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__User__Detail__Topics__Ex...

1176 lines
1.9 MiB

(self.webpackChunk=self.webpackChunk||[]).push([[2806],{88540:function(){"use strict"},42271:function(){"use strict"},15547:function(un,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"}},74470:function(un,Gn){"use strict";Gn.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}},71584:function(){"use strict";function un(Nt,et,nt,ct){nt===void 0&&(nt=0),ct===void 0&&(ct=1/0),this._name=Nt,this._defaultValue=et,this._minimum=nt,this._maximum=ct}Object.defineProperty(un.prototype,"name",{get:function(){return this._name},set:function(Nt){if(typeof Nt!="string"||Nt==="")throw new Error("Shape name must be a valid string.");this._name=Nt}}),Object.defineProperty(un.prototype,"defaultValue",{get:function(){return this._defaultValue},set:function(Nt){if(typeof Nt!="number"||isNaN(Nt))throw new Error("The default value must be a real number, not: "+Nt);this._defaultValue=Nt}}),Object.defineProperty(un.prototype,"minimum",{get:function(){return this._minimum},set:function(Nt){if(typeof Nt!="number"||isNaN(Nt))throw new Error("Minimum must be a real number, not: "+Nt);this._minimum=Nt}}),Object.defineProperty(un.prototype,"maximum",{get:function(){return this._maximum},set:function(Nt){if(typeof Nt!="number"||isNaN(Nt))throw new Error("Maximum must be a real number, not: "+Nt);this._maximum=Nt}}),go.Shape._FigureParameters={},go.Shape.getFigureParameter=function(Nt,et){var nt=go.Shape._FigureParameters[Nt];return nt?nt[et]:null},go.Shape.setFigureParameter=function(Nt,et,nt){if(!(nt instanceof un))throw new Error("Third argument to Shape.setFigureParameter is not FigureParameter: "+nt);if(nt.defaultValue<nt.minimum||nt.defaultValue>nt.maximum)throw new Error("defaultValue must be between minimum and maximum, not: "+nt.defaultValue);var ct=go.Shape._FigureParameters[Nt];ct||(ct=[],go.Shape._FigureParameters[Nt]=ct),ct[et]=nt};var Gn=[];function Yt(Nt,et){var nt=Gn.pop();return nt===void 0?new go.Point(Nt,et):(nt.x=Nt,nt.y=et,nt)}function St(){var Nt=Gn.pop();return Nt===void 0?new go.Point:Nt}function fe(Nt){Gn.push(Nt)}function be(Nt,et,nt,ct,lt,pt,vt,Lt,bt){bt||(bt=new go.Point);var Gt=Nt-nt,jt=lt-vt,ne=NaN,ie=NaN;if(Gt===0)if(jt===0)Nt===nt&&(ne=Nt,ie=et);else{var te=(pt-Lt)/jt,Ge=pt-te*lt;ne=Nt,ie=te*ne+Ge}else if(jt===0){var pe=(et-ct)/Gt,Je=et-pe*Nt;ne=lt,ie=pe*ne+Je}else{var pe=(et-ct)/Gt,te=(pt-Lt)/jt,Je=et-pe*Nt,Ge=pt-te*lt;ne=(Ge-Je)/(pe-te),ie=pe*ne+Je}return bt.x=ne,bt.y=ie,bt}function Xe(Nt,et,nt,ct,lt,pt,vt,Lt,bt,Gt,jt,ne,ie,te){var Ge=1-bt,pe=bt,Je=Nt*Ge+nt*pe,Ye=et*Ge+ct*pe,hn=nt*Ge+lt*pe,Fn=ct*Ge+pt*pe,vn=lt*Ge+vt*pe,pi=pt*Ge+Lt*pe,yn=Je*Ge+hn*pe,ce=Ye*Ge+Fn*pe,Kt=hn*Ge+vn*pe,tn=Fn*Ge+pi*pe,Yn=yn*Ge+Kt*pe,Dn=ce*Ge+tn*pe;Gt.x=Je,Gt.y=Ye,jt.x=yn,jt.y=ce,ne.x=Yn,ne.y=Dn,ie.x=Kt,ie.y=tn,te.x=vn,te.y=pi}var ge=new go.Spot(.156,.156),re=new go.Spot(.844,.844),se=4*((Math.sqrt(2)-1)/3);go.Shape.setFigureParameter("RoundedRectangle",0,new un("CornerRounding",5)),go.Shape.defineFigureGenerator("RoundedRectangle",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;(isNaN(ct)||ct<0)&&(ct=5),ct=Math.min(ct,et/3),ct=Math.min(ct,nt/3);var lt=ct*se,pt=new go.Geometry().add(new go.PathFigure(ct,0,!0).add(new go.PathSegment(go.PathSegment.Line,et-ct,0)).add(new go.PathSegment(go.PathSegment.Bezier,et,ct,et-lt,0,et,lt)).add(new go.PathSegment(go.PathSegment.Line,et,nt-ct)).add(new go.PathSegment(go.PathSegment.Bezier,et-ct,nt,et,nt-lt,et-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,ct,nt)).add(new go.PathSegment(go.PathSegment.Bezier,0,nt-ct,lt,nt,0,nt-lt)).add(new go.PathSegment(go.PathSegment.Line,0,ct)).add(new go.PathSegment(go.PathSegment.Bezier,ct,0,0,lt,lt,0).close()));return lt>1&&(pt.spot1=new go.Spot(0,0,lt,lt),pt.spot2=new go.Spot(1,1,-lt,-lt)),pt}),go.Shape.defineFigureGenerator("Border","RoundedRectangle"),go.Shape.defineFigureGenerator("TriangleRight",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())).setSpots(0,.25,.5,.75)}),go.Shape.defineFigureGenerator("TriangleDown",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,.5*et,nt).close())).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("TriangleLeft",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(et,nt).add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,et,0).close())).setSpots(.5,.25,1,.75)}),go.Shape.defineFigureGenerator("TriangleUp",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(et,nt).add(new go.PathSegment(go.PathSegment.Line,0,nt)).add(new go.PathSegment(go.PathSegment.Line,.5*et,0).close())).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("Triangle","TriangleUp"),go.Shape.defineFigureGenerator("Diamond",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(.5*et,0).add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt).close())).setSpots(.25,.25,.75,.75)}),go.Shape.defineFigureGenerator("LineH",function(Nt,et,nt){var ct=new go.Geometry(go.Geometry.Line);return ct.startX=0,ct.startY=nt/2,ct.endX=et,ct.endY=nt/2,ct}),go.Shape.defineFigureGenerator("LineV",function(Nt,et,nt){var ct=new go.Geometry(go.Geometry.Line);return ct.startX=et/2,ct.startY=0,ct.endX=et/2,ct.endY=nt,ct}),go.Shape.defineFigureGenerator("BarH","Rectangle"),go.Shape.defineFigureGenerator("BarV","Rectangle"),go.Shape.defineFigureGenerator("MinusLine","LineH"),go.Shape.defineFigureGenerator("PlusLine",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,nt/2,!1).add(new go.PathSegment(go.PathSegment.Line,et,nt/2)).add(new go.PathSegment(go.PathSegment.Move,et/2,0)).add(new go.PathSegment(go.PathSegment.Line,et/2,nt)))}),go.Shape.defineFigureGenerator("XLine",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,nt,!1).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Move,0,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)))}),go.Shape.defineFigureGenerator("LineRight",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(.25*et,0,!1).add(new go.PathSegment(go.PathSegment.Line,.75*et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,.25*et,nt)))}),go.Shape.defineFigureGenerator("LineDown",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,.25*nt,!1).add(new go.PathSegment(go.PathSegment.Line,.5*et,.75*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)))}),go.Shape.defineFigureGenerator("LineLeft",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(.75*et,0,!1).add(new go.PathSegment(go.PathSegment.Line,.25*et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,.75*et,nt)))}),go.Shape.defineFigureGenerator("LineUp",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,.75*nt,!1).add(new go.PathSegment(go.PathSegment.Line,.5*et,.25*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.75*nt)))}),go.Shape.defineFigureGenerator("AsteriskLine",function(Nt,et,nt){var ct=.2/Math.SQRT2;return new go.Geometry().add(new go.PathFigure(ct*et,(1-ct)*nt,!1).add(new go.PathSegment(go.PathSegment.Line,(1-ct)*et,ct*nt)).add(new go.PathSegment(go.PathSegment.Move,ct*et,ct*nt)).add(new go.PathSegment(go.PathSegment.Line,(1-ct)*et,(1-ct)*nt)).add(new go.PathSegment(go.PathSegment.Move,0,nt/2)).add(new go.PathSegment(go.PathSegment.Line,et,nt/2)).add(new go.PathSegment(go.PathSegment.Move,et/2,0)).add(new go.PathSegment(go.PathSegment.Line,et/2,nt)))}),go.Shape.defineFigureGenerator("CircleLine",function(Nt,et,nt){var ct=et/2,lt=new go.Geometry().add(new go.PathFigure(et,et/2,!1).add(new go.PathSegment(go.PathSegment.Arc,0,360,ct,ct,ct,ct).close()));return lt.spot1=ge,lt.spot2=re,lt.defaultStretch=go.GraphObject.Uniform,lt}),go.Shape.defineFigureGenerator("Line1",function(Nt,et,nt){var ct=new go.Geometry(go.Geometry.Line);return ct.startX=0,ct.startY=0,ct.endX=et,ct.endY=nt,ct}),go.Shape.defineFigureGenerator("Line2",function(Nt,et,nt){var ct=new go.Geometry(go.Geometry.Line);return ct.startX=et,ct.startY=0,ct.endX=0,ct.endY=nt,ct}),go.Shape.defineFigureGenerator("Curve1",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,et,nt,se*et,0,et,(1-se)*nt)))}),go.Shape.defineFigureGenerator("Curve2",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,et,nt,0,se*nt,(1-se)*et,nt)))}),go.Shape.defineFigureGenerator("Curve3",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(et,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,nt,et,se*nt,se*et,nt)))}),go.Shape.defineFigureGenerator("Curve4",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(et,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,nt,(1-se)*et,0,0,(1-se)*nt)))}),go.Shape.defineFigureGenerator("TriangleDownLeft",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())).setSpots(0,.5,.5,1)}),go.Shape.defineFigureGenerator("TriangleDownRight",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(et,0,!0).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())).setSpots(.5,.5,1,1)}),go.Shape.defineFigureGenerator("TriangleUpLeft",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())).setSpots(0,0,.5,.5)}),go.Shape.defineFigureGenerator("TriangleUpRight",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt).close())).setSpots(.5,0,1,.5)}),go.Shape.defineFigureGenerator("RightTriangle","TriangleDownLeft"),go.Shape.setFigureParameter("Parallelogram1",0,new un("Indent",.1,-.99,.99)),go.Shape.defineFigureGenerator("Parallelogram1",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)?ct=.1:ct<-1?ct=-1:ct>1&&(ct=1);var lt=Math.abs(ct)*et;if(ct===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=et,pt.endY=nt,pt}else{var pt=new go.Geometry;return ct>0?pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et-lt,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,lt,nt).close())),lt<et/2&&pt.setSpots(lt/et,0,(et-lt)/et,1),pt}}),go.Shape.defineFigureGenerator("Parallelogram","Parallelogram1"),go.Shape.setFigureParameter("Parallelogram2",0,new un("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("Parallelogram2",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)?ct=10:ct<-et?ct=-et:ct>et&&(ct=et);var lt=Math.abs(ct);if(ct===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=et,pt.endY=nt,pt}else{var pt=new go.Geometry;return ct>0?pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et-lt,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,lt,nt).close())),lt<et/2&&pt.setSpots(lt/et,0,(et-lt)/et,1),pt}}),go.Shape.setFigureParameter("Trapezoid1",0,new un("Indent",.2,-.99,.99)),go.Shape.defineFigureGenerator("Trapezoid1",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)?ct=.2:ct<.5?ct=-.5:ct>.5&&(ct=.5);var lt=Math.abs(ct)*et;if(ct===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=et,pt.endY=nt,pt}else{var pt=new go.Geometry;return ct>0?pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,et-lt,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,lt,nt).close())),lt<et/2&&pt.setSpots(lt/et,0,(et-lt)/et,1),pt}}),go.Shape.defineFigureGenerator("Trapezoid","Trapezoid1"),go.Shape.setFigureParameter("Trapezoid2",0,new un("Indent",20,-1/0,1/0)),go.Shape.defineFigureGenerator("Trapezoid2",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)?ct=20:ct<-et?ct=-et/2:ct>et&&(ct=et/2);var lt=Math.abs(ct);if(ct===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=et,pt.endY=nt,pt}else{var pt=new go.Geometry;return ct>0?pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,et-lt,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,lt,nt).close())),lt<et/2&&pt.setSpots(lt/et,0,(et-lt)/et,1),pt}}),go.Shape.setFigureParameter("ManualOperation",0,new un("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("ManualOperation",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)?ct=10:ct<-et?ct=-et/2:ct>et&&(ct=et/2);var lt=Math.abs(ct);if(ct===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=et,pt.endY=nt,pt}else{var pt=new go.Geometry;return ct>0?pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,lt,nt).close())):pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,et-lt,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close())),lt<et/2&&pt.setSpots(lt/et,0,(et-lt)/et,1),pt}});var Ie=[];function Le(){var Nt=Ie.pop();return Nt===void 0?[]:Nt}function $t(Nt){Nt.length=0,Ie.push(Nt)}function Ze(Nt){for(var et=Le(),nt=.5,ct=.5,lt=Math.PI*1.5,pt=0,vt=0;vt<Nt;vt++)pt=2*Math.PI/Nt*vt+lt,et[vt]=new go.Point(ct+nt*Math.cos(pt),ct+nt*Math.sin(pt));return et.push(et[0]),et}function ae(Nt){var et=Re(Nt),nt=Le();nt[0]=et[0];for(var ct=1,lt=1;ct<et.length;ct+=2,lt+=3)nt[lt]=et[ct],nt[lt+1]=et[ct],nt[lt+2]=et[ct+1];return $t(et),nt}function Re(Nt){for(var et=Ze(Nt),nt=Le(),ct=Math.floor(et.length/2),lt=et.length-1,pt=Nt%2===0?2:1,vt=0;vt<lt;vt++){var Lt=et[vt],bt=et[vt+1],Gt=et[(ct+vt-1)%lt],jt=et[(ct+vt+pt)%lt];nt[vt*2]=Lt,nt[vt*2+1]=be(Lt.x,Lt.y,Gt.x,Gt.y,bt.x,bt.y,jt.x,jt.y,new go.Point)}return nt[nt.length]=nt[0],$t(et),nt}go.Shape.defineFigureGenerator("Pentagon",function(Nt,et,nt){var ct=Ze(5),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<5;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ct[vt].x*et,ct[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ct[0].x*et,ct[0].y*nt).close()),$t(ct),lt.spot1=new go.Spot(.2,.22),lt.spot2=new go.Spot(.8,.9),lt}),go.Shape.defineFigureGenerator("Hexagon",function(Nt,et,nt){var ct=Ze(6),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<6;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ct[vt].x*et,ct[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ct[0].x*et,ct[0].y*nt).close()),$t(ct),lt.spot1=new go.Spot(.07,.25),lt.spot2=new go.Spot(.93,.75),lt}),go.Shape.defineFigureGenerator("Heptagon",function(Nt,et,nt){var ct=Ze(7),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<7;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ct[vt].x*et,ct[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ct[0].x*et,ct[0].y*nt).close()),$t(ct),lt.spot1=new go.Spot(.2,.15),lt.spot2=new go.Spot(.8,.85),lt}),go.Shape.defineFigureGenerator("Octagon",function(Nt,et,nt){var ct=Ze(8),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<8;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ct[vt].x*et,ct[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ct[0].x*et,ct[0].y*nt).close()),$t(ct),lt.spot1=new go.Spot(.15,.15),lt.spot2=new go.Spot(.85,.85),lt}),go.Shape.defineFigureGenerator("Nonagon",function(Nt,et,nt){var ct=Ze(9),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<9;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ct[vt].x*et,ct[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ct[0].x*et,ct[0].y*nt).close()),$t(ct),lt.spot1=new go.Spot(.17,.13),lt.spot2=new go.Spot(.82,.82),lt}),go.Shape.defineFigureGenerator("Decagon",function(Nt,et,nt){var ct=Ze(10),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<10;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ct[vt].x*et,ct[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ct[0].x*et,ct[0].y*nt).close()),$t(ct),lt.spot1=new go.Spot(.16,.16),lt.spot2=new go.Spot(.84,.84),lt}),go.Shape.defineFigureGenerator("Dodecagon",function(Nt,et,nt){var ct=Ze(12),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<12;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ct[vt].x*et,ct[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ct[0].x*et,ct[0].y*nt).close()),$t(ct),lt.spot1=new go.Spot(.16,.16),lt.spot2=new go.Spot(.84,.84),lt}),go.Shape.defineFigureGenerator("FivePointedStar",function(Nt,et,nt){var ct=Re(5),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<10;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ct[vt].x*et,ct[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ct[0].x*et,ct[0].y*nt).close()),$t(ct),lt.spot1=new go.Spot(.266,.333),lt.spot2=new go.Spot(.733,.733),lt}),go.Shape.defineFigureGenerator("SixPointedStar",function(Nt,et,nt){var ct=Re(6),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<12;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ct[vt].x*et,ct[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ct[0].x*et,ct[0].y*nt).close()),$t(ct),lt.spot1=new go.Spot(.17,.25),lt.spot2=new go.Spot(.83,.75),lt}),go.Shape.defineFigureGenerator("SevenPointedStar",function(Nt,et,nt){var ct=Re(7),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<14;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ct[vt].x*et,ct[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ct[0].x*et,ct[0].y*nt).close()),$t(ct),lt.spot1=new go.Spot(.222,.277),lt.spot2=new go.Spot(.777,.666),lt}),go.Shape.defineFigureGenerator("EightPointedStar",function(Nt,et,nt){var ct=Re(8),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<16;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ct[vt].x*et,ct[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ct[0].x*et,ct[0].y*nt).close()),$t(ct),lt.spot1=new go.Spot(.25,.25),lt.spot2=new go.Spot(.75,.75),lt}),go.Shape.defineFigureGenerator("NinePointedStar",function(Nt,et,nt){var ct=Re(9),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<18;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ct[vt].x*et,ct[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ct[0].x*et,ct[0].y*nt).close()),$t(ct),lt.spot1=new go.Spot(.222,.277),lt.spot2=new go.Spot(.777,.666),lt}),go.Shape.defineFigureGenerator("TenPointedStar",function(Nt,et,nt){var ct=Re(10),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<20;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ct[vt].x*et,ct[vt].y*nt));return pt.add(new go.PathSegment(go.PathSegment.Line,ct[0].x*et,ct[0].y*nt).close()),$t(ct),lt.spot1=new go.Spot(.281,.261),lt.spot2=new go.Spot(.723,.748),lt}),go.Shape.defineFigureGenerator("FivePointedBurst",function(Nt,et,nt){var ct=ae(5),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<ct.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ct[vt+2].x*et,ct[vt+2].y*nt,ct[vt].x*et,ct[vt].y*nt,ct[vt+1].x*et,ct[vt+1].y*nt));return pt.segments.last().close(),$t(ct),lt.spot1=new go.Spot(.222,.277),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("SixPointedBurst",function(Nt,et,nt){var ct=ae(6),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<ct.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ct[vt+2].x*et,ct[vt+2].y*nt,ct[vt].x*et,ct[vt].y*nt,ct[vt+1].x*et,ct[vt+1].y*nt));return pt.segments.last().close(),$t(ct),lt.spot1=new go.Spot(.17,.222),lt.spot2=new go.Spot(.833,.777),lt}),go.Shape.defineFigureGenerator("SevenPointedBurst",function(Nt,et,nt){var ct=ae(7),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<ct.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ct[vt+2].x*et,ct[vt+2].y*nt,ct[vt].x*et,ct[vt].y*nt,ct[vt+1].x*et,ct[vt+1].y*nt));return pt.segments.last().close(),$t(ct),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("EightPointedBurst",function(Nt,et,nt){var ct=ae(8),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<ct.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ct[vt+2].x*et,ct[vt+2].y*nt,ct[vt].x*et,ct[vt].y*nt,ct[vt+1].x*et,ct[vt+1].y*nt));return pt.segments.last().close(),$t(ct),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("NinePointedBurst",function(Nt,et,nt){var ct=ae(9),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<ct.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ct[vt+2].x*et,ct[vt+2].y*nt,ct[vt].x*et,ct[vt].y*nt,ct[vt+1].x*et,ct[vt+1].y*nt));return pt.segments.last().close(),$t(ct),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("TenPointedBurst",function(Nt,et,nt){var ct=ae(10),lt=new go.Geometry,pt=new go.PathFigure(ct[0].x*et,ct[0].y*nt,!0);lt.add(pt);for(var vt=1;vt<ct.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ct[vt+2].x*et,ct[vt+2].y*nt,ct[vt].x*et,ct[vt].y*nt,ct[vt+1].x*et,ct[vt+1].y*nt));return pt.segments.last().close(),$t(ct),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.setFigureParameter("FramedRectangle",0,new un("ThicknessX",8)),go.Shape.setFigureParameter("FramedRectangle",1,new un("ThicknessY",8)),go.Shape.defineFigureGenerator("FramedRectangle",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN,lt=Nt?Nt.parameter2:NaN;isNaN(ct)&&(ct=8),isNaN(lt)&&(lt=8);var pt=new go.Geometry,vt=new go.PathFigure(0,0,!0);return pt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ct<et/2&&lt<nt/2&&(vt.add(new go.PathSegment(go.PathSegment.Move,ct,lt)),vt.add(new go.PathSegment(go.PathSegment.Line,ct,nt-lt)),vt.add(new go.PathSegment(go.PathSegment.Line,et-ct,nt-lt)),vt.add(new go.PathSegment(go.PathSegment.Line,et-ct,lt).close())),pt.setSpots(0,0,1,1,ct,lt,-ct,-lt),pt}),go.Shape.setFigureParameter("Ring",0,new un("Thickness",8)),go.Shape.defineFigureGenerator("Ring",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;(isNaN(ct)||ct<0)&&(ct=8);var lt=et/2,pt=new go.Geometry,vt=new go.PathFigure(et,et/2,!0);pt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Arc,0,360,lt,lt,lt,lt).close());var Lt=Math.max(lt-ct,0);return Lt>0&&(vt.add(new go.PathSegment(go.PathSegment.Move,et/2+Lt,et/2)),vt.add(new go.PathSegment(go.PathSegment.Arc,0,-360,lt,lt,Lt,Lt).close())),pt.spot1=ge,pt.spot2=re,pt.defaultStretch=go.GraphObject.Uniform,pt}),go.Shape.defineFigureGenerator("Cloud",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(.08034461*et,.1944299*nt,!0).add(new go.PathSegment(go.PathSegment.Bezier,.2008615*et,.05349299*nt,-.09239631*et,.07836421*nt,.1406031*et,-.0542823*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.4338609*et,.074219*nt,.2450511*et,-.00697547*nt,.3776197*et,-.01112067*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.6558228*et,.07004196*nt,.4539471*et,0,.6066018*et,-.02526587*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.8921095*et,.08370865*nt,.6914277*et,-.01904177*nt,.8921095*et,-.01220843*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.9147671*et,.3194596*nt,1.036446*et,.04105738*nt,1.020377*et,.3022052*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.9082935*et,.562044*nt,1.04448*et,.360238*nt,.992256*et,.5219009*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.9212406*et,.8217117*nt,1.032337*et,.5771781*nt,1.018411*et,.8120651*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.7592566*et,.9156953*nt,1.028411*et,.9571472*nt,.8556702*et,1.052487*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.5101666*et,.9310455*nt,.7431877*et,1.009325*nt,.5624123*et,1.021761*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.2609328*et,.9344623*nt,.4820677*et,1.031761*nt,.3030112*et,1.002796*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*et,.870098*nt,.2329994*et,1.01518*nt,.03213784*et,1.01518*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.06829292*et,.6545475*nt,-.02812061*et,.9032597*nt,-.01205169*et,.6835638*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.06427569*et,.4265613*nt,-.01812061*et,.6089503*nt,-.00606892*et,.4555777*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*et,.1944299*nt,-.01606892*et,.3892545*nt,-.01205169*et,.1944299*nt))).setSpots(.1,.1,.9,.9)}),go.Shape.defineFigureGenerator("StopSign",function(Nt,et,nt){var ct=1/(Math.SQRT2+2);return new go.Geometry().add(new go.PathFigure(ct*et,0,!0).add(new go.PathSegment(go.PathSegment.Line,(1-ct)*et,0)).add(new go.PathSegment(go.PathSegment.Line,et,ct*nt)).add(new go.PathSegment(go.PathSegment.Line,et,(1-ct)*nt)).add(new go.PathSegment(go.PathSegment.Line,(1-ct)*et,nt)).add(new go.PathSegment(go.PathSegment.Line,ct*et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,(1-ct)*nt)).add(new go.PathSegment(go.PathSegment.Line,0,ct*nt).close())).setSpots(ct/2,ct/2,1-ct/2,1-ct/2)}),go.Shape.setFigureParameter("Pie",0,new un("Start",0,-360,360)),go.Shape.setFigureParameter("Pie",1,new un("Sweep",315,-360,360)),go.Shape.defineFigureGenerator("Pie",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN,lt=Nt?Nt.parameter2:NaN;isNaN(ct)&&(ct=0),isNaN(lt)&&(lt=315);var pt=ct%360;pt<0&&(pt+=360);var vt=lt%360,Lt=Math.min(et,nt)/2;return new go.Geometry().add(new go.PathFigure(Lt,Lt).add(new go.PathSegment(go.PathSegment.Arc,pt,vt,Lt,Lt,Lt,Lt).close()))}),go.Shape.defineFigureGenerator("PiePiece",function(Nt,et,nt){var ct=se/Math.SQRT2*.5,lt=Math.SQRT2/2,pt=1-Math.SQRT2/2;return new go.Geometry().add(new go.PathFigure(et,nt,!0).add(new go.PathSegment(go.PathSegment.Bezier,lt*et,pt*nt,et,(1-ct)*nt,(lt+ct)*et,(pt+ct)*nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close()))}),go.Shape.setFigureParameter("ThickCross",0,new un("Thickness",30)),go.Shape.defineFigureGenerator("ThickCross",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;(isNaN(ct)||ct<0)&&(ct=30);var lt=Math.min(ct,et)/2,pt=et/2,vt=nt/2;return new go.Geometry().add(new go.PathFigure(pt-lt,0,!0).add(new go.PathSegment(go.PathSegment.Line,pt+lt,0)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,et,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,et,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,nt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,0,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,0,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,vt-lt).close()))}),go.Shape.setFigureParameter("ThinCross",0,new un("Thickness",10)),go.Shape.defineFigureGenerator("ThinCross",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;(isNaN(ct)||ct<0)&&(ct=10);var lt=Math.min(ct,et)/2,pt=et/2,vt=nt/2;return new go.Geometry().add(new go.PathFigure(pt-lt,0,!0).add(new go.PathSegment(go.PathSegment.Line,pt+lt,0)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,et,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,et,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,nt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,nt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,0,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,0,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,vt-lt).close()))}),go.Shape.setFigureParameter("ThickX",0,new un("Thickness",30)),go.Shape.defineFigureGenerator("ThickX",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;if((isNaN(ct)||ct<0)&&(ct=30),et===0||nt===0){var lt=new go.Geometry(go.Geometry.Rectangle);return lt.startX=0,lt.startY=0,lt.endX=et,lt.endY=nt,lt}else{var pt=et/2,vt=nt/2,Lt=Math.atan2(nt,et),bt=ct-Math.min(Math.cos(Lt)*ct/2,pt),Gt=ct-Math.min(Math.sin(Lt)*ct/2,vt),lt=new go.Geometry,jt=new go.PathFigure(bt,0,!0);return lt.add(jt),jt.add(new go.PathSegment(go.PathSegment.Line,pt,.2*nt)),jt.add(new go.PathSegment(go.PathSegment.Line,et-bt,0)),jt.add(new go.PathSegment(go.PathSegment.Line,et,Gt)),jt.add(new go.PathSegment(go.PathSegment.Line,.8*et,vt)),jt.add(new go.PathSegment(go.PathSegment.Line,et,nt-Gt)),jt.add(new go.PathSegment(go.PathSegment.Line,et-bt,nt)),jt.add(new go.PathSegment(go.PathSegment.Line,pt,.8*nt)),jt.add(new go.PathSegment(go.PathSegment.Line,bt,nt)),jt.add(new go.PathSegment(go.PathSegment.Line,0,nt-Gt)),jt.add(new go.PathSegment(go.PathSegment.Line,.2*et,vt)),jt.add(new go.PathSegment(go.PathSegment.Line,0,Gt).close()),lt}}),go.Shape.setFigureParameter("ThinX",0,new un("Thickness",10)),go.Shape.defineFigureGenerator("ThinX",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;(isNaN(ct)||ct<0)&&(ct=10);var lt=new go.Geometry,pt=new go.PathFigure(.1*et,0,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.1*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.9*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.9*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.1*nt).close()),lt}),go.Shape.setFigureParameter("SquareIBeam",0,new un("BeamWidth",.2,.1,.9)),go.Shape.defineFigureGenerator("SquareIBeam",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=.2);var lt=new go.Geometry,pt=new go.PathFigure(0,0,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,ct*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5+ct/2)*et,ct*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5+ct/2)*et,(1-ct)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,(1-ct)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,(1-ct)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5-ct/2)*et,(1-ct)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5-ct/2)*et,ct*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,ct*nt).close()),lt}),go.Shape.setFigureParameter("RoundedIBeam",0,new un("Curviness",.5,.05,.65)),go.Shape.defineFigureGenerator("RoundedIBeam",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=.5);var lt=new go.Geometry,pt=new go.PathFigure(0,0,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Bezier,et,nt,Math.abs(1-ct)*et,.25*nt,Math.abs(1-ct)*et,.75*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ct*et,.75*nt,ct*et,.25*nt).close()),lt}),go.Shape.defineFigureGenerator("HalfEllipse",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,se*et,0,et,(.5-se/2)*nt)).add(new go.PathSegment(go.PathSegment.Bezier,0,nt,et,(.5+se/2)*nt,se*et,nt).close())).setSpots(0,.156,.844,.844)}),go.Shape.defineFigureGenerator("Crescent",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,nt,et,0,et,nt)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.5*et,.75*nt,.5*et,.25*nt).close())).setSpots(.311,.266,.744,.744)}),go.Shape.defineFigureGenerator("Heart",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(.5*et,nt,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,.3*nt,.1*et,.8*nt,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.3*nt,0,0,.45*et,0)).add(new go.PathSegment(go.PathSegment.Bezier,et,.3*nt,.55*et,0,et,0)).add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,.5*nt,.9*et,.8*nt).close())).setSpots(.14,.29,.86,.78)}),go.Shape.defineFigureGenerator("Spade",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(.5*et,0,!0).add(new go.PathSegment(go.PathSegment.Line,.51*et,.01*nt)).add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,.6*et,.2*nt,et,.25*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.55*et,.7*nt,et,.8*nt,.6*et,.8*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.75*et,nt,.5*et,.75*nt,.55*et,.95*nt)).add(new go.PathSegment(go.PathSegment.Line,.25*et,nt)).add(new go.PathSegment(go.PathSegment.Bezier,.45*et,.7*nt,.45*et,.95*nt,.5*et,.75*nt)).add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,.4*et,.8*nt,0,.8*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.49*et,.01*nt,0,.25*nt,.4*et,.2*nt).close())).setSpots(.14,.26,.86,.78)}),go.Shape.defineFigureGenerator("Club",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.4*et,.6*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.15*et,nt,.5*et,.75*nt,.45*et,.95*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.85*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.6*et,.6*nt,.55*et,.95*nt,.5*et,.75*nt));var pt=.2,vt=.3,Lt=0,bt=pt*se;return lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5+pt+Lt)*nt,(.5-pt+vt)*et,(.5+bt+Lt)*nt,(.5-bt+vt)*et,(.5+pt+Lt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pt+vt)*et,(.5+Lt)*nt,(.5+bt+vt)*et,(.5+pt+Lt)*nt,(.5+pt+vt)*et,(.5+bt+Lt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5-pt+Lt)*nt,(1-.5+pt+vt)*et,(.5-bt+Lt)*nt,(.5+bt+vt)*et,(.5-pt+Lt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.65*et,.36771243*nt,(.5-bt+vt)*et,(.5-pt+Lt)*nt,(.5-pt+vt+.05)*et,(.5-bt+Lt-.02)*nt)),pt=.2,vt=0,Lt=-.3,bt=pt*se,lt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pt+vt)*et,(.5+Lt)*nt,(.5+bt+vt)*et,(.5+pt+Lt)*nt,(.5+pt+vt)*et,(.5+bt+Lt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5-pt+Lt)*nt,(1-.5+pt+vt)*et,(.5-bt+Lt)*nt,(.5+bt+vt)*et,(.5-pt+Lt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pt+vt)*et,(.5+Lt)*nt,(.5-bt+vt)*et,(.5-pt+Lt)*nt,(.5-pt+vt)*et,(.5-bt+Lt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-bt+vt)*et,(.5+pt+Lt)*nt,(.5-pt+vt)*et,(.5+bt+Lt)*nt,(.5-bt+vt)*et,(.5+pt+Lt)*nt)),pt=.2,vt=-.3,Lt=0,bt=pt*se,lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5-pt+Lt)*nt,(1-.5+pt+vt-.05)*et,(.5-bt+Lt-.02)*nt,(.5+bt+vt)*et,(.5-pt+Lt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pt+vt)*et,(.5+Lt)*nt,(.5-bt+vt)*et,(.5-pt+Lt)*nt,(.5-pt+vt)*et,(.5-bt+Lt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5+pt+Lt)*nt,(.5-pt+vt)*et,(.5+bt+Lt)*nt,(.5-bt+vt)*et,(.5+pt+Lt)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.4*et,.6*nt,(.5+bt+vt)*et,(.5+pt+Lt)*nt,(.5+pt+vt)*et,(.5+bt+Lt)*nt).close()),ct.setSpots(.06,.33,.93,.68),ct}),go.Shape.defineFigureGenerator("YinYang",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et*.5,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,270,180,et*.5,et*.5,et*.5,et*.5)),lt.add(new go.PathSegment(go.PathSegment.Arc,90,-180,et*.5,et*.75,et*.25,et*.25)),lt.add(new go.PathSegment(go.PathSegment.Arc,90,180,et*.5,et*.25,et*.25,et*.25));var pt=.1,vt=.5,Lt=.25;return lt.add(new go.PathSegment(go.PathSegment.Move,(vt+pt)*et,Lt*nt)),lt.add(new go.PathSegment(go.PathSegment.Arc,0,-360,et*vt,nt*Lt,pt*et,pt*et).close()),lt=new go.PathFigure(et*.5,0,!1),ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,270,-180,et*.5,et*.5,et*.5,et*.5)),Lt=.75,lt=new go.PathFigure((vt+pt)*et,Lt*nt,!0),ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,0,360,et*vt,nt*Lt,pt*et,pt*et).close()),ct.defaultStretch=go.GraphObject.Uniform,ct}),go.Shape.defineFigureGenerator("Peace",function(Nt,et,nt){var ct=.8535533905932737,lt=.5*et,pt=.5*nt;return new go.Geometry().add(new go.PathFigure(lt,0,!1).add(new go.PathSegment(go.PathSegment.Arc,270,360,lt,pt,lt,pt)).add(new go.PathSegment(go.PathSegment.Line,lt,nt)).add(new go.PathSegment(go.PathSegment.Move,lt,pt)).add(new go.PathSegment(go.PathSegment.Line,(1-ct)*et,ct*nt)).add(new go.PathSegment(go.PathSegment.Move,lt,pt)).add(new go.PathSegment(go.PathSegment.Line,ct*et,ct*nt)))}),go.Shape.defineFigureGenerator("NotAllowed",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.5,pt=.5,vt=.5,Lt=.5,bt=new go.PathFigure(vt*et,(Lt-pt)*nt);ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Lt*nt,(vt-lt)*et,(Lt-pt)*nt,(vt-pt)*et,(Lt-lt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+pt)*nt,(vt-pt)*et,(Lt+lt)*nt,(vt-lt)*et,(Lt+pt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Lt*nt,(vt+lt)*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt-pt)*nt,(vt+pt)*et,(Lt-lt)*nt,(vt+lt)*et,(Lt-pt)*nt)),pt=.4,lt=se*.4;var Gt=St(),jt=St(),ne=St(),ie=St();Xe(vt,Lt-pt,vt+lt,Lt-pt,vt+pt,Lt-lt,vt+pt,Lt,.42,Gt,jt,ne,ie,ie);var te=St(),Ge=St(),pe=St();Xe(vt,Lt-pt,vt+lt,Lt-pt,vt+pt,Lt-lt,vt+pt,Lt,.58,ie,ie,pe,te,Ge);var Je=St(),Ye=St(),hn=St();Xe(vt,Lt+pt,vt-lt,Lt+pt,vt-pt,Lt+lt,vt-pt,Lt,.42,Je,Ye,hn,ie,ie);var Fn=St(),vn=St(),pi=St();return Xe(vt,Lt+pt,vt-lt,Lt+pt,vt-pt,Lt+lt,vt-pt,Lt,.58,ie,ie,pi,Fn,vn),bt.add(new go.PathSegment(go.PathSegment.Move,pi.x*et,pi.y*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Lt*nt,Fn.x*et,Fn.y*nt,vn.x*et,vn.y*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt-pt)*nt,(vt-pt)*et,(Lt-lt)*nt,(vt-lt)*et,(Lt-pt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,ne.x*et,ne.y*nt,Gt.x*et,Gt.y*nt,jt.x*et,jt.y*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,pi.x*et,pi.y*nt).close()),bt.add(new go.PathSegment(go.PathSegment.Move,hn.x*et,hn.y*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,pe.x*et,pe.y*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Lt*nt,te.x*et,te.y*nt,Ge.x*et,Ge.y*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt,(vt+lt)*et,(Lt+pt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,hn.x*et,hn.y*nt,Je.x*et,Je.y*nt,Ye.x*et,Ye.y*nt).close()),fe(Gt),fe(jt),fe(ne),fe(ie),fe(te),fe(Ge),fe(pe),fe(Je),fe(Ye),fe(hn),fe(Fn),fe(vn),fe(pi),ct.defaultStretch=go.GraphObject.Uniform,ct}),go.Shape.defineFigureGenerator("Fragile",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.25*et,0)).add(new go.PathSegment(go.PathSegment.Line,.2*et,.15*nt)).add(new go.PathSegment(go.PathSegment.Line,.3*et,.25*nt)).add(new go.PathSegment(go.PathSegment.Line,.29*et,.33*nt)).add(new go.PathSegment(go.PathSegment.Line,.35*et,.25*nt)).add(new go.PathSegment(go.PathSegment.Line,.3*et,.15*nt)).add(new go.PathSegment(go.PathSegment.Line,.4*et,0)).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Bezier,.55*et,.5*nt,et,.25*nt,.75*et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,.55*et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.7*et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)).add(new go.PathSegment(go.PathSegment.Line,.3*et,nt)).add(new go.PathSegment(go.PathSegment.Line,.3*et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.45*et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.45*et,.5*nt)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*et,.5*nt,0,.25*nt).close()))}),go.Shape.setFigureParameter("HourGlass",0,new un("Thickness",30)),go.Shape.defineFigureGenerator("HourGlass",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;(isNaN(ct)||ct<0)&&(ct=30),ct>et&&(ct=et);var lt=(et-ct)/2,pt=lt+ct;return new go.Geometry().add(new go.PathFigure(pt,.5*nt).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt)).add(new go.PathSegment(go.PathSegment.Line,lt,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,0,0)).add(new go.PathSegment(go.PathSegment.Line,et,0).close()))}),go.Shape.defineFigureGenerator("Lightning",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,.55*nt).add(new go.PathSegment(go.PathSegment.Line,.6*et,0)).add(new go.PathSegment(go.PathSegment.Line,.3*et,.45*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.45*nt)).add(new go.PathSegment(go.PathSegment.Line,.4*et,nt)).add(new go.PathSegment(go.PathSegment.Line,.7*et,.55*nt).close()))}),go.Shape.defineFigureGenerator("GenderMale",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.4,pt=.4,vt=.5,Lt=.5,bt=St(),Gt=St(),jt=St(),ne=St(),ie=new go.PathFigure((vt-pt)*et,Lt*nt,!1);ct.add(ie),ie.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt-pt)*nt,(vt-pt)*et,(Lt-lt)*nt,(vt-lt)*et,(Lt-pt)*nt)),Xe(vt,Lt-pt,vt+lt,Lt-pt,vt+pt,Lt-lt,vt+pt,Lt,.44,jt,ne,Gt,bt,bt),ie.add(new go.PathSegment(go.PathSegment.Bezier,Gt.x*et,Gt.y*nt,jt.x*et,jt.y*nt,ne.x*et,ne.y*nt));var te=Yt(Gt.x,Gt.y);Xe(vt,Lt-pt,vt+lt,Lt-pt,vt+pt,Lt-lt,vt+pt,Lt,.56,bt,bt,Gt,jt,ne);var Ge=Yt(Gt.x,Gt.y);ie.add(new go.PathSegment(go.PathSegment.Line,(te.x*.1+.95*.9)*et,te.y*.1*nt)),ie.add(new go.PathSegment(go.PathSegment.Line,.85*et,te.y*.1*nt)),ie.add(new go.PathSegment(go.PathSegment.Line,.85*et,0)),ie.add(new go.PathSegment(go.PathSegment.Line,et,0)),ie.add(new go.PathSegment(go.PathSegment.Line,et,.15*nt)),ie.add(new go.PathSegment(go.PathSegment.Line,(Ge.x*.1+.9)*et,.15*nt)),ie.add(new go.PathSegment(go.PathSegment.Line,(Ge.x*.1+.9)*et,(Ge.y*.1+.05*.9)*nt)),ie.add(new go.PathSegment(go.PathSegment.Line,Ge.x*et,Ge.y*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Lt*nt,jt.x*et,jt.y*nt,ne.x*et,ne.y*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt,(vt+lt)*et,(Lt+pt)*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Lt*nt,(vt-lt)*et,(Lt+pt)*nt,(vt-pt)*et,(Lt+lt)*nt)),pt=.35,lt=se*.35;var pe=new go.PathFigure(vt*et,(Lt-pt)*nt,!1);ct.add(pe),pe.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Lt*nt,(vt-lt)*et,(Lt-pt)*nt,(vt-pt)*et,(Lt-lt)*nt)),pe.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+pt)*nt,(vt-pt)*et,(Lt+lt)*nt,(vt-lt)*et,(Lt+pt)*nt)),pe.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Lt*nt,(vt+lt)*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt)),pe.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt-pt)*nt,(vt+pt)*et,(Lt-lt)*nt,(vt+lt)*et,(Lt-pt)*nt));var Je=new go.PathFigure((vt-pt)*et,Lt*nt,!1);return ct.add(Je),fe(bt),fe(Gt),fe(jt),fe(ne),fe(te),fe(Ge),ct.spot1=new go.Spot(.202,.257),ct.spot2=new go.Spot(.792,.739),ct.defaultStretch=go.GraphObject.Uniform,ct}),go.Shape.defineFigureGenerator("GenderFemale",function(Nt,et,nt){var ct=new go.Geometry,lt=.375,pt=0,vt=-.125,Lt=lt*se,bt=new go.PathFigure((.525+pt)*et,(.5+lt+vt)*nt,!1);ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+lt+pt)*et,(.5+vt)*nt,(.5+Lt+pt)*et,(.5+lt+vt)*nt,(.5+lt+pt)*et,(.5+Lt+vt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*et,(.5-lt+vt)*nt,(1-.5+lt+pt)*et,(.5-Lt+vt)*nt,(.5+Lt+pt)*et,(.5-lt+vt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-lt+pt)*et,(.5+vt)*nt,(.5-Lt+pt)*et,(.5-lt+vt)*nt,(.5-lt+pt)*et,(.5-Lt+vt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(.475+pt)*et,(.5+lt+vt)*nt,(.5-lt+pt)*et,(.5+Lt+vt)*nt,(.5-Lt+pt)*et,(.5+lt+vt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.475*et,.85*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.425*et,.85*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.425*et,.9*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.475*et,.9*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.475*et,nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.525*et,nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.525*et,.9*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.575*et,.9*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.575*et,.85*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.525*et,.85*nt).close()),lt=.325,pt=0,vt=-.125,Lt=lt*se;var bt=new go.PathFigure((1-.5+lt+pt)*et,(.5+vt)*nt,!1);ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*et,(.5+lt+vt)*nt,(.5+lt+pt)*et,(.5+Lt+vt)*nt,(.5+Lt+pt)*et,(.5+lt+vt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-lt+pt)*et,(.5+vt)*nt,(.5-Lt+pt)*et,(.5+lt+vt)*nt,(.5-lt+pt)*et,(.5+Lt+vt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*et,(.5-lt+vt)*nt,(.5-lt+pt)*et,(.5-Lt+vt)*nt,(.5-Lt+pt)*et,(.5-lt+vt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+lt+pt)*et,(.5+vt)*nt,(.5+Lt+pt)*et,(.5-lt+vt)*nt,(1-.5+lt+pt)*et,(.5-Lt+vt)*nt));var bt=new go.PathFigure((.525+pt)*et,(.5+lt+vt)*nt,!1);return ct.add(bt),ct.spot1=new go.Spot(.232,.136),ct.spot2=new go.Spot(.682,.611),ct.defaultStretch=go.GraphObject.Uniform,ct}),go.Shape.defineFigureGenerator("LogicImplies",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;return isNaN(ct)&&(ct=.2),new go.Geometry().add(new go.PathFigure((1-ct)*et,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,(1-ct)*et,nt)).add(new go.PathSegment(go.PathSegment.Move,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt))).setSpots(0,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicIff",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;return isNaN(ct)&&(ct=.2),new go.Geometry().add(new go.PathFigure((1-ct)*et,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,(1-ct)*et,nt)).add(new go.PathSegment(go.PathSegment.Move,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Move,ct*et,0)).add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,ct*et,nt))).setSpots(.2,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicNot",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)))}),go.Shape.defineFigureGenerator("LogicAnd",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,nt,!1).add(new go.PathSegment(go.PathSegment.Line,.5*et,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt))).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("LogicOr",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)).add(new go.PathSegment(go.PathSegment.Line,et,0))).setSpots(.219,0,.78,.409)}),go.Shape.defineFigureGenerator("LogicXor",function(Nt,et,nt){var ct=new go.Geometry().add(new go.PathFigure(.5*et,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)).add(new go.PathSegment(go.PathSegment.Move,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Arc,0,360,.5*et,.5*nt,.5*et,.5*nt)));return ct.defaultStretch=go.GraphObject.Uniform,ct}),go.Shape.defineFigureGenerator("LogicTruth",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Move,.5*et,0)).add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)))}),go.Shape.defineFigureGenerator("LogicFalsity",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,nt,!1).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Move,.5*et,nt)).add(new go.PathSegment(go.PathSegment.Line,.5*et,0)))}),go.Shape.defineFigureGenerator("LogicThereExists",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Move,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt)))}),go.Shape.defineFigureGenerator("LogicForAll",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Move,.25*et,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,.75*et,.5*nt))).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("LogicIsDefinedAs",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Move,0,.5*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)).add(new go.PathSegment(go.PathSegment.Move,0,nt)).add(new go.PathSegment(go.PathSegment.Line,et,nt))).setSpots(.01,.01,.99,.49)}),go.Shape.defineFigureGenerator("LogicIntersect",function(Nt,et,nt){var ct=.5;return new go.Geometry().add(new go.PathFigure(0,nt,!1).add(new go.PathSegment(go.PathSegment.Line,0,ct*nt)).add(new go.PathSegment(go.PathSegment.Arc,180,180,ct*et,ct*nt,ct*et,ct*nt)).add(new go.PathSegment(go.PathSegment.Line,et,nt))).setSpots(0,.5,1,1)}),go.Shape.defineFigureGenerator("LogicUnion",function(Nt,et,nt){var ct=.5;return new go.Geometry().add(new go.PathFigure(et,0,!1).add(new go.PathSegment(go.PathSegment.Line,et,ct*nt)).add(new go.PathSegment(go.PathSegment.Arc,0,180,ct*et,ct*nt,ct*et,ct*nt)).add(new go.PathSegment(go.PathSegment.Line,0,0))).setSpots(0,0,1,.5)}),go.Shape.setFigureParameter("Arrow",0,new un("ArrowheadWidth",.3,.01,.99)),go.Shape.setFigureParameter("Arrow",1,new un("TailHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("Arrow",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=.3);var lt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=.3);var pt=(1-ct)*et,vt=(.5-lt/2)*nt,Lt=(.5+lt/2)*nt,bt=new go.Geometry,Gt=new go.PathFigure(0,vt,!0);bt.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Line,pt,vt)),Gt.add(new go.PathSegment(go.PathSegment.Line,pt,0)),Gt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),Gt.add(new go.PathSegment(go.PathSegment.Line,pt,nt)),Gt.add(new go.PathSegment(go.PathSegment.Line,pt,Lt)),Gt.add(new go.PathSegment(go.PathSegment.Line,0,Lt).close()),bt.spot1=new go.Spot(0,vt/nt);var jt=be(0,Lt/nt,1,Lt/nt,pt/et,1,1,.5,St());return bt.spot2=new go.Spot(jt.x,jt.y),fe(jt),bt}),go.Shape.setFigureParameter("Arrow2",0,new un("ArrowheadWidth",30)),go.Shape.setFigureParameter("Arrow2",0,new un("TailHeight",30)),go.Shape.defineFigureGenerator("Arrow2",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=30),ct>et&&(ct=et);var lt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=30),lt=Math.min(lt,nt/2);var pt=et-ct,vt=(nt-lt)/2,Lt=vt+lt,bt=new go.Geometry,Gt=new go.PathFigure(0,vt,!0);bt.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Line,pt,vt)),Gt.add(new go.PathSegment(go.PathSegment.Line,pt,0)),Gt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),Gt.add(new go.PathSegment(go.PathSegment.Line,pt,nt)),Gt.add(new go.PathSegment(go.PathSegment.Line,pt,Lt)),Gt.add(new go.PathSegment(go.PathSegment.Line,0,Lt).close()),bt.spot1=new go.Spot(0,vt/nt);var jt=be(0,Lt/nt,1,Lt/nt,pt/et,1,1,.5,St());return bt.spot2=new go.Spot(jt.x,jt.y),fe(jt),bt}),go.Shape.defineFigureGenerator("Chevron",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt).close()),ct}),go.Shape.defineFigureGenerator("DoubleArrow",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,.214*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,1*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,.786*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,1*nt).close()),ct}),go.Shape.setFigureParameter("DoubleEndArrow",0,new un("ConnecterHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("DoubleEndArrow",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=.3);var lt=(.5-ct/2)*nt,pt=(.5+ct/2)*nt,vt=new go.Geometry,Lt=new go.PathFigure(et,.5*nt,!0);vt.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,pt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,0)),Lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,lt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,lt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,0).close());var bt=be(0,.5,.3,0,0,lt/nt,.1,lt/nt,St());return vt.spot1=new go.Spot(bt.x,bt.y),bt=be(.7,1,1,.5,0,pt/nt,1,pt/nt,bt),vt.spot2=new go.Spot(bt.x,bt.y),fe(bt),vt}),go.Shape.setFigureParameter("DoubleEndArrow2",0,new un("ConnecterHeight",40)),go.Shape.setFigureParameter("DoubleEndArrow2",1,new un("ArrowHeight",100)),go.Shape.defineFigureGenerator("DoubleEndArrow2",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=40);var lt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=100);var pt=(nt-ct)/2,vt=pt+ct,Lt=(nt-lt)/2,bt=Lt+lt;(ct>nt||lt>nt)&&(lt>ct?(ct=ct*nt/lt,pt=(nt-ct)/2,vt=pt+ct,Lt=0,bt=nt):(pt=0,vt=nt,Lt=0,bt=nt));var Gt=new go.Geometry,jt=new go.PathFigure(et,.5*nt,!0);Gt.add(jt),jt.add(new go.PathSegment(go.PathSegment.Line,.7*et,bt)),jt.add(new go.PathSegment(go.PathSegment.Line,.7*et,vt)),jt.add(new go.PathSegment(go.PathSegment.Line,.3*et,vt)),jt.add(new go.PathSegment(go.PathSegment.Line,.3*et,bt)),jt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)),jt.add(new go.PathSegment(go.PathSegment.Line,.3*et,Lt)),jt.add(new go.PathSegment(go.PathSegment.Line,.3*et,pt)),jt.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),jt.add(new go.PathSegment(go.PathSegment.Line,.7*et,Lt).close());var ne=be(0,.5,.3,Lt/nt,0,pt/nt,1,pt/nt,St());return Gt.spot1=new go.Spot(ne.x,ne.y),ne=be(.7,bt/nt,1,.5,0,vt/nt,1,vt/nt,ne),Gt.spot2=new go.Spot(ne.x,ne.y),fe(ne),Gt}),go.Shape.setFigureParameter("IBeamArrow",0,new un("ConnectorHeight",.7,.51,.97)),go.Shape.defineFigureGenerator("IBeamArrow",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=.3);var lt=(.5-ct/2)*nt,pt=(.5+ct/2)*nt,vt=new go.Geometry,Lt=new go.PathFigure(et,.5*nt,!0);vt.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,pt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),Lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,0)),Lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,lt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,lt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,0).close()),vt.spot1=new go.Spot(0,lt/nt);var bt=be(.7,1,1,.5,0,pt/nt,1,pt/nt,St());return vt.spot2=new go.Spot(bt.x,bt.y),fe(bt),vt}),go.Shape.setFigureParameter("IBeamArrow2",0,new un("ConnectorHeight",40)),go.Shape.setFigureParameter("IBeamArrow2",1,new un("BeamArrowHeight",100)),go.Shape.defineFigureGenerator("IBeamArrow2",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=40);var lt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=100);var pt=(nt-ct)/2,vt=pt+ct,Lt=(nt-lt)/2,bt=Lt+lt;(ct>nt||lt>nt)&&(lt>ct?(ct=ct*nt/lt,pt=(nt-ct)/2,vt=pt+ct,Lt=0,bt=nt):(pt=0,vt=nt,Lt=0,bt=nt));var Gt=new go.Geometry,jt=new go.PathFigure(et,.5*nt,!0);Gt.add(jt),jt.add(new go.PathSegment(go.PathSegment.Line,.7*et,bt)),jt.add(new go.PathSegment(go.PathSegment.Line,.7*et,vt)),jt.add(new go.PathSegment(go.PathSegment.Line,.2*et,vt)),jt.add(new go.PathSegment(go.PathSegment.Line,.2*et,bt)),jt.add(new go.PathSegment(go.PathSegment.Line,0,bt)),jt.add(new go.PathSegment(go.PathSegment.Line,0,Lt)),jt.add(new go.PathSegment(go.PathSegment.Line,.2*et,Lt)),jt.add(new go.PathSegment(go.PathSegment.Line,.2*et,pt)),jt.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),jt.add(new go.PathSegment(go.PathSegment.Line,.7*et,Lt).close()),Gt.spot1=new go.Spot(0,pt/nt);var ne=be(.7,bt/nt,1,.5,0,vt/nt,1,vt/nt,St());return Gt.spot2=new go.Spot(ne.x,ne.y),fe(ne),Gt}),go.Shape.setFigureParameter("Pointer",0,new un("BackPoint",.1,0,.2)),go.Shape.defineFigureGenerator("Pointer",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=.1);var lt=new go.Geometry,pt=new go.PathFigure(et,.5*nt,!0);lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,ct*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,0).close()),lt.spot1=new go.Spot(ct,.35);var vt=be(.2,.65,1,.65,0,1,1,.5,St());return lt.spot2=new go.Spot(vt.x,vt.y),fe(vt),lt}),go.Shape.setFigureParameter("RoundedPointer",0,new un("RoundedEdge",.3,0,.5)),go.Shape.defineFigureGenerator("RoundedPointer",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=.3);var lt=new go.Geometry,pt=new go.PathFigure(et,.5*nt,!0);lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ct*et,.75*nt,ct*et,.25*nt).close()),lt.spot1=new go.Spot(ct,.35);var vt=be(0,.65,1,.65,0,1,1,.5,St());return lt.spot2=new go.Spot(vt.x,vt.y),fe(vt),lt}),go.Shape.setFigureParameter("SplitEndArrow",0,new un("TailHeight",.4,.01,.99)),go.Shape.defineFigureGenerator("SplitEndArrow",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=.4);var lt=(.5-ct/2)*nt,pt=(.5+ct/2)*nt,vt=new go.Geometry,Lt=new go.PathFigure(et,.5*nt,!0);vt.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),Lt.add(new go.PathSegment(go.PathSegment.Line,0,pt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.5*nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,0,lt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,lt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,0).close()),vt.spot1=new go.Spot(.2,.3);var bt=be(.7,1,1,.5,0,pt/nt,1,pt/nt,St());return vt.spot2=new go.Spot(bt.x,bt.y),fe(bt),vt}),go.Shape.setFigureParameter("SplitEndArrow2",0,new un("TailThickness",50)),go.Shape.defineFigureGenerator("SplitEndArrow2",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=50);var lt=(nt-ct)/2,pt=lt+ct;ct>nt&&(lt=0,pt=nt);var vt=new go.Geometry,Lt=new go.PathFigure(et,.5*nt,!0);vt.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),Lt.add(new go.PathSegment(go.PathSegment.Line,0,pt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.5*nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,0,lt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,lt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,0).close()),vt.spot1=new go.Spot(.2,lt/nt);var bt=be(.7,1,1,.5,0,pt/nt,1,pt/nt,St());return vt.spot2=new go.Spot(bt.x,bt.y),fe(bt),vt}),go.Shape.setFigureParameter("SquareArrow",0,new un("ArrowPoint",.7,.2,.9)),go.Shape.defineFigureGenerator("SquareArrow",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=.7);var lt=new go.Geometry,pt=new go.PathFigure(et,.5*nt,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,ct*et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,0)),pt.add(new go.PathSegment(go.PathSegment.Line,ct*et,0).close()),lt.spot1=go.Spot.TopLeft,lt.spot2=new go.Spot(ct,1),lt}),go.Shape.defineFigureGenerator("Cone1",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.5,pt=se*.1,vt=new go.PathFigure(0,.9*nt,!0);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,(.9+pt)*nt,(.5+lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*nt,(.5-lt)*et,nt,0,(.9+pt)*nt).close()),ct.spot1=new go.Spot(.25,.5),ct.spot2=new go.Spot(.75,.97),ct}),go.Shape.defineFigureGenerator("Cone2",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.9*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,.9*nt,(1-.85/.9)*et,nt,.85/.9*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.9*nt).close());var pt=new go.PathFigure(0,.9*nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Bezier,et,.9*nt,(1-.85/.9)*et,.8*nt,.85/.9*et,.8*nt)),ct.spot1=new go.Spot(.25,.5),ct.spot2=new go.Spot(.75,.82),ct}),go.Shape.defineFigureGenerator("Cube1",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.5*et,nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.15*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.15*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.85*nt).close());var pt=new go.PathFigure(.5*et,nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.15*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.15*nt)),ct.spot1=new go.Spot(0,.3),ct.spot2=new go.Spot(.5,.85),ct}),go.Shape.defineFigureGenerator("Cube2",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.3*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,0).close());var pt=new go.PathFigure(0,.3*nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Move,.7*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),ct.spot1=new go.Spot(0,.3),ct.spot2=new go.Spot(.7,1),ct}),go.Shape.defineFigureGenerator("Cylinder1",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=5),ct=Math.min(ct,nt/3);var lt=new go.Geometry,pt=se*.5,vt=new go.PathFigure(0,ct,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,0,se*ct,(.5-pt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,1*et,ct,(.5+pt)*et,0,1*et,se*ct)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt-ct)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,1*nt,1*et,nt-se*ct,(.5+pt)*et,1*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt-ct,(.5-pt)*et,1*nt,0,nt-se*ct)),vt.add(new go.PathSegment(go.PathSegment.Line,0,ct));var Lt=new go.PathFigure(et,ct,!1);return lt.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,2*ct,1*et,2*ct-se*ct,(.5+pt)*et,2*ct)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,0,ct,(.5-pt)*et,2*ct,0,2*ct-se*ct)),lt.spot1=new go.Spot(0,0,0,2*ct),lt.spot2=new go.Spot(1,1),lt}),go.Shape.defineFigureGenerator("Cylinder2",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=5),ct=Math.min(ct,nt/3);var lt=new go.Geometry,pt=se*.5,vt=new go.PathFigure(0,nt-ct,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,0,ct)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,0,se*ct,(.5-pt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,ct,(.5+pt)*et,0,et,se*ct)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt-ct)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,nt-se*ct,(.5+pt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt-ct,(.5-pt)*et,nt,0,nt-se*ct));var Lt=new go.PathFigure(0,nt-ct,!1);return lt.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt-2*ct,0,nt-ct-se*ct,(.5-pt)*et,nt-2*ct)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,et,nt-ct,(.5+pt)*et,nt-2*ct,et,nt-ct-se*ct)),lt.spot1=new go.Spot(0,0),lt.spot2=new go.Spot(1,1,0,-2*ct),lt}),go.Shape.defineFigureGenerator("Cylinder3",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=5),ct=Math.min(ct,et/3);var lt=new go.Geometry,pt=se*.5,vt=new go.PathFigure(ct,0,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et-ct,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,et-se*ct,0,et,(.5-pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et-ct,nt,et,(.5+pt)*nt,et-se*ct,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,ct,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,se*ct,nt,0,(.5+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ct,0,0,(.5-pt)*nt,se*ct,0));var Lt=new go.PathFigure(ct,0,!1);return lt.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Bezier,2*ct,.5*nt,ct+se*ct,0,2*ct,(.5-pt)*nt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,ct,nt,2*ct,(.5+pt)*nt,ct+se*ct,nt)),lt.spot1=new go.Spot(0,0,2*ct,0),lt.spot2=new go.Spot(1,1),lt}),go.Shape.defineFigureGenerator("Cylinder4",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=5),ct=Math.min(ct,et/3);var lt=new go.Geometry,pt=se*.5,vt=new go.PathFigure(et-ct,0,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,et-se*ct,0,et,(.5-pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et-ct,nt,et,(.5+pt)*nt,et-se*ct,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,ct,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,se*ct,nt,0,(.5+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ct,0,0,(.5-pt)*nt,se*ct,0)),vt.add(new go.PathSegment(go.PathSegment.Line,et-ct,0));var Lt=new go.PathFigure(et-ct,0,!1);return lt.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Bezier,et-2*ct,.5*nt,et-ct-se*ct,0,et-2*ct,(.5-pt)*nt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,et-ct,nt,et-2*ct,(.5+pt)*nt,et-ct-se*ct,nt)),lt.spot1=new go.Spot(0,0),lt.spot2=new go.Spot(1,1,-2*ct,0),lt}),go.Shape.defineFigureGenerator("Prism1",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.25*et,.25*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var pt=new go.PathFigure(.25*et,.25*nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),ct.spot1=new go.Spot(.408,.172),ct.spot2=new go.Spot(.833,.662),ct}),go.Shape.defineFigureGenerator("Prism2",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.25*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var pt=new go.PathFigure(0,nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.25*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,0,.25*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.25*et,.5*nt)),ct.spot1=new go.Spot(.25,.5),ct.spot2=new go.Spot(.75,.75),ct}),go.Shape.defineFigureGenerator("Pyramid1",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.5*et,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.75*nt).close());var pt=new go.PathFigure(.5*et,0,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),ct.spot1=new go.Spot(.25,.367),ct.spot2=new go.Spot(.75,.875),ct}),go.Shape.defineFigureGenerator("Pyramid2",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.5*et,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.85*nt).close());var pt=new go.PathFigure(.5*et,0,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.7*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.85*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.7*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.85*nt)),ct.spot1=new go.Spot(.25,.367),ct.spot2=new go.Spot(.75,.875),ct}),go.Shape.defineFigureGenerator("Actor",function(Nt,et,nt){var ct=new go.Geometry,lt=.2,pt=.1,vt=se*lt,Lt=se*pt,bt=.5,Gt=.1,jt=new go.PathFigure(bt*et,(Gt+pt)*nt,!0);ct.add(jt),jt.add(new go.PathSegment(go.PathSegment.Bezier,(bt-lt)*et,Gt*nt,(bt-vt)*et,(Gt+pt)*nt,(bt-lt)*et,(Gt+Lt)*nt)),jt.add(new go.PathSegment(go.PathSegment.Bezier,bt*et,(Gt-pt)*nt,(bt-lt)*et,(Gt-Lt)*nt,(bt-vt)*et,(Gt-pt)*nt)),jt.add(new go.PathSegment(go.PathSegment.Bezier,(bt+lt)*et,Gt*nt,(bt+vt)*et,(Gt-pt)*nt,(bt+lt)*et,(Gt-Lt)*nt)),jt.add(new go.PathSegment(go.PathSegment.Bezier,bt*et,(Gt+pt)*nt,(bt+lt)*et,(Gt+Lt)*nt,(bt+vt)*et,(Gt+pt)*nt));var ne=.05,ie=se*ne;bt=.05,Gt=.25;var te=new go.PathFigure(.5*et,.2*nt,!0);return ct.add(te),te.add(new go.PathSegment(go.PathSegment.Line,.95*et,.2*nt)),bt=.95,Gt=.25,te.add(new go.PathSegment(go.PathSegment.Bezier,(bt+ne)*et,Gt*nt,(bt+ie)*et,(Gt-ne)*nt,(bt+ne)*et,(Gt-ie)*nt)),te.add(new go.PathSegment(go.PathSegment.Line,et,.6*nt)),te.add(new go.PathSegment(go.PathSegment.Line,.85*et,.6*nt)),te.add(new go.PathSegment(go.PathSegment.Line,.85*et,.35*nt)),ne=.025,ie=se*ne,bt=.825,Gt=.35,te.add(new go.PathSegment(go.PathSegment.Bezier,bt*et,(Gt-ne)*nt,(bt+ne)*et,(Gt-ie)*nt,(bt+ie)*et,(Gt-ne)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(bt-ne)*et,Gt*nt,(bt-ie)*et,(Gt-ne)*nt,(bt-ne)*et,(Gt-ie)*nt)),te.add(new go.PathSegment(go.PathSegment.Line,.8*et,nt)),te.add(new go.PathSegment(go.PathSegment.Line,.55*et,nt)),te.add(new go.PathSegment(go.PathSegment.Line,.55*et,.7*nt)),ne=.05,ie=se*ne,bt=.5,Gt=.7,te.add(new go.PathSegment(go.PathSegment.Bezier,bt*et,(Gt-ne)*nt,(bt+ne)*et,(Gt-ie)*nt,(bt+ie)*et,(Gt-ne)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(bt-ne)*et,Gt*nt,(bt-ie)*et,(Gt-ne)*nt,(bt-ne)*et,(Gt-ie)*nt)),te.add(new go.PathSegment(go.PathSegment.Line,.45*et,nt)),te.add(new go.PathSegment(go.PathSegment.Line,.2*et,nt)),te.add(new go.PathSegment(go.PathSegment.Line,.2*et,.35*nt)),ne=.025,ie=se*ne,bt=.175,Gt=.35,te.add(new go.PathSegment(go.PathSegment.Bezier,bt*et,(Gt-ne)*nt,(bt+ne)*et,(Gt-ie)*nt,(bt+ie)*et,(Gt-ne)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(bt-ne)*et,Gt*nt,(bt-ie)*et,(Gt-ne)*nt,(bt-ne)*et,(Gt-ie)*nt)),te.add(new go.PathSegment(go.PathSegment.Line,.15*et,.6*nt)),te.add(new go.PathSegment(go.PathSegment.Line,0,.6*nt)),te.add(new go.PathSegment(go.PathSegment.Line,0,.25*nt)),ne=.05,ie=se*ne,bt=.05,Gt=.25,te.add(new go.PathSegment(go.PathSegment.Bezier,bt*et,(Gt-ne)*nt,(bt-ne)*et,(Gt-ie)*nt,(bt-ie)*et,(Gt-ne)*nt)),te.add(new go.PathSegment(go.PathSegment.Line,.5*et,.2*nt)),ct.spot1=new go.Spot(.2,.2),ct.spot2=new go.Spot(.8,.65),ct}),go.Shape.setFigureParameter("Card",0,new un("CornerCutoutSize",.2,.1,.9)),go.Shape.defineFigureGenerator("Card",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;isNaN(ct)&&(ct=.2);var lt=new go.Geometry,pt=new go.PathFigure(et,0,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,ct*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,ct*et,0).close()),lt.spot1=new go.Spot(0,ct),lt.spot2=go.Spot.BottomRight,lt}),go.Shape.defineFigureGenerator("Collate",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.5*et,.5*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt));var pt=new go.PathFigure(.5*et,.5*nt,!0);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),ct.spot1=new go.Spot(.25,0),ct.spot2=new go.Spot(.75,.25),ct}),go.Shape.defineFigureGenerator("CreateRequest",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var vt=new go.PathFigure(0,lt*nt,!1);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,lt*nt)),vt.add(new go.PathSegment(go.PathSegment.Move,0,(1-lt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,(1-lt)*nt)),ct}),go.Shape.defineFigureGenerator("Database",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.5,pt=se*.1,vt=new go.PathFigure(et,.1*nt,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,(.9+pt)*nt,(.5+lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*nt,(.5-lt)*et,nt,0,(.9+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.1*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,0,(.1-pt)*nt,(.5-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,.1*nt,(.5+lt)*et,0,et,(.1-pt)*nt));var Lt=new go.PathFigure(et,.1*nt,!1);return ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.2*nt,et,(.1+pt)*nt,(.5+lt)*et,.2*nt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*nt,(.5-lt)*et,.2*nt,0,(.1+pt)*nt)),Lt.add(new go.PathSegment(go.PathSegment.Move,et,.2*nt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.3*nt,et,(.2+pt)*nt,(.5+lt)*et,.3*nt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*nt,(.5-lt)*et,.3*nt,0,(.2+pt)*nt)),Lt.add(new go.PathSegment(go.PathSegment.Move,et,.3*nt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.4*nt,et,(.3+pt)*nt,(.5+lt)*et,.4*nt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.3*nt,(.5-lt)*et,.4*nt,0,(.3+pt)*nt)),ct.spot1=new go.Spot(0,.4),ct.spot2=new go.Spot(1,.9),ct}),go.Shape.defineFigureGenerator("DataStorage",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.75*et,nt,et,0,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*et,.9*nt,.25*et,.1*nt).close()),ct.spot1=new go.Spot(.226,0),ct.spot2=new go.Spot(.81,1),ct}),go.Shape.defineFigureGenerator("DiskStorage",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.5,pt=se*.1,vt=new go.PathFigure(et,.1*nt,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,(.9+pt)*nt,(.5+lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*nt,(.5-lt)*et,nt,0,(.9+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.1*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,0,(.1-pt)*nt,(.5-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,.1*nt,(.5+lt)*et,0,et,(.1-pt)*nt));var Lt=new go.PathFigure(et,.1*nt,!1);return ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.2*nt,et,(.1+pt)*nt,(.5+lt)*et,.2*nt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*nt,(.5-lt)*et,.2*nt,0,(.1+pt)*nt)),Lt.add(new go.PathSegment(go.PathSegment.Move,et,.2*nt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.3*nt,et,(.2+pt)*nt,(.5+lt)*et,.3*nt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*nt,(.5-lt)*et,.3*nt,0,(.2+pt)*nt)),ct.spot1=new go.Spot(0,.3),ct.spot2=new go.Spot(1,.9),ct}),go.Shape.defineFigureGenerator("Display",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.25*et,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.75*et,nt,et,0,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.25*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt).close()),ct.spot1=new go.Spot(.25,0),ct.spot2=new go.Spot(.75,1),ct}),go.Shape.defineFigureGenerator("DividedEvent",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)?lt=.2:lt<.15&&(lt=.15);var pt=se*.2,vt=new go.PathFigure(0,.2*nt,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.2*et,0,0,(.2-pt)*nt,(.2-pt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.8*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,.2*nt,(.8+pt)*et,0,et,(.2-pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,.8*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,nt,et,(.8+pt)*nt,(.8+pt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.2*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.8*nt,(.2-pt)*et,nt,0,(.8+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.2*nt));var Lt=new go.PathFigure(0,lt*nt,!1);return ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,et,lt*nt)),ct}),go.Shape.defineFigureGenerator("DividedProcess",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN;(isNaN(lt)||lt<.1)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var vt=new go.PathFigure(0,lt*nt,!1);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,lt*nt)),ct}),go.Shape.defineFigureGenerator("Document",function(Nt,et,nt){var ct=new go.Geometry;nt=nt/.8;var lt=new go.PathFigure(0,.7*nt,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*nt,.5*et,.4*nt,.5*et,nt).close()),ct.spot1=go.Spot.TopLeft,ct.spot2=new go.Spot(1,.6),ct}),go.Shape.defineFigureGenerator("ExternalOrganization",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN;(isNaN(lt)||lt<.2)&&(lt=.2);var pt=new go.PathFigure(0,0,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var vt=new go.PathFigure(lt*et,0,!1);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,0,lt*nt)),vt.add(new go.PathSegment(go.PathSegment.Move,et,lt*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Move,0,(1-lt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,lt*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Move,(1-lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,(1-lt)*nt)),ct}),go.Shape.defineFigureGenerator("ExternalProcess",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.5*et,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt).close());var pt=new go.PathFigure(.1*et,.4*nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.9*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.6*et,.1*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.1*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.4*et,.9*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.9*nt)),ct.spot1=new go.Spot(.25,.25),ct.spot2=new go.Spot(.75,.75),ct}),go.Shape.defineFigureGenerator("File",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var pt=new go.PathFigure(.75*et,0,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.25*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)),ct.spot1=new go.Spot(0,.25),ct.spot2=go.Spot.BottomRight,ct}),go.Shape.defineFigureGenerator("Interrupt",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et,.5*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt));var pt=new go.PathFigure(et,.5*nt,!1);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt));var vt=new go.PathFigure(et,.5*nt,!1);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,0)),ct.spot1=new go.Spot(0,.25),ct.spot2=new go.Spot(.5,.75),ct}),go.Shape.defineFigureGenerator("InternalStorage",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN,pt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=.1),isNaN(pt)&&(pt=.1);var vt=new go.PathFigure(0,0,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var Lt=new go.PathFigure(lt*et,0,!1);return ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,lt*et,nt)),Lt.add(new go.PathSegment(go.PathSegment.Move,0,pt*nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,et,pt*nt)),ct}),go.Shape.defineFigureGenerator("Junction",function(Nt,et,nt){var ct=new go.Geometry,lt=1/Math.SQRT2,pt=(1-1/Math.SQRT2)/2,vt=se*.5,Lt=.5,bt=new go.PathFigure(et,Lt*nt,!0);ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,Lt*et,nt,et,(Lt+vt)*nt,(Lt+vt)*et,nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,0,Lt*nt,(Lt-vt)*et,nt,0,(Lt+vt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,Lt*et,0,0,(Lt-vt)*nt,(Lt-vt)*et,0)),bt.add(new go.PathSegment(go.PathSegment.Bezier,et,Lt*nt,(Lt+vt)*et,0,et,(Lt-vt)*nt));var Gt=new go.PathFigure((pt+lt)*et,(pt+lt)*nt,!1);return ct.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Line,pt*et,pt*nt)),Gt.add(new go.PathSegment(go.PathSegment.Move,pt*et,(pt+lt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Line,(pt+lt)*et,pt*nt)),ct}),go.Shape.defineFigureGenerator("LinedDocument",function(Nt,et,nt){var ct=new go.Geometry;nt=nt/.8;var lt=new go.PathFigure(0,.7*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*nt,.5*et,.4*nt,.5*et,nt).close());var pt=new go.PathFigure(.1*et,0,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.75*nt)),ct.spot1=new go.Spot(.1,0),ct.spot2=new go.Spot(1,.6),ct}),go.Shape.defineFigureGenerator("LoopLimit",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,nt,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.25*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt).close()),ct.spot1=new go.Spot(0,.25),ct.spot2=go.Spot.BottomRight,ct}),go.Shape.defineFigureGenerator("MagneticTape",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.5,pt=.5,vt=new go.PathFigure(.5*et,nt,!0);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*nt,(pt-lt)*et,nt,0,(pt+lt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*et,0,0,(pt-lt)*nt,(pt-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,pt*nt,(pt+lt)*et,0,et,(pt-lt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,(pt+.1)*et,.9*nt,et,(pt+lt)*nt,(pt+lt)*et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),ct.spot1=new go.Spot(.15,.15),ct.spot2=new go.Spot(.85,.8),ct}),go.Shape.defineFigureGenerator("ManualInput",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.25*nt).close()),ct.spot1=new go.Spot(0,.25),ct.spot2=go.Spot.BottomRight,ct}),go.Shape.defineFigureGenerator("MessageFromUser",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.7);var pt=new go.PathFigure(0,0,!0);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,lt*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ct.spot1=go.Spot.TopLeft,ct}),go.Shape.defineFigureGenerator("MicroformProcessing",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.25);var pt=new go.PathFigure(0,0,!0);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,lt*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,(1-lt)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ct}),go.Shape.defineFigureGenerator("MicroformRecording",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.15*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ct.spot1=new go.Spot(0,.25),ct.spot2=new go.Spot(1,.75),ct}),go.Shape.defineFigureGenerator("MultiDocument",function(Nt,et,nt){var ct=new go.Geometry;nt=nt/.8;var lt=new go.PathFigure(et,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*et,.44*nt,.96*et,.47*nt,.93*et,.45*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.54*nt,.86*et,.57*nt,.83*et,.55*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*nt,.4*et,.4*nt,.4*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,0).close());var pt=new go.PathFigure(.1*et,.2*nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.2*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.54*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.1*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.1*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.44*nt)),ct.spot1=new go.Spot(0,.25),ct.spot2=new go.Spot(.8,.77),ct}),go.Shape.defineFigureGenerator("MultiProcess",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.1*et,.1*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.9*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.9*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.2*nt).close());var pt=new go.PathFigure(.2*et,.1*nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.1*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.8*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.1*et,.2*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.2*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.9*nt)),ct.spot1=new go.Spot(0,.2),ct.spot2=new go.Spot(.8,1),ct}),go.Shape.defineFigureGenerator("OfflineStorage",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=1-lt,vt=new go.PathFigure(0,0,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt).close());var Lt=new go.PathFigure(.5*lt*et,lt*nt,!1);return ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,(1-.5*lt)*et,lt*nt)),ct}),go.Shape.defineFigureGenerator("OffPageConnector",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ct.spot1=go.Spot.TopLeft,ct.spot2=new go.Spot(.75,1),ct}),go.Shape.defineFigureGenerator("Or",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.5,pt=.5,vt=new go.PathFigure(et,pt*nt,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*et,nt,et,(pt+lt)*nt,(pt+lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*nt,(pt-lt)*et,nt,0,(pt+lt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*et,0,0,(pt-lt)*nt,(pt-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,pt*nt,(pt+lt)*et,0,et,(pt-lt)*nt));var Lt=new go.PathFigure(et,.5*nt,!1);return ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)),Lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),ct}),go.Shape.defineFigureGenerator("PaperTape",function(Nt,et,nt){var ct=new go.Geometry;nt=nt/.8;var lt=new go.PathFigure(0,.7*nt,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.3*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,.3*nt,.5*et,.6*nt,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*nt,.5*et,.4*nt,.5*et,nt).close()),ct.spot1=new go.Spot(0,.49),ct.spot2=new go.Spot(1,.75),ct}),go.Shape.defineFigureGenerator("PrimitiveFromCall",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN,pt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=.1),isNaN(pt)&&(pt=.3);var vt=new go.PathFigure(0,0,!0);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*et,.5*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ct}),go.Shape.defineFigureGenerator("PrimitiveToCall",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN,pt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=.1),isNaN(pt)&&(pt=.3);var vt=new go.PathFigure(0,0,!0);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ct}),go.Shape.defineFigureGenerator("Procedure",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var vt=new go.PathFigure((1-lt)*et,0,!1);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,(1-lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Move,lt*et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,lt*et,nt)),ct}),go.Shape.defineFigureGenerator("Process",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var vt=new go.PathFigure(lt*et,0,!1);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,lt*et,nt)),ct.spot2=go.Spot.BottomRight,ct}),go.Shape.defineFigureGenerator("Sort",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.5*et,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt).close());var pt=new go.PathFigure(0,.5*nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),ct.spot1=new go.Spot(.25,.25),ct.spot2=new go.Spot(.75,.5),ct}),go.Shape.defineFigureGenerator("Start",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.25);var pt=new go.PathFigure(lt*et,0,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*et,.5*nt,.25*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*et,.5*nt,.25*et,.5*nt));var vt=new go.PathFigure(lt*et,0,!1);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,lt*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Move,(1-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-lt)*et,nt)),ct.spot1=new go.Spot(lt,0),ct.spot2=new go.Spot(1-lt,1),ct}),go.Shape.defineFigureGenerator("Terminator",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.25*et,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*et,.5*nt,.25*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*et,.5*nt,.25*et,.5*nt)),ct.spot1=new go.Spot(.23,0),ct.spot2=new go.Spot(.77,1),ct}),go.Shape.defineFigureGenerator("TransmittalTape",function(Nt,et,nt){var ct=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.75*et,(1-lt)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,(1-lt)*nt).close()),ct.spot1=go.Spot.TopLeft,ct}),go.Shape.defineFigureGenerator("AndGate",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.5,pt=new go.PathFigure(0,0,!0);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),pt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,(.5+lt)*et,0,et,(.5-lt)*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,(.5+lt)*nt,(.5+lt)*et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ct.spot1=go.Spot.TopLeft,ct.spot2=new go.Spot(.55,1),ct}),go.Shape.defineFigureGenerator("Buffer",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ct.spot1=new go.Spot(0,.25),ct.spot2=new go.Spot(.5,.75),ct}),go.Shape.defineFigureGenerator("Clock",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.5,pt=.5,vt=new go.PathFigure(et,pt*nt,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*et,nt,et,(pt+lt)*nt,(pt+lt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*nt,(pt-lt)*et,nt,0,(pt+lt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*et,0,0,(pt-lt)*nt,(pt-lt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,pt*nt,(pt+lt)*et,0,et,(pt-lt)*nt));var Lt=new go.PathFigure(et,pt*nt,!1);ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,et,pt*nt));var bt=new go.PathFigure(.8*et,.75*nt,!1);return ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.25*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.25*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.75*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.75*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.25*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.25*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.75*nt)),ct}),go.Shape.defineFigureGenerator("Ground",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.5*et,0,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.3*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.4*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,nt)),ct}),go.Shape.defineFigureGenerator("Inverter",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.1,pt=.1,vt=.9,Lt=.5,bt=new go.PathFigure(.8*et,.5*nt,!0);ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),bt.add(new go.PathSegment(go.PathSegment.Line,0,0)),bt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.5*nt));var Gt=new go.PathFigure((vt+pt)*et,Lt*nt,!0);return ct.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt,(vt+lt)*et,(Lt+pt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Lt*nt,(vt-lt)*et,(Lt+pt)*nt,(vt-pt)*et,(Lt+lt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt-pt)*nt,(vt-pt)*et,(Lt-lt)*nt,(vt-lt)*et,(Lt-pt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Lt*nt,(vt+lt)*et,(Lt-pt)*nt,(vt+pt)*et,(Lt-lt)*nt)),ct.spot1=new go.Spot(0,.25),ct.spot2=new go.Spot(.4,.75),ct}),go.Shape.defineFigureGenerator("NandGate",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.5,pt=se*.4,vt=se*.1,Lt=.1,bt=.9,Gt=.5,jt=new go.PathFigure(.8*et,.5*nt,!0);ct.add(jt),jt.add(new go.PathSegment(go.PathSegment.Bezier,.4*et,nt,.8*et,(.5+pt)*nt,(.4+lt)*et,nt)),jt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),jt.add(new go.PathSegment(go.PathSegment.Line,0,0)),jt.add(new go.PathSegment(go.PathSegment.Line,.4*et,0)),jt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.5*nt,(.4+lt)*et,0,.8*et,(.5-pt)*nt));var ne=new go.PathFigure((bt+Lt)*et,Gt*nt,!0);return ct.add(ne),ne.add(new go.PathSegment(go.PathSegment.Bezier,bt*et,(Gt+Lt)*nt,(bt+Lt)*et,(Gt+vt)*nt,(bt+vt)*et,(Gt+Lt)*nt)),ne.add(new go.PathSegment(go.PathSegment.Bezier,(bt-Lt)*et,Gt*nt,(bt-vt)*et,(Gt+Lt)*nt,(bt-Lt)*et,(Gt+vt)*nt)),ne.add(new go.PathSegment(go.PathSegment.Bezier,bt*et,(Gt-Lt)*nt,(bt-Lt)*et,(Gt-vt)*nt,(bt-vt)*et,(Gt-Lt)*nt)),ne.add(new go.PathSegment(go.PathSegment.Bezier,(bt+Lt)*et,Gt*nt,(bt+vt)*et,(Gt-Lt)*nt,(bt+Lt)*et,(Gt-vt)*nt)),ct.spot1=new go.Spot(0,.05),ct.spot2=new go.Spot(.55,.95),ct}),go.Shape.defineFigureGenerator("NorGate",function(Nt,et,nt){var ct=new go.Geometry,lt=.5,pt=se*lt,vt=0,Lt=.5,bt=new go.PathFigure(.8*et,.5*nt,!0);ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt,.7*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*et,.75*nt,.25*et,.25*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.5*nt,(vt+pt)*et,(Lt-lt)*nt,.7*et,(Lt-pt)*nt)),lt=.1,pt=se*.1,vt=.9,Lt=.5;var Gt=new go.PathFigure((vt-lt)*et,Lt*nt,!0);return ct.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt-lt)*nt,(vt-lt)*et,(Lt-pt)*nt,(vt-pt)*et,(Lt-lt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,Lt*nt,(vt+pt)*et,(Lt-lt)*nt,(vt+lt)*et,(Lt-pt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+lt)*nt,(vt+lt)*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,Lt*nt,(vt-pt)*et,(Lt+lt)*nt,(vt-lt)*et,(Lt+pt)*nt)),ct.spot1=new go.Spot(.2,.25),ct.spot2=new go.Spot(.6,.75),ct}),go.Shape.defineFigureGenerator("OrGate",function(Nt,et,nt){var ct=new go.Geometry,lt=.5,pt=se*lt,vt=0,Lt=.5,bt=new go.PathFigure(0,0,!0);return ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,(vt+pt+pt)*et,(Lt-lt)*nt,.8*et,(Lt-pt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt,.8*et,(Lt+pt)*nt,(vt+pt+pt)*et,(Lt+lt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*et,.75*nt,.25*et,.25*nt).close()),ct.spot1=new go.Spot(.2,.25),ct.spot2=new go.Spot(.75,.75),ct}),go.Shape.defineFigureGenerator("XnorGate",function(Nt,et,nt){var ct=new go.Geometry,lt=.5,pt=se*lt,vt=.2,Lt=.5,bt=new go.PathFigure(.1*et,0,!1);ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,.1*et,nt,.35*et,.25*nt,.35*et,.75*nt));var Gt=new go.PathFigure(.8*et,.5*nt,!0);ct.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,.2*et,nt,.7*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,.2*et,0,.45*et,.75*nt,.45*et,.25*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.5*nt,(vt+pt)*et,(Lt-lt)*nt,.7*et,(Lt-pt)*nt)),lt=.1,pt=se*.1,vt=.9,Lt=.5;var jt=new go.PathFigure((vt-lt)*et,Lt*nt,!0);return ct.add(jt),jt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt-lt)*nt,(vt-lt)*et,(Lt-pt)*nt,(vt-pt)*et,(Lt-lt)*nt)),jt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,Lt*nt,(vt+pt)*et,(Lt-lt)*nt,(vt+lt)*et,(Lt-pt)*nt)),jt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+lt)*nt,(vt+lt)*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt)),jt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,Lt*nt,(vt-pt)*et,(Lt+lt)*nt,(vt-lt)*et,(Lt+pt)*nt)),ct.spot1=new go.Spot(.4,.25),ct.spot2=new go.Spot(.65,.75),ct}),go.Shape.defineFigureGenerator("XorGate",function(Nt,et,nt){var ct=new go.Geometry,lt=.5,pt=se*lt,vt=.2,Lt=.5,bt=new go.PathFigure(.1*et,0,!1);ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,.1*et,nt,.35*et,.25*nt,.35*et,.75*nt));var Gt=new go.PathFigure(.2*et,0,!0);return ct.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,(vt+pt)*et,(Lt-lt)*nt,.9*et,(Lt-pt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,.2*et,nt,.9*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,.2*et,0,.45*et,.75*nt,.45*et,.25*nt).close()),ct.spot1=new go.Spot(.4,.25),ct.spot2=new go.Spot(.8,.75),ct}),go.Shape.defineFigureGenerator("Capacitor",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),ct}),go.Shape.defineFigureGenerator("Resistor",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.5*nt,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.5*nt)),ct}),go.Shape.defineFigureGenerator("Inductor",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.1,pt=.1,vt=.1,Lt=.5,bt=new go.PathFigure((vt-lt*.5)*et,nt,!1);return ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,0,(vt-lt)*et,nt,(vt-pt)*et,0)),vt=.3,bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,nt,(vt+pt)*et,0,(vt+lt)*et,nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,0,(vt-lt)*et,nt,(vt-pt)*et,0)),vt=.5,bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,nt,(vt+pt)*et,0,(vt+lt)*et,nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,0,(vt-lt)*et,nt,(vt-pt)*et,0)),vt=.7,bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,nt,(vt+pt)*et,0,(vt+lt)*et,nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,0,(vt-lt)*et,nt,(vt-pt)*et,0)),vt=.9,bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt*.5)*et,nt,(vt+pt)*et,0,(vt+lt)*et,nt)),ct}),go.Shape.defineFigureGenerator("ACvoltageSource",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.5,pt=.5,vt=.5,Lt=.5,bt=new go.PathFigure((vt-pt)*et,Lt*nt,!1);return ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt-pt)*nt,(vt-pt)*et,(Lt-lt)*nt,(vt-lt)*et,(Lt-pt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Lt*nt,(vt+lt)*et,(Lt-pt)*nt,(vt+pt)*et,(Lt-lt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt,(vt+lt)*et,(Lt+pt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Lt*nt,(vt-lt)*et,(Lt+pt)*nt,(vt-pt)*et,(Lt+lt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Move,(vt-pt+.1)*et,Lt*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt-.1)*et,Lt*nt,vt*et,(Lt-pt)*nt,vt*et,(Lt+pt)*nt)),ct}),go.Shape.defineFigureGenerator("DCvoltageSource",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.75*nt,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),ct}),go.Shape.defineFigureGenerator("Diode",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et,0,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),ct.spot1=new go.Spot(0,.25),ct.spot2=new go.Spot(.5,.75),ct}),go.Shape.defineFigureGenerator("Wifi",function(Nt,et,nt){var ct=new go.Geometry,lt=et,pt=nt;et=et*.38,nt=nt*.6;var vt=se*.8,Lt=.8,bt=0,Gt=.5,jt=(lt-et)/2,ne=(pt-nt)/2,ie=new go.PathFigure(bt*et+jt,(Gt+Lt)*nt+ne,!0);ct.add(ie),ie.add(new go.PathSegment(go.PathSegment.Bezier,(bt-Lt)*et+jt,Gt*nt+ne,(bt-vt)*et+jt,(Gt+Lt)*nt+ne,(bt-Lt)*et+jt,(Gt+vt)*nt+ne)),ie.add(new go.PathSegment(go.PathSegment.Bezier,bt*et+jt,(Gt-Lt)*nt+ne,(bt-Lt)*et+jt,(Gt-vt)*nt+ne,(bt-vt)*et+jt,(Gt-Lt)*nt+ne)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(bt-Lt+vt*.5)*et+jt,Gt*nt+ne,bt*et+jt,(Gt-Lt)*nt+ne,(bt-Lt+vt*.5)*et+jt,(Gt-vt)*nt+ne)),ie.add(new go.PathSegment(go.PathSegment.Bezier,bt*et+jt,(Gt+Lt)*nt+ne,(bt-Lt+vt*.5)*et+jt,(Gt+vt)*nt+ne,bt*et+jt,(Gt+Lt)*nt+ne).close()),vt=se*.4,Lt=.4,bt=.2,Gt=.5;var te=new go.PathFigure(bt*et+jt,(Gt+Lt)*nt+ne,!0);ct.add(te),te.add(new go.PathSegment(go.PathSegment.Bezier,(bt-Lt)*et+jt,Gt*nt+ne,(bt-vt)*et+jt,(Gt+Lt)*nt+ne,(bt-Lt)*et+jt,(Gt+vt)*nt+ne)),te.add(new go.PathSegment(go.PathSegment.Bezier,bt*et+jt,(Gt-Lt)*nt+ne,(bt-Lt)*et+jt,(Gt-vt)*nt+ne,(bt-vt)*et+jt,(Gt-Lt)*nt+ne)),te.add(new go.PathSegment(go.PathSegment.Bezier,(bt-Lt+vt*.5)*et+jt,Gt*nt+ne,bt*et+jt,(Gt-Lt)*nt+ne,(bt-Lt+vt*.5)*et+jt,(Gt-vt)*nt+ne)),te.add(new go.PathSegment(go.PathSegment.Bezier,bt*et+jt,(Gt+Lt)*nt+ne,(bt-Lt+vt*.5)*et+jt,(Gt+vt)*nt+ne,bt*et+jt,(Gt+Lt)*nt+ne).close()),vt=se*.2,Lt=.2,bt=.5,Gt=.5;var Ge=new go.PathFigure((bt-Lt)*et+jt,Gt*nt+ne,!0);ct.add(Ge),Ge.add(new go.PathSegment(go.PathSegment.Bezier,bt*et+jt,(Gt-Lt)*nt+ne,(bt-Lt)*et+jt,(Gt-vt)*nt+ne,(bt-vt)*et+jt,(Gt-Lt)*nt+ne)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(bt+Lt)*et+jt,Gt*nt+ne,(bt+vt)*et+jt,(Gt-Lt)*nt+ne,(bt+Lt)*et+jt,(Gt-vt)*nt+ne)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,bt*et+jt,(Gt+Lt)*nt+ne,(bt+Lt)*et+jt,(Gt+vt)*nt+ne,(bt+vt)*et+jt,(Gt+Lt)*nt+ne)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(bt-Lt)*et+jt,Gt*nt+ne,(bt-vt)*et+jt,(Gt+Lt)*nt+ne,(bt-Lt)*et+jt,(Gt+vt)*nt+ne)),vt=se*.4,Lt=.4,bt=.8,Gt=.5;var pe=new go.PathFigure(bt*et+jt,(Gt-Lt)*nt+ne,!0);ct.add(pe),pe.add(new go.PathSegment(go.PathSegment.Bezier,(bt+Lt)*et+jt,Gt*nt+ne,(bt+vt)*et+jt,(Gt-Lt)*nt+ne,(bt+Lt)*et+jt,(Gt-vt)*nt+ne)),pe.add(new go.PathSegment(go.PathSegment.Bezier,bt*et+jt,(Gt+Lt)*nt+ne,(bt+Lt)*et+jt,(Gt+vt)*nt+ne,(bt+vt)*et+jt,(Gt+Lt)*nt+ne)),pe.add(new go.PathSegment(go.PathSegment.Bezier,(bt+Lt-vt*.5)*et+jt,Gt*nt+ne,bt*et+jt,(Gt+Lt)*nt+ne,(bt+Lt-vt*.5)*et+jt,(Gt+vt)*nt+ne)),pe.add(new go.PathSegment(go.PathSegment.Bezier,bt*et+jt,(Gt-Lt)*nt+ne,(bt+Lt-vt*.5)*et+jt,(Gt-vt)*nt+ne,bt*et+jt,(Gt-Lt)*nt+ne).close()),vt=se*.8,Lt=.8,bt=1,Gt=.5;var Je=new go.PathFigure(bt*et+jt,(Gt-Lt)*nt+ne,!0);return ct.add(Je),Je.add(new go.PathSegment(go.PathSegment.Bezier,(bt+Lt)*et+jt,Gt*nt+ne,(bt+vt)*et+jt,(Gt-Lt)*nt+ne,(bt+Lt)*et+jt,(Gt-vt)*nt+ne)),Je.add(new go.PathSegment(go.PathSegment.Bezier,bt*et+jt,(Gt+Lt)*nt+ne,(bt+Lt)*et+jt,(Gt+vt)*nt+ne,(bt+vt)*et+jt,(Gt+Lt)*nt+ne)),Je.add(new go.PathSegment(go.PathSegment.Bezier,(bt+Lt-vt*.5)*et+jt,Gt*nt+ne,bt*et+jt,(Gt+Lt)*nt+ne,(bt+Lt-vt*.5)*et+jt,(Gt+vt)*nt+ne)),Je.add(new go.PathSegment(go.PathSegment.Bezier,bt*et+jt,(Gt-Lt)*nt+ne,(bt+Lt-vt*.5)*et+jt,(Gt-vt)*nt+ne,bt*et+jt,(Gt-Lt)*nt+ne).close()),ct}),go.Shape.defineFigureGenerator("Email",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(0,0,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,0)),pt.add(new go.PathSegment(go.PathSegment.Move,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.54*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.54*nt)),ct}),go.Shape.defineFigureGenerator("Ethernet",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.35*et,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.65*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*et,0).close());var pt=new go.PathFigure(.1*et,nt,!0,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.4*et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*et,nt).close());var vt=new go.PathFigure(.6*et,nt,!0,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.9*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.6*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.6*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.6*et,nt).close());var Lt=new go.PathFigure(0,.5*nt,!1);return ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),Lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.5*nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.4*nt)),Lt.add(new go.PathSegment(go.PathSegment.Move,.75*et,.5*nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.6*nt)),Lt.add(new go.PathSegment(go.PathSegment.Move,.25*et,.5*nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.25*et,.6*nt)),ct}),go.Shape.defineFigureGenerator("Power",function(Nt,et,nt){var ct=new go.Geometry,lt=se*.4,pt=.4,vt=.5,Lt=.5,bt=St(),Gt=St(),jt=St(),ne=St();Xe(vt,Lt-pt,vt+lt,Lt-pt,vt+pt,Lt-lt,vt+pt,Lt,.5,bt,bt,Gt,jt,ne);var ie=Yt(Gt.x,Gt.y),te=new go.PathFigure(Gt.x*et,Gt.y*nt,!0);ct.add(te),te.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Lt*nt,jt.x*et,jt.y*nt,ne.x*et,ne.y*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt,(vt+lt)*et,(Lt+pt)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Lt*nt,(vt-lt)*et,(Lt+pt)*nt,(vt-pt)*et,(Lt+lt)*nt)),Xe(vt-pt,Lt,vt-pt,Lt-lt,vt-lt,Lt-pt,vt,Lt-pt,.5,jt,ne,Gt,bt,bt),te.add(new go.PathSegment(go.PathSegment.Bezier,Gt.x*et,Gt.y*nt,jt.x*et,jt.y*nt,ne.x*et,ne.y*nt)),lt=se*.3,pt=.3,Xe(vt-pt,Lt,vt-pt,Lt-lt,vt-lt,Lt-pt,vt,Lt-pt,.5,jt,ne,Gt,bt,bt),te.add(new go.PathSegment(go.PathSegment.Line,Gt.x*et,Gt.y*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Lt*nt,ne.x*et,ne.y*nt,jt.x*et,jt.y*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+pt)*nt,(vt-pt)*et,(Lt+lt)*nt,(vt-lt)*et,(Lt+pt)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Lt*nt,(vt+lt)*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt)),Xe(vt,Lt-pt,vt+lt,Lt-pt,vt+pt,Lt-lt,vt+pt,Lt,.5,bt,bt,Gt,jt,ne),te.add(new go.PathSegment(go.PathSegment.Bezier,Gt.x*et,Gt.y*nt,ne.x*et,ne.y*nt,jt.x*et,jt.y*nt).close());var te=new go.PathFigure(.45*et,0,!0);return ct.add(te),te.add(new go.PathSegment(go.PathSegment.Line,.45*et,.5*nt)),te.add(new go.PathSegment(go.PathSegment.Line,.55*et,.5*nt)),te.add(new go.PathSegment(go.PathSegment.Line,.55*et,0).close()),fe(bt),fe(Gt),fe(jt),fe(ne),fe(ie),ct.spot1=new go.Spot(.25,.45),ct.spot2=new go.Spot(.75,.8),ct}),go.Shape.defineFigureGenerator("Fallout",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,nt/2,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,180,360,et/2,nt/2,et/2,nt/2));function pt(vt,Lt,bt){vt.add(new go.PathSegment(go.PathSegment.Move,(.3+Lt)*et,(.8+bt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,(.5+Lt)*et,(.5+bt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,(.1+Lt)*et,(.5+bt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,(.3+Lt)*et,(.8+bt)*nt).close())}return pt(lt,0,0),pt(lt,.4,0),pt(lt,.2,-.3),ct}),go.Shape.defineFigureGenerator("IrritationHazard",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.2*et,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.3*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.2*nt).close()),ct.spot1=new go.Spot(.3,.3),ct.spot2=new go.Spot(.7,.7),ct}),go.Shape.defineFigureGenerator("ElectricalHazard",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.37*et,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.11*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.77*et,.04*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.33*et,.49*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.37*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.63*et,.86*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.77*et,.91*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.34*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.34*et,.78*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.44*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.56*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.68*nt).close()),ct}),go.Shape.defineFigureGenerator("FireHazard",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.1*et,nt,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.29*et,0,-.25*et,.63*nt,.45*et,.44*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.51*et,.42*nt,.48*et,.17*nt,.54*et,.35*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.59*et,.18*nt,.59*et,.29*nt,.58*et,.28*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.75*et,.6*nt,.8*et,.34*nt,.88*et,.43*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.88*et,.31*nt,.87*et,.48*nt,.88*et,.43*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*et,nt,1.17*et,.76*nt,.82*et,.8*nt).close()),ct.spot1=new go.Spot(.07,.445),ct.spot2=new go.Spot(.884,.958),ct}),go.Shape.defineFigureGenerator("BpmnActivityLoop",function(Nt,et,nt){var ct=new go.Geometry,lt=.5,pt=0,vt=0,Lt=lt*se,bt=.4*Math.SQRT2/2+.5,Gt=.5-.5*Math.SQRT2/2,jt=1,ne=.5,ie=.5,te=0,Ge=new go.PathFigure(bt*et,(1-Gt)*nt,!1);return ct.add(Ge),Ge.add(new go.PathSegment(go.PathSegment.Bezier,jt*et,ne*nt,jt*et,.7*nt,jt*et,ne*nt)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(ie+pt)*et,(te+pt)*nt,(.5+lt+pt)*et,(.5-Lt+pt)*nt,(.5+Lt+pt)*et,(.5-lt+pt)*nt)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(.5-lt+pt)*et,(.5+vt)*nt,(.5-Lt+pt)*et,(.5-lt+vt)*nt,(.5-lt+pt)*et,(.5-Lt+vt)*nt)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(.35+pt)*et,.9*nt,(.5-lt+pt)*et,(.5+Lt+vt)*nt,(.5-Lt+pt)*et,.9*nt)),Ge.add(new go.PathSegment(go.PathSegment.Move,(.25+pt)*et,.8*nt)),Ge.add(new go.PathSegment(go.PathSegment.Line,(.35+pt)*et,.9*nt)),Ge.add(new go.PathSegment(go.PathSegment.Line,(.2+pt)*et,.95*nt)),ct}),go.Shape.defineFigureGenerator("BpmnActivityParallel",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),ct}),go.Shape.defineFigureGenerator("BpmnActivitySequential",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Move,0,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),ct}),go.Shape.defineFigureGenerator("BpmnActivityAdHoc",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!1);ct.add(lt);var pt=new go.PathFigure(et,nt,!1);ct.add(pt);var vt=new go.PathFigure(0,.5*nt,!1);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.5*nt,.2*et,.35*nt,.3*et,.35*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,.7*et,.65*nt,.8*et,.65*nt)),ct}),go.Shape.defineFigureGenerator("BpmnActivityCompensation",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.5*nt,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt).close()),ct}),go.Shape.defineFigureGenerator("BpmnTaskMessage",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.2*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt).close());var lt=new go.PathFigure(0,.2*nt,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.2*nt)),ct}),go.Shape.defineFigureGenerator("BpmnTaskScript",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.7*et,nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.3*et,0,.6*et,.5*nt,0,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.7*et,nt,.4*et,.5*nt,et,.5*nt).close());var pt=new go.PathFigure(.45*et,.73*nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.73*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.38*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.63*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.31*et,.27*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.56*et,.27*nt)),ct}),go.Shape.defineFigureGenerator("BpmnTaskUser",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!1);ct.add(lt);var pt=new go.PathFigure(.335*et,(1-.555)*nt,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.335*et,(1-.405)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*et,(1-.405)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*et,(1-.555)*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,et,.68*nt,(1-.12)*et,.46*nt,(1-.02)*et,.54*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.68*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.335*et,(1-.555)*nt,.02*et,.54*nt,.12*et,.46*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.365*et,(1-.595)*nt));var vt=.5-.285,Lt=.5,bt=vt,Gt=Math.PI/4,jt=4*(1-Math.cos(Gt))/(3*Math.sin(Gt)),ne=jt*.5,ie=vt,te=vt,Ge=jt*ie,pe=jt*te;pt.add(new go.PathSegment(go.PathSegment.Bezier,(Lt-ie)*et,bt*nt,(Lt-(Ge+ie)/2)*et,(bt+(te+pe)/2)*nt,(Lt-ie)*et,(bt+pe)*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,Lt*et,(bt-te)*nt,(Lt-ie)*et,(bt-pe)*nt,(Lt-Ge)*et,(bt-te)*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,(Lt+ie)*et,bt*nt,(Lt+Ge)*et,(bt-te)*nt,(Lt+ie)*et,(bt-pe)*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.365)*et,(1-.595)*nt,(Lt+ie)*et,(bt+pe)*nt,(Lt+(Ge+ie)/2)*et,(bt+(te+pe)/2)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.365)*et,(1-.595)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*et,(1-.555)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*et,(1-.405)*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.335*et,(1-.405)*nt));var Je=new go.PathFigure(.2*et,nt,!1);ct.add(Je),Je.add(new go.PathSegment(go.PathSegment.Line,.2*et,.8*nt));var Ye=new go.PathFigure(.8*et,nt,!1);return ct.add(Ye),Ye.add(new go.PathSegment(go.PathSegment.Line,.8*et,.8*nt)),ct}),go.Shape.defineFigureGenerator("BpmnEventConditional",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.1*et,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,nt).close());var pt=new go.PathFigure(.2*et,.2*nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.2*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.8*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.8*nt)),ct}),go.Shape.defineFigureGenerator("BpmnEventError",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,nt,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.33*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.66*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.66*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.33*et,.5*nt).close()),ct}),go.Shape.defineFigureGenerator("BpmnEventEscalation",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!1);ct.add(lt);var pt=new go.PathFigure(et,nt,!1);ct.add(pt);var vt=new go.PathFigure(.1*et,nt,!0);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt).close()),ct}),go.Shape.defineFigureGenerator("Caution",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.05*et,nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.1*et,.8*nt,0,nt,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.55*et,.1*nt,.5*et,0,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.95*et,.9*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*et,nt,et,nt,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.05*et,nt));var pt=.05;return lt.add(new go.PathSegment(go.PathSegment.Move,(.5-pt)*et,.875*nt)),lt.add(new go.PathSegment(go.PathSegment.Arc,180,-360,.5*et,.875*nt,pt*et,pt*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.325*nt,.575*et,.725*nt,.625*et,.375*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.75*nt,.375*et,.375*nt,.425*et,.725*nt)),ct}),go.Shape.defineFigureGenerator("Recycle",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.45*et,.95*nt,!1);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.95*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.185*et,.85*nt,.17*et,.95*nt,.15*et,.9*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.235*et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*et,.625*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*et,.65*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.275*et,.45*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.05*et,.45*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.05*et,.575*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.1875*et,.95*nt,0,.675*nt,0,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.45*et,.95*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.775*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.22*et,.775*nt));var pt=new go.PathFigure(.475*et,.2*nt,!1);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.225*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.275*et,.175*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.325*et,.05*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.4*et,.05*nt,.35*et,0,.375*et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.575*et,.375*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.525*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.475*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.85*et,.315*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.32*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.05*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.575*et,0,.65*et,.05*nt,.625*et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.38*et,.0105*nt));var vt=new go.PathFigure(.675*et,.575*nt,!1);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.875*et,.525*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,.775*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.85*et,.95*nt,et,.8*nt,et,.85*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.95*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.85*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.725*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.775*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.775*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,et,.775*nt)),vt.add(new go.PathSegment(go.PathSegment.Move,.675*et,.575*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.775*et,.775*nt)),ct}),go.Shape.defineFigureGenerator("BpmnEventTimer",function(Nt,et,nt){var ct=new go.Geometry,lt=.5,pt=se*.5,vt=new go.PathFigure(et,lt*nt,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,lt*et,nt,et,(lt+pt)*nt,(lt+pt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,lt*nt,(lt-pt)*et,nt,0,(lt+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,lt*et,0,0,(lt-pt)*nt,(lt-pt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,lt*nt,(lt+pt)*et,0,et,(lt-pt)*nt));var Lt=new go.PathFigure(lt*et,0,!1);return ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,lt*et,.15*nt)),Lt.add(new go.PathSegment(go.PathSegment.Move,lt*et,nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,lt*et,.85*nt)),Lt.add(new go.PathSegment(go.PathSegment.Move,0,lt*nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.15*et,lt*nt)),Lt.add(new go.PathSegment(go.PathSegment.Move,et,lt*nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.85*et,lt*nt)),Lt.add(new go.PathSegment(go.PathSegment.Move,lt*et,lt*nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.58*et,.1*nt)),Lt.add(new go.PathSegment(go.PathSegment.Move,lt*et,lt*nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.78*et,.54*nt)),ct}),go.Shape.defineFigureGenerator("Package",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.15*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,.15*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close());var pt=new go.PathFigure(0,.15*nt,!0);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.15*nt).close()),ct.spot1=new go.Spot(0,.1),ct.spot2=new go.Spot(1,1),ct}),go.Shape.defineFigureGenerator("Class",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(0,.2*nt,!1);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,.2*nt).close());var vt=new go.PathFigure(0,.5*nt,!1);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt).close()),ct}),go.Shape.defineFigureGenerator("Component",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et,nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt).close());var pt=new go.PathFigure(0,.2*nt,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.2*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.2*nt).close());var vt=new go.PathFigure(0,.6*nt,!0);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.6*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.8*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.6*nt).close()),ct}),go.Shape.defineFigureGenerator("Boat Shipment",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.15*et,.6*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.15*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.85*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.85*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*et,.6*nt));var pt=new go.PathFigure(.15*et,.6*nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.85*et,.6*nt)),ct}),go.Shape.defineFigureGenerator("Customer/Supplier",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et,nt,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.66*et,.33*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.66*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.33*et,.33*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.33*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.33*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt).close()),ct}),go.Shape.defineFigureGenerator("Workcell",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,nt,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.65*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.65*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),ct}),go.Shape.defineFigureGenerator("Supermarket",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.33*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.33*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,et,.33*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.66*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.66*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,et,.66*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),ct}),go.Shape.defineFigureGenerator("TruckShipment",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(et,.8*nt,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.8*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.8*nt).close());var vt=.1,Lt=se*.1,bt=.2,Gt=.9,jt=new go.PathFigure((bt-vt)*et,Gt*nt,!0);ct.add(jt),jt.add(new go.PathSegment(go.PathSegment.Bezier,bt*et,(Gt-vt)*nt,(bt-vt)*et,(Gt-Lt)*nt,(bt-Lt)*et,(Gt-vt)*nt)),jt.add(new go.PathSegment(go.PathSegment.Bezier,(bt+vt)*et,Gt*nt,(bt+Lt)*et,(Gt-vt)*nt,(bt+vt)*et,(Gt-Lt)*nt)),jt.add(new go.PathSegment(go.PathSegment.Bezier,bt*et,(Gt+vt)*nt,(bt+vt)*et,(Gt+Lt)*nt,(bt+Lt)*et,(Gt+vt)*nt)),jt.add(new go.PathSegment(go.PathSegment.Bezier,(bt-vt)*et,Gt*nt,(bt-Lt)*et,(Gt+vt)*nt,(bt-vt)*et,(Gt+Lt)*nt).close()),vt=.1,Lt=se*.1,bt=.8,Gt=.9;var ne=new go.PathFigure((bt-vt)*et,Gt*nt,!0);return ct.add(ne),ne.add(new go.PathSegment(go.PathSegment.Bezier,bt*et,(Gt-vt)*nt,(bt-vt)*et,(Gt-Lt)*nt,(bt-Lt)*et,(Gt-vt)*nt)),ne.add(new go.PathSegment(go.PathSegment.Bezier,(bt+vt)*et,Gt*nt,(bt+Lt)*et,(Gt-vt)*nt,(bt+vt)*et,(Gt-Lt)*nt)),ne.add(new go.PathSegment(go.PathSegment.Bezier,bt*et,(Gt+vt)*nt,(bt+vt)*et,(Gt+Lt)*nt,(bt+Lt)*et,(Gt+vt)*nt)),ne.add(new go.PathSegment(go.PathSegment.Bezier,(bt-vt)*et,Gt*nt,(bt-Lt)*et,(Gt+vt)*nt,(bt-vt)*et,(Gt+Lt)*nt).close()),ct}),go.Shape.defineFigureGenerator("KanbanPost",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.2*et,0,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,0)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,nt)),ct}),go.Shape.defineFigureGenerator("Forklift",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0));var pt=new go.PathFigure(0,.5*nt,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.8*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt));var vt=new go.PathFigure(.5*et,.8*nt,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.1*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.1*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.8*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.8*nt));var Lt=new go.PathFigure(.5*et,.7*nt,!1);ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,et,.7*nt));var bt=.1,Gt=se*.1,jt=.1,ne=.9,ie=new go.PathFigure((jt-bt)*et,ne*nt,!0);ct.add(ie),ie.add(new go.PathSegment(go.PathSegment.Bezier,jt*et,(ne-bt)*nt,(jt-bt)*et,(ne-Gt)*nt,(jt-Gt)*et,(ne-bt)*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(jt+bt)*et,ne*nt,(jt+Gt)*et,(ne-bt)*nt,(jt+bt)*et,(ne-Gt)*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,jt*et,(ne+bt)*nt,(jt+bt)*et,(ne+Gt)*nt,(jt+Gt)*et,(ne+bt)*nt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(jt-bt)*et,ne*nt,(jt-Gt)*et,(ne+bt)*nt,(jt-bt)*et,(ne+Gt)*nt)),bt=.1,Gt=se*.1,jt=.4,ne=.9;var te=new go.PathFigure((jt-bt)*et,ne*nt,!0);return ct.add(te),te.add(new go.PathSegment(go.PathSegment.Bezier,jt*et,(ne-bt)*nt,(jt-bt)*et,(ne-Gt)*nt,(jt-Gt)*et,(ne-bt)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(jt+bt)*et,ne*nt,(jt+Gt)*et,(ne-bt)*nt,(jt+bt)*et,(ne-Gt)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,jt*et,(ne+bt)*nt,(jt+bt)*et,(ne+Gt)*nt,(jt+Gt)*et,(ne+bt)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(jt-bt)*et,ne*nt,(jt-Gt)*et,(ne+bt)*nt,(jt-bt)*et,(ne+Gt)*nt)),ct}),go.Shape.defineFigureGenerator("RailShipment",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.1*et,.4*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.45*et,.9*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.9*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.4*nt).close());var pt=new go.PathFigure(.45*et,.7*nt,!1);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.7*nt));var vt=new go.PathFigure(.55*et,.4*nt,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.4*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.9*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*et,.4*nt).close());var jt=.05,ne=se*.05,ie=.175,te=.95,Lt=new go.PathFigure((ie-jt)*et,te*nt,!0);ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Bezier,ie*et,(te-jt)*nt,(ie-jt)*et,(te-ne)*nt,(ie-ne)*et,(te-jt)*nt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,(ie+jt)*et,te*nt,(ie+ne)*et,(te-jt)*nt,(ie+jt)*et,(te-ne)*nt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,ie*et,(te+jt)*nt,(ie+jt)*et,(te+ne)*nt,(ie+ne)*et,(te+jt)*nt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,(ie-jt)*et,te*nt,(ie-ne)*et,(te+jt)*nt,(ie-jt)*et,(te+ne)*nt));var jt=.05,ne=se*.05,ie=.375,te=.95,bt=new go.PathFigure((ie-jt)*et,te*nt,!0);ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,ie*et,(te-jt)*nt,(ie-jt)*et,(te-ne)*nt,(ie-ne)*et,(te-jt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(ie+jt)*et,te*nt,(ie+ne)*et,(te-jt)*nt,(ie+jt)*et,(te-ne)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,ie*et,(te+jt)*nt,(ie+jt)*et,(te+ne)*nt,(ie+ne)*et,(te+jt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(ie-jt)*et,te*nt,(ie-ne)*et,(te+jt)*nt,(ie-jt)*et,(te+ne)*nt));var jt=.05,ne=se*.05,ie=.625,te=.95,Gt=new go.PathFigure((ie-jt)*et,te*nt,!0);ct.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,ie*et,(te-jt)*nt,(ie-jt)*et,(te-ne)*nt,(ie-ne)*et,(te-jt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(ie+jt)*et,te*nt,(ie+ne)*et,(te-jt)*nt,(ie+jt)*et,(te-ne)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,ie*et,(te+jt)*nt,(ie+jt)*et,(te+ne)*nt,(ie+ne)*et,(te+jt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(ie-jt)*et,te*nt,(ie-ne)*et,(te+jt)*nt,(ie-jt)*et,(te+ne)*nt));var jt=.05,ne=se*.05,ie=.825,te=.95,Ge=new go.PathFigure((ie-jt)*et,te*nt,!0);ct.add(Ge),Ge.add(new go.PathSegment(go.PathSegment.Bezier,ie*et,(te-jt)*nt,(ie-jt)*et,(te-ne)*nt,(ie-ne)*et,(te-jt)*nt)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(ie+jt)*et,te*nt,(ie+ne)*et,(te-jt)*nt,(ie+jt)*et,(te-ne)*nt)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,ie*et,(te+jt)*nt,(ie+jt)*et,(te+ne)*nt,(ie+ne)*et,(te+jt)*nt)),Ge.add(new go.PathSegment(go.PathSegment.Bezier,(ie-jt)*et,te*nt,(ie-ne)*et,(te+jt)*nt,(ie-jt)*et,(te+ne)*nt).close());var pe=new go.PathFigure(0,nt,!1);return ct.add(pe),pe.add(new go.PathSegment(go.PathSegment.Line,et,nt).close()),ct}),go.Shape.defineFigureGenerator("Warehouse",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(0,.2*nt,!1);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,.2*nt).close());var vt=new go.PathFigure(.15*et,nt,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.15*et,.5*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.5*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.4*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.15*et,nt).close());var Lt=.05,bt=se*.05,Gt=.35,jt=.775,ne=new go.PathFigure((Gt-Lt)*et,jt*nt,!0);return ct.add(ne),ne.add(new go.PathSegment(go.PathSegment.Bezier,Gt*et,(jt-Lt)*nt,(Gt-Lt)*et,(jt-bt)*nt,(Gt-bt)*et,(jt-Lt)*nt)),ne.add(new go.PathSegment(go.PathSegment.Bezier,(Gt+Lt)*et,jt*nt,(Gt+bt)*et,(jt-Lt)*nt,(Gt+Lt)*et,(jt-bt)*nt)),ne.add(new go.PathSegment(go.PathSegment.Bezier,Gt*et,(jt+Lt)*nt,(Gt+Lt)*et,(jt+bt)*nt,(Gt+bt)*et,(jt+Lt)*nt)),ne.add(new go.PathSegment(go.PathSegment.Bezier,(Gt-Lt)*et,jt*nt,(Gt-bt)*et,(jt+Lt)*nt,(Gt-Lt)*et,(jt+bt)*nt).close()),ct}),go.Shape.defineFigureGenerator("ControlCenter",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,nt,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.1*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.8*nt).close()),ct}),go.Shape.defineFigureGenerator("Bluetooth",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.75*nt,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.25*nt)),ct}),go.Shape.defineFigureGenerator("Bookmark",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.4*nt)),ct}),go.Shape.defineFigureGenerator("Bookmark",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.4*nt)),ct}),go.Shape.defineFigureGenerator("Globe",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.5*et,0,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,0,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,.75*et,0,et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,et,.75*nt,.75*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,.25*et,nt,0,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,0,.25*nt,.25*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt,.15*et,.25*nt,.15*et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,.85*et,.75*nt,.85*et,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.1675*et,.15*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.8325*et,.15*nt,.35*et,.3*nt,.65*et,.3*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.1675*et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.8325*et,.85*nt,.35*et,.7*nt,.65*et,.7*nt)),ct}),go.Shape.defineFigureGenerator("Wave",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.25*nt,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.3*et,.25*nt,.1*et,0,.2*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.7*et,.25*nt,.425*et,.5*nt,.575*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,.25*nt,.8*et,0,.9*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,0,.25*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.75*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.3*et,.75*nt,.1*et,.5*nt,.2*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.7*et,.75*nt,.425*et,nt,.575*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,.75*nt,.8*et,.5*nt,.9*et,.5*nt)),ct}),go.Shape.defineFigureGenerator("Operator",function(Nt,et,nt){var ct=new go.Geometry,lt=.3,pt=se*.3,vt=.5,Lt=.7,bt=new go.PathFigure((vt-lt)*et,Lt*nt,!0);ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt-lt)*nt,(vt-lt)*et,(Lt-pt)*nt,(vt-pt)*et,(Lt-lt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,Lt*nt,(vt+pt)*et,(Lt-lt)*nt,(vt+lt)*et,(Lt-pt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+lt)*nt,(vt+lt)*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,Lt*nt,(vt-pt)*et,(Lt+lt)*nt,(vt-lt)*et,(Lt+pt)*nt));var Gt=new go.PathFigure(0,.7*nt,!1);return ct.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,et,.7*nt,0,0,et,0)),ct}),go.Shape.defineFigureGenerator("TripleFanBlades",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.5*et,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.65*nt,.65*et,.3*nt,.65*et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,.35*et,.5*nt,.35*et,.3*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.65*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt,.3*et,.6*nt,.1*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.65*nt,.2*et,nt,.35*et,.95*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.65*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,nt,.7*et,.6*nt,.9*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.65*nt,.8*et,nt,.65*et,.95*nt)),ct}),go.Shape.defineFigureGenerator("CentrifugalPump",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et,0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,0,.075*nt,0,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.4*et,nt,0,nt,.4*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.4*nt,.8*et,nt,.85*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,0)),ct}),go.Shape.defineFigureGenerator("Battery",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.4*et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.1*nt));var pt=new go.PathFigure(0,.6*nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,0,.4*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,et,.4*nt)),ct}),go.Shape.defineFigureGenerator("Delete",function(Nt,et,nt){var ct=new go.Geometry,lt=.5,pt=se*.5,vt=.5,Lt=.5,bt=new go.PathFigure((vt-lt)*et,Lt*nt,!0);ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt-lt)*nt,(vt-lt)*et,(Lt-pt)*nt,(vt-pt)*et,(Lt-lt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,Lt*nt,(vt+pt)*et,(Lt-lt)*nt,(vt+lt)*et,(Lt-pt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+lt)*nt,(vt+lt)*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,Lt*nt,(vt-pt)*et,(Lt+lt)*nt,(vt-lt)*et,(Lt+pt)*nt));var Gt=new go.PathFigure(.15*et,.5*nt,!1);return ct.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Line,.85*et,.5*nt)),ct}),go.Shape.defineFigureGenerator("Flag",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.1*nt,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,0,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.1*nt,.15*et,0,.35*et,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,et,.1*nt,.65*et,.2*nt,.85*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.5*nt,.85*et,.6*nt,.65*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,.35*et,.4*nt,.15*et,.4*nt).close()),ct}),go.Shape.defineFigureGenerator("Help",function(Nt,et,nt){var ct=new go.Geometry,lt=.5,pt=se*.5,vt=.5,Lt=.5,bt=new go.PathFigure((vt-lt)*et,Lt*nt,!1);ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt-lt)*nt,(vt-lt)*et,(Lt-pt)*nt,(vt-pt)*et,(Lt-lt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,Lt*nt,(vt+pt)*et,(Lt-lt)*nt,(vt+lt)*et,(Lt-pt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+lt)*nt,(vt+lt)*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,Lt*nt,(vt-pt)*et,(Lt+lt)*nt,(vt-lt)*et,(Lt+pt)*nt).close()),lt=.05,pt=se*.05,vt=.5,Lt=.8;var Gt=new go.PathFigure((vt-lt)*et,Lt*nt,!1);return ct.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt-lt)*nt,(vt-lt)*et,(Lt-pt)*nt,(vt-pt)*et,(Lt-lt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,Lt*nt,(vt+pt)*et,(Lt-lt)*nt,(vt+lt)*et,(Lt-pt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Lt+lt)*nt,(vt+lt)*et,(Lt+pt)*nt,(vt+pt)*et,(Lt+lt)*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,Lt*nt,(vt-pt)*et,(Lt+lt)*nt,(vt-lt)*et,(Lt+pt)*nt).close()),Gt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.7*nt)),Gt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.2*nt,.75*et,.475*nt,.75*et,.225*nt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,.3*et,.35*nt,.4*et,.2*nt,.3*et,.25*nt)),ct}),go.Shape.defineFigureGenerator("Location",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(.5*et,nt,!0).add(new go.PathSegment(go.PathSegment.Line,.75*et,.5*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,.975*et,.025*nt,.5*et,0)).add(new go.PathSegment(go.PathSegment.Bezier,.25*et,.5*nt,.5*et,0,.025*et,.025*nt).close()).add(new go.PathSegment(go.PathSegment.Move,.5*et,.2*nt)).add(new go.PathSegment(go.PathSegment.Arc,270,360,.5*et,.3*nt,.1*et,.1*nt).close()))}),go.Shape.defineFigureGenerator("Lock",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.5*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt));var pt=new go.PathFigure(.2*et,.5*nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.3*nt,.25*et,0,.75*et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.3*nt)),ct}),go.Shape.defineFigureGenerator("Unlocked",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.5*nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt));var pt=new go.PathFigure(.2*et,.5*nt,!1);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,.2*et,.5*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.3*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.3*nt,.25*et,0,.75*et,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.35*nt)),ct}),go.Shape.defineFigureGenerator("Gear",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(.9375*et,.56246875*nt,!0).add(new go.PathSegment(go.PathSegment.Line,.9375*et,.4375*nt)).add(new go.PathSegment(go.PathSegment.Line,.80621875*et,.4375*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.763*et,.3316875*nt,.79840625*et,.39915625*nt,.7834375*et,.3635*nt)).add(new go.PathSegment(go.PathSegment.Line,.8566875*et,.23796875*nt)).add(new go.PathSegment(go.PathSegment.Line,.76825*et,.14959375*nt)).add(new go.PathSegment(go.PathSegment.Line,.67596875*et,.24184375*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.5625*et,.19378125*nt,.64228125*et,.2188125*nt,.603875*et,.2021875*nt)).add(new go.PathSegment(go.PathSegment.Line,.5625*et,.0625*nt)).add(new go.PathSegment(go.PathSegment.Line,.4375*et,.0625*nt)).add(new go.PathSegment(go.PathSegment.Line,.4375*et,.19378125*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.32775*et,.239375*nt,.39759375*et,.20190625*nt,.36053125*et,.2176875*nt)).add(new go.PathSegment(go.PathSegment.Line,.2379375*et,.14959375*nt)).add(new go.PathSegment(go.PathSegment.Line,.14953125*et,.2379375*nt)).add(new go.PathSegment(go.PathSegment.Line,.23934375*et,.3278125*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.19378125*et,.4375*nt,.21765625*et,.36059375*nt,.201875*et,.397625*nt)).add(new go.PathSegment(go.PathSegment.Line,.0625*et,.4375*nt)).add(new go.PathSegment(go.PathSegment.Line,.0625*et,.5625*nt)).add(new go.PathSegment(go.PathSegment.Line,.1938125*et,.5625*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.241875*et,.67596875*nt,.20221875*et,.603875*nt,.21884375*et,.64228125*nt)).add(new go.PathSegment(go.PathSegment.Line,.1495625*et,.76825*nt)).add(new go.PathSegment(go.PathSegment.Line,.238*et,.8566875*nt)).add(new go.PathSegment(go.PathSegment.Line,.3316875*et,.76296875*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.43753125*et,.80621875*nt,.36353125*et,.78340625*nt,.3991875*et,.79840625*nt)).add(new go.PathSegment(go.PathSegment.Line,.43753125*et,.9375*nt)).add(new go.PathSegment(go.PathSegment.Line,.5625*et,.9375*nt)).add(new go.PathSegment(go.PathSegment.Line,.5625*et,.80621875*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.67225*et,.760625*nt,.602375*et,.79809375*nt,.63946875*et,.78234375*nt)).add(new go.PathSegment(go.PathSegment.Line,.76828125*et,.8566875*nt)).add(new go.PathSegment(go.PathSegment.Line,.85671875*et,.76825*nt)).add(new go.PathSegment(go.PathSegment.Line,.76065625*et,.67221875*nt)).add(new go.PathSegment(go.PathSegment.Bezier,.80621875*et,.56246875*nt,.78234375*et,.63940625*nt,.798125*et,.602375*nt)).add(new go.PathSegment(go.PathSegment.Line,.9375*et,.56246875*nt).close()).add(new go.PathSegment(go.PathSegment.Move,.5*et,.6*nt)).add(new go.PathSegment(go.PathSegment.Arc,90,360,.5*et,.5*nt,.1*et,.1*nt).close()))}),go.Shape.defineFigureGenerator("Hand",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.5*nt,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.1*et,.3*nt,0,.375*nt,.05*et,.325*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.45*et,.075*nt,.3*et,.225*nt,.4*et,.175*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.525*et,.075*nt,.46*et,.05*nt,.525*et,.05*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.3*et,.4*nt,.525*et,.275*nt,.475*et,.325*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*et,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*et,.55*nt,et,.4*nt,et,.55*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.425*et,.55*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.55*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.6*et,.7*nt,.675*et,.55*nt,.675*et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.575*et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.575*et,.85*nt,.65*et,.7*nt,.65*et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.525*et,.85*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.535*et,nt,.61*et,.85*nt,.61*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*nt,.435*et,nt,0,nt).close()),ct}),go.Shape.defineFigureGenerator("Map",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,.2*nt,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.25*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.25*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt).close()),lt.add(new go.PathSegment(go.PathSegment.Move,.25*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.25*et,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt)),lt.add(new go.PathSegment(go.PathSegment.Move,.75*et,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*et,.8*nt)),ct}),go.Shape.defineFigureGenerator("Eject",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,nt,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt*.7)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*.7).close());var pt=new go.PathFigure(0,nt*.6,!0);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et,.6*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*et,0).close()),ct}),go.Shape.defineFigureGenerator("Pencil",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.2*et,.1*nt)).add(new go.PathSegment(go.PathSegment.Line,et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.9*et,nt)).add(new go.PathSegment(go.PathSegment.Line,.1*et,.2*nt).close()))}),go.Shape.defineFigureGenerator("Building",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et*1,nt*1,!1);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*.85)),lt.add(new go.PathSegment(go.PathSegment.Line,.046*et,nt*.85)),lt.add(new go.PathSegment(go.PathSegment.Line,.046*et,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*.3)),lt.add(new go.PathSegment(go.PathSegment.Line,.046*et,nt*.3)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*et,nt*.3)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt*.3)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*et,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*et,nt*.85)),lt.add(new go.PathSegment(go.PathSegment.Line,et,nt*.85).close());var pt=new go.PathFigure(.126*et,.85*nt,!1);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.126*et,.45*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.322*et,.45*nt)),pt.add(new go.PathSegment(go.PathSegment.Line,.322*et,.85*nt).close());var vt=new go.PathFigure(.402*et,.85*nt,!1);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.402*et,.45*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.598*et,.45*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,.598*et,.85*nt).close());var Lt=new go.PathFigure(.678*et,.85*nt,!1);ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,.678*et,.45*nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.874*et,.45*nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,.874*et,.85*nt).close());var bt=new go.PathFigure(.5*et,.1*nt,!1);return ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,(.046+.15)*et,.3*nt)),bt.add(new go.PathSegment(go.PathSegment.Line,(1-(.046+.15))*et,.3*nt).close()),ct}),go.Shape.defineFigureGenerator("Staircase",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,nt*1,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.2,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.2,nt*.8)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.8)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.6)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*.6)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*.4)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*.4)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*.2)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.2)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.15)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*.15)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*.35)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.55,nt*.35)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.55,nt*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.35,nt*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.35,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.15,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.15,nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*.95).close()),ct}),go.Shape.defineFigureGenerator("5Bars",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,nt*1,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.184,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.184,nt*(1-.184)).close());var pt=new go.PathFigure(et*.204,nt,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et*.204,nt*(1-.184))),pt.add(new go.PathSegment(go.PathSegment.Line,et*.388,nt*(1-.184*2))),pt.add(new go.PathSegment(go.PathSegment.Line,et*.388,nt*1).close());var vt=new go.PathFigure(et*.408,nt,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*.408,nt*(1-.184*2))),vt.add(new go.PathSegment(go.PathSegment.Line,et*.592,nt*(1-.184*3))),vt.add(new go.PathSegment(go.PathSegment.Line,et*.592,nt*1).close());var Lt=new go.PathFigure(et*.612,nt,!0);ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,et*.612,nt*(1-.184*3))),Lt.add(new go.PathSegment(go.PathSegment.Line,et*.796,nt*(1-.184*4))),Lt.add(new go.PathSegment(go.PathSegment.Line,et*.796,nt*1).close());var bt=new go.PathFigure(et*.816,nt,!0);return ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,et*.816,nt*(1-.184*4))),bt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*(1-.184*5))),bt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1).close()),ct}),go.Shape.defineFigureGenerator("PC",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,0).close());var pt=new go.PathFigure(et*.055,.07*nt,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.07)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.055,nt*.1).close());var vt=new go.PathFigure(et*.055,.13*nt,!0);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.13)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.16)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.055,nt*.16).close());var Lt=new go.PathFigure(et*.055,.18*nt,!0);ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.18)),Lt.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.21)),Lt.add(new go.PathSegment(go.PathSegment.Line,et*.055,nt*.21).close());var bt=new go.PathFigure(et*1,0,!0);return ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,et*.4,0)),bt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.65)),bt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.65).close()),ct}),go.Shape.defineFigureGenerator("Plane",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(.55*et,nt,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.7*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*et,.475*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.35*et,.525*nt,0,.4*nt,.225*et,.45*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.475*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*et,.35*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.325*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.325*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.85*et,.1*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*et,.2*nt,.975*et,0,et,.08*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*et,.45*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.95*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,.55*et,nt).close()),ct}),go.Shape.defineFigureGenerator("Key",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et*1,nt*.5,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.9,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,.4*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,.35*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.45,.35*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.15,.2*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.35*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.65*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.15,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,.8*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.45,.65*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,.65*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.6,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.65,.55*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.7,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,.55*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.8,.6*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.85,.575*nt)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.9,.6*nt).close()),lt.add(new go.PathSegment(go.PathSegment.Move,.17*et,.425*nt)),lt.add(new go.PathSegment(go.PathSegment.Arc,270,360,.17*et,.5*nt,.075*et,.075*nt).close()),ct}),go.Shape.defineFigureGenerator("FilmTape",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(0,0,!1);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,270,180,et*0,et*.3,et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,0,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.08,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.08,nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*1),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*1),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*2),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*2),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*3),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*3),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*4),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*4),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*5),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*5),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*6),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*6),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*7),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*7),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*8),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*8),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*9),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*9),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*10),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*10),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*11),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*11),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*12),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*12),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*13),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*13),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*14),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*14),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*15),nt*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(.08+.056*15),nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1));var pt=new go.PathFigure(0,0,!1);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*0)),pt.add(new go.PathSegment(go.PathSegment.Arc,270,-180,et*1,et*.3,et*.055)),pt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1));var vt=new go.PathFigure(et*.11,nt*.1,!1);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*1+.028*0),nt*.1)),vt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*1+.028*0),nt*.8)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.11,nt*.8).close());var Lt=new go.PathFigure(et*(.11+.24133333*1+.028*1),nt*.1,!1);ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*2+.028*1),nt*.1)),Lt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*2+.028*1),nt*.8)),Lt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*1+.028*1),nt*.8).close());var bt=new go.PathFigure(et*(.11+.24133333*2+.028*2),nt*.1,!1);return ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*3+.028*2),nt*.1)),bt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*3+.028*2),nt*.8)),bt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*2+.028*2),nt*.8).close()),ct}),go.Shape.defineFigureGenerator("FloppyDisk",function(Nt,et,nt){var ct=new go.Geometry,lt=8,pt=lt*se,vt=new go.PathFigure(lt,0,!1);ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*.86,0)),vt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.14)),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt-lt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et-lt,nt,et,nt-pt,et-pt,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,lt,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt-lt,pt,nt,0,nt-pt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,lt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,lt,0,0,pt,pt,0).close());var Lt=new go.PathFigure(et*.83,0,!1);ct.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,et*.83,nt*.3)),Lt.add(new go.PathSegment(go.PathSegment.Line,et*.17,nt*.3)),Lt.add(new go.PathSegment(go.PathSegment.Line,et*.17,nt*0).close());var bt=new go.PathFigure(et*.83,nt*1,!1);ct.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,et*.83,nt*.5)),bt.add(new go.PathSegment(go.PathSegment.Line,et*.17,nt*.5)),bt.add(new go.PathSegment(go.PathSegment.Line,et*.17,nt*1).close());var Gt=new go.PathFigure(et*.78,nt*.05,!1);return ct.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*.05)),Gt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*.25)),Gt.add(new go.PathSegment(go.PathSegment.Line,et*.78,nt*.25).close()),ct}),go.Shape.defineFigureGenerator("SpeechBubble",function(Nt,et,nt){var ct=Nt?Nt.parameter1:NaN;(isNaN(ct)||ct<0)&&(ct=15),ct=Math.min(ct,et/3),ct=Math.min(ct,nt/3);var lt=ct*se,pt=nt*.8,vt=new go.Geometry,Lt=new go.PathFigure(ct,0,!0);return vt.add(Lt),Lt.add(new go.PathSegment(go.PathSegment.Line,et-ct,0)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,et,ct,et-lt,0,et,lt)),Lt.add(new go.PathSegment(go.PathSegment.Line,et,pt-ct)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,et-ct,pt,et,pt-lt,et-lt,pt)),Lt.add(new go.PathSegment(go.PathSegment.Line,et*.7,pt)),Lt.add(new go.PathSegment(go.PathSegment.Line,et*.7,nt)),Lt.add(new go.PathSegment(go.PathSegment.Line,et*.55,pt)),Lt.add(new go.PathSegment(go.PathSegment.Line,ct,pt)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt-ct,lt,pt,0,pt-lt)),Lt.add(new go.PathSegment(go.PathSegment.Line,0,ct)),Lt.add(new go.PathSegment(go.PathSegment.Bezier,ct,0,0,lt,lt,0).close()),lt>1?(vt.spot1=new go.Spot(0,0,lt,lt),vt.spot2=new go.Spot(1,.8,-lt,-lt)):(vt.spot1=go.Spot.TopLeft,vt.spot2=new go.Spot(1,.8)),vt}),go.Shape.defineFigureGenerator("Repeat",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et*0,nt*.45,!0);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.25,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,nt*.9)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*.9)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.65,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.2,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.2,nt*.45).close());var pt=new go.PathFigure(et*1,nt*.55,!0);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*1)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*.55)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.7,nt*.55)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.7,nt*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.35,nt*0)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*0)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*.55).close()),ct}),go.Shape.defineFigureGenerator("Windows",function(Nt,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,et,0)).add(new go.PathSegment(go.PathSegment.Line,et,nt)).add(new go.PathSegment(go.PathSegment.Line,0,nt).close()).add(new go.PathSegment(go.PathSegment.Move,.4*et,.4*nt)).add(new go.PathSegment(go.PathSegment.Line,.4*et,.8*nt)).add(new go.PathSegment(go.PathSegment.Line,.9*et,.8*nt)).add(new go.PathSegment(go.PathSegment.Line,.9*et,.4*nt).close()).add(new go.PathSegment(go.PathSegment.Move,.2*et,.1*nt)).add(new go.PathSegment(go.PathSegment.Line,.2*et,.6*nt)).add(new go.PathSegment(go.PathSegment.Line,.7*et,.6*nt)).add(new go.PathSegment(go.PathSegment.Line,.7*et,.1*nt).close()).add(new go.PathSegment(go.PathSegment.Move,.1*et,.6*nt)).add(new go.PathSegment(go.PathSegment.Line,.1*et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.5*et,.9*nt)).add(new go.PathSegment(go.PathSegment.Line,.5*et,.6*nt).close()))}),go.Shape.defineFigureGenerator("Terminal",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et*0,nt*.1,!1);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.9)),lt.add(new go.PathSegment(go.PathSegment.Line,et*0,nt*.9).close());var pt=new go.PathFigure(et*.1,nt*.2,!0);ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et*.1,nt*.25)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.22,nt*.285)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.1,nt*.32)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.1,nt*.37)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.275,nt*.32)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.275,nt*.25).close());var vt=new go.PathFigure(et*.28,nt*.37,!0);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*.45,nt*.37)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.45,nt*.41)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.28,nt*.41).close()),ct}),go.Shape.defineFigureGenerator("Beaker",function(Nt,et,nt){var ct=new go.Geometry,lt=15,pt=lt*se,vt=new go.PathFigure(et*.62,nt*.475,!0);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et,nt-lt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et-lt,nt,et,nt-pt,et-pt,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,lt,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt-lt,pt,nt,0,nt-pt)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.38,nt*.475)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.38,nt*.03)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.36,nt*0)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.64,nt*0)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.62,nt*.03).close()),pt>1?(ct.spot1=new go.Spot(0,0,pt,pt),ct.spot2=new go.Spot(1,1,-pt,-pt)):(ct.spot1=go.Spot.TopLeft,ct.spot2=go.Spot.BottomRight),ct}),go.Shape.defineFigureGenerator("Download",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et*0,nt*1,!0);ct.add(lt);var pt=.1/.3;lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.755,nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.93,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.64,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.61,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.39,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.36,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.07,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.755),nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.66),nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.66),nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.8),nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*0,nt*(1-pt)).close());var vt=new go.PathFigure(et*.4,nt*0,!0);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.26,nt*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*.66)),vt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.26),nt*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*0).close()),ct}),go.Shape.defineFigureGenerator("Bin",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et*0,nt*1,!0);ct.add(lt);var pt=.1/.3;return lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.755,nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.93,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.64,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.61,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.39,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.36,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.07,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.755),nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.66),nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.66),nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.8),nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*0,nt*(1-pt)).close()),ct}),go.Shape.defineFigureGenerator("Upload",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et*0,nt*1,!0);ct.add(lt);var pt=.1/.3;lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.8,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.755,nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.93,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.64,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.61,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.39,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.36,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*.07,nt*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.755),nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.66),nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.66),nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*(1-.8),nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*0,nt*(1-pt)).close());var vt=new go.PathFigure(et*.5,nt*0,!0);return ct.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,et*.26,nt*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.63)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*.63)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.6,nt*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,et*.74,nt*.25).close()),ct}),go.Shape.defineFigureGenerator("EmptyDrink",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et*.15,nt*0,!1);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.85,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.7,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,nt*1).close()),ct}),go.Shape.defineFigureGenerator("Drink",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et*.15,nt*0,!1);ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.85,nt*0)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.7,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.3,nt*1).close());var pt=new go.PathFigure(et*.235,nt*.28,!0);return ct.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,et*.765,nt*.28)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.655,nt*.97)),pt.add(new go.PathSegment(go.PathSegment.Line,et*.345,nt*.97).close()),ct}),go.Shape.defineFigureGenerator("4Arrows",function(Nt,et,nt){var ct=new go.Geometry,lt=new go.PathFigure(et*.5,nt*0,!0);return ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,et*.65,nt*.25)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.55,nt*.25)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.55,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*.35)),lt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.5)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*.65)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.75,nt*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.55,nt*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.55,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.65,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.5,nt*1)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.35,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.45,nt*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.45,nt*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.25,nt*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.25,nt*.65)),lt.add(new go.PathSegment(go.PathSegment.Line,et*0,nt*.5)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.25,nt*.35)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.25,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.45,nt*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.45,nt*.25)),lt.add(new go.PathSegment(go.PathSegment.Line,et*.35,nt*.25).close()),ct}),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 un={},Gn="5.0",Yt={},St=null,fe=!1,be=!1,Xe=null,ge=!1,re=null,se=null,Ie=0;Ie<arguments.length;Ie++){var Le=arguments[Ie];if(Le!==null)switch(typeof Le){case"number":Gn=Le.toFixed(1);break;case"string":Le.match(new RegExp("^[0-9]\\.[0-9]+$"))?Gn=Le:Xe=Le;break;case"object":typeof Le.is3D!="undefined"?St=Le:Yt=Le;break;case"boolean":fe=Le,be=!0;break}}St===null&&(St={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},Yt.material_id!==void 0&&!be&&(fe=!0)),Xe!==null&&Yt.id===void 0&&(Yt.id=Xe);var $t="",Ze="",ae=!1,Re=null,Nt=null,et=null,nt=!1,ct=null,lt=null,pt=null,vt=null,Lt=null;Yt.height!==void 0&&(Yt.height=Math.round(Yt.height)),Yt.width!==void 0&&(Yt.width=Math.round(Yt.width));var bt=function(je){return parseFloat(je)>4?parseFloat(je):5};un.setHTML5Codebase=function(je,gn){se=je,tn(je,gn)},un.setJavaCodebase=un.setJavaCodebaseVersion=un.isCompiledInstalled=un.setPreCompiledScriptPath=un.setPreCompiledResourcePath=function(){},un.setHTML5CodebaseVersion=function(je,gn){var Tn=parseFloat(je);if(Tn!==NaN&&Tn<5){console.log("The GeoGebra HTML5 codebase version "+Tn+" is deprecated. Using version latest instead.");return}re=je,Kt(je,gn)},un.getHTML5CodebaseVersion=function(){return Nt},un.getParameters=function(){return Yt},un.setFontsCSSURL=function(je){vt=je},un.setGiacJSURL=function(je){},un.setJNLPFile=function(je){$t=je},un.setJNLPBaseDir=function(je){},un.inject=function(){function je(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var gn="auto",Tn=Yt.id,Jn,Pn=!1,Qn=0;Qn<arguments.length;Qn++){var ee=arguments[Qn];typeof ee=="string"?(ee=ee.toLowerCase(),ee.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?gn=ee:Tn=arguments[Qn]):typeof ee=="boolean"?Pn=ee:ee instanceof HTMLElement&&(Jn=ee)}jn();function jn(){if(!ge){setTimeout(jn,200);return}gn=yn(gn);var hi=Jn||document.getElementById(Tn);if(!hi){console.log("possibly bug on ajax loading? ");return}if(un.removeExistingApplet(hi,!1),Yt.width===void 0&&hi.clientWidth&&(Yt.width=hi.clientWidth),Yt.height===void 0&&hi.clientHeight&&(Yt.height=hi.clientHeight),!(Yt.width&&Yt.height)&&gn==="html5"&&(delete Yt.width,delete Yt.height),Re=gn,gn==="screenshot")Ye(hi,Yt);else{var Dt=!1;Yt.hasOwnProperty("playButton")&&Yt.playButton||Yt.hasOwnProperty("clickToLoad")&&Yt.clickToLoad?Dt=!0:Yt.hasOwnProperty("playButtonAutoDecide")&&Yt.playButtonAutoDecide&&(Dt=(!Gt()||je())&&jt()),Dt?(Re="screenshot",Fn(hi,Yt,Pn,gn)):Je(hi,Yt,Pn)}}};function Gt(){try{return window.self!==window.top}catch(je){return!0}}function jt(){return Yt.hasOwnProperty("screenshotGenerator")&&Yt.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}un.getViews=function(){return St},un.isJavaInstalled=function(){return!1};var ne=function(je){var gn=function(Qn){var ee=JSON.parse(Qn),jn=function(kt){return kt.type=="G"||kt.type=="E"},hi=ee.elements?ee.elements.filter(jn)[0]:ee;if(!hi||!hi.url){Tn();return}Yt.fileName=hi.url,ie(hi.settings||{}),St.is3D=!0;var Dt="https://www.geogebra.org/images/";un.setPreviewImage(ct||hi.previewUrl,Dt+"GeoGebra_loading.png",Dt+"applet_play.png"),je()},Tn=function(){Yt.onError&&Yt.onError(),Yn("Error: Fetching material (id "+Yt.material_id+") failed.",Yt)},Jn=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",Pn="/materials/"+Yt.material_id+"?scope=basic";te("https://"+Jn+"/api/proxy.php?path="+encodeURIComponent(Pn),gn,Tn)};function ie(je){var gn=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(Tn){je[Tn]=!!je[Tn]}),gn.forEach(function(Tn){Yt[Tn]===void 0&&je[Tn]!==void 0&&(Yt[Tn]=je[Tn])}),Yt.showToolBarHelp===void 0&&(Yt.showToolBarHelp=Yt.showToolBar)}function te(je,gn,Tn){var Jn=new XMLHttpRequest;Jn.open("GET",je),Jn.onload=function(){gn(Jn.responseText)},Jn.onerror=Tn,Jn.send()}un.isHTML5Installed=function(){return!0},un.getLoadedAppletType=function(){return Re},un.setPreviewImage=function(je,gn,Tn){ct=je,lt=gn,pt=Tn},un.removeExistingApplet=function(je,gn){var Tn;typeof je=="string"&&(je=document.getElementById(je)),Re=null;var Jn=null;for(Tn=0;Tn<je.childNodes.length;Tn++){var Pn=je.childNodes[Tn],Qn=Pn.className;Qn==="applet_screenshot"?gn?(Pn.style.display="block",Re="screenshot"):Pn.style.display="none":Qn!=="applet_scaler prerender"&&(je.removeChild(Pn),Jn=Qn&&Qn.indexOf("appletParameters")!=-1?Pn.id:null,Tn--)}var ee=Yt.id!==void 0?Yt.id:Jn,jn=window[ee];jn&&typeof jn.getBase64=="function"&&(jn.remove(),window[ee]=null)},un.refreshHitPoints=function(){if(bt(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var je=un.getAppletObject();return je&&typeof je.recalculateEnvironments=="function"?(je.recalculateEnvironments(),!0):!1},un.startAnimation=function(){var je=un.getAppletObject();return je&&typeof je.startAnimation=="function"?(je.startAnimation(),!0):!1},un.stopAnimation=function(){var je=un.getAppletObject();return je&&typeof je.stopAnimation=="function"?(je.stopAnimation(),!0):!1},un.getAppletObject=function(){var je=Yt.id!==void 0?Yt.id:"ggbApplet";return window[je]},un.resize=function(){};var Ge=function(je,gn,Tn){var Jn=document.createElement("param");Jn.setAttribute("name",gn),Jn.setAttribute("value",Tn),je.appendChild(Jn)},pe=function(je){return je&&je!=="false"},Je=function(je,gn,Tn){bt(Nt)<=4.2&&(Tn=!0);var Jn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==Nt||ggbHTML5LoadedCodebaseIsWebSimple&&!nt)&&(Jn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var Pn=document.createElement("div");Pn.classList.add("appletParameters","notranslate");var Qn=gn.width,ee=gn.height;if(gn.disableAutoScale=gn.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():gn.disableAutoScale,gn.width!==void 0)if(bt(Nt)<=4.4)pe(gn.showToolBar)&&(gn.height-=7),pe(gn.showAlgebraInput)&&(gn.height-=37),gn.width<605&&pe(gn.showToolBar)&&(gn.width=605,Qn=605);else{var jn=100;(pe(gn.showToolBar)||pe(gn.showMenuBar))&&(gn.hasOwnProperty("customToolBar")&&(gn.customToolbar=gn.customToolBar),jn=pe(gn.showMenuBar)?245:155),Qn<jn&&(gn.width=jn,Qn=jn)}Pn.style.border="none",Pn.style.display="inline-block";for(var hi in gn)gn.hasOwnProperty(hi)&&hi!=="appletOnLoad"&&Pn.setAttribute("data-param-"+hi,gn[hi]);vt&&Pn.setAttribute("data-param-fontscssurl",vt),un.resize=function(){GGBAppletUtils.responsiveResize(je,gn)},window.addEventListener("resize",function(en){un.resize()});var Dt=typeof gn.appletOnLoad=="function"?gn.appletOnLoad:function(){};if(!Tn&&gn.width!==void 0){gn.hasOwnProperty("showSplash")||Pn.setAttribute("data-param-showSplash","false");var kt=je.querySelector(".applet_scaler.prerender"),wt=kt!==null;if(wt)var At=kt.querySelector(".ggb_preview");else{var At=pi(Qn,ee,gn.borderColor,!1);kt=document.createElement("div"),kt.className="applet_scaler",kt.style.position="relative",kt.style.display="block",kt.style.width=Qn+"px",kt.style.height=ee+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(kt,"66%"),bt(Nt)>=5?(gn.appletOnLoad=function(en){var dn=je.querySelector(".ggb_preview");dn&&dn.parentNode.removeChild(dn),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(kt),window.GGBT_wsf_view&&$(window).trigger("resize"),Dt(en)},wt||kt.appendChild(At)):Pn.appendChild(At),kt.appendChild(Pn),wt||je.appendChild(kt),setTimeout(function(){un.resize()},1)}else{var _t=document.createElement("div");_t.className="applet_scaler",_t.style.position="relative",_t.style.display="block",_t.appendChild(Pn),je.appendChild(_t),gn.appletOnLoad=function(en){un.resize(),Dt(en)}}function Et(en,dn){dn&&typeof dn.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(en,dn.appletOnLoad):renderGGBElement(en),Yn("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",dn)}function Pe(en,dn){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:en,params:dn}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(An){Et(An.article,An.params)}),html5AppletsToProcess=null)},bt(Nt)<5&&(en.className+=" geogebraweb")):Et(en,dn)}if(Jn){scriptLoadStarted=!0;for(var Ee=0;Ee<Pn.childNodes.length;Ee++){var sn=Pn.childNodes[Ee].tagName;sn==="TABLE"&&(Pn.removeChild(Pn.childNodes[Ee]),Ee--)}if(ggbHTML5LoadedScript!==null){var He=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');He!=null&&He.parentNode.removeChild(He)}var Ae=document.createElement("script"),qe=function(){Pe(Pn,gn)};Ae.src=Ze+et,ggbHTML5LoadedCodebaseIsWebSimple=nt,ggbHTML5LoadedCodebaseVersion=Nt,ggbHTML5LoadedScript=Ae.src,Yn("GeoGebra HTML5 codebase loaded: '"+Ze+"'.",gn),!se&&(!re||re=="5.0")?(nt?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),qe()):Ze.requirejs?__webpack_require__.e(245).then(function(){var en=[__webpack_require__(40245)];qe.apply(null,en)}.bind(this)).catch(__webpack_require__.oe):(Ae.onload=qe,je.appendChild(Ae))}else Pe(Pn,gn);gn.height=ee,gn.width=Qn},Ye=function(je,gn,Tn){var Jn=pi(gn.width,gn.height,gn.borderColor,Tn),Pn=document.createElement("div");Pn.style.position="relative",Pn.style.display="block",Pn.style.width=gn.width+"px",Pn.style.height=gn.height+"px",Pn.className="applet_screenshot applet_scaler"+(Tn?" applet_screenshot_play":""),Pn.appendChild(Jn);var Qn=GGBAppletUtils.getScale(gn,je,Tn);Tn?(je.appendChild(vn()),window.GGBT_wsf_view||(je.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Pn,"66%"),je.appendChild(Pn),Qn!==1&&!isNaN(Qn)&&(GGBAppletUtils.scaleElement(Pn,Qn),Pn.style.width=gn.width+"px",Pn.style.height=gn.height+"px",Pn.parentNode.style.width=gn.width*Qn+"px",Pn.parentNode.style.height=gn.height*Qn+"px"),un.resize=function(){hn(je,Jn,Pn,Tn)},window.addEventListener("resize",function(ee){un.resize()}),un.resize()};function hn(je,gn,Tn,Jn){if(je.contains(gn)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(je.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(je)}var Pn=GGBAppletUtils.getScale(Yt,je,Jn);Tn.parentNode!==null&&(!isNaN(Pn)&&Pn!==1?(GGBAppletUtils.scaleElement(Tn,Pn),Tn.parentNode.style.width=Yt.width*Pn+"px",Tn.parentNode.style.height=Yt.height*Pn+"px"):(GGBAppletUtils.scaleElement(Tn,1),Tn.parentNode.style.width=Yt.width+"px",Tn.parentNode.style.height=Yt.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(je),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}un.onExitFullscreen=function(je,gn){gn.appendChild(je)};var Fn=function(je,gn,Tn,Jn){Ye(je,gn,!0);for(var Pn=function(){var jn=[];for(ee=0;ee<je.childNodes.length;ee++)jn.push(je.childNodes[ee]);if(window.GGBT_wsf_view){var hi=window.GGBT_wsf_view.renderFullScreen(je,gn.id),Dt=document.getElementById("fullscreencontainer"),kt=jQuery(je).find(".fullscreencontent");kt.length>0?(hi.remove(),kt.attr("id","fullscreencontent").show(),jQuery(Dt).append(kt),window.dispatchEvent(new Event("resize"))):Je(hi,gn,!1),window.GGBT_wsf_view.launchFullScreen(Dt)}else Re=Jn,Je(je,gn,!1);if(!window.GGBT_wsf_view)for(ee=0;ee<jn.length;ee++)je.removeChild(jn[ee])},Qn=je.getElementsByClassName("ggb_preview_play"),ee=0;ee<Qn.length;ee++)Qn[ee].addEventListener("click",Pn,!1),Qn[ee].addEventListener("ontouchstart",Pn,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(je),jt()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},vn=function(){var je=document.createElement("div");if(je.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var gn='.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");}',Tn=document.createElement("style");Tn.styleSheet?Tn.styleSheet.cssText=gn:Tn.appendChild(document.createTextNode(gn)),document.getElementsByTagName("head")[0].appendChild(Tn)}return je},pi=function(je,gn,Tn,Jn){var Pn=document.createElement("div");Pn.className="ggb_preview",Pn.style.position="absolute",Pn.style.zIndex="90",Pn.style.width=je-2+"px",Pn.style.height=gn-2+"px",Pn.style.top="0px",Pn.style.left="0px",Pn.style.overflow="hidden",Pn.style.backgroundColor="white";var Qn="lightgrey";Tn!==void 0&&(Tn==="none"?Qn="transparent":Qn=Tn),Pn.style.border="1px solid "+Qn;var ee=document.createElement("img");if(ee.style.position="relative",ee.style.zIndex="1000",ee.style.top="-1px",ee.style.left="-1px",ct!==null&&ee.setAttribute("src",ct),ee.style.opacity=.7,lt!==null){var jn,hi,Dt;if(!Jn){jn=document.createElement("img"),jn.style.position="absolute",jn.style.zIndex="1001",jn.style.opacity=1,ee.style.opacity=.3,hi=360,hi>je/4*3&&(hi=je/4*3),Dt=hi/5.8,jn.setAttribute("src",lt),jn.setAttribute("width",hi),jn.setAttribute("height",Dt);var kt=(je-hi)/2,wt=(gn-Dt)/2;jn.style.left=kt+"px",jn.style.top=wt+"px",Pn.appendChild(jn)}}return Pn.appendChild(ee),Pn},yn=function(je){return je=je.toLowerCase(),je==="html5"||je==="screenshot"?je:"html5"},ce=["web","webSimple","web3d","tablet","tablet3d","phone"],Kt=function(je,gn){if(Nt=je,gn){tn(Nt,!0);return}var Tn=!fe;if(Tn){var Jn=bt(Nt);!isNaN(Jn)&&Jn<4.4&&(Tn=!1)}var Pn,Qn;window.location.protocol.substr(0,4)==="http"?Pn=window.location.protocol:Pn="http:";var ee=Nt.indexOf("//");ee>0?Qn=Nt:ee===0?Qn=Pn+Nt:Qn="https://www.geogebra.org/apps/5.2.814.0/";for(var jn in ce)if(Nt.slice(ce[jn].length*-1)===ce[jn]||Nt.slice((ce[jn].length+1)*-1)===ce[jn]+"/"){tn(Qn,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&Tn&&!St.is3D&&!St.AV&&!St.SV&&!St.CV&&!St.EV2&&!St.CP&&!St.PC&&!St.DA&&!St.FI&&!St.PV&&!pe(Yt.showToolBar)&&!pe(Yt.showMenuBar)&&!pe(Yt.showAlgebraInput)&&!pe(Yt.enableRightClick)&&(!Yt.appName||Yt.appName=="classic")?Qn+="webSimple/":Qn+="web3d/",tn(Qn,!1)},tn=function(je,gn){if(je.requirejs){Ze=je;return}je.slice(-1)!=="/"&&(je+="/"),Ze=je,gn===null&&(gn=je.indexOf("http")===-1),ae=gn,et="web.nocache.js",nt=!1;var Tn=Ze.split("/");Tn.length>1&&(!gn&&Tn[Tn.length-2]==="webSimple"?(et="webSimple.nocache.js",nt=!0):ce.indexOf(Tn[Tn.length-2])>=0&&(et=Tn[Tn.length-2]+".nocache.js")),Tn=je.split("/"),Nt=Tn[Tn.length-3],Nt.substr(0,4)==="test"?Nt=Nt.substr(4,1)+"."+Nt.substr(5,1):(Nt.substr(0,3)==="war"||Nt.substr(0,4)==="beta")&&(Nt="5.0");var Jn=parseFloat(Nt);Jn!==NaN&&Jn<5&&je.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+Jn+" is deprecated. Using version latest instead."),Kt("5.0",gn))},Yn=function(je,gn){window.console&&window.console.log&&(!gn||typeof gn.showLogging=="undefined"||gn.showLogging&&gn.showLogging!=="false")&&console.log(je)};Yt.material_id!==void 0?ne(Dn):Dn();function Dn(){var je=Gn;re!==null?je=re:parseFloat(je)<5&&(je="5.0"),Kt(je,!1),se!==null&&tn(se,ae),ge=!0}return un},GGBAppletUtils=function(){"use strict";function un(){return window.GGBT_wsf_edit!==void 0}function Gn(ge,re){re!=1?(ge.style.transformOrigin="0% 0% 0px",ge.style.webkitTransformOrigin="0% 0% 0px",ge.style.transform="scale("+re+","+re+")",ge.style.webkitTransform="scale("+re+","+re+")",ge.style.maxWidth="initial",ge.querySelector(".ggb_preview")!==null&&(ge.querySelector(".ggb_preview").style.maxWidth="initial"),ge.querySelectorAll(".ggb_preview img")[0]!==void 0&&(ge.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),ge.querySelectorAll(".ggb_preview img")[1]!==void 0&&(ge.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(ge.style.transform="none",ge.style.webkitTransform="none")}function Yt(ge,re,se,Ie,Le,$t){var Ze=null;if($t!=null&&$t!="")for(var ae=ge.parentNode;ae!=null;)if((" "+ae.className+" ").indexOf(" "+$t+" ")>-1){Ze=ae;break}else ae=ae.parentNode;var Re=0,Nt=0,et=0,nt=0,ct=0,lt=0,pt=0;if(Ze)Re=Ze.offsetWidth,Nt=Math.max(Ie?Ze.offsetWidth:0,Ze.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(Re=Math.min(window.innerWidth,document.documentElement.clientWidth),Nt=Math.min(window.innerHeight,document.documentElement.clientHeight),et=Re):(Re=window.innerWidth,Nt=window.innerHeight,et=window.innerWidth),ge){var vt=ge.getBoundingClientRect();vt.left>0&&vt.left<=Re&&(Le===void 0||!Le)&&(document.dir==="rtl"?(ct=Re-vt.width-vt.left,lt=et<=480?10:30):(lt=vt.left,ct=et<=480?10:30),nt=lt+ct)}if(ge&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var Lt=ge.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(nt=40,pt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(nt=0,pt=40)}}return ge&&((se===void 0||!se)&&re>0&&re+nt<Re?Re=re:Re-=nt,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(se===void 0||!se)&&(Nt-=pt)),{width:Re,height:Nt}}function St(ge,re,se,Ie,Le){if(ge.isScreenshoGenerator)return 1;var $t=Ie!==void 0&&Ie,Ze=ge.noScaleMargin!=null&&ge.noScaleMargin,ae=function(Lt){return Lt&&Lt!=="false"},Re=ae(ge.autoHeight),Nt=Yt(re,ge.width,se,Re,$t&&window.GGBT_wsf_view||Ze,Le),et=parseInt(Nt.width),nt=ge.width,ct=ge.height;if(nt===void 0){var lt=re.querySelector(".appletParameters");lt&&(nt=lt.offsetWidth,ct=lt.offsetHeight)}var pt=et/nt,vt=$t?1:Nt.height/ct;return se!==void 0&&!se&&(pt=Math.min(1,pt),vt=Math.min(1,vt)),Math.min(pt,vt)}function fe(ge,re,se){var Ie=1,Le,$t=!1;if(ge.hasOwnProperty("allowUpscale")&&($t=ge.allowUpscale),ge.hasOwnProperty("scale")&&(Ie=parseFloat(ge.scale),(isNaN(Ie)||Ie===null||Ie===0)&&(Ie=1),Ie>1&&($t=!0)),re&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&($t=!0),!(ge.hasOwnProperty("disableAutoScale")&&ge.disableAutoScale))Le=St(ge,re,$t,se,ge.scaleContainerClass);else return Ie;return $t&&(!ge.hasOwnProperty("scale")||Ie===1)?Le:Math.min(Ie,Le)}function be(ge){var re=Math.min(window.innerWidth,document.documentElement.clientWidth),se=Math.min(window.innerHeight,document.documentElement.clientHeight),Ie=ge.getBoundingClientRect(),Le=(re-Ie.width)/2,$t=(se-Ie.height)/2;$t<0&&($t=0),ge.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Le<40?ge.style.left="40px":ge.style.left=Le+"px",ge.style.top=$t+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&($t<40?ge.style.top="40px":ge.style.top=$t+"px",ge.style.left=Le+"px")}function Xe(ge,re){var se=ge.querySelector(".appletParameters");if(se){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(re.id!==se.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(ge)}if(se.parentElement&&/fullscreen/.test(se.parentElement.className))return;var Ie=fe(re,ge);un()&&se.setAttribute("data-param-scale",Ie);for(var Le=null,$t=0;$t<ge.childNodes.length;$t++)if(ge.childNodes[$t].className!==void 0&&ge.childNodes[$t].className.match(/^applet_scaler/)){Le=ge.childNodes[$t];break}if(Le!==null&&Le.querySelector(".noscale")!==null)return;var Ze=re.id!==void 0?re.id:"ggbApplet",ae=window[Ze];(ae==null||!ae.recalculateEnvironments)&&Le!==null&&!Le.className.match(/fullscreen/)&&(Le.parentNode.style.transform="",!isNaN(Ie)&&Ie!==1?(Le.parentNode.style.width=re.width*Ie+"px",Le.parentNode.style.height=re.height*Ie+"px",Gn(Le,Ie)):(Gn(Le,1),Le.parentNode.style.width=re.width+"px",Le.parentNode.style.height=re.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&be(ge),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(se).parents(".content-added-content"))}}return{responsiveResize:Xe,isFlexibleWorksheetEditor:un,positionCenter:be,getScale:fe,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 un=n.location.search;return un.indexOf(J)!=-1||un.indexOf(K)!=-1}function q(un,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(un){var Gn=s[L].bindings;s[L].bindings=function(){for(var Yt=Gn?Gn():{},St=un[webModule.__softPermutationId],fe=O;fe<St.length;fe++){var be=St[fe];Yt[be[O]]=be[P]}return Yt}};var t;function u(){return v(),t}function v(){if(!t){var un=o.createElement(Q);if(un.id=L,un.style.cssText=R+S,un.tabIndex=-1,o.body.appendChild(un),t=un.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var Gn=document.compatMode==U?V:W;t.write(Gn+X),t.close()}}}function w(un){function Gn(St){function fe(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var be=fe();if(be){St();return}function Xe(){if(!be){if(!fe())return;be=!0,St(),o.removeEventListener&&o.removeEventListener(Z,Xe,!1),ge&&clearInterval(ge)}}o.addEventListener&&o.addEventListener(Z,Xe,!1);var ge=setInterval(function(){Xe()},$)}function Yt(St){var fe=u(),be=fe.body,Xe=fe.createElement(_);Xe.language=ab,Xe.crossOrigin=W,Xe.src=St,webModule.__errFn&&(Xe.onerror=function(){webModule.__errFn(L,new Error(bb+St))}),be.appendChild(Xe)}Gn(function(){Yt(un)})}webModule.__startLoadingFragment=function(un){return C(un)},webModule.__installRunAsyncCode=function(un){var Gn=u(),Yt=Gn.body,St=Gn.createElement(_);St.language=ab,St.text=un,Yt.appendChild(St),Yt.removeChild(St)};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(un){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(un){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(un){var Gn=c[un];return Gn==null?null:Gn},r=d,webModule.__errFn=e}function B(){function un(ge){var re=ge.lastIndexOf(rb);re==-1&&(re=ge.length);var se=ge.indexOf(sb);se==-1&&(se=ge.length);var Ie=ge.lastIndexOf(tb,Math.min(se,re));return Ie>=O?ge.substring(O,Ie+P):W}function Gn(ge){if(!ge.match(/^\w+:\/\//)){var re=o.createElement(ub);re.src=ge+vb,ge=un(re.src)}return ge}function Yt(){var ge=__gwt_getMetaProperty(wb);return ge!=null?ge:W}function St(){for(var ge=o.getElementsByTagName(_),re=O;re<ge.length;++re)if(ge[re].src.indexOf(xb)!=-1)return un(ge[re].src);return W}function fe(){var ge=o.getElementsByTagName(yb);return ge.length>O?ge[ge.length-P].href:W}function be(){var ge=o.location;return ge.href==ge.protocol+zb+ge.host+ge.pathname+ge.search+ge.hash}var Xe=Yt();return Xe==W&&(Xe=St()),Xe==W&&(Xe=fe()),Xe==W&&be()&&(Xe=un(o.location.href)),Xe=Gn(Xe),Xe}function C(un){return un.match(/^\//)||un.match(/^[a-zA-Z]+:\/\//)?un:webModule.__moduleBase+un}function D(){var un=[],Gn=O,Yt=[],St=[];function fe(ge){var re=St[ge](),se=Yt[ge];if(re in se)return re;var Ie=[];for(var Le in se)Ie[se[Le]]=Le;throw r&&r(ge,Ie,re),null}if(__gwt_isKnownPropertyValue=function(ge,re){return re in Yt[ge]},webModule.__getPropMap=function(){var ge={};for(var re in Yt)Yt.hasOwnProperty(re)&&(ge[re]=fe(re));return ge},webModule.__computePropValue=fe,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var be;try{be=Cb;var Xe=be.indexOf(Db);Xe!=-1&&(Gn=parseInt(be.substring(Xe+P),$),be=be.substring(O,Xe))}catch(ge){}return webModule.__softPermutationId=Gn,C(be+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(un,Gn,Yt){"use strict";Yt.d(Gn,{Ax:function(){return Xe},Ds:function(){return ge},KI:function(){return se},SI:function(){return be},f1:function(){return fe}});var St=Yt(12242);function fe(Ie){let Le=!0;if(Ie.length>0){for(let $t=0;$t<Ie.length;$t++)if(Ie[$t].compile_success==0||!Ie[$t].compile_success){Le=!1;break}}else Le=!1;return Le}function be(Ie,Le=""){let $t=[];for(let Ze=0;Ze<Ie.length;Ze++){let ae=Ie[Ze],Re=Le?`${Le}/${ae.name}`:`${ae.name}`;$t.push({title:ae.name,type:ae.type,isLeaf:ae.type!=="tree",key:Re})}return $t}function Xe(Ie,Le,$t){for(let Ze=0;Ze<Ie.length;Ze++){let ae=Ie[Ze];if(ae.key===Le){ae.children=$t;break}ae.children&&Xe(ae.children,Le,$t)}return Ie}function ge(Ie,Le,$t){let Ze;return function(){let ae=this,Re=arguments,Nt=function(){Ze=null,$t||Ie.apply(ae,Re)},et=$t&&!Ze;clearTimeout(Ze),Ze=setTimeout(Nt,Le),et&&Ie.apply(ae,Re)}}const re=!0,se=St.Z.API_SERVER},39928:function(un,Gn,Yt){"use strict";Yt.d(Gn,{Z:function(){return Le}});var St=Yt(59301),fe=Yt(37568),be=Yt(96599),Xe=Yt(6767),ge={flex:"flex___eLcnP",flex1:"flex1___yUTT7",color666:"color666___TiUhG",error:"error___gTTtv",deleteIcon:"deleteIcon___mnZW1",addIcon:"addIcon___JC5NS"},re=Yt(62772);const{TextArea:se}=fe.default;class Ie extends St.Component{constructor(Ze){super(Ze),this.state={inputVisible:!1,EditInputIndex:-1}}render(){let{index:Ze,onAnswerChange:ae,addChildAnswer:Re,exerciseIsPublish:Nt,answers:et,activeOptionErrorIndex:nt,flex:ct="0 0 1000px"}=this.props;console.log("----",et);let{inputVisible:lt,EditInputIndex:pt}=this.state;return St.createElement("div",{className:ge.flex},St.createElement("div",{className:`${ge.color666} mb5 mt6`,style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",Ze+1,"):"),St.createElement("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10}},et==null?void 0:et.map((vt,Lt)=>St.createElement(St.Fragment,null,pt!==Lt?(vt==null?void 0:vt.length)>0?St.createElement(be.default,{className:"edit-tag",key:vt,closable:!((et==null?void 0:et.length)===1&&Lt===0),onClose:bt=>{bt.preventDefault(),(et==null?void 0:et.length)===1&&Lt===0?this.props.deleteChildAnswermain(Ze,Lt):this.props.deleteChildAnswer(Ze,Lt)}},St.createElement("span",{onDoubleClick:bt=>{this.setState({EditInputIndex:Lt}),bt.preventDefault()}},vt)):St.createElement(fe.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:bt=>{if(bt.target.value.replaceAll(" ","").length<=0){Xe.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}ae(Ze,Lt,bt.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}):St.createElement(fe.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:bt=>{if(bt.target.value.replaceAll(" ","").length<=0){Xe.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}ae(Ze,Lt,bt.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}))),!lt&&St.createElement(be.default,{className:"site-tag-plus",onClick:()=>{Re(Ze),this.setState({inputVisible:!0})}},St.createElement(re.Z,null)," \u65B0\u589E\u7B54\u6848")))}}var Le=Ie},43749:function(un,Gn,Yt){"use strict";Yt.d(Gn,{Z:function(){return Nt}});var St=Yt(59301),fe=Yt(19565),be=Object.defineProperty,Xe=Object.defineProperties,ge=Object.getOwnPropertyDescriptors,re=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,Ie=Object.prototype.propertyIsEnumerable,Le=(et,nt,ct)=>nt in et?be(et,nt,{enumerable:!0,configurable:!0,writable:!0,value:ct}):et[nt]=ct,$t=(et,nt)=>{for(var ct in nt||(nt={}))se.call(nt,ct)&&Le(et,ct,nt[ct]);if(re)for(var ct of re(nt))Ie.call(nt,ct)&&Le(et,ct,nt[ct]);return et},Ze=(et,nt)=>Xe(et,ge(nt)),ae=(et,nt,ct)=>Le(et,typeof nt!="symbol"?nt+"":nt,ct);const Re="\u2581";class Nt extends St.Component{constructor(){super(...arguments),ae(this,"getChCountBeforeCursor",(nt,ct)=>{const lt=ct.line;let pt=0;for(let Lt=0;Lt<lt;Lt++)pt+=nt.getLine(Lt).split(Re).length-1;const vt=nt.getLine(lt).substring(0,ct.ch);return pt+=vt.split(Re).length-1,pt}),ae(this,"onCMBeforeChange",(nt,ct)=>{const lt=nt.getRange(ct.from,ct.to);let pt=0;if(ct.text.forEach(vt=>{pt+=vt.split(Re).length-1}),lt&&lt.indexOf(Re)!=-1){const vt=lt.split(Re).length-1,Lt=this.getChCountBeforeCursor(nt,ct.from);console.log(`\u5220\u9664${vt}\u4E2A\uFF0C \u4E4B\u524D\u6709${Lt}\u4E2A\uFF0C\u65B0\u589E${pt}\u4E2A`),this.props.deleteEmptyDisabled?ct.cancel():this.props.onPlaceholderChange&&this.props.onPlaceholderChange(Lt,vt,pt)}else if(pt){const vt=this.getChCountBeforeCursor(nt,ct.from);console.log(`\u65B0\u589E${pt}\u4E2A\uFF0C\u4E4B\u524D\u6709${vt}\u4E2A`),this.props.onPlaceholderChange&&this.props.onPlaceholderChange(vt,0,pt)}})}render(){return St.createElement(fe.Z,Ze($t({},this.props),{onCMBeforeChange:this.onCMBeforeChange}))}}},25138:function(un,Gn,Yt){"use strict";Yt.d(Gn,{Z:function(){return Ze}});var St=Yt(59301),fe={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},be=Yt(92310),Xe=Yt.n(be),ge=Yt(29787),re=Yt(2859),se=Yt(24092),Ie=Yt(59895),Le=(ae,Re,Nt)=>new Promise((et,nt)=>{var ct=vt=>{try{pt(Nt.next(vt))}catch(Lt){nt(Lt)}},lt=vt=>{try{pt(Nt.throw(vt))}catch(Lt){nt(Lt)}},pt=vt=>vt.done?et(vt.value):Promise.resolve(vt.value).then(ct,lt);pt((Nt=Nt.apply(ae,Re)).next())}),Ze=({data:ae,className:Re,fullWidth:Nt,style:et={},onClose:nt,onOk:ct,showFullTools:lt,noAssociationId:pt})=>{const vt=(0,St.useRef)(null),Lt=(0,St.useRef)(null),bt=(0,St.useRef)(null),Gt=(0,St.useRef)(null),[jt,ne]=(0,St.useState)(!1),[ie,te]=(0,St.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,St.useEffect)(()=>(bt.current||(bt.current=document.createElement("style"),document.head.appendChild(bt.current)),ae!=null&&ae.visible?(document.body.setAttribute("data-custom","y-hidden"),bt.current.innerHTML=" html { overflow-y: hidden; }",ae!=null&&ae.src&&Ge()):(document.body.removeAttribute("data-custom"),bt.current&&(document.head.removeChild(bt.current),bt.current=null)),()=>{document.body.removeAttribute("data-custom"),bt.current&&(document.head.removeChild(bt.current),bt.current=null)}),[ae==null?void 0:ae.visible]);const Ge=()=>Le(void 0,null,function*(){ne(!0),te("\u6B63\u5728\u52A0\u8F7D\u4E2D");const hn=yield(0,Ie.ZJ)(ae==null?void 0:ae.src);vt.current.src="",vt.current.src=hn,vt.current.onload=function(){Ye()},ne(!1),te("")}),pe=hn=>Le(void 0,null,function*(){ne(!0),te("\u6B63\u5728\u4FDD\u5B58\u4E2D");const Fn=yield(0,se.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:ae.title,file:hn.dataUrl}});Fn!=null&&Fn.id&&!pt?(yield(0,se.ZP)(`/api/attachments/${ae.id}/add_subitem.json`,{method:"post",body:{subitem_id:Fn==null?void 0:Fn.id,settings:JSON.stringify(hn.state)}})).status===0&&ct():Fn!=null&&Fn.id&&ct(Fn),ne(!1),te("")}),Je=()=>{const hn=document.querySelector('a[href="https://markerjs.com/"]');hn&&hn.parentNode&&(hn.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(vn=>{const pi=document.querySelector(vn.name);pi&&pi.setAttribute("title",vn.title)})},Ye=()=>{Lt.current=new re.hP(vt.current),Lt.current.targetRoot=Gt.current,Lt.current.addEventListener("render",pe),Lt.current.addEventListener("beforeclose",nt),lt&&(Lt.current.availableMarkerTypes=Lt.current.ALL_MARKER_TYPES,Lt.current.uiStyleSettings.redoButtonVisible=!0,Lt.current.uiStyleSettings.notesButtonVisible=!0,Lt.current.uiStyleSettings.zoomButtonVisible=!0,Lt.current.uiStyleSettings.zoomOutButtonVisible=!0,Lt.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=Lt.current.uiStyleSettings,Lt.current.show(),ae!=null&&ae.snapshotData&&Lt.current.restoreState(ae.snapshotData),setTimeout(()=>{window.scrollTo(0,0),Je()},300)};return St.createElement(St.Fragment,null,(ae==null?void 0:ae.visible)&&St.createElement(ge.Z,{spinning:jt,tip:ie,style:{position:"absolute",width:"100vw"}},St.createElement("div",{ref:Gt,className:Xe()(fe.imageDimensions,Re,Nt?fe.fullWidth:""),style:et},St.createElement("img",{className:fe.img,ref:vt}))))}},88831:function(un,Gn,Yt){"use strict";var St=Yt(59301),fe=Yt(77019),be=Yt(5269),Xe=Yt(20554),ge=Yt(99571),re=Yt(79074),se=Yt(15547),Ie=Yt(48136),Le=Yt(59301);const $t=(0,St.forwardRef)(({callback:Ze,showSaveButton:ae,value:Re=""},Nt)=>{const et=(0,St.useRef)(),nt=[{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 "}]}]}],ct=[{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}`}]}]}],lt=Lt=>{et.current.setValue(et.current.getValue()+" "+Lt.value+" ")},pt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:Le.createElement(fe.Z,{className:se.Z.lists,gutter:[10,10]},nt.map((Lt,bt)=>Le.createElement(be.Z,{flex:"110px",className:se.Z.item},Le.createElement("div",null,Le.createElement(re.Z,{value:`$$${Lt.value}$$`}),Lt.name),Le.createElement("div",{className:se.Z.children},Lt.children.map((Gt,jt)=>Le.createElement("div",{key:jt},Le.createElement("h1",null,Gt.name),Le.createElement(fe.Z,{gutter:[10,10]},Gt.data.map((ne,ie)=>Le.createElement(be.Z,{key:ie,onClick:()=>lt(ne),className:se.Z.diamond},Le.createElement(re.Z,{value:"`$$"+ne.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:Le.createElement(fe.Z,{className:se.Z.lists,gutter:[10,10]},ct.map((Lt,bt)=>Le.createElement(be.Z,{flex:"110px",className:se.Z.item},Le.createElement("div",null,Le.createElement(re.Z,{value:"`$$"+Lt.value+"$$`"}),Lt.name),Le.createElement("div",{className:se.Z.children},Lt.children.map((Gt,jt)=>Le.createElement("div",{key:jt},Gt.name&&Le.createElement("h1",null,Gt.name),Le.createElement(fe.Z,{gutter:[10,10]},Gt.data.map((ne,ie)=>Le.createElement(be.Z,{key:ie,onClick:()=>lt(ne),className:se.Z.diamond},Le.createElement(re.Z,{value:"`$$"+ne.value+"$$`"}))))))))))}],vt=()=>{var Lt=document.createElement("div");Lt.innerHTML=et.current.getValue();var bt=Lt.innerText;return Ze&&Ze(bt),bt};return(0,St.useImperativeHandle)(Nt,()=>({getData:vt})),Le.createElement("div",{className:se.Z.mathWrap},Le.createElement(Xe.default,{defaultActiveKey:"1",items:pt}),Le.createElement("math-field",{locale:"zh_cn",className:se.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:et,style:{width:800,marginTop:30,fontSize:18}},Re||""),ae&&Le.createElement("div",{className:se.Z.button},Le.createElement(ge.ZP,{size:"large",onClick:vt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});Gn.Z=$t},12635:function(un,Gn,Yt){"use strict";var St=Yt(59301),fe=Yt(93314),be=Yt(99571),Xe=Object.defineProperty,ge=Object.defineProperties,re=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,$t=(Nt,et,nt)=>et in Nt?Xe(Nt,et,{enumerable:!0,configurable:!0,writable:!0,value:nt}):Nt[et]=nt,Ze=(Nt,et)=>{for(var nt in et||(et={}))Ie.call(et,nt)&&$t(Nt,nt,et[nt]);if(se)for(var nt of se(et))Le.call(et,nt)&&$t(Nt,nt,et[nt]);return Nt},ae=(Nt,et)=>ge(Nt,re(et));const Re=({img:Nt,buttonProps:et={},styles:nt={},customText:ct,ButtonText:lt,ButtonClick:pt,Buttonclass:vt,ButtonTwo:Lt,imgStyles:bt,loading:Gt=!1,className:jt=""})=>St.createElement("section",{className:`tc animated fadeIn ${jt}`,style:Ze({color:"#999",margin:"100px auto",visibility:Gt?"hidden":"visible"},nt)},St.createElement("img",{src:Nt||fe,style:ae(Ze({},bt),{pointerEvents:"none",userSelect:"none"})}),St.createElement("p",{className:"mt20 font14"},ct||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),lt&&St.createElement(be.ZP,Ze({className:vt,onClick:pt},et),lt),Lt&&Lt);Gn.Z=Re},6311:function(un,Gn,Yt){"use strict";Yt.d(Gn,{Z:function(){return vt}});var St=Yt(59301),fe={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},be=Yt(99571),Xe=Yt(70557),ge=Yt(89081),re=Yt(25399),se=Yt(59895),Ie=Yt(76011),Le=Yt(12635),$t=Yt(12242),Ze=Yt(65789),ae=Yt(59301),Re=Object.defineProperty,Nt=Object.getOwnPropertySymbols,et=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,ct=(Lt,bt,Gt)=>bt in Lt?Re(Lt,bt,{enumerable:!0,configurable:!0,writable:!0,value:Gt}):Lt[bt]=Gt,lt=(Lt,bt)=>{for(var Gt in bt||(bt={}))et.call(bt,Gt)&&ct(Lt,Gt,bt[Gt]);if(Nt)for(var Gt of Nt(bt))nt.call(bt,Gt)&&ct(Lt,Gt,bt[Gt]);return Lt},pt=(Lt,bt,Gt)=>new Promise((jt,ne)=>{var ie=pe=>{try{Ge(Gt.next(pe))}catch(Je){ne(Je)}},te=pe=>{try{Ge(Gt.throw(pe))}catch(Je){ne(Je)}},Ge=pe=>pe.done?jt(pe.value):Promise.resolve(pe.value).then(ie,te);Ge((Gt=Gt.apply(Lt,bt)).next())}),vt=({editOffice:Lt="view",data:bt,theme:Gt,type:jt,filename:ne,monacoEditor:ie,className:te,style:Ge,close:pe,onClose:Je,hasMask:Ye,disabledDownload:hn,onImgDimensions:Fn,showNodata:vn,recordInfo:pi})=>{const[yn,ce]=(0,St.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[Kt,tn]=(0,St.useState)(""),[Yn,Dn]=(0,St.useState)(),je=window.ENV==="build"?"/react/build":"",gn=location.host.startsWith("localhost")?$t.Z.PROXY_SERVER:$t.Z.API_SERVER,Jn=10*(1024*1024),Pn=(0,St.useRef)();bt!=null&&bt.startsWith("/api")&&jt!=="txt"&&(bt=$t.Z.API_SERVER+bt);const Qn=Dt=>Dt.substring(Dt.lastIndexOf("/")+1).split(".").pop();ne&&ie&&(ie.filename=ne),(0,St.useEffect)(()=>{var Dt,kt;const wt=(kt=(Dt=document.cookie)==null?void 0:Dt.replace(/\s/g,""))==null?void 0:kt.split(";");wt==null||wt.map(At=>{let _t=At.split("=");_t[0]==="_educoder_session"&&tn(_t[1])})},[]),(0,St.useEffect)(()=>{jt==="office"&&(bt.indexOf("bigfilescdn.")>-1||bt.indexOf("bigfiles1")>-1?Dn({url:bt,fileType:Qn(bt),model:bt.indexOf("model=edit")?"edit":"view"}):ee())},[jt,bt]);const ee=()=>pt(void 0,null,function*(){console.log("data:",bt);let Dt=bt;bt.startsWith("http")||(Dt=location.origin+Dt);let kt=new URL(Dt).pathname.split("/").pop();const wt=yield(0,Ie.gJ)({attachment_id:kt});wt.url=gn+wt.url,Dn(wt)}),jn=()=>{if(bt.startsWith("http")||bt.startsWith("blob:")){hi();return}(0,se.Sv)(ne||"educoder",bt,ne)},hi=()=>{pi&&(0,Ze.fc)({id:pi==null?void 0:pi.id,watch_type:1,course_id:pi==null?void 0:pi.course_id}),(0,se.Nd)(ne||"educoder",decodeURIComponent(bt))};return ae.createElement("div",{style:lt({},Ge||{}),className:`${Ye&&fe.bgBlack} ${jt?fe.wrp:"hide"}`},pe&&ae.createElement("div",{className:fe.close,ref:Pn},!!Fn&&ae.createElement(re.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Pn.current},ae.createElement("span",{onClick:()=>{Je(),Fn()}},ae.createElement("i",{className:"icon-yulanpizhu"}))),!hn&&ae.createElement(re.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Pn.current},ae.createElement("span",{onClick:hi},ae.createElement("i",{className:"icon-quxiaozhiding"}))),ae.createElement(re.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Pn.current},ae.createElement("span",{className:"",onClick:Je},ae.createElement("i",{className:"icon-guanbi1"})))),ae.createElement("div",{className:`${fe[te]} ${te} ${fe.monaco} ${jt==="txt"?"show":"hide"}`},jt==="txt"&&ae.createElement(ae.Fragment,null,ae.createElement(ge.ZP,lt({},ie)))),jt==="audio"&&ae.createElement("audio",{src:`${(bt==null?void 0:bt.indexOf("http://"))>-1||(bt==null?void 0:bt.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${bt}`,autoPlay:!0}),jt==="video"&&ae.createElement(ae.Fragment,null,(bt==null?void 0:bt.indexOf("http"))>-1?ae.createElement("video",{controls:!0,src:`${bt}`,autoPlay:!0}):ae.createElement("video",{controls:!0,src:`data:video/mp4;base64,${bt}`,autoPlay:!0})),jt==="office"&&Yn&&ae.createElement("iframe",{src:`${je}/office.html?key=${Yn.key}&url=${btoa(Yn.url)}&callbackUrl=${gn+(Yn.callbackUrl||"")}&fileType=${Yn.fileType}&title=${Yn.title||""}&model=${Lt}&officeServer=${$t.Z.ONLYOFFICE}&disabledDownload=${!!hn}`}),jt==="html"&&ae.createElement("iframe",{src:bt+"&disposition=inline"}),jt==="pdf"&&ae.createElement("iframe",{src:`${je}/js/pdfview/index.html?filename=${ne||"educoder.pdf"}&url=${encodeURIComponent(bt)}&disabledDownload=${!!hn}`}),jt==="image"&&ae.createElement("img",{src:`${(bt==null?void 0:bt.indexOf("http://"))>-1||(bt==null?void 0:bt.indexOf("https://"))>-1?"":"data:image/png;base64,"}${bt}`}),(jt==="other"||jt==="download")&&ae.createElement(ae.Fragment,null,vn?ae.createElement(Le.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:ae.createElement(be.ZP,{icon:ae.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:jn,disabled:hn},"\u4E0B\u8F7D")}):ae.createElement(be.ZP,{type:"primary",size:"middle",onClick:jn,disabled:hn},ae.createElement(Xe.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},79074:function(un,Gn,Yt){"use strict";Yt.d(Gn,{z:function(){return jt},Z:function(){return ne}});var St=Yt(59301),fe=Yt(53122),be=Yt(49405),Xe=Yt(64018),ge=Yt(79710),re=Yt(12242),se=Yt(59895),Ie=Yt(15342),Le=Yt(1012),$t=Yt(6311),Ze=Yt(59301),Re=({html:ie})=>{const te=(0,St.useRef)(null),Ge=(0,St.useRef)(null),pe=`.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,St.useEffect)(()=>{const Je=te.current.attachShadow({mode:"open"});Ge.current=document.createElement("div"),Ge.current.className="markdown-body",Ge.current.innerHTML=ie,Je.appendChild(Ge.current);const Ye=document.createElement("style");return Ye.textContent=pe,Je.appendChild(Ye),()=>{Je.innerHTML=""}},[]),(0,St.useEffect)(()=>{Ge.current&&(Ge.current.innerHTML=ie)},[ie]),Ze.createElement("div",{ref:te})},Nt=Object.defineProperty,et=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,ct=Object.prototype.propertyIsEnumerable,lt=(ie,te,Ge)=>te in ie?Nt(ie,te,{enumerable:!0,configurable:!0,writable:!0,value:Ge}):ie[te]=Ge,pt=(ie,te)=>{for(var Ge in te||(te={}))nt.call(te,Ge)&&lt(ie,Ge,te[Ge]);if(et)for(var Ge of et(te))ct.call(te,Ge)&&lt(ie,Ge,te[Ge]);return ie};const vt="@\u2581\u2581@",Lt="@\u2581@",bt=/<pre[^>]*>/g;function Gt(ie){let te=document.createElement("div");return te.innerHTML=ie,te.childNodes.length===0?"":te.childNodes[0].nodeValue}const jt=(ie,te)=>{ie=ie||"";const Ge=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,pe=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Je=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Ye=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return te?ie.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(Ge,(hn,Fn,vn,pi,yn,ce,Kt)=>{const tn=Fn||pi||ce,Yn=vn||yn||Kt||"?";return re.Z.API_SERVER+"/api/attachments/"+tn+Yn+"&t="+(0,se.Jn)(tn,Date.now())+(hn.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(ie=ie.replace(Ye,(hn,Fn,vn,pi,yn,ce,Kt)=>{const tn=Fn||pi||ce,Yn=vn||yn||Kt||"?";return re.Z.API_SERVER+"/attachments/download/"+tn+Yn+"&t="+(0,se.Jn)(tn,Date.now())+(hn.indexOf(")")>-1?")":"&")}).replace(Ge,(hn,Fn,vn,pi,yn,ce,Kt)=>{const tn=Fn||pi||ce,Yn=vn||yn||Kt||"?";return re.Z.API_SERVER+"/api/attachments/"+tn+Yn+"&t="+(0,se.Jn)(tn,Date.now())+(hn.indexOf(")")>-1?")":"&")}).replace(pe,(hn,Fn,vn,pi,yn)=>{const ce=Fn||pi,Kt=vn||yn||"";return'"'+re.Z.API_SERVER+"/api/attachments/"+ce+Kt+ce+Kt+"&t="+(0,se.Jn)(ce,Date.now())}).replace(Je,(hn,Fn,vn,pi,yn)=>{const ce=Fn||pi,Kt=vn||yn||"";return"("+re.Z.API_SERVER+"/files/uploads/"+ce+Kt+ce+Kt+"&t="+(0,se.Jn)(ce,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,`
`),ie)};var ne=({value:ie="",className:te,showTextOnly:Ge,showLines:pe,style:Je={},stylesPrev:Ye={},highlightKeywords:hn,showProgramFill:Fn,isProgramFill:vn,disabledFill:pi=!1,programFillValue:yn,onFillChange:ce=Yn=>{},onFillBlur:Kt=()=>{},onFillFocus:tn=()=>{}})=>{let Yn=String(ie);const[Dn,je]=(0,St.useState)(""),[gn,Tn]=(0,St.useState)("office"),[Jn,Pn]=(0,St.useState)([]),Qn=(0,St.useRef)("a"+(0,Le.Z)()),ee={},jn=(Ae,qe,en)=>{const dn=document.createElement(Ae===Lt?"input":"textarea");dn.style.width="100%",dn.style.height=Ae===Lt?"40px":"151px",dn.rows=5,dn.spellcheck=!1,dn.name="edu-program-fill",dn.placeholder="\u8BF7\u8F93\u5165",dn.dataset.id=qe;const An=Object.keys(ee).length;return ee[An]=dn,`<span class="edu-program-fill-wrap ${Ae===Lt?"":"show"}" style="width:${Ae===Lt?"400px":"100%"}" title=${en||""}><span>${dn.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function hi(Ae){return Ae=Ae.replace(/!\[.*?\]\(.*?\)/g,""),Ae=Ae.replace(/\[.*?\]\(.*?\)/g,""),Ae=Ae.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),Ae=Ae.replace(/<embed.*?>/g,""),Ae=Ae.replace(/<img.*?>/g,""),Ae=Ae.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),Ae=Ae.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),Ae=Ae.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),Ae=Ae.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),Ae}const Dt=Ae=>Ae.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(qe,en){let dn=en.replace(/(\n|\r)/g,"").split("}"),An=[];return dn.map(_n=>{_n!=""&&An.push(`.${Qn.current} ${_n}`)}),`<style>${An.join("}")}</style>`}),kt=(0,St.useMemo)(()=>{try{const dn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,An=/\"\/api\/attachments\/|\"\/attachments\/download\//g,_n=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,fn=/\(\/attachments\/download\//g;Yn=Yn.replace(fn,"("+re.Z.API_SERVER+"/attachments/download/").replace(dn,"("+re.Z.API_SERVER+"/api/attachments/").replace(An,'"'+re.Z.API_SERVER+"/api/attachments/").replace(_n,'"'+re.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(dn){}if(Fn){let dn=-1;return Yn=Yn.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,function(An,_n,fn){var Zi;return++dn,jn(An,dn,(Zi=yn==null?void 0:yn[dn])==null?void 0:Zi.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))}),`<pre style="background:#fff;padding:4px">${Dt(Yn||"")}</pre>`}let Ae=Dt(Yn);Ae=(0,be.ZP)(Ae);const qe=(0,be.ez)();Yn.match(/\[TOC\]/)&&(Ae=Ae.replace("<p>[TOC]</p>",(0,be.Qv)()),(0,be.Iy)()),Ae=Ae.replace(/(__special_katext_id_\d+__)/g,(dn,An)=>{const{type:_n,expression:fn}=qe[An];return(0,Ie.renderToString)(Gt(fn)||"",{displayMode:_n==="block",throwOnError:!1,output:"html"})}),Ae=Ae.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,be.AL)();const en=document.createElement("div");if(en.innerHTML=Ae,Ge)return en.innerText;if(hn){const dn=hn.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return Et(en,dn),en.innerHTML}return setTimeout(()=>sn(),500),en.innerHTML},[Yn,hn]);(0,St.useEffect)(()=>{Pe.current&&Pe.current.querySelectorAll(["input","textarea"]).forEach(qe=>{qe.oninput=wt,qe.onblur=At,qe.onfocus=_t})},[Jn]),(0,St.useEffect)(()=>{var Ae,qe,en,dn,An;if(yn!=null&&yn.length)try{const _n=Pe.current.querySelectorAll(".edu-program-fill-score"),fn=Pe.current.querySelectorAll('[name="edu-program-fill"]');for(const[Zi,Pi]of fn.entries())Pi.value=((Ae=yn==null?void 0:yn[Zi])==null?void 0:Ae.value)||"",((qe=yn==null?void 0:yn[Zi])==null?void 0:qe.type)==="warning"?Pi.className="program-fill-warning":((en=yn==null?void 0:yn[Zi])==null?void 0:en.type)==="success"?Pi.className="program-fill-success":Pi.className="";for(const[Zi,Pi]of _n.entries())Pi.innerHTML=(dn=yn==null?void 0:yn[Zi])!=null&&dn.score?`${(An=yn==null?void 0:yn[Zi])==null?void 0:An.score}\u5206`:"";Pn(yn)}catch(_n){console.log(_n,"error")}},[yn]);const wt=Ae=>{Jn[Ae.target.dataset.id]=Jn[Ae.target.dataset.id]||{},Jn[Ae.target.dataset.id].value=Ae.target.value,Pn([...Jn]),ce(Jn,Ae.target.dataset.id)},At=Ae=>{Jn[Ae.target.dataset.id]=Jn[Ae.target.dataset.id]||{},Jn[Ae.target.dataset.id].value=Ae.target.value,Pn([...Jn]),Kt(Jn,Ae.target.dataset.id)},_t=Ae=>{Jn[Ae.target.dataset.id]=Jn[Ae.target.dataset.id]||{},Jn[Ae.target.dataset.id].value=Ae.target.value,Pn([...Jn]),tn(Jn,Ae.target.dataset.id)};function Et(Ae,qe){return Ae.childNodes.forEach(en=>{var dn;if(en.childNodes.length>0)Et(en,qe);else if(en.nodeName!=="IMG")if(en.innerHTML)en.innerHTML=(dn=en.innerHTML)==null?void 0:dn.replace(new RegExp(qe,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const An=document.createElement("span");An.innerHTML=en.textContent.replace(new RegExp(qe,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),en.replaceWith(An)}})}const Pe=(0,St.useRef)();be.jb.WebkitLineClamp=pe,pe&&(Je=pt(pt({},Je),be.jb));function Ee(Ae){let qe=Ae.target;if(qe.tagName.toUpperCase()==="A"){let en=qe.getAttribute("href");if(en.indexOf("office")>-1)Ae.preventDefault(),je(en),Tn("office");else if(en.indexOf("application/pdf")>-1)Ae.preventDefault(),je(en),Tn("pdf");else if(en.indexOf("text/html")>-1)Ae.preventDefault(),je(en),Tn("html");else if(en.startsWith("#")){Ae.preventDefault();let dn=document.getElementById(en.replace("#",""));dn&&dn.scrollIntoView(!0)}}}const sn=()=>{var Ae;const qe=(Ae=Pe.current)==null?void 0:Ae.querySelectorAll("video");qe==null||qe.forEach(en=>{if(en.oncontextmenu=()=>!1,en.src.indexOf(".m3u8")>-1&&!en.canPlayType("application/vnd.apple.mpegurl")){if(ge.ZP.isSupported()){var dn=new ge.ZP;dn.loadSource(en.src),dn.attachMedia(en)}}})};(0,St.useEffect)(()=>{if(Pe.current&&kt&&kt.match(bt)&&window.PR.prettyPrint(),Pe.current)return Pe.current.addEventListener("click",Ee),()=>{var Ae;(Ae=Pe.current)==null||Ae.removeEventListener("click",Ee),(0,be.AL)(),(0,be.Iy)()}},[kt,Pe.current,Ee]),(0,St.useEffect)(()=>{var Ae;const qe=en=>{en.preventDefault(),en.clipboardData.setData("text",window.getSelection().toString())};return(Ae=Pe.current)==null||Ae.addEventListener("copy",qe),()=>{var en;(en=Pe.current)==null||en.removeEventListener("copy",qe)}},[Pe.current]);const He=Ae=>/<style[\s\S]*?>/i.test(Ae||"");return St.createElement(St.Fragment,null,Ge&&St.createElement("div",{ref:Pe},kt),!Ge&&!He(kt)&&St.createElement("div",{ref:Pe,style:pt({},Je),className:`${te||""} ${pi?"disabled-fill":""} markdown-body ${Qn.current}`,dangerouslySetInnerHTML:{__html:kt}}),!Ge&&He(kt)&&St.createElement(Re,{html:kt}),St.createElement($t.Z,{close:!0,data:Dn,type:Dn!=null&&Dn.length?gn:"",style:pt({},Ye),onClose:()=>je("")}))}},77531:function(un,Gn,Yt){"use strict";Yt.d(Gn,{h:function(){return Lt}});var St=Yt(59301),fe=Yt(82326),be=Yt(28284),Xe=Yt(99571),ge=Yt(89780),re=Yt.n(ge),se=Yt(88540),Ie=Yt(42271),Le=Object.defineProperty,$t=Object.defineProperties,Ze=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable,et=(bt,Gt,jt)=>Gt in bt?Le(bt,Gt,{enumerable:!0,configurable:!0,writable:!0,value:jt}):bt[Gt]=jt,nt=(bt,Gt)=>{for(var jt in Gt||(Gt={}))Re.call(Gt,jt)&&et(bt,jt,Gt[jt]);if(ae)for(var jt of ae(Gt))Nt.call(Gt,jt)&&et(bt,jt,Gt[jt]);return bt},ct=(bt,Gt)=>$t(bt,Ze(Gt));const lt=fe.default.Option,pt={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:bt,onCancel:Gt})=>{const[jt,ne]=(0,St.useState)("python");function ie(Ge){ne(vt[Ge][1])}function te(Ge){bt(Ge)}return St.createElement(be.default,ct(nt({},pt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:te,style:{width:500}}),St.createElement(be.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},St.createElement(fe.default,{getPopupContainer:Ge=>Ge.parentNode,onChange:ie},Object.keys(vt).map(Ge=>St.createElement(lt,{key:Ge,value:Ge},vt[Ge][0])))),St.createElement(be.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},St.createElement(Lt,{mode:jt})),St.createElement("div",{className:"flex-container flex-end"},St.createElement(Xe.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),St.createElement(Xe.ZP,{type:"ghost",onClick:Gt},"\u53D6\u6D88")))};function Lt({value:bt,onChange:Gt,mode:jt,options:ne={}}){const ie=(0,St.useRef)(),[te,Ge]=(0,St.useState)();return(0,St.useEffect)(()=>{if(te){let pe=function(Je){const Ye=Je.getValue();Gt&&Gt(Ye)};return te.on("change",pe),()=>{te.off("change",pe)}}},[te,Gt]),(0,St.useEffect)(()=>{te&&te.setOption("mode",jt)},[te,jt]),(0,St.useEffect)(()=>{te&&(bt!==te.getValue()||bt==="")&&setTimeout(()=>{te.setValue(bt||"")},300)},[te,bt]),(0,St.useEffect)(()=>{if(ie.current&&!te){const pe=re().fromTextArea(ie.current,nt({mode:jt,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},ne));Ge(pe)}},[ie.current,te]),St.createElement("div",{className:"my-codemirror-container"},St.createElement("textarea",{ref:ie}))}},19565:function(un,Gn,Yt){"use strict";Yt.d(Gn,{Z:function(){return In}});var St=Yt(59301),fe=Yt(89780),be=Yt.n(fe),Xe=Yt(76374),ge=Yt(88540),re=Yt(6313),se=Yt(25717),Ie=Yt(99498),Le=Yt(25419),$t=Yt(67549),Ze=Yt(79074),ae=({value:ve="",className:he,showTextOnly:oe,showLines:xn,style:Cn={}})=>{const Zn=(0,St.useMemo)(()=>"",[ve]);return St.createElement(St.Fragment,null,St.createElement("div",{dangerouslySetInnerHTML:{__html:Zn}}))},Re=Yt(59301),Nt=Object.defineProperty,et=Object.defineProperties,nt=Object.getOwnPropertyDescriptors,ct=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,vt=(ve,he,oe)=>he in ve?Nt(ve,he,{enumerable:!0,configurable:!0,writable:!0,value:oe}):ve[he]=oe,Lt=(ve,he)=>{for(var oe in he||(he={}))lt.call(he,oe)&&vt(ve,oe,he[oe]);if(ct)for(var oe of ct(he))pt.call(he,oe)&&vt(ve,oe,he[oe]);return ve},bt=(ve,he)=>et(ve,nt(he));let Gt=[{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 jt({onActionCallback:ve,title:he,icon:oe,actionName:xn,className:Cn="",children:Zn}){function Ke(){ve(xn)}return Re.createElement("a",{title:he,className:Cn,onClick:Ke},Re.createElement("i",{className:`${oe}`}),Zn)}var ne=({watch:ve,showNullButton:he,showNullProgramButton:oe,onActionCallback:xn,fullScreen:Cn,insertTemp:Zn,hidetoolBar:Ke,extraUse:pn})=>{const me=[...Gt,{title:`${ve?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${ve?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return Re.createElement("ul",{className:"markdown-toolbar-container"},!Ke&&me.map((de,Sn)=>Re.createElement("li",{key:Sn},de.actionName?Re.createElement(jt,bt(Lt({},de),{onActionCallback:xn})):Re.createElement("span",{className:"v-line"}))),he?Re.createElement("li",null,Re.createElement(jt,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:xn},Re.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,oe?Re.createElement(Re.Fragment,null,Re.createElement("li",null,Re.createElement(jt,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:xn},Re.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),Re.createElement("li",null,Re.createElement(jt,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:xn},Re.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,Zn&&Re.createElement("li",null,Re.createElement(jt,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Zn}`,onActionCallback:xn},Re.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),pn&&Re.createElement("li",null,pn),Re.createElement("li",{className:"btn-full-screen"},Re.createElement(jt,{icon:`${Cn?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Cn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:xn})))},ie=Yt(52272),te=Yt(28284),Ge=Yt(37568),pe=Yt(99571),Je=Object.defineProperty,Ye=Object.defineProperties,hn=Object.getOwnPropertyDescriptors,Fn=Object.getOwnPropertySymbols,vn=Object.prototype.hasOwnProperty,pi=Object.prototype.propertyIsEnumerable,yn=(ve,he,oe)=>he in ve?Je(ve,he,{enumerable:!0,configurable:!0,writable:!0,value:oe}):ve[he]=oe,ce=(ve,he)=>{for(var oe in he||(he={}))vn.call(he,oe)&&yn(ve,oe,he[oe]);if(Fn)for(var oe of Fn(he))pi.call(he,oe)&&yn(ve,oe,he[oe]);return ve},Kt=(ve,he)=>Ye(ve,hn(he));const tn={labelCol:{span:4},wrapperCol:{span:20}};var Yn=({callback:ve,onCancel:he})=>{function oe(xn){ve(xn)}return St.createElement(te.default,Kt(ce({},tn),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:oe,style:{width:500}}),St.createElement(te.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},St.createElement(Ge.default,null)),St.createElement(te.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},St.createElement(Ge.default,null)),St.createElement("div",{className:"flex-container flex-end"},St.createElement(pe.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),St.createElement(pe.ZP,{type:"ghost",onClick:he},"\u53D6\u6D88")))},Dn=Yt(77531),je=Yt(24141),gn=Yt(62957),Tn=Yt(77019),Jn=Yt(25138),Pn=Yt(59301),Qn=({callback:ve,onCancel:he})=>{const oe=document.createElement("canvas"),xn=oe.getContext("2d");oe.width=1e3,oe.height=800,xn.fillStyle="#ffffff",xn.fillRect(0,0,oe.width,oe.height);const Cn=oe.toDataURL("image/png");return Pn.createElement(gn.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},Pn.createElement(Tn.Z,{style:{height:"100vh"}},Pn.createElement(Jn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Cn,visible:!0,title:String(Date.now())},onOk:Zn=>{ve({src:Zn.url})},onClose:he})))},ee=Yt(12378);function jn(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(jn,go.CommandHandler),jn.prototype.canAlignSelection=function(){var ve=this.diagram;return!(ve===null||ve.isReadOnly||ve.isModelReadOnly||ve.selection.count<2)},jn.prototype.alignLeft=function(){var ve=this.diagram;ve.startTransaction("aligning left");var he=1/0;ve.selection.each(function(oe){oe instanceof go.Link||(he=Math.min(oe.position.x,he))}),ve.selection.each(function(oe){oe instanceof go.Link||oe.move(new go.Point(he,oe.position.y))}),ve.commitTransaction("aligning left")},jn.prototype.alignRight=function(){var ve=this.diagram;ve.startTransaction("aligning right");var he=-1/0;ve.selection.each(function(oe){if(!(oe instanceof go.Link)){var xn=oe.actualBounds.x+oe.actualBounds.width;he=Math.max(xn,he)}}),ve.selection.each(function(oe){oe instanceof go.Link||oe.move(new go.Point(he-oe.actualBounds.width,oe.position.y))}),ve.commitTransaction("aligning right")},jn.prototype.alignTop=function(){var ve=this.diagram;ve.startTransaction("alignTop");var he=1/0;ve.selection.each(function(oe){oe instanceof go.Link||(he=Math.min(oe.position.y,he))}),ve.selection.each(function(oe){oe instanceof go.Link||oe.move(new go.Point(oe.position.x,he))}),ve.commitTransaction("alignTop")},jn.prototype.alignBottom=function(){var ve=this.diagram;ve.startTransaction("aligning bottom");var he=-1/0;ve.selection.each(function(oe){if(!(oe instanceof go.Link)){var xn=oe.actualBounds.y+oe.actualBounds.height;he=Math.max(xn,he)}}),ve.selection.each(function(oe){oe instanceof go.Link||oe.move(new go.Point(oe.actualBounds.x,he-oe.actualBounds.height))}),ve.commitTransaction("aligning bottom")},jn.prototype.alignCenterX=function(){var ve=this.diagram,he=ve.selection.first();if(he){ve.startTransaction("aligning Center X");var oe=he.actualBounds.x+he.actualBounds.width/2;ve.selection.each(function(xn){xn instanceof go.Link||xn.move(new go.Point(oe-xn.actualBounds.width/2,xn.actualBounds.y))}),ve.commitTransaction("aligning Center X")}},jn.prototype.alignCenterY=function(){var ve=this.diagram,he=ve.selection.first();if(he){ve.startTransaction("aligning Center Y");var oe=he.actualBounds.y+he.actualBounds.height/2;ve.selection.each(function(xn){xn instanceof go.Link||xn.move(new go.Point(xn.actualBounds.x,oe-xn.actualBounds.height/2))}),ve.commitTransaction("aligning Center Y")}},jn.prototype.alignColumn=function(ve){var he=this.diagram;he.startTransaction("align Column"),ve===void 0&&(ve=0),ve=parseFloat(ve);var oe=new Array;he.selection.each(function(pn){pn instanceof go.Link||oe.push(pn)});for(var xn=0;xn<oe.length-1;xn++){var Cn=oe[xn],Zn=Cn.actualBounds.y+Cn.actualBounds.height+ve,Ke=oe[xn+1];Ke.move(new go.Point(Cn.actualBounds.x,Zn))}he.commitTransaction("align Column")},jn.prototype.alignRow=function(ve){ve===void 0&&(ve=0),ve=parseFloat(ve);var he=this.diagram;he.startTransaction("align Row");var oe=new Array;he.selection.each(function(pn){pn instanceof go.Link||oe.push(pn)});for(var xn=0;xn<oe.length-1;xn++){var Cn=oe[xn],Zn=Cn.actualBounds.x+Cn.actualBounds.width+ve,Ke=oe[xn+1];Ke.move(new go.Point(Zn,Cn.actualBounds.y))}he.commitTransaction("align Row")},jn.prototype.canRotate=function(ve){var he=this.diagram;return!(he===null||he.isReadOnly||he.isModelReadOnly||he.selection.count<1)},jn.prototype.rotate=function(ve){ve===void 0&&(ve=90);var he=this.diagram;he.startTransaction("rotate "+ve.toString());var he=this.diagram;he.selection.each(function(oe){oe instanceof go.Link||oe instanceof go.Group||(oe.angle+=ve)}),he.commitTransaction("rotate "+ve.toString())},jn.prototype.pullToFront=function(){var ve=this.diagram;ve.startTransaction("pullToFront");var he=new go.Map;ve.selection.each(function(oe){he.set(oe.layer,0)}),he.iteratorKeys.each(function(oe){var xn=0;oe.parts.each(function(Cn){if(!Cn.isSelected){var Zn=Cn.zOrder;isNaN(Zn)?Cn.zOrder=0:xn=Math.max(xn,Zn)}}),he.set(oe,xn)}),ve.selection.each(function(oe){jn._assignZOrder(oe,he.get(oe.layer)+1)}),ve.commitTransaction("pullToFront")},jn.prototype.pushToBack=function(){var ve=this.diagram;ve.startTransaction("pushToBack");var he=new go.Map;ve.selection.each(function(oe){he.set(oe.layer,0)}),he.iteratorKeys.each(function(oe){var xn=0;oe.parts.each(function(Cn){if(!Cn.isSelected){var Zn=Cn.zOrder;isNaN(Zn)?Cn.zOrder=0:xn=Math.min(xn,Zn)}}),he.set(oe,xn)}),ve.selection.each(function(oe){jn._assignZOrder(oe,he.get(oe.layer)-1-jn._findGroupDepth(oe))}),ve.commitTransaction("pushToBack")},jn._assignZOrder=function(ve,he,oe){oe===void 0&&(oe=ve),ve.layer===oe.layer&&(ve.zOrder=he),ve instanceof go.Group&&ve.memberParts.each(function(xn){jn._assignZOrder(xn,he+1,oe)})},jn._findGroupDepth=function(ve){if(ve instanceof go.Group){var he=0;return ve.memberParts.each(function(oe){he=Math.max(he,jn._findGroupDepth(oe))}),he+1}else return 0},jn.prototype.doKeyDown=function(){var ve=this.diagram;if(ve!==null){var he=ve.lastInput;if(he.key==="Up"||he.key==="Down"||he.key==="Left"||he.key==="Right"){var oe=this.arrowKeyBehavior;if(oe==="none")return;if(oe==="select"){this._arrowKeySelect();return}else if(oe==="move"){this._arrowKeyMove();return}else if(oe==="tree"){this._arrowKeyTree();return}}go.CommandHandler.prototype.doKeyDown.call(this)}},jn.prototype._getAllParts=function(){var ve=new Array;return this.diagram.nodes.each(function(he){ve.push(he)}),this.diagram.parts.each(function(he){ve.push(he)}),ve},jn.prototype._arrowKeyMove=function(){var ve=this.diagram,he=ve.lastInput,oe=0,xn=0;if(he.control||he.meta)oe=1,xn=1;else if(ve.grid!==null){var Cn=ve.grid.gridCellSize;xn=Cn.width,oe=Cn.height}ve.startTransaction("arrowKeyMove"),ve.selection.each(function(Zn){he.key==="Up"?Zn.move(new go.Point(Zn.actualBounds.x,Zn.actualBounds.y-oe)):he.key==="Down"?Zn.move(new go.Point(Zn.actualBounds.x,Zn.actualBounds.y+oe)):he.key==="Left"?Zn.move(new go.Point(Zn.actualBounds.x-xn,Zn.actualBounds.y)):he.key==="Right"&&Zn.move(new go.Point(Zn.actualBounds.x+xn,Zn.actualBounds.y))}),ve.commitTransaction("arrowKeyMove")},jn.prototype._arrowKeySelect=function(){var ve=this.diagram,he=ve.lastInput,oe=null;he.key==="Up"?oe=this._findNearestPartTowards(270):he.key==="Down"?oe=this._findNearestPartTowards(90):he.key==="Left"?oe=this._findNearestPartTowards(180):he.key==="Right"&&(oe=this._findNearestPartTowards(0)),oe!==null&&(he.shift?oe.isSelected=!0:he.control||he.meta?oe.isSelected=!oe.isSelected:ve.select(oe))},jn.prototype._findNearestPartTowards=function(ve){var he=this.diagram.selection.first();if(he===null)return null;for(var oe=he.actualBounds.center,xn=this._getAllParts(),Cn=1/0,Zn=he,Ke=0;Ke<xn.length;Ke++){var pn=xn[Ke];if(pn!==he&&pn.canSelect()){var me=pn.actualBounds.center,de=oe.directionPoint(me),Sn=this._angleCloseness(de,ve);if(Sn<=45){var Wt=oe.distanceSquaredPoint(me);Wt*=1+Math.sin(Sn*Math.PI/180),Wt<Cn&&(Cn=Wt,Zn=pn)}}}return Zn},jn.prototype._angleCloseness=function(ve,he){return Math.min(Math.abs(he-ve),Math.min(Math.abs(he+360-ve),Math.abs(he-360-ve)))},jn.prototype._arrowKeyTree=function(){var ve=this.diagram,he=ve.selection.first();if(he instanceof go.Node){var oe=ve.lastInput;if(oe.key==="Right"){if(!he.isTreeLeaf)if(!he.isTreeExpanded)ve.commandHandler.canExpandTree(he)&&ve.commandHandler.expandTree(he);else{var xn=this._sortTreeChildrenByY(he).first();xn!==null&&ve.select(xn)}}else if(oe.key==="Left")if(!he.isTreeLeaf&&he.isTreeExpanded)ve.commandHandler.canCollapseTree(he)&&ve.commandHandler.collapseTree(he);else{var Cn=he.findTreeParentNode();Cn!==null&&ve.select(Cn)}else if(oe.key==="Up"){var Cn=he.findTreeParentNode();if(Cn!==null){var Zn=this._sortTreeChildrenByY(Cn),Ke=Zn.indexOf(he);if(Ke>0){for(var pn=Zn.elt(Ke-1);pn!==null&&pn.isTreeExpanded&&!pn.isTreeLeaf;){var me=this._sortTreeChildrenByY(pn);pn=me.last()}pn!==null&&ve.select(pn)}else ve.select(Cn)}}else if(oe.key==="Down")if(he.isTreeExpanded&&!he.isTreeLeaf){var xn=this._sortTreeChildrenByY(he).first();xn!==null&&ve.select(xn)}else for(;he!==null;){var Cn=he.findTreeParentNode();if(Cn===null)break;var Zn=this._sortTreeChildrenByY(Cn),Ke=Zn.indexOf(he);if(Ke<Zn.length-1){ve.select(Zn.elt(Ke+1));break}else he=Cn}var de=ve.selection.first();de!==null&&ve.scrollToRect(de.actualBounds)}},jn.prototype._sortTreeChildrenByY=function(ve){var he=new go.List().addAll(ve.findTreeChildrenNodes());return he.sort(function(oe,xn){var Cn=oe.location,Zn=xn.location;return Cn.y<Zn.y?-1:Cn.y>Zn.y?1:Cn.x<Zn.x?-1:Cn.x>Zn.x?1:0}),he},jn.prototype.copyToClipboard=function(ve){go.CommandHandler.prototype.copyToClipboard.call(this,ve),this._lastPasteOffset.set(this.pasteOffset)},jn.prototype.pasteFromClipboard=function(){var ve=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(ve,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),ve},Object.defineProperty(jn.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(ve){if(ve!=="move"&&ve!=="select"&&ve!=="scroll"&&ve!=="tree"&&ve!=="none")throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+ve);this._arrowKeyBehavior=ve}}),Object.defineProperty(jn.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(ve){if(!(ve instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+ve);this._pasteOffset.set(ve)}});var hi=jn,Dt=Yt(71584),kt=Yt(5269),wt=Yt(24092),At={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},_t=Yt(69669),Et=Yt(59301),Pe=(ve,he,oe)=>new Promise((xn,Cn)=>{var Zn=me=>{try{pn(oe.next(me))}catch(de){Cn(de)}},Ke=me=>{try{pn(oe.throw(me))}catch(de){Cn(de)}},pn=me=>me.done?xn(me.value):Promise.resolve(me.value).then(Zn,Ke);pn((oe=oe.apply(ve,he)).next())});function Ee({onCancel:ve,callback:he}){let oe=(0,St.useRef)(),xn=(0,St.useRef)(),Cn=(0,St.useRef)(),Zn=(0,St.useRef)(!1);const Ke=(0,St.useRef)(!1),[pn,me]=(0,St.useState)(0);function de(){const Wt=ee.bx.make,Ne={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"};oe.current=new ee.S0(xn.current,{padding:20,grid:Wt(ee.s_,"Grid",Wt(ee.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Wt(ee.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:on=>{var bn=on.diagram.commandHandler.addTopLevelParts(on.diagram.selection,!0);bn||on.diagram.currentTool.doCancel()},commandHandler:Wt(hi),"clickCreatingTool.archetypeNodeData":{text:"\u672A\u547D\u540D",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:on=>{var bn=on.subject;bn.location=bn.location.copy().snapToGridPoint(on.diagram.grid.gridOrigin,on.diagram.grid.gridCellSize),setTimeout(()=>{on.diagram.commandHandler.editTextBlock()},20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:on=>{var bn=on.subject;setTimeout(()=>{on.diagram.commandHandler.editTextBlock()})},LinkRelinked:on=>{var bn=on.parameter.part;bn.invalidateConnectedLinks();var Rn=on.subject;on.diagram.toolManager.linkingTool.isForwards?Rn.toNode.invalidateConnectedLinks():Rn.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),oe.current.nodeTemplate=Wt(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),Wt(ee.bn,{name:"SHAPE",fill:Ne.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")),Wt(ee.bn,{width:100,height:20,strokeWidth:0,fill:"transparent"}),Wt(ee.al,{margin:1,textAlign:"center",overflow:ee.al.OverflowEllipsis,editable:!0},new ee.KX("text").makeTwoWay(),new ee.KX("stroke","color"))),oe.current.nodeTemplate.toolTip=Wt("ToolTip",Wt(ee.s_,"Vertical",{maxSize:new ee.$u(200,NaN)},Wt(ee.al,{font:"bold 10pt sans-serif",textAlign:"center"},new ee.KX("text")),Wt(ee.al,{font:"10pt sans-serif",textAlign:"center"},new ee.KX("text","details"))));function an(on,bn){var Rn=(Bn,Un)=>{Bn.handled=!0,Bn.diagram.model.commit(mi=>{var ai=Un.part.adornedPart,ei=new ee.E9().setRectSpot(ai.actualBounds,on);ei.subtract(ai.location),ei.scale(2,2),ei.x+=Math.sign(ei.x)*130,ei.y+=Math.sign(ei.y)*130,ei.add(ai.location),ei.snapToGridPoint(Bn.diagram.grid.gridOrigin,Bn.diagram.grid.gridCellSize);var di=mi.copyNodeData(ai.data);mi.setGroupKeyForNodeData(di,mi.getGroupKeyForNodeData(ai.data)),mi.addNodeData(di);var ke={from:ai.key,to:mi.getKeyForNodeData(di)};mi.addLinkData(ke);var Di=Bn.diagram.findNodeForData(di);Di.location=ei,Bn.diagram.select(Di),setTimeout(()=>{Bn.diagram.commandHandler.editTextBlock()},20)})};return Wt(ee.bn,{figure:bn,alignment:on,alignmentFocus:on.opposite(),width:on.equals(ee.z6.Top)||on.equals(ee.z6.Bottom)?25:18,height:on.equals(ee.z6.Top)||on.equals(ee.z6.Bottom)?18:25,fill:"orange",stroke:Ne.white,strokeWidth:4,mouseEnter:(Bn,Un)=>Un.fill="dodgerblue",mouseLeave:(Bn,Un)=>Un.fill="orange",isActionable:!0,click:Rn,contextClick:Rn})}function ye(on){return Wt(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:(bn,Rn)=>Rn.fill="dodgerblue",mouseLeave:(bn,Rn)=>Rn.fill="orange",click:(bn,Rn)=>{bn.diagram.commandHandler.showContextMenu(Rn.part.adornedPart)}},on||{})}oe.current.nodeTemplate.selectionAdornmentTemplate=Wt(ee.uz,"Spot",Wt(ee.Vm,{padding:10}),an(ee.z6.Top,"TriangleUp"),an(ee.z6.Left,"TriangleLeft"),an(ee.z6.Right,"TriangleRight"),an(ee.z6.Bottom,"TriangleDown"),ye({alignment:new ee.z6(.75,0)}));function Qt(on,bn){return(Rn,Bn)=>{Rn.handled=!0,Rn.diagram.model.commit(Un=>{Un.set(Bn.part.adornedPart.data,on,bn)})}}function Zt(on,bn){return bn||(bn="color"),Wt(ee.bn,{width:16,height:16,stroke:"lightgray",fill:on,margin:1,background:"transparent",mouseEnter:(Rn,Bn)=>Bn.stroke="dodgerblue",mouseLeave:(Rn,Bn)=>Bn.stroke="lightgray",click:Qt(bn,on),contextClick:Qt(bn,on)})}function De(){return[Wt("ContextMenuButton",Wt(ee.s_,"Horizontal",Zt(Ne.white,"fill"),Zt(Ne.beige,"fill"),Zt(Ne.extralightblue,"fill"),Zt(Ne.extralightred,"fill"))),Wt("ContextMenuButton",Wt(ee.s_,"Horizontal",Zt(Ne.lightgray,"fill"),Zt(Ne.lightgreen,"fill"),Zt(Ne.lightblue,"fill"),Zt(Ne.lightred,"fill")))]}function Mn(){return[Wt("ContextMenuButton",Wt(ee.s_,"Horizontal",Zt(Ne.black),Zt(Ne.green),Zt(Ne.blue),Zt(Ne.red))),Wt("ContextMenuButton",Wt(ee.s_,"Horizontal",Zt(Ne.white),Zt(Ne.magenta),Zt(Ne.purple),Zt(Ne.orange)))]}function Hn(on,bn){return bn||(bn="thickness"),Wt(ee.bn,"LineH",{width:16,height:16,strokeWidth:on,margin:1,background:"transparent",mouseEnter:(Rn,Bn)=>Bn.background="dodgerblue",mouseLeave:(Rn,Bn)=>Bn.background="transparent",click:Qt(bn,on),contextClick:Qt(bn,on)})}function ln(on,bn){return bn||(bn="dash"),Wt(ee.bn,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:on,margin:1,background:"transparent",mouseEnter:(Rn,Bn)=>Bn.background="dodgerblue",mouseLeave:(Rn,Bn)=>Bn.background="transparent",click:Qt(bn,on),contextClick:Qt(bn,on)})}function Be(){return[Wt("ContextMenuButton",Wt(ee.s_,"Horizontal",Hn(1),Hn(2),Hn(3),Hn(4))),Wt("ContextMenuButton",Wt(ee.s_,"Horizontal",ln(null),ln([2,4]),ln([4,4])))]}function we(on,bn){return bn||(bn="figure"),Wt(ee.bn,{width:32,height:32,scale:.5,fill:"lightgray",figure:on,margin:1,background:"transparent",mouseEnter:(Rn,Bn)=>Bn.fill="dodgerblue",mouseLeave:(Rn,Bn)=>Bn.fill="lightgray",click:Qt(bn,on),contextClick:Qt(bn,on)})}oe.current.nodeTemplate.contextMenu=Wt("ContextMenu",Wt("ContextMenuButton",Wt(ee.s_,"Horizontal",we("Rectangle"),we("RoundedRectangle"),we("Ellipse"),we("Diamond"))),Wt("ContextMenuButton",Wt(ee.s_,"Horizontal",we("Parallelogram2"),we("ManualOperation"),we("Procedure"),we("Cylinder1"))),Wt("ContextMenuButton",Wt(ee.s_,"Horizontal",we("Terminator"),we("CreateRequest"),we("Document"),we("TriangleDown"))),De(),Mn(),Be()),oe.current.groupTemplate=Wt(ee.ZA,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:ee.z6.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:(on,bn)=>{var Rn=bn.addMembers(bn.diagram.selection,!0);Rn||bn.diagram.currentTool.doCancel()},avoidable:!1},new ee.KX("location","loc",ee.E9.parse).makeTwoWay(ee.E9.stringify),Wt(ee.s_,"Auto",{name:"BODY"},Wt(ee.bn,{parameter1:10,fill:Ne.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")),Wt(ee.Vm,{background:"transparent",margin:20})),Wt(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"))),oe.current.groupTemplate.selectionAdornmentTemplate=Wt(ee.uz,"Spot",Wt(ee.s_,"Auto",Wt(ee.bn,{fill:null,stroke:"dodgerblue",strokeWidth:3}),Wt(ee.Vm,{margin:1.5})),ye({alignment:ee.z6.TopRight,alignmentFocus:ee.z6.BottomRight})),oe.current.groupTemplate.contextMenu=Wt("ContextMenu",De(),Mn(),Be()),oe.current.linkTemplate=Wt(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",on=>on>=1?10:0),new ee.KX("toShortLength","dir",on=>on>=1?10:0),new ee.KX("points").makeTwoWay(),Wt(ee.bn,{strokeWidth:2},new ee.KX("stroke","color"),new ee.KX("strokeWidth","thickness"),new ee.KX("strokeDashArray","dash")),Wt(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",on=>on===1)),Wt(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",on=>on>=1),new ee.KX("width","thickness",on=>7+3*on),new ee.KX("height","thickness",on=>7+3*on),new ee.KX("segmentOffset","thickness",on=>new ee.E9(-15,4+1.5*on))),Wt(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",on=>on===2),new ee.KX("width","thickness",on=>7+3*on),new ee.KX("height","thickness",on=>7+3*on),new ee.KX("segmentOffset","thickness",on=>new ee.E9(-15,4+1.5*on))),Wt(ee.al,{alignmentFocus:new ee.z6(0,1,-4,0),editable:!0},new ee.KX("text").makeTwoWay(),new ee.KX("stroke","color"))),oe.current.linkTemplate.selectionAdornmentTemplate=Wt(ee.uz,Wt(ee.bn,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:zn(2)},new ee.KX("pathPattern","thickness",zn)),ye({alignmentFocus:new ee.z6(0,0,-6,-4)}));function zn(on){return Wt(ee.bn,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(on+4).toString()+" H3"})}function Vn(on){var bn="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return on===0?bn="M0 0 M16 16 M0 8 L16 8":on===2&&(bn="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),Wt(ee.bn,{geometryString:bn,margin:2,background:"transparent",mouseEnter:(Rn,Bn)=>Bn.background="dodgerblue",mouseLeave:(Rn,Bn)=>Bn.background="transparent",click:Qt("dir",on),contextClick:Qt("dir",on)})}function si(on){var bn=(Rn,Bn)=>{Rn.handled=!0,Rn.diagram.model.commit(Un=>{var mi=Bn.part.adornedPart;Un.set(mi.data,on?"toSpot":"fromSpot",ee.z6.stringify(ee.z6.AllSides)),(on?mi.toNode:mi.fromNode).invalidateConnectedLinks()})};return Wt(ee.bn,{width:12,height:12,fill:"transparent",mouseEnter:(Rn,Bn)=>Bn.background="dodgerblue",mouseLeave:(Rn,Bn)=>Bn.background="transparent",click:bn,contextClick:bn})}function Fe(on,bn){var Rn=0,Bn=ee.z6.RightSide;on.equals(ee.z6.Top)?(Rn=270,Bn=ee.z6.TopSide):on.equals(ee.z6.Left)?(Rn=180,Bn=ee.z6.LeftSide):on.equals(ee.z6.Bottom)&&(Rn=90,Bn=ee.z6.BottomSide),bn||(Rn-=180);var Un=(mi,ai)=>{mi.handled=!0,mi.diagram.model.commit(ei=>{var di=ai.part.adornedPart;ei.set(di.data,bn?"toSpot":"fromSpot",ee.z6.stringify(Bn)),(bn?di.toNode:di.fromNode).invalidateConnectedLinks()})};return Wt(ee.bn,{alignment:on,alignmentFocus:on.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:Rn,background:"transparent",mouseEnter:(mi,ai)=>ai.background="dodgerblue",mouseLeave:(mi,ai)=>ai.background="transparent",click:Un,contextClick:Un})}oe.current.linkTemplate.contextMenu=Wt("ContextMenu",Mn(),Be(),Wt("ContextMenuButton",Wt(ee.s_,"Horizontal",Vn(0),Vn(1),Vn(2))),Wt("ContextMenuButton",Wt(ee.s_,"Horizontal",Wt(ee.s_,"Spot",si(!1),Fe(ee.z6.Top,!1),Fe(ee.z6.Left,!1),Fe(ee.z6.Right,!1),Fe(ee.z6.Bottom,!1)),Wt(ee.s_,"Spot",{margin:new ee.Zt(0,0,0,2)},si(!0),Fe(ee.z6.Top,!0),Fe(ee.z6.Left,!0),Fe(ee.z6.Right,!0),Fe(ee.z6.Bottom,!0)))));const Yi=`{ "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 qn=["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 Ri(on){return console.log("shapeName:",on),qn.indexOf(on)>=0}var Se=new ee.YI(Cn.current,{maxSelectionCount:1,linkTemplate:Wt(ee.rU,{locationSpot:ee.z6.Center,selectionAdornmentTemplate:Wt(ee.uz,"Link",{locationSpot:ee.z6.Center},Wt(ee.bn,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),Wt(ee.bn,{toArrow:"Standard",stroke:null}))},{routing:ee.rU.AvoidsNodes,curve:ee.rU.JumpOver,corner:5,toShortLength:4},new ee.KX("points"),Wt(ee.bn,{isPanelMain:!0,strokeWidth:2}),Wt(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(on=>({text:"\u672A\u547D\u540D",size:"100 100",figure:on.key,fill:"white",stroke:"#666",borderColor:"#000"}))])});return oe.current.addDiagramListener("TextEdited",function(on){var bn;const Rn=on.subject.part;var Bn=(bn=document.activeElement)==null?void 0:bn.value;typeof Bn=="string"&&Bn.trim()===""&&oe.current.model.commit(function(Un){Un.set(Rn.data,"text","\u672A\u547D\u540D"),oe.current.commandHandler.stopCommand()},"increment")}),Se.nodeTemplate=Wt(ee.NB,"Auto",{locationSpot:ee.z6.Center},new ee.KX("location","location",ee.E9.parse).makeTwoWay(ee.E9.stringify),Wt(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")),Wt(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(()=>{oe.current.grid=Wt(ee.s_,"Grid",Wt(ee.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Wt(ee.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),oe.current.grid.visible=!0,oe.current.grid.gridCellStroke="darkgray",oe.current.grid.gridCellStrokeWidth=1},300),window.myDiagrams=oe.current,oe.current}const Sn=()=>Pe(this,null,function*(){var Wt,Ne=oe.current.makeImage();const an=yield(0,wt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:Ne.src,file_data:JSON.stringify({login:(Wt=(0,_t.eY)())==null?void 0:Wt.login,data:JSON.parse(oe.current.model.toJson())})}});he({src:an.url})});return(0,St.useEffect)(()=>(setTimeout(()=>{de()},500),me(pn+1),()=>{oe.current=null}),[]),Et.createElement("div",{ref:Ke,className:"body-overflow-initial"},Et.createElement(gn.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!pn,destroyOnClose:!0,maskClosable:!1,rootClassName:"zIndex-9999",title:Et.createElement(Tn.Z,null,Et.createElement(kt.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),Et.createElement(kt.Z,{onClick:()=>{var Wt,Ne,an=oe.current.selection.first();if(Zn.current=!Zn.current,document.activeElement&&an){let ye=(Ne=(Wt=document.activeElement)==null?void 0:Wt.value)==null?void 0:Ne.trim();typeof ye=="string"&&oe.current.model.commit(function(Qt){Qt.set(an.data,"text",ye||"\u672A\u547D\u540D"),oe.current.commandHandler.stopCommand()},"increment")}me(pn+1)}},Et.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:ve},Et.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative",display:Zn.current?"none":"block"},className:At.flowChartWrp},Et.createElement("div",{style:{display:"flex",height:"100%"}},Et.createElement("div",{style:{width:"300px",height:"100%"}},Et.createElement("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"}},"\u56FE\u5F62\u5E93"),Et.createElement("div",{style:{height:"calc(100% - 50px)"},className:At.myPaletteDiv,ref:Cn})),Et.createElement("div",{style:{flex:1,position:"relative"}},Et.createElement("div",{ref:xn,style:{height:"80vh"}}))),Et.createElement("div",{className:"tr"},Et.createElement(pe.ZP,{size:"large",onClick:Sn,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var sn=Ee,He=Yt(47889),Ae=Yt(71051);const qe=He.ZP.Group,en={margin:"0 8px"};var dn=({callback:ve,onCancel:he})=>{function oe(xn){ve(xn)}return St.createElement(te.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:oe},St.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},St.createElement("span",{style:en},"\u5355\u5143\u683C\u6570\uFF1A"),St.createElement("span",{style:en},"\u884C\u6570"),St.createElement(te.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},St.createElement(Ae.Z,null)),St.createElement("span",{style:en},"\u5217\u6570"),St.createElement(te.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},St.createElement(Ae.Z,null))),St.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},St.createElement("span",{style:en},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),St.createElement(te.default.Item,{name:"align"},St.createElement(qe,null,St.createElement(He.ZP,{value:"default"},St.createElement("i",{className:"fa fa-align-justify"})),St.createElement(He.ZP,{value:"left"},St.createElement("i",{className:"fa fa-align-left"})),St.createElement(He.ZP,{value:"center"},St.createElement("i",{className:"fa fa-align-center"})),St.createElement(He.ZP,{value:"right"},St.createElement("i",{className:"fa fa-align-right"}))))),St.createElement("div",{className:"flex-container flex-end"},St.createElement(pe.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),St.createElement(pe.ZP,{type:"ghost",onClick:he},"\u53D6\u6D88")))},An=Yt(71411),_n=Yt(91e3),fn=Yt.n(_n),Pi=(0,St.forwardRef)(({use3d:ve,width:he,height:oe,callback:xn,showSaveButton:Cn},Zn)=>{const Ke=(0,St.useRef)(),pn=(0,St.useRef)(),[me,de]=(0,St.useState)(!1),Sn=(0,St.useRef)({id:Ke,appName:"graphing",width:he||1e3,height:oe||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,St.useEffect)(()=>{pn.current=new(fn())(Sn.current,!0),window.onload=function(){pn.current.inject("applet_container")}},[]);const Wt=()=>{var Ne=window.ggbApplet.getPNGBase64(1,!0,72);return xn&&xn(Ne),Ne};return(0,St.useEffect)(()=>{Sn.current.appName=me?"3D":"graphing",pn.current.inject("applet_container")},[me]),(0,St.useEffect)(()=>{de(ve)},[ve]),(0,St.useImperativeHandle)(Zn,()=>({getImgData:Wt})),St.createElement(St.Fragment,null,St.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:Ke}),St.createElement(Tn.Z,{align:"middle"},St.createElement(kt.Z,{flex:1},St.createElement(An.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:me,onChange:Ne=>de(Ne)})),St.createElement(kt.Z,null,St.createElement(pe.ZP,{size:"large",onClick:Wt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),zi=Yt(88831),Hi=Yt(6767);const po="link",oo="upload-image",Fi="add-flowchart",Ki="draw-image",hr="add-flowchart",Yo="code-block",Ro="add-table",er="------------",$o={default:er,left:`:${er}`,center:`:${er}:`,right:`${er}:`};var Sr=Yt(23206);function Br(){}let nr=0;const zo=1e4,Xi="\u2581",ro="@\u2581\u2581@",Ct="@\u2581@",Go=`
**\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`,lo=["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 jo(ve){return/^\d+$/.test(ve)?`${ve}px`:ve}const br=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",qr={[br+"-B"]:"bold",[br+"-I"]:"italic"},ii={[po]:"\u6DFB\u52A0\u94FE\u63A5",[Yo]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[oo]:"\u6DFB\u52A0\u56FE\u7247",[Ki]:"\u6DFB\u52A0\u753B\u56FE",[Fi]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[Ro]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var In=({defaultValue:ve="",onChange:he,width:oe="100%",height:xn=400,miniToolbar:Cn=!1,isFocus:Zn=!1,watch:Ke,insertTemp:pn,mode:me="markdown",id:de="markdown-editor-id",showResizeBar:Sn=!1,noStorage:Wt=!1,showNullButton:Ne=!1,showNullProgramButton:an=!1,hidetoolBar:ye=!1,fullScreen:Qt=!1,onBlur:Zt,onCMBeforeChange:De,onFullScreen:Mn,className:Hn="",disablePaste:ln=!1,disabled:Be=!1,disabledFill:we=!1,placeholder:zn="",values:Vn="",extraUse:si})=>{const[Fe,Yi]=(0,St.useState)(null),[qn,Ri]=(0,St.useState)(ve),[Se,on]=(0,St.useState)(Ke),[bn,Rn]=(0,St.useState)(Qt),[Bn,Un]=(0,St.useState)(""),[mi,ai]=(0,St.useState)(0),[ei,di]=(0,St.useState)(xn),[ke,Di]=(0,St.useState)(!1),[Me,En]=(0,St.useState)(0),[$n,ti]=(0,St.useState)(0),mo=(0,St.useRef)(),Ji=(0,St.useRef)(),wi=(0,St.useRef)(),bi=(0,St.useRef)();(0,St.useEffect)(()=>{const vi=window.scrollY||window.pageYOffset;Ri(Vn),Fe==null||Fe.setValue(Vn),window.scrollTo(0,vi)},[Vn]),(0,St.useEffect)(()=>{Mn==null||Mn(bn)},[bn]),(0,St.useEffect)(()=>{if(mo.current){let vi=function(Qe,ni){var no;if(ln){ni.preventDefault();return}const Ho=ni.clipboardData;if(Ho){const _o=Ho.types.toString(),ko=Ho.items;if(_o==="Files"||Ho.types.indexOf("Files")>-1){if(ni.preventDefault(),me=="stex")return;try{let Ko=ko[1];((no=ko[0])==null?void 0:no.kind)==="file"&&(Ko=ko[0]);const Fo=Ko.getAsFile(),zr=Fo.name.split(".").pop();(0,je.I)(Fo,Dr=>{var ms,Ce,To;Dr.id?((ms=Fo==null?void 0:Fo.type)==null?void 0:ms.indexOf("image"))>-1?fi.replaceSelection(`<img width="100%" src="/api/attachments/${Dr.id}?type=${Dr.content_type})" alt="" />`):((Ce=Fo==null?void 0:Fo.type)==null?void 0:Ce.indexOf("video"))>-1?fi.replaceSelection(`<video width="100%" controls src="/api/attachments/${Dr.id}"></video>`):((To=Fo==null?void 0:Fo.type)==null?void 0:To.indexOf("pdf"))>-1?fi.replaceSelection(`<a href="/api/attachments/${Dr.id}?type=${Fo.type}&disposition=inline" target="_blank">${Fo.name}</a>`):lo.includes(zr)?fi.replaceSelection(`<a href="/api/attachments/${Dr.id}?type=office&disposition=inline" target="_blank">${Fo.name}</a>`):fi.replaceSelection(`[${Fo.name}](/api/attachments/${Dr.id}?type=${Dr.content_type})`):(Dr==null?void 0:Dr.status)===401&&(document.location.href="/user/login")})}catch(Ko){Hi.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const fi=be().fromTextArea(mo.current,{mode:me,lineNumbers:!Cn,lineWrapping:!0,value:ve,autoCloseTags:!0,autoCloseBrackets:!0});return fi.on("keyup",function(Qe,ni){ni.keyCode===8&&(Qe.getValue()==""?fi.setOption("placeholder",zn):fi.setOption("placeholder",null))}),fi.on("keydown",function(Qe,ni){if(ni.keyCode===8){var no=Ci(Qe);no&&ni.preventDefault()}}),Zn&&fi.focus(),fi.on("paste",vi),Be&&fi.on("beforeChange",function(Qe,ni){(ni.origin==="paste"||ni.origin==="+input")&&ni.cancel()}),Yi(fi),()=>{fi.off("paste",vi)}}},[]);const Vi=(0,St.useCallback)(()=>{if(Ji.current)try{}catch(vi){console.log(vi,"---- to set md editor body height")}},[ei,Ji,bn]);(0,St.useEffect)(()=>{function vi(){let fi=new Xe.Z(Qe=>{for(let ni of Qe)(ni.target.offsetHeight>0||ni.target.offsetWidth>0)&&(Vi(),Fe.setSize("100%","100%"),Fe.refresh())});return fi.observe(mo.current.parentElement),fi}if(Fe){const fi=vi();return()=>{var Qe,ni;(Qe=mo.current)!=null&&Qe.parentElement&&fi.unobserve((ni=mo.current)==null?void 0:ni.parentElement)}}},[Fe,Vi]),(0,St.useEffect)(()=>{if(Fe){let vi=[];for(const[fi,Qe]of Object.entries(qr)){let ni={[fi]:()=>{kn(Qe)}};vi.push(ni),Fe.addKeyMap(ni)}return()=>{for(let fi of vi)Fe.removeKeyMap(fi)}}},[Fe]),(0,St.useEffect)(()=>{Qt!==bn&&Rn(Qt)},[Qt]),(0,Sr.Z)(()=>{if(!Wt&&mi>0){let vi=new Date().getTime(),fi=window.sessionStorage.getItem(de);vi>=mi+zo&&(!fi||fi!==qn)&&(window.sessionStorage.setItem(de,qn),Di(!0))}},zo),(0,St.useEffect)(()=>{on(Ke)},[Fe,Ke]),(0,St.useEffect)(()=>{Fe&&Zn&&Fe.focus()},[Fe,Zn]),(0,St.useEffect)(()=>{if(Se&&Fe){let vi=function(Qe){let ni=Qe.target;if(bi.current){let no=ni.scrollTop/ni.scrollHeight;bi.current.scrollTop=bi.current.scrollHeight*no}};const fi=Fe.getScrollerElement();return fi.addEventListener("scroll",vi),()=>{fi.removeEventListener("scroll",vi)}}},[Fe,Se]),(0,St.useEffect)(()=>{if(Fe&&De){let vi=function(fi,Qe){De(fi,Qe)};return Fe.on("beforeChange",vi),()=>{Fe.off("beforeChange",vi)}}},[Fe,De]),(0,St.useEffect)(()=>{if(Fe&&Zt){let vi=function(){Zt(Fe.getValue())};return Fe.on("blur",vi),()=>{Fe.off("blur",vi)}}},[Fe,Zt]);function Ci(vi,fi){var Qe=vi.getDoc(),ni=Qe.getCursor(),no=Qe.getLine(ni.line),Ho=no.charAt(ni.ch-1),_o=no.lastIndexOf("@\u2581@",ni.ch),ko=no.lastIndexOf("@\u2581\u2581@",ni.ch),Ko=_o>ko?_o:ko,Fo=_o>ko?3:4;if(ro.indexOf(Ho)===-1)return null;if(console.log("change1:",fi,vi,no,ni,Ko,_o,ko,Ho),Ko>=0&&ni.ch-Ko<5){var zr=Ko+Fo;return Qe.replaceRange("",{line:ni.line,ch:Ko},{line:ni.line,ch:zr}),{line:ni.line,ch:zr}}return null}(0,St.useEffect)(()=>{if(Fe){let vi=function(fi,Qe){const ni=fi.getValue();Ri(ni),ai(new Date().getTime()),fi.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),he&&(an?he(ni,li(ni)):he(ni))};return Fe.on("change",vi),()=>{Fe.off("change",vi)}}},[Fe,he]),(0,St.useEffect)(()=>{if(Fe)if(ve==null)Fe.setValue(""),Ri("");else{const vi=window.scrollY||window.pageYOffset;ve!==Fe.getValue()&&(Fe.setValue(ve),Ri(ve),Fe.setCursor(Be?1:Fe.lineCount(),0),window.scrollTo(0,vi))}},[Fe,ve]);const kn=(0,St.useCallback)(vi=>{const fi=Fe.getCursor(),Qe=Fe.getSelection();let ni=Qe.split(`
`);switch(vi){case"bold":return Fe.replaceSelection("**"+Qe+"**"),Qe===""&&Fe.setCursor(fi.line,fi.ch+2),Fe.focus();case"italic":return Fe.replaceSelection("*"+Qe+"*"),Qe===""&&Fe.setCursor(fi.line,fi.ch+1),Fe.focus();case"code":return Fe.replaceSelection("`"+Qe+"`"),Qe===""&&Fe.setCursor(fi.line,fi.ch+1),Fe.focus();case"inline-latex":return Un("inline-latex"),Fe.focus();case"latex":return Fe.replaceSelection("```latex\n"+Qe+"\n```"),Fe.setCursor(fi.line+1,Qe.length+1),Fe.focus();case"line-break":return Fe.replaceSelection(`<br/>
`),Fe.focus();case"list-ul":return Qe===""?Fe.replaceSelection("- "+Qe):Fe.replaceSelection(ni.map(no=>no===""?"":`- ${no}`).join(`
`)),Fe.focus();case"list-ol":return Qe===""?Fe.replaceSelection("1. "+Qe):Fe.replaceSelection(ni.map((no,Ho)=>no===""?"":`${Ho+1}. ${no}`).join(`
`)),Fe.focus();case"add-null-ch":return Qe===""&&Fe.setCursor(fi.line,fi.ch),Fe.replaceSelection(Xi),Fe.focus();case"add-signal":return Qe===""&&Fe.setCursor(fi.line,fi.ch),Fe.replaceSelection(Ct),Fe.focus();case"add-multiple":return Qe===""&&Fe.setCursor(fi.line,fi.ch),Fe.replaceSelection(ro),Fe.focus();case"inster-template-1":return Qe===""&&Fe.setCursor(fi.line,fi.ch),Fe.replaceSelection(Go),Fe.focus();case"eraser":return Fe.setValue(""),Fe.focus();case"trigger-watch":return on(!Se),Fe.focus();case"trigger-full-screen":return Rn(!bn),Fe.focus();case po:Un(po);return;case Yo:Un(Yo);return;case oo:Un(oo);return;case Ki:Un(Ki);return;case"maths-latex":Un("maths-latex");return;case Fi:Un(Fi);return;case Ro:Un(Ro);return;default:throw new Error}},[Fe,Se,bn]),Bt=(0,St.useCallback)((vi,fi)=>{var Qe,ni,no,Ho,_o,ko;switch(Un(""),Bn){case po:const{title:ms,link:Ce}=vi;return Fe.replaceSelection(`[${ms}](${Ce})`),Fe.focus();case Yo:const{language:To,content:kl}=vi;return Fe.replaceSelection(["```"+To,kl,"```"].join(`
`)),Fe.focus();case"maths-latex":for(var Ko=atob(vi),Fo=new Uint8Array(Ko.length),zr=0;zr<Ko.length;zr++)Fo[zr]=Ko.charCodeAt(zr);var Dr=new Blob([Fo],{type:"image/png"});(0,je.I)(Dr,is=>{is.id?Fe.replaceSelection(`![,](/api/attachments/${is.id}?type=${is.content_type})`):(is==null?void 0:is.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":Fe.replaceSelection("`$$"+vi+"$$`");break;case oo:case Ki:case hr:const{src:Gr,alt:ca}=vi,Po=fi,Ml=(no=(ni=(Qe=Po==null?void 0:Po.name)==null?void 0:Qe.split("."))==null?void 0:ni.pop)==null?void 0:no.call(ni);return((Ho=Po==null?void 0:Po.type)==null?void 0:Ho.indexOf("image"))>-1||!(Po!=null&&Po.type)?Po!=null&&Po.align||Po!=null&&Po.width?Fe.replaceSelection(`<p style="text-align:${Po.align||"initial"}"><img width="${Po.width?Po.width+"%":"initial"}" src="${Gr}" alt="${ca||""}" /></p>`):Fe.replaceSelection(`<img width="100%" src="${Gr}" alt="${ca||""}" />`):((_o=Po==null?void 0:Po.type)==null?void 0:_o.indexOf("video"))>-1?Fe.replaceSelection(`<video width="100%" controls src="${Gr}"></video>`):((ko=Po==null?void 0:Po.type)==null?void 0:ko.indexOf("pdf"))>-1?Fe.replaceSelection(`<a href="${Gr}?type=${Po.type}&disposition=inline" target="_blank">${Po.name}</a>`):lo.includes(Ml)?Fe.replaceSelection(`<a href="${Gr}?type=office&disposition=inline" target="_blank">${Po.name}</a>`):Fe.replaceSelection(`[${Po.name}](${Gr})`),Fe.focus();case Ro:const{row:fl,col:Wo,align:Or}=vi;let ta=`
`;for(let is=0;is<fl;is++){let Ra=[],Ys=[];for(let yi=0;yi<Wo;yi++)is===1&&Ys.push($o[Or]),Ra.push(" ");is===1&&(ta+=`| ${Ys.join(" | ")} |
`),ta+=`| ${Ra.join(Wo===1?"":" | ")} |
`}return Fe.replaceSelection(ta+`
`),Fe.focus();default:throw new Error}},[Fe,Bn]),vo=(0,St.useMemo)(()=>{switch(Bn){case po:return St.createElement(Yn,{callback:Bt,onCancel:Ui});case Yo:return St.createElement(Dn.Z,{callback:Bt,onCancel:Ui});case oo:return St.createElement(je.Z,{callback:Bt,onCancel:Ui});case Fi:return St.createElement(sn,{callback:Bt,onCancel:Ui});case Ro:return St.createElement(dn,{callback:Bt,onCancel:Ui});case"maths-latex":return St.createElement(Pi,{showSaveButton:!0,callback:Bt});case"inline-latex":return St.createElement(zi.Z,{showSaveButton:!0,callback:Bt});default:return null}},[Bn]);function Ui(){Un("")}(0,St.useEffect)(()=>{if(wi.current){let vi=function(_o){no=!0,Ho=_o.pageY},fi=function(){no=!1},Qe=function(_o){if(no){let ko=_o.pageY-Ho;ko<0&&(ko=0),ko>300&&(ko=300);let Ko=xn+ko+"px";di(Ko)}},ni=wi.current,no=!1,Ho=0;return ni.addEventListener("mousedown",vi),document.addEventListener("mousemove",Qe),document.addEventListener("mouseup",fi),()=>{ni.removeEventListener("mousedown",vi),document.removeEventListener("mousemove",Qe),document.removeEventListener("mouseup",fi)}}},[Fe,wi]),(0,St.useEffect)(()=>{di(xn)},[xn]);const Wi=jo(oe),so=jo(ei),bo={width:Wi,height:so},Kn=(0,St.useMemo)(()=>{if(mi){let vi=new Date(mi),fi=vi.getHours(),Qe=vi.getMinutes(),ni=vi.getSeconds();return fi=fi<10?"0"+fi:fi,Qe=Qe<10?"0"+Qe:Qe,ni=ni<10?"0"+ni:ni,`${fi}:${Qe}:${ni}`}return 0},[mi]),li=vi=>{const fi=[];if(an){let Qe=-1;vi=vi.replace(/(@▁▁@|@▁@)/g,function(ni,no,Ho){fi.push({multiLine:ni!==Ct})})}return fi};function Ai(){window.sessionStorage.removeItem(de),Di(!1),ai(0)}function ki(){Di(!1),ai(0),Fe.setValue(window.sessionStorage.getItem(de))}(0,St.useEffect)(()=>{ii[Bn]&&Bn!==Ki&&Bn!==Fi&&setTimeout(()=>{const vi=document.getElementsByClassName("markdown-popup-form")[0],fi=window.innerWidth/2-vi.offsetWidth/2,Qe=window.innerHeight/2-vi.offsetHeight/2;En(fi),ti(Qe)},0)},[Bn]);const Bi=vi=>{vi.preventDefault();const fi=vi.clientX-Me,Qe=vi.clientY-$n;document.body.onmousemove=ni=>{let no=ni.clientX-fi,Ho=ni.clientY-Qe;const _o=document.getElementsByClassName("markdown-popup-form")[0],ko=window.innerWidth-_o.offsetWidth,Ko=window.innerHeight-_o.offsetHeight;no=Math.max(0,Math.min(no,ko)),Ho=Math.max(0,Math.min(Ho,Ko)),Zo(ni.clientX,ni.clientY,fi,Qe)&&(En(no),ti(Ho))},document.body.onmouseup=function(){document.body.onmousemove=null}},Zo=(vi,fi,Qe,ni)=>{const no=document.body.clientHeight,Ho=document.body.clientWidth;return vi<20&&Qe>vi||vi>Ho-20&&Qe<vi||fi<20&&ni>fi||fi>no-20&&ni<fi?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return St.createElement(St.Fragment,null,St.createElement("div",{className:"markdown-editor-wrapper",ref:Ji},St.createElement("div",{className:`markdown-editor-container ${Hn} ${Se?"on-preview":""} ${Cn?"mini":""} ${bn?"full-screen":""}`,style:bo},St.createElement(ne,{insertTemp:pn,watch:Se,fullScreen:bn,showNullButton:Ne,showNullProgramButton:an,onActionCallback:kn,hidetoolBar:ye,extraUse:si}),St.createElement("div",{className:"markdown-editor-body"},St.createElement("div",{className:"codemirror-container"},St.createElement("textarea",{ref:mo,placeholder:zn})),Se?St.createElement("div",{ref:bi,className:"preview-container"},me==="stex"&&St.createElement(ae,{value:qn}),me!=="stex"&&St.createElement(Ze.Z,{disabledFill:we,showProgramFill:an,value:qn})):null))),Sn?St.createElement("a",{ref:wi,className:"editor-resize"}):null,Bn===Ki&&St.createElement(Qn,{callback:Bt,onCancel:Ui}),Bn===Fi&&St.createElement(sn,{callback:Bt,onCancel:Ui}),St.createElement(ie.Z,null,ii[Bn]&&Bn!==Ki&&Bn!==Fi?St.createElement(gn.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Me,top:$n},title:St.createElement("div",{style:{cursor:"move"},onMouseDown:Bi},ii[Bn]),open:!0,onCancel:Ui,footer:null,destroyOnClose:!0,width:Bn===Fi?"1200px":null,height:Bn===Fi?"80vh":null,className:"markdown-popup-form"},vo):null))}},24141:function(un,Gn,Yt){"use strict";Yt.d(Gn,{Z:function(){return Gt},I:function(){return ne}});var St=Yt(28284),fe=Yt(6767),be=Yt(37568),Xe=Yt(77736),ge=Yt(71051),re=Yt(47889),se=Yt(99571),Ie=Yt(55322),Le=Yt(59301),$t=Yt(59301),Ze=Object.defineProperty,ae=Object.defineProperties,Re=Object.getOwnPropertyDescriptors,Nt=Object.getOwnPropertySymbols,et=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,ct=(ie,te,Ge)=>te in ie?Ze(ie,te,{enumerable:!0,configurable:!0,writable:!0,value:Ge}):ie[te]=Ge,lt=(ie,te)=>{for(var Ge in te||(te={}))et.call(te,Ge)&&ct(ie,Ge,te[Ge]);if(Nt)for(var Ge of Nt(te))nt.call(te,Ge)&&ct(ie,Ge,te[Ge]);return ie},pt=(ie,te)=>ae(ie,Re(te));const{useForm:vt}=St.default,Lt={width:280,marginRight:10},bt={labelCol:{span:5},wrapperCol:{span:19}};var Gt=({callback:ie,onCancel:te})=>{const[Ge]=vt();let pe=(0,Le.useRef)();function Je(Fn){pe.current.width=Ge.getFieldValue("width"),pe.current.align=Ge.getFieldValue("align"),ie(Fn,pe.current)}function Ye(Fn,vn){if(Fn.status===-1){fe.ZP.error(Fn.message);return}Ge.setFieldsValue({src:`/api/attachments/${Fn.id}`,type:vn.type})}function hn(Fn){let vn=Fn.target.files[0];pe.current=vn,ne(vn,Ye)}return $t.createElement(St.default,pt(lt({form:Ge},bt),{className:"upload-image-panel",onFinish:Je,style:{width:470,overflow:"hidden"}}),$t.createElement(St.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},$t.createElement("div",{className:"flex-container"},$t.createElement(St.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},$t.createElement(be.default,{style:Lt})),$t.createElement(jt,{onFileChange:hn}))),$t.createElement(St.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},$t.createElement(be.default,{style:{width:264}})),$t.createElement(St.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},$t.createElement(Xe.Z,null,$t.createElement(St.default.Item,{name:"width",style:{margin:0}},$t.createElement(ge.Z,{style:{width:264}})),$t.createElement("span",{className:"ml8"},"%"))),$t.createElement(St.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},$t.createElement(re.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"}]})),$t.createElement("aside",null,$t.createElement(St.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},$t.createElement(se.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),$t.createElement(se.ZP,{type:"default",onClick:te},"\u53D6\u6D88"))))};function jt({onFileChange:ie}){return $t.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",$t.createElement("input",{type:"file",onChange:ie}))}function ne(ie,te){if(!ie)throw new String("\u6CA1\u6709\u6587\u4EF6");let Ge=new FormData;Ge.append("editormd-image-file",ie),Ge.append("file_param_name","editormd-image-file"),Ge.append("byxhr","true");var pe=new window.XMLHttpRequest;pe.withCredentials=!0,pe.addEventListener("load",function(Je){te(JSON.parse(Je.target.responseText),ie)},!1),pe.addEventListener("error",function(Je){console.error(Je)},!1),pe.open("POST",`${Ie.KI}/api/attachments.json`),pe.send(Ge)}},52272:function(un,Gn,Yt){"use strict";Yt.d(Gn,{Z:function(){return be}});var St=Yt(59301),fe=Yt(4676);class be extends St.Component{constructor(ge){super(ge);const re=window.document;this.node=re.createElement("div"),re.body.appendChild(this.node)}render(){const{children:ge}=this.props;return(0,fe.createPortal)(ge,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},89081:function(un,Gn,Yt){"use strict";Yt.d(Gn,{SV:function(){return Pe},ZP:function(){return Et}});var St=Yt(59301),fe=Yt(76374);const be={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"]},Xe={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"]},ge={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(`
`)}]},re={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(`
`)}]},se={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 Ie=Yt(53184),Le=Yt.n(Ie),$t=Object.defineProperty,Ze=Object.defineProperties,ae=Object.getOwnPropertyDescriptors,Re=Object.getOwnPropertySymbols,Nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,nt=(Ee,sn,He)=>sn in Ee?$t(Ee,sn,{enumerable:!0,configurable:!0,writable:!0,value:He}):Ee[sn]=He,ct=(Ee,sn)=>{for(var He in sn||(sn={}))Nt.call(sn,He)&&nt(Ee,He,sn[He]);if(Re)for(var He of Re(sn))et.call(sn,He)&&nt(Ee,He,sn[He]);return Ee},lt=(Ee,sn)=>Ze(Ee,ae(sn)),pt=(Ee,sn,He)=>new Promise((Ae,qe)=>{var en=_n=>{try{An(He.next(_n))}catch(fn){qe(fn)}},dn=_n=>{try{An(He.throw(_n))}catch(fn){qe(fn)}},An=_n=>_n.done?Ae(_n.value):Promise.resolve(_n.value).then(en,dn);An((He=He.apply(Ee,sn)).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"]}},Lt=(Ee,sn)=>sn.map(He=>({label:He,kind:Ee.languages.CompletionItemKind.Keyword,insertText:He})),bt=Ee=>Object.keys(vt.tables).map(sn=>({label:sn,kind:Ee.languages.CompletionItemKind.Variable,insertText:sn})),Gt=(Ee,sn)=>{const He=vt.tables[Ee];return He?He.map(Ae=>({label:Ae,kind:sn.languages.CompletionItemKind.Field,insertText:Ae})):[]};function jt(Ee,sn,He,Ae,qe){let en=sn.getWordUntilPosition(He),dn={startLineNumber:He.lineNumber,endLineNumber:He.lineNumber,startColumn:en.startColumn,endColumn:en.endColumn},An=Ae.map(_n=>({label:_n,kind:Ee.languages.CompletionItemKind.Keyword,insertText:_n,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:dn}));return qe.map(_n=>{An.push(lt(ct({},_n),{range:dn}))}),An}var ne=Ee=>{vt.languages.map(qe=>(Ee.languages.registerDocumentFormattingEditProvider(qe,{provideDocumentFormattingEdits(en,dn,An){return pt(this,null,function*(){const _n=Le()(en.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:en.getFullModelRange(),text:_n}]})}}),qe));const sn=ge.quickKey.map(qe=>({label:qe.label,kind:Ee.languages.CompletionItemKind.Method,insertText:qe.content,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet})),He=re.quickKey.map(qe=>({label:qe.label,kind:Ee.languages.CompletionItemKind.Method,insertText:qe.content,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet})),Ae=Xe.quickKey.map(qe=>({label:qe.label,kind:Ee.languages.CompletionItemKind.Method,insertText:qe.content,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet}));Ee.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(qe,en){var dn=qe.getWordUntilPosition(en),An={startLineNumber:en.lineNumber,endLineNumber:en.lineNumber,startColumn:dn.startColumn,endColumn:dn.endColumn},_n=qe.getLineContent(en.lineNumber).substring(dn.startColumn-2,dn.endColumn);return{suggestions:[...ge.keywords.map(fn=>({label:fn,kind:Ee.languages.CompletionItemKind.Function,documentation:fn,insertText:fn,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An})),...ge.quickKey.map(fn=>({label:fn.label,kind:Ee.languages.CompletionItemKind.Function,documentation:fn.content,insertText:_n.startsWith("#")?fn.content.replace(/#/,""):fn.content,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An}))]}}}),Ee.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(qe,en){var dn=qe.getWordUntilPosition(en),An={startLineNumber:en.lineNumber,endLineNumber:en.lineNumber,startColumn:dn.startColumn,endColumn:dn.endColumn};return{suggestions:[...be.keywords.map(_n=>({label:_n,kind:Ee.languages.CompletionItemKind.Function,documentation:_n,insertText:_n,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An}))]}}}),Ee.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(qe,en){var dn=qe.getWordUntilPosition(en),An={startLineNumber:en.lineNumber,endLineNumber:en.lineNumber,startColumn:dn.startColumn,endColumn:dn.endColumn},_n=qe.getLineContent(en.lineNumber).substring(dn.startColumn-2,dn.endColumn);return{suggestions:[...Xe.keywords.map(fn=>({label:fn,kind:Ee.languages.CompletionItemKind.Function,documentation:fn,insertText:fn,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An})),...Xe.quickKey.map(fn=>({label:fn.label,kind:Ee.languages.CompletionItemKind.Function,documentation:fn.content,insertText:_n.startsWith("#")?fn.content.replace(/#/,""):fn.content,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An}))]}}}),Ee.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(qe,en){var dn=qe.getWordUntilPosition(en),An={startLineNumber:en.lineNumber,endLineNumber:en.lineNumber,startColumn:dn.startColumn,endColumn:dn.endColumn},_n=qe.getLineContent(en.lineNumber).substring(dn.startColumn-2,dn.endColumn);return{suggestions:[...se.keywords.map(fn=>({label:fn,kind:Ee.languages.CompletionItemKind.Function,documentation:fn,insertText:fn,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An})),...se.quickKey.map(fn=>({label:fn.label,kind:Ee.languages.CompletionItemKind.Function,documentation:fn.content,insertText:_n.startsWith("#")?fn.content.replace(/#/,""):fn.content,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An}))]}}}),Ee.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(qe,en){var dn=qe.getWordUntilPosition(en),An={startLineNumber:en.lineNumber,endLineNumber:en.lineNumber,startColumn:dn.startColumn,endColumn:dn.endColumn},_n=qe.getLineContent(en.lineNumber).substring(dn.startColumn-2,dn.endColumn);return{suggestions:[...re.keywords.map(fn=>({label:fn,kind:Ee.languages.CompletionItemKind.Function,documentation:fn,insertText:fn,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An})),...re.quickKey.map(fn=>({label:fn.label,kind:Ee.languages.CompletionItemKind.Function,documentation:fn.content,insertText:_n.startsWith("#")?fn.content.replace(/#/,""):fn.content,insertTextRules:Ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:An}))]}}})};const ie="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var te=Object.defineProperty,Ge=(Ee,sn,He)=>sn in Ee?te(Ee,sn,{enumerable:!0,configurable:!0,writable:!0,value:He}):Ee[sn]=He,pe=(Ee,sn,He)=>Ge(Ee,typeof sn!="symbol"?sn+"":sn,He);const Je=class px{constructor(sn,He,Ae){this.placeholder=sn,this.editor=He,this.monaco=Ae,He.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)}};pe(Je,"ID","editor.widget.placeholderHint");var hn=Je,Fn=Yt(96236),vn=Yt(6767),pi=Yt(25399),yn=Yt(89392),ce=Yt(16448),Kt=Yt(56102),tn=Object.defineProperty,Yn=Object.defineProperties,Dn=Object.getOwnPropertyDescriptors,je=Object.getOwnPropertySymbols,gn=Object.prototype.hasOwnProperty,Tn=Object.prototype.propertyIsEnumerable,Jn=(Ee,sn,He)=>sn in Ee?tn(Ee,sn,{enumerable:!0,configurable:!0,writable:!0,value:He}):Ee[sn]=He,Pn=(Ee,sn)=>{for(var He in sn||(sn={}))gn.call(sn,He)&&Jn(Ee,He,sn[He]);if(je)for(var He of je(sn))Tn.call(sn,He)&&Jn(Ee,He,sn[He]);return Ee},Qn=(Ee,sn)=>Yn(Ee,Dn(sn)),ee=(Ee,sn)=>{var He={};for(var Ae in Ee)gn.call(Ee,Ae)&&sn.indexOf(Ae)<0&&(He[Ae]=Ee[Ae]);if(Ee!=null&&je)for(var Ae of je(Ee))sn.indexOf(Ae)<0&&Tn.call(Ee,Ae)&&(He[Ae]=Ee[Ae]);return He},jn=(Ee,sn,He)=>new Promise((Ae,qe)=>{var en=_n=>{try{An(He.next(_n))}catch(fn){qe(fn)}},dn=_n=>{try{An(He.throw(_n))}catch(fn){qe(fn)}},An=_n=>_n.done?Ae(_n.value):Promise.resolve(_n.value).then(en,dn);An((He=He.apply(Ee,sn)).next())});function hi(Ee){return/^\d+$/.test(Ee)?`${Ee}px`:Ee}function Dt(){}let kt=!1;const wt={"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 At(Ee=[]){let sn=Ee;if(Array.isArray(Ee)){for(let He=0;He<Ee.length;He++){let Ae=wt[Ee[He]];if(Ae)return Ae}return sn[0]}return wt[sn]||sn}let _t=null;var Et=Ee=>{var sn=Ee,{width:He="100%",height:Ae="100%",value:qe,language:en="javascript",style:dn={},options:An={},overrideServices:_n={},theme:fn="vs-dark",onEditBlur:Zi,isCopy:Pi=!1,onSave:zi,autoHeight:Hi=!1,forbidCopy:po=!1,onChange:oo=Dt,editorDidMount:Fi=Dt,onFocus:Ki=Dt,onBreakPoint:hr=Dt,breakPointValue:Yo=[],filename:Ro="educoder.txt",errorLine:er,errorContent:$o="",highlightLine:Sr,openBreakPoint:Br=!1,placeholder:nr="",showMiniMap:zo=!0}=sn,Xi=ee(sn,["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 ro=(0,St.useRef)(),Ct=(0,St.useRef)({}),Go=(0,St.useRef)(),lo=(0,St.useRef)(),jo=(0,St.useRef)([]),dr=(0,St.useRef)(!1),br=(0,St.useRef)(),qr=(0,St.useRef)(),ii=(0,St.useRef)(!1),[In,ve]=(0,St.useState)(!1);function he(){let Zt;return ro.current&&(Zt=new fe.Z(De=>{for(let Mn of De)(Mn.target.offsetHeight>0||Mn.target.offsetWidth>0)&&Ct.current.instance.layout()}),Zt.observe(ro.current)),Zt}function oe(){vn.ZP.warning({content:decodeURIComponent(ie),key:"monaco-editor-tip"})}const xn=()=>{let Zt=Ct.current.instance;if(qe!=null&&Zt&&In){const De=Zt.getModel();De&&qe!==De.getValue()&&(kt=!0,De.setValue(qe),Zt.layout(),kt=!1)}};(0,St.useEffect)(()=>{const Zt=ce.Z.subscribe("formatDocument",De=>{var Mn;let Hn=Ct.current.instance;(Mn=Hn==null?void 0:Hn.getAction)==null||Mn.call(Hn,"editor.action.formatDocument").run()});return window.updateMonacoValue=De=>{oo(De)},Zt},[]),(0,St.useEffect)(()=>{var Zt;let De=Ct.current.instance;lo.current&&clearTimeout(lo.current),lo.current=setTimeout(()=>{xn()},500),qe&&(qe!=null&&qe.length)&&((Zt=De==null?void 0:De.updateOptions)==null||Zt.call(De,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(qe.split(/\r\n|\r|\n/g).length))+3,5)}))},[qe,In,Ct.current]),(0,St.useEffect)(()=>{if(er&&Ct.current&&Ct.current.instance){let De=Ct.current.instance;De.changeViewZones(function(Mn){var Hn=document.createElement("div");Hn.style.padding="10px 20px",Hn.style.width="calc(100% - 20px)",Hn.className="my-error-line-wrp",Hn.innerHTML=$o,Mn.addZone({afterLineNumber:er||11,heightInLines:3,domNode:Hn})});var Zt={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}};De.addOverlayWidget(Zt),De.revealPositionInCenter({lineNumber:20,column:1})}},[er,Ct.current,In]);const Cn=(Zt="",De)=>{if(!Zt||Zt.trim()==="")return!0;const Hn=Ct.current.instance.getModel().getLineTokens(De);let ln=!1;for(let Be=0;Be<2;Be++)Hn.getStandardTokenType(Be)===1&&(ln=!0);return ln};(0,St.useEffect)(()=>{var Zt;const De=(Zt=Ct.current)==null?void 0:Zt.instance;if(De&&In&&po){const Mn=De.onDidBlurEditorWidget(()=>{ii.current=!1}),Hn=De.onDidFocusEditorText(()=>{ii.current=!0});return()=>{Mn.dispose(),Hn.dispose()}}},[Ct.current,In,po]),(0,St.useEffect)(()=>{var Zt;if((Zt=Ct.current)!=null&&Zt.instance&&In&&Br){let De=Ct.current.instance,Mn=De.getModel();if(!Mn)return;(()=>{var Se;let on=[],bn=[];const Rn=Mn.getAllDecorations();for(let Un of Rn)Un.options.className==="highlighted-line"&&(on.push((Se=Un==null?void 0:Un.range)==null?void 0:Se.startLineNumber),bn.push(Un==null?void 0:Un.id));if(Sr===on[0])return;Mn.deltaDecorations(bn,[]);const Bn=Mn.getLineCount();Sr&&Sr<=Bn&&(De.deltaDecorations([],[{range:new _t.Range(Sr,1,Sr,Mn.getLineMaxColumn(Sr)),options:{isWholeLine:!0,className:"highlighted-line"}}]),De.revealLineInCenter(Sr))})();const ln=(Se=!1)=>{var on;let bn=[],Rn=[];const Bn=Mn.getAllDecorations();for(let Un of Bn)Un.options.linesDecorationsClassName==="breakpoints-select"&&(bn.push((on=Un==null?void 0:Un.range)==null?void 0:on.startLineNumber),Rn.push(Un==null?void 0:Un.id));if(Se)return{lines:bn,ids:Rn};hr(bn)},Be=Se=>jn(void 0,null,function*(){let on={range:new _t.Range(Se,1,Se,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield Mn.deltaDecorations([],[on]),ln()}),we=Se=>jn(void 0,null,function*(){let on=[];const bn=De.getLineDecorations(Se);for(let Rn of bn)Rn.options.linesDecorationsClassName==="breakpoints-select"&&on.push(Rn.id);yield Mn.deltaDecorations(on,[]),ln()}),zn=Se=>{let on=De.getLineDecorations(Se);for(let bn of on)if(bn.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,yn.isEqual)(Yo,ln(!0).lines)){Mn.deltaDecorations(ln(!0).ids,[]);const Se=Yo.map(on=>({range:new _t.Range(on,1,on,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));Mn.deltaDecorations([],Se)}const Vn=De.onDidChangeModelContent(Se=>{let on=De.getPosition();if(on){let bn=on.lineNumber;clearTimeout(qr.current),qr.current=setTimeout(()=>{Cn(Mn.getLineContent(bn),bn)?we(bn):zn(bn)?(we(bn),Be(bn)):ln()},100)}}),si=De.onMouseDown(Se=>{var on,bn,Rn;if(Se.target.detail&&((Rn=(bn=(on=Se.target)==null?void 0:on.element)==null?void 0:bn.className)!=null&&Rn.includes("line-numbers"))){let Bn=Se.target.position.lineNumber;if(Cn(Mn.getLineContent(Bn),Bn))return;zn(Bn)?we(Bn):Be(Bn)}}),Fe=Se=>{let on={range:new _t.Range(Se,1,Se,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};jo.current=De.deltaDecorations(jo.current,[on])},Yi=()=>{jo.current=De.deltaDecorations(jo.current,[])},qn=De.onMouseMove(Se=>{var on,bn,Rn;if(Yi(),Se.target.detail&&((Rn=(bn=(on=Se.target)==null?void 0:on.element)==null?void 0:bn.className)!=null&&Rn.includes("line-numbers"))){let Bn=Se.target.position.lineNumber;if(Cn(Mn.getLineContent(Bn),Bn))return;Fe(Bn)}}),Ri=De.onMouseLeave(()=>{Yi()});return()=>{Vn.dispose(),si.dispose(),qn.dispose(),Ri.dispose()}}},[Ct.current,In,Yo,Sr,Br,en]),(0,St.useEffect)(()=>{var Zt;(Zt=Ct.current)!=null&&Zt.instance&&Br&&Ct.current.instance.setPosition({lineNumber:0,column:0})},[Sr]);function Zn(){let Zt=Ct.current.instance;if(Zt){const De=Zt.getSelection(),Mn=Ct.current.pastePos||{},Hn=new _t.Range(Mn.startLineNumber||De.endLineNumber,Mn.startColumn||De.endColumn,Mn.endLineNumber||De.endLineNumber,Mn.endColumn||De.endColumn);setTimeout(()=>{Zt.executeEdits("",[{range:Hn,text:""}])},300)}}function Ke(Zt){(window.navigator.platform.match("Mac")?Zt.metaKey:Zt.ctrlKey)&&Zt.keyCode==83&&(Zt.preventDefault(),zi())}const pn=()=>{if(Hi&&Ct.current.instance){const Zt=Ct.current.instance.getContentHeight();ye(Zt<Ae?Ae:Zt)}else ye(Ae)};function me(Zt){var De=document.createEvent("MouseEvents");De.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Zt.dispatchEvent(De)}const de=Zt=>{if(!ii.current)return;const{keyCode:De,ctrlKey:Mn,metaKey:Hn,target:ln,type:Be}=Zt;return(Be==="paste"||(De===67||De===86)&&(Hn||Mn))&&ln.nodeName==="TEXTAREA"&&(oe(),Zt.preventDefault()),!1};function Sn(Zt,De){var Mn=window.URL||window.webkitURL||window,Hn=new Blob([De]),ln=document.createElementNS("http://www.w3.org/1999/xhtml","a");ln.href=Mn.createObjectURL(Hn),ln.download=Zt,me(ln)}(0,St.useEffect)(()=>{pn()},[pn]),(0,St.useEffect)(()=>{ro.current&&!In&&Promise.all([Yt.e(8909),Yt.e(7960)]).then(Yt.bind(Yt,71448)).then(Zt=>{try{_t=Zt,Ct.current.instance=_t.editor.create(ro.current,{value:qe,language:At(en),theme:fn,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:zo||!1}},_n);const De=Ct.current.instance;let ln=[...Fn.BH._menuItems].find(Vn=>Vn[0]._debugName=="EditorContext")[1],Be=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],we=(Vn,si)=>{var Fe,Yi;let qn=Vn._first;do si.includes((Yi=(Fe=qn.element)==null?void 0:Fe.command)==null?void 0:Yi.id)&&Vn._remove(qn);while(qn=qn.next)};if(Fi(De,_t),setTimeout(()=>{pn(),Ct.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Sn(Ro||"educoder.txt",De.getValue())}})},500),Ct.current.subscription=De.onDidChangeModelContent(Vn=>{dr.current?clearTimeout(br.current):(pn(),oo(De.getValue(),Vn)),br.current=setTimeout(()=>{dr.current=!1},500)}),window.Monaco||ne(_t,At(en)),po&&(we(ln,Be),ro.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",de),window.removeEventListener("paste",de),window.addEventListener("keydown",de),window.addEventListener("paste",de)),window.Monaco=_t,Zi&&De.onDidBlurEditorWidget(()=>{Zi(De.getValue())}),Ki&&De.onDidFocusEditorText(()=>{Ki(De.getValue())}),po)try{De.onDidPaste(Vn=>{const si=De.getSelection(),Fe=Ct.current.pastePos||{},Yi=new _t.Range(Fe.startLineNumber||si.endLineNumber,Fe.startColumn||si.endColumn,Fe.endLineNumber||si.endLineNumber,Fe.endColumn||si.endColumn);De.executeEdits("",[{range:Vn.range,text:""}])})}catch(Vn){}let zn=he();return nr&&typeof nr=="string"&&new hn(nr,De,_t),ve(!0),()=>{const Vn=Ct.current.instance;Vn.dispose();const si=Vn.getModel();si&&si.dispose(),Ct.current.subscription&&Ct.current.subscription.dispose(),zn.unobserve(ro.current)}}catch(De){}})},[]),(0,St.useEffect)(()=>{if(Ct.current.instance&&In)return document.addEventListener("keydown",Ke,!1),()=>{document.removeEventListener("keydown",Ke)}},[zi,In]),(0,St.useEffect)(()=>{let Zt=Ct.current.instance;if(Zt&&In){let De=At(en);_t.editor.setModelLanguage(Zt.getModel(),De)}},[en,In]),(0,St.useEffect)(()=>{Ct.current.instance&&In&&_t.editor.setTheme(fn)},[fn,In]),(0,St.useEffect)(()=>{let Zt=Ct.current.instance;Go.current=An,Zt&&In&&(Zt.updateOptions(Pn({},An)),setTimeout(()=>{Zt.getModel().updateOptions(Pn({},An))},200))},[JSON.stringify(An),In]),(0,St.useEffect)(()=>{let Zt=Ct.current.instance;Zt&&In&&Zt.layout()},[He,Ae,In]);const[Wt,Ne]=(0,St.useState)(hi(He)),[an,ye]=(0,St.useState)(hi(Ae)),Qt=Qn(Pn({},dn),{width:Wt,height:an,position:"relative"});return St.createElement("div",{className:"my-monaco-editor",ref:ro,style:Qt},Pi&&St.createElement(Kt.CopyToClipboard,{text:qe,onCopy:()=>vn.ZP.success("\u590D\u5236\u6210\u529F")},St.createElement(pi.Z,{title:"\u590D\u5236\u4EE3\u7801"},St.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},St.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function Pe({width:Ee="100%",height:sn="100%",original:He,modified:Ae,language:qe,options:en={}}){const dn=(0,St.useRef)(),[An,_n]=(0,St.useState)(null);function fn(Hi){let po;return dn.current&&(po=new fe.Z(oo=>{for(let Fi of oo)(Fi.target.offsetHeight>0||Fi.target.offsetWidth>0)&&Hi.layout()}),po.observe(dn.current)),po}(0,St.useEffect)(()=>(dn.current&&Promise.all([Yt.e(8909),Yt.e(9404)]).then(Yt.bind(Yt,2550)).then(Hi=>{_t=Hi;const po=_t.editor.createDiffEditor(dn.current,Qn(Pn({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},en),{wordWrap:!0}));_n(po);let oo=fn(po);return()=>{po.dispose();const Fi=po.getModel();Fi&&Fi.dispose(),oo.unobserve(dn.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,St.useEffect)(()=>{An&&An.setModel({original:_t.editor.createModel(He,qe),modified:_t.editor.createModel(Ae,qe)})},[He,Ae,qe,An]);const Zi=hi(Ee),Pi=hi(sn),zi={width:Zi,height:Pi};return St.createElement("div",{className:"my-diff-editor",ref:dn,style:zi})}},46133:function(un,Gn,Yt){"use strict";Yt.d(Gn,{jL:function(){return ge},w9:function(){return gn},QD:function(){return oo},cQ:function(){return Kt},op:function(){return fn},O5:function(){return qr},_b:function(){return er},t7:function(){return lt},Gi:function(){return jn},YG:function(){return Qn},qp:function(){return Ze},vr:function(){return hr},qE:function(){return zi},Je:function(){return Lt},wb:function(){return Fn},cq:function(){return _t},tp:function(){return Nt}});var St=Yt(59301),fe={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"},be="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==",ge=({dataSource:ii=[],img:In,imgWidth:ve=346,title:he,sunTitle:oe,bannerExtraContent:xn})=>St.createElement("div",{className:fe.banner},St.createElement("div",{className:fe.content},St.createElement("aside",null,St.createElement("p",null,St.createElement("b",null,he),St.createElement("span",null,oe)),ii.length>0&&St.createElement("div",{className:fe.btns},ii.map((Cn,Zn)=>St.createElement("div",{key:Zn,onClick:Cn.click},Cn.name,Cn.sign?St.createElement("img",{src:be,width:39}):null))),xn),In&&St.createElement("img",{style:{marginTop:33,marginRight:38},src:In,width:ve}))),re={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"},se=Yt(92310),Ie=Yt.n(se),Le=Yt(89392),Ze=({dataSource:ii=[],value:In,onChange:ve,onTitleChange:he,className:oe,title:xn,titleWidth:Cn=41,style:Zn={},fontColor:Ke="#6A7283",showCount:pn})=>{const[me,de]=(0,St.useState)(0),[Sn,Wt]=(0,St.useState)(!1),Ne=(0,St.useRef)(null),an=(0,St.useRef)(null);return(0,St.useEffect)(()=>{var ye;ii.length!==0&&(((ye=Ne==null?void 0:Ne.current)==null?void 0:ye.clientHeight)>97?de(1):de(0)),ii.length===0&&de(0),Wt(!1)},[ii]),St.createElement("div",{className:Ie()(re.row,oe),style:Zn},St.createElement("div",{onClick:(0,Le.throttle)(()=>he==null?void 0:he(),2e3),style:{width:Cn,marginTop:Sn?12:4},className:`${re.title} ${he?"current":""}`},xn),St.createElement("div",{className:Sn?`${re.tagsWrap} ${re.tagsBorderWrap}`:re.tagsWrap},St.createElement("div",{className:re.bar,ref:an,style:me>0?{height:me===1?97:"auto",overflow:me===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},St.createElement("div",{className:re.tag,ref:Ne},ii==null?void 0:ii.map(ye=>St.createElement("span",{onClick:()=>ve(ye.id),key:ye.id,style:{color:Ke},className:In===ye.id?re.active:""},St.createElement("span",{title:ye.name,className:re.name},ye.name),!!pn&&St.createElement("span",{className:re.num},ye.count))))),!!me&&St.createElement(St.Fragment,null,me===1?St.createElement("div",{onClick:()=>{var ye;de(2),((ye=Ne==null?void 0:Ne.current)==null?void 0:ye.clientHeight)>245?Wt(!0):Wt(!1)},className:re.action},"\u5C55\u5F00",St.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):St.createElement("div",{onClick:()=>{an.current.scrollTop=0,de(1),Wt(!1)},className:re.action},"\u6536\u8D77",St.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},ae={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"},Nt=({dataSource:ii=[],value:In,onChange:ve,className:he,style:oe={}})=>St.createElement("div",{style:oe,className:Ie()(ae.tabs,he)},ii.map(xn=>St.createElement("span",{onClick:()=>ve(xn.id),className:In===xn.id?ae.active:"",key:xn.id},xn.name))),et={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"},nt=Yt(37568),lt=({dataSource:ii=[],value:In="",onChange:ve,onInputChange:he=()=>{},className:oe,style:xn={},placeholder:Cn,allowClear:Zn=!1})=>{var Ke;const[pn,me]=(0,St.useState)(""),[de,Sn]=(0,St.useState)("");(0,St.useEffect)(()=>{var an;let ye=In;(an=JSON.stringify(In))!=null&&an.includes("{")&&(me(In.id),ye=In.value||"");try{Sn(decodeURIComponent(ye||""))}catch(Qt){Sn(decodeURIComponent(ye||""))}},[In]);const Wt=()=>{ve(encodeURIComponent(de),pn||null)},Ne=an=>{an!==pn&&(me(an),ve(encodeURIComponent(de),an))};return St.createElement("div",{className:Ie()(et.input,oe),style:xn},!!ii.length&&St.createElement("div",{className:et.dropdown},St.createElement("div",{className:et.text},(Ke=ii.find(an=>an.id===pn))==null?void 0:Ke.name,St.createElement("i",{className:"iconfont icon-zhankai4"}),St.createElement("b",{className:et.b1}),St.createElement("b",{className:et.b2})),St.createElement("div",{className:et.menu},ii.map((an,ye)=>St.createElement("div",{key:ye,onClick:()=>Ne(an.id)},an.name)))),St.createElement(nt.default,{onPressEnter:Wt,value:de,onChange:an=>{Sn(an.target.value),he(encodeURIComponent(an.target.value),pn||null)},bordered:!1,placeholder:Cn}),St.createElement("i",{onClick:Wt,className:"iconfont icon-sousuo9 font14 pl10 current"}))},pt={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"},Lt=({value:ii,onChange:In,className:ve,total:he,pageSize:oe,style:xn={}})=>{const Cn=ii<2,Zn=ii>=Math.ceil(he/oe);return he<=oe?St.createElement(St.Fragment,null):St.createElement("div",{className:Ie()(pt.quickPager,ve),style:xn},St.createElement("div",{onClick:()=>{Cn||In(ii-1,"prev")},className:Cn?pt.disabled:""},"\u4E0A\u4E00\u9875"),St.createElement("div",{onClick:()=>{Zn||In(ii+1,"next")},className:Zn?pt.disabled:""},"\u4E0B\u4E00\u9875"))},bt={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"},Gt=Yt(29787),jt=Yt(25399),ne=Yt(58018),ie=Yt(12242),te=Yt(59895),Ge=Yt(96908),pe=Yt(57177),Je=Yt(81378),Ye=Yt(12635),Fn=({className:ii,dataSource:In=[],col:ve=4,right:he,bottom:oe=23,precision:xn=0,wrapWidth:Cn=1200,trackEventItems:Zn,loading:Ke})=>{const pn=Math.floor((Cn-(ve-1)*he)/ve);return St.createElement(Gt.Z,{spinning:Ke},St.createElement("div",{className:Ie()(bt.list,ii)},!!In.length&&In.map((me,de)=>{const{name:Sn,id:Wt,identifier:Ne,power:an,cover_image_id:ye,pic:Qt}=me;return St.createElement("div",{className:bt.wrap,key:Wt,style:{width:pn,marginRight:(1+de)%ve===0?0:he+xn,marginBottom:oe}},St.createElement("a",{target:"_blank",href:`/shixuns/${Ne}/challenges`,className:bt.li,onClick:Zt=>{Zt.preventDefault(),Zn&&(0,te.L9)([Zn]),an&&(0,te.xg)(`/shixuns/${Ne}/challenges`)}},St.createElement("div",{className:bt.img},St.createElement("img",{className:bt.cover,src:`${Qt}`}),me.is_jupyter&&St.createElement("img",{className:bt.sign,src:Ge}),me.is_jupyter_lab&&St.createElement("img",{className:bt.sign,src:pe}),me.is_unity_3d&&St.createElement("img",{className:bt.sign,src:Je})),St.createElement("div",{className:bt.name},St.createElement(jt.Z,{title:Sn||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},St.createElement("span",{className:bt.e},Sn||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),St.createElement("div",{className:bt.tags},St.createElement(jt.Z,{placement:"bottom",title:"\u5173\u5361\u6570"},St.createElement("span",null,St.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr2"}),St.createElement("span",null,me.challenges_count))),!!me.myshixuns_count&&St.createElement(jt.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},St.createElement("span",null,St.createElement("i",{className:"iconfont icon-chengyuan font14 mr2"}),St.createElement("span",null,me.myshixuns_count))),St.createElement(jt.Z,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},St.createElement("span",null,St.createElement("span",null,me.level))),St.createElement("div",{className:bt.rate},St.createElement(ne.Z,{allowHalf:!0,disabled:!0,defaultValue:me.score_info}),St.createElement("span",null,"\xA0",me.score_info?`${me.score_info}\u5206`:"5\u5206")))),!an&&St.createElement("div",{className:bt.lockWrap},St.createElement("img",{src:`${ie.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),St.createElement("span",{className:"mt15 font16 c-white"},"\u5B9A\u5411\u5F00\u653E\u5185\u5BB9\uFF0C\u9700\u8981\u6388\u6743")))}),!In.length&&St.createElement(Ye.Z,null)))},vn={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"},pi=Yt(69669),yn=Yt(59301),Kt=({className:ii,dataSource:In=[],col:ve=4,right:he,bottom:oe=23,precision:xn=0,wrapWidth:Cn=1200,trackEventItems:Zn,loading:Ke,onRemove:pn=()=>{},isCurrent:me=!0,showAlias:de=!1})=>{const Sn=Math.floor((Cn-(ve-1)*he)/ve),Wt=[{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 yn.createElement(Gt.Z,{spinning:Ke},yn.createElement("div",{className:Ie()(vn.list,ii)},!!(In!=null&&In.length)&&(In==null?void 0:In.map((Ne,an)=>{var ye;const{name:Qt,id:Zt,identifier:De,featured:Mn,school_name:Hn,image_url:ln,excellent:Be,is_plan:we}=Ne;return yn.createElement("div",{key:Zt,className:vn.wrap,style:{width:Sn,marginRight:(1+an)%ve===0?0:he+xn,marginBottom:oe}},yn.createElement("a",{className:vn.li,onClick:zn=>{zn.preventDefault(),zn.stopPropagation(),Zn&&(0,te.L9)([Zn]),(0,te.xg)(`/paths/${De}`)}},yn.createElement("div",{className:vn.img},yn.createElement("img",{className:vn.cover,src:`${ln}`}),me&&(0,pi.bg)()&&(Ne==null?void 0:Ne.studying)&&yn.createElement("div",{className:`${vn.movebq} user-path-items`,onClick:zn=>{zn.stopPropagation(),pn(Ne)}},yn.createElement("i",{className:"iconfont icon-yichu1 mr5 c-red"}),yn.createElement("span",{className:"c-red"},"\u79FB\u9664")),(ye=Ne==null?void 0:Ne.subject_tags)==null?void 0:ye.map((zn,Vn)=>{var si,Fe;if(Vn===0){const qn=(si=Wt.find(Ri=>Ri.name==zn))==null?void 0:si.swimg;return yn.createElement("img",{className:vn.sign,src:qn,style:{left:"-4px"}})}const Yi=(Fe=Wt.find(qn=>qn.name==zn))==null?void 0:Fe.ptimg;return yn.createElement("img",{className:vn.sign,src:Yi,style:{left:`${48+52*(Vn-1)+2*Vn}px`}})}),yn.createElement("div",{style:{position:"absolute",top:"150px",left:"4px"}},(Ne==null?void 0:Ne.excellent)&&yn.createElement("div",{className:vn.bq},"\u5F00\u653E\u8BFE\u7A0B"))),yn.createElement("div",{className:vn.name},yn.createElement(jt.Z,{title:de&&(Ne!=null&&Ne.excellent_alias_name)?yn.createElement("span",null,`\u8BFE\u7A0B\u539F\u540D\uFF1A${Qt}`,yn.createElement("br",null),yn.createElement("span",null,`\u8BFE\u7A0B\u522B\u540D\uFF1A${Ne==null?void 0:Ne.excellent_alias_name}`)):Qt},yn.createElement("span",{className:vn.e},de&&(Ne==null?void 0:Ne.excellent_alias_name)||Qt))),yn.createElement(jt.Z,{title:`\u53D1\u5E03\u5355\u4F4D\uFF1A${Hn}`},yn.createElement("div",{className:vn.unit},yn.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),Hn)),yn.createElement("div",{className:vn.tags},yn.createElement("div",null,yn.createElement(jt.Z,{placement:"bottom",title:"\u7AE0\u8282\u6570"},yn.createElement("span",null,yn.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),yn.createElement("span",null,Ne.stages_count))),yn.createElement(jt.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},yn.createElement("span",null,yn.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),yn.createElement("span",null,Ne.members_count)))))))})),!In.length&&yn.createElement(Ye.Z,null)))},tn={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"},Yn="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",Dn=Yt(59301),gn=({className:ii,dataSource:In=[],col:ve=4,right:he,bottom:oe=23,precision:xn=0,wrapWidth:Cn=1200,trackEventItems:Zn,loading:Ke,handleVery:pn=()=>!0})=>{const me=Math.floor((Cn-(ve-1)*he)/ve);return Dn.createElement(Gt.Z,{spinning:Ke},Dn.createElement("div",{className:Ie()(tn.list,ii)},!!In.length&&In.map((de,Sn)=>{const{subject_identifier:Wt,id:Ne,identifier:an,power:ye}=de,Qt=de.is_public!=0&&de.is_public;return Dn.createElement("div",{className:tn.wrap,key:Ne,style:{width:me,marginRight:(1+Sn)%ve===0?0:he+xn,marginBottom:oe}},Dn.createElement("a",{className:tn.li,onClick:Zt=>{Zt.preventDefault(),pn(de==null?void 0:de.first_category_url)&&(Zn&&(0,te.L9)([Zn]),(0,te.xg)(de.first_category_url))}},Dn.createElement("div",{className:tn.top},Dn.createElement(jt.Z,{title:de.name},Dn.createElement("div",{className:tn.name},de.name)),Dn.createElement("img",{className:tn.img,src:ie.Z.IMG_SERVER+"/images/"+de.avatar_url}),Dn.createElement("div",{className:tn.text,title:de.creator},de.creator),Wt&&Dn.createElement("div",{className:tn.btns},Dn.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),Dn.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),Qt&&Dn.createElement("div",{className:tn.sign},"\u516C\u5F00")),Dn.createElement("div",{className:tn.bottom},de.visits>0&&Dn.createElement(jt.Z,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},Dn.createElement("span",null,Dn.createElement("i",{className:"iconfont icon-liulanyan"}),Dn.createElement("span",null,de.visits))),de.course_members_count>0&&Dn.createElement(jt.Z,{title:"\u6210\u5458",placement:"bottom"},Dn.createElement("span",null,Dn.createElement("i",{className:"iconfont icon-chengyuan"}),de.course_members_count)),de.tasks_count>0&&Dn.createElement(jt.Z,{title:"\u4F5C\u4E1A",placement:"bottom"},Dn.createElement("span",null,Dn.createElement("i",{className:"iconfont icon-zuoye"}),de.tasks_count)),de.is_end?Dn.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):Dn.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),!de.is_accessible&&Dn.createElement("div",{className:tn.lockWrap},Dn.createElement("img",{src:`${ie.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),Dn.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165")))}),!In.length&&Dn.createElement(Ye.Z,null)))},Tn={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=Yt(71570),Qn=({dataSource:ii=[],value:In,onChange:ve,className:he,style:oe={},tabBarExtraContent:xn})=>St.createElement("div",{className:Ie()(Tn.tabs,he),style:oe},St.createElement("div",{className:Tn.tabsWrap},ii.map((Cn,Zn)=>!(Cn!=null&&Cn.hide)&&St.createElement("aside",{className:Tn.tab,onClick:()=>{ve(Cn.id),Cn.link&&Jn.history.push(Cn.link)},key:Zn},St.createElement("div",{className:In===Cn.id?Tn.active:""},Cn.name),(Cn==null?void 0:Cn.resetCount)==null&&(Cn==null?void 0:Cn.total)!==void 0&&St.createElement("span",null,"\uFF08",Cn==null?void 0:Cn.total,"\uFF09"),(Cn==null?void 0:Cn.resetCount)!==void 0&&(Cn==null?void 0:Cn.total)!==void 0&&St.createElement(jt.Z,{title:(Cn==null?void 0:Cn.tip)!=null?Cn==null?void 0:Cn.tip:""},St.createElement("span",{style:{color:"#9096A3"}},"\uFF08",St.createElement("span",{style:{color:"#000"}},Cn==null?void 0:Cn.resetCount),"/",St.createElement("span",null,Cn==null?void 0:Cn.total),"\uFF09"))))),St.createElement("div",{className:Tn.tabBar},xn)),jn=({className:ii,style:In={},children:ve})=>St.createElement("div",{className:Ie()(ii),style:In},ve),hi={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"},Dt=Yt(75727),kt=Yt(93041);const wt=[{id:"updated_at",name:"\u6700\u65B0\u52A8\u6001"},{id:"created_at",name:"\u6700\u65B0\u521B\u5EFA"},{id:"name",name:"\u540D\u79F0\u6392\u5E8F"}];var _t=({sortValue:ii,dropValue:In,className:ve,onSort:he,onDrop:oe,dataSource:xn=wt})=>{var Cn;return St.createElement("div",{className:Ie()(hi.orderWrap,ve)},St.createElement(Dt.Z,{dropdownRender:()=>St.createElement(kt.default,null,xn.map((Zn,Ke)=>St.createElement(kt.default.Item,{key:Ke,onClick:()=>oe(Zn.id)},Zn.name)))},St.createElement("span",{className:hi.orderTextWrap},(Cn=xn.find(Zn=>In===Zn.id))==null?void 0:Cn.name)),St.createElement("span",{className:hi.orderIconWrap},St.createElement("span",{className:hi.orderAsc},St.createElement("i",{className:ii==="asc"?`iconfont icon-sanjiaoxing-up font12 ${hi.cursorPointer} ${hi.active}`:`iconfont icon-sanjiaoxing-up font12 ${hi.cursorPointer}`,onClick:()=>he(ii==="asc"?"desc":"asc")})),St.createElement("span",{className:hi.orderDesc},St.createElement("i",{className:ii==="desc"?`iconfont icon-sanjiaoxing-down font12 ${hi.cursorPointer} ${hi.active}`:`iconfont icon-sanjiaoxing-down font12 ${hi.cursorPointer}`,onClick:()=>he(ii==="asc"?"desc":"asc")}))))},Et={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"},Pe=Yt(99571),Ee=Object.defineProperty,sn=Object.getOwnPropertySymbols,He=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,qe=(ii,In,ve)=>In in ii?Ee(ii,In,{enumerable:!0,configurable:!0,writable:!0,value:ve}):ii[In]=ve,en=(ii,In)=>{for(var ve in In||(In={}))He.call(In,ve)&&qe(ii,ve,In[ve]);if(sn)for(var ve of sn(In))Ae.call(In,ve)&&qe(ii,ve,In[ve]);return ii},dn=(ii,In)=>{var ve={};for(var he in ii)He.call(ii,he)&&In.indexOf(he)<0&&(ve[he]=ii[he]);if(ii!=null&&sn)for(var he of sn(ii))In.indexOf(he)<0&&Ae.call(ii,he)&&(ve[he]=ii[he]);return ve},An=(ii,In,ve)=>new Promise((he,oe)=>{var xn=Ke=>{try{Zn(ve.next(Ke))}catch(pn){oe(pn)}},Cn=Ke=>{try{Zn(ve.throw(Ke))}catch(pn){oe(pn)}},Zn=Ke=>Ke.done?he(Ke.value):Promise.resolve(Ke.value).then(xn,Cn);Zn((ve=ve.apply(ii,In)).next())}),fn=ii=>{var In=ii,{className:ve,style:he,children:oe,loading:xn=!1,openLoading:Cn,onClick:Zn=()=>{},size:Ke="middle",shape:pn="round"}=In,me=dn(In,["className","style","children","loading","openLoading","onClick","size","shape"]);const[de,Sn]=(0,St.useState)(!1);return St.createElement(Pe.ZP,en({onClick:(0,Le.throttle)(Wt=>An(void 0,null,function*(){Cn&&Sn(!0);try{yield Zn(Wt)}catch(Ne){console.log("error",Ne)}Cn&&Sn(!1)}),2e3,{leading:!0,trailing:!1}),className:Ie()(Et.btn,Et[`${Ke}-${pn}`],ve),style:he,size:Ke,shape:pn,loading:de||xn},me),oe)},Zi={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"},zi=({className:ii,style:In,children:ve=null,onClick:he,title:oe})=>St.createElement("div",{className:Ie()(Zi.head,ii),style:In},St.createElement("span",{className:"primary-hover",onClick:he},St.createElement("i",{className:"iconfont icon-fanhui2 font12"}),"\u8FD4\u56DE"),St.createElement("b",{title:oe},oe),St.createElement("div",{className:Zi.node},ve)),Hi={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"},oo=({confirmShow:ii=!0,confirmTitle:In,confirmClick:ve,cancelShow:he=!0,cancelTitle:oe,cancelClick:xn,className:Cn,style:Zn,confirmLoading:Ke=!1})=>St.createElement("div",{className:Ie()(Hi.btns,Cn),style:Zn},ii&&St.createElement(Pe.ZP,{loading:Ke,onClick:ve,type:"primary",className:Hi.confirm},In),he&&St.createElement(Pe.ZP,{onClick:xn,className:Hi.cancel},oe)),Fi={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"},hr=({className:ii,style:In={},LeftContent:ve,children:he,RightContent:oe})=>St.createElement("div",{className:Ie()(Fi.fixedBottom,ii),style:In},St.createElement("div",{className:Fi.wrap},St.createElement("div",{className:Fi.left},ve),St.createElement("div",{className:Fi.center},he),St.createElement("div",{className:Fi.right},oe))),Yo={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"},er=({className:ii,style:In={},dataSource:ve=[]})=>St.createElement("div",{className:Ie()(Yo.crumbs,ii),style:In},ve.map((he,oe)=>oe<ve.length-1?St.createElement(St.Fragment,{key:oe},he.path||he.onClick?St.createElement("span",{className:Yo.hover,onClick:he!=null&&he.onClick?he.onClick:()=>Jn.history.push(he.path)},he.name):St.createElement("span",null,he.name),St.createElement("span",null,"\xA0",">","\xA0")):St.createElement("span",{key:oe,style:{color:"#5F6368"}},he.name))),$o=Yt(11938),Sr=Object.defineProperty,Br=Object.defineProperties,nr=Object.getOwnPropertyDescriptors,zo=Object.getOwnPropertySymbols,Xi=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable,Ct=(ii,In,ve)=>In in ii?Sr(ii,In,{enumerable:!0,configurable:!0,writable:!0,value:ve}):ii[In]=ve,Go=(ii,In)=>{for(var ve in In||(In={}))Xi.call(In,ve)&&Ct(ii,ve,In[ve]);if(zo)for(var ve of zo(In))ro.call(In,ve)&&Ct(ii,ve,In[ve]);return ii},lo=(ii,In)=>Br(ii,nr(In)),jo=(ii,In)=>{var ve={};for(var he in ii)Xi.call(ii,he)&&In.indexOf(he)<0&&(ve[he]=ii[he]);if(ii!=null&&zo)for(var he of zo(ii))In.indexOf(he)<0&&ro.call(ii,he)&&(ve[he]=ii[he]);return ve};const{Countdown:dr}=$o.default;var qr=ii=>{var In=ii,{onChange:ve}=In,he=jo(In,["onChange"]);const[oe,xn]=(0,St.useState)(null);(0,St.useEffect)(()=>{typeof oe=="number"&&oe>=0&&ve(oe)},[oe]);const Cn=Zn=>{const Ke=Math.floor(Zn/1e3);xn(Ke)};return St.createElement(dr,lo(Go({},he),{onChange:Cn}))}},23206:function(un,Gn,Yt){"use strict";Yt.d(Gn,{Z:function(){return fe}});var St=Yt(59301);function fe(be,Xe){const ge=(0,St.useRef)();(0,St.useEffect)(()=>{ge.current=be}),(0,St.useEffect)(()=>{function re(){ge.current()}if(Xe!==null){let se=setInterval(re,Xe);return()=>clearInterval(se)}},[Xe])}},32525:function(un,Gn,Yt){"use strict";Yt.r(Gn),Yt.d(Gn,{default:function(){return an}});var St=Yt(59301),fe=Yt(71570),be=Yt(93041),Xe=Yt(24404),ge=Yt(28284),re=Yt(6767),se=Yt(37285),Ie=Yt(91882),Le=Yt(77019),$t=Yt(5269),Ze=Yt(62957),ae=Yt(20554),Re=Yt(37568),Nt=Yt(99571),et=Yt(94411),nt=Yt(52314),ct=Yt(12635),lt=Yt(25399),pt=Yt(62673),vt=Yt(71051),Lt=Yt(76011),bt=Yt(19565),Gt=Yt(79074),jt={flex_box_center:"flex_box_center___p1qG1",flex_space_between:"flex_space_between___EHoRl",flex_box_vertical_center:"flex_box_vertical_center___c0u2d",flex_box_center_end:"flex_box_center_end___ueiDD",flex_box_column:"flex_box_column___tyRHS",wrap:"wrap___ce8sS",modal:"modal___yzD47",titleWrap:"titleWrap___OBPcs",required:"required___ncxFF",title:"title___cxIaz",colorGray:"colorGray___NXXsn",choiceWrap:"choiceWrap___AhJbr",answer:"answer____f42Z",activeAnswer:"activeAnswer___BqxNg",deleteIcon:"deleteIcon___iHXv4",addIcon:"addIcon___Kb1l4",editorWrap:"editorWrap___UmeId",htmlWrap:"htmlWrap____EtjV",radio:"radio___zqqhF",color333:"color333___PUxW5",color999:"color999___Uiwst",questionType:"questionType___GcJoU",questionChoices:"questionChoices___WgikS"},ne=Object.defineProperty,ie=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable,pe=(ye,Qt,Zt)=>Qt in ye?ne(ye,Qt,{enumerable:!0,configurable:!0,writable:!0,value:Zt}):ye[Qt]=Zt,Je=(ye,Qt)=>{for(var Zt in Qt||(Qt={}))te.call(Qt,Zt)&&pe(ye,Zt,Qt[Zt]);if(ie)for(var Zt of ie(Qt))Ge.call(Qt,Zt)&&pe(ye,Zt,Qt[Zt]);return ye},Ye=(ye,Qt)=>{var Zt={};for(var De in ye)te.call(ye,De)&&Qt.indexOf(De)<0&&(Zt[De]=ye[De]);if(ye!=null&&ie)for(var De of ie(ye))Qt.indexOf(De)<0&&Ge.call(ye,De)&&(Zt[De]=ye[De]);return Zt},hn=(ye,Qt,Zt)=>new Promise((De,Mn)=>{var Hn=we=>{try{Be(Zt.next(we))}catch(zn){Mn(zn)}},ln=we=>{try{Be(Zt.throw(we))}catch(zn){Mn(zn)}},Be=we=>we.done?De(we.value):Promise.resolve(we.value).then(Hn,ln);Be((Zt=Zt.apply(ye,Qt)).next())});const Fn=["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"],vn=(ye,Qt)=>{var Zt=ye,{problemset:De,globalSetting:Mn,loading:Hn,dispatch:ln,onRef:Be=()=>{},editData:we}=Zt,zn=Ye(Zt,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[Vn,si]=(0,St.useState)([]),[Fe,Yi]=(0,St.useState)(),[qn,Ri]=(0,St.useState)([]),[Se,on]=(0,St.useState)(""),[bn,Rn]=(0,St.useState)(5),[Bn,Un]=(0,St.useState)(!1),mi=(0,fe.useParams)();(0,St.useEffect)(()=>{si(["","","",""])},[]),(0,St.useEffect)(()=>{if(!(we!=null&&we.question_choices)){Un(!0);return}on(we==null?void 0:we.question_title),Rn(parseInt(we==null?void 0:we.question_score)),si(we==null?void 0:we.question_choices.map(En=>En.choice_text));const Me=[];we==null||we.standard_answer.map((En,$n)=>{Me.push(En-1)}),Ri(Me)},[we]),(0,St.useImperativeHandle)(Qt,()=>({onSave:ai,isEdit:Bn}));const ai=()=>hn(void 0,null,function*(){if(!Se)return re.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),!1;const Me=Vn.findIndex(ti=>!ti);if(Me>-1)return re.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Fn[Me]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!qn.length)return re.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(qn.length<1)return re.ZP.info("\u8BF7\u9009\u62E9\u7B54\u6848"),!1;const En=Vn.map((ti,mo)=>({choice_text:ti,is_answer:qn.includes(mo)?mo+1:0}));let $n;we.question_id?$n=yield ln({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:Se,question_type:1,question_score:"5.0",question_choices:En.map(ti=>ti.choice_text),standard_answers:En.filter(ti=>ti.is_answer).map(ti=>ti.is_answer)}}):$n=yield ln({type:"exercise/addExerciseQuestion",payload:{categoryId:mi.categoryId,question_title:Se,question_type:1,question_score:"5.0",question_choices:En.map(ti=>ti.choice_text),standard_answers:En.filter(ti=>ti.is_answer).map(ti=>ti.is_answer)}}),$n.status===0&&(re.ZP.success("\u4FDD\u5B58\u6210\u529F"),Un(!1),ln({type:"exercise/editExercise",payload:Je({},mi)}))}),ei=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],di=Me=>hn(void 0,null,function*(){switch(Me.id){case"del":let En;Ze.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return hn(this,null,function*(){yield(0,Lt.Fl)({id:we.question_id}),ln({type:"exercise/editExercise",payload:Je({},mi)})})}});break;case"up":case"down":yield ln({type:"exercise/exeriseMoveUpDown",payload:{id:we.question_id,opr:Me.id}}),ln({type:"exercise/editExercise",payload:Je({},mi)});break;case"edit":Un(!0);break}}),ke=()=>{var Me;return St.createElement("aside",null,St.createElement("div",{className:jt.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u591A\u9009\u9898"),"\uFF08",we.question_score,"\u5206\uFF09"),!we.hideAction&&ei.map(function(En,$n){return En.id==="up"&&we.key===1||En.id==="down"&&we.key===we.len?null:St.createElement(lt.Z,{key:$n,placement:"bottom",title:En.name},St.createElement("span",{onClick:()=>di(En),className:En.icon}))})),St.createElement("div",{className:"mt5"},St.createElement(Gt.Z,{value:we.question_title})),St.createElement("div",{className:jt.questionChoices},(Me=we==null?void 0:we.question_choices)==null?void 0:Me.map(function(En,$n){return St.createElement(Le.Z,null,St.createElement($t.Z,null,St.createElement(pt.default,{key:$n,checked:we.standard_answer.includes($n+1),disabled:!0},Fn[$n],".")),St.createElement($t.Z,{flex:"1"},St.createElement("span",{className:"c-black font14"},St.createElement(Gt.Z,{value:En.choice_text}))))})))},Di=()=>St.createElement("aside",null,St.createElement("div",{className:jt.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),St.createElement("p",{className:jt.titleWrap},St.createElement("span",{className:jt.required},"*"),St.createElement("span",{className:jt.title},"\u9898\u5E72\uFF1A")),St.createElement(bt.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Se,onChange:Me=>on(Me)}),St.createElement("p",{className:jt.titleWrap},St.createElement("span",{className:jt.required},"*"),St.createElement("span",{className:jt.title},"\u7B54\u6848\u9009\u9879\uFF1A",St.createElement("span",{className:jt.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Vn.map((Me,En)=>St.createElement("div",{className:jt.choiceWrap,key:En},St.createElement(lt.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},St.createElement("div",{className:`${jt.answer} ${qn.includes(En)?jt.activeAnswer:""}`,onClick:()=>{qn.includes(En)?Ri(qn.filter($n=>$n!==En)):Ri([...qn,En])}},Fn[En])),St.createElement("div",{className:jt.editorWrap},Fe===En?St.createElement(bt.Z,{id:`single-question-option-${En}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Me,onChange:$n=>{Vn[En]=$n,si(Vn)}}):St.createElement("div",{className:jt.htmlWrap,onClick:()=>Yi(En)},St.createElement(Gt.Z,{value:Me}))),En>1&&St.createElement(lt.Z,{title:"\u5220\u9664"},St.createElement("i",{className:`${jt.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>si(Vn.filter(($n,ti)=>ti!==En))})),En<7&&En===Vn.length-1&&St.createElement(lt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},St.createElement("i",{className:`${jt.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>si([...Vn,""])})))),St.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),St.createElement("p",{className:""},"\u5206\u503C\uFF1A",St.createElement(vt.Z,{value:bn,max:1e4,min:-1,onChange:Me=>{Rn(Me)}})," \u5206"),St.createElement("aside",{className:"tr"},we.question_id&&St.createElement(Nt.ZP,{type:"default",onClick:()=>Un(!1)},"\u53D6\u6D88"),St.createElement(Nt.ZP,{className:"ml20",type:"primary",onClick:()=>ai()},"\u4FDD\u5B58")));return St.createElement("section",{className:jt.wrap},!Bn&&ke(),Bn&&Di())};var pi=(0,fe.connect)(({problemset:ye,loading:Qt,globalSetting:Zt})=>({problemset:ye,globalSetting:Zt,loading:Qt.effects}),null,null,{forwardRef:!0})((0,St.forwardRef)(vn)),yn=Yt(47889),ce=Object.defineProperty,Kt=Object.getOwnPropertySymbols,tn=Object.prototype.hasOwnProperty,Yn=Object.prototype.propertyIsEnumerable,Dn=(ye,Qt,Zt)=>Qt in ye?ce(ye,Qt,{enumerable:!0,configurable:!0,writable:!0,value:Zt}):ye[Qt]=Zt,je=(ye,Qt)=>{for(var Zt in Qt||(Qt={}))tn.call(Qt,Zt)&&Dn(ye,Zt,Qt[Zt]);if(Kt)for(var Zt of Kt(Qt))Yn.call(Qt,Zt)&&Dn(ye,Zt,Qt[Zt]);return ye},gn=(ye,Qt)=>{var Zt={};for(var De in ye)tn.call(ye,De)&&Qt.indexOf(De)<0&&(Zt[De]=ye[De]);if(ye!=null&&Kt)for(var De of Kt(ye))Qt.indexOf(De)<0&&Yn.call(ye,De)&&(Zt[De]=ye[De]);return Zt},Tn=(ye,Qt,Zt)=>new Promise((De,Mn)=>{var Hn=we=>{try{Be(Zt.next(we))}catch(zn){Mn(zn)}},ln=we=>{try{Be(Zt.throw(we))}catch(zn){Mn(zn)}},Be=we=>we.done?De(we.value):Promise.resolve(we.value).then(Hn,ln);Be((Zt=Zt.apply(ye,Qt)).next())});const Jn=["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"],Pn=(ye,Qt)=>{var Zt=ye,{problemset:De,globalSetting:Mn,loading:Hn,dispatch:ln,onRef:Be=()=>{},editData:we}=Zt,zn=gn(Zt,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[Vn,si]=(0,St.useState)([]),[Fe,Yi]=(0,St.useState)(),[qn,Ri]=(0,St.useState)([]),[Se,on]=(0,St.useState)(""),[bn,Rn]=(0,St.useState)(0),[Bn,Un]=(0,St.useState)(!1),mi=(0,fe.useParams)();(0,St.useEffect)(()=>{si(["","","",""])},[]),(0,St.useEffect)(()=>{if(!(we!=null&&we.question_choices)){Un(!0);return}on(we==null?void 0:we.question_title),Rn(parseInt(we==null?void 0:we.question_score)),si(we==null?void 0:we.question_choices.map(En=>En.choice_text));const Me=[];we==null||we.standard_answer.map((En,$n)=>{Me.push(En-1)}),Ri(Me)},[we]),(0,St.useImperativeHandle)(Qt,()=>({onSave:ai,isEdit:Bn}));const ai=()=>Tn(void 0,null,function*(){if(!Se)return re.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),!1;const Me=Vn.findIndex(ti=>!ti);if(Me>-1)return re.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Jn[Me]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!qn.length)return re.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(qn.length<1)return re.ZP.info("\u8BF7\u9009\u62E9\u7B54\u6848"),!1;const En=Vn.map((ti,mo)=>({choice_text:ti,is_answer:qn.includes(mo)?mo+1:0}));let $n;we.question_id?$n=yield(0,et.Kc)({id:we.question_id,question_title:Se,question_type:1,question_score:bn,question_choices:En.map(ti=>ti.choice_text),standard_answers:En.filter(ti=>ti.is_answer).map(ti=>ti.is_answer)}):$n=yield(0,et.iV)({exercise_bank_id:mi.topicId,question_title:Se,question_type:1,question_score:"5.0",question_choices:En.map(ti=>ti.choice_text),standard_answers:En.filter(ti=>ti.is_answer).map(ti=>ti.is_answer)}),$n.status===0&&(re.ZP.success("\u4FDD\u5B58\u6210\u529F"),Un(!1)),yield ln({type:"polls/getExerciseBanks",payload:je({},mi)})}),ei=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],di=Me=>Tn(void 0,null,function*(){switch(Me.id){case"del":let En;Ze.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return Tn(this,null,function*(){yield(0,et.x$)({pollsId:we.question_id}),ln({type:"polls/getExerciseBanks",payload:je({},mi)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:we==null?void 0:we.question_id,opr:Me.id}),ln({type:"polls/getExerciseBanks",payload:je({},mi)});break;case"edit":Un(!0);break}}),ke=()=>{var Me;return St.createElement("aside",null,St.createElement("div",{className:jt.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u5355\u9009\u9898"),"\uFF08",we.question_score,"\u5206\uFF09"),!we.hideAction&&ei.map(function(En,$n){return En.id==="up"&&we.key===1||En.id==="down"&&we.key===we.len?null:St.createElement(lt.Z,{key:$n,placement:"bottom",title:En.name},St.createElement("span",{onClick:()=>di(En),className:En.icon}))})),St.createElement("div",{className:"mt5"},St.createElement(Gt.Z,{value:we.question_title})),St.createElement("div",{className:jt.questionChoices},(Me=we==null?void 0:we.question_choices)==null?void 0:Me.map(function(En,$n){return St.createElement(Le.Z,null,St.createElement($t.Z,null,St.createElement(yn.ZP,{key:$n,checked:we.standard_answer.includes($n+1),disabled:!0},Jn[$n],".")),St.createElement($t.Z,{flex:"1"},St.createElement("span",{className:"c-black font14"},St.createElement(Gt.Z,{value:En.choice_text}))))})))},Di=()=>St.createElement("aside",null,St.createElement("div",{className:jt.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),St.createElement("p",{className:jt.titleWrap},St.createElement("span",{className:jt.required},"*"),St.createElement("span",{className:jt.title},"\u9898\u5E72\uFF1A")),St.createElement(bt.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Se,onChange:Me=>on(Me)}),St.createElement("p",{className:jt.titleWrap},St.createElement("span",{className:jt.required},"*"),St.createElement("span",{className:jt.title},"\u7B54\u6848\u9009\u9879\uFF1A",St.createElement("span",{className:jt.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Vn.map((Me,En)=>St.createElement("div",{className:jt.choiceWrap,key:En},St.createElement(lt.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},St.createElement("div",{className:`${jt.answer} ${qn.includes(En)?jt.activeAnswer:""}`,onClick:()=>{qn.includes(En)?Ri(qn.filter($n=>$n!==En)):Ri([...qn,En])}},Jn[En])),St.createElement("div",{className:jt.editorWrap},Fe===En?St.createElement(bt.Z,{id:`single-question-option-${En}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Me,onChange:$n=>{Vn[En]=$n,si(Vn)}}):St.createElement("div",{className:jt.htmlWrap,onClick:()=>Yi(En)},St.createElement(Gt.Z,{value:Me}))),En>1&&St.createElement(lt.Z,{title:"\u5220\u9664"},St.createElement("i",{className:`${jt.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>si(Vn.filter(($n,ti)=>ti!==En))})),En<7&&En===Vn.length-1&&St.createElement(lt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},St.createElement("i",{className:`${jt.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>si([...Vn,""])})))),St.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),St.createElement("p",{className:""},"\u5206\u503C\uFF1A",St.createElement(vt.Z,{value:bn,max:1e4,min:-1,onChange:Me=>{Rn(Me)}})," \u5206"),St.createElement("aside",{className:"tr"},we.question_id&&St.createElement(Nt.ZP,{type:"default",onClick:()=>Un(!1)},"\u53D6\u6D88"),St.createElement(Nt.ZP,{className:"ml20",type:"primary",onClick:()=>ai()},"\u4FDD\u5B58")));return St.createElement("section",{className:jt.wrap},!Bn&&ke(),Bn&&Di())};var Qn=(0,fe.connect)(({problemset:ye,loading:Qt,globalSetting:Zt})=>({problemset:ye,globalSetting:Zt,loading:Qt.effects}),null,null,{forwardRef:!0})((0,St.forwardRef)(Pn)),ee=Object.defineProperty,jn=Object.getOwnPropertySymbols,hi=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,kt=(ye,Qt,Zt)=>Qt in ye?ee(ye,Qt,{enumerable:!0,configurable:!0,writable:!0,value:Zt}):ye[Qt]=Zt,wt=(ye,Qt)=>{for(var Zt in Qt||(Qt={}))hi.call(Qt,Zt)&&kt(ye,Zt,Qt[Zt]);if(jn)for(var Zt of jn(Qt))Dt.call(Qt,Zt)&&kt(ye,Zt,Qt[Zt]);return ye},At=(ye,Qt)=>{var Zt={};for(var De in ye)hi.call(ye,De)&&Qt.indexOf(De)<0&&(Zt[De]=ye[De]);if(ye!=null&&jn)for(var De of jn(ye))Qt.indexOf(De)<0&&Dt.call(ye,De)&&(Zt[De]=ye[De]);return Zt},_t=(ye,Qt,Zt)=>new Promise((De,Mn)=>{var Hn=we=>{try{Be(Zt.next(we))}catch(zn){Mn(zn)}},ln=we=>{try{Be(Zt.throw(we))}catch(zn){Mn(zn)}},Be=we=>we.done?De(we.value):Promise.resolve(we.value).then(Hn,ln);Be((Zt=Zt.apply(ye,Qt)).next())});const Et=["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"],Pe=(ye,Qt)=>{var Zt=ye,{problemset:De,globalSetting:Mn,loading:Hn,dispatch:ln,onRef:Be=()=>{},editData:we}=Zt,zn=At(Zt,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[Vn,si]=(0,St.useState)(),[Fe,Yi]=(0,St.useState)(""),[qn,Ri]=(0,St.useState)(!1),[Se,on]=(0,St.useState)(5),bn=(0,fe.useParams)();(0,St.useEffect)(()=>{if(!(we!=null&&we.question_choices)){Ri(!0);return}Yi(we==null?void 0:we.question_title),on(we==null?void 0:we.question_score),si(we.standard_answer[0]+"")},[we]),(0,St.useImperativeHandle)(Qt,()=>({onSave:Rn,isEdit:qn}));const Rn=()=>_t(void 0,null,function*(){if(!Fe)return re.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!Vn)return re.ZP.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;const ei=[{choice_text:"\u6B63\u786E",is_answer:Vn==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Vn==="2"?2:0}];let di;return we.question_id?di=yield(0,et.Kc)({id:we.question_id,question_title:Fe,question_type:2,question_score:Se,question_choices:ei.map(ke=>ke.choice_text),standard_answers:ei.filter(ke=>ke.is_answer).map(ke=>ke.is_answer)}):di=yield(0,et.iV)({exercise_bank_id:bn.topicId,question_title:Fe,question_type:2,question_score:Se,question_choices:ei.map(ke=>ke.choice_text),standard_answers:ei.filter(ke=>ke.is_answer).map(ke=>ke.is_answer)}),di.status===0&&(re.ZP.success("\u4FDD\u5B58\u6210\u529F"),Ri(!1)),ln({type:"polls/getExerciseBanks",payload:wt({},bn)}),{name:Fe,choices:ei}}),Bn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Un=ei=>_t(void 0,null,function*(){switch(ei.id){case"del":let di;Ze.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return _t(this,null,function*(){yield(0,et.x$)({pollsId:we.question_id}),ln({type:"polls/getExerciseBanks",payload:wt({},bn)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:we==null?void 0:we.question_id,opr:ei.id}),ln({type:"polls/getExerciseBanks",payload:wt({},bn)});break;case"edit":Ri(!0);break}}),mi=()=>{var ei;return St.createElement("aside",null,St.createElement("div",{className:jt.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",we.question_score,"\u5206\uFF09"),!we.hideAction&&Bn.map(function(di,ke){return di.id==="up"&&we.key===1||di.id==="down"&&we.key===we.len?null:St.createElement(lt.Z,{key:ke,placement:"bottom",title:di.name},St.createElement("span",{onClick:()=>Un(di),className:di.icon}))})),St.createElement("div",{className:"mt5"},we.question_title),St.createElement("div",{className:jt.questionChoices},(ei=we==null?void 0:we.question_choices)==null?void 0:ei.map(function(di,ke){return St.createElement(yn.ZP,{key:ke,checked:we.standard_answer.includes(ke+1),disabled:!0},Et[ke],". ",St.createElement("span",{className:"c-black font14"},di.choice_text))})))},ai=()=>St.createElement("aside",null,St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),St.createElement("p",{className:jt.titleWrap},St.createElement("span",{className:jt.required},"*"),St.createElement("span",{className:jt.title},"\u9898\u5E72\uFF1A")),St.createElement(bt.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Fe,onChange:ei=>Yi(ei)}),St.createElement("p",{className:jt.titleWrap},St.createElement("span",{className:jt.required},"*"),St.createElement("span",{className:jt.title},"\u7B54\u6848\u9009\u9879\uFF1A",St.createElement("span",{className:jt.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),St.createElement(yn.ZP.Group,{buttonStyle:"solid",value:Vn,onChange:ei=>si(ei.target.value)},St.createElement(yn.ZP.Button,{value:"1",className:`${jt.radio} mr40`},"\u6B63\u786E"),St.createElement(yn.ZP.Button,{value:"2",className:jt.radio},"\u9519\u8BEF")),St.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),St.createElement("p",{className:""},"\u5206\u503C\uFF1A",St.createElement(vt.Z,{value:Se,max:1e4,min:-1,onChange:ei=>{on(ei)}})," \u5206"),St.createElement("aside",{className:"tr"},we.question_id&&St.createElement(Nt.ZP,{type:"default",onClick:()=>Ri(!1)},"\u53D6\u6D88"),St.createElement(Nt.ZP,{className:"ml20",type:"primary",onClick:()=>Rn()},"\u4FDD\u5B58")));return St.createElement("section",{className:jt.wrap},!qn&&mi(),qn&&ai())};var Ee=(0,fe.connect)(({problemset:ye,loading:Qt,globalSetting:Zt})=>({problemset:ye,globalSetting:Zt,loading:Qt.effects}),null,null,{forwardRef:!0})((0,St.forwardRef)(Pe)),sn=Yt(43749),He=Yt(39928),Ae=Yt(59895),qe=Object.defineProperty,en=Object.getOwnPropertySymbols,dn=Object.prototype.hasOwnProperty,An=Object.prototype.propertyIsEnumerable,_n=(ye,Qt,Zt)=>Qt in ye?qe(ye,Qt,{enumerable:!0,configurable:!0,writable:!0,value:Zt}):ye[Qt]=Zt,fn=(ye,Qt)=>{for(var Zt in Qt||(Qt={}))dn.call(Qt,Zt)&&_n(ye,Zt,Qt[Zt]);if(en)for(var Zt of en(Qt))An.call(Qt,Zt)&&_n(ye,Zt,Qt[Zt]);return ye},Zi=(ye,Qt)=>{var Zt={};for(var De in ye)dn.call(ye,De)&&Qt.indexOf(De)<0&&(Zt[De]=ye[De]);if(ye!=null&&en)for(var De of en(ye))Qt.indexOf(De)<0&&An.call(ye,De)&&(Zt[De]=ye[De]);return Zt},Pi=(ye,Qt,Zt)=>new Promise((De,Mn)=>{var Hn=we=>{try{Be(Zt.next(we))}catch(zn){Mn(zn)}},ln=we=>{try{Be(Zt.throw(we))}catch(zn){Mn(zn)}},Be=we=>we.done?De(we.value):Promise.resolve(we.value).then(Hn,ln);Be((Zt=Zt.apply(ye,Qt)).next())});const zi=null,Hi=(ye,Qt)=>{var Zt=ye,{problemset:De,globalSetting:Mn,loading:Hn,dispatch:ln,editData:Be}=Zt,we=Zi(Zt,["problemset","globalSetting","loading","dispatch","editData"]);const[zn,Vn]=(0,St.useState)(""),[si,Fe]=(0,St.useState)(""),[Yi,qn]=(0,St.useState)([]),[Ri,Se]=(0,St.useState)(""),[on,bn]=(0,St.useState)(),[Rn,Bn]=(0,St.useState)(!1),[Un,mi]=(0,St.useState)(5),[ai,ei]=(0,St.useState)(!1),di=(0,fe.useParams)();(0,St.useEffect)(()=>{if(!(Be!=null&&Be.question_title)){ei(!0);return}Vn(Be==null?void 0:Be.question_title),bn(Be==null?void 0:Be.is_ordered),mi(Be==null?void 0:Be.question_score);const Vi=Be==null?void 0:Be.standard_answer.map(Ci=>Ci.answer_text);qn(Vi)},[De.editData]),(0,St.useEffect)(()=>{Bn(!1)},[ai]),(0,St.useImperativeHandle)(Qt,()=>({onSave:ke,isEdit:ai}));const ke=()=>Pi(void 0,null,function*(){let Vi=[],Ci=!1;if(Yi.forEach((Bt,vo)=>{Vi.push({choice_id:vo+1,answer_text:[]}),Bt.forEach((Ui,Wi)=>{Vi[vo].answer_text.push(Ui),(!Ui||!(0,Ae.eR)(Ui,1e4))&&(Se(`${vo}-${Wi}`),re.ZP.info(Ui?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Ci=!0)})}),Ci)return!1;let kn;return Be.question_id?kn=yield(0,et.Kc)({id:Be.question_id,question_title:zn,question_type:3,question_score:Un,is_ordered:on,standard_answers:Vi}):kn=yield(0,et.iV)({exercise_bank_id:di.topicId,question_title:zn,question_type:3,question_score:Un,is_ordered:on,standard_answers:Vi}),kn.status===0&&(re.ZP.success("\u4FDD\u5B58\u6210\u529F"),ei(!1)),ln({type:"polls/getExerciseBanks",payload:fn({},di)}),{name:zn,analysis:si,standard_answers:Vi,is_ordered:on}}),Di=(Vi,Ci,kn)=>{const Bt=Yi.slice();if(Ci&&Bt.splice(Vi,Ci),kn&&Rn)for(let vo=0;vo<kn;vo++)Bt.splice(Vi+vo,0,[""]);Bn(!0),qn(Bt)},Me=(Vi,Ci,kn)=>{Se("");let Bt=Yi.slice();Bt[Vi][Ci]=kn,qn(Bt)},En=Vi=>{let Ci=Yi.slice();Ci[Vi]=[...Ci[Vi],""],qn(Ci)},$n=(Vi,Ci)=>{let kn=Yi.slice();if(!kn[Vi][Ci]){kn[Vi]=kn[Vi].filter((Bt,vo)=>vo!==Ci),qn(kn);return}Ze.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:jt.modal,onOk:()=>{kn[Vi]=kn[Vi].filter((Bt,vo)=>vo!==Ci),qn(kn)}})},ti=Vi=>{Ze.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:jt.modal,onOk:()=>{let Ci=Yi.slice();Ci=Yi.filter((kn,Bt)=>Vi!==Bt),qn(Ci)}})},mo=()=>St.createElement("aside",null,St.createElement("div",{className:jt.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),St.createElement("div",null,St.createElement(sn.Z,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:zn,onChange:Vi=>Vn(Vi),showNullButton:!0,onPlaceholderChange:Di})),St.createElement("div",{className:"mt20"},Yi.map((Vi,Ci)=>St.createElement(He.Z,{key:Ci,answers:Vi,index:Ci,is_md:!0,activeOptionErrorIndex:Ri,onAnswerChange:Me,addChildAnswer:En,deleteChildAnswer:$n,deleteChildAnswermain:ti}))),St.createElement("div",{className:"mt20"},Yi.length>1&&St.createElement("span",null,St.createElement(pt.default,{checked:on,onChange:Vi=>bn(Vi.target.checked),className:`${jt.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),St.createElement("span",{className:`${jt.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"))),St.createElement("p",{className:""},"\u5206\u503C\uFF1A",St.createElement(vt.Z,{value:Un,max:1e4,min:-1,onChange:Vi=>{mi(Vi)}})," \u5206"),St.createElement("aside",{className:"tr"},Be.question_id&&St.createElement(Nt.ZP,{type:"default",onClick:()=>ei(!1)},"\u53D6\u6D88"),St.createElement(Nt.ZP,{className:"ml20",type:"primary",onClick:()=>ke()},"\u4FDD\u5B58"))),Ji=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],wi=Vi=>Pi(void 0,null,function*(){switch(Vi.id){case"del":let Ci;Ze.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return Pi(this,null,function*(){yield(0,et.x$)({pollsId:Be.question_id}),ln({type:"polls/getExerciseBanks",payload:fn({},di)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:Be==null?void 0:Be.question_id,opr:Vi.id}),ln({type:"polls/getExerciseBanks",payload:fn({},di)});break;case"edit":ei(!0);break}}),bi=()=>{var Vi;return St.createElement("aside",null,St.createElement("div",{className:jt.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},Be.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",Be.question_score,"\u5206\uFF09"),!Be.hideAction&&Ji.map(function(Ci,kn){return Ci.id==="up"&&Be.key===1||Ci.id==="down"&&Be.key===Be.len?null:St.createElement(lt.Z,{key:kn,placement:"bottom",title:Ci.name},St.createElement("span",{onClick:()=>wi(Ci),className:Ci.icon}))})),St.createElement("div",{className:"mt5"},Be.question_title),St.createElement("div",{className:jt.questionChoices},(Vi=Be==null?void 0:Be.standard_answer)==null?void 0:Vi.map(function(Ci,kn){return St.createElement(Le.Z,null,St.createElement($t.Z,null,"\u7B54\u6848\uFF08\u586B\u7A7A",Ci.choice_id,"\uFF09\uFF1A"),St.createElement($t.Z,{flex:"1"},St.createElement(Re.default,{key:kn,checked:Be.standard_answer.includes(kn),disabled:!0,value:Ci.answer_text})))})))};return St.createElement("section",{className:jt.wrap},!ai&&bi(),ai&&mo())};var po=(0,fe.connect)(({problemset:ye,loading:Qt,globalSetting:Zt})=>({problemset:ye,globalSetting:Zt,loading:Qt.effects}),null,null,{forwardRef:!0})((0,St.forwardRef)(Hi)),oo=Object.defineProperty,Fi=Object.getOwnPropertySymbols,Ki=Object.prototype.hasOwnProperty,hr=Object.prototype.propertyIsEnumerable,Yo=(ye,Qt,Zt)=>Qt in ye?oo(ye,Qt,{enumerable:!0,configurable:!0,writable:!0,value:Zt}):ye[Qt]=Zt,Ro=(ye,Qt)=>{for(var Zt in Qt||(Qt={}))Ki.call(Qt,Zt)&&Yo(ye,Zt,Qt[Zt]);if(Fi)for(var Zt of Fi(Qt))hr.call(Qt,Zt)&&Yo(ye,Zt,Qt[Zt]);return ye},er=(ye,Qt)=>{var Zt={};for(var De in ye)Ki.call(ye,De)&&Qt.indexOf(De)<0&&(Zt[De]=ye[De]);if(ye!=null&&Fi)for(var De of Fi(ye))Qt.indexOf(De)<0&&hr.call(ye,De)&&(Zt[De]=ye[De]);return Zt},$o=(ye,Qt,Zt)=>new Promise((De,Mn)=>{var Hn=we=>{try{Be(Zt.next(we))}catch(zn){Mn(zn)}},ln=we=>{try{Be(Zt.throw(we))}catch(zn){Mn(zn)}},Be=we=>we.done?De(we.value):Promise.resolve(we.value).then(Hn,ln);Be((Zt=Zt.apply(ye,Qt)).next())});const Sr=null,Br=(ye,Qt)=>{var Zt=ye,{problemset:De,globalSetting:Mn,loading:Hn,dispatch:ln,onRef:Be=()=>{},editData:we}=Zt,zn=er(Zt,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[Vn,si]=(0,St.useState)(""),[Fe,Yi]=(0,St.useState)(""),[qn,Ri]=(0,St.useState)(""),[Se,on]=(0,St.useState)(5),[bn,Rn]=(0,St.useState)(!1),Bn=(0,fe.useParams)();(0,St.useEffect)(()=>{var ke;if(!(we!=null&&we.question_title)){Rn(!0);return}si(we==null?void 0:we.question_title),Ri((ke=we==null?void 0:we.standard_answer)==null?void 0:ke[0]),on(we==null?void 0:we.question_score)},[De.editData]),(0,St.useImperativeHandle)(Qt,()=>({onSave:Un,isEdit:bn}));const Un=()=>$o(void 0,null,function*(){if(!Vn)return re.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;let ke;return we.question_id?ke=yield(0,et.Kc)({id:we.question_id,question_title:Vn,question_type:4,question_score:Se,standard_answers:[qn]}):ke=yield(0,et.iV)({exercise_bank_id:Bn.topicId,question_title:Vn,question_type:4,question_score:Se,standard_answers:[qn]}),ke.status===0&&(re.ZP.success("\u4FDD\u5B58\u6210\u529F"),Rn(!1),ln({type:"polls/getExerciseBanks",payload:Ro({},Bn)})),{name:Vn,answer_texts:[qn],analysis:Fe}}),mi=()=>St.createElement("aside",null,St.createElement("div",{className:jt.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},"\u7B80\u7B54\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),St.createElement(bt.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Vn,onChange:ke=>si(ke)}),St.createElement("p",{className:jt.titleWrap},St.createElement("span",{className:jt.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),St.createElement(bt.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:qn,onChange:ke=>Ri(ke)}),St.createElement("p",{className:""},"\u5206\u503C\uFF1A",St.createElement(vt.Z,{value:Se,max:1e4,min:-1,onChange:ke=>{on(ke)}})," \u5206"),St.createElement("aside",{className:"tr"},we.question_id&&St.createElement(Nt.ZP,{type:"default",onClick:()=>Rn(!1)},"\u53D6\u6D88"),St.createElement(Nt.ZP,{className:"ml20",type:"primary",onClick:()=>Un()},"\u4FDD\u5B58"))),ai=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],ei=ke=>$o(void 0,null,function*(){switch(ke.id){case"del":let Di;Ze.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return $o(this,null,function*(){yield(0,et.x$)({pollsId:we.question_id}),ln({type:"polls/getExerciseBanks",payload:Ro({},Bn)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:we==null?void 0:we.question_id,opr:ke.id}),ln({type:"polls/getExerciseBanks",payload:Ro({},Bn)});break;case"edit":Rn(!0);break}}),di=()=>St.createElement("aside",null,St.createElement("div",{className:jt.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",we.question_score,"\u5206\uFF09"),!we.hideAction&&ai.map(function(ke,Di){return ke.id==="up"&&we.key===1||ke.id==="down"&&we.key===we.len?null:St.createElement(lt.Z,{key:Di,placement:"bottom",title:ke.name},St.createElement("span",{onClick:()=>ei(ke),className:ke.icon}))})),St.createElement("div",{className:"mt5"},we.question_title),St.createElement("div",{className:jt.questionChoices},St.createElement("p",null,St.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),St.createElement(Gt.Z,{value:qn})));return St.createElement("section",{className:jt.wrap},!bn&&di(),bn&&mi())};var nr=(0,fe.connect)(({problemset:ye,loading:Qt,globalSetting:Zt})=>({problemset:ye,globalSetting:Zt,loading:Qt.effects}),null,null,{forwardRef:!0})((0,St.forwardRef)(Br)),zo=Object.defineProperty,Xi=Object.getOwnPropertySymbols,ro=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,Go=(ye,Qt,Zt)=>Qt in ye?zo(ye,Qt,{enumerable:!0,configurable:!0,writable:!0,value:Zt}):ye[Qt]=Zt,lo=(ye,Qt)=>{for(var Zt in Qt||(Qt={}))ro.call(Qt,Zt)&&Go(ye,Zt,Qt[Zt]);if(Xi)for(var Zt of Xi(Qt))Ct.call(Qt,Zt)&&Go(ye,Zt,Qt[Zt]);return ye},jo=(ye,Qt)=>{var Zt={};for(var De in ye)ro.call(ye,De)&&Qt.indexOf(De)<0&&(Zt[De]=ye[De]);if(ye!=null&&Xi)for(var De of Xi(ye))Qt.indexOf(De)<0&&Ct.call(ye,De)&&(Zt[De]=ye[De]);return Zt},dr=(ye,Qt,Zt)=>new Promise((De,Mn)=>{var Hn=we=>{try{Be(Zt.next(we))}catch(zn){Mn(zn)}},ln=we=>{try{Be(Zt.throw(we))}catch(zn){Mn(zn)}},Be=we=>we.done?De(we.value):Promise.resolve(we.value).then(Hn,ln);Be((Zt=Zt.apply(ye,Qt)).next())});const br=null,qr=(ye,Qt)=>{var Zt=ye,{problemset:De,globalSetting:Mn,loading:Hn,dispatch:ln,editData:Be}=Zt,we=jo(Zt,["problemset","globalSetting","loading","dispatch","editData"]);const[zn,Vn]=(0,St.useState)(""),[si,Fe]=(0,St.useState)(""),[Yi,qn]=(0,St.useState)(""),[Ri,Se]=(0,St.useState)([]),[on,bn]=(0,St.useState)(""),[Rn,Bn]=(0,St.useState)(),[Un,mi]=(0,St.useState)(!1),[ai,ei]=(0,St.useState)([]),[di,ke]=(0,St.useState)(!1),Di=(0,fe.useParams)();(0,St.useEffect)(()=>{var Ji;Be.edit&&ke(!0),Vn(Be.shixun_name),Fe(Be.question_title);const wi=[];(Ji=Be.shixun)==null||Ji.map(bi=>{wi.push(bi.challenge_score)}),ei(wi)},[Be]),(0,St.useEffect)(()=>{mi(!1)},[di]),(0,St.useImperativeHandle)(Qt,()=>({onSave:Me,isEdit:di}));const Me=()=>dr(void 0,null,function*(){let Ji=[];if(!1)return!1;let bi;return Be.question_id?bi=yield(0,et.Kc)({id:Be.question_id,question_title:si,shixun_name:zn,shixun_id:Be.shixun_id,question_type:5,question_scores:ai}):bi=yield(0,et.iV)({exercise_bank_id:Di.topicId,question_title:si,shixun_name:zn,shixun_id:Be.shixun_id,question_type:5,question_scores:ai}),bi.status===0&&(re.ZP.success("\u4FDD\u5B58\u6210\u529F"),ke(!1)),yield ln({type:"polls/getExerciseBanks",payload:lo({},Di)}),{name:si,analysis:Yi,standard_answers:Ji,is_ordered:Rn}}),En=()=>{var Ji;return St.createElement("aside",null,St.createElement("div",{className:jt.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),St.createElement("div",{className:"mt10"},St.createElement(Re.default,{defaultValue:zn,onChange:wi=>{Vn(wi.target.value)}})),St.createElement("div",{className:"mt10"},St.createElement(bt.Z,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:si,onChange:wi=>{Fe(wi)}})),St.createElement("div",{className:"mt20"},(Ji=Be.shixun)==null?void 0:Ji.map((wi,bi)=>St.createElement(Le.Z,{gutter:[20,20]},St.createElement($t.Z,{flex:"1"},bi+1,".",wi.challenge_name),St.createElement($t.Z,null,St.createElement(vt.Z,{defaultValue:ai[bi],onChange:Vi=>{ai[bi]=Vi,ei(ai),console.log("srore:L",ai[bi])}}))))),St.createElement("div",{className:"mt20"},Ri.length>1&&St.createElement("span",null,St.createElement(pt.default,{checked:Rn,onChange:wi=>Bn(wi.target.checked),className:`${jt.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),St.createElement("span",{className:`${jt.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"))),St.createElement("aside",{className:"tr"},!(Be!=null&&Be.edit)&&St.createElement(Nt.ZP,{type:"default",onClick:()=>ke(!1)},"\u53D6\u6D88"),St.createElement(Nt.ZP,{className:"ml20",type:"primary",onClick:()=>Me()},"\u4FDD\u5B58")))},$n=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],ti=Ji=>dr(void 0,null,function*(){switch(Ji.id){case"del":let wi;Ze.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return dr(this,null,function*(){yield(0,et.x$)({pollsId:Be.question_id}),ln({type:"polls/getExerciseBanks",payload:lo({},Di)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:Be==null?void 0:Be.question_id,opr:Ji.id}),ln({type:"polls/getExerciseBanks",payload:lo({},Di)});break;case"edit":ke(!0);break}}),mo=()=>{var Ji;return St.createElement("aside",null,St.createElement("div",{className:jt.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},Be.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",Be.question_score,"\u5206\uFF09"),St.createElement("div",{className:"tr"},St.createElement(fe.Link,{target:"_blank",to:`/shixuns/${Be.shixun_identifier}/challenges`},"\u5B9E\u8BAD\u8BE6\u60C5"),!Be.hideAction&&$n.map(function(wi,bi){return wi.id==="up"&&Be.key===1||wi.id==="down"&&Be.key===Be.len?null:St.createElement(lt.Z,{key:bi,placement:"bottom",title:wi.name},St.createElement("span",{onClick:()=>ti(wi),className:wi.icon}))}))),St.createElement("div",{className:"font16"},Be.shixun_name),St.createElement("div",{className:"mt30"}),(Ji=Be.shixun)==null?void 0:Ji.map(function(wi,bi){return St.createElement("div",{key:bi},"\u7B2C",bi+1,"\u5173 ",St.createElement("span",{className:"ml10"},wi.challenge_name)," ",St.createElement("span",{className:"ml10"},wi.challenge_score))}))};return St.createElement("section",{className:jt.wrap},!di&&mo(),di&&En())};var ii=(0,fe.connect)(({problemset:ye,loading:Qt,globalSetting:Zt})=>({problemset:ye,globalSetting:Zt,loading:Qt.effects}),null,null,{forwardRef:!0})((0,St.forwardRef)(qr)),In={flex_box_center:"flex_box_center___eWsYC",flex_space_between:"flex_space_between___RALuo",flex_box_vertical_center:"flex_box_vertical_center___f7uVp",flex_box_center_end:"flex_box_center_end___UxPR3",flex_box_column:"flex_box_column___YUFuv",bg:"bg___zWTsF",containerTitle:"containerTitle___DzTZh",containerDesc:"containerDesc___a3TiA",listItem:"listItem____nHKG",info:"info___LWlgA",title:"title___gtaI4",titleLeft:"titleLeft___Ce3h9",titleRight:"titleRight___gARIc",acitons:"acitons___MrR2u",export:"export___u_8cL"},ve=Yt(74431),he=Object.defineProperty,oe=Object.getOwnPropertySymbols,xn=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable,Zn=(ye,Qt,Zt)=>Qt in ye?he(ye,Qt,{enumerable:!0,configurable:!0,writable:!0,value:Zt}):ye[Qt]=Zt,Ke=(ye,Qt)=>{for(var Zt in Qt||(Qt={}))xn.call(Qt,Zt)&&Zn(ye,Zt,Qt[Zt]);if(oe)for(var Zt of oe(Qt))Cn.call(Qt,Zt)&&Zn(ye,Zt,Qt[Zt]);return ye},pn=(ye,Qt)=>{var Zt={};for(var De in ye)xn.call(ye,De)&&Qt.indexOf(De)<0&&(Zt[De]=ye[De]);if(ye!=null&&oe)for(var De of oe(ye))Qt.indexOf(De)<0&&Cn.call(ye,De)&&(Zt[De]=ye[De]);return Zt},me=(ye,Qt,Zt)=>new Promise((De,Mn)=>{var Hn=we=>{try{Be(Zt.next(we))}catch(zn){Mn(zn)}},ln=we=>{try{Be(Zt.throw(we))}catch(zn){Mn(zn)}},Be=we=>we.done?De(we.value):Promise.resolve(we.value).then(Hn,ln);Be((Zt=Zt.apply(ye,Qt)).next())});const{SubMenu:de}=be.default,{Content:Sn,Sider:Wt}=Xe.default,Ne=ye=>{var Qt=ye,{polls:Zt,globalSetting:De,loading:Mn,user:Hn,dispatch:ln}=Qt,Be=pn(Qt,["polls","globalSetting","loading","user","dispatch"]),we,zn,Vn,si,Fe,Yi,qn,Ri,Se,on,bn,Rn,Bn,Un,mi,ai,ei,di,ke,Di,Me,En,$n,ti,mo,Ji,wi,bi,Vi,Ci,kn,Bt,vo,Ui,Wi,so,bo,Kn,li,Ai,ki,Bi,Zo,vi,fi,Qe,ni,no,Ho,_o,ko,Ko,Fo,zr,Dr,ms,Ce;const To=(0,fe.useParams)(),kl=(0,fe.useLocation)(),{userInfo:Gr}=Hn,[ca]=ge.default.useForm(),[Po,Ml]=(0,St.useState)([]),[fl,Wo]=(0,St.useState)(!1),Or=[{name:"\u9009\u62E9\u9898",id:0},{name:"\u5224\u65AD\u9898",id:2},{name:"\u586B\u7A7A\u9898",id:3},{name:"\u7B80\u7B54\u9898",id:4},{name:"\u5B9E\u8BAD\u9898",id:5}],ta=(0,St.useRef)();(0,St.useEffect)(()=>{var yo,vs,Vr,to,co,rn;(yo=Zt.exerciseBanks)!=null&&yo.exercise_questions&&(Ml([...(vs=Zt.exerciseBanks)==null?void 0:vs.exercise_questions]),ca.setFieldsValue({exercise_name:(to=(Vr=Zt.exerciseBanks)==null?void 0:Vr.exercise)==null?void 0:to.exercise_name,exercise_description:(rn=(co=Zt.exerciseBanks)==null?void 0:co.exercise)==null?void 0:rn.exercise_description}))},[Zt.exerciseBanks]),(0,St.useEffect)(()=>{ln({type:"polls/getExerciseBanks",payload:Ke({},To)})},[To.categoryId]);const is=()=>me(void 0,null,function*(){var yo,vs;yield ca.validateFields();const Vr=ca.getFieldValue();Vr.is_md=!0,Vr.topicId=(vs=(yo=Zt.exerciseBanks)==null?void 0:yo.exercise)==null?void 0:vs.id,Wo(!1),yield(0,et.hO)(Ke({},Vr)),ln({type:"polls/getExerciseBanks",payload:Ke({},To)})}),Ra=yo=>me(void 0,null,function*(){const vs=yield ta==null?void 0:ta.current;if(vs!=null&&vs.isEdit){re.ZP.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898");return}yo===5?ln({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}):Ml([...Po,{question_type:yo}])}),Ys=()=>{ln({type:"userDetail/setActionTabs",payload:{key:"UserDetail-SendToClass",params:{object_id:[To.topicId],object_type:"exercise"}}})},yi=function(){return Po==null?void 0:Po.map(function(yo,vs){if(yo.key=vs+1,yo.len=Po.length,yo.question_type===0)return St.createElement("aside",null,St.createElement(Qn,{ref:ta,editData:yo}),St.createElement(se.Z,null));if(yo.question_type===1)return St.createElement("aside",null,St.createElement(pi,{ref:ta,editData:yo}),St.createElement(se.Z,null));if(yo.question_type===2)return St.createElement("aside",null,St.createElement(Ee,{ref:ta,editData:yo}),St.createElement(se.Z,null));if(yo.question_type===3)return St.createElement("aside",null,St.createElement(po,{editData:yo}),St.createElement(se.Z,null));if(yo.question_type===4)return St.createElement("aside",null,St.createElement(nr,{editData:yo}),St.createElement(se.Z,null));if(yo.question_type===5)return St.createElement("aside",null,St.createElement(ii,{editData:yo}),St.createElement(se.Z,null))})};return St.createElement("section",{className:"edu-container"},St.createElement("section",{className:"animated fadeIn"},St.createElement("aside",{className:"mt10"},Gr&&St.createElement(Ie.Z,{separator:">"},St.createElement(Ie.Z.Item,null,St.createElement(fe.Link,{to:`/users/${To.username}/${To.topictype==="personal"?"topics":"topicbank"}/${To.topictype}`},To.topictype==="personal"?"\u6211\u7684\u9898\u5E93":"\u516C\u5171\u9898\u5E93")),St.createElement(Ie.Z.Item,null,"\u8BE6\u60C5"))),St.createElement("aside",{className:[In.title,"mt20"].join(" ")},St.createElement(Le.Z,{style:{width:"100%"},align:"middle"},St.createElement($t.Z,{flex:"1"},St.createElement("strong",{className:"font20 ml5"},(zn=(we=Zt.exerciseBanks)==null?void 0:we.exercise)==null?void 0:zn.exercise_name),St.createElement(Ae.VV,{status:[(si=(Vn=Zt.exerciseBanks)==null?void 0:Vn.exercise)!=null&&si.is_public?"\u516C\u5F00":"\u79C1\u6709"]})),St.createElement($t.Z,null,St.createElement(fe.Link,{className:"font16 c-light-black",to:`/users/${Gr.login}/topics/${To.topictype}`},"\u8FD4\u56DE"))))),St.createElement("section",{className:[In.bg,"pl30","pr30","pb30","mt20 relative"].join(" ")},St.createElement("div",{className:In.export},((Fe=Zt.exerciseBanks)==null?void 0:Fe.authorize)&&St.createElement(St.Fragment,null,St.createElement("a",{onClick:yo=>{yo.preventDefault(),Ze.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:()=>me(void 0,null,function*(){(yield(0,nt.Tv)({object_type:"normal",object_id:[To.topicId]})).status===0&&fe.history.push(`/users/${To.username}/topics/personal`)})})}},"\u5220\u9664"),St.createElement(fe.Link,{to:`/users/${Gr.login}/topics/${To.topicId}/${To.topictype}/exercise/edit`},"\u7F16\u8F91")),St.createElement("a",{onClick:yo=>{yo.preventDefault(),Ys()}},"\u53D1\u9001")),St.createElement(ae.default,{className:In.tabs},St.createElement(ae.default.TabPane,{tab:St.createElement("span",{className:"font16 pt10 pb12"},"\u5185\u5BB9\u8BE6\u60C5"),key:"1"},St.createElement("div",{className:"c-light-black"},(qn=(Yi=Zt.exerciseBanks)==null?void 0:Yi.exercise)==null?void 0:qn.exercise_description))),fl&&St.createElement(ge.default,{layout:"vertical",form:ca},St.createElement(ge.default.Item,{name:"exercise_name",label:"\u8BD5\u5377\u6807\u9898\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},St.createElement(Re.default,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),St.createElement(ge.default.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},St.createElement(Re.default.TextArea,{rows:6,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26"})),St.createElement(ge.default.Item,{className:"tr"},St.createElement(Nt.ZP,{type:"primary",onClick:()=>{is()}},"\u4FDD\u5B58")))),St.createElement("p",{className:"mt10",style:{display:"flex"}},St.createElement("span",{className:"fl",style:{flex:"1"}},!!((Se=(Ri=Zt.exerciseBanks)==null?void 0:Ri.exercise_types)!=null&&Se.q_singles)&&St.createElement("span",{className:"ml20"},"\u5355\u9009\u9898",(bn=(on=Zt.exerciseBanks)==null?void 0:on.exercise_types)==null?void 0:bn.q_singles,"\u9898\uFF0C\u5171",(Bn=(Rn=Zt.exerciseBanks)==null?void 0:Rn.exercise_types)==null?void 0:Bn.q_singles_scores,"\u5206"),!!((mi=(Un=Zt.exerciseBanks)==null?void 0:Un.exercise_types)!=null&&mi.q_doubles)&&St.createElement("span",{className:"ml20"},"\u591A\u9009\u9898",(ei=(ai=Zt.exerciseBanks)==null?void 0:ai.exercise_types)==null?void 0:ei.q_doubles,"\u9898\uFF0C\u5171",(ke=(di=Zt.exerciseBanks)==null?void 0:di.exercise_types)==null?void 0:ke.q_doubles_scores,"\u5206"),!!((Me=(Di=Zt.exerciseBanks)==null?void 0:Di.exercise_types)!=null&&Me.q_judges)&&St.createElement("span",{className:"ml20"},"\u5224\u65AD\u9898",($n=(En=Zt.exerciseBanks)==null?void 0:En.exercise_types)==null?void 0:$n.q_judges,"\u9898\uFF0C\u5171",(mo=(ti=Zt.exerciseBanks)==null?void 0:ti.exercise_types)==null?void 0:mo.q_judges_scores,"\u5206"),!!((wi=(Ji=Zt.exerciseBanks)==null?void 0:Ji.exercise_types)!=null&&wi.q_nulls)&&St.createElement("span",{className:"ml20"},"\u586B\u7A7A\u9898",(Vi=(bi=Zt.exerciseBanks)==null?void 0:bi.exercise_types)==null?void 0:Vi.q_nulls,"\u9898\uFF0C\u5171",(kn=(Ci=Zt.exerciseBanks)==null?void 0:Ci.exercise_types)==null?void 0:kn.q_nulls_scores,"\u5206"),!!((vo=(Bt=Zt.exerciseBanks)==null?void 0:Bt.exercise_types)!=null&&vo.q_mains)&&St.createElement("span",{className:"ml20"},"\u7B80\u7B54\u9898",(Wi=(Ui=Zt.exerciseBanks)==null?void 0:Ui.exercise_types)==null?void 0:Wi.q_mains,"\u9898\uFF0C\u5171",(bo=(so=Zt.exerciseBanks)==null?void 0:so.exercise_types)==null?void 0:bo.q_mains_scores,"\u5206"),!!((li=(Kn=Zt.exerciseBanks)==null?void 0:Kn.exercise_types)!=null&&li.q_shixuns)&&St.createElement("span",{className:"ml20"},"\u5B9E\u8BAD\u9898",(ki=(Ai=Zt.exerciseBanks)==null?void 0:Ai.exercise_types)==null?void 0:ki.q_shixuns,"\u9898\uFF0C\u5171",(Zo=(Bi=Zt.exerciseBanks)==null?void 0:Bi.exercise_types)==null?void 0:Zo.q_shixuns_scores,"\u5206"),!!((fi=(vi=Zt.exerciseBanks)==null?void 0:vi.exercise_types)!=null&&fi.q_pros)&&St.createElement("span",{className:"ml20"},"\u7F16\u7A0B\u9898",(ni=(Qe=Zt.exerciseBanks)==null?void 0:Qe.exercise_types)==null?void 0:ni.q_pros,"\u9898\uFF0C\u5171",(Ho=(no=Zt.exerciseBanks)==null?void 0:no.exercise_types)==null?void 0:Ho.q_pros_scores,"\u5206")),St.createElement("span",{className:"fr"},!!((ko=(_o=Zt.exerciseBanks)==null?void 0:_o.exercise_types)!=null&&ko.q_counts)&&St.createElement("span",null,"\u5408\u8BA1 ",St.createElement("span",{className:"color-blue"},(Fo=(Ko=Zt.exerciseBanks)==null?void 0:Ko.exercise_types)==null?void 0:Fo.q_counts)," \u9898\uFF0C \u5171 ",St.createElement("span",{className:`${((Dr=(zr=Zt.exerciseBanks)==null?void 0:zr.exercise_types)==null?void 0:Dr.q_scores)>100?"color-red font-bd":"color-orange"}`},(Ce=(ms=Zt.exerciseBanks)==null?void 0:ms.exercise_types)==null?void 0:Ce.q_scores)," \u5206"))),St.createElement("section",{className:[In.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},Po!=""&&yi(),Po==""&&St.createElement(ct.Z,null)),St.createElement(ve.Z,null))};var an=(0,fe.connect)(({polls:ye,loading:Qt,user:Zt,globalSetting:De})=>({polls:ye,globalSetting:De,user:Zt,loading:Qt.effects}))(Ne)},74431:function(un,Gn,Yt){"use strict";Yt.d(Gn,{Z:function(){return Je}});var St=Yt(59301),fe=Yt(71570),be=Yt(6767),Xe=Yt(62957),ge=Yt(20554),re=Yt(458),se=Yt(47889),Ie={title:"title___XAxiE",radioWrap:"radioWrap___k0pOB",radio:"radio___x9kMt",colorFF0000:"colorFF0000___IMgd0",pagination:"pagination___ou2ht",checkboxWrapper:"checkboxWrapper___kF7xI"},Le=Yt(59895),$t=Yt(46133),Ze=Yt(29787),ae=Yt(62673),Re=Yt(52314),Nt=Yt(26724),et=Yt.n(Nt),nt=(Ye,hn,Fn)=>new Promise((vn,pi)=>{var yn=tn=>{try{Kt(Fn.next(tn))}catch(Yn){pi(Yn)}},ce=tn=>{try{Kt(Fn.throw(tn))}catch(Yn){pi(Yn)}},Kt=tn=>tn.done?vn(tn.value):Promise.resolve(tn.value).then(yn,ce);Kt((Fn=Fn.apply(Ye,hn)).next())}),lt=({username:Ye,setStages:hn,stages:Fn,hasError:vn,setHasError:pi})=>{const[yn,ce]=(0,St.useState)(""),[Kt,tn]=(0,St.useState)(1),[Yn,Dn]=(0,St.useState)([]),[je,gn]=(0,St.useState)(!1),[Tn,Jn]=(0,St.useState)(0);(0,St.useEffect)(()=>{Pn({page:1,search:""},!0)},[]);const Pn=(ee,jn)=>nt(void 0,null,function*(){gn(!0);const hi=yield(0,Re.w3)({username:Ye,category:"manage",page:ee.page,search:ee.search});gn(!1),Dn(Dt=>jn?hi==null?void 0:hi.subjects:[...Dt,...hi==null?void 0:hi.subjects]),Jn(hi==null?void 0:hi.count)}),Qn=(0,St.useRef)();return St.createElement("div",{className:Ie.wrap},St.createElement("div",{className:"mb10"},St.createElement($t.t7,{placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",value:yn,style:{width:500},onChange:ee=>{ce(ee),tn(1),Qn.current.scrollTo({behavior:"smooth",top:0}),Pn({page:1,search:ee},!0)}})),St.createElement(Ze.Z,{spinning:je},St.createElement("div",{className:Ie.radioWrap,ref:Qn},St.createElement(et(),{initialLoad:!1,pageStart:1,threshold:6,loadMore:()=>{tn(Kt+1),Pn({page:Kt+1,search:yn},!1)},hasMore:Yn.length<Tn,useWindow:!1},St.createElement(se.ZP.Group,{value:Fn.subjectId,onChange:ee=>{hn({subjectId:ee.target.value,stage_ids:[]}),pi(!1)}},Yn.map(ee=>{const jn=ee.stages.map(hi=>({label:hi.name,value:hi.id}));return St.createElement("div",{key:ee.id},St.createElement(se.ZP,{className:Ie.radio,value:ee.id},ee.name),ee.id===Fn.subjectId&&St.createElement("div",{className:Ie.checkboxWrapper},jn.length>0&&St.createElement(ae.default,{indeterminate:Fn.stage_ids.length>0&&Fn.stage_ids.length<jn.length,onChange:hi=>{hn({subjectId:ee.id,stage_ids:hi.target.checked?jn.map(Dt=>Dt.value):[]})},checked:Fn.stage_ids.length===jn.length},"\u5168\u9009"),St.createElement(ae.default.Group,{options:jn,value:Fn.stage_ids,onChange:hi=>hn({subjectId:ee.id,stage_ids:hi})})))}))))),vn&&St.createElement("div",{className:Ie.colorFF0000},"\u8BF7\u5148\u9009\u62E9\u5B9E\u8DF5\u8BFE\u7A0B\u53CA\u7AE0\u8282"))},pt=Yt(74470),vt=Yt(68268),Lt=Object.defineProperty,bt=Object.getOwnPropertySymbols,Gt=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable,ne=(Ye,hn,Fn)=>hn in Ye?Lt(Ye,hn,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):Ye[hn]=Fn,ie=(Ye,hn)=>{for(var Fn in hn||(hn={}))Gt.call(hn,Fn)&&ne(Ye,Fn,hn[Fn]);if(bt)for(var Fn of bt(hn))jt.call(hn,Fn)&&ne(Ye,Fn,hn[Fn]);return Ye},te=(Ye,hn)=>{var Fn={};for(var vn in Ye)Gt.call(Ye,vn)&&hn.indexOf(vn)<0&&(Fn[vn]=Ye[vn]);if(Ye!=null&&bt)for(var vn of bt(Ye))hn.indexOf(vn)<0&&jt.call(Ye,vn)&&(Fn[vn]=Ye[vn]);return Fn},Ge=(Ye,hn,Fn)=>new Promise((vn,pi)=>{var yn=tn=>{try{Kt(Fn.next(tn))}catch(Yn){pi(Yn)}},ce=tn=>{try{Kt(Fn.throw(tn))}catch(Yn){pi(Yn)}},Kt=tn=>tn.done?vn(tn.value):Promise.resolve(tn.value).then(yn,ce);Kt((Fn=Fn.apply(Ye,hn)).next())});const pe=Ye=>{var hn=Ye,{userDetail:Fn,globalSetting:vn,loading:pi,user:yn,dispatch:ce}=hn,Kt=te(hn,["userDetail","globalSetting","loading","user","dispatch"]),tn,Yn,Dn,je,gn;const[Tn,Jn]=(0,St.useState)("course"),[Pn,Qn]=(0,St.useState)(""),[ee,jn]=(0,St.useState)([]),[hi,Dt]=(0,St.useState)(),[kt,wt]=(0,St.useState)(!1),[At,_t]=(0,St.useState)(!1);(0,St.useEffect)(()=>{Fn.actionTabs.key==="UserDetail-SendToClass"&&Et(Pn)},[Fn.actionTabs.key]);const Et=He=>Ge(void 0,null,function*(){wt(!0);const Ae=yield ce({type:"userDetail/topicGetCourseList",payload:{search:He}});Ae&&jn((Ae==null?void 0:Ae.courses)||[]),wt(!1)}),[Pe,Ee]=(0,St.useState)({subjectId:"",stage_ids:[]}),sn=()=>Ge(void 0,null,function*(){var He,Ae,qe,en,dn,An;if(Tn==="course"){if(!hi){_t(!0);return}const _n=yield ce({type:"userDetail/topicSendToClass",payload:ie({course_id:hi},(He=Fn.actionTabs)==null?void 0:He.params)});if(ce({type:"userDetail/setActionTabs",payload:{}}),_n&&_n.status===0){const fn={normal:"common_homework",group:"group_homework",exercise:"exercise",poll:"poll",videos:"video"};(0,Le.xg)(`/classrooms/${hi}/${fn[(qe=(Ae=Fn.actionTabs)==null?void 0:Ae.params)==null?void 0:qe.object_type]}`)}}else{if(!Pe.subjectId||!Pe.stage_ids.length){_t(!0);return}(yield(0,vt.nI)({id:(dn=(en=Fn.actionTabs)==null?void 0:en.params)==null?void 0:dn.object_id,login:(An=yn.userInfo)==null?void 0:An.login},{stage_ids:Pe.stage_ids})).status===0&&(be.ZP.success("\u53D1\u9001\u6210\u529F"),ce({type:"userDetail/setActionTabs",payload:{}}),(0,Le.xg)(`/paths/${Pe.subjectId}`))}});return St.createElement(Xe.default,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,open:Fn.actionTabs.key==="UserDetail-SendToClass",title:"\u53D1\u9001",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:pi["userDetail/sendToClass"],width:600,afterClose:()=>{_t(!1),jn([]),Ee({subjectId:"",stage_ids:[]}),Qn("")},onOk:sn,wrapClassName:pt.Z.CustomCss,onCancel:()=>{ce({type:"userDetail/setActionTabs",payload:{}})}},St.createElement(ge.default,{activeKey:Tn,onChange:He=>{_t(!1),Jn(He)},items:[{label:"\u8BFE\u5802",key:"course",children:St.createElement("div",{className:Ie.wrap},St.createElement("div",{className:"mb10"},St.createElement($t.t7,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u5802\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",value:Pn,style:{width:500},onChange:He=>{Qn(He),Et(He)}})),St.createElement(re.Z,{active:!0,loading:kt},St.createElement("div",{className:Ie.radioWrap},St.createElement(se.ZP.Group,{value:hi,onChange:He=>{Dt(He.target.value),_t(!1)}},ee.map((He,Ae)=>St.createElement(se.ZP,{className:Ie.radio,value:He.course_id,key:He.course_id},He.course_name))))),((Yn=(tn=Fn.actionTabs)==null?void 0:tn.params)==null?void 0:Yn.object_type)!=="videos"&&St.createElement("div",{className:Ie.title},"\u6E29\u99A8\u63D0\u793A\uFF1A\u9009\u62E9\u7684\u9898\u5C06\u4F1A\u53D1\u9001\u5230\u6307\u5B9A\u8BFE\u5802"),At&&St.createElement("div",{className:Ie.colorFF0000},"\u8BF7\u5148\u9009\u62E9\u8BFE\u5802")),show:!0},{label:"\u5B9E\u8DF5\u8BFE\u7A0B",key:"subject",children:St.createElement(lt,{username:(Dn=yn.userInfo)==null?void 0:Dn.login,stages:Pe,setStages:Ee,hasError:At,setHasError:_t}),show:((gn=(je=Fn.actionTabs)==null?void 0:je.params)==null?void 0:gn.object_type)==="videos"}].filter(He=>He.show)}))};var Je=(0,fe.connect)(({userDetail:Ye,loading:hn,globalSetting:Fn,user:vn})=>({userDetail:Ye,globalSetting:Fn,loading:hn.effects,user:vn}))(pe)},49405:function(un,Gn,Yt){"use strict";Yt.d(Gn,{AL:function(){return Lt},Iy:function(){return Ze},Qv:function(){return Nt},ez:function(){return vt},jb:function(){return ae}});var St=Yt(32834),fe=Yt.n(St),be=Yt(11690),Xe=Yt.n(be);let ge=1;function re(ie,te){const Ge=ie.match(/^(\s+)(?:```)/);if(Ge===null)return te;const pe=Ge[1];return te.split(`
`).map(Je=>{const Ye=Je.match(/^\s+/);if(Ye===null)return Je;const[hn]=Ye;return hn.length>=pe.length?Je.slice(pe.length):Je}).join(`
`)}let se=[],Ie=["<ul>"];const Le=new(fe()).Renderer,$t=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ze(){se.length=0,Ie=["<ul>"]}const ae={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Re(ie,te,Ge,pe){if(te>=ie.length||ie[te].level<=Ge)return te;var Je=ie[te];pe.push("<li><a href='#"+ge+Je.anchor+"'>"+Je.text+"</a>"),te++;var Ye=[];return te=Re(ie,te,Je.level,Ye),Ye.length>0&&(pe.push("<ul>"),Ye.forEach(function(hn){pe.push(hn)}),pe.push("</ul>")),pe.push("</li>"),te=Re(ie,te,Ge,pe),te}function Nt(){return Re(se,0,0,Ie),Ie.push("</ul>"),Ie.join("")}const et={heading(ie){const te=$t.exec(ie);if(ge+=1,te)return{type:"heading",raw:te[0],depth:te[1].length,text:te[2]}},fences(ie){const te=this.rules.block.fences.exec(ie);if(te){const Ge=te[0];let pe=re(Ge,te[3]||"");const Je=te[2]?te[2].trim():te[2];if(["latex","katex","math"].indexOf(Je)>=0){const Ye=lt(),hn=pe;pe=Ye,pt[Ye]={type:"block",expression:hn}}return{type:"code",raw:Ge,lang:Je,text:pe}}}},nt=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let ct=0;const lt=()=>`__special_katext_id_${ct++}__`;let pt={};function vt(){return pt}function Lt(){ct=0,pt={}}function bt(ie){return ie=ie.replace(nt,(te,Ge)=>{const pe=lt();return pt[pe]={type:"inline",expression:Ge},pe}),ie}const Gt=Le.listitem;Le.listitem=function(ie){return Gt(bt(ie))};const jt=Le.paragraph;Le.paragraph=function(ie){return jt(bt(ie))};const ne=Le.tablecell;Le.tablecell=function(ie,te){return ne(bt(ie),te)},Le.code=function(ie,te,Ge){const pe=(te||"").match(/\S*/)[0];return pe?["latex","katex","math"].indexOf(pe)>=0?`<p class='editormd-tex'>${ie}</p>`:`<pre class="prettyprint linenums"><code class="language-${te}">${Ge?ie:(0,be.escape)(ie,!0)}</code></pre>
`:'<pre class="prettyprint linenums"><code>'+(Ge?ie:(0,be.escape)(ie,!0))+"</code></pre>"},Le.heading=function(ie,te,Ge){let pe=this.options.headerPrefix+Ge.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return se.push({anchor:pe,level:te,text:ie}),"<h"+te+' id="'+ge+pe+'">'+ie+"</h"+te+">"},fe().setOptions({silent:!0,gfm:!0,pedantic:!1}),fe().use({tokenizer:et,renderer:Le}),Gn.ZP=fe()},99498:function(un,Gn,Yt){(function(St){St(Yt(89780))})(function(St){St.defineOption("placeholder","",function(Ie,Le,$t){var Ze=$t&&$t!=St.Init;if(Le&&!Ze)Ie.on("blur",ge),Ie.on("change",re),Ie.on("swapDoc",re),St.on(Ie.getInputField(),"compositionupdate",Ie.state.placeholderCompose=function(){Xe(Ie)}),re(Ie);else if(!Le&&Ze){Ie.off("blur",ge),Ie.off("change",re),Ie.off("swapDoc",re),St.off(Ie.getInputField(),"compositionupdate",Ie.state.placeholderCompose),fe(Ie);var ae=Ie.getWrapperElement();ae.className=ae.className.replace(" CodeMirror-empty","")}Le&&!Ie.hasFocus()&&ge(Ie)});function fe(Ie){Ie.state.placeholder&&(Ie.state.placeholder.parentNode.removeChild(Ie.state.placeholder),Ie.state.placeholder=null)}function be(Ie){fe(Ie);var Le=Ie.state.placeholder=document.createElement("pre");Le.style.cssText="height: 0; overflow: visible",Le.style.direction=Ie.getOption("direction"),Le.className="CodeMirror-placeholder CodeMirror-line-like";var $t=Ie.getOption("placeholder");typeof $t=="string"&&($t=document.createTextNode($t)),Le.appendChild($t),Ie.display.lineSpace.insertBefore(Le,Ie.display.lineSpace.firstChild)}function Xe(Ie){setTimeout(function(){var Le=!1,$t=Ie.getInputField();$t.nodeName=="TEXTAREA"?Le=!$t.value:Ie.lineCount()==1&&(Le=!/[^\u200b]/.test($t.querySelector(".CodeMirror-line").textContent)),Le?be(Ie):fe(Ie)},20)}function ge(Ie){se(Ie)&&be(Ie)}function re(Ie){var Le=Ie.getWrapperElement(),$t=se(Ie);Le.className=Le.className.replace(" CodeMirror-empty","")+($t?" CodeMirror-empty":""),$t?be(Ie):fe(Ie)}function se(Ie){return Ie.lineCount()===1&&Ie.getLine(0)===""}})},25717:function(un,Gn,Yt){(function(St){St(Yt(89780))})(function(St){var fe={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},be=St.Pos;St.defineOption("autoCloseBrackets",!1,function(et,nt,ct){ct&&ct!=St.Init&&(et.removeKeyMap(ge),et.state.closeBrackets=null),nt&&(re(Xe(nt,"pairs")),et.state.closeBrackets=nt,et.addKeyMap(ge))});function Xe(et,nt){return nt=="pairs"&&typeof et=="string"?et:typeof et=="object"&&et[nt]!=null?et[nt]:fe[nt]}var ge={Backspace:Le,Enter:$t};function re(et){for(var nt=0;nt<et.length;nt++){var ct=et.charAt(nt),lt="'"+ct+"'";ge[lt]||(ge[lt]=se(ct))}}re(fe.pairs+"`");function se(et){return function(nt){return ae(nt,et)}}function Ie(et){var nt=et.state.closeBrackets;if(!nt||nt.override)return nt;var ct=et.getModeAt(et.getCursor());return ct.closeBrackets||nt}function Le(et){var nt=Ie(et);if(!nt||et.getOption("disableInput"))return St.Pass;for(var ct=Xe(nt,"pairs"),lt=et.listSelections(),pt=0;pt<lt.length;pt++){if(!lt[pt].empty())return St.Pass;var vt=Re(et,lt[pt].head);if(!vt||ct.indexOf(vt)%2!=0)return St.Pass}for(var pt=lt.length-1;pt>=0;pt--){var Lt=lt[pt].head;et.replaceRange("",be(Lt.line,Lt.ch-1),be(Lt.line,Lt.ch+1),"+delete")}}function $t(et){var nt=Ie(et),ct=nt&&Xe(nt,"explode");if(!ct||et.getOption("disableInput"))return St.Pass;for(var lt=et.listSelections(),pt=0;pt<lt.length;pt++){if(!lt[pt].empty())return St.Pass;var vt=Re(et,lt[pt].head);if(!vt||ct.indexOf(vt)%2!=0)return St.Pass}et.operation(function(){var Lt=et.lineSeparator()||`
`;et.replaceSelection(Lt+Lt,null),et.execCommand("goCharLeft"),lt=et.listSelections();for(var bt=0;bt<lt.length;bt++){var Gt=lt[bt].head.line;et.indentLine(Gt,null,!0),et.indentLine(Gt+1,null,!0)}})}function Ze(et){var nt=St.cmpPos(et.anchor,et.head)>0;return{anchor:new be(et.anchor.line,et.anchor.ch+(nt?-1:1)),head:new be(et.head.line,et.head.ch+(nt?1:-1))}}function ae(et,nt){var ct=Ie(et);if(!ct||et.getOption("disableInput"))return St.Pass;var lt=Xe(ct,"pairs"),pt=lt.indexOf(nt);if(pt==-1)return St.Pass;for(var vt=Xe(ct,"closeBefore"),Lt=Xe(ct,"triples"),bt=lt.charAt(pt+1)==nt,Gt=et.listSelections(),jt=pt%2==0,ne,ie=0;ie<Gt.length;ie++){var te=Gt[ie],Ge=te.head,pe,Je=et.getRange(Ge,be(Ge.line,Ge.ch+1));if(jt&&!te.empty())pe="surround";else if((bt||!jt)&&Je==nt)bt&&Nt(et,Ge)?pe="both":Lt.indexOf(nt)>=0&&et.getRange(Ge,be(Ge.line,Ge.ch+3))==nt+nt+nt?pe="skipThree":pe="skip";else if(bt&&Ge.ch>1&&Lt.indexOf(nt)>=0&&et.getRange(be(Ge.line,Ge.ch-2),Ge)==nt+nt){if(Ge.ch>2&&/\bstring/.test(et.getTokenTypeAt(be(Ge.line,Ge.ch-2))))return St.Pass;pe="addFour"}else if(bt){var Ye=Ge.ch==0?" ":et.getRange(be(Ge.line,Ge.ch-1),Ge);if(!St.isWordChar(Je)&&Ye!=nt&&!St.isWordChar(Ye))pe="both";else return St.Pass}else if(jt&&(Je.length===0||/\s/.test(Je)||vt.indexOf(Je)>-1))pe="both";else return St.Pass;if(!ne)ne=pe;else if(ne!=pe)return St.Pass}var hn=pt%2?lt.charAt(pt-1):nt,Fn=pt%2?nt:lt.charAt(pt+1);et.operation(function(){if(ne=="skip")et.execCommand("goCharRight");else if(ne=="skipThree")for(var vn=0;vn<3;vn++)et.execCommand("goCharRight");else if(ne=="surround"){for(var pi=et.getSelections(),vn=0;vn<pi.length;vn++)pi[vn]=hn+pi[vn]+Fn;et.replaceSelections(pi,"around"),pi=et.listSelections().slice();for(var vn=0;vn<pi.length;vn++)pi[vn]=Ze(pi[vn]);et.setSelections(pi)}else ne=="both"?(et.replaceSelection(hn+Fn,null),et.triggerElectric(hn+Fn),et.execCommand("goCharLeft")):ne=="addFour"&&(et.replaceSelection(hn+hn+hn+hn,"before"),et.execCommand("goCharRight"))})}function Re(et,nt){var ct=et.getRange(be(nt.line,nt.ch-1),be(nt.line,nt.ch+1));return ct.length==2?ct:null}function Nt(et,nt){var ct=et.getTokenAt(be(nt.line,nt.ch+1));return/\bstring/.test(ct.type)&&ct.start==nt.ch&&(nt.ch==0||!/\bstring/.test(et.getTokenTypeAt(nt)))}})},6313:function(un,Gn,Yt){(function(St){St(Yt(89780),Yt(32855))})(function(St){St.defineOption("autoCloseTags",!1,function(Le,$t,Ze){if(Ze!=St.Init&&Ze&&Le.removeKeyMap("autoCloseTags"),!!$t){var ae={name:"autoCloseTags"};(typeof $t!="object"||$t.whenClosing!==!1)&&(ae["'/'"]=function(Re){return re(Re)}),(typeof $t!="object"||$t.whenOpening!==!1)&&(ae["'>'"]=function(Re){return Xe(Re)}),Le.addKeyMap(ae)}});var fe=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],be=["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 Xe(Le){if(Le.getOption("disableInput"))return St.Pass;for(var $t=Le.listSelections(),Ze=[],ae=Le.getOption("autoCloseTags"),Re=0;Re<$t.length;Re++){if(!$t[Re].empty())return St.Pass;var Nt=$t[Re].head,et=Le.getTokenAt(Nt),nt=St.innerMode(Le.getMode(),et.state),ct=nt.state,lt=nt.mode.xmlCurrentTag&&nt.mode.xmlCurrentTag(ct),pt=lt&&lt.name;if(!pt)return St.Pass;var vt=nt.mode.configuration=="html",Lt=typeof ae=="object"&&ae.dontCloseTags||vt&&fe,bt=typeof ae=="object"&&ae.indentTags||vt&&be;et.end>Nt.ch&&(pt=pt.slice(0,pt.length-et.end+Nt.ch));var Gt=pt.toLowerCase();if(!pt||et.type=="string"&&(et.end!=Nt.ch||!/[\"\']/.test(et.string.charAt(et.string.length-1))||et.string.length==1)||et.type=="tag"&&lt.close||et.string.indexOf("/")==Nt.ch-et.start-1||Lt&&se(Lt,Gt)>-1||Ie(Le,nt.mode.xmlCurrentContext&&nt.mode.xmlCurrentContext(ct)||[],pt,Nt,!0))return St.Pass;var jt=typeof ae=="object"&&ae.emptyTags;if(jt&&se(jt,pt)>-1){Ze[Re]={text:"/>",newPos:St.Pos(Nt.line,Nt.ch+2)};continue}var ne=bt&&se(bt,Gt)>-1;Ze[Re]={indent:ne,text:">"+(ne?`
`:"")+"</"+pt+">",newPos:ne?St.Pos(Nt.line+1,0):St.Pos(Nt.line,Nt.ch+1)}}for(var ie=typeof ae=="object"&&ae.dontIndentOnAutoClose,Re=$t.length-1;Re>=0;Re--){var te=Ze[Re];Le.replaceRange(te.text,$t[Re].head,$t[Re].anchor,"+insert");var Ge=Le.listSelections().slice(0);Ge[Re]={head:te.newPos,anchor:te.newPos},Le.setSelections(Ge),!ie&&te.indent&&(Le.indentLine(te.newPos.line,null,!0),Le.indentLine(te.newPos.line+1,null,!0))}}function ge(Le,$t){for(var Ze=Le.listSelections(),ae=[],Re=$t?"/":"</",Nt=Le.getOption("autoCloseTags"),et=typeof Nt=="object"&&Nt.dontIndentOnSlash,nt=0;nt<Ze.length;nt++){if(!Ze[nt].empty())return St.Pass;var ct=Ze[nt].head,lt=Le.getTokenAt(ct),pt=St.innerMode(Le.getMode(),lt.state),vt=pt.state;if($t&&(lt.type=="string"||lt.string.charAt(0)!="<"||lt.start!=ct.ch-1))return St.Pass;var Lt,bt=pt.mode.name!="xml"&&Le.getMode().name=="htmlmixed";if(bt&&pt.mode.name=="javascript")Lt=Re+"script";else if(bt&&pt.mode.name=="css")Lt=Re+"style";else{var Gt=pt.mode.xmlCurrentContext&&pt.mode.xmlCurrentContext(vt);if(!Gt||Gt.length&&Ie(Le,Gt,Gt[Gt.length-1],ct))return St.Pass;Lt=Re+Gt[Gt.length-1]}Le.getLine(ct.line).charAt(lt.end)!=">"&&(Lt+=">"),ae[nt]=Lt}if(Le.replaceSelections(ae),Ze=Le.listSelections(),!et)for(var nt=0;nt<Ze.length;nt++)(nt==Ze.length-1||Ze[nt].head.line<Ze[nt+1].head.line)&&Le.indentLine(Ze[nt].head.line)}function re(Le){return Le.getOption("disableInput")?St.Pass:ge(Le,!0)}St.commands.closeTag=function(Le){return ge(Le)};function se(Le,$t){if(Le.indexOf)return Le.indexOf($t);for(var Ze=0,ae=Le.length;Ze<ae;++Ze)if(Le[Ze]==$t)return Ze;return-1}function Ie(Le,$t,Ze,ae,Re){if(!St.scanForClosingTag)return!1;var Nt=Math.min(Le.lastLine()+1,ae.line+500),et=St.scanForClosingTag(Le,ae,null,Nt);if(!et||et.tag!=Ze)return!1;for(var nt=Re?1:0,ct=$t.length-1;ct>=0&&$t[ct]==Ze;ct--)++nt;ae=et.to;for(var ct=1;ct<nt;ct++){var lt=St.scanForClosingTag(Le,ae,null,Nt);if(!lt||lt.tag!=Ze)return!1;ae=lt.to}return!0}})},32855:function(un,Gn,Yt){(function(St){St(Yt(89780))})(function(St){"use strict";var fe=St.Pos;function be(ct,lt){return ct.line-lt.line||ct.ch-lt.ch}var Xe="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",ge=Xe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",re=new RegExp("<(/?)(["+Xe+"]["+ge+"]*)","g");function se(ct,lt,pt,vt){this.line=lt,this.ch=pt,this.cm=ct,this.text=ct.getLine(lt),this.min=vt?Math.max(vt.from,ct.firstLine()):ct.firstLine(),this.max=vt?Math.min(vt.to-1,ct.lastLine()):ct.lastLine()}function Ie(ct,lt){var pt=ct.cm.getTokenTypeAt(fe(ct.line,lt));return pt&&/\btag\b/.test(pt)}function Le(ct){if(!(ct.line>=ct.max))return ct.ch=0,ct.text=ct.cm.getLine(++ct.line),!0}function $t(ct){if(!(ct.line<=ct.min))return ct.text=ct.cm.getLine(--ct.line),ct.ch=ct.text.length,!0}function Ze(ct){for(;;){var lt=ct.text.indexOf(">",ct.ch);if(lt==-1){if(Le(ct))continue;return}if(!Ie(ct,lt+1)){ct.ch=lt+1;continue}var pt=ct.text.lastIndexOf("/",lt),vt=pt>-1&&!/\S/.test(ct.text.slice(pt+1,lt));return ct.ch=lt+1,vt?"selfClose":"regular"}}function ae(ct){for(;;){var lt=ct.ch?ct.text.lastIndexOf("<",ct.ch-1):-1;if(lt==-1){if($t(ct))continue;return}if(!Ie(ct,lt+1)){ct.ch=lt;continue}re.lastIndex=lt,ct.ch=lt;var pt=re.exec(ct.text);if(pt&&pt.index==lt)return pt}}function Re(ct){for(;;){re.lastIndex=ct.ch;var lt=re.exec(ct.text);if(!lt){if(Le(ct))continue;return}if(!Ie(ct,lt.index+1)){ct.ch=lt.index+1;continue}return ct.ch=lt.index+lt[0].length,lt}}function Nt(ct){for(;;){var lt=ct.ch?ct.text.lastIndexOf(">",ct.ch-1):-1;if(lt==-1){if($t(ct))continue;return}if(!Ie(ct,lt+1)){ct.ch=lt;continue}var pt=ct.text.lastIndexOf("/",lt),vt=pt>-1&&!/\S/.test(ct.text.slice(pt+1,lt));return ct.ch=lt+1,vt?"selfClose":"regular"}}function et(ct,lt){for(var pt=[];;){var vt=Re(ct),Lt,bt=ct.line,Gt=ct.ch-(vt?vt[0].length:0);if(!vt||!(Lt=Ze(ct)))return;if(Lt!="selfClose")if(vt[1]){for(var jt=pt.length-1;jt>=0;--jt)if(pt[jt]==vt[2]){pt.length=jt;break}if(jt<0&&(!lt||lt==vt[2]))return{tag:vt[2],from:fe(bt,Gt),to:fe(ct.line,ct.ch)}}else pt.push(vt[2])}}function nt(ct,lt){for(var pt=[];;){var vt=Nt(ct);if(!vt)return;if(vt=="selfClose"){ae(ct);continue}var Lt=ct.line,bt=ct.ch,Gt=ae(ct);if(!Gt)return;if(Gt[1])pt.push(Gt[2]);else{for(var jt=pt.length-1;jt>=0;--jt)if(pt[jt]==Gt[2]){pt.length=jt;break}if(jt<0&&(!lt||lt==Gt[2]))return{tag:Gt[2],from:fe(ct.line,ct.ch),to:fe(Lt,bt)}}}}St.registerHelper("fold","xml",function(ct,lt){for(var pt=new se(ct,lt.line,0);;){var vt=Re(pt);if(!vt||pt.line!=lt.line)return;var Lt=Ze(pt);if(!Lt)return;if(!vt[1]&&Lt!="selfClose"){var bt=fe(pt.line,pt.ch),Gt=et(pt,vt[2]);return Gt&&be(Gt.from,bt)>0?{from:bt,to:Gt.from}:null}}}),St.findMatchingTag=function(ct,lt,pt){var vt=new se(ct,lt.line,lt.ch,pt);if(!(vt.text.indexOf(">")==-1&&vt.text.indexOf("<")==-1)){var Lt=Ze(vt),bt=Lt&&fe(vt.line,vt.ch),Gt=Lt&&ae(vt);if(!(!Lt||!Gt||be(vt,lt)>0)){var jt={from:fe(vt.line,vt.ch),to:bt,tag:Gt[2]};return Lt=="selfClose"?{open:jt,close:null,at:"open"}:Gt[1]?{open:nt(vt,Gt[2]),close:jt,at:"close"}:(vt=new se(ct,bt.line,bt.ch,pt),{open:jt,close:et(vt,Gt[2]),at:"open"})}}},St.findEnclosingTag=function(ct,lt,pt,vt){for(var Lt=new se(ct,lt.line,lt.ch,pt);;){var bt=nt(Lt,vt);if(!bt)break;var Gt=new se(ct,lt.line,lt.ch,pt),jt=et(Gt,bt.tag);if(jt)return{open:bt,close:jt}}},St.scanForClosingTag=function(ct,lt,pt,vt){var Lt=new se(ct,lt.line,lt.ch,vt?{from:0,to:vt}:null);return et(Lt,pt)}})},89780:function(un){(function(Gn,Yt){un.exports=Yt()})(this,function(){"use strict";var Gn=navigator.userAgent,Yt=navigator.platform,St=/gecko\/\d/i.test(Gn),fe=/MSIE \d/.test(Gn),be=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Gn),Xe=/Edge\/(\d+)/.exec(Gn),ge=fe||be||Xe,re=ge&&(fe?document.documentMode||6:+(Xe||be)[1]),se=!Xe&&/WebKit\//.test(Gn),Ie=se&&/Qt\/\d+\.\d+/.test(Gn),Le=!Xe&&/Chrome\//.test(Gn),$t=/Opera\//.test(Gn),Ze=/Apple Computer/.test(navigator.vendor),ae=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Gn),Re=/PhantomJS/.test(Gn),Nt=!Xe&&/AppleWebKit/.test(Gn)&&/Mobile\/\w+/.test(Gn),et=/Android/.test(Gn),nt=Nt||et||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Gn),ct=Nt||/Mac/.test(Yt),lt=/\bCrOS\b/.test(Gn),pt=/win/i.test(Yt),vt=$t&&Gn.match(/Version\/(\d*\.\d*)/);vt&&(vt=Number(vt[1])),vt&&vt>=15&&($t=!1,se=!0);var Lt=ct&&(Ie||$t&&(vt==null||vt<12.11)),bt=St||ge&&re>=9;function Gt(it){return new RegExp("(^|\\s)"+it+"(?:$|\\s)\\s*")}var jt=function(it,st){var dt=it.className,ht=Gt(st).exec(dt);if(ht){var gt=dt.slice(ht.index+ht[0].length);it.className=dt.slice(0,ht.index)+(gt?ht[1]+gt:"")}};function ne(it){for(var st=it.childNodes.length;st>0;--st)it.removeChild(it.firstChild);return it}function ie(it,st){return ne(it).appendChild(st)}function te(it,st,dt,ht){var gt=document.createElement(it);if(dt&&(gt.className=dt),ht&&(gt.style.cssText=ht),typeof st=="string")gt.appendChild(document.createTextNode(st));else if(st)for(var Pt=0;Pt<st.length;++Pt)gt.appendChild(st[Pt]);return gt}function Ge(it,st,dt,ht){var gt=te(it,st,dt,ht);return gt.setAttribute("role","presentation"),gt}var pe;document.createRange?pe=function(it,st,dt,ht){var gt=document.createRange();return gt.setEnd(ht||it,dt),gt.setStart(it,st),gt}:pe=function(it,st,dt){var ht=document.body.createTextRange();try{ht.moveToElementText(it.parentNode)}catch(gt){return ht}return ht.collapse(!0),ht.moveEnd("character",dt),ht.moveStart("character",st),ht};function Je(it,st){if(st.nodeType==3&&(st=st.parentNode),it.contains)return it.contains(st);do if(st.nodeType==11&&(st=st.host),st==it)return!0;while(st=st.parentNode)}function Ye(){var it;try{it=document.activeElement}catch(st){it=document.body||null}for(;it&&it.shadowRoot&&it.shadowRoot.activeElement;)it=it.shadowRoot.activeElement;return it}function hn(it,st){var dt=it.className;Gt(st).test(dt)||(it.className+=(dt?" ":"")+st)}function Fn(it,st){for(var dt=it.split(" "),ht=0;ht<dt.length;ht++)dt[ht]&&!Gt(dt[ht]).test(st)&&(st+=" "+dt[ht]);return st}var vn=function(it){it.select()};Nt?vn=function(it){it.selectionStart=0,it.selectionEnd=it.value.length}:ge&&(vn=function(it){try{it.select()}catch(st){}});function pi(it){var st=Array.prototype.slice.call(arguments,1);return function(){return it.apply(null,st)}}function yn(it,st,dt){st||(st={});for(var ht in it)it.hasOwnProperty(ht)&&(dt!==!1||!st.hasOwnProperty(ht))&&(st[ht]=it[ht]);return st}function ce(it,st,dt,ht,gt){st==null&&(st=it.search(/[^\s\u00a0]/),st==-1&&(st=it.length));for(var Pt=ht||0,Ft=gt||0;;){var Rt=it.indexOf(" ",Pt);if(Rt<0||Rt>=st)return Ft+(st-Pt);Ft+=Rt-Pt,Ft+=dt-Ft%dt,Pt=Rt+1}}var Kt=function(){this.id=null,this.f=null,this.time=0,this.handler=pi(this.onTimeout,this)};Kt.prototype.onTimeout=function(it){it.id=0,it.time<=+new Date?it.f():setTimeout(it.handler,it.time-+new Date)},Kt.prototype.set=function(it,st){this.f=st;var dt=+new Date+it;(!this.id||dt<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,it),this.time=dt)};function tn(it,st){for(var dt=0;dt<it.length;++dt)if(it[dt]==st)return dt;return-1}var Yn=50,Dn={toString:function(){return"CodeMirror.Pass"}},je={scroll:!1},gn={origin:"*mouse"},Tn={origin:"+move"};function Jn(it,st,dt){for(var ht=0,gt=0;;){var Pt=it.indexOf(" ",ht);Pt==-1&&(Pt=it.length);var Ft=Pt-ht;if(Pt==it.length||gt+Ft>=st)return ht+Math.min(Ft,st-gt);if(gt+=Pt-ht,gt+=dt-gt%dt,ht=Pt+1,gt>=st)return ht}}var Pn=[""];function Qn(it){for(;Pn.length<=it;)Pn.push(ee(Pn)+" ");return Pn[it]}function ee(it){return it[it.length-1]}function jn(it,st){for(var dt=[],ht=0;ht<it.length;ht++)dt[ht]=st(it[ht],ht);return dt}function hi(it,st,dt){for(var ht=0,gt=dt(st);ht<it.length&&dt(it[ht])<=gt;)ht++;it.splice(ht,0,st)}function Dt(){}function kt(it,st){var dt;return Object.create?dt=Object.create(it):(Dt.prototype=it,dt=new Dt),st&&yn(st,dt),dt}var wt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function At(it){return/\w/.test(it)||it>"\x80"&&(it.toUpperCase()!=it.toLowerCase()||wt.test(it))}function _t(it,st){return st?st.source.indexOf("\\w")>-1&&At(it)?!0:st.test(it):At(it)}function Et(it){for(var st in it)if(it.hasOwnProperty(st)&&it[st])return!1;return!0}var Pe=/[\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 Ee(it){return it.charCodeAt(0)>=768&&Pe.test(it)}function sn(it,st,dt){for(;(dt<0?st>0:st<it.length)&&Ee(it.charAt(st));)st+=dt;return st}function He(it,st,dt){for(var ht=st>dt?-1:1;;){if(st==dt)return st;var gt=(st+dt)/2,Pt=ht<0?Math.ceil(gt):Math.floor(gt);if(Pt==st)return it(Pt)?st:dt;it(Pt)?dt=Pt:st=Pt+ht}}function Ae(it,st,dt,ht){if(!it)return ht(st,dt,"ltr",0);for(var gt=!1,Pt=0;Pt<it.length;++Pt){var Ft=it[Pt];(Ft.from<dt&&Ft.to>st||st==dt&&Ft.to==st)&&(ht(Math.max(Ft.from,st),Math.min(Ft.to,dt),Ft.level==1?"rtl":"ltr",Pt),gt=!0)}gt||ht(st,dt,"ltr")}var qe=null;function en(it,st,dt){var ht;qe=null;for(var gt=0;gt<it.length;++gt){var Pt=it[gt];if(Pt.from<st&&Pt.to>st)return gt;Pt.to==st&&(Pt.from!=Pt.to&&dt=="before"?ht=gt:qe=gt),Pt.from==st&&(Pt.from!=Pt.to&&dt!="before"?ht=gt:qe=gt)}return ht!=null?ht:qe}var dn=function(){var it="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",st="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function dt(Ut){return Ut<=247?it.charAt(Ut):1424<=Ut&&Ut<=1524?"R":1536<=Ut&&Ut<=1785?st.charAt(Ut-1536):1774<=Ut&&Ut<=2220?"r":8192<=Ut&&Ut<=8203?"w":Ut==8204?"b":"L"}var ht=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,gt=/[stwN]/,Pt=/[LRr]/,Ft=/[Lb1n]/,Rt=/[1n]/;function Ot(Ut,xe,Jt){this.level=Ut,this.from=xe,this.to=Jt}return function(Ut,xe){var Jt=xe=="ltr"?"L":"R";if(Ut.length==0||xe=="ltr"&&!ht.test(Ut))return!1;for(var _e=Ut.length,Oe=[],wn=0;wn<_e;++wn)Oe.push(dt(Ut.charCodeAt(wn)));for(var Nn=0,Wn=Jt;Nn<_e;++Nn){var ui=Oe[Nn];ui=="m"?Oe[Nn]=Wn:Wn=ui}for(var Mi=0,xi=Jt;Mi<_e;++Mi){var Ti=Oe[Mi];Ti=="1"&&xi=="r"?Oe[Mi]="n":Pt.test(Ti)&&(xi=Ti,Ti=="r"&&(Oe[Mi]="R"))}for(var eo=1,Si=Oe[0];eo<_e-1;++eo){var wo=Oe[eo];wo=="+"&&Si=="1"&&Oe[eo+1]=="1"?Oe[eo]="1":wo==","&&Si==Oe[eo+1]&&(Si=="1"||Si=="n")&&(Oe[eo]=Si),Si=wo}for(var Pr=0;Pr<_e;++Pr){var cs=Oe[Pr];if(cs==",")Oe[Pr]="N";else if(cs=="%"){var Tr=void 0;for(Tr=Pr+1;Tr<_e&&Oe[Tr]=="%";++Tr);for(var ya=Pr&&Oe[Pr-1]=="!"||Tr<_e&&Oe[Tr]=="1"?"1":"N",Ks=Pr;Ks<Tr;++Ks)Oe[Ks]=ya;Pr=Tr-1}}for(var rs=0,ba=Jt;rs<_e;++rs){var zs=Oe[rs];ba=="L"&&zs=="1"?Oe[rs]="L":Pt.test(zs)&&(ba=zs)}for(var ss=0;ss<_e;++ss)if(gt.test(Oe[ss])){var Xo=void 0;for(Xo=ss+1;Xo<_e&&gt.test(Oe[Xo]);++Xo);for(var Rr=(ss?Oe[ss-1]:Jt)=="L",Cs=(Xo<_e?Oe[Xo]:Jt)=="L",Gs=Rr==Cs?Rr?"L":"R":Jt,pl=ss;pl<Xo;++pl)Oe[pl]=Gs;ss=Xo-1}for(var Ar=[],ol,Wr=0;Wr<_e;)if(Ft.test(Oe[Wr])){var vc=Wr;for(++Wr;Wr<_e&&Ft.test(Oe[Wr]);++Wr);Ar.push(new Ot(0,vc,Wr))}else{var Ua=Wr,Fa=Ar.length,Sa=xe=="rtl"?1:0;for(++Wr;Wr<_e&&Oe[Wr]!="L";++Wr);for(var fr=Ua;fr<Wr;)if(Rt.test(Oe[fr])){Ua<fr&&(Ar.splice(Fa,0,new Ot(1,Ua,fr)),Fa+=Sa);var Ls=fr;for(++fr;fr<Wr&&Rt.test(Oe[fr]);++fr);Ar.splice(Fa,0,new Ot(2,Ls,fr)),Fa+=Sa,Ua=fr}else++fr;Ua<Wr&&Ar.splice(Fa,0,new Ot(1,Ua,Wr))}return xe=="ltr"&&(Ar[0].level==1&&(ol=Ut.match(/^\s+/))&&(Ar[0].from=ol[0].length,Ar.unshift(new Ot(0,0,ol[0].length))),ee(Ar).level==1&&(ol=Ut.match(/\s+$/))&&(ee(Ar).to-=ol[0].length,Ar.push(new Ot(0,_e-ol[0].length,_e)))),xe=="rtl"?Ar.reverse():Ar}}();function An(it,st){var dt=it.order;return dt==null&&(dt=it.order=dn(it.text,st)),dt}var _n=[],fn=function(it,st,dt){if(it.addEventListener)it.addEventListener(st,dt,!1);else if(it.attachEvent)it.attachEvent("on"+st,dt);else{var ht=it._handlers||(it._handlers={});ht[st]=(ht[st]||_n).concat(dt)}};function Zi(it,st){return it._handlers&&it._handlers[st]||_n}function Pi(it,st,dt){if(it.removeEventListener)it.removeEventListener(st,dt,!1);else if(it.detachEvent)it.detachEvent("on"+st,dt);else{var ht=it._handlers,gt=ht&&ht[st];if(gt){var Pt=tn(gt,dt);Pt>-1&&(ht[st]=gt.slice(0,Pt).concat(gt.slice(Pt+1)))}}}function zi(it,st){var dt=Zi(it,st);if(dt.length)for(var ht=Array.prototype.slice.call(arguments,2),gt=0;gt<dt.length;++gt)dt[gt].apply(null,ht)}function Hi(it,st,dt){return typeof st=="string"&&(st={type:st,preventDefault:function(){this.defaultPrevented=!0}}),zi(it,dt||st.type,it,st),Yo(st)||st.codemirrorIgnore}function po(it){var st=it._handlers&&it._handlers.cursorActivity;if(st)for(var dt=it.curOp.cursorActivityHandlers||(it.curOp.cursorActivityHandlers=[]),ht=0;ht<st.length;++ht)tn(dt,st[ht])==-1&&dt.push(st[ht])}function oo(it,st){return Zi(it,st).length>0}function Fi(it){it.prototype.on=function(st,dt){fn(this,st,dt)},it.prototype.off=function(st,dt){Pi(this,st,dt)}}function Ki(it){it.preventDefault?it.preventDefault():it.returnValue=!1}function hr(it){it.stopPropagation?it.stopPropagation():it.cancelBubble=!0}function Yo(it){return it.defaultPrevented!=null?it.defaultPrevented:it.returnValue==!1}function Ro(it){Ki(it),hr(it)}function er(it){return it.target||it.srcElement}function $o(it){var st=it.which;return st==null&&(it.button&1?st=1:it.button&2?st=3:it.button&4&&(st=2)),ct&&it.ctrlKey&&st==1&&(st=3),st}var Sr=function(){if(ge&&re<9)return!1;var it=te("div");return"draggable"in it||"dragDrop"in it}(),Br;function nr(it){if(Br==null){var st=te("span","\u200B");ie(it,te("span",[st,document.createTextNode("x")])),it.firstChild.offsetHeight!=0&&(Br=st.offsetWidth<=1&&st.offsetHeight>2&&!(ge&&re<8))}var dt=Br?te("span","\u200B"):te("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return dt.setAttribute("cm-text",""),dt}var zo;function Xi(it){if(zo!=null)return zo;var st=ie(it,document.createTextNode("A\u062EA")),dt=pe(st,0,1).getBoundingClientRect(),ht=pe(st,1,2).getBoundingClientRect();return ne(it),!dt||dt.left==dt.right?!1:zo=ht.right-dt.right<3}var ro=`
b`.split(/\n/).length!=3?function(it){for(var st=0,dt=[],ht=it.length;st<=ht;){var gt=it.indexOf(`
`,st);gt==-1&&(gt=it.length);var Pt=it.slice(st,it.charAt(gt-1)=="\r"?gt-1:gt),Ft=Pt.indexOf("\r");Ft!=-1?(dt.push(Pt.slice(0,Ft)),st+=Ft+1):(dt.push(Pt),st=gt+1)}return dt}:function(it){return it.split(/\r\n?|\n/)},Ct=window.getSelection?function(it){try{return it.selectionStart!=it.selectionEnd}catch(st){return!1}}:function(it){var st;try{st=it.ownerDocument.selection.createRange()}catch(dt){}return!st||st.parentElement()!=it?!1:st.compareEndPoints("StartToEnd",st)!=0},Go=function(){var it=te("div");return"oncopy"in it?!0:(it.setAttribute("oncopy","return;"),typeof it.oncopy=="function")}(),lo=null;function jo(it){if(lo!=null)return lo;var st=ie(it,te("span","x")),dt=st.getBoundingClientRect(),ht=pe(st,0,1).getBoundingClientRect();return lo=Math.abs(dt.left-ht.left)>1}var dr={},br={};function qr(it,st){arguments.length>2&&(st.dependencies=Array.prototype.slice.call(arguments,2)),dr[it]=st}function ii(it,st){br[it]=st}function In(it){if(typeof it=="string"&&br.hasOwnProperty(it))it=br[it];else if(it&&typeof it.name=="string"&&br.hasOwnProperty(it.name)){var st=br[it.name];typeof st=="string"&&(st={name:st}),it=kt(st,it),it.name=st.name}else{if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(it))return In("application/xml");if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(it))return In("application/json")}return typeof it=="string"?{name:it}:it||{name:"null"}}function ve(it,st){st=In(st);var dt=dr[st.name];if(!dt)return ve(it,"text/plain");var ht=dt(it,st);if(he.hasOwnProperty(st.name)){var gt=he[st.name];for(var Pt in gt)gt.hasOwnProperty(Pt)&&(ht.hasOwnProperty(Pt)&&(ht["_"+Pt]=ht[Pt]),ht[Pt]=gt[Pt])}if(ht.name=st.name,st.helperType&&(ht.helperType=st.helperType),st.modeProps)for(var Ft in st.modeProps)ht[Ft]=st.modeProps[Ft];return ht}var he={};function oe(it,st){var dt=he.hasOwnProperty(it)?he[it]:he[it]={};yn(st,dt)}function xn(it,st){if(st===!0)return st;if(it.copyState)return it.copyState(st);var dt={};for(var ht in st){var gt=st[ht];gt instanceof Array&&(gt=gt.concat([])),dt[ht]=gt}return dt}function Cn(it,st){for(var dt;it.innerMode&&(dt=it.innerMode(st),!(!dt||dt.mode==it));)st=dt.state,it=dt.mode;return dt||{mode:it,state:st}}function Zn(it,st,dt){return it.startState?it.startState(st,dt):!0}var Ke=function(it,st,dt){this.pos=this.start=0,this.string=it,this.tabSize=st||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=dt};Ke.prototype.eol=function(){return this.pos>=this.string.length},Ke.prototype.sol=function(){return this.pos==this.lineStart},Ke.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ke.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ke.prototype.eat=function(it){var st=this.string.charAt(this.pos),dt;if(typeof it=="string"?dt=st==it:dt=st&&(it.test?it.test(st):it(st)),dt)return++this.pos,st},Ke.prototype.eatWhile=function(it){for(var st=this.pos;this.eat(it););return this.pos>st},Ke.prototype.eatSpace=function(){for(var it=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>it},Ke.prototype.skipToEnd=function(){this.pos=this.string.length},Ke.prototype.skipTo=function(it){var st=this.string.indexOf(it,this.pos);if(st>-1)return this.pos=st,!0},Ke.prototype.backUp=function(it){this.pos-=it},Ke.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ce(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ce(this.string,this.lineStart,this.tabSize):0)},Ke.prototype.indentation=function(){return ce(this.string,null,this.tabSize)-(this.lineStart?ce(this.string,this.lineStart,this.tabSize):0)},Ke.prototype.match=function(it,st,dt){if(typeof it=="string"){var ht=function(Ft){return dt?Ft.toLowerCase():Ft},gt=this.string.substr(this.pos,it.length);if(ht(gt)==ht(it))return st!==!1&&(this.pos+=it.length),!0}else{var Pt=this.string.slice(this.pos).match(it);return Pt&&Pt.index>0?null:(Pt&&st!==!1&&(this.pos+=Pt[0].length),Pt)}},Ke.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ke.prototype.hideFirstChars=function(it,st){this.lineStart+=it;try{return st()}finally{this.lineStart-=it}},Ke.prototype.lookAhead=function(it){var st=this.lineOracle;return st&&st.lookAhead(it)},Ke.prototype.baseToken=function(){var it=this.lineOracle;return it&&it.baseToken(this.pos)};function pn(it,st){if(st-=it.first,st<0||st>=it.size)throw new Error("There is no line "+(st+it.first)+" in the document.");for(var dt=it;!dt.lines;)for(var ht=0;;++ht){var gt=dt.children[ht],Pt=gt.chunkSize();if(st<Pt){dt=gt;break}st-=Pt}return dt.lines[st]}function me(it,st,dt){var ht=[],gt=st.line;return it.iter(st.line,dt.line+1,function(Pt){var Ft=Pt.text;gt==dt.line&&(Ft=Ft.slice(0,dt.ch)),gt==st.line&&(Ft=Ft.slice(st.ch)),ht.push(Ft),++gt}),ht}function de(it,st,dt){var ht=[];return it.iter(st,dt,function(gt){ht.push(gt.text)}),ht}function Sn(it,st){var dt=st-it.height;if(dt)for(var ht=it;ht;ht=ht.parent)ht.height+=dt}function Wt(it){if(it.parent==null)return null;for(var st=it.parent,dt=tn(st.lines,it),ht=st.parent;ht;st=ht,ht=ht.parent)for(var gt=0;ht.children[gt]!=st;++gt)dt+=ht.children[gt].chunkSize();return dt+st.first}function Ne(it,st){var dt=it.first;t:do{for(var ht=0;ht<it.children.length;++ht){var gt=it.children[ht],Pt=gt.height;if(st<Pt){it=gt;continue t}st-=Pt,dt+=gt.chunkSize()}return dt}while(!it.lines);for(var Ft=0;Ft<it.lines.length;++Ft){var Rt=it.lines[Ft],Ot=Rt.height;if(st<Ot)break;st-=Ot}return dt+Ft}function an(it,st){return st>=it.first&&st<it.first+it.size}function ye(it,st){return String(it.lineNumberFormatter(st+it.firstLineNumber))}function Qt(it,st,dt){if(dt===void 0&&(dt=null),!(this instanceof Qt))return new Qt(it,st,dt);this.line=it,this.ch=st,this.sticky=dt}function Zt(it,st){return it.line-st.line||it.ch-st.ch}function De(it,st){return it.sticky==st.sticky&&Zt(it,st)==0}function Mn(it){return Qt(it.line,it.ch)}function Hn(it,st){return Zt(it,st)<0?st:it}function ln(it,st){return Zt(it,st)<0?it:st}function Be(it,st){return Math.max(it.first,Math.min(st,it.first+it.size-1))}function we(it,st){if(st.line<it.first)return Qt(it.first,0);var dt=it.first+it.size-1;return st.line>dt?Qt(dt,pn(it,dt).text.length):zn(st,pn(it,st.line).text.length)}function zn(it,st){var dt=it.ch;return dt==null||dt>st?Qt(it.line,st):dt<0?Qt(it.line,0):it}function Vn(it,st){for(var dt=[],ht=0;ht<st.length;ht++)dt[ht]=we(it,st[ht]);return dt}var si=function(it,st){this.state=it,this.lookAhead=st},Fe=function(it,st,dt,ht){this.state=st,this.doc=it,this.line=dt,this.maxLookAhead=ht||0,this.baseTokens=null,this.baseTokenPos=1};Fe.prototype.lookAhead=function(it){var st=this.doc.getLine(this.line+it);return st!=null&&it>this.maxLookAhead&&(this.maxLookAhead=it),st},Fe.prototype.baseToken=function(it){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=it;)this.baseTokenPos+=2;var st=this.baseTokens[this.baseTokenPos+1];return{type:st&&st.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-it}},Fe.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Fe.fromSaved=function(it,st,dt){return st instanceof si?new Fe(it,xn(it.mode,st.state),dt,st.lookAhead):new Fe(it,xn(it.mode,st),dt)},Fe.prototype.save=function(it){var st=it!==!1?xn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new si(st,this.maxLookAhead):st};function Yi(it,st,dt,ht){var gt=[it.state.modeGen],Pt={};mi(it,st.text,it.doc.mode,dt,function(Ut,xe){return gt.push(Ut,xe)},Pt,ht);for(var Ft=dt.state,Rt=function(Ut){dt.baseTokens=gt;var xe=it.state.overlays[Ut],Jt=1,_e=0;dt.state=!0,mi(it,st.text,xe.mode,dt,function(Oe,wn){for(var Nn=Jt;_e<Oe;){var Wn=gt[Jt];Wn>Oe&&gt.splice(Jt,1,Oe,gt[Jt+1],Wn),Jt+=2,_e=Math.min(Oe,Wn)}if(wn)if(xe.opaque)gt.splice(Nn,Jt-Nn,Oe,"overlay "+wn),Jt=Nn+2;else for(;Nn<Jt;Nn+=2){var ui=gt[Nn+1];gt[Nn+1]=(ui?ui+" ":"")+"overlay "+wn}},Pt),dt.state=Ft,dt.baseTokens=null,dt.baseTokenPos=1},Ot=0;Ot<it.state.overlays.length;++Ot)Rt(Ot);return{styles:gt,classes:Pt.bgClass||Pt.textClass?Pt:null}}function qn(it,st,dt){if(!st.styles||st.styles[0]!=it.state.modeGen){var ht=Ri(it,Wt(st)),gt=st.text.length>it.options.maxHighlightLength&&xn(it.doc.mode,ht.state),Pt=Yi(it,st,ht);gt&&(ht.state=gt),st.stateAfter=ht.save(!gt),st.styles=Pt.styles,Pt.classes?st.styleClasses=Pt.classes:st.styleClasses&&(st.styleClasses=null),dt===it.doc.highlightFrontier&&(it.doc.modeFrontier=Math.max(it.doc.modeFrontier,++it.doc.highlightFrontier))}return st.styles}function Ri(it,st,dt){var ht=it.doc,gt=it.display;if(!ht.mode.startState)return new Fe(ht,!0,st);var Pt=ai(it,st,dt),Ft=Pt>ht.first&&pn(ht,Pt-1).stateAfter,Rt=Ft?Fe.fromSaved(ht,Ft,Pt):new Fe(ht,Zn(ht.mode),Pt);return ht.iter(Pt,st,function(Ot){Se(it,Ot.text,Rt);var Ut=Rt.line;Ot.stateAfter=Ut==st-1||Ut%5==0||Ut>=gt.viewFrom&&Ut<gt.viewTo?Rt.save():null,Rt.nextLine()}),dt&&(ht.modeFrontier=Rt.line),Rt}function Se(it,st,dt,ht){var gt=it.doc.mode,Pt=new Ke(st,it.options.tabSize,dt);for(Pt.start=Pt.pos=ht||0,st==""&&on(gt,dt.state);!Pt.eol();)bn(gt,Pt,dt.state),Pt.start=Pt.pos}function on(it,st){if(it.blankLine)return it.blankLine(st);if(it.innerMode){var dt=Cn(it,st);if(dt.mode.blankLine)return dt.mode.blankLine(dt.state)}}function bn(it,st,dt,ht){for(var gt=0;gt<10;gt++){ht&&(ht[0]=Cn(it,dt).mode);var Pt=it.token(st,dt);if(st.pos>st.start)return Pt}throw new Error("Mode "+it.name+" failed to advance stream.")}var Rn=function(it,st,dt){this.start=it.start,this.end=it.pos,this.string=it.current(),this.type=st||null,this.state=dt};function Bn(it,st,dt,ht){var gt=it.doc,Pt=gt.mode,Ft;st=we(gt,st);var Rt=pn(gt,st.line),Ot=Ri(it,st.line,dt),Ut=new Ke(Rt.text,it.options.tabSize,Ot),xe;for(ht&&(xe=[]);(ht||Ut.pos<st.ch)&&!Ut.eol();)Ut.start=Ut.pos,Ft=bn(Pt,Ut,Ot.state),ht&&xe.push(new Rn(Ut,Ft,xn(gt.mode,Ot.state)));return ht?xe:new Rn(Ut,Ft,Ot.state)}function Un(it,st){if(it)for(;;){var dt=it.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!dt)break;it=it.slice(0,dt.index)+it.slice(dt.index+dt[0].length);var ht=dt[1]?"bgClass":"textClass";st[ht]==null?st[ht]=dt[2]:new RegExp("(?:^|\\s)"+dt[2]+"(?:$|\\s)").test(st[ht])||(st[ht]+=" "+dt[2])}return it}function mi(it,st,dt,ht,gt,Pt,Ft){var Rt=dt.flattenSpans;Rt==null&&(Rt=it.options.flattenSpans);var Ot=0,Ut=null,xe=new Ke(st,it.options.tabSize,ht),Jt,_e=it.options.addModeClass&&[null];for(st==""&&Un(on(dt,ht.state),Pt);!xe.eol();){if(xe.pos>it.options.maxHighlightLength?(Rt=!1,Ft&&Se(it,st,ht,xe.pos),xe.pos=st.length,Jt=null):Jt=Un(bn(dt,xe,ht.state,_e),Pt),_e){var Oe=_e[0].name;Oe&&(Jt="m-"+(Jt?Oe+" "+Jt:Oe))}if(!Rt||Ut!=Jt){for(;Ot<xe.start;)Ot=Math.min(xe.start,Ot+5e3),gt(Ot,Ut);Ut=Jt}xe.start=xe.pos}for(;Ot<xe.pos;){var wn=Math.min(xe.pos,Ot+5e3);gt(wn,Ut),Ot=wn}}function ai(it,st,dt){for(var ht,gt,Pt=it.doc,Ft=dt?-1:st-(it.doc.mode.innerMode?1e3:100),Rt=st;Rt>Ft;--Rt){if(Rt<=Pt.first)return Pt.first;var Ot=pn(Pt,Rt-1),Ut=Ot.stateAfter;if(Ut&&(!dt||Rt+(Ut instanceof si?Ut.lookAhead:0)<=Pt.modeFrontier))return Rt;var xe=ce(Ot.text,null,it.options.tabSize);(gt==null||ht>xe)&&(gt=Rt-1,ht=xe)}return gt}function ei(it,st){if(it.modeFrontier=Math.min(it.modeFrontier,st),!(it.highlightFrontier<st-10)){for(var dt=it.first,ht=st-1;ht>dt;ht--){var gt=pn(it,ht).stateAfter;if(gt&&(!(gt instanceof si)||ht+gt.lookAhead<st)){dt=ht+1;break}}it.highlightFrontier=Math.min(it.highlightFrontier,dt)}}var di=!1,ke=!1;function Di(){di=!0}function Me(){ke=!0}function En(it,st,dt){this.marker=it,this.from=st,this.to=dt}function $n(it,st){if(it)for(var dt=0;dt<it.length;++dt){var ht=it[dt];if(ht.marker==st)return ht}}function ti(it,st){for(var dt,ht=0;ht<it.length;++ht)it[ht]!=st&&(dt||(dt=[])).push(it[ht]);return dt}function mo(it,st){it.markedSpans=it.markedSpans?it.markedSpans.concat([st]):[st],st.marker.attachLine(it)}function Ji(it,st,dt){var ht;if(it)for(var gt=0;gt<it.length;++gt){var Pt=it[gt],Ft=Pt.marker,Rt=Pt.from==null||(Ft.inclusiveLeft?Pt.from<=st:Pt.from<st);if(Rt||Pt.from==st&&Ft.type=="bookmark"&&(!dt||!Pt.marker.insertLeft)){var Ot=Pt.to==null||(Ft.inclusiveRight?Pt.to>=st:Pt.to>st);(ht||(ht=[])).push(new En(Ft,Pt.from,Ot?null:Pt.to))}}return ht}function wi(it,st,dt){var ht;if(it)for(var gt=0;gt<it.length;++gt){var Pt=it[gt],Ft=Pt.marker,Rt=Pt.to==null||(Ft.inclusiveRight?Pt.to>=st:Pt.to>st);if(Rt||Pt.from==st&&Ft.type=="bookmark"&&(!dt||Pt.marker.insertLeft)){var Ot=Pt.from==null||(Ft.inclusiveLeft?Pt.from<=st:Pt.from<st);(ht||(ht=[])).push(new En(Ft,Ot?null:Pt.from-st,Pt.to==null?null:Pt.to-st))}}return ht}function bi(it,st){if(st.full)return null;var dt=an(it,st.from.line)&&pn(it,st.from.line).markedSpans,ht=an(it,st.to.line)&&pn(it,st.to.line).markedSpans;if(!dt&&!ht)return null;var gt=st.from.ch,Pt=st.to.ch,Ft=Zt(st.from,st.to)==0,Rt=Ji(dt,gt,Ft),Ot=wi(ht,Pt,Ft),Ut=st.text.length==1,xe=ee(st.text).length+(Ut?gt:0);if(Rt)for(var Jt=0;Jt<Rt.length;++Jt){var _e=Rt[Jt];if(_e.to==null){var Oe=$n(Ot,_e.marker);Oe?Ut&&(_e.to=Oe.to==null?null:Oe.to+xe):_e.to=gt}}if(Ot)for(var wn=0;wn<Ot.length;++wn){var Nn=Ot[wn];if(Nn.to!=null&&(Nn.to+=xe),Nn.from==null){var Wn=$n(Rt,Nn.marker);Wn||(Nn.from=xe,Ut&&(Rt||(Rt=[])).push(Nn))}else Nn.from+=xe,Ut&&(Rt||(Rt=[])).push(Nn)}Rt&&(Rt=Vi(Rt)),Ot&&Ot!=Rt&&(Ot=Vi(Ot));var ui=[Rt];if(!Ut){var Mi=st.text.length-2,xi;if(Mi>0&&Rt)for(var Ti=0;Ti<Rt.length;++Ti)Rt[Ti].to==null&&(xi||(xi=[])).push(new En(Rt[Ti].marker,null,null));for(var eo=0;eo<Mi;++eo)ui.push(xi);ui.push(Ot)}return ui}function Vi(it){for(var st=0;st<it.length;++st){var dt=it[st];dt.from!=null&&dt.from==dt.to&&dt.marker.clearWhenEmpty!==!1&&it.splice(st--,1)}return it.length?it:null}function Ci(it,st,dt){var ht=null;if(it.iter(st.line,dt.line+1,function(Oe){if(Oe.markedSpans)for(var wn=0;wn<Oe.markedSpans.length;++wn){var Nn=Oe.markedSpans[wn].marker;Nn.readOnly&&(!ht||tn(ht,Nn)==-1)&&(ht||(ht=[])).push(Nn)}}),!ht)return null;for(var gt=[{from:st,to:dt}],Pt=0;Pt<ht.length;++Pt)for(var Ft=ht[Pt],Rt=Ft.find(0),Ot=0;Ot<gt.length;++Ot){var Ut=gt[Ot];if(!(Zt(Ut.to,Rt.from)<0||Zt(Ut.from,Rt.to)>0)){var xe=[Ot,1],Jt=Zt(Ut.from,Rt.from),_e=Zt(Ut.to,Rt.to);(Jt<0||!Ft.inclusiveLeft&&!Jt)&&xe.push({from:Ut.from,to:Rt.from}),(_e>0||!Ft.inclusiveRight&&!_e)&&xe.push({from:Rt.to,to:Ut.to}),gt.splice.apply(gt,xe),Ot+=xe.length-3}}return gt}function kn(it){var st=it.markedSpans;if(st){for(var dt=0;dt<st.length;++dt)st[dt].marker.detachLine(it);it.markedSpans=null}}function Bt(it,st){if(st){for(var dt=0;dt<st.length;++dt)st[dt].marker.attachLine(it);it.markedSpans=st}}function vo(it){return it.inclusiveLeft?-1:0}function Ui(it){return it.inclusiveRight?1:0}function Wi(it,st){var dt=it.lines.length-st.lines.length;if(dt!=0)return dt;var ht=it.find(),gt=st.find(),Pt=Zt(ht.from,gt.from)||vo(it)-vo(st);if(Pt)return-Pt;var Ft=Zt(ht.to,gt.to)||Ui(it)-Ui(st);return Ft||st.id-it.id}function so(it,st){var dt=ke&&it.markedSpans,ht;if(dt)for(var gt=void 0,Pt=0;Pt<dt.length;++Pt)gt=dt[Pt],gt.marker.collapsed&&(st?gt.from:gt.to)==null&&(!ht||Wi(ht,gt.marker)<0)&&(ht=gt.marker);return ht}function bo(it){return so(it,!0)}function Kn(it){return so(it,!1)}function li(it,st){var dt=ke&&it.markedSpans,ht;if(dt)for(var gt=0;gt<dt.length;++gt){var Pt=dt[gt];Pt.marker.collapsed&&(Pt.from==null||Pt.from<st)&&(Pt.to==null||Pt.to>st)&&(!ht||Wi(ht,Pt.marker)<0)&&(ht=Pt.marker)}return ht}function Ai(it,st,dt,ht,gt){var Pt=pn(it,st),Ft=ke&&Pt.markedSpans;if(Ft)for(var Rt=0;Rt<Ft.length;++Rt){var Ot=Ft[Rt];if(Ot.marker.collapsed){var Ut=Ot.marker.find(0),xe=Zt(Ut.from,dt)||vo(Ot.marker)-vo(gt),Jt=Zt(Ut.to,ht)||Ui(Ot.marker)-Ui(gt);if(!(xe>=0&&Jt<=0||xe<=0&&Jt>=0)&&(xe<=0&&(Ot.marker.inclusiveRight&&gt.inclusiveLeft?Zt(Ut.to,dt)>=0:Zt(Ut.to,dt)>0)||xe>=0&&(Ot.marker.inclusiveRight&&gt.inclusiveLeft?Zt(Ut.from,ht)<=0:Zt(Ut.from,ht)<0)))return!0}}}function ki(it){for(var st;st=bo(it);)it=st.find(-1,!0).line;return it}function Bi(it){for(var st;st=Kn(it);)it=st.find(1,!0).line;return it}function Zo(it){for(var st,dt;st=Kn(it);)it=st.find(1,!0).line,(dt||(dt=[])).push(it);return dt}function vi(it,st){var dt=pn(it,st),ht=ki(dt);return dt==ht?st:Wt(ht)}function fi(it,st){if(st>it.lastLine())return st;var dt=pn(it,st),ht;if(!Qe(it,dt))return st;for(;ht=Kn(dt);)dt=ht.find(1,!0).line;return Wt(dt)+1}function Qe(it,st){var dt=ke&&st.markedSpans;if(dt){for(var ht=void 0,gt=0;gt<dt.length;++gt)if(ht=dt[gt],!!ht.marker.collapsed){if(ht.from==null)return!0;if(!ht.marker.widgetNode&&ht.from==0&&ht.marker.inclusiveLeft&&ni(it,st,ht))return!0}}}function ni(it,st,dt){if(dt.to==null){var ht=dt.marker.find(1,!0);return ni(it,ht.line,$n(ht.line.markedSpans,dt.marker))}if(dt.marker.inclusiveRight&&dt.to==st.text.length)return!0;for(var gt=void 0,Pt=0;Pt<st.markedSpans.length;++Pt)if(gt=st.markedSpans[Pt],gt.marker.collapsed&&!gt.marker.widgetNode&&gt.from==dt.to&&(gt.to==null||gt.to!=dt.from)&&(gt.marker.inclusiveLeft||dt.marker.inclusiveRight)&&ni(it,st,gt))return!0}function no(it){it=ki(it);for(var st=0,dt=it.parent,ht=0;ht<dt.lines.length;++ht){var gt=dt.lines[ht];if(gt==it)break;st+=gt.height}for(var Pt=dt.parent;Pt;dt=Pt,Pt=dt.parent)for(var Ft=0;Ft<Pt.children.length;++Ft){var Rt=Pt.children[Ft];if(Rt==dt)break;st+=Rt.height}return st}function Ho(it){if(it.height==0)return 0;for(var st=it.text.length,dt,ht=it;dt=bo(ht);){var gt=dt.find(0,!0);ht=gt.from.line,st+=gt.from.ch-gt.to.ch}for(ht=it;dt=Kn(ht);){var Pt=dt.find(0,!0);st-=ht.text.length-Pt.from.ch,ht=Pt.to.line,st+=ht.text.length-Pt.to.ch}return st}function _o(it){var st=it.display,dt=it.doc;st.maxLine=pn(dt,dt.first),st.maxLineLength=Ho(st.maxLine),st.maxLineChanged=!0,dt.iter(function(ht){var gt=Ho(ht);gt>st.maxLineLength&&(st.maxLineLength=gt,st.maxLine=ht)})}var ko=function(it,st,dt){this.text=it,Bt(this,st),this.height=dt?dt(this):1};ko.prototype.lineNo=function(){return Wt(this)},Fi(ko);function Ko(it,st,dt,ht){it.text=st,it.stateAfter&&(it.stateAfter=null),it.styles&&(it.styles=null),it.order!=null&&(it.order=null),kn(it),Bt(it,dt);var gt=ht?ht(it):1;gt!=it.height&&Sn(it,gt)}function Fo(it){it.parent=null,kn(it)}var zr={},Dr={};function ms(it,st){if(!it||/^\s*$/.test(it))return null;var dt=st.addModeClass?Dr:zr;return dt[it]||(dt[it]=it.replace(/\S+/g,"cm-$&"))}function Ce(it,st){var dt=Ge("span",null,null,se?"padding-right: .1px":null),ht={pre:Ge("pre",[dt],"CodeMirror-line"),content:dt,col:0,pos:0,cm:it,trailingSpace:!1,splitSpaces:it.getOption("lineWrapping")};st.measure={};for(var gt=0;gt<=(st.rest?st.rest.length:0);gt++){var Pt=gt?st.rest[gt-1]:st.line,Ft=void 0;ht.pos=0,ht.addToken=kl,Xi(it.display.measure)&&(Ft=An(Pt,it.doc.direction))&&(ht.addToken=ca(ht.addToken,Ft)),ht.map=[];var Rt=st!=it.display.externalMeasured&&Wt(Pt);Ml(Pt,ht,qn(it,Pt,Rt)),Pt.styleClasses&&(Pt.styleClasses.bgClass&&(ht.bgClass=Fn(Pt.styleClasses.bgClass,ht.bgClass||"")),Pt.styleClasses.textClass&&(ht.textClass=Fn(Pt.styleClasses.textClass,ht.textClass||""))),ht.map.length==0&&ht.map.push(0,0,ht.content.appendChild(nr(it.display.measure))),gt==0?(st.measure.map=ht.map,st.measure.cache={}):((st.measure.maps||(st.measure.maps=[])).push(ht.map),(st.measure.caches||(st.measure.caches=[])).push({}))}if(se){var Ot=ht.content.lastChild;(/\bcm-tab\b/.test(Ot.className)||Ot.querySelector&&Ot.querySelector(".cm-tab"))&&(ht.content.className="cm-tab-wrap-hack")}return zi(it,"renderLine",it,st.line,ht.pre),ht.pre.className&&(ht.textClass=Fn(ht.pre.className,ht.textClass||"")),ht}function To(it){var st=te("span","\u2022","cm-invalidchar");return st.title="\\u"+it.charCodeAt(0).toString(16),st.setAttribute("aria-label",st.title),st}function kl(it,st,dt,ht,gt,Pt,Ft){if(st){var Rt=it.splitSpaces?Gr(st,it.trailingSpace):st,Ot=it.cm.state.specialChars,Ut=!1,xe;if(!Ot.test(st))it.col+=st.length,xe=document.createTextNode(Rt),it.map.push(it.pos,it.pos+st.length,xe),ge&&re<9&&(Ut=!0),it.pos+=st.length;else{xe=document.createDocumentFragment();for(var Jt=0;;){Ot.lastIndex=Jt;var _e=Ot.exec(st),Oe=_e?_e.index-Jt:st.length-Jt;if(Oe){var wn=document.createTextNode(Rt.slice(Jt,Jt+Oe));ge&&re<9?xe.appendChild(te("span",[wn])):xe.appendChild(wn),it.map.push(it.pos,it.pos+Oe,wn),it.col+=Oe,it.pos+=Oe}if(!_e)break;Jt+=Oe+1;var Nn=void 0;if(_e[0]==" "){var Wn=it.cm.options.tabSize,ui=Wn-it.col%Wn;Nn=xe.appendChild(te("span",Qn(ui),"cm-tab")),Nn.setAttribute("role","presentation"),Nn.setAttribute("cm-text"," "),it.col+=ui}else _e[0]=="\r"||_e[0]==`
`?(Nn=xe.appendChild(te("span",_e[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Nn.setAttribute("cm-text",_e[0]),it.col+=1):(Nn=it.cm.options.specialCharPlaceholder(_e[0]),Nn.setAttribute("cm-text",_e[0]),ge&&re<9?xe.appendChild(te("span",[Nn])):xe.appendChild(Nn),it.col+=1);it.map.push(it.pos,it.pos+1,Nn),it.pos++}}if(it.trailingSpace=Rt.charCodeAt(st.length-1)==32,dt||ht||gt||Ut||Pt||Ft){var Mi=dt||"";ht&&(Mi+=ht),gt&&(Mi+=gt);var xi=te("span",[xe],Mi,Pt);if(Ft)for(var Ti in Ft)Ft.hasOwnProperty(Ti)&&Ti!="style"&&Ti!="class"&&xi.setAttribute(Ti,Ft[Ti]);return it.content.appendChild(xi)}it.content.appendChild(xe)}}function Gr(it,st){if(it.length>1&&!/ /.test(it))return it;for(var dt=st,ht="",gt=0;gt<it.length;gt++){var Pt=it.charAt(gt);Pt==" "&&dt&&(gt==it.length-1||it.charCodeAt(gt+1)==32)&&(Pt="\xA0"),ht+=Pt,dt=Pt==" "}return ht}function ca(it,st){return function(dt,ht,gt,Pt,Ft,Rt,Ot){gt=gt?gt+" cm-force-border":"cm-force-border";for(var Ut=dt.pos,xe=Ut+ht.length;;){for(var Jt=void 0,_e=0;_e<st.length&&(Jt=st[_e],!(Jt.to>Ut&&Jt.from<=Ut));_e++);if(Jt.to>=xe)return it(dt,ht,gt,Pt,Ft,Rt,Ot);it(dt,ht.slice(0,Jt.to-Ut),gt,Pt,null,Rt,Ot),Pt=null,ht=ht.slice(Jt.to-Ut),Ut=Jt.to}}}function Po(it,st,dt,ht){var gt=!ht&&dt.widgetNode;gt&&it.map.push(it.pos,it.pos+st,gt),!ht&&it.cm.display.input.needsContentAttribute&&(gt||(gt=it.content.appendChild(document.createElement("span"))),gt.setAttribute("cm-marker",dt.id)),gt&&(it.cm.display.input.setUneditable(gt),it.content.appendChild(gt)),it.pos+=st,it.trailingSpace=!1}function Ml(it,st,dt){var ht=it.markedSpans,gt=it.text,Pt=0;if(!ht){for(var Ft=1;Ft<dt.length;Ft+=2)st.addToken(st,gt.slice(Pt,Pt=dt[Ft]),ms(dt[Ft+1],st.cm.options));return}for(var Rt=gt.length,Ot=0,Ut=1,xe="",Jt,_e,Oe=0,wn,Nn,Wn,ui,Mi;;){if(Oe==Ot){wn=Nn=Wn=_e="",Mi=null,ui=null,Oe=1/0;for(var xi=[],Ti=void 0,eo=0;eo<ht.length;++eo){var Si=ht[eo],wo=Si.marker;if(wo.type=="bookmark"&&Si.from==Ot&&wo.widgetNode)xi.push(wo);else if(Si.from<=Ot&&(Si.to==null||Si.to>Ot||wo.collapsed&&Si.to==Ot&&Si.from==Ot)){if(Si.to!=null&&Si.to!=Ot&&Oe>Si.to&&(Oe=Si.to,Nn=""),wo.className&&(wn+=" "+wo.className),wo.css&&(_e=(_e?_e+";":"")+wo.css),wo.startStyle&&Si.from==Ot&&(Wn+=" "+wo.startStyle),wo.endStyle&&Si.to==Oe&&(Ti||(Ti=[])).push(wo.endStyle,Si.to),wo.title&&((Mi||(Mi={})).title=wo.title),wo.attributes)for(var Pr in wo.attributes)(Mi||(Mi={}))[Pr]=wo.attributes[Pr];wo.collapsed&&(!ui||Wi(ui.marker,wo)<0)&&(ui=Si)}else Si.from>Ot&&Oe>Si.from&&(Oe=Si.from)}if(Ti)for(var cs=0;cs<Ti.length;cs+=2)Ti[cs+1]==Oe&&(Nn+=" "+Ti[cs]);if(!ui||ui.from==Ot)for(var Tr=0;Tr<xi.length;++Tr)Po(st,0,xi[Tr]);if(ui&&(ui.from||0)==Ot){if(Po(st,(ui.to==null?Rt+1:ui.to)-Ot,ui.marker,ui.from==null),ui.to==null)return;ui.to==Ot&&(ui=!1)}}if(Ot>=Rt)break;for(var ya=Math.min(Rt,Oe);;){if(xe){var Ks=Ot+xe.length;if(!ui){var rs=Ks>ya?xe.slice(0,ya-Ot):xe;st.addToken(st,rs,Jt?Jt+wn:wn,Wn,Ot+rs.length==Oe?Nn:"",_e,Mi)}if(Ks>=ya){xe=xe.slice(ya-Ot),Ot=ya;break}Ot=Ks,Wn=""}xe=gt.slice(Pt,Pt=dt[Ut++]),Jt=ms(dt[Ut++],st.cm.options)}}}function fl(it,st,dt){this.line=st,this.rest=Zo(st),this.size=this.rest?Wt(ee(this.rest))-dt+1:1,this.node=this.text=null,this.hidden=Qe(it,st)}function Wo(it,st,dt){for(var ht=[],gt,Pt=st;Pt<dt;Pt=gt){var Ft=new fl(it.doc,pn(it.doc,Pt),Pt);gt=Pt+Ft.size,ht.push(Ft)}return ht}var Or=null;function ta(it){Or?Or.ops.push(it):it.ownsGroup=Or={ops:[it],delayedCallbacks:[]}}function is(it){var st=it.delayedCallbacks,dt=0;do{for(;dt<st.length;dt++)st[dt].call(null);for(var ht=0;ht<it.ops.length;ht++){var gt=it.ops[ht];if(gt.cursorActivityHandlers)for(;gt.cursorActivityCalled<gt.cursorActivityHandlers.length;)gt.cursorActivityHandlers[gt.cursorActivityCalled++].call(null,gt.cm)}}while(dt<st.length)}function Ra(it,st){var dt=it.ownsGroup;if(dt)try{is(dt)}finally{Or=null,st(dt)}}var Ys=null;function yi(it,st){var dt=Zi(it,st);if(dt.length){var ht=Array.prototype.slice.call(arguments,2),gt;Or?gt=Or.delayedCallbacks:Ys?gt=Ys:(gt=Ys=[],setTimeout(yo,0));for(var Pt=function(Rt){gt.push(function(){return dt[Rt].apply(null,ht)})},Ft=0;Ft<dt.length;++Ft)Pt(Ft)}}function yo(){var it=Ys;Ys=null;for(var st=0;st<it.length;++st)it[st]()}function vs(it,st,dt,ht){for(var gt=0;gt<st.changes.length;gt++){var Pt=st.changes[gt];Pt=="text"?rn(it,st):Pt=="gutter"?io(it,st,dt,ht):Pt=="class"?Ni(it,st):Pt=="widget"&&Jo(it,st,ht)}st.changes=null}function Vr(it){return it.node==it.text&&(it.node=te("div",null,null,"position: relative"),it.text.parentNode&&it.text.parentNode.replaceChild(it.node,it.text),it.node.appendChild(it.text),ge&&re<8&&(it.node.style.zIndex=2)),it.node}function to(it,st){var dt=st.bgClass?st.bgClass+" "+(st.line.bgClass||""):st.line.bgClass;if(dt&&(dt+=" CodeMirror-linebackground"),st.background)dt?st.background.className=dt:(st.background.parentNode.removeChild(st.background),st.background=null);else if(dt){var ht=Vr(st);st.background=ht.insertBefore(te("div",null,dt),ht.firstChild),it.display.input.setUneditable(st.background)}}function co(it,st){var dt=it.display.externalMeasured;return dt&&dt.line==st.line?(it.display.externalMeasured=null,st.measure=dt.measure,dt.built):Ce(it,st)}function rn(it,st){var dt=st.text.className,ht=co(it,st);st.text==st.node&&(st.node=ht.pre),st.text.parentNode.replaceChild(ht.pre,st.text),st.text=ht.pre,ht.bgClass!=st.bgClass||ht.textClass!=st.textClass?(st.bgClass=ht.bgClass,st.textClass=ht.textClass,Ni(it,st)):dt&&(st.text.className=dt)}function Ni(it,st){to(it,st),st.line.wrapClass?Vr(st).className=st.line.wrapClass:st.node!=st.text&&(st.node.className="");var dt=st.textClass?st.textClass+" "+(st.line.textClass||""):st.line.textClass;st.text.className=dt||""}function io(it,st,dt,ht){if(st.gutter&&(st.node.removeChild(st.gutter),st.gutter=null),st.gutterBackground&&(st.node.removeChild(st.gutterBackground),st.gutterBackground=null),st.line.gutterClass){var gt=Vr(st);st.gutterBackground=te("div",null,"CodeMirror-gutter-background "+st.line.gutterClass,"left: "+(it.options.fixedGutter?ht.fixedPos:-ht.gutterTotalWidth)+"px; width: "+ht.gutterTotalWidth+"px"),it.display.input.setUneditable(st.gutterBackground),gt.insertBefore(st.gutterBackground,st.text)}var Pt=st.line.gutterMarkers;if(it.options.lineNumbers||Pt){var Ft=Vr(st),Rt=st.gutter=te("div",null,"CodeMirror-gutter-wrapper","left: "+(it.options.fixedGutter?ht.fixedPos:-ht.gutterTotalWidth)+"px");if(it.display.input.setUneditable(Rt),Ft.insertBefore(Rt,st.text),st.line.gutterClass&&(Rt.className+=" "+st.line.gutterClass),it.options.lineNumbers&&(!Pt||!Pt["CodeMirror-linenumbers"])&&(st.lineNumber=Rt.appendChild(te("div",ye(it.options,dt),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+ht.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+it.display.lineNumInnerWidth+"px"))),Pt)for(var Ot=0;Ot<it.display.gutterSpecs.length;++Ot){var Ut=it.display.gutterSpecs[Ot].className,xe=Pt.hasOwnProperty(Ut)&&Pt[Ut];xe&&Rt.appendChild(te("div",[xe],"CodeMirror-gutter-elt","left: "+ht.gutterLeft[Ut]+"px; width: "+ht.gutterWidth[Ut]+"px"))}}}function Jo(it,st,dt){st.alignable&&(st.alignable=null);for(var ht=Gt("CodeMirror-linewidget"),gt=st.node.firstChild,Pt=void 0;gt;gt=Pt)Pt=gt.nextSibling,ht.test(gt.className)&&st.node.removeChild(gt);ea(it,st,dt)}function fa(it,st,dt,ht){var gt=co(it,st);return st.text=st.node=gt.pre,gt.bgClass&&(st.bgClass=gt.bgClass),gt.textClass&&(st.textClass=gt.textClass),Ni(it,st),io(it,st,dt,ht),ea(it,st,ht),st.node}function ea(it,st,dt){if(ji(it,st.line,st,dt,!0),st.rest)for(var ht=0;ht<st.rest.length;ht++)ji(it,st.rest[ht],st,dt,!1)}function ji(it,st,dt,ht,gt){if(st.widgets)for(var Pt=Vr(dt),Ft=0,Rt=st.widgets;Ft<Rt.length;++Ft){var Ot=Rt[Ft],Ut=te("div",[Ot.node],"CodeMirror-linewidget"+(Ot.className?" "+Ot.className:""));Ot.handleMouseEvents||Ut.setAttribute("cm-ignore-events","true"),$r(Ot,Ut,dt,ht),it.display.input.setUneditable(Ut),gt&&Ot.above?Pt.insertBefore(Ut,dt.gutter||dt.text):Pt.appendChild(Ut),yi(Ot,"redraw")}}function $r(it,st,dt,ht){if(it.noHScroll){(dt.alignable||(dt.alignable=[])).push(st);var gt=ht.wrapperWidth;st.style.left=ht.fixedPos+"px",it.coverGutter||(gt-=ht.gutterTotalWidth,st.style.paddingLeft=ht.gutterTotalWidth+"px"),st.style.width=gt+"px"}it.coverGutter&&(st.style.zIndex=5,st.style.position="relative",it.noHScroll||(st.style.marginLeft=-ht.gutterTotalWidth+"px"))}function Ds(it){if(it.height!=null)return it.height;var st=it.doc.cm;if(!st)return 0;if(!Je(document.body,it.node)){var dt="position: relative;";it.coverGutter&&(dt+="margin-left: -"+st.display.gutters.offsetWidth+"px;"),it.noHScroll&&(dt+="width: "+st.display.wrapper.clientWidth+"px;"),ie(st.display.measure,te("div",[it.node],null,dt))}return it.height=it.node.parentNode.offsetHeight}function ts(it,st){for(var dt=er(st);dt!=it.wrapper;dt=dt.parentNode)if(!dt||dt.nodeType==1&&dt.getAttribute("cm-ignore-events")=="true"||dt.parentNode==it.sizer&&dt!=it.mover)return!0}function Os(it){return it.lineSpace.offsetTop}function El(it){return it.mover.offsetHeight-it.lineSpace.offsetHeight}function $a(it){if(it.cachedPaddingH)return it.cachedPaddingH;var st=ie(it.measure,te("pre","x","CodeMirror-line-like")),dt=window.getComputedStyle?window.getComputedStyle(st):st.currentStyle,ht={left:parseInt(dt.paddingLeft),right:parseInt(dt.paddingRight)};return!isNaN(ht.left)&&!isNaN(ht.right)&&(it.cachedPaddingH=ht),ht}function Hr(it){return Yn-it.display.nativeBarWidth}function ga(it){return it.display.scroller.clientWidth-Hr(it)-it.display.barWidth}function gh(it){return it.display.scroller.clientHeight-Hr(it)-it.display.barHeight}function Yd(it,st,dt){var ht=it.options.lineWrapping,gt=ht&&ga(it);if(!st.measure.heights||ht&&st.measure.width!=gt){var Pt=st.measure.heights=[];if(ht){st.measure.width=gt;for(var Ft=st.text.firstChild.getClientRects(),Rt=0;Rt<Ft.length-1;Rt++){var Ot=Ft[Rt],Ut=Ft[Rt+1];Math.abs(Ot.bottom-Ut.bottom)>2&&Pt.push((Ot.bottom+Ut.top)/2-dt.top)}}Pt.push(dt.bottom-dt.top)}}function bl(it,st,dt){if(it.line==st)return{map:it.measure.map,cache:it.measure.cache};for(var ht=0;ht<it.rest.length;ht++)if(it.rest[ht]==st)return{map:it.measure.maps[ht],cache:it.measure.caches[ht]};for(var gt=0;gt<it.rest.length;gt++)if(Wt(it.rest[gt])>dt)return{map:it.measure.maps[gt],cache:it.measure.caches[gt],before:!0}}function Zd(it,st){st=ki(st);var dt=Wt(st),ht=it.display.externalMeasured=new fl(it.doc,st,dt);ht.lineN=dt;var gt=ht.built=Ce(it,ht);return ht.text=gt.pre,ie(it.display.lineMeasure,gt.pre),ht}function sd(it,st,dt,ht){return ja(it,Gl(it,st),dt,ht)}function ph(it,st){if(st>=it.display.viewFrom&&st<it.display.viewTo)return it.display.view[Ga(it,st)];var dt=it.display.externalMeasured;if(dt&&st>=dt.lineN&&st<dt.lineN+dt.size)return dt}function Gl(it,st){var dt=Wt(st),ht=ph(it,dt);ht&&!ht.text?ht=null:ht&&ht.changes&&(vs(it,ht,dt,Gc(it)),it.curOp.forceUpdate=!0),ht||(ht=Zd(it,st));var gt=bl(ht,st,dt);return{line:st,view:ht,rect:null,map:gt.map,cache:gt.cache,before:gt.before,hasHeights:!1}}function ja(it,st,dt,ht,gt){st.before&&(dt=-1);var Pt=dt+(ht||""),Ft;return st.cache.hasOwnProperty(Pt)?Ft=st.cache[Pt]:(st.rect||(st.rect=st.view.text.getBoundingClientRect()),st.hasHeights||(Yd(it,st.view,st.rect),st.hasHeights=!0),Ft=Fr(it,st,dt,ht),Ft.bogus||(st.cache[Pt]=Ft)),{left:Ft.left,right:Ft.right,top:gt?Ft.rtop:Ft.top,bottom:gt?Ft.rbottom:Ft.bottom}}var mh={left:0,right:0,top:0,bottom:0};function ad(it,st,dt){for(var ht,gt,Pt,Ft,Rt,Ot,Ut=0;Ut<it.length;Ut+=3)if(Rt=it[Ut],Ot=it[Ut+1],st<Rt?(gt=0,Pt=1,Ft="left"):st<Ot?(gt=st-Rt,Pt=gt+1):(Ut==it.length-3||st==Ot&&it[Ut+3]>st)&&(Pt=Ot-Rt,gt=Pt-1,st>=Ot&&(Ft="right")),gt!=null){if(ht=it[Ut+2],Rt==Ot&&dt==(ht.insertLeft?"left":"right")&&(Ft=dt),dt=="left"&&gt==0)for(;Ut&&it[Ut-2]==it[Ut-3]&&it[Ut-1].insertLeft;)ht=it[(Ut-=3)+2],Ft="left";if(dt=="right"&&gt==Ot-Rt)for(;Ut<it.length-3&&it[Ut+3]==it[Ut+4]&&!it[Ut+5].insertLeft;)ht=it[(Ut+=3)+2],Ft="right";break}return{node:ht,start:gt,end:Pt,collapse:Ft,coverStart:Rt,coverEnd:Ot}}function ld(it,st){var dt=mh;if(st=="left")for(var ht=0;ht<it.length&&(dt=it[ht]).left==dt.right;ht++);else for(var gt=it.length-1;gt>=0&&(dt=it[gt]).left==dt.right;gt--);return dt}function Fr(it,st,dt,ht){var gt=ad(st.map,dt,ht),Pt=gt.node,Ft=gt.start,Rt=gt.end,Ot=gt.collapse,Ut;if(Pt.nodeType==3){for(var xe=0;xe<4;xe++){for(;Ft&&Ee(st.line.text.charAt(gt.coverStart+Ft));)--Ft;for(;gt.coverStart+Rt<gt.coverEnd&&Ee(st.line.text.charAt(gt.coverStart+Rt));)++Rt;if(ge&&re<9&&Ft==0&&Rt==gt.coverEnd-gt.coverStart?Ut=Pt.parentNode.getBoundingClientRect():Ut=ld(pe(Pt,Ft,Rt).getClientRects(),ht),Ut.left||Ut.right||Ft==0)break;Rt=Ft,Ft=Ft-1,Ot="right"}ge&&re<11&&(Ut=zc(it.display.measure,Ut))}else{Ft>0&&(Ot=ht="right");var Jt;it.options.lineWrapping&&(Jt=Pt.getClientRects()).length>1?Ut=Jt[ht=="right"?Jt.length-1:0]:Ut=Pt.getBoundingClientRect()}if(ge&&re<9&&!Ft&&(!Ut||!Ut.left&&!Ut.right)){var _e=Pt.parentNode.getClientRects()[0];_e?Ut={left:_e.left,right:_e.left+Sh(it.display),top:_e.top,bottom:_e.bottom}:Ut=mh}for(var Oe=Ut.top-st.rect.top,wn=Ut.bottom-st.rect.top,Nn=(Oe+wn)/2,Wn=st.view.measure.heights,ui=0;ui<Wn.length-1&&!(Nn<Wn[ui]);ui++);var Mi=ui?Wn[ui-1]:0,xi=Wn[ui],Ti={left:(Ot=="right"?Ut.right:Ut.left)-st.rect.left,right:(Ot=="left"?Ut.left:Ut.right)-st.rect.left,top:Mi,bottom:xi};return!Ut.left&&!Ut.right&&(Ti.bogus=!0),it.options.singleCursorHeightPerLine||(Ti.rtop=Oe,Ti.rbottom=wn),Ti}function zc(it,st){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!jo(it))return st;var dt=screen.logicalXDPI/screen.deviceXDPI,ht=screen.logicalYDPI/screen.deviceYDPI;return{left:st.left*dt,right:st.right*dt,top:st.top*ht,bottom:st.bottom*ht}}function ud(it){if(it.measure&&(it.measure.cache={},it.measure.heights=null,it.rest))for(var st=0;st<it.rest.length;st++)it.measure.caches[st]={}}function vh(it){it.display.externalMeasure=null,ne(it.display.lineMeasure);for(var st=0;st<it.display.view.length;st++)ud(it.display.view[st])}function bu(it){vh(it),it.display.cachedCharWidth=it.display.cachedTextHeight=it.display.cachedPaddingH=null,it.options.lineWrapping||(it.display.maxLineChanged=!0),it.display.lineNumChars=null}function Is(){return Le&&et?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Rs(){return Le&&et?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ur(it){var st=0;if(it.widgets)for(var dt=0;dt<it.widgets.length;++dt)it.widgets[dt].above&&(st+=Ds(it.widgets[dt]));return st}function es(it,st,dt,ht,gt){if(!gt){var Pt=Ur(st);dt.top+=Pt,dt.bottom+=Pt}if(ht=="line")return dt;ht||(ht="local");var Ft=no(st);if(ht=="local"?Ft+=Os(it.display):Ft-=it.display.viewOffset,ht=="page"||ht=="window"){var Rt=it.display.lineSpace.getBoundingClientRect();Ft+=Rt.top+(ht=="window"?0:Rs());var Ot=Rt.left+(ht=="window"?0:Is());dt.left+=Ot,dt.right+=Ot}return dt.top+=Ft,dt.bottom+=Ft,dt}function Vo(it,st,dt){if(dt=="div")return st;var ht=st.left,gt=st.top;if(dt=="page")ht-=Is(),gt-=Rs();else if(dt=="local"||!dt){var Pt=it.display.sizer.getBoundingClientRect();ht+=Pt.left,gt+=Pt.top}var Ft=it.display.lineSpace.getBoundingClientRect();return{left:ht-Ft.left,top:gt-Ft.top}}function Co(it,st,dt,ht,gt){return ht||(ht=pn(it.doc,st.line)),es(it,ht,sd(it,ht,st.ch,gt),dt)}function Bo(it,st,dt,ht,gt,Pt){ht=ht||pn(it.doc,st.line),gt||(gt=Gl(it,ht));function Ft(wn,Nn){var Wn=ja(it,gt,wn,Nn?"right":"left",Pt);return Nn?Wn.left=Wn.right:Wn.right=Wn.left,es(it,ht,Wn,dt)}var Rt=An(ht,it.doc.direction),Ot=st.ch,Ut=st.sticky;if(Ot>=ht.text.length?(Ot=ht.text.length,Ut="before"):Ot<=0&&(Ot=0,Ut="after"),!Rt)return Ft(Ut=="before"?Ot-1:Ot,Ut=="before");function xe(wn,Nn,Wn){var ui=Rt[Nn],Mi=ui.level==1;return Ft(Wn?wn-1:wn,Mi!=Wn)}var Jt=en(Rt,Ot,Ut),_e=qe,Oe=xe(Ot,Jt,Ut=="before");return _e!=null&&(Oe.other=xe(Ot,_e,Ut!="before")),Oe}function js(it,st){var dt=0;st=we(it.doc,st),it.options.lineWrapping||(dt=Sh(it.display)*st.ch);var ht=pn(it.doc,st.line),gt=no(ht)+Os(it.display);return{left:dt,right:dt,top:gt,bottom:gt+ht.height}}function Yr(it,st,dt,ht,gt){var Pt=Qt(it,st,dt);return Pt.xRel=gt,ht&&(Pt.outside=ht),Pt}function ls(it,st,dt){var ht=it.doc;if(dt+=it.display.viewOffset,dt<0)return Yr(ht.first,0,null,-1,-1);var gt=Ne(ht,dt),Pt=ht.first+ht.size-1;if(gt>Pt)return Yr(ht.first+ht.size-1,pn(ht,Pt).text.length,null,1,1);st<0&&(st=0);for(var Ft=pn(ht,gt);;){var Rt=Ue(it,Ft,gt,st,dt),Ot=li(Ft,Rt.ch+(Rt.xRel>0||Rt.outside>0?1:0));if(!Ot)return Rt;var Ut=Ot.find(1);if(Ut.line==gt)return Ut;Ft=pn(ht,gt=Ut.line)}}function ci(it,st,dt,ht){ht-=Ur(st);var gt=st.text.length,Pt=He(function(Ft){return ja(it,dt,Ft-1).bottom<=ht},gt,0);return gt=He(function(Ft){return ja(it,dt,Ft).top>ht},Pt,gt),{begin:Pt,end:gt}}function _a(it,st,dt,ht){dt||(dt=Gl(it,st));var gt=es(it,st,ja(it,dt,ht),"line").top;return ci(it,st,dt,gt)}function qt(it,st,dt,ht){return it.bottom<=dt?!1:it.top>dt?!0:(ht?it.left:it.right)>st}function Ue(it,st,dt,ht,gt){gt-=no(st);var Pt=Gl(it,st),Ft=Ur(st),Rt=0,Ot=st.text.length,Ut=!0,xe=An(st,it.doc.direction);if(xe){var Jt=(it.options.lineWrapping?yh:Hl)(it,st,dt,Pt,xe,ht,gt);Ut=Jt.level!=1,Rt=Ut?Jt.from:Jt.to-1,Ot=Ut?Jt.to:Jt.from-1}var _e=null,Oe=null,wn=He(function(eo){var Si=ja(it,Pt,eo);return Si.top+=Ft,Si.bottom+=Ft,qt(Si,ht,gt,!1)?(Si.top<=gt&&Si.left<=ht&&(_e=eo,Oe=Si),!0):!1},Rt,Ot),Nn,Wn,ui=!1;if(Oe){var Mi=ht-Oe.left<Oe.right-ht,xi=Mi==Ut;wn=_e+(xi?0:1),Wn=xi?"after":"before",Nn=Mi?Oe.left:Oe.right}else{!Ut&&(wn==Ot||wn==Rt)&&wn++,Wn=wn==0?"after":wn==st.text.length?"before":ja(it,Pt,wn-(Ut?1:0)).bottom+Ft<=gt==Ut?"after":"before";var Ti=Bo(it,Qt(dt,wn,Wn),"line",st,Pt);Nn=Ti.left,ui=gt<Ti.top?-1:gt>=Ti.bottom?1:0}return wn=sn(st.text,wn,1),Yr(dt,wn,Wn,ui,ht-Nn)}function Hl(it,st,dt,ht,gt,Pt,Ft){var Rt=He(function(Jt){var _e=gt[Jt],Oe=_e.level!=1;return qt(Bo(it,Qt(dt,Oe?_e.to:_e.from,Oe?"before":"after"),"line",st,ht),Pt,Ft,!0)},0,gt.length-1),Ot=gt[Rt];if(Rt>0){var Ut=Ot.level!=1,xe=Bo(it,Qt(dt,Ut?Ot.from:Ot.to,Ut?"after":"before"),"line",st,ht);qt(xe,Pt,Ft,!0)&&xe.top>Ft&&(Ot=gt[Rt-1])}return Ot}function yh(it,st,dt,ht,gt,Pt,Ft){var Rt=ci(it,st,ht,Ft),Ot=Rt.begin,Ut=Rt.end;/\s/.test(st.text.charAt(Ut-1))&&Ut--;for(var xe=null,Jt=null,_e=0;_e<gt.length;_e++){var Oe=gt[_e];if(!(Oe.from>=Ut||Oe.to<=Ot)){var wn=Oe.level!=1,Nn=ja(it,ht,wn?Math.min(Ut,Oe.to)-1:Math.max(Ot,Oe.from)).right,Wn=Nn<Pt?Pt-Nn+1e9:Nn-Pt;(!xe||Jt>Wn)&&(xe=Oe,Jt=Wn)}}return xe||(xe=gt[gt.length-1]),xe.from<Ot&&(xe={from:Ot,to:xe.to,level:xe.level}),xe.to>Ut&&(xe={from:xe.from,to:Ut,level:xe.level}),xe}var za;function lu(it){if(it.cachedTextHeight!=null)return it.cachedTextHeight;if(za==null){za=te("pre",null,"CodeMirror-line-like");for(var st=0;st<49;++st)za.appendChild(document.createTextNode("x")),za.appendChild(te("br"));za.appendChild(document.createTextNode("x"))}ie(it.measure,za);var dt=za.offsetHeight/50;return dt>3&&(it.cachedTextHeight=dt),ne(it.measure),dt||1}function Sh(it){if(it.cachedCharWidth!=null)return it.cachedCharWidth;var st=te("span","xxxxxxxxxx"),dt=te("pre",[st],"CodeMirror-line-like");ie(it.measure,dt);var ht=st.getBoundingClientRect(),gt=(ht.right-ht.left)/10;return gt>2&&(it.cachedCharWidth=gt),gt||10}function Gc(it){for(var st=it.display,dt={},ht={},gt=st.gutters.clientLeft,Pt=st.gutters.firstChild,Ft=0;Pt;Pt=Pt.nextSibling,++Ft){var Rt=it.display.gutterSpecs[Ft].className;dt[Rt]=Pt.offsetLeft+Pt.clientLeft+gt,ht[Rt]=Pt.clientWidth}return{fixedPos:Kd(st),gutterTotalWidth:st.gutters.offsetWidth,gutterLeft:dt,gutterWidth:ht,wrapperWidth:st.wrapper.clientWidth}}function Kd(it){return it.scroller.getBoundingClientRect().left-it.sizer.getBoundingClientRect().left}function xr(it){var st=lu(it.display),dt=it.options.lineWrapping,ht=dt&&Math.max(5,it.display.scroller.clientWidth/Sh(it.display)-3);return function(gt){if(Qe(it.doc,gt))return 0;var Pt=0;if(gt.widgets)for(var Ft=0;Ft<gt.widgets.length;Ft++)gt.widgets[Ft].height&&(Pt+=gt.widgets[Ft].height);return dt?Pt+(Math.ceil(gt.text.length/ht)||1)*st:Pt+st}}function _i(it){var st=it.doc,dt=xr(it);st.iter(function(ht){var gt=dt(ht);gt!=ht.height&&Sn(ht,gt)})}function na(it,st,dt,ht){var gt=it.display;if(!dt&&er(st).getAttribute("cm-not-content")=="true")return null;var Pt,Ft,Rt=gt.lineSpace.getBoundingClientRect();try{Pt=st.clientX-Rt.left,Ft=st.clientY-Rt.top}catch(Jt){return null}var Ot=ls(it,Pt,Ft),Ut;if(ht&&Ot.xRel>0&&(Ut=pn(it.doc,Ot.line).text).length==Ot.ch){var xe=ce(Ut,Ut.length,it.options.tabSize)-Ut.length;Ot=Qt(Ot.line,Math.max(0,Math.round((Pt-$a(it.display).left)/Sh(it.display))-xe))}return Ot}function Ga(it,st){if(st>=it.display.viewTo||(st-=it.display.viewFrom,st<0))return null;for(var dt=it.display.view,ht=0;ht<dt.length;ht++)if(st-=dt[ht].size,st<0)return ht}function wr(it,st,dt,ht){st==null&&(st=it.doc.first),dt==null&&(dt=it.doc.first+it.doc.size),ht||(ht=0);var gt=it.display;if(ht&&dt<gt.viewTo&&(gt.updateLineNumbers==null||gt.updateLineNumbers>st)&&(gt.updateLineNumbers=st),it.curOp.viewChanged=!0,st>=gt.viewTo)ke&&vi(it.doc,st)<gt.viewTo&&Zr(it);else if(dt<=gt.viewFrom)ke&&fi(it.doc,dt+ht)>gt.viewFrom?Zr(it):(gt.viewFrom+=ht,gt.viewTo+=ht);else if(st<=gt.viewFrom&&dt>=gt.viewTo)Zr(it);else if(st<=gt.viewFrom){var Pt=pa(it,dt,dt+ht,1);Pt?(gt.view=gt.view.slice(Pt.index),gt.viewFrom=Pt.lineN,gt.viewTo+=ht):Zr(it)}else if(dt>=gt.viewTo){var Ft=pa(it,st,st,-1);Ft?(gt.view=gt.view.slice(0,Ft.index),gt.viewTo=Ft.lineN):Zr(it)}else{var Rt=pa(it,st,st,-1),Ot=pa(it,dt,dt+ht,1);Rt&&Ot?(gt.view=gt.view.slice(0,Rt.index).concat(Wo(it,Rt.lineN,Ot.lineN)).concat(gt.view.slice(Ot.index)),gt.viewTo+=ht):Zr(it)}var Ut=gt.externalMeasured;Ut&&(dt<Ut.lineN?Ut.lineN+=ht:st<Ut.lineN+Ut.size&&(gt.externalMeasured=null))}function So(it,st,dt){it.curOp.viewChanged=!0;var ht=it.display,gt=it.display.externalMeasured;if(gt&&st>=gt.lineN&&st<gt.lineN+gt.size&&(ht.externalMeasured=null),!(st<ht.viewFrom||st>=ht.viewTo)){var Pt=ht.view[Ga(it,st)];if(Pt.node!=null){var Ft=Pt.changes||(Pt.changes=[]);tn(Ft,dt)==-1&&Ft.push(dt)}}}function Zr(it){it.display.viewFrom=it.display.viewTo=it.doc.first,it.display.view=[],it.display.viewOffset=0}function pa(it,st,dt,ht){var gt=Ga(it,st),Pt,Ft=it.display.view;if(!ke||dt==it.doc.first+it.doc.size)return{index:gt,lineN:dt};for(var Rt=it.display.viewFrom,Ot=0;Ot<gt;Ot++)Rt+=Ft[Ot].size;if(Rt!=st){if(ht>0){if(gt==Ft.length-1)return null;Pt=Rt+Ft[gt].size-st,gt++}else Pt=Rt-st;st+=Pt,dt+=Pt}for(;vi(it.doc,dt)!=dt;){if(gt==(ht<0?0:Ft.length-1))return null;dt+=ht*Ft[gt-(ht<0?1:0)].size,gt+=ht}return{index:gt,lineN:dt}}function ur(it,st,dt){var ht=it.display,gt=ht.view;gt.length==0||st>=ht.viewTo||dt<=ht.viewFrom?(ht.view=Wo(it,st,dt),ht.viewFrom=st):(ht.viewFrom>st?ht.view=Wo(it,st,ht.viewFrom).concat(ht.view):ht.viewFrom<st&&(ht.view=ht.view.slice(Ga(it,st))),ht.viewFrom=st,ht.viewTo<dt?ht.view=ht.view.concat(Wo(it,ht.viewTo,dt)):ht.viewTo>dt&&(ht.view=ht.view.slice(0,Ga(it,dt)))),ht.viewTo=dt}function La(it){for(var st=it.display.view,dt=0,ht=0;ht<st.length;ht++){var gt=st[ht];!gt.hidden&&(!gt.node||gt.changes)&&++dt}return dt}function us(it){it.display.input.showSelection(it.display.input.prepareSelection())}function Fu(it,st){st===void 0&&(st=!0);for(var dt=it.doc,ht={},gt=ht.cursors=document.createDocumentFragment(),Pt=ht.selection=document.createDocumentFragment(),Ft=0;Ft<dt.sel.ranges.length;Ft++)if(!(!st&&Ft==dt.sel.primIndex)){var Rt=dt.sel.ranges[Ft];if(!(Rt.from().line>=it.display.viewTo||Rt.to().line<it.display.viewFrom)){var Ot=Rt.empty();(Ot||it.options.showCursorWhenSelecting)&&Ao(it,Rt.head,gt),Ot||No(it,Rt,Pt)}}return ht}function Ao(it,st,dt){var ht=Bo(it,st,"div",null,null,!it.options.singleCursorHeightPerLine),gt=dt.appendChild(te("div","\xA0","CodeMirror-cursor"));if(gt.style.left=ht.left+"px",gt.style.top=ht.top+"px",gt.style.height=Math.max(0,ht.bottom-ht.top)*it.options.cursorHeight+"px",ht.other){var Pt=dt.appendChild(te("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));Pt.style.display="",Pt.style.left=ht.other.left+"px",Pt.style.top=ht.other.top+"px",Pt.style.height=(ht.other.bottom-ht.other.top)*.85+"px"}}function ia(it,st){return it.top-st.top||it.left-st.left}function No(it,st,dt){var ht=it.display,gt=it.doc,Pt=document.createDocumentFragment(),Ft=$a(it.display),Rt=Ft.left,Ot=Math.max(ht.sizerWidth,ga(it)-ht.sizer.offsetLeft)-Ft.right,Ut=gt.direction=="ltr";function xe(xi,Ti,eo,Si){Ti<0&&(Ti=0),Ti=Math.round(Ti),Si=Math.round(Si),Pt.appendChild(te("div",null,"CodeMirror-selected","position: absolute; left: "+xi+`px;
top: `+Ti+"px; width: "+(eo==null?Ot-xi:eo)+`px;
height: `+(Si-Ti)+"px"))}function Jt(xi,Ti,eo){var Si=pn(gt,xi),wo=Si.text.length,Pr,cs;function Tr(rs,ba){return Co(it,Qt(xi,rs),"div",Si,ba)}function ya(rs,ba,zs){var ss=_a(it,Si,null,rs),Xo=ba=="ltr"==(zs=="after")?"left":"right",Rr=zs=="after"?ss.begin:ss.end-(/\s/.test(Si.text.charAt(ss.end-1))?2:1);return Tr(Rr,Xo)[Xo]}var Ks=An(Si,gt.direction);return Ae(Ks,Ti||0,eo==null?wo:eo,function(rs,ba,zs,ss){var Xo=zs=="ltr",Rr=Tr(rs,Xo?"left":"right"),Cs=Tr(ba-1,Xo?"right":"left"),Gs=Ti==null&&rs==0,pl=eo==null&&ba==wo,Ar=ss==0,ol=!Ks||ss==Ks.length-1;if(Cs.top-Rr.top<=3){var Wr=(Ut?Gs:pl)&&Ar,vc=(Ut?pl:Gs)&&ol,Ua=Wr?Rt:(Xo?Rr:Cs).left,Fa=vc?Ot:(Xo?Cs:Rr).right;xe(Ua,Rr.top,Fa-Ua,Rr.bottom)}else{var Sa,fr,Ls,Kl;Xo?(Sa=Ut&&Gs&&Ar?Rt:Rr.left,fr=Ut?Ot:ya(rs,zs,"before"),Ls=Ut?Rt:ya(ba,zs,"after"),Kl=Ut&&pl&&ol?Ot:Cs.right):(Sa=Ut?ya(rs,zs,"before"):Rt,fr=!Ut&&Gs&&Ar?Ot:Rr.right,Ls=!Ut&&pl&&ol?Rt:Cs.left,Kl=Ut?ya(ba,zs,"after"):Ot),xe(Sa,Rr.top,fr-Sa,Rr.bottom),Rr.bottom<Cs.top&&xe(Rt,Rr.bottom,null,Cs.top),xe(Ls,Cs.top,Kl-Ls,Cs.bottom)}(!Pr||ia(Rr,Pr)<0)&&(Pr=Rr),ia(Cs,Pr)<0&&(Pr=Cs),(!cs||ia(Rr,cs)<0)&&(cs=Rr),ia(Cs,cs)<0&&(cs=Cs)}),{start:Pr,end:cs}}var _e=st.from(),Oe=st.to();if(_e.line==Oe.line)Jt(_e.line,_e.ch,Oe.ch);else{var wn=pn(gt,_e.line),Nn=pn(gt,Oe.line),Wn=ki(wn)==ki(Nn),ui=Jt(_e.line,_e.ch,Wn?wn.text.length+1:null).end,Mi=Jt(Oe.line,Wn?0:null,Oe.ch).start;Wn&&(ui.top<Mi.top-2?(xe(ui.right,ui.top,null,ui.bottom),xe(Rt,Mi.top,Mi.left,Mi.bottom)):xe(ui.right,ui.top,Mi.left-ui.right,ui.bottom)),ui.bottom<Mi.top&&xe(Rt,ui.bottom,null,Mi.top)}dt.appendChild(Pt)}function ir(it){if(it.state.focused){var st=it.display;clearInterval(st.blinker);var dt=!0;st.cursorDiv.style.visibility="",it.options.cursorBlinkRate>0?st.blinker=setInterval(function(){it.hasFocus()||xh(it),st.cursorDiv.style.visibility=(dt=!dt)?"":"hidden"},it.options.cursorBlinkRate):it.options.cursorBlinkRate<0&&(st.cursorDiv.style.visibility="hidden")}}function mr(it){it.state.focused||(it.display.input.focus(),Do(it))}function kr(it){it.state.delayingBlurEvent=!0,setTimeout(function(){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1,xh(it))},100)}function Do(it,st){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1),it.options.readOnly!="nocursor"&&(it.state.focused||(zi(it,"focus",it,st),it.state.focused=!0,hn(it.display.wrapper,"CodeMirror-focused"),!it.curOp&&it.display.selForContextMenu!=it.doc.sel&&(it.display.input.reset(),se&&setTimeout(function(){return it.display.input.reset(!0)},20)),it.display.input.receivedFocus()),ir(it))}function xh(it,st){it.state.delayingBlurEvent||(it.state.focused&&(zi(it,"blur",it,st),it.state.focused=!1,jt(it.display.wrapper,"CodeMirror-focused")),clearInterval(it.display.blinker),setTimeout(function(){it.state.focused||(it.display.shift=!1)},150))}function Oi(it){for(var st=it.display,dt=st.lineDiv.offsetTop,ht=0;ht<st.view.length;ht++){var gt=st.view[ht],Pt=it.options.lineWrapping,Ft=void 0,Rt=0;if(!gt.hidden){if(ge&&re<8){var Ot=gt.node.offsetTop+gt.node.offsetHeight;Ft=Ot-dt,dt=Ot}else{var Ut=gt.node.getBoundingClientRect();Ft=Ut.bottom-Ut.top,!Pt&&gt.text.firstChild&&(Rt=gt.text.firstChild.getBoundingClientRect().right-Ut.left-1)}var xe=gt.line.height-Ft;if((xe>.005||xe<-.005)&&(Sn(gt.line,Ft),Dp(gt.line),gt.rest))for(var Jt=0;Jt<gt.rest.length;Jt++)Dp(gt.rest[Jt]);if(Rt>it.display.sizerWidth){var _e=Math.ceil(Rt/Sh(it.display));_e>it.display.maxLineLength&&(it.display.maxLineLength=_e,it.display.maxLine=gt.line,it.display.maxLineChanged=!0)}}}}function Dp(it){if(it.widgets)for(var st=0;st<it.widgets.length;++st){var dt=it.widgets[st],ht=dt.node.parentNode;ht&&(dt.height=ht.offsetHeight)}}function Eo(it,st,dt){var ht=dt&&dt.top!=null?Math.max(0,dt.top):it.scroller.scrollTop;ht=Math.floor(ht-Os(it));var gt=dt&&dt.bottom!=null?dt.bottom:ht+it.wrapper.clientHeight,Pt=Ne(st,ht),Ft=Ne(st,gt);if(dt&&dt.ensure){var Rt=dt.ensure.from.line,Ot=dt.ensure.to.line;Rt<Pt?(Pt=Rt,Ft=Ne(st,no(pn(st,Rt))+it.wrapper.clientHeight)):Math.min(Ot,st.lastLine())>=Ft&&(Pt=Ne(st,no(pn(st,Ot))-it.wrapper.clientHeight),Ft=Ot)}return{from:Pt,to:Math.max(Ft,Pt+1)}}function Op(it,st){if(!Hi(it,"scrollCursorIntoView")){var dt=it.display,ht=dt.sizer.getBoundingClientRect(),gt=null;if(st.top+ht.top<0?gt=!0:st.bottom+ht.top>(window.innerHeight||document.documentElement.clientHeight)&&(gt=!1),gt!=null&&!Re){var Pt=te("div","\u200B",null,`position: absolute;
top: `+(st.top-dt.viewOffset-Os(it.display))+`px;
height: `+(st.bottom-st.top+Hr(it)+dt.barHeight)+`px;
left: `+st.left+"px; width: "+Math.max(2,st.right-st.left)+"px;");it.display.lineSpace.appendChild(Pt),Pt.scrollIntoView(gt),it.display.lineSpace.removeChild(Pt)}}}function hd(it,st,dt,ht){ht==null&&(ht=0);var gt;!it.options.lineWrapping&&st==dt&&(st=st.ch?Qt(st.line,st.sticky=="before"?st.ch-1:st.ch,"after"):st,dt=st.sticky=="before"?Qt(st.line,st.ch+1,"before"):st);for(var Pt=0;Pt<5;Pt++){var Ft=!1,Rt=Bo(it,st),Ot=!dt||dt==st?Rt:Bo(it,dt);gt={left:Math.min(Rt.left,Ot.left),top:Math.min(Rt.top,Ot.top)-ht,right:Math.max(Rt.left,Ot.left),bottom:Math.max(Rt.bottom,Ot.bottom)+ht};var Ut=tg(it,gt),xe=it.doc.scrollTop,Jt=it.doc.scrollLeft;if(Ut.scrollTop!=null&&(Ph(it,Ut.scrollTop),Math.abs(it.doc.scrollTop-xe)>1&&(Ft=!0)),Ut.scrollLeft!=null&&(hu(it,Ut.scrollLeft),Math.abs(it.doc.scrollLeft-Jt)>1&&(Ft=!0)),!Ft)break}return gt}function Xd(it,st){var dt=tg(it,st);dt.scrollTop!=null&&Ph(it,dt.scrollTop),dt.scrollLeft!=null&&hu(it,dt.scrollLeft)}function tg(it,st){var dt=it.display,ht=lu(it.display);st.top<0&&(st.top=0);var gt=it.curOp&&it.curOp.scrollTop!=null?it.curOp.scrollTop:dt.scroller.scrollTop,Pt=gh(it),Ft={};st.bottom-st.top>Pt&&(st.bottom=st.top+Pt);var Rt=it.doc.height+El(dt),Ot=st.top<ht,Ut=st.bottom>Rt-ht;if(st.top<gt)Ft.scrollTop=Ot?0:st.top;else if(st.bottom>gt+Pt){var xe=Math.min(st.top,(Ut?Rt:st.bottom)-Pt);xe!=gt&&(Ft.scrollTop=xe)}var Jt=it.options.fixedGutter?0:dt.gutters.offsetWidth,_e=it.curOp&&it.curOp.scrollLeft!=null?it.curOp.scrollLeft:dt.scroller.scrollLeft-Jt,Oe=ga(it)-dt.gutters.offsetWidth,wn=st.right-st.left>Oe;return wn&&(st.right=st.left+Oe),st.left<10?Ft.scrollLeft=0:st.left<_e?Ft.scrollLeft=Math.max(0,st.left+Jt-(wn?0:10)):st.right>Oe+_e-3&&(Ft.scrollLeft=st.right+(wn?0:10)-Oe),Ft}function Hc(it,st){st!=null&&(Wl(it),it.curOp.scrollTop=(it.curOp.scrollTop==null?it.doc.scrollTop:it.curOp.scrollTop)+st)}function uu(it){Wl(it);var st=it.getCursor();it.curOp.scrollToPos={from:st,to:st,margin:it.options.cursorScrollMargin}}function wh(it,st,dt){(st!=null||dt!=null)&&Wl(it),st!=null&&(it.curOp.scrollLeft=st),dt!=null&&(it.curOp.scrollTop=dt)}function Oo(it,st){Wl(it),it.curOp.scrollToPos=st}function Wl(it){var st=it.curOp.scrollToPos;if(st){it.curOp.scrollToPos=null;var dt=js(it,st.from),ht=js(it,st.to);Wc(it,dt,ht,st.margin)}}function Wc(it,st,dt,ht){var gt=tg(it,{left:Math.min(st.left,dt.left),top:Math.min(st.top,dt.top)-ht,right:Math.max(st.right,dt.right),bottom:Math.max(st.bottom,dt.bottom)+ht});wh(it,gt.scrollLeft,gt.scrollTop)}function Ph(it,st){Math.abs(it.doc.scrollTop-st)<2||(St||Ou(it,{top:st}),eg(it,st,!0),St&&Ou(it),dd(it,100))}function eg(it,st,dt){st=Math.max(0,Math.min(it.display.scroller.scrollHeight-it.display.scroller.clientHeight,st)),!(it.display.scroller.scrollTop==st&&!dt)&&(it.doc.scrollTop=st,it.display.scrollbars.setScrollTop(st),it.display.scroller.scrollTop!=st&&(it.display.scroller.scrollTop=st))}function hu(it,st,dt,ht){st=Math.max(0,Math.min(st,it.display.scroller.scrollWidth-it.display.scroller.clientWidth)),!((dt?st==it.doc.scrollLeft:Math.abs(it.doc.scrollLeft-st)<2)&&!ht)&&(it.doc.scrollLeft=st,Yc(it),it.display.scroller.scrollLeft!=st&&(it.display.scroller.scrollLeft=st),it.display.scrollbars.setScrollLeft(st))}function tl(it){var st=it.display,dt=st.gutters.offsetWidth,ht=Math.round(it.doc.height+El(it.display));return{clientHeight:st.scroller.clientHeight,viewHeight:st.wrapper.clientHeight,scrollWidth:st.scroller.scrollWidth,clientWidth:st.scroller.clientWidth,viewWidth:st.wrapper.clientWidth,barLeft:it.options.fixedGutter?dt:0,docHeight:ht,scrollHeight:ht+Hr(it)+st.barHeight,nativeBarWidth:st.nativeBarWidth,gutterWidth:dt}}var Nu=function(it,st,dt){this.cm=dt;var ht=this.vert=te("div",[te("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),gt=this.horiz=te("div",[te("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");ht.tabIndex=gt.tabIndex=-1,it(ht),it(gt),fn(ht,"scroll",function(){ht.clientHeight&&st(ht.scrollTop,"vertical")}),fn(gt,"scroll",function(){gt.clientWidth&&st(gt.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ge&&re<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Nu.prototype.update=function(it){var st=it.scrollWidth>it.clientWidth+1,dt=it.scrollHeight>it.clientHeight+1,ht=it.nativeBarWidth;if(dt){this.vert.style.display="block",this.vert.style.bottom=st?ht+"px":"0";var gt=it.viewHeight-(st?ht:0);this.vert.firstChild.style.height=Math.max(0,it.scrollHeight-it.clientHeight+gt)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(st){this.horiz.style.display="block",this.horiz.style.right=dt?ht+"px":"0",this.horiz.style.left=it.barLeft+"px";var Pt=it.viewWidth-it.barLeft-(dt?ht:0);this.horiz.firstChild.style.width=Math.max(0,it.scrollWidth-it.clientWidth+Pt)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&it.clientHeight>0&&(ht==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:dt?ht:0,bottom:st?ht:0}},Nu.prototype.setScrollLeft=function(it){this.horiz.scrollLeft!=it&&(this.horiz.scrollLeft=it),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Nu.prototype.setScrollTop=function(it){this.vert.scrollTop!=it&&(this.vert.scrollTop=it),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Nu.prototype.zeroWidthHack=function(){var it=ct&&!ae?"12px":"18px";this.horiz.style.height=this.vert.style.width=it,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Kt,this.disableVert=new Kt},Nu.prototype.enableZeroWidthBar=function(it,st,dt){it.style.pointerEvents="auto";function ht(){var gt=it.getBoundingClientRect(),Pt=dt=="vert"?document.elementFromPoint(gt.right-1,(gt.top+gt.bottom)/2):document.elementFromPoint((gt.right+gt.left)/2,gt.bottom-1);Pt!=it?it.style.pointerEvents="none":st.set(1e3,ht)}st.set(1e3,ht)},Nu.prototype.clear=function(){var it=this.horiz.parentNode;it.removeChild(this.horiz),it.removeChild(this.vert)};var Fl=function(){};Fl.prototype.update=function(){return{bottom:0,right:0}},Fl.prototype.setScrollLeft=function(){},Fl.prototype.setScrollTop=function(){},Fl.prototype.clear=function(){};function Tu(it,st){st||(st=tl(it));var dt=it.display.barWidth,ht=it.display.barHeight;Vc(it,st);for(var gt=0;gt<4&&dt!=it.display.barWidth||ht!=it.display.barHeight;gt++)dt!=it.display.barWidth&&it.options.lineWrapping&&Oi(it),Vc(it,tl(it)),dt=it.display.barWidth,ht=it.display.barHeight}function Vc(it,st){var dt=it.display,ht=dt.scrollbars.update(st);dt.sizer.style.paddingRight=(dt.barWidth=ht.right)+"px",dt.sizer.style.paddingBottom=(dt.barHeight=ht.bottom)+"px",dt.heightForcer.style.borderBottom=ht.bottom+"px solid transparent",ht.right&&ht.bottom?(dt.scrollbarFiller.style.display="block",dt.scrollbarFiller.style.height=ht.bottom+"px",dt.scrollbarFiller.style.width=ht.right+"px"):dt.scrollbarFiller.style.display="",ht.bottom&&it.options.coverGutterNextToScrollbar&&it.options.fixedGutter?(dt.gutterFiller.style.display="block",dt.gutterFiller.style.height=ht.bottom+"px",dt.gutterFiller.style.width=st.gutterWidth+"px"):dt.gutterFiller.style.display=""}var ng={native:Nu,null:Fl};function ig(it){it.display.scrollbars&&(it.display.scrollbars.clear(),it.display.scrollbars.addClass&&jt(it.display.wrapper,it.display.scrollbars.addClass)),it.display.scrollbars=new ng[it.options.scrollbarStyle](function(st){it.display.wrapper.insertBefore(st,it.display.scrollbarFiller),fn(st,"mousedown",function(){it.state.focused&&setTimeout(function(){return it.display.input.focus()},0)}),st.setAttribute("cm-not-content","true")},function(st,dt){dt=="horizontal"?hu(it,st):Ph(it,st)},it),it.display.scrollbars.addClass&&hn(it.display.wrapper,it.display.scrollbars.addClass)}var Ip=0;function Au(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:++Ip},ta(it.curOp)}function Bu(it){var st=it.curOp;st&&Ra(st,function(dt){for(var ht=0;ht<dt.ops.length;ht++)dt.ops[ht].cm.curOp=null;J0(dt)})}function J0(it){for(var st=it.ops,dt=0;dt<st.length;dt++)Q0(st[dt]);for(var ht=0;ht<st.length;ht++)q0(st[ht]);for(var gt=0;gt<st.length;gt++)Rp(st[gt]);for(var Pt=0;Pt<st.length;Pt++)Ir(st[Pt]);for(var Ft=0;Ft<st.length;Ft++)Du(st[Ft])}function Q0(it){var st=it.cm,dt=st.display;jp(st),it.updateMaxLine&&_o(st),it.mustUpdate=it.viewChanged||it.forceUpdate||it.scrollTop!=null||it.scrollToPos&&(it.scrollToPos.from.line<dt.viewFrom||it.scrollToPos.to.line>=dt.viewTo)||dt.maxLineChanged&&st.options.lineWrapping,it.update=it.mustUpdate&&new Ch(st,it.mustUpdate&&{top:it.scrollTop,ensure:it.scrollToPos},it.forceUpdate)}function q0(it){it.updatedDisplay=it.mustUpdate&&Uc(it.cm,it.update)}function Rp(it){var st=it.cm,dt=st.display;it.updatedDisplay&&Oi(st),it.barMeasure=tl(st),dt.maxLineChanged&&!st.options.lineWrapping&&(it.adjustWidthTo=sd(st,dt.maxLine,dt.maxLine.text.length).left+3,st.display.sizerWidth=it.adjustWidthTo,it.barMeasure.scrollWidth=Math.max(dt.scroller.clientWidth,dt.sizer.offsetLeft+it.adjustWidthTo+Hr(st)+st.display.barWidth),it.maxScrollLeft=Math.max(0,dt.sizer.offsetLeft+it.adjustWidthTo-ga(st))),(it.updatedDisplay||it.selectionChanged)&&(it.preparedSelection=dt.input.prepareSelection())}function Ir(it){var st=it.cm;it.adjustWidthTo!=null&&(st.display.sizer.style.minWidth=it.adjustWidthTo+"px",it.maxScrollLeft<st.doc.scrollLeft&&hu(st,Math.min(st.display.scroller.scrollLeft,it.maxScrollLeft),!0),st.display.maxLineChanged=!1);var dt=it.focus&&it.focus==Ye();it.preparedSelection&&st.display.input.showSelection(it.preparedSelection,dt),(it.updatedDisplay||it.startHeight!=st.doc.height)&&Tu(st,it.barMeasure),it.updatedDisplay&&Ru(st,it.barMeasure),it.selectionChanged&&ir(st),st.state.focused&&it.updateInput&&st.display.input.reset(it.typing),dt&&mr(it.cm)}function Du(it){var st=it.cm,dt=st.display,ht=st.doc;if(it.updatedDisplay&&or(st,it.update),dt.wheelStartX!=null&&(it.scrollTop!=null||it.scrollLeft!=null||it.scrollToPos)&&(dt.wheelStartX=dt.wheelStartY=null),it.scrollTop!=null&&eg(st,it.scrollTop,it.forceScroll),it.scrollLeft!=null&&hu(st,it.scrollLeft,!0,!0),it.scrollToPos){var gt=hd(st,we(ht,it.scrollToPos.from),we(ht,it.scrollToPos.to),it.scrollToPos.margin);Op(st,gt)}var Pt=it.maybeHiddenMarkers,Ft=it.maybeUnhiddenMarkers;if(Pt)for(var Rt=0;Rt<Pt.length;++Rt)Pt[Rt].lines.length||zi(Pt[Rt],"hide");if(Ft)for(var Ot=0;Ot<Ft.length;++Ot)Ft[Ot].lines.length&&zi(Ft[Ot],"unhide");dt.wrapper.offsetHeight&&(ht.scrollTop=st.display.scroller.scrollTop),it.changeObjs&&zi(st,"changes",st,it.changeObjs),it.update&&it.update.finish()}function Qo(it,st){if(it.curOp)return st();Au(it);try{return st()}finally{Bu(it)}}function hs(it,st){return function(){if(it.curOp)return st.apply(it,arguments);Au(it);try{return st.apply(it,arguments)}finally{Bu(it)}}}function ys(it){return function(){if(this.curOp)return it.apply(this,arguments);Au(this);try{return it.apply(this,arguments)}finally{Bu(this)}}}function Ss(it){return function(){var st=this.cm;if(!st||st.curOp)return it.apply(this,arguments);Au(st);try{return it.apply(this,arguments)}finally{Bu(st)}}}function dd(it,st){it.doc.highlightFrontier<it.display.viewTo&&it.state.highlight.set(st,pi(xs,it))}function xs(it){var st=it.doc;if(!(st.highlightFrontier>=it.display.viewTo)){var dt=+new Date+it.options.workTime,ht=Ri(it,st.highlightFrontier),gt=[];st.iter(ht.line,Math.min(st.first+st.size,it.display.viewTo+500),function(Pt){if(ht.line>=it.display.viewFrom){var Ft=Pt.styles,Rt=Pt.text.length>it.options.maxHighlightLength?xn(st.mode,ht.state):null,Ot=Yi(it,Pt,ht,!0);Rt&&(ht.state=Rt),Pt.styles=Ot.styles;var Ut=Pt.styleClasses,xe=Ot.classes;xe?Pt.styleClasses=xe:Ut&&(Pt.styleClasses=null);for(var Jt=!Ft||Ft.length!=Pt.styles.length||Ut!=xe&&(!Ut||!xe||Ut.bgClass!=xe.bgClass||Ut.textClass!=xe.textClass),_e=0;!Jt&&_e<Ft.length;++_e)Jt=Ft[_e]!=Pt.styles[_e];Jt&&gt.push(ht.line),Pt.stateAfter=ht.save(),ht.nextLine()}else Pt.text.length<=it.options.maxHighlightLength&&Se(it,Pt.text,ht),Pt.stateAfter=ht.line%5==0?ht.save():null,ht.nextLine();if(+new Date>dt)return dd(it,it.options.workDelay),!0}),st.highlightFrontier=ht.line,st.modeFrontier=Math.max(st.modeFrontier,ht.line),gt.length&&Qo(it,function(){for(var Pt=0;Pt<gt.length;Pt++)So(it,gt[Pt],"text")})}}var Ch=function(it,st,dt){var ht=it.display;this.viewport=st,this.visible=Eo(ht,it.doc,st),this.editorIsHidden=!ht.wrapper.offsetWidth,this.wrapperHeight=ht.wrapper.clientHeight,this.wrapperWidth=ht.wrapper.clientWidth,this.oldDisplayWidth=ga(it),this.force=dt,this.dims=Gc(it),this.events=[]};Ch.prototype.signal=function(it,st){oo(it,st)&&this.events.push(arguments)},Ch.prototype.finish=function(){for(var it=0;it<this.events.length;it++)zi.apply(null,this.events[it])};function jp(it){var st=it.display;!st.scrollbarsClipped&&st.scroller.offsetWidth&&(st.nativeBarWidth=st.scroller.offsetWidth-st.scroller.clientWidth,st.heightForcer.style.height=Hr(it)+"px",st.sizer.style.marginBottom=-st.nativeBarWidth+"px",st.sizer.style.borderRightWidth=Hr(it)+"px",st.scrollbarsClipped=!0)}function _p(it){if(it.hasFocus())return null;var st=Ye();if(!st||!Je(it.display.lineDiv,st))return null;var dt={activeElt:st};if(window.getSelection){var ht=window.getSelection();ht.anchorNode&&ht.extend&&Je(it.display.lineDiv,ht.anchorNode)&&(dt.anchorNode=ht.anchorNode,dt.anchorOffset=ht.anchorOffset,dt.focusNode=ht.focusNode,dt.focusOffset=ht.focusOffset)}return dt}function ma(it){if(!(!it||!it.activeElt||it.activeElt==Ye())&&(it.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(it.activeElt.nodeName)&&it.anchorNode&&Je(document.body,it.anchorNode)&&Je(document.body,it.focusNode))){var st=window.getSelection(),dt=document.createRange();dt.setEnd(it.anchorNode,it.anchorOffset),dt.collapse(!1),st.removeAllRanges(),st.addRange(dt),st.extend(it.focusNode,it.focusOffset)}}function Uc(it,st){var dt=it.display,ht=it.doc;if(st.editorIsHidden)return Zr(it),!1;if(!st.force&&st.visible.from>=dt.viewFrom&&st.visible.to<=dt.viewTo&&(dt.updateLineNumbers==null||dt.updateLineNumbers>=dt.viewTo)&&dt.renderedView==dt.view&&La(it)==0)return!1;ns(it)&&(Zr(it),st.dims=Gc(it));var gt=ht.first+ht.size,Pt=Math.max(st.visible.from-it.options.viewportMargin,ht.first),Ft=Math.min(gt,st.visible.to+it.options.viewportMargin);dt.viewFrom<Pt&&Pt-dt.viewFrom<20&&(Pt=Math.max(ht.first,dt.viewFrom)),dt.viewTo>Ft&&dt.viewTo-Ft<20&&(Ft=Math.min(gt,dt.viewTo)),ke&&(Pt=vi(it.doc,Pt),Ft=fi(it.doc,Ft));var Rt=Pt!=dt.viewFrom||Ft!=dt.viewTo||dt.lastWrapHeight!=st.wrapperHeight||dt.lastWrapWidth!=st.wrapperWidth;ur(it,Pt,Ft),dt.viewOffset=no(pn(it.doc,dt.viewFrom)),it.display.mover.style.top=dt.viewOffset+"px";var Ot=La(it);if(!Rt&&Ot==0&&!st.force&&dt.renderedView==dt.view&&(dt.updateLineNumbers==null||dt.updateLineNumbers>=dt.viewTo))return!1;var Ut=_p(it);return Ot>4&&(dt.lineDiv.style.display="none"),og(it,dt.updateLineNumbers,st.dims),Ot>4&&(dt.lineDiv.style.display=""),dt.renderedView=dt.view,ma(Ut),ne(dt.cursorDiv),ne(dt.selectionDiv),dt.gutters.style.height=dt.sizer.style.minHeight=0,Rt&&(dt.lastWrapHeight=st.wrapperHeight,dt.lastWrapWidth=st.wrapperWidth,dd(it,400)),dt.updateLineNumbers=null,!0}function or(it,st){for(var dt=st.viewport,ht=!0;;ht=!1){if(!ht||!it.options.lineWrapping||st.oldDisplayWidth==ga(it)){if(dt&&dt.top!=null&&(dt={top:Math.min(it.doc.height+El(it.display)-gh(it),dt.top)}),st.visible=Eo(it.display,it.doc,dt),st.visible.from>=it.display.viewFrom&&st.visible.to<=it.display.viewTo)break}else ht&&(st.visible=Eo(it.display,it.doc,dt));if(!Uc(it,st))break;Oi(it);var gt=tl(it);us(it),Tu(it,gt),Ru(it,gt),st.force=!1}st.signal(it,"update",it),(it.display.viewFrom!=it.display.reportedViewFrom||it.display.viewTo!=it.display.reportedViewTo)&&(st.signal(it,"viewportChange",it,it.display.viewFrom,it.display.viewTo),it.display.reportedViewFrom=it.display.viewFrom,it.display.reportedViewTo=it.display.viewTo)}function Ou(it,st){var dt=new Ch(it,st);if(Uc(it,dt)){Oi(it),or(it,dt);var ht=tl(it);us(it),Tu(it,ht),Ru(it,ht),dt.finish()}}function og(it,st,dt){var ht=it.display,gt=it.options.lineNumbers,Pt=ht.lineDiv,Ft=Pt.firstChild;function Rt(wn){var Nn=wn.nextSibling;return se&&ct&&it.display.currentWheelTarget==wn?wn.style.display="none":wn.parentNode.removeChild(wn),Nn}for(var Ot=ht.view,Ut=ht.viewFrom,xe=0;xe<Ot.length;xe++){var Jt=Ot[xe];if(!Jt.hidden)if(!Jt.node||Jt.node.parentNode!=Pt){var _e=fa(it,Jt,Ut,dt);Pt.insertBefore(_e,Ft)}else{for(;Ft!=Jt.node;)Ft=Rt(Ft);var Oe=gt&&st!=null&&st<=Ut&&Jt.lineNumber;Jt.changes&&(tn(Jt.changes,"gutter")>-1&&(Oe=!1),vs(it,Jt,Ut,dt)),Oe&&(ne(Jt.lineNumber),Jt.lineNumber.appendChild(document.createTextNode(ye(it.options,Ut)))),Ft=Jt.node.nextSibling}Ut+=Jt.size}for(;Ft;)Ft=Rt(Ft)}function Iu(it){var st=it.gutters.offsetWidth;it.sizer.style.marginLeft=st+"px"}function Ru(it,st){it.display.sizer.style.minHeight=st.docHeight+"px",it.display.heightForcer.style.top=st.docHeight+"px",it.display.gutters.style.height=st.docHeight+it.display.barHeight+Hr(it)+"px"}function Yc(it){var st=it.display,dt=st.view;if(!(!st.alignWidgets&&(!st.gutters.firstChild||!it.options.fixedGutter))){for(var ht=Kd(st)-st.scroller.scrollLeft+it.doc.scrollLeft,gt=st.gutters.offsetWidth,Pt=ht+"px",Ft=0;Ft<dt.length;Ft++)if(!dt[Ft].hidden){it.options.fixedGutter&&(dt[Ft].gutter&&(dt[Ft].gutter.style.left=Pt),dt[Ft].gutterBackground&&(dt[Ft].gutterBackground.style.left=Pt));var Rt=dt[Ft].alignable;if(Rt)for(var Ot=0;Ot<Rt.length;Ot++)Rt[Ot].style.left=Pt}it.options.fixedGutter&&(st.gutters.style.left=ht+gt+"px")}}function ns(it){if(!it.options.lineNumbers)return!1;var st=it.doc,dt=ye(it.options,st.first+st.size-1),ht=it.display;if(dt.length!=ht.lineNumChars){var gt=ht.measure.appendChild(te("div",[te("div",dt)],"CodeMirror-linenumber CodeMirror-gutter-elt")),Pt=gt.firstChild.offsetWidth,Ft=gt.offsetWidth-Pt;return ht.lineGutter.style.width="",ht.lineNumInnerWidth=Math.max(Pt,ht.lineGutter.offsetWidth-Ft)+1,ht.lineNumWidth=ht.lineNumInnerWidth+Ft,ht.lineNumChars=ht.lineNumInnerWidth?dt.length:-1,ht.lineGutter.style.width=ht.lineNumWidth+"px",Iu(it.display),!0}return!1}function ws(it,st){for(var dt=[],ht=!1,gt=0;gt<it.length;gt++){var Pt=it[gt],Ft=null;if(typeof Pt!="string"&&(Ft=Pt.style,Pt=Pt.className),Pt=="CodeMirror-linenumbers")if(st)ht=!0;else continue;dt.push({className:Pt,style:Ft})}return st&&!ht&&dt.push({className:"CodeMirror-linenumbers",style:null}),dt}function Lh(it){var st=it.gutters,dt=it.gutterSpecs;ne(st),it.lineGutter=null;for(var ht=0;ht<dt.length;++ht){var gt=dt[ht],Pt=gt.className,Ft=gt.style,Rt=st.appendChild(te("div",null,"CodeMirror-gutter "+Pt));Ft&&(Rt.style.cssText=Ft),Pt=="CodeMirror-linenumbers"&&(it.lineGutter=Rt,Rt.style.width=(it.lineNumWidth||1)+"px")}st.style.display=dt.length?"":"none",Iu(it)}function Ha(it){Lh(it.display),wr(it),Yc(it)}function ju(it,st,dt,ht){var gt=this;this.input=dt,gt.scrollbarFiller=te("div",null,"CodeMirror-scrollbar-filler"),gt.scrollbarFiller.setAttribute("cm-not-content","true"),gt.gutterFiller=te("div",null,"CodeMirror-gutter-filler"),gt.gutterFiller.setAttribute("cm-not-content","true"),gt.lineDiv=Ge("div",null,"CodeMirror-code"),gt.selectionDiv=te("div",null,null,"position: relative; z-index: 1"),gt.cursorDiv=te("div",null,"CodeMirror-cursors"),gt.measure=te("div",null,"CodeMirror-measure"),gt.lineMeasure=te("div",null,"CodeMirror-measure"),gt.lineSpace=Ge("div",[gt.measure,gt.lineMeasure,gt.selectionDiv,gt.cursorDiv,gt.lineDiv],null,"position: relative; outline: none");var Pt=Ge("div",[gt.lineSpace],"CodeMirror-lines");gt.mover=te("div",[Pt],null,"position: relative"),gt.sizer=te("div",[gt.mover],"CodeMirror-sizer"),gt.sizerWidth=null,gt.heightForcer=te("div",null,null,"position: absolute; height: "+Yn+"px; width: 1px;"),gt.gutters=te("div",null,"CodeMirror-gutters"),gt.lineGutter=null,gt.scroller=te("div",[gt.sizer,gt.heightForcer,gt.gutters],"CodeMirror-scroll"),gt.scroller.setAttribute("tabIndex","-1"),gt.wrapper=te("div",[gt.scrollbarFiller,gt.gutterFiller,gt.scroller],"CodeMirror"),ge&&re<8&&(gt.gutters.style.zIndex=-1,gt.scroller.style.paddingRight=0),!se&&!(St&&nt)&&(gt.scroller.draggable=!0),it&&(it.appendChild?it.appendChild(gt.wrapper):it(gt.wrapper)),gt.viewFrom=gt.viewTo=st.first,gt.reportedViewFrom=gt.reportedViewTo=st.first,gt.view=[],gt.renderedView=null,gt.externalMeasured=null,gt.viewOffset=0,gt.lastWrapHeight=gt.lastWrapWidth=0,gt.updateLineNumbers=null,gt.nativeBarWidth=gt.barHeight=gt.barWidth=0,gt.scrollbarsClipped=!1,gt.lineNumWidth=gt.lineNumInnerWidth=gt.lineNumChars=null,gt.alignWidgets=!1,gt.cachedCharWidth=gt.cachedTextHeight=gt.cachedPaddingH=null,gt.maxLine=null,gt.maxLineLength=0,gt.maxLineChanged=!1,gt.wheelDX=gt.wheelDY=gt.wheelStartX=gt.wheelStartY=null,gt.shift=!1,gt.selForContextMenu=null,gt.activeTouch=null,gt.gutterSpecs=ws(ht.gutters,ht.lineNumbers),Lh(gt),dt.init(gt)}var ka=0,Kr=null;ge?Kr=-.53:St?Kr=15:Le?Kr=-.7:Ze&&(Kr=-1/3);function Nl(it){var st=it.wheelDeltaX,dt=it.wheelDeltaY;return st==null&&it.detail&&it.axis==it.HORIZONTAL_AXIS&&(st=it.detail),dt==null&&it.detail&&it.axis==it.VERTICAL_AXIS?dt=it.detail:dt==null&&(dt=it.wheelDelta),{x:st,y:dt}}function Wa(it){var st=Nl(it);return st.x*=Kr,st.y*=Kr,st}function Ps(it,st){var dt=Nl(st),ht=dt.x,gt=dt.y,Pt=it.display,Ft=Pt.scroller,Rt=Ft.scrollWidth>Ft.clientWidth,Ot=Ft.scrollHeight>Ft.clientHeight;if(ht&&Rt||gt&&Ot){if(gt&&ct&&se){t:for(var Ut=st.target,xe=Pt.view;Ut!=Ft;Ut=Ut.parentNode)for(var Jt=0;Jt<xe.length;Jt++)if(xe[Jt].node==Ut){it.display.currentWheelTarget=Ut;break t}}if(ht&&!St&&!$t&&Kr!=null){gt&&Ot&&Ph(it,Math.max(0,Ft.scrollTop+gt*Kr)),hu(it,Math.max(0,Ft.scrollLeft+ht*Kr)),(!gt||gt&&Ot)&&Ki(st),Pt.wheelStartX=null;return}if(gt&&Kr!=null){var _e=gt*Kr,Oe=it.doc.scrollTop,wn=Oe+Pt.wrapper.clientHeight;_e<0?Oe=Math.max(0,Oe+_e-50):wn=Math.min(it.doc.height,wn+_e+50),Ou(it,{top:Oe,bottom:wn})}ka<20&&(Pt.wheelStartX==null?(Pt.wheelStartX=Ft.scrollLeft,Pt.wheelStartY=Ft.scrollTop,Pt.wheelDX=ht,Pt.wheelDY=gt,setTimeout(function(){if(Pt.wheelStartX!=null){var Nn=Ft.scrollLeft-Pt.wheelStartX,Wn=Ft.scrollTop-Pt.wheelStartY,ui=Wn&&Pt.wheelDY&&Wn/Pt.wheelDY||Nn&&Pt.wheelDX&&Nn/Pt.wheelDX;Pt.wheelStartX=Pt.wheelStartY=null,ui&&(Kr=(Kr*ka+ui)/(ka+1),++ka)}},200)):(Pt.wheelDX+=ht,Pt.wheelDY+=gt))}}var el=function(it,st){this.ranges=it,this.primIndex=st};el.prototype.primary=function(){return this.ranges[this.primIndex]},el.prototype.equals=function(it){if(it==this)return!0;if(it.primIndex!=this.primIndex||it.ranges.length!=this.ranges.length)return!1;for(var st=0;st<this.ranges.length;st++){var dt=this.ranges[st],ht=it.ranges[st];if(!De(dt.anchor,ht.anchor)||!De(dt.head,ht.head))return!1}return!0},el.prototype.deepCopy=function(){for(var it=[],st=0;st<this.ranges.length;st++)it[st]=new rr(Mn(this.ranges[st].anchor),Mn(this.ranges[st].head));return new el(it,this.primIndex)},el.prototype.somethingSelected=function(){for(var it=0;it<this.ranges.length;it++)if(!this.ranges[it].empty())return!0;return!1},el.prototype.contains=function(it,st){st||(st=it);for(var dt=0;dt<this.ranges.length;dt++){var ht=this.ranges[dt];if(Zt(st,ht.from())>=0&&Zt(it,ht.to())<=0)return dt}return-1};var rr=function(it,st){this.anchor=it,this.head=st};rr.prototype.from=function(){return ln(this.anchor,this.head)},rr.prototype.to=function(){return Hn(this.anchor,this.head)},rr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function gl(it,st,dt){var ht=it&&it.options.selectionsMayTouch,gt=st[dt];st.sort(function(_e,Oe){return Zt(_e.from(),Oe.from())}),dt=tn(st,gt);for(var Pt=1;Pt<st.length;Pt++){var Ft=st[Pt],Rt=st[Pt-1],Ot=Zt(Rt.to(),Ft.from());if(ht&&!Ft.empty()?Ot>0:Ot>=0){var Ut=ln(Rt.from(),Ft.from()),xe=Hn(Rt.to(),Ft.to()),Jt=Rt.empty()?Ft.from()==Ft.head:Rt.from()==Rt.head;Pt<=dt&&--dt,st.splice(--Pt,2,new rr(Jt?xe:Ut,Jt?Ut:xe))}}return new el(st,dt)}function du(it,st){return new el([new rr(it,st||it)],0)}function _u(it){return it.text?Qt(it.from.line+it.text.length-1,ee(it.text).length+(it.text.length==1?it.from.ch:0)):it.to}function kh(it,st){if(Zt(it,st.from)<0)return it;if(Zt(it,st.to)<=0)return _u(st);var dt=it.line+st.text.length-(st.to.line-st.from.line)-1,ht=it.ch;return it.line==st.to.line&&(ht+=_u(st).ch-st.to.ch),Qt(dt,ht)}function Jd(it,st){for(var dt=[],ht=0;ht<it.sel.ranges.length;ht++){var gt=it.sel.ranges[ht];dt.push(new rr(kh(gt.anchor,st),kh(gt.head,st)))}return gl(it.cm,dt,it.sel.primIndex)}function cd(it,st,dt){return it.line==st.line?Qt(dt.line,it.ch-st.ch+dt.ch):Qt(dt.line+(it.line-st.line),it.ch)}function Qd(it,st,dt){for(var ht=[],gt=Qt(it.first,0),Pt=gt,Ft=0;Ft<st.length;Ft++){var Rt=st[Ft],Ot=cd(Rt.from,gt,Pt),Ut=cd(_u(Rt),gt,Pt);if(gt=Rt.to,Pt=Ut,dt=="around"){var xe=it.sel.ranges[Ft],Jt=Zt(xe.head,xe.anchor)<0;ht[Ft]=new rr(Jt?Ut:Ot,Jt?Ot:Ut)}else ht[Ft]=new rr(Ot,Ot)}return new el(ht,it.sel.primIndex)}function xo(it){it.doc.mode=ve(it.options,it.doc.modeOption),qd(it)}function qd(it){it.doc.iter(function(st){st.stateAfter&&(st.stateAfter=null),st.styles&&(st.styles=null)}),it.doc.modeFrontier=it.doc.highlightFrontier=it.doc.first,dd(it,100),it.state.modeGen++,it.curOp&&wr(it)}function rg(it,st){return st.from.ch==0&&st.to.ch==0&&ee(st.text)==""&&(!it.cm||it.cm.options.wholeLineUpdateBefore)}function Zc(it,st,dt,ht){function gt(Mi){return dt?dt[Mi]:null}function Pt(Mi,xi,Ti){Ko(Mi,xi,Ti,ht),yi(Mi,"change",Mi,st)}function Ft(Mi,xi){for(var Ti=[],eo=Mi;eo<xi;++eo)Ti.push(new ko(Ut[eo],gt(eo),ht));return Ti}var Rt=st.from,Ot=st.to,Ut=st.text,xe=pn(it,Rt.line),Jt=pn(it,Ot.line),_e=ee(Ut),Oe=gt(Ut.length-1),wn=Ot.line-Rt.line;if(st.full)it.insert(0,Ft(0,Ut.length)),it.remove(Ut.length,it.size-Ut.length);else if(rg(it,st)){var Nn=Ft(0,Ut.length-1);Pt(Jt,Jt.text,Oe),wn&&it.remove(Rt.line,wn),Nn.length&&it.insert(Rt.line,Nn)}else if(xe==Jt)if(Ut.length==1)Pt(xe,xe.text.slice(0,Rt.ch)+_e+xe.text.slice(Ot.ch),Oe);else{var Wn=Ft(1,Ut.length-1);Wn.push(new ko(_e+xe.text.slice(Ot.ch),Oe,ht)),Pt(xe,xe.text.slice(0,Rt.ch)+Ut[0],gt(0)),it.insert(Rt.line+1,Wn)}else if(Ut.length==1)Pt(xe,xe.text.slice(0,Rt.ch)+Ut[0]+Jt.text.slice(Ot.ch),gt(0)),it.remove(Rt.line+1,wn);else{Pt(xe,xe.text.slice(0,Rt.ch)+Ut[0],gt(0)),Pt(Jt,_e+Jt.text.slice(Ot.ch),Oe);var ui=Ft(1,Ut.length-1);wn>1&&it.remove(Rt.line+1,wn-1),it.insert(Rt.line+1,ui)}yi(it,"change",it,st)}function Tl(it,st,dt){function ht(gt,Pt,Ft){if(gt.linked)for(var Rt=0;Rt<gt.linked.length;++Rt){var Ot=gt.linked[Rt];if(Ot.doc!=Pt){var Ut=Ft&&Ot.sharedHist;dt&&!Ut||(st(Ot.doc,Ut),ht(Ot.doc,gt,Ut))}}}ht(it,null,!0)}function Kc(it,st){if(st.cm)throw new Error("This document is already in use.");it.doc=st,st.cm=it,_i(it),xo(it),$d(it),it.options.lineWrapping||_o(it),it.options.mode=st.modeOption,wr(it)}function $d(it){(it.doc.direction=="rtl"?hn:jt)(it.display.lineDiv,"CodeMirror-rtl")}function $0(it){Qo(it,function(){$d(it),wr(it)})}function fd(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 Xc(it,st){var dt={from:Mn(st.from),to:_u(st),text:me(it,st.from,st.to)};return zu(it,dt,st.from.line,st.to.line+1),Tl(it,function(ht){return zu(ht,dt,st.from.line,st.to.line+1)},!0),dt}function gd(it){for(;it.length;){var st=ee(it);if(st.ranges)it.pop();else break}}function tc(it,st){if(st)return gd(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 ec(it,st,dt,ht){var gt=it.history;gt.undone.length=0;var Pt=+new Date,Ft,Rt;if((gt.lastOp==ht||gt.lastOrigin==st.origin&&st.origin&&(st.origin.charAt(0)=="+"&&gt.lastModTime>Pt-(it.cm?it.cm.options.historyEventDelay:500)||st.origin.charAt(0)=="*"))&&(Ft=tc(gt,gt.lastOp==ht)))Rt=ee(Ft.changes),Zt(st.from,st.to)==0&&Zt(st.from,Rt.to)==0?Rt.to=_u(st):Ft.changes.push(Xc(it,st));else{var Ot=ee(gt.done);for((!Ot||!Ot.ranges)&&pd(it.sel,gt.done),Ft={changes:[Xc(it,st)],generation:gt.generation},gt.done.push(Ft);gt.done.length>gt.undoDepth;)gt.done.shift(),gt.done[0].ranges||gt.done.shift()}gt.done.push(dt),gt.generation=++gt.maxGeneration,gt.lastModTime=gt.lastSelTime=Pt,gt.lastOp=gt.lastSelOp=ht,gt.lastOrigin=gt.lastSelOrigin=st.origin,Rt||zi(it,"historyAdded")}function sg(it,st,dt,ht){var gt=st.charAt(0);return gt=="*"||gt=="+"&&dt.ranges.length==ht.ranges.length&&dt.somethingSelected()==ht.somethingSelected()&&new Date-it.history.lastSelTime<=(it.cm?it.cm.options.historyEventDelay:500)}function nc(it,st,dt,ht){var gt=it.history,Pt=ht&&ht.origin;dt==gt.lastSelOp||Pt&&gt.lastSelOrigin==Pt&&(gt.lastModTime==gt.lastSelTime&&gt.lastOrigin==Pt||sg(it,Pt,ee(gt.done),st))?gt.done[gt.done.length-1]=st:pd(st,gt.done),gt.lastSelTime=+new Date,gt.lastSelOrigin=Pt,gt.lastSelOp=dt,ht&&ht.clearRedo!==!1&&gd(gt.undone)}function pd(it,st){var dt=ee(st);dt&&dt.ranges&&dt.equals(it)||st.push(it)}function zu(it,st,dt,ht){var gt=st["spans_"+it.id],Pt=0;it.iter(Math.max(it.first,dt),Math.min(it.first+it.size,ht),function(Ft){Ft.markedSpans&&((gt||(gt=st["spans_"+it.id]={}))[Pt]=Ft.markedSpans),++Pt})}function oa(it){if(!it)return null;for(var st,dt=0;dt<it.length;++dt)it[dt].marker.explicitlyCleared?st||(st=it.slice(0,dt)):st&&st.push(it[dt]);return st?st.length?st:null:it}function Vl(it,st){var dt=st["spans_"+it.id];if(!dt)return null;for(var ht=[],gt=0;gt<st.text.length;++gt)ht.push(oa(dt[gt]));return ht}function Jc(it,st){var dt=Vl(it,st),ht=bi(it,st);if(!dt)return ht;if(!ht)return dt;for(var gt=0;gt<dt.length;++gt){var Pt=dt[gt],Ft=ht[gt];if(Pt&&Ft)t:for(var Rt=0;Rt<Ft.length;++Rt){for(var Ot=Ft[Rt],Ut=0;Ut<Pt.length;++Ut)if(Pt[Ut].marker==Ot.marker)continue t;Pt.push(Ot)}else Ft&&(dt[gt]=Ft)}return dt}function cu(it,st,dt){for(var ht=[],gt=0;gt<it.length;++gt){var Pt=it[gt];if(Pt.ranges){ht.push(dt?el.prototype.deepCopy.call(Pt):Pt);continue}var Ft=Pt.changes,Rt=[];ht.push({changes:Rt});for(var Ot=0;Ot<Ft.length;++Ot){var Ut=Ft[Ot],xe=void 0;if(Rt.push({from:Ut.from,to:Ut.to,text:Ut.text}),st)for(var Jt in Ut)(xe=Jt.match(/^spans_(\d+)$/))&&tn(st,Number(xe[1]))>-1&&(ee(Rt)[Jt]=Ut[Jt],delete Ut[Jt])}}return ht}function Qc(it,st,dt,ht){if(ht){var gt=it.anchor;if(dt){var Pt=Zt(st,gt)<0;Pt!=Zt(dt,gt)<0?(gt=st,st=dt):Pt!=Zt(st,dt)<0&&(st=dt)}return new rr(gt,st)}else return new rr(dt||st,st)}function qc(it,st,dt,ht,gt){gt==null&&(gt=it.cm&&(it.cm.display.shift||it.extend)),Zs(it,new el([Qc(it.sel.primary(),st,dt,gt)],0),ht)}function zp(it,st,dt){for(var ht=[],gt=it.cm&&(it.cm.display.shift||it.extend),Pt=0;Pt<it.sel.ranges.length;Pt++)ht[Pt]=Qc(it.sel.ranges[Pt],st[Pt],null,gt);var Ft=gl(it.cm,ht,it.sel.primIndex);Zs(it,Ft,dt)}function Gu(it,st,dt,ht){var gt=it.sel.ranges.slice(0);gt[st]=dt,Zs(it,gl(it.cm,gt,it.sel.primIndex),ht)}function Mh(it,st,dt,ht){Zs(it,du(st,dt),ht)}function Gp(it,st,dt){var ht={ranges:st.ranges,update:function(gt){this.ranges=[];for(var Pt=0;Pt<gt.length;Pt++)this.ranges[Pt]=new rr(we(it,gt[Pt].anchor),we(it,gt[Pt].head))},origin:dt&&dt.origin};return zi(it,"beforeSelectionChange",it,ht),it.cm&&zi(it.cm,"beforeSelectionChange",it.cm,ht),ht.ranges!=st.ranges?gl(it.cm,ht.ranges,ht.ranges.length-1):st}function $c(it,st,dt){var ht=it.history.done,gt=ee(ht);gt&&gt.ranges?(ht[ht.length-1]=st,Eh(it,st,dt)):Zs(it,st,dt)}function Zs(it,st,dt){Eh(it,st,dt),nc(it,it.sel,it.cm?it.cm.curOp.id:NaN,dt)}function Eh(it,st,dt){(oo(it,"beforeSelectionChange")||it.cm&&oo(it.cm,"beforeSelectionChange"))&&(st=Gp(it,st,dt));var ht=dt&&dt.bias||(Zt(st.primary().head,it.sel.primary().head)<0?-1:1);ag(it,oc(it,st,ht,!0)),!(dt&&dt.scroll===!1)&&it.cm&&uu(it.cm)}function ag(it,st){st.equals(it.sel)||(it.sel=st,it.cm&&(it.cm.curOp.updateInput=1,it.cm.curOp.selectionChanged=!0,po(it.cm)),yi(it,"cursorActivity",it))}function ic(it){ag(it,oc(it,it.sel,null,!1))}function oc(it,st,dt,ht){for(var gt,Pt=0;Pt<st.ranges.length;Pt++){var Ft=st.ranges[Pt],Rt=st.ranges.length==it.sel.ranges.length&&it.sel.ranges[Pt],Ot=rc(it,Ft.anchor,Rt&&Rt.anchor,dt,ht),Ut=rc(it,Ft.head,Rt&&Rt.head,dt,ht);(gt||Ot!=Ft.anchor||Ut!=Ft.head)&&(gt||(gt=st.ranges.slice(0,Pt)),gt[Pt]=new rr(Ot,Ut))}return gt?gl(it.cm,gt,st.primIndex):st}function fu(it,st,dt,ht,gt){var Pt=pn(it,st.line);if(Pt.markedSpans)for(var Ft=0;Ft<Pt.markedSpans.length;++Ft){var Rt=Pt.markedSpans[Ft],Ot=Rt.marker,Ut="selectLeft"in Ot?!Ot.selectLeft:Ot.inclusiveLeft,xe="selectRight"in Ot?!Ot.selectRight:Ot.inclusiveRight;if((Rt.from==null||(Ut?Rt.from<=st.ch:Rt.from<st.ch))&&(Rt.to==null||(xe?Rt.to>=st.ch:Rt.to>st.ch))){if(gt&&(zi(Ot,"beforeCursorEnter"),Ot.explicitlyCleared))if(Pt.markedSpans){--Ft;continue}else break;if(!Ot.atomic)continue;if(dt){var Jt=Ot.find(ht<0?1:-1),_e=void 0;if((ht<0?xe:Ut)&&(Jt=lg(it,Jt,-ht,Jt&&Jt.line==st.line?Pt:null)),Jt&&Jt.line==st.line&&(_e=Zt(Jt,dt))&&(ht<0?_e<0:_e>0))return fu(it,Jt,st,ht,gt)}var Oe=Ot.find(ht<0?-1:1);return(ht<0?Ut:xe)&&(Oe=lg(it,Oe,ht,Oe.line==st.line?Pt:null)),Oe?fu(it,Oe,st,ht,gt):null}}return st}function rc(it,st,dt,ht,gt){var Pt=ht||1,Ft=fu(it,st,dt,Pt,gt)||!gt&&fu(it,st,dt,Pt,!0)||fu(it,st,dt,-Pt,gt)||!gt&&fu(it,st,dt,-Pt,!0);return Ft||(it.cantEdit=!0,Qt(it.first,0))}function lg(it,st,dt,ht){return dt<0&&st.ch==0?st.line>it.first?we(it,Qt(st.line-1)):null:dt>0&&st.ch==(ht||pn(it,st.line)).text.length?st.line<it.first+it.size-1?Qt(st.line+1,0):null:new Qt(st.line,st.ch+dt)}function Xr(it){it.setSelection(Qt(it.firstLine(),0),Qt(it.lastLine()),je)}function sc(it,st,dt){var ht={canceled:!1,from:st.from,to:st.to,text:st.text,origin:st.origin,cancel:function(){return ht.canceled=!0}};return dt&&(ht.update=function(gt,Pt,Ft,Rt){gt&&(ht.from=we(it,gt)),Pt&&(ht.to=we(it,Pt)),Ft&&(ht.text=Ft),Rt!==void 0&&(ht.origin=Rt)}),zi(it,"beforeChange",it,ht),it.cm&&zi(it.cm,"beforeChange",it.cm,ht),ht.canceled?(it.cm&&(it.cm.curOp.updateInput=2),null):{from:ht.from,to:ht.to,text:ht.text,origin:ht.origin}}function Hu(it,st,dt){if(it.cm){if(!it.cm.curOp)return hs(it.cm,Hu)(it,st,dt);if(it.cm.state.suppressEdits)return}if(!((oo(it,"beforeChange")||it.cm&&oo(it.cm,"beforeChange"))&&(st=sc(it,st,!0),!st))){var ht=di&&!dt&&Ci(it,st.from,st.to);if(ht)for(var gt=ht.length-1;gt>=0;--gt)bh(it,{from:ht[gt].from,to:ht[gt].to,text:gt?[""]:st.text,origin:st.origin});else bh(it,st)}}function bh(it,st){if(!(st.text.length==1&&st.text[0]==""&&Zt(st.from,st.to)==0)){var dt=Jd(it,st);ec(it,st,dt,it.cm?it.cm.curOp.id:NaN),md(it,st,dt,bi(it,st));var ht=[];Tl(it,function(gt,Pt){!Pt&&tn(ht,gt.history)==-1&&(hg(gt.history,st),ht.push(gt.history)),md(gt,st,null,bi(gt,st))})}}function ac(it,st,dt){var ht=it.cm&&it.cm.state.suppressEdits;if(!(ht&&!dt)){for(var gt=it.history,Pt,Ft=it.sel,Rt=st=="undo"?gt.done:gt.undone,Ot=st=="undo"?gt.undone:gt.done,Ut=0;Ut<Rt.length&&(Pt=Rt[Ut],!(dt?Pt.ranges&&!Pt.equals(it.sel):!Pt.ranges));Ut++);if(Ut!=Rt.length){for(gt.lastOrigin=gt.lastSelOrigin=null;;)if(Pt=Rt.pop(),Pt.ranges){if(pd(Pt,Ot),dt&&!Pt.equals(it.sel)){Zs(it,Pt,{clearRedo:!1});return}Ft=Pt}else if(ht){Rt.push(Pt);return}else break;var xe=[];pd(Ft,Ot),Ot.push({changes:xe,generation:gt.generation}),gt.generation=Pt.generation||++gt.maxGeneration;for(var Jt=oo(it,"beforeChange")||it.cm&&oo(it.cm,"beforeChange"),_e=function(Nn){var Wn=Pt.changes[Nn];if(Wn.origin=st,Jt&&!sc(it,Wn,!1))return Rt.length=0,{};xe.push(Xc(it,Wn));var ui=Nn?Jd(it,Wn):ee(Rt);md(it,Wn,ui,Jc(it,Wn)),!Nn&&it.cm&&it.cm.scrollIntoView({from:Wn.from,to:_u(Wn)});var Mi=[];Tl(it,function(xi,Ti){!Ti&&tn(Mi,xi.history)==-1&&(hg(xi.history,Wn),Mi.push(xi.history)),md(xi,Wn,null,Jc(xi,Wn))})},Oe=Pt.changes.length-1;Oe>=0;--Oe){var wn=_e(Oe);if(wn)return wn.v}}}}function ug(it,st){if(st!=0&&(it.first+=st,it.sel=new el(jn(it.sel.ranges,function(gt){return new rr(Qt(gt.anchor.line+st,gt.anchor.ch),Qt(gt.head.line+st,gt.head.ch))}),it.sel.primIndex),it.cm)){wr(it.cm,it.first,it.first-st,st);for(var dt=it.cm.display,ht=dt.viewFrom;ht<dt.viewTo;ht++)So(it.cm,ht,"gutter")}}function md(it,st,dt,ht){if(it.cm&&!it.cm.curOp)return hs(it.cm,md)(it,st,dt,ht);if(st.to.line<it.first){ug(it,st.text.length-1-(st.to.line-st.from.line));return}if(!(st.from.line>it.lastLine())){if(st.from.line<it.first){var gt=st.text.length-1-(it.first-st.from.line);ug(it,gt),st={from:Qt(it.first,0),to:Qt(st.to.line+gt,st.to.ch),text:[ee(st.text)],origin:st.origin}}var Pt=it.lastLine();st.to.line>Pt&&(st={from:st.from,to:Qt(Pt,pn(it,Pt).text.length),text:[st.text[0]],origin:st.origin}),st.removed=me(it,st.from,st.to),dt||(dt=Jd(it,st)),it.cm?Hp(it.cm,st,ht):Zc(it,st,ht),Eh(it,dt,je),it.cantEdit&&rc(it,Qt(it.firstLine(),0))&&(it.cantEdit=!1)}}function Hp(it,st,dt){var ht=it.doc,gt=it.display,Pt=st.from,Ft=st.to,Rt=!1,Ot=Pt.line;it.options.lineWrapping||(Ot=Wt(ki(pn(ht,Pt.line))),ht.iter(Ot,Ft.line+1,function(Oe){if(Oe==gt.maxLine)return Rt=!0,!0})),ht.sel.contains(st.from,st.to)>-1&&po(it),Zc(ht,st,dt,xr(it)),it.options.lineWrapping||(ht.iter(Ot,Pt.line+st.text.length,function(Oe){var wn=Ho(Oe);wn>gt.maxLineLength&&(gt.maxLine=Oe,gt.maxLineLength=wn,gt.maxLineChanged=!0,Rt=!1)}),Rt&&(it.curOp.updateMaxLine=!0)),ei(ht,Pt.line),dd(it,400);var Ut=st.text.length-(Ft.line-Pt.line)-1;st.full?wr(it):Pt.line==Ft.line&&st.text.length==1&&!rg(it.doc,st)?So(it,Pt.line,"text"):wr(it,Pt.line,Ft.line+1,Ut);var xe=oo(it,"changes"),Jt=oo(it,"change");if(Jt||xe){var _e={from:Pt,to:Ft,text:st.text,removed:st.removed,origin:st.origin};Jt&&yi(it,"change",it,_e),xe&&(it.curOp.changeObjs||(it.curOp.changeObjs=[])).push(_e)}it.display.selForContextMenu=null}function Fh(it,st,dt,ht,gt){var Pt;ht||(ht=dt),Zt(ht,dt)<0&&(Pt=[ht,dt],dt=Pt[0],ht=Pt[1]),typeof st=="string"&&(st=it.splitLines(st)),Hu(it,{from:dt,to:ht,text:st,origin:gt})}function nl(it,st,dt,ht){dt<it.line?it.line+=ht:st<it.line&&(it.line=st,it.ch=0)}function Wp(it,st,dt,ht){for(var gt=0;gt<it.length;++gt){var Pt=it[gt],Ft=!0;if(Pt.ranges){Pt.copied||(Pt=it[gt]=Pt.deepCopy(),Pt.copied=!0);for(var Rt=0;Rt<Pt.ranges.length;Rt++)nl(Pt.ranges[Rt].anchor,st,dt,ht),nl(Pt.ranges[Rt].head,st,dt,ht);continue}for(var Ot=0;Ot<Pt.changes.length;++Ot){var Ut=Pt.changes[Ot];if(dt<Ut.from.line)Ut.from=Qt(Ut.from.line+ht,Ut.from.ch),Ut.to=Qt(Ut.to.line+ht,Ut.to.ch);else if(st<=Ut.to.line){Ft=!1;break}}Ft||(it.splice(0,gt+1),gt=0)}}function hg(it,st){var dt=st.from.line,ht=st.to.line,gt=st.text.length-(ht-dt)-1;Wp(it.done,dt,ht,gt),Wp(it.undone,dt,ht,gt)}function Nh(it,st,dt,ht){var gt=st,Pt=st;return typeof st=="number"?Pt=pn(it,Be(it,st)):gt=Wt(st),gt==null?null:(ht(Pt,gt)&&it.cm&&So(it.cm,gt,dt),Pt)}function vd(it){this.lines=it,this.parent=null;for(var st=0,dt=0;dt<it.length;++dt)it[dt].parent=this,st+=it[dt].height;this.height=st}vd.prototype={chunkSize:function(){return this.lines.length},removeInner:function(it,st){for(var dt=it,ht=it+st;dt<ht;++dt){var gt=this.lines[dt];this.height-=gt.height,Fo(gt),yi(gt,"delete")}this.lines.splice(it,st)},collapse:function(it){it.push.apply(it,this.lines)},insertInner:function(it,st,dt){this.height+=dt,this.lines=this.lines.slice(0,it).concat(st).concat(this.lines.slice(it));for(var ht=0;ht<st.length;++ht)st[ht].parent=this},iterN:function(it,st,dt){for(var ht=it+st;it<ht;++it)if(dt(this.lines[it]))return!0}};function Nr(it){this.children=it;for(var st=0,dt=0,ht=0;ht<it.length;++ht){var gt=it[ht];st+=gt.chunkSize(),dt+=gt.height,gt.parent=this}this.size=st,this.height=dt,this.parent=null}Nr.prototype={chunkSize:function(){return this.size},removeInner:function(it,st){this.size-=st;for(var dt=0;dt<this.children.length;++dt){var ht=this.children[dt],gt=ht.chunkSize();if(it<gt){var Pt=Math.min(st,gt-it),Ft=ht.height;if(ht.removeInner(it,Pt),this.height-=Ft-ht.height,gt==Pt&&(this.children.splice(dt--,1),ht.parent=null),(st-=Pt)==0)break;it=0}else it-=gt}if(this.size-st<25&&(this.children.length>1||!(this.children[0]instanceof vd))){var Rt=[];this.collapse(Rt),this.children=[new vd(Rt)],this.children[0].parent=this}},collapse:function(it){for(var st=0;st<this.children.length;++st)this.children[st].collapse(it)},insertInner:function(it,st,dt){this.size+=st.length,this.height+=dt;for(var ht=0;ht<this.children.length;++ht){var gt=this.children[ht],Pt=gt.chunkSize();if(it<=Pt){if(gt.insertInner(it,st,dt),gt.lines&&gt.lines.length>50){for(var Ft=gt.lines.length%25+25,Rt=Ft;Rt<gt.lines.length;){var Ot=new vd(gt.lines.slice(Rt,Rt+=25));gt.height-=Ot.height,this.children.splice(++ht,0,Ot),Ot.parent=this}gt.lines=gt.lines.slice(0,Ft),this.maybeSpill()}break}it-=Pt}},maybeSpill:function(){if(!(this.children.length<=10)){var it=this;do{var st=it.children.splice(it.children.length-5,5),dt=new Nr(st);if(it.parent){it.size-=dt.size,it.height-=dt.height;var gt=tn(it.parent.children,it);it.parent.children.splice(gt+1,0,dt)}else{var ht=new Nr(it.children);ht.parent=it,it.children=[ht,dt],it=ht}dt.parent=it.parent}while(it.children.length>10);it.parent.maybeSpill()}},iterN:function(it,st,dt){for(var ht=0;ht<this.children.length;++ht){var gt=this.children[ht],Pt=gt.chunkSize();if(it<Pt){var Ft=Math.min(st,Pt-it);if(gt.iterN(it,Ft,dt))return!0;if((st-=Ft)==0)break;it=0}else it-=Pt}}};var gu=function(it,st,dt){if(dt)for(var ht in dt)dt.hasOwnProperty(ht)&&(this[ht]=dt[ht]);this.doc=it,this.node=st};gu.prototype.clear=function(){var it=this.doc.cm,st=this.line.widgets,dt=this.line,ht=Wt(dt);if(!(ht==null||!st)){for(var gt=0;gt<st.length;++gt)st[gt]==this&&st.splice(gt--,1);st.length||(dt.widgets=null);var Pt=Ds(this);Sn(dt,Math.max(0,dt.height-Pt)),it&&(Qo(it,function(){Vp(it,dt,-Pt),So(it,ht,"widget")}),yi(it,"lineWidgetCleared",it,this,ht))}},gu.prototype.changed=function(){var it=this,st=this.height,dt=this.doc.cm,ht=this.line;this.height=null;var gt=Ds(this)-st;gt&&(Qe(this.doc,ht)||Sn(ht,ht.height+gt),dt&&Qo(dt,function(){dt.curOp.forceUpdate=!0,Vp(dt,ht,gt),yi(dt,"lineWidgetChanged",dt,it,Wt(ht))}))},Fi(gu);function Vp(it,st,dt){no(st)<(it.curOp&&it.curOp.scrollTop||it.doc.scrollTop)&&Hc(it,dt)}function tf(it,st,dt,ht){var gt=new gu(it,dt,ht),Pt=it.cm;return Pt&&gt.noHScroll&&(Pt.display.alignWidgets=!0),Nh(it,st,"widget",function(Ft){var Rt=Ft.widgets||(Ft.widgets=[]);if(gt.insertAt==null?Rt.push(gt):Rt.splice(Math.min(Rt.length-1,Math.max(0,gt.insertAt)),0,gt),gt.line=Ft,Pt&&!Qe(it,Ft)){var Ot=no(Ft)<it.scrollTop;Sn(Ft,Ft.height+Ds(gt)),Ot&&Hc(Pt,gt.height),Pt.curOp.forceUpdate=!0}return!0}),Pt&&yi(Pt,"lineWidgetAdded",Pt,gt,typeof st=="number"?st:Wt(st)),gt}var Up=0,ue=function(it,st){this.lines=[],this.type=st,this.doc=it,this.id=++Up};ue.prototype.clear=function(){if(!this.explicitlyCleared){var it=this.doc.cm,st=it&&!it.curOp;if(st&&Au(it),oo(this,"clear")){var dt=this.find();dt&&yi(this,"clear",dt.from,dt.to)}for(var ht=null,gt=null,Pt=0;Pt<this.lines.length;++Pt){var Ft=this.lines[Pt],Rt=$n(Ft.markedSpans,this);it&&!this.collapsed?So(it,Wt(Ft),"text"):it&&(Rt.to!=null&&(gt=Wt(Ft)),Rt.from!=null&&(ht=Wt(Ft))),Ft.markedSpans=ti(Ft.markedSpans,Rt),Rt.from==null&&this.collapsed&&!Qe(this.doc,Ft)&&it&&Sn(Ft,lu(it.display))}if(it&&this.collapsed&&!it.options.lineWrapping)for(var Ot=0;Ot<this.lines.length;++Ot){var Ut=ki(this.lines[Ot]),xe=Ho(Ut);xe>it.display.maxLineLength&&(it.display.maxLine=Ut,it.display.maxLineLength=xe,it.display.maxLineChanged=!0)}ht!=null&&it&&this.collapsed&&wr(it,ht,gt+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,it&&ic(it.doc)),it&&yi(it,"markerCleared",it,this,ht,gt),st&&Bu(it),this.parent&&this.parent.clear()}},ue.prototype.find=function(it,st){it==null&&this.type=="bookmark"&&(it=1);for(var dt,ht,gt=0;gt<this.lines.length;++gt){var Pt=this.lines[gt],Ft=$n(Pt.markedSpans,this);if(Ft.from!=null&&(dt=Qt(st?Pt:Wt(Pt),Ft.from),it==-1))return dt;if(Ft.to!=null&&(ht=Qt(st?Pt:Wt(Pt),Ft.to),it==1))return ht}return dt&&{from:dt,to:ht}},ue.prototype.changed=function(){var it=this,st=this.find(-1,!0),dt=this,ht=this.doc.cm;!st||!ht||Qo(ht,function(){var gt=st.line,Pt=Wt(st.line),Ft=ph(ht,Pt);if(Ft&&(ud(Ft),ht.curOp.selectionChanged=ht.curOp.forceUpdate=!0),ht.curOp.updateMaxLine=!0,!Qe(dt.doc,gt)&&dt.height!=null){var Rt=dt.height;dt.height=null;var Ot=Ds(dt)-Rt;Ot&&Sn(gt,gt.height+Ot)}yi(ht,"markerChanged",ht,it)})},ue.prototype.attachLine=function(it){if(!this.lines.length&&this.doc.cm){var st=this.doc.cm.curOp;(!st.maybeHiddenMarkers||tn(st.maybeHiddenMarkers,this)==-1)&&(st.maybeUnhiddenMarkers||(st.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(it)},ue.prototype.detachLine=function(it){if(this.lines.splice(tn(this.lines,it),1),!this.lines.length&&this.doc.cm){var st=this.doc.cm.curOp;(st.maybeHiddenMarkers||(st.maybeHiddenMarkers=[])).push(this)}},Fi(ue);function Th(it,st,dt,ht,gt){if(ht&&ht.shared)return Yp(it,st,dt,ht,gt);if(it.cm&&!it.cm.curOp)return hs(it.cm,Th)(it,st,dt,ht,gt);var Pt=new ue(it,gt),Ft=Zt(st,dt);if(ht&&yn(ht,Pt,!1),Ft>0||Ft==0&&Pt.clearWhenEmpty!==!1)return Pt;if(Pt.replacedWith&&(Pt.collapsed=!0,Pt.widgetNode=Ge("span",[Pt.replacedWith],"CodeMirror-widget"),ht.handleMouseEvents||Pt.widgetNode.setAttribute("cm-ignore-events","true"),ht.insertLeft&&(Pt.widgetNode.insertLeft=!0)),Pt.collapsed){if(Ai(it,st.line,st,dt,Pt)||st.line!=dt.line&&Ai(it,dt.line,st,dt,Pt))throw new Error("Inserting collapsed marker partially overlapping an existing one");Me()}Pt.addToHistory&&ec(it,{from:st,to:dt,origin:"markText"},it.sel,NaN);var Rt=st.line,Ot=it.cm,Ut;if(it.iter(Rt,dt.line+1,function(Jt){Ot&&Pt.collapsed&&!Ot.options.lineWrapping&&ki(Jt)==Ot.display.maxLine&&(Ut=!0),Pt.collapsed&&Rt!=st.line&&Sn(Jt,0),mo(Jt,new En(Pt,Rt==st.line?st.ch:null,Rt==dt.line?dt.ch:null)),++Rt}),Pt.collapsed&&it.iter(st.line,dt.line+1,function(Jt){Qe(it,Jt)&&Sn(Jt,0)}),Pt.clearOnEnter&&fn(Pt,"beforeCursorEnter",function(){return Pt.clear()}),Pt.readOnly&&(Di(),(it.history.done.length||it.history.undone.length)&&it.clearHistory()),Pt.collapsed&&(Pt.id=++Up,Pt.atomic=!0),Ot){if(Ut&&(Ot.curOp.updateMaxLine=!0),Pt.collapsed)wr(Ot,st.line,dt.line+1);else if(Pt.className||Pt.startStyle||Pt.endStyle||Pt.css||Pt.attributes||Pt.title)for(var xe=st.line;xe<=dt.line;xe++)So(Ot,xe,"text");Pt.atomic&&ic(Ot.doc),yi(Ot,"markerAdded",Ot,Pt)}return Pt}var Ul=function(it,st){this.markers=it,this.primary=st;for(var dt=0;dt<it.length;++dt)it[dt].parent=this};Ul.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var it=0;it<this.markers.length;++it)this.markers[it].clear();yi(this,"clear")}},Ul.prototype.find=function(it,st){return this.primary.find(it,st)},Fi(Ul);function Yp(it,st,dt,ht,gt){ht=yn(ht),ht.shared=!1;var Pt=[Th(it,st,dt,ht,gt)],Ft=Pt[0],Rt=ht.widgetNode;return Tl(it,function(Ot){Rt&&(ht.widgetNode=Rt.cloneNode(!0)),Pt.push(Th(Ot,we(Ot,st),we(Ot,dt),ht,gt));for(var Ut=0;Ut<Ot.linked.length;++Ut)if(Ot.linked[Ut].isParent)return;Ft=ee(Pt)}),new Ul(Pt,Ft)}function dg(it){return it.findMarks(Qt(it.first,0),it.clipPos(Qt(it.lastLine())),function(st){return st.parent})}function Zp(it,st){for(var dt=0;dt<st.length;dt++){var ht=st[dt],gt=ht.find(),Pt=it.clipPos(gt.from),Ft=it.clipPos(gt.to);if(Zt(Pt,Ft)){var Rt=Th(it,Pt,Ft,ht.primary,ht.primary.type);ht.markers.push(Rt),Rt.parent=ht}}}function cg(it){for(var st=function(ht){var gt=it[ht],Pt=[gt.primary.doc];Tl(gt.primary.doc,function(Ot){return Pt.push(Ot)});for(var Ft=0;Ft<gt.markers.length;Ft++){var Rt=gt.markers[Ft];tn(Pt,Rt.doc)==-1&&(Rt.parent=null,gt.markers.splice(Ft--,1))}},dt=0;dt<it.length;dt++)st(dt)}var tv=0,_s=function(it,st,dt,ht,gt){if(!(this instanceof _s))return new _s(it,st,dt,ht,gt);dt==null&&(dt=0),Nr.call(this,[new vd([new ko("",null)])]),this.first=dt,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=dt;var Pt=Qt(dt,0);this.sel=du(Pt),this.history=new fd(null),this.id=++tv,this.modeOption=st,this.lineSep=ht,this.direction=gt=="rtl"?"rtl":"ltr",this.extend=!1,typeof it=="string"&&(it=this.splitLines(it)),Zc(this,{from:Pt,to:Pt,text:it}),Zs(this,du(Pt),je)};_s.prototype=kt(Nr.prototype,{constructor:_s,iter:function(it,st,dt){dt?this.iterN(it-this.first,st-it,dt):this.iterN(this.first,this.first+this.size,it)},insert:function(it,st){for(var dt=0,ht=0;ht<st.length;++ht)dt+=st[ht].height;this.insertInner(it-this.first,st,dt)},remove:function(it,st){this.removeInner(it-this.first,st)},getValue:function(it){var st=de(this,this.first,this.first+this.size);return it===!1?st:st.join(it||this.lineSeparator())},setValue:Ss(function(it){var st=Qt(this.first,0),dt=this.first+this.size-1;Hu(this,{from:st,to:Qt(dt,pn(this,dt).text.length),text:this.splitLines(it),origin:"setValue",full:!0},!0),this.cm&&wh(this.cm,0,0),Zs(this,du(st),je)}),replaceRange:function(it,st,dt,ht){st=we(this,st),dt=dt?we(this,dt):st,Fh(this,it,st,dt,ht)},getRange:function(it,st,dt){var ht=me(this,we(this,it),we(this,st));return dt===!1?ht:ht.join(dt||this.lineSeparator())},getLine:function(it){var st=this.getLineHandle(it);return st&&st.text},getLineHandle:function(it){if(an(this,it))return pn(this,it)},getLineNumber:function(it){return Wt(it)},getLineHandleVisualStart:function(it){return typeof it=="number"&&(it=pn(this,it)),ki(it)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(it){return we(this,it)},getCursor:function(it){var st=this.sel.primary(),dt;return it==null||it=="head"?dt=st.head:it=="anchor"?dt=st.anchor:it=="end"||it=="to"||it===!1?dt=st.to():dt=st.from(),dt},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ss(function(it,st,dt){Mh(this,we(this,typeof it=="number"?Qt(it,st||0):it),null,dt)}),setSelection:Ss(function(it,st,dt){Mh(this,we(this,it),we(this,st||it),dt)}),extendSelection:Ss(function(it,st,dt){qc(this,we(this,it),st&&we(this,st),dt)}),extendSelections:Ss(function(it,st){zp(this,Vn(this,it),st)}),extendSelectionsBy:Ss(function(it,st){var dt=jn(this.sel.ranges,it);zp(this,Vn(this,dt),st)}),setSelections:Ss(function(it,st,dt){if(it.length){for(var ht=[],gt=0;gt<it.length;gt++)ht[gt]=new rr(we(this,it[gt].anchor),we(this,it[gt].head));st==null&&(st=Math.min(it.length-1,this.sel.primIndex)),Zs(this,gl(this.cm,ht,st),dt)}}),addSelection:Ss(function(it,st,dt){var ht=this.sel.ranges.slice(0);ht.push(new rr(we(this,it),we(this,st||it))),Zs(this,gl(this.cm,ht,ht.length-1),dt)}),getSelection:function(it){for(var st=this.sel.ranges,dt,ht=0;ht<st.length;ht++){var gt=me(this,st[ht].from(),st[ht].to());dt=dt?dt.concat(gt):gt}return it===!1?dt:dt.join(it||this.lineSeparator())},getSelections:function(it){for(var st=[],dt=this.sel.ranges,ht=0;ht<dt.length;ht++){var gt=me(this,dt[ht].from(),dt[ht].to());it!==!1&&(gt=gt.join(it||this.lineSeparator())),st[ht]=gt}return st},replaceSelection:function(it,st,dt){for(var ht=[],gt=0;gt<this.sel.ranges.length;gt++)ht[gt]=it;this.replaceSelections(ht,st,dt||"+input")},replaceSelections:Ss(function(it,st,dt){for(var ht=[],gt=this.sel,Pt=0;Pt<gt.ranges.length;Pt++){var Ft=gt.ranges[Pt];ht[Pt]={from:Ft.from(),to:Ft.to(),text:this.splitLines(it[Pt]),origin:dt}}for(var Rt=st&&st!="end"&&Qd(this,ht,st),Ot=ht.length-1;Ot>=0;Ot--)Hu(this,ht[Ot]);Rt?$c(this,Rt):this.cm&&uu(this.cm)}),undo:Ss(function(){ac(this,"undo")}),redo:Ss(function(){ac(this,"redo")}),undoSelection:Ss(function(){ac(this,"undo",!0)}),redoSelection:Ss(function(){ac(this,"redo",!0)}),setExtending:function(it){this.extend=it},getExtending:function(){return this.extend},historySize:function(){for(var it=this.history,st=0,dt=0,ht=0;ht<it.done.length;ht++)it.done[ht].ranges||++st;for(var gt=0;gt<it.undone.length;gt++)it.undone[gt].ranges||++dt;return{undo:st,redo:dt}},clearHistory:function(){var it=this;this.history=new fd(this.history.maxGeneration),Tl(this,function(st){return st.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:cu(this.history.done),undone:cu(this.history.undone)}},setHistory:function(it){var st=this.history=new fd(this.history.maxGeneration);st.done=cu(it.done.slice(0),null,!0),st.undone=cu(it.undone.slice(0),null,!0)},setGutterMarker:Ss(function(it,st,dt){return Nh(this,it,"gutter",function(ht){var gt=ht.gutterMarkers||(ht.gutterMarkers={});return gt[st]=dt,!dt&&Et(gt)&&(ht.gutterMarkers=null),!0})}),clearGutter:Ss(function(it){var st=this;this.iter(function(dt){dt.gutterMarkers&&dt.gutterMarkers[it]&&Nh(st,dt,"gutter",function(){return dt.gutterMarkers[it]=null,Et(dt.gutterMarkers)&&(dt.gutterMarkers=null),!0})})}),lineInfo:function(it){var st;if(typeof it=="number"){if(!an(this,it)||(st=it,it=pn(this,it),!it))return null}else if(st=Wt(it),st==null)return null;return{line:st,handle:it,text:it.text,gutterMarkers:it.gutterMarkers,textClass:it.textClass,bgClass:it.bgClass,wrapClass:it.wrapClass,widgets:it.widgets}},addLineClass:Ss(function(it,st,dt){return Nh(this,it,st=="gutter"?"gutter":"class",function(ht){var gt=st=="text"?"textClass":st=="background"?"bgClass":st=="gutter"?"gutterClass":"wrapClass";if(!ht[gt])ht[gt]=dt;else{if(Gt(dt).test(ht[gt]))return!1;ht[gt]+=" "+dt}return!0})}),removeLineClass:Ss(function(it,st,dt){return Nh(this,it,st=="gutter"?"gutter":"class",function(ht){var gt=st=="text"?"textClass":st=="background"?"bgClass":st=="gutter"?"gutterClass":"wrapClass",Pt=ht[gt];if(Pt)if(dt==null)ht[gt]=null;else{var Ft=Pt.match(Gt(dt));if(!Ft)return!1;var Rt=Ft.index+Ft[0].length;ht[gt]=Pt.slice(0,Ft.index)+(!Ft.index||Rt==Pt.length?"":" ")+Pt.slice(Rt)||null}else return!1;return!0})}),addLineWidget:Ss(function(it,st,dt){return tf(this,it,st,dt)}),removeLineWidget:function(it){it.clear()},markText:function(it,st,dt){return Th(this,we(this,it),we(this,st),dt,dt&&dt.type||"range")},setBookmark:function(it,st){var dt={replacedWith:st&&(st.nodeType==null?st.widget:st),insertLeft:st&&st.insertLeft,clearWhenEmpty:!1,shared:st&&st.shared,handleMouseEvents:st&&st.handleMouseEvents};return it=we(this,it),Th(this,it,it,dt,"bookmark")},findMarksAt:function(it){it=we(this,it);var st=[],dt=pn(this,it.line).markedSpans;if(dt)for(var ht=0;ht<dt.length;++ht){var gt=dt[ht];(gt.from==null||gt.from<=it.ch)&&(gt.to==null||gt.to>=it.ch)&&st.push(gt.marker.parent||gt.marker)}return st},findMarks:function(it,st,dt){it=we(this,it),st=we(this,st);var ht=[],gt=it.line;return this.iter(it.line,st.line+1,function(Pt){var Ft=Pt.markedSpans;if(Ft)for(var Rt=0;Rt<Ft.length;Rt++){var Ot=Ft[Rt];!(Ot.to!=null&&gt==it.line&&it.ch>=Ot.to||Ot.from==null&&gt!=it.line||Ot.from!=null&&gt==st.line&&Ot.from>=st.ch)&&(!dt||dt(Ot.marker))&&ht.push(Ot.marker.parent||Ot.marker)}++gt}),ht},getAllMarks:function(){var it=[];return this.iter(function(st){var dt=st.markedSpans;if(dt)for(var ht=0;ht<dt.length;++ht)dt[ht].from!=null&&it.push(dt[ht].marker)}),it},posFromIndex:function(it){var st,dt=this.first,ht=this.lineSeparator().length;return this.iter(function(gt){var Pt=gt.text.length+ht;if(Pt>it)return st=it,!0;it-=Pt,++dt}),we(this,Qt(dt,st))},indexFromPos:function(it){it=we(this,it);var st=it.ch;if(it.line<this.first||it.ch<0)return 0;var dt=this.lineSeparator().length;return this.iter(this.first,it.line,function(ht){st+=ht.text.length+dt}),st},copy:function(it){var st=new _s(de(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return st.scrollTop=this.scrollTop,st.scrollLeft=this.scrollLeft,st.sel=this.sel,st.extend=!1,it&&(st.history.undoDepth=this.history.undoDepth,st.setHistory(this.getHistory())),st},linkedDoc:function(it){it||(it={});var st=this.first,dt=this.first+this.size;it.from!=null&&it.from>st&&(st=it.from),it.to!=null&&it.to<dt&&(dt=it.to);var ht=new _s(de(this,st,dt),it.mode||this.modeOption,st,this.lineSep,this.direction);return it.sharedHist&&(ht.history=this.history),(this.linked||(this.linked=[])).push({doc:ht,sharedHist:it.sharedHist}),ht.linked=[{doc:this,isParent:!0,sharedHist:it.sharedHist}],Zp(ht,dg(this)),ht},unlinkDoc:function(it){if(it instanceof Uo&&(it=it.doc),this.linked)for(var st=0;st<this.linked.length;++st){var dt=this.linked[st];if(dt.doc==it){this.linked.splice(st,1),it.unlinkDoc(this),cg(dg(this));break}}if(it.history==this.history){var ht=[it.id];Tl(it,function(gt){return ht.push(gt.id)},!0),it.history=new fd(null),it.history.done=cu(this.history.done,ht),it.history.undone=cu(this.history.undone,ht)}},iterLinkedDocs:function(it){Tl(this,it)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(it){return this.lineSep?it.split(this.lineSep):ro(it)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Ss(function(it){it!="rtl"&&(it="ltr"),it!=this.direction&&(this.direction=it,this.iter(function(st){return st.order=null}),this.cm&&$0(this.cm))})}),_s.prototype.eachLine=_s.prototype.iter;var lc=0;function fg(it){var st=this;if(Jp(st),!(Hi(st,it)||ts(st.display,it))){Ki(it),ge&&(lc=+new Date);var dt=na(st,it,!0),ht=it.dataTransfer.files;if(!(!dt||st.isReadOnly()))if(ht&&ht.length&&window.FileReader&&window.File)for(var gt=ht.length,Pt=Array(gt),Ft=0,Rt=function(){++Ft==gt&&hs(st,function(){dt=we(st.doc,dt);var Oe={from:dt,to:dt,text:st.doc.splitLines(Pt.filter(function(wn){return wn!=null}).join(st.doc.lineSeparator())),origin:"paste"};Hu(st.doc,Oe),$c(st.doc,du(we(st.doc,dt),we(st.doc,_u(Oe))))})()},Ot=function(Oe,wn){if(st.options.allowDropFileTypes&&tn(st.options.allowDropFileTypes,Oe.type)==-1){Rt();return}var Nn=new FileReader;Nn.onerror=function(){return Rt()},Nn.onload=function(){var Wn=Nn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Wn)){Rt();return}Pt[wn]=Wn,Rt()},Nn.readAsText(Oe)},Ut=0;Ut<ht.length;Ut++)Ot(ht[Ut],Ut);else{if(st.state.draggingText&&st.doc.sel.contains(dt)>-1){st.state.draggingText(it),setTimeout(function(){return st.display.input.focus()},20);return}try{var xe=it.dataTransfer.getData("Text");if(xe){var Jt;if(st.state.draggingText&&!st.state.draggingText.copy&&(Jt=st.listSelections()),Eh(st.doc,du(dt,dt)),Jt)for(var _e=0;_e<Jt.length;++_e)Fh(st.doc,"",Jt[_e].anchor,Jt[_e].head,"drag");st.replaceSelection(xe,"around","paste"),st.display.input.focus()}}catch(Oe){}}}}function Kp(it,st){if(ge&&(!it.state.draggingText||+new Date-lc<100)){Ro(st);return}if(!(Hi(it,st)||ts(it.display,st))&&(st.dataTransfer.setData("Text",it.getSelection()),st.dataTransfer.effectAllowed="copyMove",st.dataTransfer.setDragImage&&!Ze)){var dt=te("img",null,null,"position: fixed; left: 0; top: 0;");dt.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",$t&&(dt.width=dt.height=1,it.display.wrapper.appendChild(dt),dt._top=dt.offsetTop),st.dataTransfer.setDragImage(dt,0,0),$t&&dt.parentNode.removeChild(dt)}}function Xp(it,st){var dt=na(it,st);if(dt){var ht=document.createDocumentFragment();Ao(it,dt,ht),it.display.dragCursor||(it.display.dragCursor=te("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),it.display.lineSpace.insertBefore(it.display.dragCursor,it.display.cursorDiv)),ie(it.display.dragCursor,ht)}}function Jp(it){it.display.dragCursor&&(it.display.lineSpace.removeChild(it.display.dragCursor),it.display.dragCursor=null)}function Qp(it){if(document.getElementsByClassName){for(var st=document.getElementsByClassName("CodeMirror"),dt=[],ht=0;ht<st.length;ht++){var gt=st[ht].CodeMirror;gt&&dt.push(gt)}dt.length&&dt[0].operation(function(){for(var Pt=0;Pt<dt.length;Pt++)it(dt[Pt])})}}var gg=!1;function Va(){gg||(yd(),gg=!0)}function yd(){var it;fn(window,"resize",function(){it==null&&(it=setTimeout(function(){it=null,Qp(pg)},100))}),fn(window,"blur",function(){return Qp(xh)})}function pg(it){var st=it.display;st.cachedCharWidth=st.cachedTextHeight=st.cachedPaddingH=null,st.scrollbarsClipped=!1,it.setSize()}for(var Yl={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"},uc=0;uc<10;uc++)Yl[uc+48]=Yl[uc+96]=String(uc);for(var ef=65;ef<=90;ef++)Yl[ef]=String.fromCharCode(ef);for(var hc=1;hc<=12;hc++)Yl[hc+111]=Yl[hc+63235]="F"+hc;var Ma={};Ma.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"},Ma.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"},Ma.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"},Ma.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"]},Ma.default=ct?Ma.macDefault:Ma.pcDefault;function mg(it){var st=it.split(/-(?!$)/);it=st[st.length-1];for(var dt,ht,gt,Pt,Ft=0;Ft<st.length-1;Ft++){var Rt=st[Ft];if(/^(cmd|meta|m)$/i.test(Rt))Pt=!0;else if(/^a(lt)?$/i.test(Rt))dt=!0;else if(/^(c|ctrl|control)$/i.test(Rt))ht=!0;else if(/^s(hift)?$/i.test(Rt))gt=!0;else throw new Error("Unrecognized modifier name: "+Rt)}return dt&&(it="Alt-"+it),ht&&(it="Ctrl-"+it),Pt&&(it="Cmd-"+it),gt&&(it="Shift-"+it),it}function vg(it){var st={};for(var dt in it)if(it.hasOwnProperty(dt)){var ht=it[dt];if(/^(name|fallthrough|(de|at)tach)$/.test(dt))continue;if(ht=="..."){delete it[dt];continue}for(var gt=jn(dt.split(" "),mg),Pt=0;Pt<gt.length;Pt++){var Ft=void 0,Rt=void 0;Pt==gt.length-1?(Rt=gt.join(" "),Ft=ht):(Rt=gt.slice(0,Pt+1).join(" "),Ft="...");var Ot=st[Rt];if(!Ot)st[Rt]=Ft;else if(Ot!=Ft)throw new Error("Inconsistent bindings for "+Rt)}delete it[dt]}for(var Ut in st)it[Ut]=st[Ut];return it}function il(it,st,dt,ht){st=Ah(st);var gt=st.call?st.call(it,ht):st[it];if(gt===!1)return"nothing";if(gt==="...")return"multi";if(gt!=null&&dt(gt))return"handled";if(st.fallthrough){if(Object.prototype.toString.call(st.fallthrough)!="[object Array]")return il(it,st.fallthrough,dt,ht);for(var Pt=0;Pt<st.fallthrough.length;Pt++){var Ft=il(it,st.fallthrough[Pt],dt,ht);if(Ft)return Ft}}}function Sd(it){var st=typeof it=="string"?it:Yl[it.keyCode];return st=="Ctrl"||st=="Alt"||st=="Shift"||st=="Mod"}function yg(it,st,dt){var ht=it;return st.altKey&&ht!="Alt"&&(it="Alt-"+it),(Lt?st.metaKey:st.ctrlKey)&&ht!="Ctrl"&&(it="Ctrl-"+it),(Lt?st.ctrlKey:st.metaKey)&&ht!="Mod"&&(it="Cmd-"+it),!dt&&st.shiftKey&&ht!="Shift"&&(it="Shift-"+it),it}function qp(it,st){if($t&&it.keyCode==34&&it.char)return!1;var dt=Yl[it.keyCode];return dt==null||it.altGraphKey?!1:(it.keyCode==3&&it.code&&(dt=it.code),yg(dt,it,st))}function Ah(it){return typeof it=="string"?Ma[it]:it}function Ea(it,st){for(var dt=it.doc.sel.ranges,ht=[],gt=0;gt<dt.length;gt++){for(var Pt=st(dt[gt]);ht.length&&Zt(Pt.from,ee(ht).to)<=0;){var Ft=ht.pop();if(Zt(Ft.from,Pt.from)<0){Pt.from=Ft.from;break}}ht.push(Pt)}Qo(it,function(){for(var Rt=ht.length-1;Rt>=0;Rt--)Fh(it.doc,"",ht[Rt].from,ht[Rt].to,"+delete");uu(it)})}function Sg(it,st,dt){var ht=sn(it.text,st+dt,dt);return ht<0||ht>it.text.length?null:ht}function Jr(it,st,dt){var ht=Sg(it,st.ch,dt);return ht==null?null:new Qt(st.line,ht,dt<0?"after":"before")}function dc(it,st,dt,ht,gt){if(it){st.doc.direction=="rtl"&&(gt=-gt);var Pt=An(dt,st.doc.direction);if(Pt){var Ft=gt<0?ee(Pt):Pt[0],Rt=gt<0==(Ft.level==1),Ot=Rt?"after":"before",Ut;if(Ft.level>0||st.doc.direction=="rtl"){var xe=Gl(st,dt);Ut=gt<0?dt.text.length-1:0;var Jt=ja(st,xe,Ut).top;Ut=He(function(_e){return ja(st,xe,_e).top==Jt},gt<0==(Ft.level==1)?Ft.from:Ft.to-1,Ut),Ot=="before"&&(Ut=Sg(dt,Ut,1))}else Ut=gt<0?Ft.to:Ft.from;return new Qt(ht,Ut,Ot)}}return new Qt(ht,gt<0?dt.text.length:0,gt<0?"before":"after")}function nf(it,st,dt,ht){var gt=An(st,it.doc.direction);if(!gt)return Jr(st,dt,ht);dt.ch>=st.text.length?(dt.ch=st.text.length,dt.sticky="before"):dt.ch<=0&&(dt.ch=0,dt.sticky="after");var Pt=en(gt,dt.ch,dt.sticky),Ft=gt[Pt];if(it.doc.direction=="ltr"&&Ft.level%2==0&&(ht>0?Ft.to>dt.ch:Ft.from<dt.ch))return Jr(st,dt,ht);var Rt=function(ui,Mi){return Sg(st,ui instanceof Qt?ui.ch:ui,Mi)},Ot,Ut=function(ui){return it.options.lineWrapping?(Ot=Ot||Gl(it,st),_a(it,st,Ot,ui)):{begin:0,end:st.text.length}},xe=Ut(dt.sticky=="before"?Rt(dt,-1):dt.ch);if(it.doc.direction=="rtl"||Ft.level==1){var Jt=Ft.level==1==ht<0,_e=Rt(dt,Jt?1:-1);if(_e!=null&&(Jt?_e<=Ft.to&&_e<=xe.end:_e>=Ft.from&&_e>=xe.begin)){var Oe=Jt?"before":"after";return new Qt(dt.line,_e,Oe)}}var wn=function(ui,Mi,xi){for(var Ti=function(Pr,cs){return cs?new Qt(dt.line,Rt(Pr,1),"before"):new Qt(dt.line,Pr,"after")};ui>=0&&ui<gt.length;ui+=Mi){var eo=gt[ui],Si=Mi>0==(eo.level!=1),wo=Si?xi.begin:Rt(xi.end,-1);if(eo.from<=wo&&wo<eo.to||(wo=Si?eo.from:Rt(eo.to,-1),xi.begin<=wo&&wo<xi.end))return Ti(wo,Si)}},Nn=wn(Pt+ht,ht,xe);if(Nn)return Nn;var Wn=ht>0?xe.end:Rt(xe.begin,-1);return Wn!=null&&!(ht>0&&Wn==st.text.length)&&(Nn=wn(ht>0?0:gt.length-1,ht,Ut(Wn)),Nn)?Nn:null}var Wu={selectAll:Xr,singleSelection:function(it){return it.setSelection(it.getCursor("anchor"),it.getCursor("head"),je)},killLine:function(it){return Ea(it,function(st){if(st.empty()){var dt=pn(it.doc,st.head.line).text.length;return st.head.ch==dt&&st.head.line<it.lastLine()?{from:st.head,to:Qt(st.head.line+1,0)}:{from:st.head,to:Qt(st.head.line,dt)}}else return{from:st.from(),to:st.to()}})},deleteLine:function(it){return Ea(it,function(st){return{from:Qt(st.from().line,0),to:we(it.doc,Qt(st.to().line+1,0))}})},delLineLeft:function(it){return Ea(it,function(st){return{from:Qt(st.from().line,0),to:st.from()}})},delWrappedLineLeft:function(it){return Ea(it,function(st){var dt=it.charCoords(st.head,"div").top+5,ht=it.coordsChar({left:0,top:dt},"div");return{from:ht,to:st.from()}})},delWrappedLineRight:function(it){return Ea(it,function(st){var dt=it.charCoords(st.head,"div").top+5,ht=it.coordsChar({left:it.display.lineDiv.offsetWidth+100,top:dt},"div");return{from:st.from(),to:ht}})},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(Qt(it.firstLine(),0))},goDocEnd:function(it){return it.extendSelection(Qt(it.lastLine()))},goLineStart:function(it){return it.extendSelectionsBy(function(st){return xd(it,st.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(it){return it.extendSelectionsBy(function(st){return xg(it,st.head)},{origin:"+move",bias:1})},goLineEnd:function(it){return it.extendSelectionsBy(function(st){return wd(it,st.head.line)},{origin:"+move",bias:-1})},goLineRight:function(it){return it.extendSelectionsBy(function(st){var dt=it.cursorCoords(st.head,"div").top+5;return it.coordsChar({left:it.display.lineDiv.offsetWidth+100,top:dt},"div")},Tn)},goLineLeft:function(it){return it.extendSelectionsBy(function(st){var dt=it.cursorCoords(st.head,"div").top+5;return it.coordsChar({left:0,top:dt},"div")},Tn)},goLineLeftSmart:function(it){return it.extendSelectionsBy(function(st){var dt=it.cursorCoords(st.head,"div").top+5,ht=it.coordsChar({left:0,top:dt},"div");return ht.ch<it.getLine(ht.line).search(/\S/)?xg(it,st.head):ht},Tn)},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 st=[],dt=it.listSelections(),ht=it.options.tabSize,gt=0;gt<dt.length;gt++){var Pt=dt[gt].from(),Ft=ce(it.getLine(Pt.line),Pt.ch,ht);st.push(Qn(ht-Ft%ht))}it.replaceSelections(st)},defaultTab:function(it){it.somethingSelected()?it.indentSelection("add"):it.execCommand("insertTab")},transposeChars:function(it){return Qo(it,function(){for(var st=it.listSelections(),dt=[],ht=0;ht<st.length;ht++)if(st[ht].empty()){var gt=st[ht].head,Pt=pn(it.doc,gt.line).text;if(Pt){if(gt.ch==Pt.length&&(gt=new Qt(gt.line,gt.ch-1)),gt.ch>0)gt=new Qt(gt.line,gt.ch+1),it.replaceRange(Pt.charAt(gt.ch-1)+Pt.charAt(gt.ch-2),Qt(gt.line,gt.ch-2),gt,"+transpose");else if(gt.line>it.doc.first){var Ft=pn(it.doc,gt.line-1).text;Ft&&(gt=new Qt(gt.line,1),it.replaceRange(Pt.charAt(0)+it.doc.lineSeparator()+Ft.charAt(Ft.length-1),Qt(gt.line-1,Ft.length-1),gt,"+transpose"))}}dt.push(new rr(gt,gt))}it.setSelections(dt)})},newlineAndIndent:function(it){return Qo(it,function(){for(var st=it.listSelections(),dt=st.length-1;dt>=0;dt--)it.replaceRange(it.doc.lineSeparator(),st[dt].anchor,st[dt].head,"+input");st=it.listSelections();for(var ht=0;ht<st.length;ht++)it.indentLine(st[ht].from().line,null,!0);uu(it)})},openLine:function(it){return it.replaceSelection(`
`,"start")},toggleOverwrite:function(it){return it.toggleOverwrite()}};function xd(it,st){var dt=pn(it.doc,st),ht=ki(dt);return ht!=dt&&(st=Wt(ht)),dc(!0,it,ht,st,1)}function wd(it,st){var dt=pn(it.doc,st),ht=Bi(dt);return ht!=dt&&(st=Wt(ht)),dc(!0,it,dt,st,-1)}function xg(it,st){var dt=xd(it,st.line),ht=pn(it.doc,dt.line),gt=An(ht,it.doc.direction);if(!gt||gt[0].level==0){var Pt=Math.max(dt.ch,ht.text.search(/\S/)),Ft=st.line==dt.line&&st.ch<=Pt&&st.ch;return Qt(dt.line,Ft?0:Pt,dt.sticky)}return dt}function Pd(it,st,dt){if(typeof st=="string"&&(st=Wu[st],!st))return!1;it.display.input.ensurePolled();var ht=it.display.shift,gt=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),dt&&(it.display.shift=!1),gt=st(it)!=Dn}finally{it.display.shift=ht,it.state.suppressEdits=!1}return gt}function wg(it,st,dt){for(var ht=0;ht<it.state.keyMaps.length;ht++){var gt=il(st,it.state.keyMaps[ht],dt,it);if(gt)return gt}return it.options.extraKeys&&il(st,it.options.extraKeys,dt,it)||il(st,it.options.keyMap,dt,it)}var Zl=new Kt;function Bh(it,st,dt,ht){var gt=it.state.keySeq;if(gt){if(Sd(st))return"handled";if(/\'$/.test(st)?it.state.keySeq=null:Zl.set(50,function(){it.state.keySeq==gt&&(it.state.keySeq=null,it.display.input.reset())}),of(it,gt+" "+st,dt,ht))return!0}return of(it,st,dt,ht)}function of(it,st,dt,ht){var gt=wg(it,st,ht);return gt=="multi"&&(it.state.keySeq=st),gt=="handled"&&yi(it,"keyHandled",it,st,dt),(gt=="handled"||gt=="multi")&&(Ki(dt),ir(it)),!!gt}function rf(it,st){var dt=qp(st,!0);return dt?st.shiftKey&&!it.state.keySeq?Bh(it,"Shift-"+dt,st,function(ht){return Pd(it,ht,!0)})||Bh(it,dt,st,function(ht){if(typeof ht=="string"?/^go[A-Z]/.test(ht):ht.motion)return Pd(it,ht)}):Bh(it,dt,st,function(ht){return Pd(it,ht)}):!1}function sf(it,st,dt){return Bh(it,"'"+dt+"'",st,function(ht){return Pd(it,ht,!0)})}var Dh=null;function Pg(it){var st=this;if(!(it.target&&it.target!=st.display.input.getField())&&(st.curOp.focus=Ye(),!Hi(st,it))){ge&&re<11&&it.keyCode==27&&(it.returnValue=!1);var dt=it.keyCode;st.display.shift=dt==16||it.shiftKey;var ht=rf(st,it);$t&&(Dh=ht?dt:null,!ht&&dt==88&&!Go&&(ct?it.metaKey:it.ctrlKey)&&st.replaceSelection("",null,"cut")),St&&!ct&&!ht&&dt==46&&it.shiftKey&&!it.ctrlKey&&document.execCommand&&document.execCommand("cut"),dt==18&&!/\bCodeMirror-crosshair\b/.test(st.display.lineDiv.className)&&Cg(st)}}function Cg(it){var st=it.display.lineDiv;hn(st,"CodeMirror-crosshair");function dt(ht){(ht.keyCode==18||!ht.altKey)&&(jt(st,"CodeMirror-crosshair"),Pi(document,"keyup",dt),Pi(document,"mouseover",dt))}fn(document,"keyup",dt),fn(document,"mouseover",dt)}function Lg(it){it.keyCode==16&&(this.doc.sel.shift=!1),Hi(this,it)}function Al(it){var st=this;if(!(it.target&&it.target!=st.display.input.getField())&&!(ts(st.display,it)||Hi(st,it)||it.ctrlKey&&!it.altKey||ct&&it.metaKey)){var dt=it.keyCode,ht=it.charCode;if($t&&dt==Dh){Dh=null,Ki(it);return}if(!($t&&(!it.which||it.which<10)&&rf(st,it))){var gt=String.fromCharCode(ht==null?dt:ht);gt!="\b"&&(sf(st,it,gt)||st.display.input.onKeyPress(it))}}}var $p=400,kg=function(it,st,dt){this.time=it,this.pos=st,this.button=dt};kg.prototype.compare=function(it,st,dt){return this.time+$p>it&&Zt(st,this.pos)==0&&dt==this.button};var Cd,Oh;function Mg(it,st){var dt=+new Date;return Oh&&Oh.compare(dt,it,st)?(Cd=Oh=null,"triple"):Cd&&Cd.compare(dt,it,st)?(Oh=new kg(dt,it,st),Cd=null,"double"):(Cd=new kg(dt,it,st),Oh=null,"single")}function Bl(it){var st=this,dt=st.display;if(!(Hi(st,it)||dt.activeTouch&&dt.input.supportsTouch())){if(dt.input.ensurePolled(),dt.shift=it.shiftKey,ts(dt,it)){se||(dt.scroller.draggable=!1,setTimeout(function(){return dt.scroller.draggable=!0},100));return}if(!uf(st,it)){var ht=na(st,it),gt=$o(it),Pt=ht?Mg(ht,gt):"single";window.focus(),gt==1&&st.state.selectingText&&st.state.selectingText(it),!(ht&&Eg(st,gt,ht,Pt,it))&&(gt==1?ht?tm(st,ht,Pt,it):er(it)==dt.scroller&&Ki(it):gt==2?(ht&&qc(st.doc,ht),setTimeout(function(){return dt.input.focus()},20)):gt==3&&(bt?st.display.input.onContextMenu(it):kr(st)))}}}function Eg(it,st,dt,ht,gt){var Pt="Click";return ht=="double"?Pt="Double"+Pt:ht=="triple"&&(Pt="Triple"+Pt),Pt=(st==1?"Left":st==2?"Middle":"Right")+Pt,Bh(it,yg(Pt,gt),gt,function(Ft){if(typeof Ft=="string"&&(Ft=Wu[Ft]),!Ft)return!1;var Rt=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),Rt=Ft(it,dt)!=Dn}finally{it.state.suppressEdits=!1}return Rt})}function af(it,st,dt){var ht=it.getOption("configureMouse"),gt=ht?ht(it,st,dt):{};if(gt.unit==null){var Pt=lt?dt.shiftKey&&dt.metaKey:dt.altKey;gt.unit=Pt?"rectangle":st=="single"?"char":st=="double"?"word":"line"}return(gt.extend==null||it.doc.extend)&&(gt.extend=it.doc.extend||dt.shiftKey),gt.addNew==null&&(gt.addNew=ct?dt.metaKey:dt.ctrlKey),gt.moveOnDrag==null&&(gt.moveOnDrag=!(ct?dt.altKey:dt.ctrlKey)),gt}function tm(it,st,dt,ht){ge?setTimeout(pi(mr,it),0):it.curOp.focus=Ye();var gt=af(it,dt,ht),Pt=it.doc.sel,Ft;it.options.dragDrop&&Sr&&!it.isReadOnly()&&dt=="single"&&(Ft=Pt.contains(st))>-1&&(Zt((Ft=Pt.ranges[Ft]).from(),st)<0||st.xRel>0)&&(Zt(Ft.to(),st)>0||st.xRel<0)?bg(it,ht,st,gt):ev(it,ht,st,gt)}function bg(it,st,dt,ht){var gt=it.display,Pt=!1,Ft=hs(it,function(Ut){se&&(gt.scroller.draggable=!1),it.state.draggingText=!1,Pi(gt.wrapper.ownerDocument,"mouseup",Ft),Pi(gt.wrapper.ownerDocument,"mousemove",Rt),Pi(gt.scroller,"dragstart",Ot),Pi(gt.scroller,"drop",Ft),Pt||(Ki(Ut),ht.addNew||qc(it.doc,dt,null,null,ht.extend),se&&!Ze||ge&&re==9?setTimeout(function(){gt.wrapper.ownerDocument.body.focus({preventScroll:!0}),gt.input.focus()},20):gt.input.focus())}),Rt=function(Ut){Pt=Pt||Math.abs(st.clientX-Ut.clientX)+Math.abs(st.clientY-Ut.clientY)>=10},Ot=function(){return Pt=!0};se&&(gt.scroller.draggable=!0),it.state.draggingText=Ft,Ft.copy=!ht.moveOnDrag,gt.scroller.dragDrop&&gt.scroller.dragDrop(),fn(gt.wrapper.ownerDocument,"mouseup",Ft),fn(gt.wrapper.ownerDocument,"mousemove",Rt),fn(gt.scroller,"dragstart",Ot),fn(gt.scroller,"drop",Ft),kr(it),setTimeout(function(){return gt.input.focus()},20)}function Fg(it,st,dt){if(dt=="char")return new rr(st,st);if(dt=="word")return it.findWordAt(st);if(dt=="line")return new rr(Qt(st.line,0),we(it.doc,Qt(st.line+1,0)));var ht=dt(it,st);return new rr(ht.from,ht.to)}function ev(it,st,dt,ht){var gt=it.display,Pt=it.doc;Ki(st);var Ft,Rt,Ot=Pt.sel,Ut=Ot.ranges;if(ht.addNew&&!ht.extend?(Rt=Pt.sel.contains(dt),Rt>-1?Ft=Ut[Rt]:Ft=new rr(dt,dt)):(Ft=Pt.sel.primary(),Rt=Pt.sel.primIndex),ht.unit=="rectangle")ht.addNew||(Ft=new rr(dt,dt)),dt=na(it,st,!0,!0),Rt=-1;else{var xe=Fg(it,dt,ht.unit);ht.extend?Ft=Qc(Ft,xe.anchor,xe.head,ht.extend):Ft=xe}ht.addNew?Rt==-1?(Rt=Ut.length,Zs(Pt,gl(it,Ut.concat([Ft]),Rt),{scroll:!1,origin:"*mouse"})):Ut.length>1&&Ut[Rt].empty()&&ht.unit=="char"&&!ht.extend?(Zs(Pt,gl(it,Ut.slice(0,Rt).concat(Ut.slice(Rt+1)),0),{scroll:!1,origin:"*mouse"}),Ot=Pt.sel):Gu(Pt,Rt,Ft,gn):(Rt=0,Zs(Pt,new el([Ft],0),gn),Ot=Pt.sel);var Jt=dt;function _e(xi){if(Zt(Jt,xi)!=0)if(Jt=xi,ht.unit=="rectangle"){for(var Ti=[],eo=it.options.tabSize,Si=ce(pn(Pt,dt.line).text,dt.ch,eo),wo=ce(pn(Pt,xi.line).text,xi.ch,eo),Pr=Math.min(Si,wo),cs=Math.max(Si,wo),Tr=Math.min(dt.line,xi.line),ya=Math.min(it.lastLine(),Math.max(dt.line,xi.line));Tr<=ya;Tr++){var Ks=pn(Pt,Tr).text,rs=Jn(Ks,Pr,eo);Pr==cs?Ti.push(new rr(Qt(Tr,rs),Qt(Tr,rs))):Ks.length>rs&&Ti.push(new rr(Qt(Tr,rs),Qt(Tr,Jn(Ks,cs,eo))))}Ti.length||Ti.push(new rr(dt,dt)),Zs(Pt,gl(it,Ot.ranges.slice(0,Rt).concat(Ti),Rt),{origin:"*mouse",scroll:!1}),it.scrollIntoView(xi)}else{var ba=Ft,zs=Fg(it,xi,ht.unit),ss=ba.anchor,Xo;Zt(zs.anchor,ss)>0?(Xo=zs.head,ss=ln(ba.from(),zs.anchor)):(Xo=zs.anchor,ss=Hn(ba.to(),zs.head));var Rr=Ot.ranges.slice(0);Rr[Rt]=em(it,new rr(we(Pt,ss),Xo)),Zs(Pt,gl(it,Rr,Rt),gn)}}var Oe=gt.wrapper.getBoundingClientRect(),wn=0;function Nn(xi){var Ti=++wn,eo=na(it,xi,!0,ht.unit=="rectangle");if(eo)if(Zt(eo,Jt)!=0){it.curOp.focus=Ye(),_e(eo);var Si=Eo(gt,Pt);(eo.line>=Si.to||eo.line<Si.from)&&setTimeout(hs(it,function(){wn==Ti&&Nn(xi)}),150)}else{var wo=xi.clientY<Oe.top?-20:xi.clientY>Oe.bottom?20:0;wo&&setTimeout(hs(it,function(){wn==Ti&&(gt.scroller.scrollTop+=wo,Nn(xi))}),50)}}function Wn(xi){it.state.selectingText=!1,wn=1/0,xi&&(Ki(xi),gt.input.focus()),Pi(gt.wrapper.ownerDocument,"mousemove",ui),Pi(gt.wrapper.ownerDocument,"mouseup",Mi),Pt.history.lastSelOrigin=null}var ui=hs(it,function(xi){xi.buttons===0||!$o(xi)?Wn(xi):Nn(xi)}),Mi=hs(it,Wn);it.state.selectingText=Mi,fn(gt.wrapper.ownerDocument,"mousemove",ui),fn(gt.wrapper.ownerDocument,"mouseup",Mi)}function em(it,st){var dt=st.anchor,ht=st.head,gt=pn(it.doc,dt.line);if(Zt(dt,ht)==0&&dt.sticky==ht.sticky)return st;var Pt=An(gt);if(!Pt)return st;var Ft=en(Pt,dt.ch,dt.sticky),Rt=Pt[Ft];if(Rt.from!=dt.ch&&Rt.to!=dt.ch)return st;var Ot=Ft+(Rt.from==dt.ch==(Rt.level!=1)?0:1);if(Ot==0||Ot==Pt.length)return st;var Ut;if(ht.line!=dt.line)Ut=(ht.line-dt.line)*(it.doc.direction=="ltr"?1:-1)>0;else{var xe=en(Pt,ht.ch,ht.sticky),Jt=xe-Ft||(ht.ch-dt.ch)*(Rt.level==1?-1:1);xe==Ot-1||xe==Ot?Ut=Jt<0:Ut=Jt>0}var _e=Pt[Ot+(Ut?-1:0)],Oe=Ut==(_e.level==1),wn=Oe?_e.from:_e.to,Nn=Oe?"after":"before";return dt.ch==wn&&dt.sticky==Nn?st:new rr(new Qt(dt.line,wn,Nn),ht)}function lf(it,st,dt,ht){var gt,Pt;if(st.touches)gt=st.touches[0].clientX,Pt=st.touches[0].clientY;else try{gt=st.clientX,Pt=st.clientY}catch(_e){return!1}if(gt>=Math.floor(it.display.gutters.getBoundingClientRect().right))return!1;ht&&Ki(st);var Ft=it.display,Rt=Ft.lineDiv.getBoundingClientRect();if(Pt>Rt.bottom||!oo(it,dt))return Yo(st);Pt-=Rt.top-Ft.viewOffset;for(var Ot=0;Ot<it.display.gutterSpecs.length;++Ot){var Ut=Ft.gutters.childNodes[Ot];if(Ut&&Ut.getBoundingClientRect().right>=gt){var xe=Ne(it.doc,Pt),Jt=it.display.gutterSpecs[Ot];return zi(it,dt,it,xe,Jt.className,st),Yo(st)}}}function uf(it,st){return lf(it,st,"gutterClick",!0)}function hf(it,st){ts(it.display,st)||nm(it,st)||Hi(it,st,"contextmenu")||bt||it.display.input.onContextMenu(st)}function nm(it,st){return oo(it,"gutterContextMenu")?lf(it,st,"gutterContextMenu",!1):!1}function df(it){it.display.wrapper.className=it.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+it.options.theme.replace(/(^|\s)\s*/g," cm-s-"),bu(it)}var Vu={toString:function(){return"CodeMirror.Init"}},Ng={},cc={};function im(it){var st=it.optionHandlers;function dt(ht,gt,Pt,Ft){it.defaults[ht]=gt,Pt&&(st[ht]=Ft?function(Rt,Ot,Ut){Ut!=Vu&&Pt(Rt,Ot,Ut)}:Pt)}it.defineOption=dt,it.Init=Vu,dt("value","",function(ht,gt){return ht.setValue(gt)},!0),dt("mode",null,function(ht,gt){ht.doc.modeOption=gt,xo(ht)},!0),dt("indentUnit",2,xo,!0),dt("indentWithTabs",!1),dt("smartIndent",!0),dt("tabSize",4,function(ht){qd(ht),bu(ht),wr(ht)},!0),dt("lineSeparator",null,function(ht,gt){if(ht.doc.lineSep=gt,!!gt){var Pt=[],Ft=ht.doc.first;ht.doc.iter(function(Ot){for(var Ut=0;;){var xe=Ot.text.indexOf(gt,Ut);if(xe==-1)break;Ut=xe+gt.length,Pt.push(Qt(Ft,xe))}Ft++});for(var Rt=Pt.length-1;Rt>=0;Rt--)Fh(ht.doc,gt,Pt[Rt],Qt(Pt[Rt].line,Pt[Rt].ch+gt.length))}}),dt("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(ht,gt,Pt){ht.state.specialChars=new RegExp(gt.source+(gt.test(" ")?"":"| "),"g"),Pt!=Vu&&ht.refresh()}),dt("specialCharPlaceholder",To,function(ht){return ht.refresh()},!0),dt("electricChars",!0),dt("inputStyle",nt?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),dt("spellcheck",!1,function(ht,gt){return ht.getInputField().spellcheck=gt},!0),dt("autocorrect",!1,function(ht,gt){return ht.getInputField().autocorrect=gt},!0),dt("autocapitalize",!1,function(ht,gt){return ht.getInputField().autocapitalize=gt},!0),dt("rtlMoveVisually",!pt),dt("wholeLineUpdateBefore",!0),dt("theme","default",function(ht){df(ht),Ha(ht)},!0),dt("keyMap","default",function(ht,gt,Pt){var Ft=Ah(gt),Rt=Pt!=Vu&&Ah(Pt);Rt&&Rt.detach&&Rt.detach(ht,Ft),Ft.attach&&Ft.attach(ht,Rt||null)}),dt("extraKeys",null),dt("configureMouse",null),dt("lineWrapping",!1,om,!0),dt("gutters",[],function(ht,gt){ht.display.gutterSpecs=ws(gt,ht.options.lineNumbers),Ha(ht)},!0),dt("fixedGutter",!0,function(ht,gt){ht.display.gutters.style.left=gt?Kd(ht.display)+"px":"0",ht.refresh()},!0),dt("coverGutterNextToScrollbar",!1,function(ht){return Tu(ht)},!0),dt("scrollbarStyle","native",function(ht){ig(ht),Tu(ht),ht.display.scrollbars.setScrollTop(ht.doc.scrollTop),ht.display.scrollbars.setScrollLeft(ht.doc.scrollLeft)},!0),dt("lineNumbers",!1,function(ht,gt){ht.display.gutterSpecs=ws(ht.options.gutters,gt),Ha(ht)},!0),dt("firstLineNumber",1,Ha,!0),dt("lineNumberFormatter",function(ht){return ht},Ha,!0),dt("showCursorWhenSelecting",!1,us,!0),dt("resetSelectionOnContextMenu",!0),dt("lineWiseCopyCut",!0),dt("pasteLinesPerSelection",!0),dt("selectionsMayTouch",!1),dt("readOnly",!1,function(ht,gt){gt=="nocursor"&&(xh(ht),ht.display.input.blur()),ht.display.input.readOnlyChanged(gt)}),dt("screenReaderLabel",null,function(ht,gt){gt=gt===""?null:gt,ht.display.input.screenReaderLabelChanged(gt)}),dt("disableInput",!1,function(ht,gt){gt||ht.display.input.reset()},!0),dt("dragDrop",!0,cf),dt("allowDropFileTypes",null),dt("cursorBlinkRate",530),dt("cursorScrollMargin",0),dt("cursorHeight",1,us,!0),dt("singleCursorHeightPerLine",!0,us,!0),dt("workTime",100),dt("workDelay",100),dt("flattenSpans",!0,qd,!0),dt("addModeClass",!1,qd,!0),dt("pollInterval",100),dt("undoDepth",200,function(ht,gt){return ht.doc.history.undoDepth=gt}),dt("historyEventDelay",1250),dt("viewportMargin",10,function(ht){return ht.refresh()},!0),dt("maxHighlightLength",1e4,qd,!0),dt("moveInputWithCursor",!0,function(ht,gt){gt||ht.display.input.resetPosition()}),dt("tabindex",null,function(ht,gt){return ht.display.input.getField().tabIndex=gt||""}),dt("autofocus",null),dt("direction","ltr",function(ht,gt){return ht.doc.setDirection(gt)},!0),dt("phrases",null)}function cf(it,st,dt){var ht=dt&&dt!=Vu;if(!st!=!ht){var gt=it.display.dragFunctions,Pt=st?fn:Pi;Pt(it.display.scroller,"dragstart",gt.start),Pt(it.display.scroller,"dragenter",gt.enter),Pt(it.display.scroller,"dragover",gt.over),Pt(it.display.scroller,"dragleave",gt.leave),Pt(it.display.scroller,"drop",gt.drop)}}function om(it){it.options.lineWrapping?(hn(it.display.wrapper,"CodeMirror-wrap"),it.display.sizer.style.minWidth="",it.display.sizerWidth=null):(jt(it.display.wrapper,"CodeMirror-wrap"),_o(it)),_i(it),wr(it),bu(it),setTimeout(function(){return Tu(it)},100)}function Uo(it,st){var dt=this;if(!(this instanceof Uo))return new Uo(it,st);this.options=st=st?yn(st):{},yn(Ng,st,!1);var ht=st.value;typeof ht=="string"?ht=new _s(ht,st.mode,null,st.lineSeparator,st.direction):st.mode&&(ht.modeOption=st.mode),this.doc=ht;var gt=new Uo.inputStyles[st.inputStyle](this),Pt=this.display=new ju(it,ht,gt,st);Pt.wrapper.CodeMirror=this,df(this),st.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ig(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 Kt,keySeq:null,specialChars:null},st.autofocus&&!nt&&Pt.input.focus(),ge&&re<11&&setTimeout(function(){return dt.display.input.reset(!0)},20),Ld(this),Va(),Au(this),this.curOp.forceUpdate=!0,Kc(this,ht),st.autofocus&&!nt||this.hasFocus()?setTimeout(function(){dt.hasFocus()&&!dt.state.focused&&Do(dt)},20):xh(this);for(var Ft in cc)cc.hasOwnProperty(Ft)&&cc[Ft](this,st[Ft],Vu);ns(this),st.finishInit&&st.finishInit(this);for(var Rt=0;Rt<Ih.length;++Rt)Ih[Rt](this);Bu(this),se&&st.lineWrapping&&getComputedStyle(Pt.lineDiv).textRendering=="optimizelegibility"&&(Pt.lineDiv.style.textRendering="auto")}Uo.defaults=Ng,Uo.optionHandlers=cc;function Ld(it){var st=it.display;fn(st.scroller,"mousedown",hs(it,Bl)),ge&&re<11?fn(st.scroller,"dblclick",hs(it,function(Ot){if(!Hi(it,Ot)){var Ut=na(it,Ot);if(!(!Ut||uf(it,Ot)||ts(it.display,Ot))){Ki(Ot);var xe=it.findWordAt(Ut);qc(it.doc,xe.anchor,xe.head)}}})):fn(st.scroller,"dblclick",function(Ot){return Hi(it,Ot)||Ki(Ot)}),fn(st.scroller,"contextmenu",function(Ot){return hf(it,Ot)}),fn(st.input.getField(),"contextmenu",function(Ot){st.scroller.contains(Ot.target)||hf(it,Ot)});var dt,ht={end:0};function gt(){st.activeTouch&&(dt=setTimeout(function(){return st.activeTouch=null},1e3),ht=st.activeTouch,ht.end=+new Date)}function Pt(Ot){if(Ot.touches.length!=1)return!1;var Ut=Ot.touches[0];return Ut.radiusX<=1&&Ut.radiusY<=1}function Ft(Ot,Ut){if(Ut.left==null)return!0;var xe=Ut.left-Ot.left,Jt=Ut.top-Ot.top;return xe*xe+Jt*Jt>20*20}fn(st.scroller,"touchstart",function(Ot){if(!Hi(it,Ot)&&!Pt(Ot)&&!uf(it,Ot)){st.input.ensurePolled(),clearTimeout(dt);var Ut=+new Date;st.activeTouch={start:Ut,moved:!1,prev:Ut-ht.end<=300?ht:null},Ot.touches.length==1&&(st.activeTouch.left=Ot.touches[0].pageX,st.activeTouch.top=Ot.touches[0].pageY)}}),fn(st.scroller,"touchmove",function(){st.activeTouch&&(st.activeTouch.moved=!0)}),fn(st.scroller,"touchend",function(Ot){var Ut=st.activeTouch;if(Ut&&!ts(st,Ot)&&Ut.left!=null&&!Ut.moved&&new Date-Ut.start<300){var xe=it.coordsChar(st.activeTouch,"page"),Jt;!Ut.prev||Ft(Ut,Ut.prev)?Jt=new rr(xe,xe):!Ut.prev.prev||Ft(Ut,Ut.prev.prev)?Jt=it.findWordAt(xe):Jt=new rr(Qt(xe.line,0),we(it.doc,Qt(xe.line+1,0))),it.setSelection(Jt.anchor,Jt.head),it.focus(),Ki(Ot)}gt()}),fn(st.scroller,"touchcancel",gt),fn(st.scroller,"scroll",function(){st.scroller.clientHeight&&(Ph(it,st.scroller.scrollTop),hu(it,st.scroller.scrollLeft,!0),zi(it,"scroll",it))}),fn(st.scroller,"mousewheel",function(Ot){return Ps(it,Ot)}),fn(st.scroller,"DOMMouseScroll",function(Ot){return Ps(it,Ot)}),fn(st.wrapper,"scroll",function(){return st.wrapper.scrollTop=st.wrapper.scrollLeft=0}),st.dragFunctions={enter:function(Ot){Hi(it,Ot)||Ro(Ot)},over:function(Ot){Hi(it,Ot)||(Xp(it,Ot),Ro(Ot))},start:function(Ot){return Kp(it,Ot)},drop:hs(it,fg),leave:function(Ot){Hi(it,Ot)||Jp(it)}};var Rt=st.input.getField();fn(Rt,"keyup",function(Ot){return Lg.call(it,Ot)}),fn(Rt,"keydown",hs(it,Pg)),fn(Rt,"keypress",hs(it,Al)),fn(Rt,"focus",function(Ot){return Do(it,Ot)}),fn(Rt,"blur",function(Ot){return xh(it,Ot)})}var Ih=[];Uo.defineInitHook=function(it){return Ih.push(it)};function ds(it,st,dt,ht){var gt=it.doc,Pt;dt==null&&(dt="add"),dt=="smart"&&(gt.mode.indent?Pt=Ri(it,st).state:dt="prev");var Ft=it.options.tabSize,Rt=pn(gt,st),Ot=ce(Rt.text,null,Ft);Rt.stateAfter&&(Rt.stateAfter=null);var Ut=Rt.text.match(/^\s*/)[0],xe;if(!ht&&!/\S/.test(Rt.text))xe=0,dt="not";else if(dt=="smart"&&(xe=gt.mode.indent(Pt,Rt.text.slice(Ut.length),Rt.text),xe==Dn||xe>150)){if(!ht)return;dt="prev"}dt=="prev"?st>gt.first?xe=ce(pn(gt,st-1).text,null,Ft):xe=0:dt=="add"?xe=Ot+it.options.indentUnit:dt=="subtract"?xe=Ot-it.options.indentUnit:typeof dt=="number"&&(xe=Ot+dt),xe=Math.max(0,xe);var Jt="",_e=0;if(it.options.indentWithTabs)for(var Oe=Math.floor(xe/Ft);Oe;--Oe)_e+=Ft,Jt+=" ";if(_e<xe&&(Jt+=Qn(xe-_e)),Jt!=Ut)return Fh(gt,Jt,Qt(st,0),Qt(st,Ut.length),"+input"),Rt.stateAfter=null,!0;for(var wn=0;wn<gt.sel.ranges.length;wn++){var Nn=gt.sel.ranges[wn];if(Nn.head.line==st&&Nn.head.ch<Ut.length){var Wn=Qt(st,Ut.length);Gu(gt,wn,new rr(Wn,Wn));break}}}var va=null;function Rh(it){va=it}function fc(it,st,dt,ht,gt){var Pt=it.doc;it.display.shift=!1,ht||(ht=Pt.sel);var Ft=+new Date-200,Rt=gt=="paste"||it.state.pasteIncoming>Ft,Ot=ro(st),Ut=null;if(Rt&&ht.ranges.length>1)if(va&&va.text.join(`
`)==st){if(ht.ranges.length%va.text.length==0){Ut=[];for(var xe=0;xe<va.text.length;xe++)Ut.push(Pt.splitLines(va.text[xe]))}}else Ot.length==ht.ranges.length&&it.options.pasteLinesPerSelection&&(Ut=jn(Ot,function(ui){return[ui]}));for(var Jt=it.curOp.updateInput,_e=ht.ranges.length-1;_e>=0;_e--){var Oe=ht.ranges[_e],wn=Oe.from(),Nn=Oe.to();Oe.empty()&&(dt&&dt>0?wn=Qt(wn.line,wn.ch-dt):it.state.overwrite&&!Rt?Nn=Qt(Nn.line,Math.min(pn(Pt,Nn.line).text.length,Nn.ch+ee(Ot).length)):Rt&&va&&va.lineWise&&va.text.join(`
`)==Ot.join(`
`)&&(wn=Nn=Qt(wn.line,0)));var Wn={from:wn,to:Nn,text:Ut?Ut[_e%Ut.length]:Ot,origin:gt||(Rt?"paste":it.state.cutIncoming>Ft?"cut":"+input")};Hu(it.doc,Wn),yi(it,"inputRead",it,Wn)}st&&!Rt&&Ag(it,st),uu(it),it.curOp.updateInput<2&&(it.curOp.updateInput=Jt),it.curOp.typing=!0,it.state.pasteIncoming=it.state.cutIncoming=-1}function Tg(it,st){var dt=it.clipboardData&&it.clipboardData.getData("Text");if(dt)return it.preventDefault(),!st.isReadOnly()&&!st.options.disableInput&&Qo(st,function(){return fc(st,dt,0,null,"paste")}),!0}function Ag(it,st){if(!(!it.options.electricChars||!it.options.smartIndent))for(var dt=it.doc.sel,ht=dt.ranges.length-1;ht>=0;ht--){var gt=dt.ranges[ht];if(!(gt.head.ch>100||ht&&dt.ranges[ht-1].head.line==gt.head.line)){var Pt=it.getModeAt(gt.head),Ft=!1;if(Pt.electricChars){for(var Rt=0;Rt<Pt.electricChars.length;Rt++)if(st.indexOf(Pt.electricChars.charAt(Rt))>-1){Ft=ds(it,gt.head.line,"smart");break}}else Pt.electricInput&&Pt.electricInput.test(pn(it.doc,gt.head.line).text.slice(0,gt.head.ch))&&(Ft=ds(it,gt.head.line,"smart"));Ft&&yi(it,"electricInput",it,gt.head.line)}}}function Bg(it){for(var st=[],dt=[],ht=0;ht<it.doc.sel.ranges.length;ht++){var gt=it.doc.sel.ranges[ht].head.line,Pt={anchor:Qt(gt,0),head:Qt(gt+1,0)};dt.push(Pt),st.push(it.getRange(Pt.anchor,Pt.head))}return{text:st,ranges:dt}}function Dg(it,st,dt,ht){it.setAttribute("autocorrect",dt?"":"off"),it.setAttribute("autocapitalize",ht?"":"off"),it.setAttribute("spellcheck",!!st)}function Og(){var it=te("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),st=te("div",[it],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return se?it.style.width="1000px":it.setAttribute("wrap","off"),Nt&&(it.style.border="1px solid black"),Dg(it),st}function Uu(it){var st=it.optionHandlers,dt=it.helpers={};it.prototype={constructor:it,focus:function(){window.focus(),this.display.input.focus()},setOption:function(ht,gt){var Pt=this.options,Ft=Pt[ht];Pt[ht]==gt&&ht!="mode"||(Pt[ht]=gt,st.hasOwnProperty(ht)&&hs(this,st[ht])(this,gt,Ft),zi(this,"optionChange",this,ht))},getOption:function(ht){return this.options[ht]},getDoc:function(){return this.doc},addKeyMap:function(ht,gt){this.state.keyMaps[gt?"push":"unshift"](Ah(ht))},removeKeyMap:function(ht){for(var gt=this.state.keyMaps,Pt=0;Pt<gt.length;++Pt)if(gt[Pt]==ht||gt[Pt].name==ht)return gt.splice(Pt,1),!0},addOverlay:ys(function(ht,gt){var Pt=ht.token?ht:it.getMode(this.options,ht);if(Pt.startState)throw new Error("Overlays may not be stateful.");hi(this.state.overlays,{mode:Pt,modeSpec:ht,opaque:gt&&gt.opaque,priority:gt&&gt.priority||0},function(Ft){return Ft.priority}),this.state.modeGen++,wr(this)}),removeOverlay:ys(function(ht){for(var gt=this.state.overlays,Pt=0;Pt<gt.length;++Pt){var Ft=gt[Pt].modeSpec;if(Ft==ht||typeof ht=="string"&&Ft.name==ht){gt.splice(Pt,1),this.state.modeGen++,wr(this);return}}}),indentLine:ys(function(ht,gt,Pt){typeof gt!="string"&&typeof gt!="number"&&(gt==null?gt=this.options.smartIndent?"smart":"prev":gt=gt?"add":"subtract"),an(this.doc,ht)&&ds(this,ht,gt,Pt)}),indentSelection:ys(function(ht){for(var gt=this.doc.sel.ranges,Pt=-1,Ft=0;Ft<gt.length;Ft++){var Rt=gt[Ft];if(Rt.empty())Rt.head.line>Pt&&(ds(this,Rt.head.line,ht,!0),Pt=Rt.head.line,Ft==this.doc.sel.primIndex&&uu(this));else{var Ot=Rt.from(),Ut=Rt.to(),xe=Math.max(Pt,Ot.line);Pt=Math.min(this.lastLine(),Ut.line-(Ut.ch?0:1))+1;for(var Jt=xe;Jt<Pt;++Jt)ds(this,Jt,ht);var _e=this.doc.sel.ranges;Ot.ch==0&&gt.length==_e.length&&_e[Ft].from().ch>0&&Gu(this.doc,Ft,new rr(Ot,_e[Ft].to()),je)}}}),getTokenAt:function(ht,gt){return Bn(this,ht,gt)},getLineTokens:function(ht,gt){return Bn(this,Qt(ht),gt,!0)},getTokenTypeAt:function(ht){ht=we(this.doc,ht);var gt=qn(this,pn(this.doc,ht.line)),Pt=0,Ft=(gt.length-1)/2,Rt=ht.ch,Ot;if(Rt==0)Ot=gt[2];else for(;;){var Ut=Pt+Ft>>1;if((Ut?gt[Ut*2-1]:0)>=Rt)Ft=Ut;else if(gt[Ut*2+1]<Rt)Pt=Ut+1;else{Ot=gt[Ut*2+2];break}}var xe=Ot?Ot.indexOf("overlay "):-1;return xe<0?Ot:xe==0?null:Ot.slice(0,xe-1)},getModeAt:function(ht){var gt=this.doc.mode;return gt.innerMode?it.innerMode(gt,this.getTokenAt(ht).state).mode:gt},getHelper:function(ht,gt){return this.getHelpers(ht,gt)[0]},getHelpers:function(ht,gt){var Pt=[];if(!dt.hasOwnProperty(gt))return Pt;var Ft=dt[gt],Rt=this.getModeAt(ht);if(typeof Rt[gt]=="string")Ft[Rt[gt]]&&Pt.push(Ft[Rt[gt]]);else if(Rt[gt])for(var Ot=0;Ot<Rt[gt].length;Ot++){var Ut=Ft[Rt[gt][Ot]];Ut&&Pt.push(Ut)}else Rt.helperType&&Ft[Rt.helperType]?Pt.push(Ft[Rt.helperType]):Ft[Rt.name]&&Pt.push(Ft[Rt.name]);for(var xe=0;xe<Ft._global.length;xe++){var Jt=Ft._global[xe];Jt.pred(Rt,this)&&tn(Pt,Jt.val)==-1&&Pt.push(Jt.val)}return Pt},getStateAfter:function(ht,gt){var Pt=this.doc;return ht=Be(Pt,ht==null?Pt.first+Pt.size-1:ht),Ri(this,ht+1,gt).state},cursorCoords:function(ht,gt){var Pt,Ft=this.doc.sel.primary();return ht==null?Pt=Ft.head:typeof ht=="object"?Pt=we(this.doc,ht):Pt=ht?Ft.from():Ft.to(),Bo(this,Pt,gt||"page")},charCoords:function(ht,gt){return Co(this,we(this.doc,ht),gt||"page")},coordsChar:function(ht,gt){return ht=Vo(this,ht,gt||"page"),ls(this,ht.left,ht.top)},lineAtHeight:function(ht,gt){return ht=Vo(this,{top:ht,left:0},gt||"page").top,Ne(this.doc,ht+this.display.viewOffset)},heightAtLine:function(ht,gt,Pt){var Ft=!1,Rt;if(typeof ht=="number"){var Ot=this.doc.first+this.doc.size-1;ht<this.doc.first?ht=this.doc.first:ht>Ot&&(ht=Ot,Ft=!0),Rt=pn(this.doc,ht)}else Rt=ht;return es(this,Rt,{top:0,left:0},gt||"page",Pt||Ft).top+(Ft?this.doc.height-no(Rt):0)},defaultTextHeight:function(){return lu(this.display)},defaultCharWidth:function(){return Sh(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(ht,gt,Pt,Ft,Rt){var Ot=this.display;ht=Bo(this,we(this.doc,ht));var Ut=ht.bottom,xe=ht.left;if(gt.style.position="absolute",gt.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(gt),Ot.sizer.appendChild(gt),Ft=="over")Ut=ht.top;else if(Ft=="above"||Ft=="near"){var Jt=Math.max(Ot.wrapper.clientHeight,this.doc.height),_e=Math.max(Ot.sizer.clientWidth,Ot.lineSpace.clientWidth);(Ft=="above"||ht.bottom+gt.offsetHeight>Jt)&&ht.top>gt.offsetHeight?Ut=ht.top-gt.offsetHeight:ht.bottom+gt.offsetHeight<=Jt&&(Ut=ht.bottom),xe+gt.offsetWidth>_e&&(xe=_e-gt.offsetWidth)}gt.style.top=Ut+"px",gt.style.left=gt.style.right="",Rt=="right"?(xe=Ot.sizer.clientWidth-gt.offsetWidth,gt.style.right="0px"):(Rt=="left"?xe=0:Rt=="middle"&&(xe=(Ot.sizer.clientWidth-gt.offsetWidth)/2),gt.style.left=xe+"px"),Pt&&Xd(this,{left:xe,top:Ut,right:xe+gt.offsetWidth,bottom:Ut+gt.offsetHeight})},triggerOnKeyDown:ys(Pg),triggerOnKeyPress:ys(Al),triggerOnKeyUp:Lg,triggerOnMouseDown:ys(Bl),execCommand:function(ht){if(Wu.hasOwnProperty(ht))return Wu[ht].call(null,this)},triggerElectric:ys(function(ht){Ag(this,ht)}),findPosH:function(ht,gt,Pt,Ft){var Rt=1;gt<0&&(Rt=-1,gt=-gt);for(var Ot=we(this.doc,ht),Ut=0;Ut<gt&&(Ot=gc(this.doc,Ot,Rt,Pt,Ft),!Ot.hitSide);++Ut);return Ot},moveH:ys(function(ht,gt){var Pt=this;this.extendSelectionsBy(function(Ft){return Pt.display.shift||Pt.doc.extend||Ft.empty()?gc(Pt.doc,Ft.head,ht,gt,Pt.options.rtlMoveVisually):ht<0?Ft.from():Ft.to()},Tn)}),deleteH:ys(function(ht,gt){var Pt=this.doc.sel,Ft=this.doc;Pt.somethingSelected()?Ft.replaceSelection("",null,"+delete"):Ea(this,function(Rt){var Ot=gc(Ft,Rt.head,ht,gt,!1);return ht<0?{from:Ot,to:Rt.head}:{from:Rt.head,to:Ot}})}),findPosV:function(ht,gt,Pt,Ft){var Rt=1,Ot=Ft;gt<0&&(Rt=-1,gt=-gt);for(var Ut=we(this.doc,ht),xe=0;xe<gt;++xe){var Jt=Bo(this,Ut,"div");if(Ot==null?Ot=Jt.left:Jt.left=Ot,Ut=Yu(this,Jt,Rt,Pt),Ut.hitSide)break}return Ut},moveV:ys(function(ht,gt){var Pt=this,Ft=this.doc,Rt=[],Ot=!this.display.shift&&!Ft.extend&&Ft.sel.somethingSelected();if(Ft.extendSelectionsBy(function(xe){if(Ot)return ht<0?xe.from():xe.to();var Jt=Bo(Pt,xe.head,"div");xe.goalColumn!=null&&(Jt.left=xe.goalColumn),Rt.push(Jt.left);var _e=Yu(Pt,Jt,ht,gt);return gt=="page"&&xe==Ft.sel.primary()&&Hc(Pt,Co(Pt,_e,"div").top-Jt.top),_e},Tn),Rt.length)for(var Ut=0;Ut<Ft.sel.ranges.length;Ut++)Ft.sel.ranges[Ut].goalColumn=Rt[Ut]}),findWordAt:function(ht){var gt=this.doc,Pt=pn(gt,ht.line).text,Ft=ht.ch,Rt=ht.ch;if(Pt){var Ot=this.getHelper(ht,"wordChars");(ht.sticky=="before"||Rt==Pt.length)&&Ft?--Ft:++Rt;for(var Ut=Pt.charAt(Ft),xe=_t(Ut,Ot)?function(Jt){return _t(Jt,Ot)}:/\s/.test(Ut)?function(Jt){return/\s/.test(Jt)}:function(Jt){return!/\s/.test(Jt)&&!_t(Jt)};Ft>0&&xe(Pt.charAt(Ft-1));)--Ft;for(;Rt<Pt.length&&xe(Pt.charAt(Rt));)++Rt}return new rr(Qt(ht.line,Ft),Qt(ht.line,Rt))},toggleOverwrite:function(ht){ht!=null&&ht==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?hn(this.display.cursorDiv,"CodeMirror-overwrite"):jt(this.display.cursorDiv,"CodeMirror-overwrite"),zi(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Ye()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ys(function(ht,gt){wh(this,ht,gt)}),getScrollInfo:function(){var ht=this.display.scroller;return{left:ht.scrollLeft,top:ht.scrollTop,height:ht.scrollHeight-Hr(this)-this.display.barHeight,width:ht.scrollWidth-Hr(this)-this.display.barWidth,clientHeight:gh(this),clientWidth:ga(this)}},scrollIntoView:ys(function(ht,gt){ht==null?(ht={from:this.doc.sel.primary().head,to:null},gt==null&&(gt=this.options.cursorScrollMargin)):typeof ht=="number"?ht={from:Qt(ht,0),to:null}:ht.from==null&&(ht={from:ht,to:null}),ht.to||(ht.to=ht.from),ht.margin=gt||0,ht.from.line!=null?Oo(this,ht):Wc(this,ht.from,ht.to,ht.margin)}),setSize:ys(function(ht,gt){var Pt=this,Ft=function(Ot){return typeof Ot=="number"||/^\d+$/.test(String(Ot))?Ot+"px":Ot};ht!=null&&(this.display.wrapper.style.width=Ft(ht)),gt!=null&&(this.display.wrapper.style.height=Ft(gt)),this.options.lineWrapping&&vh(this);var Rt=this.display.viewFrom;this.doc.iter(Rt,this.display.viewTo,function(Ot){if(Ot.widgets){for(var Ut=0;Ut<Ot.widgets.length;Ut++)if(Ot.widgets[Ut].noHScroll){So(Pt,Rt,"widget");break}}++Rt}),this.curOp.forceUpdate=!0,zi(this,"refresh",this)}),operation:function(ht){return Qo(this,ht)},startOperation:function(){return Au(this)},endOperation:function(){return Bu(this)},refresh:ys(function(){var ht=this.display.cachedTextHeight;wr(this),this.curOp.forceUpdate=!0,bu(this),wh(this,this.doc.scrollLeft,this.doc.scrollTop),Iu(this.display),(ht==null||Math.abs(ht-lu(this.display))>.5||this.options.lineWrapping)&&_i(this),zi(this,"refresh",this)}),swapDoc:ys(function(ht){var gt=this.doc;return gt.cm=null,this.state.selectingText&&this.state.selectingText(),Kc(this,ht),bu(this),this.display.input.reset(),wh(this,ht.scrollLeft,ht.scrollTop),this.curOp.forceScroll=!0,yi(this,"swapDoc",this,gt),gt}),phrase:function(ht){var gt=this.options.phrases;return gt&&Object.prototype.hasOwnProperty.call(gt,ht)?gt[ht]:ht},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}},Fi(it),it.registerHelper=function(ht,gt,Pt){dt.hasOwnProperty(ht)||(dt[ht]=it[ht]={_global:[]}),dt[ht][gt]=Pt},it.registerGlobalHelper=function(ht,gt,Pt,Ft){it.registerHelper(ht,gt,Ft),dt[ht]._global.push({pred:Pt,val:Ft})}}function gc(it,st,dt,ht,gt){var Pt=st,Ft=dt,Rt=pn(it,st.line),Ot=gt&&it.direction=="rtl"?-dt:dt;function Ut(){var Mi=st.line+Ot;return Mi<it.first||Mi>=it.first+it.size?!1:(st=new Qt(Mi,st.ch,st.sticky),Rt=pn(it,Mi))}function xe(Mi){var xi;if(ht=="codepoint"){var Ti=Rt.text.charCodeAt(st.ch+(ht>0?0:-1));isNaN(Ti)?xi=null:xi=new Qt(st.line,Math.max(0,Math.min(Rt.text.length,st.ch+dt*(Ti>=55296&&Ti<56320?2:1))),-dt)}else gt?xi=nf(it.cm,Rt,st,dt):xi=Jr(Rt,st,dt);if(xi==null)if(!Mi&&Ut())st=dc(gt,it.cm,Rt,st.line,Ot);else return!1;else st=xi;return!0}if(ht=="char"||ht=="codepoint")xe();else if(ht=="column")xe(!0);else if(ht=="word"||ht=="group")for(var Jt=null,_e=ht=="group",Oe=it.cm&&it.cm.getHelper(st,"wordChars"),wn=!0;!(dt<0&&!xe(!wn));wn=!1){var Nn=Rt.text.charAt(st.ch)||`
`,Wn=_t(Nn,Oe)?"w":_e&&Nn==`
`?"n":!_e||/\s/.test(Nn)?null:"p";if(_e&&!wn&&!Wn&&(Wn="s"),Jt&&Jt!=Wn){dt<0&&(dt=1,xe(),st.sticky="after");break}if(Wn&&(Jt=Wn),dt>0&&!xe(!wn))break}var ui=rc(it,st,Pt,Ft,!0);return De(Pt,ui)&&(ui.hitSide=!0),ui}function Yu(it,st,dt,ht){var gt=it.doc,Pt=st.left,Ft;if(ht=="page"){var Rt=Math.min(it.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Ot=Math.max(Rt-.5*lu(it.display),3);Ft=(dt>0?st.bottom:st.top)+dt*Ot}else ht=="line"&&(Ft=dt>0?st.bottom+3:st.top-3);for(var Ut;Ut=ls(it,Pt,Ft),!!Ut.outside;){if(dt<0?Ft<=0:Ft>=gt.height){Ut.hitSide=!0;break}Ft+=dt*5}return Ut}var cr=function(it){this.cm=it,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Kt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};cr.prototype.init=function(it){var st=this,dt=this,ht=dt.cm,gt=dt.div=it.lineDiv;Dg(gt,ht.options.spellcheck,ht.options.autocorrect,ht.options.autocapitalize);function Pt(Rt){for(var Ot=Rt.target;Ot;Ot=Ot.parentNode){if(Ot==gt)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Ot.className))break}return!1}fn(gt,"paste",function(Rt){!Pt(Rt)||Hi(ht,Rt)||Tg(Rt,ht)||re<=11&&setTimeout(hs(ht,function(){return st.updateFromDOM()}),20)}),fn(gt,"compositionstart",function(Rt){st.composing={data:Rt.data,done:!1}}),fn(gt,"compositionupdate",function(Rt){st.composing||(st.composing={data:Rt.data,done:!1})}),fn(gt,"compositionend",function(Rt){st.composing&&(Rt.data!=st.composing.data&&st.readFromDOMSoon(),st.composing.done=!0)}),fn(gt,"touchstart",function(){return dt.forceCompositionEnd()}),fn(gt,"input",function(){st.composing||st.readFromDOMSoon()});function Ft(Rt){if(!(!Pt(Rt)||Hi(ht,Rt))){if(ht.somethingSelected())Rh({lineWise:!1,text:ht.getSelections()}),Rt.type=="cut"&&ht.replaceSelection("",null,"cut");else if(ht.options.lineWiseCopyCut){var Ot=Bg(ht);Rh({lineWise:!0,text:Ot.text}),Rt.type=="cut"&&ht.operation(function(){ht.setSelections(Ot.ranges,0,je),ht.replaceSelection("",null,"cut")})}else return;if(Rt.clipboardData){Rt.clipboardData.clearData();var Ut=va.text.join(`
`);if(Rt.clipboardData.setData("Text",Ut),Rt.clipboardData.getData("Text")==Ut){Rt.preventDefault();return}}var xe=Og(),Jt=xe.firstChild;ht.display.lineSpace.insertBefore(xe,ht.display.lineSpace.firstChild),Jt.value=va.text.join(`
`);var _e=document.activeElement;vn(Jt),setTimeout(function(){ht.display.lineSpace.removeChild(xe),_e.focus(),_e==gt&&dt.showPrimarySelection()},50)}}fn(gt,"copy",Ft),fn(gt,"cut",Ft)},cr.prototype.screenReaderLabelChanged=function(it){it?this.div.setAttribute("aria-label",it):this.div.removeAttribute("aria-label")},cr.prototype.prepareSelection=function(){var it=Fu(this.cm,!1);return it.focus=document.activeElement==this.div,it},cr.prototype.showSelection=function(it,st){!it||!this.cm.display.view.length||((it.focus||st)&&this.showPrimarySelection(),this.showMultipleSelections(it))},cr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},cr.prototype.showPrimarySelection=function(){var it=this.getSelection(),st=this.cm,dt=st.doc.sel.primary(),ht=dt.from(),gt=dt.to();if(st.display.viewTo==st.display.viewFrom||ht.line>=st.display.viewTo||gt.line<st.display.viewFrom){it.removeAllRanges();return}var Pt=pc(st,it.anchorNode,it.anchorOffset),Ft=pc(st,it.focusNode,it.focusOffset);if(!(Pt&&!Pt.bad&&Ft&&!Ft.bad&&Zt(ln(Pt,Ft),ht)==0&&Zt(Hn(Pt,Ft),gt)==0)){var Rt=st.display.view,Ot=ht.line>=st.display.viewFrom&&ff(st,ht)||{node:Rt[0].measure.map[2],offset:0},Ut=gt.line<st.display.viewTo&&ff(st,gt);if(!Ut){var xe=Rt[Rt.length-1].measure,Jt=xe.maps?xe.maps[xe.maps.length-1]:xe.map;Ut={node:Jt[Jt.length-1],offset:Jt[Jt.length-2]-Jt[Jt.length-3]}}if(!Ot||!Ut){it.removeAllRanges();return}var _e=it.rangeCount&&it.getRangeAt(0),Oe;try{Oe=pe(Ot.node,Ot.offset,Ut.offset,Ut.node)}catch(wn){}Oe&&(!St&&st.state.focused?(it.collapse(Ot.node,Ot.offset),Oe.collapsed||(it.removeAllRanges(),it.addRange(Oe))):(it.removeAllRanges(),it.addRange(Oe)),_e&&it.anchorNode==null?it.addRange(_e):St&&this.startGracePeriod()),this.rememberSelection()}},cr.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)},cr.prototype.showMultipleSelections=function(it){ie(this.cm.display.cursorDiv,it.cursors),ie(this.cm.display.selectionDiv,it.selection)},cr.prototype.rememberSelection=function(){var it=this.getSelection();this.lastAnchorNode=it.anchorNode,this.lastAnchorOffset=it.anchorOffset,this.lastFocusNode=it.focusNode,this.lastFocusOffset=it.focusOffset},cr.prototype.selectionInEditor=function(){var it=this.getSelection();if(!it.rangeCount)return!1;var st=it.getRangeAt(0).commonAncestorContainer;return Je(this.div,st)},cr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},cr.prototype.blur=function(){this.div.blur()},cr.prototype.getField=function(){return this.div},cr.prototype.supportsTouch=function(){return!0},cr.prototype.receivedFocus=function(){var it=this;this.selectionInEditor()?this.pollSelection():Qo(this.cm,function(){return it.cm.curOp.selectionChanged=!0});function st(){it.cm.state.focused&&(it.pollSelection(),it.polling.set(it.cm.options.pollInterval,st))}this.polling.set(this.cm.options.pollInterval,st)},cr.prototype.selectionChanged=function(){var it=this.getSelection();return it.anchorNode!=this.lastAnchorNode||it.anchorOffset!=this.lastAnchorOffset||it.focusNode!=this.lastFocusNode||it.focusOffset!=this.lastFocusOffset},cr.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var it=this.getSelection(),st=this.cm;if(et&&Le&&this.cm.display.gutterSpecs.length&&Ig(it.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var dt=pc(st,it.anchorNode,it.anchorOffset),ht=pc(st,it.focusNode,it.focusOffset);dt&&ht&&Qo(st,function(){Zs(st.doc,du(dt,ht),je),(dt.bad||ht.bad)&&(st.curOp.selectionChanged=!0)})}}},cr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var it=this.cm,st=it.display,dt=it.doc.sel.primary(),ht=dt.from(),gt=dt.to();if(ht.ch==0&&ht.line>it.firstLine()&&(ht=Qt(ht.line-1,pn(it.doc,ht.line-1).length)),gt.ch==pn(it.doc,gt.line).text.length&&gt.line<it.lastLine()&&(gt=Qt(gt.line+1,0)),ht.line<st.viewFrom||gt.line>st.viewTo-1)return!1;var Pt,Ft,Rt;ht.line==st.viewFrom||(Pt=Ga(it,ht.line))==0?(Ft=Wt(st.view[0].line),Rt=st.view[0].node):(Ft=Wt(st.view[Pt].line),Rt=st.view[Pt-1].node.nextSibling);var Ot=Ga(it,gt.line),Ut,xe;if(Ot==st.view.length-1?(Ut=st.viewTo-1,xe=st.lineDiv.lastChild):(Ut=Wt(st.view[Ot+1].line)-1,xe=st.view[Ot+1].node.previousSibling),!Rt)return!1;for(var Jt=it.doc.splitLines(Md(it,Rt,xe,Ft,Ut)),_e=me(it.doc,Qt(Ft,0),Qt(Ut,pn(it.doc,Ut).text.length));Jt.length>1&&_e.length>1;)if(ee(Jt)==ee(_e))Jt.pop(),_e.pop(),Ut--;else if(Jt[0]==_e[0])Jt.shift(),_e.shift(),Ft++;else break;for(var Oe=0,wn=0,Nn=Jt[0],Wn=_e[0],ui=Math.min(Nn.length,Wn.length);Oe<ui&&Nn.charCodeAt(Oe)==Wn.charCodeAt(Oe);)++Oe;for(var Mi=ee(Jt),xi=ee(_e),Ti=Math.min(Mi.length-(Jt.length==1?Oe:0),xi.length-(_e.length==1?Oe:0));wn<Ti&&Mi.charCodeAt(Mi.length-wn-1)==xi.charCodeAt(xi.length-wn-1);)++wn;if(Jt.length==1&&_e.length==1&&Ft==ht.line)for(;Oe&&Oe>ht.ch&&Mi.charCodeAt(Mi.length-wn-1)==xi.charCodeAt(xi.length-wn-1);)Oe--,wn++;Jt[Jt.length-1]=Mi.slice(0,Mi.length-wn).replace(/^\u200b+/,""),Jt[0]=Jt[0].slice(Oe).replace(/\u200b+$/,"");var eo=Qt(Ft,Oe),Si=Qt(Ut,_e.length?ee(_e).length-wn:0);if(Jt.length>1||Jt[0]||Zt(eo,Si))return Fh(it.doc,Jt,eo,Si,"+input"),!0},cr.prototype.ensurePolled=function(){this.forceCompositionEnd()},cr.prototype.reset=function(){this.forceCompositionEnd()},cr.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},cr.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))},cr.prototype.updateFromDOM=function(){var it=this;(this.cm.isReadOnly()||!this.pollContent())&&Qo(this.cm,function(){return wr(it.cm)})},cr.prototype.setUneditable=function(it){it.contentEditable="false"},cr.prototype.onKeyPress=function(it){it.charCode==0||this.composing||(it.preventDefault(),this.cm.isReadOnly()||hs(this.cm,fc)(this.cm,String.fromCharCode(it.charCode==null?it.keyCode:it.charCode),0))},cr.prototype.readOnlyChanged=function(it){this.div.contentEditable=String(it!="nocursor")},cr.prototype.onContextMenu=function(){},cr.prototype.resetPosition=function(){},cr.prototype.needsContentAttribute=!0;function ff(it,st){var dt=ph(it,st.line);if(!dt||dt.hidden)return null;var ht=pn(it.doc,st.line),gt=bl(dt,ht,st.line),Pt=An(ht,it.doc.direction),Ft="left";if(Pt){var Rt=en(Pt,st.ch);Ft=Rt%2?"right":"left"}var Ot=ad(gt.map,st.ch,Ft);return Ot.offset=Ot.collapse=="right"?Ot.end:Ot.start,Ot}function Ig(it){for(var st=it;st;st=st.parentNode)if(/CodeMirror-gutter-wrapper/.test(st.className))return!0;return!1}function kd(it,st){return st&&(it.bad=!0),it}function Md(it,st,dt,ht,gt){var Pt="",Ft=!1,Rt=it.doc.lineSeparator(),Ot=!1;function Ut(Oe){return function(wn){return wn.id==Oe}}function xe(){Ft&&(Pt+=Rt,Ot&&(Pt+=Rt),Ft=Ot=!1)}function Jt(Oe){Oe&&(xe(),Pt+=Oe)}function _e(Oe){if(Oe.nodeType==1){var wn=Oe.getAttribute("cm-text");if(wn){Jt(wn);return}var Nn=Oe.getAttribute("cm-marker"),Wn;if(Nn){var ui=it.findMarks(Qt(ht,0),Qt(gt+1,0),Ut(+Nn));ui.length&&(Wn=ui[0].find(0))&&Jt(me(it.doc,Wn.from,Wn.to).join(Rt));return}if(Oe.getAttribute("contenteditable")=="false")return;var Mi=/^(pre|div|p|li|table|br)$/i.test(Oe.nodeName);if(!/^br$/i.test(Oe.nodeName)&&Oe.textContent.length==0)return;Mi&&xe();for(var xi=0;xi<Oe.childNodes.length;xi++)_e(Oe.childNodes[xi]);/^(pre|p)$/i.test(Oe.nodeName)&&(Ot=!0),Mi&&(Ft=!0)}else Oe.nodeType==3&&Jt(Oe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;_e(st),st!=dt;)st=st.nextSibling,Ot=!1;return Pt}function pc(it,st,dt){var ht;if(st==it.display.lineDiv){if(ht=it.display.lineDiv.childNodes[dt],!ht)return kd(it.clipPos(Qt(it.display.viewTo-1)),!0);st=null,dt=0}else for(ht=st;;ht=ht.parentNode){if(!ht||ht==it.display.lineDiv)return null;if(ht.parentNode&&ht.parentNode==it.display.lineDiv)break}for(var gt=0;gt<it.display.view.length;gt++){var Pt=it.display.view[gt];if(Pt.node==ht)return rm(Pt,st,dt)}}function rm(it,st,dt){var ht=it.text.firstChild,gt=!1;if(!st||!Je(ht,st))return kd(Qt(Wt(it.line),0),!0);if(st==ht&&(gt=!0,st=ht.childNodes[dt],dt=0,!st)){var Pt=it.rest?ee(it.rest):it.line;return kd(Qt(Wt(Pt),Pt.text.length),gt)}var Ft=st.nodeType==3?st:null,Rt=st;for(!Ft&&st.childNodes.length==1&&st.firstChild.nodeType==3&&(Ft=st.firstChild,dt&&(dt=Ft.nodeValue.length));Rt.parentNode!=ht;)Rt=Rt.parentNode;var Ot=it.measure,Ut=Ot.maps;function xe(Wn,ui,Mi){for(var xi=-1;xi<(Ut?Ut.length:0);xi++)for(var Ti=xi<0?Ot.map:Ut[xi],eo=0;eo<Ti.length;eo+=3){var Si=Ti[eo+2];if(Si==Wn||Si==ui){var wo=Wt(xi<0?it.line:it.rest[xi]),Pr=Ti[eo]+Mi;return(Mi<0||Si!=Wn)&&(Pr=Ti[eo+(Mi?1:0)]),Qt(wo,Pr)}}}var Jt=xe(Ft,Rt,dt);if(Jt)return kd(Jt,gt);for(var _e=Rt.nextSibling,Oe=Ft?Ft.nodeValue.length-dt:0;_e;_e=_e.nextSibling){if(Jt=xe(_e,_e.firstChild,0),Jt)return kd(Qt(Jt.line,Jt.ch-Oe),gt);Oe+=_e.textContent.length}for(var wn=Rt.previousSibling,Nn=dt;wn;wn=wn.previousSibling){if(Jt=xe(wn,wn.firstChild,-1),Jt)return kd(Qt(Jt.line,Jt.ch+Nn),gt);Nn+=wn.textContent.length}}var os=function(it){this.cm=it,this.prevInput="",this.pollingFast=!1,this.polling=new Kt,this.hasSelection=!1,this.composing=null};os.prototype.init=function(it){var st=this,dt=this,ht=this.cm;this.createField(it);var gt=this.textarea;it.wrapper.insertBefore(this.wrapper,it.wrapper.firstChild),Nt&&(gt.style.width="0px"),fn(gt,"input",function(){ge&&re>=9&&st.hasSelection&&(st.hasSelection=null),dt.poll()}),fn(gt,"paste",function(Ft){Hi(ht,Ft)||Tg(Ft,ht)||(ht.state.pasteIncoming=+new Date,dt.fastPoll())});function Pt(Ft){if(!Hi(ht,Ft)){if(ht.somethingSelected())Rh({lineWise:!1,text:ht.getSelections()});else if(ht.options.lineWiseCopyCut){var Rt=Bg(ht);Rh({lineWise:!0,text:Rt.text}),Ft.type=="cut"?ht.setSelections(Rt.ranges,null,je):(dt.prevInput="",gt.value=Rt.text.join(`
`),vn(gt))}else return;Ft.type=="cut"&&(ht.state.cutIncoming=+new Date)}}fn(gt,"cut",Pt),fn(gt,"copy",Pt),fn(it.scroller,"paste",function(Ft){if(!(ts(it,Ft)||Hi(ht,Ft))){if(!gt.dispatchEvent){ht.state.pasteIncoming=+new Date,dt.focus();return}var Rt=new Event("paste");Rt.clipboardData=Ft.clipboardData,gt.dispatchEvent(Rt)}}),fn(it.lineSpace,"selectstart",function(Ft){ts(it,Ft)||Ki(Ft)}),fn(gt,"compositionstart",function(){var Ft=ht.getCursor("from");dt.composing&&dt.composing.range.clear(),dt.composing={start:Ft,range:ht.markText(Ft,ht.getCursor("to"),{className:"CodeMirror-composing"})}}),fn(gt,"compositionend",function(){dt.composing&&(dt.poll(),dt.composing.range.clear(),dt.composing=null)})},os.prototype.createField=function(it){this.wrapper=Og(),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,st=it.display,dt=it.doc,ht=Fu(it);if(it.options.moveInputWithCursor){var gt=Bo(it,dt.sel.primary().head,"div"),Pt=st.wrapper.getBoundingClientRect(),Ft=st.lineDiv.getBoundingClientRect();ht.teTop=Math.max(0,Math.min(st.wrapper.clientHeight-10,gt.top+Ft.top-Pt.top)),ht.teLeft=Math.max(0,Math.min(st.wrapper.clientWidth-10,gt.left+Ft.left-Pt.left))}return ht},os.prototype.showSelection=function(it){var st=this.cm,dt=st.display;ie(dt.cursorDiv,it.cursors),ie(dt.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 st=this.cm;if(st.somethingSelected()){this.prevInput="";var dt=st.getSelection();this.textarea.value=dt,st.state.focused&&vn(this.textarea),ge&&re>=9&&(this.hasSelection=dt)}else it||(this.prevInput=this.textarea.value="",ge&&re>=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"&&(!nt||Ye()!=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,st=this;st.pollingFast=!0;function dt(){var ht=st.poll();!ht&&!it?(it=!0,st.polling.set(60,dt)):(st.pollingFast=!1,st.slowPoll())}st.polling.set(20,dt)},os.prototype.poll=function(){var it=this,st=this.cm,dt=this.textarea,ht=this.prevInput;if(this.contextMenuPending||!st.state.focused||Ct(dt)&&!ht&&!this.composing||st.isReadOnly()||st.options.disableInput||st.state.keySeq)return!1;var gt=dt.value;if(gt==ht&&!st.somethingSelected())return!1;if(ge&&re>=9&&this.hasSelection===gt||ct&&/[\uf700-\uf7ff]/.test(gt))return st.display.input.reset(),!1;if(st.doc.sel==st.display.selForContextMenu){var Pt=gt.charCodeAt(0);if(Pt==8203&&!ht&&(ht="\u200B"),Pt==8666)return this.reset(),this.cm.execCommand("undo")}for(var Ft=0,Rt=Math.min(ht.length,gt.length);Ft<Rt&&ht.charCodeAt(Ft)==gt.charCodeAt(Ft);)++Ft;return Qo(st,function(){fc(st,gt.slice(Ft),ht.length-Ft,null,it.composing?"*compose":null),gt.length>1e3||gt.indexOf(`
`)>-1?dt.value=it.prevInput="":it.prevInput=gt,it.composing&&(it.composing.range.clear(),it.composing.range=st.markText(it.composing.start,st.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},os.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},os.prototype.onKeyPress=function(){ge&&re>=9&&(this.hasSelection=null),this.fastPoll()},os.prototype.onContextMenu=function(it){var st=this,dt=st.cm,ht=dt.display,gt=st.textarea;st.contextMenuPending&&st.contextMenuPending();var Pt=na(dt,it),Ft=ht.scroller.scrollTop;if(!Pt||$t)return;var Rt=dt.options.resetSelectionOnContextMenu;Rt&&dt.doc.sel.contains(Pt)==-1&&hs(dt,Zs)(dt.doc,du(Pt),je);var Ot=gt.style.cssText,Ut=st.wrapper.style.cssText,xe=st.wrapper.offsetParent.getBoundingClientRect();st.wrapper.style.cssText="position: static",gt.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(it.clientY-xe.top-5)+"px; left: "+(it.clientX-xe.left-5)+`px;
z-index: 1000; background: `+(ge?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Jt;se&&(Jt=window.scrollY),ht.input.focus(),se&&window.scrollTo(null,Jt),ht.input.reset(),dt.somethingSelected()||(gt.value=st.prevInput=" "),st.contextMenuPending=Oe,ht.selForContextMenu=dt.doc.sel,clearTimeout(ht.detectingSelectAll);function _e(){if(gt.selectionStart!=null){var Nn=dt.somethingSelected(),Wn="\u200B"+(Nn?gt.value:"");gt.value="\u21DA",gt.value=Wn,st.prevInput=Nn?"":"\u200B",gt.selectionStart=1,gt.selectionEnd=Wn.length,ht.selForContextMenu=dt.doc.sel}}function Oe(){if(st.contextMenuPending==Oe&&(st.contextMenuPending=!1,st.wrapper.style.cssText=Ut,gt.style.cssText=Ot,ge&&re<9&&ht.scrollbars.setScrollTop(ht.scroller.scrollTop=Ft),gt.selectionStart!=null)){(!ge||ge&&re<9)&&_e();var Nn=0,Wn=function(){ht.selForContextMenu==dt.doc.sel&&gt.selectionStart==0&&gt.selectionEnd>0&&st.prevInput=="\u200B"?hs(dt,Xr)(dt):Nn++<10?ht.detectingSelectAll=setTimeout(Wn,500):(ht.selForContextMenu=null,ht.input.reset())};ht.detectingSelectAll=setTimeout(Wn,200)}}if(ge&&re>=9&&_e(),bt){Ro(it);var wn=function(){Pi(window,"mouseup",wn),setTimeout(Oe,20)};fn(window,"mouseup",wn)}else setTimeout(Oe,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 sm(it,st){if(st=st?yn(st):{},st.value=it.value,!st.tabindex&&it.tabIndex&&(st.tabindex=it.tabIndex),!st.placeholder&&it.placeholder&&(st.placeholder=it.placeholder),st.autofocus==null){var dt=Ye();st.autofocus=dt==it||it.getAttribute("autofocus")!=null&&dt==document.body}function ht(){it.value=Rt.getValue()}var gt;if(it.form&&(fn(it.form,"submit",ht),!st.leaveSubmitMethodAlone)){var Pt=it.form;gt=Pt.submit;try{var Ft=Pt.submit=function(){ht(),Pt.submit=gt,Pt.submit(),Pt.submit=Ft}}catch(Ot){}}st.finishInit=function(Ot){Ot.save=ht,Ot.getTextArea=function(){return it},Ot.toTextArea=function(){Ot.toTextArea=isNaN,ht(),it.parentNode.removeChild(Ot.getWrapperElement()),it.style.display="",it.form&&(Pi(it.form,"submit",ht),!st.leaveSubmitMethodAlone&&typeof it.form.submit=="function"&&(it.form.submit=gt))}},it.style.display="none";var Rt=Uo(function(Ot){return it.parentNode.insertBefore(Ot,it.nextSibling)},st);return Rt}function Ed(it){it.off=Pi,it.on=fn,it.wheelEventPixels=Wa,it.Doc=_s,it.splitLines=ro,it.countColumn=ce,it.findColumn=Jn,it.isWordChar=At,it.Pass=Dn,it.signal=zi,it.Line=ko,it.changeEnd=_u,it.scrollbarModel=ng,it.Pos=Qt,it.cmpPos=Zt,it.modes=dr,it.mimeModes=br,it.resolveMode=In,it.getMode=ve,it.modeExtensions=he,it.extendMode=oe,it.copyState=xn,it.startState=Zn,it.innerMode=Cn,it.commands=Wu,it.keyMap=Ma,it.keyName=qp,it.isModifierKey=Sd,it.lookupKey=il,it.normalizeKeyMap=vg,it.StringStream=Ke,it.SharedTextMarker=Ul,it.TextMarker=ue,it.LineWidget=gu,it.e_preventDefault=Ki,it.e_stopPropagation=hr,it.e_stop=Ro,it.addClass=hn,it.contains=Je,it.rmClass=jt,it.keyNames=Yl}im(Uo),Uu(Uo);var pu="iter insert remove copy getEditor constructor".split(" ");for(var mc in _s.prototype)_s.prototype.hasOwnProperty(mc)&&tn(pu,mc)<0&&(Uo.prototype[mc]=function(it){return function(){return it.apply(this.doc,arguments)}}(_s.prototype[mc]));return Fi(_s),Uo.inputStyles={textarea:os,contenteditable:cr},Uo.defineMode=function(it){!Uo.defaults.mode&&it!="null"&&(Uo.defaults.mode=it),qr.apply(this,arguments)},Uo.defineMIME=ii,Uo.defineMode("null",function(){return{token:function(it){return it.skipToEnd()}}}),Uo.defineMIME("text/plain","null"),Uo.defineExtension=function(it,st){Uo.prototype[it]=st},Uo.defineDocExtension=function(it,st){_s.prototype[it]=st},Uo.fromTextArea=sm,Ed(Uo),Uo.version="5.58.2",Uo})},25419:function(un,Gn,Yt){(function(St){St(Yt(89780),Yt(15525),Yt(98101))})(function(St){"use strict";St.defineMode("markdown",function(fe,be){var Xe=St.getMode(fe,"text/html"),ge=Xe.name=="null";function re(ce){if(St.findModeByName){var Kt=St.findModeByName(ce);Kt&&(ce=Kt.mime||Kt.mimes[0])}var tn=St.getMode(fe,ce);return tn.name=="null"?null:tn}be.highlightFormatting===void 0&&(be.highlightFormatting=!1),be.maxBlockquoteDepth===void 0&&(be.maxBlockquoteDepth=0),be.taskLists===void 0&&(be.taskLists=!1),be.strikethrough===void 0&&(be.strikethrough=!1),be.emoji===void 0&&(be.emoji=!1),be.fencedCodeBlockHighlighting===void 0&&(be.fencedCodeBlockHighlighting=!0),be.fencedCodeBlockDefaultMode===void 0&&(be.fencedCodeBlockDefaultMode="text/plain"),be.xml===void 0&&(be.xml=!0),be.tokenTypeOverrides===void 0&&(be.tokenTypeOverrides={});var se={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 Ie in se)se.hasOwnProperty(Ie)&&be.tokenTypeOverrides[Ie]&&(se[Ie]=be.tokenTypeOverrides[Ie]);var Le=/^([*\-_])(?:\s*\1){2,}\s*$/,$t=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,Ze=/^\[(x| )\](?=\s)/i,ae=be.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,Re=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Nt=/^[^#!\[\]*_\\<>` "'(~:]+/,et=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,nt=/^\s*\[[^\]]+?\]:.*$/,ct=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,lt=" ";function pt(ce,Kt,tn){return Kt.f=Kt.inline=tn,tn(ce,Kt)}function vt(ce,Kt,tn){return Kt.f=Kt.block=tn,tn(ce,Kt)}function Lt(ce){return!ce||!/\S/.test(ce.string)}function bt(ce){if(ce.linkTitle=!1,ce.linkHref=!1,ce.linkText=!1,ce.em=!1,ce.strong=!1,ce.strikethrough=!1,ce.quote=0,ce.indentedCode=!1,ce.f==jt){var Kt=ge;if(!Kt){var tn=St.innerMode(Xe,ce.htmlState);Kt=tn.mode.name=="xml"&&tn.state.tagStart===null&&!tn.state.context&&tn.state.tokenize.isInText}Kt&&(ce.f=Ge,ce.block=Gt,ce.htmlState=null)}return ce.trailingSpace=0,ce.trailingSpaceNewLine=!1,ce.prevLine=ce.thisLine,ce.thisLine={stream:null},null}function Gt(ce,Kt){var tn=ce.column()===Kt.indentation,Yn=Lt(Kt.prevLine.stream),Dn=Kt.indentedCode,je=Kt.prevLine.hr,gn=Kt.list!==!1,Tn=(Kt.listStack[Kt.listStack.length-1]||0)+3;Kt.indentedCode=!1;var Jn=Kt.indentation;if(Kt.indentationDiff===null&&(Kt.indentationDiff=Kt.indentation,gn)){for(Kt.list=null;Jn<Kt.listStack[Kt.listStack.length-1];)Kt.listStack.pop(),Kt.listStack.length?Kt.indentation=Kt.listStack[Kt.listStack.length-1]:Kt.list=!1;Kt.list!==!1&&(Kt.indentationDiff=Jn-Kt.listStack[Kt.listStack.length-1])}var Pn=!Yn&&!je&&!Kt.prevLine.header&&(!gn||!Dn)&&!Kt.prevLine.fencedCodeEnd,Qn=(Kt.list===!1||je||Yn)&&Kt.indentation<=Tn&&ce.match(Le),ee=null;if(Kt.indentationDiff>=4&&(Dn||Kt.prevLine.fencedCodeEnd||Kt.prevLine.header||Yn))return ce.skipToEnd(),Kt.indentedCode=!0,se.code;if(ce.eatSpace())return null;if(tn&&Kt.indentation<=Tn&&(ee=ce.match(ae))&&ee[1].length<=6)return Kt.quote=0,Kt.header=ee[1].length,Kt.thisLine.header=!0,be.highlightFormatting&&(Kt.formatting="header"),Kt.f=Kt.inline,ie(Kt);if(Kt.indentation<=Tn&&ce.eat(">"))return Kt.quote=tn?1:Kt.quote+1,be.highlightFormatting&&(Kt.formatting="quote"),ce.eatSpace(),ie(Kt);if(!Qn&&!Kt.setext&&tn&&Kt.indentation<=Tn&&(ee=ce.match($t))){var jn=ee[1]?"ol":"ul";return Kt.indentation=Jn+ce.current().length,Kt.list=!0,Kt.quote=0,Kt.listStack.push(Kt.indentation),Kt.em=!1,Kt.strong=!1,Kt.code=!1,Kt.strikethrough=!1,be.taskLists&&ce.match(Ze,!1)&&(Kt.taskList=!0),Kt.f=Kt.inline,be.highlightFormatting&&(Kt.formatting=["list","list-"+jn]),ie(Kt)}else{if(tn&&Kt.indentation<=Tn&&(ee=ce.match(et,!0)))return Kt.quote=0,Kt.fencedEndRE=new RegExp(ee[1]+"+ *$"),Kt.localMode=be.fencedCodeBlockHighlighting&&re(ee[2]||be.fencedCodeBlockDefaultMode),Kt.localMode&&(Kt.localState=St.startState(Kt.localMode)),Kt.f=Kt.block=ne,be.highlightFormatting&&(Kt.formatting="code-block"),Kt.code=-1,ie(Kt);if(Kt.setext||(!Pn||!gn)&&!Kt.quote&&Kt.list===!1&&!Kt.code&&!Qn&&!nt.test(ce.string)&&(ee=ce.lookAhead(1))&&(ee=ee.match(Re)))return Kt.setext?(Kt.header=Kt.setext,Kt.setext=0,ce.skipToEnd(),be.highlightFormatting&&(Kt.formatting="header")):(Kt.header=ee[0].charAt(0)=="="?1:2,Kt.setext=Kt.header),Kt.thisLine.header=!0,Kt.f=Kt.inline,ie(Kt);if(Qn)return ce.skipToEnd(),Kt.hr=!0,Kt.thisLine.hr=!0,se.hr;if(ce.peek()==="[")return pt(ce,Kt,Fn)}return pt(ce,Kt,Kt.inline)}function jt(ce,Kt){var tn=Xe.token(ce,Kt.htmlState);if(!ge){var Yn=St.innerMode(Xe,Kt.htmlState);(Yn.mode.name=="xml"&&Yn.state.tagStart===null&&!Yn.state.context&&Yn.state.tokenize.isInText||Kt.md_inside&&ce.current().indexOf(">")>-1)&&(Kt.f=Ge,Kt.block=Gt,Kt.htmlState=null)}return tn}function ne(ce,Kt){var tn=Kt.listStack[Kt.listStack.length-1]||0,Yn=Kt.indentation<tn,Dn=tn+3;if(Kt.fencedEndRE&&Kt.indentation<=Dn&&(Yn||ce.match(Kt.fencedEndRE))){be.highlightFormatting&&(Kt.formatting="code-block");var je;return Yn||(je=ie(Kt)),Kt.localMode=Kt.localState=null,Kt.block=Gt,Kt.f=Ge,Kt.fencedEndRE=null,Kt.code=0,Kt.thisLine.fencedCodeEnd=!0,Yn?vt(ce,Kt,Kt.block):je}else return Kt.localMode?Kt.localMode.token(ce,Kt.localState):(ce.skipToEnd(),se.code)}function ie(ce){var Kt=[];if(ce.formatting){Kt.push(se.formatting),typeof ce.formatting=="string"&&(ce.formatting=[ce.formatting]);for(var tn=0;tn<ce.formatting.length;tn++)Kt.push(se.formatting+"-"+ce.formatting[tn]),ce.formatting[tn]==="header"&&Kt.push(se.formatting+"-"+ce.formatting[tn]+"-"+ce.header),ce.formatting[tn]==="quote"&&(!be.maxBlockquoteDepth||be.maxBlockquoteDepth>=ce.quote?Kt.push(se.formatting+"-"+ce.formatting[tn]+"-"+ce.quote):Kt.push("error"))}if(ce.taskOpen)return Kt.push("meta"),Kt.length?Kt.join(" "):null;if(ce.taskClosed)return Kt.push("property"),Kt.length?Kt.join(" "):null;if(ce.linkHref?Kt.push(se.linkHref,"url"):(ce.strong&&Kt.push(se.strong),ce.em&&Kt.push(se.em),ce.strikethrough&&Kt.push(se.strikethrough),ce.emoji&&Kt.push(se.emoji),ce.linkText&&Kt.push(se.linkText),ce.code&&Kt.push(se.code),ce.image&&Kt.push(se.image),ce.imageAltText&&Kt.push(se.imageAltText,"link"),ce.imageMarker&&Kt.push(se.imageMarker)),ce.header&&Kt.push(se.header,se.header+"-"+ce.header),ce.quote&&(Kt.push(se.quote),!be.maxBlockquoteDepth||be.maxBlockquoteDepth>=ce.quote?Kt.push(se.quote+"-"+ce.quote):Kt.push(se.quote+"-"+be.maxBlockquoteDepth)),ce.list!==!1){var Yn=(ce.listStack.length-1)%3;Yn?Yn===1?Kt.push(se.list2):Kt.push(se.list3):Kt.push(se.list1)}return ce.trailingSpaceNewLine?Kt.push("trailing-space-new-line"):ce.trailingSpace&&Kt.push("trailing-space-"+(ce.trailingSpace%2?"a":"b")),Kt.length?Kt.join(" "):null}function te(ce,Kt){if(ce.match(Nt,!0))return ie(Kt)}function Ge(ce,Kt){var tn=Kt.text(ce,Kt);if(typeof tn!="undefined")return tn;if(Kt.list)return Kt.list=null,ie(Kt);if(Kt.taskList){var Yn=ce.match(Ze,!0)[1]===" ";return Yn?Kt.taskOpen=!0:Kt.taskClosed=!0,be.highlightFormatting&&(Kt.formatting="task"),Kt.taskList=!1,ie(Kt)}if(Kt.taskOpen=!1,Kt.taskClosed=!1,Kt.header&&ce.match(/^#+$/,!0))return be.highlightFormatting&&(Kt.formatting="header"),ie(Kt);var Dn=ce.next();if(Kt.linkTitle){Kt.linkTitle=!1;var je=Dn;Dn==="("&&(je=")"),je=(je+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var gn="^\\s*(?:[^"+je+"\\\\]+|\\\\\\\\|\\\\.)"+je;if(ce.match(new RegExp(gn),!0))return se.linkHref}if(Dn==="`"){var Tn=Kt.formatting;be.highlightFormatting&&(Kt.formatting="code"),ce.eatWhile("`");var Jn=ce.current().length;if(Kt.code==0&&(!Kt.quote||Jn==1))return Kt.code=Jn,ie(Kt);if(Jn==Kt.code){var Pn=ie(Kt);return Kt.code=0,Pn}else return Kt.formatting=Tn,ie(Kt)}else if(Kt.code)return ie(Kt);if(Dn==="\\"&&(ce.next(),be.highlightFormatting)){var Qn=ie(Kt),ee=se.formatting+"-escape";return Qn?Qn+" "+ee:ee}if(Dn==="!"&&ce.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return Kt.imageMarker=!0,Kt.image=!0,be.highlightFormatting&&(Kt.formatting="image"),ie(Kt);if(Dn==="["&&Kt.imageMarker&&ce.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return Kt.imageMarker=!1,Kt.imageAltText=!0,be.highlightFormatting&&(Kt.formatting="image"),ie(Kt);if(Dn==="]"&&Kt.imageAltText){be.highlightFormatting&&(Kt.formatting="image");var Qn=ie(Kt);return Kt.imageAltText=!1,Kt.image=!1,Kt.inline=Kt.f=Je,Qn}if(Dn==="["&&!Kt.image)return Kt.linkText&&ce.match(/^.*?\]/)||(Kt.linkText=!0,be.highlightFormatting&&(Kt.formatting="link")),ie(Kt);if(Dn==="]"&&Kt.linkText){be.highlightFormatting&&(Kt.formatting="link");var Qn=ie(Kt);return Kt.linkText=!1,Kt.inline=Kt.f=ce.match(/\(.*?\)| ?\[.*?\]/,!1)?Je:Ge,Qn}if(Dn==="<"&&ce.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){Kt.f=Kt.inline=pe,be.highlightFormatting&&(Kt.formatting="link");var Qn=ie(Kt);return Qn?Qn+=" ":Qn="",Qn+se.linkInline}if(Dn==="<"&&ce.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){Kt.f=Kt.inline=pe,be.highlightFormatting&&(Kt.formatting="link");var Qn=ie(Kt);return Qn?Qn+=" ":Qn="",Qn+se.linkEmail}if(be.xml&&Dn==="<"&&ce.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var jn=ce.string.indexOf(">",ce.pos);if(jn!=-1){var hi=ce.string.substring(ce.start,jn);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(hi)&&(Kt.md_inside=!0)}return ce.backUp(1),Kt.htmlState=St.startState(Xe),vt(ce,Kt,jt)}if(be.xml&&Dn==="<"&&ce.match(/^\/\w*?>/))return Kt.md_inside=!1,"tag";if(Dn==="*"||Dn==="_"){for(var Dt=1,kt=ce.pos==1?" ":ce.string.charAt(ce.pos-2);Dt<3&&ce.eat(Dn);)Dt++;var wt=ce.peek()||" ",At=!/\s/.test(wt)&&(!ct.test(wt)||/\s/.test(kt)||ct.test(kt)),_t=!/\s/.test(kt)&&(!ct.test(kt)||/\s/.test(wt)||ct.test(wt)),Et=null,Pe=null;if(Dt%2&&(!Kt.em&&At&&(Dn==="*"||!_t||ct.test(kt))?Et=!0:Kt.em==Dn&&_t&&(Dn==="*"||!At||ct.test(wt))&&(Et=!1)),Dt>1&&(!Kt.strong&&At&&(Dn==="*"||!_t||ct.test(kt))?Pe=!0:Kt.strong==Dn&&_t&&(Dn==="*"||!At||ct.test(wt))&&(Pe=!1)),Pe!=null||Et!=null){be.highlightFormatting&&(Kt.formatting=Et==null?"strong":Pe==null?"em":"strong em"),Et===!0&&(Kt.em=Dn),Pe===!0&&(Kt.strong=Dn);var Pn=ie(Kt);return Et===!1&&(Kt.em=!1),Pe===!1&&(Kt.strong=!1),Pn}}else if(Dn===" "&&(ce.eat("*")||ce.eat("_"))){if(ce.peek()===" ")return ie(Kt);ce.backUp(1)}if(be.strikethrough){if(Dn==="~"&&ce.eatWhile(Dn)){if(Kt.strikethrough){be.highlightFormatting&&(Kt.formatting="strikethrough");var Pn=ie(Kt);return Kt.strikethrough=!1,Pn}else if(ce.match(/^[^\s]/,!1))return Kt.strikethrough=!0,be.highlightFormatting&&(Kt.formatting="strikethrough"),ie(Kt)}else if(Dn===" "&&ce.match(/^~~/,!0)){if(ce.peek()===" ")return ie(Kt);ce.backUp(2)}}if(be.emoji&&Dn===":"&&ce.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){Kt.emoji=!0,be.highlightFormatting&&(Kt.formatting="emoji");var Ee=ie(Kt);return Kt.emoji=!1,Ee}return Dn===" "&&(ce.match(/^ +$/,!1)?Kt.trailingSpace++:Kt.trailingSpace&&(Kt.trailingSpaceNewLine=!0)),ie(Kt)}function pe(ce,Kt){var tn=ce.next();if(tn===">"){Kt.f=Kt.inline=Ge,be.highlightFormatting&&(Kt.formatting="link");var Yn=ie(Kt);return Yn?Yn+=" ":Yn="",Yn+se.linkInline}return ce.match(/^[^>]+/,!0),se.linkInline}function Je(ce,Kt){if(ce.eatSpace())return null;var tn=ce.next();return tn==="("||tn==="["?(Kt.f=Kt.inline=hn(tn==="("?")":"]"),be.highlightFormatting&&(Kt.formatting="link-string"),Kt.linkHref=!0,ie(Kt)):"error"}var Ye={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function hn(ce){return function(Kt,tn){var Yn=Kt.next();if(Yn===ce){tn.f=tn.inline=Ge,be.highlightFormatting&&(tn.formatting="link-string");var Dn=ie(tn);return tn.linkHref=!1,Dn}return Kt.match(Ye[ce]),tn.linkHref=!0,ie(tn)}}function Fn(ce,Kt){return ce.match(/^([^\]\\]|\\.)*\]:/,!1)?(Kt.f=vn,ce.next(),be.highlightFormatting&&(Kt.formatting="link"),Kt.linkText=!0,ie(Kt)):pt(ce,Kt,Ge)}function vn(ce,Kt){if(ce.match(/^\]:/,!0)){Kt.f=Kt.inline=pi,be.highlightFormatting&&(Kt.formatting="link");var tn=ie(Kt);return Kt.linkText=!1,tn}return ce.match(/^([^\]\\]|\\.)+/,!0),se.linkText}function pi(ce,Kt){return ce.eatSpace()?null:(ce.match(/^[^\s]+/,!0),ce.peek()===void 0?Kt.linkTitle=!0:ce.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),Kt.f=Kt.inline=Ge,se.linkHref+" url")}var yn={startState:function(){return{f:Gt,prevLine:{stream:null},thisLine:{stream:null},block:Gt,htmlState:null,indentation:0,inline:Ge,text:te,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(ce){return{f:ce.f,prevLine:ce.prevLine,thisLine:ce.thisLine,block:ce.block,htmlState:ce.htmlState&&St.copyState(Xe,ce.htmlState),indentation:ce.indentation,localMode:ce.localMode,localState:ce.localMode?St.copyState(ce.localMode,ce.localState):null,inline:ce.inline,text:ce.text,formatting:!1,linkText:ce.linkText,linkTitle:ce.linkTitle,linkHref:ce.linkHref,code:ce.code,em:ce.em,strong:ce.strong,strikethrough:ce.strikethrough,emoji:ce.emoji,header:ce.header,setext:ce.setext,hr:ce.hr,taskList:ce.taskList,list:ce.list,listStack:ce.listStack.slice(0),quote:ce.quote,indentedCode:ce.indentedCode,trailingSpace:ce.trailingSpace,trailingSpaceNewLine:ce.trailingSpaceNewLine,md_inside:ce.md_inside,fencedEndRE:ce.fencedEndRE}},token:function(ce,Kt){if(Kt.formatting=!1,ce!=Kt.thisLine.stream){if(Kt.header=0,Kt.hr=!1,ce.match(/^\s*$/,!0))return bt(Kt),null;if(Kt.prevLine=Kt.thisLine,Kt.thisLine={stream:ce},Kt.taskList=!1,Kt.trailingSpace=0,Kt.trailingSpaceNewLine=!1,!Kt.localState&&(Kt.f=Kt.block,Kt.f!=jt)){var tn=ce.match(/^\s*/,!0)[0].replace(/\t/g,lt).length;if(Kt.indentation=tn,Kt.indentationDiff=null,tn>0)return null}}return Kt.f(ce,Kt)},innerMode:function(ce){return ce.block==jt?{state:ce.htmlState,mode:Xe}:ce.localState?{state:ce.localState,mode:ce.localMode}:{state:ce,mode:yn}},indent:function(ce,Kt,tn){return ce.block==jt&&Xe.indent?Xe.indent(ce.htmlState,Kt,tn):ce.localState&&ce.localMode.indent?ce.localMode.indent(ce.localState,Kt,tn):St.Pass},blankLine:bt,getType:ie,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return yn},"xml"),St.defineMIME("text/markdown","markdown"),St.defineMIME("text/x-markdown","markdown")})},98101:function(un,Gn,Yt){(function(St){St(Yt(89780))})(function(St){"use strict";St.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 fe=0;fe<St.modeInfo.length;fe++){var be=St.modeInfo[fe];be.mimes&&(be.mime=be.mimes[0])}St.findModeByMIME=function(Xe){Xe=Xe.toLowerCase();for(var ge=0;ge<St.modeInfo.length;ge++){var re=St.modeInfo[ge];if(re.mime==Xe)return re;if(re.mimes){for(var se=0;se<re.mimes.length;se++)if(re.mimes[se]==Xe)return re}}if(/\+xml$/.test(Xe))return St.findModeByMIME("application/xml");if(/\+json$/.test(Xe))return St.findModeByMIME("application/json")},St.findModeByExtension=function(Xe){Xe=Xe.toLowerCase();for(var ge=0;ge<St.modeInfo.length;ge++){var re=St.modeInfo[ge];if(re.ext){for(var se=0;se<re.ext.length;se++)if(re.ext[se]==Xe)return re}}},St.findModeByFileName=function(Xe){for(var ge=0;ge<St.modeInfo.length;ge++){var re=St.modeInfo[ge];if(re.file&&re.file.test(Xe))return re}var se=Xe.lastIndexOf("."),Ie=se>-1&&Xe.substring(se+1,Xe.length);if(Ie)return St.findModeByExtension(Ie)},St.findModeByName=function(Xe){Xe=Xe.toLowerCase();for(var ge=0;ge<St.modeInfo.length;ge++){var re=St.modeInfo[ge];if(re.name.toLowerCase()==Xe)return re;if(re.alias){for(var se=0;se<re.alias.length;se++)if(re.alias[se].toLowerCase()==Xe)return re}}}})},67549:function(un,Gn,Yt){(function(St){St(Yt(89780))})(function(St){"use strict";St.defineMode("stex",function(fe,be){"use strict";function Xe(Nt,et){Nt.cmdState.push(et)}function ge(Nt){return Nt.cmdState.length>0?Nt.cmdState[Nt.cmdState.length-1]:null}function re(Nt){var et=Nt.cmdState.pop();et&&et.closeBracket()}function se(Nt){for(var et=Nt.cmdState,nt=et.length-1;nt>=0;nt--){var ct=et[nt];if(ct.name!="DEFAULT")return ct}return{styleIdentifier:function(){return null}}}function Ie(Nt,et,nt){return function(){this.name=Nt,this.bracketNo=0,this.style=et,this.styles=nt,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var Le={};Le.importmodule=Ie("importmodule","tag",["string","builtin"]),Le.documentclass=Ie("documentclass","tag",["","atom"]),Le.usepackage=Ie("usepackage","tag",["atom"]),Le.begin=Ie("begin","tag",["atom"]),Le.end=Ie("end","tag",["atom"]),Le.label=Ie("label","tag",["atom"]),Le.ref=Ie("ref","tag",["atom"]),Le.eqref=Ie("eqref","tag",["atom"]),Le.cite=Ie("cite","tag",["atom"]),Le.bibitem=Ie("bibitem","tag",["atom"]),Le.Bibitem=Ie("Bibitem","tag",["atom"]),Le.RBibitem=Ie("RBibitem","tag",["atom"]),Le.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function $t(Nt,et){Nt.f=et}function Ze(Nt,et){var nt;if(Nt.match(/^\\[a-zA-Z@]+/)){var ct=Nt.current().slice(1);return nt=Le.hasOwnProperty(ct)?Le[ct]:Le.DEFAULT,nt=new nt,Xe(et,nt),$t(et,Re),nt.style}if(Nt.match(/^\\[$&%#{}_]/)||Nt.match(/^\\[,;!\/\\]/))return"tag";if(Nt.match("\\["))return $t(et,function(pt,vt){return ae(pt,vt,"\\]")}),"keyword";if(Nt.match("\\("))return $t(et,function(pt,vt){return ae(pt,vt,"\\)")}),"keyword";if(Nt.match("$$"))return $t(et,function(pt,vt){return ae(pt,vt,"$$")}),"keyword";if(Nt.match("$"))return $t(et,function(pt,vt){return ae(pt,vt,"$")}),"keyword";var lt=Nt.next();if(lt=="%")return Nt.skipToEnd(),"comment";if(lt=="}"||lt=="]"){if(nt=ge(et),nt)nt.closeBracket(lt),$t(et,Re);else return"error";return"bracket"}else return lt=="{"||lt=="["?(nt=Le.DEFAULT,nt=new nt,Xe(et,nt),"bracket"):/\d/.test(lt)?(Nt.eatWhile(/[\w.%]/),"atom"):(Nt.eatWhile(/[\w\-_]/),nt=se(et),nt.name=="begin"&&(nt.argument=Nt.current()),nt.styleIdentifier())}function ae(Nt,et,nt){if(Nt.eatSpace())return null;if(nt&&Nt.match(nt))return $t(et,Ze),"keyword";if(Nt.match(/^\\[a-zA-Z@]+/))return"tag";if(Nt.match(/^[a-zA-Z]+/))return"variable-2";if(Nt.match(/^\\[$&%#{}_]/)||Nt.match(/^\\[,;!\/]/)||Nt.match(/^[\^_&]/))return"tag";if(Nt.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Nt.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var ct=Nt.next();return ct=="{"||ct=="}"||ct=="["||ct=="]"||ct=="("||ct==")"?"bracket":ct=="%"?(Nt.skipToEnd(),"comment"):"error"}function Re(Nt,et){var nt=Nt.peek(),ct;return nt=="{"||nt=="["?(ct=ge(et),ct.openBracket(nt),Nt.eat(nt),$t(et,Ze),"bracket"):/[ \t\r]/.test(nt)?(Nt.eat(nt),null):($t(et,Ze),re(et),Ze(Nt,et))}return{startState:function(){var Nt=be.inMathMode?function(et,nt){return ae(et,nt)}:Ze;return{cmdState:[],f:Nt}},copyState:function(Nt){return{cmdState:Nt.cmdState.slice(),f:Nt.f}},token:function(Nt,et){return et.f(Nt,et)},blankLine:function(Nt){Nt.f=Ze,Nt.cmdState.length=0},lineComment:"%"}}),St.defineMIME("text/x-stex","stex"),St.defineMIME("text/x-latex","stex")})},15525:function(un,Gn,Yt){(function(St){St(Yt(89780))})(function(St){"use strict";var fe={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},be={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};St.defineMode("xml",function(Xe,ge){var re=Xe.indentUnit,se={},Ie=ge.htmlMode?fe:be;for(var Le in Ie)se[Le]=Ie[Le];for(var Le in ge)se[Le]=ge[Le];var $t,Ze;function ae(pe,Je){function Ye(vn){return Je.tokenize=vn,vn(pe,Je)}var hn=pe.next();if(hn=="<")return pe.eat("!")?pe.eat("[")?pe.match("CDATA[")?Ye(et("atom","]]>")):null:pe.match("--")?Ye(et("comment","-->")):pe.match("DOCTYPE",!0,!0)?(pe.eatWhile(/[\w\._\-]/),Ye(nt(1))):null:pe.eat("?")?(pe.eatWhile(/[\w\._\-]/),Je.tokenize=et("meta","?>"),"meta"):($t=pe.eat("/")?"closeTag":"openTag",Je.tokenize=Re,"tag bracket");if(hn=="&"){var Fn;return pe.eat("#")?pe.eat("x")?Fn=pe.eatWhile(/[a-fA-F\d]/)&&pe.eat(";"):Fn=pe.eatWhile(/[\d]/)&&pe.eat(";"):Fn=pe.eatWhile(/[\w\.\-:]/)&&pe.eat(";"),Fn?"atom":"error"}else return pe.eatWhile(/[^&<]/),null}ae.isInText=!0;function Re(pe,Je){var Ye=pe.next();if(Ye==">"||Ye=="/"&&pe.eat(">"))return Je.tokenize=ae,$t=Ye==">"?"endTag":"selfcloseTag","tag bracket";if(Ye=="=")return $t="equals",null;if(Ye=="<"){Je.tokenize=ae,Je.state=vt,Je.tagName=Je.tagStart=null;var hn=Je.tokenize(pe,Je);return hn?hn+" tag error":"tag error"}else return/[\'\"]/.test(Ye)?(Je.tokenize=Nt(Ye),Je.stringStartCol=pe.column(),Je.tokenize(pe,Je)):(pe.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Nt(pe){var Je=function(Ye,hn){for(;!Ye.eol();)if(Ye.next()==pe){hn.tokenize=Re;break}return"string"};return Je.isInAttribute=!0,Je}function et(pe,Je){return function(Ye,hn){for(;!Ye.eol();){if(Ye.match(Je)){hn.tokenize=ae;break}Ye.next()}return pe}}function nt(pe){return function(Je,Ye){for(var hn;(hn=Je.next())!=null;){if(hn=="<")return Ye.tokenize=nt(pe+1),Ye.tokenize(Je,Ye);if(hn==">")if(pe==1){Ye.tokenize=ae;break}else return Ye.tokenize=nt(pe-1),Ye.tokenize(Je,Ye)}return"meta"}}function ct(pe,Je,Ye){this.prev=pe.context,this.tagName=Je,this.indent=pe.indented,this.startOfLine=Ye,(se.doNotIndent.hasOwnProperty(Je)||pe.context&&pe.context.noIndent)&&(this.noIndent=!0)}function lt(pe){pe.context&&(pe.context=pe.context.prev)}function pt(pe,Je){for(var Ye;;){if(!pe.context||(Ye=pe.context.tagName,!se.contextGrabbers.hasOwnProperty(Ye)||!se.contextGrabbers[Ye].hasOwnProperty(Je)))return;lt(pe)}}function vt(pe,Je,Ye){return pe=="openTag"?(Ye.tagStart=Je.column(),Lt):pe=="closeTag"?bt:vt}function Lt(pe,Je,Ye){return pe=="word"?(Ye.tagName=Je.current(),Ze="tag",ne):se.allowMissingTagName&&pe=="endTag"?(Ze="tag bracket",ne(pe,Je,Ye)):(Ze="error",Lt)}function bt(pe,Je,Ye){if(pe=="word"){var hn=Je.current();return Ye.context&&Ye.context.tagName!=hn&&se.implicitlyClosed.hasOwnProperty(Ye.context.tagName)&&lt(Ye),Ye.context&&Ye.context.tagName==hn||se.matchClosing===!1?(Ze="tag",Gt):(Ze="tag error",jt)}else return se.allowMissingTagName&&pe=="endTag"?(Ze="tag bracket",Gt(pe,Je,Ye)):(Ze="error",jt)}function Gt(pe,Je,Ye){return pe!="endTag"?(Ze="error",Gt):(lt(Ye),vt)}function jt(pe,Je,Ye){return Ze="error",Gt(pe,Je,Ye)}function ne(pe,Je,Ye){if(pe=="word")return Ze="attribute",ie;if(pe=="endTag"||pe=="selfcloseTag"){var hn=Ye.tagName,Fn=Ye.tagStart;return Ye.tagName=Ye.tagStart=null,pe=="selfcloseTag"||se.autoSelfClosers.hasOwnProperty(hn)?pt(Ye,hn):(pt(Ye,hn),Ye.context=new ct(Ye,hn,Fn==Ye.indented)),vt}return Ze="error",ne}function ie(pe,Je,Ye){return pe=="equals"?te:(se.allowMissing||(Ze="error"),ne(pe,Je,Ye))}function te(pe,Je,Ye){return pe=="string"?Ge:pe=="word"&&se.allowUnquoted?(Ze="string",ne):(Ze="error",ne(pe,Je,Ye))}function Ge(pe,Je,Ye){return pe=="string"?Ge:ne(pe,Je,Ye)}return{startState:function(pe){var Je={tokenize:ae,state:vt,indented:pe||0,tagName:null,tagStart:null,context:null};return pe!=null&&(Je.baseIndent=pe),Je},token:function(pe,Je){if(!Je.tagName&&pe.sol()&&(Je.indented=pe.indentation()),pe.eatSpace())return null;$t=null;var Ye=Je.tokenize(pe,Je);return(Ye||$t)&&Ye!="comment"&&(Ze=null,Je.state=Je.state($t||Ye,pe,Je),Ze&&(Ye=Ze=="error"?Ye+" error":Ze)),Ye},indent:function(pe,Je,Ye){var hn=pe.context;if(pe.tokenize.isInAttribute)return pe.tagStart==pe.indented?pe.stringStartCol+1:pe.indented+re;if(hn&&hn.noIndent)return St.Pass;if(pe.tokenize!=Re&&pe.tokenize!=ae)return Ye?Ye.match(/^(\s*)/)[0].length:0;if(pe.tagName)return se.multilineTagIndentPastTag!==!1?pe.tagStart+pe.tagName.length+2:pe.tagStart+re*(se.multilineTagIndentFactor||1);if(se.alignCDATA&&/<!\[CDATA\[/.test(Je))return 0;var Fn=Je&&/^<(\/)?([\w_:\.-]*)/.exec(Je);if(Fn&&Fn[1])for(;hn;)if(hn.tagName==Fn[2]){hn=hn.prev;break}else if(se.implicitlyClosed.hasOwnProperty(hn.tagName))hn=hn.prev;else break;else if(Fn)for(;hn;){var vn=se.contextGrabbers[hn.tagName];if(vn&&vn.hasOwnProperty(Fn[2]))hn=hn.prev;else break}for(;hn&&hn.prev&&!hn.startOfLine;)hn=hn.prev;return hn?hn.indent+re:pe.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:se.htmlMode?"html":"xml",helperType:se.htmlMode?"html":"xml",skipAttribute:function(pe){pe.state==te&&(pe.state=ne)},xmlCurrentTag:function(pe){return pe.tagName?{name:pe.tagName,close:pe.type=="closeTag"}:null},xmlCurrentContext:function(pe){for(var Je=[],Ye=pe.context;Ye;Ye=Ye.prev)Ye.tagName&&Je.push(Ye.tagName);return Je.reverse()}}}),St.defineMIME("text/xml","xml"),St.defineMIME("application/xml","xml"),St.mimeModes.hasOwnProperty("text/html")||St.defineMIME("text/html",{name:"xml",htmlMode:!0})})},12378:function(un,Gn,Yt){"use strict";Yt.d(Gn,{$u:function(){return Le},BD:function(){return Dt},E9:function(){return Ie},FF:function(){return Br},FJ:function(){return vt},Hn:function(){return pt},KX:function(){return bt},NB:function(){return Ae},S0:function(){return ee},UL:function(){return $t},Vk:function(){return lt},Vm:function(){return en},YI:function(){return jn},ZA:function(){return be},Zt:function(){return Ze},al:function(){return Et},bn:function(){return _t},bx:function(){return kt},g2:function(){return hi},h1:function(){return te},hD:function(){return Fi},l4:function(){return re},rU:function(){return qe},s_:function(){return wt},uz:function(){return He},z6:function(){return ae}}),un=Yt.hmd(un),function(){var Ct;function Go(a){var y=0;return function(){return y<a.length?{done:!1,value:a[y++]}:{done:!0}}}function lo(a){var y=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];return y?y.call(a):{next:Go(a)}}function jo(a){for(var y,x=[];!(y=a.next()).done;)x.push(y.value);return x}var dr=typeof Object.create=="function"?Object.create:function(a){function y(){}return y.prototype=a,new y},br;if(typeof Object.setPrototypeOf=="function")br=Object.setPrototypeOf;else{var qr;t:{var ii={a:!0},In={};try{In.__proto__=ii,qr=In.a;break t}catch(a){}qr=!1}br=qr?function(a,y){if(a.__proto__=y,a.__proto__!==y)throw new TypeError(a+" is not extensible");return a}:null}var ve=br;function he(a,y){if(a.prototype=dr(y.prototype),a.prototype.constructor=a,ve)ve(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 oe=typeof Yt.g!="undefined"&&Yt.g!=null?Yt.g:self,xn=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},Cn=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,y,x){a!=Array.prototype&&a!=Object.prototype&&(a[y]=x.value)};function Zn(a,y){if(y){var x=oe;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&&Cn(x,a,{writable:!0,value:y})}}Zn("Object.assign",function(a){return a||xn}),Zn("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 Ke=typeof globalThis=="object"&&globalThis||typeof Yt.g=="object"&&Yt.g.global===Yt.g&&Yt.g||typeof self=="object"&&self.self===self&&self||{};Ke.requestAnimationFrame===void 0&&(Ke.setImmediate===void 0?Ke.requestAnimationFrame=function(a){Ke.setTimeout(a,0)}:Ke.requestAnimationFrame=Ke.setImmediate);function pn(){}function me(a,y){var x=-1;return function(){var E=this,b=arguments;x!==-1&&Ke.clearTimeout(x),x=de(function(){x=-1,a.apply(E,b)},y)}}function de(a,y){return Ke.setTimeout(a,y)}function Sn(a){return Ke.document.createElement(a)}function Wt(a){throw Error(a)}function Ne(a,y){a="The object is frozen, so its properties cannot be set: "+a.toString(),y!==void 0&&(a+=" to value: "+y),Wt(a)}function an(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),Wt(x+" is not in the range "+y+": "+a)}function ye(a){Ke.console&&Ke.console.log(a)}function Qt(a){return typeof a=="object"&&a!==null}function Zt(a){return Array.isArray(a)||Ke.NodeList&&a instanceof Ke.NodeList||Ke.HTMLCollection&&a instanceof Ke.HTMLCollection}function De(a){return Array.prototype.slice.call(a)}function Mn(a,y,x){Array.isArray(a)?y>=a.length?a.push(x):a.splice(y,0,x):Wt("Cannot insert an object into an HTMLCollection or NodeList: "+x+" at "+y)}function Hn(a,y){Array.isArray(a)?y>=a.length?a.pop():a.splice(y,1):Wt("Cannot remove an object from an HTMLCollection or NodeList at "+y)}function ln(){var a=Ri.pop();return a===void 0?[]:a}function Be(a){a.length=0,Ri.push(a)}function we(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(Qt(a)&&a.constructor)return we(a.constructor);return typeof a}function zn(a){var y=a;return Qt(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 Vn(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 si(a,y,x){Object.defineProperty(Eo.prototype,a,{get:y,set:x})}function Fe(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 Yi=Ke.navigator!==void 0&&0<Ke.navigator.userAgent.indexOf("Trident/7"),qn=Ke.navigator!==void 0&&Ke.navigator.platform!==void 0&&Ke.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,Ri=[];Object.freeze([]),pn.className="Util",pn.Dx="32ab5ff3b26f42dc0ed90f21472913b5",pn.adym="gojs.net",pn.vfo="28e645fdb266",pn.className="Util";function Se(a,y,x){En(this),this.j=a,this.xa=y,this.o=x}Se.prototype.toString=function(){return"EnumValue."+this.xa};function on(a,y){return y==null||y===""?null:a[y]}oe.Object.defineProperties(Se.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),Se.className="EnumValue";function bn(){this.ew=[]}bn.prototype.toString=function(){return this.ew.join("")},bn.prototype.add=function(a){a!==""&&this.ew.push(a)},bn.className="StringBuilder";function Rn(){}Rn.className="PropertyCollection";var Bn={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(a){Ke.console&&Ke.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,ot){return function(){throw Error("Property "+tt.Zl[ot.Tj]+" of "+tt.x+" is read-only.")}}(y,b)})}}}y={Zl:y.Zl,x:y.x}}}};function Un(){}Un.prototype.reset=function(){},Un.prototype.next=function(){return!1},Un.prototype.Ad=function(){return!1},Un.prototype.first=function(){return null},Un.prototype.any=function(){return!1},Un.prototype.all=function(){return!0},Un.prototype.each=function(){return this},Un.prototype.map=function(){return this},Un.prototype.filter=function(){return this},Un.prototype.de=function(){},Un.prototype.toString=function(){return"EmptyIterator"},oe.Object.defineProperties(Un.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),Un.prototype.first=Un.prototype.first,Un.prototype.hasNext=Un.prototype.Ad,Un.prototype.next=Un.prototype.next,Un.prototype.reset=Un.prototype.reset;var mi=null;Un.className="EmptyIterator",mi=new Un;function ai(a){this.key=-1,this.value=a}ai.prototype.reset=function(){this.key=-1},ai.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},ai.prototype.Ad=function(){return this.next()},ai.prototype.first=function(){return this.key=0,this.value},ai.prototype.any=function(a){return this.key=-1,a(this.value)},ai.prototype.all=function(a){return this.key=-1,a(this.value)},ai.prototype.each=function(a){return this.key=-1,a(this.value),this},ai.prototype.map=function(a){return new ai(a(this.value))},ai.prototype.filter=function(a){return a(this.value)?new ai(this.value):mi},ai.prototype.de=function(){this.value=null},ai.prototype.toString=function(){return"SingletonIterator("+this.value+")"},oe.Object.defineProperties(ai.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),ai.prototype.first=ai.prototype.first,ai.prototype.hasNext=ai.prototype.Ad,ai.prototype.next=ai.prototype.next,ai.prototype.reset=ai.prototype.reset,ai.className="SingletonIterator";function ei(a){this.Bb=a,this.qf=null,a.Sa=null,this.qa=a.Ja,this.Za=-1}ei.prototype.reset=function(){var a=this.Bb;a.Sa=null,this.qa=a.Ja,this.Za=-1},ei.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},ei.prototype.Ad=function(){return this.next()},ei.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},ei.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},ei.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},ei.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},ei.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 ke,a.s=x,a.xb(),a.iterator},ei.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 ke,a.s=x,a.xb(),a.iterator},ei.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},ei.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},oe.Object.defineProperties(ei.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}}}),ei.prototype.first=ei.prototype.first,ei.prototype.hasNext=ei.prototype.Ad,ei.prototype.next=ei.prototype.next,ei.prototype.reset=ei.prototype.reset,ei.className="ListIterator";function di(a){this.Bb=a,a.Hg=null,this.qa=a.Ja,this.Za=a.s.length}di.prototype.reset=function(){var a=this.Bb;a.Hg=null,this.qa=a.Ja,this.Za=a.s.length},di.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)},di.prototype.Ad=function(){return this.next()},di.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},di.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},di.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},di.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},di.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 ke,a.s=x,a.xb(),a.iterator},di.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 ke,a.s=x,a.xb(),a.iterator},di.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},di.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},oe.Object.defineProperties(di.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),di.prototype.first=di.prototype.first,di.prototype.hasNext=di.prototype.Ad,di.prototype.next=di.prototype.next,di.prototype.reset=di.prototype.reset,di.className="ListIteratorBackwards";function ke(a){En(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof a=="string"&&Wt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}Ct=ke.prototype,Ct.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},Ct.freeze=function(){return this._isFrozen=!0,this},Ct.ka=function(){return this._isFrozen=!1,this},Ct.toString=function(){return"List()#"+ti(this)},Ct.add=function(a){return a===null?this:(this._isFrozen&&Ne(this,a),this.s.push(a),this.xb(),this)},Ct.push=function(a){this.add(a)},Ct.addAll=function(a){if(a===null)return this;this._isFrozen&&Ne(this);var y=this.s;if(Zt(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},Ct.clear=function(){this._isFrozen&&Ne(this),this.s.length=0,this.xb()},Ct.contains=function(a){return a===null?!1:this.s.indexOf(a)!==-1},Ct.has=function(a){return this.contains(a)},Ct.indexOf=function(a){return a===null?-1:this.s.indexOf(a)},Ct.M=function(a){var y=this.s;return(0>a||a>=y.length)&&an(a,"0 <= i < length",ke,"elt:i"),y[a]},Ct.get=function(a){return this.M(a)},Ct.cd=function(a,y){var x=this.s;(0>a||a>=x.length)&&an(a,"0 <= i < length",ke,"setElt:i"),this._isFrozen&&Ne(this,a),x[a]=y},Ct.set=function(a,y){this.cd(a,y)},Ct.first=function(){var a=this.s;return a.length===0?null:a[0]},Ct.jc=function(){var a=this.s,y=a.length;return 0<y?a[y-1]:null},Ct.pop=function(){this._isFrozen&&Ne(this);var a=this.s;return 0<a.length?a.pop():null},ke.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},ke.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},ke.prototype.each=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)a(y[E]);return this},ke.prototype.map=function(a){for(var y=new ke,x=[],E=this.s,b=E.length,z=0;z<b;z++)x.push(a(E[z]));return y.s=x,y.xb(),y},ke.prototype.filter=function(a){for(var y=new ke,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},Ct=ke.prototype,Ct.Gb=function(a,y){0>a&&an(a,">= 0",ke,"insertAt:i"),this._isFrozen&&Ne(this,a);var x=this.s;a>=x.length?x.push(y):x.splice(a,0,y),this.xb()},Ct.remove=function(a){if(a===null)return!1;this._isFrozen&&Ne(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)},Ct.delete=function(a){return this.remove(a)},Ct.mb=function(a){var y=this.s;(0>a||a>=y.length)&&an(a,"0 <= i < length",ke,"removeAt:i"),this._isFrozen&&Ne(this,a),a===y.length-1?y.pop():y.splice(a,1),this.xb()},Ct.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&&Ne(this);for(var b=a,z=y+1;z<E;)x[b++]=x[z++];return x.length=E-(y-a+1),this.xb(),this},ke.prototype.copy=function(){var a=new ke,y=this.s;return 0<y.length&&(a.s=Array.prototype.slice.call(y)),a},Ct=ke.prototype,Ct.Fa=function(){for(var a=this.s,y=this.count,x=Array(y),E=0;E<y;E++)x[E]=a[E];return x},Ct.Iv=function(){for(var a=new Me,y=this.s,x=this.count,E=0;E<x;E++)a.add(y[E]);return a},Ct.sort=function(a){return this._isFrozen&&Ne(this),this.s.sort(a),this.xb(),this},Ct.zi=function(a,y,x){var E=this.s,b=E.length;y===void 0&&(y=0),x===void 0&&(x=b),this._isFrozen&&Ne(this);var z=x-y;if(1>=z)return this;if((0>y||y>=b-1)&&an(y,"0 <= from < length",ke,"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},Ct.reverse=function(){return this._isFrozen&&Ne(this),this.s.reverse(),this.xb(),this},oe.Object.defineProperties(ke.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 mi;var a=this.Sa;return a!==null?(a.reset(),a):new ei(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return mi;var a=this.Hg;return a!==null?(a.reset(),a):new di(this)}}}),ke.prototype.reverse=ke.prototype.reverse,ke.prototype.sortRange=ke.prototype.zi,ke.prototype.sort=ke.prototype.sort,ke.prototype.toSet=ke.prototype.Iv,ke.prototype.toArray=ke.prototype.Fa,ke.prototype.removeRange=ke.prototype.removeRange,ke.prototype.removeAt=ke.prototype.mb,ke.prototype.delete=ke.prototype.delete,ke.prototype.remove=ke.prototype.remove,ke.prototype.insertAt=ke.prototype.Gb,ke.prototype.pop=ke.prototype.pop,ke.prototype.last=ke.prototype.jc,ke.prototype.first=ke.prototype.first,ke.prototype.set=ke.prototype.set,ke.prototype.setElt=ke.prototype.cd,ke.prototype.get=ke.prototype.get,ke.prototype.elt=ke.prototype.M,ke.prototype.indexOf=ke.prototype.indexOf,ke.prototype.has=ke.prototype.has,ke.prototype.contains=ke.prototype.contains,ke.prototype.clear=ke.prototype.clear,ke.prototype.addAll=ke.prototype.addAll,ke.prototype.push=ke.prototype.push,ke.prototype.add=ke.prototype.add,ke.prototype.thaw=ke.prototype.ka,ke.prototype.freeze=ke.prototype.freeze,ke.className="List";function Di(a){this.eg=a,a.Sa=null,this.qa=a.Ja,this.sa=null}Di.prototype.reset=function(){var a=this.eg;a.Sa=null,this.qa=a.Ja,this.sa=null},Di.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)},Di.prototype.Ad=function(){return this.next()},Di.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},Di.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},Di.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},Di.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},Di.prototype.map=function(a){var y=this.eg;y.Sa=null;var x=new ke;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},Di.prototype.filter=function(a){var y=this.eg;y.Sa=null;var x=new ke;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},Di.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},Di.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},oe.Object.defineProperties(Di.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),Di.prototype.first=Di.prototype.first,Di.prototype.hasNext=Di.prototype.Ad,Di.prototype.next=Di.prototype.next,Di.prototype.reset=Di.prototype.reset,Di.className="SetIterator";function Me(a){En(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&Wt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}Ct=Me.prototype,Ct.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},Ct.freeze=function(){return this._isFrozen=!0,this},Ct.ka=function(){return this._isFrozen=!1,this},Ct.toString=function(){return"Set()#"+ti(this)},Ct.add=function(a){if(a===null)return this;this._isFrozen&&Ne(this,a);var y=a;return Qt(a)&&(y=$n(a)),this.Tb[y]===void 0&&(this.Sb++,a=new Vi(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},Ct.addAll=function(a){if(a===null)return this;if(this._isFrozen&&Ne(this),Zt(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},Ct.contains=function(a){if(a===null)return!1;var y=a;return Qt(a)&&(y=ti(a),y===void 0)?!1:this.Tb[y]!==void 0},Ct.has=function(a){return this.contains(a)},Ct.Sy=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0},Ct.Ty=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1},Ct.first=function(){var a=this.ea;return a===null?null:a.value},Me.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},Me.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},Me.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y.value),y=y.va;return this},Me.prototype.map=function(a){for(var y=new Me,x=this.ea;x!==null;)y.add(a(x.value)),x=x.va;return y},Me.prototype.filter=function(a){for(var y=new Me,x=this.ea;x!==null;){var E=x.value;a(E)&&y.add(E),x=x.va}return y},Ct=Me.prototype,Ct.remove=function(a){if(a===null)return!1;this._isFrozen&&Ne(this,a);var y=a;if(Qt(a)&&(y=ti(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},Ct.delete=function(a){return this.remove(a)},Ct.hp=function(a){if(a===null)return this;if(this._isFrozen&&Ne(this),Zt(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},Ct.pA=function(a){if(a===null||this.count===0)return this;this._isFrozen&&Ne(this);var y=new Me;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},Ct.clear=function(){this._isFrozen&&Ne(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},Me.prototype.copy=function(){var a=new Me,y=this.Tb,x;for(x in y)a.add(y[x].value);return a},Me.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},Me.prototype.Hv=function(){var a=new ke,y=this.Tb,x;for(x in y)a.add(y[x].value);return a};function En(a){a.__gohashid=mo++}function $n(a){var y=a.__gohashid;return y===void 0&&(y=mo++,a.__gohashid=y),y}function ti(a){return a.__gohashid}oe.Object.defineProperties(Me.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return mi;var a=this.Sa;return a!==null?(a.reset(),a):new Di(this)}}}),Me.prototype.toList=Me.prototype.Hv,Me.prototype.toArray=Me.prototype.Fa,Me.prototype.clear=Me.prototype.clear,Me.prototype.retainAll=Me.prototype.pA,Me.prototype.removeAll=Me.prototype.hp,Me.prototype.delete=Me.prototype.delete,Me.prototype.remove=Me.prototype.remove,Me.prototype.first=Me.prototype.first,Me.prototype.containsAny=Me.prototype.Ty,Me.prototype.containsAll=Me.prototype.Sy,Me.prototype.has=Me.prototype.has,Me.prototype.contains=Me.prototype.contains,Me.prototype.addAll=Me.prototype.addAll,Me.prototype.add=Me.prototype.add,Me.prototype.thaw=Me.prototype.ka,Me.prototype.freeze=Me.prototype.freeze;var mo=1;Me.className="Set",Me.uniqueHash=En,Me.hashIdUnique=$n,Me.hashId=ti;function Ji(a){this.ma=a,this.qa=a.Ja,this.sa=null}Ji.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},Ji.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)},Ji.prototype.Ad=function(){return this.next()},Ji.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},Ji.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},Ji.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},Ji.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},Ji.prototype.map=function(a){var y=this.ma;this.sa=null;var x=new ke;for(y=y.ea;y!==null;)x.add(a(y.key)),y=y.va;return x.iterator},Ji.prototype.filter=function(a){var y=this.ma;this.sa=null;var x=new ke;for(y=y.ea;y!==null;){var E=y.key;a(E)&&x.add(E),y=y.va}return x.iterator},Ji.prototype.de=function(){this.value=this.key=null,this.qa=-1},Ji.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},oe.Object.defineProperties(Ji.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Ji.prototype.first=Ji.prototype.first,Ji.prototype.hasNext=Ji.prototype.Ad,Ji.prototype.next=Ji.prototype.next,Ji.prototype.reset=Ji.prototype.reset,Ji.className="MapKeySetIterator";function wi(a){Me.call(this),En(this),this._isFrozen=!0,this.ma=a}he(wi,Me),Ct=wi.prototype,Ct.freeze=function(){return this},Ct.ka=function(){return this},Ct.toString=function(){return"MapKeySet("+this.ma.toString()+")"},Ct.add=function(){Wt("This Set is read-only: "+this.toString())},Ct.contains=function(a){return this.ma.contains(a)},Ct.has=function(a){return this.contains(a)},Ct.remove=function(){Wt("This Set is read-only: "+this.toString())},Ct.delete=function(a){return this.remove(a)},Ct.clear=function(){Wt("This Set is read-only: "+this.toString())},Ct.first=function(){var a=this.ma.ea;return a!==null?a.key:null},wi.prototype.any=function(a){for(var y=this.ma.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},wi.prototype.all=function(a){for(var y=this.ma.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},wi.prototype.each=function(a){for(var y=this.ma.ea;y!==null;)a(y.key),y=y.va;return this},wi.prototype.map=function(a){for(var y=new Me,x=this.ma.ea;x!==null;)y.add(a(x.key)),x=x.va;return y},wi.prototype.filter=function(a){for(var y=new Me,x=this.ma.ea;x!==null;){var E=x.key;a(E)&&y.add(E),x=x.va}return y},wi.prototype.copy=function(){return new wi(this.ma)},wi.prototype.Iv=function(){var a=new Me,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},wi.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},wi.prototype.Hv=function(){var a=new ke,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},oe.Object.defineProperties(wi.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?mi:new Ji(this.ma)}}}),wi.prototype.toList=wi.prototype.Hv,wi.prototype.toArray=wi.prototype.Fa,wi.prototype.toSet=wi.prototype.Iv,wi.prototype.first=wi.prototype.first,wi.prototype.clear=wi.prototype.clear,wi.prototype.delete=wi.prototype.delete,wi.prototype.remove=wi.prototype.remove,wi.prototype.has=wi.prototype.has,wi.prototype.contains=wi.prototype.contains,wi.prototype.add=wi.prototype.add,wi.prototype.thaw=wi.prototype.ka,wi.prototype.freeze=wi.prototype.freeze,wi.className="MapKeySet";function bi(a){this.ma=a,a.jf=null,this.qa=a.Ja,this.sa=null}bi.prototype.reset=function(){var a=this.ma;a.jf=null,this.qa=a.Ja,this.sa=null},bi.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)},bi.prototype.Ad=function(){return this.next()},bi.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},bi.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},bi.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},bi.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},bi.prototype.map=function(a){var y=this.ma;this.sa=y.jf=null;var x=new ke;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},bi.prototype.filter=function(a){var y=this.ma;this.sa=y.jf=null;var x=new ke;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},bi.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},bi.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},oe.Object.defineProperties(bi.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),bi.prototype.first=bi.prototype.first,bi.prototype.hasNext=bi.prototype.Ad,bi.prototype.next=bi.prototype.next,bi.prototype.reset=bi.prototype.reset,bi.className="MapValueSetIterator";function Vi(a,y){this.key=a,this.value=y,this.ll=this.va=null}Vi.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},Vi.className="KeyValuePair";function Ci(a){this.ma=a,a.Sa=null,this.qa=a.Ja,this.sa=null}Ci.prototype.reset=function(){var a=this.ma;a.Sa=null,this.qa=a.Ja,this.sa=null},Ci.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)},Ci.prototype.Ad=function(){return this.next()},Ci.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},Ci.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},Ci.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},Ci.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},Ci.prototype.map=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new ke;for(y=y.ea;y!==null;)x.add(a(y)),y=y.va;return x.iterator},Ci.prototype.filter=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new ke;for(y=y.ea;y!==null;)a(y)&&x.add(y),y=y.va;return x.iterator},Ci.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},Ci.prototype.toString=function(){return this.sa!==null?"MapIterator@"+this.sa:"MapIterator"},oe.Object.defineProperties(Ci.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Ci.prototype.first=Ci.prototype.first,Ci.prototype.hasNext=Ci.prototype.Ad,Ci.prototype.next=Ci.prototype.next,Ci.prototype.reset=Ci.prototype.reset,Ci.className="MapIterator";function kn(a){En(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"&&Wt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}Ct=kn.prototype,Ct.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},Ct.freeze=function(){return this._isFrozen=!0,this},Ct.ka=function(){return this._isFrozen=!1,this},Ct.toString=function(){return"Map()#"+ti(this)},Ct.add=function(a,y){this._isFrozen&&Ne(this,a);var x=a;Qt(a)&&(x=$n(a));var E=this.Tb[x];return E===void 0?(this.Sb++,a=new Vi(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},Ct.set=function(a,y){return this.add(a,y)},Ct.addAll=function(a){if(a===null)return this;if(Zt(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 kn)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},Ct.first=function(){return this.ea},kn.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},kn.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},kn.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y),y=y.va;return this},kn.prototype.map=function(a){for(var y=new kn,x=this.ea;x!==null;)y.add(x.key,a(x)),x=x.va;return y},kn.prototype.filter=function(a){for(var y=new kn,x=this.ea;x!==null;)a(x)&&y.add(x.key,x.value),x=x.va;return y},Ct=kn.prototype,Ct.contains=function(a){var y=a;return Qt(a)&&(y=ti(a),y===void 0)?!1:this.Tb[y]!==void 0},Ct.has=function(a){return this.contains(a)},Ct.I=function(a){var y=a;return Qt(a)&&(y=ti(a),y===void 0)?null:(a=this.Tb[y],a===void 0?null:a.value)},Ct.get=function(a){return this.I(a)},Ct.remove=function(a){if(a===null)return!1;this._isFrozen&&Ne(this,a);var y=a;if(Qt(a)&&(y=ti(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},Ct.delete=function(a){return this.remove(a)},Ct.clear=function(){this._isFrozen&&Ne(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()},kn.prototype.copy=function(){var a=new kn,y=this.Tb,x;for(x in y){var E=y[x];a.add(E.key,E.value)}return a},kn.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 Vi(b.key,b.value),x++}return y},kn.prototype.Lf=function(){return new wi(this)},oe.Object.defineProperties(kn.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return mi;var a=this.Sa;return a!==null?(a.reset(),a):new Ci(this)}},iteratorKeys:{get:function(){return 0>=this.count?mi:new Ji(this)}},iteratorValues:{get:function(){if(0>=this.count)return mi;var a=this.jf;return a!==null?(a.reset(),a):new bi(this)}}}),kn.prototype.toKeySet=kn.prototype.Lf,kn.prototype.toArray=kn.prototype.Fa,kn.prototype.clear=kn.prototype.clear,kn.prototype.delete=kn.prototype.delete,kn.prototype.remove=kn.prototype.remove,kn.prototype.get=kn.prototype.get,kn.prototype.getValue=kn.prototype.I,kn.prototype.has=kn.prototype.has,kn.prototype.contains=kn.prototype.contains,kn.prototype.first=kn.prototype.first,kn.prototype.addAll=kn.prototype.addAll,kn.prototype.set=kn.prototype.set,kn.prototype.add=kn.prototype.add,kn.prototype.thaw=kn.prototype.ka,kn.prototype.freeze=kn.prototype.freeze,kn.className="Map";function Bt(a,y){a===void 0?this.y=this.x=0:typeof a=="number"&&typeof y=="number"?(this.x=a,this.y=y):Wt("Invalid arguments to Point constructor: "+a+", "+y),this._isFrozen=!1}var vo,Ui,Wi,so,bo;Bt.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this},Bt.prototype.h=function(a,y){return this.x=a,this.y=y,this},Bt.prototype.sg=function(a,y){return this.x=a,this.y=y,this},Bt.prototype.set=function(a){return this.x=a.x,this.y=a.y,this},Bt.prototype.copy=function(){var a=new Bt;return a.x=this.x,a.y=this.y,a},Ct=Bt.prototype,Ct.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},Ct.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},Ct.freeze=function(){return this._isFrozen=!0,this},Ct.ka=function(){return Object.isFrozen(this)&&Wt("cannot thaw constant: "+this),this._isFrozen=!1,this};function Kn(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 Bt(x,b)}return new Bt}function li(a){return a.x.toString()+" "+a.y.toString()}Ct.toString=function(){return"Point("+this.x+","+this.y+")"},Ct.D=function(a){return a instanceof Bt?this.x===a.x&&this.y===a.y:!1},Ct.hi=function(a,y){return this.x===a&&this.y===y},Ct.Xa=function(a){return qt.B(this.x,a.x)&&qt.B(this.y,a.y)},Ct.add=function(a){return this.x+=a.x,this.y+=a.y,this},Ct.re=function(a){return this.x-=a.x,this.y-=a.y,this},Ct.offset=function(a,y){return this.x+=a,this.y+=y,this},Bt.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},Ct=Bt.prototype,Ct.scale=function(a,y){return this.x*=a,this.y*=y,this},Ct.Bf=function(a){var y=a.x-this.x;return a=a.y-this.y,y*y+a*a},Ct.zd=function(a,y){return a-=this.x,y-=this.y,a*a+y*y},Ct.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},Ct.ab=function(a){return Ai(a.x-this.x,a.y-this.y)},Ct.direction=function(a,y){return Ai(a-this.x,y-this.y)};function Ai(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}Ct.Ry=function(a,y){return qt.Fl(a.x,a.y,y.x,y.y,this.x,this.y)},Ct.fA=function(a,y,x,E){return qt.qh(a,y,x,E,this.x,this.y,this),this},Ct.gA=function(a,y){return qt.qh(a.x,a.y,y.x,y.y,this.x,this.y,this),this},Ct.uA=function(a,y,x,E){return qt.No(this.x,this.y,a,y,x,E,this),this},Ct.vA=function(a,y){return qt.No(this.x,this.y,a.x,a.y,y.width,y.height,this),this},Ct.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},Ct.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},Ct.transform=function(a){return a.Ga(this),this};function ki(a,y){return y.Cd(a),a}function Bi(a,y,x,E,b,z){var tt=b-x,ot=z-E,rt=tt*tt+ot*ot;x-=a,E-=y;var at=-x*tt-E*ot;return 0>=at||at>=rt?(tt=b-a,ot=z-y,Math.min(x*x+E*E,tt*tt+ot*ot)):(a=tt*E-ot*x,a*a/rt)}function Zo(a,y,x,E){return a=x-a,y=E-y,a*a+y*y}function vi(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)}Ct.w=function(){return isFinite(this.x)&&isFinite(this.y)},Bt.alloc=function(){var a=fi.pop();return a===void 0?new Bt:a},Bt.allocAt=function(a,y){var x=fi.pop();return x===void 0?new Bt(a,y):(x.x=a,x.y=y,x)},Bt.free=function(a){fi.push(a)},Bt.prototype.isReal=Bt.prototype.w,Bt.prototype.setSpot=Bt.prototype.yi,Bt.prototype.setRectSpot=Bt.prototype.xi,Bt.prototype.snapToGridPoint=Bt.prototype.vA,Bt.prototype.snapToGrid=Bt.prototype.uA,Bt.prototype.projectOntoLineSegmentPoint=Bt.prototype.gA,Bt.prototype.projectOntoLineSegment=Bt.prototype.fA,Bt.intersectingLineSegments=function(a,y,x,E,b,z,tt,ot){return qt.Rl(a,y,x,E,b,z,tt,ot)},Bt.prototype.compareWithLineSegmentPoint=Bt.prototype.Ry,Bt.compareWithLineSegment=function(a,y,x,E,b,z){return qt.Fl(a,y,x,E,b,z)},Bt.prototype.direction=Bt.prototype.direction,Bt.prototype.directionPoint=Bt.prototype.ab,Bt.prototype.normalize=Bt.prototype.normalize,Bt.prototype.distanceSquared=Bt.prototype.zd,Bt.prototype.distanceSquaredPoint=Bt.prototype.Bf,Bt.prototype.scale=Bt.prototype.scale,Bt.prototype.rotate=Bt.prototype.rotate,Bt.prototype.offset=Bt.prototype.offset,Bt.prototype.subtract=Bt.prototype.re,Bt.prototype.add=Bt.prototype.add,Bt.prototype.equalsApprox=Bt.prototype.Xa,Bt.prototype.equalTo=Bt.prototype.hi,Bt.prototype.equals=Bt.prototype.D,Bt.prototype.set=Bt.prototype.set,Bt.prototype.setTo=Bt.prototype.sg;var fi=[];Bt.className="Point",Bt.parse=Kn,Bt.stringify=li,Bt.distanceLineSegmentSquared=Bi,Bt.distanceSquared=Zo,Bt.direction=vi,Bt.Origin=vo=new Bt(0,0).ja(),Bt.InfiniteTopLeft=Ui=new Bt(-1/0,-1/0).ja(),Bt.InfiniteBottomRight=Wi=new Bt(1/0,1/0).ja(),Bt.SixPoint=so=new Bt(6,6).ja(),Bt.NoPoint=bo=new Bt(NaN,NaN).ja(),Bt.parse=Kn,Bt.stringify=li,Bt.distanceLineSegmentSquared=Bi,Bt.distanceSquared=Zo,Bt.direction=vi;function Qe(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):Wt("Invalid arguments to Size constructor: "+a+", "+y),this._isFrozen=!1}var ni,no,Ho,_o,ko,Ko,Fo;Qe.prototype.assign=function(a){return this.width=a.width,this.height=a.height,this},Qe.prototype.h=function(a,y){return this.width=a,this.height=y,this},Qe.prototype.sg=function(a,y){return this.width=a,this.height=y,this},Qe.prototype.set=function(a){return this.width=a.width,this.height=a.height,this},Qe.prototype.copy=function(){var a=new Qe;return a.width=this.width,a.height=this.height,a},Ct=Qe.prototype,Ct.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},Ct.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},Ct.freeze=function(){return this._isFrozen=!0,this},Ct.ka=function(){return Object.isFrozen(this)&&Wt("cannot thaw constant: "+this),this._isFrozen=!1,this};function zr(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 Qe(x,b)}return new Qe}function Dr(a){return a.width.toString()+" "+a.height.toString()}Ct.toString=function(){return"Size("+this.width+","+this.height+")"},Ct.D=function(a){return a instanceof Qe?this.width===a.width&&this.height===a.height:!1},Ct.hi=function(a,y){return this.width===a&&this.height===y},Ct.Xa=function(a){return qt.B(this.width,a.width)&&qt.B(this.height,a.height)},Ct.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},Ct.w=function(){return isFinite(this.width)&&isFinite(this.height)},Qe.alloc=function(){var a=ms.pop();return a===void 0?new Qe:a},Qe.free=function(a){ms.push(a)},Qe.prototype.isReal=Qe.prototype.w,Qe.prototype.inflate=Qe.prototype.Bc,Qe.prototype.equalsApprox=Qe.prototype.Xa,Qe.prototype.equalTo=Qe.prototype.hi,Qe.prototype.equals=Qe.prototype.D,Qe.prototype.set=Qe.prototype.set,Qe.prototype.setTo=Qe.prototype.sg;var ms=[];Qe.className="Size",Qe.parse=zr,Qe.stringify=Dr,Qe.ZeroSize=ni=new Qe(0,0).ja(),Qe.OneSize=no=new Qe(1,1).ja(),Qe.SixSize=Ho=new Qe(6,6).ja(),Qe.EightSize=_o=new Qe(8,8).ja(),Qe.TenSize=ko=new Qe(10,10).ja(),Qe.InfiniteSize=Ko=new Qe(1/0,1/0).ja(),Qe.NoSize=Fo=new Qe(NaN,NaN).ja(),Qe.parse=zr,Qe.stringify=Dr;function Ce(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 Bt?(x=a.x,a=a.y,y instanceof Bt?(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 Qe?(this.x=x,this.y=a,this.width=y.width,this.height=y.height):Wt("Incorrect second argument supplied to Rect constructor "+y)):Wt("Invalid arguments to Rect constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}Ct=Ce.prototype,Ct.assign=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},Ct.h=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this};function To(a,y,x){a.width=y,a.height=x}Ct.sg=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this},Ct.set=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},Ct.dd=function(a){return this.x=a.x,this.y=a.y,this},Ct.tA=function(a){return this.width=a.width,this.height=a.height,this},Ce.prototype.copy=function(){var a=new Ce;return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},Ct=Ce.prototype,Ct.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},Ct.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},Ct.freeze=function(){return this._isFrozen=!0,this},Ct.ka=function(){return Object.isFrozen(this)&&Wt("cannot thaw constant: "+this),this._isFrozen=!1,this};function kl(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 Ce(x,b,z,tt)}return new Ce}function Gr(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}Ct.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},Ct.D=function(a){return a instanceof Ce?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1},Ct.hi=function(a,y,x,E){return this.x===a&&this.y===y&&this.width===x&&this.height===E},Ct.Xa=function(a){return qt.B(this.x,a.x)&&qt.B(this.y,a.y)&&qt.B(this.width,a.width)&&qt.B(this.height,a.height)};function ca(a,y){return qt.$(a.x,y.x)&&qt.$(a.y,y.y)&&qt.$(a.width,y.width)&&qt.$(a.height,y.height)}Ct.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y},Ct.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},Ct.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},Ct.offset=function(a,y){return this.x+=a,this.y+=y,this},Ct.Bc=function(a,y){return Po(this,y,a,y,a)},Ct.Co=function(a){return Po(this,a.top,a.right,a.bottom,a.left)},Ct.Fv=function(a){return Po(this,-a.top,-a.right,-a.bottom,-a.left)},Ct.Hz=function(a,y,x,E){return Po(this,a,y,x,E)};function Po(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}Ct.Ex=function(a){return Ml(this,a.x,a.y,a.width,a.height)},Ct.Uu=function(a,y,x,E){return Ml(this,a,y,x,E)};function Ml(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}Ct.Yc=function(a){return this.Vu(a.x,a.y,a.width,a.height)},Ct.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 fl(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))}Ct.Ye=function(a){return Wo(this,a.x,a.y,0,0)},Ct.ed=function(a){return Wo(this,a.x,a.y,a.width,a.height)},Ct.Kv=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),Wo(this,a,y,x,E)};function Wo(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}Ct.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 Or(a,y,x,E,b,z,tt,ot){return tt===void 0&&(tt=0),ot===void 0&&(ot=0),a<=b&&b+tt<=a+x&&y<=z&&z+ot<=y+E}function ta(a,y,x,E,b,z,tt,ot){return a>tt+b||b>x+a?!1:!(y>ot+z||z>E+y)}Ct.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},Ct.Mz=function(){return this.width===0&&this.height===0},Ce.alloc=function(){var a=Ys.pop();return a===void 0?new Ce:a},Ce.allocAt=function(a,y,x,E){var b=Ys.pop();return b===void 0?new Ce(a,y,x,E):b.h(a,y,x,E)},Ce.free=function(a){Ys.push(a)},oe.Object.defineProperties(Ce.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 Bt(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}},size:{get:function(){return new Qe(this.width,this.height)},set:function(a){this.width=a.width,this.height=a.height}},center:{get:function(){return new Bt(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}}}),Ce.prototype.isEmpty=Ce.prototype.Mz,Ce.prototype.isReal=Ce.prototype.w,Ce.intersectsLineSegment=function(a,y,x,E,b,z,tt,ot){return qt.Fx(a,y,x,E,b,z,tt,ot)},Ce.prototype.setSpot=Ce.prototype.yi,Ce.prototype.union=Ce.prototype.Kv,Ce.prototype.unionRect=Ce.prototype.ed,Ce.prototype.unionPoint=Ce.prototype.Ye,Ce.prototype.intersects=Ce.prototype.Vu,Ce.prototype.intersectsRect=Ce.prototype.Yc,Ce.prototype.intersect=Ce.prototype.Uu,Ce.prototype.intersectRect=Ce.prototype.Ex,Ce.prototype.grow=Ce.prototype.Hz,Ce.prototype.subtractMargin=Ce.prototype.Fv,Ce.prototype.addMargin=Ce.prototype.Co,Ce.prototype.inflate=Ce.prototype.Bc,Ce.prototype.offset=Ce.prototype.offset,Ce.prototype.contains=Ce.prototype.contains,Ce.prototype.containsRect=Ce.prototype.Re,Ce.prototype.containsPoint=Ce.prototype.ca,Ce.prototype.equalsApprox=Ce.prototype.Xa,Ce.prototype.equalTo=Ce.prototype.hi,Ce.prototype.equals=Ce.prototype.D,Ce.prototype.setSize=Ce.prototype.tA,Ce.prototype.setPoint=Ce.prototype.dd,Ce.prototype.set=Ce.prototype.set,Ce.prototype.setTo=Ce.prototype.sg;var is=null,Ra=null,Ys=[];Ce.className="Rect",Ce.parse=kl,Ce.stringify=Gr,Ce.contains=Or,Ce.intersects=ta,Ce.ZeroRect=is=new Ce(0,0,0,0).ja(),Ce.NoRect=Ra=new Ce(NaN,NaN,NaN,NaN).ja(),Ce.parse=kl,Ce.stringify=Gr,Ce.contains=Or,Ce.intersects=ta;function yi(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):Wt("Invalid arguments to Margin constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}yi.prototype.assign=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},yi.prototype.sg=function(a,y,x,E){return this.top=a,this.right=y,this.bottom=x,this.left=E,this},yi.prototype.set=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},yi.prototype.copy=function(){var a=new yi;return a.top=this.top,a.right=this.right,a.bottom=this.bottom,a.left=this.left,a},Ct=yi.prototype,Ct.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},Ct.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},Ct.freeze=function(){return this._isFrozen=!0,this},Ct.ka=function(){return Object.isFrozen(this)&&Wt("cannot thaw constant: "+this),this._isFrozen=!1,this};function yo(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 yi;for(var b=NaN;a[y]==="";)y++;if((E=a[y++])&&(b=parseFloat(E)),isNaN(b))return new yi(x);for(var z=NaN;a[y]==="";)y++;if((E=a[y++])&&(z=parseFloat(E)),isNaN(z))return new yi(x,b);for(var tt=NaN;a[y]==="";)y++;return(E=a[y++])&&(tt=parseFloat(E)),isNaN(tt)?new yi(x,b):new yi(x,b,z,tt)}return new yi}function vs(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}Ct.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},Ct.D=function(a){return a instanceof yi?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1},Ct.hi=function(a,y,x,E){return this.top===a&&this.right===y&&this.bottom===x&&this.left===E},Ct.Xa=function(a){return qt.B(this.top,a.top)&&qt.B(this.right,a.right)&&qt.B(this.bottom,a.bottom)&&qt.B(this.left,a.left)},Ct.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},yi.alloc=function(){var a=co.pop();return a===void 0?new yi:a},yi.free=function(a){co.push(a)},yi.prototype.isReal=yi.prototype.w,yi.prototype.equalsApprox=yi.prototype.Xa,yi.prototype.equalTo=yi.prototype.hi,yi.prototype.equals=yi.prototype.D,yi.prototype.set=yi.prototype.set,yi.prototype.setTo=yi.prototype.sg;var Vr=null,to=null,co=[];yi.className="Margin",yi.parse=yo,yi.stringify=vs,yi.ZeroMargin=Vr=new yi(0,0,0,0).ja(),yi.TwoMargin=to=new yi(2,2,2,2).ja(),yi.parse=yo,yi.stringify=vs;function rn(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 Ni,io,Jo,fa,ea,ji,$r,Ds,ts,Os,El,$a,Hr,ga,gh,Yd,bl,Zd,sd,ph,Gl,ja,mh,ad,ld,Fr,zc,ud,vh,bu,Is,Rs,Ur,es,Vo,Co;rn.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},rn.prototype.sg=function(a,y,x,E){return this.x=a,this.y=y,this.offsetX=x,this.offsetY=E,this},rn.prototype.set=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},rn.prototype.copy=function(){var a=new rn;return a.x=this.x,a.y=this.y,a.offsetX=this.offsetX,a.offsetY=this.offsetY,a},Ct=rn.prototype,Ct.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},Ct.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},Ct.freeze=function(){return this._isFrozen=!0,this},Ct.ka=function(){return Object.isFrozen(this)&&Wt("cannot thaw constant: "+this),this._isFrozen=!1,this};function Bo(a,y){return a.x=NaN,a.y=NaN,a.offsetX=y,a}function js(a){if(typeof a=="string"){if(a=a.trim(),a==="None")return Ni;if(a==="TopLeft")return io;if(a==="Top"||a==="TopCenter"||a==="MiddleTop")return Jo;if(a==="TopRight")return fa;if(a==="Left"||a==="LeftCenter"||a==="MiddleLeft")return ea;if(a==="Center")return ji;if(a==="Right"||a==="RightCenter"||a==="MiddleRight")return $r;if(a==="BottomLeft")return Ds;if(a==="Bottom"||a==="BottomCenter"||a==="MiddleBottom")return ts;if(a==="BottomRight")return Os;if(a==="TopSide")return El;if(a==="LeftSide")return $a;if(a==="RightSide")return Hr;if(a==="BottomSide")return ga;if(a==="TopBottomSides")return gh;if(a==="LeftRightSides")return Yd;if(a==="TopLeftSides")return bl;if(a==="TopRightSides")return Zd;if(a==="BottomLeftSides")return sd;if(a==="BottomRightSides")return ph;if(a==="NotTopSide")return Gl;if(a==="NotLeftSide")return ja;if(a==="NotRightSide")return mh;if(a==="NotBottomSide")return ad;if(a==="AllSides")return ld;if(a==="Default")return Fr;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 rn(x,b,z,tt)}return new rn}function Yr(a){return a.sb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()}Ct.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(Ni)?"None":this.D(io)?"TopLeft":this.D(Jo)?"Top":this.D(fa)?"TopRight":this.D(ea)?"Left":this.D(ji)?"Center":this.D($r)?"Right":this.D(Ds)?"BottomLeft":this.D(ts)?"Bottom":this.D(Os)?"BottomRight":this.D(El)?"TopSide":this.D($a)?"LeftSide":this.D(Hr)?"RightSide":this.D(ga)?"BottomSide":this.D(gh)?"TopBottomSides":this.D(Yd)?"LeftRightSides":this.D(bl)?"TopLeftSides":this.D(Zd)?"TopRightSides":this.D(sd)?"BottomLeftSides":this.D(ph)?"BottomRightSides":this.D(Gl)?"NotTopSide":this.D(ja)?"NotLeftSide":this.D(mh)?"NotRightSide":this.D(ad)?"NotBottomSide":this.D(ld)?"AllSides":this.D(Fr)?"Default":"None"},Ct.D=function(a){return a instanceof rn?(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},Ct.gv=function(){return new rn(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},Ct.Hf=function(a){if(!this.$c())return!1;if(!a.$c())if(a.D(zc))a=$a;else if(a.D(ud))a=Hr;else if(a.D(vh))a=El;else if(a.D(bu))a=ga;else return!1;return a=a.offsetY,(this.offsetY&a)===a},Ct.sb=function(){return!isNaN(this.x)&&!isNaN(this.y)},Ct.Mc=function(){return isNaN(this.x)||isNaN(this.y)},Ct.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0},Ct.ys=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0},Ct.Xb=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0},rn.alloc=function(){var a=ls.pop();return a===void 0?new rn:a},rn.free=function(a){ls.push(a)},rn.prototype.isDefault=rn.prototype.Xb,rn.prototype.isNone=rn.prototype.ys,rn.prototype.isSide=rn.prototype.$c,rn.prototype.isNoSpot=rn.prototype.Mc,rn.prototype.isSpot=rn.prototype.sb,rn.prototype.includesSide=rn.prototype.Hf,rn.prototype.opposite=rn.prototype.gv,rn.prototype.equals=rn.prototype.D,rn.prototype.set=rn.prototype.set,rn.prototype.setTo=rn.prototype.sg;var ls=[];rn.className="Spot",rn.parse=js,rn.stringify=Yr,rn.None=Ni=Bo(new rn(0,0,0,0),0).ja(),rn.Default=Fr=Bo(new rn(0,0,-1,0),-1).ja(),rn.TopLeft=io=new rn(0,0,0,0).ja(),rn.TopCenter=Jo=new rn(.5,0,0,0).ja(),rn.TopRight=fa=new rn(1,0,0,0).ja(),rn.LeftCenter=ea=new rn(0,.5,0,0).ja(),rn.Center=ji=new rn(.5,.5,0,0).ja(),rn.RightCenter=$r=new rn(1,.5,0,0).ja(),rn.BottomLeft=Ds=new rn(0,1,0,0).ja(),rn.BottomCenter=ts=new rn(.5,1,0,0).ja(),rn.BottomRight=Os=new rn(1,1,0,0).ja(),rn.MiddleTop=Is=Jo,rn.MiddleLeft=Rs=ea,rn.MiddleRight=Ur=$r,rn.MiddleBottom=es=ts,rn.Top=vh=Jo,rn.Left=zc=ea,rn.Right=ud=$r,rn.Bottom=bu=ts,rn.TopSide=El=Bo(new rn(0,0,1,1),1).ja(),rn.LeftSide=$a=Bo(new rn(0,0,1,2),1).ja(),rn.RightSide=Hr=Bo(new rn(0,0,1,4),1).ja(),rn.BottomSide=ga=Bo(new rn(0,0,1,8),1).ja(),rn.TopBottomSides=gh=Bo(new rn(0,0,1,9),1).ja(),rn.LeftRightSides=Yd=Bo(new rn(0,0,1,6),1).ja(),rn.TopLeftSides=bl=Bo(new rn(0,0,1,3),1).ja(),rn.TopRightSides=Zd=Bo(new rn(0,0,1,5),1).ja(),rn.BottomLeftSides=sd=Bo(new rn(0,0,1,10),1).ja(),rn.BottomRightSides=ph=Bo(new rn(0,0,1,12),1).ja(),rn.NotTopSide=Gl=Bo(new rn(0,0,1,14),1).ja(),rn.NotLeftSide=ja=Bo(new rn(0,0,1,13),1).ja(),rn.NotRightSide=mh=Bo(new rn(0,0,1,11),1).ja(),rn.NotBottomSide=ad=Bo(new rn(0,0,1,7),1).ja(),rn.AllSides=ld=Bo(new rn(0,0,1,15),1).ja(),Vo=new rn(.156,.156).ja(),Co=new rn(.844,.844).ja(),rn.parse=js,rn.stringify=Yr;function ci(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}ci.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},ci.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},ci.prototype.copy=function(){var a=new ci;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},ci.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},ci.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},ci.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},ci.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},ci.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},ci.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},ci.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},ci.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},Ct=ci.prototype,Ct.translate=function(a,y){return this.dx+=this.m11*a+this.m21*y,this.dy+=this.m12*a+this.m22*y,this},Ct.scale=function(a,y){return y===void 0&&(y=a),this.m11*=a,this.m12*=a,this.m21*=y,this.m22*=y,this},Ct.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)},Ct.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))},Ct.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))},Ct.pp=function(a){var y=a.x,x=a.y,E=y+a.width,b=x+a.height,z=this.m11,tt=this.m12,ot=this.m21,rt=this.m22,at=this.dx,ut=this.dy,ft=y*z+x*ot+at,mt=y*tt+x*rt+ut,yt=E*z+x*ot+at,xt=E*tt+x*rt+ut;return x=y*z+b*ot+at,y=y*tt+b*rt+ut,z=E*z+b*ot+at,E=E*tt+b*rt+ut,b=Math.min(ft,yt),ft=Math.max(ft,yt),yt=Math.min(mt,xt),mt=Math.max(mt,xt),b=Math.min(b,x),ft=Math.max(ft,x),yt=Math.min(yt,y),mt=Math.max(mt,y),b=Math.min(b,z),ft=Math.max(ft,z),yt=Math.min(yt,E),mt=Math.max(mt,E),a.h(b,yt,ft-b,mt-yt),a},ci.alloc=function(){var a=_a.pop();return a===void 0?new ci:a},ci.free=function(a){_a.push(a)},ci.prototype.transformRect=ci.prototype.pp,ci.prototype.transformPoint=ci.prototype.Ga,ci.prototype.scale=ci.prototype.scale,ci.prototype.translate=ci.prototype.translate,ci.prototype.rotate=ci.prototype.rotate,ci.prototype.invert=ci.prototype.Vj,ci.prototype.multiplyInverted=ci.prototype.bv,ci.prototype.multiply=ci.prototype.multiply,ci.prototype.reset=ci.prototype.reset,ci.prototype.isIdentity=ci.prototype.ws,ci.prototype.equals=ci.prototype.D,ci.prototype.setTransform=ci.prototype.setTransform,ci.prototype.set=ci.prototype.set;var _a=[];ci.className="Transform",ci.xF="54a702f3e53909c447824c6706603faf4c";var qt={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(a){if(0>=a)return 0;var y=qt.Uv;if(y===null){y=[];for(var x=0;2e3>=x;x++)y[x]=Math.sqrt(x);qt.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 ot=a,rt=x;else ot=x,rt=a;if(y<E)var at=y,ut=E;else at=E,ut=y;if(a===x)return at<=tt&&tt<=ut&&a-b<=z&&z<=a+b;if(y===E)return ot<=z&&z<=rt&&y-b<=tt&&tt<=y+b;if(rt+=b,ot-=b,ot<=z&&z<=rt&&(ut+=b,at-=b,at<=tt&&tt<=ut))if(rt-ot>ut-at)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,ot,rt,at,ut,ft){if(qt.Yb(a,y,tt,ot,ft,x,E)&&qt.Yb(a,y,tt,ot,ft,b,z))return qt.Yb(a,y,tt,ot,ft,at,ut);var mt=(a+x)/2,yt=(y+E)/2,xt=(x+b)/2,Mt=(E+z)/2;b=(b+tt)/2,z=(z+ot)/2,E=(mt+xt)/2,x=(yt+Mt)/2,xt=(xt+b)/2,Mt=(Mt+z)/2;var It=(E+xt)/2,Tt=(x+Mt)/2;return qt.cs(a,y,mt,yt,E,x,It,Tt,rt,at,ut,ft)||qt.cs(It,Tt,xt,Mt,b,z,tt,ot,rt,at,ut,ft)},ax:function(a,y,x,E,b,z,tt,ot,rt){var at=(x+b)/2,ut=(E+z)/2;return rt.h((((a+x)/2+at)/2+(at+(b+tt)/2)/2)/2,(((y+E)/2+ut)/2+(ut+(z+ot)/2)/2)/2),rt},My:function(a,y,x,E,b,z,tt,ot){var rt=(x+b)/2,at=(E+z)/2;return vi(((a+x)/2+rt)/2,((y+E)/2+at)/2,(rt+(b+tt)/2)/2,(at+(z+ot)/2)/2)},Dl:function(a,y,x,E,b,z,tt,ot,rt,at){if(qt.Yb(a,y,tt,ot,rt,x,E)&&qt.Yb(a,y,tt,ot,rt,b,z))Wo(at,a,y,0,0),Wo(at,tt,ot,0,0);else{var ut=(a+x)/2,ft=(y+E)/2,mt=(x+b)/2,yt=(E+z)/2;b=(b+tt)/2,z=(z+ot)/2,E=(ut+mt)/2,x=(ft+yt)/2,mt=(mt+b)/2,yt=(yt+z)/2;var xt=(E+mt)/2,Mt=(x+yt)/2;qt.Dl(a,y,ut,ft,E,x,xt,Mt,rt,at),qt.Dl(xt,Mt,mt,yt,b,z,tt,ot,rt,at)}return at},Qe:function(a,y,x,E,b,z,tt,ot,rt,at){if(qt.Yb(a,y,tt,ot,rt,x,E)&&qt.Yb(a,y,tt,ot,rt,b,z))at.length===0&&(at.push(a),at.push(y)),at.push(tt),at.push(ot);else{var ut=(a+x)/2,ft=(y+E)/2,mt=(x+b)/2,yt=(E+z)/2;b=(b+tt)/2,z=(z+ot)/2,E=(ut+mt)/2,x=(ft+yt)/2,mt=(mt+b)/2,yt=(yt+z)/2;var xt=(E+mt)/2,Mt=(x+yt)/2;qt.Qe(a,y,ut,ft,E,x,xt,Mt,rt,at),qt.Qe(xt,Mt,mt,yt,b,z,tt,ot,rt,at)}return at},jv:function(a,y,x,E,b,z,tt,ot,rt,at){if(qt.Yb(a,y,b,z,at,x,E))return qt.Yb(a,y,b,z,at,ot,rt);var ut=(a+x)/2,ft=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var mt=(ut+x)/2,yt=(ft+E)/2;return qt.jv(a,y,ut,ft,mt,yt,tt,ot,rt,at)||qt.jv(mt,yt,x,E,b,z,tt,ot,rt,at)},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,ot){if(qt.Yb(a,y,b,z,tt,x,E))Wo(ot,a,y,0,0),Wo(ot,b,z,0,0);else{var rt=(a+x)/2,at=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var ut=(rt+x)/2,ft=(at+E)/2;qt.iv(a,y,rt,at,ut,ft,tt,ot),qt.iv(ut,ft,x,E,b,z,tt,ot)}return ot},ep:function(a,y,x,E,b,z,tt,ot){if(qt.Yb(a,y,b,z,tt,x,E))ot.length===0&&(ot.push(a),ot.push(y)),ot.push(b),ot.push(z);else{var rt=(a+x)/2,at=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var ut=(rt+x)/2,ft=(at+E)/2;qt.ep(a,y,rt,at,ut,ft,tt,ot),qt.ep(ut,ft,x,E,b,z,tt,ot)}return ot},Eo:function(a,y,x,E,b,z,tt,ot,rt,at,ut,ft,mt,yt){if(qt.Yb(a,y,tt,ot,mt,x,E)&&qt.Yb(a,y,tt,ot,mt,b,z))return!qt.Rl(a,y,tt,ot,rt,at,ut,ft)||(mt=(a-tt)*(at-ft)-(y-ot)*(rt-ut),mt===0)?!1:(yt.h(((a*ot-y*tt)*(rt-ut)-(a-tt)*(rt*ft-at*ut))/mt,((a*ot-y*tt)*(at-ft)-(y-ot)*(rt*ft-at*ut))/mt),!0);var xt=(a+x)/2,Mt=(y+E)/2,It=(x+b)/2,Tt=(E+z)/2;b=(b+tt)/2,z=(z+ot)/2,E=(xt+It)/2,x=(Mt+Tt)/2,It=(It+b)/2,Tt=(Tt+z)/2;var zt=(E+It)/2,Ht=(x+Tt)/2,Vt=1/0,Xt=!1,le=0,$e=0;return qt.Eo(a,y,xt,Mt,E,x,zt,Ht,rt,at,ut,ft,mt,yt)&&(a=(yt.x-rt)*(yt.x-rt)+(yt.y-at)*(yt.y-at),a<Vt&&(Vt=a,Xt=!0,le=yt.x,$e=yt.y)),qt.Eo(zt,Ht,It,Tt,b,z,tt,ot,rt,at,ut,ft,mt,yt)&&(yt.x-rt)*(yt.x-rt)+(yt.y-at)*(yt.y-at)<Vt&&(Xt=!0,le=yt.x,$e=yt.y),Xt&&(yt.x=le,yt.y=$e),Xt},Fo:function(a,y,x,E,b,z,tt,ot,rt,at,ut,ft,mt){var yt=0;if(qt.Yb(a,y,tt,ot,mt,x,E)&&qt.Yb(a,y,tt,ot,mt,b,z)){if(mt=(a-tt)*(at-ft)-(y-ot)*(rt-ut),mt===0)return yt;var xt=((a*ot-y*tt)*(rt-ut)-(a-tt)*(rt*ft-at*ut))/mt,Mt=((a*ot-y*tt)*(at-ft)-(y-ot)*(rt*ft-at*ut))/mt;if(xt>=ut)return yt;if((rt>ut?rt-ut:ut-rt)<(at>ft?at-ft:ft-at)){if(y<ot?(rt=y,a=ot):(rt=ot,a=y),Mt<rt||Mt>a)return yt}else if(a<tt?(rt=a,a=tt):rt=tt,xt<rt||xt>a)return yt;0<mt?yt++:0>mt&&yt--}else{xt=(a+x)/2,Mt=(y+E)/2;var It=(x+b)/2,Tt=(E+z)/2;b=(b+tt)/2,z=(z+ot)/2,E=(xt+It)/2,x=(Mt+Tt)/2,It=(It+b)/2,Tt=(Tt+z)/2;var zt=(E+It)/2,Ht=(x+Tt)/2;yt+=qt.Fo(a,y,xt,Mt,E,x,zt,Ht,rt,at,ut,ft,mt),yt+=qt.Fo(zt,Ht,It,Tt,b,z,tt,ot,rt,at,ut,ft,mt)}return yt},qh:function(a,y,x,E,b,z,tt){return qt.$(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)):qt.$(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,ot,rt){return qt.B(a,x)&&qt.B(y,E)?(rt.h(a,y),!1):qt.$(b,tt)?qt.$(a,x)?(qt.qh(a,y,x,E,b,z,rt),!1):qt.qh(a,y,x,E,b,(E-y)/(x-a)*(b-a)+y,rt):(ot=(ot-z)/(tt-b),qt.$(a,x)?(x=ot*(a-b)+z,y<E?(b=y,y=E):b=E,x<b?(rt.h(a,b),!1):x>y?(rt.h(a,y),!1):(rt.h(a,x),!0)):(tt=(E-y)/(x-a),qt.$(ot,tt)?(qt.qh(a,y,x,E,b,z,rt),!1):(b=(tt*a-ot*b+z-y)/(tt-ot),qt.$(tt,0)?(a<x?(E=a,a=x):E=x,b<E?(rt.h(E,y),!1):b>a?(rt.h(a,y),!1):(rt.h(b,y),!0)):qt.qh(a,y,x,E,b,tt*(b-a)+y,rt))))},MA:function(a,y,x,E,b){return qt.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,ot,rt,at){function ut(It,Tt){var zt=(It-a)*(It-a)+(Tt-y)*(Tt-y);zt<ft&&(ft=zt,rt.h(It,Tt))}var ft=1/0;ut(rt.x,rt.y);var mt=0,yt=0,xt=0,Mt=0;if(b<tt?(mt=b,yt=tt):(mt=tt,yt=b),z<ot?(xt=b,Mt=tt):(xt=tt,Mt=b),mt=(yt-mt)/2+at,at=(Mt-xt)/2+at,b=(b+tt)/2,z=(z+ot)/2,mt===0||at===0)return rt;if(.5>(x>a?x-a:a-x)){if(mt=1-(x-b)*(x-b)/(mt*mt),0>mt)return rt;mt=Math.sqrt(mt),E=-at*mt+z,ut(x,at*mt+z),ut(x,E)}else{if(x=(E-y)/(x-a),E=1/(mt*mt)+x*x/(at*at),ot=2*x*(y-x*a)/(at*at)-2*x*z/(at*at)-2*b/(mt*mt),mt=ot*ot-4*E*(2*x*a*z/(at*at)-2*y*z/(at*at)+z*z/(at*at)+b*b/(mt*mt)-1+(y-x*a)*(y-x*a)/(at*at)),0>mt)return rt;mt=Math.sqrt(mt),at=(-ot+mt)/(2*E),ut(at,x*at-x*a+y),mt=(-ot-mt)/(2*E),ut(mt,x*mt-x*a+y)}return rt},Ff:function(a,y,x,E,b,z,tt,ot,rt){var at=1e21,ut=a,ft=y;if(qt.Ve(a,y,a,E,b,z,tt,ot,rt)){var mt=(rt.x-b)*(rt.x-b)+(rt.y-z)*(rt.y-z);mt<at&&(at=mt,ut=rt.x,ft=rt.y)}return qt.Ve(x,y,x,E,b,z,tt,ot,rt)&&(mt=(rt.x-b)*(rt.x-b)+(rt.y-z)*(rt.y-z),mt<at&&(at=mt,ut=rt.x,ft=rt.y)),qt.Ve(a,y,x,y,b,z,tt,ot,rt)&&(y=(rt.x-b)*(rt.x-b)+(rt.y-z)*(rt.y-z),y<at&&(at=y,ut=rt.x,ft=rt.y)),qt.Ve(a,E,x,E,b,z,tt,ot,rt)&&(a=(rt.x-b)*(rt.x-b)+(rt.y-z)*(rt.y-z),a<at&&(at=a,ut=rt.x,ft=rt.y)),rt.h(ut,ft),1e21>at},us:function(a,y,x){return qt.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,ot){var rt=a+x,at=y+E;return b===tt?(z<ot?(tt=z,z=ot):tt=ot,a<=b&&b<=rt&&tt<=at&&z>=y):z===ot?(b<tt?(ot=b,b=tt):ot=tt,y<=z&&z<=at&&ot<=rt&&b>=a):!!(Or(a,y,x,E,b,z)||Or(a,y,x,E,tt,ot)||qt.Rl(a,y,rt,y,b,z,tt,ot)||qt.Rl(rt,y,rt,at,b,z,tt,ot)||qt.Rl(rt,at,a,at,b,z,tt,ot)||qt.Rl(a,at,a,y,b,z,tt,ot))},Rl:function(a,y,x,E,b,z,tt,ot){return a===x&&y===E&&b===tt&&z===ot?a===b&&y===z:0>=qt.Fl(a,y,x,E,b,z)*qt.Fl(a,y,x,E,tt,ot)&&0>=qt.Fl(b,z,tt,ot,a,y)*qt.Fl(b,z,tt,ot,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 ot=E>b?-1:1;z=[];var rt=tt/2,at=E;if(E=Math.min(2*tt,Math.abs(b-E)),1e-5>E)return rt=at+ot*Math.min(E,rt),ot=a+x*Math.cos(at),at=y+x*Math.sin(at),a+=x*Math.cos(rt),y+=x*Math.sin(rt),x=(ot+a)/2,rt=(at+y)/2,z.push([ot,at,x,rt,x,rt,a,y]),z;for(;1e-5<E;)b=at+ot*Math.min(E,rt),z.push(qt.Vy(x,at,b,a,y)),E-=Math.abs(b-at),at=b;return z},Vy:function(a,y,x,E,b){var z=(x-y)/2,tt=a*Math.cos(z),ot=a*Math.sin(z),rt=-ot,at=tt*tt+rt*rt,ut=at+tt*tt+rt*ot;return at=4/3*(Math.sqrt(2*at*ut)-ut)/(tt*ot-rt*tt),ot=tt-at*rt,tt=rt+at*tt,rt=-tt,at=z+y,z=Math.cos(at),at=Math.sin(at),[E+a*Math.cos(y),b+a*Math.sin(y),E+ot*z-tt*at,b+ot*at+tt*z,E+ot*z-rt*at,b+ot*at+rt*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 ot=x;return x+b-a<b/2&&(ot=x+b),a=E,E+z-y<z/2&&(a=E+z),tt.h(ot,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,ot=0;else tt=0,ot=1;var rt=tt===0?a:y,at=tt===0?x:E;return(tt===0?b:z)&&(at=-at),tt=ot,x=tt===0?x:E,(tt===0?b:z)&&(x=-x),qt.az(rt,tt===0?a:y,at,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,ot=-z+tt,rt=-z+Math.sqrt(a*a+tt*tt);y=ot;for(var at=0;9999999999>at&&(y=.5*(ot+rt),!(y===ot||y===rt));++at){var ut=a/(y+b),ft=tt/(y+z);if(ut=ut*ut+ft*ft-1,0<ut)ot=y;else if(0>ut)rt=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 Rn,um:new Rn,Mf:new Rn,Nf:0,vm:100};qt.za=qt.AA;function Ue(a){En(this),this.l=2,a===void 0&&(a=Ue.o),this.na=a,this.Ec=this.Dc=this.pd=this.od=0,a===Ue.o?this.ee=new ke:(Ue.V===null&&(Ue.V=new ke().freeze()),this.ee=Ue.V),this.aq=this.ee.Ja,this.Ip=new Ce().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=io,this.gg=Os,this.Rk=this.Sk=NaN,this.Uf=_e}Ue.prototype.copy=function(){var a=new Ue;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===Ue.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},Ue.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},Ue.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==Ue.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},Ue.prototype.ka=function(){if(Object.isFrozen(this)&&Wt("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==Ue.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},Ue.prototype.Xa=function(a){if(!(a instanceof Ue))return!1;if(this.type!==a.type)return this.type===Ue.j&&a.type===Ue.o?Hl(this,a):a.type===Ue.j&&this.type===Ue.o?Hl(a,this):!1;if(this.type===Ue.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 qt.B(this.startX,a.startX)&&qt.B(this.startY,a.startY)&&qt.B(this.endX,a.endX)&&qt.B(this.endY,a.endY)};function Hl(a,y){return a.type!==Ue.j||y.type!==Ue.o?!1:!!(y.figures.count===1&&(y=y.figures.M(0),y.segments.count===1&&qt.B(a.startX,y.startX)&&qt.B(a.startY,y.startY)&&(y=y.segments.M(0),y.type===So&&qt.B(a.endX,y.endX)&&qt.B(a.endY,y.endY))))}Ue.ia=function(a){return a.toString()},Ue.prototype.qb=function(a){a.classType===Ue&&(this.type=a)},Ue.prototype.toString=function(a){switch(a===void 0&&(a=-1),this.type){case Ue.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 Ue.u:var y=new Ce(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 Ue.F:if(y=new Ce(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 Ue.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()}},Ue.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},Ue.parse=function(a,y){function x(){return Mt>=Vt-1?!0:at[Mt+1].match(Xt)!==null}function E(){return Mt++,at[Mt]}function b(oi){var Xn=parseFloat(E()),Gi=parseFloat(E());It===It.toLowerCase()&&(Xn=Ht.x+Xn,Gi=Ht.y+Gi),oi.h(Xn,Gi)}function z(){return b(Ht),Ht}function tt(){return b(zt),zt}function ot(){var oi=Tt.toLowerCase();return oi!=="c"&&oi!=="s"&&oi!=="q"&&oi!=="t"?Ht:new Bt(2*Ht.x-zt.x,2*Ht.y-zt.y)}y===void 0&&(y=!1);var rt=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm;a=a.replace(/,/gm," "),a=a.replace(rt,"$1 $2"),a=a.replace(rt,"$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 at=a.split(" ");for(a=0;a<at.length;a++){var ut=at[a];if(ut.match(/(\.[0-9]*)(\.)/gm)!==null){rt=ln();for(var ft="",mt=!1,yt=0;yt<ut.length;yt++){var xt=ut[yt];xt!=="."||mt?xt==="."?(rt.push(ft),ft="."):ft+=xt:(mt=!0,ft+=xt)}for(rt.push(ft),at.splice(a,1),ut=0;ut<rt.length;ut++)at.splice(a+ut,0,rt[ut]);a+=rt.length-1,Be(rt)}}var Mt=-1,It="",Tt="";rt=new Bt(0,0);var zt=new Bt(0,0),Ht=new Bt(0,0),Vt=at.length;a=NS(null),mt=ft=ut=!1,yt=!0,xt=null;for(var Xt=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(Mt>=Vt-1);)if(Tt=It,It=E(),It!=="")switch(It.toUpperCase()){case"X":yt=!0,ft=ut=!1;break;case"M":for(xt=z(),a.mc===null||yt===!0?(Ef(a,xt.x,xt.y,ut,!ft,mt),yt=!1):a.moveTo(xt.x,xt.y),rt.assign(Ht);!x();)xt=z(),a.lineTo(xt.x,xt.y);break;case"L":for(;!x();)xt=z(),a.lineTo(xt.x,xt.y);break;case"H":for(;!x();)Ht=new Bt((It===It.toLowerCase()?Ht.x:0)+parseFloat(E()),Ht.y),a.lineTo(Ht.x,Ht.y);break;case"V":for(;!x();)Ht=new Bt(Ht.x,(It===It.toLowerCase()?Ht.y:0)+parseFloat(E())),a.lineTo(Ht.x,Ht.y);break;case"C":for(;!x();){xt=new Bt,b(xt);var le=tt(),$e=z();Ju(a,xt.x,xt.y,le.x,le.y,$e.x,$e.y)}break;case"S":for(;!x();)xt=ot(),le=tt(),$e=z(),Ju(a,xt.x,xt.y,le.x,le.y,$e.x,$e.y);break;case"Q":for(;!x();)xt=tt(),le=z(),Im(a,xt.x,xt.y,le.x,le.y);break;case"T":for(;!x();)zt=xt=ot(),le=z(),Im(a,xt.x,xt.y,le.x,le.y);break;case"B":for(;!x();){xt=parseFloat(E()),le=parseFloat(E()),$e=parseFloat(E());var mn=parseFloat(E()),cn=parseFloat(E()),We=cn,Te=!1;x()||(We=parseFloat(E()),x()||(Te=parseFloat(E())!==0)),It===It.toLowerCase()&&($e+=Ht.x,mn+=Ht.y),a.arcTo(xt,le,$e,mn,cn,We,Te)}break;case"A":for(;!x();)xt=Math.abs(parseFloat(E())),le=Math.abs(parseFloat(E())),$e=parseFloat(E()),cn=mn=!1,Te=We=0,We=E(),We.length===1?(mn=!!parseFloat(We),cn=!!parseFloat(E()),We=parseFloat(E())):We.length===2?(mn=!!parseFloat(We[0]),cn=!!parseFloat(We[1]),We=parseFloat(E())):(mn=!!parseFloat(We[0]),cn=!!parseFloat(We[1]),We=parseFloat(We.slice(2))),Te=parseFloat(E()),It===It.toLowerCase()&&(We=Ht.x+We,Te=Ht.y+Te),Ht.h(We,Te),Px(a,xt,le,$e,mn,cn,We,Te);break;case"Z":wx(a),Ht.assign(rt);break;case"F":for(xt="",le=1;at[Mt+le];)if(at[Mt+le]==="0")mt=!0,le++;else if(at[Mt+le].match(/[Uu]/)!==null)le++;else if(at[Mt+le].match(Xt)===null)le++;else{xt=at[Mt+le];break}xt.match(/[Mm]/)?ut=!0:0<a.mc.segments.length&&(a.mc.isFilled=!0);break;case"U":for(xt="",le=1;at[Mt+le];)if(at[Mt+le].match(/[Ff]/)!==null)le++;else if(at[Mt+le].match(Xt)===null)le++;else{xt=at[Mt+le];break}xt.match(/[Mm]/)?ft=!0:a.mc.isShadowed=!1}if(rt=a.os,Rm=a,y)for(y=rt.figures.iterator;y.next();)y.value.isFilled=!0;return rt},Ue.Ha=function(a,y){for(var x=a.length,E=Bt.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}Bt.free(E)},Ue.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===Ue.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},Ue.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===Ue.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),yh(this,a,!1),Wo(a,0,0,0,0),a.freeze()},Ue.prototype.ix=function(){var a=new Ce;return yh(this,a,!0),a};function yh(a,y,x){switch(a.type){case Ue.j:case Ue.u:case Ue.F:x?y.h(a.od,a.pd,0,0):Wo(y,a.od,a.pd,0,0),Wo(y,a.Dc,a.Ec,0,0);break;case Ue.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):Wo(y,z.startX,z.startY,0,0);for(var tt=z.segments.s,ot=tt.length,rt=z.startX,at=z.startY,ut=0;ut<ot;ut++){var ft=tt[ut];switch(ft.type){case So:case wr:rt=ft.endX,at=ft.endY,Wo(y,rt,at,0,0);break;case Zr:qt.Dl(rt,at,ft.point1X,ft.point1Y,ft.point2X,ft.point2Y,ft.endX,ft.endY,.5,y),rt=ft.endX,at=ft.endY;break;case pa:qt.iv(rt,at,ft.point1X,ft.point1Y,ft.endX,ft.endY,.5,y),rt=ft.endX,at=ft.endY;break;case ur:case La:var mt=ft.type===ur?na(ft,z):Ga(ft,z,rt,at),yt=mt.length;if(yt===0){rt=ft.type===ur?ft.centerX:ft.endX,at=ft.type===ur?ft.centerY:ft.endY,Wo(y,rt,at,0,0);break}ft=null;for(var xt=0;xt<yt;xt++)ft=mt[xt],qt.Dl(ft[0],ft[1],ft[2],ft[3],ft[4],ft[5],ft[6],ft[7],.5,y);ft!==null&&(rt=ft[6],at=ft[7]);break;default:Wt("Unknown Segment type: "+ft.type)}}}break;default:Wt("Unknown Geometry type: "+a.type)}}Ue.prototype.normalize=function(){this._isFrozen&&Ne(this);var a=this.ix();return this.offset(-a.x,-a.y),new Bt(-a.x,-a.y)},Ue.prototype.offset=function(a,y){return this._isFrozen&&Ne(this),this.transform(1,0,0,1,a,y),this},Ue.prototype.scale=function(a,y){return this._isFrozen&&Ne(this),this.transform(a,0,0,y,0,0),this},Ue.prototype.rotate=function(a,y,x){this._isFrozen&&Ne(this),y===void 0&&(y=0),x===void 0&&(x=0);var E=ci.alloc();return E.reset(),E.rotate(a,y,x),this.transform(E.m11,E.m12,E.m21,E.m22,E.dx,E.dy),ci.free(E),this},Ct=Ue.prototype,Ct.transform=function(a,y,x,E,b,z){switch(this.type){case Ue.j:case Ue.u:case Ue.F:var tt=this.od,ot=this.pd;this.od=tt*a+ot*x+b,this.pd=tt*y+ot*E+z,tt=this.Dc,ot=this.Ec,this.Dc=tt*a+ot*x+b,this.Ec=tt*y+ot*E+z;break;case Ue.o:for(var rt=this.figures.s,at=rt.length,ut=0;ut<at;ut++){var ft=rt[ut];tt=ft.startX,ot=ft.startY,ft.startX=tt*a+ot*x+b,ft.startY=tt*y+ot*E+z,ft=ft.segments.s;for(var mt=ft.length,yt=0;yt<mt;yt++){var xt=ft[yt];switch(xt.type){case So:case wr:tt=xt.endX,ot=xt.endY,xt.endX=tt*a+ot*x+b,xt.endY=tt*y+ot*E+z;break;case Zr:tt=xt.point1X,ot=xt.point1Y,xt.point1X=tt*a+ot*x+b,xt.point1Y=tt*y+ot*E+z,tt=xt.point2X,ot=xt.point2Y,xt.point2X=tt*a+ot*x+b,xt.point2Y=tt*y+ot*E+z,tt=xt.endX,ot=xt.endY,xt.endX=tt*a+ot*x+b,xt.endY=tt*y+ot*E+z;break;case pa:tt=xt.point1X,ot=xt.point1Y,xt.point1X=tt*a+ot*x+b,xt.point1Y=tt*y+ot*E+z,tt=xt.endX,ot=xt.endY,xt.endX=tt*a+ot*x+b,xt.endY=tt*y+ot*E+z;break;case ur:tt=xt.centerX,ot=xt.centerY,xt.centerX=tt*a+ot*x+b,xt.centerY=tt*y+ot*E+z,y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),xt.startAngle+=tt),0>a&&(xt.startAngle=180-xt.startAngle,xt.sweepAngle=-xt.sweepAngle),0>E&&(xt.startAngle=-xt.startAngle,xt.sweepAngle=-xt.sweepAngle),xt.radiusX*=Math.sqrt(a*a+x*x),xt.radiusY!==void 0&&(xt.radiusY*=Math.sqrt(y*y+E*E));break;case La:if(tt=xt.endX,ot=xt.endY,xt.endX=tt*a+ot*x+b,xt.endY=tt*y+ot*E+z,xt.radiusX===0||xt.radiusY===0)break;y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),xt.xAxisRotation+=tt),0>a&&(xt.xAxisRotation=180-xt.xAxisRotation,xt.isClockwiseArc=!xt.isClockwiseArc),0>E&&(xt.xAxisRotation=-xt.xAxisRotation,xt.isClockwiseArc=!xt.isClockwiseArc),xt.radiusX*=Math.sqrt(a*a+x*x),xt.radiusY*=Math.sqrt(y*y+E*E);break;default:Wt("Unknown Segment type: "+xt.type)}}}}return this._isInvalidBounds=!0,this},Ct.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 Ue.j:return qt.Yb(x,E,b,z,y,a.x,a.y);case Ue.u:var tt=Ce.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),Ce.free(tt),a;case Ue.F:tt=Math.min(x,b)-y;var ot=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),ot=a.y-(ot+y),1>=tt*tt/(x*x)+ot*ot/(y*y));case Ue.o:return za(this,a,y,!0,!1);default:return!1}};function za(a,y,x,E,b){var z=y.x;y=y.y;for(var tt=a.bounds.x-20,ot=0,rt,at,ut,ft,mt=a.figures.s,yt=mt.length,xt=0;xt<yt;xt++){var Mt=mt[xt],It=!Mt.isEvenOdd;if(Mt.isFilled){if(E&&Mt.ca(z,y,x))return!0;var Tt=Mt.segments;rt=Mt.startX,at=Mt.startY;for(var zt=rt,Ht=at,Vt=Tt.s,Xt=0;Xt<=Tt.length;Xt++){var le=void 0;if(Xt!==Tt.length){le=Vt[Xt];var $e=le.type;a=le.endX,ft=le.endY}else $e=So,a=zt,ft=Ht;switch($e){case wr:if(zt=lu(z,y,tt,y,rt,at,zt,Ht),isNaN(zt))return!0;ot+=zt,zt=a,Ht=ft;break;case So:if(rt=lu(z,y,tt,y,rt,at,a,ft),isNaN(rt))return!0;ot+=rt;break;case Zr:ut=qt.Fo(rt,at,le.point1X,le.point1Y,le.point2X,le.point2Y,a,ft,tt,y,z,y,.5),ot+=ut;break;case pa:ut=qt.Fo(rt,at,(rt+2*le.point1X)/3,(at+2*le.point1Y)/3,(2*le.point1X+a)/3,(2*le.point1Y+ft)/3,a,ft,tt,y,z,y,.5),ot+=ut;break;case ur:case La:$e=le.type===ur?na(le,Mt):Ga(le,Mt,rt,at);var mn=$e.length;if(mn===0){if(rt=lu(z,y,tt,y,rt,at,le.type===ur?le.centerX:le.endX,le.type===ur?le.centerY:le.endY),isNaN(rt))return!0;ot+=rt;break}le=null;for(var cn=0;cn<mn;cn++){if(le=$e[cn],cn===0){if(ut=lu(z,y,tt,y,rt,at,le[0],le[1]),isNaN(ut))return!0;ot+=ut}ut=qt.Fo(le[0],le[1],le[2],le[3],le[4],le[5],le[6],le[7],tt,y,z,y,.5),ot+=ut}le!==null&&(a=le[6],ft=le[7]);break;default:Wt("Unknown Segment type: "+le.type)}rt=a,at=ft}if(It){if(ot!==0)return!0}else if(ot%2!==0)return!0;ot=0}else if(Mt.ca(z,y,b?x:x+2))return!0}return!1}function lu(a,y,x,E,b,z,tt,ot){if(qt.Yb(b,z,tt,ot,.05,a,y))return NaN;var rt=(a-x)*(z-ot);if(rt===0)return 0;var at=((a*E-y*x)*(b-tt)-(a-x)*(b*ot-z*tt))/rt;if(y=(a*E-y*x)*(z-ot)/rt,at>=a)return 0;if((b>tt?b-tt:tt-b)<(z>ot?z-ot:ot-z)){if(z<ot){if(y<z||y>ot)return 0}else if(y<ot||y>z)return 0}else if(b<tt){if(at<b||at>tt)return 0}else if(at<tt||at>b)return 0;return 0<rt?1:-1}function Sh(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}Ct.Pu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=new Bt),this.type===Ue.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,ot=0;ot<b;ot++){var rt=E[ot],at=rt.length;for(a=0;a<at;a++){var ut=rt[a];if(tt+ut>=z)return E=z-tt,E=ut===0?0:E/ut,x=x[ot],ot=x[2*a],b=x[2*a+1],y.h(ot+(x[2*a+2]-ot)*E,b+(x[2*a+3]-b)*E),y;tt+=ut}}return y},Ct.wx=function(a){if(0>a?a=0:1<a&&(a=1),this.type===Ue.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 ot=x[tt],rt=ot.length;for(a=0;a<rt;a++){var at=ot[a];if(z+at>=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+=at}}return NaN},Ct.Qu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=[]),y.length=3,this.type===Ue.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,ot=0;ot<b;ot++){var rt=E[ot],at=rt.length;for(a=0;a<at;a++){var ut=rt[a];if(tt+ut>=z)return E=z-tt,E=ut===0?0:E/ut,ut=x[ot],x=ut[2*a],ot=ut[2*a+1],b=ut[2*a+2],a=ut[2*a+3],y[0]=x+(b-x)*E,y[1]=ot+(a-ot)*E,y[2]=1>Math.abs(b-x)&&1>Math.abs(a-ot)?0:1>Math.abs(b-x)?0<=a-ot?90:270:1>Math.abs(a-ot)?0<=b-x?0:180:180*Math.atan2(a-ot,b-x)/Math.PI,y;tt+=ut}}return y},Ct.xx=function(a){if(this.type===Ue.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 ot=Bt.alloc();return qt.qh(y,x,E,b,z,a,ot),a=ot.x,z=ot.y,Bt.free(ot),Math.sqrt(((a-y)*(a-y)+(z-x)*(z-x))/tt)}}else if(this.type===Ue.u){tt=this.startX,ot=this.startY;var rt=this.endX;if(b=this.endY,tt!==rt||ot!==b){y=rt-tt,x=b-ot,z=2*y+2*x,E=a.x,a=a.y,E=Math.min(Math.max(E,tt),rt),a=Math.min(Math.max(a,ot),b),tt=Math.abs(E-tt),rt=Math.abs(E-rt),ot=Math.abs(a-ot),b=Math.abs(a-b);var at=Math.min(tt,rt,ot,b);if(at===ot)return E/z;if(at===rt)return(y+a)/z;if(at===b)return(2*y+x-E)/z;if(at===tt)return(2*y+2*x-a)/z}}else{y=this.flattenedSegments,x=this.flattenedLengths,z=this.flattenedTotalLength,E=Bt.alloc(),b=1/0,ot=tt=0,rt=y.length;for(var ut=at=0,ft=0;ft<rt;ft++)for(var mt=y[ft],yt=x[ft],xt=mt.length,Mt=0;Mt<xt;Mt+=2){var It=mt[Mt],Tt=mt[Mt+1];if(Mt!==0){qt.qh(at,ut,It,Tt,a.x,a.y,E);var zt=(E.x-a.x)*(E.x-a.x)+(E.y-a.y)*(E.y-a.y);zt<b&&(b=zt,tt=ot,tt+=Math.sqrt((E.x-at)*(E.x-at)+(E.y-ut)*(E.y-ut))),ot+=yt[(Mt-2)/2]}at=It,ut=Tt}return Bt.free(E),a=tt/z,0>a?0:1<a?1:a}return 0};function Gc(a){if(a.tk===null){var y=a.tk=[],x=a.ym=[],E=[],b=[];if(a.type===Ue.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===Ue.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===Ue.F){var z=new xr;z.startX=a.endX,z.startY=(a.startY+a.endY)/2;var tt=new _i(ur);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=na(tt,z),b=a.length,b===0)E.push(tt.centerX),E.push(tt.centerY);else{tt=z.startX,z=z.startY;for(var ot=0;ot<b;ot++){var rt=a[ot];qt.Qe(tt,z,rt[2],rt[3],rt[4],rt[5],rt[6],rt[7],.5,E),tt=rt[6],z=rt[7]}}y.push(E),x.push(Kd(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,ot=tt,rt=z;for(var at=b.segments.s,ut=at.length,ft=0;ft<ut;ft++){var mt=at[ft];switch(mt.type){case wr:4<=E.length&&(y.push(E),x.push(Kd(E))),E=[],E.push(mt.endX),E.push(mt.endY),tt=mt.endX,z=mt.endY,ot=tt,rt=z;break;case So:E.push(mt.endX),E.push(mt.endY),tt=mt.endX,z=mt.endY;break;case Zr:qt.Qe(tt,z,mt.point1X,mt.point1Y,mt.point2X,mt.point2Y,mt.endX,mt.endY,.5,E),tt=mt.endX,z=mt.endY;break;case pa:qt.ep(tt,z,mt.point1X,mt.point1Y,mt.endX,mt.endY,.5,E),tt=mt.endX,z=mt.endY;break;case ur:var yt=na(mt,b),xt=yt.length;if(xt===0){E.push(mt.centerX),E.push(mt.centerY),tt=mt.centerX,z=mt.centerY;break}for(var Mt=0;Mt<xt;Mt++){var It=yt[Mt];qt.Qe(tt,z,It[2],It[3],It[4],It[5],It[6],It[7],.5,E),tt=It[6],z=It[7]}break;case La:if(yt=Ga(mt,b,tt,z),xt=yt.length,Mt=mt.endX,It=mt.endY,xt===0){E.push(Mt),E.push(It),tt=Mt,z=It;break}for(Mt=0;Mt<xt;Mt++)It=yt[Mt],qt.Qe(tt,z,It[2],It[3],It[4],It[5],It[6],It[7],.5,E),tt=It[6],z=It[7];break;default:Wt("Segment not of valid type: "+mt.type)}mt.isClosed&&(E.push(ot),E.push(rt))}4<=E.length&&(y.push(E),x.push(Kd(E)))}}}function Kd(a){for(var y=[],x=0,E=0,b=a.length,z=0;z<b;z+=2){var tt=a[z],ot=a[z+1];z!==0&&y.push(Math.sqrt(Zo(x,E,tt,ot))),x=tt,E=ot}return y}Ct.add=function(a){return this.ee.add(a),this},Ct.pm=function(a,y,x,E,b,z,tt,ot){return this._isFrozen&&Ne(this),this.fg=new rn(a,y,b,z).freeze(),this.gg=new rn(x,E,tt,ot).freeze(),this},oe.Object.defineProperties(Ue.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 Gc(this),this.tk}},flattenedLengths:{get:function(){return Gc(this),this.ym}},flattenedTotalLength:{get:function(){var a=this.zm;if(isNaN(a)){if(this.type===Ue.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===Ue.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&&Ne(this,a),this.na=a,a===Ue.o?this.ee=new ke:(Ue.V===null&&(Ue.V=new ke().freeze()),this.ee=Ue.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(a){this.od!==a&&(this._isFrozen&&Ne(this,a),this.od=a,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(a){this.pd!==a&&(this._isFrozen&&Ne(this,a),this.pd=a,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(a){this.Dc!==a&&(this._isFrozen&&Ne(this,a),this.Dc=a,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(a){this.Ec!==a&&(this._isFrozen&&Ne(this,a),this.Ec=a,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(a){this.ee!==a&&(this._isFrozen&&Ne(this,a),this.ee=a,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(a){this._isFrozen&&Ne(this,a),this.fg=a.J()}},spot2:{get:function(){return this.gg},set:function(a){this._isFrozen&&Ne(this,a),this.gg=a.J()}},defaultStretch:{get:function(){return this.Uf},set:function(a){this._isFrozen&&Ne(this,a),this.Uf=a}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),Ue.prototype.setSpots=Ue.prototype.pm,Ue.prototype.add=Ue.prototype.add,Ue.prototype.getFractionForPoint=Ue.prototype.xx,Ue.prototype.getPointAndAngleAlongPath=Ue.prototype.Qu,Ue.prototype.getAngleAlongPath=Ue.prototype.wx,Ue.prototype.getPointAlongPath=Ue.prototype.Pu,Ue.prototype.containsPoint=Ue.prototype.ca,Ue.prototype.transform=Ue.prototype.transform,Ue.prototype.rotate=Ue.prototype.rotate,Ue.prototype.scale=Ue.prototype.scale,Ue.prototype.offset=Ue.prototype.offset,Ue.prototype.normalize=Ue.prototype.normalize,Ue.prototype.computeBoundsWithoutOrigin=Ue.prototype.ix,Ue.prototype.equalsApprox=Ue.prototype.Xa,Ue.className="Geometry",Ue.j=new Se(Ue,"Line",0),Ue.u=new Se(Ue,"Rectangle",1),Ue.F=new Se(Ue,"Ellipse",2),Ue.o=new Se(Ue,"Path",3),Ue.V=null,Ue.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",Ue.className="Geometry",Ue.stringify=Ue.ia,Ue.fillPath=Ue.nb,Ue.parse=Ue.parse,Ue.Line=Ue.j,Ue.Rectangle=Ue.u,Ue.Ellipse=Ue.F,Ue.Path=Ue.o;function xr(a,y,x,E,b){En(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 ke,this.sr=this.pl.Ja,this.fw=null}xr.prototype.copy=function(){var a=new xr;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},Ct=xr.prototype,Ct.Xa=function(a){if(!(a instanceof xr&&qt.B(this.startX,a.startX)&&qt.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},Ct.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},Ct.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},Ct.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},Ct.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},Ct.add=function(a){return this.pl.add(a),this},Ct.ca=function(a,y,x){for(var E=this.startX,b=this.startY,z=E,tt=b,ot=this.segments.s,rt=ot.length,at=0;at<rt;at++){var ut=ot[at];switch(ut.type){case wr:z=ut.endX,tt=ut.endY,E=ut.endX,b=ut.endY;break;case So:if(qt.Yb(E,b,ut.endX,ut.endY,x,a,y))return!0;E=ut.endX,b=ut.endY;break;case Zr:if(qt.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 pa:if(qt.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 ur:case La:var ft=ut.type===ur?na(ut,this):Ga(ut,this,E,b),mt=ft.length,yt=ut.type===ur?ut.centerX:ut.endX,xt=ut.type===ur?ut.centerY:ut.endY;if(mt===0){if(qt.Yb(E,b,yt,xt,x,a,y))return!0;E=yt,b=xt;break}for(yt=null,xt=0;xt<mt;xt++)if(yt=ft[xt],xt===0&&qt.Yb(E,b,yt[0],yt[1],x,a,y)||qt.cs(yt[0],yt[1],yt[2],yt[3],yt[4],yt[5],yt[6],yt[7],.5,a,y,x))return!0;yt!==null&&(E=yt[6],b=yt[7]);break;default:Wt("Unknown Segment type: "+ut.type)}if(ut.isClosed&&(E!==z||b!==tt)&&qt.Yb(E,b,z,tt,x,a,y))return!0}return!1},oe.Object.defineProperties(xr.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&&Ne(this,a),this.l=a?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(a){this._isFrozen&&Ne(this,a),this.l=a?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&Ne(this,a),this.l=a?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(a){this._isFrozen&&Ne(this,a),this.od=a,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(a){this._isFrozen&&Ne(this,a),this.pd=a,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(a){this._isFrozen&&Ne(this,a),this.pl=a,this._isInvalidBounds=!0}}}),xr.prototype.add=xr.prototype.add,xr.prototype.equalsApprox=xr.prototype.Xa,xr.className="PathFigure";function _i(a,y,x,E,b,z,tt,ot){En(this),a===void 0&&(a=So),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===La?(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),ot&&(this.isClockwiseArc=!0)):(this.Ne=E,this.Vh=b,a===ur&&(z=Math.max(z,0)),this.Wh=z,typeof tt=="number"?(a===ur&&(tt=Math.max(tt,0)),this.Pg=tt):this.Pg=0),this.ae=null}_i.prototype.copy=function(){var a=new _i;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},Ct=_i.prototype,Ct.Xa=function(a){if(!(a instanceof _i)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case wr:case So:return qt.B(this.endX,a.endX)&&qt.B(this.endY,a.endY);case Zr:return qt.B(this.endX,a.endX)&&qt.B(this.endY,a.endY)&&qt.B(this.point1X,a.point1X)&&qt.B(this.point1Y,a.point1Y)&&qt.B(this.point2X,a.point2X)&&qt.B(this.point2Y,a.point2Y);case pa:return qt.B(this.endX,a.endX)&&qt.B(this.endY,a.endY)&&qt.B(this.point1X,a.point1X)&&qt.B(this.point1Y,a.point1Y);case ur:return qt.B(this.startAngle,a.startAngle)&&qt.B(this.sweepAngle,a.sweepAngle)&&qt.B(this.centerX,a.centerX)&&qt.B(this.centerY,a.centerY)&&qt.B(this.radiusX,a.radiusX)&&qt.B(this.radiusY,a.radiusY);case La:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&qt.B(this.xAxisRotation,a.xAxisRotation)&&qt.B(this.endX,a.endX)&&qt.B(this.endY,a.endY)&&qt.B(this.radiusX,a.radiusX)&&qt.B(this.radiusY,a.radiusY);default:return!1}},Ct.qb=function(a){a.classType===_i&&(this.type=a)},Ct.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 So:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Zr: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 pa: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 ur: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 La: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":"")},Ct.freeze=function(){return this._isFrozen=!0,this},Ct.ka=function(){return this._isFrozen=!1,this},Ct.close=function(){return this.isClosed=!0,this};function na(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=qt.jx(0,0,x<E?x:E,a.startAngle,a.startAngle+a.sweepAngle,!1);if(x!==E){var tt=ci.alloc();tt.reset(),x<E?tt.scale(1,E/x):tt.scale(x/E,1),Ue.Ha(z,tt),ci.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 Ga(a,y,x,E){function b(Mt,It,Tt,zt){return(Mt*zt<It*Tt?-1:1)*Math.acos((Mt*Tt+It*zt)/(Math.sqrt(Mt*Mt+It*It)*Math.sqrt(Tt*Tt+zt*zt)))}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,ot=a.isLargeArc,rt=a.isClockwiseArc,at=a.Dc,ut=a.Ec,ft=Math.cos(tt),mt=Math.sin(tt),yt=ft*(x-at)/2+mt*(E-ut)/2;tt=-mt*(x-at)/2+ft*(E-ut)/2;var xt=yt*yt/(y*y)+tt*tt/(z*z);return 1<xt&&(y*=Math.sqrt(xt),z*=Math.sqrt(xt)),xt=(ot===rt?-1:1)*Math.sqrt((y*y*z*z-y*y*tt*tt-z*z*yt*yt)/(y*y*tt*tt+z*z*yt*yt)),isNaN(xt)&&(xt=0),ot=xt*y*tt/z,xt=xt*-z*yt/y,isNaN(ot)&&(ot=0),isNaN(xt)&&(xt=0),x=(x+at)/2+ft*ot-mt*xt,E=(E+ut)/2+mt*ot+ft*xt,ut=b(1,0,(yt-ot)/y,(tt-xt)/z),ft=(yt-ot)/y,at=(tt-xt)/z,yt=(-yt-ot)/y,ot=(-tt-xt)/z,tt=b(ft,at,yt,ot),yt=(ft*yt+at*ot)/(Math.sqrt(ft*ft+at*at)*Math.sqrt(yt*yt+ot*ot)),-1>=yt?tt=Math.PI:1<=yt&&(tt=0),!rt&&0<tt&&(tt-=2*Math.PI),rt&&0>tt&&(tt+=2*Math.PI),rt=y>z?1:y/z,yt=y>z?z/y:1,y=qt.jx(0,0,y>z?y:z,ut,ut+tt,!0),z=ci.alloc(),z.reset(),z.translate(x,E),z.rotate(a.Ne,0,0),z.scale(rt,yt),Ue.Ha(y,z),ci.free(z),a.ae=y,a.ae}oe.Object.defineProperties(_i.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&&Ne(this,a),this.na=a,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(a){this._isFrozen&&Ne(this,a),this.Dc=a,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(a){this._isFrozen&&Ne(this,a),this.Ec=a,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(a){this._isFrozen&&Ne(this,a),this.Ne=a,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(a){this._isFrozen&&Ne(this,a),this.Vh=a,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(a){this._isFrozen&&Ne(this,a),this.Wh=a,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(a){this._isFrozen&&Ne(this,a),this.Pg=a,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(a){this._isFrozen&&Ne(this,a),this.Ne=a,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(a){this._isFrozen&&Ne(this,a),this.Vh=a,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(a){0>a&&an(a,">= zero",_i,"radiusX"),this._isFrozen&&Ne(this,a),this.Wh=a,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(a){0>a&&an(a,">= zero",_i,"radiusY"),this._isFrozen&&Ne(this,a),this.Pg=a,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(a){this._isFrozen&&Ne(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&&Ne(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&&Ne(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&&Ne(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&&Ne(this,a),a%=360,0>a&&(a+=360),this.Ne=a,this._isInvalidBounds=!0}}}),_i.prototype.equalsApprox=_i.prototype.Xa;var wr=new Se(_i,"Move",0),So=new Se(_i,"Line",1),Zr=new Se(_i,"Bezier",2),pa=new Se(_i,"QuadraticBezier",3),ur=new Se(_i,"Arc",4),La=new Se(_i,"SvgArc",4);_i.className="PathSegment",_i.Move=wr,_i.Line=So,_i.Bezier=Zr,_i.QuadraticBezier=pa,_i.Arc=ur,_i.SvgArc=La;function us(){this.H=null,this.xu=new Bt(0,0).freeze(),this.mt=new Bt(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}us.prototype.copy=function(){var a=new us;return this.clone(a)},us.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},us.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},us.prototype.So=function(a,y){var x=this.diagram;return x===null||yg(x,a,y),y},us.prototype.Bz=function(a,y){var x=this.diagram;return x===null||(yg(x,a,y),y.assign(x.Ps(y))),y},oe.Object.defineProperties(us.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}}}),us.prototype.getMultiTouchDocumentPoint=us.prototype.Bz,us.prototype.getMultiTouchViewPoint=us.prototype.So,us.className="InputEvent";function Fu(){this.H=null,this.xa="",this.ar=this.Lr=null}Fu.prototype.copy=function(){var a=new Fu;return a.H=this.H,a.xa=this.xa,a.Lr=this.Lr,a.ar=this.ar,a},Fu.prototype.toString=function(){var a="*"+this.name;return this.subject!==null&&(a+=":"+this.subject.toString()),this.parameter!==null&&(a+="("+this.parameter.toString()+")"),a},oe.Object.defineProperties(Fu.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}}}),Fu.className="DiagramEvent";function Ao(){this.Fm=No,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}Ao.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},Ao.prototype.copy=function(){var a=new Ao;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=Qt(y)&&typeof y.J=="function"?y.J():y,y=this.Rn,a.Rn=Qt(y)&&typeof y.J=="function"?y.J():y,y=this.Mn,a.Mn=Qt(y)&&typeof y.J=="function"?y.J():y,y=this.Ln,a.Ln=Qt(y)&&typeof y.J=="function"?y.J():y,a},Ao.prototype.qb=function(a){a.classType===Ao&&(this.change=a)},Ao.prototype.toString=function(){var a="";return a=this.change===ia?a+"* ":this.change===No?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===ia?this.oldValue!==null&&(a+=" "+this.oldValue):(this.object!==null&&(a+=zn(this.object)),this.oldValue!==null&&(a+=" old: "+zn(this.oldValue)),this.oldParam!==null&&(a+=" "+this.oldParam),this.newValue!==null&&(a+=" new: "+zn(this.newValue)),this.newParam!==null&&(a+=" "+this.newParam)),a},Ao.prototype.I=function(a){return a?this.oldValue:this.newValue},Ao.prototype.Dz=function(a){return a?this.oldParam:this.newParam},Ao.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},Ao.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},Ao.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},Ao.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},oe.Object.defineProperties(Ao.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===ia&&(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}}}),Ao.prototype.redo=Ao.prototype.redo,Ao.prototype.canRedo=Ao.prototype.canRedo,Ao.prototype.undo=Ao.prototype.undo,Ao.prototype.canUndo=Ao.prototype.canUndo,Ao.prototype.getParam=Ao.prototype.Dz,Ao.prototype.getValue=Ao.prototype.I,Ao.prototype.clear=Ao.prototype.clear;var ia=new Se(Ao,"Transaction",-1),No=new Se(Ao,"Property",0),ir=new Se(Ao,"Insert",1),mr=new Se(Ao,"Remove",2);Ao.className="ChangedEvent",Ao.Transaction=ia,Ao.Property=No,Ao.Insert=ir,Ao.Remove=mr;function kr(){this.o=new ke().freeze(),this.xa="",this.j=!1}kr.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},kr.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()},kr.prototype.canUndo=function(){return this.isComplete},kr.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()}},kr.prototype.canRedo=function(){return this.isComplete},kr.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()}},kr.prototype.ak=function(){if(this.isComplete){var a=this.changes;a.ka();for(var y=new kn,x=0;x<a.count;x++){var E=a.M(x);if(E!==null&&E.change===No&&E.object){var b=y.get(E.object);b||(b=new kn,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()}},oe.Object.defineProperties(kr.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}}}),kr.prototype.optimize=kr.prototype.ak,kr.prototype.redo=kr.prototype.redo,kr.prototype.canRedo=kr.prototype.canRedo,kr.prototype.undo=kr.prototype.undo,kr.prototype.canUndo=kr.prototype.canUndo,kr.prototype.clear=kr.prototype.clear,kr.className="Transaction";function Do(){this.Pt=new Me,this.Jd=!1,this.u=new ke().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new ke().freeze(),this.hl=new ke,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}Do.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},Do.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},Do.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled,this.maxHistoryLength=a.maxHistoryLength,this.checksTransactionLevel=a.checksTransactionLevel},Ct=Do.prototype,Ct.Xw=function(a){this.Pt.add(a)},Ct.Rx=function(a){this.Pt.remove(a)},Ct.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},Ct.eb=function(a){return a===void 0&&(a=""),xh(this,!0,a)},Ct.Kf=function(){return xh(this,!1,"")};function xh(a,y,x){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&ye("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}Ct.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()}},Do.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return!!(a!==null&&a.canUndo())},Do.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){ye("undo error: "+y.toString())}finally{this.Ob("FinishedUndo","Undo",a),this.Fe=!1}}},Do.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return!!(a!==null&&a.canRedo())},Do.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){ye("redo error: "+y.toString())}finally{this.Ob("FinishedRedo","Redo",a),this.Fe=!1}}},Do.prototype.Ob=function(a,y,x){x===void 0&&(x=null);var E=new Ao;for(E.change=ia,E.propertyName=a,E.object=x,E.oldValue=y,a=this.models;a.next();)y=a.value,E.model=y,y.ds(E)},Do.prototype.Tu=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var y=this.currentTransaction;y===null&&(this.Np=y=new kr);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||ye("Change not within a transaction: "+x.toString()))}},Do.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},oe.Object.defineProperties(Do.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}}}),Do.prototype.handleChanged=Do.prototype.Tu,Do.prototype.redo=Do.prototype.redo,Do.prototype.undo=Do.prototype.undo,Do.prototype.canUndo=Do.prototype.canUndo,Do.prototype.discardHistoryAfterIndex=Do.prototype.lx,Do.prototype.rollbackTransaction=Do.prototype.Kf,Do.prototype.commitTransaction=Do.prototype.eb,Do.prototype.startTransaction=Do.prototype.Ea,Do.prototype.removeModel=Do.prototype.Rx,Do.prototype.addModel=Do.prototype.Xw,Do.prototype.clear=Do.prototype.clear,Do.className="UndoManager";function Oi(){En(this),this.H=Ul,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new us,this.Zr=-1}Oi.prototype.toString=function(){return this.name!==""?this.name+" Tool":we(this.constructor)},Oi.prototype.updateAdornments=function(){},Oi.prototype.canStart=function(){return this.isEnabled},Oi.prototype.doStart=function(){},Oi.prototype.doActivate=function(){this.isActive=!0},Oi.prototype.doDeactivate=function(){this.isActive=!1},Oi.prototype.doStop=function(){},Oi.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},Oi.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")},Oi.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},Oi.prototype.doMouseMove=function(){},Oi.prototype.doMouseUp=function(){this.stopTool()},Oi.prototype.doMouseWheel=function(){},Oi.prototype.canStartMultiTouch=function(){return!0},Oi.prototype.standardPinchZoomStart=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,Bt.allocAt(NaN,NaN)),E=y.So(1,Bt.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}Bt.free(x),Bt.free(E)},Oi.prototype.standardPinchZoomMove=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,Bt.allocAt(NaN,NaN)),E=y.So(1,Bt.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 Bt((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 ot=a.zoomPoint;a.zoomPoint=b,tt.resetZoom(z),a.zoomPoint=ot}y.bubbles=!1}Bt.free(x),Bt.free(E)},Oi.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},Oi.prototype.doKeyUp=function(){},Oi.prototype.Ea=function(a){return a===void 0&&(a=this.name),this.transactionResult=null,this.diagram.Ea(a)},Oi.prototype.stopTransaction=function(){var a=this.diagram;return this.transactionResult===null?a.Kf():a.eb(this.transactionResult)},Oi.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.lastInput,x=a.Ol(y.documentPoint,!1);if(x!==null){if(qn?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||(qn?y.meta:y.control)||y.shift||a.clearSelection()}},Oi.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,Dp(a,E,x),E.handled};function Dp(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)}}}Oi.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 ot=z.mouseLeave;if(ot!==null&&(E===z||E!==null&&E.rg(z)||(ot(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}},Oi.prototype.doUpdateCursor=function(){var a=this.diagram;a&&(a.currentCursor="")},Oi.prototype.doCurrentObjectChanged=function(){},Oi.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===Xd&&!y.shift||b===hd&&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===Xd&&y.shift||b===hd&&!y.control){E=a.position.copy();var z=y.event;b=z.deltaMode;var tt=z.deltaX;z=z.deltaY;var ot="pixel";if(tt===0&&z===0||y.shift)!y.shift&&a.allowVerticalScroll?(x=3*x*a.scrollVerticalLineChange,a.scroll(ot,0<x?"up":"down",Math.abs(x))):y.shift&&a.allowHorizontalScroll&&(x=3*x*a.scrollHorizontalLineChange,a.scroll(ot,0<x?"left":"right",Math.abs(x)));else{switch(b){case 0:ot="pixel";break;case 1:ot="line";break;case 2:ot="page"}tt!==0&&a.allowHorizontalScroll&&(tt*=a.scrollHorizontalLineChange/16,a.scroll(ot,0<tt?"right":"left",Math.abs(tt))),z!==0&&a.allowVerticalScroll&&(z*=a.scrollVerticalLineChange/16,a.scroll(ot,0<z?"down":"up",Math.abs(z)))}this.doWheelChange(a,E,y)}}},Oi.prototype.doWheelChange=function(a,y,x){a.position.D(y)&&x.event.wheelDeltaX===0||(x.bubbles=!1)},Oi.prototype.standardWaitAfter=function(a,y){y===void 0&&(y=this.diagram.lastInput),this.cancelWaitAfter();var x=this,E=y.clone(this.yy);this.Zr=de(function(){x.doWaitAfter(E)},a)},Oi.prototype.cancelWaitAfter=function(){this.Zr!==-1&&Ke.clearTimeout(this.Zr),this.Zr=-1},Oi.prototype.doWaitAfter=function(){},Oi.prototype.findToolHandleAt=function(a,y){return a=this.diagram.ic(a,function(x){for(;x!==null&&!(x.panel instanceof Ii);)x=x.panel;return x}),a===null?null:a.part.category===y?a:null},Oi.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},oe.Object.defineProperties(Oi.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof ue&&(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}}}),Oi.prototype.startTransaction=Oi.prototype.Ea,Oi.className="Tool";function Eo(){Oi.call(this),this.name="ToolManager",this.hb=new ke,this.ob=new ke,this.Hb=new ke,this.F=this.V=850,this.o=new Qe(2,2).ja(),this.Ha=5e3,this.ia=hd,this.u=Hc,this.Mp=this.j=null,this.zj=-1}he(Eo,Oi),Eo.prototype.initializeStandardTools=function(){},Eo.prototype.updateAdornments=function(a){var y=this.currentToolTip;if(y instanceof Ii&&this.Mp===a){var x=y.adornedObject;(a!==null?x.part===a:x===null)?this.showToolTip(y,x):this.hideToolTip()}},Eo.prototype.doMouseDown=function(){var a=this.diagram,y=a.lastInput;if(y.isTouchEvent&&this.gestureBehavior===uu&&(y.bubbles=!1),y.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===wh){y.bubbles=!0;return}if(this.gestureBehavior===uu)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===hd?this.mouseWheelBehavior=Xd:this.mouseWheelBehavior===Xd&&(this.mouseWheelBehavior=hd)),this.doActivate(),this.standardWaitAfter(this.holdDelay,y)},Eo.prototype.doMouseMove=function(){var a=this.diagram,y=a.lastInput;if(y.isMultiTouch){if(this.gestureBehavior===wh){y.bubbles=!0;return}if(this.gestureBehavior===uu)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}}Op(this,a),a=y.event,a===null||a.type!=="pointermove"&&a.cancelable||(y.bubbles=!0)};function Op(a,y){a.standardMouseOver(),a.isBeyondDragSize()&&a.standardWaitAfter(a.isActive?a.holdDelay:a.hoverDelay,y.lastInput)}Eo.prototype.doCurrentObjectChanged=function(a,y){a=this.currentToolTip,a===null||y!==null&&a instanceof Ii&&(y===a||y.rg(a))||this.hideToolTip()},Eo.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()))},Eo.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)},Eo.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 Ii)||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()},Eo.prototype.showToolTip=function(a,y){var x=this.diagram;if(a!==this.currentToolTip&&this.hideToolTip(),a instanceof Ii){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 Nl&&a!==this.currentToolTip&&a.show(y,x,this);if(this.currentToolTip=a,this.zj!==-1&&(Ke.clearTimeout(this.zj),this.zj=-1),a=this.toolTipDuration,0<a&&a!==1/0){var b=this;this.zj=de(function(){b.hideToolTip()},a)}},Eo.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}},Eo.prototype.hideToolTip=function(){this.zj!==-1&&(Ke.clearTimeout(this.zj),this.zj=-1);var a=this.diagram,y=this.currentToolTip;y!==null&&(y instanceof Ii?(a.remove(y),this.Mp!==null&&this.Mp.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Nl&&y.hide!==null&&y.hide(a,this),this.currentToolTip=null)},Eo.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()},Eo.prototype.doMouseWheel=function(){this.standardMouseWheel()},Eo.prototype.doKeyDown=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyDown()},Eo.prototype.doKeyUp=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyUp()},Eo.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},Eo.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},Eo.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)},oe.Object.defineProperties(Eo.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 Ii?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}}}),Eo.prototype.replaceStandardTool=Eo.prototype.gb;var hd=new Se(Eo,"WheelScroll",0),Xd=new Se(Eo,"WheelZoom",1),tg=new Se(Eo,"WheelNone",2),Hc=new Se(Eo,"GestureZoom",3),uu=new Se(Eo,"GestureCancel",4),wh=new Se(Eo,"GestureNone",5);Eo.className="ToolManager",Eo.WheelScroll=hd,Eo.WheelZoom=Xd,Eo.WheelNone=tg,Eo.GestureZoom=Hc,Eo.GestureCancel=uu,Eo.GestureNone=wh;function Oo(){Oi.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 Bt(NaN,NaN),this.Fr=new Bt,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new Me().freeze(),this.ia=new st,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var Wl;he(Oo,Oi),Oo.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},Oo.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},Oo.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,(qn?y.meta:y.control)||y.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.R("ChangedSelection",a.selection))}}},Oo.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),Ir=null,this.isActive=!0,this.tl.set(a.position),Wc(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&&_s(a),sf(a,this.draggedParts),this.Ea("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,Ir=this,Du=this.diagram,this.doSimulatedDragOut()))};function Wc(a,y){if(a.dragsLink){var x=a.diagram;x.allowRelink&&(x.model.Wj()&&y.count===1&&y.first()instanceof Ve?(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 ma,a.Oe.diagram=x),a.Oe.originalLink=a.draggedLink):(a.draggedLink=null,a.Oe=null))}}Oo.prototype.computeEffectiveCollection=function(a,y){return this.diagram.commandHandler.computeEffectiveCollection(a,y)},Oo.prototype.Pd=function(a){return a===void 0?new pu(vo):this.isGridSnapEnabled?new pu(new Bt(Math.round(1e3*a.x)/1e3,Math.round(1e3*a.y)/1e3)):new pu(a.copy())},Oo.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,a.Fu(!1),a.ug(),Ph(this),Dh(a,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<Wl.count){for(var y=Wl,x=y.length,E=0;E<x;E++){var b=y.M(E);Nu(b),tl(b),Ph(b),b.diagram.ug()}y.clear()}Nu(this),this.tl.h(NaN,NaN),Du!==null&&(Du.currentCursor=""),Ir=Du=null,tl(this),a.isMouseCaptured=!1,a.currentCursor="",a.Ns=!1,this.stopTransaction(),lc(a,!0)},Oo.prototype.stopTransaction=function(){var a=this.diagram,y=Oi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y};function Ph(a){var y=a.diagram,x=y.skipsUndoManager;y.skipsUndoManager=!0,ng(a,y.lastInput,null),y.skipsUndoManager=x,a.Cg.length=0}function eg(){var a=Ir;tl(a),Tu(a);var y=a.diagram;a.tl.w()&&(y.position=a.tl),y.ug()}Oo.prototype.doCancel=function(){tl(this),Tu(this);var a=this.diagram;this.tl.w()&&(a.position=this.tl),this.stopTool()},Oo.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput;this.isActive&&(y.key==="Esc"?this.doCancel():y.key!==a.previousInput.key&&this.doMouseMove())},Oo.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function hu(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")):Tu(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 kn,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 Ve&&E.canCopy()&&x.add(E,a.Pd());a.copiedParts=x,Wc(a,x.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,$u(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}function tl(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 Ve&&(x.value.point=new Bt(0,0));a.doUpdateCursor(null)}y.skipsUndoManager=!1,y.partManager.addsToTemporaryLayer=!1,a.startPoint=y.firstInput.documentPoint}function Nu(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 Fl(a,y,x){var E=a.diagram,b=a.startPoint,z=Bt.alloc();z.assign(E.lastInput.documentPoint),a.moveParts(y,z.re(b),x),Bt.free(z),E.Gf("temporaryPixelRatio")===!0&&E.Yh===null&&30<E.$w&&(_s(E),E.hk())}Oo.prototype.moveParts=function(a,y,x){x===void 0&&(x=!1);var E=this.diagram;E!==null&&Bh(E,a,y,this.dragOptions,x)};function Tu(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 Ve&&E.suspendsRouting){var b=x.value.point;a.draggedParts.add(E,a.Pd()),$u(E,-b.x,-b.y)}y.bd()}}function Vc(a,y){var x=a.diagram;a.dragsLink&&(a.draggedLink!==null&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),Au(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=ng(a,b,E),!a.isActive&&Ir===null)return;var ot=E!==null?E.part:null;if(ot===null||x.handlesDragDropForTopLevelParts&&ot.isTopLevel&&!(ot instanceof ri)){var rt=x.mouseDragOver;rt!==null&&(rt(b),tt=!0)}if(!a.isActive&&Ir===null||(a.doDragOver(y,E),!a.isActive&&Ir===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)}Oo.prototype.findDragOverObject=function(a){var y=this;return Yl(this.diagram,a,null,function(x){return x===null?x=!0:(x=x.part,x=!!(x===null||x instanceof Ii||x.layer.isTemporary||y.draggedParts&&y.draggedParts.contains(x)||y.copiedParts&&y.copiedParts.contains(x))),!x})},Oo.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 ng(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 ot=a.Cg[tt],rt=ot.mouseDragLeave;if(rt!==null&&(rt(y,ot,x),E=!0,y.handled))break}if(a.Cg.length=0,!a.isActive&&Ir===null||x===null)return E;for(y.handled=!1,b=x;b!==null;)a.Cg.push(b),b=ig(b);for(b=a.Cg.length,x=0;x<b&&(tt=a.Cg[x],ot=tt.mouseDragEnter,ot===null||(ot(y,tt,z),E=!0,!y.handled));x++);return E}function ig(a){var y=a.panel;return y!==null?y:a instanceof On&&!(a instanceof ri)&&(a=a.containingGroup,a!==null&&a.handlesDragDropForMembers)?a:null}function Ip(a,y,x){var E=a.Oe;if(E===null)return null;var b=a.diagram.og(y,E.portGravity,function(at){return E.findValidLinkablePort(at,x)});a=Bt.alloc();var z=1/0,tt=null;for(b=b.iterator;b.next();){var ot=b.value;if(ot.part!==null){var rt=ot.ga(ji,a);rt=y.Bf(rt),rt<z&&(tt=ot,z=rt)}}return Bt.free(a),tt}function Au(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=Ip(a,x.i(0),!1),z!==null&&(tt=z.part));var ot=null,rt=null;x.toNode===null&&(ot=Ip(a,x.i(x.pointsCount-1),!0),ot!==null&&(rt=ot.part)),b.isValidLink(tt,z,rt,ot)?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=rt,ot!==null&&(x.toPortId=ot.portId),x.fromPort!==E.Mx&&E.R("LinkRelinked",x,E.Mx),x.toPort!==E.Nx&&E.R("LinkRelinked",x,E.Nx)):Uc(b,tt,z,rt,ot):Uc(b,null,null,null,null)}}}}Oo.prototype.doDragOver=function(){};function Bu(a,y){var x=a.diagram;a.dragsLink&&Au(a,!0),Ph(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;J0(a,b,z),z=ig(z)}}else z=x.mouseDrop,z!==null&&z(b);if(a.isActive||Ir!==null){for(b=(a.copiedParts||a.draggedParts).iterator;b.next();)z=b.key,z instanceof nn&&z.linksConnected.each(function(ot){ot.suspendsRouting=!1});if(a.doDropOnto(y,E),a.isActive||Ir!==null){for(a=Ce.alloc(),y=x.selection.iterator;y.next();)E=y.value,E instanceof nn&&Q0(x,E,a);Ce.free(a)}}}function J0(a,y,x){a=a.diagram,x=x.part,!a.handlesDragDropForTopLevelParts||!x.isTopLevel||x instanceof ri||(x=a.mouseDrop,x!==null&&x(y))}function Q0(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 Ve},!0,function(b){return b instanceof Ve},E),a.count!==0)for(a=a.iterator;a.next();)x=a.value,!x.Td(y)&&x.isAvoiding&&x.bb()}Oo.prototype.doDropOnto=function(){},Oo.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()?(hu(this,!1),sf(a,this.copiedParts),Fl(this,this.copiedParts,!1),Dh(a,this.copiedParts)):this.mayMove()?(tl(this),Fl(this,this.draggedParts,!0)):this.mayDragOut()?(hu(this,!1),Fl(this,this.copiedParts,!1)):tl(this),Vc(this,a.lastInput.documentPoint))}},Oo.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?(tl(this),hu(this,!0),sf(a,this.copiedParts),Fl(this,this.copiedParts,!1),Dh(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,tl(this),this.mayMove()&&(Fl(this,this.draggedParts,!0),Vc(this,a.lastInput.documentPoint))),this.Ym=!0,Bu(this,a.lastInput.documentPoint),this.isActive){var E=x?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,y&&q0(this),a.Ya(),Dh(a,this.draggedParts),this.transactionResult=x?"Copy":"Move",a.R(x?"SelectionCopied":"SelectionMoved",E)}this.stopTool(),x&&a.R("ChangedSelection",a.selection)}}},Oo.prototype.simulatedMouseMove=function(a,y,x){if(Ir===null)return!1;var E=Ir.diagram;x instanceof ue||(x=null);var b=Du;return x!==b&&(b!==null&&b!==E&&(b.ug(),Ir.isDragOutStarted=!1,b=b.toolManager.findTool("Dragging"),b!==null&&b.doSimulatedDragLeave()),Du=x,x!==null&&x!==E&&(eg(),b=x.toolManager.findTool("Dragging"),b!==null&&(Wl.contains(b)||Wl.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)},Oo.prototype.simulatedMouseUp=function(a,y,x){if(Ir===null)return!1;var E=Du,b=Ir.diagram;if(x===null)return Ir.doCancel(),!0;if(x!==E){var z=E.toolManager.findTool("Dragging");if(E!==null&&E!==b&&z!==null)return E.ug(),Ir.isDragOutStarted=!1,z.doSimulatedDragLeave(),!1;Du=x,E=x.toolManager.findTool("Dragging"),E!==null&&(eg(),Wl.contains(E)||Wl.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 Bt),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=Ir,a!==null&&(x=a.mayCopy(),a.transactionResult=x?"Copy":"Move",a.stopTool()),!0):!1};function q0(a){if(a.draggedParts!==null)for(var y=a.draggedParts.iterator;y.next();){var x=y.key;x instanceof nn&&(x=x.containingGroup,x===null||x.placeholder===null||a.draggedParts.contains(x)||x.placeholder.v())}}Oo.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(qn?!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())},Oo.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())},Oo.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())},Oo.prototype.computeBorder=function(a,y,x){return this.Ym||this.draggedParts===null||this.draggedParts.contains(a)?null:x.assign(y)},Oo.prototype.Az=function(){return Ir},Oo.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var y=Ir;return!(y===null||y.diagram.model.dataFormat!==a.model.dataFormat)},Oo.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Cc(),Ea(a),a.animationManager.Cc(),a=Ir,a!==null&&(a.diagram.Ns=!1),this.doUpdateCursor(null)}},Oo.prototype.doSimulatedDragLeave=function(){var a=Ir;a!==null&&a.doSimulatedDragOut(),this.doCancel()},Oo.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.Dm=!0;var y=Ir;if(y!==null&&y.draggedParts!==null){if(!this.mayDragIn())return;Rp(this,y.draggedParts.Lf(),!1,a.firstInput),Fl(this,this.copiedParts,!1),Vc(this,a.lastInput.documentPoint)}a.animationManager.Dm=!1},Oo.prototype.doSimulatedDrop=function(){var a=this.diagram,y=Ir;if(y!==null){var x=y.diagram;if(y.Ym=!0,tl(this),!this.mayDragIn())return;a.animationManager.Dm=!0,a.R("ChangingSelection",a.selection),this.Ea("Drop"),Rp(this,y.draggedParts.Lf(),!0,a.lastInput),Fl(this,this.copiedParts,!1);var E=new Me;this.copiedParts!==null&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0,E.add(b)})),Bu(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 Rp(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=Ce.alloc();b=E=1/0;for(var tt=-1/0,ot=-1/0,rt=y.iterator;rt.next();){var at=rt.value;if(at.isVisible()){var ut=at.location;at=ut.x,ut=ut.y,isNaN(at)||isNaN(ut)||(at<E&&(E=at),ut<b&&(b=ut),at>tt&&(tt=at),ut>ot&&(ot=ut))}}for(E===1/0?z.h(0,0,0,0):z.h(E,b,tt-E,ot-b),E=z.x+z.width/2,b=z.y+z.height/2,Ce.free(z),z=a.Fr,tt=new kn,ot=Bt.alloc(),rt=y.iterator;rt.next();)at=rt.value,at instanceof Ve&&at.canCopy()&&(ut=x.I(at),ut!==null&&(ut.points=at.points,$u(ut,z.x-E,z.y-b),ut.suspendsRouting=!0,tt.add(ut,a.Pd())));for(y=y.iterator;y.next();)at=y.value,at.Zc()&&at.canCopy()&&(rt=x.I(at),rt!==null&&(at=at.location,ot.h(z.x-(E-at.x),z.y-(b-at.y)),rt.location=ot,rt.Va(),tt.add(rt,a.Pd(ot))));Bt.free(ot),a.copiedParts=tt,Wc(a,tt.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,$u(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}Oo.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ns=!1,this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor,this.Bn=null},Oo.prototype.computeMove=function(a,y,x,E){return x=this.diagram,x!==null?x.computeMove(a,y,this.dragOptions,E):new Bt},oe.Object.defineProperties(Oo.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}}}),Oo.prototype.getDraggingSource=Oo.prototype.Az;var Ir=null,Du=null;Oo.className="DraggingTool",Wl=new ke,si("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)}),Eo.prototype.doCancel=function(){Ir!==null&&Ir.doCancel(),Oi.prototype.doCancel.call(this)};function Qo(){Oi.call(this),this.te=100,this.Ha=!1,this.u="pointer";var a=new Ve,y=new gi;y.isPanelMain=!0,y.stroke="blue",a.add(y),y=new gi,y.toArrow="Standard",y.fill="blue",y.stroke="blue",a.add(y),a.layerName="Tool",this.Ci=a,a=new nn,y=new gi,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=no,a.add(y),a.selectable=!1,a.layerName="Tool",this.Bi=a,this.j=y,a=new nn,y=new gi,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=no,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 kn,this.Of=this.gj=this.Pf=null}he(Qo,Oi),Qo.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},Qo.prototype.copyPortProperties=function(a,y,x,E,b){if(a!==null&&y!==null&&x!==null&&E!==null){var z=y.Df(),tt=Qe.alloc();tt.width=y.naturalBounds.width*z,tt.height=y.naturalBounds.height*z,E.desiredSize=tt,Qe.free(tt),b?(E.toSpot=y.toSpot,E.toEndSegmentLength=y.toEndSegmentLength):(E.fromSpot=y.fromSpot,E.fromEndSegmentLength=y.fromEndSegmentLength),x.locationSpot=ji,z=Bt.alloc(),x.location=y.ga(ji,z),Bt.free(z),E.angle=y.li(),this.portTargeted!==null&&this.portTargeted(a,y,x,E,b)}},Qo.prototype.setNoTargetPortProperties=function(a,y,x){y!==null&&(y.desiredSize=no,y.fromSpot=Ni,y.toSpot=Ni),a!==null&&(a.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,a,y,x)},Qo.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},Qo.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof nn){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)}},Qo.prototype.findValidLinkablePort=function(a,y){if(a===null)return null;var x=a.part;if(!(x instanceof nn))return null;for(;a!==null;){var E=y?a.toLinkable:a.fromLinkable;if(E===!0&&(a.portId!==null||a instanceof nn)&&(y?this.isValidTo(x,a):this.isValidFrom(x,a)))return a;if(E===!1)break;a=a.panel}return null},Qo.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,ot=tt.part;if(ot instanceof nn){var rt=tt.ga(ji,Bt.alloc()),at=x.x-rt.x,ut=x.y-rt.y;Bt.free(rt),rt=at*at+ut*ut,rt<E&&(at=this.validPortsCache.I(tt),at!==null?at&&(y=tt,E=rt):a&&this.isValidLink(this.originalFromNode,this.originalFromPort,ot,tt)||!a&&this.isValidLink(ot,tt,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(tt,!0),y=tt,E=rt):this.validPortsCache.add(tt,!1))}}return y!==null&&(x=y.part,x instanceof nn&&(x.layer===null||x.layer.allowLink))?y:null},Qo.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},Qo.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},Qo.prototype.isInSameNode=function(a,y){return a===null||y===null?!1:a===y?!0:(a=a.part,y=y.part,a!==null&&a===y)},Qo.prototype.isLinked=function(a,y){if(a===null||y===null)return!1;var x=a.part;if(!(x instanceof nn))return!1;a=a.portId,a===null&&(a="");var E=y.part;if(!(E instanceof nn))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},Qo.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)},Qo.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 Me;return E.add(a),hs(this,x,y,E)};function hs(a,y,x,E){if(y===x)return!0;var b=y.fromNode;return b!==null&&b.isLinkLabel&&(E.add(b),hs(a,b.labeledLink,x,E))?!0:(y=y.toNode,!!(y!==null&&y.isLinkLabel&&(E.add(y),hs(a,y.labeledLink,x,E))))}Qo.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!==fc){if(E===Dg){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!ys(this,a,y,x,!0)}if(E===Og){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!ys(this,a,y,x,!0)}if(E===Tg)return a===y?a=!0:(E=new Me,E.add(y),a=Ss(this,E,a,y,x)),!a;if(E===Ag)return!ys(this,a,y,x,!1);if(E===Bg)return a===y?a=!0:(E=new Me,E.add(y),a=dd(this,E,a,y,x)),!a}return!0};function ys(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&&ys(a,tt,x,E,b)))return!0}return!1}function Ss(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&&Ss(a,y,tt,E,b)))return!0}return!1}function dd(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 ot=tt.fromNode;if(tt=tt.toNode,ot=ot===x?tt:ot,ot!==x&&dd(a,y,ot,E,b))return!0}}return!1}oe.Object.defineProperties(Qo.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}}}),Qo.className="LinkingBaseTool";function xs(){Qo.call(this),this.name="Linking",this.V={},this.F=null,this.K=Ch,this.Xd=null}he(xs,Qo),xs.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},xs.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 nn)))return null;var x=this.direction;if(x===Ch||x===jp){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===Ch||x===_p)&&(y=this.findValidLinkablePort(y,!0),y!==null||this.startObject===a&&(y=a.port,this.findValidLinkablePort(y,!0)))?(this.isForwards=!1,y):null},xs.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 nn&&(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 nn&&(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)},xs.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()},xs.prototype.doStop=function(){Qo.prototype.doStop.call(this),this.startObject=null},xs.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 ot=tt.part;ot instanceof nn&&(this.isForwards?(this.originalFromNode!==null&&(y=this.originalFromNode,x=this.originalFromPort),E=ot,b=tt):(y=ot,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)}}},xs.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(a===null)return!0;if(a instanceof Ve)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)},xs.prototype.insertLink=function(a,y,x,E){return this.diagram.partManager.insertLink(a,y,x,E)},xs.prototype.doNoLink=function(){},oe.Object.defineProperties(xs.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 Ch=new Se(xs,"Either",0),jp=new Se(xs,"ForwardsOnly",0),_p=new Se(xs,"BackwardsOnly",0);xs.className="LinkingTool",xs.Either=Ch,xs.ForwardsOnly=jp,xs.BackwardsOnly=_p;function ma(){Qo.call(this),this.name="Relinking";var a=new gi;a.figure="Diamond",a.desiredSize=_o,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=0,this.V=a,a=new gi,a.figure="Diamond",a.desiredSize=_o,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=-1,this.Xd=a,this.F=null,this.Ew=new Ce}he(ma,Qo),ma.prototype.updateAdornments=function(a){if(a!==null&&a instanceof Ve){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)}},ma.prototype.makeAdornment=function(a,y){var x=new Ii;return x.type=ze.Link,y=y?this.toHandleArchetype:this.fromHandleArchetype,y!==null&&x.add(y.copy()),x.adornedObject=a,x},ma.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},ma.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 Ii&&x.adornedPart instanceof Ve))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=ni),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=ni),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},ma.prototype.copyLinkProperties=function(a,y){if(a!==null&&y!==null){y.adjusting=a.adjusting,y.corner=a.corner;var x=a.curve;(x===Nf||x===th)&&(x=Es),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}},ma.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()},ma.prototype.doStop=function(){Qo.prototype.doStop.call(this),this.handle=null},ma.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 nn&&(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()}}},ma.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},ma.prototype.doNoRelink=function(){};function Uc(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)}oe.Object.defineProperties(ma.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 Ii))throw Error("new handle is not in an Adornment: "+a);this.F=a}}}),ma.className="RelinkingTool",si("linkingTool",function(){return this.findTool("Linking")},function(a){this.gb("Linking",a,this.mouseMoveTools)}),si("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.gb("Relinking",a,this.mouseDownTools)});function or(){Oi.call(this),this.name="LinkReshaping";var a=new gi;a.figure="Rectangle",a.desiredSize=Ho,a.fill="lightblue",a.stroke="dodgerblue",this.o=a,a=new gi,a.figure="Diamond",a.desiredSize=_o,a.fill="lightblue",a.stroke="dodgerblue",a.cursor="move",this.u=a,this.F=3,this.Ts=this.j=null,this.Fw=new Bt,this.Yq=new ke}he(or,Oi),or.prototype.Ru=function(a){return a&&a.reshapingBehavior.value!==0?a.reshapingBehavior:og},or.prototype.om=function(a,y){a.reshapingBehavior=y},or.prototype.updateAdornments=function(a){if(a!==null&&a instanceof Ve){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)}},or.prototype.makeAdornment=function(a){var y=a.part,x=y.pointsCount,E=y.isOrthogonal,b=null;if(y.points!==null&&1<x){b=new Ii,b.type=ze.Link,x=y.firstPickIndex;var z=y.lastPickIndex,tt=E?1:0;if(y.resegmentable&&y.computeCurve()!==wa)for(var ot=x+tt;ot<z-tt;ot++){var rt=this.makeResegmentHandle(a,ot);rt!==null&&(rt.segmentIndex=ot,rt.segmentFraction=.5,rt.fromMaxLinks=999,b.add(rt))}for(tt=x+1;tt<z;tt++)if(ot=this.makeHandle(a,tt),ot!==null){if(ot.segmentIndex=tt,tt!==x)if(tt===x+1&&E){rt=y.i(x);var at=y.i(x+1);qt.B(rt.x,at.x)&&qt.B(rt.y,at.y)&&(at=y.i(x-1)),qt.B(rt.x,at.x)?(this.om(ot,Ru),ot.cursor="n-resize"):qt.B(rt.y,at.y)&&(this.om(ot,Iu),ot.cursor="w-resize")}else tt===z-1&&E?(rt=y.i(z-1),at=y.i(z),qt.B(rt.x,at.x)&&qt.B(rt.y,at.y)&&(rt=y.i(z+1)),qt.B(rt.x,at.x)?(this.om(ot,Ru),ot.cursor="n-resize"):qt.B(rt.y,at.y)&&(this.om(ot,Iu),ot.cursor="w-resize")):tt!==z&&(this.om(ot,Yc),ot.cursor="move");b.add(ot)}b.adornedObject=a}return b},or.prototype.makeHandle=function(){var a=this.handleArchetype;return a===null?null:a.copy()},or.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return a===null?null:a.copy()},or.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},or.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 Ve){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}}},or.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},or.prototype.stopTransaction=function(){var a=this.diagram,y=Oi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},or.prototype.doCancel=function(){var a=this.adornedLink;a!==null&&(a.points=this.Yq),this.stopTool()},or.prototype.getResegmentingPoint=function(){return this.handle.ga(ji)},or.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))},or.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&&(Ou(this,tt,E,b,z,!0)||Ou(this,tt,E,b,z,!1))){var ot=y.points.copy();Ou(this,tt,E,b,z,!0)?(ot.cd(x-2,new Bt(tt.x,(z.y+tt.y)/2)),ot.cd(x+1,new Bt(z.x,(z.y+tt.y)/2))):(ot.cd(x-2,new Bt((z.x+tt.x)/2,tt.y)),ot.cd(x+1,new Bt((z.x+tt.x)/2,z.y))),ot.mb(x),ot.mb(x-1),y.points=ot,y.Wb()}else tt=y.i(x+2),Math.abs(b.x-z.x)<this.resegmentingDistance&&Math.abs(b.y-z.y)<this.resegmentingDistance&&(Ou(this,E,b,z,tt,!0)||Ou(this,E,b,z,tt,!1))&&(ot=y.points.copy(),Ou(this,E,b,z,tt,!0)?(ot.cd(x-1,new Bt(E.x,(E.y+tt.y)/2)),ot.cd(x+2,new Bt(tt.x,(E.y+tt.y)/2))):(ot.cd(x-1,new Bt((E.x+tt.x)/2,E.y)),ot.cd(x+2,new Bt((E.x+tt.x)/2,tt.y))),ot.mb(x+1),ot.mb(x),y.points=ot,y.Wb())}}else tt=Bt.alloc(),qt.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()),Bt.free(tt)}a.Ya(),this.transactionResult=this.name,a.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function Ou(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}or.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===Ru?(y.L(x,y.i(x-1).x,a.y),y.L(x+1,y.i(x+2).x,a.y)):E===Iu&&(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===Ru?(y.L(x-1,y.i(x-2).x,a.y),y.L(x,y.i(x+1).x,a.y)):E===Iu&&(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);qt.B(z.x,b.x)&&qt.B(b.y,tt.y)?(qt.B(z.x,y.i(E-2).x)&&!qt.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),qt.B(tt.y,y.i(E+2).y)&&!qt.B(tt.x,y.i(E+2).x)?y.m(E+1,tt.x,a.y):y.L(E+1,tt.x,a.y)):qt.B(z.y,b.y)&&qt.B(b.x,tt.x)?(qt.B(z.y,y.i(E-2).y)&&!qt.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),qt.B(tt.x,y.i(E+2).x)&&!qt.B(tt.y,y.i(E+2).y)?y.m(E+1,a.x,tt.y):y.L(E+1,a.x,tt.y)):qt.B(z.x,b.x)&&qt.B(b.x,tt.x)?(qt.B(z.x,y.i(E-2).x)&&!qt.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),qt.B(tt.x,y.i(E+2).x)&&!qt.B(tt.y,y.i(E+2).y)?y.m(E+1,a.x,tt.y):y.L(E+1,a.x,tt.y)):qt.B(z.y,b.y)&&qt.B(b.y,tt.y)&&(qt.B(z.y,y.i(E-2).y)&&!qt.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),qt.B(tt.y,y.i(E+2).y)&&!qt.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(ji,Bt.alloc()),E=y.getLinkPointFromPoint(E,b,z,a,!0,Bt.alloc()),y.L(0,E.x,E.y),Bt.free(z),Bt.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(ji,Bt.alloc()),a=y.getLinkPointFromPoint(E,b,x,a,!1,Bt.alloc()),y.L(y.pointsCount-1,a.x,a.y),Bt.free(x),Bt.free(a));y.zf()},or.prototype.computeReshape=function(a){var y=this.adornedLink,x=this.handle.segmentIndex;switch(this.Ru(this.handle)){case Yc:return a;case Ru:return new Bt(y.i(x).x,a.y);case Iu:return new Bt(a.x,y.i(x).y);default:case og:return y.i(x)}},oe.Object.defineProperties(or.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 Ii))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}}}),or.prototype.setReshapingBehavior=or.prototype.om,or.prototype.getReshapingBehavior=or.prototype.Ru;var og=new Se(or,"None",0),Iu=new Se(or,"Horizontal",1),Ru=new Se(or,"Vertical",2),Yc=new Se(or,"All",3);or.className="LinkReshapingTool",or.None=og,or.Horizontal=Iu,or.Vertical=Ru,or.All=Yc,si("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.gb("LinkReshaping",a,this.mouseDownTools)});function ns(){Oi.call(this),this.name="Resizing",this.o=new Qe(1,1).freeze(),this.j=new Qe(9999,9999).freeze(),this.yg=new Qe(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var a=new gi;a.alignmentFocus=ji,a.figure="Rectangle",a.desiredSize=Ho,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.F=a,this.u=null,this.Xq=new Bt,this.Dw=new Qe,this.Tn=new Bt,this.rt=new Qe(0,0),this.qt=new Qe(1/0,1/0),this.pt=new Qe(1,1)}he(ns,Oi),ns.prototype.updateAdornments=function(a){if(!(a===null||a instanceof Ve)){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(),zh(a)&&this.updateResizeHandles(x,y),a.bh(this.name,x);return}}a.Jf(this.name)}},ns.prototype.makeAdornment=function(a){var y=a.part.resizeAdornmentTemplate;if(y===null){y=new Ii,y.type=ze.Spot,y.locationSpot=ji;var x=new Ms;x.isPanelMain=!0,y.add(x),y.add(this.makeHandle(a,io)),y.add(this.makeHandle(a,fa)),y.add(this.makeHandle(a,Os)),y.add(this.makeHandle(a,Ds)),y.add(this.makeHandle(a,Is)),y.add(this.makeHandle(a,Ur)),y.add(this.makeHandle(a,es)),y.add(this.makeHandle(a,Rs))}else if(Za(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},ns.prototype.makeHandle=function(a,y){return a=this.handleArchetype,a===null?null:(a=a.copy(),a.alignment=y,a)},ns.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=ji),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 ze)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,y)}},ns.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},ns.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))},ns.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=a.isMouseCaptured=!1},ns.prototype.stopTransaction=function(){var a=this.diagram,y=Oi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},ns.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},ns.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,Bt.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),a.bd(),Bt.free(b)}},ns.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,Bt.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),Bt.free(b),a.Ya(),this.transactionResult=this.name,a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},ns.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 ri){var E=new ke;if(E.add(a),!this.dragsMembers&&a.placeholder===null){var b=new st;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()}},ns.prototype.computeResize=function(a,y,x,E,b,z){y.Mc()&&(y=ji);var tt=this.adornedObject.naturalBounds,ot=tt.x,rt=tt.y,at=tt.x+tt.width,ut=tt.y+tt.height,ft=1;if(!z){ft=tt.width;var mt=tt.height;0>=ft&&(ft=1),0>=mt&&(mt=1),ft=mt/ft}return mt=Bt.alloc(),qt.No(a.x,a.y,ot,rt,b.width,b.height,mt),a=tt.copy(),0>=y.x?0>=y.y?(a.x=Math.max(mt.x,at-E.width),a.x=Math.min(a.x,at-x.width),a.width=Math.max(at-a.x,x.width),a.y=Math.max(mt.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=at-a.width,a.y=ut-a.height)):1<=y.y?(a.x=Math.max(mt.x,at-E.width),a.x=Math.min(a.x,at-x.width),a.width=Math.max(at-a.x,x.width),a.height=Math.max(Math.min(mt.y-rt,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=at-a.width)):(a.x=Math.max(mt.x,at-E.width),a.x=Math.min(a.x,at-x.width),a.width=at-a.x,z||(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft,a.y=rt+.5*(ut-rt-a.height))):1<=y.x?0>=y.y?(a.width=Math.max(Math.min(mt.x-ot,E.width),x.width),a.y=Math.max(mt.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(mt.x-ot,E.width),x.width),a.height=Math.max(Math.min(mt.y-rt,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(mt.x-ot,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=rt+.5*(ut-rt-a.height))):0>=y.y?(a.y=Math.max(mt.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=ot+.5*(at-ot-a.width))):1<=y.y&&(a.height=Math.max(Math.min(mt.y-rt,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=ot+.5*(at-ot-a.width))),Bt.free(mt),a},ns.prototype.computeReshape=function(){var a=Oe;return this.adornedObject instanceof gi&&(a=Lv(this.adornedObject)),!(a===wn||this.diagram.lastInput.shift)},ns.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},ns.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},ns.prototype.computeCellSize=function(){var a=new Qe(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},oe.Object.defineProperties(ns.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 Ii))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 Ii)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}}}),ns.className="ResizingTool",si("resizingTool",function(){return this.findTool("Resizing")},function(a){this.gb("Resizing",a,this.mouseDownTools)});function ws(){Oi.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new Bt,this.ue=null;var a=new gi;a.figure="Ellipse",a.desiredSize=_o,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.o=a,this.j=null,this.Cw=0,this.kr=new Bt(NaN,NaN),this.u=0,this.F=50}he(ws,Oi),ws.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)}},ws.prototype.makeAdornment=function(a){var y=a.part.rotateAdornmentTemplate;if(y===null){y=new Ii,y.type=ze.Position,y.locationSpot=ji;var x=this.handleArchetype;x!==null&&y.add(x.copy())}else if(Za(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},ws.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},ws.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)},ws.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(ji)},ws.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)},ws.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new Bt(NaN,NaN),this.isActive=a.isMouseCaptured=!1},ws.prototype.stopTransaction=function(){var a=this.diagram,y=Oi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},ws.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},ws.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))},ws.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()},ws.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()}},ws.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},oe.Object.defineProperties(ws.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 Ii))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 Ii)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}}}),ws.className="RotatingTool",si("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function Lh(){Oi.call(this),this.name="ClickSelecting"}he(Lh,Oi),Lh.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},Lh.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},Lh.className="ClickSelectingTool";function Ha(){Oi.call(this),this.name="Action",this.pk=null}he(Ha,Oi),Ha.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},Ha.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()},Ha.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))}},Ha.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()},Ha.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())},Ha.prototype.doStop=function(){this.pk=null},Ha.className="ActionTool";function ju(){Oi.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new Bt(0,0)}he(ju,Oi),ju.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)},ju.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint),this.stopTool()},ju.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 On)x.Zc()&&(Za(x),E=x.copy(),E!==null&&y.add(E));else if(x!==null){var b=y.model.copyNodeData(x);Qt(b)&&(y.model.xf(b),E=y.Lc(b))}if(E!==null){var z=Bt.allocAt(a.x,a.y);this.isGridSnapEnabled&&rf(this.diagram,E,a,z),E.location=z,y.allowSelect&&(y.clearSelection(!0),E.isSelected=!0),Bt.free(z)}y.Ya(),this.transactionResult=this.name,y.R("PartCreated",E)}finally{this.stopTransaction(),y.R("ChangedSelection",y.selection)}return E},oe.Object.defineProperties(ju.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}}}),ju.className="ClickCreatingTool";function ka(){Oi.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var a=new On;a.layerName="Tool",a.selectable=!1;var y=new gi;y.name="SHAPE",y.figure="Rectangle",y.fill=null,y.stroke="magenta",a.add(y),this.j=a}he(ka,Oi),ka.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))},ka.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0,a.isMouseCaptured=!0,a.skipsUndoManager=!0,a.add(this.box),this.doMouseMove()},ka.prototype.doDeactivate=function(){var a=this.diagram;a.ug(),a.remove(this.box),a.skipsUndoManager=!1,this.isActive=a.isMouseCaptured=!1},ka.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=Qe.alloc().h(y.width,y.height);x.desiredSize=E,this.box.mm(y.x,y.y,!1),Qe.free(E),(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},ka.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()},ka.prototype.computeBoxBounds=function(){var a=this.diagram;return new Ce(a.firstInput.documentPoint,a.lastInput.documentPoint)},ka.prototype.selectInRect=function(a){var y=this.diagram,x=y.lastInput;if(a=y.ux(a,this.isPartialInclusion),qn?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 ke,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)}},oe.Object.defineProperties(ka.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}}}),ka.className="DragSelectingTool";function Kr(){Oi.call(this),this.name="Panning",this.Xt=new Bt,this.xy=new Bt,this.xg=!1;var a=this;this.Kw=function(){var y=a.diagram;y!==null&&y.removeEventListener(Ke.document,"scroll",a.Kw,!1),a.stopTool()}}he(Kr,Oi),Kr.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())},Kr.prototype.doActivate=function(){var a=this.diagram;this.xg?(a.lastInput.bubbles=!0,a.addEventListener(Ke.document,"scroll",this.Kw,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Xt.assign(a.position)),this.isActive=!0},Kr.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="",this.isActive=a.isMouseCaptured=!1},Kr.prototype.doCancel=function(){var a=this.diagram;a.position=this.Xt,a.isMouseCaptured=!1,this.stopTool()},Kr.prototype.doMouseMove=function(){this.move()},Kr.prototype.doMouseUp=function(){this.move(),this.stopTool()},Kr.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)}},oe.Object.defineProperties(Kr.prototype,{bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},originalPosition:{get:function(){return this.Xt}}}),Kr.className="PanningTool",si("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.gb("ClickCreating",a,this.mouseUpTools)}),si("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.gb("ClickSelecting",a,this.mouseUpTools)}),si("panningTool",function(){return this.findTool("Panning")},function(a){this.gb("Panning",a,this.mouseMoveTools)}),si("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.gb("DragSelecting",a,this.mouseMoveTools)}),si("actionTool",function(){return this.findTool("Action")},function(a){this.gb("Action",a,this.mouseDownTools)});function Nl(){this.F=this.u=this.j=this.o=null}oe.Object.defineProperties(Nl.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}}}),Nl.className="HTMLInfo";function Wa(a,y,x){this.text=a,this.hx=y,this.visible=x}Wa.className="ContextMenuButtonInfo";function Ps(){Oi.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new Bt,this.jt=null,this.Et=!1;var a=this;this.tu=function(){a.stopTool()}}he(Ps,Oi);function el(a){var y=new Nl;y.show=function(b,z,tt){tt.showDefaultContextMenu()},y.hide=function(b,z){z.hideDefaultContextMenu()},kh=y,a.tu=function(){a.stopTool()},y=Sn("div");var x=Sn("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=Sn("style");Ke.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",rr,!1),E.addEventListener(y,"selectstart",rr,!1),E.addEventListener(x,"contextmenu",rr,!1)),y.className="goCXforeground",x.className="goCXbackground",Ke.document.body&&(Ke.document.body.appendChild(y),Ke.document.body.appendChild(x)),Qd=y,cd=x,Jd=!0}function rr(a){return a.preventDefault(),!1}Ps.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)},Ps.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},Ps.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},Ps.prototype.findObjectWithContextMenu=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.lastInput,E=null;if(a instanceof ue||(a instanceof Jt?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},Ps.prototype.doActivate=function(){},Ps.prototype.doMouseDown=function(){if(Oi.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof Ii){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doMouseDown(),a.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&gl(this)},Ps.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof Ii){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doCancel(),a.doDeactivate())}gl(this)};function gl(a){var y=a.diagram;if(a.isActive){var x=a.currentContextMenu;if(x!==null){var E=null;x instanceof Nl||(E=y.ic(y.lastInput.documentPoint,null,null),E!==null&&E.rg(x)&&a.standardMouseClick(null,null)),a.maybeStopTool(E)}}else a.canStart()&&(du(a,!0),a.isActive||a.stopTool())}Ps.prototype.maybeStopTool=function(){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this,this.doMouseUp())};function du(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=kh,x===null&&(x=a.findObjectWithContextMenu()),x!==null){var E=x.contextMenu;E!==null?(a.currentObject=x instanceof Jt?x:null,a.showContextMenu(E,a.currentObject)):y!==null&&a.showContextMenu(y,a.currentObject)}else y!==null&&a.showContextMenu(y,null);a.currentContextMenu instanceof Ii&&!a.currentContextMenu.visible&&a.stopTool()}}Ps.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},Ps.prototype.showContextMenu=function(a,y){var x=this.diagram;if(a!==this.currentContextMenu&&this.hideContextMenu(),a instanceof Ii){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 Nl&&a.show(y,x,this);this.currentContextMenu=a},Ps.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}},Ps.prototype.hideContextMenu=function(){var a=this.diagram,y=this.currentContextMenu;y!==null&&(y instanceof Ii?(a.remove(y),this.ht!==null&&this.ht.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Nl&&(y.hide!==null?y.hide(a,this):y.mainElement!==null&&(y.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};function _u(a){var y=new ke;return y.add(new Wa("Copy",function(x){x.commandHandler.copySelection()},function(x){return x.commandHandler.canCopySelection()})),y.add(new Wa("Cut",function(x){x.commandHandler.cutSelection()},function(x){return x.commandHandler.canCutSelection()})),y.add(new Wa("Delete",function(x){x.commandHandler.deleteSelection()},function(x){return x.commandHandler.canDeleteSelection()})),y.add(new Wa("Paste",function(x){x.commandHandler.pasteSelection(a.mouseDownPoint)},function(x){return x.commandHandler.canPasteSelection(a.mouseDownPoint)})),y.add(new Wa("Select All",function(x){x.commandHandler.selectAll()},function(x){return x.commandHandler.canSelectAll()})),y.add(new Wa("Undo",function(x){x.commandHandler.undo()},function(x){return x.commandHandler.canUndo()})),y.add(new Wa("Redo",function(x){x.commandHandler.redo()},function(x){return x.commandHandler.canRedo()})),y.add(new Wa("Scroll To Part",function(x){x.commandHandler.scrollToPart()},function(x){return x.commandHandler.canScrollToPart()})),y.add(new Wa("Zoom To Fit",function(x){x.commandHandler.zoomToFit()},function(x){return x.commandHandler.canZoomToFit()})),y.add(new Wa("Reset Zoom",function(x){x.commandHandler.resetZoom()},function(x){return x.commandHandler.canResetZoom()})),y.add(new Wa("Group Selection",function(x){x.commandHandler.groupSelection()},function(x){return x.commandHandler.canGroupSelection()})),y.add(new Wa("Ungroup Selection",function(x){x.commandHandler.ungroupSelection()},function(x){return x.commandHandler.canUngroupSelection()})),y.add(new Wa("Edit Text",function(x){x.commandHandler.editTextBlock()},function(x){return x.commandHandler.canEditTextBlock()})),y}Ps.prototype.showDefaultContextMenu=function(){var a=this.diagram;this.jt===null&&(this.jt=_u(this)),Qd.innerHTML="",cd.addEventListener("pointerdown",this.tu,!1);var y=this,x=Sn("ul");x.className="goCXul",Qd.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=Sn("li"),z.className="goCXli";var tt=Sn("a");tt.className="goCXa",tt.href="#",tt.ky=b.hx,tt.addEventListener("pointerdown",function(ot){return this.ky(a),y.stopTool(),ot.preventDefault(),!1},!1),tt.textContent=b.text,z.appendChild(tt),x.appendChild(z)}}Qd.style.display="block",cd.style.display="block"},Ps.prototype.hideDefaultContextMenu=function(){if(this.currentContextMenu!==null&&this.currentContextMenu===kh){Qd.style.display="none",cd.style.display="none";var a=this.diagram;a!==null&&a.removeEventListener(cd,"pointerdown",this.tu,!1),this.currentContextMenu=null}},oe.Object.defineProperties(Ps.prototype,{currentContextMenu:{get:function(){return this.j},set:function(a){this.j=a,this.ht=a instanceof Ii?a.adornedPart:null}},defaultTouchContextMenu:{get:function(){return Jd===!1&&kh===null&&Uo&&el(this),kh},set:function(a){a===null&&(Jd=!0),kh=a}},currentObject:{get:function(){return this.o},set:function(a){this.o=a}},mouseDownPoint:{get:function(){return this.yw}}});var kh=null,Jd=!1,cd=null,Qd=null;Ps.className="ContextMenuTool",si("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.gb("ContextMenu",a,this.mouseUpTools)});function xo(){Oi.call(this),this.name="TextEditing",this.Zh=new uo,this.ia=null,this.V=fd,this.vj=null,this.qa=gd,this.u=1,this.F=!0,this.o=null,this.j=new Nl,this.kt=null,qd(this,this.j)}he(xo,Oi);function qd(a,y){if(Uo){var x=Sn("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($d)):b==="Tab"?(a.acceptText(Kc),E.preventDefault()):b==="Escape"&&(a.doCancel(),a.diagram!==null&&a.diagram.doFocus())}},!1),x.addEventListener("focus",function(){if(a.currentTextEditor!==null&&a.state!==gd){var E=a.kt;a.qa===tc&&(a.qa=ec),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),x.addEventListener("blur",function(){if(a.currentTextEditor!==null&&a.state!==gd){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 uo&&z instanceof xo)if(z.state===nc)x.style.border="3px solid red",x.focus();else{var tt=E.ga(ji),ot=b.position,rt=b.scale,at=E.Df()*rt;at<z.minimumEditorScale&&(at=z.minimumEditorScale);var ut=E.naturalBounds.width*at+6,ft=E.naturalBounds.height*at+2,mt=(tt.x-ot.x)*rt;tt=(tt.y-ot.y)*rt,ot=E.verticalAlignment,rt=(E.lineHeight+E.spacingAbove+E.spacingBelow)*E.lineCount*at,ft=ot.y*ft-ot.y*rt+ot.offsetY-(.5*ft-.5*rt)-rt/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*at+"%",x.style.lineHeight="normal",x.style.width=ut+"px",x.style.left=(mt-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=at,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)}}}xo.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||a.isReadOnly||zu&&zu!==this&&(zu.acceptText(Tl),zu&&zu!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var y=a.ic(a.lastInput.documentPoint);return y!==null&&y instanceof uo&&y.editable&&y.part.canEdit()?(y=y.part,!(y===null||this.starting===fd&&!y.isSelected||this.starting===Xc&&2>a.lastInput.clickCount)):!1},xo.prototype.doStart=function(){zu=this,this.textBlock!==null&&this.doActivate()},xo.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 uo&&(this.textBlock=y,y.part!==null)){a.animationManager.Cc(),this.isActive=!0,this.qa=tc;var x=this.defaultTextEditor;y.textEditor!==null&&(x=y.textEditor),this.Zh=this.textBlock.copy();var E=new Ce(this.textBlock.ga(io),this.textBlock.ga(Os));a.tv(E),x.show(y,a,this),this.currentTextEditor=x}}}},xo.prototype.doCancel=function(){this.stopTool()},xo.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},xo.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Tl)},xo.prototype.acceptText=function(a){switch(a){case Tl:this.qa===pd?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.qa===tc||this.qa===nc||this.qa===ec)&&(this.qa=sg,rg(this));break;case Zc:case $d:case Kc:($d!==a||this.textBlock.isMultiline!==!0)&&(this.qa===tc||this.qa===nc||this.qa===ec)&&(this.qa=sg,rg(this))}};function rg(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=pd,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=nc,a.doError(b,z))}}xo.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)},xo.prototype.doSuccess=function(a,y){var x=this.textBlock;x.textEdited!==null&&x.textEdited(x,a,y)},xo.prototype.doDeactivate=function(){var a=this.diagram;a!==null&&(this.qa=gd,this.currentTextEditor!==null&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)},xo.prototype.doStop=function(){zu=null},xo.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)))},xo.prototype.Lx=function(a){var y=this.Zh;return y.text=a,y.measure(this.textBlock.Ih,1/0),y},oe.Object.defineProperties(xo.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)}}}),xo.prototype.measureTemporaryTextBlock=xo.prototype.Lx;var Zc=new Se(xo,"LostFocus",0),Tl=new Se(xo,"MouseDown",1),Kc=new Se(xo,"Tab",2),$d=new Se(xo,"Enter",3),$0=new Se(xo,"SingleClick",0),fd=new Se(xo,"SingleClickSelected",1),Xc=new Se(xo,"DoubleClick",2),gd=new Se(xo,"StateNone",0),tc=new Se(xo,"StateActive",1),ec=new Se(xo,"StateEditing",2),sg=new Se(xo,"StateValidating",3),nc=new Se(xo,"StateInvalid",4),pd=new Se(xo,"StateValidated",5),zu=null;xo.className="TextEditingTool",xo.LostFocus=Zc,xo.MouseDown=Tl,xo.Tab=Kc,xo.Enter=$d,xo.SingleClick=$0,xo.SingleClickSelected=fd,xo.DoubleClick=Xc,xo.StateNone=gd,xo.StateActive=tc,xo.StateEditing=ec,xo.StateValidating=sg,xo.StateInvalid=nc,xo.StateValidated=pd,si("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)});function oa(a){oc||(ag(),oc=!0),this.H=Ul,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=fu,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new Me,this.ce=new Xr,this.ce.Yd=this,this.Ei=new Me,this.pu=new Me,this.Sr=new Me,this.pr=new Me,a&&Object.assign(this,a)}oa.prototype.Xe=function(a){this.H=a},oa.prototype.canStart=function(){return!0};function Vl(a,y){a.Jd&&a.canStart(y)&&(a.Zd.add(y),a.defaultAnimation.isAnimating&&a.Cc(),Jr(a.H),a.zb=!0)}function Jc(a){if(a.Jd&&a.zb){var y=a.ce,x=a.H,E=a.Zd.contains("Model");E&&(a.Ok=!0,a.Pk===fu?(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===lg&&y.vc.clear(),a.Qw=!!(a.Pk===rc&&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(),sc(y,x),a.Ok=!1,x.N()):(a.Zd.clear(),x.kg=!1,E=y.vc.get(x),x.autoScale!==ds&&E!==null&&(delete E.start.scale,delete E.end.scale),Ke.requestAnimationFrame(function(){a.zb===!1||y.bc||(x.Gf("temporaryPixelRatio")&&_s(x),fg(x),a.zb=!1,y.start(),y.bc&&(Gu(a),x.Ya(),ug(y,0),Ea(x,!0),Mh(a),x.R("AnimationStarting",a)))}))}}function cu(a){return a.Zd.contains("Trigger")&&a.Zd.count===1}function Qc(a,y,x,E){a.isTicking||cu(a)||y instanceof Ve&&(y.fromNode!==null||y.toNode!==null)||a.ce.add(y,"position",x,E,!1)}Ct=oa.prototype,Ct.fv=function(a){return this.ce.fv(a)},Ct.Xu=function(a){return this.ce.Xu(a)};function qc(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 ot=!0;else{for(ot=tt.vc.iterator;ot.next();){var rt=ot.key;if(rt instanceof Jt&&rt.diagram!==null||rt instanceof ue){ot=!0;break t}}ot=!1}ot?ac(tt,!1):tt.Xk=!0}}b.pu.clear(),b.bc!==!1&&(Gu(b),Ea(b.H),Mh(b)),Ke.requestAnimationFrame(x)}}var E=a.Ei,b=a;a.bc?a.Sr.add(y):(a.bc=!0,E.add(y),Ke.requestAnimationFrame(function(){x()}))}function zp(a){for(a=a.Ei.iterator;a.next();)a.value.Xk=!1}function Gu(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 Mh(a){var y=a.H;y.skipsUndoManager=a.Ow,y.skipsModelSourceBindings=a.cw,a.vq=!1}Ct.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(),sc(y,null),a===!0)for(a=this.Ei.Fa(),y=0;y<a.length;y++)a[y].Ml(!0)}else y.vc.clear(),sc(y,this.H)},Ct.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))},Ct.Cj=function(a,y){this.zb&&(this.Zd.contains("Expand Tree")||this.Zd.contains("Expand SubGraph"))&&(this.ce.Cj(a,y),Zs(this,a))},Ct.Aj=function(a,y){this.zb&&(this.Zd.contains("Collapse Tree")||this.Zd.contains("Collapse SubGraph"))&&(this.ce.Aj(a,y),Hu(this.ce,y,"position",y.position,y.position),Zs(this,a))};function Gp(a,y,x){!a.zb||y.D(x)||cu(a)||(a.H.pi||(y=x.copy()),Hu(a.ce,a.H,"position",y,x))}function $c(a,y,x){y.fd&&(y.Tg=x,a.pr.add(y))}function Zs(a,y){for(y=y.findLinksConnected();y.next();){var x=y.value;x.fd&&(x.Tg=x.points.copy(),a.pr.add(x))}}function Eh(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],ot=a[2];a=a[3];var rt=y[0],at=y[1],ut=y[2];return y=y[3],ot===0||ot===100?(z=rt,tt=at):(ut===0||ut===100)&&(rt=z,at=tt),180<Math.abs(rt-z)&&(rt>z?z+=360:rt+=360),z=b(x,z,rt-z,E)%360,tt=b(x,tt,at-tt,E),ot=b(x,ot,ut-ot,E),x=b(x,a,y-a,E),"hsla("+z+", "+tt+"%, "+ot+"%, "+x+")"}function ag(){function a(x,E,b,z,tt,ot){x.position=new Bt(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot))}var y=new kn;y.add("position:diagram",a),y.add("position",a),y.add("position:part",function(x,E,b,z,tt,ot){tt<ot?x.mm(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot),!1):x.position=new Bt(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot))}),y.add("location",function(x,E,b,z,tt,ot){tt<ot?x.mm(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot),!0):x.location=new Bt(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot))}),y.add("position:placeholder",function(x,E,b,z,tt,ot){tt<ot?x.mm(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot),!1):x.position=new Bt(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot))}),y.add("position:nodeCollapse",function(x,E,b,z,tt,ot){var rt=x.actualBounds,at=b.actualBounds;b=at.x+at.width/2-rt.width/2,rt=at.y+at.height/2-rt.height/2,tt<ot?x.mm(z(tt,E.x,b-E.x,ot),z(tt,E.y,rt-E.y,ot),!1):x.position=new Bt(z(tt,E.x,b-E.x,ot),z(tt,E.y,rt-E.y,ot))}),y.add("desiredSize",function(x,E,b,z,tt,ot){x.desiredSize=new Ce(z(tt,E.width,b.width-E.width,ot),z(tt,E.height,b.height-E.height,ot))}),y.add("width",function(x,E,b,z,tt,ot){x.width=z(tt,E,b-E,ot)}),y.add("height",function(x,E,b,z,tt,ot){x.height=z(tt,E,b-E,ot)}),y.add("fill",function(x,E,b,z,tt,ot){x.fill=Eh(E,b,tt,ot,z)}),y.add("stroke",function(x,E,b,z,tt,ot){x.stroke=Eh(E,b,tt,ot,z)}),y.add("strokeWidth",function(x,E,b,z,tt,ot){x.strokeWidth=z(tt,E,b-E,ot)}),y.add("strokeDashOffset",function(x,E,b,z,tt,ot){x.strokeDashOffset=z(tt,E,b-E,ot)}),y.add("background",function(x,E,b,z,tt,ot){x.background=Eh(E,b,tt,ot,z)}),y.add("areaBackground",function(x,E,b,z,tt,ot){x.areaBackground=Eh(E,b,tt,ot,z)}),y.add("opacity",function(x,E,b,z,tt,ot){x.opacity=z(tt,E,b-E,ot)}),y.add("scale",function(x,E,b,z,tt,ot){x.scale=z(tt,E,b-E,ot)}),y.add("angle",function(x,E,b,z,tt,ot){x.angle=z(tt,E,b-E,ot)}),ic=y}oe.Object.defineProperties(oa.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&&an(a,">= 1",oa,"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}}}),oa.prototype.stopAnimation=oa.prototype.Cc;var ic=null,oc=!1,fu=new Se(oa,"Default",1),rc=new Se(oa,"AnimateLocations",2),lg=new Se(oa,"None",3);oa.className="AnimationManager",oa.defineAnimationEffect=function(a,y){oc||(ag(),oc=!0),ic.add(a,y)},oa.Default=fu,oa.AnimateLocations=rc,oa.None=lg;function Xr(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=md,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=vo,this.vc=new kn,this.Tt=new kn,this.yl=new Me,this.Ut=new Me,this.dw=Uu,a&&Object.assign(this,a)}Xr.prototype.suspend=function(){this.Xk=!0},Xr.prototype.advanceTo=function(a,y){y&&(this.Xk=!1),this.ho&&a>=this.Gd&&(this.Wk=!0,a-=this.Gd),this.gw=a,ac(this,!0),Gu(this.Yd),Ea(this.H),Mh(this.Yd),this.H.redraw()};function sc(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}Ct=Xr.prototype,Ct.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 ue?a=x:x instanceof Jt&&(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===fu&&this===y.defaultAnimation&&(this.Lp=Hp,this.Gd=isNaN(this.Dg)?y.duration===600?900:y.duration:this.Dg),this.dw=a.scrollMode,this.isViewportUnconstrained&&(a.sj=gc),Gu(y),this.yl.each(function(E){E.data=null,a.add(E)}),Mh(y),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,qc(y,this),this)},Ct.Iy=function(a,y){return a.Zc()?(this.yl.add(a),this.H=y,this):this},Ct.add=function(a,y,x,E,b){if(y==="position"&&x.Xa(E))return this;if(this.H===null&&(a instanceof ue?this.H=a:a instanceof Jt&&a.diagram!==null&&(this.H=a.diagram)),a instanceof On){if(!a.isAnimated)return this;y==="position"&&(y="position:part")}return Hu(this,a,y,x,E,b),this};function Hu(a,y,x,E,b,z){var tt=a.vc;if(y instanceof ue&&x==="position"&&(x="position:diagram"),(x==="fill"||x==="stroke"||x==="background"||x==="areaBackground")&&(vu(E),sv(),E=[xa.j,xa.u,xa.o,xa.F],vu(b),sv(),b=[xa.j,xa.u,xa.o,xa.F]),tt.contains(y)){var ot=tt.I(y),rt=ot.start,at=ot.end;rt[x]===void 0&&(rt[x]=bh(E)),at[x]=bh(b)}else rt={},at={},rt[x]=bh(E),at[x]=bh(b),ot=rt.position,y instanceof Jt&&ot instanceof Bt&&!ot.w()&&y.diagram.animationManager.Zd.contains("Expand SubGraph")&&ot.assign(at.position),ot=new Fh(rt,at,z),tt.add(y,ot);tt=rt[x],tt instanceof Bt&&!tt.w()&&tt.assign(a.o),z&&x.indexOf("position:")===0&&y instanceof On?ot.Ku.location=bh(y.location):z&&(ot.Ku[x]=bh(E))}function bh(a){return a instanceof Bt||a instanceof Qe?a.copy():a}Ct.fv=function(a){return this.bc?(a=this.vc.I(a),a!==null&&a.nv):!1},Ct.Xu=function(a){return this.bc?(a=this.vc.I(a),a!==null&&(a.start.position||a.start.location)):!1};function ac(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),Gu(x),ug(a,b),Ea(a.H,!0),Mh(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 ug(a,y){for(var x=a.Gd,E=a.vc.iterator,b=a.Wk;E.next();){var z=E.key;if(!(z instanceof Jt&&z.diagram===null)){var tt=E.value,ot=b?tt.end:tt.start;tt=b?tt.start:tt.end;var rt=ic,at;for(at in tt)at==="position"&&(tt["position:placeholder"]||tt["position:nodeCollapse"])||rt.get(at)===null||rt.get(at)(z,ot[at],tt[at],a.Lp,y,x,a)}}}Ct.stop=function(){return this.bc?(this.Ml(!0),this):this},Ct.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,Gu(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=ic;E.next();){var tt=E.key,ot=E.value,rt=b?ot.end:ot.start,at=b?ot.start:ot.end,ut=ot.Ku,ft;for(ft in at)if(z.get(ft)!==null){var mt=ft;!ot.Hu||mt!=="position:nodeCollapse"&&mt!=="position:placeholder"||(mt="position"),z.get(mt)(tt,rt[ft],ut[ft]!==void 0?ut[ft]:ot.Hu?rt[ft]:at[ft],this.Lp,this.Gd,this.Gd,this)}ot.Hu&&ut.location!==void 0&&tt instanceof On&&(tt.location=ut.location),ot.nv&&tt instanceof On&&tt.Zb(!1)}if(y.As.clear(),lc(y,!1),y.Ya(),y.N(),Ea(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()}Ea(y,!0),this.isViewportUnconstrained&&(y.scrollMode=this.dw),Mh(x),this.au++,!a&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),sc(this,null),x.Ml(this),y.$b())}},Ct.Cj=function(a,y){var x=y.actualBounds,E=null;if(y instanceof ri&&(E=y.placeholder),E!==null?(x=E.ga(io),E=E.padding,x.x+=E.left,x.y+=E.top,this.add(a,"position",x,a.position,!1)):this.add(a,"position",new Bt(x.x+x.width/2,x.y+x.height/2),a.position,!1),this.add(a,"scale",.01,a.scale,!1),a instanceof ri)for(a=a.memberParts;a.next();)E=a.value,E instanceof nn&&this.Cj(E,y)},Ct.Aj=function(a,y){if(a.isVisible()){var x=null;if(y instanceof ri&&(x=y.placeholder),x!==null){var E=x.ga(io);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 ri)for(a=a.memberParts;a.next();)E=a.value,E instanceof nn&&this.Aj(E,y)}},Ct.Ez=function(a){var y=this.Tt.get(a);return y===null&&(y={},this.Tt.add(a,y)),y},oe.Object.defineProperties(Xr.prototype,{duration:{get:function(){return this.Dg},set:function(a){1>a&&an(a,">= 1",Xr,"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:Wt("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}}}),Xr.prototype.getTemporaryState=Xr.prototype.Ez,Xr.prototype.stop=Xr.prototype.stop,Xr.prototype.add=Xr.prototype.add,Xr.prototype.addTemporaryPart=Xr.prototype.Iy;function md(a,y,x,E){return a/=E/2,1>a?x/2*a*a+y:-x/2*(--a*(a-2)-1)+y}function Hp(a,y,x,E){return a===E?y+x:x*(-Math.pow(2,-10*a/E)+1)+y}Xr.className="Animation",Xr.EaseLinear=function(a,y,x,E){return x*a/E+y},Xr.EaseInOutQuad=md,Xr.EaseInQuad=function(a,y,x,E){return x*(a/=E)*a+y},Xr.EaseOutQuad=function(a,y,x,E){return-x*(a/=E)*(a-2)+y},Xr.EaseInExpo=function(a,y,x,E){return a===0?y:x*Math.pow(2,10*(a/E-1))+y},Xr.EaseOutExpo=Hp;function Fh(a,y,x){this.start=a,this.end=y,this.Ku={},this.Hu=x,this.nv=!1}Fh.className="AnimationState";function nl(a,y,x){this.xd=null,this.rf=a,this.so=x||hg,this.uk=null,y!==void 0&&(this.uk=y,x===void 0&&(this.so=Nh))}nl.prototype.copy=function(){var a=new nl(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 Wp(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))}oe.Object.defineProperties(nl.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 hg=new Se(nl,"Default",1),Nh=new Se(nl,"Immediate",2),vd=new Se(nl,"Bundled",3);nl.className="AnimationTrigger",nl.Default=hg,nl.Immediate=Nh,nl.Bundled=vd;function Nr(a){En(this),this.H=null,this.Pa=new ke,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)}Ct=Nr.prototype,Ct.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},Ct.Xe=function(a){this.H=a},Ct.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,ot=this.Pa.iterator;ot.next();){var rt=ot.value;rt instanceof ri?b++:rt instanceof nn?E++:rt instanceof Ve?z++:rt instanceof Ii?tt++:x++}if(ot="",0<x&&(ot+=x+" Parts "),0<E&&(ot+=E+" Nodes "),0<b&&(ot+=b+" Groups "),0<z&&(ot+=z+" Links "),0<tt&&(ot+=tt+" Adornments "),1<a)for(a=this.Pa.iterator;a.next();)x=a.value,ot+=`
`+x.toString(),E=x.data,E!==null&&ti(E)&&(ot+=" #"+ti(E)),x instanceof nn?ot+=" "+zn(E):x instanceof Ve&&(ot+=" "+zn(x.fromNode)+" "+zn(x.toNode));return y+" "+this.Pa.count+": "+ot},Ct.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=Bt.alloc(),z=this.Pa.s,tt=z.length;tt--;){var ot=z[tt];if((E!==!0||zh(ot)!==!1)&&ot.isVisible()&&(b.assign(a),ki(b,ot.oe),ot=ot.ic(b,y,x),ot!==null&&(y!==null&&(ot=y(ot)),ot!==null&&(x===null||x(ot)))))return Bt.free(b),ot}return Bt.free(b),null},Ct.ji=function(a,y,x,E){if(y===void 0&&(y=null),x===void 0&&(x=null),E instanceof ke||E instanceof Me||(E=new Me),this.Uh===!1)return E;var b=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(b=!0);for(var z=Bt.alloc(),tt=this.Pa.s,ot=tt.length;ot--;){var rt=tt[ot];if((b!==!0||zh(rt)!==!1)&&rt.isVisible()){z.assign(a),ki(z,rt.oe);var at=rt;rt.ji(z,y,x,E)&&(y!==null&&(at=y(at)),at===null||x!==null&&!x(at)||E.add(at))}}return Bt.free(z),E},Ct.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 ke||b instanceof Me||(b=new Me),this.Uh===!1)return b;var z=!1;this.diagram!==null&&this.diagram.viewportBounds.Re(a)&&(z=!0);for(var tt=this.Pa.s,ot=tt.length;ot--;){var rt=tt[ot];if((z!==!0||zh(rt)!==!1)&&rt.isVisible()){var at=rt;rt.Cf(a,y,x,E,b)&&(y!==null&&(at=y(at)),at===null||x!==null&&!x(at)||b.add(at))}}return b},Ct.Nu=function(a,y,x,E,b,z,tt){if(this.Uh===!1)return b;for(var ot=this.Pa.s,rt=ot.length;rt--;){var at=ot[rt];if((tt!==!0||zh(at)!==!1)&&z(at)&&at.isVisible()){var ut=at;at.Cf(a,y,x,E,b)&&(y!==null&&(ut=y(ut)),ut===null||x!==null&&!x(ut)||b.add(ut))}}return b},Ct.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 ke||b instanceof Me)&&(z=b),b=!0),z instanceof ke||z instanceof Me||(z=new Me),this.Uh===!1)return z;var tt=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(tt=!0);for(var ot=Bt.alloc(),rt=Bt.alloc(),at=this.Pa.s,ut=at.length;ut--;){var ft=at[ut];if((tt!==!0||zh(ft)!==!1)&&ft.isVisible()){ot.assign(a),ki(ot,ft.oe),rt.h(a.x+y,a.y),ki(rt,ft.oe);var mt=ft;ft.og(ot,rt,x,E,b,z)&&(x!==null&&(mt=x(mt)),mt===null||E!==null&&!E(mt)||z.add(mt))}}return Bt.free(ot),Bt.free(rt),z},Ct.Fd=function(a,y){if(this.visible){var x=this.Pa.s,E=x.length;if(E!==0){a=ln();for(var b=ln(),z=0;z<E;z++){var tt=x[z];if(tt.vw=z,tt instanceof Ve){if(tt.fd===!1)continue}else if(tt instanceof Ii&&tt.adornedPart!==null)continue;var ot=tt.actualBounds;tt.isVisible()&&fl(ot,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]);Be(a),Be(b)}}};function gu(a,y){var x=1;return a.pb!==1&&(x=y.globalAlpha,y.globalAlpha=x*a.pb),x}Ct.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=gu(this,a);var z=this.Zq;z.length=0;for(var tt=y.scale,ot=Ce.alloc(),rt=0;rt<E;rt++)this.Oj(a,x[rt],y,z,tt,ot,!0);if(Ce.free(ot),a.isTemporary)for(y=0;y<E;y++)x[y].Gj();a.globalAlpha=b}}};function Vp(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=gu(a,y),ot=a.Zq;ot.length=0;for(var rt=x.scale,at=Ce.alloc(),ut=0;ut<z;ut++){var ft=b[ut];E.contains(ft)&&a.Oj(y,ft,x,ot,rt,at,!1)}Ce.free(at),y.globalAlpha=tt}}}Ct.Oj=function(a,y,x,E,b,z,tt){if(tt&&!zh(y))a.Hs(y);else{if(E!==null&&y instanceof Ve&&(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 ot=y.actualBounds;if(E=!1,tt&&y.isVisible()){if(!z.Yc(ot)){a.Hs(y);return}E=!z.Re(ot)}E&&(a.save(),a instanceof ra?a.bk=z.copy():(a.beginPath(),a.rect(z.x,z.y,z.width,z.height),a.clip())),ot.width*b>x.Oq||ot.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&&(Xo(y,a,y.areaBackground,!0,!0,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.areaBackground===null&&y.background===null&&(Xo(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),Xo(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))}},Ct.g=function(a,y,x,E,b){var z=this.diagram;z!==null&&z.cb(No,a,this,y,x,E,b)},Ct.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)),tf(this,a,y),a},Ct.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 tf(a,y,x){if(y=Up(a,y,x),x instanceof ri&&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 ot=b[tt];if(ot===x&&(y=tt,0<=E)||0>E&&ot.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&&tf(a,-1,y)}x.svg!==null&&x.svg.remove()}function Up(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 ot=y+1,rt=NaN;ot<b&&(rt=a.M(ot).zOrder,!!isNaN(rt));)ot++;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(rt)&&rt<E)for(;;){if(ot===b||rt>=E){if(ot--,ot===y)break;return a.mb(y),a.Gb(ot,x),ot}for(rt=NaN;++ot<b&&(rt=a.M(ot).zOrder,isNaN(rt)););}return y}oe.Object.defineProperties(Nr.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===""&&Wt("Cannot rename default Layer to: "+a),x=x.layers;x.next();)x.value.name===a&&Wt("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)&&an(a,"0 <= value <= 1",Nr,"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))}}}),Nr.prototype.findObjectsNear=Nr.prototype.og,Nr.prototype.findObjectsIn=Nr.prototype.Cf,Nr.prototype.findObjectsAt=Nr.prototype.ji,Nr.prototype.findObjectAt=Nr.prototype.ic,Nr.className="Layer";function ue(a,y){if(rm||(os(),rm=!0),En(this),Ul=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,Uo){var x=this,E=function(){x.removeEventListener(Ke.document,"DOMContentLoaded",E,!1),x.setRTL()};Ke.document.body!==null?this.setRTL():x.addEventListener(Ke.document,"DOMContentLoaded",E,!1)}this.ol=null,cf.add("Model",qi);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 ot=z.change;z.modelChange===""&&ot===No&&tt.updateDataBindings(z.object,z.propertyName)}finally{tt.diagram.aa=!0}}},this.Oc=function(z){b.partManager.doModelChanged(z)},this.hu=this.ku=null,Yp(this),this.model=hy(),this.Wg=!0,Kp(this),this.layout=new Mo,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 sm,a!==void 0&&(typeof a=="string"||Ke.Element&&a instanceof Element?cg(this,a):y=a),this.vb=!1,y&&this.nm(y),this}var Th,Ul;function Yp(a){a.Yd=new oa,a.Yd.Xe(a),a.Db=17,a.Gw=!1,a.tn=!1,a.bu="default",a.Wa=new ke,a.pj=new kn,a.nl="default",a.Tx(),a.Sx(),a.pb=1,a.pa=new Bt(NaN,NaN).freeze(),a.du=new Bt(NaN,NaN),a.Ca=1,a.Pp=1,a.zt=new Bt(NaN,NaN).freeze(),a.At=NaN,a.Ot=1e-4,a.Mt=100,a.Ab=new ci,a.zu=new Bt(NaN,NaN).freeze(),a.ut=new Ce(NaN,NaN,NaN,NaN).freeze(),a.rj=new yi(0,0,0,0).freeze(),a.sj=Uu,a.nu=!1,a.Zt=null,a.fu=null,a.yh=ds,a.zk=Fr,a.Fg=ds,a.pq=Fr,a.yt=io,a.Bt=io,a.Fc=!0,a.pn=!1,a.De=new Me,a.Eh=new kn,a.Xm=!0,a.vp=250,a.vk=-1,a.xp=new yi(16,16,16,16).freeze(),a.kg=!1,a.Jk=!1,a.fn=!0,a.bq=new us,a.bq.diagram=a,a.Qg=new us,a.Qg.diagram=a,a.cj=new us,a.cj.diagram=a,a.zg=null,a.pf=null,a.qu=!1,ev(a),a.ai=new Me,a.Ht=!0,a.uu=Yu,a.pw=!1,a.wu=fc,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 kn,a.Xn=new ke,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 yi(5).freeze(),a.Hw=new Me().freeze(),a.Nt=999999999,a.nw=new Me().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 Me,a.ow=new Me,a.Xh=null,a.aw=new Qe(8,8),a.bw=999,a.Bw=1,a.Jw=0,a.fc={scale:1,position:new Bt,bounds:new Ce,Py:new Qe,bA:new Qe,Oz:!1},a.fc.canvasSize=a.fc.Py,a.fc.newCanvasSize=a.fc.bA,a.fc.isScroll=!1,a.Rw=new Ce(NaN,NaN,NaN,NaN).freeze(),a.wo=new Qe(NaN,NaN).freeze(),a.Sp=new Ce(NaN,NaN,NaN,NaN).freeze(),a.It=!1,a.Lg=new kn;var y=new nn,x=new uo;x.bind(new sr("text","",zn)),y.add(x),a.ny=y,a.Lg.add("",y),y=new nn,x=new uo,x.stroke="brown",x.bind(new sr("text","",zn)),y.add(x),a.Lg.add("Comment",y),y=new nn,y.selectable=!1,y.avoidable=!1,x=new gi,x.figure="Ellipse",x.fill="black",x.stroke=null,x.desiredSize=new Qe(3,3).ja(),y.add(x),a.Lg.add("LinkLabel",y),a.Yi=new kn,y=new ri,y.selectionObjectName="GROUPPANEL",y.type=ze.Vertical,x=new uo,x.font="bold 12pt sans-serif",x.bind(new sr("text","",zn)),y.add(x),x=new ze(ze.Auto),x.name="GROUPPANEL";var E=new gi;E.figure="Rectangle",E.fill="rgba(128,128,128,0.2)",E.stroke="black",x.add(E),E=new Ms,E.padding=new yi(5,5,5,5).ja(),x.add(E),y.add(x),a.ly=y,a.Yi.add("",y),a.Kh=new kn,y=new Ve,x=new gi,x.isPanelMain=!0,y.add(x),x=new gi,x.toArrow="Standard",x.fill="black",x.stroke=null,x.strokeWidth=0,y.add(x),a.my=y,a.Kh.add("",y),y=new Ve,x=new gi,x.isPanelMain=!0,x.stroke="brown",y.add(x),a.Kh.add("Comment",y),y=new Ii,y.type=ze.Auto,x=new gi,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),x=new Ms,x.margin=new yi(1.5,1.5,1.5,1.5).ja(),y.add(x),a.St=y,a.wt=y,y=new Ii,y.type=ze.Link,x=new gi,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 qi,a.toolManager=new Eo,a.toolManager.initializeStandardTools(),a.defaultTool=a.toolManager,a.currentTool=a.defaultTool,a.nt=null,a.Wm=new st,a.Vt=null,a.Wt=null,a.Mr=!1,a.commandHandler=Zp(),a.eq=null,a.fq=bo,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 Bt,a.zy=500,a.wp=new Bt,a.wq=!1}ue.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),Ld=null,Ih="",dg(this,!1),this.Xn.clear(),kf(),this.Og.clear(),this.Xh=null,this.Ya(),this.Va(),this.N()};function dg(a,y){a.animationManager.Cc(!0),a.Hw=new Me().freeze(),a.nw=new Me().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 ot=a.Wa.s[y].parts;ot.next();){var rt=ot.value;rt!==b&&rt.data===null&&z.push(rt)}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(),kf(),a.Og.clear(),Ri=[],b!==null&&(a.add(b),a.partManager.parts.remove(b)),E&&(a.skipsUndoManager=x),z}function Zp(){return null}ue.prototype.reset=function(){this.clear(),this.vb=!0,Yp(this),Bl(this),this.Wg=!0,Kp(this),this.layout=new Mo,this.Wg=!1,this.model=hy(),this.model.undoManager=new Do,this.vb=this.rn=!1,this.N()},ue.prototype.setRTL=function(a){a=a===void 0?this.div:a,a===null&&(a=Ke.document.body);var y=Sn("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},ue.prototype.setScrollWidth=function(a){a=a===void 0?this.div:a,a===null&&(a=Ke.document.body);var y=0;if(Uo){var x=om;y=Th,x===null&&(x=om=Sn("p"),x.style.width="100%",x.style.height="200px",x.style.boxSizing="content-box",y=Th=Sn("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||qn||(y=11)}this.Db=y,this.Gw=!0},ue.prototype.qb=function(a){a.classType===ue&&(this.autoScale=a)},ue.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 cg(a,y){if(Uo){if(y!=null||Wt("Diagram setup requires an argument DIV."),a.Ka!==null&&Wt("Diagram has already completed setup."),typeof y=="string"?a.Ka=Ke.document.getElementById(y):y instanceof HTMLDivElement?a.Ka=y:Wt("No DIV or DIV id supplied: "+y),a.Ka===null&&Wt("Invalid DIV id; could not get element with id: "+y),a.Ka.H!==void 0&&Wt("Invalid div id; div already has a Diagram associated with it."),!a.ol&&Ke.ResizeObserver){var x=me(function(){a.$b()},250);a.ol=new Ke.ResizeObserver(function(){x()}),a.ol.observe(a.Ka)}Ke.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=Ke.go;var b=new Ya(a);if(b.style!==void 0&&(b.style.position="absolute",b.style.top="0px",b.style.left="0px",Ke.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),xg(a,a.Aa,a.ya),a.Ka.insertBefore(b.Oa,a.Ka.firstChild),b=new Ya(null),b.width=1,b.height=1,a.jw=b,a.oy=b.context,Uo){b=Sn("div");var z=Sn("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=Jp,b.addEventListener("pointerdown",Qp),b.H=a,b.uy=!0,b.vy=!0,a.ku=b,a.hu=z}a.hk=me(function(){a.Yh=null,a.N()},300),a.Ov=me(function(){fg(a)},250),a.preventDefault=function(tt){return tt.preventDefault(),!1},a.$j=function(tt){if(a.isEnabled){var ot=Ma(a,tt,!0);ot.bubbles=!0;var rt=0,at=0;ot.delta=0,tt.deltaX!==void 0?(tt.deltaX!==0&&(rt=0<tt.deltaX?1:-1),tt.deltaY!==0&&(at=0<tt.deltaY?1:-1),ot.delta=Math.abs(tt.deltaX)>Math.abs(tt.deltaY)?-rt:-at):tt.wheelDeltaX!==void 0?(tt.wheelDeltaX!==0&&(rt=0<tt.wheelDeltaX?-1:1),tt.wheelDeltaY!==0&&(at=0<tt.wheelDeltaY?-1:1),ot.delta=Math.abs(tt.wheelDeltaX)>Math.abs(tt.wheelDeltaY)?-rt:-at):tt.wheelDelta!==void 0&&tt.wheelDelta!==0&&(ot.delta=0<tt.wheelDelta?1:-1),a.doMouseWheel(),il(ot,tt)}},a.aA=function(tt){a.isEnabled&&(a.Vk=!1,Ma(a,tt,!0),tt=a.currentTool,tt.cancelWaitAfter(),tt.standardMouseOver())},a.ui=function(tt){if(a.isEnabled){a.Vk=!0;var ot=a.Yt;ot[tt.pointerId]===void 0&&(ot[tt.pointerId]=tt),ot=a.oj;var rt=!1;if(ot[0]===null||ot[0].pointerId!==tt.pointerId&&ot[0].pointerType===tt.pointerType)if(ot[1]!==null&&ot[1].pointerId===tt.pointerId)ot[1]=tt,rt=!0;else if(ot[0]===null)ot[0]=tt;else if(ot[1]===null)ot[1]=tt,rt=!0;else{tt.preventDefault();return}else ot[0]=tt;(ot=tt.pointerType==="touch"||tt.pointerType==="pen")&&(a.qu=!1,a.wq=!0);var at=rt;rt=vg(a,tt,!0,!1,!0,at),Sd(a,tt,rt),rt.targetDiagram=mg(tt,tt.target),rt.targetObject=null,at||rt.clone(a.bq),at=a.uw,ot=ot?25:10,tt.timeStamp-a.tw<a.zy&&!(Math.abs(at.x-tt.screenX)>ot||Math.abs(at.y-tt.screenY)>ot)?a.yq++:a.yq=1,rt.clickCount=a.yq,a.tw=tt.timeStamp,a.uw.sg(tt.screenX,tt.screenY),a.doMouseDown(),tt.button===1?tt.preventDefault():il(rt,tt)}},a.dk=function(tt){if(a.isEnabled){a.Vk=!0;var ot=a.oj;if(ot[0]===null||ot[0].pointerId!==tt.pointerId&&ot[0].pointerType===tt.pointerType){if(ot[1]!==null&&ot[1].pointerId===tt.pointerId){ot[1]=tt;return}if(ot[0]===null)ot[0]=tt;else return}else ot[0]=tt;if(ot[0].pointerId===tt.pointerId){ot=vg(a,tt,!1,!1,!1,ot[1]!==null);var rt=Ke.document.elementFromPoint(tt.clientX,tt.clientY)||null;rt!==null&&rt.shadowRoot!==void 0&&rt.shadowRoot!==null&&(rt=rt.shadowRoot.elementFromPoint(tt.clientX,tt.clientY));var at=a,ut=tt;rt&&rt.H&&(ut=tt,at=rt.H),ot.targetDiagram=at,Sd(a,ut,ot),ot.targetObject=null,a.doMouseMove(),il(ot,tt)}}},a.fk=function(tt){if(a.isEnabled){a.Vk=!0;var ot=tt.pointerType==="touch"||tt.pointerType==="pen",rt=a.Yt;if(ot&&a.qu)delete rt[tt.pointerId],tt.preventDefault();else if(rt=a.oj,rt[0]===null||rt[0].pointerId!==tt.pointerId&&rt[0].pointerType===tt.pointerType)rt[1]!==null&&rt[1].pointerId===tt.pointerId&&(rt[1]=null);else{rt[0]=null,rt=vg(a,tt,!1,!0,!0,!1);var at=Ke.document.elementFromPoint(tt.clientX,tt.clientY)||null;at!==null&&at.shadowRoot!==void 0&&at.shadowRoot!==null&&(at=at.shadowRoot.elementFromPoint(tt.clientX,tt.clientY)),at!==null&&at.H instanceof ue&&at.H!==a&&Sd(at.H,tt,rt),at===null&&(at=tt.target),Sd(a,tt,rt),rt.clickCount=a.yq,rt.targetDiagram=mg(tt,at),rt.targetObject=null,a.doMouseUp(),il(rt,tt),ot&&(a.wq=!1)}}},a.ek=function(tt){if(a.isEnabled){a.Vk=!1;var ot=a.Yt;ot[tt.pointerId]&&delete ot[tt.pointerId],ot=a.oj,ot[0]!==null&&ot[0].pointerId===tt.pointerId&&(ot[0]=null),ot[1]!==null&&ot[1].pointerId===tt.pointerId&&(ot[1]=null),tt.pointerType!=="touch"&&tt.pointerType!=="pen"&&(tt=a.currentTool,tt.cancelWaitAfter(),tt.standardMouseOver())}},a.ck=function(tt){var ot=a.oj;ot[0]!==null&&ot[0].pointerId===tt.pointerId?(ot[0]=null,a.wq=!1):ot[1]!==null&&ot[1].pointerId===tt.pointerId&&(ot[1]=null)},a.Vp=E.Z["d"+mc[1]+mc[2]+"wI"+Md.slice(1,5)]["b"+Ax.slice(1,y)](E.Z,pc,y,y),E.Vc(!0),tv(a),a.nl==="svg"&&(y=a.pj.get("svg"),a.Ka.appendChild(y.Oa),a.ib=y.context)}}ue.prototype.addEventListener=function(a,y,x,E){a.addEventListener(y,x,{capture:E,passive:!1})},ue.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(Ke,"resize",a.Ov,!1)}function _s(a){30<a.Sq&&(a.Yh=1)}function lc(a,y){a.Yh!==null&&(a.Yh=null,y&&a.hk(),Bn&&Bn.nx||(a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0))}ue.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:Ke.devicePixelRatio||1},ue.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},ue.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},ue.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},ue.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},ue.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},ue.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},ue.prototype.doFocus=function(){this.focus()},ue.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var a=Ke.scrollX||Ke.pageXOffset,y=Ke.scrollY||Ke.pageYOffset;this.ta.focus(),Ke.scrollTo(a,y)}},ue.prototype.Oy=function(){this.H.R("GainedFocus")},ue.prototype.Ny=function(){this.H.R("LostFocus")};function fg(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===ds&&(a.Jk=!0,y.C()),a.ld||a.$b())}}}function Kp(a){var y=new Nr;y.name="Background",a.Al(y),y=new Nr,y.name="",a.Al(y),y=new Nr,y.name="Foreground",a.Al(y),y=new Nr,y.name="Adornment",y.isTemporary=!0,y.isInDocumentBounds=!1,a.Al(y),y=new Nr,y.name="Tool",y.isTemporary=!0,y.isInDocumentBounds=!0,a.Al(y),y=new Nr,y.name="Grid",y.allowSelect=!1,y.pickable=!1,y.isTemporary=!0,y.isInDocumentBounds=!1,a.Ww(y,a.Qj("Background"))}function Xp(a){var y=new ze(ze.Grid);y.name="GRID";var x=new gi;return x.figure="LineH",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new gi,x.figure="LineH",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new gi,x.figure="LineH",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new gi,x.figure="LineV",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new gi,x.figure="LineV",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new gi,x.figure="LineV",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new On,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 Jp(){this.H.gu?this.H.gu=!1:this.H.isEnabled?this.H.kx(this):Pd(this.H)}function Qp(a){this.H.isEnabled?(this.H.lu=a.target.scrollTop,this.H.ju=a.target.scrollLeft):Pd(this.H)}ue.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,ot=E.y-z.top,rt=E.width+z.left+z.right,at=E.height+z.top+z.bottom,ut=E.right+z.right;z=E.bottom+z.bottom;var ft=b.x;E=b.y;var mt=b.width,yt=b.height,xt=b.right,Mt=b.bottom;b=this.scale;var It=a.scrollLeft;if(this.tn)switch(this.bu){case"negative":It=It+a.scrollWidth-a.clientWidth;break;case"reverse":It=a.scrollWidth-It-a.clientWidth}var Tt=It;mt<rt||yt<at?(It=Bt.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==Tt&&(It.x=Tt/b+tt,this.ju=Tt),this.allowVerticalScroll&&this.lu!==a.scrollTop&&(It.y=a.scrollTop/b+ot,this.lu=a.scrollTop),this.position=It,Bt.free(It),this.Ee=this.qr=!1):(It=Bt.alloc(),a.uy&&this.allowHorizontalScroll&&(tt<ft&&(this.position=It.h(Tt+tt,this.position.y)),ut>xt&&(this.position=It.h(-(y.scrollWidth-this.Aa)+Tt-this.Aa/b+ut,this.position.y))),a.vy&&this.allowVerticalScroll&&(ot<E&&(this.position=It.h(this.position.x,a.scrollTop+ot)),z>Mt&&(this.position=It.h(this.position.x,-(y.scrollHeight-this.ya)+a.scrollTop-this.ya/b+z))),Bt.free(It),this.vd=!0,this.Ee=this.qr=!1,E=this.documentBounds,b=this.viewportBounds,ut=E.right,xt=b.right,z=E.bottom,Mt=b.bottom,tt=E.x,ft=b.x,ot=E.y,E=b.y,mt>=rt&&tt>=ft&&ut<=xt&&(x.style.width="1px"),yt>=at&&ot>=E&&z<=Mt&&(x.style.height="1px"))}},ue.prototype.computeBounds=function(a){return a===void 0&&(a=new Ce),Jr(this),gg(this,a)};function gg(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 ot=tt.length,rt=0;rt<ot;rt++){var at=tt[rt];at.isInDocumentBounds&&at.isVisible()&&(at=at.actualBounds,at.w()&&(x?(x=!1,y.assign(at)):y.ed(at)))}}}return x&&y.h(0,0,0,0),y.Co(a.yb),y}ue.prototype.computePartsBounds=function(a,y){y===void 0&&(y=!1);var x=null;if(Zt(a))for(var E=0;E<a.length;E++){var b=a[E];!y&&b instanceof Ve||(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 Ve||(E.Va(),x===null?x=E.actualBounds.copy():x.ed(E.actualBounds));return x===null?new Ce(NaN,NaN,0,0):x};function Va(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=Bt.alloc(),x.xi(a.documentBounds,a.initialDocumentSpot);var E=a.viewportBounds;E=Ce.allocAt(0,0,E.width,E.height);var b=Bt.alloc();b.xi(E,a.initialViewportSpot),b.h(x.x-b.x,x.y-b.y),a.position=b,Ce.free(E),Bt.free(b),Bt.free(x)}x=a.yh,y&&a.Fg!==ds&&(x=a.Fg);var z=x!==ds?yd(a,x):a.scale;x=a.pa.x,E=a.pa.y,b=a.Aa/z;var tt=a.ya/z,ot=a.zk,rt=a.pq;y&&!ot.sb()&&(rt.sb()||rt.Xb())&&(ot=rt.Xb()?ji:rt),pg(a,a.documentBounds,b,tt,ot,y),y=a.scale,a.scale=z,a.vb=!1,z=a.viewportBounds,qt.B(z.x,x)&&qt.B(z.y,E)&&qt.B(z.width,b)&&qt.B(z.height,tt)||a.onViewportBoundsChanged(new Ce(x,E,b,tt),z,y,!1)}}function yd(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),ot=z/b,rt=tt/E;return y===va?(y=Math.min(rt,ot),y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):y===Rh?(y=rt>ot?(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}ue.prototype.zoomToFit=function(){var a=this.sj;this.sj=Uu,this.scale=yd(this,va),a!==Uu&&(Va(this,!1),pg(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=a},Ct=ue.prototype,Ct.BA=function(a,y){y===void 0&&(y=va);var x=a.width,E=a.height;if(!(x===0||E===0||isNaN(x)&&isNaN(E))){var b=1;if(y===va||y===Rh)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===Rh?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 Bt(a.x,a.y)}},Ct.Jy=function(a,y){this.Va();var x=this.documentBounds,E=this.viewportBounds;this.position=new Bt(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))},Ct.zz=function(a){if(a instanceof Jt){this.eq=a;var y=Bt.alloc();this.fq=this.op(a.ga(io,y)),Bt.free(y)}else this.eq=null,this.fq=bo};function pg(a,y,x,E,b,z){var tt=Bt.allocAt(a.pa.x,a.pa.y),ot=tt.x,rt=tt.y;if(a.eq!==null){var at=Bt.alloc();at=a.eq.ga(io,at),ot=at.x-a.fq.x/a.scale,rt=at.y-a.fq.y/a.scale,b=Ni,Bt.free(at)}(z||a.scrollMode===Uu)&&(b.sb()&&(x>y.width&&(ot=y.x+(b.x*y.width+b.offsetX)-(b.x*x-b.offsetX)),E>y.height&&(rt=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?(ot=Math.min(ot+x/2,y.right+Math.max(z,b.right)-x/2),ot=Math.max(ot,y.left-Math.max(z,b.left)+x/2),ot-=x/2):ot>y.left?ot=y.left:ot<y.right-x&&(ot=y.right-x),x=E-y.height,E<y.height+b.top+b.bottom?(rt=Math.min(rt+E/2,y.bottom+Math.max(x,b.bottom)-E/2),rt=Math.max(rt,y.top-Math.max(x,b.top)+E/2),rt-=E/2):rt>y.top?rt=y.top:rt<y.bottom-E&&(rt=y.bottom-E)),tt.x=isFinite(ot)?ot:-a.yb.left,tt.y=isFinite(rt)?rt:-a.yb.top,a.positionComputation!==null&&(y=a.positionComputation(a,tt),tt.x=y.x,tt.y=y.y),Gp(a.Yd,a.pa,tt),a.pa.h(tt.x,tt.y),Bl(a),Bt.free(tt)}Ct.Ol=function(a,y){if(y===void 0&&(y=!0),y){if(a=Yl(this,a,function(x){return x.part},function(x){return x.canSelect()}),a instanceof On)return a}else if(a=Yl(this,a,function(x){return x.part}),a instanceof On)return a;return null},Ct.ic=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null),Jr(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 Yl(a,y,x,E){for(x===void 0&&(x=null),E===void 0&&(E=null),Jr(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}Ct.lz=function(a,y,x){return y===void 0&&(y=!0),uc(this,a,function(E){return E.part},y?function(E){return E instanceof On&&E.canSelect()}:null,x)};function uc(a,y,x,E,b){for(x===void 0&&(x=null),E===void 0&&(E=null),b instanceof ke||b instanceof Me||(b=new Me),Jr(a),a=a.Wa.iteratorBackwards;a.next();){var z=a.value;z.visible&&!z.isTemporary&&z.ji(y,x,E,b)}return b}Ct.ji=function(a,y,x,E){y===void 0&&(y=null),x===void 0&&(x=null),E instanceof ke||E instanceof Me||(E=new Me),Jr(this);for(var b=this.Wa.iteratorBackwards;b.next();){var z=b.value;z.visible&&z.ji(a,y,x,E)}return E},Ct.ux=function(a,y,x,E){return y===void 0&&(y=!1),x===void 0&&(x=!0),ef(this,a,function(b){return b instanceof On&&(!x||b.canSelect())},y,E)},Ct.Cf=function(a,y,x,E,b){y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof ke||b instanceof Me||(b=new Me),Jr(this);for(var z=this.Wa.iteratorBackwards;z.next();){var tt=z.value;tt.visible&&tt.Cf(a,y,x,E,b)}return b},Ct.Nu=function(a,y,x,E,b,z){var tt=new Me;Jr(this);for(var ot=this.Wa.iteratorBackwards;ot.next();){var rt=ot.value;rt.visible&&rt.Nu(a,y,x,E,tt,b,z)}return tt};function ef(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 ke||b instanceof Me||(b=new Me),Jr(a),a=a.Wa.iteratorBackwards;a.next();){var tt=a.value;tt.visible&&!tt.isTemporary&&tt.Cf(y,z,x,E,b)}return b}Ct.mz=function(a,y,x,E,b){return x===void 0&&(x=!0),E===void 0&&(E=!0),hc(this,a,y,function(z){return z instanceof On&&(!E||z.canSelect())},x,b)},Ct.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 ke||b instanceof Me)&&(z=b),b=!0),z instanceof ke||z instanceof Me||(z=new Me),Jr(this);for(var tt=this.Wa.iteratorBackwards;tt.next();){var ot=tt.value;ot.visible&&ot.og(a,y,x,E,b,z)}return z};function hc(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 ke||b instanceof Me)&&(z=b),b=!0),z instanceof ke||z instanceof Me||(z=new Me),Jr(a),a=a.Wa.iteratorBackwards;a.next();){var ot=a.value;ot.visible&&!ot.isTemporary&&ot.og(y,x,tt,E,b,z)}return z}ue.prototype.acceptEvent=function(a){return Ma(this,a,a instanceof MouseEvent)};function Ma(a,y,x){var E=a.Qg;return a.Qg=a.cj,a.cj=E,E.diagram=a,E.event=y,x?Sd(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),qn&&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=mg(y,y.target),E.targetObject=null,E}function mg(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 vg(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,qn&&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 il(a,y){return a.bubbles?!0:(y.stopPropagation!==void 0&&y.stopPropagation(),y.cancelable!==!1&&y.preventDefault(),y.cancelBubble=!0,!1)}ue.prototype.Qz=function(a){var y=this.H;if(!this.H.isEnabled)return!1;var x=Ma(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(),il(x,a)},ue.prototype.Rz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Ma(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(),il(x,a)},ue.prototype.bz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Ma(y,a,!0);return y.mouseEnter!==null&&y.mouseEnter(x),y.currentTool.standardMouseOver(),il(x,a)},ue.prototype.cz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Ma(y,a,!0);return y.mouseLeave!==null&&y.mouseLeave(x),il(x,a)},ue.prototype.getMouse=function(a){var y=this.ta;if(y===null)return new Bt(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?ki(new Bt(y,a),this.Ab):new Bt(y,a)};function Sd(a,y,x){var E=a.ta,b=a.Aa,z=a.ya,tt=0,ot=0;E!==null&&(E=E.getBoundingClientRect(),tt=y.clientX-b/E.width*E.left,ot=y.clientY-z/E.height*E.top),x.viewPoint.h(tt,ot),a.Ab!==null?(y=Bt.allocAt(tt,ot),a.Ab.Cd(y),x.documentPoint.assign(y),Bt.free(y)):x.documentPoint.h(tt,ot)}function yg(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))}}ue.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function qp(a){a.ld||Jr(a),a.Va()}ue.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},Ct=ue.prototype,Ct.Pz=function(){return this.kg},Ct.Xy=function(a){a===void 0&&(a=null);var y=this.animationManager,x=y.isEnabled;y.Cc(),y.isEnabled=!1,Ea(this),this.hf=!1,this.du=new Bt(NaN,NaN),y.isEnabled=x,this.ld=!0;var E=this;a!==null&&de(function(){E.ld=!1,Vl(y,"Model"),a(E)},1)},Ct.$b=function(a){if(a===void 0&&(a=!1),this.kg!==!0&&!(this.vb||a===!1&&this.ld)){this.kg=!0;var y=this;Ke.requestAnimationFrame(function(){y.kg&&y.bd()})}},Ct.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),Ea(this))};function Ah(a,y,x){!a.Ee||a.vb||a.animationManager.defaultAnimation.isAnimating||Pd(a)||(y&&Jr(a),x&&Va(a,!1))}function Ea(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 ot=b[tt];fr(ot,!1),ot.v()}E.clear()}E=a.ow,0<E.count&&(E.each(function(rt){rt.Nv()}),E.clear()),b=E=!1,x.defaultAnimation.isAnimating&&(b=!0,E=a.skipsUndoManager,a.skipsUndoManager=!0),x.zb||fg(a),Ah(a,!1,!0),a.fe!==null&&(a.fe.visible&&!a.mq&&(Al(a),a.mq=!0),!a.fe.visible&&a.mq&&(a.mq=!1)),Jr(a),z=!1,(!a.hf||a.xh)&&(a.hf?bg(a,!a.Jk):(a.Ea("Initial Layout"),x.isEnabled===!1&&x.Cc(),bg(a,!1)),z=!0),a.Jk=!1,Jr(a),a.ou||qp(a),Ah(a,!0,!1),tt=!1,z?(x=Ce.alloc(),x.assign(a.viewportBounds),a.hf||(tt=a.hf=!0,a.skipsUndoManager||(a.undoManager.isPendingClear=!0),a.undoManager.isPendingUnmodified=!0,Sg(a)),a.R("LayoutCompleted"),Ah(a,!0,!1),Ce.free(x)):x.Ok&&x.Qw&&(a.Fg!==ds?a.scale=yd(a,a.Fg):a.yh!==ds?a.scale=yd(a,a.yh):(x=a.initialScale,isFinite(x)&&0<x&&(a.scale=x)),Va(a,!0)),z&&tt&&a.eb("Initial Layout"),Jr(a),y||a.gc(a.ib),b&&(a.skipsUndoManager=E),a.ld=!1}}function Sg(a){if(a.Fg!==ds)a.scale=yd(a,a.Fg);else if(a.yh!==ds)a.scale=yd(a,a.yh);else{var y=a.initialScale;isFinite(y)&&0<y&&(a.scale=y)}Va(a,!0),y=a.Wa.s,a.Fd(y,y.length,a,a.viewportBounds),a.R("InitialLayoutCompleted"),a.du.assign(a.pa),Al(a)}function Jr(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 Me,a.Nv(x,a.De)}a.nodes.each(function(E){E instanceof ri&&E.U&65536&&(E.U=E.U^65536)})}}Ct.Nv=function(a,y){for(a.reset();a.next();){var x=a.value;!x.Zc()||x instanceof ri||(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))}for(a.reset();a.next();)x=a.value,x instanceof ri&&x.isVisible()&&dc(this,x);for(a.reset();a.next();)x=a.value,x instanceof Ve&&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 Ii&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))};function dc(a,y){for(var x=ln(),E=ln(),b=y.memberParts;b.next();){var z=b.value;z.isVisible()&&(z instanceof ri?(Sa(z)||Ls(z)||_h(z))&&dc(a,z):z instanceof Ve?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(Be(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();Be(E)}Ct.Fd=function(a,y,x,E){if(this.vd||this.animationManager.isAnimating)for(var b=0;b<y;b++)a[b].Fd(x,E)},Ct.gc=function(a){if(this.Ka!==null){if(this.ta===null&&Wt("No canvas specified"),this.nl==="svg"){if(this.Ka!==null){var y=this.animationManager;if(!y.zb&&(!y.isAnimating||y.isTicking)){wd(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,ot=this.Ab;for(ot.reset(),b!==1&&ot.scale(b),y.x===0&&y.y===0||ot.translate(-z,-tt),a.ti=null,Ky(a,ot.m11,ot.m12,ot.m21,ot.m22,ot.dx,ot.dy),this.pb!==1&&(a.globalAlpha=this.pb),Wu(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?Ed(this.Yf,this)&&(a=this.Vp()):a=!0,a&&(ci.prototype.Cd=ci.prototype.Eu),this.Fc=this.vd=!1}}}}else t:if(z=this.animationManager,!z.zb&&(!z.isAnimating||z.isTicking)&&(x=new Date,wd(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,ot=this.pa;var rt=this.Ca,at=Math.round(ot.x*rt)/rt,ut=Math.round(ot.y*rt)/rt;for(rt!==1&&z.scale(rt),ot.x===0&&ot.y===0||z.translate(-at,-ut),a.setTransform(tt,0,0,tt,0,0),a.clearRect(0,0,this.Aa,this.ya),this.pb!==1&&(a.globalAlpha=this.pb),Wu(this,a),ot=0;ot<b;ot++)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[ot].gc(a,this);if(y=!1,this.Yf?Ed(this.Yf,this)&&(y=this.Vp()):y=!0,y&&(ci.prototype.Cd=ci.prototype.Eu),E?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,y=+new Date-+x,E=Bn&&Bn.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 nf(a,y,x,E,b,z,tt,ot,rt,at){if(a.Ka!==null){a.ta===null&&Wt("No canvas specified"),tt===void 0&&(tt=null),ot===void 0&&(ot=null),rt===void 0&&(rt=!1),at===void 0&&(at=!1),wd(a),a.ib.Vc(!0),a.vd=!0,a.$i=!0;var ut=a.Ca;a.Ca=b;var ft=a.Wa.s,mt=ft.length;try{var yt=new Ce(z.x,z.y,E.width/b,E.height/b),xt=yt.copy();xt.Co(x),Al(a,xt),Jr(a),a.Fd(ft,mt,a,yt),y.setTransform(1,0,0,1,0,0),y.clearRect(0,0,E.width,E.height),ot!==null&&ot!==""&&(y.fillStyle=ot,y.ox(0,0,E.width,E.height));var Mt=a.Mb;y.scale(Mt,Mt);var It=ci.alloc();It.reset(),It.translate(x.left,x.top),It.scale(b),z.x===0&&z.y===0||It.translate(-z.x,-z.y),y.setTransform(It.m11,It.m12,It.m21,It.m22,It.dx,It.dy),y.yc(),y instanceof ra&&Ky(y,It.m11,It.m12,It.m21,It.m22,It.dx,It.dy),ci.free(It),Wu(a,y),y.globalAlpha=a.pb;var Tt=a.Qj("Grid");if(tt){var zt=new Me,Ht=tt.iterator;for(Ht.reset();Ht.next();){var Vt=Ht.value;Vt instanceof On&&(at||Vt.layer!==Tt)&&(Vt.Gj(),zt.add(Vt))}for(at=0;at<mt;at++)Vp(ft[at],y,a,zt,rt);zt.each(function(le){return le.Gj()})}else for(zt=0;zt<mt;zt++){var Xt=ft[zt];Xt===Tt?at&&Xt.gc(y,a,!0):Xt.gc(y,a,rt)}a.$i=!1,a.Yf&&Ed(a.Yf,a)&&a.Vp()}finally{a.Ca=ut,a.ib.Vc(!0),a.vd=!0,a.Fd(ft,mt,a,a.viewportBounds),Al(a),a.ib instanceof ra&&(a.ib.Nj.PA(),a.redraw())}}}Ct.Gf=function(a){return this.Rg[a]},Ct.Xx=function(a,y){a==="minDrawingLength"&&(this.Oq=y),this.Rg[a]=y,this.redraw()},Ct.Tx=function(){this.Rg=new Rn,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(qn||Yi),this.Rg.temporaryPixelRatio=!0,this.Rg.pictureRatioOptimization=!0,this.Oq=this.Rg.minDrawingLength=1};function Wu(a,y){a=a.Rg,a!==null&&(a.imageSmoothingEnabled!==void 0&&y.Wx(!!a.imageSmoothingEnabled),a=a.defaultFont,a!=null&&(y.font=a))}Ct.Ql=function(a){return this.on[a]},Ct.sA=function(a,y){this.on[a]=y},Ct.Sx=function(){this.on=new Rn,this.on.extraTouchArea=10,this.on.extraTouchThreshold=10,this.on.hasGestureZoom=!0},Ct.set=function(a){return Object.assign(this,a),this},Ct.Du=function(a){return this.nm(a)},Ct.nm=function(a){return xd(this,a),this};function xd(a,y){var x=a instanceof ze,E=a instanceof ue,b;for(b in y){b===""&&Wt("Setting properties requires non-empty property names");var z=a,tt=b;if(x||E){var ot=b.indexOf(".");if(0<ot){var rt=b.substring(0,ot);x?z=a.fb(rt):(z=a[rt],z==null&&(z=a.toolManager[rt])),Qt(z)?tt=b.substr(ot+1):Wt("Unable to find object named: "+rt+" in "+a.toString()+" when trying to set property: "+b)}}if(tt[0]!=="_"&&!Vn(z,tt))if(E&&tt==="ModelChanged"){a.Yw(y[tt]);continue}else if(E&&tt==="Changed"){a.Pe(y[tt]);continue}else if(E&&Vn(a.toolManager,tt))z=a.toolManager;else if(E&&em(a,tt)){a.Bj(tt,y[tt]);continue}else if(a instanceof Ln&&tt==="Changed"){a.Pe(y[tt]);continue}else Wt('Trying to set undefined property "'+tt+'" on object: '+z.toString());z[tt]=y[b],tt[0]==="_"&&z instanceof Jt&&z.Vw(tt)}}Ct.bx=function(){if(this.Eh.count!==0&&!(1<this.undoManager.transactionLevel)){for(;0<this.Eh.count;){var a=this.Eh;for(this.Eh=new kn,a=a.iterator;a.next();){var y=a.key;y.Xo(a.value),y.qc()}}this.N()}},Ct.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")},ue.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!==gc&&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=Ce.alloc(),Eg(this,this.computeBounds(E)),Ce.free(E)),E=this.ta,E===null||E instanceof Dl)))){var tt=this.Mb;b=this.Aa*tt;var ot=this.ya*tt,rt=this.scale*tt;z=Math.round(Math.round(y.x*rt)-Math.round(a.x*rt)),y=Math.round(Math.round(y.y*rt)-Math.round(a.y*rt)),rt=this.jw,a=this.oy,rt.width!==b&&(rt.width=b),rt.height!==ot&&(rt.height=ot),a.clearRect(0,0,b,ot),rt=190*tt;var at=70*tt,ut=Math.max(z,0),ft=Math.max(y,0),mt=Math.floor(b-ut),yt=Math.floor(ot-ft);a.drawImage(E.Oa,ut,ft,mt,yt,0,0,mt,yt),Ed(this.Yf,this)&&a.clearRect(0,0,rt,at),E=ln(),a=ln(),yt=Math.abs(z),mt=Math.abs(y);var xt=ut===0?0:b-yt;ut=Bt.allocAt(xt,0),yt=Bt.allocAt(yt+xt,ot),a.push(new Ce(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y)));var Mt=this.Ab;if(Mt.reset(),Mt.scale(tt,tt),this.Ca!==1&&Mt.scale(this.Ca),tt=this.pa,(tt.x!==0||tt.y!==0)&&isFinite(tt.x)&&isFinite(tt.y)&&Mt.translate(-tt.x,-tt.y),ki(ut,Mt),ki(yt,Mt),E.push(new Ce(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),xt=ft===0?0:ot-mt,ut.h(0,xt),yt.h(b,mt+xt),a.push(new Ce(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),ki(ut,Mt),ki(yt,Mt),E.push(new Ce(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),Ed(this.Yf,this)&&(b=0<z?0:-z,ot=0<y?0:-y,ut.h(b,ot),yt.h(rt+b,at+ot),a.push(new Ce(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),ki(ut,Mt),ki(yt,Mt),E.push(new Ce(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y)))),Bt.free(ut),Bt.free(yt),Ah(this,!1,!0),this.Ka===null&&Wt("No div specified"),this.ta===null&&Wt("No canvas specified"),!this.animationManager.zb&&(b=this.ib,this.Fc)){for(wd(this),ot=this.Mb,b.setTransform(1,0,0,1,0,0),b.clearRect(0,0,this.Aa*ot,this.ya*ot),b.drawImage(this.jw.Oa,0<z?0:Math.round(-z),0<y?0:Math.round(-y)),z=this.pa,tt=this.Ca,rt=Math.round(z.x*tt)/tt,at=Math.round(z.y*tt)/tt,y=this.Ab,y.reset(),tt!==1&&y.scale(tt),z.x===0&&z.y===0||y.translate(-rt,-at),b.save(),b.beginPath(),z=a.length,tt=0;tt<z;tt++)rt=a[tt],rt.width!==0&&rt.height!==0&&b.rect(Math.floor(rt.x),Math.floor(rt.y),Math.ceil(rt.width),Math.ceil(rt.height));for(b.clip(),b.setTransform(ot,0,0,ot,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),Wu(this,b),b.globalAlpha=this.pb,ot=0;ot<z;ot++)if(tt=y[ot],rt=E,tt.visible&&tt.pb!==0){at=gu(tt,b),ft=tt.Zq,ft.length=0,ut=this.scale,mt=Ce.alloc(),yt=tt.Pa.s,Mt=yt.length,xt=rt.length;for(var It=0;It<Mt;It++){var Tt=yt[It],zt=Dd(Tt,Tt.actualBounds);t:{for(var Ht=2/ut,Vt=4/ut,Xt=0;Xt<xt;Xt++){var le=rt[Xt];if(le.width!==0&&le.height!==0&&zt.Vu(le.x-Ht,le.y-Ht,le.width+Vt,le.height+Vt)){zt=!0;break t}}zt=!1}zt&&tt.Oj(b,Tt,this,ft,ut,mt,!0)}Ce.free(mt),b.globalAlpha=at}b.restore(),b.Vc(!0),this.Yf&&Ed(this.Yf,this)&&this.Vp(),this.Fc=this.vd=!1,this.hk()}Be(E),Be(a),this.ld=!1}}else this.bd();x&&(_s(this),this.bd(),lc(this,!0))}else x?(_s(this),this.bd(),lc(this,!0)):this.bd()}};function wd(a){a.pn!==!1&&(a.pn=!1,xg(a,a.Aa,a.ya))}function xg(a,y,x){Bl(a);var E=a.Mb;a.ta.resize(y*E,x*E,y,x)&&(a.Fc=!0,a.ib.Vc(!0))}function Pd(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,ot=a.Be?a.Db:0,rt=b.clientWidth||x+tt,at=b.clientHeight||E+ot,ut=a.viewportBounds;b=ut.x;var ft=ut.y,mt=ut.width,yt=ut.height;if((rt!==x+tt||at!==E+ot)&&(a.gf=!1,a.Be=!1,ot=tt=0,a.Aa=rt,a.ya=at,z=a.pn=!0,Bl(a)),!a.hf||!a.viewportBounds.w())return!0;var xt=a.ku,Mt=a.hu;if(a.Ee=!1,!(z||a.gf||a.Be||a.mn||a.nn))return!0;var It=a.documentBounds,Tt=0,zt=0,Ht=0,Vt=0,Xt=ut.width,le=ut.height,$e=a.rj;a.contentAlignment.sb()?(It.width>Xt&&(Tt=$e.left,zt=$e.right),It.height>le&&(Ht=$e.top,Vt=$e.bottom)):(Tt=$e.left,zt=$e.right,Ht=$e.top,Vt=$e.bottom);var mn=It.width+Tt+zt,cn=It.height+Ht+Vt;$e=a.scale;var We=mn>rt/$e,Te=cn>at/$e;if(!(z||a.gf||a.Be||We||Te))return!0;Tt=It.x-Tt,rt=ut.x,zt=It.right+zt,at=ut.right+tt,Ht=It.y-Ht;var oi=ut.y;It=It.bottom+Vt,ut=ut.bottom+ot;var Xn="1px";if(Vt="1px",a.scrollMode===Uu&&(We||Te)&&(We&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(We=1,Tt+1<rt&&(We=Math.max((rt-Tt)*$e+a.Aa,We)),zt>at+1&&(We=Math.max((zt-at)*$e+a.Aa,We)),Xt+tt+1<mn&&(We=Math.max((mn-Xt)*$e+a.Aa,We)),Xn=We.toString()+"px"),Te&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(We=1,Ht+1<oi&&(We=Math.max((oi-Ht)*$e+a.ya,We)),It>ut+1&&(We=Math.max((It-ut)*$e+a.ya,We)),le+ot+1<cn&&(We=Math.max((cn-le)*$e+a.ya,We)),Vt=We.toString()+"px")),We=Xn!=="1px",Te=Vt!=="1px",We&&Te||!We&&!Te||(Te&&(at-=a.Db),We&&(ut-=a.Db),mn<Xt+tt||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(tt=1,Tt+1<rt&&(tt=Math.max((rt-Tt)*$e+a.Aa,tt)),zt>at+1&&(tt=Math.max((zt-at)*$e+a.Aa,tt)),Xt+1<mn&&(tt=Math.max((mn-Xt)*$e+a.Aa,tt)),Xn=tt.toString()+"px"),We=Xn!=="1px",tt=a.ya,We!==a.Be&&(tt=We?a.ya-a.Db:a.ya+a.Db),cn<le+ot||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(ot=1,Ht+1<oi&&(ot=Math.max((oi-Ht)*$e+tt,ot)),It>ut+1&&(ot=Math.max((It-ut)*$e+tt,ot)),le+1<cn&&(ot=Math.max((cn-le)*$e+tt,ot)),Vt=ot.toString()+"px"),Te=Vt!=="1px"),a.qr&&We===a.Be&&Te===a.gf)return x===a.Aa&&E===a.ya||a.bd(),!1;if(We!==a.Be&&(Xn==="1px"?a.ya=a.ya+a.Db:a.ya=Math.max(a.ya-a.Db,1),z=!0),a.Be=We,Mt.style.width=Xn,Te!==a.gf&&(Vt==="1px"?a.Aa=a.Aa+a.Db:a.Aa=Math.max(a.Aa-a.Db,1),z=!0,a.tn&&(ot=Bt.alloc(),Te?(y.style.left=a.Db+"px",a.position=ot.h(a.pa.x+a.Db/a.scale,a.pa.y)):(y.style.left="0px",a.position=ot.h(a.pa.x-a.Db/a.scale,a.pa.y)),Bt.free(ot))),z&&Bl(a),a.gf=Te,Mt.style.height=Vt,a.gu=!0,z&&(a.pn=!0),y=xt.scrollLeft,a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(Xt+1<mn?y=(a.position.x-Tt)*$e:Tt+1<rt?y=xt.scrollWidth-xt.clientWidth:zt>at+1&&(y=a.position.x*$e)),a.tn)switch(a.bu){case"negative":y=-(xt.scrollWidth-y-xt.clientWidth);break;case"reverse":y=xt.scrollWidth-y-xt.clientWidth}return xt.scrollLeft=y,a.hasVerticalScrollbar&&a.allowVerticalScroll&&(le+1<cn?xt.scrollTop=(a.position.y-Ht)*$e:Ht+1<oi?xt.scrollTop=xt.scrollHeight-xt.clientHeight:It>ut+1&&(xt.scrollTop=a.position.y*$e)),rt=a.Aa,at=a.ya,xt.style.width=rt+(a.gf?a.Db:0)+"px",xt.style.height=at+(a.Be?a.Db:0)+"px",x!==rt||E!==at||a.animationManager.zb?(x=Ce.allocAt(b,ft,mt,yt),a.onViewportBoundsChanged(x,a.viewportBounds,$e,z),Ce.free(x),!1):!0}Ct=ue.prototype,Ct.add=function(a){var y=a.diagram;if(y!==this&&(y!==null&&Wt("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&&Wt('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(ir,"parts",y,null,a,null,x),y.isTemporary||this.Ya(),a.C(1),x=a.layerChanged,x!==null&&x(a,null,y)}},Ct.oi=function(a){this.partManager.oi(a);var y=this;Td(a,function(x){Cd(y,x)}),(a instanceof Ii||a instanceof ri&&a.placeholder!==null)&&a.v(),a.data!==null&&Td(a,function(x){ay(y.partManager,x)}),Ls(a)!==!0&&_h(a)!==!0||this.De.add(a),RS(a,!0,this),_S(a)?(a.actualBounds.w()&&this.N(Dd(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(Dd(a,a.actualBounds)),this.$b()},Ct.pc=function(a){a.Ej(),this.partManager.pc(a);var y=this;a.data!==null&&Td(a,function(x){ly(y.partManager,x,y)}),this.De.remove(a),_S(a)?(a.actualBounds.w()&&this.N(Dd(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(Dd(a,a.actualBounds)),this.$b()},Ct.remove=function(a){wg(this,a,!0)};function wg(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(mr,"parts",E,y,null,x,null),a=y.layerChanged,a!==null&&a(y,E,null))}Ct.Is=function(a,y){if(y===void 0&&(y=!1),Zt(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 Me,x.addAll(a),a=x.iterator;a.next();)x=a.value,y&&!x.canDelete()||this.remove(x)},Ct.Kj=function(a,y,x){return x===void 0&&(x=!1),this.partManager.Kj(a,y,x)},ue.prototype.moveParts=function(a,y,x,E){if(x===void 0&&(x=!1),E===void 0&&(E=of(this)),this.toolManager!==null){var b=new kn;if(a!==null)if(Zt(a))for(var z=0;z<a.length;z++)Zl(this,b,a[z],x,E);else for(a=a.iterator;a.next();)Zl(this,b,a.value,x,E);else{for(a=this.parts;a.next();)Zl(this,b,a.value,x,E);for(a=this.nodes;a.next();)Zl(this,b,a.value,x,E);for(a=this.links;a.next();)Zl(this,b,a.value,x,E)}Bh(this,b,y,E,x)}};function Zl(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=of(a)),x instanceof nn){if(y.add(x,a.Pd(b,x,x.location)),x instanceof ri&&(x.placeholder!==null||b.dragsMembers))for(z=x.memberParts;z.next();)Zl(a,y,z.value,E,b,b.groupsAlwaysMove);for(z=x.linksConnected;z.next();){var tt=z.value;if(!y.contains(tt)){var ot=tt.fromNode,rt=tt.toNode;ot!==null&&y.contains(ot)&&rt!==null&&y.contains(rt)&&Zl(a,y,tt,E,b)}}if(b.dragsTree)for(x=x.Ou();x.next();)Zl(a,y,x.value,E,b)}else if(x instanceof Ve)for(y.add(x,a.Pd(b,x)),x=x.labelNodes;x.next();)Zl(a,y,x.value,E,b);else x instanceof Ii||y.add(x,a.Pd(b,x,x.location))}function Bh(a,y,x,E,b){if(y!==null&&y.count!==0){var z=Bt.alloc(),tt=Bt.alloc();tt.assign(x),isNaN(tt.x)&&(tt.x=0),isNaN(tt.y)&&(tt.y=0),(x=a.Mr)||sf(a,y);for(var ot=ln(),rt=ln(),at=y.iterator,ut=Bt.alloc();at.next();){var ft=at.key,mt=at.value;if(ft.Zc()){var yt=Pg(a,ft,y);yt!==null?ot.push(new it(ft,mt,yt)):(!b||ft.canMove())&&(yt=mt.point,z.assign(yt),a.computeMove(ft,z.add(tt),E,ut),ft.location=ut,mt.shifted===void 0&&(mt.shifted=new Bt),mt.shifted.assign(ut.re(yt)))}else at.key instanceof Ve&&rt.push(at.sa)}for(Bt.free(ut),b=ot.length,at=0;at<b;at++)ft=ot[at],z.assign(ft.info.point),ft.Su.shifted===void 0&&(ft.Su.shifted=new Bt),ft.node.location=z.add(ft.Su.shifted);for(b=Bt.alloc(),at=Bt.alloc(),ft=rt.length,mt=0;mt<ft;mt++){var xt=rt[mt];if(yt=xt.key,yt instanceof Ve)if(yt.suspendsRouting){yt.Tg=null,ut=yt.fromNode;var Mt=yt.toNode;if(a.draggedLink!==null&&E.dragsLink)if(Mt=xt.value.point,yt.dragComputation===null)y.add(yt,a.Pd(E,yt,tt)),$u(yt,tt.x-Mt.x,tt.y-Mt.y);else{xt=Bt.allocAt(0,0),(ut=yt.i(0))&&ut.w()&&xt.assign(ut);var It=ut=Bt.alloc().assign(xt).add(tt);E.isGridSnapEnabled&&(E.isGridSnapRealtime||a.lastInput.up)&&(It=Bt.alloc(),rf(a,yt,ut,It,E)),ut.assign(yt.dragComputation(yt,ut,It)).re(xt),y.add(yt,a.Pd(E,yt,ut)),$u(yt,ut.x-Mt.x,ut.y-Mt.y),Bt.free(xt),Bt.free(ut),It!==ut&&Bt.free(It)}else ut!==null&&(b.assign(ut.location),It=y.I(ut),It!==null&&b.re(It.point)),Mt!==null&&(at.assign(Mt.location),It=y.I(Mt),It!==null&&at.re(It.point)),ut!==null&&Mt!==null?b.Xa(at)?(ut=xt.value.point,Mt=z,Mt.assign(b),Mt.re(ut),y.add(yt,a.Pd(E,yt,b)),$u(yt,Mt.x,Mt.y)):(yt.suspendsRouting=!1,yt.bb()):(xt=xt.value.point,ut=ut!==null?b:Mt!==null?at:tt,y.add(yt,a.Pd(E,yt,ut)),$u(yt,ut.x-xt.x,ut.y-xt.y))}else(yt.fromNode===null||yt.toNode===null)&&(ut=xt.value.point,y.add(yt,a.Pd(E,yt,tt)),$u(yt,tt.x-ut.x,tt.y-ut.y))}Bt.free(z),Bt.free(tt),Bt.free(b),Bt.free(at),Be(ot),Be(rt),x||(Jr(a),Dh(a,y))}}ue.prototype.computeMove=function(a,y,x,E){if(E===void 0&&(E=new Bt),E.assign(y),a===null)return E;var b=y,z=x.isGridSnapEnabled;z&&(x.isGridSnapRealtime||this.lastInput.up)&&(b=Bt.alloc(),rf(this,a,y,b,x)),x=a.dragComputation!==null?a.dragComputation(a,y,b):b;var tt=a.minLocation,ot=tt.x;isNaN(ot)&&(ot=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 rt=a.maxLocation,at=rt.x;return isNaN(at)&&(at=z?Math.round(1e3*a.location.x)/1e3:a.location.x),rt=rt.y,isNaN(rt)&&(rt=z?Math.round(1e3*a.location.y)/1e3:a.location.y),E.h(Math.max(ot,Math.min(x.x,at)),Math.max(tt,Math.min(x.y,rt))),b!==y&&Bt.free(b),E};function of(a){var y=a.toolManager.findTool("Dragging");return y!==null?y.dragOptions:a.Wm}function rf(a,y,x,E,b){if(b===void 0&&(b=of(a)),E.assign(x),y!==null){var z=a.grid;y=b.gridSnapCellSize,a=y.width,y=y.height;var tt=b.gridSnapOrigin,ot=tt.x;if(tt=tt.y,b=b.gridSnapCellSpot,z!==null){var rt=z.gridCellSize;isNaN(a)&&(a=rt.width),isNaN(y)&&(y=rt.height),z=z.gridOrigin,isNaN(ot)&&(ot=z.x),isNaN(tt)&&(tt=z.y)}z=Bt.allocAt(0,0),z.yi(0,0,a,y,b),qt.No(x.x,x.y,ot+z.x,tt+z.y,a,y,E),Bt.free(z)}}function sf(a,y){if(y!==null)for(a.Mr=!0,a=y.iterator;a.next();)y=a.key,y instanceof Ve&&(y.suspendsRouting=!0)}function Dh(a,y){if(y!==null){for(y=y.iterator;y.next();){var x=y.key;x instanceof Ve&&(x.suspendsRouting=!1,Zv(x)&&x.bb())}a.Mr=!1}}function Pg(a,y,x){return y=y.containingGroup,y!==null&&(a=Pg(a,y,x),a!==null||(a=x.I(y),a!==null))?a:null}Ct=ue.prototype,Ct.Pd=function(a,y,x){if(x===void 0)return new pu(vo);var E=a.isGridSnapEnabled;return a.groupsSnapMembers||y.containingGroup===null||(E=!1),E?new pu(new Bt(Math.round(1e3*x.x)/1e3,Math.round(1e3*x.y)/1e3)):new pu(x.copy())};function Cg(a,y,x){if(y.diagram!==null&&y.diagram!==a&&Wt("Cannot share a Layer with another Diagram: "+y+" of "+y.diagram),x===null?y.diagram!==null&&Wt("Cannot add an existing Layer to this Diagram again: "+y):(x.diagram!==a&&Wt("Existing Layer must be in this Diagram: "+x+" not in "+x.diagram),y===x&&Wt("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&&Wt("Cannot add Layer with the name '"+y+"'; a Layer with the same name is already present in this Diagram.")}}Ct.Al=function(a){Cg(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(ir,"layers",this,null,a,null,x+1),this.N(),this.Ya(),this},Ct.Ww=function(a,y){Cg(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(mr,"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(ir,"layers",this,null,a,null,z),this.N(),0>E&&this.Ya(),this},Ct.Cy=function(a,y){Cg(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(mr,"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(ir,"layers",this,null,a,null,z+1),this.N(),0>E&&this.Ya(),this},Ct.kA=function(a){if(a.diagram!==this&&Wt("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(mr,"layers",this,a,null,x,null),this.N(),this.Ya()}}},Ct.Qj=function(a){for(var y=this.layers;y.next();){var x=y.value;if(x.name===a)return x}return null},Ct.Yw=function(a){return this.pf===null&&(this.pf=new ke),this.pf.add(a),this.model.Pe(a),this},Ct.mA=function(a){this.pf!==null&&(this.pf.remove(a),this.pf.count===0&&(this.pf=null)),this.model.ik(a)},Ct.Pe=function(a){return this.zg===null&&(this.zg=new ke),this.zg.add(a),this},Ct.ik=function(a){this.zg!==null&&(this.zg.remove(a),this.zg.count===0&&(this.zg=null))},Ct.ds=function(a){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(a),a.change!==ia&&(this.isModified=!0),this.zg!==null)for(var y=this.zg,x=y.length,E=0;E<x;E++)y.M(E)(a)},Ct.cb=function(a,y,x,E,b,z,tt){z===void 0&&(z=null),tt===void 0&&(tt=null);var ot=new Ao;ot.diagram=this,ot.change=a,ot.propertyName=y,ot.object=x,ot.oldValue=E,ot.oldParam=z,ot.newValue=b,ot.newParam=tt,this.ds(ot)},Ct.g=function(a,y,x,E,b){this.cb(No,a,this,y,x,E,b)},ue.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===No){var b=a.object;if(Lo(b,a.propertyName,a.I(y)),b instanceof Jt){var z=b.part;z!==null&&z.Wb()}this.isModified=!0}else if(E===ir){var tt=a.object,ot=a.newParam,rt=a.newValue;if(tt instanceof ze)if(typeof ot=="number"&&rt instanceof Jt){y?tt.pc(ot):tt.Gb(ot,rt);var at=tt.part;at!==null&&at.Wb()}else typeof ot=="number"&&rt instanceof gr&&(rt.isRow?hS(tt,ot,y?void 0:rt):dS(tt,ot,y?void 0:rt));else if(tt instanceof Nr){var ut=a.oldParam===!0;typeof ot=="number"&&rt instanceof On&&(y?(rt.isSelected=!1,rt.isHighlighted=!1,rt.Wb(),tt.pc(ut?ot:-1,rt,ut)):tt.oi(ot,rt,ut))}else tt instanceof ue?typeof ot=="number"&&rt instanceof Nr&&(y?this.Wa.mb(ot):(rt.Xe(this),this.Wa.Gb(ot,rt))):Wt("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(E===mr){var ft=a.object,mt=a.oldParam,yt=a.oldValue;if(ft instanceof ze)typeof mt=="number"&&yt instanceof Jt?y?ft.Gb(mt,yt):ft.pc(mt):typeof mt=="number"&&yt instanceof gr&&(yt.isRow?hS(ft,mt,y?yt:void 0):dS(ft,mt,y?yt:void 0));else if(ft instanceof Nr){var xt=a.newParam===!0;typeof mt=="number"&&yt instanceof On&&(y?0>ft.Pa.indexOf(yt)&&ft.oi(mt,yt,xt):(yt.isSelected=!1,yt.isHighlighted=!1,yt.Wb(),ft.pc(xt?mt:-1,yt,xt)))}else ft instanceof ue?typeof mt=="number"&&yt instanceof Nr&&(y?(yt.Xe(this),this.Wa.Gb(mt,yt)):this.Wa.mb(mt)):Wt("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else E!==ia&&Wt("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=x}}},ue.prototype.Ea=function(a){return this.undoManager.Ea(a)},ue.prototype.eb=function(a){return this.undoManager.eb(a)},ue.prototype.Kf=function(){return this.undoManager.Kf()},ue.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}},ue.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)},ue.prototype.rp=function(){this.partManager.rp()};function Lg(a,y,x){var E=a.animationManager;if(a.vb||a.ld)a.Ca=x,Bl(a),a.N(),a.Ee=!0,E.zb&&(cu(E)||E.ce.add(E.H,"scale",y,a.Ca));else if(a.ta===null)a.Ca=x,Bl(a);else{a.vb=!0;var b=a.viewportBounds.copy(),z=a.Aa,tt=a.ya,ot=a.zoomPoint.x,rt=a.zoomPoint.y,at=a.contentAlignment;isNaN(ot)&&(at.$c()?at.Hf($a)?ot=0:at.Hf(Hr)&&(ot=z-1):ot=at.sb()?at.x*(z-1):z/2),isNaN(rt)&&(at.$c()?at.Hf(El)?rt=0:at.Hf(ga)&&(rt=tt-1):rt=at.sb()?at.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=Bt.allocAt(a.pa.x+ot/y-ot/x,a.pa.y+rt/y-rt/x),a.position=z,Bt.free(z),a.Ca=x,Bl(a),a.vb=!1,a.onViewportBoundsChanged(b,a.viewportBounds,y,!1),Va(a,!1),E.zb&&(cu(E)||E.ce.add(E.H,"scale",y,a.Ca))}}ue.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!==ds||a.width===y.width&&a.height===y.height||b.C(),b=this.currentTool,this.Vk===!0&&b instanceof Eo&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),Op(b,this)),this.vb||this.invalidateViewport(a,y),Al(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 Al(a,y){var x=a.fe;if(x!==null&&x.visible){for(var E=Qe.alloc(),b=1,z=1,tt=x.O.s,ot=tt.length,rt=0;rt<ot;rt++){var at=tt[rt],ut=Math.abs(at.interval);2>ut||(pv(at.figure)?z=z*ut/qt.vx(z,ut):b=b*ut/qt.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=Ce.alloc(),a=a.viewportBounds,y.h(a.x,a.y,a.width,a.height),!y.w()){Ce.free(y);return}b=y.width,z=y.height,a=y.x,tt=y.y,Ce.free(y)}x.width=b+2*E.width,x.height=z+2*E.height,y=Bt.alloc(),qt.No(a,tt,0,0,E.width,E.height,y),y.offset(-E.width,-E.height),Qe.free(E),x.part.location=y,Bt.free(y)}}ue.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)}},ue.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))},ue.prototype.rA=function(a){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),Zt(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];E instanceof On||Wt("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 On||Wt("Diagram.selectCollection given something that is not a Part: "+y),y.isSelected=!0;this.R("ChangedSelection",this.selection)},ue.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()}},Ct=ue.prototype,Ct.Iz=function(a){a!==null&&a.diagram===this&&(!a.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),a.isHighlighted=!0)},Ct.Jz=function(a){a=new Me().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 On||Wt("Diagram.highlightCollection given something that is not a Part: "+y),y.isHighlighted=!0},Ct.scroll=function(a,y,x){x===void 0&&(x=1);var E=y==="up"||y==="down",b=0,z=Bt.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)),Bt.free(z);return}Wt("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):Wt("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+y),Bt.free(z)},Ct.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)},Ct.es=function(a){var y=this.viewportBounds;a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a},Ct.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)},Ct.zA=function(a){var y=this.Ab,x=a.x,E=a.y,b=x+a.width,z=E+a.height,tt=y.m11,ot=y.m12,rt=y.m21,at=y.m22,ut=y.dx,ft=y.dy,mt=x*tt+E*rt+ut;y=x*ot+E*at+ft;var yt=b*tt+E*rt+ut;return a=b*ot+E*at+ft,E=x*tt+z*rt+ut,x=x*ot+z*at+ft,tt=b*tt+z*rt+ut,b=b*ot+z*at+ft,z=Math.min(mt,yt),mt=Math.max(mt,yt),yt=Math.min(y,a),y=Math.max(y,a),z=Math.min(z,E),mt=Math.max(mt,E),yt=Math.min(yt,x),y=Math.max(y,x),z=Math.min(z,tt),mt=Math.max(mt,tt),yt=Math.min(yt,b),y=Math.max(y,b),new Ce(z,yt,mt-z,y-yt)},Ct.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),ki(a.copy(),this.Ab)};function $p(a){var y=a.isModified;a.Tw!==y&&(a.Tw=y,a.R("Modified"))}function kg(a){return a=cf.get(a),a!==null?new a:new qi}ue.prototype.doModelChanged=function(a){var y=this;if(a.model===this.model){var x=a.change,E=a.propertyName;if(x===ia&&E[0]==="S")if(E==="StartingFirstTransaction"){var b=this;a=this.toolManager,a.mouseDownTools.each(function(rt){return rt.diagram=b}),a.mouseMoveTools.each(function(rt){return rt.diagram=b}),a.mouseUpTools.each(function(rt){return rt.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===ia){(E==="FinishedUndo"||E==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),Jr(this));var z=this.animationManager;E==="RolledBackTransaction"&&z.Cc(),this.bx(),this.Jk=!0,this.bd(),this.undoManager.transactionLevel!==0&&this.undoManager.transactionLevel!==1||Jc(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&&($p(this),this.As.clear(),zp(this.animationManager)),!this.Rt&&tt&&this.lastInput.targetDiagram){this.Rt=!0;var ot=this;de(function(){ot.currentTool.standardMouseOver(),ot.Rt=!1},10)}}}finally{this.aa=!0}}}};function Cd(a,y){y=y.O.s;for(var x=y.length,E=0;E<x;E++)Oh(a,y[E])}function Oh(a,y){if(y instanceof Ws){var x=y.element;if(x!==null&&x instanceof HTMLImageElement){x.Bg instanceof Me&&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 Mg(a,y){if(y instanceof Ws){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 Me&&x.Bg.remove(a),kf(E));break}}}}}ue.prototype.Wd=function(){this.partManager.Wd()},ue.prototype.Aj=function(a,y){this.Yd.Aj(a,y)},ue.prototype.Cj=function(a,y){this.Yd.Cj(a,y)},ue.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)},ue.prototype.Vb=function(a){return this.partManager.Vb(a)},ue.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)},Ct=ue.prototype,Ct.Lc=function(a){return this.partManager.Lc(a)},Ct.ii=function(a){return this.partManager.ii(a)},Ct.Kc=function(a){return this.partManager.Kc(a)},Ct.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:jo(lo(y)))},Ct.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:jo(lo(y)))};function Bl(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 Eg(a,y){a.Zi=!1;var x=a.Sp;x.D(y)||(x=x.copy(),a.Sp.assign(y),Va(a,!1),a.R("DocumentBoundsChanged",void 0,x),a.Ee=!0,a.N())}Ct.Va=function(){if(this.Zi){var a=Ce.alloc();Eg(this,this.computeBounds(a)),Ce.free(a)}},Ct.rz=function(){for(var a=new Me,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},Ct.qz=function(){return this.ai.iterator},Ct.Uz=function(a){Jr(this),a&&af(this,!0),this.ld?bg(this,!1):(this.Jk=!0,Ea(this))};function af(a,y){for(var x=a.ai.iterator;x.next();)tm(a,x.value,y);a.layout&&(y?a.layout.isValidLayout=!1:a.layout.C())}function tm(a,y,x){if(y!==null){for(var E=y.gl.iterator;E.next();)tm(a,E.value,x);y.layout!==null&&(x?y.layout.isValidLayout=!1:y.layout.C())}}function bg(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||Vl(z,"Layout")),a.xh=!1;for(var tt=a.ai.iterator;tt.next();)Fg(a,tt.value,y,E);b.isValidLayout||(!y||b.isRealtime||b.isRealtime===null||E===0?(b.doLayout(a),Jr(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||Jc(z),a.aa=x}}}function Fg(a,y,x,E){if(y!==null){for(var b=y.gl.iterator;b.next();)Fg(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),dc(a,y),b.isValidLayout=!0):a.xh=!0)}}Ct.yz=function(){for(var a=new ke,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 ke;x.add(b,tt),x.add(z,tt),E.add(b,b),E.add(z,b)}var x=new kn,E=new kn;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 em(a,y){var x=a.hw.I(y);return x!==null?x:a.hw.I(y.toLowerCase())}function lf(a,y){var x=a.iw.I(y);if(x!==null||(x=a.iw.I(y.toLowerCase()),x!==null))return x;Wt("Unknown DiagramEvent name: "+y)}Ct.Bj=function(a,y){return a=lf(this,a),a!==null&&a.add(y),this},Ct.am=function(a,y){a=lf(this,a),a!==null&&a.remove(y)},Ct.R=function(a,y,x){var E=lf(this,a),b=new Fu;if(b.diagram=this,a=em(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 uf(a){if(a.animationManager.isTicking)return!1;var y=a.currentTool;return y===a.toolManager.findTool("Dragging")?!a.Mr||y.isComplexRoutingRealtime:!0}Ct.Yj=function(a,y){return hf(this,!1,null,y||null).Yj(a.x,a.y,a.width,a.height)},ue.prototype.computeOccupiedArea=function(a){return this.isVirtualized?this.viewportBounds.copy():this.Zi?gg(this,a):a.assign(this.documentBounds)};function hf(a,y,x,E){var b=a.Xh;if(b===null&&(a.Xh=b=new op(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=nm(a,x)),x===null){y=Ce.alloc(),a.computeOccupiedArea(y),y.Bc(100,100),b.initialize(y);for(var z=a.nodes;z.next();){var tt=z.value,ot=tt.layer;ot!==null&&ot.visible&&!ot.isTemporary&&df(a,tt,E,y)}Ce.free(y)}else{for(0<x.memberParts.count&&(y=a.computePartsBounds(x.memberParts,!1),y.Bc(20,20),b.initialize(y)),y=Ce.alloc(),z=x.memberParts;z.next();)tt=z.value,tt instanceof nn&&df(a,tt,E,y);Ce.free(y)}b.group=x,b.Yx=E,b.vs=!1}else y&&o1(b);return b}function nm(a,y){return y.avoidable&&!y.isLinkLabel?y:y.containingGroup!==null?nm(a,y.containingGroup):null}function df(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(Tf(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(eh,x,y+1);else for(var tt=x;tt<=y;tt++)z[tt]=eh}else if(y instanceof ri)for(y=y.memberParts;y.next();)b=y.value,b instanceof nn&&df(a,b,x,E)}}function Vu(a,y){a.Xh===null||a.Xh.vs||y!==void 0&&(!y.avoidable||y.isLinkLabel)||(a.Xh.vs=!0)}ue.prototype.gs=function(a){this.wp.assign(a),this.computeAutoScrollPosition(this.wp).Xa(this.position)?this.ug():Ng(this)};function Ng(a){a.vk===-1&&(a.vk=de(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=Ce.alloc(),a.computeBounds(y),y.ed(a.documentBounds),Eg(a,y),Ce.free(y),a.Fc=!0,a.bd(),Ng(a))}},a.vp))}ue.prototype.ug=function(){this.vk!==-1&&(Ke.clearTimeout(this.vk),this.vk=-1)},ue.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=Ce.allocAt(0,0,E.width*b,E.height*b);var z=Bt.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(vo)||(y=new Bt(y.x+z.x/b,y.y+z.y/b)),Ce.free(E),Bt.free(z),y},Ct=ue.prototype,Ct.Cs=function(){return null},Ct.av=function(){return null},Ct.bs=function(a,y){this.pj.add(a,y)},Ct.Fu=function(a){(this.Pw=a)||this.nodes.each(function(y){y instanceof ri&&(y.$p=null)})};function cc(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-at>rt?y(x,b,ot):Ke.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 ot=a,rt=x.callbackTimeout||300,at=+new Date;return Ke.requestAnimationFrame(function(){E()}),null}Ct.Wz=function(a){return Uo?(a===void 0&&(a={}),a.returnType="Image",this.Jx(a)):null},Ct.Jx=function(a){return a===void 0&&(a={}),cc(this,this.Xz,a)},Ct.Xz=function(a,y,x){var E=im(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 Md+"data":b=E.getImageData(0,0,x.width,x.height);break;case Md:E=(a.document||document).createElement("img"),E.src=x.toDataURL(a.type,a.details),b=E;break;case"blob":return typeof y!="function"&&Wt('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 im(a,y,x,E){if(a.animationManager.Cc(),a.bd(),a.ta===null)return null;typeof y!="object"&&Wt("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 Qe(1/0,1/0):new Qe(2e3,2e3));var ot=y.position||null,rt=y.parts||null,at=y.padding===void 0?1:y.padding,ut=y.background||null,ft=y.omitTemporary;ft===void 0&&(ft=!0);var mt=y.document||document,yt=y.elementFinished||null,xt=y.showTemporary;xt===void 0&&(xt=!ft),y=y.showGrid,y===void 0&&(y=xt),b!==null&&isNaN(b.width)&&isNaN(b.height)&&(b=null),typeof at=="number"?at=new yi(at):at instanceof yi||Wt("MakeImage padding must be a Margin or a number."),at.left=Math.max(at.left,0),at.right=Math.max(at.right,0),at.top=Math.max(at.top,0),at.bottom=Math.max(at.bottom,0),a.ib.Vc(!0),ft=new Ya(null,mt,void 0,!0);var Mt=ft.context;if(!(b||z||rt||ot))return ft.width=a.Aa+Math.ceil(at.left+at.right),ft.height=a.ya+Math.ceil(at.top+at.bottom),x==="SVG"?E===null?null:(E.resize(ft.width,ft.height,ft.width,ft.height),E.ownerDocument=mt,E.hs=yt,nf(a,E.context,at,new Qe(ft.width,ft.height),a.Ca,a.pa,rt,ut,xt,y),E.context):(a.Xm=!1,nf(a,Mt,at,new Qe(ft.width,ft.height),a.Ca,a.pa,rt,ut,xt,y),a.Xm=!0,ft.context);var It=a.Pp,Tt=a.documentBounds.copy();if(Tt.Fv(a.yb),xt)for(var zt=a.Wa.s,Ht=zt.length,Vt=0;Vt<Ht;Vt++){var Xt=zt[Vt];if(Xt.visible&&Xt.isTemporary){Xt=Xt.Pa.s;for(var le=Xt.length,$e=0;$e<le;$e++){var mn=Xt[$e];mn.isInDocumentBounds&&mn.isVisible()&&(mn=mn.actualBounds,mn.w()&&Tt.ed(mn))}}}if(zt=new Bt(Tt.x,Tt.y),rt!==null){for(Ht=new Ce(0,0,0,0),Vt=!0,Xt=rt.iterator,Xt.reset();Xt.next();)le=Xt.value,le instanceof On&&($e=le.layer,$e!==null&&!$e.visible||$e!==null&&!xt&&$e.isTemporary||!le.isVisible()||(le=le.actualBounds,le.w()&&(Vt?(Vt=!1,Ht.assign(le)):Ht.ed(le))));Tt.width=Ht.width,Tt.height=Ht.height,zt.x=Ht.x,zt.y=Ht.y}return ot!==null&&ot.w()&&(zt=ot,z||(z=It)),Ht=ot=0,at!==null&&(ot=at.left+at.right,Ht=at.top+at.bottom),Vt=Xt=0,b!==null&&(Xt=b.width,Vt=b.height,isFinite(Xt)&&(Xt=Math.max(0,Xt-ot)),isFinite(Vt)&&(Vt=Math.max(0,Vt-Ht))),b!==null&&z!==null?(z==="NaN"&&(z=It),b.w()?(b=Xt,Tt=Vt):isNaN(Vt)?(b=Xt,Tt=Tt.height*z):(b=Tt.width*z,Tt=Vt)):b!==null?b.w()?(z=Math.min(Xt/Tt.width,Vt/Tt.height),b=Xt,Tt=Vt):isNaN(Vt)?(z=Xt/Tt.width,b=Xt,Tt=Tt.height*z):(z=Vt/Tt.height,b=Tt.width*z,Tt=Vt):z!==null?z==="NaN"&&tt.w()?(z=Math.min((tt.width-ot)/Tt.width,(tt.height-Ht)/Tt.height),z>It?(z=It,b=Tt.width,Tt=Tt.height):(b=tt.width,Tt=tt.height)):(b=Tt.width*z,Tt=Tt.height*z):(z=It,b=Tt.width,Tt=Tt.height),at!==null?(b+=ot,Tt+=Ht):at=new yi(0),tt!==null&&(It=tt.width,tt=tt.height,isNaN(It)&&(It=2e3),isNaN(tt)&&(tt=2e3),isFinite(It)&&(b=Math.min(b,It)),isFinite(tt)&&(Tt=Math.min(Tt,tt))),ft.width=Math.ceil(b),ft.height=Math.ceil(Tt),x==="SVG"?E===null?null:(E.resize(ft.width,ft.height,ft.width,ft.height),E.ownerDocument=mt,E.hs=yt,nf(a,E.context,at,new Qe(Math.ceil(b),Math.ceil(Tt)),z,zt,rt,ut,xt,y),E.context):(a.Xm=!1,nf(a,Mt,at,new Qe(Math.ceil(b),Math.ceil(Tt)),z,zt,rt,ut,xt,y),a.Xm=!0,ft.context)}oe.Object.defineProperties(ue.prototype,{renderer:{get:function(){return this.nl},set:function(a){this instanceof gt||(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 Dl(this,Ke.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 Dl(this,Ke.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(Ke,"resize",this.Ov,!1),this.removeEventListener(Ke,"wheel",this.$j,!0),Ul===this&&(Ul=null)):this.ui===null&&(this.hf=!1),this.Ka=null,a!==null&&((y=a.H)&&(y.div=null),cg(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)&&an(a,"0 <= value <= 1",ue,"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),Va(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),Va(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),Va(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),Va(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(a){var y=this.iu;y!==a&&(0>a&&an(a,">= 0",ue,"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&&an(a,">= 0",ue,"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 an(a,">= 0",ue,"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||$p(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&&Wt("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var x=dg(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var E=this.vb;this.vb=!0,Vl(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=kg(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(Ke,"pointermove",this.dk,!0),this.addEventListener(Ke,"pointerdown",this.ui,!0),this.addEventListener(Ke,"pointerup",this.fk,!0),this.addEventListener(Ke,"pointerout",this.ek,!0),this.addEventListener(Ke,"pointercancel",this.ck,!0),this.removeEventListener(y,"wheel",this.$j,!1),this.addEventListener(Ke,"wheel",this.$j,!0),this.addEventListener(Ke,"selectstart",this.preventDefault,!1)):(this.removeEventListener(Ke,"pointermove",this.dk,!0),this.removeEventListener(Ke,"pointerdown",this.ui,!0),this.removeEventListener(Ke,"pointerup",this.fk,!0),this.removeEventListener(Ke,"pointerout",this.ek,!0),this.removeEventListener(Ke,"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(Ke,"wheel",this.$j,!0),this.removeEventListener(Ke,"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=Bt.alloc().assign(this.pa);if(!y.D(a)){var x=this.viewportBounds.copy();this.pa.assign(a),Gp(this.animationManager,y,this.pa),this.vb||this.ta===null&&!this.wo.w()?Bl(this):(this.vb=!0,a=this.scale,pg(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)}Bt.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=Xp(this)),this.fe},set:function(a){var y=this.fe;if(y!==a){y===null&&(y=this.fe=Xp(this)),a.type!==ze.Grid&&Wt("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),Al(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),Bl(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||Wt("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 yi(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===Uu&&Va(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,Va(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,Lg(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&&Lg(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!==ds&&Va(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()||Wt("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()||Wt("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)):an(a,"> 0",ue,"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)):an(a,"> 0",ue,"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),Va(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 yi(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&&Wt("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();)Kg(a.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(a){var y=this.uu;y!==a&&(a!==Yu&&a!==cr&&a!==ff&&Wt("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 Qe(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 yi(a));var y=this.xp;y.D(a)||(this.xp=a=a.J(),this.Ya(),this.g("autoScrollRegion",y,a))}}}),oe.Object.defineProperties(ue,{licenseKey:{get:function(){return Ig.jc()},set:function(a){Ig.add(a.replace(/\s/g,""))}},version:{get:function(){return kd}}}),ue.prototype.makeImageData=ue.prototype.Jx,ue.prototype.makeImage=ue.prototype.Wz,ue.prototype.cacheGroupExternalLinks=ue.prototype.Fu,ue.prototype.addRenderer=ue.prototype.bs,ue.prototype.makeSVG=ue.prototype.av,ue.prototype.makeSvg=ue.prototype.Cs,ue.prototype.stopAutoScroll=ue.prototype.ug,ue.prototype.doAutoScroll=ue.prototype.gs,ue.prototype.isUnoccupied=ue.prototype.Yj,ue.prototype.raiseDiagramEvent=ue.prototype.R,ue.prototype.removeDiagramListener=ue.prototype.am,ue.prototype.addDiagramListener=ue.prototype.Bj,ue.prototype.findTreeRoots=ue.prototype.yz,ue.prototype.layoutDiagram=ue.prototype.Uz,ue.prototype.findTopLevelGroups=ue.prototype.qz,ue.prototype.findTopLevelNodesAndLinks=ue.prototype.rz,ue.prototype.ensureBounds=ue.prototype.Va,ue.prototype.findLinksByExample=ue.prototype.ls,ue.prototype.findNodesByExample=ue.prototype.ms,ue.prototype.findLinkForData=ue.prototype.Kc,ue.prototype.findNodeForData=ue.prototype.ii,ue.prototype.findPartForData=ue.prototype.Lc,ue.prototype.findLinkForKey=ue.prototype.findLinkForKey,ue.prototype.findNodeForKey=ue.prototype.Vb,ue.prototype.findPartForKey=ue.prototype.findPartForKey,ue.prototype.rebuildParts=ue.prototype.Wd,ue.prototype.transformViewToDoc=ue.prototype.Ps,ue.prototype.transformRectDocToView=ue.prototype.zA,ue.prototype.transformDocToView=ue.prototype.op,ue.prototype.centerRect=ue.prototype.es,ue.prototype.scrollToRect=ue.prototype.tv,ue.prototype.scroll=ue.prototype.scroll,ue.prototype.highlightCollection=ue.prototype.Jz,ue.prototype.highlight=ue.prototype.Iz,ue.prototype.selectCollection=ue.prototype.rA,ue.prototype.select=ue.prototype.select,ue.prototype.updateAllRelationshipsFromData=ue.prototype.rp,ue.prototype.updateAllTargetBindings=ue.prototype.updateAllTargetBindings,ue.prototype.commit=ue.prototype.commit,ue.prototype.rollbackTransaction=ue.prototype.Kf,ue.prototype.commitTransaction=ue.prototype.eb,ue.prototype.startTransaction=ue.prototype.Ea,ue.prototype.raiseChanged=ue.prototype.g,ue.prototype.raiseChangedEvent=ue.prototype.cb,ue.prototype.removeChangedListener=ue.prototype.ik,ue.prototype.addChangedListener=ue.prototype.Pe,ue.prototype.removeModelChangedListener=ue.prototype.mA,ue.prototype.addModelChangedListener=ue.prototype.Yw,ue.prototype.findLayer=ue.prototype.Qj,ue.prototype.removeLayer=ue.prototype.kA,ue.prototype.addLayerAfter=ue.prototype.Cy,ue.prototype.addLayerBefore=ue.prototype.Ww,ue.prototype.addLayer=ue.prototype.Al,ue.prototype.moveParts=ue.prototype.moveParts,ue.prototype.copyParts=ue.prototype.Kj,ue.prototype.removeParts=ue.prototype.Is,ue.prototype.remove=ue.prototype.remove,ue.prototype.add=ue.prototype.add,ue.prototype.clearDelayedGeometries=ue.prototype.bx,ue.prototype.setProperties=ue.prototype.nm,ue.prototype.attach=ue.prototype.Du,ue.prototype.set=ue.prototype.set,ue.prototype.resetInputOptions=ue.prototype.Sx,ue.prototype.setInputOption=ue.prototype.sA,ue.prototype.getInputOption=ue.prototype.Ql,ue.prototype.resetRenderingHints=ue.prototype.Tx,ue.prototype.setRenderingHint=ue.prototype.Xx,ue.prototype.getRenderingHint=ue.prototype.Gf,ue.prototype.maybeUpdate=ue.prototype.bd,ue.prototype.requestUpdate=ue.prototype.$b,ue.prototype.delayInitialization=ue.prototype.Xy,ue.prototype.isUpdateRequested=ue.prototype.Pz,ue.prototype.invalidateDocumentBounds=ue.prototype.Ya,ue.prototype.findObjectsNear=ue.prototype.og,ue.prototype.findPartsNear=ue.prototype.mz,ue.prototype.findObjectsIn=ue.prototype.Cf,ue.prototype.findPartsIn=ue.prototype.ux,ue.prototype.findObjectsAt=ue.prototype.ji,ue.prototype.findPartsAt=ue.prototype.lz,ue.prototype.findObjectAt=ue.prototype.ic,ue.prototype.findPartAt=ue.prototype.Ol,ue.prototype.focusObject=ue.prototype.zz,ue.prototype.alignDocument=ue.prototype.Jy,ue.prototype.zoomToRect=ue.prototype.BA,ue.prototype.zoomToFit=ue.prototype.zoomToFit,ue.prototype.diagramScroll=ue.prototype.kx,ue.prototype.focus=ue.prototype.focus;var cf=new kn,om=null,Uo=Ke.document!==void 0,Ld=null,Ih="",ds=new Se(ue,"None",0),va=new Se(ue,"Uniform",1),Rh=new Se(ue,"UniformToFill",2),fc=new Se(ue,"CycleAll",10),Tg=new Se(ue,"CycleNotDirected",11),Ag=new Se(ue,"CycleNotDirectedFast",12),Bg=new Se(ue,"CycleNotUndirected",13),Dg=new Se(ue,"CycleDestinationTree",14),Og=new Se(ue,"CycleSourceTree",15),Uu=new Se(ue,"DocumentScroll",1),gc=new Se(ue,"InfiniteScroll",2),Yu=new Se(ue,"TreeParentCollapsed",21),cr=new Se(ue,"AllParentsCollapsed",22),ff=new Se(ue,"AnyParentsCollapsed",23),Ig=new ke,kd="2.3.10",Md="image",pc=null,rm=!1;function os(){if(Uo){var a=Ke.document.createElement("canvas"),y=a.getContext("2d"),x=Fe("7ca11abfd022028846");y[x]=Fe("398c3597c01238");for(var E=["5da73c80a36455d7038e4972187c3cae51fd22",pn.Dx+"4ae6247590da4bb21c324ba3a84e385776",ci.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",qt.za],b=1;5>b;b++)y[Fe("7ca11abfd7330390")](Fe(E[b-1]),10,15*b);for(y[x]=Fe("39f046ebb36e4b"),x=1;5>x;x++)y[Fe("7ca11abfd7330390")](Fe(E[x-1]),10,15*x);(E.length!==4||E[0][0]!=="5"||E[3][0]!=="7")&&(ci.prototype.Cd=ci.prototype.Eu),pc=a}}ue.className="Diagram",ue.fromDiv=function(a){var y=a;return typeof a=="string"&&(y=Ke.document.getElementById(a)),y instanceof HTMLDivElement&&y.H instanceof ue?y.H:null},ue.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},ue.useDOM=function(a){Uo=a?Ke.document!==void 0:!1},ue.isUsingDOM=function(){return Uo},ue.None=ds,ue.Uniform=va,ue.UniformToFill=Rh,ue.CycleAll=fc,ue.CycleNotDirected=Tg,ue.CycleNotDirectedFast=Ag,ue.CycleNotUndirected=Bg,ue.CycleDestinationTree=Dg,ue.CycleSourceTree=Og,ue.DocumentScroll=Uu,ue.InfiniteScroll=gc,ue.TreeParentCollapsed=Yu,ue.AllParentsCollapsed=cr,ue.AnyParentsCollapsed=ff;function sm(){this.wy=null,this.j="zz@orderNum",this._tk==="63ad05bbe23a1786468a4c741b6d2"?this.Rc=this.j=!0:this.Rc=null}function Ed(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=Ke[Fe("76a715b2f73f148a")][Fe("72ba13b5")]||"";if(a.Rc=!0,Uo){var E=ue[Fe("76a115b6ed251eaf4692")];if(E)for(var b=Ig.iterator;b.next()&&(E=b.value,E=Fe(E).split(Fe("39e9")),!(6>E.length));){var z=Fe(E[1]).split(".");if(E[4]!=="7da71ca0")break;var tt=Fe(pn[Fe("6cae19")]).split(".");if(z[0]>tt[0]||z[0]===tt[0]&&z[1]>=tt[1]){var ot=Ke[Fe("74a900bae4370f8b51")][Fe("6fbb13a1c2311e8a57")].toLowerCase();if(tt=ot[Fe("73a612b6fb191d")](Fe("3aad1ab6e022098b4dc4")),z=Fe(E[2]),-1<tt&&(ot=ot[Fe("73a612b6fb191d")](z.toLowerCase()+"/"),a.Rc=!(-1<ot&&ot<tt),!a.Rc))break;for(tt=x[Fe("76ad18b4f73e")],ot=x[Fe("73a612b6fb191d")](Fe("35e7"))+2;ot<tt;ot++)y+=x[ot];if(tt=y[Fe("73a612b6fb191d")](z),0>tt&&z!==Fe("7da71ca0ad381e90")&&(tt=y[Fe("73a612b6fb191d")](Fe("76a715b2ef3e149757"))),0>tt&&(tt=y[Fe("73a612b6fb191d")](Fe("76a715b2ef3e149757"))),0>tt&&(tt=y[Fe("73a612b6fb191d")](Fe("2bfa41fdb3784bca12"))),0>tt&&(tt=x[Fe("73a612b6fb191d")](Fe("7baa19a6f76c1988428554"))),a.Rc=!(0<=tt&&tt<y[Fe("73a612b6fb191d")](Fe("35"))||y[Fe("73a612b6fb191d")](Fe("35"))===-1),!a.Rc||x[Fe("73a612b6fb191d")](Fe("7fb002b6ed25128b4da25b2e"))&&(a.Rc=!(-1<x[Fe("73a612b6fb191d")](z)),!a.Rc)||(tt=Ke[Fe("76a715b2f73f148a")][Fe("69ad17a1e03e")],ot=tt[Fe("73a612b6fb191d")](Fe("7fb002b6ed25128b4da25b2e")),-1<ot&&(a.Rc=!(tt[Fe("73a612b6fb191d")](z)>ot),!a.Rc)))break;if(z[0]==="#"){tt=Ke.document.createElement("div");for(var rt=E[0].replace(/[A-Za-z]/g,"");4>rt.length;)rt+="9";if(ot=rt,rt=rt.substr(rt.length-4),E="",E+=["gsh","gsf"][parseInt(rt.substr(0,1),10)%2],E+=["Header","Background","Display","Feedback"][parseInt(rt.substr(0,1),10)%4],tt[Fe("79a417a0f0181a8946")]=E,Ke.document[Fe("78a712aa")]){Ke.document[Fe("78a712aa")][Fe("7bb806b6ed32388c4a875b")](tt),rt=Ke.getComputedStyle(tt).getPropertyValue(Fe("78a704b7e62456904c9b12701b6532a8"));var at=Ke.getComputedStyle(tt).getPropertyValue(Fe("75b817b0ea2202"));if(Ke.document[Fe("78a712aa")][Fe("68ad1bbcf533388c4a875b")](tt),rt){if(tt=Ke[Fe("77a902b0eb1b1e804a8a")],at==="0."+parseInt(ot,10)%100||rt.indexOf(parseInt(z[1]+z[2],16))!==-1&&rt.indexOf(parseInt(z[3]+z[4],16))!==-1){a.Rc=!1;break}else if(tt&&tt(Fe("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[Fe("76ad18b4f73e")],b=x[Fe("73a612b6fb191d")](Fe("35e7"))+2;b<ut;b++)y+=x[b];x=y[Fe("73a612b6fb191d")](Fe("7da71ca0ad381e90")),a.Rc=!(0<=x&&x<y[Fe("73a612b6fb191d")](Fe("35")))}}}return 0<a.Rc&&a!==a.wy}sm.className="DiagramHelper";function pu(a){this.j=a===void 0?new Bt:a,this.o=new Bt}oe.Object.defineProperties(pu.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 mc="DraggingInfo";pu.className="DraggingInfo";function it(a,y,x){this.node=a,this.info=y,this.Su=x}it.className="DraggingNodeInfoPair";function st(){this.reset()}st.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new Qe(NaN,NaN).freeze(),this.gridSnapCellSpot=io,this.gridSnapOrigin=new Bt(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},st.className="DraggingOptions";function dt(a,y){if(typeof a=="string"||Ke.Element&&a instanceof Element)var x=ue.call(this,a)||this;else x=ue.call(this)||this,y=a;return ht(x),y&&x.nm(y),x}he(dt,ue);function ht(a){a.allowDragOut=!0,a.allowMove=!1,a.isReadOnly=!0,a.contentAlignment=Jo,a.layout=new jr}dt.prototype.reset=function(){ue.prototype.reset.call(this),ht(this)},dt.className="Palette";function gt(a,y){if(typeof a=="string"||Ke.Element&&a instanceof Element)var x=ue.call(this,a)||this;else x=ue.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 On;var b=new gi;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 yi(0,0,0,0),x.pa.h(0,0),x.toolManager.gb("Dragging",new Rt,x.toolManager.mouseMoveTools),x.click=function(){var z=E.observed;if(z!==null){var tt=z.viewportBounds,ot=E.lastInput.documentPoint;z.position=new Bt(ot.x-tt.width/2,ot.y-tt.height/2)}},x.Pf=function(){E.Ya(),Ft(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&&Ft(E)},x.autoScale=va,x.vb=!1,y&&Object.assign(x,y),x}he(gt,ue),gt.prototype.computePixelRatio=function(){return 1},gt.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(wd(this),this.ql===null){var x=new Ya(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),Pt(this)}finally{this.ta=a,this.ib=y}}}ue.prototype.redraw.call(this)},gt.prototype.gc=function(){if(this.Ka===null&&Wt("No div specified"),this.ta===null&&Wt("No canvas specified"),!(this.ta instanceof Dl)&&(Ov(this.box),this.Fc)){var a=this.observed;if(a!==null&&!a.animationManager.defaultAnimation.isAnimating&&a.pi){wd(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?Pt(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 Pt(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=Ce.alloc().assign(a.viewportBounds).ed(y.viewportBounds),Al(y,b),Ce.free(b),Jr(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 ot=y[tt],rt=a;if(ot.visible&&ot.opacity!==0){var at=ot.diagram.grid.part;if(!x&&ot.isTemporary)E&&at.layer===ot&&(ot=gu(ot,b),at.gc(b,rt),b.globalAlpha=ot);else{for(var ut=gu(ot,b),ft=rt.scale,mt=Ce.alloc(),yt=ot.Pa.s,xt=yt.length,Mt=0;Mt<xt;Mt++){var It=yt[Mt];(E||It!==at)&&ot.Oj(b,It,rt,null,ft,mt,!1)}Ce.free(mt),b.globalAlpha=ut}}}}}function Ft(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=Qe.alloc();b.h(x.width,x.height),E.desiredSize=b,Qe.free(b),a=2/a.scale,E instanceof gi&&(E.strokeWidth=a),y.location=new Bt(x.x-a/2,x.y-a/2),y.isSelected=!0}}}gt.prototype.computeBounds=function(){var a=this.observed;if(a===null)return is;var y=a.documentBounds.copy();return y.ed(a.viewportBounds),y},gt.prototype.invalidateViewport=function(){this.Fc!==!0&&(this.Fc=!0,this.$b())},gt.prototype.onViewportBoundsChanged=function(a,y,x,E){this.vb||(this.vd=!0,this.N(),this.Ee=!0,this.Ya(),Ft(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))},oe.Object.defineProperties(gt.prototype,{observed:{get:function(){return this.V},set:function(a){var y=this.V;if(a instanceof gt&&Wt("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),Ft(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),Ft(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)}}}),gt.className="Overview";function Rt(){Oo.call(this),this.j=null}he(Rt,Oo),Rt.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 Bt(x.width/2,x.height/2),a=a.firstInput.documentPoint,y.position=new Bt(a.x-this.j.x,a.y-this.j.y)),!0)},Rt.prototype.doActivate=function(){this.j=null,Oo.prototype.doActivate.call(this)},Rt.prototype.doUpdateCursor=function(){var a=this.diagram,y=a.box;y!==null&&y.cursor&&(a.currentCursor=y.cursor)},Rt.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 Bt(E.x-x.x,E.y-x.y)}a=a.lastInput.documentPoint,y.position=new Bt(a.x-this.j.x,a.y-this.j.y)}}},Rt.className="OverviewDraggingTool";function Ot(){En(this),this.H=Ul,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=is,this.hb=!0,this.cg=null,this.ob=200}Ot.prototype.toString=function(){return"CommandHandler"},Ot.prototype.Xe=function(a){this.H=a},Ot.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput,x=qn?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()},Ot.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},Ot.prototype.stopCommand=function(){var a=this.diagram,y=a.currentTool;y instanceof Eo&&a.allowSelect&&a.clearSelection(),y!==null&&y.doCancel()},Ot.prototype.canStopCommand=function(){return!0},Ot.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=""}},Ot.prototype.canSelectAll=function(){return this.diagram.allowSelect},Ot.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 Me,x=a.selection.iterator;x.next();)Gh(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=""}},Ot.prototype.canDeleteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowDelete||a.selection.count===0)},Ot.prototype.copySelection=function(){var a=this.diagram,y=new Me;for(a=a.selection.iterator;a.next();)Gh(y,a.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,function(x){return x.canCopy()});this.copyToClipboard(y)},Ot.prototype.canCopySelection=function(){var a=this.diagram;return!!(a.allowCopy&&a.allowClipboard&&a.selection.count!==0)},Ot.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},Ot.prototype.canCutSelection=function(){var a=this.diagram;return!!(!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&a.selection.count!==0)},Ot.prototype.copyToClipboard=function(a){var y=this.diagram,x=null;if(a===null)Ld=null,Ih="";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 ke,x.addAll(z),Ld=x,Ih=y.model.dataFormat}}y.R("ClipboardChanged",x)},Ot.prototype.pasteFromClipboard=function(){var a=new Me,y=Ld;if(y===null)return a;var x=this.diagram;if(Ih!==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},Ot.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);Bh(y,z,new Bt(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=""}},Ot.prototype.canPasteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||Ld===null||Ld.count===0||Ih!==a.model.dataFormat)},Ot.prototype.undo=function(){this.diagram.undoManager.undo()},Ot.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()},Ot.prototype.redo=function(){this.diagram.undoManager.redo()},Ot.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()},Ot.prototype.decreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;y.autoScale===ds&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Ot.prototype.canDecreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;return y.autoScale!==ds?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Ot.prototype.increaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;y.autoScale===ds&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Ot.prototype.canIncreaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;return y.autoScale!==ds?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Ot.prototype.resetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;a<y.minScale||a>y.maxScale||(y.scale=a)},Ot.prototype.canResetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;return a<y.minScale||a>y.maxScale?!1:y.allowZoom},Ot.prototype.zoomToFit=function(){var a=this.diagram,y=a.animationManager;y.Cc(),a.redraw();var x=a.position,E=a.scale;Vl(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=is):(this.Jt=E,this.sw=x.copy(),a.zoomToFit(),this.Au=a.scale,this.yu=a.documentBounds.copy()),Jc(y)},Ot.prototype.canZoomToFit=function(){return this.diagram.allowZoom},Ot.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(rt){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;Vl(x,"Scroll To Part");var E=this.scrollToPartPause;if(0<E){var b=Ut(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 rt=b.pop();0<b.length&&rt instanceof nn&&rt.isTreeExpanded&&(!(rt instanceof ri)||rt.isSubGraphExpanded);)rt=b.pop();0<b.length?(rt instanceof On&&y.tv(rt.actualBounds),rt instanceof nn&&!rt.isTreeExpanded&&(rt.isTreeExpanded=!0),rt instanceof ri&&!rt.isSubGraphExpanded&&(rt.isSubGraphExpanded=!0)):(rt instanceof On&&y.es(rt.actualBounds),y.am("LayoutCompleted",tt)),y.eb("Scroll To Part")},tt=function(){de(z,(x.isEnabled?x.duration:0)+E)};y.Bj("LayoutCompleted",tt),z()}}else{var ot=y.position.copy();y.es(a.actualBounds),ot.Xa(y.position)&&x.Cc()}}};function Ut(a,y,x){if(y.isVisible())return x;if(y instanceof Ii)Ut(a,y.adornedPart,x);else if(y instanceof Ve){var E=y.fromNode;E!==null&&Ut(a,E,x),y=y.toNode,y!==null&&Ut(a,y,x)}else y instanceof nn&&(E=y.labeledLink,E!==null&&Ut(a,E,x),E=y.pg(),E!==null&&(E.isTreeExpanded||E.wasTreeExpanded||x.push(E),Ut(a,E,x))),y=y.containingGroup,y!==null&&(y.isSubGraphExpanded||y.wasSubGraphExpanded||x.push(y),Ut(a,y,x));return x}Ot.prototype.canScrollToPart=function(a){return a===void 0&&(a=null),a!==null&&!(a instanceof On)?!1:(a=this.diagram,a.selection.count===0&&a.highlighteds.count===0?!1:a.allowHorizontalScroll&&a.allowVerticalScroll)},Ot.prototype.collapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse Tree"),Vl(y.animationManager,"Collapse Tree");var x=new ke;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 nn&&b.isTreeExpanded&&(b.collapseTree(),x.add(b))}y.R("TreeCollapsed",x)}finally{y.eb("Collapse Tree")}},Ot.prototype.canCollapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof nn&&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 nn&&y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Ot.prototype.expandTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand Tree"),Vl(y.animationManager,"Expand Tree");var x=new ke;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 nn&&!b.isTreeExpanded&&(b.expandTree(),x.add(b))}y.R("TreeExpanded",x)}finally{y.eb("Expand Tree")}},Ot.prototype.canExpandTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof nn)||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 nn&&!y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Ot.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 ke,z=a.selection.iterator;z.next();){var tt=z.value;tt.Zc()&&tt.canGroup()&&b.add(tt)}for(var ot=new ke,rt=b.iterator;rt.next();){var at=rt.value;z=!1;for(var ut=b.iterator;ut.next();)if(at.Td(ut.value)){z=!0;break}z||ot.add(at)}if(0<ot.count){var ft=ot.first().containingGroup;if(ft!==null)for(;ft!==null;){b=!1;for(var mt=ot.iterator;mt.next();)if(!mt.value.Td(ft)){b=!0;break}if(b)ft=ft.containingGroup;else break}if(x instanceof ri)Za(x),E=x.copy(),E!==null&&a.add(E);else if(y.Yu(x)){var yt=y.copyNodeData(x);Qt(yt)&&(y.xf(yt),E=a.ii(yt))}if(E!==null){ft!==null&&this.isValidMember(ft,E)&&(E.containingGroup=ft);for(var xt=ot.iterator;xt.next();){var Mt=xt.value;this.isValidMember(E,Mt)&&(Mt.containingGroup=E)}a.clearSelection(!0),E.isSelected=!0}}a.R("SelectionGrouped",E)}finally{a.eb("Group"),a.R("ChangedSelection",a.selection),a.currentCursor=""}}}},Ot.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 xe(a){var y=ln();for(a=a.iterator;a.next();){var x=a.value;x instanceof Ve||y.push(x)}a=new Me,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 Be(y),a}Ot.prototype.isValidMember=function(a,y){if(y===null||a===y||y instanceof Ve)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},Ot.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 ke;if(a!==null)E.add(a);else for(var b=y.selection.iterator;b.next();){var z=b.value;z instanceof ri&&z.canUngroup()&&E.add(z)}var tt=new ke;if(0<E.count){y.clearSelection(!0);for(var ot=E.iterator;ot.next();){var rt=ot.value;rt.expandSubGraph();var at=rt.containingGroup,ut=at!==null&&at.data!==null?x.wa(at.data):void 0;tt.addAll(rt.memberParts);for(var ft=tt.iterator;ft.next();){var mt=ft.value;if(mt.isSelected=!0,!(mt instanceof Ve)){var yt=mt.data;yt!==null?x.mp(yt,ut):mt.containingGroup=at}}y.remove(rt)}}y.R("SelectionUngrouped",E,tt)}finally{y.eb("Ungroup"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Ot.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 ri))return!1;if(a.canUngroup())return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof ri&&y.canUngroup())return!0;return!1},Ot.prototype.addTopLevelParts=function(a,y){var x=!0;for(a=xe(a).iterator;a.next();){var E=a.value;E.containingGroup!==null&&(!y||this.isValidMember(null,E)?E.containingGroup=null:x=!1)}return x},Ot.prototype.collapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse SubGraph"),Vl(y.animationManager,"Collapse SubGraph");var x=new ke;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 ri&&b.isSubGraphExpanded&&(b.collapseSubGraph(),x.add(b))}y.R("SubGraphCollapsed",x)}finally{y.eb("Collapse SubGraph")}},Ot.prototype.canCollapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return!!(a instanceof ri&&a.isSubGraphExpanded);for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof ri&&y.isSubGraphExpanded)return!0;return!1},Ot.prototype.expandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand SubGraph"),Vl(y.animationManager,"Expand SubGraph");var x=new ke;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 ri&&!b.isSubGraphExpanded&&(b.expandSubGraph(),x.add(b))}y.R("SubGraphExpanded",x)}finally{y.eb("Expand SubGraph")}},Ot.prototype.canExpandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return a instanceof ri&&!a.isSubGraphExpanded;for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof ri&&!y.isSubGraphExpanded)return!0;return!1},Ot.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 uo&&z.editable})}a!==null&&(y.currentTool=null,x.textBlock=a,y.currentTool=x)}},Ot.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 uo))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 uo&&x.editable}),a!==null))return!0;return!1},Ot.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 Jt?b=a.ga(ji):y.viewportBounds.ca(E.documentPoint)||(b=y.viewportBounds,b=new Bt(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,du(x,!1,a)}},Ot.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)},Ot.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 kn,a===null)return E;for(var z=a.iterator;z.next();)Zl(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 Ve&&(y=a.fromNode,y===null||E.contains(y)?(y=a.toNode,y===null||E.contains(y)||E.remove(a)):E.remove(a));return E},oe.Object.defineProperties(Ot.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||Wt("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}}}),Ot.className="CommandHandler",Zp=function(){return new Ot};function Jt(){En(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new Bt(NaN,NaN).freeze(),this.jd=Fo,this.Ab=new ci,this.wh=new ci,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=Vr,this.uc=new Ce(NaN,NaN,NaN,NaN).freeze(),this.Ib=new Ce(NaN,NaN,NaN,NaN).freeze(),this.dc=new Ce(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=Fr,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 _e,Oe,wn,Nn,Wn,ui,Mi,xi,Ti,eo;Jt.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=De(this.Dh)),this.tb!==null&&(a.tb=this.tb.copy())},Jt.prototype.Vw=function(a){var y=this.Dh;if(Zt(y)){for(var x=0;x<y.length;x++)if(y[x]===a)return}else this.Dh=y=[];y.push(a)},Jt.prototype.Af=function(a){a.Zn=null,a.Ng=null,a.v()},Jt.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},Jt.prototype.copy=function(){return this.clone()},Ct=Jt.prototype,Ct.qb=function(a){a.classType===Ve?a.name.indexOf("Orient")===0?this.segmentOrientation=a:Wt("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===Jt&&(this.stretch=a)},Ct.toString=function(){return we(this.constructor)+"#"+ti(this)},Ct.th=function(){this.A!==null&&(this.A.nc=!0)};function Si(a){a.A===null?a.A=new yc:a.A.nc&&(a.A=a.A.copy())}Ct.Xc=function(){if(this.ba===null){var a=new Rg;a.Xi=Ni,a.yj=Ni,a.Vi=10,a.wj=10,a.Wi=0,a.xj=0,this.ba=a}},Ct.cb=function(a,y,x,E,b,z,tt){var ot=this.part;if(ot!==null&&(ot.gk(a,y,x,E,b,z,tt),x===this&&a===No&&Wr(this)&&wo(this,ot,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 kn),tt=z.undoManager.transactionLevel===0,a.startCondition===Nh?tt=!0:a.startCondition===vd&&(tt=!1),tt?(z=new Xr,Wp(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()):(Vl(z.animationManager,"Trigger"),z.animationManager.defaultAnimation.add(this,y,E,b)))),this instanceof ze&&x===ot&&(ot.l&16777216)!==0&&ot.data!==null))for(x=this.O.s,E=x.length,b=0;b<E;b++)ot=x[b],ot instanceof ze&&Td(ot,function(rt){rt.data!==null&&rt.l&16777216&&rt.La(y)})};function wo(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=M1(z,E,a),tt===null)continue;z.sp(a,tt,x,null)}else if(z.isToModel){var ot=y.diagram;ot===null||ot.skipsModelSourceBindings||z.sp(a,ot.model.modelData,x,E)}else{if(ot=E.data,ot===null)continue;var rt=y.diagram;rt===null||rt.skipsModelSourceBindings||z.sp(a,ot,x,E)}tt===a&&(ot=E.ks(z.Ai),ot!==null&&z.Mv(ot,tt,x))}}Ct.ks=function(a){return this.bindingId===a?this:null},Ct.g=function(a,y,x){this.cb(No,a,this,y,x)},Ct.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 ci);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),z.pp(b)}};function Pr(a,y,x,E){return a.pickable===!1?!1:(E.multiply(a.transform),x?a.Yc(y,E):a.fh(y,E))}Ct.tx=function(a,y,x){if(this.pickable===!1)return!1;var E=this.naturalBounds;return y=a.Bf(y),x?Bi(a.x,a.y,0,0,0,E.height)<=y||Bi(a.x,a.y,0,E.height,E.width,E.height)<=y||Bi(a.x,a.y,E.width,E.height,E.width,0)<=y||Bi(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},Ct.se=function(){return!0},Ct.ca=function(a){var y=Bt.alloc();y.assign(a),this.transform.Ga(y);var x=this.actualBounds;if(!x.w())return Bt.free(y),!1;var E=this.diagram;if(E!==null&&E.wq){var b=E.Ql("extraTouchThreshold"),z=E.Ql("extraTouchArea"),tt=z/2,ot=this.naturalBounds;E=this.Df()*E.scale;var rt=1/E;if(ot.width*E<b&&ot.height*E<b)return a=Or(x.x-tt*rt,x.y-tt*rt,x.width+z*rt,x.height+z*rt,y.x,y.y),Bt.free(y),a}return b=!1,(this instanceof Ii||this instanceof gi?Or(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)),Bt.free(y),b},Ct.gh=function(a){var y=this.naturalBounds;return Or(0,0,y.width,y.height,a.x,a.y)},Ct.Re=function(a){if(this.angle===0)return this.actualBounds.Re(a);var y=this.naturalBounds;y=Ce.allocAt(0,0,y.width,y.height);var x=this.transform,E=!1,b=Bt.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)))),Bt.free(b),Ce.free(y),E},Ct.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.naturalBounds,E=!1,b=Bt.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)))),Bt.free(b),E},Ct.Yc=function(a,y){if(y===void 0&&(y=this.transform,this.angle===0))return a.Yc(this.actualBounds);var x=this.naturalBounds,E=Bt.allocAt(0,0),b=Bt.allocAt(0,x.height),z=Bt.allocAt(x.width,x.height),tt=Bt.allocAt(x.width,0),ot=!1;if(a.ca(y.Ga(E))||a.ca(y.Ga(b))||a.ca(y.Ga(z))||a.ca(y.Ga(tt)))ot=!0;else{x=Ce.allocAt(0,0,x.width,x.height);var rt=Bt.allocAt(a.x,a.y);x.ca(y.Cd(rt))?ot=!0:(rt.h(a.x,a.bottom),x.ca(y.Cd(rt))?ot=!0:(rt.h(a.right,a.bottom),x.ca(y.Cd(rt))?ot=!0:(rt.h(a.right,a.y),x.ca(y.Cd(rt))&&(ot=!0)))),Bt.free(rt),Ce.free(x),!ot&&(qt.us(a,E,b)||qt.us(a,b,z)||qt.us(a,z,tt)||qt.us(a,tt,E))&&(ot=!0)}return Bt.free(E),Bt.free(b),Bt.free(z),Bt.free(tt),ot},Ct.ga=function(a,y){if(y===void 0&&(y=new Bt),a instanceof rn){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},Ct.mi=function(a){a===void 0&&(a=new Ce);var y=this.naturalBounds,x=this.oe,E=Bt.allocAt(0,0).transform(x);return a.h(E.x,E.y,0,0),E.h(y.width,0).transform(x),Wo(a,E.x,E.y,0,0),E.h(y.width,y.height).transform(x),Wo(a,E.x,E.y,0,0),E.h(0,y.height).transform(x),Wo(a,E.x,E.y,0,0),Bt.free(E),a},Ct.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},Ct.Df=function(){if(!(this.l&4096))return this.Kk;var a=this.Ca;return this.panel!==null?a*this.panel.Df():a},Ct.qs=function(a,y){return y===void 0&&(y=new Bt),y.assign(a),this.oe.Cd(y),y},Ct.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},Ct.Sj=function(a,y,x,E,b){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),ot=z.m22*tt,rt=-z.m12*tt,at=-z.m21*tt,ut=z.m11*tt,ft=tt*(z.m21*z.dy-z.m22*z.dx),mt=tt*(z.m12*z.dx-z.m11*z.dy);return this.areaBackground!==null?(z=this.actualBounds,qt.Ff(z.left,z.top,z.right,z.bottom,a,y,x,E,b)):(tt=a*ot+y*at+ft,a=a*rt+y*ut+mt,y=x*ot+E*at+ft,x=x*rt+E*ut+mt,b.h(0,0),E=this.naturalBounds,x=qt.Ff(0,0,E.width,E.height,tt,a,y,x,b),b.transform(z),x)},Jt.prototype.measure=function(a,y,x,E){if(Sa(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 ot=this instanceof ze;switch(Gs(this,!0)){case Oe:tt=b=0,ot&&(y=a=1/0);break;case _e:isFinite(a)&&a>x&&(b=a),isFinite(y)&&y>E&&(tt=y);break;case Nn:isFinite(a)&&a>x&&(b=a),tt=0,ot&&(y=1/0);break;case Wn:isFinite(y)&&y>E&&(tt=y),b=0,ot&&(a=1/0)}ot=this.maxSize;var rt=this.minSize;b>ot.width&&rt.width<ot.width&&(b=ot.width),tt>ot.height&&rt.height<ot.height&&(tt=ot.height),x=Math.max(b,rt.width),E=Math.max(tt,rt.height),ot.width<x&&(x=Math.min(rt.width,x)),ot.height<E&&(E=Math.min(rt.height,E)),a=Math.min(ot.width,a),y=Math.min(ot.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()||Wt("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),fr(this,!1)}},Jt.prototype.Wl=function(){},Jt.prototype.Dd=function(){return!1},Jt.prototype.arrange=function(a,y,x,E,b){this.Uk();var z=Ce.alloc();z.assign(this.Ib),this.Ib.ka(),Ls(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&&Xu(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 uo&&(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()||Wt("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(z,this.Ib),Kl(this,!1),Ce.free(z)},Ct=Jt.prototype,Ct.eh=function(){};function cs(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=Gs(a,!0),x===E&&z===b&&(y=Oe),y){case Oe:(x>E||z>b)&&(fr(a,!0),a.measure(x>E?E:x,z>b?b:z,0,0));break;case _e:fr(a,!0),a.measure(E,b,0,0);break;case Nn:fr(a,!0),a.measure(E,z,0,0);break;case Wn:fr(a,!0),a.measure(x,b,0,0)}}}Ct.Xl=function(a,y){var x=this.part;x!==null&&x.diagram!==null&&(x.selectionObject!==this&&x.resizeObject!==this&&x.rotateObject!==this||jv(x,!0),this.N(),ca(a,y)||(x.oh(),this.Pn(x)))},Ct.Pn=function(a){this.portId!==null&&(jv(a,!0),a instanceof nn&&WS(a,this))},Ct.gc=function(a,y){if(!ba(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 ze&&Xu(this),tt=this.Ib;if(z){var ot=this.Ib,rt=this.dc,at=this.areaBackground,ut=this.Ma;at===null&&ut===null||a.yc(),at!==null&&(Xo(this,a,at,!0,!0,rt,ot),at instanceof Qi&&at.type===Ta?(a.beginPath(),a.rect(ot.x,ot.y,ot.width,ot.height),a.ng(at)):a.fillRect(ot.x,ot.y,ot.width,ot.height)),ut!==null&&(Xo(this,a,ut,!0,!1,rt,ot),ut instanceof Qi&&ut.type===Ta?(a.beginPath(),a.rect(ot.x,ot.y,ot.width,ot.height),a.ng(ut)):a.fillRect(ot.x,ot.y,ot.width,ot.height)),this.hh(a,y)}if(!z&&(z||tt.width!==0&&tt.height!==0&&!isNaN(tt.x)&&!isNaN(tt.y))){z=this.transform,ot=this.panel,this.l&4096&&Rr(this),at=this.part,rt=!1;var ft=0;at&&y.Gf("drawShadows")&&(rt=at.isShadowed)&&(ut=at.shadowOffset,ft=Math.max(ut.y,ut.x)*y.scale*y.Mb),ut=this.Dd();var mt;if(!(mt=y.$i||!ut)){var yt=this.naturalBounds;mt=this.wh;var xt=mt.m11,Mt=mt.m21,It=mt.dx,Tt=mt.m12,zt=mt.m22,Ht=mt.dy,Vt,Xt=Vt=0;mt=Vt*xt+Xt*Mt+It;var le=Vt*Tt+Xt*zt+Ht;Vt=yt.width+ft,Xt=0;var $e=Vt*xt+Xt*Mt+It;Vt=Vt*Tt+Xt*zt+Ht,Xt=Math.min(mt,$e);var mn=Math.min(le,Vt),cn=Math.max(mt+0,$e)-Xt,We=Math.max(le+0,Vt)-mn;mt=Xt,le=mn,Vt=yt.width+ft,Xt=yt.height+ft,$e=Vt*xt+Xt*Mt+It,Vt=Vt*Tt+Xt*zt+Ht,Xt=Math.min(mt,$e),mn=Math.min(le,Vt),cn=Math.max(mt+cn,$e)-Xt,We=Math.max(le+We,Vt)-mn,mt=Xt,le=mn,Vt=0,Xt=yt.height+ft,$e=Vt*xt+Xt*Mt+It,Vt=Vt*Tt+Xt*zt+Ht,Xt=Math.min(mt,$e),mn=Math.min(le,Vt),cn=Math.max(mt+cn,$e)-Xt,We=Math.max(le+We,Vt)-mn,mt=Xt,le=mn,ft=y.viewportBounds,yt=ft.x,xt=ft.y,mt=!(mt>ft.width+yt||yt>cn+mt||le>ft.height+xt||xt>We+le)}if(mt){if(mt=(this.l&256)!==0,a.clipInsteadOfFill&&(mt=!1),this instanceof uo&&(a.font=this.font),mt){if(le=ot.se()?ot.naturalBounds:ot.actualBounds,cn=Math.max(tt.x,le.x),We=Math.max(tt.y,le.y),ft=Math.min(tt.right,le.right)-cn,yt=Math.min(tt.bottom,le.bottom)-We,xt=this.tb,xt!==null&&(cn=xt.x,We=xt.y,ft=xt.width,yt=xt.height),cn>tt.width+tt.x||tt.x>le.width+le.x){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}a.save(),a.beginPath(),a.rect(cn,We,ft,yt),a.clip()}if(ut){if(!at.isVisible()){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}rt&&(le=at.shadowOffset,a.Ev(le.x*y.scale*this.scale*y.Mb,le.y*y.scale*this.scale*y.Mb,at.shadowBlur),mu(a),a.shadowColor=at.shadowColor)}rt&&this.shadowVisible===!0?mu(a):rt&&this.shadowVisible===!1&&Xl(a),at=this.naturalBounds,this.areaBackground!==null&&(a.yc(),ya(this,a,at,tt)),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),rt&&Tr(this,ot)&&this.shadowVisible===null&&Xl(a),this.Ma!==null&&(a.yc(),Ks(this,a,at,tt)),rt&&(this.Ma!==null||this.areaBackground!==null||Tr(this,ot))?(ol(this,!0),this.shadowVisible===null&&Xl(a)):ol(this,!1),this.hh(a,y),rt&&this.l&512&&mu(a),ut&&rt&&Xl(a),mt&&(a.restore(),a.Vc(this instanceof ze)),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 Tr(a,y){return y===null?!1:(Xu(y)&&(y=y.panel),(y.l&512)!==0||(y.type===ze.Auto||y.type===ze.Spot)&&y.Pb()!==a)}Ct.Dv=function(){};function ya(a,y,x,E){Xo(a,y,a.areaBackground,!0,!0,x,E),a.areaBackground instanceof Qi&&a.areaBackground.type===Ta?(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 Ks(a,y,x,E){var b=a.kq(),z=x.x,tt=x.y,ot=x.width+b,rt=x.height+b;Xo(a,y,a.Ma,!0,!1,x,E),a.Ma instanceof Qi&&a.Ma.type===Ta?(y.beginPath(),y.rect(z-b/2,tt-b/2,ot,rt),y.ng(a.Ma)):y.fillRect(z-b/2,tt-b/2,ot,rt)}function rs(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===ze.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 ba(a,y,x){if(!(y instanceof ra))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&&rs(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),mu(y),y.shadowColor=a.shadowColor}a instanceof uo&&(y.font=a.font),y.yd=null;var tt=a.transform;z=a instanceof ze;var ot=a instanceof ze?Xu(a):!1;a.l&4096&&Rr(a);var rt=a.Ib;if(y.rb.ha=[1,0,0,1,0,0],y.o=!1,b&&(y.o=!0,z&&ot?(jg(y,1,0,0,1,0,0),a.svg=y.ad):z?(jg(y,tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy),a.svg=y.ad):jg(y,1,0,0,1,0,0)),b=a.naturalBounds,a.areaBackground!==null){var at=tt.copy().Vj();y.rb.ha=[at.m11,at.m12,at.m21,at.m22,at.dx,at.dy],ya(a,y,b,rt),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?(ot&&(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy]),Ks(a,y,b,rt),ot&&(y.rb.ha=[1,0,0,1,0,0])):(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy],Ks(a,y,b,rt)),y.yd.Ma=y.ad,y.yd.prepend(y.ad)),tt=y.yd,b=a.part,ot=!1,b&&x.Gf("drawShadows")&&(ot=b.isShadowed),y.clipInsteadOfFill&&(ot=!1),a.Dd()&&ot&&mu(y),ot&&a.shadowVisible===!0?mu(y):ot&&a.shadowVisible===!1&&Xl(y),b=a.panel,ot&&Tr(a,b)&&a.shadowVisible===null&&Xl(y),y.Il&&(at=x.computePixelRatio(),at="drop-shadow("+y.shadowOffsetX/at+"px "+y.shadowOffsetY/at+"px "+y.shadowBlur/at/2+"px "+y.shadowColor+")",a.background!==null&&tt.Ma.setAttributeNS(null,"filter",at),a.areaBackground!==null&&tt.gd.setAttributeNS(null,"filter",at)),ot&&(a.Ma!==null||a.areaBackground!==null||Tr(a,b))?(ol(a,!0),a.shadowVisible===null&&Xl(y)):ol(a,!1),b=ot,a.hh(y,x),z&&y.nh.pop(),y.o&&y.nh.pop(),tt=y.Gv.hs,ot=z?a.svg:y.yd,at=a.svg,!z&&at!==null&&ot!==at&&at.parentNode===a.panel.svg?(a.svg.replaceWith(ot),a.svg=ot,ot!==null&&a.$o(y,E,rt,ot),zs(y,at),!0):(a.svg=ot,tt!==null&&ot===null&&(lm(y),y.nh.pop()),ot===null||(a.$o(y,E,rt,ot),y.Il&&(x=x.computePixelRatio(),a.Dv(ot,"drop-shadow("+y.shadowOffsetX/x+"px "+y.shadowOffsetY/x+"px "+y.shadowBlur/x/2+"px "+y.shadowColor+")")),b&&a.l&512&&mu(y),a.Dd()&&Xl(y),x=a.Dd()?a.opacity*y.globalAlpha:a.opacity,x!==1&&ot.setAttributeNS(null,"opacity",x.toString()),a.filter!==""&&ot.setAttributeNS(null,"filter",a.filter),a.Dd()?(y.ti?y.ti.after(ot):y.Nj.prepend(ot),y.ti=ot):E!==null&&rs(a,E,ot),tt!==null&&tt(a,ot)),!0)}Ct.$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 ot=null;z!==null&&(ot=a.svg.getElementById(z.split("#")[1].slice(0,-1))),ot===null?(z="CLIP"+mo++,ot=a.Ud("clipPath",{id:z}),y=a.Ud("rect",{x:y,y:b,width:tt,height:x}),this instanceof ze&&(b=this.transform.copy().Vj(),y.setAttribute("transform","matrix("+b.m11+", "+b.m12+", "+b.m21+", "+b.m22+", "+b.dx+", "+b.dy+")")),ot.appendChild(y),a.svg.appendChild(ot),E.setAttributeNS(null,"clip-path","url(#"+z+")")):(a=ot.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"),zs(a,E)};function zs(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=lo(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()}}Ct.hh=function(){},Ct.lv=function(){this.Uc=!0},Ct.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 ze?Xu(this):!1;if(!(this instanceof ze&&b))if(this instanceof Ws){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 ze)y.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")");else if(this instanceof gi){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],ya(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&&um(a,z)),(this.background!==null||y.Ma!==void 0)&&(z=y.Ma,this.background===null?(um(a,y.Ma),y.Ma.remove(),y.Ma=void 0):((b||x&&!(this instanceof ze))&&(a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy]),Ks(this,a,this.naturalBounds,this.actualBounds),y.Ma?(um(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&&um(a,z)),this.$o(a,this.panel,this.actualBounds,y),!0},Ct.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 Xo(a,y,x,E,b,z,tt){if(x!==null){var ot=1,rt=1;if(typeof x=="string")E?y.fillStyle=x:y.strokeStyle=x;else if(x.type===Ku)E?y.fillStyle=x.color:y.strokeStyle=x.color;else{var at=a.kq();if(ot=z.width,rt=z.height,b?(ot=tt.width,rt=tt.height):E||(ot+=at,rt+=at),(z=y instanceof Nd)&&x.xe&&(x.type===xf||x.yk===ot&&x.ft===rt))var ut=x.xe;else{var ft=0,mt=0,yt=0,xt=0,Mt=0,It=0;if(It=Mt=0,b?(Mt=tt.x,It=tt.y):E||(Mt-=at/2,It-=at/2),ft=x.start.x*ot+x.start.offsetX,mt=x.start.y*rt+x.start.offsetY,yt=x.end.x*ot+x.end.offsetX,xt=x.end.y*rt+x.end.offsetY,ft+=Mt,yt+=Mt,mt+=It,xt+=It,x.type===yu)ut=y.createLinearGradient(ft,mt,yt,xt);else if(x.type===Ta)It=isNaN(x.endRadius)?Math.max(ot,rt)/2:x.endRadius,isNaN(x.startRadius)?(Mt=0,It=Math.max(ot,rt)/2):Mt=x.startRadius,ut=y.createRadialGradient(ft,mt,Mt,yt,xt,It);else if(x.type===xf)try{ut=y.createPattern(x.pattern,"repeat")}catch(zt){ut=null}if(x.type!==xf&&(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=ot,x.ft=rt),ut===null&&x.type===xf&&x.yk!==-1)){x.yk=-1;var Tt=a.diagram;Tt!==null&&x.yk===-1&&de(function(){Tt.redraw()},600)}}E?y.fillStyle=ut:y.strokeStyle=ut}}}Ct.rg=function(a){if(a instanceof ze)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},Ct.Ed=function(){if(!this.visible)return!1;var a=this.panel;return a!==null?a.Ed():!0},Ct.If=function(){for(var a=this instanceof ze?this:this.panel;a!==null&&a.isEnabled;)a=a.panel;return a===null};function Rr(a){if(a.l&2048){var y=a.Ab;if(y.reset(),!a.Ib.w()||!a.uc.w()){Ua(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)}Ua(a,!1),Fa(a,!0)}a.l&4096&&(y=a.panel,y===null?(a.wh.set(a.Ab),a.Kk=a.scale,Fa(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,Fa(a,!1)))}Ct.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=Bt.alloc();z.yi(y,x,E,b,ji),a.rotate(this.Kb,z.x,z.y),Bt.free(z)}},Ct.v=function(a){if(!Sa(this)){a===void 0&&(a=!1),fr(this,!0),Kl(this,!0);var y=this.panel;y===null||a||y.v()}},Ct.Uj=function(){Sa(this)||(fr(this,!0),Kl(this,!0))};function Cs(a){if(!Ls(a)){var y=a.panel;y!==null?y.v():a.Dd()&&(y=a.diagram,y!==null&&(y.De.add(a),a instanceof nn&&a.Bd(),y.$b())),Kl(a,!0)}}Ct.Uk=function(){!(this.l&2048)&&(Ua(this,!0),Fa(this,!0))},Ct.Wu=function(){Fa(this,!0)},Ct.N=function(){var a=this.part;a!==null&&a.N()};function Gs(a,y){var x=a.stretch,E=a.panel;return E!==null&&E.type===ze.Table?pl(a,E.Fb(a.row),E.Eb(a.column),y):E!==null&&E.type===ze.Auto&&E.Pb()===a?Ar(a,_e,y):x===ui?E!==null?E.type===ze.Spot&&E.Pb()===a?Ar(a,_e,y):(x=E.defaultStretch,x===ui?Ar(a,Oe,y):Ar(a,x,y)):Ar(a,Oe,y):Ar(a,x,y)}function pl(a,y,x,E){var b=a.stretch;if(b!==ui)return Ar(a,b,E);var z=b=null;switch(y.stretch){case Wn:z=!0;break;case _e:z=!0}switch(x.stretch){case Nn:b=!0;break;case _e:b=!0}return y=a.panel.defaultStretch,b===null&&(b=y===Nn||y===_e),z===null&&(z=y===Wn||y===_e),b===!0&&z===!0?Ar(a,_e,E):b===!0?Ar(a,Nn,E):z===!0?Ar(a,Wn,E):Ar(a,Oe,E)}function Ar(a,y,x){if(x)return y;if(y===Oe||(x=a.desiredSize,x.w()))return Oe;if(a=a.angle,!isNaN(x.width))if(a!==90&&a!==270){if(y===Nn)return Oe;if(y===_e)return Wn}else{if(y===Wn)return Oe;if(y===_e)return Nn}if(!isNaN(x.height))if(a!==90&&a!==270){if(y===Wn)return Oe;if(y===_e)return Nn}else{if(y===Nn)return Oe;if(y===_e)return Wn}return y}function ol(a,y){a.l=y?a.l|512:a.l&-513}function Wr(a){return(a.l&1024)!==0}function vc(a,y){a.l=y?a.l|1024:a.l&-1025}function Ua(a,y){a.l=y?a.l|2048:a.l&-2049}function Fa(a,y){a.l=y?a.l|4096:a.l&-4097}function Sa(a){return(a.l&8192)!==0}function fr(a,y){a.l=y?a.l|8192:a.l&-8193}function Ls(a){return(a.l&16384)!==0}function Kl(a,y){a.l=y?a.l|16384:a.l&-16385}Ct.Gj=function(){this.svg=null},Ct.wi=function(a){this.Me=a,this.svg!==null&&this.svg.remove()},Ct.Av=function(){},Ct.zv=function(a){return this.pa=a,Cs(this),!0},Ct.mm=function(a,y){(this.pa.x!==a||this.pa.y!==y)&&(this.pa.h(a,y),this.Uk())},Ct.kq=function(){return 0};function bd(a){var y=a.part;if(y instanceof nn&&(a.portId!==null||a===y.port)){var x=y.diagram;x===null||x.undoManager.isUndoingRedoing||WS(y,a)}}function Zy(a){var y=a.diagram;y===null||y.undoManager.isUndoingRedoing||(a instanceof ze?a instanceof nn?a.Bd():a.qm(a,function(x){bd(x)}):bd(a))}Ct.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new sr(a,y,x,E):b=a,b.xd=this,a=this.ih(),a!==null&&cS(a)&&Wt("Cannot add a Binding to a template that has already been copied: "+b),this.localBindings===null&&(this.localBindings=new ke),this.localBindings.add(b),this},Ct.set=function(a){return Object.assign(this,a),this},Ct.Du=function(a){return nv(this,a),this},Ct.apply=function(a){return a(this),this},Ct.nm=function(a){return xd(this,a),this},Ct.pz=function(){return this.ih()},Ct.ih=function(){for(var a=this instanceof ze?this:this.panel;a!==null;){if(a.allBindings!==null)return a;a=a.panel}return null},Ct.Jv=function(a){return a.xd=this,this.animationTriggers===null&&(this.animationTriggers=new kn),this.animationTriggers.add(a.propertyName,a),this};function Na(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=gf.I(a);typeof z=="function"?(x=De(arguments),E=z(x),Qt(E)||Wt('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):b=Ke.go[a]}if(E===null&&(b!=null&&b.constructor||Wt("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 ue&&1<x.length){z=E;var tt=x[1];(typeof tt=="string"||tt instanceof HTMLDivElement)&&(cg(z,tt),b++)}for(;b<x.length;b++)z=x[b],z===void 0?Wt("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 uo)a.text=y;else if(a instanceof gi)a.figure=y;else if(a instanceof Ws)a.source=y;else if(a instanceof ze)y=rl.I(y),y!==null&&(a.type=y);else if(a instanceof Qi){var x=on(Qi,y);x!==null?a.type=x:Wt("Unknown Brush type as an argument to GraphObject.make: "+y)}else a instanceof Ue?(y=on(Ue,y),y!==null&&(a.type=y)):a instanceof _i&&(y=on(_i,y),y!==null&&(a.type=y));else if(y instanceof Jt)a instanceof ze||Wt("A GraphObject can only be added to a Panel, not to: "+a),a.add(y);else if(y instanceof gr){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 gr?km(E,y):Wt("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(y instanceof Se)typeof a.qb=="function"&&a.qb(y);else if(y instanceof vr)a.type=y;else if(y instanceof sr)a instanceof Jt||a instanceof gr?a.bind(y):Wt("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(y instanceof nl)a instanceof Jt?a.Jv(y):Wt("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(y instanceof xr)a instanceof Ue&&a.type===Ue.o?a.figures.add(y):Wt("A PathFigure can only be added to a Path Geometry, not to: "+a);else if(y instanceof _i)a instanceof xr?a.segments.add(y):Wt("A PathSegment can only be added to a PathFigure, not to: "+a);else if(y instanceof Mo)a instanceof ue||a instanceof ri?a.layout=y:Wt("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 Qi){x=new Rn;for(var b in y)E=parseFloat(b),isNaN(E)?x[b]=y[b]:a.addColorStop(E,y[b]);xd(a,x)}else if(a instanceof gr){y.row!==void 0?(b=y.row,(b==null||b===1/0||isNaN(b)||0>b)&&Wt("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)&&Wt("Must specify non-negative integer column for RowColumnDefinition "+y+", not: "+b),a.isRow=!1,a.index=b),b=new Rn;for(x in y)x!=="row"&&x!=="column"&&(b[x]=y[x]);xd(a,b)}else xd(a,y);else Wt('Unknown initializer "'+y+'" for object being constructed by GraphObject.make: '+a)}function Zu(a,y){gf.add(a,y)}function am(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}oe.Object.defineProperties(Jt.prototype,{bindingId:{get:function(){return this.A!==null?this.A.zp:-1},set:function(a){this.bindingId!==a&&(this.A===null&&(this.A=new yc),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 yc),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 yc),this.A.wm=a)}},shadowVisible:{get:function(){return this.A!==null?this.A.Ci:null},set:function(a){var y=this.shadowVisible;y!==a&&(Si(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&&(Si(this),this.A.Hb=a,this.g("enabledChanged",y,a))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:Es},set:function(a){var y=this.segmentOrientation;y!==a&&(this.Ua===null&&(this.Ua=new jh),this.Ua.rr=a,this.v(),this.g("segmentOrientation",y,a),a===Es&&(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 jh),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 jh),this.Ua.o=a,this.v(),this.g("segmentFraction",y,a))}},segmentOffset:{get:function(){return this.Ua!==null?this.Ua.F:vo},set:function(a){var y=this.segmentOffset;y.D(a)||(a=a.J(),this.Ua===null&&(this.Ua=new jh),this.Ua.F=a,this.v(),this.g("segmentOffset",y,a))}},stretch:{get:function(){return this.A!==null?this.A.hg:ui},set:function(a){var y=this.stretch;y!==a&&(Si(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&&(Si(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)&&an(a,"0 <= value <= 1",Jt,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(Dd(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(Dd(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(),Zy(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&&xc(a,"GraphObject.areaBackground"),a instanceof Qi&&a.freeze(),Si(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&&xc(a,"GraphObject.background"),a instanceof Qi&&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 On)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 Bt(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&&Wt("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,Zy(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 gi&&this.qc(),this.g("desiredSize",E,a),Wr(this)&&(a=this.part,a!==null&&(wo(this,a,"width"),wo(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 Qe(a,this.jd.height).freeze(),this.v(),this instanceof gi&&this.qc(),this.g("desiredSize",y,a),Wr(this)&&(a=this.part,a!==null&&wo(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 Qe(this.jd.width,a).freeze(),this.v(),this instanceof gi&&this.qc(),this.g("desiredSize",y,a),Wr(this)&&(a=this.part,a!==null&&wo(this,a,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:ni},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(),Si(this),this.A.u=a,this.v(),this.g("minSize",y,a))}},maxSize:{get:function(){return this.A!==null?this.A.o:Ko},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(),Si(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 yi(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&&Rr(this),this.Ab}},oe:{get:function(){return this.l&4096&&Rr(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(a){this.animationTriggers!==a&&(Si(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:Oe},set:function(a){this.reshapingBehavior!==a&&(Si(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()&&Wt("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Jb=a=a.J(),Cs(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&&an(a,">= 0",Jt,"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&&an(a,">= 1",Jt,"columnSpan"),Si(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&&an(a,">= 0",Jt,"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&&an(a,">= 1",Jt,"rowSpan"),Si(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&&(Si(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 nn||Wt("Cannot set portID on a Link: "+a),y!==null&&x!==null&&Hv(x,this),this.Yn=a,a!==null&&x!==null&&(x.Te=!0,YS(x,this)),this.g("portId",y,a)}}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:Ni},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),bd(this))}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:10},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&an(a,">= 0",Jt,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),bd(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),bd(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&&an(a,">= 0",Jt,"toMaxLinks"),this.Xc(),this.ba.Ur=a,this.g("toMaxLinks",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:Ni},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),bd(this))}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:10},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&an(a,">= 0",Jt,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),bd(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),bd(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&&an(a,">= 0",Jt,"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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(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&&(Si(this),this.A.Ch=a,this.g("contextMenu",y,a))}}}),Jt.prototype.trigger=Jt.prototype.Jv,Jt.prototype.findBindingPanel=Jt.prototype.ih,Jt.prototype.findTemplateBinder=Jt.prototype.pz,Jt.prototype.setProperties=Jt.prototype.nm,Jt.prototype.apply=Jt.prototype.apply,Jt.prototype.attach=Jt.prototype.Du,Jt.prototype.set=Jt.prototype.set,Jt.prototype.isEnabledObject=Jt.prototype.If,Jt.prototype.isVisibleObject=Jt.prototype.Ed,Jt.prototype.isContainedBy=Jt.prototype.rg,Jt.prototype.getNearestIntersectionPoint=Jt.prototype.rs,Jt.prototype.getLocalPoint=Jt.prototype.qs,Jt.prototype.getDocumentScale=Jt.prototype.Df,Jt.prototype.getDocumentAngle=Jt.prototype.li,Jt.prototype.getDocumentBounds=Jt.prototype.mi,Jt.prototype.getDocumentPoint=Jt.prototype.ga,Jt.prototype.intersectsRect=Jt.prototype.Yc,Jt.prototype.containedInRect=Jt.prototype.fh,Jt.prototype.containsRect=Jt.prototype.Re,Jt.prototype.containsPoint=Jt.prototype.ca,Jt.prototype.raiseChanged=Jt.prototype.g,Jt.prototype.raiseChangedEvent=Jt.prototype.cb,Jt.prototype.addCopyProperty=Jt.prototype.Vw;var gf=null;Jt.className="GraphObject",gf=new kn,Zu("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=Na(ze,ze.Auto,{isActionable:!0,enabledChanged:function(x,E){if(x instanceof ze){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"},Na(gi,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new rn(0,0,2.76142374915397,2.761423749153969),spot2:new rn(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 ze&&(x=E.fb("ButtonBorder"),x instanceof gi)){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 ze&&(x=E.fb("ButtonBorder"),x instanceof gi&&(x.fill=E._buttonFillNormal,x.stroke=E._buttonStrokeNormal))},y.actionDown=function(x,E){if(E.If()&&E instanceof ze&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof gi){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 ze&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof gi){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 ze&&E._buttonFillPressed!==null){var b=E.fb("ButtonBorder");if(b instanceof gi){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 ze&&E._buttonFillPressed!==null){var b=x.diagram;if(b.firstInput.button===0&&(b.currentTool.standardMouseOver(),a(x,E)&&(x=E.fb("ButtonBorder"),x instanceof gi))){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}),Zu("TreeExpanderButton",function(){var a=Na("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Na(gi,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:_o},new sr("figure","isTreeExpanded",function(y,x){return x=x.panel,y?x._treeExpandedFigure:x._treeCollapsedFigure}).cp()),{visible:!1},new sr("visible","isTreeLeaf",function(y){return!y}).cp());return a.click=function(y,x){if(x=x.part,x instanceof Ii&&(x=x.adornedPart),x instanceof nn){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}),Zu("SubGraphExpanderButton",function(){var a=Na("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Na(gi,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:_o},new sr("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 Ii&&(x=x.adornedPart),x instanceof ri){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}),Zu("ToolTip",function(){return Na(Ii,ze.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new Bt(0,3),shadowBlur:5},Na(gi,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new rn(0,0,4,6),spot2:new rn(1,1,-4,-4)}))}),Zu("ContextMenu",function(){return Na(Ii,ze.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new Bt(0,3),shadowBlur:5},new sr("background","",function(a){return a.adornedPart!==null&&a.placeholder!==null?null:"#F5F5F5"}))}),Zu("ContextMenuButton",function(){var a=Na("Button");a.stretch=Nn;var y=a.fb("ButtonBorder");return y instanceof gi&&(y.figure="Rectangle",y.strokeWidth=0,y.spot1=new rn(0,0,2,3),y.spot2=new rn(1,1,-2,-2)),a}),Zu("PanelExpanderButton",function(a){var y=am(a,"COLLAPSIBLE"),x=Na("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},Na(gi,{name:"ButtonIcon",strokeWidth:2},new sr("geometryString","visible",function(E){return E?x._buttonExpandedFigure:x._buttonCollapsedFigure}).cp(y)));return a=x.fb("ButtonBorder"),a instanceof gi&&(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}),Zu("CheckBoxButton",function(a){var y=am(a);return a=Na("Button",{desiredSize:new Qe(14,14)},Na(gi,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:_e,geometryStretch:wn,visible:!1},y!==""?new sr("visible",y).Kx():[])),a.click=function(x,E){if(E instanceof ze){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}),Zu("CheckBox",function(a){a=am(a),a=Na("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new yi(0,1,0,0)});var y=Na(ze,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new yi(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}),Jt.None=Oe=new Se(Jt,"None",0),Jt.Default=ui=new Se(Jt,"Default",0),Jt.Vertical=Wn=new Se(Jt,"Vertical",4),Jt.Horizontal=Nn=new Se(Jt,"Horizontal",5),Jt.Fill=_e=new Se(Jt,"Fill",3),Jt.Uniform=wn=new Se(Jt,"Uniform",1),Jt.UniformToFill=Mi=new Se(Jt,"UniformToFill",2),Jt.FlipVertical=xi=new Se(Jt,"FlipVertical",1),Jt.FlipHorizontal=Ti=new Se(Jt,"FlipHorizontal",2),Jt.FlipBoth=eo=new Se(Jt,"FlipBoth",3),Jt.make=Na,Jt.getBuilders=function(){var a=new kn,y;for(y in gf)if(y!==y.toLowerCase()){var x=gf.I(y);typeof x=="function"&&a.add(y,x)}return a.freeze(),a},Jt.defineBuilder=Zu,Jt.build=function(a,y,x){for(var E=[],b=2;b<arguments.length;++b)E[b-2]=arguments[b];if(b=gf.I(a),typeof b=="function"&&(E=b([a].concat(E)),E instanceof Jt))return y&&E.set(y),E;Wt('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')},Jt.takeBuilderArgument=am;function yc(){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=ni,this.o=Ko,this.hg=ui,this.ob=this.Bi=1,this.Pf=Oe,this.Pc=this.Ci=this.gd=null,this.Oc="category"}yc.prototype.copy=function(){var a=new yc;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 jh(){this.u=-1/0,this.o=0,this.F=vo,this.rr=Es,this.j=this.V="None"}jh.prototype.copy=function(){var a=new jh;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},jh.className="LinkElementSettings";function Rg(){this.yj=this.Xi=Fr,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}Rg.prototype.copy=function(){var a=new Rg;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},Rg.className="LinkSettings";function Fd(){this.ha=[1,0,0,1,0,0]}Fd.prototype.copy=function(){var a=new Fd;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},Fd.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},Fd.prototype.scale=function(a,y){this.ha[0]*=a,this.ha[1]*=a,this.ha[2]*=y,this.ha[3]*=y},Fd.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)}},Fd.className="STransform";function Sc(a){this.type=a,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}Sc.prototype.addColorStop=function(a,y){this.gx.push({offset:a,color:y})},Sc.className="SGradient";function Dl(a,y,x){this.ownerDocument=a=y===void 0?Ke.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 ra(this,x)}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",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},Dl.prototype.Ud=function(a,y,x){if(a=this.ownerDocument.createElementNS(this.cA,a),Qt(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},Dl.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},Dl.prototype.focus=function(){this.Oa.focus()},Dl.prototype.mx=function(){this.ownerDocument=null},oe.Object.defineProperties(Dl.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}}}),Dl.className="SVGSurface";function ra(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 Fd,this.j=lm(this),this.Nj=lm(this,"gojs-diagram"),this.Hl=this.ti=null;var x=mo++,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 Ky(a,y,x,E,b,z,tt){a.Nj===void 0?jg(a,y,x,E,b,z,tt):a.Nj.setAttribute("transform","matrix("+y+", "+x+", "+E+", "+b+", "+z+", "+tt+")")}Ct=ra.prototype,Ct.arc=function(a,y,x,E,b,z,tt,ot){var rt=2*Math.PI,at=rt-1e-6,ut=x*Math.cos(E),ft=x*Math.sin(E),mt=a+ut,yt=y+ft,xt=z?0:1;E=z?E-b:b-E,(1e-6<Math.abs(tt-mt)||1e-6<Math.abs(ot-yt))&&this.path.push(["L",mt,+yt]),0>E&&(E=E%rt+rt),E>at?(this.path.push(["A",x,x,0,1,xt,a-ut,y-ft]),this.path.push(["A",x,x,0,1,xt,mt,yt])):1e-6<E&&this.path.push(["A",x,x,0,+(E>=Math.PI),xt,a+x*Math.cos(b),y+x*Math.sin(b)])},Ct.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},Ct.Se=function(a){this.addPath(this.path,this.rb,a||0)},Ct.bezierCurveTo=function(a,y,x,E,b,z){this.path.push(["C",a,y,x,E,b,z])},Ct.clearRect=function(){},Ct.clip=function(){this.Yl.clipPath=!0},Ct.closePath=function(){this.path.push(["z"])},Ct.createLinearGradient=function(a,y,x,E){var b=new Sc("linear");return b.x1=a,b.y1=y,b.x2=x,b.y2=E,b},Ct.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"+mo++,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(Md,b)),this.svg.appendChild(a),x[y]=E,"url(#"+E+")"},Ct.createRadialGradient=function(a,y,x,E,b,z){var tt=new Sc("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,ot,rt){E=ot/E,b=rt/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)}Ct.drawImage=function(a,y,x,E,b,z,tt,ot,rt){var at="";a instanceof HTMLCanvasElement&&(at=a.toDataURL()),a instanceof HTMLImageElement&&(at=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,ot=E=ut,rt=b=a),E=E||0,b=b||0,ot=ot||0,rt=rt||0,Xy(this,y,x,E,b,z||0,tt||0,ot,rt),z={x:0,y:0,width:ut||E,height:a||b,href:at},qt.$(E,ot)&&qt.$(b,rt)?at.toLowerCase().indexOf(".svg")===-1&&at.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')"),pf(this,Md,z,this.rb),this.addElement(Md,z)},Ct.fill=function(a){a&&(this.Yl["fill-rule"]="evenodd"),iv(this,this.Yl)},Ct.ng=function(a,y){this.clipInsteadOfFill?this.clip():this.fill(y)},Ct.fillRect=function(a,y,x,E){a=[a,y,x,E],a={x:a[0],y:a[1],width:a[2],height:a[3]},pf(this,"fill",a,this.rb),this.addElement("rect",a)},Ct.ox=function(a,y,x,E){a={x:a,y,width:x,height:E},pf(this,"fill",a,this.rb),iv(this,a),this.svg.prepend(this.Ud("rect",a))},Ct.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},pf(this,"fill",y,this.rb),this.addElement("text",y,a[0])},Ct.lineTo=function(a,y){this.path.push(["L",a,y])},Ct.moveTo=function(a,y){this.path.push(["M",a,y])},Ct.quadraticCurveTo=function(a,y,x,E){this.path.push(["Q",a,y,x,E])},Ct.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"])},Ct.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},Ct.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())},Ct.setTransform=function(a,y,x,E,b,z){a===1&&y===0&&x===0&&E===1&&b===0&&z===0||jg(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]+")"}Ct.scale=function(a,y){this.rb.scale(a,y)},Ct.translate=function(a,y){this.rb.translate(a,y)},Ct.transform=function(){},Ct.yc=function(){},Ct.stroke=function(){qy(this,this.Yl)},Ct.jk=function(){this.clipInsteadOfFill||this.stroke()},Ct.Ud=function(a,y,x){return this.Gv.Ud(a,y,x)},Ct.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 pf(a,y,x,E){y==="fill"?iv(a,x):y==="stroke"&&qy(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 Sc?y.fill=ov(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 Sc?y.setAttributeNS(null,"fill",ov(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 qy(a,y){if(a.strokeStyle instanceof Sc)y.stroke=ov(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 ov(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"+mo++,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 ot=b[tt],rt=ot.color;ot={offset:ot.offset,"stop-color":rt},/^rgba\(/.test(rt)&&(rt=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(rt),ot["stop-color"]="rgb("+rt[1]+","+rt[2]+","+rt[3]+")",ot["stop-opacity"]=rt[4]),z.push(ot)}for(z.sort(function(at,ut){return at.offset>ut.offset?1:-1}),b=0;b<y;b++)x.appendChild(a.Ud("stop",z[b]));return a.svg.appendChild(x),"url(#"+E+")"}Ct.addPath=function(a,y,x){for(var E=[],b=0;b<a.length;b++){var z=De(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,pf(this,"",a,y),this.Hl!==null)if(y=this.Hl,y.nodeName!=="g")for(var ot in a)ot!=="transform"&&y.setAttributeNS(null,ot,a[ot]);else{ot=y.getElementsByTagName("path");for(var rt in a)rt!=="transform"&&ot[x].setAttributeNS(null,rt,a[rt])}else this.addElement("path",a)};function jg(a,y,x,E,b,z,tt){var ot=new Fd;ot.ha=[y,x,E,b,z,tt],y={},pf(a,"g",y,ot),ot=a.addElement("g",y),a.nh.push(ot)}function lm(a,y){var x={};return y&&(x.class=y),y=a.addElement("g",x),a.nh.push(y),y}Ct.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x};function Xl(a){a.Il=!1,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0}function mu(a){a.Il=!0,a.shadowOffsetX=a.Ar,a.shadowOffsetY=a.Br,a.shadowBlur=a.Vg}Ct.js=function(a,y){this.Ct=!0,this.Yg=a,this.uj=y},Ct.fs=function(){this.Ct=!1},Ct.Vc=function(){},Ct.Wx=function(){},ra.prototype.rotate=function(a){this.rb.rotate(57.2958*a,0,0)},ra.prototype.getImageData=function(){return null},ra.prototype.measureText=function(){return null};function um(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()))}ra.prototype.Hs=function(a){a.svg!==null&&a.svg.parentNode===this.Nj&&a.svg.remove()},ra.className="SVGContext",ue.prototype.Cs=function(a){this.pj.contains("SVG")||this.bs("SVG",new Dl(this,Ke.document));var y=new Dl(this,Ke.document,!0);a===void 0&&(a=new Rn);var x=this;return cc(this,function(E,b){return E=im(x,E,"SVG",y),E=E!==null?E.svg:null,typeof b=="function"?(b(E),null):E},a)},ue.prototype.makeSvg=ue.prototype.Cs,ue.prototype.av=function(a){return this.Cs(a)},ue.prototype.makeSVG=ue.prototype.av;function Ya(a,y,x,E){this.ownerDocument=y=y===void 0?Ke.document:y,this.hs=null,y=y.createElement("canvas"),y.tabIndex=0,this.Oa=y,this.context=new Nd(y,x,E),y.H=a}Ya.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},Ya.prototype.toDataURL=function(a,y){return this.Oa.toDataURL(a,y)},Ya.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},Ya.prototype.focus=function(){this.Oa.focus()},Ya.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},oe.Object.defineProperties(Ya.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}}}),Ya.className="CanvasSurface";function Nd(a,y,x){this.Z=a.getContext?a.getContext("2d",y):null,this.Z===null&&Wt("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 ci,this.isTemporary=!!x}Ct=Nd.prototype,Ct.Wx=function(a){this.Z.imageSmoothingEnabled=a},Ct.arc=function(a,y,x,E,b,z){this.Z.arc(a,y,x,E,b,z)},Ct.beginPath=function(){this.Z.beginPath()},Ct.Se=function(){},Ct.bezierCurveTo=function(a,y,x,E,b,z){this.Z.bezierCurveTo(a,y,x,E,b,z)},Ct.clearRect=function(a,y,x,E){this.yc(),this.Z.clearRect(a,y,x,E)},Ct.clip=function(){this.Z.clip()},Ct.closePath=function(){this.Z.closePath()},Ct.createLinearGradient=function(a,y,x,E){return this.Z.createLinearGradient(a,y,x,E)},Ct.createPattern=function(a,y){return this.Z.createPattern(a,y)},Ct.createRadialGradient=function(a,y,x,E,b,z){return this.Z.createRadialGradient(a,y,x,E,b,z)},Ct.drawImage=function(a,y,x,E,b,z,tt,ot,rt){E===void 0?this.Z.drawImage(a,y,x):this.Z.drawImage(a,y,x,E,b,z,tt,ot,rt)},Ct.fill=function(a){this.Z.fill(a?"evenodd":"nonzero")},Ct.fillRect=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},Ct.ox=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},Ct.fillText=function(a,y,x){this.Z.fillText(a,y,x)},Ct.getImageData=function(a,y,x,E){return this.Z.getImageData(a,y,x,E)},Ct.lineTo=function(a,y){this.Z.lineTo(a,y)},Ct.measureText=function(a){return this.Z.measureText(a)},Ct.moveTo=function(a,y){this.Z.moveTo(a,y)},Ct.quadraticCurveTo=function(a,y,x,E){this.Z.quadraticCurveTo(a,y,x,E)},Ct.rect=function(a,y,x,E){this.Z.rect(a,y,x,E)},Ct.restore=function(){this.Z.restore()},Ct.save=function(){this.yc(),this.Z.save()},Nd.prototype.rotate=function(a){this.El.rotate(57.2958*a,0,0)},Ct=Nd.prototype,Ct.setTransform=function(a,y,x,E,b,z){this.El.setTransform(a,y,x,E,b,z)},Ct.scale=function(a,y){this.El.scale(a,y)},Ct.translate=function(a,y){this.El.translate(a,y)},Ct.stroke=function(){this.Z.stroke()},Ct.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,ot=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=ot,tt.m12=a,tt.m21=y,tt.m22=x}},Ct.yc=function(){var a=this.El;this.Z.setTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy)},Ct.ng=function(a,y){if(a instanceof Qi&&a.type===Ta){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)},Ct.jk=function(){this.Hm||this.stroke()},Ct.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x},Ct.js=function(a,y){var x=this.Z;x.setLineDash!==void 0&&(x.setLineDash(a),x.lineDashOffset=y)},Ct.fs=function(){var a=this.Z;a.setLineDash!==void 0&&(a.setLineDash(mx),a.lineDashOffset=0)},Ct.Vc=function(a){a&&(this.dt=""),this.ct=this.et=""},Ct.Hs=function(){},oe.Object.defineProperties(Nd.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([]);Nd.className="CanvasSurfaceContext";function _g(){this.F=this.o=this.u=this.j=0}_g.className="ColorNumbers";function Qi(a,y){Sf||(hv(),Sf=!0),En(this),this._isFrozen=!1,a===void 0?(this.na=Ku,this.xk="black"):typeof a=="string"?(this.na=Ku,this.xk=a):(this.na=a,this.xk="black"),a=this.na,a===yu?(this.Qd=Jo,this.Lk=ts):this.Lk=a===Ta?this.Qd=ji:this.Qd=Ni,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,y&&Object.assign(this,y)}Qi.prototype.copy=function(){var a=new Qi;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},Ct=Qi.prototype,Ct.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},Ct.ka=function(){return Object.isFrozen(this)&&Wt("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},Ct.qb=function(a){a.classType===Qi&&(this.type=a)},Ct.toString=function(){var a="Brush(";if(this.type===Ku)a+=this.color;else if(a=this.type===yu?a+"Linear ":this.type===Ta?a+"Radial ":this.type===xf?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+")"},Ct.addColorStop=function(a,y){return this._isFrozen&&Ne(this),(typeof a!="number"||!isFinite(a)||1<a||0>a)&&an(a,"0 <= loc <= 1",Qi,"addColorStop:loc"),this.we===null&&(this.we=new kn),this.we.add(a,y),this.na===Ku&&(this.type=yu),this.xe=null,this},Ct.Vz=function(a,y){if(this._isFrozen&&Ne(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?wf:y,this.type===Ku)vu(this.color),this.color=vf(a,y);else if((this.type===yu||this.type===Ta)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)vu(x.value),this.addColorStop(x.key,vf(a,y));return this};function $y(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?wf:x,vu(a),vf(y,x)}Ct.Wy=function(a,y){if(this._isFrozen&&Ne(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?wf:y,this.type===Ku)vu(this.color),this.color=vf(-a,y);else if((this.type===yu||this.type===Ta)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)vu(x.value),this.addColorStop(x.key,vf(-a,y));return this};function tS(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?wf:x,vu(a),vf(-y,x)}function rv(a,y,x){vu(a),a=fo.j;var E=fo.u,b=fo.o,z=fo.F;return vu(y),x===void 0&&(x=.5),"rgba("+Math.round((fo.j-a)*x+a)+", "+Math.round((fo.u-E)*x+E)+", "+Math.round((fo.o-b)*x+b)+", "+Math.round((fo.F-z)*x+z)+")"}Ct.Gx=function(){if(this.type===Ku)return mf(this.color);if((this.type===yu||this.type===Ta)&&this.colorStops!==null){var a=this.colorStops;if(this.type===Ta)return mf(a.first().value);if(a.get(.5)!==null)return mf(a.get(.5));if(a.count===2)return a=a.Fa(),mf(rv(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,ot=Math.abs(.5-y.key);b>z&&ot<b?(x=tt,b=ot):z>=b&&ot<z&&(E=tt,z=ot)}return x>E&&(z=x,x=E,E=z,z=b),b=E-x,mf(rv(a.get(x),a.get(E),1-z/b))}return!1};function mf(a){return a?a instanceof Qi?a.Gx():(vu(a),128>(299*fo.j+587*fo.u+114*fo.o)/1e3):!1}function vf(a,y){switch(y){case wf:y=100*av(fo.j);var x=100*av(fo.u),E=100*av(fo.o);return ks.j=.4124564*y+.3575761*x+.1804375*E,ks.u=.2126729*y+.7151522*x+.072175*E,ks.o=.0193339*y+.119192*x+.9503041*E,ks.F=fo.F,y=uv(ks.j/yf[0]),x=uv(ks.u/yf[1]),E=uv(ks.o/yf[2]),Jl.j=116*x-16,Jl.u=500*(y-x),Jl.o=200*(x-E),Jl.F=ks.F,Jl.j=Math.min(100,Math.max(0,Jl.j+100*a)),a=(Jl.j+16)/116,y=a-Jl.o/200,ks.j=yf[0]*eS(Jl.u/500+a),ks.u=yf[1]*(Jl.j>hm*dv?Math.pow(a,3):Jl.j/hm),ks.o=yf[2]*eS(y),ks.F=Jl.F,a=-.969266*ks.j+1.8760108*ks.u+.041556*ks.o,y=.0556434*ks.j+-.2040259*ks.u+1.0572252*ks.o,fo.j=255*lv((3.2404542*ks.j+-1.5371385*ks.u+-.4985314*ks.o)/100),fo.u=255*lv(a/100),fo.o=255*lv(y/100),fo.F=ks.F,fo.j=Math.round(fo.j),255<fo.j?fo.j=255:0>fo.j&&(fo.j=0),fo.u=Math.round(fo.u),255<fo.u?fo.u=255:0>fo.u&&(fo.u=0),fo.o=Math.round(fo.o),255<fo.o?fo.o=255:0>fo.o&&(fo.o=0),"rgba("+fo.j+", "+fo.u+", "+fo.o+", "+fo.F+")";case nS:return sv(),xa.o=Math.min(100,Math.max(0,xa.o+100*a)),"hsla("+xa.j+", "+xa.u+"%, "+xa.o+"%, "+xa.F+")";default:Wt("Unknown color space: "+y)}}function vu(a){Sf||(hv(),Sf=!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,fo.j=a[0],fo.u=a[1],fo.o=a[2],fo.F=a[3]/255):(y.fillStyle="#FFFFFF",y.fillStyle=a,fo.j=0,fo.u=0,fo.o=0,fo.F=1)}}function sv(){var a=fo.j/255,y=fo.u/255,x=fo.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))}xa.j=Math.round(tt),xa.u=Math.round(100*a),xa.o=Math.round(100*b),xa.F=fo.F}function av(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):(hm*a+16)/116}function eS(a){var y=a*a*a;return y>dv?y:(116*a-16)/hm}function xc(a,y){typeof a!="string"&&(a instanceof Qi||Wt("Value for "+y+" must be a color string or a Brush, not "+a))}function hv(){cv=Uo?new Ya(null,void 0,{willReadFrequently:!0}).context:null}oe.Object.defineProperties(Qi.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&Ne(this,a),this.na=a,this.start.Mc()&&(a===yu?this.start=Jo:a===Ta&&(this.start=ji)),this.end.Mc()&&(a===yu?this.end=ts:a===Ta&&(this.end=ji)),this.xe=null}},color:{get:function(){return this.xk},set:function(a){this._isFrozen&&Ne(this,a),this.xk=a,this.xe=null}},start:{get:function(){return this.Qd},set:function(a){this._isFrozen&&Ne(this,a),this.Qd=a.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(a){this._isFrozen&&Ne(this,a),this.Lk=a.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(a){this._isFrozen&&Ne(this,a),0>a&&an(a,">= zero",Qi,"startRadius"),this.Gr=a,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(a){this._isFrozen&&Ne(this,a),0>a&&an(a,">= zero",Qi,"endRadius"),this.Xp=a,this.xe=null}},colorStops:{get:function(){return this.we},set:function(a){this._isFrozen&&Ne(this,a),this.we=a,this.xe=null}},pattern:{get:function(){return this.cr},set:function(a){this._isFrozen&&Ne(this,a),this.cr=a,this.xe=null}}}),Qi.prototype.isDark=Qi.prototype.Gx,Qi.prototype.darkenBy=Qi.prototype.Wy,Qi.prototype.lightenBy=Qi.prototype.Vz,Qi.prototype.addColorStop=Qi.prototype.addColorStop;var dv=216/24389,hm=24389/27,yf=[95.047,100,108.883],cv=null,fo=new _g,xa=new _g,ks=new _g,Jl=new _g,Sf=!1;Qi.className="Brush";var Ku;Qi.Solid=Ku=new Se(Qi,"Solid",0);var yu;Qi.Linear=yu=new Se(Qi,"Linear",1);var Ta;Qi.Radial=Ta=new Se(Qi,"Radial",2);var xf;Qi.Pattern=xf=new Se(Qi,"Pattern",4);var wf;Qi.Lab=wf=new Se(Qi,"Lab",5);var nS;Qi.HSL=nS=new Se(Qi,"HSL",6),Qi.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},Qi.isValidColor=function(a){if(a==="black")return!0;if(a==="")return!1;Sf||(hv(),Sf=!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)},Qi.lighten=function(a){return $y(a)},Qi.lightenBy=$y,Qi.darken=function(a){return tS(a)},Qi.darkenBy=tS,Qi.mix=rv,Qi.isDark=mf;function vr(){this.xa="Base"}vr.prototype.measure=function(){},vr.prototype.Yz=function(a,y,x,E,b){a.measure(y,x,E,b)},vr.prototype.arrange=function(){},vr.prototype.Ly=function(a,y,x,E,b,z){a.arrange(y,x,E,b,z)},vr.prototype.iA=function(a){a.Uj()},vr.prototype.gc=function(){},oe.Object.defineProperties(vr.prototype,{name:{get:function(){return this.xa},set:function(a){this.xa=a}},classType:{get:function(){return ze}}}),vr.prototype.remeasureObject=vr.prototype.iA,vr.prototype.arrangeElement=vr.prototype.Ly,vr.prototype.measureElement=vr.prototype.Yz,vr.className="PanelLayout";function dm(){this.xa="Base"}he(dm,vr),dm.prototype.measure=function(a,y,x,E,b,z,tt){var ot=E.length;a=Su(a);for(var rt=0;rt<ot;rt++){var at=E[rt];if(at.visible||at===a){var ut=at.margin,ft=ut.right+ut.left;ut=ut.top+ut.bottom,at.measure(y,x,z,tt);var mt=at.measuredBounds;ft=Math.max(mt.width+ft,0),ut=Math.max(mt.height+ut,0),mt=at.position.x;var yt=at.position.y;isFinite(mt)||(mt=0),isFinite(yt)||(yt=0),at instanceof gi&&at.isGeometryPositioned&&(at=at.strokeWidth/2,mt-=at,yt-=at),Wo(b,mt,yt,ft,ut)}}},dm.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,ot=z.margin,rt=z.position.x,at=z.position.y;if(rt=isNaN(rt)?-a:rt-a,at=isNaN(at)?-x:at-x,z instanceof gi&&z.isGeometryPositioned){var ut=z.strokeWidth/2;rt-=ut,at-=ut}z.visible&&z.arrange(rt+ot.left,at+ot.top,tt.width,tt.height)}};function cm(){this.xa="Base"}he(cm,vr),cm.prototype.measure=function(a,y,x,E,b,z,tt){var ot=E.length;y=ln(),z=Su(a);for(var rt=0;rt<ot;rt++){var at=E[rt];if(at.visible||at===z){var ut=Gs(at,!1);if(ut!==Oe&&ut!==Nn)y.push(at);else{at.measure(1/0,x,0,tt),ut=at.margin,at=at.measuredBounds;var ft=Math.max(at.height+ut.top+ut.bottom,0);b.width+=Math.max(at.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++)rt=y[a],(rt.visible||rt===z)&&(ut=rt.margin,ot=ut.right+ut.left,ut=ut.top+ut.bottom,rt.measure(1/0,x,0,tt),rt=rt.measuredBounds,ut=Math.max(rt.height+ut,0),b.width+=Math.max(rt.width+ot,0),b.height=Math.max(b.height,ut));Be(y)},cm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.top,tt=a.isOpposite,ot=tt?x.width:b.left,rt=0;rt<E;rt++){var at=z,ut=y[rt];if(ut.visible){var ft=ut.measuredBounds,mt=ut.margin,yt=mt.top+mt.bottom,xt=z+b.bottom,Mt=ft.height,It=Gs(ut,!1);(isNaN(ut.desiredSize.height)&&It===_e||It===Wn)&&(Mt=Math.max(x.height-yt-xt,0)),yt=Mt+yt+xt,xt=ut.alignment,xt.Xb()&&(xt=a.defaultAlignment),xt.sb()||(xt=ji),tt&&(ot-=ft.width+mt.left+mt.right),ut.arrange(ot+xt.offsetX+mt.left,at+xt.offsetY+mt.top+(x.height*xt.y-yt*xt.y),ft.width,Mt),tt||(ot+=ft.width+mt.left+mt.right)}}};function fm(){this.xa="Base"}he(fm,vr),fm.prototype.measure=function(a,y,x,E,b,z){var tt=E.length;x=ln();for(var ot=Su(a),rt=0;rt<tt;rt++){var at=E[rt];if(at.visible||at===ot){var ut=Gs(at,!1);if(ut!==Oe&&ut!==Wn)x.push(at);else{var ft=at.margin;ut=ft.right+ft.left,ft=ft.top+ft.bottom,at.measure(y,1/0,z,0),at=at.measuredBounds,To(b,Math.max(b.width,Math.max(at.width+ut,0)),b.height+Math.max(at.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++)rt=x[a],(rt.visible||rt===ot)&&(at=rt.margin,tt=at.right+at.left,at=at.top+at.bottom,rt.measure(y,1/0,z,0),rt=rt.measuredBounds,at=Math.max(rt.height+at,0),b.width=Math.max(b.width,Math.max(rt.width+tt,0)),b.height+=at);Be(x)}},fm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.left,tt=a.isOpposite,ot=tt?x.height:b.top,rt=0;rt<E;rt++){var at=z,ut=y[rt];if(ut.visible){var ft=ut.measuredBounds,mt=ut.margin,yt=mt.left+mt.right,xt=z+b.right,Mt=ft.width,It=Gs(ut,!1);(isNaN(ut.desiredSize.width)&&It===_e||It===Nn)&&(Mt=Math.max(x.width-yt-xt,0)),yt=Mt+yt+xt,xt=ut.alignment,xt.Xb()&&(xt=a.defaultAlignment),xt.sb()||(xt=ji),tt&&(ot-=ft.height+mt.bottom+mt.top),ut.arrange(at+xt.offsetX+mt.left+(x.width*xt.x-yt*xt.x),ot+xt.offsetY+mt.top,Mt,ft.height),tt||(ot+=ft.height+mt.bottom+mt.top)}}};function gm(){this.xa="Base"}he(gm,vr),gm.prototype.measure=function(a,y,x,E,b,z,tt){var ot=E.length,rt=a.Pb(),at=rt.margin,ut=at.right+at.left,ft=at.top+at.bottom;rt.measure(y,x,z,tt);var mt=rt.measuredBounds;z=mt.width,tt=mt.height;var yt=Math.max(z+ut,0),xt=Math.max(tt+ft,0),Mt=a.isClipping,It=Ce.allocAt(-at.left,-at.top,yt,xt),Tt=Ce.allocAt(0,0,z,tt);fv(rt,Tt,!0),z=Tt.width,tt=Tt.height;for(var zt=!0,Ht=Su(a),Vt=0;Vt<ot;Vt++){var Xt=E[Vt];mt=y;var le=x;if(Xt!==rt&&(Xt.visible||Xt===Ht)){at=Xt.margin;var $e=at.left,mn=at.top;switch(yt=at.right+at.left,xt=at.top+at.bottom,at=Gs(Xt,!1),at){case _e:mt=z,le=tt,mn=$e=xt=yt=0;break;case Nn:mt=z,$e=yt=0;break;case Wn:le=tt,mn=xt=0}Xt.measure(mt,le,0,0),mt=Xt.measuredBounds,yt=Math.max(mt.width+yt,0),xt=Math.max(mt.height+xt,0),at=Xt.alignment,at.Xb()&&(at=a.defaultAlignment),at.sb()||(at=ji);var cn=Xt.alignmentFocus;if(cn.Xb()&&(cn=ji),le=null,Xt instanceof ze&&Xt.$e!==""&&(le=Xt.fb(Xt.$e),le===Xt&&(le=null)),$e=Tt.x-$e,mn=Tt.y-mn,le!==null){for(Xt.arrange(0,0,mt.width,mt.height),mt=le.actualBounds,mt=Bt.allocAt(mt.x+(cn.x*mt.width-cn.offsetX),mt.y+(cn.y*mt.height-cn.offsetY)),le=le.panel;le!==Xt;)le.transform.Ga(mt),le=le.panel;$e+=at.x*z+at.offsetX-mt.x,mn+=at.y*tt+at.offsetY-mt.y,Bt.free(mt)}else $e+=at.x*z+at.offsetX-(cn.x*mt.width+cn.offsetX),mn+=at.y*tt+at.offsetY-(cn.y*mt.height+cn.offsetY);zt?(zt=!1,b.h($e,mn,yt,xt)):Wo(b,$e,mn,yt,xt)}}switch(zt?b.assign(It):Mt?b.Uu(Tt.x,Tt.y,Tt.width,Tt.height):Wo(b,It.x,It.y,It.width,It.height),Ce.free(It),Ce.free(Tt),at=rt.stretch,at===ui&&(at=Gs(rt,!1)),at){case Oe:return;case _e:if(!isFinite(y)&&!isFinite(x))return;break;case Nn:if(!isFinite(y))return;break;case Wn:if(!isFinite(x))return}for(mt=rt.measuredBounds,z=mt.width,tt=mt.height,yt=Math.max(z+ut,0),xt=Math.max(tt+ft,0),at=rt.margin,Tt=Ce.allocAt(-at.left,-at.top,yt,xt),fv(rt,Tt,!0),z=Tt.width,tt=Tt.height,y=0;y<ot;y++)x=E[y],x===rt||!x.visible&&x!==Ht||(at=x.margin,yt=at.right+at.left,xt=at.top+at.bottom,mt=x.measuredBounds,yt=Math.max(mt.width+yt,0),xt=Math.max(mt.height+xt,0),ut=x.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=ji),x=x.alignmentFocus,x.Xb()&&(x=ji),zt?(zt=!1,b.h(ut.x*z+ut.offsetX-(x.x*mt.width+x.offsetX)-at.left,ut.y*tt+ut.offsetY-(x.y*mt.height+x.offsetY)-at.top,yt,xt)):Wo(b,ut.x*z+ut.offsetX-(x.x*mt.width+x.offsetX)-at.left,ut.y*tt+ut.offsetY-(x.y*mt.height+x.offsetY)-at.top,yt,xt));zt?b.assign(It):Mt?b.Uu(Tt.x,Tt.y,Tt.width,Tt.height):Wo(b,It.x,It.y,It.width,It.height),Ce.free(Tt)},gm.prototype.arrange=function(a,y,x){var E=y.length,b=a.Pb(),z=b.measuredBounds,tt=z.width,ot=z.height,rt=a.padding;z=rt.left,rt=rt.top;var at=z-x.x,ut=rt-x.y;for(b.arrange(at,ut,tt,ot),tt=Ce.allocAt(0,0,tt,ot),fv(b,tt,!1),ot=0;ot<E;ot++){var ft=y[ot];if(ft!==b){at=ft.measuredBounds;var mt=at.width,yt=at.height;ut=ft.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=ji);var xt=ft.alignmentFocus;if(xt.Xb()&&(xt=ji),at=null,ft instanceof ze&&ft.$e!==""&&(at=ft.fb(ft.$e),at===ft&&(at=null)),at!==null){var Mt=at.actualBounds;for(xt=Bt.allocAt(Mt.x+(xt.x*Mt.width-xt.offsetX),Mt.y+(xt.y*Mt.height-xt.offsetY)),at=at.panel;at!==ft;)at.transform.Ga(xt),at=at.panel;at=ut.x*tt.width+ut.offsetX-xt.x,ut=ut.y*tt.height+ut.offsetY-xt.y,Bt.free(xt)}else at=ut.x*tt.width+ut.offsetX-(xt.x*mt+xt.offsetX),ut=ut.y*tt.height+ut.offsetY-(xt.y*yt+xt.offsetY);at+=tt.x-x.x,ut+=tt.y-x.y,ft.visible&&ft.arrange(z+at,rt+ut,mt,yt)}}Ce.free(tt)};function fv(a,y,x){var E=null;if(a instanceof ze&&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 pm(){this.xa="Base"}he(pm,vr),pm.prototype.measure=function(a,y,x,E,b,z,tt){var ot=E.length,rt=a.Pb(),at=rt.margin,ut=y,ft=x,mt=at.right+at.left,yt=at.top+at.bottom;rt.measure(y,x,z,tt),at=rt.measuredBounds;var xt=0,Mt=null;rt instanceof gi&&(Mt=rt,xt=Mt.strokeWidth*Mt.scale);var It=Math.max(at.width+mt,0);at=Math.max(at.height+yt,0);var Tt=vv(rt),zt=Tt.x*It+Tt.offsetX;Tt=Tt.y*at+Tt.offsetY;var Ht=yv(rt),Vt=Ht.x*It+Ht.offsetX;for(Ht=Ht.y*at+Ht.offsetY,isFinite(y)&&(ut=Math.max(Math.abs(zt-Vt)-xt,0)),isFinite(x)&&(ft=Math.max(Math.abs(Tt-Ht)-xt,0)),xt=Qe.alloc(),xt.h(0,0),a=Su(a),Ht=0;Ht<ot;Ht++)Tt=E[Ht],Tt===rt||!Tt.visible&&Tt!==a||(at=Tt.margin,It=at.right+at.left,zt=at.top+at.bottom,Tt.measure(ut,ft,0,0),at=Tt.measuredBounds,It=Math.max(at.width+It,0),at=Math.max(at.height+zt,0),xt.h(Math.max(It,xt.width),Math.max(at,xt.height)));if(ot===1)b.width=It,b.height=at,Qe.free(xt);else{switch(Tt=vv(rt),Ht=yv(rt),ot=E=0,Ht.x!==Tt.x&&Ht.y!==Tt.y&&(E=xt.width/Math.abs(Ht.x-Tt.x),ot=xt.height/Math.abs(Ht.y-Tt.y)),Qe.free(xt),xt=0,Mt!==null&&(xt=Mt.strokeWidth*Mt.scale,Lv(Mt)===wn&&(E=ot=Math.max(E,ot))),E+=Math.abs(Tt.offsetX)+Math.abs(Ht.offsetX)+xt,ot+=Math.abs(Tt.offsetY)+Math.abs(Ht.offsetY)+xt,Mt=rt.stretch,Mt===ui&&(Mt=Gs(rt,!1)),Mt){case Oe:tt=z=0;break;case _e:isFinite(y)&&(E=y),isFinite(x)&&(ot=x);break;case Nn:isFinite(y)&&(E=y),tt=0;break;case Wn:z=0,isFinite(x)&&(ot=x)}rt.Uj(),rt.measure(E,ot,z,tt),b.width=rt.measuredBounds.width+mt,b.height=rt.measuredBounds.height+yt}},pm.prototype.arrange=function(a,y){var x=y.length,E=a.Pb(),b=E.measuredBounds,z=Ce.alloc();z.h(0,0,1,1);var tt=E.margin,ot=tt.left;tt=tt.top;var rt=a.padding,at=rt.left;rt=rt.top,E.arrange(at+ot,rt+tt,b.width,b.height);var ut=vv(E),ft=yv(E),mt=ut.y*b.height+ut.offsetY,yt=ft.x*b.width+ft.offsetX;for(ft=ft.y*b.height+ft.offsetY,z.x=ut.x*b.width+ut.offsetX,z.y=mt,Wo(z,yt,ft,0,0),z.x+=ot+at,z.y+=tt+rt,b=0;b<x;b++)ot=y[b],ot!==E&&(at=ot.measuredBounds,tt=ot.margin,rt=Math.max(at.width+tt.right+tt.left,0),ut=Math.max(at.height+tt.top+tt.bottom,0),mt=ot.alignment,mt.Xb()&&(mt=a.defaultAlignment),mt.sb()||(mt=ji),rt=z.width*mt.x+mt.offsetX-rt*mt.x+tt.left+z.x,tt=z.height*mt.y+mt.offsetY-ut*mt.y+tt.top+z.y,ot.visible&&(Or(z.x,z.y,z.width,z.height,rt,tt,at.width,at.height)?ot.arrange(rt,tt,at.width,at.height):ot.arrange(rt,tt,at.width,at.height,new Ce(z.x,z.y,z.width,z.height))));Ce.free(z)};function mm(){this.xa="Base",this.name="Table"}he(mm,vr),mm.prototype.measure=function(a,y,x,E,b){for(var z=E.length,tt=ln(),ot=ln(),rt=0;rt<z;rt++){var at=E[rt],ut=at instanceof ze?at:null;if(ut!==null&&Xu(ut)&&at.visible){ot.push(ut);for(var ft=ut.O.s,mt=ft.length,yt=0;yt<mt;yt++){var xt=ft[yt];ut.type===ze.TableRow?xt.row=at.row:ut.type===ze.TableColumn&&(xt.column=at.column),tt.push(xt)}}else tt.push(at)}z=tt.length,z===0&&(a.Fb(0),a.Eb(0));for(var Mt=[],It=0;It<z;It++){var Tt=tt[It];Tt.visible&&(fr(Tt,!0),Kl(Tt,!0),Mt[Tt.row]||(Mt[Tt.row]=[]),Mt[Tt.row][Tt.column]||(Mt[Tt.row][Tt.column]=[]),Mt[Tt.row][Tt.column].push(Tt))}Be(tt);var zt=ln(),Ht=ln(),Vt=ln(),Xt={count:0},le={count:0},$e=y,mn=x,cn=a.rowDefs,We=a.colDefs,Te=null;z=cn.length;for(var oi=0;oi<z;oi++)Te=cn[oi],Te!==void 0&&(Te.actual=0);z=We.length;for(var Xn=0;Xn<z;Xn++)Te=We[Xn],Te!==void 0&&(Te.actual=0);for(var Gi=Mt.length,ao=0,Cr=0;Cr<Gi;Cr++)Mt[Cr]&&(ao=Math.max(ao,Mt[Cr].length));var Er=Math.min(a.topIndex,Gi-1),fs=Math.min(a.leftIndex,ao-1),Lr=0;Gi=Mt.length;for(var rh=Su(a),ar=0;ar<Gi;ar++)if(Mt[ar]){ao=Mt[ar].length;var xl=a.Fb(ar);xl.actual=0;for(var gs=xl.oc=0;gs<ao;gs++)if(Mt[ar][gs]){var sh=a.Eb(gs);zt[gs]===void 0&&(sh.actual=0,sh.oc=0,zt[gs]=!0);for(var Ca=Mt[ar][gs],Ja=Ca.length,la=0;la<Ja;la++){var Js=Ca[la];if(Js.visible||Js===rh){var qh=1<Js.rowSpan||1<Js.columnSpan;qh&&(ar<Er||gs<fs||Ht.push(Js));var wl=Js.margin,Vf=wl.right+wl.left,ua=wl.top+wl.bottom,ps=pl(Js,xl,sh,!1),Mp=Js.desiredSize,Ac=!isNaN(Mp.height),Rl=!isNaN(Mp.width)&&Ac;if(qh||ps===Oe||Rl||ar<Er||gs<fs||(Xt[gs]!==void 0||ps!==_e&&ps!==Nn||(Xt[gs]=-1,Xt.count++),le[ar]!==void 0||ps!==_e&&ps!==Wn||(le[ar]=-1,le.count++),Vt.push(Js)),Js.measure(1/0,1/0,0,0),!(ar<Er||gs<fs)){var Qs=Js.measuredBounds,_d=Math.max(Qs.width+Vf,0),ha=Math.max(Qs.height+ua,0);if(Js.rowSpan===1&&(ps===Oe||ps===Nn)){Te=a.Fb(ar);var $h=Te.Wc();Lr=Math.max(ha-Te.actual,0),Lr+$h>mn&&(Lr=Math.max(mn-$h,0));var _0=Te.oa===0;Te.oc=Te.oc+Lr,Te.actual=Te.oa+Lr,mn=Math.max(mn-(Lr+(_0?$h:0)),0)}if(Js.columnSpan===1&&(ps===Oe||ps===Wn)){Te=a.Eb(gs);var Ep=Te.Wc();Lr=Math.max(_d-Te.actual,0),Lr+Ep>$e&&(Lr=Math.max($e-Ep,0));var zy=Te.oa===0;Te.oc=Te.oc+Lr,Te.actual=Te.oa+Lr,$e=Math.max($e-(Lr+(zy?Ep:0)),0)}qh&&Js.Uj()}}}}}Be(zt);var ru=0,Pu=0;z=a.columnCount;for(var Bc=0;Bc<z;Bc++){var td=We[Bc];td!==void 0&&(ru+=isNaN(td.Hc)?td.oc:td.Hc,td.oc!==0&&(ru+=td.Wc()))}z=a.rowCount;for(var Uf=0;Uf<z;Uf++){var ed=cn[Uf];ed!==void 0&&(Pu+=isNaN(ed.Hc)?ed.oc:ed.Hc,ed.oc!==0&&(Pu+=ed.Wc()))}$e=Math.max(y-ru,0);var su=mn=Math.max(x-Pu,0),ah=$e;z=Vt.length;for(var qs=0;qs<z;qs++){var jl=Vt[qs],z0=a.Fb(jl.row),Cu=a.Eb(jl.column),Yf=jl.measuredBounds,Pl=jl.margin,zd=Pl.right+Pl.left,_l=Pl.top+Pl.bottom;Xt[jl.column]=Cu.oc===0&&Xt[jl.column]!==void 0?Math.max(Yf.width+zd,Xt[jl.column]):null,le[jl.row]=z0.oc===0&&le[jl.row]!==void 0?Math.max(Yf.height+_l,le[jl.row]):null}var Dc=0,Zf=0,dl;for(dl in le)dl!=="count"&&(Dc+=le[dl]);for(dl in Xt)dl!=="count"&&(Zf+=Xt[dl]);for(var _r=Qe.alloc(),bp=0;bp<z;bp++){var As=Vt[bp];if(As.visible||As===rh){var lr=a.Fb(As.row),Bs=a.Eb(As.column),Lu=0;isFinite(Bs.width)?Lu=Bs.width:(isFinite($e)&&Xt[As.column]!==null?Zf===0?Lu=Bs.actual+$e:Lu=Xt[As.column]/Zf*ah:Xt[As.column]!==null?Lu=$e:Lu=Bs.actual||$e,Lu=Math.max(0,Lu-Bs.Wc()));var lh=0;switch(isFinite(lr.height)?lh=lr.height:(isFinite(mn)&&le[As.row]!==null?Dc===0?lh=lr.actual+mn:lh=le[As.row]/Dc*su:le[As.row]!==null?lh=mn:lh=lr.actual||mn,lh=Math.max(0,lh-lr.Wc())),_r.h(Math.max(Bs.minimum,Math.min(Lu,Bs.maximum)),Math.max(lr.minimum,Math.min(lh,lr.maximum))),ps=pl(As,lr,Bs,!1),ps){case Nn:_r.height=Math.max(_r.height,lr.actual+mn);break;case Wn:_r.width=Math.max(_r.width,Bs.actual+$e)}var Gd=As.margin,Gy=Gd.right+Gd.left,G0=Gd.top+Gd.bottom;As.Uj(),As.measure(_r.width,_r.height,Bs.minimum,lr.minimum);var Kf=As.measuredBounds,Hd=Math.max(Kf.width+Gy,0),Oc=Math.max(Kf.height+G0,0);isFinite($e)&&(Hd=Math.min(Hd,_r.width)),isFinite(mn)&&(Oc=Math.min(Oc,_r.height));var $s=0;$s=lr.actual,lr.actual=Math.max(lr.actual,Oc),lr.oc=Math.max(lr.oc,Oc),Lr=lr.actual-$s,mn=Math.max(mn-Lr,0),le[As.row]===null&&(su=Math.max(su-Lr,0)),$s=Bs.actual,Bs.actual=Math.max(Bs.actual,Hd),Bs.oc=Math.max(Bs.oc,Hd),Lr=Bs.actual-$s,$e=Math.max($e-Lr,0),Xt[As.column]===null&&(ah=Math.max(ah-Lr,0))}}Be(Vt);var ku=Qe.alloc(),Cl=ln(),Ia=ln();if(z=Ht.length,z!==0){for(var nd=0;nd<Gi;nd++)if(Mt[nd]){ao=Mt[nd].length;var Xf=a.Fb(nd);Cl[nd]=Xf.actual;for(var id=0;id<ao;id++)if(Mt[nd][id]){var H0=a.Eb(id);Ia[id]=H0.actual}}}for(var Jf=0;Jf<z;Jf++){var qo=Ht[Jf];if(qo.visible||qo===rh){var cl=a.Fb(qo.row),Qa=a.Eb(qo.column);switch(_r.h(Math.max(Qa.minimum,Math.min(y,Qa.maximum)),Math.max(cl.minimum,Math.min(x,cl.maximum))),ps=pl(qo,cl,Qa,!1),ps){case _e:Ia[Qa.index]!==0&&(_r.width=Math.min(_r.width,Ia[Qa.index])),Cl[cl.index]!==0&&(_r.height=Math.min(_r.height,Cl[cl.index]));break;case Nn:Ia[Qa.index]!==0&&(_r.width=Math.min(_r.width,Ia[Qa.index]));break;case Wn:Cl[cl.index]!==0&&(_r.height=Math.min(_r.height,Cl[cl.index]))}isFinite(Qa.width)&&(_r.width=Qa.width),isFinite(cl.height)&&(_r.height=cl.height),ku.h(0,0);for(var W0=Qa.minimum,da=cl.minimum,uh=1;uh<qo.rowSpan&&!(qo.row+uh>=a.rowCount);uh++)Te=a.Fb(qo.row+uh),Lr=0,Lr=ps===_e||ps===Wn?Math.max(Te.minimum,Cl[qo.row+uh]===0?Te.maximum:Math.min(Cl[qo.row+uh],Te.maximum)):Math.max(Te.minimum,isNaN(Te.Hc)?Te.maximum:Math.min(Te.Hc,Te.maximum)),ku.height+=Lr,da+=Te.minimum;for(var qa=1;qa<qo.columnSpan&&!(qo.column+qa>=a.columnCount);qa++)Te=a.Eb(qo.column+qa),Lr=0,Lr=ps===_e||ps===Nn?Math.max(Te.minimum,Ia[qo.column+qa]===0?Te.maximum:Math.min(Ia[qo.column+qa],Te.maximum)):Math.max(Te.minimum,isNaN(Te.Hc)?Te.maximum:Math.min(Te.Hc,Te.maximum)),ku.width+=Lr,W0+=Te.minimum;_r.width+=ku.width,_r.height+=ku.height;var Qf=qo.margin,od=Qf.right+Qf.left,Fp=Qf.top+Qf.bottom;qo.measure(_r.width,_r.height,W0,da);for(var qf=qo.measuredBounds,zl=Math.max(qf.width+od,0),Wd=Math.max(qf.height+Fp,0),rd=0,$f=0;$f<qo.rowSpan&&!(qo.row+$f>=a.rowCount);$f++)Te=a.Fb(qo.row+$f),rd+=Te.total||0;if(rd<Wd){var hh=Wd-rd,au=Wd-rd;if(qo.spanAllocation!==null)for(var dh=qo.spanAllocation,Mu=0;Mu<qo.rowSpan&&!(0>=hh)&&!(qo.row+Mu>=a.rowCount);Mu++){Te=a.Fb(qo.row+Mu);var ch=Te.oa||0,Vd=dh(qo,Te,au);Te.actual=Math.min(Te.maximum,ch+Vd),Te.oa!==ch&&(hh-=Te.oa-ch)}for(;0<hh;){var Ll=Te.oa||0;if(isNaN(Te.height)&&Te.maximum>Ll&&(Te.actual=Math.min(Te.maximum,Ll+hh),Te.oa!==Ll&&(hh-=Te.oa-Ll)),Te.index===0)break;Te=a.Fb(Te.index-1)}}for(var Ic=0,fh=0;fh<qo.columnSpan&&!(qo.column+fh>=a.columnCount);fh++)Te=a.Eb(qo.column+fh),Ic+=Te.total||0;if(Ic<zl){var Rc=zl-Ic,Hy=zl-Ic;if(qo.spanAllocation!==null)for(var Eu=qo.spanAllocation,Ud=0;Ud<qo.columnSpan&&!(0>=Rc)&&!(qo.column+Ud>=a.columnCount);Ud++){Te=a.Eb(qo.column+Ud);var Np=Te.oa||0,Wy=Eu(qo,Te,Hy);Te.actual=Math.min(Te.maximum,Np+Wy),Te.oa!==Np&&(Rc-=Te.oa-Np)}for(;0<Rc;){var V0=Te.oa||0;if(isNaN(Te.width)&&Te.maximum>V0&&(Te.actual=Math.min(Te.maximum,V0+Rc),Te.oa!==V0&&(Rc-=Te.oa-V0)),Te.index===0)break;Te=a.Eb(Te.index-1)}}}}Be(Ht),Qe.free(ku),Qe.free(_r),Cl!==void 0&&Be(Cl),Ia!==void 0&&Be(Ia);var jc=0,_c=0,U0=a.desiredSize,gx=a.maxSize;ps=Gs(a,!0);var Tp=Pu=ru=0,Ap=0;z=a.columnCount;for(var Y0=0;Y0<z;Y0++)We[Y0]!==void 0&&(Te=a.Eb(Y0),isFinite(Te.width)?(Tp+=Te.width,Tp+=Te.Wc()):Mm(Te)===Wg?(Tp+=Te.oa,Tp+=Te.Wc()):Te.oa!==0&&(ru+=Te.oa,ru+=Te.Wc()));isFinite(U0.width)?jc=Math.min(U0.width,gx.width):jc=ps!==Oe&&isFinite(y)?y:ru,jc=Math.max(jc,a.minSize.width),jc=Math.max(jc-Tp,0);for(var Qx=ru===0?1:Math.max(jc/ru,1),Z0=0;Z0<z;Z0++)We[Z0]!==void 0&&(Te=a.Eb(Z0),isFinite(Te.width)||Mm(Te)===Wg||(Te.actual=Te.oa*Qx),Te.position=b.width,Te.oa!==0&&(b.width+=Te.oa,b.width+=Te.Wc()));z=a.rowCount;for(var K0=0;K0<z;K0++)cn[K0]!==void 0&&(Te=a.Fb(K0),isFinite(Te.height)?(Ap+=Te.height,Ap+=Te.Wc()):Mm(Te)===Wg?(Ap+=Te.oa,Ap+=Te.Wc()):Te.oa!==0&&(Pu+=Te.oa,Pu+=Te.Wc()));isFinite(U0.height)?_c=Math.min(U0.height,gx.height):_c=ps!==Oe&&isFinite(x)?x:Pu,_c=Math.max(_c,a.minSize.height),_c=Math.max(_c-Ap,0);for(var qx=Pu===0?1:Math.max(_c/Pu,1),X0=0;X0<z;X0++)cn[X0]!==void 0&&(Te=a.Fb(X0),isFinite(Te.height)||Mm(Te)===Wg||(Te.actual=Te.oa*qx),Te.position=b.height,Te.oa!==0&&(b.height+=Te.oa,b.height+=Te.Wc()));z=ot.length;for(var Vy=0;Vy<z;Vy++){var Bp=ot[Vy],Uy=0,Yy=0;Bp.type===ze.TableRow?(Uy=b.width,Te=a.Fb(Bp.row),Yy=Te.actual):(Te=a.Eb(Bp.column),Uy=Te.actual,Yy=b.height),Bp.measuredBounds.h(0,0,Uy,Yy),fr(Bp,!1)}Be(ot),a.inRowsCols=Mt},mm.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 ot,rt,at=tt.length,ut=0,ft=0;ft<at;ft++)tt[ft]&&(ut=Math.max(ut,tt[ft].length));rt=a.rowDefs,ot=a.colDefs;var mt=ft=0,yt=Math.min(a.topIndex,at-1);if(0<rt.length){for(;yt!==at&&(rt[yt]===void 0||rt[yt].oa===0);)yt++;yt=Math.max(Math.min(yt,at-1),0),ft=-rt[yt].position}var xt=Math.min(a.leftIndex,ut-1);if(0<ot.length){for(;xt!==ut&&(ot[xt]===void 0||ot[xt].oa===0);)xt++;xt=Math.max(Math.min(xt,ut-1),0),mt=-ot[xt].position}for(var Mt=0,It=0;Mt!==at&&rt[Mt]===void 0;)Mt++;for(;It!==at&&ot[It]===void 0;)It++;ut=a.part,a.Fb(Mt),a.Eb(It);for(var Tt=0;Tt<y.length;Tt++){var zt=y[Tt];if(zt instanceof ze&&zt.visible&&Xu(zt)){if(zt.type===ze.TableRow){ot=a.Fb(zt.row);var Ht=a.Eb(It)}else ot=a.Fb(Mt),Ht=a.Eb(zt.column);rt=ot.position+ft+b,ot.oa!==0&&(rt+=ot.Io(Math.max(Mt,yt))),ot=Ht.position+mt+z,Ht.oa!==0&&(ot+=Ht.Io(Math.max(It,xt))),Ht=zt.measuredBounds,zt.Uk(),zt.actualBounds.ka();var Vt=zt.actualBounds,Xt=Ce.allocAt(Vt.x,Vt.y,Vt.width,Vt.height);Vt.x=zt.type===ze.TableRow?z:ot,Vt.y=zt.type===ze.TableColumn?b:rt,Vt.width=Ht.width,Vt.height=Ht.height,zt.actualBounds.freeze(),Kl(zt,!1),ca(Xt,Vt)||ut===null||(ut.oh(),zt.Pn(ut)),Ce.free(Xt)}}for(Tt=Qe.alloc(),zt=0;zt<at;zt++)if(tt[zt]){for(ut=tt[zt].length,Ht=a.Fb(zt),rt=Ht.position+ft+b,Ht.oa!==0&&(rt+=Ht.Io(Math.max(Mt,yt))),Vt=0;Vt<ut;Vt++)if(tt[zt][Vt]){Xt=a.Eb(Vt),ot=Xt.position+mt+z,Xt.oa!==0&&(ot+=Xt.Io(Math.max(It,xt)));for(var le=tt[zt][Vt],$e=le.length,mn=0;mn<$e;mn++){var cn=le[mn],We=cn.measuredBounds;Tt.h(0,0);for(var Te=1;Te<cn.rowSpan&&!(zt+Te>=a.rowCount);Te++){var oi=a.Fb(zt+Te);oi.oa!==0&&(Tt.height+=oi.total)}for(Te=1;Te<cn.columnSpan&&!(Vt+Te>=a.columnCount);Te++)oi=a.Eb(Vt+Te),oi.oa!==0&&(Tt.width+=oi.total);var Xn=Xt.oa+Tt.width,Gi=Ht.oa+Tt.height;Te=ot,oi=rt;var ao=Xn,Cr=Gi,Er=ot,fs=rt,Lr=Xn,rh=Gi;ot+Xn>x.width&&(Lr=Math.max(x.width-ot,0)),rt+Gi>x.height&&(rh=Math.max(x.height-rt,0));var ar=cn.alignment;if(ar.Xb()){ar=a.defaultAlignment,ar.sb()||(ar=ji);var xl=ar.x,gs=ar.y,sh=ar.offsetX;ar=ar.offsetY;var Ca=Xt.alignment,Ja=Ht.alignment;Ca.sb()&&(xl=Ca.x,sh=Ca.offsetX),Ja.sb()&&(gs=Ja.y,ar=Ja.offsetY)}else xl=ar.x,gs=ar.y,sh=ar.offsetX,ar=ar.offsetY;(isNaN(xl)||isNaN(gs))&&(gs=xl=.5,ar=sh=0),Ca=We.width,Ja=We.height;var la=cn.margin,Js=la.left+la.right,qh=la.top+la.bottom,wl=pl(cn,Ht,Xt,!1);!isNaN(cn.desiredSize.width)||wl!==_e&&wl!==Nn||(Ca=Math.max(Xn-Js,0)),!isNaN(cn.desiredSize.height)||wl!==_e&&wl!==Wn||(Ja=Math.max(Gi-qh,0)),Xn=cn.maxSize,Gi=cn.minSize,Ca=Math.min(Xn.width,Ca),Ja=Math.min(Xn.height,Ja),Ca=Math.max(Gi.width,Ca),Ja=Math.max(Gi.height,Ja),Xn=Ja+qh,Te+=ao*xl-(Ca+Js)*xl+sh+la.left,oi+=Cr*gs-Xn*gs+ar+la.top,cn.visible&&(Or(Er,fs,Lr,rh,Te,oi,We.width,We.height)?cn.arrange(Te,oi,Ca,Ja):cn.arrange(Te,oi,Ca,Ja,new Ce(Er,fs,Lr,rh)))}}}for(Qe.free(Tt),a=0;a<E;a++)x=y[a],z=x instanceof ze?x:null,z!==null&&Xu(z)&&(z=x.actualBounds,x.naturalBounds.ka(),x.naturalBounds.h(0,0,z.width,z.height),x.naturalBounds.freeze())}};function vm(){this.xa="Base"}he(vm,vr),vm.prototype.measure=function(){},vm.prototype.arrange=function(){};function ym(){this.xa="Base"}he(ym,vr),ym.prototype.measure=function(){},ym.prototype.arrange=function(){};function Sm(){this.xa="Base"}he(Sm,vr),Sm.prototype.measure=function(a,y,x,E,b,z,tt){1<E.length&&Wt("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 ot=E.measuredBounds,rt=E.margin,at=rt.right+rt.left;if(rt=rt.top+rt.bottom,isFinite(y)||isFinite(x)){var ut=E.scale,ft=ot.width;ot=ot.height;var mt=Math.max(y-at,0),yt=Math.max(x-rt,0),xt=1;a.viewboxStretch===wn?ft!==0&&ot!==0&&(xt=Math.min(mt/ft,yt/ot)):ft!==0&&ot!==0&&(xt=Math.max(mt/ft,yt/ot)),xt===0&&(xt=1e-4),E.Ca*=xt,ut!==E.scale&&(fr(E,!0),E.measure(1/0,1/0,z,tt))}ot=E.measuredBounds,b.width=isFinite(y)?y:Math.max(ot.width+at,0),b.height=isFinite(x)?x:Math.max(ot.height+rt,0)},Sm.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=ji),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 zg(){this.xa="Base"}he(zg,vr),zg.prototype.measure=function(){},zg.prototype.arrange=function(){},zg.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,ot=z.width,rt=z.height,at=Math.ceil(ot/b),ut=Math.ceil(rt/E),ft=a.gridOrigin,mt=ft.x;ft=ft.y,y.save(),y.beginPath(),y.rect(0,0,ot,rt),y.clip(),y.Se();for(var yt=[],xt=a.O.s,Mt=xt.length,It=0;It<Mt;It++){var Tt=xt[It],zt=[];if(yt.push(zt),Tt.visible){var Ht=Tt.interval;if(!(0>Ht)){Tt=pv(Tt.figure);for(var Vt=0;Vt<Mt;Vt++)if(Vt!==It){var Xt=xt[Vt];Xt.visible&&pv(Xt.figure)===Tt&&(Xt=Xt.interval,Xt>Ht&&zt.push(Xt))}}}}for(xt=a.O.s,Mt=xt.length,It=0;It<Mt;It++){var le=xt[It];if(le.visible&&(zt=le.interval||1,Tt=Math.abs(zt),!(2>b*Tt*x))){if(Ht=le.segmentIndex,(!isFinite(Ht)||isNaN(Ht))&&(Ht=0),0>Ht&&(Ht=Tt-Math.min(-Ht,Tt)),Ht=Math.round(Ht%Tt),Tt=le.opacity,Vt=1,Tt!==1){if(Tt===0)continue;Vt=y.globalAlpha,y.globalAlpha=Vt*Tt}Xt=yt[It];var $e=!1,mn=le.strokeDashArray;if(mn!==null&&($e=!0,y.js(mn,le.strokeDashOffset)),le.figure==="LineV"&&le.stroke!==null&&0<le.strokeWidth){for(y.lineWidth=le.strokeWidth,Xo(a,y,le.stroke,!1,!1,z,tt),y.beginPath(),mn=le=Math.floor((mt-b)/b);mn<=le+at;mn++){var cn=mn*b+mt;0<=cn&&cn<=ot&&xm(mn,zt,Ht,Xt)&&(y.moveTo(cn,0),y.lineTo(cn,rt))}y.stroke(),y.Se()}else if(le.figure==="LineH"&&le.stroke!==null&&0<le.strokeWidth){for(y.lineWidth=le.strokeWidth,Xo(a,y,le.stroke,!1,!1,z,tt),y.beginPath(),mn=le=Math.floor((ft-E)/E);mn<=le+ut;mn++)cn=mn*E+ft,0<=cn&&cn<=rt&&xm(mn,zt,Ht,Xt)&&(y.moveTo(0,cn),y.lineTo(ot,cn));y.stroke(),y.Se()}else if(le.figure==="BarV"&&le.fill!==null)for(Xo(a,y,le.fill,!0,!1,z,tt),le=le.width,isNaN(le)&&(le=b),cn=mn=Math.floor((mt-b)/b);cn<=mn+at;cn++){var We=cn*b+mt;0<=We+le&&We<=ot&&xm(cn,zt,Ht,Xt)&&y.fillRect(We,0,le,rt)}else if(le.figure==="BarH"&&le.fill!==null)for(Xo(a,y,le.fill,!0,!1,z,tt),le=le.height,isNaN(le)&&(le=E),cn=mn=Math.floor((ft-E)/E);cn<=mn+ut;cn++)We=cn*E+ft,0<=We+le&&We<=rt&&xm(cn,zt,Ht,Xt)&&y.fillRect(0,We,ot,le);$e&&y.fs(),Tt!==1&&(y.globalAlpha=Vt)}}y.restore(),y.Vc(!1)};function xm(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 wm(){this.xa="Base"}he(wm,vr),wm.prototype.measure=function(a,y,x,E,b){var z=E.length;if(a instanceof Ii||a instanceof Ve){var tt=null,ot=null;if(a instanceof Ve&&(tt=a),a instanceof Ii&&(ot=a,tt=ot.adornedPart,a.j===null&&(a.j=[])),tt instanceof Ve){var rt=tt;if(z===0)To(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var at=a instanceof Ii?null:tt.path;y=tt.routeBounds,x=a.jg,x.h(0,0,y.width,y.height);var ut=rt.points,ft=tt.pointsCount;ot!==null?ot.Ul(!1):tt!==null&&tt.Ul(!1),ot=y.width;var mt=y.height,yt=a.j;if(yt.length=0,at!==null){iS(a,ot,mt,at);var xt=at.measuredBounds;x.ed(xt),yt.push(xt)}xt=ci.alloc();for(var Mt=Bt.alloc(),It=Bt.alloc(),Tt=0;Tt<z;Tt++){var zt=E[Tt];if(zt!==at)if(zt.isPanelMain&&zt instanceof gi){iS(a,ot,mt,zt);var Ht=zt.measuredBounds;x.ed(Ht),yt.push(Ht)}else if(2>ft)zt.measure(1/0,1/0,0,0),Ht=zt.measuredBounds,x.ed(Ht),yt.push(Ht);else{var Vt=zt.segmentIndex,Xt=zt.segmentFraction,le=zt.alignmentFocus;le.Mc()&&(le=ji);var $e=zt.segmentOrientation,mn=zt.segmentOffset;if(isNaN(Vt)){var cn=rt.ua;Ht=ln(),cn.Qu(Xt,Ht);var We=Bt.allocAt(Ht[0],Ht[1]);if(We.add(rt.i(0)),cn.type===Ue.j?We.offset(-cn.startX,-cn.startY):(cn=cn.figures.first(),cn!==null&&We.offset(-cn.startX,-cn.startY)),cn=Ht[2],$e!==Es){var Te=rt.computeAngle(zt,$e,cn);zt.Kb=Te}Te=We.x-y.x;var oi=We.y-y.y;Bt.free(We),Be(Ht)}else if(Vt<-ft||Vt>=ft)Ht=Bt.alloc(),rt.vg(),rt.computeMidPoint(Ht),cn=rt.midAngle,$e!==Es&&(Te=rt.computeAngle(zt,$e,cn),zt.Kb=Te),Te=Ht.x-y.x,oi=Ht.y-y.y,Bt.free(Ht);else{if(Te=0,0<=Vt?(oi=ut.M(Vt),Ht=Vt<ft-1?ut.M(Vt+1):oi):(Te=ft+Vt,oi=ut.M(Te),Ht=0<Te?ut.M(Te-1):oi),oi.Xa(Ht)){0<=Vt?(cn=0<Vt?ut.M(Vt-1):oi,Te=Vt<ft-2?ut.M(Vt+2):Ht):(cn=Te<ft-1?ut.M(Te+1):oi,Te=1<Te?ut.M(Te-2):Ht),We=cn.Bf(oi);var Xn=Ht.Bf(Te);cn=We>Xn+10?0<=Vt?cn.ab(oi):oi.ab(cn):Xn>We+10?0<=Vt?Ht.ab(Te):Te.ab(Ht):0<=Vt?cn.ab(Te):Te.ab(cn)}else cn=0<=Vt?oi.ab(Ht):Ht.ab(oi);$e!==Es&&(Te=rt.computeAngle(zt,$e,cn),zt.Kb=Te),Te=oi.x+(Ht.x-oi.x)*Xt-y.x,oi=oi.y+(Ht.y-oi.y)*Xt-y.y}zt.measure(1/0,1/0,0,0),Ht=zt.measuredBounds,We=zt.naturalBounds;var Gi=0;zt instanceof gi&&(Gi=zt.strokeWidth),Xn=We.width+Gi;var ao=We.height+Gi;xt.reset(),xt.translate(-Ht.x,-Ht.y),xt.scale(zt.scale,zt.scale),xt.rotate($e===Es?zt.angle:cn,Xn/2,ao/2),$e!==$g&&$e!==ep||xt.rotate(90,Xn/2,ao/2),$e!==tp&&$e!==np||xt.rotate(-90,Xn/2,ao/2),$e===Qm&&(45<cn&&135>cn||225<cn&&315>cn)&&xt.rotate(-cn,Xn/2,ao/2),We=new Ce(0,0,Xn,ao),Mt.xi(We,le),xt.Ga(Mt),le=-Mt.x+Gi/2*zt.scale,zt=-Mt.y+Gi/2*zt.scale,It.assign(mn),Gi=isNaN(mn.x);var Cr=isNaN(mn.y);if(Gi||Cr){Xn=Xn/2+3,ao=ao/2+3;var Er=45<=cn&&135>=cn,fs=225<=cn&&315>=cn;$e===Es&&(Er||fs)?(It.x=Cr?Xn:mn.y,It.y=Gi?ao:mn.x,Er?0<=Vt||isNaN(Vt)&&.5>Xt||!Gi||(It.y=-ao):fs&&((0<=Vt||isNaN(Vt)&&.5>Xt)&&Gi&&(It.y=-ao),Cr&&(It.x=-Xn))):(Gi&&(It.x=0<=Vt||isNaN(Vt)&&.5>Xt?Xn:-Xn),Cr&&(It.y=-ao),It.rotate(cn))}else It.rotate(cn);Te+=It.x,oi+=It.y,We.set(Ht),We.h(Te+le,oi+zt,Ht.width,Ht.height),yt.push(We),x.ed(We)}}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),To(b,x.width||0,x.height||0),ci.free(xt),Bt.free(Mt),Bt.free(It)}}}},wm.prototype.arrange=function(a,y){var x=y.length;if(a instanceof Ii||a instanceof Ve){var E=a,b=null;a instanceof Ii&&(b=a,E=b.adornedPart);var z=a instanceof Ii?null:E.path,tt=a.j;if(tt.length!==0){var ot=0;if(z!==null&&ot<tt.length){var rt=tt[ot];ot++,z.arrange(rt.x-a.jg.x,rt.y-a.jg.y,rt.width,rt.height)}for(rt=0;rt<x;rt++){var at=y[rt];if(at!==z&&ot<tt.length){var ut=tt[ot];ot++,at.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 Ve)for(z=a.labelNodes;z.next();){var ft=a;tt=z.value,ot=tt.segmentIndex,rt=tt.segmentFraction;var mt=tt.alignmentFocus;if(at=tt.segmentOrientation,ut=tt.segmentOffset,isNaN(ot)){var yt=ft.ua,xt=ln();yt.Qu(rt,xt);var Mt=Bt.allocAt(xt[0],xt[1]);Mt.add(ft.i(0)),yt.type===Ue.j||(yt=yt.figures.first()),Mt.offset(-yt.startX,-yt.startY),yt=xt[2],at!==Es&&(ft=ft.computeAngle(tt,at,yt),tt.angle=ft),ft=Mt.x;var It=Mt.y;Bt.free(Mt),Be(xt)}else if(ot<-x||ot>=x)xt=Bt.alloc(),yt=ft,It=xt,yt.vg(),yt.computeMidPoint(It),yt=ft.midAngle,at!==Es&&(ft=ft.computeAngle(tt,at,yt),tt.angle=ft),ft=xt.x,It=xt.y,Bt.free(xt);else{if(Mt=0,0<=ot?(xt=y.s[ot],It=ot<x-1?y.s[ot+1]:xt):(Mt=x+ot,xt=y.s[Mt],It=0<Mt?y.s[Mt-1]:xt),xt.Xa(It)){0<=ot?(yt=0<ot?y.s[ot-1]:xt,Mt=ot<x-2?y.s[ot+2]:It):(yt=Mt<x-1?y.s[Mt+1]:xt,Mt=1<Mt?y.s[Mt-2]:It);var Tt=yt.Bf(xt),zt=It.Bf(Mt);yt=Tt>zt+10?0<=ot?yt.ab(xt):xt.ab(yt):zt>Tt+10?0<=ot?It.ab(Mt):Mt.ab(It):0<=ot?yt.ab(Mt):Mt.ab(yt)}else yt=0<=ot?xt.ab(It):It.ab(xt);at!==Es&&(ft=ft.computeAngle(tt,at,yt),tt.angle=ft),ft=xt.x+(It.x-xt.x)*rt,It=xt.y+(It.y-xt.y)*rt}if(mt.ys())tt.location=new Bt(ft,It);else{mt.Mc()&&(mt=ji),xt=ci.alloc(),xt.reset(),xt.scale(tt.scale,tt.scale),xt.rotate(tt.angle,0,0);var Ht=tt.naturalBounds;Mt=Ce.allocAt(0,0,Ht.width,Ht.height),Tt=Bt.alloc(),Tt.xi(Mt,mt),xt.Ga(Tt),mt=-Tt.x,zt=-Tt.y;var Vt=Ht.width,Xt=Ht.height;Ht=Bt.alloc(),Ht.assign(ut);var le=isNaN(ut.x),$e=isNaN(ut.y);if(le||$e){Vt=Vt/2+3,Xt=Xt/2+3;var mn=45<=yt&&135>=yt,cn=225<=yt&&315>=yt;at===Es&&(mn||cn)?(Ht.x=$e?Vt:ut.y,Ht.y=le?Xt:ut.x,mn?0<=ot||isNaN(ot)&&.5>rt||!le||(Ht.y=-Xt):cn&&((0<=ot||isNaN(ot)&&.5>rt)&&le&&(Ht.y=-Xt),$e&&(Ht.x=-Vt))):(le&&(Ht.x=0<=ot||isNaN(ot)&&.5>rt?Vt:-Vt),$e&&(Ht.y=-Xt),Ht.rotate(yt))}else Ht.rotate(yt);ft+=Ht.x,It+=Ht.y,xt.pp(Mt),mt+=Mt.x,zt+=Mt.y,ot=Bt.allocAt(ft+mt,It+zt),tt.move(ot),Bt.free(ot),Bt.free(Ht),Bt.free(Tt),Ce.free(Mt),ci.free(xt)}}b!==null?b.Ul(!1):E.Ul(!1),E=AS(a),a.location.h(a.position.x+E.x,a.position.y+E.y),Bt.free(E)}};function iS(a,y,x,E){if(Sa(E)!==!1){var b=E.strokeWidth;b===0&&a instanceof Ii&&a.type===ze.Link&&a.adornedObject instanceof gi&&(b=a.adornedObject.strokeWidth),b*=E.Ca,a instanceof Ve&&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 Ii&&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),fr(E,!1)}}function Gg(){this.xa="Base"}he(Gg,vr),Gg.prototype.measure=function(a,y,x,E,b,z,tt){var ot=a.Pb();a.graduatedBounds=[];var rt=ot.margin,at=rt.right+rt.left,ut=rt.top+rt.bottom;ot.measure(y,x,z,tt);var ft=ot.measuredBounds,mt=new Ce(-rt.left,-rt.top,Math.max(ft.width+at,0),Math.max(ft.height+ut,0));a.graduatedBounds.push(mt),b.assign(mt);for(var yt=ot.geometry,xt=ot.strokeWidth,Mt=yt.flattenedSegments,It=yt.flattenedLengths,Tt=yt.flattenedTotalLength,zt=Mt.length,Ht=0,Vt=0,Xt=ln(),le=0;le<zt;le++){var $e=Mt[le],mn=[];Vt=Ht=0;for(var cn=$e.length,We=0;We<cn;We+=2){var Te=$e[We],oi=$e[We+1];if(We!==0){var Xn=180*Math.atan2(oi-Vt,Te-Ht)/Math.PI;0>Xn&&(Xn+=360),mn.push(Xn)}Ht=Te,Vt=oi}Xt.push(mn)}if(a.graduatedIntervals===null){for(var Gi=[],ao=a.O.s,Cr=ao.length,Er=0;Er<Cr;Er++){var fs=ao[Er],Lr=[];if(Gi.push(Lr),fs.visible){var rh=fs.interval;if(!(0>rh)){for(var ar=0;ar<Cr;ar++)if(ar!==Er){var xl=ao[ar];if(xl.visible&&fs.constructor===xl.constructor){var gs=xl.interval;gs>rh&&Lr.push(gs)}}}}}a.graduatedIntervals=Gi}var sh=a.graduatedIntervals,Ca=a.O.s,Ja=Ca.length,la=0,Js=0,qh=Tt;a.graduatedMarks=[];for(var wl,Vf=0;Vf<Ja;Vf++){var ua=Ca[Vf];if(wl=[],ua.visible&&ua!==ot){var ps=Math.abs(ua.interval),Mp=a.graduatedTickUnit;if(!(2>Mp*ps*Tt/a.graduatedRange&&ua.graduatedSkip===null)){var Ac=It[0][0],Rl=0,Qs=0;Js=Tt*ua.graduatedStart-1e-4,qh=Tt*ua.graduatedEnd+1e-4;var _d=Mp*ps,ha=a.graduatedTickBase;if(ha<a.graduatedMin){var $h=(a.graduatedMin-ha)/_d;$h=$h%1===0?$h:Math.floor($h+1),ha+=$h*_d}else ha>a.graduatedMin+_d&&(ha-=Math.floor((ha-a.graduatedMin)/_d)*_d);for(var _0=sh[Vf],Ep=ha,zy=1e-6*a.graduatedMax,ru=1;ha<=a.graduatedMax+zy;ru++){t:{for(var Pu=_0.length,Bc=0;Bc<Pu;Bc++){var td=(ha-a.graduatedTickBase)%(_0[Bc]*a.graduatedTickUnit),Uf=1e-6*a.graduatedTickUnit;if(td<Uf&&td>-Uf){var ed=!1;break t}}ed=!0}if(ed&&(ha>a.graduatedMax&&(ha=a.graduatedMax),ua.graduatedSkip===null||ua instanceof uo&&!ua.graduatedSkip(ha,ua)||ua instanceof gi&&!ua.graduatedSkip(ha,ua))&&(la=(ha-a.graduatedMin)*Tt/a.graduatedRange,la>Tt&&(la=Tt),Js<=la&&la<=qh)){for(var su=Xt[Rl][Qs],ah=It[Rl][Qs];Rl<It.length;){for(;la>Ac&&Qs<It[Rl].length-1;)Qs++,su=Xt[Rl][Qs],ah=It[Rl][Qs],Ac+=ah;if(la<=Ac)break;Rl++,Qs=0,su=Xt[Rl][Qs],ah=It[Rl][Qs],Ac+=ah}var qs=Mt[Rl],jl=qs[2*Qs],z0=qs[2*Qs+1],Cu=(la-(Ac-ah))/ah,Yf=new Bt(jl+(qs[2*Qs+2]-jl)*Cu+xt/2-yt.bounds.x,z0+(qs[2*Qs+3]-z0)*Cu+xt/2-yt.bounds.y);Yf.scale(ot.scale,ot.scale);t:{var Pl=su,zd=Xt[Rl];if(!(.5005>Cu&&.4995<Cu)){var _l=Pl;if(.5>Cu?0<Qs?_l=zd[Qs-1]:qt.$(qs[0],qs[qs.length-2])&&qt.$(qs[1],qs[qs.length-1])&&(_l=zd[zd.length-1]):.5<Cu&&(Qs+1<zd.length?_l=zd[Qs+1]:qt.$(qs[0],qs[qs.length-2])&&qt.$(qs[1],qs[qs.length-1])&&(_l=zd[0])),Pl!==_l){var Dc=Math.abs(Pl-_l);if(180<Dc&&(Pl<_l?Pl+=360:_l+=360,Dc=Math.abs(Pl-_l)),5e-4>Cu||.9995<Cu){su=(Pl+_l)/2%360;break t}if(10>Dc){var Zf=1-Math.abs(.5-Cu);su=(Pl*Zf+_l*(1-Zf))%360;break t}}}su=Pl}if(ua instanceof uo){var dl="";ua.graduatedFunction!==null?(dl=ua.graduatedFunction(ha,ua),dl=dl!=null?dl.toString():""):dl=(+ha.toFixed(2)).toString(),dl!==""&&wl.push({$l:Yf,angle:su,text:dl})}else wl.push({$l:Yf,angle:su})}ha=Ep+ru*_d}}}a.graduatedMarks.push(wl)}Be(Xt);var _r=a.graduatedMarks;if(_r!==null)for(var bp=E.length,As=0;As<bp;As++){var lr=E[As],Bs=_r[As];if(lr.visible&&lr!==ot&&Bs.length!==0){if(lr instanceof gi){var Lu=a,lh=b,Gd=lr.alignmentFocus;Gd.Mc()&&(Gd=Jo);var Gy=lr.angle;lr.Kb=0,lr.measure(1/0,1/0,0,0),lr.Kb=Gy;var G0=lr.measuredBounds,Kf=G0.width,Hd=G0.height,Oc=Ce.allocAt(0,0,Kf,Hd),$s=Bt.alloc();$s.xi(Oc,Gd),Ce.free(Oc);for(var ku=-$s.x,Cl=-$s.y,Ia=new Ce,nd=Bs.length,Xf=0;Xf<nd;Xf++)for(var id=Bs[Xf],H0=id.$l.x,Jf=id.$l.y,qo=id.angle,cl=0;4>cl;cl++){switch(cl){case 0:$s.h(ku,Cl);break;case 1:$s.h(ku+Kf,Cl);break;case 2:$s.h(ku,Cl+Hd);break;case 3:$s.h(ku+Kf,Cl+Hd)}$s.rotate(qo+lr.angle),$s.offset(H0,Jf),Xf===0&&cl===0?Ia.h($s.x,$s.y,0,0):Ia.Ye($s),$s.offset(-H0,-Jf),$s.rotate(-qo-lr.angle)}Bt.free($s),Lu.graduatedBounds!==null&&Lu.graduatedBounds.push(Ia),Wo(lh,Ia.x,Ia.y,Ia.width,Ia.height)}else if(lr instanceof uo){var Qa=a,W0=b;Qa.temporaryTextBlock===null&&(Qa.temporaryTextBlock=new uo);var da=Qa.temporaryTextBlock;yS(da,lr);var uh=lr.alignmentFocus;uh.Mc()&&(uh=Jo);for(var qa=lr.segmentOrientation,Qf=lr.segmentOffset,od=new Ce,Fp=0,qf=0,zl=0,Wd=0,rd=0,$f=Bs.length,hh=0;hh<$f;hh++){var au=Bs[hh];Fp=au.$l.x,qf=au.$l.y,zl=au.angle,rd=Wd=lr.angle,qa!==Es&&(rd=qa===qg||qa===Jm?zl+lr.angle:zl,Wd=Ve.computeAngle(qa,rd)),da.Kb=Wd,da.text=au.text||"",da.measure(1/0,1/0,0,0);var dh=da.measuredBounds,Mu=da.naturalBounds,ch=Mu.width,Vd=Mu.height,Ll=ci.alloc();Ll.reset(),Ll.translate(-dh.x,-dh.y),Ll.scale(da.scale,da.scale),Ll.rotate(rd,ch/2,Vd/2),qa!==$g&&qa!==ep||Ll.rotate(90,ch/2,Vd/2),qa!==tp&&qa!==np||Ll.rotate(-90,ch/2,Vd/2),qa===Qm&&(45<zl&&135>zl||225<zl&&315>zl)&&Ll.rotate(-zl,ch/2,Vd/2);var Ic=Ce.allocAt(0,0,ch,Vd),fh=Bt.alloc();fh.xi(Ic,uh),Ll.Ga(fh);var Rc=-fh.x,Hy=-fh.y,Eu=Bt.alloc();Eu.assign(Qf),isNaN(Eu.x)&&(Eu.x=ch/2+3),isNaN(Eu.y)&&(Eu.y=-(Vd/2+3)),Eu.rotate(zl),Fp+=Eu.x+Rc,qf+=Eu.y+Hy;var Ud=new Ce(Fp,qf,dh.width,dh.height),Np=new Ce(dh.x,dh.y,dh.width,dh.height),Wy=new Ce(Mu.x,Mu.y,Mu.width,Mu.height);au.Sz=Wd,au.lineCount=da.lineCount,au.lines=[da.Cb,da.Ih,da.df,da.Le,da.Qc,da.Qb,da.ze],au.actualBounds=Ud,au.measuredBounds=Np,au.naturalBounds=Wy,hh===0?od.assign(Ud):od.ed(Ud),Bt.free(Eu),Bt.free(fh),Ce.free(Ic),ci.free(Ll)}Qa.graduatedBounds!==null&&Qa.graduatedBounds.push(od),Wo(W0,od.x,od.y,od.width,od.height)}fr(lr,!1)}}},Gg.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,ot=z[tt];tt++,E!==null&&E.arrange(ot.x-x.x,ot.y-x.y,ot.width,ot.height);for(var rt=y.length,at=0;at<rt;at++){var ut=y[at];ot=b[at],ut.visible&&ut!==E&&ot.length!==0&&(ot=z[tt],tt++,ut.arrange(ot.x-x.x,ot.y-x.y,ot.width,ot.height))}a.graduatedBounds=null}}},Gg.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 ra,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 ot=z.actualBounds,rt=a.O.s,at=a.graduatedMarks,ut=rt.length,ft=0;ft<ut;ft++){var mt=rt[ft],yt=at[ft],xt=yt.length;if(mt.visible&&mt!==z&&yt.length!==0){if(mt instanceof gi){if(!(2>a.graduatedTickUnit*mt.interval*z.geometry.flattenedTotalLength/a.graduatedRange*tt&&mt.graduatedSkip===null)){var Mt=mt.measuredBounds,It=mt.strokeWidth*mt.scale,Tt=mt.alignmentFocus;Tt.Mc()&&(Tt=Jo);for(var zt=0;zt<xt;zt++){var Ht=yt[zt].$l,Vt=yt[zt].angle,Xt=Tt,le=mt.Ab;le.reset(),le.translate(Ht.x+ot.x,Ht.y+ot.y),le.rotate(Vt+mt.angle,0,0),le.translate(-Mt.width*Xt.x+Xt.offsetX+It/2,-Mt.height*Xt.y+Xt.offsetY+It/2),le.scale(mt.scale,mt.scale),Ua(mt,!1),mt.wh.set(mt.Ab),mt.Kk=mt.scale,Fa(mt,!1),mt.gc(y,x),b&&(a.svg.appendChild(mt.svg),mt.svg=null),mt.Ab.reset()}}}else if(mt instanceof uo)for(a.temporaryTextBlock===null&&(a.temporaryTextBlock=new uo),Mt=a.temporaryTextBlock,yS(Mt,mt),It=0;It<xt;It++)Tt=yt[It],Tt.actualBounds&&Tt.measuredBounds&&Tt.naturalBounds&&(Mt.ec=Tt.text||"",Mt.Kb=Tt.Sz||0,Mt.Gc=Tt.lineCount||0,zt=Tt.lines,zt!==void 0&&(Mt.Cb=zt[0],Mt.Ih=zt[1],Mt.df=zt[2],Mt.Le=zt[3],Mt.Qc=zt[4],Mt.Qb=zt[5],Mt.ze=zt[6]),Tt.naturalBounds&&(Mt.dc=Tt.naturalBounds),Tt.actualBounds&&(zt=Tt.actualBounds,Mt.arrange(zt.x,zt.y,zt.width,zt.height)),zt=Tt.actualBounds,Mt.arrange(zt.x,zt.y,zt.width,zt.height),Ht=Tt.measuredBounds,Tt=Tt.naturalBounds,Vt=Mt.Ab,Vt.reset(),Vt.translate(zt.x+ot.x,zt.y+ot.y),Vt.translate(-Ht.x,-Ht.y),Mt.no(Vt,Tt.x,Tt.y,Tt.width,Tt.height),Ua(Mt,!1),Mt.wh.set(Mt.Ab),Mt.Kk=Mt.scale,Fa(Mt,!1),Mt.Ng=mt.part,Mt.Me=mt.panel,Mt.gc(y,x),Mt.Me=null,Mt.Ng=null,b&&(a.svg.appendChild(Mt.svg),Mt.svg=null))}}x.$i=E,y.restore(),y.Vc(!0)};function ze(a,y){if(Jt.call(this),this.na=null,a===void 0)this.na=ze.Position;else if(typeof a=="string"){var x=rl.I(a);x!==null&&(this.na=x)}else a instanceof vr?this.na=a:a&&(this.na=ze.Position,y=a);this.na===null&&Wt("Panel type not specified or PanelLayout not loaded: "+a),this.l=this.l|4194304|(this.na===ze.Grid?1048576:0),this.O=new ke,this.yb=Vr,this.Tm=Fr,this.Uf=ui,this.$g=null,this.$e="",this.jg=new Ce(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=wn,this.jn=ko,this.kn=vo,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,y&&Object.assign(this,y)}he(ze,Jt),ze.prototype.cloneProtected=function(a){Jt.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},ze.prototype.Af=function(a){Jt.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},ze.prototype.copy=function(){var a=Jt.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 nn&&(z.Te=!0);var ot=a.diagram;ot!==null&&ot.undoManager.isUndoingRedoing||z.cb(ir,"elements",a,null,b,null,tt)}}return a}return null},Ct=ze.prototype,Ct.toString=function(){return"Panel("+this.type.name+")#"+ti(this)},Ct.Pn=function(a){Jt.prototype.Pn.call(this,a);for(var y=this.O.s,x=y.length,E=0;E<x;E++)y[E].Pn(a)},Ct.hh=function(a,y){if(this.na===ze.Grid)a.yc(),this.na.gc(this,a,y);else if(this.na===ze.Graduated)a.yc(),this.na.gc(this,a,y);else{if(this.na===ze.Table)if(a.yc(),a instanceof ra){var x=a.yd;a.yd=lm(a,"gojs-ts"),gv(this,a),a.nh.pop(),a.yd=x}else gv(this,a);(x=this.isClipping&&this.na===ze.Spot)&&a.save();for(var E=this.Pb(),b=this.O.s,z=b.length,tt=0;tt<z;tt++){var ot=b[tt];x&&ot===E&&(a.clipInsteadOfFill=!0),ot.gc(a,y),x&&ot===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&&Pm(a,y,!0,x,!0),E!==null&&Pm(a,y,!1,E,!0),x!==null&&oS(a,y,!0,x),E!==null&&oS(a,y,!1,E),x!==null&&Pm(a,y,!0,x,!1),E!==null&&Pm(a,y,!1,E,!1)}function oS(a,y,x,E){for(var b=E.length,z=a.actualBounds,tt=a.naturalBounds,ot=!0,rt=0;rt<b;rt++){var at=E[rt];if(at!==void 0&&at.actual!==0)if(ot)ot=!1;else{if(x){if(at.position>tt.height)continue}else if(at.position>tt.width)continue;var ut=at.separatorStrokeWidth;isNaN(ut)&&(ut=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var ft=at.separatorStroke;if(ft===null&&(ft=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),ut!==0&&ft!==null){Xo(a,y,ft,!1,!1,tt,z),ft=!1;var mt=at.separatorDashArray;mt===null&&(mt=x?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray),mt!==null&&(ft=!0,y.js(mt,0)),y.beginPath(),mt=at.position+ut,x?mt>tt.height&&(ut-=mt-tt.height):mt>tt.width&&(ut-=mt-tt.width),at=at.position+ut/2,y.lineWidth=ut,ut=a.yb,x?(at+=ut.top,mt=tt.width-ut.right,y.moveTo(ut.left,at),y.lineTo(mt,at)):(at+=ut.left,mt=tt.height-ut.bottom,y.moveTo(at,ut.top),y.lineTo(at,mt)),y.stroke(),y.Se(),ft&&y.fs()}}}}function Pm(a,y,x,E,b){for(var z=E.length,tt=a.actualBounds,ot=a.naturalBounds,rt=rS(a,!0),at=rS(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 mt=x?tt.height:tt.width;if(!(ft.position>mt)){var yt=ft.Wc(),xt=ft.separatorStrokeWidth;isNaN(xt)&&(xt=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var Mt=ft.separatorStroke;Mt===null&&(Mt=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),(Mt===null||ft.index===(x?rt:at))&&(xt=0),yt-=xt,xt=ft.position+xt,yt+=ft.actual,xt+yt>mt&&(yt=mt-xt),0>=yt||(mt=a.yb,Xo(a,y,ft.background,!0,!1,ot,tt),x?y.fillRect(mt.left,xt+mt.top,tt.width-(mt.left+mt.right),yt):y.fillRect(xt+mt.left,mt.top,yt,tt.height-(mt.top+mt.bottom)))}}}}function rS(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"}Ct.lv=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].lv();this.Uc=!0},Ct.kk=function(a,y,x){if(!Jt.prototype.kk.call(this,a,y,x))return!1;if(this.type===ze.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===ze.Grid||this.na===ze.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},Ct.nk=function(){return!0},Ct.$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 ot=y[tt].actualBounds;b=tt===0?ot.x:Math.min(ot.x,b),z=tt===0?ot.y:Math.min(ot.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 Jt.prototype.$o.call(this,a,y,x,E)},Ct.Sj=function(a,y,x,E,b){var z=this.se(),tt=this.transform,ot=1/(tt.m11*tt.m22-tt.m12*tt.m21),rt=tt.m22*ot,at=-tt.m12*ot,ut=-tt.m21*ot,ft=tt.m11*ot,mt=ot*(tt.m21*tt.dy-tt.m22*tt.dx),yt=ot*(tt.m12*tt.dx-tt.m11*tt.dy);if(this.areaBackground!==null)return tt=this.actualBounds,qt.Ff(tt.left,tt.top,tt.right,tt.bottom,a,y,x,E,b);if(this.background!==null)return z=a*rt+y*ut+mt,ot=a*at+y*ft+yt,a=x*rt+E*ut+mt,rt=x*at+E*ft+yt,b.h(0,0),x=this.naturalBounds,z=qt.Ff(0,0,x.width,x.height,z,ot,a,rt,b),b.transform(tt),z;z||(rt=1,ut=at=0,ft=1,yt=mt=0),ot=a*rt+y*ut+mt,a=a*at+y*ft+yt,rt=x*rt+E*ut+mt,x=x*at+E*ft+yt,b.h(rt,x),E=(rt-ot)*(rt-ot)+(x-a)*(x-a),at=!1,ft=this.O.s,yt=ft.length,ut=Bt.alloc(),mt=null,y=1/0;var xt=null,Mt=this.isClipping&&this.na===ze.Spot;Mt&&(xt=Bt.alloc(),mt=this.Pb(),(at=mt.Sj(ot,a,rt,x,xt))&&(y=(ot-xt.x)*(ot-xt.x)+(a-xt.y)*(a-xt.y)));for(var It=0;It<yt;It++){var Tt=ft[It];Tt.visible&&Tt!==mt&&Tt.Sj(ot,a,rt,x,ut)&&(at=!0,Tt=(ot-ut.x)*(ot-ut.x)+(a-ut.y)*(a-ut.y),Tt<E&&(E=Tt,b.set(ut)))}return Mt&&(y>E&&b.set(xt),Bt.free(xt)),Bt.free(ut),z&&b.transform(tt),at},Ct.Gj=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Gj();Jt.prototype.Gj.call(this)},Ct.v=function(a){if(!Sa(this)){Jt.prototype.v.call(this,a),a=null,(this.na===ze.Auto||this.na===ze.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=Gs(b,!1);(b instanceof Ms||b instanceof ze||b instanceof uo||z!==Oe)&&b.v(!0)}}}},Ct.Uj=function(){if(!Sa(this)){fr(this,!0),Kl(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Uj()}},Ct.Uk=function(){if(!(this.l&2048)){Ua(this,!0),Fa(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()}},Ct.Wu=function(){Fa(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()},Ct.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 ot=this.maxSize;isNaN(z.width)||(a=Math.min(z.width,ot.width)),isNaN(z.height)||(y=Math.min(z.height,ot.height)),a=Math.max(x,a),y=Math.max(E,y);var rt=this.yb;a=Math.max(a-rt.left-rt.right,0),y=Math.max(y-rt.top-rt.bottom,0);var at=this.O.s;at.length!==0&&this.na.measure(this,a,y,at,b,x,E),a=b.width+rt.left+rt.right,rt=b.height+rt.top+rt.bottom,isFinite(z.width)&&(a=z.width),isFinite(z.height)&&(rt=z.height),a=Math.min(ot.width,a),rt=Math.min(ot.height,rt),a=Math.max(tt.width,a),rt=Math.max(tt.height,rt),a=Math.max(x,a),rt=Math.max(E,rt),To(b,a,rt),To(this.naturalBounds,a,rt),this.Ge(0,0,a,rt)},Ct.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 Su(a){return a.part!==null?a.part.locationObject:null}Ct.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=Gs(this,!0);var z=this.measuredBounds;y=z.width,z=z.height;var tt=this.Kg,ot=tt.left+tt.right;switch(tt=tt.top+tt.bottom,y===x&&z===E&&(a=Oe),a){case Oe:(y>x||z>E)&&(this.v(),this.measure(y>x?x:y,z>E?E:z,0,0));break;case _e:this.v(!0),this.measure(x+ot,E+tt,0,0);break;case Nn:this.v(!0),this.measure(x+ot,z+tt,0,0);break;case Wn:this.v(!0),this.measure(y+ot,E+tt,0,0)}}this.na.arrange(this,b,this.jg)}},Ct.gh=function(a){var y=this.naturalBounds,x=Su(this);if(Or(0,0,y.width,y.height,a.x,a.y)){y=this.O.s;for(var E=y.length,b=Bt.allocAt(0,0);E--;){var z=y[E];if((z.visible||z===x)&&(ki(b.set(a),z.transform),z.ca(b)))return Bt.free(b),!0}return Bt.free(b),!(this.Ma===null&&this.areaBackground===null)}return!1},Ct.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},Ct.qm=function(a,y){if(y(this,a),a instanceof ze){a=a.O.s;for(var x=a.length,E=0;E<x;E++)this.qm(a[E],y)}};function Td(a,y){sS(a,a,y)}function sS(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 ze&&sS(a,z,x)}}function vx(a,y){aS(a,a,y)}function aS(a,y,x){if(x(y),y instanceof ze){y=y.O.s;for(var E=y.length,b=0;b<E;b++)aS(a,y[b],x)}}Ct.Nl=function(a){return lS(this,this,a)};function lS(a,y,x){if(x(y))return y;if(y instanceof ze){y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=lS(a,y[b],x);if(z!==null)return z}}return null}Ct.fb=function(a){if(this.name===a)return this;var y=this.O.s,x=y.length;this.Hh===null&&this.itemTemplateMap===null||(x=Hg(this));for(var E=0;E<x;E++){var b=y[E];if(b instanceof ze){var z=b.fb(a);if(z!==null)return z}if(b.name===a)return b}return null};function uS(a){a=a.O.s;for(var y=a.length,x=0,E=0;E<y;E++){var b=a[E];b instanceof ze?x=Math.max(x,uS(b)):b instanceof gi&&(x=Math.max(x,b.ig/2*b.strokeMiterLimit*b.Df()))}return x}Ct.se=function(){return!(this.type===ze.TableRow||this.type===ze.TableColumn)};function Xu(a){return a.type===ze.TableRow||a.type===ze.TableColumn}Ct.ic=function(a,y,x){if(this.pickable===!1||(y===void 0&&(y=null),x===void 0&&(x=null),Ls(this)))return null;var E=this.naturalBounds,b=1/this.Df(),z=this.se(),tt=z?a:ki(Bt.allocAt(a.x,a.y),this.transform),ot=this.diagram,rt=10,at=5;if(ot!==null&&(rt=ot.Ql("extraTouchArea"),at=rt/2),Or(-(at*b),-(at*b),E.width+rt*b,E.height+rt*b,tt.x,tt.y)){if(!this.isAtomic){b=this.O.s;var ut=b.length;if(ot=Bt.alloc(),at=(rt=this.isClipping&&this.na===ze.Spot)?this.Pb():null,rt&&(at.se()?ki(ot.set(a),at.transform):ot.set(a),!at.ca(ot)))return Bt.free(ot),z||Bt.free(tt),null;for(var ft=Su(this);ut--;){var mt=b[ut];if((mt.visible||mt===ft)&&(mt.se()?ki(ot.set(a),mt.transform):ot.set(a),!rt||mt!==at)){var yt=null;if(mt instanceof ze?yt=mt.ic(ot,y,x):mt.pickable===!0&&mt.ca(ot)&&(yt=mt),yt!==null&&(y!==null&&(yt=y(yt)),yt!==null&&(x===null||x(yt))))return Bt.free(ot),z||Bt.free(tt),yt}}Bt.free(ot)}return this.background===null&&this.areaBackground===null?(z||Bt.free(tt),null):(a=Or(0,0,E.width,E.height,tt.x,tt.y)?this:null,z||Bt.free(tt),a)}return z||Bt.free(tt),null},Ct.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:ki(Bt.allocAt(a.x,a.y),this.transform);if(b=Or(0,0,b.width,b.height,tt.x,tt.y),Xu(this)||b){if(!this.isAtomic){for(var ot=this.O.s,rt=ot.length,at=Bt.alloc(),ut=Su(this);rt--;){var ft=ot[rt];if(ft.visible||ft===ut){ft.se()?ki(at.set(a),ft.transform):at.set(a);var mt=ft;ft=ft instanceof ze?ft:null,(ft!==null?ft.ji(at,y,x,E):mt.ca(at))&&mt.pickable!==!1&&(y!==null&&(mt=y(mt)),mt===null||x!==null&&!x(mt)||E.add(mt))}}Bt.free(at)}return z||Bt.free(tt),b&&(this.background!==null||this.areaBackground!==null)}return z||Bt.free(tt),!1},Ct.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=ci.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&ci.free(tt),!0;if(this.Yc(a,tt)){if(!this.isAtomic)for(var ot=Su(this),rt=this.O.s,at=rt.length;at--;){var ut=rt[at];if(ut.visible||ut===ot){var ft=ut.actualBounds,mt=this.naturalBounds;ft.x>mt.width||ft.y>mt.height||0>ft.x+ft.width||0>ft.y+ft.height||(ft=ut,ut=ut instanceof ze?ut:null,mt=ci.alloc(),mt.set(tt),(ut!==null?ut.Cf(a,y,x,E,b,mt):Pr(ft,a,E,mt))&&(y!==null&&(ft=y(ft)),ft===null||x!==null&&!x(ft)||b.add(ft)),ci.free(mt))}}return z===void 0&&ci.free(tt),E}return z===void 0&&ci.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 ot=tt.actualBounds,rt=a.naturalBounds;ot.x>rt.width||ot.y>rt.height||0>ot.x+ot.width||0>ot.y+ot.height||(tt instanceof ze&&mv(tt,y,x,E),y!==null&&(tt=y(tt)),tt===null||x!==null&&!x(tt)||E.add(tt))}}}Ct.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,ot=this.se(),rt=ot?a:ki(Bt.allocAt(a.x,a.y),this.transform),at=ot?y:ki(Bt.allocAt(y.x,y.y),this.transform),ut=rt.Bf(at),ft=0<rt.x&&rt.x<tt.width&&0<rt.y&&rt.y<tt.height||Bi(rt.x,rt.y,0,0,0,tt.height)<=ut||Bi(rt.x,rt.y,0,tt.height,tt.width,tt.height)<=ut||Bi(rt.x,rt.y,tt.width,tt.height,tt.width,0)<=ut||Bi(rt.x,rt.y,tt.width,0,0,0)<=ut;if(tt=rt.zd(0,0)<=ut&&rt.zd(0,tt.height)<=ut&&rt.zd(tt.width,0)<=ut&&rt.zd(tt.width,tt.height)<=ut,ot||(Bt.free(rt),Bt.free(at)),ft){if(!this.isAtomic){rt=Bt.alloc(),at=Bt.alloc(),ut=Su(this);for(var mt=this.O.s,yt=mt.length;yt--;){var xt=mt[yt];if(xt.visible||xt===ut){var Mt=xt.actualBounds,It=this.naturalBounds;(!ot||!(Mt.x>It.width||Mt.y>It.height||0>Mt.x+Mt.width||0>Mt.y+Mt.height))&&(xt.se()?(Mt=xt.transform,ki(rt.set(a),Mt),ki(at.set(y),Mt)):(rt.set(a),at.set(y)),Mt=xt,xt=xt instanceof ze?xt:null,(xt!==null?xt.og(rt,at,x,E,b,z):Mt.tx(rt,at,b))&&(x!==null&&(Mt=x(Mt)),Mt===null||E!==null&&!E(Mt)||z.add(Mt)))}}Bt.free(rt),Bt.free(at)}return b?ft:tt}return!1};function vv(a){var y=null;return a instanceof gi&&(y=a.spot1,y===Fr&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot1)),y===null&&(y=io),y}function yv(a){var y=null;return a instanceof gi&&(y=a.spot2,y===Fr&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot2)),y===null&&(y=Os),y}Ct.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},Ct.M=function(a){return this.O.M(a)},Ct.Gb=function(a,y){y instanceof On&&Wt("Cannot add a Part to a Panel: "+y+"; use a Panel instead"),(this===y||this.rg(y))&&(this===y&&Wt("Cannot make a Panel contain itself: "+this.toString()),Wt("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+y.toString()));var x=y.panel;if(x!==null&&x!==this&&Wt("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!==ze.Grid||y instanceof gi||Wt("Can only add Shapes to a Grid Panel, not: "+y),this.na!==ze.Graduated||y instanceof gi||y instanceof uo||Wt("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 kn),this.ge.add(E,y))}var b=this.O;if(E=-1,x===this){for(var z=-1,tt=this.O.s,ot=tt.length,rt=0;rt<ot;rt++)if(tt[rt]===y){z=rt;break}if(z!==-1){if(z===a||z+1>=b.count&&a>=b.count)return;b.mb(z),E=z}else Wt("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),Sa(this)||this.v(),y.v(!1),y.portId!==null?this.Te=!0:y instanceof ze&&y.Te===!0&&(this.Te=!0),this.graduatedIntervals=null,this.If()||Lm(this,y,!1),x=this.part,x!==null&&(x.Rh=null,x.ag=NaN,this.Te&&x instanceof nn&&(x.Te=!0),x.Te&&x instanceof nn&&(x.wc=null),b=this.diagram,b!==null&&b.undoManager.isUndoingRedoing||(E!==-1&&x.cb(mr,"elements",this,y,null,E,null),x.cb(ir,"elements",this,null,y,null,a)))};function Sv(a,y){a.l=y?a.l|16777216:a.l&-16777217}Ct.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)},Ct.mb=function(a){0<=a&&this.pc(a,!0)},Ct.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),fr(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 nn&&(E instanceof ze?E.qm(E,function(tt,ot){Hv(z,ot,y)}):Hv(z,E,y)),x=this.diagram,x!==null&&x.undoManager.isUndoingRedoing||z.cb(mr,"elements",this,E,null,a,null))},Ct.Fb=function(a){0>a&&an(a,">= 0",ze,"getRowDefinition:idx"),a=Math.round(a);var y=this.rowDefs;if(y[a]===void 0){var x=new gr;x.wi(this),x.isRow=!0,x.index=a,y[a]=x,this.cb(ir,"rowdefs",this,null,x,null,a)}return y[a]},Ct.oA=function(a){if(0>a&&an(a,">= 0",ze,"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(mr,"rowdefs",this,x,null,a,null),this.v()}}};function hS(a,y,x){var E=a.rowDefs;if(!(0>y)){if(E[y]=x instanceof gr?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}Ct.Eb=function(a){0>a&&an(a,">= 0",ze,"getColumnDefinition:idx"),a=Math.round(a);var y=this.colDefs;if(y[a]===void 0){var x=new gr;x.wi(this),x.isRow=!1,x.index=a,y[a]=x,this.cb(ir,"coldefs",this,null,x,null,a)}return y[a]},Ct.jA=function(a){if(0>a&&an(a,">= 0",ze,"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(mr,"coldefs",this,x,null,a,null),this.v()}}};function dS(a,y,x){var E=a.colDefs;if(!(0>y)){if(E[y]=x instanceof gr?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}Ct.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},Ct.Hy=function(a,y){return(a=this.Fb(a))&&km(a,new gr(y)),this},Ct.By=function(a,y){return(a=this.Eb(a))&&km(a,new gr(y)),this},Ct.nz=function(a){if(0>a||this.type!==ze.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},Ct.fz=function(a){if(0>a||this.type!==ze.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},Ct.Fz=function(a,y){if(y===void 0&&(y=new Bt(NaN,NaN)),this.type!==ze.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)},Ct.Gz=function(a){if(this.type!==ze.Graduated)return NaN;var y=this.Pb();return y.transform.Cd(a),y.geometry.xx(a)*this.graduatedRange+this.graduatedMin};function cS(a){return a=a.allBindings,a!==null&&a._isFrozen}function Za(a){var y=a.allBindings;if(y===null)a.data!==null&&Wt("Template cannot have .data be non-null: "+a),a.allBindings=y=new ke;else if(y._isFrozen)return;var x=new ke;Sv(a,!1),a.qm(a,function(at,ut){ut.th();var ft=ut.localBindings;if(ft!==null)for(vc(ut,!1),ft=ft.iterator;ft.next();){var mt=ft.value;mt.mode===hp&&vc(ut,!0);var yt=mt.sourceName;yt!==null&&(yt==="/"&&Sv(at,!0),yt=M1(mt,at,ut),yt!==null&&(x.add(yt),yt.srcBindings===null&&(yt.srcBindings=new ke),yt.srcBindings.add(mt))),y.add(mt)}if(ut instanceof ze&&ut.type===ze.Table){if(0<ut.rowCount){for(at=ut.rowDefs,ft=at.length,mt=0;mt<ft;mt++)if(yt=at[mt],yt!==void 0&&yt.be!==null)for(var xt=yt.be.iterator;xt.next();){var Mt=xt.value;Mt.xd=yt,Mt.to=2,Mt.wl=yt.index,y.add(Mt)}}if(0<ut.columnCount){for(ut=ut.colDefs,at=ut.length,ft=0;ft<at;ft++)if(mt=ut[ft],mt!==void 0&&mt.be!==null)for(yt=mt.be.iterator;yt.next();)xt=yt.value,xt.xd=mt,xt.to=1,xt.wl=mt.index,y.add(xt)}}});for(var E=x.iterator;E.next();){var b=E.value;if(b.srcBindings!==null){vc(b,!0);for(var z=b.srcBindings.iterator;z.next();){var tt=z.value;b.localBindings===null&&(b.localBindings=new ke),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 ot=b.targetProperty,rt=ot.indexOf(".");0<rt&&z instanceof ze&&(tt=ot.substring(0,rt),ot=ot.substr(rt+1),rt=z.fb(tt),rt!==null?(z=rt,b.targetProperty=ot):ye('Warning: unable to find GraphObject named "'+tt+'" for Binding: '+b.toString())),z instanceof gr?(tt=ti(z.panel),b.Ai=tt===void 0?-1:tt,z.panel.bindingId=b.Ai):z instanceof Jt?(tt=ti(z),b.Ai=tt===void 0?-1:tt,z.bindingId=b.Ai):Wt("Unknown type of binding target: "+z)}y.freeze(),a instanceof On&&a.Zc()&&a.Va()}Ct.Uy=function(a){a===void 0&&(a=!1);var y=this.copy();return vx(y,function(x){x instanceof ze&&(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&&Za(y),y},Ct.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 ze))continue;b===1?z=z.Eb(x.wl):b===2&&(z=z.Fb(x.wl))}z!==void 0&&x.Mv(z,E)}}},Ct.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 ze&&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 ze)||z.data!==y[tt])return!0;b++,tt++}return!1}function Hg(a){if(a.type===ze.Spot||a.type===ze.Auto)return Math.min(a.O.length,1);if(a.type===ze.Link){a=a.O;for(var y=a.length,x=0;x<y;x++){var E=a.M(x);if(!(E instanceof gi&&E.isPanelMain))break}return x}return a.type===ze.Table&&0<a.O.length&&(a=a.O.M(0),a.isPanelMain&&a instanceof ze&&Xu(a))?1:0}Ct.mv=function(){for(var a=Hg(this);this.O.length>a;)this.pc(this.O.length-1,!1);fS(this,this.itemArray)};function fS(a,y){var x=Hg(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++)Cm(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 ze){if(tt.data!==z){var ot=wv(a,tt.data),rt=wv(a,z),at=rt!==ot;at||(ot=Pv(a,ot),at=Pv(a,rt)!==ot),at?(a.pc(E,!1),Cm(a,z,b,!1)):tt.data=z}}else Cm(a,z,b,!1)}for(;E<a.O.length;)a.pc(E,!1);a.$g=null,xv(a,x,0),Sa(a)||a.v(),a.graduatedIntervals=null,a.If()||Lm(a,a,!1),y=a.part,y!==null&&(y.Rh=null,y.ag=NaN,a.Te&&y instanceof nn&&(y.Te=!0),y.Te&&y instanceof nn&&(y.wc=null))}}function Cm(a,y,x,E){if(!(y==null||0>x)){var b=wv(a,y);if(b=Pv(a,b),b!==null){if(Za(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 kn),a.ge.add(y,b)),z=x+Hg(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 ze){var b=y,z=x;E.type===ze.TableRow?E.row=b:E.type===ze.TableColumn&&(E.column=b),E.itemIndex=z}y++,x++}}function wv(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=tr(y,a)}else return"";if(a===void 0)return"";if(typeof a=="string")return a;Wt("Panel.getCategoryForItemData found a non-string category for "+y+": "+a)}function Pv(a,y){var x=a.itemTemplateMap,E=null;return x!==null&&(E=x.I(y)),E===null&&(x!==null&&(E=x.I("")),E===null&&(gS||(gS=!0,ye('No item template Panel found for category "'+y+'" on '+a),ye(" Using default item template."),a=new ze,y=new uo,y.bind(new sr("text","",zn)),a.add(y),pS=a),E=pS)),E}function Lm(a,y,x){var E=y.enabledChanged;if(E!==null&&E(y,x),y instanceof ze){y=y.O.s,E=y.length;for(var b=0;b<E;b++){var z=y[b];x&&z instanceof ze&&!z.isEnabled||Lm(a,z,x)}}}function Ol(a,y){y.name=a,rl.add(a,y)}oe.Object.defineProperties(ze.prototype,{type:{get:function(){return this.na},set:function(a){var y=this.na;y!==a&&(this.na=a,this.isAtomic=this.na===ze.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&&an(a,">= 0",ze,"padding"),a=new yi(a)):(0>a.left&&an(a.left,">= 0",ze,"padding:value.left"),0>a.right&&an(a.right,">= 0",ze,"padding:value.right"),0>a.top&&an(a.top,">= 0",ze,"padding:value.top"),0>a.bottom&&an(a.bottom,">= 0",ze,"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:Vr},set:function(a){typeof a=="number"&&(a=new yi(a));var y=this.defaultSeparatorPadding;y.D(a)||(a=a.J(),this.T===null&&(this.T=new Aa),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 Qi)&&(a instanceof Qi&&a.freeze(),this.T===null&&(this.T=new Aa),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 Aa),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)||Wt("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 Aa),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 Qi)&&(a instanceof Qi&&a.freeze(),this.T===null&&(this.T=new Aa),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 Aa),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)||Wt("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 Aa),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 Aa),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||Wt("Invalid Panel.gridCellSize: "+a),this.jn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Al(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()||Wt("Invalid Panel.gridOrigin: "+a),this.kn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Al(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 xu),this.ra.lq=a,this.v(),this.g("graduatedMin",y,a),Wr(this)&&(a=this.part,a!==null&&wo(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 xu),this.ra.F=a,this.v(),this.g("graduatedMax",y,a),Wr(this)&&(a=this.part,a!==null&&wo(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 xu),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 xu),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 xu,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 xu,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 xu,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 xu,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 Aa),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new Aa),this.T.Oc}},columnCount:{get:function(){return this.T===null?0:this.colDefs.length}},rowSizing:{get:function(){return this.T!==null?this.T.ob:Em},set:function(a){var y=this.rowSizing;y!==a&&(this.T===null&&(this.T=new Aa),this.T.ob=a,this.v(),this.g("rowSizing",y,a))}},columnSizing:{get:function(){return this.T!==null?this.T.j:Em},set:function(a){var y=this.columnSizing;y!==a&&(this.T===null&&(this.T=new Aa),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)&&Wt("Panel.topIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Aa),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)&&Wt("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Aa),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 On&&!(this instanceof Ii);Za(this),this.ub=a;var E=this.diagram;E!==null&&(x?(x=E.partManager,this instanceof Ve?(y!==null&&x.bf.remove(y),a!==null&&x.bf.add(a,this)):this instanceof On&&(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 yc),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&&ay(x.partManager,this)),this.g("itemArray",y,a),x!==null&&x.undoManager.isUndoingRedoing||fS(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 kn}var y=this.itemTemplateMap.I("");y!==a&&((a instanceof On||a.isPanelMain)&&Wt("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(););Si(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&&(Si(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 ri&&(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&&Lm(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))}}}),oe.Object.defineProperties(ze,{Position:{get:function(){return rl.I("Position")}},Horizontal:{get:function(){return rl.I("Horizontal")}},Vertical:{get:function(){return rl.I("Vertical")}},Spot:{get:function(){return rl.I("Spot")}},Auto:{get:function(){return rl.I("Auto")}},Table:{get:function(){return rl.I("Table")}},Viewbox:{get:function(){return rl.I("Viewbox")}},TableRow:{get:function(){return rl.I("TableRow")}},TableColumn:{get:function(){return rl.I("TableColumn")}},Link:{get:function(){return rl.I("Link")}},Grid:{get:function(){return rl.I("Grid")}},Graduated:{get:function(){return rl.I("Graduated")}}}),ze.prototype.rebuildItemElements=ze.prototype.mv,ze.prototype.findItemPanelForData=ze.prototype.sx,ze.prototype.updateTargetBindings=ze.prototype.La,ze.prototype.copyTemplate=ze.prototype.Uy,ze.prototype.graduatedValueForPoint=ze.prototype.Gz,ze.prototype.graduatedPointForValue=ze.prototype.Fz,ze.prototype.findColumnForLocalX=ze.prototype.fz,ze.prototype.findRowForLocalY=ze.prototype.nz,ze.prototype.addColumnDefinition=ze.prototype.By,ze.prototype.addRowDefinition=ze.prototype.Hy,ze.prototype.addRowColumnDefinition=ze.prototype.Gy,ze.prototype.removeColumnDefinition=ze.prototype.jA,ze.prototype.getColumnDefinition=ze.prototype.Eb,ze.prototype.removeRowDefinition=ze.prototype.oA,ze.prototype.getRowDefinition=ze.prototype.Fb,ze.prototype.removeAt=ze.prototype.mb,ze.prototype.remove=ze.prototype.remove,ze.prototype.insertAt=ze.prototype.Gb,ze.prototype.elt=ze.prototype.M,ze.prototype.add=ze.prototype.add,ze.prototype.findObject=ze.prototype.fb,ze.prototype.findInVisualTree=ze.prototype.Nl,ze.prototype.walkVisualTreeFrom=ze.prototype.qm,ze.prototype.findMainElement=ze.prototype.Pb;var gS=!1,pS=null,rl=new kn;ze.className="Panel",ze.definePanelLayout=Ol,Ol("Position",new dm),Ol("Vertical",new fm),Ol("Auto",new pm),Ol("Link",new wm);function xu(){this.lq=0,this.F=100,this.ia=10,this.V=0,this.Zh=this.o=this.j=this.u=null}xu.prototype.copy=function(){var a=new xu;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},xu.className="GradPanelSettings";function Aa(){this.Pc=[],this.Oc=[],this.j=this.ob=Em,this.hb=this.Hb=0,this.Qp=Vr,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}Aa.prototype.copy=function(a){for(var y=new Aa,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},Aa.className="TablePanelSettings";function gr(a){En(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=Fr,this.pa=this.oc=this.oa=0,this.be=null,this.oo=Cv,this.hg=ui,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))}gr.prototype.copy=function(){var a=new gr;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=De(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=De(y.separatorDashArray)),a.background=y.background,a.coversSeparators=y.coversSeparators,a.be=y.be}Ct=gr.prototype,Ct.qb=function(a){a.classType===gr&&(this.sizing=a)},Ct.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+ti(this)},Ct.wi=function(a){this.Me=a},Ct.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)},Ct.Wc=function(){var a=0,y=this.Me,x=0,E=this.isRow;if(y!==null&&y.type===ze.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)},Ct.Ob=function(a,y,x){var E=this.Me;if(E!==null&&(E.cb(No,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 Mm(a){if(a.sizing===Cv){var y=a.Me;return a.isRow?y.rowSizing:y.columnSizing}return a.sizing}Ct.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new sr(a,y,x,E):b=a,b.xd=this,a=this.panel,a!==null&&(y=a.ih(),y!==null&&cS(y)&&Wt("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+b+" on "+a)),this.be===null&&(this.be=new ke),this.be.add(b),this},oe.Object.defineProperties(gr.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&&an(a,">= 0",gr,"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&&an(a,">= 0",gr,"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))&&an(a,">= 0",gr,"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&&an(a,">= 0",gr,"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 yi(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&&xc(a,"RowColumnDefinition.separatorStroke"),a instanceof Qi&&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)||Wt("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&&xc(a,"RowColumnDefinition.background"),a instanceof Qi&&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}}}),gr.prototype.computeEffectiveSpacing=gr.prototype.Wc,gr.prototype.computeEffectiveSpacingTop=gr.prototype.Io;var Cv=new Se(gr,"Default",0),Wg=new Se(gr,"None",1),Em=new Se(gr,"ProportionalExtra",2);gr.className="RowColumnDefinition",gr.Default=Cv,gr.None=Wg,gr.ProportionalExtra=Em;function gi(a,y){Jt.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)}he(gi,Jt),gi.prototype.cloneProtected=function(a){Jt.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=De(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 Ad(a){a.Na===null?a.Na=new Mv:a.Na.nc&&(a.Na=a.Na.copy())}Ct=gi.prototype,Ct.th=function(){Jt.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},Ct.qb=function(a){a===Oe||a===wn||a===Mi||a===ui?this.geometryStretch=a:Jt.prototype.qb.call(this,a)},Ct.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+ti(this)};function Pf(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 ot=x[0],rt=x[1],at,ut,ft,mt,yt,xt,Mt=0,It=ln(),Tt=2;Tt<b;Tt+=2)at=x[Tt],ut=x[Tt+1],ft=at-ot,ot=ut-rt,ft===0&&(ft=.001),mt=ot/ft,yt=Math.atan2(ot,ft),xt=Math.sqrt(ft*ft+ot*ot),It.push([ft,yt,mt,xt]),Mt+=xt,ot=at,rt=ut;ot=x[0],rt=x[1],ft=E.measuredBounds.width,E instanceof gi&&(ft-=E.strokeWidth),1>ft&&(ft=1),b=x=ft,at=tt/2,ut=at!==0,Tt=0,xt=It[Tt],ft=xt[0],yt=xt[1],mt=xt[2],xt=xt[3];for(var zt=0;.1<=Mt;){if(zt===0&&(ut?(b=x,b-=at,Mt-=at,ut=!1):b=x,b===0&&(b=1)),b>Mt){Be(It);return}b>xt?(zt=b-xt,b=xt):zt=0;var Ht=Math.sqrt(b*b/(1+mt*mt));if(0>ft&&(Ht=-Ht),ot+=Ht,rt+=mt*Ht,a.translate(ot,rt),a.rotate(yt),a.translate(-(tt/2),-(z/2)),zt===0&&E.hh(a,y),a.translate(tt/2,z/2),a.rotate(-yt),a.translate(-ot,-rt),Mt-=b,xt-=b,zt!==0){if(Tt++,Tt===It.length){Be(It);return}xt=It[Tt],ft=xt[0],yt=xt[1],mt=xt[2],xt=xt[3],b=zt}}Be(It)}}Ct.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&&Xo(this,a,E,!0,!1,tt,z);var ot=this.part,rt=this.ig;if(x===null||rt!==0||ot===null||!this.isPanelMain&&ot.Pb()!==this||(rt=ot.type===ze.Link&&ot instanceof Ii&&ot.category==="Selection"&&ot.adornedObject instanceof gi&&ot.adornedPart.Pb()===ot.adornedObject?ot.adornedObject.strokeWidth:0),rt===0&&(x=null),x!==null&&rt!==0&&(Xo(this,a,x,!1,!1,tt,z),a.lineWidth=rt,a.lineJoin=this.strokeJoin,a.lineCap=this.strokeCap,a.miterLimit=this.strokeMiterLimit),z=!1,ot&&y.Gf("drawShadows")&&(z=ot.isShadowed),a.Il===!1&&(z=!1),ot=!0,x===null||E!==null&&E!=="transparent"||(ot=!1),tt=!1,rt=this.strokeDashArray,rt!==null&&(tt=!0,a.js(rt,this.strokeDashOffset)),b.type===Ue.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===Ue.u){var at=b.startX;rt=b.startY;var ut=b.endX,ft=b.endY;b=Math.min(at,ut);var mt=Math.min(rt,ft);at=Math.abs(ut-at),rt=Math.abs(ft-rt),a.beginPath(),a.rect(b,mt,at,rt),E!==null&&a.ng(E),x!==null&&(ot&&z&&Xl(a),a.jk(),ot&&z&&mu(a)),a.Se()}else if(b.type===Ue.F)at=b.startX,rt=b.startY,ut=b.endX,ft=b.endY,b=Math.abs(ut-at)/2,mt=Math.abs(ft-rt)/2,at=Math.min(at,ut)+b,rt=Math.min(rt,ft)+mt,a.beginPath(),a.moveTo(at,rt-mt),a.bezierCurveTo(at+qt.wg*b,rt-mt,at+b,rt-qt.wg*mt,at+b,rt),a.bezierCurveTo(at+b,rt+qt.wg*mt,at+qt.wg*b,rt+mt,at,rt+mt),a.bezierCurveTo(at-qt.wg*b,rt+mt,at-b,rt+qt.wg*mt,at-b,rt),a.bezierCurveTo(at-b,rt-qt.wg*mt,at-qt.wg*b,rt-mt,at,rt-mt),a.closePath(),E!==null&&a.ng(E),x!==null&&(ot&&z&&Xl(a),a.jk(),ot&&z&&mu(a)),a.Se();else if(b.type===Ue.o)for(b=b.figures,rt=b.length,mt=0;mt<rt;mt++){at=b.s[mt],a.beginPath(),a.moveTo(at.startX,at.startY),ut=at.segments.s,ft=ut.length;for(var yt=null,xt=0;xt<ft;xt++){var Mt=ut[xt];switch(Mt.type){case wr:a.moveTo(Mt.endX,Mt.endY);break;case So:a.lineTo(Mt.endX,Mt.endY);break;case Zr:a.bezierCurveTo(Mt.point1X,Mt.point1Y,Mt.point2X,Mt.point2Y,Mt.endX,Mt.endY);break;case pa:a.quadraticCurveTo(Mt.point1X,Mt.point1Y,Mt.endX,Mt.endY);break;case ur:if(Mt.radiusX===Mt.radiusY){var It=Math.PI/180;a.arc(Mt.point1X,Mt.point1Y,Mt.radiusX,Mt.startAngle*It,(Mt.startAngle+Mt.sweepAngle)*It,0>Mt.sweepAngle,yt!==null?yt.endX:at.startX,yt!==null?yt.endY:at.startY)}else if(yt=na(Mt,at),It=yt.length,It===0)a.lineTo(Mt.centerX,Mt.centerY);else for(var Tt=0;Tt<It;Tt++){var zt=yt[Tt];Tt===0&&a.lineTo(zt[0],zt[1]),a.bezierCurveTo(zt[2],zt[3],zt[4],zt[5],zt[6],zt[7])}break;case La:if(Tt=It=0,yt!==null&&yt.type===ur){if(yt=na(yt,at),zt=yt.length,zt===0){a.lineTo(Mt.endX,Mt.endY);break}yt=yt[zt-1]||null,yt!==null&&(It=yt[6],Tt=yt[7])}else It=yt!==null?yt.endX:at.startX,Tt=yt!==null?yt.endY:at.startY;if(yt=Ga(Mt,at,It,Tt),It=yt.length,It===0){a.lineTo(Mt.endX,Mt.endY);break}for(Tt=0;Tt<It;Tt++)zt=yt[Tt],a.bezierCurveTo(zt[2],zt[3],zt[4],zt[5],zt[6],zt[7]);break;default:Wt("Segment not of valid type: "+Mt.type)}Mt.isClosed&&a.closePath(),yt=Mt}ut=at.isFilled,z?at.isShadowed?(ut===!0&&E!=="transparent"&&E!==null&&a.ng(E,at.isEvenOdd),x!==null&&(ut&&ot&&Xl(a),a.jk(),ut&&ot&&mu(a))):(Xl(a),ut&&E!=="transparent"&&E!==null&&a.ng(E,at.isEvenOdd),x!==null&&a.jk(),mu(a)):(ut&&E!==null&&a.ng(E,at.isEvenOdd),x!==null&&a.jk()),a.Se(mt)}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=ln(),z.type===Ue.j)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.endY),Pf(a,y,E,x);else if(z.type===Ue.o)for(z=z.figures.iterator;z.next();){for(ot=z.value,E.length=0,E.push(ot.startX),E.push(ot.startY),tt=ot.startX,b=ot.startY,rt=tt,mt=b,at=ot.segments.s,ut=at.length,ft=0;ft<ut;ft++){switch(xt=at[ft],xt.type){case wr:Pf(a,y,E,x),E.length=0,E.push(xt.endX),E.push(xt.endY),tt=xt.endX,b=xt.endY,rt=tt,mt=b;break;case So:E.push(xt.endX),E.push(xt.endY),tt=xt.endX,b=xt.endY;break;case Zr:qt.Qe(tt,b,xt.point1X,xt.point1Y,xt.point2X,xt.point2Y,xt.endX,xt.endY,.5,E),tt=xt.endX,b=xt.endY;break;case pa:qt.ep(tt,b,xt.point1X,xt.point1Y,xt.endX,xt.endY,.5,E),tt=xt.endX,b=xt.endY;break;case ur:if(Mt=na(xt,ot),yt=Mt.length,yt===0){E.push(xt.centerX),E.push(xt.centerY),tt=xt.centerX,b=xt.centerY;break}for(It=0;It<yt;It++)Tt=Mt[It],qt.Qe(tt,b,Tt[2],Tt[3],Tt[4],Tt[5],Tt[6],Tt[7],.5,E),tt=Tt[6],b=Tt[7];break;case La:if(Mt=Ga(xt,ot,tt,b),yt=Mt.length,yt===0){E.push(xt.endX),E.push(xt.endY),tt=xt.endX,b=xt.endY;break}for(It=0;It<yt;It++)Tt=Mt[It],qt.Qe(tt,b,Tt[2],Tt[3],Tt[4],Tt[5],Tt[6],Tt[7],.5,E),tt=Tt[6],b=Tt[7];break;default:Wt("Segment not of valid type: "+xt.type)}xt.isClosed&&(E.push(rt),E.push(mt),Pf(a,y,E,x))}Pf(a,y,E,x)}else if(z.type===Ue.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),Pf(a,y,E,x);else if(z.type===Ue.F){if(b=new xr,b.startX=z.endX,b.startY=(z.startY+z.endY)/2,tt=new _i(ur),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=na(tt,b),ot=z.length,ot===0)E.push(tt.centerX),E.push(tt.centerY);else for(tt=b.startX,b=b.startY,rt=0;rt<ot;rt++)mt=z[rt],qt.Qe(tt,b,mt[2],mt[3],mt[4],mt[5],mt[6],mt[7],.5,E),tt=mt[6],b=mt[7];Pf(a,y,E,x)}Be(E),a.restore(),a.Vc(!1)}}}},Ct.kk=function(a,y,x){return!Jt.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)},Ct.nk=function(a){return this.geometry!==null&&1<this.geometry.figures.length||this.pathPattern!==null?!0:Jt.prototype.nk.call(this,a)},Ct.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)}},Ct.ga=function(a,y){if(y===void 0&&(y=new Bt),a instanceof rn){a.Mc()&&Wt("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},Ct.mi=function(a){a===void 0&&(a=new Ce);var y=this.naturalBounds,x=this.oe;y=Ce.allocAt(y.x,y.y,y.width,y.height);var E=this.strokeWidth;return y.Bc(E/2,E/2),E=Bt.allocAt(y.x,y.y).transform(x),a.h(E.x,E.y,0,0),E.h(y.right,y.y).transform(x),Wo(a,E.x,E.y,0,0),E.h(y.right,y.bottom).transform(x),Wo(a,E.x,E.y,0,0),E.h(y.x,y.bottom).transform(x),Wo(a,E.x,E.y,0,0),Ce.free(y),Bt.free(E),a},Ct.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!==Ue.j||y||(b+=2);var z=Ce.alloc();if(z.assign(E),z.Bc(b+2,b+2),!z.ca(a))return Ce.free(z),!1;if(E=b+1e-4,x.type===Ue.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:(Ce.free(z),qt.Yb(x.startX,x.startY,x.endX,x.endY,b,a.x,a.y));if(x.type===Ue.u){y=x.startX;var tt=x.startY,ot=x.endX;if(x=x.endY,z.x=Math.min(y,ot),z.y=Math.min(tt,x),z.width=Math.abs(ot-y),z.height=Math.abs(x-tt),this.fill===null){if(z.Bc(-E,-E),z.ca(a))return Ce.free(z),!1;z.Bc(E,E)}return this.stroke!==null&&z.Bc(b,b),a=z.ca(a),Ce.free(z),a}if(x.type===Ue.F){tt=x.startX,b=x.startY,ot=x.endX;var rt=x.endY;if(x=Math.min(tt,ot),y=Math.min(b,rt),tt=Math.abs(ot-tt)/2,b=Math.abs(rt-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 Ce.free(z),!1;tt+=E,b+=E}return this.stroke!==null&&(tt+=E,b+=E),Ce.free(z),0>=tt||0>=b?!1:1>=x*x/(tt*tt)+y*y/(b*b)}if(x.type===Ue.o)return Ce.free(z),this.fill===null?Sh(x,a.x,a.y,b):za(x,a,b,1<this.strokeWidth,y);Wt("Unknown Geometry type: "+x.type)},Ct.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 ot=this.figure,rt=kv[ot];if(rt===void 0){var at=qt.Ze[ot];typeof at=="string"&&(at=qt.Ze[at]),typeof at=="function"?(rt=at(null,100,100),kv[ot]=rt):Wt("Unsupported Figure: "+ot)}tt=rt.bounds}ot=tt.width,rt=tt.height,at=tt.width;var ut=tt.height;switch(Gs(this,!0)){case Oe:E=x=0;break;case _e:at=Math.max(a-z,0),ut=Math.max(y-z,0);break;case Nn:at=Math.max(a-z,0),E=0;break;case Wn:x=0,ut=Math.max(y-z,0)}isFinite(b.width)&&(at=b.width),isFinite(b.height)&&(ut=b.height);var ft=this.maxSize,mt=this.minSize;switch(x=Math.max(x-z,mt.width),E=Math.max(E-z,mt.height),at=Math.min(ft.width,at),ut=Math.min(ft.height,ut),at=isFinite(at)?Math.max(x,at):Math.max(ot,x),ut=isFinite(ut)?Math.max(E,ut):Math.max(rt,E),x=Lv(this),x){case Oe:break;case _e:ot=at,rt=ut;break;case wn:x=Math.min(at/ot,ut/rt),isFinite(x)||(x=1),ot*=x,rt*=x;break;default:Wt(x+" is not a valid geometryStretch.")}this.Rd!==null?(ot===0&&(ot=.001),rt===0&&(rt=.001),x=this.Rd!==null?this.Rd:this.ua,tt=x.bounds,E=ot/tt.width,tt=rt/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&&qt.$(this.ua.Sk,a-z)&&qt.$(this.ua.Rk,y-z)||(this.ua=gi.makeGeometry(this,ot,rt)),tt=this.ua.bounds,a===1/0||y===1/0?this.Ge(tt.x-z/2,tt.y-z/2,a===0&&ot===0?0:tt.width+z,y===0&&rt===0?0:tt.height+z):this.Ge(-(z/2),-(z/2),at+z,ut+z),b.w()?(at=b.width,ut=b.height,at=Math.min(ft.width,at),ut=Math.min(ft.height,ut),at=Math.max(mt.width,at),ut=Math.max(mt.height,ut),this.dc.h(0,0,at,ut)):this.dc.assign(tt)};function Lv(a){var y=a.geometryStretch;return a.Rd!==null?y===ui?_e:y:y===ui?kv[a.figure].defaultStretch:y}Ct.eh=function(a,y,x,E){cs(this,a,y,x,E)},Ct.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},Ct.Sj=function(a,y,x,E,b){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),ot=z.m22*tt,rt=-z.m12*tt,at=-z.m21*tt,ut=z.m11*tt,ft=tt*(z.m21*z.dy-z.m22*z.dx),mt=tt*(z.m12*z.dx-z.m11*z.dy);z=a*ot+y*at+ft,tt=a*rt+y*ut+mt,ot=x*ot+E*at+ft,rt=x*rt+E*ut+mt,ft=this.ig/2,at=this.ua,at===null&&(this.measure(1/0,1/0),at=this.ua);var yt=at.bounds;if(ut=!1,at.type===Ue.j)if(1.5>=this.strokeWidth)ut=qt.Ve(at.startX,at.startY,at.endX,at.endY,z,tt,ot,rt,b);else{if(at.startX===at.endX?(E=ft,ut=0):(y=(at.endY-at.startY)/(at.endX-at.startX),ut=ft/Math.sqrt(1+y*y),E=ut*y),y=ln(),a=new Bt,qt.Ve(at.startX+E,at.startY+ut,at.endX+E,at.endY+ut,z,tt,ot,rt,a)&&y.push(a),a=new Bt,qt.Ve(at.startX-E,at.startY-ut,at.endX-E,at.endY-ut,z,tt,ot,rt,a)&&y.push(a),a=new Bt,qt.Ve(at.startX+E,at.startY+ut,at.startX-E,at.startY-ut,z,tt,ot,rt,a)&&y.push(a),a=new Bt,qt.Ve(at.endX+E,at.endY+ut,at.endX-E,at.endY-ut,z,tt,ot,rt,a)&&y.push(a),ot=y.length,ot===0)return Be(y),!1;for(ut=!0,rt=1/0,E=0;E<ot;E++)a=y[E],x=(a.x-z)*(a.x-z)+(a.y-tt)*(a.y-tt),x<rt&&(rt=x,b.x=a.x,b.y=a.y);Be(y)}else if(at.type===Ue.u)ut=qt.Ff(yt.x-ft,yt.y-ft,yt.x+yt.width+ft,yt.y+yt.height+ft,z,tt,ot,rt,b);else if(at.type===Ue.F){y=Ce.allocAt(yt.x,yt.y,yt.width,yt.height).Bc(ft,ft);t:if(y.width===0)ut=qt.Ve(y.x,y.y,y.x,y.y+y.height,z,tt,ot,rt,b);else if(y.height===0)ut=qt.Ve(y.x,y.y,y.x+y.width,y.y,z,tt,ot,rt,b);else{if(a=y.width/2,at=y.height/2,E=y.x+a,ut=y.y+at,x=9999,z!==ot&&(x=(tt-rt)/(z-ot)),9999>Math.abs(x)){if(rt=tt-ut-x*(z-E),0>a*a*x*x+at*at-rt*rt){b.x=NaN,b.y=NaN,ut=!1;break t}ft=Math.sqrt(a*a*x*x+at*at-rt*rt),ot=(-(a*a*x*rt)+a*at*ft)/(at*at+a*a*x*x)+E,a=(-(a*a*x*rt)-a*at*ft)/(at*at+a*a*x*x)+E,at=x*(ot-E)+rt+ut,rt=x*(a-E)+rt+ut,Math.abs((z-ot)*(z-ot))+Math.abs((tt-at)*(tt-at))<Math.abs((z-a)*(z-a))+Math.abs((tt-rt)*(tt-rt))?(b.x=ot,b.y=at):(b.x=a,b.y=rt)}else{if(ot=at*at,rt=z-E,ot-=ot/(a*a)*rt*rt,0>ot){b.x=NaN,b.y=NaN,ut=!1;break t}rt=Math.sqrt(ot),ot=ut+rt,rt=ut-rt,Math.abs(ot-tt)<Math.abs(rt-tt)?(b.x=z,b.y=ot):(b.x=z,b.y=rt)}ut=!0}Ce.free(y)}else if(at.type===Ue.o){mt=Bt.alloc();var xt=ot-z,Mt=rt-tt,It=xt*xt+Mt*Mt,Tt=z,zt=tt;if(0<It&&yt.contains(Tt,zt)&&(mt.x=Tt,mt.y=zt,this.ca(mt)))for(xt!==0&&.5>Math.abs(xt)?(Mt*=.5/xt,xt=.5):Mt!==0&&.5>Math.abs(Mt)&&(xt*=.5/Mt,Mt=.5),Tt-=xt,zt-=Mt;yt.contains(Tt,zt);)Tt-=xt,zt-=Mt;for(b.x=ot,b.y=rt,Mt=0;Mt<at.figures.count;Mt++){var Ht=at.figures.s[Mt],Vt=Ht.isFilled?Tt:z,Xt=Ht.isFilled?zt:tt,le=Ht.segments;yt=Ht.startX,xt=Ht.startY;for(var $e=yt,mn=xt,cn=0;cn<le.count;cn++){var We=le.s[cn],Te=We.type,oi=We.endX,Xn=We.endY,Gi=!1;switch(Te){case wr:$e=oi,mn=Xn;break;case So:Gi=Fm(yt,xt,oi,Xn,Vt,Xt,ot,rt,mt);break;case Zr:Gi=qt.Eo(yt,xt,We.point1X,We.point1Y,We.point2X,We.point2Y,oi,Xn,Vt,Xt,ot,rt,.6,mt);break;case pa:Gi=qt.Eo(yt,xt,yt+2/3*(We.point1X-yt),xt+2/3*(We.point1Y-xt),oi+2/3*(We.point1X-oi),Xn+2/3*(We.point1Y-Xn),oi,Xn,Vt,Xt,ot,rt,.6,mt);break;case ur:case La:Te=We.type===ur?na(We,Ht):Ga(We,Ht,yt,xt);var ao=Te.length;if(ao===0){Gi=Fm(yt,xt,We.type===ur?We.centerX:We.endX,We.type===ur?We.centerY:We.endY,Vt,Xt,ot,rt,mt);break}for(Xn=null,oi=0;oi<ao;oi++){if(Xn=Te[oi],oi===0&&Fm(yt,xt,Xn[0],Xn[1],Vt,Xt,ot,rt,mt)){var Cr=bm(Vt,Xt,mt,It,b);Cr<It&&(It=Cr,ut=!0)}qt.Eo(Xn[0],Xn[1],Xn[2],Xn[3],Xn[4],Xn[5],Xn[6],Xn[7],Vt,Xt,ot,rt,.6,mt)&&(Cr=bm(Vt,Xt,mt,It,b),Cr<It&&(It=Cr,ut=!0))}oi=Xn[6],Xn=Xn[7];break;default:Wt("Unknown Segment type: "+Te)}yt=oi,xt=Xn,Gi&&(Gi=bm(Vt,Xt,mt,It,b),Gi<It&&(It=Gi,ut=!0)),We.isClosed&&(oi=$e,Xn=mn,Fm(yt,xt,oi,Xn,Vt,Xt,ot,rt,mt)&&(We=bm(Vt,Xt,mt,It,b),We<It&&(It=We,ut=!0)))}}z=x-a,tt=E-y,ot=Math.sqrt(z*z+tt*tt),ot!==0&&(z/=ot,tt/=ot),b.x-=z*ft,b.y-=tt*ft,Bt.free(mt)}else Wt("Unknown Geometry type: "+at.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 Fm(a,y,x,E,b,z,tt,ot,rt){if(qt.$(a,x)&&qt.$(y,E)||qt.$(b,tt)&&qt.$(z,ot))return!1;var at=!1,ut=(b-tt)*(y-E)-(z-ot)*(a-x);return ut===0?!1:(rt.x=((b*ot-z*tt)*(a-x)-(b-tt)*(a*E-y*x))/ut,rt.y=((b*ot-z*tt)*(y-E)-(z-ot)*(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,(rt.y>a||qt.$(rt.y,a))&&(rt.y<y||qt.$(rt.y,y))&&(at=!0)):(y=a<x?a:x,a=a<x?x:a,(rt.x>y||qt.$(rt.x,y))&&(rt.x<a||qt.$(rt.x,a))&&(at=!0)),at)}Ct.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=Bt.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)))),Bt.free(z),b},Ct.Yc=function(a,y){if(this.fh(a,y)||y===void 0&&(y=this.transform,a.Re(this.actualBounds)))return!0;var x=ci.alloc();x.set(y),x.Vj();var E=a.left,b=a.right,z=a.top;a=a.bottom;var tt=Bt.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 Bt.free(tt),!0;var ot=Bt.alloc(),rt=Bt.alloc();return x.set(y),x.bv(this.transform),x.Vj(),ot.x=b,ot.y=z,ot.transform(x),tt.x=E,tt.y=z,tt.transform(x),y=!1,Bd(this,tt,ot,rt)?y=!0:(tt.x=b,tt.y=a,tt.transform(x),Bd(this,tt,ot,rt)?y=!0:(ot.x=E,ot.y=a,ot.transform(x),Bd(this,tt,ot,rt)?y=!0:(tt.x=E,tt.y=z,tt.transform(x),Bd(this,tt,ot,rt)&&(y=!0)))),Bt.free(tt),ci.free(x),Bt.free(ot),Bt.free(rt),y};function Bd(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)}Ct.tx=function(a,y,x){function E(It,Tt){for(var zt=It.length,Ht=0;Ht<zt;Ht+=2)if(Tt.zd(It[Ht],It[Ht+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,ot=tt.x,rt=tt.y,at=tt.x+tt.width;if(tt=tt.y+tt.height,Zo(a.x,a.y,ot,rt)<=b&&Zo(a.x,a.y,at,rt)<=b&&Zo(a.x,a.y,ot,tt)<=b&&Zo(a.x,a.y,at,tt)<=b)return!0}if(ot=y.startX,rt=y.startY,at=y.endX,tt=y.endY,y.type===Ue.j){if(x=(ot-at)*(a.x-at)+(rt-tt)*(a.y-tt),Bi(a.x,a.y,ot,rt,at,tt)<=(0<=(at-ot)*(a.x-ot)+(tt-rt)*(a.y-rt)&&0<=x?b:z))return!0}else{if(y.type===Ue.u)return y=!1,x&&(y=Bi(a.x,a.y,ot,rt,ot,tt)<=b||Bi(a.x,a.y,ot,rt,at,rt)<=b||Bi(a.x,a.y,at,rt,at,tt)<=b||Bi(a.x,a.y,ot,tt,at,tt)<=b),y;if(y.type===Ue.F){y=a.x-(ot+at)/2,z=a.y-(rt+tt)/2;var ut=Math.abs(at-ot)/2,ft=Math.abs(tt-rt)/2;if(ut===0||ft===0)return Bi(a.x,a.y,ot,rt,at,tt)<=b;if(x){if(a=qt.$y(ut,ft,y,z),a*a<=b)return!0}else return!(Zo(y,z,-ut,0)>=b||Zo(y,z,0,-ft)>=b||Zo(y,z,0,ft)>=b||Zo(y,z,ut,0)>=b)}else if(y.type===Ue.o){if(at=y.bounds,z=at.x,ot=at.y,rt=at.x+at.width,at=at.y+at.height,a.x>rt&&a.x<z&&a.y>at&&a.y<ot&&Bi(a.x,a.y,z,ot,z,at)>b&&Bi(a.x,a.y,z,ot,rt,ot)>b&&Bi(a.x,a.y,rt,at,z,at)>b&&Bi(a.x,a.y,rt,at,rt,ot)>b)return!1;if(z=Math.sqrt(b),x){if(this.fill===null?Sh(y,a.x,a.y,z):za(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(ot=z.segments.s,rt=ot.length,at=0;at<rt;at++)switch(ft=ot[at],ft.type){case wr:case So:if(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b)return!1;break;case Zr:var mt=ln();if(qt.Qe(tt,ut,ft.point1X,ft.point1Y,ft.point2X,ft.point2Y,ft.endX,ft.endY,.8,mt),tt=E(mt,a),Be(mt),tt||(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b))return!1;break;case pa:if(mt=ln(),qt.ep(tt,ut,ft.point1X,ft.point1Y,ft.endX,ft.endY,.8,mt),tt=E(mt,a),Be(mt),tt||(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b))return!1;break;case ur:case La:mt=ft.type===ur?na(ft,z):Ga(ft,z,tt,ut);var yt=mt.length;if(yt===0){if(tt=ft.type===ur?ft.centerX:ft.endX,ut=ft.type===ur?ft.centerY:ft.endY,a.zd(tt,ut)>b)return!1;break}ft=null;for(var xt=ln(),Mt=0;Mt<yt;Mt++)if(ft=mt[Mt],xt.length=0,qt.Qe(ft[0],ft[1],ft[2],ft[3],ft[4],ft[5],ft[6],ft[7],.8,xt),E(xt,a))return Be(xt),!1;Be(xt),ft!==null&&(tt=ft[6],ut=ft[7]);break;default:Wt("Unknown Segment type: "+ft.type)}}return!0}}}return!1},Ct.qc=function(){this.ua=null},Ct.kq=function(){return this.ig};function mS(a){var y=a.diagram;y!==null&&y.undoManager.isUndoingRedoing||(a.segmentOrientation=qg,a.toArrow!=="None"?(a.segmentIndex=-1,a.alignmentFocus=Ur):a.fromArrow!=="None"&&(a.segmentIndex=0,a.alignmentFocus=new rn(1-Ur.x,Ur.y)))}gi.makeGeometry=function(a,y,x){if(a.toArrow!=="None")var E=Ql[a.toArrow];else a.fromArrow!=="None"?E=Ql[a.fromArrow]:(E=qt.Ze[a.figure],typeof E=="string"&&(E=qt.Ze[E]),E===void 0&&Wt("Unknown Shape.figure: "+a.figure),E=E(a,y,x),E.Sk=y,E.Rk=x);if(E===null){var b=qt.Ze.Rectangle;typeof b=="function"&&(E=b(a,y,x))}return E};function vS(a){var y=Ql[a];if(y===void 0){var x=a.toLowerCase();if(x==="none")return"None";if(y=Ql[x],y===void 0){var E=null,b;for(b in qt.um)if(b.toLowerCase()===x){E=b;break}if(E!==null)return a=Ue.parse(qt.um[E],!1),Ql[E]=a,x!==E&&(Ql[x]=E),E}}return typeof y=="string"?y:y instanceof Ue?a:null}oe.Object.defineProperties(gi.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),Wr(this)&&(a=this.part,a!==null&&wo(this,a,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(a){a=Ue.parse(a);var y=a.normalize();this.geometry=a,this.position=a=Bt.allocAt(-y.x,-y.y),Bt.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&&xc(a,"Shape.fill"),a instanceof Qi&&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&&xc(a,"Shape.stroke"),a instanceof Qi&&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 an(a,"value >= 0",gi,"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"?an(a,'"butt", "round", or "square"',gi,"strokeCap"):(Ad(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"?an(a,'"miter", "bevel", or "round"',gi,"strokeJoin"):(Ad(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){Ad(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)||Wt("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&&(Ad(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=qt.Ze[a];typeof x=="function"?x=a:(x=qt.Ze[a.toLowerCase()])||Wt("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=vS(a);x===null?Wt("Unknown Shape.toArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new jh),this.Ua.V=x,this.Rd=null,this.qc(),this.v(),mS(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=vS(a);x===null?Wt("Unknown Shape.fromArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new jh),this.Ua.j=x,this.Rd=null,this.qc(),this.v(),mS(this),this.g("fromArrow",y,x))}}},spot1:{get:function(){return this.Na!==null?this.Na.fg:Fr},set:function(a){var y=this.spot1;y.D(a)||(a=a.J(),Ad(this),this.Na.fg=a,this.v(),this.g("spot1",y,a))}},spot2:{get:function(){return this.Na!==null?this.Na.gg:Fr},set:function(a){var y=this.spot2;y.D(a)||(a=a.J(),Ad(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&&(Ad(this),this.Na.br=a,this.N(),this.g("pathPattern",y,a))}},geometryStretch:{get:function(){return this.Na!==null?this.Na.jq:ui},set:function(a){var y=this.geometryStretch;y!==a&&(Ad(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 ql),this.fa.Tk=a;var x=this.diagram;x!==null&&this.panel===x.grid&&Al(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 ql),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 ql),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 ql),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}}}),gi.prototype.intersectsRect=gi.prototype.Yc,gi.prototype.containedInRect=gi.prototype.fh,gi.prototype.getNearestIntersectionPoint=gi.prototype.rs,gi.prototype.getDocumentBounds=gi.prototype.mi,gi.prototype.getDocumentPoint=gi.prototype.ga;var Ql=new Rn,kv=new Rn;gi.className="Shape",gi.getFigureGenerators=function(){var a=new kn,y;for(y in qt.Ze)y!==y.toLowerCase()&&a.add(y,qt.Ze[y]);return a.freeze(),a},gi.defineFigureGenerator=function(a,y){var x=a.toLowerCase(),E=qt.Ze;E[a]=y,E[x]=a},gi.getArrowheadGeometries=function(){var a=new kn;for(E in qt.um)if(Ql[E]===void 0){var y=Ue.parse(qt.um[E],!1);Ql[E]=y,y=E.toLowerCase(),y!==E&&(Ql[y]=E)}for(var x in Ql)if(x!==x.toLowerCase()){var E=Ql[x];E instanceof Ue&&a.add(x,E)}return a.freeze(),a},gi.defineArrowheadGeometry=function(a,y){var x=null;typeof y=="string"?x=Ue.parse(y,!1):x=y,y=a.toLowerCase(),y!=="none"&&a!==y||Wt("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var E=Ql;E[a]=x,E[y]=a};function Mv(){this.nc=!1,this.Hr="butt",this.Ir="miter",this.Jr=10,this.uj=0,this.br=null,this.jq=ui,this.gg=this.fg=Fr}Mv.prototype.copy=function(){var a=new Mv;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 uo(a,y){return Jt.call(this),Dm||(Hs=Uo?new Ya(null).context:null,Dm=!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}he(uo,Jt),uo.prototype.cloneProtected=function(a){Jt.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 Il(a){a.da===null?a.da=new Bv:a.da.nc&&(a.da=a.da.copy())}Ct=uo.prototype,Ct.th=function(){Jt.prototype.th.call(this),this.da!==null&&(this.da.nc=!0)};function yS(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}Ct.qb=function(a){a.classType===uo?this.wrap=a:Jt.prototype.qb.call(this,a)},Ct.toString=function(){return 22<this.ec.length?'TextBlock("'+this.ec.substring(0,20)+'"...)':'TextBlock("'+this.ec+'")'},Ct.v=function(){Jt.prototype.v.call(this)},Ct.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=Ug(this),ot=a.textAlign=this.textAlign,rt=y.tn;ot==="start"?ot=rt?"right":"left":ot==="end"&&(ot=rt?"left":"right"),rt=this.isUnderline;var at=this.isStrikethrough;Xo(this,a,this.xc,!0,!1,x,E),(rt||at)&&Xo(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 mt=y.scale;switch(8>(ft*ft+ut*ut)*mt*mt&&(x=!0),y.ib!==a&&(x=!1),y.ib instanceof ra&&(x=!1),y.Gf("textGreeking")===!1&&(x=!1),y=this.spacingAbove,ft=this.spacingBelow,this.flip){case Ti:a.translate(b,0),a.scale(-1,1);break;case xi:a.translate(0,z),a.scale(1,-1);break;case eo:a.translate(b,z),a.scale(-1,-1)}if(a.yc(),ut=this.Gc,mt=(y+tt+ft)*ut,z>mt&&(E=this.verticalAlignment,E=E.y*z-E.y*mt+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,ot,rt,at);else if(this.Qc!==null&&this.Qb!==null)for(mt=0;mt<ut;mt++){var yt=this.Qc[mt];yt>b&&(yt=b),E+=y,this.Oj(this.Qb[mt],a,0,E,b,tt,yt,x,ot,rt,at),E+=tt+ft}switch(this.flip){case Ti:a.scale(-1,1),a.translate(-b,0);break;case xi:a.scale(1,-1),a.translate(0,-z);break;case eo:a.scale(-1,-1),a.translate(-b,-z)}}},Ct.Oj=function(a,y,x,E,b,z,tt,ot,rt,at,ut){var ft=0;if(ot)rt==="left"?ft=0:rt==="right"?ft=b-tt:rt==="center"&&(ft=(b-tt)/2),y.fillRect(x+ft,E+.25*z,tt,1);else{if(rt==="left"?ft=0:rt==="right"?ft=b:rt==="center"&&(ft=b/2),b=Nm!==null?Nm(this,z):.75*z,y.fillText(a,x+ft,E+b),a=z/20|0,a===0&&(a=1),rt==="right"?ft-=tt:rt==="center"&&(ft-=tt/2),at){ot=Tm!==null?Tm(this,z):.8*z,rt=x+ft,at=E+ot,b=x+ft+tt,ot=E+ot;var mt=a;y.beginPath(),y.lineWidth=mt,y.moveTo(rt,at),y.lineTo(b,ot),y.stroke(),y.Se(),y instanceof ra&&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 ra&&y.ad.classList.add("gojs-td"))}},Ct.kk=function(a,y,x){if(!Jt.prototype.kk.call(this,a,y,x))return!1;if(Xo(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},Ct.nk=function(a){return 1<this.lineCount||this.isUnderline||this.isStrikethrough?!0:Jt.prototype.nk.call(this,a)},Ct.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)}},Ct.Wl=function(a,y,x,E){var b=this.Gc;this.Ih=a,this.l&=-16777217;var z=this.Ae;Hs!==null&&kS!==z&&(kS=Hs.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 ot=tt=0,rt=!1;!rt;){var at=z.indexOf(`
`,ot);at===-1&&(at=z.length,rt=!0),ot=z.substr(ot,at-ot),this.formatting===Yg&&(ot=ot.trim()),tt=Math.max(tt,sl(ot)),ot=at+1}z=tt}else tt=z.indexOf(`
`,0),0<=tt&&(z=z.substr(0,tt)),z=sl(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=xS(this,z),isNaN(this.desiredSize.height)?tt=Math.min(tt,y/this.scale):tt=this.desiredSize.height,rt=tt,this.Cb!==0&&this.Qc!==null&&this.Qb!==null&&this.overflow===Am&&(y=this.Ae,y=this.overflow===Am?SS(y):0,at=this.spacingAbove+this.spacingBelow,at=Math.max(0,Ug(this)+at),rt=Math.min(this.maxLines-1,Math.max(Math.floor(rt/at+.01)-1,0)),!(rt+1>=this.Qb.length))){for(this.l|=16777216,at=this.Qb[rt],y=Math.max(1,a-y);sl(at)>y&&1<at.length;)at=at.substr(0,at.length-1);at+=Zg,y=sl(at),this.Qb[rt]=at,this.Qb=this.Qb.slice(0,rt+1),this.Qc[rt]=y,this.Qc=this.Qc.slice(0,rt+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===wS||isNaN(this.desiredSize.width))&&(z=isNaN(a)?this.Cb:Math.min(a,this.Cb)),z=Math.max(x,z),tt=Math.max(E,tt),To(this.dc,z,tt),this.Ge(0,0,z,tt),this.svg!==null&&b!==this.Gc&&(this.Uc=!0)},Ct.eh=function(a,y,x,E){cs(this,a,y,x,E)};function Vg(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 Ev(a,y,x,E){var b=a.formatting===Yg;b&&(y=y.trim());var z=0,tt=a.Ae,ot=a.spacingAbove+a.spacingBelow;ot=Math.max(0,Ug(a)+ot);var rt=a.overflow===Am?SS(tt):0;if(a.Gc>=a.maxLines)E!==null&&E.h(0,ot);else if(tt=y,a.wrap===bv){a.Le=1;var at=sl(y);if(rt===0||at<=x)a.Cb=Math.max(a.Cb,at),Vg(a,y,a.Cb),E!==null&&E.h(at,ot);else{for(z=Cf(a,tt),tt=tt.substr(z.length),y=Cf(a,tt),at=sl(z+y);0<y.length&&at<=x;)z+=y,tt=tt.substr(y.length),y=Cf(a,tt),at=z+y,b&&(at=at.trim()),at=sl(at);for(b&&(y=y.trim()),z+=y,x=Math.max(1,x-rt);sl(z)>x&&1<z.length;)z=z.substr(0,z.length-1);a.l|=16777216,z+=Zg;var ut=sl(z);a.Cb=ut,Vg(a,z,ut),E!==null&&E.h(ut,ot)}}else{for(rt=0,tt.length===0&&(rt=1,Vg(a,tt,0));0<tt.length;){for(y=Cf(a,tt),tt=tt.substr(y.length);sl(y)>x;){var ft=1;for(at=sl(y.substr(0,ft)),ut=0;at<=x;)ft++,ut=at,at=sl(y.substr(0,ft));if(ft===1){var mt=at;z=Math.max(z,at)}else mt=ut,z=Math.max(z,ut);if(ft--,1>ft&&(ft=1),Vg(a,y.substr(0,ft),mt),rt++,y=y.substr(ft),a.Gc+rt>a.maxLines)break}for(ut=Cf(a,tt),at=sl(y+ut);0<ut.length&&at<=x;)y+=ut,tt=tt.substr(ut.length),ut=Cf(a,tt),at=y+ut,b&&(at=at.trim()),at=sl(at);if(b&&(y=y.trim()),y!==""&&(y[y.length-1]==="\xAD"&&(y=y.substring(0,y.length-1)+"\u2010"),ut.length===0?(ft=at,z=Math.max(z,at)):(ft=ut=sl(y),z=Math.max(z,ut)),Vg(a,y,ft),rt++,a.Gc+rt>a.maxLines))break}a.Le=Math.min(a.maxLines,rt),a.Cb=Math.max(a.Cb,z),E!==null&&E.h(a.Cb,ot*a.Le)}}function Cf(a,y){if(a.wrap===PS)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===CS&&(x=Math.min(x,E+1));E<x&&b.test(y.charAt(E));)E++;return E>=y.length?y:y.substr(0,E)}function sl(a){return Hs===null?8*a.length:Hs.measureText(a).width}function Ug(a){if(a.df!==null)return a.df;var y=a.Ae;if(Hs===null){var x=16;return a.df=x}return Tv[y]!==void 0&&5e3>LS?x=Tv[y]:(x=1.3*Hs.measureText("M").width,Tv[y]=x,LS++),a.df=x}function SS(a){if(Hs===null)return 6;if(Bm[a]!==void 0&&5e3>Av)var y=Bm[a];else y=Hs.measureText(Zg).width,Bm[a]=y,Av++;return y}function xS(a,y){var x=a.ec.replace(/\r\n/g,`
`).replace(/\r/g,`
`),E=a.spacingAbove+a.spacingBelow;if(E=Math.max(0,Ug(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,ot=!1;!ot;){if(tt=x.indexOf(`
`,z),tt===-1&&(tt=x.length,ot=!0),z<=tt){if(z=x.substr(z,tt-z),a.wrap!==bv){a.Le=0;var rt=Qe.alloc();Ev(a,z,y,rt),b+=rt.height,Qe.free(rt),a.Gc+=a.Le}else Ev(a,z,y,null),b+=E,a.Gc++;a.Gc===a.maxLines&&(ot=!0)}z=tt+1}return a.Lq=b}oe.Object.defineProperties(uo.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"||(Il(this),this.da.Or=a,this.N(),this.g("textAlign",y,a))}},flip:{get:function(){return this.da!==null?this.da.Xf:Oe},set:function(a){var y=this.flip;y!==a&&(Il(this),this.da.Xf=a,this.N(),this.g("flip",y,a))}},verticalAlignment:{get:function(){return this.da!==null?this.da.Yr:vh},set:function(a){var y=this.verticalAlignment;y.D(a)||(a=a.J(),Il(this),this.da.Yr=a,Cs(this),this.g("verticalAlignment",y,a))}},naturalBounds:{get:function(){if(!this.dc.w()){var a=Qe.alloc();Ev(this,this.ec,999999,a);var y=a.width;Qe.free(a),a=xS(this,y);var x=this.desiredSize;isNaN(x.width)||(y=x.width),isNaN(x.height)||(a=x.height),To(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:Fv},set:function(a){var y=this.wrap;y!==a&&(Il(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&&(Il(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&&xc(a,"TextBlock.stroke"),a instanceof Qi&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},lineCount:{get:function(){return this.Gc}},lineHeight:{get:function(){return Ug(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&&(Il(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&&(Il(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 ql),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 ql),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 ql),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 ql),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 ql),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&&(Il(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&&(Il(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&&(Il(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&&(Il(this),this.da.Er=a,this.v(),this.g("spacingBelow",y,a))}},formatting:{get:function(){return this.da!==null?this.da.gq:Yg},set:function(a){var y=this.formatting;y!==a&&(Il(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&&an(a,"> 0",uo,"maxLines"),Il(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 Nm=null,Tm=null,bv=new Se(uo,"None",0),wS=new Se(uo,"WrapFit",1),Fv=new Se(uo,"WrapDesiredSize",2),PS=new Se(uo,"WrapBreakAll",3),Nv=new Se(uo,"OverflowClip",0),Am=new Se(uo,"OverflowEllipsis",1),Yg=new Se(uo,"FormatTrim",0),CS=new Se(uo,"FormatNone",0),Sx=/[ \u200b\u00ad]/,Tv=new Rn,LS=0,Bm=new Rn,Av=0,Zg="...",kS="",Hs=null,Dm=!1;uo.className="TextBlock";function Bv(){this.nc=!1,this.Hd=null,this.Xf=Oe,this.gq=Yg,this.Jq=1/0,this.$q=Nv,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=vh,this.$r=Fv}Bv.prototype.copy=function(){var a=new Bv;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},uo.getEllipsis=function(){return Zg},uo.setEllipsis=function(a){Zg=a,Bm=new Rn,Av=0},uo.getBaseline=function(){return Nm},uo.setBaseline=function(a){Nm=a},uo.getUnderline=function(){return Tm},uo.setUnderline=function(a){Tm=a},uo.isValidFont=function(a){if(Dm||(Hs=Uo?new Ya(null).context:null,Dm=!0),Hs===null)return!0;var y=Hs.font;if(a===y||a==="10px sans-serif")return!0;Hs.font="10px sans-serif",Hs.font=a;var x=Hs.font;if(x!=="10px sans-serif")return Hs.font=y,!0;Hs.font="19px serif";var E=Hs.font;return Hs.font=a,x=Hs.font,Hs.font=y,x!==E},uo.FormatNone=CS,uo.FormatTrim=Yg,uo.None=bv,uo.OverflowClip=Nv,uo.OverflowEllipsis=Am,uo.WrapBreakAll=PS,uo.WrapDesiredSize=Fv,uo.WrapFit=wS;function ql(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}ql.prototype.copy=function(){var a=new ql;return a.Tk=this.Tk,a.u=this.u,a.j=this.j,a.F=this.F,a.o=this.o,a},ql.className="GradElementSettings";function Ws(a,y){Jt.call(this),this.Eg=null,this.qo="",this.Xg=Ra,this.Nk=_e,this.Zg=this.Hd=null,this.Mk=ji,this.Xf=Oe,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 Lf;he(Ws,Jt),Ws.prototype.cloneProtected=function(a){Jt.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},Ws.prototype.qb=function(a){a===Oe||a===wn||a===Mi?this.imageStretch=a:Jt.prototype.qb.call(this,a)},Ws.prototype.toString=function(){return"Picture("+this.source+")#"+ti(this)};function kf(a){a===void 0&&(a=""),a!==""?Lf[a]&&(delete Lf[a],Om--):(Lf=new Rn,Om=0)}function MS(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 ot=tt.length,rt=0;rt<ot;rt++)z=tt[rt],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()||(fr(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=ln();for(var ot=0;ot<b;ot++)z.push(tt[ot]);if(y.hn)for(ot=0;ot<b;ot++)tt=z[ot],tt.Hd!==null&&tt.Hd(tt,x);Be(z)}}y.Bg.clear()}},y.addEventListener("load",y.Fq),y.addEventListener("error",y.Yp),y.qy=!0)}Ws.prototype.hA=function(){if(this.source!==""){kf(this.source);var a=this.source;this.source="",this.source=a}},Ws.prototype.redraw=function(){this.N(),this.Uc=!0},Ws.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 Nd)){var b=a instanceof ra;E=this.naturalBounds;var z=0,tt=0,ot=this.qn,rt=ot?+x.width:x.naturalWidth;if(ot=ot?+x.height:x.naturalHeight,rt===void 0&&x.videoWidth&&(rt=x.videoWidth),ot===void 0&&x.videoHeight&&(ot=x.videoHeight),rt=rt||E.width,ot=ot||E.height,rt!==0&&ot!==0){var at=rt,ut=ot;this.sourceRect.w()&&(z=this.Xg.x,tt=this.Xg.y,rt=this.Xg.width,ot=this.Xg.height);var ft=rt,mt=ot,yt=this.Nk,xt=this.Mk;switch(yt){case Oe:if(this.sourceRect.w())break;ft>=E.width&&(z=z+xt.offsetX+(ft*xt.x-E.width*xt.x)),mt>=E.height&&(tt=tt+xt.offsetY+(mt*xt.y-E.height*xt.y)),rt=Math.min(E.width,ft),ot=Math.min(E.height,mt);break;case _e:ft=E.width,mt=E.height;break;case wn:case Mi:yt===wn?(yt=Math.min(E.height/mt,E.width/ft),ft*=yt,mt*=yt):yt===Mi&&(yt=Math.max(E.height/mt,E.width/ft),ft*=yt,mt*=yt,ft>=E.width&&(z=(z+xt.offsetX+(ft*xt.x-E.width*xt.x)/ft)*rt),mt>=E.height&&(tt=(tt+xt.offsetY+(mt*xt.y-E.height*xt.y)/mt)*ot),rt*=1/(ft/E.width),ot*=1/(mt/E.height),ft=E.width,mt=E.height)}yt=this.Df()*y.scale;var Mt=ft*yt*mt*yt,It=rt*ot/Mt,Tt=x.__goCache;yt=null;var zt=xx;if(!b){if(x.sq&&Tt!==void 0&&4<Mt&&It>zt*zt)for(Tt.gi===null&&(bS(Tt,4,at,ut,x),bS(Tt,16,at,ut,x)),b=Tt.gi,at=b.length,ut=0;ut<at&&b[ut].ratio*b[ut].ratio<It;ut++)yt=b[ut];if(!y.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{b=new Ya(null).context;try{b.drawImage(this.Eg,0,0)}catch(Ht){this.en=!1}try{b.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(Ht){this.vl=!0}}if(this.vl)return}}switch(b=ft<E.width?xt.offsetX+(E.width*xt.x-ft*xt.x):0,xt=mt<E.height?xt.offsetY+(E.height*xt.y-mt*xt.y):0,this.flip){case Ti:a.translate(Math.min(E.width,ft),0),a.scale(-1,1);break;case xi:a.translate(0,Math.min(E.height,mt)),a.scale(1,-1);break;case eo:a.translate(Math.min(E.width,ft),Math.min(E.height,mt)),a.scale(-1,-1)}if(a.yc(),y.Gf("pictureRatioOptimization")&&!y.$i&&Tt!==void 0&&yt!==null&&yt.ratio!==1){a.save(),y=yt.ratio;try{a.drawImage(yt.source,z/y,tt/y,Math.min(yt.source.width,rt/y),Math.min(yt.source.height,ot/y),b,xt,Math.min(E.width,ft),Math.min(E.height,mt)),a instanceof ra&&(this.bt=[z/y,tt/y,Math.min(yt.source.width,rt/y),Math.min(yt.source.height,ot/y),b,xt,Math.min(E.width,ft),Math.min(E.height,mt)])}catch(Ht){this.en=!1}a.restore()}else try{a.drawImage(x,z,tt,rt,ot,b,xt,Math.min(E.width,ft),Math.min(E.height,mt)),a instanceof ra&&(this.bt=[z,tt,rt,ot,b,xt,Math.min(E.width,ft),Math.min(E.height,mt)])}catch(Ht){this.en=!1}switch(this.flip){case Ti:a.scale(-1,1),a.translate(-Math.min(E.width,ft),0);break;case xi:a.scale(1,-1),a.translate(0,-Math.min(E.height,mt));break;case eo:a.scale(-1,-1),a.translate(-Math.min(E.width,ft),-Math.min(E.height,mt))}}}}},Ws.prototype.Wl=function(a,y,x,E){var b=this.desiredSize,z=Gs(this,!0),tt=this.Eg,ot=this.qn,rt=0,at=0;(ot||!this.al&&tt&&tt.complete)&&(this.al=!0),tt===null?(isFinite(b.width)||(a=0),isFinite(b.height)||(y=0)):(rt=ot?+tt.width:tt.naturalWidth,at=ot?+tt.height:tt.naturalHeight),isFinite(b.width)||z===_e||z===Nn?(isFinite(a)||(this.sourceRect.w()?a=this.sourceRect.width:tt!==null&&(a=rt)),x=0):tt!==null&&this.al!==!1&&(a=this.sourceRect.w()?this.sourceRect.width:rt),isFinite(b.height)||z===_e||z===Wn?(isFinite(y)||(this.sourceRect.w()?y=this.sourceRect.height:tt!==null&&(y=at)),E=0):tt!==null&&this.al!==!1&&(y=this.sourceRect.w()?this.sourceRect.height:at),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)),To(this.dc,a,y),this.Ge(0,0,a,y)},Ws.prototype.eh=function(a,y,x,E){cs(this,a,y,x,E)},oe.Object.defineProperties(Ws.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||Wt("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);var E=this.diagram;E!==null&&Mg(E,this),this.Eg=a,a!==null&&x&&a.Bg===void 0&&(a.Bg=new Me),E!==null&&x&&Oh(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()||(fr(this,!1),this.v())):x&&MS(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=Lf;if(Uo){var E=null;if(x[a]!==void 0)E=x[a];else if(a!==""){30<Om&&(kf(),x=Lf),E=Sn("img"),E.hn=!0,MS(this,E);var b=this.rl;b!==null&&(E.crossOrigin=b(this)),E.src=a,x[a]=E,Om++}this.element=E,E!==null&&E.__goCache===void 0&&(E.__goCache=new ES),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}}}),Ws.prototype.redraw=Ws.prototype.redraw,Ws.prototype.reloadSource=Ws.prototype.hA;var Om=0,xx=4;Ws.className="Picture",Lf=new Rn,Ws.clearCache=kf;function ES(){this.gi=null}function bS(a,y,x,E,b){a.gi===null&&(a.gi=[]);var z=new Ya(null),tt=z.context,ot=1/y;z.width=x/y,z.height=E/y,z.width!==0&&z.height!==0&&(y=new FS(z.Oa,y),x=1,0<a.gi.length&&(x=a.gi[a.gi.length-1],b=x.source,x=x.ratio),tt.setTransform(ot*x,0,0,ot*x,0,0),tt.yc(),tt.drawImage(b,0,0),a.gi.push(y))}ES.className="PictureCacheArray";function FS(a,y){this.source=a,this.ratio=y}FS.className="PictureCacheInstance";function Mf(){this.os=new Ue,this.mc=null}Mf.prototype.reset=function(a){a!==null?(a.ka(),this.os=a,a.figures.clear()):this.os=new Ue,this.mc=null};function Ef(a,y,x,E,b,z){a.mc=new xr,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 wx(a){var y=a.mc.segments.length;0<y&&a.mc.segments.M(y-1).close()}Mf.prototype.moveTo=function(a,y,x){x===void 0&&(x=!1);var E=new _i(wr);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)},Mf.prototype.lineTo=function(a,y,x){x===void 0&&(x=!1);var E=new _i(So);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)};function Ju(a,y,x,E,b,z,tt){var ot;ot===void 0&&(ot=!1);var rt=new _i(Zr);rt.point1X=y,rt.point1Y=x,rt.point2X=E,rt.point2Y=b,rt.endX=z,rt.endY=tt,ot&&rt.close(),a.mc.segments.add(rt)}function Im(a,y,x,E,b){var z;z===void 0&&(z=!1);var tt=new _i(pa);tt.point1X=y,tt.point1Y=x,tt.endX=E,tt.endY=b,z&&tt.close(),a.mc.segments.add(tt)}Mf.prototype.arcTo=function(a,y,x,E,b,z,tt){z===void 0&&(z=0),tt===void 0&&(tt=!1);var ot=new _i(ur);ot.startAngle=a,ot.sweepAngle=y,ot.centerX=x,ot.centerY=E,ot.radiusX=b,ot.radiusY=z!==0?z:b,tt&&ot.close(),this.mc.segments.add(ot)};function Px(a,y,x,E,b,z,tt,ot){var rt;rt===void 0&&(rt=!1),y=new _i(La,tt,ot,y,x,E,b,z),rt&&y.close(),a.mc.segments.add(y)}function NS(a){var y=Rm;return y!==null?(Rm=null,y.reset(a),y):(y=new Mf,y.reset(a),y)}var Rm=null;Mf.className="StreamGeometryContext";function as(a,y){var x=a.toLowerCase(),E=qt.Ze;E[a]=y,E[x]=a}as("Rectangle",function(a,y,x){a="r"+y+","+x;var E=qt.Mf[a];return E!==void 0||(E=new Ue(Ue.u),E.endX=y,E.endY=x,qt.Nf<qt.vm&&(qt.Mf[a]=E,qt.Nf++)),E}),as("Square",function(a,y,x){a="s"+y+","+x;var E=qt.Mf[a];return E!==void 0||(E=new Ue(Ue.u),E.endX=y,E.endY=x,E.defaultStretch=wn,qt.Nf<qt.vm&&(qt.Mf[a]=E,qt.Nf++)),E}),as("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=qt.Mf[E];if(b!==void 0)return b;var z=a*qt.wg;return b=new Ue().add(new xr(a,0,!0).add(new _i(So,y-a,0)).add(new _i(Zr,y,a,y-z,0,y,z)).add(new _i(So,y,x-a)).add(new _i(Zr,y-a,x,y,x-z,y-z,x)).add(new _i(So,a,x)).add(new _i(Zr,0,x-a,z,x,0,x-z)).add(new _i(So,0,a)).add(new _i(Zr,a,0,0,z,z,0).close())),1<z&&(b.spot1=new rn(0,0,z,z),b.spot2=new rn(1,1,-z,-z)),qt.Nf<qt.vm&&(qt.Mf[E]=b,qt.Nf++),b}),as("Border","RoundedRectangle"),as("Ellipse",function(a,y,x){a="e"+y+","+x;var E=qt.Mf[a];return E!==void 0||(E=new Ue(Ue.F),E.endX=y,E.endY=x,E.spot1=Vo,E.spot2=Co,qt.Nf<qt.vm&&(qt.Mf[a]=E,qt.Nf++)),E}),as("Circle",function(a,y,x){a="c"+y+","+x;var E=qt.Mf[a];return E!==void 0||(E=new Ue(Ue.F),E.endX=y,E.endY=x,E.spot1=Vo,E.spot2=Co,E.defaultStretch=wn,qt.Nf<qt.vm&&(qt.Mf[a]=E,qt.Nf++)),E}),as("TriangleRight",function(a,y,x){return new Ue().add(new xr(0,0).add(new _i(So,y,.5*x)).add(new _i(So,0,x).close())).pm(0,.25,.5,.75)}),as("TriangleDown",function(a,y,x){return new Ue().add(new xr(0,0).add(new _i(So,y,0)).add(new _i(So,.5*y,x).close())).pm(.25,0,.75,.5)}),as("TriangleLeft",function(a,y,x){return new Ue().add(new xr(y,x).add(new _i(So,0,.5*x)).add(new _i(So,y,0).close())).pm(.5,.25,1,.75)}),as("TriangleUp",function(a,y,x){return new Ue().add(new xr(y,x).add(new _i(So,0,x)).add(new _i(So,.5*y,0).close())).pm(.25,.5,.75,1)}),as("Triangle","TriangleUp"),as("Diamond",function(a,y,x){return new Ue().add(new xr(.5*y,0).add(new _i(So,0,.5*x)).add(new _i(So,.5*y,x)).add(new _i(So,y,.5*x).close())).pm(.25,.25,.75,.75)}),as("LineH",function(a,y,x){return a=new Ue(Ue.j),a.startX=0,a.startY=x/2,a.endX=y,a.endY=x/2,a}),as("LineV",function(a,y,x){return a=new Ue(Ue.j),a.startX=y/2,a.startY=0,a.endX=y/2,a.endY=x,a}),as("None","Rectangle"),as("BarH","Rectangle"),as("BarV","Rectangle"),as("MinusLine","LineH"),as("PlusLine",function(a,y,x){return new Ue().add(new xr(0,x/2,!1).add(new _i(So,y,x/2)).add(new _i(wr,y/2,0)).add(new _i(So,y/2,x)))}),as("XLine",function(a,y,x){return new Ue().add(new xr(0,x,!1).add(new _i(So,y,0)).add(new _i(wr,0,0)).add(new _i(So,y,x)))}),as("LineRight",function(a,y,x){return new Ue().add(new xr(.25*y,0,!1).add(new _i(So,.75*y,.5*x)).add(new _i(So,.25*y,x)))}),as("LineDown",function(a,y,x){return new Ue().add(new xr(0,.25*x,!1).add(new _i(So,.5*y,.75*x)).add(new _i(So,y,.25*x)))}),as("LineLeft",function(a,y,x){return new Ue().add(new xr(.75*y,0,!1).add(new _i(So,.25*y,.5*x)).add(new _i(So,.75*y,x)))}),as("LineUp",function(a,y,x){return new Ue().add(new xr(0,.75*x,!1).add(new _i(So,.5*y,.25*x)).add(new _i(So,y,.75*x)))}),qt.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=Fo,this.ir=null,this.jr="",this.lr=Fr,this.Gq="",this.Hq=io,this.Pq=Ui,this.Kq=Wi,this.Up=null,this.Cq=127,this.zr=so,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 On(a,y){a===void 0||a instanceof vr||typeof a=="string"?ze.call(this,a):(ze.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 Bt(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new Ce,this.Rh=null,this.ag=NaN,y&&Object.assign(this,y)}he(On,ze),On.prototype.cloneProtected=function(a){ze.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},Ct=On.prototype,Ct.Af=function(a){ze.prototype.Af.call(this,a),a.oh(),a.Ug=null,a.nf=null,a.Rh=null},Ct.toString=function(){var a=we(this.constructor)+"#"+ti(this);return this.data!==null&&(a+="("+zn(this.data)+")"),a};function Vs(a){a.P===null?a.P=new Dv:a.P.nc&&(a.P=a.P.copy())}Ct.th=function(){ze.prototype.th.call(this),this.P!==null&&(this.P.nc=!0)},Ct.gk=function(a,y,x,E,b,z,tt){var ot=this.diagram;ot!==null&&(a===ir&&y==="elements"?b instanceof ze?Td(b,function(rt){ay(ot.partManager,rt),Cd(ot,rt)}):Oh(ot,b):a===mr&&y==="elements"&&(b instanceof ze?Td(b,function(rt){ly(ot.partManager,rt,ot)}):Mg(ot,b)),ot.cb(a,y,x,E,b,z,tt))},Ct.La=function(a){if(ze.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 ze&&Td(b,function(z){z.data!==null&&z.La()})}for(y=this.adornments;y.next();)y.value.La(a)}},On.prototype.updateRelationshipsFromData=function(){var a;this.data!==null&&((a=this.diagram)===null||a===void 0||a.partManager.updateRelationshipsFromData(this))},On.prototype.Pj=function(a){var y=this.Qf;return y===null?null:y.I(a)},On.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 kn),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)))}}},On.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)}},On.prototype.Ej=function(){var a=this.Qf;if(a!==null){var y=ln();for(a=a.iterator;a.next();)y.push(a.key);a=y.length;for(var x=0;x<a;x++)this.Jf(y[x]);Be(y)}},On.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 ri?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate),!(x instanceof Ii))break t;Za(x),x=x.copy(),x!==null&&(this.ph()&&this.selectionObject===this.path&&(x.type=ze.Link),x.adornedObject=y)}if(x!==null){x.type===ze.Link&&x.v(),this.bh("Selection",x);break t}}this.Jf("Selection")}for(Cx(this,a),y=this.adornments;y.next();)y.value.La()}},On.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 jm(a){if(_h(a)===!1){Rv(a,!0),a.Uk();var y=a.diagram;y!==null&&(y.De.add(a),y.$b())}}function TS(a){if(a.G|=2097152,_h(a)!==!1){var y=a.position,x=a.location;x.w()&&y.w()||DS(a,y,x),x=a.Ib;var E=Ce.alloc().assign(x);x.ka(),x.x=y.x,x.y=y.y,x.freeze(),a.Xl(E,x),Ce.free(E),Rv(a,!1)}}On.prototype.Ge=function(a,y,x,E){var b=this.uc;b.h(a,y,x,E),this.Lb===null&&(this.Lb=new ci);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),this.Lb=z,z.ws()||z.pp(b)},On.prototype.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=ji;this.locationSpot.sb()&&(z=this.locationSpot);var tt=Bt.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),Bt.free(tt)}},On.prototype.move=function(a,y){y===!0?this.location=a:this.position=a},On.prototype.moveTo=function(a,y,x){a=Bt.allocAt(a,y),this.move(a,x),Bt.free(a)},On.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())},On.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())},On.prototype.fb=function(a){if(this.name===a)return this;var y=this.Rh;if(y===null&&(this.Rh=y=new kn),y.I(a)!==null)return y.I(a);var x=ze.prototype.fb.call(this,a);return x!==null?(y.set(a,x),x):(y.set(a,null),null)};function Qu(a,y,x,E){E===void 0&&(E=new Bt),x=x.Mc()?ji: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}On.prototype.mi=function(a){return a===void 0&&(a=new Ce),a.assign(this.actualBounds)},On.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function AS(a){var y=Bt.alloc(),x=a.locationObject,E=x.naturalBounds,b=x instanceof gi?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 Dd(a,y){var x=a.py;isNaN(a.ag)&&(a.ag=uS(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}On.prototype.arrange=function(){if(Ls(this)===!1)TS(this);else{Kl(this,!1);var a=this.Ib,y=Ce.alloc();y.assign(a);var x=zh(this);this.eh(0,0,this.uc.width,this.uc.height);var E=this.position;DS(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()||qt.B(y.width,a.width)&&qt.B(y.height,a.height)||0<=this.vw&&this.C(16),Ce.free(y),Rv(this,!1)}},Ct=On.prototype,Ct.Xl=function(a,y){var x=this.diagram;if(x!==null){var E=!1;if(x.Zi===!1&&a.w()){var b=Ce.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),Ce.free(b)}!(this.G&65536)&&a.D(y)||RS(this,E,x),x.N(),!a.w()&&!y.w()||ca(a,y)||(this instanceof nn&&!x.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}},Ct.zv=function(a,y,x){if(this.ph()||!a.w())return!1;var E=this.diagram;return E!==null&&BS(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 Bt(E.x+(a.x-y),E.y+(a.y-x)),this.g("location",E,this.ke.copy())),_h(this)===!1&&Ls(this)===!1&&(jm(this),TS(this)),!0};function BS(a,y,x,E,b){y===null||a instanceof Ii||(y=y.animationManager,y.zb&&Qc(y,a,new Bt(E,b),x))}Ct.mm=function(a,y,x){var E=this.ke,b=this.pa;if(x){if(E.x===a&&E.y===y)return;_h(this)||Ls(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)}jm(this)},Ct.Av=function(){this.G&=-2097153,jm(this)};function DS(a,y,x){var E=AS(a),b=a.diagram,z=x.w(),tt=y.w();z&&tt?a.G&2097152?OS(a,y,x,b,E):IS(a,y,x,b,E):z?OS(a,y,x,b,E):tt&&IS(a,y,x,b,E),a.G|=2097152,Bt.free(E),a.Uk()}function OS(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 Ii||Qc(x,a,new Bt(z,tt),y),E||y.x===z&&y.y===tt||a.g("position",new Bt(z,tt),y.copy()))}function IS(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 RS(a,y,x){jv(a,!1),a instanceof nn&&Vu(x,a),a.layer.isTemporary||y||x.Ya(),y=a.Ib;var E=x.viewportBounds;E.w()?zh(a)?(fl(y,E)||a.Fd(!1),a.updateAdornments()):a.isVisible()&&y.Yc(E)?(a.Fd(!0),a.updateAdornments()):a.Wb():x.vd=!0}Ct.si=function(){return!0},Ct.Zc=function(){return!0},Ct.ph=function(){return!1},Ct.Dd=function(){return!0};function Iv(a,y,x,E){y.constructor===a.constructor||zS||(zS=!0,ye('Should not change the class of the Part when changing category from "'+x+'" to "'+E+'"'),ye(" Old class: "+we(a.constructor)+", new class: "+we(y.constructor)+", part: "+a.toString())),a.Ej();var b=a.data;x=a.layerName;var z=a.isSelected,tt=a.isHighlighted,ot=!0,rt=!0,at=!1;a instanceof nn&&(ot=a.isTreeLeaf,rt=a.isTreeExpanded,at=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 nn&&(a.U=ot?a.U|4:a.U&-5,a.U=rt?a.U|1:a.U&-2,a.U=at?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)}On.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},On.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},On.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},On.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},On.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},On.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},On.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},On.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},On.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 _h(a){return(a.G&32768)!==0}function Rv(a,y){a.G=y?a.G|32768:a.G&-32769}function jv(a,y){a.G=y?a.G|65536:a.G&-65537}function zh(a){return(a.G&131072)!==0}Ct=On.prototype,Ct.Fd=function(a){this.G=a?this.G|131072:this.G&-131073};function _m(a,y){a.G=y?a.G|1048576:a.G&-1048577}Ct.oh=function(){var a=this.containingGroup;a!==null&&(a.v(),a.placeholder!==null&&a.placeholder.v(),a.Bd())},Ct.N=function(){var a=this.diagram;a!==null&&!Ls(this)&&!_h(this)&&this.isVisible()&&this.Ib.w()&&a.N(Dd(this,this.Ib))},Ct.v=function(){ze.prototype.v.call(this);var a=this.diagram;a!==null&&(a.De.add(this),this instanceof nn&&this.labeledLink!==null&&Cs(this.labeledLink),a.$b(!0))},Ct.Vo=function(a){a||(a=this.Ah,a!==null&&Vv(a,this))},Ct.Wo=function(a){a||(a=this.Ah,a!==null&&Uv(a,this))},Ct.Lj=function(){var a=this.data;if(a!==null){var y=this.diagram;y!==null&&(y=y.model,y!==null&&y.cm(a))}},Ct.oz=function(){return _v(this,this)};function _v(a,y){var x=y.containingGroup;return x!==null?1+_v(a,x):y instanceof nn&&(y=y.labeledLink,y!==null)?_v(a,y):0}Ct.sz=function(){return jS(this,this)};function jS(a,y){var x=y.containingGroup;return x!==null||y instanceof nn&&(x=y.labeledLink,x!==null)?jS(a,x):y}Ct.Td=function(a){return a instanceof ri?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 nn&&(y=y.labeledLink,y!==null)?zv(a,y,x):!1:!0}Ct.px=function(a){if(a===null)return null;if(this===a)return this.containingGroup;for(var y=this;y!==null;){if(y instanceof ri&&_m(y,!0),y instanceof nn){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 nn&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup}for(y=this;y!==null;)y instanceof ri&&_m(y,!1),y instanceof nn&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup;return x},On.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return!(a!==null&&a.isTemporary||this instanceof nn&&this.isLinkLabel)},On.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 nn&&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 _S(a){return a.isVisible()?(a=a.layer,!(a!==null&&a.isTemporary)):!1}function Gh(a,y,x,E,b,z){if(z===void 0&&(z=null),!(a.contains(y)||z!==null&&!z(y)||y instanceof Ii)){if(a.add(y),y instanceof nn){if(x&&y instanceof ri)for(var tt=y.memberParts;tt.next();)Gh(a,tt.value,x,E,b,z);if(b!==!1)for(tt=y.linksConnected;tt.next();){var ot=tt.value;if(!a.contains(ot)){var rt=ot.fromNode,at=ot.toNode;rt=rt===null||a.contains(rt),at=at===null||a.contains(at),(b?rt&&at:rt||at)&&Gh(a,ot,x,E,b,z)}}if(1<E)for(y=y.Ou();y.next();)Gh(a,y.value,x,E-1,b,z)}else if(y instanceof Ve)for(y=y.labelNodes;y.next();)Gh(a,y.value,x,E,b,z)}}oe.Object.defineProperties(On.prototype,{key:{get:function(){var a=this.diagram;if(a!==null)return a.model.wa(this.data)}},adornments:{get:function(){return this.Qf===null?mi: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(mr,"parts",y,this,null,E,!0),E=a.oi(99999999,this,!0),y.visible!==a.visible&&this.Zb(a.visible),0<=E&&x.cb(ir,"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&&(Vs(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&&tf(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 Ii?this.type!==ze.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:Ui},set:function(a){var y=this.minLocation;y.D(a)||(a=a.J(),Vs(this),this.P.Pq=a,this.g("minLocation",y,a))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:Wi},set:function(a){var y=this.maxLocation;y.D(a)||(a=a.J(),Vs(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&&(Vs(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:io},set:function(a){var y=this.locationSpot;y.D(a)||(a=a.J(),Vs(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,Ls(this)===!1&&(jm(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)),BS(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 Ii)){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 Ii?this instanceof Ii&&(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&&(Za(x),x=x.copy(),x!==null&&Iv(this,x,y,a))):(z!==null&&z.jm(E,a),x=d1(x.partManager,E,a),x!==null&&(Za(x),x=x.copy(),x===null||x instanceof Ve||(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&&(Vs(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&&(Vs(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&&(Vs(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 Ve?(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&&(Vs(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&&(Vs(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&&(Vs(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:Fo},set:function(a){var y=this.resizeCellSize;y.D(a)||(a=a.J(),Vs(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&&(Vs(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&&(Vs(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:Fr},set:function(a){var y=this.rotationSpot;y.D(a)||(a=a.J(),Vs(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&&Wt("Cannot make a Group a member of itself: "+this.toString()),Wt("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString())),this.C(2);var x=this.diagram;if(y!==null?Uv(y,this):this instanceof ri&&x!==null&&x.ai.remove(this),this.Ah=a,a!==null?Vv(a,this):this instanceof ri&&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 ri){for(x=new Me,Gh(x,this,!0,0,!0),x=x.iterator;x.next();)if(E=x.value,E instanceof nn)for(E=E.linksConnected;E.next();)bf(E.value)}if(this instanceof nn){for(x=this.linksConnected;x.next();)bf(x.value);x=this.labeledLink,x!==null&&bf(x)}this.g("containingGroup",y,a),a!==null&&(y=a.layer,y!==null&&tf(y,-1,a))}}else Wt("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&&(Vs(this),this.P.Kp=a,this.g("containingGroupChanged",y,a))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof nn&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(a){var y=this.layoutConditions;y!==a&&(Vs(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&&(Vs(this),this.P.Up=a,this.g("dragComputation",y,a))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:so},set:function(a){var y=this.shadowOffset;y.D(a)||(a=a.J(),Vs(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&&(Vs(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&&(Vs(this),this.P.Vg=a,this.N(),this.g("shadowBlur",y,a))}}}),On.prototype.invalidateLayout=On.prototype.C,On.prototype.findCommonContainingGroup=On.prototype.px,On.prototype.isMemberOf=On.prototype.Td,On.prototype.findTopLevelPart=On.prototype.sz,On.prototype.findSubGraphLevel=On.prototype.oz,On.prototype.ensureBounds=On.prototype.Va,On.prototype.getDocumentBounds=On.prototype.mi,On.prototype.findObject=On.prototype.fb,On.prototype.moveTo=On.prototype.moveTo,On.prototype.invalidateAdornments=On.prototype.Wb,On.prototype.clearAdornments=On.prototype.Ej,On.prototype.removeAdornment=On.prototype.Jf,On.prototype.addAdornment=On.prototype.bh,On.prototype.findAdornment=On.prototype.Pj,On.prototype.updateTargetBindings=On.prototype.La;var zS=!1;On.className="Part",On.LayoutNone=0,On.LayoutAdded=1,On.LayoutRemoved=2,On.LayoutShown=4,On.LayoutHidden=8,On.LayoutNodeSized=16,On.LayoutGroupLayout=32,On.LayoutNodeReplaced=64,On.LayoutStandard=127,On.LayoutAll=16777215;function Ii(a,y){a===void 0||a instanceof vr||typeof a=="string"?On.call(this,a):(On.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)}he(Ii,On),Ii.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(a!==null?a.toString():"")},Ii.prototype.updateRelationshipsFromData=function(){},Ii.prototype.Ul=function(a){var y=this.adornedObject,x=y==null?void 0:y.part;if(x instanceof Ve&&y instanceof gi){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 gi&&(b.ua=a)}}},Ii.prototype.si=function(){var a=this.ue;return a===null?!0:(a=a.part,a===null||!Ls(a))},Ii.prototype.Zc=function(){return!1},Ii.prototype.gk=function(a,y,x,E,b,z,tt){if(a===ir&&y==="elements"){if(b instanceof Ms)this.$a===null&&(this.$a=b);else if(b instanceof ze){var ot=b.Nl(function(rt){return rt instanceof Ms});ot instanceof Ms&&this.$a===null&&(this.$a=ot)}}else a===mr&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof ze&&this.$a.rg(E)&&(this.$a=null));On.prototype.gk.call(this,a,y,x,E,b,z,tt)},Ii.prototype.updateAdornments=function(){},Ii.prototype.Lj=function(){},oe.Object.defineProperties(Ii.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}}}),Ii.className="Adornment";function Gv(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=to,this.er=Hm,this.Kr=this.ij=this.Nq=this.Mq=null}Gv.prototype.copy=function(){var a=new Gv;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 nn(a,y){a===void 0||a instanceof vr||typeof a=="string"?On.call(this,a):(On.call(this),a&&(y=a)),this.U=13,this.Ba=null,this.jb=new ke,this.wc=this.af=this.Yk=null,this.ci=!1,y&&Object.assign(this,y)}he(nn,On),nn.prototype.cloneProtected=function(a){On.prototype.cloneProtected.call(this,a),a.U=this.U,this.Ba!==null&&(a.Ba=this.Ba.nc?this.Ba:this.Ba.copy())},Ct=nn.prototype,Ct.Af=function(a){On.prototype.Af.call(this,a),a.Bd(),a.af=this.af,a.wc=null};function qu(a){a.Ba===null?a.Ba=new Gv:a.Ba.nc&&(a.Ba=a.Ba.copy())}Ct.th=function(){On.prototype.th.call(this),this.Ba!==null&&(this.Ba.nc=!0)};function GS(a,y){y!==null&&(a.af===null&&(a.af=new Me),a.af.add(y))}function HS(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}Ct.Lz=function(a,y,x){y==null&&(y=""),x==null&&(x=""),a=HS(this,a,y,x),a!==null&&a.Sl()},Ct.gk=function(a,y,x,E,b,z,tt){a===ir&&y==="elements"?this.wc=null:a===mr&&y==="elements"&&(this.wc=null),On.prototype.gk.call(this,a,y,x,E,b,z,tt)},Ct.Bd=function(a){for(var y=this.linksConnected;y.next();){var x=y.value;a!==void 0&&a.contains(x)||(sa(x.fromPort),sa(x.toPort),x.bb())}};function WS(a,y){for(a=a.linksConnected;a.next();){var x=a.value;(x.fromPort===y||x.toPort===y)&&(sa(x.fromPort),sa(x.toPort),x.bb())}}function sa(a){if(a!==null){var y=a.Zn;y!==null&&y.Sl(),a=a.part,y=a.containingGroup,y===null||a.isVisible()||sa(y.port)}}Ct.si=function(){return!0},nn.prototype.getAvoidableRect=function(a){return a.set(this.actualBounds),a.Co(this.avoidableMargin),a},nn.prototype.findVisibleNode=function(){for(var a=this;a!==null&&!a.isVisible();)a=a.containingGroup;return a},nn.prototype.isVisible=function(){if(!On.prototype.isVisible.call(this))return!1;var a=!0,y=Yu,x=this.diagram;if(x!==null&&(a=x.isTreePathToChildren,y=x.treeCollapsePolicy),y===Yu){if(a=this.pg(),a!==null&&!a.isTreeExpanded)return!1}else if(y===cr){if(a=a?this.Oo():this.Po(),0<a.count&&a.all(function(E){return!E.isTreeExpanded}))return!1}else if(y===ff&&(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},nn.prototype.Zb=function(a){On.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)}},nn.prototype.qx=function(){var a=new Me,y=new Me;return VS(this,this,a,y),y.iterator};function VS(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)&&VS(a,b?tt.toNode:tt.fromNode,x,E):E.add(tt)})}}nn.prototype.findLinksConnected=function(a){if(a===void 0&&(a=null),a===null)return this.jb.iterator;var y=new ei(this.jb),x=this;return y.predicate=function(E){return E.fromNode===x&&E.fromPortId===a||E.toNode===x&&E.toPortId===a},y},Ct=nn.prototype,Ct.Mo=function(a){a===void 0&&(a=null);var y=new ei(this.jb),x=this;return y.predicate=function(E){return E.fromNode!==x?!1:a===null?!0:E.fromPortId===a},y},Ct.Sd=function(a){a===void 0&&(a=null);var y=new ei(this.jb),x=this;return y.predicate=function(E){return E.toNode!==x?!1:a===null?!0:E.toPortId===a},y},Ct.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 Me,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 Me,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new ai(x):mi},Ct.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 Me,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new ai(x):mi},Ct.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 Me,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new ai(x):mi},Ct.jz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new ei(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},Ct.kz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new ei(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 zm(a,y,x){sa(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 Gm(a,y,x){sa(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)):Kg(y)))}function Kg(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}}}nn.prototype.updateRelationshipsFromData=function(){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)},Ct=nn.prototype,Ct.Vo=function(a){On.prototype.Vo.call(this,a),a||(Kg(this),a=this.Yk,a!==null&&$S(a,this))},Ct.Wo=function(a){On.prototype.Wo.call(this,a),a||(a=this.Yk,a!==null&&a.wd!==null&&(a.wd.remove(this),a.v()))},Ct.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,On.prototype.Lj.call(this)},Ct.ns=function(a){if(this.wc===null){if(a===""&&this.Te===!1)return this;US(this)}var y=this.wc.I(a);return y!==null||a!==""&&(y=this.wc.I(""),y!==null)?y:this};function US(a){a.wc===null?a.wc=new kn:a.wc.clear(),a.qm(a,function(y,x){YS(y,x)}),a.wc.count===0&&a.wc.add("",a)}function YS(a,y){var x=y.portId;x!==null&&a.wc!==null&&a.wc.add(x,y)}function Hv(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=ln()),x.push(E);if(x!==null){for(a=0;a<x.length;a++)y.remove(x[a]);Be(x)}}}Ct.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},Ct.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}},Ct.gz=function(a){if(a===null)return null;if(this===a)return this;for(var y=this;y!==null;)_m(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;)_m(y,!1),y=y.pg();return x},Ct.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},Ct.pg=function(){var a=this.ci;if(a===null)return null;if(a instanceof nn)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},Ct.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 Me;return a(this,y),y},Ct.uz=function(){return ZS(this,this)};function ZS(a,y){return y=y.pg(),y===null?0:1+ZS(a,y)}Ct.Qo=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren),y=new ei(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},Ct.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 ke,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 ke,y.add(x),y.add(a)):x=a);return y!==null?y.iterator:x!==null?new ai(x):mi},Ct.wz=function(a){a===void 0&&(a=1/0);var y=new Me;return Gh(y,this,!1,a,!0),y},nn.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 Me;x.add(this),KS(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Yu),y.Ue=!1}};function KS(a,y,x,E,b,z,tt){if(1<E)for(var ot=x?a.Mo():a.Sd();ot.next();){var rt=ot.value;rt.isTreeLink&&(rt=rt.To(a),rt===null||rt===a||y.contains(rt)||(y.add(rt),KS(rt,y,x,E-1,b,z,tt)))}else XS(a,y,x,b,z,tt)}function XS(a,y,x,E,b,z){for(var tt=b===a?!0:a.isTreeExpanded,ot=x?a.Mo():a.Sd(),rt={};ot.next();){var at=ot.value;if(at.isTreeLink&&(at=at.To(a),at!==null&&at!==a)){var ut=y.contains(at);if(ut||y.add(at),tt){var ft=x?at.Oo():at.Po();rt.uv=a,ft.all(function(mt){return function(yt){return yt===mt.uv||!yt.isTreeExpanded}}(rt))&&E.Aj(at,b),at.oh(),at.Zb(!1)}at.isTreeExpanded&&(at.wasTreeExpanded=at.isTreeExpanded,ut||XS(at,y,x,E,b,z))}rt={uv:rt.uv}}a.isTreeExpanded=!1}nn.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 Me;x.add(this),JS(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Yu),y.Ue=!1}};function JS(a,y,x,E,b,z,tt){for(var ot=z===a?!1:a.isTreeExpanded,rt=x?a.Mo():a.Sd(),at={};rt.next();){var ut=rt.value;if(ut.isTreeLink&&(ot||ut.fd||ut.bb(),ut=ut.To(a),ut!==null&&ut!==a&&!y.contains(ut))){if(y.add(ut),!ot){ut.Zb(!0),ut.oh();var ft=x?ut.Oo():ut.Po();at.vv=a,ft.all(function(mt){return function(yt){return yt===mt.vv||!yt.isTreeExpanded}}(at))&&b.Cj(ut,z)}(2<E||ut.wasTreeExpanded)&&(ut.wasTreeExpanded=!1,JS(ut,y,x,E-1,b,z,tt))}at={vv:at.vv}}a.isTreeExpanded=!0}oe.Object.defineProperties(nn.prototype,{portSpreading:{get:function(){return this.Ba!==null?this.Ba.er:Hm},set:function(a){var y=this.portSpreading;y!==a&&(qu(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&&Vu(x,this),this.g("avoidable",y,a)}}},avoidableMargin:{get:function(){return this.Ba!==null?this.Ba.yp:to},set:function(a){typeof a=="number"&&(a=new yi(a));var y=this.avoidableMargin;if(!y.D(a)){a=a.J(),qu(this),this.Ba.yp=a;var x=this.diagram;x!==null&&Vu(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&&(qu(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&&(qu(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&&(qu(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&&($S(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),Cs(this),this.g("labeledLink",y,a)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return this.wc===null&&US(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&&(qu(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))}}}),nn.prototype.expandTree=nn.prototype.expandTree,nn.prototype.collapseTree=nn.prototype.collapseTree,nn.prototype.findTreeParts=nn.prototype.wz,nn.prototype.findTreeChildrenNodes=nn.prototype.Ou,nn.prototype.findTreeChildrenLinks=nn.prototype.Qo,nn.prototype.findTreeLevel=nn.prototype.uz,nn.prototype.findTreeParentChain=nn.prototype.vz,nn.prototype.findTreeParentNode=nn.prototype.pg,nn.prototype.findTreeParentLink=nn.prototype.kh,nn.prototype.findCommonTreeParent=nn.prototype.gz,nn.prototype.findTreeRoot=nn.prototype.xz,nn.prototype.isInTreeOf=nn.prototype.Nz,nn.prototype.findPort=nn.prototype.ns,nn.prototype.findLinksTo=nn.prototype.kz,nn.prototype.findLinksBetween=nn.prototype.jz,nn.prototype.findNodesInto=nn.prototype.Oo,nn.prototype.findNodesOutOf=nn.prototype.Po,nn.prototype.findNodesConnected=nn.prototype.Mu,nn.prototype.findLinksInto=nn.prototype.Sd,nn.prototype.findLinksOutOf=nn.prototype.Mo,nn.prototype.findExternalTreeLinksConnected=nn.prototype.qx,nn.prototype.invalidateConnectedLinks=nn.prototype.Bd,nn.prototype.invalidateLinkBundle=nn.prototype.Lz;var Lx=new Se(nn,"SpreadingNone",10),Hm=new Se(nn,"SpreadingEvenly",11),Wv=new Se(nn,"SpreadingPacked",12);nn.className="Node",nn.SpreadingNone=Lx,nn.SpreadingEvenly=Hm,nn.SpreadingPacked=Wv;function ri(a,y){a===void 0||a instanceof vr||typeof a=="string"?nn.call(this,a):(nn.call(this),a&&(y=a)),this.U|=4608,this.Gn=new Me,this.$a=null,this.Sc=new Mo,this.Sc.group=this,this.gl=new Me,this.tb=this.$p=null,y&&Object.assign(this,y)}he(ri,nn),ri.prototype.cloneProtected=function(a){nn.prototype.cloneProtected.call(this,a),this.U=this.U&-32769;var y=a.Nl(function(x){return x instanceof Ms});y instanceof Ms?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())},Ct=ri.prototype,Ct.Af=function(a){nn.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 nn)x.Bd(y);else if(x instanceof Ve)for(x=x.labelNodes;x.next();)x.value.Bd(y)}},Ct.gk=function(a,y,x,E,b,z,tt){if(a===ir&&y==="elements"){if(b instanceof Ms)this.$a===null?this.$a=b:this.$a!==b&&Wt("Cannot insert a second Placeholder into the visual tree of a Group.");else if(b instanceof ze){var ot=b.Nl(function(rt){return rt instanceof Ms});ot instanceof Ms&&(this.$a===null?this.$a=ot:this.$a!==ot&&Wt("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===mr&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof ze&&this.$a.rg(E)&&(this.$a=null));nn.prototype.gk.call(this,a,y,x,E,b,z,tt)},Ct.Xl=function(a,y){nn.prototype.Xl.call(this,a,y),this.isClipping&&this.type!==ze.Spot&&this.isSubGraphExpanded&&(a=this.resizeObject,a instanceof ze&&(a=a.Pb()),this.tb===null&&(this.tb=new Ce),a.mi(this.tb),a instanceof gi&&this.tb.Bc(-a.strokeWidth,-a.strokeWidth))},Ct.eh=function(a,y,x,E){this.nf=this.$a,nn.prototype.eh.call(this,a,y,x,E)},Ct.Va=function(){var a=this;a.isSubGraphExpanded&&this.memberParts.each(function(y){!a.computesBoundsIncludingLinks&&y instanceof Ve||y.Va()}),nn.prototype.Va.call(this)},Ct.si=function(){if(!nn.prototype.si.call(this))return!1;for(var a=this.memberParts;a.next();){var y=a.value;if(y instanceof nn){if(y.isVisible()&&Ls(y))return!1}else if(y instanceof Ve&&y.isVisible()&&Ls(y)&&y.fromNode!==this&&y.toNode!==this)return!1}return!0};function Vv(a,y){if(a.Gn.add(y)){y instanceof ri&&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 Ve&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}function Uv(a,y){if(a.Gn.remove(y)){y instanceof ri&&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 Ve&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}Ct.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)}nn.prototype.Lj.call(this)},ri.prototype.canAddMembers=function(a){var y=this.diagram;if(y===null)return!1;for(y=y.commandHandler,a=xe(a).iterator;a.next();)if(!y.isValidMember(this,a.value))return!1;return!0},ri.prototype.addMembers=function(a,y){var x=this.diagram;if(x===null)return!1;x=x.commandHandler;var E=!0;for(a=xe(a).iterator;a.next();){var b=a.value;!y||x.isValidMember(this,b)?b.containingGroup=this:E=!1}return E},ri.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))},Ct=ri.prototype,Ct.Bd=function(a){var y=(this.U&65536)!==0;if(nn.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()?(sa(x.fromPort),sa(x.toPort),x.bb()):(E=x.toNode,E!==null&&E!==this&&E.Td(this)&&!E.isVisible()&&(sa(x.fromPort),sa(x.toPort),x.bb()))}}},Ct.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 Me,E=y.iterator;E.next();){var b=E.value;if(b instanceof nn)for(b=b.linksConnected;b.next();){var z=b.value;y.contains(z)||x.add(z)}}return a&&(this.$p=x),x.iterator},Ct.iz=function(){var a=this.Rj();a.add(this);for(var y=new Me,x=a.iterator;x.next();){var E=x.value;if(E instanceof nn)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},Ct.hz=function(){function a(x,E){x!==null&&(E.add(x),a(x.containingGroup,E))}var y=new Me;return a(this,y),y},Ct.Rj=function(){var a=new Me;return Gh(a,this,!0,0,!0),a.remove(this),a},Ct.Zb=function(a){nn.prototype.Zb.call(this,a);for(var y=this.memberParts;y.next();)y.value.Zb(a)},ri.prototype.collapseSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();QS(this,y,a,this),a.Ue=!1}};function QS(a,y,x,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!1),z instanceof ri&&z.isSubGraphExpanded&&(z.wasSubGraphExpanded=z.isSubGraphExpanded,QS(z,y,x,E)),z instanceof nn)z.Bd(y),x.Aj(z,E);else if(z instanceof Ve)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!1}ri.prototype.expandSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();qS(this,y,a,this),a.Ue=!1}};function qS(a,y,x,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!0),z instanceof ri&&z.wasSubGraphExpanded&&(z.wasSubGraphExpanded=!1,qS(z,y,x,E)),z instanceof nn)z.Bd(y),x.Cj(z,E);else if(z instanceof Ve)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!0}ri.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=Bt.alloc(),nn.prototype.move.call(this,a,y),a=new Me,y=this.Rj().iterator;y.next();)b=y.value,b instanceof Ve&&(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 nn&&b.isLinkLabel)){var tt=b.position,ot=b.location;tt.w()?(z.x=tt.x+E,z.y=tt.y+x,b.position=z):ot.w()&&(z.x=ot.x+E,z.y=ot.y+x,b.location=z)}for(y.reset();y.next();)b=y.value,b instanceof Ve&&(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(),Zv(b)&&b.bb());Bt.free(z)}},oe.Object.defineProperties(ri.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&&Wt("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&&(qu(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&&(qu(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&&(qu(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&&(qu(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)}}}),ri.prototype.expandSubGraph=ri.prototype.expandSubGraph,ri.prototype.collapseSubGraph=ri.prototype.collapseSubGraph,ri.prototype.findSubGraphParts=ri.prototype.Rj,ri.prototype.findContainingGroupChain=ri.prototype.hz,ri.prototype.findExternalNodesConnected=ri.prototype.iz,ri.prototype.findExternalLinksConnected=ri.prototype.Lu,ri.prototype.ensureBounds=ri.prototype.Va,ri.className="Group";function Ms(a){Jt.call(this),this.yb=Vr,this.ko=new Ce(NaN,NaN,NaN,NaN),a&&Object.assign(this,a)}he(Ms,Jt),Ms.prototype.cloneProtected=function(a){Jt.prototype.cloneProtected.call(this,a),a.yb=this.yb.J(),a.ko=this.ko.copy()},Ms.prototype.gh=function(a){if(this.background===null&&this.areaBackground===null)return!1;var y=this.naturalBounds;return Or(0,0,y.width,y.height,a.x,a.y)},Ms.prototype.Wl=function(){var a=this.part;if(a!==null&&(a instanceof ri||a instanceof Ii)||Wt("Placeholder is not inside a Group or Adornment."),a instanceof ri){var y=this.computeBorder(this.ko),x=this.minSize,E=this.dc;for(To(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=Bt.alloc(),x.xi(y,a.locationSpot),x.D(a.location)||(a.location=x),Bt.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 gi&&(tt=z.strokeWidth);var ot=z.Df(),rt=z.naturalBounds,at=(rt.width+tt)*ot;tt=(rt.height+tt)*ot,a.type!==ze.Link&&(ot=z.ga(a.category==="Selection"?io:a.locationSpot,Bt.alloc()),a.location=ot,Bt.free(ot)),isNaN(at)||isNaN(tt)?(a=z.ga(io,Bt.alloc()),at=Ce.allocAt(a.x,a.y,0,0),at.Ye(z.ga(Os,a)),at.Ye(z.ga(fa,a)),at.Ye(z.ga(Ds,a)),To(y,at.width+E||0,at.height+b||0),this.Ge(-x.left,-x.top,y.width,y.height),Bt.free(a),Ce.free(at)):(To(y,at+E||0,tt+b||0),this.Ge(-x.left,-x.top,y.width,y.height))}},Ms.prototype.eh=function(a,y,x,E){this.actualBounds.h(a,y,x,E)},Ms.prototype.computeBorder=function(a){var y=this.part,x=y.diagram,E=x===null||!x.animationManager.isAnimating;if(x!==null&&y instanceof ri&&!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=Ce.alloc(),b=this.computeMemberBounds(x);var z=this.yb;return y instanceof ri&&!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)),Ce.free(x),E&&y instanceof ri&&y.computesBoundsIncludingLocation&&y.location.w()&&a.Ye(y.location),a},Ms.prototype.computeMemberBounds=function(a){if(!(this.part instanceof ri))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 ot=tt.value;if(ot.isVisible()){if(ot instanceof Ve&&(!y.computesBoundsIncludingLinks||Sa(ot)||ot.fromNode===y||ot.toNode===y))continue;ot=ot.actualBounds,ot.left<x&&(x=ot.left),ot.top<E&&(E=ot.top),ot.right>b&&(b=ot.right),ot.bottom>z&&(z=ot.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},oe.Object.defineProperties(Ms.prototype,{padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new yi(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.g("padding",y,a),this.v())}}}),Ms.className="Placeholder";function Ve(a){On.call(this,ze.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=Es,this.Om=0,this.Qm=Es,this.Rm=NaN,this.qj=Jv,this.po=.5,this.wd=null,this.Nb=new ke().freeze(),this.Tg=this.Mg=null,this.ml=new Ce,this.ua=new Ue,this.u=this.o=this.Sf=this.Wf=null,this.su=new Bt,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],a&&Object.assign(this,a)}he(Ve,On),Ve.prototype.cloneProtected=function(a){On.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())},Ct=Ve.prototype,Ct.Af=function(a){On.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&&sa(y),a=a.toPort,a!==null&&sa(a)},Ct.qb=function(a){a.classType===Ve?(a.value&2)===2?this.routing=a:a===wa||a===th||a===Nf?this.curve=a:a===Qg||a===Km||a===Xm?this.adjusting=a:a!==Jv&&a!==Es&&Wt("Unknown Link enum value for a Link property: "+a):On.prototype.qb.call(this,a)},Ct.Xc=function(){this.ba===null&&(this.ba=new Rg)},Ct.si=function(){var a=this.fromNode;if(a!==null){var y=a.findVisibleNode();if(y!==null&&(a=y),Ls(a)||_h(a))return!1}return a=this.toNode,!(a!==null&&(y=a.findVisibleNode(),y!==null&&(a=y),Ls(a)||_h(a)))},Ct.zv=function(){return!1},Ct.Av=function(){},Ct.Zc=function(){return!1},Ve.prototype.computeAngle=function(a,y,x){return Ve.computeAngle(y,x)},Ve.computeAngle=function(a,y){switch(a){default:case Es:a=0;break;case qg:a=y;break;case $g:a=y+90;break;case tp:a=y-90;break;case Qv:a=y+180;break;case Jm:a=qt.bp(y),90<a&&270>a&&(a-=180);break;case ep:a=qt.bp(y+90),90<a&&270>a&&(a-=180);break;case np:a=qt.bp(y-90),90<a&&270>a&&(a-=180);break;case Qm:if(a=qt.bp(y),45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return qt.bp(a)};function bf(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&&Uv(x,a),a.Ah=y,y!==null&&Vv(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}Ct=Ve.prototype,Ct.oh=function(){var a=this.containingGroup;a!==null&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&On.prototype.oh.call(this)},Ct.To=function(a){var y=this.fromNode;return a===y?this.toNode:y},Ct.Cz=function(a){var y=this.fromPort;return a===y?this.toPort:y};function $S(a,y){a.wd===null&&(a.wd=new Me),a.wd.add(y),a.v()}Ct.Vo=function(a){if(On.prototype.Vo.call(this,a),Od(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,zm(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||zm(x,this,E)}Xg(this)}},Ct.Wo=function(a){if(On.prototype.Wo.call(this,a),Od(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,Gm(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||Gm(x,this,E)}Jg(this)}},Ct.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))},Ve.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)}},Ve.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?On.prototype.move.call(this,a,!1):(a=Bt.allocAt(x.x+E,x.y+b),On.prototype.move.call(this,a,!1),Bt.free(a)),$u(this,E,b),a=this.labelNodes;a.next();)y=a.value,x=y.position,y.moveTo(x.x+E,x.y+b)},Ve.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},Ve.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},Ve.prototype.computeMidPoint=function(a){var y=this.pointsCount;if(y===0)return a.assign(bo),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()===wa))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()===wa){if(y===3){x=this.i(0),E=this.i(1);var b=this.i(2);return qt.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),qt.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},Ve.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()===wa))return this.ua.wx(.5);if(this.computeCurve()===wa&&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),qt.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)},Ct=Ve.prototype,Ct.i=function(a){return this.Nb.s[a]},Ct.dd=function(a,y){this.Nb.cd(a,y)},Ct.L=function(a,y,x){this.Nb.cd(a,new Bt(y,x))},Ct.Kz=function(a,y){this.Nb.Gb(a,y)},Ct.m=function(a,y,x){this.Nb.Gb(a,new Bt(y,x))},Ct.ne=function(a){this.Nb.add(a)},Ct.yf=function(a,y){this.Nb.add(new Bt(a,y))},Ct.pv=function(a){this.Nb.mb(a)},Ct.Fj=function(){this.Nb.clear()};function $u(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 ke,z=a.Nb.iterator;z.next();){var tt=z.value;b.add(new Bt(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),Cs(a)),E?Wm(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint=a.i(a.pointsCount-1))),tt!==null&&tt.animationManager.zb&&$c(tt.animationManager,a,b),a.g("points",z,b)}}Ct.uh=function(){this.Mg===null&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},Ct.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 ot=b[tt];x=Math.min(ot.x,x),E=Math.min(ot.y,E)}ot=tt=1/0;for(var rt=y.s,at=rt.length,ut=0;ut<at;ut++){var ft=rt[ut];tt=Math.min(ft.x,tt),ot=Math.min(ft.y,ot),ft.freeze()}if(y.freeze(),at===z){for(z=0;z<at;z++)if(ut=b[z],ft=rt[z],ut.x-x!==ft.x-tt||ut.y-E!==ft.y-ot){this.qc();break}}else this.qc();this.Mg=null,x=this.diagram,x!==null&&x.animationManager.zb&&$c(x.animationManager,this,y),Wm(this),this.g("points",a,y)}},Ct.rv=function(){this.Mg!==null&&(this.Nb=this.Mg,this.Mg=null)};function Wm(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),Zm(a,!1))}Ct.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())}},Ct.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()}}},Ve.prototype.computePoints=function(){if(this.diagram===null)return!1;var a=this.fromNode,y=null;if(a===null?(Cc||(Cc=new nn,Cc.desiredSize=ni,Cc.Va()),this.defaultFromPoint&&(Cc.location=this.defaultFromPoint,Cc.Va(),y=a=Cc)):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?(Lc||(Lc=new nn,Lc.desiredSize=ni,Lc.Va()),this.defaultToPoint&&(Lc.location=this.defaultToPoint,Lc.Va(),b=E=Lc)):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 ot=Ff(tt),rt=Ff(x),at=y===b&&y!==null,ut=this.isOrthogonal,ft=this.curve===wa;this.Wf=at&&!ut?ft=!0:!1;var mt=this.computeAdjusting()===Es||at;if(!ut&&!at&&ot&&rt){if(ot=!1,!mt&&3<=z&&(mt=this.getLinkPoint(a,y,tt,!0,!1,E,b),rt=this.getLinkPoint(E,b,x,!1,!1,a,y),ot=this.adjustPoints(0,mt,z-1,rt))&&(mt=this.getLinkPoint(a,y,tt,!0,!1,E,b),rt=this.getLinkPoint(E,b,x,!1,!1,a,y),this.adjustPoints(0,mt,z-1,rt)),!ot)if(this.Fj(),ft){z=this.getLinkPoint(a,y,tt,!0,!1,E,b),mt=this.getLinkPoint(E,b,x,!1,!1,a,y),ot=mt.x-z.x,rt=mt.y-z.y,at=this.computeCurviness(),ft=ut=0;var yt=z.x+ot/3,xt=z.y+rt/3,Mt=yt,It=xt;qt.B(rt,0)?It=0<ot?It-at:It+at:(ut=-ot/rt,ft=Math.sqrt(at*at/(ut*ut+1)),0>at&&(ft=-ft),Mt=(0>rt?-1:1)*ft+yt,It=ut*(Mt-yt)+xt),yt=z.x+2*ot/3,xt=z.y+2*rt/3;var Tt=yt,zt=xt;qt.B(rt,0)?zt=0<ot?zt-at:zt+at:(Tt=(0>rt?-1:1)*ft+yt,zt=ut*(Tt-yt)+xt),this.Fj(),this.ne(z),this.yf(Mt,It),this.yf(Tt,zt),this.ne(mt),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,mt=b,E=this.getLinkPoint(a,y,tt,!0,!1,z,mt),b=this.getLinkPoint(z,mt,x,!1,!1,a,y),this.hasCurviness()?(mt=b.x-E.x,x=b.y-E.y,tt=this.computeCurviness(),a=E.x+mt/2,y=E.y+x/2,z=a,ot=y,qt.B(x,0)?ot=0<mt?ot-tt:ot+tt:(mt=-mt/x,z=Math.sqrt(tt*tt/(mt*mt+1)),0>tt&&(z=-z),z=(0>x?-1:1)*z+a,ot=mt*(z-a)+y),this.ne(E),this.yf(z,ot),this.ne(b)):(this.ne(E),this.ne(b),ot=Ce.alloc(),y.mi(ot),rt=ot.ca(b),mt.mi(ot),at=ot.ca(E),(rt||at)&&(tt=y.ga(Um(tt),new Bt),this.dd(0,this.getLinkPointFromPoint(a,y,tt,b,!0,tt)),x=mt.ga(Um(x),new Bt),this.dd(1,this.getLinkPointFromPoint(z,mt,x,E,!1,x))),Ce.free(ot))}else{ft=this.isAvoiding,mt&&(ut&&ft||at)&&this.Fj();var Ht=at?this.computeCurviness():0;ft=this.getLinkPoint(a,y,tt,!0,ut,E,b),yt=Mt=xt=0,(ut||!ot||at)&&(It=this.computeEndSegmentLength(a,y,tt,!0),yt=this.getLinkDirection(a,y,ft,tt,!0,ut,E,b),at&&(ot||tt.D(x)||!ut&&tt.x+x.x===1&&tt.y+x.y===1)&&(yt-=ut?90:30,0>Ht&&(yt-=180)),0>yt?yt+=360:360<=yt&&(yt-=360),at&&(It+=Math.abs(Ht)*(ut?1:2)),yt===0?xt=It:yt===90?Mt=It:yt===180?xt=-It:yt===270?Mt=-It:(xt=It*Math.cos(yt*Math.PI/180),Mt=It*Math.sin(yt*Math.PI/180)),tt.Mc()&&at&&(It=y.ga(ji,Bt.alloc()),Tt=Bt.allocAt(It.x+1e3*xt,It.y+1e3*Mt),this.getLinkPointFromPoint(a,y,It,Tt,!0,ft),Bt.free(It),Bt.free(Tt))),It=this.getLinkPoint(E,b,x,!1,ut,a,y);var Vt=zt=Tt=0;if(ut||!rt||at){var Xt=this.computeEndSegmentLength(E,b,x,!1);Vt=this.getLinkDirection(E,b,It,x,!1,ut,a,y),at&&(rt||tt.D(x)||!ut&&tt.x+x.x===1&&tt.y+x.y===1)&&(Vt+=ut?0:30,0>Ht&&(Vt+=180)),0>Vt?Vt+=360:360<=Vt&&(Vt-=360),at&&(Xt+=Math.abs(Ht)*(ut?1:2)),Vt===0?Tt=Xt:Vt===90?zt=Xt:Vt===180?Tt=-Xt:Vt===270?zt=-Xt:(Tt=Xt*Math.cos(Vt*Math.PI/180),zt=Xt*Math.sin(Vt*Math.PI/180)),x.Mc()&&at&&(x=b.ga(ji,Bt.alloc()),tt=Bt.allocAt(x.x+1e3*Tt,x.y+1e3*zt),this.getLinkPointFromPoint(E,b,x,tt,!1,It),Bt.free(x),Bt.free(tt))}x=ft,(ut||!ot||at)&&(x=new Bt(ft.x+xt,ft.y+Mt)),tt=It,(ut||!rt||at)&&(tt=new Bt(It.x+Tt,It.y+zt)),!mt&&!ut&&ot&&3<z&&this.adjustPoints(0,ft,z-2,tt)?this.dd(z-1,It):!mt&&!ut&&rt&&3<z&&this.adjustPoints(1,x,z-1,It)?this.dd(0,ft):!mt&&(ut?6<=z:4<z)&&this.adjustPoints(1,x,z-2,tt)?(this.dd(0,ft),this.dd(z-1,It)):(this.Fj(),this.ne(ft),(ut||!ot||at)&&this.ne(x),ut&&this.addOrthoPoints(x,yt,tt,Vt,a,E),(ut||!rt||at)&&this.ne(tt),this.ne(It))}return!0};function Yv(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}Ve.prototype.getLinkPointFromPoint=function(a,y,x,E,b,z){if(z===void 0&&(z=new Bt),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 ot=-a.m12*b,rt=-a.m21*b,at=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*rt+ut,E=E.x*ot+E.y*at+ft,tt=x.x*tt+x.y*rt+ut,x=x.x*ot+x.y*at+ft}return y.Sj(b,E,tt,x,z),a!==null&&z.transform(a),z};function Vm(a,y){var x=y.Zn;return x===null&&(x=new kc,x.port=y,x.node=y.part,y.Zn=x),a1(x,a)}Ve.prototype.getLinkPoint=function(a,y,x,E,b,z,tt,ot){if(ot===void 0&&(ot=new Bt),x.sb()&&!Ff(x))return y.ga(x,ot),ot;if(x.$c()){var rt=Vm(this,y);if(rt!==null){if(ot.assign(rt.Zo),b&&this.routing===e1){var at=Vm(this,tt);if(at!==null&&rt.Gl<at.Gl){rt=Bt.alloc(),at=Bt.alloc();var ut=new Ce(y.ga(io,rt),y.ga(Os,at)),ft=this.computeSpot(!E,tt);a=this.getLinkPoint(z,tt,ft,!E,b,a,y,at),(x.Hf($a)||x.Hf(Hr))&&a.y>=ut.y&&a.y<=ut.y+ut.height?ot.y=a.y:(x.Hf(El)||x.Hf(ga))&&a.x>=ut.x&&a.x<=ut.x+ut.width&&(ot.x=a.x),Bt.free(rt),Bt.free(at)}}return ot}}return x=y.ga(Um(x),Bt.alloc()),this.pointsCount>(b?6:2)?(tt=E?this.i(1):this.i(this.pointsCount-2),b&&(tt=Yv(x,tt.copy()))):(rt=this.computeSpot(!E,tt),z=Bt.alloc(),tt=tt.ga(Um(rt),z),b&&(tt=Yv(x,tt)),Bt.free(z)),this.getLinkPointFromPoint(a,y,x,tt,E,ot),Bt.free(x),ot},Ve.prototype.getLinkDirection=function(a,y,x,E,b,z,tt,ot){t:if(E.sb())var rt=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()&&(rt=Vm(this,y),rt!==null))switch(rt.Nc){case 1:rt=270;break t;case 2:rt=180;break t;default:case 4:rt=0;break t;case 8:rt=90;break t}rt=y.ga(ji,Bt.alloc()),this.pointsCount>(z?6:2)?(ot=b?this.i(1):this.i(this.pointsCount-2),ot=z?Yv(rt,ot.copy()):x):(x=Bt.alloc(),ot=ot.ga(ji,x),Bt.free(x)),x=Math.abs(ot.x-rt.x)>Math.abs(ot.y-rt.y)?ot.x>=rt.x?0:180:ot.y>=rt.y?90:270,Bt.free(rt),rt=x}return E.Mc()&&tt.Td(a)&&(rt+=180,360<=rt&&(rt-=360)),Ff(E)||(a=y.li(),a===0)||(45<=a&&135>a?rt+=90:135<=a&&225>a?rt+=180:225<=a&&315>a&&(rt+=270),360<=rt&&(rt-=360)),rt},Ve.prototype.computeEndSegmentLength=function(a,y,x,E){return y!==null&&x.$c()&&(a=Vm(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)},Ve.prototype.computeSpot=function(a,y){return y===void 0&&(y=null),a?(a=y||this.fromPort,a===null?a=ji:(y=this.fromSpot,y.Xb()&&(y=a.fromSpot),a=y===Fr?Ni:y)):(a=y||this.toPort,a===null?a=ji:(y=this.toSpot,y.Xb()&&(y=a.toSpot),a=y===Fr?Ni:y)),a};function Ff(a){return a===Ni||a.x===.5&&a.y===.5}function Um(a){return a.x===.5&&a.y===.5?a:ji}Ve.prototype.computeOtherPoint=function(a,y){return this.computeAdjusting()!==Es&&4<this.pointsCount?this.computeMidPoint(new Bt):(a=y.Zn,a=a!==null?a1(a,this):null,a!==null?a.Zo:y.ga(ji))},Ve.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},Ve.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=ci.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&ci.free(tt),!0;if(this.Yc(a,tt)){var ot=!1;if(!this.isAtomic)for(var rt=this.O.s,at=rt.length;at--;){var ut=rt[at];if(ut.visible||ut===this.locationObject){var ft=ut.actualBounds,mt=this.naturalBounds;if(!(ft.x>mt.width||ft.y>mt.height||0>ft.x+ft.width||0>ft.y+ft.height)){if(ft=ci.alloc(),ft.set(tt),ut instanceof ze)ot=ut.Cf(a,y,x,E,b,ft);else if(this.path===ut){if(ut instanceof gi)if(ot=a,mt=E,ut.pickable===!1)ot=!1;else if(ft.multiply(ut.transform),mt)t:{var yt=ot,xt=ft;if(ut.fh(yt,xt))ot=!0;else{if(xt===void 0&&(xt=ut.transform,yt.Re(ut.actualBounds))){ot=!0;break t}ot=yt.left,mt=yt.right;var Mt=yt.top;yt=yt.bottom;var It=Bt.alloc(),Tt=Bt.alloc(),zt=Bt.alloc(),Ht=ci.alloc();Ht.set(xt),Ht.bv(ut.transform),Ht.Vj(),Tt.x=mt,Tt.y=Mt,Tt.transform(Ht),It.x=ot,It.y=Mt,It.transform(Ht),xt=!1,Bd(ut,It,Tt,zt)?xt=!0:(It.x=mt,It.y=yt,It.transform(Ht),Bd(ut,It,Tt,zt)?xt=!0:(Tt.x=ot,Tt.y=yt,Tt.transform(Ht),Bd(ut,It,Tt,zt)?xt=!0:(It.x=ot,It.y=Mt,It.transform(Ht),Bd(ut,It,Tt,zt)&&(xt=!0)))),ci.free(Ht),Bt.free(It),Bt.free(Tt),Bt.free(zt),ot=xt}}else ot=ut.fh(ot,ft)}else ot=Pr(ut,a,E,ft);ot&&(mt=ut,y!==null&&(mt=y(ut)),mt&&(x===null||x(mt))&&b.add(mt)),ci.free(ft)}}}return z===void 0&&ci.free(tt),ot||this.background!==null||this.areaBackground!==null}return z===void 0&&ci.free(tt),!1},Ve.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?wa:this.curve},Ve.prototype.computeCorner=function(){if(this.curve===wa)return 0;var a=this.corner;return(isNaN(a)||0>a)&&(a=10),a},Ve.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},Ve.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a=i1;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===qg||E===Jm||E===Qv?a=Math.max(a,b):E===tp||E===np||E===$g||E===ep?a=Math.max(a,tt):(y=y.ga(ji).ab(x.ga(ji))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(y)*tt)+Math.abs(Math.cos(y)*b)+1)),this.curve===wa&&(a*=1.333)}}return a},Ve.prototype.arrangeBundledLinks=function(a,y){if(y)for(y=0;y<a.length;y++){var x=a[y];x.computeAdjusting()===Es&&x.bb()}},Ve.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=n1;var y=this.Sf;if(y!==null){for(var x=ln(),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),Be(x)}}return a},Ve.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return a!==null?Math.max(a.strokeWidth,1):1},Ve.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},Ve.prototype.adjustPoints=function(a,y,x,E){var b=this.computeAdjusting();if(this.isOrthogonal){if(b===Km)return!1;b===Xm&&(b=Qg)}switch(b){case Km:var z=this.i(a),tt=this.i(x);if(!z.Xa(y)||!tt.Xa(E)){b=z.x,z=z.y;var ot=tt.x-b,rt=tt.y-z,at=Math.sqrt(ot*ot+rt*rt);if(!qt.$(at,0)){if(qt.$(ot,0))var ut=0>rt?-Math.PI/2:Math.PI/2;else ut=Math.atan(rt/Math.abs(ot)),0>ot&&(ut=Math.PI-ut);tt=y.x;var ft=y.y;ot=E.x-tt;var mt=E.y-ft;for(rt=Math.sqrt(ot*ot+mt*mt),qt.$(ot,0)?mt=0>mt?-Math.PI/2:Math.PI/2:(mt=Math.atan(mt/Math.abs(ot)),0>ot&&(mt=Math.PI-mt)),at=rt/at,ut=mt-ut,this.dd(a,y),a+=1;a<x;a++)y=this.i(a),ot=y.x-b,rt=y.y-z,y=Math.sqrt(ot*ot+rt*rt),qt.$(y,0)||(qt.$(ot,0)?rt=0>rt?-Math.PI/2:Math.PI/2:(rt=Math.atan(rt/Math.abs(ot)),0>ot&&(rt=Math.PI-rt)),ot=rt+ut,y*=at,this.L(a,tt+y*Math.cos(ot),ft+y*Math.sin(ot)));this.dd(x,E)}}return!0;case Xm: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,at=(tt-b)*(tt-b)+(ft-z)*(ft-z),ot=y.x,ut=y.y,rt=E.x,mt=E.y;var yt=1;if(rt-ot!==0){var xt=(mt-ut)/(rt-ot);yt=Math.sqrt(1+1/(xt*xt))}else xt=9e9;for(this.dd(a,y),a+=1;a<x;a++){y=this.i(a);var Mt=y.x,It=y.y,Tt=.5;at!==0&&(Tt=((b-Mt)*(b-tt)+(z-It)*(z-ft))/at);var zt=b+Tt*(tt-b),Ht=z+Tt*(ft-z);y=Math.sqrt((Mt-zt)*(Mt-zt)+(It-Ht)*(It-Ht)),It<xt*(Mt-zt)+Ht&&(y=-y),0<xt&&(y=-y),Mt=ot+Tt*(rt-ot),Tt=ut+Tt*(mt-ut),xt!==0?(y=Mt+y/yt,this.L(a,y,Tt-(y-Mt)/xt)):this.L(a,Mt,Tt+y)}this.dd(x,E)}return!0;case Qg:t:{if(this.isOrthogonal&&(b=this.i(a),z=this.i(a+1),tt=this.i(a+2),ot=z.x,ut=z.y,ft=ot,at=ut,qt.B(b.y,z.y)?qt.B(z.x,tt.x)?ut=y.y:qt.B(z.y,tt.y)&&(ot=y.x):qt.B(b.x,z.x)&&(qt.B(z.y,tt.y)?ot=y.x:qt.B(z.x,tt.x)&&(ut=y.y)),this.L(a+1,ot,ut),b=this.i(x),z=this.i(x-1),tt=this.i(x-2),ot=z.x,ut=z.y,rt=ot,mt=ut,qt.B(b.y,z.y)?qt.B(z.x,tt.x)?ut=E.y:qt.B(z.y,tt.y)&&(ot=E.x):qt.B(b.x,z.x)&&(qt.B(z.y,tt.y)?ot=E.x:qt.B(z.x,tt.x)&&(ut=E.y)),this.L(x-1,ot,ut),Zv(this))){this.L(a+1,ft,at),this.L(x-1,rt,mt),x=!1;break t}this.dd(a,y),this.dd(x,E),x=!0}return x;default:return!1}},Ve.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 ot=b.actualBounds.copy(),rt=z.actualBounds.copy();if(ot.w()&&rt.w()){ot.Bc(ip,ip),rt.Bc(ip,ip),ot.Ye(a),rt.Ye(x);var at=Bt.alloc(),ut=Bt.alloc();y===0?x.x>a.x||E===270&&x.y<a.y&&rt.right>a.x||E===90&&x.y>a.y&&rt.right>a.x?(at.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),E===180?(at.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),ut.x=at.x,ut.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(at.x=a.x<rt.left?this.computeMidOrthoPosition(a.x,a.y,rt.left,x.y,!1):a.x<rt.right&&(E===270&&a.y<rt.top||E===90&&a.y>rt.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):rt.right,ut.x=at.x,ut.y=x.y):E===0&&a.x<rt.left&&a.y>rt.top&&a.y<rt.bottom&&(at.x=a.x,at.y=a.y<x.y?Math.min(x.y,rt.top):Math.max(x.y,rt.bottom),ut.y=at.y)):(at.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),(E===180||E===90&&x.y<ot.top||E===270&&x.y>ot.bottom)&&(E===180&&(rt.ca(a)||ot.ca(x))?at.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===180||E===90)?at.y=this.computeMidOrthoPosition(a.x,ot.top,x.x,Math.max(x.y,rt.bottom),!0):x.y>a.y&&(E===180||E===270)&&(at.y=this.computeMidOrthoPosition(a.x,ot.bottom,x.x,Math.min(x.y,rt.top),!0)),ut.x=x.x,ut.y=at.y),at.y>ot.top&&at.y<ot.bottom&&(x.x>=ot.left&&x.x<=a.x||a.x<=rt.right&&a.x>=x.x?(E===90||E===270)&&(at.h(Math.max((a.x+x.x)/2,a.x),a.y),ut.h(at.x,x.y)):(at.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===0?ot.top:Math.min(ot.top,rt.top)):Math.max(x.y,E===0?ot.bottom:Math.max(ot.bottom,rt.bottom)),ut.x=x.x,ut.y=at.y))):y===180?x.x<a.x||E===270&&x.y<a.y&&rt.left<a.x||E===90&&x.y>a.y&&rt.left<a.x?(at.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),E===0?(at.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),ut.x=at.x,ut.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(at.x=a.x>rt.right?this.computeMidOrthoPosition(a.x,a.y,rt.right,x.y,!1):a.x>rt.left&&(E===270&&a.y<rt.top||E===90&&a.y>rt.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):rt.left,ut.x=at.x,ut.y=x.y):E===180&&a.x>rt.right&&a.y>rt.top&&a.y<rt.bottom&&(at.x=a.x,at.y=a.y<x.y?Math.min(x.y,rt.top):Math.max(x.y,rt.bottom),ut.y=at.y)):(at.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),(E===0||E===90&&x.y<ot.top||E===270&&x.y>ot.bottom)&&(E===0&&(rt.ca(a)||ot.ca(x))?at.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===0||E===90)?at.y=this.computeMidOrthoPosition(a.x,ot.top,x.x,Math.max(x.y,rt.bottom),!0):x.y>a.y&&(E===0||E===270)&&(at.y=this.computeMidOrthoPosition(a.x,ot.bottom,x.x,Math.min(x.y,rt.top),!0)),ut.x=x.x,ut.y=at.y),at.y>ot.top&&at.y<ot.bottom&&(x.x<=ot.right&&x.x>=a.x||a.x>=rt.left&&a.x<=x.x?(E===90||E===270)&&(at.h(Math.min((a.x+x.x)/2,a.x),a.y),ut.h(at.x,x.y)):(at.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===180?ot.top:Math.min(ot.top,rt.top)):Math.max(x.y,E===180?ot.bottom:Math.max(ot.bottom,rt.bottom)),ut.x=x.x,ut.y=at.y))):y===90?x.y>a.y||E===180&&x.x<a.x&&rt.bottom>a.y||E===0&&x.x>a.x&&rt.bottom>a.y?(at.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),E===270?(at.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),ut.x=x.x,ut.y=at.y):E===180&&x.x<a.x||E===0&&x.x>a.x?(at.y=a.y<rt.top?this.computeMidOrthoPosition(a.x,a.y,x.x,rt.top,!0):a.y<rt.bottom&&(E===180&&a.x<rt.left||E===0&&a.x>rt.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):rt.bottom,ut.x=x.x,ut.y=at.y):E===90&&a.y<rt.top&&a.x>rt.left&&a.x<rt.right&&(at.x=a.x<x.x?Math.min(x.x,rt.left):Math.max(x.x,rt.right),at.y=a.y,ut.x=at.x)):(at.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),(E===270||E===0&&x.x<ot.left||E===180&&x.x>ot.right)&&(E===270&&(rt.ca(a)||ot.ca(x))?at.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===270||E===0)?at.x=this.computeMidOrthoPosition(ot.left,a.y,Math.max(x.x,rt.right),x.y,!1):x.x>a.x&&(E===270||E===180)&&(at.x=this.computeMidOrthoPosition(ot.right,a.y,Math.min(x.x,rt.left),x.y,!1)),ut.x=at.x,ut.y=x.y),at.x>ot.left&&at.x<ot.right&&(x.y>=ot.top&&x.y<=a.y||a.y<=rt.bottom&&a.y>=x.y?(E===0||E===180)&&(at.h(a.x,Math.max((a.y+x.y)/2,a.y)),ut.h(x.x,at.y)):(at.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===90?ot.left:Math.min(ot.left,rt.left)):Math.max(x.x,E===90?ot.right:Math.max(ot.right,rt.right)),ut.x=at.x,ut.y=x.y))):x.y<a.y||E===180&&x.x<a.x&&rt.top<a.y||E===0&&x.x>a.x&&rt.top<a.y?(at.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),E===90?(at.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),ut.x=x.x,ut.y=at.y):E===180&&x.x<a.x||E===0&&x.x>=a.x?(at.y=a.y>rt.bottom?this.computeMidOrthoPosition(a.x,a.y,x.x,rt.bottom,!0):a.y>rt.top&&(E===180&&a.x<rt.left||E===0&&a.x>rt.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):rt.top,ut.x=x.x,ut.y=at.y):E===270&&a.y>rt.bottom&&a.x>rt.left&&a.x<rt.right&&(at.x=a.x<x.x?Math.min(x.x,rt.left):Math.max(x.x,rt.right),at.y=a.y,ut.x=at.x)):(at.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),(E===90||E===0&&x.x<ot.left||E===180&&x.x>ot.right)&&(E===90&&(rt.ca(a)||ot.ca(x))?at.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===90||E===0)?at.x=this.computeMidOrthoPosition(ot.left,a.y,Math.max(x.x,rt.right),x.y,!1):x.x>a.x&&(E===90||E===180)&&(at.x=this.computeMidOrthoPosition(ot.right,a.y,Math.min(x.x,rt.left),x.y,!1)),ut.x=at.x,ut.y=x.y),at.x>ot.left&&at.x<ot.right&&(x.y<=ot.bottom&&x.y>=a.y||a.y>=rt.top&&a.y<=x.y?(E===0||E===180)&&(at.h(a.x,Math.min((a.y+x.y)/2,a.y)),ut.h(x.x,at.y)):(at.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===270?ot.left:Math.min(ot.left,rt.left)):Math.max(x.x,E===270?ot.right:Math.max(ot.right,rt.right)),ut.x=at.x,ut.y=x.y)));var ft=x;if(this.isAvoiding){var mt=this.diagram;if(mt===null||b===z||this.layer.isTemporary||!uf(mt)||ot.ca(ft)&&!z.Td(b)||rt.ca(a)&&!b.Td(z))y=!1;else{var yt=hf(mt,!0,this.containingGroup,null);if(this.segmentIndex!==17&&yt.Yj(Math.min(a.x,at.x),Math.min(a.y,at.y),Math.abs(a.x-at.x),Math.abs(a.y-at.y))&&yt.Yj(Math.min(at.x,ut.x),Math.min(at.y,ut.y),Math.abs(at.x-ut.x),Math.abs(at.y-ut.y))&&yt.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 xt=x=null;if(mt.isVirtualized){mt=yt.bounds.copy(),mt.Bc(-yt.Ho,-yt.Go);var Mt=Bt.alloc();Tf(yt,a.x,a.y)||(qt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,a.x,a.y,at.x,at.y,Mt)?(x=a=Mt.copy(),y=Mt.ab(at)):qt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,at.x,at.y,ut.x,ut.y,Mt)?(x=a=Mt.copy(),y=Mt.ab(ut)):qt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,ut.x,ut.y,ft.x,ft.y,Mt)&&(x=a=Mt.copy(),y=Mt.ab(ft))),Tf(yt,ft.x,ft.y)||(qt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,ft.x,ft.y,ut.x,ut.y,Mt)?(xt=ft=Mt.copy(),E=ut.ab(Mt)):qt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,ut.x,ut.y,at.x,at.y,Mt)?(xt=ft=Mt.copy(),E=at.ab(Mt)):qt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,at.x,at.y,a.x,a.y,Mt)&&(xt=ft=Mt.copy(),E=a.ab(Mt))),Bt.free(Mt)}ot=ot.copy().ed(rt),ot.Bc(yt.Ho*yt.Os,yt.Go*yt.Os),r1(yt,a,y,ft,E,ot,!0),rt=$l(yt,ft.x,ft.y),!yt.abort&&rt>=Af&&(o1(yt),ot.Bc(yt.Ho*yt.Hx,yt.Go*yt.Ix),r1(yt,a,y,ft,E,ot,!1),rt=$l(yt,ft.x,ft.y)),!yt.abort&&rt<Af&&$l(yt,ft.x,ft.y)!==eh?(Kv(this,yt,ft.x,ft.y,E,!0,tt),ot=this.i(2),4>this.pointsCount?(y===0||y===180?(ot.x=a.x,ot.y=ft.y):(ot.x=ft.x,ot.y=a.y),this.L(2,ot.x,ot.y),this.m(3,ot.x,ot.y)):(tt=this.i(3),y===0||y===180?qt.B(ot.x,tt.x)?(ot=y===0?Math.max(ot.x,a.x):Math.min(ot.x,a.x),this.L(2,ot,a.y),this.L(3,ot,tt.y)):qt.B(ot.y,tt.y)?(Math.abs(a.y-ot.y)<=yt.Go/2&&(this.L(2,ot.x,a.y),this.L(3,tt.x,a.y)),this.m(2,ot.x,a.y)):this.L(2,a.x,ot.y):(y===90||y===270)&&(qt.B(ot.y,tt.y)?(ot=y===90?Math.max(ot.y,a.y):Math.min(ot.y,a.y),this.L(2,a.x,ot),this.L(3,tt.x,ot)):qt.B(ot.x,tt.x)?(Math.abs(a.x-ot.x)<=yt.Ho/2&&(this.L(2,a.x,ot.y),this.L(3,a.x,tt.y)),this.m(2,a.x,ot.y)):this.L(2,ot.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)),xt!==null&&(E===0||E===180?this.yf(z.x,xt.y):this.yf(xt.x,z.y)),y=!0):y=!1}}}else y=!1;y||(this.ne(at.copy()),this.ne(ut.copy())),Bt.free(at),Bt.free(ut)}},Ve.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 Zv(a){if(a.diagram===null||!a.isAvoiding||!uf(a.diagram))return!1;var y=a.points.s,x=y.length;if(4>x)return!1;a=hf(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 Kv(a,y,x,E,b,z,tt){var ot=y.Ho,rt=y.Go,at=$l(y,x,E),ut=x,ft=E;for(b===0?ut+=ot:b===90?ft+=rt:b===180?ut-=ot:ft-=rt,b!==tt&&at>Id&&$l(y,ut,ft)!==at-1&&($l(y,x-ot,E)===at-1?(b=180,ut=x-ot,ft=E):$l(y,x+ot,E)===at-1?(b=0,ut=x+ot,ft=E):$l(y,x,E-rt)===at-1?(b=270,ut=x,ft=E-rt):$l(y,x,E+rt)===at-1&&(b=90,ut=x,ft=E+rt));at>Id&&$l(y,ut,ft)===at-1;)x=ut,E=ft,b===0?ut+=ot:b===90?ft+=rt:b===180?ut-=ot:ft-=rt,--at;z?at>Id&&(b===180||b===0?x=Math.floor(x/ot)*ot+ot/2:(b===90||b===270)&&(E=Math.floor(E/rt)*rt+rt/2)):(x=Math.floor(x/ot)*ot+ot/2,E=Math.floor(E/rt)*rt+rt/2),at>Id&&(z=b,tt=x,ut=E,b===0?(z=90,ut+=rt):b===90?(z=180,tt-=ot):b===180?(z=270,ut-=rt):b===270&&(z=0,tt+=ot),$l(y,tt,ut)===at-1?Kv(a,y,tt,ut,z,!1,z):(tt=x,ut=E,b===0?(z=270,ut-=rt):b===90?(z=0,tt+=ot):b===180?(z=90,ut+=rt):b===270&&(z=180,tt-=ot),$l(y,tt,ut)===at-1&&Kv(a,y,tt,ut,z,!1,z))),a.yf(x,E)}Ve.prototype.ez=function(a){var y=a.x;a=a.y;for(var x=this.i(0),E=this.i(1),b=Bi(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 ot=Bi(y,a,E.x,E.y,x.x,x.y);E=x,ot<b&&(z=tt,b=ot)}return z},Ve.prototype.qc=function(){this.lk=!1,this.v()},Ve.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 gi&&(b.ua=this.ua)}}},Ve.prototype.makeGeometry=function(){var a=this.ua,y=this.pointsCount,x=!1,E=this.diagram;E!==null&&Od(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===wa&&3<=y&&!qt.$(this.smoothness,0))if(y===3){var ot=this.i(1);E=Math.min(b.x,ot.x);var rt=Math.min(b.y,ot.y);ot=this.i(2),E=Math.min(E,ot.x),rt=Math.min(rt,ot.y)}else{if(this.isOrthogonal)for(rt=0;rt<y;rt++)ot=E[rt],z.x=Math.min(ot.x,z.x),z.y=Math.min(ot.y,z.y);else for(E=3;E<y;E+=3)E+3>=y&&(E=y-1),rt=this.i(E),z.x=Math.min(rt.x,z.x),z.y=Math.min(rt.y,z.y);E=z.x,rt=z.y}else{for(rt=0;rt<y;rt++)ot=E[rt],z.x=Math.min(ot.x,z.x),z.y=Math.min(ot.y,z.y);E=z.x,rt=z.y}if(E-=this.su.x,rt-=this.su.y,b.x-=E,b.y-=rt,y!==2||Od(this)){if(a.type=Ue.o,ot=NS(a),this.computeShortLength(!0)!==0&&(b=wc(this,b,!0,z)),Ef(ot,b.x,b.y,!1),tt===wa&&3<=y&&!qt.$(this.smoothness,0))if(y===3)x=this.i(1),y=x.x-E,x=x.y-rt,b=this.i(2).copy(),b.x-=E,b.y-=rt,this.computeShortLength(!1)!==0&&(b=wc(this,b,!1,z)),Ju(ot,y,x,y,x,b.x,b.y);else if(this.isOrthogonal){y=Bt.allocAt(E,rt),x=Bt.alloc(),x.assign(this.i(1)),z=Bt.allocAt(E,rt),b=Bt.allocAt(E,rt),tt=this.i(0);for(var at,ut=this.smoothness/3,ft=1;ft<this.pointsCount-1;ft++){at=this.i(ft);var mt=tt,yt=at,xt=this.i(Xv(this,at,ft,!1));if((!qt.$(mt.x,yt.x)||!qt.$(yt.x,xt.x))&&(!qt.$(mt.y,yt.y)||!qt.$(yt.y,xt.y))){var Mt=ut;isNaN(Mt)&&(Mt=this.smoothness/3);var It=mt.x;mt=mt.y;var Tt=yt.x;yt=yt.y;var zt=xt.x;xt=xt.y;var Ht=Mt*Ym(It,mt,Tt,yt);Mt*=Ym(Tt,yt,zt,xt),qt.$(mt,yt)&&qt.$(Tt,zt)&&(Tt>It?xt>yt?(z.x=Tt-Ht,z.y=yt-Ht,b.x=Tt+Mt,b.y=yt+Mt):(z.x=Tt-Ht,z.y=yt+Ht,b.x=Tt+Mt,b.y=yt-Mt):xt>yt?(z.x=Tt+Ht,z.y=yt-Ht,b.x=Tt-Mt,b.y=yt+Mt):(z.x=Tt+Ht,z.y=yt+Ht,b.x=Tt-Mt,b.y=yt-Mt)),qt.$(It,Tt)&&qt.$(yt,xt)&&(yt>mt?(zt>Tt?(z.x=Tt-Ht,z.y=yt-Ht,b.x=Tt+Mt):(z.x=Tt+Ht,z.y=yt-Ht,b.x=Tt-Mt),b.y=yt+Mt):(zt>Tt?(z.x=Tt-Ht,z.y=yt+Ht,b.x=Tt+Mt):(z.x=Tt+Ht,z.y=yt+Ht,b.x=Tt-Mt),b.y=yt-Mt)),(qt.$(It,Tt)&&qt.$(Tt,zt)||qt.$(mt,yt)&&qt.$(yt,xt))&&(It=.5*(It+zt),mt=.5*(mt+xt),z.x=It,z.y=mt,b.x=It,b.y=mt),(ft===1||ft===2&&qt.$(tt.x,this.i(0).x)&&qt.$(tt.y,this.i(0).y))&&(x.x=.5*(tt.x+at.x),x.y=.5*(tt.y+at.y)),Ju(ot,x.x-E,x.y-rt,z.x-E,z.y-rt,at.x-E,at.y-rt),y.set(z),x.set(b),tt=at}}at=tt.x,tt=tt.y,ut=this.i(this.pointsCount-1),this.computeShortLength(!1)!==0&&(ut=wc(this,ut.copy(),!1,vo)),at=.5*(at+ut.x),tt=.5*(tt+ut.y),Ju(ot,b.x-E,b.y-rt,at-E,tt-rt,ut.x-E,ut.y-rt),Bt.free(y),Bt.free(x),Bt.free(z),Bt.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=wc(this,tt.copy(),!1,vo)),Ju(ot,z.x-E,z.y-rt,b.x-E,b.y-rt,tt.x-E,tt.y-rt);else{for(z=Bt.alloc(),z.assign(this.i(0)),b=Bt.alloc(),b.assign(z),tt=this.computeCorner(),ft=1,at=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=wc(this,ut.copy(),!1,vo)),Pc(this,ot,-E,-rt,z,ut,x);else if(at===0)for(ft=1;ft<y;)b.assign(z),ut=this.i(ft++),Pc(this,ot,-E,-rt,z,ut,x),z.assign(ut);break}if(at=Xv(this,ut,ft+1,ft<y-3),ft=-E,It=-rt,mt=ut,Tt=this.i(at),Mt=x,qt.B(z.y,mt.y)&&qt.B(mt.x,Tt.x))if(xt=Math.min(tt,Math.abs(mt.x-b.x)/2),xt=Ht=Math.min(xt,Math.abs(Tt.y-mt.y)/2),qt.B(xt,0))Pc(this,ot,ft,It,z,mt,Mt),z.assign(mt);else{var Vt=mt.x,Xt=mt.y;yt=Vt,zt=Xt,mt.x>z.x?Vt=mt.x-xt:Vt=mt.x+xt,Tt.y>mt.y?zt=mt.y+Ht:zt=mt.y-Ht,Tt=Bt.allocAt(Vt,Xt),Pc(this,ot,ft,It,z,Tt,Mt),Bt.free(Tt),Im(ot,mt.x+ft,mt.y+It,yt+ft,zt+It),z.h(yt,zt)}else qt.B(z.x,mt.x)&&qt.B(mt.y,Tt.y)?(xt=Math.min(tt,Math.abs(mt.y-b.y)/2),xt=Ht=Math.min(xt,Math.abs(Tt.x-mt.x)/2),qt.B(Ht,0)?(Pc(this,ot,ft,It,z,mt,Mt),z.assign(mt)):(Vt=mt.x,Xt=mt.y,yt=Vt,zt=Xt,mt.y>z.y?Xt=mt.y-xt:Xt=mt.y+xt,Tt.x>mt.x?yt=mt.x+Ht:yt=mt.x-Ht,Tt=Bt.allocAt(Vt,Xt),Pc(this,ot,ft,It,z,Tt,Mt),Bt.free(Tt),Im(ot,mt.x+ft,mt.y+It,yt+ft,zt+It),z.h(yt,zt))):(Pc(this,ot,ft,It,z,mt,Mt),z.assign(mt));b.assign(ut),ft=at}Bt.free(z)}Rm=ot}else ot=this.i(1).copy(),ot.x-=E,ot.y-=rt,this.computeShortLength(!0)!==0&&(b=wc(this,b,!0,z)),this.computeShortLength(!1)!==0&&(ot=wc(this,ot,!1,z)),a.type=Ue.j,a.startX=b.x,a.startY=b.y,a.endX=ot.x,a.endY=ot.y;return this.lk=!0,a};function Ym(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),qt.$(a,0)?y:qt.$(y,0)?a:Math.sqrt(a*a+y*y)))}function wc(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=Ym(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=Ym(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;qt.$(y.x,z.x)&&qt.$(y.y,z.y);){if(x>=b)return b-1;z=a.i(x++)}if(!qt.$(y.x,z.x)&&!qt.$(y.y,z.y))return x-1;for(var tt=z;qt.$(y.x,z.x)&&qt.$(z.x,tt.x)&&(!E||(y.y>=z.y?z.y>=tt.y:z.y<=tt.y))||qt.$(y.y,z.y)&&qt.$(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}Ve.prototype.computeJumpLength=function(){return 10};function Pc(a,y,x,E,b,z,tt){if(!tt&&Od(a)){tt=a.computeJumpLength();var ot=tt/2,rt=[],at=0;if(a.isVisible()&&(at=kx(a,b,z,rt)),0<at){if(qt.B(b.y,z.y))if(b.x<z.x)for(var ut=0;ut<at;){var ft=Math.max(b.x,Math.min(rt[ut++]-ot,z.x-tt));y.lineTo(ft+x,z.y+E);for(var mt=ft+x,yt=Math.min(ft+tt,z.x);ut<at&&(ft=rt[ut],ft<yt+tt);)ut++,yt=Math.min(ft+ot,z.x);ft=z.y-tt+E,yt+=x;var xt=z.y+E;a.curve===th?Ef(y,yt,xt,!1):Ju(y,mt,ft,yt,ft,yt,xt)}else for(--at;0<=at;){for(ut=Math.min(b.x,Math.max(rt[at--]+ot,z.x+tt)),y.lineTo(ut+x,z.y+E),mt=ut+x,ft=Math.max(ut-tt,z.x);0<=at&&(ut=rt[at],ut>ft-tt);)at--,ft=Math.max(ut-ot,z.x);ut=z.y-tt+E,ft+=x,yt=z.y+E,a.curve===th?Ef(y,ft,yt,!1):Ju(y,mt,ut,ft,ut,ft,yt)}else if(qt.B(b.x,z.x))if(b.y<z.y)for(ut=0;ut<at;){for(ft=Math.max(b.y,Math.min(rt[ut++]-ot,z.y-tt)),y.lineTo(z.x+x,ft+E),mt=ft+E,ft=Math.min(ft+tt,z.y);ut<at&&(yt=rt[ut],yt<ft+tt);)ut++,ft=Math.min(yt+ot,z.y);yt=z.x-tt+x,xt=z.x+x,ft+=E,a.curve===th?Ef(y,xt,ft,!1):Ju(y,yt,mt,yt,ft,xt,ft)}else for(--at;0<=at;){for(ut=Math.min(b.y,Math.max(rt[at--]+ot,z.y+tt)),y.lineTo(z.x+x,ut+E),mt=ut+E,ut=Math.max(ut-tt,z.y);0<=at&&(ft=rt[at],ft>ut-tt);)at--,ut=Math.max(ft-ot,z.y);ft=z.x-tt+x,yt=z.x+x,ut+=E,a.curve===th?Ef(y,yt,ut,!1):Ju(y,ft,mt,ft,ut,yt,ut)}}}y.lineTo(z.x+x,z.y+E)}function kx(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,ot=0;ot<tt;ot++){var rt=z[ot];if(rt instanceof Ve){if(rt===a)return 0<E.length&&E.sort(function(ut,ft){return ut-ft}),E.length;if(rt.isVisible()&&Od(rt)){var at=rt.routeBounds;at.w()&&a.routeBounds.Yc(at)&&!a.usesSamePort(rt)&&(at=rt.path,at!==null&&at.Ed()&&Mx(y,x,E,rt))}}}}}return 0<E.length&&E.sort(function(ut,ft){return ut-ft}),E.length}function Mx(a,y,x,E){for(var b=qt.B(a.y,y.y),z=E.pointsCount,tt=E.i(0),ot=Bt.alloc(),rt=1;rt<z;rt++){var at=E.i(rt);if(rt<z-1){var ut=E.i(rt+1);if(tt.y===at.y&&at.y===ut.y){if(at.x>tt.x&&ut.x>=at.x||at.x<tt.x&&ut.x<=at.x)continue}else if(tt.x===at.x&&at.x===ut.x&&(at.y>tt.y&&ut.y>=at.y||at.y<tt.y&&ut.y<=at.y))continue}t:{ut=a.x;var ft=a.y,mt=y.x,yt=y.y,xt=tt.x;tt=tt.y;var Mt=at.x,It=at.y;if(qt.B(ut,mt)){if(!qt.B(ft,yt)&&qt.B(tt,It)&&Math.min(ft,yt)<tt&&Math.max(ft,yt)>tt&&Math.min(xt,Mt)<ut&&Math.max(xt,Mt)>ut&&!qt.B(xt,Mt)){ot.x=ut,ot.y=tt,ut=!0;break t}}else if(qt.B(ft,yt)&&qt.B(xt,Mt)&&Math.min(ut,mt)<xt&&Math.max(ut,mt)>xt&&Math.min(tt,It)<ft&&Math.max(tt,It)>ft&&!qt.B(tt,It)){ot.x=xt,ot.y=ft,ut=!0;break t}ot.x=0,ot.y=0,ut=!1}ut&&(b?x.push(ot.x):x.push(ot.y)),tt=at}Bt.free(ot)}function Od(a){return a=a.curve,a===Nf||a===th}function Zm(a,y){(y||Od(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()))}Ve.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,ot=0;ot<tt;ot++){var rt=b[ot];rt instanceof Ve&&(rt===this?z=!0:z&&t1(this,rt,a))}}else if(E)for(z=b.Pa.s,b=z.length,tt=0;tt<b;tt++)ot=z[tt],ot instanceof Ve&&t1(this,ot,a)}}}}};function t1(a,y,x){if(y!==null&&y.lk&&y.fd&&Od(y)){var E=y.routeBounds;E.w()&&(a.routeBounds.Yc(E)||x.Yc(E))&&(a.usesSamePort(y)||y.qc())}}Ve.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},Ve.prototype.isVisible=function(){if(!On.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},Ve.prototype.Zb=function(a){if(On.prototype.Zb.call(this,a),a&&Zm(this,!1),this.Sf!==null&&this.Sf.Sl(),this.wd!==null)for(var y=this.wd.iterator;y.next();)y.value.Zb(a)},Ve.prototype.computeAdjusting=function(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?Qg:this.qk};function Xg(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,ot=tt.length,rt=0;rt<ot;rt++){var at=tt[rt];(at.ef===y&&at.ff===E&&at.uf===x&&at.vf===b||at.ef===x&&at.ff===b&&at.uf===y&&at.vf===E)&&(z===null?z=at:(a===null&&(a=[],a.push(z)),a.push(at)))}if(a!==null){for(z=HS(y,x,E,b),z===null&&(z=new qm(y,E,x,b),GS(y,z),GS(x,z)),z.links=a,y=0;y<a.length;y++)a[y].Sf=z;z.Sl()}}}}function Jg(a){var y=a.Sf;y!==null&&isNaN(a.curviness)&&(a.Sf=null,a=y.links.indexOf(a),0<=a&&(Hn(y.links,a),y.Sl()))}Ve.prototype.ph=function(){return!0},oe.Object.defineProperties(Ve.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&&Gm(y,this,x),Jg(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&&zm(a,this,b),Xg(this),this.C(1)),this.g("fromNode",y,a),bf(this)}}},fromPortId:{get:function(){return this.ff},set:function(a){var y=this.ff;if(y!==a){var x=this.fromPort;x!==null&&sa(x),Jg(this),this.ff=a;var E=this.fromPort;E!==null&&sa(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))),Xg(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&&Gm(y,this,x),Jg(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&&zm(a,this,b),Xg(this),this.C(1)),this.g("toNode",y,a),bf(this)}}},toPortId:{get:function(){return this.vf},set:function(a){var y=this.vf;if(y!==a){var x=this.toPort;x!==null&&sa(x),Jg(this),this.vf=a;var E=this.toPort;E!==null&&sa(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))),Xg(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:Fr},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&&sa(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&&an(a,">= 0",Ve,"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:Fr},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&&sa(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&&an(a,">= 0",Ve,"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?mi: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&&Kg(this.fromNode),this.toNode!==null&&Kg(this.toNode))}},path:{get:function(){var a=this.Pb();return a instanceof gi?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()===wa&&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),qt.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 ot=this.i(z-1),rt=this.i(z);qt.Dl(b.x,b.y,tt.x,tt.y,ot.x,ot.y,rt.x,rt.y,.5,a),y=Math.min(rt.x,y),x=Math.min(rt.y,x),b=rt}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 Bt)}},midAngle:{get:function(){return this.vg(),this.computeMidAngle()}},flattenedLengths:{get:function(){if(this.cq===null){this.fd||Wm(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);qt.$(E.x,b.x)?(E=b.y-E.y,0>E&&(E=-E)):qt.$(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 ke,E=0;E<a.length/2;E++)b=new Bt(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(!Qt(z)||typeof z.x!="number"||isNaN(z.x)||typeof z.y!="number"||isNaN(z.y)){E=!1;break}}if(E)for(x=new ke,E=0;E<a.length;E++)b=a[E],x.add(new Bt(b.x,b.y).freeze())}}else if(a instanceof ke)for(x=a.copy(),a=x.iterator;a.next();)a.value.freeze();else Wt("Link.points value is not an instance of List or Array: "+a);x.freeze(),this.Nb=x,this.qc(),Wm(this),a=this.diagram,a!==null&&(a.pi||a.undoManager.isUndoingRedoing||a.As.add(this),a.animationManager.zb&&$c(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||!Ff(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return a===0?0:2>=a?a-1:this.isOrthogonal||!Ff(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(),Zm(this,y===th||y===Nf||a===th||a===Nf),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(),Zm(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)}}}),Ve.prototype.invalidateOtherJumpOvers=Ve.prototype.Xo,Ve.prototype.findClosestSegment=Ve.prototype.ez,Ve.prototype.updateRoute=Ve.prototype.vg,Ve.prototype.invalidateRoute=Ve.prototype.bb,Ve.prototype.rollbackRoute=Ve.prototype.rv,Ve.prototype.commitRoute=Ve.prototype.zf,Ve.prototype.startRoute=Ve.prototype.uh,Ve.prototype.clearPoints=Ve.prototype.Fj,Ve.prototype.removePoint=Ve.prototype.pv,Ve.prototype.addPointAt=Ve.prototype.yf,Ve.prototype.addPoint=Ve.prototype.ne,Ve.prototype.insertPointAt=Ve.prototype.m,Ve.prototype.insertPoint=Ve.prototype.Kz,Ve.prototype.setPointAt=Ve.prototype.L,Ve.prototype.setPoint=Ve.prototype.dd,Ve.prototype.getPoint=Ve.prototype.i,Ve.prototype.getOtherPort=Ve.prototype.Cz,Ve.prototype.getOtherNode=Ve.prototype.To;var Cc=null,Lc=null,Jv=new Se(Ve,"Normal",1),Ex=new Se(Ve,"Orthogonal",2),bx=new Se(Ve,"AvoidsNodes",6),e1=new Se(Ve,"AvoidsNodesStraight",7),Es=new Se(Ve,"None",0),wa=new Se(Ve,"Bezier",9),th=new Se(Ve,"JumpGap",10),Nf=new Se(Ve,"JumpOver",11),Qg=new Se(Ve,"End",17),Km=new Se(Ve,"Scale",18),Xm=new Se(Ve,"Stretch",19),qg=new Se(Ve,"OrientAlong",21),$g=new Se(Ve,"OrientPlus90",22),tp=new Se(Ve,"OrientMinus90",23),Qv=new Se(Ve,"OrientOpposite",24),Jm=new Se(Ve,"OrientUpright",25),ep=new Se(Ve,"OrientPlus90Upright",26),np=new Se(Ve,"OrientMinus90Upright",27),Qm=new Se(Ve,"OrientUpright45",28),n1=16,i1=14,ip=8;Ve.className="Link",Ve.Normal=Jv,Ve.Orthogonal=Ex,Ve.AvoidsNodes=bx,Ve.AvoidsNodesStraight=e1,Ve.None=Es,Ve.Bezier=wa,Ve.JumpGap=th,Ve.JumpOver=Nf,Ve.End=Qg,Ve.Scale=Km,Ve.Stretch=Xm,Ve.OrientAlong=qg,Ve.OrientPlus90=$g,Ve.OrientMinus90=tp,Ve.OrientOpposite=Qv,Ve.OrientUpright=Jm,Ve.OrientPlus90Upright=ep,Ve.OrientMinus90Upright=np,Ve.OrientUpright45=Qm,Ve.EndSegmentStep=8,Ve.CurvinessStart=n1,Ve.SpacingMin=i1,Ve.OrthoShortCut=ip;function qm(a,y,x,E){En(this),this.Fe=this.qq=!1,this.Ds=a,this.Ox=y,this.cv=x,this.Px=E,this.links=[]}qm.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},qm.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))}},qm.className="LinkBundle";function op(a){En(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}op.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=qv,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 Tf(a,y,x){return a.Nd<=y&&y<=a.En&&a.Od<=x&&x<=a.Fn}function $l(a,y,x){return Tf(a,y,x)?(y-=a.Nd,y/=a.rc,x-=a.Od,x/=a.sc,a.ac[y|0][x|0]):qv}function o1(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]>=Id&&(x[E]=qv)}op.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]===eh)return!1}return!0};function tu(a,y,x,E,b,z,tt,ot,rt){if(!(y<z||y>tt||x<ot||x>rt)){var at=y|0,ut=x|0,ft=a.ac[at][ut];if(ft>=Id&&ft<Af)for(b?ut+=E:at+=E,ft+=1;z<=at&&at<=tt&&ot<=ut&&ut<=rt&&!(ft>=a.ac[at][ut]);)a.ac[at][ut]=ft,ft+=1,b?ut+=E:at+=E;if(at=b?ut:at,b)if(0<E)for(x+=E;x<at;x+=E)tu(a,y,x,1,!b,z,tt,ot,rt),tu(a,y,x,-1,!b,z,tt,ot,rt);else for(x+=E;x>at;x+=E)tu(a,y,x,1,!b,z,tt,ot,rt),tu(a,y,x,-1,!b,z,tt,ot,rt);else if(0<E)for(y+=E;y<at;y+=E)tu(a,y,x,1,!b,z,tt,ot,rt),tu(a,y,x,-1,!b,z,tt,ot,rt);else for(y+=E;y>at;y+=E)tu(a,y,x,1,!b,z,tt,ot,rt),tu(a,y,x,-1,!b,z,tt,ot,rt)}}function $m(a,y,x,E,b,z,tt,ot,rt){y|=0,x|=0;var at=eh,ut=Id;for(a.ac[y][x]=ut;at===eh&&y>z&&y<tt&&x>ot&&x<rt;)ut+=1,a.ac[y][x]=ut,b?x+=E:y+=E,at=a.ac[y][x]}function t0(a,y,x,E,b,z,tt,ot,rt){y|=0,x|=0;var at=eh,ut=Af;for(a.ac[y][x]=ut;at===eh&&y>z&&y<tt&&x>ot&&x<rt;)a.ac[y][x]=ut,b?x+=E:y+=E,at=a.ac[y][x]}function r1(a,y,x,E,b,z,tt){if(a.ac!==null){a.abort=!1;var ot=y.x,rt=y.y;if(Tf(a,ot,rt)){ot-=a.Nd,ot/=a.rc,rt-=a.Od,rt/=a.sc;var at=E.x,ut=E.y;if(Tf(a,at,ut))if(at-=a.Nd,at/=a.rc,ut-=a.Od,ut/=a.sc,1>=Math.abs(ot-at)&&1>=Math.abs(rt-ut))a.abort=!0;else{var ft=z.x;E=z.y,y=z.x+z.width;var mt=z.y+z.height;ft-=a.Nd,ft/=a.rc,E-=a.Od,E/=a.sc,y-=a.Nd,y/=a.rc,mt-=a.Od,mt/=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)),mt=Math.min(a.ei,Math.max(0,mt|0)),E=a.ac,ot|=0,rt|=0,at|=0,ut|=0;var yt=x===0||x===90?1:-1;if(x=x===90||x===270,E[ot][rt]===eh?($m(a,ot,rt,yt,x,z,y,ft,mt),$m(a,ot,rt,1,!x,z,y,ft,mt),$m(a,ot,rt,-1,!x,z,y,ft,mt)):$m(a,ot,rt,yt,x,ot,rt,ot,rt),E[at][ut]===eh?(t0(a,at,ut,b===0||b===90?1:-1,b===90||b===270,z,y,ft,mt),t0(a,at,ut,1,!(b===90||b===270),z,y,ft,mt),t0(a,at,ut,-1,!(b===90||b===270),z,y,ft,mt)):t0(a,at,ut,yt,x,at,ut,at,ut),x=ln(),tt&&s1(a,at,ut,b,ot,rt,x))for((x[0]!==at||x[1]!==ut)&&(x.unshift(ut),x.unshift(at)),(x[x.length-2]!==ot||x[x.length-1]!==rt)&&(x.push(ot),x.push(rt)),a=Id,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],at=x[z+1];y>b?b++:y<b?b--:at>tt?tt++:at<tt&&tt--,E[b][tt]=a++,b!==y||tt!==at;);else tu(a,ot,rt,1,!1,z,y,ft,mt),tu(a,ot,rt,-1,!1,z,y,ft,mt),tu(a,ot,rt,1,!0,z,y,ft,mt),tu(a,ot,rt,-1,!0,z,y,ft,mt);Be(x)}}}}function s1(a,y,x,E,b,z,tt){for(var ot=a.ac,rt=y,at=x;;){if(rt===b&&at===z)return!0;var ut=rt,ft=at;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 mt=ot[ut][ft];if(mt===0||mt===$v)break;rt=ut,at=ft}for(;;){if(ut=E,ft=rt,mt=at,E===0?mt<z?(ut=90,mt++):mt>z&&(ut=270,mt--):E===90?ft<b?(ut=0,ft++):ft>b&&(ut=180,ft--):E===180?mt<z?(ut=90,mt++):mt>z&&(ut=270,mt--):ft<b?(ut=0,ft++):ft>b&&(ut=180,ft--),ft=ot[ft][mt],ut!==E&&ft!==0&&ft!==$v){if(tt.push(rt),tt.push(at),s1(a,rt,at,ut,b,z,tt))return!0;tt.pop(),tt.pop()}if(ot[rt][at]=$v,E===0){if(rt===y)return!1;rt--}else if(E===90){if(at===x)return!1;at--}else if(E===180){if(rt===y)return!1;rt++}else{if(at===x)return!1;at++}}}oe.Object.defineProperties(op.prototype,{bounds:{get:function(){return new Ce(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 eh=0,Id=1,Af=999999,qv=Af+1,$v=Af+2;op.className="PositionArray";function kc(){En(this),this.port=this.node=null,this.pe=[],this.ap=!1}kc.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 Fx(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}kc.prototype.Sl=function(){this.pe.length=0};function a1(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 ri?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 ot=a.port.ga(io,Bt.alloc()),rt=a.port.ga(Os,Bt.alloc());for(b=Ce.allocAt(ot.x,ot.y,0,0),b.Ye(rt),Bt.free(ot),Bt.free(rt),ot=Bt.allocAt(b.x+b.width/2,b.y+b.height/2),rt=a.port.li(),tt=tt.iterator;tt.next();){var at=tt.value;if(at.isVisible()&&at.fromPort!==at.toPort){var ut=at.fromPort===a.port||at.fromNode!==null&&at.fromNode.Td(E),ft=at.computeSpot(ut,a.port);if(ft.$c()&&(ut=ut?at.toPort:at.fromPort,ut!==null)){var mt=ut.part;if(mt!==null){var yt=mt.findVisibleNode();yt!==null&&yt!==mt&&(mt=yt,ut=mt.port),ut=at.computeOtherPoint(mt,ut),mt=ot.ab(ut),mt-=rt,0>mt?mt+=360:360<=mt&&(mt-=360),ft=Fx(b,ft,mt,at.isOrthogonal),ft===0?(ft=4,180<mt&&(mt-=360)):ft===90?(ft=8,270<mt&&(mt-=360)):ft===180?ft=2:(ft=1,90>mt&&(mt+=360)),yt=a.pe[z],yt===void 0?(yt=new ty(at,mt,ft),a.pe[z]=yt):(yt.link=at,yt.angle=mt,yt.Nc=ft),yt.hv.set(ut),z++}}}}for(Bt.free(ot),a.pe.sort(kc.prototype.j),rt=a.pe.length,E=-1,z=ot=0;z<rt;z++)tt=a.pe[z],tt!==void 0&&(tt.Nc!==E&&(E=tt.Nc,ot=0),tt.Uo=ot,ot++);for(E=-1,ot=0,z=rt-1;0<=z;z--)rt=a.pe[z],rt!==void 0&&(rt.Nc!==E&&(E=rt.Nc,ot=rt.Uo+1),rt.Gl=ot);if(z=a.pe,ft=a.port,E=a.node.portSpreading,ot=Bt.alloc(),rt=Bt.alloc(),tt=Bt.alloc(),at=Bt.alloc(),ft.ga(io,ot),ft.ga(fa,rt),ft.ga(Os,tt),ft.ga(Ds,at),yt=mt=ut=ft=0,E===Wv)for(var xt=0;xt<z.length;xt++){var Mt=z[xt];if(Mt!==null){var It=Mt.link.computeThickness();switch(Mt.Nc){case 8:mt+=It;break;case 2:yt+=It;break;case 1:ft+=It;break;default:case 4:ut+=It}}}var Tt=xt=0,zt=1,Ht=Mt=0;for(It=0;It<z.length;It++){var Vt=z[It];if(Vt!==null){if(xt!==Vt.Nc){switch(xt=Vt.Nc,xt){case 8:var Xt=tt;Tt=at;break;case 2:Xt=at,Tt=ot;break;case 1:Xt=ot,Tt=rt;break;default:case 4:Xt=rt,Tt=tt}switch(Mt=Tt.x-Xt.x,Ht=Tt.y-Xt.y,xt){case 8:mt>Math.abs(Mt)?(zt=Math.abs(Mt)/mt,mt=Math.abs(Mt)):zt=1;break;case 2:yt>Math.abs(Ht)?(zt=Math.abs(Ht)/yt,yt=Math.abs(Ht)):zt=1;break;case 1:ft>Math.abs(Mt)?(zt=Math.abs(Mt)/ft,ft=Math.abs(Mt)):zt=1;break;default:case 4:ut>Math.abs(Ht)?(zt=Math.abs(Ht)/ut,ut=Math.abs(Ht)):zt=1}Tt=0}var le=Vt.Zo;if(E===Wv){switch(Vt=Vt.link.computeThickness(),Vt*=zt,le.set(Xt),xt){case 8:le.x=Xt.x+Mt/2+mt/2-Tt-Vt/2;break;case 2:le.y=Xt.y+Ht/2+yt/2-Tt-Vt/2;break;case 1:le.x=Xt.x+Mt/2-ft/2+Tt+Vt/2;break;default:case 4:le.y=Xt.y+Ht/2-ut/2+Tt+Vt/2}Tt+=Vt}else{var $e=.5;E===Hm&&($e=(Vt.Uo+1)/(Vt.Gl+1)),le.x=Xt.x+Mt*$e,le.y=Xt.y+Ht*$e}}}for(Bt.free(ot),Bt.free(rt),Bt.free(tt),Bt.free(at),Xt=a.pe,z=0;z<Xt.length;z++)E=Xt[z],E!==null&&(E.Ju=a.computeEndSegmentLength(E));a.ap=x,Ce.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}kc.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},kc.prototype.computeEndSegmentLength=function(a){var y=a.link,x=y.computeEndSegmentLength(this.node,this.port,Ni,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)},kc.className="Knot";function ty(a,y,x){this.link=a,this.angle=y,this.Nc=x,this.hv=new Bt,this.Gl=this.Uo=0,this.Zo=new Bt,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 Mo(a){En(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new Bt(0,0).freeze(),this.vn=!0,this.Em=this.un=null,this.xn=!1,this.j=null,a&&Object.assign(this,a)}Mo.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},Mo.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},Mo.prototype.qb=function(){},Mo.prototype.toString=function(){var a=we(this.constructor);return a+="(",this.group!==null&&(a+=" in "+this.group),this.diagram!==null&&(a+=" for "+this.diagram),a+")"},Mo.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())}}},Mo.prototype.createNetwork=function(){return new ho(this)},Mo.prototype.makeNetwork=function(a){var y=this.createNetwork();return a instanceof ue?(y.lg(a.nodes,!0),y.lg(a.links,!0)):a instanceof ri?y.lg(a.memberParts):y.lg(a.iterator),y},Mo.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")}},Mo.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()}},Mo.prototype.doLayout=function(a){var y=new Me;a instanceof ue?(Hh(this,y,a.nodes,!0,this.rh,!0,!1,!0),Hh(this,y,a.parts,!0,this.rh,!0,!1,!0)):a instanceof ri?Hh(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},Mo.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 ot=a.value;rp(ot);var rt=ot.measuredBounds,at=rt.width;rt=rt.height,ot.moveTo(E,b),ot instanceof ri&&(ot.rh=!1),E+=Math.max(at,50)+20,tt=Math.max(tt,Math.max(rt,50)),z>=y-1?(z=0,E=x,b+=tt+20,tt=0):z++}},Mo.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 ot=tt.value.node;if(!(ot===null||ot instanceof Ve)&&(rp(ot),this.rh(ot))){var rt=ot.measuredBounds,at=rt.width;rt=rt.height,ot.moveTo(x,E),ot instanceof ri&&(ot.rh=!1),x+=Math.max(at,50)+20,z=Math.max(z,Math.max(rt,50)),b>=a-1?(b=0,x=y,E+=z+20,z=0):b++}}},Mo.prototype.rh=function(a){return!!(!a.location.w()||a instanceof ri&&a.rh)};function Hh(a,y,x,E,b,z,tt,ot){for(x=x.iterator;x.next();){var rt=x.value;E&&!rt.isTopLevel||b!==null&&!b(rt)||!rt.canLayout()||(z&&rt instanceof nn?rt.isLinkLabel||(rt instanceof ri&&rt.layout===null?Hh(a,y,rt.memberParts,!1,b,z,tt,ot):(rp(rt),y.add(rt))):tt&&rt instanceof Ve?y.add(rt):!ot||!rt.Zc()||rt instanceof nn||(rp(rt),y.add(rt)))}}function rp(a){var y=a.actualBounds;(y.width===0||y.height===0||isNaN(y.width)||isNaN(y.height))&&a.Va()}Mo.prototype.ni=function(a,y){var x=this.boundsComputation;return x!==null?(y||(y=new Ce),x(a,this,y)):y?(y.set(a.actualBounds),y):a.actualBounds},Mo.prototype.ex=function(a){var y=new Me;return a instanceof ue?(Hh(this,y,a.nodes,!0,null,!0,!0,!0),Hh(this,y,a.links,!0,null,!0,!0,!0),Hh(this,y,a.parts,!0,null,!0,!0,!0)):a instanceof ri?Hh(this,y,a.memberParts,!1,null,!0,!0,!0):Hh(this,y,a.iterator,!1,null,!0,!0,!0),y},Mo.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(io),(isNaN(x.x)||isNaN(x.y))&&x.set(a),a=y.padding,x.x+=a.left,x.y+=a.top),x}return a},oe.Object.defineProperties(Mo.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())}}}),Mo.prototype.collectParts=Mo.prototype.ex,Mo.prototype.getLayoutBounds=Mo.prototype.ni,Mo.prototype.invalidateLayout=Mo.prototype.C,Mo.className="Layout";function ho(a){En(this),this.Sc=a,this.wf=new Me,this.ye=new Me,this.Es=new kn,this.zs=new kn}ho.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 Me,this.ye=new Me,this.Es=new kn,this.zs=new kn},ho.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},ho.prototype.createVertex=function(){return new yr(this)},ho.prototype.createEdge=function(){return new aa(this)},ho.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 nn)return!tt.isLinkLabel;if(tt instanceof Ve){var ot=tt.fromNode;return ot===null||ot.isLinkLabel?!1:(tt=tt.toNode,!(tt===null||tt.isLinkLabel))}return!1}),a=a.iterator;a.next();){var E=a.value;if(E instanceof nn&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)){if(E instanceof ri&&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 Ve&&(!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))}}},ho.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},Ct=ho.prototype,Ct.dh=function(a){if(a!==null){this.wf.add(a);var y=a.node;y!==null&&this.Es.add(y,a),a.network=this}},Ct.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},Ct.Iu=function(a){if(a!==null&&l1(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 l1(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}Ct.Zy=function(a){a!==null&&(a=this.ki(a),a!==null&&this.Iu(a))},Ct.ki=function(a){return a===null?null:this.Es.I(a)},Ct.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}}Ct.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},Ct.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))}Ct.Yy=function(a){a!==null&&(a=this.Lo(a),a!==null&&this.Mj(a))},Ct.Lo=function(a){return a===null?null:this.zs.I(a)},Ct.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},Ct.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))}},Ct.Ko=function(){for(var a=ln(),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]);Be(a)},ho.prototype.deleteArtificialVertexes=function(){for(var a=ln(),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=ln(),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]);Be(a),Be(y)};function Nx(a){for(var y=ln(),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]);Be(y)}ho.prototype.Zx=function(a){a===void 0&&(a=!0),a&&(this.deleteArtificialVertexes(),Nx(this),this.Ko()),a=new ke;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){l1(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))}}ho.prototype.dz=function(){for(var a=new Me,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},oe.Object.defineProperties(ho.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}}}),ho.prototype.findAllParts=ho.prototype.dz,ho.prototype.splitIntoSubNetworks=ho.prototype.Zx,ho.prototype.deleteSelfEdges=ho.prototype.Ko,ho.prototype.reverseEdge=ho.prototype.gm,ho.prototype.linkVertexes=ho.prototype.Zj,ho.prototype.findEdge=ho.prototype.Lo,ho.prototype.deleteLink=ho.prototype.Yy,ho.prototype.deleteEdge=ho.prototype.Mj,ho.prototype.addLink=ho.prototype.Dy,ho.prototype.addEdge=ho.prototype.Bo,ho.prototype.findVertex=ho.prototype.ki,ho.prototype.deleteNode=ho.prototype.Zy,ho.prototype.deleteVertex=ho.prototype.Iu,ho.prototype.addNode=ho.prototype.Bl,ho.prototype.addVertex=ho.prototype.dh,ho.prototype.addParts=ho.prototype.lg,ho.className="LayoutNetwork";function yr(a){En(this),this.ob=a,this.j=new Ce(0,0,10,10).freeze(),this.o=new Bt(5,5).freeze(),this.Sh=this.ub=null,this.tg=new ke,this.mg=new ke}yr.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new ke,this.mg=new ke},yr.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutVertex#"+ti(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},yr.prototype.commit=function(){var a=this.ub;if(a!==null){var y=this.bounds,x=a.bounds;Qt(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 ri)){x=Ce.alloc(),a.Va();var E=this.network.layout.ni(a,x),b=a.locationObject.ga(ji);if(E.w()&&b.w()){a.moveTo(y.x+this.focusX-(b.x-E.x),y.y+this.focusY-(b.y-E.y)),Ce.free(x);return}Ce.free(x)}a.moveTo(y.x,y.y)}},yr.prototype.Cl=function(a){a!==null&&(this.tg.contains(a)||this.tg.add(a))},yr.prototype.Kl=function(a){a!==null&&this.tg.remove(a)},yr.prototype.zl=function(a){a!==null&&(this.mg.contains(a)||this.mg.add(a))},yr.prototype.Jl=function(a){a!==null&&this.mg.remove(a)};function oy(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}oe.Object.defineProperties(yr.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=Ce.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),Ce.free(x),!(a instanceof ri)&&(a=a.locationObject.ga(ji),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 Me,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new Me,y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new Me,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 ke,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}}}),yr.prototype.deleteDestinationEdge=yr.prototype.Jl,yr.prototype.addDestinationEdge=yr.prototype.zl,yr.prototype.deleteSourceEdge=yr.prototype.Kl,yr.prototype.addSourceEdge=yr.prototype.Cl,yr.className="LayoutVertex",yr.standardComparer=oy,yr.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 aa(a){En(this),this.nb=a,this.qd=this.kd=this.$k=this.ub=null}aa.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},aa.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutEdge#"+ti(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},aa.prototype.gm=function(){var a=this.kd;this.kd=this.qd,this.qd=a},aa.prototype.commit=function(){},aa.prototype.Ax=function(a){return this.qd===a?this.kd:this.kd===a?this.qd:null},oe.Object.defineProperties(aa.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)}}}),aa.prototype.getOtherVertex=aa.prototype.Ax,aa.className="LayoutEdge";function jr(a){Mo.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new Qe(NaN,NaN).freeze(),this.tf=new Qe(10,10).freeze(),this.Jb=sp,this.Rb=n0,this.nd=ap,this.hd=u1,a&&Object.assign(this,a)}he(jr,Mo),jr.prototype.cloneProtected=function(a){Mo.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},jr.prototype.qb=function(a){a.classType===jr?a===ap||a===o0||a===ry||a===i0?this.sorting=a:a===n0||a===ml?this.arrangement=a:a===sp||a===e0?this.alignment=a:Wt("Unknown enum value: "+a):Mo.prototype.qb.call(this,a)},jr.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 ri)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 i0:b.reverse();break;case ap:b.sort(this.comparer);break;case o0: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 e0:var ot=y,rt=x,at=Ce.alloc(),ut=Math.max(this.cellSize.width,1);if(!isFinite(ut))for(var ft=ut=0;ft<b.length;ft++){var mt=this.ni(b[ft],at);ut=Math.max(ut,mt.width)}if(ut=Math.max(ut+ot,1),ft=Math.max(this.cellSize.height,1),!isFinite(ft))for(mt=ft=0;mt<b.length;mt++){var yt=this.ni(b[mt],at);ft=Math.max(ft,yt.height)}ft=Math.max(ft+rt,1),mt=this.arrangement;for(var xt=yt=this.arrangementOrigin.x,Mt=this.arrangementOrigin.y,It=0,Tt=0,zt=0;zt<b.length;zt++){var Ht=b[zt],Vt=this.ni(Ht,at),Xt=Math.ceil((Vt.width+ot)/ut)*ut,le=Math.ceil((Vt.height+rt)/ft)*ft;switch(mt){case ml:var $e=Math.abs(xt-Vt.width);break;default:$e=xt+Vt.width}switch((0<z&&It>z-1||0<tt&&0<It&&$e-yt>tt)&&(E.push(new Ce(0,Mt,tt+ot,Tt)),It=0,xt=yt,Mt+=Tt,Tt=0),Tt=Math.max(Tt,le),mt){case ml:Vt=-Vt.width;break;default:Vt=0}switch(Ht.moveTo(xt+Vt,Mt),mt){case ml:xt-=Xt;break;default:xt+=Xt}It++}E.push(new Ce(0,Mt,tt+ot,Tt)),Ce.free(at);break;case sp:for(rt=tt,ut=z,ft=y,mt=x,tt=Ce.alloc(),yt=Math.max(this.cellSize.width,1),z=Mt=at=0,ot=Bt.alloc(),xt=0;xt<b.length;xt++)Tt=b[xt],It=this.ni(Tt,tt),Tt=Qu(Tt,Tt.locationObject,Tt.locationSpot,ot),at=Math.max(at,Tt.x),Mt=Math.max(Mt,It.width-Tt.x),z=Math.max(z,Tt.y);switch(xt=this.arrangement,xt){case ml:at+=ft;break;default:Mt+=ft}yt=isFinite(yt)?Math.max(yt+ft,1):Math.max(at+Mt,1);var mn=Tt=this.arrangementOrigin.x;for(zt=this.arrangementOrigin.y,Mt=0,rt>=at&&(rt-=at),at=Ht=0,Xt=Math.max(this.cellSize.height,1),Vt=z=0,le=!0,It=Bt.alloc(),$e=0;$e<b.length;$e++){var cn=b[$e],We=this.ni(cn,tt),Te=Qu(cn,cn.locationObject,cn.locationSpot,ot);if(0<Mt)switch(xt){case ml:mn=(mn-Tt-(We.width-Te.x))/yt,mn=qt.$(Math.round(mn),mn)?Math.round(mn):Math.floor(mn),mn=mn*yt+Tt;break;default:mn=(mn-Tt+Te.x)/yt,mn=qt.$(Math.round(mn),mn)?Math.round(mn):Math.ceil(mn),mn=mn*yt+Tt}else switch(xt){case ml:Ht=mn+Te.x+We.width;break;default:Ht=mn-Te.x}switch(xt){case ml:var oi=-(mn+Te.x)+Ht;break;default:oi=mn+We.width-Te.x-Ht}if(0<ut&&Mt>ut-1||0<rt&&0<Mt&&oi>rt){for(E.push(new Ce(0,le?zt-z:zt,rt+ft,Vt+z+mt)),mn=0;mn<Mt&&$e!==Mt;mn++){oi=b[$e-Mt+mn];var Xn=Qu(oi,oi.locationObject,oi.locationSpot,It);oi.moveTo(oi.position.x,oi.position.y+z-Xn.y)}Vt+=mt,zt=le?zt+Vt:zt+(Vt+z),Mt=Vt=z=0,mn=Tt,le=!1}switch(mn===Tt&&(at=xt===ml?Math.max(at,We.width-Te.x):Math.min(at,-Te.x)),z=Math.max(z,Te.y),Vt=Math.max(Vt,We.height-Te.y),isFinite(Xt)&&(Vt=Math.max(Vt,Math.max(We.height,Xt)-Te.y)),le?cn.moveTo(mn-Te.x,zt-Te.y):cn.moveTo(mn-Te.x,zt),xt){case ml:mn-=Te.x+ft;break;default:mn+=We.width-Te.x+ft}Mt++}if(E.push(new Ce(0,zt,rt+ft,(le?Vt:Vt+z)+mt)),b.length!==Mt)for(rt=0;rt<Mt;rt++)ut=b[b.length-Mt+rt],ft=Qu(ut,ut.locationObject,ut.locationSpot,ot),ut.moveTo(ut.position.x,ut.position.y+z-ft.y);if(Bt.free(ot),Bt.free(It),xt===ml)for(b=0;b<E.length;b++)z=E[b],z.width+=at,z.x-=at;else for(b=0;b<E.length;b++)z=E[b],z.x>at&&(z.width+=z.x-at,z.x=at);Ce.free(tt)}for(ot=z=tt=b=0;ot<E.length;ot++)rt=E[ot],b=Math.min(b,rt.x),tt=Math.min(tt,rt.y),z=Math.max(z,rt.x+rt.width);this.arrangement===ml?this.commitLayers(E,new Bt(b+y/2-(z+b),tt-x/2)):this.commitLayers(E,new Bt(b-y/2,tt-x/2)),a!==null&&a.eb("Layout"),this.isValidLayout=!0}},jr.prototype.commitLayers=function(){};function u1(a,y){return a=a.text,y=y.text,a<y?-1:a>y?1:0}oe.Object.defineProperties(jr.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!==sp&&a!==e0||(this.Jb=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==n0&&a!==ml||(this.Rb=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==ry&&a!==i0&&a!==ap&&a!==o0||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}}});var e0=new Se(jr,"Position",0),sp=new Se(jr,"Location",1),n0=new Se(jr,"LeftToRight",2),ml=new Se(jr,"RightToLeft",3),ry=new Se(jr,"Forward",4),i0=new Se(jr,"Reverse",5),ap=new Se(jr,"Ascending",6),o0=new Se(jr,"Descending",7);jr.className="GridLayout",jr.standardComparer=u1,jr.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},jr.Position=e0,jr.Location=sp,jr.LeftToRight=n0,jr.RightToLeft=ml,jr.Forward=ry,jr.Reverse=i0,jr.Ascending=ap,jr.Descending=o0;function qi(){this.On=new Me,this.Dn=new Me,this.Pa=new Me,this.cf=new kn,this.bf=new kn,this.aj=new kn,this.H=null,this.tp=!1}Ct=qi.prototype,Ct.clear=function(){this.On.clear(),this.Dn.clear(),this.Pa.clear(),this.cf.clear(),this.bf.clear(),this.aj.clear()},Ct.Xe=function(a){this.H=a},Ct.oi=function(a){if(a instanceof nn){if(this.On.add(a),a instanceof ri){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 Ve?this.Dn.add(a):a instanceof Ii||this.Pa.add(a);y=a.data,y===null||a instanceof Ii||(a instanceof Ve?this.bf.add(y,a):this.cf.add(y,a))},Ct.pc=function(a){if(a.Ej(),a instanceof nn){if(this.On.remove(a),a instanceof ri){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 Ve?this.Dn.remove(a):a instanceof Ii||this.Pa.remove(a);y=a.data,y===null||a instanceof Ii||(a instanceof Ve?this.bf.remove(y):this.cf.remove(y))},Ct.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 ri)&&Wt('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 ri||Wt('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 Ve||Wt('Invalid link template in Diagram.linkTemplateMap: template for "'+E+'" must be a Link, not a normal Node or simple Part: '+x);for(y=ln(),x=a.selection.iterator;x.next();)(E=x.value.data)&&y.push(E);for(x=ln(),a=a.highlighteds.iterator;a.next();)(E=a.value.data)&&x.push(E);for(a=ln(),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]);Be(y),Be(x),Be(a)}},qi.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},qi.prototype.addModeledParts=function(a,y){var x=this,E=this.diagram.model;a.forEach(function(b){E.lb(b)&&h1(x,b,!1)}),a.forEach(function(b){E.lb(b)&&x.resolveReferencesForData(b)}),y!==!1&&af(this.diagram,!1)};function h1(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=d1(a,y,E);if(b!==null&&(Za(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)}}qi.prototype.insertLink=function(){return null},qi.prototype.resolveReferencesForData=function(){},qi.prototype.Ro=function(a){return this.H.model.Ro(a)};function d1(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&&(g1||(g1=!0,ye('No Group template found for category "'+x+'"'),ye(" Using default group template")),y=a.ly))):(y=a.nodeTemplateMap.I(x),y===null&&(y=a.nodeTemplateMap.I(""),y===null&&(f1||(f1=!0,ye('No Node template found for category "'+x+'"'),ye(" Using default node template")),y=a.ny))),y}qi.prototype.getLinkCategoryForData=function(){return""},qi.prototype.setLinkCategoryForData=function(){},qi.prototype.setFromNodeForLink=function(){},qi.prototype.setToNodeForLink=function(){},qi.prototype.findLinkTemplateForCategory=function(a){var y=this.H,x=y.linkTemplateMap.I(a);return x===null&&(x=y.linkTemplateMap.I(""),x===null&&(p1||(p1=!0,ye('No Link template found for category "'+a+'"'),ye(" Using default link template")),x=y.my)),x},qi.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},qi.prototype.Gs=function(a){var y=this;a.forEach(function(x){y.ip(x)})},qi.prototype.ip=function(a){a=this.Lc(a),a!==null&&(wg(this.diagram,a,!1),this.unresolveReferencesForPart(a))},qi.prototype.unresolveReferencesForPart=function(){},qi.prototype.removeDataForLink=function(){},qi.prototype.findPartForKey=function(a){return a==null?null:(a=this.H.model.hc(a),a!==null?this.cf.I(a):null)},qi.prototype.Vb=function(a){return a==null||(a=this.H.model.hc(a),a===null)?null:(a=this.cf.I(a),a instanceof nn?a:null)},qi.prototype.findLinkForKey=function(){return null},Ct=qi.prototype,Ct.Lc=function(a){if(a===null)return null;var y=this.cf.I(a);return y!==null?y:y=this.bf.I(a)},Ct.ii=function(a){return a===null?null:(a=this.cf.I(a),a instanceof nn?a:null)},Ct.Kc=function(a){return a===null?null:this.bf.I(a)},Ct.ms=function(a){for(var y=0;y<arguments.length;++y);y=new Me;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(Qt(tt)&&sy(this,b,tt)){y.add(E);break}}}return y.iterator},Ct.ls=function(a){for(var y=0;y<arguments.length;++y);y=new Me;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(Qt(tt)&&sy(this,b,tt)){y.add(E);break}}}return y.iterator};function sy(a,y,x){for(var E in x){var b=y[E],z=x[E];if(Zt(z)){if(!Zt(b)||b.length<z.length)return!1;for(var tt=0;tt<b.length;tt++){var ot=z[tt];if(ot!==void 0&&!c1(a,b[tt],ot))return!1}}else if(!c1(a,b,z))return!1}return!0}function c1(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(Qt(y)&&Qt(x)){if(!sy(a,y,x))return!1}else if(y!==x)return!1;return!0}qi.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===No){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===ir){var tt=a.newValue;E==="nodeDataArray"&&Qt(tt)&&h1(this,tt),y.isModified=!0}else if(x===mr){var ot=a.oldValue;E==="nodeDataArray"&&Qt(ot)&&this.ip(ot),y.isModified=!0}else x===ia&&(E==="SourceChanged"?a.object!==null?this.updateDataBindings(a.object,a.propertyName):(this.rp(),this.updateAllTargetBindings()):E==="ModelDisplaced"&&this.Wd());else if(x===No){var rt=a.propertyName,at=a.object;at===y.model?(rt==="nodeKeyProperty"||rt==="nodeCategoryProperty")&&(y.undoManager.isUndoingRedoing||this.Wd()):this.updateDataBindings(at,rt),y.isModified=!0}else if(x===ir||x===mr){var ut=a.change===ir,ft=ut?a.newParam:a.oldParam,mt=ut?a.newValue:a.oldValue,yt=this.aj.I(a.object);if(Array.isArray(yt))for(a=0;a<yt.length;a++){var xt=yt[a];if(ut)Cm(xt,mt,ft,!0);else if(!(0>ft)){var Mt=ft+Hg(xt);xt.pc(Mt,!0),xv(xt,Mt,ft)}}y.isModified=!0}}finally{y.aa=!0}}}}},qi.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)},qi.prototype.rp=function(){for(var a=this.H.model,y=new Me,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){L1(a,tt,!1)}),E=0;E<x.length;E++){var z=x[E];this.Lc(z)===null&&C1(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()},qi.prototype.refreshDataBoundLinks=function(){},qi.prototype.updateRelationshipsFromData=function(){},qi.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=ln()),x.push(tt))}if(x!==null)break}if(x!==null){for(E=0;E<x.length;E++)x[E].La(y);Be(x)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(y)}};function ay(a,y){var x=y.Hh;if(Zt(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){Td(y,function(tt){tt=tt.O.s;for(var ot=tt.length,rt=0;rt<ot;rt++)Mg(x,tt[rt])});var E=y.Hh;if(Zt(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}}}}qi.prototype.Kj=function(a,y,x){x===void 0&&(x=!1);var E=new kn;if(Zt(a))for(var b=0;b<a.length;b++)r0(this,a[b],y,E,x);else for(a=a.iterator;a.next();)r0(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 Me;for(var z=new kn,tt=E.iterator;tt.next();){var ot=tt.value;if(ot instanceof Ve)a||ot.fromNode!==null&&ot.toNode!==null||b.add(ot);else if(ot instanceof nn&&ot.data!==null&&x.Tl()){var rt=ot;ot=tt.key;var at=ot.pg();at!==null&&(at=E.I(at),at!==null?(x.qe(rt.data,x.wa(at.data)),rt=y.Kc(rt.data),ot=ot.kh(),ot!==null&&rt!==null&&z.add(ot,rt)):x.qe(rt.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 kn;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 r0(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 On))return null;if(z.isSelected=!1,z.isHighlighted=!1,E.add(y,z),y instanceof nn){for(var tt=y.linksConnected;tt.next();){var ot=tt.value;if(ot.fromNode===y){var rt=E.I(ot);rt!==null&&(rt.fromNode=z)}ot.toNode===y&&(ot=E.I(ot),ot!==null&&(ot.toNode=z))}if(y instanceof ri&&z instanceof ri)for(y=y.memberParts;y.next();)tt=r0(a,y.value,x,E,b),tt instanceof Ve||tt===null||(tt.containingGroup=z)}else if(y instanceof Ve&&z instanceof Ve)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=r0(a,y.value,x,E,b),tt!==null&&tt instanceof nn&&(tt.labeledLink=z);return z}qi.prototype.copyPartData=function(a,y){var x=null,E=a.data;if(E!==null&&y!==null){var b=y.model;a instanceof Ve||(E=b.copyNodeData(E),Qt(E)&&(b.xf(E),x=y.Lc(E)))}else Za(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 Ve||(b=y.copyNodeData(E)),Qt(b)&&(x.data=b)));return x},oe.Object.defineProperties(qi.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}}}),qi.prototype.updateAllRelationshipsFromData=qi.prototype.rp,qi.prototype.findLinksByExample=qi.prototype.ls,qi.prototype.findNodesByExample=qi.prototype.ms,qi.prototype.findLinkForData=qi.prototype.Kc,qi.prototype.findNodeForData=qi.prototype.ii,qi.prototype.findPartForData=qi.prototype.Lc,qi.prototype.findNodeForKey=qi.prototype.Vb,qi.prototype.removeModeledPart=qi.prototype.ip,qi.prototype.removeModeledParts=qi.prototype.Gs,qi.prototype.rebuildParts=qi.prototype.Wd;var f1=!1,g1=!1,p1=!1;qi.className="PartManager";function Mr(a){qi.apply(this,arguments)}he(Mr,qi),Mr.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray),m1(this,a.linkDataArray)},Mr.prototype.addModeledParts=function(a){for(qi.prototype.addModeledParts.call(this,a,!1),a=this.links.iterator;a.next();)bf(a.value);af(this.diagram,!1)};function m1(a,y){y.forEach(function(x){v1(a,x)}),af(a.diagram,!1)}function v1(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){Za(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=u0(x,y,!0);z!==""&&(b.fromPortId=z),z=Pa(x,y,!0),z!==void 0&&(z=a.Vb(z),z instanceof nn&&(b.fromNode=z)),z=u0(x,y,!1),z!==""&&(b.toPortId=z),z=Pa(x,y,!1),z!==void 0&&(z=a.Vb(z),z instanceof nn&&(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}}}}Mr.prototype.removeAllModeledParts=function(){var a=this.diagram.model;y1(this,a.linkDataArray),this.Gs(a.nodeDataArray)};function y1(a,y){y.forEach(function(x){a.ip(x)})}Mr.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ps(a)},Mr.prototype.setLinkCategoryForData=function(a,y){return this.diagram.model.lp(a,y)},Mr.prototype.setFromNodeForLink=function(a,y){var x=this.diagram.model;x.wv(a.data,x.wa(y!==null?y.data:null))},Mr.prototype.setToNodeForLink=function(a,y){var x=this.diagram.model;x.Bv(a.data,x.wa(y!==null?y.data:null))},Mr.prototype.removeDataForLink=function(a){this.diagram.model.bm(a.data)},Mr.prototype.findPartForKey=function(a){var y=qi.prototype.findPartForKey.call(this,a);return y===null&&(a=this.diagram.model.jh(a),a!==null)?this.bf.I(a):y},Mr.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.jh(a),a!==null?this.bf.I(a):null)},Mr.prototype.doModelChanged=function(a){var y=this;if(qi.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===No){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 ot=this.Kc(a.object);if(ot!==null){var rt=this.Vb(a.newValue);ot.toNode=rt}}else if(b==="linkFromPortId"){var at=this.Kc(a.object);if(at!==null){var ut=a.newValue;typeof ut=="string"&&(at.fromPortId=ut)}}else if(b==="linkToPortId"){var ft=this.Kc(a.object);if(ft!==null){var mt=a.newValue;typeof mt=="string"&&(ft.toPortId=mt)}}else if(b==="nodeGroupKey"){var yt=this.Lc(a.object);if(yt!==null){var xt=a.newValue;if(xt!==void 0){var Mt=this.Vb(xt);Mt instanceof ri?yt.containingGroup=Mt:yt.containingGroup=null}else yt.containingGroup=null}}else if(b==="linkLabelKeys"){var It=this.Kc(a.object);if(It!==null){var Tt=a.oldValue,zt=a.newValue;Array.isArray(Tt)&&Tt.forEach(function(Te){0<=zt.indexOf(Te)||(Te=y.Vb(Te),Te!==null&&(Te.labeledLink=null))}),Array.isArray(zt)&&zt.forEach(function(Te){Te=y.Vb(Te),Te!==null&&(Te.labeledLink=It)})}}else if(b==="linkCategory"){var Ht=this.Kc(a.object),Vt=a.newValue;Ht!==null&&typeof Vt=="string"&&(Ht.category=Vt)}else b==="linkDataArray"&&(y1(this,a.oldValue),m1(this,a.newValue));x.isModified=!0}else if(E===ir){var Xt=a.newValue;if(b==="linkDataArray"&&typeof Xt=="object"&&Xt!==null)v1(this,Xt);else if(b==="linkLabelKeys"&&Vh(Xt)){var le=this.Kc(a.object),$e=this.Vb(Xt);le!==null&&$e!==null&&($e.labeledLink=le)}x.isModified=!0}else if(E===mr){var mn=a.oldValue;if(b==="linkDataArray"&&typeof mn=="object"&&mn!==null)this.ip(mn);else if(b==="linkLabelKeys"&&Vh(mn)){var cn=this.Vb(mn);cn!==null&&(cn.labeledLink=null)}x.isModified=!0}}else if(E===No){var We=a.propertyName;a.object!==x.model||We!=="linkFromKeyProperty"&&We!=="linkToKeyProperty"&&We!=="linkFromPortIdProperty"&&We!=="linkToPortIdProperty"&&We!=="linkLabelKeysProperty"&&We!=="nodeIsGroupProperty"&&We!=="nodeGroupKeyProperty"&&We!=="linkCategoryProperty"||x.undoManager.isUndoingRedoing||this.Wd(),x.isModified=!0}}finally{x.aa=!0}}}}},Mr.prototype.refreshDataBoundLinks=function(){var a=this,y=this.diagram.model,x=new Me,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){N1(y,z,!1)}),E.forEach(function(z){a.Kc(z)===null&&F1(y,z,!1)})},Mr.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 Ve){var b=Pa(E,y,!0);if(b=x.Vb(b),a.fromNode=b,b=Pa(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 Me().addAll(y);var tt=new Me;a.labelNodes.each(function(ot){ot.data!==null&&(ot=E.wa(ot.data),ot!==void 0&&tt.add(ot))}),y=tt.copy(),y.hp(b),b=b.copy(),b.hp(tt),(0<y.count||0<b.count)&&(y.each(function(ot){ot=x.Vb(ot),ot!==null&&ot.labeledLink===a&&(ot.labeledLink=null)}),b.each(function(ot){ot=x.Vb(ot),ot!==null&&ot.labeledLink!==a&&(ot.labeledLink=a)}))}}else!(a instanceof Ii)&&(y=E.lh(y),y=x.findPartForKey(y),y===null||y instanceof ri)&&(a.containingGroup=y)}}},Mr.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=lp(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 ri&&y.lh(tt)===x&&(tt=this.Lc(tt),tt!==null&&(tt.containingGroup=b)):(z.link=this.Kc(tt),z.link!==null&&b instanceof nn&&(Pa(y,tt,!0)===x&&(z.link.fromNode=b),Pa(y,tt,!1)===x&&(z.link.toNode=b),tt=y.Ef(tt),Array.isArray(tt)&&tt.some(function(ot){return function(rt){return rt===x?(b.labeledLink=ot.link,!0):!1}}(z)))),z={link:z.link}}yl(y,x)}a=y.lh(a),a!==void 0&&(a=this.Vb(a),a instanceof ri&&(b.containingGroup=a))}},Mr.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof nn){var x=y.wa(a.data);if(x!==void 0){for(var E=a.linksConnected;E.next();)vl(y,x,E.value.data);if(a.isLinkLabel&&(E=a.labeledLink,E!==null&&vl(y,x,E.data)),a instanceof ri)for(a=a.memberParts;a.next();)E=a.value.data,y.lb(E)&&vl(y,x,E)}}},Mr.prototype.copyPartData=function(a,y){var x=qi.prototype.copyPartData.call(this,a,y);if(a instanceof Ve)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},Mr.prototype.insertLink=function(a,y,x,E){var b=this.diagram,z=b.model,tt=b.toolManager.findTool("Linking"),ot="";if(a!==null&&(y===null&&(y=a),ot=y.portId,ot===null&&(ot="")),y="",x!==null&&(E===null&&(E=x),y=E.portId,y===null&&(y="")),E=tt.archetypeLinkData,E instanceof Ve){if(Za(E),z=E.copy(),z!==null)return z.fromNode=a,z.fromPortId=ot,z.toNode=x,z.toPortId=y,b.add(z),a=tt.archetypeLabelNodeData,a instanceof nn&&(Za(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&&Df(z,E,z.wa(a.data),!0),Of(z,E,ot,!0),x!==null&&Df(z,E,z.wa(x.data),!1),Of(z,E,y,!1),z.fi(E),a=tt.archetypeLabelNodeData,a===null||a instanceof nn||(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},Mr.prototype.findLinkForKey=Mr.prototype.findLinkForKey,Mr.prototype.findPartForKey=Mr.prototype.findPartForKey,Mr.prototype.removeAllModeledParts=Mr.prototype.removeAllModeledParts,Mr.prototype.addModeledParts=Mr.prototype.addModeledParts,Mr.prototype.addAllModeledParts=Mr.prototype.addAllModeledParts,Mr.className="GraphLinksPartManager";function Ba(){qi.apply(this,arguments),this.Sg=null}he(Ba,qi);function s0(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||!ys(E,b,z,null,!0))&&(y=a.getLinkCategoryForData(x.data),E=a.findLinkTemplateForCategory(y),E!==null&&(Za(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}}}Ba.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ss(a)},Ba.prototype.setLinkCategoryForData=function(a,y){this.diagram.model.Ms(a,y)},Ba.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}},Ba.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))},Ba.prototype.removeDataForLink=function(a){this.diagram.model.qe(a.data,void 0)},Ba.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.hc(a),a!==null?this.bf.I(a):null)},Ba.prototype.doModelChanged=function(a){if(qi.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===No){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 ot=tt.kh();ot!==null?z===null?y.remove(ot):y.isTreePathToChildren?ot.fromNode=z:ot.toNode=z:s0(this,z,tt)}}else if(E==="parentLinkCategory"){var rt=this.ii(a.object),at=a.newValue;if(rt!==null&&typeof at=="string"){var ut=rt.kh();ut!==null&&(ut.category=at)}}y.isModified=!0}}else if(x===No){var ft=a.propertyName;a.object===y.model&&ft==="nodeParentKeyProperty"&&(y.undoManager.isUndoingRedoing||this.Wd()),y.isModified=!0}}finally{y.aa=!0}}}}},Ba.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;a instanceof nn&&(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:s0(this,y,a):E!==null&&wg(x,E,!1)))}}},Ba.prototype.updateDataBindings=function(a,y){qi.prototype.updateDataBindings.call(this,a,y),typeof y=="string"&&this.Lc(a)!==null&&(a=this.Kc(a),a!==null&&a.La(y))},Ba.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=lp(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 nn&&y.mh(z)===x&&s0(this,b,this.ii(z))}yl(y,x)}a=y.mh(a),a!==void 0&&b instanceof nn&&(a=this.Vb(a),s0(this,a,b))}},Ba.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof nn){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(mr,"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)&&vl(y,x,b)}},Ba.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},Ba.prototype.findLinkForKey=Ba.prototype.findLinkForKey,Ba.className="TreePartManager";function Ln(a,y){this.kl=new Me,this.il=new Me,this.Wv=`,
"insertedNodeKeys": `,this.jy=`,
"modifiedNodeData": `,this.Yv=`,
"removedNodeKeys": `,this.vh=null,En(this),this.Sm=this.xa="",this.Gg=!1,this.j={},this.Tc=[],this.kb=new kn,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 kn,this.Lt=new ke,this.Wg=!1,this.o=null,this.undoManager=new Do,a!==void 0&&(Zt(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}Ln.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},Ln.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},Ln.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},Ln.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)+":"+zn(b)}}return y},Ln.prototype.xA=function(a){a.change!==ia&&Wt("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var y=a.object;return a.isTransactionFinished&&y instanceof kr?(x1(this,y),a=this.Qv(y,a.propertyName==="FinishedUndo"),this.vh=null,a):null},Ln.prototype.Qv=function(a,y){var x=this,E=!1,b=new Me,z=new Me,tt=new Me,ot=this.vh;a.changes.each(function(ft){ft.model===x&&(ft.modelChange==="nodeDataArray"?ft.change===ir?b.add(ft.newValue):ft.change===mr&&tt.add(ft.oldValue):x.lb(ft.object)?z.add(ft.object):ft.change!==No||x.modelData!==ft.object&&ft.propertyName!=="modelData"?ft.object!==null&&(ot&&ot.contains(ft.object)?ot.get(ft.object).each(function(mt){x.lb(mt)&&z.add(mt)}):ft.object instanceof Ln||x.ri()&&x.Jc(ft.object)||w1(x,ft.object).each(function(mt){z.add(mt)})):E=!0)});var rt=this.il;rt.clear(),b.each(function(ft){rt.add(x.wa(ft)),y||z.add(ft)});var at=this.kl;at.clear(),tt.each(function(ft){at.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<rt.count&&(ut===null&&(ut={}),y?ut.removedNodeKeys=rt.Fa():ut.insertedNodeKeys=rt.Fa()),0<a.length&&(ut===null&&(ut={}),ut.modifiedNodeData=a),0<at.count&&(ut===null&&(ut={}),y?ut.insertedNodeKeys=at.Fa():ut.removedNodeKeys=at.Fa()),at.clear(),rt.clear(),ut},Ln.prototype.cloneDeep=function(a){return Bf(this,a,!0)};function Bf(a,y,x,E,b,z){function tt(ft,mt){ot?(ft.__gohashid===void 0&&z.push(ft),E.set(ft,mt)):(ft=mo++,E.set(ft,mt),b.set(ft,y))}if(!Qt(y))return y;z||(z=[]);var ot=Object.isExtensible(y);if(E||(E=new kn),ot){var rt=E.get(y);if(rt)return rt}else for(b||(b=new kn),rt=b.iterator;rt.next();){var at=rt.key;if(rt.value===y&&(at=E.get(at)))return at}if(Array.isArray(y)){rt=[],tt(y,rt);for(var ut=0;ut<y.length;ut++)rt.push(Bf(a,y[ut],!1,E,b,z))}else if(y instanceof Bt||y instanceof Qe||y instanceof Ce||y instanceof yi||y instanceof rn)rt=y.copy(),tt(y,rt);else{if(y instanceof Qi||y instanceof Ue||y instanceof Se)return y;if(y instanceof ke)rt=new ke().addAll(Bf(a,y.Fa(),!1,E,b,z)),tt(y,rt);else if(y instanceof Me)rt=new Me().addAll(Bf(a,y.Fa(),!1,E,b,z)),tt(y,rt);else if(y instanceof kn)rt=new kn().addAll(Bf(a,y.Fa(),!1,E,b,z)),tt(y,rt);else if(y instanceof Date)rt=new Date(y.getTime()),tt(y,rt);else if(y instanceof RegExp)rt=new RegExp(y),tt(y,rt),rt.lastIndex=y.lastIndex;else if(typeof y.copy=="function")rt=y.copy(),tt(y,rt);else for(ut in rt={},tt(y,rt),y)ut!=="__gohashid"&&(rt[ut]=Bf(a,y[ut],!1,E,b,z))}return x&&z.forEach(function(ft){delete ft.__gohashid}),rt}Ct=Ln.prototype,Ct.quote=function(a){return JSON.stringify(a).replace(/[\u007F-\uFFFF]/g,function(y){return"\\u"+("0000"+y.charCodeAt(0).toString(16)).substr(-4)})},Ct.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},Ct.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 S1(a,y){y=y.modelData,Qt(y)&&(a.dm(y),a.modelData=y)}Ct.Rv=function(){var a=this.modelData,y=!1,x;for(x in a)if(!P1(x,a[x])){y=!0;break}return a="",y&&(a=`,
"modelData": `+uy(this,this.modelData)),a+`,
"nodeDataArray": `+Wh(this,this.nodeDataArray,!0)},Ct.kv=function(a){S1(this,a),a=a.nodeDataArray,Zt(a)&&(this.dm(a),this.nodeDataArray=a)};function x1(a,y){function x(b,z){if((z=z.part)&&(z=z.data,b!==z)){var tt=E.get(b);tt===null?(tt=new Me,tt.add(z),E.add(b,tt)):tt.add(z)}}var E=a.vh;E===null&&(E=new kn,y.changes.each(function(b){if(b.diagram!==null){var z=b.change;z===No?(b=b.object.panel)&&(z=b.data)&&x(z,b):(z===ir||z===mr)&&(b=b.object,(z=b.itemArray)&&x(z,b))}}),a.vh=E)}function w1(a,y){for(var x=new Me,E=0;E<a.nodeDataArray.length;E++){var b=a.nodeDataArray[E];a0(a,y,b,b,x)}return x}function a0(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(a0(a,y,tt,E,b))return!0}else if(Qt(x)&&Object.getPrototypeOf(x)===Object.prototype)for(z in x){if(tt=x[z],tt===y)return b.add(E),!0;if(a0(a,y,tt,E,b))return!0}return!1}Ct.Pv=function(a,y){var x=this,E=!1,b=new Me,z=new Me,tt=new Me,ot=this.vh;a.changes.each(function(ut){ut.model===x&&(ut.modelChange==="nodeDataArray"?ut.change===ir?b.add(ut.newValue):ut.change===mr&&tt.add(ut.oldValue):x.lb(ut.object)?z.add(ut.object):ut.change!==No||x.modelData!==ut.object&&ut.propertyName!=="modelData"?ut.object!==null&&(ot&&ot.contains(ut.object)?ot.get(ut.object).each(function(ft){x.lb(ft)&&z.add(ft)}):ut.object instanceof Ln||x.ri()&&x.Jc(ut.object)||w1(x,ut.object).each(function(ft){z.add(ft)})):E=!0)});var rt=this.il;rt.clear(),b.each(function(ut){rt.add(x.wa(ut)),y||z.add(ut)});var at=this.kl;return at.clear(),tt.each(function(ut){at.add(x.wa(ut)),y&&z.add(ut)}),a="",E&&(a+=`,
"modelData": `+uy(this,this.modelData)),0<rt.count&&(a+=(y?this.Yv:this.Wv)+Wh(this,rt.Fa(),!0)),0<z.count&&(a+=this.jy+Wh(this,z.Fa(),!0)),0<at.count&&(a+=(y?this.Wv:this.Yv)+Wh(this,at.Fa(),!0)),at.clear(),rt.clear(),a},Ct.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)&&Wt("applyIncrementalJson cannot change Model properties"),S1(this,a);var y=a.insertedNodeKeys,x=a.modifiedNodeData,E=new kn;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 ot=this.hc(tt);ot===null&&(ot=(ot=E.get(tt))?ot:this.copyNodeData({}),this.km(ot,tt),this.xf(ot))}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 rt in b)rt==="__gohashid"||rt===this.nodeKeyProperty||this.Wj()&&rt===this.nodeIsGroupProperty||this.setDataProperty(z,rt,b[rt]);this.lm(b,z)}}if(a=a.removedNodeKeys,Array.isArray(a))for(x=a.length,rt=0;rt<x;rt++)y=this.hc(a[rt]),y!==null&&this.cm(y)},Ct.$x=function(a,y){a.change!==ia&&Wt("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var x=a.object;return a.isTransactionFinished&&x instanceof kr?(y===void 0&&(y=up(this,this)),x1(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 }'},Ct.yA=function(a,y){return this.$x(a,y)},Ct.np=function(a){return a===void 0&&(a=up(this,this)),'{ "class": '+this.quote(a)+this.rm()+this.Rv()+"}"},Ct.toJSON=function(a){return this.np(a)},Ct.Zw=function(a){var y=null;if(typeof a=="string")try{y=Ke.JSON.parse(a)}catch(E){}else typeof a=="object"?y=a:Wt("Unable to modify a Model from: "+a);var x=y.incremental;typeof x!="number"&&Wt("Unable to apply non-incremental changes to Model: "+a),x!==0&&(this.Ea("applyIncrementalJson"),this.fp(y),this.eb("applyIncrementalJson"))},Ct.Ky=function(a){return this.Zw(a)},Ln.constructGraphLinksModel=function(){return new Ln},Ct=Ln.prototype,Ct.dm=function(a){if(Zt(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];if(Qt(E)){var b=x;E=this.dm(E),Array.isArray(a)?a[b]=E:Wt("Cannot replace an object in an HTMLCollection or NodeList at "+b)}}else if(Qt(a)){for(y in a)if(x=a[y],Qt(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 ke,E=0;E<x.length/2;E++)b.add(new Bt(x[2*E],x[2*E+1]));b.freeze(),a[y]=b}}return Tx(a)}return a},Ct.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()):Zt(a)?Wh(this,a):Qt(a)?uy(this,a):typeof a=="function"?"null":a.toString()};function Wh(a,y,x){x===void 0&&(x=!1);var E=y.length;if(0>=E)return"[]";var b=new bn;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 P1(a,y){return y===void 0||a==="__gohashid"||a[0]==="_"||typeof y=="function"}function bs(a){return isNaN(a)?"NaN":a===1/0?"9e9999":a===-1/0?"-9e9999":a}function uy(a,y){var x=y;if(x instanceof Bt)y={class:"go.Point",x:bs(x.x),y:bs(x.y)};else if(x instanceof Qe)y={class:"go.Size",width:bs(x.width),height:bs(x.height)};else if(x instanceof Ce)y={class:"go.Rect",x:bs(x.x),y:bs(x.y),width:bs(x.width),height:bs(x.height)};else if(x instanceof yi)y={class:"go.Margin",top:bs(x.top),right:bs(x.right),bottom:bs(x.bottom),left:bs(x.left)};else if(x instanceof rn)x.sb()?y={class:"go.Spot",x:bs(x.x),y:bs(x.y),offsetX:bs(x.offsetX),offsetY:bs(x.offsetY)}:y={class:"go.Spot",enum:x.toString()};else if(x instanceof Qi){if(y={class:"go.Brush",type:x.type.name},x.type===Ku?y.color=x.color:(x.type===yu||x.type===Ta)&&(y.start=x.start,y.end=x.end,x.type===Ta&&(x.startRadius!==0&&(y.startRadius=bs(x.startRadius)),isNaN(x.endRadius)||(y.endRadius=bs(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 Ue?(y={class:"go.Geometry",type:x.type.name},x.startX!==0&&(y.startX=bs(x.startX)),x.startY!==0&&(y.startY=bs(x.startY)),x.endX!==0&&(y.endX=bs(x.endX)),x.endY!==0&&(y.endY=bs(x.endY)),x.spot1.D(io)||(y.spot1=x.spot1),x.spot2.D(Os)||(y.spot2=x.spot2),x.type===Ue.o&&(y.path=Ue.ia(x))):x instanceof Se&&(y={class:"go.EnumValue",classType:up(a,x.classType),name:x.name});E="{",x=!0;for(var b in y){var z=tr(y,b);if(!P1(b,z))if(x?x=!1:E+=",",E+=a.quote(b)+":",b==="points"&&z instanceof ke){var tt="[";for(z=z.iterator;z.next();){var ot=z.value;1<tt.length&&(tt+=","),tt+=a.sm(ot.x),tt+=",",tt+=a.sm(ot.y)}tt+="]",E+=tt}else E+=a.sm(z)}return E+"}"}function Fs(a){return typeof a=="number"?a:a==="NaN"?NaN:a==="9e9999"?1/0:a==="-9e9999"?-1/0:parseFloat(a)}function Tx(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 Bt(Fs(a.x),Fs(a.y));else if(y==="Size")x=new Qe(Fs(a.width),Fs(a.height));else if(y==="Rect")x=new Ce(Fs(a.x),Fs(a.y),Fs(a.width),Fs(a.height));else if(y==="Margin")x=new yi(Fs(a.top),Fs(a.right),Fs(a.bottom),Fs(a.left));else if(y==="Spot")typeof a.enum=="string"?x=js(a.enum):x=new rn(Fs(a.x),Fs(a.y),Fs(a.offsetX),Fs(a.offsetY));else if(y==="Brush"){if(x=new Qi,x.type=on(Qi,a.type),typeof a.color=="string"&&(x.color=a.color),a.start instanceof rn&&(x.start=a.start),a.end instanceof rn&&(x.end=a.end),typeof a.startRadius=="number"&&(x.startRadius=Fs(a.startRadius)),typeof a.endRadius=="number"&&(x.endRadius=Fs(a.endRadius)),a=a.colorStops,Qt(a))for(var E in a)x.addColorStop(parseFloat(E),a[E])}else y==="Geometry"?(x=null,typeof a.path=="string"?x=Ue.parse(a.path):x=new Ue,x.type=on(Ue,a.type),typeof a.startX=="number"&&(x.startX=Fs(a.startX)),typeof a.startY=="number"&&(x.startY=Fs(a.startY)),typeof a.endX=="number"&&(x.endX=Fs(a.endX)),typeof a.endY=="number"&&(x.endY=Fs(a.endY)),a.spot1 instanceof rn&&(x.spot1=a.spot1),a.spot2 instanceof rn&&(x.spot2=a.spot2)):y==="EnumValue"&&(E=a.classType,E.indexOf("go.")===0&&(E=E.substr(3)),E=dy(E),typeof E=="function"&&(x=on(E,a.name)));return x}Ct.Pe=function(a){return this.Lt.add(a),this},Ct.ik=function(a){this.Lt.remove(a)},Ct.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)},Ct.cb=function(a,y,x,E,b,z,tt){pr(this,"",a,y,x,E,b,z,tt)},Ct.g=function(a,y,x,E,b){pr(this,"",No,a,this,y,x,E,b)},Ct.Fs=function(a,y,x,E,b,z){pr(this,"",No,y,a,x,E,b,z)};function pr(a,y,x,E,b,z,tt,ot,rt){ot===void 0&&(ot=null),rt===void 0&&(rt=null);var at=new Ao;at.model=a,at.change=x,at.modelChange=y,at.propertyName=E,at.object=b,at.oldValue=z,at.oldParam=ot,at.newValue=tt,at.newParam=rt,a.ds(at)}Ln.prototype.changeState=function(a,y){if(a!==null&&a.model===this)if(a.change===No){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)),Lo(x,E,b)}else a.change===ir?(x=a.newParam,a.modelChange==="nodeDataArray"?(a=a.newValue,Qt(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]===a&&Hn(this.Tc,x),E!==void 0&&this.kb.remove(E)):(this.Tc[x]!==a&&Mn(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)))):a.modelChange===""?((E=a.object)&&!Zt(E)&&a.propertyName&&(E=tr(a.object,a.propertyName)),Zt(E)&&typeof x=="number"&&(a=a.newValue,y?Hn(E,x):Mn(E,x,a))):Wt("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===mr?(x=a.oldParam,a.modelChange==="nodeDataArray"?(a=a.oldValue,Qt(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]!==a&&Mn(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)):(this.Tc[x]===a&&Hn(this.Tc,x),E!==void 0&&this.kb.remove(E)))):a.modelChange===""?((E=a.object)&&!Zt(E)&&a.propertyName&&(E=tr(a.object,a.propertyName)),Zt(E)&&typeof x=="number"&&(a=a.oldValue,y?Mn(E,x,a):Hn(E,x))):Wt("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==ia&&Wt("unknown ChangedEvent: "+a.toString())},Ln.prototype.Ea=function(a){return this.undoManager.Ea(a)},Ln.prototype.eb=function(a){return this.undoManager.eb(a)},Ln.prototype.Kf=function(){return this.undoManager.Kf()},Ln.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}},Ct=Ln.prototype,Ct.La=function(a,y){y===void 0&&(y=""),pr(this,"SourceChanged",ia,y,a,null,null)},Ct.wa=function(a){if(a!==null){var y=this.Th;if(y!==""&&(y=tr(a,y),y!==void 0)){if(Vh(y))return y;Wt("Key value for node data "+a+" is not a number or a string: "+y)}}},Ct.km=function(a,y){if(a!==null){var x=this.Th;if(x!=="")if(this.lb(a)){var E=tr(a,x);E!==y&&this.hc(y)===null&&(Lo(a,x,y),E!==void 0&&this.kb.remove(E),this.kb.add(y,a),pr(this,"nodeKey",No,x,a,E,y),typeof x=="string"&&this.La(a,x),this.jp(E,y))}else Lo(a,x,y)}};function Vh(a){return typeof a=="number"||typeof a=="string"}Ct.lb=function(a){var y=this.wa(a);return y===void 0?!1:this.kb.I(y)===a},Ct.hc=function(a){return a===null&&Wt("Model.findNodeDataForKey:key must not be null"),a!==void 0&&Vh(a)?this.kb.I(a):null},Ct.$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))){Lo(a,y,x);return}if(typeof x=="string"){for(E=2;this.kb.contains(x+E);)E++;Lo(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.kb.count-1;this.kb.contains(x);)x--;Lo(a,y,x)}}}}},Ct.xf=function(a){a!==null&&($n(a),this.lb(a)||C1(this,a,!0))};function C1(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&&Wt("Model.makeNodeDataKeyUnique failed on "+y+". Data not added to Model."),a.kb.add(E,y),E=null,x&&(E=a.Tc.length,Mn(a.Tc,E,y)),pr(a,"nodeDataArray",ir,"nodeDataArray",a,null,y,null,E),a.fm(y),a.em(y))}Ct.Fy=function(a){if(Zt(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)},Ct.cm=function(a){a!==null&&L1(this,a,!0)};function L1(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;Hn(a.Tc,E)}pr(a,"nodeDataArray",mr,"nodeDataArray",a,y,null,E,null),a.qp(y)}Ct.nA=function(a){if(Zt(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)},Ct.$z=function(a){if(a!==this.nodeDataArray&&Zt(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 ot=this.hc(tt);ot!==z&&(ot!==null?(this.Do(ot,z),this.lm(z,ot)):(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()}},Ct.jp=function(a,y){y!==void 0&&(a=lp(this,a),a instanceof Me&&this.Vf.add(y,a))},Ct.Lv=function(){},Ct.fm=function(){},Ct.em=function(){},Ct.qp=function(){};function vl(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E===null&&(E=new Me,a.Vf.add(y,E)),E.add(x)}}function yl(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E instanceof Me&&(x==null?a.Vf.remove(y):(E.remove(x),E.count===0&&a.Vf.remove(y)))}}function lp(a,y){return y===void 0?null:(a=a.Vf.I(y),a instanceof Me?a:null)}Ct.Qy=function(a){a===void 0?this.Vf.clear():this.Vf.remove(a)},Ln.prototype.copyNodeData=function(a){if(a===null)return null;var y=this.Bk;return a=y!==null?y(a,this):l0(this,a,!0),Qt(a)&&En(a),a};function l0(a,y,x){if(a.copiesArrays&&Array.isArray(y)){var E=[];for(x=0;x<y.length;x++){var b=l0(a,y[x],a.copiesArrayObjects);E.push(b)}return En(E),E}if(x&&Qt(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=tr(y,E),tt=up(a,z);tt==="GraphObject"||tt==="Diagram"||tt==="Layer"||tt==="RowColumnDefinition"||tt==="AnimationManager"||tt==="Tool"||tt==="CommandHandler"||tt==="Layout"||tt==="InputEvent"||tt==="DiagramEvent"||z instanceof Ln||z instanceof Do||z instanceof kr||z instanceof Ao||(z=l0(a,z,!1)),Lo(x,E,z)}return En(x),x}return y instanceof Bt||y instanceof Qe||y instanceof Ce||y instanceof rn||y instanceof yi?y.copy():y}Ln.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!k1&&a instanceof Jt&&(k1=!0,ye('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),ye(" Is that really your intent?"));var E=tr(a,y);E!==x&&(Lo(a,y,x),this.Fs(a,y,E,x))},Ct=Ln.prototype,Ct.set=function(a,y,x){this.setDataProperty(a,y,x)},Ct.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])}},Ct.Ay=function(a,y){this.ts(a,-1,y)},Ct.ts=function(a,y,x){0>y&&(y=a.length),Mn(a,y,x),pr(this,"",ir,"",a,null,x,null,y)},Ct.ov=function(a,y){y===void 0&&(y=-1),a===this.Tc&&Wt("Model.removeArrayItem should not be called on the Model.nodeDataArray"),y===-1&&(y=a.length-1);var x=a[y];Hn(a,y),pr(this,"",mr,"",a,x,null,y,null)},Ct.Ro=function(a){if(a===null)return"";var y=this.lj;if(y===""||(y=tr(a,y),y===void 0))return"";if(typeof y=="string")return y;Wt("getCategoryForNodeData found a non-string category for "+a+": "+y)},Ct.jm=function(a,y){if(a!==null){var x=this.lj;if(x!=="")if(this.lb(a)){var E=tr(a,x);E===void 0&&(E=""),E!==y&&(Lo(a,x,y),pr(this,"nodeCategory",No,x,a,E,y))}else Lo(a,x,y)}},Ct.lm=function(a,y){this.jm(y,this.Ro(a))},Ct.Tl=function(){return!1},Ct.Wj=function(){return!1},Ct.ri=function(){return!1},Ct.xs=function(){return!1},Ct.Xj=function(){return!1};function hy(){return new Ln}function up(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 up(a,y.constructor);return typeof y}function dy(a){return al[a]?al[a]:Ke.go!==void 0&&Ke.go[a]?Ke.go[a]:null}function tr(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 Lo(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){}}oe.Object.defineProperties(Ln.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===""&&Wt("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&Wt("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];Qt(b)||Wt("Model.nodeDataArray must only contain Objects, not: "+b),$n(b)}for(this.Tc=a,E=new ke,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(pr(this,"nodeDataArray",No,"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"}}}),Ln.prototype.setCategoryForNodeData=Ln.prototype.jm,Ln.prototype.getCategoryForNodeData=Ln.prototype.Ro,Ln.prototype.removeArrayItem=Ln.prototype.ov,Ln.prototype.insertArrayItem=Ln.prototype.ts,Ln.prototype.addArrayItem=Ln.prototype.Ay,Ln.prototype.assignAllDataProperties=Ln.prototype.Do,Ln.prototype.set=Ln.prototype.set,Ln.prototype.clearUnresolvedReferences=Ln.prototype.Qy,Ln.prototype.mergeNodeDataArray=Ln.prototype.$z,Ln.prototype.removeNodeDataCollection=Ln.prototype.nA,Ln.prototype.removeNodeData=Ln.prototype.cm,Ln.prototype.addNodeDataCollection=Ln.prototype.Fy,Ln.prototype.addNodeData=Ln.prototype.xf,Ln.prototype.makeNodeDataKeyUnique=Ln.prototype.$u,Ln.prototype.findNodeDataForKey=Ln.prototype.hc,Ln.prototype.containsNodeData=Ln.prototype.lb,Ln.prototype.setKeyForNodeData=Ln.prototype.km,Ln.prototype.getKeyForNodeData=Ln.prototype.wa,Ln.prototype.updateTargetBindings=Ln.prototype.La,Ln.prototype.commit=Ln.prototype.commit,Ln.prototype.rollbackTransaction=Ln.prototype.Kf,Ln.prototype.commitTransaction=Ln.prototype.eb,Ln.prototype.startTransaction=Ln.prototype.Ea,Ln.prototype.raiseDataChanged=Ln.prototype.Fs,Ln.prototype.raiseChanged=Ln.prototype.g,Ln.prototype.raiseChangedEvent=Ln.prototype.cb,Ln.prototype.removeChangedListener=Ln.prototype.ik,Ln.prototype.addChangedListener=Ln.prototype.Pe,Ln.prototype.writeJsonValue=Ln.prototype.sm,Ln.prototype.replaceJsonObjects=Ln.prototype.dm,Ln.prototype.applyIncrementalJSON=Ln.prototype.Ky,Ln.prototype.applyIncrementalJson=Ln.prototype.Zw,Ln.prototype.toJSON=Ln.prototype.toJSON,Ln.prototype.toJson=Ln.prototype.np,Ln.prototype.toIncrementalJSON=Ln.prototype.yA,Ln.prototype.toIncrementalJson=Ln.prototype.$x,Ln.prototype.toIncrementalData=Ln.prototype.xA,Ln.prototype.clear=Ln.prototype.clear;var k1=!1,al={};Ln.className="Model",Ln.fromJSON=Ln.fromJson=function(a,y){y===void 0&&(y=null);var x=null;if(typeof a=="string")try{x=Ke.JSON.parse(a)}catch(z){}else typeof a=="object"?x=a:Wt("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=Ke[E])),typeof b=="function"&&(a=new b)}catch(z){}a===null||a instanceof Ln?y=a:Wt("Unable to construct a Model of declared class: "+x.class)}return y===null&&(y=Ln.constructGraphLinksModel()),y.gp(x),y.kv(x),y},Ln.safePropertyValue=tr,Ln.safePropertySet=Lo,al.Brush=Qi,al.ChangedEvent=Ao,al.Geometry=Ue,al.Margin=yi,al.Panel=ze,al.Point=Bt,al.Rect=Ce,al.Size=Qe,al.Spot=rn,al.Transaction=kr,al.UndoManager=Do;function sr(a,y,x,E){En(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=E1,this.wk=null):(this.el=hp,this.wk=E),this.st=new Me}sr.prototype.copy=function(){var a=new sr;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},Ct=sr.prototype,Ct.qb=function(a){a.classType===sr&&(this.mode=a)},Ct.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.Ai!==-1?" "+this.Ai:"")+" "+this.mode.name+")"},Ct.freeze=function(){return this._isFrozen=!0,this},Ct.ka=function(){return this._isFrozen=!1,this},Ct.Kx=function(a){return a===void 0&&(a=null),this.mode=hp,this.backConverter=a,this},Ct.cp=function(a){return a===void 0&&(a=""),this.sourceName=a,this.isToModel=!1,this},Ct.dA=function(){return this.sourceName=null,this.isToModel=!0,this};function M1(a,y,x){return a=a.sourceName,a===null||a===""?y:a==="/"?x.part:a==="."?x:a===".."?x.panel:y.fb(a)}Ct.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==="")ye("Binding error: target property is the empty string: "+this.toString());else{var z=y;if(E!==""&&(z=tr(y,E)),z!==void 0)if(b===null)x!==""&&Lo(a,x,z);else try{if(x!==""){var tt=b(z,a);Lo(a,x,tt)}else b(z,a)}catch(ot){}}}},Ct.sp=function(a,y,x,E){if(this.el===hp){var b=this.xl;if(x===void 0||b===x){x=this.sl;var z=this.wk,tt=a;if(b!==""&&(tt=tr(a,b)),tt!==void 0&&!this.st.contains(a))try{this.st.add(a);var ot=E!==null?E.diagram:null,rt=ot!==null?ot.model:null;if(z===null){if(x!=="")rt!==null?rt.setDataProperty(y,x,tt):Lo(y,x,tt);else if(rt!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var at=E.itemIndex,ut=E.panel.itemArray;rt.ov(ut,at),rt.ts(ut,at,tt)}}else try{if(x!==""){var ft=z(tt,y,rt);rt!==null?rt.setDataProperty(y,x,ft):Lo(y,x,ft)}else{var mt=z(tt,y,rt);if(mt!==void 0&&rt!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var yt=E.itemIndex,xt=E.panel.itemArray;rt.ov(xt,yt),rt.ts(xt,yt,mt)}}}catch(Mt){}}finally{this.st.remove(a)}}}},oe.Object.defineProperties(sr.prototype,{Ai:{get:function(){return this.j},set:function(a){this._isFrozen&&Ne(this),this.j=a}},targetProperty:{get:function(){return this.xl},set:function(a){this._isFrozen&&Ne(this),this.xl=a}},sourceName:{get:function(){return this.Cr},set:function(a){this._isFrozen&&Ne(this),this.Cr=a,a!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(a){this._isFrozen&&Ne(this),this.wn=a}},sourceProperty:{get:function(){return this.sl},set:function(a){this._isFrozen&&Ne(this),this.sl=a}},converter:{get:function(){return this.Im},set:function(a){this._isFrozen&&Ne(this),this.Im=a}},backConverter:{get:function(){return this.wk},set:function(a){this._isFrozen&&Ne(this),this.wk=a}},mode:{get:function(){return this.el},set:function(a){this._isFrozen&&Ne(this),this.el=a}}}),sr.prototype.updateSource=sr.prototype.sp,sr.prototype.updateTarget=sr.prototype.Mv,sr.prototype.ofModel=sr.prototype.dA,sr.prototype.ofObject=sr.prototype.cp,sr.prototype.makeTwoWay=sr.prototype.Kx;var Ax="Binding",E1=new Se(sr,"OneWay",1),hp=new Se(sr,"TwoWay",2);sr.className="Binding",sr.parseEnum=function(a,y){return function(x){return x=on(a,x),x===null?y:x}},sr.toString=zn,sr.OneWay=E1,sr.TwoWay=hp;function Ei(a,y,x){Ln.call(this),this.Vv=`,
"insertedLinkKeys": `,this.iy=`,
"modifiedLinkData": `,this.Xv=`,
"removedLinkKeys": `,this.md=[],this.$f=new Me,this.wb=new kn,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&&(Zt(a)?this.nodeDataArray=a:x=a),x&&(Object.assign(this,x),a=x.Changed)&&(delete this.Changed,this.Pe(a))}he(Ei,Ln),Ei.constructGraphLinksModel=Ln.constructGraphLinksModel,Ei.prototype.cloneProtected=function(a){Ln.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},Ct=Ei.prototype,Ct.clear=function(){Ln.prototype.clear.call(this),this.md=[],this.wb.clear(),this.$f.clear()},Ct.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)+":"+zn(b)}for(y+=`
link data:`,a=this.linkDataArray,x=a.length,E=0;E<x;E++)b=a[E],y+=" "+Pa(this,b,!0)+"-->"+Pa(this,b,!1)}return y},Ct.Qv=function(a,y){this.linkKeyProperty===""&&Wt("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var x=Ln.prototype.Qv.call(this,a,y),E=this,b=new Me,z=new Me,tt=new Me,ot=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===ir?b.add(ut.newValue):ut.change===mr&&tt.add(ut.oldValue):E.Jc(ut.object)?z.add(ut.object):ut.object!==null&&(ut.object!==null&&ot&&ot.contains(ut.object)?ot.get(ut.object).each(function(ft){E.Jc(ft)&&z.add(ft)}):ut.object instanceof Ln||E.lb(ut.object)||b1(E,ut.object).each(function(ft){z.add(ft)})))});var rt=this.il;rt.clear(),b.each(function(ut){rt.add(E.Ac(ut)),y||z.add(ut)});var at=this.kl;return at.clear(),tt.each(function(ut){at.add(E.Ac(ut)),y&&z.add(ut)}),a=E.cloneDeep(z.Fa()),0<rt.count&&(x===null&&(x={}),y?x.removedLinkKeys=rt.Fa():x.insertedLinkKeys=rt.Fa()),0<a.length&&(x===null&&(x={}),x.modifiedLinkData=a),0<at.count&&(x===null&&(x={}),y?x.insertedLinkKeys=at.Fa():x.removedLinkKeys=at.Fa()),at.clear(),rt.clear(),x},Ct.rm=function(){var a=Ln.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},Ct.gp=function(a){Ln.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)},Ct.Rv=function(){var a=Ln.prototype.Rv.call(this),y=`,
"linkDataArray": `+Wh(this,this.linkDataArray,!0);return a+y},Ct.kv=function(a){Ln.prototype.kv.call(this,a),a=a.linkDataArray,Array.isArray(a)&&(this.dm(a),this.linkDataArray=a)};function b1(a,y){for(var x=new Me,E=0;E<a.linkDataArray.length;E++){var b=a.linkDataArray[E];a0(a,y,b,b,x)}return x}Ct.Pv=function(a,y){this.linkKeyProperty===""&&Wt("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var x=Ln.prototype.Pv.call(this,a,y),E=this,b=new Me,z=new Me,tt=new Me,ot=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===ir?b.add(ut.newValue):ut.change===mr&&tt.add(ut.oldValue):E.Jc(ut.object)?z.add(ut.object):ut.object!==null&&(ut.object!==null&&ot&&ot.contains(ut.object)?ot.get(ut.object).each(function(ft){E.Jc(ft)&&z.add(ft)}):ut.object instanceof Ln||E.lb(ut.object)||b1(E,ut.object).each(function(ft){z.add(ft)})))});var rt=this.il;rt.clear(),b.each(function(ut){rt.add(E.Ac(ut)),y||z.add(ut)});var at=this.kl;return at.clear(),tt.each(function(ut){at.add(E.Ac(ut)),y&&z.add(ut)}),a=x,0<rt.count&&(a+=(y?this.Xv:this.Vv)+Wh(this,rt.Fa(),!0)),0<z.count&&(a+=this.iy+Wh(this,z.Fa(),!0)),0<at.count&&(a+=(y?this.Vv:this.Xv)+Wh(this,at.Fa(),!0)),at.clear(),rt.clear(),a},Ct.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)&&Wt("applyIncrementalJson cannot change Model properties"),Ln.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]);T1(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)},Ei.prototype.changeState=function(a,y){if(a!==null&&a.model===this){if(a.change===No){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),Lo(x,E,b);return}}else if(a.change===ir){if(x=a.newParam,a.modelChange==="linkDataArray"){a=a.newValue,Qt(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===mr){if(x=a.oldParam,a.modelChange==="linkDataArray"){a=a.oldValue,Qt(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}}Ln.prototype.changeState.call(this,a,y)}},Ct=Ei.prototype,Ct.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),Lo(x,this.nodeKeyProperty,a),this.xf(x))}return a}},Ct.yx=function(a){return Pa(this,a,!0)},Ct.wv=function(a,y){Df(this,a,y,!0)},Ct.Bx=function(a){return Pa(this,a,!1)},Ct.Bv=function(a,y){Df(this,a,y,!1)};function Pa(a,y,x){if(y!==null&&(a=x?a.lf:a.mf,a!==""&&(a=tr(y,a),a!==void 0))){if(Vh(a))return a;Wt((x?"FromKey":"ToKey")+" value for link data "+y+" is not a number or a string: "+a)}}function Df(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=tr(y,b);z!==x&&(yl(a,z,y),Lo(y,b,x),a.hc(x)===null&&vl(a,x,y),pr(a,E?"linkFromKey":"linkToKey",No,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Lo(y,b,x)}}Ct.zx=function(a){return u0(this,a,!0)},Ct.xv=function(a,y){Of(this,a,y,!0)},Ct.Cx=function(a){return u0(this,a,!1)},Ct.Cv=function(a,y){Of(this,a,y,!1)};function u0(a,y,x){return y===null||(a=x?a.ej:a.fj,a==="")?"":(y=tr(y,a),y===void 0?"":y)}function Of(a,y,x,E){if(y!==null){var b=E?a.ej:a.fj;if(b!=="")if(a.Jc(y)){var z=tr(y,b);z===void 0&&(z=""),z!==x&&(Lo(y,b,x),pr(a,E?"linkFromPortId":"linkToPortId",No,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Lo(y,b,x)}}Ct.Ef=function(a){if(a===null)return h0;var y=this.je;return y===""?h0:(a=tr(a,y),a===void 0?h0:a)},Ct.Ls=function(a,y){if(a!==null){var x=this.je;if(x!=="")if(this.Jc(a)){var E=tr(a,x);if(E===void 0&&(E=h0),E!==y){if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)yl(this,E[z],a);for(Lo(a,x,y),b=y.length,z=0;z<b;z++){var tt=y[z];this.hc(tt)===null&&vl(this,tt,a)}pr(this,"linkLabelKeys",No,x,a,E,y),typeof x=="string"&&this.La(a,x)}}else Lo(a,x,y)}},Ct.Bu=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=tr(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&&vl(this,y,a),pr(this,"linkLabelKeys",ir,x,a,null,y,null,b)))}else Wt(x+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}},Ct.Qx=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=tr(a,x);if(Array.isArray(E)){var b=E.indexOf(y);0>b||(E.splice(b,1),this.Jc(a)&&(yl(this,y,a),pr(this,"linkLabelKeys",mr,x,a,y,null,b,null)))}else E!==void 0&&Wt(x+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}},Ct.Ac=function(a){if(a!==null){var y=this.Jh;if(y!==""&&(y=tr(a,y),y!==void 0)){if(Vh(y))return y;Wt("Key value for link data "+a+" is not a number or a string: "+y)}}},Ct.Ks=function(a,y){if(a!==null){var x=this.Jh;if(x!=="")if(this.Jc(a)){var E=tr(a,x);E!==y&&this.jh(y)===null&&(Lo(a,x,y),E!==void 0&&this.wb.remove(E),this.wb.add(y,a),pr(this,"linkKey",No,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Lo(a,x,y)}},Ct.jh=function(a){return a===null&&Wt("GraphLinksModel.findLinkDataForKey:key must not be null"),a!==void 0&&Vh(a)?this.wb.I(a):null},Ct.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))){Lo(a,y,x);return}if(typeof x=="string"){for(E=2;this.wb.contains(x+E);)E++;Lo(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.wb.count-1;this.wb.contains(x);)x--;Lo(a,y,x)}}}}},Ct.Jc=function(a){return a===null?!1:this.$f.contains(a)},Ct.fi=function(a){a!==null&&($n(a),this.Jc(a)||F1(this,a,!0))};function F1(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&&Wt("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)),pr(a,"linkDataArray",ir,"linkDataArray",a,null,y,null,E),cy(a,y)}Ct.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)},Ct.bm=function(a){a!==null&&N1(this,a,!0)};function N1(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(pr(a,"linkDataArray",mr,"linkDataArray",a,y,null,E,null),x=Pa(a,y,!0),yl(a,x,y),x=Pa(a,y,!1),yl(a,x,y),E=a.Ef(y),Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],yl(a,x,y)}Ct.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)},Ct.Zz=function(a){if(this.linkKeyProperty===""&&Wt("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),a!==this.linkDataArray&&Zt(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 ot=this.jh(tt);ot!==z&&(ot!==null?(this.Do(ot,z),T1(this,z,ot)):(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=Pa(a,y,!0);x=a.Vl(x),a.hc(x)===null&&vl(a,x,y),x=Pa(a,y,!1),x=a.Vl(x),a.hc(x)===null&&vl(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&&vl(a,x,y)}Ct.Jo=function(a){if(a===null)return null;var y=this.Ak;return a=y!==null?y(a,this):l0(this,a,!0),Qt(a)&&(En(a),this.lf!==""&&Lo(a,this.lf,void 0),this.mf!==""&&Lo(a,this.mf,void 0),this.je!==""&&Lo(a,this.je,[])),a},Ct.Yu=function(a){if(a===null)return!1;var y=this.jl;return y===""?!1:!!tr(a,y)},Ct.lh=function(a){if(a!==null){var y=this.Je;if(y!==""&&(y=tr(a,y),y!==void 0)){if(Vh(y))return y;Wt("GroupKey value for node data "+a+" is not a number or a string: "+y)}}},Ct.mp=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Je;if(x!=="")if(this.lb(a)){var E=tr(a,x);E!==y&&(yl(this,E,a),Lo(a,x,y),this.hc(y)===null&&vl(this,y,a),pr(this,"nodeGroupKey",No,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Lo(a,x,y)}},Ei.prototype.copyNodeData=function(a){return a===null?null:(a=Ln.prototype.copyNodeData.call(this,a),this.Ij||this.Je===""||tr(a,this.Je)===void 0||Lo(a,this.Je,void 0),a)},Ei.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){Df(this,a,x,!0);return}if(y===this.linkToKeyProperty){Df(this,a,x,!1);return}if(y===this.linkFromPortIdProperty){Of(this,a,x,!0);return}if(y===this.linkToPortIdProperty){Of(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=tr(a,y);E!==x&&(Lo(a,y,x),this.Fs(a,y,E,x))},Ct=Ei.prototype,Ct.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&&tr(a,b)===y[b]||E&&b===this.linkKeyProperty||this.setDataProperty(a,b,y[b])}},Ct.jp=function(a,y){Ln.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(Pa(this,E,!0)===b){var tt=this.lf;Lo(E,tt,z),pr(this,"linkFromKey",No,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)}if(Pa(this,E,!1)===b&&(tt=this.mf,Lo(E,tt,z),pr(this,"linkToKey",No,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)),tt=this.Ef(E),Array.isArray(tt))for(var ot=tt.length,rt=this.je,at=0;at<ot;at++)tt[at]===b&&(tt[at]=z,pr(this,"linkLabelKeys",ir,rt,E,b,z,at,at))}},Ct.qv=function(a,y,x){if(this.lh(a)===y){var E=this.Je;Lo(a,E,x),pr(this,"nodeGroupKey",No,E,a,y,x),typeof E=="string"&&this.La(a,E)}},Ct.Lv=function(){Ln.prototype.Lv.call(this);for(var a=this.linkDataArray,y=a.length,x=0;x<y;x++)cy(this,a[x])},Ct.fm=function(a){Ln.prototype.fm.call(this,a),a=this.wa(a);var y=lp(this,a);if(y!==null){var x=ln();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)){if(this.lh(E)===a){var b=this.Je;pr(this,"nodeGroupKey",No,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}else if(Pa(this,E,!0)===a&&(b=this.lf,pr(this,"linkFromKey",No,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),Pa(this,E,!1)===a&&(b=this.mf,pr(this,"linkToKey",No,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,ot=0;ot<z;ot++)b[ot]===a&&(pr(this,"linkLabelKeys",ir,tt,E,a,a,ot,ot),x.push(E))}for(y=0;y<x.length;y++)yl(this,a,x[y]);Be(x)}},Ct.em=function(a){Ln.prototype.em.call(this,a);var y=this.lh(a);this.hc(y)===null&&vl(this,y,a)},Ct.qp=function(a){Ln.prototype.qp.call(this,a);var y=this.lh(a);yl(this,y,a)},Ct.ps=function(a){if(a===null)return"";var y=this.dj;if(y===""||(y=tr(a,y),y===void 0))return"";if(typeof y=="string")return y;Wt("getCategoryForLinkData found a non-string category for "+a+": "+y)},Ei.prototype.getLinkCategoryForData=function(a){return this.ps(a)},Ei.prototype.lp=function(a,y){if(a!==null){var x=this.dj;if(x!=="")if(this.Jc(a)){var E=tr(a,x);E===void 0&&(E=""),E!==y&&(Lo(a,x,y),pr(this,"linkCategory",No,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Lo(a,x,y)}},Ei.prototype.setLinkCategoryForData=function(a,y){this.lp(a,y)},Ct=Ei.prototype,Ct.lm=function(a,y){Ln.prototype.lm.call(this,a,y),this.mp(y,this.lh(a))};function T1(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))}Ct.Wj=function(){return!0},Ct.ri=function(){return!0},Ct.xs=function(){return!0},Ct.Xj=function(){return!0},oe.Object.defineProperties(Ei.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];Qt(b)||Wt("GraphLinksModel.linkDataArray must only contain Objects, not: "+b),$n(b)}if(this.md=a,this.linkKeyProperty!==""){for(E=new ke,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 Me,b=0;b<x;b++)E.add(a[b]);for(this.$f=E,pr(this,"linkDataArray",No,"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"}}}),Ei.prototype.setCategoryForLinkData=Ei.prototype.lp,Ei.prototype.getCategoryForLinkData=Ei.prototype.ps,Ei.prototype.assignAllDataProperties=Ei.prototype.Do,Ei.prototype.setGroupKeyForNodeData=Ei.prototype.mp,Ei.prototype.getGroupKeyForNodeData=Ei.prototype.lh,Ei.prototype.isGroupForNodeData=Ei.prototype.Yu,Ei.prototype.copyLinkData=Ei.prototype.Jo,Ei.prototype.mergeLinkDataArray=Ei.prototype.Zz,Ei.prototype.removeLinkDataCollection=Ei.prototype.lA,Ei.prototype.removeLinkData=Ei.prototype.bm,Ei.prototype.addLinkDataCollection=Ei.prototype.Ey,Ei.prototype.addLinkData=Ei.prototype.fi,Ei.prototype.containsLinkData=Ei.prototype.Jc,Ei.prototype.makeLinkDataKeyUnique=Ei.prototype.Bs,Ei.prototype.findLinkDataForKey=Ei.prototype.jh,Ei.prototype.setKeyForLinkData=Ei.prototype.Ks,Ei.prototype.getKeyForLinkData=Ei.prototype.Ac,Ei.prototype.removeLabelKeyForLinkData=Ei.prototype.Qx,Ei.prototype.addLabelKeyForLinkData=Ei.prototype.Bu,Ei.prototype.setLabelKeysForLinkData=Ei.prototype.Ls,Ei.prototype.getLabelKeysForLinkData=Ei.prototype.Ef,Ei.prototype.setToPortIdForLinkData=Ei.prototype.Cv,Ei.prototype.getToPortIdForLinkData=Ei.prototype.Cx,Ei.prototype.setFromPortIdForLinkData=Ei.prototype.xv,Ei.prototype.getFromPortIdForLinkData=Ei.prototype.zx,Ei.prototype.setToKeyForLinkData=Ei.prototype.Bv,Ei.prototype.getToKeyForLinkData=Ei.prototype.Bx,Ei.prototype.setFromKeyForLinkData=Ei.prototype.wv,Ei.prototype.getFromKeyForLinkData=Ei.prototype.yx,Ei.prototype.clear=Ei.prototype.clear;var h0=Object.freeze([]);Ei.className="GraphLinksModel",al.GraphLinksModel=Ei,Ln.constructGraphLinksModel=Ln.constructGraphLinksModel=function(){return new Ei},Ln.initDiagramModel=hy=function(){return new Ei};function Ns(a,y){Ln.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",a!==void 0&&(Zt(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}he(Ns,Ln),Ns.constructGraphLinksModel=Ln.constructGraphLinksModel,Ns.prototype.cloneProtected=function(a){Ln.prototype.cloneProtected.call(this,a),a.Ke=this.Ke,a.Nm=this.Nm,a.nj=this.nj},Ct=Ns.prototype,Ct.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)+":"+zn(b)}}return y},Ct.rm=function(){var a=Ln.prototype.rm.call(this),y="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(y+=`,
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),a+y},Ct.gp=function(a){Ln.prototype.gp.call(this,a),a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)},Ct.fp=function(a){a.nodeParentKeyProperty!==void 0&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&Wt("applyIncrementalJson cannot change Model properties"),Ln.prototype.fp.call(this,a)},Ct.Vl=function(a){return a},Ct.mh=function(a){if(a!==null){var y=this.Ke;if(y!==""&&(y=tr(a,y),y!==void 0)){if(Vh(y))return y;Wt("ParentKey value for node data "+a+" is not a number or a string: "+y)}}},Ct.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=tr(a,x);E!==y&&(yl(this,E,a),Lo(a,x,y),this.hc(y)===null&&vl(this,y,a),pr(this,"nodeParentKey",No,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Lo(a,x,y)}},Ct.ss=function(a){if(a===null)return"";var y=this.nj;return y===""||(y=tr(a,y),y===void 0)?"":typeof y=="string"?y:(Wt("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+y),"")},Ns.prototype.getLinkCategoryForData=function(a){return this.ss(a)},Ns.prototype.Ms=function(a,y){if(a!==null){var x=this.nj;if(x!=="")if(this.lb(a)){var E=tr(a,x);E===void 0&&(E=""),E!==y&&(Lo(a,x,y),pr(this,"parentLinkCategory",No,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Lo(a,x,y)}},Ns.prototype.setLinkCategoryForData=function(a,y){this.Ms(a,y)},Ns.prototype.copyNodeData=function(a){return a===null?null:(a=Ln.prototype.copyNodeData.call(this,a),this.Jj||this.Ke===""||tr(a,this.Ke)===void 0||Lo(a,this.Ke,void 0),a)},Ns.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=tr(a,y);E!==x&&(Lo(a,y,x),this.Fs(a,y,E,x))},Ct=Ns.prototype,Ct.jp=function(a,y){Ln.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y)},Ct.qv=function(a,y,x){if(this.mh(a)===y){var E=this.Ke;Lo(a,E,x),pr(this,"nodeParentKey",No,E,a,y,x),typeof E=="string"&&this.La(a,E)}},Ct.fm=function(a){Ln.prototype.fm.call(this,a),a=this.wa(a);var y=lp(this,a);if(y!==null){var x=ln();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)&&this.mh(E)===a){var b=this.Ke;pr(this,"nodeParentKey",No,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}for(y=0;y<x.length;y++)yl(this,a,x[y]);Be(x)}},Ct.em=function(a){Ln.prototype.em.call(this,a);var y=this.mh(a);y=this.Vl(y),this.hc(y)===null&&vl(this,y,a)},Ct.qp=function(a){Ln.prototype.qp.call(this,a);var y=this.mh(a);yl(this,y,a)},Ct.lm=function(a,y){Ln.prototype.lm.call(this,a,y),this.Ms(y,this.ss(a)),this.qe(y,this.mh(a))},Ct.Tl=function(){return!0},Ct.xs=function(){return!0},oe.Object.defineProperties(Ns.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"}}}),Ns.prototype.setParentLinkCategoryForNodeData=Ns.prototype.Ms,Ns.prototype.getParentLinkCategoryForNodeData=Ns.prototype.ss,Ns.prototype.setParentKeyForNodeData=Ns.prototype.qe,Ns.prototype.getParentKeyForNodeData=Ns.prototype.mh,Ns.className="TreeModel",al.TreeModel=Ns;function Io(a){Mo.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=ll,this.Ti=0,this.Zv=new Bt,this.Jp=this.me=0,this.Xr=new gp,this.gt=this.mj=0,this.ty=600,this.eo=NaN,this.Cm=1,this.ro=0,this.ul=360,this.Rb=ll,this.K=Ts,this.nd=Rf,this.hd=oy,this.tf=6,this.Nn=v0,a&&Object.assign(this,a)}he(Io,Mo),Io.prototype.cloneProtected=function(a){Mo.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},Io.prototype.qb=function(a){a.classType===Io?a===p0||a===m0||a===f0||a===g0||a===Rf?this.sorting=a:a===Rd||a===If||a===Ts||a===Yh?this.direction=a:a===nh||a===Uh||a===ll||a===ul?this.arrangement=a:(a===Mc||a===v0)&&(this.nodeDiameterFormula=a):Mo.prototype.qb.call(this,a)},Io.prototype.createNetwork=function(){return new jf(this)},Io.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 ke;y.addAll(a.iterator),a=new ke;var x=new ke,E=this.sort(y),b,z,tt=this.Jp,ot=this.arrangement,rt=this.nodeDiameterFormula,at=this.radius;(!isFinite(at)||0>=at)&&(at=NaN);var ut=this.aspectRatio;(!isFinite(ut)||0>=ut)&&(ut=1);var ft=this.startAngle;isFinite(ft)||(ft=0);var mt=this.sweepAngle;if((!isFinite(mt)||360<mt||1>mt)&&(mt=360),y=this.spacing,isFinite(y)||(y=NaN),ot===ul&&rt===Mc?ot=ll:ot===ul&&rt!==Mc&&(ot=this.arrangement),(this.direction===Rd||this.direction===If)&&this.sorting!==Rf){for(rt=0;!(rt>=E.length)&&(a.add(E.M(rt)),!(rt+1>=E.length));rt+=2)x.add(E.M(rt+1));this.direction===Rd?(this.arrangement===ul&&a.reverse(),E=new ke,E.addAll(a),E.addAll(x)):(this.arrangement===ul&&x.reverse(),E=new ke,E.addAll(x),E.addAll(a))}rt=E.length;for(var yt=z=b=0;yt<E.length;yt++){var xt=ft+mt*z*(this.direction===Ts?1:-1)/rt,Mt=E.M(yt).diameter;isNaN(Mt)&&(Mt=Zh(E.M(yt),xt)),360>mt&&(yt===0||yt===E.length-1)&&(Mt/=2),b+=Mt,z++}if(isNaN(at)||ot===ul){if(isNaN(y)&&(y=6),ot!==ll&&ot!==ul){for(z=-1/0,tt=0;tt<rt;tt++)yt=E.M(tt),b=E.M(tt===rt-1?0:tt+1),isNaN(yt.diameter)&&Zh(yt,0),isNaN(b.diameter)&&Zh(b,0),z=Math.max(z,(yt.diameter+b.diameter)/2);tt=z+y,ot===nh?at=(z+y)/(2*Math.PI/rt):at=d0(this,tt*(360<=mt?rt:rt-1),ut,ft*Math.PI/180,mt*Math.PI/180)}else at=d0(this,b+(360<=mt?rt:rt-1)*(ot!==ul?y:1.6*y),ut,ft*Math.PI/180,mt*Math.PI/180);z=at*ut}else if(z=at*ut,yt=fy(this,at,z,ft*Math.PI/180,mt*Math.PI/180),isNaN(y))(ot===ll||ot===ul)&&(y=(yt-b)/(360<=mt?rt:rt-1));else if(ot===ll||ot===ul)yt=(yt-b)/(360<=mt?rt:rt-1),yt<y?(at=d0(this,b+y*(360<=mt?rt:rt-1),ut,ft*Math.PI/180,mt*Math.PI/180),z=at*ut):y=yt;else{for(tt=-1/0,b=0;b<rt;b++)xt=E.M(b),Mt=E.M(b===rt-1?0:b+1),isNaN(xt.diameter)&&Zh(xt,0),isNaN(Mt.diameter)&&Zh(Mt,0),tt=Math.max(tt,(xt.diameter+Mt.diameter)/2);tt+=y,b=d0(this,tt*(360<=mt?rt:rt-1),ut,ft*Math.PI/180,mt*Math.PI/180),b>at?(at=b,z=at*ut):tt=yt/(360<=mt?rt:rt-1)}if(this.kw=ot,this.lc=at,this.Zm=ut,this.lw=ft,this.Wp=mt,this.Ti=y,this.me=z,this.Jp=tt,y=E,E=this.kw,ot=this.lc,at=this.lw,ut=this.Wp,ft=this.Ti,mt=this.me,rt=this.Jp,this.direction!==Rd&&this.direction!==If||E!==ul)if(this.direction===Rd||this.direction===If){switch(tt=0,E){case Uh:tt=180*c0(this,ot,mt,at,rt)/Math.PI;break;case ll:rt=y=0,tt=a.first(),tt!==null&&(y=Zh(tt,Math.PI/2)),tt=x.first(),tt!==null&&(rt=Zh(tt,Math.PI/2)),tt=180*c0(this,ot,mt,at,ft+(y+rt)/2)/Math.PI;break;case nh:tt=ut/y.length}if(this.direction===Rd){switch(E){case Uh:fp(this,a,at,Yh);break;case ll:cp(this,a,at,Yh);break;case nh:dp(this,a,ut/2,at,Yh)}switch(E){case Uh:fp(this,x,at+tt,Ts);break;case ll:cp(this,x,at+tt,Ts);break;case nh:dp(this,x,ut/2,at+tt,Ts)}}else{switch(E){case Uh:fp(this,x,at,Yh);break;case ll:cp(this,x,at,Yh);break;case nh:dp(this,x,ut/2,at,Yh)}switch(E){case Uh:fp(this,a,at+tt,Ts);break;case ll:cp(this,a,at+tt,Ts);break;case nh:dp(this,a,ut/2,at+tt,Ts)}}}else switch(E){case Uh:fp(this,y,at,this.direction);break;case ll:cp(this,y,at,this.direction);break;case nh:dp(this,y,ut,at,this.direction);break;case ul:A1(this,y,ut,at,this.direction)}else A1(this,y,ut,at-ut/2,Ts)}this.updateParts(),this.network=null,this.isValidLayout=!0};function dp(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 ot=y.length,rt=0;rt<ot;rt++){var at=E+(b===Ts?rt*x/(360<=z?ot:ot-1):-(rt*x)/ot),ut=y.M(rt),ft=tt*Math.tan(at)/a;ft=Math.sqrt((tt*tt+a*a*ft*ft)/(1+ft*ft)),ut.centerX=ft*Math.cos(at),ut.centerY=ft*Math.sin(at),ut.actualAngle=180*at/Math.PI}}function cp(a,y,x,E){var b=a.lc,z=a.me,tt=a.Ti;x=x*Math.PI/180;for(var ot=y.length,rt=0;rt<ot;rt++){var at=y.M(rt),ut=y.M(rt===ot-1?0:rt+1),ft=z*Math.sin(x);at.centerX=b*Math.cos(x),at.centerY=ft,at.actualAngle=180*x/Math.PI,isNaN(at.diameter)&&Zh(at,0),isNaN(ut.diameter)&&Zh(ut,0),at=c0(a,b,z,E===Ts?x:-x,(at.diameter+ut.diameter)/2+tt),x+=E===Ts?at:-at}}function fp(a,y,x,E){var b=a.lc,z=a.me,tt=a.Jp;x=x*Math.PI/180;for(var ot=y.length,rt=0;rt<ot;rt++){var at=y.M(rt);at.centerX=b*Math.cos(x),at.centerY=z*Math.sin(x),at.actualAngle=180*x/Math.PI,at=c0(a,b,z,E===Ts?x:-x,tt),x+=E===Ts?at:-at}}function A1(a,y,x,E,b){var z=a.Wp;if(a.mj=0,a.Xr=new gp,360>x){for(z=E+(b===Ts?z:-z);0>z;)z+=360;z%=360,180<z&&(z-=360),z*=Math.PI/180,a.gt=z,D1(a,y,x,E,b)}else B1(a,y,x,E,b);a.Xr.commit(y)}function B1(a,y,x,E,b){var z=a.lc,tt=a.Ti,ot=a.Zm,rt=z*Math.cos(E*Math.PI/180),at=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=Bt.alloc();for(var ft=0;ft<ut.length&&(ut[ft].centerX=rt,ut[ft].centerY=at,!(ft>=ut.length-1));ft++)O1(a,rt,at,ut,ft,b,z)||I1(a,rt,at,ut,ft,b,z),rt=z.x,at=z.y;if(Bt.free(z),a.mj++,!(23<a.mj)){rt=ut[0].centerX,at=ut[0].centerY,z=ut[ut.length-1].centerX,ft=ut[ut.length-1].centerY;var mt=Math.abs(rt-z)-((ut[0].width+ut[ut.length-1].width)/2+tt),yt=Math.abs(at-ft)-((ut[0].height+ut[ut.length-1].height)/2+tt);tt=0,1>Math.abs(yt)?Math.abs(rt-z)<(ut[0].width+ut[ut.length-1].width)/2&&(tt=0):tt=0<yt?yt:1>Math.abs(mt)?0:mt,rt=Math.abs(z)>Math.abs(ft)?0<z!=at>ft:0<ft!=rt<z,(rt=b===Ts?rt:!rt)&&(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*ot,B1(a,y,x,E,b))}}}function D1(a,y,x,E,b){for(var z=a.lc,tt=a.me,ot=a.Zm,rt=z*Math.cos(E*Math.PI/180),at=tt*Math.sin(E*Math.PI/180),ut=Bt.alloc(),ft=y.Fa(),mt=0;mt<ft.length&&(ft[mt].centerX=rt,ft[mt].centerY=at,!(mt>=ft.length-1));mt++)O1(a,rt,at,ft,mt,b,ut)||I1(a,rt,at,ft,mt,b,ut),rt=ut.x,at=ut.y;if(Bt.free(ut),a.mj++,!(23<a.mj)){if(rt=Math.atan2(at,rt),rt=b===Ts?a.gt-rt:rt-a.gt,rt=Math.abs(rt)<Math.abs(rt-2*Math.PI)?rt:rt-2*Math.PI,z=rt*(z+tt)/2,tt=a.Xr,Math.abs(z)<Math.abs(tt.Pl))for(tt.Pl=z,tt.mk=[],tt.tm=[],rt=0;rt<ft.length;rt++)tt.mk[rt]=ft[rt].bounds.x,tt.tm[rt]=ft[rt].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*ot,D1(a,y,x,E,b))}}function O1(a,y,x,E,b,z,tt){var ot=a.lc,rt=a.me,at=0;a=(E[b].width+E[b+1].width)/2+a.Ti;var ut=!1;if(0<=x!=(z===Ts)){if(z=y+a,z>ot){if(z=y-a,z<-ot)return tt.x=z,tt.y=at,!1;ut=!0}}else if(z=y-a,z<-ot){if(z=y+a,z>ot)return tt.x=z,tt.y=at,!1;ut=!0}return at=Math.sqrt(1-Math.min(1,z*z/(ot*ot)))*rt,0>x!==ut&&(at=-at),Math.abs(x-at)>(E[b].height+E[b+1].height)/2?(tt.x=z,tt.y=at,!1):(tt.x=z,tt.y=at,!0)}function I1(a,y,x,E,b,z,tt){var ot=a.lc,rt=a.me,at=0;if(a=(E[b].height+E[b+1].height)/2+a.Ti,E=!1,0<=y!=(z===Ts)){if(z=x-a,z<-rt){if(z=x+a,z>rt){tt.x=at,tt.y=z;return}E=!0}}else if(z=x+a,z>rt){if(z=x-a,z<-rt){tt.x=at,tt.y=z;return}E=!0}at=Math.sqrt(1-Math.min(1,z*z/(rt*rt)))*ot,0>y!==E&&(at=-at),tt.x=at,tt.y=z}Io.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},Io.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 Bt(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))},Io.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,ot=E!==void 0&&b!==void 0?b/(z+1):Math.PI/(2*(z+1)),rt=0,at=0;at<=z;at++){E!==void 0&&b!==void 0?rt=E+at*b/z:rt=at*Math.PI/(2*z);var ut=Math.sin(rt);tt+=Math.sqrt(1-a*a*ut*ut)*ot}return E!==void 0&&b!==void 0?(y>x?y:x)*tt:4*(y>x?y:x)*tt}function d0(a,y,x,E,b){return y/(E!==void 0&&b!==void 0?fy(a,1,x,E,b):fy(a,1,x))}function c0(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 ot=0;;ot++){var rt=Math.sin(E+ot*a);if(tt+=(y>x?y:x)*Math.sqrt(1-z*z*rt*rt)*a,tt>=b)return ot*a}}Io.prototype.sort=function(a){switch(this.sorting){case f0:break;case g0:a.reverse();break;case p0:a.sort(this.comparer);break;case m0:a.sort(this.comparer),a.reverse();break;case Rf:return this.ak(Bx(a));default:Wt("Invalid sorting type.")}return a};function Bx(a){for(var y=[],x=0;x<a.length;x++)y.push(0);x=new ke;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 ot=a.M(tt).edgesCount;ot>b&&(b=ot,z=tt)}else for(tt=0;tt<a.length;tt++)ot=y[tt],ot>b&&(b=ot,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}Io.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=[],ot=[];E=[],b=new ke;for(var rt=0,at=0;at<y.length;at++){var ut=y[at].length;if(ut===1)E.push(at);else if(ut===0)b.add(a.M(at));else{if(rt===0)x.push(at);else{for(var ft=ut=1/0,mt=-1,yt=[],xt=0;xt<x.length;xt++)0>y[x[xt]].indexOf(x[xt===x.length-1?0:xt+1])&&yt.push(xt===x.length-1?0:xt+1);if(yt.length===0)for(xt=0;xt<x.length;xt++)yt.push(xt);for(xt=0;xt<yt.length;xt++){for(var Mt=yt[xt],It=y[at],Tt=0,zt=0;zt<tt.length;zt++){var Ht=z[tt[zt]],Vt=z[ot[zt]];if(Ht<Vt){var Xt=Ht;Ht=Vt}else Xt=Vt;if(Xt<Mt&&Mt<=Ht)for(Vt=0;Vt<It.length;Vt++){var le=It[Vt];0>x.indexOf(le)||Xt<z[le]&&z[le]<Ht||Xt===z[le]||Ht===z[le]||Tt++}else for(Vt=0;Vt<It.length;Vt++)le=It[Vt],0>x.indexOf(le)||Xt<z[le]&&z[le]<Ht&&Xt!==z[le]&&Ht!==z[le]&&Tt++}for(It=Tt,zt=Tt=0;zt<y[at].length;zt++)Xt=x.indexOf(y[at][zt]),0<=Xt&&(Xt=Math.abs(Mt-(Xt>=Mt?Xt+1:Xt)),Tt+=Xt<x.length+1-Xt?Xt:x.length+1-Xt);for(zt=0;zt<tt.length;zt++)Xt=z[tt[zt]],Ht=z[ot[zt]],Xt>=Mt&&Xt++,Ht>=Mt&&Ht++,Xt>Ht&&(Vt=Ht,Ht=Xt,Xt=Vt),Ht-Xt<(x.length+2)/2==(Xt<Mt&&Mt<=Ht)&&Tt++;(It<ut||It===ut&&Tt<ft)&&(ut=It,ft=Tt,mt=Mt)}for(x.splice(mt,0,at),ut=0;ut<x.length;ut++)z[x[ut]]=ut;for(ut=0;ut<y[at].length;ut++)ft=y[at][ut],0<=x.indexOf(ft)&&(tt.push(at),ot.push(ft))}rt++}}for(tt=x.length;;){for(z=!0,ot=0;ot<E.length;ot++)if(rt=E[ot],at=y[rt][0],ut=x.indexOf(at),0<=ut){for(mt=ft=0;mt<y[at].length;mt++)yt=x.indexOf(y[at][mt]),0>yt||yt===ut||(xt=yt>ut?yt-ut:ut-yt,ft+=yt<ut!=xt>tt-xt?1:-1);x.splice(0>ft?ut:ut+1,0,rt),E.splice(ot,1),ot--}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},oe.Object.defineProperties(Io.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!==ul&&a!==ll&&a!==Uh&&a!==nh||(this.Rb=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==Ts&&a!==Yh&&a!==Rd&&a!==If||(this.K=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==f0&&a!==g0&&a!==p0&&!m0&&a!==Rf||(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!==v0&&a!==Mc||(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 ll=new Se(Io,"ConstantSpacing",0),Uh=new Se(Io,"ConstantDistance",1),nh=new Se(Io,"ConstantAngle",2),ul=new Se(Io,"Packed",3),Ts=new Se(Io,"Clockwise",4),Yh=new Se(Io,"Counterclockwise",5),Rd=new Se(Io,"BidirectionalLeft",6),If=new Se(Io,"BidirectionalRight",7),f0=new Se(Io,"Forwards",8),g0=new Se(Io,"Reverse",9),p0=new Se(Io,"Ascending",10),m0=new Se(Io,"Descending",11),Rf=new Se(Io,"Optimized",12),v0=new Se(Io,"Pythagorean",13),Mc=new Se(Io,"Circular",14);Io.className="CircularLayout",Io.ConstantSpacing=ll,Io.ConstantDistance=Uh,Io.ConstantAngle=nh,Io.Packed=ul,Io.Clockwise=Ts,Io.Counterclockwise=Yh,Io.BidirectionalLeft=Rd,Io.BidirectionalRight=If,Io.Forwards=f0,Io.Reverse=g0,Io.Ascending=p0,Io.Descending=m0,Io.Optimized=Rf,Io.Pythagorean=v0,Io.Circular=Mc;function gp(){this.Pl=-1/0,this.tm=this.mk=null}gp.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},gp.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]}},gp.className="VertexArrangement";function jf(a){ho.call(this,a)}he(jf,ho),jf.prototype.createVertex=function(){return new pp(this)},jf.prototype.createEdge=function(){return new y0(this)},jf.className="CircularNetwork";function pp(a){yr.call(this,a),this.u=this.Si=NaN}he(pp,yr);function Zh(a,y){var x=a.network;if(x===null)return NaN;if(x=x.layout,x===null)return NaN;if(x.arrangement===ul)if(x.nodeDiameterFormula===Mc)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===Mc?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.Si}oe.Object.defineProperties(pp.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)}}}),pp.className="CircularVertex";function y0(a){aa.call(this,a)}he(y0,aa),y0.className="CircularEdge";function Qr(a){Mo.call(this),this.ah=null,this.An=0,this.$d=new Qe(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)}he(Qr,Mo),Qr.prototype.cloneProtected=function(a){Mo.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},Qr.prototype.createNetwork=function(){return new Ec(this)},Qr.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}R1(this,0,a)}this.network=y;var tt=E=x.iterator;E=this.arrangementSpacing;var ot=tt.count,rt=!0;z=b=0;for(var at=ln(),ut=0;ut<ot+y.vertexes.count+2;ut++)at[ut]=null;ot=0,tt.reset();for(var ft=Ce.alloc();tt.next();)if(ut=tt.value,this.computeBounds(ut,ft),rt)rt=!1,b=ft.x+ft.width/2,z=ft.y+ft.height/2,at[0]=new Bt(ft.x+ft.width+E.width,ft.y),at[1]=new Bt(ft.x,ft.y+ft.height+E.height),ot=2;else{var mt=j1(at,ot,b,z,ft.width,ft.height,E),yt=at[mt],xt=new Bt(yt.x+ft.width+E.width,yt.y),Mt=new Bt(yt.x,yt.y+ft.height+E.height);for(mt+1<ot&&at.splice(mt+1,0,null),at[mt]=xt,at[mt+1]=Mt,ot++,mt=yt.x-ft.x,yt=yt.y-ft.y,ut=ut.vertexes.iterator;ut.next();)xt=ut.value,xt.centerX+=mt,xt.centerY+=yt}for(Ce.free(ft),ut=y.vertexes.iterator;ut.next();)tt=ut.value,mt=tt.bounds,2>ot?(b=mt.x+mt.width/2,z=mt.y+mt.height/2,at[0]=new Bt(mt.x+mt.width+E.width,mt.y),at[1]=new Bt(mt.x,mt.y+mt.height+E.height),ot=2):(rt=j1(at,ot,b,z,mt.width,mt.height,E),ft=at[rt],yt=new Bt(ft.x+mt.width+E.width,ft.y),mt=new Bt(ft.x,ft.y+mt.height+E.height),rt+1<ot&&at.splice(rt+1,0,null),at[rt]=yt,at[rt+1]=mt,ot++,tt.centerX=ft.x+tt.width/2,tt.centerY=ft.y+tt.height/2);for(Be(at),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)}}z1(this,a),this.updateParts()}this.dl=a,this.network=null,this.isValidLayout=!0},Qr.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},Qr.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 R1(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,R1(a,y+1,x),z1(a,z),Ix(a,b),y=b.vertexes.Fa(),y.sort(function(tt,ot){return tt===null||ot===null||tt===ot?0:ot.Vd-tt.Vd}),x=0;x<y.length;x++)Rx(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 Ec(a),b=0;b<a.ah.length;b++){var z=a.ah[b];if(1<z.Vd){E.dh(z);var tt=new G1;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 ke),z.We.add(tt),z.sv=z.We.count-1}else break}for(z=x.edges.iterator;z.next();){var ot=z.value;b=ot.fromVertex,tt=ot.toVertex,b.network===E&&tt.network===E?E.Bo(ot):b.network===E?(ot=b.Hj,ot===null&&(ot=new ke,b.Hj=ot),ot.add(tt),b.Vd--,b.sh+=tt.sh):tt.network===E&&(ot=tt.Hj,ot===null&&(ot=new ke,tt.Hj=ot),ot.add(b),tt.Vd--,tt.sh+=b.sh)}for(b=E.edges.iterator;b.next();)z=b.value,z.length*=Math.max(1,qt.sqrt((z.fromVertex.sh+z.toVertex.sh)/(4*y+1)));for(y=E.vertexes.iterator;y.next();){b=y.value;var rt=b.Hj;if(rt!==null&&0<rt.count&&(tt=b.We.M(b.We.count-1).Rs-b.Vd,!(0>=tt))){for(var at=ot=0,ut=rt.count-tt;ut<rt.count;ut++){var ft=rt.M(ut),mt=null;for(z=ft.edges.iterator;z.next();){var yt=z.value;if(yt.Ax(ft)===b){mt=yt;break}}mt!==null&&(at+=mt.length,ot+=ft.width*ft.height)}z=b.centerX,rt=b.centerY,ut=b.width,ft=b.height,mt=b.focus,yt=ut*ft,1>yt&&(yt=1),ot=qt.sqrt((ot+yt+at*at*4/(tt*tt))/yt),tt=(ot-1)*ut/2,ot=(ot-1)*ft/2,b.bounds=new Ce(z-mt.x-tt,rt-mt.y-ot,ut+2*tt,ft+2*ot),b.focus=new Bt(mt.x+tt,mt.y+ot)}}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 Ce(E.centerX-z,E.centerY-tt,b.Ss,b.Qs),E.focus=new Bt(z,tt),E.sv--}}for(x=a.network.edges.iterator;x.next();)x.value.network=y;a.network=y}function Rx(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=qt.sqrt(z*z+tt*tt)/2;for(var ot=!1,rt=tt=0,at=0,ut=y.vertexes.iterator;ut.next();){var ft=ut.value;1>=ft.Vd?rt++:(ot=!0,at++,tt+=Math.atan2(y.centerY-ft.centerY,y.centerX-ft.centerX))}if(rt!==0){for(0<at&&(tt/=at),at=y=0,y=ot?2*Math.PI/(rt+1):2*Math.PI/rt,rt%2===0&&(at=y/2),1<x.count&&x.sort(function(yt,xt){return yt===null||xt===null||yt===xt?0:xt.width*xt.height-yt.width*yt.height}),ot=rt%2===0?0:1,x=x.iterator;x.next();)if(rt=x.value,!(1<rt.Vd||a.isFixed(rt))){for(ut=null,ft=rt.edges.iterator;ft.next();){ut=ft.value;break}ft=rt.width;var mt=rt.height;ft=qt.sqrt(ft*ft+mt*mt)/2,ut=z+ut.length+ft,ft=tt+(y*(ot/2>>1)+at)*(ot%2===0?1:-1),rt.centerX=E+ut*Math.cos(ft),rt.centerY=b+ut*Math.sin(ft),ot++}}}}function j1(a,y,x,E,b,z,tt){var ot=9e19,rt=-1,at=0;t:for(;at<y;at++){var ut=a[at],ft=ut.x-x,mt=ut.y-E;if(ft=ft*ft+mt*mt,ft<ot){for(mt=at-1;0<=mt;mt--)if(a[mt].y>ut.y&&a[mt].x-ut.x<b+tt.width)continue t;for(mt=at+1;mt<y;mt++)if(a[mt].x>ut.x&&a[mt].y-ut.y<z+tt.height)continue t;rt=at,ot=ft}}return rt}Qr.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},Qr.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 _1(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 ot=z.width;return z=z.height,E+b<tt?a>y+z?(x=E+b-tt,a=a-y-z,qt.sqrt(x*x+a*a)):a+x<y?(E=E+b-tt,a=a+x-y,qt.sqrt(E*E+a*a)):tt-(E+b):E>tt+ot?a>y+z?(x=E-tt-ot,a=a-y-z,qt.sqrt(x*x+a*a)):a+x<y?(E=E-tt-ot,a=a+x-y,qt.sqrt(E*E+a*a)):E-(tt+ot):a>y+z?a-(y+z):a+x<y?y-(a+x):.1}function z1(a,y){for(a.ah=null,y=a.An+y;a.An<y&&(a.An++,jx(a)););a.ah=null}function jx(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 ot=y[tt];ot.forceX=0,ot.forceY=0;var rt=ot.centerX;ot=ot.centerY,E=Math.min(E,rt),b=Math.max(b,rt),x=Math.min(x,ot),z=Math.max(z,ot)}(b=b-E>z-x)?y.sort(function(Mt,It){return Mt===null||It===null||Mt===It?0:Mt.centerX-It.centerX}):y.sort(function(Mt,It){return Mt===null||It===null||Mt===It?0:Mt.centerY-It.centerY}),x=a.Zf;var at=E=ot=0;for(z=0;z<y.length;z++){tt=y[z],E=tt.bounds,ot=tt.focus,rt=E.x+ot.x;var ut=E.y+ot.y;E=tt.charge*a.electricalFieldX(rt,ut),at=tt.charge*a.electricalFieldY(rt,ut),E+=tt.mass*a.gravitationalFieldX(rt,ut),at+=tt.mass*a.gravitationalFieldY(rt,ut),tt.forceX+=E,tt.forceY+=at;for(var ft=z+1;ft<y.length;ft++){var mt=y[ft];if(mt!==tt){E=mt.bounds,ot=mt.focus,at=E.x+ot.x;var yt=E.y+ot.y;if(rt-at>x||at-rt>x){if(b)break}else if(ut-yt>x||yt-ut>x){if(!b)break}else{var xt=_1(tt,mt);1>xt?(E=a.randomNumberGenerator,E===null&&(a.randomNumberGenerator=E=new S0),xt=E.random(),ot=E.random(),rt>at?(E=Math.abs(mt.bounds.right-tt.bounds.x),E=(1+E)*xt):rt<at?(E=Math.abs(mt.bounds.x-tt.bounds.right),E=-(1+E)*xt):(E=Math.max(mt.width,tt.width),E=(1+E)*xt-E/2),ut>yt?(at=Math.abs(mt.bounds.bottom-tt.bounds.y),at=(1+at)*ot):rt<at?(at=Math.abs(mt.bounds.y-tt.bounds.bottom),at=-(1+at)*ot):(at=Math.max(mt.height,tt.height),at=(1+at)*ot-at/2)):(ot=-(tt.charge*mt.charge)/(xt*xt),E=(at-rt)/xt*ot,at=(yt-ut)/xt*ot),tt.forceX+=E,tt.forceY+=at,mt.forceX-=E,mt.forceY-=at}}}}for(b=a.network.edges.iterator;b.next();)ot=b.value,x=ot.fromVertex,z=ot.toVertex,tt=x.bounds,rt=x.focus,E=tt.x+rt.x,tt=tt.y+rt.y,ut=z.bounds,ft=z.focus,rt=ut.x+ft.x,ut=ut.y+ft.y,ft=_1(x,z),1>ft?(ft=a.randomNumberGenerator,ft===null&&(a.randomNumberGenerator=ft=new S0),ot=ft.random(),ft=ft.random(),E=(E>rt?1:-1)*(1+(z.width>x.width?z.width:x.width))*ot,at=(tt>ut?1:-1)*(1+(z.height>x.height?z.height:x.height))*ft):(ot=ot.stiffness*(ft-ot.length),E=(rt-E)/ft*ot,at=(ut-tt)/ft*ot),x.forceX+=E,x.forceY+=at,z.forceX-=E,z.forceY-=at;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}Qr.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},Qr.prototype.moveFixedVertex=function(){},Qr.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},Qr.prototype.yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var y=a.value.link;y!==null&&(y.fromSpot=Fr,y.toSpot=Fr)}},Qr.prototype.commitNodes=function(){var a=0,y=0;if(this.arrangesToOrigin){var x=Ce.alloc();this.computeBounds(this.network,x),y=this.arrangementOrigin,a=y.x-x.x,y=y.y-x.y,Ce.free(x)}x=Ce.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()}Ce.free(x)},Qr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},Qr.prototype.springStiffness=function(a){return a=a.stiffness,isNaN(a)?this.Hk:a},Qr.prototype.springLength=function(a){return a=a.length,isNaN(a)?this.Gk:a},Qr.prototype.electricalCharge=function(a){return a=a.charge,isNaN(a)?this.Ek:a},Qr.prototype.electricalFieldX=function(){return 0},Qr.prototype.electricalFieldY=function(){return 0},Qr.prototype.gravitationalMass=function(a){return a=a.mass,isNaN(a)?this.Fk:a},Qr.prototype.gravitationalFieldX=function(){return 0},Qr.prototype.gravitationalFieldY=function(){return 0},Qr.prototype.isFixed=function(a){return a.isFixed},oe.Object.defineProperties(Qr.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"&&Wt('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())}}}),Qr.className="ForceDirectedLayout";function G1(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}G1.className="ForceDirectedSubnet";function Ec(a){ho.call(this,a)}he(Ec,ho),Ec.prototype.createVertex=function(){return new mp(this)},Ec.prototype.createEdge=function(){return new vp(this)},Ec.className="ForceDirectedNetwork";function mp(a){yr.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}he(mp,yr),oe.Object.defineProperties(mp.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)}}}),mp.className="ForceDirectedVertex";function vp(a){aa.call(this,a),this.j=this.o=NaN}he(vp,aa),oe.Object.defineProperties(vp.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)}}}),vp.className="ForceDirectedEdge";function S0(){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()}S0.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},S0.className="RandomNumberGenerator";function $i(a){Mo.call(this),this.kc=this.ie=25,this.K=0,this.Dk=L0,this.Zk=k0,this.Qk=M0,this.bj=4,this.rk=E0,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 Bt,this.He=[],this.He.length=100,this.xw=this.ve=0,a&&Object.assign(this,a)}he($i,Mo),$i.prototype.cloneProtected=function(a){Mo.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},$i.prototype.qb=function(a){a.classType===$i?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:Wt("Unknown enum value: "+a):Mo.prototype.qb.call(this,a)},$i.prototype.createNetwork=function(){return new zf(this)},$i.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!==Sp&&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===Sp&&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,ot=0,rt=0,at=0;if(E.link!==null){if(ot=E.link,ot===null)continue;var ut=b.node;if(tt=z.node,ut===null||tt===null)continue;var ft=ot.fromNode;rt=ot.toNode;for(var mt=ot.fromPort;mt!==null&&!mt.Ed();)mt=mt.panel;for(ot=ot.toPort;ot!==null&&!ot.Ed();)ot=ot.panel;if(E.rev){at=ft;var yt=mt;ft=rt,mt=ot,rt=at,ot=yt}var xt=b.focus;at=z.focus;var Mt=E.rev?z.bounds:b.bounds;yt=Bt.alloc(),ut!==ft?Mt.w()&&ft.isVisible()?ft.actualBounds.w()?(Qu(ft,mt,ji,yt),yt.x+=ft.actualBounds.x-Mt.x,yt.y+=ft.actualBounds.y-Mt.y):(Qu(ft,mt,ji,yt),yt.w()||yt.assign(xt)):yt.assign(xt):Mt.w()?(Qu(ft,mt,ji,yt),yt.w()||yt.assign(xt)):yt.assign(xt),ft=E.rev?b.bounds:z.bounds,ut=Bt.alloc(),tt!==rt?ft.w()&&rt.isVisible()?rt.actualBounds.w()?(Qu(rt,ot,ji,ut),ut.x+=rt.actualBounds.x-ft.x,ut.y+=rt.actualBounds.y-ft.y):(Qu(rt,ot,ji,ut),ut.w()||ut.assign(at)):ut.assign(at):ft.w()?(Qu(rt,ot,ji,ut),ut.w()||ut.assign(at)):ut.assign(at),this.K===90||this.K===270?(tt=Math.round((yt.x-xt.x)/this.kc),rt=yt.x,ot=Math.round((ut.x-at.x)/this.kc),at=ut.x):(tt=Math.round((yt.y-xt.y)/this.kc),rt=yt.y,ot=Math.round((ut.y-at.y)/this.kc),at=ut.y),Bt.free(yt),Bt.free(ut),E.portFromColOffset=tt,E.portFromPos=rt,E.portToColOffset=ot,E.portToPos=at}else E.portFromColOffset=0,E.portFromPos=0,E.portToColOffset=0,E.portToPos=0;if(yt=b.layer,ut=z.layer,ft=0,Mt=E.link,Mt!==null){var It=Mt.fromPort,Tt=Mt.toPort;if(It!==null&&Tt!==null){var zt=Mt.fromNode;if(mt=Mt.toNode,zt!==null&&mt!==null){var Ht=C0(this,!0),Vt=C0(this,!1),Xt=this.setsPortSpots?Ht:Mt.computeSpot(!0,It);xt=this.setsPortSpots?Vt:Mt.computeSpot(!1,Tt);var le=Mt.isOrthogonal;Xt.$c()&&Xt.Hf(Vt)&&xt.$c()&&xt.Hf(Ht)?ft=0:(Ht=Mt.getLinkPoint(zt,It,Xt,!0,le,mt,Tt,Bt.alloc()),Vt=Mt.getLinkDirection(zt,It,Ht,Xt,!0,le,mt,Tt),Bt.free(Ht),Xt.ys()||Vt!==J1(this,E,!0)?this.setsPortSpots&&zt!==null&&zt.ports.count===1&&E.rev&&(ft+=1):ft+=1,Xt=Mt.getLinkPoint(mt,Tt,xt,!1,le,zt,It,Bt.alloc()),Mt=Mt.getLinkDirection(mt,Tt,Xt,xt,!1,le,zt,It),Bt.free(Xt),xt.ys()||Mt!==J1(this,E,!1)?this.setsPortSpots&&mt!==null&&mt.ports.count===1&&E.rev&&(ft+=2):ft+=2)}}}if(mt=ft,ft=mt===1||mt===3,(mt=mt===2||mt===3)&&(xt=a.createVertex(),xt.node=null,xt.Dj=1,xt.layer=yt,xt.near=b,a.dh(xt),b=a.Zj(b,xt,E.link),b.valid=!1,b.rev=E.rev,b.portFromColOffset=tt,b.portToColOffset=0,b.portFromPos=rt,b.portToPos=0,b=xt),Mt=1,ft&&Mt--,yt-ut>Mt&&0<yt){for(E.valid=!1,xt=a.createVertex(),xt.node=null,xt.Dj=2,xt.layer=yt-1,a.dh(xt),b=a.Zj(b,xt,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=mt?0:tt,b.portToColOffset=0,b.portFromPos=mt?0:rt,b.portToPos=0,b=xt,yt--;yt-ut>Mt&&0<yt;)xt=a.createVertex(),xt.node=null,xt.Dj=3,xt.layer=yt-1,a.dh(xt),b=a.Zj(b,xt,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=0,b.portFromPos=0,b.portToPos=0,b=xt,yt--;b=a.Zj(xt,z,E.link),b.valid=!ft,ft&&(xt.near=z),b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=ot,b.portFromPos=0,b.portToPos=at}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=Kh(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),Xh(this,a,y)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},$i.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}$i.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},$i.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 Us(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 Da(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 H1(a,y,x){var E=Kh(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 ot=0,rt=E[tt],at=rt.near;if(at!==null&&at.layer===rt.layer)if(rt=at.index,rt>tt)for(var ut=tt+1;ut<rt;ut++){var ft=E[ut];ft.near===at&&ft.Dj===at.Dj||ot++}else for(ut=tt-1;ut>rt;ut--)ft=E[ut],ft.near===at&&ft.Dj===at.Dj||ot++;var mt;if(0<=x)for(rt=E[tt].sourceEdgesArrayAccess,at=0;at<rt.length;at++){var yt=rt[at];if(yt.valid&&yt.fromVertex.layer!==y)for(ft=yt.fromVertex.index,ut=yt.portToPos,yt=yt.portFromPos,mt=at+1;mt<rt.length;mt++){var xt=rt[mt];if(xt.valid&&xt.fromVertex.layer!==y){var Mt=xt.fromVertex.index,It=xt.portToPos;xt=xt.portFromPos,ut<It&&(ft>Mt||ft===Mt&&yt>xt)&&ot++,It<ut&&(Mt>ft||Mt===ft&&xt>yt)&&ot++}}}if(0>=x){for(rt=E[tt].destinationEdgesArrayAccess,at=0;at<rt.length;at++)if(yt=rt[at],yt.valid&&yt.toVertex.layer!==y)for(ft=yt.toVertex.index,ut=yt.portToPos,yt=yt.portFromPos,mt=at+1;mt<rt.length;mt++)xt=rt[mt],xt.valid&&xt.toVertex.layer!==y&&(Mt=xt.toVertex.index,It=xt.portToPos,xt=xt.portFromPos,yt<xt&&(ft>Mt||ft===Mt&&ut>It)&&ot++,xt<yt&&(Mt>ft||Mt===ft&&It>ut)&&ot++)}for(z[tt*b+tt]=ot,rt=tt+1;rt<b;rt++){var Tt=0,zt=0;if(0<=x){ot=E[tt].sourceEdgesArrayAccess;var Ht=E[rt].sourceEdgesArrayAccess;for(at=0;at<ot.length;at++)if(yt=ot[at],yt.valid&&yt.fromVertex.layer!==y)for(ft=yt.fromVertex.index,yt=yt.portFromPos,mt=0;mt<Ht.length;mt++)xt=Ht[mt],xt.valid&&xt.fromVertex.layer!==y&&(Mt=xt.fromVertex.index,xt=xt.portFromPos,(ft<Mt||ft===Mt&&yt<xt)&&zt++,(Mt<ft||Mt===ft&&xt<yt)&&Tt++)}if(0>=x){for(ot=E[tt].destinationEdgesArrayAccess,Ht=E[rt].destinationEdgesArrayAccess,at=0;at<ot.length;at++)if(yt=ot[at],yt.valid&&yt.toVertex.layer!==y)for(ft=yt.toVertex.index,ut=yt.portToPos,mt=0;mt<Ht.length;mt++)xt=Ht[mt],xt.valid&&xt.toVertex.layer!==y&&(Mt=xt.toVertex.index,It=xt.portToPos,(ft<Mt||ft===Mt&&ut<It)&&zt++,(Mt<ft||Mt===ft&&It<ut)&&Tt++)}z[tt*b+rt]=Tt,z[rt*b+tt]=zt}}return Xh(a,y,E),z}$i.prototype.countCrossings=function(){for(var a=0,y=0;y<=this.Ia;y++)for(var x=H1(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 x0(a){for(var y=0,x=0;x<=a.Ia;x++){for(var E=a,b=x,z=Kh(E,b),tt=E.tc[b],ot=0,rt=0;rt<tt;rt++){var at=z[rt].destinationEdgesArrayAccess;if(at!==null)for(var ut=0;ut<at.length;ut++){var ft=at[ut];if(ft.valid&&ft.toVertex.layer!==b){var mt=ft.fromVertex.column+ft.portFromColOffset,yt=ft.toVertex.column+ft.portToColOffset;ot+=(Math.abs(mt-yt)+1)*gy(ft)}}}Xh(E,b,z),y+=ot}return y}$i.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=Kh(a,y),b=a.tc[y],z=[],tt=0;tt<b;tt++){var ot=E[tt],rt=null;0>=x&&(rt=ot.sourceEdgesArrayAccess);var at=null;0<=x&&(at=ot.destinationEdgesArrayAccess);var ut=0,ft=0,mt=ot.near;if(mt!==null&&mt.layer===ot.layer&&(ut+=mt.column-1,ft++),rt!==null)for(mt=0;mt<rt.length;mt++){ot=rt[mt];var yt=ot.fromVertex;ot.valid&&!ot.rev&&yt.layer!==y&&(ut+=yt.column,ft++)}if(at!==null)for(rt=0;rt<at.length;rt++)ot=at[rt],mt=ot.toVertex,ot.valid&&!ot.rev&&mt.layer!==y&&(ut+=mt.column,ft++);z[tt]=ft===0?-1:ut/ft}return Xh(a,y,E),z}function W1(a,y,x){for(var E=Kh(a,y),b=a.tc[y],z=[],tt=0;tt<b;tt++){var ot=E[tt],rt=null;0>=x&&(rt=ot.sourceEdgesArrayAccess);var at=null;0<=x&&(at=ot.destinationEdgesArrayAccess);var ut=0,ft=[],mt=ot.near;if(mt!==null&&mt.layer===ot.layer&&(ft[ut]=mt.column-1,ut++),ot=void 0,rt!==null)for(mt=0;mt<rt.length;mt++){ot=rt[mt];var yt=ot.fromVertex;ot.valid&&!ot.rev&&yt.layer!==y&&(ft[ut]=yt.column+ot.portFromColOffset,ut++)}if(at!==null)for(rt=0;rt<at.length;rt++)ot=at[rt],mt=ot.toVertex,ot.valid&&!ot.rev&&mt.layer!==y&&(ft[ut]=mt.column+ot.portToColOffset,ut++);ut===0?z[tt]=-1:(ft.sort(function(xt,Mt){return xt-Mt}),at=ut>>1,z[tt]=ut&1?ft[at]:ft[at-1]+ft[at]>>1)}return Xh(a,y,E),z}function yp(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var tt=y.destinationEdges;tt.next();){var ot=tt.value,rt=ot.toVertex,at=y.layer-rt.layer;ot=a.linkMinLength(ot),at===ot&&yp(a,rt,x,E,b,z)}if(z)for(tt=y.sourceEdges;tt.next();)ot=tt.value,rt=ot.fromVertex,at=rt.layer-y.layer,ot=a.linkMinLength(ot),at===ot&&yp(a,rt,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)}}$i.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(;_x(a)!==null;){for(b=V1(a);b!==null;)E[x]=b,x--,b.valid=!1,b=V1(a);for(b=U1(a);b!==null;)E[y]=b,y++,b.valid=!1,b=U1(a);b=null;for(var z=0,tt=this.network.vertexes.iterator;tt.next();){var ot=tt.value;if(ot.valid){for(var rt=0,at=ot.destinationEdges;at.next();)at.value.toVertex.valid&&rt++;at=0;for(var ut=ot.sourceEdges;ut.next();)ut.value.fromVertex.valid&&at++;(b===null||z<rt-at)&&(b=ot,z=rt-at)}}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 L0: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 Sp: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 _x(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid)return y}return null}function V1(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 U1(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++}$i.prototype.assignLayers=function(){switch(this.Zk){case xy:Y1(this);break;case wy:for(var a,y=this.network.vertexes.iterator;y.next();)a=K1(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(Y1(this),y=this.network.vertexes.iterator;y.next();)y.value.valid=!1;for(y.reset();y.next();)a=y.value,a.sourceEdges.count===0&&X1(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 Y1(a){for(var y=a.network.vertexes.iterator;y.next();){var x=Z1(a,y.value);a.Ia=Math.max(x,a.Ia)}}function Z1(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,Z1(a,z)+b)}y.layer=x}else x=y.layer;return x}function K1(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,K1(a,z)+b)}y.layer=x}else x=y.layer;return x}function X1(a,y){if(!y.valid){y.valid=!0;for(var x=y.destinationEdges;x.next();)X1(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],ot=tt.fromVertex,rt=tt.toVertex;tt=a.linkMinLength(tt),ot.layer-rt.layer>tt&&yp(a,ot,0,-1,!0,!1)}for(yp(a,y,1,-1,!0,!0);y.component!==0;){for(z=0,E=1/0,ot=0,rt=null,tt=a.network.vertexes.iterator;tt.next();){var at=tt.value;if(at.component===1){var ut=0,ft=!1,mt=at.sourceEdgesArrayAccess;b=mt.length;for(var yt=0;yt<b;yt++){var xt=mt[yt],Mt=xt.fromVertex;ut+=1,Mt.component!==1&&(z+=1,Mt=Mt.layer-at.layer,xt=a.linkMinLength(xt),E=Math.min(E,Mt-xt))}for(mt=at.destinationEdgesArrayAccess,b=mt.length,yt=0;yt<b;yt++)xt=mt[yt].toVertex,--ut,xt.component!==1?--z:ft=!0;(rt===null||ut<ot)&&!ft&&(rt=at,ot=ut)}}if(0<z){for(x.reset();x.next();)b=x.value,b.component===1&&(b.layer+=E);y.component=0}else rt.component=0}for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(yp(a,y,1,-1,!0,!1);y.component!==0;){for(E=0,b=1/0,z=0,ot=null,rt=a.network.vertexes.iterator;rt.next();)if(tt=rt.value,tt.component===1){for(at=0,ut=!1,mt=tt.sourceEdgesArrayAccess,ft=mt.length,yt=0;yt<ft;yt++)xt=mt[yt].fromVertex,at+=1,xt.component!==1?E+=1:ut=!0;for(mt=tt.destinationEdgesArrayAccess,ft=mt.length,yt=0;yt<ft;yt++)xt=mt[yt],Mt=xt.toVertex,--at,Mt.component!==1&&(--E,Mt=tt.layer-Mt.layer,xt=a.linkMinLength(xt),b=Math.min(b,Mt-xt));(ot===null||at>z)&&!ut&&(ot=tt,z=at)}if(0>E){for(x.reset();x.next();)E=x.value,E.component===1&&(E.layer-=b);y.component=0}else ot.component=0}}}function J1(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}$i.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 M0: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&&Q1(this,x);break;case Py: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&&q1(this,x)}};function Q1(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&&Q1(a,E))}function q1(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&&q1(a,E))}$i.prototype.reduceCrossings=function(){var a=this.countCrossings(),y=Us(this),x,E;for(x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)w0(this,E,1),Ka(this,E,1);var b=this.countCrossings();for(b<a&&(a=b,y=Us(this)),E=this.Ia;0<=E;E--)w0(this,E,-1),Ka(this,E,-1);b=this.countCrossings(),b<a&&(a=b,y=Us(this))}for(Da(this,y),x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)w0(this,E,0),Ka(this,E,0);for(b=this.countCrossings(),b<a&&(a=b,y=Us(this)),E=this.Ia;0<=E;E--)w0(this,E,0),Ka(this,E,0);b=this.countCrossings(),b<a&&(a=b,y=Us(this))}Da(this,y);var z,tt,ot;switch(this.rk){case Ly:break;case ky:for(ot=a+1;(E=this.countCrossings())<ot;)for(ot=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=Ka(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Da(this,y):(a=b,y=Us(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Ka(this,E,1)||z;for(b=this.countCrossings(),b>=a?Da(this,y):(a=b,y=Us(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Ka(this,E,1)||z;for(b>=a?Da(this,y):(a=b,y=Us(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Ka(this,E,-1)||z;for(b>=a?Da(this,y):(a=b,y=Us(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Ka(this,E,0)||z;for(b>=a?Da(this,y):(a=b,y=Us(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Ka(this,E,0)||z;b>=a?Da(this,y):(a=b,y=Us(this))}break;default:case E0:for(x=this.Ia,tt=0,ot=a+1;(E=this.countCrossings())<ot;){for(ot=E,z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Ka(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Da(this,y):(a=b,y=Us(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Ka(this,E,1)||z;for(b=this.countCrossings(),b>=a?Da(this,y):(a=b,y=Us(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Ka(this,E,1)||z;for(b>=a?Da(this,y):(a=b,y=Us(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Ka(this,E,-1)||z;for(b>=a?Da(this,y):(a=b,y=Us(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Ka(this,E,0)||z;for(b>=a?Da(this,y):(a=b,y=Us(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Ka(this,E,0)||z;b>=a?Da(this,y):(a=b,y=Us(this))}}Da(this,y)};function w0(a,y,x){var E=Kh(a,y),b=a.tc[y],z=W1(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 ot=!0,rt;ot;)for(ot=!1,x=0;x<b-1;x++)(z[x+1]<z[x]||z[x+1]===z[x]&&tt[x+1]<tt[x])&&(ot=!0,rt=z[x],z[x]=z[x+1],z[x+1]=rt,rt=tt[x],tt[x]=tt[x+1],tt[x+1]=rt,rt=E[x],E[x]=E[x+1],E[x+1]=rt);for(x=z=0;x<b;x++)rt=E[x],rt.index=x,z+=a.nodeMinColumnSpace(rt,!0),rt.column=z,z+=1,z+=a.nodeMinColumnSpace(rt,!1);Xh(a,y,E)}function Ka(a,y,x){var E=Kh(a,y),b=a.tc[y];x=H1(a,y,x);var z,tt=[];for(z=0;z<b;z++)tt[z]=-1;var ot=[];for(z=0;z<b;z++)ot[z]=-1;for(var rt=!1,at=!0;at;)for(at=!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],mt=0,yt=0,xt=E[z].column,Mt=E[z+1].column,It=a.nodeMinColumnSpace(E[z],!0),Tt=a.nodeMinColumnSpace(E[z],!1),zt=a.nodeMinColumnSpace(E[z+1],!0),Ht=a.nodeMinColumnSpace(E[z+1],!1);It=xt-It+zt,Tt=Mt-Tt+Ht;var Vt=E[z].sourceEdges.iterator;for(Vt.reset();Vt.next();)if(zt=Vt.value,Ht=zt.fromVertex,zt.valid&&Ht.layer===y){for(zt=0;E[zt]!==Ht;)zt++;zt<z&&(mt+=2*(z-zt),yt+=2*(z+1-zt)),zt===z+1&&(mt+=1),zt>z+1&&(mt+=4*(zt-z),yt+=4*(zt-(z+1)))}for(Vt=E[z].destinationEdges.iterator,Vt.reset();Vt.next();)if(zt=Vt.value,Ht=zt.toVertex,zt.valid&&Ht.layer===y){for(zt=0;E[zt]!==Ht;)zt++;zt===z+1&&(yt+=1)}for(Vt=E[z+1].sourceEdges.iterator,Vt.reset();Vt.next();)if(zt=Vt.value,Ht=zt.fromVertex,zt.valid&&Ht.layer===y){for(zt=0;E[zt]!==Ht;)zt++;zt<z&&(mt+=2*(z+1-zt),yt+=2*(z-zt)),zt===z&&(yt+=1),zt>z+1&&(mt+=4*(zt-(z+1)),yt+=4*(zt-z))}for(Vt=E[z+1].destinationEdges.iterator,Vt.reset();Vt.next();)if(zt=Vt.value,Ht=zt.toVertex,zt.valid&&Ht.layer===y){for(zt=0;E[zt]!==Ht;)zt++;zt===z&&(mt+=1)}zt=Ht=0,Vt=tt[E[z].index];var Xt=ot[E[z].index],le=tt[E[z+1].index],$e=ot[E[z+1].index];Vt!==-1&&(Ht+=Math.abs(Vt-xt),zt+=Math.abs(Vt-Tt)),Xt!==-1&&(Ht+=Math.abs(Xt-xt),zt+=Math.abs(Xt-Tt)),le!==-1&&(Ht+=Math.abs(le-Mt),zt+=Math.abs(le-It)),$e!==-1&&(Ht+=Math.abs($e-Mt),zt+=Math.abs($e-It)),(yt<mt-.5||yt===mt&&ft<ut-.5||yt===mt&&ft===ut&&zt<Ht-.5)&&(at=rt=!0,E[z].column=Tt,E[z+1].column=It,ut=E[z],E[z]=E[z+1],E[z+1]=ut)}for(z=0;z<b;z++)E[z].index=z;return Xh(a,y,E),rt}$i.prototype.straightenAndPack=function(){if(this.ve===0){var a=(this.bg&1)!==0,y=(this.bg&Zx)!==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=_f(this,y,1)||x;for(y=this.Md-1;0<=y;y--)x=_f(this,y,-1)||x;x=_f(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&&($1(this,-1),$1(this,1)),this.bg&2)for(x=!0;x;){for(x=!1,x=_f(this,this.Md,0)||x,y=this.Md+1;y<=this.Ia;y++)x=_f(this,y,0)||x;for(y=this.Md-1;0<=y;y--)x=_f(this,y,0)||x}}else Wx(this)};function _f(a,y,x){for(var E=!1;zx(a,y,x);)E=!0;return E}function zx(a,y,x){var E,b=Kh(a,y),z=a.tc[y],tt=py(a,y,-1);if(0<x)for(E=0;E<z;E++)tt[E]=-1;var ot=py(a,y,1);if(0>x)for(E=0;E<z;E++)ot[E]=-1;for(var rt=!1,at=!0;at;)for(at=!1,E=0;E<z;E++){var ut=b[E].column,ft=a.nodeMinColumnSpace(b[E],!0),mt=a.nodeMinColumnSpace(b[E],!1),yt=0;0>E-1||ut-b[E-1].column-1>ft+a.nodeMinColumnSpace(b[E-1],!1)?yt=ut-1:yt=ut,ft=E+1>=z||b[E+1].column-ut-1>mt+a.nodeMinColumnSpace(b[E+1],!0)?ut+1:ut;var xt=mt=0,Mt=0;if(0>=x)for(var It=b[E].sourceEdges.iterator;It.next();){var Tt=It.value,zt=Tt.fromVertex;if(Tt.valid&&zt.layer!==y){var Ht=gy(Tt),Vt=Tt.portFromColOffset;Tt=Tt.portToColOffset,zt=zt.column,mt+=(Math.abs(ut+Tt-(zt+Vt))+1)*Ht,xt+=(Math.abs(yt+Tt-(zt+Vt))+1)*Ht,Mt+=(Math.abs(ft+Tt-(zt+Vt))+1)*Ht}}if(0<=x)for(It=b[E].destinationEdges.iterator;It.next();)Tt=It.value,zt=Tt.toVertex,Tt.valid&&zt.layer!==y&&(Ht=gy(Tt),Vt=Tt.portFromColOffset,Tt=Tt.portToColOffset,zt=zt.column,mt+=(Math.abs(ut+Vt-(zt+Tt))+1)*Ht,xt+=(Math.abs(yt+Vt-(zt+Tt))+1)*Ht,Mt+=(Math.abs(ft+Vt-(zt+Tt))+1)*Ht);Tt=Vt=Ht=0,It=tt[b[E].index],zt=ot[b[E].index],It!==-1&&(Ht+=Math.abs(It-ut),Vt+=Math.abs(It-yt),Tt+=Math.abs(It-ft)),zt!==-1&&(Ht+=Math.abs(zt-ut),Vt+=Math.abs(zt-yt),Tt+=Math.abs(zt-ft)),xt<mt||xt===mt&&Vt<Ht?(at=rt=!0,b[E].column=yt):(Mt<mt||Mt===mt&&Tt<Ht)&&(at=rt=!0,b[E].column=ft)}return Xh(a,y,b),a.normalize(),rt}function yy(a,y,x){var E=Kh(a,y),b=a.tc[y],z=W1(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 ot=E[x].column,rt=a.nodeMinColumnSpace(E[x],!0),at=a.nodeMinColumnSpace(E[x],!1),ut=0;if(tt[x]===-1)if(x===0&&x===b-1)ut=ot;else if(x===0){var ft=E[x+1].column;ft-ot===at+a.nodeMinColumnSpace(E[x+1],!0)?ut=ot-1:ut=ot}else x===b-1?(ft=E[x-1].column,ut=ot-ft===rt+a.nodeMinColumnSpace(E[x-1],!1)?ot+1:ot):(ft=E[x-1].column,rt=ft+a.nodeMinColumnSpace(E[x-1],!1)+rt+1,ft=E[x+1].column,at=ft-a.nodeMinColumnSpace(E[x+1],!0)-at-1,ut=(rt+at)/2|0);else x===0&&x===b-1?ut=tt[x]:x===0?(ft=E[x+1].column,at=ft-a.nodeMinColumnSpace(E[x+1],!0)-at-1,ut=Math.min(tt[x],at)):x===b-1?(ft=E[x-1].column,rt=ft+a.nodeMinColumnSpace(E[x-1],!1)+rt+1,ut=Math.max(tt[x],rt)):(ft=E[x-1].column,rt=ft+a.nodeMinColumnSpace(E[x-1],!1)+rt+1,ft=E[x+1].column,at=ft-a.nodeMinColumnSpace(E[x+1],!0)-at-1,rt<tt[x]&&tt[x]<at?ut=tt[x]:rt>=tt[x]?ut=rt:at<=tt[x]&&(ut=at));ut!==ot&&(z=!0,E[x].column=ut)}Xh(a,y,E),a.normalize()}function Gx(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 Hx(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 ot=E.column-a.nodeMinColumnSpace(E,!0),rt=E.column+a.nodeMinColumnSpace(E,!1);ot<=y&&rt>=y&&(b[E.layer]=!0),ot<=x&&rt>=x&&(z[E.layer]=!0)}for(ot=!0,x=!1,E=0;E<=a.Ia;E++)ot=ot&&!(b[E]&&z[E]);if(ot)for(tt.reset();tt.next();)a=tt.value,a.column>y&&(--a.column,x=!0);return x}function $1(a,y){for(var x=0;x<=a.Ra;x++)for(;Gx(a,x););for(a.normalize(),x=0;x<a.Ra;x++)for(;Hx(a,x););a.normalize();var E;if(0<y)for(x=0;x<=a.Ra;x++){var b=Us(a),z=x0(a);for(E=z+1;z<E;){E=z,tx(a,x,1);var tt=x0(a);tt>z?Da(a,b):tt<z&&(z=tt,b=Us(a))}}if(0>y)for(x=a.Ra;0<=x;x--)for(b=Us(a),z=x0(a),E=z+1;z<E;)E=z,tx(a,x,-1),tt=x0(a),tt>z?Da(a,b):tt<z&&(z=tt,b=Us(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,ot=Math.max(0,z.column-a.nodeMinColumnSpace(z,!0)),rt=Math.min(a.Ra,z.column+a.nodeMinColumnSpace(z,!1));ot<=rt;ot++)b[tt*(a.Ra+1)+ot]=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(rt=tt[tt.length-1],tt.pop(),b[rt])for(b[rt]=!1,z=0;z<a.le;z++)y[rt*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 Wx(a){for(var y=ln(),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 Me,Vx(y,x);var z=null,tt=null,ot=null,rt=null,at=(a.ve&1)!==0,ut=(a.ve&2)!==0,ft=(a.ve&4)!==0,mt=(a.ve&8)!==0;for(at&&(a.verticalAlignment(y,x,!0),z=P0(a,y,!0,!1)),y.reverse(),ft&&(a.verticalAlignment(y,x,!1),ot=P0(a,y,!1,!1)),E=lo(y),b=E.next();!b.done;b=E.next())b.value.reverse();mt&&(a.verticalAlignment(y,x,!1),rt=P0(a,y,!1,!0)),y.reverse(),ut&&(a.verticalAlignment(y,x,!0),tt=P0(a,y,!0,!0)),Be(y),a.u(z,tt,ot,rt),a.network.vertexes.each(function(yt){var xt=ln();at&&xt.push(z.get(yt)),ut&&xt.push(tt.get(yt)),ft&&xt.push(ot.get(yt)),mt&&xt.push(rt.get(yt)),xt.sort(function(It,Tt){return It-Tt});var Mt=xt.length;Mt=(xt[Math.floor((Mt-1)/2)]+xt[Math.ceil((Mt-1)/2)])/2,Be(xt),yt.zc=Mt})}function Vx(a,y){for(var x=a.length,E=1;E<x-1;E++)for(var b=0,z=0,tt=a[E],ot=a[E+1],rt=0;z<ot.length;rt++){var at=ot[rt];t:{if(at.node===null){var ut=My(at);if(0<ut.length){ut=ut[0].node===null;break t}}ut=!1}var ft=ut;if(rt===ot.length-1||ft){for(ut=tt.length-1,ft&&(ut=My(at)[0].index);z<=rt;){if(at=ot[z],!at.bo){ft=[];for(var mt=lo(at.sourceEdgesArrayAccess),yt=mt.next();!yt.done;yt=mt.next())yt=yt.value,yt.valid&&ft.push(yt);at.bo=ft}for(at=lo(at.bo),ft=at.next();!ft.done;ft=at.next())ft=ft.value,mt=ft.fromVertex.index,(mt<b||mt>ut)&&y.add(ft);z++}b=ut}}}$i.prototype.verticalAlignment=function(a,y,x){Ux(a),a=lo(a);for(var E=a.next();!E.done;E=a.next()){var b=-1;E=lo(E.value);for(var z=E.next();!z.done;z=E.next()){z=z.value;var tt=x?My(z):Kx(z),ot=tt.length;if(0<ot){tt.sort(function(ft,mt){return ft.vi-mt.vi});var rt=(ot-1)/2;for(ot=Math.floor(rt),rt=Math.ceil(rt);ot<=rt;ot++)if(z.align===z){var at=tt[ot],ut=void 0;ut=x?b0(at,z):b0(z,at),!y.contains(ut)&&b<at.vi&&(at.align=z,z.root=at.root,z.align=at.root,b=at.vi)}}}}};function Ux(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 P0(a,y,x,E){for(var b=a.K===90||a.K===270,z=lo(y),tt=z.next();!tt.done;tt=z.next()){var ot=lo(tt.value);for(tt=ot.next();!tt.done;tt=ot.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=lo(y),ot=z.next();!ot.done;ot=z.next()){ot=lo(ot.value);for(var rt=ot.next();!rt.done;rt=ot.next())if(rt=rt.value,rt.root===rt){for(var at=0,ut=rt;ut.align!==rt;){var ft=ut.align,mt=tt?ut.width:ut.height,yt=tt?ft.width:ft.height;if(x){var xt=b0(ut,ft),Mt=xt.portFromPos,It=xt.portToPos;xt.link!==null&&(ut.node&&ut.node!==xt.link.fromNode&&(Mt=tt?ut.focusX:ut.focusY),ft.node&&ft.node!==xt.link.toNode&&(It=tt?ft.focusX:ft.focusY))}else xt=b0(ft,ut),Mt=xt.portToPos,It=xt.portFromPos,xt.link!==null&&(ut.node&&ut.node!==xt.link.toNode&&(Mt=tt?ut.focusX:ut.focusY),ft.node&&ft.node!==xt.link.fromNode&&(It=tt?ft.focusX:ft.focusY));mt=E?ut.qg+(mt-Mt)-(yt-It):ut.qg+Mt-It,ft.qg=mt,at=Math.min(at,mt),ut=ut.align}ut=rt;do ut.qg=ut.qg-at,ut=ut.align;while(ut!==rt)}}for(x=lo(y),tt=x.next();!tt.done;tt=x.next())for(z=lo(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,ot=0;do{for(z=y[tt][ot];z.align!==z.root;)z=z.align,tt++,0<z.vi&&(ot=nx(z,y),ot.sd.shift=Math.min(ot.sd.shift,z.sd.shift+z.zc+z.qg-(ot.zc+ot.qg+(b?ot.width:ot.height)+a.columnSpacing)));ot=z.vi+1}while(tt<y.length&&ot<y[tt].length&&z.sd===y[tt][ot].sd)}for(a=new kn,y=lo(y),tt=y.next();!tt.done;tt=y.next())for(x=lo(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&&Wt("Could not determine previous vertex in layer"),y[x][a-1]}$i.prototype.u=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];x=-1;for(var E=ln(),b=ln(),z=1/0,tt=0;4>tt;tt++)if(y[tt]){var ot=Yx(this,y[tt],E,b,tt);ot<z&&(x=tt,z=ot)}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(rt){return function(at){at.value+=rt.delta}}(z)));Be(E),Be(b)};function Yx(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(ot){var rt=ot.key;ot=ot.value,rt=a.K===90||a.K===270?rt.width:rt.height,ot<z&&(z=ot),ot+rt>tt&&(tt=ot+rt)}),x[b]=z,E[b]=tt,tt-z}$i.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=C0(this,!0),y=C0(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 C0(a,y){return a.K===270?y?Is:es:a.K===90?y?es:Is:a.K===180?y?Rs:Ur:y?Ur:Rs}$i.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,ot=-1/0;a.next();){var rt=a.value,at=rt.layer,ut=rt.column|0;E?(tt=y.x+this.kc*ut,at=this.Kd[at]):(tt=this.Kd[at],at=y.y+this.kc*ut),rt.centerX=tt,rt.centerY=at,x&&isFinite(rt.zc)&&(E?rt.node?rt.x=y.x+rt.zc:rt.centerX=y.x+rt.zc:rt.node?rt.y=y.y+rt.zc:rt.centerY=y.y+rt.zc),z=Math.min(rt.x,z),b=Math.min(rt.y,b),E?(tt=z,ot=Math.max(ot,rt.bounds.right)):(tt=b,ot=Math.max(ot,rt.bounds.bottom))}for(this.xw=ot-tt,z=y.x-z,y=y.y-b,this.Rf=new Bt(x&&E?0:z,x&&!E?0:y),a.reset();a.next();)x=a.value,x.x+=z,x.y+=y,x.commit()},$i.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 Ce(0,0,x,Math.abs(this.Ta[0]))):y.push(new Ce(0,this.Ta[E-1],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===90?E===0?y.push(new Ce(0,this.Ta[0],x,Math.abs(this.Ta[0]-a))):y.push(new Ce(0,this.Ta[E],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===180?E===0?y.push(new Ce(0,0,Math.abs(this.Ta[0]),x)):y.push(new Ce(this.Ta[E-1],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x)):E===0?y.push(new Ce(this.Ta[0],0,Math.abs(this.Ta[0]-a),x)):y.push(new Ce(this.Ta[E],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x));this.commitLayers(y,this.Rf)},$i.prototype.commitLayers=function(){},$i.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,ot=E.toPort;if(b!==null){var rt=b.findVisibleNode();rt!==null&&rt!==b&&(b=rt,tt=rt.port)}z!==null&&(rt=z.findVisibleNode(),rt!==null&&rt!==z&&(z=rt,ot=rt.port));var at=y.computeSpot(!0,tt);rt=y.computeSpot(!1,ot);var ut=x.fromVertex,ft=x.toVertex;if(x.valid)y.curve===wa&&y.pointsCount===4&&(ut.column===ft.column&&this.alignOption===0?(x=y.getLinkPoint(b,tt,at,!0,!1,z,ot),ot=y.getLinkPoint(z,ot,rt,!1,!1,b,tt),x.w()||x.set(b.actualBounds.center),ot.w()||ot.set(z.actualBounds.center),y.Fj(),y.yf(x.x,x.y),y.yf((2*x.x+ot.x)/3,(2*x.y+ot.y)/3),y.yf((x.x+2*ot.x)/3,(x.y+2*ot.y)/3),y.yf(ot.x,ot.y)):(x=E=!1,tt!==null&&at===Ni&&(E=!0),ot!==null&&rt===Ni&&(x=!0),(E||x)&&(rt=null,E&&(rt=y.getLinkPointFromPoint(b,tt,tt.ga(ji),y.i(3),!0),rt.w()||rt.set(b.actualBounds.center),y.L(0,rt.x,rt.y)),b=null,x&&(b=y.getLinkPointFromPoint(z,ot,ot.ga(ji),y.i(0),!1),b.w()||b.set(z.actualBounds.center),y.L(3,b.x,b.y)),rt&&(z=y.i(2),y.L(1,(2*rt.x+z.x)/3,(2*rt.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 mt=!1,yt=!1,xt=this.ie,Mt=y.firstPickIndex+1;if(y.isOrthogonal){yt=!0;var It=y.pointsCount;4<It&&y.points.removeRange(2,It-3)}else if(y.curve===wa)mt=!0,It=y.pointsCount,4<It&&y.points.removeRange(2,It-3),It===4&&(Mt=2);else{It=y.pointsCount;var Tt=at===Ni,zt=rt===Ni;2<It&&Tt&&zt?y.points.removeRange(1,It-2):3<It&&Tt&&!zt?y.points.removeRange(1,It-3):3<It&&!Tt&&zt?y.points.removeRange(2,It-2):4<It&&!Tt&&!zt&&y.points.removeRange(2,It-3)}if(x.rev){for(;ft!==null&&ut!==ft;){var Ht=It=null;for(Tt=ft.sourceEdges.iterator;Tt.next()&&(zt=Tt.value,zt.link!==x.link||(It=zt.fromVertex,Ht=zt.toVertex,It.node!==null)););if(It===null)break;if(It!==ut){Tt=y.i(Mt-1).x,zt=y.i(Mt-1).y;var Vt=It.centerX,Xt=It.centerY;if(yt)this.K===180||this.K===0?Mt===y.firstPickIndex+1?(y.m(Mt++,Tt,zt),y.m(Mt++,Tt,Xt)):(Ht!==null?Ht.centerY:zt)!==Xt&&(Ht=this.Ta[It.layer-1]+this.Rf.x,y.m(Mt++,Ht,zt),y.m(Mt++,Ht,Xt)):Mt===y.firstPickIndex+1?(y.m(Mt++,Tt,zt),y.m(Mt++,Vt,zt)):(Ht!==null?Ht.centerX:Tt)!==Vt&&(Ht=this.Ta[It.layer-1]+this.Rf.y,y.m(Mt++,Tt,Ht),y.m(Mt++,Vt,Ht));else if(Mt===y.firstPickIndex+1){Ht=Math.max(10,this.he[ft.layer]);var le=Math.max(10,this.Ld[ft.layer]);if(mt)this.K===180?Vt<=ft.bounds.x?(ft=ft.bounds.x,y.m(Mt++,ft-Ht,Xt),y.m(Mt++,ft,Xt),y.m(Mt++,ft+le,Xt)):(y.m(Mt++,Vt-Ht,Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt+le,Xt)):this.K===90?Xt>=ft.bounds.bottom?(ft=ft.bounds.y+ft.bounds.height,y.m(Mt++,Vt,ft+le),y.m(Mt++,Vt,ft),y.m(Mt++,Vt,ft-Ht)):(y.m(Mt++,Vt,Xt+le),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Xt-Ht)):this.K===270?Xt<=ft.bounds.y?(ft=ft.bounds.y,y.m(Mt++,Vt,ft-Ht),y.m(Mt++,Vt,ft),y.m(Mt++,Vt,ft+le)):(y.m(Mt++,Vt,Xt-Ht),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Xt+le)):this.K===0&&(Vt>=ft.bounds.right?(ft=ft.bounds.x+ft.bounds.width,y.m(Mt++,ft+le,Xt),y.m(Mt++,ft,Xt),y.m(Mt++,ft-Ht,Xt)):(y.m(Mt++,Vt+le,Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt-Ht,Xt)));else{y.m(Mt++,Tt,zt);var $e=0;this.K===180||this.K===0?((this.K===180?Vt>=ft.bounds.right:Vt<=ft.bounds.x)&&($e=(this.K===0?-Ht:le)/2),y.m(Mt++,Tt+$e,Xt)):((this.K===270?Xt>=ft.bounds.bottom:Xt<=ft.bounds.y)&&($e=(this.K===90?-Ht:le)/2),y.m(Mt++,Vt,zt+$e)),y.m(Mt++,Vt,Xt)}}else Ht=Math.max(10,this.he[It.layer]),le=Math.max(10,this.Ld[It.layer]),mt?this.K===180?(y.m(Mt++,Vt-Ht-xt,Xt),y.m(Mt++,Math.min(Vt-Ht+xt/2,Vt),Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Math.max(Vt+le-xt/2,Vt),Xt),y.m(Mt++,Vt+le+xt,Xt)):this.K===90?(y.m(Mt++,Vt,Xt+le+xt),y.m(Mt++,Vt,Math.max(Xt+le-xt/2,Xt)),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Math.min(Xt-Ht+xt/2,Xt)),y.m(Mt++,Vt,Xt-Ht-xt)):this.K===270?(y.m(Mt++,Vt,Xt-Ht-xt),y.m(Mt++,Vt,Math.min(Xt-Ht+xt/2,Xt)),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Math.max(Xt+le-xt/2,Xt)),y.m(Mt++,Vt,Xt+le+xt)):(y.m(Mt++,Vt+le+xt,Xt),y.m(Mt++,Math.max(Vt+le-xt/2,Vt),Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Math.min(Vt-Ht+xt/2,Vt),Xt),y.m(Mt++,Vt-Ht-xt,Xt)):y.m(Mt++,Vt,Xt)}ft=It}(ot===null||at!==Ni||yt)&&(Tt=y.i(Mt-1).x,zt=y.i(Mt-1).y,Vt=y.i(Mt).x,Xt=y.i(Mt).y,yt?(xt=this.Ld[ut.layer],this.K===180||this.K===0?(yt=zt,yt>=ut.bounds.y&&yt<=ut.bounds.bottom&&(this.K===180?Vt>=ut.bounds.x:Vt<=ut.bounds.right)&&(ft=ut.centerX+(this.K===180?-xt:xt),yt<ut.bounds.y+ut.bounds.height/2?yt=ut.bounds.y-this.kc/2:yt=ut.bounds.bottom+this.kc/2,y.m(Mt++,ft,zt),y.m(Mt++,ft,yt)),y.m(Mt++,Vt,yt)):(yt=Tt,yt>=ut.bounds.x&&yt<=ut.bounds.right&&(this.K===270?Xt>=ut.bounds.y:Xt<=ut.bounds.bottom)&&(ft=ut.centerY+(this.K===270?-xt:xt),yt<ut.bounds.x+ut.bounds.width/2?yt=ut.bounds.x-this.kc/2:yt=ut.bounds.right+this.kc/2,y.m(Mt++,Tt,ft),y.m(Mt++,yt,ft)),y.m(Mt++,yt,Xt)),y.m(Mt++,Vt,Xt)):mt?(Ht=Math.max(10,this.he[ut.layer]),le=Math.max(10,this.Ld[ut.layer]),this.K===180&&Vt>=ut.bounds.x?(ft=ut.bounds.x+ut.bounds.width,y.L(Mt-2,ft,zt),y.L(Mt-1,ft+le,zt)):this.K===90&&Xt<=ut.bounds.bottom?(ft=ut.bounds.y,y.L(Mt-2,Tt,ft),y.L(Mt-1,Tt,ft-Ht)):this.K===270&&Xt>=ut.bounds.y?(ft=ut.bounds.y+ut.bounds.height,y.L(Mt-2,Tt,ft),y.L(Mt-1,Tt,ft+le)):this.K===0&&Vt<=ut.bounds.right&&(ft=ut.bounds.x,y.L(Mt-2,ft,zt),y.L(Mt-1,ft-Ht,zt))):(Ht=Math.max(10,this.he[ut.layer]),le=Math.max(10,this.Ld[ut.layer]),yt=0,this.K===180||this.K===0?((this.K===180?Vt<=ut.bounds.x:Vt>=ut.bounds.right)&&(yt=(this.K===0?le:-Ht)/2),y.m(Mt++,Vt+yt,zt)):((this.K===270?Xt<=ut.bounds.y:Xt>=ut.bounds.bottom)&&(yt=(this.K===90?le:-Ht)/2),y.m(Mt++,Tt,Xt+yt)),y.m(Mt++,Vt,Xt)))}else{for(;ut!==null&&ut!==ft;){for(Ht=It=null,ut=ut.destinationEdges.iterator;ut.next()&&(Tt=ut.value,Tt.link!==x.link||(It=Tt.toVertex,Ht=Tt.fromVertex,Ht.node!==null&&(Ht=null),It.node!==null)););if(It===null)break;It!==ft&&(Tt=y.i(Mt-1).x,zt=y.i(Mt-1).y,Vt=It.centerX,Xt=It.centerY,yt?this.K===180||this.K===0?(Ht!==null?Ht.centerY:zt)!==Xt&&(Ht=this.Ta[It.layer]+this.Rf.x,Mt===y.firstPickIndex+1&&(Ht=this.K===0?Math.max(Ht,Tt):Math.min(Ht,Tt)),y.m(Mt++,Ht,zt),y.m(Mt++,Ht,Xt)):(Ht!==null?Ht.centerX:Tt)!==Vt&&(Ht=this.Ta[It.layer]+this.Rf.y,Mt===y.firstPickIndex+1&&(Ht=this.K===90?Math.max(Ht,zt):Math.min(Ht,zt)),y.m(Mt++,Tt,Ht),y.m(Mt++,Vt,Ht)):(Ht=Math.max(10,this.he[It.layer]),le=Math.max(10,this.Ld[It.layer]),mt?this.K===180?(y.m(Mt++,Vt+le+xt,Xt),y.m(Mt++,Math.max(Vt+le-xt/2,Vt),Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Math.min(Vt-Ht+xt/2,Vt),Xt),y.m(Mt++,Vt-Ht-xt,Xt)):this.K===90?(y.m(Mt++,Vt,Xt-Ht-xt),y.m(Mt++,Vt,Math.min(Xt-Ht+xt/2,Xt)),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Math.max(Xt+le-xt/2,Xt)),y.m(Mt++,Vt,Xt+le+xt)):this.K===270?(y.m(Mt++,Vt,Xt+le+xt),y.m(Mt++,Vt,Math.max(Xt+le-xt/2,Xt)),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Math.min(Xt-Ht+xt/2,Xt)),y.m(Mt++,Vt,Xt-Ht-xt)):(y.m(Mt++,Vt-Ht-xt,Xt),y.m(Mt++,Math.min(Vt-Ht+xt/2,Vt),Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Vt,Xt),y.m(Mt++,Math.max(Vt+le-xt/2,Vt),Xt),y.m(Mt++,Vt+le+xt,Xt)):this.K===180?(y.m(Mt++,Vt+le,Xt),y.m(Mt++,Vt-Ht,Xt)):this.K===90?(y.m(Mt++,Vt,Xt-Ht),y.m(Mt++,Vt,Xt+le)):this.K===270?(y.m(Mt++,Vt,Xt+le),y.m(Mt++,Vt,Xt-Ht)):(y.m(Mt++,Vt-Ht,Xt),y.m(Mt++,Vt+le,Xt)))),ut=It}yt&&(Tt=y.i(Mt-1).x,zt=y.i(Mt-1).y,Vt=y.i(Mt).x,Xt=y.i(Mt).y,this.K===180||this.K===0?zt!==Xt&&(Ht=this.K===0?Math.min(Math.max((Vt+Tt)/2,this.Ta[ft.layer]+this.Rf.x),Vt):Math.max(Math.min((Vt+Tt)/2,this.Ta[ft.layer]+this.Rf.x),Vt),y.m(Mt++,Ht,zt),y.m(Mt++,Ht,Xt)):Tt!==Vt&&(Ht=this.K===90?Math.min(Math.max((Xt+zt)/2,this.Ta[ft.layer]+this.Rf.y),Xt):Math.max(Math.min((Xt+zt)/2,this.Ta[ft.layer]+this.Rf.y),Xt),y.m(Mt++,Tt,Ht),y.m(Mt++,Vt,Ht)))}E!==null&&mt&&4<=y.pointsCount&&(tt!==null&&(tt=at===Ni?y.getLinkPointFromPoint(b,tt,tt.ga(ji),y.i(3),!0):y.i(0),at===Ni&&(at=y.i(2),E=y.i(3),this.direction===90||this.direction===270?(y.L(1,(tt.x+at.x)/2,at.y),y.L(2,E.x,(at.y+E.y)/2)):(y.L(1,at.x,(tt.y+at.y)/2),y.L(2,(at.x+E.x)/2,E.y))),tt.w()||tt.set(b.actualBounds.center),y.L(0,tt.x,tt.y)),ot!==null&&(b=rt===Ni?y.getLinkPointFromPoint(z,ot,ot.ga(ji),y.i(y.pointsCount-4),!1):y.i(y.pointsCount-1),rt===Ni&&(ot=y.i(y.pointsCount-3),rt=y.i(y.pointsCount-4),this.direction===90||this.direction===270?(y.L(y.pointsCount-2,(b.x+ot.x)/2,ot.y),y.L(y.pointsCount-2,rt.x,(ot.y+rt.y)/2)):(y.L(y.pointsCount-2,ot.x,(b.y+ot.y)/2),y.L(y.pointsCount-3,(ot.x+rt.x)/2,rt.y))),b.w()||b.set(z.actualBounds.center),y.L(y.pointsCount-1,b.x,b.y))),y.zf(),x.commit()}}}this.avoidOrthogonalOverlaps()},$i.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new ke,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 ot=new Jh;ot.layer=Math.floor(z.y/2);var rt=E.i(0),at=E.i(E.pointsCount-1);if(ot.first=rt.x*rt.x+rt.y,ot.jc=at.x*at.x+at.y,ot.rd=Math.min(z.x,tt.x),ot.Ic=Math.max(z.x,tt.x),ot.index=b,ot.link=E,b+2<E.pointsCount){rt=E.i(b-1),at=E.i(b+2);var ut=0;rt.y<z.y?ut=at.y<z.y?3:z.x<tt.x?2:1:rt.y>z.y&&(ut=at.y>z.y?0:tt.x<z.x?2:1),ot.j=ut}x.push(ot)}}}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,ot=x[z].jc,rt=z;rt<b;rt++)at=x[rt],at.jc!==ot&&(ut++,ot=at.jc);this.zi(x,this.Ux,z,z+tt);var ft=1;for(ot=x[z].first,rt=z;rt<b;rt++)at=x[rt],at.first!==ot&&(ft++,ot=at.first);for(rt=!0,at=ft,ut<ft?(rt=!1,at=ut,ot=x[z].jc,this.zi(x,this.Js,z,z+tt)):ot=x[z].first,ut=0,ft=z;ft<b;ft++){var mt=x[ft];(rt?mt.first:mt.jc)!==ot&&(ut++,ot=rt?mt.first:mt.jc);var yt=mt.link;z=yt.i(mt.index),tt=yt.i(mt.index+1);var xt=this.linkSpacing*(ut-(at-1)/2);y++,yt.uh(),yt.L(mt.index,z.x,z.y+xt),yt.L(mt.index+1,tt.x,tt.y+xt),yt.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)&&(ot=new Jh,ot.layer=Math.floor(z.x/2),rt=E.i(0),at=E.i(E.pointsCount-1),ot.first=rt.x+rt.y*rt.y,ot.jc=at.x+at.y*at.y,ot.rd=Math.min(z.y,tt.y),ot.Ic=Math.max(z.y,tt.y),ot.index=b,ot.link=E,b+2<E.pointsCount&&(rt=E.i(b-1),at=E.i(b+2),ut=0,rt.x<z.x?ut=at.x<z.x?3:z.y<tt.y?2:1:rt.x>z.x&&(ut=at.x>z.x?0:tt.y<z.y?2:1),ot.j=ut),x.push(ot));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,ot=x[z].jc,rt=z;rt<b;rt++)at=x[rt],at.jc!==ot&&(ut++,ot=at.jc);for(this.zi(x,this.Ux,z,z+tt),ft=1,ot=x[z].first,rt=z;rt<b;rt++)at=x[rt],at.first!==ot&&(ft++,ot=at.first);for(rt=!0,at=ft,ut<ft?(rt=!1,at=ut,ot=x[z].jc,this.zi(x,this.Js,z,z+tt)):ot=x[z].first,ut=0,ft=z;ft<b;ft++)mt=x[ft],(rt?mt.first:mt.jc)!==ot&&(ut++,ot=rt?mt.first:mt.jc),yt=mt.link,z=yt.i(mt.index),tt=yt.i(mt.index+1),xt=this.linkSpacing*(ut-(at-1)/2),y++,yt.uh(),yt.L(mt.index,z.x+xt,z.y),yt.L(mt.index+1,tt.x+xt,tt.y),yt.zf()}z=b}a=E}}}},Ct=$i.prototype,Ct.Vx=function(a,y){return a instanceof Jh&&y instanceof Jh&&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},Ct.Ux=function(a,y){return a instanceof Jh&&y instanceof Jh&&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},Ct.Js=function(a,y){return a instanceof Jh&&y instanceof Jh&&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},Ct.B=function(a,y){return a-=y,-1<a&&1>a},Ct.zi=function(a,y,x,E){var b=a.length,z=E-x;if(!(1>=z))if((0>x||x>=b-1)&&Wt("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 Kh(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 Xh(a,y,x){a.He[a.tc[y]]=x}oe.Object.defineProperties($i.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()):Wt("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{get:function(){return this.Dk},set:function(a){this.Dk===a||a!==Sy&&a!==L0&&a!==Sp||(this.Dk=a,this.C())}},layeringOption:{get:function(){return this.Zk},set:function(a){this.Zk===a||a!==k0&&a!==xy&&a!==wy||(this.Zk=a,this.C())}},initializeOption:{get:function(){return this.Qk},set:function(a){this.Qk===a||a!==M0&&a!==Py&&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!==Ly&&a!==E0&&a!==ky||(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 L0=new Se($i,"CycleDepthFirst",0),Sy=new Se($i,"CycleGreedy",1),Sp=new Se($i,"CycleFromLayers",2),k0=new Se($i,"LayerOptimalLinkLength",0),xy=new Se($i,"LayerLongestPathSink",1),wy=new Se($i,"LayerLongestPathSource",2),M0=new Se($i,"InitDepthFirstOut",0),Py=new Se($i,"InitDepthFirstIn",1),Cy=new Se($i,"InitNaive",2),Ly=new Se($i,"AggressiveNone",0),E0=new Se($i,"AggressiveLess",1),ky=new Se($i,"AggressiveMore",2),Zx=8;$i.className="LayeredDigraphLayout",$i.CycleDepthFirst=L0,$i.CycleGreedy=Sy,$i.CycleFromLayers=Sp,$i.LayerOptimalLinkLength=k0,$i.LayerLongestPathSink=xy,$i.LayerLongestPathSource=wy,$i.InitDepthFirstOut=M0,$i.InitDepthFirstIn=Py,$i.InitNaive=Cy,$i.AggressiveNone=Ly,$i.AggressiveLess=E0,$i.AggressiveMore=ky,$i.PackNone=0,$i.PackExpand=1,$i.PackStraighten=2,$i.PackMedian=4,$i.PackAll=15,$i.AlignNone=0,$i.AlignUpperLeft=1,$i.AlignUpperRight=2,$i.AlignLowerLeft=4,$i.AlignLowerRight=8,$i.AlignAll=15;function Jh(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}Jh.className="SegInfo";function zf(a){ho.call(this,a)}he(zf,ho),zf.prototype.createVertex=function(){return new Oa(this)},zf.prototype.createEdge=function(){return new xp(this)},zf.className="LayeredDigraphNetwork";function Oa(a){yr.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}he(Oa,yr);function ix(a,y){return a.index-y.index}function b0(a,y){if(!a.$n){for(var x=[],E=lo(a.destinationEdgesArrayAccess),b=E.next();!b.done;b=E.next())b=b.value,b.valid&&x.push(b);a.$n=x}for(a=lo(a.$n),x=a.next();!x.done;x=a.next())if(x=x.value,x.toVertex===y)return x;Wt("Unable to find destination edge to given vertex")}function My(a){if(!a.co){for(var y=[],x=lo(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 Kx(a){if(!a.ao){for(var y=[],x=lo(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}Oa.prototype.Cl=function(a){yr.prototype.Cl.call(this,a),this.bo=this.co=null},Oa.prototype.Kl=function(a){yr.prototype.Kl.call(this,a),this.bo=this.co=null},Oa.prototype.zl=function(a){yr.prototype.zl.call(this,a),this.$n=this.ao=null},Oa.prototype.Jl=function(a){yr.prototype.Jl.call(this,a),this.$n=this.ao=null},oe.Object.defineProperties(Oa.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)}}}),Oa.prototype.deleteDestinationEdge=Oa.prototype.Jl,Oa.prototype.addDestinationEdge=Oa.prototype.zl,Oa.prototype.deleteSourceEdge=Oa.prototype.Kl,Oa.prototype.addSourceEdge=Oa.prototype.Cl,Oa.className="LayeredDigraphVertex";function xp(a){aa.call(this,a),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}he(xp,aa),oe.Object.defineProperties(xp.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)}}}),xp.className="LayeredDigraphEdge";function Li(a){Mo.call(this),this.Ub=new Me,this.Wn=A0,this.ud=eu,this.vo=D0,this.Bq=Ry,this.$v=[],this.td=!0,this.Rb=O0,this.$d=new Qe(10,10).freeze();var y=new Tc(this);this.W=new Xa(y),this.Y=new Xa(y),this.ru=[],a&&Object.assign(this,a)}he(Li,Mo),Li.prototype.cloneProtected=function(a){Mo.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)},Li.prototype.qb=function(a){a.classType===Li?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:Wt("Unknown enum value: "+a):Mo.prototype.qb.call(this,a)},Li.prototype.createNetwork=function(){return new Tc(this)},Li.prototype.makeNetwork=function(a){function y(E){if(E instanceof nn)return!E.isLinkLabel&&E.category!=="Comment";if(E instanceof Ve){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 ue?(x.lg(a.nodes,!0,y),x.lg(a.links,!0,y)):a instanceof ri?x.lg(a.memberParts,!1,y):x.lg(a.iterator,!1,y),x},Li.prototype.doLayout=function(a){this.network===null&&(this.network=this.makeNetwork(a)),this.arrangement!==I0&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var y=this.diagram;if(y===null&&a instanceof ue&&(y=a),this.path===A0&&y!==null?this.ud=y.isTreePathToChildren?eu:Fc:this.ud=this.path===A0?eu: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 Me,y=this.Ub.iterator;y.next();){var x=y.value;x instanceof nn?(x=this.network.ki(x),x!==null&&a.add(x)):x instanceof Xa&&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,Ey(this,y));for(y=this.network.vertexes,a=null;a=Xx(y),0<a.count;)y=ox(this,a),y!==null&&this.Ub.add(y),y.initialized=!0,Ey(this,y),y=a;for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Xa&&sx(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Xa&&ax(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Xa&&lx(this,y);if(this.Cu(),this.layerStyle===R0){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===jy)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 Xa&&this.layoutTree(y);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new Me,this.isValidLayout=!0};function Xx(a){var y=new Me;for(a=a.iterator;a.next();){var x=a.value;x.initialized||y.add(x)}return y}Li.prototype.findRoots=function(){for(var a=this.network.vertexes,y=a.iterator;y.next();){var x=y.value;switch(this.ud){case eu:x.sourceEdges.count===0&&this.Ub.add(x);break;case Fc:x.destinationEdges.count===0&&this.Ub.add(x);break;default:Wt("Unhandled path value "+this.ud.toString())}}this.Ub.count===0&&(a=ox(this,a),a!==null&&this.Ub.add(a))};function ox(a,y){var x=999999,E=null;for(y=y.iterator;y.next();){var b=y.value;switch(a.ud){case eu:b.sourceEdges.count<x&&(x=b.sourceEdges.count,E=b);break;case Fc:b.destinationEdges.count<x&&(x=b.destinationEdges.count,E=b);break;default:Wt("Unhandled path value "+a.ud.toString())}}return E}function Ey(a,y){if(y!==null){switch(a.ud){case eu:if(0<y.destinationEdges.count){for(var x=new ke,E=y.destinationVertexes;E.next();){var b=E.value;rx(a,y,b)&&x.add(b)}0<x.count&&(y.children=x.Fa())}break;case Fc:if(0<y.sourceEdges.count){for(x=new ke,E=y.sourceVertexes;E.next();)b=E.value,rx(a,y,b)&&x.add(b);0<x.count&&(y.children=x.Fa())}break;default:Wt("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++)Ey(a,x[y])}}function rx(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}Li.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 sx(a,y){if(y!==null){a.initializeTreeVertexValues(y),y.alignment===ou&&a.sortTreeVertexChildren(y);for(var x=0,E=y.childrenCount,b=0,z=y.children,tt=z.length,ot=0;ot<tt;ot++){var rt=z[ot];sx(a,rt),x+=rt.descendantCount+1,E=Math.max(E,rt.maxChildrenCount),b=Math.max(b,rt.maxGenerationCount)}y.descendantCount=x,y.maxChildrenCount=E,y.maxGenerationCount=0<E?b+1:0}}function Jx(a,y){switch(a.vo){default:case D0: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 By: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}}Li.prototype.initializeTreeVertexValues=function(a){if(a.copyInheritedPropertiesFrom(Jx(this,a)),a.parent!==null&&a.parent.alignment===ou){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 ax(a,y){if(y!==null){a.assignTreeVertexValues(y),y=y.children;for(var x=y.length,E=0;E<x;E++)ax(a,y[E])}}Li.prototype.assignTreeVertexValues=function(){};function lx(a,y){if(y!==null){y.alignment!==ou&&a.sortTreeVertexChildren(y),y=y.children;for(var x=y.length,E=0;E<x;E++)lx(a,y[E])}}Li.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case Gf:break;case Pp:a.children.reverse();break;case Cp:a.children.sort(a.comparer);break;case Lp:a.children.sort(a.comparer),a.children.reverse();break;default:Wt("Unhandled sorting value "+a.sorting.toString())}},Li.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},Li.prototype.addComments=function(a){var y=a.angle,x=a.parent,E=0,b=!1;x!==null&&(E=x.angle,b=x.alignment,b=Qh(b)),y=y===90||y===270,E=E===90||E===270,x=a.childrenCount===0;var z=0,tt=0,ot=0,rt=a.commentSpacing;if(a.node!==null)for(var at=a.node.Mu();at.next();){var ut=at.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(ot)):(z+=ut.width+Math.abs(ot),tt=Math.max(tt,ut.height)),ot=rt)}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=Ce.allocAt(0,0,a.bounds.width+z,a.bounds.height+tt),a.bounds=b,Ce.free(b))};function Qh(a){return a===ih||a===ou||a===oh||a===wu}function wp(a){return a===ih||a===ou}function by(a){var y=a.parent;if(y!==null){var x=y.alignment;if(Qh(x)){if(wp(x)){for(y=y.children,x=0;x<y.length&&a!==y[x];)x++;return x%2===0}if(x===oh)return!0}}return!1}Li.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=Qh(z)),E=E===90||E===270,x=b===90||b===270;for(var tt=a.childrenCount===0,ot=by(a),rt=0,at=a.comments,ut=at.length,ft=Bt.alloc(),mt=0;mt<ut;mt++){var yt=at[mt],xt=yt.measuredBounds;if(E&&!tt||!z&&!x&&tt||z&&x&&tt){if(135<b&&!z||x&&ot)if(0<=a.commentMargin)for(ft.h(a.bounds.x-a.commentMargin-xt.width,a.bounds.y+rt),yt.move(ft),yt=yt.Sd();yt.next();){var Mt=yt.value;Mt.fromSpot=Rs,Mt.toSpot=Ur}else for(ft.h(a.bounds.x+2*a.focus.x-a.commentMargin,a.bounds.y+rt),yt.move(ft),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=Ur,Mt.toSpot=Rs;else if(0<=a.commentMargin)for(ft.h(a.bounds.x+2*a.focus.x+a.commentMargin,a.bounds.y+rt),yt.move(ft),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=Ur,Mt.toSpot=Rs;else for(ft.h(a.bounds.x+a.commentMargin-xt.width,a.bounds.y+rt),yt.move(ft),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=Rs,Mt.toSpot=Ur;rt=0<=a.commentSpacing?rt+(xt.height+a.commentSpacing):rt+(a.commentSpacing-xt.height)}else{if(135<b&&!z||!x&&ot)if(0<=a.commentMargin)for(ft.h(a.bounds.x+rt,a.bounds.y-a.commentMargin-xt.height),yt.move(ft),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=Is,Mt.toSpot=es;else for(ft.h(a.bounds.x+rt,a.bounds.y+2*a.focus.y-a.commentMargin),yt.move(ft),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=es,Mt.toSpot=Is;else if(0<=a.commentMargin)for(ft.h(a.bounds.x+rt,a.bounds.y+2*a.focus.y+a.commentMargin),yt.move(ft),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=es,Mt.toSpot=Is;else for(ft.h(a.bounds.x+rt,a.bounds.y+a.commentMargin-xt.height),yt.move(ft),yt=yt.Sd();yt.next();)Mt=yt.value,Mt.fromSpot=Is,Mt.toSpot=es;rt=0<=a.commentSpacing?rt+(xt.width+a.commentSpacing):rt+(a.commentSpacing-xt.width)}}if(Bt.free(ft),y=rt-a.commentSpacing-(E?y.height:y.width),this.ud===eu)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)}},Li.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 B0:ux(this,a);break;case kp:if(a.alignment===ou)ux(this,a);else if(a.childrenCount===0)E=a.parent,x=!1,y=0,E!==null&&(y=E.angle,x=E.alignment,x=Qh(x)),E=by(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=hl(a);y=b===90||b===270;var z=0,tt=a.children,ot=tt.length;for(x=0;x<ot;x++)E=tt[x],z=Math.max(z,y?E.Da.width:E.Da.height);var rt=a.alignment;E=rt===nu;var at=rt===iu,ut=Qh(rt),ft=Math.max(0,a.breadthLimit);x=this.computeLayerSpacing(a);var mt=a.nodeSpacing,yt=this.computeNodeIndent(a),xt=a.rowSpacing,Mt=0;(E||at||a.hm||a.im&&a.maxGenerationCount===1)&&(Mt=Math.max(0,a.rowIndent)),E=a.width;var It=a.height,Tt=0,zt=0,Ht=0,Vt=null,Xt=null,le=0,$e=0,mn=0,cn=0,We=0,Te=0,oi=0,Xn=0;if(ut&&!wp(rt)&&135<b&&tt.reverse(),wp(rt))if(1<ot)for(var Gi=0;Gi<ot;Gi++)Gi%2===0&&Gi!==ot-1&&(Xn=Math.max(Xn,y?tt[Gi].Da.width:tt[Gi].Da.height));else ot===1&&(Xn=y?tt[0].Da.width:tt[0].Da.height);if(ut){switch(rt){case ih:zt=135>b?hx(this,a,tt,Xn,Tt,zt):dx(this,a,tt,Xn,Tt,zt),Xn=zt.x,Tt=zt.width,zt=zt.height;break;case oh:for(Vt=0;Vt<ot;Vt++)Xt=tt[Vt],ft=Xt.Da,Ht=Te===0?0:xt,y?(Xt.S.h(z-ft.width,cn+Ht),Tt=Math.max(Tt,ft.width),zt=Math.max(zt,cn+Ht+ft.height),cn+=Ht+ft.height):(Xt.S.h(mn+Ht,z-ft.height),Tt=Math.max(Tt,mn+Ht+ft.width),zt=Math.max(zt,ft.height),mn+=Ht+ft.width),Te++;break;case wu:for(Vt=0;Vt<ot;Vt++)Xt=tt[Vt],z=Xt.Da,ft=Te===0?0:xt,y?(Xt.S.h(mt/2+a.focus.x,cn+ft),Tt=Math.max(Tt,z.width),zt=Math.max(zt,cn+ft+z.height),cn+=ft+z.height):(Xt.S.h(mn+ft,mt/2+a.focus.y),Tt=Math.max(Tt,mn+ft+z.width),zt=Math.max(zt,z.height),mn+=ft+z.width),Te++}Vt=Xs(this,2),Xt=Xs(this,2),y?(Vt[0].h(0,0),Vt[1].h(0,zt),Xt[0].h(Tt,0)):(Vt[0].h(0,0),Vt[1].h(Tt,0),Xt[0].h(0,zt)),Xt[1].h(Tt,zt)}else for(Gi=0;Gi<ot;Gi++){var ao=tt[Gi],Cr=ao.Da;if(y){0<ft&&0<Te&&mn+mt+Cr.width>ft&&(mn<z&&jd(a,rt,z-mn,0,oi,Gi-1),We++,Te=0,oi=Gi,Ht=zt,mn=0,cn=135<b?-zt-xt:zt+xt),N0(this,ao,0,cn);var Er=0;if(Te===0)Vt=ao.Yo,Xt=ao.kp,le=Cr.width,$e=Cr.height,(Vt===null||Xt===null||b!==hl(ao))&&(Vt=Xs(this,2),Xt=Xs(this,2),Vt[0].h(0,0),Vt[1].h(0,$e),Xt[0].h(le,0),Xt[1].h(le,$e));else{var fs=ln();$e=cx(this,a,ao,Vt,Xt,le,$e,fs),Er=$e.x,Vt=fs[0],Xt=fs[1],le=$e.width,$e=$e.height,Be(fs),mn<Cr.width&&0>Er&&(bc(a,-Er,0,oi,Gi-1),T0(Vt,-Er,0),T0(Xt,-Er,0),Er=0)}ao.S.h(Er,cn),Tt=Math.max(Tt,le),zt=Math.max(zt,Ht+(We===0?0:xt)+Cr.height),mn=le}else 0<ft&&0<Te&&cn+mt+Cr.height>ft&&(cn<z&&jd(a,rt,0,z-cn,oi,Gi-1),We++,Te=0,oi=Gi,Ht=Tt,cn=0,mn=135<b?-Tt-xt:Tt+xt),N0(this,ao,mn,0),Er=0,Te===0?(Vt=ao.Yo,Xt=ao.kp,le=Cr.width,$e=Cr.height,(Vt===null||Xt===null||b!==hl(ao))&&(Vt=Xs(this,2),Xt=Xs(this,2),Vt[0].h(0,0),Vt[1].h(le,0),Xt[0].h(0,$e),Xt[1].h(le,$e))):(fs=ln(),$e=cx(this,a,ao,Vt,Xt,le,$e,fs),Er=$e.x,Vt=fs[0],Xt=fs[1],le=$e.width,$e=$e.height,Be(fs),cn<Cr.height&&0>Er&&(bc(a,0,-Er,oi,Gi-1),T0(Vt,0,-Er),T0(Xt,0,-Er),Er=0)),ao.S.h(mn,Er),zt=Math.max(zt,$e),Tt=Math.max(Tt,Ht+(We===0?0:xt)+Cr.width),cn=$e;Te++}switch(0<We&&(y?(zt+=Math.max(0,x),mn<Tt&&jd(a,rt,Tt-mn,0,oi,ot-1),0<Mt&&(at||bc(a,Mt,0,0,ot-1),Tt+=Mt)):(Tt+=Math.max(0,x),cn<zt&&jd(a,rt,0,zt-cn,oi,ot-1),0<Mt&&(at||bc(a,0,Mt,0,ot-1),zt+=Mt))),Mt=at=0,rt){case Hf:y?at+=Tt/2-a.focus.x-yt/2:Mt+=zt/2-a.focus.y-yt/2;break;case Nc:0<We?y?at+=Tt/2-a.focus.x-yt/2:Mt+=zt/2-a.focus.y-yt/2:y?(Xn=tt[0].S.x+tt[0].la.x,at+=Xn+(tt[ot-1].S.x+tt[ot-1].la.x+2*tt[ot-1].focus.x-Xn)/2-a.focus.x-yt/2):(Xn=tt[0].S.y+tt[0].la.y,Mt+=Xn+(tt[ot-1].S.y+tt[ot-1].la.y+2*tt[ot-1].focus.y-Xn)/2-a.focus.y-yt/2);break;case nu:y?(at-=yt,Tt+=yt):(Mt-=yt,zt+=yt);break;case iu:y?(at+=Tt-a.width+yt,Tt+=yt):(Mt+=zt-a.height+yt,zt+=yt);break;case ih:y?1<ot?at+=Xn+mt/2-a.focus.x:at+=tt[0].focus.x-a.focus.x+tt[0].la.x:1<ot?Mt+=Xn+mt/2-a.focus.y:Mt+=tt[0].focus.y-a.focus.y+tt[0].la.y;break;case oh:y?at+=Tt+mt/2-a.focus.x:Mt+=zt+mt/2-a.focus.y;break;case wu:break;default:zt=this.customAlignment(a,at,Mt,Tt,zt),at=zt[0],Mt=zt[1],Tt=zt[2],zt=zt[3]}for(yt=0;yt<ot;yt++)Xn=tt[yt],y?Xn.S.h(Xn.S.x+Xn.la.x-at,Xn.S.y+(135<b?(ut?-zt:-Xn.Da.height)+Xn.la.y-x:It+x+Xn.la.y)):Xn.S.h(Xn.S.x+(135<b?(ut?-Tt:-Xn.Da.width)+Xn.la.x-x:E+x+Xn.la.x),Xn.S.y+Xn.la.y-Mt);if(ot=tt=0,ut?y?(Tt=Fy(a,Tt,at),0>at&&(at=0),135<b&&(Mt+=zt+x),zt+=It+x,rt===wu&&(tt+=mt/2+a.focus.x),ot+=It+x):(135<b&&(at+=Tt+x),Tt+=E+x,zt=Ny(a,zt,Mt),0>Mt&&(Mt=0),rt===wu&&(ot+=mt/2+a.focus.y),tt+=E+x):y?(a.comments===null?E>Tt&&(Tt=Ty(rt,E-Tt,0),tt=Tt.x,ot=Tt.y,Tt=E,at=0):Tt=Fy(a,Tt,at),0>at&&(tt-=at,at=0),135<b&&(Mt+=zt+x),zt=Math.max(Math.max(zt,It),zt+It+x),ot+=It+x):(135<b&&(at+=Tt+x),Tt=Math.max(Math.max(Tt,E),Tt+E+x),a.comments===null?It>zt&&(zt=Ty(rt,0,It-zt),tt=zt.x,ot=zt.y,zt=It,Mt=0):zt=Ny(a,zt,Mt),0>Mt&&(ot-=Mt,Mt=0),tt+=E+x),0<We)b=Xs(this,4),We=Xs(this,4),y?(b[2].h(0,It+x),b[3].h(b[2].x,zt),We[2].h(Tt,b[2].y),We[3].h(We[2].x,b[3].y)):(b[2].h(E+x,0),b[3].h(Tt,b[2].y),We[2].h(b[2].x,zt),We[3].h(b[3].x,We[2].y));else{for(b=Xs(this,Vt.length+2),We=Xs(this,Xt.length+2),rt=0;rt<Vt.length;rt++)ut=Vt[rt],b[rt+2].h(ut.x+tt,ut.y+ot);for(rt=0;rt<Xt.length;rt++)ut=Xt[rt],We[rt+2].h(ut.x+tt,ut.y+ot)}y?(b[0].h(at,0),b[1].h(b[0].x,It),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])),We[0].h(at+E,0),We[1].h(We[0].x,It),We[2].y<We[1].y&&(We[2].x<We[0].x?We[2].assign(We[1]):We[1].assign(We[2])),We[3].y<We[2].y&&(We[3].x<We[0].x?We[3].assign(We[2]):We[2].assign(We[3])),b[2].y-=x/2,We[2].y-=x/2):(b[0].h(0,Mt),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])),We[0].h(0,Mt+It),We[1].h(E,We[0].y),We[2].x<We[1].x&&(We[2].y<We[0].y?We[2].assign(We[1]):We[1].assign(We[2])),We[3].x<We[2].x&&(We[3].y<We[0].y?We[3].assign(We[2]):We[2].assign(We[3])),b[2].x-=x/2,We[2].x-=x/2),Sl(this,Vt),Sl(this,Xt),a.Yo=b,a.kp=We,a.la.h(at,Mt),a.Da.h(Tt,zt)}break;default:Wt("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=Qh(x));var b=by(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=hl(y),x=E===90||E===270;var z=0;b=y.children;for(var tt=b.length,ot=0;ot<tt;ot++){var rt=b[ot];z=Math.max(z,x?rt.Da.width:rt.Da.height)}var at=y.alignment,ut=at===nu,ft=at===iu;ot=Qh(at);var mt=Math.max(0,y.breadthLimit);rt=a.computeLayerSpacing(y);var yt=y.nodeSpacing,xt=a.computeNodeIndent(y),Mt=ut||ft?0:xt/2,It=y.rowSpacing,Tt=0;(ut||ft||y.hm||y.im&&y.maxGenerationCount===1)&&(Tt=Math.max(0,y.rowIndent)),ut=y.width;var zt=y.height,Ht=0,Vt=0,Xt=0,le=0,$e=0,mn=0,cn=0,We=0,Te=0,oi=0;if(ot&&!wp(at)&&135<E&&b.reverse(),wp(at))if(1<tt)for(var Xn=0;Xn<tt;Xn++){var Gi=b[Xn],ao=Gi.Da;Xn%2===0&&Xn!==tt-1?Te=Math.max(Te,(x?ao.width:ao.height)+a.computeBusNodeSpacing(Gi)-yt):Xn%2!==0&&(oi=Math.max(oi,(x?ao.width:ao.height)+a.computeBusNodeSpacing(Gi)-yt))}else tt===1&&(Te=x?b[0].Da.width:b[0].Da.height);if(ot)switch(at){case ih:case ou:Vt=135>E?hx(a,y,b,Te,Ht,Vt):dx(a,y,b,Te,Ht,Vt),Te=Vt.x,Ht=Vt.width,Vt=Vt.height;break;case oh:for(mt=0;mt<tt;mt++)Mt=b[mt],Xt=Mt.Da,oi=cn===0?0:It,x?(Mt.S.h(z-Xt.width,$e+oi),Ht=Math.max(Ht,Xt.width),Vt=Math.max(Vt,$e+oi+Xt.height),$e+=oi+Xt.height):(Mt.S.h(le+oi,z-Xt.height),Ht=Math.max(Ht,le+oi+Xt.width),Vt=Math.max(Vt,Xt.height),le+=oi+Xt.width),cn++;break;case wu:for(z=0;z<tt;z++)mt=b[z],Mt=mt.Da,Xt=cn===0?0:It,x?(mt.S.h(yt/2+y.focus.x,$e+Xt),Ht=Math.max(Ht,Mt.width),Vt=Math.max(Vt,$e+Xt+Mt.height),$e+=Xt+Mt.height):(mt.S.h(le+Xt,yt/2+y.focus.y),Ht=Math.max(Ht,le+Xt+Mt.width),Vt=Math.max(Vt,Mt.height),le+=Xt+Mt.width),cn++}else for(oi=0;oi<tt;oi++)Xn=b[oi],Gi=Xn.Da,x?(0<mt&&0<cn&&le+yt+Gi.width>mt&&(le<z&&jd(y,at,z-le,0,We,oi-1),mn++,cn=0,We=oi,Xt=Vt,le=0,$e=135<E?-Vt-It:Vt+It),ao=cn===0?Mt:yt,N0(a,Xn,0,$e),Xn.S.h(le+ao,$e),Ht=Math.max(Ht,le+ao+Gi.width),Vt=Math.max(Vt,Xt+(mn===0?0:It)+Gi.height),le+=ao+Gi.width):(0<mt&&0<cn&&$e+yt+Gi.height>mt&&($e<z&&jd(y,at,0,z-$e,We,oi-1),mn++,cn=0,We=oi,Xt=Ht,$e=0,le=135<E?-Ht-It:Ht+It),ao=cn===0?Mt:yt,N0(a,Xn,le,0),Xn.S.h(le,$e+ao),Vt=Math.max(Vt,$e+ao+Gi.height),Ht=Math.max(Ht,Xt+(mn===0?0:It)+Gi.width),$e+=ao+Gi.height),cn++;switch(0<mn&&(x?(Vt+=Math.max(0,rt),le<Ht&&jd(y,at,Ht-le,0,We,tt-1),0<Tt&&(ft||bc(y,Tt,0,0,tt-1),Ht+=Tt)):(Ht+=Math.max(0,rt),$e<Vt&&jd(y,at,0,Vt-$e,We,tt-1),0<Tt&&(ft||bc(y,0,Tt,0,tt-1),Vt+=Tt))),Tt=ft=0,at){case Hf:x?ft+=Ht/2-y.focus.x-xt/2:Tt+=Vt/2-y.focus.y-xt/2;break;case Nc:0<mn?x?ft+=Ht/2-y.focus.x-xt/2:Tt+=Vt/2-y.focus.y-xt/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-xt/2):(a=b[0].S.y+b[0].la.y,Tt+=a+(b[tt-1].S.y+b[tt-1].la.y+2*b[tt-1].focus.y-a)/2-y.focus.y-xt/2);break;case nu:x?(ft-=xt,Ht+=xt):(Tt-=xt,Vt+=xt);break;case iu:x?(ft+=Ht-y.width+xt,Ht+=xt):(Tt+=Vt-y.height+xt,Vt+=xt);break;case ih:case ou:x?1<tt?ft+=Te+yt/2-y.focus.x:ft+=b[0].focus.x-y.focus.x+b[0].la.x:1<tt?Tt+=Te+yt/2-y.focus.y:Tt+=b[0].focus.y-y.focus.y+b[0].la.y;break;case oh:x?ft+=Ht+yt/2-y.focus.x:Tt+=Vt+yt/2-y.focus.y;break;case wu:break;default:a=a.customAlignment(y,ft,Tt,Ht,Vt),ft=a[0],Tt=a[1],Ht=a[2],Vt=a[3]}for(a=0;a<tt;a++)xt=b[a],x?xt.S.h(xt.S.x+xt.la.x-ft,xt.S.y+(135<E?(ot?-Vt:-xt.Da.height)+xt.la.y-rt:zt+rt+xt.la.y)):xt.S.h(xt.S.x+(135<E?(ot?-Ht:-xt.Da.width)+xt.la.x-rt:ut+rt+xt.la.x),xt.S.y+xt.la.y-Tt);x?(Ht=Fy(y,Ht,ft),0>ft&&(ft=0),135<E&&(Tt+=Vt+rt),Vt=Math.max(Math.max(Vt,zt),Vt+zt+rt)):(135<E&&(ft+=Ht+rt),Ht=Math.max(Math.max(Ht,ut),Ht+ut+rt),Vt=Ny(y,Vt,Tt),0>Tt&&(Tt=0)),y.la.h(ft,Tt),y.Da.h(Ht,Vt)}}Li.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 Ce(E,0,b,z);if(tt===1)return y=x[0],b=y.Da.width,z=y.Da.height,new Ce(E,0,b,z);for(var ot=y.nodeSpacing,rt=y.rowSpacing,at=hl(y)===90,ut=0,ft=0,mt=0,yt=0;yt<tt;yt++)if(!(yt%2!==0||1<tt&&yt===tt-1)){var xt=x[yt],Mt=xt.Da,It=ut===0?0:rt;if(at){var Tt=a.computeBusNodeSpacing(xt)-ot;xt.S.h(E-(Mt.width+Tt),mt+It),b=Math.max(b,Mt.width+Tt),z=Math.max(z,mt+It+Mt.height),mt+=It+Mt.height}else Tt=a.computeBusNodeSpacing(xt)-ot,xt.S.h(ft+It,E-(Mt.height+Tt)),z=Math.max(z,Mt.height+Tt),b=Math.max(b,ft+It+Mt.width),ft+=It+Mt.width;ut++}for(ut=0,xt=ft,yt=mt,at?(ft=E+ot,mt=0):(ft=0,mt=E+ot),Mt=0;Mt<tt;Mt++)if(Mt%2!==0){It=x[Mt],Tt=It.Da;var zt=ut===0?0:rt;if(at){var Ht=a.computeBusNodeSpacing(It)-ot;It.S.h(ft+Ht,mt+zt),b=Math.max(b,ft+Tt.width+Ht),z=Math.max(z,mt+zt+Tt.height),mt+=zt+Tt.height}else Ht=a.computeBusNodeSpacing(It)-ot,It.S.h(ft+zt,mt+Ht),b=Math.max(b,ft+zt+Tt.width),z=Math.max(z,mt+Tt.height+Ht),ft+=zt+Tt.width;ut++}return 1<tt&&tt%2===1&&(x=x[tt-1],tt=x.Da,a=a.computeBusLastRowSpacing(x,at?Math.max(Math.abs(yt),Math.abs(mt)):Math.max(Math.abs(xt),Math.abs(ft))),at?(x.S.h(E+ot/2-x.focus.x-x.la.x,z+a),at=E+ot/2-x.focus.x-x.la.x,b=Math.max(b,at+tt.width),0>at&&(b-=at),z=Math.max(z,Math.max(yt,mt)+a+tt.height),0>x.S.x&&(E=F0(y,x.S.x,!1,E,ot))):(x.S.h(b+a,E+ot/2-x.focus.y-x.la.y),b=Math.max(b,Math.max(xt,ft)+a+tt.width),mt=E+ot/2-x.focus.y-x.la.y,z=Math.max(z,mt+tt.height),0>mt&&(z-=mt),0>x.S.y&&(E=F0(y,x.S.y,!0,E,ot)))),new Ce(E,0,b,z)}function dx(a,y,x,E,b,z){var tt=x.length;if(tt===0)return new Ce(E,0,b,z);if(tt===1)return x=x[0],b=x.Da.width,z=x.Da.height,new Ce(E,0,b,z);for(var ot=y.nodeSpacing,rt=y.rowSpacing,at=hl(y)===270,ut=0,ft=0,mt=0,yt=0;yt<tt;yt++)if(!(yt%2!==0||1<tt&&yt===tt-1)){var xt=x[yt],Mt=xt.Da,It=ut===0?0:rt;if(at){var Tt=a.computeBusNodeSpacing(xt)-ot;mt-=It+Mt.height,xt.S.h(E-(Mt.width+Tt),mt),b=Math.max(b,Mt.width+Tt),z=Math.max(z,Math.abs(mt))}else Tt=a.computeBusNodeSpacing(xt)-ot,ft-=It+Mt.width,xt.S.h(ft,E-(Mt.height+Tt)),z=Math.max(z,Mt.height+Tt),b=Math.max(b,Math.abs(ft));ut++}for(ut=0,xt=ft,yt=mt,at?(ft=E+ot,mt=0):(ft=0,mt=E+ot),Mt=0;Mt<tt;Mt++)if(Mt%2!==0){It=x[Mt],Tt=It.Da;var zt=ut===0?0:rt;if(at){var Ht=a.computeBusNodeSpacing(It)-ot;mt-=zt+Tt.height,It.S.h(ft+Ht,mt),b=Math.max(b,ft+Tt.width+Ht),z=Math.max(z,Math.abs(mt))}else Ht=a.computeBusNodeSpacing(It)-ot,ft-=zt+Tt.width,It.S.h(ft,mt+Ht),z=Math.max(z,mt+Tt.height+Ht),b=Math.max(b,Math.abs(ft));ut++}for(1<tt&&tt%2===1&&(rt=x[tt-1],ut=rt.Da,a=a.computeBusLastRowSpacing(rt,at?Math.max(Math.abs(yt),Math.abs(mt)):Math.max(Math.abs(xt),Math.abs(ft))),at?(rt.S.h(E+ot/2-rt.focus.x-rt.la.x,-z-ut.height-a),ft=E+ot/2-rt.focus.x-rt.la.x,b=Math.max(b,ft+ut.width),0>ft&&(b-=ft),z=Math.max(z,Math.abs(Math.min(yt,mt))+a+ut.height),0>rt.S.x&&(E=F0(y,rt.S.x,!1,E,ot))):(rt.S.h(-b-ut.width-a,E+ot/2-rt.focus.y-rt.la.y),b=Math.max(b,Math.abs(Math.min(xt,ft))+a+ut.width),mt=E+ot/2-rt.focus.y-rt.la.y,z=Math.max(z,mt+ut.height),0>mt&&(z-=mt),0>rt.S.y&&(E=F0(y,rt.S.y,!0,E,ot)))),y=0;y<tt;y++)ot=x[y],at?ot.S.h(ot.S.x,ot.S.y+z):ot.S.h(ot.S.x+b,ot.S.y);return new Ce(E,0,b,z)}Li.prototype.computeBusNodeSpacing=function(a){return a.parent===null?0:a.parent.nodeSpacing},Li.prototype.computeBusLastRowSpacing=function(a){return a.parent===null?0:a.parent.rowSpacing};function F0(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 Fy(a,y,x){switch(a.alignment){case Nc:case Hf:return x+a.width>y&&(y=x+a.width),0>x&&(y-=x),y;case nu:return a.width>y?a.width:y;case iu:return 2*a.focus.x>y?a.width:y+a.width-2*a.focus.x;case ih:case ou:return Math.max(a.width,Math.max(y,x+a.width)-Math.min(0,x));case oh:return a.width-a.focus.x+a.nodeSpacing/2+y;case wu:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+y);default:return y}}function Ny(a,y,x){switch(a.alignment){case Nc:case Hf:return x+a.height>y&&(y=x+a.height),0>x&&(y-=x),y;case nu:return a.height>y?a.height:y;case iu:return 2*a.focus.y>y?a.height:y+a.height-2*a.focus.y;case ih:case ou:return Math.max(a.height,Math.max(y,x+a.height)-Math.min(0,x));case oh:return a.height-a.focus.y+a.nodeSpacing/2+y;case wu:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+y);default:return y}}function Ty(a,y,x){switch(a){case Hf:y/=2,x/=2;break;case Nc:y/=2,x/=2;break;case nu:x=y=0;break;case iu:break;default:Wt("Unhandled alignment value "+a.toString())}return new Bt(y,x)}function jd(a,y,x,E,b,z){y=Ty(y,x,E),bc(a,y.x,y.y,b,z)}function bc(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 N0(a,y,x,E){var b=y.parent;switch(a.ud){case eu:for(a=y.sourceEdges;a.next();)y=a.value,y.fromVertex===b&&y.relativePoint.h(x,E);break;case Fc:for(a=y.destinationEdges;a.next();)y=a.value,y.toVertex===b&&y.relativePoint.h(x,E);break;default:Wt("Unhandled path value "+a.ud.toString())}}function T0(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,ot){var rt=hl(y),at=rt===90||rt===270,ut=y.nodeSpacing;y=E;var ft=b;E=z;var mt=tt,yt=x.Yo,xt=x.kp;tt=x.Da;var Mt=at?Math.max(mt,tt.height):Math.max(E,tt.width);if((yt===null||rt!==hl(x))&&(yt=Xs(a,2),xt=Xs(a,2),at?(yt[0].h(0,0),yt[1].h(0,tt.height),xt[0].h(tt.width,0),xt[1].h(xt[0].x,yt[1].y)):(yt[0].h(0,0),yt[1].h(tt.width,0),xt[0].h(0,tt.height),xt[1].h(yt[1].x,xt[0].y))),at){if(mt=9999999,!(ft===null||2>ft.length||yt===null||2>yt.length))for(b=x=0;x<ft.length&&b<yt.length;){z=ft[x];var It=yt[b];rt=It.x,at=It.y,rt+=E;var Tt=z;x+1<ft.length&&(Tt=ft[x+1]);var zt=It;It=zt.x,zt=zt.y,b+1<yt.length&&(zt=yt[b+1],It=zt.x,zt=zt.y,It+=E);var Ht=mt;z.y===at?Ht=rt-z.x:z.y>at&&z.y<zt?Ht=rt+(z.y-at)/(zt-at)*(It-rt)-z.x:at>z.y&&at<Tt.y&&(Ht=rt-(z.x+(at-z.y)/(Tt.y-z.y)*(Tt.x-z.x))),Ht<mt&&(mt=Ht),Tt.y<=z.y?x++:zt<=at?b++:(Tt.y<=zt&&x++,zt<=Tt.y&&b++)}if(mt=E-mt,mt+=ut,x=yt,b=mt,y===null||2>y.length||x===null||2>x.length)E=null;else{for(ut=Xs(a,y.length+x.length),E=z=rt=0;z<x.length&&x[z].y<y[0].y;)at=x[z++],ut[E++].h(at.x+b,at.y);for(;rt<y.length;)at=y[rt++],ut[E++].h(at.x,at.y);for(rt=y[y.length-1].y;z<x.length&&x[z].y<=rt;)z++;for(;z<x.length&&x[z].y>rt;)at=x[z++],ut[E++].h(at.x+b,at.y);for(x=Xs(a,E),rt=0;rt<E;rt++)x[rt].assign(ut[rt]);Sl(a,ut),E=x}if(z=xt,rt=mt,ft===null||2>ft.length||z===null||2>z.length)b=null;else{for(ut=Xs(a,ft.length+z.length),b=at=x=0;x<ft.length&&ft[x].y<z[0].y;)Tt=ft[x++],ut[b++].h(Tt.x,Tt.y);for(;at<z.length;)Tt=z[at++],ut[b++].h(Tt.x+rt,Tt.y);for(z=z[z.length-1].y;x<ft.length&&ft[x].y<=z;)x++;for(;x<ft.length&&ft[x].y>z;)rt=ft[x++],ut[b++].h(rt.x,rt.y);for(z=Xs(a,b),x=0;x<b;x++)z[x].assign(ut[x]);Sl(a,ut),b=z}return z=Math.max(0,mt)+tt.width,tt=Mt,Sl(a,y),Sl(a,yt),Sl(a,ft),Sl(a,xt),ot[0]=E,ot[1]=b,new Ce(mt,0,z,tt)}if(E=9999999,!(ft===null||2>ft.length||yt===null||2>yt.length))for(b=x=0;x<ft.length&&b<yt.length;)z=ft[x],It=yt[b],rt=It.x,at=It.y,at+=mt,Tt=z,x+1<ft.length&&(Tt=ft[x+1]),zt=It,It=zt.x,zt=zt.y,b+1<yt.length&&(zt=yt[b+1],It=zt.x,zt=zt.y,zt+=mt),Ht=E,z.x===rt?Ht=at-z.y:z.x>rt&&z.x<It?Ht=at+(z.x-rt)/(It-rt)*(zt-at)-z.y:rt>z.x&&rt<Tt.x&&(Ht=at-(z.y+(rt-z.x)/(Tt.x-z.x)*(Tt.y-z.y))),Ht<E&&(E=Ht),Tt.x<=z.x?x++:It<=rt?b++:(Tt.x<=It&&x++,It<=Tt.x&&b++);if(mt-=E,mt+=ut,x=yt,b=mt,y===null||2>y.length||x===null||2>x.length)E=null;else{for(ut=Xs(a,y.length+x.length),E=z=rt=0;z<x.length&&x[z].x<y[0].x;)at=x[z++],ut[E++].h(at.x,at.y+b);for(;rt<y.length;)at=y[rt++],ut[E++].h(at.x,at.y);for(rt=y[y.length-1].x;z<x.length&&x[z].x<=rt;)z++;for(;z<x.length&&x[z].x>rt;)at=x[z++],ut[E++].h(at.x,at.y+b);for(x=Xs(a,E),rt=0;rt<E;rt++)x[rt].assign(ut[rt]);Sl(a,ut),E=x}if(z=xt,rt=mt,ft===null||2>ft.length||z===null||2>z.length)b=null;else{for(ut=Xs(a,ft.length+z.length),b=at=x=0;x<ft.length&&ft[x].x<z[0].x;)Tt=ft[x++],ut[b++].h(Tt.x,Tt.y);for(;at<z.length;)Tt=z[at++],ut[b++].h(Tt.x,Tt.y+rt);for(z=z[z.length-1].x;x<ft.length&&ft[x].x<=z;)x++;for(;x<ft.length&&ft[x].x>z;)rt=ft[x++],ut[b++].h(rt.x,rt.y);for(z=Xs(a,b),x=0;x<b;x++)z[x].assign(ut[x]);Sl(a,ut),b=z}return z=Mt,tt=Math.max(0,mt)+tt.height,Sl(a,y),Sl(a,yt),Sl(a,ft),Sl(a,xt),ot[0]=E,ot[1]=b,new Ce(mt,0,z,tt)}function Xs(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 Bt;return a}function Sl(a,y){var x=y.length,E=a.ru[x];E===void 0&&(E=[],a.ru[x]=E),E.push(y)}Li.prototype.arrangeTrees=function(){if(this.Rb===I0)for(var a=this.Ub.iterator;a.next();){var y=a.value;if(y instanceof Xa){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 Xa&&a.push(x);switch(this.sorting){case Gf:break;case Pp:a.reverse();break;case Cp:a.sort(this.comparer);break;case Lp:a.sort(this.comparer),a.reverse();break;default:Wt("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 O0:x+=b.Da.height+this.$d.height;break;case Iy:y+=b.Da.width+this.$d.width;break;default:Wt("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)}}}Li.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},Li.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)},Li.prototype.Gu=function(){if(this.layerStyle===R0){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 Bt(-this.nodeSpacing/2,-this.layerSpacing/2)):(x.Bc(this.layerSpacing,this.nodeSpacing/2),E=new Bt(-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 ot=a[tt]+y[tt];this.angle===270?(z-=ot,b.push(new Ce(0,z,x,ot))):this.angle===90?(b.push(new Ce(0,z,x,ot)),z+=ot):this.angle===180?(z-=ot,b.push(new Ce(z,0,ot,x))):(b.push(new Ce(z,0,ot,x)),z+=ot)}this.commitLayers(b,E)}},Li.prototype.commitLayers=function(){},Li.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},Li.prototype.yv=function(){for(var a=this.Ub.iterator;a.next();){var y=a.value;y instanceof Xa&&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])}}Li.prototype.setPortSpots=function(a){var y=a.alignment;if(Qh(y)){var x=this.ud===eu,E=hl(a);switch(E){case 0:var b=Ur;break;case 90:b=es;break;case 180:b=Rs;break;default:b=Is}var z=a.children,tt=z.length;switch(y){case ih:case ou:for(y=0;y<tt;y++){var ot=z[y];if(ot=(x?ot.sourceEdges:ot.destinationEdges).first(),ot!==null&&(ot=ot.link,ot!==null)){var rt=E===90||E===270?Rs:Is;if(tt===1||y===tt-1&&tt%2===1)switch(E){case 0:rt=Rs;break;case 90:rt=Is;break;case 180:rt=Ur;break;default:rt=es}else y%2===0&&(rt=E===90||E===270?Ur:es);x?(a.setsPortSpot&&(ot.fromSpot=b),a.setsChildPortSpot&&(ot.toSpot=rt)):(a.setsPortSpot&&(ot.fromSpot=rt),a.setsChildPortSpot&&(ot.toSpot=b))}}break;case oh:for(E=E===90||E===270?Ur:es,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 wu:for(E=E===90||E===270?Rs:Is,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=hl(a),this.ud===eu){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=Ur;break;case 90:E.fromSpot=es;break;case 180:E.fromSpot=Rs;break;default:E.fromSpot=Is}else E.fromSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.toSpot=Rs;break;case 90:E.toSpot=Is;break;case 180:E.toSpot=Ur;break;default:E.toSpot=es}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=Ur;break;case 90:E.toSpot=es;break;case 180:E.toSpot=Rs;break;default:E.toSpot=Is}else E.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.fromSpot=Rs;break;case 90:E.fromSpot=Is;break;case 180:E.fromSpot=Ur;break;default:E.fromSpot=es}else E.fromSpot=a.childPortSpot}};function hl(a){return a=a.angle,45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}Li.prototype.computeLayerSpacing=function(a){var y=hl(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},Li.prototype.computeNodeIndent=function(a){var y=hl(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)},oe.Object.defineProperties(Li.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!==D0&&a!==Dy&&a!==By&&a!==Oy||(this.vo=a,this.C())}},layerStyle:{get:function(){return this.Bq},set:function(a){this.Rb===a||a!==Ry&&a!==jy&&a!==R0||(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!==O0&&a!==Iy&&a!==I0||(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!==Gf&&a!==Pp&&a!==Cp&&!Lp||(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()):Wt("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!==B0&&a!==kp||(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!==Gf&&a!==Pp&&a!==Cp&&!Lp||(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!==B0&&a!==kp||(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 A0=new Se(Li,"PathDefault",-1),eu=new Se(Li,"PathDestination",0),Fc=new Se(Li,"PathSource",1),Gf=new Se(Li,"SortingForwards",10),Pp=new Se(Li,"SortingReverse",11),Cp=new Se(Li,"SortingAscending",12),Lp=new Se(Li,"SortingDescending",13),Hf=new Se(Li,"AlignmentCenterSubtrees",20),Nc=new Se(Li,"AlignmentCenterChildren",21),nu=new Se(Li,"AlignmentStart",22),iu=new Se(Li,"AlignmentEnd",23),ih=new Se(Li,"AlignmentBus",24),ou=new Se(Li,"AlignmentBusBranching",25),oh=new Se(Li,"AlignmentTopLeftBus",26),wu=new Se(Li,"AlignmentBottomRightBus",27),B0=new Se(Li,"CompactionNone",30),kp=new Se(Li,"CompactionBlock",31),D0=new Se(Li,"StyleLayered",40),By=new Se(Li,"StyleLastParents",41),Dy=new Se(Li,"StyleAlternating",42),Oy=new Se(Li,"StyleRootOnly",43),O0=new Se(Li,"ArrangementVertical",50),Iy=new Se(Li,"ArrangementHorizontal",51),I0=new Se(Li,"ArrangementFixedRoots",52),Ry=new Se(Li,"LayerIndividual",60),jy=new Se(Li,"LayerSiblings",61),R0=new Se(Li,"LayerUniform",62);Li.className="TreeLayout",Li.PathDefault=A0,Li.PathDestination=eu,Li.PathSource=Fc,Li.SortingForwards=Gf,Li.SortingReverse=Pp,Li.SortingAscending=Cp,Li.SortingDescending=Lp,Li.AlignmentCenterSubtrees=Hf,Li.AlignmentCenterChildren=Nc,Li.AlignmentStart=nu,Li.AlignmentEnd=iu,Li.AlignmentBus=ih,Li.AlignmentBusBranching=ou,Li.AlignmentTopLeftBus=oh,Li.AlignmentBottomRightBus=wu,Li.CompactionNone=B0,Li.CompactionBlock=kp,Li.StyleLayered=D0,Li.StyleLastParents=By,Li.StyleAlternating=Dy,Li.StyleRootOnly=Oy,Li.ArrangementVertical=O0,Li.ArrangementHorizontal=Iy,Li.ArrangementFixedRoots=I0,Li.LayerIndividual=Ry,Li.LayerSiblings=jy,Li.LayerUniform=R0;function Tc(a){ho.call(this,a)}he(Tc,ho),Tc.prototype.createVertex=function(){return new Xa(this)},Tc.prototype.createEdge=function(){return new Wf(this)},Tc.className="TreeNetwork";function Xa(a){yr.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 Bt(0,0),this.Da=new Qe(0,0),this.la=new Bt(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=Gf,this.hd=oy,this.Kb=0,this.Jb=Nc,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=kp,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=Fr,this.wr=!0,this.Dp=Fr}he(Xa,yr),Xa.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)},oe.Object.defineProperties(Xa.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)}}}),Xa.className="TreeVertex";function Wf(a){aa.call(this,a),this.$t=new Bt(0,0)}he(Wf,aa),Wf.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 eu:x=this.fromVertex,E=this.toVertex;break;case Fc:x=this.toVertex,E=this.fromVertex;break;default:Wt("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=hl(x),tt=y.computeLayerSpacing(x),ot=x.rowSpacing;a.vg();var rt=a.curve===wa,at=a.isOrthogonal,ut;if(a.uh(),at||rt){for(ut=2;4<a.pointsCount;)a.pv(2);var ft=a.i(1),mt=a.i(2)}else{for(ut=1;3<a.pointsCount;)a.pv(1);ft=a.i(0),mt=a.i(a.pointsCount-1)}var yt=a.i(a.pointsCount-1);z===0?(x.alignment===iu?(z=E.bottom+b.y,b.y===0&&ft.y>yt.y+x.rowIndent&&(z=Math.min(z,Math.max(ft.y,z-y.computeNodeIndent(x))))):x.alignment===nu?(z=E.top+b.y,b.y===0&&ft.y<yt.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,rt?(a.m(ut,ft.x,z),ut++,a.m(ut,E.right+tt,z),ut++,a.m(ut,E.right+tt+(b.x-ot)/3,z),ut++,a.m(ut,E.right+tt+2*(b.x-ot)/3,z),ut++,a.m(ut,E.right+tt+(b.x-ot),z),ut++,a.m(ut,mt.x,z)):(at&&(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-(at?ot/2:ot),z),ut++,at&&a.m(ut,a.i(ut-1).x,mt.y))):z===90?(x.alignment===iu?(z=E.right+b.x,b.x===0&&ft.x>yt.x+x.rowIndent&&(z=Math.min(z,Math.max(ft.x,z-y.computeNodeIndent(x))))):x.alignment===nu?(z=E.left+b.x,b.x===0&&ft.x<yt.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,rt?(a.m(ut,z,ft.y),ut++,a.m(ut,z,E.bottom+tt),ut++,a.m(ut,z,E.bottom+tt+(b.y-ot)/3),ut++,a.m(ut,z,E.bottom+tt+2*(b.y-ot)/3),ut++,a.m(ut,z,E.bottom+tt+(b.y-ot)),ut++,a.m(ut,z,mt.y)):(at&&(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-(at?ot/2:ot)),ut++,at&&a.m(ut,mt.x,a.i(ut-1).y))):z===180?(x.alignment===iu?(z=E.bottom+b.y,b.y===0&&ft.y>yt.y+x.rowIndent&&(z=Math.min(z,Math.max(ft.y,z-y.computeNodeIndent(x))))):x.alignment===nu?(z=E.top+b.y,b.y===0&&ft.y<yt.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,rt?(a.m(ut,ft.x,z),ut++,a.m(ut,E.left-tt,z),ut++,a.m(ut,E.left-tt+(b.x+ot)/3,z),ut++,a.m(ut,E.left-tt+2*(b.x+ot)/3,z),ut++,a.m(ut,E.left-tt+(b.x+ot),z),ut++,a.m(ut,mt.x,z)):(at&&(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+(at?ot/2:ot),z),ut++,at&&a.m(ut,a.i(ut-1).x,mt.y))):z===270?(x.alignment===iu?(z=E.right+b.x,b.x===0&&ft.x>yt.x+x.rowIndent&&(z=Math.min(z,Math.max(ft.x,z-y.computeNodeIndent(x))))):x.alignment===nu?(z=E.left+b.x,b.x===0&&ft.x<yt.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,rt?(a.m(ut,z,ft.y),ut++,a.m(ut,z,E.top-tt),ut++,a.m(ut,z,E.top-tt+(b.y+ot)/3),ut++,a.m(ut,z,E.top-tt+2*(b.y+ot)/3),ut++,a.m(ut,z,E.top-tt+(b.y+ot)),ut++,a.m(ut,z,mt.y)):(at&&(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+(at?ot/2:ot)),ut++,at&&a.m(ut,mt.x,a.i(ut-1).y))):Wt("Invalid angle "+z),a.zf()}else b=E,a=this.link,E=this.network.layout,y=hl(x),y!==hl(b)&&(tt=E.computeLayerSpacing(x),ot=x.bounds,x=b.bounds,y===0&&x.left-ot.right<tt+1||y===90&&x.top-ot.bottom<tt+1||y===180&&ot.left-x.right<tt+1||y===270&&ot.top-x.bottom<tt+1||(a.vg(),x=a.curve===wa,b=a.isOrthogonal,E=Qh(this.fromVertex.alignment),a.uh(),y===0?(y=ot.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=ot.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=ot.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=ot.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()))}}},oe.Object.defineProperties(Wf.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)}}}),Wf.className="TreeEdge",Eo.prototype.initializeStandardTools=function(){this.gb("Action",new Ha,this.mouseDownTools),this.gb("Relinking",new ma,this.mouseDownTools),this.gb("LinkReshaping",new or,this.mouseDownTools),this.gb("Rotating",new ws,this.mouseDownTools),this.gb("Resizing",new ns,this.mouseDownTools),this.gb("Linking",new xs,this.mouseMoveTools),this.gb("Dragging",new Oo,this.mouseMoveTools),this.gb("DragSelecting",new ka,this.mouseMoveTools),this.gb("Panning",new Kr,this.mouseMoveTools),this.gb("ContextMenu",new Ps,this.mouseUpTools),this.gb("TextEditing",new xo,this.mouseUpTools),this.gb("ClickCreating",new ju,this.mouseUpTools),this.gb("ClickSelecting",new Lh,this.mouseUpTools)},Ol("Horizontal",new cm),Ol("Spot",new gm),Ol("Table",new mm),Ol("Viewbox",new Sm),Ol("TableRow",new vm),Ol("TableColumn",new ym),Ol("Graduated",new Gg),Ol("Grid",new zg),cf.add("GraphLinksModel",Mr),cf.add("TreeModel",Ba);var j0=Ke.go,_y={get licenseKey(){return ue.licenseKey},set licenseKey(a){ue.licenseKey=a},get version(){return ue.version},Group:ri,EnumValue:Se,List:ke,Set:Me,Map:kn,Point:Bt,Size:Qe,Rect:Ce,Margin:yi,Spot:rn,Geometry:Ue,PathFigure:xr,PathSegment:_i,InputEvent:us,DiagramEvent:Fu,ChangedEvent:Ao,Model:Ln,GraphLinksModel:Ei,TreeModel:Ns,Binding:sr,Transaction:kr,UndoManager:Do,CommandHandler:Ot,Tool:Oi,DraggingTool:Oo,DraggingInfo:pu,DraggingOptions:st,LinkingBaseTool:Qo,LinkingTool:xs,RelinkingTool:ma,LinkReshapingTool:or,ResizingTool:ns,RotatingTool:ws,ClickSelectingTool:Lh,ActionTool:Ha,ClickCreatingTool:ju,HTMLInfo:Nl,ContextMenuTool:Ps,DragSelectingTool:ka,PanningTool:Kr,TextEditingTool:xo,ToolManager:Eo,Animation:Xr,AnimationManager:oa,AnimationTrigger:nl,Layer:Nr,Diagram:ue,Palette:dt,Overview:gt,Brush:Qi,GraphObject:Jt,Panel:ze,RowColumnDefinition:gr,Shape:gi,TextBlock:uo,Picture:Ws,Part:On,Adornment:Ii,Node:nn,Link:Ve,Placeholder:Ms,Layout:Mo,LayoutNetwork:ho,LayoutVertex:yr,LayoutEdge:aa,GridLayout:jr,PanelLayout:vr,CircularLayout:Io,CircularNetwork:jf,CircularVertex:pp,CircularEdge:y0,ForceDirectedLayout:Qr,ForceDirectedNetwork:Ec,ForceDirectedVertex:mp,ForceDirectedEdge:vp,LayeredDigraphLayout:$i,LayeredDigraphNetwork:zf,LayeredDigraphVertex:Oa,LayeredDigraphEdge:xp,TreeLayout:Li,TreeNetwork:Tc,TreeVertex:Xa,TreeEdge:Wf};typeof j0=="object"&&j0.version&&ye("WARNING: a `go` object on the root object is already defined. "+("Debug"in j0?"debug ":"")+"version: "+j0.version+", replaced with version: "+_y.version),ue.prototype.go=_y,Ke.go=_y,typeof un.exports=="object"&&(un.exports=typeof Yt.g!="undefined"?Yt.g.go:self.go)}();var St=typeof Yt.g!="undefined"?Yt.g.go:self.go;const fe=typeof Yt.g!="undefined"?Yt.g.go:self.go,be=fe.Group,Xe=fe.EnumValue,ge=fe.List,re=fe.Set,se=fe.Map,Ie=fe.Point,Le=fe.Size,$t=fe.Rect,Ze=fe.Margin,ae=fe.Spot,Re=fe.Geometry,Nt=fe.PathFigure,et=fe.PathSegment,nt=fe.InputEvent,ct=fe.DiagramEvent,lt=fe.ChangedEvent,pt=fe.Model,vt=fe.GraphLinksModel,Lt=fe.TreeModel,bt=fe.Binding,Gt=fe.Transaction,jt=fe.UndoManager,ne=fe.CommandHandler,ie=fe.Tool,te=fe.DraggingTool,Ge=fe.DraggingInfo,pe=fe.LinkingBaseTool,Je=fe.LinkingTool,Ye=fe.RelinkingTool,hn=fe.LinkReshapingTool,Fn=fe.ResizingTool,vn=fe.RotatingTool,pi=fe.ClickSelectingTool,yn=fe.ActionTool,ce=fe.ClickCreatingTool,Kt=fe.HTMLInfo,tn=fe.ContextMenuTool,Yn=fe.DragSelectingTool,Dn=fe.PanningTool,je=fe.TextEditingTool,gn=fe.ToolManager,Tn=fe.Animation,Jn=fe.AnimationManager,Pn=fe.AnimationTrigger,Qn=fe.Layer,ee=fe.Diagram,jn=fe.Palette,hi=fe.Overview,Dt=fe.Brush,kt=fe.GraphObject,wt=fe.Panel,At=fe.RowColumnDefinition,_t=fe.Shape,Et=fe.TextBlock,Pe=fe.TextBlockMetrics,Ee=fe.Picture,sn=fe.Part,He=fe.Adornment,Ae=fe.Node,qe=fe.Link,en=fe.Placeholder,dn=fe.Layout,An=fe.LayoutNetwork,_n=fe.LayoutVertex,fn=fe.LayoutEdge,Zi=fe.GridLayout,Pi=fe.PanelLayout,zi=fe.CircularLayout,Hi=fe.CircularNetwork,po=fe.CircularVertex,oo=fe.CircularEdge,Fi=fe.ForceDirectedLayout,Ki=fe.ForceDirectedNetwork,hr=fe.ForceDirectedVertex,Yo=fe.ForceDirectedEdge,Ro=fe.LayeredDigraphLayout,er=fe.LayeredDigraphNetwork,$o=fe.LayeredDigraphVertex,Sr=fe.LayeredDigraphEdge,Br=fe.TreeLayout,nr=fe.TreeNetwork,zo=fe.TreeVertex,Xi=fe.TreeEdge,ro=fe.version},2859:function(un,Gn,Yt){"use strict";Yt.d(Gn,{hP:function(){return hi}});var St=function(Dt,kt){return(St=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(wt,At){wt.__proto__=At}||function(wt,At){for(var _t in At)Object.prototype.hasOwnProperty.call(At,_t)&&(wt[_t]=At[_t])})(Dt,kt)};function fe(Dt,kt){function wt(){this.constructor=Dt}St(Dt,kt),Dt.prototype=kt===null?Object.create(kt):(wt.prototype=kt.prototype,new wt)}function be(Dt,kt,wt,At){return new(wt||(wt=Promise))(function(_t,Et){function Pe(He){try{sn(At.next(He))}catch(Ae){Et(Ae)}}function Ee(He){try{sn(At.throw(He))}catch(Ae){Et(Ae)}}function sn(He){var Ae;He.done?_t(He.value):(Ae=He.value,Ae instanceof wt?Ae:new wt(function(qe){qe(Ae)})).then(Pe,Ee)}sn((At=At.apply(Dt,kt||[])).next())})}function Xe(Dt,kt){var wt,At,_t,Et,Pe={label:0,sent:function(){if(1&_t[0])throw _t[1];return _t[1]},trys:[],ops:[]};return Et={next:Ee(0),throw:Ee(1),return:Ee(2)},typeof Symbol=="function"&&(Et[Symbol.iterator]=function(){return this}),Et;function Ee(sn){return function(He){return function(Ae){if(wt)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(wt=1,At&&(_t=2&Ae[0]?At.return:Ae[0]?At.throw||((_t=At.return)&&_t.call(At),0):At.next)&&!(_t=_t.call(At,Ae[1])).done)return _t;switch(At=0,_t&&(Ae=[2&Ae[0],_t.value]),Ae[0]){case 0:case 1:_t=Ae;break;case 4:return Pe.label++,{value:Ae[1],done:!1};case 5:Pe.label++,At=Ae[1],Ae=[0];continue;case 7:Ae=Pe.ops.pop(),Pe.trys.pop();continue;default:if(_t=Pe.trys,!((_t=_t.length>0&&_t[_t.length-1])||Ae[0]!==6&&Ae[0]!==2)){Pe=0;continue}if(Ae[0]===3&&(!_t||Ae[1]>_t[0]&&Ae[1]<_t[3])){Pe.label=Ae[1];break}if(Ae[0]===6&&Pe.label<_t[1]){Pe.label=_t[1],_t=Ae;break}if(_t&&Pe.label<_t[2]){Pe.label=_t[2],Pe.ops.push(Ae);break}_t[2]&&Pe.ops.pop(),Pe.trys.pop();continue}Ae=kt.call(Dt,Pe)}catch(qe){Ae=[6,qe],At=0}finally{wt=_t=0}if(5&Ae[0])throw Ae[1];return{value:Ae[0]?Ae[1]:void 0,done:!0}}([sn,He])}}}function ge(){for(var Dt=0,kt=0,wt=arguments.length;kt<wt;kt++)Dt+=arguments[kt].length;var At=Array(Dt),_t=0;for(kt=0;kt<wt;kt++)for(var Et=arguments[kt],Pe=0,Ee=Et.length;Pe<Ee;Pe++,_t++)At[_t]=Et[Pe];return At}var re=function(){function Dt(){}return Dt.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Dt.setAttributes=function(kt,wt){for(var At=0,_t=wt;At<_t.length;At++){var Et=_t[At],Pe=Et[0],Ee=Et[1];kt.setAttribute(Pe,Ee)}},Dt.createRect=function(kt,wt,At){var _t=document.createElementNS("http://www.w3.org/2000/svg","rect");return _t.setAttribute("width",kt.toString()),_t.setAttribute("height",wt.toString()),At&&Dt.setAttributes(_t,At),_t},Dt.createLine=function(kt,wt,At,_t,Et){var Pe=document.createElementNS("http://www.w3.org/2000/svg","line");return Pe.setAttribute("x1",kt.toString()),Pe.setAttribute("y1",wt.toString()),Pe.setAttribute("x2",At.toString()),Pe.setAttribute("y2",_t.toString()),Et&&Dt.setAttributes(Pe,Et),Pe},Dt.createPolygon=function(kt,wt){var At=document.createElementNS("http://www.w3.org/2000/svg","polygon");return At.setAttribute("points",kt),wt&&Dt.setAttributes(At,wt),At},Dt.createCircle=function(kt,wt){var At=document.createElementNS("http://www.w3.org/2000/svg","circle");return At.setAttribute("cx",(kt/2).toString()),At.setAttribute("cy",(kt/2).toString()),At.setAttribute("r",kt.toString()),wt&&Dt.setAttributes(At,wt),At},Dt.createEllipse=function(kt,wt,At){var _t=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return _t.setAttribute("cx",(kt/2).toString()),_t.setAttribute("cy",(wt/2).toString()),_t.setAttribute("rx",(kt/2).toString()),_t.setAttribute("ry",(wt/2).toString()),At&&Dt.setAttributes(_t,At),_t},Dt.createGroup=function(kt){var wt=document.createElementNS("http://www.w3.org/2000/svg","g");return kt&&Dt.setAttributes(wt,kt),wt},Dt.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Dt.createMarker=function(kt,wt,At,_t,Et,Pe,Ee){var sn=document.createElementNS("http://www.w3.org/2000/svg","marker");return Dt.setAttributes(sn,[["id",kt],["orient",wt],["markerWidth",At.toString()],["markerHeight",_t.toString()],["refX",Et.toString()],["refY",Pe.toString()]]),sn.appendChild(Ee),sn},Dt.createText=function(kt){var wt=document.createElementNS("http://www.w3.org/2000/svg","text");return wt.setAttribute("x","0"),wt.setAttribute("y","0"),kt&&Dt.setAttributes(wt,kt),wt},Dt.createTSpan=function(kt,wt){var At=document.createElementNS("http://www.w3.org/2000/svg","tspan");return At.textContent=kt,wt&&Dt.setAttributes(At,wt),At},Dt.createImage=function(kt){var wt=document.createElementNS("http://www.w3.org/2000/svg","image");return kt&&Dt.setAttributes(wt,kt),wt},Dt.createPoint=function(kt,wt){var At=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return At.x=kt,At.y=wt,At},Dt.createPath=function(kt,wt){var At=document.createElementNS("http://www.w3.org/2000/svg","path");return At.setAttribute("d",kt),wt&&Dt.setAttributes(At,wt),At},Dt}(),se=function(){function Dt(){}return Dt.addKey=function(kt){Dt.key=kt},Object.defineProperty(Dt,"isLicensed",{get:function(){return!!Dt.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Dt.key)},enumerable:!1,configurable:!0}),Dt}(),Ie=function(){function Dt(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Dt.prototype.rasterize=function(kt,wt,At){var _t=this;return new Promise(function(Et){var Pe=At!==void 0?At:document.createElement("canvas");kt===null&&(_t.markersOnly=!0,_t.naturalSize=!1);var Ee=document.createElementNS("http://www.w3.org/2000/svg","svg");Ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ee.setAttribute("width",wt.width.baseVal.valueAsString),Ee.setAttribute("height",wt.height.baseVal.valueAsString),Ee.setAttribute("viewBox","0 0 "+wt.viewBox.baseVal.width.toString()+" "+wt.viewBox.baseVal.height.toString()),Ee.innerHTML=wt.innerHTML,_t.naturalSize===!0?(Ee.width.baseVal.value=kt.naturalWidth,Ee.height.baseVal.value=kt.naturalHeight):_t.width!==void 0&&_t.height!==void 0&&(Ee.width.baseVal.value=_t.width,Ee.height.baseVal.value=_t.height),Pe.width=Ee.width.baseVal.value,Pe.height=Ee.height.baseVal.value;var sn=Ee.outerHTML,He=Pe.getContext("2d");_t.markersOnly!==!0&&He.drawImage(kt,0,0,Pe.width,Pe.height);var Ae=window.URL,qe=new Image(Pe.width,Pe.height);qe.setAttribute("crossOrigin","anonymous");var en=new Blob([sn],{type:"image/svg+xml"}),dn=Ae.createObjectURL(en);qe.onload=function(){He.drawImage(qe,0,0),Ae.revokeObjectURL(dn);var An=Pe.toDataURL(_t.imageType,_t.imageQuality);Et(An)},qe.src=dn})},Dt}(),Le=function(){},$t=function(){function Dt(kt){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+kt+"_"}return Object.defineProperty(Dt.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.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(Dt.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Dt.prototype.addClass=function(kt){return this.styleSheet===void 0&&this.addStyleSheet(),kt.name=""+this.classNamePrefix+kt.localName,this.classes.push(kt),this.styleSheet.sheet.insertRule("."+kt.name+" {"+kt.style+"}",this.styleSheet.sheet.cssRules.length),kt},Dt.prototype.addRule=function(kt){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(kt),this.styleSheet.sheet.insertRule(kt.selector+" {"+kt.style+"}",this.styleSheet.sheet.cssRules.length)},Dt.prototype.addStyleSheet=function(){var kt;this.styleSheet=document.createElement("style"),((kt=this.styleSheetRoot)!==null&&kt!==void 0?kt:document.head).appendChild(this.styleSheet),this.addRule(new Ze("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ze("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ze("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ae("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ae("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Dt.prototype.removeStyleSheet=function(){var kt;this.styleSheet&&(((kt=this.styleSheetRoot)!==null&&kt!==void 0?kt:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Dt}(),Ze=function(Dt,kt){this.selector=Dt,this.style=kt},ae=function(Dt,kt){this.localName=Dt,this.style=kt},Re=function(){function Dt(kt,wt,At,_t,Et){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=kt,this.displayMode=wt,this.markerItems=At,this.uiStyleSettings=_t,this.styles=Et,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Dt.prototype.show=function(kt){var wt=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=kt,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var At=document.createElement("div");At.className=this.toolbarBlockStyleClass.name,At.style.whiteSpace="nowrap",this.uiContainer.appendChild(At),this.addActionButton(At,'<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(At,'<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(At,'<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(At,'<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(At,'<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(At,'<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(At,'<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(At,'<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(Et){var Pe=document.createElement("div");Pe.className=""+wt.toolbarButtonStyleClass.name,Pe.setAttribute("data-type-name",Et.typeName),Pe.innerHTML=Et.icon,Pe.addEventListener("click",function(){wt.markerToolbarButtonClicked(Pe,Et)}),wt.buttons.push(Pe),wt.markerButtons.push(Pe)}),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 _t=document.createElement("div");_t.className=this.toolbarBlockStyleClass.name,_t.style.whiteSpace="nowrap",_t.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(_t),this.addActionButton(_t,'<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(_t,'<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()},Dt.prototype.addButtonClickListener=function(kt){this.buttonClickListeners.push(kt)},Dt.prototype.removeButtonClickListener=function(kt){this.buttonClickListeners.indexOf(kt)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(kt),1)},Dt.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Dt.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var kt=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var wt=0;wt<this.markerButtons.length;wt++)wt<kt||wt===kt&&this.markerButtons.length-1===kt?this.markerButtonBlock.appendChild(this.markerButtons[wt]):(wt===kt&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[wt]))}},Dt.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")},Dt.prototype.resetButtonStyles=function(){var kt=this;this.buttons.forEach(function(wt){wt.className=wt.className.replace(kt.uiStyleSettings.toolbarButtonStyleColorsClassName?kt.uiStyleSettings.toolbarButtonStyleColorsClassName:kt.toolbarButtonStyleColorsClass.name,"").trim(),wt.className=wt.className.replace(kt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?kt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:kt.toolbarActiveButtonStyleColorsClass.name,"").trim(),wt.className+=" "+(kt.uiStyleSettings.toolbarButtonStyleColorsClassName?kt.uiStyleSettings.toolbarButtonStyleColorsClassName:kt.toolbarButtonStyleColorsClass.name)})},Dt.prototype.addActionButton=function(kt,wt,At){var _t=this,Et=document.createElement("div");switch(Et.className=""+this.toolbarButtonStyleClass.name,Et.innerHTML=wt,Et.setAttribute("data-action",At),Et.addEventListener("click",function(){_t.actionToolbarButtonClicked(Et,At)}),At){case"select":Et.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Et.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Et.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Et.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Et.style.fill=this.uiStyleSettings.closeButtonColor}kt.appendChild(Et),this.buttons.push(Et)},Dt.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ae("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 ae("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ae("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ae("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 ae("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var kt=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ae("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*kt)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*kt)+`px;
padding: `+kt+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ae("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ae("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ze("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ze("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},Dt.prototype.markerToolbarButtonClicked=function(kt,wt){this.setActiveButton(kt),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(At){return At("marker",wt)}),this.markerButtonOverflowBlock.style.display="none"},Dt.prototype.actionToolbarButtonClicked=function(kt,wt){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(At){return At("action",wt)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Dt.prototype.setActiveButton=function(kt){this.resetButtonStyles(),kt.className=kt.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),kt.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Dt.prototype.setActiveMarkerButton=function(kt){var wt=this.markerButtons.find(function(At){return At.getAttribute("data-type-name")===kt});wt&&this.setActiveButton(wt)},Dt.prototype.setCurrentMarker=function(kt){var wt=this;this.currentMarker=kt,this.buttons.filter(function(At){return/delete|notes/.test(At.getAttribute("data-action"))}).forEach(function(At){wt.currentMarker===void 0?(At.style.fillOpacity="0.4",At.style.pointerEvents="none"):(At.style.fillOpacity="1",At.style.pointerEvents="all")})},Dt}(),Nt=function(){function Dt(kt,wt,At,_t){this.panels=[],this.panelButtons=[],this.markerjsContainer=kt,this.displayMode=wt,this.uiStyleSettings=At,this.styles=_t,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Dt.prototype.addStyles=function(){var kt;this.toolboxStyleClass=this.styles.addClass(new ae("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 ae("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var wt=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ae("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ae("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ae("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 ae("toolbox-panel-row_colors",`
background-color: `+((kt=this.uiStyleSettings.toolboxBackgroundColor)!==null&&kt!==void 0?kt:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ae("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*wt)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*wt)+`px;
padding: `+wt+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ae("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ae("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ze("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ze("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},Dt.prototype.show=function(kt){var wt;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=kt,this.uiContainer.className=this.toolboxStyleClass.name+" "+((wt=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&wt!==void 0?wt:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Dt.prototype.setPanelButtons=function(kt){var wt,At,_t=this;this.panels=kt,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((wt=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&wt!==void 0?wt:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((At=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&At!==void 0?At:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Et){var Pe;Et.uiStyleSettings=_t.uiStyleSettings;var Ee=document.createElement("div");Ee.className=_t.toolboxButtonStyleClass.name+" "+((Pe=_t.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pe!==void 0?Pe:_t.toolboxButtonStyleColorsClass.name),Ee.innerHTML=Et.icon,Ee.title=Et.title,Ee.addEventListener("click",function(){_t.panelButtonClick(Et)}),_t.panelButtons.push(Ee),_t.buttonRow.appendChild(Ee)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Dt.prototype.panelButtonClick=function(kt){var wt=this,At=-1;if(kt!==this.activePanel){At=this.panels.indexOf(kt),this.panelRow.innerHTML="";var _t=kt.getUi();_t.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(_t),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=kt}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){wt.displayMode==="inline"?wt.panelRow.style.display="none":wt.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Et,Pe){var Ee,sn;Et.className=wt.toolboxButtonStyleClass.name+" "+(Pe===At?""+((Ee=wt.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:wt.toolboxActiveButtonStyleColorsClass.name):""+((sn=wt.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&sn!==void 0?sn:wt.toolboxButtonStyleColorsClass.name))})},Dt}(),et=function(Dt,kt){this.title=Dt,this.icon=kt},nt=function(Dt){function kt(wt,At,_t,Et){var Pe=Dt.call(this,wt,Et||'<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 Pe.colors=[],Pe.addTransparent=!1,Pe.colorBoxes=[],Pe.colors=At,Pe.currentColor=_t,Pe.setCurrentColor=Pe.setCurrentColor.bind(Pe),Pe.getColorBox=Pe.getColorBox.bind(Pe),Pe}return fe(kt,Dt),kt.prototype.getUi=function(){var wt=this,At=document.createElement("div");return At.style.overflow="hidden",At.style.whiteSpace="nowrap",this.colors.forEach(function(_t){var Et=wt.getColorBox(_t);At.appendChild(Et),wt.colorBoxes.push(Et)}),At},kt.prototype.getColorBox=function(wt){var At=this,_t=this.uiStyleSettings.toolbarHeight/4,Et=this.uiStyleSettings.toolbarHeight-_t,Pe=document.createElement("div");Pe.style.display="inline-block",Pe.style.boxSizing="content-box",Pe.style.width=Et-2+"px",Pe.style.height=Et-2+"px",Pe.style.padding="1px",Pe.style.marginRight="2px",Pe.style.marginBottom="2px",Pe.style.borderWidth="2px",Pe.style.borderStyle="solid",Pe.style.borderRadius=(Et+2)/2+"px",Pe.style.borderColor=wt===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Pe.addEventListener("click",function(){At.setCurrentColor(wt,Pe)});var Ee=document.createElement("div");return Ee.style.display="inline-block",Ee.style.width=Et-2+"px",Ee.style.height=Et-2+"px",Ee.style.backgroundColor=wt,Ee.style.borderRadius=Et/2+"px",wt==="transparent"&&(Ee.style.fill=this.uiStyleSettings.toolboxAccentColor,Ee.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>`),Pe.appendChild(Ee),Pe},kt.prototype.setCurrentColor=function(wt,At){var _t=this;this.currentColor=wt,this.colorBoxes.forEach(function(Et){Et.style.borderColor=Et===At?_t.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(wt)},kt}(et),ct=function(){function Dt(kt,wt,At){this._state="new",this._isSelected=!1,this._container=kt,this._overlayContainer=wt,this.globalSettings=At,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Dt.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Dt.prototype.ownsTarget=function(kt){return!1},Object.defineProperty(Dt.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Dt.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Dt.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Dt.prototype.pointerDown=function(kt,wt){},Dt.prototype.dblClick=function(kt,wt){},Dt.prototype.manipulate=function(kt){},Dt.prototype.pointerUp=function(kt){this.stateChanged()},Dt.prototype.dispose=function(){},Dt.prototype.addMarkerVisualToContainer=function(kt){this.container.childNodes.length>0?this.container.insertBefore(kt,this.container.childNodes[0]):this.container.appendChild(kt)},Dt.prototype.getState=function(){return{typeName:Dt.typeName,state:this.state,notes:this.notes}},Dt.prototype.restoreState=function(kt){this._state=kt.state,this.notes=kt.notes},Dt.prototype.scale=function(kt,wt){},Dt.prototype.colorChanged=function(kt){this.onColorChanged&&this.onColorChanged(kt),this.stateChanged()},Dt.prototype.fillColorChanged=function(kt){this.onFillColorChanged&&this.onFillColorChanged(kt),this.stateChanged()},Dt.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var kt=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),kt.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(kt)&&this.onStateChanged(this)}},Dt.typeName="MarkerBase",Dt}(),lt=function(){function Dt(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Dt.prototype.findGripByVisual=function(kt){return this.topLeft.ownsTarget(kt)?this.topLeft:this.topCenter.ownsTarget(kt)?this.topCenter:this.topRight.ownsTarget(kt)?this.topRight:this.centerLeft.ownsTarget(kt)?this.centerLeft:this.centerRight.ownsTarget(kt)?this.centerRight:this.bottomLeft.ownsTarget(kt)?this.bottomLeft:this.bottomCenter.ownsTarget(kt)?this.bottomCenter:this.bottomRight.ownsTarget(kt)?this.bottomRight:void 0},Dt}(),pt=function(){function Dt(){this.GRIP_SIZE=10,this.visual=re.createGroup(),this.visual.appendChild(re.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(re.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Dt.prototype.ownsTarget=function(kt){return kt===this.visual||kt===this.visual.childNodes[0]||kt===this.visual.childNodes[1]},Dt}(),vt=function(){function Dt(){}return Dt.toITransformMatrix=function(kt){return{a:kt.a,b:kt.b,c:kt.c,d:kt.d,e:kt.e,f:kt.f}},Dt.toSVGMatrix=function(kt,wt){return kt.a=wt.a,kt.b=wt.b,kt.c=wt.c,kt.d=wt.d,kt.e=wt.e,kt.f=wt.f,kt},Dt}(),Lt=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.left=0,Et.top=0,Et.width=0,Et.height=0,Et.defaultSize={x:50,y:20},Et.offsetX=0,Et.offsetY=0,Et.rotationAngle=0,Et.CB_DISTANCE=10,Et._suppressMarkerCreateEvent=!1,Et.container.transform.baseVal.appendItem(re.createTransform()),Et.setupControlBox(),Et}return fe(kt,Dt),Object.defineProperty(kt.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(kt.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(kt.prototype,"visual",{get:function(){return this._visual},set:function(wt){this._visual=wt;var At=re.createTransform();this._visual.transform.baseVal.appendItem(At)},enumerable:!1,configurable:!0}),kt.prototype.ownsTarget=function(wt){return!!Dt.prototype.ownsTarget.call(this,wt)||!!(this.controlGrips.findGripByVisual(wt)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(wt))},kt.prototype.pointerDown=function(wt,At){Dt.prototype.pointerDown.call(this,wt,At),this.state==="new"&&(this.left=wt.x,this.top=wt.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var _t=this.unrotatePoint(wt);if(this.manipulationStartX=_t.x,this.manipulationStartY=_t.y,this.offsetX=_t.x-this.left,this.offsetY=_t.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(At),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(At)){this.activeGrip=this.rotatorGrip;var Et=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Et.x-this.width/2,this.top=Et.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Pe=this.container.transform.baseVal.getItem(0);Pe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Pe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},kt.prototype.pointerUp=function(wt){var At=this.state;Dt.prototype.pointerUp.call(this,wt),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(wt),this._state="select",At==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},kt.prototype.moveVisual=function(wt){this.visual.style.transform="translate("+wt.x+"px, "+wt.y+"px)"},kt.prototype.manipulate=function(wt){var At=this.unrotatePoint(wt);this.state==="creating"?this.resize(wt):this.state==="move"?(this.left=this.manipulationStartLeft+(At.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(At.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(At):this.state==="rotate"&&this.rotate(wt)},kt.prototype.resize=function(wt){var At=this.manipulationStartLeft,_t=this.manipulationStartWidth,Et=this.manipulationStartTop,Pe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:At=this.manipulationStartLeft+wt.x-this.manipulationStartX,_t=this.manipulationStartWidth+this.manipulationStartLeft-At;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:_t=this.manipulationStartWidth+wt.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Et=this.manipulationStartTop+wt.y-this.manipulationStartY,Pe=this.manipulationStartHeight+this.manipulationStartTop-Et;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Pe=this.manipulationStartHeight+wt.y-this.manipulationStartY}_t>=0?(this.left=At,this.width=_t):(this.left=At+_t,this.width=-_t),Pe>=0?(this.top=Et,this.height=Pe):(this.top=Et+Pe,this.height=-Pe),this.setSize()},kt.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},kt.prototype.rotate=function(wt){if(Math.abs(wt.x-this.centerX)>.1){var At=Math.sign(wt.x-this.centerX);this.rotationAngle=180*Math.atan((wt.y-this.centerY)/(wt.x-this.centerX))/Math.PI+90*At,this.applyRotation()}},kt.prototype.applyRotation=function(){var wt=this.container.transform.baseVal.getItem(0);wt.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(wt,0)},kt.prototype.rotatePoint=function(wt){if(this.rotationAngle===0)return wt;var At=this.container.getCTM(),_t=re.createPoint(wt.x,wt.y);return{x:(_t=_t.matrixTransform(At)).x,y:_t.y}},kt.prototype.unrotatePoint=function(wt){if(this.rotationAngle===0)return wt;var At=this.container.getCTM();At=At.inverse();var _t=re.createPoint(wt.x,wt.y);return{x:(_t=_t.matrixTransform(At)).x,y:_t.y}},kt.prototype.select=function(){Dt.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},kt.prototype.deselect=function(){Dt.prototype.deselect.call(this),this.controlBox.style.display="none"},kt.prototype.setupControlBox=function(){this.controlBox=re.createGroup();var wt=re.createTransform();wt.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(wt),this.container.appendChild(this.controlBox),this.controlRect=re.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=re.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 lt,this.addControlGrips(),this.controlBox.style.display="none"},kt.prototype.adjustControlBox=function(){var wt=this.controlBox.transform.baseVal.getItem(0);wt.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(wt,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()},kt.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()},kt.prototype.createGrip=function(){var wt=new pt;return wt.visual.transform.baseVal.appendItem(re.createTransform()),this.controlBox.appendChild(wt.visual),wt},kt.prototype.positionGrips=function(){var wt=this.controlGrips.topLeft.GRIP_SIZE,At=-wt/2,_t=At,Et=(this.width+this.CB_DISTANCE)/2-wt/2,Pe=(this.height+this.CB_DISTANCE)/2-wt/2,Ee=this.height+this.CB_DISTANCE-wt/2,sn=this.width+this.CB_DISTANCE-wt/2;this.positionGrip(this.controlGrips.topLeft.visual,At,_t),this.positionGrip(this.controlGrips.topCenter.visual,Et,_t),this.positionGrip(this.controlGrips.topRight.visual,sn,_t),this.positionGrip(this.controlGrips.centerLeft.visual,At,Pe),this.positionGrip(this.controlGrips.centerRight.visual,sn,Pe),this.positionGrip(this.controlGrips.bottomLeft.visual,At,Ee),this.positionGrip(this.controlGrips.bottomCenter.visual,Et,Ee),this.positionGrip(this.controlGrips.bottomRight.visual,sn,Ee),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Et,_t-3*this.CB_DISTANCE)},kt.prototype.positionGrip=function(wt,At,_t){var Et=wt.transform.baseVal.getItem(0);Et.setTranslate(At,_t),wt.transform.baseVal.replaceItem(Et,0)},kt.prototype.hideControlBox=function(){this.controlBox.style.display="none"},kt.prototype.showControlBox=function(){this.controlBox.style.display=""},kt.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)},Dt.prototype.getState.call(this))},kt.prototype.restoreState=function(wt){Dt.prototype.restoreState.call(this,wt);var At=wt;this.left=At.left,this.top=At.top,this.width=At.width,this.height=At.height,this.rotationAngle=At.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,At.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,At.containerTransformMatrix))},kt.prototype.scale=function(wt,At){Dt.prototype.scale.call(this,wt,At);var _t=this.rotatePoint({x:this.left,y:this.top}),Et=this.unrotatePoint({x:_t.x*wt,y:_t.y*At});this.left=Et.x,this.top=Et.y,this.width=this.width*wt,this.height=this.height*At,this.adjustControlBox()},kt}(ct),bt=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.fillColor="transparent",Et.strokeColor="transparent",Et.strokeWidth=0,Et.strokeDasharray="",Et.opacity=1,Et.setStrokeColor=Et.setStrokeColor.bind(Et),Et.setFillColor=Et.setFillColor.bind(Et),Et.setStrokeWidth=Et.setStrokeWidth.bind(Et),Et.setStrokeDasharray=Et.setStrokeDasharray.bind(Et),Et.createVisual=Et.createVisual.bind(Et),Et}return fe(kt,Dt),kt.prototype.ownsTarget=function(wt){return!(!Dt.prototype.ownsTarget.call(this,wt)&&wt!==this.visual)},kt.prototype.createVisual=function(){this.visual=re.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)},kt.prototype.pointerDown=function(wt,At){Dt.prototype.pointerDown.call(this,wt,At),this.state==="new"&&(this.createVisual(),this.moveVisual(wt),this._state="creating")},kt.prototype.manipulate=function(wt){Dt.prototype.manipulate.call(this,wt)},kt.prototype.resize=function(wt){Dt.prototype.resize.call(this,wt),this.setSize()},kt.prototype.setSize=function(){Dt.prototype.setSize.call(this),re.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},kt.prototype.pointerUp=function(wt){Dt.prototype.pointerUp.call(this,wt),this.setSize()},kt.prototype.setStrokeColor=function(wt){this.strokeColor=wt,this.visual&&re.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(wt),this.stateChanged()},kt.prototype.setFillColor=function(wt){this.fillColor=wt,this.visual&&re.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},kt.prototype.setStrokeWidth=function(wt){this.strokeWidth=wt,this.visual&&re.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},kt.prototype.setStrokeDasharray=function(wt){this.strokeDasharray=wt,this.visual&&re.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},kt.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Dt.prototype.getState.call(this))},kt.prototype.restoreState=function(wt){var At=wt;this.fillColor=At.fillColor,this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.opacity=At.opacity,this.createVisual(),Dt.prototype.restoreState.call(this,wt),this.setSize()},kt.prototype.scale=function(wt,At){Dt.prototype.scale.call(this,wt,At),this.setSize()},kt.title="Rectangle marker",kt}(Lt),Gt=function(Dt){function kt(wt,At,_t,Et){var Pe=Dt.call(this,wt,Et||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Pe.widths=[],Pe.widthBoxes=[],Pe.widths=At,Pe.currentWidth=_t,Pe.setCurrentWidth=Pe.setCurrentWidth.bind(Pe),Pe}return fe(kt,Dt),kt.prototype.getUi=function(){var wt=this,At=document.createElement("div");return At.style.display="flex",At.style.overflow="hidden",At.style.flexGrow="2",this.widths.forEach(function(_t){var Et=document.createElement("div");Et.style.display="flex",Et.style.flexGrow="2",Et.style.alignItems="center",Et.style.justifyContent="space-between",Et.style.padding="5px",Et.style.borderWidth="2px",Et.style.borderStyle="solid",Et.style.borderColor=_t===wt.currentWidth?wt.uiStyleSettings.toolboxAccentColor:"transparent",Et.addEventListener("click",function(){wt.setCurrentWidth(_t,Et)}),At.appendChild(Et);var Pe=document.createElement("div");Pe.innerText=_t.toString(),Pe.style.marginRight="5px",Et.appendChild(Pe);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.display="flex",Ee.style.alignItems="center";var sn=document.createElement("hr");sn.style.minWidth="20px",sn.style.border="0px",sn.style.borderTop=_t+"px solid "+wt.uiStyleSettings.toolboxColor,sn.style.flexGrow="2",Ee.appendChild(sn),Et.appendChild(Ee),wt.widthBoxes.push(Et)}),At},kt.prototype.setCurrentWidth=function(wt,At){var _t=this;this.currentWidth=wt,this.widthBoxes.forEach(function(Et){Et.style.borderColor=Et===At?_t.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},kt}(et),jt=function(Dt){function kt(wt,At,_t,Et){var Pe=Dt.call(this,wt,Et||'<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 Pe.styles=[],Pe.styleBoxes=[],Pe.styles=At,Pe.currentStyle=_t,Pe.setCurrentStyle=Pe.setCurrentStyle.bind(Pe),Pe}return fe(kt,Dt),kt.prototype.getUi=function(){var wt=this,At=document.createElement("div");return At.style.display="flex",At.style.overflow="hidden",At.style.flexGrow="2",this.styles.forEach(function(_t){var Et=document.createElement("div");Et.style.display="flex",Et.style.alignItems="center",Et.style.justifyContent="space-between",Et.style.padding="5px",Et.style.borderWidth="2px",Et.style.borderStyle="solid",Et.style.overflow="hidden",Et.style.maxWidth=100/wt.styles.length-5+"%",Et.style.borderColor=_t===wt.currentStyle?wt.uiStyleSettings.toolboxAccentColor:"transparent",Et.addEventListener("click",function(){wt.setCurrentStyle(_t,Et)}),At.appendChild(Et);var Pe=document.createElement("div");Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.overflow="hidden";var Ee=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+wt.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(_t!==""?'stroke-dasharray="'+_t+'"':"")+` />
</svg>`;Pe.innerHTML=Ee,Et.appendChild(Pe),wt.styleBoxes.push(Et)}),At},kt.prototype.setCurrentStyle=function(wt,At){var _t=this;this.currentStyle=wt,this.styleBoxes.forEach(function(Et){Et.style.borderColor=Et===At?_t.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},kt}(et),ne=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.strokeColor=_t.defaultColor,Et.strokeWidth=_t.defaultStrokeWidth,Et.strokeDasharray=_t.defaultStrokeDasharray,Et.strokePanel=new nt("Line color",_t.defaultColorSet,_t.defaultColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.strokeWidthPanel=new Gt("Line width",_t.defaultStrokeWidths,_t.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new jt("Line style",_t.defaultStrokeDasharrays,_t.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et}return fe(kt,Dt),Object.defineProperty(kt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),kt.prototype.getState=function(){var wt=Dt.prototype.getState.call(this);return wt.typeName=kt.typeName,wt},kt.typeName="FrameMarker",kt.title="Frame marker",kt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',kt}(bt),ie=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"},te=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.x1=0,Et.y1=0,Et.x2=0,Et.y2=0,Et.defaultLength=50,Et.manipulationStartX=0,Et.manipulationStartY=0,Et.manipulationStartX1=0,Et.manipulationStartY1=0,Et.manipulationStartX2=0,Et.manipulationStartY2=0,Et.setupControlBox(),Et}return fe(kt,Dt),kt.prototype.ownsTarget=function(wt){return!!Dt.prototype.ownsTarget.call(this,wt)||!(!this.grip1.ownsTarget(wt)&&!this.grip2.ownsTarget(wt))},kt.prototype.pointerDown=function(wt,At){Dt.prototype.pointerDown.call(this,wt,At),this.manipulationStartX=wt.x,this.manipulationStartY=wt.y,this.state==="new"&&(this.x1=wt.x,this.y1=wt.y,this.x2=wt.x,this.y2=wt.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(At)?this.activeGrip=this.grip1:this.grip2.ownsTarget(At)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},kt.prototype.pointerUp=function(wt){var At=this.state;Dt.prototype.pointerUp.call(this,wt),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(wt),this._state="select",At==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},kt.prototype.adjustVisual=function(){},kt.prototype.manipulate=function(wt){this.state==="creating"?this.resize(wt):this.state==="move"?(this.x1=this.manipulationStartX1+wt.x-this.manipulationStartX,this.y1=this.manipulationStartY1+wt.y-this.manipulationStartY,this.x2=this.manipulationStartX2+wt.x-this.manipulationStartX,this.y2=this.manipulationStartY2+wt.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(wt)},kt.prototype.resize=function(wt){switch(this.activeGrip){case this.grip1:this.x1=wt.x,this.y1=wt.y;break;case this.grip2:case void 0:this.x2=wt.x,this.y2=wt.y}this.adjustVisual(),this.adjustControlBox()},kt.prototype.select=function(){Dt.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},kt.prototype.deselect=function(){Dt.prototype.deselect.call(this),this.controlBox.style.display="none"},kt.prototype.setupControlBox=function(){this.controlBox=re.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},kt.prototype.adjustControlBox=function(){this.positionGrips()},kt.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},kt.prototype.createGrip=function(){var wt=new pt;return wt.visual.transform.baseVal.appendItem(re.createTransform()),this.controlBox.appendChild(wt.visual),wt},kt.prototype.positionGrips=function(){var wt=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-wt/2,this.y1-wt/2),this.positionGrip(this.grip2.visual,this.x2-wt/2,this.y2-wt/2)},kt.prototype.positionGrip=function(wt,At,_t){var Et=wt.transform.baseVal.getItem(0);Et.setTranslate(At,_t),wt.transform.baseVal.replaceItem(Et,0)},kt.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Dt.prototype.getState.call(this))},kt.prototype.restoreState=function(wt){Dt.prototype.restoreState.call(this,wt);var At=wt;this.x1=At.x1,this.y1=At.y1,this.x2=At.x2,this.y2=At.y2},kt.prototype.scale=function(wt,At){Dt.prototype.scale.call(this,wt,At),this.x1=this.x1*wt,this.y1=this.y1*At,this.x2=this.x2*wt,this.y2=this.y2*At,this.adjustVisual(),this.adjustControlBox()},kt}(ct),Ge=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.strokeColor="transparent",Et.strokeWidth=0,Et.strokeDasharray="",Et.setStrokeColor=Et.setStrokeColor.bind(Et),Et.setStrokeWidth=Et.setStrokeWidth.bind(Et),Et.setStrokeDasharray=Et.setStrokeDasharray.bind(Et),Et.strokeColor=_t.defaultColor,Et.strokeWidth=_t.defaultStrokeWidth,Et.strokeDasharray=_t.defaultStrokeDasharray,Et.strokePanel=new nt("Line color",_t.defaultColorSet,_t.defaultColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.strokeWidthPanel=new Gt("Line width",_t.defaultStrokeWidths,_t.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new jt("Line style",_t.defaultStrokeDasharrays,_t.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et}return fe(kt,Dt),kt.prototype.ownsTarget=function(wt){return!(!Dt.prototype.ownsTarget.call(this,wt)&&wt!==this.visual&&wt!==this.selectorLine&&wt!==this.visibleLine)},kt.prototype.createVisual=function(){this.visual=re.createGroup(),this.selectorLine=re.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=re.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)},kt.prototype.pointerDown=function(wt,At){Dt.prototype.pointerDown.call(this,wt,At),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},kt.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()),re.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),re.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),re.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},kt.prototype.setStrokeColor=function(wt){this.strokeColor=wt,this.adjustVisual(),this.colorChanged(wt)},kt.prototype.setStrokeWidth=function(wt){this.strokeWidth=wt,this.adjustVisual()},kt.prototype.setStrokeDasharray=function(wt){this.strokeDasharray=wt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(kt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),kt.prototype.getState=function(){var wt=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Dt.prototype.getState.call(this));return wt.typeName=kt.typeName,wt},kt.prototype.restoreState=function(wt){Dt.prototype.restoreState.call(this,wt);var At=wt;this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.createVisual(),this.adjustVisual()},kt.typeName="LineMarker",kt.title="Line marker",kt.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',kt}(te),pe=function(Dt){function kt(wt,At,_t,Et){var Pe=Dt.call(this,wt,Et||'<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 Pe.fonts=[],Pe.fontBoxes=[],Pe.fonts=At,Pe.currentFont=_t,Pe.setCurrentFont=Pe.setCurrentFont.bind(Pe),Pe}return fe(kt,Dt),kt.prototype.getUi=function(){var wt=this,At=document.createElement("div");return At.style.overflow="hidden",At.style.flexGrow="2",this.fonts.forEach(function(_t){var Et=document.createElement("div");Et.style.display="inline-block",Et.style.alignItems="center",Et.style.justifyContent="space-between",Et.style.padding="5px",Et.style.borderWidth="2px",Et.style.borderStyle="solid",Et.style.overflow="hidden",Et.style.maxWidth=100/wt.fonts.length-5+"%",Et.style.borderColor=_t===wt.currentFont?wt.uiStyleSettings.toolboxAccentColor:"transparent",Et.addEventListener("click",function(){wt.setCurrentFont(_t,Et)}),At.appendChild(Et);var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.fontFamily=_t,Pe.style.overflow="hidden";var Ee=document.createElement("div");Ee.style.whiteSpace="nowrap",Ee.style.overflow="hidden",Ee.style.textOverflow="ellipsis",Ee.innerHTML="The quick brown fox jumps over the lazy dog",Pe.appendChild(Ee),Et.appendChild(Pe),wt.fontBoxes.push(Et)}),At},kt.prototype.setCurrentFont=function(wt,At){var _t=this;this.currentFont=wt,this.fontBoxes.forEach(function(Et){Et.style.borderColor=Et===At?_t.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},kt}(et),Je=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.color="transparent",Et.padding=5,Et.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",Et.text=Et.DEFAULT_TEXT,Et.isMoved=!1,Et.color=_t.defaultColor,Et.fontFamily=_t.defaultFontFamily,Et.defaultSize={x:100,y:30},Et.setColor=Et.setColor.bind(Et),Et.setFont=Et.setFont.bind(Et),Et.renderText=Et.renderText.bind(Et),Et.sizeText=Et.sizeText.bind(Et),Et.textEditDivClicked=Et.textEditDivClicked.bind(Et),Et.showTextEditor=Et.showTextEditor.bind(Et),Et.setSize=Et.setSize.bind(Et),Et.positionTextEditor=Et.positionTextEditor.bind(Et),Et.colorPanel=new nt("Color",_t.defaultColorSet,_t.defaultColor),Et.colorPanel.onColorChanged=Et.setColor,Et.fontFamilyPanel=new pe("Font",_t.defaultFontFamilies,_t.defaultFontFamily),Et.fontFamilyPanel.onFontChanged=Et.setFont,Et}return fe(kt,Dt),kt.prototype.ownsTarget=function(wt){if(Dt.prototype.ownsTarget.call(this,wt)||wt===this.visual||wt===this.textElement||wt===this.bgRectangle)return!0;var At=!1;return this.textElement.childNodes.forEach(function(_t){_t===wt&&(At=!0)}),At},kt.prototype.createVisual=function(){this.visual=re.createGroup(),this.bgRectangle=re.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=re.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(re.createTransform()),this.textElement.transform.baseVal.appendItem(re.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},kt.prototype.pointerDown=function(wt,At){Dt.prototype.pointerDown.call(this,wt,At),this.isMoved=!1,this.pointerDownPoint=wt,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(wt),this._state="creating")},kt.prototype.renderText=function(){var wt=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(At){wt.textElement.appendChild(re.createTSpan(At.trim()===""?" ":At.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},kt.prototype.getTextScale=function(){var wt=this.textElement.getBBox(),At=1;if(wt.width>0&&wt.height>0){var _t=(1*this.width-this.width*this.padding*2/100)/wt.width,Et=(1*this.height-this.height*this.padding*2/100)/wt.height;At=Math.min(_t,Et)}return At},kt.prototype.getTextPosition=function(wt){var At=this.textElement.getBBox(),_t=0,Et=0;return At.width>0&&At.height>0&&(_t=(this.width-At.width*wt)/2,Et=this.height/2-At.height*wt/2),{x:_t,y:Et}},kt.prototype.sizeText=function(){var wt=this.textElement.getBBox(),At=this.getTextScale(),_t=this.getTextPosition(At);_t.y-=wt.y*At,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+_t.x+"px, "+_t.y+"px) scale("+At+", "+At+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(_t.x,_t.y),this.textElement.transform.baseVal.getItem(1).setScale(At,At))},kt.prototype.manipulate=function(wt){Dt.prototype.manipulate.call(this,wt),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(wt.x-this.pointerDownPoint.x)>5||Math.abs(wt.y-this.pointerDownPoint.y)>5)},kt.prototype.resize=function(wt){Dt.prototype.resize.call(this,wt),this.isMoved=!0,this.setSize(),this.sizeText()},kt.prototype.setSize=function(){Dt.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(re.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),re.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},kt.prototype.pointerUp=function(wt){var At=this.state;At==="creating"&&(this._suppressMarkerCreateEvent=!0),Dt.prototype.pointerUp.call(this,wt),this.setSize(),(At==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},kt.prototype.showTextEditor=function(){var wt=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(At){At.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var At=Number.parseFloat(wt.textEditor.style.fontSize);wt.textEditor.clientWidth>=Number.parseInt(wt.textEditor.style.maxWidth)&&At>.9;)At-=.1,wt.textEditor.style.fontSize=Math.max(At,.9)+"em"}),this.textEditor.addEventListener("keyup",function(At){At.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(At){if(At.clipboardData){var _t=At.clipboardData.getData("text"),Et=window.getSelection();if(!Et.rangeCount)return!1;Et.deleteFromDocument(),Et.getRangeAt(0).insertNode(document.createTextNode(_t)),At.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){wt.textEditDivClicked(wt.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},kt.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var wt=this.getTextScale(),At=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),_t=this.textElement.getBBox(),Et={x:_t.width*wt,y:_t.height*wt};At.x-=Et.x/2,At.y-=Et.y/2,this.textEditor.style.top=At.y+"px",this.textEditor.style.left=At.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-At.x+"px",this.textEditor.style.fontSize=Math.max(16*wt,12)+"px",this.textElement.style.display="none"}},kt.prototype.textEditDivClicked=function(wt){this.text=wt.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},kt.prototype.select=function(){Dt.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},kt.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Dt.prototype.deselect.call(this)},kt.prototype.dblClick=function(wt,At){Dt.prototype.dblClick.call(this,wt,At),this.showTextEditor()},kt.prototype.setColor=function(wt){this.textElement&&re.setAttributes(this.textElement,[["fill",wt]]),this.color=wt,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(wt)},kt.prototype.setFont=function(wt){this.textElement&&re.setAttributes(this.textElement,[["font-family",wt]]),this.fontFamily=wt,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},kt.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},kt.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(kt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),kt.prototype.getState=function(){var wt=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Dt.prototype.getState.call(this));return wt.typeName=kt.typeName,wt},kt.prototype.restoreState=function(wt){var At=wt;this.color=At.color,this.fontFamily=At.fontFamily,this.padding=At.padding,this.text=At.text,this.createVisual(),Dt.prototype.restoreState.call(this,wt),this.setSize()},kt.prototype.scale=function(wt,At){Dt.prototype.scale.call(this,wt,At),this.setSize(),this.sizeText(),this.positionTextEditor()},kt.typeName="TextMarker",kt.title="Text marker",kt.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>',kt}(Lt),Ye=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.color="transparent",Et.lineWidth=3,Et.drawing=!1,Et.pixelRatio=1,Et.color=_t.defaultColor,Et.lineWidth=_t.defaultStrokeWidth,Et.pixelRatio=_t.freehandPixelRatio,Et.setColor=Et.setColor.bind(Et),Et.addCanvas=Et.addCanvas.bind(Et),Et.finishCreation=Et.finishCreation.bind(Et),Et.setLineWidth=Et.setLineWidth.bind(Et),Et.colorPanel=new nt("Color",_t.defaultColorSet,_t.defaultColor),Et.colorPanel.onColorChanged=Et.setColor,Et.lineWidthPanel=new Gt("Line width",_t.defaultStrokeWidths,_t.defaultStrokeWidth),Et.lineWidthPanel.onWidthChanged=Et.setLineWidth,Et}return fe(kt,Dt),kt.prototype.ownsTarget=function(wt){return!(!Dt.prototype.ownsTarget.call(this,wt)&&wt!==this.visual&&wt!==this.drawingImage)},kt.prototype.createVisual=function(){this.visual=re.createGroup(),this.drawingImage=re.createImage(),this.visual.appendChild(this.drawingImage);var wt=re.createTransform();this.visual.transform.baseVal.appendItem(wt),this.addMarkerVisualToContainer(this.visual)},kt.prototype.pointerDown=function(wt,At){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(wt.x,wt.y),this.drawing=!0):Dt.prototype.pointerDown.call(this,wt,At)},kt.prototype.manipulate=function(wt){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(wt.x,wt.y),this.canvasContext.stroke()):Dt.prototype.manipulate.call(this,wt)},kt.prototype.resize=function(wt){Dt.prototype.resize.call(this,wt),re.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),re.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},kt.prototype.pointerUp=function(wt){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Dt.prototype.pointerUp.call(this,wt)},kt.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)},kt.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Dt.prototype.select.call(this)},kt.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Dt.prototype.deselect.call(this)},kt.prototype.finishCreation=function(){for(var wt=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),At=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],_t=At[0],Et=At[1],Pe=At[2],Ee=At[3],sn=!1,He=0;He<this.canvasElement.height;He++)for(var Ae=0;Ae<this.canvasElement.width;Ae++)wt.data[He*this.canvasElement.width*4+4*Ae+3]>0&&(sn=!0,He<Et&&(Et=He),Ae<_t&&(_t=Ae),He>Ee&&(Ee=He),Ae>Pe&&(Pe=Ae));if(sn){this.left=_t/this.pixelRatio,this.top=Et/this.pixelRatio,this.width=(Pe-_t)/this.pixelRatio,this.height=(Ee-Et)/this.pixelRatio;var qe=document.createElement("canvas");qe.width=Pe-_t,qe.height=Ee-Et,qe.getContext("2d").putImageData(this.canvasContext.getImageData(_t,Et,Pe-_t,Ee-Et),0,0),this.drawingImgUrl=qe.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},kt.prototype.setDrawingImage=function(){re.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),re.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},kt.prototype.setColor=function(wt){this.color=wt,this.colorChanged(wt)},kt.prototype.setLineWidth=function(wt){this.lineWidth=wt},Object.defineProperty(kt.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),kt.prototype.getState=function(){var wt=Object.assign({drawingImgUrl:this.drawingImgUrl},Dt.prototype.getState.call(this));return wt.typeName=kt.typeName,wt},kt.prototype.restoreState=function(wt){this.createVisual(),Dt.prototype.restoreState.call(this,wt),this.drawingImgUrl=wt.drawingImgUrl,this.setDrawingImage()},kt.prototype.scale=function(wt,At){Dt.prototype.scale.call(this,wt,At),this.setDrawingImage()},kt.typeName="FreehandMarker",kt.title="Freehand marker",kt.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>',kt}(Lt),hn=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,_t||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Et.typeBoxes=[],Et.currentType=At,Et.setCurrentType=Et.setCurrentType.bind(Et),Et}return fe(kt,Dt),kt.prototype.getUi=function(){var wt=this,At=document.createElement("div");At.style.display="flex",At.style.overflow="hidden",At.style.flexGrow="2";for(var _t=function(Ee){var sn="both";switch(Ee){case 0:sn="both";break;case 1:sn="start";break;case 2:sn="end";break;case 3:sn="none"}var He=document.createElement("div");if(He.style.display="flex",He.style.flexGrow="2",He.style.alignItems="center",He.style.justifyContent="space-between",He.style.padding="5px",He.style.borderWidth="2px",He.style.borderStyle="solid",He.style.borderColor=sn===Et.currentType?Et.uiStyleSettings.toolboxAccentColor:"transparent",He.addEventListener("click",function(){wt.setCurrentType(sn,He)}),At.appendChild(He),sn==="both"||sn==="start"){var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.alignItems="center",Ae.style.minHeight="20px",Ae.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="`+(Et.uiStyleSettings!==void 0?Et.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ae.style.marginLeft="5px",He.appendChild(Ae)}var qe=document.createElement("div");qe.style.display="flex",qe.style.alignItems="center",qe.style.minHeight="20px",qe.style.flexGrow="2";var en=document.createElement("hr");if(en.style.minWidth="20px",en.style.border="0px",en.style.borderTop="3px solid "+(Et.uiStyleSettings!==void 0?Et.uiStyleSettings.toolboxColor:"#eeeeee"),en.style.flexGrow="2",qe.appendChild(en),He.appendChild(qe),sn==="both"||sn==="end"){var dn=document.createElement("div");dn.style.display="flex",dn.style.alignItems="center",dn.style.minHeight="20px",dn.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="`+(Et.uiStyleSettings!==void 0?Et.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,dn.style.marginRight="5px",He.appendChild(dn)}Et.typeBoxes.push(He)},Et=this,Pe=0;Pe<4;Pe++)_t(Pe);return At},kt.prototype.setCurrentType=function(wt,At){var _t=this;this.currentType=wt,this.typeBoxes.forEach(function(Et){Et.style.borderColor=Et===At?_t.uiStyleSettings!==void 0?_t.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},kt}(et),Fn=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.arrowType="end",Et.arrowBaseHeight=10,Et.arrowBaseWidth=10,Et.getArrowPoints=Et.getArrowPoints.bind(Et),Et.setArrowType=Et.setArrowType.bind(Et),Et.arrowTypePanel=new hn("Arrow type","end"),Et.arrowTypePanel.onArrowTypeChanged=Et.setArrowType,Et}return fe(kt,Dt),kt.prototype.ownsTarget=function(wt){return!(!Dt.prototype.ownsTarget.call(this,wt)&&wt!==this.arrow1&&wt!==this.arrow2)},kt.prototype.getArrowPoints=function(wt,At){var _t=this.arrowBaseWidth+2*this.strokeWidth,Et=this.arrowBaseHeight+2*this.strokeWidth;return wt-_t/2+","+(At+Et/2)+" "+wt+","+(At-Et/2)+" "+(wt+_t/2)+","+(At+Et/2)},kt.prototype.createTips=function(){this.arrow1=re.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(re.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=re.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(re.createTransform()),this.visual.appendChild(this.arrow2)},kt.prototype.pointerDown=function(wt,At){Dt.prototype.pointerDown.call(this,wt,At),this.state==="creating"&&this.createTips()},kt.prototype.adjustVisual=function(){if(Dt.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",re.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),re.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var wt=0;Math.abs(this.x1-this.x2)>.1&&(wt=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var At=this.arrow1.transform.baseVal.getItem(0);At.setRotate(wt,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(At,0);var _t=this.arrow2.transform.baseVal.getItem(0);_t.setRotate(wt+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(_t,0)}},kt.prototype.setArrowType=function(wt){this.arrowType=wt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(kt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),kt.prototype.getState=function(){var wt=Object.assign({arrowType:this.arrowType},Dt.prototype.getState.call(this));return wt.typeName=kt.typeName,wt},kt.prototype.restoreState=function(wt){Dt.prototype.restoreState.call(this,wt);var At=wt;this.arrowType=At.arrowType,this.createTips(),this.adjustVisual()},kt.typeName="ArrowMarker",kt.title="Arrow marker",kt.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',kt}(Ge),vn=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.fillColor=_t.defaultFillColor,Et.strokeWidth=0,Et.fillPanel=new nt("Color",_t.defaultColorSet,_t.defaultFillColor),Et.fillPanel.onColorChanged=Et.setFillColor,Et}return fe(kt,Dt),Object.defineProperty(kt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),kt.prototype.getState=function(){var wt=Dt.prototype.getState.call(this);return wt.typeName=kt.typeName,wt},kt.typeName="CoverMarker",kt.title="Cover marker",kt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',kt}(bt),pi=function(Dt){function kt(wt,At,_t,Et){var Pe=Dt.call(this,wt,Et||'<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 Pe.opacities=[],Pe.opacityBoxes=[],Pe.opacities=At,Pe.currentOpacity=_t,Pe.setCurrentOpacity=Pe.setCurrentOpacity.bind(Pe),Pe}return fe(kt,Dt),kt.prototype.getUi=function(){var wt=this,At=document.createElement("div");return At.style.display="flex",At.style.overflow="hidden",At.style.flexGrow="2",At.style.justifyContent="space-between",this.opacities.forEach(function(_t){var Et=document.createElement("div");Et.style.display="flex",Et.style.alignItems="center",Et.style.justifyContent="center",Et.style.padding="5px",Et.style.borderWidth="2px",Et.style.borderStyle="solid",Et.style.borderColor=_t===wt.currentOpacity?wt.uiStyleSettings.toolboxAccentColor:"transparent",Et.addEventListener("click",function(){wt.setCurrentOpacity(_t,Et)}),At.appendChild(Et);var Pe=document.createElement("div");Pe.innerText=100*_t+"%",Et.appendChild(Pe),wt.opacityBoxes.push(Et)}),At},kt.prototype.setCurrentOpacity=function(wt,At){var _t=this;this.currentOpacity=wt,this.opacityBoxes.forEach(function(Et){Et.style.borderColor=Et===At?_t.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},kt}(et),yn=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.setOpacity=Et.setOpacity.bind(Et),Et.fillColor=_t.defaultHighlightColor,Et.strokeWidth=0,Et.opacity=_t.defaultHighlightOpacity,Et.fillPanel=new nt("Color",_t.defaultColorSet,Et.fillColor),Et.fillPanel.onColorChanged=Et.setFillColor,Et.opacityPanel=new pi("Opacity",_t.defaultOpacitySteps,Et.opacity),Et.opacityPanel.onOpacityChanged=Et.setOpacity,Et}return fe(kt,Dt),kt.prototype.setOpacity=function(wt){this.opacity=wt,this.visual&&re.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(kt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),kt.prototype.getState=function(){var wt=Dt.prototype.getState.call(this);return wt.typeName=kt.typeName,wt},kt.typeName="HighlightMarker",kt.title="Highlight marker",kt.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>',kt}(vn),ce='<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>',Kt='<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>',tn=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.bgColor="transparent",Et.tipPosition={x:0,y:0},Et.tipBase1Position={x:0,y:0},Et.tipBase2Position={x:0,y:0},Et.tipMoving=!1,Et.color=_t.defaultStrokeColor,Et.bgColor=_t.defaultFillColor,Et.fontFamily=_t.defaultFontFamily,Et.defaultSize={x:100,y:30},Et.setBgColor=Et.setBgColor.bind(Et),Et.getTipPoints=Et.getTipPoints.bind(Et),Et.positionTip=Et.positionTip.bind(Et),Et.setTipPoints=Et.setTipPoints.bind(Et),Et.colorPanel=new nt("Text color",_t.defaultColorSet,Et.color,ce),Et.colorPanel.onColorChanged=Et.setColor,Et.bgColorPanel=new nt("Fill color",_t.defaultColorSet,Et.bgColor,Kt),Et.bgColorPanel.onColorChanged=Et.setBgColor,Et.fontFamilyPanel=new pe("Font",_t.defaultFontFamilies,_t.defaultFontFamily),Et.fontFamilyPanel.onFontChanged=Et.setFont,Et.tipGrip=new pt,Et.tipGrip.visual.transform.baseVal.appendItem(re.createTransform()),Et.controlBox.appendChild(Et.tipGrip.visual),Et}return fe(kt,Dt),kt.prototype.ownsTarget=function(wt){return Dt.prototype.ownsTarget.call(this,wt)||this.tipGrip.ownsTarget(wt)||this.tip===wt},kt.prototype.createTip=function(){re.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=re.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},kt.prototype.pointerDown=function(wt,At){this.state==="new"&&Dt.prototype.pointerDown.call(this,wt,At),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(At)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Dt.prototype.pointerDown.call(this,wt,At)},kt.prototype.pointerUp=function(wt){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Dt.prototype.pointerUp.call(this,wt);else{var At=this.state==="creating";Dt.prototype.pointerUp.call(this,wt),this.setTipPoints(At),this.positionTip()}},kt.prototype.manipulate=function(wt){if(this.tipMoving){var At=this.unrotatePoint(wt);this.tipPosition={x:At.x-this.manipulationStartLeft,y:At.y-this.manipulationStartTop},this.positionTip()}else Dt.prototype.manipulate.call(this,wt)},kt.prototype.setBgColor=function(wt){this.bgRectangle&&this.tip&&(re.setAttributes(this.bgRectangle,[["fill",wt]]),re.setAttributes(this.tip,[["fill",wt]])),this.bgColor=wt,this.fillColorChanged(wt)},kt.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},kt.prototype.setTipPoints=function(wt){wt===void 0&&(wt=!1);var At=Math.min(this.height/2,15),_t=this.height/5;wt&&(this.tipPosition={x:At+_t/2,y:this.height+20});var Et=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Et<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(_t=this.width/5,At=Math.min(this.width/2,15),this.tipBase1Position={x:At,y:0},this.tipBase2Position={x:At+_t,y:0}):(this.tipBase1Position={x:0,y:At},this.tipBase2Position={x:0,y:At+_t}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Et<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(_t=this.width/5,At=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-At-_t,y:0},this.tipBase2Position={x:this.width-At,y:0}):(this.tipBase1Position={x:this.width,y:At},this.tipBase2Position={x:this.width,y:At+_t}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Et<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(_t=this.width/5,At=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-At-_t,y:this.height},this.tipBase2Position={x:this.width-At,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-At-_t},this.tipBase2Position={x:this.width,y:this.height-At}):Et<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(_t=this.width/5,At=Math.min(this.width/2,15),this.tipBase1Position={x:At,y:this.height},this.tipBase2Position={x:At+_t,y:this.height}):(this.tipBase1Position={x:0,y:this.height-At},this.tipBase2Position={x:0,y:this.height-At-_t})},kt.prototype.resize=function(wt){Dt.prototype.resize.call(this,wt),this.positionTip()},kt.prototype.positionTip=function(){re.setAttributes(this.tip,[["points",this.getTipPoints()]]);var wt=this.tipGrip.visual.transform.baseVal.getItem(0);wt.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(wt,0)},Object.defineProperty(kt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),kt.prototype.select=function(){this.positionTip(),Dt.prototype.select.call(this)},kt.prototype.getState=function(){var wt=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Dt.prototype.getState.call(this));return wt.typeName=kt.typeName,wt},kt.prototype.restoreState=function(wt){var At=wt;this.bgColor=At.bgColor,this.tipPosition=At.tipPosition,Dt.prototype.restoreState.call(this,wt),this.createTip(),this.setTipPoints()},kt.prototype.scale=function(wt,At){Dt.prototype.scale.call(this,wt,At),this.tipPosition={x:this.tipPosition.x*wt,y:this.tipPosition.y*At},this.positionTip()},kt.typeName="CalloutMarker",kt.title="Callout marker",kt.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>',kt}(Je),Yn=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.fillColor="transparent",Et.strokeColor="transparent",Et.strokeWidth=0,Et.strokeDasharray="",Et.opacity=1,Et.strokeColor=_t.defaultColor,Et.strokeWidth=_t.defaultStrokeWidth,Et.strokeDasharray=_t.defaultStrokeDasharray,Et.fillColor=_t.defaultFillColor,Et.setStrokeColor=Et.setStrokeColor.bind(Et),Et.setFillColor=Et.setFillColor.bind(Et),Et.setStrokeWidth=Et.setStrokeWidth.bind(Et),Et.setStrokeDasharray=Et.setStrokeDasharray.bind(Et),Et.setOpacity=Et.setOpacity.bind(Et),Et.createVisual=Et.createVisual.bind(Et),Et.strokePanel=new nt("Line color",ge(_t.defaultColorSet,["transparent"]),_t.defaultColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.fillPanel=new nt("Fill color",ge(_t.defaultColorSet,["transparent"]),Et.fillColor,Kt),Et.fillPanel.onColorChanged=Et.setFillColor,Et.strokeWidthPanel=new Gt("Line width",_t.defaultStrokeWidths,_t.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new jt("Line style",_t.defaultStrokeDasharrays,_t.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et.opacityPanel=new pi("Opacity",_t.defaultOpacitySteps,Et.opacity),Et.opacityPanel.onOpacityChanged=Et.setOpacity,Et}return fe(kt,Dt),kt.prototype.ownsTarget=function(wt){return!(!Dt.prototype.ownsTarget.call(this,wt)&&wt!==this.visual)},kt.prototype.createVisual=function(){this.visual=re.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)},kt.prototype.pointerDown=function(wt,At){Dt.prototype.pointerDown.call(this,wt,At),this.state==="new"&&(this.createVisual(),this.moveVisual(wt),this._state="creating")},kt.prototype.manipulate=function(wt){Dt.prototype.manipulate.call(this,wt)},kt.prototype.resize=function(wt){Dt.prototype.resize.call(this,wt),this.setSize()},kt.prototype.setSize=function(){Dt.prototype.setSize.call(this),re.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},kt.prototype.pointerUp=function(wt){Dt.prototype.pointerUp.call(this,wt),this.setSize()},kt.prototype.setStrokeColor=function(wt){this.strokeColor=wt,this.visual&&re.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(wt),this.stateChanged()},kt.prototype.setFillColor=function(wt){this.fillColor=wt,this.visual&&re.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(wt),this.stateChanged()},kt.prototype.setStrokeWidth=function(wt){this.strokeWidth=wt,this.visual&&re.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},kt.prototype.setStrokeDasharray=function(wt){this.strokeDasharray=wt,this.visual&&re.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},kt.prototype.setOpacity=function(wt){this.opacity=wt,this.visual&&re.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(kt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),kt.prototype.getState=function(){var wt=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Dt.prototype.getState.call(this));return wt.typeName=kt.typeName,wt},kt.prototype.restoreState=function(wt){var At=wt;this.fillColor=At.fillColor,this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.opacity=At.opacity,this.createVisual(),Dt.prototype.restoreState.call(this,wt),this.setSize()},kt.prototype.scale=function(wt,At){Dt.prototype.scale.call(this,wt,At),this.setSize()},kt.typeName="EllipseMarker",kt.title="Ellipse marker",kt.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>',kt}(Lt),Dn=function(Dt){function kt(wt,At,_t){return Dt.call(this,wt,At,_t)||this}return fe(kt,Dt),Object.defineProperty(kt.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),kt.prototype.ownsTarget=function(wt){return!(!Dt.prototype.ownsTarget.call(this,wt)&&wt!==this.tip1&&wt!==this.tip2)},kt.prototype.createTips=function(){this.tip1=re.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(re.createTransform()),this.visual.appendChild(this.tip1),this.tip2=re.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(re.createTransform()),this.visual.appendChild(this.tip2)},kt.prototype.pointerDown=function(wt,At){Dt.prototype.pointerDown.call(this,wt,At),this.state==="creating"&&this.createTips()},kt.prototype.adjustVisual=function(){if(Dt.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(re.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()]]),re.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 wt=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),At=this.tip1.transform.baseVal.getItem(0);At.setRotate(wt,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(At,0);var _t=this.tip2.transform.baseVal.getItem(0);_t.setRotate(wt+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(_t,0)}},Object.defineProperty(kt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),kt.prototype.getState=function(){var wt=Dt.prototype.getState.call(this);return wt.typeName=kt.typeName,wt},kt.prototype.restoreState=function(wt){Dt.prototype.restoreState.call(this,wt),this.createTips(),this.adjustVisual()},kt.typeName="MeasurementMarker",kt.title="Measurement marker",kt.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>',kt}(Ge),je=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.strokePanel.colors=_t.defaultColorSet,Et.fillColor="transparent",Et}return fe(kt,Dt),Object.defineProperty(kt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),kt.prototype.getState=function(){var wt=Dt.prototype.getState.call(this);return wt.typeName=kt.typeName,wt},kt.typeName="EllipseFrameMarker",kt.title="Ellipse frame marker",kt.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>',kt}(Yn),gn=function(){function Dt(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Dt.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Dt.prototype.addUndoStep=function(kt){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(kt)||(this.undoStack.push(kt),JSON.stringify(this.lastRedoStep)!==JSON.stringify(kt)&&this.redoStack.splice(0,this.redoStack.length))},Dt.prototype.replaceLastUndoStep=function(kt){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=kt)},Dt.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Dt.prototype.undo=function(){if(this.undoStack.length>1){var kt=this.undoStack.pop();return kt!==void 0&&this.redoStack.push(kt),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Dt.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Dt}(),Tn=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.strokeColor="transparent",Et.strokeWidth=0,Et.strokeDasharray="",Et.curveX=0,Et.curveY=0,Et.manipulationStartCurveX=0,Et.manipulationStartCurveY=0,Et.setStrokeColor=Et.setStrokeColor.bind(Et),Et.setStrokeWidth=Et.setStrokeWidth.bind(Et),Et.setStrokeDasharray=Et.setStrokeDasharray.bind(Et),Et.positionGrips=Et.positionGrips.bind(Et),Et.addControlGrips=Et.addControlGrips.bind(Et),Et.adjustVisual=Et.adjustVisual.bind(Et),Et.setupControlBox=Et.setupControlBox.bind(Et),Et.resize=Et.resize.bind(Et),Et.strokeColor=_t.defaultColor,Et.strokeWidth=_t.defaultStrokeWidth,Et.strokeDasharray=_t.defaultStrokeDasharray,Et.strokePanel=new nt("Line color",_t.defaultColorSet,_t.defaultColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.strokeWidthPanel=new Gt("Line width",_t.defaultStrokeWidths,_t.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new jt("Line style",_t.defaultStrokeDasharrays,_t.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et}return fe(kt,Dt),kt.prototype.ownsTarget=function(wt){return!(!Dt.prototype.ownsTarget.call(this,wt)&&wt!==this.visual&&wt!==this.selectorCurve&&wt!==this.visibleCurve&&!this.curveGrip.ownsTarget(wt))},kt.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},kt.prototype.createVisual=function(){this.visual=re.createGroup(),this.selectorCurve=re.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=re.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)},kt.prototype.pointerDown=function(wt,At){Dt.prototype.pointerDown.call(this,wt,At),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=wt.x,this.curveY=wt.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(At)&&(this.activeGrip=this.curveGrip,this._state="resize")},kt.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),re.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),re.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),re.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},kt.prototype.setupControlBox=function(){Dt.prototype.setupControlBox.call(this),this.curveControlLine1=re.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=re.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)},kt.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Dt.prototype.addControlGrips.call(this)},kt.prototype.positionGrips=function(){Dt.prototype.positionGrips.call(this);var wt=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-wt/2,this.curveY-wt/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()))},kt.prototype.manipulate=function(wt){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+wt.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+wt.y-this.manipulationStartY),Dt.prototype.manipulate.call(this,wt)},kt.prototype.resize=function(wt){this.activeGrip===this.curveGrip&&(this.curveX=wt.x,this.curveY=wt.y),Dt.prototype.resize.call(this,wt),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},kt.prototype.setStrokeColor=function(wt){this.strokeColor=wt,this.adjustVisual(),this.colorChanged(wt)},kt.prototype.setStrokeWidth=function(wt){this.strokeWidth=wt,this.adjustVisual()},kt.prototype.setStrokeDasharray=function(wt){this.strokeDasharray=wt,this.adjustVisual()},kt.prototype.scale=function(wt,At){this.curveX=this.curveX*wt,this.curveY=this.curveY*At,Dt.prototype.scale.call(this,wt,At)},Object.defineProperty(kt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),kt.prototype.getState=function(){var wt=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Dt.prototype.getState.call(this));return wt.typeName=kt.typeName,wt},kt.prototype.restoreState=function(wt){Dt.prototype.restoreState.call(this,wt);var At=wt;this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.curveX=At.curveX,this.curveY=At.curveY,this.createVisual(),this.adjustVisual()},kt.typeName="CurveMarker",kt.title="Curve marker",kt.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>',kt}(te),Jn=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,At,_t)||this;return Et.fillColor="transparent",Et.strokeColor="transparent",Et.strokeWidth=0,Et.strokeDasharray="",Et.textColor="transparent",Et.fontSize="1rem",Et.isMoved=!1,Et.captionText="Caption",Et.PADDING=5,Et.captionBoxWidth=0,Et.captionBoxHeight=0,Et.strokeColor=_t.defaultColor,Et.strokeWidth=_t.defaultStrokeWidth,Et.strokeDasharray=_t.defaultStrokeDasharray,Et.fillColor=_t.defaultFillColor,Et.textColor=_t.defaultStrokeColor,Et.fontFamily=_t.defaultFontFamily,Et.fontSize=_t.defaultCaptionFontSize,Et.captionText=_t.defaultCaptionText,Et.setStrokeColor=Et.setStrokeColor.bind(Et),Et.setFillColor=Et.setFillColor.bind(Et),Et.setStrokeWidth=Et.setStrokeWidth.bind(Et),Et.setStrokeDasharray=Et.setStrokeDasharray.bind(Et),Et.createVisual=Et.createVisual.bind(Et),Et.sizeCaption=Et.sizeCaption.bind(Et),Et.setCaptionText=Et.setCaptionText.bind(Et),Et.showTextEditor=Et.showTextEditor.bind(Et),Et.positionTextEditor=Et.positionTextEditor.bind(Et),Et.finishTextEditing=Et.finishTextEditing.bind(Et),Et.setFont=Et.setFont.bind(Et),Et.setTextColor=Et.setTextColor.bind(Et),Et.strokePanel=new nt("Line color",ge(_t.defaultColorSet,["transparent"]),Et.strokeColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.fillPanel=new nt("Fill color",ge(_t.defaultColorSet,["transparent"]),Et.fillColor,Kt),Et.fillPanel.onColorChanged=Et.setFillColor,Et.strokeWidthPanel=new Gt("Line width",_t.defaultStrokeWidths,_t.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new jt("Line style",_t.defaultStrokeDasharrays,_t.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et.fontFamilyPanel=new pe("Font",_t.defaultFontFamilies,_t.defaultFontFamily),Et.fontFamilyPanel.onFontChanged=Et.setFont,Et.textColorPanel=new nt("Text color",_t.defaultColorSet,Et.textColor,ce),Et.textColorPanel.onColorChanged=Et.setTextColor,Et}return fe(kt,Dt),kt.prototype.ownsTarget=function(wt){return!(!Dt.prototype.ownsTarget.call(this,wt)&&wt!==this.visual&&wt!==this.frame&&wt!==this.captionBg&&wt!==this.captionElement)},kt.prototype.createVisual=function(){this.visual=re.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=re.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=re.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=re.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()},kt.prototype.setCaptionText=function(wt){this.captionText=wt,this.captionElement.textContent=this.captionText,this.sizeCaption()},kt.prototype.pointerDown=function(wt,At){Dt.prototype.pointerDown.call(this,wt,At),this.isMoved=!1,this.pointerDownPoint=wt,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(wt),this._state="creating")},kt.prototype.manipulate=function(wt){Dt.prototype.manipulate.call(this,wt),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(wt.x-this.pointerDownPoint.x)>5||Math.abs(wt.y-this.pointerDownPoint.y)>5)},kt.prototype.resize=function(wt){Dt.prototype.resize.call(this,wt),this.setSize()},kt.prototype.sizeCaption=function(){var wt=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=wt.width+2*this.PADDING,this.captionBoxHeight=wt.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),re.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')"]]),re.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')"]])},kt.prototype.showTextEditor=function(){var wt=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(At){At.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(At){At.key==="Enter"&&wt.finishTextEditing(wt.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(At){At.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){wt.finishTextEditing(wt.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){wt.finishTextEditing(wt.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},kt.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"))},kt.prototype.finishTextEditing=function(wt){this.setCaptionText(wt.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},kt.prototype.setFont=function(wt){this.captionElement&&re.setAttributes(this.captionElement,[["font-family",wt]]),this.fontFamily=wt,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},kt.prototype.setTextColor=function(wt){this.captionElement&&re.setAttributes(this.captionElement,[["fill",wt]]),this.textColor=wt,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},kt.prototype.setSize=function(){Dt.prototype.setSize.call(this),re.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},kt.prototype.pointerUp=function(wt){Dt.prototype.pointerUp.call(this,wt),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},kt.prototype.dblClick=function(wt,At){Dt.prototype.dblClick.call(this,wt,At),this.showTextEditor()},kt.prototype.setStrokeColor=function(wt){this.strokeColor=wt,this.frame&&re.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(wt),this.stateChanged()},kt.prototype.setFillColor=function(wt){this.fillColor=wt,this.captionBg&&re.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(wt),this.stateChanged()},kt.prototype.setStrokeWidth=function(wt){this.strokeWidth=wt,this.frame&&re.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},kt.prototype.setStrokeDasharray=function(wt){this.strokeDasharray=wt,this.frame&&re.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(kt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),kt.prototype.getState=function(){var wt=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},Dt.prototype.getState.call(this));return wt.typeName=this.typeName,wt},kt.prototype.restoreState=function(wt){var At=wt;this.fillColor=At.fillColor,this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.textColor=At.textColor,this.fontFamily=At.fontFamily,this.captionText=At.captionText,this.fontSize=At.fontSize,this.createVisual(),Dt.prototype.restoreState.call(this,wt),this.setSize()},kt.prototype.scale=function(wt,At){Dt.prototype.scale.call(this,wt,At),this.setSize()},kt.typeName="CaptionFrameMarker",kt.title="Caption frame marker",kt.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>',kt}(Lt),Pn=function(){function Dt(kt,wt){wt===void 0&&(wt=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=kt,this.cancelable=wt}return Object.defineProperty(Dt.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Dt.prototype.preventDefault=function(){this._defaultPrevented=!0},Dt}(),Qn=function(Dt){function kt(wt,At,_t){var Et=Dt.call(this,wt,!1)||this;return Et.dataUrl=At,Et.state=_t,Et}return fe(kt,Dt),kt}(Pn),ee=function(Dt){function kt(wt,At,_t){_t===void 0&&(_t=!1);var Et=Dt.call(this,wt,_t)||this;return Et.marker=At,Et}return fe(kt,Dt),kt}(Pn),jn=function(){function Dt(){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 Dt.prototype.addEventListener=function(kt,wt){this[kt].push(wt)},Dt.prototype.removeEventListener=function(kt,wt){var At=this[kt].indexOf(wt);At>-1&&this[kt].splice(At,1)},Dt}(),hi=function(){function Dt(kt){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ie,this._isOpen=!1,this.undoRedoManager=new gn,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 jn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Dt.instanceCounter++,this.styles=new $t(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=kt,this.targetRoot=document.body,this.width=kt.clientWidth,this.height=kt.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(Dt.prototype,"ALL_MARKER_TYPES",{get:function(){return[ne,Ye,Fn,Je,je,Yn,yn,tn,Dn,vn,Ge,Tn,Jn]},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ne,Ye,Fn,Je,Yn,yn,tn]},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ne,Ye,Fn,Je,yn]},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(kt){var wt=this;this._availableMarkerTypes.splice(0),kt.forEach(function(At){if(typeof At=="string"){var _t=wt.ALL_MARKER_TYPES.find(function(Et){return Et.typeName===At});_t!==void 0&&wt._availableMarkerTypes.push(_t)}else wt._availableMarkerTypes.push(At)})},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Dt.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(kt){this._zoomLevel=kt,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(Dt.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Dt.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),se.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Dt.prototype.show=function(){var kt=this;this.styles.styleSheetRoot===void 0&&Le.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Le.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(wt){return wt(new Pn(kt))})},Dt.prototype.render=function(){return be(this,void 0,void 0,function(){var kt;return Xe(this,function(wt){switch(wt.label){case 0:return this.setCurrentMarker(),(kt=new Ie).naturalSize=this.renderAtNaturalSize,kt.imageType=this.renderImageType,kt.imageQuality=this.renderImageQuality,kt.markersOnly=this.renderMarkersOnly,kt.width=this.renderWidth,kt.height=this.renderHeight,[4,kt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return wt.sent(),[4,kt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,wt.sent()]}})})},Dt.prototype.close=function(kt){var wt=this;if(kt===void 0&&(kt=!1),this.isOpen){var At=!1;kt||this.eventListeners.beforeclose.forEach(function(_t){var Et=new Pn(wt,!0);_t(Et),Et.defaultPrevented&&(At=!0)}),At||(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(_t){return _t(new Pn(wt))}),this.detachEvents(),this._isOpen=!1)}},Dt.prototype.addMarkersToToolbar=function(){for(var kt,wt=[],At=0;At<arguments.length;At++)wt[At]=arguments[At];(kt=this._availableMarkerTypes).push.apply(kt,wt)},Dt.prototype.addRenderEventListener=function(kt){this.addEventListener("render",function(wt){kt(wt.dataUrl,wt.state)})},Dt.prototype.removeRenderEventListener=function(kt){},Dt.prototype.addCloseEventListener=function(kt){this.addEventListener("close",function(){kt()})},Dt.prototype.removeCloseEventListener=function(kt){},Dt.prototype.setupResizeObserver=function(){var kt=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){kt.resize(kt.target.clientWidth,kt.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return kt.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Dt.prototype.onPopupTargetResize=function(){var kt=1*this.target.clientWidth/this.target.clientHeight,wt=this.editorCanvas.clientWidth/kt>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*kt:this.editorCanvas.clientWidth,At=wt<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/kt;this.resize(wt,At)},Dt.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Dt.prototype.resize=function(kt,wt){this._isResizing=!0;var At=kt/this.imageWidth,_t=wt/this.imageHeight;this.imageWidth=Math.round(kt),this.imageHeight=Math.round(wt),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(At,_t),this._isResizing=!1},Dt.prototype.scaleMarkers=function(kt,wt){var At,_t=this;this._currentMarker&&this._currentMarker instanceof Je?this._currentMarker.scale(kt,wt):(At=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Et){Et!==_t._currentMarker&&Et.scale(kt,wt)}),At!==void 0&&this.setCurrentMarker(At)},Dt.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"},Dt.prototype.setTopLeft=function(){var kt=this.editingTarget.getBoundingClientRect(),wt=this.editorCanvas.getBoundingClientRect();this.left=kt.left-wt.left,this.top=kt.top-wt.top},Dt.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)},Dt.prototype.addDefs=function(){for(var kt,wt=[],At=0;At<arguments.length;At++)wt[At]=arguments[At];this.defs=re.createDefs(),this.addDefsToImage(),(kt=this.defs).append.apply(kt,wt)},Dt.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Dt.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)},Dt.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Dt.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Dt.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)},Dt.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Dt.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)},Dt.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 kt=document.createElement("a");kt.href="https://markerjs.com/",kt.target="_blank",kt.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>',kt.title="Powered by marker.js",kt.style.display="grid",kt.style.alignItems="center",kt.style.justifyItems="center",kt.style.padding="3px",kt.style.width="20px",kt.style.height="20px",this.logoUI.appendChild(kt),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Dt.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")},Dt.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"},Dt.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Dt.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 kt=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=kt+"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 Re(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 Nt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Dt.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Dt.prototype.removeMarker=function(kt){this.markerImage.removeChild(kt.container),this.markers.indexOf(kt)>-1&&this.markers.splice(this.markers.indexOf(kt),1),kt.dispose()},Dt.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())},Dt.prototype.toolbarButtonClicked=function(kt,wt){if(kt==="marker"&&wt!==void 0)this.createNewMarker(wt);else if(kt==="action")switch(wt){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()}},Dt.prototype.deleteSelectedMarker=function(){var kt=this;if(this._currentMarker!==void 0){var wt=!1;if(this.eventListeners.markerbeforedelete.forEach(function(_t){var Et=new ee(kt,kt._currentMarker,!0);_t(Et),Et.defaultPrevented&&(wt=!0)}),!wt){var At=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(_t){return _t(new ee(kt,At))})}}},Dt.prototype.clear=function(){var kt=this,wt=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Pe){var Ee=new ee(kt,void 0,!0);Pe(Ee),Ee.defaultPrevented&&(wt=!0)}),!wt)){this.setCurrentMarker();for(var At=function(Pe){var Ee=_t.markers[Pe];_t.setCurrentMarker(_t.markers[Pe]),_t._currentMarker.dispose(),_t.markerImage.removeChild(_t._currentMarker.container),_t.markers.splice(_t.markers.indexOf(_t._currentMarker),1),_t.eventListeners.markerdelete.forEach(function(sn){return sn(new ee(kt,Ee))})},_t=this,Et=this.markers.length-1;Et>=0;Et--)At(Et);this.addUndoStep()}},Object.defineProperty(Dt.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Dt.prototype.showNotesEditor=function(){var kt;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=(kt=this._currentMarker.notes)!==null&&kt!==void 0?kt:"",this.overlayContainer.appendChild(this.notesArea))},Dt.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)},Dt.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Dt.prototype.addUndoStep=function(){var kt=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var wt=this.getState(),At=this.undoRedoManager.getLastUndoStep();if(!At||At.width===wt.width&&At.height===wt.height){var _t=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(wt),_t<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Et){return Et(new Pn(kt))})}else this.undoRedoManager.replaceLastUndoStep(wt),this.eventListeners.statechange.forEach(function(Et){return Et(new Pn(kt))})}},Dt.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Dt.prototype.undoStep=function(){var kt=this,wt=this.undoRedoManager.undo();wt!==void 0&&(this.restoreState(wt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(At){return At(new Pn(kt))}))},Dt.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Dt.prototype.redoStep=function(){var kt=this,wt=this.undoRedoManager.redo();wt!==void 0&&(this.restoreState(wt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(At){return At(new Pn(kt))}))},Dt.prototype.stepZoom=function(){var kt=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=kt<this.zoomSteps.length-1?this.zoomSteps[kt+1]:this.zoomSteps[0]},Dt.prototype.panTo=function(kt){this.contentDiv.scrollBy({left:this.prevPanPoint.x-kt.x,top:this.prevPanPoint.y-kt.y}),this.prevPanPoint=kt},Dt.prototype.startRenderAndClose=function(){return be(this,void 0,void 0,function(){var kt,wt,At=this;return Xe(this,function(_t){switch(_t.label){case 0:return[4,this.render()];case 1:return kt=_t.sent(),wt=this.getState(),this.eventListeners.render.forEach(function(Et){return Et(new Qn(At,kt,wt))}),this.close(!0),[2]}})})},Dt.prototype.getState=function(kt){kt===!0&&this.setCurrentMarker();var wt={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(At){return wt.markers.push(At.getState())}),wt},Dt.prototype.restoreState=function(kt){var wt=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);kt.markers.forEach(function(At){var _t=wt._availableMarkerTypes.find(function(Pe){return Pe.typeName===At.typeName});if(_t!==void 0){var Et=wt.addNewMarker(_t);Et.restoreState(At),wt.markers.push(Et)}}),kt.width&&kt.height&&(kt.width!==this.imageWidth||kt.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/kt.width,this.imageHeight/kt.height),this.eventListeners.restorestate.forEach(function(At){return At(new Pn(wt))})},Dt.prototype.addNewMarker=function(kt){var wt=re.createGroup();return this.markerImage.appendChild(wt),new kt(wt,this.overlayContainer,this.settings)},Dt.prototype.createNewMarker=function(kt){var wt,At=this;(wt=typeof kt=="string"?this._availableMarkerTypes.find(function(_t){return _t.typeName===kt}):kt)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(wt),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(wt.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(_t){return _t(new ee(At,At._currentMarker))}))},Dt.prototype.markerCreated=function(kt){var wt=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(kt),this.setCurrentMarker(kt),kt instanceof Ye&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ye):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(At){return At(new ee(wt,wt._currentMarker))})},Dt.prototype.colorChanged=function(kt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=kt,this.settings.defaultStrokeColor=kt)},Dt.prototype.fillColorChanged=function(kt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=kt)},Dt.prototype.markerStateChanged=function(kt){var wt=this;this.eventListeners.markerchange.forEach(function(At){return At(new ee(wt,kt))})},Dt.prototype.setCurrentMarker=function(kt){var wt=this;this._currentMarker!==kt&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(At){return At(new ee(wt,wt._currentMarker))})),this._currentMarker=kt,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(At){return At(new ee(wt,wt._currentMarker))}))},Dt.prototype.onPointerDown=function(kt){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||kt.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var wt=this.markers.find(function(At){return At.ownsTarget(kt.target)});wt!==void 0?(this.setCurrentMarker(wt),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(kt.clientX,kt.clientY),kt.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:kt.clientX,y:kt.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(kt.clientX,kt.clientY))},Dt.prototype.onDblClick=function(kt){if(this._isFocused||this.focus(),this.mode==="select"){var wt=this.markers.find(function(At){return At.ownsTarget(kt.target)});wt!==void 0&&wt!==this._currentMarker&&this.setCurrentMarker(wt),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(kt.clientX,kt.clientY),kt.target):this.setCurrentMarker()}},Dt.prototype.onPointerMove=function(kt){this.touchPoints!==1&&kt.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||kt.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(kt.clientX,kt.clientY)):this.zoomLevel>1&&this.panTo({x:kt.clientX,y:kt.clientY}))},Dt.prototype.onPointerUp=function(kt){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(kt.clientX,kt.clientY)),this.isDragging=!1,this.addUndoStep()},Dt.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Dt.prototype.onKeyUp=function(kt){this._currentMarker===void 0||this.notesArea!==void 0||kt.key!=="Delete"&&kt.key!=="Backspace"||this.deleteSelectedMarker()},Dt.prototype.clientToLocalCoordinates=function(kt,wt){var At=this.markerImage.getBoundingClientRect();return{x:(kt-At.left)/this.zoomLevel,y:(wt-At.top)/this.zoomLevel}},Dt.prototype.onWindowResize=function(){this.positionUI()},Dt.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var kt=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=kt+"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()},Dt.prototype.addLicenseKey=function(kt){se.addKey(kt)},Dt.prototype.addEventListener=function(kt,wt){this.eventListeners.addEventListener(kt,wt)},Dt.prototype.removeEventListener=function(kt,wt){this.eventListeners.removeEventListener(kt,wt)},Dt.prototype.renderState=function(kt){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(kt),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Dt.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Dt.prototype.focus=function(){var kt=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(wt){return wt(new Pn(kt))}))},Dt.prototype.blur=function(){var kt=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(wt){return wt(new Pn(kt))}))},Dt.instanceCounter=0,Dt}()},738:function(un,Gn,Yt){"use strict";Yt.d(Gn,{Z:function(){return vt}});var St=Yt(72308),fe=Yt(49618),be=Yt(52487),Xe=Yt(74416),ge=Yt(92310),re=Yt.n(ge),se=Yt(18929),Ie=Yt(10228),Le=Yt(26112),$t=Yt(59301);function Ze(Lt,bt){var Gt=Lt.disabled,jt=Lt.prefixCls,ne=Lt.character,ie=Lt.characterRender,te=Lt.index,Ge=Lt.count,pe=Lt.value,Je=Lt.allowHalf,Ye=Lt.focused,hn=Lt.onHover,Fn=Lt.onClick,vn=function(je){hn(je,te)},pi=function(je){Fn(je,te)},yn=function(je){je.keyCode===Ie.Z.ENTER&&Fn(je,te)},ce=te+1,Kt=new Set([jt]);pe===0&&te===0&&Ye?Kt.add("".concat(jt,"-focused")):Je&&pe+.5>=ce&&pe<ce?(Kt.add("".concat(jt,"-half")),Kt.add("".concat(jt,"-active")),Ye&&Kt.add("".concat(jt,"-focused"))):(ce<=pe?Kt.add("".concat(jt,"-full")):Kt.add("".concat(jt,"-zero")),ce===pe&&Ye&&Kt.add("".concat(jt,"-focused")));var tn=typeof ne=="function"?ne(Lt):ne,Yn=$t.createElement("li",{className:re()(Array.from(Kt)),ref:bt},$t.createElement("div",{onClick:Gt?null:pi,onKeyDown:Gt?null:yn,onMouseMove:Gt?null:vn,role:"radio","aria-checked":pe>te?"true":"false","aria-posinset":te+1,"aria-setsize":Ge,tabIndex:Gt?-1:0},$t.createElement("div",{className:"".concat(jt,"-first")},tn),$t.createElement("div",{className:"".concat(jt,"-second")},tn)));return ie&&(Yn=ie(Yn,Lt)),Yn}var ae=$t.forwardRef(Ze);function Re(){var Lt=$t.useRef({});function bt(jt){return Lt.current[jt]}function Gt(jt){return function(ne){Lt.current[jt]=ne}}return[bt,Gt]}function Nt(Lt){var bt=Lt.pageXOffset,Gt="scrollLeft";if(typeof bt!="number"){var jt=Lt.document;bt=jt.documentElement[Gt],typeof bt!="number"&&(bt=jt.body[Gt])}return bt}function et(Lt){var bt,Gt,jt=Lt.ownerDocument,ne=jt.body,ie=jt&&jt.documentElement,te=Lt.getBoundingClientRect();return bt=te.left,Gt=te.top,bt-=ie.clientLeft||ne.clientLeft||0,Gt-=ie.clientTop||ne.clientTop||0,{left:bt,top:Gt}}function nt(Lt){var bt=et(Lt),Gt=Lt.ownerDocument,jt=Gt.defaultView||Gt.parentWindow;return bt.left+=Nt(jt),bt.left}var ct=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function lt(Lt,bt){var Gt=Lt.prefixCls,jt=Gt===void 0?"rc-rate":Gt,ne=Lt.className,ie=Lt.defaultValue,te=Lt.value,Ge=Lt.count,pe=Ge===void 0?5:Ge,Je=Lt.allowHalf,Ye=Je===void 0?!1:Je,hn=Lt.allowClear,Fn=hn===void 0?!0:hn,vn=Lt.keyboard,pi=vn===void 0?!0:vn,yn=Lt.character,ce=yn===void 0?"\u2605":yn,Kt=Lt.characterRender,tn=Lt.disabled,Yn=Lt.direction,Dn=Yn===void 0?"ltr":Yn,je=Lt.tabIndex,gn=je===void 0?0:je,Tn=Lt.autoFocus,Jn=Lt.onHoverChange,Pn=Lt.onChange,Qn=Lt.onFocus,ee=Lt.onBlur,jn=Lt.onKeyDown,hi=Lt.onMouseLeave,Dt=(0,Xe.Z)(Lt,ct),kt=Re(),wt=(0,be.Z)(kt,2),At=wt[0],_t=wt[1],Et=$t.useRef(null),Pe=function(){if(!tn){var Xi;(Xi=Et.current)===null||Xi===void 0||Xi.focus()}};$t.useImperativeHandle(bt,function(){return{focus:Pe,blur:function(){if(!tn){var Xi;(Xi=Et.current)===null||Xi===void 0||Xi.blur()}}}});var Ee=(0,se.Z)(ie||0,{value:te}),sn=(0,be.Z)(Ee,2),He=sn[0],Ae=sn[1],qe=(0,se.Z)(null),en=(0,be.Z)(qe,2),dn=en[0],An=en[1],_n=function(Xi,ro){var Ct=Dn==="rtl",Go=Xi+1;if(Ye){var lo=At(Xi),jo=nt(lo),dr=lo.clientWidth;(Ct&&ro-jo>dr/2||!Ct&&ro-jo<dr/2)&&(Go-=.5)}return Go},fn=function(Xi){Ae(Xi),Pn==null||Pn(Xi)},Zi=$t.useState(!1),Pi=(0,be.Z)(Zi,2),zi=Pi[0],Hi=Pi[1],po=function(){Hi(!0),Qn==null||Qn()},oo=function(){Hi(!1),ee==null||ee()},Fi=$t.useState(null),Ki=(0,be.Z)(Fi,2),hr=Ki[0],Yo=Ki[1],Ro=function(Xi,ro){var Ct=_n(ro,Xi.pageX);Ct!==dn&&(Yo(Ct),An(null)),Jn==null||Jn(Ct)},er=function(Xi){tn||(Yo(null),An(null),Jn==null||Jn(void 0)),Xi&&(hi==null||hi(Xi))},$o=function(Xi,ro){var Ct=_n(ro,Xi.pageX),Go=!1;Fn&&(Go=Ct===He),er(),fn(Go?0:Ct),An(Go?Ct:null)},Sr=function(Xi){var ro=Xi.keyCode,Ct=Dn==="rtl",Go=Ye?.5:1;pi&&(ro===Ie.Z.RIGHT&&He<pe&&!Ct?(fn(He+Go),Xi.preventDefault()):ro===Ie.Z.LEFT&&He>0&&!Ct||ro===Ie.Z.RIGHT&&He>0&&Ct?(fn(He-Go),Xi.preventDefault()):ro===Ie.Z.LEFT&&He<pe&&Ct&&(fn(He+Go),Xi.preventDefault())),jn==null||jn(Xi)};$t.useEffect(function(){Tn&&!tn&&Pe()},[]);var Br=new Array(pe).fill(0).map(function(zo,Xi){return $t.createElement(ae,{ref:_t(Xi),index:Xi,count:pe,disabled:tn,prefixCls:"".concat(jt,"-star"),allowHalf:Ye,value:hr===null?He:hr,onClick:$o,onHover:Ro,key:zo||Xi,character:ce,characterRender:Kt,focused:zi})}),nr=re()(jt,ne,(0,fe.Z)((0,fe.Z)({},"".concat(jt,"-disabled"),tn),"".concat(jt,"-rtl"),Dn==="rtl"));return $t.createElement("ul",(0,St.Z)({className:nr,onMouseLeave:er,tabIndex:tn?-1:gn,onFocus:tn?null:po,onBlur:tn?null:oo,onKeyDown:tn?null:Sr,ref:Et},(0,Le.Z)(Dt,{aria:!0,data:!0,attr:!0})),Br)}var pt=$t.forwardRef(lt),vt=pt},69582:function(un,Gn,Yt){"use strict";Yt.d(Gn,{ZP:function(){return se}});var St=Yt(52487),fe=Yt(59301),be=Yt(47273),Xe=0,ge=(0,be.Z)();function re(){var Ie;return ge?(Ie=Xe,Xe+=1):Ie="TEST_OR_SSR",Ie}function se(Ie){var Le=fe.useState(),$t=(0,St.Z)(Le,2),Ze=$t[0],ae=$t[1];return fe.useEffect(function(){ae("rc_select_".concat(re()))},[]),Ie||Ze}},45560:function(un,Gn,Yt){"use strict";Yt.d(Gn,{Ac:function(){return Zi},Xo:function(){return zi},Wx:function(){return po},ZP:function(){return pn},lk:function(){return vt}});var St=Yt(72308),fe=Yt(80702),be=Yt(49618),Xe=Yt(77321),ge=Yt(52487),re=Yt(74416),se=Yt(62853),Ie=Yt(18929),Le=Yt(48736),$t=Yt(59301),Ze=Yt(92310),ae=Yt.n(Ze),Re=Yt(34280),Nt=Yt(49658),et=Yt(8654),nt=function(de){var Sn=de.className,Wt=de.customizeIcon,Ne=de.customizeIconProps,an=de.children,ye=de.onMouseDown,Qt=de.onClick,Zt=typeof Wt=="function"?Wt(Ne):Wt;return $t.createElement("span",{className:Sn,onMouseDown:function(Mn){Mn.preventDefault(),ye==null||ye(Mn)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:Qt,"aria-hidden":!0},Zt!==void 0?Zt:$t.createElement("span",{className:ae()(Sn.split(/\s+/).map(function(De){return"".concat(De,"-icon")}))},an))},ct=nt,lt=function(de,Sn,Wt,Ne,an){var ye=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,Qt=arguments.length>6?arguments[6]:void 0,Zt=arguments.length>7?arguments[7]:void 0,De=$t.useMemo(function(){if((0,se.Z)(Ne)==="object")return Ne.clearIcon;if(an)return an},[Ne,an]),Mn=$t.useMemo(function(){return!!(!ye&&Ne&&(Wt.length||Qt)&&!(Zt==="combobox"&&Qt===""))},[Ne,ye,Wt.length,Qt,Zt]);return{allowClear:Mn,clearIcon:$t.createElement(ct,{className:"".concat(de,"-clear"),onMouseDown:Sn,customizeIcon:De},"\xD7")}},pt=$t.createContext(null);function vt(){return $t.useContext(pt)}function Lt(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,de=$t.useState(!1),Sn=(0,ge.Z)(de,2),Wt=Sn[0],Ne=Sn[1],an=$t.useRef(null),ye=function(){window.clearTimeout(an.current)};$t.useEffect(function(){return ye},[]);var Qt=function(De,Mn){ye(),an.current=window.setTimeout(function(){Ne(De),Mn&&Mn()},me)};return[Wt,Qt,ye]}function bt(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,de=$t.useRef(null),Sn=$t.useRef(null);$t.useEffect(function(){return function(){window.clearTimeout(Sn.current)}},[]);function Wt(Ne){(Ne||de.current===null)&&(de.current=Ne),window.clearTimeout(Sn.current),Sn.current=window.setTimeout(function(){de.current=null},me)}return[function(){return de.current},Wt]}function Gt(me,de,Sn,Wt){var Ne=$t.useRef(null);Ne.current={open:de,triggerOpen:Sn,customizedTrigger:Wt},$t.useEffect(function(){function an(ye){var Qt;if(!((Qt=Ne.current)!==null&&Qt!==void 0&&Qt.customizedTrigger)){var Zt=ye.target;Zt.shadowRoot&&ye.composed&&(Zt=ye.composedPath()[0]||Zt),Ne.current.open&&me().filter(function(De){return De}).every(function(De){return!De.contains(Zt)&&De!==Zt})&&Ne.current.triggerOpen(!1)}}return window.addEventListener("mousedown",an),function(){return window.removeEventListener("mousedown",an)}},[])}var jt=Yt(10228);function ne(me){return me&&![jt.Z.ESC,jt.Z.SHIFT,jt.Z.BACKSPACE,jt.Z.TAB,jt.Z.WIN_KEY,jt.Z.ALT,jt.Z.META,jt.Z.WIN_KEY_RIGHT,jt.Z.CTRL,jt.Z.SEMICOLON,jt.Z.EQUALS,jt.Z.CAPS_LOCK,jt.Z.CONTEXT_MENU,jt.Z.F1,jt.Z.F2,jt.Z.F3,jt.Z.F4,jt.Z.F5,jt.Z.F6,jt.Z.F7,jt.Z.F8,jt.Z.F9,jt.Z.F10,jt.Z.F11,jt.Z.F12].includes(me)}var ie=Yt(26112),te=Yt(11780),Ge=function(de,Sn){var Wt,Ne=de.prefixCls,an=de.id,ye=de.inputElement,Qt=de.disabled,Zt=de.tabIndex,De=de.autoFocus,Mn=de.autoComplete,Hn=de.editable,ln=de.activeDescendantId,Be=de.value,we=de.maxLength,zn=de.onKeyDown,Vn=de.onMouseDown,si=de.onChange,Fe=de.onPaste,Yi=de.onCompositionStart,qn=de.onCompositionEnd,Ri=de.onBlur,Se=de.open,on=de.attrs,bn=ye||$t.createElement("input",null),Rn=bn,Bn=Rn.ref,Un=Rn.props,mi=Un.onKeyDown,ai=Un.onChange,ei=Un.onMouseDown,di=Un.onCompositionStart,ke=Un.onCompositionEnd,Di=Un.onBlur,Me=Un.style;return(0,Le.Kp)(!("maxLength"in bn.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),bn=$t.cloneElement(bn,(0,Xe.Z)((0,Xe.Z)((0,Xe.Z)({type:"search"},Un),{},{id:an,ref:(0,et.sQ)(Sn,Bn),disabled:Qt,tabIndex:Zt,autoComplete:Mn||"off",autoFocus:De,className:ae()("".concat(Ne,"-selection-search-input"),(Wt=bn)===null||Wt===void 0||(Wt=Wt.props)===null||Wt===void 0?void 0:Wt.className),role:"combobox","aria-expanded":Se||!1,"aria-haspopup":"listbox","aria-owns":"".concat(an,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(an,"_list"),"aria-activedescendant":Se?ln:void 0},on),{},{value:Hn?Be:"",maxLength:we,readOnly:!Hn,unselectable:Hn?null:"on",style:(0,Xe.Z)((0,Xe.Z)({},Me),{},{opacity:Hn?null:0}),onKeyDown:function($n){zn($n),mi&&mi($n)},onMouseDown:function($n){Vn($n),ei&&ei($n)},onChange:function($n){si($n),ai&&ai($n)},onCompositionStart:function($n){Yi($n),di&&di($n)},onCompositionEnd:function($n){qn($n),ke&&ke($n)},onPaste:Fe,onBlur:function($n){Ri($n),Di&&Di($n)}})),bn},pe=$t.forwardRef(Ge),Je=pe;function Ye(me){return Array.isArray(me)?me:me!==void 0?[me]:[]}var hn=typeof window!="undefined"&&window.document&&window.document.documentElement,Fn=hn;function vn(me){return me!=null}function pi(me){return!me&&me!==0}function yn(me){return["string","number"].includes((0,se.Z)(me))}function ce(me){var de=void 0;return me&&(yn(me.title)?de=me.title.toString():yn(me.label)&&(de=me.label.toString())),de}function Kt(me,de){Fn?$t.useLayoutEffect(me,de):$t.useEffect(me,de)}function tn(me){var de;return(de=me.key)!==null&&de!==void 0?de:me.value}var Yn=function(de){de.preventDefault(),de.stopPropagation()},Dn=function(de){var Sn=de.id,Wt=de.prefixCls,Ne=de.values,an=de.open,ye=de.searchValue,Qt=de.autoClearSearchValue,Zt=de.inputRef,De=de.placeholder,Mn=de.disabled,Hn=de.mode,ln=de.showSearch,Be=de.autoFocus,we=de.autoComplete,zn=de.activeDescendantId,Vn=de.tabIndex,si=de.removeIcon,Fe=de.maxTagCount,Yi=de.maxTagTextLength,qn=de.maxTagPlaceholder,Ri=qn===void 0?function(bo){return"+ ".concat(bo.length," ...")}:qn,Se=de.tagRender,on=de.onToggleOpen,bn=de.onRemove,Rn=de.onInputChange,Bn=de.onInputPaste,Un=de.onInputKeyDown,mi=de.onInputMouseDown,ai=de.onInputCompositionStart,ei=de.onInputCompositionEnd,di=de.onInputBlur,ke=$t.useRef(null),Di=(0,$t.useState)(0),Me=(0,ge.Z)(Di,2),En=Me[0],$n=Me[1],ti=(0,$t.useState)(!1),mo=(0,ge.Z)(ti,2),Ji=mo[0],wi=mo[1],bi="".concat(Wt,"-selection"),Vi=an||Hn==="multiple"&&Qt===!1||Hn==="tags"?ye:"",Ci=Hn==="tags"||Hn==="multiple"&&Qt===!1||ln&&(an||Ji);Kt(function(){$n(ke.current.scrollWidth)},[Vi]);var kn=function(Kn,li,Ai,ki,Bi){return $t.createElement("span",{title:ce(Kn),className:ae()("".concat(bi,"-item"),(0,be.Z)({},"".concat(bi,"-item-disabled"),Ai))},$t.createElement("span",{className:"".concat(bi,"-item-content")},li),ki&&$t.createElement(ct,{className:"".concat(bi,"-item-remove"),onMouseDown:Yn,onClick:Bi,customizeIcon:si},"\xD7"))},Bt=function(Kn,li,Ai,ki,Bi,Zo){var vi=function(Qe){Yn(Qe),on(!an)};return $t.createElement("span",{onMouseDown:vi},Se({label:li,value:Kn,disabled:Ai,closable:ki,onClose:Bi,isMaxTag:!!Zo}))},vo=function(Kn){var li=Kn.disabled,Ai=Kn.label,ki=Kn.value,Bi=!Mn&&!li,Zo=Ai;if(typeof Yi=="number"&&(typeof Ai=="string"||typeof Ai=="number")){var vi=String(Zo);vi.length>Yi&&(Zo="".concat(vi.slice(0,Yi),"..."))}var fi=function(ni){ni&&ni.stopPropagation(),bn(Kn)};return typeof Se=="function"?Bt(ki,Zo,li,Bi,fi):kn(Kn,Zo,li,Bi,fi)},Ui=function(Kn){if(!Ne.length)return null;var li=typeof Ri=="function"?Ri(Kn):Ri;return typeof Se=="function"?Bt(void 0,li,!1,!1,void 0,!0):kn({title:li},li,!1)},Wi=$t.createElement("div",{className:"".concat(bi,"-search"),style:{width:En},onFocus:function(){wi(!0)},onBlur:function(){wi(!1)}},$t.createElement(Je,{ref:Zt,open:an,prefixCls:Wt,id:Sn,inputElement:null,disabled:Mn,autoFocus:Be,autoComplete:we,editable:Ci,activeDescendantId:zn,value:Vi,onKeyDown:Un,onMouseDown:mi,onChange:Rn,onPaste:Bn,onCompositionStart:ai,onCompositionEnd:ei,onBlur:di,tabIndex:Vn,attrs:(0,ie.Z)(de,!0)}),$t.createElement("span",{ref:ke,className:"".concat(bi,"-search-mirror"),"aria-hidden":!0},Vi,"\xA0")),so=$t.createElement(te.Z,{prefixCls:"".concat(bi,"-overflow"),data:Ne,renderItem:vo,renderRest:Ui,suffix:Wi,itemKey:tn,maxCount:Fe});return $t.createElement("span",{className:"".concat(bi,"-wrap")},so,!Ne.length&&!Vi&&$t.createElement("span",{className:"".concat(bi,"-placeholder")},De))},je=Dn,gn=function(de){var Sn=de.inputElement,Wt=de.prefixCls,Ne=de.id,an=de.inputRef,ye=de.disabled,Qt=de.autoFocus,Zt=de.autoComplete,De=de.activeDescendantId,Mn=de.mode,Hn=de.open,ln=de.values,Be=de.placeholder,we=de.tabIndex,zn=de.showSearch,Vn=de.searchValue,si=de.activeValue,Fe=de.maxLength,Yi=de.onInputKeyDown,qn=de.onInputMouseDown,Ri=de.onInputChange,Se=de.onInputPaste,on=de.onInputCompositionStart,bn=de.onInputCompositionEnd,Rn=de.onInputBlur,Bn=de.title,Un=$t.useState(!1),mi=(0,ge.Z)(Un,2),ai=mi[0],ei=mi[1],di=Mn==="combobox",ke=di||zn,Di=ln[0],Me=Vn||"";di&&si&&!ai&&(Me=si),$t.useEffect(function(){di&&ei(!1)},[di,si]);var En=Mn!=="combobox"&&!Hn&&!zn?!1:!!Me,$n=Bn===void 0?ce(Di):Bn,ti=$t.useMemo(function(){return Di?null:$t.createElement("span",{className:"".concat(Wt,"-selection-placeholder"),style:En?{visibility:"hidden"}:void 0},Be)},[Di,En,Be,Wt]);return $t.createElement("span",{className:"".concat(Wt,"-selection-wrap")},$t.createElement("span",{className:"".concat(Wt,"-selection-search")},$t.createElement(Je,{ref:an,prefixCls:Wt,id:Ne,open:Hn,inputElement:Sn,disabled:ye,autoFocus:Qt,autoComplete:Zt,editable:ke,activeDescendantId:De,value:Me,onKeyDown:Yi,onMouseDown:qn,onChange:function(Ji){ei(!0),Ri(Ji)},onPaste:Se,onCompositionStart:on,onCompositionEnd:bn,onBlur:Rn,tabIndex:we,attrs:(0,ie.Z)(de,!0),maxLength:di?Fe:void 0})),!di&&Di?$t.createElement("span",{className:"".concat(Wt,"-selection-item"),title:$n,style:En?{visibility:"hidden"}:void 0},Di.label):null,ti)},Tn=gn,Jn=function(de,Sn){var Wt=(0,$t.useRef)(null),Ne=(0,$t.useRef)(!1),an=de.prefixCls,ye=de.open,Qt=de.mode,Zt=de.showSearch,De=de.tokenWithEnter,Mn=de.disabled,Hn=de.prefix,ln=de.autoClearSearchValue,Be=de.onSearch,we=de.onSearchSubmit,zn=de.onToggleOpen,Vn=de.onInputKeyDown,si=de.onInputBlur,Fe=de.domRef;$t.useImperativeHandle(Sn,function(){return{focus:function($n){Wt.current.focus($n)},blur:function(){Wt.current.blur()}}});var Yi=bt(0),qn=(0,ge.Z)(Yi,2),Ri=qn[0],Se=qn[1],on=function($n){var ti=$n.which,mo=Wt.current instanceof HTMLTextAreaElement;!mo&&ye&&(ti===jt.Z.UP||ti===jt.Z.DOWN)&&$n.preventDefault(),Vn&&Vn($n),ti===jt.Z.ENTER&&Qt==="tags"&&!Ne.current&&!ye&&(we==null||we($n.target.value)),!(mo&&!ye&&~[jt.Z.UP,jt.Z.DOWN,jt.Z.LEFT,jt.Z.RIGHT].indexOf(ti))&&ne(ti)&&zn(!0)},bn=function(){Se(!0)},Rn=(0,$t.useRef)(null),Bn=function($n){Be($n,!0,Ne.current)!==!1&&zn(!0)},Un=function(){Ne.current=!0},mi=function($n){Ne.current=!1,Qt!=="combobox"&&Bn($n.target.value)},ai=function($n){var ti=$n.target.value;if(De&&Rn.current&&/[\r\n]/.test(Rn.current)){var mo=Rn.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");ti=ti.replace(mo,Rn.current)}Rn.current=null,Bn(ti)},ei=function($n){var ti=$n.clipboardData,mo=ti==null?void 0:ti.getData("text");Rn.current=mo||""},di=function($n){var ti=$n.target;if(ti!==Wt.current){var mo=document.body.style.msTouchAction!==void 0;mo?setTimeout(function(){Wt.current.focus()}):Wt.current.focus()}},ke=function($n){var ti=Ri();$n.target!==Wt.current&&!ti&&!(Qt==="combobox"&&Mn)&&$n.preventDefault(),(Qt!=="combobox"&&(!Zt||!ti)||!ye)&&(ye&&ln!==!1&&Be("",!0,!1),zn())},Di={inputRef:Wt,onInputKeyDown:on,onInputMouseDown:bn,onInputChange:ai,onInputPaste:ei,onInputCompositionStart:Un,onInputCompositionEnd:mi,onInputBlur:si},Me=Qt==="multiple"||Qt==="tags"?$t.createElement(je,(0,St.Z)({},de,Di)):$t.createElement(Tn,(0,St.Z)({},de,Di));return $t.createElement("div",{ref:Fe,className:"".concat(an,"-selector"),onClick:di,onMouseDown:ke},Hn&&$t.createElement("div",{className:"".concat(an,"-prefix")},Hn),Me)},Pn=$t.forwardRef(Jn),Qn=Pn,ee=Yt(65352),jn=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],hi=function(de){var Sn=de===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:Sn,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:Sn,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:Sn,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:Sn,adjustY:1},htmlRegion:"scroll"}}},Dt=function(de,Sn){var Wt=de.prefixCls,Ne=de.disabled,an=de.visible,ye=de.children,Qt=de.popupElement,Zt=de.animation,De=de.transitionName,Mn=de.dropdownStyle,Hn=de.dropdownClassName,ln=de.direction,Be=ln===void 0?"ltr":ln,we=de.placement,zn=de.builtinPlacements,Vn=de.dropdownMatchSelectWidth,si=de.dropdownRender,Fe=de.dropdownAlign,Yi=de.getPopupContainer,qn=de.empty,Ri=de.getTriggerDOMNode,Se=de.onPopupVisibleChange,on=de.onPopupMouseEnter,bn=(0,re.Z)(de,jn),Rn="".concat(Wt,"-dropdown"),Bn=Qt;si&&(Bn=si(Qt));var Un=$t.useMemo(function(){return zn||hi(Vn)},[zn,Vn]),mi=Zt?"".concat(Rn,"-").concat(Zt):De,ai=typeof Vn=="number",ei=$t.useMemo(function(){return ai?null:Vn===!1?"minWidth":"width"},[Vn,ai]),di=Mn;ai&&(di=(0,Xe.Z)((0,Xe.Z)({},di),{},{width:Vn}));var ke=$t.useRef(null);return $t.useImperativeHandle(Sn,function(){return{getPopupElement:function(){var Me;return(Me=ke.current)===null||Me===void 0?void 0:Me.popupElement}}}),$t.createElement(ee.Z,(0,St.Z)({},bn,{showAction:Se?["click"]:[],hideAction:Se?["click"]:[],popupPlacement:we||(Be==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Un,prefixCls:Rn,popupTransitionName:mi,popup:$t.createElement("div",{onMouseEnter:on},Bn),ref:ke,stretch:ei,popupAlign:Fe,popupVisible:an,getPopupContainer:Yi,popupClassName:ae()(Hn,(0,be.Z)({},"".concat(Rn,"-empty"),qn)),popupStyle:di,getTriggerDOMNode:Ri,onPopupVisibleChange:Se}),ye)},kt=$t.forwardRef(Dt),wt=kt,At=Yt(68413);function _t(me,de){var Sn=me.key,Wt;return"value"in me&&(Wt=me.value),Sn!=null?Sn:Wt!==void 0?Wt:"rc-index-key-".concat(de)}function Et(me){return typeof me!="undefined"&&!Number.isNaN(me)}function Pe(me,de){var Sn=me||{},Wt=Sn.label,Ne=Sn.value,an=Sn.options,ye=Sn.groupLabel,Qt=Wt||(de?"children":"label");return{label:Qt,value:Ne||"value",options:an||"options",groupLabel:ye||Qt}}function Ee(me){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Sn=de.fieldNames,Wt=de.childrenAsData,Ne=[],an=Pe(Sn,!1),ye=an.label,Qt=an.value,Zt=an.options,De=an.groupLabel;function Mn(Hn,ln){Array.isArray(Hn)&&Hn.forEach(function(Be){if(ln||!(Zt in Be)){var we=Be[Qt];Ne.push({key:_t(Be,Ne.length),groupOption:ln,data:Be,label:Be[ye],value:we})}else{var zn=Be[De];zn===void 0&&Wt&&(zn=Be.label),Ne.push({key:_t(Be,Ne.length),group:!0,data:Be,label:zn}),Mn(Be[Zt],!0)}})}return Mn(me,!1),Ne}function sn(me){var de=(0,Xe.Z)({},me);return"props"in de||Object.defineProperty(de,"props",{get:function(){return(0,Le.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),de}}),de}var He=function(de,Sn,Wt){if(!Sn||!Sn.length)return null;var Ne=!1,an=function Qt(Zt,De){var Mn=(0,At.Z)(De),Hn=Mn[0],ln=Mn.slice(1);if(!Hn)return[Zt];var Be=Zt.split(Hn);return Ne=Ne||Be.length>1,Be.reduce(function(we,zn){return[].concat((0,fe.Z)(we),(0,fe.Z)(Qt(zn,ln)))},[]).filter(Boolean)},ye=an(de,Sn);return Ne?typeof Wt!="undefined"?ye.slice(0,Wt):ye:null},Ae=$t.createContext(null),qe=Ae;function en(me){var de=me.visible,Sn=me.values;if(!de)return null;var Wt=50;return $t.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(Sn.slice(0,Wt).map(function(Ne){var an=Ne.label,ye=Ne.value;return["number","string"].includes((0,se.Z)(an))?an:ye}).join(", ")),Sn.length>Wt?", ...":null)}var dn=["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"],An=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],_n=function(de){return de==="tags"||de==="multiple"},fn=$t.forwardRef(function(me,de){var Sn,Wt=me.id,Ne=me.prefixCls,an=me.className,ye=me.showSearch,Qt=me.tagRender,Zt=me.direction,De=me.omitDomProps,Mn=me.displayValues,Hn=me.onDisplayValuesChange,ln=me.emptyOptions,Be=me.notFoundContent,we=Be===void 0?"Not Found":Be,zn=me.onClear,Vn=me.mode,si=me.disabled,Fe=me.loading,Yi=me.getInputElement,qn=me.getRawInputElement,Ri=me.open,Se=me.defaultOpen,on=me.onDropdownVisibleChange,bn=me.activeValue,Rn=me.onActiveValueChange,Bn=me.activeDescendantId,Un=me.searchValue,mi=me.autoClearSearchValue,ai=me.onSearch,ei=me.onSearchSplit,di=me.tokenSeparators,ke=me.allowClear,Di=me.prefix,Me=me.suffixIcon,En=me.clearIcon,$n=me.OptionList,ti=me.animation,mo=me.transitionName,Ji=me.dropdownStyle,wi=me.dropdownClassName,bi=me.dropdownMatchSelectWidth,Vi=me.dropdownRender,Ci=me.dropdownAlign,kn=me.placement,Bt=me.builtinPlacements,vo=me.getPopupContainer,Ui=me.showAction,Wi=Ui===void 0?[]:Ui,so=me.onFocus,bo=me.onBlur,Kn=me.onKeyUp,li=me.onKeyDown,Ai=me.onMouseDown,ki=(0,re.Z)(me,dn),Bi=_n(Vn),Zo=(ye!==void 0?ye:Bi)||Vn==="combobox",vi=(0,Xe.Z)({},ki);An.forEach(function(Vo){delete vi[Vo]}),De==null||De.forEach(function(Vo){delete vi[Vo]});var fi=$t.useState(!1),Qe=(0,ge.Z)(fi,2),ni=Qe[0],no=Qe[1];$t.useEffect(function(){no((0,Nt.Z)())},[]);var Ho=$t.useRef(null),_o=$t.useRef(null),ko=$t.useRef(null),Ko=$t.useRef(null),Fo=$t.useRef(null),zr=$t.useRef(!1),Dr=Lt(),ms=(0,ge.Z)(Dr,3),Ce=ms[0],To=ms[1],kl=ms[2];$t.useImperativeHandle(de,function(){var Vo,Co;return{focus:(Vo=Ko.current)===null||Vo===void 0?void 0:Vo.focus,blur:(Co=Ko.current)===null||Co===void 0?void 0:Co.blur,scrollTo:function(js){var Yr;return(Yr=Fo.current)===null||Yr===void 0?void 0:Yr.scrollTo(js)},nativeElement:Ho.current||_o.current}});var Gr=$t.useMemo(function(){var Vo;if(Vn!=="combobox")return Un;var Co=(Vo=Mn[0])===null||Vo===void 0?void 0:Vo.value;return typeof Co=="string"||typeof Co=="number"?String(Co):""},[Un,Vn,Mn]),ca=Vn==="combobox"&&typeof Yi=="function"&&Yi()||null,Po=typeof qn=="function"&&qn(),Ml=(0,et.x1)(_o,Po==null||(Sn=Po.props)===null||Sn===void 0?void 0:Sn.ref),fl=$t.useState(!1),Wo=(0,ge.Z)(fl,2),Or=Wo[0],ta=Wo[1];(0,Re.Z)(function(){ta(!0)},[]);var is=(0,Ie.Z)(!1,{defaultValue:Se,value:Ri}),Ra=(0,ge.Z)(is,2),Ys=Ra[0],yi=Ra[1],yo=Or?Ys:!1,vs=!we&&ln;(si||vs&&yo&&Vn==="combobox")&&(yo=!1);var Vr=vs?!1:yo,to=$t.useCallback(function(Vo){var Co=Vo!==void 0?Vo:!yo;si||(yi(Co),yo!==Co&&(on==null||on(Co)))},[si,yo,yi,on]),co=$t.useMemo(function(){return(di||[]).some(function(Vo){return[`
`,`\r
`].includes(Vo)})},[di]),rn=$t.useContext(qe)||{},Ni=rn.maxCount,io=rn.rawValues,Jo=function(Co,Bo,js){if(!(Bi&&Et(Ni)&&(io==null?void 0:io.size)>=Ni)){var Yr=!0,ls=Co;Rn==null||Rn(null);var ci=He(Co,di,Et(Ni)?Ni-io.size:void 0),_a=js?null:ci;return Vn!=="combobox"&&_a&&(ls="",ei==null||ei(_a),to(!1),Yr=!1),ai&&Gr!==ls&&ai(ls,{source:Bo?"typing":"effect"}),Yr}},fa=function(Co){!Co||!Co.trim()||ai(Co,{source:"submit"})};$t.useEffect(function(){!yo&&!Bi&&Vn!=="combobox"&&Jo("",!1,!1)},[yo]),$t.useEffect(function(){Ys&&si&&yi(!1),si&&!zr.current&&To(!1)},[si]);var ea=bt(),ji=(0,ge.Z)(ea,2),$r=ji[0],Ds=ji[1],ts=$t.useRef(!1),Os=function(Co){var Bo=$r(),js=Co.key,Yr=js==="Enter";if(Yr&&(Vn!=="combobox"&&Co.preventDefault(),yo||to(!0)),Ds(!!Gr),js==="Backspace"&&!Bo&&Bi&&!Gr&&Mn.length){for(var ls=(0,fe.Z)(Mn),ci=null,_a=ls.length-1;_a>=0;_a-=1){var qt=ls[_a];if(!qt.disabled){ls.splice(_a,1),ci=qt;break}}ci&&Hn(ls,{type:"remove",values:[ci]})}for(var Ue=arguments.length,Hl=new Array(Ue>1?Ue-1:0),yh=1;yh<Ue;yh++)Hl[yh-1]=arguments[yh];if(yo&&(!Yr||!ts.current)){var za;Yr&&(ts.current=!0),(za=Fo.current)===null||za===void 0||za.onKeyDown.apply(za,[Co].concat(Hl))}li==null||li.apply(void 0,[Co].concat(Hl))},El=function(Co){for(var Bo=arguments.length,js=new Array(Bo>1?Bo-1:0),Yr=1;Yr<Bo;Yr++)js[Yr-1]=arguments[Yr];if(yo){var ls;(ls=Fo.current)===null||ls===void 0||ls.onKeyUp.apply(ls,[Co].concat(js))}Co.key==="Enter"&&(ts.current=!1),Kn==null||Kn.apply(void 0,[Co].concat(js))},$a=function(Co){var Bo=Mn.filter(function(js){return js!==Co});Hn(Bo,{type:"remove",values:[Co]})},Hr=function(){ts.current=!1},ga=$t.useRef(!1),gh=function(){To(!0),si||(so&&!ga.current&&so.apply(void 0,arguments),Wi.includes("focus")&&to(!0)),ga.current=!0},Yd=function(){zr.current=!0,To(!1,function(){ga.current=!1,zr.current=!1,to(!1)}),!si&&(Gr&&(Vn==="tags"?ai(Gr,{source:"submit"}):Vn==="multiple"&&ai("",{source:"blur"})),bo&&bo.apply(void 0,arguments))},bl=[];$t.useEffect(function(){return function(){bl.forEach(function(Vo){return clearTimeout(Vo)}),bl.splice(0,bl.length)}},[]);var Zd=function(Co){var Bo,js=Co.target,Yr=(Bo=ko.current)===null||Bo===void 0?void 0:Bo.getPopupElement();if(Yr&&Yr.contains(js)){var ls=setTimeout(function(){var Ue=bl.indexOf(ls);if(Ue!==-1&&bl.splice(Ue,1),kl(),!ni&&!Yr.contains(document.activeElement)){var Hl;(Hl=Ko.current)===null||Hl===void 0||Hl.focus()}});bl.push(ls)}for(var ci=arguments.length,_a=new Array(ci>1?ci-1:0),qt=1;qt<ci;qt++)_a[qt-1]=arguments[qt];Ai==null||Ai.apply(void 0,[Co].concat(_a))},sd=$t.useState({}),ph=(0,ge.Z)(sd,2),Gl=ph[1];function ja(){Gl({})}var mh;Po&&(mh=function(Co){to(Co)}),Gt(function(){var Vo;return[Ho.current,(Vo=ko.current)===null||Vo===void 0?void 0:Vo.getPopupElement()]},Vr,to,!!Po);var ad=$t.useMemo(function(){return(0,Xe.Z)((0,Xe.Z)({},me),{},{notFoundContent:we,open:yo,triggerOpen:Vr,id:Wt,showSearch:Zo,multiple:Bi,toggleOpen:to})},[me,we,Vr,yo,Wt,Zo,Bi,to]),ld=!!Me||Fe,Fr;ld&&(Fr=$t.createElement(ct,{className:ae()("".concat(Ne,"-arrow"),(0,be.Z)({},"".concat(Ne,"-arrow-loading"),Fe)),customizeIcon:Me,customizeIconProps:{loading:Fe,searchValue:Gr,open:yo,focused:Ce,showSearch:Zo}}));var zc=function(){var Co;zn==null||zn(),(Co=Ko.current)===null||Co===void 0||Co.focus(),Hn([],{type:"clear",values:Mn}),Jo("",!1,!1)},ud=lt(Ne,zc,Mn,ke,En,si,Gr,Vn),vh=ud.allowClear,bu=ud.clearIcon,Is=$t.createElement($n,{ref:Fo}),Rs=ae()(Ne,an,(0,be.Z)((0,be.Z)((0,be.Z)((0,be.Z)((0,be.Z)((0,be.Z)((0,be.Z)((0,be.Z)((0,be.Z)((0,be.Z)({},"".concat(Ne,"-focused"),Ce),"".concat(Ne,"-multiple"),Bi),"".concat(Ne,"-single"),!Bi),"".concat(Ne,"-allow-clear"),ke),"".concat(Ne,"-show-arrow"),ld),"".concat(Ne,"-disabled"),si),"".concat(Ne,"-loading"),Fe),"".concat(Ne,"-open"),yo),"".concat(Ne,"-customize-input"),ca),"".concat(Ne,"-show-search"),Zo)),Ur=$t.createElement(wt,{ref:ko,disabled:si,prefixCls:Ne,visible:Vr,popupElement:Is,animation:ti,transitionName:mo,dropdownStyle:Ji,dropdownClassName:wi,direction:Zt,dropdownMatchSelectWidth:bi,dropdownRender:Vi,dropdownAlign:Ci,placement:kn,builtinPlacements:Bt,getPopupContainer:vo,empty:ln,getTriggerDOMNode:function(Co){return _o.current||Co},onPopupVisibleChange:mh,onPopupMouseEnter:ja},Po?$t.cloneElement(Po,{ref:Ml}):$t.createElement(Qn,(0,St.Z)({},me,{domRef:_o,prefixCls:Ne,inputElement:ca,ref:Ko,id:Wt,prefix:Di,showSearch:Zo,autoClearSearchValue:mi,mode:Vn,activeDescendantId:Bn,tagRender:Qt,values:Mn,open:yo,onToggleOpen:to,activeValue:bn,searchValue:Gr,onSearch:Jo,onSearchSubmit:fa,onRemove:$a,tokenWithEnter:co,onInputBlur:Hr}))),es;return Po?es=Ur:es=$t.createElement("div",(0,St.Z)({className:Rs},vi,{ref:Ho,onMouseDown:Zd,onKeyDown:Os,onKeyUp:El,onFocus:gh,onBlur:Yd}),$t.createElement(en,{visible:Ce&&!yo,values:Mn}),Ur,Fr,vh&&bu),$t.createElement(pt.Provider,{value:ad},es)}),Zi=fn,Pi=function(){return null};Pi.isSelectOptGroup=!0;var zi=Pi,Hi=function(){return null};Hi.isSelectOption=!0;var po=Hi,oo=Yt(80547),Fi=Yt(2738),Ki=Yt(45680);function hr(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Yo=["disabled","title","children","style","className"];function Ro(me){return typeof me=="string"||typeof me=="number"}var er=function(de,Sn){var Wt=vt(),Ne=Wt.prefixCls,an=Wt.id,ye=Wt.open,Qt=Wt.multiple,Zt=Wt.mode,De=Wt.searchValue,Mn=Wt.toggleOpen,Hn=Wt.notFoundContent,ln=Wt.onPopupScroll,Be=$t.useContext(qe),we=Be.maxCount,zn=Be.flattenOptions,Vn=Be.onActiveValue,si=Be.defaultActiveFirstOption,Fe=Be.onSelect,Yi=Be.menuItemSelectedIcon,qn=Be.rawValues,Ri=Be.fieldNames,Se=Be.virtual,on=Be.direction,bn=Be.listHeight,Rn=Be.listItemHeight,Bn=Be.optionRender,Un="".concat(Ne,"-item"),mi=(0,oo.Z)(function(){return zn},[ye,zn],function(Ui,Wi){return Wi[0]&&Ui[1]!==Wi[1]}),ai=$t.useRef(null),ei=$t.useMemo(function(){return Qt&&Et(we)&&(qn==null?void 0:qn.size)>=we},[Qt,we,qn==null?void 0:qn.size]),di=function(Wi){Wi.preventDefault()},ke=function(Wi){var so;(so=ai.current)===null||so===void 0||so.scrollTo(typeof Wi=="number"?{index:Wi}:Wi)},Di=$t.useCallback(function(Ui){return Zt==="combobox"?!1:qn.has(Ui)},[Zt,(0,fe.Z)(qn).toString(),qn.size]),Me=function(Wi){for(var so=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,bo=mi.length,Kn=0;Kn<bo;Kn+=1){var li=(Wi+Kn*so+bo)%bo,Ai=mi[li]||{},ki=Ai.group,Bi=Ai.data;if(!ki&&!(Bi!=null&&Bi.disabled)&&(Di(Bi.value)||!ei))return li}return-1},En=$t.useState(function(){return Me(0)}),$n=(0,ge.Z)(En,2),ti=$n[0],mo=$n[1],Ji=function(Wi){var so=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;mo(Wi);var bo={source:so?"keyboard":"mouse"},Kn=mi[Wi];if(!Kn){Vn(null,-1,bo);return}Vn(Kn.value,Wi,bo)};(0,$t.useEffect)(function(){Ji(si!==!1?Me(0):-1)},[mi.length,De]);var wi=$t.useCallback(function(Ui){return Zt==="combobox"?String(Ui).toLowerCase()===De.toLowerCase():qn.has(Ui)},[Zt,De,(0,fe.Z)(qn).toString(),qn.size]);(0,$t.useEffect)(function(){var Ui=setTimeout(function(){if(!Qt&&ye&&qn.size===1){var so=Array.from(qn)[0],bo=mi.findIndex(function(Kn){var li=Kn.data;return li.value===so});bo!==-1&&(Ji(bo),ke(bo))}});if(ye){var Wi;(Wi=ai.current)===null||Wi===void 0||Wi.scrollTo(void 0)}return function(){return clearTimeout(Ui)}},[ye,De]);var bi=function(Wi){Wi!==void 0&&Fe(Wi,{selected:!qn.has(Wi)}),Qt||Mn(!1)};if($t.useImperativeHandle(Sn,function(){return{onKeyDown:function(Wi){var so=Wi.which,bo=Wi.ctrlKey;switch(so){case jt.Z.N:case jt.Z.P:case jt.Z.UP:case jt.Z.DOWN:{var Kn=0;if(so===jt.Z.UP?Kn=-1:so===jt.Z.DOWN?Kn=1:hr()&&bo&&(so===jt.Z.N?Kn=1:so===jt.Z.P&&(Kn=-1)),Kn!==0){var li=Me(ti+Kn,Kn);ke(li),Ji(li,!0)}break}case jt.Z.TAB:case jt.Z.ENTER:{var Ai,ki=mi[ti];ki&&!(ki!=null&&(Ai=ki.data)!==null&&Ai!==void 0&&Ai.disabled)&&!ei?bi(ki.value):bi(void 0),ye&&Wi.preventDefault();break}case jt.Z.ESC:Mn(!1),ye&&Wi.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Wi){ke(Wi)}}}),mi.length===0)return $t.createElement("div",{role:"listbox",id:"".concat(an,"_list"),className:"".concat(Un,"-empty"),onMouseDown:di},Hn);var Vi=Object.keys(Ri).map(function(Ui){return Ri[Ui]}),Ci=function(Wi){return Wi.label};function kn(Ui,Wi){var so=Ui.group;return{role:so?"presentation":"option",id:"".concat(an,"_list_").concat(Wi)}}var Bt=function(Wi){var so=mi[Wi];if(!so)return null;var bo=so.data||{},Kn=bo.value,li=so.group,Ai=(0,ie.Z)(bo,!0),ki=Ci(so);return so?$t.createElement("div",(0,St.Z)({"aria-label":typeof ki=="string"&&!li?ki:null},Ai,{key:Wi},kn(so,Wi),{"aria-selected":wi(Kn)}),Kn):null},vo={role:"listbox",id:"".concat(an,"_list")};return $t.createElement($t.Fragment,null,Se&&$t.createElement("div",(0,St.Z)({},vo,{style:{height:0,width:0,overflow:"hidden"}}),Bt(ti-1),Bt(ti),Bt(ti+1)),$t.createElement(Ki.Z,{itemKey:"key",ref:ai,data:mi,height:bn,itemHeight:Rn,fullHeight:!1,onMouseDown:di,onScroll:ln,virtual:Se,direction:on,innerProps:Se?null:vo},function(Ui,Wi){var so=Ui.group,bo=Ui.groupOption,Kn=Ui.data,li=Ui.label,Ai=Ui.value,ki=Kn.key;if(so){var Bi,Zo=(Bi=Kn.title)!==null&&Bi!==void 0?Bi:Ro(li)?li.toString():void 0;return $t.createElement("div",{className:ae()(Un,"".concat(Un,"-group"),Kn.className),title:Zo},li!==void 0?li:ki)}var vi=Kn.disabled,fi=Kn.title,Qe=Kn.children,ni=Kn.style,no=Kn.className,Ho=(0,re.Z)(Kn,Yo),_o=(0,Fi.Z)(Ho,Vi),ko=Di(Ai),Ko=vi||!ko&&ei,Fo="".concat(Un,"-option"),zr=ae()(Un,Fo,no,(0,be.Z)((0,be.Z)((0,be.Z)((0,be.Z)({},"".concat(Fo,"-grouped"),bo),"".concat(Fo,"-active"),ti===Wi&&!Ko),"".concat(Fo,"-disabled"),Ko),"".concat(Fo,"-selected"),ko)),Dr=Ci(Ui),ms=!Yi||typeof Yi=="function"||ko,Ce=typeof Dr=="number"?Dr:Dr||Ai,To=Ro(Ce)?Ce.toString():void 0;return fi!==void 0&&(To=fi),$t.createElement("div",(0,St.Z)({},(0,ie.Z)(_o),Se?{}:kn(Ui,Wi),{"aria-selected":wi(Ai),className:zr,title:To,onMouseMove:function(){ti===Wi||Ko||Ji(Wi)},onClick:function(){Ko||bi(Ai)},style:ni}),$t.createElement("div",{className:"".concat(Fo,"-content")},typeof Bn=="function"?Bn(Ui,{index:Wi}):Ce),$t.isValidElement(Yi)||ko,ms&&$t.createElement(ct,{className:"".concat(Un,"-option-state"),customizeIcon:Yi,customizeIconProps:{value:Ai,disabled:Ko,isSelected:ko}},ko?"\u2713":null))}))},$o=$t.forwardRef(er),Sr=$o,Br=function(me,de){var Sn=$t.useRef({values:new Map,options:new Map}),Wt=$t.useMemo(function(){var an=Sn.current,ye=an.values,Qt=an.options,Zt=me.map(function(Hn){if(Hn.label===void 0){var ln;return(0,Xe.Z)((0,Xe.Z)({},Hn),{},{label:(ln=ye.get(Hn.value))===null||ln===void 0?void 0:ln.label})}return Hn}),De=new Map,Mn=new Map;return Zt.forEach(function(Hn){De.set(Hn.value,Hn),Mn.set(Hn.value,de.get(Hn.value)||Qt.get(Hn.value))}),Sn.current.values=De,Sn.current.options=Mn,Zt},[me,de]),Ne=$t.useCallback(function(an){return de.get(an)||Sn.current.options.get(an)},[de]);return[Wt,Ne]};function nr(me,de){return Ye(me).join("").toUpperCase().includes(de)}var zo=function(me,de,Sn,Wt,Ne){return $t.useMemo(function(){if(!Sn||Wt===!1)return me;var an=de.options,ye=de.label,Qt=de.value,Zt=[],De=typeof Wt=="function",Mn=Sn.toUpperCase(),Hn=De?Wt:function(Be,we){return Ne?nr(we[Ne],Mn):we[an]?nr(we[ye!=="children"?ye:"label"],Mn):nr(we[Qt],Mn)},ln=De?function(Be){return sn(Be)}:function(Be){return Be};return me.forEach(function(Be){if(Be[an]){var we=Hn(Sn,ln(Be));if(we)Zt.push(Be);else{var zn=Be[an].filter(function(Vn){return Hn(Sn,ln(Vn))});zn.length&&Zt.push((0,Xe.Z)((0,Xe.Z)({},Be),{},(0,be.Z)({},an,zn)))}return}Hn(Sn,ln(Be))&&Zt.push(Be)}),Zt},[me,Wt,Ne,Sn,de])},Xi=Yt(69582),ro=Yt(11592),Ct=["children","value"],Go=["children"];function lo(me){var de=me,Sn=de.key,Wt=de.props,Ne=Wt.children,an=Wt.value,ye=(0,re.Z)(Wt,Ct);return(0,Xe.Z)({key:Sn,value:an!==void 0?an:Sn,children:Ne},ye)}function jo(me){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,ro.Z)(me).map(function(Sn,Wt){if(!$t.isValidElement(Sn)||!Sn.type)return null;var Ne=Sn,an=Ne.type.isSelectOptGroup,ye=Ne.key,Qt=Ne.props,Zt=Qt.children,De=(0,re.Z)(Qt,Go);return de||!an?lo(Sn):(0,Xe.Z)((0,Xe.Z)({key:"__RC_SELECT_GRP__".concat(ye===null?Wt:ye,"__"),label:ye},De),{},{options:jo(Zt)})}).filter(function(Sn){return Sn})}var dr=function(de,Sn,Wt,Ne,an){return $t.useMemo(function(){var ye=de,Qt=!de;Qt&&(ye=jo(Sn));var Zt=new Map,De=new Map,Mn=function(Be,we,zn){zn&&typeof zn=="string"&&Be.set(we[zn],we)},Hn=function ln(Be){for(var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,zn=0;zn<Be.length;zn+=1){var Vn=Be[zn];!Vn[Wt.options]||we?(Zt.set(Vn[Wt.value],Vn),Mn(De,Vn,Wt.label),Mn(De,Vn,Ne),Mn(De,Vn,an)):ln(Vn[Wt.options],!0)}};return Hn(ye),{options:ye,valueOptions:Zt,labelOptions:De}},[de,Sn,Wt,Ne,an])},br=dr;function qr(me){var de=$t.useRef();de.current=me;var Sn=$t.useCallback(function(){return de.current.apply(de,arguments)},[]);return Sn}function ii(me){var de=me.mode,Sn=me.options,Wt=me.children,Ne=me.backfill,an=me.allowClear,ye=me.placeholder,Qt=me.getInputElement,Zt=me.showSearch,De=me.onSearch,Mn=me.defaultOpen,Hn=me.autoFocus,ln=me.labelInValue,Be=me.value,we=me.inputValue,zn=me.optionLabelProp,Vn=isMultiple(de),si=Zt!==void 0?Zt:Vn||de==="combobox",Fe=Sn||convertChildrenToData(Wt);if(warning(de!=="tags"||Fe.every(function(Se){return!Se.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),de==="tags"||de==="combobox"){var Yi=Fe.some(function(Se){return Se.options?Se.options.some(function(on){return typeof("value"in on?on.value:on.key)=="number"}):typeof("value"in Se?Se.value:Se.key)=="number"});warning(!Yi,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(de!=="combobox"||!zn,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(de==="combobox"||!Ne,"`backfill` only works with `combobox` mode."),warning(de==="combobox"||!Qt,"`getInputElement` only work with `combobox` mode."),noteOnce(de!=="combobox"||!Qt||!an||!ye,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),De&&!si&&de!=="combobox"&&de!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Mn||Hn,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Be!=null){var qn=toArray(Be);warning(!ln||qn.every(function(Se){return _typeof(Se)==="object"&&("key"in Se||"value"in Se)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Vn||Array.isArray(Be),"`value` should be array when `mode` is `multiple` or `tags`")}if(Wt){var Ri=null;toNodeArray(Wt).some(function(Se){if(!React.isValidElement(Se)||!Se.type)return!1;var on=Se,bn=on.type;if(bn.isSelectOption)return!1;if(bn.isSelectOptGroup){var Rn=toNodeArray(Se.props.children).every(function(Bn){return!React.isValidElement(Bn)||!Se.type||Bn.type.isSelectOption?!0:(Ri=Bn.type,!1)});return!Rn}return Ri=bn,!0}),Ri&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ri.displayName||Ri.name||Ri,"`.")),warning(we===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function In(me,de){if(me){var Sn=function Wt(Ne){for(var an=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ye=0;ye<Ne.length;ye++){var Qt=Ne[ye];if(Qt[de==null?void 0:de.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!an&&Array.isArray(Qt[de==null?void 0:de.options])&&Wt(Qt[de==null?void 0:de.options],!0))break}};Sn(me)}}var ve=null,he=["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"],oe=["inputValue"];function xn(me){return!me||(0,se.Z)(me)!=="object"}var Cn=$t.forwardRef(function(me,de){var Sn=me.id,Wt=me.mode,Ne=me.prefixCls,an=Ne===void 0?"rc-select":Ne,ye=me.backfill,Qt=me.fieldNames,Zt=me.inputValue,De=me.searchValue,Mn=me.onSearch,Hn=me.autoClearSearchValue,ln=Hn===void 0?!0:Hn,Be=me.onSelect,we=me.onDeselect,zn=me.dropdownMatchSelectWidth,Vn=zn===void 0?!0:zn,si=me.filterOption,Fe=me.filterSort,Yi=me.optionFilterProp,qn=me.optionLabelProp,Ri=me.options,Se=me.optionRender,on=me.children,bn=me.defaultActiveFirstOption,Rn=me.menuItemSelectedIcon,Bn=me.virtual,Un=me.direction,mi=me.listHeight,ai=mi===void 0?200:mi,ei=me.listItemHeight,di=ei===void 0?20:ei,ke=me.labelRender,Di=me.value,Me=me.defaultValue,En=me.labelInValue,$n=me.onChange,ti=me.maxCount,mo=(0,re.Z)(me,he),Ji=(0,Xi.ZP)(Sn),wi=_n(Wt),bi=!!(!Ri&&on),Vi=$t.useMemo(function(){return si===void 0&&Wt==="combobox"?!1:si},[si,Wt]),Ci=$t.useMemo(function(){return Pe(Qt,bi)},[JSON.stringify(Qt),bi]),kn=(0,Ie.Z)("",{value:De!==void 0?De:Zt,postState:function(co){return co||""}}),Bt=(0,ge.Z)(kn,2),vo=Bt[0],Ui=Bt[1],Wi=br(Ri,on,Ci,Yi,qn),so=Wi.valueOptions,bo=Wi.labelOptions,Kn=Wi.options,li=$t.useCallback(function(to){var co=Ye(to);return co.map(function(rn){var Ni,io,Jo,fa,ea;if(xn(rn))Ni=rn;else{var ji;Jo=rn.key,io=rn.label,Ni=(ji=rn.value)!==null&&ji!==void 0?ji:Jo}var $r=so.get(Ni);if($r){var Ds;if(io===void 0&&(io=$r==null?void 0:$r[qn||Ci.label]),Jo===void 0&&(Jo=(Ds=$r==null?void 0:$r.key)!==null&&Ds!==void 0?Ds:Ni),fa=$r==null?void 0:$r.disabled,ea=$r==null?void 0:$r.title,0)var ts}return{label:io,value:Ni,key:Jo,disabled:fa,title:ea}})},[Ci,qn,so]),Ai=(0,Ie.Z)(Me,{value:Di}),ki=(0,ge.Z)(Ai,2),Bi=ki[0],Zo=ki[1],vi=$t.useMemo(function(){var to,co=wi&&Bi===null?[]:Bi,rn=li(co);return Wt==="combobox"&&pi((to=rn[0])===null||to===void 0?void 0:to.value)?[]:rn},[Bi,li,Wt,wi]),fi=Br(vi,so),Qe=(0,ge.Z)(fi,2),ni=Qe[0],no=Qe[1],Ho=$t.useMemo(function(){if(!Wt&&ni.length===1){var to=ni[0];if(to.value===null&&(to.label===null||to.label===void 0))return[]}return ni.map(function(co){var rn;return(0,Xe.Z)((0,Xe.Z)({},co),{},{label:(rn=typeof ke=="function"?ke(co):co.label)!==null&&rn!==void 0?rn:co.value})})},[Wt,ni,ke]),_o=$t.useMemo(function(){return new Set(ni.map(function(to){return to.value}))},[ni]);$t.useEffect(function(){if(Wt==="combobox"){var to,co=(to=ni[0])===null||to===void 0?void 0:to.value;Ui(vn(co)?String(co):"")}},[ni]);var ko=qr(function(to,co){var rn=co!=null?co:to;return(0,be.Z)((0,be.Z)({},Ci.value,to),Ci.label,rn)}),Ko=$t.useMemo(function(){if(Wt!=="tags")return Kn;var to=(0,fe.Z)(Kn),co=function(Ni){return so.has(Ni)};return(0,fe.Z)(ni).sort(function(rn,Ni){return rn.value<Ni.value?-1:1}).forEach(function(rn){var Ni=rn.value;co(Ni)||to.push(ko(Ni,rn.label))}),to},[ko,Kn,so,ni,Wt]),Fo=zo(Ko,Ci,vo,Vi,Yi),zr=$t.useMemo(function(){return Wt!=="tags"||!vo||Fo.some(function(to){return to[Yi||"value"]===vo})||Fo.some(function(to){return to[Ci.value]===vo})?Fo:[ko(vo)].concat((0,fe.Z)(Fo))},[ko,Yi,Wt,Fo,vo,Ci]),Dr=function to(co){var rn=(0,fe.Z)(co).sort(function(Ni,io){return Fe(Ni,io,{searchValue:vo})});return rn.map(function(Ni){return Array.isArray(Ni.options)?(0,Xe.Z)((0,Xe.Z)({},Ni),{},{options:Ni.options.length>0?to(Ni.options):Ni.options}):Ni})},ms=$t.useMemo(function(){return Fe?Dr(zr):zr},[zr,Fe,vo]),Ce=$t.useMemo(function(){return Ee(ms,{fieldNames:Ci,childrenAsData:bi})},[ms,Ci,bi]),To=function(co){var rn=li(co);if(Zo(rn),$n&&(rn.length!==ni.length||rn.some(function(Jo,fa){var ea;return((ea=ni[fa])===null||ea===void 0?void 0:ea.value)!==(Jo==null?void 0:Jo.value)}))){var Ni=En?rn:rn.map(function(Jo){return Jo.value}),io=rn.map(function(Jo){return sn(no(Jo.value))});$n(wi?Ni:Ni[0],wi?io:io[0])}},kl=$t.useState(null),Gr=(0,ge.Z)(kl,2),ca=Gr[0],Po=Gr[1],Ml=$t.useState(0),fl=(0,ge.Z)(Ml,2),Wo=fl[0],Or=fl[1],ta=bn!==void 0?bn:Wt!=="combobox",is=$t.useCallback(function(to,co){var rn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ni=rn.source,io=Ni===void 0?"keyboard":Ni;Or(co),ye&&Wt==="combobox"&&to!==null&&io==="keyboard"&&Po(String(to))},[ye,Wt]),Ra=function(co,rn,Ni){var io=function(){var $a,Hr=no(co);return[En?{label:Hr==null?void 0:Hr[Ci.label],value:co,key:($a=Hr==null?void 0:Hr.key)!==null&&$a!==void 0?$a:co}:co,sn(Hr)]};if(rn&&Be){var Jo=io(),fa=(0,ge.Z)(Jo,2),ea=fa[0],ji=fa[1];Be(ea,ji)}else if(!rn&&we&&Ni!=="clear"){var $r=io(),Ds=(0,ge.Z)($r,2),ts=Ds[0],Os=Ds[1];we(ts,Os)}},Ys=qr(function(to,co){var rn,Ni=wi?co.selected:!0;Ni?rn=wi?[].concat((0,fe.Z)(ni),[to]):[to]:rn=ni.filter(function(io){return io.value!==to}),To(rn),Ra(to,Ni),Wt==="combobox"?Po(""):(!_n||ln)&&(Ui(""),Po(""))}),yi=function(co,rn){To(co);var Ni=rn.type,io=rn.values;(Ni==="remove"||Ni==="clear")&&io.forEach(function(Jo){Ra(Jo.value,!1,Ni)})},yo=function(co,rn){if(Ui(co),Po(null),rn.source==="submit"){var Ni=(co||"").trim();if(Ni){var io=Array.from(new Set([].concat((0,fe.Z)(_o),[Ni])));To(io),Ra(Ni,!0),Ui("")}return}rn.source!=="blur"&&(Wt==="combobox"&&To(co),Mn==null||Mn(co))},vs=function(co){var rn=co;Wt!=="tags"&&(rn=co.map(function(io){var Jo=bo.get(io);return Jo==null?void 0:Jo.value}).filter(function(io){return io!==void 0}));var Ni=Array.from(new Set([].concat((0,fe.Z)(_o),(0,fe.Z)(rn))));To(Ni),Ni.forEach(function(io){Ra(io,!0)})},Vr=$t.useMemo(function(){var to=Bn!==!1&&Vn!==!1;return(0,Xe.Z)((0,Xe.Z)({},Wi),{},{flattenOptions:Ce,onActiveValue:is,defaultActiveFirstOption:ta,onSelect:Ys,menuItemSelectedIcon:Rn,rawValues:_o,fieldNames:Ci,virtual:to,direction:Un,listHeight:ai,listItemHeight:di,childrenAsData:bi,maxCount:ti,optionRender:Se})},[ti,Wi,Ce,is,ta,Ys,Rn,_o,Ci,Bn,Vn,Un,ai,di,bi,Se]);return $t.createElement(qe.Provider,{value:Vr},$t.createElement(Zi,(0,St.Z)({},mo,{id:Ji,prefixCls:an,ref:de,omitDomProps:oe,mode:Wt,displayValues:Ho,onDisplayValuesChange:yi,direction:Un,searchValue:vo,onSearch:yo,autoClearSearchValue:ln,onSearchSplit:vs,dropdownMatchSelectWidth:Vn,OptionList:Sr,emptyOptions:!Ce.length,activeValue:ca,activeDescendantId:"".concat(Ji,"_list_").concat(Wo)})))}),Zn=Cn;Zn.Option=po,Zn.OptGroup=zi;var Ke=Zn,pn=Ke},63158:function(un,Gn,Yt){"use strict";var St=Yt(72308),fe=Yt(49618),be=Yt(52487),Xe=Yt(74416),ge=Yt(59301),re=Yt(92310),se=Yt.n(re),Ie=Yt(18929),Le=Yt(10228),$t=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Ze=ge.forwardRef(function(ae,Re){var Nt,et=ae.prefixCls,nt=et===void 0?"rc-switch":et,ct=ae.className,lt=ae.checked,pt=ae.defaultChecked,vt=ae.disabled,Lt=ae.loadingIcon,bt=ae.checkedChildren,Gt=ae.unCheckedChildren,jt=ae.onClick,ne=ae.onChange,ie=ae.onKeyDown,te=(0,Xe.Z)(ae,$t),Ge=(0,Ie.Z)(!1,{value:lt,defaultValue:pt}),pe=(0,be.Z)(Ge,2),Je=pe[0],Ye=pe[1];function hn(yn,ce){var Kt=Je;return vt||(Kt=yn,Ye(Kt),ne==null||ne(Kt,ce)),Kt}function Fn(yn){yn.which===Le.Z.LEFT?hn(!1,yn):yn.which===Le.Z.RIGHT&&hn(!0,yn),ie==null||ie(yn)}function vn(yn){var ce=hn(!Je,yn);jt==null||jt(ce,yn)}var pi=se()(nt,ct,(Nt={},(0,fe.Z)(Nt,"".concat(nt,"-checked"),Je),(0,fe.Z)(Nt,"".concat(nt,"-disabled"),vt),Nt));return ge.createElement("button",(0,St.Z)({},te,{type:"button",role:"switch","aria-checked":Je,disabled:vt,className:pi,ref:Re,onKeyDown:Fn,onClick:vn}),Lt,ge.createElement("span",{className:"".concat(nt,"-inner")},ge.createElement("span",{className:"".concat(nt,"-inner-checked")},bt),ge.createElement("span",{className:"".concat(nt,"-inner-unchecked")},Gt)))});Ze.displayName="Switch",Gn.Z=Ze},22711:function(un,Gn,Yt){"use strict";Yt.r(Gn),Yt.d(Gn,{ResizableTextArea:function(){return pe},default:function(){return Fn}});var St=Yt(72308),fe=Yt(49618),be=Yt(77321),Xe=Yt(80702),ge=Yt(52487),re=Yt(74416),se=Yt(92310),Ie=Yt.n(se),Le=Yt(36901),$t=Yt(66003),Ze=Yt(30292),ae=Yt(18929),Re=Yt(59301),Nt=Yt(62853),et=Yt(29301),nt=Yt(34280),ct=Yt(16089),lt=`
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;
`,pt=["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={},Lt;function bt(vn){var pi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,yn=vn.getAttribute("id")||vn.getAttribute("data-reactid")||vn.getAttribute("name");if(pi&&vt[yn])return vt[yn];var ce=window.getComputedStyle(vn),Kt=ce.getPropertyValue("box-sizing")||ce.getPropertyValue("-moz-box-sizing")||ce.getPropertyValue("-webkit-box-sizing"),tn=parseFloat(ce.getPropertyValue("padding-bottom"))+parseFloat(ce.getPropertyValue("padding-top")),Yn=parseFloat(ce.getPropertyValue("border-bottom-width"))+parseFloat(ce.getPropertyValue("border-top-width")),Dn=pt.map(function(gn){return"".concat(gn,":").concat(ce.getPropertyValue(gn))}).join(";"),je={sizingStyle:Dn,paddingSize:tn,borderSize:Yn,boxSizing:Kt};return pi&&yn&&(vt[yn]=je),je}function Gt(vn){var pi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,yn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ce=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Lt||(Lt=document.createElement("textarea"),Lt.setAttribute("tab-index","-1"),Lt.setAttribute("aria-hidden","true"),Lt.setAttribute("name","hiddenTextarea"),document.body.appendChild(Lt)),vn.getAttribute("wrap")?Lt.setAttribute("wrap",vn.getAttribute("wrap")):Lt.removeAttribute("wrap");var Kt=bt(vn,pi),tn=Kt.paddingSize,Yn=Kt.borderSize,Dn=Kt.boxSizing,je=Kt.sizingStyle;Lt.setAttribute("style","".concat(je,";").concat(lt)),Lt.value=vn.value||vn.placeholder||"";var gn=void 0,Tn=void 0,Jn,Pn=Lt.scrollHeight;if(Dn==="border-box"?Pn+=Yn:Dn==="content-box"&&(Pn-=tn),yn!==null||ce!==null){Lt.value=" ";var Qn=Lt.scrollHeight-tn;yn!==null&&(gn=Qn*yn,Dn==="border-box"&&(gn=gn+tn+Yn),Pn=Math.max(gn,Pn)),ce!==null&&(Tn=Qn*ce,Dn==="border-box"&&(Tn=Tn+tn+Yn),Jn=Pn>Tn?"":"hidden",Pn=Math.min(Tn,Pn))}var ee={height:Pn,overflowY:Jn,resize:"none"};return gn&&(ee.minHeight=gn),Tn&&(ee.maxHeight=Tn),ee}var jt=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],ne=0,ie=1,te=2,Ge=Re.forwardRef(function(vn,pi){var yn=vn,ce=yn.prefixCls,Kt=yn.defaultValue,tn=yn.value,Yn=yn.autoSize,Dn=yn.onResize,je=yn.className,gn=yn.style,Tn=yn.disabled,Jn=yn.onChange,Pn=yn.onInternalAutoSize,Qn=(0,re.Z)(yn,jt),ee=(0,ae.Z)(Kt,{value:tn,postState:function(Ki){return Ki!=null?Ki:""}}),jn=(0,ge.Z)(ee,2),hi=jn[0],Dt=jn[1],kt=function(Ki){Dt(Ki.target.value),Jn==null||Jn(Ki)},wt=Re.useRef();Re.useImperativeHandle(pi,function(){return{textArea:wt.current}});var At=Re.useMemo(function(){return Yn&&(0,Nt.Z)(Yn)==="object"?[Yn.minRows,Yn.maxRows]:[]},[Yn]),_t=(0,ge.Z)(At,2),Et=_t[0],Pe=_t[1],Ee=!!Yn,sn=function(){try{if(document.activeElement===wt.current){var Ki=wt.current,hr=Ki.selectionStart,Yo=Ki.selectionEnd,Ro=Ki.scrollTop;wt.current.setSelectionRange(hr,Yo),wt.current.scrollTop=Ro}}catch(er){}},He=Re.useState(te),Ae=(0,ge.Z)(He,2),qe=Ae[0],en=Ae[1],dn=Re.useState(),An=(0,ge.Z)(dn,2),_n=An[0],fn=An[1],Zi=function(){en(ne)};(0,nt.Z)(function(){Ee&&Zi()},[tn,Et,Pe,Ee]),(0,nt.Z)(function(){if(qe===ne)en(ie);else if(qe===ie){var Fi=Gt(wt.current,!1,Et,Pe);en(te),fn(Fi)}else sn()},[qe]);var Pi=Re.useRef(),zi=function(){ct.Z.cancel(Pi.current)},Hi=function(Ki){qe===te&&(Dn==null||Dn(Ki),Yn&&(zi(),Pi.current=(0,ct.Z)(function(){Zi()})))};Re.useEffect(function(){return zi},[]);var po=Ee?_n:null,oo=(0,be.Z)((0,be.Z)({},gn),po);return(qe===ne||qe===ie)&&(oo.overflowY="hidden",oo.overflowX="hidden"),Re.createElement(et.Z,{onResize:Hi,disabled:!(Yn||Dn)},Re.createElement("textarea",(0,St.Z)({},Qn,{ref:wt,style:oo,className:Ie()(ce,je,(0,fe.Z)({},"".concat(ce,"-disabled"),Tn)),disabled:Tn,value:hi,onChange:kt})))}),pe=Ge,Je=["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"],Ye=Re.forwardRef(function(vn,pi){var yn,ce=vn.defaultValue,Kt=vn.value,tn=vn.onFocus,Yn=vn.onBlur,Dn=vn.onChange,je=vn.allowClear,gn=vn.maxLength,Tn=vn.onCompositionStart,Jn=vn.onCompositionEnd,Pn=vn.suffix,Qn=vn.prefixCls,ee=Qn===void 0?"rc-textarea":Qn,jn=vn.showCount,hi=vn.count,Dt=vn.className,kt=vn.style,wt=vn.disabled,At=vn.hidden,_t=vn.classNames,Et=vn.styles,Pe=vn.onResize,Ee=vn.onClear,sn=vn.onPressEnter,He=vn.readOnly,Ae=vn.autoSize,qe=vn.onKeyDown,en=(0,re.Z)(vn,Je),dn=(0,ae.Z)(ce,{value:Kt,defaultValue:ce}),An=(0,ge.Z)(dn,2),_n=An[0],fn=An[1],Zi=_n==null?"":String(_n),Pi=Re.useState(!1),zi=(0,ge.Z)(Pi,2),Hi=zi[0],po=zi[1],oo=Re.useRef(!1),Fi=Re.useState(null),Ki=(0,ge.Z)(Fi,2),hr=Ki[0],Yo=Ki[1],Ro=(0,Re.useRef)(null),er=(0,Re.useRef)(null),$o=function(){var me;return(me=er.current)===null||me===void 0?void 0:me.textArea},Sr=function(){$o().focus()};(0,Re.useImperativeHandle)(pi,function(){var pn;return{resizableTextArea:er.current,focus:Sr,blur:function(){$o().blur()},nativeElement:((pn=Ro.current)===null||pn===void 0?void 0:pn.nativeElement)||$o()}}),(0,Re.useEffect)(function(){po(function(pn){return!wt&&pn})},[wt]);var Br=Re.useState(null),nr=(0,ge.Z)(Br,2),zo=nr[0],Xi=nr[1];Re.useEffect(function(){if(zo){var pn;(pn=$o()).setSelectionRange.apply(pn,(0,Xe.Z)(zo))}},[zo]);var ro=(0,$t.Z)(hi,jn),Ct=(yn=ro.max)!==null&&yn!==void 0?yn:gn,Go=Number(Ct)>0,lo=ro.strategy(Zi),jo=!!Ct&&lo>Ct,dr=function(me,de){var Sn=de;!oo.current&&ro.exceedFormatter&&ro.max&&ro.strategy(de)>ro.max&&(Sn=ro.exceedFormatter(de,{max:ro.max}),de!==Sn&&Xi([$o().selectionStart||0,$o().selectionEnd||0])),fn(Sn),(0,Ze.rJ)(me.currentTarget,me,Dn,Sn)},br=function(me){oo.current=!0,Tn==null||Tn(me)},qr=function(me){oo.current=!1,dr(me,me.currentTarget.value),Jn==null||Jn(me)},ii=function(me){dr(me,me.target.value)},In=function(me){me.key==="Enter"&&sn&&sn(me),qe==null||qe(me)},ve=function(me){po(!0),tn==null||tn(me)},he=function(me){po(!1),Yn==null||Yn(me)},oe=function(me){fn(""),Sr(),(0,Ze.rJ)($o(),me,Dn)},xn=Pn,Cn;ro.show&&(ro.showFormatter?Cn=ro.showFormatter({value:Zi,count:lo,maxLength:Ct}):Cn="".concat(lo).concat(Go?" / ".concat(Ct):""),xn=Re.createElement(Re.Fragment,null,xn,Re.createElement("span",{className:Ie()("".concat(ee,"-data-count"),_t==null?void 0:_t.count),style:Et==null?void 0:Et.count},Cn)));var Zn=function(me){var de;Pe==null||Pe(me),(de=$o())!==null&&de!==void 0&&de.style.height&&Yo(!0)},Ke=!Ae&&!jn&&!je;return Re.createElement(Le.BaseInput,{ref:Ro,value:Zi,allowClear:je,handleReset:oe,suffix:xn,prefixCls:ee,classNames:(0,be.Z)((0,be.Z)({},_t),{},{affixWrapper:Ie()(_t==null?void 0:_t.affixWrapper,(0,fe.Z)((0,fe.Z)({},"".concat(ee,"-show-count"),jn),"".concat(ee,"-textarea-allow-clear"),je))}),disabled:wt,focused:Hi,className:Ie()(Dt,jo&&"".concat(ee,"-out-of-range")),style:(0,be.Z)((0,be.Z)({},kt),hr&&!Ke?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Cn=="string"?Cn:void 0}},hidden:At,readOnly:He,onClear:Ee},Re.createElement(pe,(0,St.Z)({},en,{autoSize:Ae,maxLength:gn,onKeyDown:In,onChange:ii,onFocus:ve,onBlur:he,onCompositionStart:br,onCompositionEnd:qr,className:Ie()(_t==null?void 0:_t.textarea),style:(0,be.Z)((0,be.Z)({},Et==null?void 0:Et.textarea),{},{resize:kt==null?void 0:kt.resize}),disabled:wt,prefixCls:ee,onResize:Zn,ref:er,readOnly:He})))}),hn=Ye,Fn=hn},45680:function(un,Gn,Yt){"use strict";Yt.d(Gn,{Z:function(){return hi}});var St=Yt(72308),fe=Yt(62853),be=Yt(77321),Xe=Yt(49618),ge=Yt(52487),re=Yt(74416),se=Yt(92310),Ie=Yt.n(se),Le=Yt(29301),$t=Yt(70425),Ze=Yt(34280),ae=Yt(59301),Re=Yt(4676),Nt=ae.forwardRef(function(Dt,kt){var wt=Dt.height,At=Dt.offsetY,_t=Dt.offsetX,Et=Dt.children,Pe=Dt.prefixCls,Ee=Dt.onInnerResize,sn=Dt.innerProps,He=Dt.rtl,Ae=Dt.extra,qe={},en={display:"flex",flexDirection:"column"};return At!==void 0&&(qe={height:wt,position:"relative",overflow:"hidden"},en=(0,be.Z)((0,be.Z)({},en),{},(0,Xe.Z)((0,Xe.Z)((0,Xe.Z)((0,Xe.Z)((0,Xe.Z)({transform:"translateY(".concat(At,"px)")},He?"marginRight":"marginLeft",-_t),"position","absolute"),"left",0),"right",0),"top",0))),ae.createElement("div",{style:qe},ae.createElement(Le.Z,{onResize:function(An){var _n=An.offsetHeight;_n&&Ee&&Ee()}},ae.createElement("div",(0,St.Z)({style:en,className:Ie()((0,Xe.Z)({},"".concat(Pe,"-holder-inner"),Pe)),ref:kt},sn),Et,Ae)))});Nt.displayName="Filler";var et=Nt;function nt(Dt){var kt=Dt.children,wt=Dt.setRef,At=ae.useCallback(function(_t){wt(_t)},[]);return ae.cloneElement(kt,{ref:At})}function ct(Dt,kt,wt,At,_t,Et,Pe,Ee){var sn=Ee.getKey;return Dt.slice(kt,wt+1).map(function(He,Ae){var qe=kt+Ae,en=Pe(He,qe,{style:{width:At},offsetX:_t}),dn=sn(He);return ae.createElement(nt,{key:dn,setRef:function(_n){return Et(He,_n)}},en)})}function lt(Dt,kt,wt,At){var _t=wt-Dt,Et=kt-wt,Pe=Math.min(_t,Et)*2;if(At<=Pe){var Ee=Math.floor(At/2);return At%2?wt+Ee+1:wt-Ee}return _t>Et?wt-(At-Et):wt+(At-_t)}function pt(Dt,kt,wt){var At=Dt.length,_t=kt.length,Et,Pe;if(At===0&&_t===0)return null;At<_t?(Et=Dt,Pe=kt):(Et=kt,Pe=Dt);var Ee={__EMPTY_ITEM__:!0};function sn(An){return An!==void 0?wt(An):Ee}for(var He=null,Ae=Math.abs(At-_t)!==1,qe=0;qe<Pe.length;qe+=1){var en=sn(Et[qe]),dn=sn(Pe[qe]);if(en!==dn){He=qe,Ae=Ae||en!==sn(Pe[qe+1]);break}}return He===null?null:{index:He,multiple:Ae}}function vt(Dt,kt,wt){var At=ae.useState(Dt),_t=(0,ge.Z)(At,2),Et=_t[0],Pe=_t[1],Ee=ae.useState(null),sn=(0,ge.Z)(Ee,2),He=sn[0],Ae=sn[1];return ae.useEffect(function(){var qe=pt(Et||[],Dt||[],kt);(qe==null?void 0:qe.index)!==void 0&&(wt==null||wt(qe.index),Ae(Dt[qe.index])),Pe(Dt)},[Dt]),[He]}var Lt=Yt(16089),bt=(typeof navigator=="undefined"?"undefined":(0,fe.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Gt=bt,jt=function(Dt,kt,wt,At){var _t=(0,ae.useRef)(!1),Et=(0,ae.useRef)(null);function Pe(){clearTimeout(Et.current),_t.current=!0,Et.current=setTimeout(function(){_t.current=!1},50)}var Ee=(0,ae.useRef)({top:Dt,bottom:kt,left:wt,right:At});return Ee.current.top=Dt,Ee.current.bottom=kt,Ee.current.left=wt,Ee.current.right=At,function(sn,He){var Ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,qe=sn?He<0&&Ee.current.left||He>0&&Ee.current.right:He<0&&Ee.current.top||He>0&&Ee.current.bottom;return Ae&&qe?(clearTimeout(Et.current),_t.current=!1):(!qe||_t.current)&&Pe(),!_t.current&&qe}};function ne(Dt,kt,wt,At,_t,Et,Pe){var Ee=(0,ae.useRef)(0),sn=(0,ae.useRef)(null),He=(0,ae.useRef)(null),Ae=(0,ae.useRef)(!1),qe=jt(kt,wt,At,_t);function en(Pi,zi){if(Lt.Z.cancel(sn.current),!qe(!1,zi)){var Hi=Pi;if(!Hi._virtualHandled)Hi._virtualHandled=!0;else return;Ee.current+=zi,He.current=zi,Gt||Hi.preventDefault(),sn.current=(0,Lt.Z)(function(){var po=Ae.current?10:1;Pe(Ee.current*po,!1),Ee.current=0})}}function dn(Pi,zi){Pe(zi,!0),Gt||Pi.preventDefault()}var An=(0,ae.useRef)(null),_n=(0,ae.useRef)(null);function fn(Pi){if(Dt){Lt.Z.cancel(_n.current),_n.current=(0,Lt.Z)(function(){An.current=null},2);var zi=Pi.deltaX,Hi=Pi.deltaY,po=Pi.shiftKey,oo=zi,Fi=Hi;(An.current==="sx"||!An.current&&po&&Hi&&!zi)&&(oo=Hi,Fi=0,An.current="sx");var Ki=Math.abs(oo),hr=Math.abs(Fi);An.current===null&&(An.current=Et&&Ki>hr?"x":"y"),An.current==="y"?en(Pi,Fi):dn(Pi,oo)}}function Zi(Pi){Dt&&(Ae.current=Pi.detail===He.current)}return[fn,Zi]}function ie(Dt,kt,wt,At){var _t=ae.useMemo(function(){return[new Map,[]]},[Dt,wt.id,At]),Et=(0,ge.Z)(_t,2),Pe=Et[0],Ee=Et[1],sn=function(Ae){var qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ae,en=Pe.get(Ae),dn=Pe.get(qe);if(en===void 0||dn===void 0)for(var An=Dt.length,_n=Ee.length;_n<An;_n+=1){var fn,Zi=Dt[_n],Pi=kt(Zi);Pe.set(Pi,_n);var zi=(fn=wt.get(Pi))!==null&&fn!==void 0?fn:At;if(Ee[_n]=(Ee[_n-1]||0)+zi,Pi===Ae&&(en=_n),Pi===qe&&(dn=_n),en!==void 0&&dn!==void 0)break}return{top:Ee[en-1]||0,bottom:Ee[dn]}};return sn}var te=Yt(96949),Ge=Yt(55090),pe=function(){function Dt(){(0,te.Z)(this,Dt),(0,Xe.Z)(this,"maps",void 0),(0,Xe.Z)(this,"id",0),(0,Xe.Z)(this,"diffKeys",new Set),this.maps=Object.create(null)}return(0,Ge.Z)(Dt,[{key:"set",value:function(wt,At){this.maps[wt]=At,this.id+=1,this.diffKeys.add(wt)}},{key:"get",value:function(wt){return this.maps[wt]}},{key:"resetRecord",value:function(){this.diffKeys.clear()}},{key:"getRecord",value:function(){return this.diffKeys}}]),Dt}(),Je=pe;function Ye(Dt){var kt=parseFloat(Dt);return isNaN(kt)?0:kt}function hn(Dt,kt,wt){var At=ae.useState(0),_t=(0,ge.Z)(At,2),Et=_t[0],Pe=_t[1],Ee=(0,ae.useRef)(new Map),sn=(0,ae.useRef)(new Je),He=(0,ae.useRef)(0);function Ae(){He.current+=1}function qe(){var dn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Ae();var An=function(){var Zi=!1;Ee.current.forEach(function(Pi,zi){if(Pi&&Pi.offsetParent){var Hi=Pi.offsetHeight,po=getComputedStyle(Pi),oo=po.marginTop,Fi=po.marginBottom,Ki=Ye(oo),hr=Ye(Fi),Yo=Hi+Ki+hr;sn.current.get(zi)!==Yo&&(sn.current.set(zi,Yo),Zi=!0)}}),Zi&&Pe(function(Pi){return Pi+1})};if(dn)An();else{He.current+=1;var _n=He.current;Promise.resolve().then(function(){_n===He.current&&An()})}}function en(dn,An){var _n=Dt(dn),fn=Ee.current.get(_n);An?(Ee.current.set(_n,An),qe()):Ee.current.delete(_n),!fn!=!An&&(An?kt==null||kt(dn):wt==null||wt(dn))}return(0,ae.useEffect)(function(){return Ae},[]),[en,qe,sn.current,Et]}var Fn=14/15;function vn(Dt,kt,wt){var At=(0,ae.useRef)(!1),_t=(0,ae.useRef)(0),Et=(0,ae.useRef)(0),Pe=(0,ae.useRef)(null),Ee=(0,ae.useRef)(null),sn,He=function(dn){if(At.current){var An=Math.ceil(dn.touches[0].pageX),_n=Math.ceil(dn.touches[0].pageY),fn=_t.current-An,Zi=Et.current-_n,Pi=Math.abs(fn)>Math.abs(Zi);Pi?_t.current=An:Et.current=_n;var zi=wt(Pi,Pi?fn:Zi,!1,dn);zi&&dn.preventDefault(),clearInterval(Ee.current),zi&&(Ee.current=setInterval(function(){Pi?fn*=Fn:Zi*=Fn;var Hi=Math.floor(Pi?fn:Zi);(!wt(Pi,Hi,!0)||Math.abs(Hi)<=.1)&&clearInterval(Ee.current)},16))}},Ae=function(){At.current=!1,sn()},qe=function(dn){sn(),dn.touches.length===1&&!At.current&&(At.current=!0,_t.current=Math.ceil(dn.touches[0].pageX),Et.current=Math.ceil(dn.touches[0].pageY),Pe.current=dn.target,Pe.current.addEventListener("touchmove",He,{passive:!1}),Pe.current.addEventListener("touchend",Ae,{passive:!0}))};sn=function(){Pe.current&&(Pe.current.removeEventListener("touchmove",He),Pe.current.removeEventListener("touchend",Ae))},(0,Ze.Z)(function(){return Dt&&kt.current.addEventListener("touchstart",qe,{passive:!0}),function(){var en;(en=kt.current)===null||en===void 0||en.removeEventListener("touchstart",qe),sn(),clearInterval(Ee.current)}},[Dt])}function pi(Dt){return Math.floor(Math.pow(Dt,.5))}function yn(Dt,kt){var wt="touches"in Dt?Dt.touches[0]:Dt;return wt[kt?"pageX":"pageY"]-window[kt?"scrollX":"scrollY"]}function ce(Dt,kt,wt){ae.useEffect(function(){var At=kt.current;if(Dt&&At){var _t=!1,Et,Pe,Ee=function(){Lt.Z.cancel(Et)},sn=function en(){Ee(),Et=(0,Lt.Z)(function(){wt(Pe),en()})},He=function(dn){if(!(dn.target.draggable||dn.button!==0)){var An=dn;An._virtualHandled||(An._virtualHandled=!0,_t=!0)}},Ae=function(){_t=!1,Ee()},qe=function(dn){if(_t){var An=yn(dn,!1),_n=At.getBoundingClientRect(),fn=_n.top,Zi=_n.bottom;if(An<=fn){var Pi=fn-An;Pe=-pi(Pi),sn()}else if(An>=Zi){var zi=An-Zi;Pe=pi(zi),sn()}else Ee()}};return At.addEventListener("mousedown",He),At.ownerDocument.addEventListener("mouseup",Ae),At.ownerDocument.addEventListener("mousemove",qe),function(){At.removeEventListener("mousedown",He),At.ownerDocument.removeEventListener("mouseup",Ae),At.ownerDocument.removeEventListener("mousemove",qe),Ee()}}},[Dt])}var Kt=10;function tn(Dt,kt,wt,At,_t,Et,Pe,Ee){var sn=ae.useRef(),He=ae.useState(null),Ae=(0,ge.Z)(He,2),qe=Ae[0],en=Ae[1];return(0,Ze.Z)(function(){if(qe&&qe.times<Kt){if(!Dt.current){en(function(ro){return(0,be.Z)({},ro)});return}Et();var dn=qe.targetAlign,An=qe.originAlign,_n=qe.index,fn=qe.offset,Zi=Dt.current.clientHeight,Pi=!1,zi=dn,Hi=null;if(Zi){for(var po=dn||An,oo=0,Fi=0,Ki=0,hr=Math.min(kt.length-1,_n),Yo=0;Yo<=hr;Yo+=1){var Ro=_t(kt[Yo]);Fi=oo;var er=wt.get(Ro);Ki=Fi+(er===void 0?At:er),oo=Ki}for(var $o=po==="top"?fn:Zi-fn,Sr=hr;Sr>=0;Sr-=1){var Br=_t(kt[Sr]),nr=wt.get(Br);if(nr===void 0){Pi=!0;break}if($o-=nr,$o<=0)break}switch(po){case"top":Hi=Fi-fn;break;case"bottom":Hi=Ki-Zi+fn;break;default:{var zo=Dt.current.scrollTop,Xi=zo+Zi;Fi<zo?zi="top":Ki>Xi&&(zi="bottom")}}Hi!==null&&Pe(Hi),Hi!==qe.lastTop&&(Pi=!0)}Pi&&en((0,be.Z)((0,be.Z)({},qe),{},{times:qe.times+1,targetAlign:zi,lastTop:Hi}))}},[qe,Dt.current]),function(dn){if(dn==null){Ee();return}if(Lt.Z.cancel(sn.current),typeof dn=="number")Pe(dn);else if(dn&&(0,fe.Z)(dn)==="object"){var An,_n=dn.align;"index"in dn?An=dn.index:An=kt.findIndex(function(Pi){return _t(Pi)===dn.key});var fn=dn.offset,Zi=fn===void 0?0:fn;en({times:0,index:An,offset:Zi,originAlign:_n})}}}var Yn=ae.forwardRef(function(Dt,kt){var wt=Dt.prefixCls,At=Dt.rtl,_t=Dt.scrollOffset,Et=Dt.scrollRange,Pe=Dt.onStartMove,Ee=Dt.onStopMove,sn=Dt.onScroll,He=Dt.horizontal,Ae=Dt.spinSize,qe=Dt.containerSize,en=Dt.style,dn=Dt.thumbStyle,An=Dt.showScrollBar,_n=ae.useState(!1),fn=(0,ge.Z)(_n,2),Zi=fn[0],Pi=fn[1],zi=ae.useState(null),Hi=(0,ge.Z)(zi,2),po=Hi[0],oo=Hi[1],Fi=ae.useState(null),Ki=(0,ge.Z)(Fi,2),hr=Ki[0],Yo=Ki[1],Ro=!At,er=ae.useRef(),$o=ae.useRef(),Sr=ae.useState(An),Br=(0,ge.Z)(Sr,2),nr=Br[0],zo=Br[1],Xi=ae.useRef(),ro=function(){An===!0||An===!1||(clearTimeout(Xi.current),zo(!0),Xi.current=setTimeout(function(){zo(!1)},3e3))},Ct=Et-qe||0,Go=qe-Ae||0,lo=ae.useMemo(function(){if(_t===0||Ct===0)return 0;var oe=_t/Ct;return oe*Go},[_t,Ct,Go]),jo=function(xn){xn.stopPropagation(),xn.preventDefault()},dr=ae.useRef({top:lo,dragging:Zi,pageY:po,startTop:hr});dr.current={top:lo,dragging:Zi,pageY:po,startTop:hr};var br=function(xn){Pi(!0),oo(yn(xn,He)),Yo(dr.current.top),Pe(),xn.stopPropagation(),xn.preventDefault()};ae.useEffect(function(){var oe=function(Ke){Ke.preventDefault()},xn=er.current,Cn=$o.current;return xn.addEventListener("touchstart",oe,{passive:!1}),Cn.addEventListener("touchstart",br,{passive:!1}),function(){xn.removeEventListener("touchstart",oe),Cn.removeEventListener("touchstart",br)}},[]);var qr=ae.useRef();qr.current=Ct;var ii=ae.useRef();ii.current=Go,ae.useEffect(function(){if(Zi){var oe,xn=function(Ke){var pn=dr.current,me=pn.dragging,de=pn.pageY,Sn=pn.startTop;Lt.Z.cancel(oe);var Wt=er.current.getBoundingClientRect(),Ne=qe/(He?Wt.width:Wt.height);if(me){var an=(yn(Ke,He)-de)*Ne,ye=Sn;!Ro&&He?ye-=an:ye+=an;var Qt=qr.current,Zt=ii.current,De=Zt?ye/Zt:0,Mn=Math.ceil(De*Qt);Mn=Math.max(Mn,0),Mn=Math.min(Mn,Qt),oe=(0,Lt.Z)(function(){sn(Mn,He)})}},Cn=function(){Pi(!1),Ee()};return window.addEventListener("mousemove",xn,{passive:!0}),window.addEventListener("touchmove",xn,{passive:!0}),window.addEventListener("mouseup",Cn,{passive:!0}),window.addEventListener("touchend",Cn,{passive:!0}),function(){window.removeEventListener("mousemove",xn),window.removeEventListener("touchmove",xn),window.removeEventListener("mouseup",Cn),window.removeEventListener("touchend",Cn),Lt.Z.cancel(oe)}}},[Zi]),ae.useEffect(function(){return ro(),function(){clearTimeout(Xi.current)}},[_t]),ae.useImperativeHandle(kt,function(){return{delayHidden:ro}});var In="".concat(wt,"-scrollbar"),ve={position:"absolute",visibility:nr?null:"hidden"},he={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return He?(ve.height=8,ve.left=0,ve.right=0,ve.bottom=0,he.height="100%",he.width=Ae,Ro?he.left=lo:he.right=lo):(ve.width=8,ve.top=0,ve.bottom=0,Ro?ve.right=0:ve.left=0,he.width="100%",he.height=Ae,he.top=lo),ae.createElement("div",{ref:er,className:Ie()(In,(0,Xe.Z)((0,Xe.Z)((0,Xe.Z)({},"".concat(In,"-horizontal"),He),"".concat(In,"-vertical"),!He),"".concat(In,"-visible"),nr)),style:(0,be.Z)((0,be.Z)({},ve),en),onMouseDown:jo,onMouseMove:ro},ae.createElement("div",{ref:$o,className:Ie()("".concat(In,"-thumb"),(0,Xe.Z)({},"".concat(In,"-thumb-moving"),Zi)),style:(0,be.Z)((0,be.Z)({},he),dn),onMouseDown:br}))}),Dn=Yn,je=20;function gn(){var Dt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,kt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,wt=Dt/kt*Dt;return isNaN(wt)&&(wt=0),wt=Math.max(wt,je),Math.floor(wt)}var Tn=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],Jn=[],Pn={overflowY:"auto",overflowAnchor:"none"};function Qn(Dt,kt){var wt=Dt.prefixCls,At=wt===void 0?"rc-virtual-list":wt,_t=Dt.className,Et=Dt.height,Pe=Dt.itemHeight,Ee=Dt.fullHeight,sn=Ee===void 0?!0:Ee,He=Dt.style,Ae=Dt.data,qe=Dt.children,en=Dt.itemKey,dn=Dt.virtual,An=Dt.direction,_n=Dt.scrollWidth,fn=Dt.component,Zi=fn===void 0?"div":fn,Pi=Dt.onScroll,zi=Dt.onVirtualScroll,Hi=Dt.onVisibleChange,po=Dt.innerProps,oo=Dt.extraRender,Fi=Dt.styles,Ki=Dt.showScrollBar,hr=Ki===void 0?"optional":Ki,Yo=(0,re.Z)(Dt,Tn),Ro=ae.useCallback(function(Kn){return typeof en=="function"?en(Kn):Kn==null?void 0:Kn[en]},[en]),er=hn(Ro,null,null),$o=(0,ge.Z)(er,4),Sr=$o[0],Br=$o[1],nr=$o[2],zo=$o[3],Xi=!!(dn!==!1&&Et&&Pe),ro=ae.useMemo(function(){return Object.values(nr.maps).reduce(function(Kn,li){return Kn+li},0)},[nr.id,nr.maps]),Ct=Xi&&Ae&&(Math.max(Pe*Ae.length,ro)>Et||!!_n),Go=An==="rtl",lo=Ie()(At,(0,Xe.Z)({},"".concat(At,"-rtl"),Go),_t),jo=Ae||Jn,dr=(0,ae.useRef)(),br=(0,ae.useRef)(),qr=(0,ae.useRef)(),ii=(0,ae.useState)(0),In=(0,ge.Z)(ii,2),ve=In[0],he=In[1],oe=(0,ae.useState)(0),xn=(0,ge.Z)(oe,2),Cn=xn[0],Zn=xn[1],Ke=(0,ae.useState)(!1),pn=(0,ge.Z)(Ke,2),me=pn[0],de=pn[1],Sn=function(){de(!0)},Wt=function(){de(!1)},Ne={getKey:Ro};function an(Kn){he(function(li){var Ai;typeof Kn=="function"?Ai=Kn(li):Ai=Kn;var ki=Un(Ai);return dr.current.scrollTop=ki,ki})}var ye=(0,ae.useRef)({start:0,end:jo.length}),Qt=(0,ae.useRef)(),Zt=vt(jo,Ro),De=(0,ge.Z)(Zt,1),Mn=De[0];Qt.current=Mn;var Hn=ae.useMemo(function(){if(!Xi)return{scrollHeight:void 0,start:0,end:jo.length-1,offset:void 0};if(!Ct){var Kn;return{scrollHeight:((Kn=br.current)===null||Kn===void 0?void 0:Kn.offsetHeight)||0,start:0,end:jo.length-1,offset:void 0}}for(var li=0,Ai,ki,Bi,Zo=jo.length,vi=0;vi<Zo;vi+=1){var fi=jo[vi],Qe=Ro(fi),ni=nr.get(Qe),no=li+(ni===void 0?Pe:ni);no>=ve&&Ai===void 0&&(Ai=vi,ki=li),no>ve+Et&&Bi===void 0&&(Bi=vi),li=no}return Ai===void 0&&(Ai=0,ki=0,Bi=Math.ceil(Et/Pe)),Bi===void 0&&(Bi=jo.length-1),Bi=Math.min(Bi+1,jo.length-1),{scrollHeight:li,start:Ai,end:Bi,offset:ki}},[Ct,Xi,ve,jo,zo,Et]),ln=Hn.scrollHeight,Be=Hn.start,we=Hn.end,zn=Hn.offset;ye.current.start=Be,ye.current.end=we,ae.useLayoutEffect(function(){var Kn=nr.getRecord();if(Kn.size===1){var li=Array.from(Kn)[0],Ai=jo[Be];if(Ai){var ki=Ro(Ai);if(ki===li){var Bi=nr.get(li),Zo=Bi-Pe;an(function(vi){return vi+Zo})}}}nr.resetRecord()},[ln]);var Vn=ae.useState({width:0,height:Et}),si=(0,ge.Z)(Vn,2),Fe=si[0],Yi=si[1],qn=function(li){Yi({width:li.offsetWidth,height:li.offsetHeight})},Ri=(0,ae.useRef)(),Se=(0,ae.useRef)(),on=ae.useMemo(function(){return gn(Fe.width,_n)},[Fe.width,_n]),bn=ae.useMemo(function(){return gn(Fe.height,ln)},[Fe.height,ln]),Rn=ln-Et,Bn=(0,ae.useRef)(Rn);Bn.current=Rn;function Un(Kn){var li=Kn;return Number.isNaN(Bn.current)||(li=Math.min(li,Bn.current)),li=Math.max(li,0),li}var mi=ve<=0,ai=ve>=Rn,ei=Cn<=0,di=Cn>=_n,ke=jt(mi,ai,ei,di),Di=function(){return{x:Go?-Cn:Cn,y:ve}},Me=(0,ae.useRef)(Di()),En=(0,$t.zX)(function(Kn){if(zi){var li=(0,be.Z)((0,be.Z)({},Di()),Kn);(Me.current.x!==li.x||Me.current.y!==li.y)&&(zi(li),Me.current=li)}});function $n(Kn,li){var Ai=Kn;li?((0,Re.flushSync)(function(){Zn(Ai)}),En()):an(Ai)}function ti(Kn){var li=Kn.currentTarget.scrollTop;li!==ve&&an(li),Pi==null||Pi(Kn),En()}var mo=function(li){var Ai=li,ki=_n?_n-Fe.width:0;return Ai=Math.max(Ai,0),Ai=Math.min(Ai,ki),Ai},Ji=(0,$t.zX)(function(Kn,li){li?((0,Re.flushSync)(function(){Zn(function(Ai){var ki=Ai+(Go?-Kn:Kn);return mo(ki)})}),En()):an(function(Ai){var ki=Ai+Kn;return ki})}),wi=ne(Xi,mi,ai,ei,di,!!_n,Ji),bi=(0,ge.Z)(wi,2),Vi=bi[0],Ci=bi[1];vn(Xi,dr,function(Kn,li,Ai,ki){var Bi=ki;return ke(Kn,li,Ai)?!1:!Bi||!Bi._virtualHandled?(Bi&&(Bi._virtualHandled=!0),Vi({preventDefault:function(){},deltaX:Kn?li:0,deltaY:Kn?0:li}),!0):!1}),ce(Ct,dr,function(Kn){an(function(li){return li+Kn})}),(0,Ze.Z)(function(){function Kn(Ai){var ki=mi&&Ai.detail<0,Bi=ai&&Ai.detail>0;Xi&&!ki&&!Bi&&Ai.preventDefault()}var li=dr.current;return li.addEventListener("wheel",Vi,{passive:!1}),li.addEventListener("DOMMouseScroll",Ci,{passive:!0}),li.addEventListener("MozMousePixelScroll",Kn,{passive:!1}),function(){li.removeEventListener("wheel",Vi),li.removeEventListener("DOMMouseScroll",Ci),li.removeEventListener("MozMousePixelScroll",Kn)}},[Xi,mi,ai]),(0,Ze.Z)(function(){if(_n){var Kn=mo(Cn);Zn(Kn),En({x:Kn})}},[Fe.width,_n]);var kn=function(){var li,Ai;(li=Ri.current)===null||li===void 0||li.delayHidden(),(Ai=Se.current)===null||Ai===void 0||Ai.delayHidden()},Bt=tn(dr,jo,nr,Pe,Ro,function(){return Br(!0)},an,kn);ae.useImperativeHandle(kt,function(){return{nativeElement:qr.current,getScrollInfo:Di,scrollTo:function(li){function Ai(ki){return ki&&(0,fe.Z)(ki)==="object"&&("left"in ki||"top"in ki)}Ai(li)?(li.left!==void 0&&Zn(mo(li.left)),Bt(li.top)):Bt(li)}}}),(0,Ze.Z)(function(){if(Hi){var Kn=jo.slice(Be,we+1);Hi(Kn,jo)}},[Be,we,jo]);var vo=ie(jo,Ro,nr,Pe),Ui=oo==null?void 0:oo({start:Be,end:we,virtual:Ct,offsetX:Cn,offsetY:zn,rtl:Go,getSize:vo}),Wi=ct(jo,Be,we,_n,Cn,Sr,qe,Ne),so=null;Et&&(so=(0,be.Z)((0,Xe.Z)({},sn?"height":"maxHeight",Et),Pn),Xi&&(so.overflowY="hidden",_n&&(so.overflowX="hidden"),me&&(so.pointerEvents="none")));var bo={};return Go&&(bo.dir="rtl"),ae.createElement("div",(0,St.Z)({ref:qr,style:(0,be.Z)((0,be.Z)({},He),{},{position:"relative"}),className:lo},bo,Yo),ae.createElement(Le.Z,{onResize:qn},ae.createElement(Zi,{className:"".concat(At,"-holder"),style:so,ref:dr,onScroll:ti,onMouseEnter:kn},ae.createElement(et,{prefixCls:At,height:ln,offsetX:Cn,offsetY:zn,scrollWidth:_n,onInnerResize:Br,ref:br,innerProps:po,rtl:Go,extra:Ui},Wi))),Ct&&ln>Et&&ae.createElement(Dn,{ref:Ri,prefixCls:At,scrollOffset:ve,scrollRange:ln,rtl:Go,onScroll:$n,onStartMove:Sn,onStopMove:Wt,spinSize:bn,containerSize:Fe.height,style:Fi==null?void 0:Fi.verticalScrollBar,thumbStyle:Fi==null?void 0:Fi.verticalScrollBarThumb,showScrollBar:hr}),Ct&&_n>Fe.width&&ae.createElement(Dn,{ref:Se,prefixCls:At,scrollOffset:Cn,scrollRange:_n,rtl:Go,onScroll:$n,onStartMove:Sn,onStopMove:Wt,spinSize:on,containerSize:Fe.width,horizontal:!0,style:Fi==null?void 0:Fi.horizontalScrollBar,thumbStyle:Fi==null?void 0:Fi.horizontalScrollBarThumb,showScrollBar:hr}))}var ee=ae.forwardRef(Qn);ee.displayName="List";var jn=ee,hi=jn},51581:function(un,Gn,Yt){"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});var St=function(){function ae(Re,Nt){for(var et=0;et<Nt.length;et++){var nt=Nt[et];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(Re,nt.key,nt)}}return function(Re,Nt,et){return Nt&&ae(Re.prototype,Nt),et&&ae(Re,et),Re}}(),fe=Yt(59301),be=re(fe),Xe=Yt(12708),ge=re(Xe);function re(ae){return ae&&ae.__esModule?ae:{default:ae}}function se(ae,Re){var Nt={};for(var et in ae)Re.indexOf(et)>=0||Object.prototype.hasOwnProperty.call(ae,et)&&(Nt[et]=ae[et]);return Nt}function Ie(ae,Re){if(!(ae instanceof Re))throw new TypeError("Cannot call a class as a function")}function Le(ae,Re){if(!ae)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Re&&(typeof Re=="object"||typeof Re=="function")?Re:ae}function $t(ae,Re){if(typeof Re!="function"&&Re!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Re);ae.prototype=Object.create(Re&&Re.prototype,{constructor:{value:ae,enumerable:!1,writable:!0,configurable:!0}}),Re&&(Object.setPrototypeOf?Object.setPrototypeOf(ae,Re):ae.__proto__=Re)}var Ze=function(ae){$t(Re,ae);function Re(Nt){Ie(this,Re);var et=Le(this,(Re.__proto__||Object.getPrototypeOf(Re)).call(this,Nt));return et.scrollListener=et.scrollListener.bind(et),et.eventListenerOptions=et.eventListenerOptions.bind(et),et.mousewheelListener=et.mousewheelListener.bind(et),et}return St(Re,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var et=this.getParentElement(this.scrollComponent);et.scrollTop=et.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var et=!1,nt={get passive(){et=!0}};try{document.addEventListener("test",null,nt),document.removeEventListener("test",null,nt)}catch(ct){}return et}},{key:"eventListenerOptions",value:function(){var et=this.props.useCapture;return this.isPassiveSupported()&&(et={useCapture:this.props.useCapture,passive:!0}),et}},{key:"setDefaultLoader",value:function(et){this.defaultLoader=et}},{key:"detachMousewheelListener",value:function(){var et=window;this.props.useWindow===!1&&(et=this.scrollComponent.parentNode),et.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var et=window;this.props.useWindow===!1&&(et=this.getParentElement(this.scrollComponent)),et.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),et.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(et){var nt=this.props.getScrollParent&&this.props.getScrollParent();return nt!=null?nt:et&&et.parentNode}},{key:"filterProps",value:function(et){return et}},{key:"attachScrollListener",value:function(){var et=this.getParentElement(this.scrollComponent);if(!(!this.props.hasMore||!et)){var nt=window;this.props.useWindow===!1&&(nt=et),nt.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),nt.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),nt.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(et){et.deltaY===1&&!this.isPassiveSupported()&&et.preventDefault()}},{key:"scrollListener",value:function(){var et=this.scrollComponent,nt=window,ct=this.getParentElement(et),lt=void 0;if(this.props.useWindow){var pt=document.documentElement||document.body.parentNode||document.body,vt=nt.pageYOffset!==void 0?nt.pageYOffset:pt.scrollTop;this.props.isReverse?lt=vt:lt=this.calculateOffset(et,vt)}else this.props.isReverse?lt=ct.scrollTop:lt=et.scrollHeight-ct.scrollTop-ct.clientHeight;lt<Number(this.props.threshold)&&et&&et.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=ct.scrollHeight,this.beforeScrollTop=ct.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(et,nt){return et?this.calculateTopPosition(et)+(et.offsetHeight-nt-window.innerHeight):0}},{key:"calculateTopPosition",value:function(et){return et?et.offsetTop+this.calculateTopPosition(et.offsetParent):0}},{key:"render",value:function(){var et=this,nt=this.filterProps(this.props),ct=nt.children,lt=nt.element,pt=nt.hasMore,vt=nt.initialLoad,Lt=nt.isReverse,bt=nt.loader,Gt=nt.loadMore,jt=nt.pageStart,ne=nt.ref,ie=nt.threshold,te=nt.useCapture,Ge=nt.useWindow,pe=nt.getScrollParent,Je=se(nt,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);Je.ref=function(hn){et.scrollComponent=hn,ne&&ne(hn)};var Ye=[ct];return pt&&(bt?Lt?Ye.unshift(bt):Ye.push(bt):this.defaultLoader&&(Lt?Ye.unshift(this.defaultLoader):Ye.push(this.defaultLoader))),be.default.createElement(lt,Je,Ye)}}]),Re}(fe.Component);Ze.propTypes={children:ge.default.node.isRequired,element:ge.default.node,hasMore:ge.default.bool,initialLoad:ge.default.bool,isReverse:ge.default.bool,loader:ge.default.node,loadMore:ge.default.func.isRequired,pageStart:ge.default.number,ref:ge.default.func,getScrollParent:ge.default.func,threshold:ge.default.number,useCapture:ge.default.bool,useWindow:ge.default.bool},Ze.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},Gn.default=Ze,un.exports=Gn.default},26724:function(un,Gn,Yt){un.exports=Yt(51581)},93314:function(un){"use strict";un.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(un){"use strict";un.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(un){"use strict";un.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(un){"use strict";un.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(un,Gn,Yt){"use strict";Yt.d(Gn,{Z:function(){return Ie}});const St=Le=>typeof Le=="object"&&Le!=null&&Le.nodeType===1,fe=(Le,$t)=>(!$t||Le!=="hidden")&&Le!=="visible"&&Le!=="clip",be=(Le,$t)=>{if(Le.clientHeight<Le.scrollHeight||Le.clientWidth<Le.scrollWidth){const Ze=getComputedStyle(Le,null);return fe(Ze.overflowY,$t)||fe(Ze.overflowX,$t)||(ae=>{const Re=(Nt=>{if(!Nt.ownerDocument||!Nt.ownerDocument.defaultView)return null;try{return Nt.ownerDocument.defaultView.frameElement}catch(et){return null}})(ae);return!!Re&&(Re.clientHeight<ae.scrollHeight||Re.clientWidth<ae.scrollWidth)})(Le)}return!1},Xe=(Le,$t,Ze,ae,Re,Nt,et,nt)=>Nt<Le&&et>$t||Nt>Le&&et<$t?0:Nt<=Le&&nt<=Ze||et>=$t&&nt>=Ze?Nt-Le-ae:et>$t&&nt<Ze||Nt<Le&&nt>Ze?et-$t+Re:0,ge=Le=>{const $t=Le.parentElement;return $t==null?Le.getRootNode().host||null:$t},re=(Le,$t)=>{var Ze,ae,Re,Nt;if(typeof document=="undefined")return[];const{scrollMode:et,block:nt,inline:ct,boundary:lt,skipOverflowHiddenElements:pt}=$t,vt=typeof lt=="function"?lt:Dn=>Dn!==lt;if(!St(Le))throw new TypeError("Invalid target");const Lt=document.scrollingElement||document.documentElement,bt=[];let Gt=Le;for(;St(Gt)&&vt(Gt);){if(Gt=ge(Gt),Gt===Lt){bt.push(Gt);break}Gt!=null&&Gt===document.body&&be(Gt)&&!be(document.documentElement)||Gt!=null&&be(Gt,pt)&&bt.push(Gt)}const jt=(ae=(Ze=window.visualViewport)==null?void 0:Ze.width)!=null?ae:innerWidth,ne=(Nt=(Re=window.visualViewport)==null?void 0:Re.height)!=null?Nt:innerHeight,{scrollX:ie,scrollY:te}=window,{height:Ge,width:pe,top:Je,right:Ye,bottom:hn,left:Fn}=Le.getBoundingClientRect(),{top:vn,right:pi,bottom:yn,left:ce}=(Dn=>{const je=window.getComputedStyle(Dn);return{top:parseFloat(je.scrollMarginTop)||0,right:parseFloat(je.scrollMarginRight)||0,bottom:parseFloat(je.scrollMarginBottom)||0,left:parseFloat(je.scrollMarginLeft)||0}})(Le);let Kt=nt==="start"||nt==="nearest"?Je-vn:nt==="end"?hn+yn:Je+Ge/2-vn+yn,tn=ct==="center"?Fn+pe/2-ce+pi:ct==="end"?Ye+pi:Fn-ce;const Yn=[];for(let Dn=0;Dn<bt.length;Dn++){const je=bt[Dn],{height:gn,width:Tn,top:Jn,right:Pn,bottom:Qn,left:ee}=je.getBoundingClientRect();if(et==="if-needed"&&Je>=0&&Fn>=0&&hn<=ne&&Ye<=jt&&(je===Lt&&!be(je)||Je>=Jn&&hn<=Qn&&Fn>=ee&&Ye<=Pn))return Yn;const jn=getComputedStyle(je),hi=parseInt(jn.borderLeftWidth,10),Dt=parseInt(jn.borderTopWidth,10),kt=parseInt(jn.borderRightWidth,10),wt=parseInt(jn.borderBottomWidth,10);let At=0,_t=0;const Et="offsetWidth"in je?je.offsetWidth-je.clientWidth-hi-kt:0,Pe="offsetHeight"in je?je.offsetHeight-je.clientHeight-Dt-wt:0,Ee="offsetWidth"in je?je.offsetWidth===0?0:Tn/je.offsetWidth:0,sn="offsetHeight"in je?je.offsetHeight===0?0:gn/je.offsetHeight:0;if(Lt===je)At=nt==="start"?Kt:nt==="end"?Kt-ne:nt==="nearest"?Xe(te,te+ne,ne,Dt,wt,te+Kt,te+Kt+Ge,Ge):Kt-ne/2,_t=ct==="start"?tn:ct==="center"?tn-jt/2:ct==="end"?tn-jt:Xe(ie,ie+jt,jt,hi,kt,ie+tn,ie+tn+pe,pe),At=Math.max(0,At+te),_t=Math.max(0,_t+ie);else{At=nt==="start"?Kt-Jn-Dt:nt==="end"?Kt-Qn+wt+Pe:nt==="nearest"?Xe(Jn,Qn,gn,Dt,wt+Pe,Kt,Kt+Ge,Ge):Kt-(Jn+gn/2)+Pe/2,_t=ct==="start"?tn-ee-hi:ct==="center"?tn-(ee+Tn/2)+Et/2:ct==="end"?tn-Pn+kt+Et:Xe(ee,Pn,Tn,hi,kt+Et,tn,tn+pe,pe);const{scrollLeft:He,scrollTop:Ae}=je;At=sn===0?0:Math.max(0,Math.min(Ae+At/sn,je.scrollHeight-gn/sn+Pe)),_t=Ee===0?0:Math.max(0,Math.min(He+_t/Ee,je.scrollWidth-Tn/Ee+Et)),Kt+=Ae-At,tn+=He-_t}Yn.push({el:je,top:At,left:_t})}return Yn},se=Le=>Le===!1?{block:"end",inline:"nearest"}:($t=>$t===Object($t)&&Object.keys($t).length!==0)(Le)?Le:{block:"start",inline:"nearest"};function Ie(Le,$t){if(!Le.isConnected||!(Re=>{let Nt=Re;for(;Nt&&Nt.parentNode;){if(Nt.parentNode===document)return!0;Nt=Nt.parentNode instanceof ShadowRoot?Nt.parentNode.host:Nt.parentNode}return!1})(Le))return;const Ze=(Re=>{const Nt=window.getComputedStyle(Re);return{top:parseFloat(Nt.scrollMarginTop)||0,right:parseFloat(Nt.scrollMarginRight)||0,bottom:parseFloat(Nt.scrollMarginBottom)||0,left:parseFloat(Nt.scrollMarginLeft)||0}})(Le);if((Re=>typeof Re=="object"&&typeof Re.behavior=="function")($t))return $t.behavior(re(Le,$t));const ae=typeof $t=="boolean"||$t==null?void 0:$t.behavior;for(const{el:Re,top:Nt,left:et}of re(Le,se($t))){const nt=Nt-Ze.top+Ze.bottom,ct=et-Ze.left+Ze.right;Re.scroll({top:nt,left:ct,behavior:ae})}}}}]);