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

1165 lines
1.8 MiB

(self.webpackChunk=self.webpackChunk||[]).push([[2806],{71749:function(){"use strict"},30483:function(){"use strict"},71736:function(tn,An){"use strict";An.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},39132:function(tn,An){"use strict";An.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"}},18023:function(){"use strict";function tn(Ft,et,nt,ct){nt===void 0&&(nt=0),ct===void 0&&(ct=1/0),this._name=Ft,this._defaultValue=et,this._minimum=nt,this._maximum=ct}Object.defineProperty(tn.prototype,"name",{get:function(){return this._name},set:function(Ft){if(typeof Ft!="string"||Ft==="")throw new Error("Shape name must be a valid string.");this._name=Ft}}),Object.defineProperty(tn.prototype,"defaultValue",{get:function(){return this._defaultValue},set:function(Ft){if(typeof Ft!="number"||isNaN(Ft))throw new Error("The default value must be a real number, not: "+Ft);this._defaultValue=Ft}}),Object.defineProperty(tn.prototype,"minimum",{get:function(){return this._minimum},set:function(Ft){if(typeof Ft!="number"||isNaN(Ft))throw new Error("Minimum must be a real number, not: "+Ft);this._minimum=Ft}}),Object.defineProperty(tn.prototype,"maximum",{get:function(){return this._maximum},set:function(Ft){if(typeof Ft!="number"||isNaN(Ft))throw new Error("Maximum must be a real number, not: "+Ft);this._maximum=Ft}}),go.Shape._FigureParameters={},go.Shape.getFigureParameter=function(Ft,et){var nt=go.Shape._FigureParameters[Ft];return nt?nt[et]:null},go.Shape.setFigureParameter=function(Ft,et,nt){if(!(nt instanceof tn))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[Ft];ct||(ct=[],go.Shape._FigureParameters[Ft]=ct),ct[et]=nt};var An=[];function Kt(Ft,et){var nt=An.pop();return nt===void 0?new go.Point(Ft,et):(nt.x=Ft,nt.y=et,nt)}function St(){var Ft=An.pop();return Ft===void 0?new go.Point:Ft}function de(Ft){An.push(Ft)}function Ie(Ft,et,nt,ct,lt,pt,vt,Ct,Nt){Nt||(Nt=new go.Point);var zt=Ft-nt,Ht=lt-vt,$t=NaN,ee=NaN;if(zt===0)if(Ht===0)Ft===nt&&($t=Ft,ee=et);else{var te=(pt-Ct)/Ht,Ae=pt-te*lt;$t=Ft,ee=te*$t+Ae}else if(Ht===0){var se=(et-ct)/zt,Re=et-se*Ft;$t=lt,ee=se*$t+Re}else{var se=(et-ct)/zt,te=(pt-Ct)/Ht,Re=et-se*Ft,Ae=pt-te*lt;$t=(Ae-Re)/(se-te),ee=se*$t+Re}return Nt.x=$t,Nt.y=ee,Nt}function $e(Ft,et,nt,ct,lt,pt,vt,Ct,Nt,zt,Ht,$t,ee,te){var Ae=1-Nt,se=Nt,Re=Ft*Ae+nt*se,He=et*Ae+ct*se,ze=nt*Ae+lt*se,Cn=ct*Ae+pt*se,Rn=lt*Ae+vt*se,Xn=pt*Ae+Ct*se,Ni=Re*Ae+ze*se,Yt=He*Ae+Cn*se,jt=ze*Ae+Rn*se,Ce=Cn*Ae+Xn*se,un=Ni*Ae+jt*se,Ln=Yt*Ae+Ce*se;zt.x=Re,zt.y=He,Ht.x=Ni,Ht.y=Yt,$t.x=un,$t.y=Ln,ee.x=jt,ee.y=Ce,te.x=Rn,te.y=Xn}var me=new go.Spot(.156,.156),re=new go.Spot(.844,.844),Zt=4*((Math.sqrt(2)-1)/3);go.Shape.setFigureParameter("RoundedRectangle",0,new tn("CornerRounding",5)),go.Shape.defineFigureGenerator("RoundedRectangle",function(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN;(isNaN(ct)||ct<0)&&(ct=5),ct=Math.min(ct,et/3),ct=Math.min(ct,nt/3);var lt=ct*Zt,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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=me,lt.spot2=re,lt.defaultStretch=go.GraphObject.Uniform,lt}),go.Shape.defineFigureGenerator("Line1",function(Ft,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(Ft,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(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,et,nt,Zt*et,0,et,(1-Zt)*nt)))}),go.Shape.defineFigureGenerator("Curve2",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,et,nt,0,Zt*nt,(1-Zt)*et,nt)))}),go.Shape.defineFigureGenerator("Curve3",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(et,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,nt,et,Zt*nt,Zt*et,nt)))}),go.Shape.defineFigureGenerator("Curve4",function(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(et,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,nt,(1-Zt)*et,0,0,(1-Zt)*nt)))}),go.Shape.defineFigureGenerator("TriangleDownLeft",function(Ft,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(Ft,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(Ft,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(Ft,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 tn("Indent",.1,-.99,.99)),go.Shape.defineFigureGenerator("Parallelogram1",function(Ft,et,nt){var ct=Ft?Ft.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 tn("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("Parallelogram2",function(Ft,et,nt){var ct=Ft?Ft.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 tn("Indent",.2,-.99,.99)),go.Shape.defineFigureGenerator("Trapezoid1",function(Ft,et,nt){var ct=Ft?Ft.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 tn("Indent",20,-1/0,1/0)),go.Shape.defineFigureGenerator("Trapezoid2",function(Ft,et,nt){var ct=Ft?Ft.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 tn("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("ManualOperation",function(Ft,et,nt){var ct=Ft?Ft.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 Oe=[];function ue(){var Ft=Oe.pop();return Ft===void 0?[]:Ft}function Se(Ft){Ft.length=0,Oe.push(Ft)}function Ue(Ft){for(var et=ue(),nt=.5,ct=.5,lt=Math.PI*1.5,pt=0,vt=0;vt<Ft;vt++)pt=2*Math.PI/Ft*vt+lt,et[vt]=new go.Point(ct+nt*Math.cos(pt),ct+nt*Math.sin(pt));return et.push(et[0]),et}function Ee(Ft){var et=Ze(Ft),nt=ue();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 Se(et),nt}function Ze(Ft){for(var et=Ue(Ft),nt=ue(),ct=Math.floor(et.length/2),lt=et.length-1,pt=Ft%2===0?2:1,vt=0;vt<lt;vt++){var Ct=et[vt],Nt=et[vt+1],zt=et[(ct+vt-1)%lt],Ht=et[(ct+vt+pt)%lt];nt[vt*2]=Ct,nt[vt*2+1]=Ie(Ct.x,Ct.y,zt.x,zt.y,Nt.x,Nt.y,Ht.x,Ht.y,new go.Point)}return nt[nt.length]=nt[0],Se(et),nt}go.Shape.defineFigureGenerator("Pentagon",function(Ft,et,nt){var ct=Ue(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()),Se(ct),lt.spot1=new go.Spot(.2,.22),lt.spot2=new go.Spot(.8,.9),lt}),go.Shape.defineFigureGenerator("Hexagon",function(Ft,et,nt){var ct=Ue(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()),Se(ct),lt.spot1=new go.Spot(.07,.25),lt.spot2=new go.Spot(.93,.75),lt}),go.Shape.defineFigureGenerator("Heptagon",function(Ft,et,nt){var ct=Ue(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()),Se(ct),lt.spot1=new go.Spot(.2,.15),lt.spot2=new go.Spot(.8,.85),lt}),go.Shape.defineFigureGenerator("Octagon",function(Ft,et,nt){var ct=Ue(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()),Se(ct),lt.spot1=new go.Spot(.15,.15),lt.spot2=new go.Spot(.85,.85),lt}),go.Shape.defineFigureGenerator("Nonagon",function(Ft,et,nt){var ct=Ue(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()),Se(ct),lt.spot1=new go.Spot(.17,.13),lt.spot2=new go.Spot(.82,.82),lt}),go.Shape.defineFigureGenerator("Decagon",function(Ft,et,nt){var ct=Ue(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()),Se(ct),lt.spot1=new go.Spot(.16,.16),lt.spot2=new go.Spot(.84,.84),lt}),go.Shape.defineFigureGenerator("Dodecagon",function(Ft,et,nt){var ct=Ue(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()),Se(ct),lt.spot1=new go.Spot(.16,.16),lt.spot2=new go.Spot(.84,.84),lt}),go.Shape.defineFigureGenerator("FivePointedStar",function(Ft,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<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()),Se(ct),lt.spot1=new go.Spot(.266,.333),lt.spot2=new go.Spot(.733,.733),lt}),go.Shape.defineFigureGenerator("SixPointedStar",function(Ft,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<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()),Se(ct),lt.spot1=new go.Spot(.17,.25),lt.spot2=new go.Spot(.83,.75),lt}),go.Shape.defineFigureGenerator("SevenPointedStar",function(Ft,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<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()),Se(ct),lt.spot1=new go.Spot(.222,.277),lt.spot2=new go.Spot(.777,.666),lt}),go.Shape.defineFigureGenerator("EightPointedStar",function(Ft,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<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()),Se(ct),lt.spot1=new go.Spot(.25,.25),lt.spot2=new go.Spot(.75,.75),lt}),go.Shape.defineFigureGenerator("NinePointedStar",function(Ft,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<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()),Se(ct),lt.spot1=new go.Spot(.222,.277),lt.spot2=new go.Spot(.777,.666),lt}),go.Shape.defineFigureGenerator("TenPointedStar",function(Ft,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<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()),Se(ct),lt.spot1=new go.Spot(.281,.261),lt.spot2=new go.Spot(.723,.748),lt}),go.Shape.defineFigureGenerator("FivePointedBurst",function(Ft,et,nt){var ct=Ee(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(),Se(ct),lt.spot1=new go.Spot(.222,.277),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("SixPointedBurst",function(Ft,et,nt){var ct=Ee(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(),Se(ct),lt.spot1=new go.Spot(.17,.222),lt.spot2=new go.Spot(.833,.777),lt}),go.Shape.defineFigureGenerator("SevenPointedBurst",function(Ft,et,nt){var ct=Ee(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(),Se(ct),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("EightPointedBurst",function(Ft,et,nt){var ct=Ee(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(),Se(ct),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("NinePointedBurst",function(Ft,et,nt){var ct=Ee(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(),Se(ct),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("TenPointedBurst",function(Ft,et,nt){var ct=Ee(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(),Se(ct),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.setFigureParameter("FramedRectangle",0,new tn("ThicknessX",8)),go.Shape.setFigureParameter("FramedRectangle",1,new tn("ThicknessY",8)),go.Shape.defineFigureGenerator("FramedRectangle",function(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN,lt=Ft?Ft.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 tn("Thickness",8)),go.Shape.defineFigureGenerator("Ring",function(Ft,et,nt){var ct=Ft?Ft.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 Ct=Math.max(lt-ct,0);return Ct>0&&(vt.add(new go.PathSegment(go.PathSegment.Move,et/2+Ct,et/2)),vt.add(new go.PathSegment(go.PathSegment.Arc,0,-360,lt,lt,Ct,Ct).close())),pt.spot1=me,pt.spot2=re,pt.defaultStretch=go.GraphObject.Uniform,pt}),go.Shape.defineFigureGenerator("Cloud",function(Ft,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(Ft,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 tn("Start",0,-360,360)),go.Shape.setFigureParameter("Pie",1,new tn("Sweep",315,-360,360)),go.Shape.defineFigureGenerator("Pie",function(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN,lt=Ft?Ft.parameter2:NaN;isNaN(ct)&&(ct=0),isNaN(lt)&&(lt=315);var pt=ct%360;pt<0&&(pt+=360);var vt=lt%360,Ct=Math.min(et,nt)/2;return new go.Geometry().add(new go.PathFigure(Ct,Ct).add(new go.PathSegment(go.PathSegment.Arc,pt,vt,Ct,Ct,Ct,Ct).close()))}),go.Shape.defineFigureGenerator("PiePiece",function(Ft,et,nt){var ct=Zt/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 tn("Thickness",30)),go.Shape.defineFigureGenerator("ThickCross",function(Ft,et,nt){var ct=Ft?Ft.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 tn("Thickness",10)),go.Shape.defineFigureGenerator("ThinCross",function(Ft,et,nt){var ct=Ft?Ft.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 tn("Thickness",30)),go.Shape.defineFigureGenerator("ThickX",function(Ft,et,nt){var ct=Ft?Ft.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,Ct=Math.atan2(nt,et),Nt=ct-Math.min(Math.cos(Ct)*ct/2,pt),zt=ct-Math.min(Math.sin(Ct)*ct/2,vt),lt=new go.Geometry,Ht=new go.PathFigure(Nt,0,!0);return lt.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Line,pt,.2*nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,et-Nt,0)),Ht.add(new go.PathSegment(go.PathSegment.Line,et,zt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.8*et,vt)),Ht.add(new go.PathSegment(go.PathSegment.Line,et,nt-zt)),Ht.add(new go.PathSegment(go.PathSegment.Line,et-Nt,nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,pt,.8*nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,Nt,nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,0,nt-zt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.2*et,vt)),Ht.add(new go.PathSegment(go.PathSegment.Line,0,zt).close()),lt}}),go.Shape.setFigureParameter("ThinX",0,new tn("Thickness",10)),go.Shape.defineFigureGenerator("ThinX",function(Ft,et,nt){var ct=Ft?Ft.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 tn("BeamWidth",.2,.1,.9)),go.Shape.defineFigureGenerator("SquareIBeam",function(Ft,et,nt){var ct=Ft?Ft.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 tn("Curviness",.5,.05,.65)),go.Shape.defineFigureGenerator("RoundedIBeam",function(Ft,et,nt){var ct=Ft?Ft.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(Ft,et,nt){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,Zt*et,0,et,(.5-Zt/2)*nt)).add(new go.PathSegment(go.PathSegment.Bezier,0,nt,et,(.5+Zt/2)*nt,Zt*et,nt).close())).setSpots(0,.156,.844,.844)}),go.Shape.defineFigureGenerator("Crescent",function(Ft,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(Ft,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(Ft,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(Ft,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,Ct=0,Nt=pt*Zt;return lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5+pt+Ct)*nt,(.5-pt+vt)*et,(.5+Nt+Ct)*nt,(.5-Nt+vt)*et,(.5+pt+Ct)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pt+vt)*et,(.5+Ct)*nt,(.5+Nt+vt)*et,(.5+pt+Ct)*nt,(.5+pt+vt)*et,(.5+Nt+Ct)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5-pt+Ct)*nt,(1-.5+pt+vt)*et,(.5-Nt+Ct)*nt,(.5+Nt+vt)*et,(.5-pt+Ct)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.65*et,.36771243*nt,(.5-Nt+vt)*et,(.5-pt+Ct)*nt,(.5-pt+vt+.05)*et,(.5-Nt+Ct-.02)*nt)),pt=.2,vt=0,Ct=-.3,Nt=pt*Zt,lt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pt+vt)*et,(.5+Ct)*nt,(.5+Nt+vt)*et,(.5+pt+Ct)*nt,(.5+pt+vt)*et,(.5+Nt+Ct)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5-pt+Ct)*nt,(1-.5+pt+vt)*et,(.5-Nt+Ct)*nt,(.5+Nt+vt)*et,(.5-pt+Ct)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pt+vt)*et,(.5+Ct)*nt,(.5-Nt+vt)*et,(.5-pt+Ct)*nt,(.5-pt+vt)*et,(.5-Nt+Ct)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-Nt+vt)*et,(.5+pt+Ct)*nt,(.5-pt+vt)*et,(.5+Nt+Ct)*nt,(.5-Nt+vt)*et,(.5+pt+Ct)*nt)),pt=.2,vt=-.3,Ct=0,Nt=pt*Zt,lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5-pt+Ct)*nt,(1-.5+pt+vt-.05)*et,(.5-Nt+Ct-.02)*nt,(.5+Nt+vt)*et,(.5-pt+Ct)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pt+vt)*et,(.5+Ct)*nt,(.5-Nt+vt)*et,(.5-pt+Ct)*nt,(.5-pt+vt)*et,(.5-Nt+Ct)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*et,(.5+pt+Ct)*nt,(.5-pt+vt)*et,(.5+Nt+Ct)*nt,(.5-Nt+vt)*et,(.5+pt+Ct)*nt)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.4*et,.6*nt,(.5+Nt+vt)*et,(.5+pt+Ct)*nt,(.5+pt+vt)*et,(.5+Nt+Ct)*nt).close()),ct.setSpots(.06,.33,.93,.68),ct}),go.Shape.defineFigureGenerator("YinYang",function(Ft,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,Ct=.25;return lt.add(new go.PathSegment(go.PathSegment.Move,(vt+pt)*et,Ct*nt)),lt.add(new go.PathSegment(go.PathSegment.Arc,0,-360,et*vt,nt*Ct,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)),Ct=.75,lt=new go.PathFigure((vt+pt)*et,Ct*nt,!0),ct.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,0,360,et*vt,nt*Ct,pt*et,pt*et).close()),ct.defaultStretch=go.GraphObject.Uniform,ct}),go.Shape.defineFigureGenerator("Peace",function(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.5,pt=.5,vt=.5,Ct=.5,Nt=new go.PathFigure(vt*et,(Ct-pt)*nt);ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Ct*nt,(vt-lt)*et,(Ct-pt)*nt,(vt-pt)*et,(Ct-lt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+pt)*nt,(vt-pt)*et,(Ct+lt)*nt,(vt-lt)*et,(Ct+pt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Ct*nt,(vt+lt)*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct-pt)*nt,(vt+pt)*et,(Ct-lt)*nt,(vt+lt)*et,(Ct-pt)*nt)),pt=.4,lt=Zt*.4;var zt=St(),Ht=St(),$t=St(),ee=St();$e(vt,Ct-pt,vt+lt,Ct-pt,vt+pt,Ct-lt,vt+pt,Ct,.42,zt,Ht,$t,ee,ee);var te=St(),Ae=St(),se=St();$e(vt,Ct-pt,vt+lt,Ct-pt,vt+pt,Ct-lt,vt+pt,Ct,.58,ee,ee,se,te,Ae);var Re=St(),He=St(),ze=St();$e(vt,Ct+pt,vt-lt,Ct+pt,vt-pt,Ct+lt,vt-pt,Ct,.42,Re,He,ze,ee,ee);var Cn=St(),Rn=St(),Xn=St();return $e(vt,Ct+pt,vt-lt,Ct+pt,vt-pt,Ct+lt,vt-pt,Ct,.58,ee,ee,Xn,Cn,Rn),Nt.add(new go.PathSegment(go.PathSegment.Move,Xn.x*et,Xn.y*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Ct*nt,Cn.x*et,Cn.y*nt,Rn.x*et,Rn.y*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct-pt)*nt,(vt-pt)*et,(Ct-lt)*nt,(vt-lt)*et,(Ct-pt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,$t.x*et,$t.y*nt,zt.x*et,zt.y*nt,Ht.x*et,Ht.y*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,Xn.x*et,Xn.y*nt).close()),Nt.add(new go.PathSegment(go.PathSegment.Move,ze.x*et,ze.y*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,se.x*et,se.y*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Ct*nt,te.x*et,te.y*nt,Ae.x*et,Ae.y*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt,(vt+lt)*et,(Ct+pt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,ze.x*et,ze.y*nt,Re.x*et,Re.y*nt,He.x*et,He.y*nt).close()),de(zt),de(Ht),de($t),de(ee),de(te),de(Ae),de(se),de(Re),de(He),de(ze),de(Cn),de(Rn),de(Xn),ct.defaultStretch=go.GraphObject.Uniform,ct}),go.Shape.defineFigureGenerator("Fragile",function(Ft,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 tn("Thickness",30)),go.Shape.defineFigureGenerator("HourGlass",function(Ft,et,nt){var ct=Ft?Ft.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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.4,pt=.4,vt=.5,Ct=.5,Nt=St(),zt=St(),Ht=St(),$t=St(),ee=new go.PathFigure((vt-pt)*et,Ct*nt,!1);ct.add(ee),ee.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct-pt)*nt,(vt-pt)*et,(Ct-lt)*nt,(vt-lt)*et,(Ct-pt)*nt)),$e(vt,Ct-pt,vt+lt,Ct-pt,vt+pt,Ct-lt,vt+pt,Ct,.44,Ht,$t,zt,Nt,Nt),ee.add(new go.PathSegment(go.PathSegment.Bezier,zt.x*et,zt.y*nt,Ht.x*et,Ht.y*nt,$t.x*et,$t.y*nt));var te=Kt(zt.x,zt.y);$e(vt,Ct-pt,vt+lt,Ct-pt,vt+pt,Ct-lt,vt+pt,Ct,.56,Nt,Nt,zt,Ht,$t);var Ae=Kt(zt.x,zt.y);ee.add(new go.PathSegment(go.PathSegment.Line,(te.x*.1+.95*.9)*et,te.y*.1*nt)),ee.add(new go.PathSegment(go.PathSegment.Line,.85*et,te.y*.1*nt)),ee.add(new go.PathSegment(go.PathSegment.Line,.85*et,0)),ee.add(new go.PathSegment(go.PathSegment.Line,et,0)),ee.add(new go.PathSegment(go.PathSegment.Line,et,.15*nt)),ee.add(new go.PathSegment(go.PathSegment.Line,(Ae.x*.1+.9)*et,.15*nt)),ee.add(new go.PathSegment(go.PathSegment.Line,(Ae.x*.1+.9)*et,(Ae.y*.1+.05*.9)*nt)),ee.add(new go.PathSegment(go.PathSegment.Line,Ae.x*et,Ae.y*nt)),ee.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Ct*nt,Ht.x*et,Ht.y*nt,$t.x*et,$t.y*nt)),ee.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt,(vt+lt)*et,(Ct+pt)*nt)),ee.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Ct*nt,(vt-lt)*et,(Ct+pt)*nt,(vt-pt)*et,(Ct+lt)*nt)),pt=.35,lt=Zt*.35;var se=new go.PathFigure(vt*et,(Ct-pt)*nt,!1);ct.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Ct*nt,(vt-lt)*et,(Ct-pt)*nt,(vt-pt)*et,(Ct-lt)*nt)),se.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+pt)*nt,(vt-pt)*et,(Ct+lt)*nt,(vt-lt)*et,(Ct+pt)*nt)),se.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Ct*nt,(vt+lt)*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt)),se.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct-pt)*nt,(vt+pt)*et,(Ct-lt)*nt,(vt+lt)*et,(Ct-pt)*nt));var Re=new go.PathFigure((vt-pt)*et,Ct*nt,!1);return ct.add(Re),de(Nt),de(zt),de(Ht),de($t),de(te),de(Ae),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(Ft,et,nt){var ct=new go.Geometry,lt=.375,pt=0,vt=-.125,Ct=lt*Zt,Nt=new go.PathFigure((.525+pt)*et,(.5+lt+vt)*nt,!1);ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+lt+pt)*et,(.5+vt)*nt,(.5+Ct+pt)*et,(.5+lt+vt)*nt,(.5+lt+pt)*et,(.5+Ct+vt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*et,(.5-lt+vt)*nt,(1-.5+lt+pt)*et,(.5-Ct+vt)*nt,(.5+Ct+pt)*et,(.5-lt+vt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-lt+pt)*et,(.5+vt)*nt,(.5-Ct+pt)*et,(.5-lt+vt)*nt,(.5-lt+pt)*et,(.5-Ct+vt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(.475+pt)*et,(.5+lt+vt)*nt,(.5-lt+pt)*et,(.5+Ct+vt)*nt,(.5-Ct+pt)*et,(.5+lt+vt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.475*et,.85*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.425*et,.85*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.425*et,.9*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.475*et,.9*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.475*et,nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.525*et,nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.525*et,.9*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.575*et,.9*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.575*et,.85*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.525*et,.85*nt).close()),lt=.325,pt=0,vt=-.125,Ct=lt*Zt;var Nt=new go.PathFigure((1-.5+lt+pt)*et,(.5+vt)*nt,!1);ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*et,(.5+lt+vt)*nt,(.5+lt+pt)*et,(.5+Ct+vt)*nt,(.5+Ct+pt)*et,(.5+lt+vt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-lt+pt)*et,(.5+vt)*nt,(.5-Ct+pt)*et,(.5+lt+vt)*nt,(.5-lt+pt)*et,(.5+Ct+vt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*et,(.5-lt+vt)*nt,(.5-lt+pt)*et,(.5-Ct+vt)*nt,(.5-Ct+pt)*et,(.5-lt+vt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+lt+pt)*et,(.5+vt)*nt,(.5+Ct+pt)*et,(.5-lt+vt)*nt,(1-.5+lt+pt)*et,(.5-Ct+vt)*nt));var Nt=new go.PathFigure((.525+pt)*et,(.5+lt+vt)*nt,!1);return ct.add(Nt),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(Ft,et,nt){var ct=Ft?Ft.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(Ft,et,nt){var ct=Ft?Ft.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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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 tn("ArrowheadWidth",.3,.01,.99)),go.Shape.setFigureParameter("Arrow",1,new tn("TailHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("Arrow",function(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN;isNaN(ct)&&(ct=.3);var lt=Ft?Ft.parameter2:NaN;isNaN(lt)&&(lt=.3);var pt=(1-ct)*et,vt=(.5-lt/2)*nt,Ct=(.5+lt/2)*nt,Nt=new go.Geometry,zt=new go.PathFigure(0,vt,!0);Nt.add(zt),zt.add(new go.PathSegment(go.PathSegment.Line,pt,vt)),zt.add(new go.PathSegment(go.PathSegment.Line,pt,0)),zt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),zt.add(new go.PathSegment(go.PathSegment.Line,pt,nt)),zt.add(new go.PathSegment(go.PathSegment.Line,pt,Ct)),zt.add(new go.PathSegment(go.PathSegment.Line,0,Ct).close()),Nt.spot1=new go.Spot(0,vt/nt);var Ht=Ie(0,Ct/nt,1,Ct/nt,pt/et,1,1,.5,St());return Nt.spot2=new go.Spot(Ht.x,Ht.y),de(Ht),Nt}),go.Shape.setFigureParameter("Arrow2",0,new tn("ArrowheadWidth",30)),go.Shape.setFigureParameter("Arrow2",0,new tn("TailHeight",30)),go.Shape.defineFigureGenerator("Arrow2",function(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN;isNaN(ct)&&(ct=30),ct>et&&(ct=et);var lt=Ft?Ft.parameter2:NaN;isNaN(lt)&&(lt=30),lt=Math.min(lt,nt/2);var pt=et-ct,vt=(nt-lt)/2,Ct=vt+lt,Nt=new go.Geometry,zt=new go.PathFigure(0,vt,!0);Nt.add(zt),zt.add(new go.PathSegment(go.PathSegment.Line,pt,vt)),zt.add(new go.PathSegment(go.PathSegment.Line,pt,0)),zt.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),zt.add(new go.PathSegment(go.PathSegment.Line,pt,nt)),zt.add(new go.PathSegment(go.PathSegment.Line,pt,Ct)),zt.add(new go.PathSegment(go.PathSegment.Line,0,Ct).close()),Nt.spot1=new go.Spot(0,vt/nt);var Ht=Ie(0,Ct/nt,1,Ct/nt,pt/et,1,1,.5,St());return Nt.spot2=new go.Spot(Ht.x,Ht.y),de(Ht),Nt}),go.Shape.defineFigureGenerator("Chevron",function(Ft,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(Ft,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 tn("ConnecterHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("DoubleEndArrow",function(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN;isNaN(ct)&&(ct=.3);var lt=(.5-ct/2)*nt,pt=(.5+ct/2)*nt,vt=new go.Geometry,Ct=new go.PathFigure(et,.5*nt,!0);vt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.3*et,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.3*et,nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.3*et,0)),Ct.add(new go.PathSegment(go.PathSegment.Line,.3*et,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,0).close());var Nt=Ie(0,.5,.3,0,0,lt/nt,.1,lt/nt,St());return vt.spot1=new go.Spot(Nt.x,Nt.y),Nt=Ie(.7,1,1,.5,0,pt/nt,1,pt/nt,Nt),vt.spot2=new go.Spot(Nt.x,Nt.y),de(Nt),vt}),go.Shape.setFigureParameter("DoubleEndArrow2",0,new tn("ConnecterHeight",40)),go.Shape.setFigureParameter("DoubleEndArrow2",1,new tn("ArrowHeight",100)),go.Shape.defineFigureGenerator("DoubleEndArrow2",function(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN;isNaN(ct)&&(ct=40);var lt=Ft?Ft.parameter2:NaN;isNaN(lt)&&(lt=100);var pt=(nt-ct)/2,vt=pt+ct,Ct=(nt-lt)/2,Nt=Ct+lt;(ct>nt||lt>nt)&&(lt>ct?(ct=ct*nt/lt,pt=(nt-ct)/2,vt=pt+ct,Ct=0,Nt=nt):(pt=0,vt=nt,Ct=0,Nt=nt));var zt=new go.Geometry,Ht=new go.PathFigure(et,.5*nt,!0);zt.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Line,.7*et,Nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.7*et,vt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.3*et,vt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.3*et,Nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.3*et,Ct)),Ht.add(new go.PathSegment(go.PathSegment.Line,.3*et,pt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.7*et,Ct).close());var $t=Ie(0,.5,.3,Ct/nt,0,pt/nt,1,pt/nt,St());return zt.spot1=new go.Spot($t.x,$t.y),$t=Ie(.7,Nt/nt,1,.5,0,vt/nt,1,vt/nt,$t),zt.spot2=new go.Spot($t.x,$t.y),de($t),zt}),go.Shape.setFigureParameter("IBeamArrow",0,new tn("ConnectorHeight",.7,.51,.97)),go.Shape.defineFigureGenerator("IBeamArrow",function(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN;isNaN(ct)&&(ct=.3);var lt=(.5-ct/2)*nt,pt=(.5+ct/2)*nt,vt=new go.Geometry,Ct=new go.PathFigure(et,.5*nt,!0);vt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.2*et,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.2*et,nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,0)),Ct.add(new go.PathSegment(go.PathSegment.Line,.2*et,0)),Ct.add(new go.PathSegment(go.PathSegment.Line,.2*et,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,0).close()),vt.spot1=new go.Spot(0,lt/nt);var Nt=Ie(.7,1,1,.5,0,pt/nt,1,pt/nt,St());return vt.spot2=new go.Spot(Nt.x,Nt.y),de(Nt),vt}),go.Shape.setFigureParameter("IBeamArrow2",0,new tn("ConnectorHeight",40)),go.Shape.setFigureParameter("IBeamArrow2",1,new tn("BeamArrowHeight",100)),go.Shape.defineFigureGenerator("IBeamArrow2",function(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN;isNaN(ct)&&(ct=40);var lt=Ft?Ft.parameter2:NaN;isNaN(lt)&&(lt=100);var pt=(nt-ct)/2,vt=pt+ct,Ct=(nt-lt)/2,Nt=Ct+lt;(ct>nt||lt>nt)&&(lt>ct?(ct=ct*nt/lt,pt=(nt-ct)/2,vt=pt+ct,Ct=0,Nt=nt):(pt=0,vt=nt,Ct=0,Nt=nt));var zt=new go.Geometry,Ht=new go.PathFigure(et,.5*nt,!0);zt.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Line,.7*et,Nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.7*et,vt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.2*et,vt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.2*et,Nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,0,Nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,0,Ct)),Ht.add(new go.PathSegment(go.PathSegment.Line,.2*et,Ct)),Ht.add(new go.PathSegment(go.PathSegment.Line,.2*et,pt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),Ht.add(new go.PathSegment(go.PathSegment.Line,.7*et,Ct).close()),zt.spot1=new go.Spot(0,pt/nt);var $t=Ie(.7,Nt/nt,1,.5,0,vt/nt,1,vt/nt,St());return zt.spot2=new go.Spot($t.x,$t.y),de($t),zt}),go.Shape.setFigureParameter("Pointer",0,new tn("BackPoint",.1,0,.2)),go.Shape.defineFigureGenerator("Pointer",function(Ft,et,nt){var ct=Ft?Ft.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=Ie(.2,.65,1,.65,0,1,1,.5,St());return lt.spot2=new go.Spot(vt.x,vt.y),de(vt),lt}),go.Shape.setFigureParameter("RoundedPointer",0,new tn("RoundedEdge",.3,0,.5)),go.Shape.defineFigureGenerator("RoundedPointer",function(Ft,et,nt){var ct=Ft?Ft.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=Ie(0,.65,1,.65,0,1,1,.5,St());return lt.spot2=new go.Spot(vt.x,vt.y),de(vt),lt}),go.Shape.setFigureParameter("SplitEndArrow",0,new tn("TailHeight",.4,.01,.99)),go.Shape.defineFigureGenerator("SplitEndArrow",function(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN;isNaN(ct)&&(ct=.4);var lt=(.5-ct/2)*nt,pt=(.5+ct/2)*nt,vt=new go.Geometry,Ct=new go.PathFigure(et,.5*nt,!0);vt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.2*et,.5*nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,0).close()),vt.spot1=new go.Spot(.2,.3);var Nt=Ie(.7,1,1,.5,0,pt/nt,1,pt/nt,St());return vt.spot2=new go.Spot(Nt.x,Nt.y),de(Nt),vt}),go.Shape.setFigureParameter("SplitEndArrow2",0,new tn("TailThickness",50)),go.Shape.defineFigureGenerator("SplitEndArrow2",function(Ft,et,nt){var ct=Ft?Ft.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,Ct=new go.PathFigure(et,.5*nt,!0);vt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.2*et,.5*nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*et,0).close()),vt.spot1=new go.Spot(.2,lt/nt);var Nt=Ie(.7,1,1,.5,0,pt/nt,1,pt/nt,St());return vt.spot2=new go.Spot(Nt.x,Nt.y),de(Nt),vt}),go.Shape.setFigureParameter("SquareArrow",0,new tn("ArrowPoint",.7,.2,.9)),go.Shape.defineFigureGenerator("SquareArrow",function(Ft,et,nt){var ct=Ft?Ft.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(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.5,pt=Zt*.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(Ft,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(Ft,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(Ft,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(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN;isNaN(ct)&&(ct=5),ct=Math.min(ct,nt/3);var lt=new go.Geometry,pt=Zt*.5,vt=new go.PathFigure(0,ct,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,0,0,Zt*ct,(.5-pt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,1*et,ct,(.5+pt)*et,0,1*et,Zt*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-Zt*ct,(.5+pt)*et,1*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt-ct,(.5-pt)*et,1*nt,0,nt-Zt*ct)),vt.add(new go.PathSegment(go.PathSegment.Line,0,ct));var Ct=new go.PathFigure(et,ct,!1);return lt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,2*ct,1*et,2*ct-Zt*ct,(.5+pt)*et,2*ct)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,0,ct,(.5-pt)*et,2*ct,0,2*ct-Zt*ct)),lt.spot1=new go.Spot(0,0,0,2*ct),lt.spot2=new go.Spot(1,1),lt}),go.Shape.defineFigureGenerator("Cylinder2",function(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN;isNaN(ct)&&(ct=5),ct=Math.min(ct,nt/3);var lt=new go.Geometry,pt=Zt*.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,Zt*ct,(.5-pt)*et,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,ct,(.5+pt)*et,0,et,Zt*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-Zt*ct,(.5+pt)*et,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt-ct,(.5-pt)*et,nt,0,nt-Zt*ct));var Ct=new go.PathFigure(0,nt-ct,!1);return lt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,nt-2*ct,0,nt-ct-Zt*ct,(.5-pt)*et,nt-2*ct)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,et,nt-ct,(.5+pt)*et,nt-2*ct,et,nt-ct-Zt*ct)),lt.spot1=new go.Spot(0,0),lt.spot2=new go.Spot(1,1,0,-2*ct),lt}),go.Shape.defineFigureGenerator("Cylinder3",function(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN;isNaN(ct)&&(ct=5),ct=Math.min(ct,et/3);var lt=new go.Geometry,pt=Zt*.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-Zt*ct,0,et,(.5-pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et-ct,nt,et,(.5+pt)*nt,et-Zt*ct,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,ct,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,Zt*ct,nt,0,(.5+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ct,0,0,(.5-pt)*nt,Zt*ct,0));var Ct=new go.PathFigure(ct,0,!1);return lt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,2*ct,.5*nt,ct+Zt*ct,0,2*ct,(.5-pt)*nt)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,ct,nt,2*ct,(.5+pt)*nt,ct+Zt*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(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN;isNaN(ct)&&(ct=5),ct=Math.min(ct,et/3);var lt=new go.Geometry,pt=Zt*.5,vt=new go.PathFigure(et-ct,0,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,et-Zt*ct,0,et,(.5-pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,et-ct,nt,et,(.5+pt)*nt,et-Zt*ct,nt)),vt.add(new go.PathSegment(go.PathSegment.Line,ct,nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*nt,Zt*ct,nt,0,(.5+pt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ct,0,0,(.5-pt)*nt,Zt*ct,0)),vt.add(new go.PathSegment(go.PathSegment.Line,et-ct,0));var Ct=new go.PathFigure(et-ct,0,!1);return lt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,et-2*ct,.5*nt,et-ct-Zt*ct,0,et-2*ct,(.5-pt)*nt)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,et-ct,nt,et-2*ct,(.5+pt)*nt,et-ct-Zt*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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=.2,pt=.1,vt=Zt*lt,Ct=Zt*pt,Nt=.5,zt=.1,Ht=new go.PathFigure(Nt*et,(zt+pt)*nt,!0);ct.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Nt-lt)*et,zt*nt,(Nt-vt)*et,(zt+pt)*nt,(Nt-lt)*et,(zt+Ct)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et,(zt-pt)*nt,(Nt-lt)*et,(zt-Ct)*nt,(Nt-vt)*et,(zt-pt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Nt+lt)*et,zt*nt,(Nt+vt)*et,(zt-pt)*nt,(Nt+lt)*et,(zt-Ct)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et,(zt+pt)*nt,(Nt+lt)*et,(zt+Ct)*nt,(Nt+vt)*et,(zt+pt)*nt));var $t=.05,ee=Zt*$t;Nt=.05,zt=.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)),Nt=.95,zt=.25,te.add(new go.PathSegment(go.PathSegment.Bezier,(Nt+$t)*et,zt*nt,(Nt+ee)*et,(zt-$t)*nt,(Nt+$t)*et,(zt-ee)*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)),$t=.025,ee=Zt*$t,Nt=.825,zt=.35,te.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et,(zt-$t)*nt,(Nt+$t)*et,(zt-ee)*nt,(Nt+ee)*et,(zt-$t)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(Nt-$t)*et,zt*nt,(Nt-ee)*et,(zt-$t)*nt,(Nt-$t)*et,(zt-ee)*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)),$t=.05,ee=Zt*$t,Nt=.5,zt=.7,te.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et,(zt-$t)*nt,(Nt+$t)*et,(zt-ee)*nt,(Nt+ee)*et,(zt-$t)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(Nt-$t)*et,zt*nt,(Nt-ee)*et,(zt-$t)*nt,(Nt-$t)*et,(zt-ee)*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)),$t=.025,ee=Zt*$t,Nt=.175,zt=.35,te.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et,(zt-$t)*nt,(Nt+$t)*et,(zt-ee)*nt,(Nt+ee)*et,(zt-$t)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(Nt-$t)*et,zt*nt,(Nt-ee)*et,(zt-$t)*nt,(Nt-$t)*et,(zt-ee)*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)),$t=.05,ee=Zt*$t,Nt=.05,zt=.25,te.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et,(zt-$t)*nt,(Nt-$t)*et,(zt-ee)*nt,(Nt-ee)*et,(zt-$t)*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 tn("CornerCutoutSize",.2,.1,.9)),go.Shape.defineFigureGenerator("Card",function(Ft,et,nt){var ct=Ft?Ft.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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.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(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.5,pt=Zt*.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 Ct=new go.PathFigure(et,.1*nt,!1);return ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.2*nt,et,(.1+pt)*nt,(.5+lt)*et,.2*nt)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*nt,(.5-lt)*et,.2*nt,0,(.1+pt)*nt)),Ct.add(new go.PathSegment(go.PathSegment.Move,et,.2*nt)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.3*nt,et,(.2+pt)*nt,(.5+lt)*et,.3*nt)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*nt,(.5-lt)*et,.3*nt,0,(.2+pt)*nt)),Ct.add(new go.PathSegment(go.PathSegment.Move,et,.3*nt)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.4*nt,et,(.3+pt)*nt,(.5+lt)*et,.4*nt)),Ct.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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.5,pt=Zt*.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 Ct=new go.PathFigure(et,.1*nt,!1);return ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.2*nt,et,(.1+pt)*nt,(.5+lt)*et,.2*nt)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*nt,(.5-lt)*et,.2*nt,0,(.1+pt)*nt)),Ct.add(new go.PathSegment(go.PathSegment.Move,et,.2*nt)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.3*nt,et,(.2+pt)*nt,(.5+lt)*et,.3*nt)),Ct.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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.parameter1:NaN;isNaN(lt)?lt=.2:lt<.15&&(lt=.15);var pt=Zt*.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 Ct=new go.PathFigure(0,lt*nt,!1);return ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,et,lt*nt)),ct}),go.Shape.defineFigureGenerator("DividedProcess",function(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.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(Ft,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(Ft,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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.parameter1:NaN,pt=Ft?Ft.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 Ct=new go.PathFigure(lt*et,0,!1);return ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,lt*et,nt)),Ct.add(new go.PathSegment(go.PathSegment.Move,0,pt*nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,et,pt*nt)),ct}),go.Shape.defineFigureGenerator("Junction",function(Ft,et,nt){var ct=new go.Geometry,lt=1/Math.SQRT2,pt=(1-1/Math.SQRT2)/2,vt=Zt*.5,Ct=.5,Nt=new go.PathFigure(et,Ct*nt,!0);ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,Ct*et,nt,et,(Ct+vt)*nt,(Ct+vt)*et,nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,0,Ct*nt,(Ct-vt)*et,nt,0,(Ct+vt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,Ct*et,0,0,(Ct-vt)*nt,(Ct-vt)*et,0)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,et,Ct*nt,(Ct+vt)*et,0,et,(Ct-vt)*nt));var zt=new go.PathFigure((pt+lt)*et,(pt+lt)*nt,!1);return ct.add(zt),zt.add(new go.PathSegment(go.PathSegment.Line,pt*et,pt*nt)),zt.add(new go.PathSegment(go.PathSegment.Move,pt*et,(pt+lt)*nt)),zt.add(new go.PathSegment(go.PathSegment.Line,(pt+lt)*et,pt*nt)),ct}),go.Shape.defineFigureGenerator("LinedDocument",function(Ft,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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.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(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.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(Ft,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(Ft,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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.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 Ct=new go.PathFigure(.5*lt*et,lt*nt,!1);return ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,(1-.5*lt)*et,lt*nt)),ct}),go.Shape.defineFigureGenerator("OffPageConnector",function(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.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 Ct=new go.PathFigure(et,.5*nt,!1);return ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,0,.5*nt)),Ct.add(new go.PathSegment(go.PathSegment.Move,.5*et,nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.5*et,0)),ct}),go.Shape.defineFigureGenerator("PaperTape",function(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.parameter1:NaN,pt=Ft?Ft.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(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.parameter1:NaN,pt=Ft?Ft.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(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.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(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Ft?Ft.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(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.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 Ct=new go.PathFigure(et,pt*nt,!1);ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,et,pt*nt));var Nt=new go.PathFigure(.8*et,.75*nt,!1);return ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.25*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.25*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.6*et,.75*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.75*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.4*et,.25*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.25*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,.2*et,.75*nt)),ct}),go.Shape.defineFigureGenerator("Ground",function(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.1,pt=.1,vt=.9,Ct=.5,Nt=new go.PathFigure(.8*et,.5*nt,!0);ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Line,0,nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,0,0)),Nt.add(new go.PathSegment(go.PathSegment.Line,.8*et,.5*nt));var zt=new go.PathFigure((vt+pt)*et,Ct*nt,!0);return ct.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt,(vt+lt)*et,(Ct+pt)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Ct*nt,(vt-lt)*et,(Ct+pt)*nt,(vt-pt)*et,(Ct+lt)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct-pt)*nt,(vt-pt)*et,(Ct-lt)*nt,(vt-lt)*et,(Ct-pt)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Ct*nt,(vt+lt)*et,(Ct-pt)*nt,(vt+pt)*et,(Ct-lt)*nt)),ct.spot1=new go.Spot(0,.25),ct.spot2=new go.Spot(.4,.75),ct}),go.Shape.defineFigureGenerator("NandGate",function(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.5,pt=Zt*.4,vt=Zt*.1,Ct=.1,Nt=.9,zt=.5,Ht=new go.PathFigure(.8*et,.5*nt,!0);ct.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,.4*et,nt,.8*et,(.5+pt)*nt,(.4+lt)*et,nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,0,nt)),Ht.add(new go.PathSegment(go.PathSegment.Line,0,0)),Ht.add(new go.PathSegment(go.PathSegment.Line,.4*et,0)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.5*nt,(.4+lt)*et,0,.8*et,(.5-pt)*nt));var $t=new go.PathFigure((Nt+Ct)*et,zt*nt,!0);return ct.add($t),$t.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et,(zt+Ct)*nt,(Nt+Ct)*et,(zt+vt)*nt,(Nt+vt)*et,(zt+Ct)*nt)),$t.add(new go.PathSegment(go.PathSegment.Bezier,(Nt-Ct)*et,zt*nt,(Nt-vt)*et,(zt+Ct)*nt,(Nt-Ct)*et,(zt+vt)*nt)),$t.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et,(zt-Ct)*nt,(Nt-Ct)*et,(zt-vt)*nt,(Nt-vt)*et,(zt-Ct)*nt)),$t.add(new go.PathSegment(go.PathSegment.Bezier,(Nt+Ct)*et,zt*nt,(Nt+vt)*et,(zt-Ct)*nt,(Nt+Ct)*et,(zt-vt)*nt)),ct.spot1=new go.Spot(0,.05),ct.spot2=new go.Spot(.55,.95),ct}),go.Shape.defineFigureGenerator("NorGate",function(Ft,et,nt){var ct=new go.Geometry,lt=.5,pt=Zt*lt,vt=0,Ct=.5,Nt=new go.PathFigure(.8*et,.5*nt,!0);ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt,.7*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*et,.75*nt,.25*et,.25*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.5*nt,(vt+pt)*et,(Ct-lt)*nt,.7*et,(Ct-pt)*nt)),lt=.1,pt=Zt*.1,vt=.9,Ct=.5;var zt=new go.PathFigure((vt-lt)*et,Ct*nt,!0);return ct.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct-lt)*nt,(vt-lt)*et,(Ct-pt)*nt,(vt-pt)*et,(Ct-lt)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,Ct*nt,(vt+pt)*et,(Ct-lt)*nt,(vt+lt)*et,(Ct-pt)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+lt)*nt,(vt+lt)*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,Ct*nt,(vt-pt)*et,(Ct+lt)*nt,(vt-lt)*et,(Ct+pt)*nt)),ct.spot1=new go.Spot(.2,.25),ct.spot2=new go.Spot(.6,.75),ct}),go.Shape.defineFigureGenerator("OrGate",function(Ft,et,nt){var ct=new go.Geometry,lt=.5,pt=Zt*lt,vt=0,Ct=.5,Nt=new go.PathFigure(0,0,!0);return ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,(vt+pt+pt)*et,(Ct-lt)*nt,.8*et,(Ct-pt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,0,nt,.8*et,(Ct+pt)*nt,(vt+pt+pt)*et,(Ct+lt)*nt)),Nt.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(Ft,et,nt){var ct=new go.Geometry,lt=.5,pt=Zt*lt,vt=.2,Ct=.5,Nt=new go.PathFigure(.1*et,0,!1);ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,.1*et,nt,.35*et,.25*nt,.35*et,.75*nt));var zt=new go.PathFigure(.8*et,.5*nt,!0);ct.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,.2*et,nt,.7*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,.2*et,0,.45*et,.75*nt,.45*et,.25*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,.8*et,.5*nt,(vt+pt)*et,(Ct-lt)*nt,.7*et,(Ct-pt)*nt)),lt=.1,pt=Zt*.1,vt=.9,Ct=.5;var Ht=new go.PathFigure((vt-lt)*et,Ct*nt,!0);return ct.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct-lt)*nt,(vt-lt)*et,(Ct-pt)*nt,(vt-pt)*et,(Ct-lt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,Ct*nt,(vt+pt)*et,(Ct-lt)*nt,(vt+lt)*et,(Ct-pt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+lt)*nt,(vt+lt)*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,Ct*nt,(vt-pt)*et,(Ct+lt)*nt,(vt-lt)*et,(Ct+pt)*nt)),ct.spot1=new go.Spot(.4,.25),ct.spot2=new go.Spot(.65,.75),ct}),go.Shape.defineFigureGenerator("XorGate",function(Ft,et,nt){var ct=new go.Geometry,lt=.5,pt=Zt*lt,vt=.2,Ct=.5,Nt=new go.PathFigure(.1*et,0,!1);ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,.1*et,nt,.35*et,.25*nt,.35*et,.75*nt));var zt=new go.PathFigure(.2*et,0,!0);return ct.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,et,.5*nt,(vt+pt)*et,(Ct-lt)*nt,.9*et,(Ct-pt)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,.2*et,nt,.9*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt)),zt.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(Ft,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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.1,pt=.1,vt=.1,Ct=.5,Nt=new go.PathFigure((vt-lt*.5)*et,nt,!1);return ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,0,(vt-lt)*et,nt,(vt-pt)*et,0)),vt=.3,Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,nt,(vt+pt)*et,0,(vt+lt)*et,nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,0,(vt-lt)*et,nt,(vt-pt)*et,0)),vt=.5,Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,nt,(vt+pt)*et,0,(vt+lt)*et,nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,0,(vt-lt)*et,nt,(vt-pt)*et,0)),vt=.7,Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,nt,(vt+pt)*et,0,(vt+lt)*et,nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,0,(vt-lt)*et,nt,(vt-pt)*et,0)),vt=.9,Nt.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(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.5,pt=.5,vt=.5,Ct=.5,Nt=new go.PathFigure((vt-pt)*et,Ct*nt,!1);return ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct-pt)*nt,(vt-pt)*et,(Ct-lt)*nt,(vt-lt)*et,(Ct-pt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Ct*nt,(vt+lt)*et,(Ct-pt)*nt,(vt+pt)*et,(Ct-lt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt,(vt+lt)*et,(Ct+pt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Ct*nt,(vt-lt)*et,(Ct+pt)*nt,(vt-pt)*et,(Ct+lt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Move,(vt-pt+.1)*et,Ct*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt-.1)*et,Ct*nt,vt*et,(Ct-pt)*nt,vt*et,(Ct+pt)*nt)),ct}),go.Shape.defineFigureGenerator("DCvoltageSource",function(Ft,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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=et,pt=nt;et=et*.38,nt=nt*.6;var vt=Zt*.8,Ct=.8,Nt=0,zt=.5,Ht=(lt-et)/2,$t=(pt-nt)/2,ee=new go.PathFigure(Nt*et+Ht,(zt+Ct)*nt+$t,!0);ct.add(ee),ee.add(new go.PathSegment(go.PathSegment.Bezier,(Nt-Ct)*et+Ht,zt*nt+$t,(Nt-vt)*et+Ht,(zt+Ct)*nt+$t,(Nt-Ct)*et+Ht,(zt+vt)*nt+$t)),ee.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et+Ht,(zt-Ct)*nt+$t,(Nt-Ct)*et+Ht,(zt-vt)*nt+$t,(Nt-vt)*et+Ht,(zt-Ct)*nt+$t)),ee.add(new go.PathSegment(go.PathSegment.Bezier,(Nt-Ct+vt*.5)*et+Ht,zt*nt+$t,Nt*et+Ht,(zt-Ct)*nt+$t,(Nt-Ct+vt*.5)*et+Ht,(zt-vt)*nt+$t)),ee.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et+Ht,(zt+Ct)*nt+$t,(Nt-Ct+vt*.5)*et+Ht,(zt+vt)*nt+$t,Nt*et+Ht,(zt+Ct)*nt+$t).close()),vt=Zt*.4,Ct=.4,Nt=.2,zt=.5;var te=new go.PathFigure(Nt*et+Ht,(zt+Ct)*nt+$t,!0);ct.add(te),te.add(new go.PathSegment(go.PathSegment.Bezier,(Nt-Ct)*et+Ht,zt*nt+$t,(Nt-vt)*et+Ht,(zt+Ct)*nt+$t,(Nt-Ct)*et+Ht,(zt+vt)*nt+$t)),te.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et+Ht,(zt-Ct)*nt+$t,(Nt-Ct)*et+Ht,(zt-vt)*nt+$t,(Nt-vt)*et+Ht,(zt-Ct)*nt+$t)),te.add(new go.PathSegment(go.PathSegment.Bezier,(Nt-Ct+vt*.5)*et+Ht,zt*nt+$t,Nt*et+Ht,(zt-Ct)*nt+$t,(Nt-Ct+vt*.5)*et+Ht,(zt-vt)*nt+$t)),te.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et+Ht,(zt+Ct)*nt+$t,(Nt-Ct+vt*.5)*et+Ht,(zt+vt)*nt+$t,Nt*et+Ht,(zt+Ct)*nt+$t).close()),vt=Zt*.2,Ct=.2,Nt=.5,zt=.5;var Ae=new go.PathFigure((Nt-Ct)*et+Ht,zt*nt+$t,!0);ct.add(Ae),Ae.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et+Ht,(zt-Ct)*nt+$t,(Nt-Ct)*et+Ht,(zt-vt)*nt+$t,(Nt-vt)*et+Ht,(zt-Ct)*nt+$t)),Ae.add(new go.PathSegment(go.PathSegment.Bezier,(Nt+Ct)*et+Ht,zt*nt+$t,(Nt+vt)*et+Ht,(zt-Ct)*nt+$t,(Nt+Ct)*et+Ht,(zt-vt)*nt+$t)),Ae.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et+Ht,(zt+Ct)*nt+$t,(Nt+Ct)*et+Ht,(zt+vt)*nt+$t,(Nt+vt)*et+Ht,(zt+Ct)*nt+$t)),Ae.add(new go.PathSegment(go.PathSegment.Bezier,(Nt-Ct)*et+Ht,zt*nt+$t,(Nt-vt)*et+Ht,(zt+Ct)*nt+$t,(Nt-Ct)*et+Ht,(zt+vt)*nt+$t)),vt=Zt*.4,Ct=.4,Nt=.8,zt=.5;var se=new go.PathFigure(Nt*et+Ht,(zt-Ct)*nt+$t,!0);ct.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,(Nt+Ct)*et+Ht,zt*nt+$t,(Nt+vt)*et+Ht,(zt-Ct)*nt+$t,(Nt+Ct)*et+Ht,(zt-vt)*nt+$t)),se.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et+Ht,(zt+Ct)*nt+$t,(Nt+Ct)*et+Ht,(zt+vt)*nt+$t,(Nt+vt)*et+Ht,(zt+Ct)*nt+$t)),se.add(new go.PathSegment(go.PathSegment.Bezier,(Nt+Ct-vt*.5)*et+Ht,zt*nt+$t,Nt*et+Ht,(zt+Ct)*nt+$t,(Nt+Ct-vt*.5)*et+Ht,(zt+vt)*nt+$t)),se.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et+Ht,(zt-Ct)*nt+$t,(Nt+Ct-vt*.5)*et+Ht,(zt-vt)*nt+$t,Nt*et+Ht,(zt-Ct)*nt+$t).close()),vt=Zt*.8,Ct=.8,Nt=1,zt=.5;var Re=new go.PathFigure(Nt*et+Ht,(zt-Ct)*nt+$t,!0);return ct.add(Re),Re.add(new go.PathSegment(go.PathSegment.Bezier,(Nt+Ct)*et+Ht,zt*nt+$t,(Nt+vt)*et+Ht,(zt-Ct)*nt+$t,(Nt+Ct)*et+Ht,(zt-vt)*nt+$t)),Re.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et+Ht,(zt+Ct)*nt+$t,(Nt+Ct)*et+Ht,(zt+vt)*nt+$t,(Nt+vt)*et+Ht,(zt+Ct)*nt+$t)),Re.add(new go.PathSegment(go.PathSegment.Bezier,(Nt+Ct-vt*.5)*et+Ht,zt*nt+$t,Nt*et+Ht,(zt+Ct)*nt+$t,(Nt+Ct-vt*.5)*et+Ht,(zt+vt)*nt+$t)),Re.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et+Ht,(zt-Ct)*nt+$t,(Nt+Ct-vt*.5)*et+Ht,(zt-vt)*nt+$t,Nt*et+Ht,(zt-Ct)*nt+$t).close()),ct}),go.Shape.defineFigureGenerator("Email",function(Ft,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(Ft,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 Ct=new go.PathFigure(0,.5*nt,!1);return ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,et,.5*nt)),Ct.add(new go.PathSegment(go.PathSegment.Move,.5*et,.5*nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.5*et,.4*nt)),Ct.add(new go.PathSegment(go.PathSegment.Move,.75*et,.5*nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.75*et,.6*nt)),Ct.add(new go.PathSegment(go.PathSegment.Move,.25*et,.5*nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.25*et,.6*nt)),ct}),go.Shape.defineFigureGenerator("Power",function(Ft,et,nt){var ct=new go.Geometry,lt=Zt*.4,pt=.4,vt=.5,Ct=.5,Nt=St(),zt=St(),Ht=St(),$t=St();$e(vt,Ct-pt,vt+lt,Ct-pt,vt+pt,Ct-lt,vt+pt,Ct,.5,Nt,Nt,zt,Ht,$t);var ee=Kt(zt.x,zt.y),te=new go.PathFigure(zt.x*et,zt.y*nt,!0);ct.add(te),te.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Ct*nt,Ht.x*et,Ht.y*nt,$t.x*et,$t.y*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt,(vt+lt)*et,(Ct+pt)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Ct*nt,(vt-lt)*et,(Ct+pt)*nt,(vt-pt)*et,(Ct+lt)*nt)),$e(vt-pt,Ct,vt-pt,Ct-lt,vt-lt,Ct-pt,vt,Ct-pt,.5,Ht,$t,zt,Nt,Nt),te.add(new go.PathSegment(go.PathSegment.Bezier,zt.x*et,zt.y*nt,Ht.x*et,Ht.y*nt,$t.x*et,$t.y*nt)),lt=Zt*.3,pt=.3,$e(vt-pt,Ct,vt-pt,Ct-lt,vt-lt,Ct-pt,vt,Ct-pt,.5,Ht,$t,zt,Nt,Nt),te.add(new go.PathSegment(go.PathSegment.Line,zt.x*et,zt.y*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*et,Ct*nt,$t.x*et,$t.y*nt,Ht.x*et,Ht.y*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+pt)*nt,(vt-pt)*et,(Ct+lt)*nt,(vt-lt)*et,(Ct+pt)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*et,Ct*nt,(vt+lt)*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt)),$e(vt,Ct-pt,vt+lt,Ct-pt,vt+pt,Ct-lt,vt+pt,Ct,.5,Nt,Nt,zt,Ht,$t),te.add(new go.PathSegment(go.PathSegment.Bezier,zt.x*et,zt.y*nt,$t.x*et,$t.y*nt,Ht.x*et,Ht.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()),de(Nt),de(zt),de(Ht),de($t),de(ee),ct.spot1=new go.Spot(.25,.45),ct.spot2=new go.Spot(.75,.8),ct}),go.Shape.defineFigureGenerator("Fallout",function(Ft,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,Ct,Nt){vt.add(new go.PathSegment(go.PathSegment.Move,(.3+Ct)*et,(.8+Nt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,(.5+Ct)*et,(.5+Nt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,(.1+Ct)*et,(.5+Nt)*nt)),vt.add(new go.PathSegment(go.PathSegment.Line,(.3+Ct)*et,(.8+Nt)*nt).close())}return pt(lt,0,0),pt(lt,.4,0),pt(lt,.2,-.3),ct}),go.Shape.defineFigureGenerator("IrritationHazard",function(Ft,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(Ft,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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=.5,pt=0,vt=0,Ct=lt*Zt,Nt=.4*Math.SQRT2/2+.5,zt=.5-.5*Math.SQRT2/2,Ht=1,$t=.5,ee=.5,te=0,Ae=new go.PathFigure(Nt*et,(1-zt)*nt,!1);return ct.add(Ae),Ae.add(new go.PathSegment(go.PathSegment.Bezier,Ht*et,$t*nt,Ht*et,.7*nt,Ht*et,$t*nt)),Ae.add(new go.PathSegment(go.PathSegment.Bezier,(ee+pt)*et,(te+pt)*nt,(.5+lt+pt)*et,(.5-Ct+pt)*nt,(.5+Ct+pt)*et,(.5-lt+pt)*nt)),Ae.add(new go.PathSegment(go.PathSegment.Bezier,(.5-lt+pt)*et,(.5+vt)*nt,(.5-Ct+pt)*et,(.5-lt+vt)*nt,(.5-lt+pt)*et,(.5-Ct+vt)*nt)),Ae.add(new go.PathSegment(go.PathSegment.Bezier,(.35+pt)*et,.9*nt,(.5-lt+pt)*et,(.5+Ct+vt)*nt,(.5-Ct+pt)*et,.9*nt)),Ae.add(new go.PathSegment(go.PathSegment.Move,(.25+pt)*et,.8*nt)),Ae.add(new go.PathSegment(go.PathSegment.Line,(.35+pt)*et,.9*nt)),Ae.add(new go.PathSegment(go.PathSegment.Line,(.2+pt)*et,.95*nt)),ct}),go.Shape.defineFigureGenerator("BpmnActivityParallel",function(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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,Ct=.5,Nt=vt,zt=Math.PI/4,Ht=4*(1-Math.cos(zt))/(3*Math.sin(zt)),$t=Ht*.5,ee=vt,te=vt,Ae=Ht*ee,se=Ht*te;pt.add(new go.PathSegment(go.PathSegment.Bezier,(Ct-ee)*et,Nt*nt,(Ct-(Ae+ee)/2)*et,(Nt+(te+se)/2)*nt,(Ct-ee)*et,(Nt+se)*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,Ct*et,(Nt-te)*nt,(Ct-ee)*et,(Nt-se)*nt,(Ct-Ae)*et,(Nt-te)*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,(Ct+ee)*et,Nt*nt,(Ct+Ae)*et,(Nt-te)*nt,(Ct+ee)*et,(Nt-se)*nt)),pt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.365)*et,(1-.595)*nt,(Ct+ee)*et,(Nt+se)*nt,(Ct+(Ae+ee)/2)*et,(Nt+(te+se)/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 Re=new go.PathFigure(.2*et,nt,!1);ct.add(Re),Re.add(new go.PathSegment(go.PathSegment.Line,.2*et,.8*nt));var He=new go.PathFigure(.8*et,nt,!1);return ct.add(He),He.add(new go.PathSegment(go.PathSegment.Line,.8*et,.8*nt)),ct}),go.Shape.defineFigureGenerator("BpmnEventConditional",function(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=.5,pt=Zt*.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 Ct=new go.PathFigure(lt*et,0,!1);return ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,lt*et,.15*nt)),Ct.add(new go.PathSegment(go.PathSegment.Move,lt*et,nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,lt*et,.85*nt)),Ct.add(new go.PathSegment(go.PathSegment.Move,0,lt*nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.15*et,lt*nt)),Ct.add(new go.PathSegment(go.PathSegment.Move,et,lt*nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.85*et,lt*nt)),Ct.add(new go.PathSegment(go.PathSegment.Move,lt*et,lt*nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.58*et,.1*nt)),Ct.add(new go.PathSegment(go.PathSegment.Move,lt*et,lt*nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.78*et,.54*nt)),ct}),go.Shape.defineFigureGenerator("Package",function(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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,Ct=Zt*.1,Nt=.2,zt=.9,Ht=new go.PathFigure((Nt-vt)*et,zt*nt,!0);ct.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et,(zt-vt)*nt,(Nt-vt)*et,(zt-Ct)*nt,(Nt-Ct)*et,(zt-vt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Nt+vt)*et,zt*nt,(Nt+Ct)*et,(zt-vt)*nt,(Nt+vt)*et,(zt-Ct)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et,(zt+vt)*nt,(Nt+vt)*et,(zt+Ct)*nt,(Nt+Ct)*et,(zt+vt)*nt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Nt-vt)*et,zt*nt,(Nt-Ct)*et,(zt+vt)*nt,(Nt-vt)*et,(zt+Ct)*nt).close()),vt=.1,Ct=Zt*.1,Nt=.8,zt=.9;var $t=new go.PathFigure((Nt-vt)*et,zt*nt,!0);return ct.add($t),$t.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et,(zt-vt)*nt,(Nt-vt)*et,(zt-Ct)*nt,(Nt-Ct)*et,(zt-vt)*nt)),$t.add(new go.PathSegment(go.PathSegment.Bezier,(Nt+vt)*et,zt*nt,(Nt+Ct)*et,(zt-vt)*nt,(Nt+vt)*et,(zt-Ct)*nt)),$t.add(new go.PathSegment(go.PathSegment.Bezier,Nt*et,(zt+vt)*nt,(Nt+vt)*et,(zt+Ct)*nt,(Nt+Ct)*et,(zt+vt)*nt)),$t.add(new go.PathSegment(go.PathSegment.Bezier,(Nt-vt)*et,zt*nt,(Nt-Ct)*et,(zt+vt)*nt,(Nt-vt)*et,(zt+Ct)*nt).close()),ct}),go.Shape.defineFigureGenerator("KanbanPost",function(Ft,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(Ft,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 Ct=new go.PathFigure(.5*et,.7*nt,!1);ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,et,.7*nt));var Nt=.1,zt=Zt*.1,Ht=.1,$t=.9,ee=new go.PathFigure((Ht-Nt)*et,$t*nt,!0);ct.add(ee),ee.add(new go.PathSegment(go.PathSegment.Bezier,Ht*et,($t-Nt)*nt,(Ht-Nt)*et,($t-zt)*nt,(Ht-zt)*et,($t-Nt)*nt)),ee.add(new go.PathSegment(go.PathSegment.Bezier,(Ht+Nt)*et,$t*nt,(Ht+zt)*et,($t-Nt)*nt,(Ht+Nt)*et,($t-zt)*nt)),ee.add(new go.PathSegment(go.PathSegment.Bezier,Ht*et,($t+Nt)*nt,(Ht+Nt)*et,($t+zt)*nt,(Ht+zt)*et,($t+Nt)*nt)),ee.add(new go.PathSegment(go.PathSegment.Bezier,(Ht-Nt)*et,$t*nt,(Ht-zt)*et,($t+Nt)*nt,(Ht-Nt)*et,($t+zt)*nt)),Nt=.1,zt=Zt*.1,Ht=.4,$t=.9;var te=new go.PathFigure((Ht-Nt)*et,$t*nt,!0);return ct.add(te),te.add(new go.PathSegment(go.PathSegment.Bezier,Ht*et,($t-Nt)*nt,(Ht-Nt)*et,($t-zt)*nt,(Ht-zt)*et,($t-Nt)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(Ht+Nt)*et,$t*nt,(Ht+zt)*et,($t-Nt)*nt,(Ht+Nt)*et,($t-zt)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,Ht*et,($t+Nt)*nt,(Ht+Nt)*et,($t+zt)*nt,(Ht+zt)*et,($t+Nt)*nt)),te.add(new go.PathSegment(go.PathSegment.Bezier,(Ht-Nt)*et,$t*nt,(Ht-zt)*et,($t+Nt)*nt,(Ht-Nt)*et,($t+zt)*nt)),ct}),go.Shape.defineFigureGenerator("RailShipment",function(Ft,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 Ht=.05,$t=Zt*.05,ee=.175,te=.95,Ct=new go.PathFigure((ee-Ht)*et,te*nt,!0);ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,ee*et,(te-Ht)*nt,(ee-Ht)*et,(te-$t)*nt,(ee-$t)*et,(te-Ht)*nt)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,(ee+Ht)*et,te*nt,(ee+$t)*et,(te-Ht)*nt,(ee+Ht)*et,(te-$t)*nt)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,ee*et,(te+Ht)*nt,(ee+Ht)*et,(te+$t)*nt,(ee+$t)*et,(te+Ht)*nt)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,(ee-Ht)*et,te*nt,(ee-$t)*et,(te+Ht)*nt,(ee-Ht)*et,(te+$t)*nt));var Ht=.05,$t=Zt*.05,ee=.375,te=.95,Nt=new go.PathFigure((ee-Ht)*et,te*nt,!0);ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,ee*et,(te-Ht)*nt,(ee-Ht)*et,(te-$t)*nt,(ee-$t)*et,(te-Ht)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(ee+Ht)*et,te*nt,(ee+$t)*et,(te-Ht)*nt,(ee+Ht)*et,(te-$t)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,ee*et,(te+Ht)*nt,(ee+Ht)*et,(te+$t)*nt,(ee+$t)*et,(te+Ht)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(ee-Ht)*et,te*nt,(ee-$t)*et,(te+Ht)*nt,(ee-Ht)*et,(te+$t)*nt));var Ht=.05,$t=Zt*.05,ee=.625,te=.95,zt=new go.PathFigure((ee-Ht)*et,te*nt,!0);ct.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,ee*et,(te-Ht)*nt,(ee-Ht)*et,(te-$t)*nt,(ee-$t)*et,(te-Ht)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(ee+Ht)*et,te*nt,(ee+$t)*et,(te-Ht)*nt,(ee+Ht)*et,(te-$t)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,ee*et,(te+Ht)*nt,(ee+Ht)*et,(te+$t)*nt,(ee+$t)*et,(te+Ht)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(ee-Ht)*et,te*nt,(ee-$t)*et,(te+Ht)*nt,(ee-Ht)*et,(te+$t)*nt));var Ht=.05,$t=Zt*.05,ee=.825,te=.95,Ae=new go.PathFigure((ee-Ht)*et,te*nt,!0);ct.add(Ae),Ae.add(new go.PathSegment(go.PathSegment.Bezier,ee*et,(te-Ht)*nt,(ee-Ht)*et,(te-$t)*nt,(ee-$t)*et,(te-Ht)*nt)),Ae.add(new go.PathSegment(go.PathSegment.Bezier,(ee+Ht)*et,te*nt,(ee+$t)*et,(te-Ht)*nt,(ee+Ht)*et,(te-$t)*nt)),Ae.add(new go.PathSegment(go.PathSegment.Bezier,ee*et,(te+Ht)*nt,(ee+Ht)*et,(te+$t)*nt,(ee+$t)*et,(te+Ht)*nt)),Ae.add(new go.PathSegment(go.PathSegment.Bezier,(ee-Ht)*et,te*nt,(ee-$t)*et,(te+Ht)*nt,(ee-Ht)*et,(te+$t)*nt).close());var se=new go.PathFigure(0,nt,!1);return ct.add(se),se.add(new go.PathSegment(go.PathSegment.Line,et,nt).close()),ct}),go.Shape.defineFigureGenerator("Warehouse",function(Ft,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 Ct=.05,Nt=Zt*.05,zt=.35,Ht=.775,$t=new go.PathFigure((zt-Ct)*et,Ht*nt,!0);return ct.add($t),$t.add(new go.PathSegment(go.PathSegment.Bezier,zt*et,(Ht-Ct)*nt,(zt-Ct)*et,(Ht-Nt)*nt,(zt-Nt)*et,(Ht-Ct)*nt)),$t.add(new go.PathSegment(go.PathSegment.Bezier,(zt+Ct)*et,Ht*nt,(zt+Nt)*et,(Ht-Ct)*nt,(zt+Ct)*et,(Ht-Nt)*nt)),$t.add(new go.PathSegment(go.PathSegment.Bezier,zt*et,(Ht+Ct)*nt,(zt+Ct)*et,(Ht+Nt)*nt,(zt+Nt)*et,(Ht+Ct)*nt)),$t.add(new go.PathSegment(go.PathSegment.Bezier,(zt-Ct)*et,Ht*nt,(zt-Nt)*et,(Ht+Ct)*nt,(zt-Ct)*et,(Ht+Nt)*nt).close()),ct}),go.Shape.defineFigureGenerator("ControlCenter",function(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=.3,pt=Zt*.3,vt=.5,Ct=.7,Nt=new go.PathFigure((vt-lt)*et,Ct*nt,!0);ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct-lt)*nt,(vt-lt)*et,(Ct-pt)*nt,(vt-pt)*et,(Ct-lt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,Ct*nt,(vt+pt)*et,(Ct-lt)*nt,(vt+lt)*et,(Ct-pt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+lt)*nt,(vt+lt)*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,Ct*nt,(vt-pt)*et,(Ct+lt)*nt,(vt-lt)*et,(Ct+pt)*nt));var zt=new go.PathFigure(0,.7*nt,!1);return ct.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,et,.7*nt,0,0,et,0)),ct}),go.Shape.defineFigureGenerator("TripleFanBlades",function(Ft,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(Ft,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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=.5,pt=Zt*.5,vt=.5,Ct=.5,Nt=new go.PathFigure((vt-lt)*et,Ct*nt,!0);ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct-lt)*nt,(vt-lt)*et,(Ct-pt)*nt,(vt-pt)*et,(Ct-lt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,Ct*nt,(vt+pt)*et,(Ct-lt)*nt,(vt+lt)*et,(Ct-pt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+lt)*nt,(vt+lt)*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,Ct*nt,(vt-pt)*et,(Ct+lt)*nt,(vt-lt)*et,(Ct+pt)*nt));var zt=new go.PathFigure(.15*et,.5*nt,!1);return ct.add(zt),zt.add(new go.PathSegment(go.PathSegment.Line,.85*et,.5*nt)),ct}),go.Shape.defineFigureGenerator("Flag",function(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=.5,pt=Zt*.5,vt=.5,Ct=.5,Nt=new go.PathFigure((vt-lt)*et,Ct*nt,!1);ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct-lt)*nt,(vt-lt)*et,(Ct-pt)*nt,(vt-pt)*et,(Ct-lt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,Ct*nt,(vt+pt)*et,(Ct-lt)*nt,(vt+lt)*et,(Ct-pt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+lt)*nt,(vt+lt)*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt)),Nt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,Ct*nt,(vt-pt)*et,(Ct+lt)*nt,(vt-lt)*et,(Ct+pt)*nt).close()),lt=.05,pt=Zt*.05,vt=.5,Ct=.8;var zt=new go.PathFigure((vt-lt)*et,Ct*nt,!1);return ct.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct-lt)*nt,(vt-lt)*et,(Ct-pt)*nt,(vt-pt)*et,(Ct-lt)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*et,Ct*nt,(vt+pt)*et,(Ct-lt)*nt,(vt+lt)*et,(Ct-pt)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*et,(Ct+lt)*nt,(vt+lt)*et,(Ct+pt)*nt,(vt+pt)*et,(Ct+lt)*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*et,Ct*nt,(vt-pt)*et,(Ct+lt)*nt,(vt-lt)*et,(Ct+pt)*nt).close()),zt.add(new go.PathSegment(go.PathSegment.Move,.5*et,.7*nt)),zt.add(new go.PathSegment(go.PathSegment.Line,.5*et,.5*nt)),zt.add(new go.PathSegment(go.PathSegment.Bezier,.5*et,.2*nt,.75*et,.475*nt,.75*et,.225*nt)),zt.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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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 Ct=new go.PathFigure(.678*et,.85*nt,!1);ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,.678*et,.45*nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.874*et,.45*nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.874*et,.85*nt).close());var Nt=new go.PathFigure(.5*et,.1*nt,!1);return ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Line,(.046+.15)*et,.3*nt)),Nt.add(new go.PathSegment(go.PathSegment.Line,(1-(.046+.15))*et,.3*nt).close()),ct}),go.Shape.defineFigureGenerator("Staircase",function(Ft,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(Ft,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 Ct=new go.PathFigure(et*.612,nt,!0);ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,et*.612,nt*(1-.184*3))),Ct.add(new go.PathSegment(go.PathSegment.Line,et*.796,nt*(1-.184*4))),Ct.add(new go.PathSegment(go.PathSegment.Line,et*.796,nt*1).close());var Nt=new go.PathFigure(et*.816,nt,!0);return ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Line,et*.816,nt*(1-.184*4))),Nt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*(1-.184*5))),Nt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*1).close()),ct}),go.Shape.defineFigureGenerator("PC",function(Ft,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 Ct=new go.PathFigure(et*.055,.18*nt,!0);ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.18)),Ct.add(new go.PathSegment(go.PathSegment.Line,et*.245,nt*.21)),Ct.add(new go.PathSegment(go.PathSegment.Line,et*.055,nt*.21).close());var Nt=new go.PathFigure(et*1,0,!0);return ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Line,et*.4,0)),Nt.add(new go.PathSegment(go.PathSegment.Line,et*.4,nt*.65)),Nt.add(new go.PathSegment(go.PathSegment.Line,et*1,nt*.65).close()),ct}),go.Shape.defineFigureGenerator("Plane",function(Ft,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(Ft,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(Ft,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 Ct=new go.PathFigure(et*(.11+.24133333*1+.028*1),nt*.1,!1);ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*2+.028*1),nt*.1)),Ct.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*2+.028*1),nt*.8)),Ct.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*1+.028*1),nt*.8).close());var Nt=new go.PathFigure(et*(.11+.24133333*2+.028*2),nt*.1,!1);return ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*3+.028*2),nt*.1)),Nt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*3+.028*2),nt*.8)),Nt.add(new go.PathSegment(go.PathSegment.Line,et*(.11+.24133333*2+.028*2),nt*.8).close()),ct}),go.Shape.defineFigureGenerator("FloppyDisk",function(Ft,et,nt){var ct=new go.Geometry,lt=8,pt=lt*Zt,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 Ct=new go.PathFigure(et*.83,0,!1);ct.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,et*.83,nt*.3)),Ct.add(new go.PathSegment(go.PathSegment.Line,et*.17,nt*.3)),Ct.add(new go.PathSegment(go.PathSegment.Line,et*.17,nt*0).close());var Nt=new go.PathFigure(et*.83,nt*1,!1);ct.add(Nt),Nt.add(new go.PathSegment(go.PathSegment.Line,et*.83,nt*.5)),Nt.add(new go.PathSegment(go.PathSegment.Line,et*.17,nt*.5)),Nt.add(new go.PathSegment(go.PathSegment.Line,et*.17,nt*1).close());var zt=new go.PathFigure(et*.78,nt*.05,!1);return ct.add(zt),zt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*.05)),zt.add(new go.PathSegment(go.PathSegment.Line,et*.66,nt*.25)),zt.add(new go.PathSegment(go.PathSegment.Line,et*.78,nt*.25).close()),ct}),go.Shape.defineFigureGenerator("SpeechBubble",function(Ft,et,nt){var ct=Ft?Ft.parameter1:NaN;(isNaN(ct)||ct<0)&&(ct=15),ct=Math.min(ct,et/3),ct=Math.min(ct,nt/3);var lt=ct*Zt,pt=nt*.8,vt=new go.Geometry,Ct=new go.PathFigure(ct,0,!0);return vt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,et-ct,0)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,et,ct,et-lt,0,et,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,et,pt-ct)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,et-ct,pt,et,pt-lt,et-lt,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,et*.7,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,et*.7,nt)),Ct.add(new go.PathSegment(go.PathSegment.Line,et*.55,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,ct,pt)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,0,pt-ct,lt,pt,0,pt-lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,ct)),Ct.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(Ft,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(Ft,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(Ft,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(Ft,et,nt){var ct=new go.Geometry,lt=15,pt=lt*Zt,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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(Ft,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")},61016: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 tn={},An="5.0",Kt={},St=null,de=!1,Ie=!1,$e=null,me=!1,re=null,Zt=null,Oe=0;Oe<arguments.length;Oe++){var ue=arguments[Oe];if(ue!==null)switch(typeof ue){case"number":An=ue.toFixed(1);break;case"string":ue.match(new RegExp("^[0-9]\\.[0-9]+$"))?An=ue:$e=ue;break;case"object":typeof ue.is3D!="undefined"?St=ue:Kt=ue;break;case"boolean":de=ue,Ie=!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},Kt.material_id!==void 0&&!Ie&&(de=!0)),$e!==null&&Kt.id===void 0&&(Kt.id=$e);var Se="",Ue="",Ee=!1,Ze=null,Ft=null,et=null,nt=!1,ct=null,lt=null,pt=null,vt=null,Ct=null;Kt.height!==void 0&&(Kt.height=Math.round(Kt.height)),Kt.width!==void 0&&(Kt.width=Math.round(Kt.width));var Nt=function(Le){return parseFloat(Le)>4?parseFloat(Le):5};tn.setHTML5Codebase=function(Le,nn){Zt=Le,Ce(Le,nn)},tn.setJavaCodebase=tn.setJavaCodebaseVersion=tn.isCompiledInstalled=tn.setPreCompiledScriptPath=tn.setPreCompiledResourcePath=function(){},tn.setHTML5CodebaseVersion=function(Le,nn){var hn=parseFloat(Le);if(hn!==NaN&&hn<5){console.log("The GeoGebra HTML5 codebase version "+hn+" is deprecated. Using version latest instead.");return}re=Le,jt(Le,nn)},tn.getHTML5CodebaseVersion=function(){return Ft},tn.getParameters=function(){return Kt},tn.setFontsCSSURL=function(Le){vt=Le},tn.setGiacJSURL=function(Le){},tn.setJNLPFile=function(Le){Se=Le},tn.setJNLPBaseDir=function(Le){},tn.inject=function(){function Le(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var nn="auto",hn=Kt.id,_n,fn=!1,le=0;le<arguments.length;le++){var we=arguments[le];typeof we=="string"?(we=we.toLowerCase(),we.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?nn=we:hn=arguments[le]):typeof we=="boolean"?fn=we:we instanceof HTMLElement&&(_n=we)}Pn();function Pn(){if(!me){setTimeout(Pn,200);return}nn=Ni(nn);var vn=_n||document.getElementById(hn);if(!vn){console.log("possibly bug on ajax loading? ");return}if(tn.removeExistingApplet(vn,!1),Kt.width===void 0&&vn.clientWidth&&(Kt.width=vn.clientWidth),Kt.height===void 0&&vn.clientHeight&&(Kt.height=vn.clientHeight),!(Kt.width&&Kt.height)&&nn==="html5"&&(delete Kt.width,delete Kt.height),Ze=nn,nn==="screenshot")He(vn,Kt);else{var _t=!1;Kt.hasOwnProperty("playButton")&&Kt.playButton||Kt.hasOwnProperty("clickToLoad")&&Kt.clickToLoad?_t=!0:Kt.hasOwnProperty("playButtonAutoDecide")&&Kt.playButtonAutoDecide&&(_t=(!zt()||Le())&&Ht()),_t?(Ze="screenshot",Cn(vn,Kt,fn,nn)):Re(vn,Kt,fn)}}};function zt(){try{return window.self!==window.top}catch(Le){return!0}}function Ht(){return Kt.hasOwnProperty("screenshotGenerator")&&Kt.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}tn.getViews=function(){return St},tn.isJavaInstalled=function(){return!1};var $t=function(Le){var nn=function(le){var we=JSON.parse(le),Pn=function(Mt){return Mt.type=="G"||Mt.type=="E"},vn=we.elements?we.elements.filter(Pn)[0]:we;if(!vn||!vn.url){hn();return}Kt.fileName=vn.url,ee(vn.settings||{}),St.is3D=!0;var _t="https://www.geogebra.org/images/";tn.setPreviewImage(ct||vn.previewUrl,_t+"GeoGebra_loading.png",_t+"applet_play.png"),Le()},hn=function(){Kt.onError&&Kt.onError(),un("Error: Fetching material (id "+Kt.material_id+") failed.",Kt)},_n=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",fn="/materials/"+Kt.material_id+"?scope=basic";te("https://"+_n+"/api/proxy.php?path="+encodeURIComponent(fn),nn,hn)};function ee(Le){var nn=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(hn){Le[hn]=!!Le[hn]}),nn.forEach(function(hn){Kt[hn]===void 0&&Le[hn]!==void 0&&(Kt[hn]=Le[hn])}),Kt.showToolBarHelp===void 0&&(Kt.showToolBarHelp=Kt.showToolBar)}function te(Le,nn,hn){var _n=new XMLHttpRequest;_n.open("GET",Le),_n.onload=function(){nn(_n.responseText)},_n.onerror=hn,_n.send()}tn.isHTML5Installed=function(){return!0},tn.getLoadedAppletType=function(){return Ze},tn.setPreviewImage=function(Le,nn,hn){ct=Le,lt=nn,pt=hn},tn.removeExistingApplet=function(Le,nn){var hn;typeof Le=="string"&&(Le=document.getElementById(Le)),Ze=null;var _n=null;for(hn=0;hn<Le.childNodes.length;hn++){var fn=Le.childNodes[hn],le=fn.className;le==="applet_screenshot"?nn?(fn.style.display="block",Ze="screenshot"):fn.style.display="none":le!=="applet_scaler prerender"&&(Le.removeChild(fn),_n=le&&le.indexOf("appletParameters")!=-1?fn.id:null,hn--)}var we=Kt.id!==void 0?Kt.id:_n,Pn=window[we];Pn&&typeof Pn.getBase64=="function"&&(Pn.remove(),window[we]=null)},tn.refreshHitPoints=function(){if(Nt(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Le=tn.getAppletObject();return Le&&typeof Le.recalculateEnvironments=="function"?(Le.recalculateEnvironments(),!0):!1},tn.startAnimation=function(){var Le=tn.getAppletObject();return Le&&typeof Le.startAnimation=="function"?(Le.startAnimation(),!0):!1},tn.stopAnimation=function(){var Le=tn.getAppletObject();return Le&&typeof Le.stopAnimation=="function"?(Le.stopAnimation(),!0):!1},tn.getAppletObject=function(){var Le=Kt.id!==void 0?Kt.id:"ggbApplet";return window[Le]},tn.resize=function(){};var Ae=function(Le,nn,hn){var _n=document.createElement("param");_n.setAttribute("name",nn),_n.setAttribute("value",hn),Le.appendChild(_n)},se=function(Le){return Le&&Le!=="false"},Re=function(Le,nn,hn){Nt(Ft)<=4.2&&(hn=!0);var _n=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==Ft||ggbHTML5LoadedCodebaseIsWebSimple&&!nt)&&(_n=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var fn=document.createElement("div");fn.classList.add("appletParameters","notranslate");var le=nn.width,we=nn.height;if(nn.disableAutoScale=nn.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():nn.disableAutoScale,nn.width!==void 0)if(Nt(Ft)<=4.4)se(nn.showToolBar)&&(nn.height-=7),se(nn.showAlgebraInput)&&(nn.height-=37),nn.width<605&&se(nn.showToolBar)&&(nn.width=605,le=605);else{var Pn=100;(se(nn.showToolBar)||se(nn.showMenuBar))&&(nn.hasOwnProperty("customToolBar")&&(nn.customToolbar=nn.customToolBar),Pn=se(nn.showMenuBar)?245:155),le<Pn&&(nn.width=Pn,le=Pn)}fn.style.border="none",fn.style.display="inline-block";for(var vn in nn)nn.hasOwnProperty(vn)&&vn!=="appletOnLoad"&&fn.setAttribute("data-param-"+vn,nn[vn]);vt&&fn.setAttribute("data-param-fontscssurl",vt),tn.resize=function(){GGBAppletUtils.responsiveResize(Le,nn)},window.addEventListener("resize",function(yn){tn.resize()});var _t=typeof nn.appletOnLoad=="function"?nn.appletOnLoad:function(){};if(!hn&&nn.width!==void 0){nn.hasOwnProperty("showSplash")||fn.setAttribute("data-param-showSplash","false");var Mt=Le.querySelector(".applet_scaler.prerender"),Lt=Mt!==null;if(Lt)var At=Mt.querySelector(".ggb_preview");else{var At=Xn(le,we,nn.borderColor,!1);Mt=document.createElement("div"),Mt.className="applet_scaler",Mt.style.position="relative",Mt.style.display="block",Mt.style.width=le+"px",Mt.style.height=we+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Mt,"66%"),Nt(Ft)>=5?(nn.appletOnLoad=function(yn){var Li=Le.querySelector(".ggb_preview");Li&&Li.parentNode.removeChild(Li),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Mt),window.GGBT_wsf_view&&$(window).trigger("resize"),_t(yn)},Lt||Mt.appendChild(At)):fn.appendChild(At),Mt.appendChild(fn),Lt||Le.appendChild(Mt),setTimeout(function(){tn.resize()},1)}else{var Wt=document.createElement("div");Wt.className="applet_scaler",Wt.style.position="relative",Wt.style.display="block",Wt.appendChild(fn),Le.appendChild(Wt),nn.appletOnLoad=function(yn){tn.resize(),_t(yn)}}function Et(yn,Li){Li&&typeof Li.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(yn,Li.appletOnLoad):renderGGBElement(yn),un("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",Li)}function be(yn,Li){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:yn,params:Li}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(yi){Et(yi.article,yi.params)}),html5AppletsToProcess=null)},Nt(Ft)<5&&(yn.className+=" geogebraweb")):Et(yn,Li)}if(_n){scriptLoadStarted=!0;for(var Nn=0;Nn<fn.childNodes.length;Nn++){var mi=fn.childNodes[Nn].tagName;mi==="TABLE"&&(fn.removeChild(fn.childNodes[Nn]),Nn--)}if(ggbHTML5LoadedScript!==null){var On=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');On!=null&&On.parentNode.removeChild(On)}var Gn=document.createElement("script"),Fi=function(){be(fn,nn)};Gn.src=Ue+et,ggbHTML5LoadedCodebaseIsWebSimple=nt,ggbHTML5LoadedCodebaseVersion=Ft,ggbHTML5LoadedScript=Gn.src,un("GeoGebra HTML5 codebase loaded: '"+Ue+"'.",nn),!Zt&&(!re||re=="5.0")?(nt?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),Fi()):Ue.requirejs?__webpack_require__.e(12).then(function(){var yn=[__webpack_require__(12)];Fi.apply(null,yn)}.bind(this)).catch(__webpack_require__.oe):(Gn.onload=Fi,Le.appendChild(Gn))}else be(fn,nn);nn.height=we,nn.width=le},He=function(Le,nn,hn){var _n=Xn(nn.width,nn.height,nn.borderColor,hn),fn=document.createElement("div");fn.style.position="relative",fn.style.display="block",fn.style.width=nn.width+"px",fn.style.height=nn.height+"px",fn.className="applet_screenshot applet_scaler"+(hn?" applet_screenshot_play":""),fn.appendChild(_n);var le=GGBAppletUtils.getScale(nn,Le,hn);hn?(Le.appendChild(Rn()),window.GGBT_wsf_view||(Le.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(fn,"66%"),Le.appendChild(fn),le!==1&&!isNaN(le)&&(GGBAppletUtils.scaleElement(fn,le),fn.style.width=nn.width+"px",fn.style.height=nn.height+"px",fn.parentNode.style.width=nn.width*le+"px",fn.parentNode.style.height=nn.height*le+"px"),tn.resize=function(){ze(Le,_n,fn,hn)},window.addEventListener("resize",function(we){tn.resize()}),tn.resize()};function ze(Le,nn,hn,_n){if(Le.contains(nn)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Le.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Le)}var fn=GGBAppletUtils.getScale(Kt,Le,_n);hn.parentNode!==null&&(!isNaN(fn)&&fn!==1?(GGBAppletUtils.scaleElement(hn,fn),hn.parentNode.style.width=Kt.width*fn+"px",hn.parentNode.style.height=Kt.height*fn+"px"):(GGBAppletUtils.scaleElement(hn,1),hn.parentNode.style.width=Kt.width+"px",hn.parentNode.style.height=Kt.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Le),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}tn.onExitFullscreen=function(Le,nn){nn.appendChild(Le)};var Cn=function(Le,nn,hn,_n){He(Le,nn,!0);for(var fn=function(){var Pn=[];for(we=0;we<Le.childNodes.length;we++)Pn.push(Le.childNodes[we]);if(window.GGBT_wsf_view){var vn=window.GGBT_wsf_view.renderFullScreen(Le,nn.id),_t=document.getElementById("fullscreencontainer"),Mt=jQuery(Le).find(".fullscreencontent");Mt.length>0?(vn.remove(),Mt.attr("id","fullscreencontent").show(),jQuery(_t).append(Mt),window.dispatchEvent(new Event("resize"))):Re(vn,nn,!1),window.GGBT_wsf_view.launchFullScreen(_t)}else Ze=_n,Re(Le,nn,!1);if(!window.GGBT_wsf_view)for(we=0;we<Pn.length;we++)Le.removeChild(Pn[we])},le=Le.getElementsByClassName("ggb_preview_play"),we=0;we<le.length;we++)le[we].addEventListener("click",fn,!1),le[we].addEventListener("ontouchstart",fn,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Le),Ht()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},Rn=function(){var Le=document.createElement("div");if(Le.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var nn='.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");}',hn=document.createElement("style");hn.styleSheet?hn.styleSheet.cssText=nn:hn.appendChild(document.createTextNode(nn)),document.getElementsByTagName("head")[0].appendChild(hn)}return Le},Xn=function(Le,nn,hn,_n){var fn=document.createElement("div");fn.className="ggb_preview",fn.style.position="absolute",fn.style.zIndex="90",fn.style.width=Le-2+"px",fn.style.height=nn-2+"px",fn.style.top="0px",fn.style.left="0px",fn.style.overflow="hidden",fn.style.backgroundColor="white";var le="lightgrey";hn!==void 0&&(hn==="none"?le="transparent":le=hn),fn.style.border="1px solid "+le;var we=document.createElement("img");if(we.style.position="relative",we.style.zIndex="1000",we.style.top="-1px",we.style.left="-1px",ct!==null&&we.setAttribute("src",ct),we.style.opacity=.7,lt!==null){var Pn,vn,_t;if(!_n){Pn=document.createElement("img"),Pn.style.position="absolute",Pn.style.zIndex="1001",Pn.style.opacity=1,we.style.opacity=.3,vn=360,vn>Le/4*3&&(vn=Le/4*3),_t=vn/5.8,Pn.setAttribute("src",lt),Pn.setAttribute("width",vn),Pn.setAttribute("height",_t);var Mt=(Le-vn)/2,Lt=(nn-_t)/2;Pn.style.left=Mt+"px",Pn.style.top=Lt+"px",fn.appendChild(Pn)}}return fn.appendChild(we),fn},Ni=function(Le){return Le=Le.toLowerCase(),Le==="html5"||Le==="screenshot"?Le:"html5"},Yt=["web","webSimple","web3d","tablet","tablet3d","phone"],jt=function(Le,nn){if(Ft=Le,nn){Ce(Ft,!0);return}var hn=!de;if(hn){var _n=Nt(Ft);!isNaN(_n)&&_n<4.4&&(hn=!1)}var fn,le;window.location.protocol.substr(0,4)==="http"?fn=window.location.protocol:fn="http:";var we=Ft.indexOf("//");we>0?le=Ft:we===0?le=fn+Ft:le="https://www.geogebra.org/apps/5.2.814.0/";for(var Pn in Yt)if(Ft.slice(Yt[Pn].length*-1)===Yt[Pn]||Ft.slice((Yt[Pn].length+1)*-1)===Yt[Pn]+"/"){Ce(le,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&hn&&!St.is3D&&!St.AV&&!St.SV&&!St.CV&&!St.EV2&&!St.CP&&!St.PC&&!St.DA&&!St.FI&&!St.PV&&!se(Kt.showToolBar)&&!se(Kt.showMenuBar)&&!se(Kt.showAlgebraInput)&&!se(Kt.enableRightClick)&&(!Kt.appName||Kt.appName=="classic")?le+="webSimple/":le+="web3d/",Ce(le,!1)},Ce=function(Le,nn){if(Le.requirejs){Ue=Le;return}Le.slice(-1)!=="/"&&(Le+="/"),Ue=Le,nn===null&&(nn=Le.indexOf("http")===-1),Ee=nn,et="web.nocache.js",nt=!1;var hn=Ue.split("/");hn.length>1&&(!nn&&hn[hn.length-2]==="webSimple"?(et="webSimple.nocache.js",nt=!0):Yt.indexOf(hn[hn.length-2])>=0&&(et=hn[hn.length-2]+".nocache.js")),hn=Le.split("/"),Ft=hn[hn.length-3],Ft.substr(0,4)==="test"?Ft=Ft.substr(4,1)+"."+Ft.substr(5,1):(Ft.substr(0,3)==="war"||Ft.substr(0,4)==="beta")&&(Ft="5.0");var _n=parseFloat(Ft);_n!==NaN&&_n<5&&Le.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+_n+" is deprecated. Using version latest instead."),jt("5.0",nn))},un=function(Le,nn){window.console&&window.console.log&&(!nn||typeof nn.showLogging=="undefined"||nn.showLogging&&nn.showLogging!=="false")&&console.log(Le)};Kt.material_id!==void 0?$t(Ln):Ln();function Ln(){var Le=An;re!==null?Le=re:parseFloat(Le)<5&&(Le="5.0"),jt(Le,!1),Zt!==null&&Ce(Zt,Ee),me=!0}return tn},GGBAppletUtils=function(){"use strict";function tn(){return window.GGBT_wsf_edit!==void 0}function An(me,re){re!=1?(me.style.transformOrigin="0% 0% 0px",me.style.webkitTransformOrigin="0% 0% 0px",me.style.transform="scale("+re+","+re+")",me.style.webkitTransform="scale("+re+","+re+")",me.style.maxWidth="initial",me.querySelector(".ggb_preview")!==null&&(me.querySelector(".ggb_preview").style.maxWidth="initial"),me.querySelectorAll(".ggb_preview img")[0]!==void 0&&(me.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),me.querySelectorAll(".ggb_preview img")[1]!==void 0&&(me.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(me.style.transform="none",me.style.webkitTransform="none")}function Kt(me,re,Zt,Oe,ue,Se){var Ue=null;if(Se!=null&&Se!="")for(var Ee=me.parentNode;Ee!=null;)if((" "+Ee.className+" ").indexOf(" "+Se+" ")>-1){Ue=Ee;break}else Ee=Ee.parentNode;var Ze=0,Ft=0,et=0,nt=0,ct=0,lt=0,pt=0;if(Ue)Ze=Ue.offsetWidth,Ft=Math.max(Oe?Ue.offsetWidth:0,Ue.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(Ze=Math.min(window.innerWidth,document.documentElement.clientWidth),Ft=Math.min(window.innerHeight,document.documentElement.clientHeight),et=Ze):(Ze=window.innerWidth,Ft=window.innerHeight,et=window.innerWidth),me){var vt=me.getBoundingClientRect();vt.left>0&&vt.left<=Ze&&(ue===void 0||!ue)&&(document.dir==="rtl"?(ct=Ze-vt.width-vt.left,lt=et<=480?10:30):(lt=vt.left,ct=et<=480?10:30),nt=lt+ct)}if(me&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var Ct=me.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(nt=40,pt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(nt=0,pt=40)}}return me&&((Zt===void 0||!Zt)&&re>0&&re+nt<Ze?Ze=re:Ze-=nt,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Zt===void 0||!Zt)&&(Ft-=pt)),{width:Ze,height:Ft}}function St(me,re,Zt,Oe,ue){if(me.isScreenshoGenerator)return 1;var Se=Oe!==void 0&&Oe,Ue=me.noScaleMargin!=null&&me.noScaleMargin,Ee=function(Ct){return Ct&&Ct!=="false"},Ze=Ee(me.autoHeight),Ft=Kt(re,me.width,Zt,Ze,Se&&window.GGBT_wsf_view||Ue,ue),et=parseInt(Ft.width),nt=me.width,ct=me.height;if(nt===void 0){var lt=re.querySelector(".appletParameters");lt&&(nt=lt.offsetWidth,ct=lt.offsetHeight)}var pt=et/nt,vt=Se?1:Ft.height/ct;return Zt!==void 0&&!Zt&&(pt=Math.min(1,pt),vt=Math.min(1,vt)),Math.min(pt,vt)}function de(me,re,Zt){var Oe=1,ue,Se=!1;if(me.hasOwnProperty("allowUpscale")&&(Se=me.allowUpscale),me.hasOwnProperty("scale")&&(Oe=parseFloat(me.scale),(isNaN(Oe)||Oe===null||Oe===0)&&(Oe=1),Oe>1&&(Se=!0)),re&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Se=!0),!(me.hasOwnProperty("disableAutoScale")&&me.disableAutoScale))ue=St(me,re,Se,Zt,me.scaleContainerClass);else return Oe;return Se&&(!me.hasOwnProperty("scale")||Oe===1)?ue:Math.min(Oe,ue)}function Ie(me){var re=Math.min(window.innerWidth,document.documentElement.clientWidth),Zt=Math.min(window.innerHeight,document.documentElement.clientHeight),Oe=me.getBoundingClientRect(),ue=(re-Oe.width)/2,Se=(Zt-Oe.height)/2;Se<0&&(Se=0),me.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(ue<40?me.style.left="40px":me.style.left=ue+"px",me.style.top=Se+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Se<40?me.style.top="40px":me.style.top=Se+"px",me.style.left=ue+"px")}function $e(me,re){var Zt=me.querySelector(".appletParameters");if(Zt){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(re.id!==Zt.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(me)}if(Zt.parentElement&&/fullscreen/.test(Zt.parentElement.className))return;var Oe=de(re,me);tn()&&Zt.setAttribute("data-param-scale",Oe);for(var ue=null,Se=0;Se<me.childNodes.length;Se++)if(me.childNodes[Se].className!==void 0&&me.childNodes[Se].className.match(/^applet_scaler/)){ue=me.childNodes[Se];break}if(ue!==null&&ue.querySelector(".noscale")!==null)return;var Ue=re.id!==void 0?re.id:"ggbApplet",Ee=window[Ue];(Ee==null||!Ee.recalculateEnvironments)&&ue!==null&&!ue.className.match(/fullscreen/)&&(ue.parentNode.style.transform="",!isNaN(Oe)&&Oe!==1?(ue.parentNode.style.width=re.width*Oe+"px",ue.parentNode.style.height=re.height*Oe+"px",An(ue,Oe)):(An(ue,1),ue.parentNode.style.width=re.width+"px",ue.parentNode.style.height=re.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&Ie(me),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(Zt).parents(".content-added-content"))}}return{responsiveResize:$e,isFlexibleWorksheetEditor:tn,positionCenter:Ie,getScale:de,scaleElement:An}}();__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 tn=n.location.search;return tn.indexOf(J)!=-1||tn.indexOf(K)!=-1}function q(tn,An){}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(tn){var An=s[L].bindings;s[L].bindings=function(){for(var Kt=An?An():{},St=tn[webModule.__softPermutationId],de=O;de<St.length;de++){var Ie=St[de];Kt[Ie[O]]=Ie[P]}return Kt}};var t;function u(){return v(),t}function v(){if(!t){var tn=o.createElement(Q);if(tn.id=L,tn.style.cssText=R+S,tn.tabIndex=-1,o.body.appendChild(tn),t=tn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var An=document.compatMode==U?V:W;t.write(An+X),t.close()}}}function w(tn){function An(St){function de(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var Ie=de();if(Ie){St();return}function $e(){if(!Ie){if(!de())return;Ie=!0,St(),o.removeEventListener&&o.removeEventListener(Z,$e,!1),me&&clearInterval(me)}}o.addEventListener&&o.addEventListener(Z,$e,!1);var me=setInterval(function(){$e()},$)}function Kt(St){var de=u(),Ie=de.body,$e=de.createElement(_);$e.language=ab,$e.crossOrigin=W,$e.src=St,webModule.__errFn&&($e.onerror=function(){webModule.__errFn(L,new Error(bb+St))}),Ie.appendChild($e)}An(function(){Kt(tn)})}webModule.__startLoadingFragment=function(tn){return C(tn)},webModule.__installRunAsyncCode=function(tn){var An=u(),Kt=An.body,St=An.createElement(_);St.language=ab,St.text=tn,Kt.appendChild(St),Kt.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(tn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(tn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(tn){var An=c[tn];return An==null?null:An},r=d,webModule.__errFn=e}function B(){function tn(me){var re=me.lastIndexOf(rb);re==-1&&(re=me.length);var Zt=me.indexOf(sb);Zt==-1&&(Zt=me.length);var Oe=me.lastIndexOf(tb,Math.min(Zt,re));return Oe>=O?me.substring(O,Oe+P):W}function An(me){if(!me.match(/^\w+:\/\//)){var re=o.createElement(ub);re.src=me+vb,me=tn(re.src)}return me}function Kt(){var me=__gwt_getMetaProperty(wb);return me!=null?me:W}function St(){for(var me=o.getElementsByTagName(_),re=O;re<me.length;++re)if(me[re].src.indexOf(xb)!=-1)return tn(me[re].src);return W}function de(){var me=o.getElementsByTagName(yb);return me.length>O?me[me.length-P].href:W}function Ie(){var me=o.location;return me.href==me.protocol+zb+me.host+me.pathname+me.search+me.hash}var $e=Kt();return $e==W&&($e=St()),$e==W&&($e=de()),$e==W&&Ie()&&($e=tn(o.location.href)),$e=An($e),$e}function C(tn){return tn.match(/^\//)||tn.match(/^[a-zA-Z]+:\/\//)?tn:webModule.__moduleBase+tn}function D(){var tn=[],An=O,Kt=[],St=[];function de(me){var re=St[me](),Zt=Kt[me];if(re in Zt)return re;var Oe=[];for(var ue in Zt)Oe[Zt[ue]]=ue;throw r&&r(me,Oe,re),null}if(__gwt_isKnownPropertyValue=function(me,re){return re in Kt[me]},webModule.__getPropMap=function(){var me={};for(var re in Kt)Kt.hasOwnProperty(re)&&(me[re]=de(re));return me},webModule.__computePropValue=de,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var Ie;try{Ie=Cb;var $e=Ie.indexOf(Db);$e!=-1&&(An=parseInt(Ie.substring($e+P),$),Ie=Ie.substring(O,$e))}catch(me){}return webModule.__softPermutationId=An,C(Ie+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})()},15476:function(tn,An,Kt){"use strict";Kt.d(An,{Ax:function(){return $e},Ds:function(){return me},KI:function(){return Zt},SI:function(){return Ie},f1:function(){return de}});var St=Kt(11320);function de(Oe){let ue=!0;if(Oe.length>0){for(let Se=0;Se<Oe.length;Se++)if(Oe[Se].compile_success==0||!Oe[Se].compile_success){ue=!1;break}}else ue=!1;return ue}function Ie(Oe,ue=""){let Se=[];for(let Ue=0;Ue<Oe.length;Ue++){let Ee=Oe[Ue],Ze=ue?`${ue}/${Ee.name}`:`${Ee.name}`;Se.push({title:Ee.name,type:Ee.type,isLeaf:Ee.type!=="tree",key:Ze})}return Se}function $e(Oe,ue,Se){for(let Ue=0;Ue<Oe.length;Ue++){let Ee=Oe[Ue];if(Ee.key===ue){Ee.children=Se;break}Ee.children&&$e(Ee.children,ue,Se)}return Oe}function me(Oe,ue,Se){let Ue;return function(){let Ee=this,Ze=arguments,Ft=function(){Ue=null,Se||Oe.apply(Ee,Ze)},et=Se&&!Ue;clearTimeout(Ue),Ue=setTimeout(Ft,ue),et&&Oe.apply(Ee,Ze)}}const re=!0,Zt=St.Z.API_SERVER},73646:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return ue}});var St=Kt(67294),de=Kt(28802),Ie=Kt(66309),$e=Kt(2453),me={flex:"flex___eLcnP",flex1:"flex1___yUTT7",color666:"color666___TiUhG",error:"error___gTTtv",deleteIcon:"deleteIcon___mnZW1",addIcon:"addIcon___JC5NS"},re=Kt(38308);const{TextArea:Zt}=de.default;class Oe extends St.Component{constructor(Ue){super(Ue),this.state={inputVisible:!1,EditInputIndex:-1}}render(){let{index:Ue,onAnswerChange:Ee,addChildAnswer:Ze,exerciseIsPublish:Ft,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:me.flex},St.createElement("div",{className:`${me.color666} mb5 mt6`,style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",Ue+1,"):"),St.createElement("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10}},et==null?void 0:et.map((vt,Ct)=>St.createElement(St.Fragment,null,pt!==Ct?(vt==null?void 0:vt.length)>0?St.createElement(Ie.default,{className:"edit-tag",key:vt,closable:!((et==null?void 0:et.length)===1&&Ct===0),onClose:Nt=>{Nt.preventDefault(),(et==null?void 0:et.length)===1&&Ct===0?this.props.deleteChildAnswermain(Ue,Ct):this.props.deleteChildAnswer(Ue,Ct)}},St.createElement("span",{onDoubleClick:Nt=>{this.setState({EditInputIndex:Ct}),Nt.preventDefault()}},vt)):St.createElement(de.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Nt=>{if(Nt.target.value.replaceAll(" ","").length<=0){$e.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}Ee(Ue,Ct,Nt.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}):St.createElement(de.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Nt=>{if(Nt.target.value.replaceAll(" ","").length<=0){$e.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}Ee(Ue,Ct,Nt.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}))),!lt&&St.createElement(Ie.default,{className:"site-tag-plus",onClick:()=>{Ze(Ue),this.setState({inputVisible:!0})}},St.createElement(re.Z,null)," \u65B0\u589E\u7B54\u6848")))}}var ue=Oe},35566:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return Ft}});var St=Kt(67294),de=Kt(35567),Ie=Object.defineProperty,$e=Object.defineProperties,me=Object.getOwnPropertyDescriptors,re=Object.getOwnPropertySymbols,Zt=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,ue=(et,nt,ct)=>nt in et?Ie(et,nt,{enumerable:!0,configurable:!0,writable:!0,value:ct}):et[nt]=ct,Se=(et,nt)=>{for(var ct in nt||(nt={}))Zt.call(nt,ct)&&ue(et,ct,nt[ct]);if(re)for(var ct of re(nt))Oe.call(nt,ct)&&ue(et,ct,nt[ct]);return et},Ue=(et,nt)=>$e(et,me(nt)),Ee=(et,nt,ct)=>ue(et,typeof nt!="symbol"?nt+"":nt,ct);const Ze="\u2581";class Ft extends St.Component{constructor(){super(...arguments),Ee(this,"getChCountBeforeCursor",(nt,ct)=>{const lt=ct.line;let pt=0;for(let Ct=0;Ct<lt;Ct++)pt+=nt.getLine(Ct).split(Ze).length-1;const vt=nt.getLine(lt).substring(0,ct.ch);return pt+=vt.split(Ze).length-1,pt}),Ee(this,"onCMBeforeChange",(nt,ct)=>{const lt=nt.getRange(ct.from,ct.to);let pt=0;if(ct.text.forEach(vt=>{pt+=vt.split(Ze).length-1}),lt&&lt.indexOf(Ze)!=-1){const vt=lt.split(Ze).length-1,Ct=this.getChCountBeforeCursor(nt,ct.from);console.log(`\u5220\u9664${vt}\u4E2A\uFF0C \u4E4B\u524D\u6709${Ct}\u4E2A\uFF0C\u65B0\u589E${pt}\u4E2A`),this.props.deleteEmptyDisabled?ct.cancel():this.props.onPlaceholderChange&&this.props.onPlaceholderChange(Ct,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(de.Z,Ue(Se({},this.props),{onCMBeforeChange:this.onCMBeforeChange}))}}},63205:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return Ue}});var St=Kt(67294),de={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},Ie=Kt(94184),$e=Kt.n(Ie),me=Kt(74330),re=Kt(15979),Zt=Kt(33170),Oe=Kt(28706),ue=(Ee,Ze,Ft)=>new Promise((et,nt)=>{var ct=vt=>{try{pt(Ft.next(vt))}catch(Ct){nt(Ct)}},lt=vt=>{try{pt(Ft.throw(vt))}catch(Ct){nt(Ct)}},pt=vt=>vt.done?et(vt.value):Promise.resolve(vt.value).then(ct,lt);pt((Ft=Ft.apply(Ee,Ze)).next())}),Ue=({data:Ee,className:Ze,fullWidth:Ft,style:et={},onClose:nt,onOk:ct,showFullTools:lt,noAssociationId:pt})=>{const vt=(0,St.useRef)(null),Ct=(0,St.useRef)(null),Nt=(0,St.useRef)(null),zt=(0,St.useRef)(null),[Ht,$t]=(0,St.useState)(!1),[ee,te]=(0,St.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,St.useEffect)(()=>(Nt.current||(Nt.current=document.createElement("style"),document.head.appendChild(Nt.current)),Ee!=null&&Ee.visible?(document.body.setAttribute("data-custom","y-hidden"),Nt.current.innerHTML=" html { overflow-y: hidden; }",Ee!=null&&Ee.src&&Ae()):(document.body.removeAttribute("data-custom"),Nt.current&&(document.head.removeChild(Nt.current),Nt.current=null)),()=>{document.body.removeAttribute("data-custom"),Nt.current&&(document.head.removeChild(Nt.current),Nt.current=null)}),[Ee==null?void 0:Ee.visible]);const Ae=()=>ue(void 0,null,function*(){$t(!0),te("\u6B63\u5728\u52A0\u8F7D\u4E2D");const ze=yield(0,Oe.ZJ)(Ee==null?void 0:Ee.src);vt.current.src="",vt.current.src=ze,vt.current.onload=function(){He()},$t(!1),te("")}),se=ze=>ue(void 0,null,function*(){$t(!0),te("\u6B63\u5728\u4FDD\u5B58\u4E2D");const Cn=yield(0,Zt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Ee.title,file:ze.dataUrl}});Cn!=null&&Cn.id&&!pt?(yield(0,Zt.ZP)(`/api/attachments/${Ee.id}/add_subitem.json`,{method:"post",body:{subitem_id:Cn==null?void 0:Cn.id,settings:JSON.stringify(ze.state)}})).status===0&&ct():Cn!=null&&Cn.id&&ct(Cn),$t(!1),te("")}),Re=()=>{const ze=document.querySelector('a[href="https://markerjs.com/"]');ze&&ze.parentNode&&(ze.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(Rn=>{const Xn=document.querySelector(Rn.name);Xn&&Xn.setAttribute("title",Rn.title)})},He=()=>{Ct.current=new re.hP(vt.current),Ct.current.targetRoot=zt.current,Ct.current.addEventListener("render",se),Ct.current.addEventListener("beforeclose",nt),lt&&(Ct.current.availableMarkerTypes=Ct.current.ALL_MARKER_TYPES,Ct.current.uiStyleSettings.redoButtonVisible=!0,Ct.current.uiStyleSettings.notesButtonVisible=!0,Ct.current.uiStyleSettings.zoomButtonVisible=!0,Ct.current.uiStyleSettings.zoomOutButtonVisible=!0,Ct.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=Ct.current.uiStyleSettings,Ct.current.show(),Ee!=null&&Ee.snapshotData&&Ct.current.restoreState(Ee.snapshotData),setTimeout(()=>{window.scrollTo(0,0),Re()},300)};return St.createElement(St.Fragment,null,(Ee==null?void 0:Ee.visible)&&St.createElement(me.Z,{spinning:Ht,tip:ee,style:{position:"absolute",width:"100vw"}},St.createElement("div",{ref:zt,className:$e()(de.imageDimensions,Ze,Ft?de.fullWidth:""),style:et},St.createElement("img",{className:de.img,ref:vt}))))}},36527:function(tn,An,Kt){"use strict";var St=Kt(67294),de=Kt(71230),Ie=Kt(15746),$e=Kt(55238),me=Kt(85804),re=Kt(65226),Zt=Kt(71736),Oe=Kt(84279),ue=Kt(67294);const Se=(0,St.forwardRef)(({callback:Ue,showSaveButton:Ee,value:Ze=""},Ft)=>{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=Ct=>{et.current.setValue(et.current.getValue()+" "+Ct.value+" ")},pt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:ue.createElement(de.Z,{className:Zt.Z.lists,gutter:[10,10]},nt.map((Ct,Nt)=>ue.createElement(Ie.Z,{flex:"110px",className:Zt.Z.item},ue.createElement("div",null,ue.createElement(re.Z,{value:`$$${Ct.value}$$`}),Ct.name),ue.createElement("div",{className:Zt.Z.children},Ct.children.map((zt,Ht)=>ue.createElement("div",{key:Ht},ue.createElement("h1",null,zt.name),ue.createElement(de.Z,{gutter:[10,10]},zt.data.map(($t,ee)=>ue.createElement(Ie.Z,{key:ee,onClick:()=>lt($t),className:Zt.Z.diamond},ue.createElement(re.Z,{value:"`$$"+$t.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:ue.createElement(de.Z,{className:Zt.Z.lists,gutter:[10,10]},ct.map((Ct,Nt)=>ue.createElement(Ie.Z,{flex:"110px",className:Zt.Z.item},ue.createElement("div",null,ue.createElement(re.Z,{value:"`$$"+Ct.value+"$$`"}),Ct.name),ue.createElement("div",{className:Zt.Z.children},Ct.children.map((zt,Ht)=>ue.createElement("div",{key:Ht},zt.name&&ue.createElement("h1",null,zt.name),ue.createElement(de.Z,{gutter:[10,10]},zt.data.map(($t,ee)=>ue.createElement(Ie.Z,{key:ee,onClick:()=>lt($t),className:Zt.Z.diamond},ue.createElement(re.Z,{value:"`$$"+$t.value+"$$`"}))))))))))}],vt=()=>{var Ct=document.createElement("div");Ct.innerHTML=et.current.getValue();var Nt=Ct.innerText;return Ue&&Ue(Nt),Nt};return(0,St.useImperativeHandle)(Ft,()=>({getData:vt})),ue.createElement("div",{className:Zt.Z.mathWrap},ue.createElement($e.default,{defaultActiveKey:"1",items:pt}),ue.createElement("math-field",{locale:"zh_cn",className:Zt.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:et,style:{width:800,marginTop:30,fontSize:18}},Ze||""),Ee&&ue.createElement("div",{className:Zt.Z.button},ue.createElement(me.ZP,{size:"large",onClick:vt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});An.Z=Se},26194:function(tn,An,Kt){"use strict";var St=Kt(67294),de=Kt(4977),Ie=Kt(85804),$e=Object.defineProperty,me=Object.defineProperties,re=Object.getOwnPropertyDescriptors,Zt=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,Se=(Ft,et,nt)=>et in Ft?$e(Ft,et,{enumerable:!0,configurable:!0,writable:!0,value:nt}):Ft[et]=nt,Ue=(Ft,et)=>{for(var nt in et||(et={}))Oe.call(et,nt)&&Se(Ft,nt,et[nt]);if(Zt)for(var nt of Zt(et))ue.call(et,nt)&&Se(Ft,nt,et[nt]);return Ft},Ee=(Ft,et)=>me(Ft,re(et));const Ze=({img:Ft,buttonProps:et={},styles:nt={},customText:ct,ButtonText:lt,ButtonClick:pt,Buttonclass:vt,ButtonTwo:Ct,imgStyles:Nt,loading:zt=!1,className:Ht=""})=>St.createElement("section",{className:`tc animated fadeIn ${Ht}`,style:Ue({color:"#999",margin:"100px auto",visibility:zt?"hidden":"visible"},nt)},St.createElement("img",{src:Ft||de,style:Ee(Ue({},Nt),{pointerEvents:"none",userSelect:"none"})}),St.createElement("p",{className:"mt20 font14"},ct||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),lt&&St.createElement(Ie.ZP,Ue({className:vt,onClick:pt},et),lt),Ct&&Ct);An.Z=Ze},20819:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return vt}});var St=Kt(67294),de={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},Ie=Kt(85804),$e=Kt(30153),me=Kt(36295),re=Kt(83062),Zt=Kt(28706),Oe=Kt(15835),ue=Kt(26194),Se=Kt(11320),Ue=Kt(66540),Ee=Kt(67294),Ze=Object.defineProperty,Ft=Object.getOwnPropertySymbols,et=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,ct=(Ct,Nt,zt)=>Nt in Ct?Ze(Ct,Nt,{enumerable:!0,configurable:!0,writable:!0,value:zt}):Ct[Nt]=zt,lt=(Ct,Nt)=>{for(var zt in Nt||(Nt={}))et.call(Nt,zt)&&ct(Ct,zt,Nt[zt]);if(Ft)for(var zt of Ft(Nt))nt.call(Nt,zt)&&ct(Ct,zt,Nt[zt]);return Ct},pt=(Ct,Nt,zt)=>new Promise((Ht,$t)=>{var ee=se=>{try{Ae(zt.next(se))}catch(Re){$t(Re)}},te=se=>{try{Ae(zt.throw(se))}catch(Re){$t(Re)}},Ae=se=>se.done?Ht(se.value):Promise.resolve(se.value).then(ee,te);Ae((zt=zt.apply(Ct,Nt)).next())}),vt=({editOffice:Ct="view",data:Nt,issaver:zt,onSaver:Ht,theme:$t,type:ee,filename:te,monacoEditor:Ae,className:se,style:Re,close:He,onClose:ze,hasMask:Cn,disabledDownload:Rn,onImgDimensions:Xn,showNodata:Ni,recordInfo:Yt})=>{const[jt,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"),[un,Ln]=(0,St.useState)(""),[Le,nn]=(0,St.useState)(),hn=window.ENV==="build"?"/react/build":"",_n=location.host.startsWith("localhost")?Se.Z.PROXY_SERVER:Se.Z.API_SERVER,le=10*(1024*1024),we=(0,St.useRef)();Nt!=null&&Nt.startsWith("/api")&&ee!=="txt"&&(Nt=Se.Z.API_SERVER+Nt);const Pn=At=>At.substring(At.lastIndexOf("/")+1).split(".").pop();te&&Ae&&(Ae.filename=te),(0,St.useEffect)(()=>{var At,Wt;const Et=(Wt=(At=document.cookie)==null?void 0:At.replace(/\s/g,""))==null?void 0:Wt.split(";");Et==null||Et.map(be=>{let Nn=be.split("=");Nn[0]==="_educoder_session"&&Ln(Nn[1])})},[]),(0,St.useEffect)(()=>{ee==="office"&&(Nt.indexOf("bigfilescdn.")>-1||Nt.indexOf("bigfiles1")>-1?nn({url:Nt,fileType:Pn(Nt),model:Nt.indexOf("model=edit")?"edit":"view"}):_t())},[ee,Nt]);function vn(At){return pt(this,null,function*(){At.data.type==="pdfdata"&&(Ht(At.data.data),window.removeEventListener("message",vn,!1)),console.log("mess---:",At.data)})}const _t=()=>pt(void 0,null,function*(){console.log("data:",Nt);let At=Nt;Nt.startsWith("http")||(At=location.origin+At);let Wt=new URL(At).pathname.split("/").pop();const Et=yield(0,Oe.gJ)({attachment_id:Wt});Et.url=_n+Et.url,nn(Et)}),Mt=()=>{if(Nt.startsWith("http")||Nt.startsWith("blob:")){Lt();return}(0,Zt.Sv)(te||"educoder",Nt,te)},Lt=()=>{Yt&&(0,Ue.fc)({id:Yt==null?void 0:Yt.id,watch_type:1,course_id:Yt==null?void 0:Yt.course_id}),(0,Zt.Nd)(te||"educoder",decodeURIComponent(Nt))};return Ee.createElement("div",{style:lt({},Re||{}),className:`${Cn&&de.bgBlack} ${ee?de.wrp:"hide"}`},He&&Ee.createElement("div",{className:de.close,ref:we},!!Xn&&Ee.createElement(re.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>we.current},Ee.createElement("span",{onClick:()=>{ze(),Xn()}},Ee.createElement("i",{className:"icon-yulanpizhu"}))),!Rn&&Ee.createElement(re.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>we.current},Ee.createElement("span",{onClick:Lt},Ee.createElement("i",{className:"icon-quxiaozhiding"}))),zt&&Ee.createElement(re.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>we.current},Ee.createElement("span",{className:"",onClick:()=>{const At=document.getElementById("pdfiframe");window.addEventListener("message",vn,!1),setTimeout(()=>{At.contentWindow.postMessage("getData","*")},300)}},Ee.createElement("i",{className:"icon-baocun"}))),Ee.createElement(re.Z,{title:"\u5173\u95ED",getPopupContainer:()=>we.current},Ee.createElement("span",{className:"",onClick:()=>{ze()}},Ee.createElement("i",{className:"icon-guanbi1"})))),Ee.createElement("div",{className:`${de[se]} ${se} ${de.monaco} ${ee==="txt"?"show":"hide"}`},ee==="txt"&&Ee.createElement(Ee.Fragment,null,Ee.createElement(me.ZP,lt({},Ae)))),ee==="audio"&&Ee.createElement("audio",{src:`${(Nt==null?void 0:Nt.indexOf("http://"))>-1||(Nt==null?void 0:Nt.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${Nt}`,autoPlay:!0}),ee==="video"&&Ee.createElement(Ee.Fragment,null,(Nt==null?void 0:Nt.indexOf("http"))>-1?Ee.createElement("video",{controls:!0,src:`${Nt}`,autoPlay:!0}):Ee.createElement("video",{controls:!0,src:`data:video/mp4;base64,${Nt}`,autoPlay:!0})),ee==="office"&&Le&&Ee.createElement("iframe",{src:`${hn}/office.html?key=${Le.key}&url=${btoa(Le.url)}&callbackUrl=${_n+(Le.callbackUrl||"")}&fileType=${Le.fileType}&title=${Le.title||""}&model=${Ct}&officeServer=${Se.Z.ONLYOFFICE}&disabledDownload=${!!Rn}`}),ee==="html"&&Ee.createElement("iframe",{src:Nt+"&disposition=inline"}),ee==="pdf"&&Ee.createElement("iframe",{id:"pdfiframe",src:`${hn}/js/pdfview/index.html?filename=${te||"educoder.pdf"}&url=${encodeURIComponent(Nt)}&disabledDownload=${!!Rn}&model=${Ct}`}),ee==="image"&&Ee.createElement("img",{src:`${(Nt==null?void 0:Nt.indexOf("http://"))>-1||(Nt==null?void 0:Nt.indexOf("https://"))>-1?"":"data:image/png;base64,"}${Nt}`}),(ee==="other"||ee==="download")&&Ee.createElement(Ee.Fragment,null,Ni?Ee.createElement(ue.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:Ee.createElement(Ie.ZP,{icon:Ee.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Mt,disabled:Rn},"\u4E0B\u8F7D")}):Ee.createElement(Ie.ZP,{type:"primary",size:"middle",onClick:Mt,disabled:Rn},Ee.createElement($e.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},65226:function(tn,An,Kt){"use strict";Kt.d(An,{z:function(){return ee},Z:function(){return te}});var St=Kt(67294),de=Kt(81897),Ie=Kt(51161),$e=Kt(11771),me=Kt(67631),re=Kt.n(me),Zt=Kt(11320),Oe=Kt(28706),ue=Kt(20527),Se=Kt(25934),Ue=Kt(20819),Ee=Kt(67294),Ft=({html:Ae})=>{const se=(0,St.useRef)(null),Re=(0,St.useRef)(null),He=`.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 56px !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 ze=se.current.attachShadow({mode:"open"});Re.current=document.createElement("div"),Re.current.className="markdown-body",Re.current.innerHTML=Ae,ze.appendChild(Re.current);const Cn=document.createElement("style");return Cn.textContent=He,ze.appendChild(Cn),()=>{ze.innerHTML=""}},[]),(0,St.useEffect)(()=>{Re.current&&(Re.current.innerHTML=Ae)},[Ae]),Ee.createElement("div",{ref:se})};function et(Ae){const se=["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"],Re=new RegExp(`\\b(${se.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return Ae.replace(Re,"").trim()}var nt=Object.defineProperty,ct=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,vt=(Ae,se,Re)=>se in Ae?nt(Ae,se,{enumerable:!0,configurable:!0,writable:!0,value:Re}):Ae[se]=Re,Ct=(Ae,se)=>{for(var Re in se||(se={}))lt.call(se,Re)&&vt(Ae,Re,se[Re]);if(ct)for(var Re of ct(se))pt.call(se,Re)&&vt(Ae,Re,se[Re]);return Ae};const Nt="@\u2581\u2581@",zt="@\u2581@",Ht=/<pre[^>]*>/g;function $t(Ae){let se=document.createElement("div");return se.innerHTML=Ae,se.childNodes.length===0?"":se.childNodes[0].nodeValue}const ee=(Ae,se)=>{Ae=Ae||"";const Re=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,He=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,ze=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Cn=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return se?Ae.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(Re,(Rn,Xn,Ni,Yt,jt,Ce,un)=>{const Ln=Xn||Yt||Ce,Le=Ni||jt||un||"?";return Zt.Z.API_SERVER+"/api/attachments/"+Ln+Le+"&t="+(0,Oe.Jn)(Ln,Date.now())+(Rn.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(Ae=Ae.replace(Cn,(Rn,Xn,Ni,Yt,jt,Ce,un)=>{const Ln=Xn||Yt||Ce,Le=Ni||jt||un||"?";return Zt.Z.API_SERVER+"/attachments/download/"+Ln+Le+"&t="+(0,Oe.Jn)(Ln,Date.now())+(Rn.indexOf(")")>-1?")":"&")}).replace(Re,(Rn,Xn,Ni,Yt,jt,Ce,un)=>{const Ln=Xn||Yt||Ce,Le=Ni||jt||un||"?";return Zt.Z.API_SERVER+"/api/attachments/"+Ln+Le+"&t="+(0,Oe.Jn)(Ln,Date.now())+(Rn.indexOf(")")>-1?")":"&")}).replace(He,(Rn,Xn,Ni,Yt,jt)=>{const Ce=Xn||Yt,un=Ni||jt||"";return'"'+Zt.Z.API_SERVER+"/api/attachments/"+Ce+un+Ce+un+"&t="+(0,Oe.Jn)(Ce,Date.now())}).replace(ze,(Rn,Xn,Ni,Yt,jt)=>{const Ce=Xn||Yt,un=Ni||jt||"";return"("+Zt.Z.API_SERVER+"/files/uploads/"+Ce+un+Ce+un+"&t="+(0,Oe.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,`
`),Ae)};var te=({value:Ae="",className:se,showTextOnly:Re,showLines:He,style:ze={},stylesPrev:Cn={},highlightKeywords:Rn,showProgramFill:Xn,isProgramFill:Ni,disabledFill:Yt=!1,programFillValue:jt,onFillChange:Ce=Le=>{},onFillBlur:un=()=>{},onFillFocus:Ln=()=>{}})=>{let Le=et(String(Ae||""));const[nn,hn]=(0,St.useState)(""),[_n,fn]=(0,St.useState)("office"),[le,we]=(0,St.useState)([]),Pn=(0,St.useRef)("a"+(0,Se.Z)()),vn={},_t=yn=>/<style[\s\S]*?>/i.test(yn||""),Mt=(yn,Li,yi)=>{const Ui=document.createElement(yn===zt?"input":"textarea");Ui.style.width="100%",Ui.style.height=yn===zt?"40px":"151px",Ui.rows=5,Ui.spellcheck=!1,Ui.name="edu-program-fill",Ui.placeholder="\u8BF7\u8F93\u5165",Ui.dataset.id=Li;const Jn=Object.keys(vn).length;return vn[Jn]=Ui,`<span class="edu-program-fill-wrap ${yn===zt?"":"show"}" style="width:${yn===zt?"600px":"100%"}" title=${yi||""}><span>${Ui.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Lt(yn){return yn=yn.replace(/!\[.*?\]\(.*?\)/g,""),yn=yn.replace(/\[.*?\]\(.*?\)/g,""),yn=yn.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),yn=yn.replace(/<embed.*?>/g,""),yn=yn.replace(/<img.*?>/g,""),yn=yn.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),yn=yn.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),yn=yn.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),yn=yn.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),yn}const At=yn=>!Re&&_t(Le)?yn:yn.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Li,yi){let Ui=yi.replace(/(\n|\r)/g,"").split("}"),Jn=[];return Ui.map(xr=>{xr!=""&&Jn.push(`.${Pn.current} ${xr}`)}),`<style>${Jn.join("}")}</style>`}),Wt=(0,St.useMemo)(()=>{try{const Ui=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,Jn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,xr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,Mo=/\(\/attachments\/download\//g;Le=Le.replace(Mo,"("+Zt.Z.API_SERVER+"/attachments/download/").replace(Ui,"("+Zt.Z.API_SERVER+"/api/attachments/").replace(Jn,'"'+Zt.Z.API_SERVER+"/api/attachments/").replace(xr,'"'+Zt.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(Ui){}if(Xn){let Ui=-1;return Le=Le.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,function(Jn,xr,Mo){var ao;return++Ui,Mt(Jn,Ui,(ao=jt==null?void 0:jt[Ui])==null?void 0:ao.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))}),`<pre style="background:#fff;padding:4px">${At(Le||"")}</pre>`}let yn=At(Le);yn=(0,Ie.ZP)(yn);const Li=(0,Ie.ez)();Le.match(/\[TOC\]/)&&(yn=yn.replace("<p>[TOC]</p>",(0,Ie.Qv)()),(0,Ie.Iy)()),yn=yn.replace(/(__special_katext_id_\d+__)/g,(Ui,Jn)=>{const{type:xr,expression:Mo}=Li[Jn];return(0,ue.renderToString)($t(Mo)||"",{displayMode:xr==="block",throwOnError:!1,output:"html"})}),yn=yn.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,Ie.AL)();const yi=document.createElement("div");if(yi.innerHTML=yn,Re)return yi.innerText;if(Rn){const Ui=Rn.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return mi(yi,Ui),yi.innerHTML}return setTimeout(()=>Fi(),500),yi.innerHTML},[Le,Rn]);(0,St.useEffect)(()=>{On.current&&On.current.querySelectorAll(["input","textarea"]).forEach(Li=>{Li.oninput=Et,Li.onblur=be,Li.onfocus=Nn})},[le]),(0,St.useEffect)(()=>{var yn,Li,yi,Ui,Jn;if(jt!=null&&jt.length)try{const xr=On.current.querySelectorAll(".edu-program-fill-score"),Mo=On.current.querySelectorAll('[name="edu-program-fill"]');for(const[ao,$i]of Mo.entries())$i.value=((yn=jt==null?void 0:jt[ao])==null?void 0:yn.value)||"",((Li=jt==null?void 0:jt[ao])==null?void 0:Li.type)==="warning"?$i.className="program-fill-warning":((yi=jt==null?void 0:jt[ao])==null?void 0:yi.type)==="success"?$i.className="program-fill-success":$i.className="";for(const[ao,$i]of xr.entries())$i.innerHTML=(Ui=jt==null?void 0:jt[ao])!=null&&Ui.score?`${(Jn=jt==null?void 0:jt[ao])==null?void 0:Jn.score}\u5206`:"";we(jt)}catch(xr){console.log(xr,"error")}},[jt]);const Et=yn=>{le[yn.target.dataset.id]=le[yn.target.dataset.id]||{},le[yn.target.dataset.id].value=yn.target.value,we([...le]),Ce(le,yn.target.dataset.id)},be=yn=>{le[yn.target.dataset.id]=le[yn.target.dataset.id]||{},le[yn.target.dataset.id].value=yn.target.value,we([...le]),un(le,yn.target.dataset.id)},Nn=yn=>{le[yn.target.dataset.id]=le[yn.target.dataset.id]||{},le[yn.target.dataset.id].value=yn.target.value,we([...le]),Ln(le,yn.target.dataset.id)};function mi(yn,Li){return yn.childNodes.forEach(yi=>{var Ui;if(yi.childNodes.length>0)mi(yi,Li);else if(yi.nodeName!=="IMG")if(yi.innerHTML)yi.innerHTML=(Ui=yi.innerHTML)==null?void 0:Ui.replace(new RegExp(Li,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const Jn=document.createElement("span");Jn.innerHTML=yi.textContent.replace(new RegExp(Li,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),yi.replaceWith(Jn)}})}const On=(0,St.useRef)();Ie.jb.WebkitLineClamp=He,He&&(ze=Ct(Ct({},ze),Ie.jb));function Gn(yn){let Li=yn.target;if(Li.tagName.toUpperCase()==="A"){let yi=Li.getAttribute("href");if(yi.indexOf("office")>-1)yn.preventDefault(),hn(yi),fn("office");else if(yi.indexOf("application/pdf")>-1)yn.preventDefault(),hn(yi),fn("pdf");else if(yi.indexOf("text/html")>-1)yn.preventDefault(),hn(yi),fn("html");else if(yi.startsWith("#")){yn.preventDefault();let Ui=document.getElementById(yi.replace("#",""));Ui&&Ui.scrollIntoView(!0)}}}const Fi=()=>{var yn;const Li=(yn=On.current)==null?void 0:yn.querySelectorAll("video");Li==null||Li.forEach(yi=>{if(yi.oncontextmenu=()=>!1,yi.src.indexOf(".m3u8")>-1&&!yi.canPlayType("application/vnd.apple.mpegurl")){if(re().isSupported()){var Ui=new(re());Ui.loadSource(yi.src),Ui.attachMedia(yi)}}})};return(0,St.useEffect)(()=>{if(On.current&&Wt&&Wt.match(Ht)&&window.PR.prettyPrint(),On.current)return On.current.addEventListener("click",Gn),()=>{var yn;(yn=On.current)==null||yn.removeEventListener("click",Gn),(0,Ie.AL)(),(0,Ie.Iy)()}},[Wt,On.current,Gn]),(0,St.useEffect)(()=>{var yn;const Li=yi=>{yi.preventDefault(),yi.clipboardData.setData("text",window.getSelection().toString())};return(yn=On.current)==null||yn.addEventListener("copy",Li),()=>{var yi;(yi=On.current)==null||yi.removeEventListener("copy",Li)}},[On.current]),St.createElement(St.Fragment,null,Re&&St.createElement("div",{ref:On},Wt),!Re&&!_t(Wt)&&St.createElement("div",{ref:On,style:Ct({},ze),className:`${se||""} ${Yt?"disabled-fill":""} markdown-body ${Pn.current}`,dangerouslySetInnerHTML:{__html:Wt}}),!Re&&_t(Wt)&&St.createElement(Ft,{html:Wt}),St.createElement(Ue.Z,{close:!0,data:nn,type:nn!=null&&nn.length?_n:"",style:Ct({},Cn),onClose:()=>hn("")}))}},57444:function(tn,An,Kt){"use strict";Kt.d(An,{h:function(){return Ct}});var St=Kt(67294),de=Kt(88044),Ie=Kt(91773),$e=Kt(85804),me=Kt(4631),re=Kt.n(me),Zt=Kt(71749),Oe=Kt(30483),ue=Object.defineProperty,Se=Object.defineProperties,Ue=Object.getOwnPropertyDescriptors,Ee=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,Ft=Object.prototype.propertyIsEnumerable,et=(Nt,zt,Ht)=>zt in Nt?ue(Nt,zt,{enumerable:!0,configurable:!0,writable:!0,value:Ht}):Nt[zt]=Ht,nt=(Nt,zt)=>{for(var Ht in zt||(zt={}))Ze.call(zt,Ht)&&et(Nt,Ht,zt[Ht]);if(Ee)for(var Ht of Ee(zt))Ft.call(zt,Ht)&&et(Nt,Ht,zt[Ht]);return Nt},ct=(Nt,zt)=>Se(Nt,Ue(zt));const lt=de.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"]};An.Z=({callback:Nt,onCancel:zt})=>{const[Ht,$t]=(0,St.useState)("python");function ee(Ae){$t(vt[Ae][1])}function te(Ae){Nt(Ae)}return St.createElement(Ie.default,ct(nt({},pt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:te,style:{width:500}}),St.createElement(Ie.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},St.createElement(de.default,{getPopupContainer:Ae=>Ae.parentNode,onChange:ee},Object.keys(vt).map(Ae=>St.createElement(lt,{key:Ae,value:Ae},vt[Ae][0])))),St.createElement(Ie.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},St.createElement(Ct,{mode:Ht})),St.createElement("div",{className:"flex-container flex-end"},St.createElement($e.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),St.createElement($e.ZP,{type:"ghost",onClick:zt},"\u53D6\u6D88")))};function Ct({value:Nt,onChange:zt,mode:Ht,options:$t={}}){const ee=(0,St.useRef)(),[te,Ae]=(0,St.useState)();return(0,St.useEffect)(()=>{if(te){let se=function(Re){const He=Re.getValue();zt&&zt(He)};return te.on("change",se),()=>{te.off("change",se)}}},[te,zt]),(0,St.useEffect)(()=>{te&&te.setOption("mode",Ht)},[te,Ht]),(0,St.useEffect)(()=>{te&&(Nt!==te.getValue()||Nt==="")&&setTimeout(()=>{te.setValue(Nt||"")},300)},[te,Nt]),(0,St.useEffect)(()=>{if(ee.current&&!te){const se=re().fromTextArea(ee.current,nt({mode:Ht,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},$t));Ae(se)}},[ee.current,te]),St.createElement("div",{className:"my-codemirror-container"},St.createElement("textarea",{ref:ee}))}},35567:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return Qn}});var St=Kt(67294),de=Kt(4631),Ie=Kt.n(de),$e=Kt(91033),me=Kt(71749),re=Kt(57341),Zt=Kt(82801),Oe=Kt(88386),ue=Kt(49047),Se=Kt(80785),Ue=Kt(65226),Ee=({value:ye="",className:ve,showTextOnly:ne,showLines:ke,style:xn={}})=>{const Fn=(0,St.useMemo)(()=>"",[ye]);return St.createElement(St.Fragment,null,St.createElement("div",{dangerouslySetInnerHTML:{__html:Fn}}))},Ze=Object.defineProperty,Ft=Object.defineProperties,et=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,ct=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable,pt=(ye,ve,ne)=>ve in ye?Ze(ye,ve,{enumerable:!0,configurable:!0,writable:!0,value:ne}):ye[ve]=ne,vt=(ye,ve)=>{for(var ne in ve||(ve={}))ct.call(ve,ne)&&pt(ye,ne,ve[ne]);if(nt)for(var ne of nt(ve))lt.call(ve,ne)&&pt(ye,ne,ve[ne]);return ye},Ct=(ye,ve)=>Ft(ye,et(ve));let Nt=[{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\u516C\u5F0F",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"md-iconfont icon-formula",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 zt({onActionCallback:ye,title:ve,icon:ne,actionName:ke,className:xn="",children:Fn}){function In(){ye(ke)}return St.createElement("a",{title:ve,className:xn,onClick:In},St.createElement("i",{className:`${ne}`}),Fn)}var Ht=({watch:ye,showNullButton:ve,showNullProgramButton:ne,onActionCallback:ke,fullScreen:xn,insertTemp:Fn,hidetoolBar:In,extraUse:ge})=>{const Ge=[...Nt,{title:`${ye?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${ye?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return St.createElement("ul",{className:"markdown-toolbar-container"},!In&&Ge.map((Bn,ri)=>St.createElement("li",{key:ri},Bn.actionName?St.createElement(zt,Ct(vt({},Bn),{onActionCallback:ke})):St.createElement("span",{className:"v-line"}))),ve?St.createElement("li",null,St.createElement(zt,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ke},St.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ne?St.createElement(St.Fragment,null,St.createElement("li",null,St.createElement(zt,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:ke},St.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u5355\u884C\u586B\u7A7A\u9879"))),St.createElement("li",null,St.createElement(zt,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:ke},St.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u591A\u884C\u586B\u7A7A\u9879")))):null,Fn&&St.createElement("li",null,St.createElement(zt,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Fn}`,onActionCallback:ke},St.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),ge&&St.createElement("li",null,ge),St.createElement("li",{className:"btn-full-screen"},St.createElement(zt,{icon:`${xn?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:xn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ke})))},$t=Kt(76621),ee=Kt(91773),te=Kt(28802),Ae=Kt(85804),se=Object.defineProperty,Re=Object.defineProperties,He=Object.getOwnPropertyDescriptors,ze=Object.getOwnPropertySymbols,Cn=Object.prototype.hasOwnProperty,Rn=Object.prototype.propertyIsEnumerable,Xn=(ye,ve,ne)=>ve in ye?se(ye,ve,{enumerable:!0,configurable:!0,writable:!0,value:ne}):ye[ve]=ne,Ni=(ye,ve)=>{for(var ne in ve||(ve={}))Cn.call(ve,ne)&&Xn(ye,ne,ve[ne]);if(ze)for(var ne of ze(ve))Rn.call(ve,ne)&&Xn(ye,ne,ve[ne]);return ye},Yt=(ye,ve)=>Re(ye,He(ve));const jt={labelCol:{span:4},wrapperCol:{span:20}};var Ce=({callback:ye,onCancel:ve})=>{function ne(ke){ye(ke)}return St.createElement(ee.default,Yt(Ni({},jt),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ne,style:{width:500}}),St.createElement(ee.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},St.createElement(te.default,null)),St.createElement(ee.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},St.createElement(te.default,null)),St.createElement("div",{className:"flex-container flex-end"},St.createElement(Ae.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),St.createElement(Ae.ZP,{type:"ghost",onClick:ve},"\u53D6\u6D88")))},un=Kt(57444),Ln=Kt(70859),Le=Kt(62844),nn=Kt(71230),hn=Kt(63205),_n=Kt(67294),fn=({callback:ye,onCancel:ve})=>{const ne=document.createElement("canvas"),ke=ne.getContext("2d");ne.width=1e3,ne.height=800,ke.fillStyle="#ffffff",ke.fillRect(0,0,ne.width,ne.height);const xn=ne.toDataURL("image/png");return _n.createElement(Le.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},_n.createElement(nn.Z,{style:{height:"100vh"}},_n.createElement(hn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:xn,visible:!0,title:String(Date.now())},onOk:Fn=>{ye({src:Fn.url})},onClose:ve})))},le=Kt(23495);function we(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(we,go.CommandHandler),we.prototype.canAlignSelection=function(){var ye=this.diagram;return!(ye===null||ye.isReadOnly||ye.isModelReadOnly||ye.selection.count<2)},we.prototype.alignLeft=function(){var ye=this.diagram;ye.startTransaction("aligning left");var ve=1/0;ye.selection.each(function(ne){ne instanceof go.Link||(ve=Math.min(ne.position.x,ve))}),ye.selection.each(function(ne){ne instanceof go.Link||ne.move(new go.Point(ve,ne.position.y))}),ye.commitTransaction("aligning left")},we.prototype.alignRight=function(){var ye=this.diagram;ye.startTransaction("aligning right");var ve=-1/0;ye.selection.each(function(ne){if(!(ne instanceof go.Link)){var ke=ne.actualBounds.x+ne.actualBounds.width;ve=Math.max(ke,ve)}}),ye.selection.each(function(ne){ne instanceof go.Link||ne.move(new go.Point(ve-ne.actualBounds.width,ne.position.y))}),ye.commitTransaction("aligning right")},we.prototype.alignTop=function(){var ye=this.diagram;ye.startTransaction("alignTop");var ve=1/0;ye.selection.each(function(ne){ne instanceof go.Link||(ve=Math.min(ne.position.y,ve))}),ye.selection.each(function(ne){ne instanceof go.Link||ne.move(new go.Point(ne.position.x,ve))}),ye.commitTransaction("alignTop")},we.prototype.alignBottom=function(){var ye=this.diagram;ye.startTransaction("aligning bottom");var ve=-1/0;ye.selection.each(function(ne){if(!(ne instanceof go.Link)){var ke=ne.actualBounds.y+ne.actualBounds.height;ve=Math.max(ke,ve)}}),ye.selection.each(function(ne){ne instanceof go.Link||ne.move(new go.Point(ne.actualBounds.x,ve-ne.actualBounds.height))}),ye.commitTransaction("aligning bottom")},we.prototype.alignCenterX=function(){var ye=this.diagram,ve=ye.selection.first();if(ve){ye.startTransaction("aligning Center X");var ne=ve.actualBounds.x+ve.actualBounds.width/2;ye.selection.each(function(ke){ke instanceof go.Link||ke.move(new go.Point(ne-ke.actualBounds.width/2,ke.actualBounds.y))}),ye.commitTransaction("aligning Center X")}},we.prototype.alignCenterY=function(){var ye=this.diagram,ve=ye.selection.first();if(ve){ye.startTransaction("aligning Center Y");var ne=ve.actualBounds.y+ve.actualBounds.height/2;ye.selection.each(function(ke){ke instanceof go.Link||ke.move(new go.Point(ke.actualBounds.x,ne-ke.actualBounds.height/2))}),ye.commitTransaction("aligning Center Y")}},we.prototype.alignColumn=function(ye){var ve=this.diagram;ve.startTransaction("align Column"),ye===void 0&&(ye=0),ye=parseFloat(ye);var ne=new Array;ve.selection.each(function(ge){ge instanceof go.Link||ne.push(ge)});for(var ke=0;ke<ne.length-1;ke++){var xn=ne[ke],Fn=xn.actualBounds.y+xn.actualBounds.height+ye,In=ne[ke+1];In.move(new go.Point(xn.actualBounds.x,Fn))}ve.commitTransaction("align Column")},we.prototype.alignRow=function(ye){ye===void 0&&(ye=0),ye=parseFloat(ye);var ve=this.diagram;ve.startTransaction("align Row");var ne=new Array;ve.selection.each(function(ge){ge instanceof go.Link||ne.push(ge)});for(var ke=0;ke<ne.length-1;ke++){var xn=ne[ke],Fn=xn.actualBounds.x+xn.actualBounds.width+ye,In=ne[ke+1];In.move(new go.Point(Fn,xn.actualBounds.y))}ve.commitTransaction("align Row")},we.prototype.canRotate=function(ye){var ve=this.diagram;return!(ve===null||ve.isReadOnly||ve.isModelReadOnly||ve.selection.count<1)},we.prototype.rotate=function(ye){ye===void 0&&(ye=90);var ve=this.diagram;ve.startTransaction("rotate "+ye.toString());var ve=this.diagram;ve.selection.each(function(ne){ne instanceof go.Link||ne instanceof go.Group||(ne.angle+=ye)}),ve.commitTransaction("rotate "+ye.toString())},we.prototype.pullToFront=function(){var ye=this.diagram;ye.startTransaction("pullToFront");var ve=new go.Map;ye.selection.each(function(ne){ve.set(ne.layer,0)}),ve.iteratorKeys.each(function(ne){var ke=0;ne.parts.each(function(xn){if(!xn.isSelected){var Fn=xn.zOrder;isNaN(Fn)?xn.zOrder=0:ke=Math.max(ke,Fn)}}),ve.set(ne,ke)}),ye.selection.each(function(ne){we._assignZOrder(ne,ve.get(ne.layer)+1)}),ye.commitTransaction("pullToFront")},we.prototype.pushToBack=function(){var ye=this.diagram;ye.startTransaction("pushToBack");var ve=new go.Map;ye.selection.each(function(ne){ve.set(ne.layer,0)}),ve.iteratorKeys.each(function(ne){var ke=0;ne.parts.each(function(xn){if(!xn.isSelected){var Fn=xn.zOrder;isNaN(Fn)?xn.zOrder=0:ke=Math.min(ke,Fn)}}),ve.set(ne,ke)}),ye.selection.each(function(ne){we._assignZOrder(ne,ve.get(ne.layer)-1-we._findGroupDepth(ne))}),ye.commitTransaction("pushToBack")},we._assignZOrder=function(ye,ve,ne){ne===void 0&&(ne=ye),ye.layer===ne.layer&&(ye.zOrder=ve),ye instanceof go.Group&&ye.memberParts.each(function(ke){we._assignZOrder(ke,ve+1,ne)})},we._findGroupDepth=function(ye){if(ye instanceof go.Group){var ve=0;return ye.memberParts.each(function(ne){ve=Math.max(ve,we._findGroupDepth(ne))}),ve+1}else return 0},we.prototype.doKeyDown=function(){var ye=this.diagram;if(ye!==null){var ve=ye.lastInput;if(ve.key==="Up"||ve.key==="Down"||ve.key==="Left"||ve.key==="Right"){var ne=this.arrowKeyBehavior;if(ne==="none")return;if(ne==="select"){this._arrowKeySelect();return}else if(ne==="move"){this._arrowKeyMove();return}else if(ne==="tree"){this._arrowKeyTree();return}}go.CommandHandler.prototype.doKeyDown.call(this)}},we.prototype._getAllParts=function(){var ye=new Array;return this.diagram.nodes.each(function(ve){ye.push(ve)}),this.diagram.parts.each(function(ve){ye.push(ve)}),ye},we.prototype._arrowKeyMove=function(){var ye=this.diagram,ve=ye.lastInput,ne=0,ke=0;if(ve.control||ve.meta)ne=1,ke=1;else if(ye.grid!==null){var xn=ye.grid.gridCellSize;ke=xn.width,ne=xn.height}ye.startTransaction("arrowKeyMove"),ye.selection.each(function(Fn){ve.key==="Up"?Fn.move(new go.Point(Fn.actualBounds.x,Fn.actualBounds.y-ne)):ve.key==="Down"?Fn.move(new go.Point(Fn.actualBounds.x,Fn.actualBounds.y+ne)):ve.key==="Left"?Fn.move(new go.Point(Fn.actualBounds.x-ke,Fn.actualBounds.y)):ve.key==="Right"&&Fn.move(new go.Point(Fn.actualBounds.x+ke,Fn.actualBounds.y))}),ye.commitTransaction("arrowKeyMove")},we.prototype._arrowKeySelect=function(){var ye=this.diagram,ve=ye.lastInput,ne=null;ve.key==="Up"?ne=this._findNearestPartTowards(270):ve.key==="Down"?ne=this._findNearestPartTowards(90):ve.key==="Left"?ne=this._findNearestPartTowards(180):ve.key==="Right"&&(ne=this._findNearestPartTowards(0)),ne!==null&&(ve.shift?ne.isSelected=!0:ve.control||ve.meta?ne.isSelected=!ne.isSelected:ye.select(ne))},we.prototype._findNearestPartTowards=function(ye){var ve=this.diagram.selection.first();if(ve===null)return null;for(var ne=ve.actualBounds.center,ke=this._getAllParts(),xn=1/0,Fn=ve,In=0;In<ke.length;In++){var ge=ke[In];if(ge!==ve&&ge.canSelect()){var Ge=ge.actualBounds.center,Bn=ne.directionPoint(Ge),ri=this._angleCloseness(Bn,ye);if(ri<=45){var Qe=ne.distanceSquaredPoint(Ge);Qe*=1+Math.sin(ri*Math.PI/180),Qe<xn&&(xn=Qe,Fn=ge)}}}return Fn},we.prototype._angleCloseness=function(ye,ve){return Math.min(Math.abs(ve-ye),Math.min(Math.abs(ve+360-ye),Math.abs(ve-360-ye)))},we.prototype._arrowKeyTree=function(){var ye=this.diagram,ve=ye.selection.first();if(ve instanceof go.Node){var ne=ye.lastInput;if(ne.key==="Right"){if(!ve.isTreeLeaf)if(!ve.isTreeExpanded)ye.commandHandler.canExpandTree(ve)&&ye.commandHandler.expandTree(ve);else{var ke=this._sortTreeChildrenByY(ve).first();ke!==null&&ye.select(ke)}}else if(ne.key==="Left")if(!ve.isTreeLeaf&&ve.isTreeExpanded)ye.commandHandler.canCollapseTree(ve)&&ye.commandHandler.collapseTree(ve);else{var xn=ve.findTreeParentNode();xn!==null&&ye.select(xn)}else if(ne.key==="Up"){var xn=ve.findTreeParentNode();if(xn!==null){var Fn=this._sortTreeChildrenByY(xn),In=Fn.indexOf(ve);if(In>0){for(var ge=Fn.elt(In-1);ge!==null&&ge.isTreeExpanded&&!ge.isTreeLeaf;){var Ge=this._sortTreeChildrenByY(ge);ge=Ge.last()}ge!==null&&ye.select(ge)}else ye.select(xn)}}else if(ne.key==="Down")if(ve.isTreeExpanded&&!ve.isTreeLeaf){var ke=this._sortTreeChildrenByY(ve).first();ke!==null&&ye.select(ke)}else for(;ve!==null;){var xn=ve.findTreeParentNode();if(xn===null)break;var Fn=this._sortTreeChildrenByY(xn),In=Fn.indexOf(ve);if(In<Fn.length-1){ye.select(Fn.elt(In+1));break}else ve=xn}var Bn=ye.selection.first();Bn!==null&&ye.scrollToRect(Bn.actualBounds)}},we.prototype._sortTreeChildrenByY=function(ye){var ve=new go.List().addAll(ye.findTreeChildrenNodes());return ve.sort(function(ne,ke){var xn=ne.location,Fn=ke.location;return xn.y<Fn.y?-1:xn.y>Fn.y?1:xn.x<Fn.x?-1:xn.x>Fn.x?1:0}),ve},we.prototype.copyToClipboard=function(ye){go.CommandHandler.prototype.copyToClipboard.call(this,ye),this._lastPasteOffset.set(this.pasteOffset)},we.prototype.pasteFromClipboard=function(){var ye=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(ye,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),ye},Object.defineProperty(we.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(ye){if(ye!=="move"&&ye!=="select"&&ye!=="scroll"&&ye!=="tree"&&ye!=="none")throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+ye);this._arrowKeyBehavior=ye}}),Object.defineProperty(we.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(ye){if(!(ye instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+ye);this._pasteOffset.set(ye)}});var Pn=we,vn=Kt(18023),_t=Kt(15746),Mt=Kt(33170),Lt={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},At=Kt(52262),Wt=Kt(67294),Et=(ye,ve,ne)=>new Promise((ke,xn)=>{var Fn=Ge=>{try{ge(ne.next(Ge))}catch(Bn){xn(Bn)}},In=Ge=>{try{ge(ne.throw(Ge))}catch(Bn){xn(Bn)}},ge=Ge=>Ge.done?ke(Ge.value):Promise.resolve(Ge.value).then(Fn,In);ge((ne=ne.apply(ye,ve)).next())});function be({onCancel:ye,callback:ve}){let ne=(0,St.useRef)(),ke=(0,St.useRef)(),xn=(0,St.useRef)(),Fn=(0,St.useRef)(!1);const In=(0,St.useRef)(!1),[ge,Ge]=(0,St.useState)(0);function Bn(){const Qe=le.bx.make,ce={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"};ne.current=new le.S0(ke.current,{padding:20,grid:Qe(le.s_,"Grid",Qe(le.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Qe(le.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:he=>{var Yn=he.diagram.commandHandler.addTopLevelParts(he.diagram.selection,!0);Yn||he.diagram.currentTool.doCancel()},commandHandler:Qe(Pn),"clickCreatingTool.archetypeNodeData":{text:"\u672A\u547D\u540D",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:he=>{var Yn=he.subject;Yn.location=Yn.location.copy().snapToGridPoint(he.diagram.grid.gridOrigin,he.diagram.grid.gridCellSize),setTimeout(()=>{he.diagram.commandHandler.editTextBlock()},20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:he=>{var Yn=he.subject;setTimeout(()=>{he.diagram.commandHandler.editTextBlock()})},LinkRelinked:he=>{var Yn=he.parameter.part;Yn.invalidateConnectedLinks();var gi=he.subject;he.diagram.toolManager.linkingTool.isForwards?gi.toNode.invalidateConnectedLinks():gi.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),ne.current.nodeTemplate=Qe(le.NB,"Auto",{locationSpot:le.z6.Center,locationObjectName:"SHAPE",desiredSize:new le.$u(120,60),minSize:new le.$u(40,40),resizable:!0,resizeCellSize:new le.$u(10,10),rotatable:!0},new le.KX("location","loc",le.E9.parse).makeTwoWay(le.E9.stringify),new le.KX("desiredSize","size",le.$u.parse).makeTwoWay(le.$u.stringify),Qe(le.bn,{name:"SHAPE",fill:ce.white,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:le.z6.AllSides,toSpot:le.z6.AllSides},new le.KX("figure"),new le.KX("fill"),new le.KX("stroke","borderColor"),new le.KX("strokeWidth","thickness"),new le.KX("strokeDashArray","dash")),Qe(le.bn,{width:100,height:20,strokeWidth:0,fill:"transparent"}),Qe(le.al,{margin:1,textAlign:"center",overflow:le.al.OverflowEllipsis,editable:!0},new le.KX("text").makeTwoWay(),new le.KX("stroke","color"))),ne.current.nodeTemplate.toolTip=Qe("ToolTip",Qe(le.s_,"Vertical",{maxSize:new le.$u(200,NaN)},Qe(le.al,{font:"bold 10pt sans-serif",textAlign:"center"},new le.KX("text")),Qe(le.al,{font:"10pt sans-serif",textAlign:"center"},new le.KX("text","details"))));function Tn(he,Yn){var gi=(zn,Ri)=>{zn.handled=!0,zn.diagram.model.commit(hi=>{var xi=Ri.part.adornedPart,di=new le.E9().setRectSpot(xi.actualBounds,he);di.subtract(xi.location),di.scale(2,2),di.x+=Math.sign(di.x)*130,di.y+=Math.sign(di.y)*130,di.add(xi.location),di.snapToGridPoint(zn.diagram.grid.gridOrigin,zn.diagram.grid.gridCellSize);var Zn=hi.copyNodeData(xi.data);hi.setGroupKeyForNodeData(Zn,hi.getGroupKeyForNodeData(xi.data)),hi.addNodeData(Zn);var pi={from:xi.key,to:hi.getKeyForNodeData(Zn)};hi.addLinkData(pi);var Pe=zn.diagram.findNodeForData(Zn);Pe.location=di,zn.diagram.select(Pe),setTimeout(()=>{zn.diagram.commandHandler.editTextBlock()},20)})};return Qe(le.bn,{figure:Yn,alignment:he,alignmentFocus:he.opposite(),width:he.equals(le.z6.Top)||he.equals(le.z6.Bottom)?25:18,height:he.equals(le.z6.Top)||he.equals(le.z6.Bottom)?18:25,fill:"orange",stroke:ce.white,strokeWidth:4,mouseEnter:(zn,Ri)=>Ri.fill="dodgerblue",mouseLeave:(zn,Ri)=>Ri.fill="orange",isActionable:!0,click:gi,contextClick:gi})}function ti(he){return Qe(le.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:(Yn,gi)=>gi.fill="dodgerblue",mouseLeave:(Yn,gi)=>gi.fill="orange",click:(Yn,gi)=>{Yn.diagram.commandHandler.showContextMenu(gi.part.adornedPart)}},he||{})}ne.current.nodeTemplate.selectionAdornmentTemplate=Qe(le.uz,"Spot",Qe(le.Vm,{padding:10}),Tn(le.z6.Top,"TriangleUp"),Tn(le.z6.Left,"TriangleLeft"),Tn(le.z6.Right,"TriangleRight"),Tn(le.z6.Bottom,"TriangleDown"),ti({alignment:new le.z6(.75,0)}));function Be(he,Yn){return(gi,zn)=>{gi.handled=!0,gi.diagram.model.commit(Ri=>{Ri.set(zn.part.adornedPart.data,he,Yn)})}}function qt(he,Yn){return Yn||(Yn="color"),Qe(le.bn,{width:16,height:16,stroke:"lightgray",fill:he,margin:1,background:"transparent",mouseEnter:(gi,zn)=>zn.stroke="dodgerblue",mouseLeave:(gi,zn)=>zn.stroke="lightgray",click:Be(Yn,he),contextClick:Be(Yn,he)})}function ae(){return[Qe("ContextMenuButton",Qe(le.s_,"Horizontal",qt(ce.white,"fill"),qt(ce.beige,"fill"),qt(ce.extralightblue,"fill"),qt(ce.extralightred,"fill"))),Qe("ContextMenuButton",Qe(le.s_,"Horizontal",qt(ce.lightgray,"fill"),qt(ce.lightgreen,"fill"),qt(ce.lightblue,"fill"),qt(ce.lightred,"fill")))]}function Mn(){return[Qe("ContextMenuButton",Qe(le.s_,"Horizontal",qt(ce.black),qt(ce.green),qt(ce.blue),qt(ce.red))),Qe("ContextMenuButton",Qe(le.s_,"Horizontal",qt(ce.white),qt(ce.magenta),qt(ce.purple),qt(ce.orange)))]}function Gi(he,Yn){return Yn||(Yn="thickness"),Qe(le.bn,"LineH",{width:16,height:16,strokeWidth:he,margin:1,background:"transparent",mouseEnter:(gi,zn)=>zn.background="dodgerblue",mouseLeave:(gi,zn)=>zn.background="transparent",click:Be(Yn,he),contextClick:Be(Yn,he)})}function Ai(he,Yn){return Yn||(Yn="dash"),Qe(le.bn,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:he,margin:1,background:"transparent",mouseEnter:(gi,zn)=>zn.background="dodgerblue",mouseLeave:(gi,zn)=>zn.background="transparent",click:Be(Yn,he),contextClick:Be(Yn,he)})}function gn(){return[Qe("ContextMenuButton",Qe(le.s_,"Horizontal",Gi(1),Gi(2),Gi(3),Gi(4))),Qe("ContextMenuButton",Qe(le.s_,"Horizontal",Ai(null),Ai([2,4]),Ai([4,4])))]}function Ye(he,Yn){return Yn||(Yn="figure"),Qe(le.bn,{width:32,height:32,scale:.5,fill:"lightgray",figure:he,margin:1,background:"transparent",mouseEnter:(gi,zn)=>zn.fill="dodgerblue",mouseLeave:(gi,zn)=>zn.fill="lightgray",click:Be(Yn,he),contextClick:Be(Yn,he)})}ne.current.nodeTemplate.contextMenu=Qe("ContextMenu",Qe("ContextMenuButton",Qe(le.s_,"Horizontal",Ye("Rectangle"),Ye("RoundedRectangle"),Ye("Ellipse"),Ye("Diamond"))),Qe("ContextMenuButton",Qe(le.s_,"Horizontal",Ye("Parallelogram2"),Ye("ManualOperation"),Ye("Procedure"),Ye("Cylinder1"))),Qe("ContextMenuButton",Qe(le.s_,"Horizontal",Ye("Terminator"),Ye("CreateRequest"),Ye("Document"),Ye("TriangleDown"))),ae(),Mn(),gn()),ne.current.groupTemplate=Qe(le.ZA,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:le.z6.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:(he,Yn)=>{var gi=Yn.addMembers(Yn.diagram.selection,!0);gi||Yn.diagram.currentTool.doCancel()},avoidable:!1},new le.KX("location","loc",le.E9.parse).makeTwoWay(le.E9.stringify),Qe(le.s_,"Auto",{name:"BODY"},Qe(le.bn,{parameter1:10,fill:ce.white,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:le.z6.AllSides,toSpot:le.z6.AllSides},new le.KX("fill"),new le.KX("stroke","color"),new le.KX("strokeWidth","thickness"),new le.KX("strokeDashArray","dash")),Qe(le.Vm,{background:"transparent",margin:20})),Qe(le.al,{alignment:le.z6.Top,alignmentFocus:le.z6.Bottom,font:"bold 12pt sans-serif",editable:!0},new le.KX("text"),new le.KX("stroke","color"))),ne.current.groupTemplate.selectionAdornmentTemplate=Qe(le.uz,"Spot",Qe(le.s_,"Auto",Qe(le.bn,{fill:null,stroke:"dodgerblue",strokeWidth:3}),Qe(le.Vm,{margin:1.5})),ti({alignment:le.z6.TopRight,alignmentFocus:le.z6.BottomRight})),ne.current.groupTemplate.contextMenu=Qe("ContextMenu",ae(),Mn(),gn()),ne.current.linkTemplate=Qe(le.rU,{layerName:"Foreground",routing:le.rU.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new le.KX("fromSpot","fromSpot",le.z6.parse),new le.KX("toSpot","toSpot",le.z6.parse),new le.KX("fromShortLength","dir",he=>he>=1?10:0),new le.KX("toShortLength","dir",he=>he>=1?10:0),new le.KX("points").makeTwoWay(),Qe(le.bn,{strokeWidth:2},new le.KX("stroke","color"),new le.KX("strokeWidth","thickness"),new le.KX("strokeDashArray","dash")),Qe(le.bn,{segmentIndex:0,segmentOffset:new le.E9(15,0),segmentOrientation:le.rU.OrientAlong,alignmentFocus:le.z6.Right,figure:"circle",width:10,strokeWidth:0},new le.KX("fill","color"),new le.KX("visible","dir",he=>he===1)),Qe(le.bn,{segmentIndex:-1,segmentOffset:new le.E9(-10,6),segmentOrientation:le.rU.OrientPlus90,alignmentFocus:le.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new le.KX("fill","color"),new le.KX("visible","dir",he=>he>=1),new le.KX("width","thickness",he=>7+3*he),new le.KX("height","thickness",he=>7+3*he),new le.KX("segmentOffset","thickness",he=>new le.E9(-15,4+1.5*he))),Qe(le.bn,{segmentIndex:0,segmentOffset:new le.E9(15,-6),segmentOrientation:le.rU.OrientMinus90,alignmentFocus:le.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new le.KX("fill","color"),new le.KX("visible","dir",he=>he===2),new le.KX("width","thickness",he=>7+3*he),new le.KX("height","thickness",he=>7+3*he),new le.KX("segmentOffset","thickness",he=>new le.E9(-15,4+1.5*he))),Qe(le.al,{alignmentFocus:new le.z6(0,1,-4,0),editable:!0},new le.KX("text").makeTwoWay(),new le.KX("stroke","color"))),ne.current.linkTemplate.selectionAdornmentTemplate=Qe(le.uz,Qe(le.bn,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:xe(2)},new le.KX("pathPattern","thickness",xe)),ti({alignmentFocus:new le.z6(0,0,-6,-4)}));function xe(he){return Qe(le.bn,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(he+4).toString()+" H3"})}function ei(he){var Yn="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return he===0?Yn="M0 0 M16 16 M0 8 L16 8":he===2&&(Yn="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),Qe(le.bn,{geometryString:Yn,margin:2,background:"transparent",mouseEnter:(gi,zn)=>zn.background="dodgerblue",mouseLeave:(gi,zn)=>zn.background="transparent",click:Be("dir",he),contextClick:Be("dir",he)})}function Si(he){var Yn=(gi,zn)=>{gi.handled=!0,gi.diagram.model.commit(Ri=>{var hi=zn.part.adornedPart;Ri.set(hi.data,he?"toSpot":"fromSpot",le.z6.stringify(le.z6.AllSides)),(he?hi.toNode:hi.fromNode).invalidateConnectedLinks()})};return Qe(le.bn,{width:12,height:12,fill:"transparent",mouseEnter:(gi,zn)=>zn.background="dodgerblue",mouseLeave:(gi,zn)=>zn.background="transparent",click:Yn,contextClick:Yn})}function qe(he,Yn){var gi=0,zn=le.z6.RightSide;he.equals(le.z6.Top)?(gi=270,zn=le.z6.TopSide):he.equals(le.z6.Left)?(gi=180,zn=le.z6.LeftSide):he.equals(le.z6.Bottom)&&(gi=90,zn=le.z6.BottomSide),Yn||(gi-=180);var Ri=(hi,xi)=>{hi.handled=!0,hi.diagram.model.commit(di=>{var Zn=xi.part.adornedPart;di.set(Zn.data,Yn?"toSpot":"fromSpot",le.z6.stringify(zn)),(Yn?Zn.toNode:Zn.fromNode).invalidateConnectedLinks()})};return Qe(le.bn,{alignment:he,alignmentFocus:he.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:gi,background:"transparent",mouseEnter:(hi,xi)=>xi.background="dodgerblue",mouseLeave:(hi,xi)=>xi.background="transparent",click:Ri,contextClick:Ri})}ne.current.linkTemplate.contextMenu=Qe("ContextMenu",Mn(),gn(),Qe("ContextMenuButton",Qe(le.s_,"Horizontal",ei(0),ei(1),ei(2))),Qe("ContextMenuButton",Qe(le.s_,"Horizontal",Qe(le.s_,"Spot",Si(!1),qe(le.z6.Top,!1),qe(le.z6.Left,!1),qe(le.z6.Right,!1),qe(le.z6.Bottom,!1)),Qe(le.s_,"Spot",{margin:new le.Zt(0,0,0,2)},Si(!0),qe(le.z6.Top,!0),qe(le.z6.Left,!0),qe(le.z6.Right,!0),qe(le.z6.Bottom,!0)))));const Hn=`{ "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 So=["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 Bi(he){return console.log("shapeName:",he),So.indexOf(he)>=0}var Qi=new le.YI(xn.current,{maxSelectionCount:1,linkTemplate:Qe(le.rU,{locationSpot:le.z6.Center,selectionAdornmentTemplate:Qe(le.uz,"Link",{locationSpot:le.z6.Center},Qe(le.bn,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),Qe(le.bn,{toArrow:"Standard",stroke:null}))},{routing:le.rU.AvoidsNodes,curve:le.rU.JumpOver,corner:5,toShortLength:4},new le.KX("points"),Qe(le.bn,{isPanelMain:!0,strokeWidth:2}),Qe(le.bn,{toArrow:"Standard",stroke:null})),model:new le.FJ([{text:"\u672A\u547D\u540D",size:"100 100",fill:null,stroke:"#000"},...le.bn.getFigureGenerators().toArray().map(he=>({text:"\u672A\u547D\u540D",size:"100 100",figure:he.key,fill:"white",stroke:"#666",borderColor:"#000"}))])});return ne.current.addDiagramListener("TextEdited",function(he){var Yn;const gi=he.subject.part;var zn=(Yn=document.activeElement)==null?void 0:Yn.value;typeof zn=="string"&&zn.trim()===""&&ne.current.model.commit(function(Ri){Ri.set(gi.data,"text","\u672A\u547D\u540D"),ne.current.commandHandler.stopCommand()},"increment")}),Qi.nodeTemplate=Qe(le.NB,"Auto",{locationSpot:le.z6.Center},new le.KX("location","location",le.E9.parse).makeTwoWay(le.E9.stringify),Qe(le.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 le.KX("stroke").makeTwoWay(),new le.KX("fill").makeTwoWay(),new le.KX("figure")),Qe(le.al,{margin:new le.Zt(5,5,3,5),font:"10pt sans-serif",minSize:new le.$u(16,16),maxSize:new le.$u(10,NaN),textAlign:"center",editable:!0},new le.KX("key").makeTwoWay())),setTimeout(()=>{ne.current.grid=Qe(le.s_,"Grid",Qe(le.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Qe(le.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),ne.current.grid.visible=!0,ne.current.grid.gridCellStroke="darkgray",ne.current.grid.gridCellStrokeWidth=1},300),window.myDiagrams=ne.current,ne.current}const ri=()=>Et(this,null,function*(){var Qe,ce=ne.current.makeImage();const Tn=yield(0,Mt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:ce.src,file_data:JSON.stringify({login:(Qe=(0,At.eY)())==null?void 0:Qe.login,data:JSON.parse(ne.current.model.toJson())})}});ve({src:Tn.url})});return(0,St.useEffect)(()=>(setTimeout(()=>{Bn()},500),Ge(ge+1),()=>{ne.current=null}),[]),Wt.createElement("div",{ref:In,className:"body-overflow-initial"},Wt.createElement(Le.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!ge,destroyOnClose:!0,maskClosable:!1,rootClassName:"zIndex-9999",title:Wt.createElement(nn.Z,null,Wt.createElement(_t.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),Wt.createElement(_t.Z,{onClick:()=>{var Qe,ce,Tn=ne.current.selection.first();if(Fn.current=!Fn.current,document.activeElement&&Tn){let ti=(ce=(Qe=document.activeElement)==null?void 0:Qe.value)==null?void 0:ce.trim();typeof ti=="string"&&ne.current.model.commit(function(Be){Be.set(Tn.data,"text",ti||"\u672A\u547D\u540D"),ne.current.commandHandler.stopCommand()},"increment")}Ge(ge+1)}},Wt.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:ye},Wt.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative",display:Fn.current?"none":"block"},className:Lt.flowChartWrp},Wt.createElement("div",{style:{display:"flex",height:"100%"}},Wt.createElement("div",{style:{width:"300px",height:"100%"}},Wt.createElement("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"}},"\u56FE\u5F62\u5E93"),Wt.createElement("div",{style:{height:"calc(100% - 50px)"},className:Lt.myPaletteDiv,ref:xn})),Wt.createElement("div",{style:{flex:1,position:"relative"}},Wt.createElement("div",{ref:ke,style:{height:"80vh"}}))),Wt.createElement("div",{className:"tr"},Wt.createElement(Ae.ZP,{size:"large",onClick:ri,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var Nn=be,mi=Kt(98813),On=Kt(37720);const Gn=mi.ZP.Group,Fi={margin:"0 8px"};var yn=({callback:ye,onCancel:ve})=>{function ne(ke){ye(ke)}return St.createElement(ee.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ne},St.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},St.createElement("span",{style:Fi},"\u5355\u5143\u683C\u6570\uFF1A"),St.createElement("span",{style:Fi},"\u884C\u6570"),St.createElement(ee.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},St.createElement(On.Z,null)),St.createElement("span",{style:Fi},"\u5217\u6570"),St.createElement(ee.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},St.createElement(On.Z,null))),St.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},St.createElement("span",{style:Fi},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),St.createElement(ee.default.Item,{name:"align"},St.createElement(Gn,null,St.createElement(mi.ZP,{value:"default"},St.createElement("i",{className:"fa fa-align-justify"})),St.createElement(mi.ZP,{value:"left"},St.createElement("i",{className:"fa fa-align-left"})),St.createElement(mi.ZP,{value:"center"},St.createElement("i",{className:"fa fa-align-center"})),St.createElement(mi.ZP,{value:"right"},St.createElement("i",{className:"fa fa-align-right"}))))),St.createElement("div",{className:"flex-container flex-end"},St.createElement(Ae.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),St.createElement(Ae.ZP,{type:"ghost",onClick:ve},"\u53D6\u6D88")))},Li=Kt(59637),yi=Kt(61016),Ui=Kt.n(yi),xr=(0,St.forwardRef)(({use3d:ye,width:ve,height:ne,callback:ke,showSaveButton:xn},Fn)=>{const In=(0,St.useRef)(),ge=(0,St.useRef)(),[Ge,Bn]=(0,St.useState)(!1),ri=(0,St.useRef)({id:In,appName:"graphing",width:ve||1e3,height:ne||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)(()=>{ge.current=new(Ui())(ri.current,!0),window.onload=function(){ge.current.inject("applet_container")}},[]);const Qe=()=>{var ce=window.ggbApplet.getPNGBase64(1,!0,72);return ke&&ke(ce),ce};return(0,St.useEffect)(()=>{ri.current.appName=Ge?"3D":"graphing",ge.current.inject("applet_container")},[Ge]),(0,St.useEffect)(()=>{Bn(ye)},[ye]),(0,St.useImperativeHandle)(Fn,()=>({getImgData:Qe})),St.createElement(St.Fragment,null,St.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:In}),St.createElement(nn.Z,{align:"middle"},St.createElement(_t.Z,{flex:1},St.createElement(Li.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Ge,onChange:ce=>Bn(ce)})),St.createElement(_t.Z,null,St.createElement(Ae.ZP,{size:"large",onClick:Qe,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Mo=Kt(36527),ao=Kt(2453);const $i="link",Kr="upload-image",No="add-flowchart",fr="draw-image",sr="add-flowchart",Pr="code-block",Vi="add-table",Ir="------------",Ns={default:Ir,left:`:${Ir}`,center:`:${Ir}:`,right:`${Ir}:`};var jr=Kt(99914);function Va(){}let Hs=0;const Ws=1e4,gr="\u2581",Ti="@\u2581\u2581@",We="@\u2581@",xt=`
**\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`,Sn=["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 mn(ye){return/^\d+$/.test(ye)?`${ye}px`:ye}const en=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",sn={[en+"-B"]:"bold",[en+"-I"]:"italic"},wn={[$i]:"\u6DFB\u52A0\u94FE\u63A5",[Pr]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[Kr]:"\u6DFB\u52A0\u56FE\u7247",[fr]:"\u6DFB\u52A0\u753B\u56FE",[No]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[Vi]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var Qn=({defaultValue:ye="",onChange:ve,width:ne="100%",height:ke=400,miniToolbar:xn=!1,isFocus:Fn=!1,watch:In,insertTemp:ge,mode:Ge="markdown",id:Bn="markdown-editor-id",showResizeBar:ri=!1,noStorage:Qe=!1,showNullButton:ce=!1,showNullProgramButton:Tn=!1,hidetoolBar:ti=!1,fullScreen:Be=!1,onBlur:qt,onCMBeforeChange:ae,onFullScreen:Mn,className:Gi="",disablePaste:Ai=!1,disabled:gn=!1,disabledFill:Ye=!1,placeholder:xe="",values:ei="",extraUse:Si})=>{const[qe,Hn]=(0,St.useState)(null),[So,Bi]=(0,St.useState)(ye),[Qi,he]=(0,St.useState)(In),[Yn,gi]=(0,St.useState)(Be),[zn,Ri]=(0,St.useState)(""),[hi,xi]=(0,St.useState)(0),[di,Zn]=(0,St.useState)(ke),[pi,Pe]=(0,St.useState)(!1),[io,Fe]=(0,St.useState)(0),[Dn,Hi]=(0,St.useState)(0),ci=(0,St.useRef)(),nr=(0,St.useRef)(),Yi=(0,St.useRef)(),ui=(0,St.useRef)();(0,St.useEffect)(()=>{const ai=window.scrollY||window.pageYOffset;Bi(ei),qe==null||qe.setValue(ei),window.scrollTo(0,ai)},[ei]),(0,St.useEffect)(()=>{Mn==null||Mn(Yn)},[Yn]),(0,St.useEffect)(()=>{if(ci.current){let ai=function(ki,Ke){var oo;if(Ai){Ke.preventDefault();return}const vo=Ke.clipboardData;if(vo){const Xo=vo.types.toString(),Eo=vo.items;if(Xo==="Files"||vo.types.indexOf("Files")>-1){if(Ke.preventDefault(),Ge=="stex")return;try{let Ro=Eo[1];((oo=Eo[0])==null?void 0:oo.kind)==="file"&&(Ro=Eo[0]);const ar=Ro.getAsFile(),hs=ar.name.split(".").pop();(0,Ln.I)(ar,Tr=>{var Ya,Na,pe;Tr.id?((Ya=ar==null?void 0:ar.type)==null?void 0:Ya.indexOf("image"))>-1?ii.replaceSelection(`<img width="100%" src="/api/attachments/${Tr.id}?type=${Tr.content_type})" alt="" />`):((Na=ar==null?void 0:ar.type)==null?void 0:Na.indexOf("video"))>-1?ii.replaceSelection(`<video width="100%" controls src="/api/attachments/${Tr.id}"></video>`):((pe=ar==null?void 0:ar.type)==null?void 0:pe.indexOf("pdf"))>-1?ii.replaceSelection(`<a href="/api/attachments/${Tr.id}?type=${ar.type}&disposition=inline" target="_blank">${ar.name}</a>`):Sn.includes(hs)?ii.replaceSelection(`<a href="/api/attachments/${Tr.id}?type=office&disposition=inline" target="_blank">${ar.name}</a>`):ii.replaceSelection(`[${ar.name}](/api/attachments/${Tr.id}?type=${Tr.content_type})`):(Tr==null?void 0:Tr.status)===401&&(document.location.href="/user/login")})}catch(Ro){ao.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const ii=Ie().fromTextArea(ci.current,{mode:Ge,lineNumbers:!xn,lineWrapping:!0,value:ye,autoCloseTags:!0,autoCloseBrackets:!0});return ii.on("keyup",function(ki,Ke){Ke.keyCode===8&&(ki.getValue()==""?ii.setOption("placeholder",xe):ii.setOption("placeholder",null))}),ii.on("keydown",function(ki,Ke){if(Ke.keyCode===8){var oo=zi(ki);oo&&Ke.preventDefault()}}),Fn&&ii.focus(),ii.on("paste",ai),gn&&ii.on("beforeChange",function(ki,Ke){(Ke.origin==="paste"||Ke.origin==="+input")&&Ke.cancel()}),Hn(ii),()=>{ii.off("paste",ai)}}},[]);const Ki=(0,St.useCallback)(()=>{if(nr.current)try{}catch(ai){console.log(ai,"---- to set md editor body height")}},[di,nr,Yn]);(0,St.useEffect)(()=>{function ai(){let ii=new $e.Z(ki=>{for(let Ke of ki)(Ke.target.offsetHeight>0||Ke.target.offsetWidth>0)&&(Ki(),qe.setSize("100%","100%"),qe.refresh())});return ii.observe(ci.current.parentElement),ii}if(qe){const ii=ai();return()=>{var ki,Ke;(ki=ci.current)!=null&&ki.parentElement&&ii.unobserve((Ke=ci.current)==null?void 0:Ke.parentElement)}}},[qe,Ki]),(0,St.useEffect)(()=>{if(qe){let ai=[];for(const[ii,ki]of Object.entries(sn)){let Ke={[ii]:()=>{Ci(ki)}};ai.push(Ke),qe.addKeyMap(Ke)}return()=>{for(let ii of ai)qe.removeKeyMap(ii)}}},[qe]),(0,St.useEffect)(()=>{Be!==Yn&&gi(Be)},[Be]),(0,jr.Z)(()=>{if(!Qe&&hi>0){let ai=new Date().getTime(),ii=window.sessionStorage.getItem(Bn);ai>=hi+Ws&&(!ii||ii!==So)&&(window.sessionStorage.setItem(Bn,So),Pe(!0))}},Ws),(0,St.useEffect)(()=>{he(In)},[qe,In]),(0,St.useEffect)(()=>{qe&&Fn&&qe.focus()},[qe,Fn]),(0,St.useEffect)(()=>{if(Qi&&qe){let ai=function(ki){let Ke=ki.target;if(ui.current){let oo=Ke.scrollTop/Ke.scrollHeight;ui.current.scrollTop=ui.current.scrollHeight*oo}};const ii=qe.getScrollerElement();return ii.addEventListener("scroll",ai),()=>{ii.removeEventListener("scroll",ai)}}},[qe,Qi]),(0,St.useEffect)(()=>{if(qe&&ae){let ai=function(ii,ki){ae(ii,ki)};return qe.on("beforeChange",ai),()=>{qe.off("beforeChange",ai)}}},[qe,ae]),(0,St.useEffect)(()=>{if(qe&&qt){let ai=function(){qt(qe.getValue())};return qe.on("blur",ai),()=>{qe.off("blur",ai)}}},[qe,qt]);function zi(ai,ii){var ki=ai.getDoc(),Ke=ki.getCursor(),oo=ki.getLine(Ke.line),vo=oo.charAt(Ke.ch-1),Xo=oo.lastIndexOf("@\u2581@",Ke.ch),Eo=oo.lastIndexOf("@\u2581\u2581@",Ke.ch),Ro=Xo>Eo?Xo:Eo,ar=Xo>Eo?3:4;if(Ti.indexOf(vo)===-1)return null;if(console.log("change1:",ii,ai,oo,Ke,Ro,Xo,Eo,vo),Ro>=0&&Ke.ch-Ro<5){var hs=Ro+ar;return ki.replaceRange("",{line:Ke.line,ch:Ro},{line:Ke.line,ch:hs}),{line:Ke.line,ch:hs}}return null}(0,St.useEffect)(()=>{if(qe){let ai=function(ii,ki){const Ke=ii.getValue();Bi(Ke),xi(new Date().getTime()),ii.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ve&&(Tn?ve(Ke,Ua(Ke)):ve(Ke))};return qe.on("change",ai),()=>{qe.off("change",ai)}}},[qe,ve]),(0,St.useEffect)(()=>{if(qe)if(ye==null)qe.setValue(""),Bi("");else{const ai=window.scrollY||window.pageYOffset;ye!==qe.getValue()&&(qe.setValue(ye),Bi(ye),qe.setCursor(gn?1:qe.lineCount(),0),window.scrollTo(0,ai))}},[qe,ye]);const Ci=(0,St.useCallback)(ai=>{const ii=qe.getCursor(),ki=qe.getSelection();let Ke=ki.split(`
`);switch(ai){case"bold":return qe.replaceSelection("**"+ki+"**"),ki===""&&qe.setCursor(ii.line,ii.ch+2),qe.focus();case"italic":return qe.replaceSelection("*"+ki+"*"),ki===""&&qe.setCursor(ii.line,ii.ch+1),qe.focus();case"code":return qe.replaceSelection("`"+ki+"`"),ki===""&&qe.setCursor(ii.line,ii.ch+1),qe.focus();case"inline-latex":return Ri("inline-latex"),qe.focus();case"latex":return qe.replaceSelection("```latex\n"+ki+"\n```"),qe.setCursor(ii.line+1,ki.length+1),qe.focus();case"line-break":return qe.replaceSelection(`<br/>
`),qe.focus();case"list-ul":return ki===""?qe.replaceSelection("- "+ki):qe.replaceSelection(Ke.map(oo=>oo===""?"":`- ${oo}`).join(`
`)),qe.focus();case"list-ol":return ki===""?qe.replaceSelection("1. "+ki):qe.replaceSelection(Ke.map((oo,vo)=>oo===""?"":`${vo+1}. ${oo}`).join(`
`)),qe.focus();case"add-null-ch":return ki===""&&qe.setCursor(ii.line,ii.ch),qe.replaceSelection(gr),qe.focus();case"add-signal":return ki===""&&qe.setCursor(ii.line,ii.ch),qe.replaceSelection(We),qe.focus();case"add-multiple":return ki===""&&qe.setCursor(ii.line,ii.ch),qe.replaceSelection(Ti),qe.focus();case"inster-template-1":return ki===""&&qe.setCursor(ii.line,ii.ch),qe.replaceSelection(xt),qe.focus();case"eraser":return qe.setValue(""),qe.focus();case"trigger-watch":return he(!Qi),qe.focus();case"trigger-full-screen":return gi(!Yn),qe.focus();case $i:Ri($i);return;case Pr:Ri(Pr);return;case Kr:Ri(Kr);return;case fr:Ri(fr);return;case"maths-latex":Ri("maths-latex");return;case No:Ri(No);return;case Vi:Ri(Vi);return;default:throw new Error}},[qe,Qi,Yn]),ln=(0,St.useCallback)((ai,ii)=>{var ki,Ke,oo,vo,Xo,Eo;switch(Ri(""),zn){case $i:const{title:Ya,link:Na}=ai;return qe.replaceSelection(`[${Ya}](${Na})`),qe.focus();case Pr:const{language:pe,content:Vo}=ai;return qe.replaceSelection(["```"+pe,Vo,"```"].join(`
`)),qe.focus();case"maths-latex":for(var Ro=atob(ai),ar=new Uint8Array(Ro.length),hs=0;hs<Ro.length;hs++)ar[hs]=Ro.charCodeAt(hs);var Tr=new Blob([ar],{type:"image/png"});(0,Ln.I)(Tr,bi=>{bi.id?qe.replaceSelection(`![,](/api/attachments/${bi.id}?type=${bi.content_type})`):(bi==null?void 0:bi.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":qe.replaceSelection("`$$"+ai+"$$`");break;case Kr:case fr:case sr:const{src:ba,alt:Ka}=ai,Io=ii,Vs=(oo=(Ke=(ki=Io==null?void 0:Io.name)==null?void 0:ki.split("."))==null?void 0:Ke.pop)==null?void 0:oo.call(Ke);return((vo=Io==null?void 0:Io.type)==null?void 0:vo.indexOf("image"))>-1||!(Io!=null&&Io.type)?Io!=null&&Io.align||Io!=null&&Io.width?qe.replaceSelection(`<p style="text-align:${Io.align||"initial"}"><img width="${Io.width?Io.width+"%":"initial"}" src="${ba}" alt="${Ka||""}" /></p>`):qe.replaceSelection(`<img width="100%" src="${ba}" alt="${Ka||""}" />`):((Xo=Io==null?void 0:Io.type)==null?void 0:Xo.indexOf("video"))>-1?qe.replaceSelection(`<video width="100%" controls src="${ba}"></video>`):((Eo=Io==null?void 0:Io.type)==null?void 0:Eo.indexOf("pdf"))>-1?qe.replaceSelection(`<a href="${ba}?type=${Io.type}&disposition=inline" target="_blank">${Io.name}</a>`):Sn.includes(Vs)?qe.replaceSelection(`<a href="${ba}?type=office&disposition=inline" target="_blank">${Io.name}</a>`):qe.replaceSelection(`[${Io.name}](${ba})`),qe.focus();case Vi:const{row:Vl,col:wl,align:yo}=ai;let lr=`
`;for(let bi=0;bi<Vl;bi++){let Wi=[],wo=[];for(let Zo=0;Zo<wl;Zo++)bi===1&&wo.push(Ns[yo]),Wi.push(" ");bi===1&&(lr+=`| ${wo.join(" | ")} |
`),lr+=`| ${Wi.join(wl===1?"":" | ")} |
`}return qe.replaceSelection(lr+`
`),qe.focus();default:throw new Error}},[qe,zn]),It=(0,St.useMemo)(()=>{switch(zn){case $i:return St.createElement(Ce,{callback:ln,onCancel:mo});case Pr:return St.createElement(un.Z,{callback:ln,onCancel:mo});case Kr:return St.createElement(Ln.Z,{callback:ln,onCancel:mo});case No:return St.createElement(Nn,{callback:ln,onCancel:mo});case Vi:return St.createElement(yn,{callback:ln,onCancel:mo});case"maths-latex":return St.createElement(xr,{showSaveButton:!0,callback:ln});case"inline-latex":return St.createElement(Mo.Z,{showSaveButton:!0,callback:ln});default:return null}},[zn]);function mo(){Ri("")}(0,St.useEffect)(()=>{if(Yi.current){let ai=function(Xo){oo=!0,vo=Xo.pageY},ii=function(){oo=!1},ki=function(Xo){if(oo){let Eo=Xo.pageY-vo;Eo<0&&(Eo=0),Eo>300&&(Eo=300);let Ro=ke+Eo+"px";Zn(Ro)}},Ke=Yi.current,oo=!1,vo=0;return Ke.addEventListener("mousedown",ai),document.addEventListener("mousemove",ki),document.addEventListener("mouseup",ii),()=>{Ke.removeEventListener("mousedown",ai),document.removeEventListener("mousemove",ki),document.removeEventListener("mouseup",ii)}}},[qe,Yi]),(0,St.useEffect)(()=>{Zn(ke)},[ke]);const xs=mn(ne),ta=mn(di),Ps={width:xs,height:ta},al=(0,St.useMemo)(()=>{if(hi){let ai=new Date(hi),ii=ai.getHours(),ki=ai.getMinutes(),Ke=ai.getSeconds();return ii=ii<10?"0"+ii:ii,ki=ki<10?"0"+ki:ki,Ke=Ke<10?"0"+Ke:Ke,`${ii}:${ki}:${Ke}`}return 0},[hi]),Ua=ai=>{const ii=[];if(Tn){let ki=-1;ai=ai.replace(/(@▁▁@|@▁@)/g,function(Ke,oo,vo){ii.push({multiLine:Ke!==We})})}return ii};function Wl(){window.sessionStorage.removeItem(Bn),Pe(!1),xi(0)}function Pl(){Pe(!1),xi(0),qe.setValue(window.sessionStorage.getItem(Bn))}(0,St.useEffect)(()=>{wn[zn]&&zn!==fr&&zn!==No&&setTimeout(()=>{const ai=document.getElementsByClassName("markdown-popup-form")[0],ii=window.innerWidth/2-ai.offsetWidth/2,ki=window.innerHeight/2-ai.offsetHeight/2;Fe(ii),Hi(ki)},0)},[zn]);const Po=ai=>{ai.preventDefault();const ii=ai.clientX-io,ki=ai.clientY-Dn;document.body.onmousemove=Ke=>{let oo=Ke.clientX-ii,vo=Ke.clientY-ki;const Xo=document.getElementsByClassName("markdown-popup-form")[0],Eo=window.innerWidth-Xo.offsetWidth,Ro=window.innerHeight-Xo.offsetHeight;oo=Math.max(0,Math.min(oo,Eo)),vo=Math.max(0,Math.min(vo,Ro)),Jo(Ke.clientX,Ke.clientY,ii,ki)&&(Fe(oo),Hi(vo))},document.body.onmouseup=function(){document.body.onmousemove=null}},Jo=(ai,ii,ki,Ke)=>{const oo=document.body.clientHeight,vo=document.body.clientWidth;return ai<20&&ki>ai||ai>vo-20&&ki<ai||ii<20&&Ke>ii||ii>oo-20&&Ke<ii?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return St.createElement(St.Fragment,null,St.createElement("div",{className:"markdown-editor-wrapper",ref:nr},St.createElement("div",{className:`markdown-editor-container ${Gi} ${Qi?"on-preview":""} ${xn?"mini":""} ${Yn?"full-screen":""}`,style:Ps},St.createElement(Ht,{insertTemp:ge,watch:Qi,fullScreen:Yn,showNullButton:ce,showNullProgramButton:Tn,onActionCallback:Ci,hidetoolBar:ti,extraUse:Si}),St.createElement("div",{className:"markdown-editor-body"},St.createElement("div",{className:"codemirror-container"},St.createElement("textarea",{ref:ci,placeholder:xe})),Qi?St.createElement("div",{ref:ui,className:"preview-container"},Ge==="stex"&&St.createElement(Ee,{value:So}),Ge!=="stex"&&St.createElement(Ue.Z,{disabledFill:Ye,showProgramFill:Tn,value:So})):null))),ri?St.createElement("a",{ref:Yi,className:"editor-resize"}):null,zn===fr&&St.createElement(fn,{callback:ln,onCancel:mo}),zn===No&&St.createElement(Nn,{callback:ln,onCancel:mo}),St.createElement($t.Z,null,wn[zn]&&zn!==fr&&zn!==No?St.createElement(Le.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:io,top:Dn},title:St.createElement("div",{style:{cursor:"move"},onMouseDown:Po},wn[zn]),open:!0,onCancel:mo,footer:null,destroyOnClose:!0,width:zn===No?"1200px":null,height:zn===No?"80vh":null,className:"markdown-popup-form"},It):null))}},70859:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return zt},I:function(){return $t}});var St=Kt(91773),de=Kt(2453),Ie=Kt(28802),$e=Kt(78957),me=Kt(37720),re=Kt(98813),Zt=Kt(85804),Oe=Kt(15476),ue=Kt(67294),Se=Kt(67294),Ue=Object.defineProperty,Ee=Object.defineProperties,Ze=Object.getOwnPropertyDescriptors,Ft=Object.getOwnPropertySymbols,et=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,ct=(ee,te,Ae)=>te in ee?Ue(ee,te,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):ee[te]=Ae,lt=(ee,te)=>{for(var Ae in te||(te={}))et.call(te,Ae)&&ct(ee,Ae,te[Ae]);if(Ft)for(var Ae of Ft(te))nt.call(te,Ae)&&ct(ee,Ae,te[Ae]);return ee},pt=(ee,te)=>Ee(ee,Ze(te));const{useForm:vt}=St.default,Ct={width:280,marginRight:10},Nt={labelCol:{span:5},wrapperCol:{span:19}};var zt=({callback:ee,onCancel:te})=>{const[Ae]=vt();let se=(0,ue.useRef)();function Re(Cn){se.current.width=Ae.getFieldValue("width"),se.current.align=Ae.getFieldValue("align"),ee(Cn,se.current)}function He(Cn,Rn){if(Cn.status===-1){de.ZP.error(Cn.message);return}Ae.setFieldsValue({src:`/api/attachments/${Cn.id}`,type:Rn.type})}function ze(Cn){let Rn=Cn.target.files[0];se.current=Rn,$t(Rn,He)}return Se.createElement(St.default,pt(lt({form:Ae},Nt),{className:"upload-image-panel",onFinish:Re,style:{width:470,overflow:"hidden"}}),Se.createElement(St.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},Se.createElement("div",{className:"flex-container"},Se.createElement(St.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},Se.createElement(Ie.default,{style:Ct})),Se.createElement(Ht,{onFileChange:ze}))),Se.createElement(St.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},Se.createElement(Ie.default,{style:{width:264}})),Se.createElement(St.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},Se.createElement($e.Z,null,Se.createElement(St.default.Item,{name:"width",style:{margin:0}},Se.createElement(me.Z,{style:{width:264}})),Se.createElement("span",{className:"ml8"},"%"))),Se.createElement(St.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},Se.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"}]})),Se.createElement("aside",null,Se.createElement(St.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},Se.createElement(Zt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),Se.createElement(Zt.ZP,{type:"default",onClick:te},"\u53D6\u6D88"))))};function Ht({onFileChange:ee}){return Se.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",Se.createElement("input",{type:"file",onChange:ee}))}function $t(ee,te){if(!ee)throw new String("\u6CA1\u6709\u6587\u4EF6");let Ae=new FormData;Ae.append("editormd-image-file",ee),Ae.append("file_param_name","editormd-image-file"),Ae.append("byxhr","true");var se=new window.XMLHttpRequest;se.withCredentials=!0,se.addEventListener("load",function(Re){te(JSON.parse(Re.target.responseText),ee)},!1),se.addEventListener("error",function(Re){console.error(Re)},!1),se.open("POST",`${Oe.KI}/api/attachments.json`),se.send(Ae)}},76621:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return Ie}});var St=Kt(67294),de=Kt(73935);class Ie extends St.Component{constructor(me){super(me);const re=window.document;this.node=re.createElement("div"),re.body.appendChild(this.node)}render(){const{children:me}=this.props;return(0,de.createPortal)(me,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},36295:function(tn,An,Kt){"use strict";Kt.d(An,{SV:function(){return le},ZP:function(){return fn}});var St=Kt(67294),de=Kt(91033);const Ie={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"]},$e={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"]},me={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(`
`)}]},Zt={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 Oe=Kt(84204),ue=Kt.n(Oe),Se=(we,Pn,vn)=>new Promise((_t,Mt)=>{var Lt=Et=>{try{Wt(vn.next(Et))}catch(be){Mt(be)}},At=Et=>{try{Wt(vn.throw(Et))}catch(be){Mt(be)}},Wt=Et=>Et.done?_t(Et.value):Promise.resolve(Et.value).then(Lt,At);Wt((vn=vn.apply(we,Pn)).next())});const Ue={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"]}},Ee=(we,Pn,vn,_t)=>{const Mt=Pn.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:vn.lineNumber,endColumn:vn.column});return Array.from(new Set(Mt.match(/\b\w{2,}\b/g)||[])).map(At=>({label:At,kind:we.languages.CompletionItemKind.Text,insertText:At,range:_t}))},Ze=(we,Pn,vn,_t)=>{we.languages.registerCompletionItemProvider(Pn,{provideCompletionItems(Mt,Lt){const At=Mt.getWordUntilPosition(Lt),Wt={startLineNumber:Lt.lineNumber,endLineNumber:Lt.lineNumber,startColumn:At.startColumn,endColumn:At.endColumn},Et=Mt.getLineContent(Lt.lineNumber).substring(At.startColumn-2,At.endColumn);return{suggestions:[...Ee(we,Mt,Lt,Wt),...vn.map(Nn=>({label:Nn,kind:we.languages.CompletionItemKind.Keyword,documentation:Nn,insertText:Nn,insertTextRules:we.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Wt})),..._t.map(Nn=>({label:Nn.label,kind:we.languages.CompletionItemKind.Snippet,documentation:Nn.content,insertText:Et.startsWith("#")?Nn.content.replace(/#/,""):Nn.content,insertTextRules:we.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Wt}))]}}})};var Ft=we=>{Ue.languages.forEach(Pn=>{we.languages.registerDocumentFormattingEditProvider(Pn,{provideDocumentFormattingEdits(vn){return Se(this,null,function*(){const _t=ue()(vn.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:vn.getFullModelRange(),text:_t}]})}})}),Ze(we,"java",$e.keywords,$e.quickKey),Ze(we,"cpp",me.keywords,me.quickKey),Ze(we,"c",Ie.keywords,[]),Ze(we,"python",re.keywords,re.quickKey),Ze(we,"scala",Zt.keywords,Zt.quickKey)};const et="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var nt=Object.defineProperty,ct=(we,Pn,vn)=>Pn in we?nt(we,Pn,{enumerable:!0,configurable:!0,writable:!0,value:vn}):we[Pn]=vn,lt=(we,Pn,vn)=>ct(we,typeof Pn!="symbol"?Pn+"":Pn,vn);const pt=class px{constructor(Pn,vn,_t){this.placeholder=Pn,this.editor=vn,this.monaco=_t,vn.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)}};lt(pt,"ID","editor.widget.placeholderHint");var Ct=pt,Nt=Kt(84144),zt=Kt(2453),Ht=Kt(83062),$t=Kt(96486),ee=Kt(33054),te=Kt(74855),Ae=Object.defineProperty,se=Object.defineProperties,Re=Object.getOwnPropertyDescriptors,He=Object.getOwnPropertySymbols,ze=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable,Rn=(we,Pn,vn)=>Pn in we?Ae(we,Pn,{enumerable:!0,configurable:!0,writable:!0,value:vn}):we[Pn]=vn,Xn=(we,Pn)=>{for(var vn in Pn||(Pn={}))ze.call(Pn,vn)&&Rn(we,vn,Pn[vn]);if(He)for(var vn of He(Pn))Cn.call(Pn,vn)&&Rn(we,vn,Pn[vn]);return we},Ni=(we,Pn)=>se(we,Re(Pn)),Yt=(we,Pn)=>{var vn={};for(var _t in we)ze.call(we,_t)&&Pn.indexOf(_t)<0&&(vn[_t]=we[_t]);if(we!=null&&He)for(var _t of He(we))Pn.indexOf(_t)<0&&Cn.call(we,_t)&&(vn[_t]=we[_t]);return vn},jt=(we,Pn,vn)=>new Promise((_t,Mt)=>{var Lt=Et=>{try{Wt(vn.next(Et))}catch(be){Mt(be)}},At=Et=>{try{Wt(vn.throw(Et))}catch(be){Mt(be)}},Wt=Et=>Et.done?_t(Et.value):Promise.resolve(Et.value).then(Lt,At);Wt((vn=vn.apply(we,Pn)).next())});function Ce(we){return/^\d+$/.test(we)?`${we}px`:we}function un(){}let Ln=!1;const Le={"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 nn(we=[]){let Pn=we;if(Array.isArray(we)){for(let vn=0;vn<we.length;vn++){let _t=Le[we[vn]];if(_t)return _t}return Pn[0]}return Le[Pn]||Pn}let hn=null;const _n=()=>jt(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(we){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",we)}});var fn=we=>{var Pn=we,{width:vn="100%",height:_t="100%",value:Mt,language:Lt="javascript",style:At={},options:Wt={},overrideServices:Et={},theme:be="vs-dark",onEditBlur:Nn,isCopy:mi=!1,onSave:On,autoHeight:Gn=!1,forbidCopy:Fi=!1,onChange:yn=un,editorDidMount:Li=un,onFocus:yi=un,onBreakPoint:Ui=un,breakPointValue:Jn=[],filename:xr="educoder.txt",errorLine:Mo,errorContent:ao="",highlightLine:$i,openBreakPoint:Kr=!1,placeholder:No="",showMiniMap:fr=!0}=Pn,sr=Yt(Pn,["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 Pr=(0,St.useRef)(),Vi=(0,St.useRef)({}),Ir=(0,St.useRef)(),Ns=(0,St.useRef)(),jr=(0,St.useRef)([]),Va=(0,St.useRef)(!1),Hs=(0,St.useRef)(),Ws=(0,St.useRef)(),gr=(0,St.useRef)(!1),[Ti,We]=(0,St.useState)(!1);function xt(){let ge;return Pr.current&&(ge=new de.Z(Ge=>{for(let Bn of Ge)(Bn.target.offsetHeight>0||Bn.target.offsetWidth>0)&&Vi.current.instance.layout()}),ge.observe(Pr.current)),ge}function Sn(){zt.ZP.warning({content:decodeURIComponent(et),key:"monaco-editor-tip"})}const mn=()=>{let ge=Vi.current.instance;if(Mt!=null&&ge&&Ti){const Ge=ge.getModel();Ge&&Mt!==Ge.getValue()&&(Ln=!0,Ge.setValue(Mt),ge.layout(),Ln=!1)}};(0,St.useEffect)(()=>{const ge=ee.Z.subscribe("formatDocument",Ge=>{var Bn;let ri=Vi.current.instance;(Bn=ri==null?void 0:ri.getAction)==null||Bn.call(ri,"editor.action.formatDocument").run()});return window.updateMonacoValue=Ge=>{yn(Ge)},ge},[]),(0,St.useEffect)(()=>{var ge;let Ge=Vi.current.instance;Ns.current&&clearTimeout(Ns.current),Ns.current=setTimeout(()=>{mn()},500),Mt&&(Mt!=null&&Mt.length)&&((ge=Ge==null?void 0:Ge.updateOptions)==null||ge.call(Ge,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Mt.split(/\r\n|\r|\n/g).length))+3,5)}))},[Mt,Ti,Vi.current]),(0,St.useEffect)(()=>{if(Mo&&Vi.current&&Vi.current.instance){let Ge=Vi.current.instance;Ge.changeViewZones(function(Bn){var ri=document.createElement("div");ri.style.padding="10px 20px",ri.style.width="calc(100% - 20px)",ri.className="my-error-line-wrp",ri.innerHTML=ao,Bn.addZone({afterLineNumber:Mo||11,heightInLines:3,domNode:ri})});var ge={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}};Ge.addOverlayWidget(ge),Ge.revealPositionInCenter({lineNumber:20,column:1})}},[Mo,Vi.current,Ti]);const rn=(ge="",Ge)=>{if(!ge||ge.trim()==="")return!0;const ri=Vi.current.instance.getModel().getLineTokens(Ge);let Qe=!1;for(let ce=0;ce<2;ce++)ri.getStandardTokenType(ce)===1&&(Qe=!0);return Qe};(0,St.useEffect)(()=>{var ge;const Ge=(ge=Vi.current)==null?void 0:ge.instance;if(Ge&&Ti&&Fi){const Bn=Ge.onDidBlurEditorWidget(()=>{gr.current=!1}),ri=Ge.onDidFocusEditorText(()=>{gr.current=!0});return()=>{Bn.dispose(),ri.dispose()}}},[Vi.current,Ti,Fi]),(0,St.useEffect)(()=>{var ge;if((ge=Vi.current)!=null&&ge.instance&&Ti&&Kr){let Ge=Vi.current.instance,Bn=Ge.getModel();if(!Bn)return;(()=>{var gn;let Ye=[],xe=[];const ei=Bn.getAllDecorations();for(let qe of ei)qe.options.className==="highlighted-line"&&(Ye.push((gn=qe==null?void 0:qe.range)==null?void 0:gn.startLineNumber),xe.push(qe==null?void 0:qe.id));if($i===Ye[0])return;Bn.deltaDecorations(xe,[]);const Si=Bn.getLineCount();$i&&$i<=Si&&(Ge.deltaDecorations([],[{range:new hn.Range($i,1,$i,Bn.getLineMaxColumn($i)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Ge.revealLineInCenter($i))})();const Qe=(gn=!1)=>{var Ye;let xe=[],ei=[];const Si=Bn.getAllDecorations();for(let qe of Si)qe.options.linesDecorationsClassName==="breakpoints-select"&&(xe.push((Ye=qe==null?void 0:qe.range)==null?void 0:Ye.startLineNumber),ei.push(qe==null?void 0:qe.id));if(gn)return{lines:xe,ids:ei};Ui(xe)},ce=gn=>jt(void 0,null,function*(){let Ye={range:new hn.Range(gn,1,gn,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield Bn.deltaDecorations([],[Ye]),Qe()}),Tn=gn=>jt(void 0,null,function*(){let Ye=[];const xe=Ge.getLineDecorations(gn);for(let ei of xe)ei.options.linesDecorationsClassName==="breakpoints-select"&&Ye.push(ei.id);yield Bn.deltaDecorations(Ye,[]),Qe()}),ti=gn=>{let Ye=Ge.getLineDecorations(gn);for(let xe of Ye)if(xe.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,$t.isEqual)(Jn,Qe(!0).lines)){Bn.deltaDecorations(Qe(!0).ids,[]);const gn=Jn.map(Ye=>({range:new hn.Range(Ye,1,Ye,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));Bn.deltaDecorations([],gn)}const Be=Ge.onDidChangeModelContent(gn=>{let Ye=Ge.getPosition();if(Ye){let xe=Ye.lineNumber;clearTimeout(Ws.current),Ws.current=setTimeout(()=>{rn(Bn.getLineContent(xe),xe)?Tn(xe):ti(xe)?(Tn(xe),ce(xe)):Qe()},100)}}),qt=Ge.onMouseDown(gn=>{var Ye,xe,ei;if(gn.target.detail&&((ei=(xe=(Ye=gn.target)==null?void 0:Ye.element)==null?void 0:xe.className)!=null&&ei.includes("line-numbers"))){let Si=gn.target.position.lineNumber;if(rn(Bn.getLineContent(Si),Si))return;ti(Si)?Tn(Si):ce(Si)}}),ae=gn=>{let Ye={range:new hn.Range(gn,1,gn,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};jr.current=Ge.deltaDecorations(jr.current,[Ye])},Mn=()=>{jr.current=Ge.deltaDecorations(jr.current,[])},Gi=Ge.onMouseMove(gn=>{var Ye,xe,ei;if(Mn(),gn.target.detail&&((ei=(xe=(Ye=gn.target)==null?void 0:Ye.element)==null?void 0:xe.className)!=null&&ei.includes("line-numbers"))){let Si=gn.target.position.lineNumber;if(rn(Bn.getLineContent(Si),Si))return;ae(Si)}}),Ai=Ge.onMouseLeave(()=>{Mn()});return()=>{Be.dispose(),qt.dispose(),Gi.dispose(),Ai.dispose()}}},[Vi.current,Ti,Jn,$i,Kr,Lt]),(0,St.useEffect)(()=>{var ge;(ge=Vi.current)!=null&&ge.instance&&Kr&&Vi.current.instance.setPosition({lineNumber:0,column:0})},[$i]);function en(){let ge=Vi.current.instance;if(ge){const Ge=ge.getSelection(),Bn=Vi.current.pastePos||{},ri=new hn.Range(Bn.startLineNumber||Ge.endLineNumber,Bn.startColumn||Ge.endColumn,Bn.endLineNumber||Ge.endLineNumber,Bn.endColumn||Ge.endColumn);setTimeout(()=>{ge.executeEdits("",[{range:ri,text:""}])},300)}}function sn(ge){(window.navigator.platform.match("Mac")?ge.metaKey:ge.ctrlKey)&&ge.keyCode==83&&(ge.preventDefault(),On())}const wn=()=>{if(Gn&&Vi.current.instance){const ge=Vi.current.instance.getContentHeight();Fn(ge<_t?_t:ge)}else Fn(_t)};function Qn(ge){var Ge=document.createEvent("MouseEvents");Ge.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),ge.dispatchEvent(Ge)}const ye=ge=>{if(!gr.current)return;const{keyCode:Ge,ctrlKey:Bn,metaKey:ri,target:Qe,type:ce}=ge;return(ce==="paste"||(Ge===67||Ge===86)&&(ri||Bn))&&Qe.nodeName==="TEXTAREA"&&(Sn(),ge.preventDefault()),!1};function ve(ge,Ge){var Bn=window.URL||window.webkitURL||window,ri=new Blob([Ge]),Qe=document.createElementNS("http://www.w3.org/1999/xhtml","a");Qe.href=Bn.createObjectURL(ri),Qe.download=ge,Qn(Qe)}(0,St.useEffect)(()=>{wn()},[wn]),(0,St.useEffect)(()=>{Pr.current&&!Ti&&Promise.all([Kt.e(5552),Kt.e(9651)]).then(Kt.bind(Kt,55826)).then(ge=>{try{hn=ge,Vi.current.instance=hn.editor.create(Pr.current,{value:Mt,language:nn(Lt),theme:be,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:fr||!1}},Et);const Ge=Vi.current.instance;let Qe=[...Nt.BH._menuItems].find(Be=>Be[0]._debugName=="EditorContext")[1],ce=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Tn=(Be,qt)=>{var ae,Mn;let Gi=Be._first;do qt.includes((Mn=(ae=Gi.element)==null?void 0:ae.command)==null?void 0:Mn.id)&&Be._remove(Gi);while(Gi=Gi.next)};if(Li(Ge,hn),setTimeout(()=>{wn(),Vi.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{ve(xr||"educoder.txt",Ge.getValue())}})},500),Vi.current.subscription=Ge.onDidChangeModelContent(Be=>{Va.current?clearTimeout(Hs.current):(wn(),yn(Ge.getValue(),Be)),Hs.current=setTimeout(()=>{Va.current=!1},500)}),window.Monaco||Ft(hn,nn(Lt)),Fi&&(Tn(Qe,ce),Pr.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",ye),window.removeEventListener("paste",ye),window.addEventListener("keydown",ye),window.addEventListener("paste",ye)),window.Monaco=hn,Nn&&Ge.onDidBlurEditorWidget(()=>{Nn(Ge.getValue())}),yi&&Ge.onDidFocusEditorText(()=>{Fi&&_n(),yi(Ge.getValue())}),Fi){_n();try{Ge.onDidPaste(Be=>{const qt=Ge.getSelection(),ae=Vi.current.pastePos||{},Mn=new hn.Range(ae.startLineNumber||qt.endLineNumber,ae.startColumn||qt.endColumn,ae.endLineNumber||qt.endLineNumber,ae.endColumn||qt.endColumn);Ge.executeEdits("",[{range:Be.range,text:""}])})}catch(Be){}}let ti=xt();return No&&typeof No=="string"&&new Ct(No,Ge,hn),We(!0),()=>{const Be=Vi.current.instance;Be.dispose();const qt=Be.getModel();qt&&qt.dispose(),Vi.current.subscription&&Vi.current.subscription.dispose(),ti.unobserve(Pr.current)}}catch(Ge){}})},[]),(0,St.useEffect)(()=>{if(Vi.current.instance&&Ti)return document.addEventListener("keydown",sn,!1),()=>{document.removeEventListener("keydown",sn)}},[On,Ti]),(0,St.useEffect)(()=>{let ge=Vi.current.instance;if(ge&&Ti){let Ge=nn(Lt);hn.editor.setModelLanguage(ge.getModel(),Ge)}},[Lt,Ti]),(0,St.useEffect)(()=>{Vi.current.instance&&Ti&&hn.editor.setTheme(be)},[be,Ti]),(0,St.useEffect)(()=>{let ge=Vi.current.instance;Ir.current=Wt,ge&&Ti&&(ge.updateOptions(Xn({},Wt)),setTimeout(()=>{ge.getModel().updateOptions(Xn({},Wt))},200))},[JSON.stringify(Wt),Ti]),(0,St.useEffect)(()=>{let ge=Vi.current.instance;ge&&Ti&&ge.layout()},[vn,_t,Ti]);const[ne,ke]=(0,St.useState)(Ce(vn)),[xn,Fn]=(0,St.useState)(Ce(_t)),In=Ni(Xn({},At),{width:ne,height:xn,position:"relative"});return St.createElement("div",{className:"my-monaco-editor",ref:Pr,style:In},mi&&St.createElement(te.CopyToClipboard,{text:Mt,onCopy:()=>zt.ZP.success("\u590D\u5236\u6210\u529F")},St.createElement(Ht.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 le({width:we="100%",height:Pn="100%",original:vn,modified:_t,language:Mt,options:Lt={}}){const At=(0,St.useRef)(),[Wt,Et]=(0,St.useState)(null);function be(Gn){let Fi;return At.current&&(Fi=new de.Z(yn=>{for(let Li of yn)(Li.target.offsetHeight>0||Li.target.offsetWidth>0)&&Gn.layout()}),Fi.observe(At.current)),Fi}(0,St.useEffect)(()=>(At.current&&Promise.all([Kt.e(5552),Kt.e(9404)]).then(Kt.bind(Kt,50048)).then(Gn=>{hn=Gn;const Fi=hn.editor.createDiffEditor(At.current,Ni(Xn({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},Lt),{wordWrap:!0}));Et(Fi);let yn=be(Fi);return()=>{Fi.dispose();const Li=Fi.getModel();Li&&Li.dispose(),yn.unobserve(At.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,St.useEffect)(()=>{Wt&&Wt.setModel({original:hn.editor.createModel(vn,Mt),modified:hn.editor.createModel(_t,Mt)})},[vn,_t,Mt,Wt]);const Nn=Ce(we),mi=Ce(Pn),On={width:Nn,height:mi};return St.createElement("div",{className:"my-diff-editor",ref:At,style:On})}},5476:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return Ue}});var St={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"},de=Kt(74330),Ie=Kt(83062),$e=Kt(94184),me=Kt.n($e),re=Kt(28706),Zt=Kt(26194),Oe=Kt(52262),ue=Kt(67294),Ue=({className:Ee,dataSource:Ze=[],col:Ft=4,right:et,bottom:nt=23,precision:ct=0,wrapWidth:lt=1200,trackEventItems:pt,loading:vt,onRemove:Ct=()=>{},isCurrent:Nt=!0,showAlias:zt=!1})=>{const Ht=Math.floor((lt-(Ft-1)*et)/Ft),$t=[{name:"\u63A8\u8350\u81EA\u5B66",ptimg:"/images/tjzx.png",swimg:"/images/sw_tjzx.png"},{name:"101\u8BA1\u5212",ptimg:"/images/jh.png",swimg:"/images/sw_jh.png"},{name:"\u56FD\u5BB6\u4E00\u6D41",ptimg:"/images/gjyl.png",swimg:"/images/sw_gjyl.png"},{name:"\u7701\u7EA7\u4E00\u6D41",ptimg:"/images/sjyl.png",swimg:"/images/sw_sjyl.png"},{name:"\u7CBE\u54C1\u8BFE\u7A0B",ptimg:"/images/jpkc.png",swimg:"/images/sw_jpkc.png"},{name:"\u519B\u961F\u4E00\u6D41",ptimg:"/images/jdyl.png",swimg:"/images/sw_jdyl.png"},{name:"\u65B0\u578B\u6559\u6750",ptimg:"/images/xxjc.png",swimg:"/images/sw_xxjc.png"}];return ue.createElement(de.Z,{spinning:vt},ue.createElement("div",{className:me()(St.list,Ee)},!!(Ze!=null&&Ze.length)&&(Ze==null?void 0:Ze.map((ee,te)=>{var Ae;const{name:se,id:Re,identifier:He,featured:ze,school_name:Cn,image_url:Rn,excellent:Xn,is_plan:Ni}=ee;return ue.createElement("div",{key:Re,className:St.wrap,style:{width:Ht,marginRight:(1+te)%Ft===0?0:et+ct,marginBottom:nt}},ue.createElement("a",{className:St.li,onClick:Yt=>{Yt.preventDefault(),Yt.stopPropagation(),pt&&(0,re.L9)([pt]),(0,re.xg)(`/paths/${He}`)}},ue.createElement("div",{className:St.img},ue.createElement("img",{className:St.cover,src:`${Rn}`}),Nt&&(0,Oe.bg)()&&(ee==null?void 0:ee.studying)&&ue.createElement("div",{className:`${St.movebq} user-path-items`,onClick:Yt=>{Yt.stopPropagation(),Ct(ee)}},ue.createElement("i",{className:"iconfont icon-yichu1 mr5 c-red"}),ue.createElement("span",{className:"c-red"},"\u79FB\u9664")),(Ae=ee==null?void 0:ee.subject_tags)==null?void 0:Ae.map((Yt,jt)=>{var Ce,un;if(jt===0){const Le=(Ce=$t.find(nn=>nn.name==Yt))==null?void 0:Ce.swimg;return ue.createElement("img",{className:St.sign,src:Le,style:{left:"-4px"}})}const Ln=(un=$t.find(Le=>Le.name==Yt))==null?void 0:un.ptimg;return ue.createElement("img",{className:St.sign,src:Ln,style:{left:`${48+52*(jt-1)+2*jt}px`}})}),ue.createElement("div",{style:{position:"absolute",top:"150px",left:"4px"}},(ee==null?void 0:ee.excellent)&&ue.createElement("div",{className:St.bq},"\u5F00\u653E\u8BFE\u7A0B"))),ue.createElement("div",{className:St.name},ue.createElement(Ie.Z,{title:zt&&(ee!=null&&ee.excellent_alias_name)?ue.createElement("span",null,`\u8BFE\u7A0B\u539F\u540D\uFF1A${se}`,ue.createElement("br",null),ue.createElement("span",null,`\u8BFE\u7A0B\u522B\u540D\uFF1A${ee==null?void 0:ee.excellent_alias_name}`)):se},ue.createElement("span",{className:St.e},zt&&(ee==null?void 0:ee.excellent_alias_name)||se))),ue.createElement(Ie.Z,{title:`\u53D1\u5E03\u5355\u4F4D\uFF1A${Cn}`},ue.createElement("div",{className:St.unit},ue.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),Cn)),ue.createElement("div",{className:St.tags},ue.createElement("div",null,ue.createElement(Ie.Z,{placement:"bottom",title:"\u7AE0\u8282\u6570"},ue.createElement("span",null,ue.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),ue.createElement("span",null,ee.stages_count))),ue.createElement(Ie.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},ue.createElement("span",null,ue.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),ue.createElement("span",null,ee.members_count)))))))})),!Ze.length&&ue.createElement(Zt.Z,null)))}},30001:function(tn,An,Kt){"use strict";Kt.d(An,{jL:function(){return me},w9:function(){return Ce},QD:function(){return Mo},cQ:function(){return Rn.Z},op:function(){return yn},O5:function(){return mn},_b:function(){return sr},t7:function(){return lt},Gi:function(){return _n},YG:function(){return nn},qp:function(){return Ue},vr:function(){return Kr},qE:function(){return Ui},Je:function(){return Ct},wb:function(){return Cn},cq:function(){return _t},tp:function(){return Ft}});var St=Kt(67294),de={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"},Ie="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==",me=({dataSource:rn=[],img:en,imgWidth:sn=346,title:wn,sunTitle:Qn,bannerExtraContent:ye})=>St.createElement("div",{className:de.banner},St.createElement("div",{className:de.content},St.createElement("aside",null,St.createElement("p",null,St.createElement("b",null,wn),St.createElement("span",null,Qn)),rn.length>0&&St.createElement("div",{className:de.btns},rn.map((ve,ne)=>St.createElement("div",{key:ne,onClick:ve.click},ve.name,ve.sign?St.createElement("img",{src:Ie,width:39}):null))),ye),en&&St.createElement("img",{style:{marginTop:33,marginRight:38},src:en,width:sn}))),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"},Zt=Kt(94184),Oe=Kt.n(Zt),ue=Kt(96486),Ue=({dataSource:rn=[],value:en,onChange:sn,onTitleChange:wn,className:Qn,title:ye,titleWidth:ve=41,style:ne={},fontColor:ke="#6A7283",showCount:xn})=>{const[Fn,In]=(0,St.useState)(0),[ge,Ge]=(0,St.useState)(!1),Bn=(0,St.useRef)(null),ri=(0,St.useRef)(null);return(0,St.useEffect)(()=>{var Qe;rn.length!==0&&(((Qe=Bn==null?void 0:Bn.current)==null?void 0:Qe.clientHeight)>97?In(1):In(0)),rn.length===0&&In(0),Ge(!1)},[rn]),St.createElement("div",{className:Oe()(re.row,Qn),style:ne},St.createElement("div",{onClick:(0,ue.throttle)(()=>wn==null?void 0:wn(),2e3),style:{width:ve,marginTop:ge?12:4},className:`${re.title} ${wn?"current":""}`},ye),St.createElement("div",{className:ge?`${re.tagsWrap} ${re.tagsBorderWrap}`:re.tagsWrap},St.createElement("div",{className:re.bar,ref:ri,style:Fn>0?{height:Fn===1?97:"auto",overflow:Fn===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},St.createElement("div",{className:re.tag,ref:Bn},rn==null?void 0:rn.map(Qe=>St.createElement("span",{onClick:()=>sn(Qe.id),key:Qe.id,style:{color:ke},className:en===Qe.id?re.active:""},St.createElement("span",{title:Qe.name,className:re.name},Qe.name),!!xn&&St.createElement("span",{className:re.num},Qe.count))))),!!Fn&&St.createElement(St.Fragment,null,Fn===1?St.createElement("div",{onClick:()=>{var Qe;In(2),((Qe=Bn==null?void 0:Bn.current)==null?void 0:Qe.clientHeight)>245?Ge(!0):Ge(!1)},className:re.action},"\u5C55\u5F00",St.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):St.createElement("div",{onClick:()=>{ri.current.scrollTop=0,In(1),Ge(!1)},className:re.action},"\u6536\u8D77",St.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},Ee={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"},Ft=({dataSource:rn=[],value:en,onChange:sn,className:wn,style:Qn={}})=>St.createElement("div",{style:Qn,className:Oe()(Ee.tabs,wn)},rn.map(ye=>St.createElement("span",{onClick:()=>sn(ye.id),className:en===ye.id?Ee.active:"",key:ye.id},ye.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=Kt(28802),lt=({dataSource:rn=[],value:en="",onChange:sn,onInputChange:wn=()=>{},className:Qn,style:ye={},placeholder:ve,allowClear:ne=!1})=>{var ke;const[xn,Fn]=(0,St.useState)(""),[In,ge]=(0,St.useState)("");(0,St.useEffect)(()=>{var ri;let Qe=en;(ri=JSON.stringify(en))!=null&&ri.includes("{")&&(Fn(en.id),Qe=en.value||"");try{ge(decodeURIComponent(Qe||""))}catch(ce){ge(decodeURIComponent(Qe||""))}},[en]);const Ge=()=>{sn(encodeURIComponent(In),xn||null)},Bn=ri=>{ri!==xn&&(Fn(ri),sn(encodeURIComponent(In),ri))};return St.createElement("div",{className:Oe()(et.input,Qn),style:ye},!!rn.length&&St.createElement("div",{className:et.dropdown},St.createElement("div",{className:et.text},(ke=rn.find(ri=>ri.id===xn))==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},rn.map((ri,Qe)=>St.createElement("div",{key:Qe,onClick:()=>Bn(ri.id)},ri.name)))),St.createElement(nt.default,{onPressEnter:Ge,value:In,onChange:ri=>{ge(ri.target.value),wn(encodeURIComponent(ri.target.value),xn||null)},bordered:!1,placeholder:ve}),St.createElement("i",{onClick:Ge,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"},Ct=({value:rn,onChange:en,className:sn,total:wn,pageSize:Qn,style:ye={}})=>{const ve=rn<2,ne=rn>=Math.ceil(wn/Qn);return wn<=Qn?St.createElement(St.Fragment,null):St.createElement("div",{className:Oe()(pt.quickPager,sn),style:ye},St.createElement("div",{onClick:()=>{ve||en(rn-1,"prev")},className:ve?pt.disabled:""},"\u4E0A\u4E00\u9875"),St.createElement("div",{onClick:()=>{ne||en(rn+1,"next")},className:ne?pt.disabled:""},"\u4E0B\u4E00\u9875"))},Nt={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"},zt=Kt(74330),Ht=Kt(83062),$t=Kt(57097),ee=Kt(11320),te=Kt(28706),Ae=Kt(96908),se=Kt(57177),Re=Kt(81378),He=Kt(26194),Cn=({className:rn,dataSource:en=[],col:sn=4,right:wn,bottom:Qn=23,precision:ye=0,wrapWidth:ve=1200,trackEventItems:ne,loading:ke})=>{const xn=Math.floor((ve-(sn-1)*wn)/sn);return St.createElement(zt.Z,{spinning:ke},St.createElement("div",{className:Oe()(Nt.list,rn)},!!en.length&&en.map((Fn,In)=>{const{name:ge,id:Ge,identifier:Bn,power:ri,cover_image_id:Qe,pic:ce}=Fn;return St.createElement("div",{className:Nt.wrap,key:Ge,style:{width:xn,marginRight:(1+In)%sn===0?0:wn+ye,marginBottom:Qn}},St.createElement("a",{target:"_blank",href:`/shixuns/${Bn}/challenges`,className:Nt.li,onClick:Tn=>{Tn.preventDefault(),ne&&(0,te.L9)([ne]),ri&&(0,te.xg)(`/shixuns/${Bn}/challenges`)}},St.createElement("div",{className:Nt.img},St.createElement("img",{className:Nt.cover,src:`${ce}`}),Fn.is_jupyter&&St.createElement("img",{className:Nt.sign,src:Ae}),Fn.is_jupyter_lab&&St.createElement("img",{className:Nt.sign,src:se}),Fn.is_unity_3d&&St.createElement("img",{className:Nt.sign,src:Re})),St.createElement("div",{className:Nt.name},St.createElement(Ht.Z,{title:ge||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},St.createElement("span",{className:Nt.e},ge||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),St.createElement("div",{className:Nt.tags},St.createElement(Ht.Z,{placement:"bottom",title:"\u5173\u5361\u6570"},St.createElement("span",null,St.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr2"}),St.createElement("span",null,Fn.challenges_count))),!!Fn.myshixuns_count&&St.createElement(Ht.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,Fn.myshixuns_count))),St.createElement(Ht.Z,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},St.createElement("span",null,St.createElement("span",null,Fn.level))),St.createElement("div",{className:Nt.rate},St.createElement($t.Z,{allowHalf:!0,disabled:!0,defaultValue:Fn.score_info}),St.createElement("span",null,"\xA0",Fn.score_info?`${Fn.score_info}\u5206`:"5\u5206")))),!ri&&St.createElement("div",{className:Nt.lockWrap},St.createElement("img",{src:`${ee.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")))}),!en.length&&St.createElement(He.Z,null)))},Rn=Kt(5476),Xn={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"},Ni="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",Yt=Kt(67294),Ce=({className:rn,dataSource:en=[],col:sn=4,right:wn,bottom:Qn=23,precision:ye=0,wrapWidth:ve=1200,trackEventItems:ne,loading:ke,handleVery:xn=()=>!0})=>{const Fn=Math.floor((ve-(sn-1)*wn)/sn);return Yt.createElement(zt.Z,{spinning:ke},Yt.createElement("div",{className:Oe()(Xn.list,rn)},!!en.length&&en.map((In,ge)=>{const{subject_identifier:Ge,id:Bn,identifier:ri,power:Qe}=In,ce=In.is_public!=0&&In.is_public;return Yt.createElement("div",{className:Xn.wrap,key:Bn,style:{width:Fn,marginRight:(1+ge)%sn===0?0:wn+ye,marginBottom:Qn}},Yt.createElement("a",{className:Xn.li,onClick:Tn=>{Tn.preventDefault(),xn(In==null?void 0:In.first_category_url)&&(ne&&(0,te.L9)([ne]),(0,te.xg)(In.first_category_url))}},Yt.createElement("div",{className:Xn.top},Yt.createElement(Ht.Z,{title:In.name},Yt.createElement("div",{className:Xn.name},In.name)),Yt.createElement("img",{className:Xn.img,src:ee.Z.IMG_SERVER+"/images/"+In.avatar_url}),Yt.createElement("div",{className:Xn.text,title:In.creator},In.creator),Ge&&Yt.createElement("div",{className:Xn.btns},Yt.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),Yt.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),ce&&Yt.createElement("div",{className:Xn.sign},"\u516C\u5F00")),Yt.createElement("div",{className:Xn.bottom},In.visits>0&&Yt.createElement(Ht.Z,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},Yt.createElement("span",null,Yt.createElement("i",{className:"iconfont icon-liulanyan"}),Yt.createElement("span",null,In.visits))),In.course_members_count>0&&Yt.createElement(Ht.Z,{title:"\u6210\u5458",placement:"bottom"},Yt.createElement("span",null,Yt.createElement("i",{className:"iconfont icon-chengyuan"}),In.course_members_count)),In.tasks_count>0&&Yt.createElement(Ht.Z,{title:"\u4F5C\u4E1A",placement:"bottom"},Yt.createElement("span",null,Yt.createElement("i",{className:"iconfont icon-zuoye"}),In.tasks_count)),In.is_end?Yt.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):Yt.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),!In.is_accessible&&Yt.createElement("div",{className:Xn.lockWrap},Yt.createElement("img",{src:`${ee.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),Yt.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165")))}),!en.length&&Yt.createElement(He.Z,null)))},un={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"},Ln=Kt(35973),nn=({dataSource:rn=[],value:en,onChange:sn,className:wn,style:Qn={},tabBarExtraContent:ye})=>St.createElement("div",{className:Oe()(un.tabs,wn),style:Qn},St.createElement("div",{className:un.tabsWrap},rn.map((ve,ne)=>!(ve!=null&&ve.hide)&&St.createElement("aside",{className:un.tab,onClick:()=>{sn(ve.id),ve.link&&Ln.history.push(ve.link)},key:ne},St.createElement("div",{className:en===ve.id?un.active:""},ve.name),(ve==null?void 0:ve.resetCount)==null&&(ve==null?void 0:ve.total)!==void 0&&St.createElement("span",null,"\uFF08",ve==null?void 0:ve.total,"\uFF09"),(ve==null?void 0:ve.resetCount)!==void 0&&(ve==null?void 0:ve.total)!==void 0&&St.createElement(Ht.Z,{title:(ve==null?void 0:ve.tip)!=null?ve==null?void 0:ve.tip:""},St.createElement("span",{style:{color:"#9096A3"}},"\uFF08",St.createElement("span",{style:{color:"#000"}},ve==null?void 0:ve.resetCount),"/",St.createElement("span",null,ve==null?void 0:ve.total),"\uFF09"))))),St.createElement("div",{className:un.tabBar},ye)),_n=({className:rn,style:en={},children:sn})=>St.createElement("div",{className:Oe()(rn),style:en},sn),fn={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"},le=Kt(85418),we=Kt(50136);const Pn=[{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:rn,dropValue:en,className:sn,onSort:wn,onDrop:Qn,dataSource:ye=Pn})=>{var ve;return St.createElement("div",{className:Oe()(fn.orderWrap,sn)},St.createElement(le.Z,{dropdownRender:()=>St.createElement(we.default,null,ye.map((ne,ke)=>St.createElement(we.default.Item,{key:ke,onClick:()=>Qn(ne.id)},ne.name)))},St.createElement("span",{className:fn.orderTextWrap},(ve=ye.find(ne=>en===ne.id))==null?void 0:ve.name)),St.createElement("span",{className:fn.orderIconWrap},St.createElement("span",{className:fn.orderAsc},St.createElement("i",{className:rn==="asc"?`iconfont icon-sanjiaoxing-up font12 ${fn.cursorPointer} ${fn.active}`:`iconfont icon-sanjiaoxing-up font12 ${fn.cursorPointer}`,onClick:()=>wn(rn==="asc"?"desc":"asc")})),St.createElement("span",{className:fn.orderDesc},St.createElement("i",{className:rn==="desc"?`iconfont icon-sanjiaoxing-down font12 ${fn.cursorPointer} ${fn.active}`:`iconfont icon-sanjiaoxing-down font12 ${fn.cursorPointer}`,onClick:()=>wn(rn==="asc"?"desc":"asc")}))))},Mt={flex_box_center:"flex_box_center___LCi0B",flex_space_between:"flex_space_between___hzONe",flex_box_vertical_center:"flex_box_vertical_center___ZyQRE",flex_box_center_end:"flex_box_center_end___XKM74",flex_box_column:"flex_box_column___p8LCU",btn:"btn___In02G","mediacy-round":"mediacy-round___uveEv","mediacy-default":"mediacy-default___dDxsd",default:"default___K791v"},Lt=Kt(85804),At=Object.defineProperty,Wt=Object.getOwnPropertySymbols,Et=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,Nn=(rn,en,sn)=>en in rn?At(rn,en,{enumerable:!0,configurable:!0,writable:!0,value:sn}):rn[en]=sn,mi=(rn,en)=>{for(var sn in en||(en={}))Et.call(en,sn)&&Nn(rn,sn,en[sn]);if(Wt)for(var sn of Wt(en))be.call(en,sn)&&Nn(rn,sn,en[sn]);return rn},On=(rn,en)=>{var sn={};for(var wn in rn)Et.call(rn,wn)&&en.indexOf(wn)<0&&(sn[wn]=rn[wn]);if(rn!=null&&Wt)for(var wn of Wt(rn))en.indexOf(wn)<0&&be.call(rn,wn)&&(sn[wn]=rn[wn]);return sn},Gn=(rn,en,sn)=>new Promise((wn,Qn)=>{var ye=ke=>{try{ne(sn.next(ke))}catch(xn){Qn(xn)}},ve=ke=>{try{ne(sn.throw(ke))}catch(xn){Qn(xn)}},ne=ke=>ke.done?wn(ke.value):Promise.resolve(ke.value).then(ye,ve);ne((sn=sn.apply(rn,en)).next())}),yn=rn=>{var en=rn,{className:sn,style:wn,children:Qn,loading:ye=!1,openLoading:ve,onClick:ne=()=>{},size:ke="middle",shape:xn="round"}=en,Fn=On(en,["className","style","children","loading","openLoading","onClick","size","shape"]);const[In,ge]=(0,St.useState)(!1);return St.createElement(Lt.ZP,mi({onClick:(0,ue.throttle)(Ge=>Gn(void 0,null,function*(){ve&&ge(!0);try{yield ne(Ge)}catch(Bn){console.log("error",Bn)}ve&&ge(!1)}),2e3,{leading:!0,trailing:!1}),className:Oe()(Mt.btn,Mt[`${ke}-${xn}`],sn),style:wn,size:ke,shape:xn,loading:In||ye},Fn),Qn)},Li={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"},Ui=({className:rn,style:en,children:sn=null,onClick:wn,title:Qn})=>St.createElement("div",{className:Oe()(Li.head,rn),style:en},St.createElement("span",{className:"primary-hover",onClick:wn},St.createElement("i",{className:"iconfont icon-fanhui2 font12"}),"\u8FD4\u56DE"),St.createElement("b",{title:Qn},Qn),St.createElement("div",{className:Li.node},sn)),Jn={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"},Mo=({confirmShow:rn=!0,confirmTitle:en,confirmClick:sn,cancelShow:wn=!0,cancelTitle:Qn,cancelClick:ye,className:ve,style:ne,confirmLoading:ke=!1})=>St.createElement("div",{className:Oe()(Jn.btns,ve),style:ne},rn&&St.createElement(Lt.ZP,{loading:ke,onClick:sn,type:"primary",className:Jn.confirm},en),wn&&St.createElement(Lt.ZP,{onClick:ye,className:Jn.cancel},Qn)),ao={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"},Kr=({className:rn,style:en={},LeftContent:sn,children:wn,RightContent:Qn})=>St.createElement("div",{className:Oe()(ao.fixedBottom,rn),style:en},St.createElement("div",{className:ao.wrap},St.createElement("div",{className:ao.left},sn),St.createElement("div",{className:ao.center},wn),St.createElement("div",{className:ao.right},Qn))),No={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"},sr=({className:rn,style:en={},dataSource:sn=[]})=>St.createElement("div",{className:Oe()(No.crumbs,rn),style:en},sn.map((wn,Qn)=>Qn<sn.length-1?St.createElement(St.Fragment,{key:Qn},wn.path||wn.onClick?St.createElement("span",{className:No.hover,onClick:wn!=null&&wn.onClick?wn.onClick:()=>Ln.history.push(wn.path)},wn.name):St.createElement("span",null,wn.name),St.createElement("span",null,"\xA0",">","\xA0")):St.createElement("span",{key:Qn,style:{color:"#5F6368"}},wn.name))),Pr=Kt(55054),Vi=Object.defineProperty,Ir=Object.defineProperties,Ns=Object.getOwnPropertyDescriptors,jr=Object.getOwnPropertySymbols,Va=Object.prototype.hasOwnProperty,Hs=Object.prototype.propertyIsEnumerable,Ws=(rn,en,sn)=>en in rn?Vi(rn,en,{enumerable:!0,configurable:!0,writable:!0,value:sn}):rn[en]=sn,gr=(rn,en)=>{for(var sn in en||(en={}))Va.call(en,sn)&&Ws(rn,sn,en[sn]);if(jr)for(var sn of jr(en))Hs.call(en,sn)&&Ws(rn,sn,en[sn]);return rn},Ti=(rn,en)=>Ir(rn,Ns(en)),We=(rn,en)=>{var sn={};for(var wn in rn)Va.call(rn,wn)&&en.indexOf(wn)<0&&(sn[wn]=rn[wn]);if(rn!=null&&jr)for(var wn of jr(rn))en.indexOf(wn)<0&&Hs.call(rn,wn)&&(sn[wn]=rn[wn]);return sn};const{Countdown:xt}=Pr.default;var mn=rn=>{var en=rn,{onChange:sn}=en,wn=We(en,["onChange"]);const[Qn,ye]=(0,St.useState)(null);(0,St.useEffect)(()=>{typeof Qn=="number"&&Qn>=0&&sn(Qn)},[Qn]);const ve=ne=>{const ke=Math.floor(ne/1e3);ye(ke)};return St.createElement(xt,Ti(gr({},wn),{onChange:ve}))}},99914:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return de}});var St=Kt(67294);function de(Ie,$e){const me=(0,St.useRef)();(0,St.useEffect)(()=>{me.current=Ie}),(0,St.useEffect)(()=>{function re(){me.current()}if($e!==null){let Zt=setInterval(re,$e);return()=>clearInterval(Zt)}},[$e])}},25628:function(tn,An,Kt){"use strict";Kt.r(An),Kt.d(An,{default:function(){return ti}});var St=Kt(67294),de=Kt(35973),Ie=Kt(50136),$e=Kt(26058),me=Kt(91773),re=Kt(2453),Zt=Kt(96074),Oe=Kt(85673),ue=Kt(71230),Se=Kt(15746),Ue=Kt(62844),Ee=Kt(55238),Ze=Kt(28802),Ft=Kt(85804),et=Kt(32027),nt=Kt(65900),ct=Kt(26194),lt=Kt(83062),pt=Kt(84567),vt=Kt(37720),Ct=Kt(15835),Nt=Kt(35567),zt=Kt(65226),Ht={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"},$t=Object.defineProperty,ee=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,se=(Be,qt,ae)=>qt in Be?$t(Be,qt,{enumerable:!0,configurable:!0,writable:!0,value:ae}):Be[qt]=ae,Re=(Be,qt)=>{for(var ae in qt||(qt={}))te.call(qt,ae)&&se(Be,ae,qt[ae]);if(ee)for(var ae of ee(qt))Ae.call(qt,ae)&&se(Be,ae,qt[ae]);return Be},He=(Be,qt)=>{var ae={};for(var Mn in Be)te.call(Be,Mn)&&qt.indexOf(Mn)<0&&(ae[Mn]=Be[Mn]);if(Be!=null&&ee)for(var Mn of ee(Be))qt.indexOf(Mn)<0&&Ae.call(Be,Mn)&&(ae[Mn]=Be[Mn]);return ae},ze=(Be,qt,ae)=>new Promise((Mn,Gi)=>{var Ai=xe=>{try{Ye(ae.next(xe))}catch(ei){Gi(ei)}},gn=xe=>{try{Ye(ae.throw(xe))}catch(ei){Gi(ei)}},Ye=xe=>xe.done?Mn(xe.value):Promise.resolve(xe.value).then(Ai,gn);Ye((ae=ae.apply(Be,qt)).next())});const Cn=["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"],Rn=(Be,qt)=>{var ae=Be,{problemset:Mn,globalSetting:Gi,loading:Ai,dispatch:gn,onRef:Ye=()=>{},editData:xe}=ae,ei=He(ae,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[Si,qe]=(0,St.useState)([]),[Hn,So]=(0,St.useState)(),[Bi,Qi]=(0,St.useState)([]),[he,Yn]=(0,St.useState)(""),[gi,zn]=(0,St.useState)(5),[Ri,hi]=(0,St.useState)(!1),xi=(0,de.useParams)();(0,St.useEffect)(()=>{qe(["","","",""])},[]),(0,St.useEffect)(()=>{if(!(xe!=null&&xe.question_choices)){hi(!0);return}Yn(xe==null?void 0:xe.question_title),zn(parseInt(xe==null?void 0:xe.question_score)),qe(xe==null?void 0:xe.question_choices.map(Dn=>Dn.choice_text));const Fe=[];xe==null||xe.standard_answer.map((Dn,Hi)=>{Fe.push(Dn-1)}),Qi(Fe)},[xe]),(0,St.useImperativeHandle)(qt,()=>({onSave:di,isEdit:Ri}));const di=()=>ze(void 0,null,function*(){if(!he)return re.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),!1;const Fe=Si.findIndex(ci=>!ci);if(Fe>-1)return re.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Cn[Fe]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Bi.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(Bi.length<1)return re.ZP.info("\u8BF7\u9009\u62E9\u7B54\u6848"),!1;const Dn=Si.map((ci,nr)=>({choice_text:ci,is_answer:Bi.includes(nr)?nr+1:0}));let Hi;xe.question_id?Hi=yield gn({type:"exercise/editExerciseQuestion",payload:{id:xe.question_id,question_title:he,question_type:1,question_score:"5.0",question_choices:Dn.map(ci=>ci.choice_text),standard_answers:Dn.filter(ci=>ci.is_answer).map(ci=>ci.is_answer)}}):Hi=yield gn({type:"exercise/addExerciseQuestion",payload:{categoryId:xi.categoryId,question_title:he,question_type:1,question_score:"5.0",question_choices:Dn.map(ci=>ci.choice_text),standard_answers:Dn.filter(ci=>ci.is_answer).map(ci=>ci.is_answer)}}),Hi.status===0&&(re.ZP.success("\u4FDD\u5B58\u6210\u529F"),hi(!1),gn({type:"exercise/editExercise",payload:Re({},xi)}))}),Zn=[{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"}],pi=Fe=>ze(void 0,null,function*(){switch(Fe.id){case"del":let Dn;Ue.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return ze(this,null,function*(){yield(0,Ct.Fl)({id:xe.question_id}),gn({type:"exercise/editExercise",payload:Re({},xi)})})}});break;case"up":case"down":yield gn({type:"exercise/exeriseMoveUpDown",payload:{id:xe.question_id,opr:Fe.id}}),gn({type:"exercise/editExercise",payload:Re({},xi)});break;case"edit":hi(!0);break}}),Pe=()=>{var Fe;return St.createElement("aside",null,St.createElement("div",{className:Ht.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},xe.key,"\u3001\u591A\u9009\u9898"),"\uFF08",xe.question_score,"\u5206\uFF09"),!xe.hideAction&&Zn.map(function(Dn,Hi){return Dn.id==="up"&&xe.key===1||Dn.id==="down"&&xe.key===xe.len?null:St.createElement(lt.Z,{key:Hi,placement:"bottom",title:Dn.name},St.createElement("span",{onClick:()=>pi(Dn),className:Dn.icon}))})),St.createElement("div",{className:"mt5"},St.createElement(zt.Z,{value:xe.question_title})),St.createElement("div",{className:Ht.questionChoices},(Fe=xe==null?void 0:xe.question_choices)==null?void 0:Fe.map(function(Dn,Hi){return St.createElement(ue.Z,null,St.createElement(Se.Z,null,St.createElement(pt.default,{key:Hi,checked:xe.standard_answer.includes(Hi+1),disabled:!0},Cn[Hi],".")),St.createElement(Se.Z,{flex:"1"},St.createElement("span",{className:"c-black font14"},St.createElement(zt.Z,{value:Dn.choice_text}))))})))},io=()=>St.createElement("aside",null,St.createElement("div",{className:Ht.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:Ht.titleWrap},St.createElement("span",{className:Ht.required},"*"),St.createElement("span",{className:Ht.title},"\u9898\u5E72\uFF1A")),St.createElement(Nt.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:he,onChange:Fe=>Yn(Fe)}),St.createElement("p",{className:Ht.titleWrap},St.createElement("span",{className:Ht.required},"*"),St.createElement("span",{className:Ht.title},"\u7B54\u6848\u9009\u9879\uFF1A",St.createElement("span",{className:Ht.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Si.map((Fe,Dn)=>St.createElement("div",{className:Ht.choiceWrap,key:Dn},St.createElement(lt.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},St.createElement("div",{className:`${Ht.answer} ${Bi.includes(Dn)?Ht.activeAnswer:""}`,onClick:()=>{Bi.includes(Dn)?Qi(Bi.filter(Hi=>Hi!==Dn)):Qi([...Bi,Dn])}},Cn[Dn])),St.createElement("div",{className:Ht.editorWrap},Hn===Dn?St.createElement(Nt.Z,{id:`single-question-option-${Dn}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Fe,onChange:Hi=>{Si[Dn]=Hi,qe(Si)}}):St.createElement("div",{className:Ht.htmlWrap,onClick:()=>So(Dn)},St.createElement(zt.Z,{value:Fe}))),Dn>1&&St.createElement(lt.Z,{title:"\u5220\u9664"},St.createElement("i",{className:`${Ht.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>qe(Si.filter((Hi,ci)=>ci!==Dn))})),Dn<7&&Dn===Si.length-1&&St.createElement(lt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},St.createElement("i",{className:`${Ht.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>qe([...Si,""])})))),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:gi,max:1e4,min:-1,onChange:Fe=>{zn(Fe)}})," \u5206"),St.createElement("aside",{className:"tr"},xe.question_id&&St.createElement(Ft.ZP,{type:"default",onClick:()=>hi(!1)},"\u53D6\u6D88"),St.createElement(Ft.ZP,{className:"ml20",type:"primary",onClick:()=>di()},"\u4FDD\u5B58")));return St.createElement("section",{className:Ht.wrap},!Ri&&Pe(),Ri&&io())};var Xn=(0,de.connect)(({problemset:Be,loading:qt,globalSetting:ae})=>({problemset:Be,globalSetting:ae,loading:qt.effects}),null,null,{forwardRef:!0})((0,St.forwardRef)(Rn)),Ni=Kt(98813),Yt=Object.defineProperty,jt=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,un=Object.prototype.propertyIsEnumerable,Ln=(Be,qt,ae)=>qt in Be?Yt(Be,qt,{enumerable:!0,configurable:!0,writable:!0,value:ae}):Be[qt]=ae,Le=(Be,qt)=>{for(var ae in qt||(qt={}))Ce.call(qt,ae)&&Ln(Be,ae,qt[ae]);if(jt)for(var ae of jt(qt))un.call(qt,ae)&&Ln(Be,ae,qt[ae]);return Be},nn=(Be,qt)=>{var ae={};for(var Mn in Be)Ce.call(Be,Mn)&&qt.indexOf(Mn)<0&&(ae[Mn]=Be[Mn]);if(Be!=null&&jt)for(var Mn of jt(Be))qt.indexOf(Mn)<0&&un.call(Be,Mn)&&(ae[Mn]=Be[Mn]);return ae},hn=(Be,qt,ae)=>new Promise((Mn,Gi)=>{var Ai=xe=>{try{Ye(ae.next(xe))}catch(ei){Gi(ei)}},gn=xe=>{try{Ye(ae.throw(xe))}catch(ei){Gi(ei)}},Ye=xe=>xe.done?Mn(xe.value):Promise.resolve(xe.value).then(Ai,gn);Ye((ae=ae.apply(Be,qt)).next())});const _n=["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"],fn=(Be,qt)=>{var ae=Be,{problemset:Mn,globalSetting:Gi,loading:Ai,dispatch:gn,onRef:Ye=()=>{},editData:xe}=ae,ei=nn(ae,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[Si,qe]=(0,St.useState)([]),[Hn,So]=(0,St.useState)(),[Bi,Qi]=(0,St.useState)([]),[he,Yn]=(0,St.useState)(""),[gi,zn]=(0,St.useState)(0),[Ri,hi]=(0,St.useState)(!1),xi=(0,de.useParams)();(0,St.useEffect)(()=>{qe(["","","",""])},[]),(0,St.useEffect)(()=>{if(!(xe!=null&&xe.question_choices)){hi(!0);return}Yn(xe==null?void 0:xe.question_title),zn(parseInt(xe==null?void 0:xe.question_score)),qe(xe==null?void 0:xe.question_choices.map(Dn=>Dn.choice_text));const Fe=[];xe==null||xe.standard_answer.map((Dn,Hi)=>{Fe.push(Dn-1)}),Qi(Fe)},[xe]),(0,St.useImperativeHandle)(qt,()=>({onSave:di,isEdit:Ri}));const di=()=>hn(void 0,null,function*(){if(!he)return re.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),!1;const Fe=Si.findIndex(ci=>!ci);if(Fe>-1)return re.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${_n[Fe]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Bi.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(Bi.length<1)return re.ZP.info("\u8BF7\u9009\u62E9\u7B54\u6848"),!1;const Dn=Si.map((ci,nr)=>({choice_text:ci,is_answer:Bi.includes(nr)?nr+1:0}));let Hi;xe.question_id?Hi=yield(0,et.Kc)({id:xe.question_id,question_title:he,question_type:1,question_score:gi,question_choices:Dn.map(ci=>ci.choice_text),standard_answers:Dn.filter(ci=>ci.is_answer).map(ci=>ci.is_answer)}):Hi=yield(0,et.iV)({exercise_bank_id:xi.topicId,question_title:he,question_type:1,question_score:"5.0",question_choices:Dn.map(ci=>ci.choice_text),standard_answers:Dn.filter(ci=>ci.is_answer).map(ci=>ci.is_answer)}),Hi.status===0&&(re.ZP.success("\u4FDD\u5B58\u6210\u529F"),hi(!1)),yield gn({type:"polls/getExerciseBanks",payload:Le({},xi)})}),Zn=[{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"}],pi=Fe=>hn(void 0,null,function*(){switch(Fe.id){case"del":let Dn;Ue.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,et.x$)({pollsId:xe.question_id}),gn({type:"polls/getExerciseBanks",payload:Le({},xi)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:xe==null?void 0:xe.question_id,opr:Fe.id}),gn({type:"polls/getExerciseBanks",payload:Le({},xi)});break;case"edit":hi(!0);break}}),Pe=()=>{var Fe;return St.createElement("aside",null,St.createElement("div",{className:Ht.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},xe.key,"\u3001\u5355\u9009\u9898"),"\uFF08",xe.question_score,"\u5206\uFF09"),!xe.hideAction&&Zn.map(function(Dn,Hi){return Dn.id==="up"&&xe.key===1||Dn.id==="down"&&xe.key===xe.len?null:St.createElement(lt.Z,{key:Hi,placement:"bottom",title:Dn.name},St.createElement("span",{onClick:()=>pi(Dn),className:Dn.icon}))})),St.createElement("div",{className:"mt5"},St.createElement(zt.Z,{value:xe.question_title})),St.createElement("div",{className:Ht.questionChoices},(Fe=xe==null?void 0:xe.question_choices)==null?void 0:Fe.map(function(Dn,Hi){return St.createElement(ue.Z,null,St.createElement(Se.Z,null,St.createElement(Ni.ZP,{key:Hi,checked:xe.standard_answer.includes(Hi+1),disabled:!0},_n[Hi],".")),St.createElement(Se.Z,{flex:"1"},St.createElement("span",{className:"c-black font14"},St.createElement(zt.Z,{value:Dn.choice_text}))))})))},io=()=>St.createElement("aside",null,St.createElement("div",{className:Ht.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:Ht.titleWrap},St.createElement("span",{className:Ht.required},"*"),St.createElement("span",{className:Ht.title},"\u9898\u5E72\uFF1A")),St.createElement(Nt.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:he,onChange:Fe=>Yn(Fe)}),St.createElement("p",{className:Ht.titleWrap},St.createElement("span",{className:Ht.required},"*"),St.createElement("span",{className:Ht.title},"\u7B54\u6848\u9009\u9879\uFF1A",St.createElement("span",{className:Ht.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Si.map((Fe,Dn)=>St.createElement("div",{className:Ht.choiceWrap,key:Dn},St.createElement(lt.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},St.createElement("div",{className:`${Ht.answer} ${Bi.includes(Dn)?Ht.activeAnswer:""}`,onClick:()=>{Bi.includes(Dn)?Qi(Bi.filter(Hi=>Hi!==Dn)):Qi([...Bi,Dn])}},_n[Dn])),St.createElement("div",{className:Ht.editorWrap},Hn===Dn?St.createElement(Nt.Z,{id:`single-question-option-${Dn}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Fe,onChange:Hi=>{Si[Dn]=Hi,qe(Si)}}):St.createElement("div",{className:Ht.htmlWrap,onClick:()=>So(Dn)},St.createElement(zt.Z,{value:Fe}))),Dn>1&&St.createElement(lt.Z,{title:"\u5220\u9664"},St.createElement("i",{className:`${Ht.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>qe(Si.filter((Hi,ci)=>ci!==Dn))})),Dn<7&&Dn===Si.length-1&&St.createElement(lt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},St.createElement("i",{className:`${Ht.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>qe([...Si,""])})))),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:gi,max:1e4,min:-1,onChange:Fe=>{zn(Fe)}})," \u5206"),St.createElement("aside",{className:"tr"},xe.question_id&&St.createElement(Ft.ZP,{type:"default",onClick:()=>hi(!1)},"\u53D6\u6D88"),St.createElement(Ft.ZP,{className:"ml20",type:"primary",onClick:()=>di()},"\u4FDD\u5B58")));return St.createElement("section",{className:Ht.wrap},!Ri&&Pe(),Ri&&io())};var le=(0,de.connect)(({problemset:Be,loading:qt,globalSetting:ae})=>({problemset:Be,globalSetting:ae,loading:qt.effects}),null,null,{forwardRef:!0})((0,St.forwardRef)(fn)),we=Object.defineProperty,Pn=Object.getOwnPropertySymbols,vn=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable,Mt=(Be,qt,ae)=>qt in Be?we(Be,qt,{enumerable:!0,configurable:!0,writable:!0,value:ae}):Be[qt]=ae,Lt=(Be,qt)=>{for(var ae in qt||(qt={}))vn.call(qt,ae)&&Mt(Be,ae,qt[ae]);if(Pn)for(var ae of Pn(qt))_t.call(qt,ae)&&Mt(Be,ae,qt[ae]);return Be},At=(Be,qt)=>{var ae={};for(var Mn in Be)vn.call(Be,Mn)&&qt.indexOf(Mn)<0&&(ae[Mn]=Be[Mn]);if(Be!=null&&Pn)for(var Mn of Pn(Be))qt.indexOf(Mn)<0&&_t.call(Be,Mn)&&(ae[Mn]=Be[Mn]);return ae},Wt=(Be,qt,ae)=>new Promise((Mn,Gi)=>{var Ai=xe=>{try{Ye(ae.next(xe))}catch(ei){Gi(ei)}},gn=xe=>{try{Ye(ae.throw(xe))}catch(ei){Gi(ei)}},Ye=xe=>xe.done?Mn(xe.value):Promise.resolve(xe.value).then(Ai,gn);Ye((ae=ae.apply(Be,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"],be=(Be,qt)=>{var ae=Be,{problemset:Mn,globalSetting:Gi,loading:Ai,dispatch:gn,onRef:Ye=()=>{},editData:xe}=ae,ei=At(ae,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[Si,qe]=(0,St.useState)(),[Hn,So]=(0,St.useState)(""),[Bi,Qi]=(0,St.useState)(!1),[he,Yn]=(0,St.useState)(5),gi=(0,de.useParams)();(0,St.useEffect)(()=>{if(!(xe!=null&&xe.question_choices)){Qi(!0);return}So(xe==null?void 0:xe.question_title),Yn(xe==null?void 0:xe.question_score),qe(xe.standard_answer[0]+"")},[xe]),(0,St.useImperativeHandle)(qt,()=>({onSave:zn,isEdit:Bi}));const zn=()=>Wt(void 0,null,function*(){if(!Hn)return re.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!Si)return re.ZP.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;const Zn=[{choice_text:"\u6B63\u786E",is_answer:Si==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Si==="2"?2:0}];let pi;return xe.question_id?pi=yield(0,et.Kc)({id:xe.question_id,question_title:Hn,question_type:2,question_score:he,question_choices:Zn.map(Pe=>Pe.choice_text),standard_answers:Zn.filter(Pe=>Pe.is_answer).map(Pe=>Pe.is_answer)}):pi=yield(0,et.iV)({exercise_bank_id:gi.topicId,question_title:Hn,question_type:2,question_score:he,question_choices:Zn.map(Pe=>Pe.choice_text),standard_answers:Zn.filter(Pe=>Pe.is_answer).map(Pe=>Pe.is_answer)}),pi.status===0&&(re.ZP.success("\u4FDD\u5B58\u6210\u529F"),Qi(!1)),gn({type:"polls/getExerciseBanks",payload:Lt({},gi)}),{name:Hn,choices:Zn}}),Ri=[{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"}],hi=Zn=>Wt(void 0,null,function*(){switch(Zn.id){case"del":let pi;Ue.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return Wt(this,null,function*(){yield(0,et.x$)({pollsId:xe.question_id}),gn({type:"polls/getExerciseBanks",payload:Lt({},gi)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:xe==null?void 0:xe.question_id,opr:Zn.id}),gn({type:"polls/getExerciseBanks",payload:Lt({},gi)});break;case"edit":Qi(!0);break}}),xi=()=>{var Zn;return St.createElement("aside",null,St.createElement("div",{className:Ht.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},xe.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",xe.question_score,"\u5206\uFF09"),!xe.hideAction&&Ri.map(function(pi,Pe){return pi.id==="up"&&xe.key===1||pi.id==="down"&&xe.key===xe.len?null:St.createElement(lt.Z,{key:Pe,placement:"bottom",title:pi.name},St.createElement("span",{onClick:()=>hi(pi),className:pi.icon}))})),St.createElement("div",{className:"mt5"},xe.question_title),St.createElement("div",{className:Ht.questionChoices},(Zn=xe==null?void 0:xe.question_choices)==null?void 0:Zn.map(function(pi,Pe){return St.createElement(Ni.ZP,{key:Pe,checked:xe.standard_answer.includes(Pe+1),disabled:!0},Et[Pe],". ",St.createElement("span",{className:"c-black font14"},pi.choice_text))})))},di=()=>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:Ht.titleWrap},St.createElement("span",{className:Ht.required},"*"),St.createElement("span",{className:Ht.title},"\u9898\u5E72\uFF1A")),St.createElement(Nt.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Hn,onChange:Zn=>So(Zn)}),St.createElement("p",{className:Ht.titleWrap},St.createElement("span",{className:Ht.required},"*"),St.createElement("span",{className:Ht.title},"\u7B54\u6848\u9009\u9879\uFF1A",St.createElement("span",{className:Ht.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),St.createElement(Ni.ZP.Group,{buttonStyle:"solid",value:Si,onChange:Zn=>qe(Zn.target.value)},St.createElement(Ni.ZP.Button,{value:"1",className:`${Ht.radio} mr40`},"\u6B63\u786E"),St.createElement(Ni.ZP.Button,{value:"2",className:Ht.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:he,max:1e4,min:-1,onChange:Zn=>{Yn(Zn)}})," \u5206"),St.createElement("aside",{className:"tr"},xe.question_id&&St.createElement(Ft.ZP,{type:"default",onClick:()=>Qi(!1)},"\u53D6\u6D88"),St.createElement(Ft.ZP,{className:"ml20",type:"primary",onClick:()=>zn()},"\u4FDD\u5B58")));return St.createElement("section",{className:Ht.wrap},!Bi&&xi(),Bi&&di())};var Nn=(0,de.connect)(({problemset:Be,loading:qt,globalSetting:ae})=>({problemset:Be,globalSetting:ae,loading:qt.effects}),null,null,{forwardRef:!0})((0,St.forwardRef)(be)),mi=Kt(35566),On=Kt(73646),Gn=Kt(28706),Fi=Object.defineProperty,yn=Object.getOwnPropertySymbols,Li=Object.prototype.hasOwnProperty,yi=Object.prototype.propertyIsEnumerable,Ui=(Be,qt,ae)=>qt in Be?Fi(Be,qt,{enumerable:!0,configurable:!0,writable:!0,value:ae}):Be[qt]=ae,Jn=(Be,qt)=>{for(var ae in qt||(qt={}))Li.call(qt,ae)&&Ui(Be,ae,qt[ae]);if(yn)for(var ae of yn(qt))yi.call(qt,ae)&&Ui(Be,ae,qt[ae]);return Be},xr=(Be,qt)=>{var ae={};for(var Mn in Be)Li.call(Be,Mn)&&qt.indexOf(Mn)<0&&(ae[Mn]=Be[Mn]);if(Be!=null&&yn)for(var Mn of yn(Be))qt.indexOf(Mn)<0&&yi.call(Be,Mn)&&(ae[Mn]=Be[Mn]);return ae},Mo=(Be,qt,ae)=>new Promise((Mn,Gi)=>{var Ai=xe=>{try{Ye(ae.next(xe))}catch(ei){Gi(ei)}},gn=xe=>{try{Ye(ae.throw(xe))}catch(ei){Gi(ei)}},Ye=xe=>xe.done?Mn(xe.value):Promise.resolve(xe.value).then(Ai,gn);Ye((ae=ae.apply(Be,qt)).next())});const ao=null,$i=(Be,qt)=>{var ae=Be,{problemset:Mn,globalSetting:Gi,loading:Ai,dispatch:gn,editData:Ye}=ae,xe=xr(ae,["problemset","globalSetting","loading","dispatch","editData"]);const[ei,Si]=(0,St.useState)(""),[qe,Hn]=(0,St.useState)(""),[So,Bi]=(0,St.useState)([]),[Qi,he]=(0,St.useState)(""),[Yn,gi]=(0,St.useState)(),[zn,Ri]=(0,St.useState)(!1),[hi,xi]=(0,St.useState)(5),[di,Zn]=(0,St.useState)(!1),pi=(0,de.useParams)();(0,St.useEffect)(()=>{if(!(Ye!=null&&Ye.question_title)){Zn(!0);return}Si(Ye==null?void 0:Ye.question_title),gi(Ye==null?void 0:Ye.is_ordered),xi(Ye==null?void 0:Ye.question_score);const zi=Ye==null?void 0:Ye.standard_answer.map(Ci=>Ci.answer_text);Bi(zi)},[Mn.editData]),(0,St.useEffect)(()=>{Ri(!1)},[di]),(0,St.useImperativeHandle)(qt,()=>({onSave:Pe,isEdit:di}));const Pe=()=>Mo(void 0,null,function*(){let zi=[],Ci=!1;if(So.forEach((It,mo)=>{zi.push({choice_id:mo+1,answer_text:[]}),It.forEach((xs,ta)=>{zi[mo].answer_text.push(xs),(!xs||!(0,Gn.eR)(xs,1e4))&&(he(`${mo}-${ta}`),re.ZP.info(xs?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Ci=!0)})}),Ci)return!1;let ln;return Ye.question_id?ln=yield(0,et.Kc)({id:Ye.question_id,question_title:ei,question_type:3,question_score:hi,is_ordered:Yn,standard_answers:zi}):ln=yield(0,et.iV)({exercise_bank_id:pi.topicId,question_title:ei,question_type:3,question_score:hi,is_ordered:Yn,standard_answers:zi}),ln.status===0&&(re.ZP.success("\u4FDD\u5B58\u6210\u529F"),Zn(!1)),gn({type:"polls/getExerciseBanks",payload:Jn({},pi)}),{name:ei,analysis:qe,standard_answers:zi,is_ordered:Yn}}),io=(zi,Ci,ln)=>{const It=So.slice();if(Ci&&It.splice(zi,Ci),ln&&zn)for(let mo=0;mo<ln;mo++)It.splice(zi+mo,0,[""]);Ri(!0),Bi(It)},Fe=(zi,Ci,ln)=>{he("");let It=So.slice();It[zi][Ci]=ln,Bi(It)},Dn=zi=>{let Ci=So.slice();Ci[zi]=[...Ci[zi],""],Bi(Ci)},Hi=(zi,Ci)=>{let ln=So.slice();if(!ln[zi][Ci]){ln[zi]=ln[zi].filter((It,mo)=>mo!==Ci),Bi(ln);return}Ue.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:Ht.modal,onOk:()=>{ln[zi]=ln[zi].filter((It,mo)=>mo!==Ci),Bi(ln)}})},ci=zi=>{Ue.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:Ht.modal,onOk:()=>{let Ci=So.slice();Ci=So.filter((ln,It)=>zi!==It),Bi(Ci)}})},nr=()=>St.createElement("aside",null,St.createElement("div",{className:Ht.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(mi.Z,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:ei,onChange:zi=>Si(zi),showNullButton:!0,onPlaceholderChange:io})),St.createElement("div",{className:"mt20"},So.map((zi,Ci)=>St.createElement(On.Z,{key:Ci,answers:zi,index:Ci,is_md:!0,activeOptionErrorIndex:Qi,onAnswerChange:Fe,addChildAnswer:Dn,deleteChildAnswer:Hi,deleteChildAnswermain:ci}))),St.createElement("div",{className:"mt20"},So.length>1&&St.createElement("span",null,St.createElement(pt.default,{checked:Yn,onChange:zi=>gi(zi.target.checked),className:`${Ht.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),St.createElement("span",{className:`${Ht.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:hi,max:1e4,min:-1,onChange:zi=>{xi(zi)}})," \u5206"),St.createElement("aside",{className:"tr"},Ye.question_id&&St.createElement(Ft.ZP,{type:"default",onClick:()=>Zn(!1)},"\u53D6\u6D88"),St.createElement(Ft.ZP,{className:"ml20",type:"primary",onClick:()=>Pe()},"\u4FDD\u5B58"))),Yi=[{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"}],ui=zi=>Mo(void 0,null,function*(){switch(zi.id){case"del":let Ci;Ue.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return Mo(this,null,function*(){yield(0,et.x$)({pollsId:Ye.question_id}),gn({type:"polls/getExerciseBanks",payload:Jn({},pi)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:Ye==null?void 0:Ye.question_id,opr:zi.id}),gn({type:"polls/getExerciseBanks",payload:Jn({},pi)});break;case"edit":Zn(!0);break}}),Ki=()=>{var zi;return St.createElement("aside",null,St.createElement("div",{className:Ht.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},Ye.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",Ye.question_score,"\u5206\uFF09"),!Ye.hideAction&&Yi.map(function(Ci,ln){return Ci.id==="up"&&Ye.key===1||Ci.id==="down"&&Ye.key===Ye.len?null:St.createElement(lt.Z,{key:ln,placement:"bottom",title:Ci.name},St.createElement("span",{onClick:()=>ui(Ci),className:Ci.icon}))})),St.createElement("div",{className:"mt5"},Ye.question_title),St.createElement("div",{className:Ht.questionChoices},(zi=Ye==null?void 0:Ye.standard_answer)==null?void 0:zi.map(function(Ci,ln){return St.createElement(ue.Z,null,St.createElement(Se.Z,null,"\u7B54\u6848\uFF08\u586B\u7A7A",Ci.choice_id,"\uFF09\uFF1A"),St.createElement(Se.Z,{flex:"1"},St.createElement(Ze.default,{key:ln,checked:Ye.standard_answer.includes(ln),disabled:!0,value:Ci.answer_text})))})))};return St.createElement("section",{className:Ht.wrap},!di&&Ki(),di&&nr())};var Kr=(0,de.connect)(({problemset:Be,loading:qt,globalSetting:ae})=>({problemset:Be,globalSetting:ae,loading:qt.effects}),null,null,{forwardRef:!0})((0,St.forwardRef)($i)),No=Object.defineProperty,fr=Object.getOwnPropertySymbols,sr=Object.prototype.hasOwnProperty,Pr=Object.prototype.propertyIsEnumerable,Vi=(Be,qt,ae)=>qt in Be?No(Be,qt,{enumerable:!0,configurable:!0,writable:!0,value:ae}):Be[qt]=ae,Ir=(Be,qt)=>{for(var ae in qt||(qt={}))sr.call(qt,ae)&&Vi(Be,ae,qt[ae]);if(fr)for(var ae of fr(qt))Pr.call(qt,ae)&&Vi(Be,ae,qt[ae]);return Be},Ns=(Be,qt)=>{var ae={};for(var Mn in Be)sr.call(Be,Mn)&&qt.indexOf(Mn)<0&&(ae[Mn]=Be[Mn]);if(Be!=null&&fr)for(var Mn of fr(Be))qt.indexOf(Mn)<0&&Pr.call(Be,Mn)&&(ae[Mn]=Be[Mn]);return ae},jr=(Be,qt,ae)=>new Promise((Mn,Gi)=>{var Ai=xe=>{try{Ye(ae.next(xe))}catch(ei){Gi(ei)}},gn=xe=>{try{Ye(ae.throw(xe))}catch(ei){Gi(ei)}},Ye=xe=>xe.done?Mn(xe.value):Promise.resolve(xe.value).then(Ai,gn);Ye((ae=ae.apply(Be,qt)).next())});const Va=null,Hs=(Be,qt)=>{var ae=Be,{problemset:Mn,globalSetting:Gi,loading:Ai,dispatch:gn,onRef:Ye=()=>{},editData:xe}=ae,ei=Ns(ae,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[Si,qe]=(0,St.useState)(""),[Hn,So]=(0,St.useState)(""),[Bi,Qi]=(0,St.useState)(""),[he,Yn]=(0,St.useState)(5),[gi,zn]=(0,St.useState)(!1),Ri=(0,de.useParams)();(0,St.useEffect)(()=>{var Pe;if(!(xe!=null&&xe.question_title)){zn(!0);return}qe(xe==null?void 0:xe.question_title),Qi((Pe=xe==null?void 0:xe.standard_answer)==null?void 0:Pe[0]),Yn(xe==null?void 0:xe.question_score)},[Mn.editData]),(0,St.useImperativeHandle)(qt,()=>({onSave:hi,isEdit:gi}));const hi=()=>jr(void 0,null,function*(){if(!Si)return re.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;let Pe;return xe.question_id?Pe=yield(0,et.Kc)({id:xe.question_id,question_title:Si,question_type:4,question_score:he,standard_answers:[Bi]}):Pe=yield(0,et.iV)({exercise_bank_id:Ri.topicId,question_title:Si,question_type:4,question_score:he,standard_answers:[Bi]}),Pe.status===0&&(re.ZP.success("\u4FDD\u5B58\u6210\u529F"),zn(!1),gn({type:"polls/getExerciseBanks",payload:Ir({},Ri)})),{name:Si,answer_texts:[Bi],analysis:Hn}}),xi=()=>St.createElement("aside",null,St.createElement("div",{className:Ht.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(Nt.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Si,onChange:Pe=>qe(Pe)}),St.createElement("p",{className:Ht.titleWrap},St.createElement("span",{className:Ht.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),St.createElement(Nt.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Bi,onChange:Pe=>Qi(Pe)}),St.createElement("p",{className:""},"\u5206\u503C\uFF1A",St.createElement(vt.Z,{value:he,max:1e4,min:-1,onChange:Pe=>{Yn(Pe)}})," \u5206"),St.createElement("aside",{className:"tr"},xe.question_id&&St.createElement(Ft.ZP,{type:"default",onClick:()=>zn(!1)},"\u53D6\u6D88"),St.createElement(Ft.ZP,{className:"ml20",type:"primary",onClick:()=>hi()},"\u4FDD\u5B58"))),di=[{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"}],Zn=Pe=>jr(void 0,null,function*(){switch(Pe.id){case"del":let io;Ue.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return jr(this,null,function*(){yield(0,et.x$)({pollsId:xe.question_id}),gn({type:"polls/getExerciseBanks",payload:Ir({},Ri)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:xe==null?void 0:xe.question_id,opr:Pe.id}),gn({type:"polls/getExerciseBanks",payload:Ir({},Ri)});break;case"edit":zn(!0);break}}),pi=()=>St.createElement("aside",null,St.createElement("div",{className:Ht.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},xe.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",xe.question_score,"\u5206\uFF09"),!xe.hideAction&&di.map(function(Pe,io){return Pe.id==="up"&&xe.key===1||Pe.id==="down"&&xe.key===xe.len?null:St.createElement(lt.Z,{key:io,placement:"bottom",title:Pe.name},St.createElement("span",{onClick:()=>Zn(Pe),className:Pe.icon}))})),St.createElement("div",{className:"mt5"},xe.question_title),St.createElement("div",{className:Ht.questionChoices},St.createElement("p",null,St.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),St.createElement(zt.Z,{value:Bi})));return St.createElement("section",{className:Ht.wrap},!gi&&pi(),gi&&xi())};var Ws=(0,de.connect)(({problemset:Be,loading:qt,globalSetting:ae})=>({problemset:Be,globalSetting:ae,loading:qt.effects}),null,null,{forwardRef:!0})((0,St.forwardRef)(Hs)),gr=Object.defineProperty,Ti=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,xt=Object.prototype.propertyIsEnumerable,Sn=(Be,qt,ae)=>qt in Be?gr(Be,qt,{enumerable:!0,configurable:!0,writable:!0,value:ae}):Be[qt]=ae,mn=(Be,qt)=>{for(var ae in qt||(qt={}))We.call(qt,ae)&&Sn(Be,ae,qt[ae]);if(Ti)for(var ae of Ti(qt))xt.call(qt,ae)&&Sn(Be,ae,qt[ae]);return Be},rn=(Be,qt)=>{var ae={};for(var Mn in Be)We.call(Be,Mn)&&qt.indexOf(Mn)<0&&(ae[Mn]=Be[Mn]);if(Be!=null&&Ti)for(var Mn of Ti(Be))qt.indexOf(Mn)<0&&xt.call(Be,Mn)&&(ae[Mn]=Be[Mn]);return ae},en=(Be,qt,ae)=>new Promise((Mn,Gi)=>{var Ai=xe=>{try{Ye(ae.next(xe))}catch(ei){Gi(ei)}},gn=xe=>{try{Ye(ae.throw(xe))}catch(ei){Gi(ei)}},Ye=xe=>xe.done?Mn(xe.value):Promise.resolve(xe.value).then(Ai,gn);Ye((ae=ae.apply(Be,qt)).next())});const sn=null,wn=(Be,qt)=>{var ae=Be,{problemset:Mn,globalSetting:Gi,loading:Ai,dispatch:gn,editData:Ye}=ae,xe=rn(ae,["problemset","globalSetting","loading","dispatch","editData"]);const[ei,Si]=(0,St.useState)(""),[qe,Hn]=(0,St.useState)(""),[So,Bi]=(0,St.useState)(""),[Qi,he]=(0,St.useState)([]),[Yn,gi]=(0,St.useState)(""),[zn,Ri]=(0,St.useState)(),[hi,xi]=(0,St.useState)(!1),[di,Zn]=(0,St.useState)([]),[pi,Pe]=(0,St.useState)(!1),io=(0,de.useParams)();(0,St.useEffect)(()=>{var Yi;Ye.edit&&Pe(!0),Si(Ye.shixun_name),Hn(Ye.question_title);const ui=[];(Yi=Ye.shixun)==null||Yi.map(Ki=>{ui.push(Ki.challenge_score)}),Zn(ui)},[Ye]),(0,St.useEffect)(()=>{xi(!1)},[pi]),(0,St.useImperativeHandle)(qt,()=>({onSave:Fe,isEdit:pi}));const Fe=()=>en(void 0,null,function*(){let Yi=[];if(!1)return!1;let Ki;return Ye.question_id?Ki=yield(0,et.Kc)({id:Ye.question_id,question_title:qe,shixun_name:ei,shixun_id:Ye.shixun_id,question_type:5,question_scores:di}):Ki=yield(0,et.iV)({exercise_bank_id:io.topicId,question_title:qe,shixun_name:ei,shixun_id:Ye.shixun_id,question_type:5,question_scores:di}),Ki.status===0&&(re.ZP.success("\u4FDD\u5B58\u6210\u529F"),Pe(!1)),yield gn({type:"polls/getExerciseBanks",payload:mn({},io)}),{name:qe,analysis:So,standard_answers:Yi,is_ordered:zn}}),Dn=()=>{var Yi;return St.createElement("aside",null,St.createElement("div",{className:Ht.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(Ze.default,{defaultValue:ei,onChange:ui=>{Si(ui.target.value)}})),St.createElement("div",{className:"mt10"},St.createElement(Nt.Z,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:qe,onChange:ui=>{Hn(ui)}})),St.createElement("div",{className:"mt20"},(Yi=Ye.shixun)==null?void 0:Yi.map((ui,Ki)=>St.createElement(ue.Z,{gutter:[20,20]},St.createElement(Se.Z,{flex:"1"},Ki+1,".",ui.challenge_name),St.createElement(Se.Z,null,St.createElement(vt.Z,{defaultValue:di[Ki],onChange:zi=>{di[Ki]=zi,Zn(di),console.log("srore:L",di[Ki])}}))))),St.createElement("div",{className:"mt20"},Qi.length>1&&St.createElement("span",null,St.createElement(pt.default,{checked:zn,onChange:ui=>Ri(ui.target.checked),className:`${Ht.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),St.createElement("span",{className:`${Ht.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"},!(Ye!=null&&Ye.edit)&&St.createElement(Ft.ZP,{type:"default",onClick:()=>Pe(!1)},"\u53D6\u6D88"),St.createElement(Ft.ZP,{className:"ml20",type:"primary",onClick:()=>Fe()},"\u4FDD\u5B58")))},Hi=[{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"}],ci=Yi=>en(void 0,null,function*(){switch(Yi.id){case"del":let ui;Ue.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return en(this,null,function*(){yield(0,et.x$)({pollsId:Ye.question_id}),gn({type:"polls/getExerciseBanks",payload:mn({},io)})})}});break;case"up":case"down":yield(0,et.W)({exerciseId:Ye==null?void 0:Ye.question_id,opr:Yi.id}),gn({type:"polls/getExerciseBanks",payload:mn({},io)});break;case"edit":Pe(!0);break}}),nr=()=>{var Yi;return St.createElement("aside",null,St.createElement("div",{className:Ht.questionType},St.createElement("div",null,St.createElement("span",{className:"font16 c-blue"},Ye.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",Ye.question_score,"\u5206\uFF09"),St.createElement("div",{className:"tr"},St.createElement(de.Link,{target:"_blank",to:`/shixuns/${Ye.shixun_identifier}/challenges`},"\u5B9E\u8BAD\u8BE6\u60C5"),!Ye.hideAction&&Hi.map(function(ui,Ki){return ui.id==="up"&&Ye.key===1||ui.id==="down"&&Ye.key===Ye.len?null:St.createElement(lt.Z,{key:Ki,placement:"bottom",title:ui.name},St.createElement("span",{onClick:()=>ci(ui),className:ui.icon}))}))),St.createElement("div",{className:"font16"},Ye.shixun_name),St.createElement("div",{className:"mt30"}),(Yi=Ye.shixun)==null?void 0:Yi.map(function(ui,Ki){return St.createElement("div",{key:Ki},"\u7B2C",Ki+1,"\u5173 ",St.createElement("span",{className:"ml10"},ui.challenge_name)," ",St.createElement("span",{className:"ml10"},ui.challenge_score))}))};return St.createElement("section",{className:Ht.wrap},!pi&&nr(),pi&&Dn())};var Qn=(0,de.connect)(({problemset:Be,loading:qt,globalSetting:ae})=>({problemset:Be,globalSetting:ae,loading:qt.effects}),null,null,{forwardRef:!0})((0,St.forwardRef)(wn)),ye={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=Kt(64239),ne=Object.defineProperty,ke=Object.getOwnPropertySymbols,xn=Object.prototype.hasOwnProperty,Fn=Object.prototype.propertyIsEnumerable,In=(Be,qt,ae)=>qt in Be?ne(Be,qt,{enumerable:!0,configurable:!0,writable:!0,value:ae}):Be[qt]=ae,ge=(Be,qt)=>{for(var ae in qt||(qt={}))xn.call(qt,ae)&&In(Be,ae,qt[ae]);if(ke)for(var ae of ke(qt))Fn.call(qt,ae)&&In(Be,ae,qt[ae]);return Be},Ge=(Be,qt)=>{var ae={};for(var Mn in Be)xn.call(Be,Mn)&&qt.indexOf(Mn)<0&&(ae[Mn]=Be[Mn]);if(Be!=null&&ke)for(var Mn of ke(Be))qt.indexOf(Mn)<0&&Fn.call(Be,Mn)&&(ae[Mn]=Be[Mn]);return ae},Bn=(Be,qt,ae)=>new Promise((Mn,Gi)=>{var Ai=xe=>{try{Ye(ae.next(xe))}catch(ei){Gi(ei)}},gn=xe=>{try{Ye(ae.throw(xe))}catch(ei){Gi(ei)}},Ye=xe=>xe.done?Mn(xe.value):Promise.resolve(xe.value).then(Ai,gn);Ye((ae=ae.apply(Be,qt)).next())});const{SubMenu:ri}=Ie.default,{Content:Qe,Sider:ce}=$e.default,Tn=Be=>{var qt=Be,{polls:ae,globalSetting:Mn,loading:Gi,user:Ai,dispatch:gn}=qt,Ye=Ge(qt,["polls","globalSetting","loading","user","dispatch"]),xe,ei,Si,qe,Hn,So,Bi,Qi,he,Yn,gi,zn,Ri,hi,xi,di,Zn,pi,Pe,io,Fe,Dn,Hi,ci,nr,Yi,ui,Ki,zi,Ci,ln,It,mo,xs,ta,Ps,al,Ua,Wl,Pl,Po,Jo,ai,ii,ki,Ke,oo,vo,Xo,Eo,Ro,ar,hs,Tr,Ya,Na,pe;const Vo=(0,de.useParams)(),ba=(0,de.useLocation)(),{userInfo:Ka}=Ai,[Io]=me.default.useForm(),[Vs,Vl]=(0,St.useState)([]),[wl,yo]=(0,St.useState)(!1),lr=[{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}],bi=(0,St.useRef)();(0,St.useEffect)(()=>{var zo,Rr,ds,fu,Ul,En;(zo=ae.exerciseBanks)!=null&&zo.exercise_questions&&(Vl([...(Rr=ae.exerciseBanks)==null?void 0:Rr.exercise_questions]),Io.setFieldsValue({exercise_name:(fu=(ds=ae.exerciseBanks)==null?void 0:ds.exercise)==null?void 0:fu.exercise_name,exercise_description:(En=(Ul=ae.exerciseBanks)==null?void 0:Ul.exercise)==null?void 0:En.exercise_description}))},[ae.exerciseBanks]),(0,St.useEffect)(()=>{gn({type:"polls/getExerciseBanks",payload:ge({},Vo)})},[Vo.categoryId]);const Wi=()=>Bn(void 0,null,function*(){var zo,Rr;yield Io.validateFields();const ds=Io.getFieldValue();ds.is_md=!0,ds.topicId=(Rr=(zo=ae.exerciseBanks)==null?void 0:zo.exercise)==null?void 0:Rr.id,yo(!1),yield(0,et.hO)(ge({},ds)),gn({type:"polls/getExerciseBanks",payload:ge({},Vo)})}),wo=zo=>Bn(void 0,null,function*(){const Rr=yield bi==null?void 0:bi.current;if(Rr!=null&&Rr.isEdit){re.ZP.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898");return}zo===5?gn({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}):Vl([...Vs,{question_type:zo}])}),Zo=()=>{gn({type:"userDetail/setActionTabs",payload:{key:"UserDetail-SendToClass",params:{object_id:[Vo.topicId],object_type:"exercise"}}})},qn=function(){return Vs==null?void 0:Vs.map(function(zo,Rr){if(zo.key=Rr+1,zo.len=Vs.length,zo.question_type===0)return St.createElement("aside",null,St.createElement(le,{ref:bi,editData:zo}),St.createElement(Zt.Z,null));if(zo.question_type===1)return St.createElement("aside",null,St.createElement(Xn,{ref:bi,editData:zo}),St.createElement(Zt.Z,null));if(zo.question_type===2)return St.createElement("aside",null,St.createElement(Nn,{ref:bi,editData:zo}),St.createElement(Zt.Z,null));if(zo.question_type===3)return St.createElement("aside",null,St.createElement(Kr,{editData:zo}),St.createElement(Zt.Z,null));if(zo.question_type===4)return St.createElement("aside",null,St.createElement(Ws,{editData:zo}),St.createElement(Zt.Z,null));if(zo.question_type===5)return St.createElement("aside",null,St.createElement(Qn,{editData:zo}),St.createElement(Zt.Z,null))})};return St.createElement("section",{className:"edu-container"},St.createElement("section",{className:"animated fadeIn"},St.createElement("aside",{className:"mt10"},Ka&&St.createElement(Oe.Z,{separator:">"},St.createElement(Oe.Z.Item,null,St.createElement(de.Link,{to:`/users/${Vo.username}/${Vo.topictype==="personal"?"topics":"topicbank"}/${Vo.topictype}`},Vo.topictype==="personal"?"\u6211\u7684\u9898\u5E93":"\u516C\u5171\u9898\u5E93")),St.createElement(Oe.Z.Item,null,"\u8BE6\u60C5"))),St.createElement("aside",{className:[ye.title,"mt20"].join(" ")},St.createElement(ue.Z,{style:{width:"100%"},align:"middle"},St.createElement(Se.Z,{flex:"1"},St.createElement("strong",{className:"font20 ml5"},(ei=(xe=ae.exerciseBanks)==null?void 0:xe.exercise)==null?void 0:ei.exercise_name),St.createElement(Gn.VV,{status:[(qe=(Si=ae.exerciseBanks)==null?void 0:Si.exercise)!=null&&qe.is_public?"\u516C\u5F00":"\u79C1\u6709"]})),St.createElement(Se.Z,null,St.createElement(de.Link,{className:"font16 c-light-black",to:`/users/${Ka.login}/topics/${Vo.topictype}`},"\u8FD4\u56DE"))))),St.createElement("section",{className:[ye.bg,"pl30","pr30","pb30","mt20 relative"].join(" ")},St.createElement("div",{className:ye.export},((Hn=ae.exerciseBanks)==null?void 0:Hn.authorize)&&St.createElement(St.Fragment,null,St.createElement("a",{onClick:zo=>{zo.preventDefault(),Ue.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:()=>Bn(void 0,null,function*(){(yield(0,nt.Tv)({object_type:"normal",object_id:[Vo.topicId]})).status===0&&de.history.push(`/users/${Vo.username}/topics/personal`)})})}},"\u5220\u9664"),St.createElement(de.Link,{to:`/users/${Ka.login}/topics/${Vo.topicId}/${Vo.topictype}/exercise/edit`},"\u7F16\u8F91")),St.createElement("a",{onClick:zo=>{zo.preventDefault(),Zo()}},"\u53D1\u9001")),St.createElement(Ee.default,{className:ye.tabs},St.createElement(Ee.default.TabPane,{tab:St.createElement("span",{className:"font16 pt10 pb12"},"\u5185\u5BB9\u8BE6\u60C5"),key:"1"},St.createElement("div",{className:"c-light-black"},(Bi=(So=ae.exerciseBanks)==null?void 0:So.exercise)==null?void 0:Bi.exercise_description))),wl&&St.createElement(me.default,{layout:"vertical",form:Io},St.createElement(me.default.Item,{name:"exercise_name",label:"\u8BD5\u5377\u6807\u9898\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},St.createElement(Ze.default,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),St.createElement(me.default.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},St.createElement(Ze.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(me.default.Item,{className:"tr"},St.createElement(Ft.ZP,{type:"primary",onClick:()=>{Wi()}},"\u4FDD\u5B58")))),St.createElement("p",{className:"mt10",style:{display:"flex"}},St.createElement("span",{className:"fl",style:{flex:"1"}},!!((he=(Qi=ae.exerciseBanks)==null?void 0:Qi.exercise_types)!=null&&he.q_singles)&&St.createElement("span",{className:"ml20"},"\u5355\u9009\u9898",(gi=(Yn=ae.exerciseBanks)==null?void 0:Yn.exercise_types)==null?void 0:gi.q_singles,"\u9898\uFF0C\u5171",(Ri=(zn=ae.exerciseBanks)==null?void 0:zn.exercise_types)==null?void 0:Ri.q_singles_scores,"\u5206"),!!((xi=(hi=ae.exerciseBanks)==null?void 0:hi.exercise_types)!=null&&xi.q_doubles)&&St.createElement("span",{className:"ml20"},"\u591A\u9009\u9898",(Zn=(di=ae.exerciseBanks)==null?void 0:di.exercise_types)==null?void 0:Zn.q_doubles,"\u9898\uFF0C\u5171",(Pe=(pi=ae.exerciseBanks)==null?void 0:pi.exercise_types)==null?void 0:Pe.q_doubles_scores,"\u5206"),!!((Fe=(io=ae.exerciseBanks)==null?void 0:io.exercise_types)!=null&&Fe.q_judges)&&St.createElement("span",{className:"ml20"},"\u5224\u65AD\u9898",(Hi=(Dn=ae.exerciseBanks)==null?void 0:Dn.exercise_types)==null?void 0:Hi.q_judges,"\u9898\uFF0C\u5171",(nr=(ci=ae.exerciseBanks)==null?void 0:ci.exercise_types)==null?void 0:nr.q_judges_scores,"\u5206"),!!((ui=(Yi=ae.exerciseBanks)==null?void 0:Yi.exercise_types)!=null&&ui.q_nulls)&&St.createElement("span",{className:"ml20"},"\u586B\u7A7A\u9898",(zi=(Ki=ae.exerciseBanks)==null?void 0:Ki.exercise_types)==null?void 0:zi.q_nulls,"\u9898\uFF0C\u5171",(ln=(Ci=ae.exerciseBanks)==null?void 0:Ci.exercise_types)==null?void 0:ln.q_nulls_scores,"\u5206"),!!((mo=(It=ae.exerciseBanks)==null?void 0:It.exercise_types)!=null&&mo.q_mains)&&St.createElement("span",{className:"ml20"},"\u7B80\u7B54\u9898",(ta=(xs=ae.exerciseBanks)==null?void 0:xs.exercise_types)==null?void 0:ta.q_mains,"\u9898\uFF0C\u5171",(al=(Ps=ae.exerciseBanks)==null?void 0:Ps.exercise_types)==null?void 0:al.q_mains_scores,"\u5206"),!!((Wl=(Ua=ae.exerciseBanks)==null?void 0:Ua.exercise_types)!=null&&Wl.q_shixuns)&&St.createElement("span",{className:"ml20"},"\u5B9E\u8BAD\u9898",(Po=(Pl=ae.exerciseBanks)==null?void 0:Pl.exercise_types)==null?void 0:Po.q_shixuns,"\u9898\uFF0C\u5171",(ai=(Jo=ae.exerciseBanks)==null?void 0:Jo.exercise_types)==null?void 0:ai.q_shixuns_scores,"\u5206"),!!((ki=(ii=ae.exerciseBanks)==null?void 0:ii.exercise_types)!=null&&ki.q_pros)&&St.createElement("span",{className:"ml20"},"\u7F16\u7A0B\u9898",(oo=(Ke=ae.exerciseBanks)==null?void 0:Ke.exercise_types)==null?void 0:oo.q_pros,"\u9898\uFF0C\u5171",(Xo=(vo=ae.exerciseBanks)==null?void 0:vo.exercise_types)==null?void 0:Xo.q_pros_scores,"\u5206")),St.createElement("span",{className:"fr"},!!((Ro=(Eo=ae.exerciseBanks)==null?void 0:Eo.exercise_types)!=null&&Ro.q_counts)&&St.createElement("span",null,"\u5408\u8BA1 ",St.createElement("span",{className:"color-blue"},(hs=(ar=ae.exerciseBanks)==null?void 0:ar.exercise_types)==null?void 0:hs.q_counts)," \u9898\uFF0C \u5171 ",St.createElement("span",{className:`${((Ya=(Tr=ae.exerciseBanks)==null?void 0:Tr.exercise_types)==null?void 0:Ya.q_scores)>100?"color-red font-bd":"color-orange"}`},(pe=(Na=ae.exerciseBanks)==null?void 0:Na.exercise_types)==null?void 0:pe.q_scores)," \u5206"))),St.createElement("section",{className:[ye.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},Vs!=""&&qn(),Vs==""&&St.createElement(ct.Z,null)),St.createElement(ve.Z,null))};var ti=(0,de.connect)(({polls:Be,loading:qt,user:ae,globalSetting:Mn})=>({polls:Be,globalSetting:Mn,user:ae,loading:qt.effects}))(Tn)},64239:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return Re}});var St=Kt(67294),de=Kt(35973),Ie=Kt(2453),$e=Kt(62844),me=Kt(55238),re=Kt(48054),Zt=Kt(98813),Oe={title:"title___XAxiE",radioWrap:"radioWrap___k0pOB",radio:"radio___x9kMt",colorFF0000:"colorFF0000___IMgd0",pagination:"pagination___ou2ht",checkboxWrapper:"checkboxWrapper___kF7xI"},ue=Kt(28706),Se=Kt(30001),Ue=Kt(74330),Ee=Kt(84567),Ze=Kt(65900),Ft=Kt(246),et=Kt.n(Ft),nt=(He,ze,Cn)=>new Promise((Rn,Xn)=>{var Ni=Ce=>{try{jt(Cn.next(Ce))}catch(un){Xn(un)}},Yt=Ce=>{try{jt(Cn.throw(Ce))}catch(un){Xn(un)}},jt=Ce=>Ce.done?Rn(Ce.value):Promise.resolve(Ce.value).then(Ni,Yt);jt((Cn=Cn.apply(He,ze)).next())}),lt=({username:He,setStages:ze,stages:Cn,hasError:Rn,setHasError:Xn})=>{const[Ni,Yt]=(0,St.useState)(""),[jt,Ce]=(0,St.useState)(1),[un,Ln]=(0,St.useState)([]),[Le,nn]=(0,St.useState)(!1),[hn,_n]=(0,St.useState)(0);(0,St.useEffect)(()=>{fn({page:1,search:""},!0)},[]);const fn=(we,Pn)=>nt(void 0,null,function*(){nn(!0);const vn=yield(0,Ze.w3)({username:He,category:"manage",page:we.page,search:we.search});nn(!1),Ln(_t=>Pn?vn==null?void 0:vn.subjects:[..._t,...vn==null?void 0:vn.subjects]),_n(vn==null?void 0:vn.count)}),le=(0,St.useRef)();return St.createElement("div",{className:Oe.wrap},St.createElement("div",{className:"mb10"},St.createElement(Se.t7,{placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",value:Ni,style:{width:500},onChange:we=>{Yt(we),Ce(1),le.current.scrollTo({behavior:"smooth",top:0}),fn({page:1,search:we},!0)}})),St.createElement(Ue.Z,{spinning:Le},St.createElement("div",{className:Oe.radioWrap,ref:le},St.createElement(et(),{initialLoad:!1,pageStart:1,threshold:6,loadMore:()=>{Ce(jt+1),fn({page:jt+1,search:Ni},!1)},hasMore:un.length<hn,useWindow:!1},St.createElement(Zt.ZP.Group,{value:Cn.subjectId,onChange:we=>{ze({subjectId:we.target.value,stage_ids:[]}),Xn(!1)}},un.map(we=>{const Pn=we.stages.map(vn=>({label:vn.name,value:vn.id}));return St.createElement("div",{key:we.id},St.createElement(Zt.ZP,{className:Oe.radio,value:we.id},we.name),we.id===Cn.subjectId&&St.createElement("div",{className:Oe.checkboxWrapper},Pn.length>0&&St.createElement(Ee.default,{indeterminate:Cn.stage_ids.length>0&&Cn.stage_ids.length<Pn.length,onChange:vn=>{ze({subjectId:we.id,stage_ids:vn.target.checked?Pn.map(_t=>_t.value):[]})},checked:Cn.stage_ids.length===Pn.length},"\u5168\u9009"),St.createElement(Ee.default.Group,{options:Pn,value:Cn.stage_ids,onChange:vn=>ze({subjectId:we.id,stage_ids:vn})})))}))))),Rn&&St.createElement("div",{className:Oe.colorFF0000},"\u8BF7\u5148\u9009\u62E9\u5B9E\u8DF5\u8BFE\u7A0B\u53CA\u7AE0\u8282"))},pt=Kt(39132),vt=Kt(60532),Ct=Object.defineProperty,Nt=Object.getOwnPropertySymbols,zt=Object.prototype.hasOwnProperty,Ht=Object.prototype.propertyIsEnumerable,$t=(He,ze,Cn)=>ze in He?Ct(He,ze,{enumerable:!0,configurable:!0,writable:!0,value:Cn}):He[ze]=Cn,ee=(He,ze)=>{for(var Cn in ze||(ze={}))zt.call(ze,Cn)&&$t(He,Cn,ze[Cn]);if(Nt)for(var Cn of Nt(ze))Ht.call(ze,Cn)&&$t(He,Cn,ze[Cn]);return He},te=(He,ze)=>{var Cn={};for(var Rn in He)zt.call(He,Rn)&&ze.indexOf(Rn)<0&&(Cn[Rn]=He[Rn]);if(He!=null&&Nt)for(var Rn of Nt(He))ze.indexOf(Rn)<0&&Ht.call(He,Rn)&&(Cn[Rn]=He[Rn]);return Cn},Ae=(He,ze,Cn)=>new Promise((Rn,Xn)=>{var Ni=Ce=>{try{jt(Cn.next(Ce))}catch(un){Xn(un)}},Yt=Ce=>{try{jt(Cn.throw(Ce))}catch(un){Xn(un)}},jt=Ce=>Ce.done?Rn(Ce.value):Promise.resolve(Ce.value).then(Ni,Yt);jt((Cn=Cn.apply(He,ze)).next())});const se=He=>{var ze=He,{userDetail:Cn,globalSetting:Rn,loading:Xn,user:Ni,dispatch:Yt}=ze,jt=te(ze,["userDetail","globalSetting","loading","user","dispatch"]),Ce,un,Ln,Le,nn;const[hn,_n]=(0,St.useState)("course"),[fn,le]=(0,St.useState)(""),[we,Pn]=(0,St.useState)([]),[vn,_t]=(0,St.useState)(),[Mt,Lt]=(0,St.useState)(!1),[At,Wt]=(0,St.useState)(!1);(0,St.useEffect)(()=>{Cn.actionTabs.key==="UserDetail-SendToClass"&&Et(fn)},[Cn.actionTabs.key]);const Et=On=>Ae(void 0,null,function*(){Lt(!0);const Gn=yield Yt({type:"userDetail/topicGetCourseList",payload:{search:On}});Gn&&Pn((Gn==null?void 0:Gn.courses)||[]),Lt(!1)}),[be,Nn]=(0,St.useState)({subjectId:"",stage_ids:[]}),mi=()=>Ae(void 0,null,function*(){var On,Gn,Fi,yn,Li,yi;if(hn==="course"){if(!vn){Wt(!0);return}const Ui=yield Yt({type:"userDetail/topicSendToClass",payload:ee({course_id:vn},(On=Cn.actionTabs)==null?void 0:On.params)});if(Yt({type:"userDetail/setActionTabs",payload:{}}),Ui&&Ui.status===0){const Jn={normal:"common_homework",group:"group_homework",exercise:"exercise",poll:"poll",videos:"video"};(0,ue.xg)(`/classrooms/${vn}/${Jn[(Fi=(Gn=Cn.actionTabs)==null?void 0:Gn.params)==null?void 0:Fi.object_type]}`)}}else{if(!be.subjectId||!be.stage_ids.length){Wt(!0);return}(yield(0,vt.nI)({id:(Li=(yn=Cn.actionTabs)==null?void 0:yn.params)==null?void 0:Li.object_id,login:(yi=Ni.userInfo)==null?void 0:yi.login},{stage_ids:be.stage_ids})).status===0&&(Ie.ZP.success("\u53D1\u9001\u6210\u529F"),Yt({type:"userDetail/setActionTabs",payload:{}}),(0,ue.xg)(`/paths/${be.subjectId}`))}});return St.createElement($e.default,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,open:Cn.actionTabs.key==="UserDetail-SendToClass",title:"\u53D1\u9001",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Xn["userDetail/sendToClass"],width:600,afterClose:()=>{Wt(!1),Pn([]),Nn({subjectId:"",stage_ids:[]}),le("")},onOk:mi,wrapClassName:pt.Z.CustomCss,onCancel:()=>{Yt({type:"userDetail/setActionTabs",payload:{}})}},St.createElement(me.default,{activeKey:hn,onChange:On=>{Wt(!1),_n(On)},items:[{label:"\u8BFE\u5802",key:"course",children:St.createElement("div",{className:Oe.wrap},St.createElement("div",{className:"mb10"},St.createElement(Se.t7,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u5802\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",value:fn,style:{width:500},onChange:On=>{le(On),Et(On)}})),St.createElement(re.Z,{active:!0,loading:Mt},St.createElement("div",{className:Oe.radioWrap},St.createElement(Zt.ZP.Group,{value:vn,onChange:On=>{_t(On.target.value),Wt(!1)}},we.map((On,Gn)=>St.createElement(Zt.ZP,{className:Oe.radio,value:On.course_id,key:On.course_id},On.course_name))))),((un=(Ce=Cn.actionTabs)==null?void 0:Ce.params)==null?void 0:un.object_type)!=="videos"&&St.createElement("div",{className:Oe.title},"\u6E29\u99A8\u63D0\u793A\uFF1A\u9009\u62E9\u7684\u9898\u5C06\u4F1A\u53D1\u9001\u5230\u6307\u5B9A\u8BFE\u5802"),At&&St.createElement("div",{className:Oe.colorFF0000},"\u8BF7\u5148\u9009\u62E9\u8BFE\u5802")),show:!0},{label:"\u5B9E\u8DF5\u8BFE\u7A0B",key:"subject",children:St.createElement(lt,{username:(Ln=Ni.userInfo)==null?void 0:Ln.login,stages:be,setStages:Nn,hasError:At,setHasError:Wt}),show:((nn=(Le=Cn.actionTabs)==null?void 0:Le.params)==null?void 0:nn.object_type)==="videos"}].filter(On=>On.show)}))};var Re=(0,de.connect)(({userDetail:He,loading:ze,globalSetting:Cn,user:Rn})=>({userDetail:He,globalSetting:Cn,loading:ze.effects,user:Rn}))(se)},51161:function(tn,An,Kt){"use strict";Kt.d(An,{AL:function(){return Ct},Iy:function(){return Ue},Qv:function(){return Ft},ez:function(){return vt},jb:function(){return Ee}});var St=Kt(47084),de=Kt.n(St),Ie=Kt(90621),$e=Kt.n(Ie);let me=1;function re(ee,te){const Ae=ee.match(/^(\s+)(?:```)/);if(Ae===null)return te;const se=Ae[1];return te.split(`
`).map(Re=>{const He=Re.match(/^\s+/);if(He===null)return Re;const[ze]=He;return ze.length>=se.length?Re.slice(se.length):Re}).join(`
`)}let Zt=[],Oe=["<ul>"];const ue=new(de()).Renderer,Se=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ue(){Zt.length=0,Oe=["<ul>"]}const Ee={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Ze(ee,te,Ae,se){if(te>=ee.length||ee[te].level<=Ae)return te;var Re=ee[te];se.push("<li><a href='#"+me+Re.anchor+"'>"+Re.text+"</a>"),te++;var He=[];return te=Ze(ee,te,Re.level,He),He.length>0&&(se.push("<ul>"),He.forEach(function(ze){se.push(ze)}),se.push("</ul>")),se.push("</li>"),te=Ze(ee,te,Ae,se),te}function Ft(){return Ze(Zt,0,0,Oe),Oe.push("</ul>"),Oe.join("")}const et={heading(ee){const te=Se.exec(ee);if(me+=1,te)return{type:"heading",raw:te[0],depth:te[1].length,text:te[2]}},fences(ee){const te=this.rules.block.fences.exec(ee);if(te){const Ae=te[0];let se=re(Ae,te[3]||"");const Re=te[2]?te[2].trim():te[2];if(["latex","katex","math"].indexOf(Re)>=0){const He=lt(),ze=se;se=He,pt[He]={type:"block",expression:ze}}return{type:"code",raw:Ae,lang:Re,text:se}}}},nt=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let ct=0;const lt=()=>`__special_katext_id_${ct++}__`;let pt={};function vt(){return pt}function Ct(){ct=0,pt={}}function Nt(ee){return ee=ee.replace(nt,(te,Ae)=>{const se=lt();return pt[se]={type:"inline",expression:Ae},se}),ee}const zt=ue.listitem;ue.listitem=function(ee){return zt(Nt(ee))};const Ht=ue.paragraph;ue.paragraph=function(ee){return Ht(Nt(ee))};const $t=ue.tablecell;ue.tablecell=function(ee,te){return $t(Nt(ee),te)},ue.code=function(ee,te,Ae){const se=(te||"").match(/\S*/)[0];return se?["latex","katex","math"].indexOf(se)>=0?`<p class='editormd-tex'>${ee}</p>`:`<pre class="prettyprint linenums"><code class="language-${te}">${Ae?ee:(0,Ie.escape)(ee,!0)}</code></pre>
`:'<pre class="prettyprint linenums"><code>'+(Ae?ee:(0,Ie.escape)(ee,!0))+"</code></pre>"},ue.heading=function(ee,te,Ae){let se=this.options.headerPrefix+Ae.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return Zt.push({anchor:se,level:te,text:ee}),"<h"+te+' id="'+me+se+'">'+ee+"</h"+te+">"},de().setOptions({silent:!0,gfm:!0,pedantic:!1}),de().use({tokenizer:et,renderer:ue}),An.ZP=de()},88386:function(tn,An,Kt){(function(St){St(Kt(4631))})(function(St){St.defineOption("placeholder","",function(Oe,ue,Se){var Ue=Se&&Se!=St.Init;if(ue&&!Ue)Oe.on("blur",me),Oe.on("change",re),Oe.on("swapDoc",re),St.on(Oe.getInputField(),"compositionupdate",Oe.state.placeholderCompose=function(){$e(Oe)}),re(Oe);else if(!ue&&Ue){Oe.off("blur",me),Oe.off("change",re),Oe.off("swapDoc",re),St.off(Oe.getInputField(),"compositionupdate",Oe.state.placeholderCompose),de(Oe);var Ee=Oe.getWrapperElement();Ee.className=Ee.className.replace(" CodeMirror-empty","")}ue&&!Oe.hasFocus()&&me(Oe)});function de(Oe){Oe.state.placeholder&&(Oe.state.placeholder.parentNode.removeChild(Oe.state.placeholder),Oe.state.placeholder=null)}function Ie(Oe){de(Oe);var ue=Oe.state.placeholder=document.createElement("pre");ue.style.cssText="height: 0; overflow: visible",ue.style.direction=Oe.getOption("direction"),ue.className="CodeMirror-placeholder CodeMirror-line-like";var Se=Oe.getOption("placeholder");typeof Se=="string"&&(Se=document.createTextNode(Se)),ue.appendChild(Se),Oe.display.lineSpace.insertBefore(ue,Oe.display.lineSpace.firstChild)}function $e(Oe){setTimeout(function(){var ue=!1,Se=Oe.getInputField();Se.nodeName=="TEXTAREA"?ue=!Se.value:Oe.lineCount()==1&&(ue=!/[^\u200b]/.test(Se.querySelector(".CodeMirror-line").textContent)),ue?Ie(Oe):de(Oe)},20)}function me(Oe){Zt(Oe)&&Ie(Oe)}function re(Oe){var ue=Oe.getWrapperElement(),Se=Zt(Oe);ue.className=ue.className.replace(" CodeMirror-empty","")+(Se?" CodeMirror-empty":""),Se?Ie(Oe):de(Oe)}function Zt(Oe){return Oe.lineCount()===1&&Oe.getLine(0)===""}})},82801:function(tn,An,Kt){(function(St){St(Kt(4631))})(function(St){var de={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Ie=St.Pos;St.defineOption("autoCloseBrackets",!1,function(et,nt,ct){ct&&ct!=St.Init&&(et.removeKeyMap(me),et.state.closeBrackets=null),nt&&(re($e(nt,"pairs")),et.state.closeBrackets=nt,et.addKeyMap(me))});function $e(et,nt){return nt=="pairs"&&typeof et=="string"?et:typeof et=="object"&&et[nt]!=null?et[nt]:de[nt]}var me={Backspace:ue,Enter:Se};function re(et){for(var nt=0;nt<et.length;nt++){var ct=et.charAt(nt),lt="'"+ct+"'";me[lt]||(me[lt]=Zt(ct))}}re(de.pairs+"`");function Zt(et){return function(nt){return Ee(nt,et)}}function Oe(et){var nt=et.state.closeBrackets;if(!nt||nt.override)return nt;var ct=et.getModeAt(et.getCursor());return ct.closeBrackets||nt}function ue(et){var nt=Oe(et);if(!nt||et.getOption("disableInput"))return St.Pass;for(var ct=$e(nt,"pairs"),lt=et.listSelections(),pt=0;pt<lt.length;pt++){if(!lt[pt].empty())return St.Pass;var vt=Ze(et,lt[pt].head);if(!vt||ct.indexOf(vt)%2!=0)return St.Pass}for(var pt=lt.length-1;pt>=0;pt--){var Ct=lt[pt].head;et.replaceRange("",Ie(Ct.line,Ct.ch-1),Ie(Ct.line,Ct.ch+1),"+delete")}}function Se(et){var nt=Oe(et),ct=nt&&$e(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=Ze(et,lt[pt].head);if(!vt||ct.indexOf(vt)%2!=0)return St.Pass}et.operation(function(){var Ct=et.lineSeparator()||`
`;et.replaceSelection(Ct+Ct,null),et.execCommand("goCharLeft"),lt=et.listSelections();for(var Nt=0;Nt<lt.length;Nt++){var zt=lt[Nt].head.line;et.indentLine(zt,null,!0),et.indentLine(zt+1,null,!0)}})}function Ue(et){var nt=St.cmpPos(et.anchor,et.head)>0;return{anchor:new Ie(et.anchor.line,et.anchor.ch+(nt?-1:1)),head:new Ie(et.head.line,et.head.ch+(nt?1:-1))}}function Ee(et,nt){var ct=Oe(et);if(!ct||et.getOption("disableInput"))return St.Pass;var lt=$e(ct,"pairs"),pt=lt.indexOf(nt);if(pt==-1)return St.Pass;for(var vt=$e(ct,"closeBefore"),Ct=$e(ct,"triples"),Nt=lt.charAt(pt+1)==nt,zt=et.listSelections(),Ht=pt%2==0,$t,ee=0;ee<zt.length;ee++){var te=zt[ee],Ae=te.head,se,Re=et.getRange(Ae,Ie(Ae.line,Ae.ch+1));if(Ht&&!te.empty())se="surround";else if((Nt||!Ht)&&Re==nt)Nt&&Ft(et,Ae)?se="both":Ct.indexOf(nt)>=0&&et.getRange(Ae,Ie(Ae.line,Ae.ch+3))==nt+nt+nt?se="skipThree":se="skip";else if(Nt&&Ae.ch>1&&Ct.indexOf(nt)>=0&&et.getRange(Ie(Ae.line,Ae.ch-2),Ae)==nt+nt){if(Ae.ch>2&&/\bstring/.test(et.getTokenTypeAt(Ie(Ae.line,Ae.ch-2))))return St.Pass;se="addFour"}else if(Nt){var He=Ae.ch==0?" ":et.getRange(Ie(Ae.line,Ae.ch-1),Ae);if(!St.isWordChar(Re)&&He!=nt&&!St.isWordChar(He))se="both";else return St.Pass}else if(Ht&&(Re.length===0||/\s/.test(Re)||vt.indexOf(Re)>-1))se="both";else return St.Pass;if(!$t)$t=se;else if($t!=se)return St.Pass}var ze=pt%2?lt.charAt(pt-1):nt,Cn=pt%2?nt:lt.charAt(pt+1);et.operation(function(){if($t=="skip")et.execCommand("goCharRight");else if($t=="skipThree")for(var Rn=0;Rn<3;Rn++)et.execCommand("goCharRight");else if($t=="surround"){for(var Xn=et.getSelections(),Rn=0;Rn<Xn.length;Rn++)Xn[Rn]=ze+Xn[Rn]+Cn;et.replaceSelections(Xn,"around"),Xn=et.listSelections().slice();for(var Rn=0;Rn<Xn.length;Rn++)Xn[Rn]=Ue(Xn[Rn]);et.setSelections(Xn)}else $t=="both"?(et.replaceSelection(ze+Cn,null),et.triggerElectric(ze+Cn),et.execCommand("goCharLeft")):$t=="addFour"&&(et.replaceSelection(ze+ze+ze+ze,"before"),et.execCommand("goCharRight"))})}function Ze(et,nt){var ct=et.getRange(Ie(nt.line,nt.ch-1),Ie(nt.line,nt.ch+1));return ct.length==2?ct:null}function Ft(et,nt){var ct=et.getTokenAt(Ie(nt.line,nt.ch+1));return/\bstring/.test(ct.type)&&ct.start==nt.ch&&(nt.ch==0||!/\bstring/.test(et.getTokenTypeAt(nt)))}})},57341:function(tn,An,Kt){(function(St){St(Kt(4631),Kt(4786))})(function(St){St.defineOption("autoCloseTags",!1,function(ue,Se,Ue){if(Ue!=St.Init&&Ue&&ue.removeKeyMap("autoCloseTags"),!!Se){var Ee={name:"autoCloseTags"};(typeof Se!="object"||Se.whenClosing!==!1)&&(Ee["'/'"]=function(Ze){return re(Ze)}),(typeof Se!="object"||Se.whenOpening!==!1)&&(Ee["'>'"]=function(Ze){return $e(Ze)}),ue.addKeyMap(Ee)}});var de=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Ie=["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 $e(ue){if(ue.getOption("disableInput"))return St.Pass;for(var Se=ue.listSelections(),Ue=[],Ee=ue.getOption("autoCloseTags"),Ze=0;Ze<Se.length;Ze++){if(!Se[Ze].empty())return St.Pass;var Ft=Se[Ze].head,et=ue.getTokenAt(Ft),nt=St.innerMode(ue.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",Ct=typeof Ee=="object"&&Ee.dontCloseTags||vt&&de,Nt=typeof Ee=="object"&&Ee.indentTags||vt&&Ie;et.end>Ft.ch&&(pt=pt.slice(0,pt.length-et.end+Ft.ch));var zt=pt.toLowerCase();if(!pt||et.type=="string"&&(et.end!=Ft.ch||!/[\"\']/.test(et.string.charAt(et.string.length-1))||et.string.length==1)||et.type=="tag"&&lt.close||et.string.indexOf("/")==Ft.ch-et.start-1||Ct&&Zt(Ct,zt)>-1||Oe(ue,nt.mode.xmlCurrentContext&&nt.mode.xmlCurrentContext(ct)||[],pt,Ft,!0))return St.Pass;var Ht=typeof Ee=="object"&&Ee.emptyTags;if(Ht&&Zt(Ht,pt)>-1){Ue[Ze]={text:"/>",newPos:St.Pos(Ft.line,Ft.ch+2)};continue}var $t=Nt&&Zt(Nt,zt)>-1;Ue[Ze]={indent:$t,text:">"+($t?`
`:"")+"</"+pt+">",newPos:$t?St.Pos(Ft.line+1,0):St.Pos(Ft.line,Ft.ch+1)}}for(var ee=typeof Ee=="object"&&Ee.dontIndentOnAutoClose,Ze=Se.length-1;Ze>=0;Ze--){var te=Ue[Ze];ue.replaceRange(te.text,Se[Ze].head,Se[Ze].anchor,"+insert");var Ae=ue.listSelections().slice(0);Ae[Ze]={head:te.newPos,anchor:te.newPos},ue.setSelections(Ae),!ee&&te.indent&&(ue.indentLine(te.newPos.line,null,!0),ue.indentLine(te.newPos.line+1,null,!0))}}function me(ue,Se){for(var Ue=ue.listSelections(),Ee=[],Ze=Se?"/":"</",Ft=ue.getOption("autoCloseTags"),et=typeof Ft=="object"&&Ft.dontIndentOnSlash,nt=0;nt<Ue.length;nt++){if(!Ue[nt].empty())return St.Pass;var ct=Ue[nt].head,lt=ue.getTokenAt(ct),pt=St.innerMode(ue.getMode(),lt.state),vt=pt.state;if(Se&&(lt.type=="string"||lt.string.charAt(0)!="<"||lt.start!=ct.ch-1))return St.Pass;var Ct,Nt=pt.mode.name!="xml"&&ue.getMode().name=="htmlmixed";if(Nt&&pt.mode.name=="javascript")Ct=Ze+"script";else if(Nt&&pt.mode.name=="css")Ct=Ze+"style";else{var zt=pt.mode.xmlCurrentContext&&pt.mode.xmlCurrentContext(vt);if(!zt||zt.length&&Oe(ue,zt,zt[zt.length-1],ct))return St.Pass;Ct=Ze+zt[zt.length-1]}ue.getLine(ct.line).charAt(lt.end)!=">"&&(Ct+=">"),Ee[nt]=Ct}if(ue.replaceSelections(Ee),Ue=ue.listSelections(),!et)for(var nt=0;nt<Ue.length;nt++)(nt==Ue.length-1||Ue[nt].head.line<Ue[nt+1].head.line)&&ue.indentLine(Ue[nt].head.line)}function re(ue){return ue.getOption("disableInput")?St.Pass:me(ue,!0)}St.commands.closeTag=function(ue){return me(ue)};function Zt(ue,Se){if(ue.indexOf)return ue.indexOf(Se);for(var Ue=0,Ee=ue.length;Ue<Ee;++Ue)if(ue[Ue]==Se)return Ue;return-1}function Oe(ue,Se,Ue,Ee,Ze){if(!St.scanForClosingTag)return!1;var Ft=Math.min(ue.lastLine()+1,Ee.line+500),et=St.scanForClosingTag(ue,Ee,null,Ft);if(!et||et.tag!=Ue)return!1;for(var nt=Ze?1:0,ct=Se.length-1;ct>=0&&Se[ct]==Ue;ct--)++nt;Ee=et.to;for(var ct=1;ct<nt;ct++){var lt=St.scanForClosingTag(ue,Ee,null,Ft);if(!lt||lt.tag!=Ue)return!1;Ee=lt.to}return!0}})},4786:function(tn,An,Kt){(function(St){St(Kt(4631))})(function(St){"use strict";var de=St.Pos;function Ie(ct,lt){return ct.line-lt.line||ct.ch-lt.ch}var $e="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",me=$e+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",re=new RegExp("<(/?)(["+$e+"]["+me+"]*)","g");function Zt(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 Oe(ct,lt){var pt=ct.cm.getTokenTypeAt(de(ct.line,lt));return pt&&/\btag\b/.test(pt)}function ue(ct){if(!(ct.line>=ct.max))return ct.ch=0,ct.text=ct.cm.getLine(++ct.line),!0}function Se(ct){if(!(ct.line<=ct.min))return ct.text=ct.cm.getLine(--ct.line),ct.ch=ct.text.length,!0}function Ue(ct){for(;;){var lt=ct.text.indexOf(">",ct.ch);if(lt==-1){if(ue(ct))continue;return}if(!Oe(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 Ee(ct){for(;;){var lt=ct.ch?ct.text.lastIndexOf("<",ct.ch-1):-1;if(lt==-1){if(Se(ct))continue;return}if(!Oe(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 Ze(ct){for(;;){re.lastIndex=ct.ch;var lt=re.exec(ct.text);if(!lt){if(ue(ct))continue;return}if(!Oe(ct,lt.index+1)){ct.ch=lt.index+1;continue}return ct.ch=lt.index+lt[0].length,lt}}function Ft(ct){for(;;){var lt=ct.ch?ct.text.lastIndexOf(">",ct.ch-1):-1;if(lt==-1){if(Se(ct))continue;return}if(!Oe(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=Ze(ct),Ct,Nt=ct.line,zt=ct.ch-(vt?vt[0].length:0);if(!vt||!(Ct=Ue(ct)))return;if(Ct!="selfClose")if(vt[1]){for(var Ht=pt.length-1;Ht>=0;--Ht)if(pt[Ht]==vt[2]){pt.length=Ht;break}if(Ht<0&&(!lt||lt==vt[2]))return{tag:vt[2],from:de(Nt,zt),to:de(ct.line,ct.ch)}}else pt.push(vt[2])}}function nt(ct,lt){for(var pt=[];;){var vt=Ft(ct);if(!vt)return;if(vt=="selfClose"){Ee(ct);continue}var Ct=ct.line,Nt=ct.ch,zt=Ee(ct);if(!zt)return;if(zt[1])pt.push(zt[2]);else{for(var Ht=pt.length-1;Ht>=0;--Ht)if(pt[Ht]==zt[2]){pt.length=Ht;break}if(Ht<0&&(!lt||lt==zt[2]))return{tag:zt[2],from:de(ct.line,ct.ch),to:de(Ct,Nt)}}}}St.registerHelper("fold","xml",function(ct,lt){for(var pt=new Zt(ct,lt.line,0);;){var vt=Ze(pt);if(!vt||pt.line!=lt.line)return;var Ct=Ue(pt);if(!Ct)return;if(!vt[1]&&Ct!="selfClose"){var Nt=de(pt.line,pt.ch),zt=et(pt,vt[2]);return zt&&Ie(zt.from,Nt)>0?{from:Nt,to:zt.from}:null}}}),St.findMatchingTag=function(ct,lt,pt){var vt=new Zt(ct,lt.line,lt.ch,pt);if(!(vt.text.indexOf(">")==-1&&vt.text.indexOf("<")==-1)){var Ct=Ue(vt),Nt=Ct&&de(vt.line,vt.ch),zt=Ct&&Ee(vt);if(!(!Ct||!zt||Ie(vt,lt)>0)){var Ht={from:de(vt.line,vt.ch),to:Nt,tag:zt[2]};return Ct=="selfClose"?{open:Ht,close:null,at:"open"}:zt[1]?{open:nt(vt,zt[2]),close:Ht,at:"close"}:(vt=new Zt(ct,Nt.line,Nt.ch,pt),{open:Ht,close:et(vt,zt[2]),at:"open"})}}},St.findEnclosingTag=function(ct,lt,pt,vt){for(var Ct=new Zt(ct,lt.line,lt.ch,pt);;){var Nt=nt(Ct,vt);if(!Nt)break;var zt=new Zt(ct,lt.line,lt.ch,pt),Ht=et(zt,Nt.tag);if(Ht)return{open:Nt,close:Ht}}},St.scanForClosingTag=function(ct,lt,pt,vt){var Ct=new Zt(ct,lt.line,lt.ch,vt?{from:0,to:vt}:null);return et(Ct,pt)}})},4631:function(tn){(function(An,Kt){tn.exports=Kt()})(this,function(){"use strict";var An=navigator.userAgent,Kt=navigator.platform,St=/gecko\/\d/i.test(An),de=/MSIE \d/.test(An),Ie=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(An),$e=/Edge\/(\d+)/.exec(An),me=de||Ie||$e,re=me&&(de?document.documentMode||6:+($e||Ie)[1]),Zt=!$e&&/WebKit\//.test(An),Oe=Zt&&/Qt\/\d+\.\d+/.test(An),ue=!$e&&/Chrome\//.test(An),Se=/Opera\//.test(An),Ue=/Apple Computer/.test(navigator.vendor),Ee=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(An),Ze=/PhantomJS/.test(An),Ft=!$e&&/AppleWebKit/.test(An)&&/Mobile\/\w+/.test(An),et=/Android/.test(An),nt=Ft||et||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(An),ct=Ft||/Mac/.test(Kt),lt=/\bCrOS\b/.test(An),pt=/win/i.test(Kt),vt=Se&&An.match(/Version\/(\d*\.\d*)/);vt&&(vt=Number(vt[1])),vt&&vt>=15&&(Se=!1,Zt=!0);var Ct=ct&&(Oe||Se&&(vt==null||vt<12.11)),Nt=St||me&&re>=9;function zt(it){return new RegExp("(^|\\s)"+it+"(?:$|\\s)\\s*")}var Ht=function(it,st){var dt=it.className,ht=zt(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 $t(it){for(var st=it.childNodes.length;st>0;--st)it.removeChild(it.firstChild);return it}function ee(it,st){return $t(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 wt=0;wt<st.length;++wt)gt.appendChild(st[wt]);return gt}function Ae(it,st,dt,ht){var gt=te(it,st,dt,ht);return gt.setAttribute("role","presentation"),gt}var se;document.createRange?se=function(it,st,dt,ht){var gt=document.createRange();return gt.setEnd(ht||it,dt),gt.setStart(it,st),gt}:se=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 Re(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 He(){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 ze(it,st){var dt=it.className;zt(st).test(dt)||(it.className+=(dt?" ":"")+st)}function Cn(it,st){for(var dt=it.split(" "),ht=0;ht<dt.length;ht++)dt[ht]&&!zt(dt[ht]).test(st)&&(st+=" "+dt[ht]);return st}var Rn=function(it){it.select()};Ft?Rn=function(it){it.selectionStart=0,it.selectionEnd=it.value.length}:me&&(Rn=function(it){try{it.select()}catch(st){}});function Xn(it){var st=Array.prototype.slice.call(arguments,1);return function(){return it.apply(null,st)}}function Ni(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 Yt(it,st,dt,ht,gt){st==null&&(st=it.search(/[^\s\u00a0]/),st==-1&&(st=it.length));for(var wt=ht||0,bt=gt||0;;){var Ot=it.indexOf(" ",wt);if(Ot<0||Ot>=st)return bt+(st-wt);bt+=Ot-wt,bt+=dt-bt%dt,wt=Ot+1}}var jt=function(){this.id=null,this.f=null,this.time=0,this.handler=Xn(this.onTimeout,this)};jt.prototype.onTimeout=function(it){it.id=0,it.time<=+new Date?it.f():setTimeout(it.handler,it.time-+new Date)},jt.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 Ce(it,st){for(var dt=0;dt<it.length;++dt)if(it[dt]==st)return dt;return-1}var un=50,Ln={toString:function(){return"CodeMirror.Pass"}},Le={scroll:!1},nn={origin:"*mouse"},hn={origin:"+move"};function _n(it,st,dt){for(var ht=0,gt=0;;){var wt=it.indexOf(" ",ht);wt==-1&&(wt=it.length);var bt=wt-ht;if(wt==it.length||gt+bt>=st)return ht+Math.min(bt,st-gt);if(gt+=wt-ht,gt+=dt-gt%dt,ht=wt+1,gt>=st)return ht}}var fn=[""];function le(it){for(;fn.length<=it;)fn.push(we(fn)+" ");return fn[it]}function we(it){return it[it.length-1]}function Pn(it,st){for(var dt=[],ht=0;ht<it.length;ht++)dt[ht]=st(it[ht],ht);return dt}function vn(it,st,dt){for(var ht=0,gt=dt(st);ht<it.length&&dt(it[ht])<=gt;)ht++;it.splice(ht,0,st)}function _t(){}function Mt(it,st){var dt;return Object.create?dt=Object.create(it):(_t.prototype=it,dt=new _t),st&&Ni(st,dt),dt}var Lt=/[\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()||Lt.test(it))}function Wt(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 be=/[\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 Nn(it){return it.charCodeAt(0)>=768&&be.test(it)}function mi(it,st,dt){for(;(dt<0?st>0:st<it.length)&&Nn(it.charAt(st));)st+=dt;return st}function On(it,st,dt){for(var ht=st>dt?-1:1;;){if(st==dt)return st;var gt=(st+dt)/2,wt=ht<0?Math.ceil(gt):Math.floor(gt);if(wt==st)return it(wt)?st:dt;it(wt)?dt=wt:st=wt+ht}}function Gn(it,st,dt,ht){if(!it)return ht(st,dt,"ltr",0);for(var gt=!1,wt=0;wt<it.length;++wt){var bt=it[wt];(bt.from<dt&&bt.to>st||st==dt&&bt.to==st)&&(ht(Math.max(bt.from,st),Math.min(bt.to,dt),bt.level==1?"rtl":"ltr",wt),gt=!0)}gt||ht(st,dt,"ltr")}var Fi=null;function yn(it,st,dt){var ht;Fi=null;for(var gt=0;gt<it.length;++gt){var wt=it[gt];if(wt.from<st&&wt.to>st)return gt;wt.to==st&&(wt.from!=wt.to&&dt=="before"?ht=gt:Fi=gt),wt.from==st&&(wt.from!=wt.to&&dt!="before"?ht=gt:Fi=gt)}return ht!=null?ht:Fi}var Li=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]/,wt=/[LRr]/,bt=/[Lb1n]/,Ot=/[1n]/;function Bt(Ut,fe,Jt){this.level=Ut,this.from=fe,this.to=Jt}return function(Ut,fe){var Jt=fe=="ltr"?"L":"R";if(Ut.length==0||fe=="ltr"&&!ht.test(Ut))return!1;for(var Te=Ut.length,Ne=[],dn=0;dn<Te;++dn)Ne.push(dt(Ut.charCodeAt(dn)));for(var pn=0,bn=Jt;pn<Te;++pn){var Un=Ne[pn];Un=="m"?Ne[pn]=bn:bn=Un}for(var li=0,ni=Jt;li<Te;++li){var vi=Ne[li];vi=="1"&&ni=="r"?Ne[li]="n":wt.test(vi)&&(ni=vi,vi=="r"&&(Ne[li]="R"))}for(var _i=1,$n=Ne[0];_i<Te-1;++_i){var no=Ne[_i];no=="+"&&$n=="1"&&Ne[_i+1]=="1"?Ne[_i]="1":no==","&&$n==Ne[_i+1]&&($n=="1"||$n=="n")&&(Ne[_i]=$n),$n=no}for(var $o=0;$o<Te;++$o){var Wr=Ne[$o];if(Wr==",")Ne[$o]="N";else if(Wr=="%"){var dr=void 0;for(dr=$o+1;dr<Te&&Ne[dr]=="%";++dr);for(var Xs=$o&&Ne[$o-1]=="!"||dr<Te&&Ne[dr]=="1"?"1":"N",Cs=$o;Cs<dr;++Cs)Ne[Cs]=Xs;$o=dr-1}}for(var Br=0,la=Jt;Br<Te;++Br){var gs=Ne[Br];la=="L"&&gs=="1"?Ne[Br]="L":wt.test(gs)&&(la=gs)}for(var Dr=0;Dr<Te;++Dr)if(gt.test(Ne[Dr])){var Co=void 0;for(Co=Dr+1;Co<Te&&gt.test(Ne[Co]);++Co);for(var vr=(Dr?Ne[Dr-1]:Jt)=="L",$r=(Co<Te?Ne[Co]:Jt)=="L",ps=vr==$r?vr?"L":"R":Jt,Qa=Dr;Qa<Co;++Qa)Ne[Qa]=ps;Dr=Co-1}for(var cr=[],Oa,wr=0;wr<Te;)if(bt.test(Ne[wr])){var nc=wr;for(++wr;wr<Te&&bt.test(Ne[wr]);++wr);cr.push(new Bt(0,nc,wr))}else{var Pa=wr,ua=cr.length,Zs=fe=="rtl"?1:0;for(++wr;wr<Te&&Ne[wr]!="L";++wr);for(var Go=Pa;Go<wr;)if(Ot.test(Ne[Go])){Pa<Go&&(cr.splice(ua,0,new Bt(1,Pa,Go)),ua+=Zs);var ts=Go;for(++Go;Go<wr&&Ot.test(Ne[Go]);++Go);cr.splice(ua,0,new Bt(2,ts,Go)),ua+=Zs,Pa=Go}else++Go;Pa<wr&&cr.splice(ua,0,new Bt(1,Pa,wr))}return fe=="ltr"&&(cr[0].level==1&&(Oa=Ut.match(/^\s+/))&&(cr[0].from=Oa[0].length,cr.unshift(new Bt(0,0,Oa[0].length))),we(cr).level==1&&(Oa=Ut.match(/\s+$/))&&(we(cr).to-=Oa[0].length,cr.push(new Bt(0,Te-Oa[0].length,Te)))),fe=="rtl"?cr.reverse():cr}}();function yi(it,st){var dt=it.order;return dt==null&&(dt=it.order=Li(it.text,st)),dt}var Ui=[],Jn=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]||Ui).concat(dt)}};function xr(it,st){return it._handlers&&it._handlers[st]||Ui}function Mo(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 wt=Ce(gt,dt);wt>-1&&(ht[st]=gt.slice(0,wt).concat(gt.slice(wt+1)))}}}function ao(it,st){var dt=xr(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 $i(it,st,dt){return typeof st=="string"&&(st={type:st,preventDefault:function(){this.defaultPrevented=!0}}),ao(it,dt||st.type,it,st),Vi(st)||st.codemirrorIgnore}function Kr(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)Ce(dt,st[ht])==-1&&dt.push(st[ht])}function No(it,st){return xr(it,st).length>0}function fr(it){it.prototype.on=function(st,dt){Jn(this,st,dt)},it.prototype.off=function(st,dt){Mo(this,st,dt)}}function sr(it){it.preventDefault?it.preventDefault():it.returnValue=!1}function Pr(it){it.stopPropagation?it.stopPropagation():it.cancelBubble=!0}function Vi(it){return it.defaultPrevented!=null?it.defaultPrevented:it.returnValue==!1}function Ir(it){sr(it),Pr(it)}function Ns(it){return it.target||it.srcElement}function jr(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 Va=function(){if(me&&re<9)return!1;var it=te("div");return"draggable"in it||"dragDrop"in it}(),Hs;function Ws(it){if(Hs==null){var st=te("span","\u200B");ee(it,te("span",[st,document.createTextNode("x")])),it.firstChild.offsetHeight!=0&&(Hs=st.offsetWidth<=1&&st.offsetHeight>2&&!(me&&re<8))}var dt=Hs?te("span","\u200B"):te("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return dt.setAttribute("cm-text",""),dt}var gr;function Ti(it){if(gr!=null)return gr;var st=ee(it,document.createTextNode("A\u062EA")),dt=se(st,0,1).getBoundingClientRect(),ht=se(st,1,2).getBoundingClientRect();return $t(it),!dt||dt.left==dt.right?!1:gr=ht.right-dt.right<3}var We=`
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 wt=it.slice(st,it.charAt(gt-1)=="\r"?gt-1:gt),bt=wt.indexOf("\r");bt!=-1?(dt.push(wt.slice(0,bt)),st+=bt+1):(dt.push(wt),st=gt+1)}return dt}:function(it){return it.split(/\r\n?|\n/)},xt=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},Sn=function(){var it=te("div");return"oncopy"in it?!0:(it.setAttribute("oncopy","return;"),typeof it.oncopy=="function")}(),mn=null;function rn(it){if(mn!=null)return mn;var st=ee(it,te("span","x")),dt=st.getBoundingClientRect(),ht=se(st,0,1).getBoundingClientRect();return mn=Math.abs(dt.left-ht.left)>1}var en={},sn={};function wn(it,st){arguments.length>2&&(st.dependencies=Array.prototype.slice.call(arguments,2)),en[it]=st}function Qn(it,st){sn[it]=st}function ye(it){if(typeof it=="string"&&sn.hasOwnProperty(it))it=sn[it];else if(it&&typeof it.name=="string"&&sn.hasOwnProperty(it.name)){var st=sn[it.name];typeof st=="string"&&(st={name:st}),it=Mt(st,it),it.name=st.name}else{if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(it))return ye("application/xml");if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(it))return ye("application/json")}return typeof it=="string"?{name:it}:it||{name:"null"}}function ve(it,st){st=ye(st);var dt=en[st.name];if(!dt)return ve(it,"text/plain");var ht=dt(it,st);if(ne.hasOwnProperty(st.name)){var gt=ne[st.name];for(var wt in gt)gt.hasOwnProperty(wt)&&(ht.hasOwnProperty(wt)&&(ht["_"+wt]=ht[wt]),ht[wt]=gt[wt])}if(ht.name=st.name,st.helperType&&(ht.helperType=st.helperType),st.modeProps)for(var bt in st.modeProps)ht[bt]=st.modeProps[bt];return ht}var ne={};function ke(it,st){var dt=ne.hasOwnProperty(it)?ne[it]:ne[it]={};Ni(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 Fn(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 In(it,st,dt){return it.startState?it.startState(st,dt):!0}var ge=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};ge.prototype.eol=function(){return this.pos>=this.string.length},ge.prototype.sol=function(){return this.pos==this.lineStart},ge.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ge.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ge.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},ge.prototype.eatWhile=function(it){for(var st=this.pos;this.eat(it););return this.pos>st},ge.prototype.eatSpace=function(){for(var it=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>it},ge.prototype.skipToEnd=function(){this.pos=this.string.length},ge.prototype.skipTo=function(it){var st=this.string.indexOf(it,this.pos);if(st>-1)return this.pos=st,!0},ge.prototype.backUp=function(it){this.pos-=it},ge.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Yt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Yt(this.string,this.lineStart,this.tabSize):0)},ge.prototype.indentation=function(){return Yt(this.string,null,this.tabSize)-(this.lineStart?Yt(this.string,this.lineStart,this.tabSize):0)},ge.prototype.match=function(it,st,dt){if(typeof it=="string"){var ht=function(bt){return dt?bt.toLowerCase():bt},gt=this.string.substr(this.pos,it.length);if(ht(gt)==ht(it))return st!==!1&&(this.pos+=it.length),!0}else{var wt=this.string.slice(this.pos).match(it);return wt&&wt.index>0?null:(wt&&st!==!1&&(this.pos+=wt[0].length),wt)}},ge.prototype.current=function(){return this.string.slice(this.start,this.pos)},ge.prototype.hideFirstChars=function(it,st){this.lineStart+=it;try{return st()}finally{this.lineStart-=it}},ge.prototype.lookAhead=function(it){var st=this.lineOracle;return st&&st.lookAhead(it)},ge.prototype.baseToken=function(){var it=this.lineOracle;return it&&it.baseToken(this.pos)};function Ge(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],wt=gt.chunkSize();if(st<wt){dt=gt;break}st-=wt}return dt.lines[st]}function Bn(it,st,dt){var ht=[],gt=st.line;return it.iter(st.line,dt.line+1,function(wt){var bt=wt.text;gt==dt.line&&(bt=bt.slice(0,dt.ch)),gt==st.line&&(bt=bt.slice(st.ch)),ht.push(bt),++gt}),ht}function ri(it,st,dt){var ht=[];return it.iter(st,dt,function(gt){ht.push(gt.text)}),ht}function Qe(it,st){var dt=st-it.height;if(dt)for(var ht=it;ht;ht=ht.parent)ht.height+=dt}function ce(it){if(it.parent==null)return null;for(var st=it.parent,dt=Ce(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 Tn(it,st){var dt=it.first;t:do{for(var ht=0;ht<it.children.length;++ht){var gt=it.children[ht],wt=gt.height;if(st<wt){it=gt;continue t}st-=wt,dt+=gt.chunkSize()}return dt}while(!it.lines);for(var bt=0;bt<it.lines.length;++bt){var Ot=it.lines[bt],Bt=Ot.height;if(st<Bt)break;st-=Bt}return dt+bt}function ti(it,st){return st>=it.first&&st<it.first+it.size}function Be(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 ae(it,st){return it.line-st.line||it.ch-st.ch}function Mn(it,st){return it.sticky==st.sticky&&ae(it,st)==0}function Gi(it){return qt(it.line,it.ch)}function Ai(it,st){return ae(it,st)<0?st:it}function gn(it,st){return ae(it,st)<0?it:st}function Ye(it,st){return Math.max(it.first,Math.min(st,it.first+it.size-1))}function xe(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,Ge(it,dt).text.length):ei(st,Ge(it,st.line).text.length)}function ei(it,st){var dt=it.ch;return dt==null||dt>st?qt(it.line,st):dt<0?qt(it.line,0):it}function Si(it,st){for(var dt=[],ht=0;ht<st.length;ht++)dt[ht]=xe(it,st[ht]);return dt}var qe=function(it,st){this.state=it,this.lookAhead=st},Hn=function(it,st,dt,ht){this.state=st,this.doc=it,this.line=dt,this.maxLookAhead=ht||0,this.baseTokens=null,this.baseTokenPos=1};Hn.prototype.lookAhead=function(it){var st=this.doc.getLine(this.line+it);return st!=null&&it>this.maxLookAhead&&(this.maxLookAhead=it),st},Hn.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}},Hn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Hn.fromSaved=function(it,st,dt){return st instanceof qe?new Hn(it,xn(it.mode,st.state),dt,st.lookAhead):new Hn(it,xn(it.mode,st),dt)},Hn.prototype.save=function(it){var st=it!==!1?xn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new qe(st,this.maxLookAhead):st};function So(it,st,dt,ht){var gt=[it.state.modeGen],wt={};xi(it,st.text,it.doc.mode,dt,function(Ut,fe){return gt.push(Ut,fe)},wt,ht);for(var bt=dt.state,Ot=function(Ut){dt.baseTokens=gt;var fe=it.state.overlays[Ut],Jt=1,Te=0;dt.state=!0,xi(it,st.text,fe.mode,dt,function(Ne,dn){for(var pn=Jt;Te<Ne;){var bn=gt[Jt];bn>Ne&&gt.splice(Jt,1,Ne,gt[Jt+1],bn),Jt+=2,Te=Math.min(Ne,bn)}if(dn)if(fe.opaque)gt.splice(pn,Jt-pn,Ne,"overlay "+dn),Jt=pn+2;else for(;pn<Jt;pn+=2){var Un=gt[pn+1];gt[pn+1]=(Un?Un+" ":"")+"overlay "+dn}},wt),dt.state=bt,dt.baseTokens=null,dt.baseTokenPos=1},Bt=0;Bt<it.state.overlays.length;++Bt)Ot(Bt);return{styles:gt,classes:wt.bgClass||wt.textClass?wt:null}}function Bi(it,st,dt){if(!st.styles||st.styles[0]!=it.state.modeGen){var ht=Qi(it,ce(st)),gt=st.text.length>it.options.maxHighlightLength&&xn(it.doc.mode,ht.state),wt=So(it,st,ht);gt&&(ht.state=gt),st.stateAfter=ht.save(!gt),st.styles=wt.styles,wt.classes?st.styleClasses=wt.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 Qi(it,st,dt){var ht=it.doc,gt=it.display;if(!ht.mode.startState)return new Hn(ht,!0,st);var wt=di(it,st,dt),bt=wt>ht.first&&Ge(ht,wt-1).stateAfter,Ot=bt?Hn.fromSaved(ht,bt,wt):new Hn(ht,In(ht.mode),wt);return ht.iter(wt,st,function(Bt){he(it,Bt.text,Ot);var Ut=Ot.line;Bt.stateAfter=Ut==st-1||Ut%5==0||Ut>=gt.viewFrom&&Ut<gt.viewTo?Ot.save():null,Ot.nextLine()}),dt&&(ht.modeFrontier=Ot.line),Ot}function he(it,st,dt,ht){var gt=it.doc.mode,wt=new ge(st,it.options.tabSize,dt);for(wt.start=wt.pos=ht||0,st==""&&Yn(gt,dt.state);!wt.eol();)gi(gt,wt,dt.state),wt.start=wt.pos}function Yn(it,st){if(it.blankLine)return it.blankLine(st);if(it.innerMode){var dt=Fn(it,st);if(dt.mode.blankLine)return dt.mode.blankLine(dt.state)}}function gi(it,st,dt,ht){for(var gt=0;gt<10;gt++){ht&&(ht[0]=Fn(it,dt).mode);var wt=it.token(st,dt);if(st.pos>st.start)return wt}throw new Error("Mode "+it.name+" failed to advance stream.")}var zn=function(it,st,dt){this.start=it.start,this.end=it.pos,this.string=it.current(),this.type=st||null,this.state=dt};function Ri(it,st,dt,ht){var gt=it.doc,wt=gt.mode,bt;st=xe(gt,st);var Ot=Ge(gt,st.line),Bt=Qi(it,st.line,dt),Ut=new ge(Ot.text,it.options.tabSize,Bt),fe;for(ht&&(fe=[]);(ht||Ut.pos<st.ch)&&!Ut.eol();)Ut.start=Ut.pos,bt=gi(wt,Ut,Bt.state),ht&&fe.push(new zn(Ut,bt,xn(gt.mode,Bt.state)));return ht?fe:new zn(Ut,bt,Bt.state)}function hi(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 xi(it,st,dt,ht,gt,wt,bt){var Ot=dt.flattenSpans;Ot==null&&(Ot=it.options.flattenSpans);var Bt=0,Ut=null,fe=new ge(st,it.options.tabSize,ht),Jt,Te=it.options.addModeClass&&[null];for(st==""&&hi(Yn(dt,ht.state),wt);!fe.eol();){if(fe.pos>it.options.maxHighlightLength?(Ot=!1,bt&&he(it,st,ht,fe.pos),fe.pos=st.length,Jt=null):Jt=hi(gi(dt,fe,ht.state,Te),wt),Te){var Ne=Te[0].name;Ne&&(Jt="m-"+(Jt?Ne+" "+Jt:Ne))}if(!Ot||Ut!=Jt){for(;Bt<fe.start;)Bt=Math.min(fe.start,Bt+5e3),gt(Bt,Ut);Ut=Jt}fe.start=fe.pos}for(;Bt<fe.pos;){var dn=Math.min(fe.pos,Bt+5e3);gt(dn,Ut),Bt=dn}}function di(it,st,dt){for(var ht,gt,wt=it.doc,bt=dt?-1:st-(it.doc.mode.innerMode?1e3:100),Ot=st;Ot>bt;--Ot){if(Ot<=wt.first)return wt.first;var Bt=Ge(wt,Ot-1),Ut=Bt.stateAfter;if(Ut&&(!dt||Ot+(Ut instanceof qe?Ut.lookAhead:0)<=wt.modeFrontier))return Ot;var fe=Yt(Bt.text,null,it.options.tabSize);(gt==null||ht>fe)&&(gt=Ot-1,ht=fe)}return gt}function Zn(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=Ge(it,ht).stateAfter;if(gt&&(!(gt instanceof qe)||ht+gt.lookAhead<st)){dt=ht+1;break}}it.highlightFrontier=Math.min(it.highlightFrontier,dt)}}var pi=!1,Pe=!1;function io(){pi=!0}function Fe(){Pe=!0}function Dn(it,st,dt){this.marker=it,this.from=st,this.to=dt}function Hi(it,st){if(it)for(var dt=0;dt<it.length;++dt){var ht=it[dt];if(ht.marker==st)return ht}}function ci(it,st){for(var dt,ht=0;ht<it.length;++ht)it[ht]!=st&&(dt||(dt=[])).push(it[ht]);return dt}function nr(it,st){it.markedSpans=it.markedSpans?it.markedSpans.concat([st]):[st],st.marker.attachLine(it)}function Yi(it,st,dt){var ht;if(it)for(var gt=0;gt<it.length;++gt){var wt=it[gt],bt=wt.marker,Ot=wt.from==null||(bt.inclusiveLeft?wt.from<=st:wt.from<st);if(Ot||wt.from==st&&bt.type=="bookmark"&&(!dt||!wt.marker.insertLeft)){var Bt=wt.to==null||(bt.inclusiveRight?wt.to>=st:wt.to>st);(ht||(ht=[])).push(new Dn(bt,wt.from,Bt?null:wt.to))}}return ht}function ui(it,st,dt){var ht;if(it)for(var gt=0;gt<it.length;++gt){var wt=it[gt],bt=wt.marker,Ot=wt.to==null||(bt.inclusiveRight?wt.to>=st:wt.to>st);if(Ot||wt.from==st&&bt.type=="bookmark"&&(!dt||wt.marker.insertLeft)){var Bt=wt.from==null||(bt.inclusiveLeft?wt.from<=st:wt.from<st);(ht||(ht=[])).push(new Dn(bt,Bt?null:wt.from-st,wt.to==null?null:wt.to-st))}}return ht}function Ki(it,st){if(st.full)return null;var dt=ti(it,st.from.line)&&Ge(it,st.from.line).markedSpans,ht=ti(it,st.to.line)&&Ge(it,st.to.line).markedSpans;if(!dt&&!ht)return null;var gt=st.from.ch,wt=st.to.ch,bt=ae(st.from,st.to)==0,Ot=Yi(dt,gt,bt),Bt=ui(ht,wt,bt),Ut=st.text.length==1,fe=we(st.text).length+(Ut?gt:0);if(Ot)for(var Jt=0;Jt<Ot.length;++Jt){var Te=Ot[Jt];if(Te.to==null){var Ne=Hi(Bt,Te.marker);Ne?Ut&&(Te.to=Ne.to==null?null:Ne.to+fe):Te.to=gt}}if(Bt)for(var dn=0;dn<Bt.length;++dn){var pn=Bt[dn];if(pn.to!=null&&(pn.to+=fe),pn.from==null){var bn=Hi(Ot,pn.marker);bn||(pn.from=fe,Ut&&(Ot||(Ot=[])).push(pn))}else pn.from+=fe,Ut&&(Ot||(Ot=[])).push(pn)}Ot&&(Ot=zi(Ot)),Bt&&Bt!=Ot&&(Bt=zi(Bt));var Un=[Ot];if(!Ut){var li=st.text.length-2,ni;if(li>0&&Ot)for(var vi=0;vi<Ot.length;++vi)Ot[vi].to==null&&(ni||(ni=[])).push(new Dn(Ot[vi].marker,null,null));for(var _i=0;_i<li;++_i)Un.push(ni);Un.push(Bt)}return Un}function zi(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(Ne){if(Ne.markedSpans)for(var dn=0;dn<Ne.markedSpans.length;++dn){var pn=Ne.markedSpans[dn].marker;pn.readOnly&&(!ht||Ce(ht,pn)==-1)&&(ht||(ht=[])).push(pn)}}),!ht)return null;for(var gt=[{from:st,to:dt}],wt=0;wt<ht.length;++wt)for(var bt=ht[wt],Ot=bt.find(0),Bt=0;Bt<gt.length;++Bt){var Ut=gt[Bt];if(!(ae(Ut.to,Ot.from)<0||ae(Ut.from,Ot.to)>0)){var fe=[Bt,1],Jt=ae(Ut.from,Ot.from),Te=ae(Ut.to,Ot.to);(Jt<0||!bt.inclusiveLeft&&!Jt)&&fe.push({from:Ut.from,to:Ot.from}),(Te>0||!bt.inclusiveRight&&!Te)&&fe.push({from:Ot.to,to:Ut.to}),gt.splice.apply(gt,fe),Bt+=fe.length-3}}return gt}function ln(it){var st=it.markedSpans;if(st){for(var dt=0;dt<st.length;++dt)st[dt].marker.detachLine(it);it.markedSpans=null}}function It(it,st){if(st){for(var dt=0;dt<st.length;++dt)st[dt].marker.attachLine(it);it.markedSpans=st}}function mo(it){return it.inclusiveLeft?-1:0}function xs(it){return it.inclusiveRight?1:0}function ta(it,st){var dt=it.lines.length-st.lines.length;if(dt!=0)return dt;var ht=it.find(),gt=st.find(),wt=ae(ht.from,gt.from)||mo(it)-mo(st);if(wt)return-wt;var bt=ae(ht.to,gt.to)||xs(it)-xs(st);return bt||st.id-it.id}function Ps(it,st){var dt=Pe&&it.markedSpans,ht;if(dt)for(var gt=void 0,wt=0;wt<dt.length;++wt)gt=dt[wt],gt.marker.collapsed&&(st?gt.from:gt.to)==null&&(!ht||ta(ht,gt.marker)<0)&&(ht=gt.marker);return ht}function al(it){return Ps(it,!0)}function Ua(it){return Ps(it,!1)}function Wl(it,st){var dt=Pe&&it.markedSpans,ht;if(dt)for(var gt=0;gt<dt.length;++gt){var wt=dt[gt];wt.marker.collapsed&&(wt.from==null||wt.from<st)&&(wt.to==null||wt.to>st)&&(!ht||ta(ht,wt.marker)<0)&&(ht=wt.marker)}return ht}function Pl(it,st,dt,ht,gt){var wt=Ge(it,st),bt=Pe&&wt.markedSpans;if(bt)for(var Ot=0;Ot<bt.length;++Ot){var Bt=bt[Ot];if(Bt.marker.collapsed){var Ut=Bt.marker.find(0),fe=ae(Ut.from,dt)||mo(Bt.marker)-mo(gt),Jt=ae(Ut.to,ht)||xs(Bt.marker)-xs(gt);if(!(fe>=0&&Jt<=0||fe<=0&&Jt>=0)&&(fe<=0&&(Bt.marker.inclusiveRight&&gt.inclusiveLeft?ae(Ut.to,dt)>=0:ae(Ut.to,dt)>0)||fe>=0&&(Bt.marker.inclusiveRight&&gt.inclusiveLeft?ae(Ut.from,ht)<=0:ae(Ut.from,ht)<0)))return!0}}}function Po(it){for(var st;st=al(it);)it=st.find(-1,!0).line;return it}function Jo(it){for(var st;st=Ua(it);)it=st.find(1,!0).line;return it}function ai(it){for(var st,dt;st=Ua(it);)it=st.find(1,!0).line,(dt||(dt=[])).push(it);return dt}function ii(it,st){var dt=Ge(it,st),ht=Po(dt);return dt==ht?st:ce(ht)}function ki(it,st){if(st>it.lastLine())return st;var dt=Ge(it,st),ht;if(!Ke(it,dt))return st;for(;ht=Ua(dt);)dt=ht.find(1,!0).line;return ce(dt)+1}function Ke(it,st){var dt=Pe&&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&&oo(it,st,ht))return!0}}}function oo(it,st,dt){if(dt.to==null){var ht=dt.marker.find(1,!0);return oo(it,ht.line,Hi(ht.line.markedSpans,dt.marker))}if(dt.marker.inclusiveRight&&dt.to==st.text.length)return!0;for(var gt=void 0,wt=0;wt<st.markedSpans.length;++wt)if(gt=st.markedSpans[wt],gt.marker.collapsed&&!gt.marker.widgetNode&&gt.from==dt.to&&(gt.to==null||gt.to!=dt.from)&&(gt.marker.inclusiveLeft||dt.marker.inclusiveRight)&&oo(it,st,gt))return!0}function vo(it){it=Po(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 wt=dt.parent;wt;dt=wt,wt=dt.parent)for(var bt=0;bt<wt.children.length;++bt){var Ot=wt.children[bt];if(Ot==dt)break;st+=Ot.height}return st}function Xo(it){if(it.height==0)return 0;for(var st=it.text.length,dt,ht=it;dt=al(ht);){var gt=dt.find(0,!0);ht=gt.from.line,st+=gt.from.ch-gt.to.ch}for(ht=it;dt=Ua(ht);){var wt=dt.find(0,!0);st-=ht.text.length-wt.from.ch,ht=wt.to.line,st+=ht.text.length-wt.to.ch}return st}function Eo(it){var st=it.display,dt=it.doc;st.maxLine=Ge(dt,dt.first),st.maxLineLength=Xo(st.maxLine),st.maxLineChanged=!0,dt.iter(function(ht){var gt=Xo(ht);gt>st.maxLineLength&&(st.maxLineLength=gt,st.maxLine=ht)})}var Ro=function(it,st,dt){this.text=it,It(this,st),this.height=dt?dt(this):1};Ro.prototype.lineNo=function(){return ce(this)},fr(Ro);function ar(it,st,dt,ht){it.text=st,it.stateAfter&&(it.stateAfter=null),it.styles&&(it.styles=null),it.order!=null&&(it.order=null),ln(it),It(it,dt);var gt=ht?ht(it):1;gt!=it.height&&Qe(it,gt)}function hs(it){it.parent=null,ln(it)}var Tr={},Ya={};function Na(it,st){if(!it||/^\s*$/.test(it))return null;var dt=st.addModeClass?Ya:Tr;return dt[it]||(dt[it]=it.replace(/\S+/g,"cm-$&"))}function pe(it,st){var dt=Ae("span",null,null,Zt?"padding-right: .1px":null),ht={pre:Ae("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 wt=gt?st.rest[gt-1]:st.line,bt=void 0;ht.pos=0,ht.addToken=ba,Ti(it.display.measure)&&(bt=yi(wt,it.doc.direction))&&(ht.addToken=Io(ht.addToken,bt)),ht.map=[];var Ot=st!=it.display.externalMeasured&&ce(wt);Vl(wt,ht,Bi(it,wt,Ot)),wt.styleClasses&&(wt.styleClasses.bgClass&&(ht.bgClass=Cn(wt.styleClasses.bgClass,ht.bgClass||"")),wt.styleClasses.textClass&&(ht.textClass=Cn(wt.styleClasses.textClass,ht.textClass||""))),ht.map.length==0&&ht.map.push(0,0,ht.content.appendChild(Ws(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(Zt){var Bt=ht.content.lastChild;(/\bcm-tab\b/.test(Bt.className)||Bt.querySelector&&Bt.querySelector(".cm-tab"))&&(ht.content.className="cm-tab-wrap-hack")}return ao(it,"renderLine",it,st.line,ht.pre),ht.pre.className&&(ht.textClass=Cn(ht.pre.className,ht.textClass||"")),ht}function Vo(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 ba(it,st,dt,ht,gt,wt,bt){if(st){var Ot=it.splitSpaces?Ka(st,it.trailingSpace):st,Bt=it.cm.state.specialChars,Ut=!1,fe;if(!Bt.test(st))it.col+=st.length,fe=document.createTextNode(Ot),it.map.push(it.pos,it.pos+st.length,fe),me&&re<9&&(Ut=!0),it.pos+=st.length;else{fe=document.createDocumentFragment();for(var Jt=0;;){Bt.lastIndex=Jt;var Te=Bt.exec(st),Ne=Te?Te.index-Jt:st.length-Jt;if(Ne){var dn=document.createTextNode(Ot.slice(Jt,Jt+Ne));me&&re<9?fe.appendChild(te("span",[dn])):fe.appendChild(dn),it.map.push(it.pos,it.pos+Ne,dn),it.col+=Ne,it.pos+=Ne}if(!Te)break;Jt+=Ne+1;var pn=void 0;if(Te[0]==" "){var bn=it.cm.options.tabSize,Un=bn-it.col%bn;pn=fe.appendChild(te("span",le(Un),"cm-tab")),pn.setAttribute("role","presentation"),pn.setAttribute("cm-text"," "),it.col+=Un}else Te[0]=="\r"||Te[0]==`
`?(pn=fe.appendChild(te("span",Te[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),pn.setAttribute("cm-text",Te[0]),it.col+=1):(pn=it.cm.options.specialCharPlaceholder(Te[0]),pn.setAttribute("cm-text",Te[0]),me&&re<9?fe.appendChild(te("span",[pn])):fe.appendChild(pn),it.col+=1);it.map.push(it.pos,it.pos+1,pn),it.pos++}}if(it.trailingSpace=Ot.charCodeAt(st.length-1)==32,dt||ht||gt||Ut||wt||bt){var li=dt||"";ht&&(li+=ht),gt&&(li+=gt);var ni=te("span",[fe],li,wt);if(bt)for(var vi in bt)bt.hasOwnProperty(vi)&&vi!="style"&&vi!="class"&&ni.setAttribute(vi,bt[vi]);return it.content.appendChild(ni)}it.content.appendChild(fe)}}function Ka(it,st){if(it.length>1&&!/ /.test(it))return it;for(var dt=st,ht="",gt=0;gt<it.length;gt++){var wt=it.charAt(gt);wt==" "&&dt&&(gt==it.length-1||it.charCodeAt(gt+1)==32)&&(wt="\xA0"),ht+=wt,dt=wt==" "}return ht}function Io(it,st){return function(dt,ht,gt,wt,bt,Ot,Bt){gt=gt?gt+" cm-force-border":"cm-force-border";for(var Ut=dt.pos,fe=Ut+ht.length;;){for(var Jt=void 0,Te=0;Te<st.length&&(Jt=st[Te],!(Jt.to>Ut&&Jt.from<=Ut));Te++);if(Jt.to>=fe)return it(dt,ht,gt,wt,bt,Ot,Bt);it(dt,ht.slice(0,Jt.to-Ut),gt,wt,null,Ot,Bt),wt=null,ht=ht.slice(Jt.to-Ut),Ut=Jt.to}}}function Vs(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 Vl(it,st,dt){var ht=it.markedSpans,gt=it.text,wt=0;if(!ht){for(var bt=1;bt<dt.length;bt+=2)st.addToken(st,gt.slice(wt,wt=dt[bt]),Na(dt[bt+1],st.cm.options));return}for(var Ot=gt.length,Bt=0,Ut=1,fe="",Jt,Te,Ne=0,dn,pn,bn,Un,li;;){if(Ne==Bt){dn=pn=bn=Te="",li=null,Un=null,Ne=1/0;for(var ni=[],vi=void 0,_i=0;_i<ht.length;++_i){var $n=ht[_i],no=$n.marker;if(no.type=="bookmark"&&$n.from==Bt&&no.widgetNode)ni.push(no);else if($n.from<=Bt&&($n.to==null||$n.to>Bt||no.collapsed&&$n.to==Bt&&$n.from==Bt)){if($n.to!=null&&$n.to!=Bt&&Ne>$n.to&&(Ne=$n.to,pn=""),no.className&&(dn+=" "+no.className),no.css&&(Te=(Te?Te+";":"")+no.css),no.startStyle&&$n.from==Bt&&(bn+=" "+no.startStyle),no.endStyle&&$n.to==Ne&&(vi||(vi=[])).push(no.endStyle,$n.to),no.title&&((li||(li={})).title=no.title),no.attributes)for(var $o in no.attributes)(li||(li={}))[$o]=no.attributes[$o];no.collapsed&&(!Un||ta(Un.marker,no)<0)&&(Un=$n)}else $n.from>Bt&&Ne>$n.from&&(Ne=$n.from)}if(vi)for(var Wr=0;Wr<vi.length;Wr+=2)vi[Wr+1]==Ne&&(pn+=" "+vi[Wr]);if(!Un||Un.from==Bt)for(var dr=0;dr<ni.length;++dr)Vs(st,0,ni[dr]);if(Un&&(Un.from||0)==Bt){if(Vs(st,(Un.to==null?Ot+1:Un.to)-Bt,Un.marker,Un.from==null),Un.to==null)return;Un.to==Bt&&(Un=!1)}}if(Bt>=Ot)break;for(var Xs=Math.min(Ot,Ne);;){if(fe){var Cs=Bt+fe.length;if(!Un){var Br=Cs>Xs?fe.slice(0,Xs-Bt):fe;st.addToken(st,Br,Jt?Jt+dn:dn,bn,Bt+Br.length==Ne?pn:"",Te,li)}if(Cs>=Xs){fe=fe.slice(Xs-Bt),Bt=Xs;break}Bt=Cs,bn=""}fe=gt.slice(wt,wt=dt[Ut++]),Jt=Na(dt[Ut++],st.cm.options)}}}function wl(it,st,dt){this.line=st,this.rest=ai(st),this.size=this.rest?ce(we(this.rest))-dt+1:1,this.node=this.text=null,this.hidden=Ke(it,st)}function yo(it,st,dt){for(var ht=[],gt,wt=st;wt<dt;wt=gt){var bt=new wl(it.doc,Ge(it.doc,wt),wt);gt=wt+bt.size,ht.push(bt)}return ht}var lr=null;function bi(it){lr?lr.ops.push(it):it.ownsGroup=lr={ops:[it],delayedCallbacks:[]}}function Wi(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 wo(it,st){var dt=it.ownsGroup;if(dt)try{Wi(dt)}finally{lr=null,st(dt)}}var Zo=null;function qn(it,st){var dt=xr(it,st);if(dt.length){var ht=Array.prototype.slice.call(arguments,2),gt;lr?gt=lr.delayedCallbacks:Zo?gt=Zo:(gt=Zo=[],setTimeout(zo,0));for(var wt=function(Ot){gt.push(function(){return dt[Ot].apply(null,ht)})},bt=0;bt<dt.length;++bt)wt(bt)}}function zo(){var it=Zo;Zo=null;for(var st=0;st<it.length;++st)it[st]()}function Rr(it,st,dt,ht){for(var gt=0;gt<st.changes.length;gt++){var wt=st.changes[gt];wt=="text"?En(it,st):wt=="gutter"?Cr(it,st,dt,ht):wt=="class"?pr(it,st):wt=="widget"&&ll(it,st,ht)}st.changes=null}function ds(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),me&&re<8&&(it.node.style.zIndex=2)),it.node}function fu(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=ds(st);st.background=ht.insertBefore(te("div",null,dt),ht.firstChild),it.display.input.setUneditable(st.background)}}function Ul(it,st){var dt=it.display.externalMeasured;return dt&&dt.line==st.line?(it.display.externalMeasured=null,st.measure=dt.measure,dt.built):pe(it,st)}function En(it,st){var dt=st.text.className,ht=Ul(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,pr(it,st)):dt&&(st.text.className=dt)}function pr(it,st){fu(it,st),st.line.wrapClass?ds(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 Cr(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=ds(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 wt=st.line.gutterMarkers;if(it.options.lineNumbers||wt){var bt=ds(st),Ot=st.gutter=te("div",null,"CodeMirror-gutter-wrapper","left: "+(it.options.fixedGutter?ht.fixedPos:-ht.gutterTotalWidth)+"px");if(it.display.input.setUneditable(Ot),bt.insertBefore(Ot,st.text),st.line.gutterClass&&(Ot.className+=" "+st.line.gutterClass),it.options.lineNumbers&&(!wt||!wt["CodeMirror-linenumbers"])&&(st.lineNumber=Ot.appendChild(te("div",Be(it.options,dt),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+ht.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+it.display.lineNumInnerWidth+"px"))),wt)for(var Bt=0;Bt<it.display.gutterSpecs.length;++Bt){var Ut=it.display.gutterSpecs[Bt].className,fe=wt.hasOwnProperty(Ut)&&wt[Ut];fe&&Ot.appendChild(te("div",[fe],"CodeMirror-gutter-elt","left: "+ht.gutterLeft[Ut]+"px; width: "+ht.gutterWidth[Ut]+"px"))}}}function ll(it,st,dt){st.alignable&&(st.alignable=null);for(var ht=zt("CodeMirror-linewidget"),gt=st.node.firstChild,wt=void 0;gt;gt=wt)wt=gt.nextSibling,ht.test(gt.className)&&st.node.removeChild(gt);Vh(it,st,dt)}function Wh(it,st,dt,ht){var gt=Ul(it,st);return st.text=st.node=gt.pre,gt.bgClass&&(st.bgClass=gt.bgClass),gt.textClass&&(st.textClass=gt.textClass),pr(it,st),Cr(it,st,dt,ht),Vh(it,st,ht),st.node}function Vh(it,st,dt){if(Di(it,st.line,st,dt,!0),st.rest)for(var ht=0;ht<st.rest.length;ht++)Di(it,st.rest[ht],st,dt,!1)}function Di(it,st,dt,ht,gt){if(st.widgets)for(var wt=ds(dt),bt=0,Ot=st.widgets;bt<Ot.length;++bt){var Bt=Ot[bt],Ut=te("div",[Bt.node],"CodeMirror-linewidget"+(Bt.className?" "+Bt.className:""));Bt.handleMouseEvents||Ut.setAttribute("cm-ignore-events","true"),Fd(Bt,Ut,dt,ht),it.display.input.setUneditable(Ut),gt&&Bt.above?wt.insertBefore(Ut,dt.gutter||dt.text):wt.appendChild(Ut),qn(Bt,"redraw")}}function Fd(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 Cl(it){if(it.height!=null)return it.height;var st=it.doc.cm;if(!st)return 0;if(!Re(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;"),ee(st.display.measure,te("div",[it.node],null,dt))}return it.height=it.node.parentNode.offsetHeight}function ea(it,st){for(var dt=Ns(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 na(it){return it.lineSpace.offsetTop}function gu(it){return it.mover.offsetHeight-it.lineSpace.offsetHeight}function eh(it){if(it.cachedPaddingH)return it.cachedPaddingH;var st=ee(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 ia(it){return un-it.display.nativeBarWidth}function Xa(it){return it.display.scroller.clientWidth-ia(it)-it.display.barWidth}function Nd(it){return it.display.scroller.clientHeight-ia(it)-it.display.barHeight}function Yf(it,st,dt){var ht=it.options.lineWrapping,gt=ht&&Xa(it);if(!st.measure.heights||ht&&st.measure.width!=gt){var wt=st.measure.heights=[];if(ht){st.measure.width=gt;for(var bt=st.text.firstChild.getClientRects(),Ot=0;Ot<bt.length-1;Ot++){var Bt=bt[Ot],Ut=bt[Ot+1];Math.abs(Bt.bottom-Ut.bottom)>2&&wt.push((Bt.bottom+Ut.top)/2-dt.top)}}wt.push(dt.bottom-dt.top)}}function kc(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(ce(it.rest[gt])>dt)return{map:it.measure.maps[gt],cache:it.measure.caches[gt],before:!0}}function Kf(it,st){st=Po(st);var dt=ce(st),ht=it.display.externalMeasured=new wl(it.doc,st,dt);ht.lineN=dt;var gt=ht.built=pe(it,ht);return ht.text=gt.pre,ee(it.display.lineMeasure,gt.pre),ht}function Mc(it,st,dt,ht){return Za(it,pu(it,st),dt,ht)}function bd(it,st){if(st>=it.display.viewFrom&&st<it.display.viewTo)return it.display.view[va(it,st)];var dt=it.display.externalMeasured;if(dt&&st>=dt.lineN&&st<dt.lineN+dt.size)return dt}function pu(it,st){var dt=ce(st),ht=bd(it,dt);ht&&!ht.text?ht=null:ht&&ht.changes&&(Rr(it,ht,dt,Bc(it)),it.curOp.forceUpdate=!0),ht||(ht=Kf(it,st));var gt=kc(ht,st,dt);return{line:st,view:ht,rect:null,map:gt.map,cache:gt.cache,before:gt.before,hasHeights:!1}}function Za(it,st,dt,ht,gt){st.before&&(dt=-1);var wt=dt+(ht||""),bt;return st.cache.hasOwnProperty(wt)?bt=st.cache[wt]:(st.rect||(st.rect=st.view.text.getBoundingClientRect()),st.hasHeights||(Yf(it,st.view,st.rect),st.hasHeights=!0),bt=Lr(it,st,dt,ht),bt.bogus||(st.cache[wt]=bt)),{left:bt.left,right:bt.right,top:gt?bt.rtop:bt.top,bottom:gt?bt.rbottom:bt.bottom}}var Ec={left:0,right:0,top:0,bottom:0};function Fc(it,st,dt){for(var ht,gt,wt,bt,Ot,Bt,Ut=0;Ut<it.length;Ut+=3)if(Ot=it[Ut],Bt=it[Ut+1],st<Ot?(gt=0,wt=1,bt="left"):st<Bt?(gt=st-Ot,wt=gt+1):(Ut==it.length-3||st==Bt&&it[Ut+3]>st)&&(wt=Bt-Ot,gt=wt-1,st>=Bt&&(bt="right")),gt!=null){if(ht=it[Ut+2],Ot==Bt&&dt==(ht.insertLeft?"left":"right")&&(bt=dt),dt=="left"&&gt==0)for(;Ut&&it[Ut-2]==it[Ut-3]&&it[Ut-1].insertLeft;)ht=it[(Ut-=3)+2],bt="left";if(dt=="right"&&gt==Bt-Ot)for(;Ut<it.length-3&&it[Ut+3]==it[Ut+4]&&!it[Ut+5].insertLeft;)ht=it[(Ut+=3)+2],bt="right";break}return{node:ht,start:gt,end:wt,collapse:bt,coverStart:Ot,coverEnd:Bt}}function Xf(it,st){var dt=Ec;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 Lr(it,st,dt,ht){var gt=Fc(st.map,dt,ht),wt=gt.node,bt=gt.start,Ot=gt.end,Bt=gt.collapse,Ut;if(wt.nodeType==3){for(var fe=0;fe<4;fe++){for(;bt&&Nn(st.line.text.charAt(gt.coverStart+bt));)--bt;for(;gt.coverStart+Ot<gt.coverEnd&&Nn(st.line.text.charAt(gt.coverStart+Ot));)++Ot;if(me&&re<9&&bt==0&&Ot==gt.coverEnd-gt.coverStart?Ut=wt.parentNode.getBoundingClientRect():Ut=Xf(se(wt,bt,Ot).getClientRects(),ht),Ut.left||Ut.right||bt==0)break;Ot=bt,bt=bt-1,Bt="right"}me&&re<11&&(Ut=Tp(it.display.measure,Ut))}else{bt>0&&(Bt=ht="right");var Jt;it.options.lineWrapping&&(Jt=wt.getClientRects()).length>1?Ut=Jt[ht=="right"?Jt.length-1:0]:Ut=wt.getBoundingClientRect()}if(me&&re<9&&!bt&&(!Ut||!Ut.left&&!Ut.right)){var Te=wt.parentNode.getClientRects()[0];Te?Ut={left:Te.left,right:Te.left+nh(it.display),top:Te.top,bottom:Te.bottom}:Ut=Ec}for(var Ne=Ut.top-st.rect.top,dn=Ut.bottom-st.rect.top,pn=(Ne+dn)/2,bn=st.view.measure.heights,Un=0;Un<bn.length-1&&!(pn<bn[Un]);Un++);var li=Un?bn[Un-1]:0,ni=bn[Un],vi={left:(Bt=="right"?Ut.right:Ut.left)-st.rect.left,right:(Bt=="left"?Ut.left:Ut.right)-st.rect.left,top:li,bottom:ni};return!Ut.left&&!Ut.right&&(vi.bogus=!0),it.options.singleCursorHeightPerLine||(vi.rtop=Ne,vi.rbottom=dn),vi}function Tp(it,st){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!rn(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 Zf(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 Td(it){it.display.externalMeasure=null,$t(it.display.lineMeasure);for(var st=0;st<it.display.view.length;st++)Zf(it.display.view[st])}function Uh(it){Td(it),it.display.cachedCharWidth=it.display.cachedTextHeight=it.display.cachedPaddingH=null,it.options.lineWrapping||(it.display.maxLineChanged=!0),it.display.lineNumChars=null}function bs(){return ue&&et?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ts(){return ue&&et?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function zr(it){var st=0;if(it.widgets)for(var dt=0;dt<it.widgets.length;++dt)it.widgets[dt].above&&(st+=Cl(it.widgets[dt]));return st}function cs(it,st,dt,ht,gt){if(!gt){var wt=zr(st);dt.top+=wt,dt.bottom+=wt}if(ht=="line")return dt;ht||(ht="local");var bt=vo(st);if(ht=="local"?bt+=na(it.display):bt-=it.display.viewOffset,ht=="page"||ht=="window"){var Ot=it.display.lineSpace.getBoundingClientRect();bt+=Ot.top+(ht=="window"?0:Ts());var Bt=Ot.left+(ht=="window"?0:bs());dt.left+=Bt,dt.right+=Bt}return dt.top+=bt,dt.bottom+=bt,dt}function Nc(it,st,dt){if(dt=="div")return st;var ht=st.left,gt=st.top;if(dt=="page")ht-=bs(),gt-=Ts();else if(dt=="local"||!dt){var wt=it.display.sizer.getBoundingClientRect();ht+=wt.left,gt+=wt.top}var bt=it.display.lineSpace.getBoundingClientRect();return{left:ht-bt.left,top:gt-bt.top}}function Ad(it,st,dt,ht,gt){return ht||(ht=Ge(it.doc,st.line)),cs(it,ht,Mc(it,ht,st.ch,gt),dt)}function ur(it,st,dt,ht,gt,wt){ht=ht||Ge(it.doc,st.line),gt||(gt=pu(it,ht));function bt(dn,pn){var bn=Za(it,gt,dn,pn?"right":"left",wt);return pn?bn.left=bn.right:bn.right=bn.left,cs(it,ht,bn,dt)}var Ot=yi(ht,it.doc.direction),Bt=st.ch,Ut=st.sticky;if(Bt>=ht.text.length?(Bt=ht.text.length,Ut="before"):Bt<=0&&(Bt=0,Ut="after"),!Ot)return bt(Ut=="before"?Bt-1:Bt,Ut=="before");function fe(dn,pn,bn){var Un=Ot[pn],li=Un.level==1;return bt(bn?dn-1:dn,li!=bn)}var Jt=yn(Ot,Bt,Ut),Te=Fi,Ne=fe(Bt,Jt,Ut=="before");return Te!=null&&(Ne.other=fe(Bt,Te,Ut!="before")),Ne}function bc(it,st){var dt=0;st=xe(it.doc,st),it.options.lineWrapping||(dt=nh(it.display)*st.ch);var ht=Ge(it.doc,st.line),gt=vo(ht)+na(it.display);return{left:dt,right:dt,top:gt,bottom:gt+ht.height}}function Tc(it,st,dt,ht,gt){var wt=qt(it,st,dt);return wt.xRel=gt,ht&&(wt.outside=ht),wt}function Ac(it,st,dt){var ht=it.doc;if(dt+=it.display.viewOffset,dt<0)return Tc(ht.first,0,null,-1,-1);var gt=Tn(ht,dt),wt=ht.first+ht.size-1;if(gt>wt)return Tc(ht.first+ht.size-1,Ge(ht,wt).text.length,null,1,1);st<0&&(st=0);for(var bt=Ge(ht,gt);;){var Ot=Ve(it,bt,gt,st,dt),Bt=Wl(bt,Ot.ch+(Ot.xRel>0||Ot.outside>0?1:0));if(!Bt)return Ot;var Ut=Bt.find(1);if(Ut.line==gt)return Ut;bt=Ge(ht,gt=Ut.line)}}function oi(it,st,dt,ht){ht-=zr(st);var gt=st.text.length,wt=On(function(bt){return Za(it,dt,bt-1).bottom<=ht},gt,0);return gt=On(function(bt){return Za(it,dt,bt).top>ht},wt,gt),{begin:wt,end:gt}}function Jf(it,st,dt,ht){dt||(dt=pu(it,st));var gt=cs(it,st,Za(it,dt,ht),"line").top;return oi(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 Ve(it,st,dt,ht,gt){gt-=vo(st);var wt=pu(it,st),bt=zr(st),Ot=0,Bt=st.text.length,Ut=!0,fe=yi(st,it.doc.direction);if(fe){var Jt=(it.options.lineWrapping?Bp:Ap)(it,st,dt,wt,fe,ht,gt);Ut=Jt.level!=1,Ot=Ut?Jt.from:Jt.to-1,Bt=Ut?Jt.to:Jt.from-1}var Te=null,Ne=null,dn=On(function(_i){var $n=Za(it,wt,_i);return $n.top+=bt,$n.bottom+=bt,Qt($n,ht,gt,!1)?($n.top<=gt&&$n.left<=ht&&(Te=_i,Ne=$n),!0):!1},Ot,Bt),pn,bn,Un=!1;if(Ne){var li=ht-Ne.left<Ne.right-ht,ni=li==Ut;dn=Te+(ni?0:1),bn=ni?"after":"before",pn=li?Ne.left:Ne.right}else{!Ut&&(dn==Bt||dn==Ot)&&dn++,bn=dn==0?"after":dn==st.text.length?"before":Za(it,wt,dn-(Ut?1:0)).bottom+bt<=gt==Ut?"after":"before";var vi=ur(it,qt(dt,dn,bn),"line",st,wt);pn=vi.left,Un=gt<vi.top?-1:gt>=vi.bottom?1:0}return dn=mi(st.text,dn,1),Tc(dt,dn,bn,Un,ht-pn)}function Ap(it,st,dt,ht,gt,wt,bt){var Ot=On(function(Jt){var Te=gt[Jt],Ne=Te.level!=1;return Qt(ur(it,qt(dt,Ne?Te.to:Te.from,Ne?"before":"after"),"line",st,ht),wt,bt,!0)},0,gt.length-1),Bt=gt[Ot];if(Ot>0){var Ut=Bt.level!=1,fe=ur(it,qt(dt,Ut?Bt.from:Bt.to,Ut?"after":"before"),"line",st,ht);Qt(fe,wt,bt,!0)&&fe.top>bt&&(Bt=gt[Ot-1])}return Bt}function Bp(it,st,dt,ht,gt,wt,bt){var Ot=oi(it,st,ht,bt),Bt=Ot.begin,Ut=Ot.end;/\s/.test(st.text.charAt(Ut-1))&&Ut--;for(var fe=null,Jt=null,Te=0;Te<gt.length;Te++){var Ne=gt[Te];if(!(Ne.from>=Ut||Ne.to<=Bt)){var dn=Ne.level!=1,pn=Za(it,ht,dn?Math.min(Ut,Ne.to)-1:Math.max(Bt,Ne.from)).right,bn=pn<wt?wt-pn+1e9:pn-wt;(!fe||Jt>bn)&&(fe=Ne,Jt=bn)}}return fe||(fe=gt[gt.length-1]),fe.from<Bt&&(fe={from:Bt,to:fe.to,level:fe.level}),fe.to>Ut&&(fe={from:fe.from,to:Ut,level:fe.level}),fe}var Yl;function Kl(it){if(it.cachedTextHeight!=null)return it.cachedTextHeight;if(Yl==null){Yl=te("pre",null,"CodeMirror-line-like");for(var st=0;st<49;++st)Yl.appendChild(document.createTextNode("x")),Yl.appendChild(te("br"));Yl.appendChild(document.createTextNode("x"))}ee(it.measure,Yl);var dt=Yl.offsetHeight/50;return dt>3&&(it.cachedTextHeight=dt),$t(it.measure),dt||1}function nh(it){if(it.cachedCharWidth!=null)return it.cachedCharWidth;var st=te("span","xxxxxxxxxx"),dt=te("pre",[st],"CodeMirror-line-like");ee(it.measure,dt);var ht=st.getBoundingClientRect(),gt=(ht.right-ht.left)/10;return gt>2&&(it.cachedCharWidth=gt),gt||10}function Bc(it){for(var st=it.display,dt={},ht={},gt=st.gutters.clientLeft,wt=st.gutters.firstChild,bt=0;wt;wt=wt.nextSibling,++bt){var Ot=it.display.gutterSpecs[bt].className;dt[Ot]=wt.offsetLeft+wt.clientLeft+gt,ht[Ot]=wt.clientWidth}return{fixedPos:Bd(st),gutterTotalWidth:st.gutters.offsetWidth,gutterLeft:dt,gutterWidth:ht,wrapperWidth:st.wrapper.clientWidth}}function Bd(it){return it.scroller.getBoundingClientRect().left-it.sizer.getBoundingClientRect().left}function Qo(it){var st=Kl(it.display),dt=it.options.lineWrapping,ht=dt&&Math.max(5,it.display.scroller.clientWidth/nh(it.display)-3);return function(gt){if(Ke(it.doc,gt))return 0;var wt=0;if(gt.widgets)for(var bt=0;bt<gt.widgets.length;bt++)gt.widgets[bt].height&&(wt+=gt.widgets[bt].height);return dt?wt+(Math.ceil(gt.text.length/ht)||1)*st:wt+st}}function Mi(it){var st=it.doc,dt=Qo(it);st.iter(function(ht){var gt=dt(ht);gt!=ht.height&&Qe(ht,gt)})}function As(it,st,dt,ht){var gt=it.display;if(!dt&&Ns(st).getAttribute("cm-not-content")=="true")return null;var wt,bt,Ot=gt.lineSpace.getBoundingClientRect();try{wt=st.clientX-Ot.left,bt=st.clientY-Ot.top}catch(Jt){return null}var Bt=Ac(it,wt,bt),Ut;if(ht&&Bt.xRel>0&&(Ut=Ge(it.doc,Bt.line).text).length==Bt.ch){var fe=Yt(Ut,Ut.length,it.options.tabSize)-Ut.length;Bt=qt(Bt.line,Math.max(0,Math.round((wt-eh(it.display).left)/nh(it.display))-fe))}return Bt}function va(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 qo(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)Pe&&ii(it.doc,st)<gt.viewTo&&kr(it);else if(dt<=gt.viewFrom)Pe&&ki(it.doc,dt+ht)>gt.viewFrom?kr(it):(gt.viewFrom+=ht,gt.viewTo+=ht);else if(st<=gt.viewFrom&&dt>=gt.viewTo)kr(it);else if(st<=gt.viewFrom){var wt=Us(it,dt,dt+ht,1);wt?(gt.view=gt.view.slice(wt.index),gt.viewFrom=wt.lineN,gt.viewTo+=ht):kr(it)}else if(dt>=gt.viewTo){var bt=Us(it,st,st,-1);bt?(gt.view=gt.view.slice(0,bt.index),gt.viewTo=bt.lineN):kr(it)}else{var Ot=Us(it,st,st,-1),Bt=Us(it,dt,dt+ht,1);Ot&&Bt?(gt.view=gt.view.slice(0,Ot.index).concat(yo(it,Ot.lineN,Bt.lineN)).concat(gt.view.slice(Bt.index)),gt.viewTo+=ht):kr(it)}var Ut=gt.externalMeasured;Ut&&(dt<Ut.lineN?Ut.lineN+=ht:st<Ut.lineN+Ut.size&&(gt.externalMeasured=null))}function to(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 wt=ht.view[va(it,st)];if(wt.node!=null){var bt=wt.changes||(wt.changes=[]);Ce(bt,dt)==-1&&bt.push(dt)}}}function kr(it){it.display.viewFrom=it.display.viewTo=it.doc.first,it.display.view=[],it.display.viewOffset=0}function Us(it,st,dt,ht){var gt=va(it,st),wt,bt=it.display.view;if(!Pe||dt==it.doc.first+it.doc.size)return{index:gt,lineN:dt};for(var Ot=it.display.viewFrom,Bt=0;Bt<gt;Bt++)Ot+=bt[Bt].size;if(Ot!=st){if(ht>0){if(gt==bt.length-1)return null;wt=Ot+bt[gt].size-st,gt++}else wt=Ot-st;st+=wt,dt+=wt}for(;ii(it.doc,dt)!=dt;){if(gt==(ht<0?0:bt.length-1))return null;dt+=ht*bt[gt-(ht<0?1:0)].size,gt+=ht}return{index:gt,lineN:dt}}function jo(it,st,dt){var ht=it.display,gt=ht.view;gt.length==0||st>=ht.viewTo||dt<=ht.viewFrom?(ht.view=yo(it,st,dt),ht.viewFrom=st):(ht.viewFrom>st?ht.view=yo(it,st,ht.viewFrom).concat(ht.view):ht.viewFrom<st&&(ht.view=ht.view.slice(va(it,st))),ht.viewFrom=st,ht.viewTo<dt?ht.view=ht.view.concat(yo(it,ht.viewTo,dt)):ht.viewTo>dt&&(ht.view=ht.view.slice(0,va(it,dt)))),ht.viewTo=dt}function oa(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 _r(it){it.display.input.showSelection(it.display.input.prepareSelection())}function mu(it,st){st===void 0&&(st=!0);for(var dt=it.doc,ht={},gt=ht.cursors=document.createDocumentFragment(),wt=ht.selection=document.createDocumentFragment(),bt=0;bt<dt.sel.ranges.length;bt++)if(!(!st&&bt==dt.sel.primIndex)){var Ot=dt.sel.ranges[bt];if(!(Ot.from().line>=it.display.viewTo||Ot.to().line<it.display.viewFrom)){var Bt=Ot.empty();(Bt||it.options.showCursorWhenSelecting)&&ho(it,Ot.head,gt),Bt||uo(it,Ot,wt)}}return ht}function ho(it,st,dt){var ht=ur(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 wt=dt.appendChild(te("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));wt.style.display="",wt.style.left=ht.other.left+"px",wt.style.top=ht.other.top+"px",wt.style.height=(ht.other.bottom-ht.other.top)*.85+"px"}}function Bs(it,st){return it.top-st.top||it.left-st.left}function uo(it,st,dt){var ht=it.display,gt=it.doc,wt=document.createDocumentFragment(),bt=eh(it.display),Ot=bt.left,Bt=Math.max(ht.sizerWidth,Xa(it)-ht.sizer.offsetLeft)-bt.right,Ut=gt.direction=="ltr";function fe(ni,vi,_i,$n){vi<0&&(vi=0),vi=Math.round(vi),$n=Math.round($n),wt.appendChild(te("div",null,"CodeMirror-selected","position: absolute; left: "+ni+`px;
top: `+vi+"px; width: "+(_i==null?Bt-ni:_i)+`px;
height: `+($n-vi)+"px"))}function Jt(ni,vi,_i){var $n=Ge(gt,ni),no=$n.text.length,$o,Wr;function dr(Br,la){return Ad(it,qt(ni,Br),"div",$n,la)}function Xs(Br,la,gs){var Dr=Jf(it,$n,null,Br),Co=la=="ltr"==(gs=="after")?"left":"right",vr=gs=="after"?Dr.begin:Dr.end-(/\s/.test($n.text.charAt(Dr.end-1))?2:1);return dr(vr,Co)[Co]}var Cs=yi($n,gt.direction);return Gn(Cs,vi||0,_i==null?no:_i,function(Br,la,gs,Dr){var Co=gs=="ltr",vr=dr(Br,Co?"left":"right"),$r=dr(la-1,Co?"right":"left"),ps=vi==null&&Br==0,Qa=_i==null&&la==no,cr=Dr==0,Oa=!Cs||Dr==Cs.length-1;if($r.top-vr.top<=3){var wr=(Ut?ps:Qa)&&cr,nc=(Ut?Qa:ps)&&Oa,Pa=wr?Ot:(Co?vr:$r).left,ua=nc?Bt:(Co?$r:vr).right;fe(Pa,vr.top,ua-Pa,vr.bottom)}else{var Zs,Go,ts,Nl;Co?(Zs=Ut&&ps&&cr?Ot:vr.left,Go=Ut?Bt:Xs(Br,gs,"before"),ts=Ut?Ot:Xs(la,gs,"after"),Nl=Ut&&Qa&&Oa?Bt:$r.right):(Zs=Ut?Xs(Br,gs,"before"):Ot,Go=!Ut&&ps&&cr?Bt:vr.right,ts=!Ut&&Qa&&Oa?Ot:$r.left,Nl=Ut?Xs(la,gs,"after"):Bt),fe(Zs,vr.top,Go-Zs,vr.bottom),vr.bottom<$r.top&&fe(Ot,vr.bottom,null,$r.top),fe(ts,$r.top,Nl-ts,$r.bottom)}(!$o||Bs(vr,$o)<0)&&($o=vr),Bs($r,$o)<0&&($o=$r),(!Wr||Bs(vr,Wr)<0)&&(Wr=vr),Bs($r,Wr)<0&&(Wr=$r)}),{start:$o,end:Wr}}var Te=st.from(),Ne=st.to();if(Te.line==Ne.line)Jt(Te.line,Te.ch,Ne.ch);else{var dn=Ge(gt,Te.line),pn=Ge(gt,Ne.line),bn=Po(dn)==Po(pn),Un=Jt(Te.line,Te.ch,bn?dn.text.length+1:null).end,li=Jt(Ne.line,bn?0:null,Ne.ch).start;bn&&(Un.top<li.top-2?(fe(Un.right,Un.top,null,Un.bottom),fe(Ot,li.top,li.left,li.bottom)):fe(Un.right,Un.top,li.left-Un.right,Un.bottom)),Un.bottom<li.top&&fe(Ot,Un.bottom,null,li.top)}dt.appendChild(wt)}function bo(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()||ih(it),st.cursorDiv.style.visibility=(dt=!dt)?"":"hidden"},it.options.cursorBlinkRate):it.options.cursorBlinkRate<0&&(st.cursorDiv.style.visibility="hidden")}}function Uo(it){it.state.focused||(it.display.input.focus(),co(it))}function ir(it){it.state.delayingBlurEvent=!0,setTimeout(function(){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1,ih(it))},100)}function co(it,st){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1),it.options.readOnly!="nocursor"&&(it.state.focused||(ao(it,"focus",it,st),it.state.focused=!0,ze(it.display.wrapper,"CodeMirror-focused"),!it.curOp&&it.display.selForContextMenu!=it.doc.sel&&(it.display.input.reset(),Zt&&setTimeout(function(){return it.display.input.reset(!0)},20)),it.display.input.receivedFocus()),bo(it))}function ih(it,st){it.state.delayingBlurEvent||(it.state.focused&&(ao(it,"blur",it,st),it.state.focused=!1,Ht(it.display.wrapper,"CodeMirror-focused")),clearInterval(it.display.blinker),setTimeout(function(){it.state.focused||(it.display.shift=!1)},150))}function Pi(it){for(var st=it.display,dt=st.lineDiv.offsetTop,ht=0;ht<st.view.length;ht++){var gt=st.view[ht],wt=it.options.lineWrapping,bt=void 0,Ot=0;if(!gt.hidden){if(me&&re<8){var Bt=gt.node.offsetTop+gt.node.offsetHeight;bt=Bt-dt,dt=Bt}else{var Ut=gt.node.getBoundingClientRect();bt=Ut.bottom-Ut.top,!wt&&gt.text.firstChild&&(Ot=gt.text.firstChild.getBoundingClientRect().right-Ut.left-1)}var fe=gt.line.height-bt;if((fe>.005||fe<-.005)&&(Qe(gt.line,bt),Dp(gt.line),gt.rest))for(var Jt=0;Jt<gt.rest.length;Jt++)Dp(gt.rest[Jt]);if(Ot>it.display.sizerWidth){var Te=Math.ceil(Ot/nh(it.display));Te>it.display.maxLineLength&&(it.display.maxLineLength=Te,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 lo(it,st,dt){var ht=dt&&dt.top!=null?Math.max(0,dt.top):it.scroller.scrollTop;ht=Math.floor(ht-na(it));var gt=dt&&dt.bottom!=null?dt.bottom:ht+it.wrapper.clientHeight,wt=Tn(st,ht),bt=Tn(st,gt);if(dt&&dt.ensure){var Ot=dt.ensure.from.line,Bt=dt.ensure.to.line;Ot<wt?(wt=Ot,bt=Tn(st,vo(Ge(st,Ot))+it.wrapper.clientHeight)):Math.min(Bt,st.lastLine())>=bt&&(wt=Tn(st,vo(Ge(st,Bt))-it.wrapper.clientHeight),bt=Bt)}return{from:wt,to:Math.max(bt,wt+1)}}function Op(it,st){if(!$i(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&&!Ze){var wt=te("div","\u200B",null,`position: absolute;
top: `+(st.top-dt.viewOffset-na(it.display))+`px;
height: `+(st.bottom-st.top+ia(it)+dt.barHeight)+`px;
left: `+st.left+"px; width: "+Math.max(2,st.right-st.left)+"px;");it.display.lineSpace.appendChild(wt),wt.scrollIntoView(gt),it.display.lineSpace.removeChild(wt)}}}function Yh(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 wt=0;wt<5;wt++){var bt=!1,Ot=ur(it,st),Bt=!dt||dt==st?Ot:ur(it,dt);gt={left:Math.min(Ot.left,Bt.left),top:Math.min(Ot.top,Bt.top)-ht,right:Math.max(Ot.left,Bt.left),bottom:Math.max(Ot.bottom,Bt.bottom)+ht};var Ut=Qf(it,gt),fe=it.doc.scrollTop,Jt=it.doc.scrollLeft;if(Ut.scrollTop!=null&&(rh(it,Ut.scrollTop),Math.abs(it.doc.scrollTop-fe)>1&&(bt=!0)),Ut.scrollLeft!=null&&(Zl(it,Ut.scrollLeft),Math.abs(it.doc.scrollLeft-Jt)>1&&(bt=!0)),!bt)break}return gt}function Dd(it,st){var dt=Qf(it,st);dt.scrollTop!=null&&rh(it,dt.scrollTop),dt.scrollLeft!=null&&Zl(it,dt.scrollLeft)}function Qf(it,st){var dt=it.display,ht=Kl(it.display);st.top<0&&(st.top=0);var gt=it.curOp&&it.curOp.scrollTop!=null?it.curOp.scrollTop:dt.scroller.scrollTop,wt=Nd(it),bt={};st.bottom-st.top>wt&&(st.bottom=st.top+wt);var Ot=it.doc.height+gu(dt),Bt=st.top<ht,Ut=st.bottom>Ot-ht;if(st.top<gt)bt.scrollTop=Bt?0:st.top;else if(st.bottom>gt+wt){var fe=Math.min(st.top,(Ut?Ot:st.bottom)-wt);fe!=gt&&(bt.scrollTop=fe)}var Jt=it.options.fixedGutter?0:dt.gutters.offsetWidth,Te=it.curOp&&it.curOp.scrollLeft!=null?it.curOp.scrollLeft:dt.scroller.scrollLeft-Jt,Ne=Xa(it)-dt.gutters.offsetWidth,dn=st.right-st.left>Ne;return dn&&(st.right=st.left+Ne),st.left<10?bt.scrollLeft=0:st.left<Te?bt.scrollLeft=Math.max(0,st.left+Jt-(dn?0:10)):st.right>Ne+Te-3&&(bt.scrollLeft=st.right+(dn?0:10)-Ne),bt}function Dc(it,st){st!=null&&(Ll(it),it.curOp.scrollTop=(it.curOp.scrollTop==null?it.doc.scrollTop:it.curOp.scrollTop)+st)}function Xl(it){Ll(it);var st=it.getCursor();it.curOp.scrollToPos={from:st,to:st,margin:it.options.cursorScrollMargin}}function oh(it,st,dt){(st!=null||dt!=null)&&Ll(it),st!=null&&(it.curOp.scrollLeft=st),dt!=null&&(it.curOp.scrollTop=dt)}function fo(it,st){Ll(it),it.curOp.scrollToPos=st}function Ll(it){var st=it.curOp.scrollToPos;if(st){it.curOp.scrollToPos=null;var dt=bc(it,st.from),ht=bc(it,st.to);Oc(it,dt,ht,st.margin)}}function Oc(it,st,dt,ht){var gt=Qf(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});oh(it,gt.scrollLeft,gt.scrollTop)}function rh(it,st){Math.abs(it.doc.scrollTop-st)<2||(St||wu(it,{top:st}),qf(it,st,!0),St&&wu(it),Kh(it,100))}function qf(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 Zl(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,Rc(it),it.display.scroller.scrollLeft!=st&&(it.display.scroller.scrollLeft=st),it.display.scrollbars.setScrollLeft(st))}function Ta(it){var st=it.display,dt=st.gutters.offsetWidth,ht=Math.round(it.doc.height+gu(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+ia(it)+st.barHeight,nativeBarWidth:st.nativeBarWidth,gutterWidth:dt}}var vu=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),Jn(ht,"scroll",function(){ht.clientHeight&&st(ht.scrollTop,"vertical")}),Jn(gt,"scroll",function(){gt.clientWidth&&st(gt.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,me&&re<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};vu.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 wt=it.viewWidth-it.barLeft-(dt?ht:0);this.horiz.firstChild.style.width=Math.max(0,it.scrollWidth-it.clientWidth+wt)+"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}},vu.prototype.setScrollLeft=function(it){this.horiz.scrollLeft!=it&&(this.horiz.scrollLeft=it),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},vu.prototype.setScrollTop=function(it){this.vert.scrollTop!=it&&(this.vert.scrollTop=it),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},vu.prototype.zeroWidthHack=function(){var it=ct&&!Ee?"12px":"18px";this.horiz.style.height=this.vert.style.width=it,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new jt,this.disableVert=new jt},vu.prototype.enableZeroWidthBar=function(it,st,dt){it.style.pointerEvents="auto";function ht(){var gt=it.getBoundingClientRect(),wt=dt=="vert"?document.elementFromPoint(gt.right-1,(gt.top+gt.bottom)/2):document.elementFromPoint((gt.right+gt.left)/2,gt.bottom-1);wt!=it?it.style.pointerEvents="none":st.set(1e3,ht)}st.set(1e3,ht)},vu.prototype.clear=function(){var it=this.horiz.parentNode;it.removeChild(this.horiz),it.removeChild(this.vert)};var ul=function(){};ul.prototype.update=function(){return{bottom:0,right:0}},ul.prototype.setScrollLeft=function(){},ul.prototype.setScrollTop=function(){},ul.prototype.clear=function(){};function yu(it,st){st||(st=Ta(it));var dt=it.display.barWidth,ht=it.display.barHeight;Ic(it,st);for(var gt=0;gt<4&&dt!=it.display.barWidth||ht!=it.display.barHeight;gt++)dt!=it.display.barWidth&&it.options.lineWrapping&&Pi(it),Ic(it,Ta(it)),dt=it.display.barWidth,ht=it.display.barHeight}function Ic(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 $f={native:vu,null:ul};function tg(it){it.display.scrollbars&&(it.display.scrollbars.clear(),it.display.scrollbars.addClass&&Ht(it.display.wrapper,it.display.scrollbars.addClass)),it.display.scrollbars=new $f[it.options.scrollbarStyle](function(st){it.display.wrapper.insertBefore(st,it.display.scrollbarFiller),Jn(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"?Zl(it,st):rh(it,st)},it),it.display.scrollbars.addClass&&ze(it.display.wrapper,it.display.scrollbars.addClass)}var Ip=0;function Su(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},bi(it.curOp)}function xu(it){var st=it.curOp;st&&wo(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++)jp(st[gt]);for(var wt=0;wt<st.length;wt++)mr(st[wt]);for(var bt=0;bt<st.length;bt++)Pu(st[bt])}function Q0(it){var st=it.cm,dt=st.display;Rp(st),it.updateMaxLine&&Eo(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 sh(st,it.mustUpdate&&{top:it.scrollTop,ensure:it.scrollToPos},it.forceUpdate)}function q0(it){it.updatedDisplay=it.mustUpdate&&jc(it.cm,it.update)}function jp(it){var st=it.cm,dt=st.display;it.updatedDisplay&&Pi(st),it.barMeasure=Ta(st),dt.maxLineChanged&&!st.options.lineWrapping&&(it.adjustWidthTo=Mc(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+ia(st)+st.display.barWidth),it.maxScrollLeft=Math.max(0,dt.sizer.offsetLeft+it.adjustWidthTo-Xa(st))),(it.updatedDisplay||it.selectionChanged)&&(it.preparedSelection=dt.input.prepareSelection())}function mr(it){var st=it.cm;it.adjustWidthTo!=null&&(st.display.sizer.style.minWidth=it.adjustWidthTo+"px",it.maxScrollLeft<st.doc.scrollLeft&&Zl(st,Math.min(st.display.scroller.scrollLeft,it.maxScrollLeft),!0),st.display.maxLineChanged=!1);var dt=it.focus&&it.focus==He();it.preparedSelection&&st.display.input.showSelection(it.preparedSelection,dt),(it.updatedDisplay||it.startHeight!=st.doc.height)&&yu(st,it.barMeasure),it.updatedDisplay&&Lu(st,it.barMeasure),it.selectionChanged&&bo(st),st.state.focused&&it.updateInput&&st.display.input.reset(it.typing),dt&&Uo(it.cm)}function Pu(it){var st=it.cm,dt=st.display,ht=st.doc;if(it.updatedDisplay&&To(st,it.update),dt.wheelStartX!=null&&(it.scrollTop!=null||it.scrollLeft!=null||it.scrollToPos)&&(dt.wheelStartX=dt.wheelStartY=null),it.scrollTop!=null&&qf(st,it.scrollTop,it.forceScroll),it.scrollLeft!=null&&Zl(st,it.scrollLeft,!0,!0),it.scrollToPos){var gt=Yh(st,xe(ht,it.scrollToPos.from),xe(ht,it.scrollToPos.to),it.scrollToPos.margin);Op(st,gt)}var wt=it.maybeHiddenMarkers,bt=it.maybeUnhiddenMarkers;if(wt)for(var Ot=0;Ot<wt.length;++Ot)wt[Ot].lines.length||ao(wt[Ot],"hide");if(bt)for(var Bt=0;Bt<bt.length;++Bt)bt[Bt].lines.length&&ao(bt[Bt],"unhide");dt.wrapper.offsetHeight&&(ht.scrollTop=st.display.scroller.scrollTop),it.changeObjs&&ao(st,"changes",st,it.changeObjs),it.update&&it.update.finish()}function Lo(it,st){if(it.curOp)return st();Su(it);try{return st()}finally{xu(it)}}function Gr(it,st){return function(){if(it.curOp)return st.apply(it,arguments);Su(it);try{return st.apply(it,arguments)}finally{xu(it)}}}function Xr(it){return function(){if(this.curOp)return it.apply(this,arguments);Su(this);try{return it.apply(this,arguments)}finally{xu(this)}}}function Zr(it){return function(){var st=this.cm;if(!st||st.curOp)return it.apply(this,arguments);Su(st);try{return it.apply(this,arguments)}finally{xu(st)}}}function Kh(it,st){it.doc.highlightFrontier<it.display.viewTo&&it.state.highlight.set(st,Xn(Jr,it))}function Jr(it){var st=it.doc;if(!(st.highlightFrontier>=it.display.viewTo)){var dt=+new Date+it.options.workTime,ht=Qi(it,st.highlightFrontier),gt=[];st.iter(ht.line,Math.min(st.first+st.size,it.display.viewTo+500),function(wt){if(ht.line>=it.display.viewFrom){var bt=wt.styles,Ot=wt.text.length>it.options.maxHighlightLength?xn(st.mode,ht.state):null,Bt=So(it,wt,ht,!0);Ot&&(ht.state=Ot),wt.styles=Bt.styles;var Ut=wt.styleClasses,fe=Bt.classes;fe?wt.styleClasses=fe:Ut&&(wt.styleClasses=null);for(var Jt=!bt||bt.length!=wt.styles.length||Ut!=fe&&(!Ut||!fe||Ut.bgClass!=fe.bgClass||Ut.textClass!=fe.textClass),Te=0;!Jt&&Te<bt.length;++Te)Jt=bt[Te]!=wt.styles[Te];Jt&&gt.push(ht.line),wt.stateAfter=ht.save(),ht.nextLine()}else wt.text.length<=it.options.maxHighlightLength&&he(it,wt.text,ht),wt.stateAfter=ht.line%5==0?ht.save():null,ht.nextLine();if(+new Date>dt)return Kh(it,it.options.workDelay),!0}),st.highlightFrontier=ht.line,st.modeFrontier=Math.max(st.modeFrontier,ht.line),gt.length&&Lo(it,function(){for(var wt=0;wt<gt.length;wt++)to(it,gt[wt],"text")})}}var sh=function(it,st,dt){var ht=it.display;this.viewport=st,this.visible=lo(ht,it.doc,st),this.editorIsHidden=!ht.wrapper.offsetWidth,this.wrapperHeight=ht.wrapper.clientHeight,this.wrapperWidth=ht.wrapper.clientWidth,this.oldDisplayWidth=Xa(it),this.force=dt,this.dims=Bc(it),this.events=[]};sh.prototype.signal=function(it,st){No(it,st)&&this.events.push(arguments)},sh.prototype.finish=function(){for(var it=0;it<this.events.length;it++)ao.apply(null,this.events[it])};function Rp(it){var st=it.display;!st.scrollbarsClipped&&st.scroller.offsetWidth&&(st.nativeBarWidth=st.scroller.offsetWidth-st.scroller.clientWidth,st.heightForcer.style.height=ia(it)+"px",st.sizer.style.marginBottom=-st.nativeBarWidth+"px",st.sizer.style.borderRightWidth=ia(it)+"px",st.scrollbarsClipped=!0)}function zp(it){if(it.hasFocus())return null;var st=He();if(!st||!Re(it.display.lineDiv,st))return null;var dt={activeElt:st};if(window.getSelection){var ht=window.getSelection();ht.anchorNode&&ht.extend&&Re(it.display.lineDiv,ht.anchorNode)&&(dt.anchorNode=ht.anchorNode,dt.anchorOffset=ht.anchorOffset,dt.focusNode=ht.focusNode,dt.focusOffset=ht.focusOffset)}return dt}function Ys(it){if(!(!it||!it.activeElt||it.activeElt==He())&&(it.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(it.activeElt.nodeName)&&it.anchorNode&&Re(document.body,it.anchorNode)&&Re(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 jc(it,st){var dt=it.display,ht=it.doc;if(st.editorIsHidden)return kr(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&&oa(it)==0)return!1;br(it)&&(kr(it),st.dims=Bc(it));var gt=ht.first+ht.size,wt=Math.max(st.visible.from-it.options.viewportMargin,ht.first),bt=Math.min(gt,st.visible.to+it.options.viewportMargin);dt.viewFrom<wt&&wt-dt.viewFrom<20&&(wt=Math.max(ht.first,dt.viewFrom)),dt.viewTo>bt&&dt.viewTo-bt<20&&(bt=Math.min(gt,dt.viewTo)),Pe&&(wt=ii(it.doc,wt),bt=ki(it.doc,bt));var Ot=wt!=dt.viewFrom||bt!=dt.viewTo||dt.lastWrapHeight!=st.wrapperHeight||dt.lastWrapWidth!=st.wrapperWidth;jo(it,wt,bt),dt.viewOffset=vo(Ge(it.doc,dt.viewFrom)),it.display.mover.style.top=dt.viewOffset+"px";var Bt=oa(it);if(!Ot&&Bt==0&&!st.force&&dt.renderedView==dt.view&&(dt.updateLineNumbers==null||dt.updateLineNumbers>=dt.viewTo))return!1;var Ut=zp(it);return Bt>4&&(dt.lineDiv.style.display="none"),eg(it,dt.updateLineNumbers,st.dims),Bt>4&&(dt.lineDiv.style.display=""),dt.renderedView=dt.view,Ys(Ut),$t(dt.cursorDiv),$t(dt.selectionDiv),dt.gutters.style.height=dt.sizer.style.minHeight=0,Ot&&(dt.lastWrapHeight=st.wrapperHeight,dt.lastWrapWidth=st.wrapperWidth,Kh(it,400)),dt.updateLineNumbers=null,!0}function To(it,st){for(var dt=st.viewport,ht=!0;;ht=!1){if(!ht||!it.options.lineWrapping||st.oldDisplayWidth==Xa(it)){if(dt&&dt.top!=null&&(dt={top:Math.min(it.doc.height+gu(it.display)-Nd(it),dt.top)}),st.visible=lo(it.display,it.doc,dt),st.visible.from>=it.display.viewFrom&&st.visible.to<=it.display.viewTo)break}else ht&&(st.visible=lo(it.display,it.doc,dt));if(!jc(it,st))break;Pi(it);var gt=Ta(it);_r(it),yu(it,gt),Lu(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 wu(it,st){var dt=new sh(it,st);if(jc(it,dt)){Pi(it),To(it,dt);var ht=Ta(it);_r(it),yu(it,ht),Lu(it,ht),dt.finish()}}function eg(it,st,dt){var ht=it.display,gt=it.options.lineNumbers,wt=ht.lineDiv,bt=wt.firstChild;function Ot(dn){var pn=dn.nextSibling;return Zt&&ct&&it.display.currentWheelTarget==dn?dn.style.display="none":dn.parentNode.removeChild(dn),pn}for(var Bt=ht.view,Ut=ht.viewFrom,fe=0;fe<Bt.length;fe++){var Jt=Bt[fe];if(!Jt.hidden)if(!Jt.node||Jt.node.parentNode!=wt){var Te=Wh(it,Jt,Ut,dt);wt.insertBefore(Te,bt)}else{for(;bt!=Jt.node;)bt=Ot(bt);var Ne=gt&&st!=null&&st<=Ut&&Jt.lineNumber;Jt.changes&&(Ce(Jt.changes,"gutter")>-1&&(Ne=!1),Rr(it,Jt,Ut,dt)),Ne&&($t(Jt.lineNumber),Jt.lineNumber.appendChild(document.createTextNode(Be(it.options,Ut)))),bt=Jt.node.nextSibling}Ut+=Jt.size}for(;bt;)bt=Ot(bt)}function Cu(it){var st=it.gutters.offsetWidth;it.sizer.style.marginLeft=st+"px"}function Lu(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+ia(it)+"px"}function Rc(it){var st=it.display,dt=st.view;if(!(!st.alignWidgets&&(!st.gutters.firstChild||!it.options.fixedGutter))){for(var ht=Bd(st)-st.scroller.scrollLeft+it.doc.scrollLeft,gt=st.gutters.offsetWidth,wt=ht+"px",bt=0;bt<dt.length;bt++)if(!dt[bt].hidden){it.options.fixedGutter&&(dt[bt].gutter&&(dt[bt].gutter.style.left=wt),dt[bt].gutterBackground&&(dt[bt].gutterBackground.style.left=wt));var Ot=dt[bt].alignable;if(Ot)for(var Bt=0;Bt<Ot.length;Bt++)Ot[Bt].style.left=wt}it.options.fixedGutter&&(st.gutters.style.left=ht+gt+"px")}}function br(it){if(!it.options.lineNumbers)return!1;var st=it.doc,dt=Be(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")),wt=gt.firstChild.offsetWidth,bt=gt.offsetWidth-wt;return ht.lineGutter.style.width="",ht.lineNumInnerWidth=Math.max(wt,ht.lineGutter.offsetWidth-bt)+1,ht.lineNumWidth=ht.lineNumInnerWidth+bt,ht.lineNumChars=ht.lineNumInnerWidth?dt.length:-1,ht.lineGutter.style.width=ht.lineNumWidth+"px",Cu(it.display),!0}return!1}function Qr(it,st){for(var dt=[],ht=!1,gt=0;gt<it.length;gt++){var wt=it[gt],bt=null;if(typeof wt!="string"&&(bt=wt.style,wt=wt.className),wt=="CodeMirror-linenumbers")if(st)ht=!0;else continue;dt.push({className:wt,style:bt})}return st&&!ht&&dt.push({className:"CodeMirror-linenumbers",style:null}),dt}function ah(it){var st=it.gutters,dt=it.gutterSpecs;$t(st),it.lineGutter=null;for(var ht=0;ht<dt.length;++ht){var gt=dt[ht],wt=gt.className,bt=gt.style,Ot=st.appendChild(te("div",null,"CodeMirror-gutter "+wt));bt&&(Ot.style.cssText=bt),wt=="CodeMirror-linenumbers"&&(it.lineGutter=Ot,Ot.style.width=(it.lineNumWidth||1)+"px")}st.style.display=dt.length?"":"none",Cu(it)}function ya(it){ah(it.display),qo(it),Rc(it)}function ku(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=Ae("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=Ae("div",[gt.measure,gt.lineMeasure,gt.selectionDiv,gt.cursorDiv,gt.lineDiv],null,"position: relative; outline: none");var wt=Ae("div",[gt.lineSpace],"CodeMirror-lines");gt.mover=te("div",[wt],null,"position: relative"),gt.sizer=te("div",[gt.mover],"CodeMirror-sizer"),gt.sizerWidth=null,gt.heightForcer=te("div",null,null,"position: absolute; height: "+un+"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"),me&&re<8&&(gt.gutters.style.zIndex=-1,gt.scroller.style.paddingRight=0),!Zt&&!(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=Qr(ht.gutters,ht.lineNumbers),ah(gt),dt.init(gt)}var ra=0,Mr=null;me?Mr=-.53:St?Mr=15:ue?Mr=-.7:Ue&&(Mr=-1/3);function hl(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 Sa(it){var st=hl(it);return st.x*=Mr,st.y*=Mr,st}function qr(it,st){var dt=hl(st),ht=dt.x,gt=dt.y,wt=it.display,bt=wt.scroller,Ot=bt.scrollWidth>bt.clientWidth,Bt=bt.scrollHeight>bt.clientHeight;if(ht&&Ot||gt&&Bt){if(gt&&ct&&Zt){t:for(var Ut=st.target,fe=wt.view;Ut!=bt;Ut=Ut.parentNode)for(var Jt=0;Jt<fe.length;Jt++)if(fe[Jt].node==Ut){it.display.currentWheelTarget=Ut;break t}}if(ht&&!St&&!Se&&Mr!=null){gt&&Bt&&rh(it,Math.max(0,bt.scrollTop+gt*Mr)),Zl(it,Math.max(0,bt.scrollLeft+ht*Mr)),(!gt||gt&&Bt)&&sr(st),wt.wheelStartX=null;return}if(gt&&Mr!=null){var Te=gt*Mr,Ne=it.doc.scrollTop,dn=Ne+wt.wrapper.clientHeight;Te<0?Ne=Math.max(0,Ne+Te-50):dn=Math.min(it.doc.height,dn+Te+50),wu(it,{top:Ne,bottom:dn})}ra<20&&(wt.wheelStartX==null?(wt.wheelStartX=bt.scrollLeft,wt.wheelStartY=bt.scrollTop,wt.wheelDX=ht,wt.wheelDY=gt,setTimeout(function(){if(wt.wheelStartX!=null){var pn=bt.scrollLeft-wt.wheelStartX,bn=bt.scrollTop-wt.wheelStartY,Un=bn&&wt.wheelDY&&bn/wt.wheelDY||pn&&wt.wheelDX&&pn/wt.wheelDX;wt.wheelStartX=wt.wheelStartY=null,Un&&(Mr=(Mr*ra+Un)/(ra+1),++ra)}},200)):(wt.wheelDX+=ht,wt.wheelDY+=gt))}}var Aa=function(it,st){this.ranges=it,this.primIndex=st};Aa.prototype.primary=function(){return this.ranges[this.primIndex]},Aa.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(!Mn(dt.anchor,ht.anchor)||!Mn(dt.head,ht.head))return!1}return!0},Aa.prototype.deepCopy=function(){for(var it=[],st=0;st<this.ranges.length;st++)it[st]=new Ao(Gi(this.ranges[st].anchor),Gi(this.ranges[st].head));return new Aa(it,this.primIndex)},Aa.prototype.somethingSelected=function(){for(var it=0;it<this.ranges.length;it++)if(!this.ranges[it].empty())return!0;return!1},Aa.prototype.contains=function(it,st){st||(st=it);for(var dt=0;dt<this.ranges.length;dt++){var ht=this.ranges[dt];if(ae(st,ht.from())>=0&&ae(it,ht.to())<=0)return dt}return-1};var Ao=function(it,st){this.anchor=it,this.head=st};Ao.prototype.from=function(){return gn(this.anchor,this.head)},Ao.prototype.to=function(){return Ai(this.anchor,this.head)},Ao.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ja(it,st,dt){var ht=it&&it.options.selectionsMayTouch,gt=st[dt];st.sort(function(Te,Ne){return ae(Te.from(),Ne.from())}),dt=Ce(st,gt);for(var wt=1;wt<st.length;wt++){var bt=st[wt],Ot=st[wt-1],Bt=ae(Ot.to(),bt.from());if(ht&&!bt.empty()?Bt>0:Bt>=0){var Ut=gn(Ot.from(),bt.from()),fe=Ai(Ot.to(),bt.to()),Jt=Ot.empty()?bt.from()==bt.head:Ot.from()==Ot.head;wt<=dt&&--dt,st.splice(--wt,2,new Ao(Jt?fe:Ut,Jt?Ut:fe))}}return new Aa(st,dt)}function Jl(it,st){return new Aa([new Ao(it,st||it)],0)}function Mu(it){return it.text?qt(it.from.line+it.text.length-1,we(it.text).length+(it.text.length==1?it.from.ch:0)):it.to}function lh(it,st){if(ae(it,st.from)<0)return it;if(ae(it,st.to)<=0)return Mu(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+=Mu(st).ch-st.to.ch),qt(dt,ht)}function Od(it,st){for(var dt=[],ht=0;ht<it.sel.ranges.length;ht++){var gt=it.sel.ranges[ht];dt.push(new Ao(lh(gt.anchor,st),lh(gt.head,st)))}return Ja(it.cm,dt,it.sel.primIndex)}function Xh(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 Id(it,st,dt){for(var ht=[],gt=qt(it.first,0),wt=gt,bt=0;bt<st.length;bt++){var Ot=st[bt],Bt=Xh(Ot.from,gt,wt),Ut=Xh(Mu(Ot),gt,wt);if(gt=Ot.to,wt=Ut,dt=="around"){var fe=it.sel.ranges[bt],Jt=ae(fe.head,fe.anchor)<0;ht[bt]=new Ao(Jt?Ut:Bt,Jt?Bt:Ut)}else ht[bt]=new Ao(Bt,Bt)}return new Aa(ht,it.sel.primIndex)}function eo(it){it.doc.mode=ve(it.options,it.doc.modeOption),jd(it)}function jd(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,Kh(it,100),it.state.modeGen++,it.curOp&&qo(it)}function ng(it,st){return st.from.ch==0&&st.to.ch==0&&we(st.text)==""&&(!it.cm||it.cm.options.wholeLineUpdateBefore)}function zc(it,st,dt,ht){function gt(li){return dt?dt[li]:null}function wt(li,ni,vi){ar(li,ni,vi,ht),qn(li,"change",li,st)}function bt(li,ni){for(var vi=[],_i=li;_i<ni;++_i)vi.push(new Ro(Ut[_i],gt(_i),ht));return vi}var Ot=st.from,Bt=st.to,Ut=st.text,fe=Ge(it,Ot.line),Jt=Ge(it,Bt.line),Te=we(Ut),Ne=gt(Ut.length-1),dn=Bt.line-Ot.line;if(st.full)it.insert(0,bt(0,Ut.length)),it.remove(Ut.length,it.size-Ut.length);else if(ng(it,st)){var pn=bt(0,Ut.length-1);wt(Jt,Jt.text,Ne),dn&&it.remove(Ot.line,dn),pn.length&&it.insert(Ot.line,pn)}else if(fe==Jt)if(Ut.length==1)wt(fe,fe.text.slice(0,Ot.ch)+Te+fe.text.slice(Bt.ch),Ne);else{var bn=bt(1,Ut.length-1);bn.push(new Ro(Te+fe.text.slice(Bt.ch),Ne,ht)),wt(fe,fe.text.slice(0,Ot.ch)+Ut[0],gt(0)),it.insert(Ot.line+1,bn)}else if(Ut.length==1)wt(fe,fe.text.slice(0,Ot.ch)+Ut[0]+Jt.text.slice(Bt.ch),gt(0)),it.remove(Ot.line+1,dn);else{wt(fe,fe.text.slice(0,Ot.ch)+Ut[0],gt(0)),wt(Jt,Te+Jt.text.slice(Bt.ch),Ne);var Un=bt(1,Ut.length-1);dn>1&&it.remove(Ot.line+1,dn-1),it.insert(Ot.line+1,Un)}qn(it,"change",it,st)}function dl(it,st,dt){function ht(gt,wt,bt){if(gt.linked)for(var Ot=0;Ot<gt.linked.length;++Ot){var Bt=gt.linked[Ot];if(Bt.doc!=wt){var Ut=bt&&Bt.sharedHist;dt&&!Ut||(st(Bt.doc,Ut),ht(Bt.doc,gt,Ut))}}}ht(it,null,!0)}function _c(it,st){if(st.cm)throw new Error("This document is already in use.");it.doc=st,st.cm=it,Mi(it),eo(it),Rd(it),it.options.lineWrapping||Eo(it),it.options.mode=st.modeOption,qo(it)}function Rd(it){(it.doc.direction=="rtl"?ze:Ht)(it.display.lineDiv,"CodeMirror-rtl")}function $0(it){Lo(it,function(){Rd(it),qo(it)})}function Zh(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 Gc(it,st){var dt={from:Gi(st.from),to:Mu(st),text:Bn(it,st.from,st.to)};return Eu(it,dt,st.from.line,st.to.line+1),dl(it,function(ht){return Eu(ht,dt,st.from.line,st.to.line+1)},!0),dt}function Jh(it){for(;it.length;){var st=we(it);if(st.ranges)it.pop();else break}}function zd(it,st){if(st)return Jh(it.done),we(it.done);if(it.done.length&&!we(it.done).ranges)return we(it.done);if(it.done.length>1&&!it.done[it.done.length-2].ranges)return it.done.pop(),we(it.done)}function _d(it,st,dt,ht){var gt=it.history;gt.undone.length=0;var wt=+new Date,bt,Ot;if((gt.lastOp==ht||gt.lastOrigin==st.origin&&st.origin&&(st.origin.charAt(0)=="+"&&gt.lastModTime>wt-(it.cm?it.cm.options.historyEventDelay:500)||st.origin.charAt(0)=="*"))&&(bt=zd(gt,gt.lastOp==ht)))Ot=we(bt.changes),ae(st.from,st.to)==0&&ae(st.from,Ot.to)==0?Ot.to=Mu(st):bt.changes.push(Gc(it,st));else{var Bt=we(gt.done);for((!Bt||!Bt.ranges)&&Qh(it.sel,gt.done),bt={changes:[Gc(it,st)],generation:gt.generation},gt.done.push(bt);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=wt,gt.lastOp=gt.lastSelOp=ht,gt.lastOrigin=gt.lastSelOrigin=st.origin,Ot||ao(it,"historyAdded")}function ig(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 Gd(it,st,dt,ht){var gt=it.history,wt=ht&&ht.origin;dt==gt.lastSelOp||wt&&gt.lastSelOrigin==wt&&(gt.lastModTime==gt.lastSelTime&&gt.lastOrigin==wt||ig(it,wt,we(gt.done),st))?gt.done[gt.done.length-1]=st:Qh(st,gt.done),gt.lastSelTime=+new Date,gt.lastSelOrigin=wt,gt.lastSelOp=dt,ht&&ht.clearRedo!==!1&&Jh(gt.undone)}function Qh(it,st){var dt=we(st);dt&&dt.ranges&&dt.equals(it)||st.push(it)}function Eu(it,st,dt,ht){var gt=st["spans_"+it.id],wt=0;it.iter(Math.max(it.first,dt),Math.min(it.first+it.size,ht),function(bt){bt.markedSpans&&((gt||(gt=st["spans_"+it.id]={}))[wt]=bt.markedSpans),++wt})}function Ds(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 kl(it,st){var dt=st["spans_"+it.id];if(!dt)return null;for(var ht=[],gt=0;gt<st.text.length;++gt)ht.push(Ds(dt[gt]));return ht}function Hc(it,st){var dt=kl(it,st),ht=Ki(it,st);if(!dt)return ht;if(!ht)return dt;for(var gt=0;gt<dt.length;++gt){var wt=dt[gt],bt=ht[gt];if(wt&&bt)t:for(var Ot=0;Ot<bt.length;++Ot){for(var Bt=bt[Ot],Ut=0;Ut<wt.length;++Ut)if(wt[Ut].marker==Bt.marker)continue t;wt.push(Bt)}else bt&&(dt[gt]=bt)}return dt}function Ql(it,st,dt){for(var ht=[],gt=0;gt<it.length;++gt){var wt=it[gt];if(wt.ranges){ht.push(dt?Aa.prototype.deepCopy.call(wt):wt);continue}var bt=wt.changes,Ot=[];ht.push({changes:Ot});for(var Bt=0;Bt<bt.length;++Bt){var Ut=bt[Bt],fe=void 0;if(Ot.push({from:Ut.from,to:Ut.to,text:Ut.text}),st)for(var Jt in Ut)(fe=Jt.match(/^spans_(\d+)$/))&&Ce(st,Number(fe[1]))>-1&&(we(Ot)[Jt]=Ut[Jt],delete Ut[Jt])}}return ht}function Wc(it,st,dt,ht){if(ht){var gt=it.anchor;if(dt){var wt=ae(st,gt)<0;wt!=ae(dt,gt)<0?(gt=st,st=dt):wt!=ae(st,dt)<0&&(st=dt)}return new Ao(gt,st)}else return new Ao(dt||st,st)}function Vc(it,st,dt,ht,gt){gt==null&&(gt=it.cm&&(it.cm.display.shift||it.extend)),ws(it,new Aa([Wc(it.sel.primary(),st,dt,gt)],0),ht)}function _p(it,st,dt){for(var ht=[],gt=it.cm&&(it.cm.display.shift||it.extend),wt=0;wt<it.sel.ranges.length;wt++)ht[wt]=Wc(it.sel.ranges[wt],st[wt],null,gt);var bt=Ja(it.cm,ht,it.sel.primIndex);ws(it,bt,dt)}function Fu(it,st,dt,ht){var gt=it.sel.ranges.slice(0);gt[st]=dt,ws(it,Ja(it.cm,gt,it.sel.primIndex),ht)}function uh(it,st,dt,ht){ws(it,Jl(st,dt),ht)}function Gp(it,st,dt){var ht={ranges:st.ranges,update:function(gt){this.ranges=[];for(var wt=0;wt<gt.length;wt++)this.ranges[wt]=new Ao(xe(it,gt[wt].anchor),xe(it,gt[wt].head))},origin:dt&&dt.origin};return ao(it,"beforeSelectionChange",it,ht),it.cm&&ao(it.cm,"beforeSelectionChange",it.cm,ht),ht.ranges!=st.ranges?Ja(it.cm,ht.ranges,ht.ranges.length-1):st}function Uc(it,st,dt){var ht=it.history.done,gt=we(ht);gt&&gt.ranges?(ht[ht.length-1]=st,hh(it,st,dt)):ws(it,st,dt)}function ws(it,st,dt){hh(it,st,dt),Gd(it,it.sel,it.cm?it.cm.curOp.id:NaN,dt)}function hh(it,st,dt){(No(it,"beforeSelectionChange")||it.cm&&No(it.cm,"beforeSelectionChange"))&&(st=Gp(it,st,dt));var ht=dt&&dt.bias||(ae(st.primary().head,it.sel.primary().head)<0?-1:1);og(it,Wd(it,st,ht,!0)),!(dt&&dt.scroll===!1)&&it.cm&&Xl(it.cm)}function og(it,st){st.equals(it.sel)||(it.sel=st,it.cm&&(it.cm.curOp.updateInput=1,it.cm.curOp.selectionChanged=!0,Kr(it.cm)),qn(it,"cursorActivity",it))}function Hd(it){og(it,Wd(it,it.sel,null,!1))}function Wd(it,st,dt,ht){for(var gt,wt=0;wt<st.ranges.length;wt++){var bt=st.ranges[wt],Ot=st.ranges.length==it.sel.ranges.length&&it.sel.ranges[wt],Bt=Vd(it,bt.anchor,Ot&&Ot.anchor,dt,ht),Ut=Vd(it,bt.head,Ot&&Ot.head,dt,ht);(gt||Bt!=bt.anchor||Ut!=bt.head)&&(gt||(gt=st.ranges.slice(0,wt)),gt[wt]=new Ao(Bt,Ut))}return gt?Ja(it.cm,gt,st.primIndex):st}function ql(it,st,dt,ht,gt){var wt=Ge(it,st.line);if(wt.markedSpans)for(var bt=0;bt<wt.markedSpans.length;++bt){var Ot=wt.markedSpans[bt],Bt=Ot.marker,Ut="selectLeft"in Bt?!Bt.selectLeft:Bt.inclusiveLeft,fe="selectRight"in Bt?!Bt.selectRight:Bt.inclusiveRight;if((Ot.from==null||(Ut?Ot.from<=st.ch:Ot.from<st.ch))&&(Ot.to==null||(fe?Ot.to>=st.ch:Ot.to>st.ch))){if(gt&&(ao(Bt,"beforeCursorEnter"),Bt.explicitlyCleared))if(wt.markedSpans){--bt;continue}else break;if(!Bt.atomic)continue;if(dt){var Jt=Bt.find(ht<0?1:-1),Te=void 0;if((ht<0?fe:Ut)&&(Jt=rg(it,Jt,-ht,Jt&&Jt.line==st.line?wt:null)),Jt&&Jt.line==st.line&&(Te=ae(Jt,dt))&&(ht<0?Te<0:Te>0))return ql(it,Jt,st,ht,gt)}var Ne=Bt.find(ht<0?-1:1);return(ht<0?Ut:fe)&&(Ne=rg(it,Ne,ht,Ne.line==st.line?wt:null)),Ne?ql(it,Ne,st,ht,gt):null}}return st}function Vd(it,st,dt,ht,gt){var wt=ht||1,bt=ql(it,st,dt,wt,gt)||!gt&&ql(it,st,dt,wt,!0)||ql(it,st,dt,-wt,gt)||!gt&&ql(it,st,dt,-wt,!0);return bt||(it.cantEdit=!0,qt(it.first,0))}function rg(it,st,dt,ht){return dt<0&&st.ch==0?st.line>it.first?xe(it,qt(st.line-1)):null:dt>0&&st.ch==(ht||Ge(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 Er(it){it.setSelection(qt(it.firstLine(),0),qt(it.lastLine()),Le)}function Ud(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,wt,bt,Ot){gt&&(ht.from=xe(it,gt)),wt&&(ht.to=xe(it,wt)),bt&&(ht.text=bt),Ot!==void 0&&(ht.origin=Ot)}),ao(it,"beforeChange",it,ht),it.cm&&ao(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 Nu(it,st,dt){if(it.cm){if(!it.cm.curOp)return Gr(it.cm,Nu)(it,st,dt);if(it.cm.state.suppressEdits)return}if(!((No(it,"beforeChange")||it.cm&&No(it.cm,"beforeChange"))&&(st=Ud(it,st,!0),!st))){var ht=pi&&!dt&&Ci(it,st.from,st.to);if(ht)for(var gt=ht.length-1;gt>=0;--gt)dh(it,{from:ht[gt].from,to:ht[gt].to,text:gt?[""]:st.text,origin:st.origin});else dh(it,st)}}function dh(it,st){if(!(st.text.length==1&&st.text[0]==""&&ae(st.from,st.to)==0)){var dt=Od(it,st);_d(it,st,dt,it.cm?it.cm.curOp.id:NaN),qh(it,st,dt,Ki(it,st));var ht=[];dl(it,function(gt,wt){!wt&&Ce(ht,gt.history)==-1&&(ag(gt.history,st),ht.push(gt.history)),qh(gt,st,null,Ki(gt,st))})}}function Yd(it,st,dt){var ht=it.cm&&it.cm.state.suppressEdits;if(!(ht&&!dt)){for(var gt=it.history,wt,bt=it.sel,Ot=st=="undo"?gt.done:gt.undone,Bt=st=="undo"?gt.undone:gt.done,Ut=0;Ut<Ot.length&&(wt=Ot[Ut],!(dt?wt.ranges&&!wt.equals(it.sel):!wt.ranges));Ut++);if(Ut!=Ot.length){for(gt.lastOrigin=gt.lastSelOrigin=null;;)if(wt=Ot.pop(),wt.ranges){if(Qh(wt,Bt),dt&&!wt.equals(it.sel)){ws(it,wt,{clearRedo:!1});return}bt=wt}else if(ht){Ot.push(wt);return}else break;var fe=[];Qh(bt,Bt),Bt.push({changes:fe,generation:gt.generation}),gt.generation=wt.generation||++gt.maxGeneration;for(var Jt=No(it,"beforeChange")||it.cm&&No(it.cm,"beforeChange"),Te=function(pn){var bn=wt.changes[pn];if(bn.origin=st,Jt&&!Ud(it,bn,!1))return Ot.length=0,{};fe.push(Gc(it,bn));var Un=pn?Od(it,bn):we(Ot);qh(it,bn,Un,Hc(it,bn)),!pn&&it.cm&&it.cm.scrollIntoView({from:bn.from,to:Mu(bn)});var li=[];dl(it,function(ni,vi){!vi&&Ce(li,ni.history)==-1&&(ag(ni.history,bn),li.push(ni.history)),qh(ni,bn,null,Hc(ni,bn))})},Ne=wt.changes.length-1;Ne>=0;--Ne){var dn=Te(Ne);if(dn)return dn.v}}}}function sg(it,st){if(st!=0&&(it.first+=st,it.sel=new Aa(Pn(it.sel.ranges,function(gt){return new Ao(qt(gt.anchor.line+st,gt.anchor.ch),qt(gt.head.line+st,gt.head.ch))}),it.sel.primIndex),it.cm)){qo(it.cm,it.first,it.first-st,st);for(var dt=it.cm.display,ht=dt.viewFrom;ht<dt.viewTo;ht++)to(it.cm,ht,"gutter")}}function qh(it,st,dt,ht){if(it.cm&&!it.cm.curOp)return Gr(it.cm,qh)(it,st,dt,ht);if(st.to.line<it.first){sg(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);sg(it,gt),st={from:qt(it.first,0),to:qt(st.to.line+gt,st.to.ch),text:[we(st.text)],origin:st.origin}}var wt=it.lastLine();st.to.line>wt&&(st={from:st.from,to:qt(wt,Ge(it,wt).text.length),text:[st.text[0]],origin:st.origin}),st.removed=Bn(it,st.from,st.to),dt||(dt=Od(it,st)),it.cm?Hp(it.cm,st,ht):zc(it,st,ht),hh(it,dt,Le),it.cantEdit&&Vd(it,qt(it.firstLine(),0))&&(it.cantEdit=!1)}}function Hp(it,st,dt){var ht=it.doc,gt=it.display,wt=st.from,bt=st.to,Ot=!1,Bt=wt.line;it.options.lineWrapping||(Bt=ce(Po(Ge(ht,wt.line))),ht.iter(Bt,bt.line+1,function(Ne){if(Ne==gt.maxLine)return Ot=!0,!0})),ht.sel.contains(st.from,st.to)>-1&&Kr(it),zc(ht,st,dt,Qo(it)),it.options.lineWrapping||(ht.iter(Bt,wt.line+st.text.length,function(Ne){var dn=Xo(Ne);dn>gt.maxLineLength&&(gt.maxLine=Ne,gt.maxLineLength=dn,gt.maxLineChanged=!0,Ot=!1)}),Ot&&(it.curOp.updateMaxLine=!0)),Zn(ht,wt.line),Kh(it,400);var Ut=st.text.length-(bt.line-wt.line)-1;st.full?qo(it):wt.line==bt.line&&st.text.length==1&&!ng(it.doc,st)?to(it,wt.line,"text"):qo(it,wt.line,bt.line+1,Ut);var fe=No(it,"changes"),Jt=No(it,"change");if(Jt||fe){var Te={from:wt,to:bt,text:st.text,removed:st.removed,origin:st.origin};Jt&&qn(it,"change",it,Te),fe&&(it.curOp.changeObjs||(it.curOp.changeObjs=[])).push(Te)}it.display.selForContextMenu=null}function ch(it,st,dt,ht,gt){var wt;ht||(ht=dt),ae(ht,dt)<0&&(wt=[ht,dt],dt=wt[0],ht=wt[1]),typeof st=="string"&&(st=it.splitLines(st)),Nu(it,{from:dt,to:ht,text:st,origin:gt})}function Ba(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 wt=it[gt],bt=!0;if(wt.ranges){wt.copied||(wt=it[gt]=wt.deepCopy(),wt.copied=!0);for(var Ot=0;Ot<wt.ranges.length;Ot++)Ba(wt.ranges[Ot].anchor,st,dt,ht),Ba(wt.ranges[Ot].head,st,dt,ht);continue}for(var Bt=0;Bt<wt.changes.length;++Bt){var Ut=wt.changes[Bt];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){bt=!1;break}}bt||(it.splice(0,gt+1),gt=0)}}function ag(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 fh(it,st,dt,ht){var gt=st,wt=st;return typeof st=="number"?wt=Ge(it,Ye(it,st)):gt=ce(st),gt==null?null:(ht(wt,gt)&&it.cm&&to(it.cm,gt,dt),wt)}function $h(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}$h.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,hs(gt),qn(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 hr(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}hr.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 wt=Math.min(st,gt-it),bt=ht.height;if(ht.removeInner(it,wt),this.height-=bt-ht.height,gt==wt&&(this.children.splice(dt--,1),ht.parent=null),(st-=wt)==0)break;it=0}else it-=gt}if(this.size-st<25&&(this.children.length>1||!(this.children[0]instanceof $h))){var Ot=[];this.collapse(Ot),this.children=[new $h(Ot)],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],wt=gt.chunkSize();if(it<=wt){if(gt.insertInner(it,st,dt),gt.lines&&gt.lines.length>50){for(var bt=gt.lines.length%25+25,Ot=bt;Ot<gt.lines.length;){var Bt=new $h(gt.lines.slice(Ot,Ot+=25));gt.height-=Bt.height,this.children.splice(++ht,0,Bt),Bt.parent=this}gt.lines=gt.lines.slice(0,bt),this.maybeSpill()}break}it-=wt}},maybeSpill:function(){if(!(this.children.length<=10)){var it=this;do{var st=it.children.splice(it.children.length-5,5),dt=new hr(st);if(it.parent){it.size-=dt.size,it.height-=dt.height;var gt=Ce(it.parent.children,it);it.parent.children.splice(gt+1,0,dt)}else{var ht=new hr(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],wt=gt.chunkSize();if(it<wt){var bt=Math.min(st,wt-it);if(gt.iterN(it,bt,dt))return!0;if((st-=bt)==0)break;it=0}else it-=wt}}};var $l=function(it,st,dt){if(dt)for(var ht in dt)dt.hasOwnProperty(ht)&&(this[ht]=dt[ht]);this.doc=it,this.node=st};$l.prototype.clear=function(){var it=this.doc.cm,st=this.line.widgets,dt=this.line,ht=ce(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 wt=Cl(this);Qe(dt,Math.max(0,dt.height-wt)),it&&(Lo(it,function(){Vp(it,dt,-wt),to(it,ht,"widget")}),qn(it,"lineWidgetCleared",it,this,ht))}},$l.prototype.changed=function(){var it=this,st=this.height,dt=this.doc.cm,ht=this.line;this.height=null;var gt=Cl(this)-st;gt&&(Ke(this.doc,ht)||Qe(ht,ht.height+gt),dt&&Lo(dt,function(){dt.curOp.forceUpdate=!0,Vp(dt,ht,gt),qn(dt,"lineWidgetChanged",dt,it,ce(ht))}))},fr($l);function Vp(it,st,dt){vo(st)<(it.curOp&&it.curOp.scrollTop||it.doc.scrollTop)&&Dc(it,dt)}function Yc(it,st,dt,ht){var gt=new $l(it,dt,ht),wt=it.cm;return wt&&gt.noHScroll&&(wt.display.alignWidgets=!0),fh(it,st,"widget",function(bt){var Ot=bt.widgets||(bt.widgets=[]);if(gt.insertAt==null?Ot.push(gt):Ot.splice(Math.min(Ot.length-1,Math.max(0,gt.insertAt)),0,gt),gt.line=bt,wt&&!Ke(it,bt)){var Bt=vo(bt)<it.scrollTop;Qe(bt,bt.height+Cl(gt)),Bt&&Dc(wt,gt.height),wt.curOp.forceUpdate=!0}return!0}),wt&&qn(wt,"lineWidgetAdded",wt,gt,typeof st=="number"?st:ce(st)),gt}var Up=0,oe=function(it,st){this.lines=[],this.type=st,this.doc=it,this.id=++Up};oe.prototype.clear=function(){if(!this.explicitlyCleared){var it=this.doc.cm,st=it&&!it.curOp;if(st&&Su(it),No(this,"clear")){var dt=this.find();dt&&qn(this,"clear",dt.from,dt.to)}for(var ht=null,gt=null,wt=0;wt<this.lines.length;++wt){var bt=this.lines[wt],Ot=Hi(bt.markedSpans,this);it&&!this.collapsed?to(it,ce(bt),"text"):it&&(Ot.to!=null&&(gt=ce(bt)),Ot.from!=null&&(ht=ce(bt))),bt.markedSpans=ci(bt.markedSpans,Ot),Ot.from==null&&this.collapsed&&!Ke(this.doc,bt)&&it&&Qe(bt,Kl(it.display))}if(it&&this.collapsed&&!it.options.lineWrapping)for(var Bt=0;Bt<this.lines.length;++Bt){var Ut=Po(this.lines[Bt]),fe=Xo(Ut);fe>it.display.maxLineLength&&(it.display.maxLine=Ut,it.display.maxLineLength=fe,it.display.maxLineChanged=!0)}ht!=null&&it&&this.collapsed&&qo(it,ht,gt+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,it&&Hd(it.doc)),it&&qn(it,"markerCleared",it,this,ht,gt),st&&xu(it),this.parent&&this.parent.clear()}},oe.prototype.find=function(it,st){it==null&&this.type=="bookmark"&&(it=1);for(var dt,ht,gt=0;gt<this.lines.length;++gt){var wt=this.lines[gt],bt=Hi(wt.markedSpans,this);if(bt.from!=null&&(dt=qt(st?wt:ce(wt),bt.from),it==-1))return dt;if(bt.to!=null&&(ht=qt(st?wt:ce(wt),bt.to),it==1))return ht}return dt&&{from:dt,to:ht}},oe.prototype.changed=function(){var it=this,st=this.find(-1,!0),dt=this,ht=this.doc.cm;!st||!ht||Lo(ht,function(){var gt=st.line,wt=ce(st.line),bt=bd(ht,wt);if(bt&&(Zf(bt),ht.curOp.selectionChanged=ht.curOp.forceUpdate=!0),ht.curOp.updateMaxLine=!0,!Ke(dt.doc,gt)&&dt.height!=null){var Ot=dt.height;dt.height=null;var Bt=Cl(dt)-Ot;Bt&&Qe(gt,gt.height+Bt)}qn(ht,"markerChanged",ht,it)})},oe.prototype.attachLine=function(it){if(!this.lines.length&&this.doc.cm){var st=this.doc.cm.curOp;(!st.maybeHiddenMarkers||Ce(st.maybeHiddenMarkers,this)==-1)&&(st.maybeUnhiddenMarkers||(st.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(it)},oe.prototype.detachLine=function(it){if(this.lines.splice(Ce(this.lines,it),1),!this.lines.length&&this.doc.cm){var st=this.doc.cm.curOp;(st.maybeHiddenMarkers||(st.maybeHiddenMarkers=[])).push(this)}},fr(oe);function gh(it,st,dt,ht,gt){if(ht&&ht.shared)return Yp(it,st,dt,ht,gt);if(it.cm&&!it.cm.curOp)return Gr(it.cm,gh)(it,st,dt,ht,gt);var wt=new oe(it,gt),bt=ae(st,dt);if(ht&&Ni(ht,wt,!1),bt>0||bt==0&&wt.clearWhenEmpty!==!1)return wt;if(wt.replacedWith&&(wt.collapsed=!0,wt.widgetNode=Ae("span",[wt.replacedWith],"CodeMirror-widget"),ht.handleMouseEvents||wt.widgetNode.setAttribute("cm-ignore-events","true"),ht.insertLeft&&(wt.widgetNode.insertLeft=!0)),wt.collapsed){if(Pl(it,st.line,st,dt,wt)||st.line!=dt.line&&Pl(it,dt.line,st,dt,wt))throw new Error("Inserting collapsed marker partially overlapping an existing one");Fe()}wt.addToHistory&&_d(it,{from:st,to:dt,origin:"markText"},it.sel,NaN);var Ot=st.line,Bt=it.cm,Ut;if(it.iter(Ot,dt.line+1,function(Jt){Bt&&wt.collapsed&&!Bt.options.lineWrapping&&Po(Jt)==Bt.display.maxLine&&(Ut=!0),wt.collapsed&&Ot!=st.line&&Qe(Jt,0),nr(Jt,new Dn(wt,Ot==st.line?st.ch:null,Ot==dt.line?dt.ch:null)),++Ot}),wt.collapsed&&it.iter(st.line,dt.line+1,function(Jt){Ke(it,Jt)&&Qe(Jt,0)}),wt.clearOnEnter&&Jn(wt,"beforeCursorEnter",function(){return wt.clear()}),wt.readOnly&&(io(),(it.history.done.length||it.history.undone.length)&&it.clearHistory()),wt.collapsed&&(wt.id=++Up,wt.atomic=!0),Bt){if(Ut&&(Bt.curOp.updateMaxLine=!0),wt.collapsed)qo(Bt,st.line,dt.line+1);else if(wt.className||wt.startStyle||wt.endStyle||wt.css||wt.attributes||wt.title)for(var fe=st.line;fe<=dt.line;fe++)to(Bt,fe,"text");wt.atomic&&Hd(Bt.doc),qn(Bt,"markerAdded",Bt,wt)}return wt}var Ml=function(it,st){this.markers=it,this.primary=st;for(var dt=0;dt<it.length;++dt)it[dt].parent=this};Ml.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var it=0;it<this.markers.length;++it)this.markers[it].clear();qn(this,"clear")}},Ml.prototype.find=function(it,st){return this.primary.find(it,st)},fr(Ml);function Yp(it,st,dt,ht,gt){ht=Ni(ht),ht.shared=!1;var wt=[gh(it,st,dt,ht,gt)],bt=wt[0],Ot=ht.widgetNode;return dl(it,function(Bt){Ot&&(ht.widgetNode=Ot.cloneNode(!0)),wt.push(gh(Bt,xe(Bt,st),xe(Bt,dt),ht,gt));for(var Ut=0;Ut<Bt.linked.length;++Ut)if(Bt.linked[Ut].isParent)return;bt=we(wt)}),new Ml(wt,bt)}function lg(it){return it.findMarks(qt(it.first,0),it.clipPos(qt(it.lastLine())),function(st){return st.parent})}function Kp(it,st){for(var dt=0;dt<st.length;dt++){var ht=st[dt],gt=ht.find(),wt=it.clipPos(gt.from),bt=it.clipPos(gt.to);if(ae(wt,bt)){var Ot=gh(it,wt,bt,ht.primary,ht.primary.type);ht.markers.push(Ot),Ot.parent=ht}}}function ug(it){for(var st=function(ht){var gt=it[ht],wt=[gt.primary.doc];dl(gt.primary.doc,function(Bt){return wt.push(Bt)});for(var bt=0;bt<gt.markers.length;bt++){var Ot=gt.markers[bt];Ce(wt,Ot.doc)==-1&&(Ot.parent=null,gt.markers.splice(bt--,1))}},dt=0;dt<it.length;dt++)st(dt)}var tv=0,fs=function(it,st,dt,ht,gt){if(!(this instanceof fs))return new fs(it,st,dt,ht,gt);dt==null&&(dt=0),hr.call(this,[new $h([new Ro("",null)])]),this.first=dt,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=dt;var wt=qt(dt,0);this.sel=Jl(wt),this.history=new Zh(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:wt,to:wt,text:it}),ws(this,Jl(wt),Le)};fs.prototype=Mt(hr.prototype,{constructor:fs,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=ri(this,this.first,this.first+this.size);return it===!1?st:st.join(it||this.lineSeparator())},setValue:Zr(function(it){var st=qt(this.first,0),dt=this.first+this.size-1;Nu(this,{from:st,to:qt(dt,Ge(this,dt).text.length),text:this.splitLines(it),origin:"setValue",full:!0},!0),this.cm&&oh(this.cm,0,0),ws(this,Jl(st),Le)}),replaceRange:function(it,st,dt,ht){st=xe(this,st),dt=dt?xe(this,dt):st,ch(this,it,st,dt,ht)},getRange:function(it,st,dt){var ht=Bn(this,xe(this,it),xe(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(ti(this,it))return Ge(this,it)},getLineNumber:function(it){return ce(it)},getLineHandleVisualStart:function(it){return typeof it=="number"&&(it=Ge(this,it)),Po(it)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(it){return xe(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:Zr(function(it,st,dt){uh(this,xe(this,typeof it=="number"?qt(it,st||0):it),null,dt)}),setSelection:Zr(function(it,st,dt){uh(this,xe(this,it),xe(this,st||it),dt)}),extendSelection:Zr(function(it,st,dt){Vc(this,xe(this,it),st&&xe(this,st),dt)}),extendSelections:Zr(function(it,st){_p(this,Si(this,it),st)}),extendSelectionsBy:Zr(function(it,st){var dt=Pn(this.sel.ranges,it);_p(this,Si(this,dt),st)}),setSelections:Zr(function(it,st,dt){if(it.length){for(var ht=[],gt=0;gt<it.length;gt++)ht[gt]=new Ao(xe(this,it[gt].anchor),xe(this,it[gt].head));st==null&&(st=Math.min(it.length-1,this.sel.primIndex)),ws(this,Ja(this.cm,ht,st),dt)}}),addSelection:Zr(function(it,st,dt){var ht=this.sel.ranges.slice(0);ht.push(new Ao(xe(this,it),xe(this,st||it))),ws(this,Ja(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=Bn(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=Bn(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:Zr(function(it,st,dt){for(var ht=[],gt=this.sel,wt=0;wt<gt.ranges.length;wt++){var bt=gt.ranges[wt];ht[wt]={from:bt.from(),to:bt.to(),text:this.splitLines(it[wt]),origin:dt}}for(var Ot=st&&st!="end"&&Id(this,ht,st),Bt=ht.length-1;Bt>=0;Bt--)Nu(this,ht[Bt]);Ot?Uc(this,Ot):this.cm&&Xl(this.cm)}),undo:Zr(function(){Yd(this,"undo")}),redo:Zr(function(){Yd(this,"redo")}),undoSelection:Zr(function(){Yd(this,"undo",!0)}),redoSelection:Zr(function(){Yd(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 Zh(this.history.maxGeneration),dl(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:Ql(this.history.done),undone:Ql(this.history.undone)}},setHistory:function(it){var st=this.history=new Zh(this.history.maxGeneration);st.done=Ql(it.done.slice(0),null,!0),st.undone=Ql(it.undone.slice(0),null,!0)},setGutterMarker:Zr(function(it,st,dt){return fh(this,it,"gutter",function(ht){var gt=ht.gutterMarkers||(ht.gutterMarkers={});return gt[st]=dt,!dt&&Et(gt)&&(ht.gutterMarkers=null),!0})}),clearGutter:Zr(function(it){var st=this;this.iter(function(dt){dt.gutterMarkers&&dt.gutterMarkers[it]&&fh(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(!ti(this,it)||(st=it,it=Ge(this,it),!it))return null}else if(st=ce(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:Zr(function(it,st,dt){return fh(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(zt(dt).test(ht[gt]))return!1;ht[gt]+=" "+dt}return!0})}),removeLineClass:Zr(function(it,st,dt){return fh(this,it,st=="gutter"?"gutter":"class",function(ht){var gt=st=="text"?"textClass":st=="background"?"bgClass":st=="gutter"?"gutterClass":"wrapClass",wt=ht[gt];if(wt)if(dt==null)ht[gt]=null;else{var bt=wt.match(zt(dt));if(!bt)return!1;var Ot=bt.index+bt[0].length;ht[gt]=wt.slice(0,bt.index)+(!bt.index||Ot==wt.length?"":" ")+wt.slice(Ot)||null}else return!1;return!0})}),addLineWidget:Zr(function(it,st,dt){return Yc(this,it,st,dt)}),removeLineWidget:function(it){it.clear()},markText:function(it,st,dt){return gh(this,xe(this,it),xe(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=xe(this,it),gh(this,it,it,dt,"bookmark")},findMarksAt:function(it){it=xe(this,it);var st=[],dt=Ge(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=xe(this,it),st=xe(this,st);var ht=[],gt=it.line;return this.iter(it.line,st.line+1,function(wt){var bt=wt.markedSpans;if(bt)for(var Ot=0;Ot<bt.length;Ot++){var Bt=bt[Ot];!(Bt.to!=null&&gt==it.line&&it.ch>=Bt.to||Bt.from==null&&gt!=it.line||Bt.from!=null&&gt==st.line&&Bt.from>=st.ch)&&(!dt||dt(Bt.marker))&&ht.push(Bt.marker.parent||Bt.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 wt=gt.text.length+ht;if(wt>it)return st=it,!0;it-=wt,++dt}),xe(this,qt(dt,st))},indexFromPos:function(it){it=xe(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 fs(ri(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 fs(ri(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}],Kp(ht,lg(this)),ht},unlinkDoc:function(it){if(it instanceof xo&&(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),ug(lg(this));break}}if(it.history==this.history){var ht=[it.id];dl(it,function(gt){return ht.push(gt.id)},!0),it.history=new Zh(null),it.history.done=Ql(this.history.done,ht),it.history.undone=Ql(this.history.undone,ht)}},iterLinkedDocs:function(it){dl(this,it)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(it){return this.lineSep?it.split(this.lineSep):We(it)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Zr(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))})}),fs.prototype.eachLine=fs.prototype.iter;var Kd=0;function hg(it){var st=this;if(Jp(st),!($i(st,it)||ea(st.display,it))){sr(it),me&&(Kd=+new Date);var dt=As(st,it,!0),ht=it.dataTransfer.files;if(!(!dt||st.isReadOnly()))if(ht&&ht.length&&window.FileReader&&window.File)for(var gt=ht.length,wt=Array(gt),bt=0,Ot=function(){++bt==gt&&Gr(st,function(){dt=xe(st.doc,dt);var Ne={from:dt,to:dt,text:st.doc.splitLines(wt.filter(function(dn){return dn!=null}).join(st.doc.lineSeparator())),origin:"paste"};Nu(st.doc,Ne),Uc(st.doc,Jl(xe(st.doc,dt),xe(st.doc,Mu(Ne))))})()},Bt=function(Ne,dn){if(st.options.allowDropFileTypes&&Ce(st.options.allowDropFileTypes,Ne.type)==-1){Ot();return}var pn=new FileReader;pn.onerror=function(){return Ot()},pn.onload=function(){var bn=pn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(bn)){Ot();return}wt[dn]=bn,Ot()},pn.readAsText(Ne)},Ut=0;Ut<ht.length;Ut++)Bt(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 fe=it.dataTransfer.getData("Text");if(fe){var Jt;if(st.state.draggingText&&!st.state.draggingText.copy&&(Jt=st.listSelections()),hh(st.doc,Jl(dt,dt)),Jt)for(var Te=0;Te<Jt.length;++Te)ch(st.doc,"",Jt[Te].anchor,Jt[Te].head,"drag");st.replaceSelection(fe,"around","paste"),st.display.input.focus()}}catch(Ne){}}}}function Xp(it,st){if(me&&(!it.state.draggingText||+new Date-Kd<100)){Ir(st);return}if(!($i(it,st)||ea(it.display,st))&&(st.dataTransfer.setData("Text",it.getSelection()),st.dataTransfer.effectAllowed="copyMove",st.dataTransfer.setDragImage&&!Ue)){var dt=te("img",null,null,"position: fixed; left: 0; top: 0;");dt.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Se&&(dt.width=dt.height=1,it.display.wrapper.appendChild(dt),dt._top=dt.offsetTop),st.dataTransfer.setDragImage(dt,0,0),Se&&dt.parentNode.removeChild(dt)}}function Zp(it,st){var dt=As(it,st);if(dt){var ht=document.createDocumentFragment();ho(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)),ee(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 wt=0;wt<dt.length;wt++)it(dt[wt])})}}var dg=!1;function xa(){dg||(td(),dg=!0)}function td(){var it;Jn(window,"resize",function(){it==null&&(it=setTimeout(function(){it=null,Qp(cg)},100))}),Jn(window,"blur",function(){return Qp(ih)})}function cg(it){var st=it.display;st.cachedCharWidth=st.cachedTextHeight=st.cachedPaddingH=null,st.scrollbarsClipped=!1,it.setSize()}for(var El={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"},Xd=0;Xd<10;Xd++)El[Xd+48]=El[Xd+96]=String(Xd);for(var Kc=65;Kc<=90;Kc++)El[Kc]=String.fromCharCode(Kc);for(var Zd=1;Zd<=12;Zd++)El[Zd+111]=El[Zd+63235]="F"+Zd;var sa={};sa.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"},sa.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"},sa.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"},sa.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"]},sa.default=ct?sa.macDefault:sa.pcDefault;function fg(it){var st=it.split(/-(?!$)/);it=st[st.length-1];for(var dt,ht,gt,wt,bt=0;bt<st.length-1;bt++){var Ot=st[bt];if(/^(cmd|meta|m)$/i.test(Ot))wt=!0;else if(/^a(lt)?$/i.test(Ot))dt=!0;else if(/^(c|ctrl|control)$/i.test(Ot))ht=!0;else if(/^s(hift)?$/i.test(Ot))gt=!0;else throw new Error("Unrecognized modifier name: "+Ot)}return dt&&(it="Alt-"+it),ht&&(it="Ctrl-"+it),wt&&(it="Cmd-"+it),gt&&(it="Shift-"+it),it}function gg(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=Pn(dt.split(" "),fg),wt=0;wt<gt.length;wt++){var bt=void 0,Ot=void 0;wt==gt.length-1?(Ot=gt.join(" "),bt=ht):(Ot=gt.slice(0,wt+1).join(" "),bt="...");var Bt=st[Ot];if(!Bt)st[Ot]=bt;else if(Bt!=bt)throw new Error("Inconsistent bindings for "+Ot)}delete it[dt]}for(var Ut in st)it[Ut]=st[Ut];return it}function Da(it,st,dt,ht){st=ph(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 Da(it,st.fallthrough,dt,ht);for(var wt=0;wt<st.fallthrough.length;wt++){var bt=Da(it,st.fallthrough[wt],dt,ht);if(bt)return bt}}}function ed(it){var st=typeof it=="string"?it:El[it.keyCode];return st=="Ctrl"||st=="Alt"||st=="Shift"||st=="Mod"}function pg(it,st,dt){var ht=it;return st.altKey&&ht!="Alt"&&(it="Alt-"+it),(Ct?st.metaKey:st.ctrlKey)&&ht!="Ctrl"&&(it="Ctrl-"+it),(Ct?st.ctrlKey:st.metaKey)&&ht!="Mod"&&(it="Cmd-"+it),!dt&&st.shiftKey&&ht!="Shift"&&(it="Shift-"+it),it}function qp(it,st){if(Se&&it.keyCode==34&&it.char)return!1;var dt=El[it.keyCode];return dt==null||it.altGraphKey?!1:(it.keyCode==3&&it.code&&(dt=it.code),pg(dt,it,st))}function ph(it){return typeof it=="string"?sa[it]:it}function aa(it,st){for(var dt=it.doc.sel.ranges,ht=[],gt=0;gt<dt.length;gt++){for(var wt=st(dt[gt]);ht.length&&ae(wt.from,we(ht).to)<=0;){var bt=ht.pop();if(ae(bt.from,wt.from)<0){wt.from=bt.from;break}}ht.push(wt)}Lo(it,function(){for(var Ot=ht.length-1;Ot>=0;Ot--)ch(it.doc,"",ht[Ot].from,ht[Ot].to,"+delete");Xl(it)})}function mg(it,st,dt){var ht=mi(it.text,st+dt,dt);return ht<0||ht>it.text.length?null:ht}function Fr(it,st,dt){var ht=mg(it,st.ch,dt);return ht==null?null:new qt(st.line,ht,dt<0?"after":"before")}function Jd(it,st,dt,ht,gt){if(it){st.doc.direction=="rtl"&&(gt=-gt);var wt=yi(dt,st.doc.direction);if(wt){var bt=gt<0?we(wt):wt[0],Ot=gt<0==(bt.level==1),Bt=Ot?"after":"before",Ut;if(bt.level>0||st.doc.direction=="rtl"){var fe=pu(st,dt);Ut=gt<0?dt.text.length-1:0;var Jt=Za(st,fe,Ut).top;Ut=On(function(Te){return Za(st,fe,Te).top==Jt},gt<0==(bt.level==1)?bt.from:bt.to-1,Ut),Bt=="before"&&(Ut=mg(dt,Ut,1))}else Ut=gt<0?bt.to:bt.from;return new qt(ht,Ut,Bt)}}return new qt(ht,gt<0?dt.text.length:0,gt<0?"before":"after")}function Xc(it,st,dt,ht){var gt=yi(st,it.doc.direction);if(!gt)return Fr(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 wt=yn(gt,dt.ch,dt.sticky),bt=gt[wt];if(it.doc.direction=="ltr"&&bt.level%2==0&&(ht>0?bt.to>dt.ch:bt.from<dt.ch))return Fr(st,dt,ht);var Ot=function(Un,li){return mg(st,Un instanceof qt?Un.ch:Un,li)},Bt,Ut=function(Un){return it.options.lineWrapping?(Bt=Bt||pu(it,st),Jf(it,st,Bt,Un)):{begin:0,end:st.text.length}},fe=Ut(dt.sticky=="before"?Ot(dt,-1):dt.ch);if(it.doc.direction=="rtl"||bt.level==1){var Jt=bt.level==1==ht<0,Te=Ot(dt,Jt?1:-1);if(Te!=null&&(Jt?Te<=bt.to&&Te<=fe.end:Te>=bt.from&&Te>=fe.begin)){var Ne=Jt?"before":"after";return new qt(dt.line,Te,Ne)}}var dn=function(Un,li,ni){for(var vi=function($o,Wr){return Wr?new qt(dt.line,Ot($o,1),"before"):new qt(dt.line,$o,"after")};Un>=0&&Un<gt.length;Un+=li){var _i=gt[Un],$n=li>0==(_i.level!=1),no=$n?ni.begin:Ot(ni.end,-1);if(_i.from<=no&&no<_i.to||(no=$n?_i.from:Ot(_i.to,-1),ni.begin<=no&&no<ni.end))return vi(no,$n)}},pn=dn(wt+ht,ht,fe);if(pn)return pn;var bn=ht>0?fe.end:Ot(fe.begin,-1);return bn!=null&&!(ht>0&&bn==st.text.length)&&(pn=dn(ht>0?0:gt.length-1,ht,Ut(bn)),pn)?pn:null}var bu={selectAll:Er,singleSelection:function(it){return it.setSelection(it.getCursor("anchor"),it.getCursor("head"),Le)},killLine:function(it){return aa(it,function(st){if(st.empty()){var dt=Ge(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 aa(it,function(st){return{from:qt(st.from().line,0),to:xe(it.doc,qt(st.to().line+1,0))}})},delLineLeft:function(it){return aa(it,function(st){return{from:qt(st.from().line,0),to:st.from()}})},delWrappedLineLeft:function(it){return aa(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 aa(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 nd(it,st.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(it){return it.extendSelectionsBy(function(st){return vg(it,st.head)},{origin:"+move",bias:1})},goLineEnd:function(it){return it.extendSelectionsBy(function(st){return id(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")},hn)},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")},hn)},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/)?vg(it,st.head):ht},hn)},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 wt=dt[gt].from(),bt=Yt(it.getLine(wt.line),wt.ch,ht);st.push(le(ht-bt%ht))}it.replaceSelections(st)},defaultTab:function(it){it.somethingSelected()?it.indentSelection("add"):it.execCommand("insertTab")},transposeChars:function(it){return Lo(it,function(){for(var st=it.listSelections(),dt=[],ht=0;ht<st.length;ht++)if(st[ht].empty()){var gt=st[ht].head,wt=Ge(it.doc,gt.line).text;if(wt){if(gt.ch==wt.length&&(gt=new qt(gt.line,gt.ch-1)),gt.ch>0)gt=new qt(gt.line,gt.ch+1),it.replaceRange(wt.charAt(gt.ch-1)+wt.charAt(gt.ch-2),qt(gt.line,gt.ch-2),gt,"+transpose");else if(gt.line>it.doc.first){var bt=Ge(it.doc,gt.line-1).text;bt&&(gt=new qt(gt.line,1),it.replaceRange(wt.charAt(0)+it.doc.lineSeparator()+bt.charAt(bt.length-1),qt(gt.line-1,bt.length-1),gt,"+transpose"))}}dt.push(new Ao(gt,gt))}it.setSelections(dt)})},newlineAndIndent:function(it){return Lo(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);Xl(it)})},openLine:function(it){return it.replaceSelection(`
`,"start")},toggleOverwrite:function(it){return it.toggleOverwrite()}};function nd(it,st){var dt=Ge(it.doc,st),ht=Po(dt);return ht!=dt&&(st=ce(ht)),Jd(!0,it,ht,st,1)}function id(it,st){var dt=Ge(it.doc,st),ht=Jo(dt);return ht!=dt&&(st=ce(ht)),Jd(!0,it,dt,st,-1)}function vg(it,st){var dt=nd(it,st.line),ht=Ge(it.doc,dt.line),gt=yi(ht,it.doc.direction);if(!gt||gt[0].level==0){var wt=Math.max(dt.ch,ht.text.search(/\S/)),bt=st.line==dt.line&&st.ch<=wt&&st.ch;return qt(dt.line,bt?0:wt,dt.sticky)}return dt}function od(it,st,dt){if(typeof st=="string"&&(st=bu[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)!=Ln}finally{it.display.shift=ht,it.state.suppressEdits=!1}return gt}function yg(it,st,dt){for(var ht=0;ht<it.state.keyMaps.length;ht++){var gt=Da(st,it.state.keyMaps[ht],dt,it);if(gt)return gt}return it.options.extraKeys&&Da(st,it.options.extraKeys,dt,it)||Da(st,it.options.keyMap,dt,it)}var Fl=new jt;function mh(it,st,dt,ht){var gt=it.state.keySeq;if(gt){if(ed(st))return"handled";if(/\'$/.test(st)?it.state.keySeq=null:Fl.set(50,function(){it.state.keySeq==gt&&(it.state.keySeq=null,it.display.input.reset())}),Zc(it,gt+" "+st,dt,ht))return!0}return Zc(it,st,dt,ht)}function Zc(it,st,dt,ht){var gt=yg(it,st,ht);return gt=="multi"&&(it.state.keySeq=st),gt=="handled"&&qn(it,"keyHandled",it,st,dt),(gt=="handled"||gt=="multi")&&(sr(dt),bo(it)),!!gt}function Jc(it,st){var dt=qp(st,!0);return dt?st.shiftKey&&!it.state.keySeq?mh(it,"Shift-"+dt,st,function(ht){return od(it,ht,!0)})||mh(it,dt,st,function(ht){if(typeof ht=="string"?/^go[A-Z]/.test(ht):ht.motion)return od(it,ht)}):mh(it,dt,st,function(ht){return od(it,ht)}):!1}function Qc(it,st,dt){return mh(it,"'"+dt+"'",st,function(ht){return od(it,ht,!0)})}var vh=null;function Sg(it){var st=this;if(!(it.target&&it.target!=st.display.input.getField())&&(st.curOp.focus=He(),!$i(st,it))){me&&re<11&&it.keyCode==27&&(it.returnValue=!1);var dt=it.keyCode;st.display.shift=dt==16||it.shiftKey;var ht=Jc(st,it);Se&&(vh=ht?dt:null,!ht&&dt==88&&!Sn&&(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)&&xg(st)}}function xg(it){var st=it.display.lineDiv;ze(st,"CodeMirror-crosshair");function dt(ht){(ht.keyCode==18||!ht.altKey)&&(Ht(st,"CodeMirror-crosshair"),Mo(document,"keyup",dt),Mo(document,"mouseover",dt))}Jn(document,"keyup",dt),Jn(document,"mouseover",dt)}function Pg(it){it.keyCode==16&&(this.doc.sel.shift=!1),$i(this,it)}function cl(it){var st=this;if(!(it.target&&it.target!=st.display.input.getField())&&!(ea(st.display,it)||$i(st,it)||it.ctrlKey&&!it.altKey||ct&&it.metaKey)){var dt=it.keyCode,ht=it.charCode;if(Se&&dt==vh){vh=null,sr(it);return}if(!(Se&&(!it.which||it.which<10)&&Jc(st,it))){var gt=String.fromCharCode(ht==null?dt:ht);gt!="\b"&&(Qc(st,it,gt)||st.display.input.onKeyPress(it))}}}var $p=400,wg=function(it,st,dt){this.time=it,this.pos=st,this.button=dt};wg.prototype.compare=function(it,st,dt){return this.time+$p>it&&ae(st,this.pos)==0&&dt==this.button};var rd,yh;function Cg(it,st){var dt=+new Date;return yh&&yh.compare(dt,it,st)?(rd=yh=null,"triple"):rd&&rd.compare(dt,it,st)?(yh=new wg(dt,it,st),rd=null,"double"):(rd=new wg(dt,it,st),yh=null,"single")}function fl(it){var st=this,dt=st.display;if(!($i(st,it)||dt.activeTouch&&dt.input.supportsTouch())){if(dt.input.ensurePolled(),dt.shift=it.shiftKey,ea(dt,it)){Zt||(dt.scroller.draggable=!1,setTimeout(function(){return dt.scroller.draggable=!0},100));return}if(!tf(st,it)){var ht=As(st,it),gt=jr(it),wt=ht?Cg(ht,gt):"single";window.focus(),gt==1&&st.state.selectingText&&st.state.selectingText(it),!(ht&&Lg(st,gt,ht,wt,it))&&(gt==1?ht?tm(st,ht,wt,it):Ns(it)==dt.scroller&&sr(it):gt==2?(ht&&Vc(st.doc,ht),setTimeout(function(){return dt.input.focus()},20)):gt==3&&(Nt?st.display.input.onContextMenu(it):ir(st)))}}}function Lg(it,st,dt,ht,gt){var wt="Click";return ht=="double"?wt="Double"+wt:ht=="triple"&&(wt="Triple"+wt),wt=(st==1?"Left":st==2?"Middle":"Right")+wt,mh(it,pg(wt,gt),gt,function(bt){if(typeof bt=="string"&&(bt=bu[bt]),!bt)return!1;var Ot=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),Ot=bt(it,dt)!=Ln}finally{it.state.suppressEdits=!1}return Ot})}function qc(it,st,dt){var ht=it.getOption("configureMouse"),gt=ht?ht(it,st,dt):{};if(gt.unit==null){var wt=lt?dt.shiftKey&&dt.metaKey:dt.altKey;gt.unit=wt?"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){me?setTimeout(Xn(Uo,it),0):it.curOp.focus=He();var gt=qc(it,dt,ht),wt=it.doc.sel,bt;it.options.dragDrop&&Va&&!it.isReadOnly()&&dt=="single"&&(bt=wt.contains(st))>-1&&(ae((bt=wt.ranges[bt]).from(),st)<0||st.xRel>0)&&(ae(bt.to(),st)>0||st.xRel<0)?kg(it,ht,st,gt):ev(it,ht,st,gt)}function kg(it,st,dt,ht){var gt=it.display,wt=!1,bt=Gr(it,function(Ut){Zt&&(gt.scroller.draggable=!1),it.state.draggingText=!1,Mo(gt.wrapper.ownerDocument,"mouseup",bt),Mo(gt.wrapper.ownerDocument,"mousemove",Ot),Mo(gt.scroller,"dragstart",Bt),Mo(gt.scroller,"drop",bt),wt||(sr(Ut),ht.addNew||Vc(it.doc,dt,null,null,ht.extend),Zt&&!Ue||me&&re==9?setTimeout(function(){gt.wrapper.ownerDocument.body.focus({preventScroll:!0}),gt.input.focus()},20):gt.input.focus())}),Ot=function(Ut){wt=wt||Math.abs(st.clientX-Ut.clientX)+Math.abs(st.clientY-Ut.clientY)>=10},Bt=function(){return wt=!0};Zt&&(gt.scroller.draggable=!0),it.state.draggingText=bt,bt.copy=!ht.moveOnDrag,gt.scroller.dragDrop&&gt.scroller.dragDrop(),Jn(gt.wrapper.ownerDocument,"mouseup",bt),Jn(gt.wrapper.ownerDocument,"mousemove",Ot),Jn(gt.scroller,"dragstart",Bt),Jn(gt.scroller,"drop",bt),ir(it),setTimeout(function(){return gt.input.focus()},20)}function Mg(it,st,dt){if(dt=="char")return new Ao(st,st);if(dt=="word")return it.findWordAt(st);if(dt=="line")return new Ao(qt(st.line,0),xe(it.doc,qt(st.line+1,0)));var ht=dt(it,st);return new Ao(ht.from,ht.to)}function ev(it,st,dt,ht){var gt=it.display,wt=it.doc;sr(st);var bt,Ot,Bt=wt.sel,Ut=Bt.ranges;if(ht.addNew&&!ht.extend?(Ot=wt.sel.contains(dt),Ot>-1?bt=Ut[Ot]:bt=new Ao(dt,dt)):(bt=wt.sel.primary(),Ot=wt.sel.primIndex),ht.unit=="rectangle")ht.addNew||(bt=new Ao(dt,dt)),dt=As(it,st,!0,!0),Ot=-1;else{var fe=Mg(it,dt,ht.unit);ht.extend?bt=Wc(bt,fe.anchor,fe.head,ht.extend):bt=fe}ht.addNew?Ot==-1?(Ot=Ut.length,ws(wt,Ja(it,Ut.concat([bt]),Ot),{scroll:!1,origin:"*mouse"})):Ut.length>1&&Ut[Ot].empty()&&ht.unit=="char"&&!ht.extend?(ws(wt,Ja(it,Ut.slice(0,Ot).concat(Ut.slice(Ot+1)),0),{scroll:!1,origin:"*mouse"}),Bt=wt.sel):Fu(wt,Ot,bt,nn):(Ot=0,ws(wt,new Aa([bt],0),nn),Bt=wt.sel);var Jt=dt;function Te(ni){if(ae(Jt,ni)!=0)if(Jt=ni,ht.unit=="rectangle"){for(var vi=[],_i=it.options.tabSize,$n=Yt(Ge(wt,dt.line).text,dt.ch,_i),no=Yt(Ge(wt,ni.line).text,ni.ch,_i),$o=Math.min($n,no),Wr=Math.max($n,no),dr=Math.min(dt.line,ni.line),Xs=Math.min(it.lastLine(),Math.max(dt.line,ni.line));dr<=Xs;dr++){var Cs=Ge(wt,dr).text,Br=_n(Cs,$o,_i);$o==Wr?vi.push(new Ao(qt(dr,Br),qt(dr,Br))):Cs.length>Br&&vi.push(new Ao(qt(dr,Br),qt(dr,_n(Cs,Wr,_i))))}vi.length||vi.push(new Ao(dt,dt)),ws(wt,Ja(it,Bt.ranges.slice(0,Ot).concat(vi),Ot),{origin:"*mouse",scroll:!1}),it.scrollIntoView(ni)}else{var la=bt,gs=Mg(it,ni,ht.unit),Dr=la.anchor,Co;ae(gs.anchor,Dr)>0?(Co=gs.head,Dr=gn(la.from(),gs.anchor)):(Co=gs.anchor,Dr=Ai(la.to(),gs.head));var vr=Bt.ranges.slice(0);vr[Ot]=em(it,new Ao(xe(wt,Dr),Co)),ws(wt,Ja(it,vr,Ot),nn)}}var Ne=gt.wrapper.getBoundingClientRect(),dn=0;function pn(ni){var vi=++dn,_i=As(it,ni,!0,ht.unit=="rectangle");if(_i)if(ae(_i,Jt)!=0){it.curOp.focus=He(),Te(_i);var $n=lo(gt,wt);(_i.line>=$n.to||_i.line<$n.from)&&setTimeout(Gr(it,function(){dn==vi&&pn(ni)}),150)}else{var no=ni.clientY<Ne.top?-20:ni.clientY>Ne.bottom?20:0;no&&setTimeout(Gr(it,function(){dn==vi&&(gt.scroller.scrollTop+=no,pn(ni))}),50)}}function bn(ni){it.state.selectingText=!1,dn=1/0,ni&&(sr(ni),gt.input.focus()),Mo(gt.wrapper.ownerDocument,"mousemove",Un),Mo(gt.wrapper.ownerDocument,"mouseup",li),wt.history.lastSelOrigin=null}var Un=Gr(it,function(ni){ni.buttons===0||!jr(ni)?bn(ni):pn(ni)}),li=Gr(it,bn);it.state.selectingText=li,Jn(gt.wrapper.ownerDocument,"mousemove",Un),Jn(gt.wrapper.ownerDocument,"mouseup",li)}function em(it,st){var dt=st.anchor,ht=st.head,gt=Ge(it.doc,dt.line);if(ae(dt,ht)==0&&dt.sticky==ht.sticky)return st;var wt=yi(gt);if(!wt)return st;var bt=yn(wt,dt.ch,dt.sticky),Ot=wt[bt];if(Ot.from!=dt.ch&&Ot.to!=dt.ch)return st;var Bt=bt+(Ot.from==dt.ch==(Ot.level!=1)?0:1);if(Bt==0||Bt==wt.length)return st;var Ut;if(ht.line!=dt.line)Ut=(ht.line-dt.line)*(it.doc.direction=="ltr"?1:-1)>0;else{var fe=yn(wt,ht.ch,ht.sticky),Jt=fe-bt||(ht.ch-dt.ch)*(Ot.level==1?-1:1);fe==Bt-1||fe==Bt?Ut=Jt<0:Ut=Jt>0}var Te=wt[Bt+(Ut?-1:0)],Ne=Ut==(Te.level==1),dn=Ne?Te.from:Te.to,pn=Ne?"after":"before";return dt.ch==dn&&dt.sticky==pn?st:new Ao(new qt(dt.line,dn,pn),ht)}function $c(it,st,dt,ht){var gt,wt;if(st.touches)gt=st.touches[0].clientX,wt=st.touches[0].clientY;else try{gt=st.clientX,wt=st.clientY}catch(Te){return!1}if(gt>=Math.floor(it.display.gutters.getBoundingClientRect().right))return!1;ht&&sr(st);var bt=it.display,Ot=bt.lineDiv.getBoundingClientRect();if(wt>Ot.bottom||!No(it,dt))return Vi(st);wt-=Ot.top-bt.viewOffset;for(var Bt=0;Bt<it.display.gutterSpecs.length;++Bt){var Ut=bt.gutters.childNodes[Bt];if(Ut&&Ut.getBoundingClientRect().right>=gt){var fe=Tn(it.doc,wt),Jt=it.display.gutterSpecs[Bt];return ao(it,dt,it,fe,Jt.className,st),Vi(st)}}}function tf(it,st){return $c(it,st,"gutterClick",!0)}function ef(it,st){ea(it.display,st)||nm(it,st)||$i(it,st,"contextmenu")||Nt||it.display.input.onContextMenu(st)}function nm(it,st){return No(it,"gutterContextMenu")?$c(it,st,"gutterContextMenu",!1):!1}function nf(it){it.display.wrapper.className=it.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+it.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Uh(it)}var Tu={toString:function(){return"CodeMirror.Init"}},Eg={},Qd={};function im(it){var st=it.optionHandlers;function dt(ht,gt,wt,bt){it.defaults[ht]=gt,wt&&(st[ht]=bt?function(Ot,Bt,Ut){Ut!=Tu&&wt(Ot,Bt,Ut)}:wt)}it.defineOption=dt,it.Init=Tu,dt("value","",function(ht,gt){return ht.setValue(gt)},!0),dt("mode",null,function(ht,gt){ht.doc.modeOption=gt,eo(ht)},!0),dt("indentUnit",2,eo,!0),dt("indentWithTabs",!1),dt("smartIndent",!0),dt("tabSize",4,function(ht){jd(ht),Uh(ht),qo(ht)},!0),dt("lineSeparator",null,function(ht,gt){if(ht.doc.lineSep=gt,!!gt){var wt=[],bt=ht.doc.first;ht.doc.iter(function(Bt){for(var Ut=0;;){var fe=Bt.text.indexOf(gt,Ut);if(fe==-1)break;Ut=fe+gt.length,wt.push(qt(bt,fe))}bt++});for(var Ot=wt.length-1;Ot>=0;Ot--)ch(ht.doc,gt,wt[Ot],qt(wt[Ot].line,wt[Ot].ch+gt.length))}}),dt("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(ht,gt,wt){ht.state.specialChars=new RegExp(gt.source+(gt.test(" ")?"":"| "),"g"),wt!=Tu&&ht.refresh()}),dt("specialCharPlaceholder",Vo,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){nf(ht),ya(ht)},!0),dt("keyMap","default",function(ht,gt,wt){var bt=ph(gt),Ot=wt!=Tu&&ph(wt);Ot&&Ot.detach&&Ot.detach(ht,bt),bt.attach&&bt.attach(ht,Ot||null)}),dt("extraKeys",null),dt("configureMouse",null),dt("lineWrapping",!1,om,!0),dt("gutters",[],function(ht,gt){ht.display.gutterSpecs=Qr(gt,ht.options.lineNumbers),ya(ht)},!0),dt("fixedGutter",!0,function(ht,gt){ht.display.gutters.style.left=gt?Bd(ht.display)+"px":"0",ht.refresh()},!0),dt("coverGutterNextToScrollbar",!1,function(ht){return yu(ht)},!0),dt("scrollbarStyle","native",function(ht){tg(ht),yu(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=Qr(ht.options.gutters,gt),ya(ht)},!0),dt("firstLineNumber",1,ya,!0),dt("lineNumberFormatter",function(ht){return ht},ya,!0),dt("showCursorWhenSelecting",!1,_r,!0),dt("resetSelectionOnContextMenu",!0),dt("lineWiseCopyCut",!0),dt("pasteLinesPerSelection",!0),dt("selectionsMayTouch",!1),dt("readOnly",!1,function(ht,gt){gt=="nocursor"&&(ih(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,of),dt("allowDropFileTypes",null),dt("cursorBlinkRate",530),dt("cursorScrollMargin",0),dt("cursorHeight",1,_r,!0),dt("singleCursorHeightPerLine",!0,_r,!0),dt("workTime",100),dt("workDelay",100),dt("flattenSpans",!0,jd,!0),dt("addModeClass",!1,jd,!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,jd,!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 of(it,st,dt){var ht=dt&&dt!=Tu;if(!st!=!ht){var gt=it.display.dragFunctions,wt=st?Jn:Mo;wt(it.display.scroller,"dragstart",gt.start),wt(it.display.scroller,"dragenter",gt.enter),wt(it.display.scroller,"dragover",gt.over),wt(it.display.scroller,"dragleave",gt.leave),wt(it.display.scroller,"drop",gt.drop)}}function om(it){it.options.lineWrapping?(ze(it.display.wrapper,"CodeMirror-wrap"),it.display.sizer.style.minWidth="",it.display.sizerWidth=null):(Ht(it.display.wrapper,"CodeMirror-wrap"),Eo(it)),Mi(it),qo(it),Uh(it),setTimeout(function(){return yu(it)},100)}function xo(it,st){var dt=this;if(!(this instanceof xo))return new xo(it,st);this.options=st=st?Ni(st):{},Ni(Eg,st,!1);var ht=st.value;typeof ht=="string"?ht=new fs(ht,st.mode,null,st.lineSeparator,st.direction):st.mode&&(ht.modeOption=st.mode),this.doc=ht;var gt=new xo.inputStyles[st.inputStyle](this),wt=this.display=new ku(it,ht,gt,st);wt.wrapper.CodeMirror=this,nf(this),st.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),tg(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 jt,keySeq:null,specialChars:null},st.autofocus&&!nt&&wt.input.focus(),me&&re<11&&setTimeout(function(){return dt.display.input.reset(!0)},20),sd(this),xa(),Su(this),this.curOp.forceUpdate=!0,_c(this,ht),st.autofocus&&!nt||this.hasFocus()?setTimeout(function(){dt.hasFocus()&&!dt.state.focused&&co(dt)},20):ih(this);for(var bt in Qd)Qd.hasOwnProperty(bt)&&Qd[bt](this,st[bt],Tu);br(this),st.finishInit&&st.finishInit(this);for(var Ot=0;Ot<Sh.length;++Ot)Sh[Ot](this);xu(this),Zt&&st.lineWrapping&&getComputedStyle(wt.lineDiv).textRendering=="optimizelegibility"&&(wt.lineDiv.style.textRendering="auto")}xo.defaults=Eg,xo.optionHandlers=Qd;function sd(it){var st=it.display;Jn(st.scroller,"mousedown",Gr(it,fl)),me&&re<11?Jn(st.scroller,"dblclick",Gr(it,function(Bt){if(!$i(it,Bt)){var Ut=As(it,Bt);if(!(!Ut||tf(it,Bt)||ea(it.display,Bt))){sr(Bt);var fe=it.findWordAt(Ut);Vc(it.doc,fe.anchor,fe.head)}}})):Jn(st.scroller,"dblclick",function(Bt){return $i(it,Bt)||sr(Bt)}),Jn(st.scroller,"contextmenu",function(Bt){return ef(it,Bt)}),Jn(st.input.getField(),"contextmenu",function(Bt){st.scroller.contains(Bt.target)||ef(it,Bt)});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 wt(Bt){if(Bt.touches.length!=1)return!1;var Ut=Bt.touches[0];return Ut.radiusX<=1&&Ut.radiusY<=1}function bt(Bt,Ut){if(Ut.left==null)return!0;var fe=Ut.left-Bt.left,Jt=Ut.top-Bt.top;return fe*fe+Jt*Jt>20*20}Jn(st.scroller,"touchstart",function(Bt){if(!$i(it,Bt)&&!wt(Bt)&&!tf(it,Bt)){st.input.ensurePolled(),clearTimeout(dt);var Ut=+new Date;st.activeTouch={start:Ut,moved:!1,prev:Ut-ht.end<=300?ht:null},Bt.touches.length==1&&(st.activeTouch.left=Bt.touches[0].pageX,st.activeTouch.top=Bt.touches[0].pageY)}}),Jn(st.scroller,"touchmove",function(){st.activeTouch&&(st.activeTouch.moved=!0)}),Jn(st.scroller,"touchend",function(Bt){var Ut=st.activeTouch;if(Ut&&!ea(st,Bt)&&Ut.left!=null&&!Ut.moved&&new Date-Ut.start<300){var fe=it.coordsChar(st.activeTouch,"page"),Jt;!Ut.prev||bt(Ut,Ut.prev)?Jt=new Ao(fe,fe):!Ut.prev.prev||bt(Ut,Ut.prev.prev)?Jt=it.findWordAt(fe):Jt=new Ao(qt(fe.line,0),xe(it.doc,qt(fe.line+1,0))),it.setSelection(Jt.anchor,Jt.head),it.focus(),sr(Bt)}gt()}),Jn(st.scroller,"touchcancel",gt),Jn(st.scroller,"scroll",function(){st.scroller.clientHeight&&(rh(it,st.scroller.scrollTop),Zl(it,st.scroller.scrollLeft,!0),ao(it,"scroll",it))}),Jn(st.scroller,"mousewheel",function(Bt){return qr(it,Bt)}),Jn(st.scroller,"DOMMouseScroll",function(Bt){return qr(it,Bt)}),Jn(st.wrapper,"scroll",function(){return st.wrapper.scrollTop=st.wrapper.scrollLeft=0}),st.dragFunctions={enter:function(Bt){$i(it,Bt)||Ir(Bt)},over:function(Bt){$i(it,Bt)||(Zp(it,Bt),Ir(Bt))},start:function(Bt){return Xp(it,Bt)},drop:Gr(it,hg),leave:function(Bt){$i(it,Bt)||Jp(it)}};var Ot=st.input.getField();Jn(Ot,"keyup",function(Bt){return Pg.call(it,Bt)}),Jn(Ot,"keydown",Gr(it,Sg)),Jn(Ot,"keypress",Gr(it,cl)),Jn(Ot,"focus",function(Bt){return co(it,Bt)}),Jn(Ot,"blur",function(Bt){return ih(it,Bt)})}var Sh=[];xo.defineInitHook=function(it){return Sh.push(it)};function Hr(it,st,dt,ht){var gt=it.doc,wt;dt==null&&(dt="add"),dt=="smart"&&(gt.mode.indent?wt=Qi(it,st).state:dt="prev");var bt=it.options.tabSize,Ot=Ge(gt,st),Bt=Yt(Ot.text,null,bt);Ot.stateAfter&&(Ot.stateAfter=null);var Ut=Ot.text.match(/^\s*/)[0],fe;if(!ht&&!/\S/.test(Ot.text))fe=0,dt="not";else if(dt=="smart"&&(fe=gt.mode.indent(wt,Ot.text.slice(Ut.length),Ot.text),fe==Ln||fe>150)){if(!ht)return;dt="prev"}dt=="prev"?st>gt.first?fe=Yt(Ge(gt,st-1).text,null,bt):fe=0:dt=="add"?fe=Bt+it.options.indentUnit:dt=="subtract"?fe=Bt-it.options.indentUnit:typeof dt=="number"&&(fe=Bt+dt),fe=Math.max(0,fe);var Jt="",Te=0;if(it.options.indentWithTabs)for(var Ne=Math.floor(fe/bt);Ne;--Ne)Te+=bt,Jt+=" ";if(Te<fe&&(Jt+=le(fe-Te)),Jt!=Ut)return ch(gt,Jt,qt(st,0),qt(st,Ut.length),"+input"),Ot.stateAfter=null,!0;for(var dn=0;dn<gt.sel.ranges.length;dn++){var pn=gt.sel.ranges[dn];if(pn.head.line==st&&pn.head.ch<Ut.length){var bn=qt(st,Ut.length);Fu(gt,dn,new Ao(bn,bn));break}}}var Ks=null;function xh(it){Ks=it}function qd(it,st,dt,ht,gt){var wt=it.doc;it.display.shift=!1,ht||(ht=wt.sel);var bt=+new Date-200,Ot=gt=="paste"||it.state.pasteIncoming>bt,Bt=We(st),Ut=null;if(Ot&&ht.ranges.length>1)if(Ks&&Ks.text.join(`
`)==st){if(ht.ranges.length%Ks.text.length==0){Ut=[];for(var fe=0;fe<Ks.text.length;fe++)Ut.push(wt.splitLines(Ks.text[fe]))}}else Bt.length==ht.ranges.length&&it.options.pasteLinesPerSelection&&(Ut=Pn(Bt,function(Un){return[Un]}));for(var Jt=it.curOp.updateInput,Te=ht.ranges.length-1;Te>=0;Te--){var Ne=ht.ranges[Te],dn=Ne.from(),pn=Ne.to();Ne.empty()&&(dt&&dt>0?dn=qt(dn.line,dn.ch-dt):it.state.overwrite&&!Ot?pn=qt(pn.line,Math.min(Ge(wt,pn.line).text.length,pn.ch+we(Bt).length)):Ot&&Ks&&Ks.lineWise&&Ks.text.join(`
`)==Bt.join(`
`)&&(dn=pn=qt(dn.line,0)));var bn={from:dn,to:pn,text:Ut?Ut[Te%Ut.length]:Bt,origin:gt||(Ot?"paste":it.state.cutIncoming>bt?"cut":"+input")};Nu(it.doc,bn),qn(it,"inputRead",it,bn)}st&&!Ot&&Ng(it,st),Xl(it),it.curOp.updateInput<2&&(it.curOp.updateInput=Jt),it.curOp.typing=!0,it.state.pasteIncoming=it.state.cutIncoming=-1}function Fg(it,st){var dt=it.clipboardData&&it.clipboardData.getData("Text");if(dt)return it.preventDefault(),!st.isReadOnly()&&!st.options.disableInput&&Lo(st,function(){return qd(st,dt,0,null,"paste")}),!0}function Ng(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 wt=it.getModeAt(gt.head),bt=!1;if(wt.electricChars){for(var Ot=0;Ot<wt.electricChars.length;Ot++)if(st.indexOf(wt.electricChars.charAt(Ot))>-1){bt=Hr(it,gt.head.line,"smart");break}}else wt.electricInput&&wt.electricInput.test(Ge(it.doc,gt.head.line).text.slice(0,gt.head.ch))&&(bt=Hr(it,gt.head.line,"smart"));bt&&qn(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,wt={anchor:qt(gt,0),head:qt(gt+1,0)};dt.push(wt),st.push(it.getRange(wt.anchor,wt.head))}return{text:st,ranges:dt}}function Tg(it,st,dt,ht){it.setAttribute("autocorrect",dt?"":"off"),it.setAttribute("autocapitalize",ht?"":"off"),it.setAttribute("spellcheck",!!st)}function Ag(){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 Zt?it.style.width="1000px":it.setAttribute("wrap","off"),Ft&&(it.style.border="1px solid black"),Tg(it),st}function Au(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 wt=this.options,bt=wt[ht];wt[ht]==gt&&ht!="mode"||(wt[ht]=gt,st.hasOwnProperty(ht)&&Gr(this,st[ht])(this,gt,bt),ao(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"](ph(ht))},removeKeyMap:function(ht){for(var gt=this.state.keyMaps,wt=0;wt<gt.length;++wt)if(gt[wt]==ht||gt[wt].name==ht)return gt.splice(wt,1),!0},addOverlay:Xr(function(ht,gt){var wt=ht.token?ht:it.getMode(this.options,ht);if(wt.startState)throw new Error("Overlays may not be stateful.");vn(this.state.overlays,{mode:wt,modeSpec:ht,opaque:gt&&gt.opaque,priority:gt&&gt.priority||0},function(bt){return bt.priority}),this.state.modeGen++,qo(this)}),removeOverlay:Xr(function(ht){for(var gt=this.state.overlays,wt=0;wt<gt.length;++wt){var bt=gt[wt].modeSpec;if(bt==ht||typeof ht=="string"&&bt.name==ht){gt.splice(wt,1),this.state.modeGen++,qo(this);return}}}),indentLine:Xr(function(ht,gt,wt){typeof gt!="string"&&typeof gt!="number"&&(gt==null?gt=this.options.smartIndent?"smart":"prev":gt=gt?"add":"subtract"),ti(this.doc,ht)&&Hr(this,ht,gt,wt)}),indentSelection:Xr(function(ht){for(var gt=this.doc.sel.ranges,wt=-1,bt=0;bt<gt.length;bt++){var Ot=gt[bt];if(Ot.empty())Ot.head.line>wt&&(Hr(this,Ot.head.line,ht,!0),wt=Ot.head.line,bt==this.doc.sel.primIndex&&Xl(this));else{var Bt=Ot.from(),Ut=Ot.to(),fe=Math.max(wt,Bt.line);wt=Math.min(this.lastLine(),Ut.line-(Ut.ch?0:1))+1;for(var Jt=fe;Jt<wt;++Jt)Hr(this,Jt,ht);var Te=this.doc.sel.ranges;Bt.ch==0&&gt.length==Te.length&&Te[bt].from().ch>0&&Fu(this.doc,bt,new Ao(Bt,Te[bt].to()),Le)}}}),getTokenAt:function(ht,gt){return Ri(this,ht,gt)},getLineTokens:function(ht,gt){return Ri(this,qt(ht),gt,!0)},getTokenTypeAt:function(ht){ht=xe(this.doc,ht);var gt=Bi(this,Ge(this.doc,ht.line)),wt=0,bt=(gt.length-1)/2,Ot=ht.ch,Bt;if(Ot==0)Bt=gt[2];else for(;;){var Ut=wt+bt>>1;if((Ut?gt[Ut*2-1]:0)>=Ot)bt=Ut;else if(gt[Ut*2+1]<Ot)wt=Ut+1;else{Bt=gt[Ut*2+2];break}}var fe=Bt?Bt.indexOf("overlay "):-1;return fe<0?Bt:fe==0?null:Bt.slice(0,fe-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 wt=[];if(!dt.hasOwnProperty(gt))return wt;var bt=dt[gt],Ot=this.getModeAt(ht);if(typeof Ot[gt]=="string")bt[Ot[gt]]&&wt.push(bt[Ot[gt]]);else if(Ot[gt])for(var Bt=0;Bt<Ot[gt].length;Bt++){var Ut=bt[Ot[gt][Bt]];Ut&&wt.push(Ut)}else Ot.helperType&&bt[Ot.helperType]?wt.push(bt[Ot.helperType]):bt[Ot.name]&&wt.push(bt[Ot.name]);for(var fe=0;fe<bt._global.length;fe++){var Jt=bt._global[fe];Jt.pred(Ot,this)&&Ce(wt,Jt.val)==-1&&wt.push(Jt.val)}return wt},getStateAfter:function(ht,gt){var wt=this.doc;return ht=Ye(wt,ht==null?wt.first+wt.size-1:ht),Qi(this,ht+1,gt).state},cursorCoords:function(ht,gt){var wt,bt=this.doc.sel.primary();return ht==null?wt=bt.head:typeof ht=="object"?wt=xe(this.doc,ht):wt=ht?bt.from():bt.to(),ur(this,wt,gt||"page")},charCoords:function(ht,gt){return Ad(this,xe(this.doc,ht),gt||"page")},coordsChar:function(ht,gt){return ht=Nc(this,ht,gt||"page"),Ac(this,ht.left,ht.top)},lineAtHeight:function(ht,gt){return ht=Nc(this,{top:ht,left:0},gt||"page").top,Tn(this.doc,ht+this.display.viewOffset)},heightAtLine:function(ht,gt,wt){var bt=!1,Ot;if(typeof ht=="number"){var Bt=this.doc.first+this.doc.size-1;ht<this.doc.first?ht=this.doc.first:ht>Bt&&(ht=Bt,bt=!0),Ot=Ge(this.doc,ht)}else Ot=ht;return cs(this,Ot,{top:0,left:0},gt||"page",wt||bt).top+(bt?this.doc.height-vo(Ot):0)},defaultTextHeight:function(){return Kl(this.display)},defaultCharWidth:function(){return nh(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(ht,gt,wt,bt,Ot){var Bt=this.display;ht=ur(this,xe(this.doc,ht));var Ut=ht.bottom,fe=ht.left;if(gt.style.position="absolute",gt.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(gt),Bt.sizer.appendChild(gt),bt=="over")Ut=ht.top;else if(bt=="above"||bt=="near"){var Jt=Math.max(Bt.wrapper.clientHeight,this.doc.height),Te=Math.max(Bt.sizer.clientWidth,Bt.lineSpace.clientWidth);(bt=="above"||ht.bottom+gt.offsetHeight>Jt)&&ht.top>gt.offsetHeight?Ut=ht.top-gt.offsetHeight:ht.bottom+gt.offsetHeight<=Jt&&(Ut=ht.bottom),fe+gt.offsetWidth>Te&&(fe=Te-gt.offsetWidth)}gt.style.top=Ut+"px",gt.style.left=gt.style.right="",Ot=="right"?(fe=Bt.sizer.clientWidth-gt.offsetWidth,gt.style.right="0px"):(Ot=="left"?fe=0:Ot=="middle"&&(fe=(Bt.sizer.clientWidth-gt.offsetWidth)/2),gt.style.left=fe+"px"),wt&&Dd(this,{left:fe,top:Ut,right:fe+gt.offsetWidth,bottom:Ut+gt.offsetHeight})},triggerOnKeyDown:Xr(Sg),triggerOnKeyPress:Xr(cl),triggerOnKeyUp:Pg,triggerOnMouseDown:Xr(fl),execCommand:function(ht){if(bu.hasOwnProperty(ht))return bu[ht].call(null,this)},triggerElectric:Xr(function(ht){Ng(this,ht)}),findPosH:function(ht,gt,wt,bt){var Ot=1;gt<0&&(Ot=-1,gt=-gt);for(var Bt=xe(this.doc,ht),Ut=0;Ut<gt&&(Bt=$d(this.doc,Bt,Ot,wt,bt),!Bt.hitSide);++Ut);return Bt},moveH:Xr(function(ht,gt){var wt=this;this.extendSelectionsBy(function(bt){return wt.display.shift||wt.doc.extend||bt.empty()?$d(wt.doc,bt.head,ht,gt,wt.options.rtlMoveVisually):ht<0?bt.from():bt.to()},hn)}),deleteH:Xr(function(ht,gt){var wt=this.doc.sel,bt=this.doc;wt.somethingSelected()?bt.replaceSelection("",null,"+delete"):aa(this,function(Ot){var Bt=$d(bt,Ot.head,ht,gt,!1);return ht<0?{from:Bt,to:Ot.head}:{from:Ot.head,to:Bt}})}),findPosV:function(ht,gt,wt,bt){var Ot=1,Bt=bt;gt<0&&(Ot=-1,gt=-gt);for(var Ut=xe(this.doc,ht),fe=0;fe<gt;++fe){var Jt=ur(this,Ut,"div");if(Bt==null?Bt=Jt.left:Jt.left=Bt,Ut=Bu(this,Jt,Ot,wt),Ut.hitSide)break}return Ut},moveV:Xr(function(ht,gt){var wt=this,bt=this.doc,Ot=[],Bt=!this.display.shift&&!bt.extend&&bt.sel.somethingSelected();if(bt.extendSelectionsBy(function(fe){if(Bt)return ht<0?fe.from():fe.to();var Jt=ur(wt,fe.head,"div");fe.goalColumn!=null&&(Jt.left=fe.goalColumn),Ot.push(Jt.left);var Te=Bu(wt,Jt,ht,gt);return gt=="page"&&fe==bt.sel.primary()&&Dc(wt,Ad(wt,Te,"div").top-Jt.top),Te},hn),Ot.length)for(var Ut=0;Ut<bt.sel.ranges.length;Ut++)bt.sel.ranges[Ut].goalColumn=Ot[Ut]}),findWordAt:function(ht){var gt=this.doc,wt=Ge(gt,ht.line).text,bt=ht.ch,Ot=ht.ch;if(wt){var Bt=this.getHelper(ht,"wordChars");(ht.sticky=="before"||Ot==wt.length)&&bt?--bt:++Ot;for(var Ut=wt.charAt(bt),fe=Wt(Ut,Bt)?function(Jt){return Wt(Jt,Bt)}:/\s/.test(Ut)?function(Jt){return/\s/.test(Jt)}:function(Jt){return!/\s/.test(Jt)&&!Wt(Jt)};bt>0&&fe(wt.charAt(bt-1));)--bt;for(;Ot<wt.length&&fe(wt.charAt(Ot));)++Ot}return new Ao(qt(ht.line,bt),qt(ht.line,Ot))},toggleOverwrite:function(ht){ht!=null&&ht==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?ze(this.display.cursorDiv,"CodeMirror-overwrite"):Ht(this.display.cursorDiv,"CodeMirror-overwrite"),ao(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==He()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Xr(function(ht,gt){oh(this,ht,gt)}),getScrollInfo:function(){var ht=this.display.scroller;return{left:ht.scrollLeft,top:ht.scrollTop,height:ht.scrollHeight-ia(this)-this.display.barHeight,width:ht.scrollWidth-ia(this)-this.display.barWidth,clientHeight:Nd(this),clientWidth:Xa(this)}},scrollIntoView:Xr(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?fo(this,ht):Oc(this,ht.from,ht.to,ht.margin)}),setSize:Xr(function(ht,gt){var wt=this,bt=function(Bt){return typeof Bt=="number"||/^\d+$/.test(String(Bt))?Bt+"px":Bt};ht!=null&&(this.display.wrapper.style.width=bt(ht)),gt!=null&&(this.display.wrapper.style.height=bt(gt)),this.options.lineWrapping&&Td(this);var Ot=this.display.viewFrom;this.doc.iter(Ot,this.display.viewTo,function(Bt){if(Bt.widgets){for(var Ut=0;Ut<Bt.widgets.length;Ut++)if(Bt.widgets[Ut].noHScroll){to(wt,Ot,"widget");break}}++Ot}),this.curOp.forceUpdate=!0,ao(this,"refresh",this)}),operation:function(ht){return Lo(this,ht)},startOperation:function(){return Su(this)},endOperation:function(){return xu(this)},refresh:Xr(function(){var ht=this.display.cachedTextHeight;qo(this),this.curOp.forceUpdate=!0,Uh(this),oh(this,this.doc.scrollLeft,this.doc.scrollTop),Cu(this.display),(ht==null||Math.abs(ht-Kl(this.display))>.5||this.options.lineWrapping)&&Mi(this),ao(this,"refresh",this)}),swapDoc:Xr(function(ht){var gt=this.doc;return gt.cm=null,this.state.selectingText&&this.state.selectingText(),_c(this,ht),Uh(this),this.display.input.reset(),oh(this,ht.scrollLeft,ht.scrollTop),this.curOp.forceScroll=!0,qn(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}},fr(it),it.registerHelper=function(ht,gt,wt){dt.hasOwnProperty(ht)||(dt[ht]=it[ht]={_global:[]}),dt[ht][gt]=wt},it.registerGlobalHelper=function(ht,gt,wt,bt){it.registerHelper(ht,gt,bt),dt[ht]._global.push({pred:wt,val:bt})}}function $d(it,st,dt,ht,gt){var wt=st,bt=dt,Ot=Ge(it,st.line),Bt=gt&&it.direction=="rtl"?-dt:dt;function Ut(){var li=st.line+Bt;return li<it.first||li>=it.first+it.size?!1:(st=new qt(li,st.ch,st.sticky),Ot=Ge(it,li))}function fe(li){var ni;if(ht=="codepoint"){var vi=Ot.text.charCodeAt(st.ch+(ht>0?0:-1));isNaN(vi)?ni=null:ni=new qt(st.line,Math.max(0,Math.min(Ot.text.length,st.ch+dt*(vi>=55296&&vi<56320?2:1))),-dt)}else gt?ni=Xc(it.cm,Ot,st,dt):ni=Fr(Ot,st,dt);if(ni==null)if(!li&&Ut())st=Jd(gt,it.cm,Ot,st.line,Bt);else return!1;else st=ni;return!0}if(ht=="char"||ht=="codepoint")fe();else if(ht=="column")fe(!0);else if(ht=="word"||ht=="group")for(var Jt=null,Te=ht=="group",Ne=it.cm&&it.cm.getHelper(st,"wordChars"),dn=!0;!(dt<0&&!fe(!dn));dn=!1){var pn=Ot.text.charAt(st.ch)||`
`,bn=Wt(pn,Ne)?"w":Te&&pn==`
`?"n":!Te||/\s/.test(pn)?null:"p";if(Te&&!dn&&!bn&&(bn="s"),Jt&&Jt!=bn){dt<0&&(dt=1,fe(),st.sticky="after");break}if(bn&&(Jt=bn),dt>0&&!fe(!dn))break}var Un=Vd(it,st,wt,bt,!0);return Mn(wt,Un)&&(Un.hitSide=!0),Un}function Bu(it,st,dt,ht){var gt=it.doc,wt=st.left,bt;if(ht=="page"){var Ot=Math.min(it.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Bt=Math.max(Ot-.5*Kl(it.display),3);bt=(dt>0?st.bottom:st.top)+dt*Bt}else ht=="line"&&(bt=dt>0?st.bottom+3:st.top-3);for(var Ut;Ut=Ac(it,wt,bt),!!Ut.outside;){if(dt<0?bt<=0:bt>=gt.height){Ut.hitSide=!0;break}bt+=dt*5}return Ut}var _o=function(it){this.cm=it,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new jt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};_o.prototype.init=function(it){var st=this,dt=this,ht=dt.cm,gt=dt.div=it.lineDiv;Tg(gt,ht.options.spellcheck,ht.options.autocorrect,ht.options.autocapitalize);function wt(Ot){for(var Bt=Ot.target;Bt;Bt=Bt.parentNode){if(Bt==gt)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Bt.className))break}return!1}Jn(gt,"paste",function(Ot){!wt(Ot)||$i(ht,Ot)||Fg(Ot,ht)||re<=11&&setTimeout(Gr(ht,function(){return st.updateFromDOM()}),20)}),Jn(gt,"compositionstart",function(Ot){st.composing={data:Ot.data,done:!1}}),Jn(gt,"compositionupdate",function(Ot){st.composing||(st.composing={data:Ot.data,done:!1})}),Jn(gt,"compositionend",function(Ot){st.composing&&(Ot.data!=st.composing.data&&st.readFromDOMSoon(),st.composing.done=!0)}),Jn(gt,"touchstart",function(){return dt.forceCompositionEnd()}),Jn(gt,"input",function(){st.composing||st.readFromDOMSoon()});function bt(Ot){if(!(!wt(Ot)||$i(ht,Ot))){if(ht.somethingSelected())xh({lineWise:!1,text:ht.getSelections()}),Ot.type=="cut"&&ht.replaceSelection("",null,"cut");else if(ht.options.lineWiseCopyCut){var Bt=bg(ht);xh({lineWise:!0,text:Bt.text}),Ot.type=="cut"&&ht.operation(function(){ht.setSelections(Bt.ranges,0,Le),ht.replaceSelection("",null,"cut")})}else return;if(Ot.clipboardData){Ot.clipboardData.clearData();var Ut=Ks.text.join(`
`);if(Ot.clipboardData.setData("Text",Ut),Ot.clipboardData.getData("Text")==Ut){Ot.preventDefault();return}}var fe=Ag(),Jt=fe.firstChild;ht.display.lineSpace.insertBefore(fe,ht.display.lineSpace.firstChild),Jt.value=Ks.text.join(`
`);var Te=document.activeElement;Rn(Jt),setTimeout(function(){ht.display.lineSpace.removeChild(fe),Te.focus(),Te==gt&&dt.showPrimarySelection()},50)}}Jn(gt,"copy",bt),Jn(gt,"cut",bt)},_o.prototype.screenReaderLabelChanged=function(it){it?this.div.setAttribute("aria-label",it):this.div.removeAttribute("aria-label")},_o.prototype.prepareSelection=function(){var it=mu(this.cm,!1);return it.focus=document.activeElement==this.div,it},_o.prototype.showSelection=function(it,st){!it||!this.cm.display.view.length||((it.focus||st)&&this.showPrimarySelection(),this.showMultipleSelections(it))},_o.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},_o.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 wt=tc(st,it.anchorNode,it.anchorOffset),bt=tc(st,it.focusNode,it.focusOffset);if(!(wt&&!wt.bad&&bt&&!bt.bad&&ae(gn(wt,bt),ht)==0&&ae(Ai(wt,bt),gt)==0)){var Ot=st.display.view,Bt=ht.line>=st.display.viewFrom&&rf(st,ht)||{node:Ot[0].measure.map[2],offset:0},Ut=gt.line<st.display.viewTo&&rf(st,gt);if(!Ut){var fe=Ot[Ot.length-1].measure,Jt=fe.maps?fe.maps[fe.maps.length-1]:fe.map;Ut={node:Jt[Jt.length-1],offset:Jt[Jt.length-2]-Jt[Jt.length-3]}}if(!Bt||!Ut){it.removeAllRanges();return}var Te=it.rangeCount&&it.getRangeAt(0),Ne;try{Ne=se(Bt.node,Bt.offset,Ut.offset,Ut.node)}catch(dn){}Ne&&(!St&&st.state.focused?(it.collapse(Bt.node,Bt.offset),Ne.collapsed||(it.removeAllRanges(),it.addRange(Ne))):(it.removeAllRanges(),it.addRange(Ne)),Te&&it.anchorNode==null?it.addRange(Te):St&&this.startGracePeriod()),this.rememberSelection()}},_o.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)},_o.prototype.showMultipleSelections=function(it){ee(this.cm.display.cursorDiv,it.cursors),ee(this.cm.display.selectionDiv,it.selection)},_o.prototype.rememberSelection=function(){var it=this.getSelection();this.lastAnchorNode=it.anchorNode,this.lastAnchorOffset=it.anchorOffset,this.lastFocusNode=it.focusNode,this.lastFocusOffset=it.focusOffset},_o.prototype.selectionInEditor=function(){var it=this.getSelection();if(!it.rangeCount)return!1;var st=it.getRangeAt(0).commonAncestorContainer;return Re(this.div,st)},_o.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},_o.prototype.blur=function(){this.div.blur()},_o.prototype.getField=function(){return this.div},_o.prototype.supportsTouch=function(){return!0},_o.prototype.receivedFocus=function(){var it=this;this.selectionInEditor()?this.pollSelection():Lo(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)},_o.prototype.selectionChanged=function(){var it=this.getSelection();return it.anchorNode!=this.lastAnchorNode||it.anchorOffset!=this.lastAnchorOffset||it.focusNode!=this.lastFocusNode||it.focusOffset!=this.lastFocusOffset},_o.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var it=this.getSelection(),st=this.cm;if(et&&ue&&this.cm.display.gutterSpecs.length&&Bg(it.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var dt=tc(st,it.anchorNode,it.anchorOffset),ht=tc(st,it.focusNode,it.focusOffset);dt&&ht&&Lo(st,function(){ws(st.doc,Jl(dt,ht),Le),(dt.bad||ht.bad)&&(st.curOp.selectionChanged=!0)})}}},_o.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,Ge(it.doc,ht.line-1).length)),gt.ch==Ge(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 wt,bt,Ot;ht.line==st.viewFrom||(wt=va(it,ht.line))==0?(bt=ce(st.view[0].line),Ot=st.view[0].node):(bt=ce(st.view[wt].line),Ot=st.view[wt-1].node.nextSibling);var Bt=va(it,gt.line),Ut,fe;if(Bt==st.view.length-1?(Ut=st.viewTo-1,fe=st.lineDiv.lastChild):(Ut=ce(st.view[Bt+1].line)-1,fe=st.view[Bt+1].node.previousSibling),!Ot)return!1;for(var Jt=it.doc.splitLines(ld(it,Ot,fe,bt,Ut)),Te=Bn(it.doc,qt(bt,0),qt(Ut,Ge(it.doc,Ut).text.length));Jt.length>1&&Te.length>1;)if(we(Jt)==we(Te))Jt.pop(),Te.pop(),Ut--;else if(Jt[0]==Te[0])Jt.shift(),Te.shift(),bt++;else break;for(var Ne=0,dn=0,pn=Jt[0],bn=Te[0],Un=Math.min(pn.length,bn.length);Ne<Un&&pn.charCodeAt(Ne)==bn.charCodeAt(Ne);)++Ne;for(var li=we(Jt),ni=we(Te),vi=Math.min(li.length-(Jt.length==1?Ne:0),ni.length-(Te.length==1?Ne:0));dn<vi&&li.charCodeAt(li.length-dn-1)==ni.charCodeAt(ni.length-dn-1);)++dn;if(Jt.length==1&&Te.length==1&&bt==ht.line)for(;Ne&&Ne>ht.ch&&li.charCodeAt(li.length-dn-1)==ni.charCodeAt(ni.length-dn-1);)Ne--,dn++;Jt[Jt.length-1]=li.slice(0,li.length-dn).replace(/^\u200b+/,""),Jt[0]=Jt[0].slice(Ne).replace(/\u200b+$/,"");var _i=qt(bt,Ne),$n=qt(Ut,Te.length?we(Te).length-dn:0);if(Jt.length>1||Jt[0]||ae(_i,$n))return ch(it.doc,Jt,_i,$n,"+input"),!0},_o.prototype.ensurePolled=function(){this.forceCompositionEnd()},_o.prototype.reset=function(){this.forceCompositionEnd()},_o.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},_o.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))},_o.prototype.updateFromDOM=function(){var it=this;(this.cm.isReadOnly()||!this.pollContent())&&Lo(this.cm,function(){return qo(it.cm)})},_o.prototype.setUneditable=function(it){it.contentEditable="false"},_o.prototype.onKeyPress=function(it){it.charCode==0||this.composing||(it.preventDefault(),this.cm.isReadOnly()||Gr(this.cm,qd)(this.cm,String.fromCharCode(it.charCode==null?it.keyCode:it.charCode),0))},_o.prototype.readOnlyChanged=function(it){this.div.contentEditable=String(it!="nocursor")},_o.prototype.onContextMenu=function(){},_o.prototype.resetPosition=function(){},_o.prototype.needsContentAttribute=!0;function rf(it,st){var dt=bd(it,st.line);if(!dt||dt.hidden)return null;var ht=Ge(it.doc,st.line),gt=kc(dt,ht,st.line),wt=yi(ht,it.doc.direction),bt="left";if(wt){var Ot=yn(wt,st.ch);bt=Ot%2?"right":"left"}var Bt=Fc(gt.map,st.ch,bt);return Bt.offset=Bt.collapse=="right"?Bt.end:Bt.start,Bt}function Bg(it){for(var st=it;st;st=st.parentNode)if(/CodeMirror-gutter-wrapper/.test(st.className))return!0;return!1}function ad(it,st){return st&&(it.bad=!0),it}function ld(it,st,dt,ht,gt){var wt="",bt=!1,Ot=it.doc.lineSeparator(),Bt=!1;function Ut(Ne){return function(dn){return dn.id==Ne}}function fe(){bt&&(wt+=Ot,Bt&&(wt+=Ot),bt=Bt=!1)}function Jt(Ne){Ne&&(fe(),wt+=Ne)}function Te(Ne){if(Ne.nodeType==1){var dn=Ne.getAttribute("cm-text");if(dn){Jt(dn);return}var pn=Ne.getAttribute("cm-marker"),bn;if(pn){var Un=it.findMarks(qt(ht,0),qt(gt+1,0),Ut(+pn));Un.length&&(bn=Un[0].find(0))&&Jt(Bn(it.doc,bn.from,bn.to).join(Ot));return}if(Ne.getAttribute("contenteditable")=="false")return;var li=/^(pre|div|p|li|table|br)$/i.test(Ne.nodeName);if(!/^br$/i.test(Ne.nodeName)&&Ne.textContent.length==0)return;li&&fe();for(var ni=0;ni<Ne.childNodes.length;ni++)Te(Ne.childNodes[ni]);/^(pre|p)$/i.test(Ne.nodeName)&&(Bt=!0),li&&(bt=!0)}else Ne.nodeType==3&&Jt(Ne.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Te(st),st!=dt;)st=st.nextSibling,Bt=!1;return wt}function tc(it,st,dt){var ht;if(st==it.display.lineDiv){if(ht=it.display.lineDiv.childNodes[dt],!ht)return ad(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 wt=it.display.view[gt];if(wt.node==ht)return rm(wt,st,dt)}}function rm(it,st,dt){var ht=it.text.firstChild,gt=!1;if(!st||!Re(ht,st))return ad(qt(ce(it.line),0),!0);if(st==ht&&(gt=!0,st=ht.childNodes[dt],dt=0,!st)){var wt=it.rest?we(it.rest):it.line;return ad(qt(ce(wt),wt.text.length),gt)}var bt=st.nodeType==3?st:null,Ot=st;for(!bt&&st.childNodes.length==1&&st.firstChild.nodeType==3&&(bt=st.firstChild,dt&&(dt=bt.nodeValue.length));Ot.parentNode!=ht;)Ot=Ot.parentNode;var Bt=it.measure,Ut=Bt.maps;function fe(bn,Un,li){for(var ni=-1;ni<(Ut?Ut.length:0);ni++)for(var vi=ni<0?Bt.map:Ut[ni],_i=0;_i<vi.length;_i+=3){var $n=vi[_i+2];if($n==bn||$n==Un){var no=ce(ni<0?it.line:it.rest[ni]),$o=vi[_i]+li;return(li<0||$n!=bn)&&($o=vi[_i+(li?1:0)]),qt(no,$o)}}}var Jt=fe(bt,Ot,dt);if(Jt)return ad(Jt,gt);for(var Te=Ot.nextSibling,Ne=bt?bt.nodeValue.length-dt:0;Te;Te=Te.nextSibling){if(Jt=fe(Te,Te.firstChild,0),Jt)return ad(qt(Jt.line,Jt.ch-Ne),gt);Ne+=Te.textContent.length}for(var dn=Ot.previousSibling,pn=dt;dn;dn=dn.previousSibling){if(Jt=fe(dn,dn.firstChild,-1),Jt)return ad(qt(Jt.line,Jt.ch+pn),gt);pn+=dn.textContent.length}}var Ar=function(it){this.cm=it,this.prevInput="",this.pollingFast=!1,this.polling=new jt,this.hasSelection=!1,this.composing=null};Ar.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),Ft&&(gt.style.width="0px"),Jn(gt,"input",function(){me&&re>=9&&st.hasSelection&&(st.hasSelection=null),dt.poll()}),Jn(gt,"paste",function(bt){$i(ht,bt)||Fg(bt,ht)||(ht.state.pasteIncoming=+new Date,dt.fastPoll())});function wt(bt){if(!$i(ht,bt)){if(ht.somethingSelected())xh({lineWise:!1,text:ht.getSelections()});else if(ht.options.lineWiseCopyCut){var Ot=bg(ht);xh({lineWise:!0,text:Ot.text}),bt.type=="cut"?ht.setSelections(Ot.ranges,null,Le):(dt.prevInput="",gt.value=Ot.text.join(`
`),Rn(gt))}else return;bt.type=="cut"&&(ht.state.cutIncoming=+new Date)}}Jn(gt,"cut",wt),Jn(gt,"copy",wt),Jn(it.scroller,"paste",function(bt){if(!(ea(it,bt)||$i(ht,bt))){if(!gt.dispatchEvent){ht.state.pasteIncoming=+new Date,dt.focus();return}var Ot=new Event("paste");Ot.clipboardData=bt.clipboardData,gt.dispatchEvent(Ot)}}),Jn(it.lineSpace,"selectstart",function(bt){ea(it,bt)||sr(bt)}),Jn(gt,"compositionstart",function(){var bt=ht.getCursor("from");dt.composing&&dt.composing.range.clear(),dt.composing={start:bt,range:ht.markText(bt,ht.getCursor("to"),{className:"CodeMirror-composing"})}}),Jn(gt,"compositionend",function(){dt.composing&&(dt.poll(),dt.composing.range.clear(),dt.composing=null)})},Ar.prototype.createField=function(it){this.wrapper=Ag(),this.textarea=this.wrapper.firstChild},Ar.prototype.screenReaderLabelChanged=function(it){it?this.textarea.setAttribute("aria-label",it):this.textarea.removeAttribute("aria-label")},Ar.prototype.prepareSelection=function(){var it=this.cm,st=it.display,dt=it.doc,ht=mu(it);if(it.options.moveInputWithCursor){var gt=ur(it,dt.sel.primary().head,"div"),wt=st.wrapper.getBoundingClientRect(),bt=st.lineDiv.getBoundingClientRect();ht.teTop=Math.max(0,Math.min(st.wrapper.clientHeight-10,gt.top+bt.top-wt.top)),ht.teLeft=Math.max(0,Math.min(st.wrapper.clientWidth-10,gt.left+bt.left-wt.left))}return ht},Ar.prototype.showSelection=function(it){var st=this.cm,dt=st.display;ee(dt.cursorDiv,it.cursors),ee(dt.selectionDiv,it.selection),it.teTop!=null&&(this.wrapper.style.top=it.teTop+"px",this.wrapper.style.left=it.teLeft+"px")},Ar.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&&Rn(this.textarea),me&&re>=9&&(this.hasSelection=dt)}else it||(this.prevInput=this.textarea.value="",me&&re>=9&&(this.hasSelection=null))}},Ar.prototype.getField=function(){return this.textarea},Ar.prototype.supportsTouch=function(){return!1},Ar.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!nt||He()!=this.textarea))try{this.textarea.focus()}catch(it){}},Ar.prototype.blur=function(){this.textarea.blur()},Ar.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ar.prototype.receivedFocus=function(){this.slowPoll()},Ar.prototype.slowPoll=function(){var it=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){it.poll(),it.cm.state.focused&&it.slowPoll()})},Ar.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)},Ar.prototype.poll=function(){var it=this,st=this.cm,dt=this.textarea,ht=this.prevInput;if(this.contextMenuPending||!st.state.focused||xt(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(me&&re>=9&&this.hasSelection===gt||ct&&/[\uf700-\uf7ff]/.test(gt))return st.display.input.reset(),!1;if(st.doc.sel==st.display.selForContextMenu){var wt=gt.charCodeAt(0);if(wt==8203&&!ht&&(ht="\u200B"),wt==8666)return this.reset(),this.cm.execCommand("undo")}for(var bt=0,Ot=Math.min(ht.length,gt.length);bt<Ot&&ht.charCodeAt(bt)==gt.charCodeAt(bt);)++bt;return Lo(st,function(){qd(st,gt.slice(bt),ht.length-bt,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},Ar.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ar.prototype.onKeyPress=function(){me&&re>=9&&(this.hasSelection=null),this.fastPoll()},Ar.prototype.onContextMenu=function(it){var st=this,dt=st.cm,ht=dt.display,gt=st.textarea;st.contextMenuPending&&st.contextMenuPending();var wt=As(dt,it),bt=ht.scroller.scrollTop;if(!wt||Se)return;var Ot=dt.options.resetSelectionOnContextMenu;Ot&&dt.doc.sel.contains(wt)==-1&&Gr(dt,ws)(dt.doc,Jl(wt),Le);var Bt=gt.style.cssText,Ut=st.wrapper.style.cssText,fe=st.wrapper.offsetParent.getBoundingClientRect();st.wrapper.style.cssText="position: static",gt.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(it.clientY-fe.top-5)+"px; left: "+(it.clientX-fe.left-5)+`px;
z-index: 1000; background: `+(me?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Jt;Zt&&(Jt=window.scrollY),ht.input.focus(),Zt&&window.scrollTo(null,Jt),ht.input.reset(),dt.somethingSelected()||(gt.value=st.prevInput=" "),st.contextMenuPending=Ne,ht.selForContextMenu=dt.doc.sel,clearTimeout(ht.detectingSelectAll);function Te(){if(gt.selectionStart!=null){var pn=dt.somethingSelected(),bn="\u200B"+(pn?gt.value:"");gt.value="\u21DA",gt.value=bn,st.prevInput=pn?"":"\u200B",gt.selectionStart=1,gt.selectionEnd=bn.length,ht.selForContextMenu=dt.doc.sel}}function Ne(){if(st.contextMenuPending==Ne&&(st.contextMenuPending=!1,st.wrapper.style.cssText=Ut,gt.style.cssText=Bt,me&&re<9&&ht.scrollbars.setScrollTop(ht.scroller.scrollTop=bt),gt.selectionStart!=null)){(!me||me&&re<9)&&Te();var pn=0,bn=function(){ht.selForContextMenu==dt.doc.sel&&gt.selectionStart==0&&gt.selectionEnd>0&&st.prevInput=="\u200B"?Gr(dt,Er)(dt):pn++<10?ht.detectingSelectAll=setTimeout(bn,500):(ht.selForContextMenu=null,ht.input.reset())};ht.detectingSelectAll=setTimeout(bn,200)}}if(me&&re>=9&&Te(),Nt){Ir(it);var dn=function(){Mo(window,"mouseup",dn),setTimeout(Ne,20)};Jn(window,"mouseup",dn)}else setTimeout(Ne,50)},Ar.prototype.readOnlyChanged=function(it){it||this.reset(),this.textarea.disabled=it=="nocursor",this.textarea.readOnly=!!it},Ar.prototype.setUneditable=function(){},Ar.prototype.needsContentAttribute=!1;function sm(it,st){if(st=st?Ni(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=He();st.autofocus=dt==it||it.getAttribute("autofocus")!=null&&dt==document.body}function ht(){it.value=Ot.getValue()}var gt;if(it.form&&(Jn(it.form,"submit",ht),!st.leaveSubmitMethodAlone)){var wt=it.form;gt=wt.submit;try{var bt=wt.submit=function(){ht(),wt.submit=gt,wt.submit(),wt.submit=bt}}catch(Bt){}}st.finishInit=function(Bt){Bt.save=ht,Bt.getTextArea=function(){return it},Bt.toTextArea=function(){Bt.toTextArea=isNaN,ht(),it.parentNode.removeChild(Bt.getWrapperElement()),it.style.display="",it.form&&(Mo(it.form,"submit",ht),!st.leaveSubmitMethodAlone&&typeof it.form.submit=="function"&&(it.form.submit=gt))}},it.style.display="none";var Ot=xo(function(Bt){return it.parentNode.insertBefore(Bt,it.nextSibling)},st);return Ot}function ud(it){it.off=Mo,it.on=Jn,it.wheelEventPixels=Sa,it.Doc=fs,it.splitLines=We,it.countColumn=Yt,it.findColumn=_n,it.isWordChar=At,it.Pass=Ln,it.signal=ao,it.Line=Ro,it.changeEnd=Mu,it.scrollbarModel=$f,it.Pos=qt,it.cmpPos=ae,it.modes=en,it.mimeModes=sn,it.resolveMode=ye,it.getMode=ve,it.modeExtensions=ne,it.extendMode=ke,it.copyState=xn,it.startState=In,it.innerMode=Fn,it.commands=bu,it.keyMap=sa,it.keyName=qp,it.isModifierKey=ed,it.lookupKey=Da,it.normalizeKeyMap=gg,it.StringStream=ge,it.SharedTextMarker=Ml,it.TextMarker=oe,it.LineWidget=$l,it.e_preventDefault=sr,it.e_stopPropagation=Pr,it.e_stop=Ir,it.addClass=ze,it.contains=Re,it.rmClass=Ht,it.keyNames=El}im(xo),Au(xo);var tu="iter insert remove copy getEditor constructor".split(" ");for(var ec in fs.prototype)fs.prototype.hasOwnProperty(ec)&&Ce(tu,ec)<0&&(xo.prototype[ec]=function(it){return function(){return it.apply(this.doc,arguments)}}(fs.prototype[ec]));return fr(fs),xo.inputStyles={textarea:Ar,contenteditable:_o},xo.defineMode=function(it){!xo.defaults.mode&&it!="null"&&(xo.defaults.mode=it),wn.apply(this,arguments)},xo.defineMIME=Qn,xo.defineMode("null",function(){return{token:function(it){return it.skipToEnd()}}}),xo.defineMIME("text/plain","null"),xo.defineExtension=function(it,st){xo.prototype[it]=st},xo.defineDocExtension=function(it,st){fs.prototype[it]=st},xo.fromTextArea=sm,ud(xo),xo.version="5.58.2",xo})},49047:function(tn,An,Kt){(function(St){St(Kt(4631),Kt(29589),Kt(52539))})(function(St){"use strict";St.defineMode("markdown",function(de,Ie){var $e=St.getMode(de,"text/html"),me=$e.name=="null";function re(Yt){if(St.findModeByName){var jt=St.findModeByName(Yt);jt&&(Yt=jt.mime||jt.mimes[0])}var Ce=St.getMode(de,Yt);return Ce.name=="null"?null:Ce}Ie.highlightFormatting===void 0&&(Ie.highlightFormatting=!1),Ie.maxBlockquoteDepth===void 0&&(Ie.maxBlockquoteDepth=0),Ie.taskLists===void 0&&(Ie.taskLists=!1),Ie.strikethrough===void 0&&(Ie.strikethrough=!1),Ie.emoji===void 0&&(Ie.emoji=!1),Ie.fencedCodeBlockHighlighting===void 0&&(Ie.fencedCodeBlockHighlighting=!0),Ie.fencedCodeBlockDefaultMode===void 0&&(Ie.fencedCodeBlockDefaultMode="text/plain"),Ie.xml===void 0&&(Ie.xml=!0),Ie.tokenTypeOverrides===void 0&&(Ie.tokenTypeOverrides={});var Zt={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 Oe in Zt)Zt.hasOwnProperty(Oe)&&Ie.tokenTypeOverrides[Oe]&&(Zt[Oe]=Ie.tokenTypeOverrides[Oe]);var ue=/^([*\-_])(?:\s*\1){2,}\s*$/,Se=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,Ue=/^\[(x| )\](?=\s)/i,Ee=Ie.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,Ze=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Ft=/^[^#!\[\]*_\\<>` "'(~:]+/,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(Yt,jt,Ce){return jt.f=jt.inline=Ce,Ce(Yt,jt)}function vt(Yt,jt,Ce){return jt.f=jt.block=Ce,Ce(Yt,jt)}function Ct(Yt){return!Yt||!/\S/.test(Yt.string)}function Nt(Yt){if(Yt.linkTitle=!1,Yt.linkHref=!1,Yt.linkText=!1,Yt.em=!1,Yt.strong=!1,Yt.strikethrough=!1,Yt.quote=0,Yt.indentedCode=!1,Yt.f==Ht){var jt=me;if(!jt){var Ce=St.innerMode($e,Yt.htmlState);jt=Ce.mode.name=="xml"&&Ce.state.tagStart===null&&!Ce.state.context&&Ce.state.tokenize.isInText}jt&&(Yt.f=Ae,Yt.block=zt,Yt.htmlState=null)}return Yt.trailingSpace=0,Yt.trailingSpaceNewLine=!1,Yt.prevLine=Yt.thisLine,Yt.thisLine={stream:null},null}function zt(Yt,jt){var Ce=Yt.column()===jt.indentation,un=Ct(jt.prevLine.stream),Ln=jt.indentedCode,Le=jt.prevLine.hr,nn=jt.list!==!1,hn=(jt.listStack[jt.listStack.length-1]||0)+3;jt.indentedCode=!1;var _n=jt.indentation;if(jt.indentationDiff===null&&(jt.indentationDiff=jt.indentation,nn)){for(jt.list=null;_n<jt.listStack[jt.listStack.length-1];)jt.listStack.pop(),jt.listStack.length?jt.indentation=jt.listStack[jt.listStack.length-1]:jt.list=!1;jt.list!==!1&&(jt.indentationDiff=_n-jt.listStack[jt.listStack.length-1])}var fn=!un&&!Le&&!jt.prevLine.header&&(!nn||!Ln)&&!jt.prevLine.fencedCodeEnd,le=(jt.list===!1||Le||un)&&jt.indentation<=hn&&Yt.match(ue),we=null;if(jt.indentationDiff>=4&&(Ln||jt.prevLine.fencedCodeEnd||jt.prevLine.header||un))return Yt.skipToEnd(),jt.indentedCode=!0,Zt.code;if(Yt.eatSpace())return null;if(Ce&&jt.indentation<=hn&&(we=Yt.match(Ee))&&we[1].length<=6)return jt.quote=0,jt.header=we[1].length,jt.thisLine.header=!0,Ie.highlightFormatting&&(jt.formatting="header"),jt.f=jt.inline,ee(jt);if(jt.indentation<=hn&&Yt.eat(">"))return jt.quote=Ce?1:jt.quote+1,Ie.highlightFormatting&&(jt.formatting="quote"),Yt.eatSpace(),ee(jt);if(!le&&!jt.setext&&Ce&&jt.indentation<=hn&&(we=Yt.match(Se))){var Pn=we[1]?"ol":"ul";return jt.indentation=_n+Yt.current().length,jt.list=!0,jt.quote=0,jt.listStack.push(jt.indentation),jt.em=!1,jt.strong=!1,jt.code=!1,jt.strikethrough=!1,Ie.taskLists&&Yt.match(Ue,!1)&&(jt.taskList=!0),jt.f=jt.inline,Ie.highlightFormatting&&(jt.formatting=["list","list-"+Pn]),ee(jt)}else{if(Ce&&jt.indentation<=hn&&(we=Yt.match(et,!0)))return jt.quote=0,jt.fencedEndRE=new RegExp(we[1]+"+ *$"),jt.localMode=Ie.fencedCodeBlockHighlighting&&re(we[2]||Ie.fencedCodeBlockDefaultMode),jt.localMode&&(jt.localState=St.startState(jt.localMode)),jt.f=jt.block=$t,Ie.highlightFormatting&&(jt.formatting="code-block"),jt.code=-1,ee(jt);if(jt.setext||(!fn||!nn)&&!jt.quote&&jt.list===!1&&!jt.code&&!le&&!nt.test(Yt.string)&&(we=Yt.lookAhead(1))&&(we=we.match(Ze)))return jt.setext?(jt.header=jt.setext,jt.setext=0,Yt.skipToEnd(),Ie.highlightFormatting&&(jt.formatting="header")):(jt.header=we[0].charAt(0)=="="?1:2,jt.setext=jt.header),jt.thisLine.header=!0,jt.f=jt.inline,ee(jt);if(le)return Yt.skipToEnd(),jt.hr=!0,jt.thisLine.hr=!0,Zt.hr;if(Yt.peek()==="[")return pt(Yt,jt,Cn)}return pt(Yt,jt,jt.inline)}function Ht(Yt,jt){var Ce=$e.token(Yt,jt.htmlState);if(!me){var un=St.innerMode($e,jt.htmlState);(un.mode.name=="xml"&&un.state.tagStart===null&&!un.state.context&&un.state.tokenize.isInText||jt.md_inside&&Yt.current().indexOf(">")>-1)&&(jt.f=Ae,jt.block=zt,jt.htmlState=null)}return Ce}function $t(Yt,jt){var Ce=jt.listStack[jt.listStack.length-1]||0,un=jt.indentation<Ce,Ln=Ce+3;if(jt.fencedEndRE&&jt.indentation<=Ln&&(un||Yt.match(jt.fencedEndRE))){Ie.highlightFormatting&&(jt.formatting="code-block");var Le;return un||(Le=ee(jt)),jt.localMode=jt.localState=null,jt.block=zt,jt.f=Ae,jt.fencedEndRE=null,jt.code=0,jt.thisLine.fencedCodeEnd=!0,un?vt(Yt,jt,jt.block):Le}else return jt.localMode?jt.localMode.token(Yt,jt.localState):(Yt.skipToEnd(),Zt.code)}function ee(Yt){var jt=[];if(Yt.formatting){jt.push(Zt.formatting),typeof Yt.formatting=="string"&&(Yt.formatting=[Yt.formatting]);for(var Ce=0;Ce<Yt.formatting.length;Ce++)jt.push(Zt.formatting+"-"+Yt.formatting[Ce]),Yt.formatting[Ce]==="header"&&jt.push(Zt.formatting+"-"+Yt.formatting[Ce]+"-"+Yt.header),Yt.formatting[Ce]==="quote"&&(!Ie.maxBlockquoteDepth||Ie.maxBlockquoteDepth>=Yt.quote?jt.push(Zt.formatting+"-"+Yt.formatting[Ce]+"-"+Yt.quote):jt.push("error"))}if(Yt.taskOpen)return jt.push("meta"),jt.length?jt.join(" "):null;if(Yt.taskClosed)return jt.push("property"),jt.length?jt.join(" "):null;if(Yt.linkHref?jt.push(Zt.linkHref,"url"):(Yt.strong&&jt.push(Zt.strong),Yt.em&&jt.push(Zt.em),Yt.strikethrough&&jt.push(Zt.strikethrough),Yt.emoji&&jt.push(Zt.emoji),Yt.linkText&&jt.push(Zt.linkText),Yt.code&&jt.push(Zt.code),Yt.image&&jt.push(Zt.image),Yt.imageAltText&&jt.push(Zt.imageAltText,"link"),Yt.imageMarker&&jt.push(Zt.imageMarker)),Yt.header&&jt.push(Zt.header,Zt.header+"-"+Yt.header),Yt.quote&&(jt.push(Zt.quote),!Ie.maxBlockquoteDepth||Ie.maxBlockquoteDepth>=Yt.quote?jt.push(Zt.quote+"-"+Yt.quote):jt.push(Zt.quote+"-"+Ie.maxBlockquoteDepth)),Yt.list!==!1){var un=(Yt.listStack.length-1)%3;un?un===1?jt.push(Zt.list2):jt.push(Zt.list3):jt.push(Zt.list1)}return Yt.trailingSpaceNewLine?jt.push("trailing-space-new-line"):Yt.trailingSpace&&jt.push("trailing-space-"+(Yt.trailingSpace%2?"a":"b")),jt.length?jt.join(" "):null}function te(Yt,jt){if(Yt.match(Ft,!0))return ee(jt)}function Ae(Yt,jt){var Ce=jt.text(Yt,jt);if(typeof Ce!="undefined")return Ce;if(jt.list)return jt.list=null,ee(jt);if(jt.taskList){var un=Yt.match(Ue,!0)[1]===" ";return un?jt.taskOpen=!0:jt.taskClosed=!0,Ie.highlightFormatting&&(jt.formatting="task"),jt.taskList=!1,ee(jt)}if(jt.taskOpen=!1,jt.taskClosed=!1,jt.header&&Yt.match(/^#+$/,!0))return Ie.highlightFormatting&&(jt.formatting="header"),ee(jt);var Ln=Yt.next();if(jt.linkTitle){jt.linkTitle=!1;var Le=Ln;Ln==="("&&(Le=")"),Le=(Le+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var nn="^\\s*(?:[^"+Le+"\\\\]+|\\\\\\\\|\\\\.)"+Le;if(Yt.match(new RegExp(nn),!0))return Zt.linkHref}if(Ln==="`"){var hn=jt.formatting;Ie.highlightFormatting&&(jt.formatting="code"),Yt.eatWhile("`");var _n=Yt.current().length;if(jt.code==0&&(!jt.quote||_n==1))return jt.code=_n,ee(jt);if(_n==jt.code){var fn=ee(jt);return jt.code=0,fn}else return jt.formatting=hn,ee(jt)}else if(jt.code)return ee(jt);if(Ln==="\\"&&(Yt.next(),Ie.highlightFormatting)){var le=ee(jt),we=Zt.formatting+"-escape";return le?le+" "+we:we}if(Ln==="!"&&Yt.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return jt.imageMarker=!0,jt.image=!0,Ie.highlightFormatting&&(jt.formatting="image"),ee(jt);if(Ln==="["&&jt.imageMarker&&Yt.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return jt.imageMarker=!1,jt.imageAltText=!0,Ie.highlightFormatting&&(jt.formatting="image"),ee(jt);if(Ln==="]"&&jt.imageAltText){Ie.highlightFormatting&&(jt.formatting="image");var le=ee(jt);return jt.imageAltText=!1,jt.image=!1,jt.inline=jt.f=Re,le}if(Ln==="["&&!jt.image)return jt.linkText&&Yt.match(/^.*?\]/)||(jt.linkText=!0,Ie.highlightFormatting&&(jt.formatting="link")),ee(jt);if(Ln==="]"&&jt.linkText){Ie.highlightFormatting&&(jt.formatting="link");var le=ee(jt);return jt.linkText=!1,jt.inline=jt.f=Yt.match(/\(.*?\)| ?\[.*?\]/,!1)?Re:Ae,le}if(Ln==="<"&&Yt.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){jt.f=jt.inline=se,Ie.highlightFormatting&&(jt.formatting="link");var le=ee(jt);return le?le+=" ":le="",le+Zt.linkInline}if(Ln==="<"&&Yt.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){jt.f=jt.inline=se,Ie.highlightFormatting&&(jt.formatting="link");var le=ee(jt);return le?le+=" ":le="",le+Zt.linkEmail}if(Ie.xml&&Ln==="<"&&Yt.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Pn=Yt.string.indexOf(">",Yt.pos);if(Pn!=-1){var vn=Yt.string.substring(Yt.start,Pn);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(vn)&&(jt.md_inside=!0)}return Yt.backUp(1),jt.htmlState=St.startState($e),vt(Yt,jt,Ht)}if(Ie.xml&&Ln==="<"&&Yt.match(/^\/\w*?>/))return jt.md_inside=!1,"tag";if(Ln==="*"||Ln==="_"){for(var _t=1,Mt=Yt.pos==1?" ":Yt.string.charAt(Yt.pos-2);_t<3&&Yt.eat(Ln);)_t++;var Lt=Yt.peek()||" ",At=!/\s/.test(Lt)&&(!ct.test(Lt)||/\s/.test(Mt)||ct.test(Mt)),Wt=!/\s/.test(Mt)&&(!ct.test(Mt)||/\s/.test(Lt)||ct.test(Lt)),Et=null,be=null;if(_t%2&&(!jt.em&&At&&(Ln==="*"||!Wt||ct.test(Mt))?Et=!0:jt.em==Ln&&Wt&&(Ln==="*"||!At||ct.test(Lt))&&(Et=!1)),_t>1&&(!jt.strong&&At&&(Ln==="*"||!Wt||ct.test(Mt))?be=!0:jt.strong==Ln&&Wt&&(Ln==="*"||!At||ct.test(Lt))&&(be=!1)),be!=null||Et!=null){Ie.highlightFormatting&&(jt.formatting=Et==null?"strong":be==null?"em":"strong em"),Et===!0&&(jt.em=Ln),be===!0&&(jt.strong=Ln);var fn=ee(jt);return Et===!1&&(jt.em=!1),be===!1&&(jt.strong=!1),fn}}else if(Ln===" "&&(Yt.eat("*")||Yt.eat("_"))){if(Yt.peek()===" ")return ee(jt);Yt.backUp(1)}if(Ie.strikethrough){if(Ln==="~"&&Yt.eatWhile(Ln)){if(jt.strikethrough){Ie.highlightFormatting&&(jt.formatting="strikethrough");var fn=ee(jt);return jt.strikethrough=!1,fn}else if(Yt.match(/^[^\s]/,!1))return jt.strikethrough=!0,Ie.highlightFormatting&&(jt.formatting="strikethrough"),ee(jt)}else if(Ln===" "&&Yt.match(/^~~/,!0)){if(Yt.peek()===" ")return ee(jt);Yt.backUp(2)}}if(Ie.emoji&&Ln===":"&&Yt.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){jt.emoji=!0,Ie.highlightFormatting&&(jt.formatting="emoji");var Nn=ee(jt);return jt.emoji=!1,Nn}return Ln===" "&&(Yt.match(/^ +$/,!1)?jt.trailingSpace++:jt.trailingSpace&&(jt.trailingSpaceNewLine=!0)),ee(jt)}function se(Yt,jt){var Ce=Yt.next();if(Ce===">"){jt.f=jt.inline=Ae,Ie.highlightFormatting&&(jt.formatting="link");var un=ee(jt);return un?un+=" ":un="",un+Zt.linkInline}return Yt.match(/^[^>]+/,!0),Zt.linkInline}function Re(Yt,jt){if(Yt.eatSpace())return null;var Ce=Yt.next();return Ce==="("||Ce==="["?(jt.f=jt.inline=ze(Ce==="("?")":"]"),Ie.highlightFormatting&&(jt.formatting="link-string"),jt.linkHref=!0,ee(jt)):"error"}var He={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function ze(Yt){return function(jt,Ce){var un=jt.next();if(un===Yt){Ce.f=Ce.inline=Ae,Ie.highlightFormatting&&(Ce.formatting="link-string");var Ln=ee(Ce);return Ce.linkHref=!1,Ln}return jt.match(He[Yt]),Ce.linkHref=!0,ee(Ce)}}function Cn(Yt,jt){return Yt.match(/^([^\]\\]|\\.)*\]:/,!1)?(jt.f=Rn,Yt.next(),Ie.highlightFormatting&&(jt.formatting="link"),jt.linkText=!0,ee(jt)):pt(Yt,jt,Ae)}function Rn(Yt,jt){if(Yt.match(/^\]:/,!0)){jt.f=jt.inline=Xn,Ie.highlightFormatting&&(jt.formatting="link");var Ce=ee(jt);return jt.linkText=!1,Ce}return Yt.match(/^([^\]\\]|\\.)+/,!0),Zt.linkText}function Xn(Yt,jt){return Yt.eatSpace()?null:(Yt.match(/^[^\s]+/,!0),Yt.peek()===void 0?jt.linkTitle=!0:Yt.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),jt.f=jt.inline=Ae,Zt.linkHref+" url")}var Ni={startState:function(){return{f:zt,prevLine:{stream:null},thisLine:{stream:null},block:zt,htmlState:null,indentation:0,inline:Ae,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(Yt){return{f:Yt.f,prevLine:Yt.prevLine,thisLine:Yt.thisLine,block:Yt.block,htmlState:Yt.htmlState&&St.copyState($e,Yt.htmlState),indentation:Yt.indentation,localMode:Yt.localMode,localState:Yt.localMode?St.copyState(Yt.localMode,Yt.localState):null,inline:Yt.inline,text:Yt.text,formatting:!1,linkText:Yt.linkText,linkTitle:Yt.linkTitle,linkHref:Yt.linkHref,code:Yt.code,em:Yt.em,strong:Yt.strong,strikethrough:Yt.strikethrough,emoji:Yt.emoji,header:Yt.header,setext:Yt.setext,hr:Yt.hr,taskList:Yt.taskList,list:Yt.list,listStack:Yt.listStack.slice(0),quote:Yt.quote,indentedCode:Yt.indentedCode,trailingSpace:Yt.trailingSpace,trailingSpaceNewLine:Yt.trailingSpaceNewLine,md_inside:Yt.md_inside,fencedEndRE:Yt.fencedEndRE}},token:function(Yt,jt){if(jt.formatting=!1,Yt!=jt.thisLine.stream){if(jt.header=0,jt.hr=!1,Yt.match(/^\s*$/,!0))return Nt(jt),null;if(jt.prevLine=jt.thisLine,jt.thisLine={stream:Yt},jt.taskList=!1,jt.trailingSpace=0,jt.trailingSpaceNewLine=!1,!jt.localState&&(jt.f=jt.block,jt.f!=Ht)){var Ce=Yt.match(/^\s*/,!0)[0].replace(/\t/g,lt).length;if(jt.indentation=Ce,jt.indentationDiff=null,Ce>0)return null}}return jt.f(Yt,jt)},innerMode:function(Yt){return Yt.block==Ht?{state:Yt.htmlState,mode:$e}:Yt.localState?{state:Yt.localState,mode:Yt.localMode}:{state:Yt,mode:Ni}},indent:function(Yt,jt,Ce){return Yt.block==Ht&&$e.indent?$e.indent(Yt.htmlState,jt,Ce):Yt.localState&&Yt.localMode.indent?Yt.localMode.indent(Yt.localState,jt,Ce):St.Pass},blankLine:Nt,getType:ee,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Ni},"xml"),St.defineMIME("text/markdown","markdown"),St.defineMIME("text/x-markdown","markdown")})},52539:function(tn,An,Kt){(function(St){St(Kt(4631))})(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 de=0;de<St.modeInfo.length;de++){var Ie=St.modeInfo[de];Ie.mimes&&(Ie.mime=Ie.mimes[0])}St.findModeByMIME=function($e){$e=$e.toLowerCase();for(var me=0;me<St.modeInfo.length;me++){var re=St.modeInfo[me];if(re.mime==$e)return re;if(re.mimes){for(var Zt=0;Zt<re.mimes.length;Zt++)if(re.mimes[Zt]==$e)return re}}if(/\+xml$/.test($e))return St.findModeByMIME("application/xml");if(/\+json$/.test($e))return St.findModeByMIME("application/json")},St.findModeByExtension=function($e){$e=$e.toLowerCase();for(var me=0;me<St.modeInfo.length;me++){var re=St.modeInfo[me];if(re.ext){for(var Zt=0;Zt<re.ext.length;Zt++)if(re.ext[Zt]==$e)return re}}},St.findModeByFileName=function($e){for(var me=0;me<St.modeInfo.length;me++){var re=St.modeInfo[me];if(re.file&&re.file.test($e))return re}var Zt=$e.lastIndexOf("."),Oe=Zt>-1&&$e.substring(Zt+1,$e.length);if(Oe)return St.findModeByExtension(Oe)},St.findModeByName=function($e){$e=$e.toLowerCase();for(var me=0;me<St.modeInfo.length;me++){var re=St.modeInfo[me];if(re.name.toLowerCase()==$e)return re;if(re.alias){for(var Zt=0;Zt<re.alias.length;Zt++)if(re.alias[Zt].toLowerCase()==$e)return re}}}})},80785:function(tn,An,Kt){(function(St){St(Kt(4631))})(function(St){"use strict";St.defineMode("stex",function(de,Ie){"use strict";function $e(Ft,et){Ft.cmdState.push(et)}function me(Ft){return Ft.cmdState.length>0?Ft.cmdState[Ft.cmdState.length-1]:null}function re(Ft){var et=Ft.cmdState.pop();et&&et.closeBracket()}function Zt(Ft){for(var et=Ft.cmdState,nt=et.length-1;nt>=0;nt--){var ct=et[nt];if(ct.name!="DEFAULT")return ct}return{styleIdentifier:function(){return null}}}function Oe(Ft,et,nt){return function(){this.name=Ft,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 ue={};ue.importmodule=Oe("importmodule","tag",["string","builtin"]),ue.documentclass=Oe("documentclass","tag",["","atom"]),ue.usepackage=Oe("usepackage","tag",["atom"]),ue.begin=Oe("begin","tag",["atom"]),ue.end=Oe("end","tag",["atom"]),ue.label=Oe("label","tag",["atom"]),ue.ref=Oe("ref","tag",["atom"]),ue.eqref=Oe("eqref","tag",["atom"]),ue.cite=Oe("cite","tag",["atom"]),ue.bibitem=Oe("bibitem","tag",["atom"]),ue.Bibitem=Oe("Bibitem","tag",["atom"]),ue.RBibitem=Oe("RBibitem","tag",["atom"]),ue.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Se(Ft,et){Ft.f=et}function Ue(Ft,et){var nt;if(Ft.match(/^\\[a-zA-Z@]+/)){var ct=Ft.current().slice(1);return nt=ue.hasOwnProperty(ct)?ue[ct]:ue.DEFAULT,nt=new nt,$e(et,nt),Se(et,Ze),nt.style}if(Ft.match(/^\\[$&%#{}_]/)||Ft.match(/^\\[,;!\/\\]/))return"tag";if(Ft.match("\\["))return Se(et,function(pt,vt){return Ee(pt,vt,"\\]")}),"keyword";if(Ft.match("\\("))return Se(et,function(pt,vt){return Ee(pt,vt,"\\)")}),"keyword";if(Ft.match("$$"))return Se(et,function(pt,vt){return Ee(pt,vt,"$$")}),"keyword";if(Ft.match("$"))return Se(et,function(pt,vt){return Ee(pt,vt,"$")}),"keyword";var lt=Ft.next();if(lt=="%")return Ft.skipToEnd(),"comment";if(lt=="}"||lt=="]"){if(nt=me(et),nt)nt.closeBracket(lt),Se(et,Ze);else return"error";return"bracket"}else return lt=="{"||lt=="["?(nt=ue.DEFAULT,nt=new nt,$e(et,nt),"bracket"):/\d/.test(lt)?(Ft.eatWhile(/[\w.%]/),"atom"):(Ft.eatWhile(/[\w\-_]/),nt=Zt(et),nt.name=="begin"&&(nt.argument=Ft.current()),nt.styleIdentifier())}function Ee(Ft,et,nt){if(Ft.eatSpace())return null;if(nt&&Ft.match(nt))return Se(et,Ue),"keyword";if(Ft.match(/^\\[a-zA-Z@]+/))return"tag";if(Ft.match(/^[a-zA-Z]+/))return"variable-2";if(Ft.match(/^\\[$&%#{}_]/)||Ft.match(/^\\[,;!\/]/)||Ft.match(/^[\^_&]/))return"tag";if(Ft.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Ft.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var ct=Ft.next();return ct=="{"||ct=="}"||ct=="["||ct=="]"||ct=="("||ct==")"?"bracket":ct=="%"?(Ft.skipToEnd(),"comment"):"error"}function Ze(Ft,et){var nt=Ft.peek(),ct;return nt=="{"||nt=="["?(ct=me(et),ct.openBracket(nt),Ft.eat(nt),Se(et,Ue),"bracket"):/[ \t\r]/.test(nt)?(Ft.eat(nt),null):(Se(et,Ue),re(et),Ue(Ft,et))}return{startState:function(){var Ft=Ie.inMathMode?function(et,nt){return Ee(et,nt)}:Ue;return{cmdState:[],f:Ft}},copyState:function(Ft){return{cmdState:Ft.cmdState.slice(),f:Ft.f}},token:function(Ft,et){return et.f(Ft,et)},blankLine:function(Ft){Ft.f=Ue,Ft.cmdState.length=0},lineComment:"%"}}),St.defineMIME("text/x-stex","stex"),St.defineMIME("text/x-latex","stex")})},29589:function(tn,An,Kt){(function(St){St(Kt(4631))})(function(St){"use strict";var de={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},Ie={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};St.defineMode("xml",function($e,me){var re=$e.indentUnit,Zt={},Oe=me.htmlMode?de:Ie;for(var ue in Oe)Zt[ue]=Oe[ue];for(var ue in me)Zt[ue]=me[ue];var Se,Ue;function Ee(se,Re){function He(Rn){return Re.tokenize=Rn,Rn(se,Re)}var ze=se.next();if(ze=="<")return se.eat("!")?se.eat("[")?se.match("CDATA[")?He(et("atom","]]>")):null:se.match("--")?He(et("comment","-->")):se.match("DOCTYPE",!0,!0)?(se.eatWhile(/[\w\._\-]/),He(nt(1))):null:se.eat("?")?(se.eatWhile(/[\w\._\-]/),Re.tokenize=et("meta","?>"),"meta"):(Se=se.eat("/")?"closeTag":"openTag",Re.tokenize=Ze,"tag bracket");if(ze=="&"){var Cn;return se.eat("#")?se.eat("x")?Cn=se.eatWhile(/[a-fA-F\d]/)&&se.eat(";"):Cn=se.eatWhile(/[\d]/)&&se.eat(";"):Cn=se.eatWhile(/[\w\.\-:]/)&&se.eat(";"),Cn?"atom":"error"}else return se.eatWhile(/[^&<]/),null}Ee.isInText=!0;function Ze(se,Re){var He=se.next();if(He==">"||He=="/"&&se.eat(">"))return Re.tokenize=Ee,Se=He==">"?"endTag":"selfcloseTag","tag bracket";if(He=="=")return Se="equals",null;if(He=="<"){Re.tokenize=Ee,Re.state=vt,Re.tagName=Re.tagStart=null;var ze=Re.tokenize(se,Re);return ze?ze+" tag error":"tag error"}else return/[\'\"]/.test(He)?(Re.tokenize=Ft(He),Re.stringStartCol=se.column(),Re.tokenize(se,Re)):(se.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Ft(se){var Re=function(He,ze){for(;!He.eol();)if(He.next()==se){ze.tokenize=Ze;break}return"string"};return Re.isInAttribute=!0,Re}function et(se,Re){return function(He,ze){for(;!He.eol();){if(He.match(Re)){ze.tokenize=Ee;break}He.next()}return se}}function nt(se){return function(Re,He){for(var ze;(ze=Re.next())!=null;){if(ze=="<")return He.tokenize=nt(se+1),He.tokenize(Re,He);if(ze==">")if(se==1){He.tokenize=Ee;break}else return He.tokenize=nt(se-1),He.tokenize(Re,He)}return"meta"}}function ct(se,Re,He){this.prev=se.context,this.tagName=Re,this.indent=se.indented,this.startOfLine=He,(Zt.doNotIndent.hasOwnProperty(Re)||se.context&&se.context.noIndent)&&(this.noIndent=!0)}function lt(se){se.context&&(se.context=se.context.prev)}function pt(se,Re){for(var He;;){if(!se.context||(He=se.context.tagName,!Zt.contextGrabbers.hasOwnProperty(He)||!Zt.contextGrabbers[He].hasOwnProperty(Re)))return;lt(se)}}function vt(se,Re,He){return se=="openTag"?(He.tagStart=Re.column(),Ct):se=="closeTag"?Nt:vt}function Ct(se,Re,He){return se=="word"?(He.tagName=Re.current(),Ue="tag",$t):Zt.allowMissingTagName&&se=="endTag"?(Ue="tag bracket",$t(se,Re,He)):(Ue="error",Ct)}function Nt(se,Re,He){if(se=="word"){var ze=Re.current();return He.context&&He.context.tagName!=ze&&Zt.implicitlyClosed.hasOwnProperty(He.context.tagName)&&lt(He),He.context&&He.context.tagName==ze||Zt.matchClosing===!1?(Ue="tag",zt):(Ue="tag error",Ht)}else return Zt.allowMissingTagName&&se=="endTag"?(Ue="tag bracket",zt(se,Re,He)):(Ue="error",Ht)}function zt(se,Re,He){return se!="endTag"?(Ue="error",zt):(lt(He),vt)}function Ht(se,Re,He){return Ue="error",zt(se,Re,He)}function $t(se,Re,He){if(se=="word")return Ue="attribute",ee;if(se=="endTag"||se=="selfcloseTag"){var ze=He.tagName,Cn=He.tagStart;return He.tagName=He.tagStart=null,se=="selfcloseTag"||Zt.autoSelfClosers.hasOwnProperty(ze)?pt(He,ze):(pt(He,ze),He.context=new ct(He,ze,Cn==He.indented)),vt}return Ue="error",$t}function ee(se,Re,He){return se=="equals"?te:(Zt.allowMissing||(Ue="error"),$t(se,Re,He))}function te(se,Re,He){return se=="string"?Ae:se=="word"&&Zt.allowUnquoted?(Ue="string",$t):(Ue="error",$t(se,Re,He))}function Ae(se,Re,He){return se=="string"?Ae:$t(se,Re,He)}return{startState:function(se){var Re={tokenize:Ee,state:vt,indented:se||0,tagName:null,tagStart:null,context:null};return se!=null&&(Re.baseIndent=se),Re},token:function(se,Re){if(!Re.tagName&&se.sol()&&(Re.indented=se.indentation()),se.eatSpace())return null;Se=null;var He=Re.tokenize(se,Re);return(He||Se)&&He!="comment"&&(Ue=null,Re.state=Re.state(Se||He,se,Re),Ue&&(He=Ue=="error"?He+" error":Ue)),He},indent:function(se,Re,He){var ze=se.context;if(se.tokenize.isInAttribute)return se.tagStart==se.indented?se.stringStartCol+1:se.indented+re;if(ze&&ze.noIndent)return St.Pass;if(se.tokenize!=Ze&&se.tokenize!=Ee)return He?He.match(/^(\s*)/)[0].length:0;if(se.tagName)return Zt.multilineTagIndentPastTag!==!1?se.tagStart+se.tagName.length+2:se.tagStart+re*(Zt.multilineTagIndentFactor||1);if(Zt.alignCDATA&&/<!\[CDATA\[/.test(Re))return 0;var Cn=Re&&/^<(\/)?([\w_:\.-]*)/.exec(Re);if(Cn&&Cn[1])for(;ze;)if(ze.tagName==Cn[2]){ze=ze.prev;break}else if(Zt.implicitlyClosed.hasOwnProperty(ze.tagName))ze=ze.prev;else break;else if(Cn)for(;ze;){var Rn=Zt.contextGrabbers[ze.tagName];if(Rn&&Rn.hasOwnProperty(Cn[2]))ze=ze.prev;else break}for(;ze&&ze.prev&&!ze.startOfLine;)ze=ze.prev;return ze?ze.indent+re:se.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Zt.htmlMode?"html":"xml",helperType:Zt.htmlMode?"html":"xml",skipAttribute:function(se){se.state==te&&(se.state=$t)},xmlCurrentTag:function(se){return se.tagName?{name:se.tagName,close:se.type=="closeTag"}:null},xmlCurrentContext:function(se){for(var Re=[],He=se.context;He;He=He.prev)He.tagName&&Re.push(He.tagName);return Re.reverse()}}}),St.defineMIME("text/xml","xml"),St.defineMIME("application/xml","xml"),St.mimeModes.hasOwnProperty("text/html")||St.defineMIME("text/html",{name:"xml",htmlMode:!0})})},23495:function(tn,An,Kt){"use strict";Kt.d(An,{$u:function(){return ue},BD:function(){return _t},E9:function(){return Oe},FF:function(){return Hs},FJ:function(){return vt},Hn:function(){return pt},KX:function(){return Nt},NB:function(){return Gn},S0:function(){return we},UL:function(){return Se},Vk:function(){return lt},Vm:function(){return yn},YI:function(){return Pn},ZA:function(){return Ie},Zt:function(){return Ue},al:function(){return Et},bn:function(){return Wt},bx:function(){return Mt},g2:function(){return vn},h1:function(){return te},hD:function(){return fr},l4:function(){return re},rU:function(){return Fi},s_:function(){return Lt},uz:function(){return On},z6:function(){return Ee}}),tn=Kt.hmd(tn),function(){var xt;function Sn(a){var y=0;return function(){return y<a.length?{done:!1,value:a[y++]}:{done:!0}}}function mn(a){var y=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];return y?y.call(a):{next:Sn(a)}}function rn(a){for(var y,x=[];!(y=a.next()).done;)x.push(y.value);return x}var en=typeof Object.create=="function"?Object.create:function(a){function y(){}return y.prototype=a,new y},sn;if(typeof Object.setPrototypeOf=="function")sn=Object.setPrototypeOf;else{var wn;t:{var Qn={a:!0},ye={};try{ye.__proto__=Qn,wn=ye.a;break t}catch(a){}wn=!1}sn=wn?function(a,y){if(a.__proto__=y,a.__proto__!==y)throw new TypeError(a+" is not extensible");return a}:null}var ve=sn;function ne(a,y){if(a.prototype=en(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 ke=typeof Kt.g!="undefined"&&Kt.g!=null?Kt.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},Fn=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,y,x){a!=Array.prototype&&a!=Object.prototype&&(a[y]=x.value)};function In(a,y){if(y){var x=ke;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&&Fn(x,a,{writable:!0,value:y})}}In("Object.assign",function(a){return a||xn}),In("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 ge=typeof globalThis=="object"&&globalThis||typeof Kt.g=="object"&&Kt.g.global===Kt.g&&Kt.g||typeof self=="object"&&self.self===self&&self||{};ge.requestAnimationFrame===void 0&&(ge.setImmediate===void 0?ge.requestAnimationFrame=function(a){ge.setTimeout(a,0)}:ge.requestAnimationFrame=ge.setImmediate);function Ge(){}function Bn(a,y){var x=-1;return function(){var E=this,b=arguments;x!==-1&&ge.clearTimeout(x),x=ri(function(){x=-1,a.apply(E,b)},y)}}function ri(a,y){return ge.setTimeout(a,y)}function Qe(a){return ge.document.createElement(a)}function ce(a){throw Error(a)}function Tn(a,y){a="The object is frozen, so its properties cannot be set: "+a.toString(),y!==void 0&&(a+=" to value: "+y),ce(a)}function ti(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),ce(x+" is not in the range "+y+": "+a)}function Be(a){ge.console&&ge.console.log(a)}function qt(a){return typeof a=="object"&&a!==null}function ae(a){return Array.isArray(a)||ge.NodeList&&a instanceof ge.NodeList||ge.HTMLCollection&&a instanceof ge.HTMLCollection}function Mn(a){return Array.prototype.slice.call(a)}function Gi(a,y,x){Array.isArray(a)?y>=a.length?a.push(x):a.splice(y,0,x):ce("Cannot insert an object into an HTMLCollection or NodeList: "+x+" at "+y)}function Ai(a,y){Array.isArray(a)?y>=a.length?a.pop():a.splice(y,1):ce("Cannot remove an object from an HTMLCollection or NodeList at "+y)}function gn(){var a=Qi.pop();return a===void 0?[]:a}function Ye(a){a.length=0,Qi.push(a)}function xe(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 xe(a.constructor);return typeof a}function ei(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 Si(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 qe(a,y,x){Object.defineProperty(lo.prototype,a,{get:y,set:x})}function Hn(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 So=ge.navigator!==void 0&&0<ge.navigator.userAgent.indexOf("Trident/7"),Bi=ge.navigator!==void 0&&ge.navigator.platform!==void 0&&ge.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,Qi=[];Object.freeze([]),Ge.className="Util",Ge.Dx="32ab5ff3b26f42dc0ed90f21472913b5",Ge.adym="gojs.net",Ge.vfo="28e645fdb266",Ge.className="Util";function he(a,y,x){Dn(this),this.j=a,this.xa=y,this.o=x}he.prototype.toString=function(){return"EnumValue."+this.xa};function Yn(a,y){return y==null||y===""?null:a[y]}ke.Object.defineProperties(he.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),he.className="EnumValue";function gi(){this.ew=[]}gi.prototype.toString=function(){return this.ew.join("")},gi.prototype.add=function(a){a!==""&&this.ew.push(a)},gi.className="StringBuilder";function zn(){}zn.className="PropertyCollection";var Ri={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(a){ge.console&&ge.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 hi(){}hi.prototype.reset=function(){},hi.prototype.next=function(){return!1},hi.prototype.Ad=function(){return!1},hi.prototype.first=function(){return null},hi.prototype.any=function(){return!1},hi.prototype.all=function(){return!0},hi.prototype.each=function(){return this},hi.prototype.map=function(){return this},hi.prototype.filter=function(){return this},hi.prototype.de=function(){},hi.prototype.toString=function(){return"EmptyIterator"},ke.Object.defineProperties(hi.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),hi.prototype.first=hi.prototype.first,hi.prototype.hasNext=hi.prototype.Ad,hi.prototype.next=hi.prototype.next,hi.prototype.reset=hi.prototype.reset;var xi=null;hi.className="EmptyIterator",xi=new hi;function di(a){this.key=-1,this.value=a}di.prototype.reset=function(){this.key=-1},di.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},di.prototype.Ad=function(){return this.next()},di.prototype.first=function(){return this.key=0,this.value},di.prototype.any=function(a){return this.key=-1,a(this.value)},di.prototype.all=function(a){return this.key=-1,a(this.value)},di.prototype.each=function(a){return this.key=-1,a(this.value),this},di.prototype.map=function(a){return new di(a(this.value))},di.prototype.filter=function(a){return a(this.value)?new di(this.value):xi},di.prototype.de=function(){this.value=null},di.prototype.toString=function(){return"SingletonIterator("+this.value+")"},ke.Object.defineProperties(di.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),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="SingletonIterator";function Zn(a){this.Bb=a,this.qf=null,a.Sa=null,this.qa=a.Ja,this.Za=-1}Zn.prototype.reset=function(){var a=this.Bb;a.Sa=null,this.qa=a.Ja,this.Za=-1},Zn.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},Zn.prototype.Ad=function(){return this.next()},Zn.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},Zn.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},Zn.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},Zn.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},Zn.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 Pe,a.s=x,a.xb(),a.iterator},Zn.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 Pe,a.s=x,a.xb(),a.iterator},Zn.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},Zn.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},ke.Object.defineProperties(Zn.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}}}),Zn.prototype.first=Zn.prototype.first,Zn.prototype.hasNext=Zn.prototype.Ad,Zn.prototype.next=Zn.prototype.next,Zn.prototype.reset=Zn.prototype.reset,Zn.className="ListIterator";function pi(a){this.Bb=a,a.Hg=null,this.qa=a.Ja,this.Za=a.s.length}pi.prototype.reset=function(){var a=this.Bb;a.Hg=null,this.qa=a.Ja,this.Za=a.s.length},pi.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)},pi.prototype.Ad=function(){return this.next()},pi.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},pi.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},pi.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},pi.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},pi.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 Pe,a.s=x,a.xb(),a.iterator},pi.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 Pe,a.s=x,a.xb(),a.iterator},pi.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},pi.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},ke.Object.defineProperties(pi.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),pi.prototype.first=pi.prototype.first,pi.prototype.hasNext=pi.prototype.Ad,pi.prototype.next=pi.prototype.next,pi.prototype.reset=pi.prototype.reset,pi.className="ListIteratorBackwards";function Pe(a){Dn(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof a=="string"&&ce("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}xt=Pe.prototype,xt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.toString=function(){return"List()#"+ci(this)},xt.add=function(a){return a===null?this:(this._isFrozen&&Tn(this,a),this.s.push(a),this.xb(),this)},xt.push=function(a){this.add(a)},xt.addAll=function(a){if(a===null)return this;this._isFrozen&&Tn(this);var y=this.s;if(ae(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},xt.clear=function(){this._isFrozen&&Tn(this),this.s.length=0,this.xb()},xt.contains=function(a){return a===null?!1:this.s.indexOf(a)!==-1},xt.has=function(a){return this.contains(a)},xt.indexOf=function(a){return a===null?-1:this.s.indexOf(a)},xt.M=function(a){var y=this.s;return(0>a||a>=y.length)&&ti(a,"0 <= i < length",Pe,"elt:i"),y[a]},xt.get=function(a){return this.M(a)},xt.cd=function(a,y){var x=this.s;(0>a||a>=x.length)&&ti(a,"0 <= i < length",Pe,"setElt:i"),this._isFrozen&&Tn(this,a),x[a]=y},xt.set=function(a,y){this.cd(a,y)},xt.first=function(){var a=this.s;return a.length===0?null:a[0]},xt.jc=function(){var a=this.s,y=a.length;return 0<y?a[y-1]:null},xt.pop=function(){this._isFrozen&&Tn(this);var a=this.s;return 0<a.length?a.pop():null},Pe.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},Pe.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},Pe.prototype.each=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)a(y[E]);return this},Pe.prototype.map=function(a){for(var y=new Pe,x=[],E=this.s,b=E.length,z=0;z<b;z++)x.push(a(E[z]));return y.s=x,y.xb(),y},Pe.prototype.filter=function(a){for(var y=new Pe,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},xt=Pe.prototype,xt.Gb=function(a,y){0>a&&ti(a,">= 0",Pe,"insertAt:i"),this._isFrozen&&Tn(this,a);var x=this.s;a>=x.length?x.push(y):x.splice(a,0,y),this.xb()},xt.remove=function(a){if(a===null)return!1;this._isFrozen&&Tn(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)},xt.delete=function(a){return this.remove(a)},xt.mb=function(a){var y=this.s;(0>a||a>=y.length)&&ti(a,"0 <= i < length",Pe,"removeAt:i"),this._isFrozen&&Tn(this,a),a===y.length-1?y.pop():y.splice(a,1),this.xb()},xt.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&&Tn(this);for(var b=a,z=y+1;z<E;)x[b++]=x[z++];return x.length=E-(y-a+1),this.xb(),this},Pe.prototype.copy=function(){var a=new Pe,y=this.s;return 0<y.length&&(a.s=Array.prototype.slice.call(y)),a},xt=Pe.prototype,xt.Fa=function(){for(var a=this.s,y=this.count,x=Array(y),E=0;E<y;E++)x[E]=a[E];return x},xt.Iv=function(){for(var a=new Fe,y=this.s,x=this.count,E=0;E<x;E++)a.add(y[E]);return a},xt.sort=function(a){return this._isFrozen&&Tn(this),this.s.sort(a),this.xb(),this},xt.zi=function(a,y,x){var E=this.s,b=E.length;y===void 0&&(y=0),x===void 0&&(x=b),this._isFrozen&&Tn(this);var z=x-y;if(1>=z)return this;if((0>y||y>=b-1)&&ti(y,"0 <= from < length",Pe,"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},xt.reverse=function(){return this._isFrozen&&Tn(this),this.s.reverse(),this.xb(),this},ke.Object.defineProperties(Pe.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 xi;var a=this.Sa;return a!==null?(a.reset(),a):new Zn(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return xi;var a=this.Hg;return a!==null?(a.reset(),a):new pi(this)}}}),Pe.prototype.reverse=Pe.prototype.reverse,Pe.prototype.sortRange=Pe.prototype.zi,Pe.prototype.sort=Pe.prototype.sort,Pe.prototype.toSet=Pe.prototype.Iv,Pe.prototype.toArray=Pe.prototype.Fa,Pe.prototype.removeRange=Pe.prototype.removeRange,Pe.prototype.removeAt=Pe.prototype.mb,Pe.prototype.delete=Pe.prototype.delete,Pe.prototype.remove=Pe.prototype.remove,Pe.prototype.insertAt=Pe.prototype.Gb,Pe.prototype.pop=Pe.prototype.pop,Pe.prototype.last=Pe.prototype.jc,Pe.prototype.first=Pe.prototype.first,Pe.prototype.set=Pe.prototype.set,Pe.prototype.setElt=Pe.prototype.cd,Pe.prototype.get=Pe.prototype.get,Pe.prototype.elt=Pe.prototype.M,Pe.prototype.indexOf=Pe.prototype.indexOf,Pe.prototype.has=Pe.prototype.has,Pe.prototype.contains=Pe.prototype.contains,Pe.prototype.clear=Pe.prototype.clear,Pe.prototype.addAll=Pe.prototype.addAll,Pe.prototype.push=Pe.prototype.push,Pe.prototype.add=Pe.prototype.add,Pe.prototype.thaw=Pe.prototype.ka,Pe.prototype.freeze=Pe.prototype.freeze,Pe.className="List";function io(a){this.eg=a,a.Sa=null,this.qa=a.Ja,this.sa=null}io.prototype.reset=function(){var a=this.eg;a.Sa=null,this.qa=a.Ja,this.sa=null},io.prototype.next=function(){var a=this.eg;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=y.value,this.key=y.key,!0):(this.de(),!1)},io.prototype.Ad=function(){return this.next()},io.prototype.first=function(){var a=this.eg;if(this.qa=a.Ja,a=a.ea,a!==null){this.sa=a;var y=a.value;return this.key=a.key,this.value=y}return null},io.prototype.any=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},io.prototype.all=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},io.prototype.each=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;)a(y.value),y=y.va;return this},io.prototype.map=function(a){var y=this.eg;y.Sa=null;var x=new Pe;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},io.prototype.filter=function(a){var y=this.eg;y.Sa=null;var x=new Pe;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},io.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},io.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},ke.Object.defineProperties(io.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),io.prototype.first=io.prototype.first,io.prototype.hasNext=io.prototype.Ad,io.prototype.next=io.prototype.next,io.prototype.reset=io.prototype.reset,io.className="SetIterator";function Fe(a){Dn(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&ce("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}xt=Fe.prototype,xt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.toString=function(){return"Set()#"+ci(this)},xt.add=function(a){if(a===null)return this;this._isFrozen&&Tn(this,a);var y=a;return qt(a)&&(y=Hi(a)),this.Tb[y]===void 0&&(this.Sb++,a=new zi(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},xt.addAll=function(a){if(a===null)return this;if(this._isFrozen&&Tn(this),ae(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},xt.contains=function(a){if(a===null)return!1;var y=a;return qt(a)&&(y=ci(a),y===void 0)?!1:this.Tb[y]!==void 0},xt.has=function(a){return this.contains(a)},xt.Sy=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0},xt.Ty=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1},xt.first=function(){var a=this.ea;return a===null?null:a.value},Fe.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},Fe.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},Fe.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y.value),y=y.va;return this},Fe.prototype.map=function(a){for(var y=new Fe,x=this.ea;x!==null;)y.add(a(x.value)),x=x.va;return y},Fe.prototype.filter=function(a){for(var y=new Fe,x=this.ea;x!==null;){var E=x.value;a(E)&&y.add(E),x=x.va}return y},xt=Fe.prototype,xt.remove=function(a){if(a===null)return!1;this._isFrozen&&Tn(this,a);var y=a;if(qt(a)&&(y=ci(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},xt.delete=function(a){return this.remove(a)},xt.hp=function(a){if(a===null)return this;if(this._isFrozen&&Tn(this),ae(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},xt.pA=function(a){if(a===null||this.count===0)return this;this._isFrozen&&Tn(this);var y=new Fe;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},xt.clear=function(){this._isFrozen&&Tn(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},Fe.prototype.copy=function(){var a=new Fe,y=this.Tb,x;for(x in y)a.add(y[x].value);return a},Fe.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},Fe.prototype.Hv=function(){var a=new Pe,y=this.Tb,x;for(x in y)a.add(y[x].value);return a};function Dn(a){a.__gohashid=nr++}function Hi(a){var y=a.__gohashid;return y===void 0&&(y=nr++,a.__gohashid=y),y}function ci(a){return a.__gohashid}ke.Object.defineProperties(Fe.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return xi;var a=this.Sa;return a!==null?(a.reset(),a):new io(this)}}}),Fe.prototype.toList=Fe.prototype.Hv,Fe.prototype.toArray=Fe.prototype.Fa,Fe.prototype.clear=Fe.prototype.clear,Fe.prototype.retainAll=Fe.prototype.pA,Fe.prototype.removeAll=Fe.prototype.hp,Fe.prototype.delete=Fe.prototype.delete,Fe.prototype.remove=Fe.prototype.remove,Fe.prototype.first=Fe.prototype.first,Fe.prototype.containsAny=Fe.prototype.Ty,Fe.prototype.containsAll=Fe.prototype.Sy,Fe.prototype.has=Fe.prototype.has,Fe.prototype.contains=Fe.prototype.contains,Fe.prototype.addAll=Fe.prototype.addAll,Fe.prototype.add=Fe.prototype.add,Fe.prototype.thaw=Fe.prototype.ka,Fe.prototype.freeze=Fe.prototype.freeze;var nr=1;Fe.className="Set",Fe.uniqueHash=Dn,Fe.hashIdUnique=Hi,Fe.hashId=ci;function Yi(a){this.ma=a,this.qa=a.Ja,this.sa=null}Yi.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},Yi.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)},Yi.prototype.Ad=function(){return this.next()},Yi.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},Yi.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},Yi.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},Yi.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},Yi.prototype.map=function(a){var y=this.ma;this.sa=null;var x=new Pe;for(y=y.ea;y!==null;)x.add(a(y.key)),y=y.va;return x.iterator},Yi.prototype.filter=function(a){var y=this.ma;this.sa=null;var x=new Pe;for(y=y.ea;y!==null;){var E=y.key;a(E)&&x.add(E),y=y.va}return x.iterator},Yi.prototype.de=function(){this.value=this.key=null,this.qa=-1},Yi.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},ke.Object.defineProperties(Yi.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Yi.prototype.first=Yi.prototype.first,Yi.prototype.hasNext=Yi.prototype.Ad,Yi.prototype.next=Yi.prototype.next,Yi.prototype.reset=Yi.prototype.reset,Yi.className="MapKeySetIterator";function ui(a){Fe.call(this),Dn(this),this._isFrozen=!0,this.ma=a}ne(ui,Fe),xt=ui.prototype,xt.freeze=function(){return this},xt.ka=function(){return this},xt.toString=function(){return"MapKeySet("+this.ma.toString()+")"},xt.add=function(){ce("This Set is read-only: "+this.toString())},xt.contains=function(a){return this.ma.contains(a)},xt.has=function(a){return this.contains(a)},xt.remove=function(){ce("This Set is read-only: "+this.toString())},xt.delete=function(a){return this.remove(a)},xt.clear=function(){ce("This Set is read-only: "+this.toString())},xt.first=function(){var a=this.ma.ea;return a!==null?a.key:null},ui.prototype.any=function(a){for(var y=this.ma.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},ui.prototype.all=function(a){for(var y=this.ma.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},ui.prototype.each=function(a){for(var y=this.ma.ea;y!==null;)a(y.key),y=y.va;return this},ui.prototype.map=function(a){for(var y=new Fe,x=this.ma.ea;x!==null;)y.add(a(x.key)),x=x.va;return y},ui.prototype.filter=function(a){for(var y=new Fe,x=this.ma.ea;x!==null;){var E=x.key;a(E)&&y.add(E),x=x.va}return y},ui.prototype.copy=function(){return new ui(this.ma)},ui.prototype.Iv=function(){var a=new Fe,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},ui.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},ui.prototype.Hv=function(){var a=new Pe,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},ke.Object.defineProperties(ui.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?xi:new Yi(this.ma)}}}),ui.prototype.toList=ui.prototype.Hv,ui.prototype.toArray=ui.prototype.Fa,ui.prototype.toSet=ui.prototype.Iv,ui.prototype.first=ui.prototype.first,ui.prototype.clear=ui.prototype.clear,ui.prototype.delete=ui.prototype.delete,ui.prototype.remove=ui.prototype.remove,ui.prototype.has=ui.prototype.has,ui.prototype.contains=ui.prototype.contains,ui.prototype.add=ui.prototype.add,ui.prototype.thaw=ui.prototype.ka,ui.prototype.freeze=ui.prototype.freeze,ui.className="MapKeySet";function Ki(a){this.ma=a,a.jf=null,this.qa=a.Ja,this.sa=null}Ki.prototype.reset=function(){var a=this.ma;a.jf=null,this.qa=a.Ja,this.sa=null},Ki.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)},Ki.prototype.Ad=function(){return this.next()},Ki.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},Ki.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},Ki.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},Ki.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},Ki.prototype.map=function(a){var y=this.ma;this.sa=y.jf=null;var x=new Pe;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},Ki.prototype.filter=function(a){var y=this.ma;this.sa=y.jf=null;var x=new Pe;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},Ki.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},Ki.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},ke.Object.defineProperties(Ki.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Ki.prototype.first=Ki.prototype.first,Ki.prototype.hasNext=Ki.prototype.Ad,Ki.prototype.next=Ki.prototype.next,Ki.prototype.reset=Ki.prototype.reset,Ki.className="MapValueSetIterator";function zi(a,y){this.key=a,this.value=y,this.ll=this.va=null}zi.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},zi.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 Pe;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 Pe;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"},ke.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 ln(a){Dn(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"&&ce("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}xt=ln.prototype,xt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.toString=function(){return"Map()#"+ci(this)},xt.add=function(a,y){this._isFrozen&&Tn(this,a);var x=a;qt(a)&&(x=Hi(a));var E=this.Tb[x];return E===void 0?(this.Sb++,a=new zi(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},xt.set=function(a,y){return this.add(a,y)},xt.addAll=function(a){if(a===null)return this;if(ae(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 ln)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},xt.first=function(){return this.ea},ln.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},ln.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},ln.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y),y=y.va;return this},ln.prototype.map=function(a){for(var y=new ln,x=this.ea;x!==null;)y.add(x.key,a(x)),x=x.va;return y},ln.prototype.filter=function(a){for(var y=new ln,x=this.ea;x!==null;)a(x)&&y.add(x.key,x.value),x=x.va;return y},xt=ln.prototype,xt.contains=function(a){var y=a;return qt(a)&&(y=ci(a),y===void 0)?!1:this.Tb[y]!==void 0},xt.has=function(a){return this.contains(a)},xt.I=function(a){var y=a;return qt(a)&&(y=ci(a),y===void 0)?null:(a=this.Tb[y],a===void 0?null:a.value)},xt.get=function(a){return this.I(a)},xt.remove=function(a){if(a===null)return!1;this._isFrozen&&Tn(this,a);var y=a;if(qt(a)&&(y=ci(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},xt.delete=function(a){return this.remove(a)},xt.clear=function(){this._isFrozen&&Tn(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()},ln.prototype.copy=function(){var a=new ln,y=this.Tb,x;for(x in y){var E=y[x];a.add(E.key,E.value)}return a},ln.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 zi(b.key,b.value),x++}return y},ln.prototype.Lf=function(){return new ui(this)},ke.Object.defineProperties(ln.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return xi;var a=this.Sa;return a!==null?(a.reset(),a):new Ci(this)}},iteratorKeys:{get:function(){return 0>=this.count?xi:new Yi(this)}},iteratorValues:{get:function(){if(0>=this.count)return xi;var a=this.jf;return a!==null?(a.reset(),a):new Ki(this)}}}),ln.prototype.toKeySet=ln.prototype.Lf,ln.prototype.toArray=ln.prototype.Fa,ln.prototype.clear=ln.prototype.clear,ln.prototype.delete=ln.prototype.delete,ln.prototype.remove=ln.prototype.remove,ln.prototype.get=ln.prototype.get,ln.prototype.getValue=ln.prototype.I,ln.prototype.has=ln.prototype.has,ln.prototype.contains=ln.prototype.contains,ln.prototype.first=ln.prototype.first,ln.prototype.addAll=ln.prototype.addAll,ln.prototype.set=ln.prototype.set,ln.prototype.add=ln.prototype.add,ln.prototype.thaw=ln.prototype.ka,ln.prototype.freeze=ln.prototype.freeze,ln.className="Map";function It(a,y){a===void 0?this.y=this.x=0:typeof a=="number"&&typeof y=="number"?(this.x=a,this.y=y):ce("Invalid arguments to Point constructor: "+a+", "+y),this._isFrozen=!1}var mo,xs,ta,Ps,al;It.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this},It.prototype.h=function(a,y){return this.x=a,this.y=y,this},It.prototype.sg=function(a,y){return this.x=a,this.y=y,this},It.prototype.set=function(a){return this.x=a.x,this.y=a.y,this},It.prototype.copy=function(){var a=new It;return a.x=this.x,a.y=this.y,a},xt=It.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&ce("cannot thaw constant: "+this),this._isFrozen=!1,this};function Ua(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 It(x,b)}return new It}function Wl(a){return a.x.toString()+" "+a.y.toString()}xt.toString=function(){return"Point("+this.x+","+this.y+")"},xt.D=function(a){return a instanceof It?this.x===a.x&&this.y===a.y:!1},xt.hi=function(a,y){return this.x===a&&this.y===y},xt.Xa=function(a){return Qt.B(this.x,a.x)&&Qt.B(this.y,a.y)},xt.add=function(a){return this.x+=a.x,this.y+=a.y,this},xt.re=function(a){return this.x-=a.x,this.y-=a.y,this},xt.offset=function(a,y){return this.x+=a,this.y+=y,this},It.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},xt=It.prototype,xt.scale=function(a,y){return this.x*=a,this.y*=y,this},xt.Bf=function(a){var y=a.x-this.x;return a=a.y-this.y,y*y+a*a},xt.zd=function(a,y){return a-=this.x,y-=this.y,a*a+y*y},xt.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},xt.ab=function(a){return Pl(a.x-this.x,a.y-this.y)},xt.direction=function(a,y){return Pl(a-this.x,y-this.y)};function Pl(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}xt.Ry=function(a,y){return Qt.Fl(a.x,a.y,y.x,y.y,this.x,this.y)},xt.fA=function(a,y,x,E){return Qt.qh(a,y,x,E,this.x,this.y,this),this},xt.gA=function(a,y){return Qt.qh(a.x,a.y,y.x,y.y,this.x,this.y,this),this},xt.uA=function(a,y,x,E){return Qt.No(this.x,this.y,a,y,x,E,this),this},xt.vA=function(a,y){return Qt.No(this.x,this.y,a.x,a.y,y.width,y.height,this),this},xt.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},xt.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},xt.transform=function(a){return a.Ga(this),this};function Po(a,y){return y.Cd(a),a}function Jo(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 ai(a,y,x,E){return a=x-a,y=E-y,a*a+y*y}function ii(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)}xt.w=function(){return isFinite(this.x)&&isFinite(this.y)},It.alloc=function(){var a=ki.pop();return a===void 0?new It:a},It.allocAt=function(a,y){var x=ki.pop();return x===void 0?new It(a,y):(x.x=a,x.y=y,x)},It.free=function(a){ki.push(a)},It.prototype.isReal=It.prototype.w,It.prototype.setSpot=It.prototype.yi,It.prototype.setRectSpot=It.prototype.xi,It.prototype.snapToGridPoint=It.prototype.vA,It.prototype.snapToGrid=It.prototype.uA,It.prototype.projectOntoLineSegmentPoint=It.prototype.gA,It.prototype.projectOntoLineSegment=It.prototype.fA,It.intersectingLineSegments=function(a,y,x,E,b,z,tt,ot){return Qt.Rl(a,y,x,E,b,z,tt,ot)},It.prototype.compareWithLineSegmentPoint=It.prototype.Ry,It.compareWithLineSegment=function(a,y,x,E,b,z){return Qt.Fl(a,y,x,E,b,z)},It.prototype.direction=It.prototype.direction,It.prototype.directionPoint=It.prototype.ab,It.prototype.normalize=It.prototype.normalize,It.prototype.distanceSquared=It.prototype.zd,It.prototype.distanceSquaredPoint=It.prototype.Bf,It.prototype.scale=It.prototype.scale,It.prototype.rotate=It.prototype.rotate,It.prototype.offset=It.prototype.offset,It.prototype.subtract=It.prototype.re,It.prototype.add=It.prototype.add,It.prototype.equalsApprox=It.prototype.Xa,It.prototype.equalTo=It.prototype.hi,It.prototype.equals=It.prototype.D,It.prototype.set=It.prototype.set,It.prototype.setTo=It.prototype.sg;var ki=[];It.className="Point",It.parse=Ua,It.stringify=Wl,It.distanceLineSegmentSquared=Jo,It.distanceSquared=ai,It.direction=ii,It.Origin=mo=new It(0,0).ja(),It.InfiniteTopLeft=xs=new It(-1/0,-1/0).ja(),It.InfiniteBottomRight=ta=new It(1/0,1/0).ja(),It.SixPoint=Ps=new It(6,6).ja(),It.NoPoint=al=new It(NaN,NaN).ja(),It.parse=Ua,It.stringify=Wl,It.distanceLineSegmentSquared=Jo,It.distanceSquared=ai,It.direction=ii;function Ke(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):ce("Invalid arguments to Size constructor: "+a+", "+y),this._isFrozen=!1}var oo,vo,Xo,Eo,Ro,ar,hs;Ke.prototype.assign=function(a){return this.width=a.width,this.height=a.height,this},Ke.prototype.h=function(a,y){return this.width=a,this.height=y,this},Ke.prototype.sg=function(a,y){return this.width=a,this.height=y,this},Ke.prototype.set=function(a){return this.width=a.width,this.height=a.height,this},Ke.prototype.copy=function(){var a=new Ke;return a.width=this.width,a.height=this.height,a},xt=Ke.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&ce("cannot thaw constant: "+this),this._isFrozen=!1,this};function Tr(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 Ke(x,b)}return new Ke}function Ya(a){return a.width.toString()+" "+a.height.toString()}xt.toString=function(){return"Size("+this.width+","+this.height+")"},xt.D=function(a){return a instanceof Ke?this.width===a.width&&this.height===a.height:!1},xt.hi=function(a,y){return this.width===a&&this.height===y},xt.Xa=function(a){return Qt.B(this.width,a.width)&&Qt.B(this.height,a.height)},xt.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},xt.w=function(){return isFinite(this.width)&&isFinite(this.height)},Ke.alloc=function(){var a=Na.pop();return a===void 0?new Ke:a},Ke.free=function(a){Na.push(a)},Ke.prototype.isReal=Ke.prototype.w,Ke.prototype.inflate=Ke.prototype.Bc,Ke.prototype.equalsApprox=Ke.prototype.Xa,Ke.prototype.equalTo=Ke.prototype.hi,Ke.prototype.equals=Ke.prototype.D,Ke.prototype.set=Ke.prototype.set,Ke.prototype.setTo=Ke.prototype.sg;var Na=[];Ke.className="Size",Ke.parse=Tr,Ke.stringify=Ya,Ke.ZeroSize=oo=new Ke(0,0).ja(),Ke.OneSize=vo=new Ke(1,1).ja(),Ke.SixSize=Xo=new Ke(6,6).ja(),Ke.EightSize=Eo=new Ke(8,8).ja(),Ke.TenSize=Ro=new Ke(10,10).ja(),Ke.InfiniteSize=ar=new Ke(1/0,1/0).ja(),Ke.NoSize=hs=new Ke(NaN,NaN).ja(),Ke.parse=Tr,Ke.stringify=Ya;function pe(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 It?(x=a.x,a=a.y,y instanceof It?(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 Ke?(this.x=x,this.y=a,this.width=y.width,this.height=y.height):ce("Incorrect second argument supplied to Rect constructor "+y)):ce("Invalid arguments to Rect constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}xt=pe.prototype,xt.assign=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},xt.h=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this};function Vo(a,y,x){a.width=y,a.height=x}xt.sg=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this},xt.set=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},xt.dd=function(a){return this.x=a.x,this.y=a.y,this},xt.tA=function(a){return this.width=a.width,this.height=a.height,this},pe.prototype.copy=function(){var a=new pe;return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},xt=pe.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&ce("cannot thaw constant: "+this),this._isFrozen=!1,this};function ba(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 pe(x,b,z,tt)}return new pe}function Ka(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}xt.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},xt.D=function(a){return a instanceof pe?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1},xt.hi=function(a,y,x,E){return this.x===a&&this.y===y&&this.width===x&&this.height===E},xt.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 Io(a,y){return Qt.$(a.x,y.x)&&Qt.$(a.y,y.y)&&Qt.$(a.width,y.width)&&Qt.$(a.height,y.height)}xt.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y},xt.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},xt.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},xt.offset=function(a,y){return this.x+=a,this.y+=y,this},xt.Bc=function(a,y){return Vs(this,y,a,y,a)},xt.Co=function(a){return Vs(this,a.top,a.right,a.bottom,a.left)},xt.Fv=function(a){return Vs(this,-a.top,-a.right,-a.bottom,-a.left)},xt.Hz=function(a,y,x,E){return Vs(this,a,y,x,E)};function Vs(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}xt.Ex=function(a){return Vl(this,a.x,a.y,a.width,a.height)},xt.Uu=function(a,y,x,E){return Vl(this,a,y,x,E)};function Vl(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}xt.Yc=function(a){return this.Vu(a.x,a.y,a.width,a.height)},xt.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 wl(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))}xt.Ye=function(a){return yo(this,a.x,a.y,0,0)},xt.ed=function(a){return yo(this,a.x,a.y,a.width,a.height)},xt.Kv=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),yo(this,a,y,x,E)};function yo(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}xt.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 lr(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 bi(a,y,x,E,b,z,tt,ot){return a>tt+b||b>x+a?!1:!(y>ot+z||z>E+y)}xt.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},xt.Mz=function(){return this.width===0&&this.height===0},pe.alloc=function(){var a=Zo.pop();return a===void 0?new pe:a},pe.allocAt=function(a,y,x,E){var b=Zo.pop();return b===void 0?new pe(a,y,x,E):b.h(a,y,x,E)},pe.free=function(a){Zo.push(a)},ke.Object.defineProperties(pe.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 It(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}},size:{get:function(){return new Ke(this.width,this.height)},set:function(a){this.width=a.width,this.height=a.height}},center:{get:function(){return new It(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}}}),pe.prototype.isEmpty=pe.prototype.Mz,pe.prototype.isReal=pe.prototype.w,pe.intersectsLineSegment=function(a,y,x,E,b,z,tt,ot){return Qt.Fx(a,y,x,E,b,z,tt,ot)},pe.prototype.setSpot=pe.prototype.yi,pe.prototype.union=pe.prototype.Kv,pe.prototype.unionRect=pe.prototype.ed,pe.prototype.unionPoint=pe.prototype.Ye,pe.prototype.intersects=pe.prototype.Vu,pe.prototype.intersectsRect=pe.prototype.Yc,pe.prototype.intersect=pe.prototype.Uu,pe.prototype.intersectRect=pe.prototype.Ex,pe.prototype.grow=pe.prototype.Hz,pe.prototype.subtractMargin=pe.prototype.Fv,pe.prototype.addMargin=pe.prototype.Co,pe.prototype.inflate=pe.prototype.Bc,pe.prototype.offset=pe.prototype.offset,pe.prototype.contains=pe.prototype.contains,pe.prototype.containsRect=pe.prototype.Re,pe.prototype.containsPoint=pe.prototype.ca,pe.prototype.equalsApprox=pe.prototype.Xa,pe.prototype.equalTo=pe.prototype.hi,pe.prototype.equals=pe.prototype.D,pe.prototype.setSize=pe.prototype.tA,pe.prototype.setPoint=pe.prototype.dd,pe.prototype.set=pe.prototype.set,pe.prototype.setTo=pe.prototype.sg;var Wi=null,wo=null,Zo=[];pe.className="Rect",pe.parse=ba,pe.stringify=Ka,pe.contains=lr,pe.intersects=bi,pe.ZeroRect=Wi=new pe(0,0,0,0).ja(),pe.NoRect=wo=new pe(NaN,NaN,NaN,NaN).ja(),pe.parse=ba,pe.stringify=Ka,pe.contains=lr,pe.intersects=bi;function qn(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):ce("Invalid arguments to Margin constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}qn.prototype.assign=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},qn.prototype.sg=function(a,y,x,E){return this.top=a,this.right=y,this.bottom=x,this.left=E,this},qn.prototype.set=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},qn.prototype.copy=function(){var a=new qn;return a.top=this.top,a.right=this.right,a.bottom=this.bottom,a.left=this.left,a},xt=qn.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&ce("cannot thaw constant: "+this),this._isFrozen=!1,this};function zo(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 qn;for(var b=NaN;a[y]==="";)y++;if((E=a[y++])&&(b=parseFloat(E)),isNaN(b))return new qn(x);for(var z=NaN;a[y]==="";)y++;if((E=a[y++])&&(z=parseFloat(E)),isNaN(z))return new qn(x,b);for(var tt=NaN;a[y]==="";)y++;return(E=a[y++])&&(tt=parseFloat(E)),isNaN(tt)?new qn(x,b):new qn(x,b,z,tt)}return new qn}function Rr(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}xt.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},xt.D=function(a){return a instanceof qn?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1},xt.hi=function(a,y,x,E){return this.top===a&&this.right===y&&this.bottom===x&&this.left===E},xt.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)},xt.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},qn.alloc=function(){var a=Ul.pop();return a===void 0?new qn:a},qn.free=function(a){Ul.push(a)},qn.prototype.isReal=qn.prototype.w,qn.prototype.equalsApprox=qn.prototype.Xa,qn.prototype.equalTo=qn.prototype.hi,qn.prototype.equals=qn.prototype.D,qn.prototype.set=qn.prototype.set,qn.prototype.setTo=qn.prototype.sg;var ds=null,fu=null,Ul=[];qn.className="Margin",qn.parse=zo,qn.stringify=Rr,qn.ZeroMargin=ds=new qn(0,0,0,0).ja(),qn.TwoMargin=fu=new qn(2,2,2,2).ja(),qn.parse=zo,qn.stringify=Rr;function En(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 pr,Cr,ll,Wh,Vh,Di,Fd,Cl,ea,na,gu,eh,ia,Xa,Nd,Yf,kc,Kf,Mc,bd,pu,Za,Ec,Fc,Xf,Lr,Tp,Zf,Td,Uh,bs,Ts,zr,cs,Nc,Ad;En.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},En.prototype.sg=function(a,y,x,E){return this.x=a,this.y=y,this.offsetX=x,this.offsetY=E,this},En.prototype.set=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},En.prototype.copy=function(){var a=new En;return a.x=this.x,a.y=this.y,a.offsetX=this.offsetX,a.offsetY=this.offsetY,a},xt=En.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&ce("cannot thaw constant: "+this),this._isFrozen=!1,this};function ur(a,y){return a.x=NaN,a.y=NaN,a.offsetX=y,a}function bc(a){if(typeof a=="string"){if(a=a.trim(),a==="None")return pr;if(a==="TopLeft")return Cr;if(a==="Top"||a==="TopCenter"||a==="MiddleTop")return ll;if(a==="TopRight")return Wh;if(a==="Left"||a==="LeftCenter"||a==="MiddleLeft")return Vh;if(a==="Center")return Di;if(a==="Right"||a==="RightCenter"||a==="MiddleRight")return Fd;if(a==="BottomLeft")return Cl;if(a==="Bottom"||a==="BottomCenter"||a==="MiddleBottom")return ea;if(a==="BottomRight")return na;if(a==="TopSide")return gu;if(a==="LeftSide")return eh;if(a==="RightSide")return ia;if(a==="BottomSide")return Xa;if(a==="TopBottomSides")return Nd;if(a==="LeftRightSides")return Yf;if(a==="TopLeftSides")return kc;if(a==="TopRightSides")return Kf;if(a==="BottomLeftSides")return Mc;if(a==="BottomRightSides")return bd;if(a==="NotTopSide")return pu;if(a==="NotLeftSide")return Za;if(a==="NotRightSide")return Ec;if(a==="NotBottomSide")return Fc;if(a==="AllSides")return Xf;if(a==="Default")return Lr;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 En(x,b,z,tt)}return new En}function Tc(a){return a.sb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()}xt.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(pr)?"None":this.D(Cr)?"TopLeft":this.D(ll)?"Top":this.D(Wh)?"TopRight":this.D(Vh)?"Left":this.D(Di)?"Center":this.D(Fd)?"Right":this.D(Cl)?"BottomLeft":this.D(ea)?"Bottom":this.D(na)?"BottomRight":this.D(gu)?"TopSide":this.D(eh)?"LeftSide":this.D(ia)?"RightSide":this.D(Xa)?"BottomSide":this.D(Nd)?"TopBottomSides":this.D(Yf)?"LeftRightSides":this.D(kc)?"TopLeftSides":this.D(Kf)?"TopRightSides":this.D(Mc)?"BottomLeftSides":this.D(bd)?"BottomRightSides":this.D(pu)?"NotTopSide":this.D(Za)?"NotLeftSide":this.D(Ec)?"NotRightSide":this.D(Fc)?"NotBottomSide":this.D(Xf)?"AllSides":this.D(Lr)?"Default":"None"},xt.D=function(a){return a instanceof En?(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},xt.gv=function(){return new En(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},xt.Hf=function(a){if(!this.$c())return!1;if(!a.$c())if(a.D(Tp))a=eh;else if(a.D(Zf))a=ia;else if(a.D(Td))a=gu;else if(a.D(Uh))a=Xa;else return!1;return a=a.offsetY,(this.offsetY&a)===a},xt.sb=function(){return!isNaN(this.x)&&!isNaN(this.y)},xt.Mc=function(){return isNaN(this.x)||isNaN(this.y)},xt.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0},xt.ys=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0},xt.Xb=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0},En.alloc=function(){var a=Ac.pop();return a===void 0?new En:a},En.free=function(a){Ac.push(a)},En.prototype.isDefault=En.prototype.Xb,En.prototype.isNone=En.prototype.ys,En.prototype.isSide=En.prototype.$c,En.prototype.isNoSpot=En.prototype.Mc,En.prototype.isSpot=En.prototype.sb,En.prototype.includesSide=En.prototype.Hf,En.prototype.opposite=En.prototype.gv,En.prototype.equals=En.prototype.D,En.prototype.set=En.prototype.set,En.prototype.setTo=En.prototype.sg;var Ac=[];En.className="Spot",En.parse=bc,En.stringify=Tc,En.None=pr=ur(new En(0,0,0,0),0).ja(),En.Default=Lr=ur(new En(0,0,-1,0),-1).ja(),En.TopLeft=Cr=new En(0,0,0,0).ja(),En.TopCenter=ll=new En(.5,0,0,0).ja(),En.TopRight=Wh=new En(1,0,0,0).ja(),En.LeftCenter=Vh=new En(0,.5,0,0).ja(),En.Center=Di=new En(.5,.5,0,0).ja(),En.RightCenter=Fd=new En(1,.5,0,0).ja(),En.BottomLeft=Cl=new En(0,1,0,0).ja(),En.BottomCenter=ea=new En(.5,1,0,0).ja(),En.BottomRight=na=new En(1,1,0,0).ja(),En.MiddleTop=bs=ll,En.MiddleLeft=Ts=Vh,En.MiddleRight=zr=Fd,En.MiddleBottom=cs=ea,En.Top=Td=ll,En.Left=Tp=Vh,En.Right=Zf=Fd,En.Bottom=Uh=ea,En.TopSide=gu=ur(new En(0,0,1,1),1).ja(),En.LeftSide=eh=ur(new En(0,0,1,2),1).ja(),En.RightSide=ia=ur(new En(0,0,1,4),1).ja(),En.BottomSide=Xa=ur(new En(0,0,1,8),1).ja(),En.TopBottomSides=Nd=ur(new En(0,0,1,9),1).ja(),En.LeftRightSides=Yf=ur(new En(0,0,1,6),1).ja(),En.TopLeftSides=kc=ur(new En(0,0,1,3),1).ja(),En.TopRightSides=Kf=ur(new En(0,0,1,5),1).ja(),En.BottomLeftSides=Mc=ur(new En(0,0,1,10),1).ja(),En.BottomRightSides=bd=ur(new En(0,0,1,12),1).ja(),En.NotTopSide=pu=ur(new En(0,0,1,14),1).ja(),En.NotLeftSide=Za=ur(new En(0,0,1,13),1).ja(),En.NotRightSide=Ec=ur(new En(0,0,1,11),1).ja(),En.NotBottomSide=Fc=ur(new En(0,0,1,7),1).ja(),En.AllSides=Xf=ur(new En(0,0,1,15),1).ja(),Nc=new En(.156,.156).ja(),Ad=new En(.844,.844).ja(),En.parse=bc,En.stringify=Tc;function oi(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}oi.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},oi.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},oi.prototype.copy=function(){var a=new oi;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},oi.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},oi.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},oi.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},oi.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},oi.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},oi.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},oi.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},oi.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},xt=oi.prototype,xt.translate=function(a,y){return this.dx+=this.m11*a+this.m21*y,this.dy+=this.m12*a+this.m22*y,this},xt.scale=function(a,y){return y===void 0&&(y=a),this.m11*=a,this.m12*=a,this.m21*=y,this.m22*=y,this},xt.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)},xt.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))},xt.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))},xt.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,Pt=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,Pt),mt=Math.max(mt,Pt),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},oi.alloc=function(){var a=Jf.pop();return a===void 0?new oi:a},oi.free=function(a){Jf.push(a)},oi.prototype.transformRect=oi.prototype.pp,oi.prototype.transformPoint=oi.prototype.Ga,oi.prototype.scale=oi.prototype.scale,oi.prototype.translate=oi.prototype.translate,oi.prototype.rotate=oi.prototype.rotate,oi.prototype.invert=oi.prototype.Vj,oi.prototype.multiplyInverted=oi.prototype.bv,oi.prototype.multiply=oi.prototype.multiply,oi.prototype.reset=oi.prototype.reset,oi.prototype.isIdentity=oi.prototype.ws,oi.prototype.equals=oi.prototype.D,oi.prototype.setTransform=oi.prototype.setTransform,oi.prototype.set=oi.prototype.set;var Jf=[];oi.className="Transform",oi.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,Pt=(x+b)/2,kt=(E+z)/2;b=(b+tt)/2,z=(z+ot)/2,E=(mt+Pt)/2,x=(yt+kt)/2,Pt=(Pt+b)/2,kt=(kt+z)/2;var Dt=(E+Pt)/2,Tt=(x+kt)/2;return Qt.cs(a,y,mt,yt,E,x,Dt,Tt,rt,at,ut,ft)||Qt.cs(Dt,Tt,Pt,kt,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 ii(((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))yo(at,a,y,0,0),yo(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 Pt=(E+mt)/2,kt=(x+yt)/2;Qt.Dl(a,y,ut,ft,E,x,Pt,kt,rt,at),Qt.Dl(Pt,kt,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 Pt=(E+mt)/2,kt=(x+yt)/2;Qt.Qe(a,y,ut,ft,E,x,Pt,kt,rt,at),Qt.Qe(Pt,kt,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))yo(ot,a,y,0,0),yo(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 Pt=(a+x)/2,kt=(y+E)/2,Dt=(x+b)/2,Tt=(E+z)/2;b=(b+tt)/2,z=(z+ot)/2,E=(Pt+Dt)/2,x=(kt+Tt)/2,Dt=(Dt+b)/2,Tt=(Tt+z)/2;var Rt=(E+Dt)/2,Gt=(x+Tt)/2,Vt=1/0,Xt=!1,ie=0,Xe=0;return Qt.Eo(a,y,Pt,kt,E,x,Rt,Gt,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,ie=yt.x,Xe=yt.y)),Qt.Eo(Rt,Gt,Dt,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,ie=yt.x,Xe=yt.y),Xt&&(yt.x=ie,yt.y=Xe),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 Pt=((a*ot-y*tt)*(rt-ut)-(a-tt)*(rt*ft-at*ut))/mt,kt=((a*ot-y*tt)*(at-ft)-(y-ot)*(rt*ft-at*ut))/mt;if(Pt>=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),kt<rt||kt>a)return yt}else if(a<tt?(rt=a,a=tt):rt=tt,Pt<rt||Pt>a)return yt;0<mt?yt++:0>mt&&yt--}else{Pt=(a+x)/2,kt=(y+E)/2;var Dt=(x+b)/2,Tt=(E+z)/2;b=(b+tt)/2,z=(z+ot)/2,E=(Pt+Dt)/2,x=(kt+Tt)/2,Dt=(Dt+b)/2,Tt=(Tt+z)/2;var Rt=(E+Dt)/2,Gt=(x+Tt)/2;yt+=Qt.Fo(a,y,Pt,kt,E,x,Rt,Gt,rt,at,ut,ft,mt),yt+=Qt.Fo(Rt,Gt,Dt,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(Dt,Tt){var Rt=(Dt-a)*(Dt-a)+(Tt-y)*(Tt-y);Rt<ft&&(ft=Rt,rt.h(Dt,Tt))}var ft=1/0;ut(rt.x,rt.y);var mt=0,yt=0,Pt=0,kt=0;if(b<tt?(mt=b,yt=tt):(mt=tt,yt=b),z<ot?(Pt=b,kt=tt):(Pt=tt,kt=b),mt=(yt-mt)/2+at,at=(kt-Pt)/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):!!(lr(a,y,x,E,b,z)||lr(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 zn,um:new zn,Mf:new zn,Nf:0,vm:100};Qt.za=Qt.AA;function Ve(a){Dn(this),this.l=2,a===void 0&&(a=Ve.o),this.na=a,this.Ec=this.Dc=this.pd=this.od=0,a===Ve.o?this.ee=new Pe:(Ve.V===null&&(Ve.V=new Pe().freeze()),this.ee=Ve.V),this.aq=this.ee.Ja,this.Ip=new pe().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=Cr,this.gg=na,this.Rk=this.Sk=NaN,this.Uf=Te}Ve.prototype.copy=function(){var a=new Ve;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===Ve.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},Ve.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},Ve.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==Ve.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},Ve.prototype.ka=function(){if(Object.isFrozen(this)&&ce("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==Ve.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},Ve.prototype.Xa=function(a){if(!(a instanceof Ve))return!1;if(this.type!==a.type)return this.type===Ve.j&&a.type===Ve.o?Ap(this,a):a.type===Ve.j&&this.type===Ve.o?Ap(a,this):!1;if(this.type===Ve.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 Ap(a,y){return a.type!==Ve.j||y.type!==Ve.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===to&&Qt.B(a.endX,y.endX)&&Qt.B(a.endY,y.endY))))}Ve.ia=function(a){return a.toString()},Ve.prototype.qb=function(a){a.classType===Ve&&(this.type=a)},Ve.prototype.toString=function(a){switch(a===void 0&&(a=-1),this.type){case Ve.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 Ve.u:var y=new pe(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 Ve.F:if(y=new pe(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 Ve.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()}},Ve.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},Ve.parse=function(a,y){function x(){return kt>=Vt-1?!0:at[kt+1].match(Xt)!==null}function E(){return kt++,at[kt]}function b(Wn){var jn=parseFloat(E()),Ei=parseFloat(E());Dt===Dt.toLowerCase()&&(jn=Gt.x+jn,Ei=Gt.y+Ei),Wn.h(jn,Ei)}function z(){return b(Gt),Gt}function tt(){return b(Rt),Rt}function ot(){var Wn=Tt.toLowerCase();return Wn!=="c"&&Wn!=="s"&&Wn!=="q"&&Wn!=="t"?Gt:new It(2*Gt.x-Rt.x,2*Gt.y-Rt.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=gn();for(var ft="",mt=!1,yt=0;yt<ut.length;yt++){var Pt=ut[yt];Pt!=="."||mt?Pt==="."?(rt.push(ft),ft="."):ft+=Pt:(mt=!0,ft+=Pt)}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,Ye(rt)}}var kt=-1,Dt="",Tt="";rt=new It(0,0);var Rt=new It(0,0),Gt=new It(0,0),Vt=at.length;a=b1(null),mt=ft=ut=!1,yt=!0,Pt=null;for(var Xt=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(kt>=Vt-1);)if(Tt=Dt,Dt=E(),Dt!=="")switch(Dt.toUpperCase()){case"X":yt=!0,ft=ut=!1;break;case"M":for(Pt=z(),a.mc===null||yt===!0?(Sf(a,Pt.x,Pt.y,ut,!ft,mt),yt=!1):a.moveTo(Pt.x,Pt.y),rt.assign(Gt);!x();)Pt=z(),a.lineTo(Pt.x,Pt.y);break;case"L":for(;!x();)Pt=z(),a.lineTo(Pt.x,Pt.y);break;case"H":for(;!x();)Gt=new It((Dt===Dt.toLowerCase()?Gt.x:0)+parseFloat(E()),Gt.y),a.lineTo(Gt.x,Gt.y);break;case"V":for(;!x();)Gt=new It(Gt.x,(Dt===Dt.toLowerCase()?Gt.y:0)+parseFloat(E())),a.lineTo(Gt.x,Gt.y);break;case"C":for(;!x();){Pt=new It,b(Pt);var ie=tt(),Xe=z();ju(a,Pt.x,Pt.y,ie.x,ie.y,Xe.x,Xe.y)}break;case"S":for(;!x();)Pt=ot(),ie=tt(),Xe=z(),ju(a,Pt.x,Pt.y,ie.x,ie.y,Xe.x,Xe.y);break;case"Q":for(;!x();)Pt=tt(),ie=z(),Im(a,Pt.x,Pt.y,ie.x,ie.y);break;case"T":for(;!x();)Rt=Pt=ot(),ie=z(),Im(a,Pt.x,Pt.y,ie.x,ie.y);break;case"B":for(;!x();){Pt=parseFloat(E()),ie=parseFloat(E()),Xe=parseFloat(E());var an=parseFloat(E()),on=parseFloat(E()),je=on,Me=!1;x()||(je=parseFloat(E()),x()||(Me=parseFloat(E())!==0)),Dt===Dt.toLowerCase()&&(Xe+=Gt.x,an+=Gt.y),a.arcTo(Pt,ie,Xe,an,on,je,Me)}break;case"A":for(;!x();)Pt=Math.abs(parseFloat(E())),ie=Math.abs(parseFloat(E())),Xe=parseFloat(E()),on=an=!1,Me=je=0,je=E(),je.length===1?(an=!!parseFloat(je),on=!!parseFloat(E()),je=parseFloat(E())):je.length===2?(an=!!parseFloat(je[0]),on=!!parseFloat(je[1]),je=parseFloat(E())):(an=!!parseFloat(je[0]),on=!!parseFloat(je[1]),je=parseFloat(je.slice(2))),Me=parseFloat(E()),Dt===Dt.toLowerCase()&&(je=Gt.x+je,Me=Gt.y+Me),Gt.h(je,Me),wx(a,Pt,ie,Xe,an,on,je,Me);break;case"Z":Px(a),Gt.assign(rt);break;case"F":for(Pt="",ie=1;at[kt+ie];)if(at[kt+ie]==="0")mt=!0,ie++;else if(at[kt+ie].match(/[Uu]/)!==null)ie++;else if(at[kt+ie].match(Xt)===null)ie++;else{Pt=at[kt+ie];break}Pt.match(/[Mm]/)?ut=!0:0<a.mc.segments.length&&(a.mc.isFilled=!0);break;case"U":for(Pt="",ie=1;at[kt+ie];)if(at[kt+ie].match(/[Ff]/)!==null)ie++;else if(at[kt+ie].match(Xt)===null)ie++;else{Pt=at[kt+ie];break}Pt.match(/[Mm]/)?ft=!0:a.mc.isShadowed=!1}if(rt=a.os,jm=a,y)for(y=rt.figures.iterator;y.next();)y.value.isFilled=!0;return rt},Ve.Ha=function(a,y){for(var x=a.length,E=It.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}It.free(E)},Ve.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===Ve.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},Ve.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===Ve.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),Bp(this,a,!1),yo(a,0,0,0,0),a.freeze()},Ve.prototype.ix=function(){var a=new pe;return Bp(this,a,!0),a};function Bp(a,y,x){switch(a.type){case Ve.j:case Ve.u:case Ve.F:x?y.h(a.od,a.pd,0,0):yo(y,a.od,a.pd,0,0),yo(y,a.Dc,a.Ec,0,0);break;case Ve.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):yo(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 to:case qo:rt=ft.endX,at=ft.endY,yo(y,rt,at,0,0);break;case kr: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 Us:Qt.iv(rt,at,ft.point1X,ft.point1Y,ft.endX,ft.endY,.5,y),rt=ft.endX,at=ft.endY;break;case jo:case oa:var mt=ft.type===jo?As(ft,z):va(ft,z,rt,at),yt=mt.length;if(yt===0){rt=ft.type===jo?ft.centerX:ft.endX,at=ft.type===jo?ft.centerY:ft.endY,yo(y,rt,at,0,0);break}ft=null;for(var Pt=0;Pt<yt;Pt++)ft=mt[Pt],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:ce("Unknown Segment type: "+ft.type)}}}break;default:ce("Unknown Geometry type: "+a.type)}}Ve.prototype.normalize=function(){this._isFrozen&&Tn(this);var a=this.ix();return this.offset(-a.x,-a.y),new It(-a.x,-a.y)},Ve.prototype.offset=function(a,y){return this._isFrozen&&Tn(this),this.transform(1,0,0,1,a,y),this},Ve.prototype.scale=function(a,y){return this._isFrozen&&Tn(this),this.transform(a,0,0,y,0,0),this},Ve.prototype.rotate=function(a,y,x){this._isFrozen&&Tn(this),y===void 0&&(y=0),x===void 0&&(x=0);var E=oi.alloc();return E.reset(),E.rotate(a,y,x),this.transform(E.m11,E.m12,E.m21,E.m22,E.dx,E.dy),oi.free(E),this},xt=Ve.prototype,xt.transform=function(a,y,x,E,b,z){switch(this.type){case Ve.j:case Ve.u:case Ve.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 Ve.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 Pt=ft[yt];switch(Pt.type){case to:case qo:tt=Pt.endX,ot=Pt.endY,Pt.endX=tt*a+ot*x+b,Pt.endY=tt*y+ot*E+z;break;case kr:tt=Pt.point1X,ot=Pt.point1Y,Pt.point1X=tt*a+ot*x+b,Pt.point1Y=tt*y+ot*E+z,tt=Pt.point2X,ot=Pt.point2Y,Pt.point2X=tt*a+ot*x+b,Pt.point2Y=tt*y+ot*E+z,tt=Pt.endX,ot=Pt.endY,Pt.endX=tt*a+ot*x+b,Pt.endY=tt*y+ot*E+z;break;case Us:tt=Pt.point1X,ot=Pt.point1Y,Pt.point1X=tt*a+ot*x+b,Pt.point1Y=tt*y+ot*E+z,tt=Pt.endX,ot=Pt.endY,Pt.endX=tt*a+ot*x+b,Pt.endY=tt*y+ot*E+z;break;case jo:tt=Pt.centerX,ot=Pt.centerY,Pt.centerX=tt*a+ot*x+b,Pt.centerY=tt*y+ot*E+z,y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),Pt.startAngle+=tt),0>a&&(Pt.startAngle=180-Pt.startAngle,Pt.sweepAngle=-Pt.sweepAngle),0>E&&(Pt.startAngle=-Pt.startAngle,Pt.sweepAngle=-Pt.sweepAngle),Pt.radiusX*=Math.sqrt(a*a+x*x),Pt.radiusY!==void 0&&(Pt.radiusY*=Math.sqrt(y*y+E*E));break;case oa:if(tt=Pt.endX,ot=Pt.endY,Pt.endX=tt*a+ot*x+b,Pt.endY=tt*y+ot*E+z,Pt.radiusX===0||Pt.radiusY===0)break;y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),Pt.xAxisRotation+=tt),0>a&&(Pt.xAxisRotation=180-Pt.xAxisRotation,Pt.isClockwiseArc=!Pt.isClockwiseArc),0>E&&(Pt.xAxisRotation=-Pt.xAxisRotation,Pt.isClockwiseArc=!Pt.isClockwiseArc),Pt.radiusX*=Math.sqrt(a*a+x*x),Pt.radiusY*=Math.sqrt(y*y+E*E);break;default:ce("Unknown Segment type: "+Pt.type)}}}}return this._isInvalidBounds=!0,this},xt.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 Ve.j:return Qt.Yb(x,E,b,z,y,a.x,a.y);case Ve.u:var tt=pe.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),pe.free(tt),a;case Ve.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 Ve.o:return Yl(this,a,y,!0,!1);default:return!1}};function Yl(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,Pt=0;Pt<yt;Pt++){var kt=mt[Pt],Dt=!kt.isEvenOdd;if(kt.isFilled){if(E&&kt.ca(z,y,x))return!0;var Tt=kt.segments;rt=kt.startX,at=kt.startY;for(var Rt=rt,Gt=at,Vt=Tt.s,Xt=0;Xt<=Tt.length;Xt++){var ie=void 0;if(Xt!==Tt.length){ie=Vt[Xt];var Xe=ie.type;a=ie.endX,ft=ie.endY}else Xe=to,a=Rt,ft=Gt;switch(Xe){case qo:if(Rt=Kl(z,y,tt,y,rt,at,Rt,Gt),isNaN(Rt))return!0;ot+=Rt,Rt=a,Gt=ft;break;case to:if(rt=Kl(z,y,tt,y,rt,at,a,ft),isNaN(rt))return!0;ot+=rt;break;case kr:ut=Qt.Fo(rt,at,ie.point1X,ie.point1Y,ie.point2X,ie.point2Y,a,ft,tt,y,z,y,.5),ot+=ut;break;case Us:ut=Qt.Fo(rt,at,(rt+2*ie.point1X)/3,(at+2*ie.point1Y)/3,(2*ie.point1X+a)/3,(2*ie.point1Y+ft)/3,a,ft,tt,y,z,y,.5),ot+=ut;break;case jo:case oa:Xe=ie.type===jo?As(ie,kt):va(ie,kt,rt,at);var an=Xe.length;if(an===0){if(rt=Kl(z,y,tt,y,rt,at,ie.type===jo?ie.centerX:ie.endX,ie.type===jo?ie.centerY:ie.endY),isNaN(rt))return!0;ot+=rt;break}ie=null;for(var on=0;on<an;on++){if(ie=Xe[on],on===0){if(ut=Kl(z,y,tt,y,rt,at,ie[0],ie[1]),isNaN(ut))return!0;ot+=ut}ut=Qt.Fo(ie[0],ie[1],ie[2],ie[3],ie[4],ie[5],ie[6],ie[7],tt,y,z,y,.5),ot+=ut}ie!==null&&(a=ie[6],ft=ie[7]);break;default:ce("Unknown Segment type: "+ie.type)}rt=a,at=ft}if(Dt){if(ot!==0)return!0}else if(ot%2!==0)return!0;ot=0}else if(kt.ca(z,y,b?x:x+2))return!0}return!1}function Kl(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 nh(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}xt.Pu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=new It),this.type===Ve.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},xt.wx=function(a){if(0>a?a=0:1<a&&(a=1),this.type===Ve.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},xt.Qu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=[]),y.length=3,this.type===Ve.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},xt.xx=function(a){if(this.type===Ve.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=It.alloc();return Qt.qh(y,x,E,b,z,a,ot),a=ot.x,z=ot.y,It.free(ot),Math.sqrt(((a-y)*(a-y)+(z-x)*(z-x))/tt)}}else if(this.type===Ve.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=It.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],Pt=mt.length,kt=0;kt<Pt;kt+=2){var Dt=mt[kt],Tt=mt[kt+1];if(kt!==0){Qt.qh(at,ut,Dt,Tt,a.x,a.y,E);var Rt=(E.x-a.x)*(E.x-a.x)+(E.y-a.y)*(E.y-a.y);Rt<b&&(b=Rt,tt=ot,tt+=Math.sqrt((E.x-at)*(E.x-at)+(E.y-ut)*(E.y-ut))),ot+=yt[(kt-2)/2]}at=Dt,ut=Tt}return It.free(E),a=tt/z,0>a?0:1<a?1:a}return 0};function Bc(a){if(a.tk===null){var y=a.tk=[],x=a.ym=[],E=[],b=[];if(a.type===Ve.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===Ve.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===Ve.F){var z=new Qo;z.startX=a.endX,z.startY=(a.startY+a.endY)/2;var tt=new Mi(jo);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=As(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(Bd(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 qo:4<=E.length&&(y.push(E),x.push(Bd(E))),E=[],E.push(mt.endX),E.push(mt.endY),tt=mt.endX,z=mt.endY,ot=tt,rt=z;break;case to:E.push(mt.endX),E.push(mt.endY),tt=mt.endX,z=mt.endY;break;case kr: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 Us:Qt.ep(tt,z,mt.point1X,mt.point1Y,mt.endX,mt.endY,.5,E),tt=mt.endX,z=mt.endY;break;case jo:var yt=As(mt,b),Pt=yt.length;if(Pt===0){E.push(mt.centerX),E.push(mt.centerY),tt=mt.centerX,z=mt.centerY;break}for(var kt=0;kt<Pt;kt++){var Dt=yt[kt];Qt.Qe(tt,z,Dt[2],Dt[3],Dt[4],Dt[5],Dt[6],Dt[7],.5,E),tt=Dt[6],z=Dt[7]}break;case oa:if(yt=va(mt,b,tt,z),Pt=yt.length,kt=mt.endX,Dt=mt.endY,Pt===0){E.push(kt),E.push(Dt),tt=kt,z=Dt;break}for(kt=0;kt<Pt;kt++)Dt=yt[kt],Qt.Qe(tt,z,Dt[2],Dt[3],Dt[4],Dt[5],Dt[6],Dt[7],.5,E),tt=Dt[6],z=Dt[7];break;default:ce("Segment not of valid type: "+mt.type)}mt.isClosed&&(E.push(ot),E.push(rt))}4<=E.length&&(y.push(E),x.push(Bd(E)))}}}function Bd(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(ai(x,E,tt,ot))),x=tt,E=ot}return y}xt.add=function(a){return this.ee.add(a),this},xt.pm=function(a,y,x,E,b,z,tt,ot){return this._isFrozen&&Tn(this),this.fg=new En(a,y,b,z).freeze(),this.gg=new En(x,E,tt,ot).freeze(),this},ke.Object.defineProperties(Ve.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 Bc(this),this.tk}},flattenedLengths:{get:function(){return Bc(this),this.ym}},flattenedTotalLength:{get:function(){var a=this.zm;if(isNaN(a)){if(this.type===Ve.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===Ve.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&&Tn(this,a),this.na=a,a===Ve.o?this.ee=new Pe:(Ve.V===null&&(Ve.V=new Pe().freeze()),this.ee=Ve.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(a){this.od!==a&&(this._isFrozen&&Tn(this,a),this.od=a,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(a){this.pd!==a&&(this._isFrozen&&Tn(this,a),this.pd=a,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(a){this.Dc!==a&&(this._isFrozen&&Tn(this,a),this.Dc=a,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(a){this.Ec!==a&&(this._isFrozen&&Tn(this,a),this.Ec=a,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(a){this.ee!==a&&(this._isFrozen&&Tn(this,a),this.ee=a,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(a){this._isFrozen&&Tn(this,a),this.fg=a.J()}},spot2:{get:function(){return this.gg},set:function(a){this._isFrozen&&Tn(this,a),this.gg=a.J()}},defaultStretch:{get:function(){return this.Uf},set:function(a){this._isFrozen&&Tn(this,a),this.Uf=a}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),Ve.prototype.setSpots=Ve.prototype.pm,Ve.prototype.add=Ve.prototype.add,Ve.prototype.getFractionForPoint=Ve.prototype.xx,Ve.prototype.getPointAndAngleAlongPath=Ve.prototype.Qu,Ve.prototype.getAngleAlongPath=Ve.prototype.wx,Ve.prototype.getPointAlongPath=Ve.prototype.Pu,Ve.prototype.containsPoint=Ve.prototype.ca,Ve.prototype.transform=Ve.prototype.transform,Ve.prototype.rotate=Ve.prototype.rotate,Ve.prototype.scale=Ve.prototype.scale,Ve.prototype.offset=Ve.prototype.offset,Ve.prototype.normalize=Ve.prototype.normalize,Ve.prototype.computeBoundsWithoutOrigin=Ve.prototype.ix,Ve.prototype.equalsApprox=Ve.prototype.Xa,Ve.className="Geometry",Ve.j=new he(Ve,"Line",0),Ve.u=new he(Ve,"Rectangle",1),Ve.F=new he(Ve,"Ellipse",2),Ve.o=new he(Ve,"Path",3),Ve.V=null,Ve.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",Ve.className="Geometry",Ve.stringify=Ve.ia,Ve.fillPath=Ve.nb,Ve.parse=Ve.parse,Ve.Line=Ve.j,Ve.Rectangle=Ve.u,Ve.Ellipse=Ve.F,Ve.Path=Ve.o;function Qo(a,y,x,E,b){Dn(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 Pe,this.sr=this.pl.Ja,this.fw=null}Qo.prototype.copy=function(){var a=new Qo;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},xt=Qo.prototype,xt.Xa=function(a){if(!(a instanceof Qo&&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},xt.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},xt.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},xt.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},xt.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},xt.add=function(a){return this.pl.add(a),this},xt.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 qo:z=ut.endX,tt=ut.endY,E=ut.endX,b=ut.endY;break;case to:if(Qt.Yb(E,b,ut.endX,ut.endY,x,a,y))return!0;E=ut.endX,b=ut.endY;break;case kr: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 Us: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 jo:case oa:var ft=ut.type===jo?As(ut,this):va(ut,this,E,b),mt=ft.length,yt=ut.type===jo?ut.centerX:ut.endX,Pt=ut.type===jo?ut.centerY:ut.endY;if(mt===0){if(Qt.Yb(E,b,yt,Pt,x,a,y))return!0;E=yt,b=Pt;break}for(yt=null,Pt=0;Pt<mt;Pt++)if(yt=ft[Pt],Pt===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:ce("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},ke.Object.defineProperties(Qo.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&&Tn(this,a),this.l=a?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(a){this._isFrozen&&Tn(this,a),this.l=a?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&Tn(this,a),this.l=a?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(a){this._isFrozen&&Tn(this,a),this.od=a,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(a){this._isFrozen&&Tn(this,a),this.pd=a,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(a){this._isFrozen&&Tn(this,a),this.pl=a,this._isInvalidBounds=!0}}}),Qo.prototype.add=Qo.prototype.add,Qo.prototype.equalsApprox=Qo.prototype.Xa,Qo.className="PathFigure";function Mi(a,y,x,E,b,z,tt,ot){Dn(this),a===void 0&&(a=to),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===oa?(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===jo&&(z=Math.max(z,0)),this.Wh=z,typeof tt=="number"?(a===jo&&(tt=Math.max(tt,0)),this.Pg=tt):this.Pg=0),this.ae=null}Mi.prototype.copy=function(){var a=new Mi;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},xt=Mi.prototype,xt.Xa=function(a){if(!(a instanceof Mi)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case qo:case to:return Qt.B(this.endX,a.endX)&&Qt.B(this.endY,a.endY);case kr: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 Us: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 jo: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 oa: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}},xt.qb=function(a){a.classType===Mi&&(this.type=a)},xt.toString=function(a){switch(a===void 0&&(a=-1),this.type){case qo:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case to:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case kr: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 Us: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 jo: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 oa: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":"")},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.close=function(){return this.isClosed=!0,this};function As(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=oi.alloc();tt.reset(),x<E?tt.scale(1,E/x):tt.scale(x/E,1),Ve.Ha(z,tt),oi.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 va(a,y,x,E){function b(kt,Dt,Tt,Rt){return(kt*Rt<Dt*Tt?-1:1)*Math.acos((kt*Tt+Dt*Rt)/(Math.sqrt(kt*kt+Dt*Dt)*Math.sqrt(Tt*Tt+Rt*Rt)))}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 Pt=yt*yt/(y*y)+tt*tt/(z*z);return 1<Pt&&(y*=Math.sqrt(Pt),z*=Math.sqrt(Pt)),Pt=(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(Pt)&&(Pt=0),ot=Pt*y*tt/z,Pt=Pt*-z*yt/y,isNaN(ot)&&(ot=0),isNaN(Pt)&&(Pt=0),x=(x+at)/2+ft*ot-mt*Pt,E=(E+ut)/2+mt*ot+ft*Pt,ut=b(1,0,(yt-ot)/y,(tt-Pt)/z),ft=(yt-ot)/y,at=(tt-Pt)/z,yt=(-yt-ot)/y,ot=(-tt-Pt)/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=oi.alloc(),z.reset(),z.translate(x,E),z.rotate(a.Ne,0,0),z.scale(rt,yt),Ve.Ha(y,z),oi.free(z),a.ae=y,a.ae}ke.Object.defineProperties(Mi.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&&Tn(this,a),this.na=a,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(a){this._isFrozen&&Tn(this,a),this.Dc=a,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(a){this._isFrozen&&Tn(this,a),this.Ec=a,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(a){this._isFrozen&&Tn(this,a),this.Ne=a,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(a){this._isFrozen&&Tn(this,a),this.Vh=a,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(a){this._isFrozen&&Tn(this,a),this.Wh=a,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(a){this._isFrozen&&Tn(this,a),this.Pg=a,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(a){this._isFrozen&&Tn(this,a),this.Ne=a,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(a){this._isFrozen&&Tn(this,a),this.Vh=a,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(a){0>a&&ti(a,">= zero",Mi,"radiusX"),this._isFrozen&&Tn(this,a),this.Wh=a,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(a){0>a&&ti(a,">= zero",Mi,"radiusY"),this._isFrozen&&Tn(this,a),this.Pg=a,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(a){this._isFrozen&&Tn(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&&Tn(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&&Tn(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&&Tn(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&&Tn(this,a),a%=360,0>a&&(a+=360),this.Ne=a,this._isInvalidBounds=!0}}}),Mi.prototype.equalsApprox=Mi.prototype.Xa;var qo=new he(Mi,"Move",0),to=new he(Mi,"Line",1),kr=new he(Mi,"Bezier",2),Us=new he(Mi,"QuadraticBezier",3),jo=new he(Mi,"Arc",4),oa=new he(Mi,"SvgArc",4);Mi.className="PathSegment",Mi.Move=qo,Mi.Line=to,Mi.Bezier=kr,Mi.QuadraticBezier=Us,Mi.Arc=jo,Mi.SvgArc=oa;function _r(){this.H=null,this.xu=new It(0,0).freeze(),this.mt=new It(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}_r.prototype.copy=function(){var a=new _r;return this.clone(a)},_r.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},_r.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},_r.prototype.So=function(a,y){var x=this.diagram;return x===null||pg(x,a,y),y},_r.prototype.Bz=function(a,y){var x=this.diagram;return x===null||(pg(x,a,y),y.assign(x.Ps(y))),y},ke.Object.defineProperties(_r.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}}}),_r.prototype.getMultiTouchDocumentPoint=_r.prototype.Bz,_r.prototype.getMultiTouchViewPoint=_r.prototype.So,_r.className="InputEvent";function mu(){this.H=null,this.xa="",this.ar=this.Lr=null}mu.prototype.copy=function(){var a=new mu;return a.H=this.H,a.xa=this.xa,a.Lr=this.Lr,a.ar=this.ar,a},mu.prototype.toString=function(){var a="*"+this.name;return this.subject!==null&&(a+=":"+this.subject.toString()),this.parameter!==null&&(a+="("+this.parameter.toString()+")"),a},ke.Object.defineProperties(mu.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}}}),mu.className="DiagramEvent";function ho(){this.Fm=uo,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}ho.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},ho.prototype.copy=function(){var a=new ho;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},ho.prototype.qb=function(a){a.classType===ho&&(this.change=a)},ho.prototype.toString=function(){var a="";return a=this.change===Bs?a+"* ":this.change===uo?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===Bs?this.oldValue!==null&&(a+=" "+this.oldValue):(this.object!==null&&(a+=ei(this.object)),this.oldValue!==null&&(a+=" old: "+ei(this.oldValue)),this.oldParam!==null&&(a+=" "+this.oldParam),this.newValue!==null&&(a+=" new: "+ei(this.newValue)),this.newParam!==null&&(a+=" "+this.newParam)),a},ho.prototype.I=function(a){return a?this.oldValue:this.newValue},ho.prototype.Dz=function(a){return a?this.oldParam:this.newParam},ho.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},ho.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},ho.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},ho.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},ke.Object.defineProperties(ho.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===Bs&&(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}}}),ho.prototype.redo=ho.prototype.redo,ho.prototype.canRedo=ho.prototype.canRedo,ho.prototype.undo=ho.prototype.undo,ho.prototype.canUndo=ho.prototype.canUndo,ho.prototype.getParam=ho.prototype.Dz,ho.prototype.getValue=ho.prototype.I,ho.prototype.clear=ho.prototype.clear;var Bs=new he(ho,"Transaction",-1),uo=new he(ho,"Property",0),bo=new he(ho,"Insert",1),Uo=new he(ho,"Remove",2);ho.className="ChangedEvent",ho.Transaction=Bs,ho.Property=uo,ho.Insert=bo,ho.Remove=Uo;function ir(){this.o=new Pe().freeze(),this.xa="",this.j=!1}ir.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},ir.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()},ir.prototype.canUndo=function(){return this.isComplete},ir.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()}},ir.prototype.canRedo=function(){return this.isComplete},ir.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()}},ir.prototype.ak=function(){if(this.isComplete){var a=this.changes;a.ka();for(var y=new ln,x=0;x<a.count;x++){var E=a.M(x);if(E!==null&&E.change===uo&&E.object){var b=y.get(E.object);b||(b=new ln,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()}},ke.Object.defineProperties(ir.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}}}),ir.prototype.optimize=ir.prototype.ak,ir.prototype.redo=ir.prototype.redo,ir.prototype.canRedo=ir.prototype.canRedo,ir.prototype.undo=ir.prototype.undo,ir.prototype.canUndo=ir.prototype.canUndo,ir.prototype.clear=ir.prototype.clear,ir.className="Transaction";function co(){this.Pt=new Fe,this.Jd=!1,this.u=new Pe().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new Pe().freeze(),this.hl=new Pe,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}co.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},co.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},co.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled,this.maxHistoryLength=a.maxHistoryLength,this.checksTransactionLevel=a.checksTransactionLevel},xt=co.prototype,xt.Xw=function(a){this.Pt.add(a)},xt.Rx=function(a){this.Pt.remove(a)},xt.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},xt.eb=function(a){return a===void 0&&(a=""),ih(this,!0,a)},xt.Kf=function(){return ih(this,!1,"")};function ih(a,y,x){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&Be("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}xt.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()}},co.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return!!(a!==null&&a.canUndo())},co.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){Be("undo error: "+y.toString())}finally{this.Ob("FinishedUndo","Undo",a),this.Fe=!1}}},co.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return!!(a!==null&&a.canRedo())},co.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){Be("redo error: "+y.toString())}finally{this.Ob("FinishedRedo","Redo",a),this.Fe=!1}}},co.prototype.Ob=function(a,y,x){x===void 0&&(x=null);var E=new ho;for(E.change=Bs,E.propertyName=a,E.object=x,E.oldValue=y,a=this.models;a.next();)y=a.value,E.model=y,y.ds(E)},co.prototype.Tu=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var y=this.currentTransaction;y===null&&(this.Np=y=new ir);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||Be("Change not within a transaction: "+x.toString()))}},co.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},ke.Object.defineProperties(co.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}}}),co.prototype.handleChanged=co.prototype.Tu,co.prototype.redo=co.prototype.redo,co.prototype.undo=co.prototype.undo,co.prototype.canUndo=co.prototype.canUndo,co.prototype.discardHistoryAfterIndex=co.prototype.lx,co.prototype.rollbackTransaction=co.prototype.Kf,co.prototype.commitTransaction=co.prototype.eb,co.prototype.startTransaction=co.prototype.Ea,co.prototype.removeModel=co.prototype.Rx,co.prototype.addModel=co.prototype.Xw,co.prototype.clear=co.prototype.clear,co.className="UndoManager";function Pi(){Dn(this),this.H=Ml,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new _r,this.Zr=-1}Pi.prototype.toString=function(){return this.name!==""?this.name+" Tool":xe(this.constructor)},Pi.prototype.updateAdornments=function(){},Pi.prototype.canStart=function(){return this.isEnabled},Pi.prototype.doStart=function(){},Pi.prototype.doActivate=function(){this.isActive=!0},Pi.prototype.doDeactivate=function(){this.isActive=!1},Pi.prototype.doStop=function(){},Pi.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},Pi.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")},Pi.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},Pi.prototype.doMouseMove=function(){},Pi.prototype.doMouseUp=function(){this.stopTool()},Pi.prototype.doMouseWheel=function(){},Pi.prototype.canStartMultiTouch=function(){return!0},Pi.prototype.standardPinchZoomStart=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,It.allocAt(NaN,NaN)),E=y.So(1,It.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}It.free(x),It.free(E)},Pi.prototype.standardPinchZoomMove=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,It.allocAt(NaN,NaN)),E=y.So(1,It.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 It((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}It.free(x),It.free(E)},Pi.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},Pi.prototype.doKeyUp=function(){},Pi.prototype.Ea=function(a){return a===void 0&&(a=this.name),this.transactionResult=null,this.diagram.Ea(a)},Pi.prototype.stopTransaction=function(){var a=this.diagram;return this.transactionResult===null?a.Kf():a.eb(this.transactionResult)},Pi.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.lastInput,x=a.Ol(y.documentPoint,!1);if(x!==null){if(Bi?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||(Bi?y.meta:y.control)||y.shift||a.clearSelection()}},Pi.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)}}}Pi.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}},Pi.prototype.doUpdateCursor=function(){var a=this.diagram;a&&(a.currentCursor="")},Pi.prototype.doCurrentObjectChanged=function(){},Pi.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===Dd&&!y.shift||b===Yh&&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===Dd&&y.shift||b===Yh&&!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)}}},Pi.prototype.doWheelChange=function(a,y,x){a.position.D(y)&&x.event.wheelDeltaX===0||(x.bubbles=!1)},Pi.prototype.standardWaitAfter=function(a,y){y===void 0&&(y=this.diagram.lastInput),this.cancelWaitAfter();var x=this,E=y.clone(this.yy);this.Zr=ri(function(){x.doWaitAfter(E)},a)},Pi.prototype.cancelWaitAfter=function(){this.Zr!==-1&&ge.clearTimeout(this.Zr),this.Zr=-1},Pi.prototype.doWaitAfter=function(){},Pi.prototype.findToolHandleAt=function(a,y){return a=this.diagram.ic(a,function(x){for(;x!==null&&!(x.panel instanceof wi);)x=x.panel;return x}),a===null?null:a.part.category===y?a:null},Pi.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},ke.Object.defineProperties(Pi.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof oe&&(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}}}),Pi.prototype.startTransaction=Pi.prototype.Ea,Pi.className="Tool";function lo(){Pi.call(this),this.name="ToolManager",this.hb=new Pe,this.ob=new Pe,this.Hb=new Pe,this.F=this.V=850,this.o=new Ke(2,2).ja(),this.Ha=5e3,this.ia=Yh,this.u=Dc,this.Mp=this.j=null,this.zj=-1}ne(lo,Pi),lo.prototype.initializeStandardTools=function(){},lo.prototype.updateAdornments=function(a){var y=this.currentToolTip;if(y instanceof wi&&this.Mp===a){var x=y.adornedObject;(a!==null?x.part===a:x===null)?this.showToolTip(y,x):this.hideToolTip()}},lo.prototype.doMouseDown=function(){var a=this.diagram,y=a.lastInput;if(y.isTouchEvent&&this.gestureBehavior===Xl&&(y.bubbles=!1),y.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===oh){y.bubbles=!0;return}if(this.gestureBehavior===Xl)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===Yh?this.mouseWheelBehavior=Dd:this.mouseWheelBehavior===Dd&&(this.mouseWheelBehavior=Yh)),this.doActivate(),this.standardWaitAfter(this.holdDelay,y)},lo.prototype.doMouseMove=function(){var a=this.diagram,y=a.lastInput;if(y.isMultiTouch){if(this.gestureBehavior===oh){y.bubbles=!0;return}if(this.gestureBehavior===Xl)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)}lo.prototype.doCurrentObjectChanged=function(a,y){a=this.currentToolTip,a===null||y!==null&&a instanceof wi&&(y===a||y.rg(a))||this.hideToolTip()},lo.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()))},lo.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)},lo.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 wi)||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()},lo.prototype.showToolTip=function(a,y){var x=this.diagram;if(a!==this.currentToolTip&&this.hideToolTip(),a instanceof wi){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 hl&&a!==this.currentToolTip&&a.show(y,x,this);if(this.currentToolTip=a,this.zj!==-1&&(ge.clearTimeout(this.zj),this.zj=-1),a=this.toolTipDuration,0<a&&a!==1/0){var b=this;this.zj=ri(function(){b.hideToolTip()},a)}},lo.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}},lo.prototype.hideToolTip=function(){this.zj!==-1&&(ge.clearTimeout(this.zj),this.zj=-1);var a=this.diagram,y=this.currentToolTip;y!==null&&(y instanceof wi?(a.remove(y),this.Mp!==null&&this.Mp.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof hl&&y.hide!==null&&y.hide(a,this),this.currentToolTip=null)},lo.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()},lo.prototype.doMouseWheel=function(){this.standardMouseWheel()},lo.prototype.doKeyDown=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyDown()},lo.prototype.doKeyUp=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyUp()},lo.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},lo.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},lo.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)},ke.Object.defineProperties(lo.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 wi?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}}}),lo.prototype.replaceStandardTool=lo.prototype.gb;var Yh=new he(lo,"WheelScroll",0),Dd=new he(lo,"WheelZoom",1),Qf=new he(lo,"WheelNone",2),Dc=new he(lo,"GestureZoom",3),Xl=new he(lo,"GestureCancel",4),oh=new he(lo,"GestureNone",5);lo.className="ToolManager",lo.WheelScroll=Yh,lo.WheelZoom=Dd,lo.WheelNone=Qf,lo.GestureZoom=Dc,lo.GestureCancel=Xl,lo.GestureNone=oh;function fo(){Pi.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 It(NaN,NaN),this.Fr=new It,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new Fe().freeze(),this.ia=new st,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var Ll;ne(fo,Pi),fo.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},fo.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},fo.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,(Bi?y.meta:y.control)||y.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.R("ChangedSelection",a.selection))}}},fo.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),mr=null,this.isActive=!0,this.tl.set(a.position),Oc(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&&fs(a),Qc(a,this.draggedParts),this.Ea("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,mr=this,Pu=this.diagram,this.doSimulatedDragOut()))};function Oc(a,y){if(a.dragsLink){var x=a.diagram;x.allowRelink&&(x.model.Wj()&&y.count===1&&y.first()instanceof _e?(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 Ys,a.Oe.diagram=x),a.Oe.originalLink=a.draggedLink):(a.draggedLink=null,a.Oe=null))}}fo.prototype.computeEffectiveCollection=function(a,y){return this.diagram.commandHandler.computeEffectiveCollection(a,y)},fo.prototype.Pd=function(a){return a===void 0?new tu(mo):this.isGridSnapEnabled?new tu(new It(Math.round(1e3*a.x)/1e3,Math.round(1e3*a.y)/1e3)):new tu(a.copy())},fo.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,a.Fu(!1),a.ug(),rh(this),vh(a,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<Ll.count){for(var y=Ll,x=y.length,E=0;E<x;E++){var b=y.M(E);vu(b),Ta(b),rh(b),b.diagram.ug()}y.clear()}vu(this),this.tl.h(NaN,NaN),Pu!==null&&(Pu.currentCursor=""),mr=Pu=null,Ta(this),a.isMouseCaptured=!1,a.currentCursor="",a.Ns=!1,this.stopTransaction(),Kd(a,!0)},fo.prototype.stopTransaction=function(){var a=this.diagram,y=Pi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y};function rh(a){var y=a.diagram,x=y.skipsUndoManager;y.skipsUndoManager=!0,$f(a,y.lastInput,null),y.skipsUndoManager=x,a.Cg.length=0}function qf(){var a=mr;Ta(a),yu(a);var y=a.diagram;a.tl.w()&&(y.position=a.tl),y.ug()}fo.prototype.doCancel=function(){Ta(this),yu(this);var a=this.diagram;this.tl.w()&&(a.position=this.tl),this.stopTool()},fo.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput;this.isActive&&(y.key==="Esc"?this.doCancel():y.key!==a.previousInput.key&&this.doMouseMove())},fo.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function Zl(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")):yu(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 ln,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 _e&&E.canCopy()&&x.add(E,a.Pd());a.copiedParts=x,Oc(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 Ta(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 _e&&(x.value.point=new It(0,0));a.doUpdateCursor(null)}y.skipsUndoManager=!1,y.partManager.addsToTemporaryLayer=!1,a.startPoint=y.firstInput.documentPoint}function vu(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 ul(a,y,x){var E=a.diagram,b=a.startPoint,z=It.alloc();z.assign(E.lastInput.documentPoint),a.moveParts(y,z.re(b),x),It.free(z),E.Gf("temporaryPixelRatio")===!0&&E.Yh===null&&30<E.$w&&(fs(E),E.hk())}fo.prototype.moveParts=function(a,y,x){x===void 0&&(x=!1);var E=this.diagram;E!==null&&mh(E,a,y,this.dragOptions,x)};function yu(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 _e&&E.suspendsRouting){var b=x.value.point;a.draggedParts.add(E,a.Pd()),_u(E,-b.x,-b.y)}y.bd()}}function Ic(a,y){var x=a.diagram;a.dragsLink&&(a.draggedLink!==null&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),Su(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=$f(a,b,E),!a.isActive&&mr===null)return;var ot=E!==null?E.part:null;if(ot===null||x.handlesDragDropForTopLevelParts&&ot.isTopLevel&&!(ot instanceof Vn)){var rt=x.mouseDragOver;rt!==null&&(rt(b),tt=!0)}if(!a.isActive&&mr===null||(a.doDragOver(y,E),!a.isActive&&mr===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)}fo.prototype.findDragOverObject=function(a){var y=this;return El(this.diagram,a,null,function(x){return x===null?x=!0:(x=x.part,x=!!(x===null||x instanceof wi||x.layer.isTemporary||y.draggedParts&&y.draggedParts.contains(x)||y.copiedParts&&y.copiedParts.contains(x))),!x})},fo.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 $f(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&&mr===null||x===null)return E;for(y.handled=!1,b=x;b!==null;)a.Cg.push(b),b=tg(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 tg(a){var y=a.panel;return y!==null?y:a instanceof kn&&!(a instanceof Vn)&&(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=It.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(Di,a);rt=y.Bf(rt),rt<z&&(tt=ot,z=rt)}}return It.free(a),tt}function Su(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)):jc(b,tt,z,rt,ot):jc(b,null,null,null,null)}}}}fo.prototype.doDragOver=function(){};function xu(a,y){var x=a.diagram;a.dragsLink&&Su(a,!0),rh(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=tg(z)}}else z=x.mouseDrop,z!==null&&z(b);if(a.isActive||mr!==null){for(b=(a.copiedParts||a.draggedParts).iterator;b.next();)z=b.key,z instanceof Je&&z.linksConnected.each(function(ot){ot.suspendsRouting=!1});if(a.doDropOnto(y,E),a.isActive||mr!==null){for(a=pe.alloc(),y=x.selection.iterator;y.next();)E=y.value,E instanceof Je&&Q0(x,E,a);pe.free(a)}}}function J0(a,y,x){a=a.diagram,x=x.part,!a.handlesDragDropForTopLevelParts||!x.isTopLevel||x instanceof Vn||(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 _e},!0,function(b){return b instanceof _e},E),a.count!==0)for(a=a.iterator;a.next();)x=a.value,!x.Td(y)&&x.isAvoiding&&x.bb()}fo.prototype.doDropOnto=function(){},fo.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()?(Zl(this,!1),Qc(a,this.copiedParts),ul(this,this.copiedParts,!1),vh(a,this.copiedParts)):this.mayMove()?(Ta(this),ul(this,this.draggedParts,!0)):this.mayDragOut()?(Zl(this,!1),ul(this,this.copiedParts,!1)):Ta(this),Ic(this,a.lastInput.documentPoint))}},fo.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?(Ta(this),Zl(this,!0),Qc(a,this.copiedParts),ul(this,this.copiedParts,!1),vh(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,Ta(this),this.mayMove()&&(ul(this,this.draggedParts,!0),Ic(this,a.lastInput.documentPoint))),this.Ym=!0,xu(this,a.lastInput.documentPoint),this.isActive){var E=x?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,y&&q0(this),a.Ya(),vh(a,this.draggedParts),this.transactionResult=x?"Copy":"Move",a.R(x?"SelectionCopied":"SelectionMoved",E)}this.stopTool(),x&&a.R("ChangedSelection",a.selection)}}},fo.prototype.simulatedMouseMove=function(a,y,x){if(mr===null)return!1;var E=mr.diagram;x instanceof oe||(x=null);var b=Pu;return x!==b&&(b!==null&&b!==E&&(b.ug(),mr.isDragOutStarted=!1,b=b.toolManager.findTool("Dragging"),b!==null&&b.doSimulatedDragLeave()),Pu=x,x!==null&&x!==E&&(qf(),b=x.toolManager.findTool("Dragging"),b!==null&&(Ll.contains(b)||Ll.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)},fo.prototype.simulatedMouseUp=function(a,y,x){if(mr===null)return!1;var E=Pu,b=mr.diagram;if(x===null)return mr.doCancel(),!0;if(x!==E){var z=E.toolManager.findTool("Dragging");if(E!==null&&E!==b&&z!==null)return E.ug(),mr.isDragOutStarted=!1,z.doSimulatedDragLeave(),!1;Pu=x,E=x.toolManager.findTool("Dragging"),E!==null&&(qf(),Ll.contains(E)||Ll.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 It),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=mr,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 Je&&(x=x.containingGroup,x===null||x.placeholder===null||a.draggedParts.contains(x)||x.placeholder.v())}}fo.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(Bi?!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())},fo.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())},fo.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())},fo.prototype.computeBorder=function(a,y,x){return this.Ym||this.draggedParts===null||this.draggedParts.contains(a)?null:x.assign(y)},fo.prototype.Az=function(){return mr},fo.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var y=mr;return!(y===null||y.diagram.model.dataFormat!==a.model.dataFormat)},fo.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Cc(),aa(a),a.animationManager.Cc(),a=mr,a!==null&&(a.diagram.Ns=!1),this.doUpdateCursor(null)}},fo.prototype.doSimulatedDragLeave=function(){var a=mr;a!==null&&a.doSimulatedDragOut(),this.doCancel()},fo.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.Dm=!0;var y=mr;if(y!==null&&y.draggedParts!==null){if(!this.mayDragIn())return;jp(this,y.draggedParts.Lf(),!1,a.firstInput),ul(this,this.copiedParts,!1),Ic(this,a.lastInput.documentPoint)}a.animationManager.Dm=!1},fo.prototype.doSimulatedDrop=function(){var a=this.diagram,y=mr;if(y!==null){var x=y.diagram;if(y.Ym=!0,Ta(this),!this.mayDragIn())return;a.animationManager.Dm=!0,a.R("ChangingSelection",a.selection),this.Ea("Drop"),jp(this,y.draggedParts.Lf(),!0,a.lastInput),ul(this,this.copiedParts,!1);var E=new Fe;this.copiedParts!==null&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0,E.add(b)})),xu(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 jp(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=pe.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,pe.free(z),z=a.Fr,tt=new ln,ot=It.alloc(),rt=y.iterator;rt.next();)at=rt.value,at instanceof _e&&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))));It.free(ot),a.copiedParts=tt,Oc(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)}}}fo.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ns=!1,this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor,this.Bn=null},fo.prototype.computeMove=function(a,y,x,E){return x=this.diagram,x!==null?x.computeMove(a,y,this.dragOptions,E):new It},ke.Object.defineProperties(fo.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}}}),fo.prototype.getDraggingSource=fo.prototype.Az;var mr=null,Pu=null;fo.className="DraggingTool",Ll=new Pe,qe("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)}),lo.prototype.doCancel=function(){mr!==null&&mr.doCancel(),Pi.prototype.doCancel.call(this)};function Lo(){Pi.call(this),this.te=100,this.Ha=!1,this.u="pointer";var a=new _e,y=new Kn;y.isPanelMain=!0,y.stroke="blue",a.add(y),y=new Kn,y.toArrow="Standard",y.fill="blue",y.stroke="blue",a.add(y),a.layerName="Tool",this.Ci=a,a=new Je,y=new Kn,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=vo,a.add(y),a.selectable=!1,a.layerName="Tool",this.Bi=a,this.j=y,a=new Je,y=new Kn,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=vo,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 ln,this.Of=this.gj=this.Pf=null}ne(Lo,Pi),Lo.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},Lo.prototype.copyPortProperties=function(a,y,x,E,b){if(a!==null&&y!==null&&x!==null&&E!==null){var z=y.Df(),tt=Ke.alloc();tt.width=y.naturalBounds.width*z,tt.height=y.naturalBounds.height*z,E.desiredSize=tt,Ke.free(tt),b?(E.toSpot=y.toSpot,E.toEndSegmentLength=y.toEndSegmentLength):(E.fromSpot=y.fromSpot,E.fromEndSegmentLength=y.fromEndSegmentLength),x.locationSpot=Di,z=It.alloc(),x.location=y.ga(Di,z),It.free(z),E.angle=y.li(),this.portTargeted!==null&&this.portTargeted(a,y,x,E,b)}},Lo.prototype.setNoTargetPortProperties=function(a,y,x){y!==null&&(y.desiredSize=vo,y.fromSpot=pr,y.toSpot=pr),a!==null&&(a.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,a,y,x)},Lo.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},Lo.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof Je){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)}},Lo.prototype.findValidLinkablePort=function(a,y){if(a===null)return null;var x=a.part;if(!(x instanceof Je))return null;for(;a!==null;){var E=y?a.toLinkable:a.fromLinkable;if(E===!0&&(a.portId!==null||a instanceof Je)&&(y?this.isValidTo(x,a):this.isValidFrom(x,a)))return a;if(E===!1)break;a=a.panel}return null},Lo.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 Je){var rt=tt.ga(Di,It.alloc()),at=x.x-rt.x,ut=x.y-rt.y;It.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 Je&&(x.layer===null||x.layer.allowLink))?y:null},Lo.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},Lo.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},Lo.prototype.isInSameNode=function(a,y){return a===null||y===null?!1:a===y?!0:(a=a.part,y=y.part,a!==null&&a===y)},Lo.prototype.isLinked=function(a,y){if(a===null||y===null)return!1;var x=a.part;if(!(x instanceof Je))return!1;a=a.portId,a===null&&(a="");var E=y.part;if(!(E instanceof Je))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},Lo.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)},Lo.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 Fe;return E.add(a),Gr(this,x,y,E)};function Gr(a,y,x,E){if(y===x)return!0;var b=y.fromNode;return b!==null&&b.isLinkLabel&&(E.add(b),Gr(a,b.labeledLink,x,E))?!0:(y=y.toNode,!!(y!==null&&y.isLinkLabel&&(E.add(y),Gr(a,y.labeledLink,x,E))))}Lo.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!==qd){if(E===Tg){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!Xr(this,a,y,x,!0)}if(E===Ag){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!Xr(this,a,y,x,!0)}if(E===Fg)return a===y?a=!0:(E=new Fe,E.add(y),a=Zr(this,E,a,y,x)),!a;if(E===Ng)return!Xr(this,a,y,x,!1);if(E===bg)return a===y?a=!0:(E=new Fe,E.add(y),a=Kh(this,E,a,y,x)),!a}return!0};function Xr(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&&Xr(a,tt,x,E,b)))return!0}return!1}function Zr(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&&Zr(a,y,tt,E,b)))return!0}return!1}function Kh(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&&Kh(a,y,ot,E,b))return!0}}return!1}ke.Object.defineProperties(Lo.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}}}),Lo.className="LinkingBaseTool";function Jr(){Lo.call(this),this.name="Linking",this.V={},this.F=null,this.K=sh,this.Xd=null}ne(Jr,Lo),Jr.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},Jr.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 Je)))return null;var x=this.direction;if(x===sh||x===Rp){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===sh||x===zp)&&(y=this.findValidLinkablePort(y,!0),y!==null||this.startObject===a&&(y=a.port,this.findValidLinkablePort(y,!0)))?(this.isForwards=!1,y):null},Jr.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 Je&&(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 Je&&(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)},Jr.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()},Jr.prototype.doStop=function(){Lo.prototype.doStop.call(this),this.startObject=null},Jr.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 Je&&(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)}}},Jr.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(a===null)return!0;if(a instanceof _e)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)},Jr.prototype.insertLink=function(a,y,x,E){return this.diagram.partManager.insertLink(a,y,x,E)},Jr.prototype.doNoLink=function(){},ke.Object.defineProperties(Jr.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 sh=new he(Jr,"Either",0),Rp=new he(Jr,"ForwardsOnly",0),zp=new he(Jr,"BackwardsOnly",0);Jr.className="LinkingTool",Jr.Either=sh,Jr.ForwardsOnly=Rp,Jr.BackwardsOnly=zp;function Ys(){Lo.call(this),this.name="Relinking";var a=new Kn;a.figure="Diamond",a.desiredSize=Eo,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=0,this.V=a,a=new Kn,a.figure="Diamond",a.desiredSize=Eo,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=-1,this.Xd=a,this.F=null,this.Ew=new pe}ne(Ys,Lo),Ys.prototype.updateAdornments=function(a){if(a!==null&&a instanceof _e){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)}},Ys.prototype.makeAdornment=function(a,y){var x=new wi;return x.type=De.Link,y=y?this.toHandleArchetype:this.fromHandleArchetype,y!==null&&x.add(y.copy()),x.adornedObject=a,x},Ys.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},Ys.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 wi&&x.adornedPart instanceof _e))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=oo),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=oo),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},Ys.prototype.copyLinkProperties=function(a,y){if(a!==null&&y!==null){y.adjusting=a.adjusting,y.corner=a.corner;var x=a.curve;(x===wf||x===Gu)&&(x=is),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}},Ys.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()},Ys.prototype.doStop=function(){Lo.prototype.doStop.call(this),this.handle=null},Ys.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 Je&&(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()}}},Ys.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},Ys.prototype.doNoRelink=function(){};function jc(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)}ke.Object.defineProperties(Ys.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 wi))throw Error("new handle is not in an Adornment: "+a);this.F=a}}}),Ys.className="RelinkingTool",qe("linkingTool",function(){return this.findTool("Linking")},function(a){this.gb("Linking",a,this.mouseMoveTools)}),qe("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.gb("Relinking",a,this.mouseDownTools)});function To(){Pi.call(this),this.name="LinkReshaping";var a=new Kn;a.figure="Rectangle",a.desiredSize=Xo,a.fill="lightblue",a.stroke="dodgerblue",this.o=a,a=new Kn,a.figure="Diamond",a.desiredSize=Eo,a.fill="lightblue",a.stroke="dodgerblue",a.cursor="move",this.u=a,this.F=3,this.Ts=this.j=null,this.Fw=new It,this.Yq=new Pe}ne(To,Pi),To.prototype.Ru=function(a){return a&&a.reshapingBehavior.value!==0?a.reshapingBehavior:eg},To.prototype.om=function(a,y){a.reshapingBehavior=y},To.prototype.updateAdornments=function(a){if(a!==null&&a instanceof _e){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)}},To.prototype.makeAdornment=function(a){var y=a.part,x=y.pointsCount,E=y.isOrthogonal,b=null;if(y.points!==null&&1<x){b=new wi,b.type=De.Link,x=y.firstPickIndex;var z=y.lastPickIndex,tt=E?1:0;if(y.resegmentable&&y.computeCurve()!==Qs)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,Lu),ot.cursor="n-resize"):Qt.B(rt.y,at.y)&&(this.om(ot,Cu),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,Lu),ot.cursor="n-resize"):Qt.B(rt.y,at.y)&&(this.om(ot,Cu),ot.cursor="w-resize")):tt!==z&&(this.om(ot,Rc),ot.cursor="move");b.add(ot)}b.adornedObject=a}return b},To.prototype.makeHandle=function(){var a=this.handleArchetype;return a===null?null:a.copy()},To.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return a===null?null:a.copy()},To.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},To.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 _e){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}}},To.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},To.prototype.stopTransaction=function(){var a=this.diagram,y=Pi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},To.prototype.doCancel=function(){var a=this.adornedLink;a!==null&&(a.points=this.Yq),this.stopTool()},To.prototype.getResegmentingPoint=function(){return this.handle.ga(Di)},To.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))},To.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&&(wu(this,tt,E,b,z,!0)||wu(this,tt,E,b,z,!1))){var ot=y.points.copy();wu(this,tt,E,b,z,!0)?(ot.cd(x-2,new It(tt.x,(z.y+tt.y)/2)),ot.cd(x+1,new It(z.x,(z.y+tt.y)/2))):(ot.cd(x-2,new It((z.x+tt.x)/2,tt.y)),ot.cd(x+1,new It((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&&(wu(this,E,b,z,tt,!0)||wu(this,E,b,z,tt,!1))&&(ot=y.points.copy(),wu(this,E,b,z,tt,!0)?(ot.cd(x-1,new It(E.x,(E.y+tt.y)/2)),ot.cd(x+2,new It(tt.x,(E.y+tt.y)/2))):(ot.cd(x-1,new It((E.x+tt.x)/2,E.y)),ot.cd(x+2,new It((E.x+tt.x)/2,tt.y))),ot.mb(x+1),ot.mb(x),y.points=ot,y.Wb())}}else tt=It.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()),It.free(tt)}a.Ya(),this.transactionResult=this.name,a.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function wu(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}To.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===Lu?(y.L(x,y.i(x-1).x,a.y),y.L(x+1,y.i(x+2).x,a.y)):E===Cu&&(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===Lu?(y.L(x-1,y.i(x-2).x,a.y),y.L(x,y.i(x+1).x,a.y)):E===Cu&&(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(Di,It.alloc()),E=y.getLinkPointFromPoint(E,b,z,a,!0,It.alloc()),y.L(0,E.x,E.y),It.free(z),It.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(Di,It.alloc()),a=y.getLinkPointFromPoint(E,b,x,a,!1,It.alloc()),y.L(y.pointsCount-1,a.x,a.y),It.free(x),It.free(a));y.zf()},To.prototype.computeReshape=function(a){var y=this.adornedLink,x=this.handle.segmentIndex;switch(this.Ru(this.handle)){case Rc:return a;case Lu:return new It(y.i(x).x,a.y);case Cu:return new It(a.x,y.i(x).y);default:case eg:return y.i(x)}},ke.Object.defineProperties(To.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 wi))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}}}),To.prototype.setReshapingBehavior=To.prototype.om,To.prototype.getReshapingBehavior=To.prototype.Ru;var eg=new he(To,"None",0),Cu=new he(To,"Horizontal",1),Lu=new he(To,"Vertical",2),Rc=new he(To,"All",3);To.className="LinkReshapingTool",To.None=eg,To.Horizontal=Cu,To.Vertical=Lu,To.All=Rc,qe("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.gb("LinkReshaping",a,this.mouseDownTools)});function br(){Pi.call(this),this.name="Resizing",this.o=new Ke(1,1).freeze(),this.j=new Ke(9999,9999).freeze(),this.yg=new Ke(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var a=new Kn;a.alignmentFocus=Di,a.figure="Rectangle",a.desiredSize=Xo,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.F=a,this.u=null,this.Xq=new It,this.Dw=new Ke,this.Tn=new It,this.rt=new Ke(0,0),this.qt=new Ke(1/0,1/0),this.pt=new Ke(1,1)}ne(br,Pi),br.prototype.updateAdornments=function(a){if(!(a===null||a instanceof _e)){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(),Ch(a)&&this.updateResizeHandles(x,y),a.bh(this.name,x);return}}a.Jf(this.name)}},br.prototype.makeAdornment=function(a){var y=a.part.resizeAdornmentTemplate;if(y===null){y=new wi,y.type=De.Spot,y.locationSpot=Di;var x=new ns;x.isPanelMain=!0,y.add(x),y.add(this.makeHandle(a,Cr)),y.add(this.makeHandle(a,Wh)),y.add(this.makeHandle(a,na)),y.add(this.makeHandle(a,Cl)),y.add(this.makeHandle(a,bs)),y.add(this.makeHandle(a,zr)),y.add(this.makeHandle(a,cs)),y.add(this.makeHandle(a,Ts))}else if(Ca(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},br.prototype.makeHandle=function(a,y){return a=this.handleArchetype,a===null?null:(a=a.copy(),a.alignment=y,a)},br.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=Di),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 De)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,y)}},br.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},br.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))},br.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=a.isMouseCaptured=!1},br.prototype.stopTransaction=function(){var a=this.diagram,y=Pi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},br.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},br.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,It.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),a.bd(),It.free(b)}},br.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,It.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),It.free(b),a.Ya(),this.transactionResult=this.name,a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},br.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 Vn){var E=new Pe;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()}},br.prototype.computeResize=function(a,y,x,E,b,z){y.Mc()&&(y=Di);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=It.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))),It.free(mt),a},br.prototype.computeReshape=function(){var a=Ne;return this.adornedObject instanceof Kn&&(a=Lv(this.adornedObject)),!(a===dn||this.diagram.lastInput.shift)},br.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},br.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},br.prototype.computeCellSize=function(){var a=new Ke(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},ke.Object.defineProperties(br.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 wi))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 wi)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}}}),br.className="ResizingTool",qe("resizingTool",function(){return this.findTool("Resizing")},function(a){this.gb("Resizing",a,this.mouseDownTools)});function Qr(){Pi.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new It,this.ue=null;var a=new Kn;a.figure="Ellipse",a.desiredSize=Eo,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.o=a,this.j=null,this.Cw=0,this.kr=new It(NaN,NaN),this.u=0,this.F=50}ne(Qr,Pi),Qr.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)}},Qr.prototype.makeAdornment=function(a){var y=a.part.rotateAdornmentTemplate;if(y===null){y=new wi,y.type=De.Position,y.locationSpot=Di;var x=this.handleArchetype;x!==null&&y.add(x.copy())}else if(Ca(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Qr.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},Qr.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)},Qr.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(Di)},Qr.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)},Qr.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new It(NaN,NaN),this.isActive=a.isMouseCaptured=!1},Qr.prototype.stopTransaction=function(){var a=this.diagram,y=Pi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Qr.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},Qr.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))},Qr.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()},Qr.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()}},Qr.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},ke.Object.defineProperties(Qr.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 wi))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 wi)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}}}),Qr.className="RotatingTool",qe("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function ah(){Pi.call(this),this.name="ClickSelecting"}ne(ah,Pi),ah.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},ah.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},ah.className="ClickSelectingTool";function ya(){Pi.call(this),this.name="Action",this.pk=null}ne(ya,Pi),ya.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},ya.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()},ya.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))}},ya.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()},ya.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())},ya.prototype.doStop=function(){this.pk=null},ya.className="ActionTool";function ku(){Pi.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new It(0,0)}ne(ku,Pi),ku.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)},ku.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint),this.stopTool()},ku.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 kn)x.Zc()&&(Ca(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=It.allocAt(a.x,a.y);this.isGridSnapEnabled&&Jc(this.diagram,E,a,z),E.location=z,y.allowSelect&&(y.clearSelection(!0),E.isSelected=!0),It.free(z)}y.Ya(),this.transactionResult=this.name,y.R("PartCreated",E)}finally{this.stopTransaction(),y.R("ChangedSelection",y.selection)}return E},ke.Object.defineProperties(ku.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}}}),ku.className="ClickCreatingTool";function ra(){Pi.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var a=new kn;a.layerName="Tool",a.selectable=!1;var y=new Kn;y.name="SHAPE",y.figure="Rectangle",y.fill=null,y.stroke="magenta",a.add(y),this.j=a}ne(ra,Pi),ra.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))},ra.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0,a.isMouseCaptured=!0,a.skipsUndoManager=!0,a.add(this.box),this.doMouseMove()},ra.prototype.doDeactivate=function(){var a=this.diagram;a.ug(),a.remove(this.box),a.skipsUndoManager=!1,this.isActive=a.isMouseCaptured=!1},ra.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=Ke.alloc().h(y.width,y.height);x.desiredSize=E,this.box.mm(y.x,y.y,!1),Ke.free(E),(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},ra.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()},ra.prototype.computeBoxBounds=function(){var a=this.diagram;return new pe(a.firstInput.documentPoint,a.lastInput.documentPoint)},ra.prototype.selectInRect=function(a){var y=this.diagram,x=y.lastInput;if(a=y.ux(a,this.isPartialInclusion),Bi?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 Pe,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)}},ke.Object.defineProperties(ra.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}}}),ra.className="DragSelectingTool";function Mr(){Pi.call(this),this.name="Panning",this.Xt=new It,this.xy=new It,this.xg=!1;var a=this;this.Kw=function(){var y=a.diagram;y!==null&&y.removeEventListener(ge.document,"scroll",a.Kw,!1),a.stopTool()}}ne(Mr,Pi),Mr.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())},Mr.prototype.doActivate=function(){var a=this.diagram;this.xg?(a.lastInput.bubbles=!0,a.addEventListener(ge.document,"scroll",this.Kw,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Xt.assign(a.position)),this.isActive=!0},Mr.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="",this.isActive=a.isMouseCaptured=!1},Mr.prototype.doCancel=function(){var a=this.diagram;a.position=this.Xt,a.isMouseCaptured=!1,this.stopTool()},Mr.prototype.doMouseMove=function(){this.move()},Mr.prototype.doMouseUp=function(){this.move(),this.stopTool()},Mr.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)}},ke.Object.defineProperties(Mr.prototype,{bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},originalPosition:{get:function(){return this.Xt}}}),Mr.className="PanningTool",qe("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.gb("ClickCreating",a,this.mouseUpTools)}),qe("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.gb("ClickSelecting",a,this.mouseUpTools)}),qe("panningTool",function(){return this.findTool("Panning")},function(a){this.gb("Panning",a,this.mouseMoveTools)}),qe("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.gb("DragSelecting",a,this.mouseMoveTools)}),qe("actionTool",function(){return this.findTool("Action")},function(a){this.gb("Action",a,this.mouseDownTools)});function hl(){this.F=this.u=this.j=this.o=null}ke.Object.defineProperties(hl.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}}}),hl.className="HTMLInfo";function Sa(a,y,x){this.text=a,this.hx=y,this.visible=x}Sa.className="ContextMenuButtonInfo";function qr(){Pi.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new It,this.jt=null,this.Et=!1;var a=this;this.tu=function(){a.stopTool()}}ne(qr,Pi);function Aa(a){var y=new hl;y.show=function(b,z,tt){tt.showDefaultContextMenu()},y.hide=function(b,z){z.hideDefaultContextMenu()},lh=y,a.tu=function(){a.stopTool()},y=Qe("div");var x=Qe("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=Qe("style");ge.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",Ao,!1),E.addEventListener(y,"selectstart",Ao,!1),E.addEventListener(x,"contextmenu",Ao,!1)),y.className="goCXforeground",x.className="goCXbackground",ge.document.body&&(ge.document.body.appendChild(y),ge.document.body.appendChild(x)),Id=y,Xh=x,Od=!0}function Ao(a){return a.preventDefault(),!1}qr.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)},qr.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},qr.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},qr.prototype.findObjectWithContextMenu=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.lastInput,E=null;if(a instanceof oe||(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},qr.prototype.doActivate=function(){},qr.prototype.doMouseDown=function(){if(Pi.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof wi){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doMouseDown(),a.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&Ja(this)},qr.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof wi){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doCancel(),a.doDeactivate())}Ja(this)};function Ja(a){var y=a.diagram;if(a.isActive){var x=a.currentContextMenu;if(x!==null){var E=null;x instanceof hl||(E=y.ic(y.lastInput.documentPoint,null,null),E!==null&&E.rg(x)&&a.standardMouseClick(null,null)),a.maybeStopTool(E)}}else a.canStart()&&(Jl(a,!0),a.isActive||a.stopTool())}qr.prototype.maybeStopTool=function(){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this,this.doMouseUp())};function Jl(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=lh,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 wi&&!a.currentContextMenu.visible&&a.stopTool()}}qr.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},qr.prototype.showContextMenu=function(a,y){var x=this.diagram;if(a!==this.currentContextMenu&&this.hideContextMenu(),a instanceof wi){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 hl&&a.show(y,x,this);this.currentContextMenu=a},qr.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}},qr.prototype.hideContextMenu=function(){var a=this.diagram,y=this.currentContextMenu;y!==null&&(y instanceof wi?(a.remove(y),this.ht!==null&&this.ht.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof hl&&(y.hide!==null?y.hide(a,this):y.mainElement!==null&&(y.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};function Mu(a){var y=new Pe;return y.add(new Sa("Copy",function(x){x.commandHandler.copySelection()},function(x){return x.commandHandler.canCopySelection()})),y.add(new Sa("Cut",function(x){x.commandHandler.cutSelection()},function(x){return x.commandHandler.canCutSelection()})),y.add(new Sa("Delete",function(x){x.commandHandler.deleteSelection()},function(x){return x.commandHandler.canDeleteSelection()})),y.add(new Sa("Paste",function(x){x.commandHandler.pasteSelection(a.mouseDownPoint)},function(x){return x.commandHandler.canPasteSelection(a.mouseDownPoint)})),y.add(new Sa("Select All",function(x){x.commandHandler.selectAll()},function(x){return x.commandHandler.canSelectAll()})),y.add(new Sa("Undo",function(x){x.commandHandler.undo()},function(x){return x.commandHandler.canUndo()})),y.add(new Sa("Redo",function(x){x.commandHandler.redo()},function(x){return x.commandHandler.canRedo()})),y.add(new Sa("Scroll To Part",function(x){x.commandHandler.scrollToPart()},function(x){return x.commandHandler.canScrollToPart()})),y.add(new Sa("Zoom To Fit",function(x){x.commandHandler.zoomToFit()},function(x){return x.commandHandler.canZoomToFit()})),y.add(new Sa("Reset Zoom",function(x){x.commandHandler.resetZoom()},function(x){return x.commandHandler.canResetZoom()})),y.add(new Sa("Group Selection",function(x){x.commandHandler.groupSelection()},function(x){return x.commandHandler.canGroupSelection()})),y.add(new Sa("Ungroup Selection",function(x){x.commandHandler.ungroupSelection()},function(x){return x.commandHandler.canUngroupSelection()})),y.add(new Sa("Edit Text",function(x){x.commandHandler.editTextBlock()},function(x){return x.commandHandler.canEditTextBlock()})),y}qr.prototype.showDefaultContextMenu=function(){var a=this.diagram;this.jt===null&&(this.jt=Mu(this)),Id.innerHTML="",Xh.addEventListener("pointerdown",this.tu,!1);var y=this,x=Qe("ul");x.className="goCXul",Id.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=Qe("li"),z.className="goCXli";var tt=Qe("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)}}Id.style.display="block",Xh.style.display="block"},qr.prototype.hideDefaultContextMenu=function(){if(this.currentContextMenu!==null&&this.currentContextMenu===lh){Id.style.display="none",Xh.style.display="none";var a=this.diagram;a!==null&&a.removeEventListener(Xh,"pointerdown",this.tu,!1),this.currentContextMenu=null}},ke.Object.defineProperties(qr.prototype,{currentContextMenu:{get:function(){return this.j},set:function(a){this.j=a,this.ht=a instanceof wi?a.adornedPart:null}},defaultTouchContextMenu:{get:function(){return Od===!1&&lh===null&&xo&&Aa(this),lh},set:function(a){a===null&&(Od=!0),lh=a}},currentObject:{get:function(){return this.o},set:function(a){this.o=a}},mouseDownPoint:{get:function(){return this.yw}}});var lh=null,Od=!1,Xh=null,Id=null;qr.className="ContextMenuTool",qe("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.gb("ContextMenu",a,this.mouseUpTools)});function eo(){Pi.call(this),this.name="TextEditing",this.Zh=new Zi,this.ia=null,this.V=Zh,this.vj=null,this.qa=Jh,this.u=1,this.F=!0,this.o=null,this.j=new hl,this.kt=null,jd(this,this.j)}ne(eo,Pi);function jd(a,y){if(xo){var x=Qe("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(Rd)):b==="Tab"?(a.acceptText(_c),E.preventDefault()):b==="Escape"&&(a.doCancel(),a.diagram!==null&&a.diagram.doFocus())}},!1),x.addEventListener("focus",function(){if(a.currentTextEditor!==null&&a.state!==Jh){var E=a.kt;a.qa===zd&&(a.qa=_d),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),x.addEventListener("blur",function(){if(a.currentTextEditor!==null&&a.state!==Jh){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 Zi&&z instanceof eo)if(z.state===Gd)x.style.border="3px solid red",x.focus();else{var tt=E.ga(Di),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)}}}eo.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||a.isReadOnly||Eu&&Eu!==this&&(Eu.acceptText(dl),Eu&&Eu!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var y=a.ic(a.lastInput.documentPoint);return y!==null&&y instanceof Zi&&y.editable&&y.part.canEdit()?(y=y.part,!(y===null||this.starting===Zh&&!y.isSelected||this.starting===Gc&&2>a.lastInput.clickCount)):!1},eo.prototype.doStart=function(){Eu=this,this.textBlock!==null&&this.doActivate()},eo.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 Zi&&(this.textBlock=y,y.part!==null)){a.animationManager.Cc(),this.isActive=!0,this.qa=zd;var x=this.defaultTextEditor;y.textEditor!==null&&(x=y.textEditor),this.Zh=this.textBlock.copy();var E=new pe(this.textBlock.ga(Cr),this.textBlock.ga(na));a.tv(E),x.show(y,a,this),this.currentTextEditor=x}}}},eo.prototype.doCancel=function(){this.stopTool()},eo.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},eo.prototype.doMouseDown=function(){this.isActive&&this.acceptText(dl)},eo.prototype.acceptText=function(a){switch(a){case dl:this.qa===Qh?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.qa===zd||this.qa===Gd||this.qa===_d)&&(this.qa=ig,ng(this));break;case zc:case Rd:case _c:(Rd!==a||this.textBlock.isMultiline!==!0)&&(this.qa===zd||this.qa===Gd||this.qa===_d)&&(this.qa=ig,ng(this))}};function ng(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=Qh,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=Gd,a.doError(b,z))}}eo.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)},eo.prototype.doSuccess=function(a,y){var x=this.textBlock;x.textEdited!==null&&x.textEdited(x,a,y)},eo.prototype.doDeactivate=function(){var a=this.diagram;a!==null&&(this.qa=Jh,this.currentTextEditor!==null&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)},eo.prototype.doStop=function(){Eu=null},eo.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)))},eo.prototype.Lx=function(a){var y=this.Zh;return y.text=a,y.measure(this.textBlock.Ih,1/0),y},ke.Object.defineProperties(eo.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)}}}),eo.prototype.measureTemporaryTextBlock=eo.prototype.Lx;var zc=new he(eo,"LostFocus",0),dl=new he(eo,"MouseDown",1),_c=new he(eo,"Tab",2),Rd=new he(eo,"Enter",3),$0=new he(eo,"SingleClick",0),Zh=new he(eo,"SingleClickSelected",1),Gc=new he(eo,"DoubleClick",2),Jh=new he(eo,"StateNone",0),zd=new he(eo,"StateActive",1),_d=new he(eo,"StateEditing",2),ig=new he(eo,"StateValidating",3),Gd=new he(eo,"StateInvalid",4),Qh=new he(eo,"StateValidated",5),Eu=null;eo.className="TextEditingTool",eo.LostFocus=zc,eo.MouseDown=dl,eo.Tab=_c,eo.Enter=Rd,eo.SingleClick=$0,eo.SingleClickSelected=Zh,eo.DoubleClick=Gc,eo.StateNone=Jh,eo.StateActive=zd,eo.StateEditing=_d,eo.StateValidating=ig,eo.StateInvalid=Gd,eo.StateValidated=Qh,qe("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)});function Ds(a){Wd||(og(),Wd=!0),this.H=Ml,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=ql,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new Fe,this.ce=new Er,this.ce.Yd=this,this.Ei=new Fe,this.pu=new Fe,this.Sr=new Fe,this.pr=new Fe,a&&Object.assign(this,a)}Ds.prototype.Xe=function(a){this.H=a},Ds.prototype.canStart=function(){return!0};function kl(a,y){a.Jd&&a.canStart(y)&&(a.Zd.add(y),a.defaultAnimation.isAnimating&&a.Cc(),Fr(a.H),a.zb=!0)}function Hc(a){if(a.Jd&&a.zb){var y=a.ce,x=a.H,E=a.Zd.contains("Model");E&&(a.Ok=!0,a.Pk===ql?(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===rg&&y.vc.clear(),a.Qw=!!(a.Pk===Vd&&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(),Ud(y,x),a.Ok=!1,x.N()):(a.Zd.clear(),x.kg=!1,E=y.vc.get(x),x.autoScale!==Hr&&E!==null&&(delete E.start.scale,delete E.end.scale),ge.requestAnimationFrame(function(){a.zb===!1||y.bc||(x.Gf("temporaryPixelRatio")&&fs(x),hg(x),a.zb=!1,y.start(),y.bc&&(Fu(a),x.Ya(),sg(y,0),aa(x,!0),uh(a),x.R("AnimationStarting",a)))}))}}function Ql(a){return a.Zd.contains("Trigger")&&a.Zd.count===1}function Wc(a,y,x,E){a.isTicking||Ql(a)||y instanceof _e&&(y.fromNode!==null||y.toNode!==null)||a.ce.add(y,"position",x,E,!1)}xt=Ds.prototype,xt.fv=function(a){return this.ce.fv(a)},xt.Xu=function(a){return this.ce.Xu(a)};function Vc(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 oe){ot=!0;break t}}ot=!1}ot?Yd(tt,!1):tt.Xk=!0}}b.pu.clear(),b.bc!==!1&&(Fu(b),aa(b.H),uh(b)),ge.requestAnimationFrame(x)}}var E=a.Ei,b=a;a.bc?a.Sr.add(y):(a.bc=!0,E.add(y),ge.requestAnimationFrame(function(){x()}))}function _p(a){for(a=a.Ei.iterator;a.next();)a.value.Xk=!1}function Fu(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 uh(a){var y=a.H;y.skipsUndoManager=a.Ow,y.skipsModelSourceBindings=a.cw,a.vq=!1}xt.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(),Ud(y,null),a===!0)for(a=this.Ei.Fa(),y=0;y<a.length;y++)a[y].Ml(!0)}else y.vc.clear(),Ud(y,this.H)},xt.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))},xt.Cj=function(a,y){this.zb&&(this.Zd.contains("Expand Tree")||this.Zd.contains("Expand SubGraph"))&&(this.ce.Cj(a,y),ws(this,a))},xt.Aj=function(a,y){this.zb&&(this.Zd.contains("Collapse Tree")||this.Zd.contains("Collapse SubGraph"))&&(this.ce.Aj(a,y),Nu(this.ce,y,"position",y.position,y.position),ws(this,a))};function Gp(a,y,x){!a.zb||y.D(x)||Ql(a)||(a.H.pi||(y=x.copy()),Nu(a.ce,a.H,"position",y,x))}function Uc(a,y,x){y.fd&&(y.Tg=x,a.pr.add(y))}function ws(a,y){for(y=y.findLinksConnected();y.next();){var x=y.value;x.fd&&(x.Tg=x.points.copy(),a.pr.add(x))}}function hh(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 og(){function a(x,E,b,z,tt,ot){x.position=new It(z(tt,E.x,b.x-E.x,ot),z(tt,E.y,b.y-E.y,ot))}var y=new ln;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 It(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 It(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 It(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 It(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 pe(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=hh(E,b,tt,ot,z)}),y.add("stroke",function(x,E,b,z,tt,ot){x.stroke=hh(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=hh(E,b,tt,ot,z)}),y.add("areaBackground",function(x,E,b,z,tt,ot){x.areaBackground=hh(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)}),Hd=y}ke.Object.defineProperties(Ds.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&&ti(a,">= 1",Ds,"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}}}),Ds.prototype.stopAnimation=Ds.prototype.Cc;var Hd=null,Wd=!1,ql=new he(Ds,"Default",1),Vd=new he(Ds,"AnimateLocations",2),rg=new he(Ds,"None",3);Ds.className="AnimationManager",Ds.defineAnimationEffect=function(a,y){Wd||(og(),Wd=!0),Hd.add(a,y)},Ds.Default=ql,Ds.AnimateLocations=Vd,Ds.None=rg;function Er(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=qh,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=mo,this.vc=new ln,this.Tt=new ln,this.yl=new Fe,this.Ut=new Fe,this.dw=Au,a&&Object.assign(this,a)}Er.prototype.suspend=function(){this.Xk=!0},Er.prototype.advanceTo=function(a,y){y&&(this.Xk=!1),this.ho&&a>=this.Gd&&(this.Wk=!0,a-=this.Gd),this.gw=a,Yd(this,!0),Fu(this.Yd),aa(this.H),uh(this.Yd),this.H.redraw()};function Ud(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}xt=Er.prototype,xt.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 oe?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===ql&&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=$d),Fu(y),this.yl.each(function(E){E.data=null,a.add(E)}),uh(y),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,Vc(y,this),this)},xt.Iy=function(a,y){return a.Zc()?(this.yl.add(a),this.H=y,this):this},xt.add=function(a,y,x,E,b){if(y==="position"&&x.Xa(E))return this;if(this.H===null&&(a instanceof oe?this.H=a:a instanceof Jt&&a.diagram!==null&&(this.H=a.diagram)),a instanceof kn){if(!a.isAnimated)return this;y==="position"&&(y="position:part")}return Nu(this,a,y,x,E,b),this};function Nu(a,y,x,E,b,z){var tt=a.vc;if(y instanceof oe&&x==="position"&&(x="position:diagram"),(x==="fill"||x==="stroke"||x==="background"||x==="areaBackground")&&(nu(E),sv(),E=[Js.j,Js.u,Js.o,Js.F],nu(b),sv(),b=[Js.j,Js.u,Js.o,Js.F]),tt.contains(y)){var ot=tt.I(y),rt=ot.start,at=ot.end;rt[x]===void 0&&(rt[x]=dh(E)),at[x]=dh(b)}else rt={},at={},rt[x]=dh(E),at[x]=dh(b),ot=rt.position,y instanceof Jt&&ot instanceof It&&!ot.w()&&y.diagram.animationManager.Zd.contains("Expand SubGraph")&&ot.assign(at.position),ot=new ch(rt,at,z),tt.add(y,ot);tt=rt[x],tt instanceof It&&!tt.w()&&tt.assign(a.o),z&&x.indexOf("position:")===0&&y instanceof kn?ot.Ku.location=dh(y.location):z&&(ot.Ku[x]=dh(E))}function dh(a){return a instanceof It||a instanceof Ke?a.copy():a}xt.fv=function(a){return this.bc?(a=this.vc.I(a),a!==null&&a.nv):!1},xt.Xu=function(a){return this.bc?(a=this.vc.I(a),a!==null&&(a.start.position||a.start.location)):!1};function Yd(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),Fu(x),sg(a,b),aa(a.H,!0),uh(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 sg(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=Hd,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)}}}xt.stop=function(){return this.bc?(this.Ml(!0),this):this},xt.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,Fu(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=Hd;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 kn&&(tt.location=ut.location),ot.nv&&tt instanceof kn&&tt.Zb(!1)}if(y.As.clear(),Kd(y,!1),y.Ya(),y.N(),aa(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()}aa(y,!0),this.isViewportUnconstrained&&(y.scrollMode=this.dw),uh(x),this.au++,!a&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),Ud(this,null),x.Ml(this),y.$b())}},xt.Cj=function(a,y){var x=y.actualBounds,E=null;if(y instanceof Vn&&(E=y.placeholder),E!==null?(x=E.ga(Cr),E=E.padding,x.x+=E.left,x.y+=E.top,this.add(a,"position",x,a.position,!1)):this.add(a,"position",new It(x.x+x.width/2,x.y+x.height/2),a.position,!1),this.add(a,"scale",.01,a.scale,!1),a instanceof Vn)for(a=a.memberParts;a.next();)E=a.value,E instanceof Je&&this.Cj(E,y)},xt.Aj=function(a,y){if(a.isVisible()){var x=null;if(y instanceof Vn&&(x=y.placeholder),x!==null){var E=x.ga(Cr);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 Vn)for(a=a.memberParts;a.next();)E=a.value,E instanceof Je&&this.Aj(E,y)}},xt.Ez=function(a){var y=this.Tt.get(a);return y===null&&(y={},this.Tt.add(a,y)),y},ke.Object.defineProperties(Er.prototype,{duration:{get:function(){return this.Dg},set:function(a){1>a&&ti(a,">= 1",Er,"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:ce("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}}}),Er.prototype.getTemporaryState=Er.prototype.Ez,Er.prototype.stop=Er.prototype.stop,Er.prototype.add=Er.prototype.add,Er.prototype.addTemporaryPart=Er.prototype.Iy;function qh(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}Er.className="Animation",Er.EaseLinear=function(a,y,x,E){return x*a/E+y},Er.EaseInOutQuad=qh,Er.EaseInQuad=function(a,y,x,E){return x*(a/=E)*a+y},Er.EaseOutQuad=function(a,y,x,E){return-x*(a/=E)*(a-2)+y},Er.EaseInExpo=function(a,y,x,E){return a===0?y:x*Math.pow(2,10*(a/E-1))+y},Er.EaseOutExpo=Hp;function ch(a,y,x){this.start=a,this.end=y,this.Ku={},this.Hu=x,this.nv=!1}ch.className="AnimationState";function Ba(a,y,x){this.xd=null,this.rf=a,this.so=x||ag,this.uk=null,y!==void 0&&(this.uk=y,x===void 0&&(this.so=fh))}Ba.prototype.copy=function(){var a=new Ba(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))}ke.Object.defineProperties(Ba.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 ag=new he(Ba,"Default",1),fh=new he(Ba,"Immediate",2),$h=new he(Ba,"Bundled",3);Ba.className="AnimationTrigger",Ba.Default=ag,Ba.Immediate=fh,Ba.Bundled=$h;function hr(a){Dn(this),this.H=null,this.Pa=new Pe,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)}xt=hr.prototype,xt.clear=function(){for(var a=this.Pa,y=0;y<a.length;y++){var x=a.s[y];x.Ig=null,Dr(x)}a.clear(),this.Zq.length=0},xt.Xe=function(a){this.H=a},xt.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 Vn?b++:rt instanceof Je?E++:rt instanceof _e?z++:rt instanceof wi?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&&ci(E)&&(ot+=" #"+ci(E)),x instanceof Je?ot+=" "+ei(E):x instanceof _e&&(ot+=" "+ei(x.fromNode)+" "+ei(x.toNode));return y+" "+this.Pa.count+": "+ot},xt.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=It.alloc(),z=this.Pa.s,tt=z.length;tt--;){var ot=z[tt];if((E!==!0||Ch(ot)!==!1)&&ot.isVisible()&&(b.assign(a),Po(b,ot.oe),ot=ot.ic(b,y,x),ot!==null&&(y!==null&&(ot=y(ot)),ot!==null&&(x===null||x(ot)))))return It.free(b),ot}return It.free(b),null},xt.ji=function(a,y,x,E){if(y===void 0&&(y=null),x===void 0&&(x=null),E instanceof Pe||E instanceof Fe||(E=new Fe),this.Uh===!1)return E;var b=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(b=!0);for(var z=It.alloc(),tt=this.Pa.s,ot=tt.length;ot--;){var rt=tt[ot];if((b!==!0||Ch(rt)!==!1)&&rt.isVisible()){z.assign(a),Po(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 It.free(z),E},xt.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 Pe||b instanceof Fe||(b=new Fe),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||Ch(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},xt.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||Ch(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},xt.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 Pe||b instanceof Fe)&&(z=b),b=!0),z instanceof Pe||z instanceof Fe||(z=new Fe),this.Uh===!1)return z;var tt=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(tt=!0);for(var ot=It.alloc(),rt=It.alloc(),at=this.Pa.s,ut=at.length;ut--;){var ft=at[ut];if((tt!==!0||Ch(ft)!==!1)&&ft.isVisible()){ot.assign(a),Po(ot,ft.oe),rt.h(a.x+y,a.y),Po(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 It.free(ot),It.free(rt),z},xt.Fd=function(a,y){if(this.visible){var x=this.Pa.s,E=x.length;if(E!==0){a=gn();for(var b=gn(),z=0;z<E;z++){var tt=x[z];if(tt.vw=z,tt instanceof _e){if(tt.fd===!1)continue}else if(tt instanceof wi&&tt.adornedPart!==null)continue;var ot=tt.actualBounds;tt.isVisible()&&wl(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]);Ye(a),Ye(b)}}};function $l(a,y){var x=1;return a.pb!==1&&(x=y.globalAlpha,y.globalAlpha=x*a.pb),x}xt.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=$l(this,a);var z=this.Zq;z.length=0;for(var tt=y.scale,ot=pe.alloc(),rt=0;rt<E;rt++)this.Oj(a,x[rt],y,z,tt,ot,!0);if(pe.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=$l(a,y),ot=a.Zq;ot.length=0;for(var rt=x.scale,at=pe.alloc(),ut=0;ut<z;ut++){var ft=b[ut];E.contains(ft)&&a.Oj(y,ft,x,ot,rt,at,!1)}pe.free(at),y.globalAlpha=tt}}}xt.Oj=function(a,y,x,E,b,z,tt){if(tt&&!Ch(y))a.Hs(y);else{if(E!==null&&y instanceof _e&&(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 Os?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&&(Co(y,a,y.areaBackground,!0,!0,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.areaBackground===null&&y.background===null&&(Co(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),Co(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))}},xt.g=function(a,y,x,E,b){var z=this.diagram;z!==null&&z.cb(uo,a,this,y,x,E,b)},xt.oi=function(a,y,x){var E=this.Pa;if(y.Ig=this,this===null&&Dr(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)),Yc(this,a,y),a},xt.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,Dr(y),a};function Yc(a,y,x){if(y=Up(a,y,x),x instanceof Vn&&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&&Yc(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}ke.Object.defineProperties(hr.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===""&&ce("Cannot rename default Layer to: "+a),x=x.layers;x.next();)x.value.name===a&&ce("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)&&ti(a,"0 <= value <= 1",hr,"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))}}}),hr.prototype.findObjectsNear=hr.prototype.og,hr.prototype.findObjectsIn=hr.prototype.Cf,hr.prototype.findObjectsAt=hr.prototype.ji,hr.prototype.findObjectAt=hr.prototype.ic,hr.className="Layer";function oe(a,y){if(rm||(Ar(),rm=!0),Dn(this),Ml=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,xo){var x=this,E=function(){x.removeEventListener(ge.document,"DOMContentLoaded",E,!1),x.setRTL()};ge.document.body!==null?this.setRTL():x.addEventListener(ge.document,"DOMContentLoaded",E,!1)}this.ol=null,of.add("Model",Ii);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===uo&&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,Xp(this),this.layout=new so,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"||ge.Element&&a instanceof Element?ug(this,a):y=a),this.vb=!1,y&&this.nm(y),this}var gh,Ml;function Yp(a){a.Yd=new Ds,a.Yd.Xe(a),a.Db=17,a.Gw=!1,a.tn=!1,a.bu="default",a.Wa=new Pe,a.pj=new ln,a.nl="default",a.Tx(),a.Sx(),a.pb=1,a.pa=new It(NaN,NaN).freeze(),a.du=new It(NaN,NaN),a.Ca=1,a.Pp=1,a.zt=new It(NaN,NaN).freeze(),a.At=NaN,a.Ot=1e-4,a.Mt=100,a.Ab=new oi,a.zu=new It(NaN,NaN).freeze(),a.ut=new pe(NaN,NaN,NaN,NaN).freeze(),a.rj=new qn(0,0,0,0).freeze(),a.sj=Au,a.nu=!1,a.Zt=null,a.fu=null,a.yh=Hr,a.zk=Lr,a.Fg=Hr,a.pq=Lr,a.yt=Cr,a.Bt=Cr,a.Fc=!0,a.pn=!1,a.De=new Fe,a.Eh=new ln,a.Xm=!0,a.vp=250,a.vk=-1,a.xp=new qn(16,16,16,16).freeze(),a.kg=!1,a.Jk=!1,a.fn=!0,a.bq=new _r,a.bq.diagram=a,a.Qg=new _r,a.Qg.diagram=a,a.cj=new _r,a.cj.diagram=a,a.zg=null,a.pf=null,a.qu=!1,ev(a),a.ai=new Fe,a.Ht=!0,a.uu=Bu,a.pw=!1,a.wu=qd,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 ln,a.Xn=new Pe,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 qn(5).freeze(),a.Hw=new Fe().freeze(),a.Nt=999999999,a.nw=new Fe().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 Fe,a.ow=new Fe,a.Xh=null,a.aw=new Ke(8,8),a.bw=999,a.Bw=1,a.Jw=0,a.fc={scale:1,position:new It,bounds:new pe,Py:new Ke,bA:new Ke,Oz:!1},a.fc.canvasSize=a.fc.Py,a.fc.newCanvasSize=a.fc.bA,a.fc.isScroll=!1,a.Rw=new pe(NaN,NaN,NaN,NaN).freeze(),a.wo=new Ke(NaN,NaN).freeze(),a.Sp=new pe(NaN,NaN,NaN,NaN).freeze(),a.It=!1,a.Lg=new ln;var y=new Je,x=new Zi;x.bind(new Bo("text","",ei)),y.add(x),a.ny=y,a.Lg.add("",y),y=new Je,x=new Zi,x.stroke="brown",x.bind(new Bo("text","",ei)),y.add(x),a.Lg.add("Comment",y),y=new Je,y.selectable=!1,y.avoidable=!1,x=new Kn,x.figure="Ellipse",x.fill="black",x.stroke=null,x.desiredSize=new Ke(3,3).ja(),y.add(x),a.Lg.add("LinkLabel",y),a.Yi=new ln,y=new Vn,y.selectionObjectName="GROUPPANEL",y.type=De.Vertical,x=new Zi,x.font="bold 12pt sans-serif",x.bind(new Bo("text","",ei)),y.add(x),x=new De(De.Auto),x.name="GROUPPANEL";var E=new Kn;E.figure="Rectangle",E.fill="rgba(128,128,128,0.2)",E.stroke="black",x.add(E),E=new ns,E.padding=new qn(5,5,5,5).ja(),x.add(E),y.add(x),a.ly=y,a.Yi.add("",y),a.Kh=new ln,y=new _e,x=new Kn,x.isPanelMain=!0,y.add(x),x=new Kn,x.toArrow="Standard",x.fill="black",x.stroke=null,x.strokeWidth=0,y.add(x),a.my=y,a.Kh.add("",y),y=new _e,x=new Kn,x.isPanelMain=!0,x.stroke="brown",y.add(x),a.Kh.add("Comment",y),y=new wi,y.type=De.Auto,x=new Kn,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),x=new ns,x.margin=new qn(1.5,1.5,1.5,1.5).ja(),y.add(x),a.St=y,a.wt=y,y=new wi,y.type=De.Link,x=new Kn,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 Ii,a.toolManager=new lo,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=Kp(),a.eq=null,a.fq=al,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 It,a.zy=500,a.wp=new It,a.wq=!1}oe.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),sd=null,Sh="",lg(this,!1),this.Xn.clear(),vf(),this.Og.clear(),this.Xh=null,this.Ya(),this.Va(),this.N()};function lg(a,y){a.animationManager.Cc(!0),a.Hw=new Fe().freeze(),a.nw=new Fe().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(),vf(),a.Og.clear(),Qi=[],b!==null&&(a.add(b),a.partManager.parts.remove(b)),E&&(a.skipsUndoManager=x),z}function Kp(){return null}oe.prototype.reset=function(){this.clear(),this.vb=!0,Yp(this),fl(this),this.Wg=!0,Xp(this),this.layout=new so,this.Wg=!1,this.model=hy(),this.model.undoManager=new co,this.vb=this.rn=!1,this.N()},oe.prototype.setRTL=function(a){a=a===void 0?this.div:a,a===null&&(a=ge.document.body);var y=Qe("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},oe.prototype.setScrollWidth=function(a){a=a===void 0?this.div:a,a===null&&(a=ge.document.body);var y=0;if(xo){var x=om;y=gh,x===null&&(x=om=Qe("p"),x.style.width="100%",x.style.height="200px",x.style.boxSizing="content-box",y=gh=Qe("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||Bi||(y=11)}this.Db=y,this.Gw=!0},oe.prototype.qb=function(a){a.classType===oe&&(this.autoScale=a)},oe.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 ug(a,y){if(xo){if(y!=null||ce("Diagram setup requires an argument DIV."),a.Ka!==null&&ce("Diagram has already completed setup."),typeof y=="string"?a.Ka=ge.document.getElementById(y):y instanceof HTMLDivElement?a.Ka=y:ce("No DIV or DIV id supplied: "+y),a.Ka===null&&ce("Invalid DIV id; could not get element with id: "+y),a.Ka.H!==void 0&&ce("Invalid div id; div already has a Diagram associated with it."),!a.ol&&ge.ResizeObserver){var x=Bn(function(){a.$b()},250);a.ol=new ge.ResizeObserver(function(){x()}),a.ol.observe(a.Ka)}ge.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=ge.go;var b=new wa(a);if(b.style!==void 0&&(b.style.position="absolute",b.style.top="0px",b.style.left="0px",ge.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),vg(a,a.Aa,a.ya),a.Ka.insertBefore(b.Oa,a.Ka.firstChild),b=new wa(null),b.width=1,b.height=1,a.jw=b,a.oy=b.context,xo){b=Qe("div");var z=Qe("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=Bn(function(){a.Yh=null,a.N()},300),a.Ov=Bn(function(){hg(a)},250),a.preventDefault=function(tt){return tt.preventDefault(),!1},a.$j=function(tt){if(a.isEnabled){var ot=sa(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(),Da(ot,tt)}},a.aA=function(tt){a.isEnabled&&(a.Vk=!1,sa(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=gg(a,tt,!0,!1,!0,at),ed(a,tt,rt),rt.targetDiagram=fg(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():Da(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=gg(a,tt,!1,!1,!1,ot[1]!==null);var rt=ge.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,ed(a,ut,ot),ot.targetObject=null,a.doMouseMove(),Da(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=gg(a,tt,!1,!0,!0,!1);var at=ge.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 oe&&at.H!==a&&ed(at.H,tt,rt),at===null&&(at=tt.target),ed(a,tt,rt),rt.clickCount=a.yq,rt.targetDiagram=fg(tt,at),rt.targetObject=null,a.doMouseUp(),Da(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"+ec[1]+ec[2]+"wI"+ld.slice(1,5)]["b"+Ax.slice(1,y)](E.Z,tc,y,y),E.Vc(!0),tv(a),a.nl==="svg"&&(y=a.pj.get("svg"),a.Ka.appendChild(y.Oa),a.ib=y.context)}}oe.prototype.addEventListener=function(a,y,x,E){a.addEventListener(y,x,{capture:E,passive:!1})},oe.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(ge,"resize",a.Ov,!1)}function fs(a){30<a.Sq&&(a.Yh=1)}function Kd(a,y){a.Yh!==null&&(a.Yh=null,y&&a.hk(),Ri&&Ri.nx||(a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0))}oe.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:ge.devicePixelRatio||1},oe.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},oe.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},oe.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},oe.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},oe.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},oe.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},oe.prototype.doFocus=function(){this.focus()},oe.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var a=ge.scrollX||ge.pageXOffset,y=ge.scrollY||ge.pageYOffset;this.ta.focus(),ge.scrollTo(a,y)}},oe.prototype.Oy=function(){this.H.R("GainedFocus")},oe.prototype.Ny=function(){this.H.R("LostFocus")};function hg(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===Hr&&(a.Jk=!0,y.C()),a.ld||a.$b())}}}function Xp(a){var y=new hr;y.name="Background",a.Al(y),y=new hr,y.name="",a.Al(y),y=new hr,y.name="Foreground",a.Al(y),y=new hr,y.name="Adornment",y.isTemporary=!0,y.isInDocumentBounds=!1,a.Al(y),y=new hr,y.name="Tool",y.isTemporary=!0,y.isInDocumentBounds=!0,a.Al(y),y=new hr,y.name="Grid",y.allowSelect=!1,y.pickable=!1,y.isTemporary=!0,y.isInDocumentBounds=!1,a.Ww(y,a.Qj("Background"))}function Zp(a){var y=new De(De.Grid);y.name="GRID";var x=new Kn;return x.figure="LineH",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new Kn,x.figure="LineH",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new Kn,x.figure="LineH",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new Kn,x.figure="LineV",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new Kn,x.figure="LineV",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new Kn,x.figure="LineV",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new kn,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):od(this.H)}function Qp(a){this.H.isEnabled?(this.H.lu=a.target.scrollTop,this.H.ju=a.target.scrollLeft):od(this.H)}oe.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,Pt=b.right,kt=b.bottom;b=this.scale;var Dt=a.scrollLeft;if(this.tn)switch(this.bu){case"negative":Dt=Dt+a.scrollWidth-a.clientWidth;break;case"reverse":Dt=a.scrollWidth-Dt-a.clientWidth}var Tt=Dt;mt<rt||yt<at?(Dt=It.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==Tt&&(Dt.x=Tt/b+tt,this.ju=Tt),this.allowVerticalScroll&&this.lu!==a.scrollTop&&(Dt.y=a.scrollTop/b+ot,this.lu=a.scrollTop),this.position=Dt,It.free(Dt),this.Ee=this.qr=!1):(Dt=It.alloc(),a.uy&&this.allowHorizontalScroll&&(tt<ft&&(this.position=Dt.h(Tt+tt,this.position.y)),ut>Pt&&(this.position=Dt.h(-(y.scrollWidth-this.Aa)+Tt-this.Aa/b+ut,this.position.y))),a.vy&&this.allowVerticalScroll&&(ot<E&&(this.position=Dt.h(this.position.x,a.scrollTop+ot)),z>kt&&(this.position=Dt.h(this.position.x,-(y.scrollHeight-this.ya)+a.scrollTop-this.ya/b+z))),It.free(Dt),this.vd=!0,this.Ee=this.qr=!1,E=this.documentBounds,b=this.viewportBounds,ut=E.right,Pt=b.right,z=E.bottom,kt=b.bottom,tt=E.x,ft=b.x,ot=E.y,E=b.y,mt>=rt&&tt>=ft&&ut<=Pt&&(x.style.width="1px"),yt>=at&&ot>=E&&z<=kt&&(x.style.height="1px"))}},oe.prototype.computeBounds=function(a){return a===void 0&&(a=new pe),Fr(this),dg(this,a)};function dg(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}oe.prototype.computePartsBounds=function(a,y){y===void 0&&(y=!1);var x=null;if(ae(a))for(var E=0;E<a.length;E++){var b=a[E];!y&&b instanceof _e||(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 _e||(E.Va(),x===null?x=E.actualBounds.copy():x.ed(E.actualBounds));return x===null?new pe(NaN,NaN,0,0):x};function xa(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=It.alloc(),x.xi(a.documentBounds,a.initialDocumentSpot);var E=a.viewportBounds;E=pe.allocAt(0,0,E.width,E.height);var b=It.alloc();b.xi(E,a.initialViewportSpot),b.h(x.x-b.x,x.y-b.y),a.position=b,pe.free(E),It.free(b),It.free(x)}x=a.yh,y&&a.Fg!==Hr&&(x=a.Fg);var z=x!==Hr?td(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()?Di:rt),cg(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 pe(x,E,b,tt),z,y,!1)}}function td(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===Ks?(y=Math.min(rt,ot),y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):y===xh?(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}oe.prototype.zoomToFit=function(){var a=this.sj;this.sj=Au,this.scale=td(this,Ks),a!==Au&&(xa(this,!1),cg(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=a},xt=oe.prototype,xt.BA=function(a,y){y===void 0&&(y=Ks);var x=a.width,E=a.height;if(!(x===0||E===0||isNaN(x)&&isNaN(E))){var b=1;if(y===Ks||y===xh)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===xh?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 It(a.x,a.y)}},xt.Jy=function(a,y){this.Va();var x=this.documentBounds,E=this.viewportBounds;this.position=new It(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))},xt.zz=function(a){if(a instanceof Jt){this.eq=a;var y=It.alloc();this.fq=this.op(a.ga(Cr,y)),It.free(y)}else this.eq=null,this.fq=al};function cg(a,y,x,E,b,z){var tt=It.allocAt(a.pa.x,a.pa.y),ot=tt.x,rt=tt.y;if(a.eq!==null){var at=It.alloc();at=a.eq.ga(Cr,at),ot=at.x-a.fq.x/a.scale,rt=at.y-a.fq.y/a.scale,b=pr,It.free(at)}(z||a.scrollMode===Au)&&(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),fl(a),It.free(tt)}xt.Ol=function(a,y){if(y===void 0&&(y=!0),y){if(a=El(this,a,function(x){return x.part},function(x){return x.canSelect()}),a instanceof kn)return a}else if(a=El(this,a,function(x){return x.part}),a instanceof kn)return a;return null},xt.ic=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null),Fr(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 El(a,y,x,E){for(x===void 0&&(x=null),E===void 0&&(E=null),Fr(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}xt.lz=function(a,y,x){return y===void 0&&(y=!0),Xd(this,a,function(E){return E.part},y?function(E){return E instanceof kn&&E.canSelect()}:null,x)};function Xd(a,y,x,E,b){for(x===void 0&&(x=null),E===void 0&&(E=null),b instanceof Pe||b instanceof Fe||(b=new Fe),Fr(a),a=a.Wa.iteratorBackwards;a.next();){var z=a.value;z.visible&&!z.isTemporary&&z.ji(y,x,E,b)}return b}xt.ji=function(a,y,x,E){y===void 0&&(y=null),x===void 0&&(x=null),E instanceof Pe||E instanceof Fe||(E=new Fe),Fr(this);for(var b=this.Wa.iteratorBackwards;b.next();){var z=b.value;z.visible&&z.ji(a,y,x,E)}return E},xt.ux=function(a,y,x,E){return y===void 0&&(y=!1),x===void 0&&(x=!0),Kc(this,a,function(b){return b instanceof kn&&(!x||b.canSelect())},y,E)},xt.Cf=function(a,y,x,E,b){y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof Pe||b instanceof Fe||(b=new Fe),Fr(this);for(var z=this.Wa.iteratorBackwards;z.next();){var tt=z.value;tt.visible&&tt.Cf(a,y,x,E,b)}return b},xt.Nu=function(a,y,x,E,b,z){var tt=new Fe;Fr(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 Kc(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 Pe||b instanceof Fe||(b=new Fe),Fr(a),a=a.Wa.iteratorBackwards;a.next();){var tt=a.value;tt.visible&&!tt.isTemporary&&tt.Cf(y,z,x,E,b)}return b}xt.mz=function(a,y,x,E,b){return x===void 0&&(x=!0),E===void 0&&(E=!0),Zd(this,a,y,function(z){return z instanceof kn&&(!E||z.canSelect())},x,b)},xt.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 Pe||b instanceof Fe)&&(z=b),b=!0),z instanceof Pe||z instanceof Fe||(z=new Fe),Fr(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 Zd(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 Pe||b instanceof Fe)&&(z=b),b=!0),z instanceof Pe||z instanceof Fe||(z=new Fe),Fr(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}oe.prototype.acceptEvent=function(a){return sa(this,a,a instanceof MouseEvent)};function sa(a,y,x){var E=a.Qg;return a.Qg=a.cj,a.cj=E,E.diagram=a,E.event=y,x?ed(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),Bi&&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=fg(y,y.target),E.targetObject=null,E}function fg(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 gg(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,Bi&&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 Da(a,y){return a.bubbles?!0:(y.stopPropagation!==void 0&&y.stopPropagation(),y.cancelable!==!1&&y.preventDefault(),y.cancelBubble=!0,!1)}oe.prototype.Qz=function(a){var y=this.H;if(!this.H.isEnabled)return!1;var x=sa(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(),Da(x,a)},oe.prototype.Rz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=sa(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(),Da(x,a)},oe.prototype.bz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=sa(y,a,!0);return y.mouseEnter!==null&&y.mouseEnter(x),y.currentTool.standardMouseOver(),Da(x,a)},oe.prototype.cz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=sa(y,a,!0);return y.mouseLeave!==null&&y.mouseLeave(x),Da(x,a)},oe.prototype.getMouse=function(a){var y=this.ta;if(y===null)return new It(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?Po(new It(y,a),this.Ab):new It(y,a)};function ed(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=It.allocAt(tt,ot),a.Ab.Cd(y),x.documentPoint.assign(y),It.free(y)):x.documentPoint.h(tt,ot)}function pg(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))}}oe.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function qp(a){a.ld||Fr(a),a.Va()}oe.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},xt=oe.prototype,xt.Pz=function(){return this.kg},xt.Xy=function(a){a===void 0&&(a=null);var y=this.animationManager,x=y.isEnabled;y.Cc(),y.isEnabled=!1,aa(this),this.hf=!1,this.du=new It(NaN,NaN),y.isEnabled=x,this.ld=!0;var E=this;a!==null&&ri(function(){E.ld=!1,kl(y,"Model"),a(E)},1)},xt.$b=function(a){if(a===void 0&&(a=!1),this.kg!==!0&&!(this.vb||a===!1&&this.ld)){this.kg=!0;var y=this;ge.requestAnimationFrame(function(){y.kg&&y.bd()})}},xt.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),aa(this))};function ph(a,y,x){!a.Ee||a.vb||a.animationManager.defaultAnimation.isAnimating||od(a)||(y&&Fr(a),x&&xa(a,!1))}function aa(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];Go(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||hg(a),ph(a,!1,!0),a.fe!==null&&(a.fe.visible&&!a.mq&&(cl(a),a.mq=!0),!a.fe.visible&&a.mq&&(a.mq=!1)),Fr(a),z=!1,(!a.hf||a.xh)&&(a.hf?kg(a,!a.Jk):(a.Ea("Initial Layout"),x.isEnabled===!1&&x.Cc(),kg(a,!1)),z=!0),a.Jk=!1,Fr(a),a.ou||qp(a),ph(a,!0,!1),tt=!1,z?(x=pe.alloc(),x.assign(a.viewportBounds),a.hf||(tt=a.hf=!0,a.skipsUndoManager||(a.undoManager.isPendingClear=!0),a.undoManager.isPendingUnmodified=!0,mg(a)),a.R("LayoutCompleted"),ph(a,!0,!1),pe.free(x)):x.Ok&&x.Qw&&(a.Fg!==Hr?a.scale=td(a,a.Fg):a.yh!==Hr?a.scale=td(a,a.yh):(x=a.initialScale,isFinite(x)&&0<x&&(a.scale=x)),xa(a,!0)),z&&tt&&a.eb("Initial Layout"),Fr(a),y||a.gc(a.ib),b&&(a.skipsUndoManager=E),a.ld=!1}}function mg(a){if(a.Fg!==Hr)a.scale=td(a,a.Fg);else if(a.yh!==Hr)a.scale=td(a,a.yh);else{var y=a.initialScale;isFinite(y)&&0<y&&(a.scale=y)}xa(a,!0),y=a.Wa.s,a.Fd(y,y.length,a,a.viewportBounds),a.R("InitialLayoutCompleted"),a.du.assign(a.pa),cl(a)}function Fr(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 Fe,a.Nv(x,a.De)}a.nodes.each(function(E){E instanceof Vn&&E.U&65536&&(E.U=E.U^65536)})}}xt.Nv=function(a,y){for(a.reset();a.next();){var x=a.value;!x.Zc()||x instanceof Vn||(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))}for(a.reset();a.next();)x=a.value,x instanceof Vn&&x.isVisible()&&Jd(this,x);for(a.reset();a.next();)x=a.value,x instanceof _e&&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 wi&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))};function Jd(a,y){for(var x=gn(),E=gn(),b=y.memberParts;b.next();){var z=b.value;z.isVisible()&&(z instanceof Vn?(Zs(z)||ts(z)||wh(z))&&Jd(a,z):z instanceof _e?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(Ye(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();Ye(E)}xt.Fd=function(a,y,x,E){if(this.vd||this.animationManager.isAnimating)for(var b=0;b<y;b++)a[b].Fd(x,E)},xt.gc=function(a){if(this.Ka!==null){if(this.ta===null&&ce("No canvas specified"),this.nl==="svg"){if(this.Ka!==null){var y=this.animationManager;if(!y.zb&&(!y.isAnimating||y.isTicking)){id(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,Xy(a,ot.m11,ot.m12,ot.m21,ot.m22,ot.dx,ot.dy),this.pb!==1&&(a.globalAlpha=this.pb),bu(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?ud(this.Yf,this)&&(a=this.Vp()):a=!0,a&&(oi.prototype.Cd=oi.prototype.Eu),this.Fc=this.vd=!1}}}}else t:if(z=this.animationManager,!z.zb&&(!z.isAnimating||z.isTicking)&&(x=new Date,id(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),bu(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?ud(this.Yf,this)&&(y=this.Vp()):y=!0,y&&(oi.prototype.Cd=oi.prototype.Eu),E?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,y=+new Date-+x,E=Ri&&Ri.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 Xc(a,y,x,E,b,z,tt,ot,rt,at){if(a.Ka!==null){a.ta===null&&ce("No canvas specified"),tt===void 0&&(tt=null),ot===void 0&&(ot=null),rt===void 0&&(rt=!1),at===void 0&&(at=!1),id(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 pe(z.x,z.y,E.width/b,E.height/b),Pt=yt.copy();Pt.Co(x),cl(a,Pt),Fr(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 kt=a.Mb;y.scale(kt,kt);var Dt=oi.alloc();Dt.reset(),Dt.translate(x.left,x.top),Dt.scale(b),z.x===0&&z.y===0||Dt.translate(-z.x,-z.y),y.setTransform(Dt.m11,Dt.m12,Dt.m21,Dt.m22,Dt.dx,Dt.dy),y.yc(),y instanceof Os&&Xy(y,Dt.m11,Dt.m12,Dt.m21,Dt.m22,Dt.dx,Dt.dy),oi.free(Dt),bu(a,y),y.globalAlpha=a.pb;var Tt=a.Qj("Grid");if(tt){var Rt=new Fe,Gt=tt.iterator;for(Gt.reset();Gt.next();){var Vt=Gt.value;Vt instanceof kn&&(at||Vt.layer!==Tt)&&(Vt.Gj(),Rt.add(Vt))}for(at=0;at<mt;at++)Vp(ft[at],y,a,Rt,rt);Rt.each(function(ie){return ie.Gj()})}else for(Rt=0;Rt<mt;Rt++){var Xt=ft[Rt];Xt===Tt?at&&Xt.gc(y,a,!0):Xt.gc(y,a,rt)}a.$i=!1,a.Yf&&ud(a.Yf,a)&&a.Vp()}finally{a.Ca=ut,a.ib.Vc(!0),a.vd=!0,a.Fd(ft,mt,a,a.viewportBounds),cl(a),a.ib instanceof Os&&(a.ib.Nj.PA(),a.redraw())}}}xt.Gf=function(a){return this.Rg[a]},xt.Xx=function(a,y){a==="minDrawingLength"&&(this.Oq=y),this.Rg[a]=y,this.redraw()},xt.Tx=function(){this.Rg=new zn,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(Bi||So),this.Rg.temporaryPixelRatio=!0,this.Rg.pictureRatioOptimization=!0,this.Oq=this.Rg.minDrawingLength=1};function bu(a,y){a=a.Rg,a!==null&&(a.imageSmoothingEnabled!==void 0&&y.Wx(!!a.imageSmoothingEnabled),a=a.defaultFont,a!=null&&(y.font=a))}xt.Ql=function(a){return this.on[a]},xt.sA=function(a,y){this.on[a]=y},xt.Sx=function(){this.on=new zn,this.on.extraTouchArea=10,this.on.extraTouchThreshold=10,this.on.hasGestureZoom=!0},xt.set=function(a){return Object.assign(this,a),this},xt.Du=function(a){return this.nm(a)},xt.nm=function(a){return nd(this,a),this};function nd(a,y){var x=a instanceof De,E=a instanceof oe,b;for(b in y){b===""&&ce("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):ce("Unable to find object named: "+rt+" in "+a.toString()+" when trying to set property: "+b)}}if(tt[0]!=="_"&&!Si(z,tt))if(E&&tt==="ModelChanged"){a.Yw(y[tt]);continue}else if(E&&tt==="Changed"){a.Pe(y[tt]);continue}else if(E&&Si(a.toolManager,tt))z=a.toolManager;else if(E&&em(a,tt)){a.Bj(tt,y[tt]);continue}else if(a instanceof cn&&tt==="Changed"){a.Pe(y[tt]);continue}else ce('Trying to set undefined property "'+tt+'" on object: '+z.toString());z[tt]=y[b],tt[0]==="_"&&z instanceof Jt&&z.Vw(tt)}}xt.bx=function(){if(this.Eh.count!==0&&!(1<this.undoManager.transactionLevel)){for(;0<this.Eh.count;){var a=this.Eh;for(this.Eh=new ln,a=a.iterator;a.next();){var y=a.key;y.Xo(a.value),y.qc()}}this.N()}},xt.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")},oe.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!==$d&&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=pe.alloc(),Lg(this,this.computeBounds(E)),pe.free(E)),E=this.ta,E===null||E instanceof gl)))){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),ud(this.Yf,this)&&a.clearRect(0,0,rt,at),E=gn(),a=gn(),yt=Math.abs(z),mt=Math.abs(y);var Pt=ut===0?0:b-yt;ut=It.allocAt(Pt,0),yt=It.allocAt(yt+Pt,ot),a.push(new pe(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 kt=this.Ab;if(kt.reset(),kt.scale(tt,tt),this.Ca!==1&&kt.scale(this.Ca),tt=this.pa,(tt.x!==0||tt.y!==0)&&isFinite(tt.x)&&isFinite(tt.y)&&kt.translate(-tt.x,-tt.y),Po(ut,kt),Po(yt,kt),E.push(new pe(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),Pt=ft===0?0:ot-mt,ut.h(0,Pt),yt.h(b,mt+Pt),a.push(new pe(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),Po(ut,kt),Po(yt,kt),E.push(new pe(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),ud(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 pe(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),Po(ut,kt),Po(yt,kt),E.push(new pe(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y)))),It.free(ut),It.free(yt),ph(this,!1,!0),this.Ka===null&&ce("No div specified"),this.ta===null&&ce("No canvas specified"),!this.animationManager.zb&&(b=this.ib,this.Fc)){for(id(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),bu(this,b),b.globalAlpha=this.pb,ot=0;ot<z;ot++)if(tt=y[ot],rt=E,tt.visible&&tt.pb!==0){at=$l(tt,b),ft=tt.Zq,ft.length=0,ut=this.scale,mt=pe.alloc(),yt=tt.Pa.s,kt=yt.length,Pt=rt.length;for(var Dt=0;Dt<kt;Dt++){var Tt=yt[Dt],Rt=md(Tt,Tt.actualBounds);t:{for(var Gt=2/ut,Vt=4/ut,Xt=0;Xt<Pt;Xt++){var ie=rt[Xt];if(ie.width!==0&&ie.height!==0&&Rt.Vu(ie.x-Gt,ie.y-Gt,ie.width+Vt,ie.height+Vt)){Rt=!0;break t}}Rt=!1}Rt&&tt.Oj(b,Tt,this,ft,ut,mt,!0)}pe.free(mt),b.globalAlpha=at}b.restore(),b.Vc(!0),this.Yf&&ud(this.Yf,this)&&this.Vp(),this.Fc=this.vd=!1,this.hk()}Ye(E),Ye(a),this.ld=!1}}else this.bd();x&&(fs(this),this.bd(),Kd(this,!0))}else x?(fs(this),this.bd(),Kd(this,!0)):this.bd()}};function id(a){a.pn!==!1&&(a.pn=!1,vg(a,a.Aa,a.ya))}function vg(a,y,x){fl(a);var E=a.Mb;a.ta.resize(y*E,x*E,y,x)&&(a.Fc=!0,a.ib.Vc(!0))}function od(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,fl(a)),!a.hf||!a.viewportBounds.w())return!0;var Pt=a.ku,kt=a.hu;if(a.Ee=!1,!(z||a.gf||a.Be||a.mn||a.nn))return!0;var Dt=a.documentBounds,Tt=0,Rt=0,Gt=0,Vt=0,Xt=ut.width,ie=ut.height,Xe=a.rj;a.contentAlignment.sb()?(Dt.width>Xt&&(Tt=Xe.left,Rt=Xe.right),Dt.height>ie&&(Gt=Xe.top,Vt=Xe.bottom)):(Tt=Xe.left,Rt=Xe.right,Gt=Xe.top,Vt=Xe.bottom);var an=Dt.width+Tt+Rt,on=Dt.height+Gt+Vt;Xe=a.scale;var je=an>rt/Xe,Me=on>at/Xe;if(!(z||a.gf||a.Be||je||Me))return!0;Tt=Dt.x-Tt,rt=ut.x,Rt=Dt.right+Rt,at=ut.right+tt,Gt=Dt.y-Gt;var Wn=ut.y;Dt=Dt.bottom+Vt,ut=ut.bottom+ot;var jn="1px";if(Vt="1px",a.scrollMode===Au&&(je||Me)&&(je&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(je=1,Tt+1<rt&&(je=Math.max((rt-Tt)*Xe+a.Aa,je)),Rt>at+1&&(je=Math.max((Rt-at)*Xe+a.Aa,je)),Xt+tt+1<an&&(je=Math.max((an-Xt)*Xe+a.Aa,je)),jn=je.toString()+"px"),Me&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(je=1,Gt+1<Wn&&(je=Math.max((Wn-Gt)*Xe+a.ya,je)),Dt>ut+1&&(je=Math.max((Dt-ut)*Xe+a.ya,je)),ie+ot+1<on&&(je=Math.max((on-ie)*Xe+a.ya,je)),Vt=je.toString()+"px")),je=jn!=="1px",Me=Vt!=="1px",je&&Me||!je&&!Me||(Me&&(at-=a.Db),je&&(ut-=a.Db),an<Xt+tt||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(tt=1,Tt+1<rt&&(tt=Math.max((rt-Tt)*Xe+a.Aa,tt)),Rt>at+1&&(tt=Math.max((Rt-at)*Xe+a.Aa,tt)),Xt+1<an&&(tt=Math.max((an-Xt)*Xe+a.Aa,tt)),jn=tt.toString()+"px"),je=jn!=="1px",tt=a.ya,je!==a.Be&&(tt=je?a.ya-a.Db:a.ya+a.Db),on<ie+ot||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(ot=1,Gt+1<Wn&&(ot=Math.max((Wn-Gt)*Xe+tt,ot)),Dt>ut+1&&(ot=Math.max((Dt-ut)*Xe+tt,ot)),ie+1<on&&(ot=Math.max((on-ie)*Xe+tt,ot)),Vt=ot.toString()+"px"),Me=Vt!=="1px"),a.qr&&je===a.Be&&Me===a.gf)return x===a.Aa&&E===a.ya||a.bd(),!1;if(je!==a.Be&&(jn==="1px"?a.ya=a.ya+a.Db:a.ya=Math.max(a.ya-a.Db,1),z=!0),a.Be=je,kt.style.width=jn,Me!==a.gf&&(Vt==="1px"?a.Aa=a.Aa+a.Db:a.Aa=Math.max(a.Aa-a.Db,1),z=!0,a.tn&&(ot=It.alloc(),Me?(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)),It.free(ot))),z&&fl(a),a.gf=Me,kt.style.height=Vt,a.gu=!0,z&&(a.pn=!0),y=Pt.scrollLeft,a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(Xt+1<an?y=(a.position.x-Tt)*Xe:Tt+1<rt?y=Pt.scrollWidth-Pt.clientWidth:Rt>at+1&&(y=a.position.x*Xe)),a.tn)switch(a.bu){case"negative":y=-(Pt.scrollWidth-y-Pt.clientWidth);break;case"reverse":y=Pt.scrollWidth-y-Pt.clientWidth}return Pt.scrollLeft=y,a.hasVerticalScrollbar&&a.allowVerticalScroll&&(ie+1<on?Pt.scrollTop=(a.position.y-Gt)*Xe:Gt+1<Wn?Pt.scrollTop=Pt.scrollHeight-Pt.clientHeight:Dt>ut+1&&(Pt.scrollTop=a.position.y*Xe)),rt=a.Aa,at=a.ya,Pt.style.width=rt+(a.gf?a.Db:0)+"px",Pt.style.height=at+(a.Be?a.Db:0)+"px",x!==rt||E!==at||a.animationManager.zb?(x=pe.allocAt(b,ft,mt,yt),a.onViewportBoundsChanged(x,a.viewportBounds,Xe,z),pe.free(x),!1):!0}xt=oe.prototype,xt.add=function(a){var y=a.diagram;if(y!==this&&(y!==null&&ce("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&&ce('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(bo,"parts",y,null,a,null,x),y.isTemporary||this.Ya(),a.C(1),x=a.layerChanged,x!==null&&x(a,null,y)}},xt.oi=function(a){this.partManager.oi(a);var y=this;fd(a,function(x){rd(y,x)}),(a instanceof wi||a instanceof Vn&&a.placeholder!==null)&&a.v(),a.data!==null&&fd(a,function(x){ay(y.partManager,x)}),ts(a)!==!0&&wh(a)!==!0||this.De.add(a),j1(a,!0,this),z1(a)?(a.actualBounds.w()&&this.N(md(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(md(a,a.actualBounds)),this.$b()},xt.pc=function(a){a.Ej(),this.partManager.pc(a);var y=this;a.data!==null&&fd(a,function(x){ly(y.partManager,x,y)}),this.De.remove(a),z1(a)?(a.actualBounds.w()&&this.N(md(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(md(a,a.actualBounds)),this.$b()},xt.remove=function(a){yg(this,a,!0)};function yg(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(Uo,"parts",E,y,null,x,null),a=y.layerChanged,a!==null&&a(y,E,null))}xt.Is=function(a,y){if(y===void 0&&(y=!1),ae(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 Fe,x.addAll(a),a=x.iterator;a.next();)x=a.value,y&&!x.canDelete()||this.remove(x)},xt.Kj=function(a,y,x){return x===void 0&&(x=!1),this.partManager.Kj(a,y,x)},oe.prototype.moveParts=function(a,y,x,E){if(x===void 0&&(x=!1),E===void 0&&(E=Zc(this)),this.toolManager!==null){var b=new ln;if(a!==null)if(ae(a))for(var z=0;z<a.length;z++)Fl(this,b,a[z],x,E);else for(a=a.iterator;a.next();)Fl(this,b,a.value,x,E);else{for(a=this.parts;a.next();)Fl(this,b,a.value,x,E);for(a=this.nodes;a.next();)Fl(this,b,a.value,x,E);for(a=this.links;a.next();)Fl(this,b,a.value,x,E)}mh(this,b,y,E,x)}};function Fl(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=Zc(a)),x instanceof Je){if(y.add(x,a.Pd(b,x,x.location)),x instanceof Vn&&(x.placeholder!==null||b.dragsMembers))for(z=x.memberParts;z.next();)Fl(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)&&Fl(a,y,tt,E,b)}}if(b.dragsTree)for(x=x.Ou();x.next();)Fl(a,y,x.value,E,b)}else if(x instanceof _e)for(y.add(x,a.Pd(b,x)),x=x.labelNodes;x.next();)Fl(a,y,x.value,E,b);else x instanceof wi||y.add(x,a.Pd(b,x,x.location))}function mh(a,y,x,E,b){if(y!==null&&y.count!==0){var z=It.alloc(),tt=It.alloc();tt.assign(x),isNaN(tt.x)&&(tt.x=0),isNaN(tt.y)&&(tt.y=0),(x=a.Mr)||Qc(a,y);for(var ot=gn(),rt=gn(),at=y.iterator,ut=It.alloc();at.next();){var ft=at.key,mt=at.value;if(ft.Zc()){var yt=Sg(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 It),mt.shifted.assign(ut.re(yt)))}else at.key instanceof _e&&rt.push(at.sa)}for(It.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 It),ft.node.location=z.add(ft.Su.shifted);for(b=It.alloc(),at=It.alloc(),ft=rt.length,mt=0;mt<ft;mt++){var Pt=rt[mt];if(yt=Pt.key,yt instanceof _e)if(yt.suspendsRouting){yt.Tg=null,ut=yt.fromNode;var kt=yt.toNode;if(a.draggedLink!==null&&E.dragsLink)if(kt=Pt.value.point,yt.dragComputation===null)y.add(yt,a.Pd(E,yt,tt)),_u(yt,tt.x-kt.x,tt.y-kt.y);else{Pt=It.allocAt(0,0),(ut=yt.i(0))&&ut.w()&&Pt.assign(ut);var Dt=ut=It.alloc().assign(Pt).add(tt);E.isGridSnapEnabled&&(E.isGridSnapRealtime||a.lastInput.up)&&(Dt=It.alloc(),Jc(a,yt,ut,Dt,E)),ut.assign(yt.dragComputation(yt,ut,Dt)).re(Pt),y.add(yt,a.Pd(E,yt,ut)),_u(yt,ut.x-kt.x,ut.y-kt.y),It.free(Pt),It.free(ut),Dt!==ut&&It.free(Dt)}else ut!==null&&(b.assign(ut.location),Dt=y.I(ut),Dt!==null&&b.re(Dt.point)),kt!==null&&(at.assign(kt.location),Dt=y.I(kt),Dt!==null&&at.re(Dt.point)),ut!==null&&kt!==null?b.Xa(at)?(ut=Pt.value.point,kt=z,kt.assign(b),kt.re(ut),y.add(yt,a.Pd(E,yt,b)),_u(yt,kt.x,kt.y)):(yt.suspendsRouting=!1,yt.bb()):(Pt=Pt.value.point,ut=ut!==null?b:kt!==null?at:tt,y.add(yt,a.Pd(E,yt,ut)),_u(yt,ut.x-Pt.x,ut.y-Pt.y))}else(yt.fromNode===null||yt.toNode===null)&&(ut=Pt.value.point,y.add(yt,a.Pd(E,yt,tt)),_u(yt,tt.x-ut.x,tt.y-ut.y))}It.free(z),It.free(tt),It.free(b),It.free(at),Ye(ot),Ye(rt),x||(Fr(a),vh(a,y))}}oe.prototype.computeMove=function(a,y,x,E){if(E===void 0&&(E=new It),E.assign(y),a===null)return E;var b=y,z=x.isGridSnapEnabled;z&&(x.isGridSnapRealtime||this.lastInput.up)&&(b=It.alloc(),Jc(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&&It.free(b),E};function Zc(a){var y=a.toolManager.findTool("Dragging");return y!==null?y.dragOptions:a.Wm}function Jc(a,y,x,E,b){if(b===void 0&&(b=Zc(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=It.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),It.free(z)}}function Qc(a,y){if(y!==null)for(a.Mr=!0,a=y.iterator;a.next();)y=a.key,y instanceof _e&&(y.suspendsRouting=!0)}function vh(a,y){if(y!==null){for(y=y.iterator;y.next();){var x=y.key;x instanceof _e&&(x.suspendsRouting=!1,Kv(x)&&x.bb())}a.Mr=!1}}function Sg(a,y,x){return y=y.containingGroup,y!==null&&(a=Sg(a,y,x),a!==null||(a=x.I(y),a!==null))?a:null}xt=oe.prototype,xt.Pd=function(a,y,x){if(x===void 0)return new tu(mo);var E=a.isGridSnapEnabled;return a.groupsSnapMembers||y.containingGroup===null||(E=!1),E?new tu(new It(Math.round(1e3*x.x)/1e3,Math.round(1e3*x.y)/1e3)):new tu(x.copy())};function xg(a,y,x){if(y.diagram!==null&&y.diagram!==a&&ce("Cannot share a Layer with another Diagram: "+y+" of "+y.diagram),x===null?y.diagram!==null&&ce("Cannot add an existing Layer to this Diagram again: "+y):(x.diagram!==a&&ce("Existing Layer must be in this Diagram: "+x+" not in "+x.diagram),y===x&&ce("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&&ce("Cannot add Layer with the name '"+y+"'; a Layer with the same name is already present in this Diagram.")}}xt.Al=function(a){xg(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(bo,"layers",this,null,a,null,x+1),this.N(),this.Ya(),this},xt.Ww=function(a,y){xg(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(Uo,"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(bo,"layers",this,null,a,null,z),this.N(),0>E&&this.Ya(),this},xt.Cy=function(a,y){xg(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(Uo,"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(bo,"layers",this,null,a,null,z+1),this.N(),0>E&&this.Ya(),this},xt.kA=function(a){if(a.diagram!==this&&ce("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(Uo,"layers",this,a,null,x,null),this.N(),this.Ya()}}},xt.Qj=function(a){for(var y=this.layers;y.next();){var x=y.value;if(x.name===a)return x}return null},xt.Yw=function(a){return this.pf===null&&(this.pf=new Pe),this.pf.add(a),this.model.Pe(a),this},xt.mA=function(a){this.pf!==null&&(this.pf.remove(a),this.pf.count===0&&(this.pf=null)),this.model.ik(a)},xt.Pe=function(a){return this.zg===null&&(this.zg=new Pe),this.zg.add(a),this},xt.ik=function(a){this.zg!==null&&(this.zg.remove(a),this.zg.count===0&&(this.zg=null))},xt.ds=function(a){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(a),a.change!==Bs&&(this.isModified=!0),this.zg!==null)for(var y=this.zg,x=y.length,E=0;E<x;E++)y.M(E)(a)},xt.cb=function(a,y,x,E,b,z,tt){z===void 0&&(z=null),tt===void 0&&(tt=null);var ot=new ho;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)},xt.g=function(a,y,x,E,b){this.cb(uo,a,this,y,x,E,b)},oe.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===uo){var b=a.object;if(ro(b,a.propertyName,a.I(y)),b instanceof Jt){var z=b.part;z!==null&&z.Wb()}this.isModified=!0}else if(E===bo){var tt=a.object,ot=a.newParam,rt=a.newValue;if(tt instanceof De)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 Ho&&(rt.isRow?h1(tt,ot,y?void 0:rt):d1(tt,ot,y?void 0:rt));else if(tt instanceof hr){var ut=a.oldParam===!0;typeof ot=="number"&&rt instanceof kn&&(y?(rt.isSelected=!1,rt.isHighlighted=!1,rt.Wb(),tt.pc(ut?ot:-1,rt,ut)):tt.oi(ot,rt,ut))}else tt instanceof oe?typeof ot=="number"&&rt instanceof hr&&(y?this.Wa.mb(ot):(rt.Xe(this),this.Wa.Gb(ot,rt))):ce("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(E===Uo){var ft=a.object,mt=a.oldParam,yt=a.oldValue;if(ft instanceof De)typeof mt=="number"&&yt instanceof Jt?y?ft.Gb(mt,yt):ft.pc(mt):typeof mt=="number"&&yt instanceof Ho&&(yt.isRow?h1(ft,mt,y?yt:void 0):d1(ft,mt,y?yt:void 0));else if(ft instanceof hr){var Pt=a.newParam===!0;typeof mt=="number"&&yt instanceof kn&&(y?0>ft.Pa.indexOf(yt)&&ft.oi(mt,yt,Pt):(yt.isSelected=!1,yt.isHighlighted=!1,yt.Wb(),ft.pc(Pt?mt:-1,yt,Pt)))}else ft instanceof oe?typeof mt=="number"&&yt instanceof hr&&(y?(yt.Xe(this),this.Wa.Gb(mt,yt)):this.Wa.mb(mt)):ce("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else E!==Bs&&ce("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=x}}},oe.prototype.Ea=function(a){return this.undoManager.Ea(a)},oe.prototype.eb=function(a){return this.undoManager.eb(a)},oe.prototype.Kf=function(){return this.undoManager.Kf()},oe.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}},oe.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)},oe.prototype.rp=function(){this.partManager.rp()};function Pg(a,y,x){var E=a.animationManager;if(a.vb||a.ld)a.Ca=x,fl(a),a.N(),a.Ee=!0,E.zb&&(Ql(E)||E.ce.add(E.H,"scale",y,a.Ca));else if(a.ta===null)a.Ca=x,fl(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(eh)?ot=0:at.Hf(ia)&&(ot=z-1):ot=at.sb()?at.x*(z-1):z/2),isNaN(rt)&&(at.$c()?at.Hf(gu)?rt=0:at.Hf(Xa)&&(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=It.allocAt(a.pa.x+ot/y-ot/x,a.pa.y+rt/y-rt/x),a.position=z,It.free(z),a.Ca=x,fl(a),a.vb=!1,a.onViewportBoundsChanged(b,a.viewportBounds,y,!1),xa(a,!1),E.zb&&(Ql(E)||E.ce.add(E.H,"scale",y,a.Ca))}}oe.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!==Hr||a.width===y.width&&a.height===y.height||b.C(),b=this.currentTool,this.Vk===!0&&b instanceof lo&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),Op(b,this)),this.vb||this.invalidateViewport(a,y),cl(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 cl(a,y){var x=a.fe;if(x!==null&&x.visible){for(var E=Ke.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=pe.alloc(),a=a.viewportBounds,y.h(a.x,a.y,a.width,a.height),!y.w()){pe.free(y);return}b=y.width,z=y.height,a=y.x,tt=y.y,pe.free(y)}x.width=b+2*E.width,x.height=z+2*E.height,y=It.alloc(),Qt.No(a,tt,0,0,E.width,E.height,y),y.offset(-E.width,-E.height),Ke.free(E),x.part.location=y,It.free(y)}}oe.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)}},oe.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))},oe.prototype.rA=function(a){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),ae(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];E instanceof kn||ce("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 kn||ce("Diagram.selectCollection given something that is not a Part: "+y),y.isSelected=!0;this.R("ChangedSelection",this.selection)},oe.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()}},xt=oe.prototype,xt.Iz=function(a){a!==null&&a.diagram===this&&(!a.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),a.isHighlighted=!0)},xt.Jz=function(a){a=new Fe().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 kn||ce("Diagram.highlightCollection given something that is not a Part: "+y),y.isHighlighted=!0},xt.scroll=function(a,y,x){x===void 0&&(x=1);var E=y==="up"||y==="down",b=0,z=It.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)),It.free(z);return}ce("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):ce("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+y),It.free(z)},xt.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)},xt.es=function(a){var y=this.viewportBounds;a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a},xt.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)},xt.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 pe(z,yt,mt-z,y-yt)},xt.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),Po(a.copy(),this.Ab)};function $p(a){var y=a.isModified;a.Tw!==y&&(a.Tw=y,a.R("Modified"))}function wg(a){return a=of.get(a),a!==null?new a:new Ii}oe.prototype.doModelChanged=function(a){var y=this;if(a.model===this.model){var x=a.change,E=a.propertyName;if(x===Bs&&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===Bs){(E==="FinishedUndo"||E==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),Fr(this));var z=this.animationManager;E==="RolledBackTransaction"&&z.Cc(),this.bx(),this.Jk=!0,this.bd(),this.undoManager.transactionLevel!==0&&this.undoManager.transactionLevel!==1||Hc(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(),_p(this.animationManager)),!this.Rt&&tt&&this.lastInput.targetDiagram){this.Rt=!0;var ot=this;ri(function(){ot.currentTool.standardMouseOver(),ot.Rt=!1},10)}}}finally{this.aa=!0}}}};function rd(a,y){y=y.O.s;for(var x=y.length,E=0;E<x;E++)yh(a,y[E])}function yh(a,y){if(y instanceof vs){var x=y.element;if(x!==null&&x instanceof HTMLImageElement){x.Bg instanceof Fe&&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 Cg(a,y){if(y instanceof vs){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 Fe&&x.Bg.remove(a),vf(E));break}}}}}oe.prototype.Wd=function(){this.partManager.Wd()},oe.prototype.Aj=function(a,y){this.Yd.Aj(a,y)},oe.prototype.Cj=function(a,y){this.Yd.Cj(a,y)},oe.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)},oe.prototype.Vb=function(a){return this.partManager.Vb(a)},oe.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)},xt=oe.prototype,xt.Lc=function(a){return this.partManager.Lc(a)},xt.ii=function(a){return this.partManager.ii(a)},xt.Kc=function(a){return this.partManager.Kc(a)},xt.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:rn(mn(y)))},xt.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:rn(mn(y)))};function fl(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 Lg(a,y){a.Zi=!1;var x=a.Sp;x.D(y)||(x=x.copy(),a.Sp.assign(y),xa(a,!1),a.R("DocumentBoundsChanged",void 0,x),a.Ee=!0,a.N())}xt.Va=function(){if(this.Zi){var a=pe.alloc();Lg(this,this.computeBounds(a)),pe.free(a)}},xt.rz=function(){for(var a=new Fe,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},xt.qz=function(){return this.ai.iterator},xt.Uz=function(a){Fr(this),a&&qc(this,!0),this.ld?kg(this,!1):(this.Jk=!0,aa(this))};function qc(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 kg(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||kl(z,"Layout")),a.xh=!1;for(var tt=a.ai.iterator;tt.next();)Mg(a,tt.value,y,E);b.isValidLayout||(!y||b.isRealtime||b.isRealtime===null||E===0?(b.doLayout(a),Fr(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||Hc(z),a.aa=x}}}function Mg(a,y,x,E){if(y!==null){for(var b=y.gl.iterator;b.next();)Mg(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),Jd(a,y),b.isValidLayout=!0):a.xh=!0)}}xt.yz=function(){for(var a=new Pe,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 Pe;x.add(b,tt),x.add(z,tt),E.add(b,b),E.add(z,b)}var x=new ln,E=new ln;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 $c(a,y){var x=a.iw.I(y);if(x!==null||(x=a.iw.I(y.toLowerCase()),x!==null))return x;ce("Unknown DiagramEvent name: "+y)}xt.Bj=function(a,y){return a=$c(this,a),a!==null&&a.add(y),this},xt.am=function(a,y){a=$c(this,a),a!==null&&a.remove(y)},xt.R=function(a,y,x){var E=$c(this,a),b=new mu;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 tf(a){if(a.animationManager.isTicking)return!1;var y=a.currentTool;return y===a.toolManager.findTool("Dragging")?!a.Mr||y.isComplexRoutingRealtime:!0}xt.Yj=function(a,y){return ef(this,!1,null,y||null).Yj(a.x,a.y,a.width,a.height)},oe.prototype.computeOccupiedArea=function(a){return this.isVirtualized?this.viewportBounds.copy():this.Zi?dg(this,a):a.assign(this.documentBounds)};function ef(a,y,x,E){var b=a.Xh;if(b===null&&(a.Xh=b=new ep(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=pe.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&&nf(a,tt,E,y)}pe.free(y)}else{for(0<x.memberParts.count&&(y=a.computePartsBounds(x.memberParts,!1),y.Bc(20,20),b.initialize(y)),y=pe.alloc(),z=x.memberParts;z.next();)tt=z.value,tt instanceof Je&&nf(a,tt,E,y);pe.free(y)}b.group=x,b.Yx=E,b.vs=!1}else y&&oS(b);return b}function nm(a,y){return y.avoidable&&!y.isLinkLabel?y:y.containingGroup!==null?nm(a,y.containingGroup):null}function nf(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(Cf(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(Hu,x,y+1);else for(var tt=x;tt<=y;tt++)z[tt]=Hu}else if(y instanceof Vn)for(y=y.memberParts;y.next();)b=y.value,b instanceof Je&&nf(a,b,x,E)}}function Tu(a,y){a.Xh===null||a.Xh.vs||y!==void 0&&(!y.avoidable||y.isLinkLabel)||(a.Xh.vs=!0)}oe.prototype.gs=function(a){this.wp.assign(a),this.computeAutoScrollPosition(this.wp).Xa(this.position)?this.ug():Eg(this)};function Eg(a){a.vk===-1&&(a.vk=ri(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=pe.alloc(),a.computeBounds(y),y.ed(a.documentBounds),Lg(a,y),pe.free(y),a.Fc=!0,a.bd(),Eg(a))}},a.vp))}oe.prototype.ug=function(){this.vk!==-1&&(ge.clearTimeout(this.vk),this.vk=-1)},oe.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=pe.allocAt(0,0,E.width*b,E.height*b);var z=It.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(mo)||(y=new It(y.x+z.x/b,y.y+z.y/b)),pe.free(E),It.free(z),y},xt=oe.prototype,xt.Cs=function(){return null},xt.av=function(){return null},xt.bs=function(a,y){this.pj.add(a,y)},xt.Fu=function(a){(this.Pw=a)||this.nodes.each(function(y){y instanceof Vn&&(y.$p=null)})};function Qd(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):ge.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 ge.requestAnimationFrame(function(){E()}),null}xt.Wz=function(a){return xo?(a===void 0&&(a={}),a.returnType="Image",this.Jx(a)):null},xt.Jx=function(a){return a===void 0&&(a={}),Qd(this,this.Xz,a)},xt.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 ld+"data":b=E.getImageData(0,0,x.width,x.height);break;case ld:E=(a.document||document).createElement("img"),E.src=x.toDataURL(a.type,a.details),b=E;break;case"blob":return typeof y!="function"&&ce('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"&&ce("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 Ke(1/0,1/0):new Ke(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,Pt=y.showTemporary;Pt===void 0&&(Pt=!ft),y=y.showGrid,y===void 0&&(y=Pt),b!==null&&isNaN(b.width)&&isNaN(b.height)&&(b=null),typeof at=="number"?at=new qn(at):at instanceof qn||ce("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 wa(null,mt,void 0,!0);var kt=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,Xc(a,E.context,at,new Ke(ft.width,ft.height),a.Ca,a.pa,rt,ut,Pt,y),E.context):(a.Xm=!1,Xc(a,kt,at,new Ke(ft.width,ft.height),a.Ca,a.pa,rt,ut,Pt,y),a.Xm=!0,ft.context);var Dt=a.Pp,Tt=a.documentBounds.copy();if(Tt.Fv(a.yb),Pt)for(var Rt=a.Wa.s,Gt=Rt.length,Vt=0;Vt<Gt;Vt++){var Xt=Rt[Vt];if(Xt.visible&&Xt.isTemporary){Xt=Xt.Pa.s;for(var ie=Xt.length,Xe=0;Xe<ie;Xe++){var an=Xt[Xe];an.isInDocumentBounds&&an.isVisible()&&(an=an.actualBounds,an.w()&&Tt.ed(an))}}}if(Rt=new It(Tt.x,Tt.y),rt!==null){for(Gt=new pe(0,0,0,0),Vt=!0,Xt=rt.iterator,Xt.reset();Xt.next();)ie=Xt.value,ie instanceof kn&&(Xe=ie.layer,Xe!==null&&!Xe.visible||Xe!==null&&!Pt&&Xe.isTemporary||!ie.isVisible()||(ie=ie.actualBounds,ie.w()&&(Vt?(Vt=!1,Gt.assign(ie)):Gt.ed(ie))));Tt.width=Gt.width,Tt.height=Gt.height,Rt.x=Gt.x,Rt.y=Gt.y}return ot!==null&&ot.w()&&(Rt=ot,z||(z=Dt)),Gt=ot=0,at!==null&&(ot=at.left+at.right,Gt=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-Gt))),b!==null&&z!==null?(z==="NaN"&&(z=Dt),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-Gt)/Tt.height),z>Dt?(z=Dt,b=Tt.width,Tt=Tt.height):(b=tt.width,Tt=tt.height)):(b=Tt.width*z,Tt=Tt.height*z):(z=Dt,b=Tt.width,Tt=Tt.height),at!==null?(b+=ot,Tt+=Gt):at=new qn(0),tt!==null&&(Dt=tt.width,tt=tt.height,isNaN(Dt)&&(Dt=2e3),isNaN(tt)&&(tt=2e3),isFinite(Dt)&&(b=Math.min(b,Dt)),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,Xc(a,E.context,at,new Ke(Math.ceil(b),Math.ceil(Tt)),z,Rt,rt,ut,Pt,y),E.context):(a.Xm=!1,Xc(a,kt,at,new Ke(Math.ceil(b),Math.ceil(Tt)),z,Rt,rt,ut,Pt,y),a.Xm=!0,ft.context)}ke.Object.defineProperties(oe.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 gl(this,ge.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 gl(this,ge.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(ge,"resize",this.Ov,!1),this.removeEventListener(ge,"wheel",this.$j,!0),Ml===this&&(Ml=null)):this.ui===null&&(this.hf=!1),this.Ka=null,a!==null&&((y=a.H)&&(y.div=null),ug(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)&&ti(a,"0 <= value <= 1",oe,"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),xa(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),xa(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),xa(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),xa(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(a){var y=this.iu;y!==a&&(0>a&&ti(a,">= 0",oe,"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&&ti(a,">= 0",oe,"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 ti(a,">= 0",oe,"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&&ce("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var x=lg(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var E=this.vb;this.vb=!0,kl(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=wg(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(ge,"pointermove",this.dk,!0),this.addEventListener(ge,"pointerdown",this.ui,!0),this.addEventListener(ge,"pointerup",this.fk,!0),this.addEventListener(ge,"pointerout",this.ek,!0),this.addEventListener(ge,"pointercancel",this.ck,!0),this.removeEventListener(y,"wheel",this.$j,!1),this.addEventListener(ge,"wheel",this.$j,!0),this.addEventListener(ge,"selectstart",this.preventDefault,!1)):(this.removeEventListener(ge,"pointermove",this.dk,!0),this.removeEventListener(ge,"pointerdown",this.ui,!0),this.removeEventListener(ge,"pointerup",this.fk,!0),this.removeEventListener(ge,"pointerout",this.ek,!0),this.removeEventListener(ge,"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(ge,"wheel",this.$j,!0),this.removeEventListener(ge,"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=It.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()?fl(this):(this.vb=!0,a=this.scale,cg(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)}It.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=Zp(this)),this.fe},set:function(a){var y=this.fe;if(y!==a){y===null&&(y=this.fe=Zp(this)),a.type!==De.Grid&&ce("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),cl(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),fl(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||ce("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 qn(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===Au&&xa(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,xa(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,Pg(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&&Pg(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!==Hr&&xa(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()||ce("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()||ce("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)):ti(a,"> 0",oe,"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)):ti(a,"> 0",oe,"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),xa(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 qn(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&&ce("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();)Ug(a.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(a){var y=this.uu;y!==a&&(a!==Bu&&a!==_o&&a!==rf&&ce("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 Ke(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 qn(a));var y=this.xp;y.D(a)||(this.xp=a=a.J(),this.Ya(),this.g("autoScrollRegion",y,a))}}}),ke.Object.defineProperties(oe,{licenseKey:{get:function(){return Bg.jc()},set:function(a){Bg.add(a.replace(/\s/g,""))}},version:{get:function(){return ad}}}),oe.prototype.makeImageData=oe.prototype.Jx,oe.prototype.makeImage=oe.prototype.Wz,oe.prototype.cacheGroupExternalLinks=oe.prototype.Fu,oe.prototype.addRenderer=oe.prototype.bs,oe.prototype.makeSVG=oe.prototype.av,oe.prototype.makeSvg=oe.prototype.Cs,oe.prototype.stopAutoScroll=oe.prototype.ug,oe.prototype.doAutoScroll=oe.prototype.gs,oe.prototype.isUnoccupied=oe.prototype.Yj,oe.prototype.raiseDiagramEvent=oe.prototype.R,oe.prototype.removeDiagramListener=oe.prototype.am,oe.prototype.addDiagramListener=oe.prototype.Bj,oe.prototype.findTreeRoots=oe.prototype.yz,oe.prototype.layoutDiagram=oe.prototype.Uz,oe.prototype.findTopLevelGroups=oe.prototype.qz,oe.prototype.findTopLevelNodesAndLinks=oe.prototype.rz,oe.prototype.ensureBounds=oe.prototype.Va,oe.prototype.findLinksByExample=oe.prototype.ls,oe.prototype.findNodesByExample=oe.prototype.ms,oe.prototype.findLinkForData=oe.prototype.Kc,oe.prototype.findNodeForData=oe.prototype.ii,oe.prototype.findPartForData=oe.prototype.Lc,oe.prototype.findLinkForKey=oe.prototype.findLinkForKey,oe.prototype.findNodeForKey=oe.prototype.Vb,oe.prototype.findPartForKey=oe.prototype.findPartForKey,oe.prototype.rebuildParts=oe.prototype.Wd,oe.prototype.transformViewToDoc=oe.prototype.Ps,oe.prototype.transformRectDocToView=oe.prototype.zA,oe.prototype.transformDocToView=oe.prototype.op,oe.prototype.centerRect=oe.prototype.es,oe.prototype.scrollToRect=oe.prototype.tv,oe.prototype.scroll=oe.prototype.scroll,oe.prototype.highlightCollection=oe.prototype.Jz,oe.prototype.highlight=oe.prototype.Iz,oe.prototype.selectCollection=oe.prototype.rA,oe.prototype.select=oe.prototype.select,oe.prototype.updateAllRelationshipsFromData=oe.prototype.rp,oe.prototype.updateAllTargetBindings=oe.prototype.updateAllTargetBindings,oe.prototype.commit=oe.prototype.commit,oe.prototype.rollbackTransaction=oe.prototype.Kf,oe.prototype.commitTransaction=oe.prototype.eb,oe.prototype.startTransaction=oe.prototype.Ea,oe.prototype.raiseChanged=oe.prototype.g,oe.prototype.raiseChangedEvent=oe.prototype.cb,oe.prototype.removeChangedListener=oe.prototype.ik,oe.prototype.addChangedListener=oe.prototype.Pe,oe.prototype.removeModelChangedListener=oe.prototype.mA,oe.prototype.addModelChangedListener=oe.prototype.Yw,oe.prototype.findLayer=oe.prototype.Qj,oe.prototype.removeLayer=oe.prototype.kA,oe.prototype.addLayerAfter=oe.prototype.Cy,oe.prototype.addLayerBefore=oe.prototype.Ww,oe.prototype.addLayer=oe.prototype.Al,oe.prototype.moveParts=oe.prototype.moveParts,oe.prototype.copyParts=oe.prototype.Kj,oe.prototype.removeParts=oe.prototype.Is,oe.prototype.remove=oe.prototype.remove,oe.prototype.add=oe.prototype.add,oe.prototype.clearDelayedGeometries=oe.prototype.bx,oe.prototype.setProperties=oe.prototype.nm,oe.prototype.attach=oe.prototype.Du,oe.prototype.set=oe.prototype.set,oe.prototype.resetInputOptions=oe.prototype.Sx,oe.prototype.setInputOption=oe.prototype.sA,oe.prototype.getInputOption=oe.prototype.Ql,oe.prototype.resetRenderingHints=oe.prototype.Tx,oe.prototype.setRenderingHint=oe.prototype.Xx,oe.prototype.getRenderingHint=oe.prototype.Gf,oe.prototype.maybeUpdate=oe.prototype.bd,oe.prototype.requestUpdate=oe.prototype.$b,oe.prototype.delayInitialization=oe.prototype.Xy,oe.prototype.isUpdateRequested=oe.prototype.Pz,oe.prototype.invalidateDocumentBounds=oe.prototype.Ya,oe.prototype.findObjectsNear=oe.prototype.og,oe.prototype.findPartsNear=oe.prototype.mz,oe.prototype.findObjectsIn=oe.prototype.Cf,oe.prototype.findPartsIn=oe.prototype.ux,oe.prototype.findObjectsAt=oe.prototype.ji,oe.prototype.findPartsAt=oe.prototype.lz,oe.prototype.findObjectAt=oe.prototype.ic,oe.prototype.findPartAt=oe.prototype.Ol,oe.prototype.focusObject=oe.prototype.zz,oe.prototype.alignDocument=oe.prototype.Jy,oe.prototype.zoomToRect=oe.prototype.BA,oe.prototype.zoomToFit=oe.prototype.zoomToFit,oe.prototype.diagramScroll=oe.prototype.kx,oe.prototype.focus=oe.prototype.focus;var of=new ln,om=null,xo=ge.document!==void 0,sd=null,Sh="",Hr=new he(oe,"None",0),Ks=new he(oe,"Uniform",1),xh=new he(oe,"UniformToFill",2),qd=new he(oe,"CycleAll",10),Fg=new he(oe,"CycleNotDirected",11),Ng=new he(oe,"CycleNotDirectedFast",12),bg=new he(oe,"CycleNotUndirected",13),Tg=new he(oe,"CycleDestinationTree",14),Ag=new he(oe,"CycleSourceTree",15),Au=new he(oe,"DocumentScroll",1),$d=new he(oe,"InfiniteScroll",2),Bu=new he(oe,"TreeParentCollapsed",21),_o=new he(oe,"AllParentsCollapsed",22),rf=new he(oe,"AnyParentsCollapsed",23),Bg=new Pe,ad="2.3.10",ld="image",tc=null,rm=!1;function Ar(){if(xo){var a=ge.document.createElement("canvas"),y=a.getContext("2d"),x=Hn("7ca11abfd022028846");y[x]=Hn("398c3597c01238");for(var E=["5da73c80a36455d7038e4972187c3cae51fd22",Ge.Dx+"4ae6247590da4bb21c324ba3a84e385776",oi.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",Qt.za],b=1;5>b;b++)y[Hn("7ca11abfd7330390")](Hn(E[b-1]),10,15*b);for(y[x]=Hn("39f046ebb36e4b"),x=1;5>x;x++)y[Hn("7ca11abfd7330390")](Hn(E[x-1]),10,15*x);(E.length!==4||E[0][0]!=="5"||E[3][0]!=="7")&&(oi.prototype.Cd=oi.prototype.Eu),tc=a}}oe.className="Diagram",oe.fromDiv=function(a){var y=a;return typeof a=="string"&&(y=ge.document.getElementById(a)),y instanceof HTMLDivElement&&y.H instanceof oe?y.H:null},oe.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},oe.useDOM=function(a){xo=a?ge.document!==void 0:!1},oe.isUsingDOM=function(){return xo},oe.None=Hr,oe.Uniform=Ks,oe.UniformToFill=xh,oe.CycleAll=qd,oe.CycleNotDirected=Fg,oe.CycleNotDirectedFast=Ng,oe.CycleNotUndirected=bg,oe.CycleDestinationTree=Tg,oe.CycleSourceTree=Ag,oe.DocumentScroll=Au,oe.InfiniteScroll=$d,oe.TreeParentCollapsed=Bu,oe.AllParentsCollapsed=_o,oe.AnyParentsCollapsed=rf;function sm(){this.wy=null,this.j="zz@orderNum",this._tk==="63ad05bbe23a1786468a4c741b6d2"?this.Rc=this.j=!0:this.Rc=null}function ud(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=ge[Hn("76a715b2f73f148a")][Hn("72ba13b5")]||"";if(a.Rc=!0,xo){var E=oe[Hn("76a115b6ed251eaf4692")];if(E)for(var b=Bg.iterator;b.next()&&(E=b.value,E=Hn(E).split(Hn("39e9")),!(6>E.length));){var z=Hn(E[1]).split(".");if(E[4]!=="7da71ca0")break;var tt=Hn(Ge[Hn("6cae19")]).split(".");if(z[0]>tt[0]||z[0]===tt[0]&&z[1]>=tt[1]){var ot=ge[Hn("74a900bae4370f8b51")][Hn("6fbb13a1c2311e8a57")].toLowerCase();if(tt=ot[Hn("73a612b6fb191d")](Hn("3aad1ab6e022098b4dc4")),z=Hn(E[2]),-1<tt&&(ot=ot[Hn("73a612b6fb191d")](z.toLowerCase()+"/"),a.Rc=!(-1<ot&&ot<tt),!a.Rc))break;for(tt=x[Hn("76ad18b4f73e")],ot=x[Hn("73a612b6fb191d")](Hn("35e7"))+2;ot<tt;ot++)y+=x[ot];if(tt=y[Hn("73a612b6fb191d")](z),0>tt&&z!==Hn("7da71ca0ad381e90")&&(tt=y[Hn("73a612b6fb191d")](Hn("76a715b2ef3e149757"))),0>tt&&(tt=y[Hn("73a612b6fb191d")](Hn("76a715b2ef3e149757"))),0>tt&&(tt=y[Hn("73a612b6fb191d")](Hn("2bfa41fdb3784bca12"))),0>tt&&(tt=x[Hn("73a612b6fb191d")](Hn("7baa19a6f76c1988428554"))),a.Rc=!(0<=tt&&tt<y[Hn("73a612b6fb191d")](Hn("35"))||y[Hn("73a612b6fb191d")](Hn("35"))===-1),!a.Rc||x[Hn("73a612b6fb191d")](Hn("7fb002b6ed25128b4da25b2e"))&&(a.Rc=!(-1<x[Hn("73a612b6fb191d")](z)),!a.Rc)||(tt=ge[Hn("76a715b2f73f148a")][Hn("69ad17a1e03e")],ot=tt[Hn("73a612b6fb191d")](Hn("7fb002b6ed25128b4da25b2e")),-1<ot&&(a.Rc=!(tt[Hn("73a612b6fb191d")](z)>ot),!a.Rc)))break;if(z[0]==="#"){tt=ge.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[Hn("79a417a0f0181a8946")]=E,ge.document[Hn("78a712aa")]){ge.document[Hn("78a712aa")][Hn("7bb806b6ed32388c4a875b")](tt),rt=ge.getComputedStyle(tt).getPropertyValue(Hn("78a704b7e62456904c9b12701b6532a8"));var at=ge.getComputedStyle(tt).getPropertyValue(Hn("75b817b0ea2202"));if(ge.document[Hn("78a712aa")][Hn("68ad1bbcf533388c4a875b")](tt),rt){if(tt=ge[Hn("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(Hn("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[Hn("76ad18b4f73e")],b=x[Hn("73a612b6fb191d")](Hn("35e7"))+2;b<ut;b++)y+=x[b];x=y[Hn("73a612b6fb191d")](Hn("7da71ca0ad381e90")),a.Rc=!(0<=x&&x<y[Hn("73a612b6fb191d")](Hn("35")))}}}return 0<a.Rc&&a!==a.wy}sm.className="DiagramHelper";function tu(a){this.j=a===void 0?new It:a,this.o=new It}ke.Object.defineProperties(tu.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 ec="DraggingInfo";tu.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 Ke(NaN,NaN).freeze(),this.gridSnapCellSpot=Cr,this.gridSnapOrigin=new It(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"||ge.Element&&a instanceof Element)var x=oe.call(this,a)||this;else x=oe.call(this)||this,y=a;return ht(x),y&&x.nm(y),x}ne(dt,oe);function ht(a){a.allowDragOut=!0,a.allowMove=!1,a.isReadOnly=!0,a.contentAlignment=ll,a.layout=new yr}dt.prototype.reset=function(){oe.prototype.reset.call(this),ht(this)},dt.className="Palette";function gt(a,y){if(typeof a=="string"||ge.Element&&a instanceof Element)var x=oe.call(this,a)||this;else x=oe.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 kn;var b=new Kn;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 qn(0,0,0,0),x.pa.h(0,0),x.toolManager.gb("Dragging",new Ot,x.toolManager.mouseMoveTools),x.click=function(){var z=E.observed;if(z!==null){var tt=z.viewportBounds,ot=E.lastInput.documentPoint;z.position=new It(ot.x-tt.width/2,ot.y-tt.height/2)}},x.Pf=function(){E.Ya(),bt(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&&bt(E)},x.autoScale=Ks,x.vb=!1,y&&Object.assign(x,y),x}ne(gt,oe),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(id(this),this.ql===null){var x=new wa(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),wt(this)}finally{this.ta=a,this.ib=y}}}oe.prototype.redraw.call(this)},gt.prototype.gc=function(){if(this.Ka===null&&ce("No div specified"),this.ta===null&&ce("No canvas specified"),!(this.ta instanceof gl)&&(Ov(this.box),this.Fc)){var a=this.observed;if(a!==null&&!a.animationManager.defaultAnimation.isAnimating&&a.pi){id(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?wt(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 wt(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=pe.alloc().assign(a.viewportBounds).ed(y.viewportBounds),cl(y,b),pe.free(b),Fr(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=$l(ot,b),at.gc(b,rt),b.globalAlpha=ot);else{for(var ut=$l(ot,b),ft=rt.scale,mt=pe.alloc(),yt=ot.Pa.s,Pt=yt.length,kt=0;kt<Pt;kt++){var Dt=yt[kt];(E||Dt!==at)&&ot.Oj(b,Dt,rt,null,ft,mt,!1)}pe.free(mt),b.globalAlpha=ut}}}}}function bt(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=Ke.alloc();b.h(x.width,x.height),E.desiredSize=b,Ke.free(b),a=2/a.scale,E instanceof Kn&&(E.strokeWidth=a),y.location=new It(x.x-a/2,x.y-a/2),y.isSelected=!0}}}gt.prototype.computeBounds=function(){var a=this.observed;if(a===null)return Wi;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(),bt(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))},ke.Object.defineProperties(gt.prototype,{observed:{get:function(){return this.V},set:function(a){var y=this.V;if(a instanceof gt&&ce("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),bt(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),bt(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 Ot(){fo.call(this),this.j=null}ne(Ot,fo),Ot.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 It(x.width/2,x.height/2),a=a.firstInput.documentPoint,y.position=new It(a.x-this.j.x,a.y-this.j.y)),!0)},Ot.prototype.doActivate=function(){this.j=null,fo.prototype.doActivate.call(this)},Ot.prototype.doUpdateCursor=function(){var a=this.diagram,y=a.box;y!==null&&y.cursor&&(a.currentCursor=y.cursor)},Ot.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 It(E.x-x.x,E.y-x.y)}a=a.lastInput.documentPoint,y.position=new It(a.x-this.j.x,a.y-this.j.y)}}},Ot.className="OverviewDraggingTool";function Bt(){Dn(this),this.H=Ml,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=Wi,this.hb=!0,this.cg=null,this.ob=200}Bt.prototype.toString=function(){return"CommandHandler"},Bt.prototype.Xe=function(a){this.H=a},Bt.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput,x=Bi?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()},Bt.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},Bt.prototype.stopCommand=function(){var a=this.diagram,y=a.currentTool;y instanceof lo&&a.allowSelect&&a.clearSelection(),y!==null&&y.doCancel()},Bt.prototype.canStopCommand=function(){return!0},Bt.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=""}},Bt.prototype.canSelectAll=function(){return this.diagram.allowSelect},Bt.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 Fe,x=a.selection.iterator;x.next();)Lh(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=""}},Bt.prototype.canDeleteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowDelete||a.selection.count===0)},Bt.prototype.copySelection=function(){var a=this.diagram,y=new Fe;for(a=a.selection.iterator;a.next();)Lh(y,a.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,function(x){return x.canCopy()});this.copyToClipboard(y)},Bt.prototype.canCopySelection=function(){var a=this.diagram;return!!(a.allowCopy&&a.allowClipboard&&a.selection.count!==0)},Bt.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},Bt.prototype.canCutSelection=function(){var a=this.diagram;return!!(!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&a.selection.count!==0)},Bt.prototype.copyToClipboard=function(a){var y=this.diagram,x=null;if(a===null)sd=null,Sh="";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 Pe,x.addAll(z),sd=x,Sh=y.model.dataFormat}}y.R("ClipboardChanged",x)},Bt.prototype.pasteFromClipboard=function(){var a=new Fe,y=sd;if(y===null)return a;var x=this.diagram;if(Sh!==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},Bt.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);mh(y,z,new It(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=""}},Bt.prototype.canPasteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||sd===null||sd.count===0||Sh!==a.model.dataFormat)},Bt.prototype.undo=function(){this.diagram.undoManager.undo()},Bt.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()},Bt.prototype.redo=function(){this.diagram.undoManager.redo()},Bt.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()},Bt.prototype.decreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;y.autoScale===Hr&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Bt.prototype.canDecreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;return y.autoScale!==Hr?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Bt.prototype.increaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;y.autoScale===Hr&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Bt.prototype.canIncreaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;return y.autoScale!==Hr?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Bt.prototype.resetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;a<y.minScale||a>y.maxScale||(y.scale=a)},Bt.prototype.canResetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;return a<y.minScale||a>y.maxScale?!1:y.allowZoom},Bt.prototype.zoomToFit=function(){var a=this.diagram,y=a.animationManager;y.Cc(),a.redraw();var x=a.position,E=a.scale;kl(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=Wi):(this.Jt=E,this.sw=x.copy(),a.zoomToFit(),this.Au=a.scale,this.yu=a.documentBounds.copy()),Hc(y)},Bt.prototype.canZoomToFit=function(){return this.diagram.allowZoom},Bt.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;kl(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 Je&&rt.isTreeExpanded&&(!(rt instanceof Vn)||rt.isSubGraphExpanded);)rt=b.pop();0<b.length?(rt instanceof kn&&y.tv(rt.actualBounds),rt instanceof Je&&!rt.isTreeExpanded&&(rt.isTreeExpanded=!0),rt instanceof Vn&&!rt.isSubGraphExpanded&&(rt.isSubGraphExpanded=!0)):(rt instanceof kn&&y.es(rt.actualBounds),y.am("LayoutCompleted",tt)),y.eb("Scroll To Part")},tt=function(){ri(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 wi)Ut(a,y.adornedPart,x);else if(y instanceof _e){var E=y.fromNode;E!==null&&Ut(a,E,x),y=y.toNode,y!==null&&Ut(a,y,x)}else y instanceof Je&&(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}Bt.prototype.canScrollToPart=function(a){return a===void 0&&(a=null),a!==null&&!(a instanceof kn)?!1:(a=this.diagram,a.selection.count===0&&a.highlighteds.count===0?!1:a.allowHorizontalScroll&&a.allowVerticalScroll)},Bt.prototype.collapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse Tree"),kl(y.animationManager,"Collapse Tree");var x=new Pe;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 Je&&b.isTreeExpanded&&(b.collapseTree(),x.add(b))}y.R("TreeCollapsed",x)}finally{y.eb("Collapse Tree")}},Bt.prototype.canCollapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof Je&&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 Je&&y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Bt.prototype.expandTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand Tree"),kl(y.animationManager,"Expand Tree");var x=new Pe;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 Je&&!b.isTreeExpanded&&(b.expandTree(),x.add(b))}y.R("TreeExpanded",x)}finally{y.eb("Expand Tree")}},Bt.prototype.canExpandTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof Je)||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 Je&&!y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Bt.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 Pe,z=a.selection.iterator;z.next();){var tt=z.value;tt.Zc()&&tt.canGroup()&&b.add(tt)}for(var ot=new Pe,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 Vn)Ca(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 Pt=ot.iterator;Pt.next();){var kt=Pt.value;this.isValidMember(E,kt)&&(kt.containingGroup=E)}a.clearSelection(!0),E.isSelected=!0}}a.R("SelectionGrouped",E)}finally{a.eb("Group"),a.R("ChangedSelection",a.selection),a.currentCursor=""}}}},Bt.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 fe(a){var y=gn();for(a=a.iterator;a.next();){var x=a.value;x instanceof _e||y.push(x)}a=new Fe,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 Ye(y),a}Bt.prototype.isValidMember=function(a,y){if(y===null||a===y||y instanceof _e)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},Bt.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 Pe;if(a!==null)E.add(a);else for(var b=y.selection.iterator;b.next();){var z=b.value;z instanceof Vn&&z.canUngroup()&&E.add(z)}var tt=new Pe;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 _e)){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=""}},Bt.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 Vn))return!1;if(a.canUngroup())return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof Vn&&y.canUngroup())return!0;return!1},Bt.prototype.addTopLevelParts=function(a,y){var x=!0;for(a=fe(a).iterator;a.next();){var E=a.value;E.containingGroup!==null&&(!y||this.isValidMember(null,E)?E.containingGroup=null:x=!1)}return x},Bt.prototype.collapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse SubGraph"),kl(y.animationManager,"Collapse SubGraph");var x=new Pe;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 Vn&&b.isSubGraphExpanded&&(b.collapseSubGraph(),x.add(b))}y.R("SubGraphCollapsed",x)}finally{y.eb("Collapse SubGraph")}},Bt.prototype.canCollapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return!!(a instanceof Vn&&a.isSubGraphExpanded);for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof Vn&&y.isSubGraphExpanded)return!0;return!1},Bt.prototype.expandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand SubGraph"),kl(y.animationManager,"Expand SubGraph");var x=new Pe;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 Vn&&!b.isSubGraphExpanded&&(b.expandSubGraph(),x.add(b))}y.R("SubGraphExpanded",x)}finally{y.eb("Expand SubGraph")}},Bt.prototype.canExpandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return a instanceof Vn&&!a.isSubGraphExpanded;for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof Vn&&!y.isSubGraphExpanded)return!0;return!1},Bt.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 Zi&&z.editable})}a!==null&&(y.currentTool=null,x.textBlock=a,y.currentTool=x)}},Bt.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 Zi))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 Zi&&x.editable}),a!==null))return!0;return!1},Bt.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(Di):y.viewportBounds.ca(E.documentPoint)||(b=y.viewportBounds,b=new It(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,Jl(x,!1,a)}},Bt.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)},Bt.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 ln,a===null)return E;for(var z=a.iterator;z.next();)Fl(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 _e&&(y=a.fromNode,y===null||E.contains(y)?(y=a.toNode,y===null||E.contains(y)||E.remove(a)):E.remove(a));return E},ke.Object.defineProperties(Bt.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||ce("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}}}),Bt.className="CommandHandler",Kp=function(){return new Bt};function Jt(){Dn(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new It(NaN,NaN).freeze(),this.jd=hs,this.Ab=new oi,this.wh=new oi,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=ds,this.uc=new pe(NaN,NaN,NaN,NaN).freeze(),this.Ib=new pe(NaN,NaN,NaN,NaN).freeze(),this.dc=new pe(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=Lr,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 Te,Ne,dn,pn,bn,Un,li,ni,vi,_i;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=Mn(this.Dh)),this.tb!==null&&(a.tb=this.tb.copy())},Jt.prototype.Vw=function(a){var y=this.Dh;if(ae(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()},xt=Jt.prototype,xt.qb=function(a){a.classType===_e?a.name.indexOf("Orient")===0?this.segmentOrientation=a:ce("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===Jt&&(this.stretch=a)},xt.toString=function(){return xe(this.constructor)+"#"+ci(this)},xt.th=function(){this.A!==null&&(this.A.nc=!0)};function $n(a){a.A===null?a.A=new ic:a.A.nc&&(a.A=a.A.copy())}xt.Xc=function(){if(this.ba===null){var a=new Dg;a.Xi=pr,a.yj=pr,a.Vi=10,a.wj=10,a.Wi=0,a.xj=0,this.ba=a}},xt.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===uo&&wr(this)&&no(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 ln),tt=z.undoManager.transactionLevel===0,a.startCondition===fh?tt=!0:a.startCondition===$h&&(tt=!1),tt?(z=new Er,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()):(kl(z.animationManager,"Trigger"),z.animationManager.defaultAnimation.add(this,y,E,b)))),this instanceof De&&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 De&&fd(ot,function(rt){rt.data!==null&&rt.l&16777216&&rt.La(y)})};function no(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=MS(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))}}xt.ks=function(a){return this.bindingId===a?this:null},xt.g=function(a,y,x){this.cb(uo,a,this,y,x)},xt.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 oi);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),z.pp(b)}};function $o(a,y,x,E){return a.pickable===!1?!1:(E.multiply(a.transform),x?a.Yc(y,E):a.fh(y,E))}xt.tx=function(a,y,x){if(this.pickable===!1)return!1;var E=this.naturalBounds;return y=a.Bf(y),x?Jo(a.x,a.y,0,0,0,E.height)<=y||Jo(a.x,a.y,0,E.height,E.width,E.height)<=y||Jo(a.x,a.y,E.width,E.height,E.width,0)<=y||Jo(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},xt.se=function(){return!0},xt.ca=function(a){var y=It.alloc();y.assign(a),this.transform.Ga(y);var x=this.actualBounds;if(!x.w())return It.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=lr(x.x-tt*rt,x.y-tt*rt,x.width+z*rt,x.height+z*rt,y.x,y.y),It.free(y),a}return b=!1,(this instanceof wi||this instanceof Kn?lr(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)),It.free(y),b},xt.gh=function(a){var y=this.naturalBounds;return lr(0,0,y.width,y.height,a.x,a.y)},xt.Re=function(a){if(this.angle===0)return this.actualBounds.Re(a);var y=this.naturalBounds;y=pe.allocAt(0,0,y.width,y.height);var x=this.transform,E=!1,b=It.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)))),It.free(b),pe.free(y),E},xt.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.naturalBounds,E=!1,b=It.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)))),It.free(b),E},xt.Yc=function(a,y){if(y===void 0&&(y=this.transform,this.angle===0))return a.Yc(this.actualBounds);var x=this.naturalBounds,E=It.allocAt(0,0),b=It.allocAt(0,x.height),z=It.allocAt(x.width,x.height),tt=It.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=pe.allocAt(0,0,x.width,x.height);var rt=It.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)))),It.free(rt),pe.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 It.free(E),It.free(b),It.free(z),It.free(tt),ot},xt.ga=function(a,y){if(y===void 0&&(y=new It),a instanceof En){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},xt.mi=function(a){a===void 0&&(a=new pe);var y=this.naturalBounds,x=this.oe,E=It.allocAt(0,0).transform(x);return a.h(E.x,E.y,0,0),E.h(y.width,0).transform(x),yo(a,E.x,E.y,0,0),E.h(y.width,y.height).transform(x),yo(a,E.x,E.y,0,0),E.h(0,y.height).transform(x),yo(a,E.x,E.y,0,0),It.free(E),a},xt.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},xt.Df=function(){if(!(this.l&4096))return this.Kk;var a=this.Ca;return this.panel!==null?a*this.panel.Df():a},xt.qs=function(a,y){return y===void 0&&(y=new It),y.assign(a),this.oe.Cd(y),y},xt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},xt.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(Zs(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 De;switch(ps(this,!0)){case Ne:tt=b=0,ot&&(y=a=1/0);break;case Te:isFinite(a)&&a>x&&(b=a),isFinite(y)&&y>E&&(tt=y);break;case pn:isFinite(a)&&a>x&&(b=a),tt=0,ot&&(y=1/0);break;case bn: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()||ce("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),Go(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=pe.alloc();z.assign(this.Ib),this.Ib.ka(),ts(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&&Iu(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 Zi&&(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()||ce("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(z,this.Ib),Nl(this,!1),pe.free(z)},xt=Jt.prototype,xt.eh=function(){};function Wr(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=ps(a,!0),x===E&&z===b&&(y=Ne),y){case Ne:(x>E||z>b)&&(Go(a,!0),a.measure(x>E?E:x,z>b?b:z,0,0));break;case Te:Go(a,!0),a.measure(E,b,0,0);break;case pn:Go(a,!0),a.measure(E,z,0,0);break;case bn:Go(a,!0),a.measure(x,b,0,0)}}}xt.Xl=function(a,y){var x=this.part;x!==null&&x.diagram!==null&&(x.selectionObject!==this&&x.resizeObject!==this&&x.rotateObject!==this||Rv(x,!0),this.N(),Io(a,y)||(x.oh(),this.Pn(x)))},xt.Pn=function(a){this.portId!==null&&(Rv(a,!0),a instanceof Je&&W1(a,this))},xt.gc=function(a,y){if(!la(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 De&&Iu(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&&(Co(this,a,at,!0,!0,rt,ot),at instanceof Oi&&at.type===da?(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&&(Co(this,a,ut,!0,!1,rt,ot),ut instanceof Oi&&ut.type===da?(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&&vr(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 Pt=mt.m11,kt=mt.m21,Dt=mt.dx,Tt=mt.m12,Rt=mt.m22,Gt=mt.dy,Vt,Xt=Vt=0;mt=Vt*Pt+Xt*kt+Dt;var ie=Vt*Tt+Xt*Rt+Gt;Vt=yt.width+ft,Xt=0;var Xe=Vt*Pt+Xt*kt+Dt;Vt=Vt*Tt+Xt*Rt+Gt,Xt=Math.min(mt,Xe);var an=Math.min(ie,Vt),on=Math.max(mt+0,Xe)-Xt,je=Math.max(ie+0,Vt)-an;mt=Xt,ie=an,Vt=yt.width+ft,Xt=yt.height+ft,Xe=Vt*Pt+Xt*kt+Dt,Vt=Vt*Tt+Xt*Rt+Gt,Xt=Math.min(mt,Xe),an=Math.min(ie,Vt),on=Math.max(mt+on,Xe)-Xt,je=Math.max(ie+je,Vt)-an,mt=Xt,ie=an,Vt=0,Xt=yt.height+ft,Xe=Vt*Pt+Xt*kt+Dt,Vt=Vt*Tt+Xt*Rt+Gt,Xt=Math.min(mt,Xe),an=Math.min(ie,Vt),on=Math.max(mt+on,Xe)-Xt,je=Math.max(ie+je,Vt)-an,mt=Xt,ie=an,ft=y.viewportBounds,yt=ft.x,Pt=ft.y,mt=!(mt>ft.width+yt||yt>on+mt||ie>ft.height+Pt||Pt>je+ie)}if(mt){if(mt=(this.l&256)!==0,a.clipInsteadOfFill&&(mt=!1),this instanceof Zi&&(a.font=this.font),mt){if(ie=ot.se()?ot.naturalBounds:ot.actualBounds,on=Math.max(tt.x,ie.x),je=Math.max(tt.y,ie.y),ft=Math.min(tt.right,ie.right)-on,yt=Math.min(tt.bottom,ie.bottom)-je,Pt=this.tb,Pt!==null&&(on=Pt.x,je=Pt.y,ft=Pt.width,yt=Pt.height),on>tt.width+tt.x||tt.x>ie.width+ie.x){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}a.save(),a.beginPath(),a.rect(on,je,ft,yt),a.clip()}if(ut){if(!at.isVisible()){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}rt&&(ie=at.shadowOffset,a.Ev(ie.x*y.scale*this.scale*y.Mb,ie.y*y.scale*this.scale*y.Mb,at.shadowBlur),eu(a),a.shadowColor=at.shadowColor)}rt&&this.shadowVisible===!0?eu(a):rt&&this.shadowVisible===!1&&bl(a),at=this.naturalBounds,this.areaBackground!==null&&(a.yc(),Xs(this,a,at,tt)),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),rt&&dr(this,ot)&&this.shadowVisible===null&&bl(a),this.Ma!==null&&(a.yc(),Cs(this,a,at,tt)),rt&&(this.Ma!==null||this.areaBackground!==null||dr(this,ot))?(Oa(this,!0),this.shadowVisible===null&&bl(a)):Oa(this,!1),this.hh(a,y),rt&&this.l&512&&eu(a),ut&&rt&&bl(a),mt&&(a.restore(),a.Vc(this instanceof De)),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 dr(a,y){return y===null?!1:(Iu(y)&&(y=y.panel),(y.l&512)!==0||(y.type===De.Auto||y.type===De.Spot)&&y.Pb()!==a)}xt.Dv=function(){};function Xs(a,y,x,E){Co(a,y,a.areaBackground,!0,!0,x,E),a.areaBackground instanceof Oi&&a.areaBackground.type===da?(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 Cs(a,y,x,E){var b=a.kq(),z=x.x,tt=x.y,ot=x.width+b,rt=x.height+b;Co(a,y,a.Ma,!0,!1,x,E),a.Ma instanceof Oi&&a.Ma.type===da?(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 Br(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===De.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 la(a,y,x){if(!(y instanceof Os))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&&Br(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),eu(y),y.shadowColor=a.shadowColor}a instanceof Zi&&(y.font=a.font),y.yd=null;var tt=a.transform;z=a instanceof De;var ot=a instanceof De?Iu(a):!1;a.l&4096&&vr(a);var rt=a.Ib;if(y.rb.ha=[1,0,0,1,0,0],y.o=!1,b&&(y.o=!0,z&&ot?(Og(y,1,0,0,1,0,0),a.svg=y.ad):z?(Og(y,tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy),a.svg=y.ad):Og(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],Xs(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]),Cs(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],Cs(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&&eu(y),ot&&a.shadowVisible===!0?eu(y):ot&&a.shadowVisible===!1&&bl(y),b=a.panel,ot&&dr(a,b)&&a.shadowVisible===null&&bl(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||dr(a,b))?(Oa(a,!0),a.shadowVisible===null&&bl(y)):Oa(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),gs(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&&eu(y),a.Dd()&&bl(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&&Br(a,E,ot),tt!==null&&tt(a,ot)),!0)}xt.$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"+nr++,ot=a.Ud("clipPath",{id:z}),y=a.Ud("rect",{x:y,y:b,width:tt,height:x}),this instanceof De&&(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"),gs(a,E)};function gs(a,y){y=y.getAttribute("clip-path"),y!==null&&(a=a.svg.getElementById(y.split("#")[1].slice(0,-1)),a!==null&&a.remove())}function Dr(a){if(a.svg!==null){var y=a.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),x=a.svg.ownerDocument;if(y!==null){y=mn(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()}}xt.hh=function(){},xt.lv=function(){this.Uc=!0},xt.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 De?Iu(this):!1;if(!(this instanceof De&&b))if(this instanceof vs){var z=this.bt;a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy],z!==null&&Zy(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 De)y.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")");else if(this instanceof Kn){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],Xs(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 De))&&(a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy]),Cs(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},xt.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 Co(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===Ou)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 cd)&&x.xe&&(x.type===cf||x.yk===ot&&x.ft===rt))var ut=x.xe;else{var ft=0,mt=0,yt=0,Pt=0,kt=0,Dt=0;if(Dt=kt=0,b?(kt=tt.x,Dt=tt.y):E||(kt-=at/2,Dt-=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,Pt=x.end.y*rt+x.end.offsetY,ft+=kt,yt+=kt,mt+=Dt,Pt+=Dt,x.type===iu)ut=y.createLinearGradient(ft,mt,yt,Pt);else if(x.type===da)Dt=isNaN(x.endRadius)?Math.max(ot,rt)/2:x.endRadius,isNaN(x.startRadius)?(kt=0,Dt=Math.max(ot,rt)/2):kt=x.startRadius,ut=y.createRadialGradient(ft,mt,kt,yt,Pt,Dt);else if(x.type===cf)try{ut=y.createPattern(x.pattern,"repeat")}catch(Rt){ut=null}if(x.type!==cf&&(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===cf&&x.yk!==-1)){x.yk=-1;var Tt=a.diagram;Tt!==null&&x.yk===-1&&ri(function(){Tt.redraw()},600)}}E?y.fillStyle=ut:y.strokeStyle=ut}}}xt.rg=function(a){if(a instanceof De)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},xt.Ed=function(){if(!this.visible)return!1;var a=this.panel;return a!==null?a.Ed():!0},xt.If=function(){for(var a=this instanceof De?this:this.panel;a!==null&&a.isEnabled;)a=a.panel;return a===null};function vr(a){if(a.l&2048){var y=a.Ab;if(y.reset(),!a.Ib.w()||!a.uc.w()){Pa(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)}Pa(a,!1),ua(a,!0)}a.l&4096&&(y=a.panel,y===null?(a.wh.set(a.Ab),a.Kk=a.scale,ua(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,ua(a,!1)))}xt.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=It.alloc();z.yi(y,x,E,b,Di),a.rotate(this.Kb,z.x,z.y),It.free(z)}},xt.v=function(a){if(!Zs(this)){a===void 0&&(a=!1),Go(this,!0),Nl(this,!0);var y=this.panel;y===null||a||y.v()}},xt.Uj=function(){Zs(this)||(Go(this,!0),Nl(this,!0))};function $r(a){if(!ts(a)){var y=a.panel;y!==null?y.v():a.Dd()&&(y=a.diagram,y!==null&&(y.De.add(a),a instanceof Je&&a.Bd(),y.$b())),Nl(a,!0)}}xt.Uk=function(){!(this.l&2048)&&(Pa(this,!0),ua(this,!0))},xt.Wu=function(){ua(this,!0)},xt.N=function(){var a=this.part;a!==null&&a.N()};function ps(a,y){var x=a.stretch,E=a.panel;return E!==null&&E.type===De.Table?Qa(a,E.Fb(a.row),E.Eb(a.column),y):E!==null&&E.type===De.Auto&&E.Pb()===a?cr(a,Te,y):x===Un?E!==null?E.type===De.Spot&&E.Pb()===a?cr(a,Te,y):(x=E.defaultStretch,x===Un?cr(a,Ne,y):cr(a,x,y)):cr(a,Ne,y):cr(a,x,y)}function Qa(a,y,x,E){var b=a.stretch;if(b!==Un)return cr(a,b,E);var z=b=null;switch(y.stretch){case bn:z=!0;break;case Te:z=!0}switch(x.stretch){case pn:b=!0;break;case Te:b=!0}return y=a.panel.defaultStretch,b===null&&(b=y===pn||y===Te),z===null&&(z=y===bn||y===Te),b===!0&&z===!0?cr(a,Te,E):b===!0?cr(a,pn,E):z===!0?cr(a,bn,E):cr(a,Ne,E)}function cr(a,y,x){if(x)return y;if(y===Ne||(x=a.desiredSize,x.w()))return Ne;if(a=a.angle,!isNaN(x.width))if(a!==90&&a!==270){if(y===pn)return Ne;if(y===Te)return bn}else{if(y===bn)return Ne;if(y===Te)return pn}if(!isNaN(x.height))if(a!==90&&a!==270){if(y===bn)return Ne;if(y===Te)return pn}else{if(y===pn)return Ne;if(y===Te)return bn}return y}function Oa(a,y){a.l=y?a.l|512:a.l&-513}function wr(a){return(a.l&1024)!==0}function nc(a,y){a.l=y?a.l|1024:a.l&-1025}function Pa(a,y){a.l=y?a.l|2048:a.l&-2049}function ua(a,y){a.l=y?a.l|4096:a.l&-4097}function Zs(a){return(a.l&8192)!==0}function Go(a,y){a.l=y?a.l|8192:a.l&-8193}function ts(a){return(a.l&16384)!==0}function Nl(a,y){a.l=y?a.l|16384:a.l&-16385}xt.Gj=function(){this.svg=null},xt.wi=function(a){this.Me=a,this.svg!==null&&this.svg.remove()},xt.Av=function(){},xt.zv=function(a){return this.pa=a,$r(this),!0},xt.mm=function(a,y){(this.pa.x!==a||this.pa.y!==y)&&(this.pa.h(a,y),this.Uk())},xt.kq=function(){return 0};function hd(a){var y=a.part;if(y instanceof Je&&(a.portId!==null||a===y.port)){var x=y.diagram;x===null||x.undoManager.isUndoingRedoing||W1(y,a)}}function Ky(a){var y=a.diagram;y===null||y.undoManager.isUndoingRedoing||(a instanceof De?a instanceof Je?a.Bd():a.qm(a,function(x){hd(x)}):hd(a))}xt.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new Bo(a,y,x,E):b=a,b.xd=this,a=this.ih(),a!==null&&c1(a)&&ce("Cannot add a Binding to a template that has already been copied: "+b),this.localBindings===null&&(this.localBindings=new Pe),this.localBindings.add(b),this},xt.set=function(a){return Object.assign(this,a),this},xt.Du=function(a){return nv(this,a),this},xt.apply=function(a){return a(this),this},xt.nm=function(a){return nd(this,a),this},xt.pz=function(){return this.ih()},xt.ih=function(){for(var a=this instanceof De?this:this.panel;a!==null;){if(a.allBindings!==null)return a;a=a.panel}return null},xt.Jv=function(a){return a.xd=this,this.animationTriggers===null&&(this.animationTriggers=new ln),this.animationTriggers.add(a.propertyName,a),this};function ha(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=sf.I(a);typeof z=="function"?(x=Mn(arguments),E=z(x),qt(E)||ce('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):b=ge.go[a]}if(E===null&&(b!=null&&b.constructor||ce("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 oe&&1<x.length){z=E;var tt=x[1];(typeof tt=="string"||tt instanceof HTMLDivElement)&&(ug(z,tt),b++)}for(;b<x.length;b++)z=x[b],z===void 0?ce("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 Zi)a.text=y;else if(a instanceof Kn)a.figure=y;else if(a instanceof vs)a.source=y;else if(a instanceof De)y=Ia.I(y),y!==null&&(a.type=y);else if(a instanceof Oi){var x=Yn(Oi,y);x!==null?a.type=x:ce("Unknown Brush type as an argument to GraphObject.make: "+y)}else a instanceof Ve?(y=Yn(Ve,y),y!==null&&(a.type=y)):a instanceof Mi&&(y=Yn(Mi,y),y!==null&&(a.type=y));else if(y instanceof Jt)a instanceof De||ce("A GraphObject can only be added to a Panel, not to: "+a),a.add(y);else if(y instanceof Ho){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 Ho?km(E,y):ce("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(y instanceof he)typeof a.qb=="function"&&a.qb(y);else if(y instanceof Yo)a.type=y;else if(y instanceof Bo)a instanceof Jt||a instanceof Ho?a.bind(y):ce("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(y instanceof Ba)a instanceof Jt?a.Jv(y):ce("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(y instanceof Qo)a instanceof Ve&&a.type===Ve.o?a.figures.add(y):ce("A PathFigure can only be added to a Path Geometry, not to: "+a);else if(y instanceof Mi)a instanceof Qo?a.segments.add(y):ce("A PathSegment can only be added to a PathFigure, not to: "+a);else if(y instanceof so)a instanceof oe||a instanceof Vn?a.layout=y:ce("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 Oi){x=new zn;for(var b in y)E=parseFloat(b),isNaN(E)?x[b]=y[b]:a.addColorStop(E,y[b]);nd(a,x)}else if(a instanceof Ho){y.row!==void 0?(b=y.row,(b==null||b===1/0||isNaN(b)||0>b)&&ce("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)&&ce("Must specify non-negative integer column for RowColumnDefinition "+y+", not: "+b),a.isRow=!1,a.index=b),b=new zn;for(x in y)x!=="row"&&x!=="column"&&(b[x]=y[x]);nd(a,b)}else nd(a,y);else ce('Unknown initializer "'+y+'" for object being constructed by GraphObject.make: '+a)}function Du(a,y){sf.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}ke.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 ic),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 ic),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 ic),this.A.wm=a)}},shadowVisible:{get:function(){return this.A!==null?this.A.Ci:null},set:function(a){var y=this.shadowVisible;y!==a&&($n(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&&($n(this),this.A.Hb=a,this.g("enabledChanged",y,a))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:is},set:function(a){var y=this.segmentOrientation;y!==a&&(this.Ua===null&&(this.Ua=new Ph),this.Ua.rr=a,this.v(),this.g("segmentOrientation",y,a),a===is&&(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 Ph),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 Ph),this.Ua.o=a,this.v(),this.g("segmentFraction",y,a))}},segmentOffset:{get:function(){return this.Ua!==null?this.Ua.F:mo},set:function(a){var y=this.segmentOffset;y.D(a)||(a=a.J(),this.Ua===null&&(this.Ua=new Ph),this.Ua.F=a,this.v(),this.g("segmentOffset",y,a))}},stretch:{get:function(){return this.A!==null?this.A.hg:Un},set:function(a){var y=this.stretch;y!==a&&($n(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&&($n(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)&&ti(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(md(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(md(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(),Ky(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&&rc(a,"GraphObject.areaBackground"),a instanceof Oi&&a.freeze(),$n(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&&rc(a,"GraphObject.background"),a instanceof Oi&&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 kn)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 It(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&&ce("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,Ky(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 Kn&&this.qc(),this.g("desiredSize",E,a),wr(this)&&(a=this.part,a!==null&&(no(this,a,"width"),no(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 Ke(a,this.jd.height).freeze(),this.v(),this instanceof Kn&&this.qc(),this.g("desiredSize",y,a),wr(this)&&(a=this.part,a!==null&&no(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 Ke(this.jd.width,a).freeze(),this.v(),this instanceof Kn&&this.qc(),this.g("desiredSize",y,a),wr(this)&&(a=this.part,a!==null&&no(this,a,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:oo},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(),$n(this),this.A.u=a,this.v(),this.g("minSize",y,a))}},maxSize:{get:function(){return this.A!==null?this.A.o:ar},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(),$n(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 qn(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&&vr(this),this.Ab}},oe:{get:function(){return this.l&4096&&vr(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(a){this.animationTriggers!==a&&($n(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:Ne},set:function(a){this.reshapingBehavior!==a&&($n(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()&&ce("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Jb=a=a.J(),$r(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&&ti(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&&ti(a,">= 1",Jt,"columnSpan"),$n(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&&ti(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&&ti(a,">= 1",Jt,"rowSpan"),$n(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&&($n(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 Je||ce("Cannot set portID on a Link: "+a),y!==null&&x!==null&&Hv(x,this),this.Yn=a,a!==null&&x!==null&&(x.Te=!0,Y1(x,this)),this.g("portId",y,a)}}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:pr},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),hd(this))}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:10},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&ti(a,">= 0",Jt,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),hd(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),hd(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&&ti(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:pr},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),hd(this))}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:10},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&ti(a,">= 0",Jt,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),hd(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),hd(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&&ti(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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&&($n(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 sf=null;Jt.className="GraphObject",sf=new ln,Du("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=ha(De,De.Auto,{isActionable:!0,enabledChanged:function(x,E){if(x instanceof De){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"},ha(Kn,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new En(0,0,2.76142374915397,2.761423749153969),spot2:new En(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 De&&(x=E.fb("ButtonBorder"),x instanceof Kn)){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 De&&(x=E.fb("ButtonBorder"),x instanceof Kn&&(x.fill=E._buttonFillNormal,x.stroke=E._buttonStrokeNormal))},y.actionDown=function(x,E){if(E.If()&&E instanceof De&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof Kn){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 De&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof Kn){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 De&&E._buttonFillPressed!==null){var b=E.fb("ButtonBorder");if(b instanceof Kn){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 De&&E._buttonFillPressed!==null){var b=x.diagram;if(b.firstInput.button===0&&(b.currentTool.standardMouseOver(),a(x,E)&&(x=E.fb("ButtonBorder"),x instanceof Kn))){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}),Du("TreeExpanderButton",function(){var a=ha("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},ha(Kn,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Eo},new Bo("figure","isTreeExpanded",function(y,x){return x=x.panel,y?x._treeExpandedFigure:x._treeCollapsedFigure}).cp()),{visible:!1},new Bo("visible","isTreeLeaf",function(y){return!y}).cp());return a.click=function(y,x){if(x=x.part,x instanceof wi&&(x=x.adornedPart),x instanceof Je){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}),Du("SubGraphExpanderButton",function(){var a=ha("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},ha(Kn,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Eo},new Bo("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 wi&&(x=x.adornedPart),x instanceof Vn){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}),Du("ToolTip",function(){return ha(wi,De.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new It(0,3),shadowBlur:5},ha(Kn,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new En(0,0,4,6),spot2:new En(1,1,-4,-4)}))}),Du("ContextMenu",function(){return ha(wi,De.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new It(0,3),shadowBlur:5},new Bo("background","",function(a){return a.adornedPart!==null&&a.placeholder!==null?null:"#F5F5F5"}))}),Du("ContextMenuButton",function(){var a=ha("Button");a.stretch=pn;var y=a.fb("ButtonBorder");return y instanceof Kn&&(y.figure="Rectangle",y.strokeWidth=0,y.spot1=new En(0,0,2,3),y.spot2=new En(1,1,-2,-2)),a}),Du("PanelExpanderButton",function(a){var y=am(a,"COLLAPSIBLE"),x=ha("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},ha(Kn,{name:"ButtonIcon",strokeWidth:2},new Bo("geometryString","visible",function(E){return E?x._buttonExpandedFigure:x._buttonCollapsedFigure}).cp(y)));return a=x.fb("ButtonBorder"),a instanceof Kn&&(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}),Du("CheckBoxButton",function(a){var y=am(a);return a=ha("Button",{desiredSize:new Ke(14,14)},ha(Kn,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:Te,geometryStretch:dn,visible:!1},y!==""?new Bo("visible",y).Kx():[])),a.click=function(x,E){if(E instanceof De){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}),Du("CheckBox",function(a){a=am(a),a=ha("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new qn(0,1,0,0)});var y=ha(De,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new qn(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=Ne=new he(Jt,"None",0),Jt.Default=Un=new he(Jt,"Default",0),Jt.Vertical=bn=new he(Jt,"Vertical",4),Jt.Horizontal=pn=new he(Jt,"Horizontal",5),Jt.Fill=Te=new he(Jt,"Fill",3),Jt.Uniform=dn=new he(Jt,"Uniform",1),Jt.UniformToFill=li=new he(Jt,"UniformToFill",2),Jt.FlipVertical=ni=new he(Jt,"FlipVertical",1),Jt.FlipHorizontal=vi=new he(Jt,"FlipHorizontal",2),Jt.FlipBoth=_i=new he(Jt,"FlipBoth",3),Jt.make=ha,Jt.getBuilders=function(){var a=new ln,y;for(y in sf)if(y!==y.toLowerCase()){var x=sf.I(y);typeof x=="function"&&a.add(y,x)}return a.freeze(),a},Jt.defineBuilder=Du,Jt.build=function(a,y,x){for(var E=[],b=2;b<arguments.length;++b)E[b-2]=arguments[b];if(b=sf.I(a),typeof b=="function"&&(E=b([a].concat(E)),E instanceof Jt))return y&&E.set(y),E;ce('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')},Jt.takeBuilderArgument=am;function ic(){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=oo,this.o=ar,this.hg=Un,this.ob=this.Bi=1,this.Pf=Ne,this.Pc=this.Ci=this.gd=null,this.Oc="category"}ic.prototype.copy=function(){var a=new ic;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 Ph(){this.u=-1/0,this.o=0,this.F=mo,this.rr=is,this.j=this.V="None"}Ph.prototype.copy=function(){var a=new Ph;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},Ph.className="LinkElementSettings";function Dg(){this.yj=this.Xi=Lr,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}Dg.prototype.copy=function(){var a=new Dg;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},Dg.className="LinkSettings";function dd(){this.ha=[1,0,0,1,0,0]}dd.prototype.copy=function(){var a=new dd;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},dd.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},dd.prototype.scale=function(a,y){this.ha[0]*=a,this.ha[1]*=a,this.ha[2]*=y,this.ha[3]*=y},dd.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)}},dd.className="STransform";function oc(a){this.type=a,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}oc.prototype.addColorStop=function(a,y){this.gx.push({offset:a,color:y})},oc.className="SGradient";function gl(a,y,x){this.ownerDocument=a=y===void 0?ge.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 Os(this,x)}gl.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},gl.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},gl.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},gl.prototype.focus=function(){this.Oa.focus()},gl.prototype.mx=function(){this.ownerDocument=null},ke.Object.defineProperties(gl.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}}}),gl.className="SVGSurface";function Os(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 dd,this.j=lm(this),this.Nj=lm(this,"gojs-diagram"),this.Hl=this.ti=null;var x=nr++,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 Xy(a,y,x,E,b,z,tt){a.Nj===void 0?Og(a,y,x,E,b,z,tt):a.Nj.setAttribute("transform","matrix("+y+", "+x+", "+E+", "+b+", "+z+", "+tt+")")}xt=Os.prototype,xt.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,Pt=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,Pt,a-ut,y-ft]),this.path.push(["A",x,x,0,1,Pt,mt,yt])):1e-6<E&&this.path.push(["A",x,x,0,+(E>=Math.PI),Pt,a+x*Math.cos(b),y+x*Math.sin(b)])},xt.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},xt.Se=function(a){this.addPath(this.path,this.rb,a||0)},xt.bezierCurveTo=function(a,y,x,E,b,z){this.path.push(["C",a,y,x,E,b,z])},xt.clearRect=function(){},xt.clip=function(){this.Yl.clipPath=!0},xt.closePath=function(){this.path.push(["z"])},xt.createLinearGradient=function(a,y,x,E){var b=new oc("linear");return b.x1=a,b.y1=y,b.x2=x,b.y2=E,b},xt.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"+nr++,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(ld,b)),this.svg.appendChild(a),x[y]=E,"url(#"+E+")"},xt.createRadialGradient=function(a,y,x,E,b,z){var tt=new oc("radial");return tt.x1=a,tt.y1=y,tt.r1=x,tt.x2=E,tt.y2=b,tt.r2=z,tt};function Zy(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)}xt.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,Zy(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')"),af(this,ld,z,this.rb),this.addElement(ld,z)},xt.fill=function(a){a&&(this.Yl["fill-rule"]="evenodd"),iv(this,this.Yl)},xt.ng=function(a,y){this.clipInsteadOfFill?this.clip():this.fill(y)},xt.fillRect=function(a,y,x,E){a=[a,y,x,E],a={x:a[0],y:a[1],width:a[2],height:a[3]},af(this,"fill",a,this.rb),this.addElement("rect",a)},xt.ox=function(a,y,x,E){a={x:a,y,width:x,height:E},af(this,"fill",a,this.rb),iv(this,a),this.svg.prepend(this.Ud("rect",a))},xt.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},af(this,"fill",y,this.rb),this.addElement("text",y,a[0])},xt.lineTo=function(a,y){this.path.push(["L",a,y])},xt.moveTo=function(a,y){this.path.push(["M",a,y])},xt.quadraticCurveTo=function(a,y,x,E){this.path.push(["Q",a,y,x,E])},xt.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"])},xt.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},xt.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())},xt.setTransform=function(a,y,x,E,b,z){a===1&&y===0&&x===0&&E===1&&b===0&&z===0||Og(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]+")"}xt.scale=function(a,y){this.rb.scale(a,y)},xt.translate=function(a,y){this.rb.translate(a,y)},xt.transform=function(){},xt.yc=function(){},xt.stroke=function(){qy(this,this.Yl)},xt.jk=function(){this.clipInsteadOfFill||this.stroke()},xt.Ud=function(a,y,x){return this.Gv.Ud(a,y,x)},xt.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 af(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 oc?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 oc?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 oc)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"+nr++,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+")"}xt.addPath=function(a,y,x){for(var E=[],b=0;b<a.length;b++){var z=Mn(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,af(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 Og(a,y,x,E,b,z,tt){var ot=new dd;ot.ha=[y,x,E,b,z,tt],y={},af(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}xt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x};function bl(a){a.Il=!1,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0}function eu(a){a.Il=!0,a.shadowOffsetX=a.Ar,a.shadowOffsetY=a.Br,a.shadowBlur=a.Vg}xt.js=function(a,y){this.Ct=!0,this.Yg=a,this.uj=y},xt.fs=function(){this.Ct=!1},xt.Vc=function(){},xt.Wx=function(){},Os.prototype.rotate=function(a){this.rb.rotate(57.2958*a,0,0)},Os.prototype.getImageData=function(){return null},Os.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()))}Os.prototype.Hs=function(a){a.svg!==null&&a.svg.parentNode===this.Nj&&a.svg.remove()},Os.className="SVGContext",oe.prototype.Cs=function(a){this.pj.contains("SVG")||this.bs("SVG",new gl(this,ge.document));var y=new gl(this,ge.document,!0);a===void 0&&(a=new zn);var x=this;return Qd(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)},oe.prototype.makeSvg=oe.prototype.Cs,oe.prototype.av=function(a){return this.Cs(a)},oe.prototype.makeSVG=oe.prototype.av;function wa(a,y,x,E){this.ownerDocument=y=y===void 0?ge.document:y,this.hs=null,y=y.createElement("canvas"),y.tabIndex=0,this.Oa=y,this.context=new cd(y,x,E),y.H=a}wa.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},wa.prototype.toDataURL=function(a,y){return this.Oa.toDataURL(a,y)},wa.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},wa.prototype.focus=function(){this.Oa.focus()},wa.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},ke.Object.defineProperties(wa.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}}}),wa.className="CanvasSurface";function cd(a,y,x){this.Z=a.getContext?a.getContext("2d",y):null,this.Z===null&&ce("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 oi,this.isTemporary=!!x}xt=cd.prototype,xt.Wx=function(a){this.Z.imageSmoothingEnabled=a},xt.arc=function(a,y,x,E,b,z){this.Z.arc(a,y,x,E,b,z)},xt.beginPath=function(){this.Z.beginPath()},xt.Se=function(){},xt.bezierCurveTo=function(a,y,x,E,b,z){this.Z.bezierCurveTo(a,y,x,E,b,z)},xt.clearRect=function(a,y,x,E){this.yc(),this.Z.clearRect(a,y,x,E)},xt.clip=function(){this.Z.clip()},xt.closePath=function(){this.Z.closePath()},xt.createLinearGradient=function(a,y,x,E){return this.Z.createLinearGradient(a,y,x,E)},xt.createPattern=function(a,y){return this.Z.createPattern(a,y)},xt.createRadialGradient=function(a,y,x,E,b,z){return this.Z.createRadialGradient(a,y,x,E,b,z)},xt.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)},xt.fill=function(a){this.Z.fill(a?"evenodd":"nonzero")},xt.fillRect=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},xt.ox=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},xt.fillText=function(a,y,x){this.Z.fillText(a,y,x)},xt.getImageData=function(a,y,x,E){return this.Z.getImageData(a,y,x,E)},xt.lineTo=function(a,y){this.Z.lineTo(a,y)},xt.measureText=function(a){return this.Z.measureText(a)},xt.moveTo=function(a,y){this.Z.moveTo(a,y)},xt.quadraticCurveTo=function(a,y,x,E){this.Z.quadraticCurveTo(a,y,x,E)},xt.rect=function(a,y,x,E){this.Z.rect(a,y,x,E)},xt.restore=function(){this.Z.restore()},xt.save=function(){this.yc(),this.Z.save()},cd.prototype.rotate=function(a){this.El.rotate(57.2958*a,0,0)},xt=cd.prototype,xt.setTransform=function(a,y,x,E,b,z){this.El.setTransform(a,y,x,E,b,z)},xt.scale=function(a,y){this.El.scale(a,y)},xt.translate=function(a,y){this.El.translate(a,y)},xt.stroke=function(){this.Z.stroke()},xt.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}},xt.yc=function(){var a=this.El;this.Z.setTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy)},xt.ng=function(a,y){if(a instanceof Oi&&a.type===da){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)},xt.jk=function(){this.Hm||this.stroke()},xt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x},xt.js=function(a,y){var x=this.Z;x.setLineDash!==void 0&&(x.setLineDash(a),x.lineDashOffset=y)},xt.fs=function(){var a=this.Z;a.setLineDash!==void 0&&(a.setLineDash(mx),a.lineDashOffset=0)},xt.Vc=function(a){a&&(this.dt=""),this.ct=this.et=""},xt.Hs=function(){},ke.Object.defineProperties(cd.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([]);cd.className="CanvasSurfaceContext";function Ig(){this.F=this.o=this.u=this.j=0}Ig.className="ColorNumbers";function Oi(a,y){df||(hv(),df=!0),Dn(this),this._isFrozen=!1,a===void 0?(this.na=Ou,this.xk="black"):typeof a=="string"?(this.na=Ou,this.xk=a):(this.na=a,this.xk="black"),a=this.na,a===iu?(this.Qd=ll,this.Lk=ea):this.Lk=a===da?this.Qd=Di:this.Qd=pr,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,y&&Object.assign(this,y)}Oi.prototype.copy=function(){var a=new Oi;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},xt=Oi.prototype,xt.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},xt.ka=function(){return Object.isFrozen(this)&&ce("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},xt.qb=function(a){a.classType===Oi&&(this.type=a)},xt.toString=function(){var a="Brush(";if(this.type===Ou)a+=this.color;else if(a=this.type===iu?a+"Linear ":this.type===da?a+"Radial ":this.type===cf?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+")"},xt.addColorStop=function(a,y){return this._isFrozen&&Tn(this),(typeof a!="number"||!isFinite(a)||1<a||0>a)&&ti(a,"0 <= loc <= 1",Oi,"addColorStop:loc"),this.we===null&&(this.we=new ln),this.we.add(a,y),this.na===Ou&&(this.type=iu),this.xe=null,this},xt.Vz=function(a,y){if(this._isFrozen&&Tn(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?ff:y,this.type===Ou)nu(this.color),this.color=uf(a,y);else if((this.type===iu||this.type===da)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)nu(x.value),this.addColorStop(x.key,uf(a,y));return this};function $y(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?ff:x,nu(a),uf(y,x)}xt.Wy=function(a,y){if(this._isFrozen&&Tn(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?ff:y,this.type===Ou)nu(this.color),this.color=uf(-a,y);else if((this.type===iu||this.type===da)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)nu(x.value),this.addColorStop(x.key,uf(-a,y));return this};function t1(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?ff:x,nu(a),uf(-y,x)}function rv(a,y,x){nu(a),a=qi.j;var E=qi.u,b=qi.o,z=qi.F;return nu(y),x===void 0&&(x=.5),"rgba("+Math.round((qi.j-a)*x+a)+", "+Math.round((qi.u-E)*x+E)+", "+Math.round((qi.o-b)*x+b)+", "+Math.round((qi.F-z)*x+z)+")"}xt.Gx=function(){if(this.type===Ou)return lf(this.color);if((this.type===iu||this.type===da)&&this.colorStops!==null){var a=this.colorStops;if(this.type===da)return lf(a.first().value);if(a.get(.5)!==null)return lf(a.get(.5));if(a.count===2)return a=a.Fa(),lf(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,lf(rv(a.get(x),a.get(E),1-z/b))}return!1};function lf(a){return a?a instanceof Oi?a.Gx():(nu(a),128>(299*qi.j+587*qi.u+114*qi.o)/1e3):!1}function uf(a,y){switch(y){case ff:y=100*av(qi.j);var x=100*av(qi.u),E=100*av(qi.o);return es.j=.4124564*y+.3575761*x+.1804375*E,es.u=.2126729*y+.7151522*x+.072175*E,es.o=.0193339*y+.119192*x+.9503041*E,es.F=qi.F,y=uv(es.j/hf[0]),x=uv(es.u/hf[1]),E=uv(es.o/hf[2]),Tl.j=116*x-16,Tl.u=500*(y-x),Tl.o=200*(x-E),Tl.F=es.F,Tl.j=Math.min(100,Math.max(0,Tl.j+100*a)),a=(Tl.j+16)/116,y=a-Tl.o/200,es.j=hf[0]*e1(Tl.u/500+a),es.u=hf[1]*(Tl.j>hm*dv?Math.pow(a,3):Tl.j/hm),es.o=hf[2]*e1(y),es.F=Tl.F,a=-.969266*es.j+1.8760108*es.u+.041556*es.o,y=.0556434*es.j+-.2040259*es.u+1.0572252*es.o,qi.j=255*lv((3.2404542*es.j+-1.5371385*es.u+-.4985314*es.o)/100),qi.u=255*lv(a/100),qi.o=255*lv(y/100),qi.F=es.F,qi.j=Math.round(qi.j),255<qi.j?qi.j=255:0>qi.j&&(qi.j=0),qi.u=Math.round(qi.u),255<qi.u?qi.u=255:0>qi.u&&(qi.u=0),qi.o=Math.round(qi.o),255<qi.o?qi.o=255:0>qi.o&&(qi.o=0),"rgba("+qi.j+", "+qi.u+", "+qi.o+", "+qi.F+")";case n1:return sv(),Js.o=Math.min(100,Math.max(0,Js.o+100*a)),"hsla("+Js.j+", "+Js.u+"%, "+Js.o+"%, "+Js.F+")";default:ce("Unknown color space: "+y)}}function nu(a){df||(hv(),df=!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,qi.j=a[0],qi.u=a[1],qi.o=a[2],qi.F=a[3]/255):(y.fillStyle="#FFFFFF",y.fillStyle=a,qi.j=0,qi.u=0,qi.o=0,qi.F=1)}}function sv(){var a=qi.j/255,y=qi.u/255,x=qi.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))}Js.j=Math.round(tt),Js.u=Math.round(100*a),Js.o=Math.round(100*b),Js.F=qi.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 e1(a){var y=a*a*a;return y>dv?y:(116*a-16)/hm}function rc(a,y){typeof a!="string"&&(a instanceof Oi||ce("Value for "+y+" must be a color string or a Brush, not "+a))}function hv(){cv=xo?new wa(null,void 0,{willReadFrequently:!0}).context:null}ke.Object.defineProperties(Oi.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&Tn(this,a),this.na=a,this.start.Mc()&&(a===iu?this.start=ll:a===da&&(this.start=Di)),this.end.Mc()&&(a===iu?this.end=ea:a===da&&(this.end=Di)),this.xe=null}},color:{get:function(){return this.xk},set:function(a){this._isFrozen&&Tn(this,a),this.xk=a,this.xe=null}},start:{get:function(){return this.Qd},set:function(a){this._isFrozen&&Tn(this,a),this.Qd=a.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(a){this._isFrozen&&Tn(this,a),this.Lk=a.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(a){this._isFrozen&&Tn(this,a),0>a&&ti(a,">= zero",Oi,"startRadius"),this.Gr=a,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(a){this._isFrozen&&Tn(this,a),0>a&&ti(a,">= zero",Oi,"endRadius"),this.Xp=a,this.xe=null}},colorStops:{get:function(){return this.we},set:function(a){this._isFrozen&&Tn(this,a),this.we=a,this.xe=null}},pattern:{get:function(){return this.cr},set:function(a){this._isFrozen&&Tn(this,a),this.cr=a,this.xe=null}}}),Oi.prototype.isDark=Oi.prototype.Gx,Oi.prototype.darkenBy=Oi.prototype.Wy,Oi.prototype.lightenBy=Oi.prototype.Vz,Oi.prototype.addColorStop=Oi.prototype.addColorStop;var dv=216/24389,hm=24389/27,hf=[95.047,100,108.883],cv=null,qi=new Ig,Js=new Ig,es=new Ig,Tl=new Ig,df=!1;Oi.className="Brush";var Ou;Oi.Solid=Ou=new he(Oi,"Solid",0);var iu;Oi.Linear=iu=new he(Oi,"Linear",1);var da;Oi.Radial=da=new he(Oi,"Radial",2);var cf;Oi.Pattern=cf=new he(Oi,"Pattern",4);var ff;Oi.Lab=ff=new he(Oi,"Lab",5);var n1;Oi.HSL=n1=new he(Oi,"HSL",6),Oi.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},Oi.isValidColor=function(a){if(a==="black")return!0;if(a==="")return!1;df||(hv(),df=!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)},Oi.lighten=function(a){return $y(a)},Oi.lightenBy=$y,Oi.darken=function(a){return t1(a)},Oi.darkenBy=t1,Oi.mix=rv,Oi.isDark=lf;function Yo(){this.xa="Base"}Yo.prototype.measure=function(){},Yo.prototype.Yz=function(a,y,x,E,b){a.measure(y,x,E,b)},Yo.prototype.arrange=function(){},Yo.prototype.Ly=function(a,y,x,E,b,z){a.arrange(y,x,E,b,z)},Yo.prototype.iA=function(a){a.Uj()},Yo.prototype.gc=function(){},ke.Object.defineProperties(Yo.prototype,{name:{get:function(){return this.xa},set:function(a){this.xa=a}},classType:{get:function(){return De}}}),Yo.prototype.remeasureObject=Yo.prototype.iA,Yo.prototype.arrangeElement=Yo.prototype.Ly,Yo.prototype.measureElement=Yo.prototype.Yz,Yo.className="PanelLayout";function dm(){this.xa="Base"}ne(dm,Yo),dm.prototype.measure=function(a,y,x,E,b,z,tt){var ot=E.length;a=ou(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 Kn&&at.isGeometryPositioned&&(at=at.strokeWidth/2,mt-=at,yt-=at),yo(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 Kn&&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"}ne(cm,Yo),cm.prototype.measure=function(a,y,x,E,b,z,tt){var ot=E.length;y=gn(),z=ou(a);for(var rt=0;rt<ot;rt++){var at=E[rt];if(at.visible||at===z){var ut=ps(at,!1);if(ut!==Ne&&ut!==pn)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));Ye(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,Pt=z+b.bottom,kt=ft.height,Dt=ps(ut,!1);(isNaN(ut.desiredSize.height)&&Dt===Te||Dt===bn)&&(kt=Math.max(x.height-yt-Pt,0)),yt=kt+yt+Pt,Pt=ut.alignment,Pt.Xb()&&(Pt=a.defaultAlignment),Pt.sb()||(Pt=Di),tt&&(ot-=ft.width+mt.left+mt.right),ut.arrange(ot+Pt.offsetX+mt.left,at+Pt.offsetY+mt.top+(x.height*Pt.y-yt*Pt.y),ft.width,kt),tt||(ot+=ft.width+mt.left+mt.right)}}};function fm(){this.xa="Base"}ne(fm,Yo),fm.prototype.measure=function(a,y,x,E,b,z){var tt=E.length;x=gn();for(var ot=ou(a),rt=0;rt<tt;rt++){var at=E[rt];if(at.visible||at===ot){var ut=ps(at,!1);if(ut!==Ne&&ut!==bn)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,Vo(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);Ye(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,Pt=z+b.right,kt=ft.width,Dt=ps(ut,!1);(isNaN(ut.desiredSize.width)&&Dt===Te||Dt===pn)&&(kt=Math.max(x.width-yt-Pt,0)),yt=kt+yt+Pt,Pt=ut.alignment,Pt.Xb()&&(Pt=a.defaultAlignment),Pt.sb()||(Pt=Di),tt&&(ot-=ft.height+mt.bottom+mt.top),ut.arrange(at+Pt.offsetX+mt.left+(x.width*Pt.x-yt*Pt.x),ot+Pt.offsetY+mt.top,kt,ft.height),tt||(ot+=ft.height+mt.bottom+mt.top)}}};function gm(){this.xa="Base"}ne(gm,Yo),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),Pt=Math.max(tt+ft,0),kt=a.isClipping,Dt=pe.allocAt(-at.left,-at.top,yt,Pt),Tt=pe.allocAt(0,0,z,tt);fv(rt,Tt,!0),z=Tt.width,tt=Tt.height;for(var Rt=!0,Gt=ou(a),Vt=0;Vt<ot;Vt++){var Xt=E[Vt];mt=y;var ie=x;if(Xt!==rt&&(Xt.visible||Xt===Gt)){at=Xt.margin;var Xe=at.left,an=at.top;switch(yt=at.right+at.left,Pt=at.top+at.bottom,at=ps(Xt,!1),at){case Te:mt=z,ie=tt,an=Xe=Pt=yt=0;break;case pn:mt=z,Xe=yt=0;break;case bn:ie=tt,an=Pt=0}Xt.measure(mt,ie,0,0),mt=Xt.measuredBounds,yt=Math.max(mt.width+yt,0),Pt=Math.max(mt.height+Pt,0),at=Xt.alignment,at.Xb()&&(at=a.defaultAlignment),at.sb()||(at=Di);var on=Xt.alignmentFocus;if(on.Xb()&&(on=Di),ie=null,Xt instanceof De&&Xt.$e!==""&&(ie=Xt.fb(Xt.$e),ie===Xt&&(ie=null)),Xe=Tt.x-Xe,an=Tt.y-an,ie!==null){for(Xt.arrange(0,0,mt.width,mt.height),mt=ie.actualBounds,mt=It.allocAt(mt.x+(on.x*mt.width-on.offsetX),mt.y+(on.y*mt.height-on.offsetY)),ie=ie.panel;ie!==Xt;)ie.transform.Ga(mt),ie=ie.panel;Xe+=at.x*z+at.offsetX-mt.x,an+=at.y*tt+at.offsetY-mt.y,It.free(mt)}else Xe+=at.x*z+at.offsetX-(on.x*mt.width+on.offsetX),an+=at.y*tt+at.offsetY-(on.y*mt.height+on.offsetY);Rt?(Rt=!1,b.h(Xe,an,yt,Pt)):yo(b,Xe,an,yt,Pt)}}switch(Rt?b.assign(Dt):kt?b.Uu(Tt.x,Tt.y,Tt.width,Tt.height):yo(b,Dt.x,Dt.y,Dt.width,Dt.height),pe.free(Dt),pe.free(Tt),at=rt.stretch,at===Un&&(at=ps(rt,!1)),at){case Ne:return;case Te:if(!isFinite(y)&&!isFinite(x))return;break;case pn:if(!isFinite(y))return;break;case bn:if(!isFinite(x))return}for(mt=rt.measuredBounds,z=mt.width,tt=mt.height,yt=Math.max(z+ut,0),Pt=Math.max(tt+ft,0),at=rt.margin,Tt=pe.allocAt(-at.left,-at.top,yt,Pt),fv(rt,Tt,!0),z=Tt.width,tt=Tt.height,y=0;y<ot;y++)x=E[y],x===rt||!x.visible&&x!==Gt||(at=x.margin,yt=at.right+at.left,Pt=at.top+at.bottom,mt=x.measuredBounds,yt=Math.max(mt.width+yt,0),Pt=Math.max(mt.height+Pt,0),ut=x.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=Di),x=x.alignmentFocus,x.Xb()&&(x=Di),Rt?(Rt=!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,Pt)):yo(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,Pt));Rt?b.assign(Dt):kt?b.Uu(Tt.x,Tt.y,Tt.width,Tt.height):yo(b,Dt.x,Dt.y,Dt.width,Dt.height),pe.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=pe.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=Di);var Pt=ft.alignmentFocus;if(Pt.Xb()&&(Pt=Di),at=null,ft instanceof De&&ft.$e!==""&&(at=ft.fb(ft.$e),at===ft&&(at=null)),at!==null){var kt=at.actualBounds;for(Pt=It.allocAt(kt.x+(Pt.x*kt.width-Pt.offsetX),kt.y+(Pt.y*kt.height-Pt.offsetY)),at=at.panel;at!==ft;)at.transform.Ga(Pt),at=at.panel;at=ut.x*tt.width+ut.offsetX-Pt.x,ut=ut.y*tt.height+ut.offsetY-Pt.y,It.free(Pt)}else at=ut.x*tt.width+ut.offsetX-(Pt.x*mt+Pt.offsetX),ut=ut.y*tt.height+ut.offsetY-(Pt.y*yt+Pt.offsetY);at+=tt.x-x.x,ut+=tt.y-x.y,ft.visible&&ft.arrange(z+at,rt+ut,mt,yt)}}pe.free(tt)};function fv(a,y,x){var E=null;if(a instanceof De&&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"}ne(pm,Yo),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 Pt=0,kt=null;rt instanceof Kn&&(kt=rt,Pt=kt.strokeWidth*kt.scale);var Dt=Math.max(at.width+mt,0);at=Math.max(at.height+yt,0);var Tt=vv(rt),Rt=Tt.x*Dt+Tt.offsetX;Tt=Tt.y*at+Tt.offsetY;var Gt=yv(rt),Vt=Gt.x*Dt+Gt.offsetX;for(Gt=Gt.y*at+Gt.offsetY,isFinite(y)&&(ut=Math.max(Math.abs(Rt-Vt)-Pt,0)),isFinite(x)&&(ft=Math.max(Math.abs(Tt-Gt)-Pt,0)),Pt=Ke.alloc(),Pt.h(0,0),a=ou(a),Gt=0;Gt<ot;Gt++)Tt=E[Gt],Tt===rt||!Tt.visible&&Tt!==a||(at=Tt.margin,Dt=at.right+at.left,Rt=at.top+at.bottom,Tt.measure(ut,ft,0,0),at=Tt.measuredBounds,Dt=Math.max(at.width+Dt,0),at=Math.max(at.height+Rt,0),Pt.h(Math.max(Dt,Pt.width),Math.max(at,Pt.height)));if(ot===1)b.width=Dt,b.height=at,Ke.free(Pt);else{switch(Tt=vv(rt),Gt=yv(rt),ot=E=0,Gt.x!==Tt.x&&Gt.y!==Tt.y&&(E=Pt.width/Math.abs(Gt.x-Tt.x),ot=Pt.height/Math.abs(Gt.y-Tt.y)),Ke.free(Pt),Pt=0,kt!==null&&(Pt=kt.strokeWidth*kt.scale,Lv(kt)===dn&&(E=ot=Math.max(E,ot))),E+=Math.abs(Tt.offsetX)+Math.abs(Gt.offsetX)+Pt,ot+=Math.abs(Tt.offsetY)+Math.abs(Gt.offsetY)+Pt,kt=rt.stretch,kt===Un&&(kt=ps(rt,!1)),kt){case Ne:tt=z=0;break;case Te:isFinite(y)&&(E=y),isFinite(x)&&(ot=x);break;case pn:isFinite(y)&&(E=y),tt=0;break;case bn: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=pe.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,yo(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=Di),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&&(lr(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 pe(z.x,z.y,z.width,z.height))));pe.free(z)};function mm(){this.xa="Base",this.name="Table"}ne(mm,Yo),mm.prototype.measure=function(a,y,x,E,b){for(var z=E.length,tt=gn(),ot=gn(),rt=0;rt<z;rt++){var at=E[rt],ut=at instanceof De?at:null;if(ut!==null&&Iu(ut)&&at.visible){ot.push(ut);for(var ft=ut.O.s,mt=ft.length,yt=0;yt<mt;yt++){var Pt=ft[yt];ut.type===De.TableRow?Pt.row=at.row:ut.type===De.TableColumn&&(Pt.column=at.column),tt.push(Pt)}}else tt.push(at)}z=tt.length,z===0&&(a.Fb(0),a.Eb(0));for(var kt=[],Dt=0;Dt<z;Dt++){var Tt=tt[Dt];Tt.visible&&(Go(Tt,!0),Nl(Tt,!0),kt[Tt.row]||(kt[Tt.row]=[]),kt[Tt.row][Tt.column]||(kt[Tt.row][Tt.column]=[]),kt[Tt.row][Tt.column].push(Tt))}Ye(tt);var Rt=gn(),Gt=gn(),Vt=gn(),Xt={count:0},ie={count:0},Xe=y,an=x,on=a.rowDefs,je=a.colDefs,Me=null;z=on.length;for(var Wn=0;Wn<z;Wn++)Me=on[Wn],Me!==void 0&&(Me.actual=0);z=je.length;for(var jn=0;jn<z;jn++)Me=je[jn],Me!==void 0&&(Me.actual=0);for(var Ei=kt.length,Xi=0,tr=0;tr<Ei;tr++)kt[tr]&&(Xi=Math.max(Xi,kt[tr].length));var rr=Math.min(a.topIndex,Ei-1),Vr=Math.min(a.leftIndex,Xi-1),er=0;Ei=kt.length;for(var Yu=ou(a),Do=0;Do<Ei;Do++)if(kt[Do]){Xi=kt[Do].length;var nl=a.Fb(Do);nl.actual=0;for(var Ur=nl.oc=0;Ur<Xi;Ur++)if(kt[Do][Ur]){var Ku=a.Eb(Ur);Rt[Ur]===void 0&&(Ku.actual=0,Ku.oc=0,Rt[Ur]=!0);for(var $s=kt[Do][Ur],Ma=$s.length,Rs=0;Rs<Ma;Rs++){var ks=$s[Rs];if(ks.visible||ks===Yu){var Oh=1<ks.rowSpan||1<ks.columnSpan;Oh&&(Do<rr||Ur<Vr||Gt.push(ks));var il=ks.margin,If=il.right+il.left,zs=il.top+il.bottom,Yr=Qa(ks,nl,Ku,!1),Cp=ks.desiredSize,vc=!isNaN(Cp.height),vl=!isNaN(Cp.width)&&vc;if(Oh||Yr===Ne||vl||Do<rr||Ur<Vr||(Xt[Ur]!==void 0||Yr!==Te&&Yr!==pn||(Xt[Ur]=-1,Xt.count++),ie[Do]!==void 0||Yr!==Te&&Yr!==bn||(ie[Do]=-1,ie.count++),Vt.push(ks)),ks.measure(1/0,1/0,0,0),!(Do<rr||Ur<Vr)){var Ms=ks.measuredBounds,Pd=Math.max(Ms.width+If,0),_s=Math.max(Ms.height+zs,0);if(ks.rowSpan===1&&(Yr===Ne||Yr===pn)){Me=a.Fb(Do);var Ih=Me.Wc();er=Math.max(_s-Me.actual,0),er+Ih>an&&(er=Math.max(an-Ih,0));var z0=Me.oa===0;Me.oc=Me.oc+er,Me.actual=Me.oa+er,an=Math.max(an-(er+(z0?Ih:0)),0)}if(ks.columnSpan===1&&(Yr===Ne||Yr===bn)){Me=a.Eb(Ur);var Lp=Me.Wc();er=Math.max(Pd-Me.actual,0),er+Lp>Xe&&(er=Math.max(Xe-Lp,0));var _y=Me.oa===0;Me.oc=Me.oc+er,Me.actual=Me.oa+er,Xe=Math.max(Xe-(er+(_y?Lp:0)),0)}Oh&&ks.Uj()}}}}}Ye(Rt);var _l=0,au=0;z=a.columnCount;for(var yc=0;yc<z;yc++){var jh=je[yc];jh!==void 0&&(_l+=isNaN(jh.Hc)?jh.oc:jh.Hc,jh.oc!==0&&(_l+=jh.Wc()))}z=a.rowCount;for(var jf=0;jf<z;jf++){var Rh=on[jf];Rh!==void 0&&(au+=isNaN(Rh.Hc)?Rh.oc:Rh.Hc,Rh.oc!==0&&(au+=Rh.Wc()))}Xe=Math.max(y-_l,0);var Gl=an=Math.max(x-au,0),Xu=Xe;z=Vt.length;for(var Es=0;Es<z;Es++){var yl=Vt[Es],_0=a.Fb(yl.row),lu=a.Eb(yl.column),Rf=yl.measuredBounds,ol=yl.margin,wd=ol.right+ol.left,Sl=ol.top+ol.bottom;Xt[yl.column]=lu.oc===0&&Xt[yl.column]!==void 0?Math.max(Rf.width+wd,Xt[yl.column]):null,ie[yl.row]=_0.oc===0&&ie[yl.row]!==void 0?Math.max(Rf.height+Sl,ie[yl.row]):null}var Sc=0,zf=0,Ha;for(Ha in ie)Ha!=="count"&&(Sc+=ie[Ha]);for(Ha in Xt)Ha!=="count"&&(zf+=Xt[Ha]);for(var Sr=Ke.alloc(),kp=0;kp<z;kp++){var ls=Vt[kp];if(ls.visible||ls===Yu){var Oo=a.Fb(ls.row),us=a.Eb(ls.column),uu=0;isFinite(us.width)?uu=us.width:(isFinite(Xe)&&Xt[ls.column]!==null?zf===0?uu=us.actual+Xe:uu=Xt[ls.column]/zf*Xu:Xt[ls.column]!==null?uu=Xe:uu=us.actual||Xe,uu=Math.max(0,uu-us.Wc()));var Zu=0;switch(isFinite(Oo.height)?Zu=Oo.height:(isFinite(an)&&ie[ls.row]!==null?Sc===0?Zu=Oo.actual+an:Zu=ie[ls.row]/Sc*Gl:ie[ls.row]!==null?Zu=an:Zu=Oo.actual||an,Zu=Math.max(0,Zu-Oo.Wc())),Sr.h(Math.max(us.minimum,Math.min(uu,us.maximum)),Math.max(Oo.minimum,Math.min(Zu,Oo.maximum))),Yr=Qa(ls,Oo,us,!1),Yr){case pn:Sr.height=Math.max(Sr.height,Oo.actual+an);break;case bn:Sr.width=Math.max(Sr.width,us.actual+Xe)}var Cd=ls.margin,Gy=Cd.right+Cd.left,G0=Cd.top+Cd.bottom;ls.Uj(),ls.measure(Sr.width,Sr.height,us.minimum,Oo.minimum);var _f=ls.measuredBounds,Ld=Math.max(_f.width+Gy,0),xc=Math.max(_f.height+G0,0);isFinite(Xe)&&(Ld=Math.min(Ld,Sr.width)),isFinite(an)&&(xc=Math.min(xc,Sr.height));var Fs=0;Fs=Oo.actual,Oo.actual=Math.max(Oo.actual,xc),Oo.oc=Math.max(Oo.oc,xc),er=Oo.actual-Fs,an=Math.max(an-er,0),ie[ls.row]===null&&(Gl=Math.max(Gl-er,0)),Fs=us.actual,us.actual=Math.max(us.actual,Ld),us.oc=Math.max(us.oc,Ld),er=us.actual-Fs,Xe=Math.max(Xe-er,0),Xt[ls.column]===null&&(Xu=Math.max(Xu-er,0))}}Ye(Vt);var hu=Ke.alloc(),rl=gn(),ma=gn();if(z=Gt.length,z!==0){for(var zh=0;zh<Ei;zh++)if(kt[zh]){Xi=kt[zh].length;var Gf=a.Fb(zh);rl[zh]=Gf.actual;for(var _h=0;_h<Xi;_h++)if(kt[zh][_h]){var H0=a.Eb(_h);ma[_h]=H0.actual}}}for(var Hf=0;Hf<z;Hf++){var ko=Gt[Hf];if(ko.visible||ko===Yu){var Wa=a.Fb(ko.row),Ea=a.Eb(ko.column);switch(Sr.h(Math.max(Ea.minimum,Math.min(y,Ea.maximum)),Math.max(Wa.minimum,Math.min(x,Wa.maximum))),Yr=Qa(ko,Wa,Ea,!1),Yr){case Te:ma[Ea.index]!==0&&(Sr.width=Math.min(Sr.width,ma[Ea.index])),rl[Wa.index]!==0&&(Sr.height=Math.min(Sr.height,rl[Wa.index]));break;case pn:ma[Ea.index]!==0&&(Sr.width=Math.min(Sr.width,ma[Ea.index]));break;case bn:rl[Wa.index]!==0&&(Sr.height=Math.min(Sr.height,rl[Wa.index]))}isFinite(Ea.width)&&(Sr.width=Ea.width),isFinite(Wa.height)&&(Sr.height=Wa.height),hu.h(0,0);for(var W0=Ea.minimum,Gs=Wa.minimum,Ju=1;Ju<ko.rowSpan&&!(ko.row+Ju>=a.rowCount);Ju++)Me=a.Fb(ko.row+Ju),er=0,er=Yr===Te||Yr===bn?Math.max(Me.minimum,rl[ko.row+Ju]===0?Me.maximum:Math.min(rl[ko.row+Ju],Me.maximum)):Math.max(Me.minimum,isNaN(Me.Hc)?Me.maximum:Math.min(Me.Hc,Me.maximum)),hu.height+=er,Gs+=Me.minimum;for(var Fa=1;Fa<ko.columnSpan&&!(ko.column+Fa>=a.columnCount);Fa++)Me=a.Eb(ko.column+Fa),er=0,er=Yr===Te||Yr===pn?Math.max(Me.minimum,ma[ko.column+Fa]===0?Me.maximum:Math.min(ma[ko.column+Fa],Me.maximum)):Math.max(Me.minimum,isNaN(Me.Hc)?Me.maximum:Math.min(Me.Hc,Me.maximum)),hu.width+=er,W0+=Me.minimum;Sr.width+=hu.width,Sr.height+=hu.height;var Wf=ko.margin,Gh=Wf.right+Wf.left,Mp=Wf.top+Wf.bottom;ko.measure(Sr.width,Sr.height,W0,Gs);for(var Vf=ko.measuredBounds,xl=Math.max(Vf.width+Gh,0),kd=Math.max(Vf.height+Mp,0),Hh=0,Uf=0;Uf<ko.rowSpan&&!(ko.row+Uf>=a.rowCount);Uf++)Me=a.Fb(ko.row+Uf),Hh+=Me.total||0;if(Hh<kd){var Qu=kd-Hh,Hl=kd-Hh;if(ko.spanAllocation!==null)for(var qu=ko.spanAllocation,du=0;du<ko.rowSpan&&!(0>=Qu)&&!(ko.row+du>=a.rowCount);du++){Me=a.Fb(ko.row+du);var $u=Me.oa||0,Md=qu(ko,Me,Hl);Me.actual=Math.min(Me.maximum,$u+Md),Me.oa!==$u&&(Qu-=Me.oa-$u)}for(;0<Qu;){var sl=Me.oa||0;if(isNaN(Me.height)&&Me.maximum>sl&&(Me.actual=Math.min(Me.maximum,sl+Qu),Me.oa!==sl&&(Qu-=Me.oa-sl)),Me.index===0)break;Me=a.Fb(Me.index-1)}}for(var Pc=0,th=0;th<ko.columnSpan&&!(ko.column+th>=a.columnCount);th++)Me=a.Eb(ko.column+th),Pc+=Me.total||0;if(Pc<xl){var wc=xl-Pc,Hy=xl-Pc;if(ko.spanAllocation!==null)for(var cu=ko.spanAllocation,Ed=0;Ed<ko.columnSpan&&!(0>=wc)&&!(ko.column+Ed>=a.columnCount);Ed++){Me=a.Eb(ko.column+Ed);var Ep=Me.oa||0,Wy=cu(ko,Me,Hy);Me.actual=Math.min(Me.maximum,Ep+Wy),Me.oa!==Ep&&(wc-=Me.oa-Ep)}for(;0<wc;){var V0=Me.oa||0;if(isNaN(Me.width)&&Me.maximum>V0&&(Me.actual=Math.min(Me.maximum,V0+wc),Me.oa!==V0&&(wc-=Me.oa-V0)),Me.index===0)break;Me=a.Eb(Me.index-1)}}}}Ye(Gt),Ke.free(hu),Ke.free(Sr),rl!==void 0&&Ye(rl),ma!==void 0&&Ye(ma);var Cc=0,Lc=0,U0=a.desiredSize,gx=a.maxSize;Yr=ps(a,!0);var Fp=au=_l=0,Np=0;z=a.columnCount;for(var Y0=0;Y0<z;Y0++)je[Y0]!==void 0&&(Me=a.Eb(Y0),isFinite(Me.width)?(Fp+=Me.width,Fp+=Me.Wc()):Mm(Me)===_g?(Fp+=Me.oa,Fp+=Me.Wc()):Me.oa!==0&&(_l+=Me.oa,_l+=Me.Wc()));isFinite(U0.width)?Cc=Math.min(U0.width,gx.width):Cc=Yr!==Ne&&isFinite(y)?y:_l,Cc=Math.max(Cc,a.minSize.width),Cc=Math.max(Cc-Fp,0);for(var Qx=_l===0?1:Math.max(Cc/_l,1),K0=0;K0<z;K0++)je[K0]!==void 0&&(Me=a.Eb(K0),isFinite(Me.width)||Mm(Me)===_g||(Me.actual=Me.oa*Qx),Me.position=b.width,Me.oa!==0&&(b.width+=Me.oa,b.width+=Me.Wc()));z=a.rowCount;for(var X0=0;X0<z;X0++)on[X0]!==void 0&&(Me=a.Fb(X0),isFinite(Me.height)?(Np+=Me.height,Np+=Me.Wc()):Mm(Me)===_g?(Np+=Me.oa,Np+=Me.Wc()):Me.oa!==0&&(au+=Me.oa,au+=Me.Wc()));isFinite(U0.height)?Lc=Math.min(U0.height,gx.height):Lc=Yr!==Ne&&isFinite(x)?x:au,Lc=Math.max(Lc,a.minSize.height),Lc=Math.max(Lc-Np,0);for(var qx=au===0?1:Math.max(Lc/au,1),Z0=0;Z0<z;Z0++)on[Z0]!==void 0&&(Me=a.Fb(Z0),isFinite(Me.height)||Mm(Me)===_g||(Me.actual=Me.oa*qx),Me.position=b.height,Me.oa!==0&&(b.height+=Me.oa,b.height+=Me.Wc()));z=ot.length;for(var Vy=0;Vy<z;Vy++){var bp=ot[Vy],Uy=0,Yy=0;bp.type===De.TableRow?(Uy=b.width,Me=a.Fb(bp.row),Yy=Me.actual):(Me=a.Eb(bp.column),Uy=Me.actual,Yy=b.height),bp.measuredBounds.h(0,0,Uy,Yy),Go(bp,!1)}Ye(ot),a.inRowsCols=kt},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 Pt=Math.min(a.leftIndex,ut-1);if(0<ot.length){for(;Pt!==ut&&(ot[Pt]===void 0||ot[Pt].oa===0);)Pt++;Pt=Math.max(Math.min(Pt,ut-1),0),mt=-ot[Pt].position}for(var kt=0,Dt=0;kt!==at&&rt[kt]===void 0;)kt++;for(;Dt!==at&&ot[Dt]===void 0;)Dt++;ut=a.part,a.Fb(kt),a.Eb(Dt);for(var Tt=0;Tt<y.length;Tt++){var Rt=y[Tt];if(Rt instanceof De&&Rt.visible&&Iu(Rt)){if(Rt.type===De.TableRow){ot=a.Fb(Rt.row);var Gt=a.Eb(Dt)}else ot=a.Fb(kt),Gt=a.Eb(Rt.column);rt=ot.position+ft+b,ot.oa!==0&&(rt+=ot.Io(Math.max(kt,yt))),ot=Gt.position+mt+z,Gt.oa!==0&&(ot+=Gt.Io(Math.max(Dt,Pt))),Gt=Rt.measuredBounds,Rt.Uk(),Rt.actualBounds.ka();var Vt=Rt.actualBounds,Xt=pe.allocAt(Vt.x,Vt.y,Vt.width,Vt.height);Vt.x=Rt.type===De.TableRow?z:ot,Vt.y=Rt.type===De.TableColumn?b:rt,Vt.width=Gt.width,Vt.height=Gt.height,Rt.actualBounds.freeze(),Nl(Rt,!1),Io(Xt,Vt)||ut===null||(ut.oh(),Rt.Pn(ut)),pe.free(Xt)}}for(Tt=Ke.alloc(),Rt=0;Rt<at;Rt++)if(tt[Rt]){for(ut=tt[Rt].length,Gt=a.Fb(Rt),rt=Gt.position+ft+b,Gt.oa!==0&&(rt+=Gt.Io(Math.max(kt,yt))),Vt=0;Vt<ut;Vt++)if(tt[Rt][Vt]){Xt=a.Eb(Vt),ot=Xt.position+mt+z,Xt.oa!==0&&(ot+=Xt.Io(Math.max(Dt,Pt)));for(var ie=tt[Rt][Vt],Xe=ie.length,an=0;an<Xe;an++){var on=ie[an],je=on.measuredBounds;Tt.h(0,0);for(var Me=1;Me<on.rowSpan&&!(Rt+Me>=a.rowCount);Me++){var Wn=a.Fb(Rt+Me);Wn.oa!==0&&(Tt.height+=Wn.total)}for(Me=1;Me<on.columnSpan&&!(Vt+Me>=a.columnCount);Me++)Wn=a.Eb(Vt+Me),Wn.oa!==0&&(Tt.width+=Wn.total);var jn=Xt.oa+Tt.width,Ei=Gt.oa+Tt.height;Me=ot,Wn=rt;var Xi=jn,tr=Ei,rr=ot,Vr=rt,er=jn,Yu=Ei;ot+jn>x.width&&(er=Math.max(x.width-ot,0)),rt+Ei>x.height&&(Yu=Math.max(x.height-rt,0));var Do=on.alignment;if(Do.Xb()){Do=a.defaultAlignment,Do.sb()||(Do=Di);var nl=Do.x,Ur=Do.y,Ku=Do.offsetX;Do=Do.offsetY;var $s=Xt.alignment,Ma=Gt.alignment;$s.sb()&&(nl=$s.x,Ku=$s.offsetX),Ma.sb()&&(Ur=Ma.y,Do=Ma.offsetY)}else nl=Do.x,Ur=Do.y,Ku=Do.offsetX,Do=Do.offsetY;(isNaN(nl)||isNaN(Ur))&&(Ur=nl=.5,Do=Ku=0),$s=je.width,Ma=je.height;var Rs=on.margin,ks=Rs.left+Rs.right,Oh=Rs.top+Rs.bottom,il=Qa(on,Gt,Xt,!1);!isNaN(on.desiredSize.width)||il!==Te&&il!==pn||($s=Math.max(jn-ks,0)),!isNaN(on.desiredSize.height)||il!==Te&&il!==bn||(Ma=Math.max(Ei-Oh,0)),jn=on.maxSize,Ei=on.minSize,$s=Math.min(jn.width,$s),Ma=Math.min(jn.height,Ma),$s=Math.max(Ei.width,$s),Ma=Math.max(Ei.height,Ma),jn=Ma+Oh,Me+=Xi*nl-($s+ks)*nl+Ku+Rs.left,Wn+=tr*Ur-jn*Ur+Do+Rs.top,on.visible&&(lr(rr,Vr,er,Yu,Me,Wn,je.width,je.height)?on.arrange(Me,Wn,$s,Ma):on.arrange(Me,Wn,$s,Ma,new pe(rr,Vr,er,Yu)))}}}for(Ke.free(Tt),a=0;a<E;a++)x=y[a],z=x instanceof De?x:null,z!==null&&Iu(z)&&(z=x.actualBounds,x.naturalBounds.ka(),x.naturalBounds.h(0,0,z.width,z.height),x.naturalBounds.freeze())}};function vm(){this.xa="Base"}ne(vm,Yo),vm.prototype.measure=function(){},vm.prototype.arrange=function(){};function ym(){this.xa="Base"}ne(ym,Yo),ym.prototype.measure=function(){},ym.prototype.arrange=function(){};function Sm(){this.xa="Base"}ne(Sm,Yo),Sm.prototype.measure=function(a,y,x,E,b,z,tt){1<E.length&&ce("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),Pt=1;a.viewboxStretch===dn?ft!==0&&ot!==0&&(Pt=Math.min(mt/ft,yt/ot)):ft!==0&&ot!==0&&(Pt=Math.max(mt/ft,yt/ot)),Pt===0&&(Pt=1e-4),E.Ca*=Pt,ut!==E.scale&&(Go(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=Di),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 jg(){this.xa="Base"}ne(jg,Yo),jg.prototype.measure=function(){},jg.prototype.arrange=function(){},jg.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=[],Pt=a.O.s,kt=Pt.length,Dt=0;Dt<kt;Dt++){var Tt=Pt[Dt],Rt=[];if(yt.push(Rt),Tt.visible){var Gt=Tt.interval;if(!(0>Gt)){Tt=pv(Tt.figure);for(var Vt=0;Vt<kt;Vt++)if(Vt!==Dt){var Xt=Pt[Vt];Xt.visible&&pv(Xt.figure)===Tt&&(Xt=Xt.interval,Xt>Gt&&Rt.push(Xt))}}}}for(Pt=a.O.s,kt=Pt.length,Dt=0;Dt<kt;Dt++){var ie=Pt[Dt];if(ie.visible&&(Rt=ie.interval||1,Tt=Math.abs(Rt),!(2>b*Tt*x))){if(Gt=ie.segmentIndex,(!isFinite(Gt)||isNaN(Gt))&&(Gt=0),0>Gt&&(Gt=Tt-Math.min(-Gt,Tt)),Gt=Math.round(Gt%Tt),Tt=ie.opacity,Vt=1,Tt!==1){if(Tt===0)continue;Vt=y.globalAlpha,y.globalAlpha=Vt*Tt}Xt=yt[Dt];var Xe=!1,an=ie.strokeDashArray;if(an!==null&&(Xe=!0,y.js(an,ie.strokeDashOffset)),ie.figure==="LineV"&&ie.stroke!==null&&0<ie.strokeWidth){for(y.lineWidth=ie.strokeWidth,Co(a,y,ie.stroke,!1,!1,z,tt),y.beginPath(),an=ie=Math.floor((mt-b)/b);an<=ie+at;an++){var on=an*b+mt;0<=on&&on<=ot&&xm(an,Rt,Gt,Xt)&&(y.moveTo(on,0),y.lineTo(on,rt))}y.stroke(),y.Se()}else if(ie.figure==="LineH"&&ie.stroke!==null&&0<ie.strokeWidth){for(y.lineWidth=ie.strokeWidth,Co(a,y,ie.stroke,!1,!1,z,tt),y.beginPath(),an=ie=Math.floor((ft-E)/E);an<=ie+ut;an++)on=an*E+ft,0<=on&&on<=rt&&xm(an,Rt,Gt,Xt)&&(y.moveTo(0,on),y.lineTo(ot,on));y.stroke(),y.Se()}else if(ie.figure==="BarV"&&ie.fill!==null)for(Co(a,y,ie.fill,!0,!1,z,tt),ie=ie.width,isNaN(ie)&&(ie=b),on=an=Math.floor((mt-b)/b);on<=an+at;on++){var je=on*b+mt;0<=je+ie&&je<=ot&&xm(on,Rt,Gt,Xt)&&y.fillRect(je,0,ie,rt)}else if(ie.figure==="BarH"&&ie.fill!==null)for(Co(a,y,ie.fill,!0,!1,z,tt),ie=ie.height,isNaN(ie)&&(ie=E),on=an=Math.floor((ft-E)/E);on<=an+ut;on++)je=on*E+ft,0<=je+ie&&je<=rt&&xm(on,Rt,Gt,Xt)&&y.fillRect(0,je,ot,ie);Xe&&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 Pm(){this.xa="Base"}ne(Pm,Yo),Pm.prototype.measure=function(a,y,x,E,b){var z=E.length;if(a instanceof wi||a instanceof _e){var tt=null,ot=null;if(a instanceof _e&&(tt=a),a instanceof wi&&(ot=a,tt=ot.adornedPart,a.j===null&&(a.j=[])),tt instanceof _e){var rt=tt;if(z===0)Vo(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var at=a instanceof wi?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){i1(a,ot,mt,at);var Pt=at.measuredBounds;x.ed(Pt),yt.push(Pt)}Pt=oi.alloc();for(var kt=It.alloc(),Dt=It.alloc(),Tt=0;Tt<z;Tt++){var Rt=E[Tt];if(Rt!==at)if(Rt.isPanelMain&&Rt instanceof Kn){i1(a,ot,mt,Rt);var Gt=Rt.measuredBounds;x.ed(Gt),yt.push(Gt)}else if(2>ft)Rt.measure(1/0,1/0,0,0),Gt=Rt.measuredBounds,x.ed(Gt),yt.push(Gt);else{var Vt=Rt.segmentIndex,Xt=Rt.segmentFraction,ie=Rt.alignmentFocus;ie.Mc()&&(ie=Di);var Xe=Rt.segmentOrientation,an=Rt.segmentOffset;if(isNaN(Vt)){var on=rt.ua;Gt=gn(),on.Qu(Xt,Gt);var je=It.allocAt(Gt[0],Gt[1]);if(je.add(rt.i(0)),on.type===Ve.j?je.offset(-on.startX,-on.startY):(on=on.figures.first(),on!==null&&je.offset(-on.startX,-on.startY)),on=Gt[2],Xe!==is){var Me=rt.computeAngle(Rt,Xe,on);Rt.Kb=Me}Me=je.x-y.x;var Wn=je.y-y.y;It.free(je),Ye(Gt)}else if(Vt<-ft||Vt>=ft)Gt=It.alloc(),rt.vg(),rt.computeMidPoint(Gt),on=rt.midAngle,Xe!==is&&(Me=rt.computeAngle(Rt,Xe,on),Rt.Kb=Me),Me=Gt.x-y.x,Wn=Gt.y-y.y,It.free(Gt);else{if(Me=0,0<=Vt?(Wn=ut.M(Vt),Gt=Vt<ft-1?ut.M(Vt+1):Wn):(Me=ft+Vt,Wn=ut.M(Me),Gt=0<Me?ut.M(Me-1):Wn),Wn.Xa(Gt)){0<=Vt?(on=0<Vt?ut.M(Vt-1):Wn,Me=Vt<ft-2?ut.M(Vt+2):Gt):(on=Me<ft-1?ut.M(Me+1):Wn,Me=1<Me?ut.M(Me-2):Gt),je=on.Bf(Wn);var jn=Gt.Bf(Me);on=je>jn+10?0<=Vt?on.ab(Wn):Wn.ab(on):jn>je+10?0<=Vt?Gt.ab(Me):Me.ab(Gt):0<=Vt?on.ab(Me):Me.ab(on)}else on=0<=Vt?Wn.ab(Gt):Gt.ab(Wn);Xe!==is&&(Me=rt.computeAngle(Rt,Xe,on),Rt.Kb=Me),Me=Wn.x+(Gt.x-Wn.x)*Xt-y.x,Wn=Wn.y+(Gt.y-Wn.y)*Xt-y.y}Rt.measure(1/0,1/0,0,0),Gt=Rt.measuredBounds,je=Rt.naturalBounds;var Ei=0;Rt instanceof Kn&&(Ei=Rt.strokeWidth),jn=je.width+Ei;var Xi=je.height+Ei;Pt.reset(),Pt.translate(-Gt.x,-Gt.y),Pt.scale(Rt.scale,Rt.scale),Pt.rotate(Xe===is?Rt.angle:on,jn/2,Xi/2),Xe!==Jg&&Xe!==qg||Pt.rotate(90,jn/2,Xi/2),Xe!==Qg&&Xe!==$g||Pt.rotate(-90,jn/2,Xi/2),Xe===Qm&&(45<on&&135>on||225<on&&315>on)&&Pt.rotate(-on,jn/2,Xi/2),je=new pe(0,0,jn,Xi),kt.xi(je,ie),Pt.Ga(kt),ie=-kt.x+Ei/2*Rt.scale,Rt=-kt.y+Ei/2*Rt.scale,Dt.assign(an),Ei=isNaN(an.x);var tr=isNaN(an.y);if(Ei||tr){jn=jn/2+3,Xi=Xi/2+3;var rr=45<=on&&135>=on,Vr=225<=on&&315>=on;Xe===is&&(rr||Vr)?(Dt.x=tr?jn:an.y,Dt.y=Ei?Xi:an.x,rr?0<=Vt||isNaN(Vt)&&.5>Xt||!Ei||(Dt.y=-Xi):Vr&&((0<=Vt||isNaN(Vt)&&.5>Xt)&&Ei&&(Dt.y=-Xi),tr&&(Dt.x=-jn))):(Ei&&(Dt.x=0<=Vt||isNaN(Vt)&&.5>Xt?jn:-jn),tr&&(Dt.y=-Xi),Dt.rotate(on))}else Dt.rotate(on);Me+=Dt.x,Wn+=Dt.y,je.set(Gt),je.h(Me+ie,Wn+Rt,Gt.width,Gt.height),yt.push(je),x.ed(je)}}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),Vo(b,x.width||0,x.height||0),oi.free(Pt),It.free(kt),It.free(Dt)}}}},Pm.prototype.arrange=function(a,y){var x=y.length;if(a instanceof wi||a instanceof _e){var E=a,b=null;a instanceof wi&&(b=a,E=b.adornedPart);var z=a instanceof wi?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 _e)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,Pt=gn();yt.Qu(rt,Pt);var kt=It.allocAt(Pt[0],Pt[1]);kt.add(ft.i(0)),yt.type===Ve.j||(yt=yt.figures.first()),kt.offset(-yt.startX,-yt.startY),yt=Pt[2],at!==is&&(ft=ft.computeAngle(tt,at,yt),tt.angle=ft),ft=kt.x;var Dt=kt.y;It.free(kt),Ye(Pt)}else if(ot<-x||ot>=x)Pt=It.alloc(),yt=ft,Dt=Pt,yt.vg(),yt.computeMidPoint(Dt),yt=ft.midAngle,at!==is&&(ft=ft.computeAngle(tt,at,yt),tt.angle=ft),ft=Pt.x,Dt=Pt.y,It.free(Pt);else{if(kt=0,0<=ot?(Pt=y.s[ot],Dt=ot<x-1?y.s[ot+1]:Pt):(kt=x+ot,Pt=y.s[kt],Dt=0<kt?y.s[kt-1]:Pt),Pt.Xa(Dt)){0<=ot?(yt=0<ot?y.s[ot-1]:Pt,kt=ot<x-2?y.s[ot+2]:Dt):(yt=kt<x-1?y.s[kt+1]:Pt,kt=1<kt?y.s[kt-2]:Dt);var Tt=yt.Bf(Pt),Rt=Dt.Bf(kt);yt=Tt>Rt+10?0<=ot?yt.ab(Pt):Pt.ab(yt):Rt>Tt+10?0<=ot?Dt.ab(kt):kt.ab(Dt):0<=ot?yt.ab(kt):kt.ab(yt)}else yt=0<=ot?Pt.ab(Dt):Dt.ab(Pt);at!==is&&(ft=ft.computeAngle(tt,at,yt),tt.angle=ft),ft=Pt.x+(Dt.x-Pt.x)*rt,Dt=Pt.y+(Dt.y-Pt.y)*rt}if(mt.ys())tt.location=new It(ft,Dt);else{mt.Mc()&&(mt=Di),Pt=oi.alloc(),Pt.reset(),Pt.scale(tt.scale,tt.scale),Pt.rotate(tt.angle,0,0);var Gt=tt.naturalBounds;kt=pe.allocAt(0,0,Gt.width,Gt.height),Tt=It.alloc(),Tt.xi(kt,mt),Pt.Ga(Tt),mt=-Tt.x,Rt=-Tt.y;var Vt=Gt.width,Xt=Gt.height;Gt=It.alloc(),Gt.assign(ut);var ie=isNaN(ut.x),Xe=isNaN(ut.y);if(ie||Xe){Vt=Vt/2+3,Xt=Xt/2+3;var an=45<=yt&&135>=yt,on=225<=yt&&315>=yt;at===is&&(an||on)?(Gt.x=Xe?Vt:ut.y,Gt.y=ie?Xt:ut.x,an?0<=ot||isNaN(ot)&&.5>rt||!ie||(Gt.y=-Xt):on&&((0<=ot||isNaN(ot)&&.5>rt)&&ie&&(Gt.y=-Xt),Xe&&(Gt.x=-Vt))):(ie&&(Gt.x=0<=ot||isNaN(ot)&&.5>rt?Vt:-Vt),Xe&&(Gt.y=-Xt),Gt.rotate(yt))}else Gt.rotate(yt);ft+=Gt.x,Dt+=Gt.y,Pt.pp(kt),mt+=kt.x,Rt+=kt.y,ot=It.allocAt(ft+mt,Dt+Rt),tt.move(ot),It.free(ot),It.free(Gt),It.free(Tt),pe.free(kt),oi.free(Pt)}}b!==null?b.Ul(!1):E.Ul(!1),E=A1(a),a.location.h(a.position.x+E.x,a.position.y+E.y),It.free(E)}};function i1(a,y,x,E){if(Zs(E)!==!1){var b=E.strokeWidth;b===0&&a instanceof wi&&a.type===De.Link&&a.adornedObject instanceof Kn&&(b=a.adornedObject.strokeWidth),b*=E.Ca,a instanceof _e&&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 wi&&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),Go(E,!1)}}function Rg(){this.xa="Base"}ne(Rg,Yo),Rg.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 pe(-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,Pt=ot.strokeWidth,kt=yt.flattenedSegments,Dt=yt.flattenedLengths,Tt=yt.flattenedTotalLength,Rt=kt.length,Gt=0,Vt=0,Xt=gn(),ie=0;ie<Rt;ie++){var Xe=kt[ie],an=[];Vt=Gt=0;for(var on=Xe.length,je=0;je<on;je+=2){var Me=Xe[je],Wn=Xe[je+1];if(je!==0){var jn=180*Math.atan2(Wn-Vt,Me-Gt)/Math.PI;0>jn&&(jn+=360),an.push(jn)}Gt=Me,Vt=Wn}Xt.push(an)}if(a.graduatedIntervals===null){for(var Ei=[],Xi=a.O.s,tr=Xi.length,rr=0;rr<tr;rr++){var Vr=Xi[rr],er=[];if(Ei.push(er),Vr.visible){var Yu=Vr.interval;if(!(0>Yu)){for(var Do=0;Do<tr;Do++)if(Do!==rr){var nl=Xi[Do];if(nl.visible&&Vr.constructor===nl.constructor){var Ur=nl.interval;Ur>Yu&&er.push(Ur)}}}}}a.graduatedIntervals=Ei}var Ku=a.graduatedIntervals,$s=a.O.s,Ma=$s.length,Rs=0,ks=0,Oh=Tt;a.graduatedMarks=[];for(var il,If=0;If<Ma;If++){var zs=$s[If];if(il=[],zs.visible&&zs!==ot){var Yr=Math.abs(zs.interval),Cp=a.graduatedTickUnit;if(!(2>Cp*Yr*Tt/a.graduatedRange&&zs.graduatedSkip===null)){var vc=Dt[0][0],vl=0,Ms=0;ks=Tt*zs.graduatedStart-1e-4,Oh=Tt*zs.graduatedEnd+1e-4;var Pd=Cp*Yr,_s=a.graduatedTickBase;if(_s<a.graduatedMin){var Ih=(a.graduatedMin-_s)/Pd;Ih=Ih%1===0?Ih:Math.floor(Ih+1),_s+=Ih*Pd}else _s>a.graduatedMin+Pd&&(_s-=Math.floor((_s-a.graduatedMin)/Pd)*Pd);for(var z0=Ku[If],Lp=_s,_y=1e-6*a.graduatedMax,_l=1;_s<=a.graduatedMax+_y;_l++){t:{for(var au=z0.length,yc=0;yc<au;yc++){var jh=(_s-a.graduatedTickBase)%(z0[yc]*a.graduatedTickUnit),jf=1e-6*a.graduatedTickUnit;if(jh<jf&&jh>-jf){var Rh=!1;break t}}Rh=!0}if(Rh&&(_s>a.graduatedMax&&(_s=a.graduatedMax),zs.graduatedSkip===null||zs instanceof Zi&&!zs.graduatedSkip(_s,zs)||zs instanceof Kn&&!zs.graduatedSkip(_s,zs))&&(Rs=(_s-a.graduatedMin)*Tt/a.graduatedRange,Rs>Tt&&(Rs=Tt),ks<=Rs&&Rs<=Oh)){for(var Gl=Xt[vl][Ms],Xu=Dt[vl][Ms];vl<Dt.length;){for(;Rs>vc&&Ms<Dt[vl].length-1;)Ms++,Gl=Xt[vl][Ms],Xu=Dt[vl][Ms],vc+=Xu;if(Rs<=vc)break;vl++,Ms=0,Gl=Xt[vl][Ms],Xu=Dt[vl][Ms],vc+=Xu}var Es=kt[vl],yl=Es[2*Ms],_0=Es[2*Ms+1],lu=(Rs-(vc-Xu))/Xu,Rf=new It(yl+(Es[2*Ms+2]-yl)*lu+Pt/2-yt.bounds.x,_0+(Es[2*Ms+3]-_0)*lu+Pt/2-yt.bounds.y);Rf.scale(ot.scale,ot.scale);t:{var ol=Gl,wd=Xt[vl];if(!(.5005>lu&&.4995<lu)){var Sl=ol;if(.5>lu?0<Ms?Sl=wd[Ms-1]:Qt.$(Es[0],Es[Es.length-2])&&Qt.$(Es[1],Es[Es.length-1])&&(Sl=wd[wd.length-1]):.5<lu&&(Ms+1<wd.length?Sl=wd[Ms+1]:Qt.$(Es[0],Es[Es.length-2])&&Qt.$(Es[1],Es[Es.length-1])&&(Sl=wd[0])),ol!==Sl){var Sc=Math.abs(ol-Sl);if(180<Sc&&(ol<Sl?ol+=360:Sl+=360,Sc=Math.abs(ol-Sl)),5e-4>lu||.9995<lu){Gl=(ol+Sl)/2%360;break t}if(10>Sc){var zf=1-Math.abs(.5-lu);Gl=(ol*zf+Sl*(1-zf))%360;break t}}}Gl=ol}if(zs instanceof Zi){var Ha="";zs.graduatedFunction!==null?(Ha=zs.graduatedFunction(_s,zs),Ha=Ha!=null?Ha.toString():""):Ha=(+_s.toFixed(2)).toString(),Ha!==""&&il.push({$l:Rf,angle:Gl,text:Ha})}else il.push({$l:Rf,angle:Gl})}_s=Lp+_l*Pd}}}a.graduatedMarks.push(il)}Ye(Xt);var Sr=a.graduatedMarks;if(Sr!==null)for(var kp=E.length,ls=0;ls<kp;ls++){var Oo=E[ls],us=Sr[ls];if(Oo.visible&&Oo!==ot&&us.length!==0){if(Oo instanceof Kn){var uu=a,Zu=b,Cd=Oo.alignmentFocus;Cd.Mc()&&(Cd=ll);var Gy=Oo.angle;Oo.Kb=0,Oo.measure(1/0,1/0,0,0),Oo.Kb=Gy;var G0=Oo.measuredBounds,_f=G0.width,Ld=G0.height,xc=pe.allocAt(0,0,_f,Ld),Fs=It.alloc();Fs.xi(xc,Cd),pe.free(xc);for(var hu=-Fs.x,rl=-Fs.y,ma=new pe,zh=us.length,Gf=0;Gf<zh;Gf++)for(var _h=us[Gf],H0=_h.$l.x,Hf=_h.$l.y,ko=_h.angle,Wa=0;4>Wa;Wa++){switch(Wa){case 0:Fs.h(hu,rl);break;case 1:Fs.h(hu+_f,rl);break;case 2:Fs.h(hu,rl+Ld);break;case 3:Fs.h(hu+_f,rl+Ld)}Fs.rotate(ko+Oo.angle),Fs.offset(H0,Hf),Gf===0&&Wa===0?ma.h(Fs.x,Fs.y,0,0):ma.Ye(Fs),Fs.offset(-H0,-Hf),Fs.rotate(-ko-Oo.angle)}It.free(Fs),uu.graduatedBounds!==null&&uu.graduatedBounds.push(ma),yo(Zu,ma.x,ma.y,ma.width,ma.height)}else if(Oo instanceof Zi){var Ea=a,W0=b;Ea.temporaryTextBlock===null&&(Ea.temporaryTextBlock=new Zi);var Gs=Ea.temporaryTextBlock;y1(Gs,Oo);var Ju=Oo.alignmentFocus;Ju.Mc()&&(Ju=ll);for(var Fa=Oo.segmentOrientation,Wf=Oo.segmentOffset,Gh=new pe,Mp=0,Vf=0,xl=0,kd=0,Hh=0,Uf=us.length,Qu=0;Qu<Uf;Qu++){var Hl=us[Qu];Mp=Hl.$l.x,Vf=Hl.$l.y,xl=Hl.angle,Hh=kd=Oo.angle,Fa!==is&&(Hh=Fa===Zg||Fa===Jm?xl+Oo.angle:xl,kd=_e.computeAngle(Fa,Hh)),Gs.Kb=kd,Gs.text=Hl.text||"",Gs.measure(1/0,1/0,0,0);var qu=Gs.measuredBounds,du=Gs.naturalBounds,$u=du.width,Md=du.height,sl=oi.alloc();sl.reset(),sl.translate(-qu.x,-qu.y),sl.scale(Gs.scale,Gs.scale),sl.rotate(Hh,$u/2,Md/2),Fa!==Jg&&Fa!==qg||sl.rotate(90,$u/2,Md/2),Fa!==Qg&&Fa!==$g||sl.rotate(-90,$u/2,Md/2),Fa===Qm&&(45<xl&&135>xl||225<xl&&315>xl)&&sl.rotate(-xl,$u/2,Md/2);var Pc=pe.allocAt(0,0,$u,Md),th=It.alloc();th.xi(Pc,Ju),sl.Ga(th);var wc=-th.x,Hy=-th.y,cu=It.alloc();cu.assign(Wf),isNaN(cu.x)&&(cu.x=$u/2+3),isNaN(cu.y)&&(cu.y=-(Md/2+3)),cu.rotate(xl),Mp+=cu.x+wc,Vf+=cu.y+Hy;var Ed=new pe(Mp,Vf,qu.width,qu.height),Ep=new pe(qu.x,qu.y,qu.width,qu.height),Wy=new pe(du.x,du.y,du.width,du.height);Hl.Sz=kd,Hl.lineCount=Gs.lineCount,Hl.lines=[Gs.Cb,Gs.Ih,Gs.df,Gs.Le,Gs.Qc,Gs.Qb,Gs.ze],Hl.actualBounds=Ed,Hl.measuredBounds=Ep,Hl.naturalBounds=Wy,Qu===0?Gh.assign(Ed):Gh.ed(Ed),It.free(cu),It.free(th),pe.free(Pc),oi.free(sl)}Ea.graduatedBounds!==null&&Ea.graduatedBounds.push(Gh),yo(W0,Gh.x,Gh.y,Gh.width,Gh.height)}Go(Oo,!1)}}},Rg.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}}},Rg.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 Os,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],Pt=yt.length;if(mt.visible&&mt!==z&&yt.length!==0){if(mt instanceof Kn){if(!(2>a.graduatedTickUnit*mt.interval*z.geometry.flattenedTotalLength/a.graduatedRange*tt&&mt.graduatedSkip===null)){var kt=mt.measuredBounds,Dt=mt.strokeWidth*mt.scale,Tt=mt.alignmentFocus;Tt.Mc()&&(Tt=ll);for(var Rt=0;Rt<Pt;Rt++){var Gt=yt[Rt].$l,Vt=yt[Rt].angle,Xt=Tt,ie=mt.Ab;ie.reset(),ie.translate(Gt.x+ot.x,Gt.y+ot.y),ie.rotate(Vt+mt.angle,0,0),ie.translate(-kt.width*Xt.x+Xt.offsetX+Dt/2,-kt.height*Xt.y+Xt.offsetY+Dt/2),ie.scale(mt.scale,mt.scale),Pa(mt,!1),mt.wh.set(mt.Ab),mt.Kk=mt.scale,ua(mt,!1),mt.gc(y,x),b&&(a.svg.appendChild(mt.svg),mt.svg=null),mt.Ab.reset()}}}else if(mt instanceof Zi)for(a.temporaryTextBlock===null&&(a.temporaryTextBlock=new Zi),kt=a.temporaryTextBlock,y1(kt,mt),Dt=0;Dt<Pt;Dt++)Tt=yt[Dt],Tt.actualBounds&&Tt.measuredBounds&&Tt.naturalBounds&&(kt.ec=Tt.text||"",kt.Kb=Tt.Sz||0,kt.Gc=Tt.lineCount||0,Rt=Tt.lines,Rt!==void 0&&(kt.Cb=Rt[0],kt.Ih=Rt[1],kt.df=Rt[2],kt.Le=Rt[3],kt.Qc=Rt[4],kt.Qb=Rt[5],kt.ze=Rt[6]),Tt.naturalBounds&&(kt.dc=Tt.naturalBounds),Tt.actualBounds&&(Rt=Tt.actualBounds,kt.arrange(Rt.x,Rt.y,Rt.width,Rt.height)),Rt=Tt.actualBounds,kt.arrange(Rt.x,Rt.y,Rt.width,Rt.height),Gt=Tt.measuredBounds,Tt=Tt.naturalBounds,Vt=kt.Ab,Vt.reset(),Vt.translate(Rt.x+ot.x,Rt.y+ot.y),Vt.translate(-Gt.x,-Gt.y),kt.no(Vt,Tt.x,Tt.y,Tt.width,Tt.height),Pa(kt,!1),kt.wh.set(kt.Ab),kt.Kk=kt.scale,ua(kt,!1),kt.Ng=mt.part,kt.Me=mt.panel,kt.gc(y,x),kt.Me=null,kt.Ng=null,b&&(a.svg.appendChild(kt.svg),kt.svg=null))}}x.$i=E,y.restore(),y.Vc(!0)};function De(a,y){if(Jt.call(this),this.na=null,a===void 0)this.na=De.Position;else if(typeof a=="string"){var x=Ia.I(a);x!==null&&(this.na=x)}else a instanceof Yo?this.na=a:a&&(this.na=De.Position,y=a);this.na===null&&ce("Panel type not specified or PanelLayout not loaded: "+a),this.l=this.l|4194304|(this.na===De.Grid?1048576:0),this.O=new Pe,this.yb=ds,this.Tm=Lr,this.Uf=Un,this.$g=null,this.$e="",this.jg=new pe(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=dn,this.jn=Ro,this.kn=mo,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,y&&Object.assign(this,y)}ne(De,Jt),De.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},De.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},De.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 Je&&(z.Te=!0);var ot=a.diagram;ot!==null&&ot.undoManager.isUndoingRedoing||z.cb(bo,"elements",a,null,b,null,tt)}}return a}return null},xt=De.prototype,xt.toString=function(){return"Panel("+this.type.name+")#"+ci(this)},xt.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)},xt.hh=function(a,y){if(this.na===De.Grid)a.yc(),this.na.gc(this,a,y);else if(this.na===De.Graduated)a.yc(),this.na.gc(this,a,y);else{if(this.na===De.Table)if(a.yc(),a instanceof Os){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===De.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&&wm(a,y,!0,x,!0),E!==null&&wm(a,y,!1,E,!0),x!==null&&o1(a,y,!0,x),E!==null&&o1(a,y,!1,E),x!==null&&wm(a,y,!0,x,!1),E!==null&&wm(a,y,!1,E,!1)}function o1(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){Co(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 wm(a,y,x,E,b){for(var z=E.length,tt=a.actualBounds,ot=a.naturalBounds,rt=r1(a,!0),at=r1(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(),Pt=ft.separatorStrokeWidth;isNaN(Pt)&&(Pt=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var kt=ft.separatorStroke;kt===null&&(kt=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),(kt===null||ft.index===(x?rt:at))&&(Pt=0),yt-=Pt,Pt=ft.position+Pt,yt+=ft.actual,Pt+yt>mt&&(yt=mt-Pt),0>=yt||(mt=a.yb,Co(a,y,ft.background,!0,!1,ot,tt),x?y.fillRect(mt.left,Pt+mt.top,tt.width-(mt.left+mt.right),yt):y.fillRect(Pt+mt.left,mt.top,yt,tt.height-(mt.top+mt.bottom)))}}}}function r1(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"}xt.lv=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].lv();this.Uc=!0},xt.kk=function(a,y,x){if(!Jt.prototype.kk.call(this,a,y,x))return!1;if(this.type===De.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===De.Grid||this.na===De.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},xt.nk=function(){return!0},xt.$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)},xt.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=It.alloc(),mt=null,y=1/0;var Pt=null,kt=this.isClipping&&this.na===De.Spot;kt&&(Pt=It.alloc(),mt=this.Pb(),(at=mt.Sj(ot,a,rt,x,Pt))&&(y=(ot-Pt.x)*(ot-Pt.x)+(a-Pt.y)*(a-Pt.y)));for(var Dt=0;Dt<yt;Dt++){var Tt=ft[Dt];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 kt&&(y>E&&b.set(Pt),It.free(Pt)),It.free(ut),z&&b.transform(tt),at},xt.Gj=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Gj();Jt.prototype.Gj.call(this)},xt.v=function(a){if(!Zs(this)){Jt.prototype.v.call(this,a),a=null,(this.na===De.Auto||this.na===De.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=ps(b,!1);(b instanceof ns||b instanceof De||b instanceof Zi||z!==Ne)&&b.v(!0)}}}},xt.Uj=function(){if(!Zs(this)){Go(this,!0),Nl(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Uj()}},xt.Uk=function(){if(!(this.l&2048)){Pa(this,!0),ua(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()}},xt.Wu=function(){ua(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()},xt.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),Vo(b,a,rt),Vo(this.naturalBounds,a,rt),this.Ge(0,0,a,rt)},xt.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 ou(a){return a.part!==null?a.part.locationObject:null}xt.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=ps(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=Ne),a){case Ne:(y>x||z>E)&&(this.v(),this.measure(y>x?x:y,z>E?E:z,0,0));break;case Te:this.v(!0),this.measure(x+ot,E+tt,0,0);break;case pn:this.v(!0),this.measure(x+ot,z+tt,0,0);break;case bn:this.v(!0),this.measure(y+ot,E+tt,0,0)}}this.na.arrange(this,b,this.jg)}},xt.gh=function(a){var y=this.naturalBounds,x=ou(this);if(lr(0,0,y.width,y.height,a.x,a.y)){y=this.O.s;for(var E=y.length,b=It.allocAt(0,0);E--;){var z=y[E];if((z.visible||z===x)&&(Po(b.set(a),z.transform),z.ca(b)))return It.free(b),!0}return It.free(b),!(this.Ma===null&&this.areaBackground===null)}return!1},xt.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},xt.qm=function(a,y){if(y(this,a),a instanceof De){a=a.O.s;for(var x=a.length,E=0;E<x;E++)this.qm(a[E],y)}};function fd(a,y){s1(a,a,y)}function s1(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 De&&s1(a,z,x)}}function vx(a,y){a1(a,a,y)}function a1(a,y,x){if(x(y),y instanceof De){y=y.O.s;for(var E=y.length,b=0;b<E;b++)a1(a,y[b],x)}}xt.Nl=function(a){return l1(this,this,a)};function l1(a,y,x){if(x(y))return y;if(y instanceof De){y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=l1(a,y[b],x);if(z!==null)return z}}return null}xt.fb=function(a){if(this.name===a)return this;var y=this.O.s,x=y.length;this.Hh===null&&this.itemTemplateMap===null||(x=zg(this));for(var E=0;E<x;E++){var b=y[E];if(b instanceof De){var z=b.fb(a);if(z!==null)return z}if(b.name===a)return b}return null};function u1(a){a=a.O.s;for(var y=a.length,x=0,E=0;E<y;E++){var b=a[E];b instanceof De?x=Math.max(x,u1(b)):b instanceof Kn&&(x=Math.max(x,b.ig/2*b.strokeMiterLimit*b.Df()))}return x}xt.se=function(){return!(this.type===De.TableRow||this.type===De.TableColumn)};function Iu(a){return a.type===De.TableRow||a.type===De.TableColumn}xt.ic=function(a,y,x){if(this.pickable===!1||(y===void 0&&(y=null),x===void 0&&(x=null),ts(this)))return null;var E=this.naturalBounds,b=1/this.Df(),z=this.se(),tt=z?a:Po(It.allocAt(a.x,a.y),this.transform),ot=this.diagram,rt=10,at=5;if(ot!==null&&(rt=ot.Ql("extraTouchArea"),at=rt/2),lr(-(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=It.alloc(),at=(rt=this.isClipping&&this.na===De.Spot)?this.Pb():null,rt&&(at.se()?Po(ot.set(a),at.transform):ot.set(a),!at.ca(ot)))return It.free(ot),z||It.free(tt),null;for(var ft=ou(this);ut--;){var mt=b[ut];if((mt.visible||mt===ft)&&(mt.se()?Po(ot.set(a),mt.transform):ot.set(a),!rt||mt!==at)){var yt=null;if(mt instanceof De?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 It.free(ot),z||It.free(tt),yt}}It.free(ot)}return this.background===null&&this.areaBackground===null?(z||It.free(tt),null):(a=lr(0,0,E.width,E.height,tt.x,tt.y)?this:null,z||It.free(tt),a)}return z||It.free(tt),null},xt.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:Po(It.allocAt(a.x,a.y),this.transform);if(b=lr(0,0,b.width,b.height,tt.x,tt.y),Iu(this)||b){if(!this.isAtomic){for(var ot=this.O.s,rt=ot.length,at=It.alloc(),ut=ou(this);rt--;){var ft=ot[rt];if(ft.visible||ft===ut){ft.se()?Po(at.set(a),ft.transform):at.set(a);var mt=ft;ft=ft instanceof De?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))}}It.free(at)}return z||It.free(tt),b&&(this.background!==null||this.areaBackground!==null)}return z||It.free(tt),!1},xt.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=oi.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&oi.free(tt),!0;if(this.Yc(a,tt)){if(!this.isAtomic)for(var ot=ou(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 De?ut:null,mt=oi.alloc(),mt.set(tt),(ut!==null?ut.Cf(a,y,x,E,b,mt):$o(ft,a,E,mt))&&(y!==null&&(ft=y(ft)),ft===null||x!==null&&!x(ft)||b.add(ft)),oi.free(mt))}}return z===void 0&&oi.free(tt),E}return z===void 0&&oi.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 De&&mv(tt,y,x,E),y!==null&&(tt=y(tt)),tt===null||x!==null&&!x(tt)||E.add(tt))}}}xt.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:Po(It.allocAt(a.x,a.y),this.transform),at=ot?y:Po(It.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||Jo(rt.x,rt.y,0,0,0,tt.height)<=ut||Jo(rt.x,rt.y,0,tt.height,tt.width,tt.height)<=ut||Jo(rt.x,rt.y,tt.width,tt.height,tt.width,0)<=ut||Jo(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||(It.free(rt),It.free(at)),ft){if(!this.isAtomic){rt=It.alloc(),at=It.alloc(),ut=ou(this);for(var mt=this.O.s,yt=mt.length;yt--;){var Pt=mt[yt];if(Pt.visible||Pt===ut){var kt=Pt.actualBounds,Dt=this.naturalBounds;(!ot||!(kt.x>Dt.width||kt.y>Dt.height||0>kt.x+kt.width||0>kt.y+kt.height))&&(Pt.se()?(kt=Pt.transform,Po(rt.set(a),kt),Po(at.set(y),kt)):(rt.set(a),at.set(y)),kt=Pt,Pt=Pt instanceof De?Pt:null,(Pt!==null?Pt.og(rt,at,x,E,b,z):kt.tx(rt,at,b))&&(x!==null&&(kt=x(kt)),kt===null||E!==null&&!E(kt)||z.add(kt)))}}It.free(rt),It.free(at)}return b?ft:tt}return!1};function vv(a){var y=null;return a instanceof Kn&&(y=a.spot1,y===Lr&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot1)),y===null&&(y=Cr),y}function yv(a){var y=null;return a instanceof Kn&&(y=a.spot2,y===Lr&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot2)),y===null&&(y=na),y}xt.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},xt.M=function(a){return this.O.M(a)},xt.Gb=function(a,y){y instanceof kn&&ce("Cannot add a Part to a Panel: "+y+"; use a Panel instead"),(this===y||this.rg(y))&&(this===y&&ce("Cannot make a Panel contain itself: "+this.toString()),ce("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+y.toString()));var x=y.panel;if(x!==null&&x!==this&&ce("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!==De.Grid||y instanceof Kn||ce("Can only add Shapes to a Grid Panel, not: "+y),this.na!==De.Graduated||y instanceof Kn||y instanceof Zi||ce("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 ln),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 ce("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),Zs(this)||this.v(),y.v(!1),y.portId!==null?this.Te=!0:y instanceof De&&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 Je&&(x.Te=!0),x.Te&&x instanceof Je&&(x.wc=null),b=this.diagram,b!==null&&b.undoManager.isUndoingRedoing||(E!==-1&&x.cb(Uo,"elements",this,y,null,E,null),x.cb(bo,"elements",this,null,y,null,a)))};function Sv(a,y){a.l=y?a.l|16777216:a.l&-16777217}xt.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)},xt.mb=function(a){0<=a&&this.pc(a,!0)},xt.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),Go(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 Je&&(E instanceof De?E.qm(E,function(tt,ot){Hv(z,ot,y)}):Hv(z,E,y)),x=this.diagram,x!==null&&x.undoManager.isUndoingRedoing||z.cb(Uo,"elements",this,E,null,a,null))},xt.Fb=function(a){0>a&&ti(a,">= 0",De,"getRowDefinition:idx"),a=Math.round(a);var y=this.rowDefs;if(y[a]===void 0){var x=new Ho;x.wi(this),x.isRow=!0,x.index=a,y[a]=x,this.cb(bo,"rowdefs",this,null,x,null,a)}return y[a]},xt.oA=function(a){if(0>a&&ti(a,">= 0",De,"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(Uo,"rowdefs",this,x,null,a,null),this.v()}}};function h1(a,y,x){var E=a.rowDefs;if(!(0>y)){if(E[y]=x instanceof Ho?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}xt.Eb=function(a){0>a&&ti(a,">= 0",De,"getColumnDefinition:idx"),a=Math.round(a);var y=this.colDefs;if(y[a]===void 0){var x=new Ho;x.wi(this),x.isRow=!1,x.index=a,y[a]=x,this.cb(bo,"coldefs",this,null,x,null,a)}return y[a]},xt.jA=function(a){if(0>a&&ti(a,">= 0",De,"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(Uo,"coldefs",this,x,null,a,null),this.v()}}};function d1(a,y,x){var E=a.colDefs;if(!(0>y)){if(E[y]=x instanceof Ho?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}xt.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},xt.Hy=function(a,y){return(a=this.Fb(a))&&km(a,new Ho(y)),this},xt.By=function(a,y){return(a=this.Eb(a))&&km(a,new Ho(y)),this},xt.nz=function(a){if(0>a||this.type!==De.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},xt.fz=function(a){if(0>a||this.type!==De.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},xt.Fz=function(a,y){if(y===void 0&&(y=new It(NaN,NaN)),this.type!==De.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)},xt.Gz=function(a){if(this.type!==De.Graduated)return NaN;var y=this.Pb();return y.transform.Cd(a),y.geometry.xx(a)*this.graduatedRange+this.graduatedMin};function c1(a){return a=a.allBindings,a!==null&&a._isFrozen}function Ca(a){var y=a.allBindings;if(y===null)a.data!==null&&ce("Template cannot have .data be non-null: "+a),a.allBindings=y=new Pe;else if(y._isFrozen)return;var x=new Pe;Sv(a,!1),a.qm(a,function(at,ut){ut.th();var ft=ut.localBindings;if(ft!==null)for(nc(ut,!1),ft=ft.iterator;ft.next();){var mt=ft.value;mt.mode===ap&&nc(ut,!0);var yt=mt.sourceName;yt!==null&&(yt==="/"&&Sv(at,!0),yt=MS(mt,at,ut),yt!==null&&(x.add(yt),yt.srcBindings===null&&(yt.srcBindings=new Pe),yt.srcBindings.add(mt))),y.add(mt)}if(ut instanceof De&&ut.type===De.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 Pt=yt.be.iterator;Pt.next();){var kt=Pt.value;kt.xd=yt,kt.to=2,kt.wl=yt.index,y.add(kt)}}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();)Pt=yt.value,Pt.xd=mt,Pt.to=1,Pt.wl=mt.index,y.add(Pt)}}});for(var E=x.iterator;E.next();){var b=E.value;if(b.srcBindings!==null){nc(b,!0);for(var z=b.srcBindings.iterator;z.next();){var tt=z.value;b.localBindings===null&&(b.localBindings=new Pe),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 De&&(tt=ot.substring(0,rt),ot=ot.substr(rt+1),rt=z.fb(tt),rt!==null?(z=rt,b.targetProperty=ot):Be('Warning: unable to find GraphObject named "'+tt+'" for Binding: '+b.toString())),z instanceof Ho?(tt=ci(z.panel),b.Ai=tt===void 0?-1:tt,z.panel.bindingId=b.Ai):z instanceof Jt?(tt=ci(z),b.Ai=tt===void 0?-1:tt,z.bindingId=b.Ai):ce("Unknown type of binding target: "+z)}y.freeze(),a instanceof kn&&a.Zc()&&a.Va()}xt.Uy=function(a){a===void 0&&(a=!1);var y=this.copy();return vx(y,function(x){x instanceof De&&(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&&Ca(y),y},xt.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 De))continue;b===1?z=z.Eb(x.wl):b===2&&(z=z.Fb(x.wl))}z!==void 0&&x.Mv(z,E)}}},xt.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 De&&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 De)||z.data!==y[tt])return!0;b++,tt++}return!1}function zg(a){if(a.type===De.Spot||a.type===De.Auto)return Math.min(a.O.length,1);if(a.type===De.Link){a=a.O;for(var y=a.length,x=0;x<y;x++){var E=a.M(x);if(!(E instanceof Kn&&E.isPanelMain))break}return x}return a.type===De.Table&&0<a.O.length&&(a=a.O.M(0),a.isPanelMain&&a instanceof De&&Iu(a))?1:0}xt.mv=function(){for(var a=zg(this);this.O.length>a;)this.pc(this.O.length-1,!1);f1(this,this.itemArray)};function f1(a,y){var x=zg(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 De){if(tt.data!==z){var ot=Pv(a,tt.data),rt=Pv(a,z),at=rt!==ot;at||(ot=wv(a,ot),at=wv(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),Zs(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 Je&&(y.Te=!0),y.Te&&y instanceof Je&&(y.wc=null))}}function Cm(a,y,x,E){if(!(y==null||0>x)){var b=Pv(a,y);if(b=wv(a,b),b!==null){if(Ca(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 ln),a.ge.add(y,b)),z=x+zg(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 De){var b=y,z=x;E.type===De.TableRow?E.row=b:E.type===De.TableColumn&&(E.column=b),E.itemIndex=z}y++,x++}}function Pv(a,y){if(y===null)return"";if(a=a.itemCategoryProperty,typeof a=="function")a=a(y);else if(typeof a=="string"&&typeof y=="object"){if(a==="")return"";a=Fo(y,a)}else return"";if(a===void 0)return"";if(typeof a=="string")return a;ce("Panel.getCategoryForItemData found a non-string category for "+y+": "+a)}function wv(a,y){var x=a.itemTemplateMap,E=null;return x!==null&&(E=x.I(y)),E===null&&(x!==null&&(E=x.I("")),E===null&&(g1||(g1=!0,Be('No item template Panel found for category "'+y+'" on '+a),Be(" Using default item template."),a=new De,y=new Zi,y.bind(new Bo("text","",ei)),a.add(y),p1=a),E=p1)),E}function Lm(a,y,x){var E=y.enabledChanged;if(E!==null&&E(y,x),y instanceof De){y=y.O.s,E=y.length;for(var b=0;b<E;b++){var z=y[b];x&&z instanceof De&&!z.isEnabled||Lm(a,z,x)}}}function pl(a,y){y.name=a,Ia.add(a,y)}ke.Object.defineProperties(De.prototype,{type:{get:function(){return this.na},set:function(a){var y=this.na;y!==a&&(this.na=a,this.isAtomic=this.na===De.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&&ti(a,">= 0",De,"padding"),a=new qn(a)):(0>a.left&&ti(a.left,">= 0",De,"padding:value.left"),0>a.right&&ti(a.right,">= 0",De,"padding:value.right"),0>a.top&&ti(a.top,">= 0",De,"padding:value.top"),0>a.bottom&&ti(a.bottom,">= 0",De,"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:ds},set:function(a){typeof a=="number"&&(a=new qn(a));var y=this.defaultSeparatorPadding;y.D(a)||(a=a.J(),this.T===null&&(this.T=new ca),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 Oi)&&(a instanceof Oi&&a.freeze(),this.T===null&&(this.T=new ca),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 ca),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)||ce("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 ca),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 Oi)&&(a instanceof Oi&&a.freeze(),this.T===null&&(this.T=new ca),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 ca),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)||ce("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 ca),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 ca),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||ce("Invalid Panel.gridCellSize: "+a),this.jn=a.J();var x=this.diagram;x!==null&&this===x.grid&&cl(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()||ce("Invalid Panel.gridOrigin: "+a),this.kn=a.J();var x=this.diagram;x!==null&&this===x.grid&&cl(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 ru),this.ra.lq=a,this.v(),this.g("graduatedMin",y,a),wr(this)&&(a=this.part,a!==null&&no(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 ru),this.ra.F=a,this.v(),this.g("graduatedMax",y,a),wr(this)&&(a=this.part,a!==null&&no(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 ru),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 ru),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 ru,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 ru,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 ru,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 ru,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 ca),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new ca),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 ca),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 ca),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)&&ce("Panel.topIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new ca),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)&&ce("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new ca),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 kn&&!(this instanceof wi);Ca(this),this.ub=a;var E=this.diagram;E!==null&&(x?(x=E.partManager,this instanceof _e?(y!==null&&x.bf.remove(y),a!==null&&x.bf.add(a,this)):this instanceof kn&&(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 ic),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||f1(this,a)}}},itemTemplate:{get:function(){return this.itemTemplateMap===null?null:this.itemTemplateMap.I("")},set:function(a){if(this.itemTemplateMap===null){if(a===null)return;this.itemTemplateMap=new ln}var y=this.itemTemplateMap.I("");y!==a&&((a instanceof kn||a.isPanelMain)&&ce("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(););$n(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&&($n(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 Vn&&(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))}}}),ke.Object.defineProperties(De,{Position:{get:function(){return Ia.I("Position")}},Horizontal:{get:function(){return Ia.I("Horizontal")}},Vertical:{get:function(){return Ia.I("Vertical")}},Spot:{get:function(){return Ia.I("Spot")}},Auto:{get:function(){return Ia.I("Auto")}},Table:{get:function(){return Ia.I("Table")}},Viewbox:{get:function(){return Ia.I("Viewbox")}},TableRow:{get:function(){return Ia.I("TableRow")}},TableColumn:{get:function(){return Ia.I("TableColumn")}},Link:{get:function(){return Ia.I("Link")}},Grid:{get:function(){return Ia.I("Grid")}},Graduated:{get:function(){return Ia.I("Graduated")}}}),De.prototype.rebuildItemElements=De.prototype.mv,De.prototype.findItemPanelForData=De.prototype.sx,De.prototype.updateTargetBindings=De.prototype.La,De.prototype.copyTemplate=De.prototype.Uy,De.prototype.graduatedValueForPoint=De.prototype.Gz,De.prototype.graduatedPointForValue=De.prototype.Fz,De.prototype.findColumnForLocalX=De.prototype.fz,De.prototype.findRowForLocalY=De.prototype.nz,De.prototype.addColumnDefinition=De.prototype.By,De.prototype.addRowDefinition=De.prototype.Hy,De.prototype.addRowColumnDefinition=De.prototype.Gy,De.prototype.removeColumnDefinition=De.prototype.jA,De.prototype.getColumnDefinition=De.prototype.Eb,De.prototype.removeRowDefinition=De.prototype.oA,De.prototype.getRowDefinition=De.prototype.Fb,De.prototype.removeAt=De.prototype.mb,De.prototype.remove=De.prototype.remove,De.prototype.insertAt=De.prototype.Gb,De.prototype.elt=De.prototype.M,De.prototype.add=De.prototype.add,De.prototype.findObject=De.prototype.fb,De.prototype.findInVisualTree=De.prototype.Nl,De.prototype.walkVisualTreeFrom=De.prototype.qm,De.prototype.findMainElement=De.prototype.Pb;var g1=!1,p1=null,Ia=new ln;De.className="Panel",De.definePanelLayout=pl,pl("Position",new dm),pl("Vertical",new fm),pl("Auto",new pm),pl("Link",new Pm);function ru(){this.lq=0,this.F=100,this.ia=10,this.V=0,this.Zh=this.o=this.j=this.u=null}ru.prototype.copy=function(){var a=new ru;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},ru.className="GradPanelSettings";function ca(){this.Pc=[],this.Oc=[],this.j=this.ob=Em,this.hb=this.Hb=0,this.Qp=ds,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}ca.prototype.copy=function(a){for(var y=new ca,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},ca.className="TablePanelSettings";function Ho(a){Dn(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=Lr,this.pa=this.oc=this.oa=0,this.be=null,this.oo=Cv,this.hg=Un,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))}Ho.prototype.copy=function(){var a=new Ho;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=Mn(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=Mn(y.separatorDashArray)),a.background=y.background,a.coversSeparators=y.coversSeparators,a.be=y.be}xt=Ho.prototype,xt.qb=function(a){a.classType===Ho&&(this.sizing=a)},xt.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+ci(this)},xt.wi=function(a){this.Me=a},xt.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)},xt.Wc=function(){var a=0,y=this.Me,x=0,E=this.isRow;if(y!==null&&y.type===De.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)},xt.Ob=function(a,y,x){var E=this.Me;if(E!==null&&(E.cb(uo,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}xt.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new Bo(a,y,x,E):b=a,b.xd=this,a=this.panel,a!==null&&(y=a.ih(),y!==null&&c1(y)&&ce("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+b+" on "+a)),this.be===null&&(this.be=new Pe),this.be.add(b),this},ke.Object.defineProperties(Ho.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&&ti(a,">= 0",Ho,"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&&ti(a,">= 0",Ho,"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))&&ti(a,">= 0",Ho,"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&&ti(a,">= 0",Ho,"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 qn(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&&rc(a,"RowColumnDefinition.separatorStroke"),a instanceof Oi&&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)||ce("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&&rc(a,"RowColumnDefinition.background"),a instanceof Oi&&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}}}),Ho.prototype.computeEffectiveSpacing=Ho.prototype.Wc,Ho.prototype.computeEffectiveSpacingTop=Ho.prototype.Io;var Cv=new he(Ho,"Default",0),_g=new he(Ho,"None",1),Em=new he(Ho,"ProportionalExtra",2);Ho.className="RowColumnDefinition",Ho.Default=Cv,Ho.None=_g,Ho.ProportionalExtra=Em;function Kn(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)}ne(Kn,Jt),Kn.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=Mn(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 gd(a){a.Na===null?a.Na=new Mv:a.Na.nc&&(a.Na=a.Na.copy())}xt=Kn.prototype,xt.th=function(){Jt.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},xt.qb=function(a){a===Ne||a===dn||a===li||a===Un?this.geometryStretch=a:Jt.prototype.qb.call(this,a)},xt.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+ci(this)};function gf(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,Pt,kt=0,Dt=gn(),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),Pt=Math.sqrt(ft*ft+ot*ot),Dt.push([ft,yt,mt,Pt]),kt+=Pt,ot=at,rt=ut;ot=x[0],rt=x[1],ft=E.measuredBounds.width,E instanceof Kn&&(ft-=E.strokeWidth),1>ft&&(ft=1),b=x=ft,at=tt/2,ut=at!==0,Tt=0,Pt=Dt[Tt],ft=Pt[0],yt=Pt[1],mt=Pt[2],Pt=Pt[3];for(var Rt=0;.1<=kt;){if(Rt===0&&(ut?(b=x,b-=at,kt-=at,ut=!1):b=x,b===0&&(b=1)),b>kt){Ye(Dt);return}b>Pt?(Rt=b-Pt,b=Pt):Rt=0;var Gt=Math.sqrt(b*b/(1+mt*mt));if(0>ft&&(Gt=-Gt),ot+=Gt,rt+=mt*Gt,a.translate(ot,rt),a.rotate(yt),a.translate(-(tt/2),-(z/2)),Rt===0&&E.hh(a,y),a.translate(tt/2,z/2),a.rotate(-yt),a.translate(-ot,-rt),kt-=b,Pt-=b,Rt!==0){if(Tt++,Tt===Dt.length){Ye(Dt);return}Pt=Dt[Tt],ft=Pt[0],yt=Pt[1],mt=Pt[2],Pt=Pt[3],b=Rt}}Ye(Dt)}}xt.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&&Co(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===De.Link&&ot instanceof wi&&ot.category==="Selection"&&ot.adornedObject instanceof Kn&&ot.adornedPart.Pb()===ot.adornedObject?ot.adornedObject.strokeWidth:0),rt===0&&(x=null),x!==null&&rt!==0&&(Co(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===Ve.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===Ve.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&&bl(a),a.jk(),ot&&z&&eu(a)),a.Se()}else if(b.type===Ve.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&&bl(a),a.jk(),ot&&z&&eu(a)),a.Se();else if(b.type===Ve.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,Pt=0;Pt<ft;Pt++){var kt=ut[Pt];switch(kt.type){case qo:a.moveTo(kt.endX,kt.endY);break;case to:a.lineTo(kt.endX,kt.endY);break;case kr:a.bezierCurveTo(kt.point1X,kt.point1Y,kt.point2X,kt.point2Y,kt.endX,kt.endY);break;case Us:a.quadraticCurveTo(kt.point1X,kt.point1Y,kt.endX,kt.endY);break;case jo:if(kt.radiusX===kt.radiusY){var Dt=Math.PI/180;a.arc(kt.point1X,kt.point1Y,kt.radiusX,kt.startAngle*Dt,(kt.startAngle+kt.sweepAngle)*Dt,0>kt.sweepAngle,yt!==null?yt.endX:at.startX,yt!==null?yt.endY:at.startY)}else if(yt=As(kt,at),Dt=yt.length,Dt===0)a.lineTo(kt.centerX,kt.centerY);else for(var Tt=0;Tt<Dt;Tt++){var Rt=yt[Tt];Tt===0&&a.lineTo(Rt[0],Rt[1]),a.bezierCurveTo(Rt[2],Rt[3],Rt[4],Rt[5],Rt[6],Rt[7])}break;case oa:if(Tt=Dt=0,yt!==null&&yt.type===jo){if(yt=As(yt,at),Rt=yt.length,Rt===0){a.lineTo(kt.endX,kt.endY);break}yt=yt[Rt-1]||null,yt!==null&&(Dt=yt[6],Tt=yt[7])}else Dt=yt!==null?yt.endX:at.startX,Tt=yt!==null?yt.endY:at.startY;if(yt=va(kt,at,Dt,Tt),Dt=yt.length,Dt===0){a.lineTo(kt.endX,kt.endY);break}for(Tt=0;Tt<Dt;Tt++)Rt=yt[Tt],a.bezierCurveTo(Rt[2],Rt[3],Rt[4],Rt[5],Rt[6],Rt[7]);break;default:ce("Segment not of valid type: "+kt.type)}kt.isClosed&&a.closePath(),yt=kt}ut=at.isFilled,z?at.isShadowed?(ut===!0&&E!=="transparent"&&E!==null&&a.ng(E,at.isEvenOdd),x!==null&&(ut&&ot&&bl(a),a.jk(),ut&&ot&&eu(a))):(bl(a),ut&&E!=="transparent"&&E!==null&&a.ng(E,at.isEvenOdd),x!==null&&a.jk(),eu(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=gn(),z.type===Ve.j)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.endY),gf(a,y,E,x);else if(z.type===Ve.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(Pt=at[ft],Pt.type){case qo:gf(a,y,E,x),E.length=0,E.push(Pt.endX),E.push(Pt.endY),tt=Pt.endX,b=Pt.endY,rt=tt,mt=b;break;case to:E.push(Pt.endX),E.push(Pt.endY),tt=Pt.endX,b=Pt.endY;break;case kr:Qt.Qe(tt,b,Pt.point1X,Pt.point1Y,Pt.point2X,Pt.point2Y,Pt.endX,Pt.endY,.5,E),tt=Pt.endX,b=Pt.endY;break;case Us:Qt.ep(tt,b,Pt.point1X,Pt.point1Y,Pt.endX,Pt.endY,.5,E),tt=Pt.endX,b=Pt.endY;break;case jo:if(kt=As(Pt,ot),yt=kt.length,yt===0){E.push(Pt.centerX),E.push(Pt.centerY),tt=Pt.centerX,b=Pt.centerY;break}for(Dt=0;Dt<yt;Dt++)Tt=kt[Dt],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 oa:if(kt=va(Pt,ot,tt,b),yt=kt.length,yt===0){E.push(Pt.endX),E.push(Pt.endY),tt=Pt.endX,b=Pt.endY;break}for(Dt=0;Dt<yt;Dt++)Tt=kt[Dt],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:ce("Segment not of valid type: "+Pt.type)}Pt.isClosed&&(E.push(rt),E.push(mt),gf(a,y,E,x))}gf(a,y,E,x)}else if(z.type===Ve.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),gf(a,y,E,x);else if(z.type===Ve.F){if(b=new Qo,b.startX=z.endX,b.startY=(z.startY+z.endY)/2,tt=new Mi(jo),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=As(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];gf(a,y,E,x)}Ye(E),a.restore(),a.Vc(!1)}}}},xt.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)},xt.nk=function(a){return this.geometry!==null&&1<this.geometry.figures.length||this.pathPattern!==null?!0:Jt.prototype.nk.call(this,a)},xt.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)}},xt.ga=function(a,y){if(y===void 0&&(y=new It),a instanceof En){a.Mc()&&ce("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},xt.mi=function(a){a===void 0&&(a=new pe);var y=this.naturalBounds,x=this.oe;y=pe.allocAt(y.x,y.y,y.width,y.height);var E=this.strokeWidth;return y.Bc(E/2,E/2),E=It.allocAt(y.x,y.y).transform(x),a.h(E.x,E.y,0,0),E.h(y.right,y.y).transform(x),yo(a,E.x,E.y,0,0),E.h(y.right,y.bottom).transform(x),yo(a,E.x,E.y,0,0),E.h(y.x,y.bottom).transform(x),yo(a,E.x,E.y,0,0),pe.free(y),It.free(E),a},xt.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!==Ve.j||y||(b+=2);var z=pe.alloc();if(z.assign(E),z.Bc(b+2,b+2),!z.ca(a))return pe.free(z),!1;if(E=b+1e-4,x.type===Ve.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:(pe.free(z),Qt.Yb(x.startX,x.startY,x.endX,x.endY,b,a.x,a.y));if(x.type===Ve.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 pe.free(z),!1;z.Bc(E,E)}return this.stroke!==null&&z.Bc(b,b),a=z.ca(a),pe.free(z),a}if(x.type===Ve.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 pe.free(z),!1;tt+=E,b+=E}return this.stroke!==null&&(tt+=E,b+=E),pe.free(z),0>=tt||0>=b?!1:1>=x*x/(tt*tt)+y*y/(b*b)}if(x.type===Ve.o)return pe.free(z),this.fill===null?nh(x,a.x,a.y,b):Yl(x,a,b,1<this.strokeWidth,y);ce("Unknown Geometry type: "+x.type)},xt.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):ce("Unsupported Figure: "+ot)}tt=rt.bounds}ot=tt.width,rt=tt.height,at=tt.width;var ut=tt.height;switch(ps(this,!0)){case Ne:E=x=0;break;case Te:at=Math.max(a-z,0),ut=Math.max(y-z,0);break;case pn:at=Math.max(a-z,0),E=0;break;case bn: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 Ne:break;case Te:ot=at,rt=ut;break;case dn:x=Math.min(at/ot,ut/rt),isFinite(x)||(x=1),ot*=x,rt*=x;break;default:ce(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=Kn.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===Un?Te:y:y===Un?kv[a.figure].defaultStretch:y}xt.eh=function(a,y,x,E){Wr(this,a,y,x,E)},xt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},xt.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===Ve.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=gn(),a=new It,Qt.Ve(at.startX+E,at.startY+ut,at.endX+E,at.endY+ut,z,tt,ot,rt,a)&&y.push(a),a=new It,Qt.Ve(at.startX-E,at.startY-ut,at.endX-E,at.endY-ut,z,tt,ot,rt,a)&&y.push(a),a=new It,Qt.Ve(at.startX+E,at.startY+ut,at.startX-E,at.startY-ut,z,tt,ot,rt,a)&&y.push(a),a=new It,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 Ye(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);Ye(y)}else if(at.type===Ve.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===Ve.F){y=pe.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}pe.free(y)}else if(at.type===Ve.o){mt=It.alloc();var Pt=ot-z,kt=rt-tt,Dt=Pt*Pt+kt*kt,Tt=z,Rt=tt;if(0<Dt&&yt.contains(Tt,Rt)&&(mt.x=Tt,mt.y=Rt,this.ca(mt)))for(Pt!==0&&.5>Math.abs(Pt)?(kt*=.5/Pt,Pt=.5):kt!==0&&.5>Math.abs(kt)&&(Pt*=.5/kt,kt=.5),Tt-=Pt,Rt-=kt;yt.contains(Tt,Rt);)Tt-=Pt,Rt-=kt;for(b.x=ot,b.y=rt,kt=0;kt<at.figures.count;kt++){var Gt=at.figures.s[kt],Vt=Gt.isFilled?Tt:z,Xt=Gt.isFilled?Rt:tt,ie=Gt.segments;yt=Gt.startX,Pt=Gt.startY;for(var Xe=yt,an=Pt,on=0;on<ie.count;on++){var je=ie.s[on],Me=je.type,Wn=je.endX,jn=je.endY,Ei=!1;switch(Me){case qo:Xe=Wn,an=jn;break;case to:Ei=Nm(yt,Pt,Wn,jn,Vt,Xt,ot,rt,mt);break;case kr:Ei=Qt.Eo(yt,Pt,je.point1X,je.point1Y,je.point2X,je.point2Y,Wn,jn,Vt,Xt,ot,rt,.6,mt);break;case Us:Ei=Qt.Eo(yt,Pt,yt+2/3*(je.point1X-yt),Pt+2/3*(je.point1Y-Pt),Wn+2/3*(je.point1X-Wn),jn+2/3*(je.point1Y-jn),Wn,jn,Vt,Xt,ot,rt,.6,mt);break;case jo:case oa:Me=je.type===jo?As(je,Gt):va(je,Gt,yt,Pt);var Xi=Me.length;if(Xi===0){Ei=Nm(yt,Pt,je.type===jo?je.centerX:je.endX,je.type===jo?je.centerY:je.endY,Vt,Xt,ot,rt,mt);break}for(jn=null,Wn=0;Wn<Xi;Wn++){if(jn=Me[Wn],Wn===0&&Nm(yt,Pt,jn[0],jn[1],Vt,Xt,ot,rt,mt)){var tr=Fm(Vt,Xt,mt,Dt,b);tr<Dt&&(Dt=tr,ut=!0)}Qt.Eo(jn[0],jn[1],jn[2],jn[3],jn[4],jn[5],jn[6],jn[7],Vt,Xt,ot,rt,.6,mt)&&(tr=Fm(Vt,Xt,mt,Dt,b),tr<Dt&&(Dt=tr,ut=!0))}Wn=jn[6],jn=jn[7];break;default:ce("Unknown Segment type: "+Me)}yt=Wn,Pt=jn,Ei&&(Ei=Fm(Vt,Xt,mt,Dt,b),Ei<Dt&&(Dt=Ei,ut=!0)),je.isClosed&&(Wn=Xe,jn=an,Nm(yt,Pt,Wn,jn,Vt,Xt,ot,rt,mt)&&(je=Fm(Vt,Xt,mt,Dt,b),je<Dt&&(Dt=je,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,It.free(mt)}else ce("Unknown Geometry type: "+at.type);return ut?(this.transform.Ga(b),!0):!1};function Fm(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 Nm(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)}xt.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=It.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)))),It.free(z),b},xt.Yc=function(a,y){if(this.fh(a,y)||y===void 0&&(y=this.transform,a.Re(this.actualBounds)))return!0;var x=oi.alloc();x.set(y),x.Vj();var E=a.left,b=a.right,z=a.top;a=a.bottom;var tt=It.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 It.free(tt),!0;var ot=It.alloc(),rt=It.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,pd(this,tt,ot,rt)?y=!0:(tt.x=b,tt.y=a,tt.transform(x),pd(this,tt,ot,rt)?y=!0:(ot.x=E,ot.y=a,ot.transform(x),pd(this,tt,ot,rt)?y=!0:(tt.x=E,tt.y=z,tt.transform(x),pd(this,tt,ot,rt)&&(y=!0)))),It.free(tt),oi.free(x),It.free(ot),It.free(rt),y};function pd(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)}xt.tx=function(a,y,x){function E(Dt,Tt){for(var Rt=Dt.length,Gt=0;Gt<Rt;Gt+=2)if(Tt.zd(Dt[Gt],Dt[Gt+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,ai(a.x,a.y,ot,rt)<=b&&ai(a.x,a.y,at,rt)<=b&&ai(a.x,a.y,ot,tt)<=b&&ai(a.x,a.y,at,tt)<=b)return!0}if(ot=y.startX,rt=y.startY,at=y.endX,tt=y.endY,y.type===Ve.j){if(x=(ot-at)*(a.x-at)+(rt-tt)*(a.y-tt),Jo(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===Ve.u)return y=!1,x&&(y=Jo(a.x,a.y,ot,rt,ot,tt)<=b||Jo(a.x,a.y,ot,rt,at,rt)<=b||Jo(a.x,a.y,at,rt,at,tt)<=b||Jo(a.x,a.y,ot,tt,at,tt)<=b),y;if(y.type===Ve.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 Jo(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!(ai(y,z,-ut,0)>=b||ai(y,z,0,-ft)>=b||ai(y,z,0,ft)>=b||ai(y,z,ut,0)>=b)}else if(y.type===Ve.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&&Jo(a.x,a.y,z,ot,z,at)>b&&Jo(a.x,a.y,z,ot,rt,ot)>b&&Jo(a.x,a.y,rt,at,z,at)>b&&Jo(a.x,a.y,rt,at,rt,ot)>b)return!1;if(z=Math.sqrt(b),x){if(this.fill===null?nh(y,a.x,a.y,z):Yl(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 qo:case to:if(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b)return!1;break;case kr:var mt=gn();if(Qt.Qe(tt,ut,ft.point1X,ft.point1Y,ft.point2X,ft.point2Y,ft.endX,ft.endY,.8,mt),tt=E(mt,a),Ye(mt),tt||(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b))return!1;break;case Us:if(mt=gn(),Qt.ep(tt,ut,ft.point1X,ft.point1Y,ft.endX,ft.endY,.8,mt),tt=E(mt,a),Ye(mt),tt||(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b))return!1;break;case jo:case oa:mt=ft.type===jo?As(ft,z):va(ft,z,tt,ut);var yt=mt.length;if(yt===0){if(tt=ft.type===jo?ft.centerX:ft.endX,ut=ft.type===jo?ft.centerY:ft.endY,a.zd(tt,ut)>b)return!1;break}ft=null;for(var Pt=gn(),kt=0;kt<yt;kt++)if(ft=mt[kt],Pt.length=0,Qt.Qe(ft[0],ft[1],ft[2],ft[3],ft[4],ft[5],ft[6],ft[7],.8,Pt),E(Pt,a))return Ye(Pt),!1;Ye(Pt),ft!==null&&(tt=ft[6],ut=ft[7]);break;default:ce("Unknown Segment type: "+ft.type)}}return!0}}}return!1},xt.qc=function(){this.ua=null},xt.kq=function(){return this.ig};function m1(a){var y=a.diagram;y!==null&&y.undoManager.isUndoingRedoing||(a.segmentOrientation=Zg,a.toArrow!=="None"?(a.segmentIndex=-1,a.alignmentFocus=zr):a.fromArrow!=="None"&&(a.segmentIndex=0,a.alignmentFocus=new En(1-zr.x,zr.y)))}Kn.makeGeometry=function(a,y,x){if(a.toArrow!=="None")var E=Al[a.toArrow];else a.fromArrow!=="None"?E=Al[a.fromArrow]:(E=Qt.Ze[a.figure],typeof E=="string"&&(E=Qt.Ze[E]),E===void 0&&ce("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 v1(a){var y=Al[a];if(y===void 0){var x=a.toLowerCase();if(x==="none")return"None";if(y=Al[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=Ve.parse(Qt.um[E],!1),Al[E]=a,x!==E&&(Al[x]=E),E}}return typeof y=="string"?y:y instanceof Ve?a:null}ke.Object.defineProperties(Kn.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&&no(this,a,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(a){a=Ve.parse(a);var y=a.normalize();this.geometry=a,this.position=a=It.allocAt(-y.x,-y.y),It.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&&rc(a,"Shape.fill"),a instanceof Oi&&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&&rc(a,"Shape.stroke"),a instanceof Oi&&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 ti(a,"value >= 0",Kn,"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"?ti(a,'"butt", "round", or "square"',Kn,"strokeCap"):(gd(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"?ti(a,'"miter", "bevel", or "round"',Kn,"strokeJoin"):(gd(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){gd(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)||ce("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&&(gd(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()])||ce("Unknown Shape.figure: "+a),y!==x&&(a=this.part,a!==null&&(a.ag=NaN),this.an=x,this.Rd=null,this.qc(),this.v(),this.g("figure",y,x))}}},toArrow:{get:function(){return this.Ua!==null?this.Ua.V:"None"},set:function(a){var y=this.toArrow;if(a===!0?a="Standard":a===!1&&(a=""),y!==a){var x=v1(a);x===null?ce("Unknown Shape.toArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new Ph),this.Ua.V=x,this.Rd=null,this.qc(),this.v(),m1(this),this.g("toArrow",y,x))}}},fromArrow:{get:function(){return this.Ua!==null?this.Ua.j:"None"},set:function(a){var y=this.fromArrow;if(a===!0?a="Standard":a===!1&&(a=""),y!==a){var x=v1(a);x===null?ce("Unknown Shape.fromArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new Ph),this.Ua.j=x,this.Rd=null,this.qc(),this.v(),m1(this),this.g("fromArrow",y,x))}}},spot1:{get:function(){return this.Na!==null?this.Na.fg:Lr},set:function(a){var y=this.spot1;y.D(a)||(a=a.J(),gd(this),this.Na.fg=a,this.v(),this.g("spot1",y,a))}},spot2:{get:function(){return this.Na!==null?this.Na.gg:Lr},set:function(a){var y=this.spot2;y.D(a)||(a=a.J(),gd(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&&(gd(this),this.Na.br=a,this.N(),this.g("pathPattern",y,a))}},geometryStretch:{get:function(){return this.Na!==null?this.Na.jq:Un},set:function(a){var y=this.geometryStretch;y!==a&&(gd(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 Bl),this.fa.Tk=a;var x=this.diagram;x!==null&&this.panel===x.grid&&cl(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 Bl),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 Bl),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 Bl),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}}}),Kn.prototype.intersectsRect=Kn.prototype.Yc,Kn.prototype.containedInRect=Kn.prototype.fh,Kn.prototype.getNearestIntersectionPoint=Kn.prototype.rs,Kn.prototype.getDocumentBounds=Kn.prototype.mi,Kn.prototype.getDocumentPoint=Kn.prototype.ga;var Al=new zn,kv=new zn;Kn.className="Shape",Kn.getFigureGenerators=function(){var a=new ln,y;for(y in Qt.Ze)y!==y.toLowerCase()&&a.add(y,Qt.Ze[y]);return a.freeze(),a},Kn.defineFigureGenerator=function(a,y){var x=a.toLowerCase(),E=Qt.Ze;E[a]=y,E[x]=a},Kn.getArrowheadGeometries=function(){var a=new ln;for(E in Qt.um)if(Al[E]===void 0){var y=Ve.parse(Qt.um[E],!1);Al[E]=y,y=E.toLowerCase(),y!==E&&(Al[y]=E)}for(var x in Al)if(x!==x.toLowerCase()){var E=Al[x];E instanceof Ve&&a.add(x,E)}return a.freeze(),a},Kn.defineArrowheadGeometry=function(a,y){var x=null;typeof y=="string"?x=Ve.parse(y,!1):x=y,y=a.toLowerCase(),y!=="none"&&a!==y||ce("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var E=Al;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=Un,this.gg=this.fg=Lr}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 Zi(a,y){return Jt.call(this),Dm||(ms=xo?new wa(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}ne(Zi,Jt),Zi.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 ml(a){a.da===null?a.da=new Bv:a.da.nc&&(a.da=a.da.copy())}xt=Zi.prototype,xt.th=function(){Jt.prototype.th.call(this),this.da!==null&&(this.da.nc=!0)};function y1(a,y){a.l=y.l|6144,a.pb=y.opacity,a.Ma=y.background,a.areaBackground=y.areaBackground,a.jd=y.desiredSize.J(),a.minSize=y.minSize.J(),a.maxSize=y.maxSize.J(),y.Lb!==null?a.Lb=y.Lb.copy():a.Lb=null,a.Ca=y.scale,a.Kb=y.angle,a.stretch=y.stretch,a.Kg=y.margin.J(),a.Jb=y.alignment.J(),a.sk=y.alignmentFocus.J(),a.segmentFraction=y.segmentFraction,a.segmentOffset=y.segmentOffset.J(),a.segmentOrientation=y.segmentOrientation,y.tb!==null&&(a.tb=y.tb.copy()),a.shadowVisible=y.shadowVisible,a.ec=y.ec,a.xc=y.xc,a.Ae=y.Ae,a.fa!==null&&(a.fa=y.fa.copy()),y.da!==null&&(a.da=y.da.nc?y.da:y.da.copy()),a.Ih=y.Ih}xt.qb=function(a){a.classType===Zi?this.wrap=a:Jt.prototype.qb.call(this,a)},xt.toString=function(){return 22<this.ec.length?'TextBlock("'+this.ec.substring(0,20)+'"...)':'TextBlock("'+this.ec+'")'},xt.v=function(){Jt.prototype.v.call(this)},xt.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=Hg(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;Co(this,a,this.xc,!0,!1,x,E),(rt||at)&&Co(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 Os&&(x=!1),y.Gf("textGreeking")===!1&&(x=!1),y=this.spacingAbove,ft=this.spacingBelow,this.flip){case vi:a.translate(b,0),a.scale(-1,1);break;case ni:a.translate(0,z),a.scale(1,-1);break;case _i: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 vi:a.scale(-1,1),a.translate(-b,0);break;case ni:a.scale(1,-1),a.translate(0,-z);break;case _i:a.scale(-1,-1),a.translate(-b,-z)}}},xt.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=bm!==null?bm(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 Os&&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 Os&&y.ad.classList.add("gojs-td"))}},xt.kk=function(a,y,x){if(!Jt.prototype.kk.call(this,a,y,x))return!1;if(Co(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},xt.nk=function(a){return 1<this.lineCount||this.isUnderline||this.isStrikethrough?!0:Jt.prototype.nk.call(this,a)},xt.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)}},xt.Wl=function(a,y,x,E){var b=this.Gc;this.Ih=a,this.l&=-16777217;var z=this.Ae;ms!==null&&k1!==z&&(k1=ms.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===Wg&&(ot=ot.trim()),tt=Math.max(tt,ja(ot)),ot=at+1}z=tt}else tt=z.indexOf(`
`,0),0<=tt&&(z=z.substr(0,tt)),z=ja(z);z=Math.min(z,a/this.scale)}else z=this.desiredSize.width;if(this.panel!==null&&(z=Math.min(z,this.panel.maxSize.width)),tt=x1(this,z),isNaN(this.desiredSize.height)?tt=Math.min(tt,y/this.scale):tt=this.desiredSize.height,rt=tt,this.Cb!==0&&this.Qc!==null&&this.Qb!==null&&this.overflow===Am&&(y=this.Ae,y=this.overflow===Am?S1(y):0,at=this.spacingAbove+this.spacingBelow,at=Math.max(0,Hg(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);ja(at)>y&&1<at.length;)at=at.substr(0,at.length-1);at+=Vg,y=ja(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===P1||isNaN(this.desiredSize.width))&&(z=isNaN(a)?this.Cb:Math.min(a,this.Cb)),z=Math.max(x,z),tt=Math.max(E,tt),Vo(this.dc,z,tt),this.Ge(0,0,z,tt),this.svg!==null&&b!==this.Gc&&(this.Uc=!0)},xt.eh=function(a,y,x,E){Wr(this,a,y,x,E)};function Gg(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===Wg;b&&(y=y.trim());var z=0,tt=a.Ae,ot=a.spacingAbove+a.spacingBelow;ot=Math.max(0,Hg(a)+ot);var rt=a.overflow===Am?S1(tt):0;if(a.Gc>=a.maxLines)E!==null&&E.h(0,ot);else if(tt=y,a.wrap===Fv){a.Le=1;var at=ja(y);if(rt===0||at<=x)a.Cb=Math.max(a.Cb,at),Gg(a,y,a.Cb),E!==null&&E.h(at,ot);else{for(z=pf(a,tt),tt=tt.substr(z.length),y=pf(a,tt),at=ja(z+y);0<y.length&&at<=x;)z+=y,tt=tt.substr(y.length),y=pf(a,tt),at=z+y,b&&(at=at.trim()),at=ja(at);for(b&&(y=y.trim()),z+=y,x=Math.max(1,x-rt);ja(z)>x&&1<z.length;)z=z.substr(0,z.length-1);a.l|=16777216,z+=Vg;var ut=ja(z);a.Cb=ut,Gg(a,z,ut),E!==null&&E.h(ut,ot)}}else{for(rt=0,tt.length===0&&(rt=1,Gg(a,tt,0));0<tt.length;){for(y=pf(a,tt),tt=tt.substr(y.length);ja(y)>x;){var ft=1;for(at=ja(y.substr(0,ft)),ut=0;at<=x;)ft++,ut=at,at=ja(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),Gg(a,y.substr(0,ft),mt),rt++,y=y.substr(ft),a.Gc+rt>a.maxLines)break}for(ut=pf(a,tt),at=ja(y+ut);0<ut.length&&at<=x;)y+=ut,tt=tt.substr(ut.length),ut=pf(a,tt),at=y+ut,b&&(at=at.trim()),at=ja(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=ja(y),z=Math.max(z,ut)),Gg(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 pf(a,y){if(a.wrap===w1)return y.substr(0,1);for(var x=y.length,E=0,b=Sx;E<x&&!b.test(y.charAt(E));)E++;for(a.formatting===C1&&(x=Math.min(x,E+1));E<x&&b.test(y.charAt(E));)E++;return E>=y.length?y:y.substr(0,E)}function ja(a){return ms===null?8*a.length:ms.measureText(a).width}function Hg(a){if(a.df!==null)return a.df;var y=a.Ae;if(ms===null){var x=16;return a.df=x}return Tv[y]!==void 0&&5e3>L1?x=Tv[y]:(x=1.3*ms.measureText("M").width,Tv[y]=x,L1++),a.df=x}function S1(a){if(ms===null)return 6;if(Bm[a]!==void 0&&5e3>Av)var y=Bm[a];else y=ms.measureText(Vg).width,Bm[a]=y,Av++;return y}function x1(a,y){var x=a.ec.replace(/\r\n/g,`
`).replace(/\r/g,`
`),E=a.spacingAbove+a.spacingBelow;if(E=Math.max(0,Hg(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!==Fv){a.Le=0;var rt=Ke.alloc();Ev(a,z,y,rt),b+=rt.height,Ke.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}ke.Object.defineProperties(Zi.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"||(ml(this),this.da.Or=a,this.N(),this.g("textAlign",y,a))}},flip:{get:function(){return this.da!==null?this.da.Xf:Ne},set:function(a){var y=this.flip;y!==a&&(ml(this),this.da.Xf=a,this.N(),this.g("flip",y,a))}},verticalAlignment:{get:function(){return this.da!==null?this.da.Yr:Td},set:function(a){var y=this.verticalAlignment;y.D(a)||(a=a.J(),ml(this),this.da.Yr=a,$r(this),this.g("verticalAlignment",y,a))}},naturalBounds:{get:function(){if(!this.dc.w()){var a=Ke.alloc();Ev(this,this.ec,999999,a);var y=a.width;Ke.free(a),a=x1(this,y);var x=this.desiredSize;isNaN(x.width)||(y=x.width),isNaN(x.height)||(a=x.height),Vo(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:Nv},set:function(a){var y=this.wrap;y!==a&&(ml(this),this.da.$r=a,this.v(),this.g("wrap",y,a))}},overflow:{get:function(){return this.da!==null?this.da.$q:bv},set:function(a){var y=this.overflow;y!==a&&(ml(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&&rc(a,"TextBlock.stroke"),a instanceof Oi&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},lineCount:{get:function(){return this.Gc}},lineHeight:{get:function(){return Hg(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&&(ml(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&&(ml(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 Bl),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 Bl),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 Bl),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 Bl),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 Bl),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&&(ml(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&&(ml(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&&(ml(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&&(ml(this),this.da.Er=a,this.v(),this.g("spacingBelow",y,a))}},formatting:{get:function(){return this.da!==null?this.da.gq:Wg},set:function(a){var y=this.formatting;y!==a&&(ml(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&&ti(a,"> 0",Zi,"maxLines"),ml(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 bm=null,Tm=null,Fv=new he(Zi,"None",0),P1=new he(Zi,"WrapFit",1),Nv=new he(Zi,"WrapDesiredSize",2),w1=new he(Zi,"WrapBreakAll",3),bv=new he(Zi,"OverflowClip",0),Am=new he(Zi,"OverflowEllipsis",1),Wg=new he(Zi,"FormatTrim",0),C1=new he(Zi,"FormatNone",0),Sx=/[ \u200b\u00ad]/,Tv=new zn,L1=0,Bm=new zn,Av=0,Vg="...",k1="",ms=null,Dm=!1;Zi.className="TextBlock";function Bv(){this.nc=!1,this.Hd=null,this.Xf=Ne,this.gq=Wg,this.Jq=1/0,this.$q=bv,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=Td,this.$r=Nv}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},Zi.getEllipsis=function(){return Vg},Zi.setEllipsis=function(a){Vg=a,Bm=new zn,Av=0},Zi.getBaseline=function(){return bm},Zi.setBaseline=function(a){bm=a},Zi.getUnderline=function(){return Tm},Zi.setUnderline=function(a){Tm=a},Zi.isValidFont=function(a){if(Dm||(ms=xo?new wa(null).context:null,Dm=!0),ms===null)return!0;var y=ms.font;if(a===y||a==="10px sans-serif")return!0;ms.font="10px sans-serif",ms.font=a;var x=ms.font;if(x!=="10px sans-serif")return ms.font=y,!0;ms.font="19px serif";var E=ms.font;return ms.font=a,x=ms.font,ms.font=y,x!==E},Zi.FormatNone=C1,Zi.FormatTrim=Wg,Zi.None=Fv,Zi.OverflowClip=bv,Zi.OverflowEllipsis=Am,Zi.WrapBreakAll=w1,Zi.WrapDesiredSize=Nv,Zi.WrapFit=P1;function Bl(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}Bl.prototype.copy=function(){var a=new Bl;return a.Tk=this.Tk,a.u=this.u,a.j=this.j,a.F=this.F,a.o=this.o,a},Bl.className="GradElementSettings";function vs(a,y){Jt.call(this),this.Eg=null,this.qo="",this.Xg=wo,this.Nk=Te,this.Zg=this.Hd=null,this.Mk=Di,this.Xf=Ne,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 mf;ne(vs,Jt),vs.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},vs.prototype.qb=function(a){a===Ne||a===dn||a===li?this.imageStretch=a:Jt.prototype.qb.call(this,a)},vs.prototype.toString=function(){return"Picture("+this.source+")#"+ci(this)};function vf(a){a===void 0&&(a=""),a!==""?mf[a]&&(delete mf[a],Om--):(mf=new zn,Om=0)}function M1(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()||(Go(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=gn();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);Ye(z)}}y.Bg.clear()}},y.addEventListener("load",y.Fq),y.addEventListener("error",y.Yp),y.qy=!0)}vs.prototype.hA=function(){if(this.source!==""){vf(this.source);var a=this.source;this.source="",this.source=a}},vs.prototype.redraw=function(){this.N(),this.Uc=!0},vs.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 cd)){var b=a instanceof Os;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,Pt=this.Mk;switch(yt){case Ne:if(this.sourceRect.w())break;ft>=E.width&&(z=z+Pt.offsetX+(ft*Pt.x-E.width*Pt.x)),mt>=E.height&&(tt=tt+Pt.offsetY+(mt*Pt.y-E.height*Pt.y)),rt=Math.min(E.width,ft),ot=Math.min(E.height,mt);break;case Te:ft=E.width,mt=E.height;break;case dn:case li:yt===dn?(yt=Math.min(E.height/mt,E.width/ft),ft*=yt,mt*=yt):yt===li&&(yt=Math.max(E.height/mt,E.width/ft),ft*=yt,mt*=yt,ft>=E.width&&(z=(z+Pt.offsetX+(ft*Pt.x-E.width*Pt.x)/ft)*rt),mt>=E.height&&(tt=(tt+Pt.offsetY+(mt*Pt.y-E.height*Pt.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 kt=ft*yt*mt*yt,Dt=rt*ot/kt,Tt=x.__goCache;yt=null;var Rt=xx;if(!b){if(x.sq&&Tt!==void 0&&4<kt&&Dt>Rt*Rt)for(Tt.gi===null&&(F1(Tt,4,at,ut,x),F1(Tt,16,at,ut,x)),b=Tt.gi,at=b.length,ut=0;ut<at&&b[ut].ratio*b[ut].ratio<Dt;ut++)yt=b[ut];if(!y.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{b=new wa(null).context;try{b.drawImage(this.Eg,0,0)}catch(Gt){this.en=!1}try{b.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(Gt){this.vl=!0}}if(this.vl)return}}switch(b=ft<E.width?Pt.offsetX+(E.width*Pt.x-ft*Pt.x):0,Pt=mt<E.height?Pt.offsetY+(E.height*Pt.y-mt*Pt.y):0,this.flip){case vi:a.translate(Math.min(E.width,ft),0),a.scale(-1,1);break;case ni:a.translate(0,Math.min(E.height,mt)),a.scale(1,-1);break;case _i: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,Pt,Math.min(E.width,ft),Math.min(E.height,mt)),a instanceof Os&&(this.bt=[z/y,tt/y,Math.min(yt.source.width,rt/y),Math.min(yt.source.height,ot/y),b,Pt,Math.min(E.width,ft),Math.min(E.height,mt)])}catch(Gt){this.en=!1}a.restore()}else try{a.drawImage(x,z,tt,rt,ot,b,Pt,Math.min(E.width,ft),Math.min(E.height,mt)),a instanceof Os&&(this.bt=[z,tt,rt,ot,b,Pt,Math.min(E.width,ft),Math.min(E.height,mt)])}catch(Gt){this.en=!1}switch(this.flip){case vi:a.scale(-1,1),a.translate(-Math.min(E.width,ft),0);break;case ni:a.scale(1,-1),a.translate(0,-Math.min(E.height,mt));break;case _i:a.scale(-1,-1),a.translate(-Math.min(E.width,ft),-Math.min(E.height,mt))}}}}},vs.prototype.Wl=function(a,y,x,E){var b=this.desiredSize,z=ps(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===Te||z===pn?(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===Te||z===bn?(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)),Vo(this.dc,a,y),this.Ge(0,0,a,y)},vs.prototype.eh=function(a,y,x,E){Wr(this,a,y,x,E)},ke.Object.defineProperties(vs.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||ce("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);var E=this.diagram;E!==null&&Cg(E,this),this.Eg=a,a!==null&&x&&a.Bg===void 0&&(a.Bg=new Fe),E!==null&&x&&yh(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()||(Go(this,!1),this.v())):x&&M1(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=mf;if(xo){var E=null;if(x[a]!==void 0)E=x[a];else if(a!==""){30<Om&&(vf(),x=mf),E=Qe("img"),E.hn=!0,M1(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 E1),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}}}),vs.prototype.redraw=vs.prototype.redraw,vs.prototype.reloadSource=vs.prototype.hA;var Om=0,xx=4;vs.className="Picture",mf=new zn,vs.clearCache=vf;function E1(){this.gi=null}function F1(a,y,x,E,b){a.gi===null&&(a.gi=[]);var z=new wa(null),tt=z.context,ot=1/y;z.width=x/y,z.height=E/y,z.width!==0&&z.height!==0&&(y=new N1(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))}E1.className="PictureCacheArray";function N1(a,y){this.source=a,this.ratio=y}N1.className="PictureCacheInstance";function yf(){this.os=new Ve,this.mc=null}yf.prototype.reset=function(a){a!==null?(a.ka(),this.os=a,a.figures.clear()):this.os=new Ve,this.mc=null};function Sf(a,y,x,E,b,z){a.mc=new Qo,a.mc.startX=y,a.mc.startY=x,a.mc.isFilled=E,a.mc.isEvenOdd=z||!1,a.os.figures.add(a.mc),b!==void 0&&(a.mc.isShadowed=b)}function Px(a){var y=a.mc.segments.length;0<y&&a.mc.segments.M(y-1).close()}yf.prototype.moveTo=function(a,y,x){x===void 0&&(x=!1);var E=new Mi(qo);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)},yf.prototype.lineTo=function(a,y,x){x===void 0&&(x=!1);var E=new Mi(to);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 Mi(kr);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 Mi(Us);tt.point1X=y,tt.point1Y=x,tt.endX=E,tt.endY=b,z&&tt.close(),a.mc.segments.add(tt)}yf.prototype.arcTo=function(a,y,x,E,b,z,tt){z===void 0&&(z=0),tt===void 0&&(tt=!1);var ot=new Mi(jo);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 wx(a,y,x,E,b,z,tt,ot){var rt;rt===void 0&&(rt=!1),y=new Mi(oa,tt,ot,y,x,E,b,z),rt&&y.close(),a.mc.segments.add(y)}function b1(a){var y=jm;return y!==null?(jm=null,y.reset(a),y):(y=new yf,y.reset(a),y)}var jm=null;yf.className="StreamGeometryContext";function Or(a,y){var x=a.toLowerCase(),E=Qt.Ze;E[a]=y,E[x]=a}Or("Rectangle",function(a,y,x){a="r"+y+","+x;var E=Qt.Mf[a];return E!==void 0||(E=new Ve(Ve.u),E.endX=y,E.endY=x,Qt.Nf<Qt.vm&&(Qt.Mf[a]=E,Qt.Nf++)),E}),Or("Square",function(a,y,x){a="s"+y+","+x;var E=Qt.Mf[a];return E!==void 0||(E=new Ve(Ve.u),E.endX=y,E.endY=x,E.defaultStretch=dn,Qt.Nf<Qt.vm&&(Qt.Mf[a]=E,Qt.Nf++)),E}),Or("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 Ve().add(new Qo(a,0,!0).add(new Mi(to,y-a,0)).add(new Mi(kr,y,a,y-z,0,y,z)).add(new Mi(to,y,x-a)).add(new Mi(kr,y-a,x,y,x-z,y-z,x)).add(new Mi(to,a,x)).add(new Mi(kr,0,x-a,z,x,0,x-z)).add(new Mi(to,0,a)).add(new Mi(kr,a,0,0,z,z,0).close())),1<z&&(b.spot1=new En(0,0,z,z),b.spot2=new En(1,1,-z,-z)),Qt.Nf<Qt.vm&&(Qt.Mf[E]=b,Qt.Nf++),b}),Or("Border","RoundedRectangle"),Or("Ellipse",function(a,y,x){a="e"+y+","+x;var E=Qt.Mf[a];return E!==void 0||(E=new Ve(Ve.F),E.endX=y,E.endY=x,E.spot1=Nc,E.spot2=Ad,Qt.Nf<Qt.vm&&(Qt.Mf[a]=E,Qt.Nf++)),E}),Or("Circle",function(a,y,x){a="c"+y+","+x;var E=Qt.Mf[a];return E!==void 0||(E=new Ve(Ve.F),E.endX=y,E.endY=x,E.spot1=Nc,E.spot2=Ad,E.defaultStretch=dn,Qt.Nf<Qt.vm&&(Qt.Mf[a]=E,Qt.Nf++)),E}),Or("TriangleRight",function(a,y,x){return new Ve().add(new Qo(0,0).add(new Mi(to,y,.5*x)).add(new Mi(to,0,x).close())).pm(0,.25,.5,.75)}),Or("TriangleDown",function(a,y,x){return new Ve().add(new Qo(0,0).add(new Mi(to,y,0)).add(new Mi(to,.5*y,x).close())).pm(.25,0,.75,.5)}),Or("TriangleLeft",function(a,y,x){return new Ve().add(new Qo(y,x).add(new Mi(to,0,.5*x)).add(new Mi(to,y,0).close())).pm(.5,.25,1,.75)}),Or("TriangleUp",function(a,y,x){return new Ve().add(new Qo(y,x).add(new Mi(to,0,x)).add(new Mi(to,.5*y,0).close())).pm(.25,.5,.75,1)}),Or("Triangle","TriangleUp"),Or("Diamond",function(a,y,x){return new Ve().add(new Qo(.5*y,0).add(new Mi(to,0,.5*x)).add(new Mi(to,.5*y,x)).add(new Mi(to,y,.5*x).close())).pm(.25,.25,.75,.75)}),Or("LineH",function(a,y,x){return a=new Ve(Ve.j),a.startX=0,a.startY=x/2,a.endX=y,a.endY=x/2,a}),Or("LineV",function(a,y,x){return a=new Ve(Ve.j),a.startX=y/2,a.startY=0,a.endX=y/2,a.endY=x,a}),Or("None","Rectangle"),Or("BarH","Rectangle"),Or("BarV","Rectangle"),Or("MinusLine","LineH"),Or("PlusLine",function(a,y,x){return new Ve().add(new Qo(0,x/2,!1).add(new Mi(to,y,x/2)).add(new Mi(qo,y/2,0)).add(new Mi(to,y/2,x)))}),Or("XLine",function(a,y,x){return new Ve().add(new Qo(0,x,!1).add(new Mi(to,y,0)).add(new Mi(qo,0,0)).add(new Mi(to,y,x)))}),Or("LineRight",function(a,y,x){return new Ve().add(new Qo(.25*y,0,!1).add(new Mi(to,.75*y,.5*x)).add(new Mi(to,.25*y,x)))}),Or("LineDown",function(a,y,x){return new Ve().add(new Qo(0,.25*x,!1).add(new Mi(to,.5*y,.75*x)).add(new Mi(to,y,.25*x)))}),Or("LineLeft",function(a,y,x){return new Ve().add(new Qo(.75*y,0,!1).add(new Mi(to,.25*y,.5*x)).add(new Mi(to,.75*y,x)))}),Or("LineUp",function(a,y,x){return new Ve().add(new Qo(0,.75*x,!1).add(new Mi(to,.5*y,.25*x)).add(new Mi(to,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=hs,this.ir=null,this.jr="",this.lr=Lr,this.Gq="",this.Hq=Cr,this.Pq=xs,this.Kq=ta,this.Up=null,this.Cq=127,this.zr=Ps,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 kn(a,y){a===void 0||a instanceof Yo||typeof a=="string"?De.call(this,a):(De.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 It(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new pe,this.Rh=null,this.ag=NaN,y&&Object.assign(this,y)}ne(kn,De),kn.prototype.cloneProtected=function(a){De.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},xt=kn.prototype,xt.Af=function(a){De.prototype.Af.call(this,a),a.oh(),a.Ug=null,a.nf=null,a.Rh=null},xt.toString=function(){var a=xe(this.constructor)+"#"+ci(this);return this.data!==null&&(a+="("+ei(this.data)+")"),a};function ys(a){a.P===null?a.P=new Dv:a.P.nc&&(a.P=a.P.copy())}xt.th=function(){De.prototype.th.call(this),this.P!==null&&(this.P.nc=!0)},xt.gk=function(a,y,x,E,b,z,tt){var ot=this.diagram;ot!==null&&(a===bo&&y==="elements"?b instanceof De?fd(b,function(rt){ay(ot.partManager,rt),rd(ot,rt)}):yh(ot,b):a===Uo&&y==="elements"&&(b instanceof De?fd(b,function(rt){ly(ot.partManager,rt,ot)}):Cg(ot,b)),ot.cb(a,y,x,E,b,z,tt))},xt.La=function(a){if(De.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 De&&fd(b,function(z){z.data!==null&&z.La()})}for(y=this.adornments;y.next();)y.value.La(a)}},kn.prototype.updateRelationshipsFromData=function(){var a;this.data!==null&&((a=this.diagram)===null||a===void 0||a.partManager.updateRelationshipsFromData(this))},kn.prototype.Pj=function(a){var y=this.Qf;return y===null?null:y.I(a)},kn.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 ln),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)))}}},kn.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)}},kn.prototype.Ej=function(){var a=this.Qf;if(a!==null){var y=gn();for(a=a.iterator;a.next();)y.push(a.key);a=y.length;for(var x=0;x<a;x++)this.Jf(y[x]);Ye(y)}},kn.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 Vn?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate),!(x instanceof wi))break t;Ca(x),x=x.copy(),x!==null&&(this.ph()&&this.selectionObject===this.path&&(x.type=De.Link),x.adornedObject=y)}if(x!==null){x.type===De.Link&&x.v(),this.bh("Selection",x);break t}}this.Jf("Selection")}for(Cx(this,a),y=this.adornments;y.next();)y.value.La()}},kn.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 Rm(a){if(wh(a)===!1){jv(a,!0),a.Uk();var y=a.diagram;y!==null&&(y.De.add(a),y.$b())}}function T1(a){if(a.G|=2097152,wh(a)!==!1){var y=a.position,x=a.location;x.w()&&y.w()||D1(a,y,x),x=a.Ib;var E=pe.alloc().assign(x);x.ka(),x.x=y.x,x.y=y.y,x.freeze(),a.Xl(E,x),pe.free(E),jv(a,!1)}}kn.prototype.Ge=function(a,y,x,E){var b=this.uc;b.h(a,y,x,E),this.Lb===null&&(this.Lb=new oi);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),this.Lb=z,z.ws()||z.pp(b)},kn.prototype.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=Di;this.locationSpot.sb()&&(z=this.locationSpot);var tt=It.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),It.free(tt)}},kn.prototype.move=function(a,y){y===!0?this.location=a:this.position=a},kn.prototype.moveTo=function(a,y,x){a=It.allocAt(a,y),this.move(a,x),It.free(a)},kn.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())},kn.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())},kn.prototype.fb=function(a){if(this.name===a)return this;var y=this.Rh;if(y===null&&(this.Rh=y=new ln),y.I(a)!==null)return y.I(a);var x=De.prototype.fb.call(this,a);return x!==null?(y.set(a,x),x):(y.set(a,null),null)};function Ru(a,y,x,E){E===void 0&&(E=new It),x=x.Mc()?Di: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}kn.prototype.mi=function(a){return a===void 0&&(a=new pe),a.assign(this.actualBounds)},kn.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function A1(a){var y=It.alloc(),x=a.locationObject,E=x.naturalBounds,b=x instanceof Kn?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 md(a,y){var x=a.py;isNaN(a.ag)&&(a.ag=u1(a));var E=a.ag,b=2*E;if(!a.isShadowed)return x.h(y.x-1-E,y.y-1-E,y.width+2+b,y.height+2+b),x;E=y.x,b=y.y;var z=y.width;y=y.height;var tt=a.shadowBlur;return a=a.shadowOffset,z+=tt,y+=tt,E-=tt/2,b-=tt/2,0<a.x?z+=a.x:(E+=a.x,z-=a.x),0<a.y?y+=a.y:(b+=a.y,y-=a.y),x.h(E-1,b-1,z+2,y+2),x}kn.prototype.arrange=function(){if(ts(this)===!1)T1(this);else{Nl(this,!1);var a=this.Ib,y=pe.alloc();y.assign(a);var x=Ch(this);this.eh(0,0,this.uc.width,this.uc.height);var E=this.position;D1(this,E,this.location),a.ka(),a.x=E.x,a.y=E.y,a.freeze(),this.Xl(y,a),y.D(a)?this.Fd(x):!this.Zc()||Qt.B(y.width,a.width)&&Qt.B(y.height,a.height)||0<=this.vw&&this.C(16),pe.free(y),jv(this,!1)}},xt=kn.prototype,xt.Xl=function(a,y){var x=this.diagram;if(x!==null){var E=!1;if(x.Zi===!1&&a.w()){var b=pe.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),pe.free(b)}!(this.G&65536)&&a.D(y)||j1(this,E,x),x.N(),!a.w()&&!y.w()||Io(a,y)||(this instanceof Je&&!x.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}},xt.zv=function(a,y,x){if(this.ph()||!a.w())return!1;var E=this.diagram;return E!==null&&B1(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 It(E.x+(a.x-y),E.y+(a.y-x)),this.g("location",E,this.ke.copy())),wh(this)===!1&&ts(this)===!1&&(Rm(this),T1(this)),!0};function B1(a,y,x,E,b){y===null||a instanceof wi||(y=y.animationManager,y.zb&&Wc(y,a,new It(E,b),x))}xt.mm=function(a,y,x){var E=this.ke,b=this.pa;if(x){if(E.x===a&&E.y===y)return;wh(this)||ts(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)}Rm(this)},xt.Av=function(){this.G&=-2097153,Rm(this)};function D1(a,y,x){var E=A1(a),b=a.diagram,z=x.w(),tt=y.w();z&&tt?a.G&2097152?O1(a,y,x,b,E):I1(a,y,x,b,E):z?O1(a,y,x,b,E):tt&&I1(a,y,x,b,E),a.G|=2097152,It.free(E),a.Uk()}function O1(a,y,x,E,b){var z=y.x,tt=y.y;y.h(x.x-b.x,x.y-b.y),E!==null&&(x=E.animationManager,(E=x.defaultAnimation.isAnimating)||!x.zb||a instanceof wi||Wc(x,a,new It(z,tt),y),E||y.x===z&&y.y===tt||a.g("position",new It(z,tt),y.copy()))}function I1(a,y,x,E,b){var z=x.copy();x.h(y.x+b.x,y.y+b.y),x.D(z)||E===null||a.g("location",z,x.copy())}function j1(a,y,x){Rv(a,!1),a instanceof Je&&Tu(x,a),a.layer.isTemporary||y||x.Ya(),y=a.Ib;var E=x.viewportBounds;E.w()?Ch(a)?(wl(y,E)||a.Fd(!1),a.updateAdornments()):a.isVisible()&&y.Yc(E)?(a.Fd(!0),a.updateAdornments()):a.Wb():x.vd=!0}xt.si=function(){return!0},xt.Zc=function(){return!0},xt.ph=function(){return!1},xt.Dd=function(){return!0};function Iv(a,y,x,E){y.constructor===a.constructor||_1||(_1=!0,Be('Should not change the class of the Part when changing category from "'+x+'" to "'+E+'"'),Be(" Old class: "+xe(a.constructor)+", new class: "+xe(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 Je&&(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 Je&&(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)}kn.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},kn.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},kn.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},kn.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},kn.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},kn.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},kn.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},kn.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},kn.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 wh(a){return(a.G&32768)!==0}function jv(a,y){a.G=y?a.G|32768:a.G&-32769}function Rv(a,y){a.G=y?a.G|65536:a.G&-65537}function Ch(a){return(a.G&131072)!==0}xt=kn.prototype,xt.Fd=function(a){this.G=a?this.G|131072:this.G&-131073};function zm(a,y){a.G=y?a.G|1048576:a.G&-1048577}xt.oh=function(){var a=this.containingGroup;a!==null&&(a.v(),a.placeholder!==null&&a.placeholder.v(),a.Bd())},xt.N=function(){var a=this.diagram;a!==null&&!ts(this)&&!wh(this)&&this.isVisible()&&this.Ib.w()&&a.N(md(this,this.Ib))},xt.v=function(){De.prototype.v.call(this);var a=this.diagram;a!==null&&(a.De.add(this),this instanceof Je&&this.labeledLink!==null&&$r(this.labeledLink),a.$b(!0))},xt.Vo=function(a){a||(a=this.Ah,a!==null&&Vv(a,this))},xt.Wo=function(a){a||(a=this.Ah,a!==null&&Uv(a,this))},xt.Lj=function(){var a=this.data;if(a!==null){var y=this.diagram;y!==null&&(y=y.model,y!==null&&y.cm(a))}},xt.oz=function(){return zv(this,this)};function zv(a,y){var x=y.containingGroup;return x!==null?1+zv(a,x):y instanceof Je&&(y=y.labeledLink,y!==null)?zv(a,y):0}xt.sz=function(){return R1(this,this)};function R1(a,y){var x=y.containingGroup;return x!==null||y instanceof Je&&(x=y.labeledLink,x!==null)?R1(a,x):y}xt.Td=function(a){return a instanceof Vn?_v(this,this,a):!1};function _v(a,y,x){if(y===x||x===null)return!1;var E=y.containingGroup;return E===null||E!==x&&!_v(a,E,x)?y instanceof Je&&(y=y.labeledLink,y!==null)?_v(a,y,x):!1:!0}xt.px=function(a){if(a===null)return null;if(this===a)return this.containingGroup;for(var y=this;y!==null;){if(y instanceof Vn&&zm(y,!0),y instanceof Je){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 Je&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup}for(y=this;y!==null;)y instanceof Vn&&zm(y,!1),y instanceof Je&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup;return x},kn.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return!(a!==null&&a.isTemporary||this instanceof Je&&this.isLinkLabel)},kn.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 Je&&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 z1(a){return a.isVisible()?(a=a.layer,!(a!==null&&a.isTemporary)):!1}function Lh(a,y,x,E,b,z){if(z===void 0&&(z=null),!(a.contains(y)||z!==null&&!z(y)||y instanceof wi)){if(a.add(y),y instanceof Je){if(x&&y instanceof Vn)for(var tt=y.memberParts;tt.next();)Lh(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)&&Lh(a,ot,x,E,b,z)}}if(1<E)for(y=y.Ou();y.next();)Lh(a,y.value,x,E-1,b,z)}else if(y instanceof _e)for(y=y.labelNodes;y.next();)Lh(a,y.value,x,E,b,z)}}ke.Object.defineProperties(kn.prototype,{key:{get:function(){var a=this.diagram;if(a!==null)return a.model.wa(this.data)}},adornments:{get:function(){return this.Qf===null?xi: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(Uo,"parts",y,this,null,E,!0),E=a.oi(99999999,this,!0),y.visible!==a.visible&&this.Zb(a.visible),0<=E&&x.cb(bo,"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&&(ys(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&&Yc(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 wi?this.type!==De.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:xs},set:function(a){var y=this.minLocation;y.D(a)||(a=a.J(),ys(this),this.P.Pq=a,this.g("minLocation",y,a))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:ta},set:function(a){var y=this.maxLocation;y.D(a)||(a=a.J(),ys(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&&(ys(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:Cr},set:function(a){var y=this.locationSpot;y.D(a)||(a=a.J(),ys(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,ts(this)===!1&&(Rm(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)),B1(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 wi)){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 wi?this instanceof wi&&(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&&(Ca(x),x=x.copy(),x!==null&&Iv(this,x,y,a))):(z!==null&&z.jm(E,a),x=dS(x.partManager,E,a),x!==null&&(Ca(x),x=x.copy(),x===null||x instanceof _e||(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&&(ys(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&&(ys(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&&(ys(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 _e?(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&&(ys(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&&(ys(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&&(ys(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:hs},set:function(a){var y=this.resizeCellSize;y.D(a)||(a=a.J(),ys(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&&(ys(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&&(ys(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:Lr},set:function(a){var y=this.rotationSpot;y.D(a)||(a=a.J(),ys(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&&ce("Cannot make a Group a member of itself: "+this.toString()),ce("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 Vn&&x!==null&&x.ai.remove(this),this.Ah=a,a!==null?Vv(a,this):this instanceof Vn&&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 Vn){for(x=new Fe,Lh(x,this,!0,0,!0),x=x.iterator;x.next();)if(E=x.value,E instanceof Je)for(E=E.linksConnected;E.next();)xf(E.value)}if(this instanceof Je){for(x=this.linksConnected;x.next();)xf(x.value);x=this.labeledLink,x!==null&&xf(x)}this.g("containingGroup",y,a),a!==null&&(y=a.layer,y!==null&&Yc(y,-1,a))}}else ce("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&&(ys(this),this.P.Kp=a,this.g("containingGroupChanged",y,a))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof Je&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(a){var y=this.layoutConditions;y!==a&&(ys(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&&(ys(this),this.P.Up=a,this.g("dragComputation",y,a))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:Ps},set:function(a){var y=this.shadowOffset;y.D(a)||(a=a.J(),ys(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&&(ys(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&&(ys(this),this.P.Vg=a,this.N(),this.g("shadowBlur",y,a))}}}),kn.prototype.invalidateLayout=kn.prototype.C,kn.prototype.findCommonContainingGroup=kn.prototype.px,kn.prototype.isMemberOf=kn.prototype.Td,kn.prototype.findTopLevelPart=kn.prototype.sz,kn.prototype.findSubGraphLevel=kn.prototype.oz,kn.prototype.ensureBounds=kn.prototype.Va,kn.prototype.getDocumentBounds=kn.prototype.mi,kn.prototype.findObject=kn.prototype.fb,kn.prototype.moveTo=kn.prototype.moveTo,kn.prototype.invalidateAdornments=kn.prototype.Wb,kn.prototype.clearAdornments=kn.prototype.Ej,kn.prototype.removeAdornment=kn.prototype.Jf,kn.prototype.addAdornment=kn.prototype.bh,kn.prototype.findAdornment=kn.prototype.Pj,kn.prototype.updateTargetBindings=kn.prototype.La;var _1=!1;kn.className="Part",kn.LayoutNone=0,kn.LayoutAdded=1,kn.LayoutRemoved=2,kn.LayoutShown=4,kn.LayoutHidden=8,kn.LayoutNodeSized=16,kn.LayoutGroupLayout=32,kn.LayoutNodeReplaced=64,kn.LayoutStandard=127,kn.LayoutAll=16777215;function wi(a,y){a===void 0||a instanceof Yo||typeof a=="string"?kn.call(this,a):(kn.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)}ne(wi,kn),wi.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(a!==null?a.toString():"")},wi.prototype.updateRelationshipsFromData=function(){},wi.prototype.Ul=function(a){var y=this.adornedObject,x=y==null?void 0:y.part;if(x instanceof _e&&y instanceof Kn){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 Kn&&(b.ua=a)}}},wi.prototype.si=function(){var a=this.ue;return a===null?!0:(a=a.part,a===null||!ts(a))},wi.prototype.Zc=function(){return!1},wi.prototype.gk=function(a,y,x,E,b,z,tt){if(a===bo&&y==="elements"){if(b instanceof ns)this.$a===null&&(this.$a=b);else if(b instanceof De){var ot=b.Nl(function(rt){return rt instanceof ns});ot instanceof ns&&this.$a===null&&(this.$a=ot)}}else a===Uo&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof De&&this.$a.rg(E)&&(this.$a=null));kn.prototype.gk.call(this,a,y,x,E,b,z,tt)},wi.prototype.updateAdornments=function(){},wi.prototype.Lj=function(){},ke.Object.defineProperties(wi.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}}}),wi.className="Adornment";function Gv(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=fu,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 Je(a,y){a===void 0||a instanceof Yo||typeof a=="string"?kn.call(this,a):(kn.call(this),a&&(y=a)),this.U=13,this.Ba=null,this.jb=new Pe,this.wc=this.af=this.Yk=null,this.ci=!1,y&&Object.assign(this,y)}ne(Je,kn),Je.prototype.cloneProtected=function(a){kn.prototype.cloneProtected.call(this,a),a.U=this.U,this.Ba!==null&&(a.Ba=this.Ba.nc?this.Ba:this.Ba.copy())},xt=Je.prototype,xt.Af=function(a){kn.prototype.Af.call(this,a),a.Bd(),a.af=this.af,a.wc=null};function zu(a){a.Ba===null?a.Ba=new Gv:a.Ba.nc&&(a.Ba=a.Ba.copy())}xt.th=function(){kn.prototype.th.call(this),this.Ba!==null&&(this.Ba.nc=!0)};function G1(a,y){y!==null&&(a.af===null&&(a.af=new Fe),a.af.add(y))}function H1(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}xt.Lz=function(a,y,x){y==null&&(y=""),x==null&&(x=""),a=H1(this,a,y,x),a!==null&&a.Sl()},xt.gk=function(a,y,x,E,b,z,tt){a===bo&&y==="elements"?this.wc=null:a===Uo&&y==="elements"&&(this.wc=null),kn.prototype.gk.call(this,a,y,x,E,b,z,tt)},xt.Bd=function(a){for(var y=this.linksConnected;y.next();){var x=y.value;a!==void 0&&a.contains(x)||(Is(x.fromPort),Is(x.toPort),x.bb())}};function W1(a,y){for(a=a.linksConnected;a.next();){var x=a.value;(x.fromPort===y||x.toPort===y)&&(Is(x.fromPort),Is(x.toPort),x.bb())}}function Is(a){if(a!==null){var y=a.Zn;y!==null&&y.Sl(),a=a.part,y=a.containingGroup,y===null||a.isVisible()||Is(y.port)}}xt.si=function(){return!0},Je.prototype.getAvoidableRect=function(a){return a.set(this.actualBounds),a.Co(this.avoidableMargin),a},Je.prototype.findVisibleNode=function(){for(var a=this;a!==null&&!a.isVisible();)a=a.containingGroup;return a},Je.prototype.isVisible=function(){if(!kn.prototype.isVisible.call(this))return!1;var a=!0,y=Bu,x=this.diagram;if(x!==null&&(a=x.isTreePathToChildren,y=x.treeCollapsePolicy),y===Bu){if(a=this.pg(),a!==null&&!a.isTreeExpanded)return!1}else if(y===_o){if(a=a?this.Oo():this.Po(),0<a.count&&a.all(function(E){return!E.isTreeExpanded}))return!1}else if(y===rf&&(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},Je.prototype.Zb=function(a){kn.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)}},Je.prototype.qx=function(){var a=new Fe,y=new Fe;return V1(this,this,a,y),y.iterator};function V1(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)&&V1(a,b?tt.toNode:tt.fromNode,x,E):E.add(tt)})}}Je.prototype.findLinksConnected=function(a){if(a===void 0&&(a=null),a===null)return this.jb.iterator;var y=new Zn(this.jb),x=this;return y.predicate=function(E){return E.fromNode===x&&E.fromPortId===a||E.toNode===x&&E.toPortId===a},y},xt=Je.prototype,xt.Mo=function(a){a===void 0&&(a=null);var y=new Zn(this.jb),x=this;return y.predicate=function(E){return E.fromNode!==x?!1:a===null?!0:E.fromPortId===a},y},xt.Sd=function(a){a===void 0&&(a=null);var y=new Zn(this.jb),x=this;return y.predicate=function(E){return E.toNode!==x?!1:a===null?!0:E.toPortId===a},y},xt.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 Fe,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 Fe,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new di(x):xi},xt.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 Fe,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new di(x):xi},xt.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 Fe,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new di(x):xi},xt.jz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new Zn(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},xt.kz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new Zn(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 _m(a,y,x){Is(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){Is(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)):Ug(y)))}function Ug(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}}}Je.prototype.updateRelationshipsFromData=function(){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)},xt=Je.prototype,xt.Vo=function(a){kn.prototype.Vo.call(this,a),a||(Ug(this),a=this.Yk,a!==null&&$1(a,this))},xt.Wo=function(a){kn.prototype.Wo.call(this,a),a||(a=this.Yk,a!==null&&a.wd!==null&&(a.wd.remove(this),a.v()))},xt.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,kn.prototype.Lj.call(this)},xt.ns=function(a){if(this.wc===null){if(a===""&&this.Te===!1)return this;U1(this)}var y=this.wc.I(a);return y!==null||a!==""&&(y=this.wc.I(""),y!==null)?y:this};function U1(a){a.wc===null?a.wc=new ln:a.wc.clear(),a.qm(a,function(y,x){Y1(y,x)}),a.wc.count===0&&a.wc.add("",a)}function Y1(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=gn()),x.push(E);if(x!==null){for(a=0;a<x.length;a++)y.remove(x[a]);Ye(x)}}}xt.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},xt.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}},xt.gz=function(a){if(a===null)return null;if(this===a)return this;for(var y=this;y!==null;)zm(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;)zm(y,!1),y=y.pg();return x},xt.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},xt.pg=function(){var a=this.ci;if(a===null)return null;if(a instanceof Je)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},xt.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 Fe;return a(this,y),y},xt.uz=function(){return K1(this,this)};function K1(a,y){return y=y.pg(),y===null?0:1+K1(a,y)}xt.Qo=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren),y=new Zn(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},xt.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 Pe,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 Pe,y.add(x),y.add(a)):x=a);return y!==null?y.iterator:x!==null?new di(x):xi},xt.wz=function(a){a===void 0&&(a=1/0);var y=new Fe;return Lh(y,this,!1,a,!0),y},Je.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 Fe;x.add(this),X1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Bu),y.Ue=!1}};function X1(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),X1(rt,y,x,E-1,b,z,tt)))}else Z1(a,y,x,b,z,tt)}function Z1(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||Z1(at,y,x,E,b,z))}rt={uv:rt.uv}}a.isTreeExpanded=!1}Je.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 Fe;x.add(this),J1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Bu),y.Ue=!1}};function J1(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,J1(ut,y,x,E-1,b,z,tt))}at={vv:at.vv}}a.isTreeExpanded=!0}ke.Object.defineProperties(Je.prototype,{portSpreading:{get:function(){return this.Ba!==null?this.Ba.er:Hm},set:function(a){var y=this.portSpreading;y!==a&&(zu(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&&Tu(x,this),this.g("avoidable",y,a)}}},avoidableMargin:{get:function(){return this.Ba!==null?this.Ba.yp:fu},set:function(a){typeof a=="number"&&(a=new qn(a));var y=this.avoidableMargin;if(!y.D(a)){a=a.J(),zu(this),this.Ba.yp=a;var x=this.diagram;x!==null&&Tu(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&&(zu(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&&(zu(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&&(zu(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&&($1(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),$r(this),this.g("labeledLink",y,a)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return this.wc===null&&U1(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&&(zu(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))}}}),Je.prototype.expandTree=Je.prototype.expandTree,Je.prototype.collapseTree=Je.prototype.collapseTree,Je.prototype.findTreeParts=Je.prototype.wz,Je.prototype.findTreeChildrenNodes=Je.prototype.Ou,Je.prototype.findTreeChildrenLinks=Je.prototype.Qo,Je.prototype.findTreeLevel=Je.prototype.uz,Je.prototype.findTreeParentChain=Je.prototype.vz,Je.prototype.findTreeParentNode=Je.prototype.pg,Je.prototype.findTreeParentLink=Je.prototype.kh,Je.prototype.findCommonTreeParent=Je.prototype.gz,Je.prototype.findTreeRoot=Je.prototype.xz,Je.prototype.isInTreeOf=Je.prototype.Nz,Je.prototype.findPort=Je.prototype.ns,Je.prototype.findLinksTo=Je.prototype.kz,Je.prototype.findLinksBetween=Je.prototype.jz,Je.prototype.findNodesInto=Je.prototype.Oo,Je.prototype.findNodesOutOf=Je.prototype.Po,Je.prototype.findNodesConnected=Je.prototype.Mu,Je.prototype.findLinksInto=Je.prototype.Sd,Je.prototype.findLinksOutOf=Je.prototype.Mo,Je.prototype.findExternalTreeLinksConnected=Je.prototype.qx,Je.prototype.invalidateConnectedLinks=Je.prototype.Bd,Je.prototype.invalidateLinkBundle=Je.prototype.Lz;var Lx=new he(Je,"SpreadingNone",10),Hm=new he(Je,"SpreadingEvenly",11),Wv=new he(Je,"SpreadingPacked",12);Je.className="Node",Je.SpreadingNone=Lx,Je.SpreadingEvenly=Hm,Je.SpreadingPacked=Wv;function Vn(a,y){a===void 0||a instanceof Yo||typeof a=="string"?Je.call(this,a):(Je.call(this),a&&(y=a)),this.U|=4608,this.Gn=new Fe,this.$a=null,this.Sc=new so,this.Sc.group=this,this.gl=new Fe,this.tb=this.$p=null,y&&Object.assign(this,y)}ne(Vn,Je),Vn.prototype.cloneProtected=function(a){Je.prototype.cloneProtected.call(this,a),this.U=this.U&-32769;var y=a.Nl(function(x){return x instanceof ns});y instanceof ns?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())},xt=Vn.prototype,xt.Af=function(a){Je.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 Je)x.Bd(y);else if(x instanceof _e)for(x=x.labelNodes;x.next();)x.value.Bd(y)}},xt.gk=function(a,y,x,E,b,z,tt){if(a===bo&&y==="elements"){if(b instanceof ns)this.$a===null?this.$a=b:this.$a!==b&&ce("Cannot insert a second Placeholder into the visual tree of a Group.");else if(b instanceof De){var ot=b.Nl(function(rt){return rt instanceof ns});ot instanceof ns&&(this.$a===null?this.$a=ot:this.$a!==ot&&ce("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===Uo&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof De&&this.$a.rg(E)&&(this.$a=null));Je.prototype.gk.call(this,a,y,x,E,b,z,tt)},xt.Xl=function(a,y){Je.prototype.Xl.call(this,a,y),this.isClipping&&this.type!==De.Spot&&this.isSubGraphExpanded&&(a=this.resizeObject,a instanceof De&&(a=a.Pb()),this.tb===null&&(this.tb=new pe),a.mi(this.tb),a instanceof Kn&&this.tb.Bc(-a.strokeWidth,-a.strokeWidth))},xt.eh=function(a,y,x,E){this.nf=this.$a,Je.prototype.eh.call(this,a,y,x,E)},xt.Va=function(){var a=this;a.isSubGraphExpanded&&this.memberParts.each(function(y){!a.computesBoundsIncludingLinks&&y instanceof _e||y.Va()}),Je.prototype.Va.call(this)},xt.si=function(){if(!Je.prototype.si.call(this))return!1;for(var a=this.memberParts;a.next();){var y=a.value;if(y instanceof Je){if(y.isVisible()&&ts(y))return!1}else if(y instanceof _e&&y.isVisible()&&ts(y)&&y.fromNode!==this&&y.toNode!==this)return!1}return!0};function Vv(a,y){if(a.Gn.add(y)){y instanceof Vn&&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 _e&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}function Uv(a,y){if(a.Gn.remove(y)){y instanceof Vn&&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 _e&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}xt.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)}Je.prototype.Lj.call(this)},Vn.prototype.canAddMembers=function(a){var y=this.diagram;if(y===null)return!1;for(y=y.commandHandler,a=fe(a).iterator;a.next();)if(!y.isValidMember(this,a.value))return!1;return!0},Vn.prototype.addMembers=function(a,y){var x=this.diagram;if(x===null)return!1;x=x.commandHandler;var E=!0;for(a=fe(a).iterator;a.next();){var b=a.value;!y||x.isValidMember(this,b)?b.containingGroup=this:E=!1}return E},Vn.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))},xt=Vn.prototype,xt.Bd=function(a){var y=(this.U&65536)!==0;if(Je.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()?(Is(x.fromPort),Is(x.toPort),x.bb()):(E=x.toNode,E!==null&&E!==this&&E.Td(this)&&!E.isVisible()&&(Is(x.fromPort),Is(x.toPort),x.bb()))}}},xt.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 Fe,E=y.iterator;E.next();){var b=E.value;if(b instanceof Je)for(b=b.linksConnected;b.next();){var z=b.value;y.contains(z)||x.add(z)}}return a&&(this.$p=x),x.iterator},xt.iz=function(){var a=this.Rj();a.add(this);for(var y=new Fe,x=a.iterator;x.next();){var E=x.value;if(E instanceof Je)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},xt.hz=function(){function a(x,E){x!==null&&(E.add(x),a(x.containingGroup,E))}var y=new Fe;return a(this,y),y},xt.Rj=function(){var a=new Fe;return Lh(a,this,!0,0,!0),a.remove(this),a},xt.Zb=function(a){Je.prototype.Zb.call(this,a);for(var y=this.memberParts;y.next();)y.value.Zb(a)},Vn.prototype.collapseSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();Q1(this,y,a,this),a.Ue=!1}};function Q1(a,y,x,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!1),z instanceof Vn&&z.isSubGraphExpanded&&(z.wasSubGraphExpanded=z.isSubGraphExpanded,Q1(z,y,x,E)),z instanceof Je)z.Bd(y),x.Aj(z,E);else if(z instanceof _e)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!1}Vn.prototype.expandSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();q1(this,y,a,this),a.Ue=!1}};function q1(a,y,x,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!0),z instanceof Vn&&z.wasSubGraphExpanded&&(z.wasSubGraphExpanded=!1,q1(z,y,x,E)),z instanceof Je)z.Bd(y),x.Cj(z,E);else if(z instanceof _e)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!0}Vn.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=It.alloc(),Je.prototype.move.call(this,a,y),a=new Fe,y=this.Rj().iterator;y.next();)b=y.value,b instanceof _e&&(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 Je&&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 _e&&(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(),Kv(b)&&b.bb());It.free(z)}},ke.Object.defineProperties(Vn.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&&ce("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&&(zu(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&&(zu(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&&(zu(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&&(zu(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)}}}),Vn.prototype.expandSubGraph=Vn.prototype.expandSubGraph,Vn.prototype.collapseSubGraph=Vn.prototype.collapseSubGraph,Vn.prototype.findSubGraphParts=Vn.prototype.Rj,Vn.prototype.findContainingGroupChain=Vn.prototype.hz,Vn.prototype.findExternalNodesConnected=Vn.prototype.iz,Vn.prototype.findExternalLinksConnected=Vn.prototype.Lu,Vn.prototype.ensureBounds=Vn.prototype.Va,Vn.className="Group";function ns(a){Jt.call(this),this.yb=ds,this.ko=new pe(NaN,NaN,NaN,NaN),a&&Object.assign(this,a)}ne(ns,Jt),ns.prototype.cloneProtected=function(a){Jt.prototype.cloneProtected.call(this,a),a.yb=this.yb.J(),a.ko=this.ko.copy()},ns.prototype.gh=function(a){if(this.background===null&&this.areaBackground===null)return!1;var y=this.naturalBounds;return lr(0,0,y.width,y.height,a.x,a.y)},ns.prototype.Wl=function(){var a=this.part;if(a!==null&&(a instanceof Vn||a instanceof wi)||ce("Placeholder is not inside a Group or Adornment."),a instanceof Vn){var y=this.computeBorder(this.ko),x=this.minSize,E=this.dc;for(Vo(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=It.alloc(),x.xi(y,a.locationSpot),x.D(a.location)||(a.location=x),It.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 Kn&&(tt=z.strokeWidth);var ot=z.Df(),rt=z.naturalBounds,at=(rt.width+tt)*ot;tt=(rt.height+tt)*ot,a.type!==De.Link&&(ot=z.ga(a.category==="Selection"?Cr:a.locationSpot,It.alloc()),a.location=ot,It.free(ot)),isNaN(at)||isNaN(tt)?(a=z.ga(Cr,It.alloc()),at=pe.allocAt(a.x,a.y,0,0),at.Ye(z.ga(na,a)),at.Ye(z.ga(Wh,a)),at.Ye(z.ga(Cl,a)),Vo(y,at.width+E||0,at.height+b||0),this.Ge(-x.left,-x.top,y.width,y.height),It.free(a),pe.free(at)):(Vo(y,at+E||0,tt+b||0),this.Ge(-x.left,-x.top,y.width,y.height))}},ns.prototype.eh=function(a,y,x,E){this.actualBounds.h(a,y,x,E)},ns.prototype.computeBorder=function(a){var y=this.part,x=y.diagram,E=x===null||!x.animationManager.isAnimating;if(x!==null&&y instanceof Vn&&!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=pe.alloc(),b=this.computeMemberBounds(x);var z=this.yb;return y instanceof Vn&&!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)),pe.free(x),E&&y instanceof Vn&&y.computesBoundsIncludingLocation&&y.location.w()&&a.Ye(y.location),a},ns.prototype.computeMemberBounds=function(a){if(!(this.part instanceof Vn))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 _e&&(!y.computesBoundsIncludingLinks||Zs(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},ke.Object.defineProperties(ns.prototype,{padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new qn(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.g("padding",y,a),this.v())}}}),ns.className="Placeholder";function _e(a){kn.call(this,De.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=is,this.Om=0,this.Qm=is,this.Rm=NaN,this.qj=Jv,this.po=.5,this.wd=null,this.Nb=new Pe().freeze(),this.Tg=this.Mg=null,this.ml=new pe,this.ua=new Ve,this.u=this.o=this.Sf=this.Wf=null,this.su=new It,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],a&&Object.assign(this,a)}ne(_e,kn),_e.prototype.cloneProtected=function(a){kn.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())},xt=_e.prototype,xt.Af=function(a){kn.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&&Is(y),a=a.toPort,a!==null&&Is(a)},xt.qb=function(a){a.classType===_e?(a.value&2)===2?this.routing=a:a===Qs||a===Gu||a===wf?this.curve=a:a===Xg||a===Xm||a===Zm?this.adjusting=a:a!==Jv&&a!==is&&ce("Unknown Link enum value for a Link property: "+a):kn.prototype.qb.call(this,a)},xt.Xc=function(){this.ba===null&&(this.ba=new Dg)},xt.si=function(){var a=this.fromNode;if(a!==null){var y=a.findVisibleNode();if(y!==null&&(a=y),ts(a)||wh(a))return!1}return a=this.toNode,!(a!==null&&(y=a.findVisibleNode(),y!==null&&(a=y),ts(a)||wh(a)))},xt.zv=function(){return!1},xt.Av=function(){},xt.Zc=function(){return!1},_e.prototype.computeAngle=function(a,y,x){return _e.computeAngle(y,x)},_e.computeAngle=function(a,y){switch(a){default:case is:a=0;break;case Zg:a=y;break;case Jg:a=y+90;break;case Qg:a=y-90;break;case Qv:a=y+180;break;case Jm:a=Qt.bp(y),90<a&&270>a&&(a-=180);break;case qg:a=Qt.bp(y+90),90<a&&270>a&&(a-=180);break;case $g: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 xf(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}xt=_e.prototype,xt.oh=function(){var a=this.containingGroup;a!==null&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&kn.prototype.oh.call(this)},xt.To=function(a){var y=this.fromNode;return a===y?this.toNode:y},xt.Cz=function(a){var y=this.fromPort;return a===y?this.toPort:y};function $1(a,y){a.wd===null&&(a.wd=new Fe),a.wd.add(y),a.v()}xt.Vo=function(a){if(kn.prototype.Vo.call(this,a),vd(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,_m(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||_m(x,this,E)}Yg(this)}},xt.Wo=function(a){if(kn.prototype.Wo.call(this,a),vd(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)}Kg(this)}},xt.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))},_e.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)}},_e.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?kn.prototype.move.call(this,a,!1):(a=It.allocAt(x.x+E,x.y+b),kn.prototype.move.call(this,a,!1),It.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)},_e.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},_e.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},_e.prototype.computeMidPoint=function(a){var y=this.pointsCount;if(y===0)return a.assign(al),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()===Qs))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()===Qs){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},_e.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()===Qs))return this.ua.wx(.5);if(this.computeCurve()===Qs&&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)},xt=_e.prototype,xt.i=function(a){return this.Nb.s[a]},xt.dd=function(a,y){this.Nb.cd(a,y)},xt.L=function(a,y,x){this.Nb.cd(a,new It(y,x))},xt.Kz=function(a,y){this.Nb.Gb(a,y)},xt.m=function(a,y,x){this.Nb.Gb(a,new It(y,x))},xt.ne=function(a){this.Nb.add(a)},xt.yf=function(a,y){this.Nb.add(new It(a,y))},xt.pv=function(a){this.Nb.mb(a)},xt.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 Pe,z=a.Nb.iterator;z.next();){var tt=z.value;b.add(new It(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),$r(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&&Uc(tt.animationManager,a,b),a.g("points",z,b)}}xt.uh=function(){this.Mg===null&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},xt.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&&Uc(x.animationManager,this,y),Wm(this),this.g("points",a,y)}},xt.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),Km(a,!1))}xt.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())}},xt.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()}}},_e.prototype.computePoints=function(){if(this.diagram===null)return!1;var a=this.fromNode,y=null;if(a===null?(lc||(lc=new Je,lc.desiredSize=oo,lc.Va()),this.defaultFromPoint&&(lc.location=this.defaultFromPoint,lc.Va(),y=a=lc)):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?(uc||(uc=new Je,uc.desiredSize=oo,uc.Va()),this.defaultToPoint&&(uc.location=this.defaultToPoint,uc.Va(),b=E=uc)):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=Pf(tt),rt=Pf(x),at=y===b&&y!==null,ut=this.isOrthogonal,ft=this.curve===Qs;this.Wf=at&&!ut?ft=!0:!1;var mt=this.computeAdjusting()===is||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,Pt=z.y+rt/3,kt=yt,Dt=Pt;Qt.B(rt,0)?Dt=0<ot?Dt-at:Dt+at:(ut=-ot/rt,ft=Math.sqrt(at*at/(ut*ut+1)),0>at&&(ft=-ft),kt=(0>rt?-1:1)*ft+yt,Dt=ut*(kt-yt)+Pt),yt=z.x+2*ot/3,Pt=z.y+2*rt/3;var Tt=yt,Rt=Pt;Qt.B(rt,0)?Rt=0<ot?Rt-at:Rt+at:(Tt=(0>rt?-1:1)*ft+yt,Rt=ut*(Tt-yt)+Pt),this.Fj(),this.ne(z),this.yf(kt,Dt),this.yf(Tt,Rt),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=pe.alloc(),y.mi(ot),rt=ot.ca(b),mt.mi(ot),at=ot.ca(E),(rt||at)&&(tt=y.ga(Um(tt),new It),this.dd(0,this.getLinkPointFromPoint(a,y,tt,b,!0,tt)),x=mt.ga(Um(x),new It),this.dd(1,this.getLinkPointFromPoint(z,mt,x,E,!1,x))),pe.free(ot))}else{ft=this.isAvoiding,mt&&(ut&&ft||at)&&this.Fj();var Gt=at?this.computeCurviness():0;ft=this.getLinkPoint(a,y,tt,!0,ut,E,b),yt=kt=Pt=0,(ut||!ot||at)&&(Dt=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>Gt&&(yt-=180)),0>yt?yt+=360:360<=yt&&(yt-=360),at&&(Dt+=Math.abs(Gt)*(ut?1:2)),yt===0?Pt=Dt:yt===90?kt=Dt:yt===180?Pt=-Dt:yt===270?kt=-Dt:(Pt=Dt*Math.cos(yt*Math.PI/180),kt=Dt*Math.sin(yt*Math.PI/180)),tt.Mc()&&at&&(Dt=y.ga(Di,It.alloc()),Tt=It.allocAt(Dt.x+1e3*Pt,Dt.y+1e3*kt),this.getLinkPointFromPoint(a,y,Dt,Tt,!0,ft),It.free(Dt),It.free(Tt))),Dt=this.getLinkPoint(E,b,x,!1,ut,a,y);var Vt=Rt=Tt=0;if(ut||!rt||at){var Xt=this.computeEndSegmentLength(E,b,x,!1);Vt=this.getLinkDirection(E,b,Dt,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>Gt&&(Vt+=180)),0>Vt?Vt+=360:360<=Vt&&(Vt-=360),at&&(Xt+=Math.abs(Gt)*(ut?1:2)),Vt===0?Tt=Xt:Vt===90?Rt=Xt:Vt===180?Tt=-Xt:Vt===270?Rt=-Xt:(Tt=Xt*Math.cos(Vt*Math.PI/180),Rt=Xt*Math.sin(Vt*Math.PI/180)),x.Mc()&&at&&(x=b.ga(Di,It.alloc()),tt=It.allocAt(x.x+1e3*Tt,x.y+1e3*Rt),this.getLinkPointFromPoint(E,b,x,tt,!1,Dt),It.free(x),It.free(tt))}x=ft,(ut||!ot||at)&&(x=new It(ft.x+Pt,ft.y+kt)),tt=Dt,(ut||!rt||at)&&(tt=new It(Dt.x+Tt,Dt.y+Rt)),!mt&&!ut&&ot&&3<z&&this.adjustPoints(0,ft,z-2,tt)?this.dd(z-1,Dt):!mt&&!ut&&rt&&3<z&&this.adjustPoints(1,x,z-1,Dt)?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,Dt)):(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(Dt))}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}_e.prototype.getLinkPointFromPoint=function(a,y,x,E,b,z){if(z===void 0&&(z=new It),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 hc,x.port=y,x.node=y.part,y.Zn=x),aS(x,a)}_e.prototype.getLinkPoint=function(a,y,x,E,b,z,tt,ot){if(ot===void 0&&(ot=new It),x.sb()&&!Pf(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===eS){var at=Vm(this,tt);if(at!==null&&rt.Gl<at.Gl){rt=It.alloc(),at=It.alloc();var ut=new pe(y.ga(Cr,rt),y.ga(na,at)),ft=this.computeSpot(!E,tt);a=this.getLinkPoint(z,tt,ft,!E,b,a,y,at),(x.Hf(eh)||x.Hf(ia))&&a.y>=ut.y&&a.y<=ut.y+ut.height?ot.y=a.y:(x.Hf(gu)||x.Hf(Xa))&&a.x>=ut.x&&a.x<=ut.x+ut.width&&(ot.x=a.x),It.free(rt),It.free(at)}}return ot}}return x=y.ga(Um(x),It.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=It.alloc(),tt=tt.ga(Um(rt),z),b&&(tt=Yv(x,tt)),It.free(z)),this.getLinkPointFromPoint(a,y,x,tt,E,ot),It.free(x),ot},_e.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(Di,It.alloc()),this.pointsCount>(z?6:2)?(ot=b?this.i(1):this.i(this.pointsCount-2),ot=z?Yv(rt,ot.copy()):x):(x=It.alloc(),ot=ot.ga(Di,x),It.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,It.free(rt),rt=x}return E.Mc()&&tt.Td(a)&&(rt+=180,360<=rt&&(rt-=360)),Pf(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},_e.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)},_e.prototype.computeSpot=function(a,y){return y===void 0&&(y=null),a?(a=y||this.fromPort,a===null?a=Di:(y=this.fromSpot,y.Xb()&&(y=a.fromSpot),a=y===Lr?pr:y)):(a=y||this.toPort,a===null?a=Di:(y=this.toSpot,y.Xb()&&(y=a.toSpot),a=y===Lr?pr:y)),a};function Pf(a){return a===pr||a.x===.5&&a.y===.5}function Um(a){return a.x===.5&&a.y===.5?a:Di}_e.prototype.computeOtherPoint=function(a,y){return this.computeAdjusting()!==is&&4<this.pointsCount?this.computeMidPoint(new It):(a=y.Zn,a=a!==null?aS(a,this):null,a!==null?a.Zo:y.ga(Di))},_e.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},_e.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=oi.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&oi.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=oi.alloc(),ft.set(tt),ut instanceof De)ot=ut.Cf(a,y,x,E,b,ft);else if(this.path===ut){if(ut instanceof Kn)if(ot=a,mt=E,ut.pickable===!1)ot=!1;else if(ft.multiply(ut.transform),mt)t:{var yt=ot,Pt=ft;if(ut.fh(yt,Pt))ot=!0;else{if(Pt===void 0&&(Pt=ut.transform,yt.Re(ut.actualBounds))){ot=!0;break t}ot=yt.left,mt=yt.right;var kt=yt.top;yt=yt.bottom;var Dt=It.alloc(),Tt=It.alloc(),Rt=It.alloc(),Gt=oi.alloc();Gt.set(Pt),Gt.bv(ut.transform),Gt.Vj(),Tt.x=mt,Tt.y=kt,Tt.transform(Gt),Dt.x=ot,Dt.y=kt,Dt.transform(Gt),Pt=!1,pd(ut,Dt,Tt,Rt)?Pt=!0:(Dt.x=mt,Dt.y=yt,Dt.transform(Gt),pd(ut,Dt,Tt,Rt)?Pt=!0:(Tt.x=ot,Tt.y=yt,Tt.transform(Gt),pd(ut,Dt,Tt,Rt)?Pt=!0:(Dt.x=ot,Dt.y=kt,Dt.transform(Gt),pd(ut,Dt,Tt,Rt)&&(Pt=!0)))),oi.free(Gt),It.free(Dt),It.free(Tt),It.free(Rt),ot=Pt}}else ot=ut.fh(ot,ft)}else ot=$o(ut,a,E,ft);ot&&(mt=ut,y!==null&&(mt=y(ut)),mt&&(x===null||x(mt))&&b.add(mt)),oi.free(ft)}}}return z===void 0&&oi.free(tt),ot||this.background!==null||this.areaBackground!==null}return z===void 0&&oi.free(tt),!1},_e.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?Qs:this.curve},_e.prototype.computeCorner=function(){if(this.curve===Qs)return 0;var a=this.corner;return(isNaN(a)||0>a)&&(a=10),a},_e.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},_e.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a=iS;a=Math.max(a,this.computeThickness());var y=this.fromPort,x=this.toPort;if(y!==null&&x!==null){var E=this.findMidLabel();if(E!==null){var b=E.naturalBounds,z=E.margin,tt=isNaN(b.width)?30:b.width*E.scale+z.left+z.right;b=isNaN(b.height)?14:b.height*E.scale+z.top+z.bottom,E=E.segmentOrientation,E===Zg||E===Jm||E===Qv?a=Math.max(a,b):E===Qg||E===$g||E===Jg||E===qg?a=Math.max(a,tt):(y=y.ga(Di).ab(x.ga(Di))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(y)*tt)+Math.abs(Math.cos(y)*b)+1)),this.curve===Qs&&(a*=1.333)}}return a},_e.prototype.arrangeBundledLinks=function(a,y){if(y)for(y=0;y<a.length;y++){var x=a[y];x.computeAdjusting()===is&&x.bb()}},_e.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=nS;var y=this.Sf;if(y!==null){for(var x=gn(),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),Ye(x)}}return a},_e.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return a!==null?Math.max(a.strokeWidth,1):1},_e.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},_e.prototype.adjustPoints=function(a,y,x,E){var b=this.computeAdjusting();if(this.isOrthogonal){if(b===Xm)return!1;b===Zm&&(b=Xg)}switch(b){case Xm: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 Zm: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 Pt=(mt-ut)/(rt-ot);yt=Math.sqrt(1+1/(Pt*Pt))}else Pt=9e9;for(this.dd(a,y),a+=1;a<x;a++){y=this.i(a);var kt=y.x,Dt=y.y,Tt=.5;at!==0&&(Tt=((b-kt)*(b-tt)+(z-Dt)*(z-ft))/at);var Rt=b+Tt*(tt-b),Gt=z+Tt*(ft-z);y=Math.sqrt((kt-Rt)*(kt-Rt)+(Dt-Gt)*(Dt-Gt)),Dt<Pt*(kt-Rt)+Gt&&(y=-y),0<Pt&&(y=-y),kt=ot+Tt*(rt-ot),Tt=ut+Tt*(mt-ut),Pt!==0?(y=kt+y/yt,this.L(a,y,Tt-(y-kt)/Pt)):this.L(a,kt,Tt+y)}this.dd(x,E)}return!0;case Xg: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),Kv(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}},_e.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(tp,tp),rt.Bc(tp,tp),ot.Ye(a),rt.Ye(x);var at=It.alloc(),ut=It.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||!tf(mt)||ot.ca(ft)&&!z.Td(b)||rt.ca(a)&&!b.Td(z))y=!1;else{var yt=ef(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 Pt=x=null;if(mt.isVirtualized){mt=yt.bounds.copy(),mt.Bc(-yt.Ho,-yt.Go);var kt=It.alloc();Cf(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,kt)?(x=a=kt.copy(),y=kt.ab(at)):Qt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,at.x,at.y,ut.x,ut.y,kt)?(x=a=kt.copy(),y=kt.ab(ut)):Qt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,ut.x,ut.y,ft.x,ft.y,kt)&&(x=a=kt.copy(),y=kt.ab(ft))),Cf(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,kt)?(Pt=ft=kt.copy(),E=ut.ab(kt)):Qt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,ut.x,ut.y,at.x,at.y,kt)?(Pt=ft=kt.copy(),E=at.ab(kt)):Qt.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,at.x,at.y,a.x,a.y,kt)&&(Pt=ft=kt.copy(),E=a.ab(kt))),It.free(kt)}ot=ot.copy().ed(rt),ot.Bc(yt.Ho*yt.Os,yt.Go*yt.Os),rS(yt,a,y,ft,E,ot,!0),rt=Dl(yt,ft.x,ft.y),!yt.abort&&rt>=Lf&&(oS(yt),ot.Bc(yt.Ho*yt.Hx,yt.Go*yt.Ix),rS(yt,a,y,ft,E,ot,!1),rt=Dl(yt,ft.x,ft.y)),!yt.abort&&rt<Lf&&Dl(yt,ft.x,ft.y)!==Hu?(Xv(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)),Pt!==null&&(E===0||E===180?this.yf(z.x,Pt.y):this.yf(Pt.x,z.y)),y=!0):y=!1}}}else y=!1;y||(this.ne(at.copy()),this.ne(ut.copy())),It.free(at),It.free(ut)}},_e.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 Kv(a){if(a.diagram===null||!a.isAvoiding||!tf(a.diagram))return!1;var y=a.points.s,x=y.length;if(4>x)return!1;a=ef(a.diagram,!0,a.containingGroup,null);for(var E=1;E<x-2;E++){var b=y[E],z=y[E+1];if(!a.Yj(Math.min(b.x,z.x),Math.min(b.y,z.y),Math.abs(b.x-z.x),Math.abs(b.y-z.y)))return!0}return!1}function Xv(a,y,x,E,b,z,tt){var ot=y.Ho,rt=y.Go,at=Dl(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>yd&&Dl(y,ut,ft)!==at-1&&(Dl(y,x-ot,E)===at-1?(b=180,ut=x-ot,ft=E):Dl(y,x+ot,E)===at-1?(b=0,ut=x+ot,ft=E):Dl(y,x,E-rt)===at-1?(b=270,ut=x,ft=E-rt):Dl(y,x,E+rt)===at-1&&(b=90,ut=x,ft=E+rt));at>yd&&Dl(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>yd&&(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>yd&&(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),Dl(y,tt,ut)===at-1?Xv(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),Dl(y,tt,ut)===at-1&&Xv(a,y,tt,ut,z,!1,z))),a.yf(x,E)}_e.prototype.ez=function(a){var y=a.x;a=a.y;for(var x=this.i(0),E=this.i(1),b=Jo(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=Jo(y,a,E.x,E.y,x.x,x.y);E=x,ot<b&&(z=tt,b=ot)}return z},_e.prototype.qc=function(){this.lk=!1,this.v()},_e.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 Kn&&(b.ua=this.ua)}}},_e.prototype.makeGeometry=function(){var a=this.ua,y=this.pointsCount,x=!1,E=this.diagram;E!==null&&vd(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===Qs&&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||vd(this)){if(a.type=Ve.o,ot=b1(a),this.computeShortLength(!0)!==0&&(b=sc(this,b,!0,z)),Sf(ot,b.x,b.y,!1),tt===Qs&&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=sc(this,b,!1,z)),ju(ot,y,x,y,x,b.x,b.y);else if(this.isOrthogonal){y=It.allocAt(E,rt),x=It.alloc(),x.assign(this.i(1)),z=It.allocAt(E,rt),b=It.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,Pt=this.i(Zv(this,at,ft,!1));if((!Qt.$(mt.x,yt.x)||!Qt.$(yt.x,Pt.x))&&(!Qt.$(mt.y,yt.y)||!Qt.$(yt.y,Pt.y))){var kt=ut;isNaN(kt)&&(kt=this.smoothness/3);var Dt=mt.x;mt=mt.y;var Tt=yt.x;yt=yt.y;var Rt=Pt.x;Pt=Pt.y;var Gt=kt*Ym(Dt,mt,Tt,yt);kt*=Ym(Tt,yt,Rt,Pt),Qt.$(mt,yt)&&Qt.$(Tt,Rt)&&(Tt>Dt?Pt>yt?(z.x=Tt-Gt,z.y=yt-Gt,b.x=Tt+kt,b.y=yt+kt):(z.x=Tt-Gt,z.y=yt+Gt,b.x=Tt+kt,b.y=yt-kt):Pt>yt?(z.x=Tt+Gt,z.y=yt-Gt,b.x=Tt-kt,b.y=yt+kt):(z.x=Tt+Gt,z.y=yt+Gt,b.x=Tt-kt,b.y=yt-kt)),Qt.$(Dt,Tt)&&Qt.$(yt,Pt)&&(yt>mt?(Rt>Tt?(z.x=Tt-Gt,z.y=yt-Gt,b.x=Tt+kt):(z.x=Tt+Gt,z.y=yt-Gt,b.x=Tt-kt),b.y=yt+kt):(Rt>Tt?(z.x=Tt-Gt,z.y=yt+Gt,b.x=Tt+kt):(z.x=Tt+Gt,z.y=yt+Gt,b.x=Tt-kt),b.y=yt-kt)),(Qt.$(Dt,Tt)&&Qt.$(Tt,Rt)||Qt.$(mt,yt)&&Qt.$(yt,Pt))&&(Dt=.5*(Dt+Rt),mt=.5*(mt+Pt),z.x=Dt,z.y=mt,b.x=Dt,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=sc(this,ut.copy(),!1,mo)),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),It.free(y),It.free(x),It.free(z),It.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=sc(this,tt.copy(),!1,mo)),ju(ot,z.x-E,z.y-rt,b.x-E,b.y-rt,tt.x-E,tt.y-rt);else{for(z=It.alloc(),z.assign(this.i(0)),b=It.alloc(),b.assign(z),tt=this.computeCorner(),ft=1,at=0;ft<y;){if(ft=Zv(this,z,ft,1<ft),ut=this.i(ft),ft>=y-1){if(!z.D(ut))this.computeShortLength(!1)!==0&&(ut=sc(this,ut.copy(),!1,mo)),ac(this,ot,-E,-rt,z,ut,x);else if(at===0)for(ft=1;ft<y;)b.assign(z),ut=this.i(ft++),ac(this,ot,-E,-rt,z,ut,x),z.assign(ut);break}if(at=Zv(this,ut,ft+1,ft<y-3),ft=-E,Dt=-rt,mt=ut,Tt=this.i(at),kt=x,Qt.B(z.y,mt.y)&&Qt.B(mt.x,Tt.x))if(Pt=Math.min(tt,Math.abs(mt.x-b.x)/2),Pt=Gt=Math.min(Pt,Math.abs(Tt.y-mt.y)/2),Qt.B(Pt,0))ac(this,ot,ft,Dt,z,mt,kt),z.assign(mt);else{var Vt=mt.x,Xt=mt.y;yt=Vt,Rt=Xt,mt.x>z.x?Vt=mt.x-Pt:Vt=mt.x+Pt,Tt.y>mt.y?Rt=mt.y+Gt:Rt=mt.y-Gt,Tt=It.allocAt(Vt,Xt),ac(this,ot,ft,Dt,z,Tt,kt),It.free(Tt),Im(ot,mt.x+ft,mt.y+Dt,yt+ft,Rt+Dt),z.h(yt,Rt)}else Qt.B(z.x,mt.x)&&Qt.B(mt.y,Tt.y)?(Pt=Math.min(tt,Math.abs(mt.y-b.y)/2),Pt=Gt=Math.min(Pt,Math.abs(Tt.x-mt.x)/2),Qt.B(Gt,0)?(ac(this,ot,ft,Dt,z,mt,kt),z.assign(mt)):(Vt=mt.x,Xt=mt.y,yt=Vt,Rt=Xt,mt.y>z.y?Xt=mt.y-Pt:Xt=mt.y+Pt,Tt.x>mt.x?yt=mt.x+Gt:yt=mt.x-Gt,Tt=It.allocAt(Vt,Xt),ac(this,ot,ft,Dt,z,Tt,kt),It.free(Tt),Im(ot,mt.x+ft,mt.y+Dt,yt+ft,Rt+Dt),z.h(yt,Rt))):(ac(this,ot,ft,Dt,z,mt,kt),z.assign(mt));b.assign(ut),ft=at}It.free(z)}jm=ot}else ot=this.i(1).copy(),ot.x-=E,ot.y-=rt,this.computeShortLength(!0)!==0&&(b=sc(this,b,!0,z)),this.computeShortLength(!1)!==0&&(ot=sc(this,ot,!1,z)),a.type=Ve.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 sc(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 Zv(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}_e.prototype.computeJumpLength=function(){return 10};function ac(a,y,x,E,b,z,tt){if(!tt&&vd(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 Pt=z.y+E;a.curve===Gu?Sf(y,yt,Pt,!1):ju(y,mt,ft,yt,ft,yt,Pt)}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===Gu?Sf(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,Pt=z.x+x,ft+=E,a.curve===Gu?Sf(y,Pt,ft,!1):ju(y,yt,mt,yt,ft,Pt,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===Gu?Sf(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 _e){if(rt===a)return 0<E.length&&E.sort(function(ut,ft){return ut-ft}),E.length;if(rt.isVisible()&&vd(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=It.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,Pt=tt.x;tt=tt.y;var kt=at.x,Dt=at.y;if(Qt.B(ut,mt)){if(!Qt.B(ft,yt)&&Qt.B(tt,Dt)&&Math.min(ft,yt)<tt&&Math.max(ft,yt)>tt&&Math.min(Pt,kt)<ut&&Math.max(Pt,kt)>ut&&!Qt.B(Pt,kt)){ot.x=ut,ot.y=tt,ut=!0;break t}}else if(Qt.B(ft,yt)&&Qt.B(Pt,kt)&&Math.min(ut,mt)<Pt&&Math.max(ut,mt)>Pt&&Math.min(tt,Dt)<ft&&Math.max(tt,Dt)>ft&&!Qt.B(tt,Dt)){ot.x=Pt,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}It.free(ot)}function vd(a){return a=a.curve,a===wf||a===Gu}function Km(a,y){(y||vd(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()))}_e.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 _e&&(rt===this?z=!0:z&&tS(this,rt,a))}}else if(E)for(z=b.Pa.s,b=z.length,tt=0;tt<b;tt++)ot=z[tt],ot instanceof _e&&tS(this,ot,a)}}}}};function tS(a,y,x){if(y!==null&&y.lk&&y.fd&&vd(y)){var E=y.routeBounds;E.w()&&(a.routeBounds.Yc(E)||x.Yc(E))&&(a.usesSamePort(y)||y.qc())}}_e.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},_e.prototype.isVisible=function(){if(!kn.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},_e.prototype.Zb=function(a){if(kn.prototype.Zb.call(this,a),a&&Km(this,!1),this.Sf!==null&&this.Sf.Sl(),this.wd!==null)for(var y=this.wd.iterator;y.next();)y.value.Zb(a)},_e.prototype.computeAdjusting=function(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?Xg:this.qk};function Yg(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=H1(y,x,E,b),z===null&&(z=new qm(y,E,x,b),G1(y,z),G1(x,z)),z.links=a,y=0;y<a.length;y++)a[y].Sf=z;z.Sl()}}}}function Kg(a){var y=a.Sf;y!==null&&isNaN(a.curviness)&&(a.Sf=null,a=y.links.indexOf(a),0<=a&&(Ai(y.links,a),y.Sl()))}_e.prototype.ph=function(){return!0},ke.Object.defineProperties(_e.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),Kg(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&&_m(a,this,b),Yg(this),this.C(1)),this.g("fromNode",y,a),xf(this)}}},fromPortId:{get:function(){return this.ff},set:function(a){var y=this.ff;if(y!==a){var x=this.fromPort;x!==null&&Is(x),Kg(this),this.ff=a;var E=this.fromPort;E!==null&&Is(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))),Yg(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),Kg(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&&_m(a,this,b),Yg(this),this.C(1)),this.g("toNode",y,a),xf(this)}}},toPortId:{get:function(){return this.vf},set:function(a){var y=this.vf;if(y!==a){var x=this.toPort;x!==null&&Is(x),Kg(this),this.vf=a;var E=this.toPort;E!==null&&Is(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))),Yg(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:Lr},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&&Is(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&&ti(a,">= 0",_e,"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:Lr},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&&Is(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&&ti(a,">= 0",_e,"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?xi: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&&Ug(this.fromNode),this.toNode!==null&&Ug(this.toNode))}},path:{get:function(){var a=this.Pb();return a instanceof Kn?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()===Qs&&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 It)}},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 Pe,E=0;E<a.length/2;E++)b=new It(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 Pe,E=0;E<a.length;E++)b=a[E],x.add(new It(b.x,b.y).freeze())}}else if(a instanceof Pe)for(x=a.copy(),a=x.iterator;a.next();)a.value.freeze();else ce("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&&Uc(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||!Pf(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return a===0?0:2>=a?a-1:this.isOrthogonal||!Pf(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(),Km(this,y===Gu||y===wf||a===Gu||a===wf),this.g("curve",y,a))}},curviness:{get:function(){return this.Rm},set:function(a){var y=this.Rm;y!==a&&(this.Rm=a,this.bb(),this.qc(),this.g("curviness",y,a))}},routing:{get:function(){return this.qj},set:function(a){var y=this.qj;y!==a&&(this.qj=a,this.Wf=null,this.bb(),Km(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)}}}),_e.prototype.invalidateOtherJumpOvers=_e.prototype.Xo,_e.prototype.findClosestSegment=_e.prototype.ez,_e.prototype.updateRoute=_e.prototype.vg,_e.prototype.invalidateRoute=_e.prototype.bb,_e.prototype.rollbackRoute=_e.prototype.rv,_e.prototype.commitRoute=_e.prototype.zf,_e.prototype.startRoute=_e.prototype.uh,_e.prototype.clearPoints=_e.prototype.Fj,_e.prototype.removePoint=_e.prototype.pv,_e.prototype.addPointAt=_e.prototype.yf,_e.prototype.addPoint=_e.prototype.ne,_e.prototype.insertPointAt=_e.prototype.m,_e.prototype.insertPoint=_e.prototype.Kz,_e.prototype.setPointAt=_e.prototype.L,_e.prototype.setPoint=_e.prototype.dd,_e.prototype.getPoint=_e.prototype.i,_e.prototype.getOtherPort=_e.prototype.Cz,_e.prototype.getOtherNode=_e.prototype.To;var lc=null,uc=null,Jv=new he(_e,"Normal",1),Ex=new he(_e,"Orthogonal",2),Fx=new he(_e,"AvoidsNodes",6),eS=new he(_e,"AvoidsNodesStraight",7),is=new he(_e,"None",0),Qs=new he(_e,"Bezier",9),Gu=new he(_e,"JumpGap",10),wf=new he(_e,"JumpOver",11),Xg=new he(_e,"End",17),Xm=new he(_e,"Scale",18),Zm=new he(_e,"Stretch",19),Zg=new he(_e,"OrientAlong",21),Jg=new he(_e,"OrientPlus90",22),Qg=new he(_e,"OrientMinus90",23),Qv=new he(_e,"OrientOpposite",24),Jm=new he(_e,"OrientUpright",25),qg=new he(_e,"OrientPlus90Upright",26),$g=new he(_e,"OrientMinus90Upright",27),Qm=new he(_e,"OrientUpright45",28),nS=16,iS=14,tp=8;_e.className="Link",_e.Normal=Jv,_e.Orthogonal=Ex,_e.AvoidsNodes=Fx,_e.AvoidsNodesStraight=eS,_e.None=is,_e.Bezier=Qs,_e.JumpGap=Gu,_e.JumpOver=wf,_e.End=Xg,_e.Scale=Xm,_e.Stretch=Zm,_e.OrientAlong=Zg,_e.OrientPlus90=Jg,_e.OrientMinus90=Qg,_e.OrientOpposite=Qv,_e.OrientUpright=Jm,_e.OrientPlus90Upright=qg,_e.OrientMinus90Upright=$g,_e.OrientUpright45=Qm,_e.EndSegmentStep=8,_e.CurvinessStart=nS,_e.SpacingMin=iS,_e.OrthoShortCut=tp;function qm(a,y,x,E){Dn(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 ep(a){Dn(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}ep.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 Cf(a,y,x){return a.Nd<=y&&y<=a.En&&a.Od<=x&&x<=a.Fn}function Dl(a,y,x){return Cf(a,y,x)?(y-=a.Nd,y/=a.rc,x-=a.Od,x/=a.sc,a.ac[y|0][x|0]):qv}function oS(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]>=yd&&(x[E]=qv)}ep.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]===Hu)return!1}return!0};function Ol(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>=yd&&ft<Lf)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)Ol(a,y,x,1,!b,z,tt,ot,rt),Ol(a,y,x,-1,!b,z,tt,ot,rt);else for(x+=E;x>at;x+=E)Ol(a,y,x,1,!b,z,tt,ot,rt),Ol(a,y,x,-1,!b,z,tt,ot,rt);else if(0<E)for(y+=E;y<at;y+=E)Ol(a,y,x,1,!b,z,tt,ot,rt),Ol(a,y,x,-1,!b,z,tt,ot,rt);else for(y+=E;y>at;y+=E)Ol(a,y,x,1,!b,z,tt,ot,rt),Ol(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=Hu,ut=yd;for(a.ac[y][x]=ut;at===Hu&&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=Hu,ut=Lf;for(a.ac[y][x]=ut;at===Hu&&y>z&&y<tt&&x>ot&&x<rt;)a.ac[y][x]=ut,b?x+=E:y+=E,at=a.ac[y][x]}function rS(a,y,x,E,b,z,tt){if(a.ac!==null){a.abort=!1;var ot=y.x,rt=y.y;if(Cf(a,ot,rt)){ot-=a.Nd,ot/=a.rc,rt-=a.Od,rt/=a.sc;var at=E.x,ut=E.y;if(Cf(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]===Hu?($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]===Hu?(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=gn(),tt&&sS(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=yd,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 Ol(a,ot,rt,1,!1,z,y,ft,mt),Ol(a,ot,rt,-1,!1,z,y,ft,mt),Ol(a,ot,rt,1,!0,z,y,ft,mt),Ol(a,ot,rt,-1,!0,z,y,ft,mt);Ye(x)}}}}function sS(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),sS(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++}}}ke.Object.defineProperties(ep.prototype,{bounds:{get:function(){return new pe(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 Hu=0,yd=1,Lf=999999,qv=Lf+1,$v=Lf+2;ep.className="PositionArray";function hc(){Dn(this),this.port=this.node=null,this.pe=[],this.ap=!1}hc.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 Nx(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}hc.prototype.Sl=function(){this.pe.length=0};function aS(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 Vn?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(Cr,It.alloc()),rt=a.port.ga(na,It.alloc());for(b=pe.allocAt(ot.x,ot.y,0,0),b.Ye(rt),It.free(ot),It.free(rt),ot=It.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=Nx(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(It.free(ot),a.pe.sort(hc.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=It.alloc(),rt=It.alloc(),tt=It.alloc(),at=It.alloc(),ft.ga(Cr,ot),ft.ga(Wh,rt),ft.ga(na,tt),ft.ga(Cl,at),yt=mt=ut=ft=0,E===Wv)for(var Pt=0;Pt<z.length;Pt++){var kt=z[Pt];if(kt!==null){var Dt=kt.link.computeThickness();switch(kt.Nc){case 8:mt+=Dt;break;case 2:yt+=Dt;break;case 1:ft+=Dt;break;default:case 4:ut+=Dt}}}var Tt=Pt=0,Rt=1,Gt=kt=0;for(Dt=0;Dt<z.length;Dt++){var Vt=z[Dt];if(Vt!==null){if(Pt!==Vt.Nc){switch(Pt=Vt.Nc,Pt){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(kt=Tt.x-Xt.x,Gt=Tt.y-Xt.y,Pt){case 8:mt>Math.abs(kt)?(Rt=Math.abs(kt)/mt,mt=Math.abs(kt)):Rt=1;break;case 2:yt>Math.abs(Gt)?(Rt=Math.abs(Gt)/yt,yt=Math.abs(Gt)):Rt=1;break;case 1:ft>Math.abs(kt)?(Rt=Math.abs(kt)/ft,ft=Math.abs(kt)):Rt=1;break;default:case 4:ut>Math.abs(Gt)?(Rt=Math.abs(Gt)/ut,ut=Math.abs(Gt)):Rt=1}Tt=0}var ie=Vt.Zo;if(E===Wv){switch(Vt=Vt.link.computeThickness(),Vt*=Rt,ie.set(Xt),Pt){case 8:ie.x=Xt.x+kt/2+mt/2-Tt-Vt/2;break;case 2:ie.y=Xt.y+Gt/2+yt/2-Tt-Vt/2;break;case 1:ie.x=Xt.x+kt/2-ft/2+Tt+Vt/2;break;default:case 4:ie.y=Xt.y+Gt/2-ut/2+Tt+Vt/2}Tt+=Vt}else{var Xe=.5;E===Hm&&(Xe=(Vt.Uo+1)/(Vt.Gl+1)),ie.x=Xt.x+kt*Xe,ie.y=Xt.y+Gt*Xe}}}for(It.free(ot),It.free(rt),It.free(tt),It.free(at),Xt=a.pe,z=0;z<Xt.length;z++)E=Xt[z],E!==null&&(E.Ju=a.computeEndSegmentLength(E));a.ap=x,pe.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}hc.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},hc.prototype.computeEndSegmentLength=function(a){var y=a.link,x=y.computeEndSegmentLength(this.node,this.port,pr,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)},hc.className="Knot";function ty(a,y,x){this.link=a,this.angle=y,this.Nc=x,this.hv=new It,this.Gl=this.Uo=0,this.Zo=new It,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 so(a){Dn(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new It(0,0).freeze(),this.vn=!0,this.Em=this.un=null,this.xn=!1,this.j=null,a&&Object.assign(this,a)}so.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},so.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},so.prototype.qb=function(){},so.prototype.toString=function(){var a=xe(this.constructor);return a+="(",this.group!==null&&(a+=" in "+this.group),this.diagram!==null&&(a+=" for "+this.diagram),a+")"},so.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())}}},so.prototype.createNetwork=function(){return new Ji(this)},so.prototype.makeNetwork=function(a){var y=this.createNetwork();return a instanceof oe?(y.lg(a.nodes,!0),y.lg(a.links,!0)):a instanceof Vn?y.lg(a.memberParts):y.lg(a.iterator),y},so.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")}},so.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()}},so.prototype.doLayout=function(a){var y=new Fe;a instanceof oe?(kh(this,y,a.nodes,!0,this.rh,!0,!1,!0),kh(this,y,a.parts,!0,this.rh,!0,!1,!0)):a instanceof Vn?kh(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},so.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;np(ot);var rt=ot.measuredBounds,at=rt.width;rt=rt.height,ot.moveTo(E,b),ot instanceof Vn&&(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++}},so.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 _e)&&(np(ot),this.rh(ot))){var rt=ot.measuredBounds,at=rt.width;rt=rt.height,ot.moveTo(x,E),ot instanceof Vn&&(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++}}},so.prototype.rh=function(a){return!!(!a.location.w()||a instanceof Vn&&a.rh)};function kh(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 Je?rt.isLinkLabel||(rt instanceof Vn&&rt.layout===null?kh(a,y,rt.memberParts,!1,b,z,tt,ot):(np(rt),y.add(rt))):tt&&rt instanceof _e?y.add(rt):!ot||!rt.Zc()||rt instanceof Je||(np(rt),y.add(rt)))}}function np(a){var y=a.actualBounds;(y.width===0||y.height===0||isNaN(y.width)||isNaN(y.height))&&a.Va()}so.prototype.ni=function(a,y){var x=this.boundsComputation;return x!==null?(y||(y=new pe),x(a,this,y)):y?(y.set(a.actualBounds),y):a.actualBounds},so.prototype.ex=function(a){var y=new Fe;return a instanceof oe?(kh(this,y,a.nodes,!0,null,!0,!0,!0),kh(this,y,a.links,!0,null,!0,!0,!0),kh(this,y,a.parts,!0,null,!0,!0,!0)):a instanceof Vn?kh(this,y,a.memberParts,!1,null,!0,!0,!0):kh(this,y,a.iterator,!1,null,!0,!0,!0),y},so.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(Cr),(isNaN(x.x)||isNaN(x.y))&&x.set(a),a=y.padding,x.x+=a.left,x.y+=a.top),x}return a},ke.Object.defineProperties(so.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())}}}),so.prototype.collectParts=so.prototype.ex,so.prototype.getLayoutBounds=so.prototype.ni,so.prototype.invalidateLayout=so.prototype.C,so.className="Layout";function Ji(a){Dn(this),this.Sc=a,this.wf=new Fe,this.ye=new Fe,this.Es=new ln,this.zs=new ln}Ji.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 Fe,this.ye=new Fe,this.Es=new ln,this.zs=new ln},Ji.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},Ji.prototype.createVertex=function(){return new Ko(this)},Ji.prototype.createEdge=function(){return new js(this)},Ji.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 Je)return!tt.isLinkLabel;if(tt instanceof _e){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 Je&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)){if(E instanceof Vn&&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 _e&&(!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))}}},Ji.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},xt=Ji.prototype,xt.dh=function(a){if(a!==null){this.wf.add(a);var y=a.node;y!==null&&this.Es.add(y,a),a.network=this}},xt.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},xt.Iu=function(a){if(a!==null&&lS(this,a)){for(var y=a.tg,x=y.count-1;0<=x;x--){var E=y.M(x);this.Mj(E)}for(y=a.mg,a=y.count-1;0<=a;a--)x=y.M(a),this.Mj(x)}};function lS(a,y){if(y===null)return!1;var x=a.wf.remove(y);return x&&(y=y.node,y!==null&&a.Es.remove(y)),x}xt.Zy=function(a){a!==null&&(a=this.ki(a),a!==null&&this.Iu(a))},xt.ki=function(a){return a===null?null:this.Es.I(a)},xt.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}}xt.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},xt.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))}xt.Yy=function(a){a!==null&&(a=this.Lo(a),a!==null&&this.Mj(a))},xt.Lo=function(a){return a===null?null:this.zs.I(a)},xt.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},xt.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))}},xt.Ko=function(){for(var a=gn(),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]);Ye(a)},Ji.prototype.deleteArtificialVertexes=function(){for(var a=gn(),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=gn(),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]);Ye(a),Ye(y)};function bx(a){for(var y=gn(),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]);Ye(y)}Ji.prototype.Zx=function(a){a===void 0&&(a=!0),a&&(this.deleteArtificialVertexes(),bx(this),this.Ko()),a=new Pe;for(var y=!0;y;){y=!1;for(var x=this.wf.iterator;x.next();){var E=x.value;if(0<E.tg.count||0<E.mg.count){y=this.layout.createNetwork(),a.add(y),iy(this,y,E),y=!0;break}}}return a.sort(function(b,z){return b===null||z===null||b===z?0:z.vertexes.count-b.vertexes.count}),a};function iy(a,y,x){if(x!==null&&x.network!==y){lS(a,x),y.dh(x);for(var E=x.sourceEdges;E.next();){var b=E.value;b.network!==y&&(ny(a,b),ey(y,b),iy(a,y,b.fromVertex))}for(E=x.destinationEdges;E.next();)x=E.value,x.network!==y&&(ny(a,x),ey(y,x),iy(a,y,x.toVertex))}}Ji.prototype.dz=function(){for(var a=new Fe,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},ke.Object.defineProperties(Ji.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}}}),Ji.prototype.findAllParts=Ji.prototype.dz,Ji.prototype.splitIntoSubNetworks=Ji.prototype.Zx,Ji.prototype.deleteSelfEdges=Ji.prototype.Ko,Ji.prototype.reverseEdge=Ji.prototype.gm,Ji.prototype.linkVertexes=Ji.prototype.Zj,Ji.prototype.findEdge=Ji.prototype.Lo,Ji.prototype.deleteLink=Ji.prototype.Yy,Ji.prototype.deleteEdge=Ji.prototype.Mj,Ji.prototype.addLink=Ji.prototype.Dy,Ji.prototype.addEdge=Ji.prototype.Bo,Ji.prototype.findVertex=Ji.prototype.ki,Ji.prototype.deleteNode=Ji.prototype.Zy,Ji.prototype.deleteVertex=Ji.prototype.Iu,Ji.prototype.addNode=Ji.prototype.Bl,Ji.prototype.addVertex=Ji.prototype.dh,Ji.prototype.addParts=Ji.prototype.lg,Ji.className="LayoutNetwork";function Ko(a){Dn(this),this.ob=a,this.j=new pe(0,0,10,10).freeze(),this.o=new It(5,5).freeze(),this.Sh=this.ub=null,this.tg=new Pe,this.mg=new Pe}Ko.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new Pe,this.mg=new Pe},Ko.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutVertex#"+ci(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},Ko.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 Vn)){x=pe.alloc(),a.Va();var E=this.network.layout.ni(a,x),b=a.locationObject.ga(Di);if(E.w()&&b.w()){a.moveTo(y.x+this.focusX-(b.x-E.x),y.y+this.focusY-(b.y-E.y)),pe.free(x);return}pe.free(x)}a.moveTo(y.x,y.y)}},Ko.prototype.Cl=function(a){a!==null&&(this.tg.contains(a)||this.tg.add(a))},Ko.prototype.Kl=function(a){a!==null&&this.tg.remove(a)},Ko.prototype.zl=function(a){a!==null&&(this.mg.contains(a)||this.mg.add(a))},Ko.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}ke.Object.defineProperties(Ko.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=pe.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),pe.free(x),!(a instanceof Vn)&&(a=a.locationObject.ga(Di),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 Fe,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new Fe,y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new Fe,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 Pe,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}}}),Ko.prototype.deleteDestinationEdge=Ko.prototype.Jl,Ko.prototype.addDestinationEdge=Ko.prototype.zl,Ko.prototype.deleteSourceEdge=Ko.prototype.Kl,Ko.prototype.addSourceEdge=Ko.prototype.Cl,Ko.className="LayoutVertex",Ko.standardComparer=oy,Ko.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 js(a){Dn(this),this.nb=a,this.qd=this.kd=this.$k=this.ub=null}js.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},js.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutEdge#"+ci(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},js.prototype.gm=function(){var a=this.kd;this.kd=this.qd,this.qd=a},js.prototype.commit=function(){},js.prototype.Ax=function(a){return this.qd===a?this.kd:this.kd===a?this.qd:null},ke.Object.defineProperties(js.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)}}}),js.prototype.getOtherVertex=js.prototype.Ax,js.className="LayoutEdge";function yr(a){so.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new Ke(NaN,NaN).freeze(),this.tf=new Ke(10,10).freeze(),this.Jb=ip,this.Rb=n0,this.nd=op,this.hd=uS,a&&Object.assign(this,a)}ne(yr,so),yr.prototype.cloneProtected=function(a){so.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},yr.prototype.qb=function(a){a.classType===yr?a===op||a===o0||a===ry||a===i0?this.sorting=a:a===n0||a===qa?this.arrangement=a:a===ip||a===e0?this.alignment=a:ce("Unknown enum value: "+a):so.prototype.qb.call(this,a)},yr.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 Vn)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 op: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=pe.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 Pt=yt=this.arrangementOrigin.x,kt=this.arrangementOrigin.y,Dt=0,Tt=0,Rt=0;Rt<b.length;Rt++){var Gt=b[Rt],Vt=this.ni(Gt,at),Xt=Math.ceil((Vt.width+ot)/ut)*ut,ie=Math.ceil((Vt.height+rt)/ft)*ft;switch(mt){case qa:var Xe=Math.abs(Pt-Vt.width);break;default:Xe=Pt+Vt.width}switch((0<z&&Dt>z-1||0<tt&&0<Dt&&Xe-yt>tt)&&(E.push(new pe(0,kt,tt+ot,Tt)),Dt=0,Pt=yt,kt+=Tt,Tt=0),Tt=Math.max(Tt,ie),mt){case qa:Vt=-Vt.width;break;default:Vt=0}switch(Gt.moveTo(Pt+Vt,kt),mt){case qa:Pt-=Xt;break;default:Pt+=Xt}Dt++}E.push(new pe(0,kt,tt+ot,Tt)),pe.free(at);break;case ip:for(rt=tt,ut=z,ft=y,mt=x,tt=pe.alloc(),yt=Math.max(this.cellSize.width,1),z=kt=at=0,ot=It.alloc(),Pt=0;Pt<b.length;Pt++)Tt=b[Pt],Dt=this.ni(Tt,tt),Tt=Ru(Tt,Tt.locationObject,Tt.locationSpot,ot),at=Math.max(at,Tt.x),kt=Math.max(kt,Dt.width-Tt.x),z=Math.max(z,Tt.y);switch(Pt=this.arrangement,Pt){case qa:at+=ft;break;default:kt+=ft}yt=isFinite(yt)?Math.max(yt+ft,1):Math.max(at+kt,1);var an=Tt=this.arrangementOrigin.x;for(Rt=this.arrangementOrigin.y,kt=0,rt>=at&&(rt-=at),at=Gt=0,Xt=Math.max(this.cellSize.height,1),Vt=z=0,ie=!0,Dt=It.alloc(),Xe=0;Xe<b.length;Xe++){var on=b[Xe],je=this.ni(on,tt),Me=Ru(on,on.locationObject,on.locationSpot,ot);if(0<kt)switch(Pt){case qa:an=(an-Tt-(je.width-Me.x))/yt,an=Qt.$(Math.round(an),an)?Math.round(an):Math.floor(an),an=an*yt+Tt;break;default:an=(an-Tt+Me.x)/yt,an=Qt.$(Math.round(an),an)?Math.round(an):Math.ceil(an),an=an*yt+Tt}else switch(Pt){case qa:Gt=an+Me.x+je.width;break;default:Gt=an-Me.x}switch(Pt){case qa:var Wn=-(an+Me.x)+Gt;break;default:Wn=an+je.width-Me.x-Gt}if(0<ut&&kt>ut-1||0<rt&&0<kt&&Wn>rt){for(E.push(new pe(0,ie?Rt-z:Rt,rt+ft,Vt+z+mt)),an=0;an<kt&&Xe!==kt;an++){Wn=b[Xe-kt+an];var jn=Ru(Wn,Wn.locationObject,Wn.locationSpot,Dt);Wn.moveTo(Wn.position.x,Wn.position.y+z-jn.y)}Vt+=mt,Rt=ie?Rt+Vt:Rt+(Vt+z),kt=Vt=z=0,an=Tt,ie=!1}switch(an===Tt&&(at=Pt===qa?Math.max(at,je.width-Me.x):Math.min(at,-Me.x)),z=Math.max(z,Me.y),Vt=Math.max(Vt,je.height-Me.y),isFinite(Xt)&&(Vt=Math.max(Vt,Math.max(je.height,Xt)-Me.y)),ie?on.moveTo(an-Me.x,Rt-Me.y):on.moveTo(an-Me.x,Rt),Pt){case qa:an-=Me.x+ft;break;default:an+=je.width-Me.x+ft}kt++}if(E.push(new pe(0,Rt,rt+ft,(ie?Vt:Vt+z)+mt)),b.length!==kt)for(rt=0;rt<kt;rt++)ut=b[b.length-kt+rt],ft=Ru(ut,ut.locationObject,ut.locationSpot,ot),ut.moveTo(ut.position.x,ut.position.y+z-ft.y);if(It.free(ot),It.free(Dt),Pt===qa)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);pe.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===qa?this.commitLayers(E,new It(b+y/2-(z+b),tt-x/2)):this.commitLayers(E,new It(b-y/2,tt-x/2)),a!==null&&a.eb("Layout"),this.isValidLayout=!0}},yr.prototype.commitLayers=function(){};function uS(a,y){return a=a.text,y=y.text,a<y?-1:a>y?1:0}ke.Object.defineProperties(yr.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!==ip&&a!==e0||(this.Jb=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==n0&&a!==qa||(this.Rb=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==ry&&a!==i0&&a!==op&&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 he(yr,"Position",0),ip=new he(yr,"Location",1),n0=new he(yr,"LeftToRight",2),qa=new he(yr,"RightToLeft",3),ry=new he(yr,"Forward",4),i0=new he(yr,"Reverse",5),op=new he(yr,"Ascending",6),o0=new he(yr,"Descending",7);yr.className="GridLayout",yr.standardComparer=uS,yr.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},yr.Position=e0,yr.Location=ip,yr.LeftToRight=n0,yr.RightToLeft=qa,yr.Forward=ry,yr.Reverse=i0,yr.Ascending=op,yr.Descending=o0;function Ii(){this.On=new Fe,this.Dn=new Fe,this.Pa=new Fe,this.cf=new ln,this.bf=new ln,this.aj=new ln,this.H=null,this.tp=!1}xt=Ii.prototype,xt.clear=function(){this.On.clear(),this.Dn.clear(),this.Pa.clear(),this.cf.clear(),this.bf.clear(),this.aj.clear()},xt.Xe=function(a){this.H=a},xt.oi=function(a){if(a instanceof Je){if(this.On.add(a),a instanceof Vn){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 _e?this.Dn.add(a):a instanceof wi||this.Pa.add(a);y=a.data,y===null||a instanceof wi||(a instanceof _e?this.bf.add(y,a):this.cf.add(y,a))},xt.pc=function(a){if(a.Ej(),a instanceof Je){if(this.On.remove(a),a instanceof Vn){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 _e?this.Dn.remove(a):a instanceof wi||this.Pa.remove(a);y=a.data,y===null||a instanceof wi||(a instanceof _e?this.bf.remove(y):this.cf.remove(y))},xt.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 Vn)&&ce('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 Vn||ce('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 _e||ce('Invalid link template in Diagram.linkTemplateMap: template for "'+E+'" must be a Link, not a normal Node or simple Part: '+x);for(y=gn(),x=a.selection.iterator;x.next();)(E=x.value.data)&&y.push(E);for(x=gn(),a=a.highlighteds.iterator;a.next();)(E=a.value.data)&&x.push(E);for(a=gn(),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]);Ye(y),Ye(x),Ye(a)}},Ii.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},Ii.prototype.addModeledParts=function(a,y){var x=this,E=this.diagram.model;a.forEach(function(b){E.lb(b)&&hS(x,b,!1)}),a.forEach(function(b){E.lb(b)&&x.resolveReferencesForData(b)}),y!==!1&&qc(this.diagram,!1)};function hS(a,y,x){if(y!=null&&!a.diagram.undoManager.isUndoingRedoing&&!a.cf.contains(y)){x===void 0&&(x=!0);t:{if(y!=null&&!a.H.undoManager.isUndoingRedoing&&!a.cf.contains(y)){var E=a.Ro(y),b=dS(a,y,E);if(b!==null&&(Ca(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)}}Ii.prototype.insertLink=function(){return null},Ii.prototype.resolveReferencesForData=function(){},Ii.prototype.Ro=function(a){return this.H.model.Ro(a)};function dS(a,y,x){a=a.H;var E=a.model;return E.Xj()&&E.Yu(y)?(y=a.groupTemplateMap.I(x),y===null&&(y=a.groupTemplateMap.I(""),y===null&&(gS||(gS=!0,Be('No Group template found for category "'+x+'"'),Be(" Using default group template")),y=a.ly))):(y=a.nodeTemplateMap.I(x),y===null&&(y=a.nodeTemplateMap.I(""),y===null&&(fS||(fS=!0,Be('No Node template found for category "'+x+'"'),Be(" Using default node template")),y=a.ny))),y}Ii.prototype.getLinkCategoryForData=function(){return""},Ii.prototype.setLinkCategoryForData=function(){},Ii.prototype.setFromNodeForLink=function(){},Ii.prototype.setToNodeForLink=function(){},Ii.prototype.findLinkTemplateForCategory=function(a){var y=this.H,x=y.linkTemplateMap.I(a);return x===null&&(x=y.linkTemplateMap.I(""),x===null&&(pS||(pS=!0,Be('No Link template found for category "'+a+'"'),Be(" Using default link template")),x=y.my)),x},Ii.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},Ii.prototype.Gs=function(a){var y=this;a.forEach(function(x){y.ip(x)})},Ii.prototype.ip=function(a){a=this.Lc(a),a!==null&&(yg(this.diagram,a,!1),this.unresolveReferencesForPart(a))},Ii.prototype.unresolveReferencesForPart=function(){},Ii.prototype.removeDataForLink=function(){},Ii.prototype.findPartForKey=function(a){return a==null?null:(a=this.H.model.hc(a),a!==null?this.cf.I(a):null)},Ii.prototype.Vb=function(a){return a==null||(a=this.H.model.hc(a),a===null)?null:(a=this.cf.I(a),a instanceof Je?a:null)},Ii.prototype.findLinkForKey=function(){return null},xt=Ii.prototype,xt.Lc=function(a){if(a===null)return null;var y=this.cf.I(a);return y!==null?y:y=this.bf.I(a)},xt.ii=function(a){return a===null?null:(a=this.cf.I(a),a instanceof Je?a:null)},xt.Kc=function(a){return a===null?null:this.bf.I(a)},xt.ms=function(a){for(var y=0;y<arguments.length;++y);y=new Fe;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},xt.ls=function(a){for(var y=0;y<arguments.length;++y);y=new Fe;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(ae(z)){if(!ae(b)||b.length<z.length)return!1;for(var tt=0;tt<b.length;tt++){var ot=z[tt];if(ot!==void 0&&!cS(a,b[tt],ot))return!1}}else if(!cS(a,b,z))return!1}return!0}function cS(a,y,x){if(typeof x=="function"){if(!x(y))return!1}else if(x instanceof RegExp){if(!y||!x.test(y.toString()))return!1}else if(qt(y)&&qt(x)){if(!sy(a,y,x))return!1}else if(y!==x)return!1;return!0}Ii.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===uo){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===bo){var tt=a.newValue;E==="nodeDataArray"&&qt(tt)&&hS(this,tt),y.isModified=!0}else if(x===Uo){var ot=a.oldValue;E==="nodeDataArray"&&qt(ot)&&this.ip(ot),y.isModified=!0}else x===Bs&&(E==="SourceChanged"?a.object!==null?this.updateDataBindings(a.object,a.propertyName):(this.rp(),this.updateAllTargetBindings()):E==="ModelDisplaced"&&this.Wd());else if(x===uo){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===bo||x===Uo){var ut=a.change===bo,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 Pt=yt[a];if(ut)Cm(Pt,mt,ft,!0);else if(!(0>ft)){var kt=ft+zg(Pt);Pt.pc(kt,!0),xv(Pt,kt,ft)}}y.isModified=!0}}finally{y.aa=!0}}}}},Ii.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)},Ii.prototype.rp=function(){for(var a=this.H.model,y=new Fe,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){LS(a,tt,!1)}),E=0;E<x.length;E++){var z=x[E];this.Lc(z)===null&&CS(a,z,!1)}for(this.refreshDataBoundLinks(),x=this.parts.iterator;x.next();)x.value.updateRelationshipsFromData();for(x=this.nodes.iterator;x.next();)x.value.updateRelationshipsFromData();for(x=this.links.iterator;x.next();)x.value.updateRelationshipsFromData()},Ii.prototype.refreshDataBoundLinks=function(){},Ii.prototype.updateRelationshipsFromData=function(){},Ii.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=gn()),x.push(tt))}if(x!==null)break}if(x!==null){for(E=0;E<x.length;E++)x[E].La(y);Ye(x)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(y)}};function ay(a,y){var x=y.Hh;if(ae(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){fd(y,function(tt){tt=tt.O.s;for(var ot=tt.length,rt=0;rt<ot;rt++)Cg(x,tt[rt])});var E=y.Hh;if(ae(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}}}}Ii.prototype.Kj=function(a,y,x){x===void 0&&(x=!1);var E=new ln;if(ae(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 Fe;for(var z=new ln,tt=E.iterator;tt.next();){var ot=tt.value;if(ot instanceof _e)a||ot.fromNode!==null&&ot.toNode!==null||b.add(ot);else if(ot instanceof Je&&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 ln;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 kn))return null;if(z.isSelected=!1,z.isHighlighted=!1,E.add(y,z),y instanceof Je){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 Vn&&z instanceof Vn)for(y=y.memberParts;y.next();)tt=r0(a,y.value,x,E,b),tt instanceof _e||tt===null||(tt.containingGroup=z)}else if(y instanceof _e&&z instanceof _e)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 Je&&(tt.labeledLink=z);return z}Ii.prototype.copyPartData=function(a,y){var x=null,E=a.data;if(E!==null&&y!==null){var b=y.model;a instanceof _e||(E=b.copyNodeData(E),qt(E)&&(b.xf(E),x=y.Lc(E)))}else Ca(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 _e||(b=y.copyNodeData(E)),qt(b)&&(x.data=b)));return x},ke.Object.defineProperties(Ii.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}}}),Ii.prototype.updateAllRelationshipsFromData=Ii.prototype.rp,Ii.prototype.findLinksByExample=Ii.prototype.ls,Ii.prototype.findNodesByExample=Ii.prototype.ms,Ii.prototype.findLinkForData=Ii.prototype.Kc,Ii.prototype.findNodeForData=Ii.prototype.ii,Ii.prototype.findPartForData=Ii.prototype.Lc,Ii.prototype.findNodeForKey=Ii.prototype.Vb,Ii.prototype.removeModeledPart=Ii.prototype.ip,Ii.prototype.removeModeledParts=Ii.prototype.Gs,Ii.prototype.rebuildParts=Ii.prototype.Wd;var fS=!1,gS=!1,pS=!1;Ii.className="PartManager";function or(a){Ii.apply(this,arguments)}ne(or,Ii),or.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray),mS(this,a.linkDataArray)},or.prototype.addModeledParts=function(a){for(Ii.prototype.addModeledParts.call(this,a,!1),a=this.links.iterator;a.next();)xf(a.value);qc(this.diagram,!1)};function mS(a,y){y.forEach(function(x){vS(a,x)}),qc(a.diagram,!1)}function vS(a,y){if(y!=null&&!a.diagram.undoManager.isUndoingRedoing&&!a.bf.contains(y)){var x=a.getLinkCategoryForData(y),E=a.findLinkTemplateForCategory(x);if(E!==null){Ca(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=qs(x,y,!0),z!==void 0&&(z=a.Vb(z),z instanceof Je&&(b.fromNode=z)),z=u0(x,y,!1),z!==""&&(b.toPortId=z),z=qs(x,y,!1),z!==void 0&&(z=a.Vb(z),z instanceof Je&&(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}}}}or.prototype.removeAllModeledParts=function(){var a=this.diagram.model;yS(this,a.linkDataArray),this.Gs(a.nodeDataArray)};function yS(a,y){y.forEach(function(x){a.ip(x)})}or.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ps(a)},or.prototype.setLinkCategoryForData=function(a,y){return this.diagram.model.lp(a,y)},or.prototype.setFromNodeForLink=function(a,y){var x=this.diagram.model;x.wv(a.data,x.wa(y!==null?y.data:null))},or.prototype.setToNodeForLink=function(a,y){var x=this.diagram.model;x.Bv(a.data,x.wa(y!==null?y.data:null))},or.prototype.removeDataForLink=function(a){this.diagram.model.bm(a.data)},or.prototype.findPartForKey=function(a){var y=Ii.prototype.findPartForKey.call(this,a);return y===null&&(a=this.diagram.model.jh(a),a!==null)?this.bf.I(a):y},or.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.jh(a),a!==null?this.bf.I(a):null)},or.prototype.doModelChanged=function(a){var y=this;if(Ii.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===uo){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 Pt=a.newValue;if(Pt!==void 0){var kt=this.Vb(Pt);kt instanceof Vn?yt.containingGroup=kt:yt.containingGroup=null}else yt.containingGroup=null}}else if(b==="linkLabelKeys"){var Dt=this.Kc(a.object);if(Dt!==null){var Tt=a.oldValue,Rt=a.newValue;Array.isArray(Tt)&&Tt.forEach(function(Me){0<=Rt.indexOf(Me)||(Me=y.Vb(Me),Me!==null&&(Me.labeledLink=null))}),Array.isArray(Rt)&&Rt.forEach(function(Me){Me=y.Vb(Me),Me!==null&&(Me.labeledLink=Dt)})}}else if(b==="linkCategory"){var Gt=this.Kc(a.object),Vt=a.newValue;Gt!==null&&typeof Vt=="string"&&(Gt.category=Vt)}else b==="linkDataArray"&&(yS(this,a.oldValue),mS(this,a.newValue));x.isModified=!0}else if(E===bo){var Xt=a.newValue;if(b==="linkDataArray"&&typeof Xt=="object"&&Xt!==null)vS(this,Xt);else if(b==="linkLabelKeys"&&Eh(Xt)){var ie=this.Kc(a.object),Xe=this.Vb(Xt);ie!==null&&Xe!==null&&(Xe.labeledLink=ie)}x.isModified=!0}else if(E===Uo){var an=a.oldValue;if(b==="linkDataArray"&&typeof an=="object"&&an!==null)this.ip(an);else if(b==="linkLabelKeys"&&Eh(an)){var on=this.Vb(an);on!==null&&(on.labeledLink=null)}x.isModified=!0}}else if(E===uo){var je=a.propertyName;a.object!==x.model||je!=="linkFromKeyProperty"&&je!=="linkToKeyProperty"&&je!=="linkFromPortIdProperty"&&je!=="linkToPortIdProperty"&&je!=="linkLabelKeysProperty"&&je!=="nodeIsGroupProperty"&&je!=="nodeGroupKeyProperty"&&je!=="linkCategoryProperty"||x.undoManager.isUndoingRedoing||this.Wd(),x.isModified=!0}}finally{x.aa=!0}}}}},or.prototype.refreshDataBoundLinks=function(){var a=this,y=this.diagram.model,x=new Fe,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){bS(y,z,!1)}),E.forEach(function(z){a.Kc(z)===null&&NS(y,z,!1)})},or.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 _e){var b=qs(E,y,!0);if(b=x.Vb(b),a.fromNode=b,b=qs(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 Fe().addAll(y);var tt=new Fe;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 wi)&&(y=E.lh(y),y=x.findPartForKey(y),y===null||y instanceof Vn)&&(a.containingGroup=y)}}},or.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=rp(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 Vn&&y.lh(tt)===x&&(tt=this.Lc(tt),tt!==null&&(tt.containingGroup=b)):(z.link=this.Kc(tt),z.link!==null&&b instanceof Je&&(qs(y,tt,!0)===x&&(z.link.fromNode=b),qs(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}}tl(y,x)}a=y.lh(a),a!==void 0&&(a=this.Vb(a),a instanceof Vn&&(b.containingGroup=a))}},or.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof Je){var x=y.wa(a.data);if(x!==void 0){for(var E=a.linksConnected;E.next();)$a(y,x,E.value.data);if(a.isLinkLabel&&(E=a.labeledLink,E!==null&&$a(y,x,E.data)),a instanceof Vn)for(a=a.memberParts;a.next();)E=a.value.data,y.lb(E)&&$a(y,x,E)}}},or.prototype.copyPartData=function(a,y){var x=Ii.prototype.copyPartData.call(this,a,y);if(a instanceof _e)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},or.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 _e){if(Ca(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 Je&&(Ca(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&&Mf(z,E,z.wa(a.data),!0),Ef(z,E,ot,!0),x!==null&&Mf(z,E,z.wa(x.data),!1),Ef(z,E,y,!1),z.fi(E),a=tt.archetypeLabelNodeData,a===null||a instanceof Je||(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},or.prototype.findLinkForKey=or.prototype.findLinkForKey,or.prototype.findPartForKey=or.prototype.findPartForKey,or.prototype.removeAllModeledParts=or.prototype.removeAllModeledParts,or.prototype.addModeledParts=or.prototype.addModeledParts,or.prototype.addAllModeledParts=or.prototype.addAllModeledParts,or.className="GraphLinksPartManager";function fa(){Ii.apply(this,arguments),this.Sg=null}ne(fa,Ii);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||!Xr(E,b,z,null,!0))&&(y=a.getLinkCategoryForData(x.data),E=a.findLinkTemplateForCategory(y),E!==null&&(Ca(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}}}fa.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ss(a)},fa.prototype.setLinkCategoryForData=function(a,y){this.diagram.model.Ms(a,y)},fa.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}},fa.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))},fa.prototype.removeDataForLink=function(a){this.diagram.model.qe(a.data,void 0)},fa.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.hc(a),a!==null?this.bf.I(a):null)},fa.prototype.doModelChanged=function(a){if(Ii.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===uo){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===uo){var ft=a.propertyName;a.object===y.model&&ft==="nodeParentKeyProperty"&&(y.undoManager.isUndoingRedoing||this.Wd()),y.isModified=!0}}finally{y.aa=!0}}}}},fa.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;a instanceof Je&&(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&&yg(x,E,!1)))}}},fa.prototype.updateDataBindings=function(a,y){Ii.prototype.updateDataBindings.call(this,a,y),typeof y=="string"&&this.Lc(a)!==null&&(a=this.Kc(a),a!==null&&a.La(y))},fa.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=rp(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 Je&&y.mh(z)===x&&s0(this,b,this.ii(z))}tl(y,x)}a=y.mh(a),a!==void 0&&b instanceof Je&&(a=this.Vb(a),s0(this,a,b))}},fa.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof Je){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(Uo,"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)&&$a(y,x,b)}},fa.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},fa.prototype.findLinkForKey=fa.prototype.findLinkForKey,fa.className="TreePartManager";function cn(a,y){this.kl=new Fe,this.il=new Fe,this.Wv=`,
"insertedNodeKeys": `,this.jy=`,
"modifiedNodeData": `,this.Yv=`,
"removedNodeKeys": `,this.vh=null,Dn(this),this.Sm=this.xa="",this.Gg=!1,this.j={},this.Tc=[],this.kb=new ln,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 ln,this.Lt=new Pe,this.Wg=!1,this.o=null,this.undoManager=new co,a!==void 0&&(ae(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}cn.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},cn.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},cn.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},cn.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)+":"+ei(b)}}return y},cn.prototype.xA=function(a){a.change!==Bs&&ce("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var y=a.object;return a.isTransactionFinished&&y instanceof ir?(xS(this,y),a=this.Qv(y,a.propertyName==="FinishedUndo"),this.vh=null,a):null},cn.prototype.Qv=function(a,y){var x=this,E=!1,b=new Fe,z=new Fe,tt=new Fe,ot=this.vh;a.changes.each(function(ft){ft.model===x&&(ft.modelChange==="nodeDataArray"?ft.change===bo?b.add(ft.newValue):ft.change===Uo&&tt.add(ft.oldValue):x.lb(ft.object)?z.add(ft.object):ft.change!==uo||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 cn||x.ri()&&x.Jc(ft.object)||PS(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},cn.prototype.cloneDeep=function(a){return kf(this,a,!0)};function kf(a,y,x,E,b,z){function tt(ft,mt){ot?(ft.__gohashid===void 0&&z.push(ft),E.set(ft,mt)):(ft=nr++,E.set(ft,mt),b.set(ft,y))}if(!qt(y))return y;z||(z=[]);var ot=Object.isExtensible(y);if(E||(E=new ln),ot){var rt=E.get(y);if(rt)return rt}else for(b||(b=new ln),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(kf(a,y[ut],!1,E,b,z))}else if(y instanceof It||y instanceof Ke||y instanceof pe||y instanceof qn||y instanceof En)rt=y.copy(),tt(y,rt);else{if(y instanceof Oi||y instanceof Ve||y instanceof he)return y;if(y instanceof Pe)rt=new Pe().addAll(kf(a,y.Fa(),!1,E,b,z)),tt(y,rt);else if(y instanceof Fe)rt=new Fe().addAll(kf(a,y.Fa(),!1,E,b,z)),tt(y,rt);else if(y instanceof ln)rt=new ln().addAll(kf(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]=kf(a,y[ut],!1,E,b,z))}return x&&z.forEach(function(ft){delete ft.__gohashid}),rt}xt=cn.prototype,xt.quote=function(a){return JSON.stringify(a).replace(/[\u007F-\uFFFF]/g,function(y){return"\\u"+("0000"+y.charCodeAt(0).toString(16)).substr(-4)})},xt.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},xt.gp=function(a){a.name&&(this.name=a.name),a.dataFormat&&(this.dataFormat=a.dataFormat),a.isReadOnly&&(this.isReadOnly=!0),a.nodeKeyProperty&&(this.nodeKeyProperty=a.nodeKeyProperty),a.copiesArrays&&(this.copiesArrays=!0),a.copiesArrayObjects&&(this.copiesArrayObjects=!0),a.copiesKey===!1&&(this.copiesKey=!1),a.nodeCategoryProperty&&(this.nodeCategoryProperty=a.nodeCategoryProperty)};function SS(a,y){y=y.modelData,qt(y)&&(a.dm(y),a.modelData=y)}xt.Rv=function(){var a=this.modelData,y=!1,x;for(x in a)if(!wS(x,a[x])){y=!0;break}return a="",y&&(a=`,
"modelData": `+uy(this,this.modelData)),a+`,
"nodeDataArray": `+Mh(this,this.nodeDataArray,!0)},xt.kv=function(a){SS(this,a),a=a.nodeDataArray,ae(a)&&(this.dm(a),this.nodeDataArray=a)};function xS(a,y){function x(b,z){if((z=z.part)&&(z=z.data,b!==z)){var tt=E.get(b);tt===null?(tt=new Fe,tt.add(z),E.add(b,tt)):tt.add(z)}}var E=a.vh;E===null&&(E=new ln,y.changes.each(function(b){if(b.diagram!==null){var z=b.change;z===uo?(b=b.object.panel)&&(z=b.data)&&x(z,b):(z===bo||z===Uo)&&(b=b.object,(z=b.itemArray)&&x(z,b))}}),a.vh=E)}function PS(a,y){for(var x=new Fe,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}xt.Pv=function(a,y){var x=this,E=!1,b=new Fe,z=new Fe,tt=new Fe,ot=this.vh;a.changes.each(function(ut){ut.model===x&&(ut.modelChange==="nodeDataArray"?ut.change===bo?b.add(ut.newValue):ut.change===Uo&&tt.add(ut.oldValue):x.lb(ut.object)?z.add(ut.object):ut.change!==uo||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 cn||x.ri()&&x.Jc(ut.object)||PS(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)+Mh(this,rt.Fa(),!0)),0<z.count&&(a+=this.jy+Mh(this,z.Fa(),!0)),0<at.count&&(a+=(y?this.Wv:this.Yv)+Mh(this,at.Fa(),!0)),at.clear(),rt.clear(),a},xt.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)&&ce("applyIncrementalJson cannot change Model properties"),SS(this,a);var y=a.insertedNodeKeys,x=a.modifiedNodeData,E=new ln;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)},xt.$x=function(a,y){a.change!==Bs&&ce("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var x=a.object;return a.isTransactionFinished&&x instanceof ir?(y===void 0&&(y=sp(this,this)),xS(this,x),a=this.Pv(x,a.propertyName==="FinishedUndo"),this.vh=null,y==="2"?'{ "incremental": 2'+a+"}":'{ "class": '+this.quote(y)+', "incremental": 1'+this.rm()+a+"}"):'{ "incremental": 0 }'},xt.yA=function(a,y){return this.$x(a,y)},xt.np=function(a){return a===void 0&&(a=sp(this,this)),'{ "class": '+this.quote(a)+this.rm()+this.Rv()+"}"},xt.toJSON=function(a){return this.np(a)},xt.Zw=function(a){var y=null;if(typeof a=="string")try{y=ge.JSON.parse(a)}catch(E){}else typeof a=="object"?y=a:ce("Unable to modify a Model from: "+a);var x=y.incremental;typeof x!="number"&&ce("Unable to apply non-incremental changes to Model: "+a),x!==0&&(this.Ea("applyIncrementalJson"),this.fp(y),this.eb("applyIncrementalJson"))},xt.Ky=function(a){return this.Zw(a)},cn.constructGraphLinksModel=function(){return new cn},xt=cn.prototype,xt.dm=function(a){if(ae(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:ce("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 Pe,E=0;E<x.length/2;E++)b.add(new It(x[2*E],x[2*E+1]));b.freeze(),a[y]=b}}return Tx(a)}return a},xt.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()):ae(a)?Mh(this,a):qt(a)?uy(this,a):typeof a=="function"?"null":a.toString()};function Mh(a,y,x){x===void 0&&(x=!1);var E=y.length;if(0>=E)return"[]";var b=new gi;b.add("["),x&&1<E&&b.add(`
`);for(var z=0;z<E;z++){var tt=y[z];tt!==void 0&&(0<z&&(b.add(","),x&&b.add(`
`)),b.add(a.sm(tt)))}return x&&1<E&&b.add(`
`),b.add("]"),b.toString()}function wS(a,y){return y===void 0||a==="__gohashid"||a[0]==="_"||typeof y=="function"}function os(a){return isNaN(a)?"NaN":a===1/0?"9e9999":a===-1/0?"-9e9999":a}function uy(a,y){var x=y;if(x instanceof It)y={class:"go.Point",x:os(x.x),y:os(x.y)};else if(x instanceof Ke)y={class:"go.Size",width:os(x.width),height:os(x.height)};else if(x instanceof pe)y={class:"go.Rect",x:os(x.x),y:os(x.y),width:os(x.width),height:os(x.height)};else if(x instanceof qn)y={class:"go.Margin",top:os(x.top),right:os(x.right),bottom:os(x.bottom),left:os(x.left)};else if(x instanceof En)x.sb()?y={class:"go.Spot",x:os(x.x),y:os(x.y),offsetX:os(x.offsetX),offsetY:os(x.offsetY)}:y={class:"go.Spot",enum:x.toString()};else if(x instanceof Oi){if(y={class:"go.Brush",type:x.type.name},x.type===Ou?y.color=x.color:(x.type===iu||x.type===da)&&(y.start=x.start,y.end=x.end,x.type===da&&(x.startRadius!==0&&(y.startRadius=os(x.startRadius)),isNaN(x.endRadius)||(y.endRadius=os(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 Ve?(y={class:"go.Geometry",type:x.type.name},x.startX!==0&&(y.startX=os(x.startX)),x.startY!==0&&(y.startY=os(x.startY)),x.endX!==0&&(y.endX=os(x.endX)),x.endY!==0&&(y.endY=os(x.endY)),x.spot1.D(Cr)||(y.spot1=x.spot1),x.spot2.D(na)||(y.spot2=x.spot2),x.type===Ve.o&&(y.path=Ve.ia(x))):x instanceof he&&(y={class:"go.EnumValue",classType:sp(a,x.classType),name:x.name});E="{",x=!0;for(var b in y){var z=Fo(y,b);if(!wS(b,z))if(x?x=!1:E+=",",E+=a.quote(b)+":",b==="points"&&z instanceof Pe){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 rs(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 It(rs(a.x),rs(a.y));else if(y==="Size")x=new Ke(rs(a.width),rs(a.height));else if(y==="Rect")x=new pe(rs(a.x),rs(a.y),rs(a.width),rs(a.height));else if(y==="Margin")x=new qn(rs(a.top),rs(a.right),rs(a.bottom),rs(a.left));else if(y==="Spot")typeof a.enum=="string"?x=bc(a.enum):x=new En(rs(a.x),rs(a.y),rs(a.offsetX),rs(a.offsetY));else if(y==="Brush"){if(x=new Oi,x.type=Yn(Oi,a.type),typeof a.color=="string"&&(x.color=a.color),a.start instanceof En&&(x.start=a.start),a.end instanceof En&&(x.end=a.end),typeof a.startRadius=="number"&&(x.startRadius=rs(a.startRadius)),typeof a.endRadius=="number"&&(x.endRadius=rs(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=Ve.parse(a.path):x=new Ve,x.type=Yn(Ve,a.type),typeof a.startX=="number"&&(x.startX=rs(a.startX)),typeof a.startY=="number"&&(x.startY=rs(a.startY)),typeof a.endX=="number"&&(x.endX=rs(a.endX)),typeof a.endY=="number"&&(x.endY=rs(a.endY)),a.spot1 instanceof En&&(x.spot1=a.spot1),a.spot2 instanceof En&&(x.spot2=a.spot2)):y==="EnumValue"&&(E=a.classType,E.indexOf("go.")===0&&(E=E.substr(3)),E=dy(E),typeof E=="function"&&(x=Yn(E,a.name)));return x}xt.Pe=function(a){return this.Lt.add(a),this},xt.ik=function(a){this.Lt.remove(a)},xt.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)},xt.cb=function(a,y,x,E,b,z,tt){Wo(this,"",a,y,x,E,b,z,tt)},xt.g=function(a,y,x,E,b){Wo(this,"",uo,a,this,y,x,E,b)},xt.Fs=function(a,y,x,E,b,z){Wo(this,"",uo,y,a,x,E,b,z)};function Wo(a,y,x,E,b,z,tt,ot,rt){ot===void 0&&(ot=null),rt===void 0&&(rt=null);var at=new ho;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)}cn.prototype.changeState=function(a,y){if(a!==null&&a.model===this)if(a.change===uo){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)),ro(x,E,b)}else a.change===bo?(x=a.newParam,a.modelChange==="nodeDataArray"?(a=a.newValue,qt(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]===a&&Ai(this.Tc,x),E!==void 0&&this.kb.remove(E)):(this.Tc[x]!==a&&Gi(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)))):a.modelChange===""?((E=a.object)&&!ae(E)&&a.propertyName&&(E=Fo(a.object,a.propertyName)),ae(E)&&typeof x=="number"&&(a=a.newValue,y?Ai(E,x):Gi(E,x,a))):ce("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===Uo?(x=a.oldParam,a.modelChange==="nodeDataArray"?(a=a.oldValue,qt(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]!==a&&Gi(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)):(this.Tc[x]===a&&Ai(this.Tc,x),E!==void 0&&this.kb.remove(E)))):a.modelChange===""?((E=a.object)&&!ae(E)&&a.propertyName&&(E=Fo(a.object,a.propertyName)),ae(E)&&typeof x=="number"&&(a=a.oldValue,y?Gi(E,x,a):Ai(E,x))):ce("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==Bs&&ce("unknown ChangedEvent: "+a.toString())},cn.prototype.Ea=function(a){return this.undoManager.Ea(a)},cn.prototype.eb=function(a){return this.undoManager.eb(a)},cn.prototype.Kf=function(){return this.undoManager.Kf()},cn.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}},xt=cn.prototype,xt.La=function(a,y){y===void 0&&(y=""),Wo(this,"SourceChanged",Bs,y,a,null,null)},xt.wa=function(a){if(a!==null){var y=this.Th;if(y!==""&&(y=Fo(a,y),y!==void 0)){if(Eh(y))return y;ce("Key value for node data "+a+" is not a number or a string: "+y)}}},xt.km=function(a,y){if(a!==null){var x=this.Th;if(x!=="")if(this.lb(a)){var E=Fo(a,x);E!==y&&this.hc(y)===null&&(ro(a,x,y),E!==void 0&&this.kb.remove(E),this.kb.add(y,a),Wo(this,"nodeKey",uo,x,a,E,y),typeof x=="string"&&this.La(a,x),this.jp(E,y))}else ro(a,x,y)}};function Eh(a){return typeof a=="number"||typeof a=="string"}xt.lb=function(a){var y=this.wa(a);return y===void 0?!1:this.kb.I(y)===a},xt.hc=function(a){return a===null&&ce("Model.findNodeDataForKey:key must not be null"),a!==void 0&&Eh(a)?this.kb.I(a):null},xt.$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))){ro(a,y,x);return}if(typeof x=="string"){for(E=2;this.kb.contains(x+E);)E++;ro(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.kb.count-1;this.kb.contains(x);)x--;ro(a,y,x)}}}}},xt.xf=function(a){a!==null&&(Hi(a),this.lb(a)||CS(this,a,!0))};function CS(a,y,x){var E=a.wa(y);(E===void 0||a.kb.I(E)!==y)&&(a.$u(y),E=a.wa(y),E===void 0&&ce("Model.makeNodeDataKeyUnique failed on "+y+". Data not added to Model."),a.kb.add(E,y),E=null,x&&(E=a.Tc.length,Gi(a.Tc,E,y)),Wo(a,"nodeDataArray",bo,"nodeDataArray",a,null,y,null,E),a.fm(y),a.em(y))}xt.Fy=function(a){if(ae(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)},xt.cm=function(a){a!==null&&LS(this,a,!0)};function LS(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;Ai(a.Tc,E)}Wo(a,"nodeDataArray",Uo,"nodeDataArray",a,y,null,E,null),a.qp(y)}xt.nA=function(a){if(ae(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)},xt.$z=function(a){if(a!==this.nodeDataArray&&ae(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()}},xt.jp=function(a,y){y!==void 0&&(a=rp(this,a),a instanceof Fe&&this.Vf.add(y,a))},xt.Lv=function(){},xt.fm=function(){},xt.em=function(){},xt.qp=function(){};function $a(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E===null&&(E=new Fe,a.Vf.add(y,E)),E.add(x)}}function tl(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E instanceof Fe&&(x==null?a.Vf.remove(y):(E.remove(x),E.count===0&&a.Vf.remove(y)))}}function rp(a,y){return y===void 0?null:(a=a.Vf.I(y),a instanceof Fe?a:null)}xt.Qy=function(a){a===void 0?this.Vf.clear():this.Vf.remove(a)},cn.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)&&Dn(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 Dn(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=Fo(y,E),tt=sp(a,z);tt==="GraphObject"||tt==="Diagram"||tt==="Layer"||tt==="RowColumnDefinition"||tt==="AnimationManager"||tt==="Tool"||tt==="CommandHandler"||tt==="Layout"||tt==="InputEvent"||tt==="DiagramEvent"||z instanceof cn||z instanceof co||z instanceof ir||z instanceof ho||(z=l0(a,z,!1)),ro(x,E,z)}return Dn(x),x}return y instanceof It||y instanceof Ke||y instanceof pe||y instanceof En||y instanceof qn?y.copy():y}cn.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!kS&&a instanceof Jt&&(kS=!0,Be('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),Be(" Is that really your intent?"));var E=Fo(a,y);E!==x&&(ro(a,y,x),this.Fs(a,y,E,x))},xt=cn.prototype,xt.set=function(a,y,x){this.setDataProperty(a,y,x)},xt.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])}},xt.Ay=function(a,y){this.ts(a,-1,y)},xt.ts=function(a,y,x){0>y&&(y=a.length),Gi(a,y,x),Wo(this,"",bo,"",a,null,x,null,y)},xt.ov=function(a,y){y===void 0&&(y=-1),a===this.Tc&&ce("Model.removeArrayItem should not be called on the Model.nodeDataArray"),y===-1&&(y=a.length-1);var x=a[y];Ai(a,y),Wo(this,"",Uo,"",a,x,null,y,null)},xt.Ro=function(a){if(a===null)return"";var y=this.lj;if(y===""||(y=Fo(a,y),y===void 0))return"";if(typeof y=="string")return y;ce("getCategoryForNodeData found a non-string category for "+a+": "+y)},xt.jm=function(a,y){if(a!==null){var x=this.lj;if(x!=="")if(this.lb(a)){var E=Fo(a,x);E===void 0&&(E=""),E!==y&&(ro(a,x,y),Wo(this,"nodeCategory",uo,x,a,E,y))}else ro(a,x,y)}},xt.lm=function(a,y){this.jm(y,this.Ro(a))},xt.Tl=function(){return!1},xt.Wj=function(){return!1},xt.ri=function(){return!1},xt.xs=function(){return!1},xt.Xj=function(){return!1};function hy(){return new cn}function sp(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 sp(a,y.constructor);return typeof y}function dy(a){return Ra[a]?Ra[a]:ge.go!==void 0&&ge.go[a]?ge.go[a]:null}function Fo(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 ro(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){}}ke.Object.defineProperties(cn.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===""&&ce("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&ce("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)||ce("Model.nodeDataArray must only contain Objects, not: "+b),Hi(b)}for(this.Tc=a,E=new Pe,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(Wo(this,"nodeDataArray",uo,"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"}}}),cn.prototype.setCategoryForNodeData=cn.prototype.jm,cn.prototype.getCategoryForNodeData=cn.prototype.Ro,cn.prototype.removeArrayItem=cn.prototype.ov,cn.prototype.insertArrayItem=cn.prototype.ts,cn.prototype.addArrayItem=cn.prototype.Ay,cn.prototype.assignAllDataProperties=cn.prototype.Do,cn.prototype.set=cn.prototype.set,cn.prototype.clearUnresolvedReferences=cn.prototype.Qy,cn.prototype.mergeNodeDataArray=cn.prototype.$z,cn.prototype.removeNodeDataCollection=cn.prototype.nA,cn.prototype.removeNodeData=cn.prototype.cm,cn.prototype.addNodeDataCollection=cn.prototype.Fy,cn.prototype.addNodeData=cn.prototype.xf,cn.prototype.makeNodeDataKeyUnique=cn.prototype.$u,cn.prototype.findNodeDataForKey=cn.prototype.hc,cn.prototype.containsNodeData=cn.prototype.lb,cn.prototype.setKeyForNodeData=cn.prototype.km,cn.prototype.getKeyForNodeData=cn.prototype.wa,cn.prototype.updateTargetBindings=cn.prototype.La,cn.prototype.commit=cn.prototype.commit,cn.prototype.rollbackTransaction=cn.prototype.Kf,cn.prototype.commitTransaction=cn.prototype.eb,cn.prototype.startTransaction=cn.prototype.Ea,cn.prototype.raiseDataChanged=cn.prototype.Fs,cn.prototype.raiseChanged=cn.prototype.g,cn.prototype.raiseChangedEvent=cn.prototype.cb,cn.prototype.removeChangedListener=cn.prototype.ik,cn.prototype.addChangedListener=cn.prototype.Pe,cn.prototype.writeJsonValue=cn.prototype.sm,cn.prototype.replaceJsonObjects=cn.prototype.dm,cn.prototype.applyIncrementalJSON=cn.prototype.Ky,cn.prototype.applyIncrementalJson=cn.prototype.Zw,cn.prototype.toJSON=cn.prototype.toJSON,cn.prototype.toJson=cn.prototype.np,cn.prototype.toIncrementalJSON=cn.prototype.yA,cn.prototype.toIncrementalJson=cn.prototype.$x,cn.prototype.toIncrementalData=cn.prototype.xA,cn.prototype.clear=cn.prototype.clear;var kS=!1,Ra={};cn.className="Model",cn.fromJSON=cn.fromJson=function(a,y){y===void 0&&(y=null);var x=null;if(typeof a=="string")try{x=ge.JSON.parse(a)}catch(z){}else typeof a=="object"?x=a:ce("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=ge[E])),typeof b=="function"&&(a=new b)}catch(z){}a===null||a instanceof cn?y=a:ce("Unable to construct a Model of declared class: "+x.class)}return y===null&&(y=cn.constructGraphLinksModel()),y.gp(x),y.kv(x),y},cn.safePropertyValue=Fo,cn.safePropertySet=ro,Ra.Brush=Oi,Ra.ChangedEvent=ho,Ra.Geometry=Ve,Ra.Margin=qn,Ra.Panel=De,Ra.Point=It,Ra.Rect=pe,Ra.Size=Ke,Ra.Spot=En,Ra.Transaction=ir,Ra.UndoManager=co;function Bo(a,y,x,E){Dn(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=ES,this.wk=null):(this.el=ap,this.wk=E),this.st=new Fe}Bo.prototype.copy=function(){var a=new Bo;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},xt=Bo.prototype,xt.qb=function(a){a.classType===Bo&&(this.mode=a)},xt.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.Ai!==-1?" "+this.Ai:"")+" "+this.mode.name+")"},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.Kx=function(a){return a===void 0&&(a=null),this.mode=ap,this.backConverter=a,this},xt.cp=function(a){return a===void 0&&(a=""),this.sourceName=a,this.isToModel=!1,this},xt.dA=function(){return this.sourceName=null,this.isToModel=!0,this};function MS(a,y,x){return a=a.sourceName,a===null||a===""?y:a==="/"?x.part:a==="."?x:a===".."?x.panel:y.fb(a)}xt.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==="")Be("Binding error: target property is the empty string: "+this.toString());else{var z=y;if(E!==""&&(z=Fo(y,E)),z!==void 0)if(b===null)x!==""&&ro(a,x,z);else try{if(x!==""){var tt=b(z,a);ro(a,x,tt)}else b(z,a)}catch(ot){}}}},xt.sp=function(a,y,x,E){if(this.el===ap){var b=this.xl;if(x===void 0||b===x){x=this.sl;var z=this.wk,tt=a;if(b!==""&&(tt=Fo(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):ro(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):ro(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,Pt=E.panel.itemArray;rt.ov(Pt,yt),rt.ts(Pt,yt,mt)}}}catch(kt){}}finally{this.st.remove(a)}}}},ke.Object.defineProperties(Bo.prototype,{Ai:{get:function(){return this.j},set:function(a){this._isFrozen&&Tn(this),this.j=a}},targetProperty:{get:function(){return this.xl},set:function(a){this._isFrozen&&Tn(this),this.xl=a}},sourceName:{get:function(){return this.Cr},set:function(a){this._isFrozen&&Tn(this),this.Cr=a,a!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(a){this._isFrozen&&Tn(this),this.wn=a}},sourceProperty:{get:function(){return this.sl},set:function(a){this._isFrozen&&Tn(this),this.sl=a}},converter:{get:function(){return this.Im},set:function(a){this._isFrozen&&Tn(this),this.Im=a}},backConverter:{get:function(){return this.wk},set:function(a){this._isFrozen&&Tn(this),this.wk=a}},mode:{get:function(){return this.el},set:function(a){this._isFrozen&&Tn(this),this.el=a}}}),Bo.prototype.updateSource=Bo.prototype.sp,Bo.prototype.updateTarget=Bo.prototype.Mv,Bo.prototype.ofModel=Bo.prototype.dA,Bo.prototype.ofObject=Bo.prototype.cp,Bo.prototype.makeTwoWay=Bo.prototype.Kx;var Ax="Binding",ES=new he(Bo,"OneWay",1),ap=new he(Bo,"TwoWay",2);Bo.className="Binding",Bo.parseEnum=function(a,y){return function(x){return x=Yn(a,x),x===null?y:x}},Bo.toString=ei,Bo.OneWay=ES,Bo.TwoWay=ap;function fi(a,y,x){cn.call(this),this.Vv=`,
"insertedLinkKeys": `,this.iy=`,
"modifiedLinkData": `,this.Xv=`,
"removedLinkKeys": `,this.md=[],this.$f=new Fe,this.wb=new ln,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&&(ae(a)?this.nodeDataArray=a:x=a),x&&(Object.assign(this,x),a=x.Changed)&&(delete this.Changed,this.Pe(a))}ne(fi,cn),fi.constructGraphLinksModel=cn.constructGraphLinksModel,fi.prototype.cloneProtected=function(a){cn.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},xt=fi.prototype,xt.clear=function(){cn.prototype.clear.call(this),this.md=[],this.wb.clear(),this.$f.clear()},xt.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)+":"+ei(b)}for(y+=`
link data:`,a=this.linkDataArray,x=a.length,E=0;E<x;E++)b=a[E],y+=" "+qs(this,b,!0)+"-->"+qs(this,b,!1)}return y},xt.Qv=function(a,y){this.linkKeyProperty===""&&ce("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var x=cn.prototype.Qv.call(this,a,y),E=this,b=new Fe,z=new Fe,tt=new Fe,ot=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===bo?b.add(ut.newValue):ut.change===Uo&&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 cn||E.lb(ut.object)||FS(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},xt.rm=function(){var a=cn.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},xt.gp=function(a){cn.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)},xt.Rv=function(){var a=cn.prototype.Rv.call(this),y=`,
"linkDataArray": `+Mh(this,this.linkDataArray,!0);return a+y},xt.kv=function(a){cn.prototype.kv.call(this,a),a=a.linkDataArray,Array.isArray(a)&&(this.dm(a),this.linkDataArray=a)};function FS(a,y){for(var x=new Fe,E=0;E<a.linkDataArray.length;E++){var b=a.linkDataArray[E];a0(a,y,b,b,x)}return x}xt.Pv=function(a,y){this.linkKeyProperty===""&&ce("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var x=cn.prototype.Pv.call(this,a,y),E=this,b=new Fe,z=new Fe,tt=new Fe,ot=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===bo?b.add(ut.newValue):ut.change===Uo&&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 cn||E.lb(ut.object)||FS(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)+Mh(this,rt.Fa(),!0)),0<z.count&&(a+=this.iy+Mh(this,z.Fa(),!0)),0<at.count&&(a+=(y?this.Vv:this.Xv)+Mh(this,at.Fa(),!0)),at.clear(),rt.clear(),a},xt.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)&&ce("applyIncrementalJson cannot change Model properties"),cn.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]);TS(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)},fi.prototype.changeState=function(a,y){if(a!==null&&a.model===this){if(a.change===uo){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),ro(x,E,b);return}}else if(a.change===bo){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===Uo){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}}cn.prototype.changeState.call(this,a,y)}},xt=fi.prototype,xt.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),ro(x,this.nodeKeyProperty,a),this.xf(x))}return a}},xt.yx=function(a){return qs(this,a,!0)},xt.wv=function(a,y){Mf(this,a,y,!0)},xt.Bx=function(a){return qs(this,a,!1)},xt.Bv=function(a,y){Mf(this,a,y,!1)};function qs(a,y,x){if(y!==null&&(a=x?a.lf:a.mf,a!==""&&(a=Fo(y,a),a!==void 0))){if(Eh(a))return a;ce((x?"FromKey":"ToKey")+" value for link data "+y+" is not a number or a string: "+a)}}function Mf(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=Fo(y,b);z!==x&&(tl(a,z,y),ro(y,b,x),a.hc(x)===null&&$a(a,x,y),Wo(a,E?"linkFromKey":"linkToKey",uo,b,y,z,x),typeof b=="string"&&a.La(y,b))}else ro(y,b,x)}}xt.zx=function(a){return u0(this,a,!0)},xt.xv=function(a,y){Ef(this,a,y,!0)},xt.Cx=function(a){return u0(this,a,!1)},xt.Cv=function(a,y){Ef(this,a,y,!1)};function u0(a,y,x){return y===null||(a=x?a.ej:a.fj,a==="")?"":(y=Fo(y,a),y===void 0?"":y)}function Ef(a,y,x,E){if(y!==null){var b=E?a.ej:a.fj;if(b!=="")if(a.Jc(y)){var z=Fo(y,b);z===void 0&&(z=""),z!==x&&(ro(y,b,x),Wo(a,E?"linkFromPortId":"linkToPortId",uo,b,y,z,x),typeof b=="string"&&a.La(y,b))}else ro(y,b,x)}}xt.Ef=function(a){if(a===null)return h0;var y=this.je;return y===""?h0:(a=Fo(a,y),a===void 0?h0:a)},xt.Ls=function(a,y){if(a!==null){var x=this.je;if(x!=="")if(this.Jc(a)){var E=Fo(a,x);if(E===void 0&&(E=h0),E!==y){if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)tl(this,E[z],a);for(ro(a,x,y),b=y.length,z=0;z<b;z++){var tt=y[z];this.hc(tt)===null&&$a(this,tt,a)}Wo(this,"linkLabelKeys",uo,x,a,E,y),typeof x=="string"&&this.La(a,x)}}else ro(a,x,y)}},xt.Bu=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=Fo(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&&$a(this,y,a),Wo(this,"linkLabelKeys",bo,x,a,null,y,null,b)))}else ce(x+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}},xt.Qx=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=Fo(a,x);if(Array.isArray(E)){var b=E.indexOf(y);0>b||(E.splice(b,1),this.Jc(a)&&(tl(this,y,a),Wo(this,"linkLabelKeys",Uo,x,a,y,null,b,null)))}else E!==void 0&&ce(x+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}},xt.Ac=function(a){if(a!==null){var y=this.Jh;if(y!==""&&(y=Fo(a,y),y!==void 0)){if(Eh(y))return y;ce("Key value for link data "+a+" is not a number or a string: "+y)}}},xt.Ks=function(a,y){if(a!==null){var x=this.Jh;if(x!=="")if(this.Jc(a)){var E=Fo(a,x);E!==y&&this.jh(y)===null&&(ro(a,x,y),E!==void 0&&this.wb.remove(E),this.wb.add(y,a),Wo(this,"linkKey",uo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else ro(a,x,y)}},xt.jh=function(a){return a===null&&ce("GraphLinksModel.findLinkDataForKey:key must not be null"),a!==void 0&&Eh(a)?this.wb.I(a):null},xt.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))){ro(a,y,x);return}if(typeof x=="string"){for(E=2;this.wb.contains(x+E);)E++;ro(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.wb.count-1;this.wb.contains(x);)x--;ro(a,y,x)}}}}},xt.Jc=function(a){return a===null?!1:this.$f.contains(a)},xt.fi=function(a){a!==null&&(Hi(a),this.Jc(a)||NS(this,a,!0))};function NS(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&&ce("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)),Wo(a,"linkDataArray",bo,"linkDataArray",a,null,y,null,E),cy(a,y)}xt.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)},xt.bm=function(a){a!==null&&bS(this,a,!0)};function bS(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(Wo(a,"linkDataArray",Uo,"linkDataArray",a,y,null,E,null),x=qs(a,y,!0),tl(a,x,y),x=qs(a,y,!1),tl(a,x,y),E=a.Ef(y),Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],tl(a,x,y)}xt.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)},xt.Zz=function(a){if(this.linkKeyProperty===""&&ce("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),a!==this.linkDataArray&&ae(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),TS(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=qs(a,y,!0);x=a.Vl(x),a.hc(x)===null&&$a(a,x,y),x=qs(a,y,!1),x=a.Vl(x),a.hc(x)===null&&$a(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&&$a(a,x,y)}xt.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)&&(Dn(a),this.lf!==""&&ro(a,this.lf,void 0),this.mf!==""&&ro(a,this.mf,void 0),this.je!==""&&ro(a,this.je,[])),a},xt.Yu=function(a){if(a===null)return!1;var y=this.jl;return y===""?!1:!!Fo(a,y)},xt.lh=function(a){if(a!==null){var y=this.Je;if(y!==""&&(y=Fo(a,y),y!==void 0)){if(Eh(y))return y;ce("GroupKey value for node data "+a+" is not a number or a string: "+y)}}},xt.mp=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Je;if(x!=="")if(this.lb(a)){var E=Fo(a,x);E!==y&&(tl(this,E,a),ro(a,x,y),this.hc(y)===null&&$a(this,y,a),Wo(this,"nodeGroupKey",uo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else ro(a,x,y)}},fi.prototype.copyNodeData=function(a){return a===null?null:(a=cn.prototype.copyNodeData.call(this,a),this.Ij||this.Je===""||Fo(a,this.Je)===void 0||ro(a,this.Je,void 0),a)},fi.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){Mf(this,a,x,!0);return}if(y===this.linkToKeyProperty){Mf(this,a,x,!1);return}if(y===this.linkFromPortIdProperty){Ef(this,a,x,!0);return}if(y===this.linkToPortIdProperty){Ef(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=Fo(a,y);E!==x&&(ro(a,y,x),this.Fs(a,y,E,x))},xt=fi.prototype,xt.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&&Fo(a,b)===y[b]||E&&b===this.linkKeyProperty||this.setDataProperty(a,b,y[b])}},xt.jp=function(a,y){cn.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(qs(this,E,!0)===b){var tt=this.lf;ro(E,tt,z),Wo(this,"linkFromKey",uo,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)}if(qs(this,E,!1)===b&&(tt=this.mf,ro(E,tt,z),Wo(this,"linkToKey",uo,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,Wo(this,"linkLabelKeys",bo,rt,E,b,z,at,at))}},xt.qv=function(a,y,x){if(this.lh(a)===y){var E=this.Je;ro(a,E,x),Wo(this,"nodeGroupKey",uo,E,a,y,x),typeof E=="string"&&this.La(a,E)}},xt.Lv=function(){cn.prototype.Lv.call(this);for(var a=this.linkDataArray,y=a.length,x=0;x<y;x++)cy(this,a[x])},xt.fm=function(a){cn.prototype.fm.call(this,a),a=this.wa(a);var y=rp(this,a);if(y!==null){var x=gn();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)){if(this.lh(E)===a){var b=this.Je;Wo(this,"nodeGroupKey",uo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}else if(qs(this,E,!0)===a&&(b=this.lf,Wo(this,"linkFromKey",uo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),qs(this,E,!1)===a&&(b=this.mf,Wo(this,"linkToKey",uo,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&&(Wo(this,"linkLabelKeys",bo,tt,E,a,a,ot,ot),x.push(E))}for(y=0;y<x.length;y++)tl(this,a,x[y]);Ye(x)}},xt.em=function(a){cn.prototype.em.call(this,a);var y=this.lh(a);this.hc(y)===null&&$a(this,y,a)},xt.qp=function(a){cn.prototype.qp.call(this,a);var y=this.lh(a);tl(this,y,a)},xt.ps=function(a){if(a===null)return"";var y=this.dj;if(y===""||(y=Fo(a,y),y===void 0))return"";if(typeof y=="string")return y;ce("getCategoryForLinkData found a non-string category for "+a+": "+y)},fi.prototype.getLinkCategoryForData=function(a){return this.ps(a)},fi.prototype.lp=function(a,y){if(a!==null){var x=this.dj;if(x!=="")if(this.Jc(a)){var E=Fo(a,x);E===void 0&&(E=""),E!==y&&(ro(a,x,y),Wo(this,"linkCategory",uo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else ro(a,x,y)}},fi.prototype.setLinkCategoryForData=function(a,y){this.lp(a,y)},xt=fi.prototype,xt.lm=function(a,y){cn.prototype.lm.call(this,a,y),this.mp(y,this.lh(a))};function TS(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))}xt.Wj=function(){return!0},xt.ri=function(){return!0},xt.xs=function(){return!0},xt.Xj=function(){return!0},ke.Object.defineProperties(fi.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)||ce("GraphLinksModel.linkDataArray must only contain Objects, not: "+b),Hi(b)}if(this.md=a,this.linkKeyProperty!==""){for(E=new Pe,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 Fe,b=0;b<x;b++)E.add(a[b]);for(this.$f=E,Wo(this,"linkDataArray",uo,"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"}}}),fi.prototype.setCategoryForLinkData=fi.prototype.lp,fi.prototype.getCategoryForLinkData=fi.prototype.ps,fi.prototype.assignAllDataProperties=fi.prototype.Do,fi.prototype.setGroupKeyForNodeData=fi.prototype.mp,fi.prototype.getGroupKeyForNodeData=fi.prototype.lh,fi.prototype.isGroupForNodeData=fi.prototype.Yu,fi.prototype.copyLinkData=fi.prototype.Jo,fi.prototype.mergeLinkDataArray=fi.prototype.Zz,fi.prototype.removeLinkDataCollection=fi.prototype.lA,fi.prototype.removeLinkData=fi.prototype.bm,fi.prototype.addLinkDataCollection=fi.prototype.Ey,fi.prototype.addLinkData=fi.prototype.fi,fi.prototype.containsLinkData=fi.prototype.Jc,fi.prototype.makeLinkDataKeyUnique=fi.prototype.Bs,fi.prototype.findLinkDataForKey=fi.prototype.jh,fi.prototype.setKeyForLinkData=fi.prototype.Ks,fi.prototype.getKeyForLinkData=fi.prototype.Ac,fi.prototype.removeLabelKeyForLinkData=fi.prototype.Qx,fi.prototype.addLabelKeyForLinkData=fi.prototype.Bu,fi.prototype.setLabelKeysForLinkData=fi.prototype.Ls,fi.prototype.getLabelKeysForLinkData=fi.prototype.Ef,fi.prototype.setToPortIdForLinkData=fi.prototype.Cv,fi.prototype.getToPortIdForLinkData=fi.prototype.Cx,fi.prototype.setFromPortIdForLinkData=fi.prototype.xv,fi.prototype.getFromPortIdForLinkData=fi.prototype.zx,fi.prototype.setToKeyForLinkData=fi.prototype.Bv,fi.prototype.getToKeyForLinkData=fi.prototype.Bx,fi.prototype.setFromKeyForLinkData=fi.prototype.wv,fi.prototype.getFromKeyForLinkData=fi.prototype.yx,fi.prototype.clear=fi.prototype.clear;var h0=Object.freeze([]);fi.className="GraphLinksModel",Ra.GraphLinksModel=fi,cn.constructGraphLinksModel=cn.constructGraphLinksModel=function(){return new fi},cn.initDiagramModel=hy=function(){return new fi};function ss(a,y){cn.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",a!==void 0&&(ae(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}ne(ss,cn),ss.constructGraphLinksModel=cn.constructGraphLinksModel,ss.prototype.cloneProtected=function(a){cn.prototype.cloneProtected.call(this,a),a.Ke=this.Ke,a.Nm=this.Nm,a.nj=this.nj},xt=ss.prototype,xt.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)+":"+ei(b)}}return y},xt.rm=function(){var a=cn.prototype.rm.call(this),y="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(y+=`,
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),a+y},xt.gp=function(a){cn.prototype.gp.call(this,a),a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)},xt.fp=function(a){a.nodeParentKeyProperty!==void 0&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&ce("applyIncrementalJson cannot change Model properties"),cn.prototype.fp.call(this,a)},xt.Vl=function(a){return a},xt.mh=function(a){if(a!==null){var y=this.Ke;if(y!==""&&(y=Fo(a,y),y!==void 0)){if(Eh(y))return y;ce("ParentKey value for node data "+a+" is not a number or a string: "+y)}}},xt.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=Fo(a,x);E!==y&&(tl(this,E,a),ro(a,x,y),this.hc(y)===null&&$a(this,y,a),Wo(this,"nodeParentKey",uo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else ro(a,x,y)}},xt.ss=function(a){if(a===null)return"";var y=this.nj;return y===""||(y=Fo(a,y),y===void 0)?"":typeof y=="string"?y:(ce("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+y),"")},ss.prototype.getLinkCategoryForData=function(a){return this.ss(a)},ss.prototype.Ms=function(a,y){if(a!==null){var x=this.nj;if(x!=="")if(this.lb(a)){var E=Fo(a,x);E===void 0&&(E=""),E!==y&&(ro(a,x,y),Wo(this,"parentLinkCategory",uo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else ro(a,x,y)}},ss.prototype.setLinkCategoryForData=function(a,y){this.Ms(a,y)},ss.prototype.copyNodeData=function(a){return a===null?null:(a=cn.prototype.copyNodeData.call(this,a),this.Jj||this.Ke===""||Fo(a,this.Ke)===void 0||ro(a,this.Ke,void 0),a)},ss.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=Fo(a,y);E!==x&&(ro(a,y,x),this.Fs(a,y,E,x))},xt=ss.prototype,xt.jp=function(a,y){cn.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y)},xt.qv=function(a,y,x){if(this.mh(a)===y){var E=this.Ke;ro(a,E,x),Wo(this,"nodeParentKey",uo,E,a,y,x),typeof E=="string"&&this.La(a,E)}},xt.fm=function(a){cn.prototype.fm.call(this,a),a=this.wa(a);var y=rp(this,a);if(y!==null){var x=gn();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)&&this.mh(E)===a){var b=this.Ke;Wo(this,"nodeParentKey",uo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}for(y=0;y<x.length;y++)tl(this,a,x[y]);Ye(x)}},xt.em=function(a){cn.prototype.em.call(this,a);var y=this.mh(a);y=this.Vl(y),this.hc(y)===null&&$a(this,y,a)},xt.qp=function(a){cn.prototype.qp.call(this,a);var y=this.mh(a);tl(this,y,a)},xt.lm=function(a,y){cn.prototype.lm.call(this,a,y),this.Ms(y,this.ss(a)),this.qe(y,this.mh(a))},xt.Tl=function(){return!0},xt.xs=function(){return!0},ke.Object.defineProperties(ss.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"}}}),ss.prototype.setParentLinkCategoryForNodeData=ss.prototype.Ms,ss.prototype.getParentLinkCategoryForNodeData=ss.prototype.ss,ss.prototype.setParentKeyForNodeData=ss.prototype.qe,ss.prototype.getParentKeyForNodeData=ss.prototype.mh,ss.className="TreeModel",Ra.TreeModel=ss;function po(a){so.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=za,this.Ti=0,this.Zv=new It,this.Jp=this.me=0,this.Xr=new dp,this.gt=this.mj=0,this.ty=600,this.eo=NaN,this.Cm=1,this.ro=0,this.ul=360,this.Rb=za,this.K=as,this.nd=Nf,this.hd=oy,this.tf=6,this.Nn=v0,a&&Object.assign(this,a)}ne(po,so),po.prototype.cloneProtected=function(a){so.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},po.prototype.qb=function(a){a.classType===po?a===p0||a===m0||a===f0||a===g0||a===Nf?this.sorting=a:a===Sd||a===Ff||a===as||a===Nh?this.direction=a:a===Wu||a===Fh||a===za||a===_a?this.arrangement=a:(a===dc||a===v0)&&(this.nodeDiameterFormula=a):so.prototype.qb.call(this,a)},po.prototype.createNetwork=function(){return new bf(this)},po.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 Pe;y.addAll(a.iterator),a=new Pe;var x=new Pe,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===_a&&rt===dc?ot=za:ot===_a&&rt!==dc&&(ot=this.arrangement),(this.direction===Sd||this.direction===Ff)&&this.sorting!==Nf){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===Sd?(this.arrangement===_a&&a.reverse(),E=new Pe,E.addAll(a),E.addAll(x)):(this.arrangement===_a&&x.reverse(),E=new Pe,E.addAll(x),E.addAll(a))}rt=E.length;for(var yt=z=b=0;yt<E.length;yt++){var Pt=ft+mt*z*(this.direction===as?1:-1)/rt,kt=E.M(yt).diameter;isNaN(kt)&&(kt=bh(E.M(yt),Pt)),360>mt&&(yt===0||yt===E.length-1)&&(kt/=2),b+=kt,z++}if(isNaN(at)||ot===_a){if(isNaN(y)&&(y=6),ot!==za&&ot!==_a){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)&&bh(yt,0),isNaN(b.diameter)&&bh(b,0),z=Math.max(z,(yt.diameter+b.diameter)/2);tt=z+y,ot===Wu?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!==_a?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===za||ot===_a)&&(y=(yt-b)/(360<=mt?rt:rt-1));else if(ot===za||ot===_a)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++)Pt=E.M(b),kt=E.M(b===rt-1?0:b+1),isNaN(Pt.diameter)&&bh(Pt,0),isNaN(kt.diameter)&&bh(kt,0),tt=Math.max(tt,(Pt.diameter+kt.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!==Sd&&this.direction!==Ff||E!==_a)if(this.direction===Sd||this.direction===Ff){switch(tt=0,E){case Fh:tt=180*c0(this,ot,mt,at,rt)/Math.PI;break;case za:rt=y=0,tt=a.first(),tt!==null&&(y=bh(tt,Math.PI/2)),tt=x.first(),tt!==null&&(rt=bh(tt,Math.PI/2)),tt=180*c0(this,ot,mt,at,ft+(y+rt)/2)/Math.PI;break;case Wu:tt=ut/y.length}if(this.direction===Sd){switch(E){case Fh:hp(this,a,at,Nh);break;case za:up(this,a,at,Nh);break;case Wu:lp(this,a,ut/2,at,Nh)}switch(E){case Fh:hp(this,x,at+tt,as);break;case za:up(this,x,at+tt,as);break;case Wu:lp(this,x,ut/2,at+tt,as)}}else{switch(E){case Fh:hp(this,x,at,Nh);break;case za:up(this,x,at,Nh);break;case Wu:lp(this,x,ut/2,at,Nh)}switch(E){case Fh:hp(this,a,at+tt,as);break;case za:up(this,a,at+tt,as);break;case Wu:lp(this,a,ut/2,at+tt,as)}}}else switch(E){case Fh:hp(this,y,at,this.direction);break;case za:up(this,y,at,this.direction);break;case Wu:lp(this,y,ut,at,this.direction);break;case _a:AS(this,y,ut,at,this.direction)}else AS(this,y,ut,at-ut/2,as)}this.updateParts(),this.network=null,this.isValidLayout=!0};function lp(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===as?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 up(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)&&bh(at,0),isNaN(ut.diameter)&&bh(ut,0),at=c0(a,b,z,E===as?x:-x,(at.diameter+ut.diameter)/2+tt),x+=E===as?at:-at}}function hp(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===as?x:-x,tt),x+=E===as?at:-at}}function AS(a,y,x,E,b){var z=a.Wp;if(a.mj=0,a.Xr=new dp,360>x){for(z=E+(b===as?z:-z);0>z;)z+=360;z%=360,180<z&&(z-=360),z*=Math.PI/180,a.gt=z,DS(a,y,x,E,b)}else BS(a,y,x,E,b);a.Xr.commit(y)}function BS(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=It.alloc();for(var ft=0;ft<ut.length&&(ut[ft].centerX=rt,ut[ft].centerY=at,!(ft>=ut.length-1));ft++)OS(a,rt,at,ut,ft,b,z)||IS(a,rt,at,ut,ft,b,z),rt=z.x,at=z.y;if(It.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===as?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,BS(a,y,x,E,b))}}}function DS(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=It.alloc(),ft=y.Fa(),mt=0;mt<ft.length&&(ft[mt].centerX=rt,ft[mt].centerY=at,!(mt>=ft.length-1));mt++)OS(a,rt,at,ft,mt,b,ut)||IS(a,rt,at,ft,mt,b,ut),rt=ut.x,at=ut.y;if(It.free(ut),a.mj++,!(23<a.mj)){if(rt=Math.atan2(at,rt),rt=b===as?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,DS(a,y,x,E,b))}}function OS(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===as)){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 IS(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===as)){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}po.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},po.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 It(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))},po.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}}po.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 Nf:return this.ak(Bx(a));default:ce("Invalid sorting type.")}return a};function Bx(a){for(var y=[],x=0;x<a.length;x++)y.push(0);x=new Pe;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}po.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 Pe;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=[],Pt=0;Pt<x.length;Pt++)0>y[x[Pt]].indexOf(x[Pt===x.length-1?0:Pt+1])&&yt.push(Pt===x.length-1?0:Pt+1);if(yt.length===0)for(Pt=0;Pt<x.length;Pt++)yt.push(Pt);for(Pt=0;Pt<yt.length;Pt++){for(var kt=yt[Pt],Dt=y[at],Tt=0,Rt=0;Rt<tt.length;Rt++){var Gt=z[tt[Rt]],Vt=z[ot[Rt]];if(Gt<Vt){var Xt=Gt;Gt=Vt}else Xt=Vt;if(Xt<kt&&kt<=Gt)for(Vt=0;Vt<Dt.length;Vt++){var ie=Dt[Vt];0>x.indexOf(ie)||Xt<z[ie]&&z[ie]<Gt||Xt===z[ie]||Gt===z[ie]||Tt++}else for(Vt=0;Vt<Dt.length;Vt++)ie=Dt[Vt],0>x.indexOf(ie)||Xt<z[ie]&&z[ie]<Gt&&Xt!==z[ie]&&Gt!==z[ie]&&Tt++}for(Dt=Tt,Rt=Tt=0;Rt<y[at].length;Rt++)Xt=x.indexOf(y[at][Rt]),0<=Xt&&(Xt=Math.abs(kt-(Xt>=kt?Xt+1:Xt)),Tt+=Xt<x.length+1-Xt?Xt:x.length+1-Xt);for(Rt=0;Rt<tt.length;Rt++)Xt=z[tt[Rt]],Gt=z[ot[Rt]],Xt>=kt&&Xt++,Gt>=kt&&Gt++,Xt>Gt&&(Vt=Gt,Gt=Xt,Xt=Vt),Gt-Xt<(x.length+2)/2==(Xt<kt&&kt<=Gt)&&Tt++;(Dt<ut||Dt===ut&&Tt<ft)&&(ut=Dt,ft=Tt,mt=kt)}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||(Pt=yt>ut?yt-ut:ut-yt,ft+=yt<ut!=Pt>tt-Pt?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},ke.Object.defineProperties(po.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!==_a&&a!==za&&a!==Fh&&a!==Wu||(this.Rb=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==as&&a!==Nh&&a!==Sd&&a!==Ff||(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!==Nf||(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!==dc||(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 za=new he(po,"ConstantSpacing",0),Fh=new he(po,"ConstantDistance",1),Wu=new he(po,"ConstantAngle",2),_a=new he(po,"Packed",3),as=new he(po,"Clockwise",4),Nh=new he(po,"Counterclockwise",5),Sd=new he(po,"BidirectionalLeft",6),Ff=new he(po,"BidirectionalRight",7),f0=new he(po,"Forwards",8),g0=new he(po,"Reverse",9),p0=new he(po,"Ascending",10),m0=new he(po,"Descending",11),Nf=new he(po,"Optimized",12),v0=new he(po,"Pythagorean",13),dc=new he(po,"Circular",14);po.className="CircularLayout",po.ConstantSpacing=za,po.ConstantDistance=Fh,po.ConstantAngle=Wu,po.Packed=_a,po.Clockwise=as,po.Counterclockwise=Nh,po.BidirectionalLeft=Sd,po.BidirectionalRight=Ff,po.Forwards=f0,po.Reverse=g0,po.Ascending=p0,po.Descending=m0,po.Optimized=Nf,po.Pythagorean=v0,po.Circular=dc;function dp(){this.Pl=-1/0,this.tm=this.mk=null}dp.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},dp.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]}},dp.className="VertexArrangement";function bf(a){Ji.call(this,a)}ne(bf,Ji),bf.prototype.createVertex=function(){return new cp(this)},bf.prototype.createEdge=function(){return new y0(this)},bf.className="CircularNetwork";function cp(a){Ko.call(this,a),this.u=this.Si=NaN}ne(cp,Ko);function bh(a,y){var x=a.network;if(x===null)return NaN;if(x=x.layout,x===null)return NaN;if(x.arrangement===_a)if(x.nodeDiameterFormula===dc)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===dc?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.Si}ke.Object.defineProperties(cp.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)}}}),cp.className="CircularVertex";function y0(a){js.call(this,a)}ne(y0,js),y0.className="CircularEdge";function Nr(a){so.call(this),this.ah=null,this.An=0,this.$d=new Ke(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)}ne(Nr,so),Nr.prototype.cloneProtected=function(a){so.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},Nr.prototype.createNetwork=function(){return new cc(this)},Nr.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}jS(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=gn(),ut=0;ut<ot+y.vertexes.count+2;ut++)at[ut]=null;ot=0,tt.reset();for(var ft=pe.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 It(ft.x+ft.width+E.width,ft.y),at[1]=new It(ft.x,ft.y+ft.height+E.height),ot=2;else{var mt=RS(at,ot,b,z,ft.width,ft.height,E),yt=at[mt],Pt=new It(yt.x+ft.width+E.width,yt.y),kt=new It(yt.x,yt.y+ft.height+E.height);for(mt+1<ot&&at.splice(mt+1,0,null),at[mt]=Pt,at[mt+1]=kt,ot++,mt=yt.x-ft.x,yt=yt.y-ft.y,ut=ut.vertexes.iterator;ut.next();)Pt=ut.value,Pt.centerX+=mt,Pt.centerY+=yt}for(pe.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 It(mt.x+mt.width+E.width,mt.y),at[1]=new It(mt.x,mt.y+mt.height+E.height),ot=2):(rt=RS(at,ot,b,z,mt.width,mt.height,E),ft=at[rt],yt=new It(ft.x+mt.width+E.width,ft.y),mt=new It(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(Ye(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)}}_S(this,a),this.updateParts()}this.dl=a,this.network=null,this.isValidLayout=!0},Nr.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},Nr.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 jS(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,jS(a,y+1,x),_S(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++)jx(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 cc(a),b=0;b<a.ah.length;b++){var z=a.ah[b];if(1<z.Vd){E.dh(z);var tt=new GS;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 Pe),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 Pe,b.Hj=ot),ot.add(tt),b.Vd--,b.sh+=tt.sh):tt.network===E&&(ot=tt.Hj,ot===null&&(ot=new Pe,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 pe(z-mt.x-tt,rt-mt.y-ot,ut+2*tt,ft+2*ot),b.focus=new It(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 pe(E.centerX-z,E.centerY-tt,b.Ss,b.Qs),E.focus=new It(z,tt),E.sv--}}for(x=a.network.edges.iterator;x.next();)x.value.network=y;a.network=y}function jx(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,Pt){return yt===null||Pt===null||yt===Pt?0:Pt.width*Pt.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 RS(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}Nr.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},Nr.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 zS(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 _S(a,y){for(a.ah=null,y=a.An+y;a.An<y&&(a.An++,Rx(a)););a.ah=null}function Rx(a){a.ah===null&&(a.ah=a.network.vertexes.Fa());var y=a.ah;if(0>=y.length)return!1;var x=y[0];x.forceX=0,x.forceY=0;for(var E=x.centerX,b=E,z=x=x.centerY,tt=1;tt<y.length;tt++){var 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(kt,Dt){return kt===null||Dt===null||kt===Dt?0:kt.centerX-Dt.centerX}):y.sort(function(kt,Dt){return kt===null||Dt===null||kt===Dt?0:kt.centerY-Dt.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 Pt=zS(tt,mt);1>Pt?(E=a.randomNumberGenerator,E===null&&(a.randomNumberGenerator=E=new S0),Pt=E.random(),ot=E.random(),rt>at?(E=Math.abs(mt.bounds.right-tt.bounds.x),E=(1+E)*Pt):rt<at?(E=Math.abs(mt.bounds.x-tt.bounds.right),E=-(1+E)*Pt):(E=Math.max(mt.width,tt.width),E=(1+E)*Pt-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)/(Pt*Pt),E=(at-rt)/Pt*ot,at=(yt-ut)/Pt*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=zS(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}Nr.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},Nr.prototype.moveFixedVertex=function(){},Nr.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},Nr.prototype.yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var y=a.value.link;y!==null&&(y.fromSpot=Lr,y.toSpot=Lr)}},Nr.prototype.commitNodes=function(){var a=0,y=0;if(this.arrangesToOrigin){var x=pe.alloc();this.computeBounds(this.network,x),y=this.arrangementOrigin,a=y.x-x.x,y=y.y-x.y,pe.free(x)}x=pe.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()}pe.free(x)},Nr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},Nr.prototype.springStiffness=function(a){return a=a.stiffness,isNaN(a)?this.Hk:a},Nr.prototype.springLength=function(a){return a=a.length,isNaN(a)?this.Gk:a},Nr.prototype.electricalCharge=function(a){return a=a.charge,isNaN(a)?this.Ek:a},Nr.prototype.electricalFieldX=function(){return 0},Nr.prototype.electricalFieldY=function(){return 0},Nr.prototype.gravitationalMass=function(a){return a=a.mass,isNaN(a)?this.Fk:a},Nr.prototype.gravitationalFieldX=function(){return 0},Nr.prototype.gravitationalFieldY=function(){return 0},Nr.prototype.isFixed=function(a){return a.isFixed},ke.Object.defineProperties(Nr.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"&&ce('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())}}}),Nr.className="ForceDirectedLayout";function GS(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}GS.className="ForceDirectedSubnet";function cc(a){Ji.call(this,a)}ne(cc,Ji),cc.prototype.createVertex=function(){return new fp(this)},cc.prototype.createEdge=function(){return new gp(this)},cc.className="ForceDirectedNetwork";function fp(a){Ko.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}ne(fp,Ko),ke.Object.defineProperties(fp.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)}}}),fp.className="ForceDirectedVertex";function gp(a){js.call(this,a),this.j=this.o=NaN}ne(gp,js),ke.Object.defineProperties(gp.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)}}}),gp.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 ji(a){so.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 It,this.He=[],this.He.length=100,this.xw=this.ve=0,a&&Object.assign(this,a)}ne(ji,so),ji.prototype.cloneProtected=function(a){so.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},ji.prototype.qb=function(a){a.classType===ji?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:ce("Unknown enum value: "+a):so.prototype.qb.call(this,a)},ji.prototype.createNetwork=function(){return new Af(this)},ji.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!==mp&&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===mp&&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 Pt=b.focus;at=z.focus;var kt=E.rev?z.bounds:b.bounds;yt=It.alloc(),ut!==ft?kt.w()&&ft.isVisible()?ft.actualBounds.w()?(Ru(ft,mt,Di,yt),yt.x+=ft.actualBounds.x-kt.x,yt.y+=ft.actualBounds.y-kt.y):(Ru(ft,mt,Di,yt),yt.w()||yt.assign(Pt)):yt.assign(Pt):kt.w()?(Ru(ft,mt,Di,yt),yt.w()||yt.assign(Pt)):yt.assign(Pt),ft=E.rev?b.bounds:z.bounds,ut=It.alloc(),tt!==rt?ft.w()&&rt.isVisible()?rt.actualBounds.w()?(Ru(rt,ot,Di,ut),ut.x+=rt.actualBounds.x-ft.x,ut.y+=rt.actualBounds.y-ft.y):(Ru(rt,ot,Di,ut),ut.w()||ut.assign(at)):ut.assign(at):ft.w()?(Ru(rt,ot,Di,ut),ut.w()||ut.assign(at)):ut.assign(at),this.K===90||this.K===270?(tt=Math.round((yt.x-Pt.x)/this.kc),rt=yt.x,ot=Math.round((ut.x-at.x)/this.kc),at=ut.x):(tt=Math.round((yt.y-Pt.y)/this.kc),rt=yt.y,ot=Math.round((ut.y-at.y)/this.kc),at=ut.y),It.free(yt),It.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,kt=E.link,kt!==null){var Dt=kt.fromPort,Tt=kt.toPort;if(Dt!==null&&Tt!==null){var Rt=kt.fromNode;if(mt=kt.toNode,Rt!==null&&mt!==null){var Gt=C0(this,!0),Vt=C0(this,!1),Xt=this.setsPortSpots?Gt:kt.computeSpot(!0,Dt);Pt=this.setsPortSpots?Vt:kt.computeSpot(!1,Tt);var ie=kt.isOrthogonal;Xt.$c()&&Xt.Hf(Vt)&&Pt.$c()&&Pt.Hf(Gt)?ft=0:(Gt=kt.getLinkPoint(Rt,Dt,Xt,!0,ie,mt,Tt,It.alloc()),Vt=kt.getLinkDirection(Rt,Dt,Gt,Xt,!0,ie,mt,Tt),It.free(Gt),Xt.ys()||Vt!==JS(this,E,!0)?this.setsPortSpots&&Rt!==null&&Rt.ports.count===1&&E.rev&&(ft+=1):ft+=1,Xt=kt.getLinkPoint(mt,Tt,Pt,!1,ie,Rt,Dt,It.alloc()),kt=kt.getLinkDirection(mt,Tt,Xt,Pt,!1,ie,Rt,Dt),It.free(Xt),Pt.ys()||kt!==JS(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)&&(Pt=a.createVertex(),Pt.node=null,Pt.Dj=1,Pt.layer=yt,Pt.near=b,a.dh(Pt),b=a.Zj(b,Pt,E.link),b.valid=!1,b.rev=E.rev,b.portFromColOffset=tt,b.portToColOffset=0,b.portFromPos=rt,b.portToPos=0,b=Pt),kt=1,ft&&kt--,yt-ut>kt&&0<yt){for(E.valid=!1,Pt=a.createVertex(),Pt.node=null,Pt.Dj=2,Pt.layer=yt-1,a.dh(Pt),b=a.Zj(b,Pt,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=Pt,yt--;yt-ut>kt&&0<yt;)Pt=a.createVertex(),Pt.node=null,Pt.Dj=3,Pt.layer=yt-1,a.dh(Pt),b=a.Zj(b,Pt,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=0,b.portFromPos=0,b.portToPos=0,b=Pt,yt--;b=a.Zj(Pt,z,E.link),b.valid=!ft,ft&&(Pt.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=Th(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),Ah(this,a,y)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},ji.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}ji.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},ji.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 Ss(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 ga(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 HS(a,y,x){var E=Th(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 Pt=rt[mt];if(Pt.valid&&Pt.fromVertex.layer!==y){var kt=Pt.fromVertex.index,Dt=Pt.portToPos;Pt=Pt.portFromPos,ut<Dt&&(ft>kt||ft===kt&&yt>Pt)&&ot++,Dt<ut&&(kt>ft||kt===ft&&Pt>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++)Pt=rt[mt],Pt.valid&&Pt.toVertex.layer!==y&&(kt=Pt.toVertex.index,Dt=Pt.portToPos,Pt=Pt.portFromPos,yt<Pt&&(ft>kt||ft===kt&&ut>Dt)&&ot++,Pt<yt&&(kt>ft||kt===ft&&Dt>ut)&&ot++)}for(z[tt*b+tt]=ot,rt=tt+1;rt<b;rt++){var Tt=0,Rt=0;if(0<=x){ot=E[tt].sourceEdgesArrayAccess;var Gt=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<Gt.length;mt++)Pt=Gt[mt],Pt.valid&&Pt.fromVertex.layer!==y&&(kt=Pt.fromVertex.index,Pt=Pt.portFromPos,(ft<kt||ft===kt&&yt<Pt)&&Rt++,(kt<ft||kt===ft&&Pt<yt)&&Tt++)}if(0>=x){for(ot=E[tt].destinationEdgesArrayAccess,Gt=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<Gt.length;mt++)Pt=Gt[mt],Pt.valid&&Pt.toVertex.layer!==y&&(kt=Pt.toVertex.index,Dt=Pt.portToPos,(ft<kt||ft===kt&&ut<Dt)&&Rt++,(kt<ft||kt===ft&&Dt<ut)&&Tt++)}z[tt*b+rt]=Tt,z[rt*b+tt]=Rt}}return Ah(a,y,E),z}ji.prototype.countCrossings=function(){for(var a=0,y=0;y<=this.Ia;y++)for(var x=HS(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=Th(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)}}}Ah(E,b,z),y+=ot}return y}ji.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=Th(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 Ah(a,y,E),z}function WS(a,y,x){for(var E=Th(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(Pt,kt){return Pt-kt}),at=ut>>1,z[tt]=ut&1?ft[at]:ft[at-1]+ft[at]>>1)}return Ah(a,y,E),z}function pp(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&&pp(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&&pp(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)}}ji.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(;zx(a)!==null;){for(b=VS(a);b!==null;)E[x]=b,x--,b.valid=!1,b=VS(a);for(b=US(a);b!==null;)E[y]=b,y++,b.valid=!1,b=US(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 mp: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 zx(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid)return y}return null}function VS(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid){for(var x=!0,E=y.destinationEdges;E.next();)if(E.value.toVertex.valid){x=!1;break}if(x)return y}}return null}function US(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++}ji.prototype.assignLayers=function(){switch(this.Zk){case xy:YS(this);break;case Py:for(var a,y=this.network.vertexes.iterator;y.next();)a=XS(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(YS(this),y=this.network.vertexes.iterator;y.next();)y.value.valid=!1;for(y.reset();y.next();)a=y.value,a.sourceEdges.count===0&&ZS(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 YS(a){for(var y=a.network.vertexes.iterator;y.next();){var x=KS(a,y.value);a.Ia=Math.max(x,a.Ia)}}function KS(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,KS(a,z)+b)}y.layer=x}else x=y.layer;return x}function XS(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,XS(a,z)+b)}y.layer=x}else x=y.layer;return x}function ZS(a,y){if(!y.valid){y.valid=!0;for(var x=y.destinationEdges;x.next();)ZS(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&&pp(a,ot,0,-1,!0,!1)}for(pp(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 Pt=mt[yt],kt=Pt.fromVertex;ut+=1,kt.component!==1&&(z+=1,kt=kt.layer-at.layer,Pt=a.linkMinLength(Pt),E=Math.min(E,kt-Pt))}for(mt=at.destinationEdgesArrayAccess,b=mt.length,yt=0;yt<b;yt++)Pt=mt[yt].toVertex,--ut,Pt.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(pp(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++)Pt=mt[yt].fromVertex,at+=1,Pt.component!==1?E+=1:ut=!0;for(mt=tt.destinationEdgesArrayAccess,ft=mt.length,yt=0;yt<ft;yt++)Pt=mt[yt],kt=Pt.toVertex,--at,kt.component!==1&&(--E,kt=tt.layer-kt.layer,Pt=a.linkMinLength(Pt),b=Math.min(b,kt-Pt));(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 JS(a,y,x){return a.K===90?x&&!y.rev||!x&&y.rev?270:90:a.K===180?x&&!y.rev||!x&&y.rev?0:180:a.K===270?x&&!y.rev||!x&&y.rev?90:270:x&&!y.rev||!x&&y.rev?180:0}ji.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&&QS(this,x);break;case wy:for(a=this.network.vertexes.iterator,y=0;y<=this.Ia;y++)for(a.reset();a.next();)x=a.value,x.layer===y&&x.index===-1&&qS(this,x)}};function QS(a,y){var x=y.layer;for(y.index=a.tc[x],a.tc[x]++,y=y.destinationEdgesArrayAccess,x=!0;x;){x=!1;for(var E=0;E<y.length-1;E++){var b=y[E],z=y[E+1];b.portFromColOffset>z.portFromColOffset&&(x=!0,y[E]=z,y[E+1]=b)}}for(x=0;x<y.length;x++)E=y[x],E.valid&&(E=E.toVertex,E.index===-1&&QS(a,E))}function qS(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&&qS(a,E))}ji.prototype.reduceCrossings=function(){var a=this.countCrossings(),y=Ss(this),x,E;for(x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)P0(this,E,1),La(this,E,1);var b=this.countCrossings();for(b<a&&(a=b,y=Ss(this)),E=this.Ia;0<=E;E--)P0(this,E,-1),La(this,E,-1);b=this.countCrossings(),b<a&&(a=b,y=Ss(this))}for(ga(this,y),x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)P0(this,E,0),La(this,E,0);for(b=this.countCrossings(),b<a&&(a=b,y=Ss(this)),E=this.Ia;0<=E;E--)P0(this,E,0),La(this,E,0);b=this.countCrossings(),b<a&&(a=b,y=Ss(this))}ga(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=La(this,E,-1)||z;for(b=this.countCrossings(),b>=a?ga(this,y):(a=b,y=Ss(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=La(this,E,1)||z;for(b=this.countCrossings(),b>=a?ga(this,y):(a=b,y=Ss(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=La(this,E,1)||z;for(b>=a?ga(this,y):(a=b,y=Ss(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=La(this,E,-1)||z;for(b>=a?ga(this,y):(a=b,y=Ss(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=La(this,E,0)||z;for(b>=a?ga(this,y):(a=b,y=Ss(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=La(this,E,0)||z;b>=a?ga(this,y):(a=b,y=Ss(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=La(this,E,-1)||z;for(b=this.countCrossings(),b>=a?ga(this,y):(a=b,y=Ss(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=La(this,E,1)||z;for(b=this.countCrossings(),b>=a?ga(this,y):(a=b,y=Ss(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=La(this,E,1)||z;for(b>=a?ga(this,y):(a=b,y=Ss(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=La(this,E,-1)||z;for(b>=a?ga(this,y):(a=b,y=Ss(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=La(this,E,0)||z;for(b>=a?ga(this,y):(a=b,y=Ss(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=La(this,E,0)||z;b>=a?ga(this,y):(a=b,y=Ss(this))}}ga(this,y)};function P0(a,y,x){var E=Th(a,y),b=a.tc[y],z=WS(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);Ah(a,y,E)}function La(a,y,x){var E=Th(a,y),b=a.tc[y];x=HS(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,Pt=E[z].column,kt=E[z+1].column,Dt=a.nodeMinColumnSpace(E[z],!0),Tt=a.nodeMinColumnSpace(E[z],!1),Rt=a.nodeMinColumnSpace(E[z+1],!0),Gt=a.nodeMinColumnSpace(E[z+1],!1);Dt=Pt-Dt+Rt,Tt=kt-Tt+Gt;var Vt=E[z].sourceEdges.iterator;for(Vt.reset();Vt.next();)if(Rt=Vt.value,Gt=Rt.fromVertex,Rt.valid&&Gt.layer===y){for(Rt=0;E[Rt]!==Gt;)Rt++;Rt<z&&(mt+=2*(z-Rt),yt+=2*(z+1-Rt)),Rt===z+1&&(mt+=1),Rt>z+1&&(mt+=4*(Rt-z),yt+=4*(Rt-(z+1)))}for(Vt=E[z].destinationEdges.iterator,Vt.reset();Vt.next();)if(Rt=Vt.value,Gt=Rt.toVertex,Rt.valid&&Gt.layer===y){for(Rt=0;E[Rt]!==Gt;)Rt++;Rt===z+1&&(yt+=1)}for(Vt=E[z+1].sourceEdges.iterator,Vt.reset();Vt.next();)if(Rt=Vt.value,Gt=Rt.fromVertex,Rt.valid&&Gt.layer===y){for(Rt=0;E[Rt]!==Gt;)Rt++;Rt<z&&(mt+=2*(z+1-Rt),yt+=2*(z-Rt)),Rt===z&&(yt+=1),Rt>z+1&&(mt+=4*(Rt-(z+1)),yt+=4*(Rt-z))}for(Vt=E[z+1].destinationEdges.iterator,Vt.reset();Vt.next();)if(Rt=Vt.value,Gt=Rt.toVertex,Rt.valid&&Gt.layer===y){for(Rt=0;E[Rt]!==Gt;)Rt++;Rt===z&&(mt+=1)}Rt=Gt=0,Vt=tt[E[z].index];var Xt=ot[E[z].index],ie=tt[E[z+1].index],Xe=ot[E[z+1].index];Vt!==-1&&(Gt+=Math.abs(Vt-Pt),Rt+=Math.abs(Vt-Tt)),Xt!==-1&&(Gt+=Math.abs(Xt-Pt),Rt+=Math.abs(Xt-Tt)),ie!==-1&&(Gt+=Math.abs(ie-kt),Rt+=Math.abs(ie-Dt)),Xe!==-1&&(Gt+=Math.abs(Xe-kt),Rt+=Math.abs(Xe-Dt)),(yt<mt-.5||yt===mt&&ft<ut-.5||yt===mt&&ft===ut&&Rt<Gt-.5)&&(at=rt=!0,E[z].column=Tt,E[z+1].column=Dt,ut=E[z],E[z]=E[z+1],E[z+1]=ut)}for(z=0;z<b;z++)E[z].index=z;return Ah(a,y,E),rt}ji.prototype.straightenAndPack=function(){if(this.ve===0){var a=(this.bg&1)!==0,y=(this.bg&Kx)!==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=Tf(this,y,1)||x;for(y=this.Md-1;0<=y;y--)x=Tf(this,y,-1)||x;x=Tf(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&&($S(this,-1),$S(this,1)),this.bg&2)for(x=!0;x;){for(x=!1,x=Tf(this,this.Md,0)||x,y=this.Md+1;y<=this.Ia;y++)x=Tf(this,y,0)||x;for(y=this.Md-1;0<=y;y--)x=Tf(this,y,0)||x}}else Wx(this)};function Tf(a,y,x){for(var E=!1;_x(a,y,x);)E=!0;return E}function _x(a,y,x){var E,b=Th(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 Pt=mt=0,kt=0;if(0>=x)for(var Dt=b[E].sourceEdges.iterator;Dt.next();){var Tt=Dt.value,Rt=Tt.fromVertex;if(Tt.valid&&Rt.layer!==y){var Gt=gy(Tt),Vt=Tt.portFromColOffset;Tt=Tt.portToColOffset,Rt=Rt.column,mt+=(Math.abs(ut+Tt-(Rt+Vt))+1)*Gt,Pt+=(Math.abs(yt+Tt-(Rt+Vt))+1)*Gt,kt+=(Math.abs(ft+Tt-(Rt+Vt))+1)*Gt}}if(0<=x)for(Dt=b[E].destinationEdges.iterator;Dt.next();)Tt=Dt.value,Rt=Tt.toVertex,Tt.valid&&Rt.layer!==y&&(Gt=gy(Tt),Vt=Tt.portFromColOffset,Tt=Tt.portToColOffset,Rt=Rt.column,mt+=(Math.abs(ut+Vt-(Rt+Tt))+1)*Gt,Pt+=(Math.abs(yt+Vt-(Rt+Tt))+1)*Gt,kt+=(Math.abs(ft+Vt-(Rt+Tt))+1)*Gt);Tt=Vt=Gt=0,Dt=tt[b[E].index],Rt=ot[b[E].index],Dt!==-1&&(Gt+=Math.abs(Dt-ut),Vt+=Math.abs(Dt-yt),Tt+=Math.abs(Dt-ft)),Rt!==-1&&(Gt+=Math.abs(Rt-ut),Vt+=Math.abs(Rt-yt),Tt+=Math.abs(Rt-ft)),Pt<mt||Pt===mt&&Vt<Gt?(at=rt=!0,b[E].column=yt):(kt<mt||kt===mt&&Tt<Gt)&&(at=rt=!0,b[E].column=ft)}return Ah(a,y,b),a.normalize(),rt}function yy(a,y,x){var E=Th(a,y),b=a.tc[y],z=WS(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)}Ah(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 $S(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=Ss(a),z=x0(a);for(E=z+1;z<E;){E=z,tx(a,x,1);var tt=x0(a);tt>z?ga(a,b):tt<z&&(z=tt,b=Ss(a))}}if(0>y)for(x=a.Ra;0<=x;x--)for(b=Ss(a),z=x0(a),E=z+1;z<E;)E=z,tx(a,x,-1),tt=x0(a),tt>z?ga(a,b):tt<z&&(z=tt,b=Ss(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=gn(),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 Fe,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=w0(a,y,!0,!1)),y.reverse(),ft&&(a.verticalAlignment(y,x,!1),ot=w0(a,y,!1,!1)),E=mn(y),b=E.next();!b.done;b=E.next())b.value.reverse();mt&&(a.verticalAlignment(y,x,!1),rt=w0(a,y,!1,!0)),y.reverse(),ut&&(a.verticalAlignment(y,x,!0),tt=w0(a,y,!0,!0)),Ye(y),a.u(z,tt,ot,rt),a.network.vertexes.each(function(yt){var Pt=gn();at&&Pt.push(z.get(yt)),ut&&Pt.push(tt.get(yt)),ft&&Pt.push(ot.get(yt)),mt&&Pt.push(rt.get(yt)),Pt.sort(function(Dt,Tt){return Dt-Tt});var kt=Pt.length;kt=(Pt[Math.floor((kt-1)/2)]+Pt[Math.ceil((kt-1)/2)])/2,Ye(Pt),yt.zc=kt})}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=mn(at.sourceEdgesArrayAccess),yt=mt.next();!yt.done;yt=mt.next())yt=yt.value,yt.valid&&ft.push(yt);at.bo=ft}for(at=mn(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}}}ji.prototype.verticalAlignment=function(a,y,x){Ux(a),a=mn(a);for(var E=a.next();!E.done;E=a.next()){var b=-1;E=mn(E.value);for(var z=E.next();!z.done;z=E.next()){z=z.value;var tt=x?My(z):Xx(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?F0(at,z):F0(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 w0(a,y,x,E){for(var b=a.K===90||a.K===270,z=mn(y),tt=z.next();!tt.done;tt=z.next()){var ot=mn(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=mn(y),ot=z.next();!ot.done;ot=z.next()){ot=mn(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 Pt=F0(ut,ft),kt=Pt.portFromPos,Dt=Pt.portToPos;Pt.link!==null&&(ut.node&&ut.node!==Pt.link.fromNode&&(kt=tt?ut.focusX:ut.focusY),ft.node&&ft.node!==Pt.link.toNode&&(Dt=tt?ft.focusX:ft.focusY))}else Pt=F0(ft,ut),kt=Pt.portToPos,Dt=Pt.portFromPos,Pt.link!==null&&(ut.node&&ut.node!==Pt.link.toNode&&(kt=tt?ut.focusX:ut.focusY),ft.node&&ft.node!==Pt.link.fromNode&&(Dt=tt?ft.focusX:ft.focusY));mt=E?ut.qg+(mt-kt)-(yt-Dt):ut.qg+kt-Dt,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=mn(y),tt=x.next();!tt.done;tt=x.next())for(z=mn(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 ln,y=mn(y),tt=y.next();!tt.done;tt=y.next())for(x=mn(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&&ce("Could not determine previous vertex in layer"),y[x][a-1]}ji.prototype.u=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];x=-1;for(var E=gn(),b=gn(),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)));Ye(E),Ye(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}ji.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?bs:cs:a.K===90?y?cs:bs:a.K===180?y?Ts:zr:y?zr:Ts}ji.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 It(x&&E?0:z,x&&!E?0:y),a.reset();a.next();)x=a.value,x.x+=z,x.y+=y,x.commit()},ji.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 pe(0,0,x,Math.abs(this.Ta[0]))):y.push(new pe(0,this.Ta[E-1],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===90?E===0?y.push(new pe(0,this.Ta[0],x,Math.abs(this.Ta[0]-a))):y.push(new pe(0,this.Ta[E],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===180?E===0?y.push(new pe(0,0,Math.abs(this.Ta[0]),x)):y.push(new pe(this.Ta[E-1],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x)):E===0?y.push(new pe(this.Ta[0],0,Math.abs(this.Ta[0]-a),x)):y.push(new pe(this.Ta[E],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x));this.commitLayers(y,this.Rf)},ji.prototype.commitLayers=function(){},ji.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===Qs&&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===pr&&(E=!0),ot!==null&&rt===pr&&(x=!0),(E||x)&&(rt=null,E&&(rt=y.getLinkPointFromPoint(b,tt,tt.ga(Di),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(Di),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,Pt=this.ie,kt=y.firstPickIndex+1;if(y.isOrthogonal){yt=!0;var Dt=y.pointsCount;4<Dt&&y.points.removeRange(2,Dt-3)}else if(y.curve===Qs)mt=!0,Dt=y.pointsCount,4<Dt&&y.points.removeRange(2,Dt-3),Dt===4&&(kt=2);else{Dt=y.pointsCount;var Tt=at===pr,Rt=rt===pr;2<Dt&&Tt&&Rt?y.points.removeRange(1,Dt-2):3<Dt&&Tt&&!Rt?y.points.removeRange(1,Dt-3):3<Dt&&!Tt&&Rt?y.points.removeRange(2,Dt-2):4<Dt&&!Tt&&!Rt&&y.points.removeRange(2,Dt-3)}if(x.rev){for(;ft!==null&&ut!==ft;){var Gt=Dt=null;for(Tt=ft.sourceEdges.iterator;Tt.next()&&(Rt=Tt.value,Rt.link!==x.link||(Dt=Rt.fromVertex,Gt=Rt.toVertex,Dt.node!==null)););if(Dt===null)break;if(Dt!==ut){Tt=y.i(kt-1).x,Rt=y.i(kt-1).y;var Vt=Dt.centerX,Xt=Dt.centerY;if(yt)this.K===180||this.K===0?kt===y.firstPickIndex+1?(y.m(kt++,Tt,Rt),y.m(kt++,Tt,Xt)):(Gt!==null?Gt.centerY:Rt)!==Xt&&(Gt=this.Ta[Dt.layer-1]+this.Rf.x,y.m(kt++,Gt,Rt),y.m(kt++,Gt,Xt)):kt===y.firstPickIndex+1?(y.m(kt++,Tt,Rt),y.m(kt++,Vt,Rt)):(Gt!==null?Gt.centerX:Tt)!==Vt&&(Gt=this.Ta[Dt.layer-1]+this.Rf.y,y.m(kt++,Tt,Gt),y.m(kt++,Vt,Gt));else if(kt===y.firstPickIndex+1){Gt=Math.max(10,this.he[ft.layer]);var ie=Math.max(10,this.Ld[ft.layer]);if(mt)this.K===180?Vt<=ft.bounds.x?(ft=ft.bounds.x,y.m(kt++,ft-Gt,Xt),y.m(kt++,ft,Xt),y.m(kt++,ft+ie,Xt)):(y.m(kt++,Vt-Gt,Xt),y.m(kt++,Vt,Xt),y.m(kt++,Vt+ie,Xt)):this.K===90?Xt>=ft.bounds.bottom?(ft=ft.bounds.y+ft.bounds.height,y.m(kt++,Vt,ft+ie),y.m(kt++,Vt,ft),y.m(kt++,Vt,ft-Gt)):(y.m(kt++,Vt,Xt+ie),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Xt-Gt)):this.K===270?Xt<=ft.bounds.y?(ft=ft.bounds.y,y.m(kt++,Vt,ft-Gt),y.m(kt++,Vt,ft),y.m(kt++,Vt,ft+ie)):(y.m(kt++,Vt,Xt-Gt),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Xt+ie)):this.K===0&&(Vt>=ft.bounds.right?(ft=ft.bounds.x+ft.bounds.width,y.m(kt++,ft+ie,Xt),y.m(kt++,ft,Xt),y.m(kt++,ft-Gt,Xt)):(y.m(kt++,Vt+ie,Xt),y.m(kt++,Vt,Xt),y.m(kt++,Vt-Gt,Xt)));else{y.m(kt++,Tt,Rt);var Xe=0;this.K===180||this.K===0?((this.K===180?Vt>=ft.bounds.right:Vt<=ft.bounds.x)&&(Xe=(this.K===0?-Gt:ie)/2),y.m(kt++,Tt+Xe,Xt)):((this.K===270?Xt>=ft.bounds.bottom:Xt<=ft.bounds.y)&&(Xe=(this.K===90?-Gt:ie)/2),y.m(kt++,Vt,Rt+Xe)),y.m(kt++,Vt,Xt)}}else Gt=Math.max(10,this.he[Dt.layer]),ie=Math.max(10,this.Ld[Dt.layer]),mt?this.K===180?(y.m(kt++,Vt-Gt-Pt,Xt),y.m(kt++,Math.min(Vt-Gt+Pt/2,Vt),Xt),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Xt),y.m(kt++,Math.max(Vt+ie-Pt/2,Vt),Xt),y.m(kt++,Vt+ie+Pt,Xt)):this.K===90?(y.m(kt++,Vt,Xt+ie+Pt),y.m(kt++,Vt,Math.max(Xt+ie-Pt/2,Xt)),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Math.min(Xt-Gt+Pt/2,Xt)),y.m(kt++,Vt,Xt-Gt-Pt)):this.K===270?(y.m(kt++,Vt,Xt-Gt-Pt),y.m(kt++,Vt,Math.min(Xt-Gt+Pt/2,Xt)),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Math.max(Xt+ie-Pt/2,Xt)),y.m(kt++,Vt,Xt+ie+Pt)):(y.m(kt++,Vt+ie+Pt,Xt),y.m(kt++,Math.max(Vt+ie-Pt/2,Vt),Xt),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Xt),y.m(kt++,Math.min(Vt-Gt+Pt/2,Vt),Xt),y.m(kt++,Vt-Gt-Pt,Xt)):y.m(kt++,Vt,Xt)}ft=Dt}(ot===null||at!==pr||yt)&&(Tt=y.i(kt-1).x,Rt=y.i(kt-1).y,Vt=y.i(kt).x,Xt=y.i(kt).y,yt?(Pt=this.Ld[ut.layer],this.K===180||this.K===0?(yt=Rt,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?-Pt:Pt),yt<ut.bounds.y+ut.bounds.height/2?yt=ut.bounds.y-this.kc/2:yt=ut.bounds.bottom+this.kc/2,y.m(kt++,ft,Rt),y.m(kt++,ft,yt)),y.m(kt++,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?-Pt:Pt),yt<ut.bounds.x+ut.bounds.width/2?yt=ut.bounds.x-this.kc/2:yt=ut.bounds.right+this.kc/2,y.m(kt++,Tt,ft),y.m(kt++,yt,ft)),y.m(kt++,yt,Xt)),y.m(kt++,Vt,Xt)):mt?(Gt=Math.max(10,this.he[ut.layer]),ie=Math.max(10,this.Ld[ut.layer]),this.K===180&&Vt>=ut.bounds.x?(ft=ut.bounds.x+ut.bounds.width,y.L(kt-2,ft,Rt),y.L(kt-1,ft+ie,Rt)):this.K===90&&Xt<=ut.bounds.bottom?(ft=ut.bounds.y,y.L(kt-2,Tt,ft),y.L(kt-1,Tt,ft-Gt)):this.K===270&&Xt>=ut.bounds.y?(ft=ut.bounds.y+ut.bounds.height,y.L(kt-2,Tt,ft),y.L(kt-1,Tt,ft+ie)):this.K===0&&Vt<=ut.bounds.right&&(ft=ut.bounds.x,y.L(kt-2,ft,Rt),y.L(kt-1,ft-Gt,Rt))):(Gt=Math.max(10,this.he[ut.layer]),ie=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?ie:-Gt)/2),y.m(kt++,Vt+yt,Rt)):((this.K===270?Xt<=ut.bounds.y:Xt>=ut.bounds.bottom)&&(yt=(this.K===90?ie:-Gt)/2),y.m(kt++,Tt,Xt+yt)),y.m(kt++,Vt,Xt)))}else{for(;ut!==null&&ut!==ft;){for(Gt=Dt=null,ut=ut.destinationEdges.iterator;ut.next()&&(Tt=ut.value,Tt.link!==x.link||(Dt=Tt.toVertex,Gt=Tt.fromVertex,Gt.node!==null&&(Gt=null),Dt.node!==null)););if(Dt===null)break;Dt!==ft&&(Tt=y.i(kt-1).x,Rt=y.i(kt-1).y,Vt=Dt.centerX,Xt=Dt.centerY,yt?this.K===180||this.K===0?(Gt!==null?Gt.centerY:Rt)!==Xt&&(Gt=this.Ta[Dt.layer]+this.Rf.x,kt===y.firstPickIndex+1&&(Gt=this.K===0?Math.max(Gt,Tt):Math.min(Gt,Tt)),y.m(kt++,Gt,Rt),y.m(kt++,Gt,Xt)):(Gt!==null?Gt.centerX:Tt)!==Vt&&(Gt=this.Ta[Dt.layer]+this.Rf.y,kt===y.firstPickIndex+1&&(Gt=this.K===90?Math.max(Gt,Rt):Math.min(Gt,Rt)),y.m(kt++,Tt,Gt),y.m(kt++,Vt,Gt)):(Gt=Math.max(10,this.he[Dt.layer]),ie=Math.max(10,this.Ld[Dt.layer]),mt?this.K===180?(y.m(kt++,Vt+ie+Pt,Xt),y.m(kt++,Math.max(Vt+ie-Pt/2,Vt),Xt),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Xt),y.m(kt++,Math.min(Vt-Gt+Pt/2,Vt),Xt),y.m(kt++,Vt-Gt-Pt,Xt)):this.K===90?(y.m(kt++,Vt,Xt-Gt-Pt),y.m(kt++,Vt,Math.min(Xt-Gt+Pt/2,Xt)),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Math.max(Xt+ie-Pt/2,Xt)),y.m(kt++,Vt,Xt+ie+Pt)):this.K===270?(y.m(kt++,Vt,Xt+ie+Pt),y.m(kt++,Vt,Math.max(Xt+ie-Pt/2,Xt)),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Math.min(Xt-Gt+Pt/2,Xt)),y.m(kt++,Vt,Xt-Gt-Pt)):(y.m(kt++,Vt-Gt-Pt,Xt),y.m(kt++,Math.min(Vt-Gt+Pt/2,Vt),Xt),y.m(kt++,Vt,Xt),y.m(kt++,Vt,Xt),y.m(kt++,Math.max(Vt+ie-Pt/2,Vt),Xt),y.m(kt++,Vt+ie+Pt,Xt)):this.K===180?(y.m(kt++,Vt+ie,Xt),y.m(kt++,Vt-Gt,Xt)):this.K===90?(y.m(kt++,Vt,Xt-Gt),y.m(kt++,Vt,Xt+ie)):this.K===270?(y.m(kt++,Vt,Xt+ie),y.m(kt++,Vt,Xt-Gt)):(y.m(kt++,Vt-Gt,Xt),y.m(kt++,Vt+ie,Xt)))),ut=Dt}yt&&(Tt=y.i(kt-1).x,Rt=y.i(kt-1).y,Vt=y.i(kt).x,Xt=y.i(kt).y,this.K===180||this.K===0?Rt!==Xt&&(Gt=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(kt++,Gt,Rt),y.m(kt++,Gt,Xt)):Tt!==Vt&&(Gt=this.K===90?Math.min(Math.max((Xt+Rt)/2,this.Ta[ft.layer]+this.Rf.y),Xt):Math.max(Math.min((Xt+Rt)/2,this.Ta[ft.layer]+this.Rf.y),Xt),y.m(kt++,Tt,Gt),y.m(kt++,Vt,Gt)))}E!==null&&mt&&4<=y.pointsCount&&(tt!==null&&(tt=at===pr?y.getLinkPointFromPoint(b,tt,tt.ga(Di),y.i(3),!0):y.i(0),at===pr&&(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===pr?y.getLinkPointFromPoint(z,ot,ot.ga(Di),y.i(y.pointsCount-4),!1):y.i(y.pointsCount-1),rt===pr&&(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()},ji.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new Pe,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 Bh;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 Pt=this.linkSpacing*(ut-(at-1)/2);y++,yt.uh(),yt.L(mt.index,z.x,z.y+Pt),yt.L(mt.index+1,tt.x,tt.y+Pt),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 Bh,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),Pt=this.linkSpacing*(ut-(at-1)/2),y++,yt.uh(),yt.L(mt.index,z.x+Pt,z.y),yt.L(mt.index+1,tt.x+Pt,tt.y),yt.zf()}z=b}a=E}}}},xt=ji.prototype,xt.Vx=function(a,y){return a instanceof Bh&&y instanceof Bh&&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},xt.Ux=function(a,y){return a instanceof Bh&&y instanceof Bh&&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},xt.Js=function(a,y){return a instanceof Bh&&y instanceof Bh&&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},xt.B=function(a,y){return a-=y,-1<a&&1>a},xt.zi=function(a,y,x,E){var b=a.length,z=E-x;if(!(1>=z))if((0>x||x>=b-1)&&ce("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 Th(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 Ah(a,y,x){a.He[a.tc[y]]=x}ke.Object.defineProperties(ji.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()):ce("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!==mp||(this.Dk=a,this.C())}},layeringOption:{get:function(){return this.Zk},set:function(a){this.Zk===a||a!==k0&&a!==xy&&a!==Py||(this.Zk=a,this.C())}},initializeOption:{get:function(){return this.Qk},set:function(a){this.Qk===a||a!==M0&&a!==wy&&a!==Cy||(this.Qk=a,this.C())}},iterations:{get:function(){return this.bj},set:function(a){this.bj!==a&&0<=a&&(this.bj=a,this.C())}},aggressiveOption:{get:function(){return this.rk},set:function(a){this.rk===a||a!==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 he(ji,"CycleDepthFirst",0),Sy=new he(ji,"CycleGreedy",1),mp=new he(ji,"CycleFromLayers",2),k0=new he(ji,"LayerOptimalLinkLength",0),xy=new he(ji,"LayerLongestPathSink",1),Py=new he(ji,"LayerLongestPathSource",2),M0=new he(ji,"InitDepthFirstOut",0),wy=new he(ji,"InitDepthFirstIn",1),Cy=new he(ji,"InitNaive",2),Ly=new he(ji,"AggressiveNone",0),E0=new he(ji,"AggressiveLess",1),ky=new he(ji,"AggressiveMore",2),Kx=8;ji.className="LayeredDigraphLayout",ji.CycleDepthFirst=L0,ji.CycleGreedy=Sy,ji.CycleFromLayers=mp,ji.LayerOptimalLinkLength=k0,ji.LayerLongestPathSink=xy,ji.LayerLongestPathSource=Py,ji.InitDepthFirstOut=M0,ji.InitDepthFirstIn=wy,ji.InitNaive=Cy,ji.AggressiveNone=Ly,ji.AggressiveLess=E0,ji.AggressiveMore=ky,ji.PackNone=0,ji.PackExpand=1,ji.PackStraighten=2,ji.PackMedian=4,ji.PackAll=15,ji.AlignNone=0,ji.AlignUpperLeft=1,ji.AlignUpperRight=2,ji.AlignLowerLeft=4,ji.AlignLowerRight=8,ji.AlignAll=15;function Bh(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}Bh.className="SegInfo";function Af(a){Ji.call(this,a)}ne(Af,Ji),Af.prototype.createVertex=function(){return new pa(this)},Af.prototype.createEdge=function(){return new vp(this)},Af.className="LayeredDigraphNetwork";function pa(a){Ko.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}ne(pa,Ko);function ix(a,y){return a.index-y.index}function F0(a,y){if(!a.$n){for(var x=[],E=mn(a.destinationEdgesArrayAccess),b=E.next();!b.done;b=E.next())b=b.value,b.valid&&x.push(b);a.$n=x}for(a=mn(a.$n),x=a.next();!x.done;x=a.next())if(x=x.value,x.toVertex===y)return x;ce("Unable to find destination edge to given vertex")}function My(a){if(!a.co){for(var y=[],x=mn(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 Xx(a){if(!a.ao){for(var y=[],x=mn(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}pa.prototype.Cl=function(a){Ko.prototype.Cl.call(this,a),this.bo=this.co=null},pa.prototype.Kl=function(a){Ko.prototype.Kl.call(this,a),this.bo=this.co=null},pa.prototype.zl=function(a){Ko.prototype.zl.call(this,a),this.$n=this.ao=null},pa.prototype.Jl=function(a){Ko.prototype.Jl.call(this,a),this.$n=this.ao=null},ke.Object.defineProperties(pa.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)}}}),pa.prototype.deleteDestinationEdge=pa.prototype.Jl,pa.prototype.addDestinationEdge=pa.prototype.zl,pa.prototype.deleteSourceEdge=pa.prototype.Kl,pa.prototype.addSourceEdge=pa.prototype.Cl,pa.className="LayeredDigraphVertex";function vp(a){js.call(this,a),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}ne(vp,js),ke.Object.defineProperties(vp.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)}}}),vp.className="LayeredDigraphEdge";function si(a){so.call(this),this.Ub=new Fe,this.Wn=A0,this.ud=Il,this.vo=D0,this.Bq=jy,this.$v=[],this.td=!0,this.Rb=O0,this.$d=new Ke(10,10).freeze();var y=new mc(this);this.W=new ka(y),this.Y=new ka(y),this.ru=[],a&&Object.assign(this,a)}ne(si,so),si.prototype.cloneProtected=function(a){so.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)},si.prototype.qb=function(a){a.classType===si?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:ce("Unknown enum value: "+a):so.prototype.qb.call(this,a)},si.prototype.createNetwork=function(){return new mc(this)},si.prototype.makeNetwork=function(a){function y(E){if(E instanceof Je)return!E.isLinkLabel&&E.category!=="Comment";if(E instanceof _e){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 oe?(x.lg(a.nodes,!0,y),x.lg(a.links,!0,y)):a instanceof Vn?x.lg(a.memberParts,!1,y):x.lg(a.iterator,!1,y),x},si.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 oe&&(y=a),this.path===A0&&y!==null?this.ud=y.isTreePathToChildren?Il:gc:this.ud=this.path===A0?Il: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 Fe,y=this.Ub.iterator;y.next();){var x=y.value;x instanceof Je?(x=this.network.ki(x),x!==null&&a.add(x)):x instanceof ka&&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=Zx(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 ka&&sx(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof ka&&ax(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof ka&&lx(this,y);if(this.Cu(),this.layerStyle===j0){for(a=[],y=this.network.vertexes.iterator;y.next();){x=y.value;var E=x.parent;E===null&&(E=x),E=E.angle===0||E.angle===180;var b=a[x.level];b===void 0&&(b=0),a[x.level]=Math.max(b,E?x.width:x.height)}for(y=0;y<a.length;y++)a[y]===void 0&&(a[y]=0);for(this.$v=a,y=this.network.vertexes.iterator;y.next();)x=y.value,E=x.parent,E===null&&(E=x),E.angle===0||E.angle===180?(E.angle===180&&(x.focusX+=a[x.level]-x.width),x.width=a[x.level]):(E.angle===270&&(x.focusY+=a[x.level]-x.height),x.height=a[x.level])}else if(this.layerStyle===Ry)for(a=this.network.vertexes.iterator;a.next();){for(y=a.value,x=y.angle===0||y.angle===180,E=-1,b=0;b<y.children.length;b++){var z=y.children[b];E=Math.max(E,x?z.width:z.height)}if(0<=E)for(b=0;b<y.children.length;b++)z=y.children[b],x?(y.angle===180&&(z.focusX+=E-z.width),z.width=E):(y.angle===270&&(z.focusY+=E-z.height),z.height=E)}for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof ka&&this.layoutTree(y);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new Fe,this.isValidLayout=!0};function Zx(a){var y=new Fe;for(a=a.iterator;a.next();){var x=a.value;x.initialized||y.add(x)}return y}si.prototype.findRoots=function(){for(var a=this.network.vertexes,y=a.iterator;y.next();){var x=y.value;switch(this.ud){case Il:x.sourceEdges.count===0&&this.Ub.add(x);break;case gc:x.destinationEdges.count===0&&this.Ub.add(x);break;default:ce("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 Il:b.sourceEdges.count<x&&(x=b.sourceEdges.count,E=b);break;case gc:b.destinationEdges.count<x&&(x=b.destinationEdges.count,E=b);break;default:ce("Unhandled path value "+a.ud.toString())}}return E}function Ey(a,y){if(y!==null){switch(a.ud){case Il:if(0<y.destinationEdges.count){for(var x=new Pe,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 gc:if(0<y.sourceEdges.count){for(x=new Pe,E=y.sourceVertexes;E.next();)b=E.value,rx(a,y,b)&&x.add(b);0<x.count&&(y.children=x.Fa())}break;default:ce("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}si.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===zl&&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}}si.prototype.initializeTreeVertexValues=function(a){if(a.copyInheritedPropertiesFrom(Jx(this,a)),a.parent!==null&&a.parent.alignment===zl){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])}}si.prototype.assignTreeVertexValues=function(){};function lx(a,y){if(y!==null){y.alignment!==zl&&a.sortTreeVertexChildren(y),y=y.children;for(var x=y.length,E=0;E<x;E++)lx(a,y[E])}}si.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case Bf:break;case Sp:a.children.reverse();break;case xp:a.children.sort(a.comparer);break;case Pp:a.children.sort(a.comparer),a.children.reverse();break;default:ce("Unhandled sorting value "+a.sorting.toString())}},si.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},si.prototype.addComments=function(a){var y=a.angle,x=a.parent,E=0,b=!1;x!==null&&(E=x.angle,b=x.alignment,b=Dh(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=pe.allocAt(0,0,a.bounds.width+z,a.bounds.height+tt),a.bounds=b,pe.free(b))};function Dh(a){return a===Vu||a===zl||a===Uu||a===su}function yp(a){return a===Vu||a===zl}function Fy(a){var y=a.parent;if(y!==null){var x=y.alignment;if(Dh(x)){if(yp(x)){for(y=y.children,x=0;x<y.length&&a!==y[x];)x++;return x%2===0}if(x===Uu)return!0}}return!1}si.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=Dh(z)),E=E===90||E===270,x=b===90||b===270;for(var tt=a.childrenCount===0,ot=Fy(a),rt=0,at=a.comments,ut=at.length,ft=It.alloc(),mt=0;mt<ut;mt++){var yt=at[mt],Pt=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-Pt.width,a.bounds.y+rt),yt.move(ft),yt=yt.Sd();yt.next();){var kt=yt.value;kt.fromSpot=Ts,kt.toSpot=zr}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();)kt=yt.value,kt.fromSpot=zr,kt.toSpot=Ts;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();)kt=yt.value,kt.fromSpot=zr,kt.toSpot=Ts;else for(ft.h(a.bounds.x+a.commentMargin-Pt.width,a.bounds.y+rt),yt.move(ft),yt=yt.Sd();yt.next();)kt=yt.value,kt.fromSpot=Ts,kt.toSpot=zr;rt=0<=a.commentSpacing?rt+(Pt.height+a.commentSpacing):rt+(a.commentSpacing-Pt.height)}else{if(135<b&&!z||!x&&ot)if(0<=a.commentMargin)for(ft.h(a.bounds.x+rt,a.bounds.y-a.commentMargin-Pt.height),yt.move(ft),yt=yt.Sd();yt.next();)kt=yt.value,kt.fromSpot=bs,kt.toSpot=cs;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();)kt=yt.value,kt.fromSpot=cs,kt.toSpot=bs;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();)kt=yt.value,kt.fromSpot=cs,kt.toSpot=bs;else for(ft.h(a.bounds.x+rt,a.bounds.y+a.commentMargin-Pt.height),yt.move(ft),yt=yt.Sd();yt.next();)kt=yt.value,kt.fromSpot=bs,kt.toSpot=cs;rt=0<=a.commentSpacing?rt+(Pt.width+a.commentSpacing):rt+(a.commentSpacing-Pt.width)}}if(It.free(ft),y=rt-a.commentSpacing-(E?y.height:y.width),this.ud===Il)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)}},si.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 wp:if(a.alignment===zl)ux(this,a);else if(a.childrenCount===0)E=a.parent,x=!1,y=0,E!==null&&(y=E.angle,x=E.alignment,x=Dh(x)),E=Fy(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=Ga(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===jl;var at=rt===Rl,ut=Dh(rt),ft=Math.max(0,a.breadthLimit);x=this.computeLayerSpacing(a);var mt=a.nodeSpacing,yt=this.computeNodeIndent(a),Pt=a.rowSpacing,kt=0;(E||at||a.hm||a.im&&a.maxGenerationCount===1)&&(kt=Math.max(0,a.rowIndent)),E=a.width;var Dt=a.height,Tt=0,Rt=0,Gt=0,Vt=null,Xt=null,ie=0,Xe=0,an=0,on=0,je=0,Me=0,Wn=0,jn=0;if(ut&&!yp(rt)&&135<b&&tt.reverse(),yp(rt))if(1<ot)for(var Ei=0;Ei<ot;Ei++)Ei%2===0&&Ei!==ot-1&&(jn=Math.max(jn,y?tt[Ei].Da.width:tt[Ei].Da.height));else ot===1&&(jn=y?tt[0].Da.width:tt[0].Da.height);if(ut){switch(rt){case Vu:Rt=135>b?hx(this,a,tt,jn,Tt,Rt):dx(this,a,tt,jn,Tt,Rt),jn=Rt.x,Tt=Rt.width,Rt=Rt.height;break;case Uu:for(Vt=0;Vt<ot;Vt++)Xt=tt[Vt],ft=Xt.Da,Gt=Me===0?0:Pt,y?(Xt.S.h(z-ft.width,on+Gt),Tt=Math.max(Tt,ft.width),Rt=Math.max(Rt,on+Gt+ft.height),on+=Gt+ft.height):(Xt.S.h(an+Gt,z-ft.height),Tt=Math.max(Tt,an+Gt+ft.width),Rt=Math.max(Rt,ft.height),an+=Gt+ft.width),Me++;break;case su:for(Vt=0;Vt<ot;Vt++)Xt=tt[Vt],z=Xt.Da,ft=Me===0?0:Pt,y?(Xt.S.h(mt/2+a.focus.x,on+ft),Tt=Math.max(Tt,z.width),Rt=Math.max(Rt,on+ft+z.height),on+=ft+z.height):(Xt.S.h(an+ft,mt/2+a.focus.y),Tt=Math.max(Tt,an+ft+z.width),Rt=Math.max(Rt,z.height),an+=ft+z.width),Me++}Vt=Ls(this,2),Xt=Ls(this,2),y?(Vt[0].h(0,0),Vt[1].h(0,Rt),Xt[0].h(Tt,0)):(Vt[0].h(0,0),Vt[1].h(Tt,0),Xt[0].h(0,Rt)),Xt[1].h(Tt,Rt)}else for(Ei=0;Ei<ot;Ei++){var Xi=tt[Ei],tr=Xi.Da;if(y){0<ft&&0<Me&&an+mt+tr.width>ft&&(an<z&&xd(a,rt,z-an,0,Wn,Ei-1),je++,Me=0,Wn=Ei,Gt=Rt,an=0,on=135<b?-Rt-Pt:Rt+Pt),b0(this,Xi,0,on);var rr=0;if(Me===0)Vt=Xi.Yo,Xt=Xi.kp,ie=tr.width,Xe=tr.height,(Vt===null||Xt===null||b!==Ga(Xi))&&(Vt=Ls(this,2),Xt=Ls(this,2),Vt[0].h(0,0),Vt[1].h(0,Xe),Xt[0].h(ie,0),Xt[1].h(ie,Xe));else{var Vr=gn();Xe=cx(this,a,Xi,Vt,Xt,ie,Xe,Vr),rr=Xe.x,Vt=Vr[0],Xt=Vr[1],ie=Xe.width,Xe=Xe.height,Ye(Vr),an<tr.width&&0>rr&&(fc(a,-rr,0,Wn,Ei-1),T0(Vt,-rr,0),T0(Xt,-rr,0),rr=0)}Xi.S.h(rr,on),Tt=Math.max(Tt,ie),Rt=Math.max(Rt,Gt+(je===0?0:Pt)+tr.height),an=ie}else 0<ft&&0<Me&&on+mt+tr.height>ft&&(on<z&&xd(a,rt,0,z-on,Wn,Ei-1),je++,Me=0,Wn=Ei,Gt=Tt,on=0,an=135<b?-Tt-Pt:Tt+Pt),b0(this,Xi,an,0),rr=0,Me===0?(Vt=Xi.Yo,Xt=Xi.kp,ie=tr.width,Xe=tr.height,(Vt===null||Xt===null||b!==Ga(Xi))&&(Vt=Ls(this,2),Xt=Ls(this,2),Vt[0].h(0,0),Vt[1].h(ie,0),Xt[0].h(0,Xe),Xt[1].h(ie,Xe))):(Vr=gn(),Xe=cx(this,a,Xi,Vt,Xt,ie,Xe,Vr),rr=Xe.x,Vt=Vr[0],Xt=Vr[1],ie=Xe.width,Xe=Xe.height,Ye(Vr),on<tr.height&&0>rr&&(fc(a,0,-rr,Wn,Ei-1),T0(Vt,0,-rr),T0(Xt,0,-rr),rr=0)),Xi.S.h(an,rr),Rt=Math.max(Rt,Xe),Tt=Math.max(Tt,Gt+(je===0?0:Pt)+tr.width),on=Xe;Me++}switch(0<je&&(y?(Rt+=Math.max(0,x),an<Tt&&xd(a,rt,Tt-an,0,Wn,ot-1),0<kt&&(at||fc(a,kt,0,0,ot-1),Tt+=kt)):(Tt+=Math.max(0,x),on<Rt&&xd(a,rt,0,Rt-on,Wn,ot-1),0<kt&&(at||fc(a,0,kt,0,ot-1),Rt+=kt))),kt=at=0,rt){case Df:y?at+=Tt/2-a.focus.x-yt/2:kt+=Rt/2-a.focus.y-yt/2;break;case pc:0<je?y?at+=Tt/2-a.focus.x-yt/2:kt+=Rt/2-a.focus.y-yt/2:y?(jn=tt[0].S.x+tt[0].la.x,at+=jn+(tt[ot-1].S.x+tt[ot-1].la.x+2*tt[ot-1].focus.x-jn)/2-a.focus.x-yt/2):(jn=tt[0].S.y+tt[0].la.y,kt+=jn+(tt[ot-1].S.y+tt[ot-1].la.y+2*tt[ot-1].focus.y-jn)/2-a.focus.y-yt/2);break;case jl:y?(at-=yt,Tt+=yt):(kt-=yt,Rt+=yt);break;case Rl:y?(at+=Tt-a.width+yt,Tt+=yt):(kt+=Rt-a.height+yt,Rt+=yt);break;case Vu:y?1<ot?at+=jn+mt/2-a.focus.x:at+=tt[0].focus.x-a.focus.x+tt[0].la.x:1<ot?kt+=jn+mt/2-a.focus.y:kt+=tt[0].focus.y-a.focus.y+tt[0].la.y;break;case Uu:y?at+=Tt+mt/2-a.focus.x:kt+=Rt+mt/2-a.focus.y;break;case su:break;default:Rt=this.customAlignment(a,at,kt,Tt,Rt),at=Rt[0],kt=Rt[1],Tt=Rt[2],Rt=Rt[3]}for(yt=0;yt<ot;yt++)jn=tt[yt],y?jn.S.h(jn.S.x+jn.la.x-at,jn.S.y+(135<b?(ut?-Rt:-jn.Da.height)+jn.la.y-x:Dt+x+jn.la.y)):jn.S.h(jn.S.x+(135<b?(ut?-Tt:-jn.Da.width)+jn.la.x-x:E+x+jn.la.x),jn.S.y+jn.la.y-kt);if(ot=tt=0,ut?y?(Tt=Ny(a,Tt,at),0>at&&(at=0),135<b&&(kt+=Rt+x),Rt+=Dt+x,rt===su&&(tt+=mt/2+a.focus.x),ot+=Dt+x):(135<b&&(at+=Tt+x),Tt+=E+x,Rt=by(a,Rt,kt),0>kt&&(kt=0),rt===su&&(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=Ny(a,Tt,at),0>at&&(tt-=at,at=0),135<b&&(kt+=Rt+x),Rt=Math.max(Math.max(Rt,Dt),Rt+Dt+x),ot+=Dt+x):(135<b&&(at+=Tt+x),Tt=Math.max(Math.max(Tt,E),Tt+E+x),a.comments===null?Dt>Rt&&(Rt=Ty(rt,0,Dt-Rt),tt=Rt.x,ot=Rt.y,Rt=Dt,kt=0):Rt=by(a,Rt,kt),0>kt&&(ot-=kt,kt=0),tt+=E+x),0<je)b=Ls(this,4),je=Ls(this,4),y?(b[2].h(0,Dt+x),b[3].h(b[2].x,Rt),je[2].h(Tt,b[2].y),je[3].h(je[2].x,b[3].y)):(b[2].h(E+x,0),b[3].h(Tt,b[2].y),je[2].h(b[2].x,Rt),je[3].h(b[3].x,je[2].y));else{for(b=Ls(this,Vt.length+2),je=Ls(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],je[rt+2].h(ut.x+tt,ut.y+ot)}y?(b[0].h(at,0),b[1].h(b[0].x,Dt),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])),je[0].h(at+E,0),je[1].h(je[0].x,Dt),je[2].y<je[1].y&&(je[2].x<je[0].x?je[2].assign(je[1]):je[1].assign(je[2])),je[3].y<je[2].y&&(je[3].x<je[0].x?je[3].assign(je[2]):je[2].assign(je[3])),b[2].y-=x/2,je[2].y-=x/2):(b[0].h(0,kt),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])),je[0].h(0,kt+Dt),je[1].h(E,je[0].y),je[2].x<je[1].x&&(je[2].y<je[0].y?je[2].assign(je[1]):je[1].assign(je[2])),je[3].x<je[2].x&&(je[3].y<je[0].y?je[3].assign(je[2]):je[2].assign(je[3])),b[2].x-=x/2,je[2].x-=x/2),el(this,Vt),el(this,Xt),a.Yo=b,a.kp=je,a.la.h(at,kt),a.Da.h(Tt,Rt)}break;default:ce("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=Dh(x));var b=Fy(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=Ga(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===jl,ft=at===Rl;ot=Dh(at);var mt=Math.max(0,y.breadthLimit);rt=a.computeLayerSpacing(y);var yt=y.nodeSpacing,Pt=a.computeNodeIndent(y),kt=ut||ft?0:Pt/2,Dt=y.rowSpacing,Tt=0;(ut||ft||y.hm||y.im&&y.maxGenerationCount===1)&&(Tt=Math.max(0,y.rowIndent)),ut=y.width;var Rt=y.height,Gt=0,Vt=0,Xt=0,ie=0,Xe=0,an=0,on=0,je=0,Me=0,Wn=0;if(ot&&!yp(at)&&135<E&&b.reverse(),yp(at))if(1<tt)for(var jn=0;jn<tt;jn++){var Ei=b[jn],Xi=Ei.Da;jn%2===0&&jn!==tt-1?Me=Math.max(Me,(x?Xi.width:Xi.height)+a.computeBusNodeSpacing(Ei)-yt):jn%2!==0&&(Wn=Math.max(Wn,(x?Xi.width:Xi.height)+a.computeBusNodeSpacing(Ei)-yt))}else tt===1&&(Me=x?b[0].Da.width:b[0].Da.height);if(ot)switch(at){case Vu:case zl:Vt=135>E?hx(a,y,b,Me,Gt,Vt):dx(a,y,b,Me,Gt,Vt),Me=Vt.x,Gt=Vt.width,Vt=Vt.height;break;case Uu:for(mt=0;mt<tt;mt++)kt=b[mt],Xt=kt.Da,Wn=on===0?0:Dt,x?(kt.S.h(z-Xt.width,Xe+Wn),Gt=Math.max(Gt,Xt.width),Vt=Math.max(Vt,Xe+Wn+Xt.height),Xe+=Wn+Xt.height):(kt.S.h(ie+Wn,z-Xt.height),Gt=Math.max(Gt,ie+Wn+Xt.width),Vt=Math.max(Vt,Xt.height),ie+=Wn+Xt.width),on++;break;case su:for(z=0;z<tt;z++)mt=b[z],kt=mt.Da,Xt=on===0?0:Dt,x?(mt.S.h(yt/2+y.focus.x,Xe+Xt),Gt=Math.max(Gt,kt.width),Vt=Math.max(Vt,Xe+Xt+kt.height),Xe+=Xt+kt.height):(mt.S.h(ie+Xt,yt/2+y.focus.y),Gt=Math.max(Gt,ie+Xt+kt.width),Vt=Math.max(Vt,kt.height),ie+=Xt+kt.width),on++}else for(Wn=0;Wn<tt;Wn++)jn=b[Wn],Ei=jn.Da,x?(0<mt&&0<on&&ie+yt+Ei.width>mt&&(ie<z&&xd(y,at,z-ie,0,je,Wn-1),an++,on=0,je=Wn,Xt=Vt,ie=0,Xe=135<E?-Vt-Dt:Vt+Dt),Xi=on===0?kt:yt,b0(a,jn,0,Xe),jn.S.h(ie+Xi,Xe),Gt=Math.max(Gt,ie+Xi+Ei.width),Vt=Math.max(Vt,Xt+(an===0?0:Dt)+Ei.height),ie+=Xi+Ei.width):(0<mt&&0<on&&Xe+yt+Ei.height>mt&&(Xe<z&&xd(y,at,0,z-Xe,je,Wn-1),an++,on=0,je=Wn,Xt=Gt,Xe=0,ie=135<E?-Gt-Dt:Gt+Dt),Xi=on===0?kt:yt,b0(a,jn,ie,0),jn.S.h(ie,Xe+Xi),Vt=Math.max(Vt,Xe+Xi+Ei.height),Gt=Math.max(Gt,Xt+(an===0?0:Dt)+Ei.width),Xe+=Xi+Ei.height),on++;switch(0<an&&(x?(Vt+=Math.max(0,rt),ie<Gt&&xd(y,at,Gt-ie,0,je,tt-1),0<Tt&&(ft||fc(y,Tt,0,0,tt-1),Gt+=Tt)):(Gt+=Math.max(0,rt),Xe<Vt&&xd(y,at,0,Vt-Xe,je,tt-1),0<Tt&&(ft||fc(y,0,Tt,0,tt-1),Vt+=Tt))),Tt=ft=0,at){case Df:x?ft+=Gt/2-y.focus.x-Pt/2:Tt+=Vt/2-y.focus.y-Pt/2;break;case pc:0<an?x?ft+=Gt/2-y.focus.x-Pt/2:Tt+=Vt/2-y.focus.y-Pt/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-Pt/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-Pt/2);break;case jl:x?(ft-=Pt,Gt+=Pt):(Tt-=Pt,Vt+=Pt);break;case Rl:x?(ft+=Gt-y.width+Pt,Gt+=Pt):(Tt+=Vt-y.height+Pt,Vt+=Pt);break;case Vu:case zl:x?1<tt?ft+=Me+yt/2-y.focus.x:ft+=b[0].focus.x-y.focus.x+b[0].la.x:1<tt?Tt+=Me+yt/2-y.focus.y:Tt+=b[0].focus.y-y.focus.y+b[0].la.y;break;case Uu:x?ft+=Gt+yt/2-y.focus.x:Tt+=Vt+yt/2-y.focus.y;break;case su:break;default:a=a.customAlignment(y,ft,Tt,Gt,Vt),ft=a[0],Tt=a[1],Gt=a[2],Vt=a[3]}for(a=0;a<tt;a++)Pt=b[a],x?Pt.S.h(Pt.S.x+Pt.la.x-ft,Pt.S.y+(135<E?(ot?-Vt:-Pt.Da.height)+Pt.la.y-rt:Rt+rt+Pt.la.y)):Pt.S.h(Pt.S.x+(135<E?(ot?-Gt:-Pt.Da.width)+Pt.la.x-rt:ut+rt+Pt.la.x),Pt.S.y+Pt.la.y-Tt);x?(Gt=Ny(y,Gt,ft),0>ft&&(ft=0),135<E&&(Tt+=Vt+rt),Vt=Math.max(Math.max(Vt,Rt),Vt+Rt+rt)):(135<E&&(ft+=Gt+rt),Gt=Math.max(Math.max(Gt,ut),Gt+ut+rt),Vt=by(y,Vt,Tt),0>Tt&&(Tt=0)),y.la.h(ft,Tt),y.Da.h(Gt,Vt)}}si.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 pe(E,0,b,z);if(tt===1)return y=x[0],b=y.Da.width,z=y.Da.height,new pe(E,0,b,z);for(var ot=y.nodeSpacing,rt=y.rowSpacing,at=Ga(y)===90,ut=0,ft=0,mt=0,yt=0;yt<tt;yt++)if(!(yt%2!==0||1<tt&&yt===tt-1)){var Pt=x[yt],kt=Pt.Da,Dt=ut===0?0:rt;if(at){var Tt=a.computeBusNodeSpacing(Pt)-ot;Pt.S.h(E-(kt.width+Tt),mt+Dt),b=Math.max(b,kt.width+Tt),z=Math.max(z,mt+Dt+kt.height),mt+=Dt+kt.height}else Tt=a.computeBusNodeSpacing(Pt)-ot,Pt.S.h(ft+Dt,E-(kt.height+Tt)),z=Math.max(z,kt.height+Tt),b=Math.max(b,ft+Dt+kt.width),ft+=Dt+kt.width;ut++}for(ut=0,Pt=ft,yt=mt,at?(ft=E+ot,mt=0):(ft=0,mt=E+ot),kt=0;kt<tt;kt++)if(kt%2!==0){Dt=x[kt],Tt=Dt.Da;var Rt=ut===0?0:rt;if(at){var Gt=a.computeBusNodeSpacing(Dt)-ot;Dt.S.h(ft+Gt,mt+Rt),b=Math.max(b,ft+Tt.width+Gt),z=Math.max(z,mt+Rt+Tt.height),mt+=Rt+Tt.height}else Gt=a.computeBusNodeSpacing(Dt)-ot,Dt.S.h(ft+Rt,mt+Gt),b=Math.max(b,ft+Rt+Tt.width),z=Math.max(z,mt+Tt.height+Gt),ft+=Rt+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(Pt),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=N0(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(Pt,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=N0(y,x.S.y,!0,E,ot)))),new pe(E,0,b,z)}function dx(a,y,x,E,b,z){var tt=x.length;if(tt===0)return new pe(E,0,b,z);if(tt===1)return x=x[0],b=x.Da.width,z=x.Da.height,new pe(E,0,b,z);for(var ot=y.nodeSpacing,rt=y.rowSpacing,at=Ga(y)===270,ut=0,ft=0,mt=0,yt=0;yt<tt;yt++)if(!(yt%2!==0||1<tt&&yt===tt-1)){var Pt=x[yt],kt=Pt.Da,Dt=ut===0?0:rt;if(at){var Tt=a.computeBusNodeSpacing(Pt)-ot;mt-=Dt+kt.height,Pt.S.h(E-(kt.width+Tt),mt),b=Math.max(b,kt.width+Tt),z=Math.max(z,Math.abs(mt))}else Tt=a.computeBusNodeSpacing(Pt)-ot,ft-=Dt+kt.width,Pt.S.h(ft,E-(kt.height+Tt)),z=Math.max(z,kt.height+Tt),b=Math.max(b,Math.abs(ft));ut++}for(ut=0,Pt=ft,yt=mt,at?(ft=E+ot,mt=0):(ft=0,mt=E+ot),kt=0;kt<tt;kt++)if(kt%2!==0){Dt=x[kt],Tt=Dt.Da;var Rt=ut===0?0:rt;if(at){var Gt=a.computeBusNodeSpacing(Dt)-ot;mt-=Rt+Tt.height,Dt.S.h(ft+Gt,mt),b=Math.max(b,ft+Tt.width+Gt),z=Math.max(z,Math.abs(mt))}else Gt=a.computeBusNodeSpacing(Dt)-ot,ft-=Rt+Tt.width,Dt.S.h(ft,mt+Gt),z=Math.max(z,mt+Tt.height+Gt),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(Pt),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=N0(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(Pt,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=N0(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 pe(E,0,b,z)}si.prototype.computeBusNodeSpacing=function(a){return a.parent===null?0:a.parent.nodeSpacing},si.prototype.computeBusLastRowSpacing=function(a){return a.parent===null?0:a.parent.rowSpacing};function N0(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 Ny(a,y,x){switch(a.alignment){case pc:case Df:return x+a.width>y&&(y=x+a.width),0>x&&(y-=x),y;case jl:return a.width>y?a.width:y;case Rl:return 2*a.focus.x>y?a.width:y+a.width-2*a.focus.x;case Vu:case zl:return Math.max(a.width,Math.max(y,x+a.width)-Math.min(0,x));case Uu:return a.width-a.focus.x+a.nodeSpacing/2+y;case su:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+y);default:return y}}function by(a,y,x){switch(a.alignment){case pc:case Df:return x+a.height>y&&(y=x+a.height),0>x&&(y-=x),y;case jl:return a.height>y?a.height:y;case Rl:return 2*a.focus.y>y?a.height:y+a.height-2*a.focus.y;case Vu:case zl:return Math.max(a.height,Math.max(y,x+a.height)-Math.min(0,x));case Uu:return a.height-a.focus.y+a.nodeSpacing/2+y;case su:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+y);default:return y}}function Ty(a,y,x){switch(a){case Df:y/=2,x/=2;break;case pc:y/=2,x/=2;break;case jl:x=y=0;break;case Rl:break;default:ce("Unhandled alignment value "+a.toString())}return new It(y,x)}function xd(a,y,x,E,b,z){y=Ty(y,x,E),fc(a,y.x,y.y,b,z)}function fc(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 b0(a,y,x,E){var b=y.parent;switch(a.ud){case Il:for(a=y.sourceEdges;a.next();)y=a.value,y.fromVertex===b&&y.relativePoint.h(x,E);break;case gc:for(a=y.destinationEdges;a.next();)y=a.value,y.toVertex===b&&y.relativePoint.h(x,E);break;default:ce("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=Ga(y),at=rt===90||rt===270,ut=y.nodeSpacing;y=E;var ft=b;E=z;var mt=tt,yt=x.Yo,Pt=x.kp;tt=x.Da;var kt=at?Math.max(mt,tt.height):Math.max(E,tt.width);if((yt===null||rt!==Ga(x))&&(yt=Ls(a,2),Pt=Ls(a,2),at?(yt[0].h(0,0),yt[1].h(0,tt.height),Pt[0].h(tt.width,0),Pt[1].h(Pt[0].x,yt[1].y)):(yt[0].h(0,0),yt[1].h(tt.width,0),Pt[0].h(0,tt.height),Pt[1].h(yt[1].x,Pt[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 Dt=yt[b];rt=Dt.x,at=Dt.y,rt+=E;var Tt=z;x+1<ft.length&&(Tt=ft[x+1]);var Rt=Dt;Dt=Rt.x,Rt=Rt.y,b+1<yt.length&&(Rt=yt[b+1],Dt=Rt.x,Rt=Rt.y,Dt+=E);var Gt=mt;z.y===at?Gt=rt-z.x:z.y>at&&z.y<Rt?Gt=rt+(z.y-at)/(Rt-at)*(Dt-rt)-z.x:at>z.y&&at<Tt.y&&(Gt=rt-(z.x+(at-z.y)/(Tt.y-z.y)*(Tt.x-z.x))),Gt<mt&&(mt=Gt),Tt.y<=z.y?x++:Rt<=at?b++:(Tt.y<=Rt&&x++,Rt<=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=Ls(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=Ls(a,E),rt=0;rt<E;rt++)x[rt].assign(ut[rt]);el(a,ut),E=x}if(z=Pt,rt=mt,ft===null||2>ft.length||z===null||2>z.length)b=null;else{for(ut=Ls(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=Ls(a,b),x=0;x<b;x++)z[x].assign(ut[x]);el(a,ut),b=z}return z=Math.max(0,mt)+tt.width,tt=kt,el(a,y),el(a,yt),el(a,ft),el(a,Pt),ot[0]=E,ot[1]=b,new pe(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],Dt=yt[b],rt=Dt.x,at=Dt.y,at+=mt,Tt=z,x+1<ft.length&&(Tt=ft[x+1]),Rt=Dt,Dt=Rt.x,Rt=Rt.y,b+1<yt.length&&(Rt=yt[b+1],Dt=Rt.x,Rt=Rt.y,Rt+=mt),Gt=E,z.x===rt?Gt=at-z.y:z.x>rt&&z.x<Dt?Gt=at+(z.x-rt)/(Dt-rt)*(Rt-at)-z.y:rt>z.x&&rt<Tt.x&&(Gt=at-(z.y+(rt-z.x)/(Tt.x-z.x)*(Tt.y-z.y))),Gt<E&&(E=Gt),Tt.x<=z.x?x++:Dt<=rt?b++:(Tt.x<=Dt&&x++,Dt<=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=Ls(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=Ls(a,E),rt=0;rt<E;rt++)x[rt].assign(ut[rt]);el(a,ut),E=x}if(z=Pt,rt=mt,ft===null||2>ft.length||z===null||2>z.length)b=null;else{for(ut=Ls(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=Ls(a,b),x=0;x<b;x++)z[x].assign(ut[x]);el(a,ut),b=z}return z=kt,tt=Math.max(0,mt)+tt.height,el(a,y),el(a,yt),el(a,ft),el(a,Pt),ot[0]=E,ot[1]=b,new pe(mt,0,z,tt)}function Ls(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 It;return a}function el(a,y){var x=y.length,E=a.ru[x];E===void 0&&(E=[],a.ru[x]=E),E.push(y)}si.prototype.arrangeTrees=function(){if(this.Rb===I0)for(var a=this.Ub.iterator;a.next();){var y=a.value;if(y instanceof ka){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 ka&&a.push(x);switch(this.sorting){case Bf:break;case Sp:a.reverse();break;case xp:a.sort(this.comparer);break;case Pp:a.sort(this.comparer),a.reverse();break;default:ce("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:ce("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)}}}si.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},si.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)},si.prototype.Gu=function(){if(this.layerStyle===j0){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 It(-this.nodeSpacing/2,-this.layerSpacing/2)):(x.Bc(this.layerSpacing,this.nodeSpacing/2),E=new It(-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 pe(0,z,x,ot))):this.angle===90?(b.push(new pe(0,z,x,ot)),z+=ot):this.angle===180?(z-=ot,b.push(new pe(z,0,ot,x))):(b.push(new pe(z,0,ot,x)),z+=ot)}this.commitLayers(b,E)}},si.prototype.commitLayers=function(){},si.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},si.prototype.yv=function(){for(var a=this.Ub.iterator;a.next();){var y=a.value;y instanceof ka&&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])}}si.prototype.setPortSpots=function(a){var y=a.alignment;if(Dh(y)){var x=this.ud===Il,E=Ga(a);switch(E){case 0:var b=zr;break;case 90:b=cs;break;case 180:b=Ts;break;default:b=bs}var z=a.children,tt=z.length;switch(y){case Vu:case zl: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?Ts:bs;if(tt===1||y===tt-1&&tt%2===1)switch(E){case 0:rt=Ts;break;case 90:rt=bs;break;case 180:rt=zr;break;default:rt=cs}else y%2===0&&(rt=E===90||E===270?zr:cs);x?(a.setsPortSpot&&(ot.fromSpot=b),a.setsChildPortSpot&&(ot.toSpot=rt)):(a.setsPortSpot&&(ot.fromSpot=rt),a.setsChildPortSpot&&(ot.toSpot=b))}}break;case Uu:for(E=E===90||E===270?zr:cs,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 su:for(E=E===90||E===270?Ts:bs,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=Ga(a),this.ud===Il){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=zr;break;case 90:E.fromSpot=cs;break;case 180:E.fromSpot=Ts;break;default:E.fromSpot=bs}else E.fromSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.toSpot=Ts;break;case 90:E.toSpot=bs;break;case 180:E.toSpot=zr;break;default:E.toSpot=cs}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=zr;break;case 90:E.toSpot=cs;break;case 180:E.toSpot=Ts;break;default:E.toSpot=bs}else E.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.fromSpot=Ts;break;case 90:E.fromSpot=bs;break;case 180:E.fromSpot=zr;break;default:E.fromSpot=cs}else E.fromSpot=a.childPortSpot}};function Ga(a){return a=a.angle,45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}si.prototype.computeLayerSpacing=function(a){var y=Ga(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},si.prototype.computeNodeIndent=function(a){var y=Ga(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)},ke.Object.defineProperties(si.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!==jy&&a!==Ry&&a!==j0||(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!==Bf&&a!==Sp&&a!==xp&&!Pp||(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()):ce("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!==wp||(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!==Bf&&a!==Sp&&a!==xp&&!Pp||(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!==wp||(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 he(si,"PathDefault",-1),Il=new he(si,"PathDestination",0),gc=new he(si,"PathSource",1),Bf=new he(si,"SortingForwards",10),Sp=new he(si,"SortingReverse",11),xp=new he(si,"SortingAscending",12),Pp=new he(si,"SortingDescending",13),Df=new he(si,"AlignmentCenterSubtrees",20),pc=new he(si,"AlignmentCenterChildren",21),jl=new he(si,"AlignmentStart",22),Rl=new he(si,"AlignmentEnd",23),Vu=new he(si,"AlignmentBus",24),zl=new he(si,"AlignmentBusBranching",25),Uu=new he(si,"AlignmentTopLeftBus",26),su=new he(si,"AlignmentBottomRightBus",27),B0=new he(si,"CompactionNone",30),wp=new he(si,"CompactionBlock",31),D0=new he(si,"StyleLayered",40),By=new he(si,"StyleLastParents",41),Dy=new he(si,"StyleAlternating",42),Oy=new he(si,"StyleRootOnly",43),O0=new he(si,"ArrangementVertical",50),Iy=new he(si,"ArrangementHorizontal",51),I0=new he(si,"ArrangementFixedRoots",52),jy=new he(si,"LayerIndividual",60),Ry=new he(si,"LayerSiblings",61),j0=new he(si,"LayerUniform",62);si.className="TreeLayout",si.PathDefault=A0,si.PathDestination=Il,si.PathSource=gc,si.SortingForwards=Bf,si.SortingReverse=Sp,si.SortingAscending=xp,si.SortingDescending=Pp,si.AlignmentCenterSubtrees=Df,si.AlignmentCenterChildren=pc,si.AlignmentStart=jl,si.AlignmentEnd=Rl,si.AlignmentBus=Vu,si.AlignmentBusBranching=zl,si.AlignmentTopLeftBus=Uu,si.AlignmentBottomRightBus=su,si.CompactionNone=B0,si.CompactionBlock=wp,si.StyleLayered=D0,si.StyleLastParents=By,si.StyleAlternating=Dy,si.StyleRootOnly=Oy,si.ArrangementVertical=O0,si.ArrangementHorizontal=Iy,si.ArrangementFixedRoots=I0,si.LayerIndividual=jy,si.LayerSiblings=Ry,si.LayerUniform=j0;function mc(a){Ji.call(this,a)}ne(mc,Ji),mc.prototype.createVertex=function(){return new ka(this)},mc.prototype.createEdge=function(){return new Of(this)},mc.className="TreeNetwork";function ka(a){Ko.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 It(0,0),this.Da=new Ke(0,0),this.la=new It(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=Bf,this.hd=oy,this.Kb=0,this.Jb=pc,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=wp,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=Lr,this.wr=!0,this.Dp=Lr}ne(ka,Ko),ka.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)},ke.Object.defineProperties(ka.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)}}}),ka.className="TreeVertex";function Of(a){js.call(this,a),this.$t=new It(0,0)}ne(Of,js),Of.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 Il:x=this.fromVertex,E=this.toVertex;break;case gc:x=this.toVertex,E=this.fromVertex;break;default:ce("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=Ga(x),tt=y.computeLayerSpacing(x),ot=x.rowSpacing;a.vg();var rt=a.curve===Qs,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===Rl?(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===jl?(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===Rl?(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===jl?(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===Rl?(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===jl?(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===Rl?(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===jl?(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))):ce("Invalid angle "+z),a.zf()}else b=E,a=this.link,E=this.network.layout,y=Ga(x),y!==Ga(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===Qs,b=a.isOrthogonal,E=Dh(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()))}}},ke.Object.defineProperties(Of.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)}}}),Of.className="TreeEdge",lo.prototype.initializeStandardTools=function(){this.gb("Action",new ya,this.mouseDownTools),this.gb("Relinking",new Ys,this.mouseDownTools),this.gb("LinkReshaping",new To,this.mouseDownTools),this.gb("Rotating",new Qr,this.mouseDownTools),this.gb("Resizing",new br,this.mouseDownTools),this.gb("Linking",new Jr,this.mouseMoveTools),this.gb("Dragging",new fo,this.mouseMoveTools),this.gb("DragSelecting",new ra,this.mouseMoveTools),this.gb("Panning",new Mr,this.mouseMoveTools),this.gb("ContextMenu",new qr,this.mouseUpTools),this.gb("TextEditing",new eo,this.mouseUpTools),this.gb("ClickCreating",new ku,this.mouseUpTools),this.gb("ClickSelecting",new ah,this.mouseUpTools)},pl("Horizontal",new cm),pl("Spot",new gm),pl("Table",new mm),pl("Viewbox",new Sm),pl("TableRow",new vm),pl("TableColumn",new ym),pl("Graduated",new Rg),pl("Grid",new jg),of.add("GraphLinksModel",or),of.add("TreeModel",fa);var R0=ge.go,zy={get licenseKey(){return oe.licenseKey},set licenseKey(a){oe.licenseKey=a},get version(){return oe.version},Group:Vn,EnumValue:he,List:Pe,Set:Fe,Map:ln,Point:It,Size:Ke,Rect:pe,Margin:qn,Spot:En,Geometry:Ve,PathFigure:Qo,PathSegment:Mi,InputEvent:_r,DiagramEvent:mu,ChangedEvent:ho,Model:cn,GraphLinksModel:fi,TreeModel:ss,Binding:Bo,Transaction:ir,UndoManager:co,CommandHandler:Bt,Tool:Pi,DraggingTool:fo,DraggingInfo:tu,DraggingOptions:st,LinkingBaseTool:Lo,LinkingTool:Jr,RelinkingTool:Ys,LinkReshapingTool:To,ResizingTool:br,RotatingTool:Qr,ClickSelectingTool:ah,ActionTool:ya,ClickCreatingTool:ku,HTMLInfo:hl,ContextMenuTool:qr,DragSelectingTool:ra,PanningTool:Mr,TextEditingTool:eo,ToolManager:lo,Animation:Er,AnimationManager:Ds,AnimationTrigger:Ba,Layer:hr,Diagram:oe,Palette:dt,Overview:gt,Brush:Oi,GraphObject:Jt,Panel:De,RowColumnDefinition:Ho,Shape:Kn,TextBlock:Zi,Picture:vs,Part:kn,Adornment:wi,Node:Je,Link:_e,Placeholder:ns,Layout:so,LayoutNetwork:Ji,LayoutVertex:Ko,LayoutEdge:js,GridLayout:yr,PanelLayout:Yo,CircularLayout:po,CircularNetwork:bf,CircularVertex:cp,CircularEdge:y0,ForceDirectedLayout:Nr,ForceDirectedNetwork:cc,ForceDirectedVertex:fp,ForceDirectedEdge:gp,LayeredDigraphLayout:ji,LayeredDigraphNetwork:Af,LayeredDigraphVertex:pa,LayeredDigraphEdge:vp,TreeLayout:si,TreeNetwork:mc,TreeVertex:ka,TreeEdge:Of};typeof R0=="object"&&R0.version&&Be("WARNING: a `go` object on the root object is already defined. "+("Debug"in R0?"debug ":"")+"version: "+R0.version+", replaced with version: "+zy.version),oe.prototype.go=zy,ge.go=zy,typeof tn.exports=="object"&&(tn.exports=typeof Kt.g!="undefined"?Kt.g.go:self.go)}();var St=typeof Kt.g!="undefined"?Kt.g.go:self.go;const de=typeof Kt.g!="undefined"?Kt.g.go:self.go,Ie=de.Group,$e=de.EnumValue,me=de.List,re=de.Set,Zt=de.Map,Oe=de.Point,ue=de.Size,Se=de.Rect,Ue=de.Margin,Ee=de.Spot,Ze=de.Geometry,Ft=de.PathFigure,et=de.PathSegment,nt=de.InputEvent,ct=de.DiagramEvent,lt=de.ChangedEvent,pt=de.Model,vt=de.GraphLinksModel,Ct=de.TreeModel,Nt=de.Binding,zt=de.Transaction,Ht=de.UndoManager,$t=de.CommandHandler,ee=de.Tool,te=de.DraggingTool,Ae=de.DraggingInfo,se=de.LinkingBaseTool,Re=de.LinkingTool,He=de.RelinkingTool,ze=de.LinkReshapingTool,Cn=de.ResizingTool,Rn=de.RotatingTool,Xn=de.ClickSelectingTool,Ni=de.ActionTool,Yt=de.ClickCreatingTool,jt=de.HTMLInfo,Ce=de.ContextMenuTool,un=de.DragSelectingTool,Ln=de.PanningTool,Le=de.TextEditingTool,nn=de.ToolManager,hn=de.Animation,_n=de.AnimationManager,fn=de.AnimationTrigger,le=de.Layer,we=de.Diagram,Pn=de.Palette,vn=de.Overview,_t=de.Brush,Mt=de.GraphObject,Lt=de.Panel,At=de.RowColumnDefinition,Wt=de.Shape,Et=de.TextBlock,be=de.TextBlockMetrics,Nn=de.Picture,mi=de.Part,On=de.Adornment,Gn=de.Node,Fi=de.Link,yn=de.Placeholder,Li=de.Layout,yi=de.LayoutNetwork,Ui=de.LayoutVertex,Jn=de.LayoutEdge,xr=de.GridLayout,Mo=de.PanelLayout,ao=de.CircularLayout,$i=de.CircularNetwork,Kr=de.CircularVertex,No=de.CircularEdge,fr=de.ForceDirectedLayout,sr=de.ForceDirectedNetwork,Pr=de.ForceDirectedVertex,Vi=de.ForceDirectedEdge,Ir=de.LayeredDigraphLayout,Ns=de.LayeredDigraphNetwork,jr=de.LayeredDigraphVertex,Va=de.LayeredDigraphEdge,Hs=de.TreeLayout,Ws=de.TreeNetwork,gr=de.TreeVertex,Ti=de.TreeEdge,We=de.version},15979:function(tn,An,Kt){"use strict";Kt.d(An,{hP:function(){return vn}});var St=function(_t,Mt){return(St=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Lt,At){Lt.__proto__=At}||function(Lt,At){for(var Wt in At)Object.prototype.hasOwnProperty.call(At,Wt)&&(Lt[Wt]=At[Wt])})(_t,Mt)};function de(_t,Mt){function Lt(){this.constructor=_t}St(_t,Mt),_t.prototype=Mt===null?Object.create(Mt):(Lt.prototype=Mt.prototype,new Lt)}function Ie(_t,Mt,Lt,At){return new(Lt||(Lt=Promise))(function(Wt,Et){function be(On){try{mi(At.next(On))}catch(Gn){Et(Gn)}}function Nn(On){try{mi(At.throw(On))}catch(Gn){Et(Gn)}}function mi(On){var Gn;On.done?Wt(On.value):(Gn=On.value,Gn instanceof Lt?Gn:new Lt(function(Fi){Fi(Gn)})).then(be,Nn)}mi((At=At.apply(_t,Mt||[])).next())})}function $e(_t,Mt){var Lt,At,Wt,Et,be={label:0,sent:function(){if(1&Wt[0])throw Wt[1];return Wt[1]},trys:[],ops:[]};return Et={next:Nn(0),throw:Nn(1),return:Nn(2)},typeof Symbol=="function"&&(Et[Symbol.iterator]=function(){return this}),Et;function Nn(mi){return function(On){return function(Gn){if(Lt)throw new TypeError("Generator is already executing.");for(;be;)try{if(Lt=1,At&&(Wt=2&Gn[0]?At.return:Gn[0]?At.throw||((Wt=At.return)&&Wt.call(At),0):At.next)&&!(Wt=Wt.call(At,Gn[1])).done)return Wt;switch(At=0,Wt&&(Gn=[2&Gn[0],Wt.value]),Gn[0]){case 0:case 1:Wt=Gn;break;case 4:return be.label++,{value:Gn[1],done:!1};case 5:be.label++,At=Gn[1],Gn=[0];continue;case 7:Gn=be.ops.pop(),be.trys.pop();continue;default:if(Wt=be.trys,!((Wt=Wt.length>0&&Wt[Wt.length-1])||Gn[0]!==6&&Gn[0]!==2)){be=0;continue}if(Gn[0]===3&&(!Wt||Gn[1]>Wt[0]&&Gn[1]<Wt[3])){be.label=Gn[1];break}if(Gn[0]===6&&be.label<Wt[1]){be.label=Wt[1],Wt=Gn;break}if(Wt&&be.label<Wt[2]){be.label=Wt[2],be.ops.push(Gn);break}Wt[2]&&be.ops.pop(),be.trys.pop();continue}Gn=Mt.call(_t,be)}catch(Fi){Gn=[6,Fi],At=0}finally{Lt=Wt=0}if(5&Gn[0])throw Gn[1];return{value:Gn[0]?Gn[1]:void 0,done:!0}}([mi,On])}}}function me(){for(var _t=0,Mt=0,Lt=arguments.length;Mt<Lt;Mt++)_t+=arguments[Mt].length;var At=Array(_t),Wt=0;for(Mt=0;Mt<Lt;Mt++)for(var Et=arguments[Mt],be=0,Nn=Et.length;be<Nn;be++,Wt++)At[Wt]=Et[be];return At}var re=function(){function _t(){}return _t.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},_t.setAttributes=function(Mt,Lt){for(var At=0,Wt=Lt;At<Wt.length;At++){var Et=Wt[At],be=Et[0],Nn=Et[1];Mt.setAttribute(be,Nn)}},_t.createRect=function(Mt,Lt,At){var Wt=document.createElementNS("http://www.w3.org/2000/svg","rect");return Wt.setAttribute("width",Mt.toString()),Wt.setAttribute("height",Lt.toString()),At&&_t.setAttributes(Wt,At),Wt},_t.createLine=function(Mt,Lt,At,Wt,Et){var be=document.createElementNS("http://www.w3.org/2000/svg","line");return be.setAttribute("x1",Mt.toString()),be.setAttribute("y1",Lt.toString()),be.setAttribute("x2",At.toString()),be.setAttribute("y2",Wt.toString()),Et&&_t.setAttributes(be,Et),be},_t.createPolygon=function(Mt,Lt){var At=document.createElementNS("http://www.w3.org/2000/svg","polygon");return At.setAttribute("points",Mt),Lt&&_t.setAttributes(At,Lt),At},_t.createCircle=function(Mt,Lt){var At=document.createElementNS("http://www.w3.org/2000/svg","circle");return At.setAttribute("cx",(Mt/2).toString()),At.setAttribute("cy",(Mt/2).toString()),At.setAttribute("r",Mt.toString()),Lt&&_t.setAttributes(At,Lt),At},_t.createEllipse=function(Mt,Lt,At){var Wt=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Wt.setAttribute("cx",(Mt/2).toString()),Wt.setAttribute("cy",(Lt/2).toString()),Wt.setAttribute("rx",(Mt/2).toString()),Wt.setAttribute("ry",(Lt/2).toString()),At&&_t.setAttributes(Wt,At),Wt},_t.createGroup=function(Mt){var Lt=document.createElementNS("http://www.w3.org/2000/svg","g");return Mt&&_t.setAttributes(Lt,Mt),Lt},_t.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},_t.createMarker=function(Mt,Lt,At,Wt,Et,be,Nn){var mi=document.createElementNS("http://www.w3.org/2000/svg","marker");return _t.setAttributes(mi,[["id",Mt],["orient",Lt],["markerWidth",At.toString()],["markerHeight",Wt.toString()],["refX",Et.toString()],["refY",be.toString()]]),mi.appendChild(Nn),mi},_t.createText=function(Mt){var Lt=document.createElementNS("http://www.w3.org/2000/svg","text");return Lt.setAttribute("x","0"),Lt.setAttribute("y","0"),Mt&&_t.setAttributes(Lt,Mt),Lt},_t.createTSpan=function(Mt,Lt){var At=document.createElementNS("http://www.w3.org/2000/svg","tspan");return At.textContent=Mt,Lt&&_t.setAttributes(At,Lt),At},_t.createImage=function(Mt){var Lt=document.createElementNS("http://www.w3.org/2000/svg","image");return Mt&&_t.setAttributes(Lt,Mt),Lt},_t.createPoint=function(Mt,Lt){var At=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return At.x=Mt,At.y=Lt,At},_t.createPath=function(Mt,Lt){var At=document.createElementNS("http://www.w3.org/2000/svg","path");return At.setAttribute("d",Mt),Lt&&_t.setAttributes(At,Lt),At},_t}(),Zt=function(){function _t(){}return _t.addKey=function(Mt){_t.key=Mt},Object.defineProperty(_t,"isLicensed",{get:function(){return!!_t.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(_t.key)},enumerable:!1,configurable:!0}),_t}(),Oe=function(){function _t(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return _t.prototype.rasterize=function(Mt,Lt,At){var Wt=this;return new Promise(function(Et){var be=At!==void 0?At:document.createElement("canvas");Mt===null&&(Wt.markersOnly=!0,Wt.naturalSize=!1);var Nn=document.createElementNS("http://www.w3.org/2000/svg","svg");Nn.setAttribute("xmlns","http://www.w3.org/2000/svg"),Nn.setAttribute("width",Lt.width.baseVal.valueAsString),Nn.setAttribute("height",Lt.height.baseVal.valueAsString),Nn.setAttribute("viewBox","0 0 "+Lt.viewBox.baseVal.width.toString()+" "+Lt.viewBox.baseVal.height.toString()),Nn.innerHTML=Lt.innerHTML,Wt.naturalSize===!0?(Nn.width.baseVal.value=Mt.naturalWidth,Nn.height.baseVal.value=Mt.naturalHeight):Wt.width!==void 0&&Wt.height!==void 0&&(Nn.width.baseVal.value=Wt.width,Nn.height.baseVal.value=Wt.height),be.width=Nn.width.baseVal.value,be.height=Nn.height.baseVal.value;var mi=Nn.outerHTML,On=be.getContext("2d");Wt.markersOnly!==!0&&On.drawImage(Mt,0,0,be.width,be.height);var Gn=window.URL,Fi=new Image(be.width,be.height);Fi.setAttribute("crossOrigin","anonymous");var yn=new Blob([mi],{type:"image/svg+xml"}),Li=Gn.createObjectURL(yn);Fi.onload=function(){On.drawImage(Fi,0,0),Gn.revokeObjectURL(Li);var yi=be.toDataURL(Wt.imageType,Wt.imageQuality);Et(yi)},Fi.src=Li})},_t}(),ue=function(){},Se=function(){function _t(Mt){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Mt+"_"}return Object.defineProperty(_t.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),_t.prototype.addClass=function(Mt){return this.styleSheet===void 0&&this.addStyleSheet(),Mt.name=""+this.classNamePrefix+Mt.localName,this.classes.push(Mt),this.styleSheet.sheet.insertRule("."+Mt.name+" {"+Mt.style+"}",this.styleSheet.sheet.cssRules.length),Mt},_t.prototype.addRule=function(Mt){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(Mt),this.styleSheet.sheet.insertRule(Mt.selector+" {"+Mt.style+"}",this.styleSheet.sheet.cssRules.length)},_t.prototype.addStyleSheet=function(){var Mt;this.styleSheet=document.createElement("style"),((Mt=this.styleSheetRoot)!==null&&Mt!==void 0?Mt:document.head).appendChild(this.styleSheet),this.addRule(new Ue("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ue("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ue("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ee("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ee("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},_t.prototype.removeStyleSheet=function(){var Mt;this.styleSheet&&(((Mt=this.styleSheetRoot)!==null&&Mt!==void 0?Mt:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},_t}(),Ue=function(_t,Mt){this.selector=_t,this.style=Mt},Ee=function(_t,Mt){this.localName=_t,this.style=Mt},Ze=function(){function _t(Mt,Lt,At,Wt,Et){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=Mt,this.displayMode=Lt,this.markerItems=At,this.uiStyleSettings=Wt,this.styles=Et,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return _t.prototype.show=function(Mt){var Lt=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Mt,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 be=document.createElement("div");be.className=""+Lt.toolbarButtonStyleClass.name,be.setAttribute("data-type-name",Et.typeName),be.innerHTML=Et.icon,be.addEventListener("click",function(){Lt.markerToolbarButtonClicked(be,Et)}),Lt.buttons.push(be),Lt.markerButtons.push(be)}),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 Wt=document.createElement("div");Wt.className=this.toolbarBlockStyleClass.name,Wt.style.whiteSpace="nowrap",Wt.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Wt),this.addActionButton(Wt,'<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(Wt,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},_t.prototype.addButtonClickListener=function(Mt){this.buttonClickListeners.push(Mt)},_t.prototype.removeButtonClickListener=function(Mt){this.buttonClickListeners.indexOf(Mt)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(Mt),1)},_t.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},_t.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var Mt=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var Lt=0;Lt<this.markerButtons.length;Lt++)Lt<Mt||Lt===Mt&&this.markerButtons.length-1===Mt?this.markerButtonBlock.appendChild(this.markerButtons[Lt]):(Lt===Mt&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[Lt]))}},_t.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},_t.prototype.resetButtonStyles=function(){var Mt=this;this.buttons.forEach(function(Lt){Lt.className=Lt.className.replace(Mt.uiStyleSettings.toolbarButtonStyleColorsClassName?Mt.uiStyleSettings.toolbarButtonStyleColorsClassName:Mt.toolbarButtonStyleColorsClass.name,"").trim(),Lt.className=Lt.className.replace(Mt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?Mt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:Mt.toolbarActiveButtonStyleColorsClass.name,"").trim(),Lt.className+=" "+(Mt.uiStyleSettings.toolbarButtonStyleColorsClassName?Mt.uiStyleSettings.toolbarButtonStyleColorsClassName:Mt.toolbarButtonStyleColorsClass.name)})},_t.prototype.addActionButton=function(Mt,Lt,At){var Wt=this,Et=document.createElement("div");switch(Et.className=""+this.toolbarButtonStyleClass.name,Et.innerHTML=Lt,Et.setAttribute("data-action",At),Et.addEventListener("click",function(){Wt.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}Mt.appendChild(Et),this.buttons.push(Et)},_t.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ee("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 Ee("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ee("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ee("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 Ee("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var Mt=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ee("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*Mt)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*Mt)+`px;
padding: `+Mt+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ee("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ee("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ue("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ue("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},_t.prototype.markerToolbarButtonClicked=function(Mt,Lt){this.setActiveButton(Mt),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(At){return At("marker",Lt)}),this.markerButtonOverflowBlock.style.display="none"},_t.prototype.actionToolbarButtonClicked=function(Mt,Lt){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(At){return At("action",Lt)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},_t.prototype.setActiveButton=function(Mt){this.resetButtonStyles(),Mt.className=Mt.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),Mt.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},_t.prototype.setActiveMarkerButton=function(Mt){var Lt=this.markerButtons.find(function(At){return At.getAttribute("data-type-name")===Mt});Lt&&this.setActiveButton(Lt)},_t.prototype.setCurrentMarker=function(Mt){var Lt=this;this.currentMarker=Mt,this.buttons.filter(function(At){return/delete|notes/.test(At.getAttribute("data-action"))}).forEach(function(At){Lt.currentMarker===void 0?(At.style.fillOpacity="0.4",At.style.pointerEvents="none"):(At.style.fillOpacity="1",At.style.pointerEvents="all")})},_t}(),Ft=function(){function _t(Mt,Lt,At,Wt){this.panels=[],this.panelButtons=[],this.markerjsContainer=Mt,this.displayMode=Lt,this.uiStyleSettings=At,this.styles=Wt,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return _t.prototype.addStyles=function(){var Mt;this.toolboxStyleClass=this.styles.addClass(new Ee("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 Ee("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var Lt=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ee("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ee("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ee("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 Ee("toolbox-panel-row_colors",`
background-color: `+((Mt=this.uiStyleSettings.toolboxBackgroundColor)!==null&&Mt!==void 0?Mt:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ee("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*Lt)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*Lt)+`px;
padding: `+Lt+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ee("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ee("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ue("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ue("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},_t.prototype.show=function(Mt){var Lt;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Mt,this.uiContainer.className=this.toolboxStyleClass.name+" "+((Lt=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&Lt!==void 0?Lt:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},_t.prototype.setPanelButtons=function(Mt){var Lt,At,Wt=this;this.panels=Mt,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((Lt=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&Lt!==void 0?Lt: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 be;Et.uiStyleSettings=Wt.uiStyleSettings;var Nn=document.createElement("div");Nn.className=Wt.toolboxButtonStyleClass.name+" "+((be=Wt.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&be!==void 0?be:Wt.toolboxButtonStyleColorsClass.name),Nn.innerHTML=Et.icon,Nn.title=Et.title,Nn.addEventListener("click",function(){Wt.panelButtonClick(Et)}),Wt.panelButtons.push(Nn),Wt.buttonRow.appendChild(Nn)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},_t.prototype.panelButtonClick=function(Mt){var Lt=this,At=-1;if(Mt!==this.activePanel){At=this.panels.indexOf(Mt),this.panelRow.innerHTML="";var Wt=Mt.getUi();Wt.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Wt),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=Mt}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){Lt.displayMode==="inline"?Lt.panelRow.style.display="none":Lt.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Et,be){var Nn,mi;Et.className=Lt.toolboxButtonStyleClass.name+" "+(be===At?""+((Nn=Lt.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Nn!==void 0?Nn:Lt.toolboxActiveButtonStyleColorsClass.name):""+((mi=Lt.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&mi!==void 0?mi:Lt.toolboxButtonStyleColorsClass.name))})},_t}(),et=function(_t,Mt){this.title=_t,this.icon=Mt},nt=function(_t){function Mt(Lt,At,Wt,Et){var be=_t.call(this,Lt,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 be.colors=[],be.addTransparent=!1,be.colorBoxes=[],be.colors=At,be.currentColor=Wt,be.setCurrentColor=be.setCurrentColor.bind(be),be.getColorBox=be.getColorBox.bind(be),be}return de(Mt,_t),Mt.prototype.getUi=function(){var Lt=this,At=document.createElement("div");return At.style.overflow="hidden",At.style.whiteSpace="nowrap",this.colors.forEach(function(Wt){var Et=Lt.getColorBox(Wt);At.appendChild(Et),Lt.colorBoxes.push(Et)}),At},Mt.prototype.getColorBox=function(Lt){var At=this,Wt=this.uiStyleSettings.toolbarHeight/4,Et=this.uiStyleSettings.toolbarHeight-Wt,be=document.createElement("div");be.style.display="inline-block",be.style.boxSizing="content-box",be.style.width=Et-2+"px",be.style.height=Et-2+"px",be.style.padding="1px",be.style.marginRight="2px",be.style.marginBottom="2px",be.style.borderWidth="2px",be.style.borderStyle="solid",be.style.borderRadius=(Et+2)/2+"px",be.style.borderColor=Lt===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",be.addEventListener("click",function(){At.setCurrentColor(Lt,be)});var Nn=document.createElement("div");return Nn.style.display="inline-block",Nn.style.width=Et-2+"px",Nn.style.height=Et-2+"px",Nn.style.backgroundColor=Lt,Nn.style.borderRadius=Et/2+"px",Lt==="transparent"&&(Nn.style.fill=this.uiStyleSettings.toolboxAccentColor,Nn.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>`),be.appendChild(Nn),be},Mt.prototype.setCurrentColor=function(Lt,At){var Wt=this;this.currentColor=Lt,this.colorBoxes.forEach(function(Et){Et.style.borderColor=Et===At?Wt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(Lt)},Mt}(et),ct=function(){function _t(Mt,Lt,At){this._state="new",this._isSelected=!1,this._container=Mt,this._overlayContainer=Lt,this.globalSettings=At,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(_t.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),_t.prototype.ownsTarget=function(Mt){return!1},Object.defineProperty(_t.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),_t.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},_t.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},_t.prototype.pointerDown=function(Mt,Lt){},_t.prototype.dblClick=function(Mt,Lt){},_t.prototype.manipulate=function(Mt){},_t.prototype.pointerUp=function(Mt){this.stateChanged()},_t.prototype.dispose=function(){},_t.prototype.addMarkerVisualToContainer=function(Mt){this.container.childNodes.length>0?this.container.insertBefore(Mt,this.container.childNodes[0]):this.container.appendChild(Mt)},_t.prototype.getState=function(){return{typeName:_t.typeName,state:this.state,notes:this.notes}},_t.prototype.restoreState=function(Mt){this._state=Mt.state,this.notes=Mt.notes},_t.prototype.scale=function(Mt,Lt){},_t.prototype.colorChanged=function(Mt){this.onColorChanged&&this.onColorChanged(Mt),this.stateChanged()},_t.prototype.fillColorChanged=function(Mt){this.onFillColorChanged&&this.onFillColorChanged(Mt),this.stateChanged()},_t.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var Mt=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),Mt.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(Mt)&&this.onStateChanged(this)}},_t.typeName="MarkerBase",_t}(),lt=function(){function _t(){this.findGripByVisual=this.findGripByVisual.bind(this)}return _t.prototype.findGripByVisual=function(Mt){return this.topLeft.ownsTarget(Mt)?this.topLeft:this.topCenter.ownsTarget(Mt)?this.topCenter:this.topRight.ownsTarget(Mt)?this.topRight:this.centerLeft.ownsTarget(Mt)?this.centerLeft:this.centerRight.ownsTarget(Mt)?this.centerRight:this.bottomLeft.ownsTarget(Mt)?this.bottomLeft:this.bottomCenter.ownsTarget(Mt)?this.bottomCenter:this.bottomRight.ownsTarget(Mt)?this.bottomRight:void 0},_t}(),pt=function(){function _t(){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 _t.prototype.ownsTarget=function(Mt){return Mt===this.visual||Mt===this.visual.childNodes[0]||Mt===this.visual.childNodes[1]},_t}(),vt=function(){function _t(){}return _t.toITransformMatrix=function(Mt){return{a:Mt.a,b:Mt.b,c:Mt.c,d:Mt.d,e:Mt.e,f:Mt.f}},_t.toSVGMatrix=function(Mt,Lt){return Mt.a=Lt.a,Mt.b=Lt.b,Mt.c=Lt.c,Mt.d=Lt.d,Mt.e=Lt.e,Mt.f=Lt.f,Mt},_t}(),Ct=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||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 de(Mt,_t),Object.defineProperty(Mt.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(Mt.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(Mt.prototype,"visual",{get:function(){return this._visual},set:function(Lt){this._visual=Lt;var At=re.createTransform();this._visual.transform.baseVal.appendItem(At)},enumerable:!1,configurable:!0}),Mt.prototype.ownsTarget=function(Lt){return!!_t.prototype.ownsTarget.call(this,Lt)||!!(this.controlGrips.findGripByVisual(Lt)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Lt))},Mt.prototype.pointerDown=function(Lt,At){_t.prototype.pointerDown.call(this,Lt,At),this.state==="new"&&(this.left=Lt.x,this.top=Lt.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Wt=this.unrotatePoint(Lt);if(this.manipulationStartX=Wt.x,this.manipulationStartY=Wt.y,this.offsetX=Wt.x-this.left,this.offsetY=Wt.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 be=this.container.transform.baseVal.getItem(0);be.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(be,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},Mt.prototype.pointerUp=function(Lt){var At=this.state;_t.prototype.pointerUp.call(this,Lt),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(Lt),this._state="select",At==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},Mt.prototype.moveVisual=function(Lt){this.visual.style.transform="translate("+Lt.x+"px, "+Lt.y+"px)"},Mt.prototype.manipulate=function(Lt){var At=this.unrotatePoint(Lt);this.state==="creating"?this.resize(Lt):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(Lt)},Mt.prototype.resize=function(Lt){var At=this.manipulationStartLeft,Wt=this.manipulationStartWidth,Et=this.manipulationStartTop,be=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:At=this.manipulationStartLeft+Lt.x-this.manipulationStartX,Wt=this.manipulationStartWidth+this.manipulationStartLeft-At;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Wt=this.manipulationStartWidth+Lt.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Et=this.manipulationStartTop+Lt.y-this.manipulationStartY,be=this.manipulationStartHeight+this.manipulationStartTop-Et;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:be=this.manipulationStartHeight+Lt.y-this.manipulationStartY}Wt>=0?(this.left=At,this.width=Wt):(this.left=At+Wt,this.width=-Wt),be>=0?(this.top=Et,this.height=be):(this.top=Et+be,this.height=-be),this.setSize()},Mt.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},Mt.prototype.rotate=function(Lt){if(Math.abs(Lt.x-this.centerX)>.1){var At=Math.sign(Lt.x-this.centerX);this.rotationAngle=180*Math.atan((Lt.y-this.centerY)/(Lt.x-this.centerX))/Math.PI+90*At,this.applyRotation()}},Mt.prototype.applyRotation=function(){var Lt=this.container.transform.baseVal.getItem(0);Lt.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Lt,0)},Mt.prototype.rotatePoint=function(Lt){if(this.rotationAngle===0)return Lt;var At=this.container.getCTM(),Wt=re.createPoint(Lt.x,Lt.y);return{x:(Wt=Wt.matrixTransform(At)).x,y:Wt.y}},Mt.prototype.unrotatePoint=function(Lt){if(this.rotationAngle===0)return Lt;var At=this.container.getCTM();At=At.inverse();var Wt=re.createPoint(Lt.x,Lt.y);return{x:(Wt=Wt.matrixTransform(At)).x,y:Wt.y}},Mt.prototype.select=function(){_t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Mt.prototype.deselect=function(){_t.prototype.deselect.call(this),this.controlBox.style.display="none"},Mt.prototype.setupControlBox=function(){this.controlBox=re.createGroup();var Lt=re.createTransform();Lt.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(Lt),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"},Mt.prototype.adjustControlBox=function(){var Lt=this.controlBox.transform.baseVal.getItem(0);Lt.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(Lt,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()},Mt.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()},Mt.prototype.createGrip=function(){var Lt=new pt;return Lt.visual.transform.baseVal.appendItem(re.createTransform()),this.controlBox.appendChild(Lt.visual),Lt},Mt.prototype.positionGrips=function(){var Lt=this.controlGrips.topLeft.GRIP_SIZE,At=-Lt/2,Wt=At,Et=(this.width+this.CB_DISTANCE)/2-Lt/2,be=(this.height+this.CB_DISTANCE)/2-Lt/2,Nn=this.height+this.CB_DISTANCE-Lt/2,mi=this.width+this.CB_DISTANCE-Lt/2;this.positionGrip(this.controlGrips.topLeft.visual,At,Wt),this.positionGrip(this.controlGrips.topCenter.visual,Et,Wt),this.positionGrip(this.controlGrips.topRight.visual,mi,Wt),this.positionGrip(this.controlGrips.centerLeft.visual,At,be),this.positionGrip(this.controlGrips.centerRight.visual,mi,be),this.positionGrip(this.controlGrips.bottomLeft.visual,At,Nn),this.positionGrip(this.controlGrips.bottomCenter.visual,Et,Nn),this.positionGrip(this.controlGrips.bottomRight.visual,mi,Nn),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Et,Wt-3*this.CB_DISTANCE)},Mt.prototype.positionGrip=function(Lt,At,Wt){var Et=Lt.transform.baseVal.getItem(0);Et.setTranslate(At,Wt),Lt.transform.baseVal.replaceItem(Et,0)},Mt.prototype.hideControlBox=function(){this.controlBox.style.display="none"},Mt.prototype.showControlBox=function(){this.controlBox.style.display=""},Mt.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:vt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:vt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},_t.prototype.getState.call(this))},Mt.prototype.restoreState=function(Lt){_t.prototype.restoreState.call(this,Lt);var At=Lt;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))},Mt.prototype.scale=function(Lt,At){_t.prototype.scale.call(this,Lt,At);var Wt=this.rotatePoint({x:this.left,y:this.top}),Et=this.unrotatePoint({x:Wt.x*Lt,y:Wt.y*At});this.left=Et.x,this.top=Et.y,this.width=this.width*Lt,this.height=this.height*At,this.adjustControlBox()},Mt}(ct),Nt=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||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 de(Mt,_t),Mt.prototype.ownsTarget=function(Lt){return!(!_t.prototype.ownsTarget.call(this,Lt)&&Lt!==this.visual)},Mt.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)},Mt.prototype.pointerDown=function(Lt,At){_t.prototype.pointerDown.call(this,Lt,At),this.state==="new"&&(this.createVisual(),this.moveVisual(Lt),this._state="creating")},Mt.prototype.manipulate=function(Lt){_t.prototype.manipulate.call(this,Lt)},Mt.prototype.resize=function(Lt){_t.prototype.resize.call(this,Lt),this.setSize()},Mt.prototype.setSize=function(){_t.prototype.setSize.call(this),re.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},Mt.prototype.pointerUp=function(Lt){_t.prototype.pointerUp.call(this,Lt),this.setSize()},Mt.prototype.setStrokeColor=function(Lt){this.strokeColor=Lt,this.visual&&re.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Lt),this.stateChanged()},Mt.prototype.setFillColor=function(Lt){this.fillColor=Lt,this.visual&&re.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},Mt.prototype.setStrokeWidth=function(Lt){this.strokeWidth=Lt,this.visual&&re.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Mt.prototype.setStrokeDasharray=function(Lt){this.strokeDasharray=Lt,this.visual&&re.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Mt.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},_t.prototype.getState.call(this))},Mt.prototype.restoreState=function(Lt){var At=Lt;this.fillColor=At.fillColor,this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.opacity=At.opacity,this.createVisual(),_t.prototype.restoreState.call(this,Lt),this.setSize()},Mt.prototype.scale=function(Lt,At){_t.prototype.scale.call(this,Lt,At),this.setSize()},Mt.title="Rectangle marker",Mt}(Ct),zt=function(_t){function Mt(Lt,At,Wt,Et){var be=_t.call(this,Lt,Et||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return be.widths=[],be.widthBoxes=[],be.widths=At,be.currentWidth=Wt,be.setCurrentWidth=be.setCurrentWidth.bind(be),be}return de(Mt,_t),Mt.prototype.getUi=function(){var Lt=this,At=document.createElement("div");return At.style.display="flex",At.style.overflow="hidden",At.style.flexGrow="2",this.widths.forEach(function(Wt){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=Wt===Lt.currentWidth?Lt.uiStyleSettings.toolboxAccentColor:"transparent",Et.addEventListener("click",function(){Lt.setCurrentWidth(Wt,Et)}),At.appendChild(Et);var be=document.createElement("div");be.innerText=Wt.toString(),be.style.marginRight="5px",Et.appendChild(be);var Nn=document.createElement("div");Nn.style.minHeight="20px",Nn.style.flexGrow="2",Nn.style.display="flex",Nn.style.alignItems="center";var mi=document.createElement("hr");mi.style.minWidth="20px",mi.style.border="0px",mi.style.borderTop=Wt+"px solid "+Lt.uiStyleSettings.toolboxColor,mi.style.flexGrow="2",Nn.appendChild(mi),Et.appendChild(Nn),Lt.widthBoxes.push(Et)}),At},Mt.prototype.setCurrentWidth=function(Lt,At){var Wt=this;this.currentWidth=Lt,this.widthBoxes.forEach(function(Et){Et.style.borderColor=Et===At?Wt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},Mt}(et),Ht=function(_t){function Mt(Lt,At,Wt,Et){var be=_t.call(this,Lt,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 be.styles=[],be.styleBoxes=[],be.styles=At,be.currentStyle=Wt,be.setCurrentStyle=be.setCurrentStyle.bind(be),be}return de(Mt,_t),Mt.prototype.getUi=function(){var Lt=this,At=document.createElement("div");return At.style.display="flex",At.style.overflow="hidden",At.style.flexGrow="2",this.styles.forEach(function(Wt){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/Lt.styles.length-5+"%",Et.style.borderColor=Wt===Lt.currentStyle?Lt.uiStyleSettings.toolboxAccentColor:"transparent",Et.addEventListener("click",function(){Lt.setCurrentStyle(Wt,Et)}),At.appendChild(Et);var be=document.createElement("div");be.style.minHeight="20px",be.style.flexGrow="2",be.style.overflow="hidden";var Nn=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+Lt.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(Wt!==""?'stroke-dasharray="'+Wt+'"':"")+` />
</svg>`;be.innerHTML=Nn,Et.appendChild(be),Lt.styleBoxes.push(Et)}),At},Mt.prototype.setCurrentStyle=function(Lt,At){var Wt=this;this.currentStyle=Lt,this.styleBoxes.forEach(function(Et){Et.style.borderColor=Et===At?Wt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},Mt}(et),$t=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||this;return Et.strokeColor=Wt.defaultColor,Et.strokeWidth=Wt.defaultStrokeWidth,Et.strokeDasharray=Wt.defaultStrokeDasharray,Et.strokePanel=new nt("Line color",Wt.defaultColorSet,Wt.defaultColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.strokeWidthPanel=new zt("Line width",Wt.defaultStrokeWidths,Wt.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new Ht("Line style",Wt.defaultStrokeDasharrays,Wt.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et}return de(Mt,_t),Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var Lt=_t.prototype.getState.call(this);return Lt.typeName=Mt.typeName,Lt},Mt.typeName="FrameMarker",Mt.title="Frame marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',Mt}(Nt),ee=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(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||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 de(Mt,_t),Mt.prototype.ownsTarget=function(Lt){return!!_t.prototype.ownsTarget.call(this,Lt)||!(!this.grip1.ownsTarget(Lt)&&!this.grip2.ownsTarget(Lt))},Mt.prototype.pointerDown=function(Lt,At){_t.prototype.pointerDown.call(this,Lt,At),this.manipulationStartX=Lt.x,this.manipulationStartY=Lt.y,this.state==="new"&&(this.x1=Lt.x,this.y1=Lt.y,this.x2=Lt.x,this.y2=Lt.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")},Mt.prototype.pointerUp=function(Lt){var At=this.state;_t.prototype.pointerUp.call(this,Lt),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(Lt),this._state="select",At==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},Mt.prototype.adjustVisual=function(){},Mt.prototype.manipulate=function(Lt){this.state==="creating"?this.resize(Lt):this.state==="move"?(this.x1=this.manipulationStartX1+Lt.x-this.manipulationStartX,this.y1=this.manipulationStartY1+Lt.y-this.manipulationStartY,this.x2=this.manipulationStartX2+Lt.x-this.manipulationStartX,this.y2=this.manipulationStartY2+Lt.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(Lt)},Mt.prototype.resize=function(Lt){switch(this.activeGrip){case this.grip1:this.x1=Lt.x,this.y1=Lt.y;break;case this.grip2:case void 0:this.x2=Lt.x,this.y2=Lt.y}this.adjustVisual(),this.adjustControlBox()},Mt.prototype.select=function(){_t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Mt.prototype.deselect=function(){_t.prototype.deselect.call(this),this.controlBox.style.display="none"},Mt.prototype.setupControlBox=function(){this.controlBox=re.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},Mt.prototype.adjustControlBox=function(){this.positionGrips()},Mt.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},Mt.prototype.createGrip=function(){var Lt=new pt;return Lt.visual.transform.baseVal.appendItem(re.createTransform()),this.controlBox.appendChild(Lt.visual),Lt},Mt.prototype.positionGrips=function(){var Lt=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-Lt/2,this.y1-Lt/2),this.positionGrip(this.grip2.visual,this.x2-Lt/2,this.y2-Lt/2)},Mt.prototype.positionGrip=function(Lt,At,Wt){var Et=Lt.transform.baseVal.getItem(0);Et.setTranslate(At,Wt),Lt.transform.baseVal.replaceItem(Et,0)},Mt.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},_t.prototype.getState.call(this))},Mt.prototype.restoreState=function(Lt){_t.prototype.restoreState.call(this,Lt);var At=Lt;this.x1=At.x1,this.y1=At.y1,this.x2=At.x2,this.y2=At.y2},Mt.prototype.scale=function(Lt,At){_t.prototype.scale.call(this,Lt,At),this.x1=this.x1*Lt,this.y1=this.y1*At,this.x2=this.x2*Lt,this.y2=this.y2*At,this.adjustVisual(),this.adjustControlBox()},Mt}(ct),Ae=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||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=Wt.defaultColor,Et.strokeWidth=Wt.defaultStrokeWidth,Et.strokeDasharray=Wt.defaultStrokeDasharray,Et.strokePanel=new nt("Line color",Wt.defaultColorSet,Wt.defaultColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.strokeWidthPanel=new zt("Line width",Wt.defaultStrokeWidths,Wt.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new Ht("Line style",Wt.defaultStrokeDasharrays,Wt.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et}return de(Mt,_t),Mt.prototype.ownsTarget=function(Lt){return!(!_t.prototype.ownsTarget.call(this,Lt)&&Lt!==this.visual&&Lt!==this.selectorLine&&Lt!==this.visibleLine)},Mt.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)},Mt.prototype.pointerDown=function(Lt,At){_t.prototype.pointerDown.call(this,Lt,At),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},Mt.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()]]))},Mt.prototype.setStrokeColor=function(Lt){this.strokeColor=Lt,this.adjustVisual(),this.colorChanged(Lt)},Mt.prototype.setStrokeWidth=function(Lt){this.strokeWidth=Lt,this.adjustVisual()},Mt.prototype.setStrokeDasharray=function(Lt){this.strokeDasharray=Lt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var Lt=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},_t.prototype.getState.call(this));return Lt.typeName=Mt.typeName,Lt},Mt.prototype.restoreState=function(Lt){_t.prototype.restoreState.call(this,Lt);var At=Lt;this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.createVisual(),this.adjustVisual()},Mt.typeName="LineMarker",Mt.title="Line marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',Mt}(te),se=function(_t){function Mt(Lt,At,Wt,Et){var be=_t.call(this,Lt,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 be.fonts=[],be.fontBoxes=[],be.fonts=At,be.currentFont=Wt,be.setCurrentFont=be.setCurrentFont.bind(be),be}return de(Mt,_t),Mt.prototype.getUi=function(){var Lt=this,At=document.createElement("div");return At.style.overflow="hidden",At.style.flexGrow="2",this.fonts.forEach(function(Wt){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/Lt.fonts.length-5+"%",Et.style.borderColor=Wt===Lt.currentFont?Lt.uiStyleSettings.toolboxAccentColor:"transparent",Et.addEventListener("click",function(){Lt.setCurrentFont(Wt,Et)}),At.appendChild(Et);var be=document.createElement("div");be.style.display="flex",be.style.minHeight="20px",be.style.flexGrow="2",be.style.fontFamily=Wt,be.style.overflow="hidden";var Nn=document.createElement("div");Nn.style.whiteSpace="nowrap",Nn.style.overflow="hidden",Nn.style.textOverflow="ellipsis",Nn.innerHTML="The quick brown fox jumps over the lazy dog",be.appendChild(Nn),Et.appendChild(be),Lt.fontBoxes.push(Et)}),At},Mt.prototype.setCurrentFont=function(Lt,At){var Wt=this;this.currentFont=Lt,this.fontBoxes.forEach(function(Et){Et.style.borderColor=Et===At?Wt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},Mt}(et),Re=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||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=Wt.defaultColor,Et.fontFamily=Wt.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",Wt.defaultColorSet,Wt.defaultColor),Et.colorPanel.onColorChanged=Et.setColor,Et.fontFamilyPanel=new se("Font",Wt.defaultFontFamilies,Wt.defaultFontFamily),Et.fontFamilyPanel.onFontChanged=Et.setFont,Et}return de(Mt,_t),Mt.prototype.ownsTarget=function(Lt){if(_t.prototype.ownsTarget.call(this,Lt)||Lt===this.visual||Lt===this.textElement||Lt===this.bgRectangle)return!0;var At=!1;return this.textElement.childNodes.forEach(function(Wt){Wt===Lt&&(At=!0)}),At},Mt.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()},Mt.prototype.pointerDown=function(Lt,At){_t.prototype.pointerDown.call(this,Lt,At),this.isMoved=!1,this.pointerDownPoint=Lt,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Lt),this._state="creating")},Mt.prototype.renderText=function(){var Lt=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){Lt.textElement.appendChild(re.createTSpan(At.trim()===""?" ":At.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},Mt.prototype.getTextScale=function(){var Lt=this.textElement.getBBox(),At=1;if(Lt.width>0&&Lt.height>0){var Wt=(1*this.width-this.width*this.padding*2/100)/Lt.width,Et=(1*this.height-this.height*this.padding*2/100)/Lt.height;At=Math.min(Wt,Et)}return At},Mt.prototype.getTextPosition=function(Lt){var At=this.textElement.getBBox(),Wt=0,Et=0;return At.width>0&&At.height>0&&(Wt=(this.width-At.width*Lt)/2,Et=this.height/2-At.height*Lt/2),{x:Wt,y:Et}},Mt.prototype.sizeText=function(){var Lt=this.textElement.getBBox(),At=this.getTextScale(),Wt=this.getTextPosition(At);Wt.y-=Lt.y*At,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Wt.x+"px, "+Wt.y+"px) scale("+At+", "+At+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Wt.x,Wt.y),this.textElement.transform.baseVal.getItem(1).setScale(At,At))},Mt.prototype.manipulate=function(Lt){_t.prototype.manipulate.call(this,Lt),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Lt.x-this.pointerDownPoint.x)>5||Math.abs(Lt.y-this.pointerDownPoint.y)>5)},Mt.prototype.resize=function(Lt){_t.prototype.resize.call(this,Lt),this.isMoved=!0,this.setSize(),this.sizeText()},Mt.prototype.setSize=function(){_t.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()]]))},Mt.prototype.pointerUp=function(Lt){var At=this.state;At==="creating"&&(this._suppressMarkerCreateEvent=!0),_t.prototype.pointerUp.call(this,Lt),this.setSize(),(At==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},Mt.prototype.showTextEditor=function(){var Lt=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(Lt.textEditor.style.fontSize);Lt.textEditor.clientWidth>=Number.parseInt(Lt.textEditor.style.maxWidth)&&At>.9;)At-=.1,Lt.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 Wt=At.clipboardData.getData("text"),Et=window.getSelection();if(!Et.rangeCount)return!1;Et.deleteFromDocument(),Et.getRangeAt(0).insertNode(document.createTextNode(Wt)),At.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){Lt.textEditDivClicked(Lt.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},Mt.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var Lt=this.getTextScale(),At=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Wt=this.textElement.getBBox(),Et={x:Wt.width*Lt,y:Wt.height*Lt};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*Lt,12)+"px",this.textElement.style.display="none"}},Mt.prototype.textEditDivClicked=function(Lt){this.text=Lt.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},Mt.prototype.select=function(){_t.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},Mt.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),_t.prototype.deselect.call(this)},Mt.prototype.dblClick=function(Lt,At){_t.prototype.dblClick.call(this,Lt,At),this.showTextEditor()},Mt.prototype.setColor=function(Lt){this.textElement&&re.setAttributes(this.textElement,[["fill",Lt]]),this.color=Lt,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(Lt)},Mt.prototype.setFont=function(Lt){this.textElement&&re.setAttributes(this.textElement,[["font-family",Lt]]),this.fontFamily=Lt,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},Mt.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},Mt.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var Lt=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},_t.prototype.getState.call(this));return Lt.typeName=Mt.typeName,Lt},Mt.prototype.restoreState=function(Lt){var At=Lt;this.color=At.color,this.fontFamily=At.fontFamily,this.padding=At.padding,this.text=At.text,this.createVisual(),_t.prototype.restoreState.call(this,Lt),this.setSize()},Mt.prototype.scale=function(Lt,At){_t.prototype.scale.call(this,Lt,At),this.setSize(),this.sizeText(),this.positionTextEditor()},Mt.typeName="TextMarker",Mt.title="Text marker",Mt.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>',Mt}(Ct),He=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||this;return Et.color="transparent",Et.lineWidth=3,Et.drawing=!1,Et.pixelRatio=1,Et.color=Wt.defaultColor,Et.lineWidth=Wt.defaultStrokeWidth,Et.pixelRatio=Wt.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",Wt.defaultColorSet,Wt.defaultColor),Et.colorPanel.onColorChanged=Et.setColor,Et.lineWidthPanel=new zt("Line width",Wt.defaultStrokeWidths,Wt.defaultStrokeWidth),Et.lineWidthPanel.onWidthChanged=Et.setLineWidth,Et}return de(Mt,_t),Mt.prototype.ownsTarget=function(Lt){return!(!_t.prototype.ownsTarget.call(this,Lt)&&Lt!==this.visual&&Lt!==this.drawingImage)},Mt.prototype.createVisual=function(){this.visual=re.createGroup(),this.drawingImage=re.createImage(),this.visual.appendChild(this.drawingImage);var Lt=re.createTransform();this.visual.transform.baseVal.appendItem(Lt),this.addMarkerVisualToContainer(this.visual)},Mt.prototype.pointerDown=function(Lt,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(Lt.x,Lt.y),this.drawing=!0):_t.prototype.pointerDown.call(this,Lt,At)},Mt.prototype.manipulate=function(Lt){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(Lt.x,Lt.y),this.canvasContext.stroke()):_t.prototype.manipulate.call(this,Lt)},Mt.prototype.resize=function(Lt){_t.prototype.resize.call(this,Lt),re.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),re.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},Mt.prototype.pointerUp=function(Lt){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):_t.prototype.pointerUp.call(this,Lt)},Mt.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)},Mt.prototype.select=function(){this.state==="creating"&&this.finishCreation(),_t.prototype.select.call(this)},Mt.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),_t.prototype.deselect.call(this)},Mt.prototype.finishCreation=function(){for(var Lt=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),At=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Wt=At[0],Et=At[1],be=At[2],Nn=At[3],mi=!1,On=0;On<this.canvasElement.height;On++)for(var Gn=0;Gn<this.canvasElement.width;Gn++)Lt.data[On*this.canvasElement.width*4+4*Gn+3]>0&&(mi=!0,On<Et&&(Et=On),Gn<Wt&&(Wt=Gn),On>Nn&&(Nn=On),Gn>be&&(be=Gn));if(mi){this.left=Wt/this.pixelRatio,this.top=Et/this.pixelRatio,this.width=(be-Wt)/this.pixelRatio,this.height=(Nn-Et)/this.pixelRatio;var Fi=document.createElement("canvas");Fi.width=be-Wt,Fi.height=Nn-Et,Fi.getContext("2d").putImageData(this.canvasContext.getImageData(Wt,Et,be-Wt,Nn-Et),0,0),this.drawingImgUrl=Fi.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},Mt.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})},Mt.prototype.setColor=function(Lt){this.color=Lt,this.colorChanged(Lt)},Mt.prototype.setLineWidth=function(Lt){this.lineWidth=Lt},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var Lt=Object.assign({drawingImgUrl:this.drawingImgUrl},_t.prototype.getState.call(this));return Lt.typeName=Mt.typeName,Lt},Mt.prototype.restoreState=function(Lt){this.createVisual(),_t.prototype.restoreState.call(this,Lt),this.drawingImgUrl=Lt.drawingImgUrl,this.setDrawingImage()},Mt.prototype.scale=function(Lt,At){_t.prototype.scale.call(this,Lt,At),this.setDrawingImage()},Mt.typeName="FreehandMarker",Mt.title="Freehand marker",Mt.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>',Mt}(Ct),ze=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,Wt||'<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 de(Mt,_t),Mt.prototype.getUi=function(){var Lt=this,At=document.createElement("div");At.style.display="flex",At.style.overflow="hidden",At.style.flexGrow="2";for(var Wt=function(Nn){var mi="both";switch(Nn){case 0:mi="both";break;case 1:mi="start";break;case 2:mi="end";break;case 3:mi="none"}var On=document.createElement("div");if(On.style.display="flex",On.style.flexGrow="2",On.style.alignItems="center",On.style.justifyContent="space-between",On.style.padding="5px",On.style.borderWidth="2px",On.style.borderStyle="solid",On.style.borderColor=mi===Et.currentType?Et.uiStyleSettings.toolboxAccentColor:"transparent",On.addEventListener("click",function(){Lt.setCurrentType(mi,On)}),At.appendChild(On),mi==="both"||mi==="start"){var Gn=document.createElement("div");Gn.style.display="flex",Gn.style.alignItems="center",Gn.style.minHeight="20px",Gn.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>`,Gn.style.marginLeft="5px",On.appendChild(Gn)}var Fi=document.createElement("div");Fi.style.display="flex",Fi.style.alignItems="center",Fi.style.minHeight="20px",Fi.style.flexGrow="2";var yn=document.createElement("hr");if(yn.style.minWidth="20px",yn.style.border="0px",yn.style.borderTop="3px solid "+(Et.uiStyleSettings!==void 0?Et.uiStyleSettings.toolboxColor:"#eeeeee"),yn.style.flexGrow="2",Fi.appendChild(yn),On.appendChild(Fi),mi==="both"||mi==="end"){var Li=document.createElement("div");Li.style.display="flex",Li.style.alignItems="center",Li.style.minHeight="20px",Li.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>`,Li.style.marginRight="5px",On.appendChild(Li)}Et.typeBoxes.push(On)},Et=this,be=0;be<4;be++)Wt(be);return At},Mt.prototype.setCurrentType=function(Lt,At){var Wt=this;this.currentType=Lt,this.typeBoxes.forEach(function(Et){Et.style.borderColor=Et===At?Wt.uiStyleSettings!==void 0?Wt.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},Mt}(et),Cn=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||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 ze("Arrow type","end"),Et.arrowTypePanel.onArrowTypeChanged=Et.setArrowType,Et}return de(Mt,_t),Mt.prototype.ownsTarget=function(Lt){return!(!_t.prototype.ownsTarget.call(this,Lt)&&Lt!==this.arrow1&&Lt!==this.arrow2)},Mt.prototype.getArrowPoints=function(Lt,At){var Wt=this.arrowBaseWidth+2*this.strokeWidth,Et=this.arrowBaseHeight+2*this.strokeWidth;return Lt-Wt/2+","+(At+Et/2)+" "+Lt+","+(At-Et/2)+" "+(Lt+Wt/2)+","+(At+Et/2)},Mt.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)},Mt.prototype.pointerDown=function(Lt,At){_t.prototype.pointerDown.call(this,Lt,At),this.state==="creating"&&this.createTips()},Mt.prototype.adjustVisual=function(){if(_t.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",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 Lt=0;Math.abs(this.x1-this.x2)>.1&&(Lt=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(Lt,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(At,0);var Wt=this.arrow2.transform.baseVal.getItem(0);Wt.setRotate(Lt+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Wt,0)}},Mt.prototype.setArrowType=function(Lt){this.arrowType=Lt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var Lt=Object.assign({arrowType:this.arrowType},_t.prototype.getState.call(this));return Lt.typeName=Mt.typeName,Lt},Mt.prototype.restoreState=function(Lt){_t.prototype.restoreState.call(this,Lt);var At=Lt;this.arrowType=At.arrowType,this.createTips(),this.adjustVisual()},Mt.typeName="ArrowMarker",Mt.title="Arrow marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',Mt}(Ae),Rn=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||this;return Et.fillColor=Wt.defaultFillColor,Et.strokeWidth=0,Et.fillPanel=new nt("Color",Wt.defaultColorSet,Wt.defaultFillColor),Et.fillPanel.onColorChanged=Et.setFillColor,Et}return de(Mt,_t),Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var Lt=_t.prototype.getState.call(this);return Lt.typeName=Mt.typeName,Lt},Mt.typeName="CoverMarker",Mt.title="Cover marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',Mt}(Nt),Xn=function(_t){function Mt(Lt,At,Wt,Et){var be=_t.call(this,Lt,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 be.opacities=[],be.opacityBoxes=[],be.opacities=At,be.currentOpacity=Wt,be.setCurrentOpacity=be.setCurrentOpacity.bind(be),be}return de(Mt,_t),Mt.prototype.getUi=function(){var Lt=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(Wt){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=Wt===Lt.currentOpacity?Lt.uiStyleSettings.toolboxAccentColor:"transparent",Et.addEventListener("click",function(){Lt.setCurrentOpacity(Wt,Et)}),At.appendChild(Et);var be=document.createElement("div");be.innerText=100*Wt+"%",Et.appendChild(be),Lt.opacityBoxes.push(Et)}),At},Mt.prototype.setCurrentOpacity=function(Lt,At){var Wt=this;this.currentOpacity=Lt,this.opacityBoxes.forEach(function(Et){Et.style.borderColor=Et===At?Wt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},Mt}(et),Ni=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||this;return Et.setOpacity=Et.setOpacity.bind(Et),Et.fillColor=Wt.defaultHighlightColor,Et.strokeWidth=0,Et.opacity=Wt.defaultHighlightOpacity,Et.fillPanel=new nt("Color",Wt.defaultColorSet,Et.fillColor),Et.fillPanel.onColorChanged=Et.setFillColor,Et.opacityPanel=new Xn("Opacity",Wt.defaultOpacitySteps,Et.opacity),Et.opacityPanel.onOpacityChanged=Et.setOpacity,Et}return de(Mt,_t),Mt.prototype.setOpacity=function(Lt){this.opacity=Lt,this.visual&&re.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var Lt=_t.prototype.getState.call(this);return Lt.typeName=Mt.typeName,Lt},Mt.typeName="HighlightMarker",Mt.title="Highlight marker",Mt.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>',Mt}(Rn),Yt='<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>',jt='<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>',Ce=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||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=Wt.defaultStrokeColor,Et.bgColor=Wt.defaultFillColor,Et.fontFamily=Wt.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",Wt.defaultColorSet,Et.color,Yt),Et.colorPanel.onColorChanged=Et.setColor,Et.bgColorPanel=new nt("Fill color",Wt.defaultColorSet,Et.bgColor,jt),Et.bgColorPanel.onColorChanged=Et.setBgColor,Et.fontFamilyPanel=new se("Font",Wt.defaultFontFamilies,Wt.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 de(Mt,_t),Mt.prototype.ownsTarget=function(Lt){return _t.prototype.ownsTarget.call(this,Lt)||this.tipGrip.ownsTarget(Lt)||this.tip===Lt},Mt.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)},Mt.prototype.pointerDown=function(Lt,At){this.state==="new"&&_t.prototype.pointerDown.call(this,Lt,At),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(At)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):_t.prototype.pointerDown.call(this,Lt,At)},Mt.prototype.pointerUp=function(Lt){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,_t.prototype.pointerUp.call(this,Lt);else{var At=this.state==="creating";_t.prototype.pointerUp.call(this,Lt),this.setTipPoints(At),this.positionTip()}},Mt.prototype.manipulate=function(Lt){if(this.tipMoving){var At=this.unrotatePoint(Lt);this.tipPosition={x:At.x-this.manipulationStartLeft,y:At.y-this.manipulationStartTop},this.positionTip()}else _t.prototype.manipulate.call(this,Lt)},Mt.prototype.setBgColor=function(Lt){this.bgRectangle&&this.tip&&(re.setAttributes(this.bgRectangle,[["fill",Lt]]),re.setAttributes(this.tip,[["fill",Lt]])),this.bgColor=Lt,this.fillColorChanged(Lt)},Mt.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},Mt.prototype.setTipPoints=function(Lt){Lt===void 0&&(Lt=!1);var At=Math.min(this.height/2,15),Wt=this.height/5;Lt&&(this.tipPosition={x:At+Wt/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))?(Wt=this.width/5,At=Math.min(this.width/2,15),this.tipBase1Position={x:At,y:0},this.tipBase2Position={x:At+Wt,y:0}):(this.tipBase1Position={x:0,y:At},this.tipBase2Position={x:0,y:At+Wt}):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))?(Wt=this.width/5,At=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-At-Wt,y:0},this.tipBase2Position={x:this.width-At,y:0}):(this.tipBase1Position={x:this.width,y:At},this.tipBase2Position={x:this.width,y:At+Wt}):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))?(Wt=this.width/5,At=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-At-Wt,y:this.height},this.tipBase2Position={x:this.width-At,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-At-Wt},this.tipBase2Position={x:this.width,y:this.height-At}):Et<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(Wt=this.width/5,At=Math.min(this.width/2,15),this.tipBase1Position={x:At,y:this.height},this.tipBase2Position={x:At+Wt,y:this.height}):(this.tipBase1Position={x:0,y:this.height-At},this.tipBase2Position={x:0,y:this.height-At-Wt})},Mt.prototype.resize=function(Lt){_t.prototype.resize.call(this,Lt),this.positionTip()},Mt.prototype.positionTip=function(){re.setAttributes(this.tip,[["points",this.getTipPoints()]]);var Lt=this.tipGrip.visual.transform.baseVal.getItem(0);Lt.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(Lt,0)},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Mt.prototype.select=function(){this.positionTip(),_t.prototype.select.call(this)},Mt.prototype.getState=function(){var Lt=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},_t.prototype.getState.call(this));return Lt.typeName=Mt.typeName,Lt},Mt.prototype.restoreState=function(Lt){var At=Lt;this.bgColor=At.bgColor,this.tipPosition=At.tipPosition,_t.prototype.restoreState.call(this,Lt),this.createTip(),this.setTipPoints()},Mt.prototype.scale=function(Lt,At){_t.prototype.scale.call(this,Lt,At),this.tipPosition={x:this.tipPosition.x*Lt,y:this.tipPosition.y*At},this.positionTip()},Mt.typeName="CalloutMarker",Mt.title="Callout marker",Mt.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>',Mt}(Re),un=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||this;return Et.fillColor="transparent",Et.strokeColor="transparent",Et.strokeWidth=0,Et.strokeDasharray="",Et.opacity=1,Et.strokeColor=Wt.defaultColor,Et.strokeWidth=Wt.defaultStrokeWidth,Et.strokeDasharray=Wt.defaultStrokeDasharray,Et.fillColor=Wt.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",me(Wt.defaultColorSet,["transparent"]),Wt.defaultColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.fillPanel=new nt("Fill color",me(Wt.defaultColorSet,["transparent"]),Et.fillColor,jt),Et.fillPanel.onColorChanged=Et.setFillColor,Et.strokeWidthPanel=new zt("Line width",Wt.defaultStrokeWidths,Wt.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new Ht("Line style",Wt.defaultStrokeDasharrays,Wt.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et.opacityPanel=new Xn("Opacity",Wt.defaultOpacitySteps,Et.opacity),Et.opacityPanel.onOpacityChanged=Et.setOpacity,Et}return de(Mt,_t),Mt.prototype.ownsTarget=function(Lt){return!(!_t.prototype.ownsTarget.call(this,Lt)&&Lt!==this.visual)},Mt.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)},Mt.prototype.pointerDown=function(Lt,At){_t.prototype.pointerDown.call(this,Lt,At),this.state==="new"&&(this.createVisual(),this.moveVisual(Lt),this._state="creating")},Mt.prototype.manipulate=function(Lt){_t.prototype.manipulate.call(this,Lt)},Mt.prototype.resize=function(Lt){_t.prototype.resize.call(this,Lt),this.setSize()},Mt.prototype.setSize=function(){_t.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()]])},Mt.prototype.pointerUp=function(Lt){_t.prototype.pointerUp.call(this,Lt),this.setSize()},Mt.prototype.setStrokeColor=function(Lt){this.strokeColor=Lt,this.visual&&re.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Lt),this.stateChanged()},Mt.prototype.setFillColor=function(Lt){this.fillColor=Lt,this.visual&&re.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(Lt),this.stateChanged()},Mt.prototype.setStrokeWidth=function(Lt){this.strokeWidth=Lt,this.visual&&re.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Mt.prototype.setStrokeDasharray=function(Lt){this.strokeDasharray=Lt,this.visual&&re.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Mt.prototype.setOpacity=function(Lt){this.opacity=Lt,this.visual&&re.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var Lt=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},_t.prototype.getState.call(this));return Lt.typeName=Mt.typeName,Lt},Mt.prototype.restoreState=function(Lt){var At=Lt;this.fillColor=At.fillColor,this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.opacity=At.opacity,this.createVisual(),_t.prototype.restoreState.call(this,Lt),this.setSize()},Mt.prototype.scale=function(Lt,At){_t.prototype.scale.call(this,Lt,At),this.setSize()},Mt.typeName="EllipseMarker",Mt.title="Ellipse marker",Mt.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>',Mt}(Ct),Ln=function(_t){function Mt(Lt,At,Wt){return _t.call(this,Lt,At,Wt)||this}return de(Mt,_t),Object.defineProperty(Mt.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),Mt.prototype.ownsTarget=function(Lt){return!(!_t.prototype.ownsTarget.call(this,Lt)&&Lt!==this.tip1&&Lt!==this.tip2)},Mt.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)},Mt.prototype.pointerDown=function(Lt,At){_t.prototype.pointerDown.call(this,Lt,At),this.state==="creating"&&this.createTips()},Mt.prototype.adjustVisual=function(){if(_t.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 Lt=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(Lt,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(At,0);var Wt=this.tip2.transform.baseVal.getItem(0);Wt.setRotate(Lt+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Wt,0)}},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var Lt=_t.prototype.getState.call(this);return Lt.typeName=Mt.typeName,Lt},Mt.prototype.restoreState=function(Lt){_t.prototype.restoreState.call(this,Lt),this.createTips(),this.adjustVisual()},Mt.typeName="MeasurementMarker",Mt.title="Measurement marker",Mt.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>',Mt}(Ae),Le=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||this;return Et.strokePanel.colors=Wt.defaultColorSet,Et.fillColor="transparent",Et}return de(Mt,_t),Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var Lt=_t.prototype.getState.call(this);return Lt.typeName=Mt.typeName,Lt},Mt.typeName="EllipseFrameMarker",Mt.title="Ellipse frame marker",Mt.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>',Mt}(un),nn=function(){function _t(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(_t.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),_t.prototype.addUndoStep=function(Mt){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(Mt)||(this.undoStack.push(Mt),JSON.stringify(this.lastRedoStep)!==JSON.stringify(Mt)&&this.redoStack.splice(0,this.redoStack.length))},_t.prototype.replaceLastUndoStep=function(Mt){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=Mt)},_t.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},_t.prototype.undo=function(){if(this.undoStack.length>1){var Mt=this.undoStack.pop();return Mt!==void 0&&this.redoStack.push(Mt),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},_t.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},_t}(),hn=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||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=Wt.defaultColor,Et.strokeWidth=Wt.defaultStrokeWidth,Et.strokeDasharray=Wt.defaultStrokeDasharray,Et.strokePanel=new nt("Line color",Wt.defaultColorSet,Wt.defaultColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.strokeWidthPanel=new zt("Line width",Wt.defaultStrokeWidths,Wt.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new Ht("Line style",Wt.defaultStrokeDasharrays,Wt.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et}return de(Mt,_t),Mt.prototype.ownsTarget=function(Lt){return!(!_t.prototype.ownsTarget.call(this,Lt)&&Lt!==this.visual&&Lt!==this.selectorCurve&&Lt!==this.visibleCurve&&!this.curveGrip.ownsTarget(Lt))},Mt.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},Mt.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)},Mt.prototype.pointerDown=function(Lt,At){_t.prototype.pointerDown.call(this,Lt,At),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=Lt.x,this.curveY=Lt.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(At)&&(this.activeGrip=this.curveGrip,this._state="resize")},Mt.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()]]))},Mt.prototype.setupControlBox=function(){_t.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)},Mt.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,_t.prototype.addControlGrips.call(this)},Mt.prototype.positionGrips=function(){_t.prototype.positionGrips.call(this);var Lt=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-Lt/2,this.curveY-Lt/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()))},Mt.prototype.manipulate=function(Lt){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+Lt.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+Lt.y-this.manipulationStartY),_t.prototype.manipulate.call(this,Lt)},Mt.prototype.resize=function(Lt){this.activeGrip===this.curveGrip&&(this.curveX=Lt.x,this.curveY=Lt.y),_t.prototype.resize.call(this,Lt),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},Mt.prototype.setStrokeColor=function(Lt){this.strokeColor=Lt,this.adjustVisual(),this.colorChanged(Lt)},Mt.prototype.setStrokeWidth=function(Lt){this.strokeWidth=Lt,this.adjustVisual()},Mt.prototype.setStrokeDasharray=function(Lt){this.strokeDasharray=Lt,this.adjustVisual()},Mt.prototype.scale=function(Lt,At){this.curveX=this.curveX*Lt,this.curveY=this.curveY*At,_t.prototype.scale.call(this,Lt,At)},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var Lt=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},_t.prototype.getState.call(this));return Lt.typeName=Mt.typeName,Lt},Mt.prototype.restoreState=function(Lt){_t.prototype.restoreState.call(this,Lt);var At=Lt;this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.curveX=At.curveX,this.curveY=At.curveY,this.createVisual(),this.adjustVisual()},Mt.typeName="CurveMarker",Mt.title="Curve marker",Mt.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>',Mt}(te),_n=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,At,Wt)||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=Wt.defaultColor,Et.strokeWidth=Wt.defaultStrokeWidth,Et.strokeDasharray=Wt.defaultStrokeDasharray,Et.fillColor=Wt.defaultFillColor,Et.textColor=Wt.defaultStrokeColor,Et.fontFamily=Wt.defaultFontFamily,Et.fontSize=Wt.defaultCaptionFontSize,Et.captionText=Wt.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",me(Wt.defaultColorSet,["transparent"]),Et.strokeColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.fillPanel=new nt("Fill color",me(Wt.defaultColorSet,["transparent"]),Et.fillColor,jt),Et.fillPanel.onColorChanged=Et.setFillColor,Et.strokeWidthPanel=new zt("Line width",Wt.defaultStrokeWidths,Wt.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new Ht("Line style",Wt.defaultStrokeDasharrays,Wt.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et.fontFamilyPanel=new se("Font",Wt.defaultFontFamilies,Wt.defaultFontFamily),Et.fontFamilyPanel.onFontChanged=Et.setFont,Et.textColorPanel=new nt("Text color",Wt.defaultColorSet,Et.textColor,Yt),Et.textColorPanel.onColorChanged=Et.setTextColor,Et}return de(Mt,_t),Mt.prototype.ownsTarget=function(Lt){return!(!_t.prototype.ownsTarget.call(this,Lt)&&Lt!==this.visual&&Lt!==this.frame&&Lt!==this.captionBg&&Lt!==this.captionElement)},Mt.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()},Mt.prototype.setCaptionText=function(Lt){this.captionText=Lt,this.captionElement.textContent=this.captionText,this.sizeCaption()},Mt.prototype.pointerDown=function(Lt,At){_t.prototype.pointerDown.call(this,Lt,At),this.isMoved=!1,this.pointerDownPoint=Lt,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Lt),this._state="creating")},Mt.prototype.manipulate=function(Lt){_t.prototype.manipulate.call(this,Lt),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Lt.x-this.pointerDownPoint.x)>5||Math.abs(Lt.y-this.pointerDownPoint.y)>5)},Mt.prototype.resize=function(Lt){_t.prototype.resize.call(this,Lt),this.setSize()},Mt.prototype.sizeCaption=function(){var Lt=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=Lt.width+2*this.PADDING,this.captionBoxHeight=Lt.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')"]])},Mt.prototype.showTextEditor=function(){var Lt=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"&&Lt.finishTextEditing(Lt.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(At){At.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){Lt.finishTextEditing(Lt.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){Lt.finishTextEditing(Lt.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},Mt.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"))},Mt.prototype.finishTextEditing=function(Lt){this.setCaptionText(Lt.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},Mt.prototype.setFont=function(Lt){this.captionElement&&re.setAttributes(this.captionElement,[["font-family",Lt]]),this.fontFamily=Lt,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},Mt.prototype.setTextColor=function(Lt){this.captionElement&&re.setAttributes(this.captionElement,[["fill",Lt]]),this.textColor=Lt,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},Mt.prototype.setSize=function(){_t.prototype.setSize.call(this),re.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},Mt.prototype.pointerUp=function(Lt){_t.prototype.pointerUp.call(this,Lt),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},Mt.prototype.dblClick=function(Lt,At){_t.prototype.dblClick.call(this,Lt,At),this.showTextEditor()},Mt.prototype.setStrokeColor=function(Lt){this.strokeColor=Lt,this.frame&&re.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(Lt),this.stateChanged()},Mt.prototype.setFillColor=function(Lt){this.fillColor=Lt,this.captionBg&&re.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(Lt),this.stateChanged()},Mt.prototype.setStrokeWidth=function(Lt){this.strokeWidth=Lt,this.frame&&re.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Mt.prototype.setStrokeDasharray=function(Lt){this.strokeDasharray=Lt,this.frame&&re.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var Lt=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:1,textColor:this.textColor,fontFamily:this.fontFamily,fontSize:this.fontSize,captionText:this.captionText},_t.prototype.getState.call(this));return Lt.typeName=this.typeName,Lt},Mt.prototype.restoreState=function(Lt){var At=Lt;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(),_t.prototype.restoreState.call(this,Lt),this.setSize()},Mt.prototype.scale=function(Lt,At){_t.prototype.scale.call(this,Lt,At),this.setSize()},Mt.typeName="CaptionFrameMarker",Mt.title="Caption frame marker",Mt.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>',Mt}(Ct),fn=function(){function _t(Mt,Lt){Lt===void 0&&(Lt=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=Mt,this.cancelable=Lt}return Object.defineProperty(_t.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),_t.prototype.preventDefault=function(){this._defaultPrevented=!0},_t}(),le=function(_t){function Mt(Lt,At,Wt){var Et=_t.call(this,Lt,!1)||this;return Et.dataUrl=At,Et.state=Wt,Et}return de(Mt,_t),Mt}(fn),we=function(_t){function Mt(Lt,At,Wt){Wt===void 0&&(Wt=!1);var Et=_t.call(this,Lt,Wt)||this;return Et.marker=At,Et}return de(Mt,_t),Mt}(fn),Pn=function(){function _t(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return _t.prototype.addEventListener=function(Mt,Lt){this[Mt].push(Lt)},_t.prototype.removeEventListener=function(Mt,Lt){var At=this[Mt].indexOf(Lt);At>-1&&this[Mt].splice(At,1)},_t}(),vn=function(){function _t(Mt){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ee,this._isOpen=!1,this.undoRedoManager=new nn,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 Pn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=_t.instanceCounter++,this.styles=new Se(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=Mt,this.targetRoot=document.body,this.width=Mt.clientWidth,this.height=Mt.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(_t.prototype,"ALL_MARKER_TYPES",{get:function(){return[$t,He,Cn,Re,Le,un,Ni,Ce,Ln,Rn,Ae,hn,_n]},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[$t,He,Cn,Re,un,Ni,Ce]},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"BASIC_MARKER_TYPES",{get:function(){return[$t,He,Cn,Re,Ni]},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(Mt){var Lt=this;this._availableMarkerTypes.splice(0),Mt.forEach(function(At){if(typeof At=="string"){var Wt=Lt.ALL_MARKER_TYPES.find(function(Et){return Et.typeName===At});Wt!==void 0&&Lt._availableMarkerTypes.push(Wt)}else Lt._availableMarkerTypes.push(At)})},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(Mt){this._zoomLevel=Mt,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),_t.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Zt.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},_t.prototype.show=function(){var Mt=this;this.styles.styleSheetRoot===void 0&&ue.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ue.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(Lt){return Lt(new fn(Mt))})},_t.prototype.render=function(){return Ie(this,void 0,void 0,function(){var Mt;return $e(this,function(Lt){switch(Lt.label){case 0:return this.setCurrentMarker(),(Mt=new Oe).naturalSize=this.renderAtNaturalSize,Mt.imageType=this.renderImageType,Mt.imageQuality=this.renderImageQuality,Mt.markersOnly=this.renderMarkersOnly,Mt.width=this.renderWidth,Mt.height=this.renderHeight,[4,Mt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return Lt.sent(),[4,Mt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,Lt.sent()]}})})},_t.prototype.close=function(Mt){var Lt=this;if(Mt===void 0&&(Mt=!1),this.isOpen){var At=!1;Mt||this.eventListeners.beforeclose.forEach(function(Wt){var Et=new fn(Lt,!0);Wt(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(Wt){return Wt(new fn(Lt))}),this.detachEvents(),this._isOpen=!1)}},_t.prototype.addMarkersToToolbar=function(){for(var Mt,Lt=[],At=0;At<arguments.length;At++)Lt[At]=arguments[At];(Mt=this._availableMarkerTypes).push.apply(Mt,Lt)},_t.prototype.addRenderEventListener=function(Mt){this.addEventListener("render",function(Lt){Mt(Lt.dataUrl,Lt.state)})},_t.prototype.removeRenderEventListener=function(Mt){},_t.prototype.addCloseEventListener=function(Mt){this.addEventListener("close",function(){Mt()})},_t.prototype.removeCloseEventListener=function(Mt){},_t.prototype.setupResizeObserver=function(){var Mt=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){Mt.resize(Mt.target.clientWidth,Mt.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return Mt.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},_t.prototype.onPopupTargetResize=function(){var Mt=1*this.target.clientWidth/this.target.clientHeight,Lt=this.editorCanvas.clientWidth/Mt>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*Mt:this.editorCanvas.clientWidth,At=Lt<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/Mt;this.resize(Lt,At)},_t.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},_t.prototype.resize=function(Mt,Lt){this._isResizing=!0;var At=Mt/this.imageWidth,Wt=Lt/this.imageHeight;this.imageWidth=Math.round(Mt),this.imageHeight=Math.round(Lt),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,Wt),this._isResizing=!1},_t.prototype.scaleMarkers=function(Mt,Lt){var At,Wt=this;this._currentMarker&&this._currentMarker instanceof Re?this._currentMarker.scale(Mt,Lt):(At=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Et){Et!==Wt._currentMarker&&Et.scale(Mt,Lt)}),At!==void 0&&this.setCurrentMarker(At)},_t.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},_t.prototype.setTopLeft=function(){var Mt=this.editingTarget.getBoundingClientRect(),Lt=this.editorCanvas.getBoundingClientRect();this.left=Mt.left-Lt.left,this.top=Mt.top-Lt.top},_t.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},_t.prototype.addDefs=function(){for(var Mt,Lt=[],At=0;At<arguments.length;At++)Lt[At]=arguments[At];this.defs=re.createDefs(),this.addDefsToImage(),(Mt=this.defs).append.apply(Mt,Lt)},_t.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},_t.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},_t.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},_t.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},_t.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},_t.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},_t.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},_t.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var Mt=document.createElement("a");Mt.href="https://markerjs.com/",Mt.target="_blank",Mt.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>',Mt.title="Powered by marker.js",Mt.style.display="grid",Mt.style.alignItems="center",Mt.style.justifyItems="center",Mt.style.padding="3px",Mt.style.width="20px",Mt.style.height="20px",this.logoUI.appendChild(Mt),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},_t.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},_t.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},_t.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},_t.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var Mt=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=Mt+"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 Ze(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 Ft(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},_t.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},_t.prototype.removeMarker=function(Mt){this.markerImage.removeChild(Mt.container),this.markers.indexOf(Mt)>-1&&this.markers.splice(this.markers.indexOf(Mt),1),Mt.dispose()},_t.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},_t.prototype.toolbarButtonClicked=function(Mt,Lt){if(Mt==="marker"&&Lt!==void 0)this.createNewMarker(Lt);else if(Mt==="action")switch(Lt){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},_t.prototype.deleteSelectedMarker=function(){var Mt=this;if(this._currentMarker!==void 0){var Lt=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Wt){var Et=new we(Mt,Mt._currentMarker,!0);Wt(Et),Et.defaultPrevented&&(Lt=!0)}),!Lt){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(Wt){return Wt(new we(Mt,At))})}}},_t.prototype.clear=function(){var Mt=this,Lt=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(be){var Nn=new we(Mt,void 0,!0);be(Nn),Nn.defaultPrevented&&(Lt=!0)}),!Lt)){this.setCurrentMarker();for(var At=function(be){var Nn=Wt.markers[be];Wt.setCurrentMarker(Wt.markers[be]),Wt._currentMarker.dispose(),Wt.markerImage.removeChild(Wt._currentMarker.container),Wt.markers.splice(Wt.markers.indexOf(Wt._currentMarker),1),Wt.eventListeners.markerdelete.forEach(function(mi){return mi(new we(Mt,Nn))})},Wt=this,Et=this.markers.length-1;Et>=0;Et--)At(Et);this.addUndoStep()}},Object.defineProperty(_t.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),_t.prototype.showNotesEditor=function(){var Mt;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=(Mt=this._currentMarker.notes)!==null&&Mt!==void 0?Mt:"",this.overlayContainer.appendChild(this.notesArea))},_t.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},_t.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},_t.prototype.addUndoStep=function(){var Mt=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var Lt=this.getState(),At=this.undoRedoManager.getLastUndoStep();if(!At||At.width===Lt.width&&At.height===Lt.height){var Wt=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(Lt),Wt<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Et){return Et(new fn(Mt))})}else this.undoRedoManager.replaceLastUndoStep(Lt),this.eventListeners.statechange.forEach(function(Et){return Et(new fn(Mt))})}},_t.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},_t.prototype.undoStep=function(){var Mt=this,Lt=this.undoRedoManager.undo();Lt!==void 0&&(this.restoreState(Lt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(At){return At(new fn(Mt))}))},_t.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},_t.prototype.redoStep=function(){var Mt=this,Lt=this.undoRedoManager.redo();Lt!==void 0&&(this.restoreState(Lt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(At){return At(new fn(Mt))}))},_t.prototype.stepZoom=function(){var Mt=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=Mt<this.zoomSteps.length-1?this.zoomSteps[Mt+1]:this.zoomSteps[0]},_t.prototype.panTo=function(Mt){this.contentDiv.scrollBy({left:this.prevPanPoint.x-Mt.x,top:this.prevPanPoint.y-Mt.y}),this.prevPanPoint=Mt},_t.prototype.startRenderAndClose=function(){return Ie(this,void 0,void 0,function(){var Mt,Lt,At=this;return $e(this,function(Wt){switch(Wt.label){case 0:return[4,this.render()];case 1:return Mt=Wt.sent(),Lt=this.getState(),this.eventListeners.render.forEach(function(Et){return Et(new le(At,Mt,Lt))}),this.close(!0),[2]}})})},_t.prototype.getState=function(Mt){Mt===!0&&this.setCurrentMarker();var Lt={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(At){return Lt.markers.push(At.getState())}),Lt},_t.prototype.restoreState=function(Mt){var Lt=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);Mt.markers.forEach(function(At){var Wt=Lt._availableMarkerTypes.find(function(be){return be.typeName===At.typeName});if(Wt!==void 0){var Et=Lt.addNewMarker(Wt);Et.restoreState(At),Lt.markers.push(Et)}}),Mt.width&&Mt.height&&(Mt.width!==this.imageWidth||Mt.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/Mt.width,this.imageHeight/Mt.height),this.eventListeners.restorestate.forEach(function(At){return At(new fn(Lt))})},_t.prototype.addNewMarker=function(Mt){var Lt=re.createGroup();return this.markerImage.appendChild(Lt),new Mt(Lt,this.overlayContainer,this.settings)},_t.prototype.createNewMarker=function(Mt){var Lt,At=this;(Lt=typeof Mt=="string"?this._availableMarkerTypes.find(function(Wt){return Wt.typeName===Mt}):Mt)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(Lt),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(Lt.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(Wt){return Wt(new we(At,At._currentMarker))}))},_t.prototype.markerCreated=function(Mt){var Lt=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(Mt),this.setCurrentMarker(Mt),Mt instanceof He&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(He):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(At){return At(new we(Lt,Lt._currentMarker))})},_t.prototype.colorChanged=function(Mt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=Mt,this.settings.defaultStrokeColor=Mt)},_t.prototype.fillColorChanged=function(Mt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=Mt)},_t.prototype.markerStateChanged=function(Mt){var Lt=this;this.eventListeners.markerchange.forEach(function(At){return At(new we(Lt,Mt))})},_t.prototype.setCurrentMarker=function(Mt){var Lt=this;this._currentMarker!==Mt&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(At){return At(new we(Lt,Lt._currentMarker))})),this._currentMarker=Mt,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 we(Lt,Lt._currentMarker))}))},_t.prototype.onPointerDown=function(Mt){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||Mt.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var Lt=this.markers.find(function(At){return At.ownsTarget(Mt.target)});Lt!==void 0?(this.setCurrentMarker(Lt),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Mt.clientX,Mt.clientY),Mt.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:Mt.clientX,y:Mt.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Mt.clientX,Mt.clientY))},_t.prototype.onDblClick=function(Mt){if(this._isFocused||this.focus(),this.mode==="select"){var Lt=this.markers.find(function(At){return At.ownsTarget(Mt.target)});Lt!==void 0&&Lt!==this._currentMarker&&this.setCurrentMarker(Lt),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(Mt.clientX,Mt.clientY),Mt.target):this.setCurrentMarker()}},_t.prototype.onPointerMove=function(Mt){this.touchPoints!==1&&Mt.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||Mt.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(Mt.clientX,Mt.clientY)):this.zoomLevel>1&&this.panTo({x:Mt.clientX,y:Mt.clientY}))},_t.prototype.onPointerUp=function(Mt){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(Mt.clientX,Mt.clientY)),this.isDragging=!1,this.addUndoStep()},_t.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},_t.prototype.onKeyUp=function(Mt){this._currentMarker===void 0||this.notesArea!==void 0||Mt.key!=="Delete"&&Mt.key!=="Backspace"||this.deleteSelectedMarker()},_t.prototype.clientToLocalCoordinates=function(Mt,Lt){var At=this.markerImage.getBoundingClientRect();return{x:(Mt-At.left)/this.zoomLevel,y:(Lt-At.top)/this.zoomLevel}},_t.prototype.onWindowResize=function(){this.positionUI()},_t.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var Mt=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=Mt+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},_t.prototype.addLicenseKey=function(Mt){Zt.addKey(Mt)},_t.prototype.addEventListener=function(Mt,Lt){this.eventListeners.addEventListener(Mt,Lt)},_t.prototype.removeEventListener=function(Mt,Lt){this.eventListeners.removeEventListener(Mt,Lt)},_t.prototype.renderState=function(Mt){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(Mt),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(_t.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),_t.prototype.focus=function(){var Mt=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(Lt){return Lt(new fn(Mt))}))},_t.prototype.blur=function(){var Mt=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(Lt){return Lt(new fn(Mt))}))},_t.instanceCounter=0,_t}()},71032:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return vt}});var St=Kt(87462),de=Kt(4942),Ie=Kt(97685),$e=Kt(45987),me=Kt(94184),re=Kt.n(me),Zt=Kt(21770),Oe=Kt(15105),ue=Kt(64217),Se=Kt(67294);function Ue(Ct,Nt){var zt=Ct.disabled,Ht=Ct.prefixCls,$t=Ct.character,ee=Ct.characterRender,te=Ct.index,Ae=Ct.count,se=Ct.value,Re=Ct.allowHalf,He=Ct.focused,ze=Ct.onHover,Cn=Ct.onClick,Rn=function(Le){ze(Le,te)},Xn=function(Le){Cn(Le,te)},Ni=function(Le){Le.keyCode===Oe.Z.ENTER&&Cn(Le,te)},Yt=te+1,jt=new Set([Ht]);se===0&&te===0&&He?jt.add("".concat(Ht,"-focused")):Re&&se+.5>=Yt&&se<Yt?(jt.add("".concat(Ht,"-half")),jt.add("".concat(Ht,"-active")),He&&jt.add("".concat(Ht,"-focused"))):(Yt<=se?jt.add("".concat(Ht,"-full")):jt.add("".concat(Ht,"-zero")),Yt===se&&He&&jt.add("".concat(Ht,"-focused")));var Ce=typeof $t=="function"?$t(Ct):$t,un=Se.createElement("li",{className:re()(Array.from(jt)),ref:Nt},Se.createElement("div",{onClick:zt?null:Xn,onKeyDown:zt?null:Ni,onMouseMove:zt?null:Rn,role:"radio","aria-checked":se>te?"true":"false","aria-posinset":te+1,"aria-setsize":Ae,tabIndex:zt?-1:0},Se.createElement("div",{className:"".concat(Ht,"-first")},Ce),Se.createElement("div",{className:"".concat(Ht,"-second")},Ce)));return ee&&(un=ee(un,Ct)),un}var Ee=Se.forwardRef(Ue);function Ze(){var Ct=Se.useRef({});function Nt(Ht){return Ct.current[Ht]}function zt(Ht){return function($t){Ct.current[Ht]=$t}}return[Nt,zt]}function Ft(Ct){var Nt=Ct.pageXOffset,zt="scrollLeft";if(typeof Nt!="number"){var Ht=Ct.document;Nt=Ht.documentElement[zt],typeof Nt!="number"&&(Nt=Ht.body[zt])}return Nt}function et(Ct){var Nt,zt,Ht=Ct.ownerDocument,$t=Ht.body,ee=Ht&&Ht.documentElement,te=Ct.getBoundingClientRect();return Nt=te.left,zt=te.top,Nt-=ee.clientLeft||$t.clientLeft||0,zt-=ee.clientTop||$t.clientTop||0,{left:Nt,top:zt}}function nt(Ct){var Nt=et(Ct),zt=Ct.ownerDocument,Ht=zt.defaultView||zt.parentWindow;return Nt.left+=Ft(Ht),Nt.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(Ct,Nt){var zt=Ct.prefixCls,Ht=zt===void 0?"rc-rate":zt,$t=Ct.className,ee=Ct.defaultValue,te=Ct.value,Ae=Ct.count,se=Ae===void 0?5:Ae,Re=Ct.allowHalf,He=Re===void 0?!1:Re,ze=Ct.allowClear,Cn=ze===void 0?!0:ze,Rn=Ct.keyboard,Xn=Rn===void 0?!0:Rn,Ni=Ct.character,Yt=Ni===void 0?"\u2605":Ni,jt=Ct.characterRender,Ce=Ct.disabled,un=Ct.direction,Ln=un===void 0?"ltr":un,Le=Ct.tabIndex,nn=Le===void 0?0:Le,hn=Ct.autoFocus,_n=Ct.onHoverChange,fn=Ct.onChange,le=Ct.onFocus,we=Ct.onBlur,Pn=Ct.onKeyDown,vn=Ct.onMouseLeave,_t=(0,$e.Z)(Ct,ct),Mt=Ze(),Lt=(0,Ie.Z)(Mt,2),At=Lt[0],Wt=Lt[1],Et=Se.useRef(null),be=function(){if(!Ce){var Ti;(Ti=Et.current)===null||Ti===void 0||Ti.focus()}};Se.useImperativeHandle(Nt,function(){return{focus:be,blur:function(){if(!Ce){var Ti;(Ti=Et.current)===null||Ti===void 0||Ti.blur()}}}});var Nn=(0,Zt.Z)(ee||0,{value:te}),mi=(0,Ie.Z)(Nn,2),On=mi[0],Gn=mi[1],Fi=(0,Zt.Z)(null),yn=(0,Ie.Z)(Fi,2),Li=yn[0],yi=yn[1],Ui=function(Ti,We){var xt=Ln==="rtl",Sn=Ti+1;if(He){var mn=At(Ti),rn=nt(mn),en=mn.clientWidth;(xt&&We-rn>en/2||!xt&&We-rn<en/2)&&(Sn-=.5)}return Sn},Jn=function(Ti){Gn(Ti),fn==null||fn(Ti)},xr=Se.useState(!1),Mo=(0,Ie.Z)(xr,2),ao=Mo[0],$i=Mo[1],Kr=function(){$i(!0),le==null||le()},No=function(){$i(!1),we==null||we()},fr=Se.useState(null),sr=(0,Ie.Z)(fr,2),Pr=sr[0],Vi=sr[1],Ir=function(Ti,We){var xt=Ui(We,Ti.pageX);xt!==Li&&(Vi(xt),yi(null)),_n==null||_n(xt)},Ns=function(Ti){Ce||(Vi(null),yi(null),_n==null||_n(void 0)),Ti&&(vn==null||vn(Ti))},jr=function(Ti,We){var xt=Ui(We,Ti.pageX),Sn=!1;Cn&&(Sn=xt===On),Ns(),Jn(Sn?0:xt),yi(Sn?xt:null)},Va=function(Ti){var We=Ti.keyCode,xt=Ln==="rtl",Sn=He?.5:1;Xn&&(We===Oe.Z.RIGHT&&On<se&&!xt?(Jn(On+Sn),Ti.preventDefault()):We===Oe.Z.LEFT&&On>0&&!xt||We===Oe.Z.RIGHT&&On>0&&xt?(Jn(On-Sn),Ti.preventDefault()):We===Oe.Z.LEFT&&On<se&&xt&&(Jn(On+Sn),Ti.preventDefault())),Pn==null||Pn(Ti)};Se.useEffect(function(){hn&&!Ce&&be()},[]);var Hs=new Array(se).fill(0).map(function(gr,Ti){return Se.createElement(Ee,{ref:Wt(Ti),index:Ti,count:se,disabled:Ce,prefixCls:"".concat(Ht,"-star"),allowHalf:He,value:Pr===null?On:Pr,onClick:jr,onHover:Ir,key:gr||Ti,character:Yt,characterRender:jt,focused:ao})}),Ws=re()(Ht,$t,(0,de.Z)((0,de.Z)({},"".concat(Ht,"-disabled"),Ce),"".concat(Ht,"-rtl"),Ln==="rtl"));return Se.createElement("ul",(0,St.Z)({className:Ws,onMouseLeave:Ns,tabIndex:Ce?-1:nn,onFocus:Ce?null:Kr,onBlur:Ce?null:No,onKeyDown:Ce?null:Va,ref:Et},(0,ue.Z)(_t,{aria:!0,data:!0,attr:!0})),Hs)}var pt=Se.forwardRef(lt),vt=pt},58212:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return Ni}});function St(){return St=Object.assign?Object.assign.bind():function(Yt){for(var jt=1;jt<arguments.length;jt++){var Ce=arguments[jt];for(var un in Ce)Object.prototype.hasOwnProperty.call(Ce,un)&&(Yt[un]=Ce[un])}return Yt},St.apply(this,arguments)}function de(Yt){"@babel/helpers - typeof";return de=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(jt){return typeof jt}:function(jt){return jt&&typeof Symbol=="function"&&jt.constructor===Symbol&&jt!==Symbol.prototype?"symbol":typeof jt},de(Yt)}function Ie(Yt,jt){if(de(Yt)!=="object"||Yt===null)return Yt;var Ce=Yt[Symbol.toPrimitive];if(Ce!==void 0){var un=Ce.call(Yt,jt||"default");if(de(un)!=="object")return un;throw new TypeError("@@toPrimitive must return a primitive value.")}return(jt==="string"?String:Number)(Yt)}function $e(Yt){var jt=Ie(Yt,"string");return de(jt)==="symbol"?jt:String(jt)}function me(Yt,jt,Ce){return jt=$e(jt),jt in Yt?Object.defineProperty(Yt,jt,{value:Ce,enumerable:!0,configurable:!0,writable:!0}):Yt[jt]=Ce,Yt}function re(Yt){if(Array.isArray(Yt))return Yt}function Zt(Yt,jt){var Ce=Yt==null?null:typeof Symbol!="undefined"&&Yt[Symbol.iterator]||Yt["@@iterator"];if(Ce!=null){var un,Ln,Le,nn,hn=[],_n=!0,fn=!1;try{if(Le=(Ce=Ce.call(Yt)).next,jt===0){if(Object(Ce)!==Ce)return;_n=!1}else for(;!(_n=(un=Le.call(Ce)).done)&&(hn.push(un.value),hn.length!==jt);_n=!0);}catch(le){fn=!0,Ln=le}finally{try{if(!_n&&Ce.return!=null&&(nn=Ce.return(),Object(nn)!==nn))return}finally{if(fn)throw Ln}}return hn}}function Oe(Yt,jt){(jt==null||jt>Yt.length)&&(jt=Yt.length);for(var Ce=0,un=new Array(jt);Ce<jt;Ce++)un[Ce]=Yt[Ce];return un}function ue(Yt,jt){if(Yt){if(typeof Yt=="string")return Oe(Yt,jt);var Ce=Object.prototype.toString.call(Yt).slice(8,-1);if(Ce==="Object"&&Yt.constructor&&(Ce=Yt.constructor.name),Ce==="Map"||Ce==="Set")return Array.from(Yt);if(Ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ce))return Oe(Yt,jt)}}function Se(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ue(Yt,jt){return re(Yt)||Zt(Yt,jt)||ue(Yt,jt)||Se()}function Ee(Yt,jt){if(Yt==null)return{};var Ce={},un=Object.keys(Yt),Ln,Le;for(Le=0;Le<un.length;Le++)Ln=un[Le],!(jt.indexOf(Ln)>=0)&&(Ce[Ln]=Yt[Ln]);return Ce}function Ze(Yt,jt){if(Yt==null)return{};var Ce=Ee(Yt,jt),un,Ln;if(Object.getOwnPropertySymbols){var Le=Object.getOwnPropertySymbols(Yt);for(Ln=0;Ln<Le.length;Ln++)un=Le[Ln],!(jt.indexOf(un)>=0)&&Object.prototype.propertyIsEnumerable.call(Yt,un)&&(Ce[un]=Yt[un])}return Ce}var Ft=Kt(67294),et=Kt(94184),nt=Kt.n(et);function ct(Yt){if(Array.isArray(Yt))return Yt}function lt(Yt,jt){var Ce=Yt==null?null:typeof Symbol!="undefined"&&Yt[Symbol.iterator]||Yt["@@iterator"];if(Ce!=null){var un,Ln,Le,nn,hn=[],_n=!0,fn=!1;try{if(Le=(Ce=Ce.call(Yt)).next,jt===0){if(Object(Ce)!==Ce)return;_n=!1}else for(;!(_n=(un=Le.call(Ce)).done)&&(hn.push(un.value),hn.length!==jt);_n=!0);}catch(le){fn=!0,Ln=le}finally{try{if(!_n&&Ce.return!=null&&(nn=Ce.return(),Object(nn)!==nn))return}finally{if(fn)throw Ln}}return hn}}function pt(Yt,jt){(jt==null||jt>Yt.length)&&(jt=Yt.length);for(var Ce=0,un=new Array(jt);Ce<jt;Ce++)un[Ce]=Yt[Ce];return un}function vt(Yt,jt){if(Yt){if(typeof Yt=="string")return pt(Yt,jt);var Ce=Object.prototype.toString.call(Yt).slice(8,-1);if(Ce==="Object"&&Yt.constructor&&(Ce=Yt.constructor.name),Ce==="Map"||Ce==="Set")return Array.from(Yt);if(Ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ce))return pt(Yt,jt)}}function Ct(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nt(Yt,jt){return ct(Yt)||lt(Yt,jt)||vt(Yt,jt)||Ct()}function zt(Yt){var jt=Ft.useRef();jt.current=Yt;var Ce=Ft.useCallback(function(){for(var un,Ln=arguments.length,Le=new Array(Ln),nn=0;nn<Ln;nn++)Le[nn]=arguments[nn];return(un=jt.current)===null||un===void 0?void 0:un.call.apply(un,[jt].concat(Le))},[]);return Ce}function Ht(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var $t=Ht()?Ft.useLayoutEffect:Ft.useEffect,ee=function(jt,Ce){var un=Ft.useRef(!0);$t(function(){return jt(un.current)},Ce),$t(function(){return un.current=!1,function(){un.current=!0}},[])},te=function(jt,Ce){ee(function(un){if(!un)return jt()},Ce)},Ae=null;function se(Yt){var jt=Ft.useRef(!1),Ce=Ft.useState(Yt),un=Nt(Ce,2),Ln=un[0],Le=un[1];Ft.useEffect(function(){return jt.current=!1,function(){jt.current=!0}},[]);function nn(hn,_n){_n&&jt.current||Le(hn)}return[Ln,nn]}function Re(Yt){return Yt!==void 0}function He(Yt,jt){var Ce=jt||{},un=Ce.defaultValue,Ln=Ce.value,Le=Ce.onChange,nn=Ce.postState,hn=se(function(){return Re(Ln)?Ln:Re(un)?typeof un=="function"?un():un:typeof Yt=="function"?Yt():Yt}),_n=Nt(hn,2),fn=_n[0],le=_n[1],we=Ln!==void 0?Ln:fn,Pn=nn?nn(we):we,vn=zt(Le),_t=se([we]),Mt=Nt(_t,2),Lt=Mt[0],At=Mt[1];te(function(){var Et=Lt[0];fn!==Et&&vn(fn,Et)},[Lt]),te(function(){Re(Ln)||le(Ln)},[Ln]);var Wt=zt(function(Et,be){le(Et,be),At([we],be)});return[Pn,Wt]}var ze={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(jt){var Ce=jt.keyCode;if(jt.altKey&&!jt.ctrlKey||jt.metaKey||Ce>=ze.F1&&Ce<=ze.F12)return!1;switch(Ce){case ze.ALT:case ze.CAPS_LOCK:case ze.CONTEXT_MENU:case ze.CTRL:case ze.DOWN:case ze.END:case ze.ESC:case ze.HOME:case ze.INSERT:case ze.LEFT:case ze.MAC_FF_META:case ze.META:case ze.NUMLOCK:case ze.NUM_CENTER:case ze.PAGE_DOWN:case ze.PAGE_UP:case ze.PAUSE:case ze.PRINT_SCREEN:case ze.RIGHT:case ze.SHIFT:case ze.UP:case ze.WIN_KEY:case ze.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(jt){if(jt>=ze.ZERO&&jt<=ze.NINE||jt>=ze.NUM_ZERO&&jt<=ze.NUM_MULTIPLY||jt>=ze.A&&jt<=ze.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&jt===0)return!0;switch(jt){case ze.SPACE:case ze.QUESTION_MARK:case ze.NUM_PLUS:case ze.NUM_MINUS:case ze.NUM_PERIOD:case ze.NUM_DIVISION:case ze.SEMICOLON:case ze.DASH:case ze.EQUALS:case ze.COMMA:case ze.PERIOD:case ze.SLASH:case ze.APOSTROPHE:case ze.SINGLE_QUOTE:case ze.OPEN_SQUARE_BRACKET:case ze.BACKSLASH:case ze.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Cn=ze,Rn=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Xn=Ft.forwardRef(function(Yt,jt){var Ce,un=Yt.prefixCls,Ln=un===void 0?"rc-switch":un,Le=Yt.className,nn=Yt.checked,hn=Yt.defaultChecked,_n=Yt.disabled,fn=Yt.loadingIcon,le=Yt.checkedChildren,we=Yt.unCheckedChildren,Pn=Yt.onClick,vn=Yt.onChange,_t=Yt.onKeyDown,Mt=Ze(Yt,Rn),Lt=He(!1,{value:nn,defaultValue:hn}),At=Ue(Lt,2),Wt=At[0],Et=At[1];function be(Gn,Fi){var yn=Wt;return _n||(yn=Gn,Et(yn),vn==null||vn(yn,Fi)),yn}function Nn(Gn){Gn.which===Cn.LEFT?be(!1,Gn):Gn.which===Cn.RIGHT&&be(!0,Gn),_t==null||_t(Gn)}function mi(Gn){var Fi=be(!Wt,Gn);Pn==null||Pn(Fi,Gn)}var On=nt()(Ln,Le,(Ce={},me(Ce,"".concat(Ln,"-checked"),Wt),me(Ce,"".concat(Ln,"-disabled"),_n),Ce));return Ft.createElement("button",St({},Mt,{type:"button",role:"switch","aria-checked":Wt,disabled:_n,className:On,ref:jt,onKeyDown:Nn,onClick:mi}),fn,Ft.createElement("span",{className:"".concat(Ln,"-inner")},Ft.createElement("span",{className:"".concat(Ln,"-inner-checked")},le),Ft.createElement("span",{className:"".concat(Ln,"-inner-unchecked")},we)))});Xn.displayName="Switch";var Ni=Xn},73299:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return Ti}});var St=Kt(87462),de=Kt(1413),Ie=Kt(71002),$e=Kt(97685),me=Kt(4942),re=Kt(45987),Zt=Kt(67294),Oe=Kt(73935),ue=Kt(94184),Se=Kt.n(ue),Ue=Kt(48555),Ee=Zt.forwardRef(function(We,xt){var Sn=We.height,mn=We.offsetY,rn=We.offsetX,en=We.children,sn=We.prefixCls,wn=We.onInnerResize,Qn=We.innerProps,ye=We.rtl,ve=We.extra,ne={},ke={display:"flex",flexDirection:"column"};if(mn!==void 0){var xn;ne={height:Sn,position:"relative",overflow:"hidden"},ke=(0,de.Z)((0,de.Z)({},ke),{},(xn={transform:"translateY(".concat(mn,"px)")},(0,me.Z)(xn,ye?"marginRight":"marginLeft",-rn),(0,me.Z)(xn,"position","absolute"),(0,me.Z)(xn,"left",0),(0,me.Z)(xn,"right",0),(0,me.Z)(xn,"top",0),xn))}return Zt.createElement("div",{style:ne},Zt.createElement(Ue.Z,{onResize:function(In){var ge=In.offsetHeight;ge&&wn&&wn()}},Zt.createElement("div",(0,St.Z)({style:ke,className:Se()((0,me.Z)({},"".concat(sn,"-holder-inner"),sn)),ref:xt},Qn),en,ve)))});Ee.displayName="Filler";var Ze=Ee,Ft=function(xt){return+setTimeout(xt,16)},et=function(xt){return clearTimeout(xt)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Ft=function(xt){return window.requestAnimationFrame(xt)},et=function(xt){return window.cancelAnimationFrame(xt)});var nt=0,ct=new Map;function lt(We){ct.delete(We)}var pt=function(xt){var Sn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;nt+=1;var mn=nt;function rn(en){if(en===0)lt(mn),xt();else{var sn=Ft(function(){rn(en-1)});ct.set(mn,sn)}}return rn(Sn),mn};pt.cancel=function(We){var xt=ct.get(We);return lt(xt),et(xt)};var vt=pt;function Ct(We,xt){var Sn="touches"in We?We.touches[0]:We;return Sn[xt?"pageX":"pageY"]}var Nt=Zt.forwardRef(function(We,xt){var Sn,mn=We.prefixCls,rn=We.rtl,en=We.scrollOffset,sn=We.scrollRange,wn=We.onStartMove,Qn=We.onStopMove,ye=We.onScroll,ve=We.horizontal,ne=We.spinSize,ke=We.containerSize,xn=We.style,Fn=We.thumbStyle,In=Zt.useState(!1),ge=(0,$e.Z)(In,2),Ge=ge[0],Bn=ge[1],ri=Zt.useState(null),Qe=(0,$e.Z)(ri,2),ce=Qe[0],Tn=Qe[1],ti=Zt.useState(null),Be=(0,$e.Z)(ti,2),qt=Be[0],ae=Be[1],Mn=!rn,Gi=Zt.useRef(),Ai=Zt.useRef(),gn=Zt.useState(!1),Ye=(0,$e.Z)(gn,2),xe=Ye[0],ei=Ye[1],Si=Zt.useRef(),qe=function(){clearTimeout(Si.current),ei(!0),Si.current=setTimeout(function(){ei(!1)},3e3)},Hn=sn-ke||0,So=ke-ne||0,Bi=Hn>0,Qi=Zt.useMemo(function(){if(en===0||Hn===0)return 0;var Zn=en/Hn;return Zn*So},[en,Hn,So]),he=function(pi){pi.stopPropagation(),pi.preventDefault()},Yn=Zt.useRef({top:Qi,dragging:Ge,pageY:ce,startTop:qt});Yn.current={top:Qi,dragging:Ge,pageY:ce,startTop:qt};var gi=function(pi){Bn(!0),Tn(Ct(pi,ve)),ae(Yn.current.top),wn(),pi.stopPropagation(),pi.preventDefault()};Zt.useEffect(function(){var Zn=function(Fe){Fe.preventDefault()},pi=Gi.current,Pe=Ai.current;return pi.addEventListener("touchstart",Zn),Pe.addEventListener("touchstart",gi),function(){pi.removeEventListener("touchstart",Zn),Pe.removeEventListener("touchstart",gi)}},[]);var zn=Zt.useRef();zn.current=Hn;var Ri=Zt.useRef();Ri.current=So,Zt.useEffect(function(){if(Ge){var Zn,pi=function(Fe){var Dn=Yn.current,Hi=Dn.dragging,ci=Dn.pageY,nr=Dn.startTop;if(vt.cancel(Zn),Hi){var Yi=Ct(Fe,ve)-ci,ui=nr;!Mn&&ve?ui-=Yi:ui+=Yi;var Ki=zn.current,zi=Ri.current,Ci=zi?ui/zi:0,ln=Math.ceil(Ci*Ki);ln=Math.max(ln,0),ln=Math.min(ln,Ki),Zn=vt(function(){ye(ln,ve)})}},Pe=function(){Bn(!1),Qn()};return window.addEventListener("mousemove",pi),window.addEventListener("touchmove",pi),window.addEventListener("mouseup",Pe),window.addEventListener("touchend",Pe),function(){window.removeEventListener("mousemove",pi),window.removeEventListener("touchmove",pi),window.removeEventListener("mouseup",Pe),window.removeEventListener("touchend",Pe),vt.cancel(Zn)}}},[Ge]),Zt.useEffect(function(){qe()},[en]),Zt.useImperativeHandle(xt,function(){return{delayHidden:qe}});var hi="".concat(mn,"-scrollbar"),xi={position:"absolute",visibility:xe&&Bi?null:"hidden"},di={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return ve?(xi.height=8,xi.left=0,xi.right=0,xi.bottom=0,di.height="100%",di.width=ne,Mn?di.left=Qi:di.right=Qi):(xi.width=8,xi.top=0,xi.bottom=0,Mn?xi.right=0:xi.left=0,di.width="100%",di.height=ne,di.top=Qi),Zt.createElement("div",{ref:Gi,className:Se()(hi,(Sn={},(0,me.Z)(Sn,"".concat(hi,"-horizontal"),ve),(0,me.Z)(Sn,"".concat(hi,"-vertical"),!ve),(0,me.Z)(Sn,"".concat(hi,"-visible"),xe),Sn)),style:(0,de.Z)((0,de.Z)({},xi),xn),onMouseDown:he,onMouseMove:qe},Zt.createElement("div",{ref:Ai,className:Se()("".concat(hi,"-thumb"),(0,me.Z)({},"".concat(hi,"-thumb-moving"),Ge)),style:(0,de.Z)((0,de.Z)({},di),Fn),onMouseDown:gi}))}),zt=Nt;function Ht(We){var xt=We.children,Sn=We.setRef,mn=Zt.useCallback(function(rn){Sn(rn)},[]);return Zt.cloneElement(xt,{ref:mn})}function $t(We,xt,Sn,mn,rn,en,sn){var wn=sn.getKey;return We.slice(xt,Sn+1).map(function(Qn,ye){var ve=xt+ye,ne=en(Qn,ve,{style:{width:mn}}),ke=wn(Qn);return Zt.createElement(Ht,{key:ke,setRef:function(Fn){return rn(Qn,Fn)}},ne)})}function ee(We){return We instanceof HTMLElement||We instanceof SVGElement}function te(We){return ee(We)?We:We instanceof Zt.Component?Oe.findDOMNode(We):null}var Ae=Kt(15671),se=Kt(43144),Re=function(){function We(){(0,Ae.Z)(this,We),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return(0,se.Z)(We,[{key:"set",value:function(Sn,mn){this.maps[Sn]=mn,this.id+=1}},{key:"get",value:function(Sn){return this.maps[Sn]}}]),We}(),He=Re;function ze(We,xt,Sn){var mn=Zt.useState(0),rn=(0,$e.Z)(mn,2),en=rn[0],sn=rn[1],wn=(0,Zt.useRef)(new Map),Qn=(0,Zt.useRef)(new He),ye=(0,Zt.useRef)();function ve(){vt.cancel(ye.current)}function ne(){var xn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ve();var Fn=function(){wn.current.forEach(function(ge,Ge){if(ge&&ge.offsetParent){var Bn=te(ge),ri=Bn.offsetHeight;Qn.current.get(Ge)!==ri&&Qn.current.set(Ge,Bn.offsetHeight)}}),sn(function(ge){return ge+1})};xn?Fn():ye.current=vt(Fn)}function ke(xn,Fn){var In=We(xn),ge=wn.current.get(In);Fn?(wn.current.set(In,Fn),ne()):wn.current.delete(In),!ge!=!Fn&&(Fn?xt==null||xt(xn):Sn==null||Sn(xn))}return(0,Zt.useEffect)(function(){return ve},[]),[ke,ne,Qn.current,en]}function Cn(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Rn=Cn()?Zt.useLayoutEffect:Zt.useEffect,Xn=function(xt,Sn){var mn=Zt.useRef(!0);Rn(function(){return xt(mn.current)},Sn),Rn(function(){return mn.current=!1,function(){mn.current=!0}},[])},Ni=function(xt,Sn){Xn(function(mn){if(!mn)return xt()},Sn)},Yt=Xn;function jt(We){var xt=Zt.useRef();xt.current=We;var Sn=Zt.useCallback(function(){for(var mn,rn=arguments.length,en=new Array(rn),sn=0;sn<rn;sn++)en[sn]=arguments[sn];return(mn=xt.current)===null||mn===void 0?void 0:mn.call.apply(mn,[xt].concat(en))},[]);return Sn}function Ce(We){var xt=React.useRef(!1),Sn=React.useState(We),mn=_slicedToArray(Sn,2),rn=mn[0],en=mn[1];React.useEffect(function(){return xt.current=!1,function(){xt.current=!0}},[]);function sn(wn,Qn){Qn&&xt.current||en(wn)}return[rn,sn]}function un(We){return We!==void 0}function Ln(We,xt){var Sn=xt||{},mn=Sn.defaultValue,rn=Sn.value,en=Sn.onChange,sn=Sn.postState,wn=useState(function(){return un(rn)?rn:un(mn)?typeof mn=="function"?mn():mn:typeof We=="function"?We():We}),Qn=_slicedToArray(wn,2),ye=Qn[0],ve=Qn[1],ne=rn!==void 0?rn:ye,ke=sn?sn(ne):ne,xn=useEvent(en),Fn=useState([ne]),In=_slicedToArray(Fn,2),ge=In[0],Ge=In[1];useLayoutUpdateEffect(function(){var ri=ge[0];ye!==ri&&xn(ye,ri)},[ge]),useLayoutUpdateEffect(function(){un(rn)||ve(rn)},[rn]);var Bn=useEvent(function(ri,Qe){ve(ri,Qe),Ge([ne],Qe)});return[ke,Bn]}var Le=Kt(31461);function nn(We,xt,Sn){var mn=React.useRef({});return(!("value"in mn.current)||Sn(mn.current.condition,xt))&&(mn.current.value=We(),mn.current.condition=xt),mn.current.value}function hn(We,xt){typeof We=="function"?We(xt):_typeof(We)==="object"&&We&&"current"in We&&(We.current=xt)}function _n(){for(var We=arguments.length,xt=new Array(We),Sn=0;Sn<We;Sn++)xt[Sn]=arguments[Sn];var mn=xt.filter(function(rn){return rn});return mn.length<=1?mn[0]:function(rn){xt.forEach(function(en){hn(en,rn)})}}function fn(){for(var We=arguments.length,xt=new Array(We),Sn=0;Sn<We;Sn++)xt[Sn]=arguments[Sn];return useMemo(function(){return _n.apply(void 0,xt)},xt,function(mn,rn){return mn.length!==rn.length||mn.every(function(en,sn){return en!==rn[sn]})})}function le(We){var xt,Sn,mn=isMemo(We)?We.type.type:We.type;return!(typeof mn=="function"&&!((xt=mn.prototype)!==null&&xt!==void 0&&xt.render)||typeof We=="function"&&!((Sn=We.prototype)!==null&&Sn!==void 0&&Sn.render))}function we(We){return!isValidElement(We)||isFragment(We)?!1:le(We)}function Pn(We,xt,Sn,mn){if(!xt.length)return Sn;var rn=_toArray(xt),en=rn[0],sn=rn.slice(1),wn;return!We&&typeof en=="number"?wn=[]:Array.isArray(We)?wn=_toConsumableArray(We):wn=_objectSpread({},We),mn&&Sn===void 0&&sn.length===1?delete wn[en][sn[0]]:wn[en]=Pn(wn[en],sn,Sn,mn),wn}function vn(We,xt,Sn){var mn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return xt.length&&mn&&Sn===void 0&&!get(We,xt.slice(0,-1))?We:Pn(We,xt,Sn,mn)}function _t(We){return _typeof(We)==="object"&&We!==null&&Object.getPrototypeOf(We)===Object.prototype}function Mt(We){return Array.isArray(We)?[]:{}}var Lt=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function At(){for(var We=arguments.length,xt=new Array(We),Sn=0;Sn<We;Sn++)xt[Sn]=arguments[Sn];var mn=Mt(xt[0]);return xt.forEach(function(rn){function en(sn,wn){var Qn=new Set(wn),ye=get(rn,sn),ve=Array.isArray(ye);if(ve||_t(ye)){if(!Qn.has(ye)){Qn.add(ye);var ne=get(mn,sn);ve?mn=vn(mn,sn,[]):(!ne||_typeof(ne)!=="object")&&(mn=vn(mn,sn,Mt(ye))),Lt(ye).forEach(function(ke){en([].concat(_toConsumableArray(sn),[ke]),Qn)})}}else mn=vn(mn,sn,ye)}en([])}),mn}var Wt={},Et=[],be=function(xt){Et.push(xt)};function Nn(We,xt){if(0)var Sn}function mi(We,xt){if(0)var Sn}function On(){Wt={}}function Gn(We,xt,Sn){!xt&&!Wt[Sn]&&(We(!1,Sn),Wt[Sn]=!0)}function Fi(We,xt){Gn(Nn,We,xt)}function yn(We,xt){Gn(mi,We,xt)}Fi.preMessage=be,Fi.resetWarned=On,Fi.noteOnce=yn;var Li=null,yi=10;function Ui(We,xt,Sn,mn,rn,en,sn,wn){var Qn=Zt.useRef(),ye=Zt.useState(null),ve=(0,$e.Z)(ye,2),ne=ve[0],ke=ve[1];return Yt(function(){if(ne&&ne.times<yi){if(!We.current){ke(function(qe){return(0,de.Z)({},qe)});return}en();var xn=ne.targetAlign,Fn=ne.originAlign,In=ne.index,ge=ne.offset,Ge=We.current.clientHeight,Bn=!1,ri=xn,Qe=null;if(Ge){for(var ce=xn||Fn,Tn=0,ti=0,Be=0,qt=Math.min(xt.length-1,In),ae=0;ae<=qt;ae+=1){var Mn=rn(xt[ae]);ti=Tn;var Gi=Sn.get(Mn);Be=ti+(Gi===void 0?mn:Gi),Tn=Be}for(var Ai=ce==="top"?ge:Ge-ge,gn=qt;gn>=0;gn-=1){var Ye=rn(xt[gn]),xe=Sn.get(Ye);if(xe===void 0){Bn=!0;break}if(Ai-=xe,Ai<=0)break}switch(ce){case"top":Qe=ti-ge;break;case"bottom":Qe=Be-Ge+ge;break;default:{var ei=We.current.scrollTop,Si=ei+Ge;ti<ei?ri="top":Be>Si&&(ri="bottom")}}Qe!==null&&sn(Qe),Qe!==ne.lastTop&&(Bn=!0)}Bn&&ke(function(qe){return(0,de.Z)((0,de.Z)({},qe),{},{times:qe.times+1,targetAlign:ri,lastTop:Qe})})}},[ne,We.current]),function(xn){if(xn==null){wn();return}if(vt.cancel(Qn.current),typeof xn=="number")sn(xn);else if(xn&&(0,Ie.Z)(xn)==="object"){var Fn,In=xn.align;"index"in xn?Fn=xn.index:Fn=xt.findIndex(function(Bn){return rn(Bn)===xn.key});var ge=xn.offset,Ge=ge===void 0?0:ge;ke({times:0,index:Fn,offset:Ge,originAlign:In})}}}function Jn(We,xt,Sn,mn){var rn=Sn-We,en=xt-Sn,sn=Math.min(rn,en)*2;if(mn<=sn){var wn=Math.floor(mn/2);return mn%2?Sn+wn+1:Sn-wn}return rn>en?Sn-(mn-en):Sn+(mn-rn)}function xr(We,xt,Sn){var mn=We.length,rn=xt.length,en,sn;if(mn===0&&rn===0)return null;mn<rn?(en=We,sn=xt):(en=xt,sn=We);var wn={__EMPTY_ITEM__:!0};function Qn(Fn){return Fn!==void 0?Sn(Fn):wn}for(var ye=null,ve=Math.abs(mn-rn)!==1,ne=0;ne<sn.length;ne+=1){var ke=Qn(en[ne]),xn=Qn(sn[ne]);if(ke!==xn){ye=ne,ve=ve||ke!==Qn(sn[ne+1]);break}}return ye===null?null:{index:ye,multiple:ve}}function Mo(We,xt,Sn){var mn=Zt.useState(We),rn=(0,$e.Z)(mn,2),en=rn[0],sn=rn[1],wn=Zt.useState(null),Qn=(0,$e.Z)(wn,2),ye=Qn[0],ve=Qn[1];return Zt.useEffect(function(){var ne=xr(en||[],We||[],xt);(ne==null?void 0:ne.index)!==void 0&&(Sn==null||Sn(ne.index),ve(We[ne.index])),sn(We)},[We]),[ye]}var ao=(typeof navigator=="undefined"?"undefined":(0,Ie.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),$i=ao,Kr=function(We,xt){var Sn=(0,Zt.useRef)(!1),mn=(0,Zt.useRef)(null);function rn(){clearTimeout(mn.current),Sn.current=!0,mn.current=setTimeout(function(){Sn.current=!1},50)}var en=(0,Zt.useRef)({top:We,bottom:xt});return en.current.top=We,en.current.bottom=xt,function(sn){var wn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Qn=sn<0&&en.current.top||sn>0&&en.current.bottom;return wn&&Qn?(clearTimeout(mn.current),Sn.current=!1):(!Qn||Sn.current)&&rn(),!Sn.current&&Qn}};function No(We,xt,Sn,mn,rn){var en=(0,Zt.useRef)(0),sn=(0,Zt.useRef)(null),wn=(0,Zt.useRef)(null),Qn=(0,Zt.useRef)(!1),ye=Kr(xt,Sn);function ve(ge,Ge){vt.cancel(sn.current),en.current+=Ge,wn.current=Ge,!ye(Ge)&&($i||ge.preventDefault(),sn.current=vt(function(){var Bn=Qn.current?10:1;rn(en.current*Bn),en.current=0}))}function ne(ge,Ge){rn(Ge,!0),$i||ge.preventDefault()}var ke=(0,Zt.useRef)(null),xn=(0,Zt.useRef)(null);function Fn(ge){if(We){vt.cancel(xn.current),xn.current=vt(function(){ke.current=null},2);var Ge=ge.deltaX,Bn=ge.deltaY,ri=ge.shiftKey,Qe=Ge,ce=Bn;(ke.current==="sx"||!ke.current&&ri&&Bn&&!Ge)&&(Qe=Bn,ce=0,ke.current="sx");var Tn=Math.abs(Qe),ti=Math.abs(ce);ke.current===null&&(ke.current=mn&&Tn>ti?"x":"y"),ke.current==="y"?ve(ge,ce):ne(ge,Qe)}}function In(ge){We&&(Qn.current=ge.detail===wn.current)}return[Fn,In]}var fr=14/15;function sr(We,xt,Sn){var mn=(0,Zt.useRef)(!1),rn=(0,Zt.useRef)(0),en=(0,Zt.useRef)(null),sn=(0,Zt.useRef)(null),wn,Qn=function(ke){if(mn.current){var xn=Math.ceil(ke.touches[0].pageY),Fn=rn.current-xn;rn.current=xn,Sn(Fn)&&ke.preventDefault(),clearInterval(sn.current),sn.current=setInterval(function(){Fn*=fr,(!Sn(Fn,!0)||Math.abs(Fn)<=.1)&&clearInterval(sn.current)},16)}},ye=function(){mn.current=!1,wn()},ve=function(ke){wn(),ke.touches.length===1&&!mn.current&&(mn.current=!0,rn.current=Math.ceil(ke.touches[0].pageY),en.current=ke.target,en.current.addEventListener("touchmove",Qn),en.current.addEventListener("touchend",ye))};wn=function(){en.current&&(en.current.removeEventListener("touchmove",Qn),en.current.removeEventListener("touchend",ye))},Yt(function(){return We&&xt.current.addEventListener("touchstart",ve),function(){var ne;(ne=xt.current)===null||ne===void 0||ne.removeEventListener("touchstart",ve),wn(),clearInterval(sn.current)}},[We])}var Pr=20;function Vi(){var We=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,xt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Sn=We/xt*100;return isNaN(Sn)&&(Sn=0),Sn=Math.max(Sn,Pr),Sn=Math.min(Sn,We/2),Math.floor(Sn)}function Ir(We,xt,Sn,mn){var rn=Zt.useMemo(function(){return[new Map,[]]},[We,Sn.id,mn]),en=(0,$e.Z)(rn,2),sn=en[0],wn=en[1],Qn=function(ve){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ve,ke=sn.get(ve),xn=sn.get(ne);if(ke===void 0||xn===void 0)for(var Fn=We.length,In=wn.length;In<Fn;In+=1){var ge,Ge=We[In],Bn=xt(Ge);sn.set(Bn,In);var ri=(ge=Sn.get(Bn))!==null&&ge!==void 0?ge:mn;if(wn[In]=(wn[In-1]||0)+ri,Bn===ve&&(ke=In),Bn===ne&&(xn=In),ke!==void 0&&xn!==void 0)break}return{top:wn[ke-1]||0,bottom:wn[xn]}};return Qn}var Ns=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles"],jr=[],Va={overflowY:"auto",overflowAnchor:"none"};function Hs(We,xt){var Sn=We.prefixCls,mn=Sn===void 0?"rc-virtual-list":Sn,rn=We.className,en=We.height,sn=We.itemHeight,wn=We.fullHeight,Qn=wn===void 0?!0:wn,ye=We.style,ve=We.data,ne=We.children,ke=We.itemKey,xn=We.virtual,Fn=We.direction,In=We.scrollWidth,ge=We.component,Ge=ge===void 0?"div":ge,Bn=We.onScroll,ri=We.onVirtualScroll,Qe=We.onVisibleChange,ce=We.innerProps,Tn=We.extraRender,ti=We.styles,Be=(0,re.Z)(We,Ns),qt=!!(xn!==!1&&en&&sn),ae=qt&&ve&&(sn*ve.length>en||!!In),Mn=Fn==="rtl",Gi=Se()(mn,(0,me.Z)({},"".concat(mn,"-rtl"),Mn),rn),Ai=ve||jr,gn=(0,Zt.useRef)(),Ye=(0,Zt.useRef)(),xe=(0,Zt.useState)(0),ei=(0,$e.Z)(xe,2),Si=ei[0],qe=ei[1],Hn=(0,Zt.useState)(0),So=(0,$e.Z)(Hn,2),Bi=So[0],Qi=So[1],he=(0,Zt.useState)(!1),Yn=(0,$e.Z)(he,2),gi=Yn[0],zn=Yn[1],Ri=function(){zn(!0)},hi=function(){zn(!1)},xi=Zt.useCallback(function(bi){return typeof ke=="function"?ke(bi):bi==null?void 0:bi[ke]},[ke]),di={getKey:xi};function Zn(bi){qe(function(Wi){var wo;typeof bi=="function"?wo=bi(Wi):wo=bi;var Zo=ki(wo);return gn.current.scrollTop=Zo,Zo})}var pi=(0,Zt.useRef)({start:0,end:Ai.length}),Pe=(0,Zt.useRef)(),io=Mo(Ai,xi),Fe=(0,$e.Z)(io,1),Dn=Fe[0];Pe.current=Dn;var Hi=ze(xi,null,null),ci=(0,$e.Z)(Hi,4),nr=ci[0],Yi=ci[1],ui=ci[2],Ki=ci[3],zi=Zt.useMemo(function(){if(!qt)return{scrollHeight:void 0,start:0,end:Ai.length-1,offset:void 0};if(!ae){var bi;return{scrollHeight:((bi=Ye.current)===null||bi===void 0?void 0:bi.offsetHeight)||0,start:0,end:Ai.length-1,offset:void 0}}for(var Wi=0,wo,Zo,qn,zo=Ai.length,Rr=0;Rr<zo;Rr+=1){var ds=Ai[Rr],fu=xi(ds),Ul=ui.get(fu),En=Wi+(Ul===void 0?sn:Ul);En>=Si&&wo===void 0&&(wo=Rr,Zo=Wi),En>Si+en&&qn===void 0&&(qn=Rr),Wi=En}return wo===void 0&&(wo=0,Zo=0,qn=Math.ceil(en/sn)),qn===void 0&&(qn=Ai.length-1),qn=Math.min(qn+1,Ai.length-1),{scrollHeight:Wi,start:wo,end:qn,offset:Zo}},[ae,qt,Si,Ai,Ki,en]),Ci=zi.scrollHeight,ln=zi.start,It=zi.end,mo=zi.offset;pi.current.start=ln,pi.current.end=It;var xs=Zt.useState({width:0,height:en}),ta=(0,$e.Z)(xs,2),Ps=ta[0],al=ta[1],Ua=function(Wi){al({width:Wi.width||Wi.offsetWidth,height:Wi.height||Wi.offsetHeight})},Wl=(0,Zt.useRef)(),Pl=(0,Zt.useRef)(),Po=Zt.useMemo(function(){return Vi(Ps.width,In)},[Ps.width,In]),Jo=Zt.useMemo(function(){return Vi(Ps.height,Ci)},[Ps.height,Ci]),ai=Ci-en,ii=(0,Zt.useRef)(ai);ii.current=ai;function ki(bi){var Wi=bi;return Number.isNaN(ii.current)||(Wi=Math.min(Wi,ii.current)),Wi=Math.max(Wi,0),Wi}var Ke=Si<=0,oo=Si>=ai,vo=Kr(Ke,oo),Xo=function(){return{x:Mn?-Bi:Bi,y:Si}},Eo=(0,Zt.useRef)(Xo()),Ro=jt(function(){if(ri){var bi=Xo();(Eo.current.x!==bi.x||Eo.current.y!==bi.y)&&(ri(bi),Eo.current=bi)}});function ar(bi,Wi){var wo=bi;Wi?((0,Oe.flushSync)(function(){Qi(wo)}),Ro()):Zn(wo)}function hs(bi){var Wi=bi.currentTarget.scrollTop;Wi!==Si&&Zn(Wi),Bn==null||Bn(bi),Ro()}var Tr=function(Wi){var wo=Wi,Zo=In-Ps.width;return wo=Math.max(wo,0),wo=Math.min(wo,Zo),wo},Ya=jt(function(bi,Wi){Wi?((0,Oe.flushSync)(function(){Qi(function(wo){var Zo=wo+(Mn?-bi:bi);return Tr(Zo)})}),Ro()):Zn(function(wo){var Zo=wo+bi;return Zo})}),Na=No(qt,Ke,oo,!!In,Ya),pe=(0,$e.Z)(Na,2),Vo=pe[0],ba=pe[1];sr(qt,gn,function(bi,Wi){return vo(bi,Wi)?!1:(Vo({preventDefault:function(){},deltaY:bi}),!0)}),Yt(function(){function bi(wo){qt&&wo.preventDefault()}var Wi=gn.current;return Wi.addEventListener("wheel",Vo),Wi.addEventListener("DOMMouseScroll",ba),Wi.addEventListener("MozMousePixelScroll",bi),function(){Wi.removeEventListener("wheel",Vo),Wi.removeEventListener("DOMMouseScroll",ba),Wi.removeEventListener("MozMousePixelScroll",bi)}},[qt]),Yt(function(){In&&Qi(function(bi){return Tr(bi)})},[Ps.width,In]);var Ka=function(){var Wi,wo;(Wi=Wl.current)===null||Wi===void 0||Wi.delayHidden(),(wo=Pl.current)===null||wo===void 0||wo.delayHidden()},Io=Ui(gn,Ai,ui,sn,xi,function(){return Yi(!0)},Zn,Ka);Zt.useImperativeHandle(xt,function(){return{getScrollInfo:Xo,scrollTo:function(Wi){function wo(Zo){return Zo&&(0,Ie.Z)(Zo)==="object"&&("left"in Zo||"top"in Zo)}wo(Wi)?(Wi.left!==void 0&&Qi(Tr(Wi.left)),Io(Wi.top)):Io(Wi)}}}),Yt(function(){if(Qe){var bi=Ai.slice(ln,It+1);Qe(bi,Ai)}},[ln,It,Ai]);var Vs=Ir(Ai,xi,ui,sn),Vl=Tn==null?void 0:Tn({start:ln,end:It,virtual:ae,offsetX:Bi,offsetY:mo,rtl:Mn,getSize:Vs}),wl=$t(Ai,ln,It,In,nr,ne,di),yo=null;en&&(yo=(0,de.Z)((0,me.Z)({},Qn?"height":"maxHeight",en),Va),qt&&(yo.overflowY="hidden",In&&(yo.overflowX="hidden"),gi&&(yo.pointerEvents="none")));var lr={};return Mn&&(lr.dir="rtl"),Zt.createElement("div",(0,St.Z)({style:(0,de.Z)((0,de.Z)({},ye),{},{position:"relative"}),className:Gi},lr,Be),Zt.createElement(Ue.Z,{onResize:Ua},Zt.createElement(Ge,{className:"".concat(mn,"-holder"),style:yo,ref:gn,onScroll:hs,onMouseEnter:Ka},Zt.createElement(Ze,{prefixCls:mn,height:Ci,offsetX:Bi,offsetY:mo,scrollWidth:In,onInnerResize:Yi,ref:Ye,innerProps:ce,rtl:Mn,extra:Vl},wl))),ae&&Ci>en&&Zt.createElement(zt,{ref:Wl,prefixCls:mn,scrollOffset:Si,scrollRange:Ci,rtl:Mn,onScroll:ar,onStartMove:Ri,onStopMove:hi,spinSize:Jo,containerSize:Ps.height,style:ti==null?void 0:ti.verticalScrollBar,thumbStyle:ti==null?void 0:ti.verticalScrollBarThumb}),ae&&In&&Zt.createElement(zt,{ref:Pl,prefixCls:mn,scrollOffset:Bi,scrollRange:In,rtl:Mn,onScroll:ar,onStartMove:Ri,onStopMove:hi,spinSize:Po,containerSize:Ps.width,horizontal:!0,style:ti==null?void 0:ti.horizontalScrollBar,thumbStyle:ti==null?void 0:ti.horizontalScrollBarThumb}))}var Ws=Zt.forwardRef(Hs);Ws.displayName="List";var gr=Ws,Ti=gr},66392:function(tn,An){"use strict";var Kt;var St=Symbol.for("react.element"),de=Symbol.for("react.portal"),Ie=Symbol.for("react.fragment"),$e=Symbol.for("react.strict_mode"),me=Symbol.for("react.profiler"),re=Symbol.for("react.provider"),Zt=Symbol.for("react.context"),Oe=Symbol.for("react.server_context"),ue=Symbol.for("react.forward_ref"),Se=Symbol.for("react.suspense"),Ue=Symbol.for("react.suspense_list"),Ee=Symbol.for("react.memo"),Ze=Symbol.for("react.lazy"),Ft=Symbol.for("react.offscreen"),et;et=Symbol.for("react.module.reference");function nt(ct){if(typeof ct=="object"&&ct!==null){var lt=ct.$$typeof;switch(lt){case St:switch(ct=ct.type,ct){case Ie:case me:case $e:case Se:case Ue:return ct;default:switch(ct=ct&&ct.$$typeof,ct){case Oe:case Zt:case ue:case Ze:case Ee:case re:return ct;default:return lt}}case de:return lt}}}Kt=Zt,Kt=re,Kt=St,Kt=ue,Kt=Ie,Kt=Ze,Kt=Ee,Kt=de,Kt=me,Kt=$e,Kt=Se,Kt=Ue,Kt=function(){return!1},Kt=function(){return!1},Kt=function(ct){return nt(ct)===Zt},Kt=function(ct){return nt(ct)===re},Kt=function(ct){return typeof ct=="object"&&ct!==null&&ct.$$typeof===St},Kt=function(ct){return nt(ct)===ue},Kt=function(ct){return nt(ct)===Ie},Kt=function(ct){return nt(ct)===Ze},Kt=function(ct){return nt(ct)===Ee},Kt=function(ct){return nt(ct)===de},Kt=function(ct){return nt(ct)===me},Kt=function(ct){return nt(ct)===$e},Kt=function(ct){return nt(ct)===Se},Kt=function(ct){return nt(ct)===Ue},Kt=function(ct){return typeof ct=="string"||typeof ct=="function"||ct===Ie||ct===me||ct===$e||ct===Se||ct===Ue||ct===Ft||typeof ct=="object"&&ct!==null&&(ct.$$typeof===Ze||ct.$$typeof===Ee||ct.$$typeof===re||ct.$$typeof===Zt||ct.$$typeof===ue||ct.$$typeof===et||ct.getModuleId!==void 0)},Kt=nt},31461:function(tn,An,Kt){"use strict";Kt(66392)},57761:function(tn,An,Kt){"use strict";Object.defineProperty(An,"__esModule",{value:!0});var St=function(){function Ee(Ze,Ft){for(var et=0;et<Ft.length;et++){var nt=Ft[et];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(Ze,nt.key,nt)}}return function(Ze,Ft,et){return Ft&&Ee(Ze.prototype,Ft),et&&Ee(Ze,et),Ze}}(),de=Kt(67294),Ie=re(de),$e=Kt(45697),me=re($e);function re(Ee){return Ee&&Ee.__esModule?Ee:{default:Ee}}function Zt(Ee,Ze){var Ft={};for(var et in Ee)Ze.indexOf(et)>=0||Object.prototype.hasOwnProperty.call(Ee,et)&&(Ft[et]=Ee[et]);return Ft}function Oe(Ee,Ze){if(!(Ee instanceof Ze))throw new TypeError("Cannot call a class as a function")}function ue(Ee,Ze){if(!Ee)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ze&&(typeof Ze=="object"||typeof Ze=="function")?Ze:Ee}function Se(Ee,Ze){if(typeof Ze!="function"&&Ze!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Ze);Ee.prototype=Object.create(Ze&&Ze.prototype,{constructor:{value:Ee,enumerable:!1,writable:!0,configurable:!0}}),Ze&&(Object.setPrototypeOf?Object.setPrototypeOf(Ee,Ze):Ee.__proto__=Ze)}var Ue=function(Ee){Se(Ze,Ee);function Ze(Ft){Oe(this,Ze);var et=ue(this,(Ze.__proto__||Object.getPrototypeOf(Ze)).call(this,Ft));return et.scrollListener=et.scrollListener.bind(et),et.eventListenerOptions=et.eventListenerOptions.bind(et),et.mousewheelListener=et.mousewheelListener.bind(et),et}return St(Ze,[{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,Ct=nt.isReverse,Nt=nt.loader,zt=nt.loadMore,Ht=nt.pageStart,$t=nt.ref,ee=nt.threshold,te=nt.useCapture,Ae=nt.useWindow,se=nt.getScrollParent,Re=Zt(nt,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);Re.ref=function(ze){et.scrollComponent=ze,$t&&$t(ze)};var He=[ct];return pt&&(Nt?Ct?He.unshift(Nt):He.push(Nt):this.defaultLoader&&(Ct?He.unshift(this.defaultLoader):He.push(this.defaultLoader))),Ie.default.createElement(lt,Re,He)}}]),Ze}(de.Component);Ue.propTypes={children:me.default.node.isRequired,element:me.default.node,hasMore:me.default.bool,initialLoad:me.default.bool,isReverse:me.default.bool,loader:me.default.node,loadMore:me.default.func.isRequired,pageStart:me.default.number,ref:me.default.func,getScrollParent:me.default.func,threshold:me.default.number,useCapture:me.default.bool,useWindow:me.default.bool},Ue.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},An.default=Ue,tn.exports=An.default},246:function(tn,An,Kt){tn.exports=Kt(57761)},4977:function(tn){"use strict";tn.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(tn){"use strict";tn.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(tn){"use strict";tn.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(tn){"use strict";tn.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="},17423:function(tn,An,Kt){"use strict";Kt.d(An,{Z:function(){return Oe}});const St=ue=>typeof ue=="object"&&ue!=null&&ue.nodeType===1,de=(ue,Se)=>(!Se||ue!=="hidden")&&ue!=="visible"&&ue!=="clip",Ie=(ue,Se)=>{if(ue.clientHeight<ue.scrollHeight||ue.clientWidth<ue.scrollWidth){const Ue=getComputedStyle(ue,null);return de(Ue.overflowY,Se)||de(Ue.overflowX,Se)||(Ee=>{const Ze=(Ft=>{if(!Ft.ownerDocument||!Ft.ownerDocument.defaultView)return null;try{return Ft.ownerDocument.defaultView.frameElement}catch(et){return null}})(Ee);return!!Ze&&(Ze.clientHeight<Ee.scrollHeight||Ze.clientWidth<Ee.scrollWidth)})(ue)}return!1},$e=(ue,Se,Ue,Ee,Ze,Ft,et,nt)=>Ft<ue&&et>Se||Ft>ue&&et<Se?0:Ft<=ue&&nt<=Ue||et>=Se&&nt>=Ue?Ft-ue-Ee:et>Se&&nt<Ue||Ft<ue&&nt>Ue?et-Se+Ze:0,me=ue=>{const Se=ue.parentElement;return Se==null?ue.getRootNode().host||null:Se},re=(ue,Se)=>{var Ue,Ee,Ze,Ft;if(typeof document=="undefined")return[];const{scrollMode:et,block:nt,inline:ct,boundary:lt,skipOverflowHiddenElements:pt}=Se,vt=typeof lt=="function"?lt:Ln=>Ln!==lt;if(!St(ue))throw new TypeError("Invalid target");const Ct=document.scrollingElement||document.documentElement,Nt=[];let zt=ue;for(;St(zt)&&vt(zt);){if(zt=me(zt),zt===Ct){Nt.push(zt);break}zt!=null&&zt===document.body&&Ie(zt)&&!Ie(document.documentElement)||zt!=null&&Ie(zt,pt)&&Nt.push(zt)}const Ht=(Ee=(Ue=window.visualViewport)==null?void 0:Ue.width)!=null?Ee:innerWidth,$t=(Ft=(Ze=window.visualViewport)==null?void 0:Ze.height)!=null?Ft:innerHeight,{scrollX:ee,scrollY:te}=window,{height:Ae,width:se,top:Re,right:He,bottom:ze,left:Cn}=ue.getBoundingClientRect(),{top:Rn,right:Xn,bottom:Ni,left:Yt}=(Ln=>{const Le=window.getComputedStyle(Ln);return{top:parseFloat(Le.scrollMarginTop)||0,right:parseFloat(Le.scrollMarginRight)||0,bottom:parseFloat(Le.scrollMarginBottom)||0,left:parseFloat(Le.scrollMarginLeft)||0}})(ue);let jt=nt==="start"||nt==="nearest"?Re-Rn:nt==="end"?ze+Ni:Re+Ae/2-Rn+Ni,Ce=ct==="center"?Cn+se/2-Yt+Xn:ct==="end"?He+Xn:Cn-Yt;const un=[];for(let Ln=0;Ln<Nt.length;Ln++){const Le=Nt[Ln],{height:nn,width:hn,top:_n,right:fn,bottom:le,left:we}=Le.getBoundingClientRect();if(et==="if-needed"&&Re>=0&&Cn>=0&&ze<=$t&&He<=Ht&&Re>=_n&&ze<=le&&Cn>=we&&He<=fn)return un;const Pn=getComputedStyle(Le),vn=parseInt(Pn.borderLeftWidth,10),_t=parseInt(Pn.borderTopWidth,10),Mt=parseInt(Pn.borderRightWidth,10),Lt=parseInt(Pn.borderBottomWidth,10);let At=0,Wt=0;const Et="offsetWidth"in Le?Le.offsetWidth-Le.clientWidth-vn-Mt:0,be="offsetHeight"in Le?Le.offsetHeight-Le.clientHeight-_t-Lt:0,Nn="offsetWidth"in Le?Le.offsetWidth===0?0:hn/Le.offsetWidth:0,mi="offsetHeight"in Le?Le.offsetHeight===0?0:nn/Le.offsetHeight:0;if(Ct===Le)At=nt==="start"?jt:nt==="end"?jt-$t:nt==="nearest"?$e(te,te+$t,$t,_t,Lt,te+jt,te+jt+Ae,Ae):jt-$t/2,Wt=ct==="start"?Ce:ct==="center"?Ce-Ht/2:ct==="end"?Ce-Ht:$e(ee,ee+Ht,Ht,vn,Mt,ee+Ce,ee+Ce+se,se),At=Math.max(0,At+te),Wt=Math.max(0,Wt+ee);else{At=nt==="start"?jt-_n-_t:nt==="end"?jt-le+Lt+be:nt==="nearest"?$e(_n,le,nn,_t,Lt+be,jt,jt+Ae,Ae):jt-(_n+nn/2)+be/2,Wt=ct==="start"?Ce-we-vn:ct==="center"?Ce-(we+hn/2)+Et/2:ct==="end"?Ce-fn+Mt+Et:$e(we,fn,hn,vn,Mt+Et,Ce,Ce+se,se);const{scrollLeft:On,scrollTop:Gn}=Le;At=mi===0?0:Math.max(0,Math.min(Gn+At/mi,Le.scrollHeight-nn/mi+be)),Wt=Nn===0?0:Math.max(0,Math.min(On+Wt/Nn,Le.scrollWidth-hn/Nn+Et)),jt+=Gn-At,Ce+=On-Wt}un.push({el:Le,top:At,left:Wt})}return un},Zt=ue=>ue===!1?{block:"end",inline:"nearest"}:(Se=>Se===Object(Se)&&Object.keys(Se).length!==0)(ue)?ue:{block:"start",inline:"nearest"};function Oe(ue,Se){if(!ue.isConnected||!(Ze=>{let Ft=Ze;for(;Ft&&Ft.parentNode;){if(Ft.parentNode===document)return!0;Ft=Ft.parentNode instanceof ShadowRoot?Ft.parentNode.host:Ft.parentNode}return!1})(ue))return;const Ue=(Ze=>{const Ft=window.getComputedStyle(Ze);return{top:parseFloat(Ft.scrollMarginTop)||0,right:parseFloat(Ft.scrollMarginRight)||0,bottom:parseFloat(Ft.scrollMarginBottom)||0,left:parseFloat(Ft.scrollMarginLeft)||0}})(ue);if((Ze=>typeof Ze=="object"&&typeof Ze.behavior=="function")(Se))return Se.behavior(re(ue,Se));const Ee=typeof Se=="boolean"||Se==null?void 0:Se.behavior;for(const{el:Ze,top:Ft,left:et}of re(ue,Zt(Se))){const nt=Ft-Ue.top+Ue.bottom,ct=et-Ue.left+Ue.right;Ze.scroll({top:nt,left:ct,behavior:Ee})}}}}]);