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

1176 lines
2.1 MiB

(self.webpackChunk=self.webpackChunk||[]).push([[337],{8336:function(){"use strict"},12469:function(){"use strict"},99587:function(Mn,Rn){"use strict";Rn.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},8423:function(Mn,Rn){"use strict";Rn.Z={wrap:"wrap___ilWvf",deleteIcon:"deleteIcon___JBDG8",keywordTag:"keywordTag___iieCb",questionTitleEditorWrap:"questionTitleEditorWrap___MHB5s",choiceListWrap:"choiceListWrap___jB8b1",choiceWrap:"choiceWrap___QFkTc",choiceIndex:"choiceIndex___Mr2YO",judgementIndex:"judgementIndex___fUVWK",setAnswerBtn:"setAnswerBtn___Whox5",activeAnswer:"activeAnswer___fGU6Y",activeJudgementAnswer:"activeJudgementAnswer___wJv8P",actionWrapper:"actionWrapper___ERQ7k",addIcon:"addIcon___L9TE0",inputBorder:"inputBorder___Q5tRE",placeholder:"placeholder___p9sFY",blankInputNumberWrapper:"blankInputNumberWrapper___uEHb0",addBtn:"addBtn___WR5ZI",blankIndex:"blankIndex___x9Pny",baseInputWrapper:"baseInputWrapper___eVsG7",collapseWrapper:"collapseWrapper___ZTysU",panelHeader:"panelHeader___QSN9g",open:"open___B6FU9",close:"close___QX19r",hide:"hide___mn25n"}},12327:function(Mn,Rn,kt){"use strict";var gt=kt(59301),Ut=Object.defineProperty,ue=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable,Dt=(Qt,jt,Ae)=>jt in Qt?Ut(Qt,jt,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):Qt[jt]=Ae,ee=(Qt,jt)=>{for(var Ae in jt||(jt={}))Ee.call(jt,Ae)&&Dt(Qt,Ae,jt[Ae]);if(ue)for(var Ae of ue(jt))he.call(jt,Ae)&&Dt(Qt,Ae,jt[Ae]);return Qt};const ge=Qt=>React.createElement("svg",ee({width:14,height:14,xmlns:"http://www.w3.org/2000/svg"},Qt),React.createElement("title",null,"\u7F16\u7EC4 18"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("circle",{fill:"#FCB041",cx:7,cy:7,r:7}),React.createElement("path",{d:"M7.531 9.638a.616.616 0 1 1-1.231 0v-.02a.616.616 0 1 1 1.231 0v.02Zm0-2.25a.616.616 0 1 1-1.231 0V4.117a.616.616 0 1 1 1.231 0v3.273Z",fill:"#FFF",fillRule:"nonzero"})));Rn.Z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGQ0IwNDEiIGN4PSI3IiBjeT0iNyIgcj0iNyIvPjxwYXRoIGQ9Ik03LjUzMSA5LjYzOGEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwdi0uMDJhLjYxNi42MTYgMCAxIDEgMS4yMzEgMHYuMDJabTAtMi4yNWEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwVjQuMTE3YS42MTYuNjE2IDAgMSAxIDEuMjMxIDB2My4yNzNaIiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+"},63720:function(){"use strict";function Mn(Bt,nt,et,ht){et===void 0&&(et=0),ht===void 0&&(ht=1/0),this._name=Bt,this._defaultValue=nt,this._minimum=et,this._maximum=ht}Object.defineProperty(Mn.prototype,"name",{get:function(){return this._name},set:function(Bt){if(typeof Bt!="string"||Bt==="")throw new Error("Shape name must be a valid string.");this._name=Bt}}),Object.defineProperty(Mn.prototype,"defaultValue",{get:function(){return this._defaultValue},set:function(Bt){if(typeof Bt!="number"||isNaN(Bt))throw new Error("The default value must be a real number, not: "+Bt);this._defaultValue=Bt}}),Object.defineProperty(Mn.prototype,"minimum",{get:function(){return this._minimum},set:function(Bt){if(typeof Bt!="number"||isNaN(Bt))throw new Error("Minimum must be a real number, not: "+Bt);this._minimum=Bt}}),Object.defineProperty(Mn.prototype,"maximum",{get:function(){return this._maximum},set:function(Bt){if(typeof Bt!="number"||isNaN(Bt))throw new Error("Maximum must be a real number, not: "+Bt);this._maximum=Bt}}),go.Shape._FigureParameters={},go.Shape.getFigureParameter=function(Bt,nt){var et=go.Shape._FigureParameters[Bt];return et?et[nt]:null},go.Shape.setFigureParameter=function(Bt,nt,et){if(!(et instanceof Mn))throw new Error("Third argument to Shape.setFigureParameter is not FigureParameter: "+et);if(et.defaultValue<et.minimum||et.defaultValue>et.maximum)throw new Error("defaultValue must be between minimum and maximum, not: "+et.defaultValue);var ht=go.Shape._FigureParameters[Bt];ht||(ht=[],go.Shape._FigureParameters[Bt]=ht),ht[nt]=et};var Rn=[];function kt(Bt,nt){var et=Rn.pop();return et===void 0?new go.Point(Bt,nt):(et.x=Bt,et.y=nt,et)}function gt(){var Bt=Rn.pop();return Bt===void 0?new go.Point:Bt}function Ut(Bt){Rn.push(Bt)}function ue(Bt,nt,et,ht,st,pt,vt,St,Et){Et||(Et=new go.Point);var Tt=Bt-et,It=st-vt,qt=NaN,Xt=NaN;if(Tt===0)if(It===0)Bt===et&&(qt=Bt,Xt=nt);else{var Ht=(pt-St)/It,pe=pt-Ht*st;qt=Bt,Xt=Ht*qt+pe}else if(It===0){var re=(nt-ht)/Tt,Ne=nt-re*Bt;qt=st,Xt=re*qt+Ne}else{var re=(nt-ht)/Tt,Ht=(pt-St)/It,Ne=nt-re*Bt,pe=pt-Ht*st;qt=(pe-Ne)/(re-Ht),Xt=re*qt+Ne}return Et.x=qt,Et.y=Xt,Et}function Ee(Bt,nt,et,ht,st,pt,vt,St,Et,Tt,It,qt,Xt,Ht){var pe=1-Et,re=Et,Ne=Bt*pe+et*re,ye=nt*pe+ht*re,xe=et*pe+st*re,Ue=ht*pe+pt*re,je=st*pe+vt*re,Je=pt*pe+St*re,fn=Ne*pe+xe*re,te=ye*pe+Ue*re,Jt=xe*pe+je*re,Xe=Ue*pe+Je*re,On=fn*pe+Jt*re,bn=te*pe+Xe*re;Tt.x=Ne,Tt.y=ye,It.x=fn,It.y=te,qt.x=On,qt.y=bn,Xt.x=Jt,Xt.y=Xe,Ht.x=je,Ht.y=Je}var he=new go.Spot(.156,.156),Dt=new go.Spot(.844,.844),ee=4*((Math.sqrt(2)-1)/3);go.Shape.setFigureParameter("RoundedRectangle",0,new Mn("CornerRounding",5)),go.Shape.defineFigureGenerator("RoundedRectangle",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=5),ht=Math.min(ht,nt/3),ht=Math.min(ht,et/3);var st=ht*ee,pt=new go.Geometry().add(new go.PathFigure(ht,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt-ht,0)).add(new go.PathSegment(go.PathSegment.Bezier,nt,ht,nt-st,0,nt,st)).add(new go.PathSegment(go.PathSegment.Line,nt,et-ht)).add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,et-st,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,ht,et)).add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,st,et,0,et-st)).add(new go.PathSegment(go.PathSegment.Line,0,ht)).add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,st,st,0).close()));return st>1&&(pt.spot1=new go.Spot(0,0,st,st),pt.spot2=new go.Spot(1,1,-st,-st)),pt}),go.Shape.defineFigureGenerator("Border","RoundedRectangle"),go.Shape.defineFigureGenerator("TriangleRight",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())).setSpots(0,.25,.5,.75)}),go.Shape.defineFigureGenerator("TriangleDown",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et).close())).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("TriangleLeft",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,et).add(new go.PathSegment(go.PathSegment.Line,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,0).close())).setSpots(.5,.25,1,.75)}),go.Shape.defineFigureGenerator("TriangleUp",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,et).add(new go.PathSegment(go.PathSegment.Line,0,et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,0).close())).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("Triangle","TriangleUp"),go.Shape.defineFigureGenerator("Diamond",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.5*nt,0).add(new go.PathSegment(go.PathSegment.Line,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et).close())).setSpots(.25,.25,.75,.75)}),go.Shape.defineFigureGenerator("LineH",function(Bt,nt,et){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=0,ht.startY=et/2,ht.endX=nt,ht.endY=et/2,ht}),go.Shape.defineFigureGenerator("LineV",function(Bt,nt,et){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=nt/2,ht.startY=0,ht.endX=nt/2,ht.endY=et,ht}),go.Shape.defineFigureGenerator("BarH","Rectangle"),go.Shape.defineFigureGenerator("BarV","Rectangle"),go.Shape.defineFigureGenerator("MinusLine","LineH"),go.Shape.defineFigureGenerator("PlusLine",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,et/2,!1).add(new go.PathSegment(go.PathSegment.Line,nt,et/2)).add(new go.PathSegment(go.PathSegment.Move,nt/2,0)).add(new go.PathSegment(go.PathSegment.Line,nt/2,et)))}),go.Shape.defineFigureGenerator("XLine",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,et,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Move,0,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)))}),go.Shape.defineFigureGenerator("LineRight",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.25*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,.75*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.25*nt,et)))}),go.Shape.defineFigureGenerator("LineDown",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,.25*et,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,.75*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)))}),go.Shape.defineFigureGenerator("LineLeft",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.75*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,.25*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.75*nt,et)))}),go.Shape.defineFigureGenerator("LineUp",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,.75*et,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,.25*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)))}),go.Shape.defineFigureGenerator("AsteriskLine",function(Bt,nt,et){var ht=.2/Math.SQRT2;return new go.Geometry().add(new go.PathFigure(ht*nt,(1-ht)*et,!1).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Move,ht*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,(1-ht)*et)).add(new go.PathSegment(go.PathSegment.Move,0,et/2)).add(new go.PathSegment(go.PathSegment.Line,nt,et/2)).add(new go.PathSegment(go.PathSegment.Move,nt/2,0)).add(new go.PathSegment(go.PathSegment.Line,nt/2,et)))}),go.Shape.defineFigureGenerator("CircleLine",function(Bt,nt,et){var ht=nt/2,st=new go.Geometry().add(new go.PathFigure(nt,nt/2,!1).add(new go.PathSegment(go.PathSegment.Arc,0,360,ht,ht,ht,ht).close()));return st.spot1=he,st.spot2=Dt,st.defaultStretch=go.GraphObject.Uniform,st}),go.Shape.defineFigureGenerator("Line1",function(Bt,nt,et){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=0,ht.startY=0,ht.endX=nt,ht.endY=et,ht}),go.Shape.defineFigureGenerator("Line2",function(Bt,nt,et){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=nt,ht.startY=0,ht.endX=0,ht.endY=et,ht}),go.Shape.defineFigureGenerator("Curve1",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,nt,et,ee*nt,0,nt,(1-ee)*et)))}),go.Shape.defineFigureGenerator("Curve2",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,nt,et,0,ee*et,(1-ee)*nt,et)))}),go.Shape.defineFigureGenerator("Curve3",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,et,nt,ee*et,ee*nt,et)))}),go.Shape.defineFigureGenerator("Curve4",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,et,(1-ee)*nt,0,0,(1-ee)*et)))}),go.Shape.defineFigureGenerator("TriangleDownLeft",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())).setSpots(0,.5,.5,1)}),go.Shape.defineFigureGenerator("TriangleDownRight",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())).setSpots(.5,.5,1,1)}),go.Shape.defineFigureGenerator("TriangleUpLeft",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())).setSpots(0,0,.5,.5)}),go.Shape.defineFigureGenerator("TriangleUpRight",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et).close())).setSpots(.5,0,1,.5)}),go.Shape.defineFigureGenerator("RightTriangle","TriangleDownLeft"),go.Shape.setFigureParameter("Parallelogram1",0,new Mn("Indent",.1,-.99,.99)),go.Shape.defineFigureGenerator("Parallelogram1",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=.1:ht<-1?ht=-1:ht>1&&(ht=1);var st=Math.abs(ht)*nt;if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())),st<nt/2&&pt.setSpots(st/nt,0,(nt-st)/nt,1),pt}}),go.Shape.defineFigureGenerator("Parallelogram","Parallelogram1"),go.Shape.setFigureParameter("Parallelogram2",0,new Mn("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("Parallelogram2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=10:ht<-nt?ht=-nt:ht>nt&&(ht=nt);var st=Math.abs(ht);if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())),st<nt/2&&pt.setSpots(st/nt,0,(nt-st)/nt,1),pt}}),go.Shape.setFigureParameter("Trapezoid1",0,new Mn("Indent",.2,-.99,.99)),go.Shape.defineFigureGenerator("Trapezoid1",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=.2:ht<.5?ht=-.5:ht>.5&&(ht=.5);var st=Math.abs(ht)*nt;if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())),st<nt/2&&pt.setSpots(st/nt,0,(nt-st)/nt,1),pt}}),go.Shape.defineFigureGenerator("Trapezoid","Trapezoid1"),go.Shape.setFigureParameter("Trapezoid2",0,new Mn("Indent",20,-1/0,1/0)),go.Shape.defineFigureGenerator("Trapezoid2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=20:ht<-nt?ht=-nt/2:ht>nt&&(ht=nt/2);var st=Math.abs(ht);if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())),st<nt/2&&pt.setSpots(st/nt,0,(nt-st)/nt,1),pt}}),go.Shape.setFigureParameter("ManualOperation",0,new Mn("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("ManualOperation",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=10:ht<-nt?ht=-nt/2:ht>nt&&(ht=nt/2);var st=Math.abs(ht);if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())):pt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())),st<nt/2&&pt.setSpots(st/nt,0,(nt-st)/nt,1),pt}});var ge=[];function Qt(){var Bt=ge.pop();return Bt===void 0?[]:Bt}function jt(Bt){Bt.length=0,ge.push(Bt)}function Ae(Bt){for(var nt=Qt(),et=.5,ht=.5,st=Math.PI*1.5,pt=0,vt=0;vt<Bt;vt++)pt=2*Math.PI/Bt*vt+st,nt[vt]=new go.Point(ht+et*Math.cos(pt),ht+et*Math.sin(pt));return nt.push(nt[0]),nt}function se(Bt){var nt=Pe(Bt),et=Qt();et[0]=nt[0];for(var ht=1,st=1;ht<nt.length;ht+=2,st+=3)et[st]=nt[ht],et[st+1]=nt[ht],et[st+2]=nt[ht+1];return jt(nt),et}function Pe(Bt){for(var nt=Ae(Bt),et=Qt(),ht=Math.floor(nt.length/2),st=nt.length-1,pt=Bt%2===0?2:1,vt=0;vt<st;vt++){var St=nt[vt],Et=nt[vt+1],Tt=nt[(ht+vt-1)%st],It=nt[(ht+vt+pt)%st];et[vt*2]=St,et[vt*2+1]=ue(St.x,St.y,Tt.x,Tt.y,Et.x,Et.y,It.x,It.y,new go.Point)}return et[et.length]=et[0],jt(nt),et}go.Shape.defineFigureGenerator("Pentagon",function(Bt,nt,et){var ht=Ae(5),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<5;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.2,.22),st.spot2=new go.Spot(.8,.9),st}),go.Shape.defineFigureGenerator("Hexagon",function(Bt,nt,et){var ht=Ae(6),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<6;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.07,.25),st.spot2=new go.Spot(.93,.75),st}),go.Shape.defineFigureGenerator("Heptagon",function(Bt,nt,et){var ht=Ae(7),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<7;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.2,.15),st.spot2=new go.Spot(.8,.85),st}),go.Shape.defineFigureGenerator("Octagon",function(Bt,nt,et){var ht=Ae(8),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<8;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.15,.15),st.spot2=new go.Spot(.85,.85),st}),go.Shape.defineFigureGenerator("Nonagon",function(Bt,nt,et){var ht=Ae(9),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<9;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.17,.13),st.spot2=new go.Spot(.82,.82),st}),go.Shape.defineFigureGenerator("Decagon",function(Bt,nt,et){var ht=Ae(10),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<10;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.16,.16),st.spot2=new go.Spot(.84,.84),st}),go.Shape.defineFigureGenerator("Dodecagon",function(Bt,nt,et){var ht=Ae(12),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<12;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.16,.16),st.spot2=new go.Spot(.84,.84),st}),go.Shape.defineFigureGenerator("FivePointedStar",function(Bt,nt,et){var ht=Pe(5),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<10;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.266,.333),st.spot2=new go.Spot(.733,.733),st}),go.Shape.defineFigureGenerator("SixPointedStar",function(Bt,nt,et){var ht=Pe(6),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<12;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.17,.25),st.spot2=new go.Spot(.83,.75),st}),go.Shape.defineFigureGenerator("SevenPointedStar",function(Bt,nt,et){var ht=Pe(7),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<14;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.222,.277),st.spot2=new go.Spot(.777,.666),st}),go.Shape.defineFigureGenerator("EightPointedStar",function(Bt,nt,et){var ht=Pe(8),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<16;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.25,.25),st.spot2=new go.Spot(.75,.75),st}),go.Shape.defineFigureGenerator("NinePointedStar",function(Bt,nt,et){var ht=Pe(9),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<18;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.222,.277),st.spot2=new go.Spot(.777,.666),st}),go.Shape.defineFigureGenerator("TenPointedStar",function(Bt,nt,et){var ht=Pe(10),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<20;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.281,.261),st.spot2=new go.Spot(.723,.748),st}),go.Shape.defineFigureGenerator("FivePointedBurst",function(Bt,nt,et){var ht=se(5),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),jt(ht),st.spot1=new go.Spot(.222,.277),st.spot2=new go.Spot(.777,.777),st}),go.Shape.defineFigureGenerator("SixPointedBurst",function(Bt,nt,et){var ht=se(6),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),jt(ht),st.spot1=new go.Spot(.17,.222),st.spot2=new go.Spot(.833,.777),st}),go.Shape.defineFigureGenerator("SevenPointedBurst",function(Bt,nt,et){var ht=se(7),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),jt(ht),st.spot1=new go.Spot(.222,.222),st.spot2=new go.Spot(.777,.777),st}),go.Shape.defineFigureGenerator("EightPointedBurst",function(Bt,nt,et){var ht=se(8),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),jt(ht),st.spot1=new go.Spot(.222,.222),st.spot2=new go.Spot(.777,.777),st}),go.Shape.defineFigureGenerator("NinePointedBurst",function(Bt,nt,et){var ht=se(9),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),jt(ht),st.spot1=new go.Spot(.222,.222),st.spot2=new go.Spot(.777,.777),st}),go.Shape.defineFigureGenerator("TenPointedBurst",function(Bt,nt,et){var ht=se(10),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),jt(ht),st.spot1=new go.Spot(.222,.222),st.spot2=new go.Spot(.777,.777),st}),go.Shape.setFigureParameter("FramedRectangle",0,new Mn("ThicknessX",8)),go.Shape.setFigureParameter("FramedRectangle",1,new Mn("ThicknessY",8)),go.Shape.defineFigureGenerator("FramedRectangle",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN,st=Bt?Bt.parameter2:NaN;isNaN(ht)&&(ht=8),isNaN(st)&&(st=8);var pt=new go.Geometry,vt=new go.PathFigure(0,0,!0);return pt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht<nt/2&&st<et/2&&(vt.add(new go.PathSegment(go.PathSegment.Move,ht,st)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et-st)),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,et-st)),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,st).close())),pt.setSpots(0,0,1,1,ht,st,-ht,-st),pt}),go.Shape.setFigureParameter("Ring",0,new Mn("Thickness",8)),go.Shape.defineFigureGenerator("Ring",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=8);var st=nt/2,pt=new go.Geometry,vt=new go.PathFigure(nt,nt/2,!0);pt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Arc,0,360,st,st,st,st).close());var St=Math.max(st-ht,0);return St>0&&(vt.add(new go.PathSegment(go.PathSegment.Move,nt/2+St,nt/2)),vt.add(new go.PathSegment(go.PathSegment.Arc,0,-360,st,st,St,St).close())),pt.spot1=he,pt.spot2=Dt,pt.defaultStretch=go.GraphObject.Uniform,pt}),go.Shape.defineFigureGenerator("Cloud",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.08034461*nt,.1944299*et,!0).add(new go.PathSegment(go.PathSegment.Bezier,.2008615*nt,.05349299*et,-.09239631*nt,.07836421*et,.1406031*nt,-.0542823*et)).add(new go.PathSegment(go.PathSegment.Bezier,.4338609*nt,.074219*et,.2450511*nt,-.00697547*et,.3776197*nt,-.01112067*et)).add(new go.PathSegment(go.PathSegment.Bezier,.6558228*nt,.07004196*et,.4539471*nt,0,.6066018*nt,-.02526587*et)).add(new go.PathSegment(go.PathSegment.Bezier,.8921095*nt,.08370865*et,.6914277*nt,-.01904177*et,.8921095*nt,-.01220843*et)).add(new go.PathSegment(go.PathSegment.Bezier,.9147671*nt,.3194596*et,1.036446*nt,.04105738*et,1.020377*nt,.3022052*et)).add(new go.PathSegment(go.PathSegment.Bezier,.9082935*nt,.562044*et,1.04448*nt,.360238*et,.992256*nt,.5219009*et)).add(new go.PathSegment(go.PathSegment.Bezier,.9212406*nt,.8217117*et,1.032337*nt,.5771781*et,1.018411*nt,.8120651*et)).add(new go.PathSegment(go.PathSegment.Bezier,.7592566*nt,.9156953*et,1.028411*nt,.9571472*et,.8556702*nt,1.052487*et)).add(new go.PathSegment(go.PathSegment.Bezier,.5101666*nt,.9310455*et,.7431877*nt,1.009325*et,.5624123*nt,1.021761*et)).add(new go.PathSegment(go.PathSegment.Bezier,.2609328*nt,.9344623*et,.4820677*nt,1.031761*et,.3030112*nt,1.002796*et)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*nt,.870098*et,.2329994*nt,1.01518*et,.03213784*nt,1.01518*et)).add(new go.PathSegment(go.PathSegment.Bezier,.06829292*nt,.6545475*et,-.02812061*nt,.9032597*et,-.01205169*nt,.6835638*et)).add(new go.PathSegment(go.PathSegment.Bezier,.06427569*nt,.4265613*et,-.01812061*nt,.6089503*et,-.00606892*nt,.4555777*et)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*nt,.1944299*et,-.01606892*nt,.3892545*et,-.01205169*nt,.1944299*et))).setSpots(.1,.1,.9,.9)}),go.Shape.defineFigureGenerator("StopSign",function(Bt,nt,et){var ht=1/(Math.SQRT2+2);return new go.Geometry().add(new go.PathFigure(ht*nt,0,!0).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,ht*et)).add(new go.PathSegment(go.PathSegment.Line,nt,(1-ht)*et)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,et)).add(new go.PathSegment(go.PathSegment.Line,ht*nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,(1-ht)*et)).add(new go.PathSegment(go.PathSegment.Line,0,ht*et).close())).setSpots(ht/2,ht/2,1-ht/2,1-ht/2)}),go.Shape.setFigureParameter("Pie",0,new Mn("Start",0,-360,360)),go.Shape.setFigureParameter("Pie",1,new Mn("Sweep",315,-360,360)),go.Shape.defineFigureGenerator("Pie",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN,st=Bt?Bt.parameter2:NaN;isNaN(ht)&&(ht=0),isNaN(st)&&(st=315);var pt=ht%360;pt<0&&(pt+=360);var vt=st%360,St=Math.min(nt,et)/2;return new go.Geometry().add(new go.PathFigure(St,St).add(new go.PathSegment(go.PathSegment.Arc,pt,vt,St,St,St,St).close()))}),go.Shape.defineFigureGenerator("PiePiece",function(Bt,nt,et){var ht=ee/Math.SQRT2*.5,st=Math.SQRT2/2,pt=1-Math.SQRT2/2;return new go.Geometry().add(new go.PathFigure(nt,et,!0).add(new go.PathSegment(go.PathSegment.Bezier,st*nt,pt*et,nt,(1-ht)*et,(st+ht)*nt,(pt+ht)*et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close()))}),go.Shape.setFigureParameter("ThickCross",0,new Mn("Thickness",30)),go.Shape.defineFigureGenerator("ThickCross",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=30);var st=Math.min(ht,nt)/2,pt=nt/2,vt=et/2;return new go.Geometry().add(new go.PathFigure(pt-st,0,!0).add(new go.PathSegment(go.PathSegment.Line,pt+st,0)).add(new go.PathSegment(go.PathSegment.Line,pt+st,vt-st)).add(new go.PathSegment(go.PathSegment.Line,nt,vt-st)).add(new go.PathSegment(go.PathSegment.Line,nt,vt+st)).add(new go.PathSegment(go.PathSegment.Line,pt+st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,pt+st,et)).add(new go.PathSegment(go.PathSegment.Line,pt-st,et)).add(new go.PathSegment(go.PathSegment.Line,pt-st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,0,vt+st)).add(new go.PathSegment(go.PathSegment.Line,0,vt-st)).add(new go.PathSegment(go.PathSegment.Line,pt-st,vt-st).close()))}),go.Shape.setFigureParameter("ThinCross",0,new Mn("Thickness",10)),go.Shape.defineFigureGenerator("ThinCross",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=10);var st=Math.min(ht,nt)/2,pt=nt/2,vt=et/2;return new go.Geometry().add(new go.PathFigure(pt-st,0,!0).add(new go.PathSegment(go.PathSegment.Line,pt+st,0)).add(new go.PathSegment(go.PathSegment.Line,pt+st,vt-st)).add(new go.PathSegment(go.PathSegment.Line,nt,vt-st)).add(new go.PathSegment(go.PathSegment.Line,nt,vt+st)).add(new go.PathSegment(go.PathSegment.Line,pt+st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,pt+st,et)).add(new go.PathSegment(go.PathSegment.Line,pt-st,et)).add(new go.PathSegment(go.PathSegment.Line,pt-st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,0,vt+st)).add(new go.PathSegment(go.PathSegment.Line,0,vt-st)).add(new go.PathSegment(go.PathSegment.Line,pt-st,vt-st).close()))}),go.Shape.setFigureParameter("ThickX",0,new Mn("Thickness",30)),go.Shape.defineFigureGenerator("ThickX",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;if((isNaN(ht)||ht<0)&&(ht=30),nt===0||et===0){var st=new go.Geometry(go.Geometry.Rectangle);return st.startX=0,st.startY=0,st.endX=nt,st.endY=et,st}else{var pt=nt/2,vt=et/2,St=Math.atan2(et,nt),Et=ht-Math.min(Math.cos(St)*ht/2,pt),Tt=ht-Math.min(Math.sin(St)*ht/2,vt),st=new go.Geometry,It=new go.PathFigure(Et,0,!0);return st.add(It),It.add(new go.PathSegment(go.PathSegment.Line,pt,.2*et)),It.add(new go.PathSegment(go.PathSegment.Line,nt-Et,0)),It.add(new go.PathSegment(go.PathSegment.Line,nt,Tt)),It.add(new go.PathSegment(go.PathSegment.Line,.8*nt,vt)),It.add(new go.PathSegment(go.PathSegment.Line,nt,et-Tt)),It.add(new go.PathSegment(go.PathSegment.Line,nt-Et,et)),It.add(new go.PathSegment(go.PathSegment.Line,pt,.8*et)),It.add(new go.PathSegment(go.PathSegment.Line,Et,et)),It.add(new go.PathSegment(go.PathSegment.Line,0,et-Tt)),It.add(new go.PathSegment(go.PathSegment.Line,.2*nt,vt)),It.add(new go.PathSegment(go.PathSegment.Line,0,Tt).close()),st}}),go.Shape.setFigureParameter("ThinX",0,new Mn("Thickness",10)),go.Shape.defineFigureGenerator("ThinX",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=10);var st=new go.Geometry,pt=new go.PathFigure(.1*nt,0,!0);return st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.9*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et).close()),st}),go.Shape.setFigureParameter("SquareIBeam",0,new Mn("BeamWidth",.2,.1,.9)),go.Shape.defineFigureGenerator("SquareIBeam",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.2);var st=new go.Geometry,pt=new go.PathFigure(0,0,!0);return st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,ht*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5+ht/2)*nt,ht*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5+ht/2)*nt,(1-ht)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,(1-ht)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,(1-ht)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5-ht/2)*nt,(1-ht)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5-ht/2)*nt,ht*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,ht*et).close()),st}),go.Shape.setFigureParameter("RoundedIBeam",0,new Mn("Curviness",.5,.05,.65)),go.Shape.defineFigureGenerator("RoundedIBeam",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.5);var st=new go.Geometry,pt=new go.PathFigure(0,0,!0);return st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Bezier,nt,et,Math.abs(1-ht)*nt,.25*et,Math.abs(1-ht)*nt,.75*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ht*nt,.75*et,ht*nt,.25*et).close()),st}),go.Shape.defineFigureGenerator("HalfEllipse",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,ee*nt,0,nt,(.5-ee/2)*et)).add(new go.PathSegment(go.PathSegment.Bezier,0,et,nt,(.5+ee/2)*et,ee*nt,et).close())).setSpots(0,.156,.844,.844)}),go.Shape.defineFigureGenerator("Crescent",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,et,nt,0,nt,et)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.5*nt,.75*et,.5*nt,.25*et).close())).setSpots(.311,.266,.744,.744)}),go.Shape.defineFigureGenerator("Heart",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.5*nt,et,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,.3*et,.1*nt,.8*et,0,.5*et)).add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.3*et,0,0,.45*nt,0)).add(new go.PathSegment(go.PathSegment.Bezier,nt,.3*et,.55*nt,0,nt,0)).add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,.5*et,.9*nt,.8*et).close())).setSpots(.14,.29,.86,.78)}),go.Shape.defineFigureGenerator("Spade",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.5*nt,0,!0).add(new go.PathSegment(go.PathSegment.Line,.51*nt,.01*et)).add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,.6*nt,.2*et,nt,.25*et)).add(new go.PathSegment(go.PathSegment.Bezier,.55*nt,.7*et,nt,.8*et,.6*nt,.8*et)).add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,et,.5*nt,.75*et,.55*nt,.95*et)).add(new go.PathSegment(go.PathSegment.Line,.25*nt,et)).add(new go.PathSegment(go.PathSegment.Bezier,.45*nt,.7*et,.45*nt,.95*et,.5*nt,.75*et)).add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,.4*nt,.8*et,0,.8*et)).add(new go.PathSegment(go.PathSegment.Bezier,.49*nt,.01*et,0,.25*et,.4*nt,.2*et).close())).setSpots(.14,.26,.86,.78)}),go.Shape.defineFigureGenerator("Club",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.4*nt,.6*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.15*nt,et,.5*nt,.75*et,.45*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Line,.85*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.6*nt,.6*et,.55*nt,.95*et,.5*nt,.75*et));var pt=.2,vt=.3,St=0,Et=pt*ee;return st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5+pt+St)*et,(.5-pt+vt)*nt,(.5+Et+St)*et,(.5-Et+vt)*nt,(.5+pt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pt+vt)*nt,(.5+St)*et,(.5+Et+vt)*nt,(.5+pt+St)*et,(.5+pt+vt)*nt,(.5+Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-pt+St)*et,(1-.5+pt+vt)*nt,(.5-Et+St)*et,(.5+Et+vt)*nt,(.5-pt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.65*nt,.36771243*et,(.5-Et+vt)*nt,(.5-pt+St)*et,(.5-pt+vt+.05)*nt,(.5-Et+St-.02)*et)),pt=.2,vt=0,St=-.3,Et=pt*ee,st.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pt+vt)*nt,(.5+St)*et,(.5+Et+vt)*nt,(.5+pt+St)*et,(.5+pt+vt)*nt,(.5+Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-pt+St)*et,(1-.5+pt+vt)*nt,(.5-Et+St)*et,(.5+Et+vt)*nt,(.5-pt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pt+vt)*nt,(.5+St)*et,(.5-Et+vt)*nt,(.5-pt+St)*et,(.5-pt+vt)*nt,(.5-Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5-Et+vt)*nt,(.5+pt+St)*et,(.5-pt+vt)*nt,(.5+Et+St)*et,(.5-Et+vt)*nt,(.5+pt+St)*et)),pt=.2,vt=-.3,St=0,Et=pt*ee,st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-pt+St)*et,(1-.5+pt+vt-.05)*nt,(.5-Et+St-.02)*et,(.5+Et+vt)*nt,(.5-pt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pt+vt)*nt,(.5+St)*et,(.5-Et+vt)*nt,(.5-pt+St)*et,(.5-pt+vt)*nt,(.5-Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5+pt+St)*et,(.5-pt+vt)*nt,(.5+Et+St)*et,(.5-Et+vt)*nt,(.5+pt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,.6*et,(.5+Et+vt)*nt,(.5+pt+St)*et,(.5+pt+vt)*nt,(.5+Et+St)*et).close()),ht.setSpots(.06,.33,.93,.68),ht}),go.Shape.defineFigureGenerator("YinYang",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*.5,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,270,180,nt*.5,nt*.5,nt*.5,nt*.5)),st.add(new go.PathSegment(go.PathSegment.Arc,90,-180,nt*.5,nt*.75,nt*.25,nt*.25)),st.add(new go.PathSegment(go.PathSegment.Arc,90,180,nt*.5,nt*.25,nt*.25,nt*.25));var pt=.1,vt=.5,St=.25;return st.add(new go.PathSegment(go.PathSegment.Move,(vt+pt)*nt,St*et)),st.add(new go.PathSegment(go.PathSegment.Arc,0,-360,nt*vt,et*St,pt*nt,pt*nt).close()),st=new go.PathFigure(nt*.5,0,!1),ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,270,-180,nt*.5,nt*.5,nt*.5,nt*.5)),St=.75,st=new go.PathFigure((vt+pt)*nt,St*et,!0),ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,0,360,nt*vt,et*St,pt*nt,pt*nt).close()),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("Peace",function(Bt,nt,et){var ht=.8535533905932737,st=.5*nt,pt=.5*et;return new go.Geometry().add(new go.PathFigure(st,0,!1).add(new go.PathSegment(go.PathSegment.Arc,270,360,st,pt,st,pt)).add(new go.PathSegment(go.PathSegment.Line,st,et)).add(new go.PathSegment(go.PathSegment.Move,st,pt)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Move,st,pt)).add(new go.PathSegment(go.PathSegment.Line,ht*nt,ht*et)))}),go.Shape.defineFigureGenerator("NotAllowed",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.5,pt=.5,vt=.5,St=.5,Et=new go.PathFigure(vt*nt,(St-pt)*et);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,(vt-st)*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-pt)*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),pt=.4,st=ee*.4;var Tt=gt(),It=gt(),qt=gt(),Xt=gt();Ee(vt,St-pt,vt+st,St-pt,vt+pt,St-st,vt+pt,St,.42,Tt,It,qt,Xt,Xt);var Ht=gt(),pe=gt(),re=gt();Ee(vt,St-pt,vt+st,St-pt,vt+pt,St-st,vt+pt,St,.58,Xt,Xt,re,Ht,pe);var Ne=gt(),ye=gt(),xe=gt();Ee(vt,St+pt,vt-st,St+pt,vt-pt,St+st,vt-pt,St,.42,Ne,ye,xe,Xt,Xt);var Ue=gt(),je=gt(),Je=gt();return Ee(vt,St+pt,vt-st,St+pt,vt-pt,St+st,vt-pt,St,.58,Xt,Xt,Je,Ue,je),Et.add(new go.PathSegment(go.PathSegment.Move,Je.x*nt,Je.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,Ue.x*nt,Ue.y*et,je.x*nt,je.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,qt.x*nt,qt.y*et,Tt.x*nt,Tt.y*et,It.x*nt,It.y*et)),Et.add(new go.PathSegment(go.PathSegment.Line,Je.x*nt,Je.y*et).close()),Et.add(new go.PathSegment(go.PathSegment.Move,xe.x*nt,xe.y*et)),Et.add(new go.PathSegment(go.PathSegment.Line,re.x*nt,re.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,Ht.x*nt,Ht.y*et,pe.x*nt,pe.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,xe.x*nt,xe.y*et,Ne.x*nt,Ne.y*et,ye.x*nt,ye.y*et).close()),Ut(Tt),Ut(It),Ut(qt),Ut(Xt),Ut(Ht),Ut(pe),Ut(re),Ut(Ne),Ut(ye),Ut(xe),Ut(Ue),Ut(je),Ut(Je),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("Fragile",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.25*nt,0)).add(new go.PathSegment(go.PathSegment.Line,.2*nt,.15*et)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,.25*et)).add(new go.PathSegment(go.PathSegment.Line,.29*nt,.33*et)).add(new go.PathSegment(go.PathSegment.Line,.35*nt,.25*et)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,.15*et)).add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Bezier,.55*nt,.5*et,nt,.25*et,.75*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.55*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.45*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.45*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*nt,.5*et,0,.25*et).close()))}),go.Shape.setFigureParameter("HourGlass",0,new Mn("Thickness",30)),go.Shape.defineFigureGenerator("HourGlass",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=30),ht>nt&&(ht=nt);var st=(nt-ht)/2,pt=st+ht;return new go.Geometry().add(new go.PathFigure(pt,.5*et).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et)).add(new go.PathSegment(go.PathSegment.Line,st,.5*et)).add(new go.PathSegment(go.PathSegment.Line,0,0)).add(new go.PathSegment(go.PathSegment.Line,nt,0).close()))}),go.Shape.defineFigureGenerator("Lightning",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,.55*et).add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,.45*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.45*et)).add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,.55*et).close()))}),go.Shape.defineFigureGenerator("GenderMale",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.4,pt=.4,vt=.5,St=.5,Et=gt(),Tt=gt(),It=gt(),qt=gt(),Xt=new go.PathFigure((vt-pt)*nt,St*et,!1);ht.add(Xt),Xt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et)),Ee(vt,St-pt,vt+st,St-pt,vt+pt,St-st,vt+pt,St,.44,It,qt,Tt,Et,Et),Xt.add(new go.PathSegment(go.PathSegment.Bezier,Tt.x*nt,Tt.y*et,It.x*nt,It.y*et,qt.x*nt,qt.y*et));var Ht=kt(Tt.x,Tt.y);Ee(vt,St-pt,vt+st,St-pt,vt+pt,St-st,vt+pt,St,.56,Et,Et,Tt,It,qt);var pe=kt(Tt.x,Tt.y);Xt.add(new go.PathSegment(go.PathSegment.Line,(Ht.x*.1+.95*.9)*nt,Ht.y*.1*et)),Xt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,Ht.y*.1*et)),Xt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,0)),Xt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),Xt.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),Xt.add(new go.PathSegment(go.PathSegment.Line,(pe.x*.1+.9)*nt,.15*et)),Xt.add(new go.PathSegment(go.PathSegment.Line,(pe.x*.1+.9)*nt,(pe.y*.1+.05*.9)*et)),Xt.add(new go.PathSegment(go.PathSegment.Line,pe.x*nt,pe.y*et)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,It.x*nt,It.y*et,qt.x*nt,qt.y*et)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,(vt-st)*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et)),pt=.35,st=ee*.35;var re=new go.PathFigure(vt*nt,(St-pt)*et,!1);ht.add(re),re.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,(vt-st)*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-pt)*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et));var Ne=new go.PathFigure((vt-pt)*nt,St*et,!1);return ht.add(Ne),Ut(Et),Ut(Tt),Ut(It),Ut(qt),Ut(Ht),Ut(pe),ht.spot1=new go.Spot(.202,.257),ht.spot2=new go.Spot(.792,.739),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("GenderFemale",function(Bt,nt,et){var ht=new go.Geometry,st=.375,pt=0,vt=-.125,St=st*ee,Et=new go.PathFigure((.525+pt)*nt,(.5+st+vt)*et,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+st+pt)*nt,(.5+vt)*et,(.5+St+pt)*nt,(.5+st+vt)*et,(.5+st+pt)*nt,(.5+St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*nt,(.5-st+vt)*et,(1-.5+st+pt)*nt,(.5-St+vt)*et,(.5+St+pt)*nt,(.5-st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5-st+pt)*nt,(.5+vt)*et,(.5-St+pt)*nt,(.5-st+vt)*et,(.5-st+pt)*nt,(.5-St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.475+pt)*nt,(.5+st+vt)*et,(.5-st+pt)*nt,(.5+St+vt)*et,(.5-St+pt)*nt,(.5+st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.475*nt,.85*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.425*nt,.85*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.425*nt,.9*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.475*nt,.9*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.475*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Line,.525*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.9*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.9*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.85*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.85*et).close()),st=.325,pt=0,vt=-.125,St=st*ee;var Et=new go.PathFigure((1-.5+st+pt)*nt,(.5+vt)*et,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*nt,(.5+st+vt)*et,(.5+st+pt)*nt,(.5+St+vt)*et,(.5+St+pt)*nt,(.5+st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5-st+pt)*nt,(.5+vt)*et,(.5-St+pt)*nt,(.5+st+vt)*et,(.5-st+pt)*nt,(.5+St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*nt,(.5-st+vt)*et,(.5-st+pt)*nt,(.5-St+vt)*et,(.5-St+pt)*nt,(.5-st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+st+pt)*nt,(.5+vt)*et,(.5+St+pt)*nt,(.5-st+vt)*et,(1-.5+st+pt)*nt,(.5-St+vt)*et));var Et=new go.PathFigure((.525+pt)*nt,(.5+st+vt)*et,!1);return ht.add(Et),ht.spot1=new go.Spot(.232,.136),ht.spot2=new go.Spot(.682,.611),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("LogicImplies",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;return isNaN(ht)&&(ht=.2),new go.Geometry().add(new go.PathFigure((1-ht)*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,et)).add(new go.PathSegment(go.PathSegment.Move,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et))).setSpots(0,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicIff",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;return isNaN(ht)&&(ht=.2),new go.Geometry().add(new go.PathFigure((1-ht)*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,et)).add(new go.PathSegment(go.PathSegment.Move,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Move,ht*nt,0)).add(new go.PathSegment(go.PathSegment.Line,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,ht*nt,et))).setSpots(.2,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicNot",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)))}),go.Shape.defineFigureGenerator("LogicAnd",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,et,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et))).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("LogicOr",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Line,nt,0))).setSpots(.219,0,.78,.409)}),go.Shape.defineFigureGenerator("LogicXor",function(Bt,nt,et){var ht=new go.Geometry().add(new go.PathFigure(.5*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Move,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Arc,0,360,.5*nt,.5*et,.5*nt,.5*et)));return ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("LogicTruth",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Move,.5*nt,0)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)))}),go.Shape.defineFigureGenerator("LogicFalsity",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,et,!1).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Move,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)))}),go.Shape.defineFigureGenerator("LogicThereExists",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,0,.5*et)).add(new go.PathSegment(go.PathSegment.Move,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et)))}),go.Shape.defineFigureGenerator("LogicForAll",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Move,.25*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.75*nt,.5*et))).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("LogicIsDefinedAs",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Move,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Move,0,et)).add(new go.PathSegment(go.PathSegment.Line,nt,et))).setSpots(.01,.01,.99,.49)}),go.Shape.defineFigureGenerator("LogicIntersect",function(Bt,nt,et){var ht=.5;return new go.Geometry().add(new go.PathFigure(0,et,!1).add(new go.PathSegment(go.PathSegment.Line,0,ht*et)).add(new go.PathSegment(go.PathSegment.Arc,180,180,ht*nt,ht*et,ht*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Line,nt,et))).setSpots(0,.5,1,1)}),go.Shape.defineFigureGenerator("LogicUnion",function(Bt,nt,et){var ht=.5;return new go.Geometry().add(new go.PathFigure(nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,ht*et)).add(new go.PathSegment(go.PathSegment.Arc,0,180,ht*nt,ht*et,ht*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Line,0,0))).setSpots(0,0,1,.5)}),go.Shape.setFigureParameter("Arrow",0,new Mn("ArrowheadWidth",.3,.01,.99)),go.Shape.setFigureParameter("Arrow",1,new Mn("TailHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("Arrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.3);var st=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.3);var pt=(1-ht)*nt,vt=(.5-st/2)*et,St=(.5+st/2)*et,Et=new go.Geometry,Tt=new go.PathFigure(0,vt,!0);Et.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,pt,vt)),Tt.add(new go.PathSegment(go.PathSegment.Line,pt,0)),Tt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),Tt.add(new go.PathSegment(go.PathSegment.Line,pt,et)),Tt.add(new go.PathSegment(go.PathSegment.Line,pt,St)),Tt.add(new go.PathSegment(go.PathSegment.Line,0,St).close()),Et.spot1=new go.Spot(0,vt/et);var It=ue(0,St/et,1,St/et,pt/nt,1,1,.5,gt());return Et.spot2=new go.Spot(It.x,It.y),Ut(It),Et}),go.Shape.setFigureParameter("Arrow2",0,new Mn("ArrowheadWidth",30)),go.Shape.setFigureParameter("Arrow2",0,new Mn("TailHeight",30)),go.Shape.defineFigureGenerator("Arrow2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=30),ht>nt&&(ht=nt);var st=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=30),st=Math.min(st,et/2);var pt=nt-ht,vt=(et-st)/2,St=vt+st,Et=new go.Geometry,Tt=new go.PathFigure(0,vt,!0);Et.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,pt,vt)),Tt.add(new go.PathSegment(go.PathSegment.Line,pt,0)),Tt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),Tt.add(new go.PathSegment(go.PathSegment.Line,pt,et)),Tt.add(new go.PathSegment(go.PathSegment.Line,pt,St)),Tt.add(new go.PathSegment(go.PathSegment.Line,0,St).close()),Et.spot1=new go.Spot(0,vt/et);var It=ue(0,St/et,1,St/et,pt/nt,1,1,.5,gt());return Et.spot2=new go.Spot(It.x,It.y),Ut(It),Et}),go.Shape.defineFigureGenerator("Chevron",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("DoubleArrow",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.214*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,1*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.786*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,1*et).close()),ht}),go.Shape.setFigureParameter("DoubleEndArrow",0,new Mn("ConnecterHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("DoubleEndArrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.3);var st=(.5-ht/2)*et,pt=(.5+ht/2)*et,vt=new go.Geometry,St=new go.PathFigure(nt,.5*et,!0);vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),St.add(new go.PathSegment(go.PathSegment.Line,.3*nt,pt)),St.add(new go.PathSegment(go.PathSegment.Line,.3*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0)),St.add(new go.PathSegment(go.PathSegment.Line,.3*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close());var Et=ue(0,.5,.3,0,0,st/et,.1,st/et,gt());return vt.spot1=new go.Spot(Et.x,Et.y),Et=ue(.7,1,1,.5,0,pt/et,1,pt/et,Et),vt.spot2=new go.Spot(Et.x,Et.y),Ut(Et),vt}),go.Shape.setFigureParameter("DoubleEndArrow2",0,new Mn("ConnecterHeight",40)),go.Shape.setFigureParameter("DoubleEndArrow2",1,new Mn("ArrowHeight",100)),go.Shape.defineFigureGenerator("DoubleEndArrow2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=40);var st=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=100);var pt=(et-ht)/2,vt=pt+ht,St=(et-st)/2,Et=St+st;(ht>et||st>et)&&(st>ht?(ht=ht*et/st,pt=(et-ht)/2,vt=pt+ht,St=0,Et=et):(pt=0,vt=et,St=0,Et=et));var Tt=new go.Geometry,It=new go.PathFigure(nt,.5*et,!0);Tt.add(It),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,Et)),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,vt)),It.add(new go.PathSegment(go.PathSegment.Line,.3*nt,vt)),It.add(new go.PathSegment(go.PathSegment.Line,.3*nt,Et)),It.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),It.add(new go.PathSegment(go.PathSegment.Line,.3*nt,St)),It.add(new go.PathSegment(go.PathSegment.Line,.3*nt,pt)),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,St).close());var qt=ue(0,.5,.3,St/et,0,pt/et,1,pt/et,gt());return Tt.spot1=new go.Spot(qt.x,qt.y),qt=ue(.7,Et/et,1,.5,0,vt/et,1,vt/et,qt),Tt.spot2=new go.Spot(qt.x,qt.y),Ut(qt),Tt}),go.Shape.setFigureParameter("IBeamArrow",0,new Mn("ConnectorHeight",.7,.51,.97)),go.Shape.defineFigureGenerator("IBeamArrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.3);var st=(.5-ht/2)*et,pt=(.5+ht/2)*et,vt=new go.Geometry,St=new go.PathFigure(nt,.5*et,!0);vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,pt)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,0,et)),St.add(new go.PathSegment(go.PathSegment.Line,0,0)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,0)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close()),vt.spot1=new go.Spot(0,st/et);var Et=ue(.7,1,1,.5,0,pt/et,1,pt/et,gt());return vt.spot2=new go.Spot(Et.x,Et.y),Ut(Et),vt}),go.Shape.setFigureParameter("IBeamArrow2",0,new Mn("ConnectorHeight",40)),go.Shape.setFigureParameter("IBeamArrow2",1,new Mn("BeamArrowHeight",100)),go.Shape.defineFigureGenerator("IBeamArrow2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=40);var st=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=100);var pt=(et-ht)/2,vt=pt+ht,St=(et-st)/2,Et=St+st;(ht>et||st>et)&&(st>ht?(ht=ht*et/st,pt=(et-ht)/2,vt=pt+ht,St=0,Et=et):(pt=0,vt=et,St=0,Et=et));var Tt=new go.Geometry,It=new go.PathFigure(nt,.5*et,!0);Tt.add(It),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,Et)),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,vt)),It.add(new go.PathSegment(go.PathSegment.Line,.2*nt,vt)),It.add(new go.PathSegment(go.PathSegment.Line,.2*nt,Et)),It.add(new go.PathSegment(go.PathSegment.Line,0,Et)),It.add(new go.PathSegment(go.PathSegment.Line,0,St)),It.add(new go.PathSegment(go.PathSegment.Line,.2*nt,St)),It.add(new go.PathSegment(go.PathSegment.Line,.2*nt,pt)),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,St).close()),Tt.spot1=new go.Spot(0,pt/et);var qt=ue(.7,Et/et,1,.5,0,vt/et,1,vt/et,gt());return Tt.spot2=new go.Spot(qt.x,qt.y),Ut(qt),Tt}),go.Shape.setFigureParameter("Pointer",0,new Mn("BackPoint",.1,0,.2)),go.Shape.defineFigureGenerator("Pointer",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.1);var st=new go.Geometry,pt=new go.PathFigure(nt,.5*et,!0);st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,0).close()),st.spot1=new go.Spot(ht,.35);var vt=ue(.2,.65,1,.65,0,1,1,.5,gt());return st.spot2=new go.Spot(vt.x,vt.y),Ut(vt),st}),go.Shape.setFigureParameter("RoundedPointer",0,new Mn("RoundedEdge",.3,0,.5)),go.Shape.defineFigureGenerator("RoundedPointer",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.3);var st=new go.Geometry,pt=new go.PathFigure(nt,.5*et,!0);st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ht*nt,.75*et,ht*nt,.25*et).close()),st.spot1=new go.Spot(ht,.35);var vt=ue(0,.65,1,.65,0,1,1,.5,gt());return st.spot2=new go.Spot(vt.x,vt.y),Ut(vt),st}),go.Shape.setFigureParameter("SplitEndArrow",0,new Mn("TailHeight",.4,.01,.99)),go.Shape.defineFigureGenerator("SplitEndArrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.4);var st=(.5-ht/2)*et,pt=(.5+ht/2)*et,vt=new go.Geometry,St=new go.PathFigure(nt,.5*et,!0);vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),St.add(new go.PathSegment(go.PathSegment.Line,0,pt)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,0,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close()),vt.spot1=new go.Spot(.2,.3);var Et=ue(.7,1,1,.5,0,pt/et,1,pt/et,gt());return vt.spot2=new go.Spot(Et.x,Et.y),Ut(Et),vt}),go.Shape.setFigureParameter("SplitEndArrow2",0,new Mn("TailThickness",50)),go.Shape.defineFigureGenerator("SplitEndArrow2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=50);var st=(et-ht)/2,pt=st+ht;ht>et&&(st=0,pt=et);var vt=new go.Geometry,St=new go.PathFigure(nt,.5*et,!0);vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),St.add(new go.PathSegment(go.PathSegment.Line,0,pt)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,0,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close()),vt.spot1=new go.Spot(.2,st/et);var Et=ue(.7,1,1,.5,0,pt/et,1,pt/et,gt());return vt.spot2=new go.Spot(Et.x,Et.y),Ut(Et),vt}),go.Shape.setFigureParameter("SquareArrow",0,new Mn("ArrowPoint",.7,.2,.9)),go.Shape.defineFigureGenerator("SquareArrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.7);var st=new go.Geometry,pt=new go.PathFigure(nt,.5*et,!0);return st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,0)),pt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,0).close()),st.spot1=go.Spot.TopLeft,st.spot2=new go.Spot(ht,1),st}),go.Shape.defineFigureGenerator("Cone1",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.5,pt=ee*.1,vt=new go.PathFigure(0,.9*et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.9+pt)*et,(.5+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-st)*nt,et,0,(.9+pt)*et).close()),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.97),ht}),go.Shape.defineFigureGenerator("Cone2",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.9*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.9*et,(1-.85/.9)*nt,et,.85/.9*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,.9*et).close());var pt=new go.PathFigure(0,.9*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.9*et,(1-.85/.9)*nt,.8*et,.85/.9*nt,.8*et)),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.82),ht}),go.Shape.defineFigureGenerator("Cube1",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,.15*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.85*et).close());var pt=new go.PathFigure(.5*nt,et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.15*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(.5,.85),ht}),go.Shape.defineFigureGenerator("Cube2",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.3*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0).close());var pt=new go.PathFigure(0,.3*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Move,.7*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(.7,1),ht}),go.Shape.defineFigureGenerator("Cylinder1",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,et/3);var st=new go.Geometry,pt=ee*.5,vt=new go.PathFigure(0,ht,!0);st.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,ee*ht,(.5-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,1*nt,ht,(.5+pt)*nt,0,1*nt,ee*ht)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et-ht)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,1*et,1*nt,et-ee*ht,(.5+pt)*nt,1*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,(.5-pt)*nt,1*et,0,et-ee*ht)),vt.add(new go.PathSegment(go.PathSegment.Line,0,ht));var St=new go.PathFigure(nt,ht,!1);return st.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,2*ht,1*nt,2*ht-ee*ht,(.5+pt)*nt,2*ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,ht,(.5-pt)*nt,2*ht,0,2*ht-ee*ht)),st.spot1=new go.Spot(0,0,0,2*ht),st.spot2=new go.Spot(1,1),st}),go.Shape.defineFigureGenerator("Cylinder2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,et/3);var st=new go.Geometry,pt=ee*.5,vt=new go.PathFigure(0,et-ht,!0);st.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,0,ht)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,ee*ht,(.5-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,ht,(.5+pt)*nt,0,nt,ee*ht)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et-ht)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,et-ee*ht,(.5+pt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,(.5-pt)*nt,et,0,et-ee*ht));var St=new go.PathFigure(0,et-ht,!1);return st.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et-2*ht,0,et-ht-ee*ht,(.5-pt)*nt,et-2*ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt,et-ht,(.5+pt)*nt,et-2*ht,nt,et-ht-ee*ht)),st.spot1=new go.Spot(0,0),st.spot2=new go.Spot(1,1,0,-2*ht),st}),go.Shape.defineFigureGenerator("Cylinder3",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,nt/3);var st=new go.Geometry,pt=ee*.5,vt=new go.PathFigure(ht,0,!0);st.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,nt-ee*ht,0,nt,(.5-pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,(.5+pt)*et,nt-ee*ht,et)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,ee*ht,et,0,(.5+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,(.5-pt)*et,ee*ht,0));var St=new go.PathFigure(ht,0,!1);return st.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,2*ht,.5*et,ht+ee*ht,0,2*ht,(.5-pt)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,ht,et,2*ht,(.5+pt)*et,ht+ee*ht,et)),st.spot1=new go.Spot(0,0,2*ht,0),st.spot2=new go.Spot(1,1),st}),go.Shape.defineFigureGenerator("Cylinder4",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,nt/3);var st=new go.Geometry,pt=ee*.5,vt=new go.PathFigure(nt-ht,0,!0);st.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,nt-ee*ht,0,nt,(.5-pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,(.5+pt)*et,nt-ee*ht,et)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,ee*ht,et,0,(.5+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,(.5-pt)*et,ee*ht,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,0));var St=new go.PathFigure(nt-ht,0,!1);return st.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,nt-2*ht,.5*et,nt-ht-ee*ht,0,nt-2*ht,(.5-pt)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt-2*ht,(.5+pt)*et,nt-ht-ee*ht,et)),st.spot1=new go.Spot(0,0),st.spot2=new go.Spot(1,1,-2*ht,0),st}),go.Shape.defineFigureGenerator("Prism1",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.25*nt,.25*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var pt=new go.PathFigure(.25*nt,.25*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),ht.spot1=new go.Spot(.408,.172),ht.spot2=new go.Spot(.833,.662),ht}),go.Shape.defineFigureGenerator("Prism2",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.25*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var pt=new go.PathFigure(0,et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),pt.add(new go.PathSegment(go.PathSegment.Move,0,.25*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.5*et)),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("Pyramid1",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.75*et).close());var pt=new go.PathFigure(.5*nt,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),ht.spot1=new go.Spot(.25,.367),ht.spot2=new go.Spot(.75,.875),ht}),go.Shape.defineFigureGenerator("Pyramid2",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.85*et).close());var pt=new go.PathFigure(.5*nt,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.7*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.85*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.7*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),ht.spot1=new go.Spot(.25,.367),ht.spot2=new go.Spot(.75,.875),ht}),go.Shape.defineFigureGenerator("Actor",function(Bt,nt,et){var ht=new go.Geometry,st=.2,pt=.1,vt=ee*st,St=ee*pt,Et=.5,Tt=.1,It=new go.PathFigure(Et*nt,(Tt+pt)*et,!0);ht.add(It),It.add(new go.PathSegment(go.PathSegment.Bezier,(Et-st)*nt,Tt*et,(Et-vt)*nt,(Tt+pt)*et,(Et-st)*nt,(Tt+St)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-pt)*et,(Et-st)*nt,(Tt-St)*et,(Et-vt)*nt,(Tt-pt)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,(Et+st)*nt,Tt*et,(Et+vt)*nt,(Tt-pt)*et,(Et+st)*nt,(Tt-St)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt+pt)*et,(Et+st)*nt,(Tt+St)*et,(Et+vt)*nt,(Tt+pt)*et));var qt=.05,Xt=ee*qt;Et=.05,Tt=.25;var Ht=new go.PathFigure(.5*nt,.2*et,!0);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Line,.95*nt,.2*et)),Et=.95,Tt=.25,Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Et+qt)*nt,Tt*et,(Et+Xt)*nt,(Tt-qt)*et,(Et+qt)*nt,(Tt-Xt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.35*et)),qt=.025,Xt=ee*qt,Et=.825,Tt=.35,Ht.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-qt)*et,(Et+qt)*nt,(Tt-Xt)*et,(Et+Xt)*nt,(Tt-qt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Et-qt)*nt,Tt*et,(Et-Xt)*nt,(Tt-qt)*et,(Et-qt)*nt,(Tt-Xt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.55*nt,et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.7*et)),qt=.05,Xt=ee*qt,Et=.5,Tt=.7,Ht.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-qt)*et,(Et+qt)*nt,(Tt-Xt)*et,(Et+Xt)*nt,(Tt-qt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Et-qt)*nt,Tt*et,(Et-Xt)*nt,(Tt-qt)*et,(Et-qt)*nt,(Tt-Xt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.45*nt,et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.35*et)),qt=.025,Xt=ee*qt,Et=.175,Tt=.35,Ht.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-qt)*et,(Et+qt)*nt,(Tt-Xt)*et,(Et+Xt)*nt,(Tt-qt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Et-qt)*nt,Tt*et,(Et-Xt)*nt,(Tt-qt)*et,(Et-qt)*nt,(Tt-Xt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.6*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,0,.6*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),qt=.05,Xt=ee*qt,Et=.05,Tt=.25,Ht.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-qt)*et,(Et-qt)*nt,(Tt-Xt)*et,(Et-Xt)*nt,(Tt-qt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.2*et)),ht.spot1=new go.Spot(.2,.2),ht.spot2=new go.Spot(.8,.65),ht}),go.Shape.setFigureParameter("Card",0,new Mn("CornerCutoutSize",.2,.1,.9)),go.Shape.defineFigureGenerator("Card",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.2);var st=new go.Geometry,pt=new go.PathFigure(nt,0,!0);return st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,ht*et)),pt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,0).close()),st.spot1=new go.Spot(0,ht),st.spot2=go.Spot.BottomRight,st}),go.Shape.defineFigureGenerator("Collate",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,.5*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et));var pt=new go.PathFigure(.5*nt,.5*et,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),ht.spot1=new go.Spot(.25,0),ht.spot2=new go.Spot(.75,.25),ht}),go.Shape.defineFigureGenerator("CreateRequest",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(0,st*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,st*et)),vt.add(new go.PathSegment(go.PathSegment.Move,0,(1-st)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,(1-st)*et)),ht}),go.Shape.defineFigureGenerator("Database",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.5,pt=ee*.1,vt=new go.PathFigure(nt,.1*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.9+pt)*et,(.5+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-st)*nt,et,0,(.9+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,(.1-pt)*et,(.5-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,(.5+st)*nt,0,nt,(.1-pt)*et));var St=new go.PathFigure(nt,.1*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.2*et,nt,(.1+pt)*et,(.5+st)*nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*et,(.5-st)*nt,.2*et,0,(.1+pt)*et)),St.add(new go.PathSegment(go.PathSegment.Move,nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.3*et,nt,(.2+pt)*et,(.5+st)*nt,.3*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*et,(.5-st)*nt,.3*et,0,(.2+pt)*et)),St.add(new go.PathSegment(go.PathSegment.Move,nt,.3*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.4*et,nt,(.3+pt)*et,(.5+st)*nt,.4*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.3*et,(.5-st)*nt,.4*et,0,(.3+pt)*et)),ht.spot1=new go.Spot(0,.4),ht.spot2=new go.Spot(1,.9),ht}),go.Shape.defineFigureGenerator("DataStorage",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,et,nt,0,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*nt,.9*et,.25*nt,.1*et).close()),ht.spot1=new go.Spot(.226,0),ht.spot2=new go.Spot(.81,1),ht}),go.Shape.defineFigureGenerator("DiskStorage",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.5,pt=ee*.1,vt=new go.PathFigure(nt,.1*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.9+pt)*et,(.5+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-st)*nt,et,0,(.9+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,(.1-pt)*et,(.5-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,(.5+st)*nt,0,nt,(.1-pt)*et));var St=new go.PathFigure(nt,.1*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.2*et,nt,(.1+pt)*et,(.5+st)*nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*et,(.5-st)*nt,.2*et,0,(.1+pt)*et)),St.add(new go.PathSegment(go.PathSegment.Move,nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.3*et,nt,(.2+pt)*et,(.5+st)*nt,.3*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*et,(.5-st)*nt,.3*et,0,(.2+pt)*et)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(1,.9),ht}),go.Shape.defineFigureGenerator("Display",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.25*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,et,nt,0,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et).close()),ht.spot1=new go.Spot(.25,0),ht.spot2=new go.Spot(.75,1),ht}),go.Shape.defineFigureGenerator("DividedEvent",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)?st=.2:st<.15&&(st=.15);var pt=ee*.2,vt=new go.PathFigure(0,.2*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,0,0,(.2-pt)*et,(.2-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.2*et,(.8+pt)*nt,0,nt,(.2-pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,et,nt,(.8+pt)*et,(.8+pt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.8*et,(.2-pt)*nt,et,0,(.8+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.2*et));var St=new go.PathFigure(0,st*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt,st*et)),ht}),go.Shape.defineFigureGenerator("DividedProcess",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;(isNaN(st)||st<.1)&&(st=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(0,st*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,st*et)),ht}),go.Shape.defineFigureGenerator("Document",function(Bt,nt,et){var ht=new go.Geometry;et=et/.8;var st=new go.PathFigure(0,.7*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.5*nt,.4*et,.5*nt,et).close()),ht.spot1=go.Spot.TopLeft,ht.spot2=new go.Spot(1,.6),ht}),go.Shape.defineFigureGenerator("ExternalOrganization",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;(isNaN(st)||st<.2)&&(st=.2);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(st*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,0,st*et)),vt.add(new go.PathSegment(go.PathSegment.Move,nt,st*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Move,0,(1-st)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Move,(1-st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,(1-st)*et)),ht}),go.Shape.defineFigureGenerator("ExternalProcess",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et).close());var pt=new go.PathFigure(.1*nt,.4*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.9*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.6*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.4*nt,.9*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.9*et)),ht.spot1=new go.Spot(.25,.25),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("File",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var pt=new go.PathFigure(.75*nt,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.25*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),ht.spot1=new go.Spot(0,.25),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("Interrupt",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,.5*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et));var pt=new go.PathFigure(nt,.5*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et));var vt=new go.PathFigure(nt,.5*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.5,.75),ht}),go.Shape.defineFigureGenerator("InternalStorage",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN,pt=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.1),isNaN(pt)&&(pt=.1);var vt=new go.PathFigure(0,0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var St=new go.PathFigure(st*nt,0,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),St.add(new go.PathSegment(go.PathSegment.Move,0,pt*et)),St.add(new go.PathSegment(go.PathSegment.Line,nt,pt*et)),ht}),go.Shape.defineFigureGenerator("Junction",function(Bt,nt,et){var ht=new go.Geometry,st=1/Math.SQRT2,pt=(1-1/Math.SQRT2)/2,vt=ee*.5,St=.5,Et=new go.PathFigure(nt,St*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,St*nt,et,nt,(St+vt)*et,(St+vt)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,St*et,(St-vt)*nt,et,0,(St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,St*nt,0,0,(St-vt)*et,(St-vt)*nt,0)),Et.add(new go.PathSegment(go.PathSegment.Bezier,nt,St*et,(St+vt)*nt,0,nt,(St-vt)*et));var Tt=new go.PathFigure((pt+st)*nt,(pt+st)*et,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,pt*nt,pt*et)),Tt.add(new go.PathSegment(go.PathSegment.Move,pt*nt,(pt+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Line,(pt+st)*nt,pt*et)),ht}),go.Shape.defineFigureGenerator("LinedDocument",function(Bt,nt,et){var ht=new go.Geometry;et=et/.8;var st=new go.PathFigure(0,.7*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.5*nt,.4*et,.5*nt,et).close());var pt=new go.PathFigure(.1*nt,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.75*et)),ht.spot1=new go.Spot(.1,0),ht.spot2=new go.Spot(1,.6),ht}),go.Shape.defineFigureGenerator("LoopLimit",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("MagneticTape",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.5,pt=.5,vt=new go.PathFigure(.5*nt,et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*et,(pt-st)*nt,et,0,(pt+st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,0,0,(pt-st)*et,(pt-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,pt*et,(pt+st)*nt,0,nt,(pt-st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,(pt+.1)*nt,.9*et,nt,(pt+st)*et,(pt+st)*nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),ht.spot1=new go.Spot(.15,.15),ht.spot2=new go.Spot(.85,.8),ht}),go.Shape.defineFigureGenerator("ManualInput",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.25*et).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("MessageFromUser",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.7);var pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,st*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=go.Spot.TopLeft,ht}),go.Shape.defineFigureGenerator("MicroformProcessing",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.25);var pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,st*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,(1-st)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("MicroformRecording",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(1,.75),ht}),go.Shape.defineFigureGenerator("MultiDocument",function(Bt,nt,et){var ht=new go.Geometry;et=et/.8;var st=new go.PathFigure(nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,.44*et,.96*nt,.47*et,.93*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.54*et,.86*nt,.57*et,.83*nt,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.4*nt,.4*et,.4*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,0).close());var pt=new go.PathFigure(.1*nt,.2*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.54*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.44*et)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.8,.77),ht}),go.Shape.defineFigureGenerator("MultiProcess",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.1*nt,.1*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.2*et).close());var pt=new go.PathFigure(.2*nt,.1*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.1*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.9*et)),ht.spot1=new go.Spot(0,.2),ht.spot2=new go.Spot(.8,1),ht}),go.Shape.defineFigureGenerator("OfflineStorage",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var pt=1-st,vt=new go.PathFigure(0,0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et).close());var St=new go.PathFigure(.5*st*nt,st*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,(1-.5*st)*nt,st*et)),ht}),go.Shape.defineFigureGenerator("OffPageConnector",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=go.Spot.TopLeft,ht.spot2=new go.Spot(.75,1),ht}),go.Shape.defineFigureGenerator("Or",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.5,pt=.5,vt=new go.PathFigure(nt,pt*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,et,nt,(pt+st)*et,(pt+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*et,(pt-st)*nt,et,0,(pt+st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,0,0,(pt-st)*et,(pt-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,pt*et,(pt+st)*nt,0,nt,(pt-st)*et));var St=new go.PathFigure(nt,.5*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),St.add(new go.PathSegment(go.PathSegment.Move,.5*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),ht}),go.Shape.defineFigureGenerator("PaperTape",function(Bt,nt,et){var ht=new go.Geometry;et=et/.8;var st=new go.PathFigure(0,.7*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.3*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.3*et,.5*nt,.6*et,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.5*nt,.4*et,.5*nt,et).close()),ht.spot1=new go.Spot(0,.49),ht.spot2=new go.Spot(1,.75),ht}),go.Shape.defineFigureGenerator("PrimitiveFromCall",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN,pt=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.1),isNaN(pt)&&(pt=.3);var vt=new go.PathFigure(0,0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("PrimitiveToCall",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN,pt=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.1),isNaN(pt)&&(pt=.3);var vt=new go.PathFigure(0,0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("Procedure",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure((1-st)*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,(1-st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Move,st*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),ht}),go.Shape.defineFigureGenerator("Process",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(st*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("Sort",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et).close());var pt=new go.PathFigure(0,.5*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),ht.spot1=new go.Spot(.25,.25),ht.spot2=new go.Spot(.75,.5),ht}),go.Shape.defineFigureGenerator("Start",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.25);var pt=new go.PathFigure(st*nt,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*nt,.5*et,.25*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*nt,.5*et,.25*nt,.5*et));var vt=new go.PathFigure(st*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Move,(1-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-st)*nt,et)),ht.spot1=new go.Spot(st,0),ht.spot2=new go.Spot(1-st,1),ht}),go.Shape.defineFigureGenerator("Terminator",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.25*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*nt,.5*et,.25*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*nt,.5*et,.25*nt,.5*et)),ht.spot1=new go.Spot(.23,0),ht.spot2=new go.Spot(.77,1),ht}),go.Shape.defineFigureGenerator("TransmittalTape",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,(1-st)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,(1-st)*et).close()),ht.spot1=go.Spot.TopLeft,ht}),go.Shape.defineFigureGenerator("AndGate",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.5,pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(.5+st)*nt,0,nt,(.5-st)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.5+st)*et,(.5+st)*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=go.Spot.TopLeft,ht.spot2=new go.Spot(.55,1),ht}),go.Shape.defineFigureGenerator("Buffer",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.5,.75),ht}),go.Shape.defineFigureGenerator("Clock",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.5,pt=.5,vt=new go.PathFigure(nt,pt*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,et,nt,(pt+st)*et,(pt+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*et,(pt-st)*nt,et,0,(pt+st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,0,0,(pt-st)*et,(pt-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,pt*et,(pt+st)*nt,0,nt,(pt-st)*et));var St=new go.PathFigure(nt,pt*et,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt,pt*et));var Et=new go.PathFigure(.8*nt,.75*et,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.75*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.75*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.75*et)),ht}),go.Shape.defineFigureGenerator("Ground",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Move,.3*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Move,.4*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,et)),ht}),go.Shape.defineFigureGenerator("Inverter",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.1,pt=.1,vt=.9,St=.5,Et=new go.PathFigure(.8*nt,.5*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,0,et)),Et.add(new go.PathSegment(go.PathSegment.Line,0,0)),Et.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.5*et));var Tt=new go.PathFigure((vt+pt)*nt,St*et,!0);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,(vt-st)*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,(vt+st)*nt,(St-pt)*et,(vt+pt)*nt,(St-st)*et)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.4,.75),ht}),go.Shape.defineFigureGenerator("NandGate",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.5,pt=ee*.4,vt=ee*.1,St=.1,Et=.9,Tt=.5,It=new go.PathFigure(.8*nt,.5*et,!0);ht.add(It),It.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,et,.8*nt,(.5+pt)*et,(.4+st)*nt,et)),It.add(new go.PathSegment(go.PathSegment.Line,0,et)),It.add(new go.PathSegment(go.PathSegment.Line,0,0)),It.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),It.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(.4+st)*nt,0,.8*nt,(.5-pt)*et));var qt=new go.PathFigure((Et+St)*nt,Tt*et,!0);return ht.add(qt),qt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt+St)*et,(Et+St)*nt,(Tt+vt)*et,(Et+vt)*nt,(Tt+St)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt,Tt*et,(Et-vt)*nt,(Tt+St)*et,(Et-St)*nt,(Tt+vt)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-St)*et,(Et-St)*nt,(Tt-vt)*et,(Et-vt)*nt,(Tt-St)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt,Tt*et,(Et+vt)*nt,(Tt-St)*et,(Et+St)*nt,(Tt-vt)*et)),ht.spot1=new go.Spot(0,.05),ht.spot2=new go.Spot(.55,.95),ht}),go.Shape.defineFigureGenerator("NorGate",function(Bt,nt,et){var ht=new go.Geometry,st=.5,pt=ee*st,vt=0,St=.5,Et=new go.PathFigure(.8*nt,.5*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,et,.7*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*nt,.75*et,.25*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(vt+pt)*nt,(St-st)*et,.7*nt,(St-pt)*et)),st=.1,pt=ee*.1,vt=.9,St=.5;var Tt=new go.PathFigure((vt-st)*nt,St*et,!0);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et)),ht.spot1=new go.Spot(.2,.25),ht.spot2=new go.Spot(.6,.75),ht}),go.Shape.defineFigureGenerator("OrGate",function(Bt,nt,et){var ht=new go.Geometry,st=.5,pt=ee*st,vt=0,St=.5,Et=new go.PathFigure(0,0,!0);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(vt+pt+pt)*nt,(St-st)*et,.8*nt,(St-pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,et,.8*nt,(St+pt)*et,(vt+pt+pt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*nt,.75*et,.25*nt,.25*et).close()),ht.spot1=new go.Spot(.2,.25),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("XnorGate",function(Bt,nt,et){var ht=new go.Geometry,st=.5,pt=ee*st,vt=.2,St=.5,Et=new go.PathFigure(.1*nt,0,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,et,.35*nt,.25*et,.35*nt,.75*et));var Tt=new go.PathFigure(.8*nt,.5*et,!0);ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,et,.7*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,0,.45*nt,.75*et,.45*nt,.25*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(vt+pt)*nt,(St-st)*et,.7*nt,(St-pt)*et)),st=.1,pt=ee*.1,vt=.9,St=.5;var It=new go.PathFigure((vt-st)*nt,St*et,!0);return ht.add(It),It.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et)),ht.spot1=new go.Spot(.4,.25),ht.spot2=new go.Spot(.65,.75),ht}),go.Shape.defineFigureGenerator("XorGate",function(Bt,nt,et){var ht=new go.Geometry,st=.5,pt=ee*st,vt=.2,St=.5,Et=new go.PathFigure(.1*nt,0,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,et,.35*nt,.25*et,.35*nt,.75*et));var Tt=new go.PathFigure(.2*nt,0,!0);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(vt+pt)*nt,(St-st)*et,.9*nt,(St-pt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,et,.9*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,0,.45*nt,.75*et,.45*nt,.25*et).close()),ht.spot1=new go.Spot(.4,.25),ht.spot2=new go.Spot(.8,.75),ht}),go.Shape.defineFigureGenerator("Capacitor",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("Resistor",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.5*et)),ht}),go.Shape.defineFigureGenerator("Inductor",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.1,pt=.1,vt=.1,St=.5,Et=new go.PathFigure((vt-st*.5)*nt,et,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,0,(vt-st)*nt,et,(vt-pt)*nt,0)),vt=.3,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+pt)*nt,0,(vt+st)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,0,(vt-st)*nt,et,(vt-pt)*nt,0)),vt=.5,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+pt)*nt,0,(vt+st)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,0,(vt-st)*nt,et,(vt-pt)*nt,0)),vt=.7,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+pt)*nt,0,(vt+st)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,0,(vt-st)*nt,et,(vt-pt)*nt,0)),vt=.9,Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st*.5)*nt,et,(vt+pt)*nt,0,(vt+st)*nt,et)),ht}),go.Shape.defineFigureGenerator("ACvoltageSource",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.5,pt=.5,vt=.5,St=.5,Et=new go.PathFigure((vt-pt)*nt,St*et,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,(vt+st)*nt,(St-pt)*et,(vt+pt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,(vt-st)*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Move,(vt-pt+.1)*nt,St*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt-.1)*nt,St*et,vt*nt,(St-pt)*et,vt*nt,(St+pt)*et)),ht}),go.Shape.defineFigureGenerator("DCvoltageSource",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.75*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("Diode",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.5,.75),ht}),go.Shape.defineFigureGenerator("Wifi",function(Bt,nt,et){var ht=new go.Geometry,st=nt,pt=et;nt=nt*.38,et=et*.6;var vt=ee*.8,St=.8,Et=0,Tt=.5,It=(st-nt)/2,qt=(pt-et)/2,Xt=new go.PathFigure(Et*nt+It,(Tt+St)*et+qt,!0);ht.add(Xt),Xt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt+It,Tt*et+qt,(Et-vt)*nt+It,(Tt+St)*et+qt,(Et-St)*nt+It,(Tt+vt)*et+qt)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(Tt-St)*et+qt,(Et-St)*nt+It,(Tt-vt)*et+qt,(Et-vt)*nt+It,(Tt-St)*et+qt)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St+vt*.5)*nt+It,Tt*et+qt,Et*nt+It,(Tt-St)*et+qt,(Et-St+vt*.5)*nt+It,(Tt-vt)*et+qt)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(Tt+St)*et+qt,(Et-St+vt*.5)*nt+It,(Tt+vt)*et+qt,Et*nt+It,(Tt+St)*et+qt).close()),vt=ee*.4,St=.4,Et=.2,Tt=.5;var Ht=new go.PathFigure(Et*nt+It,(Tt+St)*et+qt,!0);ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt+It,Tt*et+qt,(Et-vt)*nt+It,(Tt+St)*et+qt,(Et-St)*nt+It,(Tt+vt)*et+qt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(Tt-St)*et+qt,(Et-St)*nt+It,(Tt-vt)*et+qt,(Et-vt)*nt+It,(Tt-St)*et+qt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St+vt*.5)*nt+It,Tt*et+qt,Et*nt+It,(Tt-St)*et+qt,(Et-St+vt*.5)*nt+It,(Tt-vt)*et+qt)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(Tt+St)*et+qt,(Et-St+vt*.5)*nt+It,(Tt+vt)*et+qt,Et*nt+It,(Tt+St)*et+qt).close()),vt=ee*.2,St=.2,Et=.5,Tt=.5;var pe=new go.PathFigure((Et-St)*nt+It,Tt*et+qt,!0);ht.add(pe),pe.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(Tt-St)*et+qt,(Et-St)*nt+It,(Tt-vt)*et+qt,(Et-vt)*nt+It,(Tt-St)*et+qt)),pe.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt+It,Tt*et+qt,(Et+vt)*nt+It,(Tt-St)*et+qt,(Et+St)*nt+It,(Tt-vt)*et+qt)),pe.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(Tt+St)*et+qt,(Et+St)*nt+It,(Tt+vt)*et+qt,(Et+vt)*nt+It,(Tt+St)*et+qt)),pe.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt+It,Tt*et+qt,(Et-vt)*nt+It,(Tt+St)*et+qt,(Et-St)*nt+It,(Tt+vt)*et+qt)),vt=ee*.4,St=.4,Et=.8,Tt=.5;var re=new go.PathFigure(Et*nt+It,(Tt-St)*et+qt,!0);ht.add(re),re.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt+It,Tt*et+qt,(Et+vt)*nt+It,(Tt-St)*et+qt,(Et+St)*nt+It,(Tt-vt)*et+qt)),re.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(Tt+St)*et+qt,(Et+St)*nt+It,(Tt+vt)*et+qt,(Et+vt)*nt+It,(Tt+St)*et+qt)),re.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St-vt*.5)*nt+It,Tt*et+qt,Et*nt+It,(Tt+St)*et+qt,(Et+St-vt*.5)*nt+It,(Tt+vt)*et+qt)),re.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(Tt-St)*et+qt,(Et+St-vt*.5)*nt+It,(Tt-vt)*et+qt,Et*nt+It,(Tt-St)*et+qt).close()),vt=ee*.8,St=.8,Et=1,Tt=.5;var Ne=new go.PathFigure(Et*nt+It,(Tt-St)*et+qt,!0);return ht.add(Ne),Ne.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt+It,Tt*et+qt,(Et+vt)*nt+It,(Tt-St)*et+qt,(Et+St)*nt+It,(Tt-vt)*et+qt)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(Tt+St)*et+qt,(Et+St)*nt+It,(Tt+vt)*et+qt,(Et+vt)*nt+It,(Tt+St)*et+qt)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St-vt*.5)*nt+It,Tt*et+qt,Et*nt+It,(Tt+St)*et+qt,(Et+St-vt*.5)*nt+It,(Tt+vt)*et+qt)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(Tt-St)*et+qt,(Et+St-vt*.5)*nt+It,(Tt-vt)*et+qt,Et*nt+It,(Tt-St)*et+qt).close()),ht}),go.Shape.defineFigureGenerator("Email",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(0,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Move,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.54*et)),pt.add(new go.PathSegment(go.PathSegment.Move,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.54*et)),ht}),go.Shape.defineFigureGenerator("Ethernet",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.35*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,0).close());var pt=new go.PathFigure(.1*nt,et,!0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,et).close());var vt=new go.PathFigure(.6*nt,et,!0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.6*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.6*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,et).close());var St=new go.PathFigure(0,.5*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.4*et)),St.add(new go.PathSegment(go.PathSegment.Move,.75*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.6*et)),St.add(new go.PathSegment(go.PathSegment.Move,.25*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.6*et)),ht}),go.Shape.defineFigureGenerator("Power",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.4,pt=.4,vt=.5,St=.5,Et=gt(),Tt=gt(),It=gt(),qt=gt();Ee(vt,St-pt,vt+st,St-pt,vt+pt,St-st,vt+pt,St,.5,Et,Et,Tt,It,qt);var Xt=kt(Tt.x,Tt.y),Ht=new go.PathFigure(Tt.x*nt,Tt.y*et,!0);ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,It.x*nt,It.y*et,qt.x*nt,qt.y*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,(vt-st)*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et)),Ee(vt-pt,St,vt-pt,St-st,vt-st,St-pt,vt,St-pt,.5,It,qt,Tt,Et,Et),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Tt.x*nt,Tt.y*et,It.x*nt,It.y*et,qt.x*nt,qt.y*et)),st=ee*.3,pt=.3,Ee(vt-pt,St,vt-pt,St-st,vt-st,St-pt,vt,St-pt,.5,It,qt,Tt,Et,Et),Ht.add(new go.PathSegment(go.PathSegment.Line,Tt.x*nt,Tt.y*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,qt.x*nt,qt.y*et,It.x*nt,It.y*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Ee(vt,St-pt,vt+st,St-pt,vt+pt,St-st,vt+pt,St,.5,Et,Et,Tt,It,qt),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Tt.x*nt,Tt.y*et,qt.x*nt,qt.y*et,It.x*nt,It.y*et).close());var Ht=new go.PathFigure(.45*nt,0,!0);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.5*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.5*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.55*nt,0).close()),Ut(Et),Ut(Tt),Ut(It),Ut(qt),Ut(Xt),ht.spot1=new go.Spot(.25,.45),ht.spot2=new go.Spot(.75,.8),ht}),go.Shape.defineFigureGenerator("Fallout",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et/2,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,180,360,nt/2,et/2,nt/2,et/2));function pt(vt,St,Et){vt.add(new go.PathSegment(go.PathSegment.Move,(.3+St)*nt,(.8+Et)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(.5+St)*nt,(.5+Et)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(.1+St)*nt,(.5+Et)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(.3+St)*nt,(.8+Et)*et).close())}return pt(st,0,0),pt(st,.4,0),pt(st,.2,-.3),ht}),go.Shape.defineFigureGenerator("IrritationHazard",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.2*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.3*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.2*et).close()),ht.spot1=new go.Spot(.3,.3),ht.spot2=new go.Spot(.7,.7),ht}),go.Shape.defineFigureGenerator("ElectricalHazard",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.37*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.11*et)),st.add(new go.PathSegment(go.PathSegment.Line,.77*nt,.04*et)),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,.49*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.37*et)),st.add(new go.PathSegment(go.PathSegment.Line,.63*nt,.86*et)),st.add(new go.PathSegment(go.PathSegment.Line,.77*nt,.91*et)),st.add(new go.PathSegment(go.PathSegment.Line,.34*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.34*nt,.78*et)),st.add(new go.PathSegment(go.PathSegment.Line,.44*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.56*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.68*et).close()),ht}),go.Shape.defineFigureGenerator("FireHazard",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.1*nt,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.29*nt,0,-.25*nt,.63*et,.45*nt,.44*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.51*nt,.42*et,.48*nt,.17*et,.54*nt,.35*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.59*nt,.18*et,.59*nt,.29*et,.58*nt,.28*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,.6*et,.8*nt,.34*et,.88*nt,.43*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.88*nt,.31*et,.87*nt,.48*et,.88*nt,.43*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,et,1.17*nt,.76*et,.82*nt,.8*et).close()),ht.spot1=new go.Spot(.07,.445),ht.spot2=new go.Spot(.884,.958),ht}),go.Shape.defineFigureGenerator("BpmnActivityLoop",function(Bt,nt,et){var ht=new go.Geometry,st=.5,pt=0,vt=0,St=st*ee,Et=.4*Math.SQRT2/2+.5,Tt=.5-.5*Math.SQRT2/2,It=1,qt=.5,Xt=.5,Ht=0,pe=new go.PathFigure(Et*nt,(1-Tt)*et,!1);return ht.add(pe),pe.add(new go.PathSegment(go.PathSegment.Bezier,It*nt,qt*et,It*nt,.7*et,It*nt,qt*et)),pe.add(new go.PathSegment(go.PathSegment.Bezier,(Xt+pt)*nt,(Ht+pt)*et,(.5+st+pt)*nt,(.5-St+pt)*et,(.5+St+pt)*nt,(.5-st+pt)*et)),pe.add(new go.PathSegment(go.PathSegment.Bezier,(.5-st+pt)*nt,(.5+vt)*et,(.5-St+pt)*nt,(.5-st+vt)*et,(.5-st+pt)*nt,(.5-St+vt)*et)),pe.add(new go.PathSegment(go.PathSegment.Bezier,(.35+pt)*nt,.9*et,(.5-st+pt)*nt,(.5+St+vt)*et,(.5-St+pt)*nt,.9*et)),pe.add(new go.PathSegment(go.PathSegment.Move,(.25+pt)*nt,.8*et)),pe.add(new go.PathSegment(go.PathSegment.Line,(.35+pt)*nt,.9*et)),pe.add(new go.PathSegment(go.PathSegment.Line,(.2+pt)*nt,.95*et)),ht}),go.Shape.defineFigureGenerator("BpmnActivityParallel",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("BpmnActivitySequential",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Move,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Move,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("BpmnActivityAdHoc",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);ht.add(st);var pt=new go.PathFigure(nt,et,!1);ht.add(pt);var vt=new go.PathFigure(0,.5*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.5*et,.2*nt,.35*et,.3*nt,.35*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,.7*nt,.65*et,.8*nt,.65*et)),ht}),go.Shape.defineFigureGenerator("BpmnActivityCompensation",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et).close()),ht}),go.Shape.defineFigureGenerator("BpmnTaskMessage",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.2*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et).close());var st=new go.PathFigure(0,.2*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),ht}),go.Shape.defineFigureGenerator("BpmnTaskScript",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.7*nt,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,0,.6*nt,.5*et,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.7*nt,et,.4*nt,.5*et,nt,.5*et).close());var pt=new go.PathFigure(.45*nt,.73*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.73*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.38*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.63*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.31*nt,.27*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.56*nt,.27*et)),ht}),go.Shape.defineFigureGenerator("BpmnTaskUser",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);ht.add(st);var pt=new go.PathFigure(.335*nt,(1-.555)*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.335*nt,(1-.405)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.405)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.555)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.68*et,(1-.12)*nt,.46*et,(1-.02)*nt,.54*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.68*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.335*nt,(1-.555)*et,.02*nt,.54*et,.12*nt,.46*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.365*nt,(1-.595)*et));var vt=.5-.285,St=.5,Et=vt,Tt=Math.PI/4,It=4*(1-Math.cos(Tt))/(3*Math.sin(Tt)),qt=It*.5,Xt=vt,Ht=vt,pe=It*Xt,re=It*Ht;pt.add(new go.PathSegment(go.PathSegment.Bezier,(St-Xt)*nt,Et*et,(St-(pe+Xt)/2)*nt,(Et+(Ht+re)/2)*et,(St-Xt)*nt,(Et+re)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,St*nt,(Et-Ht)*et,(St-Xt)*nt,(Et-re)*et,(St-pe)*nt,(Et-Ht)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,(St+Xt)*nt,Et*et,(St+pe)*nt,(Et-Ht)*et,(St+Xt)*nt,(Et-re)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.365)*nt,(1-.595)*et,(St+Xt)*nt,(Et+re)*et,(St+(pe+Xt)/2)*nt,(Et+(Ht+re)/2)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.365)*nt,(1-.595)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.555)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.405)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.335*nt,(1-.405)*et));var Ne=new go.PathFigure(.2*nt,et,!1);ht.add(Ne),Ne.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.8*et));var ye=new go.PathFigure(.8*nt,et,!1);return ht.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.8*et)),ht}),go.Shape.defineFigureGenerator("BpmnEventConditional",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.1*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,et).close());var pt=new go.PathFigure(.2*nt,.2*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.8*et)),ht}),go.Shape.defineFigureGenerator("BpmnEventError",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.66*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.66*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("BpmnEventEscalation",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);ht.add(st);var pt=new go.PathFigure(nt,et,!1);ht.add(pt);var vt=new go.PathFigure(.1*nt,et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("Caution",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.05*nt,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,.8*et,0,et,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.55*nt,.1*et,.5*nt,0,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.95*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,et,nt,et,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.05*nt,et));var pt=.05;return st.add(new go.PathSegment(go.PathSegment.Move,(.5-pt)*nt,.875*et)),st.add(new go.PathSegment(go.PathSegment.Arc,180,-360,.5*nt,.875*et,pt*nt,pt*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.325*et,.575*nt,.725*et,.625*nt,.375*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.75*et,.375*nt,.375*et,.425*nt,.725*et)),ht}),go.Shape.defineFigureGenerator("Recycle",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.45*nt,.95*et,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.185*nt,.85*et,.17*nt,.95*et,.15*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.235*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.625*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,.65*et)),st.add(new go.PathSegment(go.PathSegment.Line,.275*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.05*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.05*nt,.575*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.1875*nt,.95*et,0,.675*et,0,.7*et)),st.add(new go.PathSegment(go.PathSegment.Move,.45*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.775*et)),st.add(new go.PathSegment(go.PathSegment.Line,.22*nt,.775*et));var pt=new go.PathFigure(.475*nt,.2*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.225*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.275*nt,.175*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.325*nt,.05*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,.05*et,.35*nt,0,.375*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.375*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.475*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.315*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.32*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.05*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.575*nt,0,.65*nt,.05*et,.625*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.38*nt,.0105*et));var vt=new go.PathFigure(.675*nt,.575*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.875*nt,.525*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.85*nt,.95*et,nt,.8*et,nt,.85*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.95*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.85*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.725*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Move,.675*nt,.575*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.775*nt,.775*et)),ht}),go.Shape.defineFigureGenerator("BpmnEventTimer",function(Bt,nt,et){var ht=new go.Geometry,st=.5,pt=ee*.5,vt=new go.PathFigure(nt,st*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,st*nt,et,nt,(st+pt)*et,(st+pt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,st*et,(st-pt)*nt,et,0,(st+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,st*nt,0,0,(st-pt)*et,(st-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,st*et,(st+pt)*nt,0,nt,(st-pt)*et));var St=new go.PathFigure(st*nt,0,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,st*nt,.15*et)),St.add(new go.PathSegment(go.PathSegment.Move,st*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,st*nt,.85*et)),St.add(new go.PathSegment(go.PathSegment.Move,0,st*et)),St.add(new go.PathSegment(go.PathSegment.Line,.15*nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Move,nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Line,.85*nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Move,st*nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Line,.58*nt,.1*et)),St.add(new go.PathSegment(go.PathSegment.Move,st*nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Line,.78*nt,.54*et)),ht}),go.Shape.defineFigureGenerator("Package",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.15*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var pt=new go.PathFigure(0,.15*et,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.15*et).close()),ht.spot1=new go.Spot(0,.1),ht.spot2=new go.Spot(1,1),ht}),go.Shape.defineFigureGenerator("Class",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(0,.2*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et).close());var vt=new go.PathFigure(0,.5*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("Component",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et).close());var pt=new go.PathFigure(0,.2*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.2*et).close());var vt=new go.PathFigure(0,.6*et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.6*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.6*et).close()),ht}),go.Shape.defineFigureGenerator("Boat Shipment",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.15*nt,.6*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.85*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.6*et));var pt=new go.PathFigure(.15*nt,.6*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),ht}),go.Shape.defineFigureGenerator("Customer/Supplier",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.66*nt,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,.66*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et).close()),ht}),go.Shape.defineFigureGenerator("Workcell",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("Supermarket",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.33*et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.66*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.66*et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,.66*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),ht}),go.Shape.defineFigureGenerator("TruckShipment",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(nt,.8*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et).close());var vt=.1,St=ee*.1,Et=.2,Tt=.9,It=new go.PathFigure((Et-vt)*nt,Tt*et,!0);ht.add(It),It.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-vt)*et,(Et-vt)*nt,(Tt-St)*et,(Et-St)*nt,(Tt-vt)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,(Et+vt)*nt,Tt*et,(Et+St)*nt,(Tt-vt)*et,(Et+vt)*nt,(Tt-St)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt+vt)*et,(Et+vt)*nt,(Tt+St)*et,(Et+St)*nt,(Tt+vt)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,(Et-vt)*nt,Tt*et,(Et-St)*nt,(Tt+vt)*et,(Et-vt)*nt,(Tt+St)*et).close()),vt=.1,St=ee*.1,Et=.8,Tt=.9;var qt=new go.PathFigure((Et-vt)*nt,Tt*et,!0);return ht.add(qt),qt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-vt)*et,(Et-vt)*nt,(Tt-St)*et,(Et-St)*nt,(Tt-vt)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,(Et+vt)*nt,Tt*et,(Et+St)*nt,(Tt-vt)*et,(Et+vt)*nt,(Tt-St)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt+vt)*et,(Et+vt)*nt,(Tt+St)*et,(Et+St)*nt,(Tt+vt)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-vt)*nt,Tt*et,(Et-St)*nt,(Tt+vt)*et,(Et-vt)*nt,(Tt+St)*et).close()),ht}),go.Shape.defineFigureGenerator("KanbanPost",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.2*nt,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,0)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),ht}),go.Shape.defineFigureGenerator("Forklift",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,0));var pt=new go.PathFigure(0,.5*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.5*et));var vt=new go.PathFigure(.5*nt,.8*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.8*et));var St=new go.PathFigure(.5*nt,.7*et,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et));var Et=.1,Tt=ee*.1,It=.1,qt=.9,Xt=new go.PathFigure((It-Et)*nt,qt*et,!0);ht.add(Xt),Xt.add(new go.PathSegment(go.PathSegment.Bezier,It*nt,(qt-Et)*et,(It-Et)*nt,(qt-Tt)*et,(It-Tt)*nt,(qt-Et)*et)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,(It+Et)*nt,qt*et,(It+Tt)*nt,(qt-Et)*et,(It+Et)*nt,(qt-Tt)*et)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,It*nt,(qt+Et)*et,(It+Et)*nt,(qt+Tt)*et,(It+Tt)*nt,(qt+Et)*et)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,(It-Et)*nt,qt*et,(It-Tt)*nt,(qt+Et)*et,(It-Et)*nt,(qt+Tt)*et)),Et=.1,Tt=ee*.1,It=.4,qt=.9;var Ht=new go.PathFigure((It-Et)*nt,qt*et,!0);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,It*nt,(qt-Et)*et,(It-Et)*nt,(qt-Tt)*et,(It-Tt)*nt,(qt-Et)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(It+Et)*nt,qt*et,(It+Tt)*nt,(qt-Et)*et,(It+Et)*nt,(qt-Tt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,It*nt,(qt+Et)*et,(It+Et)*nt,(qt+Tt)*et,(It+Tt)*nt,(qt+Et)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(It-Et)*nt,qt*et,(It-Tt)*nt,(qt+Et)*et,(It-Et)*nt,(qt+Tt)*et)),ht}),go.Shape.defineFigureGenerator("RailShipment",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.1*nt,.4*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.4*et).close());var pt=new go.PathFigure(.45*nt,.7*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.7*et));var vt=new go.PathFigure(.55*nt,.4*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.4*et).close());var It=.05,qt=ee*.05,Xt=.175,Ht=.95,St=new go.PathFigure((Xt-It)*nt,Ht*et,!0);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht-It)*et,(Xt-It)*nt,(Ht-qt)*et,(Xt-qt)*nt,(Ht-It)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,(Xt+It)*nt,Ht*et,(Xt+qt)*nt,(Ht-It)*et,(Xt+It)*nt,(Ht-qt)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht+It)*et,(Xt+It)*nt,(Ht+qt)*et,(Xt+qt)*nt,(Ht+It)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,(Xt-It)*nt,Ht*et,(Xt-qt)*nt,(Ht+It)*et,(Xt-It)*nt,(Ht+qt)*et));var It=.05,qt=ee*.05,Xt=.375,Ht=.95,Et=new go.PathFigure((Xt-It)*nt,Ht*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht-It)*et,(Xt-It)*nt,(Ht-qt)*et,(Xt-qt)*nt,(Ht-It)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(Xt+It)*nt,Ht*et,(Xt+qt)*nt,(Ht-It)*et,(Xt+It)*nt,(Ht-qt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht+It)*et,(Xt+It)*nt,(Ht+qt)*et,(Xt+qt)*nt,(Ht+It)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(Xt-It)*nt,Ht*et,(Xt-qt)*nt,(Ht+It)*et,(Xt-It)*nt,(Ht+qt)*et));var It=.05,qt=ee*.05,Xt=.625,Ht=.95,Tt=new go.PathFigure((Xt-It)*nt,Ht*et,!0);ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht-It)*et,(Xt-It)*nt,(Ht-qt)*et,(Xt-qt)*nt,(Ht-It)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(Xt+It)*nt,Ht*et,(Xt+qt)*nt,(Ht-It)*et,(Xt+It)*nt,(Ht-qt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht+It)*et,(Xt+It)*nt,(Ht+qt)*et,(Xt+qt)*nt,(Ht+It)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(Xt-It)*nt,Ht*et,(Xt-qt)*nt,(Ht+It)*et,(Xt-It)*nt,(Ht+qt)*et));var It=.05,qt=ee*.05,Xt=.825,Ht=.95,pe=new go.PathFigure((Xt-It)*nt,Ht*et,!0);ht.add(pe),pe.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht-It)*et,(Xt-It)*nt,(Ht-qt)*et,(Xt-qt)*nt,(Ht-It)*et)),pe.add(new go.PathSegment(go.PathSegment.Bezier,(Xt+It)*nt,Ht*et,(Xt+qt)*nt,(Ht-It)*et,(Xt+It)*nt,(Ht-qt)*et)),pe.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht+It)*et,(Xt+It)*nt,(Ht+qt)*et,(Xt+qt)*nt,(Ht+It)*et)),pe.add(new go.PathSegment(go.PathSegment.Bezier,(Xt-It)*nt,Ht*et,(Xt-qt)*nt,(Ht+It)*et,(Xt-It)*nt,(Ht+qt)*et).close());var re=new go.PathFigure(0,et,!1);return ht.add(re),re.add(new go.PathSegment(go.PathSegment.Line,nt,et).close()),ht}),go.Shape.defineFigureGenerator("Warehouse",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(0,.2*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et).close());var vt=new go.PathFigure(.15*nt,et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,et).close());var St=.05,Et=ee*.05,Tt=.35,It=.775,qt=new go.PathFigure((Tt-St)*nt,It*et,!0);return ht.add(qt),qt.add(new go.PathSegment(go.PathSegment.Bezier,Tt*nt,(It-St)*et,(Tt-St)*nt,(It-Et)*et,(Tt-Et)*nt,(It-St)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,(Tt+St)*nt,It*et,(Tt+Et)*nt,(It-St)*et,(Tt+St)*nt,(It-Et)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,Tt*nt,(It+St)*et,(Tt+St)*nt,(It+Et)*et,(Tt+Et)*nt,(It+St)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,(Tt-St)*nt,It*et,(Tt-Et)*nt,(It+St)*et,(Tt-St)*nt,(It+Et)*et).close()),ht}),go.Shape.defineFigureGenerator("ControlCenter",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,.1*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et).close()),ht}),go.Shape.defineFigureGenerator("Bluetooth",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.75*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),ht}),go.Shape.defineFigureGenerator("Bookmark",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.4*et)),ht}),go.Shape.defineFigureGenerator("Bookmark",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.4*et)),ht}),go.Shape.defineFigureGenerator("Globe",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Move,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,.75*nt,0,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,.75*et,.75*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,.25*nt,et,0,.75*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,.25*et,.25*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,.15*nt,.25*et,.15*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,.85*nt,.75*et,.85*nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Move,.1675*nt,.15*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.8325*nt,.15*et,.35*nt,.3*et,.65*nt,.3*et)),st.add(new go.PathSegment(go.PathSegment.Move,.1675*nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.8325*nt,.85*et,.35*nt,.7*et,.65*nt,.7*et)),ht}),go.Shape.defineFigureGenerator("Wave",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.25*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.25*et,.1*nt,0,.2*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.7*nt,.25*et,.425*nt,.5*et,.575*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.25*et,.8*nt,0,.9*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Move,0,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.75*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.75*et,.1*nt,.5*et,.2*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.7*nt,.75*et,.425*nt,et,.575*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.75*et,.8*nt,.5*et,.9*nt,.5*et)),ht}),go.Shape.defineFigureGenerator("Operator",function(Bt,nt,et){var ht=new go.Geometry,st=.3,pt=ee*.3,vt=.5,St=.7,Et=new go.PathFigure((vt-st)*nt,St*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et));var Tt=new go.PathFigure(0,.7*et,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.7*et,0,0,nt,0)),ht}),go.Shape.defineFigureGenerator("TripleFanBlades",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.65*et,.65*nt,.3*et,.65*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,.35*nt,.5*et,.35*nt,.3*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.65*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,et,.3*nt,.6*et,.1*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.65*et,.2*nt,et,.35*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.65*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,et,.7*nt,.6*et,.9*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.65*et,.8*nt,et,.65*nt,.95*et)),ht}),go.Shape.defineFigureGenerator("CentrifugalPump",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,0,.075*et,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,et,0,et,.4*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.4*et,.8*nt,et,.85*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),ht}),go.Shape.defineFigureGenerator("Battery",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,.4*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.1*et));var pt=new go.PathFigure(0,.6*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,0,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),ht}),go.Shape.defineFigureGenerator("Delete",function(Bt,nt,et){var ht=new go.Geometry,st=.5,pt=ee*.5,vt=.5,St=.5,Et=new go.PathFigure((vt-st)*nt,St*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et));var Tt=new go.PathFigure(.15*nt,.5*et,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.5*et)),ht}),go.Shape.defineFigureGenerator("Flag",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.1*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,0,.1*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.1*et,.15*nt,0,.35*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,.65*nt,.2*et,.85*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.5*et,.85*nt,.6*et,.65*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,.35*nt,.4*et,.15*nt,.4*et).close()),ht}),go.Shape.defineFigureGenerator("Help",function(Bt,nt,et){var ht=new go.Geometry,st=.5,pt=ee*.5,vt=.5,St=.5,Et=new go.PathFigure((vt-st)*nt,St*et,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et).close()),st=.05,pt=ee*.05,vt=.5,St=.8;var Tt=new go.PathFigure((vt-st)*nt,St*et,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et).close()),Tt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.7*et)),Tt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.2*et,.75*nt,.475*et,.75*nt,.225*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.35*et,.4*nt,.2*et,.3*nt,.25*et)),ht}),go.Shape.defineFigureGenerator("Location",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.5*nt,et,!0).add(new go.PathSegment(go.PathSegment.Line,.75*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,.975*nt,.025*et,.5*nt,0)).add(new go.PathSegment(go.PathSegment.Bezier,.25*nt,.5*et,.5*nt,0,.025*nt,.025*et).close()).add(new go.PathSegment(go.PathSegment.Move,.5*nt,.2*et)).add(new go.PathSegment(go.PathSegment.Arc,270,360,.5*nt,.3*et,.1*nt,.1*et).close()))}),go.Shape.defineFigureGenerator("Lock",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et));var pt=new go.PathFigure(.2*nt,.5*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.3*et,.25*nt,0,.75*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.3*et)),ht}),go.Shape.defineFigureGenerator("Unlocked",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et));var pt=new go.PathFigure(.2*nt,.5*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.3*et,.25*nt,0,.75*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.35*et)),ht}),go.Shape.defineFigureGenerator("Gear",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.9375*nt,.56246875*et,!0).add(new go.PathSegment(go.PathSegment.Line,.9375*nt,.4375*et)).add(new go.PathSegment(go.PathSegment.Line,.80621875*nt,.4375*et)).add(new go.PathSegment(go.PathSegment.Bezier,.763*nt,.3316875*et,.79840625*nt,.39915625*et,.7834375*nt,.3635*et)).add(new go.PathSegment(go.PathSegment.Line,.8566875*nt,.23796875*et)).add(new go.PathSegment(go.PathSegment.Line,.76825*nt,.14959375*et)).add(new go.PathSegment(go.PathSegment.Line,.67596875*nt,.24184375*et)).add(new go.PathSegment(go.PathSegment.Bezier,.5625*nt,.19378125*et,.64228125*nt,.2188125*et,.603875*nt,.2021875*et)).add(new go.PathSegment(go.PathSegment.Line,.5625*nt,.0625*et)).add(new go.PathSegment(go.PathSegment.Line,.4375*nt,.0625*et)).add(new go.PathSegment(go.PathSegment.Line,.4375*nt,.19378125*et)).add(new go.PathSegment(go.PathSegment.Bezier,.32775*nt,.239375*et,.39759375*nt,.20190625*et,.36053125*nt,.2176875*et)).add(new go.PathSegment(go.PathSegment.Line,.2379375*nt,.14959375*et)).add(new go.PathSegment(go.PathSegment.Line,.14953125*nt,.2379375*et)).add(new go.PathSegment(go.PathSegment.Line,.23934375*nt,.3278125*et)).add(new go.PathSegment(go.PathSegment.Bezier,.19378125*nt,.4375*et,.21765625*nt,.36059375*et,.201875*nt,.397625*et)).add(new go.PathSegment(go.PathSegment.Line,.0625*nt,.4375*et)).add(new go.PathSegment(go.PathSegment.Line,.0625*nt,.5625*et)).add(new go.PathSegment(go.PathSegment.Line,.1938125*nt,.5625*et)).add(new go.PathSegment(go.PathSegment.Bezier,.241875*nt,.67596875*et,.20221875*nt,.603875*et,.21884375*nt,.64228125*et)).add(new go.PathSegment(go.PathSegment.Line,.1495625*nt,.76825*et)).add(new go.PathSegment(go.PathSegment.Line,.238*nt,.8566875*et)).add(new go.PathSegment(go.PathSegment.Line,.3316875*nt,.76296875*et)).add(new go.PathSegment(go.PathSegment.Bezier,.43753125*nt,.80621875*et,.36353125*nt,.78340625*et,.3991875*nt,.79840625*et)).add(new go.PathSegment(go.PathSegment.Line,.43753125*nt,.9375*et)).add(new go.PathSegment(go.PathSegment.Line,.5625*nt,.9375*et)).add(new go.PathSegment(go.PathSegment.Line,.5625*nt,.80621875*et)).add(new go.PathSegment(go.PathSegment.Bezier,.67225*nt,.760625*et,.602375*nt,.79809375*et,.63946875*nt,.78234375*et)).add(new go.PathSegment(go.PathSegment.Line,.76828125*nt,.8566875*et)).add(new go.PathSegment(go.PathSegment.Line,.85671875*nt,.76825*et)).add(new go.PathSegment(go.PathSegment.Line,.76065625*nt,.67221875*et)).add(new go.PathSegment(go.PathSegment.Bezier,.80621875*nt,.56246875*et,.78234375*nt,.63940625*et,.798125*nt,.602375*et)).add(new go.PathSegment(go.PathSegment.Line,.9375*nt,.56246875*et).close()).add(new go.PathSegment(go.PathSegment.Move,.5*nt,.6*et)).add(new go.PathSegment(go.PathSegment.Arc,90,360,.5*nt,.5*et,.1*nt,.1*et).close()))}),go.Shape.defineFigureGenerator("Hand",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,.3*et,0,.375*et,.05*nt,.325*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.45*nt,.075*et,.3*nt,.225*et,.4*nt,.175*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.525*nt,.075*et,.46*nt,.05*et,.525*nt,.05*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.4*et,.525*nt,.275*et,.475*nt,.325*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,.55*et,nt,.4*et,nt,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,.425*nt,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.55*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.6*nt,.7*et,.675*nt,.55*et,.675*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.575*nt,.85*et,.65*nt,.7*et,.65*nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.535*nt,et,.61*nt,.85*et,.61*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,.435*nt,et,0,et).close()),ht}),go.Shape.defineFigureGenerator("Map",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.2*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),st.add(new go.PathSegment(go.PathSegment.Move,.25*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Move,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.8*et)),ht}),go.Shape.defineFigureGenerator("Eject",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et*.7)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.7).close());var pt=new go.PathFigure(0,et*.6,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0).close()),ht}),go.Shape.defineFigureGenerator("Pencil",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.2*nt,.1*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.1*nt,.2*et).close()))}),go.Shape.defineFigureGenerator("Building",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*1,et*1,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.85)),st.add(new go.PathSegment(go.PathSegment.Line,.046*nt,et*.85)),st.add(new go.PathSegment(go.PathSegment.Line,.046*nt,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.3)),st.add(new go.PathSegment(go.PathSegment.Line,.046*nt,et*.3)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*nt,et*.3)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et*.3)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*nt,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*nt,et*.85)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et*.85).close());var pt=new go.PathFigure(.126*nt,.85*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.126*nt,.45*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.322*nt,.45*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.322*nt,.85*et).close());var vt=new go.PathFigure(.402*nt,.85*et,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.402*nt,.45*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.598*nt,.45*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.598*nt,.85*et).close());var St=new go.PathFigure(.678*nt,.85*et,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.678*nt,.45*et)),St.add(new go.PathSegment(go.PathSegment.Line,.874*nt,.45*et)),St.add(new go.PathSegment(go.PathSegment.Line,.874*nt,.85*et).close());var Et=new go.PathFigure(.5*nt,.1*et,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,(.046+.15)*nt,.3*et)),Et.add(new go.PathSegment(go.PathSegment.Line,(1-(.046+.15))*nt,.3*et).close()),ht}),go.Shape.defineFigureGenerator("Staircase",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et*1,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*.8)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.8)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.6)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.6)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.4)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*.4)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*.2)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.2)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.15)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.15)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.35)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.35)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.15,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.15,et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.95).close()),ht}),go.Shape.defineFigureGenerator("5Bars",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et*1,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.184,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.184,et*(1-.184)).close());var pt=new go.PathFigure(nt*.204,et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.204,et*(1-.184))),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.388,et*(1-.184*2))),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.388,et*1).close());var vt=new go.PathFigure(nt*.408,et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.408,et*(1-.184*2))),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.592,et*(1-.184*3))),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.592,et*1).close());var St=new go.PathFigure(nt*.612,et,!0);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt*.612,et*(1-.184*3))),St.add(new go.PathSegment(go.PathSegment.Line,nt*.796,et*(1-.184*4))),St.add(new go.PathSegment(go.PathSegment.Line,nt*.796,et*1).close());var Et=new go.PathFigure(nt*.816,et,!0);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.816,et*(1-.184*4))),Et.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-.184*5))),Et.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1).close()),ht}),go.Shape.defineFigureGenerator("PC",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,0).close());var pt=new go.PathFigure(nt*.055,.07*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.07)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.055,et*.1).close());var vt=new go.PathFigure(nt*.055,.13*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.13)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.16)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.055,et*.16).close());var St=new go.PathFigure(nt*.055,.18*et,!0);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.18)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.21)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.055,et*.21).close());var Et=new go.PathFigure(nt*1,0,!0);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.4,0)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.65)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.65).close()),ht}),go.Shape.defineFigureGenerator("Plane",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.55*nt,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.475*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.35*nt,.525*et,0,.4*et,.225*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.475*et)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.35*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.325*et)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.325*et)),st.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,.2*et,.975*nt,0,nt,.08*et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Line,.55*nt,et).close()),ht}),go.Shape.defineFigureGenerator("Key",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*1,et*.5,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.9,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.35*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,.35*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.15,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.35*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.65*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.15,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,.65*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.65*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.6,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.65,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.7,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.85,.575*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.9,.6*et).close()),st.add(new go.PathSegment(go.PathSegment.Move,.17*nt,.425*et)),st.add(new go.PathSegment(go.PathSegment.Arc,270,360,.17*nt,.5*et,.075*nt,.075*et).close()),ht}),go.Shape.defineFigureGenerator("FilmTape",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,270,180,nt*0,nt*.3,nt*.055)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.08,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.08,et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*1),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*1),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*2),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*2),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*3),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*3),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*4),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*4),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*5),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*5),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*6),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*6),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*7),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*7),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*8),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*8),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*9),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*9),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*10),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*10),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*11),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*11),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*12),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*12),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*13),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*13),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*14),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*14),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*15),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*15),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1));var pt=new go.PathFigure(0,0,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*0)),pt.add(new go.PathSegment(go.PathSegment.Arc,270,-180,nt*1,nt*.3,nt*.055)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1));var vt=new go.PathFigure(nt*.11,et*.1,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*1+.028*0),et*.1)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*1+.028*0),et*.8)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.11,et*.8).close());var St=new go.PathFigure(nt*(.11+.24133333*1+.028*1),et*.1,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*2+.028*1),et*.1)),St.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*2+.028*1),et*.8)),St.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*1+.028*1),et*.8).close());var Et=new go.PathFigure(nt*(.11+.24133333*2+.028*2),et*.1,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*3+.028*2),et*.1)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*3+.028*2),et*.8)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*2+.028*2),et*.8).close()),ht}),go.Shape.defineFigureGenerator("FloppyDisk",function(Bt,nt,et){var ht=new go.Geometry,st=8,pt=st*ee,vt=new go.PathFigure(st,0,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.86,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.14)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et-st)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-st,et,nt,et-pt,nt-pt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,st,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-st,pt,et,0,et-pt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,st)),vt.add(new go.PathSegment(go.PathSegment.Bezier,st,0,0,pt,pt,0).close());var St=new go.PathFigure(nt*.83,0,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt*.83,et*.3)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*.3)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*0).close());var Et=new go.PathFigure(nt*.83,et*1,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.83,et*.5)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*.5)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*1).close());var Tt=new go.PathFigure(nt*.78,et*.05,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.05)),Tt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.25)),Tt.add(new go.PathSegment(go.PathSegment.Line,nt*.78,et*.25).close()),ht}),go.Shape.defineFigureGenerator("SpeechBubble",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=15),ht=Math.min(ht,nt/3),ht=Math.min(ht,et/3);var st=ht*ee,pt=et*.8,vt=new go.Geometry,St=new go.PathFigure(ht,0,!0);return vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt-ht,0)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt,ht,nt-st,0,nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,nt,pt-ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,pt,nt,pt-st,nt-st,pt)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.7,pt)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.55,pt)),St.add(new go.PathSegment(go.PathSegment.Line,ht,pt)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,pt-ht,st,pt,0,pt-st)),St.add(new go.PathSegment(go.PathSegment.Line,0,ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,st,st,0).close()),st>1?(vt.spot1=new go.Spot(0,0,st,st),vt.spot2=new go.Spot(1,.8,-st,-st)):(vt.spot1=go.Spot.TopLeft,vt.spot2=new go.Spot(1,.8)),vt}),go.Shape.defineFigureGenerator("Repeat",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*.45,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*.9)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.9)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.65,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*.45).close());var pt=new go.PathFigure(nt*1,et*.55,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*1)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.55)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*.55)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*.55).close()),ht}),go.Shape.defineFigureGenerator("Windows",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close()).add(new go.PathSegment(go.PathSegment.Move,.4*nt,.4*et)).add(new go.PathSegment(go.PathSegment.Line,.4*nt,.8*et)).add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)).add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et).close()).add(new go.PathSegment(go.PathSegment.Move,.2*nt,.1*et)).add(new go.PathSegment(go.PathSegment.Line,.2*nt,.6*et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,.6*et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,.1*et).close()).add(new go.PathSegment(go.PathSegment.Move,.1*nt,.6*et)).add(new go.PathSegment(go.PathSegment.Line,.1*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et).close()))}),go.Shape.defineFigureGenerator("Terminal",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*.1,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.9)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*.9).close());var pt=new go.PathFigure(nt*.1,et*.2,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.25)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.22,et*.285)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.32)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.37)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.275,et*.32)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.275,et*.25).close());var vt=new go.PathFigure(nt*.28,et*.37,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.37)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.41)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.28,et*.41).close()),ht}),go.Shape.defineFigureGenerator("Beaker",function(Bt,nt,et){var ht=new go.Geometry,st=15,pt=st*ee,vt=new go.PathFigure(nt*.62,et*.475,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et-st)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-st,et,nt,et-pt,nt-pt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,st,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-st,pt,et,0,et-pt)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.38,et*.475)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.38,et*.03)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.62,et*.03).close()),pt>1?(ht.spot1=new go.Spot(0,0,pt,pt),ht.spot2=new go.Spot(1,1,-pt,-pt)):(ht.spot1=go.Spot.TopLeft,ht.spot2=go.Spot.BottomRight),ht}),go.Shape.defineFigureGenerator("Download",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*1,!0);ht.add(st);var pt=.1/.3;st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.755,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.93,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.61,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.39,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.755),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.8),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*(1-pt)).close());var vt=new go.PathFigure(nt*.4,et*0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.26,et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.66)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.26),et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*0).close()),ht}),go.Shape.defineFigureGenerator("Bin",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*1,!0);ht.add(st);var pt=.1/.3;return st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.755,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.93,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.61,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.39,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.755),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.8),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*(1-pt)).close()),ht}),go.Shape.defineFigureGenerator("Upload",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*1,!0);ht.add(st);var pt=.1/.3;st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.755,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.93,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.61,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.39,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.755),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.8),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*(1-pt)).close());var vt=new go.PathFigure(nt*.5,et*0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.26,et*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.63)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.63)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.74,et*.25).close()),ht}),go.Shape.defineFigureGenerator("EmptyDrink",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*.15,et*0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.85,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*1).close()),ht}),go.Shape.defineFigureGenerator("Drink",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*.15,et*0,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.85,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*1).close());var pt=new go.PathFigure(nt*.235,et*.28,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.765,et*.28)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.655,et*.97)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.345,et*.97).close()),ht}),go.Shape.defineFigureGenerator("4Arrows",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*.5,et*0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.65,et*.25)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.25)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.35)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.5)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.65)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.65,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.65)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*.5)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.35)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.25)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.25).close()),ht}),go.Shape.defineFigureGenerator("Connector","Ellipse"),go.Shape.defineFigureGenerator("Alternative","TriangleUp"),go.Shape.defineFigureGenerator("Merge","TriangleUp"),go.Shape.defineFigureGenerator("Decision","Diamond"),go.Shape.defineFigureGenerator("DataTransmissions","Hexagon"),go.Shape.defineFigureGenerator("Gate","Crescent"),go.Shape.defineFigureGenerator("Delay","HalfEllipse"),go.Shape.defineFigureGenerator("Input","Parallelogram1"),go.Shape.defineFigureGenerator("ManualLoop","ManualOperation"),go.Shape.defineFigureGenerator("ISOProcess","Chevron"),go.Shape.defineFigureGenerator("MessageToUser","SquareArrow"),go.Shape.defineFigureGenerator("MagneticData","Cylinder1"),go.Shape.defineFigureGenerator("DirectData","Cylinder4"),go.Shape.defineFigureGenerator("StoredData","DataStorage"),go.Shape.defineFigureGenerator("SequentialData","MagneticTape"),go.Shape.defineFigureGenerator("Subroutine","Procedure")},43001: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 Mn={},Rn="5.0",kt={},gt=null,Ut=!1,ue=!1,Ee=null,he=!1,Dt=null,ee=null,ge=0;ge<arguments.length;ge++){var Qt=arguments[ge];if(Qt!==null)switch(typeof Qt){case"number":Rn=Qt.toFixed(1);break;case"string":Qt.match(new RegExp("^[0-9]\\.[0-9]+$"))?Rn=Qt:Ee=Qt;break;case"object":typeof Qt.is3D!="undefined"?gt=Qt:kt=Qt;break;case"boolean":Ut=Qt,ue=!0;break}}gt===null&&(gt={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&&!ue&&(Ut=!0)),Ee!==null&&kt.id===void 0&&(kt.id=Ee);var jt="",Ae="",se=!1,Pe=null,Bt=null,nt=null,et=!1,ht=null,st=null,pt=null,vt=null,St=null;kt.height!==void 0&&(kt.height=Math.round(kt.height)),kt.width!==void 0&&(kt.width=Math.round(kt.width));var Et=function(De){return parseFloat(De)>4?parseFloat(De):5};Mn.setHTML5Codebase=function(De,on){ee=De,Xe(De,on)},Mn.setJavaCodebase=Mn.setJavaCodebaseVersion=Mn.isCompiledInstalled=Mn.setPreCompiledScriptPath=Mn.setPreCompiledResourcePath=function(){},Mn.setHTML5CodebaseVersion=function(De,on){var un=parseFloat(De);if(un!==NaN&&un<5){console.log("The GeoGebra HTML5 codebase version "+un+" is deprecated. Using version latest instead.");return}Dt=De,Jt(De,on)},Mn.getHTML5CodebaseVersion=function(){return Bt},Mn.getParameters=function(){return kt},Mn.setFontsCSSURL=function(De){vt=De},Mn.setGiacJSURL=function(De){},Mn.setJNLPFile=function(De){jt=De},Mn.setJNLPBaseDir=function(De){},Mn.inject=function(){function De(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var on="auto",un=kt.id,Kn,Me=!1,vn=0;vn<arguments.length;vn++){var ne=arguments[vn];typeof ne=="string"?(ne=ne.toLowerCase(),ne.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?on=ne:un=arguments[vn]):typeof ne=="boolean"?Me=ne:ne instanceof HTMLElement&&(Kn=ne)}wn();function wn(){if(!he){setTimeout(wn,200);return}on=fn(on);var fi=Kn||document.getElementById(un);if(!fi){console.log("possibly bug on ajax loading? ");return}if(Mn.removeExistingApplet(fi,!1),kt.width===void 0&&fi.clientWidth&&(kt.width=fi.clientWidth),kt.height===void 0&&fi.clientHeight&&(kt.height=fi.clientHeight),!(kt.width&&kt.height)&&on==="html5"&&(delete kt.width,delete kt.height),Pe=on,on==="screenshot")ye(fi,kt);else{var Rt=!1;kt.hasOwnProperty("playButton")&&kt.playButton||kt.hasOwnProperty("clickToLoad")&&kt.clickToLoad?Rt=!0:kt.hasOwnProperty("playButtonAutoDecide")&&kt.playButtonAutoDecide&&(Rt=(!Tt()||De())&&It()),Rt?(Pe="screenshot",Ue(fi,kt,Me,on)):Ne(fi,kt,Me)}}};function Tt(){try{return window.self!==window.top}catch(De){return!0}}function It(){return kt.hasOwnProperty("screenshotGenerator")&&kt.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}Mn.getViews=function(){return gt},Mn.isJavaInstalled=function(){return!1};var qt=function(De){var on=function(vn){var ne=JSON.parse(vn),wn=function(Lt){return Lt.type=="G"||Lt.type=="E"},fi=ne.elements?ne.elements.filter(wn)[0]:ne;if(!fi||!fi.url){un();return}kt.fileName=fi.url,Xt(fi.settings||{}),gt.is3D=!0;var Rt="https://www.geogebra.org/images/";Mn.setPreviewImage(ht||fi.previewUrl,Rt+"GeoGebra_loading.png",Rt+"applet_play.png"),De()},un=function(){kt.onError&&kt.onError(),On("Error: Fetching material (id "+kt.material_id+") failed.",kt)},Kn=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",Me="/materials/"+kt.material_id+"?scope=basic";Ht("https://"+Kn+"/api/proxy.php?path="+encodeURIComponent(Me),on,un)};function Xt(De){var on=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(un){De[un]=!!De[un]}),on.forEach(function(un){kt[un]===void 0&&De[un]!==void 0&&(kt[un]=De[un])}),kt.showToolBarHelp===void 0&&(kt.showToolBarHelp=kt.showToolBar)}function Ht(De,on,un){var Kn=new XMLHttpRequest;Kn.open("GET",De),Kn.onload=function(){on(Kn.responseText)},Kn.onerror=un,Kn.send()}Mn.isHTML5Installed=function(){return!0},Mn.getLoadedAppletType=function(){return Pe},Mn.setPreviewImage=function(De,on,un){ht=De,st=on,pt=un},Mn.removeExistingApplet=function(De,on){var un;typeof De=="string"&&(De=document.getElementById(De)),Pe=null;var Kn=null;for(un=0;un<De.childNodes.length;un++){var Me=De.childNodes[un],vn=Me.className;vn==="applet_screenshot"?on?(Me.style.display="block",Pe="screenshot"):Me.style.display="none":vn!=="applet_scaler prerender"&&(De.removeChild(Me),Kn=vn&&vn.indexOf("appletParameters")!=-1?Me.id:null,un--)}var ne=kt.id!==void 0?kt.id:Kn,wn=window[ne];wn&&typeof wn.getBase64=="function"&&(wn.remove(),window[ne]=null)},Mn.refreshHitPoints=function(){if(Et(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var De=Mn.getAppletObject();return De&&typeof De.recalculateEnvironments=="function"?(De.recalculateEnvironments(),!0):!1},Mn.startAnimation=function(){var De=Mn.getAppletObject();return De&&typeof De.startAnimation=="function"?(De.startAnimation(),!0):!1},Mn.stopAnimation=function(){var De=Mn.getAppletObject();return De&&typeof De.stopAnimation=="function"?(De.stopAnimation(),!0):!1},Mn.getAppletObject=function(){var De=kt.id!==void 0?kt.id:"ggbApplet";return window[De]},Mn.resize=function(){};var pe=function(De,on,un){var Kn=document.createElement("param");Kn.setAttribute("name",on),Kn.setAttribute("value",un),De.appendChild(Kn)},re=function(De){return De&&De!=="false"},Ne=function(De,on,un){Et(Bt)<=4.2&&(un=!0);var Kn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==Bt||ggbHTML5LoadedCodebaseIsWebSimple&&!et)&&(Kn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var Me=document.createElement("div");Me.classList.add("appletParameters","notranslate");var vn=on.width,ne=on.height;if(on.disableAutoScale=on.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():on.disableAutoScale,on.width!==void 0)if(Et(Bt)<=4.4)re(on.showToolBar)&&(on.height-=7),re(on.showAlgebraInput)&&(on.height-=37),on.width<605&&re(on.showToolBar)&&(on.width=605,vn=605);else{var wn=100;(re(on.showToolBar)||re(on.showMenuBar))&&(on.hasOwnProperty("customToolBar")&&(on.customToolbar=on.customToolBar),wn=re(on.showMenuBar)?245:155),vn<wn&&(on.width=wn,vn=wn)}Me.style.border="none",Me.style.display="inline-block";for(var fi in on)on.hasOwnProperty(fi)&&fi!=="appletOnLoad"&&Me.setAttribute("data-param-"+fi,on[fi]);vt&&Me.setAttribute("data-param-fontscssurl",vt),Mn.resize=function(){GGBAppletUtils.responsiveResize(De,on)},window.addEventListener("resize",function(Fe){Mn.resize()});var Rt=typeof on.appletOnLoad=="function"?on.appletOnLoad:function(){};if(!un&&on.width!==void 0){on.hasOwnProperty("showSplash")||Me.setAttribute("data-param-showSplash","false");var Lt=De.querySelector(".applet_scaler.prerender"),Pt=Lt!==null;if(Pt)var Nt=Lt.querySelector(".ggb_preview");else{var Nt=Je(vn,ne,on.borderColor,!1);Lt=document.createElement("div"),Lt.className="applet_scaler",Lt.style.position="relative",Lt.style.display="block",Lt.style.width=vn+"px",Lt.style.height=ne+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Lt,"66%"),Et(Bt)>=5?(on.appletOnLoad=function(Fe){var He=De.querySelector(".ggb_preview");He&&He.parentNode.removeChild(He),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Lt),window.GGBT_wsf_view&&$(window).trigger("resize"),Rt(Fe)},Pt||Lt.appendChild(Nt)):Me.appendChild(Nt),Lt.appendChild(Me),Pt||De.appendChild(Lt),setTimeout(function(){Mn.resize()},1)}else{var Zt=document.createElement("div");Zt.className="applet_scaler",Zt.style.position="relative",Zt.style.display="block",Zt.appendChild(Me),De.appendChild(Zt),on.appletOnLoad=function(Fe){Mn.resize(),Rt(Fe)}}function Mt(Fe,He){He&&typeof He.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(Fe,He.appletOnLoad):renderGGBElement(Fe),On("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",He)}function Yt(Fe,He){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:Fe,params:He}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(Qe){Mt(Qe.article,Qe.params)}),html5AppletsToProcess=null)},Et(Bt)<5&&(Fe.className+=" geogebraweb")):Mt(Fe,He)}if(Kn){scriptLoadStarted=!0;for(var Ge=0;Ge<Me.childNodes.length;Ge++){var Oe=Me.childNodes[Ge].tagName;Oe==="TABLE"&&(Me.removeChild(Me.childNodes[Ge]),Ge--)}if(ggbHTML5LoadedScript!==null){var Ke=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');Ke!=null&&Ke.parentNode.removeChild(Ke)}var we=document.createElement("script"),Ce=function(){Yt(Me,on)};we.src=Ae+nt,ggbHTML5LoadedCodebaseIsWebSimple=et,ggbHTML5LoadedCodebaseVersion=Bt,ggbHTML5LoadedScript=we.src,On("GeoGebra HTML5 codebase loaded: '"+Ae+"'.",on),!ee&&(!Dt||Dt=="5.0")?(et?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),Ce()):Ae.requirejs?__webpack_require__.e(7963).then(function(){var Fe=[__webpack_require__(87963)];Ce.apply(null,Fe)}.bind(this)).catch(__webpack_require__.oe):(we.onload=Ce,De.appendChild(we))}else Yt(Me,on);on.height=ne,on.width=vn},ye=function(De,on,un){var Kn=Je(on.width,on.height,on.borderColor,un),Me=document.createElement("div");Me.style.position="relative",Me.style.display="block",Me.style.width=on.width+"px",Me.style.height=on.height+"px",Me.className="applet_screenshot applet_scaler"+(un?" applet_screenshot_play":""),Me.appendChild(Kn);var vn=GGBAppletUtils.getScale(on,De,un);un?(De.appendChild(je()),window.GGBT_wsf_view||(De.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Me,"66%"),De.appendChild(Me),vn!==1&&!isNaN(vn)&&(GGBAppletUtils.scaleElement(Me,vn),Me.style.width=on.width+"px",Me.style.height=on.height+"px",Me.parentNode.style.width=on.width*vn+"px",Me.parentNode.style.height=on.height*vn+"px"),Mn.resize=function(){xe(De,Kn,Me,un)},window.addEventListener("resize",function(ne){Mn.resize()}),Mn.resize()};function xe(De,on,un,Kn){if(De.contains(on)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(De.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(De)}var Me=GGBAppletUtils.getScale(kt,De,Kn);un.parentNode!==null&&(!isNaN(Me)&&Me!==1?(GGBAppletUtils.scaleElement(un,Me),un.parentNode.style.width=kt.width*Me+"px",un.parentNode.style.height=kt.height*Me+"px"):(GGBAppletUtils.scaleElement(un,1),un.parentNode.style.width=kt.width+"px",un.parentNode.style.height=kt.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(De),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}Mn.onExitFullscreen=function(De,on){on.appendChild(De)};var Ue=function(De,on,un,Kn){ye(De,on,!0);for(var Me=function(){var wn=[];for(ne=0;ne<De.childNodes.length;ne++)wn.push(De.childNodes[ne]);if(window.GGBT_wsf_view){var fi=window.GGBT_wsf_view.renderFullScreen(De,on.id),Rt=document.getElementById("fullscreencontainer"),Lt=jQuery(De).find(".fullscreencontent");Lt.length>0?(fi.remove(),Lt.attr("id","fullscreencontent").show(),jQuery(Rt).append(Lt),window.dispatchEvent(new Event("resize"))):Ne(fi,on,!1),window.GGBT_wsf_view.launchFullScreen(Rt)}else Pe=Kn,Ne(De,on,!1);if(!window.GGBT_wsf_view)for(ne=0;ne<wn.length;ne++)De.removeChild(wn[ne])},vn=De.getElementsByClassName("ggb_preview_play"),ne=0;ne<vn.length;ne++)vn[ne].addEventListener("click",Me,!1),vn[ne].addEventListener("ontouchstart",Me,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(De),It()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},je=function(){var De=document.createElement("div");if(De.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var on='.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");}',un=document.createElement("style");un.styleSheet?un.styleSheet.cssText=on:un.appendChild(document.createTextNode(on)),document.getElementsByTagName("head")[0].appendChild(un)}return De},Je=function(De,on,un,Kn){var Me=document.createElement("div");Me.className="ggb_preview",Me.style.position="absolute",Me.style.zIndex="90",Me.style.width=De-2+"px",Me.style.height=on-2+"px",Me.style.top="0px",Me.style.left="0px",Me.style.overflow="hidden",Me.style.backgroundColor="white";var vn="lightgrey";un!==void 0&&(un==="none"?vn="transparent":vn=un),Me.style.border="1px solid "+vn;var ne=document.createElement("img");if(ne.style.position="relative",ne.style.zIndex="1000",ne.style.top="-1px",ne.style.left="-1px",ht!==null&&ne.setAttribute("src",ht),ne.style.opacity=.7,st!==null){var wn,fi,Rt;if(!Kn){wn=document.createElement("img"),wn.style.position="absolute",wn.style.zIndex="1001",wn.style.opacity=1,ne.style.opacity=.3,fi=360,fi>De/4*3&&(fi=De/4*3),Rt=fi/5.8,wn.setAttribute("src",st),wn.setAttribute("width",fi),wn.setAttribute("height",Rt);var Lt=(De-fi)/2,Pt=(on-Rt)/2;wn.style.left=Lt+"px",wn.style.top=Pt+"px",Me.appendChild(wn)}}return Me.appendChild(ne),Me},fn=function(De){return De=De.toLowerCase(),De==="html5"||De==="screenshot"?De:"html5"},te=["web","webSimple","web3d","tablet","tablet3d","phone"],Jt=function(De,on){if(Bt=De,on){Xe(Bt,!0);return}var un=!Ut;if(un){var Kn=Et(Bt);!isNaN(Kn)&&Kn<4.4&&(un=!1)}var Me,vn;window.location.protocol.substr(0,4)==="http"?Me=window.location.protocol:Me="http:";var ne=Bt.indexOf("//");ne>0?vn=Bt:ne===0?vn=Me+Bt:vn="https://www.geogebra.org/apps/5.2.814.0/";for(var wn in te)if(Bt.slice(te[wn].length*-1)===te[wn]||Bt.slice((te[wn].length+1)*-1)===te[wn]+"/"){Xe(vn,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&un&&!gt.is3D&&!gt.AV&&!gt.SV&&!gt.CV&&!gt.EV2&&!gt.CP&&!gt.PC&&!gt.DA&&!gt.FI&&!gt.PV&&!re(kt.showToolBar)&&!re(kt.showMenuBar)&&!re(kt.showAlgebraInput)&&!re(kt.enableRightClick)&&(!kt.appName||kt.appName=="classic")?vn+="webSimple/":vn+="web3d/",Xe(vn,!1)},Xe=function(De,on){if(De.requirejs){Ae=De;return}De.slice(-1)!=="/"&&(De+="/"),Ae=De,on===null&&(on=De.indexOf("http")===-1),se=on,nt="web.nocache.js",et=!1;var un=Ae.split("/");un.length>1&&(!on&&un[un.length-2]==="webSimple"?(nt="webSimple.nocache.js",et=!0):te.indexOf(un[un.length-2])>=0&&(nt=un[un.length-2]+".nocache.js")),un=De.split("/"),Bt=un[un.length-3],Bt.substr(0,4)==="test"?Bt=Bt.substr(4,1)+"."+Bt.substr(5,1):(Bt.substr(0,3)==="war"||Bt.substr(0,4)==="beta")&&(Bt="5.0");var Kn=parseFloat(Bt);Kn!==NaN&&Kn<5&&De.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+Kn+" is deprecated. Using version latest instead."),Jt("5.0",on))},On=function(De,on){window.console&&window.console.log&&(!on||typeof on.showLogging=="undefined"||on.showLogging&&on.showLogging!=="false")&&console.log(De)};kt.material_id!==void 0?qt(bn):bn();function bn(){var De=Rn;Dt!==null?De=Dt:parseFloat(De)<5&&(De="5.0"),Jt(De,!1),ee!==null&&Xe(ee,se),he=!0}return Mn},GGBAppletUtils=function(){"use strict";function Mn(){return window.GGBT_wsf_edit!==void 0}function Rn(he,Dt){Dt!=1?(he.style.transformOrigin="0% 0% 0px",he.style.webkitTransformOrigin="0% 0% 0px",he.style.transform="scale("+Dt+","+Dt+")",he.style.webkitTransform="scale("+Dt+","+Dt+")",he.style.maxWidth="initial",he.querySelector(".ggb_preview")!==null&&(he.querySelector(".ggb_preview").style.maxWidth="initial"),he.querySelectorAll(".ggb_preview img")[0]!==void 0&&(he.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),he.querySelectorAll(".ggb_preview img")[1]!==void 0&&(he.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(he.style.transform="none",he.style.webkitTransform="none")}function kt(he,Dt,ee,ge,Qt,jt){var Ae=null;if(jt!=null&&jt!="")for(var se=he.parentNode;se!=null;)if((" "+se.className+" ").indexOf(" "+jt+" ")>-1){Ae=se;break}else se=se.parentNode;var Pe=0,Bt=0,nt=0,et=0,ht=0,st=0,pt=0;if(Ae)Pe=Ae.offsetWidth,Bt=Math.max(ge?Ae.offsetWidth:0,Ae.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(Pe=Math.min(window.innerWidth,document.documentElement.clientWidth),Bt=Math.min(window.innerHeight,document.documentElement.clientHeight),nt=Pe):(Pe=window.innerWidth,Bt=window.innerHeight,nt=window.innerWidth),he){var vt=he.getBoundingClientRect();vt.left>0&&vt.left<=Pe&&(Qt===void 0||!Qt)&&(document.dir==="rtl"?(ht=Pe-vt.width-vt.left,st=nt<=480?10:30):(st=vt.left,ht=nt<=480?10:30),et=st+ht)}if(he&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var St=he.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(et=40,pt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(et=0,pt=40)}}return he&&((ee===void 0||!ee)&&Dt>0&&Dt+et<Pe?Pe=Dt:Pe-=et,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(ee===void 0||!ee)&&(Bt-=pt)),{width:Pe,height:Bt}}function gt(he,Dt,ee,ge,Qt){if(he.isScreenshoGenerator)return 1;var jt=ge!==void 0&&ge,Ae=he.noScaleMargin!=null&&he.noScaleMargin,se=function(St){return St&&St!=="false"},Pe=se(he.autoHeight),Bt=kt(Dt,he.width,ee,Pe,jt&&window.GGBT_wsf_view||Ae,Qt),nt=parseInt(Bt.width),et=he.width,ht=he.height;if(et===void 0){var st=Dt.querySelector(".appletParameters");st&&(et=st.offsetWidth,ht=st.offsetHeight)}var pt=nt/et,vt=jt?1:Bt.height/ht;return ee!==void 0&&!ee&&(pt=Math.min(1,pt),vt=Math.min(1,vt)),Math.min(pt,vt)}function Ut(he,Dt,ee){var ge=1,Qt,jt=!1;if(he.hasOwnProperty("allowUpscale")&&(jt=he.allowUpscale),he.hasOwnProperty("scale")&&(ge=parseFloat(he.scale),(isNaN(ge)||ge===null||ge===0)&&(ge=1),ge>1&&(jt=!0)),Dt&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(jt=!0),!(he.hasOwnProperty("disableAutoScale")&&he.disableAutoScale))Qt=gt(he,Dt,jt,ee,he.scaleContainerClass);else return ge;return jt&&(!he.hasOwnProperty("scale")||ge===1)?Qt:Math.min(ge,Qt)}function ue(he){var Dt=Math.min(window.innerWidth,document.documentElement.clientWidth),ee=Math.min(window.innerHeight,document.documentElement.clientHeight),ge=he.getBoundingClientRect(),Qt=(Dt-ge.width)/2,jt=(ee-ge.height)/2;jt<0&&(jt=0),he.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Qt<40?he.style.left="40px":he.style.left=Qt+"px",he.style.top=jt+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(jt<40?he.style.top="40px":he.style.top=jt+"px",he.style.left=Qt+"px")}function Ee(he,Dt){var ee=he.querySelector(".appletParameters");if(ee){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Dt.id!==ee.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(he)}if(ee.parentElement&&/fullscreen/.test(ee.parentElement.className))return;var ge=Ut(Dt,he);Mn()&&ee.setAttribute("data-param-scale",ge);for(var Qt=null,jt=0;jt<he.childNodes.length;jt++)if(he.childNodes[jt].className!==void 0&&he.childNodes[jt].className.match(/^applet_scaler/)){Qt=he.childNodes[jt];break}if(Qt!==null&&Qt.querySelector(".noscale")!==null)return;var Ae=Dt.id!==void 0?Dt.id:"ggbApplet",se=window[Ae];(se==null||!se.recalculateEnvironments)&&Qt!==null&&!Qt.className.match(/fullscreen/)&&(Qt.parentNode.style.transform="",!isNaN(ge)&&ge!==1?(Qt.parentNode.style.width=Dt.width*ge+"px",Qt.parentNode.style.height=Dt.height*ge+"px",Rn(Qt,ge)):(Rn(Qt,1),Qt.parentNode.style.width=Dt.width+"px",Qt.parentNode.style.height=Dt.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&ue(he),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(ee).parents(".content-added-content"))}}return{responsiveResize:Ee,isFlexibleWorksheetEditor:Mn,positionCenter:ue,getScale:Ut,scaleElement:Rn}}();__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 Mn=n.location.search;return Mn.indexOf(J)!=-1||Mn.indexOf(K)!=-1}function q(Mn,Rn){}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(Mn){var Rn=s[L].bindings;s[L].bindings=function(){for(var kt=Rn?Rn():{},gt=Mn[webModule.__softPermutationId],Ut=O;Ut<gt.length;Ut++){var ue=gt[Ut];kt[ue[O]]=ue[P]}return kt}};var t;function u(){return v(),t}function v(){if(!t){var Mn=o.createElement(Q);if(Mn.id=L,Mn.style.cssText=R+S,Mn.tabIndex=-1,o.body.appendChild(Mn),t=Mn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var Rn=document.compatMode==U?V:W;t.write(Rn+X),t.close()}}}function w(Mn){function Rn(gt){function Ut(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var ue=Ut();if(ue){gt();return}function Ee(){if(!ue){if(!Ut())return;ue=!0,gt(),o.removeEventListener&&o.removeEventListener(Z,Ee,!1),he&&clearInterval(he)}}o.addEventListener&&o.addEventListener(Z,Ee,!1);var he=setInterval(function(){Ee()},$)}function kt(gt){var Ut=u(),ue=Ut.body,Ee=Ut.createElement(_);Ee.language=ab,Ee.crossOrigin=W,Ee.src=gt,webModule.__errFn&&(Ee.onerror=function(){webModule.__errFn(L,new Error(bb+gt))}),ue.appendChild(Ee)}Rn(function(){kt(Mn)})}webModule.__startLoadingFragment=function(Mn){return C(Mn)},webModule.__installRunAsyncCode=function(Mn){var Rn=u(),kt=Rn.body,gt=Rn.createElement(_);gt.language=ab,gt.text=Mn,kt.appendChild(gt),kt.removeChild(gt)};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(Mn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(Mn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(Mn){var Rn=c[Mn];return Rn==null?null:Rn},r=d,webModule.__errFn=e}function B(){function Mn(he){var Dt=he.lastIndexOf(rb);Dt==-1&&(Dt=he.length);var ee=he.indexOf(sb);ee==-1&&(ee=he.length);var ge=he.lastIndexOf(tb,Math.min(ee,Dt));return ge>=O?he.substring(O,ge+P):W}function Rn(he){if(!he.match(/^\w+:\/\//)){var Dt=o.createElement(ub);Dt.src=he+vb,he=Mn(Dt.src)}return he}function kt(){var he=__gwt_getMetaProperty(wb);return he!=null?he:W}function gt(){for(var he=o.getElementsByTagName(_),Dt=O;Dt<he.length;++Dt)if(he[Dt].src.indexOf(xb)!=-1)return Mn(he[Dt].src);return W}function Ut(){var he=o.getElementsByTagName(yb);return he.length>O?he[he.length-P].href:W}function ue(){var he=o.location;return he.href==he.protocol+zb+he.host+he.pathname+he.search+he.hash}var Ee=kt();return Ee==W&&(Ee=gt()),Ee==W&&(Ee=Ut()),Ee==W&&ue()&&(Ee=Mn(o.location.href)),Ee=Rn(Ee),Ee}function C(Mn){return Mn.match(/^\//)||Mn.match(/^[a-zA-Z]+:\/\//)?Mn:webModule.__moduleBase+Mn}function D(){var Mn=[],Rn=O,kt=[],gt=[];function Ut(he){var Dt=gt[he](),ee=kt[he];if(Dt in ee)return Dt;var ge=[];for(var Qt in ee)ge[ee[Qt]]=Qt;throw r&&r(he,ge,Dt),null}if(__gwt_isKnownPropertyValue=function(he,Dt){return Dt in kt[he]},webModule.__getPropMap=function(){var he={};for(var Dt in kt)kt.hasOwnProperty(Dt)&&(he[Dt]=Ut(Dt));return he},webModule.__computePropValue=Ut,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var ue;try{ue=Cb;var Ee=ue.indexOf(Db);Ee!=-1&&(Rn=parseInt(ue.substring(Ee+P),$),ue=ue.substring(O,Ee))}catch(he){}return webModule.__softPermutationId=Rn,C(ue+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})()},46699:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Ax:function(){return Ee},Ds:function(){return he},KI:function(){return ee},SI:function(){return ue},f1:function(){return Ut}});var gt=kt(346);function Ut(ge){let Qt=!0;if(ge.length>0){for(let jt=0;jt<ge.length;jt++)if(ge[jt].compile_success==0||!ge[jt].compile_success){Qt=!1;break}}else Qt=!1;return Qt}function ue(ge,Qt=""){let jt=[];for(let Ae=0;Ae<ge.length;Ae++){let se=ge[Ae],Pe=Qt?`${Qt}/${se.name}`:`${se.name}`;jt.push({title:se.name,type:se.type,isLeaf:se.type!=="tree",key:Pe})}return jt}function Ee(ge,Qt,jt){for(let Ae=0;Ae<ge.length;Ae++){let se=ge[Ae];if(se.key===Qt){se.children=jt;break}se.children&&Ee(se.children,Qt,jt)}return ge}function he(ge,Qt,jt){let Ae;return function(){let se=this,Pe=arguments,Bt=function(){Ae=null,jt||ge.apply(se,Pe)},nt=jt&&!Ae;clearTimeout(Ae),Ae=setTimeout(Bt,Qt),nt&&ge.apply(se,Pe)}}const Dt=!0,ee=gt.Z.API_SERVER},84842:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Bt}});var gt=kt(99571),Ut=kt(59301),ue=Object.defineProperty,Ee=Object.defineProperties,he=Object.getOwnPropertyDescriptors,Dt=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,Qt=(nt,et,ht)=>et in nt?ue(nt,et,{enumerable:!0,configurable:!0,writable:!0,value:ht}):nt[et]=ht,jt=(nt,et)=>{for(var ht in et||(et={}))ee.call(et,ht)&&Qt(nt,ht,et[ht]);if(Dt)for(var ht of Dt(et))ge.call(et,ht)&&Qt(nt,ht,et[ht]);return nt},Ae=(nt,et)=>Ee(nt,he(et)),se=(nt,et)=>{var ht={};for(var st in nt)ee.call(nt,st)&&et.indexOf(st)<0&&(ht[st]=nt[st]);if(nt!=null&&Dt)for(var st of Dt(nt))et.indexOf(st)<0&&ge.call(nt,st)&&(ht[st]=nt[st]);return ht},Pe=(nt,et,ht)=>new Promise((st,pt)=>{var vt=Tt=>{try{Et(ht.next(Tt))}catch(It){pt(It)}},St=Tt=>{try{Et(ht.throw(Tt))}catch(It){pt(It)}},Et=Tt=>Tt.done?st(Tt.value):Promise.resolve(Tt.value).then(vt,St);Et((ht=ht.apply(nt,et)).next())});const Bt=nt=>{var et=nt,{children:ht}=et,st=se(et,["children"]);const[pt,vt]=(0,Ut.useState)(!1);return Ut.createElement(gt.ZP,Ae(jt({},st),{loading:pt,onClick:St=>Pe(void 0,null,function*(){try{vt(!0),yield st.onClick(St),vt(!1)}catch(Et){console.error(Et),vt(!1)}})}),ht)}},54650:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Pe}});var gt=kt(59301),Ut=kt(6767),ue=kt(37568),Ee={codeBox:"codeBox___WpkVl"},he=kt(92310),Dt=kt.n(he),ee=Object.defineProperty,ge=(Bt,nt,et)=>nt in Bt?ee(Bt,nt,{enumerable:!0,configurable:!0,writable:!0,value:et}):Bt[nt]=et,Qt=(Bt,nt,et)=>ge(Bt,typeof nt!="symbol"?nt+"":nt,et),jt=(Bt,nt,et)=>new Promise((ht,st)=>{var pt=Et=>{try{St(et.next(Et))}catch(Tt){st(Tt)}},vt=Et=>{try{St(et.throw(Et))}catch(Tt){st(Tt)}},St=Et=>Et.done?ht(Et.value):Promise.resolve(Et.value).then(pt,vt);St((et=et.apply(Bt,nt)).next())});class Ae extends gt.Component{constructor(nt){super(nt),Qt(this,"canvas"),Qt(this,"randomNum",(et,ht)=>Math.floor(Math.random()*(ht-et)+et)),Qt(this,"drawPic",()=>{this.randomCode()}),Qt(this,"reloadPic",()=>{this.drawPic()}),Qt(this,"changeCode",et=>{console.log(et.target.value,222),this.setState({value:et.target.value,showError:!1})}),Qt(this,"onVerify",()=>{let et;return this.state.value.toLowerCase()!==""&&this.state.value.toLowerCase()!==this.state.code.toLowerCase()?(et=!0,Ut.ZP.error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801"),this.reloadPic()):this.state.value.toLowerCase()===""?(et=!0,Ut.ZP.error("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801")):this.state.value.toLowerCase()===this.state.code.toLowerCase()&&(et=!1),this.setState({showError:et}),et}),this.canvas=gt.createRef(),this.state={value:"",code:"",codeLength:4,fontSizeMin:20,fontSizeMax:22,backgroundColorMin:240,backgroundColorMax:250,colorMin:10,colorMax:20,lineColorMin:40,lineColorMax:180,contentWidth:96,contentHeight:38,showError:!1}}componentDidMount(){this.drawPic()}randomColor(nt,et){const ht=this.randomNum(nt,et),st=this.randomNum(nt,et),pt=this.randomNum(nt,et);return`rgb(${ht}, ${st}, ${pt})`}drawText(nt,et,ht){nt.fillStyle=this.randomColor(this.state.colorMin,this.state.colorMax);const st=this.randomNum(this.state.fontSizeMin,this.state.fontSizeMax);nt.font=st+"px SimHei";const pt=10,vt=(this.state.contentWidth-40)/(this.state.code.length-1);let St=pt;ht>0&&(St=pt+ht*vt);let Et=this.randomNum(this.state.fontSizeMax,this.state.contentHeight-5);st>40&&(Et=40);const Tt=this.randomNum(-10,10);nt.translate(St,Et),nt.rotate(Tt*Math.PI/180),nt.fillText(et,0,0),nt.rotate(-Tt*Math.PI/180),nt.translate(-St,-Et)}drawLine(nt){for(let et=0;et<1;et++)nt.strokeStyle=this.randomColor(this.state.lineColorMin,this.state.lineColorMax),nt.beginPath(),nt.moveTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),nt.lineTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),nt.stroke()}drawDot(nt){for(let et=0;et<100;et++)nt.fillStyle=this.randomColor(0,255),nt.beginPath(),nt.arc(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight),1,0,2*Math.PI),nt.fill()}randomCode(){let nt="";const et="QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890";for(let ht=0;ht<this.state.codeLength;ht++){const st=Math.floor(Math.random()*57);nt+=et[st]}this.setState({code:nt},()=>{const st=this.canvas.current.getContext("2d");st.textBaseline="bottom",st.fillStyle=this.randomColor(this.state.backgroundColorMin,this.state.backgroundColorMax),st.fillRect(0,0,this.state.contentWidth,this.state.contentHeight);for(let pt=0;pt<this.state.code.length;pt++)this.drawText(st,this.state.code[pt],pt);this.drawLine(st),this.drawDot(st)})}render(){const{className:nt,width:et=300}=this.props;return gt.createElement("div",{className:Dt()(Ee.codeBox,nt),style:{width:et}},gt.createElement("aside",null,gt.createElement(ue.default,{value:this.state.value,onChange:this.changeCode,placeholder:"\u8BF7\u8F93\u5165\u56FE\u7247\u4E2D\u7684\u9A8C\u8BC1\u7801"})),gt.createElement("div",null,gt.createElement("canvas",{onClick:this.reloadPic,ref:this.canvas,width:"100",height:"30"}),gt.createElement("div",{className:"current",onClick:this.reloadPic},"\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u5F20")))}}const se=(Bt,nt)=>{let et;Modal.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:React.createElement("div",null,React.createElement("p",null,nt),React.createElement(Ae,{ref:ht=>et=ht})),onOk:()=>jt(void 0,null,function*(){if(et.onVerify())return Promise.reject();Bt()})})};var Pe=Ae},30371:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Qt}});var gt=kt(59301),Ut=kt(37568),ue=kt(96599),Ee=kt(6767),he={flex:"flex___eLcnP",flex1:"flex1___yUTT7",color666:"color666___TiUhG",error:"error___gTTtv",deleteIcon:"deleteIcon___mnZW1",addIcon:"addIcon___JC5NS"},Dt=kt(62772);const{TextArea:ee}=Ut.default;class ge extends gt.Component{constructor(Ae){super(Ae),this.state={inputVisible:!1,EditInputIndex:-1}}render(){let{index:Ae,onAnswerChange:se,addChildAnswer:Pe,exerciseIsPublish:Bt,answers:nt,activeOptionErrorIndex:et,flex:ht="0 0 1000px"}=this.props;console.log("----",nt);let{inputVisible:st,EditInputIndex:pt}=this.state;return gt.createElement("div",{className:he.flex},gt.createElement("div",{className:`${he.color666} mb5 mt6`,style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",Ae+1,"):"),gt.createElement("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10}},nt==null?void 0:nt.map((vt,St)=>gt.createElement(gt.Fragment,null,pt!==St?(vt==null?void 0:vt.length)>0?gt.createElement(ue.default,{className:"edit-tag",key:vt,closable:!((nt==null?void 0:nt.length)===1&&St===0),onClose:Et=>{Et.preventDefault(),(nt==null?void 0:nt.length)===1&&St===0?this.props.deleteChildAnswermain(Ae,St):this.props.deleteChildAnswer(Ae,St)}},gt.createElement("span",{onDoubleClick:Et=>{this.setState({EditInputIndex:St}),Et.preventDefault()}},vt)):gt.createElement(Ut.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Et=>{if(Et.target.value.replaceAll(" ","").length<=0){Ee.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}se(Ae,St,Et.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}):gt.createElement(Ut.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Et=>{if(Et.target.value.replaceAll(" ","").length<=0){Ee.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}se(Ae,St,Et.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}))),!st&&gt.createElement(ue.default,{className:"site-tag-plus",onClick:()=>{Pe(Ae),this.setState({inputVisible:!0})}},gt.createElement(Dt.Z,null)," \u65B0\u589E\u7B54\u6848")))}}var Qt=ge},61011:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Bt}});var gt=kt(59301),Ut=kt(39793),ue=Object.defineProperty,Ee=Object.defineProperties,he=Object.getOwnPropertyDescriptors,Dt=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,Qt=(nt,et,ht)=>et in nt?ue(nt,et,{enumerable:!0,configurable:!0,writable:!0,value:ht}):nt[et]=ht,jt=(nt,et)=>{for(var ht in et||(et={}))ee.call(et,ht)&&Qt(nt,ht,et[ht]);if(Dt)for(var ht of Dt(et))ge.call(et,ht)&&Qt(nt,ht,et[ht]);return nt},Ae=(nt,et)=>Ee(nt,he(et)),se=(nt,et,ht)=>Qt(nt,typeof et!="symbol"?et+"":et,ht);const Pe="\u2581";class Bt extends gt.Component{constructor(){super(...arguments),se(this,"getChCountBeforeCursor",(et,ht)=>{const st=ht.line;let pt=0;for(let St=0;St<st;St++)pt+=et.getLine(St).split(Pe).length-1;const vt=et.getLine(st).substring(0,ht.ch);return pt+=vt.split(Pe).length-1,pt}),se(this,"onCMBeforeChange",(et,ht)=>{const st=et.getRange(ht.from,ht.to);let pt=0;if(ht.text.forEach(vt=>{pt+=vt.split(Pe).length-1}),st&&st.indexOf(Pe)!=-1){const vt=st.split(Pe).length-1,St=this.getChCountBeforeCursor(et,ht.from);console.log(`\u5220\u9664${vt}\u4E2A\uFF0C \u4E4B\u524D\u6709${St}\u4E2A\uFF0C\u65B0\u589E${pt}\u4E2A`),this.props.deleteEmptyDisabled?ht.cancel():this.props.onPlaceholderChange&&this.props.onPlaceholderChange(St,vt,pt)}else if(pt){const vt=this.getChCountBeforeCursor(et,ht.from);console.log(`\u65B0\u589E${pt}\u4E2A\uFF0C\u4E4B\u524D\u6709${vt}\u4E2A`),this.props.onPlaceholderChange&&this.props.onPlaceholderChange(vt,0,pt)}})}render(){return gt.createElement(Ut.Z,Ae(jt({},this.props),{onCMBeforeChange:this.onCMBeforeChange}))}}},94361:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Dt}});var gt=kt(37639),Ut={text:"text___FxbAX",wrap:"wrap___UlBQ1",contact:"contact____pUDq",img:"img___BapAv"},ue=kt(32637),Ee=kt(59301),Dt=({type:ee,style:ge})=>{const Qt=Ee.createElement("div",{className:Ut.wrap,onClick:jt=>{jt.preventDefault(),jt.stopPropagation()}},Ee.createElement("p",null,ee==="shixun"||ee==="paths"?"\u5F53\u524D\u5B9E\u8DF5\u9879\u76EE\u662F\u9AD8\u6D88\u8017\u7C7B\u578B\u7684\u5B9E\u9A8C\u3002":"\u5F53\u524D\u8BD5\u5377\u5305\u542B\u9AD8\u6D88\u8017\u7C7B\u578B\u7684\u5B9E\u9A8C\u3002",Ee.createElement("br",null),"\u6839\u636E\u5E73\u53F0\u4F7F\u7528\u89C4\u5219\uFF0C\u9700\u8981\u6388\u6743\u624D\u80FD\u4F7F\u7528\u3002",ee==="paths"?"\u53D1\u9001\u5230\u8BFE\u5802":"\u53D1\u5E03","\u4F7F\u7528\u4E4B\u524D\uFF0C\u8BF7\u5148\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u83B7\u53D6\u6388\u6743\u7801\u3002"),Ee.createElement("div",{className:Ut.contact},Ee.createElement("div",{className:Ut.img},Ee.createElement("img",{src:ue,width:"124px",height:"124px"})),Ee.createElement("div",{className:"tc font14 mt10",style:{color:"#777A93"}},"\u626B\u4E00\u626B\uFF0C\u83B7\u53D6\u6388\u6743\u7801")));return Ee.createElement(gt.Z,{content:Qt},Ee.createElement("span",{className:Ut.text,style:ge},"\u9AD8\u6D88\u8017"))}},9507:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Ae}});var gt=kt(59301),Ut={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},ue=kt(92310),Ee=kt.n(ue),he=kt(29787),Dt=kt(2859),ee=kt(38986),ge=kt(51257),Qt=(se,Pe,Bt)=>new Promise((nt,et)=>{var ht=vt=>{try{pt(Bt.next(vt))}catch(St){et(St)}},st=vt=>{try{pt(Bt.throw(vt))}catch(St){et(St)}},pt=vt=>vt.done?nt(vt.value):Promise.resolve(vt.value).then(ht,st);pt((Bt=Bt.apply(se,Pe)).next())}),Ae=({data:se,className:Pe,fullWidth:Bt,style:nt={},onClose:et,onOk:ht,showFullTools:st,noAssociationId:pt})=>{const vt=(0,gt.useRef)(null),St=(0,gt.useRef)(null),Et=(0,gt.useRef)(null),Tt=(0,gt.useRef)(null),[It,qt]=(0,gt.useState)(!1),[Xt,Ht]=(0,gt.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,gt.useEffect)(()=>(Et.current||(Et.current=document.createElement("style"),document.head.appendChild(Et.current)),se!=null&&se.visible?(document.body.setAttribute("data-custom","y-hidden"),Et.current.innerHTML=" html { overflow-y: hidden; }",se!=null&&se.src&&pe()):(document.body.removeAttribute("data-custom"),Et.current&&(document.head.removeChild(Et.current),Et.current=null)),()=>{document.body.removeAttribute("data-custom"),Et.current&&(document.head.removeChild(Et.current),Et.current=null)}),[se==null?void 0:se.visible]);const pe=()=>Qt(void 0,null,function*(){qt(!0),Ht("\u6B63\u5728\u52A0\u8F7D\u4E2D");const xe=yield(0,ge.ZJ)(se==null?void 0:se.src);vt.current.src="",vt.current.src=xe,vt.current.onload=function(){ye()},qt(!1),Ht("")}),re=xe=>Qt(void 0,null,function*(){qt(!0),Ht("\u6B63\u5728\u4FDD\u5B58\u4E2D");const Ue=yield(0,ee.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:se.title,file:xe.dataUrl}});Ue!=null&&Ue.id&&!pt?(yield(0,ee.ZP)(`/api/attachments/${se.id}/add_subitem.json`,{method:"post",body:{subitem_id:Ue==null?void 0:Ue.id,settings:JSON.stringify(xe.state)}})).status===0&&ht():Ue!=null&&Ue.id&&ht(Ue),qt(!1),Ht("")}),Ne=()=>{const xe=document.querySelector('a[href="https://markerjs.com/"]');xe&&xe.parentNode&&(xe.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(je=>{const Je=document.querySelector(je.name);Je&&Je.setAttribute("title",je.title)})},ye=()=>{St.current=new Dt.hP(vt.current),St.current.targetRoot=Tt.current,St.current.addEventListener("render",re),St.current.addEventListener("beforeclose",et),st&&(St.current.availableMarkerTypes=St.current.ALL_MARKER_TYPES,St.current.uiStyleSettings.redoButtonVisible=!0,St.current.uiStyleSettings.notesButtonVisible=!0,St.current.uiStyleSettings.zoomButtonVisible=!0,St.current.uiStyleSettings.zoomOutButtonVisible=!0,St.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=St.current.uiStyleSettings,St.current.show(),se!=null&&se.snapshotData&&St.current.restoreState(se.snapshotData),setTimeout(()=>{window.scrollTo(0,0),Ne()},300)};return gt.createElement(gt.Fragment,null,(se==null?void 0:se.visible)&&gt.createElement(he.Z,{spinning:It,tip:Xt,style:{position:"absolute",width:"100vw"}},gt.createElement("div",{ref:Tt,className:Ee()(Ut.imageDimensions,Pe,Bt?Ut.fullWidth:""),style:nt},gt.createElement("img",{className:Ut.img,ref:vt}))))}},19105:function(Mn,Rn,kt){"use strict";var gt=kt(59301),Ut=kt(99587),ue=kt(48136),Ee=kt(76562),he=kt(62957),Dt=kt(59301);const ee=(0,gt.forwardRef)(({callback:ge,width:Qt,onChange:jt,disabled:Ae,readOnly:se,type:Pe="",value:Bt="",style:nt={}},et)=>{const ht=(0,gt.useRef)(),st=(0,gt.useRef)(),[pt,vt]=(0,gt.useState)(0),[St,Et]=(0,gt.useState)(0),[Tt,It]=(0,gt.useState)(!1),qt=()=>{var re=document.createElement("div");re.innerHTML=ht.current.getValue();var Ne=re.innerText;return ge&&ge(Ne),Ne};(0,gt.useImperativeHandle)(et,()=>({getData:qt}));const Xt=re=>{re.preventDefault();const Ne=re.clientX-pt,ye=re.clientY-St;document.body.onmousemove=xe=>{let Ue=xe.clientX-Ne,je=xe.clientY-ye;const Je=document.getElementsByClassName("markdown-popup-form")[0],fn=window.innerWidth-Je.offsetWidth,te=window.innerHeight-Je.offsetHeight;Ue=Math.max(0,Math.min(Ue,fn)),je=Math.max(0,Math.min(je,te)),Ht(xe.clientX,xe.clientY,Ne,ye)&&(vt(Ue),Et(je))},document.body.onmouseup=function(){document.body.onmousemove=null}},Ht=(re,Ne,ye,xe)=>{const Ue=document.body.clientHeight,je=document.body.clientWidth;return re<20&&ye>re||re>je-20&&ye<re||Ne<20&&xe>Ne||Ne>Ue-20&&xe<Ne?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};(0,gt.useEffect)(()=>{Tt&&setTimeout(()=>{const re=document.getElementsByClassName("markdown-popup-form")[0],Ne=window.innerWidth/2-re.offsetWidth/2,ye=window.innerHeight/2-re.offsetHeight/2;vt(Ne),Et(ye)},0)},[Tt]);const pe=()=>{Ae||se||It(!0)};return Dt.createElement("div",{style:nt},Dt.createElement("div",{style:{width:Qt||"100%",position:"relative"},className:`${Ut.Z.mathFillWrap} ${Ae||se?"cursorDefault":""}`,onClick:()=>pe()},Dt.createElement("math-field",{disabled:Ae,locale:"zh_cn",class:`${Ut.Z.mathField} ${Pe}`,readOnly:se,placeholder:"\u8BF7\u8F93\u5165\u516C\u5F0F",ref:ht,style:{width:"100%",fontSize:Bt?18:14},value:Bt||""})),Dt.createElement(he.default,{maskClosable:!1,centered:!0,width:860,style:{position:"absolute",left:pt,top:St},title:Dt.createElement("div",{style:{cursor:"move"},onMouseDown:Xt},"\u8F93\u5165\u516C\u5F0F"),open:Tt,onOk:()=>{const re=st.current.getData();ht.current.setValue(re),jt(re),It(!1)},onCancel:()=>{It(!1)},destroyOnClose:!0,className:"markdown-popup-form"},Dt.createElement(Ee.Z,{value:Bt,ref:st,onChange:jt,showSaveButton:!1})))});Rn.Z=ee},76562:function(Mn,Rn,kt){"use strict";var gt=kt(59301),Ut=kt(77019),ue=kt(5269),Ee=kt(20554),he=kt(99571),Dt=kt(76902),ee=kt(99587),ge=kt(48136),Qt=kt(59301);const jt=(0,gt.forwardRef)(({callback:Ae,showSaveButton:se,value:Pe=""},Bt)=>{const nt=(0,gt.useRef)(),et=[{name:"\u5206\u6570\u5F97\u5206",value:"\\frac{x}{y}",children:[{name:"\u5206\u6570 Fractions",data:[{value:"\\frac{a}{b}"},{value:"x\\tfrac{x}{a} "},{value:"\\mathrm{d}t"},{value:"\\partial t"},{value:"\\frac{\\partial y}{\\partial x}"},{value:"\\nabla\\psi"},{value:"\\frac{\\partial^2}{\\partial x_1\\partial x_2}y"},{value:"\\cfrac{1}{a + \\cfrac{7}{b + \\cfrac{2}{9}}} = c"}]},{name:"\u5BFC\u6570 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"\u6A21\u7B97\u672F Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"\u6839\u5F0F\u89D2\u6807",value:"\\sqrt{x}",children:[{name:"\u6839\u5F0F Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"\u4E0A\u4E0B\u6807 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"\u91CD\u97F3\u7B26\u53CA\u5176\u4ED6 Accents and Others",data:[{value:"\\hat{a} "},{value:"\\sqrt[y]{x}"},{value:"\\check{} "},{value:"\\grave{a} "},{value:"\\acute{a}"},{value:"\\tilde{a}"},{value:"\\breve{a}"},{value:"\\bar{a}"},{value:"\\vec{a}"},{value:"\\not{a}"},{value:"\\widetilde{abc}"},{value:"\\widehat{abc}"},{value:"\\overleftarrow{abc} "},{value:"\\overrightarrow{abc}"},{value:"\\overline{abc}"},{value:"\\underline{abc}"},{value:"\\overbrace{abc}"},{value:"\\underbrace{abc}"},{value:"\\overset{a}{abc}"},{value:"\\underset{a}{abc} \\stackrel\\frown{ab}"},{value:"\\overline{ab} "},{value:"\\overleftrightarrow{ab}"},{value:"\\overset{a}{\\leftarrow}"},{value:"\\overset{a}{\\rightarrow}"},{value:"\\xleftarrow[abc]{a}"},{value:"\\xrightarrow[abc]{a} "}]}]},{name:"\u6781\u9650\u5BF9\u6570",value:"\\lim_{x \\to 0}",children:[{name:"\u6781\u9650 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"\u5BF9\u6570\u6307\u6570 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"\u754C\u9650 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"\u4E09\u89D2\u51FD\u6570",value:"\\sin a",children:[{name:"\u4E09\u89D2\u51FD\u6570 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"\u53CD\u4E09\u89D2\u51FD\u6570 Inverse trigonometric functions",data:[{value:"\\sin^{-1}"},{value:"\\cos^{-1}"},{value:"\\tan^{-1}"},{value:"\\cot^{-1}"},{value:"\\sec^{-1}"},{value:"\\csc^{-1}"},{value:"\\arcsin a"},{value:"\\arccos a"},{value:"\\arctan a"},{value:"\\operatorname{arccot} a"},{value:"\\operatorname{arcsec} a"},{value:"\\operatorname{arccsc} a"}]},{name:"\u53CC\u66F2\u51FD\u6570 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"\u53CD\u53CC\u66F2\u51FD\u6570 Inverse hyperbolic functions",data:[{value:"\\sinh^{-1}"},{value:"a\\cosh^{-1} a"},{value:"\\tanh^{-1} a"},{value:"\\coth^{-1} a"},{value:"\\operatorname{sech}^{-1} a"},{value:"\\operatorname{csch}^{-1} a"}]}]},{name:"\u79EF\u5206\u8FD0\u7B97",value:"\\int_{a}^{b}",children:[{name:"\u79EF\u5206 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"\u53CC\u91CD\u79EF\u5206 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"\u4E09\u91CD\u79EF\u5206 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"\u66F2\u7EBF\u79EF\u5206 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"\u5927\u578B\u8FD0\u7B97",value:"\\sum_{a}^{b}",children:[{name:"\u6C42\u548C Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"\u4E58\u79EF\u4F59\u79EF Product and coproduct",data:[{value:"\\prod"},{value:"\\prod_{a}^{b}"},{value:"{\\textstyle \\prod_{a}^{b}}"},{value:"\\coprod"},{value:"\\coprod_{a}^{b}"},{value:"{\\textstyle \\coprod_{a}^{b}} "}]},{name:"\u5E76\u96C6\u4EA4\u96C6 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"\u6790\u53D6\u5408\u53D6 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"\u62EC\u53F7\u53D6\u6574",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"\u62EC\u53F7 Brackets",data:[{value:"\\left ( \\right )"},{value:"\\left [ \\right ]"},{value:"\\left \\langle \\right \\rangle "},{value:"\\left | \\right | "},{value:"\\left \\lfloor \\right \\rfloor "},{value:"\\left \\lceil \\right \\rceil "}]}]}],ht=[{name:"\u4EE3\u6570",value:"\\sqrt{a^2+b^2}",children:[{data:[{value:"\\left(x-1\\right)\\left(x+3\\right) "},{value:"\\sqrt{a^2+b^2}"},{value:"\\left ( \\frac{a}{b}\\right )^{n}= \\frac{a^{n}}{b^{n}}"},{value:"\\frac{a}{b}\\pm \\frac{c}{d}= \\frac{ad \\pm bc}{bd} "},{value:"\\frac{x^{2}}{a^{2}}-\\frac{y^{2}}{b^{2}}=1 "},{value:"\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0 "},{value:"\\sqrt[n]{a^{n}}=\\left ( \\sqrt[n]{a}\\right )^{n} "},{value:"x ={-b \\pm \\sqrt{b^2-4ac}\\over 2a} "},{value:"y-y_{1}=k \\left( x-x_{1}\\right) "},{value:`\\left\\{\\begin{matrix} \r
x=a + r\\text{cos}\\theta \\ \r
y=b + r\\text{sin}\\theta \r
\\end{matrix}\\right. `},{value:`\\begin{array}{l} \r
\\text{\u5BF9\u4E8E\u65B9\u7A0B\u5F62\u5982\uFF1A}x^{3}-1=0 \\ \r
\\text{\u8BBE}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\left\\{\\begin{matrix} \r
\\Delta \\gt 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u4E0D\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta = 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta \\lt 0\\text{\u65B9\u7A0B\u65E0\u5B9E\u6839} \r
\\end{matrix}\\right. \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r
\\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r
\\end{array} `}]}]},{name:"\u51E0\u4F55",value:"\\Delta A B C ",children:[{data:[{value:"\\Delta A B C "},{value:"a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b "},{value:"l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta"},{value:`\\left.\\begin{matrix} \r
a \\perp \\alpha \\ \r
b \\perp \\alpha \r
\\end{matrix}\\right\\}\\Rightarrow a \\parallel b`},{value:"P \\in \\alpha ,P \\in \\beta , \\alpha \\cap \\beta =l \\Rightarrow P \\in l "},{value:`\\alpha \\perp \\beta , \\alpha \\cap \\beta =l,a \\subset \\alpha ,a \\perp l \r
\\Rightarrow a \\perp \\beta `},{value:`\\left.\\begin{matrix} \r
a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r
a \\parallel \\partial ,b \\parallel \\partial \r
\\end{matrix}\\right\\}\\Rightarrow \\beta \\parallel \\alpha `},{value:"\\alpha \\parallel \\beta , \\gamma \\cap \\alpha =a, \\gamma \\cap \\beta =b \\Rightarrow a \\parallel b "},{value:"A \\in l,B \\in l,A \\in \\alpha ,B \\in \\alpha \\Rightarrow l \\subset \\alpha "},{value:`\\left.\\begin{matrix} \r
m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r
a \\perp m,a \\perp n \r
\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha `},{value:`\\begin{array}{c} \r
\\text{\u76F4\u89D2\u4E09\u89D2\u5F62\u4E2D,\u76F4\u89D2\u8FB9\u957Fa,b,\u659C\u8FB9\u8FB9\u957Fc} \\ \r
a^{2}+b^{2}=c^{2} \r
\\end{array}`}]}]},{name:"\u4E0D\u7B49\u5F0F",value:"a > b",children:[{data:[{value:"a > b,b > c \\Rightarrow a > c "},{value:"a > b,c > d \\Rightarrow a+c > b+d "},{value:"a > b > 0,c > d > 0 \\Rightarrow ac bd "},{value:`\\begin{array}{c} \r
a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r
a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r
\\end{array}`},{value:"\\left | a-b \\right | \\geqslant \\left | a \\right | -\\left | b \\right | "},{value:"-\\left | a \\right |\\leq a\\leqslant \\left | a \\right | "},{value:"\\left | a \\right |\\leqslant b \\Rightarrow -b \\leqslant a \\leqslant \\left | b \\right | "},{value:"\\left | a+b \\right | \\leqslant \\left | a \\right | + \\left | b \\right | "},{value:`\\begin{array}{c} \r
a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r
\\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r
\\end{array}`},{value:`\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r
\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) `},{value:`\\begin{array}{c} \r
a,b \\in R^{+} \\ \r
\\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
a,b \\in R \\ \r
\\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
H_{n}=\\frac{n}{\\sum \\limits_{i=1}^{n}\\frac{1}{x_{i}}}= \\frac{n}{\\frac{1}{x_{1}}+ \\frac{1}{x_{2}}+ \\cdots + \\frac{1}{x_{n}}} \\ G_{n}=\\sqrt[n]{\\prod \\limits_{i=1}^{n}x_{i}}= \\sqrt[n]{x_{1}x_{2}\\cdots x_{n}} \\ A_{n}=\\frac{1}{n}\\sum \\limits_{i=1}^{n}x_{i}=\\frac{x_{1}+ x_{2}+ \\cdots + x_{n}}{n} \\ Q_{n}=\\sqrt{\\sum \\limits_{i=1}^{n}x_{i}^{2}}= \\sqrt{\\frac{x_{1}^{2}+ x_{2}^{2}+ \\cdots + x_{n}^{2}}{n}} \\ H_{n}\\leq G_{n}\\leq A_{n}\\leq Q_{n} \r
\\end{array}`}]}]},{name:"\u79EF\u5206",value:"\\frac{\\mathrm{d}\\partial}{\\partial x}",children:[{data:[{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}x^n=nx^{n-1} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}e^{ax}=a\\,e^{ax} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\ln(x)=\\frac{1}{x} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\sin x=\\cos x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cos x=-\\sin x "},{value:"\\int k\\mathrm{d}x = kx+C "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\tan x=\\sec^2 x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cot x=-\\csc^2 x "},{value:"\\int \\frac{1}{x}\\mathrm{d}x= \\ln \\left| x \\right| +C "},{value:"\\int \\frac{1}{\\sqrt{1-x^{2}}}\\mathrm{d}x= \\arcsin x +C "},{value:"\\int \\frac{1}{1+x^{2}}\\mathrm{d}x= \\arctan x +C "},{value:"\\int u \\frac{\\mathrm{d}v}{\\mathrm{d}x}\\,\\mathrm{d}x=uv-\\int \\frac{\\mathrm{d}u}{\\mathrm{d}x}v\\,\\mathrm{d}x "},{value:"f(x) = \\int_{-\\infty}^\\infty \\hat f(x)\\xi\\,e^{2 \\pi i \\xi x} \\,\\mathrm{d}\\xi "},{value:"\\int x^{\\mu}\\mathrm{d}x=\\frac{x^{\\mu +1}}{\\mu +1}+C, \\left({\\mu \\neq -1}\\right) "}]}]},{name:"\u4E09\u89D2",value:"e^{i \\theta}",children:[{name:"\u6C42\u548C Summation",data:[{value:"e^{i \\theta} "},{value:"\\left(\\frac{\\pi}{2}-\\theta \\right ) "},{value:"\\text{sin}^{2}\\frac{\\alpha}{2}=\\frac{1- \\text{cos}\\alpha}{2} "},{value:"\\text{cos}^{2}\\frac{\\alpha}{2}=\\frac{1+ \\text{cos}\\alpha}{2} "},{value:"\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha} "},{value:"\\sin \\alpha + \\sin \\beta =2 \\sin \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\sin \\alpha - \\sin \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha + \\cos \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha - \\cos \\beta =-2\\sin \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"a^{2}=b^{2}+c^{2}-2bc\\cos A "},{value:"\\frac{\\sin A}{a}=\\frac{\\sin B}{b}=\\frac{\\sin C}{c}=\\frac{1}{2R} "},{value:"\\sin \\left ( \\frac{\\pi}{2}-\\alpha \\right ) = \\cos \\alpha "},{value:"\\sin \\left ( \\frac{\\pi}{2}+\\alpha \\right ) = \\cos \\alpha "}]}]},{name:"\u7EDF\u8BA1",value:"C_{r}^{n}",children:[{data:[{value:"C_{r}^{n} "},{value:"\\frac{n!}{r!(n-r)!} "},{value:"\\sum_{i=1}^{n}{X_i} "},{value:"\\sum_{i=1}^{n}{X_i^2} "},{value:"X_1, \\cdots,X_n "},{value:"\\frac{x-\\mu}{\\sigma} "},{value:"\\sum_{i=1}^{n}{(X_i - \\overline{X})^2} "},{value:`\\begin{array}{c} \r
\\text{\u82E5}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r
\\text{\u5219}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r
\\end{array}`},{value:"P(E) ={n \\choose k}p^k (1-p)^{n-k} "},{value:"P \\left( A \\right) = \\lim \\limits_{n \\to \\infty}f_{n}\\left ( A \\right ) "},{value:"P \\left( \\bigcup \\limits_{i=1}^{+ \\infty}A_{i}\\right) = \\prod \\limits_{i=1}^{+ \\infty}P{\\left( A_{i}\\right)} "},{value:`\\begin{array}{c} \r
P \\left( \\emptyset \\right) =0 \\\\ \r
P \\left( S \\right) =1 \r
\\end{array}`},{value:`\\begin{array}{c} \r
\\forall A \\in S \\\\ \r
P \\left( A \\right) \\ge 0 \r
\\end{array}`},{value:"P \\left( \\bigcup \\limits_{i=1}^{n}A_{i}\\right) = \\prod \\limits_{i=1}^{n}P \\left( A_{i}\\right) "},{value:`\\begin{array}{c} \r
S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r
P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r
\\end{array}`},{value:`\\begin{array}{c} \r
P_{n}=n! \\\\ \r
A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r
\\end{array}`}]}]}],st=St=>{nt.current.setValue(nt.current.getValue()+" "+St.value+" ")},pt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:Qt.createElement(Ut.Z,{className:ee.Z.lists,gutter:[10,10]},et.map((St,Et)=>Qt.createElement(ue.Z,{flex:"110px",className:ee.Z.item},Qt.createElement("div",null,Qt.createElement(Dt.Z,{value:`$$${St.value}$$`}),St.name),Qt.createElement("div",{className:ee.Z.children},St.children.map((Tt,It)=>Qt.createElement("div",{key:It},Qt.createElement("h1",null,Tt.name),Qt.createElement(Ut.Z,{gutter:[10,10]},Tt.data.map((qt,Xt)=>Qt.createElement(ue.Z,{key:Xt,onClick:()=>st(qt),className:ee.Z.diamond},Qt.createElement(Dt.Z,{value:"`$$"+qt.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:Qt.createElement(Ut.Z,{className:ee.Z.lists,gutter:[10,10]},ht.map((St,Et)=>Qt.createElement(ue.Z,{flex:"110px",className:ee.Z.item},Qt.createElement("div",null,Qt.createElement(Dt.Z,{value:"`$$"+St.value+"$$`"}),St.name),Qt.createElement("div",{className:ee.Z.children},St.children.map((Tt,It)=>Qt.createElement("div",{key:It},Tt.name&&Qt.createElement("h1",null,Tt.name),Qt.createElement(Ut.Z,{gutter:[10,10]},Tt.data.map((qt,Xt)=>Qt.createElement(ue.Z,{key:Xt,onClick:()=>st(qt),className:ee.Z.diamond},Qt.createElement(Dt.Z,{value:"`$$"+qt.value+"$$`"}))))))))))}],vt=()=>{var St=document.createElement("div");St.innerHTML=nt.current.getValue();var Et=St.innerText;return Ae&&Ae(Et),Et};return(0,gt.useImperativeHandle)(Bt,()=>({getData:vt})),Qt.createElement("div",{className:ee.Z.mathWrap},Qt.createElement(Ee.default,{defaultActiveKey:"1",items:pt}),Qt.createElement("math-field",{locale:"zh_cn",className:ee.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:nt,style:{width:800,marginTop:30,fontSize:18}},Pe||""),se&&Qt.createElement("div",{className:ee.Z.button},Qt.createElement(he.ZP,{size:"large",onClick:vt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});Rn.Z=jt},28426:function(Mn,Rn,kt){"use strict";var gt=kt(59301),Ut=kt(93314),ue=kt(99571),Ee=Object.defineProperty,he=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,ee=Object.getOwnPropertySymbols,ge=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable,jt=(Bt,nt,et)=>nt in Bt?Ee(Bt,nt,{enumerable:!0,configurable:!0,writable:!0,value:et}):Bt[nt]=et,Ae=(Bt,nt)=>{for(var et in nt||(nt={}))ge.call(nt,et)&&jt(Bt,et,nt[et]);if(ee)for(var et of ee(nt))Qt.call(nt,et)&&jt(Bt,et,nt[et]);return Bt},se=(Bt,nt)=>he(Bt,Dt(nt));const Pe=({img:Bt,buttonProps:nt={},styles:et={},customText:ht,ButtonText:st,ButtonClick:pt,Buttonclass:vt,ButtonTwo:St,imgStyles:Et,loading:Tt=!1,className:It=""})=>gt.createElement("section",{className:`tc animated fadeIn ${It}`,style:Ae({color:"#999",margin:"100px auto",visibility:Tt?"hidden":"visible"},et)},gt.createElement("img",{src:Bt||Ut,style:se(Ae({},Et),{pointerEvents:"none",userSelect:"none"})}),gt.createElement("p",{className:"mt20 font14"},ht||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),st&&gt.createElement(ue.ZP,Ae({className:vt,onClick:pt},nt),st),St&&St);Rn.Z=Pe},45677:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return vt}});var gt=kt(59301),Ut={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},ue=kt(99571),Ee=kt(70557),he=kt(75975),Dt=kt(25399),ee=kt(51257),ge=kt(81722),Qt=kt(28426),jt=kt(346),Ae=kt(44203),se=kt(59301),Pe=Object.defineProperty,Bt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(St,Et,Tt)=>Et in St?Pe(St,Et,{enumerable:!0,configurable:!0,writable:!0,value:Tt}):St[Et]=Tt,st=(St,Et)=>{for(var Tt in Et||(Et={}))nt.call(Et,Tt)&&ht(St,Tt,Et[Tt]);if(Bt)for(var Tt of Bt(Et))et.call(Et,Tt)&&ht(St,Tt,Et[Tt]);return St},pt=(St,Et,Tt)=>new Promise((It,qt)=>{var Xt=re=>{try{pe(Tt.next(re))}catch(Ne){qt(Ne)}},Ht=re=>{try{pe(Tt.throw(re))}catch(Ne){qt(Ne)}},pe=re=>re.done?It(re.value):Promise.resolve(re.value).then(Xt,Ht);pe((Tt=Tt.apply(St,Et)).next())}),vt=({editOffice:St="view",data:Et,issaver:Tt,onSaver:It,theme:qt,type:Xt,filename:Ht,monacoEditor:pe,className:re,style:Ne,close:ye,onClose:xe,hasMask:Ue,disabledDownload:je,onImgDimensions:Je,showNodata:fn,recordInfo:te})=>{const[Jt,Xe]=(0,gt.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[On,bn]=(0,gt.useState)(""),[De,on]=(0,gt.useState)(),un=window.ENV==="build"?"/react/build":"",Kn=location.host.startsWith("localhost")?jt.Z.PROXY_SERVER:jt.Z.API_SERVER,vn=10*(1024*1024),ne=(0,gt.useRef)();Et!=null&&Et.startsWith("/api")&&Xt!=="txt"&&(Et=jt.Z.API_SERVER+Et);const wn=Nt=>Nt.substring(Nt.lastIndexOf("/")+1).split(".").pop();Ht&&pe&&(pe.filename=Ht),(0,gt.useEffect)(()=>{var Nt,Zt;const Mt=(Zt=(Nt=document.cookie)==null?void 0:Nt.replace(/\s/g,""))==null?void 0:Zt.split(";");Mt==null||Mt.map(Yt=>{let Ge=Yt.split("=");Ge[0]==="_educoder_session"&&bn(Ge[1])})},[]),(0,gt.useEffect)(()=>{Xt==="office"&&(Et.indexOf("bigfilescdn.")>-1||Et.indexOf("bigfiles1")>-1?on({url:Et,fileType:wn(Et),model:Et.indexOf("model=edit")?"edit":"view"}):Rt())},[Xt,Et]);function fi(Nt){return pt(this,null,function*(){Nt.data.type==="pdfdata"&&(It(Nt.data.data),window.removeEventListener("message",fi,!1)),console.log("mess---:",Nt.data)})}const Rt=()=>pt(void 0,null,function*(){console.log("data:",Et);let Nt=Et;Et.startsWith("http")||(Nt=location.origin+Nt);let Zt=new URL(Nt).pathname.split("/").pop();const Mt=yield(0,ge.gJ)({attachment_id:Zt});Mt.url=Kn+Mt.url,on(Mt)}),Lt=()=>{if(Et.startsWith("http")||Et.startsWith("blob:")){Pt();return}(0,ee.Sv)(Ht||"educoder",Et,Ht)},Pt=()=>{te&&(0,Ae.fc)({id:te==null?void 0:te.id,watch_type:1,course_id:te==null?void 0:te.course_id}),(0,ee.Nd)(Ht||"educoder",decodeURIComponent(Et))};return se.createElement("div",{style:st({},Ne||{}),className:`${Ue&&Ut.bgBlack} ${Xt?Ut.wrp:"hide"}`},ye&&se.createElement("div",{className:Ut.close,ref:ne},!!Je&&se.createElement(Dt.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>ne.current},se.createElement("span",{onClick:()=>{xe(),Je()}},se.createElement("i",{className:"icon-yulanpizhu"}))),!je&&se.createElement(Dt.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>ne.current},se.createElement("span",{onClick:Pt},se.createElement("i",{className:"icon-quxiaozhiding"}))),Tt&&se.createElement(Dt.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>ne.current},se.createElement("span",{className:"",onClick:()=>{const Nt=document.getElementById("pdfiframe");window.addEventListener("message",fi,!1),setTimeout(()=>{Nt.contentWindow.postMessage("getData","*")},300)}},se.createElement("i",{className:"icon-baocun"}))),se.createElement(Dt.Z,{title:"\u5173\u95ED",getPopupContainer:()=>ne.current},se.createElement("span",{className:"",onClick:()=>{xe()}},se.createElement("i",{className:"icon-guanbi1"})))),se.createElement("div",{className:`${Ut[re]} ${re} ${Ut.monaco} ${Xt==="txt"?"show":"hide"}`},Xt==="txt"&&se.createElement(se.Fragment,null,se.createElement(he.ZP,st({},pe)))),Xt==="audio"&&se.createElement("audio",{src:`${(Et==null?void 0:Et.indexOf("http://"))>-1||(Et==null?void 0:Et.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${Et}`,autoPlay:!0}),Xt==="video"&&se.createElement(se.Fragment,null,(Et==null?void 0:Et.indexOf("http"))>-1?se.createElement("video",{controls:!0,src:`${Et}`,autoPlay:!0}):se.createElement("video",{controls:!0,src:`data:video/mp4;base64,${Et}`,autoPlay:!0})),Xt==="office"&&De&&se.createElement("iframe",{src:`${un}/office.html?key=${De.key}&url=${btoa(De.url)}&callbackUrl=${Kn+(De.callbackUrl||"")}&fileType=${De.fileType}&title=${De.title||""}&model=${St}&officeServer=${jt.Z.ONLYOFFICE}&disabledDownload=${!!je}`}),Xt==="html"&&se.createElement("iframe",{src:Et+"&disposition=inline"}),Xt==="pdf"&&se.createElement("iframe",{id:"pdfiframe",src:`${un}/js/pdfview/index.html?filename=${Ht||"educoder.pdf"}&url=${encodeURIComponent(Et)}&disabledDownload=${!!je}&model=${St}`}),Xt==="image"&&se.createElement("img",{src:`${(Et==null?void 0:Et.indexOf("http://"))>-1||(Et==null?void 0:Et.indexOf("https://"))>-1?"":"data:image/png;base64,"}${Et}`}),(Xt==="other"||Xt==="download")&&se.createElement(se.Fragment,null,fn?se.createElement(Qt.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:se.createElement(ue.ZP,{icon:se.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Lt,disabled:je},"\u4E0B\u8F7D")}):se.createElement(ue.ZP,{type:"primary",size:"middle",onClick:Lt,disabled:je},se.createElement(Ee.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},68571:function(Mn,Rn,kt){"use strict";kt.d(Rn,{t:function(){return Pt}});var gt=kt(59301),Ut=kt(37568),ue=kt(28284),Ee=kt(62957),he=kt(77019),Dt=kt(5269),ee=kt(71051),ge=kt(82326),Qt=kt(47889),jt=kt(31457),Ae=kt(25690),se=kt(8423),Pe=kt(6767),Bt=kt(99571),nt=kt(29787),et=kt(24334),ht={flex_box_center:"flex_box_center___kOQ8P",flex_space_between:"flex_space_between___fY6jt",flex_box_vertical_center:"flex_box_vertical_center___bDSSI",flex_box_center_end:"flex_box_center_end___mQ6mU",flex_box_column:"flex_box_column___F15G0",result:"result___UYRo8",left:"left___TRaH5",right:"right___twp9s",box:"box___vwndt",li:"li___hRe2d"},st=kt(38986),pt=kt(81072),vt=kt(39793),St=kt(56102),Et=kt(37345),Tt=kt(59301),It=Object.defineProperty,qt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,Ht=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable,Ne=(Nt,Zt,Mt)=>Zt in Nt?It(Nt,Zt,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):Nt[Zt]=Mt,ye=(Nt,Zt)=>{for(var Mt in Zt||(Zt={}))pe.call(Zt,Mt)&&Ne(Nt,Mt,Zt[Mt]);if(Ht)for(var Mt of Ht(Zt))re.call(Zt,Mt)&&Ne(Nt,Mt,Zt[Mt]);return Nt},xe=(Nt,Zt)=>qt(Nt,Xt(Zt)),Ue=(Nt,Zt,Mt)=>new Promise((Yt,Ge)=>{var Oe=Ce=>{try{we(Mt.next(Ce))}catch(Fe){Ge(Fe)}},Ke=Ce=>{try{we(Mt.throw(Ce))}catch(Fe){Ge(Fe)}},we=Ce=>Ce.done?Yt(Ce.value):Promise.resolve(Ce.value).then(Oe,Ke);we((Mt=Mt.apply(Nt,Zt)).next())}),Je=({buttonProps:Nt,buttonText:Zt,form:Mt,hackIdentifier:Yt="",answerKey:Ge,data:Oe})=>{const[Ke,we]=(0,gt.useState)(!1),[Ce,Fe]=(0,gt.useState)(!1),[He,Qe]=(0,gt.useState)(!1),[hn,dn]=(0,gt.useState)({}),[ri,ze]=(0,gt.useState)(""),[We,an]=(0,gt.useState)(""),Xn=(0,gt.useRef)(Yt),pn=(0,gt.useRef)(""),rn=(0,gt.useRef)(!1);(0,gt.useEffect)(()=>{He&&mi()},[He]),(0,gt.useEffect)(()=>()=>{sessionStorage.removeItem("projectFill")},[]);const In=()=>new Date().getTime(),pi=Oe==null?void 0:Oe.code,ei=()=>{var Sn,Bn;let si=pi?Oe==null?void 0:Oe.code:(Sn=Mt.getFieldValue("hack_codes"))==null?void 0:Sn.code,yi=pi?Oe==null?void 0:Oe.answer_content:Mt.getFieldValue(Ge),hi=pi?Oe==null?void 0:Oe.input:(Bn=Mt.getFieldValue("hack_sets"))==null?void 0:Bn.input;yi==null||yi.forEach(Gi=>{const wt=Gi.value||Gi.answer_text||"";si=si.replace(/(@▁@|@▁▁@)/,wt)}),an(hi),ze(si),dn({}),Qe(!0)},mi=()=>Ue(void 0,null,function*(){var Sn,Bn,si,yi;const hi=In(),Gi=pi?Oe==null?void 0:Oe.time_limit:(Sn=Mt.getFieldsValue())==null?void 0:Sn.hack.time_limit,wt=pi?(Bn=Oe==null?void 0:Oe.answer_content)==null?void 0:Bn.length:(yi=(si=Mt.getFieldsValue())==null?void 0:si.standard_answers)==null?void 0:yi.length;we(!0),yield(0,pt.bM)(pn.current,{test_hack_code:ri,test_input:We});function Ye(){return Ue(this,null,function*(){const{status:Zn,data:Ln}=yield(0,pt.rX)(pn.current,"submit"),oi=In()-hi>(Gi+3)*1e3*wt;if(rn.current){if(oi){Pe.ZP.error("\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"),we(!1);return}if(Zn===0){we(!1),dn(xe(ye({},Ln),{showText:!0}));return}setTimeout(Ye,1e3)}})}Ye()}),Hi=()=>Ue(void 0,null,function*(){var Sn,Bn,si,yi,hi,Gi,wt;if(!Oe){try{yield Mt.validateFields()}catch(zn){(si=(Bn=(Sn=zn==null?void 0:zn.errorFields)==null?void 0:Sn[0])==null?void 0:Bn.name)!=null&&si.includes("standard_answers")?Pe.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):Pe.ZP.error(zn.errorFields[0].errors[0]),Mt.scrollToField(zn.errorFields[0].name,{behavior:"smooth",block:"center"});return}Fe(!0);let Zn="";const Ln=Mt.getFieldsValue();Xn.current?Zn=yield(0,st.ZP)(`/api/problems/${Xn.current}.json`,{method:"put",body:xe(ye({},Ln),{hack:xe(ye({},Ln==null?void 0:Ln.hack),{sub_discipline_id:(wt=(Gi=Ln==null?void 0:Ln.hack)==null?void 0:Gi.sub_discipline_id)==null?void 0:wt[1],difficult:Ln.difficulty,item_banks_group_id:Ln.item_banks_group_id}),hack_codes:xe(ye({},Ln.hack_codes),{code:et.Base64.encode(Ln.hack_codes.code)}),update_hack_sets:[ye({},Ln.hack_sets)],is_blank:!0,item_type:"BPROGRAM"})}):(Zn=yield(0,st.ZP)("/api/problems.json",{method:"post",body:xe(ye({},Ln),{hack:xe(ye({},Ln==null?void 0:Ln.hack),{sub_discipline_id:(hi=(yi=Ln==null?void 0:Ln.hack)==null?void 0:yi.sub_discipline_id)==null?void 0:hi[1],difficult:Ln.difficulty,item_banks_group_id:Ln.item_banks_group_id}),hack_codes:xe(ye({},Ln.hack_codes),{code:et.Base64.encode(Ln.hack_codes.code)}),hack_sets:[ye({},Ln.hack_sets)],is_blank:!0,item_type:"BPROGRAM"})}),Xn.current=Zn==null?void 0:Zn.identifier,sessionStorage.projectFill=Zn==null?void 0:Zn.identifier)}const Ye=yield(0,st.ZP)(`/api/problems/${Xn.current}/start.json`,{method:"get"});if((Ye==null?void 0:Ye.status)===0){pn.current=Ye==null?void 0:Ye.identifier,rn.current=!0,Fe(!1),ei();return}Fe(!1)}),Cn=Sn=>{const{status:Bn,error_msg:si,execute_time:yi,output:hi,input:Gi,expected_output:wt}=Sn;let Ye=null;switch(Bn){case Et.h.OK:Ye=Tt.createElement(Tt.Fragment,null,Tt.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",yi/1e3,"\u79D2"),Tt.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A\u8C03\u8BD5\u901A\u8FC7"));break;case Et.h.NOMATCH:Ye=Tt.createElement(Tt.Fragment,null,Tt.createElement("div",null,"\u8F93\u5165\uFF1A"),Tt.createElement("pre",{style:{fontFamily:"initial"}},Gi),Tt.createElement("div",null,"\u8F93\u51FA\uFF1A"),Tt.createElement("pre",{style:{fontFamily:"initial"}},hi&&et.Base64.decode(hi)),Tt.createElement("div",null,"\u9884\u671F\u8F93\u51FA\uFF1A"),Tt.createElement("pre",{style:{fontFamily:"initial"}},wt&&et.Base64.decode(wt)));break;case Et.h.EXECUTEFAILURE:Ye=Tt.createElement(Tt.Fragment,null,Tt.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",Tt.createElement("pre",null,Gi)),Tt.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),Tt.createElement("pre",{className:"error"},et.Base64.decode(si)));break;case Et.h.COMPILEFAILURE:Ye=Tt.createElement(Tt.Fragment,null,Tt.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",Tt.createElement("pre",null,Gi)),Tt.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),Tt.createElement("pre",{className:"error"},et.Base64.decode(si)));break;case Et.h.PODFAILURE:Ye=Tt.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case Et.h.TIMEOUT:Ye=Tt.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return Tt.createElement(Tt.Fragment,null," ",Ye," ")};return Tt.createElement("div",null,Tt.createElement(Bt.ZP,xe(ye({loading:Ce},Nt),{onClick:Hi}),Zt),Tt.createElement(Ee.default,{open:He,title:"\u8C03\u8BD5\u4EE3\u7801",destroyOnClose:!0,width:1200,okText:"\u8FD0\u884C\u6D4B\u8BD5",confirmLoading:Ke,cancelButtonProps:{style:{display:"none"}},onOk:()=>mi(),onCancel:()=>{rn.current=!1,Qe(!1)}},Tt.createElement("div",{className:ht.result},Tt.createElement("div",{className:ht.left},Tt.createElement("div",{className:"mb20"},Tt.createElement("span",{className:"c-black"},"\u6267\u884C\u4EE3\u7801"),!Oe&&Tt.createElement(St.CopyToClipboard,{text:ri,onCopy:()=>Pe.ZP.success("\u590D\u5236\u6210\u529F")},Tt.createElement("span",{style:{float:"right"},className:"current c-light-primary"},Tt.createElement("i",{className:"iconfont icon-fuzhi8 mr5"}),"\u590D\u5236"))),Tt.createElement(vt.Z,{height:510,className:"mb0",hidetoolBar:!0,defaultValue:ri,onChange:Sn=>ze(Sn)})),Tt.createElement("div",{className:ht.right},Tt.createElement("div",{className:"c-black mb20"},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B"),Tt.createElement("div",{className:ht.box},Tt.createElement("div",{className:ht.li},Tt.createElement(Ut.default.TextArea,{placeholder:"\u8BF7\u8F93\u5165",value:We,onChange:Sn=>an(Sn.target.value),bordered:!1,style:{height:180}}))),Tt.createElement("div",{className:"c-black mb20 mt30"},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"),Tt.createElement("div",{className:ht.box},Tt.createElement(nt.Z,{spinning:Ke,tip:"\u4EE3\u7801\u6267\u884C\u4E2D"},Tt.createElement("div",{className:ht.li,style:{height:196,overflow:"auto",padding:10}},Cn(hn))))))))},fn=kt(87169),te=kt(59301),Jt=Object.defineProperty,Xe=Object.defineProperties,On=Object.getOwnPropertyDescriptors,bn=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,on=Object.prototype.propertyIsEnumerable,un=(Nt,Zt,Mt)=>Zt in Nt?Jt(Nt,Zt,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):Nt[Zt]=Mt,Kn=(Nt,Zt)=>{for(var Mt in Zt||(Zt={}))De.call(Zt,Mt)&&un(Nt,Mt,Zt[Mt]);if(bn)for(var Mt of bn(Zt))on.call(Zt,Mt)&&un(Nt,Mt,Zt[Mt]);return Nt},Me=(Nt,Zt)=>Xe(Nt,On(Zt)),vn=(Nt,Zt)=>{var Mt={};for(var Yt in Nt)De.call(Nt,Yt)&&Zt.indexOf(Yt)<0&&(Mt[Yt]=Nt[Yt]);if(Nt!=null&&bn)for(var Yt of bn(Nt))Zt.indexOf(Yt)<0&&on.call(Nt,Yt)&&(Mt[Yt]=Nt[Yt]);return Mt};const{TextArea:ne}=Ut.default,wn=[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"}],fi=({value:Nt,onChange:Zt})=>te.createElement(Switch,{checked:Nt,onChange:Mt=>{Zt(Mt)}}),Rt="@\u2581@",Lt="@\u2581\u2581@",Pt=({questionTitlePlaceholder:Nt,form:Zt,scoreByBlank:Mt=!1,hackidentifier:Yt,answerKey:Ge})=>{const[Oe,Ke]=(0,gt.useState)(!1),[we,Ce]=(0,gt.useState)(!1),He=(0,Ae.useParams)().type==="edit",Qe=(pn,rn)=>{const In=rn.line;let pi=0;for(let mi=0;mi<In;mi++)pi+=pn.getLine(mi).split(Rt).length-1;for(let mi=0;mi<In;mi++)pi+=pn.getLine(mi).split(Lt).length-1;const ei=pn.getLine(In).substring(0,rn.ch);return pi+=ei.split(Rt).length-1,pi+=ei.split(Lt).length-1,pi},hn=(pn,rn,In,pi)=>{const ei=pn.getRange(rn.from,rn.to);let mi=0;if(rn.text.forEach(Hi=>{mi+=Hi.split(Rt).length-1}),rn.text.forEach(Hi=>{mi+=Hi.split(Lt).length-1}),rn.origin!=="setValue"){if(ei&&(ei.indexOf(Rt)!==-1||ei.indexOf(Lt)!==-1)){const Hi=ei.split(Rt).length-1+ei.split(Lt).length-1,Cn=Qe(pn,rn.from);if(console.log(`\u5220\u9664${Hi}\u4E2A\uFF0C \u524D\u9762\u6709${Cn}\u4E2A\uFF0C\u65B0\u589E${mi}\u4E2A`),Hi>1){const Sn=Array.from({length:Hi},(Bn,si)=>Cn+si);pi(Sn)}else pi(Cn)}else if(mi>0){const Hi=Qe(pn,rn.from);console.log(`\u65B0\u589E${mi}\u4E2A\uFF0C\u4E4B\u524D\u6709${Hi}\u4E2A`),In(mi,Hi)}}},dn=()=>{const pn=Zt.getFieldValue(Ge);Zt.setFieldsValue({[Ge]:pn==null?void 0:pn.map((rn,In)=>Me(Kn({},rn),{position:In+1}))})},ri=(0,gt.useRef)(),ze=(pn,rn)=>{for(let In=0;In<pn;In++)ri.current({position:null,answer_text:""},rn+In);dn()},We=(0,gt.useRef)(),an=pn=>{We.current(pn),dn()},Xn=ue.default.useWatch(Ge,Zt);return te.createElement("div",{className:se.Z.wrap},te.createElement(ue.default.Item,{label:"\u8BD5\u9898\u63CF\u8FF0",name:["hack","description"],style:{display:"table"},className:"w100",labelCol:{span:24},rules:[{required:!0}]},te.createElement(jt.h,{scrollId:"name",watch:!0,height:140})),te.createElement("div",{className:se.Z.questionTitleEditorWrap},te.createElement(ue.default.Item,{label:"\u7A0B\u5E8F\u4EE3\u7801",name:["hack_codes","code"],labelCol:{span:24},rules:[{required:!0}]},te.createElement(jt.h,{scrollId:"name",watch:!0,height:400,showNullProgramButton:!0,onChange:(pn,rn)=>{const In=Zt.getFieldValue(Ge);console.log("--preAnswerData",In,rn),Zt.setFieldsValue({[Ge]:In==null?void 0:In.map((pi,ei)=>{var mi;return Me(Kn({},pi),{position:ei+1,multi_line:(mi=rn==null?void 0:rn[ei])==null?void 0:mi.multiLine})})})},placeholder:Nt,onCMBeforeChange:(pn,rn)=>{hn(pn,rn,ze,an)}}))),te.createElement(ue.default.List,{name:Ge,rules:[{validator(pn,rn){if(!(rn!=null&&rn.length))return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const In of rn){const{answer_text:pi}=In||{};if((pi==null?void 0:pi.length)===0)return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(pn,{add:rn,remove:In},{errors:pi})=>(ri.current=rn,We.current=In,te.createElement(te.Fragment,null,te.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},te.createElement(ue.default.Item,{label:"\u586B\u7A7A\u9879\u7B54\u6848",required:!0,labelCol:{span:24}}),te.createElement("div",{onClick:()=>{Ee.default.warning({title:"\u7ED9\u5206\u8BF4\u660E",icon:null,width:700,centered:!0,content:te.createElement("div",null,te.createElement("div",null,"1.\u5B66\u751F\u586B\u5199\u7B54\u6848\u4E4B\u540E\uFF0C\u5FC5\u987B\u63D0\u4EA4\u4EE3\u7801",te.createElement("span",{style:{color:"#e30000"}},"\u8FDB\u884C\u8BC4\u6D4B"),"\u624D\u80FD\u5F97\u5206\u3002"),te.createElement("div",{style:{marginTop:10}},"2.\u8BD5\u9898\u7B97\u5206\u65F6\uFF0C\u7CFB\u7EDF\u4F1A\u5C06\u7A0B\u5E8F\u91CC\u9762\u7684\u6240\u6709\u7A7A\u66FF\u6362\u6210\u5B66\u751F\u7684\u7B54\u6848\u8FDB\u884C\u8BC4\u6D4B\u3002\u8F93\u51FA\u7684\u7ED3\u679C\u4E0E\u6D4B\u8BD5\u96C6\u6BD4\u5BF9\uFF0C\u5B8C\u5168\u6B63\u786E\u5219\u5F97\u6EE1\u5206\uFF1B\u82E5\u4E0D\u5B8C\u5168\u6B63\u786E\uFF0C\u5219\u4F9D\u6B21\u5C06\u6BCF\u4E2A\u7A7A\u6362\u6210\u5B66\u751F\u63D0\u4EA4\u7684\u7B54\u6848\uFF0C\u540C\u65F6\u5C06\u5176\u4ED6\u7A7A\u66FF\u6362\u6210\u6807\u51C6\u7B54\u6848\uFF0C\u8FD0\u884C\u7A0B\u5E8F\u3002\u5982\u679C\u8FD9\u4E2A\u7A7A\u7684\u5B66\u751F\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7ED3\u5408\u80FD\u5F97\u5230\u6B63\u786E\u8F93\u51FA\uFF0C\u5219\u8FD9\u4E2A\u7A7A\u5F97\u5230\u8BE5\u7A7A\u7684\u6EE1\u5206\uFF0C\u5426\u5219\u8BE5\u7A7A\u5F970\u5206\u3002"))})},style:{minHeight:32,color:"#3061D0",cursor:"pointer"}},te.createElement(fn.Z,{style:{marginRight:3,color:"#3061D0"}}),te.createElement("span",null," \u7ED9\u5206\u8BF4\u660E"))),pn.map((ei,mi)=>{var Hi=ei,{key:Cn,name:Sn}=Hi,Bn=vn(Hi,["key","name"]),si,yi;return te.createElement(he.Z,{className:"mb20",key:Cn,align:"middle",wrap:!1},te.createElement(Dt.Z,{flex:"0 0 auto",className:`${se.Z.blankIndex}`},"\u586B\u7A7A\u9879",mi+1),te.createElement(Dt.Z,{flex:1},te.createElement(he.Z,{align:"top",justify:"space-between",wrap:!1},te.createElement(Dt.Z,null,te.createElement(ue.default.Item,Me(Kn({},Bn),{name:[Sn,"answer_text"],noStyle:!0}),(si=Xn==null?void 0:Xn[Sn])!=null&&si.multi_line||(yi=Xn==null?void 0:Xn[Sn])!=null&&yi.multiLine?te.createElement(ne,{spellCheck:!1,style:{marginLeft:10,width:550}}):te.createElement(Ut.default,{style:{marginLeft:10,width:550},className:se.Z.blankInput,size:"large",maxLength:1e3,onBlur:hi=>{}}))),Mt&&te.createElement(Dt.Z,{flex:"224px"},te.createElement(ue.default.Item,Me(Kn({},Bn),{name:[Sn,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),te.createElement(ee.Z,{size:"large",className:se.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"}))))))})))),te.createElement("div",{onClick:()=>Ke(!0)},te.createElement(ue.default.Item,{name:["hack","analysis"],label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},te.createElement(jt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Oe}))),te.createElement(ue.default.Item,{label:"\u7F16\u7A0B\u8BED\u8A00",style:{marginTop:30},name:["hack_codes","language"],labelCol:{span:24},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},te.createElement(ge.default,{size:"large"},wn.map(pn=>te.createElement(ge.default.Option,{key:pn.title,value:pn.key}," ",pn.title)))),te.createElement(ue.default.Item,{label:"\u6700\u5927\u8BC4\u6D4B\u65F6\u957F\uFF08\u79D2\uFF09",style:{marginTop:30},labelCol:{span:24},required:!0},te.createElement(ue.default.Item,{name:["hack","time_limit"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5355\u4E2A\u6D4B\u8BD5\u96C6\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"},{type:"number",min:3,message:"\u6700\u5C0F\u9650\u5236\u65F6\u95F4\u662F3\u79D2"}],noStyle:!0},te.createElement(ee.Z,{precision:0,max:10,min:3,size:"large",style:{width:"97%"}})),te.createElement("span",{className:"ml10 font14"},"\u79D2")),te.createElement(ue.default.Item,{label:"\u8BC4\u6D4B\u65F6\u7A7A\u683C\u5904\u7406",style:{marginTop:30},name:["hack","submit_rule"],labelCol:{span:24},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BC4\u6D4B\u65F6\u7A7A\u683C\u5904\u7406"}]},te.createElement(Qt.ZP.Group,{style:{marginTop:-10}},te.createElement(Qt.ZP,{value:0},"\u4E0D\u5FFD\u7565\u7A7A\u683C"),te.createElement(Qt.ZP,{value:1},"\u5FFD\u7565\u9996\u5C3E\u7A7A\u683C"),te.createElement(Qt.ZP,{value:2},"\u5FFD\u7565\u6240\u6709\u7A7A\u683C"))),te.createElement(ue.default.Item,{label:"\u6D4B\u8BD5\u7528\u4F8B",required:!0,style:{marginTop:30}}),te.createElement("div",{style:{background:"#F6F7F9",padding:15}},te.createElement(ue.default.Item,{label:"\u8F93\u5165",labelCol:{span:24},name:["hack_sets","input"]},te.createElement(ne,{rows:4})),te.createElement(ue.default.Item,{label:"\u8F93\u51FA",labelCol:{span:24},name:["hack_sets","output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},te.createElement(ne,{rows:4}))),te.createElement(Je,{form:Zt,answerKey:Ge,hackIdentifier:Yt,buttonText:"\u8FD0\u884C\u8C03\u8BD5",buttonProps:{ghost:!0,icon:te.createElement("i",{className:"iconfont icon-ceshi"}),style:{background:"rgba(55,173,131,0.05)",borderRadius:19,border:"1px solid #37AD83",width:116,height:38,display:"inline-flex",fontSize:14,alignItems:"center",justifyContent:"center",marginTop:20,cursor:"pointer",color:"#37AD83"}}}))}},81727:function(Mn,Rn,kt){"use strict";kt.d(Rn,{u:function(){return Tt}});var gt=kt(59301),Ut=kt(77019),ue=kt(5269),Ee=kt(25399),he=kt(28284),Dt=kt(8423),ee=kt(32134),ge=kt(12893),Qt=kt(31457),jt=kt(59301),Ae=Object.defineProperty,se=Object.defineProperties,Pe=Object.getOwnPropertyDescriptors,Bt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(It,qt,Xt)=>qt in It?Ae(It,qt,{enumerable:!0,configurable:!0,writable:!0,value:Xt}):It[qt]=Xt,st=(It,qt)=>{for(var Xt in qt||(qt={}))nt.call(qt,Xt)&&ht(It,Xt,qt[Xt]);if(Bt)for(var Xt of Bt(qt))et.call(qt,Xt)&&ht(It,Xt,qt[Xt]);return It},pt=(It,qt)=>se(It,Pe(qt)),vt=(It,qt)=>{var Xt={};for(var Ht in It)nt.call(It,Ht)&&qt.indexOf(Ht)<0&&(Xt[Ht]=It[Ht]);if(It!=null&&Bt)for(var Ht of Bt(It))qt.indexOf(Ht)<0&&et.call(It,Ht)&&(Xt[Ht]=It[Ht]);return Xt};const St=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Et=({value:It,onChange:qt,choiceTextKey:Xt,answerKey:Ht,index:pe,isEdit:re,setInputActive:Ne,form:ye,choiceOptionsPath:xe,allowChangeMode:Ue,showAddIcon:je,addItem:Je,deleteItem:fn})=>{console.log(It,"value");const te=(It==null?void 0:It[Ht])===1,Jt=()=>{const On=ye.getFieldValue(xe);ye.setFieldValue(xe,On.map(bn=>pt(st({},bn),{[Ht]:0})))},Xe=()=>{te?qt(pt(st({},It),{[Ht]:0})):(Ue||Jt(),qt(pt(st({},It),{[Ht]:1})))};return jt.createElement(Ut.Z,{className:Dt.Z.choiceWrap,align:"middle",wrap:!1},jt.createElement(ue.Z,{onClick:Xe,className:`${Dt.Z.choiceIndex} ${te?Dt.Z.activeAnswer:""}`},St[pe]),jt.createElement(ue.Z,{flex:1,className:`${Dt.Z.editorWrap} ml15`,onClick:Ne},jt.createElement(Qt.x,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:re,value:It==null?void 0:It[Xt],onChange:On=>{qt(pt(st({},It),{[Xt]:On}))}})),jt.createElement(ue.Z,{flex:"0 0 auto",className:"ml15"},jt.createElement("div",{onClick:Xe,className:`${Dt.Z.setAnswerBtn} ${te?Dt.Z.activeAnswer:""}`},te?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),jt.createElement(ue.Z,{className:Dt.Z.actionWrapper},jt.createElement(Ee.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},jt.createElement(ee.Z,{className:Dt.Z.addIcon,onClick:Je,style:{visibility:je?"visible":"hidden"}})),jt.createElement(Ee.Z,{title:"\u5220\u9664"},jt.createElement(ge.Z,{className:Dt.Z.deleteIcon,onClick:fn,style:{visibility:pe>1?"visible":"hidden"}}))))},Tt=({questionTitlePlaceholder:It,titleKey:qt,choiceKey:Xt,analysisKey:Ht,choiceTextKey:pe,answerKey:re,choiceOptionsPath:Ne,allowChangeMode:ye=!0,form:xe,showAnalysis:Ue=!0})=>{const[je,Je]=(0,gt.useState)(),[fn,te]=(0,gt.useState)(!1);return jt.createElement("div",{className:Dt.Z.wrap},jt.createElement("div",{className:Dt.Z.questionTitleEditorWrap},jt.createElement(he.default.Item,{label:"\u9898\u5E72",name:qt,labelCol:{span:24},rules:[{required:!0}]},jt.createElement(Qt.h,{scrollId:Array.isArray(qt)?qt.join("_"):`${qt}`,watch:!0,height:140,placeholder:It}))),jt.createElement(he.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),jt.createElement(he.default.List,{name:Xt,rules:[{validator(Jt,Xe){const On=Xe.some(De=>De[re]===1),bn=Xe.findIndex(De=>{var on;return((on=De[pe])==null?void 0:on.length)<=0});return bn!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${St[bn]}\u9009\u9879\u7684\u5185\u5BB9`)):On?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(Jt,{add:Xe,remove:On})=>jt.createElement("div",{id:Array.isArray(Ne)?Ne.join("_"):`${Ne}`},Jt.map((bn,De)=>{var on=bn,{key:un,name:Kn}=on,Me=vt(on,["key","name"]);const vn=je===un,ne=()=>{Je(un)},wn=De<7&&De===Jt.length-1,fi=()=>Xe({[pe]:"",[re]:0}),Rt=()=>On(Kn);return jt.createElement(he.default.Item,pt(st({},Me),{key:un,name:Kn,className:Dt.Z.choiceListWrap,rules:[{validator(Lt,Pt){return Pt!=null&&Pt.choice_text?Promise.resolve():Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${St[De]}\u9009\u9879\u7684\u5185\u5BB9`))}}]}),jt.createElement(Et,{choiceTextKey:pe,answerKey:re,index:De,isEdit:vn,setInputActive:ne,form:xe,choiceOptionsPath:Ne,allowChangeMode:ye,showAddIcon:wn,addItem:fi,deleteItem:Rt}))}),Jt.length<8&&jt.createElement("div",{className:`${Dt.Z.addBtn} mb30`,onClick:()=>Xe({[pe]:"",[re]:0})},"\u6DFB\u52A0\u9009\u9879"))),Ue&&jt.createElement("div",{onClick:()=>te(!0)},jt.createElement(he.default.Item,{name:Ht,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},jt.createElement(Qt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:fn}))))}},92046:function(Mn,Rn,kt){"use strict";kt.d(Rn,{u:function(){return ye}});var gt=kt(59301),Ut=kt(62957),ue=kt(77019),Ee=kt(5269),he=kt(37568),Dt=kt(25399),ee=kt(71411),ge=kt(28284),Qt=kt(47889),jt=kt(71051),Ae=kt(31457),se=kt(12893),Pe=kt(61485),Bt=kt(8423),nt=kt(19105),et=kt(59301),ht=Object.defineProperty,st=Object.defineProperties,pt=Object.getOwnPropertyDescriptors,vt=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,Tt=(xe,Ue,je)=>Ue in xe?ht(xe,Ue,{enumerable:!0,configurable:!0,writable:!0,value:je}):xe[Ue]=je,It=(xe,Ue)=>{for(var je in Ue||(Ue={}))St.call(Ue,je)&&Tt(xe,je,Ue[je]);if(vt)for(var je of vt(Ue))Et.call(Ue,je)&&Tt(xe,je,Ue[je]);return xe},qt=(xe,Ue)=>st(xe,pt(Ue)),Xt=(xe,Ue)=>{var je={};for(var Je in xe)St.call(xe,Je)&&Ue.indexOf(Je)<0&&(je[Je]=xe[Je]);if(xe!=null&&vt)for(var Je of vt(xe))Ue.indexOf(Je)<0&&Et.call(xe,Je)&&(je[Je]=xe[Je]);return je};const Ht=({value:xe,onChange:Ue})=>{const je=fn=>{Ut.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Bt.Z.modal,onOk:()=>{const te=[...xe];te.splice(fn,1),Ue(te)}})},Je=()=>{const fn=[...xe];fn.push(""),Ue(fn)};return et.createElement(ue.Z,{className:"ml20"},et.createElement(Ee.Z,{flex:1},xe==null?void 0:xe.map((fn,te)=>et.createElement(ue.Z,{key:`${fn}_${te}`,className:"mb20"},et.createElement(he.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:fn,autoSize:{maxRows:3},maxLength:1e3,onBlur:Jt=>{const Xe=[...xe],On=Jt.target.value.trim();Xe[te]=On,Ue(Xe)}}),et.createElement(Dt.Z,{title:"\u5220\u9664"},et.createElement(se.Z,{className:Bt.Z.deleteIcon,style:{marginLeft:15,visibility:te>0?"visible":"hidden"},onClick:()=>je(te)}))))),et.createElement(Ee.Z,null,et.createElement("div",{className:`${Bt.Z.addBtn}`,onClick:()=>{Je()}},"\u65B0\u589E\u7B54\u6848")))},pe=({value:xe,onChange:Ue})=>{const je=fn=>{Ut.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Bt.Z.modal,onOk:()=>{const te=[...xe];te.splice(fn,1),Ue(te)}})},Je=()=>{const fn=[...xe];fn.push(""),Ue(fn)};return et.createElement(ue.Z,{className:"ml20"},et.createElement(Ee.Z,{flex:1},xe==null?void 0:xe.map((fn,te)=>et.createElement(ue.Z,{key:`${fn}_${te}`,align:"middle",className:"mb20"},et.createElement(nt.Z,{value:fn,style:{flex:1},onChange:Jt=>{const Xe=[...xe];Xe[te]=Jt,Ue(Xe)}}),et.createElement(Dt.Z,{title:"\u5220\u9664"},et.createElement(se.Z,{className:Bt.Z.deleteIcon,style:{marginLeft:15,visibility:te>0?"visible":"hidden"},onClick:()=>je(te)}))))),et.createElement(Ee.Z,null,et.createElement("div",{className:`${Bt.Z.addBtn}`,onClick:()=>{Je()}},"\u65B0\u589E\u7B54\u6848")))},re=({value:xe=!0,onChange:Ue})=>et.createElement(ee.Z,{checked:!xe,onChange:je=>{Ue(!je)}}),Ne="\u2581",ye=({questionTitlePlaceholder:xe,form:Ue,scoreByBlank:je=!1,answerKey:Je})=>{const[fn,te]=(0,gt.useState)(!1),Jt=(Me,vn)=>{const ne=vn.line;let wn=0;for(let Rt=0;Rt<ne;Rt++)wn+=Me.getLine(Rt).split(Ne).length-1;const fi=Me.getLine(ne).substring(0,vn.ch);return wn+=fi.split(Ne).length-1,wn},Xe=(Me,vn,ne,wn)=>{const fi=Me.getRange(vn.from,vn.to);let Rt=0;if(vn.text.forEach(Lt=>{Rt+=Lt.split(Ne).length-1}),vn.origin!=="setValue"){if(fi&&fi.indexOf(Ne)!==-1){const Lt=fi.split(Ne).length-1,Pt=Jt(Me,vn.from);if(console.log(`\u5220\u9664${Lt}\u4E2A\uFF0C \u524D\u9762\u6709${Pt}\u4E2A\uFF0C\u65B0\u589E${Rt}\u4E2A`),Lt>1){const Nt=Array.from({length:Lt},(Zt,Mt)=>Pt+Mt);wn(Nt)}else wn(Pt)}else if(Rt>0){const Lt=Jt(Me,vn.from);console.log(`\u65B0\u589E${Rt}\u4E2A\uFF0C\u4E4B\u524D\u6709${Lt}\u4E2A`),ne(Rt,Lt)}}},On=()=>{const Me=Ue.getFieldValue(Je);Ue.setFieldsValue({[Je]:Me.map((vn,ne)=>qt(It({},vn),{position:ne+1}))})},bn=(0,gt.useRef)(),De=(Me,vn)=>{for(let ne=0;ne<Me;ne++)bn.current({position:null,answer_text:[""],model:1},vn+ne);On()},on=(0,gt.useRef)(),un=Me=>{on.current(Me),On()},Kn=ge.default.useWatch(Je,Ue);return et.createElement("div",{className:Bt.Z.wrap},et.createElement("div",{className:Bt.Z.questionTitleEditorWrap},et.createElement(ge.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},et.createElement(Ae.h,{scrollId:"name",watch:!0,height:140,placeholder:xe,showNullButton:!0,onCMBeforeChange:(Me,vn)=>{Xe(Me,vn,De,un)}}))),et.createElement(ge.default.List,{name:Je,rules:[{validator(Me,vn){if(!(vn!=null&&vn.length))return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const ne of vn){const{answer_text:wn}=ne||{};if(wn!=null&&wn.some(fi=>(fi==null?void 0:fi.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(Me,{add:vn,remove:ne},{errors:wn})=>(bn.current=vn,on.current=ne,et.createElement(et.Fragment,null,et.createElement(ge.default.Item,{label:et.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(Me!=null&&Me.length)&&et.createElement("span",{style:{color:"#E99237"}},"\uFF08\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879\uFF09")),required:!0,labelCol:{span:24}}),Me.map((fi,Rt)=>{var Lt=fi,{key:Pt,name:Nt}=Lt,Zt=Xt(Lt,["key","name"]),Mt,Yt;return et.createElement("div",{style:{marginBottom:10},key:Pt},et.createElement(ue.Z,{className:"mb20",align:"middle",wrap:!1},et.createElement(Ee.Z,{style:{marginRight:10},flex:"0 0 auto",className:`${Bt.Z.blankIndex}`},"\u586B\u7A7A\u9879",Rt+1),et.createElement(ge.default.Item,qt(It({},Zt),{name:[Nt,"model"],noStyle:!0}),et.createElement(Qt.ZP.Group,{onChange:()=>{const Ge=Ue.getFieldValue(Je);Ue.setFieldsValue({[Je]:Ge.map((Oe,Ke)=>qt(It({},Oe),{answer_text:Nt===Ke?[""]:Oe.answer_text}))})}},et.createElement(Qt.ZP,{value:1},"\u6587\u672C\u6A21\u5F0F ",et.createElement(Dt.Z,{title:"\u5B66\u751F\u7B54\u9898\u65F6\uFF0C\u9700\u8981\u5728\u6587\u672C\u6846\u4E2D\u586B\u5199\u6587\u672C\u7B54\u6848"},et.createElement(Pe.Z,null))),et.createElement(Qt.ZP,{value:2},"\u6570\u5B66\u516C\u5F0F\u6A21\u5F0F ",et.createElement(Dt.Z,{title:"\u5B66\u751F\u7B54\u9898\u65F6\uFF0C\u9700\u8981\u7F16\u5199\u6570\u5B66\u516C\u5F0F\u4F5C\u4E3A\u7B54\u6848"},et.createElement(Pe.Z,null)))))),et.createElement(ue.Z,{style:{marginLeft:20},align:"middle",wrap:!1},et.createElement(Ee.Z,{flex:1},et.createElement(ue.Z,{align:"top",justify:"space-between",wrap:!1},et.createElement(Ee.Z,{flex:1},et.createElement(ge.default.Item,qt(It({},Zt),{name:[Nt,"answer_text"],noStyle:!0}),((Yt=(Mt=Ue.getFieldValue(Je))==null?void 0:Mt[Nt])==null?void 0:Yt.model)===1?et.createElement(Ht,null):et.createElement(pe,null))),je&&et.createElement(Ee.Z,{flex:"224px",style:{margin:"-7px 0 0 20px"}},et.createElement(ge.default.Item,qt(It({},Zt),{name:[Nt,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Bt.Z.blankInputNumberWrapper}),et.createElement(jt.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"})))),et.createElement(ge.default.Item,qt(It({},Zt),{name:[Nt,"position"],noStyle:!0}),et.createElement(he.default,{type:"hidden"})))))})))),et.createElement(ue.Z,{align:"middle"},et.createElement(ge.default.Item,{name:"downcase",valuePropName:"checked"},et.createElement(ee.Z,null)),et.createElement(Ee.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),et.createElement(ue.Z,{align:"middle"},et.createElement(ge.default.Item,{name:"no_space",valuePropName:"checked"},et.createElement(ee.Z,null)),et.createElement(Ee.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(Kn==null?void 0:Kn.length)>1&&et.createElement(ue.Z,{align:"middle",className:(Kn==null?void 0:Kn.length)>1?"mb30":`${Bt.Z.hide}`},et.createElement(ge.default.Item,{name:"is_ordered"},et.createElement(re,null)),et.createElement(Ee.Z,{className:"ml10"},"\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")),et.createElement("div",{onClick:()=>te(!0)},et.createElement(ge.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},et.createElement(Ae.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:fn}))))}},14289:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return vt}});var gt=kt(59301),Ut=kt(77019),ue=kt(5269),Ee=kt(28284),he=kt(8423),Dt=kt(31457),ee=kt(59301),ge=Object.defineProperty,Qt=Object.defineProperties,jt=Object.getOwnPropertyDescriptors,Ae=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,Bt=(St,Et,Tt)=>Et in St?ge(St,Et,{enumerable:!0,configurable:!0,writable:!0,value:Tt}):St[Et]=Tt,nt=(St,Et)=>{for(var Tt in Et||(Et={}))se.call(Et,Tt)&&Bt(St,Tt,Et[Tt]);if(Ae)for(var Tt of Ae(Et))Pe.call(Et,Tt)&&Bt(St,Tt,Et[Tt]);return St},et=(St,Et)=>Qt(St,jt(Et)),ht=(St,Et)=>{var Tt={};for(var It in St)se.call(St,It)&&Et.indexOf(It)<0&&(Tt[It]=St[It]);if(St!=null&&Ae)for(var It of Ae(St))Et.indexOf(It)<0&&Pe.call(St,It)&&(Tt[It]=St[It]);return Tt};const st={\u6B63\u786E:"T",\u9519\u8BEF:"F"},pt=({value:St,onChange:Et,form:Tt})=>{const It=(St==null?void 0:St.is_answer)===1,qt=St==null?void 0:St.choice_text,Xt=()=>{const Ht=Tt.getFieldsValue().choices.map(pe=>({choice_text:pe.choice_text,is_answer:0}));Tt.setFieldsValue({choices:Ht}),Et(et(nt({},St),{is_answer:1}))};return ee.createElement(Ut.Z,{className:he.Z.choiceWrap,align:"middle",wrap:!1,style:{marginBottom:"20px"}},ee.createElement(ue.Z,{onClick:Xt,className:`${he.Z.choiceIndex} ${he.Z.judgementIndex} ${It?he.Z.activeAnswer:""}`},st[qt]),ee.createElement(ue.Z,{flex:1,className:`${he.Z.editorWrap} ml15`},ee.createElement("div",{className:`${he.Z.inputBorder} ${he.Z.placeholder} ${It?he.Z.activeJudgementAnswer:""}`},qt)),ee.createElement(ue.Z,{flex:"0 0 auto",className:"ml15"},ee.createElement("div",{onClick:Xt,className:`${he.Z.setAnswerBtn} ${It?he.Z.activeAnswer:""}`},It?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},vt=({questionTitlePlaceholder:St,choiceKey:Et,form:Tt})=>{const[It,qt]=(0,gt.useState)(!1);return ee.createElement("div",{className:he.Z.wrap},ee.createElement("div",{className:he.Z.questionTitleEditorWrap},ee.createElement(Ee.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},ee.createElement(Dt.h,{scrollId:"name",watch:!0,height:140,placeholder:St}))),ee.createElement(Ee.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},ee.createElement(Ee.default.List,{name:"choices",rules:[{validator(Xt,Ht){return Ht.some(re=>(re==null?void 0:re.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},Xt=>ee.createElement("div",{id:"choices"},Xt.map(Ht=>{var pe=Ht,{key:re,name:Ne}=pe,ye=ht(pe,["key","name"]);return ee.createElement(Ee.default.Item,et(nt({},ye),{key:re,name:Ne,noStyle:!0}),ee.createElement(pt,{form:Tt}))})))),ee.createElement("div",{onClick:()=>qt(!0)},ee.createElement(Ee.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ee.createElement(Dt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:It}))))}},31457:function(Mn,Rn,kt){"use strict";kt.d(Rn,{h:function(){return nt},x:function(){return et}});var gt=kt(39793),Ut=kt(8423),ue=kt(76902),Ee=kt(59301),he=Object.defineProperty,Dt=Object.defineProperties,ee=Object.getOwnPropertyDescriptors,ge=Object.getOwnPropertySymbols,Qt=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable,Ae=(ht,st,pt)=>st in ht?he(ht,st,{enumerable:!0,configurable:!0,writable:!0,value:pt}):ht[st]=pt,se=(ht,st)=>{for(var pt in st||(st={}))Qt.call(st,pt)&&Ae(ht,pt,st[pt]);if(ge)for(var pt of ge(st))jt.call(st,pt)&&Ae(ht,pt,st[pt]);return ht},Pe=(ht,st)=>Dt(ht,ee(st)),Bt=(ht,st)=>{var pt={};for(var vt in ht)Qt.call(ht,vt)&&st.indexOf(vt)<0&&(pt[vt]=ht[vt]);if(ht!=null&&ge)for(var vt of ge(ht))st.indexOf(vt)<0&&jt.call(ht,vt)&&(pt[vt]=ht[vt]);return pt};const nt=ht=>{var st=ht,{value:pt,onChange:vt,scrollId:St}=st,Et=Bt(st,["value","onChange","scrollId"]);return Ee.createElement("div",{id:St||""},Ee.createElement(gt.Z,Pe(se({},Et),{defaultValue:pt,onChange:(Tt,It)=>{It!=null&&It.length?vt(Tt,It):vt(Tt)}})))},et=({value:ht,onChange:st,placeholder:pt,height:vt=140,isEdit:St,miniToolbar:Et,watch:Tt=!0})=>St?Ee.createElement(gt.Z,{watch:Tt,isFocus:!0,height:vt||void 0,placeholder:pt,defaultValue:ht,onChange:st,miniToolbar:Et}):Ee.createElement("div",{style:{cursor:"pointer"}},ht?Ee.createElement(ue.Z,{className:Ut.Z.inputBorder,value:ht}):Ee.createElement("div",{className:`${Ut.Z.inputBorder} ${Ut.Z.placeholder} inputBorderError`},pt))},44272:function(Mn,Rn,kt){"use strict";kt.d(Rn,{W:function(){return pe}});var gt=kt(59301),Ut=kt(6767),ue=kt(96599),Ee=kt(28284),he=kt(71411),Dt=kt(77019),ee=kt(5269),ge=kt(25399),Qt=kt(37568),jt=kt(71051),Ae=kt(8423),se=kt(31457),Pe=kt(39793),Bt=kt(61485),nt=Object.defineProperty,et=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,pt=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable,St=(re,Ne,ye)=>Ne in re?nt(re,Ne,{enumerable:!0,configurable:!0,writable:!0,value:ye}):re[Ne]=ye,Et=(re,Ne)=>{for(var ye in Ne||(Ne={}))pt.call(Ne,ye)&&St(re,ye,Ne[ye]);if(st)for(var ye of st(Ne))vt.call(Ne,ye)&&St(re,ye,Ne[ye]);return re},Tt=(re,Ne)=>et(re,ht(Ne)),It=(re,Ne)=>{var ye={};for(var xe in re)pt.call(re,xe)&&Ne.indexOf(xe)<0&&(ye[xe]=re[xe]);if(re!=null&&st)for(var xe of st(re))Ne.indexOf(xe)<0&&vt.call(re,xe)&&(ye[xe]=re[xe]);return ye};const qt=re=>{var Ne=re,{value:ye,onChange:xe}=Ne,Ue=It(Ne,["value","onChange"]);const je=Je=>{xe([Je])};return gt.createElement(Pe.Z,Tt(Et({},Ue),{defaultValue:ye==null?void 0:ye[0],onChange:je}))},Xt=re=>{if(!re)return!1;if(/^s*$/.test(re)||re.trim()===""){Ut.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let Ne=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return re==="|"?(Ut.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Ht=({value:re=[],onClose:Ne})=>gt.createElement(ue.default,{closable:!0,onClose:Ne,className:Ae.Z.keywordTag},gt.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},re.join(" \u6216 "))),pe=({questionTitlePlaceholder:re,form:Ne,showKeywords:ye,isMustKeyWords:xe=ye})=>{const[Ue,je]=(0,gt.useState)(!1),[Je,fn]=(0,gt.useState)(""),te=Ee.default.useWatch("use_keywords",Ne),Jt=Ee.default.useWatch("question_score",Ne);return gt.createElement("div",{className:Ae.Z.wrap},gt.createElement("div",{className:Ae.Z.questionTitleEditorWrap},gt.createElement(Ee.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},gt.createElement(se.h,{scrollId:"name",watch:!0,height:140,placeholder:re}))),gt.createElement(Ee.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:"answer_texts",labelCol:{span:24}},gt.createElement(qt,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),ye&&!xe&&gt.createElement(Ee.default.Item,{hidden:!0,name:"use_keywords",valuePropName:"checked"},gt.createElement(he.Z,{defaultChecked:!0})),ye&&xe&&gt.createElement(Dt.Z,{align:"middle",className:"mb30"},gt.createElement(Ee.default.Item,{name:"use_keywords",valuePropName:"checked"},gt.createElement(he.Z,null)),gt.createElement(ee.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),gt.createElement(ee.Z,null,gt.createElement(ge.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},gt.createElement(Bt.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(te||!xe)&&gt.createElement(Ee.default.List,{name:"keywords",rules:[{validator(Xe,On){return xe?On!=null&&On.length?(On==null?void 0:On.reduce((De,on)=>De+on.score,0))>parseFloat(Jt)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD")):Promise.resolve()}}]},(Xe,{add:On,remove:bn})=>gt.createElement(gt.Fragment,null,gt.createElement("div",{className:`${Ae.Z.title} mb10`},xe?"\u5173\u952E\u8BCD":gt.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),gt.createElement(Dt.Z,{align:"middle",className:"font14 mb30"},gt.createElement(ee.Z,{flex:1},gt.createElement(Qt.default,{value:Je,onChange:De=>{fn(De.target.value)},maxLength:50,allowClear:!0,onPressEnter:De=>{var on,un,Kn,Me;const vn=`${(on=De.target)==null?void 0:on.value}`,ne=(Kn=(un=vn==null?void 0:vn.split("|"))==null?void 0:un.filter(Rt=>!!Rt))==null?void 0:Kn.map(Rt=>Rt==null?void 0:Rt.trim()),wn=Ne.getFieldValue("keywords"),fi=((Me=wn==null?void 0:wn.map(Rt=>Rt==null?void 0:Rt.keyword))==null?void 0:Me.flat())||[];for(const Rt of ne)if(fi.includes(Rt)){Ut.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Xt(vn)&&(On({keyword:ne,score:1}),fn(""))},className:Ae.Z.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),gt.createElement(ee.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Xe.map(De=>{var on=De,{key:un,name:Kn}=on,Me=It(on,["key","name"]);return gt.createElement(Dt.Z,{key:un,className:"mb20",style:{marginRight:148}},gt.createElement(ee.Z,{flex:1},gt.createElement(Dt.Z,{align:"middle",justify:"space-between"},gt.createElement(Ee.default.Item,Tt(Et({},Me),{name:[Kn,"keyword"]}),gt.createElement(Ht,{onClose:()=>bn(Kn)})),xe&&gt.createElement(Ee.default.Item,Tt(Et({},Me),{name:[Kn,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Ae.Z.blankInputNumberWrapper}),gt.createElement(jt.Z,{className:Ae.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),gt.createElement("div",{onClick:()=>je(!0)},gt.createElement(Ee.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},gt.createElement(se.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ue}))))}},77762:function(Mn,Rn,kt){"use strict";kt.d(Rn,{tc:function(){return Hi.t},uh:function(){return gt.u},rL:function(){return mi},u8:function(){return ue.u},ZZ:function(){return Ut.Z},Wk:function(){return Ee.W}});var gt=kt(81727),Ut=kt(14289),ue=kt(92046),Ee=kt(44272),he=kt(59301),Dt=kt(8848),ee=kt(28284),ge=kt(77019),Qt=kt(5269),jt=kt(71051),Ae=kt(25399),se=kt(75727),Pe=kt(8423),Bt=kt(12893),nt=kt(31457),et=kt(62957),ht=kt(37568),st=kt(71411),pt=kt(59301),vt=Object.defineProperty,St=Object.defineProperties,Et=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,It=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,Xt=(Cn,Sn,Bn)=>Sn in Cn?vt(Cn,Sn,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):Cn[Sn]=Bn,Ht=(Cn,Sn)=>{for(var Bn in Sn||(Sn={}))It.call(Sn,Bn)&&Xt(Cn,Bn,Sn[Bn]);if(Tt)for(var Bn of Tt(Sn))qt.call(Sn,Bn)&&Xt(Cn,Bn,Sn[Bn]);return Cn},pe=(Cn,Sn)=>St(Cn,Et(Sn)),re=(Cn,Sn)=>{var Bn={};for(var si in Cn)It.call(Cn,si)&&Sn.indexOf(si)<0&&(Bn[si]=Cn[si]);if(Cn!=null&&Tt)for(var si of Tt(Cn))Sn.indexOf(si)<0&&qt.call(Cn,si)&&(Bn[si]=Cn[si]);return Bn};const Ne=({value:Cn,onChange:Sn})=>{const Bn=yi=>{et.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Pe.Z.modal,onOk:()=>{const hi=[...Cn];hi.splice(yi,1),Sn(hi)}})},si=()=>{const yi=[...Cn];yi.push(""),Sn(yi)};return pt.createElement(ge.Z,{className:"ml20"},pt.createElement(Qt.Z,{flex:1},Cn==null?void 0:Cn.map((yi,hi)=>pt.createElement(ge.Z,{key:`${yi}_${hi}`,align:"middle",className:"mb20"},pt.createElement(ht.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:yi,autoSize:{maxRows:3},maxLength:1e3,onBlur:Gi=>{const wt=[...Cn],Ye=Gi.target.value.trim();wt[hi]=Ye,Sn(wt)}}),pt.createElement(Ae.Z,{title:"\u5220\u9664"},pt.createElement(Bt.Z,{className:Pe.Z.deleteIcon,style:{marginLeft:15,visibility:hi>0?"visible":"hidden"},onClick:()=>Bn(hi)}))))),pt.createElement(Qt.Z,null,pt.createElement("div",{className:`${Pe.Z.addBtn}`,onClick:()=>{si()}},"\u65B0\u589E\u7B54\u6848")))},ye=({value:Cn=!0,onChange:Sn})=>pt.createElement(st.Z,{checked:!Cn,onChange:Bn=>{Sn(!Bn)}}),xe="\u2581",Ue=({questionTitlePlaceholder:Cn,form:Sn,name:Bn,scoreByBlank:si=!1,answerKey:yi,titleKey:hi="name",analysisKey:Gi="analysis",isOrdered:wt="is_ordered"})=>{var Ye,Zn;const[Ln,zn]=(0,he.useState)(!1),oi=(Yn,Wn)=>{const qe=Wn.line;let Dn=0;for(let Di=0;Di<qe;Di++)Dn+=Yn.getLine(Di).split(xe).length-1;const ki=Yn.getLine(qe).substring(0,Wn.ch);return Dn+=ki.split(xe).length-1,Dn},Si=(Yn,Wn,qe,Dn)=>{const ki=Yn.getRange(Wn.from,Wn.to);let Di=0;if(Wn.text.forEach(Ki=>{Di+=Ki.split(xe).length-1}),Wn.origin!=="setValue"){if(ki&&ki.indexOf(xe)!==-1){const Ki=ki.split(xe).length-1,Gt=oi(Yn,Wn.from);if(console.log(`\u5220\u9664${Ki}\u4E2A\uFF0C \u524D\u9762\u6709${Gt}\u4E2A\uFF0C\u65B0\u589E${Di}\u4E2A`),Ki>1){const me=Array.from({length:Ki},(En,Gn)=>Gt+Gn);Dn(me)}else Dn(Gt)}else if(Di>0){const Ki=oi(Yn,Wn.from);console.log(`\u65B0\u589E${Di}\u4E2A\uFF0C\u4E4B\u524D\u6709${Ki}\u4E2A`),qe(Di,Ki)}}},Yi=()=>{const Yn=Sn.getFieldValue(["sub_item_banks",...yi]);Sn.setFieldValue(["sub_item_banks",...yi],Yn==null?void 0:Yn.map((Wn,qe)=>pe(Ht({},Wn),{position:qe+1})))},Fi=(0,he.useRef)(),ve=(Yn,Wn)=>{for(let qe=0;qe<Yn;qe++)Fi.current({position:null,answer_text:[""]},Wn+qe);Yi()},Le=(0,he.useRef)(),Se=Yn=>{Le.current(Yn),Yi()},ti=(Zn=(Ye=Sn.getFieldValue("sub_item_banks"))==null?void 0:Ye[yi==null?void 0:yi[0]])==null?void 0:Zn[yi==null?void 0:yi[1]];return(0,he.useEffect)(()=>{console.log("========",Sn.getFieldsValue())},[Sn]),pt.createElement("div",{className:Pe.Z.wrap},pt.createElement("div",{className:Pe.Z.questionTitleEditorWrap},pt.createElement(ee.default.Item,{label:"\u9898\u5E72",name:hi,labelCol:{span:24},rules:[{required:!0}]},pt.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:Cn,showNullButton:!0,onCMBeforeChange:(Yn,Wn)=>{Si(Yn,Wn,ve,Se)}}))),pt.createElement(ee.default.List,{name:yi,rules:[{validator(Yn,Wn){if((Wn==null?void 0:Wn.length)===0)return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const qe of Wn){const{answer_text:Dn}=qe||{};if(Dn!=null&&Dn.some(ki=>(ki==null?void 0:ki.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(Yn,{add:Wn,remove:qe},{errors:Dn})=>(Fi.current=Wn,Le.current=qe,pt.createElement(pt.Fragment,null,pt.createElement(ee.default.Item,{label:pt.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(Yn!=null&&Yn.length)&&pt.createElement("span",{style:{color:"#E99237"}},"\uFF08\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879\uFF09")),required:!0,labelCol:{span:24}}),Yn.map((ki,Di)=>{var Ki=ki,{key:Gt,name:me}=Ki,En=re(Ki,["key","name"]);return pt.createElement(ge.Z,{align:"top",key:Gt},pt.createElement(Qt.Z,{className:`${Pe.Z.blankIndex} pt5`},"\u586B\u7A7A\u9879",Di+1),pt.createElement(Qt.Z,{flex:1},pt.createElement(ge.Z,{align:"top",justify:"space-between"},pt.createElement(Qt.Z,{flex:1},pt.createElement(ee.default.Item,pe(Ht({},En),{name:[me,"answer_text"],noStyle:!0}),pt.createElement(Ne,null))),si&&pt.createElement(Qt.Z,{flex:"224px"},pt.createElement(ee.default.Item,pe(Ht({},En),{name:[me,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Pe.Z.blankInputNumberWrapper}),pt.createElement(jt.Z,{className:Pe.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"})))),pt.createElement(ee.default.Item,pe(Ht({},En),{name:[me,"position"],noStyle:!0}),pt.createElement(ht.default,{type:"hidden"}))))})))),pt.createElement(ge.Z,{align:"middle"},pt.createElement(ee.default.Item,{name:[Bn,"downcase"],valuePropName:"checked"},pt.createElement(st.Z,null)),pt.createElement(Qt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),pt.createElement(ge.Z,{align:"middle"},pt.createElement(ee.default.Item,{name:[Bn,"no_space"],valuePropName:"checked"},pt.createElement(st.Z,null)),pt.createElement(Qt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(ti==null?void 0:ti.length)>1&&pt.createElement(ge.Z,{align:"middle",className:(ti==null?void 0:ti.length)>1?"mb30":`${Pe.Z.hide}`},pt.createElement(ee.default.Item,{name:wt},pt.createElement(ye,null)),pt.createElement(Qt.Z,{className:"ml10"},"\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")),pt.createElement("div",{className:"mt30",onClick:()=>zn(!0)},pt.createElement(ee.default.Item,{name:Gi,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},pt.createElement(nt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ln}))))};var je=kt(59301),Je=Object.defineProperty,fn=Object.defineProperties,te=Object.getOwnPropertyDescriptors,Jt=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,On=Object.prototype.propertyIsEnumerable,bn=(Cn,Sn,Bn)=>Sn in Cn?Je(Cn,Sn,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):Cn[Sn]=Bn,De=(Cn,Sn)=>{for(var Bn in Sn||(Sn={}))Xe.call(Sn,Bn)&&bn(Cn,Bn,Sn[Bn]);if(Jt)for(var Bn of Jt(Sn))On.call(Sn,Bn)&&bn(Cn,Bn,Sn[Bn]);return Cn},on=(Cn,Sn)=>fn(Cn,te(Sn)),un=(Cn,Sn)=>{var Bn={};for(var si in Cn)Xe.call(Cn,si)&&Sn.indexOf(si)<0&&(Bn[si]=Cn[si]);if(Cn!=null&&Jt)for(var si of Jt(Cn))Sn.indexOf(si)<0&&On.call(Cn,si)&&(Bn[si]=Cn[si]);return Bn};const Kn={\u6B63\u786E:"T",\u9519\u8BEF:"F"},Me=({value:Cn,onChange:Sn,form:Bn,choiceKey:si})=>{const yi=(Cn==null?void 0:Cn.is_answer)===1,hi=Cn==null?void 0:Cn.choice_text,Gi=()=>{var wt;const Ye=(wt=Bn==null?void 0:Bn.getFieldValue(["sub_item_banks",...si]))==null?void 0:wt.map(Zn=>({choice_text:Zn.choice_text,is_answer:0}));Bn==null||Bn.setFieldValue(["sub_item_banks",...si],Ye),Sn(on(De({},Cn),{is_answer:1}))};return je.createElement(ge.Z,{className:Pe.Z.choiceWrap,align:"middle",wrap:!1},je.createElement(Qt.Z,{onClick:Gi,className:`${Pe.Z.choiceIndex} ${Pe.Z.judgementIndex} ${yi?Pe.Z.activeAnswer:""}`},Kn[hi]),je.createElement(Qt.Z,{flex:1,className:`${Pe.Z.editorWrap} ml15`},je.createElement("div",{className:`${Pe.Z.inputBorder} ${Pe.Z.placeholder} ${yi?Pe.Z.activeJudgementAnswer:""}`},hi)),je.createElement(Qt.Z,{flex:"0 0 auto",className:"ml15"},je.createElement("div",{onClick:Gi,className:`${Pe.Z.setAnswerBtn} ${yi?Pe.Z.activeAnswer:""}`},yi?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},vn=({questionTitlePlaceholder:Cn,choiceKey:Sn="choices",form:Bn,titleKey:si="name",analysisKey:yi="analysis"})=>{const[hi,Gi]=(0,he.useState)(!1);return je.createElement("div",{className:Pe.Z.wrap},je.createElement("div",{className:Pe.Z.questionTitleEditorWrap},je.createElement(ee.default.Item,{label:"\u9898\u5E72",name:si,labelCol:{span:24},rules:[{required:!0}]},je.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:Cn}))),je.createElement(ee.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},je.createElement(ee.default.List,{name:Sn,rules:[{validator(wt,Ye){return Ye.some(Ln=>(Ln==null?void 0:Ln.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},wt=>je.createElement("div",{id:"choices",style:{display:"flex",flexDirection:"column",gap:"20px"}},wt.map(Ye=>{var Zn=Ye,{key:Ln,name:zn}=Zn,oi=un(Zn,["key","name"]);return je.createElement(ee.default.Item,on(De({},oi),{key:Ln,name:zn,noStyle:!0}),je.createElement(Me,{form:Bn,choiceKey:Sn}))})))),je.createElement("div",{className:"mt30",onClick:()=>Gi(!0)},je.createElement(ee.default.Item,{name:yi,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},je.createElement(nt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:hi}))))};var ne=kt(6767),wn=kt(96599),fi=kt(39793),Rt=kt(61485),Lt=Object.defineProperty,Pt=Object.defineProperties,Nt=Object.getOwnPropertyDescriptors,Zt=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,Ge=(Cn,Sn,Bn)=>Sn in Cn?Lt(Cn,Sn,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):Cn[Sn]=Bn,Oe=(Cn,Sn)=>{for(var Bn in Sn||(Sn={}))Mt.call(Sn,Bn)&&Ge(Cn,Bn,Sn[Bn]);if(Zt)for(var Bn of Zt(Sn))Yt.call(Sn,Bn)&&Ge(Cn,Bn,Sn[Bn]);return Cn},Ke=(Cn,Sn)=>Pt(Cn,Nt(Sn)),we=(Cn,Sn)=>{var Bn={};for(var si in Cn)Mt.call(Cn,si)&&Sn.indexOf(si)<0&&(Bn[si]=Cn[si]);if(Cn!=null&&Zt)for(var si of Zt(Cn))Sn.indexOf(si)<0&&Yt.call(Cn,si)&&(Bn[si]=Cn[si]);return Bn};const Ce=Cn=>{var Sn=Cn,{value:Bn,onChange:si}=Sn,yi=we(Sn,["value","onChange"]);const hi=Gi=>{si([Gi])};return he.createElement(fi.Z,Ke(Oe({},yi),{defaultValue:Bn==null?void 0:Bn[0],onChange:hi}))},Fe=Cn=>{if(!Cn)return!1;let Sn=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return Cn==="|"?(ne.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},He=({value:Cn=[],onClose:Sn})=>he.createElement(wn.default,{closable:!0,onClose:Sn,className:Pe.Z.keywordTag},he.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},Cn.join(" \u6216 "))),Qe=({questionTitlePlaceholder:Cn,form:Sn,showKeywords:Bn,isMustKeyWords:si=Bn,titleKey:yi="name",analysisKey:hi="analysis",answerTexts:Gi="answer_texts",keywords:wt="keywords",useKeywords:Ye="use_keywords",indexs:Zn})=>{const[Ln,zn]=(0,he.useState)(!1),[oi,Si]=(0,he.useState)(""),[Yi,Fi]=(0,he.useState)(!1),ve=ee.default.useWatch("question_score",Sn);return he.createElement("div",{className:Pe.Z.wrap},he.createElement("div",{className:Pe.Z.questionTitleEditorWrap},he.createElement(ee.default.Item,{label:"\u9898\u5E72",name:yi,labelCol:{span:24},rules:[{required:!0}]},he.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:Cn}))),he.createElement(ee.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:Gi,labelCol:{span:24}},he.createElement(Ce,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),Bn&&!si&&he.createElement(ee.default.Item,{hidden:!0,name:Ye,valuePropName:"checked"},he.createElement(st.Z,{defaultChecked:!0})),Bn&&si&&he.createElement(ge.Z,{align:"middle",className:"mb30"},he.createElement(ee.default.Item,{name:Ye,valuePropName:"checked"},he.createElement(st.Z,{onChange:()=>{var Le,Se,ti,Yn,Wn,qe;console.log(Sn.getFieldsValue()),Fi((ti=(Se=(Le=Sn.getFieldsValue())==null?void 0:Le.sub_item_banks)==null?void 0:Se[Zn])==null?void 0:ti.use_keywords),console.log((qe=(Wn=(Yn=Sn.getFieldsValue())==null?void 0:Yn.sub_item_banks)==null?void 0:Wn[Zn])==null?void 0:qe.use_keywords),console.log(Yi)}})),he.createElement(Qt.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),he.createElement(Qt.Z,null,he.createElement(Ae.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},he.createElement(Rt.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(Yi||!si)&&he.createElement(ee.default.List,{name:wt,rules:[{validator(Le,Se){return si?Se!=null&&Se.length?(Se==null?void 0:Se.reduce((Yn,Wn)=>Yn+Wn.score,0))>parseFloat(ve)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD")):Promise.resolve()}}]},(Le,{add:Se,remove:ti})=>he.createElement(he.Fragment,null,he.createElement("div",{className:`${Pe.Z.title} mb10`},si?"\u5173\u952E\u8BCD":he.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),he.createElement(ge.Z,{align:"middle",className:"font14 mb30"},he.createElement(Qt.Z,{flex:1},he.createElement(ht.default,{value:oi,onChange:Yn=>{Si(Yn.target.value)},maxLength:50,allowClear:!0,onPressEnter:Yn=>{var Wn,qe,Dn,ki;const Di=`${(Wn=Yn.target)==null?void 0:Wn.value}`,Ki=(Dn=(qe=Di==null?void 0:Di.split("|"))==null?void 0:qe.filter(En=>!!En))==null?void 0:Dn.map(En=>En==null?void 0:En.trim()),Gt=Sn.getFieldValue(["sub_item_banks",...wt]),me=((ki=Gt==null?void 0:Gt.map(En=>En==null?void 0:En.keyword))==null?void 0:ki.flat())||[];for(const En of Ki)if(me.includes(En)){ne.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Fe(Di)&&(Se({keyword:Ki,score:1}),Si(""))},className:Pe.Z.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),he.createElement(Qt.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Le.map(Yn=>{var Wn=Yn,{key:qe,name:Dn}=Wn,ki=we(Wn,["key","name"]);return he.createElement(ge.Z,{key:qe,className:"mb20",style:{marginRight:148}},he.createElement(Qt.Z,{flex:1},he.createElement(ge.Z,{align:"middle",justify:"space-between"},he.createElement(ee.default.Item,Ke(Oe({},ki),{name:[Dn,"keyword"]}),he.createElement(He,{onClose:()=>ti(Dn)})),si&&he.createElement(ee.default.Item,Ke(Oe({},ki),{name:[Dn,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Pe.Z.blankInputNumberWrapper}),he.createElement(jt.Z,{className:Pe.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),he.createElement("div",{onClick:()=>zn(!0)},he.createElement(ee.default.Item,{name:hi,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},he.createElement(nt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ln}))))};var hn=kt(59301),dn=Object.defineProperty,ri=Object.defineProperties,ze=Object.getOwnPropertyDescriptors,We=Object.getOwnPropertySymbols,an=Object.prototype.hasOwnProperty,Xn=Object.prototype.propertyIsEnumerable,pn=(Cn,Sn,Bn)=>Sn in Cn?dn(Cn,Sn,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):Cn[Sn]=Bn,rn=(Cn,Sn)=>{for(var Bn in Sn||(Sn={}))an.call(Sn,Bn)&&pn(Cn,Bn,Sn[Bn]);if(We)for(var Bn of We(Sn))Xn.call(Sn,Bn)&&pn(Cn,Bn,Sn[Bn]);return Cn},In=(Cn,Sn)=>ri(Cn,ze(Sn)),pi=(Cn,Sn)=>{var Bn={};for(var si in Cn)an.call(Cn,si)&&Sn.indexOf(si)<0&&(Bn[si]=Cn[si]);if(Cn!=null&&We)for(var si of We(Cn))Sn.indexOf(si)<0&&Xn.call(Cn,si)&&(Bn[si]=Cn[si]);return Bn};const{Panel:ei}=Dt.default,mi=({questionTitlePlaceholder:Cn,choiceKey:Sn,form:Bn,withScore:si})=>{const[yi,hi]=(0,he.useState)([]),Gi=wt=>{hi(wt)};return hn.createElement("div",{className:Pe.Z.wrap},hn.createElement("div",{className:Pe.Z.questionTitleEditorWrap},hn.createElement(ee.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},hn.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:Cn}))),hn.createElement(ee.default.Item,{label:"\u5C0F\u9898",required:!0,labelCol:{span:24}}),hn.createElement(ee.default.List,{name:"sub_item_banks",rules:[{validator(wt,Ye){return Ye?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(wt,{add:Ye,remove:Zn,move:Ln})=>{const zn=Bn.getFieldValue("sub_item_banks");return hn.createElement(hn.Fragment,null,hn.createElement(Dt.default,{className:wt.length>0?Pe.Z.collapseWrapper:"",bordered:!1,activeKey:yi,onChange:Gi,expandIcon:({isActive:oi})=>hn.createElement("i",{className:`iconfont icon-weizhankai ${oi?Pe.Z.open:Pe.Z.close}`,style:{fontSize:14,transition:"all .2s"}})},wt.map((oi,Si)=>{var Yi=oi,{key:Fi,name:ve}=Yi,Le=pi(Yi,["key","name"]),Se,ti,Yn,Wn,qe,Dn,ki,Di,Ki,Gt;return hn.createElement(ei,{className:Pe.Z.panel,forceRender:!0,header:hn.createElement("div",{className:Pe.Z.panelHeader},"\u7B2C",Si+1,"\u5C0F\u9898",hn.createElement("span",null,"\uFF08",((Se=zn==null?void 0:zn[ve])==null?void 0:Se.item_type)=="SINGLE"?"\u5355\u9009\u9898":((ti=zn==null?void 0:zn[ve])==null?void 0:ti.item_type)=="MULTIPLE"?"\u591A\u9009\u9898":((Yn=zn==null?void 0:zn[ve])==null?void 0:Yn.item_type)=="COMPLETION"?"\u586B\u7A7A\u9898":((Wn=zn==null?void 0:zn[ve])==null?void 0:Wn.item_type)=="JUDGMENT"?"\u5224\u65AD\u9898":"\u7B80\u7B54\u9898","\uFF09")),key:ve,extra:hn.createElement(ge.Z,{align:"middle",onClick:me=>me.stopPropagation()},si&&hn.createElement(Qt.Z,null,hn.createElement(ee.default.Item,In(rn({},Le),{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5C0F\u9898\u5206\u503C"}],label:"\u5206\u503C",name:[ve,"question_score"],className:Pe.Z.blankInputNumberWrapper}),hn.createElement(jt.Z,{className:Pe.Z.blankInput,placeholder:"\u8BF7\u8F93\u5165\u5F53\u524D\u5C0F\u9898\u5206\u6570",min:.1,precision:1,max:100,style:{width:150}}))),hn.createElement(Qt.Z,null,hn.createElement(ge.Z,{align:"middle",className:"pl40",justify:"end"},Si!==0&&hn.createElement("div",{onClick:()=>{var me;Ln(Si,Si-1);const En=(me=Bn.getFieldValue("sub_item_banks"))==null?void 0:me.map((Gn,Re)=>(wt.map(($e,Nn)=>{Re===Nn&&(Gn.q_position=Number($e.name)+1)}),Gn));Bn.setFieldValue("sub_item_banks",En)}},hn.createElement(Ae.Z,{title:"\u4E0A\u79FB"},hn.createElement("i",{className:"iconfont icon-shangyi3 c-grey-999 primary-hover"}))),Si<wt.length-1&&hn.createElement("div",{onClick:()=>{var me;Ln(Si,Si+1);const En=(me=Bn.getFieldValue("sub_item_banks"))==null?void 0:me.map((Gn,Re)=>(wt.map(($e,Nn)=>{Re===Nn&&(Gn.q_position=Number($e.name)+1)}),Gn));Bn.setFieldValue("sub_item_banks",En)},className:Si===0?"":"ml15"},hn.createElement(Ae.Z,{title:"\u4E0B\u79FB"},hn.createElement("i",{className:"iconfont icon-xiayi3 c-grey-999 primary-hover"}))))),hn.createElement(Qt.Z,null,hn.createElement(Ae.Z,{title:"\u5220\u9664"},hn.createElement(Bt.Z,{className:`${Pe.Z.deleteIcon} ml15`,onClick:()=>Zn(ve)}))))},hn.createElement(ee.default.Item,In(rn({},Le),{name:ve}),(((qe=zn==null?void 0:zn[ve])==null?void 0:qe.item_type)=="SINGLE"||((Dn=zn==null?void 0:zn[ve])==null?void 0:Dn.item_type)=="MULTIPLE")&&hn.createElement(gt.u,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((ki=zn==null?void 0:zn[ve])==null?void 0:ki.item_type)=="MULTIPLE",form:Bn,choiceKey:[ve,"choices"],titleKey:[ve,"name"],analysisKey:[ve,"analysis"],choiceOptionsPath:["sub_item_banks",ve,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((Di=zn==null?void 0:zn[ve])==null?void 0:Di.item_type)=="COMPLETION"&&hn.createElement(Ue,{form:Bn,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,name:ve,titleKey:[ve,"name"],analysisKey:[ve,"analysis"],isOrdered:[ve,"is_ordered"],answerKey:[ve,"standard_answers"]}),((Ki=zn==null?void 0:zn[ve])==null?void 0:Ki.item_type)=="JUDGMENT"&&hn.createElement(vn,{form:Bn,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[ve,"name"],analysisKey:[ve,"analysis"],choiceKey:[ve,"choices"]}),((Gt=zn==null?void 0:zn[ve])==null?void 0:Gt.item_type)=="SUBJECTIVE"&&hn.createElement(Qe,{showKeywords:!0,isMustKeyWords:!1,form:Bn,titleKey:[ve,"name"],analysisKey:[ve,"analysis"],answerTexts:[ve,"answer_texts"],useKeywords:[ve,"use_keywords"],keywords:[ve,"keywords"],indexs:ve,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})),wt.length<20&&hn.createElement(se.Z,{menu:{items:[{label:hn.createElement("div",{onClick:()=>{Ye({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"SINGLE"}),hi([wt==null?void 0:wt.length,...yi])}},"\u5355\u9009\u9898"),key:"1",show:!0},{label:hn.createElement("div",{onClick:()=>{Ye({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"MULTIPLE"}),hi([wt==null?void 0:wt.length,...yi])}},"\u591A\u9009\u9898"),key:"2",show:!0},{label:hn.createElement("div",{onClick:()=>{Ye({name:"",choices:[{choice_text:"\u6B63\u786E",is_answer:0},{choice_text:"\u9519\u8BEF",is_answer:0}],analysis:"",item_type:"JUDGMENT"}),hi([wt==null?void 0:wt.length,...yi])}},"\u5224\u65AD\u9898"),key:"3",show:!0},{label:hn.createElement("div",{onClick:()=>{Ye({name:"",analysis:"",is_ordered:!0,standard_answers:[],item_type:"COMPLETION",downcase:!0,no_space:!0}),hi([wt==null?void 0:wt.length,...yi])}},"\u586B\u7A7A\u9898"),key:"4",show:!0},{label:hn.createElement("div",{onClick:()=>{Ye({name:"",answer_texts:[],keywords:[],use_keywords:!0,analysis:"",item_type:"SUBJECTIVE"}),hi([wt==null?void 0:wt.length,...yi])}},"\u7B80\u7B54\u9898"),key:"5",show:!0}].filter(oi=>oi.show).map(oi=>({label:oi.label,key:oi.key}))}},hn.createElement("div",{className:`${Pe.Z.addBtn}`},"\u6DFB\u52A0\u5C0F\u9898")))}))};var Hi=kt(68571)},76902:function(Mn,Rn,kt){"use strict";kt.d(Rn,{z:function(){return qt},Z:function(){return Xt}});var gt=kt(59301),Ut=kt(8944),ue=kt(81428),Ee=kt(64018),he=kt(15360),Dt=kt(346),ee=kt(51257),ge=kt(15342),Qt=kt(1012),jt=kt(45677),Ae=kt(59301),Pe=({html:Ht})=>{const pe=(0,gt.useRef)(null),re=(0,gt.useRef)(null),Ne=`.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,gt.useEffect)(()=>{const ye=pe.current.attachShadow({mode:"open"});re.current=document.createElement("div"),re.current.className="markdown-body",re.current.innerHTML=Ht,ye.appendChild(re.current);const xe=document.createElement("style");return xe.textContent=Ne,ye.appendChild(xe),()=>{ye.innerHTML=""}},[]),(0,gt.useEffect)(()=>{re.current&&(re.current.innerHTML=Ht)},[Ht]),Ae.createElement("div",{ref:pe})};function Bt(Ht){const pe=["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(${pe.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return Ht.replace(re,"").trim()}var nt=Object.defineProperty,et=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,pt=(Ht,pe,re)=>pe in Ht?nt(Ht,pe,{enumerable:!0,configurable:!0,writable:!0,value:re}):Ht[pe]=re,vt=(Ht,pe)=>{for(var re in pe||(pe={}))ht.call(pe,re)&&pt(Ht,re,pe[re]);if(et)for(var re of et(pe))st.call(pe,re)&&pt(Ht,re,pe[re]);return Ht};const St="@\u2581\u2581@",Et="@\u2581@",Tt=/<pre[^>]*>/g;function It(Ht){let pe=document.createElement("div");return pe.innerHTML=Ht,pe.childNodes.length===0?"":pe.childNodes[0].nodeValue}const qt=(Ht,pe)=>{Ht=Ht||"";const re=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Ne=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,ye=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,xe=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return pe?Ht.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(re,(Ue,je,Je,fn,te,Jt,Xe)=>{const On=je||fn||Jt,bn=Je||te||Xe||"?";return Dt.Z.API_SERVER+"/api/attachments/"+On+bn+"&t="+(0,ee.Jn)(On,Date.now())+(Ue.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(Ht=Ht.replace(xe,(Ue,je,Je,fn,te,Jt,Xe)=>{const On=je||fn||Jt,bn=Je||te||Xe||"?";return Dt.Z.API_SERVER+"/attachments/download/"+On+bn+"&t="+(0,ee.Jn)(On,Date.now())+(Ue.indexOf(")")>-1?")":"&")}).replace(re,(Ue,je,Je,fn,te,Jt,Xe)=>{const On=je||fn||Jt,bn=Je||te||Xe||"?";return Dt.Z.API_SERVER+"/api/attachments/"+On+bn+"&t="+(0,ee.Jn)(On,Date.now())+(Ue.indexOf(")")>-1?")":"&")}).replace(Ne,(Ue,je,Je,fn,te)=>{const Jt=je||fn,Xe=Je||te||"";return'"'+Dt.Z.API_SERVER+"/api/attachments/"+Jt+Xe+Jt+Xe+"&t="+(0,ee.Jn)(Jt,Date.now())}).replace(ye,(Ue,je,Je,fn,te)=>{const Jt=je||fn,Xe=Je||te||"";return"("+Dt.Z.API_SERVER+"/files/uploads/"+Jt+Xe+Jt+Xe+"&t="+(0,ee.Jn)(Jt,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,`
`),Ht)};var Xt=({value:Ht="",className:pe,showTextOnly:re,showLines:Ne,style:ye={},stylesPrev:xe={},highlightKeywords:Ue,showProgramFill:je,isProgramFill:Je,disabledFill:fn=!1,programFillValue:te,onFillChange:Jt=bn=>{},onFillBlur:Xe=()=>{},onFillFocus:On=()=>{}})=>{let bn=Bt(String(Ht||""));const[De,on]=(0,gt.useState)(""),[un,Kn]=(0,gt.useState)("office"),[Me,vn]=(0,gt.useState)([]),ne=(0,gt.useRef)("a"+(0,Qt.Z)()),wn={},fi=Ce=>/<style[\s\S]*?>/i.test(Ce||""),Rt=(Ce,Fe,He)=>{const Qe=document.createElement(Ce===Et?"input":"textarea");Qe.style.width="100%",Qe.style.height=Ce===Et?"40px":"151px",Qe.rows=5,Qe.spellcheck=!1,Qe.name="edu-program-fill",Qe.placeholder="\u8BF7\u8F93\u5165",Qe.dataset.id=Fe;const hn=Object.keys(wn).length;return wn[hn]=Qe,`<span class="edu-program-fill-wrap ${Ce===Et?"":"show"}" style="width:${Ce===Et?"400px":"100%"}" title=${He||""}><span>${Qe.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Lt(Ce){return Ce=Ce.replace(/!\[.*?\]\(.*?\)/g,""),Ce=Ce.replace(/\[.*?\]\(.*?\)/g,""),Ce=Ce.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),Ce=Ce.replace(/<embed.*?>/g,""),Ce=Ce.replace(/<img.*?>/g,""),Ce=Ce.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),Ce=Ce.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),Ce=Ce.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),Ce=Ce.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),Ce}const Pt=Ce=>!re&&fi(bn)?Ce:Ce.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Fe,He){let Qe=He.replace(/(\n|\r)/g,"").split("}"),hn=[];return Qe.map(dn=>{dn!=""&&hn.push(`.${ne.current} ${dn}`)}),`<style>${hn.join("}")}</style>`}),Nt=(0,gt.useMemo)(()=>{try{const Qe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,hn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,dn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,ri=/\(\/attachments\/download\//g;bn=bn.replace(ri,"("+Dt.Z.API_SERVER+"/attachments/download/").replace(Qe,"("+Dt.Z.API_SERVER+"/api/attachments/").replace(hn,'"'+Dt.Z.API_SERVER+"/api/attachments/").replace(dn,'"'+Dt.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(Qe){}if(je){let Qe=-1;return bn=bn.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,function(hn,dn,ri){var ze;return++Qe,Rt(hn,Qe,(ze=te==null?void 0:te[Qe])==null?void 0:ze.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))}),`<pre style="background:#fff;padding:4px">${Pt(bn||"")}</pre>`}let Ce=Pt(bn);Ce=(0,ue.ZP)(Ce);const Fe=(0,ue.ez)();bn.match(/\[TOC\]/)&&(Ce=Ce.replace("<p>[TOC]</p>",(0,ue.Qv)()),(0,ue.Iy)()),Ce=Ce.replace(/(__special_katext_id_\d+__)/g,(Qe,hn)=>{const{type:dn,expression:ri}=Fe[hn];return(0,ge.renderToString)(It(ri)||"",{displayMode:dn==="block",throwOnError:!1,output:"html"})}),Ce=Ce.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,ue.AL)();const He=document.createElement("div");if(He.innerHTML=Ce,re)return He.innerText;if(Ue){const Qe=Ue.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return Ge(He,Qe),He.innerHTML}return setTimeout(()=>we(),500),He.innerHTML},[bn,Ue]);(0,gt.useEffect)(()=>{Oe.current&&Oe.current.querySelectorAll(["input","textarea"]).forEach(Fe=>{Fe.oninput=Zt,Fe.onblur=Mt,Fe.onfocus=Yt})},[Me]),(0,gt.useEffect)(()=>{var Ce,Fe,He,Qe,hn;if(te!=null&&te.length)try{const dn=Oe.current.querySelectorAll(".edu-program-fill-score"),ri=Oe.current.querySelectorAll('[name="edu-program-fill"]');for(const[ze,We]of ri.entries())We.value=((Ce=te==null?void 0:te[ze])==null?void 0:Ce.value)||"",((Fe=te==null?void 0:te[ze])==null?void 0:Fe.type)==="warning"?We.className="program-fill-warning":((He=te==null?void 0:te[ze])==null?void 0:He.type)==="success"?We.className="program-fill-success":We.className="";for(const[ze,We]of dn.entries())We.innerHTML=(Qe=te==null?void 0:te[ze])!=null&&Qe.score?`${(hn=te==null?void 0:te[ze])==null?void 0:hn.score}\u5206`:"";vn(te)}catch(dn){console.log(dn,"error")}},[te]);const Zt=Ce=>{Me[Ce.target.dataset.id]=Me[Ce.target.dataset.id]||{},Me[Ce.target.dataset.id].value=Ce.target.value,vn([...Me]),Jt(Me,Ce.target.dataset.id)},Mt=Ce=>{Me[Ce.target.dataset.id]=Me[Ce.target.dataset.id]||{},Me[Ce.target.dataset.id].value=Ce.target.value,vn([...Me]),Xe(Me,Ce.target.dataset.id)},Yt=Ce=>{Me[Ce.target.dataset.id]=Me[Ce.target.dataset.id]||{},Me[Ce.target.dataset.id].value=Ce.target.value,vn([...Me]),On(Me,Ce.target.dataset.id)};function Ge(Ce,Fe){return Ce.childNodes.forEach(He=>{var Qe;if(He.childNodes.length>0)Ge(He,Fe);else if(He.nodeName!=="IMG")if(He.innerHTML)He.innerHTML=(Qe=He.innerHTML)==null?void 0:Qe.replace(new RegExp(Fe,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const hn=document.createElement("span");hn.innerHTML=He.textContent.replace(new RegExp(Fe,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),He.replaceWith(hn)}})}const Oe=(0,gt.useRef)();ue.jb.WebkitLineClamp=Ne,Ne&&(ye=vt(vt({},ye),ue.jb));function Ke(Ce){let Fe=Ce.target;if(Fe.tagName.toUpperCase()==="A"){let He=Fe.getAttribute("href");if(He.indexOf("office")>-1)Ce.preventDefault(),on(He),Kn("office");else if(He.indexOf("application/pdf")>-1)Ce.preventDefault(),on(He),Kn("pdf");else if(He.indexOf("text/html")>-1)Ce.preventDefault(),on(He),Kn("html");else if(He.startsWith("#")){Ce.preventDefault();let Qe=document.getElementById(He.replace("#",""));Qe&&Qe.scrollIntoView(!0)}}}const we=()=>{var Ce;const Fe=(Ce=Oe.current)==null?void 0:Ce.querySelectorAll("video");Fe==null||Fe.forEach(He=>{if(He.oncontextmenu=()=>!1,He.src.indexOf(".m3u8")>-1&&!He.canPlayType("application/vnd.apple.mpegurl")){if(he.ZP.isSupported()){var Qe=new he.ZP;Qe.loadSource(He.src),Qe.attachMedia(He)}}})};return(0,gt.useEffect)(()=>{if(Oe.current&&Nt&&Nt.match(Tt)&&window.PR.prettyPrint(),Oe.current)return Oe.current.addEventListener("click",Ke),()=>{var Ce;(Ce=Oe.current)==null||Ce.removeEventListener("click",Ke),(0,ue.AL)(),(0,ue.Iy)()}},[Nt,Oe.current,Ke]),(0,gt.useEffect)(()=>{var Ce;const Fe=He=>{He.preventDefault(),He.clipboardData.setData("text",window.getSelection().toString())};return(Ce=Oe.current)==null||Ce.addEventListener("copy",Fe),()=>{var He;(He=Oe.current)==null||He.removeEventListener("copy",Fe)}},[Oe.current]),gt.createElement(gt.Fragment,null,re&&gt.createElement("div",{ref:Oe},Nt),!re&&!fi(Nt)&&gt.createElement("div",{ref:Oe,style:vt({},ye),className:`${pe||""} ${fn?"disabled-fill":""} markdown-body ${ne.current}`,dangerouslySetInnerHTML:{__html:Nt}}),!re&&fi(Nt)&&gt.createElement(Pe,{html:Nt}),gt.createElement(jt.Z,{close:!0,data:De,type:De!=null&&De.length?un:"",style:vt({},xe),onClose:()=>on("")}))}},60572:function(Mn,Rn,kt){"use strict";kt.d(Rn,{C:function(){return Ue}});var gt=kt(59301),Ut={recalculation:"recalculation____i9AE",tips:"tips___GoMu8",filter:"filter___Vx7VO",input:"input___OEMMv",operating:"operating___TS9iA",operatingItem:"operatingItem___AT84q"},ue=kt(92310),Ee=kt.n(ue),he=kt(62673),Dt=kt(77019),ee=kt(6767),ge=kt(25399),Qt=kt(99571),jt=kt(62957),Ae=kt(54172),se=kt(71051),Pe=kt(28284),Bt=kt(29787),nt=kt(51257),et=kt(38986),ht=kt(48790),st=kt(54650),pt=kt(9148),vt=Object.defineProperty,St=Object.defineProperties,Et=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,It=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,Xt=(je,Je,fn)=>Je in je?vt(je,Je,{enumerable:!0,configurable:!0,writable:!0,value:fn}):je[Je]=fn,Ht=(je,Je)=>{for(var fn in Je||(Je={}))It.call(Je,fn)&&Xt(je,fn,Je[fn]);if(Tt)for(var fn of Tt(Je))qt.call(Je,fn)&&Xt(je,fn,Je[fn]);return je},pe=(je,Je)=>St(je,Et(Je)),re=(je,Je,fn)=>new Promise((te,Jt)=>{var Xe=De=>{try{bn(fn.next(De))}catch(on){Jt(on)}},On=De=>{try{bn(fn.throw(De))}catch(on){Jt(on)}},bn=De=>De.done?te(De.value):Promise.resolve(De.value).then(Xe,On);bn((fn=fn.apply(je,Je)).next())});const Ne=he.default.Group,ye=({className:je,title:Je,items:fn=[],value:te,onChange:Jt})=>{const Xe=(fn==null?void 0:fn.length)===(te==null?void 0:te.length),On=(te==null?void 0:te.length)>0&&(te==null?void 0:te.length)<(fn==null?void 0:fn.length),bn=De=>{const on=fn.map(un=>un.id);Jt(De.target.checked?on:[])};return gt.createElement(Dt.Z,{align:"middle",className:je},!!Je&&gt.createElement("div",{className:"mr20",style:{color:"#5F6368"}},Je),gt.createElement(he.default,{indeterminate:On,onChange:bn,checked:Xe},"\u5168\u90E8"),gt.createElement(Ne,{value:te,onChange:Jt},fn.map(De=>gt.createElement(he.default,{className:"ml30 c-black",key:De.id,value:De.id},De.name,gt.createElement("span",null,`(${De.count})`)))))};var Ue=({className:je,style:Je,dataSource:fn})=>{var te,Jt,Xe,On,bn,De,on;const[un,Kn]=(0,gt.useState)({}),[Me,vn]=(0,gt.useState)(!0),[ne,wn]=(0,gt.useState)(!1),[fi,Rt]=(0,gt.useState)(!1),[Lt,Pt]=(0,gt.useState)(null),[Nt,Zt]=(0,gt.useState)(0),[Mt,Yt]=(0,gt.useState)({}),[Ge,Oe]=(0,gt.useState)(!0),[Ke,we]=(0,gt.useState)(0),[Ce,Fe]=(0,gt.useState)(0),[He,Qe]=(0,gt.useState)(!1),hn=(0,gt.useRef)(null),[dn,ri]=(0,gt.useState)(!1),[ze,We]=(0,gt.useState)(!0),[an,Xn]=(0,gt.useState)([]),pn={page:1,per_page:5,keyword:"",review:[],question_status:[],success_status:[],sort_by:null,direction:null},[rn,In]=(0,gt.useState)(Ht({},pn));(0,gt.useEffect)(()=>{fn!=null&&fn.question_id&&Kn(fn)},[fn==null?void 0:fn.question_id]),(0,gt.useEffect)(()=>{var Ye;if(((Ye=un==null?void 0:un.exercise_question_resubmit)==null?void 0:Ye.status)==="running"){const Zn=setInterval(()=>{mi()},3e3);return()=>clearInterval(Zn)}},[(te=un==null?void 0:un.exercise_question_resubmit)==null?void 0:te.status]),(0,gt.useEffect)(()=>{var Ye;fi&&(fi===1&&(rn.question_status=Hi.map(Zn=>Zn.value),rn.review=Cn.map(Zn=>Zn.value)),fi===2&&(rn.exercise_question_resubmit_id=(Ye=un==null?void 0:un.exercise_question_resubmit)==null?void 0:Ye.id,Lt===1&&(rn.success_status=[1]),Lt===2&&(rn.success_status=[0])),In(Ht({},rn)),pi(rn),Fe(un!=null&&un.is_mirror?3:10),we(un!=null&&un.is_mirror?1:5))},[fi]),(0,gt.useEffect)(()=>{dn&&ei()},[dn]);const pi=Ye=>re(void 0,null,function*(){vn(!0);const Zn=yield(0,et.ZP)(`/api/exercise_questions/${un==null?void 0:un.question_id}/resubmit_student_list.json`,{method:"get",params:Ye});(Zn==null?void 0:Zn.status)==0&&(Yt(Zn||[]),Zt(Zn==null?void 0:Zn.count)),vn(!1)}),ei=()=>re(void 0,null,function*(){We(!0);const Ye=yield(0,et.ZP)(`/api/exercise_questions/${un==null?void 0:un.question_id}/resubmit_history.json`,{method:"get"});(Ye==null?void 0:Ye.status)==0&&Xn((Ye==null?void 0:Ye.data)||[]),We(!1)}),mi=()=>re(void 0,null,function*(){const Ye=yield(0,et.ZP)(`/api/exercise_questions/${un==null?void 0:un.question_id}/resubmit_status.json`,{method:"get"});(Ye==null?void 0:Ye.status)==0&&Kn(pe(Ht({},un),{show_resubmit_history:!0,exercise_question_resubmit:(Ye==null?void 0:Ye.data)||{}}))}),Hi=[{label:"\u672A\u8BC4\u6D4B",value:2,color:"#9096A3"},{label:"\u672A\u901A\u5173",value:0,color:"#E30000"},{label:"\u5DF2\u901A\u5173",value:1,color:"#00B187"}],Cn=[{label:"\u672A\u8BC4\u9605",value:0,color:"#9096A3"},{label:"\u8BC4\u9605\u4E2D",value:2,color:"#FF9D18"},{label:"\u5DF2\u8BC4\u9605",value:1,color:"#3061D0"}],Sn=[{label:"\u6210\u529F",value:1,color:"#00B187"},{label:"\u5931\u8D25",value:0,color:"#E30000"}],Bn=[{title:"\u5E8F\u53F7",dataIndex:"key",render:(Ye,Zn,Ln)=>gt.createElement("span",{className:"c-black"},Ln+1+(rn.page-1)*rn.per_page)},{title:"\u59D3\u540D",dataIndex:"user_name",render:Ye=>gt.createElement("span",{className:"c-black"},Ye)},{title:"\u5B66\u53F7",dataIndex:"student_id",sorter:!0,render:Ye=>gt.createElement("span",{className:"c-grey-666"},Ye||"--")},{title:"\u5206\u73ED",dataIndex:"group_name",render:Ye=>gt.createElement("span",{className:"c-black"},Ye)},{title:"\u9898\u76EE\u72B6\u6001",dataIndex:"question_status",render:Ye=>{const{label:Zn,color:Ln}=Hi.find(zn=>zn.value===Ye)||{};return gt.createElement("span",{style:{color:Ln}},Zn)}},{title:"\u9898\u76EE\u5F97\u5206",dataIndex:"question_score",sorter:!0,render:Ye=>gt.createElement("span",{className:"c-black"},Ye)},{title:"\u6700\u7EC8\u6210\u7EE9",dataIndex:"score",sorter:!0,render:Ye=>gt.createElement("span",{className:"c-black"},Ye)},{title:"\u8BC4\u9605\u72B6\u6001",dataIndex:"review",render:Ye=>{const{label:Zn,color:Ln}=Cn.find(zn=>zn.value===Ye)||{};return gt.createElement("span",{style:{color:Ln}},Zn)}},fi===2&&{title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",dataIndex:"success_status",render:Ye=>{const{label:Zn,color:Ln}=Sn.find(zn=>zn.value===Ye)||{};return gt.createElement("span",{style:{color:Ln}},Zn)}}].filter(Boolean),si=(Ye,Zn,Ln)=>{rn.page=Ye==null?void 0:Ye.current,rn.per_page=Ye==null?void 0:Ye.pageSize,Ln!=null&&Ln.order?(rn.sort_by=Ln==null?void 0:Ln.field,rn.direction=(Ln==null?void 0:Ln.order)==="ascend"?"asc":"desc"):(rn.sort_by=null,rn.direction=null),In(Ht({},rn)),pi(rn)},yi=()=>{if(!Ke){ee.ZP.warning("\u8BF7\u8F93\u5165\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570");return}Qe(!0)},hi=()=>re(void 0,null,function*(){var Ye,Zn;if((Ye=hn.current)!=null&&Ye.onVerify())return;wn(!0);const Ln=yield(0,et.ZP)(`/api/exercise_questions/${un==null?void 0:un.question_id}/resubmit.json`,{method:"post",body:{keyword:rn.keyword,question_status:rn.question_status,review:rn.review_status,success_status:rn.success_status,use_max_score:Ge,permits:Ke,exercise_question_resubmit_id:fi===1?null:(Zn=un==null?void 0:un.exercise_question_resubmit)==null?void 0:Zn.id}});(Ln==null?void 0:Ln.status)==0&&(yield mi(),ee.ZP.success("\u64CD\u4F5C\u6210\u529F"),Qe(!1),Rt(!1)),wn(!1)}),Gi=(Ye,Zn)=>{rn.page=1,rn[Zn]=Ye,In(Ht({},rn)),pi(rn)},wt=["","\u5F53\u524D\u9898\u76EE\u7684\u5B9E\u9A8C\u8D44\u6E90\u4E3A\u4E13\u6709\u4E91\uFF0C\u4E0D\u652F\u6301\u91CD\u65B0\u8BC4\u6D4B~","\u8BE5\u529F\u80FD\u4EC5\u8BFE\u5802\u7BA1\u7406\u5458\u548C\u8003\u8BD5\u7684\u521B\u5EFA\u8005\u53EF\u4EE5\u64CD\u4F5C~"];return gt.createElement(gt.Fragment,null,gt.createElement("div",{className:Ee()(Ut.recalculation,je),style:Je},gt.createElement(ge.Z,{title:wt[(un==null?void 0:un.disable_resubmit_reason)||0]},gt.createElement(Qt.ZP,{disabled:(un==null?void 0:un.disable_resubmit)||((Jt=un==null?void 0:un.exercise_question_resubmit)==null?void 0:Jt.status)==="running",onClick:()=>Rt(1),icon:gt.createElement("i",{className:"iconfont icon-zhongxinpingce font14"}),type:"primary",ghost:!0},"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206")),(un==null?void 0:un.show_resubmit_history)&&gt.createElement(gt.Fragment,null,((Xe=un==null?void 0:un.exercise_question_resubmit)==null?void 0:Xe.status)==="running"?gt.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",gt.createElement("span",{className:"c-light-primary ml3"},(On=un==null?void 0:un.exercise_question_resubmit)==null?void 0:On.rate)):gt.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",gt.createElement("span",{onClick:()=>{Rt(2),Pt(1)},className:"current",style:{color:"#3061D0",textDecoration:"underline",margin:"0 3px"}},(bn=un==null?void 0:un.exercise_question_resubmit)==null?void 0:bn.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",gt.createElement("span",{onClick:()=>{Rt(2),Pt(2)},className:"current",style:{color:"#E30000",textDecoration:"underline",margin:"0 3px"}},(De=un==null?void 0:un.exercise_question_resubmit)==null?void 0:De.fail_count),"\u4EBA"),gt.createElement(ge.Z,{title:"\u64CD\u4F5C\u8BB0\u5F55"},gt.createElement("i",{onClick:()=>ri(!0),className:"iconfont icon-chakanshenqingjilu c-light-primary current font14"})))),gt.createElement(jt.default,{centered:!0,open:!!fi,title:`\u91CD\u65B0\u8BC4\u6D4B${fi===1?"\u7B97\u5206":"\u7ED3\u679C"}`,width:870,okText:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",onCancel:()=>Rt(!1),onOk:yi,afterClose:()=>{Oe(!0),Pt(null),In(Ht({},pn))}},gt.createElement("div",{className:Ut.filter},fi===1&&gt.createElement(gt.Fragment,null,gt.createElement("div",{className:Ut.tips},gt.createElement("div",{className:"mb5",style:{color:"#FF9D18"}},gt.createElement("i",{className:"iconfont icon-tishi9 mr10 font14"}),"\u6E29\u99A8\u63D0\u793A"),gt.createElement("div",null,"1.\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206\u6D41\u7A0B\uFF1A \u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6\u5B66\u751F\u5728\u8003\u8BD5\u9875\u9762\u4FDD\u5B58\u7684\u6700\u65B0\u4EE3\u7801\uFF0C\u5E76\u8FDB\u884C\u91CD\u65B0\u8BC4\u6D4B\uFF0C\u4ECE\u800C\u7CBE\u51C6\u8BA1\u7B97\u51FA\u5B66\u751F\u7684\u6700\u7EC8\u5F97\u5206\uFF1B"),gt.createElement("div",{style:{margin:"2px 0"}},"2.\u91CD\u65B0\u8BC4\u6D4B\u6761\u4EF6\uFF1A \u8003\u8BD5\u7ED3\u675F\u540E\uFF0C\u4EC5\u5BF9\u5DF2\u63D0\u4EA4\u8BD5\u5377\u4E14\u5DF2\u4F5C\u7B54\u8BE5\u9898\u76EE\u7684\u5B66\u751F\u8FDB\u884C\u91CD\u65B0\u8BC4\u6D4B\u4E0E\u7B97\u5206\uFF1B"),gt.createElement("div",null,"3.\u91CD\u65B0\u8BC4\u6D4B\u65F6\uFF0C\u8BF7\u786E\u4FDD\u5B9E\u9A8C\u73AF\u5883\u80FD\u6B63\u5E38\u542F\u52A8\u5E76\u53EF\u8FD0\u884C\u8BC4\u6D4B\u3002")),gt.createElement(ye,{className:"mt10",title:"\u9898\u76EE\u72B6\u6001",items:(Mt==null?void 0:Mt.question_status)||[],value:rn.question_status,onChange:Ye=>Gi(Ye,"question_status")}),gt.createElement(ye,{className:"mt10",title:"\u8BC4\u9605\u72B6\u6001",items:(Mt==null?void 0:Mt.review_status)||[],value:rn.review,onChange:Ye=>Gi(Ye,"review")})),fi===2&&gt.createElement(gt.Fragment,null,gt.createElement(ye,{className:"mt10",title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",items:(Mt==null?void 0:Mt.success_status)||[],value:rn.success_status,onChange:Ye=>Gi(Ye,"success_status")})),gt.createElement(pt.t7,{className:Ut.input,style:{bottom:fi===1?10:-5},value:rn.keyword,onChange:Ye=>Gi(Ye,"keyword"),placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22"})),gt.createElement(Ae.default,{className:"mt20",columns:Bn,scroll:((on=Mt==null?void 0:Mt.data)==null?void 0:on.length)>7?{y:300}:{},dataSource:(Mt==null?void 0:Mt.data)||[],loading:Me,onChange:si,pagination:{total:Nt,pageSize:rn.per_page,current:rn.page,hideOnSinglePage:!Nt,showSizeChanger:!0,pageSizeOptions:["5","10","20","50","100"],showQuickJumper:!0,size:"default",showTotal:nt.rU}}),gt.createElement(Dt.Z,{justify:"space-between",align:"middle",className:"mt10"},gt.createElement(he.default,{className:"c-black",checked:Ge,onChange:Ye=>Oe(Ye.target.checked)},"\u91CD\u65B0\u8BC4\u6D4B\u540E\u7684\u5206\u6570\u5927\u4E8E\u539F\u6765\u7684\u5206\u6570\u624D\u66F4\u65B0\u6210\u7EE9"),(0,ht.Ny)()&&gt.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570",gt.createElement(se.Z,{className:"ml10 mr10",value:Ke,max:Ce,min:1,precision:0,onChange:Ye=>we(Ye)}),"\u4EBA",gt.createElement(ge.Z,{overlayStyle:{maxWidth:450},title:"\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u7684\u6700\u5927\u5E76\u53D1\u4EBA\u6570\u4E3A20\u4EBA\uFF08\u81EA\u5B9A\u4E49\u955C\u50CF\u7684\u6700\u5927\u5E76\u53D1\u4EBA\u6570\u4E3A3\u4EBA\uFF09\u3002"},gt.createElement("i",{style:{color:"#9096A3"},className:"iconfont icon-tishi5 font13 ml10"}))))),gt.createElement(jt.default,{centered:!0,title:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",open:He,width:494,zIndex:1001,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:ne,destroyOnClose:!0,onOk:hi,onCancel:()=>Qe(!1)},gt.createElement(Pe.default.Item,{className:"mb0",colon:!1,label:"\u9A8C\u8BC1\u7801",name:"code",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"}]},gt.createElement(st.Z,{ref:Ye=>hn.current=Ye}))),gt.createElement(jt.default,{centered:!0,title:"\u64CD\u4F5C\u8BB0\u5F55",open:dn,width:710,onCancel:()=>ri(!1),footer:null},gt.createElement(Bt.Z,{spinning:ze},gt.createElement("div",{className:Ut.operating},an.map((Ye,Zn)=>gt.createElement("div",{key:Zn,className:Ut.operatingItem},gt.createElement("div",{style:{flex:"0 0 180px"},className:"c-grey-666"},Ye==null?void 0:Ye.created_at),gt.createElement("div",{className:"c-black"},Ye==null?void 0:Ye.user_name,"\u64CD\u4F5C\u4E86\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206"),(Ye==null?void 0:Ye.status)==="running"?gt.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",gt.createElement("span",{className:"c-light-primary ml3"},Ye==null?void 0:Ye.rate)):gt.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",gt.createElement("span",{style:{color:"#3061D0",margin:"0 3px"}},Ye==null?void 0:Ye.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",gt.createElement("span",{style:{color:"#E30000",margin:"0 3px"}},Ye==null?void 0:Ye.fail_count),"\u4EBA")))),gt.createElement("div",{style:{height:20}}))))}},3039:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return ge}});var gt=kt(59301),Ut={flex_box_center:"flex_box_center___rQJfc",flex_space_between:"flex_space_between___MDW24",flex_box_vertical_center:"flex_box_vertical_center___RZbAv",flex_box_center_end:"flex_box_center_end___ILhJA",flex_box_column:"flex_box_column___Fmij7",orangeColor:"orangeColor___U5vU6",redColor:"redColor___qYa6X",statustitle:"statustitle___pTBLm",statusbody:"statusbody___qUPQx",flex:"flex___VtL45"},ue=kt(62957),Ee="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAPCAYAAADUFP50AAAAAXNSR0IArs4c6QAAAUFJREFUOE+V0ktKw1AUxvH/rVqIxT4wkgwEUSmK4APRBfiYCKU7cOZEBOkadAMZiwhuwJETBQciFRTtwJkPBLW2BRGrRanU9kpN2sSYiGaWc/PjuznnCN2Qh8AkPo+AzXxKLLiPhW7ICtDqB4GzQkqM/huGFZgZcDCBBDaaicsTMKbZH2xfwdY5/ICAEGSasC0AwRYblj+gKkENwfy4WS9V4LHsgsk49EZteJKHdBa6w7AybdZzr3D64ILxGKjtNrx9gfsSRBSYtf6xZh1/u+qQClrIhtdFuHmGvhisJcz65RPsZl2Jc/3QE7FhpgDHuT80x2+O9cR1K/GiCDt3rkQ/+Ns43gDFD0YVmHIuQGOOmiGTARhxwkGd1cZ7Vwd0OppWr3911StpcV++Iwn67q/kyBMuHchErcqwFxT1XZXsfQJqo2zI6kdI4QAAAABJRU5ErkJggg==",he="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAW1JREFUOE+dkj1IQmEUht9z/blp4VQEjS39eW+oSCFCpFCI4BiKFGWWQUSrCjVVg+lQNJZQDZGNTm1B4NTibS3n2lo0wuqEN8i/a0HfeN7v+d73nO+QJEcKAJzQPAwCnSpKNtoqkyRHqgDrtUFAb6Rnedx43KgT6O5P0GQijFiNLe/Sy3/B8g+YTIRRrb5jP32JYNADr8eOldU0RJEqVlm8r1kyuA/AIEB10OWy4vBgA4ryCIdjCJlMDmfn1zAY6EmyGY/UrAwrgGATWKsn4mGEQl4Uiw+YX9hT73aZiEcl8eMbZAGA0AT6/ZPY3Ykiny/A55tA7uoGqdQFBD2VbDbDugoSTTEj3gTGYgG8Vt7UeG63hNkZJ7a2s+gw1XqPnf5REKhkt4kxNakO08ycbOtRC/7FcakCwNTJ0WwmDI+1LUCZZDkSYGa5Eewf0G0KAnprNYtFQHdPbZhNS1cmLafF5bUTJsyBSVMHPm+/ADTrfrtCH68WAAAAAElFTkSuQmCC",Dt=(Qt,jt,Ae)=>new Promise((se,Pe)=>{var Bt=ht=>{try{et(Ae.next(ht))}catch(st){Pe(st)}},nt=ht=>{try{et(Ae.throw(ht))}catch(st){Pe(st)}},et=ht=>ht.done?se(ht.value):Promise.resolve(ht.value).then(Bt,nt);et((Ae=Ae.apply(Qt,jt)).next())}),ge=({type:Qt,resdata:jt,onok:Ae,oktext:se,okloading:Pe})=>{const[Bt,nt]=(0,gt.useState)(!1),{can_copy_list:et,can_copy_num:ht,challenge_type:st,course_data_list:pt,no_copy_list:vt,no_copy_num:St,no_use_list:Et,no_use_num:Tt,repeat_shixun_num:It,student_count:qt,total_num:Xt,use_num:Ht}=jt;let pe=ht>0||Qt==="exercise";(0,gt.useEffect)(()=>{(jt==null?void 0:jt.student_count)>0&&nt(!0)},[jt]),console.log("---11",Pe),(0,gt.useEffect)(()=>{Pe||nt(!1)},[Pe]);const re=()=>{if(Qt==="exercise"&&st===1)return gt.createElement(gt.Fragment,null,"\u8BFE\u5802\u5185\u6709",gt.createElement("span",{className:Ut.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",gt.createElement("span",{className:Ut.orangeColor},Ht),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",gt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u4F5C\u7B54\u5DF2\u6311\u6218\u8FC7\u7684\u5B9E\u8BAD\u9898\u3002"));if(Qt==="exercise"&&st===2)return gt.createElement(gt.Fragment,null,"\u8BFE\u5802\u5185\u6709",gt.createElement("span",{className:Ut.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",gt.createElement("span",{className:Ut.orangeColor},Ht),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",gt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(Qt==="shixun"&&st===1)return gt.createElement(gt.Fragment,null,"\u8BFE\u5802\u5185\u6709",gt.createElement("span",{className:Ut.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\uFF0C",gt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(Qt==="shixun"&&st===2)return gt.createElement(gt.Fragment,null,"\u8BFE\u5802\u5185\u6709",gt.createElement("span",{className:Ut.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",gt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(Qt==="subject"&&st===1)return gt.createElement(gt.Fragment,null,"\u8BFE\u5802\u5185\u6709",gt.createElement("span",{className:Ut.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",gt.createElement("span",{className:Ut.orangeColor},Ht),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",gt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(Qt==="subject"&&st===2)return gt.createElement(gt.Fragment,null,"\u8BFE\u5802\u5185\u6709 ",gt.createElement("span",{className:Ut.orangeColor},qt)," \u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u6311\u6218\u8FC7\u5176\u4E2D\u7684 ",gt.createElement("span",{className:Ut.orangeColor},Ht)," \u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",gt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(Qt==="exercisepush")return gt.createElement(gt.Fragment,null,"\u8BFE\u5802\u5185\u6709",gt.createElement("span",{className:Ut.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BD5\u5377\u4E2D\u7684",gt.createElement("span",{className:Ut.orangeColor},Ht),"\u4E2A\u5B9E\u8DF5\u9879\u76EE \uFF0C",gt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u5728\u5F53\u524D\u8003\u8BD5\u4E2D\u8FDB\u884C\u4F5C\u7B54\u3002"));if(Qt==="shixunpush"&&st===1)return gt.createElement(gt.Fragment,null,"\u8BFE\u5802\u5185\u6709",gt.createElement("span",{className:Ut.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",gt.createElement("span",{className:Ut.orangeColor},Ht),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",gt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(Qt==="shixunpush"&&st===2)return gt.createElement(gt.Fragment,null,"\u8BFE\u5802\u5185\u6709",gt.createElement("span",{className:Ut.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7",gt.createElement("span",{className:Ut.orangeColor},Ht),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",gt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"))},Ne=()=>{if(Qt==="exercise"||Qt==="subject"||Qt==="exercisepush"||Qt==="shixunpush")return gt.createElement("div",{style:{marginTop:20}},St>0&&gt.createElement("div",null,gt.createElement("span",{className:Ut.flex},gt.createElement("img",{src:he,style:{width:14}}),gt.createElement("span",{className:Ut.statustitle},"\u4E0D\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),gt.createElement("div",{className:Ut.statusbody},Qt==="exercise"&&gt.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",gt.createElement("span",{className:Ut.redColor},"\u4EE5\u4E0B\u8BD5\u9898\u5C06\u4E0D\u4F1A\u88AB\u53D1\u9001\u81F3\u8BFE\u5802\u4E2D\u3002"),"\u60A8\u4E5F\u53EF\u4EE5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8005\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002"),(Qt==="subject"||Qt==="exercisepush")&&gt.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",pe&&gt.createElement("span",{className:Ut.redColor},"\u4E00\u952E\u590D\u5236\u4E0D\u4F1A\u590D\u5236\u6B64\u90E8\u5206\u9879\u76EE\u3002"),"\u60A8\u53EF\u4EE5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8005\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002"),Qt==="shixunpush"&&gt.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",pe&&gt.createElement("span",{className:Ut.redColor},"\u4E00\u952E\u590D\u5236\u4E0D\u4F1A\u590D\u5236\u6B64\u90E8\u5206\u9879\u76EE\u3002"),"\u5EFA\u8BAE\u60A8\u91CD\u65B0\u9009\u62E9\u5B9E\u8DF5\u9879\u76EE\u518D\u53D1\u5E03\u4F5C\u4E1A\uFF0C\u4E5F\u53EF\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002"),gt.createElement("div",null,vt==null?void 0:vt.map((ye,xe)=>gt.createElement("a",{href:`/shixuns/${ye.identifier}/challenges`,target:"_blank"},"\u300A",ye==null?void 0:ye.name,"\u300B",xe+1!==St&&"\u3001"))))),ht>0&&gt.createElement("div",{style:{marginTop:20}},gt.createElement("span",{className:Ut.flex},gt.createElement("img",{src:Ee,style:{width:14}}),gt.createElement("span",{className:Ut.statustitle},"\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),gt.createElement("div",{className:Ut.statusbody},Qt==="exercise"&&gt.createElement("div",{style:{marginBottom:15}},"\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362\u8BD5\u9898\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\u66FF\u6362\u8BD5\u5377\u4E2D\u7684\u539F\u8BD5\u9898\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002"),(Qt==="subject"||Qt==="exercisepush")&&gt.createElement("div",{style:{marginBottom:15}},"\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u53D1\u9001\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002"),Qt==="shixunpush"&&gt.createElement("div",{style:{marginBottom:15}},"\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362\u8BD5\u9898\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\u66FF\u6362\u5F53\u524D\u4F5C\u4E1A\u4E2D\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002"),gt.createElement("div",null,et==null?void 0:et.map((ye,xe)=>gt.createElement("a",{href:`/shixuns/${ye.identifier}/challenges`,target:"_blank"},"\u300A",ye==null?void 0:ye.name,"\u300B",xe+1!==ht&&"\u3001"))))));if(Qt==="shixun")return gt.createElement("div",{style:{marginTop:20}},ht>0?"\u8BE5\u9879\u76EE\u652F\u6301\u590D\u5236\uFF0C\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u53D1\u9001\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002":"\u8BE5\u9879\u76EE\u4E0D\u652F\u6301\u590D\u5236\uFF0C\u60A8\u53EF\u4EE5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8005\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002")};return gt.createElement(ue.default,{open:Bt,onCancel:()=>{nt(!1)},cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",width:700,centered:!0,cancelButtonProps:{style:{display:!pe&&"none"}},zIndex:1003,confirmLoading:Pe,okText:pe?se:"\u6211\u77E5\u9053\u4E86",onOk:()=>Dt(void 0,null,function*(){pe?yield Ae([...et,...Et]):nt(!1)})},gt.createElement("div",{style:{maxHeight:600,overflow:"auto"}},re(),Ne()))}},90283:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Dt}});var gt=kt(59301),Ut={btn:"btn___kReTL",redBtn:"redBtn___UFEL0"},ue=kt(92310),Ee=kt.n(ue),Dt=({className:ee,style:ge,state:Qt,onClick:jt})=>{var Ae,se;return gt.createElement("div",{onClick:jt,className:Ee()(Qt?(Ae=Ut)==null?void 0:Ae.redBtn:(se=Ut)==null?void 0:se.btn,ee),style:ge},Qt?gt.createElement(gt.Fragment,null,gt.createElement("i",{className:"iconfont icon-biaoji1"}),gt.createElement("span",null,"\u53D6\u6D88\u6807\u8BB0\u9519\u9898")):gt.createElement(gt.Fragment,null,gt.createElement("i",{className:"iconfont icon-biaojigaiti"}),gt.createElement("span",null,"\u6807\u8BB0\u9519\u9898")))}},69720:function(Mn,Rn,kt){"use strict";kt.d(Rn,{h:function(){return St}});var gt=kt(59301),Ut=kt(82326),ue=kt(28284),Ee=kt(99571),he=kt(89780),Dt=kt.n(he),ee=kt(8336),ge=kt(12469),Qt=Object.defineProperty,jt=Object.defineProperties,Ae=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,nt=(Et,Tt,It)=>Tt in Et?Qt(Et,Tt,{enumerable:!0,configurable:!0,writable:!0,value:It}):Et[Tt]=It,et=(Et,Tt)=>{for(var It in Tt||(Tt={}))Pe.call(Tt,It)&&nt(Et,It,Tt[It]);if(se)for(var It of se(Tt))Bt.call(Tt,It)&&nt(Et,It,Tt[It]);return Et},ht=(Et,Tt)=>jt(Et,Ae(Tt));const st=Ut.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"]};Rn.Z=({callback:Et,onCancel:Tt})=>{const[It,qt]=(0,gt.useState)("python");function Xt(pe){qt(vt[pe][1])}function Ht(pe){Et(pe)}return gt.createElement(ue.default,ht(et({},pt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Ht,style:{width:500}}),gt.createElement(ue.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},gt.createElement(Ut.default,{getPopupContainer:pe=>pe.parentNode,onChange:Xt},Object.keys(vt).map(pe=>gt.createElement(st,{key:pe,value:pe},vt[pe][0])))),gt.createElement(ue.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},gt.createElement(St,{mode:It})),gt.createElement("div",{className:"flex-container flex-end"},gt.createElement(Ee.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),gt.createElement(Ee.ZP,{type:"ghost",onClick:Tt},"\u53D6\u6D88")))};function St({value:Et,onChange:Tt,mode:It,options:qt={}}){const Xt=(0,gt.useRef)(),[Ht,pe]=(0,gt.useState)();return(0,gt.useEffect)(()=>{if(Ht){let re=function(Ne){const ye=Ne.getValue();Tt&&Tt(ye)};return Ht.on("change",re),()=>{Ht.off("change",re)}}},[Ht,Tt]),(0,gt.useEffect)(()=>{Ht&&Ht.setOption("mode",It)},[Ht,It]),(0,gt.useEffect)(()=>{Ht&&(Et!==Ht.getValue()||Et==="")&&setTimeout(()=>{Ht.setValue(Et||"")},300)},[Ht,Et]),(0,gt.useEffect)(()=>{if(Xt.current&&!Ht){const re=Dt().fromTextArea(Xt.current,et({mode:It,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},qt));pe(re)}},[Xt.current,Ht]),gt.createElement("div",{className:"my-codemirror-container"},gt.createElement("textarea",{ref:Xt}))}},39793:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Fi}});var gt=kt(59301),Ut=kt(89780),ue=kt.n(Ut),Ee=kt(76374),he=kt(8336),Dt=kt(6313),ee=kt(25717),ge=kt(99498),Qt=kt(25419),jt=kt(67549),Ae=kt(76902),se=({value:ve="",className:Le,showTextOnly:Se,showLines:ti,style:Yn={}})=>{const Wn=(0,gt.useMemo)(()=>"",[ve]);return gt.createElement(gt.Fragment,null,gt.createElement("div",{dangerouslySetInnerHTML:{__html:Wn}}))},Pe=kt(59301),Bt=Object.defineProperty,nt=Object.defineProperties,et=Object.getOwnPropertyDescriptors,ht=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,vt=(ve,Le,Se)=>Le in ve?Bt(ve,Le,{enumerable:!0,configurable:!0,writable:!0,value:Se}):ve[Le]=Se,St=(ve,Le)=>{for(var Se in Le||(Le={}))st.call(Le,Se)&&vt(ve,Se,Le[Se]);if(ht)for(var Se of ht(Le))pt.call(Le,Se)&&vt(ve,Se,Le[Se]);return ve},Et=(ve,Le)=>nt(ve,et(Le));let Tt=[{title:"\u7C97\u4F53",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"md-iconfont icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"\u6570\u5B66\u56FE\u50CF",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function It({onActionCallback:ve,title:Le,icon:Se,actionName:ti,className:Yn="",children:Wn}){function qe(){ve(ti)}return Pe.createElement("a",{title:Le,className:Yn,onClick:qe},Pe.createElement("i",{className:`${Se}`}),Wn)}var qt=({watch:ve,showNullButton:Le,showNullProgramButton:Se,onActionCallback:ti,fullScreen:Yn,insertTemp:Wn,hidetoolBar:qe,extraUse:Dn})=>{const ki=[...Tt,{title:`${ve?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${ve?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return Pe.createElement("ul",{className:"markdown-toolbar-container"},!qe&&ki.map((Di,Ki)=>Pe.createElement("li",{key:Ki},Di.actionName?Pe.createElement(It,Et(St({},Di),{onActionCallback:ti})):Pe.createElement("span",{className:"v-line"}))),Le?Pe.createElement("li",null,Pe.createElement(It,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ti},Pe.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Se?Pe.createElement(Pe.Fragment,null,Pe.createElement("li",null,Pe.createElement(It,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:ti},Pe.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),Pe.createElement("li",null,Pe.createElement(It,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:ti},Pe.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,Wn&&Pe.createElement("li",null,Pe.createElement(It,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Wn}`,onActionCallback:ti},Pe.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Dn&&Pe.createElement("li",null,Dn),Pe.createElement("li",{className:"btn-full-screen"},Pe.createElement(It,{icon:`${Yn?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Yn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ti})))},Xt=kt(91558),Ht=kt(28284),pe=kt(37568),re=kt(99571),Ne=Object.defineProperty,ye=Object.defineProperties,xe=Object.getOwnPropertyDescriptors,Ue=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,fn=(ve,Le,Se)=>Le in ve?Ne(ve,Le,{enumerable:!0,configurable:!0,writable:!0,value:Se}):ve[Le]=Se,te=(ve,Le)=>{for(var Se in Le||(Le={}))je.call(Le,Se)&&fn(ve,Se,Le[Se]);if(Ue)for(var Se of Ue(Le))Je.call(Le,Se)&&fn(ve,Se,Le[Se]);return ve},Jt=(ve,Le)=>ye(ve,xe(Le));const Xe={labelCol:{span:4},wrapperCol:{span:20}};var On=({callback:ve,onCancel:Le})=>{function Se(ti){ve(ti)}return gt.createElement(Ht.default,Jt(te({},Xe),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Se,style:{width:500}}),gt.createElement(Ht.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},gt.createElement(pe.default,null)),gt.createElement(Ht.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},gt.createElement(pe.default,null)),gt.createElement("div",{className:"flex-container flex-end"},gt.createElement(re.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),gt.createElement(re.ZP,{type:"ghost",onClick:Le},"\u53D6\u6D88")))},bn=kt(69720),De=kt(17077),on=kt(62957),un=kt(77019),Kn=kt(9507),Me=kt(59301),vn=({callback:ve,onCancel:Le})=>{const Se=document.createElement("canvas"),ti=Se.getContext("2d");Se.width=1e3,Se.height=800,ti.fillStyle="#ffffff",ti.fillRect(0,0,Se.width,Se.height);const Yn=Se.toDataURL("image/png");return Me.createElement(on.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},Me.createElement(un.Z,{style:{height:"100vh"}},Me.createElement(Kn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Yn,visible:!0,title:String(Date.now())},onOk:Wn=>{ve({src:Wn.url})},onClose:Le})))},ne=kt(12378);function wn(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(wn,go.CommandHandler),wn.prototype.canAlignSelection=function(){var ve=this.diagram;return!(ve===null||ve.isReadOnly||ve.isModelReadOnly||ve.selection.count<2)},wn.prototype.alignLeft=function(){var ve=this.diagram;ve.startTransaction("aligning left");var Le=1/0;ve.selection.each(function(Se){Se instanceof go.Link||(Le=Math.min(Se.position.x,Le))}),ve.selection.each(function(Se){Se instanceof go.Link||Se.move(new go.Point(Le,Se.position.y))}),ve.commitTransaction("aligning left")},wn.prototype.alignRight=function(){var ve=this.diagram;ve.startTransaction("aligning right");var Le=-1/0;ve.selection.each(function(Se){if(!(Se instanceof go.Link)){var ti=Se.actualBounds.x+Se.actualBounds.width;Le=Math.max(ti,Le)}}),ve.selection.each(function(Se){Se instanceof go.Link||Se.move(new go.Point(Le-Se.actualBounds.width,Se.position.y))}),ve.commitTransaction("aligning right")},wn.prototype.alignTop=function(){var ve=this.diagram;ve.startTransaction("alignTop");var Le=1/0;ve.selection.each(function(Se){Se instanceof go.Link||(Le=Math.min(Se.position.y,Le))}),ve.selection.each(function(Se){Se instanceof go.Link||Se.move(new go.Point(Se.position.x,Le))}),ve.commitTransaction("alignTop")},wn.prototype.alignBottom=function(){var ve=this.diagram;ve.startTransaction("aligning bottom");var Le=-1/0;ve.selection.each(function(Se){if(!(Se instanceof go.Link)){var ti=Se.actualBounds.y+Se.actualBounds.height;Le=Math.max(ti,Le)}}),ve.selection.each(function(Se){Se instanceof go.Link||Se.move(new go.Point(Se.actualBounds.x,Le-Se.actualBounds.height))}),ve.commitTransaction("aligning bottom")},wn.prototype.alignCenterX=function(){var ve=this.diagram,Le=ve.selection.first();if(Le){ve.startTransaction("aligning Center X");var Se=Le.actualBounds.x+Le.actualBounds.width/2;ve.selection.each(function(ti){ti instanceof go.Link||ti.move(new go.Point(Se-ti.actualBounds.width/2,ti.actualBounds.y))}),ve.commitTransaction("aligning Center X")}},wn.prototype.alignCenterY=function(){var ve=this.diagram,Le=ve.selection.first();if(Le){ve.startTransaction("aligning Center Y");var Se=Le.actualBounds.y+Le.actualBounds.height/2;ve.selection.each(function(ti){ti instanceof go.Link||ti.move(new go.Point(ti.actualBounds.x,Se-ti.actualBounds.height/2))}),ve.commitTransaction("aligning Center Y")}},wn.prototype.alignColumn=function(ve){var Le=this.diagram;Le.startTransaction("align Column"),ve===void 0&&(ve=0),ve=parseFloat(ve);var Se=new Array;Le.selection.each(function(Dn){Dn instanceof go.Link||Se.push(Dn)});for(var ti=0;ti<Se.length-1;ti++){var Yn=Se[ti],Wn=Yn.actualBounds.y+Yn.actualBounds.height+ve,qe=Se[ti+1];qe.move(new go.Point(Yn.actualBounds.x,Wn))}Le.commitTransaction("align Column")},wn.prototype.alignRow=function(ve){ve===void 0&&(ve=0),ve=parseFloat(ve);var Le=this.diagram;Le.startTransaction("align Row");var Se=new Array;Le.selection.each(function(Dn){Dn instanceof go.Link||Se.push(Dn)});for(var ti=0;ti<Se.length-1;ti++){var Yn=Se[ti],Wn=Yn.actualBounds.x+Yn.actualBounds.width+ve,qe=Se[ti+1];qe.move(new go.Point(Wn,Yn.actualBounds.y))}Le.commitTransaction("align Row")},wn.prototype.canRotate=function(ve){var Le=this.diagram;return!(Le===null||Le.isReadOnly||Le.isModelReadOnly||Le.selection.count<1)},wn.prototype.rotate=function(ve){ve===void 0&&(ve=90);var Le=this.diagram;Le.startTransaction("rotate "+ve.toString());var Le=this.diagram;Le.selection.each(function(Se){Se instanceof go.Link||Se instanceof go.Group||(Se.angle+=ve)}),Le.commitTransaction("rotate "+ve.toString())},wn.prototype.pullToFront=function(){var ve=this.diagram;ve.startTransaction("pullToFront");var Le=new go.Map;ve.selection.each(function(Se){Le.set(Se.layer,0)}),Le.iteratorKeys.each(function(Se){var ti=0;Se.parts.each(function(Yn){if(!Yn.isSelected){var Wn=Yn.zOrder;isNaN(Wn)?Yn.zOrder=0:ti=Math.max(ti,Wn)}}),Le.set(Se,ti)}),ve.selection.each(function(Se){wn._assignZOrder(Se,Le.get(Se.layer)+1)}),ve.commitTransaction("pullToFront")},wn.prototype.pushToBack=function(){var ve=this.diagram;ve.startTransaction("pushToBack");var Le=new go.Map;ve.selection.each(function(Se){Le.set(Se.layer,0)}),Le.iteratorKeys.each(function(Se){var ti=0;Se.parts.each(function(Yn){if(!Yn.isSelected){var Wn=Yn.zOrder;isNaN(Wn)?Yn.zOrder=0:ti=Math.min(ti,Wn)}}),Le.set(Se,ti)}),ve.selection.each(function(Se){wn._assignZOrder(Se,Le.get(Se.layer)-1-wn._findGroupDepth(Se))}),ve.commitTransaction("pushToBack")},wn._assignZOrder=function(ve,Le,Se){Se===void 0&&(Se=ve),ve.layer===Se.layer&&(ve.zOrder=Le),ve instanceof go.Group&&ve.memberParts.each(function(ti){wn._assignZOrder(ti,Le+1,Se)})},wn._findGroupDepth=function(ve){if(ve instanceof go.Group){var Le=0;return ve.memberParts.each(function(Se){Le=Math.max(Le,wn._findGroupDepth(Se))}),Le+1}else return 0},wn.prototype.doKeyDown=function(){var ve=this.diagram;if(ve!==null){var Le=ve.lastInput;if(Le.key==="Up"||Le.key==="Down"||Le.key==="Left"||Le.key==="Right"){var Se=this.arrowKeyBehavior;if(Se==="none")return;if(Se==="select"){this._arrowKeySelect();return}else if(Se==="move"){this._arrowKeyMove();return}else if(Se==="tree"){this._arrowKeyTree();return}}go.CommandHandler.prototype.doKeyDown.call(this)}},wn.prototype._getAllParts=function(){var ve=new Array;return this.diagram.nodes.each(function(Le){ve.push(Le)}),this.diagram.parts.each(function(Le){ve.push(Le)}),ve},wn.prototype._arrowKeyMove=function(){var ve=this.diagram,Le=ve.lastInput,Se=0,ti=0;if(Le.control||Le.meta)Se=1,ti=1;else if(ve.grid!==null){var Yn=ve.grid.gridCellSize;ti=Yn.width,Se=Yn.height}ve.startTransaction("arrowKeyMove"),ve.selection.each(function(Wn){Le.key==="Up"?Wn.move(new go.Point(Wn.actualBounds.x,Wn.actualBounds.y-Se)):Le.key==="Down"?Wn.move(new go.Point(Wn.actualBounds.x,Wn.actualBounds.y+Se)):Le.key==="Left"?Wn.move(new go.Point(Wn.actualBounds.x-ti,Wn.actualBounds.y)):Le.key==="Right"&&Wn.move(new go.Point(Wn.actualBounds.x+ti,Wn.actualBounds.y))}),ve.commitTransaction("arrowKeyMove")},wn.prototype._arrowKeySelect=function(){var ve=this.diagram,Le=ve.lastInput,Se=null;Le.key==="Up"?Se=this._findNearestPartTowards(270):Le.key==="Down"?Se=this._findNearestPartTowards(90):Le.key==="Left"?Se=this._findNearestPartTowards(180):Le.key==="Right"&&(Se=this._findNearestPartTowards(0)),Se!==null&&(Le.shift?Se.isSelected=!0:Le.control||Le.meta?Se.isSelected=!Se.isSelected:ve.select(Se))},wn.prototype._findNearestPartTowards=function(ve){var Le=this.diagram.selection.first();if(Le===null)return null;for(var Se=Le.actualBounds.center,ti=this._getAllParts(),Yn=1/0,Wn=Le,qe=0;qe<ti.length;qe++){var Dn=ti[qe];if(Dn!==Le&&Dn.canSelect()){var ki=Dn.actualBounds.center,Di=Se.directionPoint(ki),Ki=this._angleCloseness(Di,ve);if(Ki<=45){var Gt=Se.distanceSquaredPoint(ki);Gt*=1+Math.sin(Ki*Math.PI/180),Gt<Yn&&(Yn=Gt,Wn=Dn)}}}return Wn},wn.prototype._angleCloseness=function(ve,Le){return Math.min(Math.abs(Le-ve),Math.min(Math.abs(Le+360-ve),Math.abs(Le-360-ve)))},wn.prototype._arrowKeyTree=function(){var ve=this.diagram,Le=ve.selection.first();if(Le instanceof go.Node){var Se=ve.lastInput;if(Se.key==="Right"){if(!Le.isTreeLeaf)if(!Le.isTreeExpanded)ve.commandHandler.canExpandTree(Le)&&ve.commandHandler.expandTree(Le);else{var ti=this._sortTreeChildrenByY(Le).first();ti!==null&&ve.select(ti)}}else if(Se.key==="Left")if(!Le.isTreeLeaf&&Le.isTreeExpanded)ve.commandHandler.canCollapseTree(Le)&&ve.commandHandler.collapseTree(Le);else{var Yn=Le.findTreeParentNode();Yn!==null&&ve.select(Yn)}else if(Se.key==="Up"){var Yn=Le.findTreeParentNode();if(Yn!==null){var Wn=this._sortTreeChildrenByY(Yn),qe=Wn.indexOf(Le);if(qe>0){for(var Dn=Wn.elt(qe-1);Dn!==null&&Dn.isTreeExpanded&&!Dn.isTreeLeaf;){var ki=this._sortTreeChildrenByY(Dn);Dn=ki.last()}Dn!==null&&ve.select(Dn)}else ve.select(Yn)}}else if(Se.key==="Down")if(Le.isTreeExpanded&&!Le.isTreeLeaf){var ti=this._sortTreeChildrenByY(Le).first();ti!==null&&ve.select(ti)}else for(;Le!==null;){var Yn=Le.findTreeParentNode();if(Yn===null)break;var Wn=this._sortTreeChildrenByY(Yn),qe=Wn.indexOf(Le);if(qe<Wn.length-1){ve.select(Wn.elt(qe+1));break}else Le=Yn}var Di=ve.selection.first();Di!==null&&ve.scrollToRect(Di.actualBounds)}},wn.prototype._sortTreeChildrenByY=function(ve){var Le=new go.List().addAll(ve.findTreeChildrenNodes());return Le.sort(function(Se,ti){var Yn=Se.location,Wn=ti.location;return Yn.y<Wn.y?-1:Yn.y>Wn.y?1:Yn.x<Wn.x?-1:Yn.x>Wn.x?1:0}),Le},wn.prototype.copyToClipboard=function(ve){go.CommandHandler.prototype.copyToClipboard.call(this,ve),this._lastPasteOffset.set(this.pasteOffset)},wn.prototype.pasteFromClipboard=function(){var ve=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(ve,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),ve},Object.defineProperty(wn.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(ve){if(ve!=="move"&&ve!=="select"&&ve!=="scroll"&&ve!=="tree"&&ve!=="none")throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+ve);this._arrowKeyBehavior=ve}}),Object.defineProperty(wn.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(ve){if(!(ve instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+ve);this._pasteOffset.set(ve)}});var fi=wn,Rt=kt(63720),Lt=kt(5269),Pt=kt(38986),Nt={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},Zt=kt(48790),Mt=kt(59301),Yt=(ve,Le,Se)=>new Promise((ti,Yn)=>{var Wn=ki=>{try{Dn(Se.next(ki))}catch(Di){Yn(Di)}},qe=ki=>{try{Dn(Se.throw(ki))}catch(Di){Yn(Di)}},Dn=ki=>ki.done?ti(ki.value):Promise.resolve(ki.value).then(Wn,qe);Dn((Se=Se.apply(ve,Le)).next())});function Ge({onCancel:ve,callback:Le}){let Se=(0,gt.useRef)(),ti=(0,gt.useRef)(),Yn=(0,gt.useRef)(),Wn=(0,gt.useRef)(!1);const qe=(0,gt.useRef)(!1),[Dn,ki]=(0,gt.useState)(0);function Di(){const Gt=ne.bx.make,me={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"};Se.current=new ne.S0(ti.current,{padding:20,grid:Gt(ne.s_,"Grid",Gt(ne.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Gt(ne.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:Tn=>{var Bi=Tn.diagram.commandHandler.addTopLevelParts(Tn.diagram.selection,!0);Bi||Tn.diagram.currentTool.doCancel()},commandHandler:Gt(fi),"clickCreatingTool.archetypeNodeData":{text:"\u672A\u547D\u540D",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:Tn=>{var Bi=Tn.subject;Bi.location=Bi.location.copy().snapToGridPoint(Tn.diagram.grid.gridOrigin,Tn.diagram.grid.gridCellSize),setTimeout(()=>{Tn.diagram.commandHandler.editTextBlock()},20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:Tn=>{var Bi=Tn.subject;setTimeout(()=>{Tn.diagram.commandHandler.editTextBlock()})},LinkRelinked:Tn=>{var Bi=Tn.parameter.part;Bi.invalidateConnectedLinks();var bi=Tn.subject;Tn.diagram.toolManager.linkingTool.isForwards?bi.toNode.invalidateConnectedLinks():bi.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),Se.current.nodeTemplate=Gt(ne.NB,"Auto",{locationSpot:ne.z6.Center,locationObjectName:"SHAPE",desiredSize:new ne.$u(120,60),minSize:new ne.$u(40,40),resizable:!0,resizeCellSize:new ne.$u(10,10),rotatable:!0},new ne.KX("location","loc",ne.E9.parse).makeTwoWay(ne.E9.stringify),new ne.KX("desiredSize","size",ne.$u.parse).makeTwoWay(ne.$u.stringify),Gt(ne.bn,{name:"SHAPE",fill:me.white,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:ne.z6.AllSides,toSpot:ne.z6.AllSides},new ne.KX("figure"),new ne.KX("fill"),new ne.KX("stroke","borderColor"),new ne.KX("strokeWidth","thickness"),new ne.KX("strokeDashArray","dash")),Gt(ne.bn,{width:100,height:20,strokeWidth:0,fill:"transparent"}),Gt(ne.al,{margin:1,textAlign:"center",overflow:ne.al.OverflowEllipsis,editable:!0},new ne.KX("text").makeTwoWay(),new ne.KX("stroke","color"))),Se.current.nodeTemplate.toolTip=Gt("ToolTip",Gt(ne.s_,"Vertical",{maxSize:new ne.$u(200,NaN)},Gt(ne.al,{font:"bold 10pt sans-serif",textAlign:"center"},new ne.KX("text")),Gt(ne.al,{font:"10pt sans-serif",textAlign:"center"},new ne.KX("text","details"))));function En(Tn,Bi){var bi=(_i,ir)=>{_i.handled=!0,_i.diagram.model.commit(yr=>{var Nr=ir.part.adornedPart,_r=new ne.E9().setRectSpot(Nr.actualBounds,Tn);_r.subtract(Nr.location),_r.scale(2,2),_r.x+=Math.sign(_r.x)*130,_r.y+=Math.sign(_r.y)*130,_r.add(Nr.location),_r.snapToGridPoint(_i.diagram.grid.gridOrigin,_i.diagram.grid.gridCellSize);var Rr=yr.copyNodeData(Nr.data);yr.setGroupKeyForNodeData(Rr,yr.getGroupKeyForNodeData(Nr.data)),yr.addNodeData(Rr);var cn={from:Nr.key,to:yr.getKeyForNodeData(Rr)};yr.addLinkData(cn);var ho=_i.diagram.findNodeForData(Rr);ho.location=_r,_i.diagram.select(ho),setTimeout(()=>{_i.diagram.commandHandler.editTextBlock()},20)})};return Gt(ne.bn,{figure:Bi,alignment:Tn,alignmentFocus:Tn.opposite(),width:Tn.equals(ne.z6.Top)||Tn.equals(ne.z6.Bottom)?25:18,height:Tn.equals(ne.z6.Top)||Tn.equals(ne.z6.Bottom)?18:25,fill:"orange",stroke:me.white,strokeWidth:4,mouseEnter:(_i,ir)=>ir.fill="dodgerblue",mouseLeave:(_i,ir)=>ir.fill="orange",isActionable:!0,click:bi,contextClick:bi})}function Gn(Tn){return Gt(ne.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:(Bi,bi)=>bi.fill="dodgerblue",mouseLeave:(Bi,bi)=>bi.fill="orange",click:(Bi,bi)=>{Bi.diagram.commandHandler.showContextMenu(bi.part.adornedPart)}},Tn||{})}Se.current.nodeTemplate.selectionAdornmentTemplate=Gt(ne.uz,"Spot",Gt(ne.Vm,{padding:10}),En(ne.z6.Top,"TriangleUp"),En(ne.z6.Left,"TriangleLeft"),En(ne.z6.Right,"TriangleRight"),En(ne.z6.Bottom,"TriangleDown"),Gn({alignment:new ne.z6(.75,0)}));function Re(Tn,Bi){return(bi,_i)=>{bi.handled=!0,bi.diagram.model.commit(ir=>{ir.set(_i.part.adornedPart.data,Tn,Bi)})}}function $e(Tn,Bi){return Bi||(Bi="color"),Gt(ne.bn,{width:16,height:16,stroke:"lightgray",fill:Tn,margin:1,background:"transparent",mouseEnter:(bi,_i)=>_i.stroke="dodgerblue",mouseLeave:(bi,_i)=>_i.stroke="lightgray",click:Re(Bi,Tn),contextClick:Re(Bi,Tn)})}function Nn(){return[Gt("ContextMenuButton",Gt(ne.s_,"Horizontal",$e(me.white,"fill"),$e(me.beige,"fill"),$e(me.extralightblue,"fill"),$e(me.extralightred,"fill"))),Gt("ContextMenuButton",Gt(ne.s_,"Horizontal",$e(me.lightgray,"fill"),$e(me.lightgreen,"fill"),$e(me.lightblue,"fill"),$e(me.lightred,"fill")))]}function _n(){return[Gt("ContextMenuButton",Gt(ne.s_,"Horizontal",$e(me.black),$e(me.green),$e(me.blue),$e(me.red))),Gt("ContextMenuButton",Gt(ne.s_,"Horizontal",$e(me.white),$e(me.magenta),$e(me.purple),$e(me.orange)))]}function di(Tn,Bi){return Bi||(Bi="thickness"),Gt(ne.bn,"LineH",{width:16,height:16,strokeWidth:Tn,margin:1,background:"transparent",mouseEnter:(bi,_i)=>_i.background="dodgerblue",mouseLeave:(bi,_i)=>_i.background="transparent",click:Re(Bi,Tn),contextClick:Re(Bi,Tn)})}function Jn(Tn,Bi){return Bi||(Bi="dash"),Gt(ne.bn,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:Tn,margin:1,background:"transparent",mouseEnter:(bi,_i)=>_i.background="dodgerblue",mouseLeave:(bi,_i)=>_i.background="transparent",click:Re(Bi,Tn),contextClick:Re(Bi,Tn)})}function li(){return[Gt("ContextMenuButton",Gt(ne.s_,"Horizontal",di(1),di(2),di(3),di(4))),Gt("ContextMenuButton",Gt(ne.s_,"Horizontal",Jn(null),Jn([2,4]),Jn([4,4])))]}function ni(Tn,Bi){return Bi||(Bi="figure"),Gt(ne.bn,{width:32,height:32,scale:.5,fill:"lightgray",figure:Tn,margin:1,background:"transparent",mouseEnter:(bi,_i)=>_i.fill="dodgerblue",mouseLeave:(bi,_i)=>_i.fill="lightgray",click:Re(Bi,Tn),contextClick:Re(Bi,Tn)})}Se.current.nodeTemplate.contextMenu=Gt("ContextMenu",Gt("ContextMenuButton",Gt(ne.s_,"Horizontal",ni("Rectangle"),ni("RoundedRectangle"),ni("Ellipse"),ni("Diamond"))),Gt("ContextMenuButton",Gt(ne.s_,"Horizontal",ni("Parallelogram2"),ni("ManualOperation"),ni("Procedure"),ni("Cylinder1"))),Gt("ContextMenuButton",Gt(ne.s_,"Horizontal",ni("Terminator"),ni("CreateRequest"),ni("Document"),ni("TriangleDown"))),Nn(),_n(),li()),Se.current.groupTemplate=Gt(ne.ZA,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:ne.z6.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:(Tn,Bi)=>{var bi=Bi.addMembers(Bi.diagram.selection,!0);bi||Bi.diagram.currentTool.doCancel()},avoidable:!1},new ne.KX("location","loc",ne.E9.parse).makeTwoWay(ne.E9.stringify),Gt(ne.s_,"Auto",{name:"BODY"},Gt(ne.bn,{parameter1:10,fill:me.white,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:ne.z6.AllSides,toSpot:ne.z6.AllSides},new ne.KX("fill"),new ne.KX("stroke","color"),new ne.KX("strokeWidth","thickness"),new ne.KX("strokeDashArray","dash")),Gt(ne.Vm,{background:"transparent",margin:20})),Gt(ne.al,{alignment:ne.z6.Top,alignmentFocus:ne.z6.Bottom,font:"bold 12pt sans-serif",editable:!0},new ne.KX("text"),new ne.KX("stroke","color"))),Se.current.groupTemplate.selectionAdornmentTemplate=Gt(ne.uz,"Spot",Gt(ne.s_,"Auto",Gt(ne.bn,{fill:null,stroke:"dodgerblue",strokeWidth:3}),Gt(ne.Vm,{margin:1.5})),Gn({alignment:ne.z6.TopRight,alignmentFocus:ne.z6.BottomRight})),Se.current.groupTemplate.contextMenu=Gt("ContextMenu",Nn(),_n(),li()),Se.current.linkTemplate=Gt(ne.rU,{layerName:"Foreground",routing:ne.rU.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new ne.KX("fromSpot","fromSpot",ne.z6.parse),new ne.KX("toSpot","toSpot",ne.z6.parse),new ne.KX("fromShortLength","dir",Tn=>Tn>=1?10:0),new ne.KX("toShortLength","dir",Tn=>Tn>=1?10:0),new ne.KX("points").makeTwoWay(),Gt(ne.bn,{strokeWidth:2},new ne.KX("stroke","color"),new ne.KX("strokeWidth","thickness"),new ne.KX("strokeDashArray","dash")),Gt(ne.bn,{segmentIndex:0,segmentOffset:new ne.E9(15,0),segmentOrientation:ne.rU.OrientAlong,alignmentFocus:ne.z6.Right,figure:"circle",width:10,strokeWidth:0},new ne.KX("fill","color"),new ne.KX("visible","dir",Tn=>Tn===1)),Gt(ne.bn,{segmentIndex:-1,segmentOffset:new ne.E9(-10,6),segmentOrientation:ne.rU.OrientPlus90,alignmentFocus:ne.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new ne.KX("fill","color"),new ne.KX("visible","dir",Tn=>Tn>=1),new ne.KX("width","thickness",Tn=>7+3*Tn),new ne.KX("height","thickness",Tn=>7+3*Tn),new ne.KX("segmentOffset","thickness",Tn=>new ne.E9(-15,4+1.5*Tn))),Gt(ne.bn,{segmentIndex:0,segmentOffset:new ne.E9(15,-6),segmentOrientation:ne.rU.OrientMinus90,alignmentFocus:ne.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new ne.KX("fill","color"),new ne.KX("visible","dir",Tn=>Tn===2),new ne.KX("width","thickness",Tn=>7+3*Tn),new ne.KX("height","thickness",Tn=>7+3*Tn),new ne.KX("segmentOffset","thickness",Tn=>new ne.E9(-15,4+1.5*Tn))),Gt(ne.al,{alignmentFocus:new ne.z6(0,1,-4,0),editable:!0},new ne.KX("text").makeTwoWay(),new ne.KX("stroke","color"))),Se.current.linkTemplate.selectionAdornmentTemplate=Gt(ne.uz,Gt(ne.bn,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:ji(2)},new ne.KX("pathPattern","thickness",ji)),Gn({alignmentFocus:new ne.z6(0,0,-6,-4)}));function ji(Tn){return Gt(ne.bn,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(Tn+4).toString()+" H3"})}function Oi(Tn){var Bi="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return Tn===0?Bi="M0 0 M16 16 M0 8 L16 8":Tn===2&&(Bi="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),Gt(ne.bn,{geometryString:Bi,margin:2,background:"transparent",mouseEnter:(bi,_i)=>_i.background="dodgerblue",mouseLeave:(bi,_i)=>_i.background="transparent",click:Re("dir",Tn),contextClick:Re("dir",Tn)})}function Ii(Tn){var Bi=(bi,_i)=>{bi.handled=!0,bi.diagram.model.commit(ir=>{var yr=_i.part.adornedPart;ir.set(yr.data,Tn?"toSpot":"fromSpot",ne.z6.stringify(ne.z6.AllSides)),(Tn?yr.toNode:yr.fromNode).invalidateConnectedLinks()})};return Gt(ne.bn,{width:12,height:12,fill:"transparent",mouseEnter:(bi,_i)=>_i.background="dodgerblue",mouseLeave:(bi,_i)=>_i.background="transparent",click:Bi,contextClick:Bi})}function Ve(Tn,Bi){var bi=0,_i=ne.z6.RightSide;Tn.equals(ne.z6.Top)?(bi=270,_i=ne.z6.TopSide):Tn.equals(ne.z6.Left)?(bi=180,_i=ne.z6.LeftSide):Tn.equals(ne.z6.Bottom)&&(bi=90,_i=ne.z6.BottomSide),Bi||(bi-=180);var ir=(yr,Nr)=>{yr.handled=!0,yr.diagram.model.commit(_r=>{var Rr=Nr.part.adornedPart;_r.set(Rr.data,Bi?"toSpot":"fromSpot",ne.z6.stringify(_i)),(Bi?Rr.toNode:Rr.fromNode).invalidateConnectedLinks()})};return Gt(ne.bn,{alignment:Tn,alignmentFocus:Tn.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:bi,background:"transparent",mouseEnter:(yr,Nr)=>Nr.background="dodgerblue",mouseLeave:(yr,Nr)=>Nr.background="transparent",click:ir,contextClick:ir})}Se.current.linkTemplate.contextMenu=Gt("ContextMenu",_n(),li(),Gt("ContextMenuButton",Gt(ne.s_,"Horizontal",Oi(0),Oi(1),Oi(2))),Gt("ContextMenuButton",Gt(ne.s_,"Horizontal",Gt(ne.s_,"Spot",Ii(!1),Ve(ne.z6.Top,!1),Ve(ne.z6.Left,!1),Ve(ne.z6.Right,!1),Ve(ne.z6.Bottom,!1)),Gt(ne.s_,"Spot",{margin:new ne.Zt(0,0,0,2)},Ii(!0),Ve(ne.z6.Top,!0),Ve(ne.z6.Left,!0),Ve(ne.z6.Right,!0),Ve(ne.z6.Bottom,!0)))));const vr=`{ "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 Mr=["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 ro(Tn){return console.log("shapeName:",Tn),Mr.indexOf(Tn)>=0}var en=new ne.YI(Yn.current,{maxSelectionCount:1,linkTemplate:Gt(ne.rU,{locationSpot:ne.z6.Center,selectionAdornmentTemplate:Gt(ne.uz,"Link",{locationSpot:ne.z6.Center},Gt(ne.bn,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),Gt(ne.bn,{toArrow:"Standard",stroke:null}))},{routing:ne.rU.AvoidsNodes,curve:ne.rU.JumpOver,corner:5,toShortLength:4},new ne.KX("points"),Gt(ne.bn,{isPanelMain:!0,strokeWidth:2}),Gt(ne.bn,{toArrow:"Standard",stroke:null})),model:new ne.FJ([{text:"\u672A\u547D\u540D",size:"100 100",fill:null,stroke:"#000"},...ne.bn.getFigureGenerators().toArray().map(Tn=>({text:"\u672A\u547D\u540D",size:"100 100",figure:Tn.key,fill:"white",stroke:"#666",borderColor:"#000"}))])});return Se.current.addDiagramListener("TextEdited",function(Tn){var Bi;const bi=Tn.subject.part;var _i=(Bi=document.activeElement)==null?void 0:Bi.value;typeof _i=="string"&&_i.trim()===""&&Se.current.model.commit(function(ir){ir.set(bi.data,"text","\u672A\u547D\u540D"),Se.current.commandHandler.stopCommand()},"increment")}),en.nodeTemplate=Gt(ne.NB,"Auto",{locationSpot:ne.z6.Center},new ne.KX("location","location",ne.E9.parse).makeTwoWay(ne.E9.stringify),Gt(ne.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 ne.KX("stroke").makeTwoWay(),new ne.KX("fill").makeTwoWay(),new ne.KX("figure")),Gt(ne.al,{margin:new ne.Zt(5,5,3,5),font:"10pt sans-serif",minSize:new ne.$u(16,16),maxSize:new ne.$u(10,NaN),textAlign:"center",editable:!0},new ne.KX("key").makeTwoWay())),setTimeout(()=>{Se.current.grid=Gt(ne.s_,"Grid",Gt(ne.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Gt(ne.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),Se.current.grid.visible=!0,Se.current.grid.gridCellStroke="darkgray",Se.current.grid.gridCellStrokeWidth=1},300),window.myDiagrams=Se.current,Se.current}const Ki=()=>Yt(this,null,function*(){var Gt,me=Se.current.makeImage();const En=yield(0,Pt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:me.src,file_data:JSON.stringify({login:(Gt=(0,Zt.eY)())==null?void 0:Gt.login,data:JSON.parse(Se.current.model.toJson())})}});Le({src:En.url})});return(0,gt.useEffect)(()=>(setTimeout(()=>{Di()},500),ki(Dn+1),()=>{Se.current=null}),[]),Mt.createElement("div",{ref:qe,className:"body-overflow-initial"},Mt.createElement(on.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!Dn,destroyOnClose:!0,maskClosable:!1,rootClassName:"zIndex-9999",title:Mt.createElement(un.Z,null,Mt.createElement(Lt.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),Mt.createElement(Lt.Z,{onClick:()=>{var Gt,me,En=Se.current.selection.first();if(Wn.current=!Wn.current,document.activeElement&&En){let Gn=(me=(Gt=document.activeElement)==null?void 0:Gt.value)==null?void 0:me.trim();typeof Gn=="string"&&Se.current.model.commit(function(Re){Re.set(En.data,"text",Gn||"\u672A\u547D\u540D"),Se.current.commandHandler.stopCommand()},"increment")}ki(Dn+1)}},Mt.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:ve},Mt.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative",display:Wn.current?"none":"block"},className:Nt.flowChartWrp},Mt.createElement("div",{style:{display:"flex",height:"100%"}},Mt.createElement("div",{style:{width:"300px",height:"100%"}},Mt.createElement("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"}},"\u56FE\u5F62\u5E93"),Mt.createElement("div",{style:{height:"calc(100% - 50px)"},className:Nt.myPaletteDiv,ref:Yn})),Mt.createElement("div",{style:{flex:1,position:"relative"}},Mt.createElement("div",{ref:ti,style:{height:"80vh"}}))),Mt.createElement("div",{className:"tr"},Mt.createElement(re.ZP,{size:"large",onClick:Ki,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var Oe=Ge,Ke=kt(47889),we=kt(71051);const Ce=Ke.ZP.Group,Fe={margin:"0 8px"};var He=({callback:ve,onCancel:Le})=>{function Se(ti){ve(ti)}return gt.createElement(Ht.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Se},gt.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},gt.createElement("span",{style:Fe},"\u5355\u5143\u683C\u6570\uFF1A"),gt.createElement("span",{style:Fe},"\u884C\u6570"),gt.createElement(Ht.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},gt.createElement(we.Z,null)),gt.createElement("span",{style:Fe},"\u5217\u6570"),gt.createElement(Ht.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},gt.createElement(we.Z,null))),gt.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},gt.createElement("span",{style:Fe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),gt.createElement(Ht.default.Item,{name:"align"},gt.createElement(Ce,null,gt.createElement(Ke.ZP,{value:"default"},gt.createElement("i",{className:"fa fa-align-justify"})),gt.createElement(Ke.ZP,{value:"left"},gt.createElement("i",{className:"fa fa-align-left"})),gt.createElement(Ke.ZP,{value:"center"},gt.createElement("i",{className:"fa fa-align-center"})),gt.createElement(Ke.ZP,{value:"right"},gt.createElement("i",{className:"fa fa-align-right"}))))),gt.createElement("div",{className:"flex-container flex-end"},gt.createElement(re.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),gt.createElement(re.ZP,{type:"ghost",onClick:Le},"\u53D6\u6D88")))},Qe=kt(71411),hn=kt(43001),dn=kt.n(hn),ze=(0,gt.forwardRef)(({use3d:ve,width:Le,height:Se,callback:ti,showSaveButton:Yn},Wn)=>{const qe=(0,gt.useRef)(),Dn=(0,gt.useRef)(),[ki,Di]=(0,gt.useState)(!1),Ki=(0,gt.useRef)({id:qe,appName:"graphing",width:Le||1e3,height:Se||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,gt.useEffect)(()=>{Dn.current=new(dn())(Ki.current,!0),window.onload=function(){Dn.current.inject("applet_container")}},[]);const Gt=()=>{var me=window.ggbApplet.getPNGBase64(1,!0,72);return ti&&ti(me),me};return(0,gt.useEffect)(()=>{Ki.current.appName=ki?"3D":"graphing",Dn.current.inject("applet_container")},[ki]),(0,gt.useEffect)(()=>{Di(ve)},[ve]),(0,gt.useImperativeHandle)(Wn,()=>({getImgData:Gt})),gt.createElement(gt.Fragment,null,gt.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:qe}),gt.createElement(un.Z,{align:"middle"},gt.createElement(Lt.Z,{flex:1},gt.createElement(Qe.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:ki,onChange:me=>Di(me)})),gt.createElement(Lt.Z,null,gt.createElement(re.ZP,{size:"large",onClick:Gt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),We=kt(76562),an=kt(6767);const Xn="link",pn="upload-image",rn="add-flowchart",In="draw-image",pi="add-flowchart",ei="code-block",mi="add-table",Hi="------------",Cn={default:Hi,left:`:${Hi}`,center:`:${Hi}:`,right:`${Hi}:`};var Sn=kt(37808);function Bn(){}let si=0;const yi=1e4,hi="\u2581",Gi="@\u2581\u2581@",wt="@\u2581@",Ye=`
**\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`,Zn=["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 Ln(ve){return/^\d+$/.test(ve)?`${ve}px`:ve}const oi=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",Si={[oi+"-B"]:"bold",[oi+"-I"]:"italic"},Yi={[Xn]:"\u6DFB\u52A0\u94FE\u63A5",[ei]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[pn]:"\u6DFB\u52A0\u56FE\u7247",[In]:"\u6DFB\u52A0\u753B\u56FE",[rn]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[mi]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var Fi=({defaultValue:ve="",onChange:Le,width:Se="100%",height:ti=400,miniToolbar:Yn=!1,isFocus:Wn=!1,watch:qe,insertTemp:Dn,mode:ki="markdown",id:Di="markdown-editor-id",showResizeBar:Ki=!1,noStorage:Gt=!1,showNullButton:me=!1,showNullProgramButton:En=!1,hidetoolBar:Gn=!1,fullScreen:Re=!1,onBlur:$e,onCMBeforeChange:Nn,onFullScreen:_n,className:di="",disablePaste:Jn=!1,disabled:li=!1,disabledFill:ni=!1,placeholder:ji="",values:Oi="",extraUse:Ii})=>{const[Ve,vr]=(0,gt.useState)(null),[Mr,ro]=(0,gt.useState)(ve),[en,Tn]=(0,gt.useState)(qe),[Bi,bi]=(0,gt.useState)(Re),[_i,ir]=(0,gt.useState)(""),[yr,Nr]=(0,gt.useState)(0),[_r,Rr]=(0,gt.useState)(ti),[cn,ho]=(0,gt.useState)(!1),[gn,Wi]=(0,gt.useState)(0),[Kr,zi]=(0,gt.useState)(0),wo=(0,gt.useRef)(),Yr=(0,gt.useRef)(),Er=(0,gt.useRef)(),Co=(0,gt.useRef)();(0,gt.useEffect)(()=>{const vi=window.scrollY||window.pageYOffset;ro(Oi),Ve==null||Ve.setValue(Oi),window.scrollTo(0,vi)},[Oi]),(0,gt.useEffect)(()=>{_n==null||_n(Bi)},[Bi]),(0,gt.useEffect)(()=>{if(wo.current){let vi=function(nn,Ni){var Xi;if(Jn){Ni.preventDefault();return}const Or=Ni.clipboardData;if(Or){const cr=Or.types.toString(),oo=Or.items;if(cr==="Files"||Or.types.indexOf("Files")>-1){if(Ni.preventDefault(),ki=="stex")return;try{let to=oo[1];((Xi=oo[0])==null?void 0:Xi.kind)==="file"&&(to=oo[0]);const $r=to.getAsFile(),po=$r.name.split(".").pop();(0,De.I)($r,lo=>{var Bo,Te,ao;lo.id?((Bo=$r==null?void 0:$r.type)==null?void 0:Bo.indexOf("image"))>-1?ii.replaceSelection(`<img width="100%" src="/api/attachments/${lo.id}?type=${lo.content_type})" alt="" />`):((Te=$r==null?void 0:$r.type)==null?void 0:Te.indexOf("video"))>-1?ii.replaceSelection(`<video width="100%" controls src="/api/attachments/${lo.id}"></video>`):((ao=$r==null?void 0:$r.type)==null?void 0:ao.indexOf("pdf"))>-1?ii.replaceSelection(`<a href="/api/attachments/${lo.id}?type=${$r.type}&disposition=inline" target="_blank">${$r.name}</a>`):Zn.includes(po)?ii.replaceSelection(`<a href="/api/attachments/${lo.id}?type=office&disposition=inline" target="_blank">${$r.name}</a>`):ii.replaceSelection(`[${$r.name}](/api/attachments/${lo.id}?type=${lo.content_type})`):(lo==null?void 0:lo.status)===401&&(document.location.href="/user/login")})}catch(to){an.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const ii=ue().fromTextArea(wo.current,{mode:ki,lineNumbers:!Yn,lineWrapping:!0,value:ve,autoCloseTags:!0,autoCloseBrackets:!0});return ii.on("keyup",function(nn,Ni){Ni.keyCode===8&&(nn.getValue()==""?ii.setOption("placeholder",ji):ii.setOption("placeholder",null))}),ii.on("keydown",function(nn,Ni){if(Ni.keyCode===8){var Xi=xn(nn);Xi&&Ni.preventDefault()}}),Wn&&ii.focus(),ii.on("paste",vi),li&&ii.on("beforeChange",function(nn,Ni){(Ni.origin==="paste"||Ni.origin==="+input")&&Ni.cancel()}),vr(ii),()=>{ii.off("paste",vi)}}},[]);const _e=(0,gt.useCallback)(()=>{if(Yr.current)try{}catch(vi){console.log(vi,"---- to set md editor body height")}},[_r,Yr,Bi]);(0,gt.useEffect)(()=>{function vi(){let ii=new Ee.Z(nn=>{for(let Ni of nn)(Ni.target.offsetHeight>0||Ni.target.offsetWidth>0)&&(_e(),Ve.setSize("100%","100%"),Ve.refresh())});return ii.observe(wo.current.parentElement),ii}if(Ve){const ii=vi();return()=>{var nn,Ni;(nn=wo.current)!=null&&nn.parentElement&&ii.unobserve((Ni=wo.current)==null?void 0:Ni.parentElement)}}},[Ve,_e]),(0,gt.useEffect)(()=>{if(Ve){let vi=[];for(const[ii,nn]of Object.entries(Si)){let Ni={[ii]:()=>{Be(nn)}};vi.push(Ni),Ve.addKeyMap(Ni)}return()=>{for(let ii of vi)Ve.removeKeyMap(ii)}}},[Ve]),(0,gt.useEffect)(()=>{Re!==Bi&&bi(Re)},[Re]),(0,Sn.Z)(()=>{if(!Gt&&yr>0){let vi=new Date().getTime(),ii=window.sessionStorage.getItem(Di);vi>=yr+yi&&(!ii||ii!==Mr)&&(window.sessionStorage.setItem(Di,Mr),ho(!0))}},yi),(0,gt.useEffect)(()=>{Tn(qe)},[Ve,qe]),(0,gt.useEffect)(()=>{Ve&&Wn&&Ve.focus()},[Ve,Wn]),(0,gt.useEffect)(()=>{if(en&&Ve){let vi=function(nn){let Ni=nn.target;if(Co.current){let Xi=Ni.scrollTop/Ni.scrollHeight;Co.current.scrollTop=Co.current.scrollHeight*Xi}};const ii=Ve.getScrollerElement();return ii.addEventListener("scroll",vi),()=>{ii.removeEventListener("scroll",vi)}}},[Ve,en]),(0,gt.useEffect)(()=>{if(Ve&&Nn){let vi=function(ii,nn){Nn(ii,nn)};return Ve.on("beforeChange",vi),()=>{Ve.off("beforeChange",vi)}}},[Ve,Nn]),(0,gt.useEffect)(()=>{if(Ve&&$e){let vi=function(){$e(Ve.getValue())};return Ve.on("blur",vi),()=>{Ve.off("blur",vi)}}},[Ve,$e]);function xn(vi,ii){var nn=vi.getDoc(),Ni=nn.getCursor(),Xi=nn.getLine(Ni.line),Or=Xi.charAt(Ni.ch-1),cr=Xi.lastIndexOf("@\u2581@",Ni.ch),oo=Xi.lastIndexOf("@\u2581\u2581@",Ni.ch),to=cr>oo?cr:oo,$r=cr>oo?3:4;if(Gi.indexOf(Or)===-1)return null;if(console.log("change1:",ii,vi,Xi,Ni,to,cr,oo,Or),to>=0&&Ni.ch-to<5){var po=to+$r;return nn.replaceRange("",{line:Ni.line,ch:to},{line:Ni.line,ch:po}),{line:Ni.line,ch:po}}return null}(0,gt.useEffect)(()=>{if(Ve){let vi=function(ii,nn){const Ni=ii.getValue();ro(Ni),Nr(new Date().getTime()),ii.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Le&&(En?Le(Ni,Vn(Ni)):Le(Ni))};return Ve.on("change",vi),()=>{Ve.off("change",vi)}}},[Ve,Le]),(0,gt.useEffect)(()=>{if(Ve)if(ve==null)Ve.setValue(""),ro("");else{const vi=window.scrollY||window.pageYOffset;ve!==Ve.getValue()&&(Ve.setValue(ve),ro(ve),Ve.setCursor(li?1:Ve.lineCount(),0),window.scrollTo(0,vi))}},[Ve,ve]);const Be=(0,gt.useCallback)(vi=>{const ii=Ve.getCursor(),nn=Ve.getSelection();let Ni=nn.split(`
`);switch(vi){case"bold":return Ve.replaceSelection("**"+nn+"**"),nn===""&&Ve.setCursor(ii.line,ii.ch+2),Ve.focus();case"italic":return Ve.replaceSelection("*"+nn+"*"),nn===""&&Ve.setCursor(ii.line,ii.ch+1),Ve.focus();case"code":return Ve.replaceSelection("`"+nn+"`"),nn===""&&Ve.setCursor(ii.line,ii.ch+1),Ve.focus();case"inline-latex":return ir("inline-latex"),Ve.focus();case"latex":return Ve.replaceSelection("```latex\n"+nn+"\n```"),Ve.setCursor(ii.line+1,nn.length+1),Ve.focus();case"line-break":return Ve.replaceSelection(`<br/>
`),Ve.focus();case"list-ul":return nn===""?Ve.replaceSelection("- "+nn):Ve.replaceSelection(Ni.map(Xi=>Xi===""?"":`- ${Xi}`).join(`
`)),Ve.focus();case"list-ol":return nn===""?Ve.replaceSelection("1. "+nn):Ve.replaceSelection(Ni.map((Xi,Or)=>Xi===""?"":`${Or+1}. ${Xi}`).join(`
`)),Ve.focus();case"add-null-ch":return nn===""&&Ve.setCursor(ii.line,ii.ch),Ve.replaceSelection(hi),Ve.focus();case"add-signal":return nn===""&&Ve.setCursor(ii.line,ii.ch),Ve.replaceSelection(wt),Ve.focus();case"add-multiple":return nn===""&&Ve.setCursor(ii.line,ii.ch),Ve.replaceSelection(Gi),Ve.focus();case"inster-template-1":return nn===""&&Ve.setCursor(ii.line,ii.ch),Ve.replaceSelection(Ye),Ve.focus();case"eraser":return Ve.setValue(""),Ve.focus();case"trigger-watch":return Tn(!en),Ve.focus();case"trigger-full-screen":return bi(!Bi),Ve.focus();case Xn:ir(Xn);return;case ei:ir(ei);return;case pn:ir(pn);return;case In:ir(In);return;case"maths-latex":ir("maths-latex");return;case rn:ir(rn);return;case mi:ir(mi);return;default:throw new Error}},[Ve,en,Bi]),At=(0,gt.useCallback)((vi,ii)=>{var nn,Ni,Xi,Or,cr,oo;switch(ir(""),_i){case Xn:const{title:Bo,link:Te}=vi;return Ve.replaceSelection(`[${Bo}](${Te})`),Ve.focus();case ei:const{language:ao,content:Jr}=vi;return Ve.replaceSelection(["```"+ao,Jr,"```"].join(`
`)),Ve.focus();case"maths-latex":for(var to=atob(vi),$r=new Uint8Array(to.length),po=0;po<to.length;po++)$r[po]=to.charCodeAt(po);var lo=new Blob([$r],{type:"image/png"});(0,De.I)(lo,ra=>{ra.id?Ve.replaceSelection(`![,](/api/attachments/${ra.id}?type=${ra.content_type})`):(ra==null?void 0:ra.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":Ve.replaceSelection("`$$"+vi+"$$`");break;case pn:case In:case pi:const{src:gr,alt:Wr}=vi,Lr=ii,Mo=(Xi=(Ni=(nn=Lr==null?void 0:Lr.name)==null?void 0:nn.split("."))==null?void 0:Ni.pop)==null?void 0:Xi.call(Ni);return((Or=Lr==null?void 0:Lr.type)==null?void 0:Or.indexOf("image"))>-1||!(Lr!=null&&Lr.type)?Lr!=null&&Lr.align||Lr!=null&&Lr.width?Ve.replaceSelection(`<p style="text-align:${Lr.align||"initial"}"><img width="${Lr.width?Lr.width+"%":"initial"}" src="${gr}" alt="${Wr||""}" /></p>`):Ve.replaceSelection(`<img width="100%" src="${gr}" alt="${Wr||""}" />`):((cr=Lr==null?void 0:Lr.type)==null?void 0:cr.indexOf("video"))>-1?Ve.replaceSelection(`<video width="100%" controls src="${gr}"></video>`):((oo=Lr==null?void 0:Lr.type)==null?void 0:oo.indexOf("pdf"))>-1?Ve.replaceSelection(`<a href="${gr}?type=${Lr.type}&disposition=inline" target="_blank">${Lr.name}</a>`):Zn.includes(Mo)?Ve.replaceSelection(`<a href="${gr}?type=office&disposition=inline" target="_blank">${Lr.name}</a>`):Ve.replaceSelection(`[${Lr.name}](${gr})`),Ve.focus();case mi:const{row:Fo,col:zr,align:Zr}=vi;let Za=`
`;for(let ra=0;ra<Fo;ra++){let bs=[],Ba=[];for(let or=0;or<zr;or++)ra===1&&Ba.push(Cn[Zr]),bs.push(" ");ra===1&&(Za+=`| ${Ba.join(" | ")} |
`),Za+=`| ${bs.join(zr===1?"":" | ")} |
`}return Ve.replaceSelection(Za+`
`),Ve.focus();default:throw new Error}},[Ve,_i]),jn=(0,gt.useMemo)(()=>{switch(_i){case Xn:return gt.createElement(On,{callback:At,onCancel:Qn});case ei:return gt.createElement(bn.Z,{callback:At,onCancel:Qn});case pn:return gt.createElement(De.Z,{callback:At,onCancel:Qn});case rn:return gt.createElement(Oe,{callback:At,onCancel:Qn});case mi:return gt.createElement(He,{callback:At,onCancel:Qn});case"maths-latex":return gt.createElement(ze,{showSaveButton:!0,callback:At});case"inline-latex":return gt.createElement(We.Z,{showSaveButton:!0,callback:At});default:return null}},[_i]);function Qn(){ir("")}(0,gt.useEffect)(()=>{if(Er.current){let vi=function(cr){Xi=!0,Or=cr.pageY},ii=function(){Xi=!1},nn=function(cr){if(Xi){let oo=cr.pageY-Or;oo<0&&(oo=0),oo>300&&(oo=300);let to=ti+oo+"px";Rr(to)}},Ni=Er.current,Xi=!1,Or=0;return Ni.addEventListener("mousedown",vi),document.addEventListener("mousemove",nn),document.addEventListener("mouseup",ii),()=>{Ni.removeEventListener("mousedown",vi),document.removeEventListener("mousemove",nn),document.removeEventListener("mouseup",ii)}}},[Ve,Er]),(0,gt.useEffect)(()=>{Rr(ti)},[ti]);const Li=Ln(Se),xi=Ln(_r),ui={width:Li,height:xi},mn=(0,gt.useMemo)(()=>{if(yr){let vi=new Date(yr),ii=vi.getHours(),nn=vi.getMinutes(),Ni=vi.getSeconds();return ii=ii<10?"0"+ii:ii,nn=nn<10?"0"+nn:nn,Ni=Ni<10?"0"+Ni:Ni,`${ii}:${nn}:${Ni}`}return 0},[yr]),Vn=vi=>{const ii=[];if(En){let nn=-1;vi=vi.replace(/(@▁▁@|@▁@)/g,function(Ni,Xi,Or){ii.push({multiLine:Ni!==wt})})}return ii};function $n(){window.sessionStorage.removeItem(Di),ho(!1),Nr(0)}function An(){ho(!1),Nr(0),Ve.setValue(window.sessionStorage.getItem(Di))}(0,gt.useEffect)(()=>{Yi[_i]&&_i!==In&&_i!==rn&&setTimeout(()=>{const vi=document.getElementsByClassName("markdown-popup-form")[0],ii=window.innerWidth/2-vi.offsetWidth/2,nn=window.innerHeight/2-vi.offsetHeight/2;Wi(ii),zi(nn)},0)},[_i]);const Un=vi=>{vi.preventDefault();const ii=vi.clientX-gn,nn=vi.clientY-Kr;document.body.onmousemove=Ni=>{let Xi=Ni.clientX-ii,Or=Ni.clientY-nn;const cr=document.getElementsByClassName("markdown-popup-form")[0],oo=window.innerWidth-cr.offsetWidth,to=window.innerHeight-cr.offsetHeight;Xi=Math.max(0,Math.min(Xi,oo)),Or=Math.max(0,Math.min(Or,to)),Ti(Ni.clientX,Ni.clientY,ii,nn)&&(Wi(Xi),zi(Or))},document.body.onmouseup=function(){document.body.onmousemove=null}},Ti=(vi,ii,nn,Ni)=>{const Xi=document.body.clientHeight,Or=document.body.clientWidth;return vi<20&&nn>vi||vi>Or-20&&nn<vi||ii<20&&Ni>ii||ii>Xi-20&&Ni<ii?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return gt.createElement(gt.Fragment,null,gt.createElement("div",{className:"markdown-editor-wrapper",ref:Yr},gt.createElement("div",{className:`markdown-editor-container ${di} ${en?"on-preview":""} ${Yn?"mini":""} ${Bi?"full-screen":""}`,style:ui},gt.createElement(qt,{insertTemp:Dn,watch:en,fullScreen:Bi,showNullButton:me,showNullProgramButton:En,onActionCallback:Be,hidetoolBar:Gn,extraUse:Ii}),gt.createElement("div",{className:"markdown-editor-body"},gt.createElement("div",{className:"codemirror-container"},gt.createElement("textarea",{ref:wo,placeholder:ji})),en?gt.createElement("div",{ref:Co,className:"preview-container"},ki==="stex"&&gt.createElement(se,{value:Mr}),ki!=="stex"&&gt.createElement(Ae.Z,{disabledFill:ni,showProgramFill:En,value:Mr})):null))),Ki?gt.createElement("a",{ref:Er,className:"editor-resize"}):null,_i===In&&gt.createElement(vn,{callback:At,onCancel:Qn}),_i===rn&&gt.createElement(Oe,{callback:At,onCancel:Qn}),gt.createElement(Xt.Z,null,Yi[_i]&&_i!==In&&_i!==rn?gt.createElement(on.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:gn,top:Kr},title:gt.createElement("div",{style:{cursor:"move"},onMouseDown:Un},Yi[_i]),open:!0,onCancel:Qn,footer:null,destroyOnClose:!0,width:_i===rn?"1200px":null,height:_i===rn?"80vh":null,className:"markdown-popup-form"},jn):null))}},17077:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Tt},I:function(){return qt}});var gt=kt(28284),Ut=kt(6767),ue=kt(37568),Ee=kt(77736),he=kt(71051),Dt=kt(47889),ee=kt(99571),ge=kt(46699),Qt=kt(59301),jt=kt(59301),Ae=Object.defineProperty,se=Object.defineProperties,Pe=Object.getOwnPropertyDescriptors,Bt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(Xt,Ht,pe)=>Ht in Xt?Ae(Xt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:pe}):Xt[Ht]=pe,st=(Xt,Ht)=>{for(var pe in Ht||(Ht={}))nt.call(Ht,pe)&&ht(Xt,pe,Ht[pe]);if(Bt)for(var pe of Bt(Ht))et.call(Ht,pe)&&ht(Xt,pe,Ht[pe]);return Xt},pt=(Xt,Ht)=>se(Xt,Pe(Ht));const{useForm:vt}=gt.default,St={width:280,marginRight:10},Et={labelCol:{span:5},wrapperCol:{span:19}};var Tt=({callback:Xt,onCancel:Ht})=>{const[pe]=vt();let re=(0,Qt.useRef)();function Ne(Ue){re.current.width=pe.getFieldValue("width"),re.current.align=pe.getFieldValue("align"),Xt(Ue,re.current)}function ye(Ue,je){if(Ue.status===-1){Ut.ZP.error(Ue.message);return}pe.setFieldsValue({src:`/api/attachments/${Ue.id}`,type:je.type})}function xe(Ue){let je=Ue.target.files[0];re.current=je,qt(je,ye)}return jt.createElement(gt.default,pt(st({form:pe},Et),{className:"upload-image-panel",onFinish:Ne,style:{width:470,overflow:"hidden"}}),jt.createElement(gt.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},jt.createElement("div",{className:"flex-container"},jt.createElement(gt.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},jt.createElement(ue.default,{style:St})),jt.createElement(It,{onFileChange:xe}))),jt.createElement(gt.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},jt.createElement(ue.default,{style:{width:264}})),jt.createElement(gt.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},jt.createElement(Ee.Z,null,jt.createElement(gt.default.Item,{name:"width",style:{margin:0}},jt.createElement(he.Z,{style:{width:264}})),jt.createElement("span",{className:"ml8"},"%"))),jt.createElement(gt.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},jt.createElement(Dt.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"}]})),jt.createElement("aside",null,jt.createElement(gt.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},jt.createElement(ee.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),jt.createElement(ee.ZP,{type:"default",onClick:Ht},"\u53D6\u6D88"))))};function It({onFileChange:Xt}){return jt.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",jt.createElement("input",{type:"file",onChange:Xt}))}function qt(Xt,Ht){if(!Xt)throw new String("\u6CA1\u6709\u6587\u4EF6");let pe=new FormData;pe.append("editormd-image-file",Xt),pe.append("file_param_name","editormd-image-file"),pe.append("byxhr","true");var re=new window.XMLHttpRequest;re.withCredentials=!0,re.addEventListener("load",function(Ne){Ht(JSON.parse(Ne.target.responseText),Xt)},!1),re.addEventListener("error",function(Ne){console.error(Ne)},!1),re.open("POST",`${ge.KI}/api/attachments.json`),re.send(pe)}},91558:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return ue}});var gt=kt(59301),Ut=kt(4676);class ue extends gt.Component{constructor(he){super(he);const Dt=window.document;this.node=Dt.createElement("div"),Dt.body.appendChild(this.node)}render(){const{children:he}=this.props;return(0,Ut.createPortal)(he,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},75975:function(Mn,Rn,kt){"use strict";kt.d(Rn,{SV:function(){return Ge},ZP:function(){return Yt}});var gt=kt(59301),Ut=kt(76374);const ue={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"]},Ee={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"]},he={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(`
`)}]},Dt={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(`
`)}]},ee={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
`)}]};var ge=kt(53184),Qt=kt.n(ge),jt=Object.defineProperty,Ae=Object.defineProperties,se=Object.getOwnPropertyDescriptors,Pe=Object.getOwnPropertySymbols,Bt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,et=(Oe,Ke,we)=>Ke in Oe?jt(Oe,Ke,{enumerable:!0,configurable:!0,writable:!0,value:we}):Oe[Ke]=we,ht=(Oe,Ke)=>{for(var we in Ke||(Ke={}))Bt.call(Ke,we)&&et(Oe,we,Ke[we]);if(Pe)for(var we of Pe(Ke))nt.call(Ke,we)&&et(Oe,we,Ke[we]);return Oe},st=(Oe,Ke)=>Ae(Oe,se(Ke)),pt=(Oe,Ke,we)=>new Promise((Ce,Fe)=>{var He=dn=>{try{hn(we.next(dn))}catch(ri){Fe(ri)}},Qe=dn=>{try{hn(we.throw(dn))}catch(ri){Fe(ri)}},hn=dn=>dn.done?Ce(dn.value):Promise.resolve(dn.value).then(He,Qe);hn((we=we.apply(Oe,Ke)).next())});const vt={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},St=(Oe,Ke)=>Ke.map(we=>({label:we,kind:Oe.languages.CompletionItemKind.Keyword,insertText:we})),Et=Oe=>Object.keys(vt.tables).map(Ke=>({label:Ke,kind:Oe.languages.CompletionItemKind.Variable,insertText:Ke})),Tt=(Oe,Ke)=>{const we=vt.tables[Oe];return we?we.map(Ce=>({label:Ce,kind:Ke.languages.CompletionItemKind.Field,insertText:Ce})):[]};function It(Oe,Ke,we,Ce,Fe){let He=Ke.getWordUntilPosition(we),Qe={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:He.startColumn,endColumn:He.endColumn},hn=Ce.map(dn=>({label:dn,kind:Oe.languages.CompletionItemKind.Keyword,insertText:dn,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}));return Fe.map(dn=>{hn.push(st(ht({},dn),{range:Qe}))}),hn}var qt=Oe=>{vt.languages.map(Fe=>(Oe.languages.registerDocumentFormattingEditProvider(Fe,{provideDocumentFormattingEdits(He,Qe,hn){return pt(this,null,function*(){const dn=Qt()(He.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:He.getFullModelRange(),text:dn}]})}}),Fe));const Ke=he.quickKey.map(Fe=>({label:Fe.label,kind:Oe.languages.CompletionItemKind.Method,insertText:Fe.content,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet})),we=Dt.quickKey.map(Fe=>({label:Fe.label,kind:Oe.languages.CompletionItemKind.Method,insertText:Fe.content,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet})),Ce=Ee.quickKey.map(Fe=>({label:Fe.label,kind:Oe.languages.CompletionItemKind.Method,insertText:Fe.content,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet}));Oe.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Fe,He){var Qe=Fe.getWordUntilPosition(He),hn={startLineNumber:He.lineNumber,endLineNumber:He.lineNumber,startColumn:Qe.startColumn,endColumn:Qe.endColumn},dn=Fe.getLineContent(He.lineNumber).substring(Qe.startColumn-2,Qe.endColumn);return{suggestions:[...he.keywords.map(ri=>({label:ri,kind:Oe.languages.CompletionItemKind.Function,documentation:ri,insertText:ri,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:hn})),...he.quickKey.map(ri=>({label:ri.label,kind:Oe.languages.CompletionItemKind.Function,documentation:ri.content,insertText:dn.startsWith("#")?ri.content.replace(/#/,""):ri.content,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:hn}))]}}}),Oe.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Fe,He){var Qe=Fe.getWordUntilPosition(He),hn={startLineNumber:He.lineNumber,endLineNumber:He.lineNumber,startColumn:Qe.startColumn,endColumn:Qe.endColumn};return{suggestions:[...ue.keywords.map(dn=>({label:dn,kind:Oe.languages.CompletionItemKind.Function,documentation:dn,insertText:dn,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:hn}))]}}}),Oe.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Fe,He){var Qe=Fe.getWordUntilPosition(He),hn={startLineNumber:He.lineNumber,endLineNumber:He.lineNumber,startColumn:Qe.startColumn,endColumn:Qe.endColumn},dn=Fe.getLineContent(He.lineNumber).substring(Qe.startColumn-2,Qe.endColumn);return{suggestions:[...Ee.keywords.map(ri=>({label:ri,kind:Oe.languages.CompletionItemKind.Function,documentation:ri,insertText:ri,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:hn})),...Ee.quickKey.map(ri=>({label:ri.label,kind:Oe.languages.CompletionItemKind.Function,documentation:ri.content,insertText:dn.startsWith("#")?ri.content.replace(/#/,""):ri.content,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:hn}))]}}}),Oe.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(Fe,He){var Qe=Fe.getWordUntilPosition(He),hn={startLineNumber:He.lineNumber,endLineNumber:He.lineNumber,startColumn:Qe.startColumn,endColumn:Qe.endColumn},dn=Fe.getLineContent(He.lineNumber).substring(Qe.startColumn-2,Qe.endColumn);return{suggestions:[...ee.keywords.map(ri=>({label:ri,kind:Oe.languages.CompletionItemKind.Function,documentation:ri,insertText:ri,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:hn})),...ee.quickKey.map(ri=>({label:ri.label,kind:Oe.languages.CompletionItemKind.Function,documentation:ri.content,insertText:dn.startsWith("#")?ri.content.replace(/#/,""):ri.content,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:hn}))]}}}),Oe.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Fe,He){var Qe=Fe.getWordUntilPosition(He),hn={startLineNumber:He.lineNumber,endLineNumber:He.lineNumber,startColumn:Qe.startColumn,endColumn:Qe.endColumn},dn=Fe.getLineContent(He.lineNumber).substring(Qe.startColumn-2,Qe.endColumn);return{suggestions:[...Dt.keywords.map(ri=>({label:ri,kind:Oe.languages.CompletionItemKind.Function,documentation:ri,insertText:ri,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:hn})),...Dt.quickKey.map(ri=>({label:ri.label,kind:Oe.languages.CompletionItemKind.Function,documentation:ri.content,insertText:dn.startsWith("#")?ri.content.replace(/#/,""):ri.content,insertTextRules:Oe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:hn}))]}}})};const Xt="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var Ht=Object.defineProperty,pe=(Oe,Ke,we)=>Ke in Oe?Ht(Oe,Ke,{enumerable:!0,configurable:!0,writable:!0,value:we}):Oe[Ke]=we,re=(Oe,Ke,we)=>pe(Oe,typeof Ke!="symbol"?Ke+"":Ke,we);const Ne=class px{constructor(Ke,we,Ce){this.placeholder=Ke,this.editor=we,this.monaco=Ce,we.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)}};re(Ne,"ID","editor.widget.placeholderHint");var xe=Ne,Ue=kt(96236),je=kt(6767),Je=kt(25399),fn=kt(89392),te=kt(49535),Jt=kt(56102),Xe=Object.defineProperty,On=Object.defineProperties,bn=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,un=Object.prototype.propertyIsEnumerable,Kn=(Oe,Ke,we)=>Ke in Oe?Xe(Oe,Ke,{enumerable:!0,configurable:!0,writable:!0,value:we}):Oe[Ke]=we,Me=(Oe,Ke)=>{for(var we in Ke||(Ke={}))on.call(Ke,we)&&Kn(Oe,we,Ke[we]);if(De)for(var we of De(Ke))un.call(Ke,we)&&Kn(Oe,we,Ke[we]);return Oe},vn=(Oe,Ke)=>On(Oe,bn(Ke)),ne=(Oe,Ke)=>{var we={};for(var Ce in Oe)on.call(Oe,Ce)&&Ke.indexOf(Ce)<0&&(we[Ce]=Oe[Ce]);if(Oe!=null&&De)for(var Ce of De(Oe))Ke.indexOf(Ce)<0&&un.call(Oe,Ce)&&(we[Ce]=Oe[Ce]);return we},wn=(Oe,Ke,we)=>new Promise((Ce,Fe)=>{var He=dn=>{try{hn(we.next(dn))}catch(ri){Fe(ri)}},Qe=dn=>{try{hn(we.throw(dn))}catch(ri){Fe(ri)}},hn=dn=>dn.done?Ce(dn.value):Promise.resolve(dn.value).then(He,Qe);hn((we=we.apply(Oe,Ke)).next())});function fi(Oe){return/^\d+$/.test(Oe)?`${Oe}px`:Oe}function Rt(){}let Lt=!1;const Pt={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function Nt(Oe=[]){let Ke=Oe;if(Array.isArray(Oe)){for(let we=0;we<Oe.length;we++){let Ce=Pt[Oe[we]];if(Ce)return Ce}return Ke[0]}return Pt[Ke]||Ke}let Zt=null;const Mt=()=>wn(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(Oe){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",Oe)}});var Yt=Oe=>{var Ke=Oe,{width:we="100%",height:Ce="100%",value:Fe,language:He="javascript",style:Qe={},options:hn={},overrideServices:dn={},theme:ri="vs-dark",onEditBlur:ze,isCopy:We=!1,onSave:an,autoHeight:Xn=!1,forbidCopy:pn=!1,onChange:rn=Rt,editorDidMount:In=Rt,onFocus:pi=Rt,onBreakPoint:ei=Rt,breakPointValue:mi=[],filename:Hi="educoder.txt",errorLine:Cn,errorContent:Sn="",highlightLine:Bn,openBreakPoint:si=!1,placeholder:yi="",showMiniMap:hi=!0}=Ke,Gi=ne(Ke,["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 wt=(0,gt.useRef)(),Ye=(0,gt.useRef)({}),Zn=(0,gt.useRef)(),Ln=(0,gt.useRef)(),zn=(0,gt.useRef)([]),oi=(0,gt.useRef)(!1),Si=(0,gt.useRef)(),Yi=(0,gt.useRef)(),Fi=(0,gt.useRef)(!1),[ve,Le]=(0,gt.useState)(!1);function Se(){let Nn;return wt.current&&(Nn=new Ut.Z(_n=>{for(let di of _n)(di.target.offsetHeight>0||di.target.offsetWidth>0)&&Ye.current.instance.layout()}),Nn.observe(wt.current)),Nn}function ti(){je.ZP.warning({content:decodeURIComponent(Xt),key:"monaco-editor-tip"})}const Yn=()=>{let Nn=Ye.current.instance;if(Fe!=null&&Nn&&ve){const _n=Nn.getModel();_n&&Fe!==_n.getValue()&&(Lt=!0,_n.setValue(Fe),Nn.layout(),Lt=!1)}};(0,gt.useEffect)(()=>{const Nn=te.Z.subscribe("formatDocument",_n=>{var di;let Jn=Ye.current.instance;(di=Jn==null?void 0:Jn.getAction)==null||di.call(Jn,"editor.action.formatDocument").run()});return window.updateMonacoValue=_n=>{rn(_n)},Nn},[]),(0,gt.useEffect)(()=>{var Nn;let _n=Ye.current.instance;Ln.current&&clearTimeout(Ln.current),Ln.current=setTimeout(()=>{Yn()},500),Fe&&(Fe!=null&&Fe.length)&&((Nn=_n==null?void 0:_n.updateOptions)==null||Nn.call(_n,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Fe.split(/\r\n|\r|\n/g).length))+3,5)}))},[Fe,ve,Ye.current]),(0,gt.useEffect)(()=>{if(Cn&&Ye.current&&Ye.current.instance){let _n=Ye.current.instance;_n.changeViewZones(function(di){var Jn=document.createElement("div");Jn.style.padding="10px 20px",Jn.style.width="calc(100% - 20px)",Jn.className="my-error-line-wrp",Jn.innerHTML=Sn,di.addZone({afterLineNumber:Cn||11,heightInLines:3,domNode:Jn})});var Nn={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}};_n.addOverlayWidget(Nn),_n.revealPositionInCenter({lineNumber:20,column:1})}},[Cn,Ye.current,ve]);const Wn=(Nn="",_n)=>{if(!Nn||Nn.trim()==="")return!0;const Jn=Ye.current.instance.getModel().getLineTokens(_n);let li=!1;for(let ni=0;ni<2;ni++)Jn.getStandardTokenType(ni)===1&&(li=!0);return li};(0,gt.useEffect)(()=>{var Nn;const _n=(Nn=Ye.current)==null?void 0:Nn.instance;if(_n&&ve&&pn){const di=_n.onDidBlurEditorWidget(()=>{Fi.current=!1}),Jn=_n.onDidFocusEditorText(()=>{Fi.current=!0});return()=>{di.dispose(),Jn.dispose()}}},[Ye.current,ve,pn]),(0,gt.useEffect)(()=>{var Nn;if((Nn=Ye.current)!=null&&Nn.instance&&ve&&si){let _n=Ye.current.instance,di=_n.getModel();if(!di)return;(()=>{var Tn;let Bi=[],bi=[];const _i=di.getAllDecorations();for(let yr of _i)yr.options.className==="highlighted-line"&&(Bi.push((Tn=yr==null?void 0:yr.range)==null?void 0:Tn.startLineNumber),bi.push(yr==null?void 0:yr.id));if(Bn===Bi[0])return;di.deltaDecorations(bi,[]);const ir=di.getLineCount();Bn&&Bn<=ir&&(_n.deltaDecorations([],[{range:new Zt.Range(Bn,1,Bn,di.getLineMaxColumn(Bn)),options:{isWholeLine:!0,className:"highlighted-line"}}]),_n.revealLineInCenter(Bn))})();const li=(Tn=!1)=>{var Bi;let bi=[],_i=[];const ir=di.getAllDecorations();for(let yr of ir)yr.options.linesDecorationsClassName==="breakpoints-select"&&(bi.push((Bi=yr==null?void 0:yr.range)==null?void 0:Bi.startLineNumber),_i.push(yr==null?void 0:yr.id));if(Tn)return{lines:bi,ids:_i};ei(bi)},ni=Tn=>wn(void 0,null,function*(){let Bi={range:new Zt.Range(Tn,1,Tn,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield di.deltaDecorations([],[Bi]),li()}),ji=Tn=>wn(void 0,null,function*(){let Bi=[];const bi=_n.getLineDecorations(Tn);for(let _i of bi)_i.options.linesDecorationsClassName==="breakpoints-select"&&Bi.push(_i.id);yield di.deltaDecorations(Bi,[]),li()}),Oi=Tn=>{let Bi=_n.getLineDecorations(Tn);for(let bi of Bi)if(bi.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,fn.isEqual)(mi,li(!0).lines)){di.deltaDecorations(li(!0).ids,[]);const Tn=mi.map(Bi=>({range:new Zt.Range(Bi,1,Bi,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));di.deltaDecorations([],Tn)}const Ii=_n.onDidChangeModelContent(Tn=>{let Bi=_n.getPosition();if(Bi){let bi=Bi.lineNumber;clearTimeout(Yi.current),Yi.current=setTimeout(()=>{Wn(di.getLineContent(bi),bi)?ji(bi):Oi(bi)?(ji(bi),ni(bi)):li()},100)}}),Ve=_n.onMouseDown(Tn=>{var Bi,bi,_i;if(Tn.target.detail&&((_i=(bi=(Bi=Tn.target)==null?void 0:Bi.element)==null?void 0:bi.className)!=null&&_i.includes("line-numbers"))){let ir=Tn.target.position.lineNumber;if(Wn(di.getLineContent(ir),ir))return;Oi(ir)?ji(ir):ni(ir)}}),vr=Tn=>{let Bi={range:new Zt.Range(Tn,1,Tn,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};zn.current=_n.deltaDecorations(zn.current,[Bi])},Mr=()=>{zn.current=_n.deltaDecorations(zn.current,[])},ro=_n.onMouseMove(Tn=>{var Bi,bi,_i;if(Mr(),Tn.target.detail&&((_i=(bi=(Bi=Tn.target)==null?void 0:Bi.element)==null?void 0:bi.className)!=null&&_i.includes("line-numbers"))){let ir=Tn.target.position.lineNumber;if(Wn(di.getLineContent(ir),ir))return;vr(ir)}}),en=_n.onMouseLeave(()=>{Mr()});return()=>{Ii.dispose(),Ve.dispose(),ro.dispose(),en.dispose()}}},[Ye.current,ve,mi,Bn,si,He]),(0,gt.useEffect)(()=>{var Nn;(Nn=Ye.current)!=null&&Nn.instance&&si&&Ye.current.instance.setPosition({lineNumber:0,column:0})},[Bn]);function qe(){let Nn=Ye.current.instance;if(Nn){const _n=Nn.getSelection(),di=Ye.current.pastePos||{},Jn=new Zt.Range(di.startLineNumber||_n.endLineNumber,di.startColumn||_n.endColumn,di.endLineNumber||_n.endLineNumber,di.endColumn||_n.endColumn);setTimeout(()=>{Nn.executeEdits("",[{range:Jn,text:""}])},300)}}function Dn(Nn){(window.navigator.platform.match("Mac")?Nn.metaKey:Nn.ctrlKey)&&Nn.keyCode==83&&(Nn.preventDefault(),an())}const ki=()=>{if(Xn&&Ye.current.instance){const Nn=Ye.current.instance.getContentHeight();Re(Nn<Ce?Ce:Nn)}else Re(Ce)};function Di(Nn){var _n=document.createEvent("MouseEvents");_n.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Nn.dispatchEvent(_n)}const Ki=Nn=>{if(!Fi.current)return;const{keyCode:_n,ctrlKey:di,metaKey:Jn,target:li,type:ni}=Nn;return(ni==="paste"||(_n===67||_n===86)&&(Jn||di))&&li.nodeName==="TEXTAREA"&&(ti(),Nn.preventDefault()),!1};function Gt(Nn,_n){var di=window.URL||window.webkitURL||window,Jn=new Blob([_n]),li=document.createElementNS("http://www.w3.org/1999/xhtml","a");li.href=di.createObjectURL(Jn),li.download=Nn,Di(li)}(0,gt.useEffect)(()=>{ki()},[ki]),(0,gt.useEffect)(()=>{wt.current&&!ve&&Promise.all([kt.e(8909),kt.e(6656)]).then(kt.bind(kt,71448)).then(Nn=>{try{Zt=Nn,Ye.current.instance=Zt.editor.create(wt.current,{value:Fe,language:Nt(He),theme:ri,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:hi||!1}},dn);const _n=Ye.current.instance;let li=[...Ue.BH._menuItems].find(Ii=>Ii[0]._debugName=="EditorContext")[1],ni=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],ji=(Ii,Ve)=>{var vr,Mr;let ro=Ii._first;do Ve.includes((Mr=(vr=ro.element)==null?void 0:vr.command)==null?void 0:Mr.id)&&Ii._remove(ro);while(ro=ro.next)};if(In(_n,Zt),setTimeout(()=>{ki(),Ye.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Gt(Hi||"educoder.txt",_n.getValue())}})},500),Ye.current.subscription=_n.onDidChangeModelContent(Ii=>{oi.current?clearTimeout(Si.current):(ki(),rn(_n.getValue(),Ii)),Si.current=setTimeout(()=>{oi.current=!1},500)}),window.Monaco||qt(Zt,Nt(He)),pn&&(ji(li,ni),wt.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Ki),window.removeEventListener("paste",Ki),window.addEventListener("keydown",Ki),window.addEventListener("paste",Ki)),window.Monaco=Zt,ze&&_n.onDidBlurEditorWidget(()=>{ze(_n.getValue())}),pi&&_n.onDidFocusEditorText(()=>{pn&&Mt(),pi(_n.getValue())}),pn){Mt();try{_n.onDidPaste(Ii=>{const Ve=_n.getSelection(),vr=Ye.current.pastePos||{},Mr=new Zt.Range(vr.startLineNumber||Ve.endLineNumber,vr.startColumn||Ve.endColumn,vr.endLineNumber||Ve.endLineNumber,vr.endColumn||Ve.endColumn);_n.executeEdits("",[{range:Ii.range,text:""}])})}catch(Ii){}}let Oi=Se();return yi&&typeof yi=="string"&&new xe(yi,_n,Zt),Le(!0),()=>{const Ii=Ye.current.instance;Ii.dispose();const Ve=Ii.getModel();Ve&&Ve.dispose(),Ye.current.subscription&&Ye.current.subscription.dispose(),Oi.unobserve(wt.current)}}catch(_n){}})},[]),(0,gt.useEffect)(()=>{if(Ye.current.instance&&ve)return document.addEventListener("keydown",Dn,!1),()=>{document.removeEventListener("keydown",Dn)}},[an,ve]),(0,gt.useEffect)(()=>{let Nn=Ye.current.instance;if(Nn&&ve){let _n=Nt(He);Zt.editor.setModelLanguage(Nn.getModel(),_n)}},[He,ve]),(0,gt.useEffect)(()=>{Ye.current.instance&&ve&&Zt.editor.setTheme(ri)},[ri,ve]),(0,gt.useEffect)(()=>{let Nn=Ye.current.instance;Zn.current=hn,Nn&&ve&&(Nn.updateOptions(Me({},hn)),setTimeout(()=>{Nn.getModel().updateOptions(Me({},hn))},200))},[JSON.stringify(hn),ve]),(0,gt.useEffect)(()=>{let Nn=Ye.current.instance;Nn&&ve&&Nn.layout()},[we,Ce,ve]);const[me,En]=(0,gt.useState)(fi(we)),[Gn,Re]=(0,gt.useState)(fi(Ce)),$e=vn(Me({},Qe),{width:me,height:Gn,position:"relative"});return gt.createElement("div",{className:"my-monaco-editor",ref:wt,style:$e},We&&gt.createElement(Jt.CopyToClipboard,{text:Fe,onCopy:()=>je.ZP.success("\u590D\u5236\u6210\u529F")},gt.createElement(Je.Z,{title:"\u590D\u5236\u4EE3\u7801"},gt.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},gt.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function Ge({width:Oe="100%",height:Ke="100%",original:we,modified:Ce,language:Fe,options:He={}}){const Qe=(0,gt.useRef)(),[hn,dn]=(0,gt.useState)(null);function ri(Xn){let pn;return Qe.current&&(pn=new Ut.Z(rn=>{for(let In of rn)(In.target.offsetHeight>0||In.target.offsetWidth>0)&&Xn.layout()}),pn.observe(Qe.current)),pn}(0,gt.useEffect)(()=>(Qe.current&&Promise.all([kt.e(8909),kt.e(9404)]).then(kt.bind(kt,2550)).then(Xn=>{Zt=Xn;const pn=Zt.editor.createDiffEditor(Qe.current,vn(Me({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},He),{wordWrap:!0}));dn(pn);let rn=ri(pn);return()=>{pn.dispose();const In=pn.getModel();In&&In.dispose(),rn.unobserve(Qe.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,gt.useEffect)(()=>{hn&&hn.setModel({original:Zt.editor.createModel(we,Fe),modified:Zt.editor.createModel(Ce,Fe)})},[we,Ce,Fe,hn]);const ze=fi(Oe),We=fi(Ke),an={width:ze,height:We};return gt.createElement("div",{className:"my-diff-editor",ref:Qe,style:an})}},10661:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Ae}});var gt={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"},Ut=kt(29787),ue=kt(25399),Ee=kt(92310),he=kt.n(Ee),Dt=kt(51257),ee=kt(28426),ge=kt(48790),Qt=kt(59301),Ae=({className:se,dataSource:Pe=[],col:Bt=4,right:nt,bottom:et=23,precision:ht=0,wrapWidth:st=1200,trackEventItems:pt,loading:vt,onRemove:St=()=>{},isCurrent:Et=!0,showAlias:Tt=!1})=>{const It=Math.floor((st-(Bt-1)*nt)/Bt),qt=[{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 Qt.createElement(Ut.Z,{spinning:vt},Qt.createElement("div",{className:he()(gt.list,se)},!!(Pe!=null&&Pe.length)&&(Pe==null?void 0:Pe.map((Xt,Ht)=>{var pe;const{name:re,id:Ne,identifier:ye,featured:xe,school_name:Ue,image_url:je,excellent:Je,is_plan:fn}=Xt;return Qt.createElement("div",{key:Ne,className:gt.wrap,style:{width:It,marginRight:(1+Ht)%Bt===0?0:nt+ht,marginBottom:et}},Qt.createElement("a",{className:gt.li,onClick:te=>{te.preventDefault(),te.stopPropagation(),pt&&(0,Dt.L9)([pt]),(0,Dt.xg)(`/paths/${ye}`)}},Qt.createElement("div",{className:gt.img},Qt.createElement("img",{className:gt.cover,src:`${je}`}),Et&&(0,ge.bg)()&&(Xt==null?void 0:Xt.studying)&&Qt.createElement("div",{className:`${gt.movebq} user-path-items`,onClick:te=>{te.stopPropagation(),St(Xt)}},Qt.createElement("i",{className:"iconfont icon-yichu1 mr5 c-red"}),Qt.createElement("span",{className:"c-red"},"\u79FB\u9664")),(pe=Xt==null?void 0:Xt.subject_tags)==null?void 0:pe.map((te,Jt)=>{var Xe,On;if(Jt===0){const De=(Xe=qt.find(on=>on.name==te))==null?void 0:Xe.swimg;return Qt.createElement("img",{className:gt.sign,src:De,style:{left:"-4px"}})}const bn=(On=qt.find(De=>De.name==te))==null?void 0:On.ptimg;return Qt.createElement("img",{className:gt.sign,src:bn,style:{left:`${48+52*(Jt-1)+2*Jt}px`}})}),Qt.createElement("div",{style:{position:"absolute",top:"150px",left:"4px"}},(Xt==null?void 0:Xt.excellent)&&Qt.createElement("div",{className:gt.bq},"\u5F00\u653E\u8BFE\u7A0B"))),Qt.createElement("div",{className:gt.name},Qt.createElement(ue.Z,{title:Tt&&(Xt!=null&&Xt.excellent_alias_name)?Qt.createElement("span",null,`\u8BFE\u7A0B\u539F\u540D\uFF1A${re}`,Qt.createElement("br",null),Qt.createElement("span",null,`\u8BFE\u7A0B\u522B\u540D\uFF1A${Xt==null?void 0:Xt.excellent_alias_name}`)):re},Qt.createElement("span",{className:gt.e},Tt&&(Xt==null?void 0:Xt.excellent_alias_name)||re))),Qt.createElement(ue.Z,{title:`\u53D1\u5E03\u5355\u4F4D\uFF1A${Ue}`},Qt.createElement("div",{className:gt.unit},Qt.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),Ue)),Qt.createElement("div",{className:gt.tags},Qt.createElement("div",null,Qt.createElement(ue.Z,{placement:"bottom",title:"\u7AE0\u8282\u6570"},Qt.createElement("span",null,Qt.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),Qt.createElement("span",null,Xt.stages_count))),Qt.createElement(ue.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},Qt.createElement("span",null,Qt.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),Qt.createElement("span",null,Xt.members_count)))))))})),!Pe.length&&Qt.createElement(ee.Z,null)))}},9148:function(Mn,Rn,kt){"use strict";kt.d(Rn,{jL:function(){return he},w9:function(){return Xe},QD:function(){return ze},cQ:function(){return je.Z},op:function(){return Fe},O5:function(){return Zn},_b:function(){return In},t7:function(){return st},Gi:function(){return Kn},YG:function(){return on},qp:function(){return Ae},vr:function(){return Xn},qE:function(){return hn},Je:function(){return St},wb:function(){return Ue},cq:function(){return Rt},tp:function(){return Bt}});var gt=kt(59301),Ut={flex_box_center:"flex_box_center___NeSU8",flex_space_between:"flex_space_between___ImTGl",flex_box_vertical_center:"flex_box_vertical_center___BtRd9",flex_box_center_end:"flex_box_center_end___qcLe3",flex_box_column:"flex_box_column___Ze_3q",banner:"banner___PoUBO",content:"content___XoDjy",btns:"btns___Pb35j"},ue="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==",he=({dataSource:Ln=[],img:zn,imgWidth:oi=346,title:Si,sunTitle:Yi,bannerExtraContent:Fi})=>gt.createElement("div",{className:Ut.banner},gt.createElement("div",{className:Ut.content},gt.createElement("aside",null,gt.createElement("p",null,gt.createElement("b",null,Si),gt.createElement("span",null,Yi)),Ln.length>0&&gt.createElement("div",{className:Ut.btns},Ln.map((ve,Le)=>gt.createElement("div",{key:Le,onClick:ve.click},ve.name,ve.sign?gt.createElement("img",{src:ue,width:39}):null))),Fi),zn&&gt.createElement("img",{style:{marginTop:33,marginRight:38},src:zn,width:oi}))),Dt={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"},ee=kt(92310),ge=kt.n(ee),Qt=kt(89392),Ae=({dataSource:Ln=[],value:zn,onChange:oi,onTitleChange:Si,className:Yi,title:Fi,titleWidth:ve=41,style:Le={},fontColor:Se="#6A7283",showCount:ti})=>{const[Yn,Wn]=(0,gt.useState)(0),[qe,Dn]=(0,gt.useState)(!1),ki=(0,gt.useRef)(null),Di=(0,gt.useRef)(null);return(0,gt.useEffect)(()=>{var Ki;Ln.length!==0&&(((Ki=ki==null?void 0:ki.current)==null?void 0:Ki.clientHeight)>97?Wn(1):Wn(0)),Ln.length===0&&Wn(0),Dn(!1)},[Ln]),gt.createElement("div",{className:ge()(Dt.row,Yi),style:Le},gt.createElement("div",{onClick:(0,Qt.throttle)(()=>Si==null?void 0:Si(),2e3),style:{width:ve,marginTop:qe?12:4},className:`${Dt.title} ${Si?"current":""}`},Fi),gt.createElement("div",{className:qe?`${Dt.tagsWrap} ${Dt.tagsBorderWrap}`:Dt.tagsWrap},gt.createElement("div",{className:Dt.bar,ref:Di,style:Yn>0?{height:Yn===1?97:"auto",overflow:Yn===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},gt.createElement("div",{className:Dt.tag,ref:ki},Ln==null?void 0:Ln.map(Ki=>gt.createElement("span",{onClick:()=>oi(Ki.id),key:Ki.id,style:{color:Se},className:zn===Ki.id?Dt.active:""},gt.createElement("span",{title:Ki.name,className:Dt.name},Ki.name),!!ti&&gt.createElement("span",{className:Dt.num},Ki.count))))),!!Yn&&gt.createElement(gt.Fragment,null,Yn===1?gt.createElement("div",{onClick:()=>{var Ki;Wn(2),((Ki=ki==null?void 0:ki.current)==null?void 0:Ki.clientHeight)>245?Dn(!0):Dn(!1)},className:Dt.action},"\u5C55\u5F00",gt.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):gt.createElement("div",{onClick:()=>{Di.current.scrollTop=0,Wn(1),Dn(!1)},className:Dt.action},"\u6536\u8D77",gt.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},se={flex_box_center:"flex_box_center___aK2n3",flex_space_between:"flex_space_between___HX0Oh",flex_box_vertical_center:"flex_box_vertical_center___LJOJr",flex_box_center_end:"flex_box_center_end___SCakF",flex_box_column:"flex_box_column___AYv4m",tabs:"tabs___GTqPV",active:"active___F26E8"},Bt=({dataSource:Ln=[],value:zn,onChange:oi,className:Si,style:Yi={}})=>gt.createElement("div",{style:Yi,className:ge()(se.tabs,Si)},Ln.map(Fi=>gt.createElement("span",{onClick:()=>oi(Fi.id),className:zn===Fi.id?se.active:"",key:Fi.id},Fi.name))),nt={flex_box_center:"flex_box_center___yX6Oa",flex_space_between:"flex_space_between___t7oqF",flex_box_vertical_center:"flex_box_vertical_center___dEIHy",flex_box_center_end:"flex_box_center_end___taQDF",flex_box_column:"flex_box_column___xY_Lr",input:"input___PW2zI",dropdown:"dropdown___vSy8B",menu:"menu___NiyBu",text:"text___Grueu",b1:"b1___ZKryM",b2:"b2___aKyGa"},et=kt(37568),st=({dataSource:Ln=[],value:zn="",onChange:oi,onInputChange:Si=()=>{},className:Yi,style:Fi={},placeholder:ve,allowClear:Le=!1})=>{var Se;const[ti,Yn]=(0,gt.useState)(""),[Wn,qe]=(0,gt.useState)("");(0,gt.useEffect)(()=>{var Di;let Ki=zn;(Di=JSON.stringify(zn))!=null&&Di.includes("{")&&(Yn(zn.id),Ki=zn.value||"");try{qe(decodeURIComponent(Ki||""))}catch(Gt){qe(decodeURIComponent(Ki||""))}},[zn]);const Dn=()=>{oi(encodeURIComponent(Wn),ti||null)},ki=Di=>{Di!==ti&&(Yn(Di),oi(encodeURIComponent(Wn),Di))};return gt.createElement("div",{className:ge()(nt.input,Yi),style:Fi},!!Ln.length&&gt.createElement("div",{className:nt.dropdown},gt.createElement("div",{className:nt.text},(Se=Ln.find(Di=>Di.id===ti))==null?void 0:Se.name,gt.createElement("i",{className:"iconfont icon-zhankai4"}),gt.createElement("b",{className:nt.b1}),gt.createElement("b",{className:nt.b2})),gt.createElement("div",{className:nt.menu},Ln.map((Di,Ki)=>gt.createElement("div",{key:Ki,onClick:()=>ki(Di.id)},Di.name)))),gt.createElement(et.default,{onPressEnter:Dn,value:Wn,onChange:Di=>{qe(Di.target.value),Si(encodeURIComponent(Di.target.value),ti||null)},bordered:!1,placeholder:ve}),gt.createElement("i",{onClick:Dn,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"},St=({value:Ln,onChange:zn,className:oi,total:Si,pageSize:Yi,style:Fi={}})=>{const ve=Ln<2,Le=Ln>=Math.ceil(Si/Yi);return Si<=Yi?gt.createElement(gt.Fragment,null):gt.createElement("div",{className:ge()(pt.quickPager,oi),style:Fi},gt.createElement("div",{onClick:()=>{ve||zn(Ln-1,"prev")},className:ve?pt.disabled:""},"\u4E0A\u4E00\u9875"),gt.createElement("div",{onClick:()=>{Le||zn(Ln+1,"next")},className:Le?pt.disabled:""},"\u4E0B\u4E00\u9875"))},Et={flex_box_center:"flex_box_center___FO7TP",flex_space_between:"flex_space_between___LotYx",flex_box_vertical_center:"flex_box_vertical_center___bWdaw",flex_box_center_end:"flex_box_center_end___mVJ1o",flex_box_column:"flex_box_column___M83Mm",list:"list___oOsiS",wrap:"wrap___G6T7F",lockWrap:"lockWrap___Rl79E",li:"li___oZZ7l",cover:"cover___b2bYW",img:"img___IQX7w",sign:"sign___HkT6C",name:"name___SsJx8",e:"e___TMqq0",tags:"tags___bcjyo",rate:"rate___YACg7"},Tt=kt(29787),It=kt(25399),qt=kt(58018),Xt=kt(346),Ht=kt(51257),pe=kt(96908),re=kt(57177),Ne=kt(81378),ye=kt(28426),Ue=({className:Ln,dataSource:zn=[],col:oi=4,right:Si,bottom:Yi=23,precision:Fi=0,wrapWidth:ve=1200,trackEventItems:Le,loading:Se})=>{const ti=Math.floor((ve-(oi-1)*Si)/oi);return gt.createElement(Tt.Z,{spinning:Se},gt.createElement("div",{className:ge()(Et.list,Ln)},!!zn.length&&zn.map((Yn,Wn)=>{const{name:qe,id:Dn,identifier:ki,power:Di,cover_image_id:Ki,pic:Gt}=Yn;return gt.createElement("div",{className:Et.wrap,key:Dn,style:{width:ti,marginRight:(1+Wn)%oi===0?0:Si+Fi,marginBottom:Yi}},gt.createElement("a",{target:"_blank",href:`/shixuns/${ki}/challenges`,className:Et.li,onClick:me=>{me.preventDefault(),Le&&(0,Ht.L9)([Le]),Di&&(0,Ht.xg)(`/shixuns/${ki}/challenges`)}},gt.createElement("div",{className:Et.img},gt.createElement("img",{className:Et.cover,src:`${Gt}`}),Yn.is_jupyter&&gt.createElement("img",{className:Et.sign,src:pe}),Yn.is_jupyter_lab&&gt.createElement("img",{className:Et.sign,src:re}),Yn.is_unity_3d&&gt.createElement("img",{className:Et.sign,src:Ne})),gt.createElement("div",{className:Et.name},gt.createElement(It.Z,{title:qe||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},gt.createElement("span",{className:Et.e},qe||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),gt.createElement("div",{className:Et.tags},gt.createElement(It.Z,{placement:"bottom",title:"\u5173\u5361\u6570"},gt.createElement("span",null,gt.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr2"}),gt.createElement("span",null,Yn.challenges_count))),!!Yn.myshixuns_count&&gt.createElement(It.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},gt.createElement("span",null,gt.createElement("i",{className:"iconfont icon-chengyuan font14 mr2"}),gt.createElement("span",null,Yn.myshixuns_count))),gt.createElement(It.Z,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},gt.createElement("span",null,gt.createElement("span",null,Yn.level))),gt.createElement("div",{className:Et.rate},gt.createElement(qt.Z,{allowHalf:!0,disabled:!0,defaultValue:Yn.score_info}),gt.createElement("span",null,"\xA0",Yn.score_info?`${Yn.score_info}\u5206`:"5\u5206")))),!Di&&gt.createElement("div",{className:Et.lockWrap},gt.createElement("img",{src:`${Xt.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),gt.createElement("span",{className:"mt15 font16 c-white"},"\u5B9A\u5411\u5F00\u653E\u5185\u5BB9\uFF0C\u9700\u8981\u6388\u6743")))}),!zn.length&&gt.createElement(ye.Z,null)))},je=kt(10661),Je={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"},fn="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",te=kt(59301),Xe=({className:Ln,dataSource:zn=[],col:oi=4,right:Si,bottom:Yi=23,precision:Fi=0,wrapWidth:ve=1200,trackEventItems:Le,loading:Se,handleVery:ti=()=>!0})=>{const Yn=Math.floor((ve-(oi-1)*Si)/oi);return te.createElement(Tt.Z,{spinning:Se},te.createElement("div",{className:ge()(Je.list,Ln)},!!zn.length&&zn.map((Wn,qe)=>{const{subject_identifier:Dn,id:ki,identifier:Di,power:Ki}=Wn,Gt=Wn.is_public!=0&&Wn.is_public;return te.createElement("div",{className:Je.wrap,key:ki,style:{width:Yn,marginRight:(1+qe)%oi===0?0:Si+Fi,marginBottom:Yi}},te.createElement("a",{className:Je.li,onClick:me=>{me.preventDefault(),ti(Wn==null?void 0:Wn.first_category_url)&&(Le&&(0,Ht.L9)([Le]),(0,Ht.xg)(Wn.first_category_url))}},te.createElement("div",{className:Je.top},te.createElement(It.Z,{title:Wn.name},te.createElement("div",{className:Je.name},Wn.name)),te.createElement("img",{className:Je.img,src:Xt.Z.IMG_SERVER+"/images/"+Wn.avatar_url}),te.createElement("div",{className:Je.text,title:Wn.creator},Wn.creator),Dn&&te.createElement("div",{className:Je.btns},te.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),te.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),Gt&&te.createElement("div",{className:Je.sign},"\u516C\u5F00")),te.createElement("div",{className:Je.bottom},Wn.visits>0&&te.createElement(It.Z,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},te.createElement("span",null,te.createElement("i",{className:"iconfont icon-liulanyan"}),te.createElement("span",null,Wn.visits))),Wn.course_members_count>0&&te.createElement(It.Z,{title:"\u6210\u5458",placement:"bottom"},te.createElement("span",null,te.createElement("i",{className:"iconfont icon-chengyuan"}),Wn.course_members_count)),Wn.tasks_count>0&&te.createElement(It.Z,{title:"\u4F5C\u4E1A",placement:"bottom"},te.createElement("span",null,te.createElement("i",{className:"iconfont icon-zuoye"}),Wn.tasks_count)),Wn.is_end?te.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):te.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),!Wn.is_accessible&&te.createElement("div",{className:Je.lockWrap},te.createElement("img",{src:`${Xt.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),te.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165")))}),!zn.length&&te.createElement(ye.Z,null)))},On={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"},bn=kt(25690),on=({dataSource:Ln=[],value:zn,onChange:oi,className:Si,style:Yi={},tabBarExtraContent:Fi})=>gt.createElement("div",{className:ge()(On.tabs,Si),style:Yi},gt.createElement("div",{className:On.tabsWrap},Ln.map((ve,Le)=>!(ve!=null&&ve.hide)&&gt.createElement("aside",{className:On.tab,onClick:()=>{oi(ve.id),ve.link&&bn.history.push(ve.link)},key:Le},gt.createElement("div",{className:zn===ve.id?On.active:""},ve.name),(ve==null?void 0:ve.resetCount)==null&&(ve==null?void 0:ve.total)!==void 0&&gt.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&&gt.createElement(It.Z,{title:(ve==null?void 0:ve.tip)!=null?ve==null?void 0:ve.tip:""},gt.createElement("span",{style:{color:"#9096A3"}},"\uFF08",gt.createElement("span",{style:{color:"#000"}},ve==null?void 0:ve.resetCount),"/",gt.createElement("span",null,ve==null?void 0:ve.total),"\uFF09"))))),gt.createElement("div",{className:On.tabBar},Fi)),Kn=({className:Ln,style:zn={},children:oi})=>gt.createElement("div",{className:ge()(Ln),style:zn},oi),Me={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"},vn=kt(75727),ne=kt(93041);const wn=[{id:"updated_at",name:"\u6700\u65B0\u52A8\u6001"},{id:"created_at",name:"\u6700\u65B0\u521B\u5EFA"},{id:"name",name:"\u540D\u79F0\u6392\u5E8F"}];var Rt=({sortValue:Ln,dropValue:zn,className:oi,onSort:Si,onDrop:Yi,dataSource:Fi=wn})=>{var ve;return gt.createElement("div",{className:ge()(Me.orderWrap,oi)},gt.createElement(vn.Z,{dropdownRender:()=>gt.createElement(ne.default,null,Fi.map((Le,Se)=>gt.createElement(ne.default.Item,{key:Se,onClick:()=>Yi(Le.id)},Le.name)))},gt.createElement("span",{className:Me.orderTextWrap},(ve=Fi.find(Le=>zn===Le.id))==null?void 0:ve.name)),gt.createElement("span",{className:Me.orderIconWrap},gt.createElement("span",{className:Me.orderAsc},gt.createElement("i",{className:Ln==="asc"?`iconfont icon-sanjiaoxing-up font12 ${Me.cursorPointer} ${Me.active}`:`iconfont icon-sanjiaoxing-up font12 ${Me.cursorPointer}`,onClick:()=>Si(Ln==="asc"?"desc":"asc")})),gt.createElement("span",{className:Me.orderDesc},gt.createElement("i",{className:Ln==="desc"?`iconfont icon-sanjiaoxing-down font12 ${Me.cursorPointer} ${Me.active}`:`iconfont icon-sanjiaoxing-down font12 ${Me.cursorPointer}`,onClick:()=>Si(Ln==="asc"?"desc":"asc")}))))},Lt={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"},Pt=kt(99571),Nt=Object.defineProperty,Zt=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,Ge=(Ln,zn,oi)=>zn in Ln?Nt(Ln,zn,{enumerable:!0,configurable:!0,writable:!0,value:oi}):Ln[zn]=oi,Oe=(Ln,zn)=>{for(var oi in zn||(zn={}))Mt.call(zn,oi)&&Ge(Ln,oi,zn[oi]);if(Zt)for(var oi of Zt(zn))Yt.call(zn,oi)&&Ge(Ln,oi,zn[oi]);return Ln},Ke=(Ln,zn)=>{var oi={};for(var Si in Ln)Mt.call(Ln,Si)&&zn.indexOf(Si)<0&&(oi[Si]=Ln[Si]);if(Ln!=null&&Zt)for(var Si of Zt(Ln))zn.indexOf(Si)<0&&Yt.call(Ln,Si)&&(oi[Si]=Ln[Si]);return oi},we=(Ln,zn,oi)=>new Promise((Si,Yi)=>{var Fi=Se=>{try{Le(oi.next(Se))}catch(ti){Yi(ti)}},ve=Se=>{try{Le(oi.throw(Se))}catch(ti){Yi(ti)}},Le=Se=>Se.done?Si(Se.value):Promise.resolve(Se.value).then(Fi,ve);Le((oi=oi.apply(Ln,zn)).next())}),Fe=Ln=>{var zn=Ln,{className:oi,style:Si,children:Yi,loading:Fi=!1,openLoading:ve,onClick:Le=()=>{},size:Se="middle",shape:ti="round"}=zn,Yn=Ke(zn,["className","style","children","loading","openLoading","onClick","size","shape"]);const[Wn,qe]=(0,gt.useState)(!1);return gt.createElement(Pt.ZP,Oe({onClick:(0,Qt.throttle)(Dn=>we(void 0,null,function*(){ve&&qe(!0);try{yield Le(Dn)}catch(ki){console.log("error",ki)}ve&&qe(!1)}),2e3,{leading:!0,trailing:!1}),className:ge()(Lt.btn,Lt[`${Se}-${ti}`],oi),style:Si,size:Se,shape:ti,loading:Wn||Fi},Yn),Yi)},He={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"},hn=({className:Ln,style:zn,children:oi=null,onClick:Si,title:Yi})=>gt.createElement("div",{className:ge()(He.head,Ln),style:zn},gt.createElement("span",{className:"primary-hover",onClick:Si},gt.createElement("i",{className:"iconfont icon-fanhui2 font12"}),"\u8FD4\u56DE"),gt.createElement("b",{title:Yi},Yi),gt.createElement("div",{className:He.node},oi)),dn={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"},ze=({confirmShow:Ln=!0,confirmTitle:zn,confirmClick:oi,cancelShow:Si=!0,cancelTitle:Yi,cancelClick:Fi,className:ve,style:Le,confirmLoading:Se=!1})=>gt.createElement("div",{className:ge()(dn.btns,ve),style:Le},Ln&&gt.createElement(Pt.ZP,{loading:Se,onClick:oi,type:"primary",className:dn.confirm},zn),Si&&gt.createElement(Pt.ZP,{onClick:Fi,className:dn.cancel},Yi)),We={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"},Xn=({className:Ln,style:zn={},LeftContent:oi,children:Si,RightContent:Yi})=>gt.createElement("div",{className:ge()(We.fixedBottom,Ln),style:zn},gt.createElement("div",{className:We.wrap},gt.createElement("div",{className:We.left},oi),gt.createElement("div",{className:We.center},Si),gt.createElement("div",{className:We.right},Yi))),pn={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"},In=({className:Ln,style:zn={},dataSource:oi=[]})=>gt.createElement("div",{className:ge()(pn.crumbs,Ln),style:zn},oi.map((Si,Yi)=>Yi<oi.length-1?gt.createElement(gt.Fragment,{key:Yi},Si.path||Si.onClick?gt.createElement("span",{className:pn.hover,onClick:Si!=null&&Si.onClick?Si.onClick:()=>bn.history.push(Si.path)},Si.name):gt.createElement("span",null,Si.name),gt.createElement("span",null,"\xA0",">","\xA0")):gt.createElement("span",{key:Yi,style:{color:"#5F6368"}},Si.name))),pi=kt(11938),ei=Object.defineProperty,mi=Object.defineProperties,Hi=Object.getOwnPropertyDescriptors,Cn=Object.getOwnPropertySymbols,Sn=Object.prototype.hasOwnProperty,Bn=Object.prototype.propertyIsEnumerable,si=(Ln,zn,oi)=>zn in Ln?ei(Ln,zn,{enumerable:!0,configurable:!0,writable:!0,value:oi}):Ln[zn]=oi,yi=(Ln,zn)=>{for(var oi in zn||(zn={}))Sn.call(zn,oi)&&si(Ln,oi,zn[oi]);if(Cn)for(var oi of Cn(zn))Bn.call(zn,oi)&&si(Ln,oi,zn[oi]);return Ln},hi=(Ln,zn)=>mi(Ln,Hi(zn)),Gi=(Ln,zn)=>{var oi={};for(var Si in Ln)Sn.call(Ln,Si)&&zn.indexOf(Si)<0&&(oi[Si]=Ln[Si]);if(Ln!=null&&Cn)for(var Si of Cn(Ln))zn.indexOf(Si)<0&&Bn.call(Ln,Si)&&(oi[Si]=Ln[Si]);return oi};const{Countdown:wt}=pi.default;var Zn=Ln=>{var zn=Ln,{onChange:oi}=zn,Si=Gi(zn,["onChange"]);const[Yi,Fi]=(0,gt.useState)(null);(0,gt.useEffect)(()=>{typeof Yi=="number"&&Yi>=0&&oi(Yi)},[Yi]);const ve=Le=>{const Se=Math.floor(Le/1e3);Fi(Se)};return gt.createElement(wt,hi(yi({},Si),{onChange:ve}))}},37808:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Ut}});var gt=kt(59301);function Ut(ue,Ee){const he=(0,gt.useRef)();(0,gt.useEffect)(()=>{he.current=ue}),(0,gt.useEffect)(()=>{function Dt(){he.current()}if(Ee!==null){let ee=setInterval(Dt,Ee);return()=>clearInterval(ee)}},[Ee])}},37345:function(Mn,Rn,kt){"use strict";kt.d(Rn,{h:function(){return gt}});var gt=(Ut=>(Ut[Ut.NOMATCH=-1]="NOMATCH",Ut[Ut.OK=0]="OK",Ut[Ut.TIMEOUT=2]="TIMEOUT",Ut[Ut.PODFAILURE=3]="PODFAILURE",Ut[Ut.COMPILEFAILURE=4]="COMPILEFAILURE",Ut[Ut.EXECUTEFAILURE=5]="EXECUTEFAILURE",Ut[Ut.HIDE_COMPILE_STATUS=11]="HIDE_COMPILE_STATUS",Ut))(gt||{})},81072:function(Mn,Rn,kt){"use strict";kt.d(Rn,{H7:function(){return nt},MK:function(){return Bt},MU:function(){return jt},X6:function(){return se},bM:function(){return Qt},fi:function(){return et},fu:function(){return ge},n4:function(){return ht},rX:function(){return Pe},vl:function(){return st},zO:function(){return Ae}});var gt=kt(38986),Ut=Object.defineProperty,ue=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable,Dt=(pt,vt,St)=>vt in pt?Ut(pt,vt,{enumerable:!0,configurable:!0,writable:!0,value:St}):pt[vt]=St,ee=(pt,vt)=>{for(var St in vt||(vt={}))Ee.call(vt,St)&&Dt(pt,St,vt[St]);if(ue)for(var St of ue(vt))he.call(vt,St)&&Dt(pt,St,vt[St]);return pt};function ge(pt,vt){return(0,gt.U2)(`myproblems/${pt}.json`,ee({hidePopLogin:!0},vt||{}))}function Qt(pt,vt){return(0,gt.v_)(`myproblems/${pt}/code_submit.json`,vt)}function jt(pt,vt){return(0,gt.v_)(`myproblems/${pt}/code_debug.json`,vt)}function Ae(pt,vt){return vt.language&&(vt.language=encodeURIComponent(vt.language)),(0,gt.U2)(`myproblems/${pt}/submit_records.json`,vt)}function se(pt){return(0,gt.U2)("myproblems/record_detail.json",{id:pt})}function Pe(pt,vt){return(0,gt.U2)(`myproblems/${pt}/result.json`,{mode:vt})}function Bt(pt,vt){return(0,gt.v_)(`myproblems/${pt}/add_notes.json`,vt)}function nt(pt,vt){return(0,gt.v_)(`myproblems/${pt}/restore_initial_code.json`,vt)}function et(pt){return(0,gt.v_)(`myproblems/${pt}/sync_code.json`)}function ht(pt,vt){return(0,gt.v_)(`myproblems/${pt}/update_code.json`,vt)}function st(pt,vt){return(0,gt.v_)(`discusses/${pt}/plus.json`,vt)}},43554:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Ta}});var gt=kt(59301),Ut={flex_box_center:"flex_box_center___bZaL5",flex_space_between:"flex_space_between___oaJSq",flex_box_vertical_center:"flex_box_vertical_center____hsuP",flex_box_center_end:"flex_box_center_end___ZYbPQ",flex_box_column:"flex_box_column___nE_62",wrap:"wrap___ulhwR",left:"left___kyWln",title:"title___jsO1D",total:"total___GEhiU",list:"list___u9dBZ",name:"name___Wxggs",b:"b___Y15YO",r:"r___mKQoe",l:"l___uelFD",tag:"tag___Mpkbg",right:"right___mQ3dU",examName:"examName___Na1r8",t:"t___IgCWK",num:"num___CXI8j",topWarp:"topWarp___Kicpu",head:"head___jx3W8",so:"so___qYW7F",btn:"btn___EMJDz",content:"content___sHGsV",titleWrap:"titleWrap___I__GR",single:"single___K5iv9",analysis:"analysis___NoAuR",text:"text___xESW2",modalColumn:"modalColumn___I_tK_",modalRow:"modalRow___lyw_U",sup:"sup___HSz3Z",popover:"popover___kE8aI",btn_warp:"btn_warp___fOE2S"},ue=kt(28284),Ee=kt(25399),he=kt(99571),Dt=kt(62957),ee=kt(71051),ge=kt(6767),Qt=kt(37568),jt=kt(37285),Ae=kt(62673),se=kt(37639),Pe=kt(77019),Bt=kt(5269),nt=kt(13747),et=Object.defineProperty,ht=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,vt=(ae,Ie,_t)=>Ie in ae?et(ae,Ie,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Ie]=_t,St=(ae,Ie)=>{for(var _t in Ie||(Ie={}))st.call(Ie,_t)&&vt(ae,_t,Ie[_t]);if(ht)for(var _t of ht(Ie))pt.call(Ie,_t)&&vt(ae,_t,Ie[_t]);return ae};const Et=ae=>React.createElement("svg",St({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},ae),React.createElement("title",null,"\u7F16\u7EC4 6"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("rect",{fill:"#E4E6FD",width:34,height:34,rx:10}),React.createElement("g",{fillRule:"nonzero"},React.createElement("path",{d:"M13.808 11.448a.558.558 0 0 1 0 .788l-1.564 1.565a.558.558 0 1 1-.789-.79l1.564-1.563a.558.558 0 0 1 .79 0Zm9.882 2.462a.558.558 0 0 1-.789 0l-1.564-1.563a.558.558 0 1 1 .789-.789l1.564 1.564a.556.556 0 0 1 0 .788Z",fill:"#6678EB"}),React.createElement("path",{d:"M21.753 21.707a5.937 5.937 0 1 0-8.58.015l-.937.936a.558.558 0 1 0 .789.788l.995-.994a5.91 5.91 0 0 0 3.436 1.095c1.287 0 2.48-.41 3.452-1.106l.992.992a.558.558 0 1 0 .789-.789l-.936-.937Z",fill:"#6678EB"}),React.createElement("path",{d:"m20.858 18.95-3.024-1.745v-2.054a.558.558 0 1 0-1.117 0v2.351c0 .064.011.126.031.184a.551.551 0 0 0 .258.33l3.293 1.9a.557.557 0 0 0 .559-.966Z",fill:"#FFF"}))));var Tt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTRFNkZEIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0iTTEzLjgwOCAxMS40NDhhLjU1OC41NTggMCAwIDEgMCAuNzg4bC0xLjU2NCAxLjU2NWEuNTU4LjU1OCAwIDEgMS0uNzg5LS43OWwxLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDAgMSAuNzkgMFptOS44ODIgMi40NjJhLjU1OC41NTggMCAwIDEtLjc4OSAwbC0xLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDEgMSAuNzg5LS43ODlsMS41NjQgMS41NjRhLjU1Ni41NTYgMCAwIDEgMCAuNzg4WiIgZmlsbD0iIzY2NzhFQiIvPjxwYXRoIGQ9Ik0yMS43NTMgMjEuNzA3YTUuOTM3IDUuOTM3IDAgMSAwLTguNTguMDE1bC0uOTM3LjkzNmEuNTU4LjU1OCAwIDEgMCAuNzg5Ljc4OGwuOTk1LS45OTRhNS45MSA1LjkxIDAgMCAwIDMuNDM2IDEuMDk1YzEuMjg3IDAgMi40OC0uNDEgMy40NTItMS4xMDZsLjk5Mi45OTJhLjU1OC41NTggMCAxIDAgLjc4OS0uNzg5bC0uOTM2LS45MzdaIiBmaWxsPSIjNjY3OEVCIi8+PHBhdGggZD0ibTIwLjg1OCAxOC45NS0zLjAyNC0xLjc0NXYtMi4wNTRhLjU1OC41NTggMCAxIDAtMS4xMTcgMHYyLjM1MWMwIC4wNjQuMDExLjEyNi4wMzEuMTg0YS41NTEuNTUxIDAgMCAwIC4yNTguMzNsMy4yOTMgMS45YS41NTcuNTU3IDAgMCAwIC41NTktLjk2NloiIGZpbGw9IiNGRkYiLz48L2c+PC9nPjwvc3ZnPg==",It=kt(76902),qt=kt(25690),Xt=kt(51257),Ht=kt(38986),pe=Object.defineProperty,re=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,xe=(ae,Ie,_t)=>Ie in ae?pe(ae,Ie,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Ie]=_t,Ue=(ae,Ie)=>{for(var _t in Ie||(Ie={}))Ne.call(Ie,_t)&&xe(ae,_t,Ie[_t]);if(re)for(var _t of re(Ie))ye.call(Ie,_t)&&xe(ae,_t,Ie[_t]);return ae};const je=ae=>React.createElement("svg",Ue({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},ae),React.createElement("title",null,"\u7F16\u7EC4 12"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("rect",{width:34,height:34,rx:10,fill:"#EAF3F4"}),React.createElement("path",{d:"M25.905 15.37a.775.775 0 0 0-.626-.529l-4.814-.7-2.152-4.362a.776.776 0 0 0-1.392 0l-2.153 4.363-4.814.699a.775.775 0 0 0-.43 1.323l3.484 3.396-.823 4.794a.777.777 0 0 0 1.126.818l4.306-2.264 4.305 2.264a.778.778 0 0 0 .817-.059.777.777 0 0 0 .31-.759l-.823-4.794 3.483-3.396a.777.777 0 0 0 .196-.795Z",fill:"#21C0A6",fillRule:"nonzero"})));var Je="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIgZmlsbD0iI0VBRjNGNCIvPjxwYXRoIGQ9Ik0yNS45MDUgMTUuMzdhLjc3NS43NzUgMCAwIDAtLjYyNi0uNTI5bC00LjgxNC0uNy0yLjE1Mi00LjM2MmEuNzc2Ljc3NiAwIDAgMC0xLjM5MiAwbC0yLjE1MyA0LjM2My00LjgxNC42OTlhLjc3NS43NzUgMCAwIDAtLjQzIDEuMzIzbDMuNDg0IDMuMzk2LS44MjMgNC43OTRhLjc3Ny43NzcgMCAwIDAgMS4xMjYuODE4bDQuMzA2LTIuMjY0IDQuMzA1IDIuMjY0YS43NzguNzc4IDAgMCAwIC44MTctLjA1OS43NzcuNzc3IDAgMCAwIC4zMS0uNzU5bC0uODIzLTQuNzk0IDMuNDgzLTMuMzk2YS43NzcuNzc3IDAgMCAwIC4xOTYtLjc5NVoiIGZpbGw9IiMyMUMwQTYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4=",fn=Object.defineProperty,te=Object.getOwnPropertySymbols,Jt=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,On=(ae,Ie,_t)=>Ie in ae?fn(ae,Ie,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Ie]=_t,bn=(ae,Ie)=>{for(var _t in Ie||(Ie={}))Jt.call(Ie,_t)&&On(ae,_t,Ie[_t]);if(te)for(var _t of te(Ie))Xe.call(Ie,_t)&&On(ae,_t,Ie[_t]);return ae};const De=ae=>React.createElement("svg",bn({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},ae),React.createElement("title",null,"\u9898\u76EE"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("rect",{fill:"#E7F3FF",width:34,height:34,rx:10}),React.createElement("g",{fill:"#4C6FFF",fillRule:"nonzero"},React.createElement("path",{d:"m23.719 13.325-4.098-3.94c-.097-.13-.225-.162-.355-.162-.129 0-.258.064-.387.161l-7.55 7.753c-.065.065-.098.162-.13.227l-1.032 5.427c-.033.194.032.323.16.484.13.13.227.162.389.162h.096l4.776-1.099c.097-.032.194-.064.258-.161l7.841-8.108c.194-.162.194-.517.033-.744h-.001Zm-8.1 8.044a.534.534 0 0 1-.386.162.56.56 0 0 1-.388-.162l-3-2.81c-.226-.194-.226-.517-.033-.743.194-.227.517-.227.743-.033l3 2.811c.259.226.291.55.065.776ZM17 22.92h6.844v1.055H17z"}))));var on="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTdGM0ZGIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGw9IiM0QzZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0ibTIzLjcxOSAxMy4zMjUtNC4wOTgtMy45NGMtLjA5Ny0uMTMtLjIyNS0uMTYyLS4zNTUtLjE2Mi0uMTI5IDAtLjI1OC4wNjQtLjM4Ny4xNjFsLTcuNTUgNy43NTNjLS4wNjUuMDY1LS4wOTguMTYyLS4xMy4yMjdsLTEuMDMyIDUuNDI3Yy0uMDMzLjE5NC4wMzIuMzIzLjE2LjQ4NC4xMy4xMy4yMjcuMTYyLjM4OS4xNjJoLjA5Nmw0Ljc3Ni0xLjA5OWMuMDk3LS4wMzIuMTk0LS4wNjQuMjU4LS4xNjFsNy44NDEtOC4xMDhjLjE5NC0uMTYyLjE5NC0uNTE3LjAzMy0uNzQ0aC0uMDAxWm0tOC4xIDguMDQ0YS41MzQuNTM0IDAgMCAxLS4zODYuMTYyLjU2LjU2IDAgMCAxLS4zODgtLjE2MmwtMy0yLjgxYy0uMjI2LS4xOTQtLjIyNi0uNTE3LS4wMzMtLjc0My4xOTQtLjIyNy41MTctLjIyNy43NDMtLjAzM2wzIDIuODExYy4yNTkuMjI2LjI5MS41NS4wNjUuNzc2Wk0xNyAyMi45Mmg2Ljg0NHYxLjA1NUgxN3oiLz48L2c+PC9nPjwvc3ZnPg==",un=kt(12327),Kn=kt(39793),Me=kt(61011),vn=kt(30371),ne={wrap:"wrap___OIoOI",modal:"modal___Z3hfU",titleWrap:"titleWrap___aK3oG",required:"required___NHoO7",title:"title___uxb1R",colorGray:"colorGray___O8YPg",choiceWrap:"choiceWrap___t51sb",answer:"answer___vsBnh",activeAnswer:"activeAnswer___AJN4p",deleteIcon:"deleteIcon___WvOJZ",addIcon:"addIcon___UyeIs",editorWrap:"editorWrap___uqcFU",htmlWrap:"htmlWrap___GcBNL",radio:"radio___e8qQ5",color333:"color333___PLzVK",color999:"color999___v3EY0",fold:"fold___OfvPe",head:"head___EejYX",collapseWrapper:"collapseWrapper___sQyVD",panelHeader:"panelHeader___Ivicf",open:"open___aEOQE",close:"close___z4P5H",inputBorder:"inputBorder___ix67O",keywordTag:"keywordTag___iGx08",scoreByBlankRadio:"scoreByBlankRadio___Kwu7q"},wn=kt(59301),fi=Object.defineProperty,Rt=Object.defineProperties,Lt=Object.getOwnPropertyDescriptors,Pt=Object.getOwnPropertySymbols,Nt=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable,Mt=(ae,Ie,_t)=>Ie in ae?fi(ae,Ie,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Ie]=_t,Yt=(ae,Ie)=>{for(var _t in Ie||(Ie={}))Nt.call(Ie,_t)&&Mt(ae,_t,Ie[_t]);if(Pt)for(var _t of Pt(Ie))Zt.call(Ie,_t)&&Mt(ae,_t,Ie[_t]);return ae},Ge=(ae,Ie)=>Rt(ae,Lt(Ie)),Oe=(ae,Ie)=>{var _t={};for(var ce in ae)Nt.call(ae,ce)&&Ie.indexOf(ce)<0&&(_t[ce]=ae[ce]);if(ae!=null&&Pt)for(var ce of Pt(ae))Ie.indexOf(ce)<0&&Zt.call(ae,ce)&&(_t[ce]=ae[ce]);return _t};const Ke=null,we=(ae,Ie)=>{var _t=ae,{globalSetting:ce,loading:Gr,dispatch:Sr,isEdit:kr,editData:ur}=_t,wr=Oe(_t,["globalSetting","loading","dispatch","isEdit","editData"]);const[vo,Xr]=(0,gt.useState)(""),[Ir,Ui]=(0,gt.useState)(""),[eo,Vi]=(0,gt.useState)([]),[ar,Qi]=(0,gt.useState)(""),[br,Fr]=(0,gt.useState)(),[Dr,no]=(0,gt.useState)(!1),[Zi,Br]=(0,gt.useState)({}),[Pi,$i]=(0,gt.useState)([]);(0,gt.useEffect)(()=>{!ur||!kr||(Xr(ur==null?void 0:ur.name),Ui(ur==null?void 0:ur.analysis),Fr(ur==null?void 0:ur.is_ordered),Br(ur),no(!0))},[ur]),(0,gt.useEffect)(()=>{if(!Dr)return;const co=ur==null?void 0:ur.standard_answer.map(ea=>ea==null?void 0:ea.answer_text);Vi(co);const Ar=ur==null?void 0:ur.standard_answer.map(ea=>ea==null?void 0:ea.score);$i(Ar),no(!1)},[Dr]),(0,gt.useImperativeHandle)(Ie,()=>({onSave:pr,Clear:uo}));const pr=()=>{let co=[],Ar=!1;return vo?(eo.forEach((ea,Zo)=>{co.push({position:Zo+1,answer_text:[],score:Pi[Zo]}),ea==null||ea.forEach((Fa,Al)=>{co[Zo].answer_text.push(Fa),(!Fa||!(0,Xt.eR)(Fa,1e4))&&(Qi(`${Zo}-${Al}`),ge.ZP.info(Fa?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Ar=!0)})}),Ar?!1:(co==null?void 0:co.length)>20?(ge.ZP.warning("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:vo,analysis:Ir,standard_answers:co,is_ordered:br,downcase:Zi==null?void 0:Zi.downcase,no_space:Zi==null?void 0:Zi.no_space,use_blank_score:Zi==null?void 0:Zi.use_blank_score}):(ge.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},uo=()=>{Xr(""),Ui(""),Vi([]),Fr(!1)},yo=(co,Ar,ea)=>{const Zo=eo.slice();if(Ar&&Zo.splice(co,Ar),ea)for(let Fa=0;Fa<ea;Fa++)Zo.splice(co+Fa,0,[""]);Vi(Zo)},Ro=(co,Ar,ea)=>{Qi("");let Zo=eo.slice();Zo[co][Ar]=ea,Vi(Zo)},qi=co=>{let Ar=eo.slice();Ar[co]=[...Ar[co],""],Vi(Ar)},Ia=(co,Ar)=>{let ea=eo.slice();if(!ea[co][Ar]){ea[co]=ea[co].filter((Zo,Fa)=>Fa!==Ar),Vi(ea);return}Dt.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:ne.modal,onOk:()=>{ea[co]=ea[co].filter((Zo,Fa)=>Fa!==Ar),Vi(ea)}})},Cr=co=>{Dt.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:ne.modal,onOk:()=>{let Ar=eo.slice();Ar=eo.filter((ea,Zo)=>co!==Zo),Vi(Ar)}})};return wn.createElement("section",{className:ne.wrap},wn.createElement("p",{className:ne.titleWrap},wn.createElement("span",{className:ne.required},"*"),wn.createElement("span",{className:ne.title},"\u9898\u5E72\uFF1A")),wn.createElement("div",null,wn.createElement(Me.Z,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:vo,onChange:co=>Xr(co),showNullButton:!0,onPlaceholderChange:yo})),wn.createElement("div",{className:"mt20"},eo.map((co,Ar)=>wn.createElement("div",{style:{display:"flex"}},wn.createElement("div",{style:{flex:1}},wn.createElement(vn.Z,{key:Ar,answers:co,index:Ar,flex:1,is_md:!0,activeOptionErrorIndex:ar,onAnswerChange:Ro,addChildAnswer:qi,deleteChildAnswer:Ia,deleteChildAnswermain:Cr})),Zi.use_blank_score&&wn.createElement("div",{style:{display:"flex",alignItems:"center",width:"165px"}},wn.createElement("span",{style:{color:"red",margin:"auto 5px auto 10px"}},"*"),"\u5206\u503C\uFF1A",wn.createElement(ee.Z,{style:{width:"100px"},size:"large",defaultValue:Pi[Ar],onBlur:ea=>{Pi[Ar]=ea.target.value,$i([...Pi])}}))))),wn.createElement("div",null,wn.createElement(Ae.default,{className:`${ne.color333} font14 mt20`,checked:Zi.use_blank_score,onChange:co=>Br(Ge(Yt({},Zi),{use_blank_score:co.target.checked}))},"\u5224\u5206\u65F6\u6309\u7A7A\u7ED9\u5206"),wn.createElement("span",{style:{color:"#999999",fontSize:"12px"}},"\uFF08\u9009\u4E2D\uFF0C\u5219\u9700\u8981\u8BBE\u7F6E\u6BCF\u7A7A\u5206\u503C\uFF0C\u5B66\u751F\u7B54\u6848\u5224\u5206\u65F6\u6309\u7A7A\u7ED9\u5206\uFF09")),wn.createElement("div",null,wn.createElement(Ae.default,{className:`${ne.color333} font14 mt20`,checked:Zi.downcase,onChange:co=>Br(Ge(Yt({},Zi),{downcase:co.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),wn.createElement("div",null,wn.createElement(Ae.default,{className:`${ne.color333} font14 mt20`,checked:Zi.no_space,onChange:co=>Br(Ge(Yt({},Zi),{no_space:co.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),wn.createElement("div",{className:"mt20"},(eo==null?void 0:eo.length)>1&&wn.createElement("span",null,wn.createElement(Ae.default,{checked:br,onChange:co=>Fr(co.target.checked),className:`${ne.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),wn.createElement("span",{className:`${ne.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"))),wn.createElement("p",{className:ne.titleWrap},wn.createElement("span",{className:ne.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),wn.createElement(Kn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ir,onChange:co=>Ui(co)}))};var Ce=(0,qt.connect)(({loading:ae,globalSetting:Ie})=>({globalSetting:Ie,loading:ae.effects}),null,null,{forwardRef:!0})((0,gt.forwardRef)(we)),Fe=kt(47889),He=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable,dn=(ae,Ie)=>{var _t={};for(var ce in ae)Qe.call(ae,ce)&&Ie.indexOf(ce)<0&&(_t[ce]=ae[ce]);if(ae!=null&&He)for(var ce of He(ae))Ie.indexOf(ce)<0&&hn.call(ae,ce)&&(_t[ce]=ae[ce]);return _t};const ri=null,ze=(ae,Ie)=>{var _t=ae,{globalSetting:ce,loading:Gr,editData:Sr,dispatch:kr,onRef:ur=()=>{},isEdit:wr}=_t,vo=dn(_t,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[Xr,Ir]=(0,gt.useState)(),[Ui,eo]=(0,gt.useState)(""),[Vi,ar]=(0,gt.useState)("");(0,gt.useEffect)(()=>{if(!Sr||!wr)return;eo(Sr==null?void 0:Sr.name),ar(Sr==null?void 0:Sr.analysis);const Fr=Sr==null?void 0:Sr.choices.find(Dr=>Dr.is_answer);Ir(Fr.choice_text==="\u6B63\u786E"?"0":"1")},[Sr]),(0,gt.useImperativeHandle)(Ie,()=>({onSave:Qi,Clear:br}));const Qi=()=>Ui?Xr?{name:Ui,choices:[{choice_text:"\u6B63\u786E",is_answer:Xr==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Xr==="1"?1:0}],analysis:Vi}:(ge.ZP.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1):(ge.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1),br=()=>{eo(""),ar(""),Ir("")};return gt.createElement("section",{className:ne.wrap},gt.createElement("p",{className:ne.titleWrap},gt.createElement("span",{className:ne.required},"*"),gt.createElement("span",{className:ne.title},"\u9898\u5E72\uFF1A")),gt.createElement(Kn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ui,onChange:Fr=>eo(Fr)}),gt.createElement("p",{className:ne.titleWrap},gt.createElement("span",{className:ne.required},"*"),gt.createElement("span",{className:ne.title},"\u7B54\u6848\u9009\u9879\uFF1A",gt.createElement("span",{className:ne.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),gt.createElement(Fe.ZP.Group,{buttonStyle:"solid",value:Xr,onChange:Fr=>Ir(Fr.target.value)},gt.createElement(Fe.ZP.Button,{value:"0",className:`${ne.radio} mr40`},"\u6B63\u786E"),gt.createElement(Fe.ZP.Button,{value:"1",className:ne.radio},"\u9519\u8BEF")),gt.createElement("p",{className:ne.titleWrap},gt.createElement("span",{className:ne.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),gt.createElement(Kn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Vi,onChange:Fr=>ar(Fr)}))};var We=(0,qt.connect)(({loading:ae,globalSetting:Ie})=>({globalSetting:Ie,loading:ae.effects}),null,null,{forwardRef:!0})((0,gt.forwardRef)(ze)),an=Object.getOwnPropertySymbols,Xn=Object.prototype.hasOwnProperty,pn=Object.prototype.propertyIsEnumerable,rn=(ae,Ie)=>{var _t={};for(var ce in ae)Xn.call(ae,ce)&&Ie.indexOf(ce)<0&&(_t[ce]=ae[ce]);if(ae!=null&&an)for(var ce of an(ae))Ie.indexOf(ce)<0&&pn.call(ae,ce)&&(_t[ce]=ae[ce]);return _t};const In=null,pi=(ae,Ie)=>{var _t=ae,{globalSetting:ce,loading:Gr,editData:Sr,dispatch:kr,onRef:ur=()=>{},isEdit:wr}=_t,vo=rn(_t,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[Xr,Ir]=(0,gt.useState)([]);(0,gt.useEffect)(()=>{var ar;if(!Sr||!wr)return;const Qi=(ar=Sr==null?void 0:Sr.shixun)==null?void 0:ar.challenges.map(br=>({id:br==null?void 0:br.id,score:br.score}));Ir(Qi)},[Sr]),(0,gt.useImperativeHandle)(Ie,()=>({onSave:Ui,Clear:eo}));const Ui=()=>({challenges:[...Xr]}),eo=()=>{Ir([])};console.log("editData--",Sr);const Vi=ar=>{var Qi,br;return gt.createElement("div",null,(br=(Qi=ar==null?void 0:ar.shixun)==null?void 0:Qi.challenges)==null?void 0:br.map((Fr,Dr)=>{var no;return gt.createElement("div",{className:"c-grey-666 font14 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"15px"}},gt.createElement("div",null,gt.createElement("span",{className:"mr5"},"\u7B2C",Dr+1,"\u5173"),gt.createElement(Ee.Z,{key:Dr,title:Fr==null?void 0:Fr.challenge_name},gt.createElement("span",null,(0,Xt.Pq)(Fr==null?void 0:Fr.challenge_name,44)))),gt.createElement("p",{style:{marginBottom:0}},gt.createElement("span",{className:ne.required},"*"),gt.createElement("span",{className:ne.title},"\u5206\u503C\uFF1A"),gt.createElement(ee.Z,{precision:1,min:1,max:100,className:ne.baseFormItem,style:{width:176},value:(no=Xr.find(Zi=>Zi.id===Fr.id))==null?void 0:no.score,onChange:Zi=>{Xr.find(Br=>Br.id===Fr.id).score=Zi,Ir([...Xr])}})))}),gt.createElement("div",{style:{clear:"both"}}))};return gt.createElement("section",{className:ne.wrap},gt.createElement(It.Z,{style:{paddingRight:10},className:ne.titleHtml,value:`${Sr==null?void 0:Sr.position}\u3001${Sr==null?void 0:Sr.name}`}),gt.createElement("p",{style:{marginBottom:"10px",marginTop:"25px"}},gt.createElement("span",{className:ne.required},"*"),gt.createElement("span",{className:ne.title},"\u5173\u5361")),Vi(Sr))};var ei=(0,qt.connect)(({loading:ae,globalSetting:Ie})=>({globalSetting:Ie,loading:ae.effects}),null,null,{forwardRef:!0})((0,gt.forwardRef)(pi)),mi=Object.getOwnPropertySymbols,Hi=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable,Sn=(ae,Ie)=>{var _t={};for(var ce in ae)Hi.call(ae,ce)&&Ie.indexOf(ce)<0&&(_t[ce]=ae[ce]);if(ae!=null&&mi)for(var ce of mi(ae))Ie.indexOf(ce)<0&&Cn.call(ae,ce)&&(_t[ce]=ae[ce]);return _t};const Bn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],si=(ae,Ie)=>{var _t=ae,{editData:ce,globalSetting:Gr,loading:Sr,dispatch:kr,onRef:ur=()=>{},isEdit:wr}=_t,vo=Sn(_t,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Xr,Ir]=(0,gt.useState)([]),[Ui,eo]=(0,gt.useState)(),[Vi,ar]=(0,gt.useState)([]),[Qi,br]=(0,gt.useState)(""),[Fr,Dr]=(0,gt.useState)("");(0,gt.useEffect)(()=>{Ir(["","","",""])},[]),(0,gt.useEffect)(()=>{if(!ce||!wr)return;br(ce==null?void 0:ce.name),Dr(ce==null?void 0:ce.analysis),Ir(ce==null?void 0:ce.choices.map(Pi=>Pi.choice_text));const Br=[];ce==null||ce.choices.map((Pi,$i)=>{Pi.is_answer&&Br.push($i)}),ar(Br)},[ce]),(0,gt.useImperativeHandle)(Ie,()=>({onSave:no,Clear:Zi}));const no=()=>{if(!Qi)return ge.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const Br=Xr.findIndex($i=>!$i);if(Br>-1)return ge.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Bn[Br]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Vi.length)return ge.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;if(Vi.length<2)return ge.ZP.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;const Pi=Xr.map(($i,pr)=>({choice_text:$i,is_answer:Vi.includes(pr)?1:0}));return{name:Qi,choices:Pi,analysis:Fr}},Zi=()=>{Ir(["","","",""]),br(""),Dr(""),ar("")};return gt.createElement("section",{className:ne.wrap},gt.createElement("p",{className:ne.titleWrap},gt.createElement("span",{className:ne.required},"*"),gt.createElement("span",{className:ne.title},"\u9898\u5E72\uFF1A")),gt.createElement(Kn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Qi,onChange:Br=>br(Br)}),gt.createElement("p",{className:ne.titleWrap},gt.createElement("span",{className:ne.required},"*"),gt.createElement("span",{className:ne.title},"\u7B54\u6848\u9009\u9879\uFF1A",gt.createElement("span",{className:ne.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Xr.map((Br,Pi)=>gt.createElement("div",{className:ne.choiceWrap,key:Pi},gt.createElement(Ee.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},gt.createElement("div",{className:`${ne.answer} ${Vi.includes(Pi)?ne.activeAnswer:""}`,onClick:()=>{Vi.includes(Pi)?ar(Vi.filter($i=>$i!==Pi)):ar([...Vi,Pi])}},Bn[Pi])),gt.createElement("div",{className:ne.editorWrap},Ui===Pi?gt.createElement(Kn.Z,{id:`single-question-option-${Pi}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Br,onChange:$i=>{Xr[Pi]=$i,Ir(Xr)}}):gt.createElement("div",{className:ne.htmlWrap,onClick:()=>eo(Pi)},gt.createElement(It.Z,{value:Br}))),Pi>1&&gt.createElement(Ee.Z,{title:"\u5220\u9664"},gt.createElement("i",{className:`${ne.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Ir(Xr.filter(($i,pr)=>pr!==Pi)),Vi.includes(Pi)?ar(Vi.filter($i=>$i!==Pi)):ar([...Vi,Pi])}})),Pi<7&&Pi===Xr.length-1&&gt.createElement(Ee.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},gt.createElement("i",{className:`${ne.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Ir([...Xr,""])})))),gt.createElement("p",{className:ne.titleWrap},gt.createElement("span",{className:ne.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),gt.createElement(Kn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Fr,onChange:Br=>Dr(Br)}))};var yi=(0,qt.connect)(({loading:ae,globalSetting:Ie})=>({globalSetting:Ie,loading:ae.effects}),null,null,{forwardRef:!0})((0,gt.forwardRef)(si)),hi=Object.getOwnPropertySymbols,Gi=Object.prototype.hasOwnProperty,wt=Object.prototype.propertyIsEnumerable,Ye=(ae,Ie)=>{var _t={};for(var ce in ae)Gi.call(ae,ce)&&Ie.indexOf(ce)<0&&(_t[ce]=ae[ce]);if(ae!=null&&hi)for(var ce of hi(ae))Ie.indexOf(ce)<0&&wt.call(ae,ce)&&(_t[ce]=ae[ce]);return _t};const Zn=["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"],Ln=(ae,Ie)=>{var _t=ae,{editData:ce,globalSetting:Gr,loading:Sr,dispatch:kr,onRef:ur=()=>{},isEdit:wr}=_t,vo=Ye(_t,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Xr,Ir]=(0,gt.useState)([]),[Ui,eo]=(0,gt.useState)(),[Vi,ar]=(0,gt.useState)(),[Qi,br]=(0,gt.useState)(""),[Fr,Dr]=(0,gt.useState)("");(0,gt.useEffect)(()=>{Ir(["","","",""])},[]),(0,gt.useEffect)(()=>{if(!ce||!wr)return;const Br=[],Pi=[];ce==null||ce.choices.forEach(($i,pr)=>{Br.push($i.choice_text),$i.is_answer&&Pi.push(pr)}),br(ce==null?void 0:ce.name),Dr(ce==null?void 0:ce.analysis),Ir(Br),ar(Pi)},[ce]),(0,gt.useImperativeHandle)(Ie,()=>({onSave:no,Clear:Zi}));const no=()=>{if(!Qi)return ge.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const Br=Xr.findIndex($i=>!$i);if(Br>-1)return ge.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Zn[Br]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Array.isArray(Vi))return ge.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;const Pi=Xr.map(($i,pr)=>({choice_text:$i,is_answer:Vi.includes(pr)?1:0}));return{name:Qi,choices:Pi,analysis:Fr}},Zi=()=>{Ir(["","","",""]),br(""),Dr(""),ar("")};return gt.createElement("section",{className:ne.wrap},gt.createElement("p",{className:ne.titleWrap},gt.createElement("span",{className:ne.required},"*"),gt.createElement("span",{className:ne.title},"\u9898\u5E72\uFF1A")),gt.createElement(Kn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Qi,onChange:Br=>br(Br)}),gt.createElement("p",{className:ne.titleWrap},gt.createElement("span",{className:ne.required},"*"),gt.createElement("span",{className:ne.title},"\u7B54\u6848\u9009\u9879\uFF1A",gt.createElement("span",{className:ne.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Xr.map((Br,Pi)=>gt.createElement("div",{className:ne.choiceWrap,key:Pi},gt.createElement(Ee.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},gt.createElement("div",{className:`${ne.answer} ${Vi!=null&&Vi.includes(Pi)?ne.activeAnswer:""}`,onClick:()=>ar([Pi])},Zn[Pi])),gt.createElement("div",{className:ne.editorWrap},Ui===Pi?gt.createElement(Kn.Z,{id:`single-question-option-${Pi}`,watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Br,onChange:$i=>{Xr[Pi]=$i,Ir(Xr)}}):gt.createElement("div",{className:ne.htmlWrap,onClick:()=>eo(Pi)},gt.createElement(It.Z,{value:Br}))),Pi>1&&gt.createElement(Ee.Z,{title:"\u5220\u9664"},gt.createElement("i",{className:`${ne.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Ir(Xr.filter(($i,pr)=>pr!==Pi)),Pi===Vi&&ar(null)}})),Pi<7&&Pi===Xr.length-1&&gt.createElement(Ee.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},gt.createElement("i",{className:`${ne.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Ir([...Xr,""])})))),gt.createElement("p",{className:ne.titleWrap},gt.createElement("span",{className:ne.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),gt.createElement(Kn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Fr,onChange:Br=>Dr(Br)}))};var zn=(0,qt.connect)(({loading:ae,globalSetting:Ie})=>({globalSetting:Ie,loading:ae.effects}),null,null,{forwardRef:!0})((0,gt.forwardRef)(Ln)),oi=kt(96599),Si=kt(71411),Yi=kt(61485),Fi=kt(59301),ve=Object.defineProperty,Le=Object.defineProperties,Se=Object.getOwnPropertyDescriptors,ti=Object.getOwnPropertySymbols,Yn=Object.prototype.hasOwnProperty,Wn=Object.prototype.propertyIsEnumerable,qe=(ae,Ie,_t)=>Ie in ae?ve(ae,Ie,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Ie]=_t,Dn=(ae,Ie)=>{for(var _t in Ie||(Ie={}))Yn.call(Ie,_t)&&qe(ae,_t,Ie[_t]);if(ti)for(var _t of ti(Ie))Wn.call(Ie,_t)&&qe(ae,_t,Ie[_t]);return ae},ki=(ae,Ie)=>Le(ae,Se(Ie)),Di=(ae,Ie)=>{var _t={};for(var ce in ae)Yn.call(ae,ce)&&Ie.indexOf(ce)<0&&(_t[ce]=ae[ce]);if(ae!=null&&ti)for(var ce of ti(ae))Ie.indexOf(ce)<0&&Wn.call(ae,ce)&&(_t[ce]=ae[ce]);return _t},Ki=(ae,Ie,_t)=>new Promise((ce,Gr)=>{var Sr=wr=>{try{ur(_t.next(wr))}catch(vo){Gr(vo)}},kr=wr=>{try{ur(_t.throw(wr))}catch(vo){Gr(vo)}},ur=wr=>wr.done?ce(wr.value):Promise.resolve(wr.value).then(Sr,kr);ur((_t=_t.apply(ae,Ie)).next())});const Gt=ae=>{if(!ae)return!1;if(/^s*$/.test(ae)||ae.trim()===""){ge.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let Ie=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return ae==="|"?(ge.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},me=({value:ae=[],onClose:Ie})=>Fi.createElement(oi.default,{closable:!0,onClose:Ie,className:ne.keywordTag},Fi.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},ae.join(" \u6216 "))),En=(ae,Ie)=>{var _t=ae,{editData:ce,globalSetting:Gr,loading:Sr,dispatch:kr,onRef:ur=()=>{},isEdit:wr}=_t,vo=Di(_t,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Xr,Ir]=(0,gt.useState)(""),[Ui,eo]=(0,gt.useState)(""),[Vi,ar]=(0,gt.useState)(""),[Qi,br]=(0,gt.useState)(""),[Fr]=ue.default.useForm(),Dr=ue.default.useWatch("use_keywords",Fr);(0,gt.useEffect)(()=>{var Pi;!ce||!wr||(Ir(ce==null?void 0:ce.name),eo(ce==null?void 0:ce.analysis),ar((Pi=ce==null?void 0:ce.answer_texts)==null?void 0:Pi[0]),Fr.setFieldsValue(Dn({},ce)))},[ce]),(0,gt.useImperativeHandle)(Ie,()=>({onSave:no,Clear:Zi}));const no=()=>Ki(void 0,null,function*(){if(!Xr)return ge.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield Fr.validateFields()}catch($i){ge.ZP.error($i.errorFields[0].errors[0]);return}const Pi=Fr.getFieldsValue();return console.log(Pi,"values"),Dn({name:Xr,answer_texts:[Vi],analysis:Ui},Pi)}),Zi=()=>{Ir(""),eo(""),ar(""),Fr.resetFields()},Br=ce==null?void 0:ce.score;return Fi.createElement("section",{className:ne.wrap},Fi.createElement("p",{className:ne.titleWrap},Fi.createElement("span",{className:ne.required},"*"),Fi.createElement("span",{className:ne.title},"\u9898\u5E72\uFF1A")),Fi.createElement(Kn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Xr,onChange:Pi=>Ir(Pi)}),Fi.createElement("p",{className:ne.titleWrap},Fi.createElement("span",{className:ne.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),Fi.createElement(Kn.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Vi,onChange:Pi=>ar(Pi)}),Fi.createElement("p",{className:ne.titleWrap},Fi.createElement("span",{className:ne.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),Fi.createElement(Kn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ui,onChange:Pi=>eo(Pi)}),Fi.createElement(ue.default,{form:Fr,size:"large",onFinishFailed:Pi=>Ki(void 0,null,function*(){var $i,pr;ge.ZP.error(Pi.errorFields[0].errors[0]),Fr.scrollToField((pr=($i=Pi==null?void 0:Pi.errorFields)==null?void 0:$i[0])==null?void 0:pr.name,{behavior:"smooth",block:"center"})})},Fi.createElement(Pe.Z,{align:"middle",className:"mb30 mt20"},Fi.createElement(ue.default.Item,{noStyle:!0,name:"use_keywords",valuePropName:"checked"},Fi.createElement(Si.Z,null)),Fi.createElement(Bt.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),Fi.createElement(Bt.Z,null,Fi.createElement(Ee.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},Fi.createElement(Yi.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),Dr&&Fi.createElement(ue.default.List,{name:"keywords",rules:[{validator(Pi,$i){return $i!=null&&$i.length?($i==null?void 0:$i.reduce((uo,yo)=>uo+yo.score,0))>parseFloat(Br)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD"))}}]},(Pi,{add:$i,remove:pr})=>Fi.createElement(Fi.Fragment,null,Fi.createElement("div",{className:"mb10"},"\u5173\u952E\u8BCD"),Fi.createElement(Pe.Z,{align:"middle",className:"font14 mb30"},Fi.createElement(Bt.Z,{flex:1},Fi.createElement(Qt.default,{value:Qi,onChange:uo=>{br(uo.target.value)},maxLength:50,allowClear:!0,onPressEnter:uo=>{var yo,Ro,qi,Ia;const Cr=`${(yo=uo.target)==null?void 0:yo.value}`,co=(qi=(Ro=Cr==null?void 0:Cr.split("|"))==null?void 0:Ro.filter(Zo=>!!Zo))==null?void 0:qi.map(Zo=>Zo==null?void 0:Zo.trim()),Ar=Fr.getFieldValue("keywords"),ea=((Ia=Ar==null?void 0:Ar.map(Zo=>Zo==null?void 0:Zo.keyword))==null?void 0:Ia.flat())||[];for(const Zo of co)if(ea.includes(Zo)){ge.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Gt(Cr)&&($i({keyword:co,score:1}),br(""))},className:ne.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),Fi.createElement(Bt.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Pi.map(uo=>{var yo=uo,{key:Ro,name:qi}=yo,Ia=Di(yo,["key","name"]);return Fi.createElement(Pe.Z,{key:Ro,style:{marginRight:148}},Fi.createElement(Bt.Z,{flex:1},Fi.createElement(Pe.Z,{align:"middle",justify:"space-between"},Fi.createElement(ue.default.Item,ki(Dn({},Ia),{name:[qi,"keyword"]}),Fi.createElement(me,{onClose:()=>pr(qi)})),Fi.createElement(ue.default.Item,ki(Dn({},Ia),{name:[qi,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),Fi.createElement(ee.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))})))))};var Gn=(0,qt.connect)(({loading:ae,globalSetting:Ie})=>({globalSetting:Ie,loading:ae.effects}),null,null,{forwardRef:!0})((0,gt.forwardRef)(En)),Re=kt(8848),$e={wrap:"wrap___Cc0gS",deleteIcon:"deleteIcon___ebwMv",keywordTag:"keywordTag___lUfL5",questionTitleEditorWrap:"questionTitleEditorWrap___u9UgK",choiceWrap:"choiceWrap___VHsr3",choiceIndex:"choiceIndex___rsj9r",judgementIndex:"judgementIndex___fMm6E",setAnswerBtn:"setAnswerBtn___krVC9",activeAnswer:"activeAnswer___WiYo2",activeJudgementAnswer:"activeJudgementAnswer___M6iww",actionWrapper:"actionWrapper___oKI8_",addIcon:"addIcon___eMbGP",inputBorder:"inputBorder___ob_6x",placeholder:"placeholder___Vkwr4",blankWrapper:"blankWrapper____MZQ5",blankInput:"blankInput___ephwY",blankInputNumberWrapper:"blankInputNumberWrapper___C1UJS",addBtn:"addBtn___qRBpJ",blankIndex:"blankIndex___QsKgf",baseInputWrapper:"baseInputWrapper___juqCB",collapseWrapper:"collapseWrapper___kAXJ0",panelHeader:"panelHeader___hLTSe",open:"open___wWDjf",close:"close___XPTJ0",hide:"hide___VytUy"},Nn=kt(32134),_n=kt(12893),di=Object.defineProperty,Jn=Object.defineProperties,li=Object.getOwnPropertyDescriptors,ni=Object.getOwnPropertySymbols,ji=Object.prototype.hasOwnProperty,Oi=Object.prototype.propertyIsEnumerable,Ii=(ae,Ie,_t)=>Ie in ae?di(ae,Ie,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Ie]=_t,Ve=(ae,Ie)=>{for(var _t in Ie||(Ie={}))ji.call(Ie,_t)&&Ii(ae,_t,Ie[_t]);if(ni)for(var _t of ni(Ie))Oi.call(Ie,_t)&&Ii(ae,_t,Ie[_t]);return ae},vr=(ae,Ie)=>Jn(ae,li(Ie)),Mr=(ae,Ie)=>{var _t={};for(var ce in ae)ji.call(ae,ce)&&Ie.indexOf(ce)<0&&(_t[ce]=ae[ce]);if(ae!=null&&ni)for(var ce of ni(ae))Ie.indexOf(ce)<0&&Oi.call(ae,ce)&&(_t[ce]=ae[ce]);return _t};const ro=ae=>{var Ie=ae,{value:_t,onChange:ce,scrollId:Gr}=Ie,Sr=Mr(Ie,["value","onChange","scrollId"]);return gt.createElement("div",{id:Gr||""},gt.createElement(Kn.Z,vr(Ve({},Sr),{defaultValue:_t,onChange:(kr,ur)=>{ur!=null&&ur.length?ce(kr,ur):ce(kr)}})))},en=({value:ae,onChange:Ie,placeholder:_t,height:ce=140,isEdit:Gr})=>Gr?gt.createElement(Kn.Z,{watch:!0,isFocus:!0,height:ce,placeholder:_t,defaultValue:ae,onChange:Ie}):gt.createElement("div",{style:{cursor:"pointer"}},ae?gt.createElement(It.Z,{className:$e.inputBorder,value:ae}):gt.createElement("div",{className:`${$e.inputBorder} ${$e.placeholder}`},_t));var Tn=kt(59301),Bi=Object.defineProperty,bi=Object.defineProperties,_i=Object.getOwnPropertyDescriptors,ir=Object.getOwnPropertySymbols,yr=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable,_r=(ae,Ie,_t)=>Ie in ae?Bi(ae,Ie,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Ie]=_t,Rr=(ae,Ie)=>{for(var _t in Ie||(Ie={}))yr.call(Ie,_t)&&_r(ae,_t,Ie[_t]);if(ir)for(var _t of ir(Ie))Nr.call(Ie,_t)&&_r(ae,_t,Ie[_t]);return ae},cn=(ae,Ie)=>bi(ae,_i(Ie)),ho=(ae,Ie)=>{var _t={};for(var ce in ae)yr.call(ae,ce)&&Ie.indexOf(ce)<0&&(_t[ce]=ae[ce]);if(ae!=null&&ir)for(var ce of ir(ae))Ie.indexOf(ce)<0&&Nr.call(ae,ce)&&(_t[ce]=ae[ce]);return _t};const gn=["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"],Wi=({value:ae,onChange:Ie,choiceTextKey:_t,answerKey:ce,index:Gr,isEdit:Sr,setInputActive:kr,form:ur,choiceOptionsPath:wr,allowChangeMode:vo,showAddIcon:Xr,addItem:Ir,deleteItem:Ui})=>{const eo=(ae==null?void 0:ae[ce])===!0,Vi=()=>{const Qi=ur.getFieldValue(wr);ur.setFieldValue(wr,Qi.map(br=>cn(Rr({},br),{[ce]:!1})))},ar=()=>{eo?Ie(cn(Rr({},ae),{[ce]:!1})):(vo||Vi(),Ie(cn(Rr({},ae),{[ce]:!0})))};return Tn.createElement(Pe.Z,{className:$e.choiceWrap,align:"middle",wrap:!1},Tn.createElement(Bt.Z,{onClick:ar,className:`${$e.choiceIndex} ${eo?$e.activeAnswer:""}`},gn[Gr]),Tn.createElement(Bt.Z,{flex:1,className:`${$e.editorWrap} ml15`,onClick:kr},Tn.createElement(en,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:Sr,value:ae==null?void 0:ae[_t],onChange:Qi=>{Ie(cn(Rr({},ae),{[_t]:Qi}))}})),Tn.createElement(Bt.Z,{flex:"0 0 auto",className:"ml15"},Tn.createElement("div",{onClick:ar,className:`${$e.setAnswerBtn} ${eo?$e.activeAnswer:""}`},eo?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),Tn.createElement(Bt.Z,{className:$e.actionWrapper},Tn.createElement(Ee.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},Tn.createElement(Nn.Z,{className:$e.addIcon,onClick:Ir,style:{visibility:Xr?"visible":"hidden"}})),Tn.createElement(Ee.Z,{title:"\u5220\u9664"},Tn.createElement(_n.Z,{className:$e.deleteIcon,onClick:Ui,style:{visibility:Gr>1?"visible":"hidden"}}))))},Kr=({questionTitlePlaceholder:ae,titleKey:Ie,choiceKey:_t,analysisKey:ce,choiceTextKey:Gr,answerKey:Sr,choiceOptionsPath:kr,allowChangeMode:ur=!0,form:wr,showAnalysis:vo=!0})=>{const[Xr,Ir]=(0,gt.useState)(),[Ui,eo]=(0,gt.useState)(!1);return Tn.createElement("div",{className:$e.wrap},Tn.createElement("div",{className:$e.questionTitleEditorWrap},Tn.createElement(ue.default.Item,{label:"\u9898\u5E72",name:Ie,labelCol:{span:24},rules:[{required:!0}]},Tn.createElement(ro,{scrollId:Array.isArray(Ie)?Ie.join("_"):`${Ie}`,watch:!0,height:140,placeholder:ae}))),Tn.createElement(ue.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),Tn.createElement(ue.default.List,{name:_t,rules:[{validator(Vi,ar){const Qi=ar.some(Fr=>Fr[Sr]),br=ar.findIndex(Fr=>{var Dr;return((Dr=Fr[Gr])==null?void 0:Dr.length)<=0});return br!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${gn[br]}\u9009\u9879\u7684\u5185\u5BB9`)):Qi?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(Vi,{add:ar,remove:Qi})=>Tn.createElement("div",{id:Array.isArray(kr)?kr.join("_"):`${kr}`},Vi.map((br,Fr)=>{var Dr=br,{key:no,name:Zi}=Dr,Br=ho(Dr,["key","name"]);const Pi=Xr===no,$i=()=>{Ir(no)},pr=Fr<7&&Fr===Vi.length-1,uo=()=>ar({[Gr]:"",[Sr]:0}),yo=()=>Qi(Zi);return Tn.createElement(ue.default.Item,cn(Rr({},Br),{key:no,name:Zi,noStyle:!0}),Tn.createElement(Wi,{choiceTextKey:Gr,answerKey:Sr,index:Fr,isEdit:Pi,setInputActive:$i,form:wr,choiceOptionsPath:kr,allowChangeMode:ur,showAddIcon:pr,addItem:uo,deleteItem:yo}))}),Vi.length<8&&Tn.createElement("div",{className:`${$e.addBtn} mb30`,onClick:()=>ar({[Gr]:"",[Sr]:0})},"\u6DFB\u52A0\u9009\u9879"))),vo&&Tn.createElement("div",{onClick:()=>eo(!0)},Tn.createElement(ue.default.Item,{name:ce,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},Tn.createElement(en,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ui}))))};var zi=kt(59301),wo=Object.defineProperty,Yr=Object.defineProperties,Er=Object.getOwnPropertyDescriptors,Co=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable,Be=(ae,Ie,_t)=>Ie in ae?wo(ae,Ie,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Ie]=_t,At=(ae,Ie)=>{for(var _t in Ie||(Ie={}))_e.call(Ie,_t)&&Be(ae,_t,Ie[_t]);if(Co)for(var _t of Co(Ie))xn.call(Ie,_t)&&Be(ae,_t,Ie[_t]);return ae},jn=(ae,Ie)=>Yr(ae,Er(Ie)),Qn=(ae,Ie)=>{var _t={};for(var ce in ae)_e.call(ae,ce)&&Ie.indexOf(ce)<0&&(_t[ce]=ae[ce]);if(ae!=null&&Co)for(var ce of Co(ae))Ie.indexOf(ce)<0&&xn.call(ae,ce)&&(_t[ce]=ae[ce]);return _t};const Li=({value:ae,onChange:Ie})=>{const _t=Gr=>{Dt.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:$e.modal,onOk:()=>{const Sr=[...ae];Sr.splice(Gr,1),Ie(Sr)}})},ce=()=>{const Gr=[...ae];Gr.push(""),Ie(Gr)};return zi.createElement(Pe.Z,{align:"middle",className:"ml20",gutter:[40,20]},ae==null?void 0:ae.map((Gr,Sr)=>zi.createElement(Bt.Z,{key:`${Gr}_${Sr}`,className:$e.blankWrapper},zi.createElement(Qt.default,{className:$e.blankInput,defaultValue:Gr,maxLength:1e3,onBlur:kr=>{const ur=[...ae],wr=kr.target.value.trim();ur[Sr]=wr,Ie(ur)}}),zi.createElement(Ee.Z,{title:"\u5220\u9664"},zi.createElement(_n.Z,{className:$e.deleteIcon,style:{marginLeft:15,visibility:Sr>0?"visible":"hidden"},onClick:()=>_t(Sr)})))),zi.createElement(Bt.Z,null,zi.createElement("div",{className:`${$e.addBtn}`,onClick:()=>{ce()}},"\u65B0\u589E\u7B54\u6848")))},xi=({value:ae=!0,onChange:Ie})=>zi.createElement(Si.Z,{checked:!ae,onChange:_t=>{Ie(!_t)}}),ui="\u2581",mn=({questionTitlePlaceholder:ae,form:Ie,name:_t,scoreByBlank:ce="use_blank_score",answerKey:Gr,titleKey:Sr="name",analysisKey:kr="analysis",isOrdered:ur="is_ordered"})=>{var wr,vo;const[Xr,Ir]=(0,gt.useState)(!1),Ui=(no,Zi)=>{const Br=Zi.line;let Pi=0;for(let pr=0;pr<Br;pr++)Pi+=no.getLine(pr).split(ui).length-1;const $i=no.getLine(Br).substring(0,Zi.ch);return Pi+=$i.split(ui).length-1,Pi},eo=(no,Zi,Br,Pi)=>{const $i=no.getRange(Zi.from,Zi.to);let pr=0;if(Zi.text.forEach(uo=>{pr+=uo.split(ui).length-1}),Zi.origin!=="setValue"){if($i&&$i.indexOf(ui)!==-1){const uo=$i.split(ui).length-1,yo=Ui(no,Zi.from);if(console.log(`\u5220\u9664${uo}\u4E2A\uFF0C \u524D\u9762\u6709${yo}\u4E2A\uFF0C\u65B0\u589E${pr}\u4E2A`),uo>1){const Ro=Array.from({length:uo},(qi,Ia)=>yo+Ia);Pi(Ro)}else Pi(yo)}else if(pr>0){const uo=Ui(no,Zi.from);console.log(`\u65B0\u589E${pr}\u4E2A\uFF0C\u4E4B\u524D\u6709${uo}\u4E2A`),Br(pr,uo)}}},Vi=()=>{const no=Ie.getFieldValue(["sub_item_banks",...Gr]);Ie.setFieldValue(["sub_item_banks",...Gr],no==null?void 0:no.map((Zi,Br)=>jn(At({},Zi),{position:Br+1})))},ar=(0,gt.useRef)(),Qi=(no,Zi)=>{for(let Br=0;Br<no;Br++)ar.current({position:null,answer_text:[""]},Zi+Br);Vi()},br=(0,gt.useRef)(),Fr=no=>{br.current(no),Vi()},Dr=(vo=(wr=Ie.getFieldValue("sub_item_banks"))==null?void 0:wr[Gr==null?void 0:Gr[0]])==null?void 0:vo[Gr==null?void 0:Gr[1]];return zi.createElement("div",{className:$e.wrap},zi.createElement("div",{className:$e.questionTitleEditorWrap},zi.createElement(ue.default.Item,{label:"\u9898\u5E72",name:Sr,labelCol:{span:24},rules:[{required:!0}]},zi.createElement(ro,{scrollId:"name",watch:!0,height:140,placeholder:ae,showNullButton:!0,onCMBeforeChange:(no,Zi)=>{eo(no,Zi,Qi,Fr)}}))),zi.createElement(ue.default.List,{name:Gr,rules:[{validator(no,Zi){if((Zi==null?void 0:Zi.length)===0)return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const Br of Zi){const{answer_text:Pi}=Br||{};if(Pi!=null&&Pi.some($i=>($i==null?void 0:$i.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(no,{add:Zi,remove:Br},{errors:Pi})=>(ar.current=Zi,br.current=Br,zi.createElement(zi.Fragment,null,zi.createElement(ue.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),no.map(($i,pr)=>{var uo=$i,{key:yo,name:Ro}=uo,qi=Qn(uo,["key","name"]);return zi.createElement(Pe.Z,{className:"mb20",key:yo,align:"middle",wrap:!1},zi.createElement(Bt.Z,{flex:"0 0 auto",className:`${$e.blankIndex}`},"\u586B\u7A7A\u9879",pr+1),zi.createElement(Bt.Z,{flex:1},zi.createElement(Pe.Z,{align:"top",justify:"space-between",wrap:!1},zi.createElement(Bt.Z,null,zi.createElement(ue.default.Item,jn(At({},qi),{name:[Ro,"answer_text"],noStyle:!0}),zi.createElement(Li,null))),(Ie==null?void 0:Ie.getFieldValue(["sub_item_banks",...ce]))&&zi.createElement(Bt.Z,{flex:"224px"},zi.createElement(ue.default.Item,jn(At({},qi),{name:[Ro,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:$e.blankInputNumberWrapper}),zi.createElement(ee.Z,{className:$e.blankInput,min:.1,max:100,style:{width:"100%"},placeholder:"\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"})))),zi.createElement(ue.default.Item,jn(At({},qi),{name:[Ro,"position"],noStyle:!0}),zi.createElement(Qt.default,{type:"hidden"}))))})))),zi.createElement(Pe.Z,{align:"middle"},zi.createElement(ue.default.Item,{name:[_t,"downcase"],valuePropName:"checked"},zi.createElement(Si.Z,null)),zi.createElement(Bt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),zi.createElement(Pe.Z,{align:"middle"},zi.createElement(ue.default.Item,{name:[_t,"no_space"],valuePropName:"checked"},zi.createElement(Si.Z,null)),zi.createElement(Bt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(Dr==null?void 0:Dr.length)>1&&zi.createElement(Pe.Z,{align:"middle",className:(Dr==null?void 0:Dr.length)>1?"mb30":`${$e.hide}`},zi.createElement(ue.default.Item,{name:ur},zi.createElement(xi,null)),zi.createElement(Bt.Z,{className:"ml10"},"\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")),zi.createElement("div",{onClick:()=>Ir(!0)},zi.createElement(ue.default.Item,{name:kr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},zi.createElement(en,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Xr}))))};var Vn=Object.defineProperty,$n=Object.defineProperties,An=Object.getOwnPropertyDescriptors,Un=Object.getOwnPropertySymbols,Ti=Object.prototype.hasOwnProperty,vi=Object.prototype.propertyIsEnumerable,ii=(ae,Ie,_t)=>Ie in ae?Vn(ae,Ie,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Ie]=_t,nn=(ae,Ie)=>{for(var _t in Ie||(Ie={}))Ti.call(Ie,_t)&&ii(ae,_t,Ie[_t]);if(Un)for(var _t of Un(Ie))vi.call(Ie,_t)&&ii(ae,_t,Ie[_t]);return ae},Ni=(ae,Ie)=>$n(ae,An(Ie)),Xi=(ae,Ie)=>{var _t={};for(var ce in ae)Ti.call(ae,ce)&&Ie.indexOf(ce)<0&&(_t[ce]=ae[ce]);if(ae!=null&&Un)for(var ce of Un(ae))Ie.indexOf(ce)<0&&vi.call(ae,ce)&&(_t[ce]=ae[ce]);return _t};const Or={\u6B63\u786E:"T",\u9519\u8BEF:"F"},cr=({value:ae,onChange:Ie,form:_t,choiceKey:ce})=>{const Gr=(ae==null?void 0:ae.is_answer)===!0,Sr=ae==null?void 0:ae.choice_text,kr=()=>{var ur;const wr=(ur=_t==null?void 0:_t.getFieldValue(["sub_item_banks",...ce]))==null?void 0:ur.map(vo=>({choice_text:vo==null?void 0:vo.choice_text,is_answer:!1}));_t==null||_t.setFieldValue(["sub_item_banks",...ce],wr),Ie(Ni(nn({},ae),{is_answer:!0}))};return gt.createElement(Pe.Z,{className:$e.choiceWrap,align:"middle",wrap:!1},gt.createElement(Bt.Z,{onClick:kr,className:`${$e.choiceIndex} ${$e.judgementIndex} ${Gr?$e.activeAnswer:""}`},Or[Sr]),gt.createElement(Bt.Z,{flex:1,className:`${$e.editorWrap} ml15`},gt.createElement("div",{className:`${$e.inputBorder} ${$e.placeholder} ${Gr?$e.activeJudgementAnswer:""}`},Sr)),gt.createElement(Bt.Z,{flex:"0 0 auto",className:"ml15"},gt.createElement("div",{onClick:kr,className:`${$e.setAnswerBtn} ${Gr?$e.activeAnswer:""}`},Gr?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},oo=({questionTitlePlaceholder:ae,choiceKey:Ie="choices",form:_t,titleKey:ce="name",analysisKey:Gr="analysis"})=>{const[Sr,kr]=(0,gt.useState)(!1);return gt.createElement("div",{className:$e.wrap},gt.createElement("div",{className:$e.questionTitleEditorWrap},gt.createElement(ue.default.Item,{label:"\u9898\u5E72",name:ce,labelCol:{span:24},rules:[{required:!0}]},gt.createElement(ro,{scrollId:"name",watch:!0,height:140,placeholder:ae}))),gt.createElement(ue.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},gt.createElement(ue.default.List,{name:Ie,rules:[{validator(ur,wr){return wr.some(Xr=>(Xr==null?void 0:Xr.is_answer)===!0)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},ur=>gt.createElement("div",{id:"choices"},ur.map(wr=>{var vo=wr,{key:Xr,name:Ir}=vo,Ui=Xi(vo,["key","name"]);return gt.createElement(ue.default.Item,Ni(nn({},Ui),{key:Xr,name:Ir,noStyle:!0}),gt.createElement(cr,{form:_t,choiceKey:Ie}))})))),gt.createElement("div",{onClick:()=>kr(!0)},gt.createElement(ue.default.Item,{name:Gr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},gt.createElement(en,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Sr}))))};var to=Object.defineProperty,$r=Object.defineProperties,po=Object.getOwnPropertyDescriptors,lo=Object.getOwnPropertySymbols,Bo=Object.prototype.hasOwnProperty,Te=Object.prototype.propertyIsEnumerable,ao=(ae,Ie,_t)=>Ie in ae?to(ae,Ie,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Ie]=_t,Jr=(ae,Ie)=>{for(var _t in Ie||(Ie={}))Bo.call(Ie,_t)&&ao(ae,_t,Ie[_t]);if(lo)for(var _t of lo(Ie))Te.call(Ie,_t)&&ao(ae,_t,Ie[_t]);return ae},gr=(ae,Ie)=>$r(ae,po(Ie)),Wr=(ae,Ie)=>{var _t={};for(var ce in ae)Bo.call(ae,ce)&&Ie.indexOf(ce)<0&&(_t[ce]=ae[ce]);if(ae!=null&&lo)for(var ce of lo(ae))Ie.indexOf(ce)<0&&Te.call(ae,ce)&&(_t[ce]=ae[ce]);return _t};const Lr=ae=>{var Ie=ae,{value:_t,onChange:ce}=Ie,Gr=Wr(Ie,["value","onChange"]);const Sr=kr=>{ce([kr])};return gt.createElement(Kn.Z,gr(Jr({},Gr),{defaultValue:_t==null?void 0:_t[0],onChange:Sr}))},Mo=ae=>{if(!ae)return!1;let Ie=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return ae==="|"?(ge.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Fo=({value:ae=[],onClose:Ie})=>gt.createElement(oi.default,{closable:!0,onClose:Ie,className:$e.keywordTag},ae==null?void 0:ae.join(" \u6216 ")),zr=({questionTitlePlaceholder:ae,form:Ie,showKeywords:_t,isMustKeyWords:ce=_t,titleKey:Gr="name",analysisKey:Sr="analysis",answerTexts:kr="answer_texts",keywords:ur="keywords",useKeywords:wr="use_keywords",indexs:vo})=>{const[Xr,Ir]=(0,gt.useState)(!1),[Ui,eo]=(0,gt.useState)(""),Vi=ue.default.useWatch("sub_item_banks",Ie),{use_keywords:ar,score:Qi}=(Vi==null?void 0:Vi[vo])||{};return console.log(ar,Qi,"itemValues"),gt.createElement("div",{className:$e.wrap},gt.createElement("div",{className:$e.questionTitleEditorWrap},gt.createElement(ue.default.Item,{label:"\u9898\u5E72",name:Gr,labelCol:{span:24},rules:[{required:!0}]},gt.createElement(ro,{scrollId:"name",watch:!0,height:140,placeholder:ae}))),gt.createElement(ue.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:kr,labelCol:{span:24}},gt.createElement(Lr,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),_t&&!ce&&gt.createElement(ue.default.Item,{hidden:!0,name:wr,valuePropName:"checked"},gt.createElement(Si.Z,{defaultChecked:!0})),_t&&ce&&gt.createElement(Pe.Z,{align:"middle",className:"mb30"},gt.createElement(ue.default.Item,{name:wr,valuePropName:"checked"},gt.createElement(Si.Z,null)),gt.createElement(Bt.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),gt.createElement(Bt.Z,null,gt.createElement(Ee.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},gt.createElement(Yi.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(ar||!ce)&&gt.createElement(ue.default.List,{name:ur,rules:[{validator(br,Fr){return ce?Fr!=null&&Fr.length?(Fr==null?void 0:Fr.reduce((no,Zi)=>no+Zi.score,0))>parseFloat(Qi)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD")):Promise.resolve()}}]},(br,{add:Fr,remove:Dr})=>gt.createElement(gt.Fragment,null,gt.createElement("div",{className:`${$e.title} mb10`},ce?"\u5173\u952E\u8BCD":gt.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),gt.createElement(Pe.Z,{align:"middle",className:"font14 mb30"},gt.createElement(Bt.Z,{flex:1},gt.createElement(Qt.default,{value:Ui,onChange:no=>{eo(no.target.value)},maxLength:50,allowClear:!0,onPressEnter:no=>{var Zi,Br,Pi,$i;const pr=`${(Zi=no.target)==null?void 0:Zi.value}`,uo=(Pi=(Br=pr==null?void 0:pr.split("|"))==null?void 0:Br.filter(qi=>!!qi))==null?void 0:Pi.map(qi=>qi==null?void 0:qi.trim()),yo=Ie.getFieldValue(["sub_item_banks",...ur]),Ro=(($i=yo==null?void 0:yo.map(qi=>qi==null?void 0:qi.keyword))==null?void 0:$i.flat())||[];for(const qi of uo)if(Ro.includes(qi)){ge.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Mo(pr)&&(Fr({keyword:uo,score:1}),eo(""))},className:$e.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),gt.createElement(Bt.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),br.map(no=>{var Zi=no,{key:Br,name:Pi}=Zi,$i=Wr(Zi,["key","name"]);return gt.createElement(Pe.Z,{key:Br,className:"mb20",style:{marginRight:148}},gt.createElement(Bt.Z,{flex:1},gt.createElement(Pe.Z,{align:"middle",justify:"space-between"},gt.createElement(ue.default.Item,gr(Jr({},$i),{name:[Pi,"keyword"]}),gt.createElement(Fo,{onClose:()=>Dr(Pi)})),ce&&gt.createElement(ue.default.Item,gr(Jr({},$i),{name:[Pi,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:$e.blankInputNumberWrapper}),gt.createElement(ee.Z,{className:$e.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),gt.createElement("div",{onClick:()=>Ir(!0)},gt.createElement(ue.default.Item,{name:Sr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},gt.createElement(en,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Xr}))))};var Zr=kt(59301),Za=Object.defineProperty,ra=Object.defineProperties,bs=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertySymbols,or=Object.prototype.hasOwnProperty,$o=Object.prototype.propertyIsEnumerable,qo=(ae,Ie,_t)=>Ie in ae?Za(ae,Ie,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Ie]=_t,ca=(ae,Ie)=>{for(var _t in Ie||(Ie={}))or.call(Ie,_t)&&qo(ae,_t,Ie[_t]);if(Ba)for(var _t of Ba(Ie))$o.call(Ie,_t)&&qo(ae,_t,Ie[_t]);return ae},ia=(ae,Ie)=>ra(ae,bs(Ie)),fa=(ae,Ie)=>{var _t={};for(var ce in ae)or.call(ae,ce)&&Ie.indexOf(ce)<0&&(_t[ce]=ae[ce]);if(ae!=null&&Ba)for(var ce of Ba(ae))Ie.indexOf(ce)<0&&$o.call(ae,ce)&&(_t[ce]=ae[ce]);return _t},gi=(ae,Ie,_t)=>new Promise((ce,Gr)=>{var Sr=wr=>{try{ur(_t.next(wr))}catch(vo){Gr(vo)}},kr=wr=>{try{ur(_t.throw(wr))}catch(vo){Gr(vo)}},ur=wr=>wr.done?ce(wr.value):Promise.resolve(wr.value).then(Sr,kr);ur((_t=_t.apply(ae,Ie)).next())});const{Panel:lr}=Re.default,jr=null,qr=(ae,Ie)=>{var _t=ae,{globalSetting:ce,loading:Gr,dispatch:Sr,editData:kr,onRef:ur=()=>{},isEdit:wr}=_t,vo=fa(_t,["globalSetting","loading","dispatch","editData","onRef","isEdit"]);const[Xr,Ir]=(0,gt.useState)(""),[Ui,eo]=(0,gt.useState)([]),[Vi]=ue.default.useForm();(0,gt.useEffect)(()=>{!kr||!wr||(Ir(kr==null?void 0:kr.name),eo(kr==null?void 0:kr.sub_item_banks),Vi.setFieldsValue(ca({},kr)))},[kr]),(0,gt.useEffect)(()=>{eo(Vi.getFieldValue("sub_item_banks"))},[ue.default.useWatch("sub_item_banks",Vi)]),(0,gt.useImperativeHandle)(Ie,()=>({onSave:ar,Clear:Qi}));const ar=()=>gi(void 0,null,function*(){if(!Xr)return ge.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield Vi.validateFields()}catch(Br){return console.log(Br,"errInfo"),ge.ZP.error(Br.errorFields[0].errors[0]),!1}const Zi=Ui.map(Br=>ca({id:Br.id>1?Br.id:null},Br));return{name:Xr,sub_item_banks:Zi}}),Qi=()=>{Ir(""),eo([])},br={single:"\u5355\u9009\u9898",multiple:"\u591A\u9009\u9898",judgement:"\u5224\u65AD\u9898",completion:"\u586B\u7A7A\u9898",subjective:"\u7B80\u7B54\u9898",practical:"\u5B9E\u8BAD\u9898",program:"\u7F16\u7A0B\u9898",bprogram:"\u7A0B\u5E8F\u586B\u7A7A\u9898",combination:"\u7EC4\u5408\u9898"},Fr=({value:Zi})=>Zr.createElement("div",{style:{textAlign:"center",color:"#DF3065",margin:"0 5px"}},Zi),[Dr,no]=(0,gt.useState)();return Zr.createElement("section",{className:ne.wrap},Zr.createElement("p",{className:ne.titleWrap},Zr.createElement("span",{className:ne.required},"*"),Zr.createElement("span",{className:ne.title},"\u9898\u5E72\uFF1A")),Zr.createElement(Kn.Z,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Xr,onChange:Zi=>Ir(Zi)}),Zr.createElement(ue.default,{form:Vi,autoComplete:"off"},Zr.createElement(ue.default.List,{name:"sub_item_banks",rules:[{validator(Zi,Br){return Br?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(Zi,{add:Br,remove:Pi})=>{const $i=Vi.getFieldValue("sub_item_banks");return Zr.createElement(Zr.Fragment,null,Zr.createElement(Re.default,{className:Zi.length>0?ne.collapseWrapper:"",bordered:!1,expandIcon:({isActive:pr})=>Zr.createElement("i",{className:`iconfont icon-weizhankai ${pr?ne.open:ne.close}`,style:{fontSize:14,transition:"all .2s"}})},Zi.map((pr,uo)=>{var yo=pr,{key:Ro,name:qi}=yo,Ia=fa(yo,["key","name"]),Cr,co,Ar,ea,Zo,Fa,Al,hu,Ys,Tl,Oo,Ns;return Zr.createElement(lr,{className:ne.panel,forceRender:!0,header:Zr.createElement("div",{className:ne.panelHeader},"\u7B2C",uo+1,"\u5C0F\u9898",Zr.createElement("span",null,"\uFF08",br[(Cr=$i==null?void 0:$i[qi])==null?void 0:Cr.item_type],"\uFF09")),extra:Zr.createElement(Pe.Z,{align:"middle",onClick:gl=>gl.stopPropagation(),style:{display:"flex",alignItems:"center"}},((co=$i==null?void 0:$i[qi])==null?void 0:co.item_type)=="completion"&&Zr.createElement(ue.default.Item,ia(ca({},Ia),{name:[qi,"score"],className:ne.blankInputNumberWrapper,style:{marginBottom:0}}),((Ar=$i==null?void 0:$i[qi])==null?void 0:Ar.item_type)=="completion"&&Zr.createElement("div",{style:{display:"flex",alignItems:"center",color:"#191919"}},"\u5171",Zr.createElement(Fr,{value:(ea=$i==null?void 0:$i[qi])==null?void 0:ea.score}),"\u5206")),((Zo=$i==null?void 0:$i[qi])==null?void 0:Zo.item_type)=="completion"&&Zr.createElement(Zr.Fragment,null,Zr.createElement(Fe.ZP.Group,{defaultValue:(Fa=$i==null?void 0:$i[qi])==null?void 0:Fa.use_blank_score,className:ne.scoreByBlankRadio,style:{marginRight:10},optionType:"button",options:[{label:"\u6309\u7A7A\u7ED9\u5206",value:!0},{label:"\u6309\u9898\u7ED9\u5206",value:!1}],onChange:gl=>{var ol;console.log(Vi.getFieldsValue()),Vi==null||Vi.setFieldValue(["sub_item_banks",qi,"use_blank_score"],(ol=gl==null?void 0:gl.target)==null?void 0:ol.value),no(new Date)}}),Zr.createElement(Ee.Z,{overlayInnerStyle:{width:460},title:Zr.createElement("div",null,"\u6309\u7A7A\u7ED9\u5206\uFF1A\u9700\u8981\u5206\u522B\u8BBE\u7F6E\u6BCF\u4E2A\u586B\u7A7A\u9879\u7684\u5206\u503C\uFF0C\u586B\u7A7A\u9879\u7B54\u5BF9\u4E4B\u540E\u5219\u83B7\u5F97\u5BF9\u5E94\u7684\u5206\u503C\u3002",Zr.createElement("br",null),"\u6309\u9898\u7ED9\u5206\uFF1A\u7B54\u5BF9\u5168\u90E8\u586B\u7A7A\u9879\u4E4B\u540E\u624D\u80FD\u83B7\u5F97\u8BE5\u5C0F\u9898\u7684\u5206\u503C\u3002")},Zr.createElement("i",{className:"icon-tishixiaowenhao font18 c-3061d0"})))),key:Ro},Zr.createElement(ue.default.Item,ia(ca({},Ia),{name:qi}),(((Al=$i==null?void 0:$i[qi])==null?void 0:Al.item_type)=="single"||((hu=$i==null?void 0:$i[qi])==null?void 0:hu.item_type)=="multiple")&&Zr.createElement(Kr,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((Ys=$i==null?void 0:$i[qi])==null?void 0:Ys.item_type)!="single",form:Vi,choiceKey:[qi,"choices"],titleKey:[qi,"name"],analysisKey:[qi,"analysis"],choiceOptionsPath:["sub_item_banks",qi,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((Tl=$i==null?void 0:$i[qi])==null?void 0:Tl.item_type)=="completion"&&Zr.createElement(mn,{form:Vi,name:qi,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:[qi,"use_blank_score"],titleKey:[qi,"name"],analysisKey:[qi,"analysis"],isOrdered:[qi,"is_ordered"],answerKey:[qi,"standard_answer"],key:Dr}),((Oo=$i==null?void 0:$i[qi])==null?void 0:Oo.item_type)=="judgement"&&Zr.createElement(oo,{form:Vi,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[qi,"name"],analysisKey:[qi,"analysis"],choiceKey:[qi,"choices"]}),((Ns=$i==null?void 0:$i[qi])==null?void 0:Ns.item_type)=="subjective"&&Zr.createElement(zr,{showKeywords:!0,form:Vi,titleKey:[qi,"name"],analysisKey:[qi,"analysis"],answerTexts:[qi,"answer_texts"],useKeywords:[qi,"use_keywords"],keywords:[qi,"keywords"],indexs:qi,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})))})))};var mo=(0,qt.connect)(({loading:ae,globalSetting:Ie})=>({globalSetting:Ie,loading:ae.effects}),null,null,{forwardRef:!0})((0,gt.forwardRef)(qr)),zo=kt(84842),dr=kt(17149),Ya=kt(82326),da=kt(54172),Yo={flex_box_center:"flex_box_center___xDdtW",flex_space_between:"flex_space_between___J4mFI",flex_box_vertical_center:"flex_box_vertical_center___hDYn6",flex_box_center_end:"flex_box_center_end___H7l1j",flex_box_column:"flex_box_column___TPd2T",questionInfo:"questionInfo___ABq66",label:"label___VQOr7",content:"content____HZ6z",leftPart:"leftPart___YB0y5",rightPart:"rightPart___UVMmS",dragItem:"dragItem___Hbx8k",blackText:"blackText___U4u33",greyText:"greyText___rWIL_",iconWrapper:"iconWrapper___I0kek",contentArea:"contentArea___hGC13",dragging:"dragging___z7VVY",hidden:"hidden___nWAxb",dragIcon:"dragIcon___j91TC",deleteIcon:"deleteIcon___cmCqc",disabled:"disabled___ZlKMj",challengeNameWrapper:"challengeNameWrapper___SpiRb",challengeName:"challengeName___lmQe2",shixunPreviewFooter:"shixunPreviewFooter___u0CzD",shixunInfoWrapper:"shixunInfoWrapper___HzLHD",shixunInfo:"shixunInfo___qaQlF",btnToDetail:"btnToDetail___scXqr",fixedBottom:"fixedBottom___wTBAR",cancelBtn:"cancelBtn___Km4Gi",confirmBtn:"confirmBtn___WrECz",previewBtn:"previewBtn____oGPS",setScoreModalTable:"setScoreModalTable___CjDlp",title:"title___cQWdZ",tipcontent:"tipcontent___A8tZ5",name:"name___CvfT9",tip:"tip___EvoCF",info:"info___y_ayi",img:"img___X9CNn"},so=kt(9148),Sa=kt(58433),ns=kt(82264),Jo=kt(45937),ps=kt(28426),ms=kt(94361),La=({open:ae,onCancel:Ie,onOk:_t})=>{const ce=(0,Sa.g)(),[Gr,Sr,kr,ur]=(0,Jo.U)(ns.Gm,{page:1,limit:10,keyword:"",diff:"",shixun_publish_status:"",discipline_id:"",sub_discipline_id:"",type:0,include_shixuns:!0,item_type:"SHIXUN"}),[wr,vo]=(0,gt.useState)(!1);(0,gt.useEffect)(()=>{ae&&kr({page:1,limit:10,type:0},!0).then(Vi=>{(Vi==null?void 0:Vi.shixuns_count)===0&&vo(!0)})},[ae]);const[Xr,Ir]=(0,gt.useState)([]),[Ui,eo]=(0,gt.useState)([]);return gt.createElement(Dt.default,{title:"\u9009\u62E9\u5B9E\u8BAD\u9898",open:ae,width:948,centered:!0,closable:!0,onCancel:Ie,onOk:()=>_t(Ui),destroyOnClose:!0},gt.createElement(Pe.Z,{justify:"space-between",className:"mb20",style:{maxHeight:650}},gt.createElement(Bt.Z,null,gt.createElement(dr.Z,{style:{width:160},size:"large",placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:ce,onChange:Vi=>{kr({page:1,discipline_id:Vi==null?void 0:Vi[0],sub_discipline_id:Vi==null?void 0:Vi[1]})}}),gt.createElement(Ya.default,{className:"ml20",style:{width:118},size:"large",placeholder:"\u96BE\u5EA6",allowClear:!0,options:[{label:"\u521D\u7EA7",value:1},{label:"\u4E2D\u7EA7",value:2},{label:"\u4E2D\u9AD8\u7EA7",value:3},{label:"\u9AD8\u7EA7",value:4}],onChange:Vi=>kr({page:1,diff:Vi})}),gt.createElement(Ya.default,{className:"ml20",placeholder:"\u5168\u90E8\u72B6\u6001",style:{width:118},size:"large",allowClear:!0,options:[{label:"\u672A\u53D1\u5E03",value:"unpublish"},{label:"\u9759\u9ED8\u53D1\u5E03",value:"silent_publish"},{label:"\u516C\u5F00\u53D1\u5E03",value:"public_publish"}],onChange:Vi=>kr({page:1,shixun_publish_status:Vi})})),gt.createElement(so.t7,{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",style:{width:290},onChange:Vi=>{kr({keyword:Vi,page:1})}})),wr?gt.createElement("div",null,gt.createElement(ps.Z,{customText:"\u6682\u65E0\u6570\u636E",ButtonText:"\u524D\u5F80\u5B9E\u8DF5\u9879\u76EE\u5E93\uFF0C\u6DFB\u52A0\u66F4\u591A\u8BD5\u9898>",ButtonClick:()=>(0,Xt.xg)("/shixuns")})):gt.createElement(da.default,{loading:Sr,rowKey:"id",columns:[{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:"30%",ellipsis:{showTitle:!0},render:(Vi,ar)=>gt.createElement("div",{style:{display:"flex",alignItems:"center"}},gt.createElement("div",{className:ar!=null&&ar.high_resources_consume?Yo.title:"",title:Vi||"--"},gt.createElement(It.Z,{key:1,showLines:1,showTextOnly:!0,value:Vi||"--"})),(ar==null?void 0:ar.high_resources_consume)&&gt.createElement(ms.Z,{type:"shixun",style:{marginLeft:10}}))},{title:"\u96BE\u5EA6",dataIndex:"level"},{title:"\u5173\u5361\u6570\u91CF",dataIndex:"challenges_count",key:"challenges_count",render:(Vi,ar,Qi)=>gt.createElement("span",null,Vi||"- -")},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"study_count"},{title:gt.createElement("span",null,"\u53D1\u5E03\u72B6\u6001 ",gt.createElement(Ee.Z,{title:"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528"},gt.createElement(Yi.Z,null))),dataIndex:"shixun_tag_num_name",key:"shixun_tag_num_name",width:100,render:(Vi,ar,Qi)=>gt.createElement("span",null,Vi||"- -")},{title:"\u64CD\u4F5C",render(Vi,ar){const{title:Qi,challenge_names:br,author_name:Fr,identifier:Dr,author_school_name:no,study_count:Zi}=ar||{};return gt.createElement("div",null,gt.createElement("span",{style:{color:"#165DFF",cursor:"pointer"},onClick:()=>{Dt.default.confirm({title:"\u9898\u76EE\u8BE6\u60C5",closable:!0,width:1e3,centered:!0,icon:null,footer:null,content:gt.createElement("div",null,gt.createElement(It.Z,{value:Qi,style:{marginBottom:18}}),gt.createElement("div",{className:Yo.challengeNameWrapper},br.map((Br,Pi)=>gt.createElement("div",{className:Yo.challengeName,key:Pi},"\u7B2C",(0,Xt.EM)(Pi+1),"\u9898\xA0",Br))),gt.createElement(Pe.Z,{className:Yo.shixunPreviewFooter,justify:"space-between",style:{alignItems:"center"}},gt.createElement(Bt.Z,{className:Yo.shixunInfoWrapper},gt.createElement("span",null,"\u521B\u5EFA\u8005"),gt.createElement("span",{className:Yo.shixunInfo},Fr.split("\u3001")[0]),gt.createElement("span",null,"\u6240\u5C5E\u5355\u4F4D"),gt.createElement("span",{className:Yo.shixunInfo},no),gt.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),gt.createElement("span",{className:Yo.shixunInfo},Zi)),gt.createElement(he.ZP,{type:"primary",className:Yo.btnToDetail,onClick:()=>(0,Xt.xg)(`/shixuns/${Dr}/challenges?exercise=true`)},gt.createElement("i",{className:"iconfont icon-shixunkecheng"}),"\u5B9E\u8BAD\u8BE6\u60C5")))})}},"\u67E5\u770B"),(ar==null?void 0:ar.shixun_tag_num)===1&&gt.createElement("a",{target:"_blank",href:`/shixuns/${ar==null?void 0:ar.identifier}/challenges`,style:{marginLeft:10}},"\u53BB\u53D1\u5E03"))}}],dataSource:ur==null?void 0:ur.items,rowSelection:{type:"radio",selectedRowKeys:Xr,preserveSelectedRowKeys:!0,getCheckboxProps:Vi=>({disabled:Vi.shixun_tag_num===1}),onChange(Vi,ar){var Qi,br,Fr;console.log(Vi),Ir(Vi);const Dr=[];for(const Zi of Ui)Vi.includes(Zi.id)&&Dr.push(Zi);const no=Dr.map(Zi=>Zi.id);for(const Zi of ar)Zi&&Vi.includes(Zi.id)&&!no.includes(Zi.id)&&Dr.push({id:Zi.id,difficulty:Zi.level,identifier:Zi.identifier,name:Zi.name,real_name:(Qi=Zi==null?void 0:Zi.author_name)==null?void 0:Qi.split("\u3001")[0],school_name:Zi.author_school_name,challenge_names:Zi.challenge_names,challenges:(br=Zi.challenge_names)==null?void 0:br.map((Br,Pi)=>({subject:Br,id:Pi,score:5})),score:((Fr=Zi.challenge_names)==null?void 0:Fr.length)*5,study_count:Zi.study_count,challenges_count:Zi.challenges_count});eo(Dr)}},pagination:{current:Gr.page,pageSize:Gr.limit,total:ur==null?void 0:ur.items_count,showTotal:Vi=>gt.createElement("span",null,"\u5171\xA0",gt.createElement("span",{style:{color:"#165DFF"}},Vi),"\xA0\u6761\u6570\u636E"),showQuickJumper:!0,onChange(Vi,ar){kr({page:Vi,limit:ar})},size:"default"},scroll:{y:400}}))},Iu=kt(3039),Cu=kt(75736),js=(ae,Ie,_t)=>new Promise((ce,Gr)=>{var Sr=wr=>{try{ur(_t.next(wr))}catch(vo){Gr(vo)}},kr=wr=>{try{ur(_t.throw(wr))}catch(vo){Gr(vo)}},ur=wr=>wr.done?ce(wr.value):Promise.resolve(wr.value).then(Sr,kr);ur((_t=_t.apply(ae,Ie)).next())}),zs=({visible:ae,getdata:Ie,onCancel:_t,onRandomExchange:ce,selectFromProblemSet:Gr,questionParams:Sr})=>{const[kr,ur]=(0,gt.useState)(!1),[wr,vo]=(0,gt.useState)(!1),[Xr,Ir]=(0,gt.useState)({}),Ui=(0,qt.useParams)(),[eo,Vi]=(0,gt.useState)(),ar=(Qi,br)=>js(void 0,null,function*(){vo(!0);const Fr=yield(0,Ht.ZP)(`/api/exercises/${Ui.categoryId}/toggle_random_question.json`,{method:"post",body:{question_id:Sr.id,item_bank_id:Qi,shixuns_info:[{id:Qi,is_copy:br!=1,is_use:br!=1}]}});vo(!1),Fr!=null&&Fr.status||(ge.ZP.info("\u6362\u9898\u6210\u529F"),_t(),Ie())});return gt.createElement(Dt.default,{title:"\u8BF7\u9009\u62E9\u66FF\u6362\u65B9\u5F0F",open:ae,onCancel:_t,centered:!0,maskClosable:!0,footer:null},gt.createElement(Pe.Z,{justify:"center",className:"pb20"},gt.createElement(zo.Z,{onClick:ce},"\u968F\u673A\u66F4\u6362"),(Sr==null?void 0:Sr.type)!=="PRACTICAL"&&gt.createElement(he.ZP,{style:{marginLeft:24},onClick:Gr},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"),(Sr==null?void 0:Sr.type)==="PRACTICAL"&&gt.createElement(he.ZP,{style:{marginLeft:24},onClick:()=>{ur(!0)}},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9")),gt.createElement(La,{open:kr,onCancel:()=>ur(!1),onOk:Qi=>js(void 0,null,function*(){if(console.log("----selectedRows",Qi,Ui),(Qi==null?void 0:Qi.length)<=0){ge.ZP.info("\u8BF7\u9009\u62E9\u5B9E\u8BAD");return}let br=Qi==null?void 0:Qi.map(Dr=>Dr==null?void 0:Dr.id),Fr=yield(0,Cu.Tr)({id:[...br],course_id:Ui.coursesId,type:"shixun"});(Fr==null?void 0:Fr.student_count)===0?ar(br==null?void 0:br[0],1):(Vi(br),Ir(Fr)),ur(!1)})}),gt.createElement(Iu.Z,{resdata:Xr,type:"shixun",okloading:wr,oktext:(Xr==null?void 0:Xr.can_copy_num)===0?"\u786E\u5B9A":"\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362",onok:Qi=>js(void 0,null,function*(){ar(eo==null?void 0:eo[0],2)})}))},Vl=kt(77762),lu=kt(24334),Eu=kt(90283),xa=kt(60572),rl=kt(32162),_u=kt(48790),Kl=Object.defineProperty,uu=Object.defineProperties,Xa=Object.getOwnPropertyDescriptors,Ja=Object.getOwnPropertySymbols,Aa=Object.prototype.hasOwnProperty,Ga=Object.prototype.propertyIsEnumerable,Bl=(ae,Ie,_t)=>Ie in ae?Kl(ae,Ie,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Ie]=_t,ga=(ae,Ie)=>{for(var _t in Ie||(Ie={}))Aa.call(Ie,_t)&&Bl(ae,_t,Ie[_t]);if(Ja)for(var _t of Ja(Ie))Ga.call(Ie,_t)&&Bl(ae,_t,Ie[_t]);return ae},_o=(ae,Ie)=>uu(ae,Xa(Ie)),Eo=(ae,Ie,_t)=>new Promise((ce,Gr)=>{var Sr=wr=>{try{ur(_t.next(wr))}catch(vo){Gr(vo)}},kr=wr=>{try{ur(_t.throw(wr))}catch(vo){Gr(vo)}},ur=wr=>wr.done?ce(wr.value):Promise.resolve(wr.value).then(Sr,kr);ur((_t=_t.apply(ae,Ie)).next())});const Ao=({data:ae,submit:Ie,goBack:_t,loading:ce,onTypeScore:Gr,editPreview:Sr=!1,onSkipExamination:kr,selectValue:ur,onExchange:wr,getdata:vo,handleMarkWrongQuestion:Xr,dispatch:Ir})=>{var Ui,eo,Vi,ar,Qi,br,Fr,Dr,no,Zi,Br;const Pi=(0,gt.useRef)(),[$i,pr]=(0,gt.useState)(null),[uo,yo]=(0,gt.useState)(!1),[Ro,qi]=(0,gt.useState)(!1),Ia=(0,gt.useRef)(),[Cr]=ue.default.useForm(),co=(0,qt.useParams)(),[Ar,ea]=(0,gt.useState)(!1),[Zo,Fa]=(0,gt.useState)([]);(0,gt.useEffect)(()=>{yo(!0)},[]),(0,gt.useEffect)(()=>{Sr||(0,Xt.Dk)("\u8BD5\u5377\u9884\u89C8")},[Sr]),(0,gt.useEffect)(()=>{var sn;((sn=ae==null?void 0:ae.questionList)==null?void 0:sn.length)>0&&(ae==null||ae.questionList.forEach(tr=>{var mr;tr.type==="PRACTICAL"&&((mr=tr==null?void 0:tr.questions)==null||mr.forEach((hr,Ci)=>{var fo;Zo[Ci]=!((fo=hr==null?void 0:hr.shixun)!=null&&fo.ignore_prompt),Fa([...Zo])}))}))},[ae]);const Al=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],hu={SINGLE:"\u5355\u9009\u9898",MULTIPLE:"\u591A\u9009\u9898",JUDGMENT:"\u5224\u65AD\u9898",COMPLETION:"\u586B\u7A7A\u9898",SUBJECTIVE:"\u7B80\u7B54\u9898",PRACTICAL:"\u5B9E\u8BAD\u9898",PROGRAM:"\u7F16\u7A0B\u9898",BPROGRAM:"\u7A0B\u5E8F\u586B\u7A7A\u9898",COMBINATION:"\u7EC4\u5408\u9898"},Ys={single:"\u5355\u9009\u9898",multiple:"\u591A\u9009\u9898",judgement:"\u5224\u65AD\u9898",completion:"\u586B\u7A7A\u9898",subjective:"\u7B80\u7B54\u9898",practical:"\u5B9E\u8BAD\u9898",program:"\u7F16\u7A0B\u9898",bprogram:"\u7A0B\u5E8F\u586B\u7A7A\u9898",combination:"\u7EC4\u5408\u9898"},Tl=sn=>{var tr;const mr=[];return gt.createElement(gt.Fragment,null,gt.createElement("aside",{className:Ut.single},(tr=sn==null?void 0:sn.choices)==null?void 0:tr.map((hr,Ci)=>(hr.is_answer&&mr.push(rl.k4[Ci]),gt.createElement("ul",{key:Ci},gt.createElement("li",null,rl.k4[Ci],"\u3001"),gt.createElement("li",null,gt.createElement(It.Z,{value:hr.choice_text})))))),gt.createElement("div",{className:Ut.analysis},gt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",mr.join(""),gt.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Al[sn.difficulty])),gt.createElement("aside",null,gt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),gt.createElement(It.Z,{value:sn.analysis?sn.analysis:"\u6682\u65E0\u89E3\u6790"})),gt.createElement("ul",null,gt.createElement("li",null,gt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(sn==null?void 0:sn.discipline_name)||"--"}/${sn==null?void 0:sn.sub_discipline_name}`),gt.createElement(Ee.Z,{title:sn==null?void 0:sn.tag_discipline_name},gt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},gt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),sn==null?void 0:sn.tag_discipline_name)))))},Oo=(sn,tr)=>{var mr;const hr=(mr=sn==null?void 0:sn.standard_answer)==null?void 0:mr.map((Ci,fo)=>{var Uo;return gt.createElement("div",{key:fo},`\u7B54\u6848\uFF08\u586B\u7A7A${Ci==null?void 0:Ci.position}\uFF09\uFF1A${(Uo=Ci==null?void 0:Ci.answer_text)==null?void 0:Uo.join("\u3001")}`)});return gt.createElement(gt.Fragment,null,gt.createElement("div",{className:Ut.analysis},gt.createElement("div",{style:{display:"flex"}},gt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),gt.createElement("div",null,hr)),gt.createElement("aside",null,gt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),gt.createElement(It.Z,{value:sn.analysis?sn.analysis:"\u6682\u65E0\u89E3\u6790"})),gt.createElement("ul",null,gt.createElement("li",null,gt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),tr?`${(tr==null?void 0:tr.discipline_name)||"--"}/${tr==null?void 0:tr.sub_discipline_name}`:`${(sn==null?void 0:sn.discipline_name)||"--"}/${sn==null?void 0:sn.sub_discipline_name}`),gt.createElement(Ee.Z,{title:tr?tr==null?void 0:tr.tag_discipline_name:sn==null?void 0:sn.tag_discipline_name},gt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},gt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),tr?tr==null?void 0:tr.tag_discipline_name:sn==null?void 0:sn.tag_discipline_name)))))},Ns=sn=>{var tr;const mr=(tr=sn==null?void 0:sn.standard_answer)==null?void 0:tr.map((hr,Ci)=>gt.createElement("div",{key:Ci},`\u7B54\u6848\uFF08\u586B\u7A7A${(hr==null?void 0:hr.position)||(hr==null?void 0:hr.exercise_choice_id)}\uFF09\uFF1A${hr==null?void 0:hr.answer_text}`));return gt.createElement(gt.Fragment,null,gt.createElement("div",{className:Ut.analysis},gt.createElement("div",{style:{display:"flex"}},gt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),gt.createElement("div",null,mr)),gt.createElement("aside",null,gt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),gt.createElement(It.Z,{value:sn.analysis?sn.analysis:"\u6682\u65E0\u89E3\u6790"})),gt.createElement("ul",null,gt.createElement("li",null,gt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(sn==null?void 0:sn.discipline_name)||"--"}/${sn==null?void 0:sn.sub_discipline_name}`),gt.createElement(Ee.Z,{title:sn==null?void 0:sn.tag_discipline_name},gt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},gt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),sn==null?void 0:sn.tag_discipline_name)))))},gl=(sn,tr)=>{var mr;return gt.createElement("div",{className:Ut.analysis},gt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",(mr=sn==null?void 0:sn.answer_texts)==null?void 0:mr[0]),gt.createElement("aside",null,gt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),gt.createElement(It.Z,{value:sn.analysis?sn.analysis:"\u6682\u65E0\u89E3\u6790"})),gt.createElement("ul",null,gt.createElement("li",null,gt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),tr?`${(tr==null?void 0:tr.discipline_name)||"--"}/${tr==null?void 0:tr.sub_discipline_name}`:`${(sn==null?void 0:sn.discipline_name)||"--"}/${sn==null?void 0:sn.sub_discipline_name}`),gt.createElement(Ee.Z,{title:tr?tr==null?void 0:tr.tag_discipline_name:sn==null?void 0:sn.tag_discipline_name},gt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},gt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),tr?tr==null?void 0:tr.tag_discipline_name:sn==null?void 0:sn.tag_discipline_name))))},ol=sn=>{var tr,mr;return gt.createElement("div",{className:Ut.analysis},gt.createElement("aside",null,gt.createElement("span",{className:Ut.text},"\u9884\u671F\u8F93\u51FA:"),gt.createElement(It.Z,{value:(tr=sn==null?void 0:sn.program_attr)==null?void 0:tr.description})),gt.createElement("div",{style:{marginTop:20}},"\u6B63\u786E\u7B54\u6848\uFF1A",((mr=sn==null?void 0:sn.program_attr)==null?void 0:mr.answer_text)||"--"),gt.createElement("aside",null,gt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),gt.createElement(It.Z,{value:sn.analysis?sn.analysis:"\u6682\u65E0\u89E3\u6790"})),gt.createElement("ul",null,gt.createElement("li",null,gt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(sn==null?void 0:sn.discipline_name)||"--"}/${sn==null?void 0:sn.sub_discipline_name}`),gt.createElement(Ee.Z,{title:sn==null?void 0:sn.tag_discipline_name},gt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},gt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),sn==null?void 0:sn.tag_discipline_name))))},Ph=(sn,tr)=>{var mr;return gt.createElement("div",null,(mr=sn==null?void 0:sn.sub_item_banks)==null?void 0:mr.map((hr,Ci)=>{var fo,Uo;const jo=[];return gt.createElement(gt.Fragment,null,gt.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333",paddingTop:"15px"}},tr+1+"."+(Ci+1),"\uFF08",hu[hr.item_type]||Ys[hr.item_type],"\uFF09",hr.name),(hr.item_type=="SINGLE"||hr.item_type=="MULTIPLE"||hr.item_type=="JUDGMENT"||hr.item_type=="single"||hr.item_type=="multiple"||hr.item_type=="judgement")&&gt.createElement(gt.Fragment,null,gt.createElement("aside",{className:Ut.single},(fo=hr==null?void 0:hr.choices)==null?void 0:fo.map((ko,ls)=>(ko.is_answer&&jo.push(rl.k4[ls]),gt.createElement("ul",{key:ls},gt.createElement("li",null,rl.k4[ls],"\u3001"),gt.createElement("li",null,gt.createElement(It.Z,{value:ko.choice_text})))))),gt.createElement("div",{className:Ut.analysis},gt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",jo.join(""),gt.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Al[hr.difficulty])),gt.createElement("aside",null,gt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),gt.createElement(It.Z,{value:hr.analysis?hr.analysis:"\u6682\u65E0\u89E3\u6790"})),gt.createElement("ul",null,gt.createElement("li",null,gt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(sn==null?void 0:sn.discipline_name)||"--"}/${sn==null?void 0:sn.sub_discipline_name}`),gt.createElement(Ee.Z,{title:sn==null?void 0:sn.tag_discipline_name},gt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},gt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),sn==null?void 0:sn.tag_discipline_name))))),(hr.item_type=="COMPLETION"||hr.item_type=="completion")&&Oo(hr,sn),(hr.item_type=="SUBJECTIVE"||hr.item_type=="subjective")&&gl(hr,sn),((Uo=ae==null?void 0:ae.exam)==null?void 0:Uo.exercise_status)===3&&gt.createElement("div",{className:"flex gap-20px mt20"},gt.createElement(Eu.Z,{state:hr==null?void 0:hr.is_wrong,onClick:()=>{Xr==null||Xr({value:_o(ga({},hr),{question_id:hr==null?void 0:hr.id,question_score:hr==null?void 0:hr.score})})}}),hr.item_type=="single"&&gt.createElement(he.ZP,{style:{color:"#3061D0"},onClick:()=>{ml({value:hr})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848")))}))},Ul=sn=>{var tr,mr,hr;return gt.createElement("div",{style:{marginTop:"12px"}},(mr=(tr=sn==null?void 0:sn.shixun)==null?void 0:tr.challenges)==null?void 0:mr.map((Ci,fo)=>gt.createElement("div",{className:"c-grey-666 font14 mb10 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},gt.createElement("div",null,gt.createElement("span",{className:"mr5"},"\u7B2C",fo+1,"\u5173"),gt.createElement(Ee.Z,{key:fo,title:Ci==null?void 0:Ci.challenge_name},gt.createElement("span",null,(0,Xt.Pq)(Ci==null?void 0:Ci.challenge_name,44)))),Sr&&gt.createElement("div",null,"\u5206\u503C\uFF1A",Ci.score,"\u5206"))),gt.createElement(qt.Link,{style:{float:"right"},target:"_blank",to:`/shixuns/${(hr=sn==null?void 0:sn.shixun)==null?void 0:hr.identifier}/challenges`},"\u5B9E\u8BAD\u8BE6\u60C5"),gt.createElement("div",{style:{clear:"both"}}))},bo=sn=>{let tr=sn.questions_score/sn.questions_count;Dt.default.confirm({icon:null,centered:!0,title:"\u5206\u6570\u8BBE\u7F6E",content:gt.createElement("div",{className:Ut.modalColumn},gt.createElement("div",{className:Ut.modalRow,style:{justifyContent:"flex-start"}},gt.createElement("sup",{className:Ut.sup},"*"),gt.createElement("span",null,sn==null?void 0:sn.name,"\uFF1A"),gt.createElement(ee.Z,{min:0,precision:1,defaultValue:tr,onChange:mr=>{tr=mr}}),gt.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Eo(void 0,null,function*(){var mr;if(!tr)return ge.ZP.warning("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),Promise.reject();const hr={type:sn==null?void 0:sn.type,score:tr,scoreTotal:Number((mr=tr*sn.questions_count)==null?void 0:mr.toFixed(1))};Gr(hr)})})},Wo=()=>{let sn="";Dt.default.confirm({icon:null,centered:!0,title:"\u4FDD\u5B58\u8BD5\u5377",content:gt.createElement("div",{className:Ut.modalColumn},gt.createElement("div",{style:{color:"#676A6C",display:"flex",alignItems:"center"},className:"font14 mt20"},gt.createElement("img",{style:{marginRight:5},src:un.Z}),"\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"),gt.createElement("div",{className:Ut.modalRow,style:{marginTop:20}},gt.createElement("sup",{className:Ut.sup},"*"),gt.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),gt.createElement(Qt.default,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:sn,onChange:tr=>{sn=tr.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Eo(void 0,null,function*(){var tr;if(!sn)return ge.ZP.warning("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),Promise.reject();const mr=[],hr=[],Ci=[],fo=[];(tr=ae==null?void 0:ae.questionList)==null||tr.forEach(jo=>{var ko;(ko=jo.questions)==null||ko.forEach(ls=>{let oa=jo.questions_score/jo.questions_count;oa=oa&&oa.toFixed(1),jo.type==="COMBINATION"&&Ci.push({id:ls.id,sub_item_bank_ids:ls.sub_item_banks.map(_a=>_a.id)}),jo.type==="PRACTICAL"?fo.push(ls.id):(mr.push(ls.id),hr.push(oa))})}),console.log("-----",Ci),yield Ie({item_bank_ids:mr,item_bank_scores:hr,name:sn,combination_item_banks:Ci,shixun_ids:fo})})})},Pa=(sn,tr,mr,hr)=>{var Ci;const fo=`${location.pathname}${location.search}`,Uo=(Ci=hr.questions)==null?void 0:Ci.map(jo=>jo==null?void 0:jo.id);if(fo.includes("exercise"))Ia.current={id:sn,ids:Uo,type:tr,index:mr},qi(!0);else{let jo=Dt.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u8981\u66F4\u6362\u8BE5\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!0,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Eo(void 0,null,function*(){jo.update({cancelButtonProps:{disabled:!0}}),yield wr({single_question_id:sn,seleted_item_bank_ids:Uo},{type:tr,index:mr}),jo.update({cancelButtonProps:{disabled:!1}}),ge.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898")})})}},is=sn=>{var tr;const mr=(tr=sn.questions)==null?void 0:tr.map(fo=>fo==null?void 0:fo.id),hr=sn.name;let Ci=Dt.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:`\u786E\u8BA4\u66F4\u6362${hr}\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F`,cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Eo(void 0,null,function*(){Ci.update({cancelButtonProps:{disabled:!0}}),yield wr({seleted_item_bank_ids:mr},{type:sn.type}),Ci.update({cancelButtonProps:{disabled:!1}}),ge.ZP.success(`\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210${hr}\u8BD5\u9898`)})})},Qa=()=>{let sn=Dt.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362\u9884\u89C8\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Eo(void 0,null,function*(){sn.update({cancelButtonProps:{disabled:!0}}),yield wr(),sn.update({cancelButtonProps:{disabled:!1}}),ge.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898")})})},pl=sn=>{console.log(sn,"key"),kr(sn-1)},Yl=(sn,tr)=>{var mr,hr;if(tr==="SINGLE")return gt.createElement(gt.Fragment,null,gt.createElement(zn,{ref:Pi,editData:sn,isEdit:!0}),gt.createElement(jt.Z,null));if(tr==="MULTIPLE")return gt.createElement(gt.Fragment,null,gt.createElement(yi,{ref:Pi,editData:sn,isEdit:!0}),gt.createElement(jt.Z,null));if(tr==="JUDGMENT")return gt.createElement(gt.Fragment,null,gt.createElement(We,{ref:Pi,editData:sn,isEdit:!0}),gt.createElement(jt.Z,null));if(tr==="COMPLETION")return gt.createElement(gt.Fragment,null,gt.createElement(Ce,{ref:Pi,editData:sn,isEdit:!0}),gt.createElement(jt.Z,null));if(tr==="SUBJECTIVE")return gt.createElement(gt.Fragment,null,gt.createElement(Gn,{ref:Pi,editData:sn,isEdit:!0}),gt.createElement(jt.Z,null));if(tr==="COMBINATION")return gt.createElement(gt.Fragment,null,gt.createElement(mo,{ref:Pi,editData:sn,isEdit:!0}),gt.createElement(jt.Z,null));if(tr==="BPROGRAM")return gt.createElement(gt.Fragment,null,gt.createElement(ue.default,{form:Cr,style:{marginTop:20},onFinishFailed:Ci=>{var fo,Uo;Ci.errorFields[0].name.includes("standard_answers")?ge.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):ge.ZP.error(Ci.errorFields[0].errors[0]),Cr.scrollToField((Uo=(fo=Ci==null?void 0:Ci.errorFields)==null?void 0:fo[0])==null?void 0:Uo.name,{behavior:"smooth",block:"center"})},onFinish:Ci=>Eo(void 0,null,function*(){var fo;let Uo=_o(ga({question_score:sn.score},Ci),{question_type:8,hack:_o(ga({},Ci.hack),{difficult:sn.program_attr.difficult}),hack_codes:_o(ga({},Ci.hack_codes),{code:lu.Base64.encode((fo=Ci.hack_codes)==null?void 0:fo.code)})});Ar&&(Uo.is_cover=1);const jo=yield(0,Ht.ZP)(`/api/exercise_questions/${sn.id}.json`,{method:"put",body:Uo});(jo==null?void 0:jo.status)===0&&(ge.ZP.success("\u7F16\u8F91\u6210\u529F"),pl(ur+1)),pr(null)})},gt.createElement(Vl.tc,{form:Cr,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,hackidentifier:(mr=sn==null?void 0:sn.program_attr)==null?void 0:mr.identifier,answerKey:"standard_answers"}),gt.createElement(jt.Z,null)));if(tr==="PROGRAM"&&qt.history.push(`/problems/${(hr=sn==null?void 0:sn.program_attr)==null?void 0:hr.identifier}/edit?type=exercises&express_id=${co.categoryId}&question_id=${sn==null?void 0:sn.id}&score=${sn==null?void 0:sn.score}&callback_url=${location.pathname}&select=${ur}&exercise=true`),tr==="PRACTICAL")return gt.createElement(gt.Fragment,null,gt.createElement(ei,{ref:Pi,editData:sn,isEdit:!0}),gt.createElement(jt.Z,null))},du=(sn,tr)=>Eo(void 0,null,function*(){var mr,hr,Ci,fo,Uo,jo;const ko=yield(mr=Pi.current)==null?void 0:mr.onSave();if(!ko)return;const ls=er=>{const us=er.map(Ha=>Ha.choice_text.trim().replace(/^\s+|\s+$/g,""));return new Set(us).size!==us.length},oa={question_score:tr.score,analysis:ko.analysis};if(sn==="SINGLE"||sn==="MULTIPLE"||sn==="JUDGMENT"){if(sn!=="JUDGMENT"&&ls(ko==null?void 0:ko.choices)){ge.ZP.error("\u9009\u62E9\u9898\u9009\u9879\u5185\u5BB9\u4E0D\u80FD\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58");return}const er=[],us=[];oa.question_type=sn==="JUDGMENT"?2:1,oa.question_title=ko==null?void 0:ko.name,(hr=ko==null?void 0:ko.choices)==null||hr.forEach((vl,Ha)=>{er.push(vl.choice_text),vl!=null&&vl.is_answer&&us.push(Ha+1)}),oa.question_choices=er,oa.standard_answers=us}if(sn==="COMPLETION"){let er=(Ci=ko==null?void 0:ko.standard_answers)==null?void 0:Ci.map((Ha,Xs)=>(Ha==null?void 0:Ha.score)<=0?Xs+1:null).filter(Ha=>Ha!==null);if((er==null?void 0:er.length)>0)return ge.ZP.warning(`\u7B2C${er.join("\u3001")}\u9879\u7684\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A`),!1;let us=(fo=ko==null?void 0:ko.standard_answers)==null?void 0:fo.reduce((Ha,Xs)=>Ha+(Number(Xs==null?void 0:Xs.score)||0),0);if(parseFloat(us.toFixed(2))!=(oa==null?void 0:oa.question_score))return ge.ZP.warning("\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E\u8BE5\u5C0F\u9898\u5206\u503C\uFF01"),!1;oa.is_ordered=ko.is_ordered,oa.question_title=ko==null?void 0:ko.name,oa.use_blank_score=ko==null?void 0:ko.use_blank_score,oa.question_type=3;const vl=[];(Uo=ko==null?void 0:ko.standard_answers)==null||Uo.forEach((Ha,Xs)=>{vl.push({choice_id:Ha.position,answer_text:Ha.answer_text,score:Ha.score})}),oa.standard_answers=vl,oa.downcase=ko==null?void 0:ko.downcase,oa.no_space=ko==null?void 0:ko.no_space}if(sn==="SUBJECTIVE"&&(console.log("editorData"),console.log(ko),oa.question_title=ko==null?void 0:ko.name,oa.question_type=4,oa.answer_texts=ko==null?void 0:ko.answer_texts,oa.use_keywords=ko==null?void 0:ko.use_keywords,oa.keywords=ko==null?void 0:ko.keywords),sn==="COMBINATION"){oa.question_title=ko==null?void 0:ko.name,oa.question_type=7;try{oa.sub_questions=(jo=ko==null?void 0:ko.sub_item_banks)==null?void 0:jo.map((er,us)=>{var vl,Ha,Xs;if((er==null?void 0:er.item_type)=="single"||(er==null?void 0:er.item_type)=="multiple"){if(ls(er==null?void 0:er.choices))throw new Error(`\u7B2C${us+1}\u5C0F\u9898\u9009\u9879\u5185\u5BB9\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58`);const ih=[],Ma=[];return(vl=er==null?void 0:er.choices)==null||vl.forEach((Ea,Xl)=>{ih.push(Ea.choice_text),Ea!=null&&Ea.is_answer&&Ma.push(Xl+1)}),{id:er.id,question_id:er.id,question_title:er.name,difficulty:er.difficulty,question_type:(er==null?void 0:er.item_type)=="single"?0:(er==null?void 0:er.item_type)=="multiple"?1:2,question_choices:ih,standard_answers:Ma,analysis:er.analysis,question_score:er==null?void 0:er.score}}else if((er==null?void 0:er.item_type)=="completion"){let ih=(Ha=er==null?void 0:er.standard_answer)==null?void 0:Ha.reduce((Ea,Xl)=>Ea+(Number(Xl==null?void 0:Xl.score)||0),0);if(parseFloat(ih.toFixed(2))!=(er==null?void 0:er.score))throw new Error("\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E\u8BE5\u5C0F\u9898\u5206\u503C\uFF01");const Ma=[];return(Xs=er==null?void 0:er.standard_answer)==null||Xs.forEach((Ea,Xl)=>{Ma.push({choice_id:Ea.position,answer_text:Ea.answer_text,score:Ea.score})}),{id:er.id,question_id:er.id,is_ordered:er.is_ordered,question_title:er.name,difficulty:er.difficulty,question_type:3,standard_answers:Ma,use_blank_score:er.use_blank_score,analysis:er.analysis,downcase:er==null?void 0:er.downcase,no_space:er==null?void 0:er.no_space,question_score:er==null?void 0:er.score}}else if((er==null?void 0:er.item_type)=="subjective")return{id:er.id,question_id:er.id,question_title:er.name,question_type:4,difficulty:er.difficulty,answer_texts:er==null?void 0:er.answer_texts,analysis:er.analysis,question_score:er==null?void 0:er.score,use_keywords:er.use_keywords,keywords:er==null?void 0:er.keywords}})}catch(er){ge.ZP.warning(er.message);return}delete oa.analysis}let _a=!1;(tr==null?void 0:tr.is_my)===1&&(_a=yield new Promise((us,vl)=>{Dt.default.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:()=>{us(!0)},onCancel:()=>{us(!1)}})})),_a&&(oa.is_cover=1);const Ru=sn!=="PRACTICAL"?yield(0,Ht.ZP)(`/api/exercise_questions/${tr.id}.json`,{method:"put",body:oa}):yield(0,Ht.ZP)(`/api/exercise_questions/${tr.id}/update_shixun_score.json`,{method:"post",body:ga({},ko)});(Ru==null?void 0:Ru.status)===0&&(ge.ZP.success("\u7F16\u8F91\u6210\u529F"),pl(ur+1),pr(null))}),al=()=>Eo(void 0,null,function*(){(0,qt.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u66F4\u65B0\u8BD5\u5377\uFF0C\u8BF7\u7A0D\u540E..."}}),(yield(0,Ht.ZP)(`/api/exercises/${co.categoryId}/sync_random_question.json`,{method:"post"})).status===0&&(yield kr(ur),ge.ZP.success("\u66F4\u65B0\u6210\u529F")),(0,qt.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1}})}),ml=({value:sn}={})=>{var tr;const mr=[];let hr=[];const Ci=(tr=sn==null?void 0:sn.choices)==null?void 0:tr.map((Uo,jo)=>{var ko;const ls=jo+1;return Uo!=null&&Uo.is_answer&&(mr.push(ls),hr.push(ls)),{value:ls,label:gt.createElement(It.Z,{className:"c-black font14",value:`${(ko=rl.k4)==null?void 0:ko[jo]}. ${Uo==null?void 0:Uo.choice_text}`}),disabled:Uo==null?void 0:Uo.origin_standard_answer}}),fo=Dt.default.confirm({centered:!0,icon:null,title:"\u589E\u8BBE\u6B63\u786E\u7B54\u6848",width:800,content:gt.createElement(gt.Fragment,null,"\u5F53\u524D\u8BD5\u9898\u7684\u6B63\u786E\u7B54\u6848\u4E3A ",mr==null?void 0:mr.map(Uo=>{var jo;return(jo=rl.k4)==null?void 0:jo[Uo-1]}),"\uFF0C\u8BF7\u9009\u62E9\u9700\u8981\u589E\u8BBE\u4E3A\u6B63\u786E\u7B54\u6848\u7684\u9009\u9879\u3002",gt.createElement("br",null),"\u52FE\u9009\u63D0\u4EA4\u4E4B\u540E\uFF0C\u9009\u4E2D\u589E\u8BBE\u4E3A\u6B63\u786E\u7B54\u6848\u4EFB\u4E00\u9009\u9879\u7684\u5B66\u751F\u4E5F\u4F1A\u83B7\u5F97\u8BE5\u5C0F\u9898\u7684\u5206\u503C\uFF0C\u4F46\u4E0D\u4F1A\u4FEE\u6539\u5F53\u524D\u8BD5\u9898\u7684\u9898\u578B\u3002\u53D6\u6D88\u52FE\u9009\u63D0\u4EA4\u4E4B\u540E\uFF0C\u4E5F\u4F1A\u91CD\u65B0\u8BA1\u7B97\u5BF9\u5E94\u5B66\u751F\u7684\u5F97\u5206\u3002",gt.createElement("br",null),gt.createElement(Ae.default.Group,{className:"flex-col mt20",options:Ci,defaultValue:hr,onChange:Uo=>{hr=Uo}})),onOk:()=>Eo(void 0,null,function*(){const Uo=yield(0,Ht.ZP)(`/api/exercises/${co.categoryId}/questions/${sn==null?void 0:sn.id}/add_standard_answers.json`,{method:"put",body:{standard_answer:hr}});(Uo==null?void 0:Uo.status)===0&&(ge.ZP.success("\u4FEE\u6539\u6210\u529F"),pl(ur+1))})})},rf=(Ui=ae==null?void 0:ae.questionList)==null?void 0:Ui.reduce((sn,tr)=>sn+Number(tr.questions_score),0),of=Sr&&((eo=ae==null?void 0:ae.exam)==null?void 0:eo.exercise_status)!==1,fg=sn=>Eo(void 0,null,function*(){const tr=yield(0,Ht.ZP)(`/api/courses/${co==null?void 0:co.coursesId}/sync_shixuns.json`,{method:"post",body:{exercise_ids:[co==null?void 0:co.categoryId],exercise_question_id:sn.id}});(tr==null?void 0:tr.status)===0&&(Ir({type:"classroomList/setActionTabs",payload:{}}),ge.ZP.info("\u5B9E\u8BAD\u540C\u6B65\u4E2D\uFF0C\u8BF7\u7A0D\u540E"))}),af=(sn,tr)=>Eo(void 0,null,function*(){let mr=yield(0,Ht.ZP)(`/api/courses/${co==null?void 0:co.coursesId}/ignore_prompt.json`,{method:"post",body:{container_type:"Exercise",container_id:co==null?void 0:co.categoryId,exercise_question_id:sn==null?void 0:sn.id}});(mr==null?void 0:mr.status)===0&&(Zo[tr]=!1,Fa([...Zo]))});return gt.createElement("section",{className:Ut.wrap},gt.createElement("div",{id:"id_left_preview",className:Ut.left,onMouseEnter:sn=>{const tr=document.getElementById("id_left_preview");tr.style.overflowY="auto"},onMouseLeave:sn=>{const tr=document.getElementById("id_left_preview");tr.style.overflowY="hidden"}},gt.createElement("div",{className:Ut.title},gt.createElement("div",{className:"body-overflow-initial"},gt.createElement("b",null),gt.createElement("span",null,"\u7B54\u9898\u5361"))),gt.createElement("div",{className:Ut.total},gt.createElement("div",null,gt.createElement("img",{src:Je}),gt.createElement("span",null,"\u9898\u6570(\u9053)"),gt.createElement("aside",null,ae==null?void 0:ae.all_questions_count)),gt.createElement("div",{className:"mr30 ml30"},gt.createElement("img",{src:on}),gt.createElement("span",null,"\u603B\u5206(\u5206)"),gt.createElement("aside",null,rf&&rf.toFixed(1))),gt.createElement("div",null,gt.createElement("img",{src:Tt}),gt.createElement("span",null,"\u65F6\u957F(\u5206)"),gt.createElement("aside",null,((Vi=ae==null?void 0:ae.exam)==null?void 0:Vi.time)===-1||((ar=ae==null?void 0:ae.exam)==null?void 0:ar.time)===null?"\u4E0D\u9650":(Qi=ae==null?void 0:ae.exam)==null?void 0:Qi.time))),(br=ae==null?void 0:ae.questionList)==null?void 0:br.map((sn,tr)=>{var mr;return gt.createElement("div",{className:Ut.list,key:tr},gt.createElement("div",{className:Ut.name},gt.createElement("b",null),gt.createElement("span",null,sn.name)),gt.createElement("aside",null,gt.createElement("div",null,"\u5171",gt.createElement("span",{className:Ut.b},sn.questions_count),"\u9898 ",gt.createElement("span",{className:Ut.l},"|"),"\u5171",gt.createElement("span",{className:Ut.r},sn.questions_score),"\u5206"),gt.createElement("div",{className:Ut.answerSheet},(mr=sn==null?void 0:sn.questions)==null?void 0:mr.map((hr,Ci)=>gt.createElement("div",{onClick:()=>{const fo=`Anchor_${hr==null?void 0:hr.id}`;let Uo=document.getElementById(fo);Uo&&setTimeout(()=>Uo.scrollIntoView({block:"center",behavior:"smooth"}))},key:hr==null?void 0:hr.id,className:Ut.tag},Ci+1)))))})),gt.createElement("div",{className:Ut.right},gt.createElement("div",{className:Ut.examName,id:"examName"},gt.createElement("div",{className:Ut.name},gt.createElement(Ee.Z,{title:(Fr=ae==null?void 0:ae.exam)==null?void 0:Fr.name,getPopupContainer:sn=>sn.parentNode},gt.createElement("span",{className:Ut.t},(Dr=ae==null?void 0:ae.exam)==null?void 0:Dr.name))),Sr&&((no=ae==null?void 0:ae.exam)==null?void 0:no.exercise_status)===1&&gt.createElement(so.op,{openLoading:!0,shape:"default",onClick:()=>{Dt.default.confirm({title:"\u63D0\u793A",content:"\u786E\u8BA4\u6839\u636E\u6700\u65B0\u7684\u968F\u673A\u7EC4\u5377\u62BD\u9898\u89C4\u5219\u91CD\u65B0\u751F\u6210\u8BD5\u5377\u5417\uFF1F",onOk:()=>{al()}})},type:"primary"},"\u66F4\u65B0\u8BD5\u5377"),!Sr&&gt.createElement(he.ZP,{onClick:Qa,type:"primary"},"\u968F\u673A\u66F4\u6362")),gt.createElement("div",{className:Ut.topWarp},(Zi=ae==null?void 0:ae.questionList)==null?void 0:Zi.map((sn,tr)=>{var mr,hr;return gt.createElement(gt.Fragment,{key:tr},gt.createElement("div",{className:Ut.head,style:tr===0?{border:0,marginTop:-16}:{}},gt.createElement("div",{className:Ut.name},gt.createElement("b",null),gt.createElement("span",null,sn.name)),gt.createElement("div",{className:Ut.so},"\u5171",gt.createElement("span",{className:Ut.b},sn.questions_count," "),"\u9898 ",sn.type==="COMBINATION"&&`\uFF08\u5305\u542B${(mr=sn==null?void 0:sn.questions)==null?void 0:mr.map(Ci=>{var fo;return(fo=Ci==null?void 0:Ci.sub_item_banks)==null?void 0:fo.length}).reduce((Ci,fo)=>Ci+fo)}\u5C0F\u9898\uFF09`,gt.createElement("span",{className:Ut.l},"|"),"\u5171",gt.createElement("span",{className:Ut.r},sn.questions_score),"\u5206"),!Sr&&gt.createElement("div",{className:Ut.btn},gt.createElement(he.ZP,{onClick:()=>{bo(sn)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),gt.createElement(he.ZP,{onClick:()=>is(sn),type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),(hr=sn==null?void 0:sn.questions)==null?void 0:hr.map((Ci,fo)=>{var Uo,jo,ko,ls,oa;return $i===(Ci==null?void 0:Ci.id)?gt.createElement("div",{id:`Anchor_${Ci==null?void 0:Ci.id}`,className:Ut.content,style:{padding:0,marginTop:24},key:Ci==null?void 0:Ci.id},gt.createElement("div",{style:{float:"right",marginTop:`${(sn==null?void 0:sn.type)==="PRACTICAL"?"-2px":"-6px"}`}},gt.createElement(he.ZP,{onClick:()=>pr(null),className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),gt.createElement(he.ZP,{onClick:()=>{du(sn==null?void 0:sn.type,Ci)},type:"primary"},"\u4FDD\u5B58")),Yl(Ci,sn.type)):gt.createElement("div",{id:`Anchor_${Ci==null?void 0:Ci.id}`,className:Ut.content,key:Ci==null?void 0:Ci.id},gt.createElement("div",{className:Ut.titleWrap},(Ci==null?void 0:Ci.item_type)==="bprogram"?gt.createElement(It.Z,{style:{paddingRight:10},value:fo+1+"\u3001"+((Uo=Ci==null?void 0:Ci.program_attr)==null?void 0:Uo.description)}):gt.createElement(It.Z,{style:{paddingRight:10},className:Ut.titleHtml,value:fo+1+`\u3001${(Ci==null?void 0:Ci.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":""}`+(Ci==null?void 0:Ci.name)}),(0,_u.G5)()&&((jo=Ci==null?void 0:Ci.shixun)==null?void 0:jo.shixun_change)&&gt.createElement(se.Z,{trigger:"click",open:Zo[fo],onOpenChange:_a=>{Zo[fo]=!0,Fa([...Zo])},placement:"bottomLeft",autoAdjustOverflow:!1,title:null,content:gt.createElement("div",{style:{width:"310px",color:"#000"}},gt.createElement("div",null,"\u5B9E\u8BAD\u7BA1\u7406\u5458\u5BF9\u8BD5\u5377\u4E2D\u4F7F\u7528\u7684\u5B9E\u8DF5\u9879\u76EE\u8FDB\u884C\u4E86\u4FEE\u6539\uFF0C\u8BF7\u68C0\u67E5\u540E\uFF0C\u786E\u8BA4\u662F\u5426\u9700\u8981\u540C\u6B65\u5230\u8BD5\u5377\u4E2D"),gt.createElement("div",{className:Ut.btn_warp},gt.createElement(he.ZP,{size:"small",onClick:()=>af(Ci,fo)},"\u5FFD\u7565"),gt.createElement(he.ZP,{className:"ml20",size:"small",type:"primary",onClick:()=>{Zo[fo]=!1,Fa([...Zo]),Ir({type:"classroomList/setActionTabs",payload:{key:"\u5B9E\u8BAD\u540C\u6B65\u786E\u8BA4",onOK:()=>fg(Ci)}})}},"\u786E\u8BA4\u540C\u6B65"),gt.createElement(he.ZP,{className:"ml20",size:"small",type:"primary",onClick:()=>(0,Xt.xg)(`/shixuns/${Ci==null?void 0:Ci.forked_shixun_identifier}/challenges?exercise=true`)},"\u524D\u5F80\u67E5\u770B")))},gt.createElement("i",{className:"iconfont icon-tongzhi1 pl10 current",style:{fontSize:"16px",color:"#F7B500"},onClick:_a=>_a.stopPropagation()})),Sr&&gt.createElement(he.ZP,{onClick:()=>{var _a,Ru,er;if($i){ge.ZP.warning("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}Cr.setFieldsValue({standard_answers:Ci==null?void 0:Ci.standard_answer,hack:ga(ga({},Ci),Ci==null?void 0:Ci.program_attr),hack_codes:_o(ga({},Ci==null?void 0:Ci.program_attr),{code:lu.Base64.decode(((_a=Ci==null?void 0:Ci.program_attr)==null?void 0:_a.code)||"")}),hack_sets:ga({},(Ru=Ci==null?void 0:Ci.hack_sets)==null?void 0:Ru[0])}),(Ci==null?void 0:Ci.item_type)=="program"?qt.history.push(`/problems/newedit/${(er=Ci==null?void 0:Ci.program_attr)==null?void 0:er.identifier}?type=exercises&express_id=${co.categoryId}&question_id=${Ci==null?void 0:Ci.id}&score=${Ci==null?void 0:Ci.score}&exercise=true&callback_url=/classrooms/${co.coursesId}/exercise/${co.categoryId}/detail?random=true`):pr(Ci==null?void 0:Ci.id)},type:"primary",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),!of&&gt.createElement(he.ZP,{disabled:of,className:"ml20",onClick:()=>Pa(Ci==null?void 0:Ci.id,sn.type,fo,sn),type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(Ci==null?void 0:Ci.item_type)==="bprogram"&&gt.createElement(It.Z,{style:{paddingRight:10,paddingLeft:25},showProgramFill:!0,disabledFill:!0,className:Ut.titleHtml,value:lu.Base64.decode(((ko=Ci==null?void 0:Ci.program_attr)==null?void 0:ko.code)||"")}),(sn.type==="SINGLE"||sn.type==="JUDGMENT"||sn.type==="MULTIPLE")&&Tl(Ci),sn.type==="COMPLETION"&&Oo(Ci),sn.type==="SUBJECTIVE"&&gl(Ci),sn.type==="PROGRAM"&&ol(Ci),sn.type==="BPROGRAM"&&Ns(Ci),sn.type==="COMBINATION"&&Ph(Ci,fo),sn.type==="PRACTICAL"&&Ul(Ci),gt.createElement(Pe.Z,{className:"mt20",wrap:!1,align:"middle",gutter:20},((ls=ae==null?void 0:ae.exam)==null?void 0:ls.exercise_status)===3&&!["PROGRAM","BPROGRAM","PRACTICAL","COMBINATION"].includes(sn.type)&&gt.createElement(Bt.Z,null,gt.createElement(Eu.Z,{state:Ci==null?void 0:Ci.is_wrong,onClick:()=>{Xr==null||Xr({value:_o(ga({},Ci),{question_id:Ci==null?void 0:Ci.id,question_score:Ci==null?void 0:Ci.score})})}})),["PROGRAM","BPROGRAM","PRACTICAL"].includes(sn.type)&&(Ci==null?void 0:Ci.show_resubmit)&&gt.createElement(Bt.Z,null,gt.createElement(xa.C,{dataSource:_o(ga({},Ci),{question_id:Ci==null?void 0:Ci.id})})),((oa=ae==null?void 0:ae.exam)==null?void 0:oa.exercise_status)===3&&["SINGLE"].includes(sn.type)&&gt.createElement(Bt.Z,null,gt.createElement(he.ZP,{style:{color:"#3061D0"},onClick:()=>{ml({value:Ci})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848"))))}))}))),Sr?gt.createElement(so.vr,null,gt.createElement(nt.Z,{showTotal:Xt.rU,total:(Br=ae==null?void 0:ae.exam)==null?void 0:Br.total_num,pageSize:1,current:ur+1,showSizeChanger:!1,onChange:pl,showQuickJumper:!1,hideOnSinglePage:!1})):gt.createElement(so.vr,{LeftContent:gt.createElement(so.op,{onClick:_t,shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u8FD4\u56DE"),RightContent:gt.createElement(Pe.Z,{align:"middle"},gt.createElement(se.Z,{color:"#55575D",overlayClassName:Ut.popover,open:uo,getPopupContainer:sn=>sn==null?void 0:sn.parentNode,content:"\u5982\u60A8\u5BF9\u6B64\u4EFD\u8BD5\u9898\u6EE1\u610F\uFF0C\u53EF\u5C06\u6B64\u4EFD\u8BD5\u9898\u4FDD\u5B58\u4E3A\u56FA\u5B9A\u8BD5\u5377"},gt.createElement(so.op,{onMouseEnter:()=>yo(!0),onMouseLeave:()=>yo(!1),onClick:()=>Wo(),shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u4FDD\u5B58")),gt.createElement(so.op,{shape:"default",type:"primary",onClick:()=>Ie(),style:{height:38,marginLeft:20}},"\u63D0\u4EA4"))}),gt.createElement(zs,{visible:Ro,questionParams:Ia.current,getdata:vo,onRandomExchange:()=>Eo(void 0,null,function*(){const sn=Ia.current;yield wr({single_question_id:sn.id,seleted_item_bank_ids:sn.ids},{type:sn.type,index:sn.index}),qi(!1)}),selectFromProblemSet:()=>{const sn=Ia.current,tr=`${location.pathname}${location.search}`;tr.includes("exercise")&&qt.history.push(`/paperlibrary/exchangequestion?type=exercise&qid=${sn.id}&qtype=${sn.type}&exerciseid=${co.categoryId}&from=${tr}`)},onCancel:()=>{qi(!1)}}))};var Ta=(0,qt.connect)(({classroomList:ae})=>({classroomList:ae}))(Ao)},23129:function(Mn,Rn,kt){"use strict";kt.r(Rn),kt.d(Rn,{default:function(){return st}});var gt=kt(59301),Ut=kt(25690),ue={flex_box_center:"flex_box_center___kQBcj",flex_space_between:"flex_space_between___Znlbo",flex_box_vertical_center:"flex_box_vertical_center___CPD50",flex_box_center_end:"flex_box_center_end___jzPvK",flex_box_column:"flex_box_column___cvIBS",wrap:"wrap___lab8O",crumbs:"crumbs___qvTza"},Ee=kt(43554),he=kt(6767),Dt=kt(458),ee=kt(38986),ge=kt(51257),Qt=kt(59301),jt=Object.defineProperty,Ae=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,Bt=(pt,vt,St)=>vt in pt?jt(pt,vt,{enumerable:!0,configurable:!0,writable:!0,value:St}):pt[vt]=St,nt=(pt,vt)=>{for(var St in vt||(vt={}))se.call(vt,St)&&Bt(pt,St,vt[St]);if(Ae)for(var St of Ae(vt))Pe.call(vt,St)&&Bt(pt,St,vt[St]);return pt},et=(pt,vt,St)=>new Promise((Et,Tt)=>{var It=Ht=>{try{Xt(St.next(Ht))}catch(pe){Tt(pe)}},qt=Ht=>{try{Xt(St.throw(Ht))}catch(pe){Tt(pe)}},Xt=Ht=>Ht.done?Et(Ht.value):Promise.resolve(Ht.value).then(It,qt);Xt((St=St.apply(pt,vt)).next())});const ht=({paperlibrary:pt,user:vt,globalSetting:St,dispatch:Et,location:Tt})=>{var It,qt,Xt,Ht;const[pe]=(0,Ut.useSearchParams)(),re=pe.get("select")||0,[Ne,ye]=(0,gt.useState)(!1),[xe,Ue]=(0,gt.useState)(!0),[je,Je]=(0,gt.useState)(Number(re)),[fn,te]=(0,gt.useState)({}),Jt=(0,Ut.useParams)(),{userInfo:Xe}=vt,{actionTabs:On}=pt;(0,gt.useEffect)(()=>(Et({type:"globalSetting/footerToggle",payload:!1}),()=>{Et({type:"globalSetting/footerToggle",payload:!0})}),[]),(0,gt.useEffect)(()=>(Et({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Et({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),Et({type:"exercise/getWorkSetting",payload:nt({},Jt)}),()=>{Et({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Et({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}),[]),(0,gt.useEffect)(()=>{bn(je)},[]),(0,gt.useEffect)(()=>{var vn;(vn=On==null?void 0:On.params)!=null&&vn.isUpdateData&&bn(je)},[(It=On==null?void 0:On.params)==null?void 0:It.isUpdateData]);const bn=(vn=0)=>et(void 0,null,function*(){console.log(Jt),Ue(!0);const ne=yield(0,ee.ZP)(`/api/exercises/${Jt.categoryId}/preview_random_exercise.json`,{method:"get",params:{num:vn}});Et({type:"paperlibrary/setActionTabs",payload:{params:{isUpdateData:!1}}}),Ue(!1),te((0,ge.PF)(ne))}),De=()=>{Ut.history.push(`/classrooms/${Jt.coursesId}/exercise`)},on=()=>{alert("\u4FDD\u5B58")},un=(vn,ne)=>et(void 0,null,function*(){const wn=yield(0,ee.ZP)(`/api/exercises/${Jt.categoryId}/toggle_random_question.json`,{method:"post",body:{question_id:vn==null?void 0:vn.single_question_id}});wn!=null&&wn.question&&(he.ZP.info("\u6362\u9898\u6210\u529F"),bn(je))}),Kn=vn=>et(void 0,null,function*(){document.body.scrollIntoView(),Je(vn),yield bn(vn)}),Me=vn=>{Et({type:"exercise/setActionTabs",payload:{key:"\u6807\u8BB0\u9519\u9898",params:vn}})};return console.log((0,Ut.useLocation)(),"location333"),Qt.createElement("section",{className:ue.wrap},Qt.createElement(Dt.Z,{loading:xe,active:!0,paragraph:{rows:5}},((Xt=(qt=(0,Ut.useLocation)())==null?void 0:qt.pathname)==null?void 0:Xt.includes("preview"))&&Qt.createElement("div",{className:ue.crumbs},Qt.createElement("b",null),Qt.createElement("span",{className:"current",onClick:()=>Ut.history.push(`/classrooms/${Jt.coursesId}/exercise`)},`${(Ht=Xe==null?void 0:Xe.course)==null?void 0:Ht.course_name}>`),Qt.createElement("span",{className:"current",onClick:()=>Ut.history.push(`/classrooms/${Jt.coursesId}/exercise`)},"\u8BD5\u5377\u5217\u8868>"),Qt.createElement("span",{style:{color:"#bebebe"}},"\u9884\u89C8")),Qt.createElement(Ee.Z,{loading:Ne,submit:on,goBack:De,data:fn,getdata:()=>{bn(je)},selectValue:je,editPreview:!0,onExchange:un,onSkipExamination:Kn,handleMarkWrongQuestion:Me})))};var st=(0,Ut.connect)(({paperlibrary:pt,user:vt,globalSetting:St})=>({paperlibrary:pt,user:vt,globalSetting:St}))(ht)},58433:function(Mn,Rn,kt){"use strict";kt.d(Rn,{g:function(){return he}});var gt=kt(59301),Ut=kt(93629),ue=kt(55305),Ee=(Dt,ee,ge)=>new Promise((Qt,jt)=>{var Ae=Bt=>{try{Pe(ge.next(Bt))}catch(nt){jt(nt)}},se=Bt=>{try{Pe(ge.throw(Bt))}catch(nt){jt(nt)}},Pe=Bt=>Bt.done?Qt(Bt.value):Promise.resolve(Bt.value).then(Ae,se);Pe((ge=ge.apply(Dt,ee)).next())});const he=()=>{const[Dt,ee]=(0,gt.useState)([]);return(0,gt.useEffect)(()=>{Ee(void 0,null,function*(){const Qt=yield(0,Ut.d1)({source:"question"});Qt!=null&&Qt.disciplines&&ee((0,ue.L)(Qt==null?void 0:Qt.disciplines))})},[]),Dt}},45937:function(Mn,Rn,kt){"use strict";kt.d(Rn,{U:function(){return Qt}});var gt=kt(59301),Ut=Object.defineProperty,ue=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable,Dt=(jt,Ae,se)=>Ae in jt?Ut(jt,Ae,{enumerable:!0,configurable:!0,writable:!0,value:se}):jt[Ae]=se,ee=(jt,Ae)=>{for(var se in Ae||(Ae={}))Ee.call(Ae,se)&&Dt(jt,se,Ae[se]);if(ue)for(var se of ue(Ae))he.call(Ae,se)&&Dt(jt,se,Ae[se]);return jt},ge=(jt,Ae,se)=>new Promise((Pe,Bt)=>{var nt=st=>{try{ht(se.next(st))}catch(pt){Bt(pt)}},et=st=>{try{ht(se.throw(st))}catch(pt){Bt(pt)}},ht=st=>st.done?Pe(st.value):Promise.resolve(st.value).then(nt,et);ht((se=se.apply(jt,Ae)).next())});function Qt(jt,Ae){const[se,Pe]=(0,gt.useState)(Ae),[Bt,nt]=(0,gt.useState)(!1),[et,ht]=(0,gt.useState)();return[se,Bt,(pt,vt=!1)=>ge(this,null,function*(){const St=vt?Ae:ee(ee({},se),pt);nt(!0),Pe(St);const Et=yield jt(St);return nt(!1),ht(Et),Et}),et,ht]}},81428:function(Mn,Rn,kt){"use strict";kt.d(Rn,{AL:function(){return St},Iy:function(){return Ae},Qv:function(){return Bt},ez:function(){return vt},jb:function(){return se}});var gt=kt(32834),Ut=kt.n(gt),ue=kt(11690),Ee=kt.n(ue);let he=1;function Dt(Xt,Ht){const pe=Xt.match(/^(\s+)(?:```)/);if(pe===null)return Ht;const re=pe[1];return Ht.split(`
`).map(Ne=>{const ye=Ne.match(/^\s+/);if(ye===null)return Ne;const[xe]=ye;return xe.length>=re.length?Ne.slice(re.length):Ne}).join(`
`)}let ee=[],ge=["<ul>"];const Qt=new(Ut()).Renderer,jt=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ae(){ee.length=0,ge=["<ul>"]}const se={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Pe(Xt,Ht,pe,re){if(Ht>=Xt.length||Xt[Ht].level<=pe)return Ht;var Ne=Xt[Ht];re.push("<li><a href='#"+he+Ne.anchor+"'>"+Ne.text+"</a>"),Ht++;var ye=[];return Ht=Pe(Xt,Ht,Ne.level,ye),ye.length>0&&(re.push("<ul>"),ye.forEach(function(xe){re.push(xe)}),re.push("</ul>")),re.push("</li>"),Ht=Pe(Xt,Ht,pe,re),Ht}function Bt(){return Pe(ee,0,0,ge),ge.push("</ul>"),ge.join("")}const nt={heading(Xt){const Ht=jt.exec(Xt);if(he+=1,Ht)return{type:"heading",raw:Ht[0],depth:Ht[1].length,text:Ht[2]}},fences(Xt){const Ht=this.rules.block.fences.exec(Xt);if(Ht){const pe=Ht[0];let re=Dt(pe,Ht[3]||"");const Ne=Ht[2]?Ht[2].trim():Ht[2];if(["latex","katex","math"].indexOf(Ne)>=0){const ye=st(),xe=re;re=ye,pt[ye]={type:"block",expression:xe}}return{type:"code",raw:pe,lang:Ne,text:re}}}},et=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let ht=0;const st=()=>`__special_katext_id_${ht++}__`;let pt={};function vt(){return pt}function St(){ht=0,pt={}}function Et(Xt){return Xt=Xt.replace(et,(Ht,pe)=>{const re=st();return pt[re]={type:"inline",expression:pe},re}),Xt}const Tt=Qt.listitem;Qt.listitem=function(Xt){return Tt(Et(Xt))};const It=Qt.paragraph;Qt.paragraph=function(Xt){return It(Et(Xt))};const qt=Qt.tablecell;Qt.tablecell=function(Xt,Ht){return qt(Et(Xt),Ht)},Qt.code=function(Xt,Ht,pe){const re=(Ht||"").match(/\S*/)[0];return re?["latex","katex","math"].indexOf(re)>=0?`<p class='editormd-tex'>${Xt}</p>`:`<pre class="prettyprint linenums"><code class="language-${Ht}">${pe?Xt:(0,ue.escape)(Xt,!0)}</code></pre>
`:'<pre class="prettyprint linenums"><code>'+(pe?Xt:(0,ue.escape)(Xt,!0))+"</code></pre>"},Qt.heading=function(Xt,Ht,pe){let re=this.options.headerPrefix+pe.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return ee.push({anchor:re,level:Ht,text:Xt}),"<h"+Ht+' id="'+he+re+'">'+Xt+"</h"+Ht+">"},Ut().setOptions({silent:!0,gfm:!0,pedantic:!1}),Ut().use({tokenizer:nt,renderer:Qt}),Rn.ZP=Ut()},99498:function(Mn,Rn,kt){(function(gt){gt(kt(89780))})(function(gt){gt.defineOption("placeholder","",function(ge,Qt,jt){var Ae=jt&&jt!=gt.Init;if(Qt&&!Ae)ge.on("blur",he),ge.on("change",Dt),ge.on("swapDoc",Dt),gt.on(ge.getInputField(),"compositionupdate",ge.state.placeholderCompose=function(){Ee(ge)}),Dt(ge);else if(!Qt&&Ae){ge.off("blur",he),ge.off("change",Dt),ge.off("swapDoc",Dt),gt.off(ge.getInputField(),"compositionupdate",ge.state.placeholderCompose),Ut(ge);var se=ge.getWrapperElement();se.className=se.className.replace(" CodeMirror-empty","")}Qt&&!ge.hasFocus()&&he(ge)});function Ut(ge){ge.state.placeholder&&(ge.state.placeholder.parentNode.removeChild(ge.state.placeholder),ge.state.placeholder=null)}function ue(ge){Ut(ge);var Qt=ge.state.placeholder=document.createElement("pre");Qt.style.cssText="height: 0; overflow: visible",Qt.style.direction=ge.getOption("direction"),Qt.className="CodeMirror-placeholder CodeMirror-line-like";var jt=ge.getOption("placeholder");typeof jt=="string"&&(jt=document.createTextNode(jt)),Qt.appendChild(jt),ge.display.lineSpace.insertBefore(Qt,ge.display.lineSpace.firstChild)}function Ee(ge){setTimeout(function(){var Qt=!1,jt=ge.getInputField();jt.nodeName=="TEXTAREA"?Qt=!jt.value:ge.lineCount()==1&&(Qt=!/[^\u200b]/.test(jt.querySelector(".CodeMirror-line").textContent)),Qt?ue(ge):Ut(ge)},20)}function he(ge){ee(ge)&&ue(ge)}function Dt(ge){var Qt=ge.getWrapperElement(),jt=ee(ge);Qt.className=Qt.className.replace(" CodeMirror-empty","")+(jt?" CodeMirror-empty":""),jt?ue(ge):Ut(ge)}function ee(ge){return ge.lineCount()===1&&ge.getLine(0)===""}})},25717:function(Mn,Rn,kt){(function(gt){gt(kt(89780))})(function(gt){var Ut={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},ue=gt.Pos;gt.defineOption("autoCloseBrackets",!1,function(nt,et,ht){ht&&ht!=gt.Init&&(nt.removeKeyMap(he),nt.state.closeBrackets=null),et&&(Dt(Ee(et,"pairs")),nt.state.closeBrackets=et,nt.addKeyMap(he))});function Ee(nt,et){return et=="pairs"&&typeof nt=="string"?nt:typeof nt=="object"&&nt[et]!=null?nt[et]:Ut[et]}var he={Backspace:Qt,Enter:jt};function Dt(nt){for(var et=0;et<nt.length;et++){var ht=nt.charAt(et),st="'"+ht+"'";he[st]||(he[st]=ee(ht))}}Dt(Ut.pairs+"`");function ee(nt){return function(et){return se(et,nt)}}function ge(nt){var et=nt.state.closeBrackets;if(!et||et.override)return et;var ht=nt.getModeAt(nt.getCursor());return ht.closeBrackets||et}function Qt(nt){var et=ge(nt);if(!et||nt.getOption("disableInput"))return gt.Pass;for(var ht=Ee(et,"pairs"),st=nt.listSelections(),pt=0;pt<st.length;pt++){if(!st[pt].empty())return gt.Pass;var vt=Pe(nt,st[pt].head);if(!vt||ht.indexOf(vt)%2!=0)return gt.Pass}for(var pt=st.length-1;pt>=0;pt--){var St=st[pt].head;nt.replaceRange("",ue(St.line,St.ch-1),ue(St.line,St.ch+1),"+delete")}}function jt(nt){var et=ge(nt),ht=et&&Ee(et,"explode");if(!ht||nt.getOption("disableInput"))return gt.Pass;for(var st=nt.listSelections(),pt=0;pt<st.length;pt++){if(!st[pt].empty())return gt.Pass;var vt=Pe(nt,st[pt].head);if(!vt||ht.indexOf(vt)%2!=0)return gt.Pass}nt.operation(function(){var St=nt.lineSeparator()||`
`;nt.replaceSelection(St+St,null),nt.execCommand("goCharLeft"),st=nt.listSelections();for(var Et=0;Et<st.length;Et++){var Tt=st[Et].head.line;nt.indentLine(Tt,null,!0),nt.indentLine(Tt+1,null,!0)}})}function Ae(nt){var et=gt.cmpPos(nt.anchor,nt.head)>0;return{anchor:new ue(nt.anchor.line,nt.anchor.ch+(et?-1:1)),head:new ue(nt.head.line,nt.head.ch+(et?1:-1))}}function se(nt,et){var ht=ge(nt);if(!ht||nt.getOption("disableInput"))return gt.Pass;var st=Ee(ht,"pairs"),pt=st.indexOf(et);if(pt==-1)return gt.Pass;for(var vt=Ee(ht,"closeBefore"),St=Ee(ht,"triples"),Et=st.charAt(pt+1)==et,Tt=nt.listSelections(),It=pt%2==0,qt,Xt=0;Xt<Tt.length;Xt++){var Ht=Tt[Xt],pe=Ht.head,re,Ne=nt.getRange(pe,ue(pe.line,pe.ch+1));if(It&&!Ht.empty())re="surround";else if((Et||!It)&&Ne==et)Et&&Bt(nt,pe)?re="both":St.indexOf(et)>=0&&nt.getRange(pe,ue(pe.line,pe.ch+3))==et+et+et?re="skipThree":re="skip";else if(Et&&pe.ch>1&&St.indexOf(et)>=0&&nt.getRange(ue(pe.line,pe.ch-2),pe)==et+et){if(pe.ch>2&&/\bstring/.test(nt.getTokenTypeAt(ue(pe.line,pe.ch-2))))return gt.Pass;re="addFour"}else if(Et){var ye=pe.ch==0?" ":nt.getRange(ue(pe.line,pe.ch-1),pe);if(!gt.isWordChar(Ne)&&ye!=et&&!gt.isWordChar(ye))re="both";else return gt.Pass}else if(It&&(Ne.length===0||/\s/.test(Ne)||vt.indexOf(Ne)>-1))re="both";else return gt.Pass;if(!qt)qt=re;else if(qt!=re)return gt.Pass}var xe=pt%2?st.charAt(pt-1):et,Ue=pt%2?et:st.charAt(pt+1);nt.operation(function(){if(qt=="skip")nt.execCommand("goCharRight");else if(qt=="skipThree")for(var je=0;je<3;je++)nt.execCommand("goCharRight");else if(qt=="surround"){for(var Je=nt.getSelections(),je=0;je<Je.length;je++)Je[je]=xe+Je[je]+Ue;nt.replaceSelections(Je,"around"),Je=nt.listSelections().slice();for(var je=0;je<Je.length;je++)Je[je]=Ae(Je[je]);nt.setSelections(Je)}else qt=="both"?(nt.replaceSelection(xe+Ue,null),nt.triggerElectric(xe+Ue),nt.execCommand("goCharLeft")):qt=="addFour"&&(nt.replaceSelection(xe+xe+xe+xe,"before"),nt.execCommand("goCharRight"))})}function Pe(nt,et){var ht=nt.getRange(ue(et.line,et.ch-1),ue(et.line,et.ch+1));return ht.length==2?ht:null}function Bt(nt,et){var ht=nt.getTokenAt(ue(et.line,et.ch+1));return/\bstring/.test(ht.type)&&ht.start==et.ch&&(et.ch==0||!/\bstring/.test(nt.getTokenTypeAt(et)))}})},6313:function(Mn,Rn,kt){(function(gt){gt(kt(89780),kt(32855))})(function(gt){gt.defineOption("autoCloseTags",!1,function(Qt,jt,Ae){if(Ae!=gt.Init&&Ae&&Qt.removeKeyMap("autoCloseTags"),!!jt){var se={name:"autoCloseTags"};(typeof jt!="object"||jt.whenClosing!==!1)&&(se["'/'"]=function(Pe){return Dt(Pe)}),(typeof jt!="object"||jt.whenOpening!==!1)&&(se["'>'"]=function(Pe){return Ee(Pe)}),Qt.addKeyMap(se)}});var Ut=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ue=["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 Ee(Qt){if(Qt.getOption("disableInput"))return gt.Pass;for(var jt=Qt.listSelections(),Ae=[],se=Qt.getOption("autoCloseTags"),Pe=0;Pe<jt.length;Pe++){if(!jt[Pe].empty())return gt.Pass;var Bt=jt[Pe].head,nt=Qt.getTokenAt(Bt),et=gt.innerMode(Qt.getMode(),nt.state),ht=et.state,st=et.mode.xmlCurrentTag&&et.mode.xmlCurrentTag(ht),pt=st&&st.name;if(!pt)return gt.Pass;var vt=et.mode.configuration=="html",St=typeof se=="object"&&se.dontCloseTags||vt&&Ut,Et=typeof se=="object"&&se.indentTags||vt&&ue;nt.end>Bt.ch&&(pt=pt.slice(0,pt.length-nt.end+Bt.ch));var Tt=pt.toLowerCase();if(!pt||nt.type=="string"&&(nt.end!=Bt.ch||!/[\"\']/.test(nt.string.charAt(nt.string.length-1))||nt.string.length==1)||nt.type=="tag"&&st.close||nt.string.indexOf("/")==Bt.ch-nt.start-1||St&&ee(St,Tt)>-1||ge(Qt,et.mode.xmlCurrentContext&&et.mode.xmlCurrentContext(ht)||[],pt,Bt,!0))return gt.Pass;var It=typeof se=="object"&&se.emptyTags;if(It&&ee(It,pt)>-1){Ae[Pe]={text:"/>",newPos:gt.Pos(Bt.line,Bt.ch+2)};continue}var qt=Et&&ee(Et,Tt)>-1;Ae[Pe]={indent:qt,text:">"+(qt?`
`:"")+"</"+pt+">",newPos:qt?gt.Pos(Bt.line+1,0):gt.Pos(Bt.line,Bt.ch+1)}}for(var Xt=typeof se=="object"&&se.dontIndentOnAutoClose,Pe=jt.length-1;Pe>=0;Pe--){var Ht=Ae[Pe];Qt.replaceRange(Ht.text,jt[Pe].head,jt[Pe].anchor,"+insert");var pe=Qt.listSelections().slice(0);pe[Pe]={head:Ht.newPos,anchor:Ht.newPos},Qt.setSelections(pe),!Xt&&Ht.indent&&(Qt.indentLine(Ht.newPos.line,null,!0),Qt.indentLine(Ht.newPos.line+1,null,!0))}}function he(Qt,jt){for(var Ae=Qt.listSelections(),se=[],Pe=jt?"/":"</",Bt=Qt.getOption("autoCloseTags"),nt=typeof Bt=="object"&&Bt.dontIndentOnSlash,et=0;et<Ae.length;et++){if(!Ae[et].empty())return gt.Pass;var ht=Ae[et].head,st=Qt.getTokenAt(ht),pt=gt.innerMode(Qt.getMode(),st.state),vt=pt.state;if(jt&&(st.type=="string"||st.string.charAt(0)!="<"||st.start!=ht.ch-1))return gt.Pass;var St,Et=pt.mode.name!="xml"&&Qt.getMode().name=="htmlmixed";if(Et&&pt.mode.name=="javascript")St=Pe+"script";else if(Et&&pt.mode.name=="css")St=Pe+"style";else{var Tt=pt.mode.xmlCurrentContext&&pt.mode.xmlCurrentContext(vt);if(!Tt||Tt.length&&ge(Qt,Tt,Tt[Tt.length-1],ht))return gt.Pass;St=Pe+Tt[Tt.length-1]}Qt.getLine(ht.line).charAt(st.end)!=">"&&(St+=">"),se[et]=St}if(Qt.replaceSelections(se),Ae=Qt.listSelections(),!nt)for(var et=0;et<Ae.length;et++)(et==Ae.length-1||Ae[et].head.line<Ae[et+1].head.line)&&Qt.indentLine(Ae[et].head.line)}function Dt(Qt){return Qt.getOption("disableInput")?gt.Pass:he(Qt,!0)}gt.commands.closeTag=function(Qt){return he(Qt)};function ee(Qt,jt){if(Qt.indexOf)return Qt.indexOf(jt);for(var Ae=0,se=Qt.length;Ae<se;++Ae)if(Qt[Ae]==jt)return Ae;return-1}function ge(Qt,jt,Ae,se,Pe){if(!gt.scanForClosingTag)return!1;var Bt=Math.min(Qt.lastLine()+1,se.line+500),nt=gt.scanForClosingTag(Qt,se,null,Bt);if(!nt||nt.tag!=Ae)return!1;for(var et=Pe?1:0,ht=jt.length-1;ht>=0&&jt[ht]==Ae;ht--)++et;se=nt.to;for(var ht=1;ht<et;ht++){var st=gt.scanForClosingTag(Qt,se,null,Bt);if(!st||st.tag!=Ae)return!1;se=st.to}return!0}})},32855:function(Mn,Rn,kt){(function(gt){gt(kt(89780))})(function(gt){"use strict";var Ut=gt.Pos;function ue(ht,st){return ht.line-st.line||ht.ch-st.ch}var Ee="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",he=Ee+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Dt=new RegExp("<(/?)(["+Ee+"]["+he+"]*)","g");function ee(ht,st,pt,vt){this.line=st,this.ch=pt,this.cm=ht,this.text=ht.getLine(st),this.min=vt?Math.max(vt.from,ht.firstLine()):ht.firstLine(),this.max=vt?Math.min(vt.to-1,ht.lastLine()):ht.lastLine()}function ge(ht,st){var pt=ht.cm.getTokenTypeAt(Ut(ht.line,st));return pt&&/\btag\b/.test(pt)}function Qt(ht){if(!(ht.line>=ht.max))return ht.ch=0,ht.text=ht.cm.getLine(++ht.line),!0}function jt(ht){if(!(ht.line<=ht.min))return ht.text=ht.cm.getLine(--ht.line),ht.ch=ht.text.length,!0}function Ae(ht){for(;;){var st=ht.text.indexOf(">",ht.ch);if(st==-1){if(Qt(ht))continue;return}if(!ge(ht,st+1)){ht.ch=st+1;continue}var pt=ht.text.lastIndexOf("/",st),vt=pt>-1&&!/\S/.test(ht.text.slice(pt+1,st));return ht.ch=st+1,vt?"selfClose":"regular"}}function se(ht){for(;;){var st=ht.ch?ht.text.lastIndexOf("<",ht.ch-1):-1;if(st==-1){if(jt(ht))continue;return}if(!ge(ht,st+1)){ht.ch=st;continue}Dt.lastIndex=st,ht.ch=st;var pt=Dt.exec(ht.text);if(pt&&pt.index==st)return pt}}function Pe(ht){for(;;){Dt.lastIndex=ht.ch;var st=Dt.exec(ht.text);if(!st){if(Qt(ht))continue;return}if(!ge(ht,st.index+1)){ht.ch=st.index+1;continue}return ht.ch=st.index+st[0].length,st}}function Bt(ht){for(;;){var st=ht.ch?ht.text.lastIndexOf(">",ht.ch-1):-1;if(st==-1){if(jt(ht))continue;return}if(!ge(ht,st+1)){ht.ch=st;continue}var pt=ht.text.lastIndexOf("/",st),vt=pt>-1&&!/\S/.test(ht.text.slice(pt+1,st));return ht.ch=st+1,vt?"selfClose":"regular"}}function nt(ht,st){for(var pt=[];;){var vt=Pe(ht),St,Et=ht.line,Tt=ht.ch-(vt?vt[0].length:0);if(!vt||!(St=Ae(ht)))return;if(St!="selfClose")if(vt[1]){for(var It=pt.length-1;It>=0;--It)if(pt[It]==vt[2]){pt.length=It;break}if(It<0&&(!st||st==vt[2]))return{tag:vt[2],from:Ut(Et,Tt),to:Ut(ht.line,ht.ch)}}else pt.push(vt[2])}}function et(ht,st){for(var pt=[];;){var vt=Bt(ht);if(!vt)return;if(vt=="selfClose"){se(ht);continue}var St=ht.line,Et=ht.ch,Tt=se(ht);if(!Tt)return;if(Tt[1])pt.push(Tt[2]);else{for(var It=pt.length-1;It>=0;--It)if(pt[It]==Tt[2]){pt.length=It;break}if(It<0&&(!st||st==Tt[2]))return{tag:Tt[2],from:Ut(ht.line,ht.ch),to:Ut(St,Et)}}}}gt.registerHelper("fold","xml",function(ht,st){for(var pt=new ee(ht,st.line,0);;){var vt=Pe(pt);if(!vt||pt.line!=st.line)return;var St=Ae(pt);if(!St)return;if(!vt[1]&&St!="selfClose"){var Et=Ut(pt.line,pt.ch),Tt=nt(pt,vt[2]);return Tt&&ue(Tt.from,Et)>0?{from:Et,to:Tt.from}:null}}}),gt.findMatchingTag=function(ht,st,pt){var vt=new ee(ht,st.line,st.ch,pt);if(!(vt.text.indexOf(">")==-1&&vt.text.indexOf("<")==-1)){var St=Ae(vt),Et=St&&Ut(vt.line,vt.ch),Tt=St&&se(vt);if(!(!St||!Tt||ue(vt,st)>0)){var It={from:Ut(vt.line,vt.ch),to:Et,tag:Tt[2]};return St=="selfClose"?{open:It,close:null,at:"open"}:Tt[1]?{open:et(vt,Tt[2]),close:It,at:"close"}:(vt=new ee(ht,Et.line,Et.ch,pt),{open:It,close:nt(vt,Tt[2]),at:"open"})}}},gt.findEnclosingTag=function(ht,st,pt,vt){for(var St=new ee(ht,st.line,st.ch,pt);;){var Et=et(St,vt);if(!Et)break;var Tt=new ee(ht,st.line,st.ch,pt),It=nt(Tt,Et.tag);if(It)return{open:Et,close:It}}},gt.scanForClosingTag=function(ht,st,pt,vt){var St=new ee(ht,st.line,st.ch,vt?{from:0,to:vt}:null);return nt(St,pt)}})},89780:function(Mn){(function(Rn,kt){Mn.exports=kt()})(this,function(){"use strict";var Rn=navigator.userAgent,kt=navigator.platform,gt=/gecko\/\d/i.test(Rn),Ut=/MSIE \d/.test(Rn),ue=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rn),Ee=/Edge\/(\d+)/.exec(Rn),he=Ut||ue||Ee,Dt=he&&(Ut?document.documentMode||6:+(Ee||ue)[1]),ee=!Ee&&/WebKit\//.test(Rn),ge=ee&&/Qt\/\d+\.\d+/.test(Rn),Qt=!Ee&&/Chrome\//.test(Rn),jt=/Opera\//.test(Rn),Ae=/Apple Computer/.test(navigator.vendor),se=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Rn),Pe=/PhantomJS/.test(Rn),Bt=!Ee&&/AppleWebKit/.test(Rn)&&/Mobile\/\w+/.test(Rn),nt=/Android/.test(Rn),et=Bt||nt||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Rn),ht=Bt||/Mac/.test(kt),st=/\bCrOS\b/.test(Rn),pt=/win/i.test(kt),vt=jt&&Rn.match(/Version\/(\d*\.\d*)/);vt&&(vt=Number(vt[1])),vt&&vt>=15&&(jt=!1,ee=!0);var St=ht&&(ge||jt&&(vt==null||vt<12.11)),Et=gt||he&&Dt>=9;function Tt(it){return new RegExp("(^|\\s)"+it+"(?:$|\\s)\\s*")}var It=function(it,at){var ct=it.className,dt=Tt(at).exec(ct);if(dt){var mt=ct.slice(dt.index+dt[0].length);it.className=ct.slice(0,dt.index)+(mt?dt[1]+mt:"")}};function qt(it){for(var at=it.childNodes.length;at>0;--at)it.removeChild(it.firstChild);return it}function Xt(it,at){return qt(it).appendChild(at)}function Ht(it,at,ct,dt){var mt=document.createElement(it);if(ct&&(mt.className=ct),dt&&(mt.style.cssText=dt),typeof at=="string")mt.appendChild(document.createTextNode(at));else if(at)for(var Ft=0;Ft<at.length;++Ft)mt.appendChild(at[Ft]);return mt}function pe(it,at,ct,dt){var mt=Ht(it,at,ct,dt);return mt.setAttribute("role","presentation"),mt}var re;document.createRange?re=function(it,at,ct,dt){var mt=document.createRange();return mt.setEnd(dt||it,ct),mt.setStart(it,at),mt}:re=function(it,at,ct){var dt=document.body.createTextRange();try{dt.moveToElementText(it.parentNode)}catch(mt){return dt}return dt.collapse(!0),dt.moveEnd("character",ct),dt.moveStart("character",at),dt};function Ne(it,at){if(at.nodeType==3&&(at=at.parentNode),it.contains)return it.contains(at);do if(at.nodeType==11&&(at=at.host),at==it)return!0;while(at=at.parentNode)}function ye(){var it;try{it=document.activeElement}catch(at){it=document.body||null}for(;it&&it.shadowRoot&&it.shadowRoot.activeElement;)it=it.shadowRoot.activeElement;return it}function xe(it,at){var ct=it.className;Tt(at).test(ct)||(it.className+=(ct?" ":"")+at)}function Ue(it,at){for(var ct=it.split(" "),dt=0;dt<ct.length;dt++)ct[dt]&&!Tt(ct[dt]).test(at)&&(at+=" "+ct[dt]);return at}var je=function(it){it.select()};Bt?je=function(it){it.selectionStart=0,it.selectionEnd=it.value.length}:he&&(je=function(it){try{it.select()}catch(at){}});function Je(it){var at=Array.prototype.slice.call(arguments,1);return function(){return it.apply(null,at)}}function fn(it,at,ct){at||(at={});for(var dt in it)it.hasOwnProperty(dt)&&(ct!==!1||!at.hasOwnProperty(dt))&&(at[dt]=it[dt]);return at}function te(it,at,ct,dt,mt){at==null&&(at=it.search(/[^\s\u00a0]/),at==-1&&(at=it.length));for(var Ft=dt||0,Ot=mt||0;;){var Kt=it.indexOf(" ",Ft);if(Kt<0||Kt>=at)return Ot+(at-Ft);Ot+=Kt-Ft,Ot+=ct-Ot%ct,Ft=Kt+1}}var Jt=function(){this.id=null,this.f=null,this.time=0,this.handler=Je(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,at){this.f=at;var ct=+new Date+it;(!this.id||ct<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,it),this.time=ct)};function Xe(it,at){for(var ct=0;ct<it.length;++ct)if(it[ct]==at)return ct;return-1}var On=50,bn={toString:function(){return"CodeMirror.Pass"}},De={scroll:!1},on={origin:"*mouse"},un={origin:"+move"};function Kn(it,at,ct){for(var dt=0,mt=0;;){var Ft=it.indexOf(" ",dt);Ft==-1&&(Ft=it.length);var Ot=Ft-dt;if(Ft==it.length||mt+Ot>=at)return dt+Math.min(Ot,at-mt);if(mt+=Ft-dt,mt+=ct-mt%ct,dt=Ft+1,mt>=at)return dt}}var Me=[""];function vn(it){for(;Me.length<=it;)Me.push(ne(Me)+" ");return Me[it]}function ne(it){return it[it.length-1]}function wn(it,at){for(var ct=[],dt=0;dt<it.length;dt++)ct[dt]=at(it[dt],dt);return ct}function fi(it,at,ct){for(var dt=0,mt=ct(at);dt<it.length&&ct(it[dt])<=mt;)dt++;it.splice(dt,0,at)}function Rt(){}function Lt(it,at){var ct;return Object.create?ct=Object.create(it):(Rt.prototype=it,ct=new Rt),at&&fn(at,ct),ct}var Pt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Nt(it){return/\w/.test(it)||it>"\x80"&&(it.toUpperCase()!=it.toLowerCase()||Pt.test(it))}function Zt(it,at){return at?at.source.indexOf("\\w")>-1&&Nt(it)?!0:at.test(it):Nt(it)}function Mt(it){for(var at in it)if(it.hasOwnProperty(at)&&it[at])return!1;return!0}var Yt=/[\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 Ge(it){return it.charCodeAt(0)>=768&&Yt.test(it)}function Oe(it,at,ct){for(;(ct<0?at>0:at<it.length)&&Ge(it.charAt(at));)at+=ct;return at}function Ke(it,at,ct){for(var dt=at>ct?-1:1;;){if(at==ct)return at;var mt=(at+ct)/2,Ft=dt<0?Math.ceil(mt):Math.floor(mt);if(Ft==at)return it(Ft)?at:ct;it(Ft)?ct=Ft:at=Ft+dt}}function we(it,at,ct,dt){if(!it)return dt(at,ct,"ltr",0);for(var mt=!1,Ft=0;Ft<it.length;++Ft){var Ot=it[Ft];(Ot.from<ct&&Ot.to>at||at==ct&&Ot.to==at)&&(dt(Math.max(Ot.from,at),Math.min(Ot.to,ct),Ot.level==1?"rtl":"ltr",Ft),mt=!0)}mt||dt(at,ct,"ltr")}var Ce=null;function Fe(it,at,ct){var dt;Ce=null;for(var mt=0;mt<it.length;++mt){var Ft=it[mt];if(Ft.from<at&&Ft.to>at)return mt;Ft.to==at&&(Ft.from!=Ft.to&&ct=="before"?dt=mt:Ce=mt),Ft.from==at&&(Ft.from!=Ft.to&&ct!="before"?dt=mt:Ce=mt)}return dt!=null?dt:Ce}var He=function(){var it="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",at="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ct(le){return le<=247?it.charAt(le):1424<=le&&le<=1524?"R":1536<=le&&le<=1785?at.charAt(le-1536):1774<=le&&le<=2220?"r":8192<=le&&le<=8203?"w":le==8204?"b":"L"}var dt=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,mt=/[stwN]/,Ft=/[LRr]/,Ot=/[Lb1n]/,Kt=/[1n]/;function Wt(le,Ze,fe){this.level=le,this.from=Ze,this.to=fe}return function(le,Ze){var fe=Ze=="ltr"?"L":"R";if(le.length==0||Ze=="ltr"&&!dt.test(le))return!1;for(var yn=le.length,ln=[],wi=0;wi<yn;++wi)ln.push(ct(le.charCodeAt(wi)));for(var Mi=0,Ri=fe;Mi<yn;++Mi){var sr=ln[Mi];sr=="m"?ln[Mi]=Ri:Ri=sr}for(var Hr=0,Pr=fe;Hr<yn;++Hr){var Ur=ln[Hr];Ur=="1"&&Pr=="r"?ln[Hr]="n":Ft.test(Ur)&&(Pr=Ur,Ur=="r"&&(ln[Hr]="R"))}for(var Lo=1,xr=ln[0];Lo<yn-1;++Lo){var Ho=ln[Lo];Ho=="+"&&xr=="1"&&ln[Lo+1]=="1"?ln[Lo]="1":Ho==","&&xr==ln[Lo+1]&&(xr=="1"||xr=="n")&&(ln[Lo]=xr),xr=Ho}for(var ka=0;ka<yn;++ka){var ds=ln[ka];if(ds==",")ln[ka]="N";else if(ds=="%"){var ja=void 0;for(ja=ka+1;ja<yn&&ln[ja]=="%";++ja);for(var ll=ka&&ln[ka-1]=="!"||ja<yn&&ln[ja]=="1"?"1":"N",Gs=ka;Gs<ja;++Gs)ln[Gs]=ll;ka=ja-1}}for(var os=0,Pl=fe;os<yn;++os){var As=ln[os];Pl=="L"&&As=="1"?ln[os]="L":Ft.test(As)&&(Pl=As)}for(var as=0;as<yn;++as)if(mt.test(ln[as])){var ta=void 0;for(ta=as+1;ta<yn&&mt.test(ln[ta]);++ta);for(var Wa=(as?ln[as-1]:fe)=="L",ys=(ta<yn?ln[ta]:fe)=="L",Ts=Wa==ys?Wa?"L":"R":fe,fu=as;fu<ta;++fu)ln[fu]=Ts;as=ta-1}for(var za=[],ql,Ua=0;Ua<yn;)if(Ot.test(ln[Ua])){var Dc=Ua;for(++Ua;Ua<yn&&Ot.test(ln[Ua]);++Ua);za.push(new Wt(0,Dc,Ua))}else{var _l=Ua,wl=za.length,ul=Ze=="rtl"?1:0;for(++Ua;Ua<yn&&ln[Ua]!="L";++Ua);for(var ma=_l;ma<Ua;)if(Kt.test(ln[ma])){_l<ma&&(za.splice(wl,0,new Wt(1,_l,ma)),wl+=ul);var Ss=ma;for(++ma;ma<Ua&&Kt.test(ln[ma]);++ma);za.splice(wl,0,new Wt(2,Ss,ma)),wl+=ul,_l=ma}else++ma;_l<Ua&&za.splice(wl,0,new Wt(1,_l,Ua))}return Ze=="ltr"&&(za[0].level==1&&(ql=le.match(/^\s+/))&&(za[0].from=ql[0].length,za.unshift(new Wt(0,0,ql[0].length))),ne(za).level==1&&(ql=le.match(/\s+$/))&&(ne(za).to-=ql[0].length,za.push(new Wt(0,yn-ql[0].length,yn)))),Ze=="rtl"?za.reverse():za}}();function Qe(it,at){var ct=it.order;return ct==null&&(ct=it.order=He(it.text,at)),ct}var hn=[],dn=function(it,at,ct){if(it.addEventListener)it.addEventListener(at,ct,!1);else if(it.attachEvent)it.attachEvent("on"+at,ct);else{var dt=it._handlers||(it._handlers={});dt[at]=(dt[at]||hn).concat(ct)}};function ri(it,at){return it._handlers&&it._handlers[at]||hn}function ze(it,at,ct){if(it.removeEventListener)it.removeEventListener(at,ct,!1);else if(it.detachEvent)it.detachEvent("on"+at,ct);else{var dt=it._handlers,mt=dt&&dt[at];if(mt){var Ft=Xe(mt,ct);Ft>-1&&(dt[at]=mt.slice(0,Ft).concat(mt.slice(Ft+1)))}}}function We(it,at){var ct=ri(it,at);if(ct.length)for(var dt=Array.prototype.slice.call(arguments,2),mt=0;mt<ct.length;++mt)ct[mt].apply(null,dt)}function an(it,at,ct){return typeof at=="string"&&(at={type:at,preventDefault:function(){this.defaultPrevented=!0}}),We(it,ct||at.type,it,at),ei(at)||at.codemirrorIgnore}function Xn(it){var at=it._handlers&&it._handlers.cursorActivity;if(at)for(var ct=it.curOp.cursorActivityHandlers||(it.curOp.cursorActivityHandlers=[]),dt=0;dt<at.length;++dt)Xe(ct,at[dt])==-1&&ct.push(at[dt])}function pn(it,at){return ri(it,at).length>0}function rn(it){it.prototype.on=function(at,ct){dn(this,at,ct)},it.prototype.off=function(at,ct){ze(this,at,ct)}}function In(it){it.preventDefault?it.preventDefault():it.returnValue=!1}function pi(it){it.stopPropagation?it.stopPropagation():it.cancelBubble=!0}function ei(it){return it.defaultPrevented!=null?it.defaultPrevented:it.returnValue==!1}function mi(it){In(it),pi(it)}function Hi(it){return it.target||it.srcElement}function Cn(it){var at=it.which;return at==null&&(it.button&1?at=1:it.button&2?at=3:it.button&4&&(at=2)),ht&&it.ctrlKey&&at==1&&(at=3),at}var Sn=function(){if(he&&Dt<9)return!1;var it=Ht("div");return"draggable"in it||"dragDrop"in it}(),Bn;function si(it){if(Bn==null){var at=Ht("span","\u200B");Xt(it,Ht("span",[at,document.createTextNode("x")])),it.firstChild.offsetHeight!=0&&(Bn=at.offsetWidth<=1&&at.offsetHeight>2&&!(he&&Dt<8))}var ct=Bn?Ht("span","\u200B"):Ht("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ct.setAttribute("cm-text",""),ct}var yi;function hi(it){if(yi!=null)return yi;var at=Xt(it,document.createTextNode("A\u062EA")),ct=re(at,0,1).getBoundingClientRect(),dt=re(at,1,2).getBoundingClientRect();return qt(it),!ct||ct.left==ct.right?!1:yi=dt.right-ct.right<3}var Gi=`
b`.split(/\n/).length!=3?function(it){for(var at=0,ct=[],dt=it.length;at<=dt;){var mt=it.indexOf(`
`,at);mt==-1&&(mt=it.length);var Ft=it.slice(at,it.charAt(mt-1)=="\r"?mt-1:mt),Ot=Ft.indexOf("\r");Ot!=-1?(ct.push(Ft.slice(0,Ot)),at+=Ot+1):(ct.push(Ft),at=mt+1)}return ct}:function(it){return it.split(/\r\n?|\n/)},wt=window.getSelection?function(it){try{return it.selectionStart!=it.selectionEnd}catch(at){return!1}}:function(it){var at;try{at=it.ownerDocument.selection.createRange()}catch(ct){}return!at||at.parentElement()!=it?!1:at.compareEndPoints("StartToEnd",at)!=0},Ye=function(){var it=Ht("div");return"oncopy"in it?!0:(it.setAttribute("oncopy","return;"),typeof it.oncopy=="function")}(),Zn=null;function Ln(it){if(Zn!=null)return Zn;var at=Xt(it,Ht("span","x")),ct=at.getBoundingClientRect(),dt=re(at,0,1).getBoundingClientRect();return Zn=Math.abs(ct.left-dt.left)>1}var zn={},oi={};function Si(it,at){arguments.length>2&&(at.dependencies=Array.prototype.slice.call(arguments,2)),zn[it]=at}function Yi(it,at){oi[it]=at}function Fi(it){if(typeof it=="string"&&oi.hasOwnProperty(it))it=oi[it];else if(it&&typeof it.name=="string"&&oi.hasOwnProperty(it.name)){var at=oi[it.name];typeof at=="string"&&(at={name:at}),it=Lt(at,it),it.name=at.name}else{if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(it))return Fi("application/xml");if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(it))return Fi("application/json")}return typeof it=="string"?{name:it}:it||{name:"null"}}function ve(it,at){at=Fi(at);var ct=zn[at.name];if(!ct)return ve(it,"text/plain");var dt=ct(it,at);if(Le.hasOwnProperty(at.name)){var mt=Le[at.name];for(var Ft in mt)mt.hasOwnProperty(Ft)&&(dt.hasOwnProperty(Ft)&&(dt["_"+Ft]=dt[Ft]),dt[Ft]=mt[Ft])}if(dt.name=at.name,at.helperType&&(dt.helperType=at.helperType),at.modeProps)for(var Ot in at.modeProps)dt[Ot]=at.modeProps[Ot];return dt}var Le={};function Se(it,at){var ct=Le.hasOwnProperty(it)?Le[it]:Le[it]={};fn(at,ct)}function ti(it,at){if(at===!0)return at;if(it.copyState)return it.copyState(at);var ct={};for(var dt in at){var mt=at[dt];mt instanceof Array&&(mt=mt.concat([])),ct[dt]=mt}return ct}function Yn(it,at){for(var ct;it.innerMode&&(ct=it.innerMode(at),!(!ct||ct.mode==it));)at=ct.state,it=ct.mode;return ct||{mode:it,state:at}}function Wn(it,at,ct){return it.startState?it.startState(at,ct):!0}var qe=function(it,at,ct){this.pos=this.start=0,this.string=it,this.tabSize=at||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=ct};qe.prototype.eol=function(){return this.pos>=this.string.length},qe.prototype.sol=function(){return this.pos==this.lineStart},qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},qe.prototype.eat=function(it){var at=this.string.charAt(this.pos),ct;if(typeof it=="string"?ct=at==it:ct=at&&(it.test?it.test(at):it(at)),ct)return++this.pos,at},qe.prototype.eatWhile=function(it){for(var at=this.pos;this.eat(it););return this.pos>at},qe.prototype.eatSpace=function(){for(var it=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>it},qe.prototype.skipToEnd=function(){this.pos=this.string.length},qe.prototype.skipTo=function(it){var at=this.string.indexOf(it,this.pos);if(at>-1)return this.pos=at,!0},qe.prototype.backUp=function(it){this.pos-=it},qe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=te(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?te(this.string,this.lineStart,this.tabSize):0)},qe.prototype.indentation=function(){return te(this.string,null,this.tabSize)-(this.lineStart?te(this.string,this.lineStart,this.tabSize):0)},qe.prototype.match=function(it,at,ct){if(typeof it=="string"){var dt=function(Ot){return ct?Ot.toLowerCase():Ot},mt=this.string.substr(this.pos,it.length);if(dt(mt)==dt(it))return at!==!1&&(this.pos+=it.length),!0}else{var Ft=this.string.slice(this.pos).match(it);return Ft&&Ft.index>0?null:(Ft&&at!==!1&&(this.pos+=Ft[0].length),Ft)}},qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},qe.prototype.hideFirstChars=function(it,at){this.lineStart+=it;try{return at()}finally{this.lineStart-=it}},qe.prototype.lookAhead=function(it){var at=this.lineOracle;return at&&at.lookAhead(it)},qe.prototype.baseToken=function(){var it=this.lineOracle;return it&&it.baseToken(this.pos)};function Dn(it,at){if(at-=it.first,at<0||at>=it.size)throw new Error("There is no line "+(at+it.first)+" in the document.");for(var ct=it;!ct.lines;)for(var dt=0;;++dt){var mt=ct.children[dt],Ft=mt.chunkSize();if(at<Ft){ct=mt;break}at-=Ft}return ct.lines[at]}function ki(it,at,ct){var dt=[],mt=at.line;return it.iter(at.line,ct.line+1,function(Ft){var Ot=Ft.text;mt==ct.line&&(Ot=Ot.slice(0,ct.ch)),mt==at.line&&(Ot=Ot.slice(at.ch)),dt.push(Ot),++mt}),dt}function Di(it,at,ct){var dt=[];return it.iter(at,ct,function(mt){dt.push(mt.text)}),dt}function Ki(it,at){var ct=at-it.height;if(ct)for(var dt=it;dt;dt=dt.parent)dt.height+=ct}function Gt(it){if(it.parent==null)return null;for(var at=it.parent,ct=Xe(at.lines,it),dt=at.parent;dt;at=dt,dt=dt.parent)for(var mt=0;dt.children[mt]!=at;++mt)ct+=dt.children[mt].chunkSize();return ct+at.first}function me(it,at){var ct=it.first;t:do{for(var dt=0;dt<it.children.length;++dt){var mt=it.children[dt],Ft=mt.height;if(at<Ft){it=mt;continue t}at-=Ft,ct+=mt.chunkSize()}return ct}while(!it.lines);for(var Ot=0;Ot<it.lines.length;++Ot){var Kt=it.lines[Ot],Wt=Kt.height;if(at<Wt)break;at-=Wt}return ct+Ot}function En(it,at){return at>=it.first&&at<it.first+it.size}function Gn(it,at){return String(it.lineNumberFormatter(at+it.firstLineNumber))}function Re(it,at,ct){if(ct===void 0&&(ct=null),!(this instanceof Re))return new Re(it,at,ct);this.line=it,this.ch=at,this.sticky=ct}function $e(it,at){return it.line-at.line||it.ch-at.ch}function Nn(it,at){return it.sticky==at.sticky&&$e(it,at)==0}function _n(it){return Re(it.line,it.ch)}function di(it,at){return $e(it,at)<0?at:it}function Jn(it,at){return $e(it,at)<0?it:at}function li(it,at){return Math.max(it.first,Math.min(at,it.first+it.size-1))}function ni(it,at){if(at.line<it.first)return Re(it.first,0);var ct=it.first+it.size-1;return at.line>ct?Re(ct,Dn(it,ct).text.length):ji(at,Dn(it,at.line).text.length)}function ji(it,at){var ct=it.ch;return ct==null||ct>at?Re(it.line,at):ct<0?Re(it.line,0):it}function Oi(it,at){for(var ct=[],dt=0;dt<at.length;dt++)ct[dt]=ni(it,at[dt]);return ct}var Ii=function(it,at){this.state=it,this.lookAhead=at},Ve=function(it,at,ct,dt){this.state=at,this.doc=it,this.line=ct,this.maxLookAhead=dt||0,this.baseTokens=null,this.baseTokenPos=1};Ve.prototype.lookAhead=function(it){var at=this.doc.getLine(this.line+it);return at!=null&&it>this.maxLookAhead&&(this.maxLookAhead=it),at},Ve.prototype.baseToken=function(it){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=it;)this.baseTokenPos+=2;var at=this.baseTokens[this.baseTokenPos+1];return{type:at&&at.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-it}},Ve.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ve.fromSaved=function(it,at,ct){return at instanceof Ii?new Ve(it,ti(it.mode,at.state),ct,at.lookAhead):new Ve(it,ti(it.mode,at),ct)},Ve.prototype.save=function(it){var at=it!==!1?ti(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ii(at,this.maxLookAhead):at};function vr(it,at,ct,dt){var mt=[it.state.modeGen],Ft={};yr(it,at.text,it.doc.mode,ct,function(le,Ze){return mt.push(le,Ze)},Ft,dt);for(var Ot=ct.state,Kt=function(le){ct.baseTokens=mt;var Ze=it.state.overlays[le],fe=1,yn=0;ct.state=!0,yr(it,at.text,Ze.mode,ct,function(ln,wi){for(var Mi=fe;yn<ln;){var Ri=mt[fe];Ri>ln&&mt.splice(fe,1,ln,mt[fe+1],Ri),fe+=2,yn=Math.min(ln,Ri)}if(wi)if(Ze.opaque)mt.splice(Mi,fe-Mi,ln,"overlay "+wi),fe=Mi+2;else for(;Mi<fe;Mi+=2){var sr=mt[Mi+1];mt[Mi+1]=(sr?sr+" ":"")+"overlay "+wi}},Ft),ct.state=Ot,ct.baseTokens=null,ct.baseTokenPos=1},Wt=0;Wt<it.state.overlays.length;++Wt)Kt(Wt);return{styles:mt,classes:Ft.bgClass||Ft.textClass?Ft:null}}function Mr(it,at,ct){if(!at.styles||at.styles[0]!=it.state.modeGen){var dt=ro(it,Gt(at)),mt=at.text.length>it.options.maxHighlightLength&&ti(it.doc.mode,dt.state),Ft=vr(it,at,dt);mt&&(dt.state=mt),at.stateAfter=dt.save(!mt),at.styles=Ft.styles,Ft.classes?at.styleClasses=Ft.classes:at.styleClasses&&(at.styleClasses=null),ct===it.doc.highlightFrontier&&(it.doc.modeFrontier=Math.max(it.doc.modeFrontier,++it.doc.highlightFrontier))}return at.styles}function ro(it,at,ct){var dt=it.doc,mt=it.display;if(!dt.mode.startState)return new Ve(dt,!0,at);var Ft=Nr(it,at,ct),Ot=Ft>dt.first&&Dn(dt,Ft-1).stateAfter,Kt=Ot?Ve.fromSaved(dt,Ot,Ft):new Ve(dt,Wn(dt.mode),Ft);return dt.iter(Ft,at,function(Wt){en(it,Wt.text,Kt);var le=Kt.line;Wt.stateAfter=le==at-1||le%5==0||le>=mt.viewFrom&&le<mt.viewTo?Kt.save():null,Kt.nextLine()}),ct&&(dt.modeFrontier=Kt.line),Kt}function en(it,at,ct,dt){var mt=it.doc.mode,Ft=new qe(at,it.options.tabSize,ct);for(Ft.start=Ft.pos=dt||0,at==""&&Tn(mt,ct.state);!Ft.eol();)Bi(mt,Ft,ct.state),Ft.start=Ft.pos}function Tn(it,at){if(it.blankLine)return it.blankLine(at);if(it.innerMode){var ct=Yn(it,at);if(ct.mode.blankLine)return ct.mode.blankLine(ct.state)}}function Bi(it,at,ct,dt){for(var mt=0;mt<10;mt++){dt&&(dt[0]=Yn(it,ct).mode);var Ft=it.token(at,ct);if(at.pos>at.start)return Ft}throw new Error("Mode "+it.name+" failed to advance stream.")}var bi=function(it,at,ct){this.start=it.start,this.end=it.pos,this.string=it.current(),this.type=at||null,this.state=ct};function _i(it,at,ct,dt){var mt=it.doc,Ft=mt.mode,Ot;at=ni(mt,at);var Kt=Dn(mt,at.line),Wt=ro(it,at.line,ct),le=new qe(Kt.text,it.options.tabSize,Wt),Ze;for(dt&&(Ze=[]);(dt||le.pos<at.ch)&&!le.eol();)le.start=le.pos,Ot=Bi(Ft,le,Wt.state),dt&&Ze.push(new bi(le,Ot,ti(mt.mode,Wt.state)));return dt?Ze:new bi(le,Ot,Wt.state)}function ir(it,at){if(it)for(;;){var ct=it.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!ct)break;it=it.slice(0,ct.index)+it.slice(ct.index+ct[0].length);var dt=ct[1]?"bgClass":"textClass";at[dt]==null?at[dt]=ct[2]:new RegExp("(?:^|\\s)"+ct[2]+"(?:$|\\s)").test(at[dt])||(at[dt]+=" "+ct[2])}return it}function yr(it,at,ct,dt,mt,Ft,Ot){var Kt=ct.flattenSpans;Kt==null&&(Kt=it.options.flattenSpans);var Wt=0,le=null,Ze=new qe(at,it.options.tabSize,dt),fe,yn=it.options.addModeClass&&[null];for(at==""&&ir(Tn(ct,dt.state),Ft);!Ze.eol();){if(Ze.pos>it.options.maxHighlightLength?(Kt=!1,Ot&&en(it,at,dt,Ze.pos),Ze.pos=at.length,fe=null):fe=ir(Bi(ct,Ze,dt.state,yn),Ft),yn){var ln=yn[0].name;ln&&(fe="m-"+(fe?ln+" "+fe:ln))}if(!Kt||le!=fe){for(;Wt<Ze.start;)Wt=Math.min(Ze.start,Wt+5e3),mt(Wt,le);le=fe}Ze.start=Ze.pos}for(;Wt<Ze.pos;){var wi=Math.min(Ze.pos,Wt+5e3);mt(wi,le),Wt=wi}}function Nr(it,at,ct){for(var dt,mt,Ft=it.doc,Ot=ct?-1:at-(it.doc.mode.innerMode?1e3:100),Kt=at;Kt>Ot;--Kt){if(Kt<=Ft.first)return Ft.first;var Wt=Dn(Ft,Kt-1),le=Wt.stateAfter;if(le&&(!ct||Kt+(le instanceof Ii?le.lookAhead:0)<=Ft.modeFrontier))return Kt;var Ze=te(Wt.text,null,it.options.tabSize);(mt==null||dt>Ze)&&(mt=Kt-1,dt=Ze)}return mt}function _r(it,at){if(it.modeFrontier=Math.min(it.modeFrontier,at),!(it.highlightFrontier<at-10)){for(var ct=it.first,dt=at-1;dt>ct;dt--){var mt=Dn(it,dt).stateAfter;if(mt&&(!(mt instanceof Ii)||dt+mt.lookAhead<at)){ct=dt+1;break}}it.highlightFrontier=Math.min(it.highlightFrontier,ct)}}var Rr=!1,cn=!1;function ho(){Rr=!0}function gn(){cn=!0}function Wi(it,at,ct){this.marker=it,this.from=at,this.to=ct}function Kr(it,at){if(it)for(var ct=0;ct<it.length;++ct){var dt=it[ct];if(dt.marker==at)return dt}}function zi(it,at){for(var ct,dt=0;dt<it.length;++dt)it[dt]!=at&&(ct||(ct=[])).push(it[dt]);return ct}function wo(it,at){it.markedSpans=it.markedSpans?it.markedSpans.concat([at]):[at],at.marker.attachLine(it)}function Yr(it,at,ct){var dt;if(it)for(var mt=0;mt<it.length;++mt){var Ft=it[mt],Ot=Ft.marker,Kt=Ft.from==null||(Ot.inclusiveLeft?Ft.from<=at:Ft.from<at);if(Kt||Ft.from==at&&Ot.type=="bookmark"&&(!ct||!Ft.marker.insertLeft)){var Wt=Ft.to==null||(Ot.inclusiveRight?Ft.to>=at:Ft.to>at);(dt||(dt=[])).push(new Wi(Ot,Ft.from,Wt?null:Ft.to))}}return dt}function Er(it,at,ct){var dt;if(it)for(var mt=0;mt<it.length;++mt){var Ft=it[mt],Ot=Ft.marker,Kt=Ft.to==null||(Ot.inclusiveRight?Ft.to>=at:Ft.to>at);if(Kt||Ft.from==at&&Ot.type=="bookmark"&&(!ct||Ft.marker.insertLeft)){var Wt=Ft.from==null||(Ot.inclusiveLeft?Ft.from<=at:Ft.from<at);(dt||(dt=[])).push(new Wi(Ot,Wt?null:Ft.from-at,Ft.to==null?null:Ft.to-at))}}return dt}function Co(it,at){if(at.full)return null;var ct=En(it,at.from.line)&&Dn(it,at.from.line).markedSpans,dt=En(it,at.to.line)&&Dn(it,at.to.line).markedSpans;if(!ct&&!dt)return null;var mt=at.from.ch,Ft=at.to.ch,Ot=$e(at.from,at.to)==0,Kt=Yr(ct,mt,Ot),Wt=Er(dt,Ft,Ot),le=at.text.length==1,Ze=ne(at.text).length+(le?mt:0);if(Kt)for(var fe=0;fe<Kt.length;++fe){var yn=Kt[fe];if(yn.to==null){var ln=Kr(Wt,yn.marker);ln?le&&(yn.to=ln.to==null?null:ln.to+Ze):yn.to=mt}}if(Wt)for(var wi=0;wi<Wt.length;++wi){var Mi=Wt[wi];if(Mi.to!=null&&(Mi.to+=Ze),Mi.from==null){var Ri=Kr(Kt,Mi.marker);Ri||(Mi.from=Ze,le&&(Kt||(Kt=[])).push(Mi))}else Mi.from+=Ze,le&&(Kt||(Kt=[])).push(Mi)}Kt&&(Kt=_e(Kt)),Wt&&Wt!=Kt&&(Wt=_e(Wt));var sr=[Kt];if(!le){var Hr=at.text.length-2,Pr;if(Hr>0&&Kt)for(var Ur=0;Ur<Kt.length;++Ur)Kt[Ur].to==null&&(Pr||(Pr=[])).push(new Wi(Kt[Ur].marker,null,null));for(var Lo=0;Lo<Hr;++Lo)sr.push(Pr);sr.push(Wt)}return sr}function _e(it){for(var at=0;at<it.length;++at){var ct=it[at];ct.from!=null&&ct.from==ct.to&&ct.marker.clearWhenEmpty!==!1&&it.splice(at--,1)}return it.length?it:null}function xn(it,at,ct){var dt=null;if(it.iter(at.line,ct.line+1,function(ln){if(ln.markedSpans)for(var wi=0;wi<ln.markedSpans.length;++wi){var Mi=ln.markedSpans[wi].marker;Mi.readOnly&&(!dt||Xe(dt,Mi)==-1)&&(dt||(dt=[])).push(Mi)}}),!dt)return null;for(var mt=[{from:at,to:ct}],Ft=0;Ft<dt.length;++Ft)for(var Ot=dt[Ft],Kt=Ot.find(0),Wt=0;Wt<mt.length;++Wt){var le=mt[Wt];if(!($e(le.to,Kt.from)<0||$e(le.from,Kt.to)>0)){var Ze=[Wt,1],fe=$e(le.from,Kt.from),yn=$e(le.to,Kt.to);(fe<0||!Ot.inclusiveLeft&&!fe)&&Ze.push({from:le.from,to:Kt.from}),(yn>0||!Ot.inclusiveRight&&!yn)&&Ze.push({from:Kt.to,to:le.to}),mt.splice.apply(mt,Ze),Wt+=Ze.length-3}}return mt}function Be(it){var at=it.markedSpans;if(at){for(var ct=0;ct<at.length;++ct)at[ct].marker.detachLine(it);it.markedSpans=null}}function At(it,at){if(at){for(var ct=0;ct<at.length;++ct)at[ct].marker.attachLine(it);it.markedSpans=at}}function jn(it){return it.inclusiveLeft?-1:0}function Qn(it){return it.inclusiveRight?1:0}function Li(it,at){var ct=it.lines.length-at.lines.length;if(ct!=0)return ct;var dt=it.find(),mt=at.find(),Ft=$e(dt.from,mt.from)||jn(it)-jn(at);if(Ft)return-Ft;var Ot=$e(dt.to,mt.to)||Qn(it)-Qn(at);return Ot||at.id-it.id}function xi(it,at){var ct=cn&&it.markedSpans,dt;if(ct)for(var mt=void 0,Ft=0;Ft<ct.length;++Ft)mt=ct[Ft],mt.marker.collapsed&&(at?mt.from:mt.to)==null&&(!dt||Li(dt,mt.marker)<0)&&(dt=mt.marker);return dt}function ui(it){return xi(it,!0)}function mn(it){return xi(it,!1)}function Vn(it,at){var ct=cn&&it.markedSpans,dt;if(ct)for(var mt=0;mt<ct.length;++mt){var Ft=ct[mt];Ft.marker.collapsed&&(Ft.from==null||Ft.from<at)&&(Ft.to==null||Ft.to>at)&&(!dt||Li(dt,Ft.marker)<0)&&(dt=Ft.marker)}return dt}function $n(it,at,ct,dt,mt){var Ft=Dn(it,at),Ot=cn&&Ft.markedSpans;if(Ot)for(var Kt=0;Kt<Ot.length;++Kt){var Wt=Ot[Kt];if(Wt.marker.collapsed){var le=Wt.marker.find(0),Ze=$e(le.from,ct)||jn(Wt.marker)-jn(mt),fe=$e(le.to,dt)||Qn(Wt.marker)-Qn(mt);if(!(Ze>=0&&fe<=0||Ze<=0&&fe>=0)&&(Ze<=0&&(Wt.marker.inclusiveRight&&mt.inclusiveLeft?$e(le.to,ct)>=0:$e(le.to,ct)>0)||Ze>=0&&(Wt.marker.inclusiveRight&&mt.inclusiveLeft?$e(le.from,dt)<=0:$e(le.from,dt)<0)))return!0}}}function An(it){for(var at;at=ui(it);)it=at.find(-1,!0).line;return it}function Un(it){for(var at;at=mn(it);)it=at.find(1,!0).line;return it}function Ti(it){for(var at,ct;at=mn(it);)it=at.find(1,!0).line,(ct||(ct=[])).push(it);return ct}function vi(it,at){var ct=Dn(it,at),dt=An(ct);return ct==dt?at:Gt(dt)}function ii(it,at){if(at>it.lastLine())return at;var ct=Dn(it,at),dt;if(!nn(it,ct))return at;for(;dt=mn(ct);)ct=dt.find(1,!0).line;return Gt(ct)+1}function nn(it,at){var ct=cn&&at.markedSpans;if(ct){for(var dt=void 0,mt=0;mt<ct.length;++mt)if(dt=ct[mt],!!dt.marker.collapsed){if(dt.from==null)return!0;if(!dt.marker.widgetNode&&dt.from==0&&dt.marker.inclusiveLeft&&Ni(it,at,dt))return!0}}}function Ni(it,at,ct){if(ct.to==null){var dt=ct.marker.find(1,!0);return Ni(it,dt.line,Kr(dt.line.markedSpans,ct.marker))}if(ct.marker.inclusiveRight&&ct.to==at.text.length)return!0;for(var mt=void 0,Ft=0;Ft<at.markedSpans.length;++Ft)if(mt=at.markedSpans[Ft],mt.marker.collapsed&&!mt.marker.widgetNode&&mt.from==ct.to&&(mt.to==null||mt.to!=ct.from)&&(mt.marker.inclusiveLeft||ct.marker.inclusiveRight)&&Ni(it,at,mt))return!0}function Xi(it){it=An(it);for(var at=0,ct=it.parent,dt=0;dt<ct.lines.length;++dt){var mt=ct.lines[dt];if(mt==it)break;at+=mt.height}for(var Ft=ct.parent;Ft;ct=Ft,Ft=ct.parent)for(var Ot=0;Ot<Ft.children.length;++Ot){var Kt=Ft.children[Ot];if(Kt==ct)break;at+=Kt.height}return at}function Or(it){if(it.height==0)return 0;for(var at=it.text.length,ct,dt=it;ct=ui(dt);){var mt=ct.find(0,!0);dt=mt.from.line,at+=mt.from.ch-mt.to.ch}for(dt=it;ct=mn(dt);){var Ft=ct.find(0,!0);at-=dt.text.length-Ft.from.ch,dt=Ft.to.line,at+=dt.text.length-Ft.to.ch}return at}function cr(it){var at=it.display,ct=it.doc;at.maxLine=Dn(ct,ct.first),at.maxLineLength=Or(at.maxLine),at.maxLineChanged=!0,ct.iter(function(dt){var mt=Or(dt);mt>at.maxLineLength&&(at.maxLineLength=mt,at.maxLine=dt)})}var oo=function(it,at,ct){this.text=it,At(this,at),this.height=ct?ct(this):1};oo.prototype.lineNo=function(){return Gt(this)},rn(oo);function to(it,at,ct,dt){it.text=at,it.stateAfter&&(it.stateAfter=null),it.styles&&(it.styles=null),it.order!=null&&(it.order=null),Be(it),At(it,ct);var mt=dt?dt(it):1;mt!=it.height&&Ki(it,mt)}function $r(it){it.parent=null,Be(it)}var po={},lo={};function Bo(it,at){if(!it||/^\s*$/.test(it))return null;var ct=at.addModeClass?lo:po;return ct[it]||(ct[it]=it.replace(/\S+/g,"cm-$&"))}function Te(it,at){var ct=pe("span",null,null,ee?"padding-right: .1px":null),dt={pre:pe("pre",[ct],"CodeMirror-line"),content:ct,col:0,pos:0,cm:it,trailingSpace:!1,splitSpaces:it.getOption("lineWrapping")};at.measure={};for(var mt=0;mt<=(at.rest?at.rest.length:0);mt++){var Ft=mt?at.rest[mt-1]:at.line,Ot=void 0;dt.pos=0,dt.addToken=Jr,hi(it.display.measure)&&(Ot=Qe(Ft,it.doc.direction))&&(dt.addToken=Wr(dt.addToken,Ot)),dt.map=[];var Kt=at!=it.display.externalMeasured&&Gt(Ft);Mo(Ft,dt,Mr(it,Ft,Kt)),Ft.styleClasses&&(Ft.styleClasses.bgClass&&(dt.bgClass=Ue(Ft.styleClasses.bgClass,dt.bgClass||"")),Ft.styleClasses.textClass&&(dt.textClass=Ue(Ft.styleClasses.textClass,dt.textClass||""))),dt.map.length==0&&dt.map.push(0,0,dt.content.appendChild(si(it.display.measure))),mt==0?(at.measure.map=dt.map,at.measure.cache={}):((at.measure.maps||(at.measure.maps=[])).push(dt.map),(at.measure.caches||(at.measure.caches=[])).push({}))}if(ee){var Wt=dt.content.lastChild;(/\bcm-tab\b/.test(Wt.className)||Wt.querySelector&&Wt.querySelector(".cm-tab"))&&(dt.content.className="cm-tab-wrap-hack")}return We(it,"renderLine",it,at.line,dt.pre),dt.pre.className&&(dt.textClass=Ue(dt.pre.className,dt.textClass||"")),dt}function ao(it){var at=Ht("span","\u2022","cm-invalidchar");return at.title="\\u"+it.charCodeAt(0).toString(16),at.setAttribute("aria-label",at.title),at}function Jr(it,at,ct,dt,mt,Ft,Ot){if(at){var Kt=it.splitSpaces?gr(at,it.trailingSpace):at,Wt=it.cm.state.specialChars,le=!1,Ze;if(!Wt.test(at))it.col+=at.length,Ze=document.createTextNode(Kt),it.map.push(it.pos,it.pos+at.length,Ze),he&&Dt<9&&(le=!0),it.pos+=at.length;else{Ze=document.createDocumentFragment();for(var fe=0;;){Wt.lastIndex=fe;var yn=Wt.exec(at),ln=yn?yn.index-fe:at.length-fe;if(ln){var wi=document.createTextNode(Kt.slice(fe,fe+ln));he&&Dt<9?Ze.appendChild(Ht("span",[wi])):Ze.appendChild(wi),it.map.push(it.pos,it.pos+ln,wi),it.col+=ln,it.pos+=ln}if(!yn)break;fe+=ln+1;var Mi=void 0;if(yn[0]==" "){var Ri=it.cm.options.tabSize,sr=Ri-it.col%Ri;Mi=Ze.appendChild(Ht("span",vn(sr),"cm-tab")),Mi.setAttribute("role","presentation"),Mi.setAttribute("cm-text"," "),it.col+=sr}else yn[0]=="\r"||yn[0]==`
`?(Mi=Ze.appendChild(Ht("span",yn[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Mi.setAttribute("cm-text",yn[0]),it.col+=1):(Mi=it.cm.options.specialCharPlaceholder(yn[0]),Mi.setAttribute("cm-text",yn[0]),he&&Dt<9?Ze.appendChild(Ht("span",[Mi])):Ze.appendChild(Mi),it.col+=1);it.map.push(it.pos,it.pos+1,Mi),it.pos++}}if(it.trailingSpace=Kt.charCodeAt(at.length-1)==32,ct||dt||mt||le||Ft||Ot){var Hr=ct||"";dt&&(Hr+=dt),mt&&(Hr+=mt);var Pr=Ht("span",[Ze],Hr,Ft);if(Ot)for(var Ur in Ot)Ot.hasOwnProperty(Ur)&&Ur!="style"&&Ur!="class"&&Pr.setAttribute(Ur,Ot[Ur]);return it.content.appendChild(Pr)}it.content.appendChild(Ze)}}function gr(it,at){if(it.length>1&&!/ /.test(it))return it;for(var ct=at,dt="",mt=0;mt<it.length;mt++){var Ft=it.charAt(mt);Ft==" "&&ct&&(mt==it.length-1||it.charCodeAt(mt+1)==32)&&(Ft="\xA0"),dt+=Ft,ct=Ft==" "}return dt}function Wr(it,at){return function(ct,dt,mt,Ft,Ot,Kt,Wt){mt=mt?mt+" cm-force-border":"cm-force-border";for(var le=ct.pos,Ze=le+dt.length;;){for(var fe=void 0,yn=0;yn<at.length&&(fe=at[yn],!(fe.to>le&&fe.from<=le));yn++);if(fe.to>=Ze)return it(ct,dt,mt,Ft,Ot,Kt,Wt);it(ct,dt.slice(0,fe.to-le),mt,Ft,null,Kt,Wt),Ft=null,dt=dt.slice(fe.to-le),le=fe.to}}}function Lr(it,at,ct,dt){var mt=!dt&&ct.widgetNode;mt&&it.map.push(it.pos,it.pos+at,mt),!dt&&it.cm.display.input.needsContentAttribute&&(mt||(mt=it.content.appendChild(document.createElement("span"))),mt.setAttribute("cm-marker",ct.id)),mt&&(it.cm.display.input.setUneditable(mt),it.content.appendChild(mt)),it.pos+=at,it.trailingSpace=!1}function Mo(it,at,ct){var dt=it.markedSpans,mt=it.text,Ft=0;if(!dt){for(var Ot=1;Ot<ct.length;Ot+=2)at.addToken(at,mt.slice(Ft,Ft=ct[Ot]),Bo(ct[Ot+1],at.cm.options));return}for(var Kt=mt.length,Wt=0,le=1,Ze="",fe,yn,ln=0,wi,Mi,Ri,sr,Hr;;){if(ln==Wt){wi=Mi=Ri=yn="",Hr=null,sr=null,ln=1/0;for(var Pr=[],Ur=void 0,Lo=0;Lo<dt.length;++Lo){var xr=dt[Lo],Ho=xr.marker;if(Ho.type=="bookmark"&&xr.from==Wt&&Ho.widgetNode)Pr.push(Ho);else if(xr.from<=Wt&&(xr.to==null||xr.to>Wt||Ho.collapsed&&xr.to==Wt&&xr.from==Wt)){if(xr.to!=null&&xr.to!=Wt&&ln>xr.to&&(ln=xr.to,Mi=""),Ho.className&&(wi+=" "+Ho.className),Ho.css&&(yn=(yn?yn+";":"")+Ho.css),Ho.startStyle&&xr.from==Wt&&(Ri+=" "+Ho.startStyle),Ho.endStyle&&xr.to==ln&&(Ur||(Ur=[])).push(Ho.endStyle,xr.to),Ho.title&&((Hr||(Hr={})).title=Ho.title),Ho.attributes)for(var ka in Ho.attributes)(Hr||(Hr={}))[ka]=Ho.attributes[ka];Ho.collapsed&&(!sr||Li(sr.marker,Ho)<0)&&(sr=xr)}else xr.from>Wt&&ln>xr.from&&(ln=xr.from)}if(Ur)for(var ds=0;ds<Ur.length;ds+=2)Ur[ds+1]==ln&&(Mi+=" "+Ur[ds]);if(!sr||sr.from==Wt)for(var ja=0;ja<Pr.length;++ja)Lr(at,0,Pr[ja]);if(sr&&(sr.from||0)==Wt){if(Lr(at,(sr.to==null?Kt+1:sr.to)-Wt,sr.marker,sr.from==null),sr.to==null)return;sr.to==Wt&&(sr=!1)}}if(Wt>=Kt)break;for(var ll=Math.min(Kt,ln);;){if(Ze){var Gs=Wt+Ze.length;if(!sr){var os=Gs>ll?Ze.slice(0,ll-Wt):Ze;at.addToken(at,os,fe?fe+wi:wi,Ri,Wt+os.length==ln?Mi:"",yn,Hr)}if(Gs>=ll){Ze=Ze.slice(ll-Wt),Wt=ll;break}Wt=Gs,Ri=""}Ze=mt.slice(Ft,Ft=ct[le++]),fe=Bo(ct[le++],at.cm.options)}}}function Fo(it,at,ct){this.line=at,this.rest=Ti(at),this.size=this.rest?Gt(ne(this.rest))-ct+1:1,this.node=this.text=null,this.hidden=nn(it,at)}function zr(it,at,ct){for(var dt=[],mt,Ft=at;Ft<ct;Ft=mt){var Ot=new Fo(it.doc,Dn(it.doc,Ft),Ft);mt=Ft+Ot.size,dt.push(Ot)}return dt}var Zr=null;function Za(it){Zr?Zr.ops.push(it):it.ownsGroup=Zr={ops:[it],delayedCallbacks:[]}}function ra(it){var at=it.delayedCallbacks,ct=0;do{for(;ct<at.length;ct++)at[ct].call(null);for(var dt=0;dt<it.ops.length;dt++){var mt=it.ops[dt];if(mt.cursorActivityHandlers)for(;mt.cursorActivityCalled<mt.cursorActivityHandlers.length;)mt.cursorActivityHandlers[mt.cursorActivityCalled++].call(null,mt.cm)}}while(ct<at.length)}function bs(it,at){var ct=it.ownsGroup;if(ct)try{ra(ct)}finally{Zr=null,at(ct)}}var Ba=null;function or(it,at){var ct=ri(it,at);if(ct.length){var dt=Array.prototype.slice.call(arguments,2),mt;Zr?mt=Zr.delayedCallbacks:Ba?mt=Ba:(mt=Ba=[],setTimeout($o,0));for(var Ft=function(Kt){mt.push(function(){return ct[Kt].apply(null,dt)})},Ot=0;Ot<ct.length;++Ot)Ft(Ot)}}function $o(){var it=Ba;Ba=null;for(var at=0;at<it.length;++at)it[at]()}function qo(it,at,ct,dt){for(var mt=0;mt<at.changes.length;mt++){var Ft=at.changes[mt];Ft=="text"?gi(it,at):Ft=="gutter"?jr(it,at,ct,dt):Ft=="class"?lr(it,at):Ft=="widget"&&qr(it,at,dt)}at.changes=null}function ca(it){return it.node==it.text&&(it.node=Ht("div",null,null,"position: relative"),it.text.parentNode&&it.text.parentNode.replaceChild(it.node,it.text),it.node.appendChild(it.text),he&&Dt<8&&(it.node.style.zIndex=2)),it.node}function ia(it,at){var ct=at.bgClass?at.bgClass+" "+(at.line.bgClass||""):at.line.bgClass;if(ct&&(ct+=" CodeMirror-linebackground"),at.background)ct?at.background.className=ct:(at.background.parentNode.removeChild(at.background),at.background=null);else if(ct){var dt=ca(at);at.background=dt.insertBefore(Ht("div",null,ct),dt.firstChild),it.display.input.setUneditable(at.background)}}function fa(it,at){var ct=it.display.externalMeasured;return ct&&ct.line==at.line?(it.display.externalMeasured=null,at.measure=ct.measure,ct.built):Te(it,at)}function gi(it,at){var ct=at.text.className,dt=fa(it,at);at.text==at.node&&(at.node=dt.pre),at.text.parentNode.replaceChild(dt.pre,at.text),at.text=dt.pre,dt.bgClass!=at.bgClass||dt.textClass!=at.textClass?(at.bgClass=dt.bgClass,at.textClass=dt.textClass,lr(it,at)):ct&&(at.text.className=ct)}function lr(it,at){ia(it,at),at.line.wrapClass?ca(at).className=at.line.wrapClass:at.node!=at.text&&(at.node.className="");var ct=at.textClass?at.textClass+" "+(at.line.textClass||""):at.line.textClass;at.text.className=ct||""}function jr(it,at,ct,dt){if(at.gutter&&(at.node.removeChild(at.gutter),at.gutter=null),at.gutterBackground&&(at.node.removeChild(at.gutterBackground),at.gutterBackground=null),at.line.gutterClass){var mt=ca(at);at.gutterBackground=Ht("div",null,"CodeMirror-gutter-background "+at.line.gutterClass,"left: "+(it.options.fixedGutter?dt.fixedPos:-dt.gutterTotalWidth)+"px; width: "+dt.gutterTotalWidth+"px"),it.display.input.setUneditable(at.gutterBackground),mt.insertBefore(at.gutterBackground,at.text)}var Ft=at.line.gutterMarkers;if(it.options.lineNumbers||Ft){var Ot=ca(at),Kt=at.gutter=Ht("div",null,"CodeMirror-gutter-wrapper","left: "+(it.options.fixedGutter?dt.fixedPos:-dt.gutterTotalWidth)+"px");if(it.display.input.setUneditable(Kt),Ot.insertBefore(Kt,at.text),at.line.gutterClass&&(Kt.className+=" "+at.line.gutterClass),it.options.lineNumbers&&(!Ft||!Ft["CodeMirror-linenumbers"])&&(at.lineNumber=Kt.appendChild(Ht("div",Gn(it.options,ct),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+dt.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+it.display.lineNumInnerWidth+"px"))),Ft)for(var Wt=0;Wt<it.display.gutterSpecs.length;++Wt){var le=it.display.gutterSpecs[Wt].className,Ze=Ft.hasOwnProperty(le)&&Ft[le];Ze&&Kt.appendChild(Ht("div",[Ze],"CodeMirror-gutter-elt","left: "+dt.gutterLeft[le]+"px; width: "+dt.gutterWidth[le]+"px"))}}}function qr(it,at,ct){at.alignable&&(at.alignable=null);for(var dt=Tt("CodeMirror-linewidget"),mt=at.node.firstChild,Ft=void 0;mt;mt=Ft)Ft=mt.nextSibling,dt.test(mt.className)&&at.node.removeChild(mt);zo(it,at,ct)}function mo(it,at,ct,dt){var mt=fa(it,at);return at.text=at.node=mt.pre,mt.bgClass&&(at.bgClass=mt.bgClass),mt.textClass&&(at.textClass=mt.textClass),lr(it,at),jr(it,at,ct,dt),zo(it,at,dt),at.node}function zo(it,at,ct){if(dr(it,at.line,at,ct,!0),at.rest)for(var dt=0;dt<at.rest.length;dt++)dr(it,at.rest[dt],at,ct,!1)}function dr(it,at,ct,dt,mt){if(at.widgets)for(var Ft=ca(ct),Ot=0,Kt=at.widgets;Ot<Kt.length;++Ot){var Wt=Kt[Ot],le=Ht("div",[Wt.node],"CodeMirror-linewidget"+(Wt.className?" "+Wt.className:""));Wt.handleMouseEvents||le.setAttribute("cm-ignore-events","true"),Ya(Wt,le,ct,dt),it.display.input.setUneditable(le),mt&&Wt.above?Ft.insertBefore(le,ct.gutter||ct.text):Ft.appendChild(le),or(Wt,"redraw")}}function Ya(it,at,ct,dt){if(it.noHScroll){(ct.alignable||(ct.alignable=[])).push(at);var mt=dt.wrapperWidth;at.style.left=dt.fixedPos+"px",it.coverGutter||(mt-=dt.gutterTotalWidth,at.style.paddingLeft=dt.gutterTotalWidth+"px"),at.style.width=mt+"px"}it.coverGutter&&(at.style.zIndex=5,at.style.position="relative",it.noHScroll||(at.style.marginLeft=-dt.gutterTotalWidth+"px"))}function da(it){if(it.height!=null)return it.height;var at=it.doc.cm;if(!at)return 0;if(!Ne(document.body,it.node)){var ct="position: relative;";it.coverGutter&&(ct+="margin-left: -"+at.display.gutters.offsetWidth+"px;"),it.noHScroll&&(ct+="width: "+at.display.wrapper.clientWidth+"px;"),Xt(at.display.measure,Ht("div",[it.node],null,ct))}return it.height=it.node.parentNode.offsetHeight}function Yo(it,at){for(var ct=Hi(at);ct!=it.wrapper;ct=ct.parentNode)if(!ct||ct.nodeType==1&&ct.getAttribute("cm-ignore-events")=="true"||ct.parentNode==it.sizer&&ct!=it.mover)return!0}function so(it){return it.lineSpace.offsetTop}function Sa(it){return it.mover.offsetHeight-it.lineSpace.offsetHeight}function ns(it){if(it.cachedPaddingH)return it.cachedPaddingH;var at=Xt(it.measure,Ht("pre","x","CodeMirror-line-like")),ct=window.getComputedStyle?window.getComputedStyle(at):at.currentStyle,dt={left:parseInt(ct.paddingLeft),right:parseInt(ct.paddingRight)};return!isNaN(dt.left)&&!isNaN(dt.right)&&(it.cachedPaddingH=dt),dt}function Jo(it){return On-it.display.nativeBarWidth}function ps(it){return it.display.scroller.clientWidth-Jo(it)-it.display.barWidth}function ms(it){return it.display.scroller.clientHeight-Jo(it)-it.display.barHeight}function Rs(it,at,ct){var dt=it.options.lineWrapping,mt=dt&&ps(it);if(!at.measure.heights||dt&&at.measure.width!=mt){var Ft=at.measure.heights=[];if(dt){at.measure.width=mt;for(var Ot=at.text.firstChild.getClientRects(),Kt=0;Kt<Ot.length-1;Kt++){var Wt=Ot[Kt],le=Ot[Kt+1];Math.abs(Wt.bottom-le.bottom)>2&&Ft.push((Wt.bottom+le.top)/2-ct.top)}}Ft.push(ct.bottom-ct.top)}}function La(it,at,ct){if(it.line==at)return{map:it.measure.map,cache:it.measure.cache};for(var dt=0;dt<it.rest.length;dt++)if(it.rest[dt]==at)return{map:it.measure.maps[dt],cache:it.measure.caches[dt]};for(var mt=0;mt<it.rest.length;mt++)if(Gt(it.rest[mt])>ct)return{map:it.measure.maps[mt],cache:it.measure.caches[mt],before:!0}}function Iu(it,at){at=An(at);var ct=Gt(at),dt=it.display.externalMeasured=new Fo(it.doc,at,ct);dt.lineN=ct;var mt=dt.built=Te(it,dt);return dt.text=mt.pre,Xt(it.display.lineMeasure,mt.pre),dt}function Cu(it,at,ct,dt){return zs(it,Nl(it,at),ct,dt)}function js(it,at){if(at>=it.display.viewFrom&&at<it.display.viewTo)return it.display.view[Vi(it,at)];var ct=it.display.externalMeasured;if(ct&&at>=ct.lineN&&at<ct.lineN+ct.size)return ct}function Nl(it,at){var ct=Gt(at),dt=js(it,ct);dt&&!dt.text?dt=null:dt&&dt.changes&&(qo(it,dt,ct,vo(it)),it.curOp.forceUpdate=!0),dt||(dt=Iu(it,at));var mt=La(dt,at,ct);return{line:at,view:dt,rect:null,map:mt.map,cache:mt.cache,before:mt.before,hasHeights:!1}}function zs(it,at,ct,dt,mt){at.before&&(ct=-1);var Ft=ct+(dt||""),Ot;return at.cache.hasOwnProperty(Ft)?Ot=at.cache[Ft]:(at.rect||(at.rect=at.view.text.getBoundingClientRect()),at.hasHeights||(Rs(it,at.view,at.rect),at.hasHeights=!0),Ot=xa(it,at,ct,dt),Ot.bogus||(at.cache[Ft]=Ot)),{left:Ot.left,right:Ot.right,top:mt?Ot.rtop:Ot.top,bottom:mt?Ot.rbottom:Ot.bottom}}var Vl={left:0,right:0,top:0,bottom:0};function lu(it,at,ct){for(var dt,mt,Ft,Ot,Kt,Wt,le=0;le<it.length;le+=3)if(Kt=it[le],Wt=it[le+1],at<Kt?(mt=0,Ft=1,Ot="left"):at<Wt?(mt=at-Kt,Ft=mt+1):(le==it.length-3||at==Wt&&it[le+3]>at)&&(Ft=Wt-Kt,mt=Ft-1,at>=Wt&&(Ot="right")),mt!=null){if(dt=it[le+2],Kt==Wt&&ct==(dt.insertLeft?"left":"right")&&(Ot=ct),ct=="left"&&mt==0)for(;le&&it[le-2]==it[le-3]&&it[le-1].insertLeft;)dt=it[(le-=3)+2],Ot="left";if(ct=="right"&&mt==Wt-Kt)for(;le<it.length-3&&it[le+3]==it[le+4]&&!it[le+5].insertLeft;)dt=it[(le+=3)+2],Ot="right";break}return{node:dt,start:mt,end:Ft,collapse:Ot,coverStart:Kt,coverEnd:Wt}}function Eu(it,at){var ct=Vl;if(at=="left")for(var dt=0;dt<it.length&&(ct=it[dt]).left==ct.right;dt++);else for(var mt=it.length-1;mt>=0&&(ct=it[mt]).left==ct.right;mt--);return ct}function xa(it,at,ct,dt){var mt=lu(at.map,ct,dt),Ft=mt.node,Ot=mt.start,Kt=mt.end,Wt=mt.collapse,le;if(Ft.nodeType==3){for(var Ze=0;Ze<4;Ze++){for(;Ot&&Ge(at.line.text.charAt(mt.coverStart+Ot));)--Ot;for(;mt.coverStart+Kt<mt.coverEnd&&Ge(at.line.text.charAt(mt.coverStart+Kt));)++Kt;if(he&&Dt<9&&Ot==0&&Kt==mt.coverEnd-mt.coverStart?le=Ft.parentNode.getBoundingClientRect():le=Eu(re(Ft,Ot,Kt).getClientRects(),dt),le.left||le.right||Ot==0)break;Kt=Ot,Ot=Ot-1,Wt="right"}he&&Dt<11&&(le=rl(it.display.measure,le))}else{Ot>0&&(Wt=dt="right");var fe;it.options.lineWrapping&&(fe=Ft.getClientRects()).length>1?le=fe[dt=="right"?fe.length-1:0]:le=Ft.getBoundingClientRect()}if(he&&Dt<9&&!Ot&&(!le||!le.left&&!le.right)){var yn=Ft.parentNode.getClientRects()[0];yn?le={left:yn.left,right:yn.left+wr(it.display),top:yn.top,bottom:yn.bottom}:le=Vl}for(var ln=le.top-at.rect.top,wi=le.bottom-at.rect.top,Mi=(ln+wi)/2,Ri=at.view.measure.heights,sr=0;sr<Ri.length-1&&!(Mi<Ri[sr]);sr++);var Hr=sr?Ri[sr-1]:0,Pr=Ri[sr],Ur={left:(Wt=="right"?le.right:le.left)-at.rect.left,right:(Wt=="left"?le.left:le.right)-at.rect.left,top:Hr,bottom:Pr};return!le.left&&!le.right&&(Ur.bogus=!0),it.options.singleCursorHeightPerLine||(Ur.rtop=ln,Ur.rbottom=wi),Ur}function rl(it,at){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ln(it))return at;var ct=screen.logicalXDPI/screen.deviceXDPI,dt=screen.logicalYDPI/screen.deviceYDPI;return{left:at.left*ct,right:at.right*ct,top:at.top*dt,bottom:at.bottom*dt}}function _u(it){if(it.measure&&(it.measure.cache={},it.measure.heights=null,it.rest))for(var at=0;at<it.rest.length;at++)it.measure.caches[at]={}}function Kl(it){it.display.externalMeasure=null,qt(it.display.lineMeasure);for(var at=0;at<it.display.view.length;at++)_u(it.display.view[at])}function uu(it){Kl(it),it.display.cachedCharWidth=it.display.cachedTextHeight=it.display.cachedPaddingH=null,it.options.lineWrapping||(it.display.maxLineChanged=!0),it.display.lineNumChars=null}function Xa(){return Qt&&nt?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ja(){return Qt&&nt?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Aa(it){var at=0;if(it.widgets)for(var ct=0;ct<it.widgets.length;++ct)it.widgets[ct].above&&(at+=da(it.widgets[ct]));return at}function Ga(it,at,ct,dt,mt){if(!mt){var Ft=Aa(at);ct.top+=Ft,ct.bottom+=Ft}if(dt=="line")return ct;dt||(dt="local");var Ot=Xi(at);if(dt=="local"?Ot+=so(it.display):Ot-=it.display.viewOffset,dt=="page"||dt=="window"){var Kt=it.display.lineSpace.getBoundingClientRect();Ot+=Kt.top+(dt=="window"?0:Ja());var Wt=Kt.left+(dt=="window"?0:Xa());ct.left+=Wt,ct.right+=Wt}return ct.top+=Ot,ct.bottom+=Ot,ct}function Bl(it,at,ct){if(ct=="div")return at;var dt=at.left,mt=at.top;if(ct=="page")dt-=Xa(),mt-=Ja();else if(ct=="local"||!ct){var Ft=it.display.sizer.getBoundingClientRect();dt+=Ft.left,mt+=Ft.top}var Ot=it.display.lineSpace.getBoundingClientRect();return{left:dt-Ot.left,top:mt-Ot.top}}function ga(it,at,ct,dt,mt){return dt||(dt=Dn(it.doc,at.line)),Ga(it,dt,Cu(it,dt,at.ch,mt),ct)}function _o(it,at,ct,dt,mt,Ft){dt=dt||Dn(it.doc,at.line),mt||(mt=Nl(it,dt));function Ot(wi,Mi){var Ri=zs(it,mt,wi,Mi?"right":"left",Ft);return Mi?Ri.left=Ri.right:Ri.right=Ri.left,Ga(it,dt,Ri,ct)}var Kt=Qe(dt,it.doc.direction),Wt=at.ch,le=at.sticky;if(Wt>=dt.text.length?(Wt=dt.text.length,le="before"):Wt<=0&&(Wt=0,le="after"),!Kt)return Ot(le=="before"?Wt-1:Wt,le=="before");function Ze(wi,Mi,Ri){var sr=Kt[Mi],Hr=sr.level==1;return Ot(Ri?wi-1:wi,Hr!=Ri)}var fe=Fe(Kt,Wt,le),yn=Ce,ln=Ze(Wt,fe,le=="before");return yn!=null&&(ln.other=Ze(Wt,yn,le!="before")),ln}function Eo(it,at){var ct=0;at=ni(it.doc,at),it.options.lineWrapping||(ct=wr(it.display)*at.ch);var dt=Dn(it.doc,at.line),mt=Xi(dt)+so(it.display);return{left:ct,right:ct,top:mt,bottom:mt+dt.height}}function Ao(it,at,ct,dt,mt){var Ft=Re(it,at,ct);return Ft.xRel=mt,dt&&(Ft.outside=dt),Ft}function Ta(it,at,ct){var dt=it.doc;if(ct+=it.display.viewOffset,ct<0)return Ao(dt.first,0,null,-1,-1);var mt=me(dt,ct),Ft=dt.first+dt.size-1;if(mt>Ft)return Ao(dt.first+dt.size-1,Dn(dt,Ft).text.length,null,1,1);at<0&&(at=0);for(var Ot=Dn(dt,mt);;){var Kt=ce(it,Ot,mt,at,ct),Wt=Vn(Ot,Kt.ch+(Kt.xRel>0||Kt.outside>0?1:0));if(!Wt)return Kt;var le=Wt.find(1);if(le.line==mt)return le;Ot=Dn(dt,mt=le.line)}}function ae(it,at,ct,dt){dt-=Aa(at);var mt=at.text.length,Ft=Ke(function(Ot){return zs(it,ct,Ot-1).bottom<=dt},mt,0);return mt=Ke(function(Ot){return zs(it,ct,Ot).top>dt},Ft,mt),{begin:Ft,end:mt}}function Ie(it,at,ct,dt){ct||(ct=Nl(it,at));var mt=Ga(it,at,zs(it,ct,dt),"line").top;return ae(it,at,ct,mt)}function _t(it,at,ct,dt){return it.bottom<=ct?!1:it.top>ct?!0:(dt?it.left:it.right)>at}function ce(it,at,ct,dt,mt){mt-=Xi(at);var Ft=Nl(it,at),Ot=Aa(at),Kt=0,Wt=at.text.length,le=!0,Ze=Qe(at,it.doc.direction);if(Ze){var fe=(it.options.lineWrapping?Sr:Gr)(it,at,ct,Ft,Ze,dt,mt);le=fe.level!=1,Kt=le?fe.from:fe.to-1,Wt=le?fe.to:fe.from-1}var yn=null,ln=null,wi=Ke(function(Lo){var xr=zs(it,Ft,Lo);return xr.top+=Ot,xr.bottom+=Ot,_t(xr,dt,mt,!1)?(xr.top<=mt&&xr.left<=dt&&(yn=Lo,ln=xr),!0):!1},Kt,Wt),Mi,Ri,sr=!1;if(ln){var Hr=dt-ln.left<ln.right-dt,Pr=Hr==le;wi=yn+(Pr?0:1),Ri=Pr?"after":"before",Mi=Hr?ln.left:ln.right}else{!le&&(wi==Wt||wi==Kt)&&wi++,Ri=wi==0?"after":wi==at.text.length?"before":zs(it,Ft,wi-(le?1:0)).bottom+Ot<=mt==le?"after":"before";var Ur=_o(it,Re(ct,wi,Ri),"line",at,Ft);Mi=Ur.left,sr=mt<Ur.top?-1:mt>=Ur.bottom?1:0}return wi=Oe(at.text,wi,1),Ao(ct,wi,Ri,sr,dt-Mi)}function Gr(it,at,ct,dt,mt,Ft,Ot){var Kt=Ke(function(fe){var yn=mt[fe],ln=yn.level!=1;return _t(_o(it,Re(ct,ln?yn.to:yn.from,ln?"before":"after"),"line",at,dt),Ft,Ot,!0)},0,mt.length-1),Wt=mt[Kt];if(Kt>0){var le=Wt.level!=1,Ze=_o(it,Re(ct,le?Wt.from:Wt.to,le?"after":"before"),"line",at,dt);_t(Ze,Ft,Ot,!0)&&Ze.top>Ot&&(Wt=mt[Kt-1])}return Wt}function Sr(it,at,ct,dt,mt,Ft,Ot){var Kt=ae(it,at,dt,Ot),Wt=Kt.begin,le=Kt.end;/\s/.test(at.text.charAt(le-1))&&le--;for(var Ze=null,fe=null,yn=0;yn<mt.length;yn++){var ln=mt[yn];if(!(ln.from>=le||ln.to<=Wt)){var wi=ln.level!=1,Mi=zs(it,dt,wi?Math.min(le,ln.to)-1:Math.max(Wt,ln.from)).right,Ri=Mi<Ft?Ft-Mi+1e9:Mi-Ft;(!Ze||fe>Ri)&&(Ze=ln,fe=Ri)}}return Ze||(Ze=mt[mt.length-1]),Ze.from<Wt&&(Ze={from:Wt,to:Ze.to,level:Ze.level}),Ze.to>le&&(Ze={from:Ze.from,to:le,level:Ze.level}),Ze}var kr;function ur(it){if(it.cachedTextHeight!=null)return it.cachedTextHeight;if(kr==null){kr=Ht("pre",null,"CodeMirror-line-like");for(var at=0;at<49;++at)kr.appendChild(document.createTextNode("x")),kr.appendChild(Ht("br"));kr.appendChild(document.createTextNode("x"))}Xt(it.measure,kr);var ct=kr.offsetHeight/50;return ct>3&&(it.cachedTextHeight=ct),qt(it.measure),ct||1}function wr(it){if(it.cachedCharWidth!=null)return it.cachedCharWidth;var at=Ht("span","xxxxxxxxxx"),ct=Ht("pre",[at],"CodeMirror-line-like");Xt(it.measure,ct);var dt=at.getBoundingClientRect(),mt=(dt.right-dt.left)/10;return mt>2&&(it.cachedCharWidth=mt),mt||10}function vo(it){for(var at=it.display,ct={},dt={},mt=at.gutters.clientLeft,Ft=at.gutters.firstChild,Ot=0;Ft;Ft=Ft.nextSibling,++Ot){var Kt=it.display.gutterSpecs[Ot].className;ct[Kt]=Ft.offsetLeft+Ft.clientLeft+mt,dt[Kt]=Ft.clientWidth}return{fixedPos:Xr(at),gutterTotalWidth:at.gutters.offsetWidth,gutterLeft:ct,gutterWidth:dt,wrapperWidth:at.wrapper.clientWidth}}function Xr(it){return it.scroller.getBoundingClientRect().left-it.sizer.getBoundingClientRect().left}function Ir(it){var at=ur(it.display),ct=it.options.lineWrapping,dt=ct&&Math.max(5,it.display.scroller.clientWidth/wr(it.display)-3);return function(mt){if(nn(it.doc,mt))return 0;var Ft=0;if(mt.widgets)for(var Ot=0;Ot<mt.widgets.length;Ot++)mt.widgets[Ot].height&&(Ft+=mt.widgets[Ot].height);return ct?Ft+(Math.ceil(mt.text.length/dt)||1)*at:Ft+at}}function Ui(it){var at=it.doc,ct=Ir(it);at.iter(function(dt){var mt=ct(dt);mt!=dt.height&&Ki(dt,mt)})}function eo(it,at,ct,dt){var mt=it.display;if(!ct&&Hi(at).getAttribute("cm-not-content")=="true")return null;var Ft,Ot,Kt=mt.lineSpace.getBoundingClientRect();try{Ft=at.clientX-Kt.left,Ot=at.clientY-Kt.top}catch(fe){return null}var Wt=Ta(it,Ft,Ot),le;if(dt&&Wt.xRel>0&&(le=Dn(it.doc,Wt.line).text).length==Wt.ch){var Ze=te(le,le.length,it.options.tabSize)-le.length;Wt=Re(Wt.line,Math.max(0,Math.round((Ft-ns(it.display).left)/wr(it.display))-Ze))}return Wt}function Vi(it,at){if(at>=it.display.viewTo||(at-=it.display.viewFrom,at<0))return null;for(var ct=it.display.view,dt=0;dt<ct.length;dt++)if(at-=ct[dt].size,at<0)return dt}function ar(it,at,ct,dt){at==null&&(at=it.doc.first),ct==null&&(ct=it.doc.first+it.doc.size),dt||(dt=0);var mt=it.display;if(dt&&ct<mt.viewTo&&(mt.updateLineNumbers==null||mt.updateLineNumbers>at)&&(mt.updateLineNumbers=at),it.curOp.viewChanged=!0,at>=mt.viewTo)cn&&vi(it.doc,at)<mt.viewTo&&br(it);else if(ct<=mt.viewFrom)cn&&ii(it.doc,ct+dt)>mt.viewFrom?br(it):(mt.viewFrom+=dt,mt.viewTo+=dt);else if(at<=mt.viewFrom&&ct>=mt.viewTo)br(it);else if(at<=mt.viewFrom){var Ft=Fr(it,ct,ct+dt,1);Ft?(mt.view=mt.view.slice(Ft.index),mt.viewFrom=Ft.lineN,mt.viewTo+=dt):br(it)}else if(ct>=mt.viewTo){var Ot=Fr(it,at,at,-1);Ot?(mt.view=mt.view.slice(0,Ot.index),mt.viewTo=Ot.lineN):br(it)}else{var Kt=Fr(it,at,at,-1),Wt=Fr(it,ct,ct+dt,1);Kt&&Wt?(mt.view=mt.view.slice(0,Kt.index).concat(zr(it,Kt.lineN,Wt.lineN)).concat(mt.view.slice(Wt.index)),mt.viewTo+=dt):br(it)}var le=mt.externalMeasured;le&&(ct<le.lineN?le.lineN+=dt:at<le.lineN+le.size&&(mt.externalMeasured=null))}function Qi(it,at,ct){it.curOp.viewChanged=!0;var dt=it.display,mt=it.display.externalMeasured;if(mt&&at>=mt.lineN&&at<mt.lineN+mt.size&&(dt.externalMeasured=null),!(at<dt.viewFrom||at>=dt.viewTo)){var Ft=dt.view[Vi(it,at)];if(Ft.node!=null){var Ot=Ft.changes||(Ft.changes=[]);Xe(Ot,ct)==-1&&Ot.push(ct)}}}function br(it){it.display.viewFrom=it.display.viewTo=it.doc.first,it.display.view=[],it.display.viewOffset=0}function Fr(it,at,ct,dt){var mt=Vi(it,at),Ft,Ot=it.display.view;if(!cn||ct==it.doc.first+it.doc.size)return{index:mt,lineN:ct};for(var Kt=it.display.viewFrom,Wt=0;Wt<mt;Wt++)Kt+=Ot[Wt].size;if(Kt!=at){if(dt>0){if(mt==Ot.length-1)return null;Ft=Kt+Ot[mt].size-at,mt++}else Ft=Kt-at;at+=Ft,ct+=Ft}for(;vi(it.doc,ct)!=ct;){if(mt==(dt<0?0:Ot.length-1))return null;ct+=dt*Ot[mt-(dt<0?1:0)].size,mt+=dt}return{index:mt,lineN:ct}}function Dr(it,at,ct){var dt=it.display,mt=dt.view;mt.length==0||at>=dt.viewTo||ct<=dt.viewFrom?(dt.view=zr(it,at,ct),dt.viewFrom=at):(dt.viewFrom>at?dt.view=zr(it,at,dt.viewFrom).concat(dt.view):dt.viewFrom<at&&(dt.view=dt.view.slice(Vi(it,at))),dt.viewFrom=at,dt.viewTo<ct?dt.view=dt.view.concat(zr(it,dt.viewTo,ct)):dt.viewTo>ct&&(dt.view=dt.view.slice(0,Vi(it,ct)))),dt.viewTo=ct}function no(it){for(var at=it.display.view,ct=0,dt=0;dt<at.length;dt++){var mt=at[dt];!mt.hidden&&(!mt.node||mt.changes)&&++ct}return ct}function Zi(it){it.display.input.showSelection(it.display.input.prepareSelection())}function Br(it,at){at===void 0&&(at=!0);for(var ct=it.doc,dt={},mt=dt.cursors=document.createDocumentFragment(),Ft=dt.selection=document.createDocumentFragment(),Ot=0;Ot<ct.sel.ranges.length;Ot++)if(!(!at&&Ot==ct.sel.primIndex)){var Kt=ct.sel.ranges[Ot];if(!(Kt.from().line>=it.display.viewTo||Kt.to().line<it.display.viewFrom)){var Wt=Kt.empty();(Wt||it.options.showCursorWhenSelecting)&&Pi(it,Kt.head,mt),Wt||pr(it,Kt,Ft)}}return dt}function Pi(it,at,ct){var dt=_o(it,at,"div",null,null,!it.options.singleCursorHeightPerLine),mt=ct.appendChild(Ht("div","\xA0","CodeMirror-cursor"));if(mt.style.left=dt.left+"px",mt.style.top=dt.top+"px",mt.style.height=Math.max(0,dt.bottom-dt.top)*it.options.cursorHeight+"px",dt.other){var Ft=ct.appendChild(Ht("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));Ft.style.display="",Ft.style.left=dt.other.left+"px",Ft.style.top=dt.other.top+"px",Ft.style.height=(dt.other.bottom-dt.other.top)*.85+"px"}}function $i(it,at){return it.top-at.top||it.left-at.left}function pr(it,at,ct){var dt=it.display,mt=it.doc,Ft=document.createDocumentFragment(),Ot=ns(it.display),Kt=Ot.left,Wt=Math.max(dt.sizerWidth,ps(it)-dt.sizer.offsetLeft)-Ot.right,le=mt.direction=="ltr";function Ze(Pr,Ur,Lo,xr){Ur<0&&(Ur=0),Ur=Math.round(Ur),xr=Math.round(xr),Ft.appendChild(Ht("div",null,"CodeMirror-selected","position: absolute; left: "+Pr+`px;
top: `+Ur+"px; width: "+(Lo==null?Wt-Pr:Lo)+`px;
height: `+(xr-Ur)+"px"))}function fe(Pr,Ur,Lo){var xr=Dn(mt,Pr),Ho=xr.text.length,ka,ds;function ja(os,Pl){return ga(it,Re(Pr,os),"div",xr,Pl)}function ll(os,Pl,As){var as=Ie(it,xr,null,os),ta=Pl=="ltr"==(As=="after")?"left":"right",Wa=As=="after"?as.begin:as.end-(/\s/.test(xr.text.charAt(as.end-1))?2:1);return ja(Wa,ta)[ta]}var Gs=Qe(xr,mt.direction);return we(Gs,Ur||0,Lo==null?Ho:Lo,function(os,Pl,As,as){var ta=As=="ltr",Wa=ja(os,ta?"left":"right"),ys=ja(Pl-1,ta?"right":"left"),Ts=Ur==null&&os==0,fu=Lo==null&&Pl==Ho,za=as==0,ql=!Gs||as==Gs.length-1;if(ys.top-Wa.top<=3){var Ua=(le?Ts:fu)&&za,Dc=(le?fu:Ts)&&ql,_l=Ua?Kt:(ta?Wa:ys).left,wl=Dc?Wt:(ta?ys:Wa).right;Ze(_l,Wa.top,wl-_l,Wa.bottom)}else{var ul,ma,Ss,Hu;ta?(ul=le&&Ts&&za?Kt:Wa.left,ma=le?Wt:ll(os,As,"before"),Ss=le?Kt:ll(Pl,As,"after"),Hu=le&&fu&&ql?Wt:ys.right):(ul=le?ll(os,As,"before"):Kt,ma=!le&&Ts&&za?Wt:Wa.right,Ss=!le&&fu&&ql?Kt:ys.left,Hu=le?ll(Pl,As,"after"):Wt),Ze(ul,Wa.top,ma-ul,Wa.bottom),Wa.bottom<ys.top&&Ze(Kt,Wa.bottom,null,ys.top),Ze(Ss,ys.top,Hu-Ss,ys.bottom)}(!ka||$i(Wa,ka)<0)&&(ka=Wa),$i(ys,ka)<0&&(ka=ys),(!ds||$i(Wa,ds)<0)&&(ds=Wa),$i(ys,ds)<0&&(ds=ys)}),{start:ka,end:ds}}var yn=at.from(),ln=at.to();if(yn.line==ln.line)fe(yn.line,yn.ch,ln.ch);else{var wi=Dn(mt,yn.line),Mi=Dn(mt,ln.line),Ri=An(wi)==An(Mi),sr=fe(yn.line,yn.ch,Ri?wi.text.length+1:null).end,Hr=fe(ln.line,Ri?0:null,ln.ch).start;Ri&&(sr.top<Hr.top-2?(Ze(sr.right,sr.top,null,sr.bottom),Ze(Kt,Hr.top,Hr.left,Hr.bottom)):Ze(sr.right,sr.top,Hr.left-sr.right,sr.bottom)),sr.bottom<Hr.top&&Ze(Kt,sr.bottom,null,Hr.top)}ct.appendChild(Ft)}function uo(it){if(it.state.focused){var at=it.display;clearInterval(at.blinker);var ct=!0;at.cursorDiv.style.visibility="",it.options.cursorBlinkRate>0?at.blinker=setInterval(function(){it.hasFocus()||Ia(it),at.cursorDiv.style.visibility=(ct=!ct)?"":"hidden"},it.options.cursorBlinkRate):it.options.cursorBlinkRate<0&&(at.cursorDiv.style.visibility="hidden")}}function yo(it){it.state.focused||(it.display.input.focus(),qi(it))}function Ro(it){it.state.delayingBlurEvent=!0,setTimeout(function(){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1,Ia(it))},100)}function qi(it,at){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1),it.options.readOnly!="nocursor"&&(it.state.focused||(We(it,"focus",it,at),it.state.focused=!0,xe(it.display.wrapper,"CodeMirror-focused"),!it.curOp&&it.display.selForContextMenu!=it.doc.sel&&(it.display.input.reset(),ee&&setTimeout(function(){return it.display.input.reset(!0)},20)),it.display.input.receivedFocus()),uo(it))}function Ia(it,at){it.state.delayingBlurEvent||(it.state.focused&&(We(it,"blur",it,at),it.state.focused=!1,It(it.display.wrapper,"CodeMirror-focused")),clearInterval(it.display.blinker),setTimeout(function(){it.state.focused||(it.display.shift=!1)},150))}function Cr(it){for(var at=it.display,ct=at.lineDiv.offsetTop,dt=0;dt<at.view.length;dt++){var mt=at.view[dt],Ft=it.options.lineWrapping,Ot=void 0,Kt=0;if(!mt.hidden){if(he&&Dt<8){var Wt=mt.node.offsetTop+mt.node.offsetHeight;Ot=Wt-ct,ct=Wt}else{var le=mt.node.getBoundingClientRect();Ot=le.bottom-le.top,!Ft&&mt.text.firstChild&&(Kt=mt.text.firstChild.getBoundingClientRect().right-le.left-1)}var Ze=mt.line.height-Ot;if((Ze>.005||Ze<-.005)&&(Ki(mt.line,Ot),co(mt.line),mt.rest))for(var fe=0;fe<mt.rest.length;fe++)co(mt.rest[fe]);if(Kt>it.display.sizerWidth){var yn=Math.ceil(Kt/wr(it.display));yn>it.display.maxLineLength&&(it.display.maxLineLength=yn,it.display.maxLine=mt.line,it.display.maxLineChanged=!0)}}}}function co(it){if(it.widgets)for(var at=0;at<it.widgets.length;++at){var ct=it.widgets[at],dt=ct.node.parentNode;dt&&(ct.height=dt.offsetHeight)}}function Ar(it,at,ct){var dt=ct&&ct.top!=null?Math.max(0,ct.top):it.scroller.scrollTop;dt=Math.floor(dt-so(it));var mt=ct&&ct.bottom!=null?ct.bottom:dt+it.wrapper.clientHeight,Ft=me(at,dt),Ot=me(at,mt);if(ct&&ct.ensure){var Kt=ct.ensure.from.line,Wt=ct.ensure.to.line;Kt<Ft?(Ft=Kt,Ot=me(at,Xi(Dn(at,Kt))+it.wrapper.clientHeight)):Math.min(Wt,at.lastLine())>=Ot&&(Ft=me(at,Xi(Dn(at,Wt))-it.wrapper.clientHeight),Ot=Wt)}return{from:Ft,to:Math.max(Ot,Ft+1)}}function ea(it,at){if(!an(it,"scrollCursorIntoView")){var ct=it.display,dt=ct.sizer.getBoundingClientRect(),mt=null;if(at.top+dt.top<0?mt=!0:at.bottom+dt.top>(window.innerHeight||document.documentElement.clientHeight)&&(mt=!1),mt!=null&&!Pe){var Ft=Ht("div","\u200B",null,`position: absolute;
top: `+(at.top-ct.viewOffset-so(it.display))+`px;
height: `+(at.bottom-at.top+Jo(it)+ct.barHeight)+`px;
left: `+at.left+"px; width: "+Math.max(2,at.right-at.left)+"px;");it.display.lineSpace.appendChild(Ft),Ft.scrollIntoView(mt),it.display.lineSpace.removeChild(Ft)}}}function Zo(it,at,ct,dt){dt==null&&(dt=0);var mt;!it.options.lineWrapping&&at==ct&&(at=at.ch?Re(at.line,at.sticky=="before"?at.ch-1:at.ch,"after"):at,ct=at.sticky=="before"?Re(at.line,at.ch+1,"before"):at);for(var Ft=0;Ft<5;Ft++){var Ot=!1,Kt=_o(it,at),Wt=!ct||ct==at?Kt:_o(it,ct);mt={left:Math.min(Kt.left,Wt.left),top:Math.min(Kt.top,Wt.top)-dt,right:Math.max(Kt.left,Wt.left),bottom:Math.max(Kt.bottom,Wt.bottom)+dt};var le=Al(it,mt),Ze=it.doc.scrollTop,fe=it.doc.scrollLeft;if(le.scrollTop!=null&&(ol(it,le.scrollTop),Math.abs(it.doc.scrollTop-Ze)>1&&(Ot=!0)),le.scrollLeft!=null&&(Ul(it,le.scrollLeft),Math.abs(it.doc.scrollLeft-fe)>1&&(Ot=!0)),!Ot)break}return mt}function Fa(it,at){var ct=Al(it,at);ct.scrollTop!=null&&ol(it,ct.scrollTop),ct.scrollLeft!=null&&Ul(it,ct.scrollLeft)}function Al(it,at){var ct=it.display,dt=ur(it.display);at.top<0&&(at.top=0);var mt=it.curOp&&it.curOp.scrollTop!=null?it.curOp.scrollTop:ct.scroller.scrollTop,Ft=ms(it),Ot={};at.bottom-at.top>Ft&&(at.bottom=at.top+Ft);var Kt=it.doc.height+Sa(ct),Wt=at.top<dt,le=at.bottom>Kt-dt;if(at.top<mt)Ot.scrollTop=Wt?0:at.top;else if(at.bottom>mt+Ft){var Ze=Math.min(at.top,(le?Kt:at.bottom)-Ft);Ze!=mt&&(Ot.scrollTop=Ze)}var fe=it.options.fixedGutter?0:ct.gutters.offsetWidth,yn=it.curOp&&it.curOp.scrollLeft!=null?it.curOp.scrollLeft:ct.scroller.scrollLeft-fe,ln=ps(it)-ct.gutters.offsetWidth,wi=at.right-at.left>ln;return wi&&(at.right=at.left+ln),at.left<10?Ot.scrollLeft=0:at.left<yn?Ot.scrollLeft=Math.max(0,at.left+fe-(wi?0:10)):at.right>ln+yn-3&&(Ot.scrollLeft=at.right+(wi?0:10)-ln),Ot}function hu(it,at){at!=null&&(Ns(it),it.curOp.scrollTop=(it.curOp.scrollTop==null?it.doc.scrollTop:it.curOp.scrollTop)+at)}function Ys(it){Ns(it);var at=it.getCursor();it.curOp.scrollToPos={from:at,to:at,margin:it.options.cursorScrollMargin}}function Tl(it,at,ct){(at!=null||ct!=null)&&Ns(it),at!=null&&(it.curOp.scrollLeft=at),ct!=null&&(it.curOp.scrollTop=ct)}function Oo(it,at){Ns(it),it.curOp.scrollToPos=at}function Ns(it){var at=it.curOp.scrollToPos;if(at){it.curOp.scrollToPos=null;var ct=Eo(it,at.from),dt=Eo(it,at.to);gl(it,ct,dt,at.margin)}}function gl(it,at,ct,dt){var mt=Al(it,{left:Math.min(at.left,ct.left),top:Math.min(at.top,ct.top)-dt,right:Math.max(at.right,ct.right),bottom:Math.max(at.bottom,ct.bottom)+dt});Tl(it,mt.scrollLeft,mt.scrollTop)}function ol(it,at){Math.abs(it.doc.scrollTop-at)<2||(gt||us(it,{top:at}),Ph(it,at,!0),gt&&us(it),Uo(it,100))}function Ph(it,at,ct){at=Math.max(0,Math.min(it.display.scroller.scrollHeight-it.display.scroller.clientHeight,at)),!(it.display.scroller.scrollTop==at&&!ct)&&(it.doc.scrollTop=at,it.display.scrollbars.setScrollTop(at),it.display.scroller.scrollTop!=at&&(it.display.scroller.scrollTop=at))}function Ul(it,at,ct,dt){at=Math.max(0,Math.min(at,it.display.scroller.scrollWidth-it.display.scroller.clientWidth)),!((ct?at==it.doc.scrollLeft:Math.abs(it.doc.scrollLeft-at)<2)&&!dt)&&(it.doc.scrollLeft=at,ih(it),it.display.scroller.scrollLeft!=at&&(it.display.scroller.scrollLeft=at),it.display.scrollbars.setScrollLeft(at))}function bo(it){var at=it.display,ct=at.gutters.offsetWidth,dt=Math.round(it.doc.height+Sa(it.display));return{clientHeight:at.scroller.clientHeight,viewHeight:at.wrapper.clientHeight,scrollWidth:at.scroller.scrollWidth,clientWidth:at.scroller.clientWidth,viewWidth:at.wrapper.clientWidth,barLeft:it.options.fixedGutter?ct:0,docHeight:dt,scrollHeight:dt+Jo(it)+at.barHeight,nativeBarWidth:at.nativeBarWidth,gutterWidth:ct}}var Wo=function(it,at,ct){this.cm=ct;var dt=this.vert=Ht("div",[Ht("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),mt=this.horiz=Ht("div",[Ht("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");dt.tabIndex=mt.tabIndex=-1,it(dt),it(mt),dn(dt,"scroll",function(){dt.clientHeight&&at(dt.scrollTop,"vertical")}),dn(mt,"scroll",function(){mt.clientWidth&&at(mt.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,he&&Dt<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Wo.prototype.update=function(it){var at=it.scrollWidth>it.clientWidth+1,ct=it.scrollHeight>it.clientHeight+1,dt=it.nativeBarWidth;if(ct){this.vert.style.display="block",this.vert.style.bottom=at?dt+"px":"0";var mt=it.viewHeight-(at?dt:0);this.vert.firstChild.style.height=Math.max(0,it.scrollHeight-it.clientHeight+mt)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(at){this.horiz.style.display="block",this.horiz.style.right=ct?dt+"px":"0",this.horiz.style.left=it.barLeft+"px";var Ft=it.viewWidth-it.barLeft-(ct?dt:0);this.horiz.firstChild.style.width=Math.max(0,it.scrollWidth-it.clientWidth+Ft)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&it.clientHeight>0&&(dt==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:ct?dt:0,bottom:at?dt:0}},Wo.prototype.setScrollLeft=function(it){this.horiz.scrollLeft!=it&&(this.horiz.scrollLeft=it),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Wo.prototype.setScrollTop=function(it){this.vert.scrollTop!=it&&(this.vert.scrollTop=it),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Wo.prototype.zeroWidthHack=function(){var it=ht&&!se?"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},Wo.prototype.enableZeroWidthBar=function(it,at,ct){it.style.pointerEvents="auto";function dt(){var mt=it.getBoundingClientRect(),Ft=ct=="vert"?document.elementFromPoint(mt.right-1,(mt.top+mt.bottom)/2):document.elementFromPoint((mt.right+mt.left)/2,mt.bottom-1);Ft!=it?it.style.pointerEvents="none":at.set(1e3,dt)}at.set(1e3,dt)},Wo.prototype.clear=function(){var it=this.horiz.parentNode;it.removeChild(this.horiz),it.removeChild(this.vert)};var Pa=function(){};Pa.prototype.update=function(){return{bottom:0,right:0}},Pa.prototype.setScrollLeft=function(){},Pa.prototype.setScrollTop=function(){},Pa.prototype.clear=function(){};function is(it,at){at||(at=bo(it));var ct=it.display.barWidth,dt=it.display.barHeight;Qa(it,at);for(var mt=0;mt<4&&ct!=it.display.barWidth||dt!=it.display.barHeight;mt++)ct!=it.display.barWidth&&it.options.lineWrapping&&Cr(it),Qa(it,bo(it)),ct=it.display.barWidth,dt=it.display.barHeight}function Qa(it,at){var ct=it.display,dt=ct.scrollbars.update(at);ct.sizer.style.paddingRight=(ct.barWidth=dt.right)+"px",ct.sizer.style.paddingBottom=(ct.barHeight=dt.bottom)+"px",ct.heightForcer.style.borderBottom=dt.bottom+"px solid transparent",dt.right&&dt.bottom?(ct.scrollbarFiller.style.display="block",ct.scrollbarFiller.style.height=dt.bottom+"px",ct.scrollbarFiller.style.width=dt.right+"px"):ct.scrollbarFiller.style.display="",dt.bottom&&it.options.coverGutterNextToScrollbar&&it.options.fixedGutter?(ct.gutterFiller.style.display="block",ct.gutterFiller.style.height=dt.bottom+"px",ct.gutterFiller.style.width=at.gutterWidth+"px"):ct.gutterFiller.style.display=""}var pl={native:Wo,null:Pa};function Yl(it){it.display.scrollbars&&(it.display.scrollbars.clear(),it.display.scrollbars.addClass&&It(it.display.wrapper,it.display.scrollbars.addClass)),it.display.scrollbars=new pl[it.options.scrollbarStyle](function(at){it.display.wrapper.insertBefore(at,it.display.scrollbarFiller),dn(at,"mousedown",function(){it.state.focused&&setTimeout(function(){return it.display.input.focus()},0)}),at.setAttribute("cm-not-content","true")},function(at,ct){ct=="horizontal"?Ul(it,at):ol(it,at)},it),it.display.scrollbars.addClass&&xe(it.display.wrapper,it.display.scrollbars.addClass)}var du=0;function al(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:++du},Za(it.curOp)}function ml(it){var at=it.curOp;at&&bs(at,function(ct){for(var dt=0;dt<ct.ops.length;dt++)ct.ops[dt].cm.curOp=null;rf(ct)})}function rf(it){for(var at=it.ops,ct=0;ct<at.length;ct++)of(at[ct]);for(var dt=0;dt<at.length;dt++)fg(at[dt]);for(var mt=0;mt<at.length;mt++)af(at[mt]);for(var Ft=0;Ft<at.length;Ft++)sn(at[Ft]);for(var Ot=0;Ot<at.length;Ot++)tr(at[Ot])}function of(it){var at=it.cm,ct=at.display;ls(at),it.updateMaxLine&&cr(at),it.mustUpdate=it.viewChanged||it.forceUpdate||it.scrollTop!=null||it.scrollToPos&&(it.scrollToPos.from.line<ct.viewFrom||it.scrollToPos.to.line>=ct.viewTo)||ct.maxLineChanged&&at.options.lineWrapping,it.update=it.mustUpdate&&new ko(at,it.mustUpdate&&{top:it.scrollTop,ensure:it.scrollToPos},it.forceUpdate)}function fg(it){it.updatedDisplay=it.mustUpdate&&Ru(it.cm,it.update)}function af(it){var at=it.cm,ct=at.display;it.updatedDisplay&&Cr(at),it.barMeasure=bo(at),ct.maxLineChanged&&!at.options.lineWrapping&&(it.adjustWidthTo=Cu(at,ct.maxLine,ct.maxLine.text.length).left+3,at.display.sizerWidth=it.adjustWidthTo,it.barMeasure.scrollWidth=Math.max(ct.scroller.clientWidth,ct.sizer.offsetLeft+it.adjustWidthTo+Jo(at)+at.display.barWidth),it.maxScrollLeft=Math.max(0,ct.sizer.offsetLeft+it.adjustWidthTo-ps(at))),(it.updatedDisplay||it.selectionChanged)&&(it.preparedSelection=ct.input.prepareSelection())}function sn(it){var at=it.cm;it.adjustWidthTo!=null&&(at.display.sizer.style.minWidth=it.adjustWidthTo+"px",it.maxScrollLeft<at.doc.scrollLeft&&Ul(at,Math.min(at.display.scroller.scrollLeft,it.maxScrollLeft),!0),at.display.maxLineChanged=!1);var ct=it.focus&&it.focus==ye();it.preparedSelection&&at.display.input.showSelection(it.preparedSelection,ct),(it.updatedDisplay||it.startHeight!=at.doc.height)&&is(at,it.barMeasure),it.updatedDisplay&&Xs(at,it.barMeasure),it.selectionChanged&&uo(at),at.state.focused&&it.updateInput&&at.display.input.reset(it.typing),ct&&yo(it.cm)}function tr(it){var at=it.cm,ct=at.display,dt=at.doc;if(it.updatedDisplay&&er(at,it.update),ct.wheelStartX!=null&&(it.scrollTop!=null||it.scrollLeft!=null||it.scrollToPos)&&(ct.wheelStartX=ct.wheelStartY=null),it.scrollTop!=null&&Ph(at,it.scrollTop,it.forceScroll),it.scrollLeft!=null&&Ul(at,it.scrollLeft,!0,!0),it.scrollToPos){var mt=Zo(at,ni(dt,it.scrollToPos.from),ni(dt,it.scrollToPos.to),it.scrollToPos.margin);ea(at,mt)}var Ft=it.maybeHiddenMarkers,Ot=it.maybeUnhiddenMarkers;if(Ft)for(var Kt=0;Kt<Ft.length;++Kt)Ft[Kt].lines.length||We(Ft[Kt],"hide");if(Ot)for(var Wt=0;Wt<Ot.length;++Wt)Ot[Wt].lines.length&&We(Ot[Wt],"unhide");ct.wrapper.offsetHeight&&(dt.scrollTop=at.display.scroller.scrollTop),it.changeObjs&&We(at,"changes",at,it.changeObjs),it.update&&it.update.finish()}function mr(it,at){if(it.curOp)return at();al(it);try{return at()}finally{ml(it)}}function hr(it,at){return function(){if(it.curOp)return at.apply(it,arguments);al(it);try{return at.apply(it,arguments)}finally{ml(it)}}}function Ci(it){return function(){if(this.curOp)return it.apply(this,arguments);al(this);try{return it.apply(this,arguments)}finally{ml(this)}}}function fo(it){return function(){var at=this.cm;if(!at||at.curOp)return it.apply(this,arguments);al(at);try{return it.apply(this,arguments)}finally{ml(at)}}}function Uo(it,at){it.doc.highlightFrontier<it.display.viewTo&&it.state.highlight.set(at,Je(jo,it))}function jo(it){var at=it.doc;if(!(at.highlightFrontier>=it.display.viewTo)){var ct=+new Date+it.options.workTime,dt=ro(it,at.highlightFrontier),mt=[];at.iter(dt.line,Math.min(at.first+at.size,it.display.viewTo+500),function(Ft){if(dt.line>=it.display.viewFrom){var Ot=Ft.styles,Kt=Ft.text.length>it.options.maxHighlightLength?ti(at.mode,dt.state):null,Wt=vr(it,Ft,dt,!0);Kt&&(dt.state=Kt),Ft.styles=Wt.styles;var le=Ft.styleClasses,Ze=Wt.classes;Ze?Ft.styleClasses=Ze:le&&(Ft.styleClasses=null);for(var fe=!Ot||Ot.length!=Ft.styles.length||le!=Ze&&(!le||!Ze||le.bgClass!=Ze.bgClass||le.textClass!=Ze.textClass),yn=0;!fe&&yn<Ot.length;++yn)fe=Ot[yn]!=Ft.styles[yn];fe&&mt.push(dt.line),Ft.stateAfter=dt.save(),dt.nextLine()}else Ft.text.length<=it.options.maxHighlightLength&&en(it,Ft.text,dt),Ft.stateAfter=dt.line%5==0?dt.save():null,dt.nextLine();if(+new Date>ct)return Uo(it,it.options.workDelay),!0}),at.highlightFrontier=dt.line,at.modeFrontier=Math.max(at.modeFrontier,dt.line),mt.length&&mr(it,function(){for(var Ft=0;Ft<mt.length;Ft++)Qi(it,mt[Ft],"text")})}}var ko=function(it,at,ct){var dt=it.display;this.viewport=at,this.visible=Ar(dt,it.doc,at),this.editorIsHidden=!dt.wrapper.offsetWidth,this.wrapperHeight=dt.wrapper.clientHeight,this.wrapperWidth=dt.wrapper.clientWidth,this.oldDisplayWidth=ps(it),this.force=ct,this.dims=vo(it),this.events=[]};ko.prototype.signal=function(it,at){pn(it,at)&&this.events.push(arguments)},ko.prototype.finish=function(){for(var it=0;it<this.events.length;it++)We.apply(null,this.events[it])};function ls(it){var at=it.display;!at.scrollbarsClipped&&at.scroller.offsetWidth&&(at.nativeBarWidth=at.scroller.offsetWidth-at.scroller.clientWidth,at.heightForcer.style.height=Jo(it)+"px",at.sizer.style.marginBottom=-at.nativeBarWidth+"px",at.sizer.style.borderRightWidth=Jo(it)+"px",at.scrollbarsClipped=!0)}function oa(it){if(it.hasFocus())return null;var at=ye();if(!at||!Ne(it.display.lineDiv,at))return null;var ct={activeElt:at};if(window.getSelection){var dt=window.getSelection();dt.anchorNode&&dt.extend&&Ne(it.display.lineDiv,dt.anchorNode)&&(ct.anchorNode=dt.anchorNode,ct.anchorOffset=dt.anchorOffset,ct.focusNode=dt.focusNode,ct.focusOffset=dt.focusOffset)}return ct}function _a(it){if(!(!it||!it.activeElt||it.activeElt==ye())&&(it.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(it.activeElt.nodeName)&&it.anchorNode&&Ne(document.body,it.anchorNode)&&Ne(document.body,it.focusNode))){var at=window.getSelection(),ct=document.createRange();ct.setEnd(it.anchorNode,it.anchorOffset),ct.collapse(!1),at.removeAllRanges(),at.addRange(ct),at.extend(it.focusNode,it.focusOffset)}}function Ru(it,at){var ct=it.display,dt=it.doc;if(at.editorIsHidden)return br(it),!1;if(!at.force&&at.visible.from>=ct.viewFrom&&at.visible.to<=ct.viewTo&&(ct.updateLineNumbers==null||ct.updateLineNumbers>=ct.viewTo)&&ct.renderedView==ct.view&&no(it)==0)return!1;Ma(it)&&(br(it),at.dims=vo(it));var mt=dt.first+dt.size,Ft=Math.max(at.visible.from-it.options.viewportMargin,dt.first),Ot=Math.min(mt,at.visible.to+it.options.viewportMargin);ct.viewFrom<Ft&&Ft-ct.viewFrom<20&&(Ft=Math.max(dt.first,ct.viewFrom)),ct.viewTo>Ot&&ct.viewTo-Ot<20&&(Ot=Math.min(mt,ct.viewTo)),cn&&(Ft=vi(it.doc,Ft),Ot=ii(it.doc,Ot));var Kt=Ft!=ct.viewFrom||Ot!=ct.viewTo||ct.lastWrapHeight!=at.wrapperHeight||ct.lastWrapWidth!=at.wrapperWidth;Dr(it,Ft,Ot),ct.viewOffset=Xi(Dn(it.doc,ct.viewFrom)),it.display.mover.style.top=ct.viewOffset+"px";var Wt=no(it);if(!Kt&&Wt==0&&!at.force&&ct.renderedView==ct.view&&(ct.updateLineNumbers==null||ct.updateLineNumbers>=ct.viewTo))return!1;var le=oa(it);return Wt>4&&(ct.lineDiv.style.display="none"),vl(it,ct.updateLineNumbers,at.dims),Wt>4&&(ct.lineDiv.style.display=""),ct.renderedView=ct.view,_a(le),qt(ct.cursorDiv),qt(ct.selectionDiv),ct.gutters.style.height=ct.sizer.style.minHeight=0,Kt&&(ct.lastWrapHeight=at.wrapperHeight,ct.lastWrapWidth=at.wrapperWidth,Uo(it,400)),ct.updateLineNumbers=null,!0}function er(it,at){for(var ct=at.viewport,dt=!0;;dt=!1){if(!dt||!it.options.lineWrapping||at.oldDisplayWidth==ps(it)){if(ct&&ct.top!=null&&(ct={top:Math.min(it.doc.height+Sa(it.display)-ms(it),ct.top)}),at.visible=Ar(it.display,it.doc,ct),at.visible.from>=it.display.viewFrom&&at.visible.to<=it.display.viewTo)break}else dt&&(at.visible=Ar(it.display,it.doc,ct));if(!Ru(it,at))break;Cr(it);var mt=bo(it);Zi(it),is(it,mt),Xs(it,mt),at.force=!1}at.signal(it,"update",it),(it.display.viewFrom!=it.display.reportedViewFrom||it.display.viewTo!=it.display.reportedViewTo)&&(at.signal(it,"viewportChange",it,it.display.viewFrom,it.display.viewTo),it.display.reportedViewFrom=it.display.viewFrom,it.display.reportedViewTo=it.display.viewTo)}function us(it,at){var ct=new ko(it,at);if(Ru(it,ct)){Cr(it),er(it,ct);var dt=bo(it);Zi(it),is(it,dt),Xs(it,dt),ct.finish()}}function vl(it,at,ct){var dt=it.display,mt=it.options.lineNumbers,Ft=dt.lineDiv,Ot=Ft.firstChild;function Kt(wi){var Mi=wi.nextSibling;return ee&&ht&&it.display.currentWheelTarget==wi?wi.style.display="none":wi.parentNode.removeChild(wi),Mi}for(var Wt=dt.view,le=dt.viewFrom,Ze=0;Ze<Wt.length;Ze++){var fe=Wt[Ze];if(!fe.hidden)if(!fe.node||fe.node.parentNode!=Ft){var yn=mo(it,fe,le,ct);Ft.insertBefore(yn,Ot)}else{for(;Ot!=fe.node;)Ot=Kt(Ot);var ln=mt&&at!=null&&at<=le&&fe.lineNumber;fe.changes&&(Xe(fe.changes,"gutter")>-1&&(ln=!1),qo(it,fe,le,ct)),ln&&(qt(fe.lineNumber),fe.lineNumber.appendChild(document.createTextNode(Gn(it.options,le)))),Ot=fe.node.nextSibling}le+=fe.size}for(;Ot;)Ot=Kt(Ot)}function Ha(it){var at=it.gutters.offsetWidth;it.sizer.style.marginLeft=at+"px"}function Xs(it,at){it.display.sizer.style.minHeight=at.docHeight+"px",it.display.heightForcer.style.top=at.docHeight+"px",it.display.gutters.style.height=at.docHeight+it.display.barHeight+Jo(it)+"px"}function ih(it){var at=it.display,ct=at.view;if(!(!at.alignWidgets&&(!at.gutters.firstChild||!it.options.fixedGutter))){for(var dt=Xr(at)-at.scroller.scrollLeft+it.doc.scrollLeft,mt=at.gutters.offsetWidth,Ft=dt+"px",Ot=0;Ot<ct.length;Ot++)if(!ct[Ot].hidden){it.options.fixedGutter&&(ct[Ot].gutter&&(ct[Ot].gutter.style.left=Ft),ct[Ot].gutterBackground&&(ct[Ot].gutterBackground.style.left=Ft));var Kt=ct[Ot].alignable;if(Kt)for(var Wt=0;Wt<Kt.length;Wt++)Kt[Wt].style.left=Ft}it.options.fixedGutter&&(at.gutters.style.left=dt+mt+"px")}}function Ma(it){if(!it.options.lineNumbers)return!1;var at=it.doc,ct=Gn(it.options,at.first+at.size-1),dt=it.display;if(ct.length!=dt.lineNumChars){var mt=dt.measure.appendChild(Ht("div",[Ht("div",ct)],"CodeMirror-linenumber CodeMirror-gutter-elt")),Ft=mt.firstChild.offsetWidth,Ot=mt.offsetWidth-Ft;return dt.lineGutter.style.width="",dt.lineNumInnerWidth=Math.max(Ft,dt.lineGutter.offsetWidth-Ot)+1,dt.lineNumWidth=dt.lineNumInnerWidth+Ot,dt.lineNumChars=dt.lineNumInnerWidth?ct.length:-1,dt.lineGutter.style.width=dt.lineNumWidth+"px",Ha(it.display),!0}return!1}function Ea(it,at){for(var ct=[],dt=!1,mt=0;mt<it.length;mt++){var Ft=it[mt],Ot=null;if(typeof Ft!="string"&&(Ot=Ft.style,Ft=Ft.className),Ft=="CodeMirror-linenumbers")if(at)dt=!0;else continue;ct.push({className:Ft,style:Ot})}return at&&!dt&&ct.push({className:"CodeMirror-linenumbers",style:null}),ct}function Xl(it){var at=it.gutters,ct=it.gutterSpecs;qt(at),it.lineGutter=null;for(var dt=0;dt<ct.length;++dt){var mt=ct[dt],Ft=mt.className,Ot=mt.style,Kt=at.appendChild(Ht("div",null,"CodeMirror-gutter "+Ft));Ot&&(Kt.style.cssText=Ot),Ft=="CodeMirror-linenumbers"&&(it.lineGutter=Kt,Kt.style.width=(it.lineNumWidth||1)+"px")}at.style.display=ct.length?"":"none",Ha(it)}function Dl(it){Xl(it.display),ar(it),ih(it)}function wh(it,at,ct,dt){var mt=this;this.input=ct,mt.scrollbarFiller=Ht("div",null,"CodeMirror-scrollbar-filler"),mt.scrollbarFiller.setAttribute("cm-not-content","true"),mt.gutterFiller=Ht("div",null,"CodeMirror-gutter-filler"),mt.gutterFiller.setAttribute("cm-not-content","true"),mt.lineDiv=pe("div",null,"CodeMirror-code"),mt.selectionDiv=Ht("div",null,null,"position: relative; z-index: 1"),mt.cursorDiv=Ht("div",null,"CodeMirror-cursors"),mt.measure=Ht("div",null,"CodeMirror-measure"),mt.lineMeasure=Ht("div",null,"CodeMirror-measure"),mt.lineSpace=pe("div",[mt.measure,mt.lineMeasure,mt.selectionDiv,mt.cursorDiv,mt.lineDiv],null,"position: relative; outline: none");var Ft=pe("div",[mt.lineSpace],"CodeMirror-lines");mt.mover=Ht("div",[Ft],null,"position: relative"),mt.sizer=Ht("div",[mt.mover],"CodeMirror-sizer"),mt.sizerWidth=null,mt.heightForcer=Ht("div",null,null,"position: absolute; height: "+On+"px; width: 1px;"),mt.gutters=Ht("div",null,"CodeMirror-gutters"),mt.lineGutter=null,mt.scroller=Ht("div",[mt.sizer,mt.heightForcer,mt.gutters],"CodeMirror-scroll"),mt.scroller.setAttribute("tabIndex","-1"),mt.wrapper=Ht("div",[mt.scrollbarFiller,mt.gutterFiller,mt.scroller],"CodeMirror"),he&&Dt<8&&(mt.gutters.style.zIndex=-1,mt.scroller.style.paddingRight=0),!ee&&!(gt&&et)&&(mt.scroller.draggable=!0),it&&(it.appendChild?it.appendChild(mt.wrapper):it(mt.wrapper)),mt.viewFrom=mt.viewTo=at.first,mt.reportedViewFrom=mt.reportedViewTo=at.first,mt.view=[],mt.renderedView=null,mt.externalMeasured=null,mt.viewOffset=0,mt.lastWrapHeight=mt.lastWrapWidth=0,mt.updateLineNumbers=null,mt.nativeBarWidth=mt.barHeight=mt.barWidth=0,mt.scrollbarsClipped=!1,mt.lineNumWidth=mt.lineNumInnerWidth=mt.lineNumChars=null,mt.alignWidgets=!1,mt.cachedCharWidth=mt.cachedTextHeight=mt.cachedPaddingH=null,mt.maxLine=null,mt.maxLineLength=0,mt.maxLineChanged=!1,mt.wheelDX=mt.wheelDY=mt.wheelStartX=mt.wheelStartY=null,mt.shift=!1,mt.selForContextMenu=null,mt.activeTouch=null,mt.gutterSpecs=Ea(dt.gutters,dt.lineNumbers),Xl(mt),ct.init(mt)}var yl=0,$a=null;he?$a=-.53:gt?$a=15:Qt?$a=-.7:Ae&&($a=-1/3);function Lu(it){var at=it.wheelDeltaX,ct=it.wheelDeltaY;return at==null&&it.detail&&it.axis==it.HORIZONTAL_AXIS&&(at=it.detail),ct==null&&it.detail&&it.axis==it.VERTICAL_AXIS?ct=it.detail:ct==null&&(ct=it.wheelDelta),{x:at,y:ct}}function Ol(it){var at=Lu(it);return at.x*=$a,at.y*=$a,at}function vs(it,at){var ct=Lu(at),dt=ct.x,mt=ct.y,Ft=it.display,Ot=Ft.scroller,Kt=Ot.scrollWidth>Ot.clientWidth,Wt=Ot.scrollHeight>Ot.clientHeight;if(dt&&Kt||mt&&Wt){if(mt&&ht&&ee){t:for(var le=at.target,Ze=Ft.view;le!=Ot;le=le.parentNode)for(var fe=0;fe<Ze.length;fe++)if(Ze[fe].node==le){it.display.currentWheelTarget=le;break t}}if(dt&&!gt&&!jt&&$a!=null){mt&&Wt&&ol(it,Math.max(0,Ot.scrollTop+mt*$a)),Ul(it,Math.max(0,Ot.scrollLeft+dt*$a)),(!mt||mt&&Wt)&&In(at),Ft.wheelStartX=null;return}if(mt&&$a!=null){var yn=mt*$a,ln=it.doc.scrollTop,wi=ln+Ft.wrapper.clientHeight;yn<0?ln=Math.max(0,ln+yn-50):wi=Math.min(it.doc.height,wi+yn+50),us(it,{top:ln,bottom:wi})}yl<20&&(Ft.wheelStartX==null?(Ft.wheelStartX=Ot.scrollLeft,Ft.wheelStartY=Ot.scrollTop,Ft.wheelDX=dt,Ft.wheelDY=mt,setTimeout(function(){if(Ft.wheelStartX!=null){var Mi=Ot.scrollLeft-Ft.wheelStartX,Ri=Ot.scrollTop-Ft.wheelStartY,sr=Ri&&Ft.wheelDY&&Ri/Ft.wheelDY||Mi&&Ft.wheelDX&&Mi/Ft.wheelDX;Ft.wheelStartX=Ft.wheelStartY=null,sr&&($a=($a*yl+sr)/(yl+1),++yl)}},200)):(Ft.wheelDX+=dt,Ft.wheelDY+=mt))}}var Jl=function(it,at){this.ranges=it,this.primIndex=at};Jl.prototype.primary=function(){return this.ranges[this.primIndex]},Jl.prototype.equals=function(it){if(it==this)return!0;if(it.primIndex!=this.primIndex||it.ranges.length!=this.ranges.length)return!1;for(var at=0;at<this.ranges.length;at++){var ct=this.ranges[at],dt=it.ranges[at];if(!Nn(ct.anchor,dt.anchor)||!Nn(ct.head,dt.head))return!1}return!0},Jl.prototype.deepCopy=function(){for(var it=[],at=0;at<this.ranges.length;at++)it[at]=new sa(_n(this.ranges[at].anchor),_n(this.ranges[at].head));return new Jl(it,this.primIndex)},Jl.prototype.somethingSelected=function(){for(var it=0;it<this.ranges.length;it++)if(!this.ranges[it].empty())return!0;return!1},Jl.prototype.contains=function(it,at){at||(at=it);for(var ct=0;ct<this.ranges.length;ct++){var dt=this.ranges[ct];if($e(at,dt.from())>=0&&$e(it,dt.to())<=0)return ct}return-1};var sa=function(it,at){this.anchor=it,this.head=at};sa.prototype.from=function(){return Jn(this.anchor,this.head)},sa.prototype.to=function(){return di(this.anchor,this.head)},sa.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function cu(it,at,ct){var dt=it&&it.options.selectionsMayTouch,mt=at[ct];at.sort(function(yn,ln){return $e(yn.from(),ln.from())}),ct=Xe(at,mt);for(var Ft=1;Ft<at.length;Ft++){var Ot=at[Ft],Kt=at[Ft-1],Wt=$e(Kt.to(),Ot.from());if(dt&&!Ot.empty()?Wt>0:Wt>=0){var le=Jn(Kt.from(),Ot.from()),Ze=di(Kt.to(),Ot.to()),fe=Kt.empty()?Ot.from()==Ot.head:Kt.from()==Kt.head;Ft<=ct&&--ct,at.splice(--Ft,2,new sa(fe?Ze:le,fe?le:Ze))}}return new Jl(at,ct)}function rh(it,at){return new Jl([new sa(it,at||it)],0)}function Ch(it){return it.text?Re(it.from.line+it.text.length-1,ne(it.text).length+(it.text.length==1?it.from.ch:0)):it.to}function $h(it,at){if($e(it,at.from)<0)return it;if($e(it,at.to)<=0)return Ch(at);var ct=it.line+at.text.length-(at.to.line-at.from.line)-1,dt=it.ch;return it.line==at.to.line&&(dt+=Ch(at).ch-at.to.ch),Re(ct,dt)}function fc(it,at){for(var ct=[],dt=0;dt<it.sel.ranges.length;dt++){var mt=it.sel.ranges[dt];ct.push(new sa($h(mt.anchor,at),$h(mt.head,at)))}return cu(it.cm,ct,it.sel.primIndex)}function Td(it,at,ct){return it.line==at.line?Re(ct.line,it.ch-at.ch+ct.ch):Re(ct.line+(it.line-at.line),it.ch)}function gc(it,at,ct){for(var dt=[],mt=Re(it.first,0),Ft=mt,Ot=0;Ot<at.length;Ot++){var Kt=at[Ot],Wt=Td(Kt.from,mt,Ft),le=Td(Ch(Kt),mt,Ft);if(mt=Kt.to,Ft=le,ct=="around"){var Ze=it.sel.ranges[Ot],fe=$e(Ze.head,Ze.anchor)<0;dt[Ot]=new sa(fe?le:Wt,fe?Wt:le)}else dt[Ot]=new sa(Wt,Wt)}return new Jl(dt,it.sel.primIndex)}function Go(it){it.doc.mode=ve(it.options,it.doc.modeOption),pc(it)}function pc(it){it.doc.iter(function(at){at.stateAfter&&(at.stateAfter=null),at.styles&&(at.styles=null)}),it.doc.modeFrontier=it.doc.highlightFrontier=it.doc.first,Uo(it,100),it.state.modeGen++,it.curOp&&ar(it)}function gg(it,at){return at.from.ch==0&&at.to.ch==0&&ne(at.text)==""&&(!it.cm||it.cm.options.wholeLineUpdateBefore)}function sf(it,at,ct,dt){function mt(Hr){return ct?ct[Hr]:null}function Ft(Hr,Pr,Ur){to(Hr,Pr,Ur,dt),or(Hr,"change",Hr,at)}function Ot(Hr,Pr){for(var Ur=[],Lo=Hr;Lo<Pr;++Lo)Ur.push(new oo(le[Lo],mt(Lo),dt));return Ur}var Kt=at.from,Wt=at.to,le=at.text,Ze=Dn(it,Kt.line),fe=Dn(it,Wt.line),yn=ne(le),ln=mt(le.length-1),wi=Wt.line-Kt.line;if(at.full)it.insert(0,Ot(0,le.length)),it.remove(le.length,it.size-le.length);else if(gg(it,at)){var Mi=Ot(0,le.length-1);Ft(fe,fe.text,ln),wi&&it.remove(Kt.line,wi),Mi.length&&it.insert(Kt.line,Mi)}else if(Ze==fe)if(le.length==1)Ft(Ze,Ze.text.slice(0,Kt.ch)+yn+Ze.text.slice(Wt.ch),ln);else{var Ri=Ot(1,le.length-1);Ri.push(new oo(yn+Ze.text.slice(Wt.ch),ln,dt)),Ft(Ze,Ze.text.slice(0,Kt.ch)+le[0],mt(0)),it.insert(Kt.line+1,Ri)}else if(le.length==1)Ft(Ze,Ze.text.slice(0,Kt.ch)+le[0]+fe.text.slice(Wt.ch),mt(0)),it.remove(Kt.line+1,wi);else{Ft(Ze,Ze.text.slice(0,Kt.ch)+le[0],mt(0)),Ft(fe,yn+fe.text.slice(Wt.ch),ln);var sr=Ot(1,le.length-1);wi>1&&it.remove(Kt.line+1,wi-1),it.insert(Kt.line+1,sr)}or(it,"change",it,at)}function Fu(it,at,ct){function dt(mt,Ft,Ot){if(mt.linked)for(var Kt=0;Kt<mt.linked.length;++Kt){var Wt=mt.linked[Kt];if(Wt.doc!=Ft){var le=Ot&&Wt.sharedHist;ct&&!le||(at(Wt.doc,le),dt(Wt.doc,mt,le))}}}dt(it,null,!0)}function lf(it,at){if(at.cm)throw new Error("This document is already in use.");it.doc=at,at.cm=it,Ui(it),Go(it),mc(it),it.options.lineWrapping||cr(it),it.options.mode=at.modeOption,ar(it)}function mc(it){(it.doc.direction=="rtl"?xe:It)(it.display.lineDiv,"CodeMirror-rtl")}function q0(it){mr(it,function(){mc(it),ar(it)})}function Dd(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 uf(it,at){var ct={from:_n(at.from),to:Ch(at),text:ki(it,at.from,at.to)};return Eh(it,ct,at.from.line,at.to.line+1),Fu(it,function(dt){return Eh(dt,ct,at.from.line,at.to.line+1)},!0),ct}function Od(it){for(;it.length;){var at=ne(it);if(at.ranges)it.pop();else break}}function vc(it,at){if(at)return Od(it.done),ne(it.done);if(it.done.length&&!ne(it.done).ranges)return ne(it.done);if(it.done.length>1&&!it.done[it.done.length-2].ranges)return it.done.pop(),ne(it.done)}function yc(it,at,ct,dt){var mt=it.history;mt.undone.length=0;var Ft=+new Date,Ot,Kt;if((mt.lastOp==dt||mt.lastOrigin==at.origin&&at.origin&&(at.origin.charAt(0)=="+"&&mt.lastModTime>Ft-(it.cm?it.cm.options.historyEventDelay:500)||at.origin.charAt(0)=="*"))&&(Ot=vc(mt,mt.lastOp==dt)))Kt=ne(Ot.changes),$e(at.from,at.to)==0&&$e(at.from,Kt.to)==0?Kt.to=Ch(at):Ot.changes.push(uf(it,at));else{var Wt=ne(mt.done);for((!Wt||!Wt.ranges)&&Id(it.sel,mt.done),Ot={changes:[uf(it,at)],generation:mt.generation},mt.done.push(Ot);mt.done.length>mt.undoDepth;)mt.done.shift(),mt.done[0].ranges||mt.done.shift()}mt.done.push(ct),mt.generation=++mt.maxGeneration,mt.lastModTime=mt.lastSelTime=Ft,mt.lastOp=mt.lastSelOp=dt,mt.lastOrigin=mt.lastSelOrigin=at.origin,Kt||We(it,"historyAdded")}function pg(it,at,ct,dt){var mt=at.charAt(0);return mt=="*"||mt=="+"&&ct.ranges.length==dt.ranges.length&&ct.somethingSelected()==dt.somethingSelected()&&new Date-it.history.lastSelTime<=(it.cm?it.cm.options.historyEventDelay:500)}function Sc(it,at,ct,dt){var mt=it.history,Ft=dt&&dt.origin;ct==mt.lastSelOp||Ft&&mt.lastSelOrigin==Ft&&(mt.lastModTime==mt.lastSelTime&&mt.lastOrigin==Ft||pg(it,Ft,ne(mt.done),at))?mt.done[mt.done.length-1]=at:Id(at,mt.done),mt.lastSelTime=+new Date,mt.lastSelOrigin=Ft,mt.lastSelOp=ct,dt&&dt.clearRedo!==!1&&Od(mt.undone)}function Id(it,at){var ct=ne(at);ct&&ct.ranges&&ct.equals(it)||at.push(it)}function Eh(it,at,ct,dt){var mt=at["spans_"+it.id],Ft=0;it.iter(Math.max(it.first,ct),Math.min(it.first+it.size,dt),function(Ot){Ot.markedSpans&&((mt||(mt=at["spans_"+it.id]={}))[Ft]=Ot.markedSpans),++Ft})}function Js(it){if(!it)return null;for(var at,ct=0;ct<it.length;++ct)it[ct].marker.explicitlyCleared?at||(at=it.slice(0,ct)):at&&at.push(it[ct]);return at?at.length?at:null:it}function ju(it,at){var ct=at["spans_"+it.id];if(!ct)return null;for(var dt=[],mt=0;mt<at.text.length;++mt)dt.push(Js(ct[mt]));return dt}function hf(it,at){var ct=ju(it,at),dt=Co(it,at);if(!ct)return dt;if(!dt)return ct;for(var mt=0;mt<ct.length;++mt){var Ft=ct[mt],Ot=dt[mt];if(Ft&&Ot)t:for(var Kt=0;Kt<Ot.length;++Kt){for(var Wt=Ot[Kt],le=0;le<Ft.length;++le)if(Ft[le].marker==Wt.marker)continue t;Ft.push(Wt)}else Ot&&(ct[mt]=Ot)}return ct}function oh(it,at,ct){for(var dt=[],mt=0;mt<it.length;++mt){var Ft=it[mt];if(Ft.ranges){dt.push(ct?Jl.prototype.deepCopy.call(Ft):Ft);continue}var Ot=Ft.changes,Kt=[];dt.push({changes:Kt});for(var Wt=0;Wt<Ot.length;++Wt){var le=Ot[Wt],Ze=void 0;if(Kt.push({from:le.from,to:le.to,text:le.text}),at)for(var fe in le)(Ze=fe.match(/^spans_(\d+)$/))&&Xe(at,Number(Ze[1]))>-1&&(ne(Kt)[fe]=le[fe],delete le[fe])}}return dt}function df(it,at,ct,dt){if(dt){var mt=it.anchor;if(ct){var Ft=$e(at,mt)<0;Ft!=$e(ct,mt)<0?(mt=at,at=ct):Ft!=$e(at,ct)<0&&(at=ct)}return new sa(mt,at)}else return new sa(ct||at,at)}function cf(it,at,ct,dt,mt){mt==null&&(mt=it.cm&&(it.cm.display.shift||it.extend)),Zs(it,new Jl([df(it.sel.primary(),at,ct,mt)],0),dt)}function Hp(it,at,ct){for(var dt=[],mt=it.cm&&(it.cm.display.shift||it.extend),Ft=0;Ft<it.sel.ranges.length;Ft++)dt[Ft]=df(it.sel.ranges[Ft],at[Ft],null,mt);var Ot=cu(it.cm,dt,it.sel.primIndex);Zs(it,Ot,ct)}function Lh(it,at,ct,dt){var mt=it.sel.ranges.slice(0);mt[at]=ct,Zs(it,cu(it.cm,mt,it.sel.primIndex),dt)}function qh(it,at,ct,dt){Zs(it,rh(at,ct),dt)}function Wp(it,at,ct){var dt={ranges:at.ranges,update:function(mt){this.ranges=[];for(var Ft=0;Ft<mt.length;Ft++)this.ranges[Ft]=new sa(ni(it,mt[Ft].anchor),ni(it,mt[Ft].head))},origin:ct&&ct.origin};return We(it,"beforeSelectionChange",it,dt),it.cm&&We(it.cm,"beforeSelectionChange",it.cm,dt),dt.ranges!=at.ranges?cu(it.cm,dt.ranges,dt.ranges.length-1):at}function ff(it,at,ct){var dt=it.history.done,mt=ne(dt);mt&&mt.ranges?(dt[dt.length-1]=at,td(it,at,ct)):Zs(it,at,ct)}function Zs(it,at,ct){td(it,at,ct),Sc(it,it.sel,it.cm?it.cm.curOp.id:NaN,ct)}function td(it,at,ct){(pn(it,"beforeSelectionChange")||it.cm&&pn(it.cm,"beforeSelectionChange"))&&(at=Wp(it,at,ct));var dt=ct&&ct.bias||($e(at.primary().head,it.sel.primary().head)<0?-1:1);mg(it,Pc(it,at,dt,!0)),!(ct&&ct.scroll===!1)&&it.cm&&Ys(it.cm)}function mg(it,at){at.equals(it.sel)||(it.sel=at,it.cm&&(it.cm.curOp.updateInput=1,it.cm.curOp.selectionChanged=!0,Xn(it.cm)),or(it,"cursorActivity",it))}function xc(it){mg(it,Pc(it,it.sel,null,!1))}function Pc(it,at,ct,dt){for(var mt,Ft=0;Ft<at.ranges.length;Ft++){var Ot=at.ranges[Ft],Kt=at.ranges.length==it.sel.ranges.length&&it.sel.ranges[Ft],Wt=wc(it,Ot.anchor,Kt&&Kt.anchor,ct,dt),le=wc(it,Ot.head,Kt&&Kt.head,ct,dt);(mt||Wt!=Ot.anchor||le!=Ot.head)&&(mt||(mt=at.ranges.slice(0,Ft)),mt[Ft]=new sa(Wt,le))}return mt?cu(it.cm,mt,at.primIndex):at}function ah(it,at,ct,dt,mt){var Ft=Dn(it,at.line);if(Ft.markedSpans)for(var Ot=0;Ot<Ft.markedSpans.length;++Ot){var Kt=Ft.markedSpans[Ot],Wt=Kt.marker,le="selectLeft"in Wt?!Wt.selectLeft:Wt.inclusiveLeft,Ze="selectRight"in Wt?!Wt.selectRight:Wt.inclusiveRight;if((Kt.from==null||(le?Kt.from<=at.ch:Kt.from<at.ch))&&(Kt.to==null||(Ze?Kt.to>=at.ch:Kt.to>at.ch))){if(mt&&(We(Wt,"beforeCursorEnter"),Wt.explicitlyCleared))if(Ft.markedSpans){--Ot;continue}else break;if(!Wt.atomic)continue;if(ct){var fe=Wt.find(dt<0?1:-1),yn=void 0;if((dt<0?Ze:le)&&(fe=vg(it,fe,-dt,fe&&fe.line==at.line?Ft:null)),fe&&fe.line==at.line&&(yn=$e(fe,ct))&&(dt<0?yn<0:yn>0))return ah(it,fe,at,dt,mt)}var ln=Wt.find(dt<0?-1:1);return(dt<0?le:Ze)&&(ln=vg(it,ln,dt,ln.line==at.line?Ft:null)),ln?ah(it,ln,at,dt,mt):null}}return at}function wc(it,at,ct,dt,mt){var Ft=dt||1,Ot=ah(it,at,ct,Ft,mt)||!mt&&ah(it,at,ct,Ft,!0)||ah(it,at,ct,-Ft,mt)||!mt&&ah(it,at,ct,-Ft,!0);return Ot||(it.cantEdit=!0,Re(it.first,0))}function vg(it,at,ct,dt){return ct<0&&at.ch==0?at.line>it.first?ni(it,Re(at.line-1)):null:ct>0&&at.ch==(dt||Dn(it,at.line)).text.length?at.line<it.first+it.size-1?Re(at.line+1,0):null:new Re(at.line,at.ch+ct)}function qa(it){it.setSelection(Re(it.firstLine(),0),Re(it.lastLine()),De)}function Cc(it,at,ct){var dt={canceled:!1,from:at.from,to:at.to,text:at.text,origin:at.origin,cancel:function(){return dt.canceled=!0}};return ct&&(dt.update=function(mt,Ft,Ot,Kt){mt&&(dt.from=ni(it,mt)),Ft&&(dt.to=ni(it,Ft)),Ot&&(dt.text=Ot),Kt!==void 0&&(dt.origin=Kt)}),We(it,"beforeChange",it,dt),it.cm&&We(it.cm,"beforeChange",it.cm,dt),dt.canceled?(it.cm&&(it.cm.curOp.updateInput=2),null):{from:dt.from,to:dt.to,text:dt.text,origin:dt.origin}}function Fh(it,at,ct){if(it.cm){if(!it.cm.curOp)return hr(it.cm,Fh)(it,at,ct);if(it.cm.state.suppressEdits)return}if(!((pn(it,"beforeChange")||it.cm&&pn(it.cm,"beforeChange"))&&(at=Cc(it,at,!0),!at))){var dt=Rr&&!ct&&xn(it,at.from,at.to);if(dt)for(var mt=dt.length-1;mt>=0;--mt)ed(it,{from:dt[mt].from,to:dt[mt].to,text:mt?[""]:at.text,origin:at.origin});else ed(it,at)}}function ed(it,at){if(!(at.text.length==1&&at.text[0]==""&&$e(at.from,at.to)==0)){var ct=fc(it,at);yc(it,at,ct,it.cm?it.cm.curOp.id:NaN),_d(it,at,ct,Co(it,at));var dt=[];Fu(it,function(mt,Ft){!Ft&&Xe(dt,mt.history)==-1&&(Sg(mt.history,at),dt.push(mt.history)),_d(mt,at,null,Co(mt,at))})}}function Ec(it,at,ct){var dt=it.cm&&it.cm.state.suppressEdits;if(!(dt&&!ct)){for(var mt=it.history,Ft,Ot=it.sel,Kt=at=="undo"?mt.done:mt.undone,Wt=at=="undo"?mt.undone:mt.done,le=0;le<Kt.length&&(Ft=Kt[le],!(ct?Ft.ranges&&!Ft.equals(it.sel):!Ft.ranges));le++);if(le!=Kt.length){for(mt.lastOrigin=mt.lastSelOrigin=null;;)if(Ft=Kt.pop(),Ft.ranges){if(Id(Ft,Wt),ct&&!Ft.equals(it.sel)){Zs(it,Ft,{clearRedo:!1});return}Ot=Ft}else if(dt){Kt.push(Ft);return}else break;var Ze=[];Id(Ot,Wt),Wt.push({changes:Ze,generation:mt.generation}),mt.generation=Ft.generation||++mt.maxGeneration;for(var fe=pn(it,"beforeChange")||it.cm&&pn(it.cm,"beforeChange"),yn=function(Mi){var Ri=Ft.changes[Mi];if(Ri.origin=at,fe&&!Cc(it,Ri,!1))return Kt.length=0,{};Ze.push(uf(it,Ri));var sr=Mi?fc(it,Ri):ne(Kt);_d(it,Ri,sr,hf(it,Ri)),!Mi&&it.cm&&it.cm.scrollIntoView({from:Ri.from,to:Ch(Ri)});var Hr=[];Fu(it,function(Pr,Ur){!Ur&&Xe(Hr,Pr.history)==-1&&(Sg(Pr.history,Ri),Hr.push(Pr.history)),_d(Pr,Ri,null,hf(Pr,Ri))})},ln=Ft.changes.length-1;ln>=0;--ln){var wi=yn(ln);if(wi)return wi.v}}}}function yg(it,at){if(at!=0&&(it.first+=at,it.sel=new Jl(wn(it.sel.ranges,function(mt){return new sa(Re(mt.anchor.line+at,mt.anchor.ch),Re(mt.head.line+at,mt.head.ch))}),it.sel.primIndex),it.cm)){ar(it.cm,it.first,it.first-at,at);for(var ct=it.cm.display,dt=ct.viewFrom;dt<ct.viewTo;dt++)Qi(it.cm,dt,"gutter")}}function _d(it,at,ct,dt){if(it.cm&&!it.cm.curOp)return hr(it.cm,_d)(it,at,ct,dt);if(at.to.line<it.first){yg(it,at.text.length-1-(at.to.line-at.from.line));return}if(!(at.from.line>it.lastLine())){if(at.from.line<it.first){var mt=at.text.length-1-(it.first-at.from.line);yg(it,mt),at={from:Re(it.first,0),to:Re(at.to.line+mt,at.to.ch),text:[ne(at.text)],origin:at.origin}}var Ft=it.lastLine();at.to.line>Ft&&(at={from:at.from,to:Re(Ft,Dn(it,Ft).text.length),text:[at.text[0]],origin:at.origin}),at.removed=ki(it,at.from,at.to),ct||(ct=fc(it,at)),it.cm?Vp(it.cm,at,dt):sf(it,at,dt),td(it,ct,De),it.cantEdit&&wc(it,Re(it.firstLine(),0))&&(it.cantEdit=!1)}}function Vp(it,at,ct){var dt=it.doc,mt=it.display,Ft=at.from,Ot=at.to,Kt=!1,Wt=Ft.line;it.options.lineWrapping||(Wt=Gt(An(Dn(dt,Ft.line))),dt.iter(Wt,Ot.line+1,function(ln){if(ln==mt.maxLine)return Kt=!0,!0})),dt.sel.contains(at.from,at.to)>-1&&Xn(it),sf(dt,at,ct,Ir(it)),it.options.lineWrapping||(dt.iter(Wt,Ft.line+at.text.length,function(ln){var wi=Or(ln);wi>mt.maxLineLength&&(mt.maxLine=ln,mt.maxLineLength=wi,mt.maxLineChanged=!0,Kt=!1)}),Kt&&(it.curOp.updateMaxLine=!0)),_r(dt,Ft.line),Uo(it,400);var le=at.text.length-(Ot.line-Ft.line)-1;at.full?ar(it):Ft.line==Ot.line&&at.text.length==1&&!gg(it.doc,at)?Qi(it,Ft.line,"text"):ar(it,Ft.line,Ot.line+1,le);var Ze=pn(it,"changes"),fe=pn(it,"change");if(fe||Ze){var yn={from:Ft,to:Ot,text:at.text,removed:at.removed,origin:at.origin};fe&&or(it,"change",it,yn),Ze&&(it.curOp.changeObjs||(it.curOp.changeObjs=[])).push(yn)}it.display.selForContextMenu=null}function nd(it,at,ct,dt,mt){var Ft;dt||(dt=ct),$e(dt,ct)<0&&(Ft=[dt,ct],ct=Ft[0],dt=Ft[1]),typeof at=="string"&&(at=it.splitLines(at)),Fh(it,{from:ct,to:dt,text:at,origin:mt})}function Ql(it,at,ct,dt){ct<it.line?it.line+=dt:at<it.line&&(it.line=at,it.ch=0)}function Kp(it,at,ct,dt){for(var mt=0;mt<it.length;++mt){var Ft=it[mt],Ot=!0;if(Ft.ranges){Ft.copied||(Ft=it[mt]=Ft.deepCopy(),Ft.copied=!0);for(var Kt=0;Kt<Ft.ranges.length;Kt++)Ql(Ft.ranges[Kt].anchor,at,ct,dt),Ql(Ft.ranges[Kt].head,at,ct,dt);continue}for(var Wt=0;Wt<Ft.changes.length;++Wt){var le=Ft.changes[Wt];if(ct<le.from.line)le.from=Re(le.from.line+dt,le.from.ch),le.to=Re(le.to.line+dt,le.to.ch);else if(at<=le.to.line){Ot=!1;break}}Ot||(it.splice(0,mt+1),mt=0)}}function Sg(it,at){var ct=at.from.line,dt=at.to.line,mt=at.text.length-(dt-ct)-1;Kp(it.done,ct,dt,mt),Kp(it.undone,ct,dt,mt)}function id(it,at,ct,dt){var mt=at,Ft=at;return typeof at=="number"?Ft=Dn(it,li(it,at)):mt=Gt(at),mt==null?null:(dt(Ft,mt)&&it.cm&&Qi(it.cm,mt,ct),Ft)}function Rd(it){this.lines=it,this.parent=null;for(var at=0,ct=0;ct<it.length;++ct)it[ct].parent=this,at+=it[ct].height;this.height=at}Rd.prototype={chunkSize:function(){return this.lines.length},removeInner:function(it,at){for(var ct=it,dt=it+at;ct<dt;++ct){var mt=this.lines[ct];this.height-=mt.height,$r(mt),or(mt,"delete")}this.lines.splice(it,at)},collapse:function(it){it.push.apply(it,this.lines)},insertInner:function(it,at,ct){this.height+=ct,this.lines=this.lines.slice(0,it).concat(at).concat(this.lines.slice(it));for(var dt=0;dt<at.length;++dt)at[dt].parent=this},iterN:function(it,at,ct){for(var dt=it+at;it<dt;++it)if(ct(this.lines[it]))return!0}};function Ra(it){this.children=it;for(var at=0,ct=0,dt=0;dt<it.length;++dt){var mt=it[dt];at+=mt.chunkSize(),ct+=mt.height,mt.parent=this}this.size=at,this.height=ct,this.parent=null}Ra.prototype={chunkSize:function(){return this.size},removeInner:function(it,at){this.size-=at;for(var ct=0;ct<this.children.length;++ct){var dt=this.children[ct],mt=dt.chunkSize();if(it<mt){var Ft=Math.min(at,mt-it),Ot=dt.height;if(dt.removeInner(it,Ft),this.height-=Ot-dt.height,mt==Ft&&(this.children.splice(ct--,1),dt.parent=null),(at-=Ft)==0)break;it=0}else it-=mt}if(this.size-at<25&&(this.children.length>1||!(this.children[0]instanceof Rd))){var Kt=[];this.collapse(Kt),this.children=[new Rd(Kt)],this.children[0].parent=this}},collapse:function(it){for(var at=0;at<this.children.length;++at)this.children[at].collapse(it)},insertInner:function(it,at,ct){this.size+=at.length,this.height+=ct;for(var dt=0;dt<this.children.length;++dt){var mt=this.children[dt],Ft=mt.chunkSize();if(it<=Ft){if(mt.insertInner(it,at,ct),mt.lines&&mt.lines.length>50){for(var Ot=mt.lines.length%25+25,Kt=Ot;Kt<mt.lines.length;){var Wt=new Rd(mt.lines.slice(Kt,Kt+=25));mt.height-=Wt.height,this.children.splice(++dt,0,Wt),Wt.parent=this}mt.lines=mt.lines.slice(0,Ot),this.maybeSpill()}break}it-=Ft}},maybeSpill:function(){if(!(this.children.length<=10)){var it=this;do{var at=it.children.splice(it.children.length-5,5),ct=new Ra(at);if(it.parent){it.size-=ct.size,it.height-=ct.height;var mt=Xe(it.parent.children,it);it.parent.children.splice(mt+1,0,ct)}else{var dt=new Ra(it.children);dt.parent=it,it.children=[dt,ct],it=dt}ct.parent=it.parent}while(it.children.length>10);it.parent.maybeSpill()}},iterN:function(it,at,ct){for(var dt=0;dt<this.children.length;++dt){var mt=this.children[dt],Ft=mt.chunkSize();if(it<Ft){var Ot=Math.min(at,Ft-it);if(mt.iterN(it,Ot,ct))return!0;if((at-=Ot)==0)break;it=0}else it-=Ft}}};var sh=function(it,at,ct){if(ct)for(var dt in ct)ct.hasOwnProperty(dt)&&(this[dt]=ct[dt]);this.doc=it,this.node=at};sh.prototype.clear=function(){var it=this.doc.cm,at=this.line.widgets,ct=this.line,dt=Gt(ct);if(!(dt==null||!at)){for(var mt=0;mt<at.length;++mt)at[mt]==this&&at.splice(mt--,1);at.length||(ct.widgets=null);var Ft=da(this);Ki(ct,Math.max(0,ct.height-Ft)),it&&(mr(it,function(){Up(it,ct,-Ft),Qi(it,dt,"widget")}),or(it,"lineWidgetCleared",it,this,dt))}},sh.prototype.changed=function(){var it=this,at=this.height,ct=this.doc.cm,dt=this.line;this.height=null;var mt=da(this)-at;mt&&(nn(this.doc,dt)||Ki(dt,dt.height+mt),ct&&mr(ct,function(){ct.curOp.forceUpdate=!0,Up(ct,dt,mt),or(ct,"lineWidgetChanged",ct,it,Gt(dt))}))},rn(sh);function Up(it,at,ct){Xi(at)<(it.curOp&&it.curOp.scrollTop||it.doc.scrollTop)&&hu(it,ct)}function gf(it,at,ct,dt){var mt=new sh(it,ct,dt),Ft=it.cm;return Ft&&mt.noHScroll&&(Ft.display.alignWidgets=!0),id(it,at,"widget",function(Ot){var Kt=Ot.widgets||(Ot.widgets=[]);if(mt.insertAt==null?Kt.push(mt):Kt.splice(Math.min(Kt.length-1,Math.max(0,mt.insertAt)),0,mt),mt.line=Ot,Ft&&!nn(it,Ot)){var Wt=Xi(Ot)<it.scrollTop;Ki(Ot,Ot.height+da(mt)),Wt&&hu(Ft,mt.height),Ft.curOp.forceUpdate=!0}return!0}),Ft&&or(Ft,"lineWidgetAdded",Ft,mt,typeof at=="number"?at:Gt(at)),mt}var Yp=0,be=function(it,at){this.lines=[],this.type=at,this.doc=it,this.id=++Yp};be.prototype.clear=function(){if(!this.explicitlyCleared){var it=this.doc.cm,at=it&&!it.curOp;if(at&&al(it),pn(this,"clear")){var ct=this.find();ct&&or(this,"clear",ct.from,ct.to)}for(var dt=null,mt=null,Ft=0;Ft<this.lines.length;++Ft){var Ot=this.lines[Ft],Kt=Kr(Ot.markedSpans,this);it&&!this.collapsed?Qi(it,Gt(Ot),"text"):it&&(Kt.to!=null&&(mt=Gt(Ot)),Kt.from!=null&&(dt=Gt(Ot))),Ot.markedSpans=zi(Ot.markedSpans,Kt),Kt.from==null&&this.collapsed&&!nn(this.doc,Ot)&&it&&Ki(Ot,ur(it.display))}if(it&&this.collapsed&&!it.options.lineWrapping)for(var Wt=0;Wt<this.lines.length;++Wt){var le=An(this.lines[Wt]),Ze=Or(le);Ze>it.display.maxLineLength&&(it.display.maxLine=le,it.display.maxLineLength=Ze,it.display.maxLineChanged=!0)}dt!=null&&it&&this.collapsed&&ar(it,dt,mt+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,it&&xc(it.doc)),it&&or(it,"markerCleared",it,this,dt,mt),at&&ml(it),this.parent&&this.parent.clear()}},be.prototype.find=function(it,at){it==null&&this.type=="bookmark"&&(it=1);for(var ct,dt,mt=0;mt<this.lines.length;++mt){var Ft=this.lines[mt],Ot=Kr(Ft.markedSpans,this);if(Ot.from!=null&&(ct=Re(at?Ft:Gt(Ft),Ot.from),it==-1))return ct;if(Ot.to!=null&&(dt=Re(at?Ft:Gt(Ft),Ot.to),it==1))return dt}return ct&&{from:ct,to:dt}},be.prototype.changed=function(){var it=this,at=this.find(-1,!0),ct=this,dt=this.doc.cm;!at||!dt||mr(dt,function(){var mt=at.line,Ft=Gt(at.line),Ot=js(dt,Ft);if(Ot&&(_u(Ot),dt.curOp.selectionChanged=dt.curOp.forceUpdate=!0),dt.curOp.updateMaxLine=!0,!nn(ct.doc,mt)&&ct.height!=null){var Kt=ct.height;ct.height=null;var Wt=da(ct)-Kt;Wt&&Ki(mt,mt.height+Wt)}or(dt,"markerChanged",dt,it)})},be.prototype.attachLine=function(it){if(!this.lines.length&&this.doc.cm){var at=this.doc.cm.curOp;(!at.maybeHiddenMarkers||Xe(at.maybeHiddenMarkers,this)==-1)&&(at.maybeUnhiddenMarkers||(at.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(it)},be.prototype.detachLine=function(it){if(this.lines.splice(Xe(this.lines,it),1),!this.lines.length&&this.doc.cm){var at=this.doc.cm.curOp;(at.maybeHiddenMarkers||(at.maybeHiddenMarkers=[])).push(this)}},rn(be);function rd(it,at,ct,dt,mt){if(dt&&dt.shared)return Xp(it,at,ct,dt,mt);if(it.cm&&!it.cm.curOp)return hr(it.cm,rd)(it,at,ct,dt,mt);var Ft=new be(it,mt),Ot=$e(at,ct);if(dt&&fn(dt,Ft,!1),Ot>0||Ot==0&&Ft.clearWhenEmpty!==!1)return Ft;if(Ft.replacedWith&&(Ft.collapsed=!0,Ft.widgetNode=pe("span",[Ft.replacedWith],"CodeMirror-widget"),dt.handleMouseEvents||Ft.widgetNode.setAttribute("cm-ignore-events","true"),dt.insertLeft&&(Ft.widgetNode.insertLeft=!0)),Ft.collapsed){if($n(it,at.line,at,ct,Ft)||at.line!=ct.line&&$n(it,ct.line,at,ct,Ft))throw new Error("Inserting collapsed marker partially overlapping an existing one");gn()}Ft.addToHistory&&yc(it,{from:at,to:ct,origin:"markText"},it.sel,NaN);var Kt=at.line,Wt=it.cm,le;if(it.iter(Kt,ct.line+1,function(fe){Wt&&Ft.collapsed&&!Wt.options.lineWrapping&&An(fe)==Wt.display.maxLine&&(le=!0),Ft.collapsed&&Kt!=at.line&&Ki(fe,0),wo(fe,new Wi(Ft,Kt==at.line?at.ch:null,Kt==ct.line?ct.ch:null)),++Kt}),Ft.collapsed&&it.iter(at.line,ct.line+1,function(fe){nn(it,fe)&&Ki(fe,0)}),Ft.clearOnEnter&&dn(Ft,"beforeCursorEnter",function(){return Ft.clear()}),Ft.readOnly&&(ho(),(it.history.done.length||it.history.undone.length)&&it.clearHistory()),Ft.collapsed&&(Ft.id=++Yp,Ft.atomic=!0),Wt){if(le&&(Wt.curOp.updateMaxLine=!0),Ft.collapsed)ar(Wt,at.line,ct.line+1);else if(Ft.className||Ft.startStyle||Ft.endStyle||Ft.css||Ft.attributes||Ft.title)for(var Ze=at.line;Ze<=ct.line;Ze++)Qi(Wt,Ze,"text");Ft.atomic&&xc(Wt.doc),or(Wt,"markerAdded",Wt,Ft)}return Ft}var zu=function(it,at){this.markers=it,this.primary=at;for(var ct=0;ct<it.length;++ct)it[ct].parent=this};zu.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var it=0;it<this.markers.length;++it)this.markers[it].clear();or(this,"clear")}},zu.prototype.find=function(it,at){return this.primary.find(it,at)},rn(zu);function Xp(it,at,ct,dt,mt){dt=fn(dt),dt.shared=!1;var Ft=[rd(it,at,ct,dt,mt)],Ot=Ft[0],Kt=dt.widgetNode;return Fu(it,function(Wt){Kt&&(dt.widgetNode=Kt.cloneNode(!0)),Ft.push(rd(Wt,ni(Wt,at),ni(Wt,ct),dt,mt));for(var le=0;le<Wt.linked.length;++le)if(Wt.linked[le].isParent)return;Ot=ne(Ft)}),new zu(Ft,Ot)}function xg(it){return it.findMarks(Re(it.first,0),it.clipPos(Re(it.lastLine())),function(at){return at.parent})}function Jp(it,at){for(var ct=0;ct<at.length;ct++){var dt=at[ct],mt=dt.find(),Ft=it.clipPos(mt.from),Ot=it.clipPos(mt.to);if($e(Ft,Ot)){var Kt=rd(it,Ft,Ot,dt.primary,dt.primary.type);dt.markers.push(Kt),Kt.parent=dt}}}function Pg(it){for(var at=function(dt){var mt=it[dt],Ft=[mt.primary.doc];Fu(mt.primary.doc,function(Wt){return Ft.push(Wt)});for(var Ot=0;Ot<mt.markers.length;Ot++){var Kt=mt.markers[Ot];Xe(Ft,Kt.doc)==-1&&(Kt.parent=null,mt.markers.splice(Ot--,1))}},ct=0;ct<it.length;ct++)at(ct)}var tv=0,Bs=function(it,at,ct,dt,mt){if(!(this instanceof Bs))return new Bs(it,at,ct,dt,mt);ct==null&&(ct=0),Ra.call(this,[new Rd([new oo("",null)])]),this.first=ct,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ct;var Ft=Re(ct,0);this.sel=rh(Ft),this.history=new Dd(null),this.id=++tv,this.modeOption=at,this.lineSep=dt,this.direction=mt=="rtl"?"rtl":"ltr",this.extend=!1,typeof it=="string"&&(it=this.splitLines(it)),sf(this,{from:Ft,to:Ft,text:it}),Zs(this,rh(Ft),De)};Bs.prototype=Lt(Ra.prototype,{constructor:Bs,iter:function(it,at,ct){ct?this.iterN(it-this.first,at-it,ct):this.iterN(this.first,this.first+this.size,it)},insert:function(it,at){for(var ct=0,dt=0;dt<at.length;++dt)ct+=at[dt].height;this.insertInner(it-this.first,at,ct)},remove:function(it,at){this.removeInner(it-this.first,at)},getValue:function(it){var at=Di(this,this.first,this.first+this.size);return it===!1?at:at.join(it||this.lineSeparator())},setValue:fo(function(it){var at=Re(this.first,0),ct=this.first+this.size-1;Fh(this,{from:at,to:Re(ct,Dn(this,ct).text.length),text:this.splitLines(it),origin:"setValue",full:!0},!0),this.cm&&Tl(this.cm,0,0),Zs(this,rh(at),De)}),replaceRange:function(it,at,ct,dt){at=ni(this,at),ct=ct?ni(this,ct):at,nd(this,it,at,ct,dt)},getRange:function(it,at,ct){var dt=ki(this,ni(this,it),ni(this,at));return ct===!1?dt:dt.join(ct||this.lineSeparator())},getLine:function(it){var at=this.getLineHandle(it);return at&&at.text},getLineHandle:function(it){if(En(this,it))return Dn(this,it)},getLineNumber:function(it){return Gt(it)},getLineHandleVisualStart:function(it){return typeof it=="number"&&(it=Dn(this,it)),An(it)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(it){return ni(this,it)},getCursor:function(it){var at=this.sel.primary(),ct;return it==null||it=="head"?ct=at.head:it=="anchor"?ct=at.anchor:it=="end"||it=="to"||it===!1?ct=at.to():ct=at.from(),ct},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:fo(function(it,at,ct){qh(this,ni(this,typeof it=="number"?Re(it,at||0):it),null,ct)}),setSelection:fo(function(it,at,ct){qh(this,ni(this,it),ni(this,at||it),ct)}),extendSelection:fo(function(it,at,ct){cf(this,ni(this,it),at&&ni(this,at),ct)}),extendSelections:fo(function(it,at){Hp(this,Oi(this,it),at)}),extendSelectionsBy:fo(function(it,at){var ct=wn(this.sel.ranges,it);Hp(this,Oi(this,ct),at)}),setSelections:fo(function(it,at,ct){if(it.length){for(var dt=[],mt=0;mt<it.length;mt++)dt[mt]=new sa(ni(this,it[mt].anchor),ni(this,it[mt].head));at==null&&(at=Math.min(it.length-1,this.sel.primIndex)),Zs(this,cu(this.cm,dt,at),ct)}}),addSelection:fo(function(it,at,ct){var dt=this.sel.ranges.slice(0);dt.push(new sa(ni(this,it),ni(this,at||it))),Zs(this,cu(this.cm,dt,dt.length-1),ct)}),getSelection:function(it){for(var at=this.sel.ranges,ct,dt=0;dt<at.length;dt++){var mt=ki(this,at[dt].from(),at[dt].to());ct=ct?ct.concat(mt):mt}return it===!1?ct:ct.join(it||this.lineSeparator())},getSelections:function(it){for(var at=[],ct=this.sel.ranges,dt=0;dt<ct.length;dt++){var mt=ki(this,ct[dt].from(),ct[dt].to());it!==!1&&(mt=mt.join(it||this.lineSeparator())),at[dt]=mt}return at},replaceSelection:function(it,at,ct){for(var dt=[],mt=0;mt<this.sel.ranges.length;mt++)dt[mt]=it;this.replaceSelections(dt,at,ct||"+input")},replaceSelections:fo(function(it,at,ct){for(var dt=[],mt=this.sel,Ft=0;Ft<mt.ranges.length;Ft++){var Ot=mt.ranges[Ft];dt[Ft]={from:Ot.from(),to:Ot.to(),text:this.splitLines(it[Ft]),origin:ct}}for(var Kt=at&&at!="end"&&gc(this,dt,at),Wt=dt.length-1;Wt>=0;Wt--)Fh(this,dt[Wt]);Kt?ff(this,Kt):this.cm&&Ys(this.cm)}),undo:fo(function(){Ec(this,"undo")}),redo:fo(function(){Ec(this,"redo")}),undoSelection:fo(function(){Ec(this,"undo",!0)}),redoSelection:fo(function(){Ec(this,"redo",!0)}),setExtending:function(it){this.extend=it},getExtending:function(){return this.extend},historySize:function(){for(var it=this.history,at=0,ct=0,dt=0;dt<it.done.length;dt++)it.done[dt].ranges||++at;for(var mt=0;mt<it.undone.length;mt++)it.undone[mt].ranges||++ct;return{undo:at,redo:ct}},clearHistory:function(){var it=this;this.history=new Dd(this.history.maxGeneration),Fu(this,function(at){return at.history=it.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(it){return it&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(it){return this.history.generation==(it||this.cleanGeneration)},getHistory:function(){return{done:oh(this.history.done),undone:oh(this.history.undone)}},setHistory:function(it){var at=this.history=new Dd(this.history.maxGeneration);at.done=oh(it.done.slice(0),null,!0),at.undone=oh(it.undone.slice(0),null,!0)},setGutterMarker:fo(function(it,at,ct){return id(this,it,"gutter",function(dt){var mt=dt.gutterMarkers||(dt.gutterMarkers={});return mt[at]=ct,!ct&&Mt(mt)&&(dt.gutterMarkers=null),!0})}),clearGutter:fo(function(it){var at=this;this.iter(function(ct){ct.gutterMarkers&&ct.gutterMarkers[it]&&id(at,ct,"gutter",function(){return ct.gutterMarkers[it]=null,Mt(ct.gutterMarkers)&&(ct.gutterMarkers=null),!0})})}),lineInfo:function(it){var at;if(typeof it=="number"){if(!En(this,it)||(at=it,it=Dn(this,it),!it))return null}else if(at=Gt(it),at==null)return null;return{line:at,handle:it,text:it.text,gutterMarkers:it.gutterMarkers,textClass:it.textClass,bgClass:it.bgClass,wrapClass:it.wrapClass,widgets:it.widgets}},addLineClass:fo(function(it,at,ct){return id(this,it,at=="gutter"?"gutter":"class",function(dt){var mt=at=="text"?"textClass":at=="background"?"bgClass":at=="gutter"?"gutterClass":"wrapClass";if(!dt[mt])dt[mt]=ct;else{if(Tt(ct).test(dt[mt]))return!1;dt[mt]+=" "+ct}return!0})}),removeLineClass:fo(function(it,at,ct){return id(this,it,at=="gutter"?"gutter":"class",function(dt){var mt=at=="text"?"textClass":at=="background"?"bgClass":at=="gutter"?"gutterClass":"wrapClass",Ft=dt[mt];if(Ft)if(ct==null)dt[mt]=null;else{var Ot=Ft.match(Tt(ct));if(!Ot)return!1;var Kt=Ot.index+Ot[0].length;dt[mt]=Ft.slice(0,Ot.index)+(!Ot.index||Kt==Ft.length?"":" ")+Ft.slice(Kt)||null}else return!1;return!0})}),addLineWidget:fo(function(it,at,ct){return gf(this,it,at,ct)}),removeLineWidget:function(it){it.clear()},markText:function(it,at,ct){return rd(this,ni(this,it),ni(this,at),ct,ct&&ct.type||"range")},setBookmark:function(it,at){var ct={replacedWith:at&&(at.nodeType==null?at.widget:at),insertLeft:at&&at.insertLeft,clearWhenEmpty:!1,shared:at&&at.shared,handleMouseEvents:at&&at.handleMouseEvents};return it=ni(this,it),rd(this,it,it,ct,"bookmark")},findMarksAt:function(it){it=ni(this,it);var at=[],ct=Dn(this,it.line).markedSpans;if(ct)for(var dt=0;dt<ct.length;++dt){var mt=ct[dt];(mt.from==null||mt.from<=it.ch)&&(mt.to==null||mt.to>=it.ch)&&at.push(mt.marker.parent||mt.marker)}return at},findMarks:function(it,at,ct){it=ni(this,it),at=ni(this,at);var dt=[],mt=it.line;return this.iter(it.line,at.line+1,function(Ft){var Ot=Ft.markedSpans;if(Ot)for(var Kt=0;Kt<Ot.length;Kt++){var Wt=Ot[Kt];!(Wt.to!=null&&mt==it.line&&it.ch>=Wt.to||Wt.from==null&&mt!=it.line||Wt.from!=null&&mt==at.line&&Wt.from>=at.ch)&&(!ct||ct(Wt.marker))&&dt.push(Wt.marker.parent||Wt.marker)}++mt}),dt},getAllMarks:function(){var it=[];return this.iter(function(at){var ct=at.markedSpans;if(ct)for(var dt=0;dt<ct.length;++dt)ct[dt].from!=null&&it.push(ct[dt].marker)}),it},posFromIndex:function(it){var at,ct=this.first,dt=this.lineSeparator().length;return this.iter(function(mt){var Ft=mt.text.length+dt;if(Ft>it)return at=it,!0;it-=Ft,++ct}),ni(this,Re(ct,at))},indexFromPos:function(it){it=ni(this,it);var at=it.ch;if(it.line<this.first||it.ch<0)return 0;var ct=this.lineSeparator().length;return this.iter(this.first,it.line,function(dt){at+=dt.text.length+ct}),at},copy:function(it){var at=new Bs(Di(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return at.scrollTop=this.scrollTop,at.scrollLeft=this.scrollLeft,at.sel=this.sel,at.extend=!1,it&&(at.history.undoDepth=this.history.undoDepth,at.setHistory(this.getHistory())),at},linkedDoc:function(it){it||(it={});var at=this.first,ct=this.first+this.size;it.from!=null&&it.from>at&&(at=it.from),it.to!=null&&it.to<ct&&(ct=it.to);var dt=new Bs(Di(this,at,ct),it.mode||this.modeOption,at,this.lineSep,this.direction);return it.sharedHist&&(dt.history=this.history),(this.linked||(this.linked=[])).push({doc:dt,sharedHist:it.sharedHist}),dt.linked=[{doc:this,isParent:!0,sharedHist:it.sharedHist}],Jp(dt,xg(this)),dt},unlinkDoc:function(it){if(it instanceof Qo&&(it=it.doc),this.linked)for(var at=0;at<this.linked.length;++at){var ct=this.linked[at];if(ct.doc==it){this.linked.splice(at,1),it.unlinkDoc(this),Pg(xg(this));break}}if(it.history==this.history){var dt=[it.id];Fu(it,function(mt){return dt.push(mt.id)},!0),it.history=new Dd(null),it.history.done=oh(this.history.done,dt),it.history.undone=oh(this.history.undone,dt)}},iterLinkedDocs:function(it){Fu(this,it)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(it){return this.lineSep?it.split(this.lineSep):Gi(it)},lineSeparator:function(){return this.lineSep||`
`},setDirection:fo(function(it){it!="rtl"&&(it="ltr"),it!=this.direction&&(this.direction=it,this.iter(function(at){return at.order=null}),this.cm&&q0(this.cm))})}),Bs.prototype.eachLine=Bs.prototype.iter;var Lc=0;function wg(it){var at=this;if(qp(at),!(an(at,it)||Yo(at.display,it))){In(it),he&&(Lc=+new Date);var ct=eo(at,it,!0),dt=it.dataTransfer.files;if(!(!ct||at.isReadOnly()))if(dt&&dt.length&&window.FileReader&&window.File)for(var mt=dt.length,Ft=Array(mt),Ot=0,Kt=function(){++Ot==mt&&hr(at,function(){ct=ni(at.doc,ct);var ln={from:ct,to:ct,text:at.doc.splitLines(Ft.filter(function(wi){return wi!=null}).join(at.doc.lineSeparator())),origin:"paste"};Fh(at.doc,ln),ff(at.doc,rh(ni(at.doc,ct),ni(at.doc,Ch(ln))))})()},Wt=function(ln,wi){if(at.options.allowDropFileTypes&&Xe(at.options.allowDropFileTypes,ln.type)==-1){Kt();return}var Mi=new FileReader;Mi.onerror=function(){return Kt()},Mi.onload=function(){var Ri=Mi.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ri)){Kt();return}Ft[wi]=Ri,Kt()},Mi.readAsText(ln)},le=0;le<dt.length;le++)Wt(dt[le],le);else{if(at.state.draggingText&&at.doc.sel.contains(ct)>-1){at.state.draggingText(it),setTimeout(function(){return at.display.input.focus()},20);return}try{var Ze=it.dataTransfer.getData("Text");if(Ze){var fe;if(at.state.draggingText&&!at.state.draggingText.copy&&(fe=at.listSelections()),td(at.doc,rh(ct,ct)),fe)for(var yn=0;yn<fe.length;++yn)nd(at.doc,"",fe[yn].anchor,fe[yn].head,"drag");at.replaceSelection(Ze,"around","paste"),at.display.input.focus()}}catch(ln){}}}}function Qp(it,at){if(he&&(!it.state.draggingText||+new Date-Lc<100)){mi(at);return}if(!(an(it,at)||Yo(it.display,at))&&(at.dataTransfer.setData("Text",it.getSelection()),at.dataTransfer.effectAllowed="copyMove",at.dataTransfer.setDragImage&&!Ae)){var ct=Ht("img",null,null,"position: fixed; left: 0; top: 0;");ct.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",jt&&(ct.width=ct.height=1,it.display.wrapper.appendChild(ct),ct._top=ct.offsetTop),at.dataTransfer.setDragImage(ct,0,0),jt&&ct.parentNode.removeChild(ct)}}function $p(it,at){var ct=eo(it,at);if(ct){var dt=document.createDocumentFragment();Pi(it,ct,dt),it.display.dragCursor||(it.display.dragCursor=Ht("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),it.display.lineSpace.insertBefore(it.display.dragCursor,it.display.cursorDiv)),Xt(it.display.dragCursor,dt)}}function qp(it){it.display.dragCursor&&(it.display.lineSpace.removeChild(it.display.dragCursor),it.display.dragCursor=null)}function tm(it){if(document.getElementsByClassName){for(var at=document.getElementsByClassName("CodeMirror"),ct=[],dt=0;dt<at.length;dt++){var mt=at[dt].CodeMirror;mt&&ct.push(mt)}ct.length&&ct[0].operation(function(){for(var Ft=0;Ft<ct.length;Ft++)it(ct[Ft])})}}var Cg=!1;function Il(){Cg||(jd(),Cg=!0)}function jd(){var it;dn(window,"resize",function(){it==null&&(it=setTimeout(function(){it=null,tm(Eg)},100))}),dn(window,"blur",function(){return tm(Ia)})}function Eg(it){var at=it.display;at.cachedCharWidth=at.cachedTextHeight=at.cachedPaddingH=null,at.scrollbarsClipped=!1,it.setSize()}for(var Zu={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Fc=0;Fc<10;Fc++)Zu[Fc+48]=Zu[Fc+96]=String(Fc);for(var pf=65;pf<=90;pf++)Zu[pf]=String.fromCharCode(pf);for(var Mc=1;Mc<=12;Mc++)Zu[Mc+111]=Zu[Mc+63235]="F"+Mc;var Sl={};Sl.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"},Sl.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"},Sl.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"},Sl.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"]},Sl.default=ht?Sl.macDefault:Sl.pcDefault;function Lg(it){var at=it.split(/-(?!$)/);it=at[at.length-1];for(var ct,dt,mt,Ft,Ot=0;Ot<at.length-1;Ot++){var Kt=at[Ot];if(/^(cmd|meta|m)$/i.test(Kt))Ft=!0;else if(/^a(lt)?$/i.test(Kt))ct=!0;else if(/^(c|ctrl|control)$/i.test(Kt))dt=!0;else if(/^s(hift)?$/i.test(Kt))mt=!0;else throw new Error("Unrecognized modifier name: "+Kt)}return ct&&(it="Alt-"+it),dt&&(it="Ctrl-"+it),Ft&&(it="Cmd-"+it),mt&&(it="Shift-"+it),it}function Fg(it){var at={};for(var ct in it)if(it.hasOwnProperty(ct)){var dt=it[ct];if(/^(name|fallthrough|(de|at)tach)$/.test(ct))continue;if(dt=="..."){delete it[ct];continue}for(var mt=wn(ct.split(" "),Lg),Ft=0;Ft<mt.length;Ft++){var Ot=void 0,Kt=void 0;Ft==mt.length-1?(Kt=mt.join(" "),Ot=dt):(Kt=mt.slice(0,Ft+1).join(" "),Ot="...");var Wt=at[Kt];if(!Wt)at[Kt]=Ot;else if(Wt!=Ot)throw new Error("Inconsistent bindings for "+Kt)}delete it[ct]}for(var le in at)it[le]=at[le];return it}function $l(it,at,ct,dt){at=od(at);var mt=at.call?at.call(it,dt):at[it];if(mt===!1)return"nothing";if(mt==="...")return"multi";if(mt!=null&&ct(mt))return"handled";if(at.fallthrough){if(Object.prototype.toString.call(at.fallthrough)!="[object Array]")return $l(it,at.fallthrough,ct,dt);for(var Ft=0;Ft<at.fallthrough.length;Ft++){var Ot=$l(it,at.fallthrough[Ft],ct,dt);if(Ot)return Ot}}}function zd(it){var at=typeof it=="string"?it:Zu[it.keyCode];return at=="Ctrl"||at=="Alt"||at=="Shift"||at=="Mod"}function Mg(it,at,ct){var dt=it;return at.altKey&&dt!="Alt"&&(it="Alt-"+it),(St?at.metaKey:at.ctrlKey)&&dt!="Ctrl"&&(it="Ctrl-"+it),(St?at.ctrlKey:at.metaKey)&&dt!="Mod"&&(it="Cmd-"+it),!ct&&at.shiftKey&&dt!="Shift"&&(it="Shift-"+it),it}function em(it,at){if(jt&&it.keyCode==34&&it.char)return!1;var ct=Zu[it.keyCode];return ct==null||it.altGraphKey?!1:(it.keyCode==3&&it.code&&(ct=it.code),Mg(ct,it,at))}function od(it){return typeof it=="string"?Sl[it]:it}function xl(it,at){for(var ct=it.doc.sel.ranges,dt=[],mt=0;mt<ct.length;mt++){for(var Ft=at(ct[mt]);dt.length&&$e(Ft.from,ne(dt).to)<=0;){var Ot=dt.pop();if($e(Ot.from,Ft.from)<0){Ft.from=Ot.from;break}}dt.push(Ft)}mr(it,function(){for(var Kt=dt.length-1;Kt>=0;Kt--)nd(it.doc,"",dt[Kt].from,dt[Kt].to,"+delete");Ys(it)})}function kg(it,at,ct){var dt=Oe(it.text,at+ct,ct);return dt<0||dt>it.text.length?null:dt}function ts(it,at,ct){var dt=kg(it,at.ch,ct);return dt==null?null:new Re(at.line,dt,ct<0?"after":"before")}function kc(it,at,ct,dt,mt){if(it){at.doc.direction=="rtl"&&(mt=-mt);var Ft=Qe(ct,at.doc.direction);if(Ft){var Ot=mt<0?ne(Ft):Ft[0],Kt=mt<0==(Ot.level==1),Wt=Kt?"after":"before",le;if(Ot.level>0||at.doc.direction=="rtl"){var Ze=Nl(at,ct);le=mt<0?ct.text.length-1:0;var fe=zs(at,Ze,le).top;le=Ke(function(yn){return zs(at,Ze,yn).top==fe},mt<0==(Ot.level==1)?Ot.from:Ot.to-1,le),Wt=="before"&&(le=kg(ct,le,1))}else le=mt<0?Ot.to:Ot.from;return new Re(dt,le,Wt)}}return new Re(dt,mt<0?ct.text.length:0,mt<0?"before":"after")}function mf(it,at,ct,dt){var mt=Qe(at,it.doc.direction);if(!mt)return ts(at,ct,dt);ct.ch>=at.text.length?(ct.ch=at.text.length,ct.sticky="before"):ct.ch<=0&&(ct.ch=0,ct.sticky="after");var Ft=Fe(mt,ct.ch,ct.sticky),Ot=mt[Ft];if(it.doc.direction=="ltr"&&Ot.level%2==0&&(dt>0?Ot.to>ct.ch:Ot.from<ct.ch))return ts(at,ct,dt);var Kt=function(sr,Hr){return kg(at,sr instanceof Re?sr.ch:sr,Hr)},Wt,le=function(sr){return it.options.lineWrapping?(Wt=Wt||Nl(it,at),Ie(it,at,Wt,sr)):{begin:0,end:at.text.length}},Ze=le(ct.sticky=="before"?Kt(ct,-1):ct.ch);if(it.doc.direction=="rtl"||Ot.level==1){var fe=Ot.level==1==dt<0,yn=Kt(ct,fe?1:-1);if(yn!=null&&(fe?yn<=Ot.to&&yn<=Ze.end:yn>=Ot.from&&yn>=Ze.begin)){var ln=fe?"before":"after";return new Re(ct.line,yn,ln)}}var wi=function(sr,Hr,Pr){for(var Ur=function(ka,ds){return ds?new Re(ct.line,Kt(ka,1),"before"):new Re(ct.line,ka,"after")};sr>=0&&sr<mt.length;sr+=Hr){var Lo=mt[sr],xr=Hr>0==(Lo.level!=1),Ho=xr?Pr.begin:Kt(Pr.end,-1);if(Lo.from<=Ho&&Ho<Lo.to||(Ho=xr?Lo.from:Kt(Lo.to,-1),Pr.begin<=Ho&&Ho<Pr.end))return Ur(Ho,xr)}},Mi=wi(Ft+dt,dt,Ze);if(Mi)return Mi;var Ri=dt>0?Ze.end:Kt(Ze.begin,-1);return Ri!=null&&!(dt>0&&Ri==at.text.length)&&(Mi=wi(dt>0?0:mt.length-1,dt,le(Ri)),Mi)?Mi:null}var Mh={selectAll:qa,singleSelection:function(it){return it.setSelection(it.getCursor("anchor"),it.getCursor("head"),De)},killLine:function(it){return xl(it,function(at){if(at.empty()){var ct=Dn(it.doc,at.head.line).text.length;return at.head.ch==ct&&at.head.line<it.lastLine()?{from:at.head,to:Re(at.head.line+1,0)}:{from:at.head,to:Re(at.head.line,ct)}}else return{from:at.from(),to:at.to()}})},deleteLine:function(it){return xl(it,function(at){return{from:Re(at.from().line,0),to:ni(it.doc,Re(at.to().line+1,0))}})},delLineLeft:function(it){return xl(it,function(at){return{from:Re(at.from().line,0),to:at.from()}})},delWrappedLineLeft:function(it){return xl(it,function(at){var ct=it.charCoords(at.head,"div").top+5,dt=it.coordsChar({left:0,top:ct},"div");return{from:dt,to:at.from()}})},delWrappedLineRight:function(it){return xl(it,function(at){var ct=it.charCoords(at.head,"div").top+5,dt=it.coordsChar({left:it.display.lineDiv.offsetWidth+100,top:ct},"div");return{from:at.from(),to:dt}})},undo:function(it){return it.undo()},redo:function(it){return it.redo()},undoSelection:function(it){return it.undoSelection()},redoSelection:function(it){return it.redoSelection()},goDocStart:function(it){return it.extendSelection(Re(it.firstLine(),0))},goDocEnd:function(it){return it.extendSelection(Re(it.lastLine()))},goLineStart:function(it){return it.extendSelectionsBy(function(at){return Zd(it,at.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(it){return it.extendSelectionsBy(function(at){return bg(it,at.head)},{origin:"+move",bias:1})},goLineEnd:function(it){return it.extendSelectionsBy(function(at){return Gd(it,at.head.line)},{origin:"+move",bias:-1})},goLineRight:function(it){return it.extendSelectionsBy(function(at){var ct=it.cursorCoords(at.head,"div").top+5;return it.coordsChar({left:it.display.lineDiv.offsetWidth+100,top:ct},"div")},un)},goLineLeft:function(it){return it.extendSelectionsBy(function(at){var ct=it.cursorCoords(at.head,"div").top+5;return it.coordsChar({left:0,top:ct},"div")},un)},goLineLeftSmart:function(it){return it.extendSelectionsBy(function(at){var ct=it.cursorCoords(at.head,"div").top+5,dt=it.coordsChar({left:0,top:ct},"div");return dt.ch<it.getLine(dt.line).search(/\S/)?bg(it,at.head):dt},un)},goLineUp:function(it){return it.moveV(-1,"line")},goLineDown:function(it){return it.moveV(1,"line")},goPageUp:function(it){return it.moveV(-1,"page")},goPageDown:function(it){return it.moveV(1,"page")},goCharLeft:function(it){return it.moveH(-1,"char")},goCharRight:function(it){return it.moveH(1,"char")},goColumnLeft:function(it){return it.moveH(-1,"column")},goColumnRight:function(it){return it.moveH(1,"column")},goWordLeft:function(it){return it.moveH(-1,"word")},goGroupRight:function(it){return it.moveH(1,"group")},goGroupLeft:function(it){return it.moveH(-1,"group")},goWordRight:function(it){return it.moveH(1,"word")},delCharBefore:function(it){return it.deleteH(-1,"codepoint")},delCharAfter:function(it){return it.deleteH(1,"char")},delWordBefore:function(it){return it.deleteH(-1,"word")},delWordAfter:function(it){return it.deleteH(1,"word")},delGroupBefore:function(it){return it.deleteH(-1,"group")},delGroupAfter:function(it){return it.deleteH(1,"group")},indentAuto:function(it){return it.indentSelection("smart")},indentMore:function(it){return it.indentSelection("add")},indentLess:function(it){return it.indentSelection("subtract")},insertTab:function(it){return it.replaceSelection(" ")},insertSoftTab:function(it){for(var at=[],ct=it.listSelections(),dt=it.options.tabSize,mt=0;mt<ct.length;mt++){var Ft=ct[mt].from(),Ot=te(it.getLine(Ft.line),Ft.ch,dt);at.push(vn(dt-Ot%dt))}it.replaceSelections(at)},defaultTab:function(it){it.somethingSelected()?it.indentSelection("add"):it.execCommand("insertTab")},transposeChars:function(it){return mr(it,function(){for(var at=it.listSelections(),ct=[],dt=0;dt<at.length;dt++)if(at[dt].empty()){var mt=at[dt].head,Ft=Dn(it.doc,mt.line).text;if(Ft){if(mt.ch==Ft.length&&(mt=new Re(mt.line,mt.ch-1)),mt.ch>0)mt=new Re(mt.line,mt.ch+1),it.replaceRange(Ft.charAt(mt.ch-1)+Ft.charAt(mt.ch-2),Re(mt.line,mt.ch-2),mt,"+transpose");else if(mt.line>it.doc.first){var Ot=Dn(it.doc,mt.line-1).text;Ot&&(mt=new Re(mt.line,1),it.replaceRange(Ft.charAt(0)+it.doc.lineSeparator()+Ot.charAt(Ot.length-1),Re(mt.line-1,Ot.length-1),mt,"+transpose"))}}ct.push(new sa(mt,mt))}it.setSelections(ct)})},newlineAndIndent:function(it){return mr(it,function(){for(var at=it.listSelections(),ct=at.length-1;ct>=0;ct--)it.replaceRange(it.doc.lineSeparator(),at[ct].anchor,at[ct].head,"+input");at=it.listSelections();for(var dt=0;dt<at.length;dt++)it.indentLine(at[dt].from().line,null,!0);Ys(it)})},openLine:function(it){return it.replaceSelection(`
`,"start")},toggleOverwrite:function(it){return it.toggleOverwrite()}};function Zd(it,at){var ct=Dn(it.doc,at),dt=An(ct);return dt!=ct&&(at=Gt(dt)),kc(!0,it,dt,at,1)}function Gd(it,at){var ct=Dn(it.doc,at),dt=Un(ct);return dt!=ct&&(at=Gt(dt)),kc(!0,it,ct,at,-1)}function bg(it,at){var ct=Zd(it,at.line),dt=Dn(it.doc,ct.line),mt=Qe(dt,it.doc.direction);if(!mt||mt[0].level==0){var Ft=Math.max(ct.ch,dt.text.search(/\S/)),Ot=at.line==ct.line&&at.ch<=Ft&&at.ch;return Re(ct.line,Ot?0:Ft,ct.sticky)}return ct}function Hd(it,at,ct){if(typeof at=="string"&&(at=Mh[at],!at))return!1;it.display.input.ensurePolled();var dt=it.display.shift,mt=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),ct&&(it.display.shift=!1),mt=at(it)!=bn}finally{it.display.shift=dt,it.state.suppressEdits=!1}return mt}function Ng(it,at,ct){for(var dt=0;dt<it.state.keyMaps.length;dt++){var mt=$l(at,it.state.keyMaps[dt],ct,it);if(mt)return mt}return it.options.extraKeys&&$l(at,it.options.extraKeys,ct,it)||$l(at,it.options.keyMap,ct,it)}var Gu=new Jt;function ad(it,at,ct,dt){var mt=it.state.keySeq;if(mt){if(zd(at))return"handled";if(/\'$/.test(at)?it.state.keySeq=null:Gu.set(50,function(){it.state.keySeq==mt&&(it.state.keySeq=null,it.display.input.reset())}),vf(it,mt+" "+at,ct,dt))return!0}return vf(it,at,ct,dt)}function vf(it,at,ct,dt){var mt=Ng(it,at,dt);return mt=="multi"&&(it.state.keySeq=at),mt=="handled"&&or(it,"keyHandled",it,at,ct),(mt=="handled"||mt=="multi")&&(In(ct),uo(it)),!!mt}function yf(it,at){var ct=em(at,!0);return ct?at.shiftKey&&!it.state.keySeq?ad(it,"Shift-"+ct,at,function(dt){return Hd(it,dt,!0)})||ad(it,ct,at,function(dt){if(typeof dt=="string"?/^go[A-Z]/.test(dt):dt.motion)return Hd(it,dt)}):ad(it,ct,at,function(dt){return Hd(it,dt)}):!1}function Sf(it,at,ct){return ad(it,"'"+ct+"'",at,function(dt){return Hd(it,dt,!0)})}var sd=null;function Bg(it){var at=this;if(!(it.target&&it.target!=at.display.input.getField())&&(at.curOp.focus=ye(),!an(at,it))){he&&Dt<11&&it.keyCode==27&&(it.returnValue=!1);var ct=it.keyCode;at.display.shift=ct==16||it.shiftKey;var dt=yf(at,it);jt&&(sd=dt?ct:null,!dt&&ct==88&&!Ye&&(ht?it.metaKey:it.ctrlKey)&&at.replaceSelection("",null,"cut")),gt&&!ht&&!dt&&ct==46&&it.shiftKey&&!it.ctrlKey&&document.execCommand&&document.execCommand("cut"),ct==18&&!/\bCodeMirror-crosshair\b/.test(at.display.lineDiv.className)&&Ag(at)}}function Ag(it){var at=it.display.lineDiv;xe(at,"CodeMirror-crosshair");function ct(dt){(dt.keyCode==18||!dt.altKey)&&(It(at,"CodeMirror-crosshair"),ze(document,"keyup",ct),ze(document,"mouseover",ct))}dn(document,"keyup",ct),dn(document,"mouseover",ct)}function Tg(it){it.keyCode==16&&(this.doc.sel.shift=!1),an(this,it)}function Mu(it){var at=this;if(!(it.target&&it.target!=at.display.input.getField())&&!(Yo(at.display,it)||an(at,it)||it.ctrlKey&&!it.altKey||ht&&it.metaKey)){var ct=it.keyCode,dt=it.charCode;if(jt&&ct==sd){sd=null,In(it);return}if(!(jt&&(!it.which||it.which<10)&&yf(at,it))){var mt=String.fromCharCode(dt==null?ct:dt);mt!="\b"&&(Sf(at,it,mt)||at.display.input.onKeyPress(it))}}}var nm=400,Dg=function(it,at,ct){this.time=it,this.pos=at,this.button=ct};Dg.prototype.compare=function(it,at,ct){return this.time+nm>it&&$e(at,this.pos)==0&&ct==this.button};var Wd,ld;function Og(it,at){var ct=+new Date;return ld&&ld.compare(ct,it,at)?(Wd=ld=null,"triple"):Wd&&Wd.compare(ct,it,at)?(ld=new Dg(ct,it,at),Wd=null,"double"):(Wd=new Dg(ct,it,at),ld=null,"single")}function ku(it){var at=this,ct=at.display;if(!(an(at,it)||ct.activeTouch&&ct.input.supportsTouch())){if(ct.input.ensurePolled(),ct.shift=it.shiftKey,Yo(ct,it)){ee||(ct.scroller.draggable=!1,setTimeout(function(){return ct.scroller.draggable=!0},100));return}if(!wf(at,it)){var dt=eo(at,it),mt=Cn(it),Ft=dt?Og(dt,mt):"single";window.focus(),mt==1&&at.state.selectingText&&at.state.selectingText(it),!(dt&&Ig(at,mt,dt,Ft,it))&&(mt==1?dt?im(at,dt,Ft,it):Hi(it)==ct.scroller&&In(it):mt==2?(dt&&cf(at.doc,dt),setTimeout(function(){return ct.input.focus()},20)):mt==3&&(Et?at.display.input.onContextMenu(it):Ro(at)))}}}function Ig(it,at,ct,dt,mt){var Ft="Click";return dt=="double"?Ft="Double"+Ft:dt=="triple"&&(Ft="Triple"+Ft),Ft=(at==1?"Left":at==2?"Middle":"Right")+Ft,ad(it,Mg(Ft,mt),mt,function(Ot){if(typeof Ot=="string"&&(Ot=Mh[Ot]),!Ot)return!1;var Kt=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),Kt=Ot(it,ct)!=bn}finally{it.state.suppressEdits=!1}return Kt})}function xf(it,at,ct){var dt=it.getOption("configureMouse"),mt=dt?dt(it,at,ct):{};if(mt.unit==null){var Ft=st?ct.shiftKey&&ct.metaKey:ct.altKey;mt.unit=Ft?"rectangle":at=="single"?"char":at=="double"?"word":"line"}return(mt.extend==null||it.doc.extend)&&(mt.extend=it.doc.extend||ct.shiftKey),mt.addNew==null&&(mt.addNew=ht?ct.metaKey:ct.ctrlKey),mt.moveOnDrag==null&&(mt.moveOnDrag=!(ht?ct.altKey:ct.ctrlKey)),mt}function im(it,at,ct,dt){he?setTimeout(Je(yo,it),0):it.curOp.focus=ye();var mt=xf(it,ct,dt),Ft=it.doc.sel,Ot;it.options.dragDrop&&Sn&&!it.isReadOnly()&&ct=="single"&&(Ot=Ft.contains(at))>-1&&($e((Ot=Ft.ranges[Ot]).from(),at)<0||at.xRel>0)&&($e(Ot.to(),at)>0||at.xRel<0)?_g(it,dt,at,mt):ev(it,dt,at,mt)}function _g(it,at,ct,dt){var mt=it.display,Ft=!1,Ot=hr(it,function(le){ee&&(mt.scroller.draggable=!1),it.state.draggingText=!1,ze(mt.wrapper.ownerDocument,"mouseup",Ot),ze(mt.wrapper.ownerDocument,"mousemove",Kt),ze(mt.scroller,"dragstart",Wt),ze(mt.scroller,"drop",Ot),Ft||(In(le),dt.addNew||cf(it.doc,ct,null,null,dt.extend),ee&&!Ae||he&&Dt==9?setTimeout(function(){mt.wrapper.ownerDocument.body.focus({preventScroll:!0}),mt.input.focus()},20):mt.input.focus())}),Kt=function(le){Ft=Ft||Math.abs(at.clientX-le.clientX)+Math.abs(at.clientY-le.clientY)>=10},Wt=function(){return Ft=!0};ee&&(mt.scroller.draggable=!0),it.state.draggingText=Ot,Ot.copy=!dt.moveOnDrag,mt.scroller.dragDrop&&mt.scroller.dragDrop(),dn(mt.wrapper.ownerDocument,"mouseup",Ot),dn(mt.wrapper.ownerDocument,"mousemove",Kt),dn(mt.scroller,"dragstart",Wt),dn(mt.scroller,"drop",Ot),Ro(it),setTimeout(function(){return mt.input.focus()},20)}function Rg(it,at,ct){if(ct=="char")return new sa(at,at);if(ct=="word")return it.findWordAt(at);if(ct=="line")return new sa(Re(at.line,0),ni(it.doc,Re(at.line+1,0)));var dt=ct(it,at);return new sa(dt.from,dt.to)}function ev(it,at,ct,dt){var mt=it.display,Ft=it.doc;In(at);var Ot,Kt,Wt=Ft.sel,le=Wt.ranges;if(dt.addNew&&!dt.extend?(Kt=Ft.sel.contains(ct),Kt>-1?Ot=le[Kt]:Ot=new sa(ct,ct)):(Ot=Ft.sel.primary(),Kt=Ft.sel.primIndex),dt.unit=="rectangle")dt.addNew||(Ot=new sa(ct,ct)),ct=eo(it,at,!0,!0),Kt=-1;else{var Ze=Rg(it,ct,dt.unit);dt.extend?Ot=df(Ot,Ze.anchor,Ze.head,dt.extend):Ot=Ze}dt.addNew?Kt==-1?(Kt=le.length,Zs(Ft,cu(it,le.concat([Ot]),Kt),{scroll:!1,origin:"*mouse"})):le.length>1&&le[Kt].empty()&&dt.unit=="char"&&!dt.extend?(Zs(Ft,cu(it,le.slice(0,Kt).concat(le.slice(Kt+1)),0),{scroll:!1,origin:"*mouse"}),Wt=Ft.sel):Lh(Ft,Kt,Ot,on):(Kt=0,Zs(Ft,new Jl([Ot],0),on),Wt=Ft.sel);var fe=ct;function yn(Pr){if($e(fe,Pr)!=0)if(fe=Pr,dt.unit=="rectangle"){for(var Ur=[],Lo=it.options.tabSize,xr=te(Dn(Ft,ct.line).text,ct.ch,Lo),Ho=te(Dn(Ft,Pr.line).text,Pr.ch,Lo),ka=Math.min(xr,Ho),ds=Math.max(xr,Ho),ja=Math.min(ct.line,Pr.line),ll=Math.min(it.lastLine(),Math.max(ct.line,Pr.line));ja<=ll;ja++){var Gs=Dn(Ft,ja).text,os=Kn(Gs,ka,Lo);ka==ds?Ur.push(new sa(Re(ja,os),Re(ja,os))):Gs.length>os&&Ur.push(new sa(Re(ja,os),Re(ja,Kn(Gs,ds,Lo))))}Ur.length||Ur.push(new sa(ct,ct)),Zs(Ft,cu(it,Wt.ranges.slice(0,Kt).concat(Ur),Kt),{origin:"*mouse",scroll:!1}),it.scrollIntoView(Pr)}else{var Pl=Ot,As=Rg(it,Pr,dt.unit),as=Pl.anchor,ta;$e(As.anchor,as)>0?(ta=As.head,as=Jn(Pl.from(),As.anchor)):(ta=As.anchor,as=di(Pl.to(),As.head));var Wa=Wt.ranges.slice(0);Wa[Kt]=rm(it,new sa(ni(Ft,as),ta)),Zs(Ft,cu(it,Wa,Kt),on)}}var ln=mt.wrapper.getBoundingClientRect(),wi=0;function Mi(Pr){var Ur=++wi,Lo=eo(it,Pr,!0,dt.unit=="rectangle");if(Lo)if($e(Lo,fe)!=0){it.curOp.focus=ye(),yn(Lo);var xr=Ar(mt,Ft);(Lo.line>=xr.to||Lo.line<xr.from)&&setTimeout(hr(it,function(){wi==Ur&&Mi(Pr)}),150)}else{var Ho=Pr.clientY<ln.top?-20:Pr.clientY>ln.bottom?20:0;Ho&&setTimeout(hr(it,function(){wi==Ur&&(mt.scroller.scrollTop+=Ho,Mi(Pr))}),50)}}function Ri(Pr){it.state.selectingText=!1,wi=1/0,Pr&&(In(Pr),mt.input.focus()),ze(mt.wrapper.ownerDocument,"mousemove",sr),ze(mt.wrapper.ownerDocument,"mouseup",Hr),Ft.history.lastSelOrigin=null}var sr=hr(it,function(Pr){Pr.buttons===0||!Cn(Pr)?Ri(Pr):Mi(Pr)}),Hr=hr(it,Ri);it.state.selectingText=Hr,dn(mt.wrapper.ownerDocument,"mousemove",sr),dn(mt.wrapper.ownerDocument,"mouseup",Hr)}function rm(it,at){var ct=at.anchor,dt=at.head,mt=Dn(it.doc,ct.line);if($e(ct,dt)==0&&ct.sticky==dt.sticky)return at;var Ft=Qe(mt);if(!Ft)return at;var Ot=Fe(Ft,ct.ch,ct.sticky),Kt=Ft[Ot];if(Kt.from!=ct.ch&&Kt.to!=ct.ch)return at;var Wt=Ot+(Kt.from==ct.ch==(Kt.level!=1)?0:1);if(Wt==0||Wt==Ft.length)return at;var le;if(dt.line!=ct.line)le=(dt.line-ct.line)*(it.doc.direction=="ltr"?1:-1)>0;else{var Ze=Fe(Ft,dt.ch,dt.sticky),fe=Ze-Ot||(dt.ch-ct.ch)*(Kt.level==1?-1:1);Ze==Wt-1||Ze==Wt?le=fe<0:le=fe>0}var yn=Ft[Wt+(le?-1:0)],ln=le==(yn.level==1),wi=ln?yn.from:yn.to,Mi=ln?"after":"before";return ct.ch==wi&&ct.sticky==Mi?at:new sa(new Re(ct.line,wi,Mi),dt)}function Pf(it,at,ct,dt){var mt,Ft;if(at.touches)mt=at.touches[0].clientX,Ft=at.touches[0].clientY;else try{mt=at.clientX,Ft=at.clientY}catch(yn){return!1}if(mt>=Math.floor(it.display.gutters.getBoundingClientRect().right))return!1;dt&&In(at);var Ot=it.display,Kt=Ot.lineDiv.getBoundingClientRect();if(Ft>Kt.bottom||!pn(it,ct))return ei(at);Ft-=Kt.top-Ot.viewOffset;for(var Wt=0;Wt<it.display.gutterSpecs.length;++Wt){var le=Ot.gutters.childNodes[Wt];if(le&&le.getBoundingClientRect().right>=mt){var Ze=me(it.doc,Ft),fe=it.display.gutterSpecs[Wt];return We(it,ct,it,Ze,fe.className,at),ei(at)}}}function wf(it,at){return Pf(it,at,"gutterClick",!0)}function Cf(it,at){Yo(it.display,at)||om(it,at)||an(it,at,"contextmenu")||Et||it.display.input.onContextMenu(at)}function om(it,at){return pn(it,"gutterContextMenu")?Pf(it,at,"gutterContextMenu",!1):!1}function Ef(it){it.display.wrapper.className=it.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+it.options.theme.replace(/(^|\s)\s*/g," cm-s-"),uu(it)}var kh={toString:function(){return"CodeMirror.Init"}},jg={},bc={};function am(it){var at=it.optionHandlers;function ct(dt,mt,Ft,Ot){it.defaults[dt]=mt,Ft&&(at[dt]=Ot?function(Kt,Wt,le){le!=kh&&Ft(Kt,Wt,le)}:Ft)}it.defineOption=ct,it.Init=kh,ct("value","",function(dt,mt){return dt.setValue(mt)},!0),ct("mode",null,function(dt,mt){dt.doc.modeOption=mt,Go(dt)},!0),ct("indentUnit",2,Go,!0),ct("indentWithTabs",!1),ct("smartIndent",!0),ct("tabSize",4,function(dt){pc(dt),uu(dt),ar(dt)},!0),ct("lineSeparator",null,function(dt,mt){if(dt.doc.lineSep=mt,!!mt){var Ft=[],Ot=dt.doc.first;dt.doc.iter(function(Wt){for(var le=0;;){var Ze=Wt.text.indexOf(mt,le);if(Ze==-1)break;le=Ze+mt.length,Ft.push(Re(Ot,Ze))}Ot++});for(var Kt=Ft.length-1;Kt>=0;Kt--)nd(dt.doc,mt,Ft[Kt],Re(Ft[Kt].line,Ft[Kt].ch+mt.length))}}),ct("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(dt,mt,Ft){dt.state.specialChars=new RegExp(mt.source+(mt.test(" ")?"":"| "),"g"),Ft!=kh&&dt.refresh()}),ct("specialCharPlaceholder",ao,function(dt){return dt.refresh()},!0),ct("electricChars",!0),ct("inputStyle",et?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),ct("spellcheck",!1,function(dt,mt){return dt.getInputField().spellcheck=mt},!0),ct("autocorrect",!1,function(dt,mt){return dt.getInputField().autocorrect=mt},!0),ct("autocapitalize",!1,function(dt,mt){return dt.getInputField().autocapitalize=mt},!0),ct("rtlMoveVisually",!pt),ct("wholeLineUpdateBefore",!0),ct("theme","default",function(dt){Ef(dt),Dl(dt)},!0),ct("keyMap","default",function(dt,mt,Ft){var Ot=od(mt),Kt=Ft!=kh&&od(Ft);Kt&&Kt.detach&&Kt.detach(dt,Ot),Ot.attach&&Ot.attach(dt,Kt||null)}),ct("extraKeys",null),ct("configureMouse",null),ct("lineWrapping",!1,sm,!0),ct("gutters",[],function(dt,mt){dt.display.gutterSpecs=Ea(mt,dt.options.lineNumbers),Dl(dt)},!0),ct("fixedGutter",!0,function(dt,mt){dt.display.gutters.style.left=mt?Xr(dt.display)+"px":"0",dt.refresh()},!0),ct("coverGutterNextToScrollbar",!1,function(dt){return is(dt)},!0),ct("scrollbarStyle","native",function(dt){Yl(dt),is(dt),dt.display.scrollbars.setScrollTop(dt.doc.scrollTop),dt.display.scrollbars.setScrollLeft(dt.doc.scrollLeft)},!0),ct("lineNumbers",!1,function(dt,mt){dt.display.gutterSpecs=Ea(dt.options.gutters,mt),Dl(dt)},!0),ct("firstLineNumber",1,Dl,!0),ct("lineNumberFormatter",function(dt){return dt},Dl,!0),ct("showCursorWhenSelecting",!1,Zi,!0),ct("resetSelectionOnContextMenu",!0),ct("lineWiseCopyCut",!0),ct("pasteLinesPerSelection",!0),ct("selectionsMayTouch",!1),ct("readOnly",!1,function(dt,mt){mt=="nocursor"&&(Ia(dt),dt.display.input.blur()),dt.display.input.readOnlyChanged(mt)}),ct("screenReaderLabel",null,function(dt,mt){mt=mt===""?null:mt,dt.display.input.screenReaderLabelChanged(mt)}),ct("disableInput",!1,function(dt,mt){mt||dt.display.input.reset()},!0),ct("dragDrop",!0,Lf),ct("allowDropFileTypes",null),ct("cursorBlinkRate",530),ct("cursorScrollMargin",0),ct("cursorHeight",1,Zi,!0),ct("singleCursorHeightPerLine",!0,Zi,!0),ct("workTime",100),ct("workDelay",100),ct("flattenSpans",!0,pc,!0),ct("addModeClass",!1,pc,!0),ct("pollInterval",100),ct("undoDepth",200,function(dt,mt){return dt.doc.history.undoDepth=mt}),ct("historyEventDelay",1250),ct("viewportMargin",10,function(dt){return dt.refresh()},!0),ct("maxHighlightLength",1e4,pc,!0),ct("moveInputWithCursor",!0,function(dt,mt){mt||dt.display.input.resetPosition()}),ct("tabindex",null,function(dt,mt){return dt.display.input.getField().tabIndex=mt||""}),ct("autofocus",null),ct("direction","ltr",function(dt,mt){return dt.doc.setDirection(mt)},!0),ct("phrases",null)}function Lf(it,at,ct){var dt=ct&&ct!=kh;if(!at!=!dt){var mt=it.display.dragFunctions,Ft=at?dn:ze;Ft(it.display.scroller,"dragstart",mt.start),Ft(it.display.scroller,"dragenter",mt.enter),Ft(it.display.scroller,"dragover",mt.over),Ft(it.display.scroller,"dragleave",mt.leave),Ft(it.display.scroller,"drop",mt.drop)}}function sm(it){it.options.lineWrapping?(xe(it.display.wrapper,"CodeMirror-wrap"),it.display.sizer.style.minWidth="",it.display.sizerWidth=null):(It(it.display.wrapper,"CodeMirror-wrap"),cr(it)),Ui(it),ar(it),uu(it),setTimeout(function(){return is(it)},100)}function Qo(it,at){var ct=this;if(!(this instanceof Qo))return new Qo(it,at);this.options=at=at?fn(at):{},fn(jg,at,!1);var dt=at.value;typeof dt=="string"?dt=new Bs(dt,at.mode,null,at.lineSeparator,at.direction):at.mode&&(dt.modeOption=at.mode),this.doc=dt;var mt=new Qo.inputStyles[at.inputStyle](this),Ft=this.display=new wh(it,dt,mt,at);Ft.wrapper.CodeMirror=this,Ef(this),at.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Yl(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},at.autofocus&&!et&&Ft.input.focus(),he&&Dt<11&&setTimeout(function(){return ct.display.input.reset(!0)},20),Vd(this),Il(),al(this),this.curOp.forceUpdate=!0,lf(this,dt),at.autofocus&&!et||this.hasFocus()?setTimeout(function(){ct.hasFocus()&&!ct.state.focused&&qi(ct)},20):Ia(this);for(var Ot in bc)bc.hasOwnProperty(Ot)&&bc[Ot](this,at[Ot],kh);Ma(this),at.finishInit&&at.finishInit(this);for(var Kt=0;Kt<ud.length;++Kt)ud[Kt](this);ml(this),ee&&at.lineWrapping&&getComputedStyle(Ft.lineDiv).textRendering=="optimizelegibility"&&(Ft.lineDiv.style.textRendering="auto")}Qo.defaults=jg,Qo.optionHandlers=bc;function Vd(it){var at=it.display;dn(at.scroller,"mousedown",hr(it,ku)),he&&Dt<11?dn(at.scroller,"dblclick",hr(it,function(Wt){if(!an(it,Wt)){var le=eo(it,Wt);if(!(!le||wf(it,Wt)||Yo(it.display,Wt))){In(Wt);var Ze=it.findWordAt(le);cf(it.doc,Ze.anchor,Ze.head)}}})):dn(at.scroller,"dblclick",function(Wt){return an(it,Wt)||In(Wt)}),dn(at.scroller,"contextmenu",function(Wt){return Cf(it,Wt)}),dn(at.input.getField(),"contextmenu",function(Wt){at.scroller.contains(Wt.target)||Cf(it,Wt)});var ct,dt={end:0};function mt(){at.activeTouch&&(ct=setTimeout(function(){return at.activeTouch=null},1e3),dt=at.activeTouch,dt.end=+new Date)}function Ft(Wt){if(Wt.touches.length!=1)return!1;var le=Wt.touches[0];return le.radiusX<=1&&le.radiusY<=1}function Ot(Wt,le){if(le.left==null)return!0;var Ze=le.left-Wt.left,fe=le.top-Wt.top;return Ze*Ze+fe*fe>20*20}dn(at.scroller,"touchstart",function(Wt){if(!an(it,Wt)&&!Ft(Wt)&&!wf(it,Wt)){at.input.ensurePolled(),clearTimeout(ct);var le=+new Date;at.activeTouch={start:le,moved:!1,prev:le-dt.end<=300?dt:null},Wt.touches.length==1&&(at.activeTouch.left=Wt.touches[0].pageX,at.activeTouch.top=Wt.touches[0].pageY)}}),dn(at.scroller,"touchmove",function(){at.activeTouch&&(at.activeTouch.moved=!0)}),dn(at.scroller,"touchend",function(Wt){var le=at.activeTouch;if(le&&!Yo(at,Wt)&&le.left!=null&&!le.moved&&new Date-le.start<300){var Ze=it.coordsChar(at.activeTouch,"page"),fe;!le.prev||Ot(le,le.prev)?fe=new sa(Ze,Ze):!le.prev.prev||Ot(le,le.prev.prev)?fe=it.findWordAt(Ze):fe=new sa(Re(Ze.line,0),ni(it.doc,Re(Ze.line+1,0))),it.setSelection(fe.anchor,fe.head),it.focus(),In(Wt)}mt()}),dn(at.scroller,"touchcancel",mt),dn(at.scroller,"scroll",function(){at.scroller.clientHeight&&(ol(it,at.scroller.scrollTop),Ul(it,at.scroller.scrollLeft,!0),We(it,"scroll",it))}),dn(at.scroller,"mousewheel",function(Wt){return vs(it,Wt)}),dn(at.scroller,"DOMMouseScroll",function(Wt){return vs(it,Wt)}),dn(at.wrapper,"scroll",function(){return at.wrapper.scrollTop=at.wrapper.scrollLeft=0}),at.dragFunctions={enter:function(Wt){an(it,Wt)||mi(Wt)},over:function(Wt){an(it,Wt)||($p(it,Wt),mi(Wt))},start:function(Wt){return Qp(it,Wt)},drop:hr(it,wg),leave:function(Wt){an(it,Wt)||qp(it)}};var Kt=at.input.getField();dn(Kt,"keyup",function(Wt){return Tg.call(it,Wt)}),dn(Kt,"keydown",hr(it,Bg)),dn(Kt,"keypress",hr(it,Mu)),dn(Kt,"focus",function(Wt){return qi(it,Wt)}),dn(Kt,"blur",function(Wt){return Ia(it,Wt)})}var ud=[];Qo.defineInitHook=function(it){return ud.push(it)};function hs(it,at,ct,dt){var mt=it.doc,Ft;ct==null&&(ct="add"),ct=="smart"&&(mt.mode.indent?Ft=ro(it,at).state:ct="prev");var Ot=it.options.tabSize,Kt=Dn(mt,at),Wt=te(Kt.text,null,Ot);Kt.stateAfter&&(Kt.stateAfter=null);var le=Kt.text.match(/^\s*/)[0],Ze;if(!dt&&!/\S/.test(Kt.text))Ze=0,ct="not";else if(ct=="smart"&&(Ze=mt.mode.indent(Ft,Kt.text.slice(le.length),Kt.text),Ze==bn||Ze>150)){if(!dt)return;ct="prev"}ct=="prev"?at>mt.first?Ze=te(Dn(mt,at-1).text,null,Ot):Ze=0:ct=="add"?Ze=Wt+it.options.indentUnit:ct=="subtract"?Ze=Wt-it.options.indentUnit:typeof ct=="number"&&(Ze=Wt+ct),Ze=Math.max(0,Ze);var fe="",yn=0;if(it.options.indentWithTabs)for(var ln=Math.floor(Ze/Ot);ln;--ln)yn+=Ot,fe+=" ";if(yn<Ze&&(fe+=vn(Ze-yn)),fe!=le)return nd(mt,fe,Re(at,0),Re(at,le.length),"+input"),Kt.stateAfter=null,!0;for(var wi=0;wi<mt.sel.ranges.length;wi++){var Mi=mt.sel.ranges[wi];if(Mi.head.line==at&&Mi.head.ch<le.length){var Ri=Re(at,le.length);Lh(mt,wi,new sa(Ri,Ri));break}}}var sl=null;function hd(it){sl=it}function Nc(it,at,ct,dt,mt){var Ft=it.doc;it.display.shift=!1,dt||(dt=Ft.sel);var Ot=+new Date-200,Kt=mt=="paste"||it.state.pasteIncoming>Ot,Wt=Gi(at),le=null;if(Kt&&dt.ranges.length>1)if(sl&&sl.text.join(`
`)==at){if(dt.ranges.length%sl.text.length==0){le=[];for(var Ze=0;Ze<sl.text.length;Ze++)le.push(Ft.splitLines(sl.text[Ze]))}}else Wt.length==dt.ranges.length&&it.options.pasteLinesPerSelection&&(le=wn(Wt,function(sr){return[sr]}));for(var fe=it.curOp.updateInput,yn=dt.ranges.length-1;yn>=0;yn--){var ln=dt.ranges[yn],wi=ln.from(),Mi=ln.to();ln.empty()&&(ct&&ct>0?wi=Re(wi.line,wi.ch-ct):it.state.overwrite&&!Kt?Mi=Re(Mi.line,Math.min(Dn(Ft,Mi.line).text.length,Mi.ch+ne(Wt).length)):Kt&&sl&&sl.lineWise&&sl.text.join(`
`)==Wt.join(`
`)&&(wi=Mi=Re(wi.line,0)));var Ri={from:wi,to:Mi,text:le?le[yn%le.length]:Wt,origin:mt||(Kt?"paste":it.state.cutIncoming>Ot?"cut":"+input")};Fh(it.doc,Ri),or(it,"inputRead",it,Ri)}at&&!Kt&&Zg(it,at),Ys(it),it.curOp.updateInput<2&&(it.curOp.updateInput=fe),it.curOp.typing=!0,it.state.pasteIncoming=it.state.cutIncoming=-1}function zg(it,at){var ct=it.clipboardData&&it.clipboardData.getData("Text");if(ct)return it.preventDefault(),!at.isReadOnly()&&!at.options.disableInput&&mr(at,function(){return Nc(at,ct,0,null,"paste")}),!0}function Zg(it,at){if(!(!it.options.electricChars||!it.options.smartIndent))for(var ct=it.doc.sel,dt=ct.ranges.length-1;dt>=0;dt--){var mt=ct.ranges[dt];if(!(mt.head.ch>100||dt&&ct.ranges[dt-1].head.line==mt.head.line)){var Ft=it.getModeAt(mt.head),Ot=!1;if(Ft.electricChars){for(var Kt=0;Kt<Ft.electricChars.length;Kt++)if(at.indexOf(Ft.electricChars.charAt(Kt))>-1){Ot=hs(it,mt.head.line,"smart");break}}else Ft.electricInput&&Ft.electricInput.test(Dn(it.doc,mt.head.line).text.slice(0,mt.head.ch))&&(Ot=hs(it,mt.head.line,"smart"));Ot&&or(it,"electricInput",it,mt.head.line)}}}function Gg(it){for(var at=[],ct=[],dt=0;dt<it.doc.sel.ranges.length;dt++){var mt=it.doc.sel.ranges[dt].head.line,Ft={anchor:Re(mt,0),head:Re(mt+1,0)};ct.push(Ft),at.push(it.getRange(Ft.anchor,Ft.head))}return{text:at,ranges:ct}}function Hg(it,at,ct,dt){it.setAttribute("autocorrect",ct?"":"off"),it.setAttribute("autocapitalize",dt?"":"off"),it.setAttribute("spellcheck",!!at)}function Wg(){var it=Ht("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),at=Ht("div",[it],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return ee?it.style.width="1000px":it.setAttribute("wrap","off"),Bt&&(it.style.border="1px solid black"),Hg(it),at}function bh(it){var at=it.optionHandlers,ct=it.helpers={};it.prototype={constructor:it,focus:function(){window.focus(),this.display.input.focus()},setOption:function(dt,mt){var Ft=this.options,Ot=Ft[dt];Ft[dt]==mt&&dt!="mode"||(Ft[dt]=mt,at.hasOwnProperty(dt)&&hr(this,at[dt])(this,mt,Ot),We(this,"optionChange",this,dt))},getOption:function(dt){return this.options[dt]},getDoc:function(){return this.doc},addKeyMap:function(dt,mt){this.state.keyMaps[mt?"push":"unshift"](od(dt))},removeKeyMap:function(dt){for(var mt=this.state.keyMaps,Ft=0;Ft<mt.length;++Ft)if(mt[Ft]==dt||mt[Ft].name==dt)return mt.splice(Ft,1),!0},addOverlay:Ci(function(dt,mt){var Ft=dt.token?dt:it.getMode(this.options,dt);if(Ft.startState)throw new Error("Overlays may not be stateful.");fi(this.state.overlays,{mode:Ft,modeSpec:dt,opaque:mt&&mt.opaque,priority:mt&&mt.priority||0},function(Ot){return Ot.priority}),this.state.modeGen++,ar(this)}),removeOverlay:Ci(function(dt){for(var mt=this.state.overlays,Ft=0;Ft<mt.length;++Ft){var Ot=mt[Ft].modeSpec;if(Ot==dt||typeof dt=="string"&&Ot.name==dt){mt.splice(Ft,1),this.state.modeGen++,ar(this);return}}}),indentLine:Ci(function(dt,mt,Ft){typeof mt!="string"&&typeof mt!="number"&&(mt==null?mt=this.options.smartIndent?"smart":"prev":mt=mt?"add":"subtract"),En(this.doc,dt)&&hs(this,dt,mt,Ft)}),indentSelection:Ci(function(dt){for(var mt=this.doc.sel.ranges,Ft=-1,Ot=0;Ot<mt.length;Ot++){var Kt=mt[Ot];if(Kt.empty())Kt.head.line>Ft&&(hs(this,Kt.head.line,dt,!0),Ft=Kt.head.line,Ot==this.doc.sel.primIndex&&Ys(this));else{var Wt=Kt.from(),le=Kt.to(),Ze=Math.max(Ft,Wt.line);Ft=Math.min(this.lastLine(),le.line-(le.ch?0:1))+1;for(var fe=Ze;fe<Ft;++fe)hs(this,fe,dt);var yn=this.doc.sel.ranges;Wt.ch==0&&mt.length==yn.length&&yn[Ot].from().ch>0&&Lh(this.doc,Ot,new sa(Wt,yn[Ot].to()),De)}}}),getTokenAt:function(dt,mt){return _i(this,dt,mt)},getLineTokens:function(dt,mt){return _i(this,Re(dt),mt,!0)},getTokenTypeAt:function(dt){dt=ni(this.doc,dt);var mt=Mr(this,Dn(this.doc,dt.line)),Ft=0,Ot=(mt.length-1)/2,Kt=dt.ch,Wt;if(Kt==0)Wt=mt[2];else for(;;){var le=Ft+Ot>>1;if((le?mt[le*2-1]:0)>=Kt)Ot=le;else if(mt[le*2+1]<Kt)Ft=le+1;else{Wt=mt[le*2+2];break}}var Ze=Wt?Wt.indexOf("overlay "):-1;return Ze<0?Wt:Ze==0?null:Wt.slice(0,Ze-1)},getModeAt:function(dt){var mt=this.doc.mode;return mt.innerMode?it.innerMode(mt,this.getTokenAt(dt).state).mode:mt},getHelper:function(dt,mt){return this.getHelpers(dt,mt)[0]},getHelpers:function(dt,mt){var Ft=[];if(!ct.hasOwnProperty(mt))return Ft;var Ot=ct[mt],Kt=this.getModeAt(dt);if(typeof Kt[mt]=="string")Ot[Kt[mt]]&&Ft.push(Ot[Kt[mt]]);else if(Kt[mt])for(var Wt=0;Wt<Kt[mt].length;Wt++){var le=Ot[Kt[mt][Wt]];le&&Ft.push(le)}else Kt.helperType&&Ot[Kt.helperType]?Ft.push(Ot[Kt.helperType]):Ot[Kt.name]&&Ft.push(Ot[Kt.name]);for(var Ze=0;Ze<Ot._global.length;Ze++){var fe=Ot._global[Ze];fe.pred(Kt,this)&&Xe(Ft,fe.val)==-1&&Ft.push(fe.val)}return Ft},getStateAfter:function(dt,mt){var Ft=this.doc;return dt=li(Ft,dt==null?Ft.first+Ft.size-1:dt),ro(this,dt+1,mt).state},cursorCoords:function(dt,mt){var Ft,Ot=this.doc.sel.primary();return dt==null?Ft=Ot.head:typeof dt=="object"?Ft=ni(this.doc,dt):Ft=dt?Ot.from():Ot.to(),_o(this,Ft,mt||"page")},charCoords:function(dt,mt){return ga(this,ni(this.doc,dt),mt||"page")},coordsChar:function(dt,mt){return dt=Bl(this,dt,mt||"page"),Ta(this,dt.left,dt.top)},lineAtHeight:function(dt,mt){return dt=Bl(this,{top:dt,left:0},mt||"page").top,me(this.doc,dt+this.display.viewOffset)},heightAtLine:function(dt,mt,Ft){var Ot=!1,Kt;if(typeof dt=="number"){var Wt=this.doc.first+this.doc.size-1;dt<this.doc.first?dt=this.doc.first:dt>Wt&&(dt=Wt,Ot=!0),Kt=Dn(this.doc,dt)}else Kt=dt;return Ga(this,Kt,{top:0,left:0},mt||"page",Ft||Ot).top+(Ot?this.doc.height-Xi(Kt):0)},defaultTextHeight:function(){return ur(this.display)},defaultCharWidth:function(){return wr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(dt,mt,Ft,Ot,Kt){var Wt=this.display;dt=_o(this,ni(this.doc,dt));var le=dt.bottom,Ze=dt.left;if(mt.style.position="absolute",mt.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(mt),Wt.sizer.appendChild(mt),Ot=="over")le=dt.top;else if(Ot=="above"||Ot=="near"){var fe=Math.max(Wt.wrapper.clientHeight,this.doc.height),yn=Math.max(Wt.sizer.clientWidth,Wt.lineSpace.clientWidth);(Ot=="above"||dt.bottom+mt.offsetHeight>fe)&&dt.top>mt.offsetHeight?le=dt.top-mt.offsetHeight:dt.bottom+mt.offsetHeight<=fe&&(le=dt.bottom),Ze+mt.offsetWidth>yn&&(Ze=yn-mt.offsetWidth)}mt.style.top=le+"px",mt.style.left=mt.style.right="",Kt=="right"?(Ze=Wt.sizer.clientWidth-mt.offsetWidth,mt.style.right="0px"):(Kt=="left"?Ze=0:Kt=="middle"&&(Ze=(Wt.sizer.clientWidth-mt.offsetWidth)/2),mt.style.left=Ze+"px"),Ft&&Fa(this,{left:Ze,top:le,right:Ze+mt.offsetWidth,bottom:le+mt.offsetHeight})},triggerOnKeyDown:Ci(Bg),triggerOnKeyPress:Ci(Mu),triggerOnKeyUp:Tg,triggerOnMouseDown:Ci(ku),execCommand:function(dt){if(Mh.hasOwnProperty(dt))return Mh[dt].call(null,this)},triggerElectric:Ci(function(dt){Zg(this,dt)}),findPosH:function(dt,mt,Ft,Ot){var Kt=1;mt<0&&(Kt=-1,mt=-mt);for(var Wt=ni(this.doc,dt),le=0;le<mt&&(Wt=Bc(this.doc,Wt,Kt,Ft,Ot),!Wt.hitSide);++le);return Wt},moveH:Ci(function(dt,mt){var Ft=this;this.extendSelectionsBy(function(Ot){return Ft.display.shift||Ft.doc.extend||Ot.empty()?Bc(Ft.doc,Ot.head,dt,mt,Ft.options.rtlMoveVisually):dt<0?Ot.from():Ot.to()},un)}),deleteH:Ci(function(dt,mt){var Ft=this.doc.sel,Ot=this.doc;Ft.somethingSelected()?Ot.replaceSelection("",null,"+delete"):xl(this,function(Kt){var Wt=Bc(Ot,Kt.head,dt,mt,!1);return dt<0?{from:Wt,to:Kt.head}:{from:Kt.head,to:Wt}})}),findPosV:function(dt,mt,Ft,Ot){var Kt=1,Wt=Ot;mt<0&&(Kt=-1,mt=-mt);for(var le=ni(this.doc,dt),Ze=0;Ze<mt;++Ze){var fe=_o(this,le,"div");if(Wt==null?Wt=fe.left:fe.left=Wt,le=Nh(this,fe,Kt,Ft),le.hitSide)break}return le},moveV:Ci(function(dt,mt){var Ft=this,Ot=this.doc,Kt=[],Wt=!this.display.shift&&!Ot.extend&&Ot.sel.somethingSelected();if(Ot.extendSelectionsBy(function(Ze){if(Wt)return dt<0?Ze.from():Ze.to();var fe=_o(Ft,Ze.head,"div");Ze.goalColumn!=null&&(fe.left=Ze.goalColumn),Kt.push(fe.left);var yn=Nh(Ft,fe,dt,mt);return mt=="page"&&Ze==Ot.sel.primary()&&hu(Ft,ga(Ft,yn,"div").top-fe.top),yn},un),Kt.length)for(var le=0;le<Ot.sel.ranges.length;le++)Ot.sel.ranges[le].goalColumn=Kt[le]}),findWordAt:function(dt){var mt=this.doc,Ft=Dn(mt,dt.line).text,Ot=dt.ch,Kt=dt.ch;if(Ft){var Wt=this.getHelper(dt,"wordChars");(dt.sticky=="before"||Kt==Ft.length)&&Ot?--Ot:++Kt;for(var le=Ft.charAt(Ot),Ze=Zt(le,Wt)?function(fe){return Zt(fe,Wt)}:/\s/.test(le)?function(fe){return/\s/.test(fe)}:function(fe){return!/\s/.test(fe)&&!Zt(fe)};Ot>0&&Ze(Ft.charAt(Ot-1));)--Ot;for(;Kt<Ft.length&&Ze(Ft.charAt(Kt));)++Kt}return new sa(Re(dt.line,Ot),Re(dt.line,Kt))},toggleOverwrite:function(dt){dt!=null&&dt==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?xe(this.display.cursorDiv,"CodeMirror-overwrite"):It(this.display.cursorDiv,"CodeMirror-overwrite"),We(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ye()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ci(function(dt,mt){Tl(this,dt,mt)}),getScrollInfo:function(){var dt=this.display.scroller;return{left:dt.scrollLeft,top:dt.scrollTop,height:dt.scrollHeight-Jo(this)-this.display.barHeight,width:dt.scrollWidth-Jo(this)-this.display.barWidth,clientHeight:ms(this),clientWidth:ps(this)}},scrollIntoView:Ci(function(dt,mt){dt==null?(dt={from:this.doc.sel.primary().head,to:null},mt==null&&(mt=this.options.cursorScrollMargin)):typeof dt=="number"?dt={from:Re(dt,0),to:null}:dt.from==null&&(dt={from:dt,to:null}),dt.to||(dt.to=dt.from),dt.margin=mt||0,dt.from.line!=null?Oo(this,dt):gl(this,dt.from,dt.to,dt.margin)}),setSize:Ci(function(dt,mt){var Ft=this,Ot=function(Wt){return typeof Wt=="number"||/^\d+$/.test(String(Wt))?Wt+"px":Wt};dt!=null&&(this.display.wrapper.style.width=Ot(dt)),mt!=null&&(this.display.wrapper.style.height=Ot(mt)),this.options.lineWrapping&&Kl(this);var Kt=this.display.viewFrom;this.doc.iter(Kt,this.display.viewTo,function(Wt){if(Wt.widgets){for(var le=0;le<Wt.widgets.length;le++)if(Wt.widgets[le].noHScroll){Qi(Ft,Kt,"widget");break}}++Kt}),this.curOp.forceUpdate=!0,We(this,"refresh",this)}),operation:function(dt){return mr(this,dt)},startOperation:function(){return al(this)},endOperation:function(){return ml(this)},refresh:Ci(function(){var dt=this.display.cachedTextHeight;ar(this),this.curOp.forceUpdate=!0,uu(this),Tl(this,this.doc.scrollLeft,this.doc.scrollTop),Ha(this.display),(dt==null||Math.abs(dt-ur(this.display))>.5||this.options.lineWrapping)&&Ui(this),We(this,"refresh",this)}),swapDoc:Ci(function(dt){var mt=this.doc;return mt.cm=null,this.state.selectingText&&this.state.selectingText(),lf(this,dt),uu(this),this.display.input.reset(),Tl(this,dt.scrollLeft,dt.scrollTop),this.curOp.forceScroll=!0,or(this,"swapDoc",this,mt),mt}),phrase:function(dt){var mt=this.options.phrases;return mt&&Object.prototype.hasOwnProperty.call(mt,dt)?mt[dt]:dt},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},rn(it),it.registerHelper=function(dt,mt,Ft){ct.hasOwnProperty(dt)||(ct[dt]=it[dt]={_global:[]}),ct[dt][mt]=Ft},it.registerGlobalHelper=function(dt,mt,Ft,Ot){it.registerHelper(dt,mt,Ot),ct[dt]._global.push({pred:Ft,val:Ot})}}function Bc(it,at,ct,dt,mt){var Ft=at,Ot=ct,Kt=Dn(it,at.line),Wt=mt&&it.direction=="rtl"?-ct:ct;function le(){var Hr=at.line+Wt;return Hr<it.first||Hr>=it.first+it.size?!1:(at=new Re(Hr,at.ch,at.sticky),Kt=Dn(it,Hr))}function Ze(Hr){var Pr;if(dt=="codepoint"){var Ur=Kt.text.charCodeAt(at.ch+(dt>0?0:-1));isNaN(Ur)?Pr=null:Pr=new Re(at.line,Math.max(0,Math.min(Kt.text.length,at.ch+ct*(Ur>=55296&&Ur<56320?2:1))),-ct)}else mt?Pr=mf(it.cm,Kt,at,ct):Pr=ts(Kt,at,ct);if(Pr==null)if(!Hr&&le())at=kc(mt,it.cm,Kt,at.line,Wt);else return!1;else at=Pr;return!0}if(dt=="char"||dt=="codepoint")Ze();else if(dt=="column")Ze(!0);else if(dt=="word"||dt=="group")for(var fe=null,yn=dt=="group",ln=it.cm&&it.cm.getHelper(at,"wordChars"),wi=!0;!(ct<0&&!Ze(!wi));wi=!1){var Mi=Kt.text.charAt(at.ch)||`
`,Ri=Zt(Mi,ln)?"w":yn&&Mi==`
`?"n":!yn||/\s/.test(Mi)?null:"p";if(yn&&!wi&&!Ri&&(Ri="s"),fe&&fe!=Ri){ct<0&&(ct=1,Ze(),at.sticky="after");break}if(Ri&&(fe=Ri),ct>0&&!Ze(!wi))break}var sr=wc(it,at,Ft,Ot,!0);return Nn(Ft,sr)&&(sr.hitSide=!0),sr}function Nh(it,at,ct,dt){var mt=it.doc,Ft=at.left,Ot;if(dt=="page"){var Kt=Math.min(it.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Wt=Math.max(Kt-.5*ur(it.display),3);Ot=(ct>0?at.bottom:at.top)+ct*Wt}else dt=="line"&&(Ot=ct>0?at.bottom+3:at.top-3);for(var le;le=Ta(it,Ft,Ot),!!le.outside;){if(ct<0?Ot<=0:Ot>=mt.height){le.hitSide=!0;break}Ot+=ct*5}return le}var pa=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};pa.prototype.init=function(it){var at=this,ct=this,dt=ct.cm,mt=ct.div=it.lineDiv;Hg(mt,dt.options.spellcheck,dt.options.autocorrect,dt.options.autocapitalize);function Ft(Kt){for(var Wt=Kt.target;Wt;Wt=Wt.parentNode){if(Wt==mt)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Wt.className))break}return!1}dn(mt,"paste",function(Kt){!Ft(Kt)||an(dt,Kt)||zg(Kt,dt)||Dt<=11&&setTimeout(hr(dt,function(){return at.updateFromDOM()}),20)}),dn(mt,"compositionstart",function(Kt){at.composing={data:Kt.data,done:!1}}),dn(mt,"compositionupdate",function(Kt){at.composing||(at.composing={data:Kt.data,done:!1})}),dn(mt,"compositionend",function(Kt){at.composing&&(Kt.data!=at.composing.data&&at.readFromDOMSoon(),at.composing.done=!0)}),dn(mt,"touchstart",function(){return ct.forceCompositionEnd()}),dn(mt,"input",function(){at.composing||at.readFromDOMSoon()});function Ot(Kt){if(!(!Ft(Kt)||an(dt,Kt))){if(dt.somethingSelected())hd({lineWise:!1,text:dt.getSelections()}),Kt.type=="cut"&&dt.replaceSelection("",null,"cut");else if(dt.options.lineWiseCopyCut){var Wt=Gg(dt);hd({lineWise:!0,text:Wt.text}),Kt.type=="cut"&&dt.operation(function(){dt.setSelections(Wt.ranges,0,De),dt.replaceSelection("",null,"cut")})}else return;if(Kt.clipboardData){Kt.clipboardData.clearData();var le=sl.text.join(`
`);if(Kt.clipboardData.setData("Text",le),Kt.clipboardData.getData("Text")==le){Kt.preventDefault();return}}var Ze=Wg(),fe=Ze.firstChild;dt.display.lineSpace.insertBefore(Ze,dt.display.lineSpace.firstChild),fe.value=sl.text.join(`
`);var yn=document.activeElement;je(fe),setTimeout(function(){dt.display.lineSpace.removeChild(Ze),yn.focus(),yn==mt&&ct.showPrimarySelection()},50)}}dn(mt,"copy",Ot),dn(mt,"cut",Ot)},pa.prototype.screenReaderLabelChanged=function(it){it?this.div.setAttribute("aria-label",it):this.div.removeAttribute("aria-label")},pa.prototype.prepareSelection=function(){var it=Br(this.cm,!1);return it.focus=document.activeElement==this.div,it},pa.prototype.showSelection=function(it,at){!it||!this.cm.display.view.length||((it.focus||at)&&this.showPrimarySelection(),this.showMultipleSelections(it))},pa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},pa.prototype.showPrimarySelection=function(){var it=this.getSelection(),at=this.cm,ct=at.doc.sel.primary(),dt=ct.from(),mt=ct.to();if(at.display.viewTo==at.display.viewFrom||dt.line>=at.display.viewTo||mt.line<at.display.viewFrom){it.removeAllRanges();return}var Ft=Ac(at,it.anchorNode,it.anchorOffset),Ot=Ac(at,it.focusNode,it.focusOffset);if(!(Ft&&!Ft.bad&&Ot&&!Ot.bad&&$e(Jn(Ft,Ot),dt)==0&&$e(di(Ft,Ot),mt)==0)){var Kt=at.display.view,Wt=dt.line>=at.display.viewFrom&&Ff(at,dt)||{node:Kt[0].measure.map[2],offset:0},le=mt.line<at.display.viewTo&&Ff(at,mt);if(!le){var Ze=Kt[Kt.length-1].measure,fe=Ze.maps?Ze.maps[Ze.maps.length-1]:Ze.map;le={node:fe[fe.length-1],offset:fe[fe.length-2]-fe[fe.length-3]}}if(!Wt||!le){it.removeAllRanges();return}var yn=it.rangeCount&&it.getRangeAt(0),ln;try{ln=re(Wt.node,Wt.offset,le.offset,le.node)}catch(wi){}ln&&(!gt&&at.state.focused?(it.collapse(Wt.node,Wt.offset),ln.collapsed||(it.removeAllRanges(),it.addRange(ln))):(it.removeAllRanges(),it.addRange(ln)),yn&&it.anchorNode==null?it.addRange(yn):gt&&this.startGracePeriod()),this.rememberSelection()}},pa.prototype.startGracePeriod=function(){var it=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){it.gracePeriod=!1,it.selectionChanged()&&it.cm.operation(function(){return it.cm.curOp.selectionChanged=!0})},20)},pa.prototype.showMultipleSelections=function(it){Xt(this.cm.display.cursorDiv,it.cursors),Xt(this.cm.display.selectionDiv,it.selection)},pa.prototype.rememberSelection=function(){var it=this.getSelection();this.lastAnchorNode=it.anchorNode,this.lastAnchorOffset=it.anchorOffset,this.lastFocusNode=it.focusNode,this.lastFocusOffset=it.focusOffset},pa.prototype.selectionInEditor=function(){var it=this.getSelection();if(!it.rangeCount)return!1;var at=it.getRangeAt(0).commonAncestorContainer;return Ne(this.div,at)},pa.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},pa.prototype.blur=function(){this.div.blur()},pa.prototype.getField=function(){return this.div},pa.prototype.supportsTouch=function(){return!0},pa.prototype.receivedFocus=function(){var it=this;this.selectionInEditor()?this.pollSelection():mr(this.cm,function(){return it.cm.curOp.selectionChanged=!0});function at(){it.cm.state.focused&&(it.pollSelection(),it.polling.set(it.cm.options.pollInterval,at))}this.polling.set(this.cm.options.pollInterval,at)},pa.prototype.selectionChanged=function(){var it=this.getSelection();return it.anchorNode!=this.lastAnchorNode||it.anchorOffset!=this.lastAnchorOffset||it.focusNode!=this.lastFocusNode||it.focusOffset!=this.lastFocusOffset},pa.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var it=this.getSelection(),at=this.cm;if(nt&&Qt&&this.cm.display.gutterSpecs.length&&Vg(it.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var ct=Ac(at,it.anchorNode,it.anchorOffset),dt=Ac(at,it.focusNode,it.focusOffset);ct&&dt&&mr(at,function(){Zs(at.doc,rh(ct,dt),De),(ct.bad||dt.bad)&&(at.curOp.selectionChanged=!0)})}}},pa.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var it=this.cm,at=it.display,ct=it.doc.sel.primary(),dt=ct.from(),mt=ct.to();if(dt.ch==0&&dt.line>it.firstLine()&&(dt=Re(dt.line-1,Dn(it.doc,dt.line-1).length)),mt.ch==Dn(it.doc,mt.line).text.length&&mt.line<it.lastLine()&&(mt=Re(mt.line+1,0)),dt.line<at.viewFrom||mt.line>at.viewTo-1)return!1;var Ft,Ot,Kt;dt.line==at.viewFrom||(Ft=Vi(it,dt.line))==0?(Ot=Gt(at.view[0].line),Kt=at.view[0].node):(Ot=Gt(at.view[Ft].line),Kt=at.view[Ft-1].node.nextSibling);var Wt=Vi(it,mt.line),le,Ze;if(Wt==at.view.length-1?(le=at.viewTo-1,Ze=at.lineDiv.lastChild):(le=Gt(at.view[Wt+1].line)-1,Ze=at.view[Wt+1].node.previousSibling),!Kt)return!1;for(var fe=it.doc.splitLines(Ud(it,Kt,Ze,Ot,le)),yn=ki(it.doc,Re(Ot,0),Re(le,Dn(it.doc,le).text.length));fe.length>1&&yn.length>1;)if(ne(fe)==ne(yn))fe.pop(),yn.pop(),le--;else if(fe[0]==yn[0])fe.shift(),yn.shift(),Ot++;else break;for(var ln=0,wi=0,Mi=fe[0],Ri=yn[0],sr=Math.min(Mi.length,Ri.length);ln<sr&&Mi.charCodeAt(ln)==Ri.charCodeAt(ln);)++ln;for(var Hr=ne(fe),Pr=ne(yn),Ur=Math.min(Hr.length-(fe.length==1?ln:0),Pr.length-(yn.length==1?ln:0));wi<Ur&&Hr.charCodeAt(Hr.length-wi-1)==Pr.charCodeAt(Pr.length-wi-1);)++wi;if(fe.length==1&&yn.length==1&&Ot==dt.line)for(;ln&&ln>dt.ch&&Hr.charCodeAt(Hr.length-wi-1)==Pr.charCodeAt(Pr.length-wi-1);)ln--,wi++;fe[fe.length-1]=Hr.slice(0,Hr.length-wi).replace(/^\u200b+/,""),fe[0]=fe[0].slice(ln).replace(/\u200b+$/,"");var Lo=Re(Ot,ln),xr=Re(le,yn.length?ne(yn).length-wi:0);if(fe.length>1||fe[0]||$e(Lo,xr))return nd(it.doc,fe,Lo,xr,"+input"),!0},pa.prototype.ensurePolled=function(){this.forceCompositionEnd()},pa.prototype.reset=function(){this.forceCompositionEnd()},pa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},pa.prototype.readFromDOMSoon=function(){var it=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(it.readDOMTimeout=null,it.composing)if(it.composing.done)it.composing=null;else return;it.updateFromDOM()},80))},pa.prototype.updateFromDOM=function(){var it=this;(this.cm.isReadOnly()||!this.pollContent())&&mr(this.cm,function(){return ar(it.cm)})},pa.prototype.setUneditable=function(it){it.contentEditable="false"},pa.prototype.onKeyPress=function(it){it.charCode==0||this.composing||(it.preventDefault(),this.cm.isReadOnly()||hr(this.cm,Nc)(this.cm,String.fromCharCode(it.charCode==null?it.keyCode:it.charCode),0))},pa.prototype.readOnlyChanged=function(it){this.div.contentEditable=String(it!="nocursor")},pa.prototype.onContextMenu=function(){},pa.prototype.resetPosition=function(){},pa.prototype.needsContentAttribute=!0;function Ff(it,at){var ct=js(it,at.line);if(!ct||ct.hidden)return null;var dt=Dn(it.doc,at.line),mt=La(ct,dt,at.line),Ft=Qe(dt,it.doc.direction),Ot="left";if(Ft){var Kt=Fe(Ft,at.ch);Ot=Kt%2?"right":"left"}var Wt=lu(mt.map,at.ch,Ot);return Wt.offset=Wt.collapse=="right"?Wt.end:Wt.start,Wt}function Vg(it){for(var at=it;at;at=at.parentNode)if(/CodeMirror-gutter-wrapper/.test(at.className))return!0;return!1}function Kd(it,at){return at&&(it.bad=!0),it}function Ud(it,at,ct,dt,mt){var Ft="",Ot=!1,Kt=it.doc.lineSeparator(),Wt=!1;function le(ln){return function(wi){return wi.id==ln}}function Ze(){Ot&&(Ft+=Kt,Wt&&(Ft+=Kt),Ot=Wt=!1)}function fe(ln){ln&&(Ze(),Ft+=ln)}function yn(ln){if(ln.nodeType==1){var wi=ln.getAttribute("cm-text");if(wi){fe(wi);return}var Mi=ln.getAttribute("cm-marker"),Ri;if(Mi){var sr=it.findMarks(Re(dt,0),Re(mt+1,0),le(+Mi));sr.length&&(Ri=sr[0].find(0))&&fe(ki(it.doc,Ri.from,Ri.to).join(Kt));return}if(ln.getAttribute("contenteditable")=="false")return;var Hr=/^(pre|div|p|li|table|br)$/i.test(ln.nodeName);if(!/^br$/i.test(ln.nodeName)&&ln.textContent.length==0)return;Hr&&Ze();for(var Pr=0;Pr<ln.childNodes.length;Pr++)yn(ln.childNodes[Pr]);/^(pre|p)$/i.test(ln.nodeName)&&(Wt=!0),Hr&&(Ot=!0)}else ln.nodeType==3&&fe(ln.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;yn(at),at!=ct;)at=at.nextSibling,Wt=!1;return Ft}function Ac(it,at,ct){var dt;if(at==it.display.lineDiv){if(dt=it.display.lineDiv.childNodes[ct],!dt)return Kd(it.clipPos(Re(it.display.viewTo-1)),!0);at=null,ct=0}else for(dt=at;;dt=dt.parentNode){if(!dt||dt==it.display.lineDiv)return null;if(dt.parentNode&&dt.parentNode==it.display.lineDiv)break}for(var mt=0;mt<it.display.view.length;mt++){var Ft=it.display.view[mt];if(Ft.node==dt)return lm(Ft,at,ct)}}function lm(it,at,ct){var dt=it.text.firstChild,mt=!1;if(!at||!Ne(dt,at))return Kd(Re(Gt(it.line),0),!0);if(at==dt&&(mt=!0,at=dt.childNodes[ct],ct=0,!at)){var Ft=it.rest?ne(it.rest):it.line;return Kd(Re(Gt(Ft),Ft.text.length),mt)}var Ot=at.nodeType==3?at:null,Kt=at;for(!Ot&&at.childNodes.length==1&&at.firstChild.nodeType==3&&(Ot=at.firstChild,ct&&(ct=Ot.nodeValue.length));Kt.parentNode!=dt;)Kt=Kt.parentNode;var Wt=it.measure,le=Wt.maps;function Ze(Ri,sr,Hr){for(var Pr=-1;Pr<(le?le.length:0);Pr++)for(var Ur=Pr<0?Wt.map:le[Pr],Lo=0;Lo<Ur.length;Lo+=3){var xr=Ur[Lo+2];if(xr==Ri||xr==sr){var Ho=Gt(Pr<0?it.line:it.rest[Pr]),ka=Ur[Lo]+Hr;return(Hr<0||xr!=Ri)&&(ka=Ur[Lo+(Hr?1:0)]),Re(Ho,ka)}}}var fe=Ze(Ot,Kt,ct);if(fe)return Kd(fe,mt);for(var yn=Kt.nextSibling,ln=Ot?Ot.nodeValue.length-ct:0;yn;yn=yn.nextSibling){if(fe=Ze(yn,yn.firstChild,0),fe)return Kd(Re(fe.line,fe.ch-ln),mt);ln+=yn.textContent.length}for(var wi=Kt.previousSibling,Mi=ct;wi;wi=wi.previousSibling){if(fe=Ze(wi,wi.firstChild,-1),fe)return Kd(Re(fe.line,fe.ch+Mi),mt);Mi+=wi.textContent.length}}var rs=function(it){this.cm=it,this.prevInput="",this.pollingFast=!1,this.polling=new Jt,this.hasSelection=!1,this.composing=null};rs.prototype.init=function(it){var at=this,ct=this,dt=this.cm;this.createField(it);var mt=this.textarea;it.wrapper.insertBefore(this.wrapper,it.wrapper.firstChild),Bt&&(mt.style.width="0px"),dn(mt,"input",function(){he&&Dt>=9&&at.hasSelection&&(at.hasSelection=null),ct.poll()}),dn(mt,"paste",function(Ot){an(dt,Ot)||zg(Ot,dt)||(dt.state.pasteIncoming=+new Date,ct.fastPoll())});function Ft(Ot){if(!an(dt,Ot)){if(dt.somethingSelected())hd({lineWise:!1,text:dt.getSelections()});else if(dt.options.lineWiseCopyCut){var Kt=Gg(dt);hd({lineWise:!0,text:Kt.text}),Ot.type=="cut"?dt.setSelections(Kt.ranges,null,De):(ct.prevInput="",mt.value=Kt.text.join(`
`),je(mt))}else return;Ot.type=="cut"&&(dt.state.cutIncoming=+new Date)}}dn(mt,"cut",Ft),dn(mt,"copy",Ft),dn(it.scroller,"paste",function(Ot){if(!(Yo(it,Ot)||an(dt,Ot))){if(!mt.dispatchEvent){dt.state.pasteIncoming=+new Date,ct.focus();return}var Kt=new Event("paste");Kt.clipboardData=Ot.clipboardData,mt.dispatchEvent(Kt)}}),dn(it.lineSpace,"selectstart",function(Ot){Yo(it,Ot)||In(Ot)}),dn(mt,"compositionstart",function(){var Ot=dt.getCursor("from");ct.composing&&ct.composing.range.clear(),ct.composing={start:Ot,range:dt.markText(Ot,dt.getCursor("to"),{className:"CodeMirror-composing"})}}),dn(mt,"compositionend",function(){ct.composing&&(ct.poll(),ct.composing.range.clear(),ct.composing=null)})},rs.prototype.createField=function(it){this.wrapper=Wg(),this.textarea=this.wrapper.firstChild},rs.prototype.screenReaderLabelChanged=function(it){it?this.textarea.setAttribute("aria-label",it):this.textarea.removeAttribute("aria-label")},rs.prototype.prepareSelection=function(){var it=this.cm,at=it.display,ct=it.doc,dt=Br(it);if(it.options.moveInputWithCursor){var mt=_o(it,ct.sel.primary().head,"div"),Ft=at.wrapper.getBoundingClientRect(),Ot=at.lineDiv.getBoundingClientRect();dt.teTop=Math.max(0,Math.min(at.wrapper.clientHeight-10,mt.top+Ot.top-Ft.top)),dt.teLeft=Math.max(0,Math.min(at.wrapper.clientWidth-10,mt.left+Ot.left-Ft.left))}return dt},rs.prototype.showSelection=function(it){var at=this.cm,ct=at.display;Xt(ct.cursorDiv,it.cursors),Xt(ct.selectionDiv,it.selection),it.teTop!=null&&(this.wrapper.style.top=it.teTop+"px",this.wrapper.style.left=it.teLeft+"px")},rs.prototype.reset=function(it){if(!(this.contextMenuPending||this.composing)){var at=this.cm;if(at.somethingSelected()){this.prevInput="";var ct=at.getSelection();this.textarea.value=ct,at.state.focused&&je(this.textarea),he&&Dt>=9&&(this.hasSelection=ct)}else it||(this.prevInput=this.textarea.value="",he&&Dt>=9&&(this.hasSelection=null))}},rs.prototype.getField=function(){return this.textarea},rs.prototype.supportsTouch=function(){return!1},rs.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!et||ye()!=this.textarea))try{this.textarea.focus()}catch(it){}},rs.prototype.blur=function(){this.textarea.blur()},rs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},rs.prototype.receivedFocus=function(){this.slowPoll()},rs.prototype.slowPoll=function(){var it=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){it.poll(),it.cm.state.focused&&it.slowPoll()})},rs.prototype.fastPoll=function(){var it=!1,at=this;at.pollingFast=!0;function ct(){var dt=at.poll();!dt&&!it?(it=!0,at.polling.set(60,ct)):(at.pollingFast=!1,at.slowPoll())}at.polling.set(20,ct)},rs.prototype.poll=function(){var it=this,at=this.cm,ct=this.textarea,dt=this.prevInput;if(this.contextMenuPending||!at.state.focused||wt(ct)&&!dt&&!this.composing||at.isReadOnly()||at.options.disableInput||at.state.keySeq)return!1;var mt=ct.value;if(mt==dt&&!at.somethingSelected())return!1;if(he&&Dt>=9&&this.hasSelection===mt||ht&&/[\uf700-\uf7ff]/.test(mt))return at.display.input.reset(),!1;if(at.doc.sel==at.display.selForContextMenu){var Ft=mt.charCodeAt(0);if(Ft==8203&&!dt&&(dt="\u200B"),Ft==8666)return this.reset(),this.cm.execCommand("undo")}for(var Ot=0,Kt=Math.min(dt.length,mt.length);Ot<Kt&&dt.charCodeAt(Ot)==mt.charCodeAt(Ot);)++Ot;return mr(at,function(){Nc(at,mt.slice(Ot),dt.length-Ot,null,it.composing?"*compose":null),mt.length>1e3||mt.indexOf(`
`)>-1?ct.value=it.prevInput="":it.prevInput=mt,it.composing&&(it.composing.range.clear(),it.composing.range=at.markText(it.composing.start,at.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},rs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},rs.prototype.onKeyPress=function(){he&&Dt>=9&&(this.hasSelection=null),this.fastPoll()},rs.prototype.onContextMenu=function(it){var at=this,ct=at.cm,dt=ct.display,mt=at.textarea;at.contextMenuPending&&at.contextMenuPending();var Ft=eo(ct,it),Ot=dt.scroller.scrollTop;if(!Ft||jt)return;var Kt=ct.options.resetSelectionOnContextMenu;Kt&&ct.doc.sel.contains(Ft)==-1&&hr(ct,Zs)(ct.doc,rh(Ft),De);var Wt=mt.style.cssText,le=at.wrapper.style.cssText,Ze=at.wrapper.offsetParent.getBoundingClientRect();at.wrapper.style.cssText="position: static",mt.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(it.clientY-Ze.top-5)+"px; left: "+(it.clientX-Ze.left-5)+`px;
z-index: 1000; background: `+(he?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var fe;ee&&(fe=window.scrollY),dt.input.focus(),ee&&window.scrollTo(null,fe),dt.input.reset(),ct.somethingSelected()||(mt.value=at.prevInput=" "),at.contextMenuPending=ln,dt.selForContextMenu=ct.doc.sel,clearTimeout(dt.detectingSelectAll);function yn(){if(mt.selectionStart!=null){var Mi=ct.somethingSelected(),Ri="\u200B"+(Mi?mt.value:"");mt.value="\u21DA",mt.value=Ri,at.prevInput=Mi?"":"\u200B",mt.selectionStart=1,mt.selectionEnd=Ri.length,dt.selForContextMenu=ct.doc.sel}}function ln(){if(at.contextMenuPending==ln&&(at.contextMenuPending=!1,at.wrapper.style.cssText=le,mt.style.cssText=Wt,he&&Dt<9&&dt.scrollbars.setScrollTop(dt.scroller.scrollTop=Ot),mt.selectionStart!=null)){(!he||he&&Dt<9)&&yn();var Mi=0,Ri=function(){dt.selForContextMenu==ct.doc.sel&&mt.selectionStart==0&&mt.selectionEnd>0&&at.prevInput=="\u200B"?hr(ct,qa)(ct):Mi++<10?dt.detectingSelectAll=setTimeout(Ri,500):(dt.selForContextMenu=null,dt.input.reset())};dt.detectingSelectAll=setTimeout(Ri,200)}}if(he&&Dt>=9&&yn(),Et){mi(it);var wi=function(){ze(window,"mouseup",wi),setTimeout(ln,20)};dn(window,"mouseup",wi)}else setTimeout(ln,50)},rs.prototype.readOnlyChanged=function(it){it||this.reset(),this.textarea.disabled=it=="nocursor",this.textarea.readOnly=!!it},rs.prototype.setUneditable=function(){},rs.prototype.needsContentAttribute=!1;function um(it,at){if(at=at?fn(at):{},at.value=it.value,!at.tabindex&&it.tabIndex&&(at.tabindex=it.tabIndex),!at.placeholder&&it.placeholder&&(at.placeholder=it.placeholder),at.autofocus==null){var ct=ye();at.autofocus=ct==it||it.getAttribute("autofocus")!=null&&ct==document.body}function dt(){it.value=Kt.getValue()}var mt;if(it.form&&(dn(it.form,"submit",dt),!at.leaveSubmitMethodAlone)){var Ft=it.form;mt=Ft.submit;try{var Ot=Ft.submit=function(){dt(),Ft.submit=mt,Ft.submit(),Ft.submit=Ot}}catch(Wt){}}at.finishInit=function(Wt){Wt.save=dt,Wt.getTextArea=function(){return it},Wt.toTextArea=function(){Wt.toTextArea=isNaN,dt(),it.parentNode.removeChild(Wt.getWrapperElement()),it.style.display="",it.form&&(ze(it.form,"submit",dt),!at.leaveSubmitMethodAlone&&typeof it.form.submit=="function"&&(it.form.submit=mt))}},it.style.display="none";var Kt=Qo(function(Wt){return it.parentNode.insertBefore(Wt,it.nextSibling)},at);return Kt}function Yd(it){it.off=ze,it.on=dn,it.wheelEventPixels=Ol,it.Doc=Bs,it.splitLines=Gi,it.countColumn=te,it.findColumn=Kn,it.isWordChar=Nt,it.Pass=bn,it.signal=We,it.Line=oo,it.changeEnd=Ch,it.scrollbarModel=pl,it.Pos=Re,it.cmpPos=$e,it.modes=zn,it.mimeModes=oi,it.resolveMode=Fi,it.getMode=ve,it.modeExtensions=Le,it.extendMode=Se,it.copyState=ti,it.startState=Wn,it.innerMode=Yn,it.commands=Mh,it.keyMap=Sl,it.keyName=em,it.isModifierKey=zd,it.lookupKey=$l,it.normalizeKeyMap=Fg,it.StringStream=qe,it.SharedTextMarker=zu,it.TextMarker=be,it.LineWidget=sh,it.e_preventDefault=In,it.e_stopPropagation=pi,it.e_stop=mi,it.addClass=xe,it.contains=Ne,it.rmClass=It,it.keyNames=Zu}am(Qo),bh(Qo);var lh="iter insert remove copy getEditor constructor".split(" ");for(var Tc in Bs.prototype)Bs.prototype.hasOwnProperty(Tc)&&Xe(lh,Tc)<0&&(Qo.prototype[Tc]=function(it){return function(){return it.apply(this.doc,arguments)}}(Bs.prototype[Tc]));return rn(Bs),Qo.inputStyles={textarea:rs,contenteditable:pa},Qo.defineMode=function(it){!Qo.defaults.mode&&it!="null"&&(Qo.defaults.mode=it),Si.apply(this,arguments)},Qo.defineMIME=Yi,Qo.defineMode("null",function(){return{token:function(it){return it.skipToEnd()}}}),Qo.defineMIME("text/plain","null"),Qo.defineExtension=function(it,at){Qo.prototype[it]=at},Qo.defineDocExtension=function(it,at){Bs.prototype[it]=at},Qo.fromTextArea=um,Yd(Qo),Qo.version="5.58.2",Qo})},25419:function(Mn,Rn,kt){(function(gt){gt(kt(89780),kt(15525),kt(98101))})(function(gt){"use strict";gt.defineMode("markdown",function(Ut,ue){var Ee=gt.getMode(Ut,"text/html"),he=Ee.name=="null";function Dt(te){if(gt.findModeByName){var Jt=gt.findModeByName(te);Jt&&(te=Jt.mime||Jt.mimes[0])}var Xe=gt.getMode(Ut,te);return Xe.name=="null"?null:Xe}ue.highlightFormatting===void 0&&(ue.highlightFormatting=!1),ue.maxBlockquoteDepth===void 0&&(ue.maxBlockquoteDepth=0),ue.taskLists===void 0&&(ue.taskLists=!1),ue.strikethrough===void 0&&(ue.strikethrough=!1),ue.emoji===void 0&&(ue.emoji=!1),ue.fencedCodeBlockHighlighting===void 0&&(ue.fencedCodeBlockHighlighting=!0),ue.fencedCodeBlockDefaultMode===void 0&&(ue.fencedCodeBlockDefaultMode="text/plain"),ue.xml===void 0&&(ue.xml=!0),ue.tokenTypeOverrides===void 0&&(ue.tokenTypeOverrides={});var ee={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var ge in ee)ee.hasOwnProperty(ge)&&ue.tokenTypeOverrides[ge]&&(ee[ge]=ue.tokenTypeOverrides[ge]);var Qt=/^([*\-_])(?:\s*\1){2,}\s*$/,jt=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,Ae=/^\[(x| )\](?=\s)/i,se=ue.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,Pe=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Bt=/^[^#!\[\]*_\\<>` "'(~:]+/,nt=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,et=/^\s*\[[^\]]+?\]:.*$/,ht=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,st=" ";function pt(te,Jt,Xe){return Jt.f=Jt.inline=Xe,Xe(te,Jt)}function vt(te,Jt,Xe){return Jt.f=Jt.block=Xe,Xe(te,Jt)}function St(te){return!te||!/\S/.test(te.string)}function Et(te){if(te.linkTitle=!1,te.linkHref=!1,te.linkText=!1,te.em=!1,te.strong=!1,te.strikethrough=!1,te.quote=0,te.indentedCode=!1,te.f==It){var Jt=he;if(!Jt){var Xe=gt.innerMode(Ee,te.htmlState);Jt=Xe.mode.name=="xml"&&Xe.state.tagStart===null&&!Xe.state.context&&Xe.state.tokenize.isInText}Jt&&(te.f=pe,te.block=Tt,te.htmlState=null)}return te.trailingSpace=0,te.trailingSpaceNewLine=!1,te.prevLine=te.thisLine,te.thisLine={stream:null},null}function Tt(te,Jt){var Xe=te.column()===Jt.indentation,On=St(Jt.prevLine.stream),bn=Jt.indentedCode,De=Jt.prevLine.hr,on=Jt.list!==!1,un=(Jt.listStack[Jt.listStack.length-1]||0)+3;Jt.indentedCode=!1;var Kn=Jt.indentation;if(Jt.indentationDiff===null&&(Jt.indentationDiff=Jt.indentation,on)){for(Jt.list=null;Kn<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=Kn-Jt.listStack[Jt.listStack.length-1])}var Me=!On&&!De&&!Jt.prevLine.header&&(!on||!bn)&&!Jt.prevLine.fencedCodeEnd,vn=(Jt.list===!1||De||On)&&Jt.indentation<=un&&te.match(Qt),ne=null;if(Jt.indentationDiff>=4&&(bn||Jt.prevLine.fencedCodeEnd||Jt.prevLine.header||On))return te.skipToEnd(),Jt.indentedCode=!0,ee.code;if(te.eatSpace())return null;if(Xe&&Jt.indentation<=un&&(ne=te.match(se))&&ne[1].length<=6)return Jt.quote=0,Jt.header=ne[1].length,Jt.thisLine.header=!0,ue.highlightFormatting&&(Jt.formatting="header"),Jt.f=Jt.inline,Xt(Jt);if(Jt.indentation<=un&&te.eat(">"))return Jt.quote=Xe?1:Jt.quote+1,ue.highlightFormatting&&(Jt.formatting="quote"),te.eatSpace(),Xt(Jt);if(!vn&&!Jt.setext&&Xe&&Jt.indentation<=un&&(ne=te.match(jt))){var wn=ne[1]?"ol":"ul";return Jt.indentation=Kn+te.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,ue.taskLists&&te.match(Ae,!1)&&(Jt.taskList=!0),Jt.f=Jt.inline,ue.highlightFormatting&&(Jt.formatting=["list","list-"+wn]),Xt(Jt)}else{if(Xe&&Jt.indentation<=un&&(ne=te.match(nt,!0)))return Jt.quote=0,Jt.fencedEndRE=new RegExp(ne[1]+"+ *$"),Jt.localMode=ue.fencedCodeBlockHighlighting&&Dt(ne[2]||ue.fencedCodeBlockDefaultMode),Jt.localMode&&(Jt.localState=gt.startState(Jt.localMode)),Jt.f=Jt.block=qt,ue.highlightFormatting&&(Jt.formatting="code-block"),Jt.code=-1,Xt(Jt);if(Jt.setext||(!Me||!on)&&!Jt.quote&&Jt.list===!1&&!Jt.code&&!vn&&!et.test(te.string)&&(ne=te.lookAhead(1))&&(ne=ne.match(Pe)))return Jt.setext?(Jt.header=Jt.setext,Jt.setext=0,te.skipToEnd(),ue.highlightFormatting&&(Jt.formatting="header")):(Jt.header=ne[0].charAt(0)=="="?1:2,Jt.setext=Jt.header),Jt.thisLine.header=!0,Jt.f=Jt.inline,Xt(Jt);if(vn)return te.skipToEnd(),Jt.hr=!0,Jt.thisLine.hr=!0,ee.hr;if(te.peek()==="[")return pt(te,Jt,Ue)}return pt(te,Jt,Jt.inline)}function It(te,Jt){var Xe=Ee.token(te,Jt.htmlState);if(!he){var On=gt.innerMode(Ee,Jt.htmlState);(On.mode.name=="xml"&&On.state.tagStart===null&&!On.state.context&&On.state.tokenize.isInText||Jt.md_inside&&te.current().indexOf(">")>-1)&&(Jt.f=pe,Jt.block=Tt,Jt.htmlState=null)}return Xe}function qt(te,Jt){var Xe=Jt.listStack[Jt.listStack.length-1]||0,On=Jt.indentation<Xe,bn=Xe+3;if(Jt.fencedEndRE&&Jt.indentation<=bn&&(On||te.match(Jt.fencedEndRE))){ue.highlightFormatting&&(Jt.formatting="code-block");var De;return On||(De=Xt(Jt)),Jt.localMode=Jt.localState=null,Jt.block=Tt,Jt.f=pe,Jt.fencedEndRE=null,Jt.code=0,Jt.thisLine.fencedCodeEnd=!0,On?vt(te,Jt,Jt.block):De}else return Jt.localMode?Jt.localMode.token(te,Jt.localState):(te.skipToEnd(),ee.code)}function Xt(te){var Jt=[];if(te.formatting){Jt.push(ee.formatting),typeof te.formatting=="string"&&(te.formatting=[te.formatting]);for(var Xe=0;Xe<te.formatting.length;Xe++)Jt.push(ee.formatting+"-"+te.formatting[Xe]),te.formatting[Xe]==="header"&&Jt.push(ee.formatting+"-"+te.formatting[Xe]+"-"+te.header),te.formatting[Xe]==="quote"&&(!ue.maxBlockquoteDepth||ue.maxBlockquoteDepth>=te.quote?Jt.push(ee.formatting+"-"+te.formatting[Xe]+"-"+te.quote):Jt.push("error"))}if(te.taskOpen)return Jt.push("meta"),Jt.length?Jt.join(" "):null;if(te.taskClosed)return Jt.push("property"),Jt.length?Jt.join(" "):null;if(te.linkHref?Jt.push(ee.linkHref,"url"):(te.strong&&Jt.push(ee.strong),te.em&&Jt.push(ee.em),te.strikethrough&&Jt.push(ee.strikethrough),te.emoji&&Jt.push(ee.emoji),te.linkText&&Jt.push(ee.linkText),te.code&&Jt.push(ee.code),te.image&&Jt.push(ee.image),te.imageAltText&&Jt.push(ee.imageAltText,"link"),te.imageMarker&&Jt.push(ee.imageMarker)),te.header&&Jt.push(ee.header,ee.header+"-"+te.header),te.quote&&(Jt.push(ee.quote),!ue.maxBlockquoteDepth||ue.maxBlockquoteDepth>=te.quote?Jt.push(ee.quote+"-"+te.quote):Jt.push(ee.quote+"-"+ue.maxBlockquoteDepth)),te.list!==!1){var On=(te.listStack.length-1)%3;On?On===1?Jt.push(ee.list2):Jt.push(ee.list3):Jt.push(ee.list1)}return te.trailingSpaceNewLine?Jt.push("trailing-space-new-line"):te.trailingSpace&&Jt.push("trailing-space-"+(te.trailingSpace%2?"a":"b")),Jt.length?Jt.join(" "):null}function Ht(te,Jt){if(te.match(Bt,!0))return Xt(Jt)}function pe(te,Jt){var Xe=Jt.text(te,Jt);if(typeof Xe!="undefined")return Xe;if(Jt.list)return Jt.list=null,Xt(Jt);if(Jt.taskList){var On=te.match(Ae,!0)[1]===" ";return On?Jt.taskOpen=!0:Jt.taskClosed=!0,ue.highlightFormatting&&(Jt.formatting="task"),Jt.taskList=!1,Xt(Jt)}if(Jt.taskOpen=!1,Jt.taskClosed=!1,Jt.header&&te.match(/^#+$/,!0))return ue.highlightFormatting&&(Jt.formatting="header"),Xt(Jt);var bn=te.next();if(Jt.linkTitle){Jt.linkTitle=!1;var De=bn;bn==="("&&(De=")"),De=(De+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var on="^\\s*(?:[^"+De+"\\\\]+|\\\\\\\\|\\\\.)"+De;if(te.match(new RegExp(on),!0))return ee.linkHref}if(bn==="`"){var un=Jt.formatting;ue.highlightFormatting&&(Jt.formatting="code"),te.eatWhile("`");var Kn=te.current().length;if(Jt.code==0&&(!Jt.quote||Kn==1))return Jt.code=Kn,Xt(Jt);if(Kn==Jt.code){var Me=Xt(Jt);return Jt.code=0,Me}else return Jt.formatting=un,Xt(Jt)}else if(Jt.code)return Xt(Jt);if(bn==="\\"&&(te.next(),ue.highlightFormatting)){var vn=Xt(Jt),ne=ee.formatting+"-escape";return vn?vn+" "+ne:ne}if(bn==="!"&&te.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return Jt.imageMarker=!0,Jt.image=!0,ue.highlightFormatting&&(Jt.formatting="image"),Xt(Jt);if(bn==="["&&Jt.imageMarker&&te.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return Jt.imageMarker=!1,Jt.imageAltText=!0,ue.highlightFormatting&&(Jt.formatting="image"),Xt(Jt);if(bn==="]"&&Jt.imageAltText){ue.highlightFormatting&&(Jt.formatting="image");var vn=Xt(Jt);return Jt.imageAltText=!1,Jt.image=!1,Jt.inline=Jt.f=Ne,vn}if(bn==="["&&!Jt.image)return Jt.linkText&&te.match(/^.*?\]/)||(Jt.linkText=!0,ue.highlightFormatting&&(Jt.formatting="link")),Xt(Jt);if(bn==="]"&&Jt.linkText){ue.highlightFormatting&&(Jt.formatting="link");var vn=Xt(Jt);return Jt.linkText=!1,Jt.inline=Jt.f=te.match(/\(.*?\)| ?\[.*?\]/,!1)?Ne:pe,vn}if(bn==="<"&&te.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){Jt.f=Jt.inline=re,ue.highlightFormatting&&(Jt.formatting="link");var vn=Xt(Jt);return vn?vn+=" ":vn="",vn+ee.linkInline}if(bn==="<"&&te.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){Jt.f=Jt.inline=re,ue.highlightFormatting&&(Jt.formatting="link");var vn=Xt(Jt);return vn?vn+=" ":vn="",vn+ee.linkEmail}if(ue.xml&&bn==="<"&&te.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var wn=te.string.indexOf(">",te.pos);if(wn!=-1){var fi=te.string.substring(te.start,wn);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(fi)&&(Jt.md_inside=!0)}return te.backUp(1),Jt.htmlState=gt.startState(Ee),vt(te,Jt,It)}if(ue.xml&&bn==="<"&&te.match(/^\/\w*?>/))return Jt.md_inside=!1,"tag";if(bn==="*"||bn==="_"){for(var Rt=1,Lt=te.pos==1?" ":te.string.charAt(te.pos-2);Rt<3&&te.eat(bn);)Rt++;var Pt=te.peek()||" ",Nt=!/\s/.test(Pt)&&(!ht.test(Pt)||/\s/.test(Lt)||ht.test(Lt)),Zt=!/\s/.test(Lt)&&(!ht.test(Lt)||/\s/.test(Pt)||ht.test(Pt)),Mt=null,Yt=null;if(Rt%2&&(!Jt.em&&Nt&&(bn==="*"||!Zt||ht.test(Lt))?Mt=!0:Jt.em==bn&&Zt&&(bn==="*"||!Nt||ht.test(Pt))&&(Mt=!1)),Rt>1&&(!Jt.strong&&Nt&&(bn==="*"||!Zt||ht.test(Lt))?Yt=!0:Jt.strong==bn&&Zt&&(bn==="*"||!Nt||ht.test(Pt))&&(Yt=!1)),Yt!=null||Mt!=null){ue.highlightFormatting&&(Jt.formatting=Mt==null?"strong":Yt==null?"em":"strong em"),Mt===!0&&(Jt.em=bn),Yt===!0&&(Jt.strong=bn);var Me=Xt(Jt);return Mt===!1&&(Jt.em=!1),Yt===!1&&(Jt.strong=!1),Me}}else if(bn===" "&&(te.eat("*")||te.eat("_"))){if(te.peek()===" ")return Xt(Jt);te.backUp(1)}if(ue.strikethrough){if(bn==="~"&&te.eatWhile(bn)){if(Jt.strikethrough){ue.highlightFormatting&&(Jt.formatting="strikethrough");var Me=Xt(Jt);return Jt.strikethrough=!1,Me}else if(te.match(/^[^\s]/,!1))return Jt.strikethrough=!0,ue.highlightFormatting&&(Jt.formatting="strikethrough"),Xt(Jt)}else if(bn===" "&&te.match(/^~~/,!0)){if(te.peek()===" ")return Xt(Jt);te.backUp(2)}}if(ue.emoji&&bn===":"&&te.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){Jt.emoji=!0,ue.highlightFormatting&&(Jt.formatting="emoji");var Ge=Xt(Jt);return Jt.emoji=!1,Ge}return bn===" "&&(te.match(/^ +$/,!1)?Jt.trailingSpace++:Jt.trailingSpace&&(Jt.trailingSpaceNewLine=!0)),Xt(Jt)}function re(te,Jt){var Xe=te.next();if(Xe===">"){Jt.f=Jt.inline=pe,ue.highlightFormatting&&(Jt.formatting="link");var On=Xt(Jt);return On?On+=" ":On="",On+ee.linkInline}return te.match(/^[^>]+/,!0),ee.linkInline}function Ne(te,Jt){if(te.eatSpace())return null;var Xe=te.next();return Xe==="("||Xe==="["?(Jt.f=Jt.inline=xe(Xe==="("?")":"]"),ue.highlightFormatting&&(Jt.formatting="link-string"),Jt.linkHref=!0,Xt(Jt)):"error"}var ye={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function xe(te){return function(Jt,Xe){var On=Jt.next();if(On===te){Xe.f=Xe.inline=pe,ue.highlightFormatting&&(Xe.formatting="link-string");var bn=Xt(Xe);return Xe.linkHref=!1,bn}return Jt.match(ye[te]),Xe.linkHref=!0,Xt(Xe)}}function Ue(te,Jt){return te.match(/^([^\]\\]|\\.)*\]:/,!1)?(Jt.f=je,te.next(),ue.highlightFormatting&&(Jt.formatting="link"),Jt.linkText=!0,Xt(Jt)):pt(te,Jt,pe)}function je(te,Jt){if(te.match(/^\]:/,!0)){Jt.f=Jt.inline=Je,ue.highlightFormatting&&(Jt.formatting="link");var Xe=Xt(Jt);return Jt.linkText=!1,Xe}return te.match(/^([^\]\\]|\\.)+/,!0),ee.linkText}function Je(te,Jt){return te.eatSpace()?null:(te.match(/^[^\s]+/,!0),te.peek()===void 0?Jt.linkTitle=!0:te.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),Jt.f=Jt.inline=pe,ee.linkHref+" url")}var fn={startState:function(){return{f:Tt,prevLine:{stream:null},thisLine:{stream:null},block:Tt,htmlState:null,indentation:0,inline:pe,text:Ht,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(te){return{f:te.f,prevLine:te.prevLine,thisLine:te.thisLine,block:te.block,htmlState:te.htmlState&&gt.copyState(Ee,te.htmlState),indentation:te.indentation,localMode:te.localMode,localState:te.localMode?gt.copyState(te.localMode,te.localState):null,inline:te.inline,text:te.text,formatting:!1,linkText:te.linkText,linkTitle:te.linkTitle,linkHref:te.linkHref,code:te.code,em:te.em,strong:te.strong,strikethrough:te.strikethrough,emoji:te.emoji,header:te.header,setext:te.setext,hr:te.hr,taskList:te.taskList,list:te.list,listStack:te.listStack.slice(0),quote:te.quote,indentedCode:te.indentedCode,trailingSpace:te.trailingSpace,trailingSpaceNewLine:te.trailingSpaceNewLine,md_inside:te.md_inside,fencedEndRE:te.fencedEndRE}},token:function(te,Jt){if(Jt.formatting=!1,te!=Jt.thisLine.stream){if(Jt.header=0,Jt.hr=!1,te.match(/^\s*$/,!0))return Et(Jt),null;if(Jt.prevLine=Jt.thisLine,Jt.thisLine={stream:te},Jt.taskList=!1,Jt.trailingSpace=0,Jt.trailingSpaceNewLine=!1,!Jt.localState&&(Jt.f=Jt.block,Jt.f!=It)){var Xe=te.match(/^\s*/,!0)[0].replace(/\t/g,st).length;if(Jt.indentation=Xe,Jt.indentationDiff=null,Xe>0)return null}}return Jt.f(te,Jt)},innerMode:function(te){return te.block==It?{state:te.htmlState,mode:Ee}:te.localState?{state:te.localState,mode:te.localMode}:{state:te,mode:fn}},indent:function(te,Jt,Xe){return te.block==It&&Ee.indent?Ee.indent(te.htmlState,Jt,Xe):te.localState&&te.localMode.indent?te.localMode.indent(te.localState,Jt,Xe):gt.Pass},blankLine:Et,getType:Xt,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return fn},"xml"),gt.defineMIME("text/markdown","markdown"),gt.defineMIME("text/x-markdown","markdown")})},98101:function(Mn,Rn,kt){(function(gt){gt(kt(89780))})(function(gt){"use strict";gt.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Ut=0;Ut<gt.modeInfo.length;Ut++){var ue=gt.modeInfo[Ut];ue.mimes&&(ue.mime=ue.mimes[0])}gt.findModeByMIME=function(Ee){Ee=Ee.toLowerCase();for(var he=0;he<gt.modeInfo.length;he++){var Dt=gt.modeInfo[he];if(Dt.mime==Ee)return Dt;if(Dt.mimes){for(var ee=0;ee<Dt.mimes.length;ee++)if(Dt.mimes[ee]==Ee)return Dt}}if(/\+xml$/.test(Ee))return gt.findModeByMIME("application/xml");if(/\+json$/.test(Ee))return gt.findModeByMIME("application/json")},gt.findModeByExtension=function(Ee){Ee=Ee.toLowerCase();for(var he=0;he<gt.modeInfo.length;he++){var Dt=gt.modeInfo[he];if(Dt.ext){for(var ee=0;ee<Dt.ext.length;ee++)if(Dt.ext[ee]==Ee)return Dt}}},gt.findModeByFileName=function(Ee){for(var he=0;he<gt.modeInfo.length;he++){var Dt=gt.modeInfo[he];if(Dt.file&&Dt.file.test(Ee))return Dt}var ee=Ee.lastIndexOf("."),ge=ee>-1&&Ee.substring(ee+1,Ee.length);if(ge)return gt.findModeByExtension(ge)},gt.findModeByName=function(Ee){Ee=Ee.toLowerCase();for(var he=0;he<gt.modeInfo.length;he++){var Dt=gt.modeInfo[he];if(Dt.name.toLowerCase()==Ee)return Dt;if(Dt.alias){for(var ee=0;ee<Dt.alias.length;ee++)if(Dt.alias[ee].toLowerCase()==Ee)return Dt}}}})},67549:function(Mn,Rn,kt){(function(gt){gt(kt(89780))})(function(gt){"use strict";gt.defineMode("stex",function(Ut,ue){"use strict";function Ee(Bt,nt){Bt.cmdState.push(nt)}function he(Bt){return Bt.cmdState.length>0?Bt.cmdState[Bt.cmdState.length-1]:null}function Dt(Bt){var nt=Bt.cmdState.pop();nt&&nt.closeBracket()}function ee(Bt){for(var nt=Bt.cmdState,et=nt.length-1;et>=0;et--){var ht=nt[et];if(ht.name!="DEFAULT")return ht}return{styleIdentifier:function(){return null}}}function ge(Bt,nt,et){return function(){this.name=Bt,this.bracketNo=0,this.style=nt,this.styles=et,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var Qt={};Qt.importmodule=ge("importmodule","tag",["string","builtin"]),Qt.documentclass=ge("documentclass","tag",["","atom"]),Qt.usepackage=ge("usepackage","tag",["atom"]),Qt.begin=ge("begin","tag",["atom"]),Qt.end=ge("end","tag",["atom"]),Qt.label=ge("label","tag",["atom"]),Qt.ref=ge("ref","tag",["atom"]),Qt.eqref=ge("eqref","tag",["atom"]),Qt.cite=ge("cite","tag",["atom"]),Qt.bibitem=ge("bibitem","tag",["atom"]),Qt.Bibitem=ge("Bibitem","tag",["atom"]),Qt.RBibitem=ge("RBibitem","tag",["atom"]),Qt.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function jt(Bt,nt){Bt.f=nt}function Ae(Bt,nt){var et;if(Bt.match(/^\\[a-zA-Z@]+/)){var ht=Bt.current().slice(1);return et=Qt.hasOwnProperty(ht)?Qt[ht]:Qt.DEFAULT,et=new et,Ee(nt,et),jt(nt,Pe),et.style}if(Bt.match(/^\\[$&%#{}_]/)||Bt.match(/^\\[,;!\/\\]/))return"tag";if(Bt.match("\\["))return jt(nt,function(pt,vt){return se(pt,vt,"\\]")}),"keyword";if(Bt.match("\\("))return jt(nt,function(pt,vt){return se(pt,vt,"\\)")}),"keyword";if(Bt.match("$$"))return jt(nt,function(pt,vt){return se(pt,vt,"$$")}),"keyword";if(Bt.match("$"))return jt(nt,function(pt,vt){return se(pt,vt,"$")}),"keyword";var st=Bt.next();if(st=="%")return Bt.skipToEnd(),"comment";if(st=="}"||st=="]"){if(et=he(nt),et)et.closeBracket(st),jt(nt,Pe);else return"error";return"bracket"}else return st=="{"||st=="["?(et=Qt.DEFAULT,et=new et,Ee(nt,et),"bracket"):/\d/.test(st)?(Bt.eatWhile(/[\w.%]/),"atom"):(Bt.eatWhile(/[\w\-_]/),et=ee(nt),et.name=="begin"&&(et.argument=Bt.current()),et.styleIdentifier())}function se(Bt,nt,et){if(Bt.eatSpace())return null;if(et&&Bt.match(et))return jt(nt,Ae),"keyword";if(Bt.match(/^\\[a-zA-Z@]+/))return"tag";if(Bt.match(/^[a-zA-Z]+/))return"variable-2";if(Bt.match(/^\\[$&%#{}_]/)||Bt.match(/^\\[,;!\/]/)||Bt.match(/^[\^_&]/))return"tag";if(Bt.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Bt.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var ht=Bt.next();return ht=="{"||ht=="}"||ht=="["||ht=="]"||ht=="("||ht==")"?"bracket":ht=="%"?(Bt.skipToEnd(),"comment"):"error"}function Pe(Bt,nt){var et=Bt.peek(),ht;return et=="{"||et=="["?(ht=he(nt),ht.openBracket(et),Bt.eat(et),jt(nt,Ae),"bracket"):/[ \t\r]/.test(et)?(Bt.eat(et),null):(jt(nt,Ae),Dt(nt),Ae(Bt,nt))}return{startState:function(){var Bt=ue.inMathMode?function(nt,et){return se(nt,et)}:Ae;return{cmdState:[],f:Bt}},copyState:function(Bt){return{cmdState:Bt.cmdState.slice(),f:Bt.f}},token:function(Bt,nt){return nt.f(Bt,nt)},blankLine:function(Bt){Bt.f=Ae,Bt.cmdState.length=0},lineComment:"%"}}),gt.defineMIME("text/x-stex","stex"),gt.defineMIME("text/x-latex","stex")})},15525:function(Mn,Rn,kt){(function(gt){gt(kt(89780))})(function(gt){"use strict";var Ut={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},ue={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};gt.defineMode("xml",function(Ee,he){var Dt=Ee.indentUnit,ee={},ge=he.htmlMode?Ut:ue;for(var Qt in ge)ee[Qt]=ge[Qt];for(var Qt in he)ee[Qt]=he[Qt];var jt,Ae;function se(re,Ne){function ye(je){return Ne.tokenize=je,je(re,Ne)}var xe=re.next();if(xe=="<")return re.eat("!")?re.eat("[")?re.match("CDATA[")?ye(nt("atom","]]>")):null:re.match("--")?ye(nt("comment","-->")):re.match("DOCTYPE",!0,!0)?(re.eatWhile(/[\w\._\-]/),ye(et(1))):null:re.eat("?")?(re.eatWhile(/[\w\._\-]/),Ne.tokenize=nt("meta","?>"),"meta"):(jt=re.eat("/")?"closeTag":"openTag",Ne.tokenize=Pe,"tag bracket");if(xe=="&"){var Ue;return re.eat("#")?re.eat("x")?Ue=re.eatWhile(/[a-fA-F\d]/)&&re.eat(";"):Ue=re.eatWhile(/[\d]/)&&re.eat(";"):Ue=re.eatWhile(/[\w\.\-:]/)&&re.eat(";"),Ue?"atom":"error"}else return re.eatWhile(/[^&<]/),null}se.isInText=!0;function Pe(re,Ne){var ye=re.next();if(ye==">"||ye=="/"&&re.eat(">"))return Ne.tokenize=se,jt=ye==">"?"endTag":"selfcloseTag","tag bracket";if(ye=="=")return jt="equals",null;if(ye=="<"){Ne.tokenize=se,Ne.state=vt,Ne.tagName=Ne.tagStart=null;var xe=Ne.tokenize(re,Ne);return xe?xe+" tag error":"tag error"}else return/[\'\"]/.test(ye)?(Ne.tokenize=Bt(ye),Ne.stringStartCol=re.column(),Ne.tokenize(re,Ne)):(re.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Bt(re){var Ne=function(ye,xe){for(;!ye.eol();)if(ye.next()==re){xe.tokenize=Pe;break}return"string"};return Ne.isInAttribute=!0,Ne}function nt(re,Ne){return function(ye,xe){for(;!ye.eol();){if(ye.match(Ne)){xe.tokenize=se;break}ye.next()}return re}}function et(re){return function(Ne,ye){for(var xe;(xe=Ne.next())!=null;){if(xe=="<")return ye.tokenize=et(re+1),ye.tokenize(Ne,ye);if(xe==">")if(re==1){ye.tokenize=se;break}else return ye.tokenize=et(re-1),ye.tokenize(Ne,ye)}return"meta"}}function ht(re,Ne,ye){this.prev=re.context,this.tagName=Ne,this.indent=re.indented,this.startOfLine=ye,(ee.doNotIndent.hasOwnProperty(Ne)||re.context&&re.context.noIndent)&&(this.noIndent=!0)}function st(re){re.context&&(re.context=re.context.prev)}function pt(re,Ne){for(var ye;;){if(!re.context||(ye=re.context.tagName,!ee.contextGrabbers.hasOwnProperty(ye)||!ee.contextGrabbers[ye].hasOwnProperty(Ne)))return;st(re)}}function vt(re,Ne,ye){return re=="openTag"?(ye.tagStart=Ne.column(),St):re=="closeTag"?Et:vt}function St(re,Ne,ye){return re=="word"?(ye.tagName=Ne.current(),Ae="tag",qt):ee.allowMissingTagName&&re=="endTag"?(Ae="tag bracket",qt(re,Ne,ye)):(Ae="error",St)}function Et(re,Ne,ye){if(re=="word"){var xe=Ne.current();return ye.context&&ye.context.tagName!=xe&&ee.implicitlyClosed.hasOwnProperty(ye.context.tagName)&&st(ye),ye.context&&ye.context.tagName==xe||ee.matchClosing===!1?(Ae="tag",Tt):(Ae="tag error",It)}else return ee.allowMissingTagName&&re=="endTag"?(Ae="tag bracket",Tt(re,Ne,ye)):(Ae="error",It)}function Tt(re,Ne,ye){return re!="endTag"?(Ae="error",Tt):(st(ye),vt)}function It(re,Ne,ye){return Ae="error",Tt(re,Ne,ye)}function qt(re,Ne,ye){if(re=="word")return Ae="attribute",Xt;if(re=="endTag"||re=="selfcloseTag"){var xe=ye.tagName,Ue=ye.tagStart;return ye.tagName=ye.tagStart=null,re=="selfcloseTag"||ee.autoSelfClosers.hasOwnProperty(xe)?pt(ye,xe):(pt(ye,xe),ye.context=new ht(ye,xe,Ue==ye.indented)),vt}return Ae="error",qt}function Xt(re,Ne,ye){return re=="equals"?Ht:(ee.allowMissing||(Ae="error"),qt(re,Ne,ye))}function Ht(re,Ne,ye){return re=="string"?pe:re=="word"&&ee.allowUnquoted?(Ae="string",qt):(Ae="error",qt(re,Ne,ye))}function pe(re,Ne,ye){return re=="string"?pe:qt(re,Ne,ye)}return{startState:function(re){var Ne={tokenize:se,state:vt,indented:re||0,tagName:null,tagStart:null,context:null};return re!=null&&(Ne.baseIndent=re),Ne},token:function(re,Ne){if(!Ne.tagName&&re.sol()&&(Ne.indented=re.indentation()),re.eatSpace())return null;jt=null;var ye=Ne.tokenize(re,Ne);return(ye||jt)&&ye!="comment"&&(Ae=null,Ne.state=Ne.state(jt||ye,re,Ne),Ae&&(ye=Ae=="error"?ye+" error":Ae)),ye},indent:function(re,Ne,ye){var xe=re.context;if(re.tokenize.isInAttribute)return re.tagStart==re.indented?re.stringStartCol+1:re.indented+Dt;if(xe&&xe.noIndent)return gt.Pass;if(re.tokenize!=Pe&&re.tokenize!=se)return ye?ye.match(/^(\s*)/)[0].length:0;if(re.tagName)return ee.multilineTagIndentPastTag!==!1?re.tagStart+re.tagName.length+2:re.tagStart+Dt*(ee.multilineTagIndentFactor||1);if(ee.alignCDATA&&/<!\[CDATA\[/.test(Ne))return 0;var Ue=Ne&&/^<(\/)?([\w_:\.-]*)/.exec(Ne);if(Ue&&Ue[1])for(;xe;)if(xe.tagName==Ue[2]){xe=xe.prev;break}else if(ee.implicitlyClosed.hasOwnProperty(xe.tagName))xe=xe.prev;else break;else if(Ue)for(;xe;){var je=ee.contextGrabbers[xe.tagName];if(je&&je.hasOwnProperty(Ue[2]))xe=xe.prev;else break}for(;xe&&xe.prev&&!xe.startOfLine;)xe=xe.prev;return xe?xe.indent+Dt:re.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:ee.htmlMode?"html":"xml",helperType:ee.htmlMode?"html":"xml",skipAttribute:function(re){re.state==Ht&&(re.state=qt)},xmlCurrentTag:function(re){return re.tagName?{name:re.tagName,close:re.type=="closeTag"}:null},xmlCurrentContext:function(re){for(var Ne=[],ye=re.context;ye;ye=ye.prev)ye.tagName&&Ne.push(ye.tagName);return Ne.reverse()}}}),gt.defineMIME("text/xml","xml"),gt.defineMIME("application/xml","xml"),gt.mimeModes.hasOwnProperty("text/html")||gt.defineMIME("text/html",{name:"xml",htmlMode:!0})})},12378:function(Mn,Rn,kt){"use strict";kt.d(Rn,{$u:function(){return Qt},BD:function(){return Rt},E9:function(){return ge},FF:function(){return Bn},FJ:function(){return vt},Hn:function(){return pt},KX:function(){return Et},NB:function(){return we},S0:function(){return ne},UL:function(){return jt},Vk:function(){return st},Vm:function(){return Fe},YI:function(){return wn},ZA:function(){return ue},Zt:function(){return Ae},al:function(){return Mt},bn:function(){return Zt},bx:function(){return Lt},g2:function(){return fi},h1:function(){return Ht},hD:function(){return rn},l4:function(){return Dt},rU:function(){return Ce},s_:function(){return Pt},uz:function(){return Ke},z6:function(){return se}}),Mn=kt.hmd(Mn),function(){var wt;function Ye(a){var y=0;return function(){return y<a.length?{done:!1,value:a[y++]}:{done:!0}}}function Zn(a){var y=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];return y?y.call(a):{next:Ye(a)}}function Ln(a){for(var y,x=[];!(y=a.next()).done;)x.push(y.value);return x}var zn=typeof Object.create=="function"?Object.create:function(a){function y(){}return y.prototype=a,new y},oi;if(typeof Object.setPrototypeOf=="function")oi=Object.setPrototypeOf;else{var Si;t:{var Yi={a:!0},Fi={};try{Fi.__proto__=Yi,Si=Fi.a;break t}catch(a){}Si=!1}oi=Si?function(a,y){if(a.__proto__=y,a.__proto__!==y)throw new TypeError(a+" is not extensible");return a}:null}var ve=oi;function Le(a,y){if(a.prototype=zn(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 Se=typeof kt.g!="undefined"&&kt.g!=null?kt.g:self,ti=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},Yn=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,y,x){a!=Array.prototype&&a!=Object.prototype&&(a[y]=x.value)};function Wn(a,y){if(y){var x=Se;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&&Yn(x,a,{writable:!0,value:y})}}Wn("Object.assign",function(a){return a||ti}),Wn("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 qe=typeof globalThis=="object"&&globalThis||typeof kt.g=="object"&&kt.g.global===kt.g&&kt.g||typeof self=="object"&&self.self===self&&self||{};qe.requestAnimationFrame===void 0&&(qe.setImmediate===void 0?qe.requestAnimationFrame=function(a){qe.setTimeout(a,0)}:qe.requestAnimationFrame=qe.setImmediate);function Dn(){}function ki(a,y){var x=-1;return function(){var E=this,b=arguments;x!==-1&&qe.clearTimeout(x),x=Di(function(){x=-1,a.apply(E,b)},y)}}function Di(a,y){return qe.setTimeout(a,y)}function Ki(a){return qe.document.createElement(a)}function Gt(a){throw Error(a)}function me(a,y){a="The object is frozen, so its properties cannot be set: "+a.toString(),y!==void 0&&(a+=" to value: "+y),Gt(a)}function En(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),Gt(x+" is not in the range "+y+": "+a)}function Gn(a){qe.console&&qe.console.log(a)}function Re(a){return typeof a=="object"&&a!==null}function $e(a){return Array.isArray(a)||qe.NodeList&&a instanceof qe.NodeList||qe.HTMLCollection&&a instanceof qe.HTMLCollection}function Nn(a){return Array.prototype.slice.call(a)}function _n(a,y,x){Array.isArray(a)?y>=a.length?a.push(x):a.splice(y,0,x):Gt("Cannot insert an object into an HTMLCollection or NodeList: "+x+" at "+y)}function di(a,y){Array.isArray(a)?y>=a.length?a.pop():a.splice(y,1):Gt("Cannot remove an object from an HTMLCollection or NodeList at "+y)}function Jn(){var a=ro.pop();return a===void 0?[]:a}function li(a){a.length=0,ro.push(a)}function ni(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(Re(a)&&a.constructor)return ni(a.constructor);return typeof a}function ji(a){var y=a;return Re(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 Oi(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 Ii(a,y,x){Object.defineProperty(Ar.prototype,a,{get:y,set:x})}function Ve(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 vr=qe.navigator!==void 0&&0<qe.navigator.userAgent.indexOf("Trident/7"),Mr=qe.navigator!==void 0&&qe.navigator.platform!==void 0&&qe.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,ro=[];Object.freeze([]),Dn.className="Util",Dn.Dx="32ab5ff3b26f42dc0ed90f21472913b5",Dn.adym="gojs.net",Dn.vfo="28e645fdb266",Dn.className="Util";function en(a,y,x){Wi(this),this.j=a,this.xa=y,this.o=x}en.prototype.toString=function(){return"EnumValue."+this.xa};function Tn(a,y){return y==null||y===""?null:a[y]}Se.Object.defineProperties(en.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),en.className="EnumValue";function Bi(){this.ew=[]}Bi.prototype.toString=function(){return this.ew.join("")},Bi.prototype.add=function(a){a!==""&&this.ew.push(a)},Bi.className="StringBuilder";function bi(){}bi.className="PropertyCollection";var _i={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(a){qe.console&&qe.console.log(a)},HA:function(a,y,x,E){a.strokeStyle="red",a.fillStyle="red",a.font="8px sans-serif",a.beginPath(),a.moveTo(-10,0),a.lineTo(10,0),a.moveTo(0,-10),a.lineTo(0,10),a.stroke(),a.setTransform(1,0,0,1,0,0),a.scale(x,x),a.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),a.lineWidth=2,a.beginPath(),a.moveTo(E.left,E.top+20),a.lineTo(E.left,E.top),a.lineTo(E.left+20,E.top),a.moveTo(E.right,E.bottom-20),a.lineTo(E.right,E.bottom),a.lineTo(E.right-20,E.bottom),a.stroke(),a.fillText("DB: "+Math.round(E.x)+", "+Math.round(E.y)+", "+Math.round(E.width)+", "+Math.round(E.height),E.left,E.top-5)},DA:function(a){var y={},x;for(x in a){if(y.x=x,y.x!=="licenseKey"){var E=a[y.x];if(E.prototype!==void 0){y.Zl=Object.getOwnPropertyNames(E.prototype);for(var b={Tj:0};b.Tj<y.Zl.length;b={Tj:b.Tj},b.Tj++){var z=Object.getOwnPropertyDescriptor(E.prototype,y.Zl[b.Tj]);z.get!==void 0&&z.set===void 0&&Object.defineProperty(E.prototype,y.Zl[b.Tj],{set:function(tt,rt){return function(){throw Error("Property "+tt.Zl[rt.Tj]+" of "+tt.x+" is read-only.")}}(y,b)})}}}y={Zl:y.Zl,x:y.x}}}};function ir(){}ir.prototype.reset=function(){},ir.prototype.next=function(){return!1},ir.prototype.Ad=function(){return!1},ir.prototype.first=function(){return null},ir.prototype.any=function(){return!1},ir.prototype.all=function(){return!0},ir.prototype.each=function(){return this},ir.prototype.map=function(){return this},ir.prototype.filter=function(){return this},ir.prototype.de=function(){},ir.prototype.toString=function(){return"EmptyIterator"},Se.Object.defineProperties(ir.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),ir.prototype.first=ir.prototype.first,ir.prototype.hasNext=ir.prototype.Ad,ir.prototype.next=ir.prototype.next,ir.prototype.reset=ir.prototype.reset;var yr=null;ir.className="EmptyIterator",yr=new ir;function Nr(a){this.key=-1,this.value=a}Nr.prototype.reset=function(){this.key=-1},Nr.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},Nr.prototype.Ad=function(){return this.next()},Nr.prototype.first=function(){return this.key=0,this.value},Nr.prototype.any=function(a){return this.key=-1,a(this.value)},Nr.prototype.all=function(a){return this.key=-1,a(this.value)},Nr.prototype.each=function(a){return this.key=-1,a(this.value),this},Nr.prototype.map=function(a){return new Nr(a(this.value))},Nr.prototype.filter=function(a){return a(this.value)?new Nr(this.value):yr},Nr.prototype.de=function(){this.value=null},Nr.prototype.toString=function(){return"SingletonIterator("+this.value+")"},Se.Object.defineProperties(Nr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),Nr.prototype.first=Nr.prototype.first,Nr.prototype.hasNext=Nr.prototype.Ad,Nr.prototype.next=Nr.prototype.next,Nr.prototype.reset=Nr.prototype.reset,Nr.className="SingletonIterator";function _r(a){this.Bb=a,this.qf=null,a.Sa=null,this.qa=a.Ja,this.Za=-1}_r.prototype.reset=function(){var a=this.Bb;a.Sa=null,this.qa=a.Ja,this.Za=-1},_r.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},_r.prototype.Ad=function(){return this.next()},_r.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},_r.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},_r.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},_r.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},_r.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 cn,a.s=x,a.xb(),a.iterator},_r.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 cn,a.s=x,a.xb(),a.iterator},_r.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},_r.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},Se.Object.defineProperties(_r.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}}}),_r.prototype.first=_r.prototype.first,_r.prototype.hasNext=_r.prototype.Ad,_r.prototype.next=_r.prototype.next,_r.prototype.reset=_r.prototype.reset,_r.className="ListIterator";function Rr(a){this.Bb=a,a.Hg=null,this.qa=a.Ja,this.Za=a.s.length}Rr.prototype.reset=function(){var a=this.Bb;a.Hg=null,this.qa=a.Ja,this.Za=a.s.length},Rr.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)},Rr.prototype.Ad=function(){return this.next()},Rr.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},Rr.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},Rr.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},Rr.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},Rr.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 cn,a.s=x,a.xb(),a.iterator},Rr.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 cn,a.s=x,a.xb(),a.iterator},Rr.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},Rr.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},Se.Object.defineProperties(Rr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),Rr.prototype.first=Rr.prototype.first,Rr.prototype.hasNext=Rr.prototype.Ad,Rr.prototype.next=Rr.prototype.next,Rr.prototype.reset=Rr.prototype.reset,Rr.className="ListIteratorBackwards";function cn(a){Wi(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof a=="string"&&Gt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}wt=cn.prototype,wt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.toString=function(){return"List()#"+zi(this)},wt.add=function(a){return a===null?this:(this._isFrozen&&me(this,a),this.s.push(a),this.xb(),this)},wt.push=function(a){this.add(a)},wt.addAll=function(a){if(a===null)return this;this._isFrozen&&me(this);var y=this.s;if($e(a))for(var x=a.length,E=0;E<x;E++)y.push(a[E]);else for(a=a.iterator;a.next();)y.push(a.value);return this.xb(),this},wt.clear=function(){this._isFrozen&&me(this),this.s.length=0,this.xb()},wt.contains=function(a){return a===null?!1:this.s.indexOf(a)!==-1},wt.has=function(a){return this.contains(a)},wt.indexOf=function(a){return a===null?-1:this.s.indexOf(a)},wt.M=function(a){var y=this.s;return(0>a||a>=y.length)&&En(a,"0 <= i < length",cn,"elt:i"),y[a]},wt.get=function(a){return this.M(a)},wt.cd=function(a,y){var x=this.s;(0>a||a>=x.length)&&En(a,"0 <= i < length",cn,"setElt:i"),this._isFrozen&&me(this,a),x[a]=y},wt.set=function(a,y){this.cd(a,y)},wt.first=function(){var a=this.s;return a.length===0?null:a[0]},wt.jc=function(){var a=this.s,y=a.length;return 0<y?a[y-1]:null},wt.pop=function(){this._isFrozen&&me(this);var a=this.s;return 0<a.length?a.pop():null},cn.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},cn.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},cn.prototype.each=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)a(y[E]);return this},cn.prototype.map=function(a){for(var y=new cn,x=[],E=this.s,b=E.length,z=0;z<b;z++)x.push(a(E[z]));return y.s=x,y.xb(),y},cn.prototype.filter=function(a){for(var y=new cn,x=[],E=this.s,b=E.length,z=0;z<b;z++){var tt=E[z];a(tt)&&x.push(tt)}return y.s=x,y.xb(),y},wt=cn.prototype,wt.Gb=function(a,y){0>a&&En(a,">= 0",cn,"insertAt:i"),this._isFrozen&&me(this,a);var x=this.s;a>=x.length?x.push(y):x.splice(a,0,y),this.xb()},wt.remove=function(a){if(a===null)return!1;this._isFrozen&&me(this,a);var y=this.s;return a=y.indexOf(a),a===-1?!1:(a===y.length-1?y.pop():y.splice(a,1),this.xb(),!0)},wt.delete=function(a){return this.remove(a)},wt.mb=function(a){var y=this.s;(0>a||a>=y.length)&&En(a,"0 <= i < length",cn,"removeAt:i"),this._isFrozen&&me(this,a),a===y.length-1?y.pop():y.splice(a,1),this.xb()},wt.removeRange=function(a,y){var x=this.s,E=x.length;if(0>a)a=0;else if(a>=E)return this;if(0>y)return this;if(y>=E&&(y=E-1),a>y)return this;this._isFrozen&&me(this);for(var b=a,z=y+1;z<E;)x[b++]=x[z++];return x.length=E-(y-a+1),this.xb(),this},cn.prototype.copy=function(){var a=new cn,y=this.s;return 0<y.length&&(a.s=Array.prototype.slice.call(y)),a},wt=cn.prototype,wt.Fa=function(){for(var a=this.s,y=this.count,x=Array(y),E=0;E<y;E++)x[E]=a[E];return x},wt.Iv=function(){for(var a=new gn,y=this.s,x=this.count,E=0;E<x;E++)a.add(y[E]);return a},wt.sort=function(a){return this._isFrozen&&me(this),this.s.sort(a),this.xb(),this},wt.zi=function(a,y,x){var E=this.s,b=E.length;y===void 0&&(y=0),x===void 0&&(x=b),this._isFrozen&&me(this);var z=x-y;if(1>=z)return this;if((0>y||y>=b-1)&&En(y,"0 <= from < length",cn,"sortRange:from"),z===2)return x=E[y],b=E[y+1],0<a(x,b)&&(E[y]=b,E[y+1]=x,this.xb()),this;if(y===0)if(x>=b)E.sort(a);else for(y=E.slice(0,x),y.sort(a),a=0;a<x;a++)E[a]=y[a];else if(x>=b)for(x=E.slice(y),x.sort(a),a=y;a<b;a++)E[a]=x[a-y];else for(b=E.slice(y,x),b.sort(a),a=y;a<x;a++)E[a]=b[a-y];return this.xb(),this},wt.reverse=function(){return this._isFrozen&&me(this),this.s.reverse(),this.xb(),this},Se.Object.defineProperties(cn.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 yr;var a=this.Sa;return a!==null?(a.reset(),a):new _r(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return yr;var a=this.Hg;return a!==null?(a.reset(),a):new Rr(this)}}}),cn.prototype.reverse=cn.prototype.reverse,cn.prototype.sortRange=cn.prototype.zi,cn.prototype.sort=cn.prototype.sort,cn.prototype.toSet=cn.prototype.Iv,cn.prototype.toArray=cn.prototype.Fa,cn.prototype.removeRange=cn.prototype.removeRange,cn.prototype.removeAt=cn.prototype.mb,cn.prototype.delete=cn.prototype.delete,cn.prototype.remove=cn.prototype.remove,cn.prototype.insertAt=cn.prototype.Gb,cn.prototype.pop=cn.prototype.pop,cn.prototype.last=cn.prototype.jc,cn.prototype.first=cn.prototype.first,cn.prototype.set=cn.prototype.set,cn.prototype.setElt=cn.prototype.cd,cn.prototype.get=cn.prototype.get,cn.prototype.elt=cn.prototype.M,cn.prototype.indexOf=cn.prototype.indexOf,cn.prototype.has=cn.prototype.has,cn.prototype.contains=cn.prototype.contains,cn.prototype.clear=cn.prototype.clear,cn.prototype.addAll=cn.prototype.addAll,cn.prototype.push=cn.prototype.push,cn.prototype.add=cn.prototype.add,cn.prototype.thaw=cn.prototype.ka,cn.prototype.freeze=cn.prototype.freeze,cn.className="List";function ho(a){this.eg=a,a.Sa=null,this.qa=a.Ja,this.sa=null}ho.prototype.reset=function(){var a=this.eg;a.Sa=null,this.qa=a.Ja,this.sa=null},ho.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)},ho.prototype.Ad=function(){return this.next()},ho.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},ho.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},ho.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},ho.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},ho.prototype.map=function(a){var y=this.eg;y.Sa=null;var x=new cn;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},ho.prototype.filter=function(a){var y=this.eg;y.Sa=null;var x=new cn;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},ho.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},ho.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},Se.Object.defineProperties(ho.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),ho.prototype.first=ho.prototype.first,ho.prototype.hasNext=ho.prototype.Ad,ho.prototype.next=ho.prototype.next,ho.prototype.reset=ho.prototype.reset,ho.className="SetIterator";function gn(a){Wi(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&Gt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}wt=gn.prototype,wt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.toString=function(){return"Set()#"+zi(this)},wt.add=function(a){if(a===null)return this;this._isFrozen&&me(this,a);var y=a;return Re(a)&&(y=Kr(a)),this.Tb[y]===void 0&&(this.Sb++,a=new _e(a,a),this.Tb[y]=a,y=this.kf,y===null?this.ea=a:(a.ll=y,y.va=a),this.kf=a,this.xb()),this},wt.addAll=function(a){if(a===null)return this;if(this._isFrozen&&me(this),$e(a))for(var y=a.length,x=0;x<y;x++)this.add(a[x]);else for(a=a.iterator;a.next();)this.add(a.value);return this},wt.contains=function(a){if(a===null)return!1;var y=a;return Re(a)&&(y=zi(a),y===void 0)?!1:this.Tb[y]!==void 0},wt.has=function(a){return this.contains(a)},wt.Sy=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0},wt.Ty=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1},wt.first=function(){var a=this.ea;return a===null?null:a.value},gn.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},gn.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},gn.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y.value),y=y.va;return this},gn.prototype.map=function(a){for(var y=new gn,x=this.ea;x!==null;)y.add(a(x.value)),x=x.va;return y},gn.prototype.filter=function(a){for(var y=new gn,x=this.ea;x!==null;){var E=x.value;a(E)&&y.add(E),x=x.va}return y},wt=gn.prototype,wt.remove=function(a){if(a===null)return!1;this._isFrozen&&me(this,a);var y=a;if(Re(a)&&(y=zi(a),y===void 0)||(a=this.Tb[y],a===void 0))return!1;var x=a.va,E=a.ll;return x!==null&&(x.ll=E),E!==null&&(E.va=x),this.ea===a&&(this.ea=x),this.kf===a&&(this.kf=E),delete this.Tb[y],this.Sb--,this.xb(),!0},wt.delete=function(a){return this.remove(a)},wt.hp=function(a){if(a===null)return this;if(this._isFrozen&&me(this),$e(a))for(var y=a.length,x=0;x<y;x++)this.remove(a[x]);else for(a=a.iterator;a.next();)this.remove(a.value);return this},wt.pA=function(a){if(a===null||this.count===0)return this;this._isFrozen&&me(this);var y=new gn;y.addAll(a),a=[];for(var x=this.iterator;x.next();){var E=x.value;y.contains(E)||a.push(E)}return this.hp(a),this},wt.clear=function(){this._isFrozen&&me(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},gn.prototype.copy=function(){var a=new gn,y=this.Tb,x;for(x in y)a.add(y[x].value);return a},gn.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},gn.prototype.Hv=function(){var a=new cn,y=this.Tb,x;for(x in y)a.add(y[x].value);return a};function Wi(a){a.__gohashid=wo++}function Kr(a){var y=a.__gohashid;return y===void 0&&(y=wo++,a.__gohashid=y),y}function zi(a){return a.__gohashid}Se.Object.defineProperties(gn.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return yr;var a=this.Sa;return a!==null?(a.reset(),a):new ho(this)}}}),gn.prototype.toList=gn.prototype.Hv,gn.prototype.toArray=gn.prototype.Fa,gn.prototype.clear=gn.prototype.clear,gn.prototype.retainAll=gn.prototype.pA,gn.prototype.removeAll=gn.prototype.hp,gn.prototype.delete=gn.prototype.delete,gn.prototype.remove=gn.prototype.remove,gn.prototype.first=gn.prototype.first,gn.prototype.containsAny=gn.prototype.Ty,gn.prototype.containsAll=gn.prototype.Sy,gn.prototype.has=gn.prototype.has,gn.prototype.contains=gn.prototype.contains,gn.prototype.addAll=gn.prototype.addAll,gn.prototype.add=gn.prototype.add,gn.prototype.thaw=gn.prototype.ka,gn.prototype.freeze=gn.prototype.freeze;var wo=1;gn.className="Set",gn.uniqueHash=Wi,gn.hashIdUnique=Kr,gn.hashId=zi;function Yr(a){this.ma=a,this.qa=a.Ja,this.sa=null}Yr.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},Yr.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)},Yr.prototype.Ad=function(){return this.next()},Yr.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},Yr.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},Yr.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},Yr.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},Yr.prototype.map=function(a){var y=this.ma;this.sa=null;var x=new cn;for(y=y.ea;y!==null;)x.add(a(y.key)),y=y.va;return x.iterator},Yr.prototype.filter=function(a){var y=this.ma;this.sa=null;var x=new cn;for(y=y.ea;y!==null;){var E=y.key;a(E)&&x.add(E),y=y.va}return x.iterator},Yr.prototype.de=function(){this.value=this.key=null,this.qa=-1},Yr.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},Se.Object.defineProperties(Yr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Yr.prototype.first=Yr.prototype.first,Yr.prototype.hasNext=Yr.prototype.Ad,Yr.prototype.next=Yr.prototype.next,Yr.prototype.reset=Yr.prototype.reset,Yr.className="MapKeySetIterator";function Er(a){gn.call(this),Wi(this),this._isFrozen=!0,this.ma=a}Le(Er,gn),wt=Er.prototype,wt.freeze=function(){return this},wt.ka=function(){return this},wt.toString=function(){return"MapKeySet("+this.ma.toString()+")"},wt.add=function(){Gt("This Set is read-only: "+this.toString())},wt.contains=function(a){return this.ma.contains(a)},wt.has=function(a){return this.contains(a)},wt.remove=function(){Gt("This Set is read-only: "+this.toString())},wt.delete=function(a){return this.remove(a)},wt.clear=function(){Gt("This Set is read-only: "+this.toString())},wt.first=function(){var a=this.ma.ea;return a!==null?a.key:null},Er.prototype.any=function(a){for(var y=this.ma.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},Er.prototype.all=function(a){for(var y=this.ma.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},Er.prototype.each=function(a){for(var y=this.ma.ea;y!==null;)a(y.key),y=y.va;return this},Er.prototype.map=function(a){for(var y=new gn,x=this.ma.ea;x!==null;)y.add(a(x.key)),x=x.va;return y},Er.prototype.filter=function(a){for(var y=new gn,x=this.ma.ea;x!==null;){var E=x.key;a(E)&&y.add(E),x=x.va}return y},Er.prototype.copy=function(){return new Er(this.ma)},Er.prototype.Iv=function(){var a=new gn,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},Er.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},Er.prototype.Hv=function(){var a=new cn,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},Se.Object.defineProperties(Er.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?yr:new Yr(this.ma)}}}),Er.prototype.toList=Er.prototype.Hv,Er.prototype.toArray=Er.prototype.Fa,Er.prototype.toSet=Er.prototype.Iv,Er.prototype.first=Er.prototype.first,Er.prototype.clear=Er.prototype.clear,Er.prototype.delete=Er.prototype.delete,Er.prototype.remove=Er.prototype.remove,Er.prototype.has=Er.prototype.has,Er.prototype.contains=Er.prototype.contains,Er.prototype.add=Er.prototype.add,Er.prototype.thaw=Er.prototype.ka,Er.prototype.freeze=Er.prototype.freeze,Er.className="MapKeySet";function Co(a){this.ma=a,a.jf=null,this.qa=a.Ja,this.sa=null}Co.prototype.reset=function(){var a=this.ma;a.jf=null,this.qa=a.Ja,this.sa=null},Co.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=y.value,this.key=y.key,!0):(this.de(),!1)},Co.prototype.Ad=function(){return this.next()},Co.prototype.first=function(){var a=this.ma;if(this.qa=a.Ja,a=a.ea,a!==null){this.sa=a;var y=a.value;return this.key=a.key,this.value=y}return null},Co.prototype.any=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},Co.prototype.all=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},Co.prototype.each=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;)a(y.value),y=y.va;return this},Co.prototype.map=function(a){var y=this.ma;this.sa=y.jf=null;var x=new cn;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},Co.prototype.filter=function(a){var y=this.ma;this.sa=y.jf=null;var x=new cn;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},Co.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},Co.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},Se.Object.defineProperties(Co.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Co.prototype.first=Co.prototype.first,Co.prototype.hasNext=Co.prototype.Ad,Co.prototype.next=Co.prototype.next,Co.prototype.reset=Co.prototype.reset,Co.className="MapValueSetIterator";function _e(a,y){this.key=a,this.value=y,this.ll=this.va=null}_e.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},_e.className="KeyValuePair";function xn(a){this.ma=a,a.Sa=null,this.qa=a.Ja,this.sa=null}xn.prototype.reset=function(){var a=this.ma;a.Sa=null,this.qa=a.Ja,this.sa=null},xn.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)},xn.prototype.Ad=function(){return this.next()},xn.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},xn.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},xn.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},xn.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},xn.prototype.map=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new cn;for(y=y.ea;y!==null;)x.add(a(y)),y=y.va;return x.iterator},xn.prototype.filter=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new cn;for(y=y.ea;y!==null;)a(y)&&x.add(y),y=y.va;return x.iterator},xn.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},xn.prototype.toString=function(){return this.sa!==null?"MapIterator@"+this.sa:"MapIterator"},Se.Object.defineProperties(xn.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),xn.prototype.first=xn.prototype.first,xn.prototype.hasNext=xn.prototype.Ad,xn.prototype.next=xn.prototype.next,xn.prototype.reset=xn.prototype.reset,xn.className="MapIterator";function Be(a){Wi(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"&&Gt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}wt=Be.prototype,wt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.toString=function(){return"Map()#"+zi(this)},wt.add=function(a,y){this._isFrozen&&me(this,a);var x=a;Re(a)&&(x=Kr(a));var E=this.Tb[x];return E===void 0?(this.Sb++,a=new _e(a,y),this.Tb[x]=a,x=this.kf,x===null?this.ea=a:(a.ll=x,x.va=a),this.kf=a,this.xb()):E.value=y,this},wt.set=function(a,y){return this.add(a,y)},wt.addAll=function(a){if(a===null)return this;if($e(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 Be)for(a=a.iterator;a.next();)this.add(a.key,a.value);else for(a=a.iterator;a.next();)y=a.value,this.add(y.key,y.value);return this},wt.first=function(){return this.ea},Be.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},Be.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},Be.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y),y=y.va;return this},Be.prototype.map=function(a){for(var y=new Be,x=this.ea;x!==null;)y.add(x.key,a(x)),x=x.va;return y},Be.prototype.filter=function(a){for(var y=new Be,x=this.ea;x!==null;)a(x)&&y.add(x.key,x.value),x=x.va;return y},wt=Be.prototype,wt.contains=function(a){var y=a;return Re(a)&&(y=zi(a),y===void 0)?!1:this.Tb[y]!==void 0},wt.has=function(a){return this.contains(a)},wt.I=function(a){var y=a;return Re(a)&&(y=zi(a),y===void 0)?null:(a=this.Tb[y],a===void 0?null:a.value)},wt.get=function(a){return this.I(a)},wt.remove=function(a){if(a===null)return!1;this._isFrozen&&me(this,a);var y=a;if(Re(a)&&(y=zi(a),y===void 0)||(a=this.Tb[y],a===void 0))return!1;var x=a.va,E=a.ll;return x!==null&&(x.ll=E),E!==null&&(E.va=x),this.ea===a&&(this.ea=x),this.kf===a&&(this.kf=E),delete this.Tb[y],this.Sb--,this.xb(),!0},wt.delete=function(a){return this.remove(a)},wt.clear=function(){this._isFrozen&&me(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()},Be.prototype.copy=function(){var a=new Be,y=this.Tb,x;for(x in y){var E=y[x];a.add(E.key,E.value)}return a},Be.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 _e(b.key,b.value),x++}return y},Be.prototype.Lf=function(){return new Er(this)},Se.Object.defineProperties(Be.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return yr;var a=this.Sa;return a!==null?(a.reset(),a):new xn(this)}},iteratorKeys:{get:function(){return 0>=this.count?yr:new Yr(this)}},iteratorValues:{get:function(){if(0>=this.count)return yr;var a=this.jf;return a!==null?(a.reset(),a):new Co(this)}}}),Be.prototype.toKeySet=Be.prototype.Lf,Be.prototype.toArray=Be.prototype.Fa,Be.prototype.clear=Be.prototype.clear,Be.prototype.delete=Be.prototype.delete,Be.prototype.remove=Be.prototype.remove,Be.prototype.get=Be.prototype.get,Be.prototype.getValue=Be.prototype.I,Be.prototype.has=Be.prototype.has,Be.prototype.contains=Be.prototype.contains,Be.prototype.first=Be.prototype.first,Be.prototype.addAll=Be.prototype.addAll,Be.prototype.set=Be.prototype.set,Be.prototype.add=Be.prototype.add,Be.prototype.thaw=Be.prototype.ka,Be.prototype.freeze=Be.prototype.freeze,Be.className="Map";function At(a,y){a===void 0?this.y=this.x=0:typeof a=="number"&&typeof y=="number"?(this.x=a,this.y=y):Gt("Invalid arguments to Point constructor: "+a+", "+y),this._isFrozen=!1}var jn,Qn,Li,xi,ui;At.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this},At.prototype.h=function(a,y){return this.x=a,this.y=y,this},At.prototype.sg=function(a,y){return this.x=a,this.y=y,this},At.prototype.set=function(a){return this.x=a.x,this.y=a.y,this},At.prototype.copy=function(){var a=new At;return a.x=this.x,a.y=this.y,a},wt=At.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this};function mn(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;return(E=a[y++])&&(b=parseFloat(E)),new At(x,b)}return new At}function Vn(a){return a.x.toString()+" "+a.y.toString()}wt.toString=function(){return"Point("+this.x+","+this.y+")"},wt.D=function(a){return a instanceof At?this.x===a.x&&this.y===a.y:!1},wt.hi=function(a,y){return this.x===a&&this.y===y},wt.Xa=function(a){return _t.B(this.x,a.x)&&_t.B(this.y,a.y)},wt.add=function(a){return this.x+=a.x,this.y+=a.y,this},wt.re=function(a){return this.x-=a.x,this.y-=a.y,this},wt.offset=function(a,y){return this.x+=a,this.y+=y,this},At.prototype.rotate=function(a){if(a===0)return this;var y=this.x,x=this.y;if(y===0&&x===0)return this;if(360<=a?a-=360:0>a&&(a+=360),a===90){a=0;var E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));return this.x=a*y-E*x,this.y=E*y+a*x,this},wt=At.prototype,wt.scale=function(a,y){return this.x*=a,this.y*=y,this},wt.Bf=function(a){var y=a.x-this.x;return a=a.y-this.y,y*y+a*a},wt.zd=function(a,y){return a-=this.x,y-=this.y,a*a+y*y},wt.normalize=function(){var a=this.x,y=this.y,x=Math.sqrt(a*a+y*y);return 0<x&&(this.x=a/x,this.y=y/x),this},wt.ab=function(a){return $n(a.x-this.x,a.y-this.y)},wt.direction=function(a,y){return $n(a-this.x,y-this.y)};function $n(a,y){if(a===0)return 0<y?90:0>y?270:0;if(y===0)return 0<a?0:180;if(isNaN(a)||isNaN(y))return 0;var x=180*Math.atan(Math.abs(y/a))/Math.PI;return 0>a?x=0>y?x+180:180-x:0>y&&(x=360-x),x}wt.Ry=function(a,y){return _t.Fl(a.x,a.y,y.x,y.y,this.x,this.y)},wt.fA=function(a,y,x,E){return _t.qh(a,y,x,E,this.x,this.y,this),this},wt.gA=function(a,y){return _t.qh(a.x,a.y,y.x,y.y,this.x,this.y,this),this},wt.uA=function(a,y,x,E){return _t.No(this.x,this.y,a,y,x,E,this),this},wt.vA=function(a,y){return _t.No(this.x,this.y,a.x,a.y,y.width,y.height,this),this},wt.xi=function(a,y){return this.x=a.x+y.x*a.width+y.offsetX,this.y=a.y+y.y*a.height+y.offsetY,this},wt.yi=function(a,y,x,E,b){return this.x=a+b.x*x+b.offsetX,this.y=y+b.y*E+b.offsetY,this},wt.transform=function(a){return a.Ga(this),this};function An(a,y){return y.Cd(a),a}function Un(a,y,x,E,b,z){var tt=b-x,rt=z-E,ot=tt*tt+rt*rt;x-=a,E-=y;var lt=-x*tt-E*rt;return 0>=lt||lt>=ot?(tt=b-a,rt=z-y,Math.min(x*x+E*E,tt*tt+rt*rt)):(a=tt*E-rt*x,a*a/ot)}function Ti(a,y,x,E){return a=x-a,y=E-y,a*a+y*y}function vi(a,y,x,E){return a=x-a,y=E-y,a===0?0<y?90:0>y?270:0:y===0?0<a?0:180:isNaN(a)||isNaN(y)?0:(E=180*Math.atan(Math.abs(y/a))/Math.PI,0>a?E=0>y?E+180:180-E:0>y&&(E=360-E),E)}wt.w=function(){return isFinite(this.x)&&isFinite(this.y)},At.alloc=function(){var a=ii.pop();return a===void 0?new At:a},At.allocAt=function(a,y){var x=ii.pop();return x===void 0?new At(a,y):(x.x=a,x.y=y,x)},At.free=function(a){ii.push(a)},At.prototype.isReal=At.prototype.w,At.prototype.setSpot=At.prototype.yi,At.prototype.setRectSpot=At.prototype.xi,At.prototype.snapToGridPoint=At.prototype.vA,At.prototype.snapToGrid=At.prototype.uA,At.prototype.projectOntoLineSegmentPoint=At.prototype.gA,At.prototype.projectOntoLineSegment=At.prototype.fA,At.intersectingLineSegments=function(a,y,x,E,b,z,tt,rt){return _t.Rl(a,y,x,E,b,z,tt,rt)},At.prototype.compareWithLineSegmentPoint=At.prototype.Ry,At.compareWithLineSegment=function(a,y,x,E,b,z){return _t.Fl(a,y,x,E,b,z)},At.prototype.direction=At.prototype.direction,At.prototype.directionPoint=At.prototype.ab,At.prototype.normalize=At.prototype.normalize,At.prototype.distanceSquared=At.prototype.zd,At.prototype.distanceSquaredPoint=At.prototype.Bf,At.prototype.scale=At.prototype.scale,At.prototype.rotate=At.prototype.rotate,At.prototype.offset=At.prototype.offset,At.prototype.subtract=At.prototype.re,At.prototype.add=At.prototype.add,At.prototype.equalsApprox=At.prototype.Xa,At.prototype.equalTo=At.prototype.hi,At.prototype.equals=At.prototype.D,At.prototype.set=At.prototype.set,At.prototype.setTo=At.prototype.sg;var ii=[];At.className="Point",At.parse=mn,At.stringify=Vn,At.distanceLineSegmentSquared=Un,At.distanceSquared=Ti,At.direction=vi,At.Origin=jn=new At(0,0).ja(),At.InfiniteTopLeft=Qn=new At(-1/0,-1/0).ja(),At.InfiniteBottomRight=Li=new At(1/0,1/0).ja(),At.SixPoint=xi=new At(6,6).ja(),At.NoPoint=ui=new At(NaN,NaN).ja(),At.parse=mn,At.stringify=Vn,At.distanceLineSegmentSquared=Un,At.distanceSquared=Ti,At.direction=vi;function nn(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):Gt("Invalid arguments to Size constructor: "+a+", "+y),this._isFrozen=!1}var Ni,Xi,Or,cr,oo,to,$r;nn.prototype.assign=function(a){return this.width=a.width,this.height=a.height,this},nn.prototype.h=function(a,y){return this.width=a,this.height=y,this},nn.prototype.sg=function(a,y){return this.width=a,this.height=y,this},nn.prototype.set=function(a){return this.width=a.width,this.height=a.height,this},nn.prototype.copy=function(){var a=new nn;return a.width=this.width,a.height=this.height,a},wt=nn.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this};function po(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 nn(x,b)}return new nn}function lo(a){return a.width.toString()+" "+a.height.toString()}wt.toString=function(){return"Size("+this.width+","+this.height+")"},wt.D=function(a){return a instanceof nn?this.width===a.width&&this.height===a.height:!1},wt.hi=function(a,y){return this.width===a&&this.height===y},wt.Xa=function(a){return _t.B(this.width,a.width)&&_t.B(this.height,a.height)},wt.Bc=function(a,y){return a=this.width+a,this.width=0<=a?a:0,y=this.height+y,this.height=0<=y?y:0,this},wt.w=function(){return isFinite(this.width)&&isFinite(this.height)},nn.alloc=function(){var a=Bo.pop();return a===void 0?new nn:a},nn.free=function(a){Bo.push(a)},nn.prototype.isReal=nn.prototype.w,nn.prototype.inflate=nn.prototype.Bc,nn.prototype.equalsApprox=nn.prototype.Xa,nn.prototype.equalTo=nn.prototype.hi,nn.prototype.equals=nn.prototype.D,nn.prototype.set=nn.prototype.set,nn.prototype.setTo=nn.prototype.sg;var Bo=[];nn.className="Size",nn.parse=po,nn.stringify=lo,nn.ZeroSize=Ni=new nn(0,0).ja(),nn.OneSize=Xi=new nn(1,1).ja(),nn.SixSize=Or=new nn(6,6).ja(),nn.EightSize=cr=new nn(8,8).ja(),nn.TenSize=oo=new nn(10,10).ja(),nn.InfiniteSize=to=new nn(1/0,1/0).ja(),nn.NoSize=$r=new nn(NaN,NaN).ja(),nn.parse=po,nn.stringify=lo;function Te(a,y,x,E){a===void 0?this.height=this.width=this.y=this.x=0:typeof a=="number"&&typeof y=="number"&&typeof x=="number"&&(0<=x||isNaN(x))&&typeof E=="number"&&(0<=E||isNaN(E))?(this.x=a,this.y=y,this.width=x,this.height=E):a instanceof At?(x=a.x,a=a.y,y instanceof At?(E=y.x,y=y.y,this.x=Math.min(x,E),this.y=Math.min(a,y),this.width=Math.abs(x-E),this.height=Math.abs(a-y)):y instanceof nn?(this.x=x,this.y=a,this.width=y.width,this.height=y.height):Gt("Incorrect second argument supplied to Rect constructor "+y)):Gt("Invalid arguments to Rect constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}wt=Te.prototype,wt.assign=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},wt.h=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this};function ao(a,y,x){a.width=y,a.height=x}wt.sg=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this},wt.set=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},wt.dd=function(a){return this.x=a.x,this.y=a.y,this},wt.tA=function(a){return this.width=a.width,this.height=a.height,this},Te.prototype.copy=function(){var a=new Te;return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},wt=Te.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this};function Jr(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 Te(x,b,z,tt)}return new Te}function gr(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}wt.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},wt.D=function(a){return a instanceof Te?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1},wt.hi=function(a,y,x,E){return this.x===a&&this.y===y&&this.width===x&&this.height===E},wt.Xa=function(a){return _t.B(this.x,a.x)&&_t.B(this.y,a.y)&&_t.B(this.width,a.width)&&_t.B(this.height,a.height)};function Wr(a,y){return _t.$(a.x,y.x)&&_t.$(a.y,y.y)&&_t.$(a.width,y.width)&&_t.$(a.height,y.height)}wt.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y},wt.Re=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height},wt.contains=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),this.x<=a&&a+x<=this.x+this.width&&this.y<=y&&y+E<=this.y+this.height},wt.offset=function(a,y){return this.x+=a,this.y+=y,this},wt.Bc=function(a,y){return Lr(this,y,a,y,a)},wt.Co=function(a){return Lr(this,a.top,a.right,a.bottom,a.left)},wt.Fv=function(a){return Lr(this,-a.top,-a.right,-a.bottom,-a.left)},wt.Hz=function(a,y,x,E){return Lr(this,a,y,x,E)};function Lr(a,y,x,E,b){var z=a.width;return x+b<=-z?(a.x+=z/2,a.width=0):(a.x-=b,a.width+=x+b),x=a.height,y+E<=-x?(a.y+=x/2,a.height=0):(a.y-=y,a.height+=y+E),a}wt.Ex=function(a){return Mo(this,a.x,a.y,a.width,a.height)},wt.Uu=function(a,y,x,E){return Mo(this,a,y,x,E)};function Mo(a,y,x,E,b){var z=Math.max(a.x,y),tt=Math.max(a.y,x);return y=Math.min(a.x+a.width,y+E),x=Math.min(a.y+a.height,x+b),a.x=z,a.y=tt,a.width=Math.max(0,y-z),a.height=Math.max(0,x-tt),a}wt.Yc=function(a){return this.Vu(a.x,a.y,a.width,a.height)},wt.Vu=function(a,y,x,E){var b=this.width,z=this.x;return b!==1/0&&x!==1/0&&(b+=z,x+=a,isNaN(x)||isNaN(b)||z>x||a>b)?!1:(a=this.height,x=this.y,!(a!==1/0&&E!==1/0&&(a+=x,E+=y,isNaN(E)||isNaN(a)||x>E||y>a)))};function Fo(a,y){var x=a.width,E=a.x,b=y.x-10;return E>y.width+10+10+b||b>x+E?!1:(x=a.height,a=a.y,E=y.y-10,!(a>y.height+10+10+E||E>x+a))}wt.Ye=function(a){return zr(this,a.x,a.y,0,0)},wt.ed=function(a){return zr(this,a.x,a.y,a.width,a.height)},wt.Kv=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),zr(this,a,y,x,E)};function zr(a,y,x,E,b){var z=Math.min(a.x,y),tt=Math.min(a.y,x);return y=Math.max(a.x+a.width,y+E),x=Math.max(a.y+a.height,x+b),a.x=z,a.y=tt,a.width=y-z,a.height=x-tt,a}wt.yi=function(a,y,x){return this.x=a-x.offsetX-x.x*this.width,this.y=y-x.offsetY-x.y*this.height,this};function Zr(a,y,x,E,b,z,tt,rt){return tt===void 0&&(tt=0),rt===void 0&&(rt=0),a<=b&&b+tt<=a+x&&y<=z&&z+rt<=y+E}function Za(a,y,x,E,b,z,tt,rt){return a>tt+b||b>x+a?!1:!(y>rt+z||z>E+y)}wt.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},wt.Mz=function(){return this.width===0&&this.height===0},Te.alloc=function(){var a=Ba.pop();return a===void 0?new Te:a},Te.allocAt=function(a,y,x,E){var b=Ba.pop();return b===void 0?new Te(a,y,x,E):b.h(a,y,x,E)},Te.free=function(a){Ba.push(a)},Se.Object.defineProperties(Te.prototype,{left:{get:function(){return this.x},set:function(a){this.x=a}},top:{get:function(){return this.y},set:function(a){this.y=a}},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{get:function(){return new At(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}},size:{get:function(){return new nn(this.width,this.height)},set:function(a){this.width=a.width,this.height=a.height}},center:{get:function(){return new At(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2,this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2},set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}}),Te.prototype.isEmpty=Te.prototype.Mz,Te.prototype.isReal=Te.prototype.w,Te.intersectsLineSegment=function(a,y,x,E,b,z,tt,rt){return _t.Fx(a,y,x,E,b,z,tt,rt)},Te.prototype.setSpot=Te.prototype.yi,Te.prototype.union=Te.prototype.Kv,Te.prototype.unionRect=Te.prototype.ed,Te.prototype.unionPoint=Te.prototype.Ye,Te.prototype.intersects=Te.prototype.Vu,Te.prototype.intersectsRect=Te.prototype.Yc,Te.prototype.intersect=Te.prototype.Uu,Te.prototype.intersectRect=Te.prototype.Ex,Te.prototype.grow=Te.prototype.Hz,Te.prototype.subtractMargin=Te.prototype.Fv,Te.prototype.addMargin=Te.prototype.Co,Te.prototype.inflate=Te.prototype.Bc,Te.prototype.offset=Te.prototype.offset,Te.prototype.contains=Te.prototype.contains,Te.prototype.containsRect=Te.prototype.Re,Te.prototype.containsPoint=Te.prototype.ca,Te.prototype.equalsApprox=Te.prototype.Xa,Te.prototype.equalTo=Te.prototype.hi,Te.prototype.equals=Te.prototype.D,Te.prototype.setSize=Te.prototype.tA,Te.prototype.setPoint=Te.prototype.dd,Te.prototype.set=Te.prototype.set,Te.prototype.setTo=Te.prototype.sg;var ra=null,bs=null,Ba=[];Te.className="Rect",Te.parse=Jr,Te.stringify=gr,Te.contains=Zr,Te.intersects=Za,Te.ZeroRect=ra=new Te(0,0,0,0).ja(),Te.NoRect=bs=new Te(NaN,NaN,NaN,NaN).ja(),Te.parse=Jr,Te.stringify=gr,Te.contains=Zr,Te.intersects=Za;function or(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):Gt("Invalid arguments to Margin constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}or.prototype.assign=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},or.prototype.sg=function(a,y,x,E){return this.top=a,this.right=y,this.bottom=x,this.left=E,this},or.prototype.set=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},or.prototype.copy=function(){var a=new or;return a.top=this.top,a.right=this.right,a.bottom=this.bottom,a.left=this.left,a},wt=or.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this};function $o(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=NaN;a[y]==="";)y++;var E=a[y++];if(E&&(x=parseFloat(E)),isNaN(x))return new or;for(var b=NaN;a[y]==="";)y++;if((E=a[y++])&&(b=parseFloat(E)),isNaN(b))return new or(x);for(var z=NaN;a[y]==="";)y++;if((E=a[y++])&&(z=parseFloat(E)),isNaN(z))return new or(x,b);for(var tt=NaN;a[y]==="";)y++;return(E=a[y++])&&(tt=parseFloat(E)),isNaN(tt)?new or(x,b):new or(x,b,z,tt)}return new or}function qo(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}wt.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},wt.D=function(a){return a instanceof or?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1},wt.hi=function(a,y,x,E){return this.top===a&&this.right===y&&this.bottom===x&&this.left===E},wt.Xa=function(a){return _t.B(this.top,a.top)&&_t.B(this.right,a.right)&&_t.B(this.bottom,a.bottom)&&_t.B(this.left,a.left)},wt.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},or.alloc=function(){var a=fa.pop();return a===void 0?new or:a},or.free=function(a){fa.push(a)},or.prototype.isReal=or.prototype.w,or.prototype.equalsApprox=or.prototype.Xa,or.prototype.equalTo=or.prototype.hi,or.prototype.equals=or.prototype.D,or.prototype.set=or.prototype.set,or.prototype.setTo=or.prototype.sg;var ca=null,ia=null,fa=[];or.className="Margin",or.parse=$o,or.stringify=qo,or.ZeroMargin=ca=new or(0,0,0,0).ja(),or.TwoMargin=ia=new or(2,2,2,2).ja(),or.parse=$o,or.stringify=qo;function gi(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 lr,jr,qr,mo,zo,dr,Ya,da,Yo,so,Sa,ns,Jo,ps,ms,Rs,La,Iu,Cu,js,Nl,zs,Vl,lu,Eu,xa,rl,_u,Kl,uu,Xa,Ja,Aa,Ga,Bl,ga;gi.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},gi.prototype.sg=function(a,y,x,E){return this.x=a,this.y=y,this.offsetX=x,this.offsetY=E,this},gi.prototype.set=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},gi.prototype.copy=function(){var a=new gi;return a.x=this.x,a.y=this.y,a.offsetX=this.offsetX,a.offsetY=this.offsetY,a},wt=gi.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this};function _o(a,y){return a.x=NaN,a.y=NaN,a.offsetX=y,a}function Eo(a){if(typeof a=="string"){if(a=a.trim(),a==="None")return lr;if(a==="TopLeft")return jr;if(a==="Top"||a==="TopCenter"||a==="MiddleTop")return qr;if(a==="TopRight")return mo;if(a==="Left"||a==="LeftCenter"||a==="MiddleLeft")return zo;if(a==="Center")return dr;if(a==="Right"||a==="RightCenter"||a==="MiddleRight")return Ya;if(a==="BottomLeft")return da;if(a==="Bottom"||a==="BottomCenter"||a==="MiddleBottom")return Yo;if(a==="BottomRight")return so;if(a==="TopSide")return Sa;if(a==="LeftSide")return ns;if(a==="RightSide")return Jo;if(a==="BottomSide")return ps;if(a==="TopBottomSides")return ms;if(a==="LeftRightSides")return Rs;if(a==="TopLeftSides")return La;if(a==="TopRightSides")return Iu;if(a==="BottomLeftSides")return Cu;if(a==="BottomRightSides")return js;if(a==="NotTopSide")return Nl;if(a==="NotLeftSide")return zs;if(a==="NotRightSide")return Vl;if(a==="NotBottomSide")return lu;if(a==="AllSides")return Eu;if(a==="Default")return xa;a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E!==void 0&&0<E.length&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;E=a[y++],E!==void 0&&0<E.length&&(b=parseFloat(E));for(var z=0;a[y]==="";)y++;E=a[y++],E!==void 0&&0<E.length&&(z=parseFloat(E));for(var tt=0;a[y]==="";)y++;return E=a[y++],E!==void 0&&0<E.length&&(tt=parseFloat(E)),new gi(x,b,z,tt)}return new gi}function Ao(a){return a.sb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()}wt.toString=function(){return this.sb()?this.offsetX===0&&this.offsetY===0?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.D(lr)?"None":this.D(jr)?"TopLeft":this.D(qr)?"Top":this.D(mo)?"TopRight":this.D(zo)?"Left":this.D(dr)?"Center":this.D(Ya)?"Right":this.D(da)?"BottomLeft":this.D(Yo)?"Bottom":this.D(so)?"BottomRight":this.D(Sa)?"TopSide":this.D(ns)?"LeftSide":this.D(Jo)?"RightSide":this.D(ps)?"BottomSide":this.D(ms)?"TopBottomSides":this.D(Rs)?"LeftRightSides":this.D(La)?"TopLeftSides":this.D(Iu)?"TopRightSides":this.D(Cu)?"BottomLeftSides":this.D(js)?"BottomRightSides":this.D(Nl)?"NotTopSide":this.D(zs)?"NotLeftSide":this.D(Vl)?"NotRightSide":this.D(lu)?"NotBottomSide":this.D(Eu)?"AllSides":this.D(xa)?"Default":"None"},wt.D=function(a){return a instanceof gi?(this.x===a.x||isNaN(this.x)&&isNaN(a.x))&&(this.y===a.y||isNaN(this.y)&&isNaN(a.y))&&this.offsetX===a.offsetX&&this.offsetY===a.offsetY:!1},wt.gv=function(){return new gi(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},wt.Hf=function(a){if(!this.$c())return!1;if(!a.$c())if(a.D(rl))a=ns;else if(a.D(_u))a=Jo;else if(a.D(Kl))a=Sa;else if(a.D(uu))a=ps;else return!1;return a=a.offsetY,(this.offsetY&a)===a},wt.sb=function(){return!isNaN(this.x)&&!isNaN(this.y)},wt.Mc=function(){return isNaN(this.x)||isNaN(this.y)},wt.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0},wt.ys=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0},wt.Xb=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0},gi.alloc=function(){var a=Ta.pop();return a===void 0?new gi:a},gi.free=function(a){Ta.push(a)},gi.prototype.isDefault=gi.prototype.Xb,gi.prototype.isNone=gi.prototype.ys,gi.prototype.isSide=gi.prototype.$c,gi.prototype.isNoSpot=gi.prototype.Mc,gi.prototype.isSpot=gi.prototype.sb,gi.prototype.includesSide=gi.prototype.Hf,gi.prototype.opposite=gi.prototype.gv,gi.prototype.equals=gi.prototype.D,gi.prototype.set=gi.prototype.set,gi.prototype.setTo=gi.prototype.sg;var Ta=[];gi.className="Spot",gi.parse=Eo,gi.stringify=Ao,gi.None=lr=_o(new gi(0,0,0,0),0).ja(),gi.Default=xa=_o(new gi(0,0,-1,0),-1).ja(),gi.TopLeft=jr=new gi(0,0,0,0).ja(),gi.TopCenter=qr=new gi(.5,0,0,0).ja(),gi.TopRight=mo=new gi(1,0,0,0).ja(),gi.LeftCenter=zo=new gi(0,.5,0,0).ja(),gi.Center=dr=new gi(.5,.5,0,0).ja(),gi.RightCenter=Ya=new gi(1,.5,0,0).ja(),gi.BottomLeft=da=new gi(0,1,0,0).ja(),gi.BottomCenter=Yo=new gi(.5,1,0,0).ja(),gi.BottomRight=so=new gi(1,1,0,0).ja(),gi.MiddleTop=Xa=qr,gi.MiddleLeft=Ja=zo,gi.MiddleRight=Aa=Ya,gi.MiddleBottom=Ga=Yo,gi.Top=Kl=qr,gi.Left=rl=zo,gi.Right=_u=Ya,gi.Bottom=uu=Yo,gi.TopSide=Sa=_o(new gi(0,0,1,1),1).ja(),gi.LeftSide=ns=_o(new gi(0,0,1,2),1).ja(),gi.RightSide=Jo=_o(new gi(0,0,1,4),1).ja(),gi.BottomSide=ps=_o(new gi(0,0,1,8),1).ja(),gi.TopBottomSides=ms=_o(new gi(0,0,1,9),1).ja(),gi.LeftRightSides=Rs=_o(new gi(0,0,1,6),1).ja(),gi.TopLeftSides=La=_o(new gi(0,0,1,3),1).ja(),gi.TopRightSides=Iu=_o(new gi(0,0,1,5),1).ja(),gi.BottomLeftSides=Cu=_o(new gi(0,0,1,10),1).ja(),gi.BottomRightSides=js=_o(new gi(0,0,1,12),1).ja(),gi.NotTopSide=Nl=_o(new gi(0,0,1,14),1).ja(),gi.NotLeftSide=zs=_o(new gi(0,0,1,13),1).ja(),gi.NotRightSide=Vl=_o(new gi(0,0,1,11),1).ja(),gi.NotBottomSide=lu=_o(new gi(0,0,1,7),1).ja(),gi.AllSides=Eu=_o(new gi(0,0,1,15),1).ja(),Bl=new gi(.156,.156).ja(),ga=new gi(.844,.844).ja(),gi.parse=Eo,gi.stringify=Ao;function ae(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}ae.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},ae.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},ae.prototype.copy=function(){var a=new ae;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},ae.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},ae.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},ae.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},ae.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},ae.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},ae.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},ae.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},ae.prototype.rotate=function(a,y,x){if(360<=a?a-=360:0>a&&(a+=360),a===0)return this;if(this.translate(y,x),a===90){a=0;var E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));var b=this.m12*a+this.m22*E,z=this.m11*-E+this.m21*a,tt=this.m12*-E+this.m22*a;return this.m11=this.m11*a+this.m21*E,this.m12=b,this.m21=z,this.m22=tt,this.translate(-y,-x),this},wt=ae.prototype,wt.translate=function(a,y){return this.dx+=this.m11*a+this.m21*y,this.dy+=this.m12*a+this.m22*y,this},wt.scale=function(a,y){return y===void 0&&(y=a),this.m11*=a,this.m12*=a,this.m21*=y,this.m22*=y,this},wt.Ga=function(a){var y=a.x,x=a.y;return a.h(y*this.m11+x*this.m21+this.dx,y*this.m12+x*this.m22+this.dy)},wt.Cd=function(a){var y=1/(this.m11*this.m22-this.m12*this.m21),x=a.x,E=a.y;return a.h(x*this.m22*y+E*-this.m21*y+y*(this.m21*this.dy-this.m22*this.dx),x*-this.m12*y+E*this.m11*y+y*(this.m12*this.dx-this.m11*this.dy))},wt.Eu=function(a){var y=1/(this.m11*this.m22-this.m12*this.m21),x=1.25*a.x,E=1.2*a.y;return a.h(x*this.m22*y+E*-this.m21*y+y*(this.m21*this.dy-this.m22*this.dx),x*-this.m12*y+E*this.m11*y+y*(this.m12*this.dx-this.m11*this.dy))},wt.pp=function(a){var y=a.x,x=a.y,E=y+a.width,b=x+a.height,z=this.m11,tt=this.m12,rt=this.m21,ot=this.m22,lt=this.dx,ut=this.dy,ft=y*z+x*rt+lt,yt=y*tt+x*ot+ut,xt=E*z+x*rt+lt,Ct=E*tt+x*ot+ut;return x=y*z+b*rt+lt,y=y*tt+b*ot+ut,z=E*z+b*rt+lt,E=E*tt+b*ot+ut,b=Math.min(ft,xt),ft=Math.max(ft,xt),xt=Math.min(yt,Ct),yt=Math.max(yt,Ct),b=Math.min(b,x),ft=Math.max(ft,x),xt=Math.min(xt,y),yt=Math.max(yt,y),b=Math.min(b,z),ft=Math.max(ft,z),xt=Math.min(xt,E),yt=Math.max(yt,E),a.h(b,xt,ft-b,yt-xt),a},ae.alloc=function(){var a=Ie.pop();return a===void 0?new ae:a},ae.free=function(a){Ie.push(a)},ae.prototype.transformRect=ae.prototype.pp,ae.prototype.transformPoint=ae.prototype.Ga,ae.prototype.scale=ae.prototype.scale,ae.prototype.translate=ae.prototype.translate,ae.prototype.rotate=ae.prototype.rotate,ae.prototype.invert=ae.prototype.Vj,ae.prototype.multiplyInverted=ae.prototype.bv,ae.prototype.multiply=ae.prototype.multiply,ae.prototype.reset=ae.prototype.reset,ae.prototype.isIdentity=ae.prototype.ws,ae.prototype.equals=ae.prototype.D,ae.prototype.setTransform=ae.prototype.setTransform,ae.prototype.set=ae.prototype.set;var Ie=[];ae.className="Transform",ae.xF="54a702f3e53909c447824c6706603faf4c";var _t={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(a){if(0>=a)return 0;var y=_t.Uv;if(y===null){y=[];for(var x=0;2e3>=x;x++)y[x]=Math.sqrt(x);_t.Uv=y}return 1>a?(x=1/a,2e3>=x?1/y[x|0]:Math.sqrt(a)):2e3>=a?y[a|0]:Math.sqrt(a)},B:function(a,y){return a-=y,.5>a&&-.5<a},$:function(a,y){return a-=y,5e-8>a&&-5e-8<a},Yb:function(a,y,x,E,b,z,tt){if(0>=b&&(b=1e-6),a<x)var rt=a,ot=x;else rt=x,ot=a;if(y<E)var lt=y,ut=E;else lt=E,ut=y;if(a===x)return lt<=tt&&tt<=ut&&a-b<=z&&z<=a+b;if(y===E)return rt<=z&&z<=ot&&y-b<=tt&&tt<=y+b;if(ot+=b,rt-=b,rt<=z&&z<=ot&&(ut+=b,lt-=b,lt<=tt&&tt<=ut))if(ot-rt>ut-lt)if(a-x>b||x-a>b){if(z=(E-y)/(x-a)*(z-a)+y,z-b<=tt&&tt<=z+b)return!0}else return!0;else if(y-E>b||E-y>b){if(tt=(x-a)/(E-y)*(tt-y)+a,tt-b<=z&&z<=tt+b)return!0}else return!0;return!1},cs:function(a,y,x,E,b,z,tt,rt,ot,lt,ut,ft){if(_t.Yb(a,y,tt,rt,ft,x,E)&&_t.Yb(a,y,tt,rt,ft,b,z))return _t.Yb(a,y,tt,rt,ft,lt,ut);var yt=(a+x)/2,xt=(y+E)/2,Ct=(x+b)/2,bt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(yt+Ct)/2,x=(xt+bt)/2,Ct=(Ct+b)/2,bt=(bt+z)/2;var Vt=(E+Ct)/2,zt=(x+bt)/2;return _t.cs(a,y,yt,xt,E,x,Vt,zt,ot,lt,ut,ft)||_t.cs(Vt,zt,Ct,bt,b,z,tt,rt,ot,lt,ut,ft)},ax:function(a,y,x,E,b,z,tt,rt,ot){var lt=(x+b)/2,ut=(E+z)/2;return ot.h((((a+x)/2+lt)/2+(lt+(b+tt)/2)/2)/2,(((y+E)/2+ut)/2+(ut+(z+rt)/2)/2)/2),ot},My:function(a,y,x,E,b,z,tt,rt){var ot=(x+b)/2,lt=(E+z)/2;return vi(((a+x)/2+ot)/2,((y+E)/2+lt)/2,(ot+(b+tt)/2)/2,(lt+(z+rt)/2)/2)},Dl:function(a,y,x,E,b,z,tt,rt,ot,lt){if(_t.Yb(a,y,tt,rt,ot,x,E)&&_t.Yb(a,y,tt,rt,ot,b,z))zr(lt,a,y,0,0),zr(lt,tt,rt,0,0);else{var ut=(a+x)/2,ft=(y+E)/2,yt=(x+b)/2,xt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(ut+yt)/2,x=(ft+xt)/2,yt=(yt+b)/2,xt=(xt+z)/2;var Ct=(E+yt)/2,bt=(x+xt)/2;_t.Dl(a,y,ut,ft,E,x,Ct,bt,ot,lt),_t.Dl(Ct,bt,yt,xt,b,z,tt,rt,ot,lt)}return lt},Qe:function(a,y,x,E,b,z,tt,rt,ot,lt){if(_t.Yb(a,y,tt,rt,ot,x,E)&&_t.Yb(a,y,tt,rt,ot,b,z))lt.length===0&&(lt.push(a),lt.push(y)),lt.push(tt),lt.push(rt);else{var ut=(a+x)/2,ft=(y+E)/2,yt=(x+b)/2,xt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(ut+yt)/2,x=(ft+xt)/2,yt=(yt+b)/2,xt=(xt+z)/2;var Ct=(E+yt)/2,bt=(x+xt)/2;_t.Qe(a,y,ut,ft,E,x,Ct,bt,ot,lt),_t.Qe(Ct,bt,yt,xt,b,z,tt,rt,ot,lt)}return lt},jv:function(a,y,x,E,b,z,tt,rt,ot,lt){if(_t.Yb(a,y,b,z,lt,x,E))return _t.Yb(a,y,b,z,lt,rt,ot);var ut=(a+x)/2,ft=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var yt=(ut+x)/2,xt=(ft+E)/2;return _t.jv(a,y,ut,ft,yt,xt,tt,rt,ot,lt)||_t.jv(yt,xt,x,E,b,z,tt,rt,ot,lt)},OA:function(a,y,x,E,b,z,tt){return tt.h(((a+x)/2+(x+b)/2)/2,((y+E)/2+(E+z)/2)/2),tt},iv:function(a,y,x,E,b,z,tt,rt){if(_t.Yb(a,y,b,z,tt,x,E))zr(rt,a,y,0,0),zr(rt,b,z,0,0);else{var ot=(a+x)/2,lt=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var ut=(ot+x)/2,ft=(lt+E)/2;_t.iv(a,y,ot,lt,ut,ft,tt,rt),_t.iv(ut,ft,x,E,b,z,tt,rt)}return rt},ep:function(a,y,x,E,b,z,tt,rt){if(_t.Yb(a,y,b,z,tt,x,E))rt.length===0&&(rt.push(a),rt.push(y)),rt.push(b),rt.push(z);else{var ot=(a+x)/2,lt=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var ut=(ot+x)/2,ft=(lt+E)/2;_t.ep(a,y,ot,lt,ut,ft,tt,rt),_t.ep(ut,ft,x,E,b,z,tt,rt)}return rt},Eo:function(a,y,x,E,b,z,tt,rt,ot,lt,ut,ft,yt,xt){if(_t.Yb(a,y,tt,rt,yt,x,E)&&_t.Yb(a,y,tt,rt,yt,b,z))return!_t.Rl(a,y,tt,rt,ot,lt,ut,ft)||(yt=(a-tt)*(lt-ft)-(y-rt)*(ot-ut),yt===0)?!1:(xt.h(((a*rt-y*tt)*(ot-ut)-(a-tt)*(ot*ft-lt*ut))/yt,((a*rt-y*tt)*(lt-ft)-(y-rt)*(ot*ft-lt*ut))/yt),!0);var Ct=(a+x)/2,bt=(y+E)/2,Vt=(x+b)/2,zt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(Ct+Vt)/2,x=(bt+zt)/2,Vt=(Vt+b)/2,zt=(zt+z)/2;var $t=(E+Vt)/2,ie=(x+zt)/2,oe=1/0,de=!1,ke=0,Hn=0;return _t.Eo(a,y,Ct,bt,E,x,$t,ie,ot,lt,ut,ft,yt,xt)&&(a=(xt.x-ot)*(xt.x-ot)+(xt.y-lt)*(xt.y-lt),a<oe&&(oe=a,de=!0,ke=xt.x,Hn=xt.y)),_t.Eo($t,ie,Vt,zt,b,z,tt,rt,ot,lt,ut,ft,yt,xt)&&(xt.x-ot)*(xt.x-ot)+(xt.y-lt)*(xt.y-lt)<oe&&(de=!0,ke=xt.x,Hn=xt.y),de&&(xt.x=ke,xt.y=Hn),de},Fo:function(a,y,x,E,b,z,tt,rt,ot,lt,ut,ft,yt){var xt=0;if(_t.Yb(a,y,tt,rt,yt,x,E)&&_t.Yb(a,y,tt,rt,yt,b,z)){if(yt=(a-tt)*(lt-ft)-(y-rt)*(ot-ut),yt===0)return xt;var Ct=((a*rt-y*tt)*(ot-ut)-(a-tt)*(ot*ft-lt*ut))/yt,bt=((a*rt-y*tt)*(lt-ft)-(y-rt)*(ot*ft-lt*ut))/yt;if(Ct>=ut)return xt;if((ot>ut?ot-ut:ut-ot)<(lt>ft?lt-ft:ft-lt)){if(y<rt?(ot=y,a=rt):(ot=rt,a=y),bt<ot||bt>a)return xt}else if(a<tt?(ot=a,a=tt):ot=tt,Ct<ot||Ct>a)return xt;0<yt?xt++:0>yt&&xt--}else{Ct=(a+x)/2,bt=(y+E)/2;var Vt=(x+b)/2,zt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(Ct+Vt)/2,x=(bt+zt)/2,Vt=(Vt+b)/2,zt=(zt+z)/2;var $t=(E+Vt)/2,ie=(x+zt)/2;xt+=_t.Fo(a,y,Ct,bt,E,x,$t,ie,ot,lt,ut,ft,yt),xt+=_t.Fo($t,ie,Vt,zt,b,z,tt,rt,ot,lt,ut,ft,yt)}return xt},qh:function(a,y,x,E,b,z,tt){return _t.$(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)):_t.$(y,E)?(a<x?(E=a,a=x):E=x,b<E?(tt.h(E,y),!1):b>a?(tt.h(a,y),!1):(tt.h(b,y),!0)):(b=((a-b)*(a-x)+(y-z)*(y-E))/((x-a)*(x-a)+(E-y)*(E-y)),-5e-6>b?(tt.h(a,y),!1):1.000005<b?(tt.h(x,E),!1):(tt.h(a+b*(x-a),y+b*(E-y)),!0))},Ve:function(a,y,x,E,b,z,tt,rt,ot){return _t.B(a,x)&&_t.B(y,E)?(ot.h(a,y),!1):_t.$(b,tt)?_t.$(a,x)?(_t.qh(a,y,x,E,b,z,ot),!1):_t.qh(a,y,x,E,b,(E-y)/(x-a)*(b-a)+y,ot):(rt=(rt-z)/(tt-b),_t.$(a,x)?(x=rt*(a-b)+z,y<E?(b=y,y=E):b=E,x<b?(ot.h(a,b),!1):x>y?(ot.h(a,y),!1):(ot.h(a,x),!0)):(tt=(E-y)/(x-a),_t.$(rt,tt)?(_t.qh(a,y,x,E,b,z,ot),!1):(b=(tt*a-rt*b+z-y)/(tt-rt),_t.$(tt,0)?(a<x?(E=a,a=x):E=x,b<E?(ot.h(E,y),!1):b>a?(ot.h(a,y),!1):(ot.h(b,y),!0)):_t.qh(a,y,x,E,b,tt*(b-a)+y,ot))))},MA:function(a,y,x,E,b){return _t.Ve(x.x,x.y,E.x,E.y,a.x,a.y,y.x,y.y,b)},KA:function(a,y,x,E,b,z,tt,rt,ot,lt){function ut(Vt,zt){var $t=(Vt-a)*(Vt-a)+(zt-y)*(zt-y);$t<ft&&(ft=$t,ot.h(Vt,zt))}var ft=1/0;ut(ot.x,ot.y);var yt=0,xt=0,Ct=0,bt=0;if(b<tt?(yt=b,xt=tt):(yt=tt,xt=b),z<rt?(Ct=b,bt=tt):(Ct=tt,bt=b),yt=(xt-yt)/2+lt,lt=(bt-Ct)/2+lt,b=(b+tt)/2,z=(z+rt)/2,yt===0||lt===0)return ot;if(.5>(x>a?x-a:a-x)){if(yt=1-(x-b)*(x-b)/(yt*yt),0>yt)return ot;yt=Math.sqrt(yt),E=-lt*yt+z,ut(x,lt*yt+z),ut(x,E)}else{if(x=(E-y)/(x-a),E=1/(yt*yt)+x*x/(lt*lt),rt=2*x*(y-x*a)/(lt*lt)-2*x*z/(lt*lt)-2*b/(yt*yt),yt=rt*rt-4*E*(2*x*a*z/(lt*lt)-2*y*z/(lt*lt)+z*z/(lt*lt)+b*b/(yt*yt)-1+(y-x*a)*(y-x*a)/(lt*lt)),0>yt)return ot;yt=Math.sqrt(yt),lt=(-rt+yt)/(2*E),ut(lt,x*lt-x*a+y),yt=(-rt-yt)/(2*E),ut(yt,x*yt-x*a+y)}return ot},Ff:function(a,y,x,E,b,z,tt,rt,ot){var lt=1e21,ut=a,ft=y;if(_t.Ve(a,y,a,E,b,z,tt,rt,ot)){var yt=(ot.x-b)*(ot.x-b)+(ot.y-z)*(ot.y-z);yt<lt&&(lt=yt,ut=ot.x,ft=ot.y)}return _t.Ve(x,y,x,E,b,z,tt,rt,ot)&&(yt=(ot.x-b)*(ot.x-b)+(ot.y-z)*(ot.y-z),yt<lt&&(lt=yt,ut=ot.x,ft=ot.y)),_t.Ve(a,y,x,y,b,z,tt,rt,ot)&&(y=(ot.x-b)*(ot.x-b)+(ot.y-z)*(ot.y-z),y<lt&&(lt=y,ut=ot.x,ft=ot.y)),_t.Ve(a,E,x,E,b,z,tt,rt,ot)&&(a=(ot.x-b)*(ot.x-b)+(ot.y-z)*(ot.y-z),a<lt&&(lt=a,ut=ot.x,ft=ot.y)),ot.h(ut,ft),1e21>lt},us:function(a,y,x){return _t.Fx(a.x,a.y,a.width,a.height,y.x,y.y,x.x,x.y)},Fx:function(a,y,x,E,b,z,tt,rt){var ot=a+x,lt=y+E;return b===tt?(z<rt?(tt=z,z=rt):tt=rt,a<=b&&b<=ot&&tt<=lt&&z>=y):z===rt?(b<tt?(rt=b,b=tt):rt=tt,y<=z&&z<=lt&&rt<=ot&&b>=a):!!(Zr(a,y,x,E,b,z)||Zr(a,y,x,E,tt,rt)||_t.Rl(a,y,ot,y,b,z,tt,rt)||_t.Rl(ot,y,ot,lt,b,z,tt,rt)||_t.Rl(ot,lt,a,lt,b,z,tt,rt)||_t.Rl(a,lt,a,y,b,z,tt,rt))},Rl:function(a,y,x,E,b,z,tt,rt){return a===x&&y===E&&b===tt&&z===rt?a===b&&y===z:0>=_t.Fl(a,y,x,E,b,z)*_t.Fl(a,y,x,E,tt,rt)&&0>=_t.Fl(b,z,tt,rt,a,y)*_t.Fl(b,z,tt,rt,x,E)},Fl:function(a,y,x,E,b,z){return x-=a,E-=y,a=b-a,y=z-y,z=a*E-y*x,z===0&&(z=a*x+y*E,0<z&&(z=(a-x)*x+(y-E)*E,0>z&&(z=0))),z},bp:function(a){return 0>a&&(a+=360),360<=a&&(a-=360),a},jx:function(a,y,x,E,b,z){var tt=Math.PI;z||(E*=tt/180,b*=tt/180);var rt=E>b?-1:1;z=[];var ot=tt/2,lt=E;if(E=Math.min(2*tt,Math.abs(b-E)),1e-5>E)return ot=lt+rt*Math.min(E,ot),rt=a+x*Math.cos(lt),lt=y+x*Math.sin(lt),a+=x*Math.cos(ot),y+=x*Math.sin(ot),x=(rt+a)/2,ot=(lt+y)/2,z.push([rt,lt,x,ot,x,ot,a,y]),z;for(;1e-5<E;)b=lt+rt*Math.min(E,ot),z.push(_t.Vy(x,lt,b,a,y)),E-=Math.abs(b-lt),lt=b;return z},Vy:function(a,y,x,E,b){var z=(x-y)/2,tt=a*Math.cos(z),rt=a*Math.sin(z),ot=-rt,lt=tt*tt+ot*ot,ut=lt+tt*tt+ot*rt;return lt=4/3*(Math.sqrt(2*lt*ut)-ut)/(tt*rt-ot*tt),rt=tt-lt*ot,tt=ot+lt*tt,ot=-tt,lt=z+y,z=Math.cos(lt),lt=Math.sin(lt),[E+a*Math.cos(y),b+a*Math.sin(y),E+rt*z-tt*lt,b+rt*lt+tt*z,E+rt*z-ot*lt,b+rt*lt+ot*z,E+a*Math.cos(x),b+a*Math.sin(x)]},No:function(a,y,x,E,b,z,tt){x=Math.floor((a-x)/b)*b+x,E=Math.floor((y-E)/z)*z+E;var rt=x;return x+b-a<b/2&&(rt=x+b),a=E,E+z-y<z/2&&(a=E+z),tt.h(rt,a),tt},vx:function(a,y){var x=Math.max(a,y);a=Math.min(a,y);var E;do y=x%a,x=E=a,a=y;while(0<y);return E},$y:function(a,y,x,E){var b=0>x,z=0>E;if(a<y)var tt=1,rt=0;else tt=0,rt=1;var ot=tt===0?a:y,lt=tt===0?x:E;return(tt===0?b:z)&&(lt=-lt),tt=rt,x=tt===0?x:E,(tt===0?b:z)&&(x=-x),_t.az(ot,tt===0?a:y,lt,x,0,0)},az:function(a,y,x,E,b,z){if(0<E)if(0<x){b=a*a,z=y*y,a*=x;var tt=y*E,rt=-z+tt,ot=-z+Math.sqrt(a*a+tt*tt);y=rt;for(var lt=0;9999999999>lt&&(y=.5*(rt+ot),!(y===rt||y===ot));++lt){var ut=a/(y+b),ft=tt/(y+z);if(ut=ut*ut+ft*ft-1,0<ut)rt=y;else if(0>ut)ot=y;else break}x=b*x/(y+b)-x,E=z*E/(y+z)-E,x=Math.sqrt(x*x+E*E)}else x=Math.abs(E-y);else E=a*a-y*y,z=a*x,z<E?(E=z/E,z=y*Math.sqrt(Math.abs(1-E*E)),x=a*E-x,x=Math.sqrt(x*x+z*z)):x=Math.abs(x-a);return x},Ze:new bi,um:new bi,Mf:new bi,Nf:0,vm:100};_t.za=_t.AA;function ce(a){Wi(this),this.l=2,a===void 0&&(a=ce.o),this.na=a,this.Ec=this.Dc=this.pd=this.od=0,a===ce.o?this.ee=new cn:(ce.V===null&&(ce.V=new cn().freeze()),this.ee=ce.V),this.aq=this.ee.Ja,this.Ip=new Te().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=jr,this.gg=so,this.Rk=this.Sk=NaN,this.Uf=yn}ce.prototype.copy=function(){var a=new ce;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===ce.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},ce.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},ce.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==ce.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},ce.prototype.ka=function(){if(Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==ce.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},ce.prototype.Xa=function(a){if(!(a instanceof ce))return!1;if(this.type!==a.type)return this.type===ce.j&&a.type===ce.o?Gr(this,a):a.type===ce.j&&this.type===ce.o?Gr(a,this):!1;if(this.type===ce.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 _t.B(this.startX,a.startX)&&_t.B(this.startY,a.startY)&&_t.B(this.endX,a.endX)&&_t.B(this.endY,a.endY)};function Gr(a,y){return a.type!==ce.j||y.type!==ce.o?!1:!!(y.figures.count===1&&(y=y.figures.M(0),y.segments.count===1&&_t.B(a.startX,y.startX)&&_t.B(a.startY,y.startY)&&(y=y.segments.M(0),y.type===Qi&&_t.B(a.endX,y.endX)&&_t.B(a.endY,y.endY))))}ce.ia=function(a){return a.toString()},ce.prototype.qb=function(a){a.classType===ce&&(this.type=a)},ce.prototype.toString=function(a){switch(a===void 0&&(a=-1),this.type){case ce.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 ce.u:var y=new Te(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 ce.F:if(y=new Te(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 ce.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()}},ce.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},ce.parse=function(a,y){function x(){return bt>=oe-1?!0:lt[bt+1].match(de)!==null}function E(){return bt++,lt[bt]}function b(nr){var Ji=parseFloat(E()),io=parseFloat(E());Vt===Vt.toLowerCase()&&(Ji=ie.x+Ji,io=ie.y+io),nr.h(Ji,io)}function z(){return b(ie),ie}function tt(){return b($t),$t}function rt(){var nr=zt.toLowerCase();return nr!=="c"&&nr!=="s"&&nr!=="q"&&nr!=="t"?ie:new At(2*ie.x-$t.x,2*ie.y-$t.y)}y===void 0&&(y=!1);var ot=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm;a=a.replace(/,/gm," "),a=a.replace(ot,"$1 $2"),a=a.replace(ot,"$1 $2"),a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^s])/gm,"$1 $2"),a=a.replace(/([^s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2"),a=a.replace(/([0-9])([+\-])/gm,"$1 $2"),a=a.replace(/[\s\r\t\n]+/gm," "),a=a.replace(/^\s+|\s+$/g,"");var lt=a.split(" ");for(a=0;a<lt.length;a++){var ut=lt[a];if(ut.match(/(\.[0-9]*)(\.)/gm)!==null){ot=Jn();for(var ft="",yt=!1,xt=0;xt<ut.length;xt++){var Ct=ut[xt];Ct!=="."||yt?Ct==="."?(ot.push(ft),ft="."):ft+=Ct:(yt=!0,ft+=Ct)}for(ot.push(ft),lt.splice(a,1),ut=0;ut<ot.length;ut++)lt.splice(a+ut,0,ot[ut]);a+=ot.length-1,li(ot)}}var bt=-1,Vt="",zt="";ot=new At(0,0);var $t=new At(0,0),ie=new At(0,0),oe=lt.length;a=N1(null),yt=ft=ut=!1,xt=!0,Ct=null;for(var de=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(bt>=oe-1);)if(zt=Vt,Vt=E(),Vt!=="")switch(Vt.toUpperCase()){case"X":xt=!0,ft=ut=!1;break;case"M":for(Ct=z(),a.mc===null||xt===!0?(zf(a,Ct.x,Ct.y,ut,!ft,yt),xt=!1):a.moveTo(Ct.x,Ct.y),ot.assign(ie);!x();)Ct=z(),a.lineTo(Ct.x,Ct.y);break;case"L":for(;!x();)Ct=z(),a.lineTo(Ct.x,Ct.y);break;case"H":for(;!x();)ie=new At((Vt===Vt.toLowerCase()?ie.x:0)+parseFloat(E()),ie.y),a.lineTo(ie.x,ie.y);break;case"V":for(;!x();)ie=new At(ie.x,(Vt===Vt.toLowerCase()?ie.y:0)+parseFloat(E())),a.lineTo(ie.x,ie.y);break;case"C":for(;!x();){Ct=new At,b(Ct);var ke=tt(),Hn=z();Dh(a,Ct.x,Ct.y,ke.x,ke.y,Hn.x,Hn.y)}break;case"S":for(;!x();)Ct=rt(),ke=tt(),Hn=z(),Dh(a,Ct.x,Ct.y,ke.x,ke.y,Hn.x,Hn.y);break;case"Q":for(;!x();)Ct=tt(),ke=z(),jm(a,Ct.x,Ct.y,ke.x,ke.y);break;case"T":for(;!x();)$t=Ct=rt(),ke=z(),jm(a,Ct.x,Ct.y,ke.x,ke.y);break;case"B":for(;!x();){Ct=parseFloat(E()),ke=parseFloat(E()),Hn=parseFloat(E());var ci=parseFloat(E()),ai=parseFloat(E()),Fn=ai,tn=!1;x()||(Fn=parseFloat(E()),x()||(tn=parseFloat(E())!==0)),Vt===Vt.toLowerCase()&&(Hn+=ie.x,ci+=ie.y),a.arcTo(Ct,ke,Hn,ci,ai,Fn,tn)}break;case"A":for(;!x();)Ct=Math.abs(parseFloat(E())),ke=Math.abs(parseFloat(E())),Hn=parseFloat(E()),ai=ci=!1,tn=Fn=0,Fn=E(),Fn.length===1?(ci=!!parseFloat(Fn),ai=!!parseFloat(E()),Fn=parseFloat(E())):Fn.length===2?(ci=!!parseFloat(Fn[0]),ai=!!parseFloat(Fn[1]),Fn=parseFloat(E())):(ci=!!parseFloat(Fn[0]),ai=!!parseFloat(Fn[1]),Fn=parseFloat(Fn.slice(2))),tn=parseFloat(E()),Vt===Vt.toLowerCase()&&(Fn=ie.x+Fn,tn=ie.y+tn),ie.h(Fn,tn),wx(a,Ct,ke,Hn,ci,ai,Fn,tn);break;case"Z":Px(a),ie.assign(ot);break;case"F":for(Ct="",ke=1;lt[bt+ke];)if(lt[bt+ke]==="0")yt=!0,ke++;else if(lt[bt+ke].match(/[Uu]/)!==null)ke++;else if(lt[bt+ke].match(de)===null)ke++;else{Ct=lt[bt+ke];break}Ct.match(/[Mm]/)?ut=!0:0<a.mc.segments.length&&(a.mc.isFilled=!0);break;case"U":for(Ct="",ke=1;lt[bt+ke];)if(lt[bt+ke].match(/[Ff]/)!==null)ke++;else if(lt[bt+ke].match(de)===null)ke++;else{Ct=lt[bt+ke];break}Ct.match(/[Mm]/)?ft=!0:a.mc.isShadowed=!1}if(ot=a.os,zm=a,y)for(y=ot.figures.iterator;y.next();)y.value.isFilled=!0;return ot},ce.Ha=function(a,y){for(var x=a.length,E=At.alloc(),b=0;b<x;b++){var z=a[b];E.x=z[0],E.y=z[1],y.Ga(E),z[0]=E.x,z[1]=E.y,E.x=z[2],E.y=z[3],y.Ga(E),z[2]=E.x,z[3]=E.y,E.x=z[4],E.y=z[5],y.Ga(E),z[4]=E.x,z[5]=E.y,E.x=z[6],E.y=z[7],y.Ga(E),z[6]=E.x,z[7]=E.y}At.free(E)},ce.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===ce.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},ce.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===ce.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),Sr(this,a,!1),zr(a,0,0,0,0),a.freeze()},ce.prototype.ix=function(){var a=new Te;return Sr(this,a,!0),a};function Sr(a,y,x){switch(a.type){case ce.j:case ce.u:case ce.F:x?y.h(a.od,a.pd,0,0):zr(y,a.od,a.pd,0,0),zr(y,a.Dc,a.Ec,0,0);break;case ce.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):zr(y,z.startX,z.startY,0,0);for(var tt=z.segments.s,rt=tt.length,ot=z.startX,lt=z.startY,ut=0;ut<rt;ut++){var ft=tt[ut];switch(ft.type){case Qi:case ar:ot=ft.endX,lt=ft.endY,zr(y,ot,lt,0,0);break;case br:_t.Dl(ot,lt,ft.point1X,ft.point1Y,ft.point2X,ft.point2Y,ft.endX,ft.endY,.5,y),ot=ft.endX,lt=ft.endY;break;case Fr:_t.iv(ot,lt,ft.point1X,ft.point1Y,ft.endX,ft.endY,.5,y),ot=ft.endX,lt=ft.endY;break;case Dr:case no:var yt=ft.type===Dr?eo(ft,z):Vi(ft,z,ot,lt),xt=yt.length;if(xt===0){ot=ft.type===Dr?ft.centerX:ft.endX,lt=ft.type===Dr?ft.centerY:ft.endY,zr(y,ot,lt,0,0);break}ft=null;for(var Ct=0;Ct<xt;Ct++)ft=yt[Ct],_t.Dl(ft[0],ft[1],ft[2],ft[3],ft[4],ft[5],ft[6],ft[7],.5,y);ft!==null&&(ot=ft[6],lt=ft[7]);break;default:Gt("Unknown Segment type: "+ft.type)}}}break;default:Gt("Unknown Geometry type: "+a.type)}}ce.prototype.normalize=function(){this._isFrozen&&me(this);var a=this.ix();return this.offset(-a.x,-a.y),new At(-a.x,-a.y)},ce.prototype.offset=function(a,y){return this._isFrozen&&me(this),this.transform(1,0,0,1,a,y),this},ce.prototype.scale=function(a,y){return this._isFrozen&&me(this),this.transform(a,0,0,y,0,0),this},ce.prototype.rotate=function(a,y,x){this._isFrozen&&me(this),y===void 0&&(y=0),x===void 0&&(x=0);var E=ae.alloc();return E.reset(),E.rotate(a,y,x),this.transform(E.m11,E.m12,E.m21,E.m22,E.dx,E.dy),ae.free(E),this},wt=ce.prototype,wt.transform=function(a,y,x,E,b,z){switch(this.type){case ce.j:case ce.u:case ce.F:var tt=this.od,rt=this.pd;this.od=tt*a+rt*x+b,this.pd=tt*y+rt*E+z,tt=this.Dc,rt=this.Ec,this.Dc=tt*a+rt*x+b,this.Ec=tt*y+rt*E+z;break;case ce.o:for(var ot=this.figures.s,lt=ot.length,ut=0;ut<lt;ut++){var ft=ot[ut];tt=ft.startX,rt=ft.startY,ft.startX=tt*a+rt*x+b,ft.startY=tt*y+rt*E+z,ft=ft.segments.s;for(var yt=ft.length,xt=0;xt<yt;xt++){var Ct=ft[xt];switch(Ct.type){case Qi:case ar:tt=Ct.endX,rt=Ct.endY,Ct.endX=tt*a+rt*x+b,Ct.endY=tt*y+rt*E+z;break;case br:tt=Ct.point1X,rt=Ct.point1Y,Ct.point1X=tt*a+rt*x+b,Ct.point1Y=tt*y+rt*E+z,tt=Ct.point2X,rt=Ct.point2Y,Ct.point2X=tt*a+rt*x+b,Ct.point2Y=tt*y+rt*E+z,tt=Ct.endX,rt=Ct.endY,Ct.endX=tt*a+rt*x+b,Ct.endY=tt*y+rt*E+z;break;case Fr:tt=Ct.point1X,rt=Ct.point1Y,Ct.point1X=tt*a+rt*x+b,Ct.point1Y=tt*y+rt*E+z,tt=Ct.endX,rt=Ct.endY,Ct.endX=tt*a+rt*x+b,Ct.endY=tt*y+rt*E+z;break;case Dr:tt=Ct.centerX,rt=Ct.centerY,Ct.centerX=tt*a+rt*x+b,Ct.centerY=tt*y+rt*E+z,y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),Ct.startAngle+=tt),0>a&&(Ct.startAngle=180-Ct.startAngle,Ct.sweepAngle=-Ct.sweepAngle),0>E&&(Ct.startAngle=-Ct.startAngle,Ct.sweepAngle=-Ct.sweepAngle),Ct.radiusX*=Math.sqrt(a*a+x*x),Ct.radiusY!==void 0&&(Ct.radiusY*=Math.sqrt(y*y+E*E));break;case no:if(tt=Ct.endX,rt=Ct.endY,Ct.endX=tt*a+rt*x+b,Ct.endY=tt*y+rt*E+z,Ct.radiusX===0||Ct.radiusY===0)break;y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),Ct.xAxisRotation+=tt),0>a&&(Ct.xAxisRotation=180-Ct.xAxisRotation,Ct.isClockwiseArc=!Ct.isClockwiseArc),0>E&&(Ct.xAxisRotation=-Ct.xAxisRotation,Ct.isClockwiseArc=!Ct.isClockwiseArc),Ct.radiusX*=Math.sqrt(a*a+x*x),Ct.radiusY*=Math.sqrt(y*y+E*E);break;default:Gt("Unknown Segment type: "+Ct.type)}}}}return this._isInvalidBounds=!0,this},wt.ca=function(a,y){y===void 0&&(y=0);var x=this.od,E=this.pd,b=this.Dc,z=this.Ec;switch(this.type){case ce.j:return _t.Yb(x,E,b,z,y,a.x,a.y);case ce.u:var tt=Te.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),Te.free(tt),a;case ce.F:tt=Math.min(x,b)-y;var rt=Math.min(E,z)-y;return x=(Math.abs(b-x)+2*y)/2,y=(Math.abs(z-E)+2*y)/2,0>=x||0>=y?!1:(tt=a.x-(tt+x),rt=a.y-(rt+y),1>=tt*tt/(x*x)+rt*rt/(y*y));case ce.o:return kr(this,a,y,!0,!1);default:return!1}};function kr(a,y,x,E,b){var z=y.x;y=y.y;for(var tt=a.bounds.x-20,rt=0,ot,lt,ut,ft,yt=a.figures.s,xt=yt.length,Ct=0;Ct<xt;Ct++){var bt=yt[Ct],Vt=!bt.isEvenOdd;if(bt.isFilled){if(E&&bt.ca(z,y,x))return!0;var zt=bt.segments;ot=bt.startX,lt=bt.startY;for(var $t=ot,ie=lt,oe=zt.s,de=0;de<=zt.length;de++){var ke=void 0;if(de!==zt.length){ke=oe[de];var Hn=ke.type;a=ke.endX,ft=ke.endY}else Hn=Qi,a=$t,ft=ie;switch(Hn){case ar:if($t=ur(z,y,tt,y,ot,lt,$t,ie),isNaN($t))return!0;rt+=$t,$t=a,ie=ft;break;case Qi:if(ot=ur(z,y,tt,y,ot,lt,a,ft),isNaN(ot))return!0;rt+=ot;break;case br:ut=_t.Fo(ot,lt,ke.point1X,ke.point1Y,ke.point2X,ke.point2Y,a,ft,tt,y,z,y,.5),rt+=ut;break;case Fr:ut=_t.Fo(ot,lt,(ot+2*ke.point1X)/3,(lt+2*ke.point1Y)/3,(2*ke.point1X+a)/3,(2*ke.point1Y+ft)/3,a,ft,tt,y,z,y,.5),rt+=ut;break;case Dr:case no:Hn=ke.type===Dr?eo(ke,bt):Vi(ke,bt,ot,lt);var ci=Hn.length;if(ci===0){if(ot=ur(z,y,tt,y,ot,lt,ke.type===Dr?ke.centerX:ke.endX,ke.type===Dr?ke.centerY:ke.endY),isNaN(ot))return!0;rt+=ot;break}ke=null;for(var ai=0;ai<ci;ai++){if(ke=Hn[ai],ai===0){if(ut=ur(z,y,tt,y,ot,lt,ke[0],ke[1]),isNaN(ut))return!0;rt+=ut}ut=_t.Fo(ke[0],ke[1],ke[2],ke[3],ke[4],ke[5],ke[6],ke[7],tt,y,z,y,.5),rt+=ut}ke!==null&&(a=ke[6],ft=ke[7]);break;default:Gt("Unknown Segment type: "+ke.type)}ot=a,lt=ft}if(Vt){if(rt!==0)return!0}else if(rt%2!==0)return!0;rt=0}else if(bt.ca(z,y,b?x:x+2))return!0}return!1}function ur(a,y,x,E,b,z,tt,rt){if(_t.Yb(b,z,tt,rt,.05,a,y))return NaN;var ot=(a-x)*(z-rt);if(ot===0)return 0;var lt=((a*E-y*x)*(b-tt)-(a-x)*(b*rt-z*tt))/ot;if(y=(a*E-y*x)*(z-rt)/ot,lt>=a)return 0;if((b>tt?b-tt:tt-b)<(z>rt?z-rt:rt-z)){if(z<rt){if(y<z||y>rt)return 0}else if(y<rt||y>z)return 0}else if(b<tt){if(lt<b||lt>tt)return 0}else if(lt<tt||lt>b)return 0;return 0<ot?1:-1}function wr(a,y,x,E){a=a.figures.s;for(var b=a.length,z=0;z<b;z++)if(a[z].ca(y,x,E))return!0;return!1}wt.Pu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=new At),this.type===ce.j)return y.h(this.startX+a*(this.endX-this.startX),this.startY+a*(this.endY-this.startY)),y;for(var x=this.flattenedSegments,E=this.flattenedLengths,b=x.length,z=this.flattenedTotalLength*a,tt=0,rt=0;rt<b;rt++){var ot=E[rt],lt=ot.length;for(a=0;a<lt;a++){var ut=ot[a];if(tt+ut>=z)return E=z-tt,E=ut===0?0:E/ut,x=x[rt],rt=x[2*a],b=x[2*a+1],y.h(rt+(x[2*a+2]-rt)*E,b+(x[2*a+3]-b)*E),y;tt+=ut}}return y},wt.wx=function(a){if(0>a?a=0:1<a&&(a=1),this.type===ce.j)return 180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI;for(var y=this.flattenedSegments,x=this.flattenedLengths,E=y.length,b=this.flattenedTotalLength*a,z=0,tt=0;tt<E;tt++){var rt=x[tt],ot=rt.length;for(a=0;a<ot;a++){var lt=rt[a];if(z+lt>=b)return b=y[tt],y=b[2*a],x=b[2*a+1],E=b[2*a+2],a=b[2*a+3],1>Math.abs(E-y)&&1>Math.abs(a-x)?0:1>Math.abs(E-y)?0<=a-x?90:270:1>Math.abs(a-x)?0<=E-y?0:180:180*Math.atan2(a-x,E-y)/Math.PI;z+=lt}}return NaN},wt.Qu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=[]),y.length=3,this.type===ce.j)return y[0]=this.startX+a*(this.endX-this.startX),y[1]=this.startY+a*(this.endY-this.startY),y[2]=180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI,y;for(var x=this.flattenedSegments,E=this.flattenedLengths,b=x.length,z=this.flattenedTotalLength*a,tt=0,rt=0;rt<b;rt++){var ot=E[rt],lt=ot.length;for(a=0;a<lt;a++){var ut=ot[a];if(tt+ut>=z)return E=z-tt,E=ut===0?0:E/ut,ut=x[rt],x=ut[2*a],rt=ut[2*a+1],b=ut[2*a+2],a=ut[2*a+3],y[0]=x+(b-x)*E,y[1]=rt+(a-rt)*E,y[2]=1>Math.abs(b-x)&&1>Math.abs(a-rt)?0:1>Math.abs(b-x)?0<=a-rt?90:270:1>Math.abs(a-rt)?0<=b-x?0:180:180*Math.atan2(a-rt,b-x)/Math.PI,y;tt+=ut}}return y},wt.xx=function(a){if(this.type===ce.j){var y=this.startX,x=this.startY,E=this.endX,b=this.endY;if(y!==E||x!==b){var z=a.x;if(a=a.y,y===E){if(x<b){var tt=x;E=b}else tt=b,E=x;return a<=tt?tt===x?0:1:a>=E?E===x?0:1:Math.abs(a-x)/(E-tt)}if(x===b)return y<E?tt=y:(tt=E,E=y),z<=tt?tt===y?0:1:z>=E?E===y?0:1:Math.abs(z-y)/(E-tt);tt=(E-y)*(E-y)+(b-x)*(b-x);var rt=At.alloc();return _t.qh(y,x,E,b,z,a,rt),a=rt.x,z=rt.y,At.free(rt),Math.sqrt(((a-y)*(a-y)+(z-x)*(z-x))/tt)}}else if(this.type===ce.u){tt=this.startX,rt=this.startY;var ot=this.endX;if(b=this.endY,tt!==ot||rt!==b){y=ot-tt,x=b-rt,z=2*y+2*x,E=a.x,a=a.y,E=Math.min(Math.max(E,tt),ot),a=Math.min(Math.max(a,rt),b),tt=Math.abs(E-tt),ot=Math.abs(E-ot),rt=Math.abs(a-rt),b=Math.abs(a-b);var lt=Math.min(tt,ot,rt,b);if(lt===rt)return E/z;if(lt===ot)return(y+a)/z;if(lt===b)return(2*y+x-E)/z;if(lt===tt)return(2*y+2*x-a)/z}}else{y=this.flattenedSegments,x=this.flattenedLengths,z=this.flattenedTotalLength,E=At.alloc(),b=1/0,rt=tt=0,ot=y.length;for(var ut=lt=0,ft=0;ft<ot;ft++)for(var yt=y[ft],xt=x[ft],Ct=yt.length,bt=0;bt<Ct;bt+=2){var Vt=yt[bt],zt=yt[bt+1];if(bt!==0){_t.qh(lt,ut,Vt,zt,a.x,a.y,E);var $t=(E.x-a.x)*(E.x-a.x)+(E.y-a.y)*(E.y-a.y);$t<b&&(b=$t,tt=rt,tt+=Math.sqrt((E.x-lt)*(E.x-lt)+(E.y-ut)*(E.y-ut))),rt+=xt[(bt-2)/2]}lt=Vt,ut=zt}return At.free(E),a=tt/z,0>a?0:1<a?1:a}return 0};function vo(a){if(a.tk===null){var y=a.tk=[],x=a.ym=[],E=[],b=[];if(a.type===ce.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===ce.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===ce.F){var z=new Ir;z.startX=a.endX,z.startY=(a.startY+a.endY)/2;var tt=new Ui(Dr);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=eo(tt,z),b=a.length,b===0)E.push(tt.centerX),E.push(tt.centerY);else{tt=z.startX,z=z.startY;for(var rt=0;rt<b;rt++){var ot=a[rt];_t.Qe(tt,z,ot[2],ot[3],ot[4],ot[5],ot[6],ot[7],.5,E),tt=ot[6],z=ot[7]}}y.push(E),x.push(Xr(E))}else for(a=a.figures.iterator;a.next();){b=a.value,E=[],E.push(b.startX),E.push(b.startY),tt=b.startX,z=b.startY,rt=tt,ot=z;for(var lt=b.segments.s,ut=lt.length,ft=0;ft<ut;ft++){var yt=lt[ft];switch(yt.type){case ar:4<=E.length&&(y.push(E),x.push(Xr(E))),E=[],E.push(yt.endX),E.push(yt.endY),tt=yt.endX,z=yt.endY,rt=tt,ot=z;break;case Qi:E.push(yt.endX),E.push(yt.endY),tt=yt.endX,z=yt.endY;break;case br:_t.Qe(tt,z,yt.point1X,yt.point1Y,yt.point2X,yt.point2Y,yt.endX,yt.endY,.5,E),tt=yt.endX,z=yt.endY;break;case Fr:_t.ep(tt,z,yt.point1X,yt.point1Y,yt.endX,yt.endY,.5,E),tt=yt.endX,z=yt.endY;break;case Dr:var xt=eo(yt,b),Ct=xt.length;if(Ct===0){E.push(yt.centerX),E.push(yt.centerY),tt=yt.centerX,z=yt.centerY;break}for(var bt=0;bt<Ct;bt++){var Vt=xt[bt];_t.Qe(tt,z,Vt[2],Vt[3],Vt[4],Vt[5],Vt[6],Vt[7],.5,E),tt=Vt[6],z=Vt[7]}break;case no:if(xt=Vi(yt,b,tt,z),Ct=xt.length,bt=yt.endX,Vt=yt.endY,Ct===0){E.push(bt),E.push(Vt),tt=bt,z=Vt;break}for(bt=0;bt<Ct;bt++)Vt=xt[bt],_t.Qe(tt,z,Vt[2],Vt[3],Vt[4],Vt[5],Vt[6],Vt[7],.5,E),tt=Vt[6],z=Vt[7];break;default:Gt("Segment not of valid type: "+yt.type)}yt.isClosed&&(E.push(rt),E.push(ot))}4<=E.length&&(y.push(E),x.push(Xr(E)))}}}function Xr(a){for(var y=[],x=0,E=0,b=a.length,z=0;z<b;z+=2){var tt=a[z],rt=a[z+1];z!==0&&y.push(Math.sqrt(Ti(x,E,tt,rt))),x=tt,E=rt}return y}wt.add=function(a){return this.ee.add(a),this},wt.pm=function(a,y,x,E,b,z,tt,rt){return this._isFrozen&&me(this),this.fg=new gi(a,y,b,z).freeze(),this.gg=new gi(x,E,tt,rt).freeze(),this},Se.Object.defineProperties(ce.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 vo(this),this.tk}},flattenedLengths:{get:function(){return vo(this),this.ym}},flattenedTotalLength:{get:function(){var a=this.zm;if(isNaN(a)){if(this.type===ce.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===ce.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&&me(this,a),this.na=a,a===ce.o?this.ee=new cn:(ce.V===null&&(ce.V=new cn().freeze()),this.ee=ce.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(a){this.od!==a&&(this._isFrozen&&me(this,a),this.od=a,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(a){this.pd!==a&&(this._isFrozen&&me(this,a),this.pd=a,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(a){this.Dc!==a&&(this._isFrozen&&me(this,a),this.Dc=a,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(a){this.Ec!==a&&(this._isFrozen&&me(this,a),this.Ec=a,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(a){this.ee!==a&&(this._isFrozen&&me(this,a),this.ee=a,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(a){this._isFrozen&&me(this,a),this.fg=a.J()}},spot2:{get:function(){return this.gg},set:function(a){this._isFrozen&&me(this,a),this.gg=a.J()}},defaultStretch:{get:function(){return this.Uf},set:function(a){this._isFrozen&&me(this,a),this.Uf=a}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),ce.prototype.setSpots=ce.prototype.pm,ce.prototype.add=ce.prototype.add,ce.prototype.getFractionForPoint=ce.prototype.xx,ce.prototype.getPointAndAngleAlongPath=ce.prototype.Qu,ce.prototype.getAngleAlongPath=ce.prototype.wx,ce.prototype.getPointAlongPath=ce.prototype.Pu,ce.prototype.containsPoint=ce.prototype.ca,ce.prototype.transform=ce.prototype.transform,ce.prototype.rotate=ce.prototype.rotate,ce.prototype.scale=ce.prototype.scale,ce.prototype.offset=ce.prototype.offset,ce.prototype.normalize=ce.prototype.normalize,ce.prototype.computeBoundsWithoutOrigin=ce.prototype.ix,ce.prototype.equalsApprox=ce.prototype.Xa,ce.className="Geometry",ce.j=new en(ce,"Line",0),ce.u=new en(ce,"Rectangle",1),ce.F=new en(ce,"Ellipse",2),ce.o=new en(ce,"Path",3),ce.V=null,ce.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",ce.className="Geometry",ce.stringify=ce.ia,ce.fillPath=ce.nb,ce.parse=ce.parse,ce.Line=ce.j,ce.Rectangle=ce.u,ce.Ellipse=ce.F,ce.Path=ce.o;function Ir(a,y,x,E,b){Wi(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 cn,this.sr=this.pl.Ja,this.fw=null}Ir.prototype.copy=function(){var a=new Ir;a.l=this.l&-2,a.od=this.od,a.pd=this.pd;for(var y=this.pl.s,x=y.length,E=a.pl,b=0;b<x;b++){var z=y[b].copy();E.add(z)}return a.sr=this.sr,a.fw=this.fw,a},wt=Ir.prototype,wt.Xa=function(a){if(!(a instanceof Ir&&_t.B(this.startX,a.startX)&&_t.B(this.startY,a.startY)))return!1;var y=this.segments.s;a=a.segments.s;var x=y.length;if(x!==a.length)return!1;for(var E=0;E<x;E++)if(!y[E].Xa(a[E]))return!1;return!0},wt.toString=function(a){a===void 0&&(a=-1);for(var y=0>a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a),x=this.segments.s,E=x.length,b=0;b<E;b++)y+=" "+x[b].toString(a);return y},wt.freeze=function(){this._isFrozen=!0;var a=this.segments;a.freeze();var y=a.s;a=a.length;for(var x=0;x<a;x++)y[x].freeze();return this},wt.ka=function(){this._isFrozen=!1;var a=this.segments;a.ka(),a=a.s;for(var y=a.length,x=0;x<y;x++)a[x].ka();return this},wt.Zu=function(){if(this._isInvalidBounds)return!0;var a=this.segments;if(this.sr!==a.Ja)return!0;a=a.s;for(var y=a.length,x=0;x<y;x++)if(a[x]._isInvalidBounds)return!0;return!1},wt.add=function(a){return this.pl.add(a),this},wt.ca=function(a,y,x){for(var E=this.startX,b=this.startY,z=E,tt=b,rt=this.segments.s,ot=rt.length,lt=0;lt<ot;lt++){var ut=rt[lt];switch(ut.type){case ar:z=ut.endX,tt=ut.endY,E=ut.endX,b=ut.endY;break;case Qi:if(_t.Yb(E,b,ut.endX,ut.endY,x,a,y))return!0;E=ut.endX,b=ut.endY;break;case br:if(_t.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 Fr:if(_t.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 Dr:case no:var ft=ut.type===Dr?eo(ut,this):Vi(ut,this,E,b),yt=ft.length,xt=ut.type===Dr?ut.centerX:ut.endX,Ct=ut.type===Dr?ut.centerY:ut.endY;if(yt===0){if(_t.Yb(E,b,xt,Ct,x,a,y))return!0;E=xt,b=Ct;break}for(xt=null,Ct=0;Ct<yt;Ct++)if(xt=ft[Ct],Ct===0&&_t.Yb(E,b,xt[0],xt[1],x,a,y)||_t.cs(xt[0],xt[1],xt[2],xt[3],xt[4],xt[5],xt[6],xt[7],.5,a,y,x))return!0;xt!==null&&(E=xt[6],b=xt[7]);break;default:Gt("Unknown Segment type: "+ut.type)}if(ut.isClosed&&(E!==z||b!==tt)&&_t.Yb(E,b,z,tt,x,a,y))return!0}return!1},Se.Object.defineProperties(Ir.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&&me(this,a),this.l=a?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(a){this._isFrozen&&me(this,a),this.l=a?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&me(this,a),this.l=a?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(a){this._isFrozen&&me(this,a),this.od=a,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(a){this._isFrozen&&me(this,a),this.pd=a,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(a){this._isFrozen&&me(this,a),this.pl=a,this._isInvalidBounds=!0}}}),Ir.prototype.add=Ir.prototype.add,Ir.prototype.equalsApprox=Ir.prototype.Xa,Ir.className="PathFigure";function Ui(a,y,x,E,b,z,tt,rt){Wi(this),a===void 0&&(a=Qi),this.na=a,this.l=2,y!==void 0?this.Dc=y:this.Dc=0,x!==void 0?this.Ec=x:this.Ec=0,E===void 0&&(E=0),b===void 0&&(b=0),z===void 0&&(z=0),tt===void 0&&(tt=0),a===no?(a=z%360,0>a&&(a+=360),this.Ne=a,this.Vh=0,this.Wh=Math.max(E,0),this.Pg=Math.max(b,0),typeof tt=="boolean"?tt&&(this.isLargeArc=!0):typeof tt=="number"&&tt&&(this.isLargeArc=!0),rt&&(this.isClockwiseArc=!0)):(this.Ne=E,this.Vh=b,a===Dr&&(z=Math.max(z,0)),this.Wh=z,typeof tt=="number"?(a===Dr&&(tt=Math.max(tt,0)),this.Pg=tt):this.Pg=0),this.ae=null}Ui.prototype.copy=function(){var a=new Ui;return a.na=this.na,a.l=this.l&-2,a.Dc=this.Dc,a.Ec=this.Ec,a.Ne=this.Ne,a.Vh=this.Vh,a.Wh=this.Wh,a.Pg=this.Pg,a},wt=Ui.prototype,wt.Xa=function(a){if(!(a instanceof Ui)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case ar:case Qi:return _t.B(this.endX,a.endX)&&_t.B(this.endY,a.endY);case br:return _t.B(this.endX,a.endX)&&_t.B(this.endY,a.endY)&&_t.B(this.point1X,a.point1X)&&_t.B(this.point1Y,a.point1Y)&&_t.B(this.point2X,a.point2X)&&_t.B(this.point2Y,a.point2Y);case Fr:return _t.B(this.endX,a.endX)&&_t.B(this.endY,a.endY)&&_t.B(this.point1X,a.point1X)&&_t.B(this.point1Y,a.point1Y);case Dr:return _t.B(this.startAngle,a.startAngle)&&_t.B(this.sweepAngle,a.sweepAngle)&&_t.B(this.centerX,a.centerX)&&_t.B(this.centerY,a.centerY)&&_t.B(this.radiusX,a.radiusX)&&_t.B(this.radiusY,a.radiusY);case no:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&_t.B(this.xAxisRotation,a.xAxisRotation)&&_t.B(this.endX,a.endX)&&_t.B(this.endY,a.endY)&&_t.B(this.radiusX,a.radiusX)&&_t.B(this.radiusY,a.radiusY);default:return!1}},wt.qb=function(a){a.classType===Ui&&(this.type=a)},wt.toString=function(a){switch(a===void 0&&(a=-1),this.type){case ar:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Qi:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case br: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 Fr: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 Dr: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 no:a=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.xAxisRotation.toFixed(a)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;default:a=this.type.toString()}return a+(this.isClosed?"z":"")},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.close=function(){return this.isClosed=!0,this};function eo(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=_t.jx(0,0,x<E?x:E,a.startAngle,a.startAngle+a.sweepAngle,!1);if(x!==E){var tt=ae.alloc();tt.reset(),x<E?tt.scale(1,E/x):tt.scale(x/E,1),ce.Ha(z,tt),ae.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 Vi(a,y,x,E){function b(bt,Vt,zt,$t){return(bt*$t<Vt*zt?-1:1)*Math.acos((bt*zt+Vt*$t)/(Math.sqrt(bt*bt+Vt*Vt)*Math.sqrt(zt*zt+$t*$t)))}if(a.ae!==null&&y._isInvalidBounds===!1)return a.ae;if(a.radiusX===0||a.radiusY===0)return a.ae=[],a.ae;y=a.Wh;var z=a.Pg;y===0&&(y=1e-4),z===0&&(z=1e-4);var tt=Math.PI/180*a.Ne,rt=a.isLargeArc,ot=a.isClockwiseArc,lt=a.Dc,ut=a.Ec,ft=Math.cos(tt),yt=Math.sin(tt),xt=ft*(x-lt)/2+yt*(E-ut)/2;tt=-yt*(x-lt)/2+ft*(E-ut)/2;var Ct=xt*xt/(y*y)+tt*tt/(z*z);return 1<Ct&&(y*=Math.sqrt(Ct),z*=Math.sqrt(Ct)),Ct=(rt===ot?-1:1)*Math.sqrt((y*y*z*z-y*y*tt*tt-z*z*xt*xt)/(y*y*tt*tt+z*z*xt*xt)),isNaN(Ct)&&(Ct=0),rt=Ct*y*tt/z,Ct=Ct*-z*xt/y,isNaN(rt)&&(rt=0),isNaN(Ct)&&(Ct=0),x=(x+lt)/2+ft*rt-yt*Ct,E=(E+ut)/2+yt*rt+ft*Ct,ut=b(1,0,(xt-rt)/y,(tt-Ct)/z),ft=(xt-rt)/y,lt=(tt-Ct)/z,xt=(-xt-rt)/y,rt=(-tt-Ct)/z,tt=b(ft,lt,xt,rt),xt=(ft*xt+lt*rt)/(Math.sqrt(ft*ft+lt*lt)*Math.sqrt(xt*xt+rt*rt)),-1>=xt?tt=Math.PI:1<=xt&&(tt=0),!ot&&0<tt&&(tt-=2*Math.PI),ot&&0>tt&&(tt+=2*Math.PI),ot=y>z?1:y/z,xt=y>z?z/y:1,y=_t.jx(0,0,y>z?y:z,ut,ut+tt,!0),z=ae.alloc(),z.reset(),z.translate(x,E),z.rotate(a.Ne,0,0),z.scale(ot,xt),ce.Ha(y,z),ae.free(z),a.ae=y,a.ae}Se.Object.defineProperties(Ui.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&&me(this,a),this.na=a,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(a){this._isFrozen&&me(this,a),this.Dc=a,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(a){this._isFrozen&&me(this,a),this.Ec=a,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(a){this._isFrozen&&me(this,a),this.Ne=a,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(a){this._isFrozen&&me(this,a),this.Vh=a,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(a){this._isFrozen&&me(this,a),this.Wh=a,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(a){this._isFrozen&&me(this,a),this.Pg=a,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(a){this._isFrozen&&me(this,a),this.Ne=a,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(a){this._isFrozen&&me(this,a),this.Vh=a,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(a){0>a&&En(a,">= zero",Ui,"radiusX"),this._isFrozen&&me(this,a),this.Wh=a,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(a){0>a&&En(a,">= zero",Ui,"radiusY"),this._isFrozen&&me(this,a),this.Pg=a,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(a){this._isFrozen&&me(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&&me(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&&me(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&&me(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&&me(this,a),a%=360,0>a&&(a+=360),this.Ne=a,this._isInvalidBounds=!0}}}),Ui.prototype.equalsApprox=Ui.prototype.Xa;var ar=new en(Ui,"Move",0),Qi=new en(Ui,"Line",1),br=new en(Ui,"Bezier",2),Fr=new en(Ui,"QuadraticBezier",3),Dr=new en(Ui,"Arc",4),no=new en(Ui,"SvgArc",4);Ui.className="PathSegment",Ui.Move=ar,Ui.Line=Qi,Ui.Bezier=br,Ui.QuadraticBezier=Fr,Ui.Arc=Dr,Ui.SvgArc=no;function Zi(){this.H=null,this.xu=new At(0,0).freeze(),this.mt=new At(0,0).freeze(),this.Bp=this.Rq=0,this.Cp=1,this.xq="",this.Wr=this.Tp=!1,this.Rp=this.Ep=0,this.xg=this.nq=this.tq=!1,this.Zp=null,this.Rr=0,this.xd=this.Nr=null}Zi.prototype.copy=function(){var a=new Zi;return this.clone(a)},Zi.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},Zi.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},Zi.prototype.So=function(a,y){var x=this.diagram;return x===null||Mg(x,a,y),y},Zi.prototype.Bz=function(a,y){var x=this.diagram;return x===null||(Mg(x,a,y),y.assign(x.Ps(y))),y},Se.Object.defineProperties(Zi.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}}}),Zi.prototype.getMultiTouchDocumentPoint=Zi.prototype.Bz,Zi.prototype.getMultiTouchViewPoint=Zi.prototype.So,Zi.className="InputEvent";function Br(){this.H=null,this.xa="",this.ar=this.Lr=null}Br.prototype.copy=function(){var a=new Br;return a.H=this.H,a.xa=this.xa,a.Lr=this.Lr,a.ar=this.ar,a},Br.prototype.toString=function(){var a="*"+this.name;return this.subject!==null&&(a+=":"+this.subject.toString()),this.parameter!==null&&(a+="("+this.parameter.toString()+")"),a},Se.Object.defineProperties(Br.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}}}),Br.className="DiagramEvent";function Pi(){this.Fm=pr,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}Pi.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},Pi.prototype.copy=function(){var a=new Pi;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=Re(y)&&typeof y.J=="function"?y.J():y,y=this.Rn,a.Rn=Re(y)&&typeof y.J=="function"?y.J():y,y=this.Mn,a.Mn=Re(y)&&typeof y.J=="function"?y.J():y,y=this.Ln,a.Ln=Re(y)&&typeof y.J=="function"?y.J():y,a},Pi.prototype.qb=function(a){a.classType===Pi&&(this.change=a)},Pi.prototype.toString=function(){var a="";return a=this.change===$i?a+"* ":this.change===pr?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===$i?this.oldValue!==null&&(a+=" "+this.oldValue):(this.object!==null&&(a+=ji(this.object)),this.oldValue!==null&&(a+=" old: "+ji(this.oldValue)),this.oldParam!==null&&(a+=" "+this.oldParam),this.newValue!==null&&(a+=" new: "+ji(this.newValue)),this.newParam!==null&&(a+=" "+this.newParam)),a},Pi.prototype.I=function(a){return a?this.oldValue:this.newValue},Pi.prototype.Dz=function(a){return a?this.oldParam:this.newParam},Pi.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},Pi.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},Pi.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},Pi.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},Se.Object.defineProperties(Pi.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===$i&&(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}}}),Pi.prototype.redo=Pi.prototype.redo,Pi.prototype.canRedo=Pi.prototype.canRedo,Pi.prototype.undo=Pi.prototype.undo,Pi.prototype.canUndo=Pi.prototype.canUndo,Pi.prototype.getParam=Pi.prototype.Dz,Pi.prototype.getValue=Pi.prototype.I,Pi.prototype.clear=Pi.prototype.clear;var $i=new en(Pi,"Transaction",-1),pr=new en(Pi,"Property",0),uo=new en(Pi,"Insert",1),yo=new en(Pi,"Remove",2);Pi.className="ChangedEvent",Pi.Transaction=$i,Pi.Property=pr,Pi.Insert=uo,Pi.Remove=yo;function Ro(){this.o=new cn().freeze(),this.xa="",this.j=!1}Ro.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},Ro.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()},Ro.prototype.canUndo=function(){return this.isComplete},Ro.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()}},Ro.prototype.canRedo=function(){return this.isComplete},Ro.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()}},Ro.prototype.ak=function(){if(this.isComplete){var a=this.changes;a.ka();for(var y=new Be,x=0;x<a.count;x++){var E=a.M(x);if(E!==null&&E.change===pr&&E.object){var b=y.get(E.object);b||(b=new Be,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()}},Se.Object.defineProperties(Ro.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}}}),Ro.prototype.optimize=Ro.prototype.ak,Ro.prototype.redo=Ro.prototype.redo,Ro.prototype.canRedo=Ro.prototype.canRedo,Ro.prototype.undo=Ro.prototype.undo,Ro.prototype.canUndo=Ro.prototype.canUndo,Ro.prototype.clear=Ro.prototype.clear,Ro.className="Transaction";function qi(){this.Pt=new gn,this.Jd=!1,this.u=new cn().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new cn().freeze(),this.hl=new cn,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}qi.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},qi.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},qi.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled,this.maxHistoryLength=a.maxHistoryLength,this.checksTransactionLevel=a.checksTransactionLevel},wt=qi.prototype,wt.Xw=function(a){this.Pt.add(a)},wt.Rx=function(a){this.Pt.remove(a)},wt.Ea=function(a){if(a===void 0&&(a=""),a===null&&(a=""),this.isUndoingRedoing)return!1;this.tt===!0&&(this.tt=!1,this.bi++,this.isInternalTransaction||this.Ob("StartingFirstTransaction",a,this.currentTransaction),0<this.bi&&this.bi--),this.isEnabled&&(this.Ie.ka(),this.Ie.add(a),this.Ie.freeze(),this.currentTransaction===null?this.hl.add(0):this.hl.add(this.currentTransaction.changes.count)),this.bi++;var y=this.transactionLevel===1;return y&&(this.isInternalTransaction||this.Ob("StartedTransaction",a,this.currentTransaction)),y},wt.eb=function(a){return a===void 0&&(a=""),Ia(this,!0,a)},wt.Kf=function(){return Ia(this,!1,"")};function Ia(a,y,x){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&Gn("Ending transaction without having started a transaction: "+x);var E=a.transactionLevel===1,b=a.currentTransaction;E&&y&&(a.isInternalTransaction||a.Ob("CommittingTransaction",x,b));var z=0;if(0<a.transactionLevel&&(a.bi--,a.isEnabled)){var tt=a.Ie.count;0<tt&&(x===""&&(x=a.Ie.M(0)),a.Ie.ka(),a.Ie.mb(tt-1),a.Ie.freeze()),tt=a.hl.count,0<tt&&(z=a.hl.M(tt-1),a.hl.mb(tt-1))}if(E){if(y)a.rq=!1,b===null&&x!==""&&(b=a.currentTransaction),a.isEnabled&&b!==null&&(b.isComplete||(b.isComplete=!0,b.name=x),a.lx(),y=a.history,y.ka(),E=a.maxHistoryLength,0<=E&&(E===0?y.clear():y.count>=E&&(z=y.M(0),z!==null&&z.clear(),y.mb(0),a.Ce--)),E===0||y.count!==0&&y.get(y.count-1)===b||(y.add(b),a.Ce++),y.freeze()),a.isInternalTransaction||a.Ob("CommittedTransaction",x,b);else{a.Fe=!0;try{a.isEnabled&&b!==null&&(b.isComplete=!0,b.undo())}finally{a.isInternalTransaction||a.Ob("RolledBackTransaction",x,b),a.Fe=!1}b!==null&&b.clear()}return a.Np=null,a.isPendingClear&&a.clear(),a.isPendingClear=!1,a.isPendingUnmodified=!1,!0}if(a.isEnabled&&!y&&b!==null){for(a=z,x=b.changes,b=x.count-1;b>=a;b--)y=x.M(b),y!==null&&y.undo(),x.ka(),x.mb(b);x.freeze()}return!1}wt.lx=function(){if(!this.isUndoingRedoing&&this.canRedo()){var a=this.history;a.ka();for(var y=a.count-1;y>this.historyIndex;y--){var x=a.M(y);x!==null&&x.clear(),a.mb(y),this.rq=!0}a.freeze()}},qi.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return!!(a!==null&&a.canUndo())},qi.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){Gn("undo error: "+y.toString())}finally{this.Ob("FinishedUndo","Undo",a),this.Fe=!1}}},qi.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return!!(a!==null&&a.canRedo())},qi.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){Gn("redo error: "+y.toString())}finally{this.Ob("FinishedRedo","Redo",a),this.Fe=!1}}},qi.prototype.Ob=function(a,y,x){x===void 0&&(x=null);var E=new Pi;for(E.change=$i,E.propertyName=a,E.object=x,E.oldValue=y,a=this.models;a.next();)y=a.value,E.model=y,y.ds(E)},qi.prototype.Tu=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var y=this.currentTransaction;y===null&&(this.Np=y=new Ro);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||Gn("Change not within a transaction: "+x.toString()))}},qi.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},Se.Object.defineProperties(qi.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}}}),qi.prototype.handleChanged=qi.prototype.Tu,qi.prototype.redo=qi.prototype.redo,qi.prototype.undo=qi.prototype.undo,qi.prototype.canUndo=qi.prototype.canUndo,qi.prototype.discardHistoryAfterIndex=qi.prototype.lx,qi.prototype.rollbackTransaction=qi.prototype.Kf,qi.prototype.commitTransaction=qi.prototype.eb,qi.prototype.startTransaction=qi.prototype.Ea,qi.prototype.removeModel=qi.prototype.Rx,qi.prototype.addModel=qi.prototype.Xw,qi.prototype.clear=qi.prototype.clear,qi.className="UndoManager";function Cr(){Wi(this),this.H=zu,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new Zi,this.Zr=-1}Cr.prototype.toString=function(){return this.name!==""?this.name+" Tool":ni(this.constructor)},Cr.prototype.updateAdornments=function(){},Cr.prototype.canStart=function(){return this.isEnabled},Cr.prototype.doStart=function(){},Cr.prototype.doActivate=function(){this.isActive=!0},Cr.prototype.doDeactivate=function(){this.isActive=!1},Cr.prototype.doStop=function(){},Cr.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},Cr.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")},Cr.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},Cr.prototype.doMouseMove=function(){},Cr.prototype.doMouseUp=function(){this.stopTool()},Cr.prototype.doMouseWheel=function(){},Cr.prototype.canStartMultiTouch=function(){return!0},Cr.prototype.standardPinchZoomStart=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,At.allocAt(NaN,NaN)),E=y.So(1,At.allocAt(NaN,NaN));if(x.w()&&E.w()&&(this.doCancel(),a.Ql("hasGestureZoom"))){a.Bw=a.scale;var b=E.x-x.x,z=E.y-x.y;a.Jw=Math.sqrt(b*b+z*z),y.bubbles=!1}At.free(x),At.free(E)},Cr.prototype.standardPinchZoomMove=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,At.allocAt(NaN,NaN)),E=y.So(1,At.allocAt(NaN,NaN));if(x.w()&&E.w()&&(this.doCancel(),a.Ql("hasGestureZoom"))){var b=E.x-x.x,z=E.y-x.y;z=Math.sqrt(b*b+z*z)/a.Jw,b=new At((Math.min(E.x,x.x)+Math.max(E.x,x.x))/2,(Math.min(E.y,x.y)+Math.max(E.y,x.y))/2),z*=a.Bw;var tt=a.commandHandler;if(z!==a.scale&&tt.canResetZoom(z)){var rt=a.zoomPoint;a.zoomPoint=b,tt.resetZoom(z),a.zoomPoint=rt}y.bubbles=!1}At.free(x),At.free(E)},Cr.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},Cr.prototype.doKeyUp=function(){},Cr.prototype.Ea=function(a){return a===void 0&&(a=this.name),this.transactionResult=null,this.diagram.Ea(a)},Cr.prototype.stopTransaction=function(){var a=this.diagram;return this.transactionResult===null?a.Kf():a.eb(this.transactionResult)},Cr.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.lastInput,x=a.Ol(y.documentPoint,!1);if(x!==null){if(Mr?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||(Mr?y.meta:y.control)||y.shift||a.clearSelection()}},Cr.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,co(a,E,x),E.handled};function co(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)}}}Cr.prototype.standardMouseOver=function(){var a=this.diagram,y=a.lastInput;if(a.animationManager.zb!==!0){var x=a.skipsUndoManager;a.skipsUndoManager=!0;var E=a.viewportBounds.ca(y.documentPoint)?a.ic(y.documentPoint,null,null):null;!y.event||y.event.type!=="pointercancel"&&y.event.type!=="pointerout"||(E=null),y.targetObject=E;var b=!1;if(E!==a.Ck){var z=a.Ck,tt=z;for(a.Ck=E,this.doCurrentObjectChanged(z,E),y.handled=!1;z!==null;){var rt=z.mouseLeave;if(rt!==null&&(E===z||E!==null&&E.rg(z)||(rt(y,z,E),b=!0,y.handled)))break;z=z.panel}for(z=tt,y.handled=!1;E!==null&&(tt=E.mouseEnter,!(tt!==null&&(z===E||z!==null&&z.rg(E)||(tt(y,E,z),b=!0,y.handled))));)E=E.panel;E=a.Ck}if(E!==null){for(z=E,tt="";z!==null&&(tt=z.cursor,tt==="");)z=z.panel;for(a.currentCursor=tt,y.handled=!1,z=E;z!==null&&(E=z.mouseOver,!(E!==null&&(E(y,z),b=!0,y.handled)));)z=z.panel}else this.doUpdateCursor(null),E=a.mouseOver,E!==null&&(E(y),b=!0);b&&a.$b(),a.skipsUndoManager=x}},Cr.prototype.doUpdateCursor=function(){var a=this.diagram;a&&(a.currentCursor="")},Cr.prototype.doCurrentObjectChanged=function(){},Cr.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===Fa&&!y.shift||b===Zo&&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===Fa&&y.shift||b===Zo&&!y.control){E=a.position.copy();var z=y.event;b=z.deltaMode;var tt=z.deltaX;z=z.deltaY;var rt="pixel";if(tt===0&&z===0||y.shift)!y.shift&&a.allowVerticalScroll?(x=3*x*a.scrollVerticalLineChange,a.scroll(rt,0<x?"up":"down",Math.abs(x))):y.shift&&a.allowHorizontalScroll&&(x=3*x*a.scrollHorizontalLineChange,a.scroll(rt,0<x?"left":"right",Math.abs(x)));else{switch(b){case 0:rt="pixel";break;case 1:rt="line";break;case 2:rt="page"}tt!==0&&a.allowHorizontalScroll&&(tt*=a.scrollHorizontalLineChange/16,a.scroll(rt,0<tt?"right":"left",Math.abs(tt))),z!==0&&a.allowVerticalScroll&&(z*=a.scrollVerticalLineChange/16,a.scroll(rt,0<z?"down":"up",Math.abs(z)))}this.doWheelChange(a,E,y)}}},Cr.prototype.doWheelChange=function(a,y,x){a.position.D(y)&&x.event.wheelDeltaX===0||(x.bubbles=!1)},Cr.prototype.standardWaitAfter=function(a,y){y===void 0&&(y=this.diagram.lastInput),this.cancelWaitAfter();var x=this,E=y.clone(this.yy);this.Zr=Di(function(){x.doWaitAfter(E)},a)},Cr.prototype.cancelWaitAfter=function(){this.Zr!==-1&&qe.clearTimeout(this.Zr),this.Zr=-1},Cr.prototype.doWaitAfter=function(){},Cr.prototype.findToolHandleAt=function(a,y){return a=this.diagram.ic(a,function(x){for(;x!==null&&!(x.panel instanceof Qr);)x=x.panel;return x}),a===null?null:a.part.category===y?a:null},Cr.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},Se.Object.defineProperties(Cr.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof be&&(this.H=a)}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},isEnabled:{get:function(){return this.Jd},set:function(a){this.Jd=a}},isActive:{get:function(){return this.nb},set:function(a){this.nb=a}},transactionResult:{get:function(){return this.wm},set:function(a){this.wm=a}}}),Cr.prototype.startTransaction=Cr.prototype.Ea,Cr.className="Tool";function Ar(){Cr.call(this),this.name="ToolManager",this.hb=new cn,this.ob=new cn,this.Hb=new cn,this.F=this.V=850,this.o=new nn(2,2).ja(),this.Ha=5e3,this.ia=Zo,this.u=hu,this.Mp=this.j=null,this.zj=-1}Le(Ar,Cr),Ar.prototype.initializeStandardTools=function(){},Ar.prototype.updateAdornments=function(a){var y=this.currentToolTip;if(y instanceof Qr&&this.Mp===a){var x=y.adornedObject;(a!==null?x.part===a:x===null)?this.showToolTip(y,x):this.hideToolTip()}},Ar.prototype.doMouseDown=function(){var a=this.diagram,y=a.lastInput;if(y.isTouchEvent&&this.gestureBehavior===Ys&&(y.bubbles=!1),y.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===Tl){y.bubbles=!0;return}if(this.gestureBehavior===Ys)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===Zo?this.mouseWheelBehavior=Fa:this.mouseWheelBehavior===Fa&&(this.mouseWheelBehavior=Zo)),this.doActivate(),this.standardWaitAfter(this.holdDelay,y)},Ar.prototype.doMouseMove=function(){var a=this.diagram,y=a.lastInput;if(y.isMultiTouch){if(this.gestureBehavior===Tl){y.bubbles=!0;return}if(this.gestureBehavior===Ys)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}}ea(this,a),a=y.event,a===null||a.type!=="pointermove"&&a.cancelable||(y.bubbles=!0)};function ea(a,y){a.standardMouseOver(),a.isBeyondDragSize()&&a.standardWaitAfter(a.isActive?a.holdDelay:a.hoverDelay,y.lastInput)}Ar.prototype.doCurrentObjectChanged=function(a,y){a=this.currentToolTip,a===null||y!==null&&a instanceof Qr&&(y===a||y.rg(a))||this.hideToolTip()},Ar.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()))},Ar.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)},Ar.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 Qr)||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()},Ar.prototype.showToolTip=function(a,y){var x=this.diagram;if(a!==this.currentToolTip&&this.hideToolTip(),a instanceof Qr){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 Lu&&a!==this.currentToolTip&&a.show(y,x,this);if(this.currentToolTip=a,this.zj!==-1&&(qe.clearTimeout(this.zj),this.zj=-1),a=this.toolTipDuration,0<a&&a!==1/0){var b=this;this.zj=Di(function(){b.hideToolTip()},a)}},Ar.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}},Ar.prototype.hideToolTip=function(){this.zj!==-1&&(qe.clearTimeout(this.zj),this.zj=-1);var a=this.diagram,y=this.currentToolTip;y!==null&&(y instanceof Qr?(a.remove(y),this.Mp!==null&&this.Mp.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Lu&&y.hide!==null&&y.hide(a,this),this.currentToolTip=null)},Ar.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()},Ar.prototype.doMouseWheel=function(){this.standardMouseWheel()},Ar.prototype.doKeyDown=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyDown()},Ar.prototype.doKeyUp=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyUp()},Ar.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},Ar.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},Ar.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)},Se.Object.defineProperties(Ar.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 Qr?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}}}),Ar.prototype.replaceStandardTool=Ar.prototype.gb;var Zo=new en(Ar,"WheelScroll",0),Fa=new en(Ar,"WheelZoom",1),Al=new en(Ar,"WheelNone",2),hu=new en(Ar,"GestureZoom",3),Ys=new en(Ar,"GestureCancel",4),Tl=new en(Ar,"GestureNone",5);Ar.className="ToolManager",Ar.WheelScroll=Zo,Ar.WheelZoom=Fa,Ar.WheelNone=Al,Ar.GestureZoom=hu,Ar.GestureCancel=Ys,Ar.GestureNone=Tl;function Oo(){Cr.call(this),this.name="Dragging",this.u=this.Sw=this.ob=!0,this.o=this.Ha=this.V=this.Oe=null,this.Ym=this.Hb=!1,this.tl=new At(NaN,NaN),this.Fr=new At,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new gn().freeze(),this.ia=new at,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var Ns;Le(Oo,Cr),Oo.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly&&!a.allowDragOut||!a.allowMove&&!a.allowCopy&&!a.allowDragOut||!a.allowSelect)return!1;var y=a.lastInput;return!y.left||a.currentTool!==this&&(!this.isBeyondDragSize()||y.isTouchEvent&&y.timestamp-a.firstInput.timestamp<this.Ik)?!1:this.findDraggablePart()!==null},Oo.prototype.findDraggablePart=function(){var a=this.diagram;if(a=a.Ol(a.firstInput.documentPoint,!1),a===null)return null;for(;a!==null&&!a.canSelect();)a=a.containingGroup;return a!==null&&(a.canMove()||a.canCopy())?a:null},Oo.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.Ol(a.firstInput.documentPoint,!1);if(y!==null){for(;y!==null&&!y.canSelect();)y=y.containingGroup;this.currentPart=y,this.currentPart===null||this.currentPart.isSelected||(a.R("ChangingSelection",a.selection),y=a.lastInput,(Mr?y.meta:y.control)||y.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.R("ChangedSelection",a.selection))}}},Oo.prototype.doActivate=function(){var a=this.diagram;this.Bn=null,this.currentPart===null&&this.standardMouseSelect();var y=this.currentPart;y!==null&&(y.canMove()||y.canCopy())&&(a.Fu(!0),sn=null,this.isActive=!0,this.tl.set(a.position),gl(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&&Bs(a),Sf(a,this.draggedParts),this.Ea("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,sn=this,tr=this.diagram,this.doSimulatedDragOut()))};function gl(a,y){if(a.dragsLink){var x=a.diagram;x.allowRelink&&(x.model.Wj()&&y.count===1&&y.first()instanceof kn?(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 _a,a.Oe.diagram=x),a.Oe.originalLink=a.draggedLink):(a.draggedLink=null,a.Oe=null))}}Oo.prototype.computeEffectiveCollection=function(a,y){return this.diagram.commandHandler.computeEffectiveCollection(a,y)},Oo.prototype.Pd=function(a){return a===void 0?new lh(jn):this.isGridSnapEnabled?new lh(new At(Math.round(1e3*a.x)/1e3,Math.round(1e3*a.y)/1e3)):new lh(a.copy())},Oo.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,a.Fu(!1),a.ug(),ol(this),sd(a,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<Ns.count){for(var y=Ns,x=y.length,E=0;E<x;E++){var b=y.M(E);Wo(b),bo(b),ol(b),b.diagram.ug()}y.clear()}Wo(this),this.tl.h(NaN,NaN),tr!==null&&(tr.currentCursor=""),sn=tr=null,bo(this),a.isMouseCaptured=!1,a.currentCursor="",a.Ns=!1,this.stopTransaction(),Lc(a,!0)},Oo.prototype.stopTransaction=function(){var a=this.diagram,y=Cr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y};function ol(a){var y=a.diagram,x=y.skipsUndoManager;y.skipsUndoManager=!0,pl(a,y.lastInput,null),y.skipsUndoManager=x,a.Cg.length=0}function Ph(){var a=sn;bo(a),is(a);var y=a.diagram;a.tl.w()&&(y.position=a.tl),y.ug()}Oo.prototype.doCancel=function(){bo(this),is(this);var a=this.diagram;this.tl.w()&&(a.position=this.tl),this.stopTool()},Oo.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput;this.isActive&&(y.key==="Esc"?this.doCancel():y.key!==a.previousInput.key&&this.doMouseMove())},Oo.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function Ul(a,y){if(a.copiedParts===null){var x=a.diagram;if((!y||!x.isReadOnly&&!x.isModelReadOnly)&&a.draggedParts!==null){var E=x.undoManager;for(E.isEnabled&&E.isInTransaction?E.currentTransaction!==null&&0<E.currentTransaction.changes.count&&(x.undoManager.Kf(),x.Ea("Drag")):is(a),x.skipsUndoManager=!y,x.partManager.addsToTemporaryLayer=!y,a.startPoint=x.firstInput.documentPoint,y=a.copiesEffectiveCollection?a.draggedParts.Lf():x.selection,y=x.Kj(y,x,!0),x=new Be,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 kn&&E.canCopy()&&x.add(E,a.Pd());a.copiedParts=x,gl(a,x.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,_h(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}function bo(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 kn&&(x.value.point=new At(0,0));a.doUpdateCursor(null)}y.skipsUndoManager=!1,y.partManager.addsToTemporaryLayer=!1,a.startPoint=y.firstInput.documentPoint}function Wo(a){if(a.draggedLink!==null){if(a.dragsLink&&a.Oe!==null){var y=a.Oe;y.diagram.remove(y.temporaryFromNode),y.diagram.remove(y.temporaryToNode),a.Oe.originalLink=null}a.draggedLink=null,a.Oe=null}}function Pa(a,y,x){var E=a.diagram,b=a.startPoint,z=At.alloc();z.assign(E.lastInput.documentPoint),a.moveParts(y,z.re(b),x),At.free(z),E.Gf("temporaryPixelRatio")===!0&&E.Yh===null&&30<E.$w&&(Bs(E),E.hk())}Oo.prototype.moveParts=function(a,y,x){x===void 0&&(x=!1);var E=this.diagram;E!==null&&ad(E,a,y,this.dragOptions,x)};function is(a){if(a.draggedParts!==null){for(var y=a.diagram,x=a.draggedParts.iterator;x.next();){var E=x.key;E.Zc()&&(E.location=x.value.point)}for(x=a.draggedParts.iterator;x.next();)if(E=x.key,E instanceof kn&&E.suspendsRouting){var b=x.value.point;a.draggedParts.add(E,a.Pd()),_h(E,-b.x,-b.y)}y.bd()}}function Qa(a,y){var x=a.diagram;a.dragsLink&&(a.draggedLink!==null&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),al(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=pl(a,b,E),!a.isActive&&sn===null)return;var rt=E!==null?E.part:null;if(rt===null||x.handlesDragDropForTopLevelParts&&rt.isTopLevel&&!(rt instanceof rr)){var ot=x.mouseDragOver;ot!==null&&(ot(b),tt=!0)}if(!a.isActive&&sn===null||(a.doDragOver(y,E),!a.isActive&&sn===null))return}finally{x.skipsUndoManager=z,tt&&x.bd()}a.Bn=E,x.isReadOnly||!x.allowMove&&!x.allowCopy||!x.allowHorizontalScroll&&!x.allowVerticalScroll||x.gs(b.viewPoint)}Oo.prototype.findDragOverObject=function(a){var y=this;return Zu(this.diagram,a,null,function(x){return x===null?x=!0:(x=x.part,x=!!(x===null||x instanceof Qr||x.layer.isTemporary||y.draggedParts&&y.draggedParts.contains(x)||y.copiedParts&&y.copiedParts.contains(x))),!x})},Oo.prototype.doUpdateCursor=function(a){var y=this.diagram;(a===null||this.Bn!==a)&&(!this.diagram.currentTool.isActive||this.mayCopy()?y.currentCursor=this.copyCursor:this.mayMove()?y.currentCursor=this.moveCursor:this.mayDragOut()&&(y.currentCursor=this.nodropCursor))};function pl(a,y,x){var E=!1,b=a.Cg.length,z=0<b?a.Cg[0]:null;if(x===z)return!1;y.handled=!1;for(var tt=0;tt<b;tt++){var rt=a.Cg[tt],ot=rt.mouseDragLeave;if(ot!==null&&(ot(y,rt,x),E=!0,y.handled))break}if(a.Cg.length=0,!a.isActive&&sn===null||x===null)return E;for(y.handled=!1,b=x;b!==null;)a.Cg.push(b),b=Yl(b);for(b=a.Cg.length,x=0;x<b&&(tt=a.Cg[x],rt=tt.mouseDragEnter,rt===null||(rt(y,tt,z),E=!0,!y.handled));x++);return E}function Yl(a){var y=a.panel;return y!==null?y:a instanceof Ai&&!(a instanceof rr)&&(a=a.containingGroup,a!==null&&a.handlesDragDropForMembers)?a:null}function du(a,y,x){var E=a.Oe;if(E===null)return null;var b=a.diagram.og(y,E.portGravity,function(lt){return E.findValidLinkablePort(lt,x)});a=At.alloc();var z=1/0,tt=null;for(b=b.iterator;b.next();){var rt=b.value;if(rt.part!==null){var ot=rt.ga(dr,a);ot=y.Bf(ot),ot<z&&(tt=rt,z=ot)}}return At.free(a),tt}function al(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=du(a,x.i(0),!1),z!==null&&(tt=z.part));var rt=null,ot=null;x.toNode===null&&(rt=du(a,x.i(x.pointsCount-1),!0),rt!==null&&(ot=rt.part)),b.isValidLink(tt,z,ot,rt)?y?(x.defaultFromPoint=x.i(0),x.defaultToPoint=x.i(x.pointsCount-1),x.suspendsRouting=!1,x.fromNode=tt,z!==null&&(x.fromPortId=z.portId),x.toNode=ot,rt!==null&&(x.toPortId=rt.portId),x.fromPort!==E.Mx&&E.R("LinkRelinked",x,E.Mx),x.toPort!==E.Nx&&E.R("LinkRelinked",x,E.Nx)):Ru(b,tt,z,ot,rt):Ru(b,null,null,null,null)}}}}Oo.prototype.doDragOver=function(){};function ml(a,y){var x=a.diagram;a.dragsLink&&al(a,!0),ol(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;rf(a,b,z),z=Yl(z)}}else z=x.mouseDrop,z!==null&&z(b);if(a.isActive||sn!==null){for(b=(a.copiedParts||a.draggedParts).iterator;b.next();)z=b.key,z instanceof qn&&z.linksConnected.each(function(rt){rt.suspendsRouting=!1});if(a.doDropOnto(y,E),a.isActive||sn!==null){for(a=Te.alloc(),y=x.selection.iterator;y.next();)E=y.value,E instanceof qn&&of(x,E,a);Te.free(a)}}}function rf(a,y,x){a=a.diagram,x=x.part,!a.handlesDragDropForTopLevelParts||!x.isTopLevel||x instanceof rr||(x=a.mouseDrop,x!==null&&x(y))}function of(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 kn},!0,function(b){return b instanceof kn},E),a.count!==0)for(a=a.iterator;a.next();)x=a.value,!x.Td(y)&&x.isAvoiding&&x.bb()}Oo.prototype.doDropOnto=function(){},Oo.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,y=a.lastInput;this.simulatedMouseMove(y.event,y.documentPoint,y.targetDiagram)||this.currentPart===null||this.draggedParts===null||(this.mayCopy()?(Ul(this,!1),Sf(a,this.copiedParts),Pa(this,this.copiedParts,!1),sd(a,this.copiedParts)):this.mayMove()?(bo(this),Pa(this,this.draggedParts,!0)):this.mayDragOut()?(Ul(this,!1),Pa(this,this.copiedParts,!1)):bo(this),Qa(this,a.lastInput.documentPoint))}},Oo.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,y=a.lastInput;if(!this.simulatedMouseUp(y.event,y.documentPoint,y.targetDiagram)){y=!1;var x=this.mayCopy();if(x&&this.copiedParts!==null?(bo(this),Ul(this,!0),Sf(a,this.copiedParts),Pa(this,this.copiedParts,!1),sd(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,bo(this),this.mayMove()&&(Pa(this,this.draggedParts,!0),Qa(this,a.lastInput.documentPoint))),this.Ym=!0,ml(this,a.lastInput.documentPoint),this.isActive){var E=x?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,y&&fg(this),a.Ya(),sd(a,this.draggedParts),this.transactionResult=x?"Copy":"Move",a.R(x?"SelectionCopied":"SelectionMoved",E)}this.stopTool(),x&&a.R("ChangedSelection",a.selection)}}},Oo.prototype.simulatedMouseMove=function(a,y,x){if(sn===null)return!1;var E=sn.diagram;x instanceof be||(x=null);var b=tr;return x!==b&&(b!==null&&b!==E&&(b.ug(),sn.isDragOutStarted=!1,b=b.toolManager.findTool("Dragging"),b!==null&&b.doSimulatedDragLeave()),tr=x,x!==null&&x!==E&&(Ph(),b=x.toolManager.findTool("Dragging"),b!==null&&(Ns.contains(b)||Ns.add(b),b.doSimulatedDragEnter())),this.doUpdateCursor(null)),x===null||x===E||!x.allowDrop||x.isReadOnly||!x.allowInsert?!1:(E=x.toolManager.findTool("Dragging"),E!==null&&(a!==null&&(a.targetTouches!==void 0&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),y=x.getMouse(a)),x.lastInput.documentPoint=y,x.lastInput.viewPoint=x.op(y),x.lastInput.down=!1,x.lastInput.up=!1,E.doSimulatedDragOver()),!0)},Oo.prototype.simulatedMouseUp=function(a,y,x){if(sn===null)return!1;var E=tr,b=sn.diagram;if(x===null)return sn.doCancel(),!0;if(x!==E){var z=E.toolManager.findTool("Dragging");if(E!==null&&E!==b&&z!==null)return E.ug(),sn.isDragOutStarted=!1,z.doSimulatedDragLeave(),!1;tr=x,E=x.toolManager.findTool("Dragging"),E!==null&&(Ph(),Ns.contains(E)||Ns.add(E),E.doSimulatedDragEnter())}return x!==this.diagram?(a!==null?(a.targetTouches!==void 0&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),y=x.getMouse(a)):y===null&&(y=new At),x.lastInput.documentPoint=y,x.lastInput.viewPoint=x.op(y),x.lastInput.down=!1,x.lastInput.up=!0,a=x.toolManager.findTool("Dragging"),a!==null&&a.doSimulatedDrop(),a=sn,a!==null&&(x=a.mayCopy(),a.transactionResult=x?"Copy":"Move",a.stopTool()),!0):!1};function fg(a){if(a.draggedParts!==null)for(var y=a.draggedParts.iterator;y.next();){var x=y.key;x instanceof qn&&(x=x.containingGroup,x===null||x.placeholder===null||a.draggedParts.contains(x)||x.placeholder.v())}}Oo.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(Mr?!a.lastInput.alt:!a.lastInput.control))return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},Oo.prototype.mayDragOut=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(!a.allowDragOut||!a.allowCopy||a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},Oo.prototype.mayMove=function(){var a=this.diagram;if(a.isReadOnly||!a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canMove())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canMove())},Oo.prototype.computeBorder=function(a,y,x){return this.Ym||this.draggedParts===null||this.draggedParts.contains(a)?null:x.assign(y)},Oo.prototype.Az=function(){return sn},Oo.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var y=sn;return!(y===null||y.diagram.model.dataFormat!==a.model.dataFormat)},Oo.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Cc(),xl(a),a.animationManager.Cc(),a=sn,a!==null&&(a.diagram.Ns=!1),this.doUpdateCursor(null)}},Oo.prototype.doSimulatedDragLeave=function(){var a=sn;a!==null&&a.doSimulatedDragOut(),this.doCancel()},Oo.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.Dm=!0;var y=sn;if(y!==null&&y.draggedParts!==null){if(!this.mayDragIn())return;af(this,y.draggedParts.Lf(),!1,a.firstInput),Pa(this,this.copiedParts,!1),Qa(this,a.lastInput.documentPoint)}a.animationManager.Dm=!1},Oo.prototype.doSimulatedDrop=function(){var a=this.diagram,y=sn;if(y!==null){var x=y.diagram;if(y.Ym=!0,bo(this),!this.mayDragIn())return;a.animationManager.Dm=!0,a.R("ChangingSelection",a.selection),this.Ea("Drop"),af(this,y.draggedParts.Lf(),!0,a.lastInput),Pa(this,this.copiedParts,!1);var E=new gn;this.copiedParts!==null&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0,E.add(b)})),ml(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 af(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=Te.alloc();b=E=1/0;for(var tt=-1/0,rt=-1/0,ot=y.iterator;ot.next();){var lt=ot.value;if(lt.isVisible()){var ut=lt.location;lt=ut.x,ut=ut.y,isNaN(lt)||isNaN(ut)||(lt<E&&(E=lt),ut<b&&(b=ut),lt>tt&&(tt=lt),ut>rt&&(rt=ut))}}for(E===1/0?z.h(0,0,0,0):z.h(E,b,tt-E,rt-b),E=z.x+z.width/2,b=z.y+z.height/2,Te.free(z),z=a.Fr,tt=new Be,rt=At.alloc(),ot=y.iterator;ot.next();)lt=ot.value,lt instanceof kn&&lt.canCopy()&&(ut=x.I(lt),ut!==null&&(ut.points=lt.points,_h(ut,z.x-E,z.y-b),ut.suspendsRouting=!0,tt.add(ut,a.Pd())));for(y=y.iterator;y.next();)lt=y.value,lt.Zc()&&lt.canCopy()&&(ot=x.I(lt),ot!==null&&(lt=lt.location,rt.h(z.x-(E-lt.x),z.y-(b-lt.y)),ot.location=rt,ot.Va(),tt.add(ot,a.Pd(rt))));At.free(rt),a.copiedParts=tt,gl(a,tt.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,_h(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}Oo.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ns=!1,this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor,this.Bn=null},Oo.prototype.computeMove=function(a,y,x,E){return x=this.diagram,x!==null?x.computeMove(a,y,this.dragOptions,E):new At},Se.Object.defineProperties(Oo.prototype,{isCopyEnabled:{get:function(){return this.ob},set:function(a){this.ob=a}},copiesEffectiveCollection:{get:function(){return this.u},set:function(a){this.u=a}},dragOptions:{get:function(){return this.ia},set:function(a){this.ia=a}},isGridSnapEnabled:{get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){this.dragOptions.isGridSnapEnabled=a}},isComplexRoutingRealtime:{get:function(){return this.hb},set:function(a){this.hb=a}},isGridSnapRealtime:{get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){this.dragOptions.isGridSnapRealtime=a}},gridSnapCellSize:{get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){this.dragOptions.gridSnapCellSize.D(a)||(a=a.J(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){this.dragOptions.gridSnapCellSpot.D(a)||(a=a.J(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){this.dragOptions.gridSnapOrigin.D(a)||(a=a.J(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{get:function(){return this.dragOptions.dragsLink},set:function(a){this.dragOptions.dragsLink=a}},dragsTree:{get:function(){return this.dragOptions.dragsTree},set:function(a){this.dragOptions.dragsTree=a}},copyCursor:{get:function(){return this.F},set:function(a){this.F=a}},moveCursor:{get:function(){return this.Oc},set:function(a){this.Oc=a}},nodropCursor:{get:function(){return this.Pc},set:function(a){this.Pc=a}},currentPart:{get:function(){return this.V},set:function(a){this.V=a}},copiedParts:{get:function(){return this.o},set:function(a){this.o=a}},draggedParts:{get:function(){return this.Ha},set:function(a){this.Ha=a}},draggingParts:{get:function(){return this.copiedParts!==null?this.copiedParts.Lf():this.draggedParts!==null?this.draggedParts.Lf():this.te}},draggedLink:{get:function(){return this.diagram.draggedLink},set:function(a){this.diagram.draggedLink=a}},isDragOutStarted:{get:function(){return this.Hb},set:function(a){this.Hb=a}},startPoint:{get:function(){return this.Fr},set:function(a){this.Fr.D(a)||this.Fr.assign(a)}},delay:{get:function(){return this.Ik},set:function(a){this.Ik=a}}}),Oo.prototype.getDraggingSource=Oo.prototype.Az;var sn=null,tr=null;Oo.className="DraggingTool",Ns=new cn,Ii("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)}),Ar.prototype.doCancel=function(){sn!==null&&sn.doCancel(),Cr.prototype.doCancel.call(this)};function mr(){Cr.call(this),this.te=100,this.Ha=!1,this.u="pointer";var a=new kn,y=new fr;y.isPanelMain=!0,y.stroke="blue",a.add(y),y=new fr,y.toArrow="Standard",y.fill="blue",y.stroke="blue",a.add(y),a.layerName="Tool",this.Ci=a,a=new qn,y=new fr,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=Xi,a.add(y),a.selectable=!1,a.layerName="Tool",this.Bi=a,this.j=y,a=new qn,y=new fr,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=Xi,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 Be,this.Of=this.gj=this.Pf=null}Le(mr,Cr),mr.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},mr.prototype.copyPortProperties=function(a,y,x,E,b){if(a!==null&&y!==null&&x!==null&&E!==null){var z=y.Df(),tt=nn.alloc();tt.width=y.naturalBounds.width*z,tt.height=y.naturalBounds.height*z,E.desiredSize=tt,nn.free(tt),b?(E.toSpot=y.toSpot,E.toEndSegmentLength=y.toEndSegmentLength):(E.fromSpot=y.fromSpot,E.fromEndSegmentLength=y.fromEndSegmentLength),x.locationSpot=dr,z=At.alloc(),x.location=y.ga(dr,z),At.free(z),E.angle=y.li(),this.portTargeted!==null&&this.portTargeted(a,y,x,E,b)}},mr.prototype.setNoTargetPortProperties=function(a,y,x){y!==null&&(y.desiredSize=Xi,y.fromSpot=lr,y.toSpot=lr),a!==null&&(a.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,a,y,x)},mr.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},mr.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof qn){var y=this.targetPort.part;this.isForwards?this.copyPortProperties(y,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(y,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort,!0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},mr.prototype.findValidLinkablePort=function(a,y){if(a===null)return null;var x=a.part;if(!(x instanceof qn))return null;for(;a!==null;){var E=y?a.toLinkable:a.fromLinkable;if(E===!0&&(a.portId!==null||a instanceof qn)&&(y?this.isValidTo(x,a):this.isValidFrom(x,a)))return a;if(E===!1)break;a=a.panel}return null},mr.prototype.findTargetPort=function(a){var y=this.diagram,x=y.lastInput.documentPoint,E=this.portGravity;0>=E&&(E=.1);var b=this,z=y.og(x,E,function(ft){return b.findValidLinkablePort(ft,a)},null,!0);for(E=1/0,y=null,z=z.iterator;z.next();){var tt=z.value,rt=tt.part;if(rt instanceof qn){var ot=tt.ga(dr,At.alloc()),lt=x.x-ot.x,ut=x.y-ot.y;At.free(ot),ot=lt*lt+ut*ut,ot<E&&(lt=this.validPortsCache.I(tt),lt!==null?lt&&(y=tt,E=ot):a&&this.isValidLink(this.originalFromNode,this.originalFromPort,rt,tt)||!a&&this.isValidLink(rt,tt,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(tt,!0),y=tt,E=ot):this.validPortsCache.add(tt,!1))}}return y!==null&&(x=y.part,x instanceof qn&&(x.layer===null||x.layer.allowLink))?y:null},mr.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},mr.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},mr.prototype.isInSameNode=function(a,y){return a===null||y===null?!1:a===y?!0:(a=a.part,y=y.part,a!==null&&a===y)},mr.prototype.isLinked=function(a,y){if(a===null||y===null)return!1;var x=a.part;if(!(x instanceof qn))return!1;a=a.portId,a===null&&(a="");var E=y.part;if(!(E instanceof qn))return!1;for(y=y.portId,y===null&&(y=""),y=E.Sd(y);y.next();)if(E=y.value,E.fromNode===x&&E.fromPortId===a)return!0;return!1},mr.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)},mr.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 gn;return E.add(a),hr(this,x,y,E)};function hr(a,y,x,E){if(y===x)return!0;var b=y.fromNode;return b!==null&&b.isLinkLabel&&(E.add(b),hr(a,b.labeledLink,x,E))?!0:(y=y.toNode,!!(y!==null&&y.isLinkLabel&&(E.add(y),hr(a,y.labeledLink,x,E))))}mr.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!==Nc){if(E===Hg){if(E=x||this.temporaryLink,E!==null&&!E.isTreeLink)return!0;for(E=y.linksConnected;E.next();){var b=E.value;if(b!==x&&b.isTreeLink&&b.toNode===y)return!1}return!Ci(this,a,y,x,!0)}if(E===Wg){if(E=x||this.temporaryLink,E!==null&&!E.isTreeLink)return!0;for(E=a.linksConnected;E.next();)if(b=E.value,b!==x&&b.isTreeLink&&b.fromNode===a)return!1;return!Ci(this,a,y,x,!0)}if(E===zg)return a===y?a=!0:(E=new gn,E.add(y),a=fo(this,E,a,y,x)),!a;if(E===Zg)return!Ci(this,a,y,x,!1);if(E===Gg)return a===y?a=!0:(E=new gn,E.add(y),a=Uo(this,E,a,y,x)),!a}return!0};function Ci(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&&Ci(a,tt,x,E,b)))return!0}return!1}function fo(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&&fo(a,y,tt,E,b)))return!0}return!1}function Uo(a,y,x,E,b){if(x===E)return!0;if(x===null||E===null||y.contains(x))return!1;y.add(x);for(var z=x.linksConnected;z.next();){var tt=z.value;if(tt!==b){var rt=tt.fromNode;if(tt=tt.toNode,rt=rt===x?tt:rt,rt!==x&&Uo(a,y,rt,E,b))return!0}}return!1}Se.Object.defineProperties(mr.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}}}),mr.className="LinkingBaseTool";function jo(){mr.call(this),this.name="Linking",this.V={},this.F=null,this.K=ko,this.Xd=null}Le(jo,mr),jo.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},jo.prototype.findLinkablePort=function(){var a=this.diagram,y=this.startObject;if(y===null&&(y=a.ic(a.firstInput.documentPoint,null,null)),y===null||(a=y.part,!(a instanceof qn)))return null;var x=this.direction;if(x===ko||x===ls){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===ko||x===oa)&&(y=this.findValidLinkablePort(y,!0),y!==null||this.startObject===a&&(y=a.port,this.findValidLinkablePort(y,!0)))?(this.isForwards=!1,y):null},jo.prototype.doActivate=function(){var a=this.diagram,y=this.findLinkablePort();y===null?this.stopTool():(this.Ea(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(this.temporaryToNode!==null&&(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=y,y=this.originalFromPort.part,y instanceof qn&&(this.originalFromNode=y),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(this.temporaryFromNode!==null&&(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=y,y=this.originalToPort.part,y instanceof qn&&(this.originalToNode=y),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),a.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.Va(),a.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.Va(),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.bb(),a.add(this.temporaryLink)),this.isActive=!0)},jo.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()},jo.prototype.doStop=function(){mr.prototype.doStop.call(this),this.startObject=null},jo.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,y=this.transactionResult=null,x=null,E=null,b=null,z=null;try{var tt=this.targetPort=this.findTargetPort(this.isForwards);if(tt!==null){var rt=tt.part;rt instanceof qn&&(this.isForwards?(this.originalFromNode!==null&&(y=this.originalFromNode,x=this.originalFromPort),E=rt,b=tt):(y=rt,x=tt,this.originalToNode!==null&&(E=this.originalToNode,b=this.originalToPort)))}else this.isForwards?this.originalFromNode!==null&&this.isUnconnectedLinkValid&&(y=this.originalFromNode,x=this.originalFromPort):this.originalToNode!==null&&this.isUnconnectedLinkValid&&(E=this.originalToNode,b=this.originalToPort);y!==null||E!==null?(z=this.insertLink(y,x,E,b),z!==null?(tt===null&&(this.isForwards?z.defaultToPoint=a.lastInput.documentPoint:z.defaultFromPoint=a.lastInput.documentPoint),a.allowSelect&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),z.isSelected=!0),this.transactionResult=this.name,a.R("LinkDrawn",z)):this.doNoLink(y,x,E,b)):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),z&&a.allowSelect&&a.R("ChangedSelection",a.selection)}}},jo.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(a===null)return!0;if(a instanceof kn)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)},jo.prototype.insertLink=function(a,y,x,E){return this.diagram.partManager.insertLink(a,y,x,E)},jo.prototype.doNoLink=function(){},Se.Object.defineProperties(jo.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 ko=new en(jo,"Either",0),ls=new en(jo,"ForwardsOnly",0),oa=new en(jo,"BackwardsOnly",0);jo.className="LinkingTool",jo.Either=ko,jo.ForwardsOnly=ls,jo.BackwardsOnly=oa;function _a(){mr.call(this),this.name="Relinking";var a=new fr;a.figure="Diamond",a.desiredSize=cr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=0,this.V=a,a=new fr,a.figure="Diamond",a.desiredSize=cr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=-1,this.Xd=a,this.F=null,this.Ew=new Te}Le(_a,mr),_a.prototype.updateAdornments=function(a){if(a!==null&&a instanceof kn){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)}},_a.prototype.makeAdornment=function(a,y){var x=new Qr;return x.type=Pn.Link,y=y?this.toHandleArchetype:this.fromHandleArchetype,y!==null&&x.add(y.copy()),x.adornedObject=a,x},_a.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},_a.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 Qr&&x.adornedPart instanceof kn))return;this.handle=y,this.isForwards=x===null||x.category==="RelinkTo",this.originalLink=x.adornedPart}this.Ea(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.originalFromPort=this.originalLink.fromPort,this.originalFromNode=this.originalLink.fromNode,this.originalToPort=this.originalLink.toPort,this.originalToNode=this.originalLink.toNode,this.Ew.set(this.originalLink.actualBounds),this.originalLink!==null&&0<this.originalLink.pointsCount&&(this.originalLink.fromNode===null&&(this.temporaryFromPort!==null&&(this.temporaryFromPort.desiredSize=Ni),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=Ni),this.temporaryToNode!==null&&(this.temporaryToNode.location=this.originalLink.i(this.originalLink.pointsCount-1)))),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0),a.add(this.temporaryFromNode),a.add(this.temporaryToNode),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.copyLinkProperties(this.originalLink,this.temporaryLink),this.temporaryLink.bb(),a.add(this.temporaryLink)),this.isActive=!0},_a.prototype.copyLinkProperties=function(a,y){if(a!==null&&y!==null){y.adjusting=a.adjusting,y.corner=a.corner;var x=a.curve;(x===Hf||x===Rh)&&(x=ws),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}},_a.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()},_a.prototype.doStop=function(){mr.prototype.doStop.call(this),this.handle=null},_a.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;this.transactionResult=null;var y=this.originalFromNode,x=this.originalFromPort,E=this.originalToNode,b=this.originalToPort,z=this.originalLink;try{if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null){var tt=this.targetPort.part;tt instanceof qn&&(this.isForwards?(E=tt,b=this.targetPort):(y=tt,x=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?b=E=null:x=y=null:z=null;z!==null?(this.reconnectLink(z,this.isForwards?E:y,this.isForwards?b:x,this.isForwards),this.targetPort===null&&(this.isForwards?z.defaultToPoint=a.lastInput.documentPoint:z.defaultFromPoint=a.lastInput.documentPoint,z.bb()),this.transactionResult=this.name,a.R("LinkRelinked",z,this.isForwards?this.originalToPort:this.originalFromPort)):this.doNoRelink(this.originalLink,this.isForwards),this.originalLink.Xo(this.Ew)}finally{this.stopTool()}}},_a.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},_a.prototype.doNoRelink=function(){};function Ru(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)}Se.Object.defineProperties(_a.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 Qr))throw Error("new handle is not in an Adornment: "+a);this.F=a}}}),_a.className="RelinkingTool",Ii("linkingTool",function(){return this.findTool("Linking")},function(a){this.gb("Linking",a,this.mouseMoveTools)}),Ii("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.gb("Relinking",a,this.mouseDownTools)});function er(){Cr.call(this),this.name="LinkReshaping";var a=new fr;a.figure="Rectangle",a.desiredSize=Or,a.fill="lightblue",a.stroke="dodgerblue",this.o=a,a=new fr,a.figure="Diamond",a.desiredSize=cr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor="move",this.u=a,this.F=3,this.Ts=this.j=null,this.Fw=new At,this.Yq=new cn}Le(er,Cr),er.prototype.Ru=function(a){return a&&a.reshapingBehavior.value!==0?a.reshapingBehavior:vl},er.prototype.om=function(a,y){a.reshapingBehavior=y},er.prototype.updateAdornments=function(a){if(a!==null&&a instanceof kn){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)}},er.prototype.makeAdornment=function(a){var y=a.part,x=y.pointsCount,E=y.isOrthogonal,b=null;if(y.points!==null&&1<x){b=new Qr,b.type=Pn.Link,x=y.firstPickIndex;var z=y.lastPickIndex,tt=E?1:0;if(y.resegmentable&&y.computeCurve()!==dl)for(var rt=x+tt;rt<z-tt;rt++){var ot=this.makeResegmentHandle(a,rt);ot!==null&&(ot.segmentIndex=rt,ot.segmentFraction=.5,ot.fromMaxLinks=999,b.add(ot))}for(tt=x+1;tt<z;tt++)if(rt=this.makeHandle(a,tt),rt!==null){if(rt.segmentIndex=tt,tt!==x)if(tt===x+1&&E){ot=y.i(x);var lt=y.i(x+1);_t.B(ot.x,lt.x)&&_t.B(ot.y,lt.y)&&(lt=y.i(x-1)),_t.B(ot.x,lt.x)?(this.om(rt,Xs),rt.cursor="n-resize"):_t.B(ot.y,lt.y)&&(this.om(rt,Ha),rt.cursor="w-resize")}else tt===z-1&&E?(ot=y.i(z-1),lt=y.i(z),_t.B(ot.x,lt.x)&&_t.B(ot.y,lt.y)&&(ot=y.i(z+1)),_t.B(ot.x,lt.x)?(this.om(rt,Xs),rt.cursor="n-resize"):_t.B(ot.y,lt.y)&&(this.om(rt,Ha),rt.cursor="w-resize")):tt!==z&&(this.om(rt,ih),rt.cursor="move");b.add(rt)}b.adornedObject=a}return b},er.prototype.makeHandle=function(){var a=this.handleArchetype;return a===null?null:a.copy()},er.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return a===null?null:a.copy()},er.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},er.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 kn){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}}},er.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},er.prototype.stopTransaction=function(){var a=this.diagram,y=Cr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},er.prototype.doCancel=function(){var a=this.adornedLink;a!==null&&(a.points=this.Yq),this.stopTool()},er.prototype.getResegmentingPoint=function(){return this.handle.ga(dr)},er.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))},er.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&&(us(this,tt,E,b,z,!0)||us(this,tt,E,b,z,!1))){var rt=y.points.copy();us(this,tt,E,b,z,!0)?(rt.cd(x-2,new At(tt.x,(z.y+tt.y)/2)),rt.cd(x+1,new At(z.x,(z.y+tt.y)/2))):(rt.cd(x-2,new At((z.x+tt.x)/2,tt.y)),rt.cd(x+1,new At((z.x+tt.x)/2,z.y))),rt.mb(x),rt.mb(x-1),y.points=rt,y.Wb()}else tt=y.i(x+2),Math.abs(b.x-z.x)<this.resegmentingDistance&&Math.abs(b.y-z.y)<this.resegmentingDistance&&(us(this,E,b,z,tt,!0)||us(this,E,b,z,tt,!1))&&(rt=y.points.copy(),us(this,E,b,z,tt,!0)?(rt.cd(x-1,new At(E.x,(E.y+tt.y)/2)),rt.cd(x+2,new At(tt.x,(E.y+tt.y)/2))):(rt.cd(x-1,new At((E.x+tt.x)/2,E.y)),rt.cd(x+2,new At((E.x+tt.x)/2,tt.y))),rt.mb(x+1),rt.mb(x),y.points=rt,y.Wb())}}else tt=At.alloc(),_t.qh(E.x,E.y,z.x,z.y,b.x,b.y,tt)&&tt.Bf(b)<this.resegmentingDistance*this.resegmentingDistance&&(E=y.points.copy(),E.mb(x),y.points=E,y.Wb()),At.free(tt)}a.Ya(),this.transactionResult=this.name,a.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function us(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}er.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===Xs?(y.L(x,y.i(x-1).x,a.y),y.L(x+1,y.i(x+2).x,a.y)):E===Ha&&(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===Xs?(y.L(x-1,y.i(x-2).x,a.y),y.L(x,y.i(x+1).x,a.y)):E===Ha&&(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);_t.B(z.x,b.x)&&_t.B(b.y,tt.y)?(_t.B(z.x,y.i(E-2).x)&&!_t.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),_t.B(tt.y,y.i(E+2).y)&&!_t.B(tt.x,y.i(E+2).x)?y.m(E+1,tt.x,a.y):y.L(E+1,tt.x,a.y)):_t.B(z.y,b.y)&&_t.B(b.x,tt.x)?(_t.B(z.y,y.i(E-2).y)&&!_t.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),_t.B(tt.x,y.i(E+2).x)&&!_t.B(tt.y,y.i(E+2).y)?y.m(E+1,a.x,tt.y):y.L(E+1,a.x,tt.y)):_t.B(z.x,b.x)&&_t.B(b.x,tt.x)?(_t.B(z.x,y.i(E-2).x)&&!_t.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),_t.B(tt.x,y.i(E+2).x)&&!_t.B(tt.y,y.i(E+2).y)?y.m(E+1,a.x,tt.y):y.L(E+1,a.x,tt.y)):_t.B(z.y,b.y)&&_t.B(b.y,tt.y)&&(_t.B(z.y,y.i(E-2).y)&&!_t.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),_t.B(tt.y,y.i(E+2).y)&&!_t.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(dr,At.alloc()),E=y.getLinkPointFromPoint(E,b,z,a,!0,At.alloc()),y.L(0,E.x,E.y),At.free(z),At.free(E)),E=y.toNode,b=y.toPort,E!==null&&(z=E.findVisibleNode(),z!==null&&z!==E&&(E=z,b=E.port)),x===y.pointsCount-2&&y.computeSpot(!1,b).Mc()&&(x=b.ga(dr,At.alloc()),a=y.getLinkPointFromPoint(E,b,x,a,!1,At.alloc()),y.L(y.pointsCount-1,a.x,a.y),At.free(x),At.free(a));y.zf()},er.prototype.computeReshape=function(a){var y=this.adornedLink,x=this.handle.segmentIndex;switch(this.Ru(this.handle)){case ih:return a;case Xs:return new At(y.i(x).x,a.y);case Ha:return new At(a.x,y.i(x).y);default:case vl:return y.i(x)}},Se.Object.defineProperties(er.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 Qr))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}}}),er.prototype.setReshapingBehavior=er.prototype.om,er.prototype.getReshapingBehavior=er.prototype.Ru;var vl=new en(er,"None",0),Ha=new en(er,"Horizontal",1),Xs=new en(er,"Vertical",2),ih=new en(er,"All",3);er.className="LinkReshapingTool",er.None=vl,er.Horizontal=Ha,er.Vertical=Xs,er.All=ih,Ii("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.gb("LinkReshaping",a,this.mouseDownTools)});function Ma(){Cr.call(this),this.name="Resizing",this.o=new nn(1,1).freeze(),this.j=new nn(9999,9999).freeze(),this.yg=new nn(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var a=new fr;a.alignmentFocus=dr,a.figure="Rectangle",a.desiredSize=Or,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.F=a,this.u=null,this.Xq=new At,this.Dw=new nn,this.Tn=new At,this.rt=new nn(0,0),this.qt=new nn(1/0,1/0),this.pt=new nn(1,1)}Le(Ma,Cr),Ma.prototype.updateAdornments=function(a){if(!(a===null||a instanceof kn)){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(),fd(a)&&this.updateResizeHandles(x,y),a.bh(this.name,x);return}}a.Jf(this.name)}},Ma.prototype.makeAdornment=function(a){var y=a.part.resizeAdornmentTemplate;if(y===null){y=new Qr,y.type=Pn.Spot,y.locationSpot=dr;var x=new Ps;x.isPanelMain=!0,y.add(x),y.add(this.makeHandle(a,jr)),y.add(this.makeHandle(a,mo)),y.add(this.makeHandle(a,so)),y.add(this.makeHandle(a,da)),y.add(this.makeHandle(a,Xa)),y.add(this.makeHandle(a,Aa)),y.add(this.makeHandle(a,Ga)),y.add(this.makeHandle(a,Ja))}else if(jl(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Ma.prototype.makeHandle=function(a,y){return a=this.handleArchetype,a===null?null:(a=a.copy(),a.alignment=y,a)},Ma.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=dr),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 Pn)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,y)}},Ma.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},Ma.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))},Ma.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=a.isMouseCaptured=!1},Ma.prototype.stopTransaction=function(){var a=this.diagram,y=Cr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Ma.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},Ma.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var y=this.rt,x=this.qt,E=this.pt,b=this.adornedObject.qs(a.lastInput.documentPoint,At.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),a.bd(),At.free(b)}},Ma.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var y=this.rt,x=this.qt,E=this.pt,b=this.adornedObject.qs(a.lastInput.documentPoint,At.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),At.free(b),a.Ya(),this.transactionResult=this.name,a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},Ma.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 rr){var E=new cn;if(E.add(a),!this.dragsMembers&&a.placeholder===null){var b=new at;b.dragsMembers=!1}y.moveParts(E,this.oppositePoint.copy().re(x),!0,b)}else a.location=a.location.copy().re(x).add(this.oppositePoint);y.bd()}},Ma.prototype.computeResize=function(a,y,x,E,b,z){y.Mc()&&(y=dr);var tt=this.adornedObject.naturalBounds,rt=tt.x,ot=tt.y,lt=tt.x+tt.width,ut=tt.y+tt.height,ft=1;if(!z){ft=tt.width;var yt=tt.height;0>=ft&&(ft=1),0>=yt&&(yt=1),ft=yt/ft}return yt=At.alloc(),_t.No(a.x,a.y,rt,ot,b.width,b.height,yt),a=tt.copy(),0>=y.x?0>=y.y?(a.x=Math.max(yt.x,lt-E.width),a.x=Math.min(a.x,lt-x.width),a.width=Math.max(lt-a.x,x.width),a.y=Math.max(yt.y,ut-E.height),a.y=Math.min(a.y,ut-x.height),a.height=Math.max(ut-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft):(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width),a.x=lt-a.width,a.y=ut-a.height)):1<=y.y?(a.x=Math.max(yt.x,lt-E.width),a.x=Math.min(a.x,lt-x.width),a.width=Math.max(lt-a.x,x.width),a.height=Math.max(Math.min(yt.y-ot,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft):(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width),a.x=lt-a.width)):(a.x=Math.max(yt.x,lt-E.width),a.x=Math.min(a.x,lt-x.width),a.width=lt-a.x,z||(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft,a.y=ot+.5*(ut-ot-a.height))):1<=y.x?0>=y.y?(a.width=Math.max(Math.min(yt.x-rt,E.width),x.width),a.y=Math.max(yt.y,ut-E.height),a.y=Math.min(a.y,ut-x.height),a.height=Math.max(ut-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft):(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width),a.y=ut-a.height)):1<=y.y?(a.width=Math.max(Math.min(yt.x-rt,E.width),x.width),a.height=Math.max(Math.min(yt.y-ot,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft):(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width))):(a.width=Math.max(Math.min(yt.x-rt,E.width),x.width),z||(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft,a.y=ot+.5*(ut-ot-a.height))):0>=y.y?(a.y=Math.max(yt.y,ut-E.height),a.y=Math.min(a.y,ut-x.height),a.height=ut-a.y,z||(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width,a.x=rt+.5*(lt-rt-a.width))):1<=y.y&&(a.height=Math.max(Math.min(yt.y-ot,E.height),x.height),z||(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width,a.x=rt+.5*(lt-rt-a.width))),At.free(yt),a},Ma.prototype.computeReshape=function(){var a=ln;return this.adornedObject instanceof fr&&(a=Ev(this.adornedObject)),!(a===wi||this.diagram.lastInput.shift)},Ma.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},Ma.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},Ma.prototype.computeCellSize=function(){var a=new nn(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},Se.Object.defineProperties(Ma.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 Qr))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 Qr)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}}}),Ma.className="ResizingTool",Ii("resizingTool",function(){return this.findTool("Resizing")},function(a){this.gb("Resizing",a,this.mouseDownTools)});function Ea(){Cr.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new At,this.ue=null;var a=new fr;a.figure="Ellipse",a.desiredSize=cr,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.o=a,this.j=null,this.Cw=0,this.kr=new At(NaN,NaN),this.u=0,this.F=50}Le(Ea,Cr),Ea.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)}},Ea.prototype.makeAdornment=function(a){var y=a.part.rotateAdornmentTemplate;if(y===null){y=new Qr,y.type=Pn.Position,y.locationSpot=dr;var x=this.handleArchetype;x!==null&&y.add(x.copy())}else if(jl(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Ea.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},Ea.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)},Ea.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(dr)},Ea.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)},Ea.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new At(NaN,NaN),this.isActive=a.isMouseCaptured=!1},Ea.prototype.stopTransaction=function(){var a=this.diagram,y=Cr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Ea.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},Ea.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))},Ea.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()},Ea.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()}},Ea.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},Se.Object.defineProperties(Ea.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 Qr))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 Qr)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}}}),Ea.className="RotatingTool",Ii("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function Xl(){Cr.call(this),this.name="ClickSelecting"}Le(Xl,Cr),Xl.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},Xl.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},Xl.className="ClickSelectingTool";function Dl(){Cr.call(this),this.name="Action",this.pk=null}Le(Dl,Cr),Dl.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},Dl.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()},Dl.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))}},Dl.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()},Dl.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())},Dl.prototype.doStop=function(){this.pk=null},Dl.className="ActionTool";function wh(){Cr.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new At(0,0)}Le(wh,Cr),wh.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)},wh.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint),this.stopTool()},wh.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 Ai)x.Zc()&&(jl(x),E=x.copy(),E!==null&&y.add(E));else if(x!==null){var b=y.model.copyNodeData(x);Re(b)&&(y.model.xf(b),E=y.Lc(b))}if(E!==null){var z=At.allocAt(a.x,a.y);this.isGridSnapEnabled&&yf(this.diagram,E,a,z),E.location=z,y.allowSelect&&(y.clearSelection(!0),E.isSelected=!0),At.free(z)}y.Ya(),this.transactionResult=this.name,y.R("PartCreated",E)}finally{this.stopTransaction(),y.R("ChangedSelection",y.selection)}return E},Se.Object.defineProperties(wh.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}}}),wh.className="ClickCreatingTool";function yl(){Cr.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var a=new Ai;a.layerName="Tool",a.selectable=!1;var y=new fr;y.name="SHAPE",y.figure="Rectangle",y.fill=null,y.stroke="magenta",a.add(y),this.j=a}Le(yl,Cr),yl.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))},yl.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0,a.isMouseCaptured=!0,a.skipsUndoManager=!0,a.add(this.box),this.doMouseMove()},yl.prototype.doDeactivate=function(){var a=this.diagram;a.ug(),a.remove(this.box),a.skipsUndoManager=!1,this.isActive=a.isMouseCaptured=!1},yl.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=nn.alloc().h(y.width,y.height);x.desiredSize=E,this.box.mm(y.x,y.y,!1),nn.free(E),(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},yl.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()},yl.prototype.computeBoxBounds=function(){var a=this.diagram;return new Te(a.firstInput.documentPoint,a.lastInput.documentPoint)},yl.prototype.selectInRect=function(a){var y=this.diagram,x=y.lastInput;if(a=y.ux(a,this.isPartialInclusion),Mr?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 cn,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)}},Se.Object.defineProperties(yl.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}}}),yl.className="DragSelectingTool";function $a(){Cr.call(this),this.name="Panning",this.Xt=new At,this.xy=new At,this.xg=!1;var a=this;this.Kw=function(){var y=a.diagram;y!==null&&y.removeEventListener(qe.document,"scroll",a.Kw,!1),a.stopTool()}}Le($a,Cr),$a.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())},$a.prototype.doActivate=function(){var a=this.diagram;this.xg?(a.lastInput.bubbles=!0,a.addEventListener(qe.document,"scroll",this.Kw,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Xt.assign(a.position)),this.isActive=!0},$a.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="",this.isActive=a.isMouseCaptured=!1},$a.prototype.doCancel=function(){var a=this.diagram;a.position=this.Xt,a.isMouseCaptured=!1,this.stopTool()},$a.prototype.doMouseMove=function(){this.move()},$a.prototype.doMouseUp=function(){this.move(),this.stopTool()},$a.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)}},Se.Object.defineProperties($a.prototype,{bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},originalPosition:{get:function(){return this.Xt}}}),$a.className="PanningTool",Ii("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.gb("ClickCreating",a,this.mouseUpTools)}),Ii("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.gb("ClickSelecting",a,this.mouseUpTools)}),Ii("panningTool",function(){return this.findTool("Panning")},function(a){this.gb("Panning",a,this.mouseMoveTools)}),Ii("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.gb("DragSelecting",a,this.mouseMoveTools)}),Ii("actionTool",function(){return this.findTool("Action")},function(a){this.gb("Action",a,this.mouseDownTools)});function Lu(){this.F=this.u=this.j=this.o=null}Se.Object.defineProperties(Lu.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}}}),Lu.className="HTMLInfo";function Ol(a,y,x){this.text=a,this.hx=y,this.visible=x}Ol.className="ContextMenuButtonInfo";function vs(){Cr.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new At,this.jt=null,this.Et=!1;var a=this;this.tu=function(){a.stopTool()}}Le(vs,Cr);function Jl(a){var y=new Lu;y.show=function(b,z,tt){tt.showDefaultContextMenu()},y.hide=function(b,z){z.hideDefaultContextMenu()},$h=y,a.tu=function(){a.stopTool()},y=Ki("div");var x=Ki("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=Ki("style");qe.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",sa,!1),E.addEventListener(y,"selectstart",sa,!1),E.addEventListener(x,"contextmenu",sa,!1)),y.className="goCXforeground",x.className="goCXbackground",qe.document.body&&(qe.document.body.appendChild(y),qe.document.body.appendChild(x)),gc=y,Td=x,fc=!0}function sa(a){return a.preventDefault(),!1}vs.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)},vs.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},vs.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},vs.prototype.findObjectWithContextMenu=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.lastInput,E=null;if(a instanceof be||(a instanceof fe?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},vs.prototype.doActivate=function(){},vs.prototype.doMouseDown=function(){if(Cr.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof Qr){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doMouseDown(),a.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&cu(this)},vs.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof Qr){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doCancel(),a.doDeactivate())}cu(this)};function cu(a){var y=a.diagram;if(a.isActive){var x=a.currentContextMenu;if(x!==null){var E=null;x instanceof Lu||(E=y.ic(y.lastInput.documentPoint,null,null),E!==null&&E.rg(x)&&a.standardMouseClick(null,null)),a.maybeStopTool(E)}}else a.canStart()&&(rh(a,!0),a.isActive||a.stopTool())}vs.prototype.maybeStopTool=function(){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this,this.doMouseUp())};function rh(a,y,x){if(x===void 0&&(x=null),!a.Et&&(a.Et=!0,y&&a.standardMouseSelect(),y=a.standardMouseClick(),a.Et=!1,!y)){if(a.isActive=!0,y=$h,x===null&&(x=a.findObjectWithContextMenu()),x!==null){var E=x.contextMenu;E!==null?(a.currentObject=x instanceof fe?x:null,a.showContextMenu(E,a.currentObject)):y!==null&&a.showContextMenu(y,a.currentObject)}else y!==null&&a.showContextMenu(y,null);a.currentContextMenu instanceof Qr&&!a.currentContextMenu.visible&&a.stopTool()}}vs.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},vs.prototype.showContextMenu=function(a,y){var x=this.diagram;if(a!==this.currentContextMenu&&this.hideContextMenu(),a instanceof Qr){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 Lu&&a.show(y,x,this);this.currentContextMenu=a},vs.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}},vs.prototype.hideContextMenu=function(){var a=this.diagram,y=this.currentContextMenu;y!==null&&(y instanceof Qr?(a.remove(y),this.ht!==null&&this.ht.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Lu&&(y.hide!==null?y.hide(a,this):y.mainElement!==null&&(y.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};function Ch(a){var y=new cn;return y.add(new Ol("Copy",function(x){x.commandHandler.copySelection()},function(x){return x.commandHandler.canCopySelection()})),y.add(new Ol("Cut",function(x){x.commandHandler.cutSelection()},function(x){return x.commandHandler.canCutSelection()})),y.add(new Ol("Delete",function(x){x.commandHandler.deleteSelection()},function(x){return x.commandHandler.canDeleteSelection()})),y.add(new Ol("Paste",function(x){x.commandHandler.pasteSelection(a.mouseDownPoint)},function(x){return x.commandHandler.canPasteSelection(a.mouseDownPoint)})),y.add(new Ol("Select All",function(x){x.commandHandler.selectAll()},function(x){return x.commandHandler.canSelectAll()})),y.add(new Ol("Undo",function(x){x.commandHandler.undo()},function(x){return x.commandHandler.canUndo()})),y.add(new Ol("Redo",function(x){x.commandHandler.redo()},function(x){return x.commandHandler.canRedo()})),y.add(new Ol("Scroll To Part",function(x){x.commandHandler.scrollToPart()},function(x){return x.commandHandler.canScrollToPart()})),y.add(new Ol("Zoom To Fit",function(x){x.commandHandler.zoomToFit()},function(x){return x.commandHandler.canZoomToFit()})),y.add(new Ol("Reset Zoom",function(x){x.commandHandler.resetZoom()},function(x){return x.commandHandler.canResetZoom()})),y.add(new Ol("Group Selection",function(x){x.commandHandler.groupSelection()},function(x){return x.commandHandler.canGroupSelection()})),y.add(new Ol("Ungroup Selection",function(x){x.commandHandler.ungroupSelection()},function(x){return x.commandHandler.canUngroupSelection()})),y.add(new Ol("Edit Text",function(x){x.commandHandler.editTextBlock()},function(x){return x.commandHandler.canEditTextBlock()})),y}vs.prototype.showDefaultContextMenu=function(){var a=this.diagram;this.jt===null&&(this.jt=Ch(this)),gc.innerHTML="",Td.addEventListener("pointerdown",this.tu,!1);var y=this,x=Ki("ul");x.className="goCXul",gc.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=Ki("li"),z.className="goCXli";var tt=Ki("a");tt.className="goCXa",tt.href="#",tt.ky=b.hx,tt.addEventListener("pointerdown",function(rt){return this.ky(a),y.stopTool(),rt.preventDefault(),!1},!1),tt.textContent=b.text,z.appendChild(tt),x.appendChild(z)}}gc.style.display="block",Td.style.display="block"},vs.prototype.hideDefaultContextMenu=function(){if(this.currentContextMenu!==null&&this.currentContextMenu===$h){gc.style.display="none",Td.style.display="none";var a=this.diagram;a!==null&&a.removeEventListener(Td,"pointerdown",this.tu,!1),this.currentContextMenu=null}},Se.Object.defineProperties(vs.prototype,{currentContextMenu:{get:function(){return this.j},set:function(a){this.j=a,this.ht=a instanceof Qr?a.adornedPart:null}},defaultTouchContextMenu:{get:function(){return fc===!1&&$h===null&&Qo&&Jl(this),$h},set:function(a){a===null&&(fc=!0),$h=a}},currentObject:{get:function(){return this.o},set:function(a){this.o=a}},mouseDownPoint:{get:function(){return this.yw}}});var $h=null,fc=!1,Td=null,gc=null;vs.className="ContextMenuTool",Ii("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.gb("ContextMenu",a,this.mouseUpTools)});function Go(){Cr.call(this),this.name="TextEditing",this.Zh=new To,this.ia=null,this.V=Dd,this.vj=null,this.qa=Od,this.u=1,this.F=!0,this.o=null,this.j=new Lu,this.kt=null,pc(this,this.j)}Le(Go,Cr);function pc(a,y){if(Qo){var x=Ki("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(mc)):b==="Tab"?(a.acceptText(lf),E.preventDefault()):b==="Escape"&&(a.doCancel(),a.diagram!==null&&a.diagram.doFocus())}},!1),x.addEventListener("focus",function(){if(a.currentTextEditor!==null&&a.state!==Od){var E=a.kt;a.qa===vc&&(a.qa=yc),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),x.addEventListener("blur",function(){if(a.currentTextEditor!==null&&a.state!==Od){var E=a.kt;typeof E.focus=="function"&&E.focus(),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),y.valueFunction=function(){return x.value},y.mainElement=x,y.show=function(E,b,z){if(E instanceof To&&z instanceof Go)if(z.state===Sc)x.style.border="3px solid red",x.focus();else{var tt=E.ga(dr),rt=b.position,ot=b.scale,lt=E.Df()*ot;lt<z.minimumEditorScale&&(lt=z.minimumEditorScale);var ut=E.naturalBounds.width*lt+6,ft=E.naturalBounds.height*lt+2,yt=(tt.x-rt.x)*ot;tt=(tt.y-rt.y)*ot,rt=E.verticalAlignment,ot=(E.lineHeight+E.spacingAbove+E.spacingBelow)*E.lineCount*lt,ft=rt.y*ft-rt.y*ot+rt.offsetY-(.5*ft-.5*ot)-ot/2,x.value=E.text,b.div.style.font=E.font,x.style.position="absolute",x.style.zIndex="100",x.style.font="inherit",x.style.fontSize=100*lt+"%",x.style.lineHeight="normal",x.style.width=ut+"px",x.style.left=(yt-ut/2|0)-1+"px",x.style.top=(tt+ft|0)-1+"px",x.style.textAlign=E.textAlign,x.style.margin="0",x.style.padding="1px",x.style.border="0",x.style.outline="none",x.style.whiteSpace="pre-wrap",x.style.overflow="hidden",x.rows=E.lineCount,x.wA=lt,x.className="goTXarea",b.div.appendChild(x),x.focus(),z.selectsTextOnActivate&&(x.select(),x.setSelectionRange(0,9999))}},y.hide=function(E){E.div.removeChild(x)}}}Go.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||a.isReadOnly||Eh&&Eh!==this&&(Eh.acceptText(Fu),Eh&&Eh!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var y=a.ic(a.lastInput.documentPoint);return y!==null&&y instanceof To&&y.editable&&y.part.canEdit()?(y=y.part,!(y===null||this.starting===Dd&&!y.isSelected||this.starting===uf&&2>a.lastInput.clickCount)):!1},Go.prototype.doStart=function(){Eh=this,this.textBlock!==null&&this.doActivate()},Go.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(a!==null){var y=this.textBlock;if(y===null&&(y=a.ic(a.lastInput.documentPoint)),y!==null&&y instanceof To&&(this.textBlock=y,y.part!==null)){a.animationManager.Cc(),this.isActive=!0,this.qa=vc;var x=this.defaultTextEditor;y.textEditor!==null&&(x=y.textEditor),this.Zh=this.textBlock.copy();var E=new Te(this.textBlock.ga(jr),this.textBlock.ga(so));a.tv(E),x.show(y,a,this),this.currentTextEditor=x}}}},Go.prototype.doCancel=function(){this.stopTool()},Go.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},Go.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Fu)},Go.prototype.acceptText=function(a){switch(a){case Fu:this.qa===Id?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.qa===vc||this.qa===Sc||this.qa===yc)&&(this.qa=pg,gg(this));break;case sf:case mc:case lf:(mc!==a||this.textBlock.isMultiline!==!0)&&(this.qa===vc||this.qa===Sc||this.qa===yc)&&(this.qa=pg,gg(this))}};function gg(a){var y=a.textBlock,x=a.diagram,E=a.currentTextEditor;if(y!==null&&E!==null){var b=y.text,z="";E.valueFunction!==null&&(z=E.valueFunction()),a.isValidText(y,b,z)?(a.Ea(a.name),a.qa=Id,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=Sc,a.doError(b,z))}}Go.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)},Go.prototype.doSuccess=function(a,y){var x=this.textBlock;x.textEdited!==null&&x.textEdited(x,a,y)},Go.prototype.doDeactivate=function(){var a=this.diagram;a!==null&&(this.qa=Od,this.currentTextEditor!==null&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)},Go.prototype.doStop=function(){Eh=null},Go.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)))},Go.prototype.Lx=function(a){var y=this.Zh;return y.text=a,y.measure(this.textBlock.Ih,1/0),y},Se.Object.defineProperties(Go.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)}}}),Go.prototype.measureTemporaryTextBlock=Go.prototype.Lx;var sf=new en(Go,"LostFocus",0),Fu=new en(Go,"MouseDown",1),lf=new en(Go,"Tab",2),mc=new en(Go,"Enter",3),q0=new en(Go,"SingleClick",0),Dd=new en(Go,"SingleClickSelected",1),uf=new en(Go,"DoubleClick",2),Od=new en(Go,"StateNone",0),vc=new en(Go,"StateActive",1),yc=new en(Go,"StateEditing",2),pg=new en(Go,"StateValidating",3),Sc=new en(Go,"StateInvalid",4),Id=new en(Go,"StateValidated",5),Eh=null;Go.className="TextEditingTool",Go.LostFocus=sf,Go.MouseDown=Fu,Go.Tab=lf,Go.Enter=mc,Go.SingleClick=q0,Go.SingleClickSelected=Dd,Go.DoubleClick=uf,Go.StateNone=Od,Go.StateActive=vc,Go.StateEditing=yc,Go.StateValidating=pg,Go.StateInvalid=Sc,Go.StateValidated=Id,Ii("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)});function Js(a){Pc||(mg(),Pc=!0),this.H=zu,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=ah,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new gn,this.ce=new qa,this.ce.Yd=this,this.Ei=new gn,this.pu=new gn,this.Sr=new gn,this.pr=new gn,a&&Object.assign(this,a)}Js.prototype.Xe=function(a){this.H=a},Js.prototype.canStart=function(){return!0};function ju(a,y){a.Jd&&a.canStart(y)&&(a.Zd.add(y),a.defaultAnimation.isAnimating&&a.Cc(),ts(a.H),a.zb=!0)}function hf(a){if(a.Jd&&a.zb){var y=a.ce,x=a.H,E=a.Zd.contains("Model");E&&(a.Ok=!0,a.Pk===ah?(y.isViewportUnconstrained=!0,y.vc.clear(),y.add(x,"position",x.position.copy().offset(0,-200),x.position),y.add(x,"opacity",0,1)):a.Pk===vg&&y.vc.clear(),a.Qw=!!(a.Pk===wc&&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(),Cc(y,x),a.Ok=!1,x.N()):(a.Zd.clear(),x.kg=!1,E=y.vc.get(x),x.autoScale!==hs&&E!==null&&(delete E.start.scale,delete E.end.scale),qe.requestAnimationFrame(function(){a.zb===!1||y.bc||(x.Gf("temporaryPixelRatio")&&Bs(x),wg(x),a.zb=!1,y.start(),y.bc&&(Lh(a),x.Ya(),yg(y,0),xl(x,!0),qh(a),x.R("AnimationStarting",a)))}))}}function oh(a){return a.Zd.contains("Trigger")&&a.Zd.count===1}function df(a,y,x,E){a.isTicking||oh(a)||y instanceof kn&&(y.fromNode!==null||y.toNode!==null)||a.ce.add(y,"position",x,E,!1)}wt=Js.prototype,wt.fv=function(a){return this.ce.fv(a)},wt.Xu=function(a){return this.ce.Xu(a)};function cf(a,y){function x(){if(0<b.Sr.count&&(E.addAll(b.Sr),b.Sr.clear(),b.bc=!0),b.bc!==!1&&E.count!==0){b.pu.addAll(E);for(var z=b.pu.iterator;z.next();){var tt=z.value;if(tt.bc!==!1){t:if(0<tt.yl.count)var rt=!0;else{for(rt=tt.vc.iterator;rt.next();){var ot=rt.key;if(ot instanceof fe&&ot.diagram!==null||ot instanceof be){rt=!0;break t}}rt=!1}rt?Ec(tt,!1):tt.Xk=!0}}b.pu.clear(),b.bc!==!1&&(Lh(b),xl(b.H),qh(b)),qe.requestAnimationFrame(x)}}var E=a.Ei,b=a;a.bc?a.Sr.add(y):(a.bc=!0,E.add(y),qe.requestAnimationFrame(function(){x()}))}function Hp(a){for(a=a.Ei.iterator;a.next();)a.value.Xk=!1}function Lh(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 qh(a){var y=a.H;y.skipsUndoManager=a.Ow,y.skipsModelSourceBindings=a.cw,a.vq=!1}wt.Cc=function(a){var y=this.ce;if(this.zb===!0&&(this.Ok=this.zb=!1,this.Zd.clear(),0<y.vc.count&&this.H.$b()),this.bc){if(y.Ml(!0),y.vc.clear(),Cc(y,null),a===!0)for(a=this.Ei.Fa(),y=0;y<a.length;y++)a[y].Ml(!0)}else y.vc.clear(),Cc(y,this.H)},wt.Ml=function(a){a===this.defaultAnimation&&this.defaultAnimation.vc.clear(),this.Ei.remove(a),this.Ei.count===0&&(this.bc=!1,this.H.$b()),a===this.defaultAnimation&&(this.defaultAnimation.vc.clear(),this.H.R("AnimationFinished",this))},wt.Cj=function(a,y){this.zb&&(this.Zd.contains("Expand Tree")||this.Zd.contains("Expand SubGraph"))&&(this.ce.Cj(a,y),Zs(this,a))},wt.Aj=function(a,y){this.zb&&(this.Zd.contains("Collapse Tree")||this.Zd.contains("Collapse SubGraph"))&&(this.ce.Aj(a,y),Fh(this.ce,y,"position",y.position,y.position),Zs(this,a))};function Wp(a,y,x){!a.zb||y.D(x)||oh(a)||(a.H.pi||(y=x.copy()),Fh(a.ce,a.H,"position",y,x))}function ff(a,y,x){y.fd&&(y.Tg=x,a.pr.add(y))}function Zs(a,y){for(y=y.findLinksConnected();y.next();){var x=y.value;x.fd&&(x.Tg=x.points.copy(),a.pr.add(x))}}function td(a,y,x,E,b){a===null&&(a=[0,0,0,0]),y===null&&(y=[0,0,0,0]);var z=a[0],tt=a[1],rt=a[2];a=a[3];var ot=y[0],lt=y[1],ut=y[2];return y=y[3],rt===0||rt===100?(z=ot,tt=lt):(ut===0||ut===100)&&(ot=z,lt=tt),180<Math.abs(ot-z)&&(ot>z?z+=360:ot+=360),z=b(x,z,ot-z,E)%360,tt=b(x,tt,lt-tt,E),rt=b(x,rt,ut-rt,E),x=b(x,a,y-a,E),"hsla("+z+", "+tt+"%, "+rt+"%, "+x+")"}function mg(){function a(x,E,b,z,tt,rt){x.position=new At(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt))}var y=new Be;y.add("position:diagram",a),y.add("position",a),y.add("position:part",function(x,E,b,z,tt,rt){tt<rt?x.mm(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt),!1):x.position=new At(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt))}),y.add("location",function(x,E,b,z,tt,rt){tt<rt?x.mm(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt),!0):x.location=new At(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt))}),y.add("position:placeholder",function(x,E,b,z,tt,rt){tt<rt?x.mm(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt),!1):x.position=new At(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt))}),y.add("position:nodeCollapse",function(x,E,b,z,tt,rt){var ot=x.actualBounds,lt=b.actualBounds;b=lt.x+lt.width/2-ot.width/2,ot=lt.y+lt.height/2-ot.height/2,tt<rt?x.mm(z(tt,E.x,b-E.x,rt),z(tt,E.y,ot-E.y,rt),!1):x.position=new At(z(tt,E.x,b-E.x,rt),z(tt,E.y,ot-E.y,rt))}),y.add("desiredSize",function(x,E,b,z,tt,rt){x.desiredSize=new Te(z(tt,E.width,b.width-E.width,rt),z(tt,E.height,b.height-E.height,rt))}),y.add("width",function(x,E,b,z,tt,rt){x.width=z(tt,E,b-E,rt)}),y.add("height",function(x,E,b,z,tt,rt){x.height=z(tt,E,b-E,rt)}),y.add("fill",function(x,E,b,z,tt,rt){x.fill=td(E,b,tt,rt,z)}),y.add("stroke",function(x,E,b,z,tt,rt){x.stroke=td(E,b,tt,rt,z)}),y.add("strokeWidth",function(x,E,b,z,tt,rt){x.strokeWidth=z(tt,E,b-E,rt)}),y.add("strokeDashOffset",function(x,E,b,z,tt,rt){x.strokeDashOffset=z(tt,E,b-E,rt)}),y.add("background",function(x,E,b,z,tt,rt){x.background=td(E,b,tt,rt,z)}),y.add("areaBackground",function(x,E,b,z,tt,rt){x.areaBackground=td(E,b,tt,rt,z)}),y.add("opacity",function(x,E,b,z,tt,rt){x.opacity=z(tt,E,b-E,rt)}),y.add("scale",function(x,E,b,z,tt,rt){x.scale=z(tt,E,b-E,rt)}),y.add("angle",function(x,E,b,z,tt,rt){x.angle=z(tt,E,b-E,rt)}),xc=y}Se.Object.defineProperties(Js.prototype,{animationReasons:{get:function(){return this.Zd}},isEnabled:{get:function(){return this.Jd},set:function(a){(this.Jd=a)&&this.Ei.each(function(y){y.isAnimating||y.runCount!==1/0||y.start()})}},duration:{get:function(){return this.Dg},set:function(a){1>a&&En(a,">= 1",Js,"duration"),this.Dg=a}},isAnimating:{get:function(){return this.bc}},isTicking:{get:function(){return this.vq}},isInitial:{get:function(){return this.Gh},set:function(a){this.Gh=a}},defaultAnimation:{get:function(){return this.ce}},activeAnimations:{get:function(){return this.Ei}},initialAnimationStyle:{get:function(){return this.Pk},set:function(a){this.Pk=a}}}),Js.prototype.stopAnimation=Js.prototype.Cc;var xc=null,Pc=!1,ah=new en(Js,"Default",1),wc=new en(Js,"AnimateLocations",2),vg=new en(Js,"None",3);Js.className="AnimationManager",Js.defineAnimationEffect=function(a,y){Pc||(mg(),Pc=!0),xc.add(a,y)},Js.Default=ah,Js.AnimateLocations=wc,Js.None=vg;function qa(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=_d,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=jn,this.vc=new Be,this.Tt=new Be,this.yl=new gn,this.Ut=new gn,this.dw=bh,a&&Object.assign(this,a)}qa.prototype.suspend=function(){this.Xk=!0},qa.prototype.advanceTo=function(a,y){y&&(this.Xk=!1),this.ho&&a>=this.Gd&&(this.Wk=!0,a-=this.Gd),this.gw=a,Ec(this,!0),Lh(this.Yd),xl(this.H),qh(this.Yd),this.H.redraw()};function Cc(a,y){if(a.Tt.clear(),a.Wk=!1,a.au=0,a.Gd=NaN,0<a.yl.count&&a.yl.clear(),0<a.Ut.count&&a.Ut.clear(),y!==null)for(a=y.links;a.next();)a.value.Tg=null}wt=qa.prototype,wt.start=function(){if(this.vc.count===0||this.bc)return this;for(var a=this.H,y=this.vc.iterator;y.next();){var x=y.key;a===null&&(x instanceof be?a=x:x instanceof fe&&(a=x.diagram))}if(a!==null)this.H=a,this.Yd=a.animationManager;else return this;return y=this.Yd,y.isEnabled===!1?this:(this.Gd=isNaN(this.Dg)?y.duration:this.Dg,this.Lp=this.ot,y.Ok&&y.Pk===ah&&this===y.defaultAnimation&&(this.Lp=Vp,this.Gd=isNaN(this.Dg)?y.duration===600?900:y.duration:this.Dg),this.dw=a.scrollMode,this.isViewportUnconstrained&&(a.sj=Bc),Lh(y),this.yl.each(function(E){E.data=null,a.add(E)}),qh(y),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,cf(y,this),this)},wt.Iy=function(a,y){return a.Zc()?(this.yl.add(a),this.H=y,this):this},wt.add=function(a,y,x,E,b){if(y==="position"&&x.Xa(E))return this;if(this.H===null&&(a instanceof be?this.H=a:a instanceof fe&&a.diagram!==null&&(this.H=a.diagram)),a instanceof Ai){if(!a.isAnimated)return this;y==="position"&&(y="position:part")}return Fh(this,a,y,x,E,b),this};function Fh(a,y,x,E,b,z){var tt=a.vc;if(y instanceof be&&x==="position"&&(x="position:diagram"),(x==="fill"||x==="stroke"||x==="background"||x==="areaBackground")&&(hh(E),av(),E=[hl.j,hl.u,hl.o,hl.F],hh(b),av(),b=[hl.j,hl.u,hl.o,hl.F]),tt.contains(y)){var rt=tt.I(y),ot=rt.start,lt=rt.end;ot[x]===void 0&&(ot[x]=ed(E)),lt[x]=ed(b)}else ot={},lt={},ot[x]=ed(E),lt[x]=ed(b),rt=ot.position,y instanceof fe&&rt instanceof At&&!rt.w()&&y.diagram.animationManager.Zd.contains("Expand SubGraph")&&rt.assign(lt.position),rt=new nd(ot,lt,z),tt.add(y,rt);tt=ot[x],tt instanceof At&&!tt.w()&&tt.assign(a.o),z&&x.indexOf("position:")===0&&y instanceof Ai?rt.Ku.location=ed(y.location):z&&(rt.Ku[x]=ed(E))}function ed(a){return a instanceof At||a instanceof nn?a.copy():a}wt.fv=function(a){return this.bc?(a=this.vc.I(a),a!==null&&a.nv):!1},wt.Xu=function(a){return this.bc?(a=this.vc.I(a),a!==null&&(a.start.position||a.start.location)):!1};function Ec(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),Lh(x),yg(a,b),xl(a.H,!0),qh(x),E>a.cn&&(a.ho&&!a.Wk?(a.Qd=+new Date,a.cn=a.Qd+a.Gd,a.Wk=!0):a.Ml(!1))}}}function yg(a,y){for(var x=a.Gd,E=a.vc.iterator,b=a.Wk;E.next();){var z=E.key;if(!(z instanceof fe&&z.diagram===null)){var tt=E.value,rt=b?tt.end:tt.start;tt=b?tt.start:tt.end;var ot=xc,lt;for(lt in tt)lt==="position"&&(tt["position:placeholder"]||tt["position:nodeCollapse"])||ot.get(lt)===null||ot.get(lt)(z,rt[lt],tt[lt],a.Lp,y,x,a)}}}wt.stop=function(){return this.bc?(this.Ml(!0),this):this},wt.Ml=function(a){if(this.vu!==null&&this.vu.jo.remove(this.Nw),this.bc){var y=this.H,x=this.Yd;this.Xk=this.bc=x.Ok=!1,Lh(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=xc;E.next();){var tt=E.key,rt=E.value,ot=b?rt.end:rt.start,lt=b?rt.start:rt.end,ut=rt.Ku,ft;for(ft in lt)if(z.get(ft)!==null){var yt=ft;!rt.Hu||yt!=="position:nodeCollapse"&&yt!=="position:placeholder"||(yt="position"),z.get(yt)(tt,ot[ft],ut[ft]!==void 0?ut[ft]:rt.Hu?ot[ft]:lt[ft],this.Lp,this.Gd,this.Gd,this)}rt.Hu&&ut.location!==void 0&&tt instanceof Ai&&(tt.location=ut.location),rt.nv&&tt instanceof Ai&&tt.Zb(!1)}if(y.As.clear(),Lc(y,!1),y.Ya(),y.N(),xl(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()}xl(y,!0),this.isViewportUnconstrained&&(y.scrollMode=this.dw),qh(x),this.au++,!a&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),Cc(this,null),x.Ml(this),y.$b())}},wt.Cj=function(a,y){var x=y.actualBounds,E=null;if(y instanceof rr&&(E=y.placeholder),E!==null?(x=E.ga(jr),E=E.padding,x.x+=E.left,x.y+=E.top,this.add(a,"position",x,a.position,!1)):this.add(a,"position",new At(x.x+x.width/2,x.y+x.height/2),a.position,!1),this.add(a,"scale",.01,a.scale,!1),a instanceof rr)for(a=a.memberParts;a.next();)E=a.value,E instanceof qn&&this.Cj(E,y)},wt.Aj=function(a,y){if(a.isVisible()){var x=null;if(y instanceof rr&&(x=y.placeholder),x!==null){var E=x.ga(jr);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 rr)for(a=a.memberParts;a.next();)E=a.value,E instanceof qn&&this.Aj(E,y)}},wt.Ez=function(a){var y=this.Tt.get(a);return y===null&&(y={},this.Tt.add(a,y)),y},Se.Object.defineProperties(qa.prototype,{duration:{get:function(){return this.Dg},set:function(a){1>a&&En(a,">= 1",qa,"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:Gt("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}}}),qa.prototype.getTemporaryState=qa.prototype.Ez,qa.prototype.stop=qa.prototype.stop,qa.prototype.add=qa.prototype.add,qa.prototype.addTemporaryPart=qa.prototype.Iy;function _d(a,y,x,E){return a/=E/2,1>a?x/2*a*a+y:-x/2*(--a*(a-2)-1)+y}function Vp(a,y,x,E){return a===E?y+x:x*(-Math.pow(2,-10*a/E)+1)+y}qa.className="Animation",qa.EaseLinear=function(a,y,x,E){return x*a/E+y},qa.EaseInOutQuad=_d,qa.EaseInQuad=function(a,y,x,E){return x*(a/=E)*a+y},qa.EaseOutQuad=function(a,y,x,E){return-x*(a/=E)*(a-2)+y},qa.EaseInExpo=function(a,y,x,E){return a===0?y:x*Math.pow(2,10*(a/E-1))+y},qa.EaseOutExpo=Vp;function nd(a,y,x){this.start=a,this.end=y,this.Ku={},this.Hu=x,this.nv=!1}nd.className="AnimationState";function Ql(a,y,x){this.xd=null,this.rf=a,this.so=x||Sg,this.uk=null,y!==void 0&&(this.uk=y,x===void 0&&(this.so=id))}Ql.prototype.copy=function(){var a=new Ql(this.rf);a.so=this.so;var y=this.uk;if(y!==null){var x={};y.duration!==void 0&&(x.duration=y.duration),y.finished!==void 0&&(x.finished=y.finished),y.easing!==void 0&&(x.easing=y.easing),a.uk=x}return a};function Kp(a,y){a=a.uk,a!==null&&(a.duration&&(y.duration=a.duration),a.finished&&(y.finished=a.finished),a.easing&&(y.easing=a.easing))}Se.Object.defineProperties(Ql.prototype,{propertyName:{get:function(){return this.rf},set:function(a){this.rf=a}},animationSettings:{get:function(){return this.uk},set:function(a){this.uk=a}},startCondition:{get:function(){return this.so},set:function(a){this.so=a}}});var Sg=new en(Ql,"Default",1),id=new en(Ql,"Immediate",2),Rd=new en(Ql,"Bundled",3);Ql.className="AnimationTrigger",Ql.Default=Sg,Ql.Immediate=id,Ql.Bundled=Rd;function Ra(a){Wi(this),this.H=null,this.Pa=new cn,this.xa="",this.pb=1,this.o=!1,this.j=this.Uh=this.u=this.Oi=this.Ni=this.Mi=this.Li=this.Ji=this.Ki=this.Ii=this.Qi=this.Hi=this.Pi=this.Gi=this.Fi=!0,this.Zq=[],a&&Object.assign(this,a)}wt=Ra.prototype,wt.clear=function(){for(var a=this.Pa,y=0;y<a.length;y++){var x=a.s[y];x.Ig=null,as(x)}a.clear(),this.Zq.length=0},wt.Xe=function(a){this.H=a},wt.toString=function(a){a===void 0&&(a=0);var y='Layer "'+this.name+'"';if(0>=a)return y;for(var x=0,E=0,b=0,z=0,tt=0,rt=this.Pa.iterator;rt.next();){var ot=rt.value;ot instanceof rr?b++:ot instanceof qn?E++:ot instanceof kn?z++:ot instanceof Qr?tt++:x++}if(rt="",0<x&&(rt+=x+" Parts "),0<E&&(rt+=E+" Nodes "),0<b&&(rt+=b+" Groups "),0<z&&(rt+=z+" Links "),0<tt&&(rt+=tt+" Adornments "),1<a)for(a=this.Pa.iterator;a.next();)x=a.value,rt+=`
`+x.toString(),E=x.data,E!==null&&zi(E)&&(rt+=" #"+zi(E)),x instanceof qn?rt+=" "+ji(E):x instanceof kn&&(rt+=" "+ji(x.fromNode)+" "+ji(x.toNode));return y+" "+this.Pa.count+": "+rt},wt.ic=function(a,y,x){if(y===void 0&&(y=null),x===void 0&&(x=null),this.Uh===!1)return null;var E=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(E=!0);for(var b=At.alloc(),z=this.Pa.s,tt=z.length;tt--;){var rt=z[tt];if((E!==!0||fd(rt)!==!1)&&rt.isVisible()&&(b.assign(a),An(b,rt.oe),rt=rt.ic(b,y,x),rt!==null&&(y!==null&&(rt=y(rt)),rt!==null&&(x===null||x(rt)))))return At.free(b),rt}return At.free(b),null},wt.ji=function(a,y,x,E){if(y===void 0&&(y=null),x===void 0&&(x=null),E instanceof cn||E instanceof gn||(E=new gn),this.Uh===!1)return E;var b=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(b=!0);for(var z=At.alloc(),tt=this.Pa.s,rt=tt.length;rt--;){var ot=tt[rt];if((b!==!0||fd(ot)!==!1)&&ot.isVisible()){z.assign(a),An(z,ot.oe);var lt=ot;ot.ji(z,y,x,E)&&(y!==null&&(lt=y(lt)),lt===null||x!==null&&!x(lt)||E.add(lt))}}return At.free(z),E},wt.Cf=function(a,y,x,E,b){if(y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof cn||b instanceof gn||(b=new gn),this.Uh===!1)return b;var z=!1;this.diagram!==null&&this.diagram.viewportBounds.Re(a)&&(z=!0);for(var tt=this.Pa.s,rt=tt.length;rt--;){var ot=tt[rt];if((z!==!0||fd(ot)!==!1)&&ot.isVisible()){var lt=ot;ot.Cf(a,y,x,E,b)&&(y!==null&&(lt=y(lt)),lt===null||x!==null&&!x(lt)||b.add(lt))}}return b},wt.Nu=function(a,y,x,E,b,z,tt){if(this.Uh===!1)return b;for(var rt=this.Pa.s,ot=rt.length;ot--;){var lt=rt[ot];if((tt!==!0||fd(lt)!==!1)&&z(lt)&&lt.isVisible()){var ut=lt;lt.Cf(a,y,x,E,b)&&(y!==null&&(ut=y(ut)),ut===null||x!==null&&!x(ut)||b.add(ut))}}return b},wt.og=function(a,y,x,E,b,z){if(x===void 0&&(x=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof cn||b instanceof gn)&&(z=b),b=!0),z instanceof cn||z instanceof gn||(z=new gn),this.Uh===!1)return z;var tt=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(tt=!0);for(var rt=At.alloc(),ot=At.alloc(),lt=this.Pa.s,ut=lt.length;ut--;){var ft=lt[ut];if((tt!==!0||fd(ft)!==!1)&&ft.isVisible()){rt.assign(a),An(rt,ft.oe),ot.h(a.x+y,a.y),An(ot,ft.oe);var yt=ft;ft.og(rt,ot,x,E,b,z)&&(x!==null&&(yt=x(yt)),yt===null||E!==null&&!E(yt)||z.add(yt))}}return At.free(rt),At.free(ot),z},wt.Fd=function(a,y){if(this.visible){var x=this.Pa.s,E=x.length;if(E!==0){a=Jn();for(var b=Jn(),z=0;z<E;z++){var tt=x[z];if(tt.vw=z,tt instanceof kn){if(tt.fd===!1)continue}else if(tt instanceof Qr&&tt.adornedPart!==null)continue;var rt=tt.actualBounds;tt.isVisible()&&Fo(rt,y)?(tt.Fd(!0),a.push(tt)):(tt.Fd(!1),tt.adornments!==null&&0<tt.adornments.count&&b.push(tt))}for(y=0;y<a.length;y++)for(x=a[y],Ov(x),x=x.adornments;x.next();)E=x.value,E.measure(1/0,1/0),E.arrange(),E.Fd(!0);for(y=0;y<b.length;y++)Ov(b[y]);li(a),li(b)}}};function sh(a,y){var x=1;return a.pb!==1&&(x=y.globalAlpha,y.globalAlpha=x*a.pb),x}wt.gc=function(a,y,x){if(this.visible&&this.pb!==0&&(x===void 0&&(x=!0),x||!this.isTemporary)){x=this.Pa.s;var E=x.length;if(E!==0){if(a.isTemporary)for(var b=0;b<E;b++)x[b].Gj();b=sh(this,a);var z=this.Zq;z.length=0;for(var tt=y.scale,rt=Te.alloc(),ot=0;ot<E;ot++)this.Oj(a,x[ot],y,z,tt,rt,!0);if(Te.free(rt),a.isTemporary)for(y=0;y<E;y++)x[y].Gj();a.globalAlpha=b}}};function Up(a,y,x,E,b){if(a.visible&&a.pb!==0&&(b||!a.isTemporary)){b=a.Pa.s;var z=b.length;if(z!==0){var tt=sh(a,y),rt=a.Zq;rt.length=0;for(var ot=x.scale,lt=Te.alloc(),ut=0;ut<z;ut++){var ft=b[ut];E.contains(ft)&&a.Oj(y,ft,x,rt,ot,lt,!1)}Te.free(lt),y.globalAlpha=tt}}}wt.Oj=function(a,y,x,E,b,z,tt){if(tt&&!fd(y))a.Hs(y);else{if(E!==null&&y instanceof kn&&(y.isOrthogonal&&E.push(y),y.fd===!1)){a.Hs(y);return}for(tt=!1,E=y.containingGroup;E!==null;)tt?E.tb!==null&&z.Ex(E.tb):E.tb!==null&&(tt=!0,z.assign(E.tb)),E=E.containingGroup;var rt=y.actualBounds;if(E=!1,tt&&y.isVisible()){if(!z.Yc(rt)){a.Hs(y);return}E=!z.Re(rt)}E&&(a.save(),a instanceof Qs?a.bk=z.copy():(a.beginPath(),a.rect(z.x,z.y,z.width,z.height),a.clip())),rt.width*b>x.Oq||rt.height*b>x.Oq?y.gc(a,x):(b=y.actualBounds,z=y.naturalBounds,b.width===0||b.height===0||isNaN(b.x)||isNaN(b.y)||!y.isVisible()||(x=y.transform,y.areaBackground!==null&&(ta(y,a,y.areaBackground,!0,!0,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.areaBackground===null&&y.background===null&&(ta(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),ta(y,a,y.background,!0,!1,z,b),a.fillRect(0,0,z.width/2,z.height/2),x.ws()||(y=1/(x.m11*x.m22-x.m12*x.m21),a.transform(x.m22*y,-x.m12*y,-x.m21*y,x.m11*y,y*(x.m21*x.dy-x.m22*x.dx),y*(x.m12*x.dx-x.m11*x.dy)))))),E&&(a.restore(),a.Vc(!0))}},wt.g=function(a,y,x,E,b){var z=this.diagram;z!==null&&z.cb(pr,a,this,y,x,E,b)},wt.oi=function(a,y,x){var E=this.Pa;if(y.Ig=this,this===null&&as(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)),gf(this,a,y),a},wt.pc=function(a,y,x){if(!x&&y.layer!==this&&y.layer!==null)return y.layer.pc(a,y,x);var E=this.Pa;if(0>a||a>=E.length){if(a=E.indexOf(y),0>a)return-1}else if(E.M(a)!==y&&(a=E.indexOf(y),0>a))return-1;return y.Wo(x),E.mb(a),E=this.diagram,E!==null&&(x?E.N():E.pc(y)),y.Ig=null,as(y),a};function gf(a,y,x){if(y=Yp(a,y,x),x instanceof rr&&x!==null&&isNaN(x.zOrder)){if(x.memberParts.count!==0){for(var E=-1,b=a.Pa.s,z=b.length,tt=0;tt<z;tt++){var rt=b[tt];if(rt===x&&(y=tt,0<=E)||0>E&&rt.containingGroup===x&&(E=tt,0<=y))break}!(0>E)&&E<y&&(b=a.Pa,b.mb(y),b.Gb(E,x))}y=x.containingGroup,y!==null&&gf(a,-1,y)}x.svg!==null&&x.svg.remove()}function Yp(a,y,x){var E=x.zOrder;if(isNaN(E))return y;a=a.Pa;var b=a.count;if(1>=b)return y;if(0>y&&(y=a.indexOf(x)),0>y)return-1;for(var z=y-1,tt=NaN;0<=z&&(tt=a.M(z).zOrder,!!isNaN(tt));)z--;for(var rt=y+1,ot=NaN;rt<b&&(ot=a.M(rt).zOrder,!!isNaN(ot));)rt++;if(!isNaN(tt)&&tt>E)for(;;){if(z===-1||tt<=E){if(z++,z===y)break;return a.mb(y),a.Gb(z,x),z}for(tt=NaN;0<=--z&&(tt=a.M(z).zOrder,isNaN(tt)););}else if(!isNaN(ot)&&ot<E)for(;;){if(rt===b||ot>=E){if(rt--,rt===y)break;return a.mb(y),a.Gb(rt,x),rt}for(ot=NaN;++rt<b&&(ot=a.M(rt).zOrder,isNaN(ot)););}return y}Se.Object.defineProperties(Ra.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===""&&Gt("Cannot rename default Layer to: "+a),x=x.layers;x.next();)x.value.name===a&&Gt("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)&&En(a,"0 <= value <= 1",Ra,"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))}}}),Ra.prototype.findObjectsNear=Ra.prototype.og,Ra.prototype.findObjectsIn=Ra.prototype.Cf,Ra.prototype.findObjectsAt=Ra.prototype.ji,Ra.prototype.findObjectAt=Ra.prototype.ic,Ra.className="Layer";function be(a,y){if(lm||(rs(),lm=!0),Wi(this),zu=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,Qo){var x=this,E=function(){x.removeEventListener(qe.document,"DOMContentLoaded",E,!1),x.setRTL()};qe.document.body!==null?this.setRTL():x.addEventListener(qe.document,"DOMContentLoaded",E,!1)}this.ol=null,Lf.add("Model",xo);var b=this;return this.Hb=function(z){var tt=b.partManager;if(z.model===tt.diagram.model&&tt.diagram.aa){tt.diagram.aa=!1;try{var rt=z.change;z.modelChange===""&&rt===pr&&tt.updateDataBindings(z.object,z.propertyName)}finally{tt.diagram.aa=!0}}},this.Oc=function(z){b.partManager.doModelChanged(z)},this.hu=this.ku=null,Xp(this),this.model=hy(),this.Wg=!0,Qp(this),this.layout=new Ko,this.Wg=!1,this.ck=this.ek=this.fk=this.dk=this.ui=this.aA=this.$j=this.Ov=null,this.hk=function(){},this.preventDefault=null,this.rn=!1,this.Yf=new um,a!==void 0&&(typeof a=="string"||qe.Element&&a instanceof Element?Pg(this,a):y=a),this.vb=!1,y&&this.nm(y),this}var rd,zu;function Xp(a){a.Yd=new Js,a.Yd.Xe(a),a.Db=17,a.Gw=!1,a.tn=!1,a.bu="default",a.Wa=new cn,a.pj=new Be,a.nl="default",a.Tx(),a.Sx(),a.pb=1,a.pa=new At(NaN,NaN).freeze(),a.du=new At(NaN,NaN),a.Ca=1,a.Pp=1,a.zt=new At(NaN,NaN).freeze(),a.At=NaN,a.Ot=1e-4,a.Mt=100,a.Ab=new ae,a.zu=new At(NaN,NaN).freeze(),a.ut=new Te(NaN,NaN,NaN,NaN).freeze(),a.rj=new or(0,0,0,0).freeze(),a.sj=bh,a.nu=!1,a.Zt=null,a.fu=null,a.yh=hs,a.zk=xa,a.Fg=hs,a.pq=xa,a.yt=jr,a.Bt=jr,a.Fc=!0,a.pn=!1,a.De=new gn,a.Eh=new Be,a.Xm=!0,a.vp=250,a.vk=-1,a.xp=new or(16,16,16,16).freeze(),a.kg=!1,a.Jk=!1,a.fn=!0,a.bq=new Zi,a.bq.diagram=a,a.Qg=new Zi,a.Qg.diagram=a,a.cj=new Zi,a.cj.diagram=a,a.zg=null,a.pf=null,a.qu=!1,ev(a),a.ai=new gn,a.Ht=!0,a.uu=Nh,a.pw=!1,a.wu=Nc,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 Be,a.Xn=new cn,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 or(5).freeze(),a.Hw=new gn().freeze(),a.Nt=999999999,a.nw=new gn().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 gn,a.ow=new gn,a.Xh=null,a.aw=new nn(8,8),a.bw=999,a.Bw=1,a.Jw=0,a.fc={scale:1,position:new At,bounds:new Te,Py:new nn,bA:new nn,Oz:!1},a.fc.canvasSize=a.fc.Py,a.fc.newCanvasSize=a.fc.bA,a.fc.isScroll=!1,a.Rw=new Te(NaN,NaN,NaN,NaN).freeze(),a.wo=new nn(NaN,NaN).freeze(),a.Sp=new Te(NaN,NaN,NaN,NaN).freeze(),a.It=!1,a.Lg=new Be;var y=new qn,x=new To;x.bind(new la("text","",ji)),y.add(x),a.ny=y,a.Lg.add("",y),y=new qn,x=new To,x.stroke="brown",x.bind(new la("text","",ji)),y.add(x),a.Lg.add("Comment",y),y=new qn,y.selectable=!1,y.avoidable=!1,x=new fr,x.figure="Ellipse",x.fill="black",x.stroke=null,x.desiredSize=new nn(3,3).ja(),y.add(x),a.Lg.add("LinkLabel",y),a.Yi=new Be,y=new rr,y.selectionObjectName="GROUPPANEL",y.type=Pn.Vertical,x=new To,x.font="bold 12pt sans-serif",x.bind(new la("text","",ji)),y.add(x),x=new Pn(Pn.Auto),x.name="GROUPPANEL";var E=new fr;E.figure="Rectangle",E.fill="rgba(128,128,128,0.2)",E.stroke="black",x.add(E),E=new Ps,E.padding=new or(5,5,5,5).ja(),x.add(E),y.add(x),a.ly=y,a.Yi.add("",y),a.Kh=new Be,y=new kn,x=new fr,x.isPanelMain=!0,y.add(x),x=new fr,x.toArrow="Standard",x.fill="black",x.stroke=null,x.strokeWidth=0,y.add(x),a.my=y,a.Kh.add("",y),y=new kn,x=new fr,x.isPanelMain=!0,x.stroke="brown",y.add(x),a.Kh.add("Comment",y),y=new Qr,y.type=Pn.Auto,x=new fr,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),x=new Ps,x.margin=new or(1.5,1.5,1.5,1.5).ja(),y.add(x),a.St=y,a.wt=y,y=new Qr,y.type=Pn.Link,x=new fr,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 xo,a.toolManager=new Ar,a.toolManager.initializeStandardTools(),a.defaultTool=a.toolManager,a.currentTool=a.defaultTool,a.nt=null,a.Wm=new at,a.Vt=null,a.Wt=null,a.Mr=!1,a.commandHandler=Jp(),a.eq=null,a.fq=ui,a.Pw=!1,a.Mb=1,a.Yh=null,a.Oq=1,a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0,a.yq=1,a.tw=0,a.uw=new At,a.zy=500,a.wp=new At,a.wq=!1}be.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),Vd=null,ud="",xg(this,!1),this.Xn.clear(),Rf(),this.Og.clear(),this.Xh=null,this.Ya(),this.Va(),this.N()};function xg(a,y){a.animationManager.Cc(!0),a.Hw=new gn().freeze(),a.nw=new gn().freeze();var x=a.skipsUndoManager,E=a.cc!==null&&a.cc!==void 0;E&&(a.skipsUndoManager=!0);var b=null;a.fe!==null&&(b=a.fe.part,b!==null&&a.remove(b));var z=[],tt=a.Wa.length;if(y){for(y=0;y<tt;y++)for(var rt=a.Wa.s[y].parts;rt.next();){var ot=rt.value;ot!==b&&ot.data===null&&z.push(ot)}for(y=0;y<z.length;y++)a.remove(z[y])}for(y=0;y<tt;y++)a.Wa.s[y].clear();return a.partManager.clear(),a.De.clear(),a.Eh.clear(),a.ai.clear(),a.Ck=null,a.Xn.clear(),Rf(),a.Og.clear(),ro=[],b!==null&&(a.add(b),a.partManager.parts.remove(b)),E&&(a.skipsUndoManager=x),z}function Jp(){return null}be.prototype.reset=function(){this.clear(),this.vb=!0,Xp(this),ku(this),this.Wg=!0,Qp(this),this.layout=new Ko,this.Wg=!1,this.model=hy(),this.model.undoManager=new qi,this.vb=this.rn=!1,this.N()},be.prototype.setRTL=function(a){a=a===void 0?this.div:a,a===null&&(a=qe.document.body);var y=Ki("div");y.dir="rtl",y.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;",y.textContent="A",a.appendChild(y);var x="reverse";0<y.scrollLeft?x="default":(y.scrollLeft=1,y.scrollLeft===0&&(x="negative")),a.removeChild(y),this.bu=x},be.prototype.setScrollWidth=function(a){a=a===void 0?this.div:a,a===null&&(a=qe.document.body);var y=0;if(Qo){var x=sm;y=rd,x===null&&(x=sm=Ki("p"),x.style.width="100%",x.style.height="200px",x.style.boxSizing="content-box",y=rd=Ki("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||Mr||(y=11)}this.Db=y,this.Gw=!0},be.prototype.qb=function(a){a.classType===be&&(this.autoScale=a)},be.prototype.toString=function(a){a===void 0&&(a=0);var y="";if(this.div&&this.div.id&&(y=this.div.id),y='Diagram "'+y+'"',0>=a)return y;for(var x=this.Wa.iterator;x.next();)y+=`
`+x.value.toString(a-1);return y};function Pg(a,y){if(Qo){if(y!=null||Gt("Diagram setup requires an argument DIV."),a.Ka!==null&&Gt("Diagram has already completed setup."),typeof y=="string"?a.Ka=qe.document.getElementById(y):y instanceof HTMLDivElement?a.Ka=y:Gt("No DIV or DIV id supplied: "+y),a.Ka===null&&Gt("Invalid DIV id; could not get element with id: "+y),a.Ka.H!==void 0&&Gt("Invalid div id; div already has a Diagram associated with it."),!a.ol&&qe.ResizeObserver){var x=ki(function(){a.$b()},250);a.ol=new qe.ResizeObserver(function(){x()}),a.ol.observe(a.Ka)}qe.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=qe.go;var b=new Rl(a);if(b.style!==void 0&&(b.style.position="absolute",b.style.top="0px",b.style.left="0px",qe.getComputedStyle(a.Ka,null).getPropertyValue("direction")==="rtl"&&(a.tn=!0),b.style.zIndex="2",b.style.userSelect="none",b.style.MozUserSelect="none",b.style.touchAction="none",b.style.letterSpacing="normal !important",b.style.wordSpacing="normal !important"),a.ta=b,a.ib=b.context,E=a.ib,a.Mb=a.computePixelRatio(),a.viewSize.w()||(a.Aa=a.Ka.clientWidth||1,a.ya=a.Ka.clientHeight||1),bg(a,a.Aa,a.ya),a.Ka.insertBefore(b.Oa,a.Ka.firstChild),b=new Rl(null),b.width=1,b.height=1,a.jw=b,a.oy=b.context,Qo){b=Ki("div");var z=Ki("div");b.style.position="absolute",b.style.overflow="auto",b.style.width=a.Aa+"px",b.style.height=a.ya+"px",b.style.zIndex="1",z.style.position="absolute",z.style.width="1px",z.style.height="1px",a.Ka.appendChild(b),b.appendChild(z),b.onscroll=qp,b.addEventListener("pointerdown",tm),b.H=a,b.uy=!0,b.vy=!0,a.ku=b,a.hu=z}a.hk=ki(function(){a.Yh=null,a.N()},300),a.Ov=ki(function(){wg(a)},250),a.preventDefault=function(tt){return tt.preventDefault(),!1},a.$j=function(tt){if(a.isEnabled){var rt=Sl(a,tt,!0);rt.bubbles=!0;var ot=0,lt=0;rt.delta=0,tt.deltaX!==void 0?(tt.deltaX!==0&&(ot=0<tt.deltaX?1:-1),tt.deltaY!==0&&(lt=0<tt.deltaY?1:-1),rt.delta=Math.abs(tt.deltaX)>Math.abs(tt.deltaY)?-ot:-lt):tt.wheelDeltaX!==void 0?(tt.wheelDeltaX!==0&&(ot=0<tt.wheelDeltaX?-1:1),tt.wheelDeltaY!==0&&(lt=0<tt.wheelDeltaY?-1:1),rt.delta=Math.abs(tt.wheelDeltaX)>Math.abs(tt.wheelDeltaY)?-ot:-lt):tt.wheelDelta!==void 0&&tt.wheelDelta!==0&&(rt.delta=0<tt.wheelDelta?1:-1),a.doMouseWheel(),$l(rt,tt)}},a.aA=function(tt){a.isEnabled&&(a.Vk=!1,Sl(a,tt,!0),tt=a.currentTool,tt.cancelWaitAfter(),tt.standardMouseOver())},a.ui=function(tt){if(a.isEnabled){a.Vk=!0;var rt=a.Yt;rt[tt.pointerId]===void 0&&(rt[tt.pointerId]=tt),rt=a.oj;var ot=!1;if(rt[0]===null||rt[0].pointerId!==tt.pointerId&&rt[0].pointerType===tt.pointerType)if(rt[1]!==null&&rt[1].pointerId===tt.pointerId)rt[1]=tt,ot=!0;else if(rt[0]===null)rt[0]=tt;else if(rt[1]===null)rt[1]=tt,ot=!0;else{tt.preventDefault();return}else rt[0]=tt;(rt=tt.pointerType==="touch"||tt.pointerType==="pen")&&(a.qu=!1,a.wq=!0);var lt=ot;ot=Fg(a,tt,!0,!1,!0,lt),zd(a,tt,ot),ot.targetDiagram=Lg(tt,tt.target),ot.targetObject=null,lt||ot.clone(a.bq),lt=a.uw,rt=rt?25:10,tt.timeStamp-a.tw<a.zy&&!(Math.abs(lt.x-tt.screenX)>rt||Math.abs(lt.y-tt.screenY)>rt)?a.yq++:a.yq=1,ot.clickCount=a.yq,a.tw=tt.timeStamp,a.uw.sg(tt.screenX,tt.screenY),a.doMouseDown(),tt.button===1?tt.preventDefault():$l(ot,tt)}},a.dk=function(tt){if(a.isEnabled){a.Vk=!0;var rt=a.oj;if(rt[0]===null||rt[0].pointerId!==tt.pointerId&&rt[0].pointerType===tt.pointerType){if(rt[1]!==null&&rt[1].pointerId===tt.pointerId){rt[1]=tt;return}if(rt[0]===null)rt[0]=tt;else return}else rt[0]=tt;if(rt[0].pointerId===tt.pointerId){rt=Fg(a,tt,!1,!1,!1,rt[1]!==null);var ot=qe.document.elementFromPoint(tt.clientX,tt.clientY)||null;ot!==null&&ot.shadowRoot!==void 0&&ot.shadowRoot!==null&&(ot=ot.shadowRoot.elementFromPoint(tt.clientX,tt.clientY));var lt=a,ut=tt;ot&&ot.H&&(ut=tt,lt=ot.H),rt.targetDiagram=lt,zd(a,ut,rt),rt.targetObject=null,a.doMouseMove(),$l(rt,tt)}}},a.fk=function(tt){if(a.isEnabled){a.Vk=!0;var rt=tt.pointerType==="touch"||tt.pointerType==="pen",ot=a.Yt;if(rt&&a.qu)delete ot[tt.pointerId],tt.preventDefault();else if(ot=a.oj,ot[0]===null||ot[0].pointerId!==tt.pointerId&&ot[0].pointerType===tt.pointerType)ot[1]!==null&&ot[1].pointerId===tt.pointerId&&(ot[1]=null);else{ot[0]=null,ot=Fg(a,tt,!1,!0,!0,!1);var lt=qe.document.elementFromPoint(tt.clientX,tt.clientY)||null;lt!==null&&lt.shadowRoot!==void 0&&lt.shadowRoot!==null&&(lt=lt.shadowRoot.elementFromPoint(tt.clientX,tt.clientY)),lt!==null&&lt.H instanceof be&&lt.H!==a&&zd(lt.H,tt,ot),lt===null&&(lt=tt.target),zd(a,tt,ot),ot.clickCount=a.yq,ot.targetDiagram=Lg(tt,lt),ot.targetObject=null,a.doMouseUp(),$l(ot,tt),rt&&(a.wq=!1)}}},a.ek=function(tt){if(a.isEnabled){a.Vk=!1;var rt=a.Yt;rt[tt.pointerId]&&delete rt[tt.pointerId],rt=a.oj,rt[0]!==null&&rt[0].pointerId===tt.pointerId&&(rt[0]=null),rt[1]!==null&&rt[1].pointerId===tt.pointerId&&(rt[1]=null),tt.pointerType!=="touch"&&tt.pointerType!=="pen"&&(tt=a.currentTool,tt.cancelWaitAfter(),tt.standardMouseOver())}},a.ck=function(tt){var rt=a.oj;rt[0]!==null&&rt[0].pointerId===tt.pointerId?(rt[0]=null,a.wq=!1):rt[1]!==null&&rt[1].pointerId===tt.pointerId&&(rt[1]=null)},a.Vp=E.Z["d"+Tc[1]+Tc[2]+"wI"+Ud.slice(1,5)]["b"+Ax.slice(1,y)](E.Z,Ac,y,y),E.Vc(!0),tv(a),a.nl==="svg"&&(y=a.pj.get("svg"),a.Ka.appendChild(y.Oa),a.ib=y.context)}}be.prototype.addEventListener=function(a,y,x,E){a.addEventListener(y,x,{capture:E,passive:!1})},be.prototype.removeEventListener=function(a,y,x,E){a.removeEventListener(y,x,{capture:E})};function tv(a){var y=a.ta.Oa;y instanceof HTMLCanvasElement||(y=a.div),a.addEventListener(y,"pointerdown",a.ui,!1),a.addEventListener(y,"pointermove",a.dk,!1),a.addEventListener(y,"pointerup",a.fk,!1),a.addEventListener(y,"pointerout",a.ek,!1),a.addEventListener(y,"pointercancel",a.ck,!1),a.addEventListener(y,"pointerenter",a.bz,!1),a.addEventListener(y,"pointerleave",a.cz,!1),a.addEventListener(y,"wheel",a.$j,!1),a.addEventListener(y,"keydown",a.Qz,!1),a.addEventListener(y,"keyup",a.Rz,!1),a.addEventListener(y,"blur",a.Ny,!1),a.addEventListener(y,"focus",a.Oy,!1),a.addEventListener(y,"selectstart",function(x){return x.preventDefault(),!1},!1),a.addEventListener(y,"contextmenu",function(x){return x.preventDefault(),!1},!1),a.addEventListener(qe,"resize",a.Ov,!1)}function Bs(a){30<a.Sq&&(a.Yh=1)}function Lc(a,y){a.Yh!==null&&(a.Yh=null,y&&a.hk(),_i&&_i.nx||(a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0))}be.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:qe.devicePixelRatio||1},be.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},be.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},be.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},be.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},be.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},be.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},be.prototype.doFocus=function(){this.focus()},be.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var a=qe.scrollX||qe.pageXOffset,y=qe.scrollY||qe.pageYOffset;this.ta.focus(),qe.scrollTo(a,y)}},be.prototype.Oy=function(){this.H.R("GainedFocus")},be.prototype.Ny=function(){this.H.R("LostFocus")};function wg(a){if(a.ta!==null){var y=a.Ka;if(y!==null&&y.clientWidth!==0&&y.clientHeight!==0){a.Gw||a.setScrollWidth();var x=a.gf?a.Db:0,E=a.Be?a.Db:0,b=a.Mb;a.Mb=a.computePixelRatio(),a.Mb!==b&&(a.pn=!0,a.$b()),(y.clientWidth!==a.Aa+x||y.clientHeight!==a.ya+E)&&(a.Ee=!0,a.Fc=!0,y=a.layout,y!==null&&y.isViewportSized&&a.autoScale===hs&&(a.Jk=!0,y.C()),a.ld||a.$b())}}}function Qp(a){var y=new Ra;y.name="Background",a.Al(y),y=new Ra,y.name="",a.Al(y),y=new Ra,y.name="Foreground",a.Al(y),y=new Ra,y.name="Adornment",y.isTemporary=!0,y.isInDocumentBounds=!1,a.Al(y),y=new Ra,y.name="Tool",y.isTemporary=!0,y.isInDocumentBounds=!0,a.Al(y),y=new Ra,y.name="Grid",y.allowSelect=!1,y.pickable=!1,y.isTemporary=!0,y.isInDocumentBounds=!1,a.Ww(y,a.Qj("Background"))}function $p(a){var y=new Pn(Pn.Grid);y.name="GRID";var x=new fr;return x.figure="LineH",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new fr,x.figure="LineH",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new fr,x.figure="LineH",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new fr,x.figure="LineV",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new fr,x.figure="LineV",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new fr,x.figure="LineV",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new Ai,x.add(y),x.layerName="Grid",x.zOrder=0,x.isInDocumentBounds=!1,x.isAnimated=!1,x.pickable=!1,x.locationObjectName="GRID",a.add(x),a.partManager.parts.remove(x),y.visible=!1,y}function qp(){this.H.gu?this.H.gu=!1:this.H.isEnabled?this.H.kx(this):Hd(this.H)}function tm(a){this.H.isEnabled?(this.H.lu=a.target.scrollTop,this.H.ju=a.target.scrollLeft):Hd(this.H)}be.prototype.kx=function(a){if(this.ta!==null){var y=this.ku,x=this.hu;this.qr=!0;var E=this.documentBounds,b=this.viewportBounds,z=this.rj,tt=E.x-z.left,rt=E.y-z.top,ot=E.width+z.left+z.right,lt=E.height+z.top+z.bottom,ut=E.right+z.right;z=E.bottom+z.bottom;var ft=b.x;E=b.y;var yt=b.width,xt=b.height,Ct=b.right,bt=b.bottom;b=this.scale;var Vt=a.scrollLeft;if(this.tn)switch(this.bu){case"negative":Vt=Vt+a.scrollWidth-a.clientWidth;break;case"reverse":Vt=a.scrollWidth-Vt-a.clientWidth}var zt=Vt;yt<ot||xt<lt?(Vt=At.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==zt&&(Vt.x=zt/b+tt,this.ju=zt),this.allowVerticalScroll&&this.lu!==a.scrollTop&&(Vt.y=a.scrollTop/b+rt,this.lu=a.scrollTop),this.position=Vt,At.free(Vt),this.Ee=this.qr=!1):(Vt=At.alloc(),a.uy&&this.allowHorizontalScroll&&(tt<ft&&(this.position=Vt.h(zt+tt,this.position.y)),ut>Ct&&(this.position=Vt.h(-(y.scrollWidth-this.Aa)+zt-this.Aa/b+ut,this.position.y))),a.vy&&this.allowVerticalScroll&&(rt<E&&(this.position=Vt.h(this.position.x,a.scrollTop+rt)),z>bt&&(this.position=Vt.h(this.position.x,-(y.scrollHeight-this.ya)+a.scrollTop-this.ya/b+z))),At.free(Vt),this.vd=!0,this.Ee=this.qr=!1,E=this.documentBounds,b=this.viewportBounds,ut=E.right,Ct=b.right,z=E.bottom,bt=b.bottom,tt=E.x,ft=b.x,rt=E.y,E=b.y,yt>=ot&&tt>=ft&&ut<=Ct&&(x.style.width="1px"),xt>=lt&&rt>=E&&z<=bt&&(x.style.height="1px"))}},be.prototype.computeBounds=function(a){return a===void 0&&(a=new Te),ts(this),Cg(this,a)};function Cg(a,y){if(a.fixedBounds.w())return y.assign(a.fixedBounds),y.Co(a.yb),y;for(var x=!0,E=a.Wa.s,b=E.length,z=0;z<b;z++){var tt=E[z];if(tt.visible&&tt.isInDocumentBounds){tt=tt.Pa.s;for(var rt=tt.length,ot=0;ot<rt;ot++){var lt=tt[ot];lt.isInDocumentBounds&&lt.isVisible()&&(lt=lt.actualBounds,lt.w()&&(x?(x=!1,y.assign(lt)):y.ed(lt)))}}}return x&&y.h(0,0,0,0),y.Co(a.yb),y}be.prototype.computePartsBounds=function(a,y){y===void 0&&(y=!1);var x=null;if($e(a))for(var E=0;E<a.length;E++){var b=a[E];!y&&b instanceof kn||(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 kn||(E.Va(),x===null?x=E.actualBounds.copy():x.ed(E.actualBounds));return x===null?new Te(NaN,NaN,0,0):x};function Il(a,y){if((y||a.hf)&&!a.vb&&a.ta!==null&&a.documentBounds.w()){if(a.vb=!0,y){var x=a.initialPosition;if(x.w()){a.vb=!1,a.position=x;return}x=At.alloc(),x.xi(a.documentBounds,a.initialDocumentSpot);var E=a.viewportBounds;E=Te.allocAt(0,0,E.width,E.height);var b=At.alloc();b.xi(E,a.initialViewportSpot),b.h(x.x-b.x,x.y-b.y),a.position=b,Te.free(E),At.free(b),At.free(x)}x=a.yh,y&&a.Fg!==hs&&(x=a.Fg);var z=x!==hs?jd(a,x):a.scale;x=a.pa.x,E=a.pa.y,b=a.Aa/z;var tt=a.ya/z,rt=a.zk,ot=a.pq;y&&!rt.sb()&&(ot.sb()||ot.Xb())&&(rt=ot.Xb()?dr:ot),Eg(a,a.documentBounds,b,tt,rt,y),y=a.scale,a.scale=z,a.vb=!1,z=a.viewportBounds,_t.B(z.x,x)&&_t.B(z.y,E)&&_t.B(z.width,b)&&_t.B(z.height,tt)||a.onViewportBoundsChanged(new Te(x,E,b,tt),z,y,!1)}}function jd(a,y){var x=a.Pp;if(a.ta===null)return x;a.Va();var E=a.documentBounds;if(!E.w())return x;var b=E.width;E=E.height;var z=a.Aa+(a.gf?a.Db:0),tt=a.ya+(a.Be?a.Db:0),rt=z/b,ot=tt/E;return y===sl?(y=Math.min(ot,rt),y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):y===hd?(y=ot>rt?(tt-a.Db)/E:(z-a.Db)/b,y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):a.scale}be.prototype.zoomToFit=function(){var a=this.sj;this.sj=bh,this.scale=jd(this,sl),a!==bh&&(Il(this,!1),Eg(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=a},wt=be.prototype,wt.BA=function(a,y){y===void 0&&(y=sl);var x=a.width,E=a.height;if(!(x===0||E===0||isNaN(x)&&isNaN(E))){var b=1;if(y===sl||y===hd)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===hd?z/E>b/x?(z-(this.Be?this.Db:0))/E:(b-(this.gf?this.Db:0))/x:Math.min(z/E,b/x)}this.scale=b,this.position=new At(a.x,a.y)}},wt.Jy=function(a,y){this.Va();var x=this.documentBounds,E=this.viewportBounds;this.position=new At(x.x+(a.x*x.width+a.offsetX)-(y.x*E.width-y.offsetX),x.y+(a.y*x.height+a.offsetY)-(y.y*E.height-y.offsetY))},wt.zz=function(a){if(a instanceof fe){this.eq=a;var y=At.alloc();this.fq=this.op(a.ga(jr,y)),At.free(y)}else this.eq=null,this.fq=ui};function Eg(a,y,x,E,b,z){var tt=At.allocAt(a.pa.x,a.pa.y),rt=tt.x,ot=tt.y;if(a.eq!==null){var lt=At.alloc();lt=a.eq.ga(jr,lt),rt=lt.x-a.fq.x/a.scale,ot=lt.y-a.fq.y/a.scale,b=lr,At.free(lt)}(z||a.scrollMode===bh)&&(b.sb()&&(x>y.width&&(rt=y.x+(b.x*y.width+b.offsetX)-(b.x*x-b.offsetX)),E>y.height&&(ot=y.y+(b.y*y.height+b.offsetY)-(b.y*E-b.offsetY))),b=a.rj,z=x-y.width,x<y.width+b.left+b.right?(rt=Math.min(rt+x/2,y.right+Math.max(z,b.right)-x/2),rt=Math.max(rt,y.left-Math.max(z,b.left)+x/2),rt-=x/2):rt>y.left?rt=y.left:rt<y.right-x&&(rt=y.right-x),x=E-y.height,E<y.height+b.top+b.bottom?(ot=Math.min(ot+E/2,y.bottom+Math.max(x,b.bottom)-E/2),ot=Math.max(ot,y.top-Math.max(x,b.top)+E/2),ot-=E/2):ot>y.top?ot=y.top:ot<y.bottom-E&&(ot=y.bottom-E)),tt.x=isFinite(rt)?rt:-a.yb.left,tt.y=isFinite(ot)?ot:-a.yb.top,a.positionComputation!==null&&(y=a.positionComputation(a,tt),tt.x=y.x,tt.y=y.y),Wp(a.Yd,a.pa,tt),a.pa.h(tt.x,tt.y),ku(a),At.free(tt)}wt.Ol=function(a,y){if(y===void 0&&(y=!0),y){if(a=Zu(this,a,function(x){return x.part},function(x){return x.canSelect()}),a instanceof Ai)return a}else if(a=Zu(this,a,function(x){return x.part}),a instanceof Ai)return a;return null},wt.ic=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null),ts(this);for(var E=this.Wa.iteratorBackwards;E.next();){var b=E.value;if(b.visible&&(b=b.ic(a,y,x),b!==null))return b}return null};function Zu(a,y,x,E){for(x===void 0&&(x=null),E===void 0&&(E=null),ts(a),a=a.Wa.iteratorBackwards;a.next();){var b=a.value;if(b.visible&&!b.isTemporary&&(b=b.ic(y,x,E),b!==null))return b}return null}wt.lz=function(a,y,x){return y===void 0&&(y=!0),Fc(this,a,function(E){return E.part},y?function(E){return E instanceof Ai&&E.canSelect()}:null,x)};function Fc(a,y,x,E,b){for(x===void 0&&(x=null),E===void 0&&(E=null),b instanceof cn||b instanceof gn||(b=new gn),ts(a),a=a.Wa.iteratorBackwards;a.next();){var z=a.value;z.visible&&!z.isTemporary&&z.ji(y,x,E,b)}return b}wt.ji=function(a,y,x,E){y===void 0&&(y=null),x===void 0&&(x=null),E instanceof cn||E instanceof gn||(E=new gn),ts(this);for(var b=this.Wa.iteratorBackwards;b.next();){var z=b.value;z.visible&&z.ji(a,y,x,E)}return E},wt.ux=function(a,y,x,E){return y===void 0&&(y=!1),x===void 0&&(x=!0),pf(this,a,function(b){return b instanceof Ai&&(!x||b.canSelect())},y,E)},wt.Cf=function(a,y,x,E,b){y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof cn||b instanceof gn||(b=new gn),ts(this);for(var z=this.Wa.iteratorBackwards;z.next();){var tt=z.value;tt.visible&&tt.Cf(a,y,x,E,b)}return b},wt.Nu=function(a,y,x,E,b,z){var tt=new gn;ts(this);for(var rt=this.Wa.iteratorBackwards;rt.next();){var ot=rt.value;ot.visible&&ot.Nu(a,y,x,E,tt,b,z)}return tt};function pf(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 cn||b instanceof gn||(b=new gn),ts(a),a=a.Wa.iteratorBackwards;a.next();){var tt=a.value;tt.visible&&!tt.isTemporary&&tt.Cf(y,z,x,E,b)}return b}wt.mz=function(a,y,x,E,b){return x===void 0&&(x=!0),E===void 0&&(E=!0),Mc(this,a,y,function(z){return z instanceof Ai&&(!E||z.canSelect())},x,b)},wt.og=function(a,y,x,E,b,z){x===void 0&&(x=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof cn||b instanceof gn)&&(z=b),b=!0),z instanceof cn||z instanceof gn||(z=new gn),ts(this);for(var tt=this.Wa.iteratorBackwards;tt.next();){var rt=tt.value;rt.visible&&rt.og(a,y,x,E,b,z)}return z};function Mc(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 cn||b instanceof gn)&&(z=b),b=!0),z instanceof cn||z instanceof gn||(z=new gn),ts(a),a=a.Wa.iteratorBackwards;a.next();){var rt=a.value;rt.visible&&!rt.isTemporary&&rt.og(y,x,tt,E,b,z)}return z}be.prototype.acceptEvent=function(a){return Sl(this,a,a instanceof MouseEvent)};function Sl(a,y,x){var E=a.Qg;return a.Qg=a.cj,a.cj=E,E.diagram=a,E.event=y,x?zd(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),Mr&&y.button===0&&y.ctrlKey&&(E.button=2),E.down=!1,E.up=!1,E.clickCount=1,E.delta=0,E.handled=!1,E.bubbles=!1,E.timestamp=y.timeStamp,E.isMultiTouch=!1,E.targetDiagram=Lg(y,y.target),E.targetObject=null,E}function Lg(a,y){return y===null?null:(y=y.H)?y:((y=a.path)||typeof a.composedPath!="function"||(y=a.composedPath()),y&&y[0]&&y[0].H?y[0].H:null)}function Fg(a,y,x,E,b,z){var tt=a.Qg;return a.Qg=a.cj,a.cj=tt,tt.diagram=a,tt.clickCount=1,a=tt.delta=0,y.ctrlKey&&(a+=1),y.altKey&&(a+=2),y.shiftKey&&(a+=4),y.metaKey&&(a+=8),tt.modifiers=a,tt.event=y,tt.timestamp=y.timeStamp,tt.button=y.button,tt.buttons=y.buttons,Mr&&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 $l(a,y){return a.bubbles?!0:(y.stopPropagation!==void 0&&y.stopPropagation(),y.cancelable!==!1&&y.preventDefault(),y.cancelBubble=!0,!1)}be.prototype.Qz=function(a){var y=this.H;if(!this.H.isEnabled)return!1;var x=Sl(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(),$l(x,a)},be.prototype.Rz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Sl(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(),$l(x,a)},be.prototype.bz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Sl(y,a,!0);return y.mouseEnter!==null&&y.mouseEnter(x),y.currentTool.standardMouseOver(),$l(x,a)},be.prototype.cz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Sl(y,a,!0);return y.mouseLeave!==null&&y.mouseLeave(x),$l(x,a)},be.prototype.getMouse=function(a){var y=this.ta;if(y===null)return new At(0,0);var x=y.getBoundingClientRect();return y=a.clientX-this.Aa/x.width*x.left,a=a.clientY-this.ya/x.height*x.top,this.Ab!==null?An(new At(y,a),this.Ab):new At(y,a)};function zd(a,y,x){var E=a.ta,b=a.Aa,z=a.ya,tt=0,rt=0;E!==null&&(E=E.getBoundingClientRect(),tt=y.clientX-b/E.width*E.left,rt=y.clientY-z/E.height*E.top),x.viewPoint.h(tt,rt),a.Ab!==null?(y=At.allocAt(tt,rt),a.Ab.Cd(y),x.documentPoint.assign(y),At.free(y)):x.documentPoint.h(tt,rt)}function Mg(a,y,x){if(a.oj[0]!==null){y=a.oj[y];var E=a.ta;E!==null&&(E=E.getBoundingClientRect(),x.h(y.clientX-a.Aa/E.width*E.left,y.clientY-a.ya/E.height*E.top))}}be.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function em(a){a.ld||ts(a),a.Va()}be.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},wt=be.prototype,wt.Pz=function(){return this.kg},wt.Xy=function(a){a===void 0&&(a=null);var y=this.animationManager,x=y.isEnabled;y.Cc(),y.isEnabled=!1,xl(this),this.hf=!1,this.du=new At(NaN,NaN),y.isEnabled=x,this.ld=!0;var E=this;a!==null&&Di(function(){E.ld=!1,ju(y,"Model"),a(E)},1)},wt.$b=function(a){if(a===void 0&&(a=!1),this.kg!==!0&&!(this.vb||a===!1&&this.ld)){this.kg=!0;var y=this;qe.requestAnimationFrame(function(){y.kg&&y.bd()})}},wt.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),xl(this))};function od(a,y,x){!a.Ee||a.vb||a.animationManager.defaultAnimation.isAnimating||Hd(a)||(y&&ts(a),x&&Il(a,!1))}function xl(a,y){if(!a.ld&&(a.kg=!1,a.Ka!==null||a.wo.w())){a.ld=!0;var x=a.animationManager,E=a.Xn;if(!x.isAnimating&&E.length!==0){for(var b=E.s,z=b.length,tt=0;tt<z;tt++){var rt=b[tt];ma(rt,!1),rt.v()}E.clear()}E=a.ow,0<E.count&&(E.each(function(ot){ot.Nv()}),E.clear()),b=E=!1,x.defaultAnimation.isAnimating&&(b=!0,E=a.skipsUndoManager,a.skipsUndoManager=!0),x.zb||wg(a),od(a,!1,!0),a.fe!==null&&(a.fe.visible&&!a.mq&&(Mu(a),a.mq=!0),!a.fe.visible&&a.mq&&(a.mq=!1)),ts(a),z=!1,(!a.hf||a.xh)&&(a.hf?_g(a,!a.Jk):(a.Ea("Initial Layout"),x.isEnabled===!1&&x.Cc(),_g(a,!1)),z=!0),a.Jk=!1,ts(a),a.ou||em(a),od(a,!0,!1),tt=!1,z?(x=Te.alloc(),x.assign(a.viewportBounds),a.hf||(tt=a.hf=!0,a.skipsUndoManager||(a.undoManager.isPendingClear=!0),a.undoManager.isPendingUnmodified=!0,kg(a)),a.R("LayoutCompleted"),od(a,!0,!1),Te.free(x)):x.Ok&&x.Qw&&(a.Fg!==hs?a.scale=jd(a,a.Fg):a.yh!==hs?a.scale=jd(a,a.yh):(x=a.initialScale,isFinite(x)&&0<x&&(a.scale=x)),Il(a,!0)),z&&tt&&a.eb("Initial Layout"),ts(a),y||a.gc(a.ib),b&&(a.skipsUndoManager=E),a.ld=!1}}function kg(a){if(a.Fg!==hs)a.scale=jd(a,a.Fg);else if(a.yh!==hs)a.scale=jd(a,a.yh);else{var y=a.initialScale;isFinite(y)&&0<y&&(a.scale=y)}Il(a,!0),y=a.Wa.s,a.Fd(y,y.length,a,a.viewportBounds),a.R("InitialLayoutCompleted"),a.du.assign(a.pa),Mu(a)}function ts(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 gn,a.Nv(x,a.De)}a.nodes.each(function(E){E instanceof rr&&E.U&65536&&(E.U=E.U^65536)})}}wt.Nv=function(a,y){for(a.reset();a.next();){var x=a.value;!x.Zc()||x instanceof rr||(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))}for(a.reset();a.next();)x=a.value,x instanceof rr&&x.isVisible()&&kc(this,x);for(a.reset();a.next();)x=a.value,x instanceof kn&&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 Qr&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))};function kc(a,y){for(var x=Jn(),E=Jn(),b=y.memberParts;b.next();){var z=b.value;z.isVisible()&&(z instanceof rr?(ul(z)||Ss(z)||cd(z))&&kc(a,z):z instanceof kn?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(li(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();li(E)}wt.Fd=function(a,y,x,E){if(this.vd||this.animationManager.isAnimating)for(var b=0;b<y;b++)a[b].Fd(x,E)},wt.gc=function(a){if(this.Ka!==null){if(this.ta===null&&Gt("No canvas specified"),this.nl==="svg"){if(this.Ka!==null){var y=this.animationManager;if(!y.zb&&(!y.isAnimating||y.isTicking)){Gd(this);var x=this.Aa,E=this.ya;if(a.Gv.resize(x,E,x,E),x=this.Wa.s,E=x.length,this.Fd(x,E,this,this.viewportBounds),this.Fc||y.isAnimating){y=this.pa;var b=this.Ca,z=Math.round(y.x*b)/b,tt=Math.round(y.y*b)/b,rt=this.Ab;for(rt.reset(),b!==1&&rt.scale(b),y.x===0&&y.y===0||rt.translate(-z,-tt),a.ti=null,Yy(a,rt.m11,rt.m12,rt.m21,rt.m22,rt.dx,rt.dy),this.pb!==1&&(a.globalAlpha=this.pb),Mh(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?Yd(this.Yf,this)&&(a=this.Vp()):a=!0,a&&(ae.prototype.Cd=ae.prototype.Eu),this.Fc=this.vd=!1}}}}else t:if(z=this.animationManager,!z.zb&&(!z.isAnimating||z.isTicking)&&(x=new Date,Gd(this),this.Ka.style.opacity!=="0")){if(E=a!==this.ib,y=this.Wa.s,b=y.length,this.Fd(y,b,this,this.viewportBounds),E)a.Vc(!0),this.vd=!0;else if(!this.Fc&&!z.isAnimating)break t;z=this.Ab,z.reset(),tt=this.Mb,rt=this.pa;var ot=this.Ca,lt=Math.round(rt.x*ot)/ot,ut=Math.round(rt.y*ot)/ot;for(ot!==1&&z.scale(ot),rt.x===0&&rt.y===0||z.translate(-lt,-ut),a.setTransform(tt,0,0,tt,0,0),a.clearRect(0,0,this.Aa,this.ya),this.pb!==1&&(a.globalAlpha=this.pb),Mh(this,a),rt=0;rt<b;rt++)a.setTransform(tt,0,0,tt,0,0),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),a.yc(),y[rt].gc(a,this);if(y=!1,this.Yf?Yd(this.Yf,this)&&(y=this.Vp()):y=!0,y&&(ae.prototype.Cd=ae.prototype.Eu),E?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,y=+new Date-+x,E=_i&&_i.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 mf(a,y,x,E,b,z,tt,rt,ot,lt){if(a.Ka!==null){a.ta===null&&Gt("No canvas specified"),tt===void 0&&(tt=null),rt===void 0&&(rt=null),ot===void 0&&(ot=!1),lt===void 0&&(lt=!1),Gd(a),a.ib.Vc(!0),a.vd=!0,a.$i=!0;var ut=a.Ca;a.Ca=b;var ft=a.Wa.s,yt=ft.length;try{var xt=new Te(z.x,z.y,E.width/b,E.height/b),Ct=xt.copy();Ct.Co(x),Mu(a,Ct),ts(a),a.Fd(ft,yt,a,xt),y.setTransform(1,0,0,1,0,0),y.clearRect(0,0,E.width,E.height),rt!==null&&rt!==""&&(y.fillStyle=rt,y.ox(0,0,E.width,E.height));var bt=a.Mb;y.scale(bt,bt);var Vt=ae.alloc();Vt.reset(),Vt.translate(x.left,x.top),Vt.scale(b),z.x===0&&z.y===0||Vt.translate(-z.x,-z.y),y.setTransform(Vt.m11,Vt.m12,Vt.m21,Vt.m22,Vt.dx,Vt.dy),y.yc(),y instanceof Qs&&Yy(y,Vt.m11,Vt.m12,Vt.m21,Vt.m22,Vt.dx,Vt.dy),ae.free(Vt),Mh(a,y),y.globalAlpha=a.pb;var zt=a.Qj("Grid");if(tt){var $t=new gn,ie=tt.iterator;for(ie.reset();ie.next();){var oe=ie.value;oe instanceof Ai&&(lt||oe.layer!==zt)&&(oe.Gj(),$t.add(oe))}for(lt=0;lt<yt;lt++)Up(ft[lt],y,a,$t,ot);$t.each(function(ke){return ke.Gj()})}else for($t=0;$t<yt;$t++){var de=ft[$t];de===zt?lt&&de.gc(y,a,!0):de.gc(y,a,ot)}a.$i=!1,a.Yf&&Yd(a.Yf,a)&&a.Vp()}finally{a.Ca=ut,a.ib.Vc(!0),a.vd=!0,a.Fd(ft,yt,a,a.viewportBounds),Mu(a),a.ib instanceof Qs&&(a.ib.Nj.PA(),a.redraw())}}}wt.Gf=function(a){return this.Rg[a]},wt.Xx=function(a,y){a==="minDrawingLength"&&(this.Oq=y),this.Rg[a]=y,this.redraw()},wt.Tx=function(){this.Rg=new bi,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(Mr||vr),this.Rg.temporaryPixelRatio=!0,this.Rg.pictureRatioOptimization=!0,this.Oq=this.Rg.minDrawingLength=1};function Mh(a,y){a=a.Rg,a!==null&&(a.imageSmoothingEnabled!==void 0&&y.Wx(!!a.imageSmoothingEnabled),a=a.defaultFont,a!=null&&(y.font=a))}wt.Ql=function(a){return this.on[a]},wt.sA=function(a,y){this.on[a]=y},wt.Sx=function(){this.on=new bi,this.on.extraTouchArea=10,this.on.extraTouchThreshold=10,this.on.hasGestureZoom=!0},wt.set=function(a){return Object.assign(this,a),this},wt.Du=function(a){return this.nm(a)},wt.nm=function(a){return Zd(this,a),this};function Zd(a,y){var x=a instanceof Pn,E=a instanceof be,b;for(b in y){b===""&&Gt("Setting properties requires non-empty property names");var z=a,tt=b;if(x||E){var rt=b.indexOf(".");if(0<rt){var ot=b.substring(0,rt);x?z=a.fb(ot):(z=a[ot],z==null&&(z=a.toolManager[ot])),Re(z)?tt=b.substr(rt+1):Gt("Unable to find object named: "+ot+" in "+a.toString()+" when trying to set property: "+b)}}if(tt[0]!=="_"&&!Oi(z,tt))if(E&&tt==="ModelChanged"){a.Yw(y[tt]);continue}else if(E&&tt==="Changed"){a.Pe(y[tt]);continue}else if(E&&Oi(a.toolManager,tt))z=a.toolManager;else if(E&&rm(a,tt)){a.Bj(tt,y[tt]);continue}else if(a instanceof Ei&&tt==="Changed"){a.Pe(y[tt]);continue}else Gt('Trying to set undefined property "'+tt+'" on object: '+z.toString());z[tt]=y[b],tt[0]==="_"&&z instanceof fe&&z.Vw(tt)}}wt.bx=function(){if(this.Eh.count!==0&&!(1<this.undoManager.transactionLevel)){for(;0<this.Eh.count;){var a=this.Eh;for(this.Eh=new Be,a=a.iterator;a.next();){var y=a.key;y.Xo(a.value),y.qc()}}this.N()}},wt.N=function(a){if(a===void 0)this.Fc=!0,this.$b();else{var y=this.viewportBounds;a.w()&&y.Yc(a)&&(this.Fc=!0,this.$b())}this.R("InvalidateDraw")},be.prototype.invalidateViewport=function(a,y){if(this.Fc!==!0)if(this.Fc=!0,this.nl==="svg")this.bd();else{var x=this.Gf("temporaryPixelRatio")===!0;if(this.Gf("viewportOptimizations")===!0&&this.scrollMode!==Bc&&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=Te.alloc(),Ig(this,this.computeBounds(E)),Te.free(E)),E=this.ta,E===null||E instanceof bu)))){var tt=this.Mb;b=this.Aa*tt;var rt=this.ya*tt,ot=this.scale*tt;z=Math.round(Math.round(y.x*ot)-Math.round(a.x*ot)),y=Math.round(Math.round(y.y*ot)-Math.round(a.y*ot)),ot=this.jw,a=this.oy,ot.width!==b&&(ot.width=b),ot.height!==rt&&(ot.height=rt),a.clearRect(0,0,b,rt),ot=190*tt;var lt=70*tt,ut=Math.max(z,0),ft=Math.max(y,0),yt=Math.floor(b-ut),xt=Math.floor(rt-ft);a.drawImage(E.Oa,ut,ft,yt,xt,0,0,yt,xt),Yd(this.Yf,this)&&a.clearRect(0,0,ot,lt),E=Jn(),a=Jn(),xt=Math.abs(z),yt=Math.abs(y);var Ct=ut===0?0:b-xt;ut=At.allocAt(Ct,0),xt=At.allocAt(xt+Ct,rt),a.push(new Te(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y)));var bt=this.Ab;if(bt.reset(),bt.scale(tt,tt),this.Ca!==1&&bt.scale(this.Ca),tt=this.pa,(tt.x!==0||tt.y!==0)&&isFinite(tt.x)&&isFinite(tt.y)&&bt.translate(-tt.x,-tt.y),An(ut,bt),An(xt,bt),E.push(new Te(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),Ct=ft===0?0:rt-yt,ut.h(0,Ct),xt.h(b,yt+Ct),a.push(new Te(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),An(ut,bt),An(xt,bt),E.push(new Te(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),Yd(this.Yf,this)&&(b=0<z?0:-z,rt=0<y?0:-y,ut.h(b,rt),xt.h(ot+b,lt+rt),a.push(new Te(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),An(ut,bt),An(xt,bt),E.push(new Te(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y)))),At.free(ut),At.free(xt),od(this,!1,!0),this.Ka===null&&Gt("No div specified"),this.ta===null&&Gt("No canvas specified"),!this.animationManager.zb&&(b=this.ib,this.Fc)){for(Gd(this),rt=this.Mb,b.setTransform(1,0,0,1,0,0),b.clearRect(0,0,this.Aa*rt,this.ya*rt),b.drawImage(this.jw.Oa,0<z?0:Math.round(-z),0<y?0:Math.round(-y)),z=this.pa,tt=this.Ca,ot=Math.round(z.x*tt)/tt,lt=Math.round(z.y*tt)/tt,y=this.Ab,y.reset(),tt!==1&&y.scale(tt),z.x===0&&z.y===0||y.translate(-ot,-lt),b.save(),b.beginPath(),z=a.length,tt=0;tt<z;tt++)ot=a[tt],ot.width!==0&&ot.height!==0&&b.rect(Math.floor(ot.x),Math.floor(ot.y),Math.ceil(ot.width),Math.ceil(ot.height));for(b.clip(),b.setTransform(rt,0,0,rt,0,0),b.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),b.yc(),y=this.Wa.s,z=y.length,this.Fd(y,z,this,this.viewportBounds),Mh(this,b),b.globalAlpha=this.pb,rt=0;rt<z;rt++)if(tt=y[rt],ot=E,tt.visible&&tt.pb!==0){lt=sh(tt,b),ft=tt.Zq,ft.length=0,ut=this.scale,yt=Te.alloc(),xt=tt.Pa.s,bt=xt.length,Ct=ot.length;for(var Vt=0;Vt<bt;Vt++){var zt=xt[Vt],$t=ec(zt,zt.actualBounds);t:{for(var ie=2/ut,oe=4/ut,de=0;de<Ct;de++){var ke=ot[de];if(ke.width!==0&&ke.height!==0&&$t.Vu(ke.x-ie,ke.y-ie,ke.width+oe,ke.height+oe)){$t=!0;break t}}$t=!1}$t&&tt.Oj(b,zt,this,ft,ut,yt,!0)}Te.free(yt),b.globalAlpha=lt}b.restore(),b.Vc(!0),this.Yf&&Yd(this.Yf,this)&&this.Vp(),this.Fc=this.vd=!1,this.hk()}li(E),li(a),this.ld=!1}}else this.bd();x&&(Bs(this),this.bd(),Lc(this,!0))}else x?(Bs(this),this.bd(),Lc(this,!0)):this.bd()}};function Gd(a){a.pn!==!1&&(a.pn=!1,bg(a,a.Aa,a.ya))}function bg(a,y,x){ku(a);var E=a.Mb;a.ta.resize(y*E,x*E,y,x)&&(a.Fc=!0,a.ib.Vc(!0))}function Hd(a){var y=a.ta;if(y===null||a.wo.w())return!0;var x=a.Aa,E=a.ya,b=a.Ka,z=!1,tt=a.gf?a.Db:0,rt=a.Be?a.Db:0,ot=b.clientWidth||x+tt,lt=b.clientHeight||E+rt,ut=a.viewportBounds;b=ut.x;var ft=ut.y,yt=ut.width,xt=ut.height;if((ot!==x+tt||lt!==E+rt)&&(a.gf=!1,a.Be=!1,rt=tt=0,a.Aa=ot,a.ya=lt,z=a.pn=!0,ku(a)),!a.hf||!a.viewportBounds.w())return!0;var Ct=a.ku,bt=a.hu;if(a.Ee=!1,!(z||a.gf||a.Be||a.mn||a.nn))return!0;var Vt=a.documentBounds,zt=0,$t=0,ie=0,oe=0,de=ut.width,ke=ut.height,Hn=a.rj;a.contentAlignment.sb()?(Vt.width>de&&(zt=Hn.left,$t=Hn.right),Vt.height>ke&&(ie=Hn.top,oe=Hn.bottom)):(zt=Hn.left,$t=Hn.right,ie=Hn.top,oe=Hn.bottom);var ci=Vt.width+zt+$t,ai=Vt.height+ie+oe;Hn=a.scale;var Fn=ci>ot/Hn,tn=ai>lt/Hn;if(!(z||a.gf||a.Be||Fn||tn))return!0;zt=Vt.x-zt,ot=ut.x,$t=Vt.right+$t,lt=ut.right+tt,ie=Vt.y-ie;var nr=ut.y;Vt=Vt.bottom+oe,ut=ut.bottom+rt;var Ji="1px";if(oe="1px",a.scrollMode===bh&&(Fn||tn)&&(Fn&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(Fn=1,zt+1<ot&&(Fn=Math.max((ot-zt)*Hn+a.Aa,Fn)),$t>lt+1&&(Fn=Math.max(($t-lt)*Hn+a.Aa,Fn)),de+tt+1<ci&&(Fn=Math.max((ci-de)*Hn+a.Aa,Fn)),Ji=Fn.toString()+"px"),tn&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(Fn=1,ie+1<nr&&(Fn=Math.max((nr-ie)*Hn+a.ya,Fn)),Vt>ut+1&&(Fn=Math.max((Vt-ut)*Hn+a.ya,Fn)),ke+rt+1<ai&&(Fn=Math.max((ai-ke)*Hn+a.ya,Fn)),oe=Fn.toString()+"px")),Fn=Ji!=="1px",tn=oe!=="1px",Fn&&tn||!Fn&&!tn||(tn&&(lt-=a.Db),Fn&&(ut-=a.Db),ci<de+tt||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(tt=1,zt+1<ot&&(tt=Math.max((ot-zt)*Hn+a.Aa,tt)),$t>lt+1&&(tt=Math.max(($t-lt)*Hn+a.Aa,tt)),de+1<ci&&(tt=Math.max((ci-de)*Hn+a.Aa,tt)),Ji=tt.toString()+"px"),Fn=Ji!=="1px",tt=a.ya,Fn!==a.Be&&(tt=Fn?a.ya-a.Db:a.ya+a.Db),ai<ke+rt||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(rt=1,ie+1<nr&&(rt=Math.max((nr-ie)*Hn+tt,rt)),Vt>ut+1&&(rt=Math.max((Vt-ut)*Hn+tt,rt)),ke+1<ai&&(rt=Math.max((ai-ke)*Hn+tt,rt)),oe=rt.toString()+"px"),tn=oe!=="1px"),a.qr&&Fn===a.Be&&tn===a.gf)return x===a.Aa&&E===a.ya||a.bd(),!1;if(Fn!==a.Be&&(Ji==="1px"?a.ya=a.ya+a.Db:a.ya=Math.max(a.ya-a.Db,1),z=!0),a.Be=Fn,bt.style.width=Ji,tn!==a.gf&&(oe==="1px"?a.Aa=a.Aa+a.Db:a.Aa=Math.max(a.Aa-a.Db,1),z=!0,a.tn&&(rt=At.alloc(),tn?(y.style.left=a.Db+"px",a.position=rt.h(a.pa.x+a.Db/a.scale,a.pa.y)):(y.style.left="0px",a.position=rt.h(a.pa.x-a.Db/a.scale,a.pa.y)),At.free(rt))),z&&ku(a),a.gf=tn,bt.style.height=oe,a.gu=!0,z&&(a.pn=!0),y=Ct.scrollLeft,a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(de+1<ci?y=(a.position.x-zt)*Hn:zt+1<ot?y=Ct.scrollWidth-Ct.clientWidth:$t>lt+1&&(y=a.position.x*Hn)),a.tn)switch(a.bu){case"negative":y=-(Ct.scrollWidth-y-Ct.clientWidth);break;case"reverse":y=Ct.scrollWidth-y-Ct.clientWidth}return Ct.scrollLeft=y,a.hasVerticalScrollbar&&a.allowVerticalScroll&&(ke+1<ai?Ct.scrollTop=(a.position.y-ie)*Hn:ie+1<nr?Ct.scrollTop=Ct.scrollHeight-Ct.clientHeight:Vt>ut+1&&(Ct.scrollTop=a.position.y*Hn)),ot=a.Aa,lt=a.ya,Ct.style.width=ot+(a.gf?a.Db:0)+"px",Ct.style.height=lt+(a.Be?a.Db:0)+"px",x!==ot||E!==lt||a.animationManager.zb?(x=Te.allocAt(b,ft,yt,xt),a.onViewportBoundsChanged(x,a.viewportBounds,Hn,z),Te.free(x),!1):!0}wt=be.prototype,wt.add=function(a){var y=a.diagram;if(y!==this&&(y!==null&&Gt("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&&Gt('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(uo,"parts",y,null,a,null,x),y.isTemporary||this.Ya(),a.C(1),x=a.layerChanged,x!==null&&x(a,null,y)}},wt.oi=function(a){this.partManager.oi(a);var y=this;$d(a,function(x){Wd(y,x)}),(a instanceof Qr||a instanceof rr&&a.placeholder!==null)&&a.v(),a.data!==null&&$d(a,function(x){sy(y.partManager,x)}),Ss(a)!==!0&&cd(a)!==!0||this.De.add(a),_1(a,!0,this),j1(a)?(a.actualBounds.w()&&this.N(ec(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(ec(a,a.actualBounds)),this.$b()},wt.pc=function(a){a.Ej(),this.partManager.pc(a);var y=this;a.data!==null&&$d(a,function(x){ly(y.partManager,x,y)}),this.De.remove(a),j1(a)?(a.actualBounds.w()&&this.N(ec(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(ec(a,a.actualBounds)),this.$b()},wt.remove=function(a){Ng(this,a,!0)};function Ng(a,y,x){var E=y.layer;E!==null&&E.diagram===a&&(y.isSelected=!1,y.isHighlighted=!1,y.C(2),x&&y.Lj(),x=E.pc(-1,y,!1),0<=x&&a.cb(yo,"parts",E,y,null,x,null),a=y.layerChanged,a!==null&&a(y,E,null))}wt.Is=function(a,y){if(y===void 0&&(y=!1),$e(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 gn,x.addAll(a),a=x.iterator;a.next();)x=a.value,y&&!x.canDelete()||this.remove(x)},wt.Kj=function(a,y,x){return x===void 0&&(x=!1),this.partManager.Kj(a,y,x)},be.prototype.moveParts=function(a,y,x,E){if(x===void 0&&(x=!1),E===void 0&&(E=vf(this)),this.toolManager!==null){var b=new Be;if(a!==null)if($e(a))for(var z=0;z<a.length;z++)Gu(this,b,a[z],x,E);else for(a=a.iterator;a.next();)Gu(this,b,a.value,x,E);else{for(a=this.parts;a.next();)Gu(this,b,a.value,x,E);for(a=this.nodes;a.next();)Gu(this,b,a.value,x,E);for(a=this.links;a.next();)Gu(this,b,a.value,x,E)}ad(this,b,y,E,x)}};function Gu(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=vf(a)),x instanceof qn){if(y.add(x,a.Pd(b,x,x.location)),x instanceof rr&&(x.placeholder!==null||b.dragsMembers))for(z=x.memberParts;z.next();)Gu(a,y,z.value,E,b,b.groupsAlwaysMove);for(z=x.linksConnected;z.next();){var tt=z.value;if(!y.contains(tt)){var rt=tt.fromNode,ot=tt.toNode;rt!==null&&y.contains(rt)&&ot!==null&&y.contains(ot)&&Gu(a,y,tt,E,b)}}if(b.dragsTree)for(x=x.Ou();x.next();)Gu(a,y,x.value,E,b)}else if(x instanceof kn)for(y.add(x,a.Pd(b,x)),x=x.labelNodes;x.next();)Gu(a,y,x.value,E,b);else x instanceof Qr||y.add(x,a.Pd(b,x,x.location))}function ad(a,y,x,E,b){if(y!==null&&y.count!==0){var z=At.alloc(),tt=At.alloc();tt.assign(x),isNaN(tt.x)&&(tt.x=0),isNaN(tt.y)&&(tt.y=0),(x=a.Mr)||Sf(a,y);for(var rt=Jn(),ot=Jn(),lt=y.iterator,ut=At.alloc();lt.next();){var ft=lt.key,yt=lt.value;if(ft.Zc()){var xt=Bg(a,ft,y);xt!==null?rt.push(new it(ft,yt,xt)):(!b||ft.canMove())&&(xt=yt.point,z.assign(xt),a.computeMove(ft,z.add(tt),E,ut),ft.location=ut,yt.shifted===void 0&&(yt.shifted=new At),yt.shifted.assign(ut.re(xt)))}else lt.key instanceof kn&&ot.push(lt.sa)}for(At.free(ut),b=rt.length,lt=0;lt<b;lt++)ft=rt[lt],z.assign(ft.info.point),ft.Su.shifted===void 0&&(ft.Su.shifted=new At),ft.node.location=z.add(ft.Su.shifted);for(b=At.alloc(),lt=At.alloc(),ft=ot.length,yt=0;yt<ft;yt++){var Ct=ot[yt];if(xt=Ct.key,xt instanceof kn)if(xt.suspendsRouting){xt.Tg=null,ut=xt.fromNode;var bt=xt.toNode;if(a.draggedLink!==null&&E.dragsLink)if(bt=Ct.value.point,xt.dragComputation===null)y.add(xt,a.Pd(E,xt,tt)),_h(xt,tt.x-bt.x,tt.y-bt.y);else{Ct=At.allocAt(0,0),(ut=xt.i(0))&&ut.w()&&Ct.assign(ut);var Vt=ut=At.alloc().assign(Ct).add(tt);E.isGridSnapEnabled&&(E.isGridSnapRealtime||a.lastInput.up)&&(Vt=At.alloc(),yf(a,xt,ut,Vt,E)),ut.assign(xt.dragComputation(xt,ut,Vt)).re(Ct),y.add(xt,a.Pd(E,xt,ut)),_h(xt,ut.x-bt.x,ut.y-bt.y),At.free(Ct),At.free(ut),Vt!==ut&&At.free(Vt)}else ut!==null&&(b.assign(ut.location),Vt=y.I(ut),Vt!==null&&b.re(Vt.point)),bt!==null&&(lt.assign(bt.location),Vt=y.I(bt),Vt!==null&&lt.re(Vt.point)),ut!==null&&bt!==null?b.Xa(lt)?(ut=Ct.value.point,bt=z,bt.assign(b),bt.re(ut),y.add(xt,a.Pd(E,xt,b)),_h(xt,bt.x,bt.y)):(xt.suspendsRouting=!1,xt.bb()):(Ct=Ct.value.point,ut=ut!==null?b:bt!==null?lt:tt,y.add(xt,a.Pd(E,xt,ut)),_h(xt,ut.x-Ct.x,ut.y-Ct.y))}else(xt.fromNode===null||xt.toNode===null)&&(ut=Ct.value.point,y.add(xt,a.Pd(E,xt,tt)),_h(xt,tt.x-ut.x,tt.y-ut.y))}At.free(z),At.free(tt),At.free(b),At.free(lt),li(rt),li(ot),x||(ts(a),sd(a,y))}}be.prototype.computeMove=function(a,y,x,E){if(E===void 0&&(E=new At),E.assign(y),a===null)return E;var b=y,z=x.isGridSnapEnabled;z&&(x.isGridSnapRealtime||this.lastInput.up)&&(b=At.alloc(),yf(this,a,y,b,x)),x=a.dragComputation!==null?a.dragComputation(a,y,b):b;var tt=a.minLocation,rt=tt.x;isNaN(rt)&&(rt=z?Math.round(1e3*a.location.x)/1e3:a.location.x),tt=tt.y,isNaN(tt)&&(tt=z?Math.round(1e3*a.location.y)/1e3:a.location.y);var ot=a.maxLocation,lt=ot.x;return isNaN(lt)&&(lt=z?Math.round(1e3*a.location.x)/1e3:a.location.x),ot=ot.y,isNaN(ot)&&(ot=z?Math.round(1e3*a.location.y)/1e3:a.location.y),E.h(Math.max(rt,Math.min(x.x,lt)),Math.max(tt,Math.min(x.y,ot))),b!==y&&At.free(b),E};function vf(a){var y=a.toolManager.findTool("Dragging");return y!==null?y.dragOptions:a.Wm}function yf(a,y,x,E,b){if(b===void 0&&(b=vf(a)),E.assign(x),y!==null){var z=a.grid;y=b.gridSnapCellSize,a=y.width,y=y.height;var tt=b.gridSnapOrigin,rt=tt.x;if(tt=tt.y,b=b.gridSnapCellSpot,z!==null){var ot=z.gridCellSize;isNaN(a)&&(a=ot.width),isNaN(y)&&(y=ot.height),z=z.gridOrigin,isNaN(rt)&&(rt=z.x),isNaN(tt)&&(tt=z.y)}z=At.allocAt(0,0),z.yi(0,0,a,y,b),_t.No(x.x,x.y,rt+z.x,tt+z.y,a,y,E),At.free(z)}}function Sf(a,y){if(y!==null)for(a.Mr=!0,a=y.iterator;a.next();)y=a.key,y instanceof kn&&(y.suspendsRouting=!0)}function sd(a,y){if(y!==null){for(y=y.iterator;y.next();){var x=y.key;x instanceof kn&&(x.suspendsRouting=!1,Uv(x)&&x.bb())}a.Mr=!1}}function Bg(a,y,x){return y=y.containingGroup,y!==null&&(a=Bg(a,y,x),a!==null||(a=x.I(y),a!==null))?a:null}wt=be.prototype,wt.Pd=function(a,y,x){if(x===void 0)return new lh(jn);var E=a.isGridSnapEnabled;return a.groupsSnapMembers||y.containingGroup===null||(E=!1),E?new lh(new At(Math.round(1e3*x.x)/1e3,Math.round(1e3*x.y)/1e3)):new lh(x.copy())};function Ag(a,y,x){if(y.diagram!==null&&y.diagram!==a&&Gt("Cannot share a Layer with another Diagram: "+y+" of "+y.diagram),x===null?y.diagram!==null&&Gt("Cannot add an existing Layer to this Diagram again: "+y):(x.diagram!==a&&Gt("Existing Layer must be in this Diagram: "+x+" not in "+x.diagram),y===x&&Gt("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&&Gt("Cannot add Layer with the name '"+y+"'; a Layer with the same name is already present in this Diagram.")}}wt.Al=function(a){Ag(this,a,null),a.Xe(this);var y=this.Wa,x=y.count-1;if(!a.isTemporary)for(;0<=x&&y.M(x).isTemporary;)x--;return y.Gb(x+1,a),this.cc!==null&&this.cb(uo,"layers",this,null,a,null,x+1),this.N(),this.Ya(),this},wt.Ww=function(a,y){Ag(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(yo,"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(uo,"layers",this,null,a,null,z),this.N(),0>E&&this.Ya(),this},wt.Cy=function(a,y){Ag(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(yo,"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(uo,"layers",this,null,a,null,z+1),this.N(),0>E&&this.Ya(),this},wt.kA=function(a){if(a.diagram!==this&&Gt("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(yo,"layers",this,a,null,x,null),this.N(),this.Ya()}}},wt.Qj=function(a){for(var y=this.layers;y.next();){var x=y.value;if(x.name===a)return x}return null},wt.Yw=function(a){return this.pf===null&&(this.pf=new cn),this.pf.add(a),this.model.Pe(a),this},wt.mA=function(a){this.pf!==null&&(this.pf.remove(a),this.pf.count===0&&(this.pf=null)),this.model.ik(a)},wt.Pe=function(a){return this.zg===null&&(this.zg=new cn),this.zg.add(a),this},wt.ik=function(a){this.zg!==null&&(this.zg.remove(a),this.zg.count===0&&(this.zg=null))},wt.ds=function(a){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(a),a.change!==$i&&(this.isModified=!0),this.zg!==null)for(var y=this.zg,x=y.length,E=0;E<x;E++)y.M(E)(a)},wt.cb=function(a,y,x,E,b,z,tt){z===void 0&&(z=null),tt===void 0&&(tt=null);var rt=new Pi;rt.diagram=this,rt.change=a,rt.propertyName=y,rt.object=x,rt.oldValue=E,rt.oldParam=z,rt.newValue=b,rt.newParam=tt,this.ds(rt)},wt.g=function(a,y,x,E,b){this.cb(pr,a,this,y,x,E,b)},be.prototype.changeState=function(a,y){if(a!==null&&a.diagram===this){var x=this.skipsModelSourceBindings;try{this.skipsModelSourceBindings=!0;var E=a.change;if(E===pr){var b=a.object;if(Vo(b,a.propertyName,a.I(y)),b instanceof fe){var z=b.part;z!==null&&z.Wb()}this.isModified=!0}else if(E===uo){var tt=a.object,rt=a.newParam,ot=a.newValue;if(tt instanceof Pn)if(typeof rt=="number"&&ot instanceof fe){y?tt.pc(rt):tt.Gb(rt,ot);var lt=tt.part;lt!==null&&lt.Wb()}else typeof rt=="number"&&ot instanceof va&&(ot.isRow?h1(tt,rt,y?void 0:ot):d1(tt,rt,y?void 0:ot));else if(tt instanceof Ra){var ut=a.oldParam===!0;typeof rt=="number"&&ot instanceof Ai&&(y?(ot.isSelected=!1,ot.isHighlighted=!1,ot.Wb(),tt.pc(ut?rt:-1,ot,ut)):tt.oi(rt,ot,ut))}else tt instanceof be?typeof rt=="number"&&ot instanceof Ra&&(y?this.Wa.mb(rt):(ot.Xe(this),this.Wa.Gb(rt,ot))):Gt("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(E===yo){var ft=a.object,yt=a.oldParam,xt=a.oldValue;if(ft instanceof Pn)typeof yt=="number"&&xt instanceof fe?y?ft.Gb(yt,xt):ft.pc(yt):typeof yt=="number"&&xt instanceof va&&(xt.isRow?h1(ft,yt,y?xt:void 0):d1(ft,yt,y?xt:void 0));else if(ft instanceof Ra){var Ct=a.newParam===!0;typeof yt=="number"&&xt instanceof Ai&&(y?0>ft.Pa.indexOf(xt)&&ft.oi(yt,xt,Ct):(xt.isSelected=!1,xt.isHighlighted=!1,xt.Wb(),ft.pc(Ct?yt:-1,xt,Ct)))}else ft instanceof be?typeof yt=="number"&&xt instanceof Ra&&(y?(xt.Xe(this),this.Wa.Gb(yt,xt)):this.Wa.mb(yt)):Gt("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else E!==$i&&Gt("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=x}}},be.prototype.Ea=function(a){return this.undoManager.Ea(a)},be.prototype.eb=function(a){return this.undoManager.eb(a)},be.prototype.Kf=function(){return this.undoManager.Kf()},be.prototype.commit=function(a,y){y===void 0&&(y="");var x=this.skipsUndoManager;y===null&&(this.skipsUndoManager=!0,y=""),this.undoManager.Ea(y);var E=!1;try{a(this),E=!0}finally{E?this.undoManager.eb(y):this.undoManager.Kf(),this.skipsUndoManager=x}},be.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)},be.prototype.rp=function(){this.partManager.rp()};function Tg(a,y,x){var E=a.animationManager;if(a.vb||a.ld)a.Ca=x,ku(a),a.N(),a.Ee=!0,E.zb&&(oh(E)||E.ce.add(E.H,"scale",y,a.Ca));else if(a.ta===null)a.Ca=x,ku(a);else{a.vb=!0;var b=a.viewportBounds.copy(),z=a.Aa,tt=a.ya,rt=a.zoomPoint.x,ot=a.zoomPoint.y,lt=a.contentAlignment;isNaN(rt)&&(lt.$c()?lt.Hf(ns)?rt=0:lt.Hf(Jo)&&(rt=z-1):rt=lt.sb()?lt.x*(z-1):z/2),isNaN(ot)&&(lt.$c()?lt.Hf(Sa)?ot=0:lt.Hf(ps)&&(ot=tt-1):ot=lt.sb()?lt.y*(tt-1):tt/2),a.scaleComputation===null||a.animationManager.defaultAnimation.isAnimating||(x=a.scaleComputation(a,x)),x<a.minScale&&(x=a.minScale),x>a.maxScale&&(x=a.maxScale),z=At.allocAt(a.pa.x+rt/y-rt/x,a.pa.y+ot/y-ot/x),a.position=z,At.free(z),a.Ca=x,ku(a),a.vb=!1,a.onViewportBoundsChanged(b,a.viewportBounds,y,!1),Il(a,!1),E.zb&&(oh(E)||E.ce.add(E.H,"scale",y,a.Ca))}}be.prototype.onViewportBoundsChanged=function(a,y,x,E){if(!a.D(y)){E===void 0&&(E=!1),E||(this.Ee=!0),this.vd=!0;var b=this.layout;b===null||!b.isViewportSized||this.autoScale!==hs||a.width===y.width&&a.height===y.height||b.C(),b=this.currentTool,this.Vk===!0&&b instanceof Ar&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),ea(b,this)),this.vb||this.invalidateViewport(a,y),Mu(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 Mu(a,y){var x=a.fe;if(x!==null&&x.visible){for(var E=nn.alloc(),b=1,z=1,tt=x.O.s,rt=tt.length,ot=0;ot<rt;ot++){var lt=tt[ot],ut=Math.abs(lt.interval);2>ut||(pv(lt.figure)?z=z*ut/_t.vx(z,ut):b=b*ut/_t.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=Te.alloc(),a=a.viewportBounds,y.h(a.x,a.y,a.width,a.height),!y.w()){Te.free(y);return}b=y.width,z=y.height,a=y.x,tt=y.y,Te.free(y)}x.width=b+2*E.width,x.height=z+2*E.height,y=At.alloc(),_t.No(a,tt,0,0,E.width,E.height,y),y.offset(-E.width,-E.height),nn.free(E),x.part.location=y,At.free(y)}}be.prototype.clearSelection=function(a){a===void 0&&(a=!1);var y=this.selection;if(y.count!==0){a||this.R("ChangingSelection",y);for(var x=y.Fa(),E=x.length,b=0;b<E;b++)x[b].isSelected=!1;y.ka(),y.clear(),y.freeze(),a||this.R("ChangedSelection",y)}},be.prototype.select=function(a){a!==null&&a.diagram===this&&(!a.isSelected||1<this.selection.count)&&(this.R("ChangingSelection",this.selection),this.clearSelection(!0),a.isSelected=!0,this.R("ChangedSelection",this.selection))},be.prototype.rA=function(a){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),$e(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];E instanceof Ai||Gt("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 Ai||Gt("Diagram.selectCollection given something that is not a Part: "+y),y.isSelected=!0;this.R("ChangedSelection",this.selection)},be.prototype.clearHighlighteds=function(){var a=this.highlighteds;if(0<a.count){for(var y=a.Fa(),x=y.length,E=0;E<x;E++)y[E].isHighlighted=!1;a.ka(),a.clear(),a.freeze()}},wt=be.prototype,wt.Iz=function(a){a!==null&&a.diagram===this&&(!a.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),a.isHighlighted=!0)},wt.Jz=function(a){a=new gn().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 Ai||Gt("Diagram.highlightCollection given something that is not a Part: "+y),y.isHighlighted=!0},wt.scroll=function(a,y,x){x===void 0&&(x=1);var E=y==="up"||y==="down",b=0,z=At.alloc();if(a==="pixel")b=x;else if(a==="line")b=x*(E?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if(a==="page")a=E?this.viewportBounds.height:this.viewportBounds.width,a*=this.scale,a!==0&&(b=x*Math.max(a-(E?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0));else{if(a==="document"){b=this.documentBounds,x=this.viewportBounds,y==="up"?this.position=z.h(x.x,b.y):y==="left"?this.position=z.h(b.x,x.y):y==="down"?this.position=z.h(x.x,b.bottom-x.height):y==="right"&&(this.position=z.h(b.right-x.width,x.y)),At.free(z);return}Gt("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):Gt("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+y),At.free(z)},wt.tv=function(a){var y=this.viewportBounds;y.Re(a)||(a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a)},wt.es=function(a){var y=this.viewportBounds;a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a},wt.op=function(a){var y=this.Ab;y.reset(),this.Ca!==1&&y.scale(this.Ca);var x=this.pa;return(x.x!==0||x.y!==0)&&isFinite(x.x)&&isFinite(x.y)&&y.translate(-x.x,-x.y),a.copy().transform(this.Ab)},wt.zA=function(a){var y=this.Ab,x=a.x,E=a.y,b=x+a.width,z=E+a.height,tt=y.m11,rt=y.m12,ot=y.m21,lt=y.m22,ut=y.dx,ft=y.dy,yt=x*tt+E*ot+ut;y=x*rt+E*lt+ft;var xt=b*tt+E*ot+ut;return a=b*rt+E*lt+ft,E=x*tt+z*ot+ut,x=x*rt+z*lt+ft,tt=b*tt+z*ot+ut,b=b*rt+z*lt+ft,z=Math.min(yt,xt),yt=Math.max(yt,xt),xt=Math.min(y,a),y=Math.max(y,a),z=Math.min(z,E),yt=Math.max(yt,E),xt=Math.min(xt,x),y=Math.max(y,x),z=Math.min(z,tt),yt=Math.max(yt,tt),xt=Math.min(xt,b),y=Math.max(y,b),new Te(z,xt,yt-z,y-xt)},wt.Ps=function(a){var y=this.Ab;y.reset(),this.Ca!==1&&y.scale(this.Ca);var x=this.pa;return(x.x!==0||x.y!==0)&&isFinite(x.x)&&isFinite(x.y)&&y.translate(-x.x,-x.y),An(a.copy(),this.Ab)};function nm(a){var y=a.isModified;a.Tw!==y&&(a.Tw=y,a.R("Modified"))}function Dg(a){return a=Lf.get(a),a!==null?new a:new xo}be.prototype.doModelChanged=function(a){var y=this;if(a.model===this.model){var x=a.change,E=a.propertyName;if(x===$i&&E[0]==="S")if(E==="StartingFirstTransaction"){var b=this;a=this.toolManager,a.mouseDownTools.each(function(ot){return ot.diagram=b}),a.mouseMoveTools.each(function(ot){return ot.diagram=b}),a.mouseUpTools.each(function(ot){return ot.diagram=b}),this.ld||this.hf||(this.Jk=!0,this.fn&&(this.kg=!0))}else E==="StartingUndo"||E==="StartingRedo"?(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Cc(),this.R("ChangingSelection",this.selection)):E==="StartedTransaction"&&(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Cc());else if(this.aa){this.aa=!1;try{if(a.modelChange===""&&x===$i){(E==="FinishedUndo"||E==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),ts(this));var z=this.animationManager;E==="RolledBackTransaction"&&z.Cc(),this.bx(),this.Jk=!0,this.bd(),this.undoManager.transactionLevel!==0&&this.undoManager.transactionLevel!==1||hf(z),E==="CommittedTransaction"&&this.undoManager.isJustDiscarded&&(this.Ce=Math.min(this.Ce,this.undoManager.historyIndex-1)),E!=="CommittedTransaction"&&E!=="RolledBackTransaction"||!this.undoManager.isPendingUnmodified||setTimeout(function(){y.isModified=!1},1);var tt=a.isTransactionFinished;if(tt&&(nm(this),this.As.clear(),Hp(this.animationManager)),!this.Rt&&tt&&this.lastInput.targetDiagram){this.Rt=!0;var rt=this;Di(function(){rt.currentTool.standardMouseOver(),rt.Rt=!1},10)}}}finally{this.aa=!0}}}};function Wd(a,y){y=y.O.s;for(var x=y.length,E=0;E<x;E++)ld(a,y[E])}function ld(a,y){if(y instanceof Os){var x=y.element;if(x!==null&&x instanceof HTMLImageElement){x.Bg instanceof gn&&x.Bg.add(a);var E=y.Eg;if(E!==null&&E.sq===!0&&y.diagram!==null&&y.diagram.Xn.add(y),x.hn)if(x=x.getAttribute("src")||"",E=a.Og.I(x),E===null)E=[],E.push(y),a.Og.add(x,E);else{for(a=0;a<E.length;a++)if(E[a]===y)return;E.push(y)}}}}function Og(a,y){if(y instanceof Os){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 gn&&x.Bg.remove(a),Rf(E));break}}}}}be.prototype.Wd=function(){this.partManager.Wd()},be.prototype.Aj=function(a,y){this.Yd.Aj(a,y)},be.prototype.Cj=function(a,y){this.Yd.Cj(a,y)},be.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)},be.prototype.Vb=function(a){return this.partManager.Vb(a)},be.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)},wt=be.prototype,wt.Lc=function(a){return this.partManager.Lc(a)},wt.ii=function(a){return this.partManager.ii(a)},wt.Kc=function(a){return this.partManager.Kc(a)},wt.ms=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];return this.partManager.ms.apply(this.partManager,y instanceof Array?y:Ln(Zn(y)))},wt.ls=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];return this.partManager.ls.apply(this.partManager,y instanceof Array?y:Ln(Zn(y)))};function ku(a){var y=a.pa,x=a.Ca;a.Rw.h(y.x,y.y,Math.max(a.Aa,0)/x,Math.max(a.ya,0)/x),a.vd=!0}function Ig(a,y){a.Zi=!1;var x=a.Sp;x.D(y)||(x=x.copy(),a.Sp.assign(y),Il(a,!1),a.R("DocumentBoundsChanged",void 0,x),a.Ee=!0,a.N())}wt.Va=function(){if(this.Zi){var a=Te.alloc();Ig(this,this.computeBounds(a)),Te.free(a)}},wt.rz=function(){for(var a=new gn,y=this.nodes;y.next();){var x=y.value;x.isTopLevel&&a.add(x)}for(y=this.links;y.next();)x=y.value,x.isTopLevel&&a.add(x);return a.iterator},wt.qz=function(){return this.ai.iterator},wt.Uz=function(a){ts(this),a&&xf(this,!0),this.ld?_g(this,!1):(this.Jk=!0,xl(this))};function xf(a,y){for(var x=a.ai.iterator;x.next();)im(a,x.value,y);a.layout&&(y?a.layout.isValidLayout=!1:a.layout.C())}function im(a,y,x){if(y!==null){for(var E=y.gl.iterator;E.next();)im(a,E.value,x);y.layout!==null&&(x?y.layout.isValidLayout=!1:y.layout.C())}}function _g(a,y){if(a.xh&&!a.lt){var x=a.aa;a.aa=!0;var E=a.undoManager.transactionLevel,b=a.layout,z=a.animationManager;try{E===0&&(a.undoManager.isInternalTransaction=!0,a.Ea("Layout")),1>=E&&!z.defaultAnimation.isAnimating&&!z.zb&&(y||ju(z,"Layout")),a.xh=!1;for(var tt=a.ai.iterator;tt.next();)Rg(a,tt.value,y,E);b.isValidLayout||(!y||b.isRealtime||b.isRealtime===null||E===0?(b.doLayout(a),ts(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||hf(z),a.aa=x}}}function Rg(a,y,x,E){if(y!==null){for(var b=y.gl.iterator;b.next();)Rg(a,b.value,x,E);b=y.layout,b===null||b.isValidLayout||(!x||b.isRealtime||E===0?(y.rh=!y.location.w(),b.doLayout(y),y.C(32),kc(a,y),b.isValidLayout=!0):a.xh=!0)}}wt.yz=function(){for(var a=new cn,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 cn;x.add(b,tt),x.add(z,tt),E.add(b,b),E.add(z,b)}var x=new Be,E=new Be;y("InitialAnimationStarting"),y("AnimationStarting"),y("AnimationFinished"),y("BackgroundSingleClicked"),y("BackgroundDoubleClicked"),y("BackgroundContextClicked"),y("ClipboardChanged"),y("ClipboardPasted"),y("DocumentBoundsChanged"),y("ExternalObjectsDropped"),y("GainedFocus"),y("InitialLayoutCompleted"),y("LayoutCompleted"),y("LinkDrawn"),y("LinkRelinked"),y("LinkReshaped"),y("LostFocus"),y("Modified"),y("ObjectSingleClicked"),y("ObjectDoubleClicked"),y("ObjectContextClicked"),y("PartCreated"),y("PartResized"),y("PartRotated"),y("SelectionMoved"),y("SelectionCopied"),y("SelectionDeleting"),y("SelectionDeleted"),y("SelectionGrouped"),y("SelectionUngrouped"),y("ChangingSelection"),y("ChangedSelection"),y("SubGraphCollapsed"),y("SubGraphExpanded"),y("TextEdited"),y("TreeCollapsed"),y("TreeExpanded"),y("ViewportBoundsChanged"),y("InvalidateDraw"),a.iw=x,a.hw=E}function rm(a,y){var x=a.hw.I(y);return x!==null?x:a.hw.I(y.toLowerCase())}function Pf(a,y){var x=a.iw.I(y);if(x!==null||(x=a.iw.I(y.toLowerCase()),x!==null))return x;Gt("Unknown DiagramEvent name: "+y)}wt.Bj=function(a,y){return a=Pf(this,a),a!==null&&a.add(y),this},wt.am=function(a,y){a=Pf(this,a),a!==null&&a.remove(y)},wt.R=function(a,y,x){var E=Pf(this,a),b=new Br;if(b.diagram=this,a=rm(this,a),a!==null&&(b.name=a),y!==void 0&&(b.subject=y),x!==void 0&&(b.parameter=x),y=E.length,y===1)E.M(0)(b);else if(y!==0)for(E=E.Fa(),x=0;x<y;x++)(0,E[x])(b)};function wf(a){if(a.animationManager.isTicking)return!1;var y=a.currentTool;return y===a.toolManager.findTool("Dragging")?!a.Mr||y.isComplexRoutingRealtime:!0}wt.Yj=function(a,y){return Cf(this,!1,null,y||null).Yj(a.x,a.y,a.width,a.height)},be.prototype.computeOccupiedArea=function(a){return this.isVirtualized?this.viewportBounds.copy():this.Zi?Cg(this,a):a.assign(this.documentBounds)};function Cf(a,y,x,E){var b=a.Xh;if(b===null&&(a.Xh=b=new fp(a.avoidanceCellSize)),b.vs||b.group!==x||b.Yx!==E){if(b.Hx=Math.max(b.Os+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.width)),b.Ix=Math.max(b.Os+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.height)),x!==null&&(x=om(a,x)),x===null){y=Te.alloc(),a.computeOccupiedArea(y),y.Bc(100,100),b.initialize(y);for(var z=a.nodes;z.next();){var tt=z.value,rt=tt.layer;rt!==null&&rt.visible&&!rt.isTemporary&&Ef(a,tt,E,y)}Te.free(y)}else{for(0<x.memberParts.count&&(y=a.computePartsBounds(x.memberParts,!1),y.Bc(20,20),b.initialize(y)),y=Te.alloc(),z=x.memberParts;z.next();)tt=z.value,tt instanceof qn&&Ef(a,tt,E,y);Te.free(y)}b.group=x,b.Yx=E,b.vs=!1}else y&&rS(b);return b}function om(a,y){return y.avoidable&&!y.isLinkLabel?y:y.containingGroup!==null?om(a,y.containingGroup):null}function Ef(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(Wf(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(jh,x,y+1);else for(var tt=x;tt<=y;tt++)z[tt]=jh}else if(y instanceof rr)for(y=y.memberParts;y.next();)b=y.value,b instanceof qn&&Ef(a,b,x,E)}}function kh(a,y){a.Xh===null||a.Xh.vs||y!==void 0&&(!y.avoidable||y.isLinkLabel)||(a.Xh.vs=!0)}be.prototype.gs=function(a){this.wp.assign(a),this.computeAutoScrollPosition(this.wp).Xa(this.position)?this.ug():jg(this)};function jg(a){a.vk===-1&&(a.vk=Di(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=Te.alloc(),a.computeBounds(y),y.ed(a.documentBounds),Ig(a,y),Te.free(y),a.Fc=!0,a.bd(),jg(a))}},a.vp))}be.prototype.ug=function(){this.vk!==-1&&(qe.clearTimeout(this.vk),this.vk=-1)},be.prototype.computeAutoScrollPosition=function(a){var y=this.position,x=this.xp;if(0>=x.top&&0>=x.left&&0>=x.right&&0>=x.bottom)return y;var E=this.viewportBounds,b=this.scale;E=Te.allocAt(0,0,E.width*b,E.height*b);var z=At.allocAt(0,0);if(a.x>=E.x&&a.x<E.x+x.left&&this.allowHorizontalScroll){var tt=Math.max(this.scrollHorizontalLineChange,1);tt|=0,z.x-=tt,a.x<E.x+x.left/2&&(z.x-=tt),a.x<E.x+x.left/4&&(z.x-=4*tt)}else a.x<=E.x+E.width&&a.x>E.x+E.width-x.right&&this.allowHorizontalScroll&&(tt=Math.max(this.scrollHorizontalLineChange,1),tt|=0,z.x+=tt,a.x>E.x+E.width-x.right/2&&(z.x+=tt),a.x>E.x+E.width-x.right/4&&(z.x+=4*tt));return a.y>=E.y&&a.y<E.y+x.top&&this.allowVerticalScroll?(tt=Math.max(this.scrollVerticalLineChange,1),tt|=0,z.y-=tt,a.y<E.y+x.top/2&&(z.y-=tt),a.y<E.y+x.top/4&&(z.y-=4*tt)):a.y<=E.y+E.height&&a.y>E.y+E.height-x.bottom&&this.allowVerticalScroll&&(tt=Math.max(this.scrollVerticalLineChange,1),tt|=0,z.y+=tt,a.y>E.y+E.height-x.bottom/2&&(z.y+=tt),a.y>E.y+E.height-x.bottom/4&&(z.y+=4*tt)),z.Xa(jn)||(y=new At(y.x+z.x/b,y.y+z.y/b)),Te.free(E),At.free(z),y},wt=be.prototype,wt.Cs=function(){return null},wt.av=function(){return null},wt.bs=function(a,y){this.pj.add(a,y)},wt.Fu=function(a){(this.Pw=a)||this.nodes.each(function(y){y instanceof rr&&(y.$p=null)})};function bc(a,y,x){function E(){var ut=+new Date;for(z=!0,tt.reset();tt.next();)if(!tt.value[0].al){z=!1;break}z||ut-lt>ot?y(x,b,rt):qe.requestAnimationFrame(E)}for(var b=x.callback,z=!0,tt=a.Og.iterator;tt.next();)if(!tt.value[0].al){z=!1;break}if(typeof b!="function"||z)return y(x,b,a);var rt=a,ot=x.callbackTimeout||300,lt=+new Date;return qe.requestAnimationFrame(function(){E()}),null}wt.Wz=function(a){return Qo?(a===void 0&&(a={}),a.returnType="Image",this.Jx(a)):null},wt.Jx=function(a){return a===void 0&&(a={}),bc(this,this.Xz,a)},wt.Xz=function(a,y,x){var E=am(x,a,"canvas",null);if(E===null)return null;x=E.Z.canvas;var b=null;if(x!==null)switch(b=a.returnType,b===void 0?b="string":b=b.toLowerCase(),b){case Ud+"data":b=E.getImageData(0,0,x.width,x.height);break;case Ud:E=(a.document||document).createElement("img"),E.src=x.toDataURL(a.type,a.details),b=E;break;case"blob":return typeof y!="function"&&Gt('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.'),typeof x.toBlob=="function"?(x.toBlob(y,a.type,a.details),"toBlob"):(y(null),null);default:b=x.toDataURL(a.type,a.details)}return typeof y=="function"?(y(b),null):b};function am(a,y,x,E){if(a.animationManager.Cc(),a.bd(),a.ta===null)return null;typeof y!="object"&&Gt("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 nn(1/0,1/0):new nn(2e3,2e3));var rt=y.position||null,ot=y.parts||null,lt=y.padding===void 0?1:y.padding,ut=y.background||null,ft=y.omitTemporary;ft===void 0&&(ft=!0);var yt=y.document||document,xt=y.elementFinished||null,Ct=y.showTemporary;Ct===void 0&&(Ct=!ft),y=y.showGrid,y===void 0&&(y=Ct),b!==null&&isNaN(b.width)&&isNaN(b.height)&&(b=null),typeof lt=="number"?lt=new or(lt):lt instanceof or||Gt("MakeImage padding must be a Margin or a number."),lt.left=Math.max(lt.left,0),lt.right=Math.max(lt.right,0),lt.top=Math.max(lt.top,0),lt.bottom=Math.max(lt.bottom,0),a.ib.Vc(!0),ft=new Rl(null,yt,void 0,!0);var bt=ft.context;if(!(b||z||ot||rt))return ft.width=a.Aa+Math.ceil(lt.left+lt.right),ft.height=a.ya+Math.ceil(lt.top+lt.bottom),x==="SVG"?E===null?null:(E.resize(ft.width,ft.height,ft.width,ft.height),E.ownerDocument=yt,E.hs=xt,mf(a,E.context,lt,new nn(ft.width,ft.height),a.Ca,a.pa,ot,ut,Ct,y),E.context):(a.Xm=!1,mf(a,bt,lt,new nn(ft.width,ft.height),a.Ca,a.pa,ot,ut,Ct,y),a.Xm=!0,ft.context);var Vt=a.Pp,zt=a.documentBounds.copy();if(zt.Fv(a.yb),Ct)for(var $t=a.Wa.s,ie=$t.length,oe=0;oe<ie;oe++){var de=$t[oe];if(de.visible&&de.isTemporary){de=de.Pa.s;for(var ke=de.length,Hn=0;Hn<ke;Hn++){var ci=de[Hn];ci.isInDocumentBounds&&ci.isVisible()&&(ci=ci.actualBounds,ci.w()&&zt.ed(ci))}}}if($t=new At(zt.x,zt.y),ot!==null){for(ie=new Te(0,0,0,0),oe=!0,de=ot.iterator,de.reset();de.next();)ke=de.value,ke instanceof Ai&&(Hn=ke.layer,Hn!==null&&!Hn.visible||Hn!==null&&!Ct&&Hn.isTemporary||!ke.isVisible()||(ke=ke.actualBounds,ke.w()&&(oe?(oe=!1,ie.assign(ke)):ie.ed(ke))));zt.width=ie.width,zt.height=ie.height,$t.x=ie.x,$t.y=ie.y}return rt!==null&&rt.w()&&($t=rt,z||(z=Vt)),ie=rt=0,lt!==null&&(rt=lt.left+lt.right,ie=lt.top+lt.bottom),oe=de=0,b!==null&&(de=b.width,oe=b.height,isFinite(de)&&(de=Math.max(0,de-rt)),isFinite(oe)&&(oe=Math.max(0,oe-ie))),b!==null&&z!==null?(z==="NaN"&&(z=Vt),b.w()?(b=de,zt=oe):isNaN(oe)?(b=de,zt=zt.height*z):(b=zt.width*z,zt=oe)):b!==null?b.w()?(z=Math.min(de/zt.width,oe/zt.height),b=de,zt=oe):isNaN(oe)?(z=de/zt.width,b=de,zt=zt.height*z):(z=oe/zt.height,b=zt.width*z,zt=oe):z!==null?z==="NaN"&&tt.w()?(z=Math.min((tt.width-rt)/zt.width,(tt.height-ie)/zt.height),z>Vt?(z=Vt,b=zt.width,zt=zt.height):(b=tt.width,zt=tt.height)):(b=zt.width*z,zt=zt.height*z):(z=Vt,b=zt.width,zt=zt.height),lt!==null?(b+=rt,zt+=ie):lt=new or(0),tt!==null&&(Vt=tt.width,tt=tt.height,isNaN(Vt)&&(Vt=2e3),isNaN(tt)&&(tt=2e3),isFinite(Vt)&&(b=Math.min(b,Vt)),isFinite(tt)&&(zt=Math.min(zt,tt))),ft.width=Math.ceil(b),ft.height=Math.ceil(zt),x==="SVG"?E===null?null:(E.resize(ft.width,ft.height,ft.width,ft.height),E.ownerDocument=yt,E.hs=xt,mf(a,E.context,lt,new nn(Math.ceil(b),Math.ceil(zt)),z,$t,ot,ut,Ct,y),E.context):(a.Xm=!1,mf(a,bt,lt,new nn(Math.ceil(b),Math.ceil(zt)),z,$t,ot,ut,Ct,y),a.Xm=!0,ft.context)}Se.Object.defineProperties(be.prototype,{renderer:{get:function(){return this.nl},set:function(a){this instanceof mt||(a===""&&(a="default"),a=a.toLowerCase(),a!==this.nl&&(this.nl=a,a==="default"||a==="canvas"?(a=this.pj.get("svg"),a!==null&&a.Oa.remove(),this.ta&&(this.ib=this.ta.context)):a==="svg"?(this.pj.contains("svg")?a=this.pj.get("svg"):(a=new bu(this,qe.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 bu(this,qe.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(qe,"resize",this.Ov,!1),this.removeEventListener(qe,"wheel",this.$j,!0),zu===this&&(zu=null)):this.ui===null&&(this.hf=!1),this.Ka=null,a!==null&&((y=a.H)&&(y.div=null),Pg(this,a),this.hk())}}},$w:{get:function(){return this.Sq}},pi:{get:function(){return this.hf}},draggedLink:{get:function(){return this.nt},set:function(a){this.nt!==a&&(this.nt=a,a!==null&&(this.Vt=a.fromPort,this.Wt=a.toPort))}},Mx:{get:function(){return this.Vt},set:function(a){this.Vt=a}},Nx:{get:function(){return this.Wt},set:function(a){this.Wt=a}},animationManager:{get:function(){return this.Yd}},undoManager:{get:function(){return this.cc.undoManager}},skipsUndoManager:{get:function(){return this.Wg},set:function(a){this.Wg=a,this.cc.skipsUndoManager=a}},delaysLayout:{get:function(){return this.lt},set:function(a){this.lt=a}},opacity:{get:function(){return this.pb},set:function(a){var y=this.pb;y!==a&&((0>a||1<a)&&En(a,"0 <= value <= 1",be,"opacity"),this.pb=a,this.g("opacity",y,a),this.N())}},validCycle:{get:function(){return this.wu},set:function(a){var y=this.wu;y!==a&&(this.wu=a,this.g("validCycle",y,a))}},layers:{get:function(){return this.Wa.iterator}},isModelReadOnly:{get:function(){var a=this.cc;return a===null?!1:a.isReadOnly},set:function(a){var y=this.cc;y!==null&&(y.isReadOnly=a)}},isReadOnly:{get:function(){return this.Gg},set:function(a){var y=this.Gg;y!==a&&(this.Gg=a,this.g("isReadOnly",y,a))}},isEnabled:{get:function(){return this.Jd},set:function(a){var y=this.Jd;y!==a&&(this.Jd=a,this.g("isEnabled",y,a))}},allowClipboard:{get:function(){return this.Us},set:function(a){var y=this.Us;y!==a&&(this.Us=a,this.g("allowClipboard",y,a))}},allowCopy:{get:function(){return this.Fi},set:function(a){var y=this.Fi;y!==a&&(this.Fi=a,this.g("allowCopy",y,a))}},allowDelete:{get:function(){return this.Gi},set:function(a){var y=this.Gi;y!==a&&(this.Gi=a,this.g("allowDelete",y,a))}},allowDragOut:{get:function(){return this.Vs},set:function(a){var y=this.Vs;y!==a&&(this.Vs=a,this.g("allowDragOut",y,a))}},allowDrop:{get:function(){return this.Ws},set:function(a){var y=this.Ws;y!==a&&(this.Ws=a,this.g("allowDrop",y,a))}},allowTextEdit:{get:function(){return this.Pi},set:function(a){var y=this.Pi;y!==a&&(this.Pi=a,this.g("allowTextEdit",y,a))}},allowGroup:{get:function(){return this.Hi},set:function(a){var y=this.Hi;y!==a&&(this.Hi=a,this.g("allowGroup",y,a))}},allowUngroup:{get:function(){return this.Qi},set:function(a){var y=this.Qi;y!==a&&(this.Qi=a,this.g("allowUngroup",y,a))}},allowInsert:{get:function(){return this.Ys},set:function(a){var y=this.Ys;y!==a&&(this.Ys=a,this.g("allowInsert",y,a))}},allowLink:{get:function(){return this.Ii},set:function(a){var y=this.Ii;y!==a&&(this.Ii=a,this.g("allowLink",y,a))}},allowRelink:{get:function(){return this.Ki},set:function(a){var y=this.Ki;y!==a&&(this.Ki=a,this.g("allowRelink",y,a))}},allowMove:{get:function(){return this.Ji},set:function(a){var y=this.Ji;y!==a&&(this.Ji=a,this.g("allowMove",y,a))}},allowReshape:{get:function(){return this.Li},set:function(a){var y=this.Li;y!==a&&(this.Li=a,this.g("allowReshape",y,a))}},allowResize:{get:function(){return this.Mi},set:function(a){var y=this.Mi;y!==a&&(this.Mi=a,this.g("allowResize",y,a))}},allowRotate:{get:function(){return this.Ni},set:function(a){var y=this.Ni;y!==a&&(this.Ni=a,this.g("allowRotate",y,a))}},allowSelect:{get:function(){return this.Oi},set:function(a){var y=this.Oi;y!==a&&(this.Oi=a,this.g("allowSelect",y,a))}},allowUndo:{get:function(){return this.Zs},set:function(a){var y=this.Zs;y!==a&&(this.Zs=a,this.g("allowUndo",y,a))}},allowZoom:{get:function(){return this.at},set:function(a){var y=this.at;y!==a&&(this.at=a,this.g("allowZoom",y,a))}},hasVerticalScrollbar:{get:function(){return this.nn},set:function(a){var y=this.nn;y!==a&&(this.nn=a,this.Ee=!0,this.N(),this.g("hasVerticalScrollbar",y,a),Il(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),Il(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),Il(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),Il(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(a){var y=this.iu;y!==a&&(0>a&&En(a,">= 0",be,"scrollHorizontalLineChange"),this.iu=a,this.g("scrollHorizontalLineChange",y,a))}},scrollVerticalLineChange:{get:function(){return this.mu},set:function(a){var y=this.mu;y!==a&&(0>a&&En(a,">= 0",be,"scrollVerticalLineChange"),this.mu=a,this.g("scrollVerticalLineChange",y,a))}},lastInput:{get:function(){return this.cj},set:function(a){this.cj=a}},previousInput:{get:function(){return this.Qg},set:function(a){this.Qg=a}},firstInput:{get:function(){return this.bq},set:function(a){this.bq=a}},currentCursor:{get:function(){return this.it},set:function(a){if(a===""&&(a=this.Op),this.it!==a){var y=this.ta,x=this.Ka;if(y!==null&&x!==null){this.it=a;var E=y.style.cursor;y.style.cursor=a,x.style.cursor=a,y.style.cursor===E&&(y.style.cursor="-webkit-"+a,x.style.cursor="-webkit-"+a,y.style.cursor===E&&(y.style.cursor="-moz-"+a,x.style.cursor="-moz-"+a,y.style.cursor===E&&(y.style.cursor=a,x.style.cursor=a)))}}}},defaultCursor:{get:function(){return this.Op},set:function(a){a===""&&(a="auto");var y=this.Op;y!==a&&(this.Op=a,this.g("defaultCursor",y,a))}},click:{get:function(){return this.zh},set:function(a){var y=this.zh;y!==a&&(this.zh=a,this.g("click",y,a))}},doubleClick:{get:function(){return this.Fh},set:function(a){var y=this.Fh;y!==a&&(this.Fh=a,this.g("doubleClick",y,a))}},contextClick:{get:function(){return this.Bh},set:function(a){var y=this.Bh;y!==a&&(this.Bh=a,this.g("contextClick",y,a))}},mouseOver:{get:function(){return this.Qh},set:function(a){var y=this.Qh;y!==a&&(this.Qh=a,this.g("mouseOver",y,a))}},mouseHover:{get:function(){return this.Oh},set:function(a){var y=this.Oh;y!==a&&(this.Oh=a,this.g("mouseHover",y,a))}},mouseHold:{get:function(){return this.Nh},set:function(a){var y=this.Nh;y!==a&&(this.Nh=a,this.g("mouseHold",y,a))}},mouseDragOver:{get:function(){return this.Qt},set:function(a){var y=this.Qt;y!==a&&(this.Qt=a,this.g("mouseDragOver",y,a))}},mouseDrop:{get:function(){return this.Lh},set:function(a){var y=this.Lh;y!==a&&(this.Lh=a,this.g("mouseDrop",y,a))}},handlesDragDropForTopLevelParts:{get:function(){return this.xt},set:function(a){var y=this.xt;y!==a&&(this.xt=a,this.g("handlesDragDropForTopLevelParts",y,a))}},mouseEnter:{get:function(){return this.Mh},set:function(a){var y=this.Mh;y!==a&&(this.Mh=a,this.g("mouseEnter",y,a))}},mouseLeave:{get:function(){return this.Ph},set:function(a){var y=this.Ph;y!==a&&(this.Ph=a,this.g("mouseLeave",y,a))}},toolTip:{get:function(){return this.$h},set:function(a){var y=this.$h;y!==a&&(this.$h=a,this.g("toolTip",y,a))}},contextMenu:{get:function(){return this.Ch},set:function(a){var y=this.Ch;y!==a&&(this.Ch=a,this.g("contextMenu",y,a))}},commandHandler:{get:function(){return this.nb},set:function(a){this.nb!==a&&(this.nb=a,a.Xe(this))}},toolManager:{get:function(){return this.te},set:function(a){this.te!==a&&(this.te=a,a.diagram=this)}},defaultTool:{get:function(){return this.ob},set:function(a){var y=this.ob;y!==a&&(this.ob=a,a.diagram=this,this.currentTool===y&&(this.currentTool=a))}},currentTool:{get:function(){return this.hb},set:function(a){var y=this.hb;y&&(y.isActive&&y.doDeactivate(),y.cancelWaitAfter(),y.doStop()),a===null&&(a=this.defaultTool),a!==null&&(this.hb=a,a.diagram=this,a.doStart())}},selection:{get:function(){return this.Hw}},maxSelectionCount:{get:function(){return this.Nt},set:function(a){var y=this.Nt;if(y!==a)if(0<=a&&!isNaN(a)){if(this.Nt=a,this.g("maxSelectionCount",y,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0<a)){this.R("ChangingSelection",this.selection),y=this.selection.Fa();for(var x=0;x<a;x++)y[x].isSelected=!1;this.R("ChangedSelection",this.selection)}}else En(a,">= 0",be,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.St},set:function(a){var y=this.St;y!==a&&(this.St=a,this.g("nodeSelectionAdornmentTemplate",y,a))}},groupSelectionAdornmentTemplate:{get:function(){return this.wt},set:function(a){var y=this.wt;y!==a&&(this.wt=a,this.g("groupSelectionAdornmentTemplate",y,a))}},linkSelectionAdornmentTemplate:{get:function(){return this.Kt},set:function(a){var y=this.Kt;y!==a&&(this.Kt=a,this.g("linkSelectionAdornmentTemplate",y,a))}},highlighteds:{get:function(){return this.nw}},isModified:{get:function(){var a=this.undoManager;return a.isEnabled?a.currentTransaction!==null?!0:this.rn&&this.Ce!==a.historyIndex:this.rn},set:function(a){if(this.rn!==a){this.rn=a;var y=this.undoManager;!a&&y.isEnabled&&(this.Ce=y.historyIndex),a||nm(this)}}},model:{get:function(){return this.cc},set:function(a){var y=this.cc;if(y!==a){this.currentTool.doCancel(),y&&y.undoManager!==a.undoManager&&y.undoManager.isInTransaction&&Gt("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var x=xg(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var E=this.vb;this.vb=!0,ju(this.animationManager,"Model"),y&&(this.pf!==null&&this.pf.each(function(z){return y.ik(z)}),y.ik(this.Oc)),this.cc=a,this.partManager=Dg(this.cc.type);for(var b=0;b<x.length;b++)this.add(x[b]);a.Pe(this.Hb),this.partManager.addAllModeledParts(),a.ik(this.Hb),a.Pe(this.Oc),this.pf!==null&&this.pf.each(function(z){return a.Pe(z)}),this.vb=E,this.Ya(),this.vb||this.N(),y&&a.undoManager.copyProperties(y.undoManager)}}},aa:{get:function(){return this.rw},set:function(a){this.rw=a}},As:{get:function(){return this.sy}},skipsModelSourceBindings:{get:function(){return this.Iw},set:function(a){this.Iw=a}},Ns:{get:function(){return this.ou},set:function(a){this.ou=a}},nodeTemplate:{get:function(){return this.Lg.I("")},set:function(a){var y=this.Lg.I("");y!==a&&(this.Lg.add("",a),this.g("nodeTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},nodeTemplateMap:{get:function(){return this.Lg},set:function(a){var y=this.Lg;y!==a&&(this.Lg=a,this.g("nodeTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplate:{get:function(){return this.Yi.I("")},set:function(a){var y=this.Yi.I("");y!==a&&(this.Yi.add("",a),this.g("groupTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplateMap:{get:function(){return this.Yi},set:function(a){var y=this.Yi;y!==a&&(this.Yi=a,this.g("groupTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplate:{get:function(){return this.Kh.I("")},set:function(a){var y=this.Kh.I("");y!==a&&(this.Kh.add("",a),this.g("linkTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplateMap:{get:function(){return this.Kh},set:function(a){var y=this.Kh;y!==a&&(this.Kh=a,this.g("linkTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},isMouseCaptured:{get:function(){return this.qw},set:function(a){var y=this.ta;y!==null&&(y=y.Oa,y instanceof SVGElement||(a?(this.lastInput.bubbles=!1,this.removeEventListener(y,"pointermove",this.dk,!1),this.removeEventListener(y,"pointerdown",this.ui,!1),this.removeEventListener(y,"pointerup",this.fk,!1),this.removeEventListener(y,"pointerout",this.ek,!1),this.removeEventListener(y,"pointercancel",this.ck,!1),this.addEventListener(qe,"pointermove",this.dk,!0),this.addEventListener(qe,"pointerdown",this.ui,!0),this.addEventListener(qe,"pointerup",this.fk,!0),this.addEventListener(qe,"pointerout",this.ek,!0),this.addEventListener(qe,"pointercancel",this.ck,!0),this.removeEventListener(y,"wheel",this.$j,!1),this.addEventListener(qe,"wheel",this.$j,!0),this.addEventListener(qe,"selectstart",this.preventDefault,!1)):(this.removeEventListener(qe,"pointermove",this.dk,!0),this.removeEventListener(qe,"pointerdown",this.ui,!0),this.removeEventListener(qe,"pointerup",this.fk,!0),this.removeEventListener(qe,"pointerout",this.ek,!0),this.removeEventListener(qe,"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(qe,"wheel",this.$j,!0),this.removeEventListener(qe,"selectstart",this.preventDefault,!1),this.addEventListener(y,"wheel",this.$j,!1)),this.qw=a))}},position:{get:function(){return this.pa},set:function(a){var y=At.alloc().assign(this.pa);if(!y.D(a)){var x=this.viewportBounds.copy();this.pa.assign(a),Wp(this.animationManager,y,this.pa),this.vb||this.ta===null&&!this.wo.w()?ku(this):(this.vb=!0,a=this.scale,Eg(this,this.Sp,this.Aa/a,this.ya/a,this.zk,!1),this.vb=!1),this.vb||this.onViewportBoundsChanged(x,this.viewportBounds,this.Ca,!1)}At.free(y)}},initialPosition:{get:function(){return this.zt},set:function(a){this.zt.D(a)||(this.zt=a.J())}},initialScale:{get:function(){return this.At},set:function(a){this.At!==a&&(this.At=a)}},grid:{get:function(){return this.fe===null&&(this.fe=$p(this)),this.fe},set:function(a){var y=this.fe;if(y!==a){y===null&&(y=this.fe=$p(this)),a.type!==Pn.Grid&&Gt("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),Mu(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),ku(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||Gt("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 or(a));var y=this.rj;y.D(a)||(this.rj=a=a.J(),this.g("scrollMargin",y,a),this.hk())}},scrollMode:{get:function(){return this.sj},set:function(a){var y=this.sj;y!==a&&(this.sj=a,a===bh&&Il(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,Il(this,!1),this.g("positionComputation",y,a))}},scaleComputation:{get:function(){return this.fu},set:function(a){var y=this.fu;y!==a&&(this.fu=a,Tg(this,this.scale,this.scale),this.g("scaleComputation",y,a))}},documentBounds:{get:function(){return this.Sp}},isVirtualized:{get:function(){return this.It},set:function(a){var y=this.It;y!==a&&(this.It=a,this.g("isVirtualized",y,a))}},scale:{get:function(){return this.Ca},set:function(a){var y=this.Ca;y!==a&&Tg(this,y,a)}},defaultScale:{get:function(){return this.Pp},set:function(a){this.Pp=a}},autoScale:{get:function(){return this.yh},set:function(a){var y=this.yh;y!==a&&(this.yh=a,this.g("autoScale",y,a),a!==hs&&Il(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()||Gt("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()||Gt("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)):En(a,"> 0",be,"minScale"))}},maxScale:{get:function(){return this.Mt},set:function(a){var y=this.Mt;y!==a&&(0<a?(this.Mt=a,this.g("maxScale",y,a),a<this.scale&&(this.scale=a)):En(a,"> 0",be,"maxScale"))}},zoomPoint:{get:function(){return this.zu},set:function(a){this.zu.D(a)||(this.zu=a=a.J())}},contentAlignment:{get:function(){return this.zk},set:function(a){var y=this.zk;y.D(a)||(this.zk=a=a.J(),this.g("contentAlignment",y,a),Il(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 or(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&&Gt("Cannot share PartManagers between Diagrams: "+a.toString()),y&&y.Xe(null),this.Pc=a,a.Xe(this))}},nodes:{get:function(){return this.partManager.nodes.iterator}},links:{get:function(){return this.partManager.links.iterator}},parts:{get:function(){return this.partManager.parts.iterator}},layout:{get:function(){return this.Sc},set:function(a){var y=this.Sc;y!==a&&(this.Sc=a,a.diagram=this,a.group=null,this.xh=!0,this.g("layout",y,a),this.$b())}},isTreePathToChildren:{get:function(){return this.Ht},set:function(a){var y=this.Ht;if(y!==a&&(this.Ht=a,this.g("isTreePathToChildren",y,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)ip(a.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(a){var y=this.uu;y!==a&&(a!==Nh&&a!==pa&&a!==Ff&&Gt("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 nn(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 or(a));var y=this.xp;y.D(a)||(this.xp=a=a.J(),this.Ya(),this.g("autoScrollRegion",y,a))}}}),Se.Object.defineProperties(be,{licenseKey:{get:function(){return Vg.jc()},set:function(a){Vg.add(a.replace(/\s/g,""))}},version:{get:function(){return Kd}}}),be.prototype.makeImageData=be.prototype.Jx,be.prototype.makeImage=be.prototype.Wz,be.prototype.cacheGroupExternalLinks=be.prototype.Fu,be.prototype.addRenderer=be.prototype.bs,be.prototype.makeSVG=be.prototype.av,be.prototype.makeSvg=be.prototype.Cs,be.prototype.stopAutoScroll=be.prototype.ug,be.prototype.doAutoScroll=be.prototype.gs,be.prototype.isUnoccupied=be.prototype.Yj,be.prototype.raiseDiagramEvent=be.prototype.R,be.prototype.removeDiagramListener=be.prototype.am,be.prototype.addDiagramListener=be.prototype.Bj,be.prototype.findTreeRoots=be.prototype.yz,be.prototype.layoutDiagram=be.prototype.Uz,be.prototype.findTopLevelGroups=be.prototype.qz,be.prototype.findTopLevelNodesAndLinks=be.prototype.rz,be.prototype.ensureBounds=be.prototype.Va,be.prototype.findLinksByExample=be.prototype.ls,be.prototype.findNodesByExample=be.prototype.ms,be.prototype.findLinkForData=be.prototype.Kc,be.prototype.findNodeForData=be.prototype.ii,be.prototype.findPartForData=be.prototype.Lc,be.prototype.findLinkForKey=be.prototype.findLinkForKey,be.prototype.findNodeForKey=be.prototype.Vb,be.prototype.findPartForKey=be.prototype.findPartForKey,be.prototype.rebuildParts=be.prototype.Wd,be.prototype.transformViewToDoc=be.prototype.Ps,be.prototype.transformRectDocToView=be.prototype.zA,be.prototype.transformDocToView=be.prototype.op,be.prototype.centerRect=be.prototype.es,be.prototype.scrollToRect=be.prototype.tv,be.prototype.scroll=be.prototype.scroll,be.prototype.highlightCollection=be.prototype.Jz,be.prototype.highlight=be.prototype.Iz,be.prototype.selectCollection=be.prototype.rA,be.prototype.select=be.prototype.select,be.prototype.updateAllRelationshipsFromData=be.prototype.rp,be.prototype.updateAllTargetBindings=be.prototype.updateAllTargetBindings,be.prototype.commit=be.prototype.commit,be.prototype.rollbackTransaction=be.prototype.Kf,be.prototype.commitTransaction=be.prototype.eb,be.prototype.startTransaction=be.prototype.Ea,be.prototype.raiseChanged=be.prototype.g,be.prototype.raiseChangedEvent=be.prototype.cb,be.prototype.removeChangedListener=be.prototype.ik,be.prototype.addChangedListener=be.prototype.Pe,be.prototype.removeModelChangedListener=be.prototype.mA,be.prototype.addModelChangedListener=be.prototype.Yw,be.prototype.findLayer=be.prototype.Qj,be.prototype.removeLayer=be.prototype.kA,be.prototype.addLayerAfter=be.prototype.Cy,be.prototype.addLayerBefore=be.prototype.Ww,be.prototype.addLayer=be.prototype.Al,be.prototype.moveParts=be.prototype.moveParts,be.prototype.copyParts=be.prototype.Kj,be.prototype.removeParts=be.prototype.Is,be.prototype.remove=be.prototype.remove,be.prototype.add=be.prototype.add,be.prototype.clearDelayedGeometries=be.prototype.bx,be.prototype.setProperties=be.prototype.nm,be.prototype.attach=be.prototype.Du,be.prototype.set=be.prototype.set,be.prototype.resetInputOptions=be.prototype.Sx,be.prototype.setInputOption=be.prototype.sA,be.prototype.getInputOption=be.prototype.Ql,be.prototype.resetRenderingHints=be.prototype.Tx,be.prototype.setRenderingHint=be.prototype.Xx,be.prototype.getRenderingHint=be.prototype.Gf,be.prototype.maybeUpdate=be.prototype.bd,be.prototype.requestUpdate=be.prototype.$b,be.prototype.delayInitialization=be.prototype.Xy,be.prototype.isUpdateRequested=be.prototype.Pz,be.prototype.invalidateDocumentBounds=be.prototype.Ya,be.prototype.findObjectsNear=be.prototype.og,be.prototype.findPartsNear=be.prototype.mz,be.prototype.findObjectsIn=be.prototype.Cf,be.prototype.findPartsIn=be.prototype.ux,be.prototype.findObjectsAt=be.prototype.ji,be.prototype.findPartsAt=be.prototype.lz,be.prototype.findObjectAt=be.prototype.ic,be.prototype.findPartAt=be.prototype.Ol,be.prototype.focusObject=be.prototype.zz,be.prototype.alignDocument=be.prototype.Jy,be.prototype.zoomToRect=be.prototype.BA,be.prototype.zoomToFit=be.prototype.zoomToFit,be.prototype.diagramScroll=be.prototype.kx,be.prototype.focus=be.prototype.focus;var Lf=new Be,sm=null,Qo=qe.document!==void 0,Vd=null,ud="",hs=new en(be,"None",0),sl=new en(be,"Uniform",1),hd=new en(be,"UniformToFill",2),Nc=new en(be,"CycleAll",10),zg=new en(be,"CycleNotDirected",11),Zg=new en(be,"CycleNotDirectedFast",12),Gg=new en(be,"CycleNotUndirected",13),Hg=new en(be,"CycleDestinationTree",14),Wg=new en(be,"CycleSourceTree",15),bh=new en(be,"DocumentScroll",1),Bc=new en(be,"InfiniteScroll",2),Nh=new en(be,"TreeParentCollapsed",21),pa=new en(be,"AllParentsCollapsed",22),Ff=new en(be,"AnyParentsCollapsed",23),Vg=new cn,Kd="2.3.10",Ud="image",Ac=null,lm=!1;function rs(){if(Qo){var a=qe.document.createElement("canvas"),y=a.getContext("2d"),x=Ve("7ca11abfd022028846");y[x]=Ve("398c3597c01238");for(var E=["5da73c80a36455d7038e4972187c3cae51fd22",Dn.Dx+"4ae6247590da4bb21c324ba3a84e385776",ae.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",_t.za],b=1;5>b;b++)y[Ve("7ca11abfd7330390")](Ve(E[b-1]),10,15*b);for(y[x]=Ve("39f046ebb36e4b"),x=1;5>x;x++)y[Ve("7ca11abfd7330390")](Ve(E[x-1]),10,15*x);(E.length!==4||E[0][0]!=="5"||E[3][0]!=="7")&&(ae.prototype.Cd=ae.prototype.Eu),Ac=a}}be.className="Diagram",be.fromDiv=function(a){var y=a;return typeof a=="string"&&(y=qe.document.getElementById(a)),y instanceof HTMLDivElement&&y.H instanceof be?y.H:null},be.inherit=function(a,y){function x(){}if(Object.getPrototypeOf(a).prototype)throw Error(`Used go.Diagram.inherit defining already defined class
`+a);x.prototype=y.prototype,a.prototype=new x,a.prototype.constructor=a},be.useDOM=function(a){Qo=a?qe.document!==void 0:!1},be.isUsingDOM=function(){return Qo},be.None=hs,be.Uniform=sl,be.UniformToFill=hd,be.CycleAll=Nc,be.CycleNotDirected=zg,be.CycleNotDirectedFast=Zg,be.CycleNotUndirected=Gg,be.CycleDestinationTree=Hg,be.CycleSourceTree=Wg,be.DocumentScroll=bh,be.InfiniteScroll=Bc,be.TreeParentCollapsed=Nh,be.AllParentsCollapsed=pa,be.AnyParentsCollapsed=Ff;function um(){this.wy=null,this.j="zz@orderNum",this._tk==="63ad05bbe23a1786468a4c741b6d2"?this.Rc=this.j=!0:this.Rc=null}function Yd(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=qe[Ve("76a715b2f73f148a")][Ve("72ba13b5")]||"";if(a.Rc=!0,Qo){var E=be[Ve("76a115b6ed251eaf4692")];if(E)for(var b=Vg.iterator;b.next()&&(E=b.value,E=Ve(E).split(Ve("39e9")),!(6>E.length));){var z=Ve(E[1]).split(".");if(E[4]!=="7da71ca0")break;var tt=Ve(Dn[Ve("6cae19")]).split(".");if(z[0]>tt[0]||z[0]===tt[0]&&z[1]>=tt[1]){var rt=qe[Ve("74a900bae4370f8b51")][Ve("6fbb13a1c2311e8a57")].toLowerCase();if(tt=rt[Ve("73a612b6fb191d")](Ve("3aad1ab6e022098b4dc4")),z=Ve(E[2]),-1<tt&&(rt=rt[Ve("73a612b6fb191d")](z.toLowerCase()+"/"),a.Rc=!(-1<rt&&rt<tt),!a.Rc))break;for(tt=x[Ve("76ad18b4f73e")],rt=x[Ve("73a612b6fb191d")](Ve("35e7"))+2;rt<tt;rt++)y+=x[rt];if(tt=y[Ve("73a612b6fb191d")](z),0>tt&&z!==Ve("7da71ca0ad381e90")&&(tt=y[Ve("73a612b6fb191d")](Ve("76a715b2ef3e149757"))),0>tt&&(tt=y[Ve("73a612b6fb191d")](Ve("76a715b2ef3e149757"))),0>tt&&(tt=y[Ve("73a612b6fb191d")](Ve("2bfa41fdb3784bca12"))),0>tt&&(tt=x[Ve("73a612b6fb191d")](Ve("7baa19a6f76c1988428554"))),a.Rc=!(0<=tt&&tt<y[Ve("73a612b6fb191d")](Ve("35"))||y[Ve("73a612b6fb191d")](Ve("35"))===-1),!a.Rc||x[Ve("73a612b6fb191d")](Ve("7fb002b6ed25128b4da25b2e"))&&(a.Rc=!(-1<x[Ve("73a612b6fb191d")](z)),!a.Rc)||(tt=qe[Ve("76a715b2f73f148a")][Ve("69ad17a1e03e")],rt=tt[Ve("73a612b6fb191d")](Ve("7fb002b6ed25128b4da25b2e")),-1<rt&&(a.Rc=!(tt[Ve("73a612b6fb191d")](z)>rt),!a.Rc)))break;if(z[0]==="#"){tt=qe.document.createElement("div");for(var ot=E[0].replace(/[A-Za-z]/g,"");4>ot.length;)ot+="9";if(rt=ot,ot=ot.substr(ot.length-4),E="",E+=["gsh","gsf"][parseInt(ot.substr(0,1),10)%2],E+=["Header","Background","Display","Feedback"][parseInt(ot.substr(0,1),10)%4],tt[Ve("79a417a0f0181a8946")]=E,qe.document[Ve("78a712aa")]){qe.document[Ve("78a712aa")][Ve("7bb806b6ed32388c4a875b")](tt),ot=qe.getComputedStyle(tt).getPropertyValue(Ve("78a704b7e62456904c9b12701b6532a8"));var lt=qe.getComputedStyle(tt).getPropertyValue(Ve("75b817b0ea2202"));if(qe.document[Ve("78a712aa")][Ve("68ad1bbcf533388c4a875b")](tt),ot){if(tt=qe[Ve("77a902b0eb1b1e804a8a")],lt==="0."+parseInt(rt,10)%100||ot.indexOf(parseInt(z[1]+z[2],16))!==-1&&ot.indexOf(parseInt(z[3]+z[4],16))!==-1){a.Rc=!1;break}else if(tt&&tt(Ve("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[Ve("76ad18b4f73e")],b=x[Ve("73a612b6fb191d")](Ve("35e7"))+2;b<ut;b++)y+=x[b];x=y[Ve("73a612b6fb191d")](Ve("7da71ca0ad381e90")),a.Rc=!(0<=x&&x<y[Ve("73a612b6fb191d")](Ve("35")))}}}return 0<a.Rc&&a!==a.wy}um.className="DiagramHelper";function lh(a){this.j=a===void 0?new At:a,this.o=new At}Se.Object.defineProperties(lh.prototype,{point:{get:function(){return this.j},set:function(a){this.j=a}},shifted:{get:function(){return this.o},set:function(a){this.o=a}}});var Tc="DraggingInfo";lh.className="DraggingInfo";function it(a,y,x){this.node=a,this.info=y,this.Su=x}it.className="DraggingNodeInfoPair";function at(){this.reset()}at.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new nn(NaN,NaN).freeze(),this.gridSnapCellSpot=jr,this.gridSnapOrigin=new At(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},at.className="DraggingOptions";function ct(a,y){if(typeof a=="string"||qe.Element&&a instanceof Element)var x=be.call(this,a)||this;else x=be.call(this)||this,y=a;return dt(x),y&&x.nm(y),x}Le(ct,be);function dt(a){a.allowDragOut=!0,a.allowMove=!1,a.isReadOnly=!0,a.contentAlignment=qr,a.layout=new Va}ct.prototype.reset=function(){be.prototype.reset.call(this),dt(this)},ct.className="Palette";function mt(a,y){if(typeof a=="string"||qe.Element&&a instanceof Element)var x=be.call(this,a)||this;else x=be.call(this)||this,y=a;var E=x;x.animationManager.isEnabled=!1,x.vb=!0,x.V=null,x.mn=!1,x.nn=!1,x.F=!0,x.u=!0,x.ia=0,x.o=!1,x.ql=null,x.Xx("drawShadows",!1),a=new Ai;var b=new fr;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 or(0,0,0,0),x.pa.h(0,0),x.toolManager.gb("Dragging",new Kt,x.toolManager.mouseMoveTools),x.click=function(){var z=E.observed;if(z!==null){var tt=z.viewportBounds,rt=E.lastInput.documentPoint;z.position=new At(rt.x-tt.width/2,rt.y-tt.height/2)}},x.Pf=function(){E.Ya(),Ot(E)},x.Xd=function(){E.observed!==null&&(E.Ya(),E.N())},x.Ha=function(){1>E.updateDelay?E.N():E.o||(E.o=!0,setTimeout(function(){return E.redraw()},E.updateDelay))},x.Of=function(){E.observed!==null&&Ot(E)},x.autoScale=sl,x.vb=!1,y&&Object.assign(x,y),x}Le(mt,be),mt.prototype.computePixelRatio=function(){return 1},mt.prototype.redraw=function(){if(this.o&&1<=this.updateDelay){this.o=!1;var a=this.ta,y=this.ib;if(a!==null&&y!==null){if(Gd(this),this.ql===null){var x=new Rl(null);x.width=a.width,x.height=a.height,this.ql=x}try{this.ta=this.ql,this.ib=this.ta.context,this.ib.Vc(!0),this.ib.setTransform(1,0,0,1,0,0),this.ib.clearRect(0,0,this.ta.width,this.ta.height),Ft(this)}finally{this.ta=a,this.ib=y}}}be.prototype.redraw.call(this)},mt.prototype.gc=function(){if(this.Ka===null&&Gt("No div specified"),this.ta===null&&Gt("No canvas specified"),!(this.ta instanceof bu)&&(Ov(this.box),this.Fc)){var a=this.observed;if(a!==null&&!a.animationManager.defaultAnimation.isAnimating&&a.pi){Gd(this);var y=this.ta;a=this.ib,a.Vc(!0),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,y.width,y.height),1>this.updateDelay?Ft(this):this.ql!==null&&(a.drawImage(this.ql.Oa,0,0),y=this.Ab,y.reset(),this.scale!==1&&y.scale(this.scale),this.position.x===0&&this.position.y===0||y.translate(-this.position.x,-this.position.y),a.scale(this.Mb,this.Mb),a.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),a.yc()),y=this.Wa.s;for(var x=y.length,E=0;E<x;E++)y[E].gc(a,this);this.Fc=this.vd=!1}}};function Ft(a){var y=a.observed;if(y!==null){var x=a.drawsTemporaryLayers,E=a.drawsGrid&&x,b=y.grid;E&&b!==null&&b.visible&&!isNaN(b.width)&&!isNaN(b.height)&&(b=Te.alloc().assign(a.viewportBounds).ed(y.viewportBounds),Mu(y,b),Te.free(b),ts(y));var z=a.Ab;z.reset(),a.scale!==1&&z.scale(a.scale),a.position.x===0&&a.position.y===0||z.translate(-a.position.x,-a.position.y),b=a.ib,b.scale(a.Mb,a.Mb),b.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),b.yc(),y=y.Wa.s,z=y.length;for(var tt=0;tt<z;tt++){var rt=y[tt],ot=a;if(rt.visible&&rt.opacity!==0){var lt=rt.diagram.grid.part;if(!x&&rt.isTemporary)E&&lt.layer===rt&&(rt=sh(rt,b),lt.gc(b,ot),b.globalAlpha=rt);else{for(var ut=sh(rt,b),ft=ot.scale,yt=Te.alloc(),xt=rt.Pa.s,Ct=xt.length,bt=0;bt<Ct;bt++){var Vt=xt[bt];(E||Vt!==lt)&&rt.Oj(b,Vt,ot,null,ft,yt,!1)}Te.free(yt),b.globalAlpha=ut}}}}}function Ot(a){var y=a.box;if(y!==null){var x=a.observed;if(x!==null){a.Fc=!0,x=x.viewportBounds;var E=y.selectionObject,b=nn.alloc();b.h(x.width,x.height),E.desiredSize=b,nn.free(b),a=2/a.scale,E instanceof fr&&(E.strokeWidth=a),y.location=new At(x.x-a/2,x.y-a/2),y.isSelected=!0}}}mt.prototype.computeBounds=function(){var a=this.observed;if(a===null)return ra;var y=a.documentBounds.copy();return y.ed(a.viewportBounds),y},mt.prototype.invalidateViewport=function(){this.Fc!==!0&&(this.Fc=!0,this.$b())},mt.prototype.onViewportBoundsChanged=function(a,y,x,E){this.vb||(this.vd=!0,this.N(),this.Ee=!0,this.Ya(),Ot(this),this.fc.scale=x,this.fc.position.x=a.x,this.fc.position.y=a.y,this.fc.bounds.assign(a),this.fc.Oz=E,this.R("ViewportBoundsChanged",this.fc,a))},Se.Object.defineProperties(mt.prototype,{observed:{get:function(){return this.V},set:function(a){var y=this.V;if(a instanceof mt&&Gt("Overview.observed Diagram may not be an Overview itself: "+a),y!==a){if(y!==null&&(this.remove(this.box),y.am("ViewportBoundsChanged",this.Pf),y.am("DocumentBoundsChanged",this.Xd),y.am("InvalidateDraw",this.Ha),y.am("AnimationFinished",this.Of)),this.V=a,a!==null&&(a.Bj("ViewportBoundsChanged",this.Pf),a.Bj("DocumentBoundsChanged",this.Xd),a.Bj("InvalidateDraw",this.Ha),a.Bj("AnimationFinished",this.Of),this.add(this.box)),this.Ya(),a===null){this.ql=null;var x=this.ta,E=this.ib;x&&E&&(E.setTransform(1,0,0,1,0,0),E.clearRect(0,0,x.width,x.height))}else this.Ha(null),Ot(this),this.N();this.g("observed",y,a)}}},box:{get:function(){return this.j},set:function(a){var y=this.j;y!==a&&(this.j=a,this.remove(y),this.add(this.j),Ot(this),this.g("box",y,a))}},drawsTemporaryLayers:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a,this.redraw())}},drawsGrid:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a,this.redraw())}},updateDelay:{get:function(){return this.ia},set:function(a){0>a&&(a=0),this.ia!==a&&(this.ia=a)}}}),mt.className="Overview";function Kt(){Oo.call(this),this.j=null}Le(Kt,Oo),Kt.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||!a.allowMove||!a.allowSelect)return!1;var y=a.observed;if(y===null)return!1;var x=a.lastInput;return!x.left||a.currentTool!==this&&(!this.isBeyondDragSize()||x.isTouchEvent&&x.timestamp-a.firstInput.timestamp<this.delay)?!1:(this.findDraggablePart()===null&&(x=y.viewportBounds,this.j=new At(x.width/2,x.height/2),a=a.firstInput.documentPoint,y.position=new At(a.x-this.j.x,a.y-this.j.y)),!0)},Kt.prototype.doActivate=function(){this.j=null,Oo.prototype.doActivate.call(this)},Kt.prototype.doUpdateCursor=function(){var a=this.diagram,y=a.box;y!==null&&y.cursor&&(a.currentCursor=y.cursor)},Kt.prototype.moveParts=function(){var a=this.diagram,y=a.observed;if(y!==null){var x=a.box;if(x!==null){if(this.j===null){var E=a.firstInput.documentPoint;x=x.location,this.j=new At(E.x-x.x,E.y-x.y)}a=a.lastInput.documentPoint,y.position=new At(a.x-this.j.x,a.y-this.j.y)}}},Kt.className="OverviewDraggingTool";function Wt(){Wi(this),this.H=zu,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=ra,this.hb=!0,this.cg=null,this.ob=200}Wt.prototype.toString=function(){return"CommandHandler"},Wt.prototype.Xe=function(a){this.H=a},Wt.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput,x=Mr?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()},Wt.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},Wt.prototype.stopCommand=function(){var a=this.diagram,y=a.currentTool;y instanceof Ar&&a.allowSelect&&a.clearSelection(),y!==null&&y.doCancel()},Wt.prototype.canStopCommand=function(){return!0},Wt.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=""}},Wt.prototype.canSelectAll=function(){return this.diagram.allowSelect},Wt.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 gn,x=a.selection.iterator;x.next();)gd(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=""}},Wt.prototype.canDeleteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowDelete||a.selection.count===0)},Wt.prototype.copySelection=function(){var a=this.diagram,y=new gn;for(a=a.selection.iterator;a.next();)gd(y,a.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,function(x){return x.canCopy()});this.copyToClipboard(y)},Wt.prototype.canCopySelection=function(){var a=this.diagram;return!!(a.allowCopy&&a.allowClipboard&&a.selection.count!==0)},Wt.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},Wt.prototype.canCutSelection=function(){var a=this.diagram;return!!(!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&a.selection.count!==0)},Wt.prototype.copyToClipboard=function(a){var y=this.diagram,x=null;if(a===null)Vd=null,ud="";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 cn,x.addAll(z),Vd=x,ud=y.model.dataFormat}}y.R("ClipboardChanged",x)},Wt.prototype.pasteFromClipboard=function(){var a=new gn,y=Vd;if(y===null)return a;var x=this.diagram;if(ud!==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},Wt.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);ad(y,z,new At(a.x-b.centerX,a.y-b.centerY),y.Wm,!1)}}y.R("ClipboardPasted",x)}finally{y.eb("Paste"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Wt.prototype.canPasteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||Vd===null||Vd.count===0||ud!==a.model.dataFormat)},Wt.prototype.undo=function(){this.diagram.undoManager.undo()},Wt.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()},Wt.prototype.redo=function(){this.diagram.undoManager.redo()},Wt.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()},Wt.prototype.decreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;y.autoScale===hs&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Wt.prototype.canDecreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;return y.autoScale!==hs?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Wt.prototype.increaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;y.autoScale===hs&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Wt.prototype.canIncreaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;return y.autoScale!==hs?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Wt.prototype.resetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;a<y.minScale||a>y.maxScale||(y.scale=a)},Wt.prototype.canResetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;return a<y.minScale||a>y.maxScale?!1:y.allowZoom},Wt.prototype.zoomToFit=function(){var a=this.diagram,y=a.animationManager;y.Cc(),a.redraw();var x=a.position,E=a.scale;ju(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=ra):(this.Jt=E,this.sw=x.copy(),a.zoomToFit(),this.Au=a.scale,this.yu=a.documentBounds.copy()),hf(y)},Wt.prototype.canZoomToFit=function(){return this.diagram.allowZoom},Wt.prototype.scrollToPart=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.Va(),a===null){try{this.cg!==null&&(this.cg.next()?a=this.cg.value:this.cg=null)}catch(ot){this.cg=null}a===null&&(0<y.highlighteds.count?this.cg=y.highlighteds.iterator:0<y.selection.count&&(this.cg=y.selection.iterator),this.cg!==null&&this.cg.next()&&(a=this.cg.value))}if(a!==null){var x=y.animationManager;ju(x,"Scroll To Part");var E=this.scrollToPartPause;if(0<E){var b=le(this,a,[a]);if(b.length===1)y.Ea(),y.es(a.actualBounds),y.eb("Scroll To Part");else{var z=function(){y.Ea();for(var ot=b.pop();0<b.length&&ot instanceof qn&&ot.isTreeExpanded&&(!(ot instanceof rr)||ot.isSubGraphExpanded);)ot=b.pop();0<b.length?(ot instanceof Ai&&y.tv(ot.actualBounds),ot instanceof qn&&!ot.isTreeExpanded&&(ot.isTreeExpanded=!0),ot instanceof rr&&!ot.isSubGraphExpanded&&(ot.isSubGraphExpanded=!0)):(ot instanceof Ai&&y.es(ot.actualBounds),y.am("LayoutCompleted",tt)),y.eb("Scroll To Part")},tt=function(){Di(z,(x.isEnabled?x.duration:0)+E)};y.Bj("LayoutCompleted",tt),z()}}else{var rt=y.position.copy();y.es(a.actualBounds),rt.Xa(y.position)&&x.Cc()}}};function le(a,y,x){if(y.isVisible())return x;if(y instanceof Qr)le(a,y.adornedPart,x);else if(y instanceof kn){var E=y.fromNode;E!==null&&le(a,E,x),y=y.toNode,y!==null&&le(a,y,x)}else y instanceof qn&&(E=y.labeledLink,E!==null&&le(a,E,x),E=y.pg(),E!==null&&(E.isTreeExpanded||E.wasTreeExpanded||x.push(E),le(a,E,x))),y=y.containingGroup,y!==null&&(y.isSubGraphExpanded||y.wasSubGraphExpanded||x.push(y),le(a,y,x));return x}Wt.prototype.canScrollToPart=function(a){return a===void 0&&(a=null),a!==null&&!(a instanceof Ai)?!1:(a=this.diagram,a.selection.count===0&&a.highlighteds.count===0?!1:a.allowHorizontalScroll&&a.allowVerticalScroll)},Wt.prototype.collapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse Tree"),ju(y.animationManager,"Collapse Tree");var x=new cn;if(a!==null&&a.isTreeExpanded)a.collapseTree(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof qn&&b.isTreeExpanded&&(b.collapseTree(),x.add(b))}y.R("TreeCollapsed",x)}finally{y.eb("Collapse Tree")}},Wt.prototype.canCollapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof qn&&a.isTreeExpanded))return!1;if(0<a.Qo().count)return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof qn&&y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Wt.prototype.expandTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand Tree"),ju(y.animationManager,"Expand Tree");var x=new cn;if(a!==null&&!a.isTreeExpanded)a.expandTree(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof qn&&!b.isTreeExpanded&&(b.expandTree(),x.add(b))}y.R("TreeExpanded",x)}finally{y.eb("Expand Tree")}},Wt.prototype.canExpandTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof qn)||a.isTreeExpanded)return!1;if(0<a.Qo().count)return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof qn&&!y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Wt.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 cn,z=a.selection.iterator;z.next();){var tt=z.value;tt.Zc()&&tt.canGroup()&&b.add(tt)}for(var rt=new cn,ot=b.iterator;ot.next();){var lt=ot.value;z=!1;for(var ut=b.iterator;ut.next();)if(lt.Td(ut.value)){z=!0;break}z||rt.add(lt)}if(0<rt.count){var ft=rt.first().containingGroup;if(ft!==null)for(;ft!==null;){b=!1;for(var yt=rt.iterator;yt.next();)if(!yt.value.Td(ft)){b=!0;break}if(b)ft=ft.containingGroup;else break}if(x instanceof rr)jl(x),E=x.copy(),E!==null&&a.add(E);else if(y.Yu(x)){var xt=y.copyNodeData(x);Re(xt)&&(y.xf(xt),E=a.ii(xt))}if(E!==null){ft!==null&&this.isValidMember(ft,E)&&(E.containingGroup=ft);for(var Ct=rt.iterator;Ct.next();){var bt=Ct.value;this.isValidMember(E,bt)&&(bt.containingGroup=E)}a.clearSelection(!0),E.isSelected=!0}}a.R("SelectionGrouped",E)}finally{a.eb("Group"),a.R("ChangedSelection",a.selection),a.currentCursor=""}}}},Wt.prototype.canGroupSelection=function(){var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowGroup||!a.model.Xj()||this.archetypeGroupData===null)return!1;for(a=a.selection.iterator;a.next();){var y=a.value;if(y.Zc()&&y.canGroup())return!0}return!1};function Ze(a){var y=Jn();for(a=a.iterator;a.next();){var x=a.value;x instanceof kn||y.push(x)}a=new gn,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 li(y),a}Wt.prototype.isValidMember=function(a,y){if(y===null||a===y||y instanceof kn)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},Wt.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 cn;if(a!==null)E.add(a);else for(var b=y.selection.iterator;b.next();){var z=b.value;z instanceof rr&&z.canUngroup()&&E.add(z)}var tt=new cn;if(0<E.count){y.clearSelection(!0);for(var rt=E.iterator;rt.next();){var ot=rt.value;ot.expandSubGraph();var lt=ot.containingGroup,ut=lt!==null&&lt.data!==null?x.wa(lt.data):void 0;tt.addAll(ot.memberParts);for(var ft=tt.iterator;ft.next();){var yt=ft.value;if(yt.isSelected=!0,!(yt instanceof kn)){var xt=yt.data;xt!==null?x.mp(xt,ut):yt.containingGroup=lt}}y.remove(ot)}}y.R("SelectionUngrouped",E,tt)}finally{y.eb("Ungroup"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Wt.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 rr))return!1;if(a.canUngroup())return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof rr&&y.canUngroup())return!0;return!1},Wt.prototype.addTopLevelParts=function(a,y){var x=!0;for(a=Ze(a).iterator;a.next();){var E=a.value;E.containingGroup!==null&&(!y||this.isValidMember(null,E)?E.containingGroup=null:x=!1)}return x},Wt.prototype.collapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse SubGraph"),ju(y.animationManager,"Collapse SubGraph");var x=new cn;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 rr&&b.isSubGraphExpanded&&(b.collapseSubGraph(),x.add(b))}y.R("SubGraphCollapsed",x)}finally{y.eb("Collapse SubGraph")}},Wt.prototype.canCollapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return!!(a instanceof rr&&a.isSubGraphExpanded);for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof rr&&y.isSubGraphExpanded)return!0;return!1},Wt.prototype.expandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand SubGraph"),ju(y.animationManager,"Expand SubGraph");var x=new cn;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 rr&&!b.isSubGraphExpanded&&(b.expandSubGraph(),x.add(b))}y.R("SubGraphExpanded",x)}finally{y.eb("Expand SubGraph")}},Wt.prototype.canExpandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return a instanceof rr&&!a.isSubGraphExpanded;for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof rr&&!y.isSubGraphExpanded)return!0;return!1},Wt.prototype.editTextBlock=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.toolManager.findTool("TextEditing");if(x!==null){if(a===null){a=null;for(var E=y.selection.iterator;E.next();){var b=E.value;if(b.canEdit()){a=b;break}}if(a===null)return;a=a.Nl(function(z){return z instanceof To&&z.editable})}a!==null&&(y.currentTool=null,x.textBlock=a,y.currentTool=x)}},Wt.prototype.canEditTextBlock=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly||y.isModelReadOnly||!y.allowTextEdit||y.toolManager.findTool("TextEditing")===null)return!1;if(a!==null){if(!(a instanceof To))return!1;if(a=a.part,a!==null&&a.canEdit())return!0}else for(y=y.selection.iterator;y.next();)if(a=y.value,a.canEdit()&&(a=a.Nl(function(x){return x instanceof To&&x.editable}),a!==null))return!0;return!1},Wt.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 fe?b=a.ga(dr):y.viewportBounds.ca(E.documentPoint)||(b=y.viewportBounds,b=new At(b.x+b.width/2,b.y+b.height/2)),b!==null&&(E.viewPoint=y.op(b),E.documentPoint=b,E.left=!1,E.right=!0,E.up=!0),y.currentTool=x,rh(x,!1,a)}},Wt.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)},Wt.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 Be,a===null)return E;for(var z=a.iterator;z.next();)Gu(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 kn&&(y=a.fromNode,y===null||E.contains(y)?(y=a.toNode,y===null||E.contains(y)||E.remove(a)):E.remove(a));return E},Se.Object.defineProperties(Wt.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||Gt("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}}}),Wt.className="CommandHandler",Jp=function(){return new Wt};function fe(){Wi(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new At(NaN,NaN).freeze(),this.jd=$r,this.Ab=new ae,this.wh=new ae,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=ca,this.uc=new Te(NaN,NaN,NaN,NaN).freeze(),this.Ib=new Te(NaN,NaN,NaN,NaN).freeze(),this.dc=new Te(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=xa,this.Ag=this.io=0,this.V=this.tb=this.Dh=this.A=this.Ua=null,this.Uc=!1,this.jo=this.Ng=null}var yn,ln,wi,Mi,Ri,sr,Hr,Pr,Ur,Lo;fe.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=Nn(this.Dh)),this.tb!==null&&(a.tb=this.tb.copy())},fe.prototype.Vw=function(a){var y=this.Dh;if($e(y)){for(var x=0;x<y.length;x++)if(y[x]===a)return}else this.Dh=y=[];y.push(a)},fe.prototype.Af=function(a){a.Zn=null,a.Ng=null,a.v()},fe.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},fe.prototype.copy=function(){return this.clone()},wt=fe.prototype,wt.qb=function(a){a.classType===kn?a.name.indexOf("Orient")===0?this.segmentOrientation=a:Gt("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===fe&&(this.stretch=a)},wt.toString=function(){return ni(this.constructor)+"#"+zi(this)},wt.th=function(){this.A!==null&&(this.A.nc=!0)};function xr(a){a.A===null?a.A=new Oc:a.A.nc&&(a.A=a.A.copy())}wt.Xc=function(){if(this.ba===null){var a=new Kg;a.Xi=lr,a.yj=lr,a.Vi=10,a.wj=10,a.Wi=0,a.xj=0,this.ba=a}},wt.cb=function(a,y,x,E,b,z,tt){var rt=this.part;if(rt!==null&&(rt.gk(a,y,x,E,b,z,tt),x===this&&a===pr&&Ua(this)&&Ho(this,rt,y),z=this.diagram,this.animationTriggers===null||z===null||!z.pi||z.undoManager.isUndoingRedoing||z.animationManager.Dm||(a=this.animationTriggers.get(y),a!==null&&z.animationManager.isEnabled&&!z.animationManager.isTicking&&(this.jo===null&&(this.jo=new Be),tt=z.undoManager.transactionLevel===0,a.startCondition===id?tt=!0:a.startCondition===Rd&&(tt=!1),tt?(z=new qa,Kp(a,z),tt=this.jo.get(a),tt!==null&&tt.stop(),this.jo.add(a,z),z.vu=this,z.Nw=a,z.add(this,y,E,b),z.start()):(ju(z.animationManager,"Trigger"),z.animationManager.defaultAnimation.add(this,y,E,b)))),this instanceof Pn&&x===rt&&(rt.l&16777216)!==0&&rt.data!==null))for(x=this.O.s,E=x.length,b=0;b<E;b++)rt=x[b],rt instanceof Pn&&$d(rt,function(ot){ot.data!==null&&ot.l&16777216&&ot.La(y)})};function Ho(a,y,x){var E=a.ih();if(E!==null)for(var b=a.localBindings.iterator;b.next();){var z=b.value,tt=null;if(z.sourceName!==null){if(tt=FS(z,E,a),tt===null)continue;z.sp(a,tt,x,null)}else if(z.isToModel){var rt=y.diagram;rt===null||rt.skipsModelSourceBindings||z.sp(a,rt.model.modelData,x,E)}else{if(rt=E.data,rt===null)continue;var ot=y.diagram;ot===null||ot.skipsModelSourceBindings||z.sp(a,rt,x,E)}tt===a&&(rt=E.ks(z.Ai),rt!==null&&z.Mv(rt,tt,x))}}wt.ks=function(a){return this.bindingId===a?this:null},wt.g=function(a,y,x){this.cb(pr,a,this,y,x)},wt.Ge=function(a,y,x,E){var b=this.uc;if(b.h(a,y,x,E),this.Ca!==1||this.Kb!==0){this.Lb===null&&(this.Lb=new ae);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),z.pp(b)}};function ka(a,y,x,E){return a.pickable===!1?!1:(E.multiply(a.transform),x?a.Yc(y,E):a.fh(y,E))}wt.tx=function(a,y,x){if(this.pickable===!1)return!1;var E=this.naturalBounds;return y=a.Bf(y),x?Un(a.x,a.y,0,0,0,E.height)<=y||Un(a.x,a.y,0,E.height,E.width,E.height)<=y||Un(a.x,a.y,E.width,E.height,E.width,0)<=y||Un(a.x,a.y,E.width,0,0,0)<=y:a.zd(0,0)<=y&&a.zd(0,E.height)<=y&&a.zd(E.width,0)<=y&&a.zd(E.width,E.height)<=y},wt.se=function(){return!0},wt.ca=function(a){var y=At.alloc();y.assign(a),this.transform.Ga(y);var x=this.actualBounds;if(!x.w())return At.free(y),!1;var E=this.diagram;if(E!==null&&E.wq){var b=E.Ql("extraTouchThreshold"),z=E.Ql("extraTouchArea"),tt=z/2,rt=this.naturalBounds;E=this.Df()*E.scale;var ot=1/E;if(rt.width*E<b&&rt.height*E<b)return a=Zr(x.x-tt*ot,x.y-tt*ot,x.width+z*ot,x.height+z*ot,y.x,y.y),At.free(y),a}return b=!1,(this instanceof Qr||this instanceof fr?Zr(x.x-5,x.y-5,x.width+10,x.height+10,y.x,y.y):x.ca(y))&&(this.tb&&!this.tb.ca(y)?b=!1:this.areaBackground!==null&&x.ca(y)||this.Ma!==null&&this.dc.ca(a)?b=!0:b=this.gh(a)),At.free(y),b},wt.gh=function(a){var y=this.naturalBounds;return Zr(0,0,y.width,y.height,a.x,a.y)},wt.Re=function(a){if(this.angle===0)return this.actualBounds.Re(a);var y=this.naturalBounds;y=Te.allocAt(0,0,y.width,y.height);var x=this.transform,E=!1,b=At.allocAt(a.x,a.y);return y.ca(x.Cd(b))&&(b.h(a.x,a.bottom),y.ca(x.Cd(b))&&(b.h(a.right,a.bottom),y.ca(x.Cd(b))&&(b.h(a.right,a.y),y.ca(x.Cd(b))&&(E=!0)))),At.free(b),Te.free(y),E},wt.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.naturalBounds,E=!1,b=At.allocAt(0,0);return a.ca(y.Ga(b))&&(b.h(0,x.height),a.ca(y.Ga(b))&&(b.h(x.width,x.height),a.ca(y.Ga(b))&&(b.h(x.width,0),a.ca(y.Ga(b))&&(E=!0)))),At.free(b),E},wt.Yc=function(a,y){if(y===void 0&&(y=this.transform,this.angle===0))return a.Yc(this.actualBounds);var x=this.naturalBounds,E=At.allocAt(0,0),b=At.allocAt(0,x.height),z=At.allocAt(x.width,x.height),tt=At.allocAt(x.width,0),rt=!1;if(a.ca(y.Ga(E))||a.ca(y.Ga(b))||a.ca(y.Ga(z))||a.ca(y.Ga(tt)))rt=!0;else{x=Te.allocAt(0,0,x.width,x.height);var ot=At.allocAt(a.x,a.y);x.ca(y.Cd(ot))?rt=!0:(ot.h(a.x,a.bottom),x.ca(y.Cd(ot))?rt=!0:(ot.h(a.right,a.bottom),x.ca(y.Cd(ot))?rt=!0:(ot.h(a.right,a.y),x.ca(y.Cd(ot))&&(rt=!0)))),At.free(ot),Te.free(x),!rt&&(_t.us(a,E,b)||_t.us(a,b,z)||_t.us(a,z,tt)||_t.us(a,tt,E))&&(rt=!0)}return At.free(E),At.free(b),At.free(z),At.free(tt),rt},wt.ga=function(a,y){if(y===void 0&&(y=new At),a instanceof gi){var x=this.naturalBounds;y.h(a.x*x.width+a.offsetX,a.y*x.height+a.offsetY)}else y.set(a);return this.oe.Ga(y),y},wt.mi=function(a){a===void 0&&(a=new Te);var y=this.naturalBounds,x=this.oe,E=At.allocAt(0,0).transform(x);return a.h(E.x,E.y,0,0),E.h(y.width,0).transform(x),zr(a,E.x,E.y,0,0),E.h(y.width,y.height).transform(x),zr(a,E.x,E.y,0,0),E.h(0,y.height).transform(x),zr(a,E.x,E.y,0,0),At.free(E),a},wt.li=function(){var a=this.oe;return a.m11===1&&a.m12===0?a=0:(a=180*Math.atan2(a.m12,a.m11)/Math.PI,0>a&&(a+=360)),a},wt.Df=function(){if(!(this.l&4096))return this.Kk;var a=this.Ca;return this.panel!==null?a*this.panel.Df():a},wt.qs=function(a,y){return y===void 0&&(y=new At),y.assign(a),this.oe.Cd(y),y},wt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},wt.Sj=function(a,y,x,E,b){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),rt=z.m22*tt,ot=-z.m12*tt,lt=-z.m21*tt,ut=z.m11*tt,ft=tt*(z.m21*z.dy-z.m22*z.dx),yt=tt*(z.m12*z.dx-z.m11*z.dy);return this.areaBackground!==null?(z=this.actualBounds,_t.Ff(z.left,z.top,z.right,z.bottom,a,y,x,E,b)):(tt=a*rt+y*lt+ft,a=a*ot+y*ut+yt,y=x*rt+E*lt+ft,x=x*ot+E*ut+yt,b.h(0,0),E=this.naturalBounds,x=_t.Ff(0,0,E.width,E.height,tt,a,y,x,b),b.transform(z),x)},fe.prototype.measure=function(a,y,x,E){if(ul(this)!==!1){var b=this.Kg,z=b.right+b.left;b=b.top+b.bottom,a=Math.max(a-z,0),y=Math.max(y-b,0),x=Math.max((x||0)-z,0),E=Math.max((E||0)-b,0),z=this.angle,b=this.desiredSize;var tt=this.kq();z===90||z===270?(a=isFinite(b.height)?b.height+tt:a,y=isFinite(b.width)?b.width+tt:y):(a=isFinite(b.width)?b.width+tt:a,y=isFinite(b.height)?b.height+tt:y),b=x||0,tt=E||0;var rt=this instanceof Pn;switch(Ts(this,!0)){case ln:tt=b=0,rt&&(y=a=1/0);break;case yn:isFinite(a)&&a>x&&(b=a),isFinite(y)&&y>E&&(tt=y);break;case Mi:isFinite(a)&&a>x&&(b=a),tt=0,rt&&(y=1/0);break;case Ri:isFinite(y)&&y>E&&(tt=y),b=0,rt&&(a=1/0)}rt=this.maxSize;var ot=this.minSize;b>rt.width&&ot.width<rt.width&&(b=rt.width),tt>rt.height&&ot.height<rt.height&&(tt=rt.height),x=Math.max(b,ot.width),E=Math.max(tt,ot.height),rt.width<x&&(x=Math.min(ot.width,x)),rt.height<E&&(E=Math.min(ot.height,E)),a=Math.min(rt.width,a),y=Math.min(rt.height,y),a=Math.max(x,a),y=Math.max(E,y),(z===90||z===270)&&(z=a,a=y,y=z,z=x,x=E,E=z),this.uc.ka(),this.Wl(a,y,x,E),this.uc.freeze(),this.uc.w()||Gt("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),ma(this,!1)}},fe.prototype.Wl=function(){},fe.prototype.Dd=function(){return!1},fe.prototype.arrange=function(a,y,x,E,b){this.Uk();var z=Te.alloc();z.assign(this.Ib),this.Ib.ka(),Ss(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&&Th(b)&&(b=b.panel),b!==null&&(b=b.dc,E=this.measuredBounds,this.areaBackground!==null&&(E=this.Ib),x=y+E.height,E=a+E.width,x=!(0<=a+.05&&E<=b.width+.05&&0<=y+.05&&x<=b.height+.05),this instanceof To&&(a=this.naturalBounds,this.Lq>a.height||this.Cb>a.width))&&(x=!0)),this.l=x?this.l|256:this.l&-257,this.Ib.w()||Gt("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(z,this.Ib),Hu(this,!1),Te.free(z)},wt=fe.prototype,wt.eh=function(){};function ds(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=Ts(a,!0),x===E&&z===b&&(y=ln),y){case ln:(x>E||z>b)&&(ma(a,!0),a.measure(x>E?E:x,z>b?b:z,0,0));break;case yn:ma(a,!0),a.measure(E,b,0,0);break;case Mi:ma(a,!0),a.measure(E,z,0,0);break;case Ri:ma(a,!0),a.measure(x,b,0,0)}}}wt.Xl=function(a,y){var x=this.part;x!==null&&x.diagram!==null&&(x.selectionObject!==this&&x.resizeObject!==this&&x.rotateObject!==this||Rv(x,!0),this.N(),Wr(a,y)||(x.oh(),this.Pn(x)))},wt.Pn=function(a){this.portId!==null&&(Rv(a,!0),a instanceof qn&&H1(a,this))},wt.gc=function(a,y){if(!Pl(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 Pn&&Th(this),tt=this.Ib;if(z){var rt=this.Ib,ot=this.dc,lt=this.areaBackground,ut=this.Ma;lt===null&&ut===null||a.yc(),lt!==null&&(ta(this,a,lt,!0,!0,ot,rt),lt instanceof So&&lt.type===El?(a.beginPath(),a.rect(rt.x,rt.y,rt.width,rt.height),a.ng(lt)):a.fillRect(rt.x,rt.y,rt.width,rt.height)),ut!==null&&(ta(this,a,ut,!0,!1,ot,rt),ut instanceof So&&ut.type===El?(a.beginPath(),a.rect(rt.x,rt.y,rt.width,rt.height),a.ng(ut)):a.fillRect(rt.x,rt.y,rt.width,rt.height)),this.hh(a,y)}if(!z&&(z||tt.width!==0&&tt.height!==0&&!isNaN(tt.x)&&!isNaN(tt.y))){z=this.transform,rt=this.panel,this.l&4096&&Wa(this),lt=this.part,ot=!1;var ft=0;lt&&y.Gf("drawShadows")&&(ot=lt.isShadowed)&&(ut=lt.shadowOffset,ft=Math.max(ut.y,ut.x)*y.scale*y.Mb),ut=this.Dd();var yt;if(!(yt=y.$i||!ut)){var xt=this.naturalBounds;yt=this.wh;var Ct=yt.m11,bt=yt.m21,Vt=yt.dx,zt=yt.m12,$t=yt.m22,ie=yt.dy,oe,de=oe=0;yt=oe*Ct+de*bt+Vt;var ke=oe*zt+de*$t+ie;oe=xt.width+ft,de=0;var Hn=oe*Ct+de*bt+Vt;oe=oe*zt+de*$t+ie,de=Math.min(yt,Hn);var ci=Math.min(ke,oe),ai=Math.max(yt+0,Hn)-de,Fn=Math.max(ke+0,oe)-ci;yt=de,ke=ci,oe=xt.width+ft,de=xt.height+ft,Hn=oe*Ct+de*bt+Vt,oe=oe*zt+de*$t+ie,de=Math.min(yt,Hn),ci=Math.min(ke,oe),ai=Math.max(yt+ai,Hn)-de,Fn=Math.max(ke+Fn,oe)-ci,yt=de,ke=ci,oe=0,de=xt.height+ft,Hn=oe*Ct+de*bt+Vt,oe=oe*zt+de*$t+ie,de=Math.min(yt,Hn),ci=Math.min(ke,oe),ai=Math.max(yt+ai,Hn)-de,Fn=Math.max(ke+Fn,oe)-ci,yt=de,ke=ci,ft=y.viewportBounds,xt=ft.x,Ct=ft.y,yt=!(yt>ft.width+xt||xt>ai+yt||ke>ft.height+Ct||Ct>Fn+ke)}if(yt){if(yt=(this.l&256)!==0,a.clipInsteadOfFill&&(yt=!1),this instanceof To&&(a.font=this.font),yt){if(ke=rt.se()?rt.naturalBounds:rt.actualBounds,ai=Math.max(tt.x,ke.x),Fn=Math.max(tt.y,ke.y),ft=Math.min(tt.right,ke.right)-ai,xt=Math.min(tt.bottom,ke.bottom)-Fn,Ct=this.tb,Ct!==null&&(ai=Ct.x,Fn=Ct.y,ft=Ct.width,xt=Ct.height),ai>tt.width+tt.x||tt.x>ke.width+ke.x){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}a.save(),a.beginPath(),a.rect(ai,Fn,ft,xt),a.clip()}if(ut){if(!lt.isVisible()){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}ot&&(ke=lt.shadowOffset,a.Ev(ke.x*y.scale*this.scale*y.Mb,ke.y*y.scale*this.scale*y.Mb,lt.shadowBlur),uh(a),a.shadowColor=lt.shadowColor)}ot&&this.shadowVisible===!0?uh(a):ot&&this.shadowVisible===!1&&Wu(a),lt=this.naturalBounds,this.areaBackground!==null&&(a.yc(),ll(this,a,lt,tt)),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),ot&&ja(this,rt)&&this.shadowVisible===null&&Wu(a),this.Ma!==null&&(a.yc(),Gs(this,a,lt,tt)),ot&&(this.Ma!==null||this.areaBackground!==null||ja(this,rt))?(ql(this,!0),this.shadowVisible===null&&Wu(a)):ql(this,!1),this.hh(a,y),ot&&this.l&512&&uh(a),ut&&ot&&Wu(a),yt&&(a.restore(),a.Vc(this instanceof Pn)),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 ja(a,y){return y===null?!1:(Th(y)&&(y=y.panel),(y.l&512)!==0||(y.type===Pn.Auto||y.type===Pn.Spot)&&y.Pb()!==a)}wt.Dv=function(){};function ll(a,y,x,E){ta(a,y,a.areaBackground,!0,!0,x,E),a.areaBackground instanceof So&&a.areaBackground.type===El?(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 Gs(a,y,x,E){var b=a.kq(),z=x.x,tt=x.y,rt=x.width+b,ot=x.height+b;ta(a,y,a.Ma,!0,!1,x,E),a.Ma instanceof So&&a.Ma.type===El?(y.beginPath(),y.rect(z-b/2,tt-b/2,rt,ot),y.ng(a.Ma)):y.fillRect(z-b/2,tt-b/2,rt,ot)}function os(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===Pn.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 Pl(a,y,x){if(!(y instanceof Qs))return!1;if(!a.visible||a.opacity===0||a.Dd()&&!a.isVisible())return a.svg!==null&&a.svg.parentNode!==null&&a.svg.remove(),!0;var E=a.panel,b=a.nk(y);if(a.kk(y,x,b))return a.svg.parentElement!==null?(a.Dd()&&(y.ti=a.svg),!0):(a.Dd()?(y.ti!==null?y.ti.after(a.svg):y.Nj.prepend(a.svg),y.ti=a.svg):E&&os(a,E,a.svg),!0);if(a.Dd()&&a.isShadowed){var z=a.shadowOffset;y.Ev(z.x*x.scale*a.scale*x.Mb,z.y*x.scale*a.scale*x.Mb,a.shadowBlur),uh(y),y.shadowColor=a.shadowColor}a instanceof To&&(y.font=a.font),y.yd=null;var tt=a.transform;z=a instanceof Pn;var rt=a instanceof Pn?Th(a):!1;a.l&4096&&Wa(a);var ot=a.Ib;if(y.rb.ha=[1,0,0,1,0,0],y.o=!1,b&&(y.o=!0,z&&rt?(Ug(y,1,0,0,1,0,0),a.svg=y.ad):z?(Ug(y,tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy),a.svg=y.ad):Ug(y,1,0,0,1,0,0)),b=a.naturalBounds,a.areaBackground!==null){var lt=tt.copy().Vj();y.rb.ha=[lt.m11,lt.m12,lt.m21,lt.m22,lt.dx,lt.dy],ll(a,y,b,ot),y.rb.ha=[1,0,0,1,0,0],y.yd.gd=y.ad,y.yd.prepend(y.ad)}return z||(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy]),a.background!==null&&(z?(rt&&(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy]),Gs(a,y,b,ot),rt&&(y.rb.ha=[1,0,0,1,0,0])):(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy],Gs(a,y,b,ot)),y.yd.Ma=y.ad,y.yd.prepend(y.ad)),tt=y.yd,b=a.part,rt=!1,b&&x.Gf("drawShadows")&&(rt=b.isShadowed),y.clipInsteadOfFill&&(rt=!1),a.Dd()&&rt&&uh(y),rt&&a.shadowVisible===!0?uh(y):rt&&a.shadowVisible===!1&&Wu(y),b=a.panel,rt&&ja(a,b)&&a.shadowVisible===null&&Wu(y),y.Il&&(lt=x.computePixelRatio(),lt="drop-shadow("+y.shadowOffsetX/lt+"px "+y.shadowOffsetY/lt+"px "+y.shadowBlur/lt/2+"px "+y.shadowColor+")",a.background!==null&&tt.Ma.setAttributeNS(null,"filter",lt),a.areaBackground!==null&&tt.gd.setAttributeNS(null,"filter",lt)),rt&&(a.Ma!==null||a.areaBackground!==null||ja(a,b))?(ql(a,!0),a.shadowVisible===null&&Wu(y)):ql(a,!1),b=rt,a.hh(y,x),z&&y.nh.pop(),y.o&&y.nh.pop(),tt=y.Gv.hs,rt=z?a.svg:y.yd,lt=a.svg,!z&&lt!==null&&rt!==lt&&lt.parentNode===a.panel.svg?(a.svg.replaceWith(rt),a.svg=rt,rt!==null&&a.$o(y,E,ot,rt),As(y,lt),!0):(a.svg=rt,tt!==null&&rt===null&&(dm(y),y.nh.pop()),rt===null||(a.$o(y,E,ot,rt),y.Il&&(x=x.computePixelRatio(),a.Dv(rt,"drop-shadow("+y.shadowOffsetX/x+"px "+y.shadowOffsetY/x+"px "+y.shadowBlur/x/2+"px "+y.shadowColor+")")),b&&a.l&512&&uh(y),a.Dd()&&Wu(y),x=a.Dd()?a.opacity*y.globalAlpha:a.opacity,x!==1&&rt.setAttributeNS(null,"opacity",x.toString()),a.filter!==""&&rt.setAttributeNS(null,"filter",a.filter),a.Dd()?(y.ti?y.ti.after(rt):y.Nj.prepend(rt),y.ti=rt):E!==null&&os(a,E,rt),tt!==null&&tt(a,rt)),!0)}wt.$o=function(a,y,x,E){var b=(this.l&256)!==0;if(a.clipInsteadOfFill&&(b=!1),b){var z=y.se()?y.naturalBounds:y.actualBounds;y=Math.max(x.x,z.x),b=Math.max(x.y,z.y);var tt=Math.min(x.right,z.right)-y;x=Math.min(x.bottom,z.bottom)-b,z=this.tb,z!==null&&(y=z.x,b=z.y,tt=z.width,x=z.height),z=E.getAttribute("clip-path");var rt=null;z!==null&&(rt=a.svg.getElementById(z.split("#")[1].slice(0,-1))),rt===null?(z="CLIP"+wo++,rt=a.Ud("clipPath",{id:z}),y=a.Ud("rect",{x:y,y:b,width:tt,height:x}),this instanceof Pn&&(b=this.transform.copy().Vj(),y.setAttribute("transform","matrix("+b.m11+", "+b.m12+", "+b.m21+", "+b.m22+", "+b.dx+", "+b.dy+")")),rt.appendChild(y),a.svg.appendChild(rt),E.setAttributeNS(null,"clip-path","url(#"+z+")")):(a=rt.firstElementChild,a.setAttribute("x",y.toString()),a.setAttribute("y",b.toString()),a.setAttribute("width",tt.toString()),a.setAttribute("height",x.toString()))}else E.removeAttributeNS(null,"clip-path"),As(a,E)};function As(a,y){y=y.getAttribute("clip-path"),y!==null&&(a=a.svg.getElementById(y.split("#")[1].slice(0,-1)),a!==null&&a.remove())}function as(a){if(a.svg!==null){var y=a.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),x=a.svg.ownerDocument;if(y!==null){y=Zn(y);for(var E=y.next();!E.done;E=y.next())E=x.getElementById(E.value.split("#")[1].slice(0,-1)),E!==null&&E.remove()}a.svg.remove()}}wt.hh=function(){},wt.lv=function(){this.Uc=!0},wt.kk=function(a,y,x){if(this.Uc)return this.lv(),this.Uc=!1;if(y=this.svg,y===null)return!1;if(!this.visible)return y.remove(),!1;if(y.nodeName!=="g"&&x||y.nodeName==="g"&&!x)return!1;var E=this.transform,b=this instanceof Pn?Th(this):!1;if(!(this instanceof Pn&&b))if(this instanceof Os){var z=this.bt;a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy],z!==null&&Xy(a,z[0],z[1],z[2],z[3],z[4],z[5],z[6],z[7]),x?y.lastElementChild.setAttributeNS(null,"transform",Jy(a)):y.setAttributeNS(null,"transform",Jy(a))}else if(!x||this instanceof Pn)y.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")");else if(this instanceof fr){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],ll(this,a,this.naturalBounds,this.actualBounds),a.rb.ha=[1,0,0,1,0,0],y.gd?(tt=y.gd.getAttribute("filter"),tt!==null&&a.ad.setAttribute("filter",tt),y.gd.replaceWith(a.ad)):y.prepend(a.ad),y.gd=a.ad),z&&cm(a,z)),(this.background!==null||y.Ma!==void 0)&&(z=y.Ma,this.background===null?(cm(a,y.Ma),y.Ma.remove(),y.Ma=void 0):((b||x&&!(this instanceof Pn))&&(a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy]),Gs(this,a,this.naturalBounds,this.actualBounds),y.Ma?(cm(a,y.Ma),x=y.Ma.getAttribute("filter"),x!==null&&a.ad.setAttribute("filter",x),y.Ma.replaceWith(a.ad)):y.prepend(a.ad),y.Ma=a.ad),z&&cm(a,z)),this.$o(a,this.panel,this.actualBounds,y),!0},wt.nk=function(a){if(this.background!==null||this.areaBackground!==null)return!0;var y=(this.l&256)!==0;return a.clipInsteadOfFill&&(y=!1),!!y};function ta(a,y,x,E,b,z,tt){if(x!==null){var rt=1,ot=1;if(typeof x=="string")E?y.fillStyle=x:y.strokeStyle=x;else if(x.type===Ah)E?y.fillStyle=x.color:y.strokeStyle=x.color;else{var lt=a.kq();if(rt=z.width,ot=z.height,b?(rt=tt.width,ot=tt.height):E||(rt+=lt,ot+=lt),(z=y instanceof Qd)&&x.xe&&(x.type===Tf||x.yk===rt&&x.ft===ot))var ut=x.xe;else{var ft=0,yt=0,xt=0,Ct=0,bt=0,Vt=0;if(Vt=bt=0,b?(bt=tt.x,Vt=tt.y):E||(bt-=lt/2,Vt-=lt/2),ft=x.start.x*rt+x.start.offsetX,yt=x.start.y*ot+x.start.offsetY,xt=x.end.x*rt+x.end.offsetX,Ct=x.end.y*ot+x.end.offsetY,ft+=bt,xt+=bt,yt+=Vt,Ct+=Vt,x.type===dh)ut=y.createLinearGradient(ft,yt,xt,Ct);else if(x.type===El)Vt=isNaN(x.endRadius)?Math.max(rt,ot)/2:x.endRadius,isNaN(x.startRadius)?(bt=0,Vt=Math.max(rt,ot)/2):bt=x.startRadius,ut=y.createRadialGradient(ft,yt,bt,xt,Ct,Vt);else if(x.type===Tf)try{ut=y.createPattern(x.pattern,"repeat")}catch($t){ut=null}if(x.type!==Tf&&(b=x.colorStops,b!==null))for(b=b.iterator;b.next();)ut.addColorStop(b.key,b.value);if(z&&(x.xe=ut,ut!==null&&(x.yk=rt,x.ft=ot),ut===null&&x.type===Tf&&x.yk!==-1)){x.yk=-1;var zt=a.diagram;zt!==null&&x.yk===-1&&Di(function(){zt.redraw()},600)}}E?y.fillStyle=ut:y.strokeStyle=ut}}}wt.rg=function(a){if(a instanceof Pn)t:{if(this!==a&&a!==null)for(var y=this.panel;y!==null;){if(y===a){a=!0;break t}y=y.panel}a=!1}else a=!1;return a},wt.Ed=function(){if(!this.visible)return!1;var a=this.panel;return a!==null?a.Ed():!0},wt.If=function(){for(var a=this instanceof Pn?this:this.panel;a!==null&&a.isEnabled;)a=a.panel;return a===null};function Wa(a){if(a.l&2048){var y=a.Ab;if(y.reset(),!a.Ib.w()||!a.uc.w()){_l(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)}_l(a,!1),wl(a,!0)}a.l&4096&&(y=a.panel,y===null?(a.wh.set(a.Ab),a.Kk=a.scale,wl(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,wl(a,!1)))}wt.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=At.alloc();z.yi(y,x,E,b,dr),a.rotate(this.Kb,z.x,z.y),At.free(z)}},wt.v=function(a){if(!ul(this)){a===void 0&&(a=!1),ma(this,!0),Hu(this,!0);var y=this.panel;y===null||a||y.v()}},wt.Uj=function(){ul(this)||(ma(this,!0),Hu(this,!0))};function ys(a){if(!Ss(a)){var y=a.panel;y!==null?y.v():a.Dd()&&(y=a.diagram,y!==null&&(y.De.add(a),a instanceof qn&&a.Bd(),y.$b())),Hu(a,!0)}}wt.Uk=function(){!(this.l&2048)&&(_l(this,!0),wl(this,!0))},wt.Wu=function(){wl(this,!0)},wt.N=function(){var a=this.part;a!==null&&a.N()};function Ts(a,y){var x=a.stretch,E=a.panel;return E!==null&&E.type===Pn.Table?fu(a,E.Fb(a.row),E.Eb(a.column),y):E!==null&&E.type===Pn.Auto&&E.Pb()===a?za(a,yn,y):x===sr?E!==null?E.type===Pn.Spot&&E.Pb()===a?za(a,yn,y):(x=E.defaultStretch,x===sr?za(a,ln,y):za(a,x,y)):za(a,ln,y):za(a,x,y)}function fu(a,y,x,E){var b=a.stretch;if(b!==sr)return za(a,b,E);var z=b=null;switch(y.stretch){case Ri:z=!0;break;case yn:z=!0}switch(x.stretch){case Mi:b=!0;break;case yn:b=!0}return y=a.panel.defaultStretch,b===null&&(b=y===Mi||y===yn),z===null&&(z=y===Ri||y===yn),b===!0&&z===!0?za(a,yn,E):b===!0?za(a,Mi,E):z===!0?za(a,Ri,E):za(a,ln,E)}function za(a,y,x){if(x)return y;if(y===ln||(x=a.desiredSize,x.w()))return ln;if(a=a.angle,!isNaN(x.width))if(a!==90&&a!==270){if(y===Mi)return ln;if(y===yn)return Ri}else{if(y===Ri)return ln;if(y===yn)return Mi}if(!isNaN(x.height))if(a!==90&&a!==270){if(y===Ri)return ln;if(y===yn)return Mi}else{if(y===Mi)return ln;if(y===yn)return Ri}return y}function ql(a,y){a.l=y?a.l|512:a.l&-513}function Ua(a){return(a.l&1024)!==0}function Dc(a,y){a.l=y?a.l|1024:a.l&-1025}function _l(a,y){a.l=y?a.l|2048:a.l&-2049}function wl(a,y){a.l=y?a.l|4096:a.l&-4097}function ul(a){return(a.l&8192)!==0}function ma(a,y){a.l=y?a.l|8192:a.l&-8193}function Ss(a){return(a.l&16384)!==0}function Hu(a,y){a.l=y?a.l|16384:a.l&-16385}wt.Gj=function(){this.svg=null},wt.wi=function(a){this.Me=a,this.svg!==null&&this.svg.remove()},wt.Av=function(){},wt.zv=function(a){return this.pa=a,ys(this),!0},wt.mm=function(a,y){(this.pa.x!==a||this.pa.y!==y)&&(this.pa.h(a,y),this.Uk())},wt.kq=function(){return 0};function Xd(a){var y=a.part;if(y instanceof qn&&(a.portId!==null||a===y.port)){var x=y.diagram;x===null||x.undoManager.isUndoingRedoing||H1(y,a)}}function Uy(a){var y=a.diagram;y===null||y.undoManager.isUndoingRedoing||(a instanceof Pn?a instanceof qn?a.Bd():a.qm(a,function(x){Xd(x)}):Xd(a))}wt.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new la(a,y,x,E):b=a,b.xd=this,a=this.ih(),a!==null&&c1(a)&&Gt("Cannot add a Binding to a template that has already been copied: "+b),this.localBindings===null&&(this.localBindings=new cn),this.localBindings.add(b),this},wt.set=function(a){return Object.assign(this,a),this},wt.Du=function(a){return nv(this,a),this},wt.apply=function(a){return a(this),this},wt.nm=function(a){return Zd(this,a),this},wt.pz=function(){return this.ih()},wt.ih=function(){for(var a=this instanceof Pn?this:this.panel;a!==null;){if(a.allBindings!==null)return a;a=a.panel}return null},wt.Jv=function(a){return a.xd=this,this.animationTriggers===null&&(this.animationTriggers=new Be),this.animationTriggers.add(a.propertyName,a),this};function Cl(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=Mf.I(a);typeof z=="function"?(x=Nn(arguments),E=z(x),Re(E)||Gt('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):b=qe.go[a]}if(E===null&&(b!=null&&b.constructor||Gt("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),E=new b),b=1,E instanceof be&&1<x.length){z=E;var tt=x[1];(typeof tt=="string"||tt instanceof HTMLDivElement)&&(Pg(z,tt),b++)}for(;b<x.length;b++)z=x[b],z===void 0?Gt("Undefined value at argument "+b+" for object being constructed by GraphObject.make: "+E):nv(E,z);return E}function nv(a,y){if(typeof y=="string")if(a instanceof To)a.text=y;else if(a instanceof fr)a.figure=y;else if(a instanceof Os)a.source=y;else if(a instanceof Pn)y=tu.I(y),y!==null&&(a.type=y);else if(a instanceof So){var x=Tn(So,y);x!==null?a.type=x:Gt("Unknown Brush type as an argument to GraphObject.make: "+y)}else a instanceof ce?(y=Tn(ce,y),y!==null&&(a.type=y)):a instanceof Ui&&(y=Tn(Ui,y),y!==null&&(a.type=y));else if(y instanceof fe)a instanceof Pn||Gt("A GraphObject can only be added to a Panel, not to: "+a),a.add(y);else if(y instanceof va){var E;y.isRow&&typeof a.getRowDefinition=="function"?E=a.getRowDefinition(y.index):y.isRow||typeof a.getColumnDefinition!="function"||(E=a.getColumnDefinition(y.index)),E instanceof va?km(E,y):Gt("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(y instanceof en)typeof a.qb=="function"&&a.qb(y);else if(y instanceof wa)a.type=y;else if(y instanceof la)a instanceof fe||a instanceof va?a.bind(y):Gt("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(y instanceof Ql)a instanceof fe?a.Jv(y):Gt("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(y instanceof Ir)a instanceof ce&&a.type===ce.o?a.figures.add(y):Gt("A PathFigure can only be added to a Path Geometry, not to: "+a);else if(y instanceof Ui)a instanceof Ir?a.segments.add(y):Gt("A PathSegment can only be added to a PathFigure, not to: "+a);else if(y instanceof Ko)a instanceof be||a instanceof rr?a.layout=y:Gt("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 So){x=new bi;for(var b in y)E=parseFloat(b),isNaN(E)?x[b]=y[b]:a.addColorStop(E,y[b]);Zd(a,x)}else if(a instanceof va){y.row!==void 0?(b=y.row,(b==null||b===1/0||isNaN(b)||0>b)&&Gt("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)&&Gt("Must specify non-negative integer column for RowColumnDefinition "+y+", not: "+b),a.isRow=!1,a.index=b),b=new bi;for(x in y)x!=="row"&&x!=="column"&&(b[x]=y[x]);Zd(a,b)}else Zd(a,y);else Gt('Unknown initializer "'+y+'" for object being constructed by GraphObject.make: '+a)}function Bh(a,y){Mf.add(a,y)}function hm(a,y,x){x===void 0&&(x=null);var E=a[1];if(typeof x=="function"?x(E):typeof E=="string")return a.splice(1,1),E;if(y===void 0)throw Error("no "+(typeof x=="function"?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return y}Se.Object.defineProperties(fe.prototype,{bindingId:{get:function(){return this.A!==null?this.A.zp:-1},set:function(a){this.bindingId!==a&&(this.A===null&&(this.A=new Oc),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 Oc),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 Oc),this.A.wm=a)}},shadowVisible:{get:function(){return this.A!==null?this.A.Ci:null},set:function(a){var y=this.shadowVisible;y!==a&&(xr(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&&(xr(this),this.A.Hb=a,this.g("enabledChanged",y,a))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:ws},set:function(a){var y=this.segmentOrientation;y!==a&&(this.Ua===null&&(this.Ua=new dd),this.Ua.rr=a,this.v(),this.g("segmentOrientation",y,a),a===ws&&(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 dd),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 dd),this.Ua.o=a,this.v(),this.g("segmentFraction",y,a))}},segmentOffset:{get:function(){return this.Ua!==null?this.Ua.F:jn},set:function(a){var y=this.segmentOffset;y.D(a)||(a=a.J(),this.Ua===null&&(this.Ua=new dd),this.Ua.F=a,this.v(),this.g("segmentOffset",y,a))}},stretch:{get:function(){return this.A!==null?this.A.hg:sr},set:function(a){var y=this.stretch;y!==a&&(xr(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&&(xr(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)&&En(a,"0 <= value <= 1",fe,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(ec(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(ec(y,y.actualBounds)))}},visible:{get:function(){return(this.l&1)!==0},set:function(a){var y=(this.l&1)!==0;y!==a&&(this.l^=1,this.g("visible",y,a),y=this.panel,y!==null?y.v():this.Dd()&&this.Zb(a),this.N(),Uy(this))}},pickable:{get:function(){return(this.l&2)!==0},set:function(a){var y=(this.l&2)!==0;y!==a&&(this.l^=2,this.g("pickable",y,a))}},fromLinkableDuplicates:{get:function(){return(this.l&4)!==0},set:function(a){var y=(this.l&4)!==0;y!==a&&(this.l^=4,this.g("fromLinkableDuplicates",y,a))}},fromLinkableSelfNode:{get:function(){return(this.l&8)!==0},set:function(a){var y=(this.l&8)!==0;y!==a&&(this.l^=8,this.g("fromLinkableSelfNode",y,a))}},toLinkableDuplicates:{get:function(){return(this.l&16)!==0},set:function(a){var y=(this.l&16)!==0;y!==a&&(this.l^=16,this.g("toLinkableDuplicates",y,a))}},toLinkableSelfNode:{get:function(){return(this.l&32)!==0},set:function(a){var y=(this.l&32)!==0;y!==a&&(this.l^=32,this.g("toLinkableSelfNode",y,a))}},isPanelMain:{get:function(){return(this.l&64)!==0},set:function(a){var y=(this.l&64)!==0;y!==a&&(this.l^=64,this.v(),this.g("isPanelMain",y,a))}},isActionable:{get:function(){return(this.l&128)!==0},set:function(a){var y=(this.l&128)!==0;y!==a&&(this.l^=128,this.g("isActionable",y,a))}},areaBackground:{get:function(){return this.A!==null?this.A.gd:null},set:function(a){var y=this.areaBackground;y!==a&&(a!==null&&_c(a,"GraphObject.areaBackground"),a instanceof So&&a.freeze(),xr(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&&_c(a,"GraphObject.background"),a instanceof So&&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 Ai)return this.Ng=a;a=a.panel}return null}},svg:{get:function(){return this.V},set:function(a){this.V=a}},panel:{get:function(){return this.Me}},layer:{get:function(){var a=this.part;return a!==null?a.layer:null}},diagram:{get:function(){var a=this.part;return a!==null?a.diagram:null}},position:{get:function(){return this.pa},set:function(a){var y=a.x,x=a.y,E=this.pa,b=E.x;E=E.y,(b===y||isNaN(b)&&isNaN(y))&&(E===x||isNaN(E)&&isNaN(x))?this.Av():(a=a.copy(),this.zv(a,b,E)&&this.g("position",new At(b,E),a))}},actualBounds:{get:function(){return this.Ib}},scale:{get:function(){return this.Ca},set:function(a){var y=this.Ca;y!==a&&(0>=a&&Gt("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Ca=a,this.v(),this.g("scale",y,a))}},angle:{get:function(){return this.Kb},set:function(a){var y=this.Kb;y!==a&&(a%=360,0>a&&(a+=360),y!==a&&(this.Kb=a,Uy(this),this.v(),this.g("angle",y,a)))}},desiredSize:{get:function(){return this.jd},set:function(a){var y=a.width,x=a.height,E=this.jd,b=E.width,z=E.height;(b===y||isNaN(b)&&isNaN(y))&&(z===x||isNaN(z)&&isNaN(x))||(this.jd=a=a.J(),this.v(),this instanceof fr&&this.qc(),this.g("desiredSize",E,a),Ua(this)&&(a=this.part,a!==null&&(Ho(this,a,"width"),Ho(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 nn(a,this.jd.height).freeze(),this.v(),this instanceof fr&&this.qc(),this.g("desiredSize",y,a),Ua(this)&&(a=this.part,a!==null&&Ho(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 nn(this.jd.width,a).freeze(),this.v(),this instanceof fr&&this.qc(),this.g("desiredSize",y,a),Ua(this)&&(a=this.part,a!==null&&Ho(this,a,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:Ni},set:function(a){var y=this.minSize;y.D(a)||(a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),xr(this),this.A.u=a,this.v(),this.g("minSize",y,a))}},maxSize:{get:function(){return this.A!==null?this.A.o:to},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(),xr(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 or(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&&Wa(this),this.Ab}},oe:{get:function(){return this.l&4096&&Wa(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(a){this.animationTriggers!==a&&(xr(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:ln},set:function(a){this.reshapingBehavior!==a&&(xr(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()&&Gt("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Jb=a=a.J(),ys(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&&En(a,">= 0",fe,"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&&En(a,">= 1",fe,"columnSpan"),xr(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&&En(a,">= 0",fe,"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&&En(a,">= 1",fe,"rowSpan"),xr(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&&(xr(this),this.A.Di=a,this.v(),this.g("spanAllocation",y,a))}},alignmentFocus:{get:function(){return this.sk},set:function(a){var y=this.sk;y.D(a)||(this.sk=a=a.J(),this.v(),this.g("alignmentFocus",y,a))}},portId:{get:function(){return this.Yn},set:function(a){var y=this.Yn;if(y!==a){var x=this.part;x===null||x instanceof qn||Gt("Cannot set portID on a Link: "+a),y!==null&&x!==null&&Gv(x,this),this.Yn=a,a!==null&&x!==null&&(x.Te=!0,K1(x,this)),this.g("portId",y,a)}}},toSpot:{get:function(){return this.ba!==null?this.ba.yj: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),Xd(this))}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:10},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&En(a,">= 0",fe,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),Xd(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),Xd(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&&En(a,">= 0",fe,"toMaxLinks"),this.Xc(),this.ba.Ur=a,this.g("toMaxLinks",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),Xd(this))}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:10},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&En(a,">= 0",fe,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),Xd(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),Xd(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&&En(a,">= 0",fe,"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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(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&&(xr(this),this.A.Ch=a,this.g("contextMenu",y,a))}}}),fe.prototype.trigger=fe.prototype.Jv,fe.prototype.findBindingPanel=fe.prototype.ih,fe.prototype.findTemplateBinder=fe.prototype.pz,fe.prototype.setProperties=fe.prototype.nm,fe.prototype.apply=fe.prototype.apply,fe.prototype.attach=fe.prototype.Du,fe.prototype.set=fe.prototype.set,fe.prototype.isEnabledObject=fe.prototype.If,fe.prototype.isVisibleObject=fe.prototype.Ed,fe.prototype.isContainedBy=fe.prototype.rg,fe.prototype.getNearestIntersectionPoint=fe.prototype.rs,fe.prototype.getLocalPoint=fe.prototype.qs,fe.prototype.getDocumentScale=fe.prototype.Df,fe.prototype.getDocumentAngle=fe.prototype.li,fe.prototype.getDocumentBounds=fe.prototype.mi,fe.prototype.getDocumentPoint=fe.prototype.ga,fe.prototype.intersectsRect=fe.prototype.Yc,fe.prototype.containedInRect=fe.prototype.fh,fe.prototype.containsRect=fe.prototype.Re,fe.prototype.containsPoint=fe.prototype.ca,fe.prototype.raiseChanged=fe.prototype.g,fe.prototype.raiseChangedEvent=fe.prototype.cb,fe.prototype.addCopyProperty=fe.prototype.Vw;var Mf=null;fe.className="GraphObject",Mf=new Be,Bh("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=Cl(Pn,Pn.Auto,{isActionable:!0,enabledChanged:function(x,E){if(x instanceof Pn){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"},Cl(fr,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new gi(0,0,2.76142374915397,2.761423749153969),spot2:new gi(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 Pn&&(x=E.fb("ButtonBorder"),x instanceof fr)){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 Pn&&(x=E.fb("ButtonBorder"),x instanceof fr&&(x.fill=E._buttonFillNormal,x.stroke=E._buttonStrokeNormal))},y.actionDown=function(x,E){if(E.If()&&E instanceof Pn&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof fr){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 Pn&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof fr){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 Pn&&E._buttonFillPressed!==null){var b=E.fb("ButtonBorder");if(b instanceof fr){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 Pn&&E._buttonFillPressed!==null){var b=x.diagram;if(b.firstInput.button===0&&(b.currentTool.standardMouseOver(),a(x,E)&&(x=E.fb("ButtonBorder"),x instanceof fr))){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}),Bh("TreeExpanderButton",function(){var a=Cl("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Cl(fr,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:cr},new la("figure","isTreeExpanded",function(y,x){return x=x.panel,y?x._treeExpandedFigure:x._treeCollapsedFigure}).cp()),{visible:!1},new la("visible","isTreeLeaf",function(y){return!y}).cp());return a.click=function(y,x){if(x=x.part,x instanceof Qr&&(x=x.adornedPart),x instanceof qn){var E=x.diagram;if(E!==null){if(E=E.commandHandler,x.isTreeExpanded){if(!E.canCollapseTree(x))return}else if(!E.canExpandTree(x))return;y.handled=!0,x.isTreeExpanded?E.collapseTree(x):E.expandTree(x)}}},a}),Bh("SubGraphExpanderButton",function(){var a=Cl("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Cl(fr,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:cr},new la("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 Qr&&(x=x.adornedPart),x instanceof rr){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}),Bh("ToolTip",function(){return Cl(Qr,Pn.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new At(0,3),shadowBlur:5},Cl(fr,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new gi(0,0,4,6),spot2:new gi(1,1,-4,-4)}))}),Bh("ContextMenu",function(){return Cl(Qr,Pn.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new At(0,3),shadowBlur:5},new la("background","",function(a){return a.adornedPart!==null&&a.placeholder!==null?null:"#F5F5F5"}))}),Bh("ContextMenuButton",function(){var a=Cl("Button");a.stretch=Mi;var y=a.fb("ButtonBorder");return y instanceof fr&&(y.figure="Rectangle",y.strokeWidth=0,y.spot1=new gi(0,0,2,3),y.spot2=new gi(1,1,-2,-2)),a}),Bh("PanelExpanderButton",function(a){var y=hm(a,"COLLAPSIBLE"),x=Cl("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},Cl(fr,{name:"ButtonIcon",strokeWidth:2},new la("geometryString","visible",function(E){return E?x._buttonExpandedFigure:x._buttonCollapsedFigure}).cp(y)));return a=x.fb("ButtonBorder"),a instanceof fr&&(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}),Bh("CheckBoxButton",function(a){var y=hm(a);return a=Cl("Button",{desiredSize:new nn(14,14)},Cl(fr,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:yn,geometryStretch:wi,visible:!1},y!==""?new la("visible",y).Kx():[])),a.click=function(x,E){if(E instanceof Pn){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}),Bh("CheckBox",function(a){a=hm(a),a=Cl("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new or(0,1,0,0)});var y=Cl(Pn,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new or(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}),fe.None=ln=new en(fe,"None",0),fe.Default=sr=new en(fe,"Default",0),fe.Vertical=Ri=new en(fe,"Vertical",4),fe.Horizontal=Mi=new en(fe,"Horizontal",5),fe.Fill=yn=new en(fe,"Fill",3),fe.Uniform=wi=new en(fe,"Uniform",1),fe.UniformToFill=Hr=new en(fe,"UniformToFill",2),fe.FlipVertical=Pr=new en(fe,"FlipVertical",1),fe.FlipHorizontal=Ur=new en(fe,"FlipHorizontal",2),fe.FlipBoth=Lo=new en(fe,"FlipBoth",3),fe.make=Cl,fe.getBuilders=function(){var a=new Be,y;for(y in Mf)if(y!==y.toLowerCase()){var x=Mf.I(y);typeof x=="function"&&a.add(y,x)}return a.freeze(),a},fe.defineBuilder=Bh,fe.build=function(a,y,x){for(var E=[],b=2;b<arguments.length;++b)E[b-2]=arguments[b];if(b=Mf.I(a),typeof b=="function"&&(E=b([a].concat(E)),E instanceof fe))return y&&E.set(y),E;Gt('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')},fe.takeBuilderArgument=hm;function Oc(){this.nc=!1,this.xa="",this.zp=-1,this.nb=this.wm=this.te=null,this.j="",this.hb=this.Di=this.Hb=this.Ch=this.$h=this.F=this.Ha=this.ia=this.V=this.Lh=this.Xd=this.Of=this.Nh=this.Oh=this.Qh=this.Ph=this.Mh=this.Bh=this.Fh=this.zh=null,this.u=Ni,this.o=to,this.hg=sr,this.ob=this.Bi=1,this.Pf=ln,this.Pc=this.Ci=this.gd=null,this.Oc="category"}Oc.prototype.copy=function(){var a=new Oc;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 dd(){this.u=-1/0,this.o=0,this.F=jn,this.rr=ws,this.j=this.V="None"}dd.prototype.copy=function(){var a=new dd;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},dd.className="LinkElementSettings";function Kg(){this.yj=this.Xi=xa,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}Kg.prototype.copy=function(){var a=new Kg;return a.Xi=this.Xi.J(),a.yj=this.yj.J(),a.Vi=this.Vi,a.wj=this.wj,a.Wi=this.Wi,a.xj=this.xj,a.hq=this.hq,a.Tr=this.Tr,a.iq=this.iq,a.Ur=this.Ur,a},Kg.className="LinkSettings";function Jd(){this.ha=[1,0,0,1,0,0]}Jd.prototype.copy=function(){var a=new Jd;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},Jd.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},Jd.prototype.scale=function(a,y){this.ha[0]*=a,this.ha[1]*=a,this.ha[2]*=y,this.ha[3]*=y},Jd.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)}},Jd.className="STransform";function Ic(a){this.type=a,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}Ic.prototype.addColorStop=function(a,y){this.gx.push({offset:a,color:y})},Ic.className="SGradient";function bu(a,y,x){this.ownerDocument=a=y===void 0?qe.document:y,this.cA="http://www.w3.org/2000/svg",a!==void 0&&(this.Oa=this.Ud("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink")),this.hs=null,this.context=new Qs(this,x)}bu.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},bu.prototype.Ud=function(a,y,x){if(a=this.ownerDocument.createElementNS(this.cA,a),Re(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},bu.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},bu.prototype.focus=function(){this.Oa.focus()},bu.prototype.mx=function(){this.ownerDocument=null},Se.Object.defineProperties(bu.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}}}),bu.className="SVGSurface";function Qs(a,y){this.Gv=a,this.svg=a.Oa,this.stack=[],this.nh=[],this.fillStyle="#000000",this.font="10px sans-serif",this.globalAlpha=1,this.lineCap="butt",this.lineDashOffset=0,this.lineJoin="miter",this.lineWidth=1,this.miterLimit=10,this.shadowBlur=0,this.shadowColor="rgba(0, 0, 0, 0)",this.shadowOffsetY=this.shadowOffsetX=0,this.Il=!1,this.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.Vg=this.Br=this.Ar=0,this.yd=this.ad=null,this.path=[],this.Yl={},this.Ct=!1,this.Yg=null,this.uj=0,this.rb=new Jd,this.j=dm(this),this.Nj=dm(this,"gojs-diagram"),this.Hl=this.ti=null;var x=wo++,E=this.Ud("clipPath",{id:"mainClip"+x});E.appendChild(this.Ud("rect",{x:0,y:0,width:a.width,height:a.height})),this.ww=E,this.svg.appendChild(this.j),this.j.appendChild(this.Nj),this.svg.appendChild(E),this.j.setAttributeNS(null,"clip-path","url(#mainClip"+x+")"),this.eA={},this.isTemporary=!!y,this.filter="",this.bk=null}function Yy(a,y,x,E,b,z,tt){a.Nj===void 0?Ug(a,y,x,E,b,z,tt):a.Nj.setAttribute("transform","matrix("+y+", "+x+", "+E+", "+b+", "+z+", "+tt+")")}wt=Qs.prototype,wt.arc=function(a,y,x,E,b,z,tt,rt){var ot=2*Math.PI,lt=ot-1e-6,ut=x*Math.cos(E),ft=x*Math.sin(E),yt=a+ut,xt=y+ft,Ct=z?0:1;E=z?E-b:b-E,(1e-6<Math.abs(tt-yt)||1e-6<Math.abs(rt-xt))&&this.path.push(["L",yt,+xt]),0>E&&(E=E%ot+ot),E>lt?(this.path.push(["A",x,x,0,1,Ct,a-ut,y-ft]),this.path.push(["A",x,x,0,1,Ct,yt,xt])):1e-6<E&&this.path.push(["A",x,x,0,+(E>=Math.PI),Ct,a+x*Math.cos(b),y+x*Math.sin(b)])},wt.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},wt.Se=function(a){this.addPath(this.path,this.rb,a||0)},wt.bezierCurveTo=function(a,y,x,E,b,z){this.path.push(["C",a,y,x,E,b,z])},wt.clearRect=function(){},wt.clip=function(){this.Yl.clipPath=!0},wt.closePath=function(){this.path.push(["z"])},wt.createLinearGradient=function(a,y,x,E){var b=new Ic("linear");return b.x1=a,b.y1=y,b.x2=x,b.y2=E,b},wt.createPattern=function(a){var y="";a instanceof HTMLCanvasElement&&(y=a.toDataURL()),a instanceof HTMLImageElement&&(y=a.getAttribute("src"));var x=this.eA;if(x[y])return"url(#"+x[y]+")";var E="PATTERN"+wo++,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(Ud,b)),this.svg.appendChild(a),x[y]=E,"url(#"+E+")"},wt.createRadialGradient=function(a,y,x,E,b,z){var tt=new Ic("radial");return tt.x1=a,tt.y1=y,tt.r1=x,tt.x2=E,tt.y2=b,tt.r2=z,tt};function Xy(a,y,x,E,b,z,tt,rt,ot){E=rt/E,b=ot/b,z===0&&tt===0||a.rb.translate(z,tt),E===1&&b===1||a.rb.scale(E,b),y===0&&x===0||a.rb.translate(-y,-x)}wt.drawImage=function(a,y,x,E,b,z,tt,rt,ot){var lt="";a instanceof HTMLCanvasElement&&(lt=a.toDataURL()),a instanceof HTMLImageElement&&(lt=a.getAttribute("src"));var ut=a instanceof HTMLImageElement?a.naturalWidth:a.width;a=a instanceof HTMLImageElement?a.naturalHeight:a.height,E===void 0&&(z=y,tt=x,rt=E=ut,ot=b=a),E=E||0,b=b||0,rt=rt||0,ot=ot||0,Xy(this,y,x,E,b,z||0,tt||0,rt,ot),z={x:0,y:0,width:ut||E,height:a||b,href:lt},_t.$(E,rt)&&_t.$(b,ot)?lt.toLowerCase().indexOf(".svg")===-1&&lt.toLowerCase().indexOf("data:image/svg")===-1&&(z.preserveAspectRatio="xMidYMid slice"):z.preserveAspectRatio="none",(y!==0||x!==0||E!==ut||b!==a)&&(E+=y,b+=x,z["clip-path"]="path('M "+y+","+x+" L "+E+" "+x+" L "+E+" "+b+" L "+y+" "+b+" z')"),kf(this,Ud,z,this.rb),this.addElement(Ud,z)},wt.fill=function(a){a&&(this.Yl["fill-rule"]="evenodd"),iv(this,this.Yl)},wt.ng=function(a,y){this.clipInsteadOfFill?this.clip():this.fill(y)},wt.fillRect=function(a,y,x,E){a=[a,y,x,E],a={x:a[0],y:a[1],width:a[2],height:a[3]},kf(this,"fill",a,this.rb),this.addElement("rect",a)},wt.ox=function(a,y,x,E){a={x:a,y,width:x,height:E},kf(this,"fill",a,this.rb),iv(this,a),this.svg.prepend(this.Ud("rect",a))},wt.fillText=function(a,y,x){a=[a,y,x],y=this.textAlign,y==="left"?y="start":y==="right"?y="end":y==="center"&&(y="middle"),y={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":y},kf(this,"fill",y,this.rb),this.addElement("text",y,a[0])},wt.lineTo=function(a,y){this.path.push(["L",a,y])},wt.moveTo=function(a,y){this.path.push(["M",a,y])},wt.quadraticCurveTo=function(a,y,x,E){this.path.push(["Q",a,y,x,E])},wt.rect=function(a,y,x,E){this.path.push(["M",a,y],["L",a+x,y],["L",a+x,y+E],["L",a,y+E],["z"])},wt.restore=function(){this.rb=this.stack.pop(),this.path=this.stack.pop();var a=this.stack.pop();this.fillStyle=a.fillStyle,this.font=a.font,this.globalAlpha=a.globalAlpha,this.lineCap=a.lineCap,this.lineDashOffset=a.lineDashOffset,this.lineJoin=a.lineJoin,this.lineWidth=a.lineWidth,this.miterLimit=a.miterLimit,this.shadowBlur=a.shadowBlur,this.shadowColor=a.shadowColor,this.shadowOffsetX=a.shadowOffsetX,this.shadowOffsetY=a.shadowOffsetY,this.strokeStyle=a.strokeStyle,this.textAlign=a.textAlign,this.bk=a.bk},wt.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign,bk:this.bk});for(var a=[],y=0;y<this.path.length;y++)a.push(this.path[y]);this.stack.push(a),this.stack.push(this.rb.copy())},wt.setTransform=function(a,y,x,E,b,z){a===1&&y===0&&x===0&&E===1&&b===0&&z===0||Ug(this,a,y,x,E,b,z)};function Jy(a){return a=a.rb.ha,"matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"}wt.scale=function(a,y){this.rb.scale(a,y)},wt.translate=function(a,y){this.rb.translate(a,y)},wt.transform=function(){},wt.yc=function(){},wt.stroke=function(){$y(this,this.Yl)},wt.jk=function(){this.clipInsteadOfFill||this.stroke()},wt.Ud=function(a,y,x){return this.Gv.Ud(a,y,x)},wt.addElement=function(a,y,x){return a=this.Ud(a,y,x),this.yd!==null?this.yd.appendChild(a):this.yd=a,this.ad=a};function kf(a,y,x,E){y==="fill"?iv(a,x):y==="stroke"&&$y(a,x),E!==null&&(a=E.ha,x.transform="matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")")}function iv(a,y){a.fillStyle instanceof Ic?y.fill=rv(a,a.fillStyle,!0):/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),y.fill="rgb("+a[1]+","+a[2]+","+a[3]+")",y["fill-opacity"]=a[4]):y.fill=a.fillStyle}function Qy(a,y,x){x=x?"fill":"stroke",a.fillStyle instanceof Ic?y.setAttributeNS(null,"fill",rv(a,a.fillStyle,!0)):/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),y.setAttributeNS(null,x,"rgb("+a[1]+","+a[2]+","+a[3]+")"),y.setAttributeNS(null,x+"-opacity",a[4])):y.setAttributeNS(null,x,a.fillStyle)}function $y(a,y){if(a.strokeStyle instanceof Ic)y.stroke=rv(a,a.strokeStyle,!1);else if(/^rgba\(/.test(a.strokeStyle)){var x=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle);y.stroke="rgb("+x[1]+","+x[2]+","+x[3]+")",y["stroke-opacity"]=x[4]}else y.stroke=a.strokeStyle;y["stroke-width"]=a.lineWidth,y["stroke-linecap"]=a.lineCap,y["stroke-linejoin"]=a.lineJoin,y["stroke-miterlimit"]=a.miterLimit,a.Ct&&(y["stroke-dasharray"]=a.Yg.toString(),y["stroke-dashoffset"]=a.uj)}function rv(a,y,x){var E="";if(E=a.Hl!==null?a.Hl.getAttribute(x?"fill":"stroke"):null,E!==null&&E.indexOf("GRAD")!==-1?(E=E.split("#")[1].slice(0,-1),x=a.svg.getElementById(E),x!==null&&x.remove()):E="GRAD"+wo++,y.type==="linear")x=a.Ud("linearGradient",{x1:y.x1,x2:y.x2,y1:y.y1,y2:y.y2,id:E,gradientUnits:"userSpaceOnUse"});else if(y.type==="radial")x=a.Ud("radialGradient",{x1:y.x1,x2:y.x2,y1:y.y1,y2:y.y2,r1:y.r1,r2:y.r2,id:E});else throw Error("invalid gradient");var b=y.gx;y=b.length;for(var z=[],tt=0;tt<y;tt++){var rt=b[tt],ot=rt.color;rt={offset:rt.offset,"stop-color":ot},/^rgba\(/.test(ot)&&(ot=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(ot),rt["stop-color"]="rgb("+ot[1]+","+ot[2]+","+ot[3]+")",rt["stop-opacity"]=ot[4]),z.push(rt)}for(z.sort(function(lt,ut){return lt.offset>ut.offset?1:-1}),b=0;b<y;b++)x.appendChild(a.Ud("stop",z[b]));return a.svg.appendChild(x),"url(#"+E+")"}wt.addPath=function(a,y,x){for(var E=[],b=0;b<a.length;b++){var z=Nn(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,kf(this,"",a,y),this.Hl!==null)if(y=this.Hl,y.nodeName!=="g")for(var rt in a)rt!=="transform"&&y.setAttributeNS(null,rt,a[rt]);else{rt=y.getElementsByTagName("path");for(var ot in a)ot!=="transform"&&rt[x].setAttributeNS(null,ot,a[ot])}else this.addElement("path",a)};function Ug(a,y,x,E,b,z,tt){var rt=new Jd;rt.ha=[y,x,E,b,z,tt],y={},kf(a,"g",y,rt),rt=a.addElement("g",y),a.nh.push(rt)}function dm(a,y){var x={};return y&&(x.class=y),y=a.addElement("g",x),a.nh.push(y),y}wt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x};function Wu(a){a.Il=!1,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0}function uh(a){a.Il=!0,a.shadowOffsetX=a.Ar,a.shadowOffsetY=a.Br,a.shadowBlur=a.Vg}wt.js=function(a,y){this.Ct=!0,this.Yg=a,this.uj=y},wt.fs=function(){this.Ct=!1},wt.Vc=function(){},wt.Wx=function(){},Qs.prototype.rotate=function(a){this.rb.rotate(57.2958*a,0,0)},Qs.prototype.getImageData=function(){return null},Qs.prototype.measureText=function(){return null};function cm(a,y){y=y.getAttribute("fill"),y!==null&&(y=y.split("#"),y.length!==1&&(y=a.svg.getElementById(y[1].slice(0,-1)),y!==null&&a.svg.innerHTML.match(new RegExp(y.id,"g")).length===1&&y.remove()))}Qs.prototype.Hs=function(a){a.svg!==null&&a.svg.parentNode===this.Nj&&a.svg.remove()},Qs.className="SVGContext",be.prototype.Cs=function(a){this.pj.contains("SVG")||this.bs("SVG",new bu(this,qe.document));var y=new bu(this,qe.document,!0);a===void 0&&(a=new bi);var x=this;return bc(this,function(E,b){return E=am(x,E,"SVG",y),E=E!==null?E.svg:null,typeof b=="function"?(b(E),null):E},a)},be.prototype.makeSvg=be.prototype.Cs,be.prototype.av=function(a){return this.Cs(a)},be.prototype.makeSVG=be.prototype.av;function Rl(a,y,x,E){this.ownerDocument=y=y===void 0?qe.document:y,this.hs=null,y=y.createElement("canvas"),y.tabIndex=0,this.Oa=y,this.context=new Qd(y,x,E),y.H=a}Rl.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},Rl.prototype.toDataURL=function(a,y){return this.Oa.toDataURL(a,y)},Rl.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},Rl.prototype.focus=function(){this.Oa.focus()},Rl.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},Se.Object.defineProperties(Rl.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}}}),Rl.className="CanvasSurface";function Qd(a,y,x){this.Z=a.getContext?a.getContext("2d",y):null,this.Z===null&&Gt("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 ae,this.isTemporary=!!x}wt=Qd.prototype,wt.Wx=function(a){this.Z.imageSmoothingEnabled=a},wt.arc=function(a,y,x,E,b,z){this.Z.arc(a,y,x,E,b,z)},wt.beginPath=function(){this.Z.beginPath()},wt.Se=function(){},wt.bezierCurveTo=function(a,y,x,E,b,z){this.Z.bezierCurveTo(a,y,x,E,b,z)},wt.clearRect=function(a,y,x,E){this.yc(),this.Z.clearRect(a,y,x,E)},wt.clip=function(){this.Z.clip()},wt.closePath=function(){this.Z.closePath()},wt.createLinearGradient=function(a,y,x,E){return this.Z.createLinearGradient(a,y,x,E)},wt.createPattern=function(a,y){return this.Z.createPattern(a,y)},wt.createRadialGradient=function(a,y,x,E,b,z){return this.Z.createRadialGradient(a,y,x,E,b,z)},wt.drawImage=function(a,y,x,E,b,z,tt,rt,ot){E===void 0?this.Z.drawImage(a,y,x):this.Z.drawImage(a,y,x,E,b,z,tt,rt,ot)},wt.fill=function(a){this.Z.fill(a?"evenodd":"nonzero")},wt.fillRect=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},wt.ox=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},wt.fillText=function(a,y,x){this.Z.fillText(a,y,x)},wt.getImageData=function(a,y,x,E){return this.Z.getImageData(a,y,x,E)},wt.lineTo=function(a,y){this.Z.lineTo(a,y)},wt.measureText=function(a){return this.Z.measureText(a)},wt.moveTo=function(a,y){this.Z.moveTo(a,y)},wt.quadraticCurveTo=function(a,y,x,E){this.Z.quadraticCurveTo(a,y,x,E)},wt.rect=function(a,y,x,E){this.Z.rect(a,y,x,E)},wt.restore=function(){this.Z.restore()},wt.save=function(){this.yc(),this.Z.save()},Qd.prototype.rotate=function(a){this.El.rotate(57.2958*a,0,0)},wt=Qd.prototype,wt.setTransform=function(a,y,x,E,b,z){this.El.setTransform(a,y,x,E,b,z)},wt.scale=function(a,y){this.El.scale(a,y)},wt.translate=function(a,y){this.El.translate(a,y)},wt.stroke=function(){this.Z.stroke()},wt.transform=function(a,y,x,E,b,z){if(a!==1||y!==0||x!==0||E!==1||b!==0||z!==0){var tt=this.El,rt=tt.m11*a+tt.m21*y;a=tt.m12*a+tt.m22*y,y=tt.m11*x+tt.m21*E,x=tt.m12*x+tt.m22*E,tt.dx=tt.m11*b+tt.m21*z+tt.dx,tt.dy=tt.m12*b+tt.m22*z+tt.dy,tt.m11=rt,tt.m12=a,tt.m21=y,tt.m22=x}},wt.yc=function(){var a=this.El;this.Z.setTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy)},wt.ng=function(a,y){if(a instanceof So&&a.type===El){var x=a.yk;a=a.ft,a>x?(this.scale(x/a,1),this.translate((a-x)/2,0)):x>a&&(this.scale(1,a/x),this.translate(0,(x-a)/2)),this.Hm?this.clip():this.fill(y),a>x?(this.translate(-(a-x)/2,0),this.scale(1/(x/a),1)):x>a&&(this.translate(0,-(x-a)/2),this.scale(1,1/(a/x)))}else this.Hm?this.clip():this.fill(y)},wt.jk=function(){this.Hm||this.stroke()},wt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x},wt.js=function(a,y){var x=this.Z;x.setLineDash!==void 0&&(x.setLineDash(a),x.lineDashOffset=y)},wt.fs=function(){var a=this.Z;a.setLineDash!==void 0&&(a.setLineDash(mx),a.lineDashOffset=0)},wt.Vc=function(a){a&&(this.dt=""),this.ct=this.et=""},wt.Hs=function(){},Se.Object.defineProperties(Qd.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([]);Qd.className="CanvasSurfaceContext";function Yg(){this.F=this.o=this.u=this.j=0}Yg.className="ColorNumbers";function So(a,y){Af||(hv(),Af=!0),Wi(this),this._isFrozen=!1,a===void 0?(this.na=Ah,this.xk="black"):typeof a=="string"?(this.na=Ah,this.xk=a):(this.na=a,this.xk="black"),a=this.na,a===dh?(this.Qd=qr,this.Lk=Yo):this.Lk=a===El?this.Qd=dr:this.Qd=lr,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,y&&Object.assign(this,y)}So.prototype.copy=function(){var a=new So;return a.na=this.na,a.xk=this.xk,a.Qd=this.Qd.J(),a.Lk=this.Lk.J(),a.Gr=this.Gr,a.Xp=this.Xp,this.we!==null&&(a.we=this.we.copy()),a.cr=this.cr,a},wt=So.prototype,wt.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},wt.ka=function(){return Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},wt.qb=function(a){a.classType===So&&(this.type=a)},wt.toString=function(){var a="Brush(";if(this.type===Ah)a+=this.color;else if(a=this.type===dh?a+"Linear ":this.type===El?a+"Radial ":this.type===Tf?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,this.colorStops!==null)for(var y=this.colorStops.iterator;y.next();)a+=" "+y.key+":"+y.value;return a+")"},wt.addColorStop=function(a,y){return this._isFrozen&&me(this),(typeof a!="number"||!isFinite(a)||1<a||0>a)&&En(a,"0 <= loc <= 1",So,"addColorStop:loc"),this.we===null&&(this.we=new Be),this.we.add(a,y),this.na===Ah&&(this.type=dh),this.xe=null,this},wt.Vz=function(a,y){if(this._isFrozen&&me(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?Df:y,this.type===Ah)hh(this.color),this.color=Nf(a,y);else if((this.type===dh||this.type===El)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)hh(x.value),this.addColorStop(x.key,Nf(a,y));return this};function qy(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?Df:x,hh(a),Nf(y,x)}wt.Wy=function(a,y){if(this._isFrozen&&me(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?Df:y,this.type===Ah)hh(this.color),this.color=Nf(-a,y);else if((this.type===dh||this.type===El)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)hh(x.value),this.addColorStop(x.key,Nf(-a,y));return this};function t1(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?Df:x,hh(a),Nf(-y,x)}function ov(a,y,x){hh(a),a=Io.j;var E=Io.u,b=Io.o,z=Io.F;return hh(y),x===void 0&&(x=.5),"rgba("+Math.round((Io.j-a)*x+a)+", "+Math.round((Io.u-E)*x+E)+", "+Math.round((Io.o-b)*x+b)+", "+Math.round((Io.F-z)*x+z)+")"}wt.Gx=function(){if(this.type===Ah)return bf(this.color);if((this.type===dh||this.type===El)&&this.colorStops!==null){var a=this.colorStops;if(this.type===El)return bf(a.first().value);if(a.get(.5)!==null)return bf(a.get(.5));if(a.count===2)return a=a.Fa(),bf(ov(a[0].value,a[1].value));for(var y=a.iterator,x=-1,E=-1,b=1,z=1;y.next();){var tt=y.key,rt=Math.abs(.5-y.key);b>z&&rt<b?(x=tt,b=rt):z>=b&&rt<z&&(E=tt,z=rt)}return x>E&&(z=x,x=E,E=z,z=b),b=E-x,bf(ov(a.get(x),a.get(E),1-z/b))}return!1};function bf(a){return a?a instanceof So?a.Gx():(hh(a),128>(299*Io.j+587*Io.u+114*Io.o)/1e3):!1}function Nf(a,y){switch(y){case Df:y=100*sv(Io.j);var x=100*sv(Io.u),E=100*sv(Io.o);return xs.j=.4124564*y+.3575761*x+.1804375*E,xs.u=.2126729*y+.7151522*x+.072175*E,xs.o=.0193339*y+.119192*x+.9503041*E,xs.F=Io.F,y=uv(xs.j/Bf[0]),x=uv(xs.u/Bf[1]),E=uv(xs.o/Bf[2]),Vu.j=116*x-16,Vu.u=500*(y-x),Vu.o=200*(x-E),Vu.F=xs.F,Vu.j=Math.min(100,Math.max(0,Vu.j+100*a)),a=(Vu.j+16)/116,y=a-Vu.o/200,xs.j=Bf[0]*e1(Vu.u/500+a),xs.u=Bf[1]*(Vu.j>fm*dv?Math.pow(a,3):Vu.j/fm),xs.o=Bf[2]*e1(y),xs.F=Vu.F,a=-.969266*xs.j+1.8760108*xs.u+.041556*xs.o,y=.0556434*xs.j+-.2040259*xs.u+1.0572252*xs.o,Io.j=255*lv((3.2404542*xs.j+-1.5371385*xs.u+-.4985314*xs.o)/100),Io.u=255*lv(a/100),Io.o=255*lv(y/100),Io.F=xs.F,Io.j=Math.round(Io.j),255<Io.j?Io.j=255:0>Io.j&&(Io.j=0),Io.u=Math.round(Io.u),255<Io.u?Io.u=255:0>Io.u&&(Io.u=0),Io.o=Math.round(Io.o),255<Io.o?Io.o=255:0>Io.o&&(Io.o=0),"rgba("+Io.j+", "+Io.u+", "+Io.o+", "+Io.F+")";case n1:return av(),hl.o=Math.min(100,Math.max(0,hl.o+100*a)),"hsla("+hl.j+", "+hl.u+"%, "+hl.o+"%, "+hl.F+")";default:Gt("Unknown color space: "+y)}}function hh(a){Af||(hv(),Af=!0);var y=cv;if(y!==null){y.clearRect(0,0,1,1),y.fillStyle="#000000";var x=y.fillStyle;y.fillStyle=a,y.fillStyle!==x?(y.fillRect(0,0,1,1),a=y.getImageData(0,0,1,1).data,Io.j=a[0],Io.u=a[1],Io.o=a[2],Io.F=a[3]/255):(y.fillStyle="#FFFFFF",y.fillStyle=a,Io.j=0,Io.u=0,Io.o=0,Io.F=1)}}function av(){var a=Io.j/255,y=Io.u/255,x=Io.o/255,E=Math.max(a,y,x),b=Math.min(a,y,x),z=E-b;if(b=(E+b)/2,z===0)var tt=a=0;else{switch(E){case a:tt=(y-x)/z%6;break;case y:tt=(x-a)/z+2;break;case x:tt=(a-y)/z+4}tt*=60,0>tt&&(tt+=360),a=z/(1-Math.abs(2*b-1))}hl.j=Math.round(tt),hl.u=Math.round(100*a),hl.o=Math.round(100*b),hl.F=Io.F}function sv(a){return a/=255,.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function lv(a){return .0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}function uv(a){return a>dv?Math.pow(a,1/3):(fm*a+16)/116}function e1(a){var y=a*a*a;return y>dv?y:(116*a-16)/fm}function _c(a,y){typeof a!="string"&&(a instanceof So||Gt("Value for "+y+" must be a color string or a Brush, not "+a))}function hv(){cv=Qo?new Rl(null,void 0,{willReadFrequently:!0}).context:null}Se.Object.defineProperties(So.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&me(this,a),this.na=a,this.start.Mc()&&(a===dh?this.start=qr:a===El&&(this.start=dr)),this.end.Mc()&&(a===dh?this.end=Yo:a===El&&(this.end=dr)),this.xe=null}},color:{get:function(){return this.xk},set:function(a){this._isFrozen&&me(this,a),this.xk=a,this.xe=null}},start:{get:function(){return this.Qd},set:function(a){this._isFrozen&&me(this,a),this.Qd=a.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(a){this._isFrozen&&me(this,a),this.Lk=a.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(a){this._isFrozen&&me(this,a),0>a&&En(a,">= zero",So,"startRadius"),this.Gr=a,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(a){this._isFrozen&&me(this,a),0>a&&En(a,">= zero",So,"endRadius"),this.Xp=a,this.xe=null}},colorStops:{get:function(){return this.we},set:function(a){this._isFrozen&&me(this,a),this.we=a,this.xe=null}},pattern:{get:function(){return this.cr},set:function(a){this._isFrozen&&me(this,a),this.cr=a,this.xe=null}}}),So.prototype.isDark=So.prototype.Gx,So.prototype.darkenBy=So.prototype.Wy,So.prototype.lightenBy=So.prototype.Vz,So.prototype.addColorStop=So.prototype.addColorStop;var dv=216/24389,fm=24389/27,Bf=[95.047,100,108.883],cv=null,Io=new Yg,hl=new Yg,xs=new Yg,Vu=new Yg,Af=!1;So.className="Brush";var Ah;So.Solid=Ah=new en(So,"Solid",0);var dh;So.Linear=dh=new en(So,"Linear",1);var El;So.Radial=El=new en(So,"Radial",2);var Tf;So.Pattern=Tf=new en(So,"Pattern",4);var Df;So.Lab=Df=new en(So,"Lab",5);var n1;So.HSL=n1=new en(So,"HSL",6),So.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},So.isValidColor=function(a){if(a==="black")return!0;if(a==="")return!1;Af||(hv(),Af=!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)},So.lighten=function(a){return qy(a)},So.lightenBy=qy,So.darken=function(a){return t1(a)},So.darkenBy=t1,So.mix=ov,So.isDark=bf;function wa(){this.xa="Base"}wa.prototype.measure=function(){},wa.prototype.Yz=function(a,y,x,E,b){a.measure(y,x,E,b)},wa.prototype.arrange=function(){},wa.prototype.Ly=function(a,y,x,E,b,z){a.arrange(y,x,E,b,z)},wa.prototype.iA=function(a){a.Uj()},wa.prototype.gc=function(){},Se.Object.defineProperties(wa.prototype,{name:{get:function(){return this.xa},set:function(a){this.xa=a}},classType:{get:function(){return Pn}}}),wa.prototype.remeasureObject=wa.prototype.iA,wa.prototype.arrangeElement=wa.prototype.Ly,wa.prototype.measureElement=wa.prototype.Yz,wa.className="PanelLayout";function gm(){this.xa="Base"}Le(gm,wa),gm.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length;a=ch(a);for(var ot=0;ot<rt;ot++){var lt=E[ot];if(lt.visible||lt===a){var ut=lt.margin,ft=ut.right+ut.left;ut=ut.top+ut.bottom,lt.measure(y,x,z,tt);var yt=lt.measuredBounds;ft=Math.max(yt.width+ft,0),ut=Math.max(yt.height+ut,0),yt=lt.position.x;var xt=lt.position.y;isFinite(yt)||(yt=0),isFinite(xt)||(xt=0),lt instanceof fr&&lt.isGeometryPositioned&&(lt=lt.strokeWidth/2,yt-=lt,xt-=lt),zr(b,yt,xt,ft,ut)}}},gm.prototype.arrange=function(a,y,x){var E=y.length,b=a.padding;for(a=x.x-b.left,x=x.y-b.top,b=0;b<E;b++){var z=y[b],tt=z.measuredBounds,rt=z.margin,ot=z.position.x,lt=z.position.y;if(ot=isNaN(ot)?-a:ot-a,lt=isNaN(lt)?-x:lt-x,z instanceof fr&&z.isGeometryPositioned){var ut=z.strokeWidth/2;ot-=ut,lt-=ut}z.visible&&z.arrange(ot+rt.left,lt+rt.top,tt.width,tt.height)}};function pm(){this.xa="Base"}Le(pm,wa),pm.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length;y=Jn(),z=ch(a);for(var ot=0;ot<rt;ot++){var lt=E[ot];if(lt.visible||lt===z){var ut=Ts(lt,!1);if(ut!==ln&&ut!==Mi)y.push(lt);else{lt.measure(1/0,x,0,tt),ut=lt.margin,lt=lt.measuredBounds;var ft=Math.max(lt.height+ut.top+ut.bottom,0);b.width+=Math.max(lt.width+ut.right+ut.left,0),b.height=Math.max(b.height,ft)}}}for(E=y.length,a.desiredSize.height?x=Math.min(a.desiredSize.height,a.maxSize.height):b.height!==0&&(x=Math.min(b.height,a.maxSize.height)),a=0;a<E;a++)ot=y[a],(ot.visible||ot===z)&&(ut=ot.margin,rt=ut.right+ut.left,ut=ut.top+ut.bottom,ot.measure(1/0,x,0,tt),ot=ot.measuredBounds,ut=Math.max(ot.height+ut,0),b.width+=Math.max(ot.width+rt,0),b.height=Math.max(b.height,ut));li(y)},pm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.top,tt=a.isOpposite,rt=tt?x.width:b.left,ot=0;ot<E;ot++){var lt=z,ut=y[ot];if(ut.visible){var ft=ut.measuredBounds,yt=ut.margin,xt=yt.top+yt.bottom,Ct=z+b.bottom,bt=ft.height,Vt=Ts(ut,!1);(isNaN(ut.desiredSize.height)&&Vt===yn||Vt===Ri)&&(bt=Math.max(x.height-xt-Ct,0)),xt=bt+xt+Ct,Ct=ut.alignment,Ct.Xb()&&(Ct=a.defaultAlignment),Ct.sb()||(Ct=dr),tt&&(rt-=ft.width+yt.left+yt.right),ut.arrange(rt+Ct.offsetX+yt.left,lt+Ct.offsetY+yt.top+(x.height*Ct.y-xt*Ct.y),ft.width,bt),tt||(rt+=ft.width+yt.left+yt.right)}}};function mm(){this.xa="Base"}Le(mm,wa),mm.prototype.measure=function(a,y,x,E,b,z){var tt=E.length;x=Jn();for(var rt=ch(a),ot=0;ot<tt;ot++){var lt=E[ot];if(lt.visible||lt===rt){var ut=Ts(lt,!1);if(ut!==ln&&ut!==Ri)x.push(lt);else{var ft=lt.margin;ut=ft.right+ft.left,ft=ft.top+ft.bottom,lt.measure(y,1/0,z,0),lt=lt.measuredBounds,ao(b,Math.max(b.width,Math.max(lt.width+ut,0)),b.height+Math.max(lt.height+ft,0))}}}if(E=x.length,E!==0){for(a.desiredSize.width?y=Math.min(a.desiredSize.width,a.maxSize.width):b.width!==0&&(y=Math.min(b.width,a.maxSize.width)),a=0;a<E;a++)ot=x[a],(ot.visible||ot===rt)&&(lt=ot.margin,tt=lt.right+lt.left,lt=lt.top+lt.bottom,ot.measure(y,1/0,z,0),ot=ot.measuredBounds,lt=Math.max(ot.height+lt,0),b.width=Math.max(b.width,Math.max(ot.width+tt,0)),b.height+=lt);li(x)}},mm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.left,tt=a.isOpposite,rt=tt?x.height:b.top,ot=0;ot<E;ot++){var lt=z,ut=y[ot];if(ut.visible){var ft=ut.measuredBounds,yt=ut.margin,xt=yt.left+yt.right,Ct=z+b.right,bt=ft.width,Vt=Ts(ut,!1);(isNaN(ut.desiredSize.width)&&Vt===yn||Vt===Mi)&&(bt=Math.max(x.width-xt-Ct,0)),xt=bt+xt+Ct,Ct=ut.alignment,Ct.Xb()&&(Ct=a.defaultAlignment),Ct.sb()||(Ct=dr),tt&&(rt-=ft.height+yt.bottom+yt.top),ut.arrange(lt+Ct.offsetX+yt.left+(x.width*Ct.x-xt*Ct.x),rt+Ct.offsetY+yt.top,bt,ft.height),tt||(rt+=ft.height+yt.bottom+yt.top)}}};function vm(){this.xa="Base"}Le(vm,wa),vm.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length,ot=a.Pb(),lt=ot.margin,ut=lt.right+lt.left,ft=lt.top+lt.bottom;ot.measure(y,x,z,tt);var yt=ot.measuredBounds;z=yt.width,tt=yt.height;var xt=Math.max(z+ut,0),Ct=Math.max(tt+ft,0),bt=a.isClipping,Vt=Te.allocAt(-lt.left,-lt.top,xt,Ct),zt=Te.allocAt(0,0,z,tt);fv(ot,zt,!0),z=zt.width,tt=zt.height;for(var $t=!0,ie=ch(a),oe=0;oe<rt;oe++){var de=E[oe];yt=y;var ke=x;if(de!==ot&&(de.visible||de===ie)){lt=de.margin;var Hn=lt.left,ci=lt.top;switch(xt=lt.right+lt.left,Ct=lt.top+lt.bottom,lt=Ts(de,!1),lt){case yn:yt=z,ke=tt,ci=Hn=Ct=xt=0;break;case Mi:yt=z,Hn=xt=0;break;case Ri:ke=tt,ci=Ct=0}de.measure(yt,ke,0,0),yt=de.measuredBounds,xt=Math.max(yt.width+xt,0),Ct=Math.max(yt.height+Ct,0),lt=de.alignment,lt.Xb()&&(lt=a.defaultAlignment),lt.sb()||(lt=dr);var ai=de.alignmentFocus;if(ai.Xb()&&(ai=dr),ke=null,de instanceof Pn&&de.$e!==""&&(ke=de.fb(de.$e),ke===de&&(ke=null)),Hn=zt.x-Hn,ci=zt.y-ci,ke!==null){for(de.arrange(0,0,yt.width,yt.height),yt=ke.actualBounds,yt=At.allocAt(yt.x+(ai.x*yt.width-ai.offsetX),yt.y+(ai.y*yt.height-ai.offsetY)),ke=ke.panel;ke!==de;)ke.transform.Ga(yt),ke=ke.panel;Hn+=lt.x*z+lt.offsetX-yt.x,ci+=lt.y*tt+lt.offsetY-yt.y,At.free(yt)}else Hn+=lt.x*z+lt.offsetX-(ai.x*yt.width+ai.offsetX),ci+=lt.y*tt+lt.offsetY-(ai.y*yt.height+ai.offsetY);$t?($t=!1,b.h(Hn,ci,xt,Ct)):zr(b,Hn,ci,xt,Ct)}}switch($t?b.assign(Vt):bt?b.Uu(zt.x,zt.y,zt.width,zt.height):zr(b,Vt.x,Vt.y,Vt.width,Vt.height),Te.free(Vt),Te.free(zt),lt=ot.stretch,lt===sr&&(lt=Ts(ot,!1)),lt){case ln:return;case yn:if(!isFinite(y)&&!isFinite(x))return;break;case Mi:if(!isFinite(y))return;break;case Ri:if(!isFinite(x))return}for(yt=ot.measuredBounds,z=yt.width,tt=yt.height,xt=Math.max(z+ut,0),Ct=Math.max(tt+ft,0),lt=ot.margin,zt=Te.allocAt(-lt.left,-lt.top,xt,Ct),fv(ot,zt,!0),z=zt.width,tt=zt.height,y=0;y<rt;y++)x=E[y],x===ot||!x.visible&&x!==ie||(lt=x.margin,xt=lt.right+lt.left,Ct=lt.top+lt.bottom,yt=x.measuredBounds,xt=Math.max(yt.width+xt,0),Ct=Math.max(yt.height+Ct,0),ut=x.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=dr),x=x.alignmentFocus,x.Xb()&&(x=dr),$t?($t=!1,b.h(ut.x*z+ut.offsetX-(x.x*yt.width+x.offsetX)-lt.left,ut.y*tt+ut.offsetY-(x.y*yt.height+x.offsetY)-lt.top,xt,Ct)):zr(b,ut.x*z+ut.offsetX-(x.x*yt.width+x.offsetX)-lt.left,ut.y*tt+ut.offsetY-(x.y*yt.height+x.offsetY)-lt.top,xt,Ct));$t?b.assign(Vt):bt?b.Uu(zt.x,zt.y,zt.width,zt.height):zr(b,Vt.x,Vt.y,Vt.width,Vt.height),Te.free(zt)},vm.prototype.arrange=function(a,y,x){var E=y.length,b=a.Pb(),z=b.measuredBounds,tt=z.width,rt=z.height,ot=a.padding;z=ot.left,ot=ot.top;var lt=z-x.x,ut=ot-x.y;for(b.arrange(lt,ut,tt,rt),tt=Te.allocAt(0,0,tt,rt),fv(b,tt,!1),rt=0;rt<E;rt++){var ft=y[rt];if(ft!==b){lt=ft.measuredBounds;var yt=lt.width,xt=lt.height;ut=ft.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=dr);var Ct=ft.alignmentFocus;if(Ct.Xb()&&(Ct=dr),lt=null,ft instanceof Pn&&ft.$e!==""&&(lt=ft.fb(ft.$e),lt===ft&&(lt=null)),lt!==null){var bt=lt.actualBounds;for(Ct=At.allocAt(bt.x+(Ct.x*bt.width-Ct.offsetX),bt.y+(Ct.y*bt.height-Ct.offsetY)),lt=lt.panel;lt!==ft;)lt.transform.Ga(Ct),lt=lt.panel;lt=ut.x*tt.width+ut.offsetX-Ct.x,ut=ut.y*tt.height+ut.offsetY-Ct.y,At.free(Ct)}else lt=ut.x*tt.width+ut.offsetX-(Ct.x*yt+Ct.offsetX),ut=ut.y*tt.height+ut.offsetY-(Ct.y*xt+Ct.offsetY);lt+=tt.x-x.x,ut+=tt.y-x.y,ft.visible&&ft.arrange(z+lt,ot+ut,yt,xt)}}Te.free(tt)};function fv(a,y,x){var E=null;if(a instanceof Pn&&a.$e!==""&&(E=a.fb(a.$e),E===a&&(E=null)),E!==null)for(x&&a.arrange(0,0,y.width,y.height),y.assign(E.actualBounds),E=E.panel;E!==a;)E.transform.pp(y),E=E.panel}function ym(){this.xa="Base"}Le(ym,wa),ym.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length,ot=a.Pb(),lt=ot.margin,ut=y,ft=x,yt=lt.right+lt.left,xt=lt.top+lt.bottom;ot.measure(y,x,z,tt),lt=ot.measuredBounds;var Ct=0,bt=null;ot instanceof fr&&(bt=ot,Ct=bt.strokeWidth*bt.scale);var Vt=Math.max(lt.width+yt,0);lt=Math.max(lt.height+xt,0);var zt=vv(ot),$t=zt.x*Vt+zt.offsetX;zt=zt.y*lt+zt.offsetY;var ie=yv(ot),oe=ie.x*Vt+ie.offsetX;for(ie=ie.y*lt+ie.offsetY,isFinite(y)&&(ut=Math.max(Math.abs($t-oe)-Ct,0)),isFinite(x)&&(ft=Math.max(Math.abs(zt-ie)-Ct,0)),Ct=nn.alloc(),Ct.h(0,0),a=ch(a),ie=0;ie<rt;ie++)zt=E[ie],zt===ot||!zt.visible&&zt!==a||(lt=zt.margin,Vt=lt.right+lt.left,$t=lt.top+lt.bottom,zt.measure(ut,ft,0,0),lt=zt.measuredBounds,Vt=Math.max(lt.width+Vt,0),lt=Math.max(lt.height+$t,0),Ct.h(Math.max(Vt,Ct.width),Math.max(lt,Ct.height)));if(rt===1)b.width=Vt,b.height=lt,nn.free(Ct);else{switch(zt=vv(ot),ie=yv(ot),rt=E=0,ie.x!==zt.x&&ie.y!==zt.y&&(E=Ct.width/Math.abs(ie.x-zt.x),rt=Ct.height/Math.abs(ie.y-zt.y)),nn.free(Ct),Ct=0,bt!==null&&(Ct=bt.strokeWidth*bt.scale,Ev(bt)===wi&&(E=rt=Math.max(E,rt))),E+=Math.abs(zt.offsetX)+Math.abs(ie.offsetX)+Ct,rt+=Math.abs(zt.offsetY)+Math.abs(ie.offsetY)+Ct,bt=ot.stretch,bt===sr&&(bt=Ts(ot,!1)),bt){case ln:tt=z=0;break;case yn:isFinite(y)&&(E=y),isFinite(x)&&(rt=x);break;case Mi:isFinite(y)&&(E=y),tt=0;break;case Ri:z=0,isFinite(x)&&(rt=x)}ot.Uj(),ot.measure(E,rt,z,tt),b.width=ot.measuredBounds.width+yt,b.height=ot.measuredBounds.height+xt}},ym.prototype.arrange=function(a,y){var x=y.length,E=a.Pb(),b=E.measuredBounds,z=Te.alloc();z.h(0,0,1,1);var tt=E.margin,rt=tt.left;tt=tt.top;var ot=a.padding,lt=ot.left;ot=ot.top,E.arrange(lt+rt,ot+tt,b.width,b.height);var ut=vv(E),ft=yv(E),yt=ut.y*b.height+ut.offsetY,xt=ft.x*b.width+ft.offsetX;for(ft=ft.y*b.height+ft.offsetY,z.x=ut.x*b.width+ut.offsetX,z.y=yt,zr(z,xt,ft,0,0),z.x+=rt+lt,z.y+=tt+ot,b=0;b<x;b++)rt=y[b],rt!==E&&(lt=rt.measuredBounds,tt=rt.margin,ot=Math.max(lt.width+tt.right+tt.left,0),ut=Math.max(lt.height+tt.top+tt.bottom,0),yt=rt.alignment,yt.Xb()&&(yt=a.defaultAlignment),yt.sb()||(yt=dr),ot=z.width*yt.x+yt.offsetX-ot*yt.x+tt.left+z.x,tt=z.height*yt.y+yt.offsetY-ut*yt.y+tt.top+z.y,rt.visible&&(Zr(z.x,z.y,z.width,z.height,ot,tt,lt.width,lt.height)?rt.arrange(ot,tt,lt.width,lt.height):rt.arrange(ot,tt,lt.width,lt.height,new Te(z.x,z.y,z.width,z.height))));Te.free(z)};function Sm(){this.xa="Base",this.name="Table"}Le(Sm,wa),Sm.prototype.measure=function(a,y,x,E,b){for(var z=E.length,tt=Jn(),rt=Jn(),ot=0;ot<z;ot++){var lt=E[ot],ut=lt instanceof Pn?lt:null;if(ut!==null&&Th(ut)&&lt.visible){rt.push(ut);for(var ft=ut.O.s,yt=ft.length,xt=0;xt<yt;xt++){var Ct=ft[xt];ut.type===Pn.TableRow?Ct.row=lt.row:ut.type===Pn.TableColumn&&(Ct.column=lt.column),tt.push(Ct)}}else tt.push(lt)}z=tt.length,z===0&&(a.Fb(0),a.Eb(0));for(var bt=[],Vt=0;Vt<z;Vt++){var zt=tt[Vt];zt.visible&&(ma(zt,!0),Hu(zt,!0),bt[zt.row]||(bt[zt.row]=[]),bt[zt.row][zt.column]||(bt[zt.row][zt.column]=[]),bt[zt.row][zt.column].push(zt))}li(tt);var $t=Jn(),ie=Jn(),oe=Jn(),de={count:0},ke={count:0},Hn=y,ci=x,ai=a.rowDefs,Fn=a.colDefs,tn=null;z=ai.length;for(var nr=0;nr<z;nr++)tn=ai[nr],tn!==void 0&&(tn.actual=0);z=Fn.length;for(var Ji=0;Ji<z;Ji++)tn=Fn[Ji],tn!==void 0&&(tn.actual=0);for(var io=bt.length,No=0,ba=0;ba<io;ba++)bt[ba]&&(No=Math.max(No,bt[ba].length));var Oa=Math.min(a.topIndex,io-1),cs=Math.min(a.leftIndex,No-1),Na=0;io=bt.length;for(var Hh=ch(a),ua=0;ua<io;ua++)if(bt[ua]){No=bt[ua].length;var yu=a.Fb(ua);yu.actual=0;for(var fs=yu.oc=0;fs<No;fs++)if(bt[ua][fs]){var Wh=a.Eb(fs);$t[fs]===void 0&&(Wh.actual=0,Wh.oc=0,$t[fs]=!0);for(var fl=bt[ua][fs],Gl=fl.length,tl=0;tl<Gl;tl++){var Ws=fl[tl];if(Ws.visible||Ws===Hh){var Ld=1<Ws.rowSpan||1<Ws.columnSpan;Ld&&(ua<Oa||fs<cs||ie.push(Ws));var Su=Ws.margin,ig=Su.right+Su.left,el=Su.top+Su.bottom,gs=fu(Ws,yu,Wh,!1),Op=Ws.desiredSize,Xc=!isNaN(Op.height),Au=!isNaN(Op.width)&&Xc;if(Ld||gs===ln||Au||ua<Oa||fs<cs||(de[fs]!==void 0||gs!==yn&&gs!==Mi||(de[fs]=-1,de.count++),ke[ua]!==void 0||gs!==yn&&gs!==Ri||(ke[ua]=-1,ke.count++),oe.push(Ws)),Ws.measure(1/0,1/0,0,0),!(ua<Oa||fs<cs)){var Vs=Ws.measuredBounds,ac=Math.max(Vs.width+ig,0),nl=Math.max(Vs.height+el,0);if(Ws.rowSpan===1&&(gs===ln||gs===Mi)){tn=a.Fb(ua);var Fd=tn.Wc();Na=Math.max(nl-tn.actual,0),Na+Fd>ci&&(Na=Math.max(ci-Fd,0));var G0=tn.oa===0;tn.oc=tn.oc+Na,tn.actual=tn.oa+Na,ci=Math.max(ci-(Na+(G0?Fd:0)),0)}if(Ws.columnSpan===1&&(gs===ln||gs===Ri)){tn=a.Eb(fs);var Ip=tn.Wc();Na=Math.max(ac-tn.actual,0),Na+Ip>Hn&&(Na=Math.max(Hn-Ip,0));var zy=tn.oa===0;tn.oc=tn.oc+Na,tn.actual=tn.oa+Na,Hn=Math.max(Hn-(Na+(zy?Ip:0)),0)}Ld&&Ws.Uj()}}}}}li($t);var th=0,ph=0;z=a.columnCount;for(var Jc=0;Jc<z;Jc++){var Md=Fn[Jc];Md!==void 0&&(th+=isNaN(Md.Hc)?Md.oc:Md.Hc,Md.oc!==0&&(th+=Md.Wc()))}z=a.rowCount;for(var rg=0;rg<z;rg++){var kd=ai[rg];kd!==void 0&&(ph+=isNaN(kd.Hc)?kd.oc:kd.Hc,kd.oc!==0&&(ph+=kd.Wc()))}Hn=Math.max(y-th,0);var eh=ci=Math.max(x-ph,0),Vh=Hn;z=oe.length;for(var Ks=0;Ks<z;Ks++){var Tu=oe[Ks],H0=a.Fb(Tu.row),mh=a.Eb(Tu.column),og=Tu.measuredBounds,xu=Tu.margin,sc=xu.right+xu.left,Du=xu.top+xu.bottom;de[Tu.column]=mh.oc===0&&de[Tu.column]!==void 0?Math.max(og.width+sc,de[Tu.column]):null,ke[Tu.row]=H0.oc===0&&ke[Tu.row]!==void 0?Math.max(og.height+Du,ke[Tu.row]):null}var Qc=0,ag=0,au;for(au in ke)au!=="count"&&(Qc+=ke[au]);for(au in de)au!=="count"&&(ag+=de[au]);for(var Ka=nn.alloc(),_p=0;_p<z;_p++){var Ms=oe[_p];if(Ms.visible||Ms===Hh){var ha=a.Fb(Ms.row),ks=a.Eb(Ms.column),vh=0;isFinite(ks.width)?vh=ks.width:(isFinite(Hn)&&de[Ms.column]!==null?ag===0?vh=ks.actual+Hn:vh=de[Ms.column]/ag*Vh:de[Ms.column]!==null?vh=Hn:vh=ks.actual||Hn,vh=Math.max(0,vh-ks.Wc()));var Kh=0;switch(isFinite(ha.height)?Kh=ha.height:(isFinite(ci)&&ke[Ms.row]!==null?Qc===0?Kh=ha.actual+ci:Kh=ke[Ms.row]/Qc*eh:ke[Ms.row]!==null?Kh=ci:Kh=ha.actual||ci,Kh=Math.max(0,Kh-ha.Wc())),Ka.h(Math.max(ks.minimum,Math.min(vh,ks.maximum)),Math.max(ha.minimum,Math.min(Kh,ha.maximum))),gs=fu(Ms,ha,ks,!1),gs){case Mi:Ka.height=Math.max(Ka.height,ha.actual+ci);break;case Ri:Ka.width=Math.max(Ka.width,ks.actual+Hn)}var lc=Ms.margin,Zy=lc.right+lc.left,W0=lc.top+lc.bottom;Ms.Uj(),Ms.measure(Ka.width,Ka.height,ks.minimum,ha.minimum);var sg=Ms.measuredBounds,uc=Math.max(sg.width+Zy,0),$c=Math.max(sg.height+W0,0);isFinite(Hn)&&(uc=Math.min(uc,Ka.width)),isFinite(ci)&&($c=Math.min($c,Ka.height));var Us=0;Us=ha.actual,ha.actual=Math.max(ha.actual,$c),ha.oc=Math.max(ha.oc,$c),Na=ha.actual-Us,ci=Math.max(ci-Na,0),ke[Ms.row]===null&&(eh=Math.max(eh-Na,0)),Us=ks.actual,ks.actual=Math.max(ks.actual,uc),ks.oc=Math.max(ks.oc,uc),Na=ks.actual-Us,Hn=Math.max(Hn-Na,0),de[Ms.column]===null&&(Vh=Math.max(Vh-Na,0))}}li(oe);var yh=nn.alloc(),Pu=Jn(),bl=Jn();if(z=ie.length,z!==0){for(var bd=0;bd<io;bd++)if(bt[bd]){No=bt[bd].length;var lg=a.Fb(bd);Pu[bd]=lg.actual;for(var Nd=0;Nd<No;Nd++)if(bt[bd][Nd]){var V0=a.Eb(Nd);bl[Nd]=V0.actual}}}for(var ug=0;ug<z;ug++){var na=ie[ug];if(na.visible||na===Hh){var su=a.Fb(na.row),Hl=a.Eb(na.column);switch(Ka.h(Math.max(Hl.minimum,Math.min(y,Hl.maximum)),Math.max(su.minimum,Math.min(x,su.maximum))),gs=fu(na,su,Hl,!1),gs){case yn:bl[Hl.index]!==0&&(Ka.width=Math.min(Ka.width,bl[Hl.index])),Pu[su.index]!==0&&(Ka.height=Math.min(Ka.height,Pu[su.index]));break;case Mi:bl[Hl.index]!==0&&(Ka.width=Math.min(Ka.width,bl[Hl.index]));break;case Ri:Pu[su.index]!==0&&(Ka.height=Math.min(Ka.height,Pu[su.index]))}isFinite(Hl.width)&&(Ka.width=Hl.width),isFinite(su.height)&&(Ka.height=su.height),yh.h(0,0);for(var K0=Hl.minimum,il=su.minimum,Uh=1;Uh<na.rowSpan&&!(na.row+Uh>=a.rowCount);Uh++)tn=a.Fb(na.row+Uh),Na=0,Na=gs===yn||gs===Ri?Math.max(tn.minimum,Pu[na.row+Uh]===0?tn.maximum:Math.min(Pu[na.row+Uh],tn.maximum)):Math.max(tn.minimum,isNaN(tn.Hc)?tn.maximum:Math.min(tn.Hc,tn.maximum)),yh.height+=Na,il+=tn.minimum;for(var Wl=1;Wl<na.columnSpan&&!(na.column+Wl>=a.columnCount);Wl++)tn=a.Eb(na.column+Wl),Na=0,Na=gs===yn||gs===Mi?Math.max(tn.minimum,bl[na.column+Wl]===0?tn.maximum:Math.min(bl[na.column+Wl],tn.maximum)):Math.max(tn.minimum,isNaN(tn.Hc)?tn.maximum:Math.min(tn.Hc,tn.maximum)),yh.width+=Na,K0+=tn.minimum;Ka.width+=yh.width,Ka.height+=yh.height;var hg=na.margin,Bd=hg.right+hg.left,Rp=hg.top+hg.bottom;na.measure(Ka.width,Ka.height,K0,il);for(var dg=na.measuredBounds,Ou=Math.max(dg.width+Bd,0),hc=Math.max(dg.height+Rp,0),Ad=0,cg=0;cg<na.rowSpan&&!(na.row+cg>=a.rowCount);cg++)tn=a.Fb(na.row+cg),Ad+=tn.total||0;if(Ad<hc){var Yh=hc-Ad,nh=hc-Ad;if(na.spanAllocation!==null)for(var Xh=na.spanAllocation,Sh=0;Sh<na.rowSpan&&!(0>=Yh)&&!(na.row+Sh>=a.rowCount);Sh++){tn=a.Fb(na.row+Sh);var Jh=tn.oa||0,dc=Xh(na,tn,nh);tn.actual=Math.min(tn.maximum,Jh+dc),tn.oa!==Jh&&(Yh-=tn.oa-Jh)}for(;0<Yh;){var wu=tn.oa||0;if(isNaN(tn.height)&&tn.maximum>wu&&(tn.actual=Math.min(tn.maximum,wu+Yh),tn.oa!==wu&&(Yh-=tn.oa-wu)),tn.index===0)break;tn=a.Fb(tn.index-1)}}for(var qc=0,Qh=0;Qh<na.columnSpan&&!(na.column+Qh>=a.columnCount);Qh++)tn=a.Eb(na.column+Qh),qc+=tn.total||0;if(qc<Ou){var tf=Ou-qc,Gy=Ou-qc;if(na.spanAllocation!==null)for(var xh=na.spanAllocation,cc=0;cc<na.columnSpan&&!(0>=tf)&&!(na.column+cc>=a.columnCount);cc++){tn=a.Eb(na.column+cc);var jp=tn.oa||0,Hy=xh(na,tn,Gy);tn.actual=Math.min(tn.maximum,jp+Hy),tn.oa!==jp&&(tf-=tn.oa-jp)}for(;0<tf;){var U0=tn.oa||0;if(isNaN(tn.width)&&tn.maximum>U0&&(tn.actual=Math.min(tn.maximum,U0+tf),tn.oa!==U0&&(tf-=tn.oa-U0)),tn.index===0)break;tn=a.Eb(tn.index-1)}}}}li(ie),nn.free(yh),nn.free(Ka),Pu!==void 0&&li(Pu),bl!==void 0&&li(bl);var ef=0,nf=0,Y0=a.desiredSize,gx=a.maxSize;gs=Ts(a,!0);var zp=ph=th=0,Zp=0;z=a.columnCount;for(var X0=0;X0<z;X0++)Fn[X0]!==void 0&&(tn=a.Eb(X0),isFinite(tn.width)?(zp+=tn.width,zp+=tn.Wc()):bm(tn)===$g?(zp+=tn.oa,zp+=tn.Wc()):tn.oa!==0&&(th+=tn.oa,th+=tn.Wc()));isFinite(Y0.width)?ef=Math.min(Y0.width,gx.width):ef=gs!==ln&&isFinite(y)?y:th,ef=Math.max(ef,a.minSize.width),ef=Math.max(ef-zp,0);for(var Qx=th===0?1:Math.max(ef/th,1),J0=0;J0<z;J0++)Fn[J0]!==void 0&&(tn=a.Eb(J0),isFinite(tn.width)||bm(tn)===$g||(tn.actual=tn.oa*Qx),tn.position=b.width,tn.oa!==0&&(b.width+=tn.oa,b.width+=tn.Wc()));z=a.rowCount;for(var Q0=0;Q0<z;Q0++)ai[Q0]!==void 0&&(tn=a.Fb(Q0),isFinite(tn.height)?(Zp+=tn.height,Zp+=tn.Wc()):bm(tn)===$g?(Zp+=tn.oa,Zp+=tn.Wc()):tn.oa!==0&&(ph+=tn.oa,ph+=tn.Wc()));isFinite(Y0.height)?nf=Math.min(Y0.height,gx.height):nf=gs!==ln&&isFinite(x)?x:ph,nf=Math.max(nf,a.minSize.height),nf=Math.max(nf-Zp,0);for(var $x=ph===0?1:Math.max(nf/ph,1),$0=0;$0<z;$0++)ai[$0]!==void 0&&(tn=a.Fb($0),isFinite(tn.height)||bm(tn)===$g||(tn.actual=tn.oa*$x),tn.position=b.height,tn.oa!==0&&(b.height+=tn.oa,b.height+=tn.Wc()));z=rt.length;for(var Wy=0;Wy<z;Wy++){var Gp=rt[Wy],Vy=0,Ky=0;Gp.type===Pn.TableRow?(Vy=b.width,tn=a.Fb(Gp.row),Ky=tn.actual):(tn=a.Eb(Gp.column),Vy=tn.actual,Ky=b.height),Gp.measuredBounds.h(0,0,Vy,Ky),ma(Gp,!1)}li(rt),a.inRowsCols=bt},Sm.prototype.arrange=function(a,y,x){var E=y.length,b=a.padding,z=b.left;b=b.top;var tt=a.inRowsCols;if(tt!==null){for(var rt,ot,lt=tt.length,ut=0,ft=0;ft<lt;ft++)tt[ft]&&(ut=Math.max(ut,tt[ft].length));ot=a.rowDefs,rt=a.colDefs;var yt=ft=0,xt=Math.min(a.topIndex,lt-1);if(0<ot.length){for(;xt!==lt&&(ot[xt]===void 0||ot[xt].oa===0);)xt++;xt=Math.max(Math.min(xt,lt-1),0),ft=-ot[xt].position}var Ct=Math.min(a.leftIndex,ut-1);if(0<rt.length){for(;Ct!==ut&&(rt[Ct]===void 0||rt[Ct].oa===0);)Ct++;Ct=Math.max(Math.min(Ct,ut-1),0),yt=-rt[Ct].position}for(var bt=0,Vt=0;bt!==lt&&ot[bt]===void 0;)bt++;for(;Vt!==lt&&rt[Vt]===void 0;)Vt++;ut=a.part,a.Fb(bt),a.Eb(Vt);for(var zt=0;zt<y.length;zt++){var $t=y[zt];if($t instanceof Pn&&$t.visible&&Th($t)){if($t.type===Pn.TableRow){rt=a.Fb($t.row);var ie=a.Eb(Vt)}else rt=a.Fb(bt),ie=a.Eb($t.column);ot=rt.position+ft+b,rt.oa!==0&&(ot+=rt.Io(Math.max(bt,xt))),rt=ie.position+yt+z,ie.oa!==0&&(rt+=ie.Io(Math.max(Vt,Ct))),ie=$t.measuredBounds,$t.Uk(),$t.actualBounds.ka();var oe=$t.actualBounds,de=Te.allocAt(oe.x,oe.y,oe.width,oe.height);oe.x=$t.type===Pn.TableRow?z:rt,oe.y=$t.type===Pn.TableColumn?b:ot,oe.width=ie.width,oe.height=ie.height,$t.actualBounds.freeze(),Hu($t,!1),Wr(de,oe)||ut===null||(ut.oh(),$t.Pn(ut)),Te.free(de)}}for(zt=nn.alloc(),$t=0;$t<lt;$t++)if(tt[$t]){for(ut=tt[$t].length,ie=a.Fb($t),ot=ie.position+ft+b,ie.oa!==0&&(ot+=ie.Io(Math.max(bt,xt))),oe=0;oe<ut;oe++)if(tt[$t][oe]){de=a.Eb(oe),rt=de.position+yt+z,de.oa!==0&&(rt+=de.Io(Math.max(Vt,Ct)));for(var ke=tt[$t][oe],Hn=ke.length,ci=0;ci<Hn;ci++){var ai=ke[ci],Fn=ai.measuredBounds;zt.h(0,0);for(var tn=1;tn<ai.rowSpan&&!($t+tn>=a.rowCount);tn++){var nr=a.Fb($t+tn);nr.oa!==0&&(zt.height+=nr.total)}for(tn=1;tn<ai.columnSpan&&!(oe+tn>=a.columnCount);tn++)nr=a.Eb(oe+tn),nr.oa!==0&&(zt.width+=nr.total);var Ji=de.oa+zt.width,io=ie.oa+zt.height;tn=rt,nr=ot;var No=Ji,ba=io,Oa=rt,cs=ot,Na=Ji,Hh=io;rt+Ji>x.width&&(Na=Math.max(x.width-rt,0)),ot+io>x.height&&(Hh=Math.max(x.height-ot,0));var ua=ai.alignment;if(ua.Xb()){ua=a.defaultAlignment,ua.sb()||(ua=dr);var yu=ua.x,fs=ua.y,Wh=ua.offsetX;ua=ua.offsetY;var fl=de.alignment,Gl=ie.alignment;fl.sb()&&(yu=fl.x,Wh=fl.offsetX),Gl.sb()&&(fs=Gl.y,ua=Gl.offsetY)}else yu=ua.x,fs=ua.y,Wh=ua.offsetX,ua=ua.offsetY;(isNaN(yu)||isNaN(fs))&&(fs=yu=.5,ua=Wh=0),fl=Fn.width,Gl=Fn.height;var tl=ai.margin,Ws=tl.left+tl.right,Ld=tl.top+tl.bottom,Su=fu(ai,ie,de,!1);!isNaN(ai.desiredSize.width)||Su!==yn&&Su!==Mi||(fl=Math.max(Ji-Ws,0)),!isNaN(ai.desiredSize.height)||Su!==yn&&Su!==Ri||(Gl=Math.max(io-Ld,0)),Ji=ai.maxSize,io=ai.minSize,fl=Math.min(Ji.width,fl),Gl=Math.min(Ji.height,Gl),fl=Math.max(io.width,fl),Gl=Math.max(io.height,Gl),Ji=Gl+Ld,tn+=No*yu-(fl+Ws)*yu+Wh+tl.left,nr+=ba*fs-Ji*fs+ua+tl.top,ai.visible&&(Zr(Oa,cs,Na,Hh,tn,nr,Fn.width,Fn.height)?ai.arrange(tn,nr,fl,Gl):ai.arrange(tn,nr,fl,Gl,new Te(Oa,cs,Na,Hh)))}}}for(nn.free(zt),a=0;a<E;a++)x=y[a],z=x instanceof Pn?x:null,z!==null&&Th(z)&&(z=x.actualBounds,x.naturalBounds.ka(),x.naturalBounds.h(0,0,z.width,z.height),x.naturalBounds.freeze())}};function xm(){this.xa="Base"}Le(xm,wa),xm.prototype.measure=function(){},xm.prototype.arrange=function(){};function Pm(){this.xa="Base"}Le(Pm,wa),Pm.prototype.measure=function(){},Pm.prototype.arrange=function(){};function wm(){this.xa="Base"}Le(wm,wa),wm.prototype.measure=function(a,y,x,E,b,z,tt){1<E.length&&Gt("Viewbox Panel cannot contain more than one GraphObject."),E=E[0],E.Ca=1,E.Uj(),E.measure(1/0,1/0,z,tt);var rt=E.measuredBounds,ot=E.margin,lt=ot.right+ot.left;if(ot=ot.top+ot.bottom,isFinite(y)||isFinite(x)){var ut=E.scale,ft=rt.width;rt=rt.height;var yt=Math.max(y-lt,0),xt=Math.max(x-ot,0),Ct=1;a.viewboxStretch===wi?ft!==0&&rt!==0&&(Ct=Math.min(yt/ft,xt/rt)):ft!==0&&rt!==0&&(Ct=Math.max(yt/ft,xt/rt)),Ct===0&&(Ct=1e-4),E.Ca*=Ct,ut!==E.scale&&(ma(E,!0),E.measure(1/0,1/0,z,tt))}rt=E.measuredBounds,b.width=isFinite(y)?y:Math.max(rt.width+lt,0),b.height=isFinite(x)?x:Math.max(rt.height+ot,0)},wm.prototype.arrange=function(a,y,x){y=y[0];var E=y.measuredBounds,b=y.margin,z=Math.max(E.width+(b.right+b.left),0);b=Math.max(E.height+(b.top+b.bottom),0);var tt=y.alignment;tt.Xb()&&(tt=a.defaultAlignment),tt.sb()||(tt=dr),y.arrange(x.width*tt.x-z*tt.x+tt.offsetX,x.height*tt.y-b*tt.y+tt.offsetY,E.width,E.height)};function Xg(){this.xa="Base"}Le(Xg,wa),Xg.prototype.measure=function(){},Xg.prototype.arrange=function(){},Xg.prototype.gc=function(a,y,x){x=a.Df()*x.scale,0>=x&&(x=1);var E=a.gridCellSize,b=E.width;E=E.height;var z=a.naturalBounds,tt=a.actualBounds,rt=z.width,ot=z.height,lt=Math.ceil(rt/b),ut=Math.ceil(ot/E),ft=a.gridOrigin,yt=ft.x;ft=ft.y,y.save(),y.beginPath(),y.rect(0,0,rt,ot),y.clip(),y.Se();for(var xt=[],Ct=a.O.s,bt=Ct.length,Vt=0;Vt<bt;Vt++){var zt=Ct[Vt],$t=[];if(xt.push($t),zt.visible){var ie=zt.interval;if(!(0>ie)){zt=pv(zt.figure);for(var oe=0;oe<bt;oe++)if(oe!==Vt){var de=Ct[oe];de.visible&&pv(de.figure)===zt&&(de=de.interval,de>ie&&$t.push(de))}}}}for(Ct=a.O.s,bt=Ct.length,Vt=0;Vt<bt;Vt++){var ke=Ct[Vt];if(ke.visible&&($t=ke.interval||1,zt=Math.abs($t),!(2>b*zt*x))){if(ie=ke.segmentIndex,(!isFinite(ie)||isNaN(ie))&&(ie=0),0>ie&&(ie=zt-Math.min(-ie,zt)),ie=Math.round(ie%zt),zt=ke.opacity,oe=1,zt!==1){if(zt===0)continue;oe=y.globalAlpha,y.globalAlpha=oe*zt}de=xt[Vt];var Hn=!1,ci=ke.strokeDashArray;if(ci!==null&&(Hn=!0,y.js(ci,ke.strokeDashOffset)),ke.figure==="LineV"&&ke.stroke!==null&&0<ke.strokeWidth){for(y.lineWidth=ke.strokeWidth,ta(a,y,ke.stroke,!1,!1,z,tt),y.beginPath(),ci=ke=Math.floor((yt-b)/b);ci<=ke+lt;ci++){var ai=ci*b+yt;0<=ai&&ai<=rt&&Cm(ci,$t,ie,de)&&(y.moveTo(ai,0),y.lineTo(ai,ot))}y.stroke(),y.Se()}else if(ke.figure==="LineH"&&ke.stroke!==null&&0<ke.strokeWidth){for(y.lineWidth=ke.strokeWidth,ta(a,y,ke.stroke,!1,!1,z,tt),y.beginPath(),ci=ke=Math.floor((ft-E)/E);ci<=ke+ut;ci++)ai=ci*E+ft,0<=ai&&ai<=ot&&Cm(ci,$t,ie,de)&&(y.moveTo(0,ai),y.lineTo(rt,ai));y.stroke(),y.Se()}else if(ke.figure==="BarV"&&ke.fill!==null)for(ta(a,y,ke.fill,!0,!1,z,tt),ke=ke.width,isNaN(ke)&&(ke=b),ai=ci=Math.floor((yt-b)/b);ai<=ci+lt;ai++){var Fn=ai*b+yt;0<=Fn+ke&&Fn<=rt&&Cm(ai,$t,ie,de)&&y.fillRect(Fn,0,ke,ot)}else if(ke.figure==="BarH"&&ke.fill!==null)for(ta(a,y,ke.fill,!0,!1,z,tt),ke=ke.height,isNaN(ke)&&(ke=E),ai=ci=Math.floor((ft-E)/E);ai<=ci+ut;ai++)Fn=ai*E+ft,0<=Fn+ke&&Fn<=ot&&Cm(ai,$t,ie,de)&&y.fillRect(0,Fn,rt,ke);Hn&&y.fs(),zt!==1&&(y.globalAlpha=oe)}}y.restore(),y.Vc(!1)};function Cm(a,y,x,E){if(0>y)return a%y===x;if(a%y!==x)return!1;y=E.length;for(var b=0;b<y;b++)if(a%E[b]===x)return!1;return!0}function Em(){this.xa="Base"}Le(Em,wa),Em.prototype.measure=function(a,y,x,E,b){var z=E.length;if(a instanceof Qr||a instanceof kn){var tt=null,rt=null;if(a instanceof kn&&(tt=a),a instanceof Qr&&(rt=a,tt=rt.adornedPart,a.j===null&&(a.j=[])),tt instanceof kn){var ot=tt;if(z===0)ao(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var lt=a instanceof Qr?null:tt.path;y=tt.routeBounds,x=a.jg,x.h(0,0,y.width,y.height);var ut=ot.points,ft=tt.pointsCount;rt!==null?rt.Ul(!1):tt!==null&&tt.Ul(!1),rt=y.width;var yt=y.height,xt=a.j;if(xt.length=0,lt!==null){i1(a,rt,yt,lt);var Ct=lt.measuredBounds;x.ed(Ct),xt.push(Ct)}Ct=ae.alloc();for(var bt=At.alloc(),Vt=At.alloc(),zt=0;zt<z;zt++){var $t=E[zt];if($t!==lt)if($t.isPanelMain&&$t instanceof fr){i1(a,rt,yt,$t);var ie=$t.measuredBounds;x.ed(ie),xt.push(ie)}else if(2>ft)$t.measure(1/0,1/0,0,0),ie=$t.measuredBounds,x.ed(ie),xt.push(ie);else{var oe=$t.segmentIndex,de=$t.segmentFraction,ke=$t.alignmentFocus;ke.Mc()&&(ke=dr);var Hn=$t.segmentOrientation,ci=$t.segmentOffset;if(isNaN(oe)){var ai=ot.ua;ie=Jn(),ai.Qu(de,ie);var Fn=At.allocAt(ie[0],ie[1]);if(Fn.add(ot.i(0)),ai.type===ce.j?Fn.offset(-ai.startX,-ai.startY):(ai=ai.figures.first(),ai!==null&&Fn.offset(-ai.startX,-ai.startY)),ai=ie[2],Hn!==ws){var tn=ot.computeAngle($t,Hn,ai);$t.Kb=tn}tn=Fn.x-y.x;var nr=Fn.y-y.y;At.free(Fn),li(ie)}else if(oe<-ft||oe>=ft)ie=At.alloc(),ot.vg(),ot.computeMidPoint(ie),ai=ot.midAngle,Hn!==ws&&(tn=ot.computeAngle($t,Hn,ai),$t.Kb=tn),tn=ie.x-y.x,nr=ie.y-y.y,At.free(ie);else{if(tn=0,0<=oe?(nr=ut.M(oe),ie=oe<ft-1?ut.M(oe+1):nr):(tn=ft+oe,nr=ut.M(tn),ie=0<tn?ut.M(tn-1):nr),nr.Xa(ie)){0<=oe?(ai=0<oe?ut.M(oe-1):nr,tn=oe<ft-2?ut.M(oe+2):ie):(ai=tn<ft-1?ut.M(tn+1):nr,tn=1<tn?ut.M(tn-2):ie),Fn=ai.Bf(nr);var Ji=ie.Bf(tn);ai=Fn>Ji+10?0<=oe?ai.ab(nr):nr.ab(ai):Ji>Fn+10?0<=oe?ie.ab(tn):tn.ab(ie):0<=oe?ai.ab(tn):tn.ab(ai)}else ai=0<=oe?nr.ab(ie):ie.ab(nr);Hn!==ws&&(tn=ot.computeAngle($t,Hn,ai),$t.Kb=tn),tn=nr.x+(ie.x-nr.x)*de-y.x,nr=nr.y+(ie.y-nr.y)*de-y.y}$t.measure(1/0,1/0,0,0),ie=$t.measuredBounds,Fn=$t.naturalBounds;var io=0;$t instanceof fr&&(io=$t.strokeWidth),Ji=Fn.width+io;var No=Fn.height+io;Ct.reset(),Ct.translate(-ie.x,-ie.y),Ct.scale($t.scale,$t.scale),Ct.rotate(Hn===ws?$t.angle:ai,Ji/2,No/2),Hn!==lp&&Hn!==hp||Ct.rotate(90,Ji/2,No/2),Hn!==up&&Hn!==dp||Ct.rotate(-90,Ji/2,No/2),Hn===t0&&(45<ai&&135>ai||225<ai&&315>ai)&&Ct.rotate(-ai,Ji/2,No/2),Fn=new Te(0,0,Ji,No),bt.xi(Fn,ke),Ct.Ga(bt),ke=-bt.x+io/2*$t.scale,$t=-bt.y+io/2*$t.scale,Vt.assign(ci),io=isNaN(ci.x);var ba=isNaN(ci.y);if(io||ba){Ji=Ji/2+3,No=No/2+3;var Oa=45<=ai&&135>=ai,cs=225<=ai&&315>=ai;Hn===ws&&(Oa||cs)?(Vt.x=ba?Ji:ci.y,Vt.y=io?No:ci.x,Oa?0<=oe||isNaN(oe)&&.5>de||!io||(Vt.y=-No):cs&&((0<=oe||isNaN(oe)&&.5>de)&&io&&(Vt.y=-No),ba&&(Vt.x=-Ji))):(io&&(Vt.x=0<=oe||isNaN(oe)&&.5>de?Ji:-Ji),ba&&(Vt.y=-No),Vt.rotate(ai))}else Vt.rotate(ai);tn+=Vt.x,nr+=Vt.y,Fn.set(ie),Fn.h(tn+ke,nr+$t,ie.width,ie.height),xt.push(Fn),x.ed(Fn)}}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),ao(b,x.width||0,x.height||0),ae.free(Ct),At.free(bt),At.free(Vt)}}}},Em.prototype.arrange=function(a,y){var x=y.length;if(a instanceof Qr||a instanceof kn){var E=a,b=null;a instanceof Qr&&(b=a,E=b.adornedPart);var z=a instanceof Qr?null:E.path,tt=a.j;if(tt.length!==0){var rt=0;if(z!==null&&rt<tt.length){var ot=tt[rt];rt++,z.arrange(ot.x-a.jg.x,ot.y-a.jg.y,ot.width,ot.height)}for(ot=0;ot<x;ot++){var lt=y[ot];if(lt!==z&&rt<tt.length){var ut=tt[rt];rt++,lt.arrange(ut.x-a.jg.x,ut.y-a.jg.y,ut.width,ut.height)}}}if(y=E.points,x=y.count,2<=x&&a instanceof kn)for(z=a.labelNodes;z.next();){var ft=a;tt=z.value,rt=tt.segmentIndex,ot=tt.segmentFraction;var yt=tt.alignmentFocus;if(lt=tt.segmentOrientation,ut=tt.segmentOffset,isNaN(rt)){var xt=ft.ua,Ct=Jn();xt.Qu(ot,Ct);var bt=At.allocAt(Ct[0],Ct[1]);bt.add(ft.i(0)),xt.type===ce.j||(xt=xt.figures.first()),bt.offset(-xt.startX,-xt.startY),xt=Ct[2],lt!==ws&&(ft=ft.computeAngle(tt,lt,xt),tt.angle=ft),ft=bt.x;var Vt=bt.y;At.free(bt),li(Ct)}else if(rt<-x||rt>=x)Ct=At.alloc(),xt=ft,Vt=Ct,xt.vg(),xt.computeMidPoint(Vt),xt=ft.midAngle,lt!==ws&&(ft=ft.computeAngle(tt,lt,xt),tt.angle=ft),ft=Ct.x,Vt=Ct.y,At.free(Ct);else{if(bt=0,0<=rt?(Ct=y.s[rt],Vt=rt<x-1?y.s[rt+1]:Ct):(bt=x+rt,Ct=y.s[bt],Vt=0<bt?y.s[bt-1]:Ct),Ct.Xa(Vt)){0<=rt?(xt=0<rt?y.s[rt-1]:Ct,bt=rt<x-2?y.s[rt+2]:Vt):(xt=bt<x-1?y.s[bt+1]:Ct,bt=1<bt?y.s[bt-2]:Vt);var zt=xt.Bf(Ct),$t=Vt.Bf(bt);xt=zt>$t+10?0<=rt?xt.ab(Ct):Ct.ab(xt):$t>zt+10?0<=rt?Vt.ab(bt):bt.ab(Vt):0<=rt?xt.ab(bt):bt.ab(xt)}else xt=0<=rt?Ct.ab(Vt):Vt.ab(Ct);lt!==ws&&(ft=ft.computeAngle(tt,lt,xt),tt.angle=ft),ft=Ct.x+(Vt.x-Ct.x)*ot,Vt=Ct.y+(Vt.y-Ct.y)*ot}if(yt.ys())tt.location=new At(ft,Vt);else{yt.Mc()&&(yt=dr),Ct=ae.alloc(),Ct.reset(),Ct.scale(tt.scale,tt.scale),Ct.rotate(tt.angle,0,0);var ie=tt.naturalBounds;bt=Te.allocAt(0,0,ie.width,ie.height),zt=At.alloc(),zt.xi(bt,yt),Ct.Ga(zt),yt=-zt.x,$t=-zt.y;var oe=ie.width,de=ie.height;ie=At.alloc(),ie.assign(ut);var ke=isNaN(ut.x),Hn=isNaN(ut.y);if(ke||Hn){oe=oe/2+3,de=de/2+3;var ci=45<=xt&&135>=xt,ai=225<=xt&&315>=xt;lt===ws&&(ci||ai)?(ie.x=Hn?oe:ut.y,ie.y=ke?de:ut.x,ci?0<=rt||isNaN(rt)&&.5>ot||!ke||(ie.y=-de):ai&&((0<=rt||isNaN(rt)&&.5>ot)&&ke&&(ie.y=-de),Hn&&(ie.x=-oe))):(ke&&(ie.x=0<=rt||isNaN(rt)&&.5>ot?oe:-oe),Hn&&(ie.y=-de),ie.rotate(xt))}else ie.rotate(xt);ft+=ie.x,Vt+=ie.y,Ct.pp(bt),yt+=bt.x,$t+=bt.y,rt=At.allocAt(ft+yt,Vt+$t),tt.move(rt),At.free(rt),At.free(ie),At.free(zt),Te.free(bt),ae.free(Ct)}}b!==null?b.Ul(!1):E.Ul(!1),E=A1(a),a.location.h(a.position.x+E.x,a.position.y+E.y),At.free(E)}};function i1(a,y,x,E){if(ul(E)!==!1){var b=E.strokeWidth;b===0&&a instanceof Qr&&a.type===Pn.Link&&a.adornedObject instanceof fr&&(b=a.adornedObject.strokeWidth),b*=E.Ca,a instanceof kn&&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 Qr&&a.adornedPart.ua!==null?(a=a.adornedPart.ua.bounds,E.Ge(a.x-b/2,a.y-b/2,a.width+b,a.height+b)):E.Ge(-(b/2),-(b/2),y+b,x+b),b=E.desiredSize,b.w()||E.ua===null?E.dc.h(0,0,b.width,b.height):E.dc.assign(E.ua.bounds),ma(E,!1)}}function Jg(){this.xa="Base"}Le(Jg,wa),Jg.prototype.measure=function(a,y,x,E,b,z,tt){var rt=a.Pb();a.graduatedBounds=[];var ot=rt.margin,lt=ot.right+ot.left,ut=ot.top+ot.bottom;rt.measure(y,x,z,tt);var ft=rt.measuredBounds,yt=new Te(-ot.left,-ot.top,Math.max(ft.width+lt,0),Math.max(ft.height+ut,0));a.graduatedBounds.push(yt),b.assign(yt);for(var xt=rt.geometry,Ct=rt.strokeWidth,bt=xt.flattenedSegments,Vt=xt.flattenedLengths,zt=xt.flattenedTotalLength,$t=bt.length,ie=0,oe=0,de=Jn(),ke=0;ke<$t;ke++){var Hn=bt[ke],ci=[];oe=ie=0;for(var ai=Hn.length,Fn=0;Fn<ai;Fn+=2){var tn=Hn[Fn],nr=Hn[Fn+1];if(Fn!==0){var Ji=180*Math.atan2(nr-oe,tn-ie)/Math.PI;0>Ji&&(Ji+=360),ci.push(Ji)}ie=tn,oe=nr}de.push(ci)}if(a.graduatedIntervals===null){for(var io=[],No=a.O.s,ba=No.length,Oa=0;Oa<ba;Oa++){var cs=No[Oa],Na=[];if(io.push(Na),cs.visible){var Hh=cs.interval;if(!(0>Hh)){for(var ua=0;ua<ba;ua++)if(ua!==Oa){var yu=No[ua];if(yu.visible&&cs.constructor===yu.constructor){var fs=yu.interval;fs>Hh&&Na.push(fs)}}}}}a.graduatedIntervals=io}var Wh=a.graduatedIntervals,fl=a.O.s,Gl=fl.length,tl=0,Ws=0,Ld=zt;a.graduatedMarks=[];for(var Su,ig=0;ig<Gl;ig++){var el=fl[ig];if(Su=[],el.visible&&el!==rt){var gs=Math.abs(el.interval),Op=a.graduatedTickUnit;if(!(2>Op*gs*zt/a.graduatedRange&&el.graduatedSkip===null)){var Xc=Vt[0][0],Au=0,Vs=0;Ws=zt*el.graduatedStart-1e-4,Ld=zt*el.graduatedEnd+1e-4;var ac=Op*gs,nl=a.graduatedTickBase;if(nl<a.graduatedMin){var Fd=(a.graduatedMin-nl)/ac;Fd=Fd%1===0?Fd:Math.floor(Fd+1),nl+=Fd*ac}else nl>a.graduatedMin+ac&&(nl-=Math.floor((nl-a.graduatedMin)/ac)*ac);for(var G0=Wh[ig],Ip=nl,zy=1e-6*a.graduatedMax,th=1;nl<=a.graduatedMax+zy;th++){t:{for(var ph=G0.length,Jc=0;Jc<ph;Jc++){var Md=(nl-a.graduatedTickBase)%(G0[Jc]*a.graduatedTickUnit),rg=1e-6*a.graduatedTickUnit;if(Md<rg&&Md>-rg){var kd=!1;break t}}kd=!0}if(kd&&(nl>a.graduatedMax&&(nl=a.graduatedMax),el.graduatedSkip===null||el instanceof To&&!el.graduatedSkip(nl,el)||el instanceof fr&&!el.graduatedSkip(nl,el))&&(tl=(nl-a.graduatedMin)*zt/a.graduatedRange,tl>zt&&(tl=zt),Ws<=tl&&tl<=Ld)){for(var eh=de[Au][Vs],Vh=Vt[Au][Vs];Au<Vt.length;){for(;tl>Xc&&Vs<Vt[Au].length-1;)Vs++,eh=de[Au][Vs],Vh=Vt[Au][Vs],Xc+=Vh;if(tl<=Xc)break;Au++,Vs=0,eh=de[Au][Vs],Vh=Vt[Au][Vs],Xc+=Vh}var Ks=bt[Au],Tu=Ks[2*Vs],H0=Ks[2*Vs+1],mh=(tl-(Xc-Vh))/Vh,og=new At(Tu+(Ks[2*Vs+2]-Tu)*mh+Ct/2-xt.bounds.x,H0+(Ks[2*Vs+3]-H0)*mh+Ct/2-xt.bounds.y);og.scale(rt.scale,rt.scale);t:{var xu=eh,sc=de[Au];if(!(.5005>mh&&.4995<mh)){var Du=xu;if(.5>mh?0<Vs?Du=sc[Vs-1]:_t.$(Ks[0],Ks[Ks.length-2])&&_t.$(Ks[1],Ks[Ks.length-1])&&(Du=sc[sc.length-1]):.5<mh&&(Vs+1<sc.length?Du=sc[Vs+1]:_t.$(Ks[0],Ks[Ks.length-2])&&_t.$(Ks[1],Ks[Ks.length-1])&&(Du=sc[0])),xu!==Du){var Qc=Math.abs(xu-Du);if(180<Qc&&(xu<Du?xu+=360:Du+=360,Qc=Math.abs(xu-Du)),5e-4>mh||.9995<mh){eh=(xu+Du)/2%360;break t}if(10>Qc){var ag=1-Math.abs(.5-mh);eh=(xu*ag+Du*(1-ag))%360;break t}}}eh=xu}if(el instanceof To){var au="";el.graduatedFunction!==null?(au=el.graduatedFunction(nl,el),au=au!=null?au.toString():""):au=(+nl.toFixed(2)).toString(),au!==""&&Su.push({$l:og,angle:eh,text:au})}else Su.push({$l:og,angle:eh})}nl=Ip+th*ac}}}a.graduatedMarks.push(Su)}li(de);var Ka=a.graduatedMarks;if(Ka!==null)for(var _p=E.length,Ms=0;Ms<_p;Ms++){var ha=E[Ms],ks=Ka[Ms];if(ha.visible&&ha!==rt&&ks.length!==0){if(ha instanceof fr){var vh=a,Kh=b,lc=ha.alignmentFocus;lc.Mc()&&(lc=qr);var Zy=ha.angle;ha.Kb=0,ha.measure(1/0,1/0,0,0),ha.Kb=Zy;var W0=ha.measuredBounds,sg=W0.width,uc=W0.height,$c=Te.allocAt(0,0,sg,uc),Us=At.alloc();Us.xi($c,lc),Te.free($c);for(var yh=-Us.x,Pu=-Us.y,bl=new Te,bd=ks.length,lg=0;lg<bd;lg++)for(var Nd=ks[lg],V0=Nd.$l.x,ug=Nd.$l.y,na=Nd.angle,su=0;4>su;su++){switch(su){case 0:Us.h(yh,Pu);break;case 1:Us.h(yh+sg,Pu);break;case 2:Us.h(yh,Pu+uc);break;case 3:Us.h(yh+sg,Pu+uc)}Us.rotate(na+ha.angle),Us.offset(V0,ug),lg===0&&su===0?bl.h(Us.x,Us.y,0,0):bl.Ye(Us),Us.offset(-V0,-ug),Us.rotate(-na-ha.angle)}At.free(Us),vh.graduatedBounds!==null&&vh.graduatedBounds.push(bl),zr(Kh,bl.x,bl.y,bl.width,bl.height)}else if(ha instanceof To){var Hl=a,K0=b;Hl.temporaryTextBlock===null&&(Hl.temporaryTextBlock=new To);var il=Hl.temporaryTextBlock;y1(il,ha);var Uh=ha.alignmentFocus;Uh.Mc()&&(Uh=qr);for(var Wl=ha.segmentOrientation,hg=ha.segmentOffset,Bd=new Te,Rp=0,dg=0,Ou=0,hc=0,Ad=0,cg=ks.length,Yh=0;Yh<cg;Yh++){var nh=ks[Yh];Rp=nh.$l.x,dg=nh.$l.y,Ou=nh.angle,Ad=hc=ha.angle,Wl!==ws&&(Ad=Wl===sp||Wl===qm?Ou+ha.angle:Ou,hc=kn.computeAngle(Wl,Ad)),il.Kb=hc,il.text=nh.text||"",il.measure(1/0,1/0,0,0);var Xh=il.measuredBounds,Sh=il.naturalBounds,Jh=Sh.width,dc=Sh.height,wu=ae.alloc();wu.reset(),wu.translate(-Xh.x,-Xh.y),wu.scale(il.scale,il.scale),wu.rotate(Ad,Jh/2,dc/2),Wl!==lp&&Wl!==hp||wu.rotate(90,Jh/2,dc/2),Wl!==up&&Wl!==dp||wu.rotate(-90,Jh/2,dc/2),Wl===t0&&(45<Ou&&135>Ou||225<Ou&&315>Ou)&&wu.rotate(-Ou,Jh/2,dc/2);var qc=Te.allocAt(0,0,Jh,dc),Qh=At.alloc();Qh.xi(qc,Uh),wu.Ga(Qh);var tf=-Qh.x,Gy=-Qh.y,xh=At.alloc();xh.assign(hg),isNaN(xh.x)&&(xh.x=Jh/2+3),isNaN(xh.y)&&(xh.y=-(dc/2+3)),xh.rotate(Ou),Rp+=xh.x+tf,dg+=xh.y+Gy;var cc=new Te(Rp,dg,Xh.width,Xh.height),jp=new Te(Xh.x,Xh.y,Xh.width,Xh.height),Hy=new Te(Sh.x,Sh.y,Sh.width,Sh.height);nh.Sz=hc,nh.lineCount=il.lineCount,nh.lines=[il.Cb,il.Ih,il.df,il.Le,il.Qc,il.Qb,il.ze],nh.actualBounds=cc,nh.measuredBounds=jp,nh.naturalBounds=Hy,Yh===0?Bd.assign(cc):Bd.ed(cc),At.free(xh),At.free(Qh),Te.free(qc),ae.free(wu)}Hl.graduatedBounds!==null&&Hl.graduatedBounds.push(Bd),zr(K0,Bd.x,Bd.y,Bd.width,Bd.height)}ma(ha,!1)}}},Jg.prototype.arrange=function(a,y,x){if(a.graduatedBounds!==null){var E=a.Pb(),b=a.graduatedMarks;if(b!==null){var z=a.graduatedBounds,tt=0,rt=z[tt];tt++,E!==null&&E.arrange(rt.x-x.x,rt.y-x.y,rt.width,rt.height);for(var ot=y.length,lt=0;lt<ot;lt++){var ut=y[lt];rt=b[lt],ut.visible&&ut!==E&&rt.length!==0&&(rt=z[tt],tt++,ut.arrange(rt.x-x.x,rt.y-x.y,rt.width,rt.height))}a.graduatedBounds=null}}},Jg.prototype.gc=function(a,y,x){var E=x.$i;x.$i=!0;var b=a.naturalBounds,z=b.width,tt=b.height;b=y instanceof Qs,y.save(),y.beginPath(),y.rect(-1,-1,z+1,tt+1),y.clip(),y.Se(),z=a.Pb(),z.gc(y,x),tt=a.Df()*x.scale,0>=tt&&(tt=1);for(var rt=z.actualBounds,ot=a.O.s,lt=a.graduatedMarks,ut=ot.length,ft=0;ft<ut;ft++){var yt=ot[ft],xt=lt[ft],Ct=xt.length;if(yt.visible&&yt!==z&&xt.length!==0){if(yt instanceof fr){if(!(2>a.graduatedTickUnit*yt.interval*z.geometry.flattenedTotalLength/a.graduatedRange*tt&&yt.graduatedSkip===null)){var bt=yt.measuredBounds,Vt=yt.strokeWidth*yt.scale,zt=yt.alignmentFocus;zt.Mc()&&(zt=qr);for(var $t=0;$t<Ct;$t++){var ie=xt[$t].$l,oe=xt[$t].angle,de=zt,ke=yt.Ab;ke.reset(),ke.translate(ie.x+rt.x,ie.y+rt.y),ke.rotate(oe+yt.angle,0,0),ke.translate(-bt.width*de.x+de.offsetX+Vt/2,-bt.height*de.y+de.offsetY+Vt/2),ke.scale(yt.scale,yt.scale),_l(yt,!1),yt.wh.set(yt.Ab),yt.Kk=yt.scale,wl(yt,!1),yt.gc(y,x),b&&(a.svg.appendChild(yt.svg),yt.svg=null),yt.Ab.reset()}}}else if(yt instanceof To)for(a.temporaryTextBlock===null&&(a.temporaryTextBlock=new To),bt=a.temporaryTextBlock,y1(bt,yt),Vt=0;Vt<Ct;Vt++)zt=xt[Vt],zt.actualBounds&&zt.measuredBounds&&zt.naturalBounds&&(bt.ec=zt.text||"",bt.Kb=zt.Sz||0,bt.Gc=zt.lineCount||0,$t=zt.lines,$t!==void 0&&(bt.Cb=$t[0],bt.Ih=$t[1],bt.df=$t[2],bt.Le=$t[3],bt.Qc=$t[4],bt.Qb=$t[5],bt.ze=$t[6]),zt.naturalBounds&&(bt.dc=zt.naturalBounds),zt.actualBounds&&($t=zt.actualBounds,bt.arrange($t.x,$t.y,$t.width,$t.height)),$t=zt.actualBounds,bt.arrange($t.x,$t.y,$t.width,$t.height),ie=zt.measuredBounds,zt=zt.naturalBounds,oe=bt.Ab,oe.reset(),oe.translate($t.x+rt.x,$t.y+rt.y),oe.translate(-ie.x,-ie.y),bt.no(oe,zt.x,zt.y,zt.width,zt.height),_l(bt,!1),bt.wh.set(bt.Ab),bt.Kk=bt.scale,wl(bt,!1),bt.Ng=yt.part,bt.Me=yt.panel,bt.gc(y,x),bt.Me=null,bt.Ng=null,b&&(a.svg.appendChild(bt.svg),bt.svg=null))}}x.$i=E,y.restore(),y.Vc(!0)};function Pn(a,y){if(fe.call(this),this.na=null,a===void 0)this.na=Pn.Position;else if(typeof a=="string"){var x=tu.I(a);x!==null&&(this.na=x)}else a instanceof wa?this.na=a:a&&(this.na=Pn.Position,y=a);this.na===null&&Gt("Panel type not specified or PanelLayout not loaded: "+a),this.l=this.l|4194304|(this.na===Pn.Grid?1048576:0),this.O=new cn,this.yb=ca,this.Tm=xa,this.Uf=sr,this.$g=null,this.$e="",this.jg=new Te(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=wi,this.jn=oo,this.kn=jn,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,y&&Object.assign(this,y)}Le(Pn,fe),Pn.prototype.cloneProtected=function(a){fe.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},Pn.prototype.Af=function(a){fe.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},Pn.prototype.copy=function(){var a=fe.prototype.copy.call(this);if(a!==null){for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E].copy();b.wi(a),b.Ng=null;var z=a.O,tt=z.count;if(z.Gb(tt,b),z=a.part,z!==null){z.Rh=null,b.portId!==null&&z instanceof qn&&(z.Te=!0);var rt=a.diagram;rt!==null&&rt.undoManager.isUndoingRedoing||z.cb(uo,"elements",a,null,b,null,tt)}}return a}return null},wt=Pn.prototype,wt.toString=function(){return"Panel("+this.type.name+")#"+zi(this)},wt.Pn=function(a){fe.prototype.Pn.call(this,a);for(var y=this.O.s,x=y.length,E=0;E<x;E++)y[E].Pn(a)},wt.hh=function(a,y){if(this.na===Pn.Grid)a.yc(),this.na.gc(this,a,y);else if(this.na===Pn.Graduated)a.yc(),this.na.gc(this,a,y);else{if(this.na===Pn.Table)if(a.yc(),a instanceof Qs){var x=a.yd;a.yd=dm(a,"gojs-ts"),gv(this,a),a.nh.pop(),a.yd=x}else gv(this,a);(x=this.isClipping&&this.na===Pn.Spot)&&a.save();for(var E=this.Pb(),b=this.O.s,z=b.length,tt=0;tt<z;tt++){var rt=b[tt];x&&rt===E&&(a.clipInsteadOfFill=!0),rt.gc(a,y),x&&rt===E&&(a.clipInsteadOfFill=!1)}x&&(a.restore(),a.Vc(!0))}};function gv(a,y){y.lineCap="butt";var x=0<a.rowCount?a.rowDefs:null,E=0<a.columnCount?a.colDefs:null;x!==null&&Lm(a,y,!0,x,!0),E!==null&&Lm(a,y,!1,E,!0),x!==null&&r1(a,y,!0,x),E!==null&&r1(a,y,!1,E),x!==null&&Lm(a,y,!0,x,!1),E!==null&&Lm(a,y,!1,E,!1)}function r1(a,y,x,E){for(var b=E.length,z=a.actualBounds,tt=a.naturalBounds,rt=!0,ot=0;ot<b;ot++){var lt=E[ot];if(lt!==void 0&&lt.actual!==0)if(rt)rt=!1;else{if(x){if(lt.position>tt.height)continue}else if(lt.position>tt.width)continue;var ut=lt.separatorStrokeWidth;isNaN(ut)&&(ut=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var ft=lt.separatorStroke;if(ft===null&&(ft=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),ut!==0&&ft!==null){ta(a,y,ft,!1,!1,tt,z),ft=!1;var yt=lt.separatorDashArray;yt===null&&(yt=x?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray),yt!==null&&(ft=!0,y.js(yt,0)),y.beginPath(),yt=lt.position+ut,x?yt>tt.height&&(ut-=yt-tt.height):yt>tt.width&&(ut-=yt-tt.width),lt=lt.position+ut/2,y.lineWidth=ut,ut=a.yb,x?(lt+=ut.top,yt=tt.width-ut.right,y.moveTo(ut.left,lt),y.lineTo(yt,lt)):(lt+=ut.left,yt=tt.height-ut.bottom,y.moveTo(lt,ut.top),y.lineTo(lt,yt)),y.stroke(),y.Se(),ft&&y.fs()}}}}function Lm(a,y,x,E,b){for(var z=E.length,tt=a.actualBounds,rt=a.naturalBounds,ot=o1(a,!0),lt=o1(a,!1),ut=0;ut<z;ut++){var ft=E[ut];if(ft!==void 0&&ft.background!==null&&ft.coversSeparators!==b&&ft.actual!==0){var yt=x?tt.height:tt.width;if(!(ft.position>yt)){var xt=ft.Wc(),Ct=ft.separatorStrokeWidth;isNaN(Ct)&&(Ct=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var bt=ft.separatorStroke;bt===null&&(bt=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),(bt===null||ft.index===(x?ot:lt))&&(Ct=0),xt-=Ct,Ct=ft.position+Ct,xt+=ft.actual,Ct+xt>yt&&(xt=yt-Ct),0>=xt||(yt=a.yb,ta(a,y,ft.background,!0,!1,rt,tt),x?y.fillRect(yt.left,Ct+yt.top,tt.width-(yt.left+yt.right),xt):y.fillRect(Ct+yt.left,yt.top,xt,tt.height-(yt.top+yt.bottom)))}}}}function o1(a,y){for(var x=y?a.rowCount:a.columnCount,E=0;E<x;E++){var b=y?a.rowDefs[E]:a.colDefs[E];if(b!==void 0)return b.index}return 0}function pv(a){return a==="LineV"||a==="BarV"}wt.lv=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].lv();this.Uc=!0},wt.kk=function(a,y,x){if(!fe.prototype.kk.call(this,a,y,x))return!1;if(this.type===Pn.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===Pn.Grid||this.na===Pn.Graduated)return this.svg.innerHTML="",this.svg.remove(),!1;x=this.O.s;for(var E=x.length,b=0;b<E;b++)x[b].gc(a,y);return!0},wt.nk=function(){return!0},wt.$o=function(a,y,x,E){if(!this.isClipping)if(this.Dd()&&a.bk!==null){a=a.bk,y=this.O.s;for(var b=0,z=0,tt=0;tt<y.length;tt++)if(y[tt].Ed()){var rt=y[tt].actualBounds;b=tt===0?rt.x:Math.min(rt.x,b),z=tt===0?rt.y:Math.min(rt.y,z)}E.setAttributeNS(null,"clip-path","path('M "+(a.x-x.x-b)+","+(a.y-x.y-z)+" l "+a.width+" 0 l 0 "+a.height+" l -"+a.width+" 0 z')")}else fe.prototype.$o.call(this,a,y,x,E)},wt.Sj=function(a,y,x,E,b){var z=this.se(),tt=this.transform,rt=1/(tt.m11*tt.m22-tt.m12*tt.m21),ot=tt.m22*rt,lt=-tt.m12*rt,ut=-tt.m21*rt,ft=tt.m11*rt,yt=rt*(tt.m21*tt.dy-tt.m22*tt.dx),xt=rt*(tt.m12*tt.dx-tt.m11*tt.dy);if(this.areaBackground!==null)return tt=this.actualBounds,_t.Ff(tt.left,tt.top,tt.right,tt.bottom,a,y,x,E,b);if(this.background!==null)return z=a*ot+y*ut+yt,rt=a*lt+y*ft+xt,a=x*ot+E*ut+yt,ot=x*lt+E*ft+xt,b.h(0,0),x=this.naturalBounds,z=_t.Ff(0,0,x.width,x.height,z,rt,a,ot,b),b.transform(tt),z;z||(ot=1,ut=lt=0,ft=1,xt=yt=0),rt=a*ot+y*ut+yt,a=a*lt+y*ft+xt,ot=x*ot+E*ut+yt,x=x*lt+E*ft+xt,b.h(ot,x),E=(ot-rt)*(ot-rt)+(x-a)*(x-a),lt=!1,ft=this.O.s,xt=ft.length,ut=At.alloc(),yt=null,y=1/0;var Ct=null,bt=this.isClipping&&this.na===Pn.Spot;bt&&(Ct=At.alloc(),yt=this.Pb(),(lt=yt.Sj(rt,a,ot,x,Ct))&&(y=(rt-Ct.x)*(rt-Ct.x)+(a-Ct.y)*(a-Ct.y)));for(var Vt=0;Vt<xt;Vt++){var zt=ft[Vt];zt.visible&&zt!==yt&&zt.Sj(rt,a,ot,x,ut)&&(lt=!0,zt=(rt-ut.x)*(rt-ut.x)+(a-ut.y)*(a-ut.y),zt<E&&(E=zt,b.set(ut)))}return bt&&(y>E&&b.set(Ct),At.free(Ct)),At.free(ut),z&&b.transform(tt),lt},wt.Gj=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Gj();fe.prototype.Gj.call(this)},wt.v=function(a){if(!ul(this)){fe.prototype.v.call(this,a),a=null,(this.na===Pn.Auto||this.na===Pn.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=Ts(b,!1);(b instanceof Ps||b instanceof Pn||b instanceof To||z!==ln)&&b.v(!0)}}}},wt.Uj=function(){if(!ul(this)){ma(this,!0),Hu(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Uj()}},wt.Uk=function(){if(!(this.l&2048)){_l(this,!0),wl(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()}},wt.Wu=function(){wl(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()},wt.Wl=function(a,y,x,E){var b=this.jg;b.h(0,0,0,0);var z=this.desiredSize,tt=this.minSize;x===void 0&&(x=tt.width,E=tt.height),x=Math.max(x,tt.width),E=Math.max(E,tt.height);var rt=this.maxSize;isNaN(z.width)||(a=Math.min(z.width,rt.width)),isNaN(z.height)||(y=Math.min(z.height,rt.height)),a=Math.max(x,a),y=Math.max(E,y);var ot=this.yb;a=Math.max(a-ot.left-ot.right,0),y=Math.max(y-ot.top-ot.bottom,0);var lt=this.O.s;lt.length!==0&&this.na.measure(this,a,y,lt,b,x,E),a=b.width+ot.left+ot.right,ot=b.height+ot.top+ot.bottom,isFinite(z.width)&&(a=z.width),isFinite(z.height)&&(ot=z.height),a=Math.min(rt.width,a),ot=Math.min(rt.height,ot),a=Math.max(tt.width,a),ot=Math.max(tt.height,ot),a=Math.max(x,a),ot=Math.max(E,ot),ao(b,a,ot),ao(this.naturalBounds,a,ot),this.Ge(0,0,a,ot)},wt.Pb=function(){if(this.$g===null){var a=this.O.s,y=a.length;if(y===0)return null;for(var x=0;x<y;x++){var E=a[x];if(E.isPanelMain===!0)return this.$g=E}this.$g=a[0]}return this.$g};function ch(a){return a.part!==null?a.part.locationObject:null}wt.eh=function(a,y,x,E){var b=this.O.s;if(this.actualBounds.h(a,y,x,E),b.length!==0){if(!this.desiredSize.w()){a=Ts(this,!0);var z=this.measuredBounds;y=z.width,z=z.height;var tt=this.Kg,rt=tt.left+tt.right;switch(tt=tt.top+tt.bottom,y===x&&z===E&&(a=ln),a){case ln:(y>x||z>E)&&(this.v(),this.measure(y>x?x:y,z>E?E:z,0,0));break;case yn:this.v(!0),this.measure(x+rt,E+tt,0,0);break;case Mi:this.v(!0),this.measure(x+rt,z+tt,0,0);break;case Ri:this.v(!0),this.measure(y+rt,E+tt,0,0)}}this.na.arrange(this,b,this.jg)}},wt.gh=function(a){var y=this.naturalBounds,x=ch(this);if(Zr(0,0,y.width,y.height,a.x,a.y)){y=this.O.s;for(var E=y.length,b=At.allocAt(0,0);E--;){var z=y[E];if((z.visible||z===x)&&(An(b.set(a),z.transform),z.ca(b)))return At.free(b),!0}return At.free(b),!(this.Ma===null&&this.areaBackground===null)}return!1},wt.ks=function(a){if(this.bindingId===a)return this;for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E].ks(a);if(b!==null)return b}return null},wt.qm=function(a,y){if(y(this,a),a instanceof Pn){a=a.O.s;for(var x=a.length,E=0;E<x;E++)this.qm(a[E],y)}};function $d(a,y){a1(a,a,y)}function a1(a,y,x){x(y),y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=y[b];z instanceof Pn&&a1(a,z,x)}}function vx(a,y){s1(a,a,y)}function s1(a,y,x){if(x(y),y instanceof Pn){y=y.O.s;for(var E=y.length,b=0;b<E;b++)s1(a,y[b],x)}}wt.Nl=function(a){return l1(this,this,a)};function l1(a,y,x){if(x(y))return y;if(y instanceof Pn){y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=l1(a,y[b],x);if(z!==null)return z}}return null}wt.fb=function(a){if(this.name===a)return this;var y=this.O.s,x=y.length;this.Hh===null&&this.itemTemplateMap===null||(x=Qg(this));for(var E=0;E<x;E++){var b=y[E];if(b instanceof Pn){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 Pn?x=Math.max(x,u1(b)):b instanceof fr&&(x=Math.max(x,b.ig/2*b.strokeMiterLimit*b.Df()))}return x}wt.se=function(){return!(this.type===Pn.TableRow||this.type===Pn.TableColumn)};function Th(a){return a.type===Pn.TableRow||a.type===Pn.TableColumn}wt.ic=function(a,y,x){if(this.pickable===!1||(y===void 0&&(y=null),x===void 0&&(x=null),Ss(this)))return null;var E=this.naturalBounds,b=1/this.Df(),z=this.se(),tt=z?a:An(At.allocAt(a.x,a.y),this.transform),rt=this.diagram,ot=10,lt=5;if(rt!==null&&(ot=rt.Ql("extraTouchArea"),lt=ot/2),Zr(-(lt*b),-(lt*b),E.width+ot*b,E.height+ot*b,tt.x,tt.y)){if(!this.isAtomic){b=this.O.s;var ut=b.length;if(rt=At.alloc(),lt=(ot=this.isClipping&&this.na===Pn.Spot)?this.Pb():null,ot&&(lt.se()?An(rt.set(a),lt.transform):rt.set(a),!lt.ca(rt)))return At.free(rt),z||At.free(tt),null;for(var ft=ch(this);ut--;){var yt=b[ut];if((yt.visible||yt===ft)&&(yt.se()?An(rt.set(a),yt.transform):rt.set(a),!ot||yt!==lt)){var xt=null;if(yt instanceof Pn?xt=yt.ic(rt,y,x):yt.pickable===!0&&yt.ca(rt)&&(xt=yt),xt!==null&&(y!==null&&(xt=y(xt)),xt!==null&&(x===null||x(xt))))return At.free(rt),z||At.free(tt),xt}}At.free(rt)}return this.background===null&&this.areaBackground===null?(z||At.free(tt),null):(a=Zr(0,0,E.width,E.height,tt.x,tt.y)?this:null,z||At.free(tt),a)}return z||At.free(tt),null},wt.ji=function(a,y,x,E){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var b=this.naturalBounds,z=this.se(),tt=z?a:An(At.allocAt(a.x,a.y),this.transform);if(b=Zr(0,0,b.width,b.height,tt.x,tt.y),Th(this)||b){if(!this.isAtomic){for(var rt=this.O.s,ot=rt.length,lt=At.alloc(),ut=ch(this);ot--;){var ft=rt[ot];if(ft.visible||ft===ut){ft.se()?An(lt.set(a),ft.transform):lt.set(a);var yt=ft;ft=ft instanceof Pn?ft:null,(ft!==null?ft.ji(lt,y,x,E):yt.ca(lt))&&yt.pickable!==!1&&(y!==null&&(yt=y(yt)),yt===null||x!==null&&!x(yt)||E.add(yt))}}At.free(lt)}return z||At.free(tt),b&&(this.background!==null||this.areaBackground!==null)}return z||At.free(tt),!1},wt.Cf=function(a,y,x,E,b,z){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var tt=z;if(z===void 0&&(tt=ae.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&ae.free(tt),!0;if(this.Yc(a,tt)){if(!this.isAtomic)for(var rt=ch(this),ot=this.O.s,lt=ot.length;lt--;){var ut=ot[lt];if(ut.visible||ut===rt){var ft=ut.actualBounds,yt=this.naturalBounds;ft.x>yt.width||ft.y>yt.height||0>ft.x+ft.width||0>ft.y+ft.height||(ft=ut,ut=ut instanceof Pn?ut:null,yt=ae.alloc(),yt.set(tt),(ut!==null?ut.Cf(a,y,x,E,b,yt):ka(ft,a,E,yt))&&(y!==null&&(ft=y(ft)),ft===null||x!==null&&!x(ft)||b.add(ft)),ae.free(yt))}}return z===void 0&&ae.free(tt),E}return z===void 0&&ae.free(tt),!1};function mv(a,y,x,E){for(var b=a.O.s,z=b.length;z--;){var tt=b[z];if(tt.visible){var rt=tt.actualBounds,ot=a.naturalBounds;rt.x>ot.width||rt.y>ot.height||0>rt.x+rt.width||0>rt.y+rt.height||(tt instanceof Pn&&mv(tt,y,x,E),y!==null&&(tt=y(tt)),tt===null||x!==null&&!x(tt)||E.add(tt))}}}wt.og=function(a,y,x,E,b,z){if(this.pickable===!1)return!1;x===void 0&&(x=null),E===void 0&&(E=null);var tt=this.naturalBounds,rt=this.se(),ot=rt?a:An(At.allocAt(a.x,a.y),this.transform),lt=rt?y:An(At.allocAt(y.x,y.y),this.transform),ut=ot.Bf(lt),ft=0<ot.x&&ot.x<tt.width&&0<ot.y&&ot.y<tt.height||Un(ot.x,ot.y,0,0,0,tt.height)<=ut||Un(ot.x,ot.y,0,tt.height,tt.width,tt.height)<=ut||Un(ot.x,ot.y,tt.width,tt.height,tt.width,0)<=ut||Un(ot.x,ot.y,tt.width,0,0,0)<=ut;if(tt=ot.zd(0,0)<=ut&&ot.zd(0,tt.height)<=ut&&ot.zd(tt.width,0)<=ut&&ot.zd(tt.width,tt.height)<=ut,rt||(At.free(ot),At.free(lt)),ft){if(!this.isAtomic){ot=At.alloc(),lt=At.alloc(),ut=ch(this);for(var yt=this.O.s,xt=yt.length;xt--;){var Ct=yt[xt];if(Ct.visible||Ct===ut){var bt=Ct.actualBounds,Vt=this.naturalBounds;(!rt||!(bt.x>Vt.width||bt.y>Vt.height||0>bt.x+bt.width||0>bt.y+bt.height))&&(Ct.se()?(bt=Ct.transform,An(ot.set(a),bt),An(lt.set(y),bt)):(ot.set(a),lt.set(y)),bt=Ct,Ct=Ct instanceof Pn?Ct:null,(Ct!==null?Ct.og(ot,lt,x,E,b,z):bt.tx(ot,lt,b))&&(x!==null&&(bt=x(bt)),bt===null||E!==null&&!E(bt)||z.add(bt)))}}At.free(ot),At.free(lt)}return b?ft:tt}return!1};function vv(a){var y=null;return a instanceof fr&&(y=a.spot1,y===xa&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot1)),y===null&&(y=jr),y}function yv(a){var y=null;return a instanceof fr&&(y=a.spot2,y===xa&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot2)),y===null&&(y=so),y}wt.add=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];for(x=0;x<y.length;x++)this.Gb(this.O.count,y[x]);return this},wt.M=function(a){return this.O.M(a)},wt.Gb=function(a,y){y instanceof Ai&&Gt("Cannot add a Part to a Panel: "+y+"; use a Panel instead"),(this===y||this.rg(y))&&(this===y&&Gt("Cannot make a Panel contain itself: "+this.toString()),Gt("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+y.toString()));var x=y.panel;if(x!==null&&x!==this&&Gt("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!==Pn.Grid||y instanceof fr||Gt("Can only add Shapes to a Grid Panel, not: "+y),this.na!==Pn.Graduated||y instanceof fr||y instanceof To||Gt("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 Be),this.ge.add(E,y))}var b=this.O;if(E=-1,x===this){for(var z=-1,tt=this.O.s,rt=tt.length,ot=0;ot<rt;ot++)if(tt[ot]===y){z=ot;break}if(z!==-1){if(z===a||z+1>=b.count&&a>=b.count)return;b.mb(z),E=z}else Gt("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),ul(this)||this.v(),y.v(!1),y.portId!==null?this.Te=!0:y instanceof Pn&&y.Te===!0&&(this.Te=!0),this.graduatedIntervals=null,this.If()||Mm(this,y,!1),x=this.part,x!==null&&(x.Rh=null,x.ag=NaN,this.Te&&x instanceof qn&&(x.Te=!0),x.Te&&x instanceof qn&&(x.wc=null),b=this.diagram,b!==null&&b.undoManager.isUndoingRedoing||(E!==-1&&x.cb(yo,"elements",this,y,null,E,null),x.cb(uo,"elements",this,null,y,null,a)))};function Sv(a,y){a.l=y?a.l|16777216:a.l&-16777217}wt.remove=function(a){for(var y=this.O.s,x=y.length,E=-1,b=0;b<x;b++)if(y[b]===a){E=b;break}E!==-1&&this.pc(E,!0)},wt.mb=function(a){0<=a&&this.pc(a,!0)},wt.pc=function(a,y){var x=this.O,E=x.M(a);if(E.Ng=null,E.wi(null),this.ge!==null){var b=E.data;typeof b=="object"&&this.ge.remove(b)}x.mb(a),ma(this,!1),this.v(),this.$g===E&&(this.$g=null),this.graduatedIntervals=null;var z=this.part;z!==null&&(z.Rh=null,z.ag=NaN,z.Wb(),z instanceof qn&&(E instanceof Pn?E.qm(E,function(tt,rt){Gv(z,rt,y)}):Gv(z,E,y)),x=this.diagram,x!==null&&x.undoManager.isUndoingRedoing||z.cb(yo,"elements",this,E,null,a,null))},wt.Fb=function(a){0>a&&En(a,">= 0",Pn,"getRowDefinition:idx"),a=Math.round(a);var y=this.rowDefs;if(y[a]===void 0){var x=new va;x.wi(this),x.isRow=!0,x.index=a,y[a]=x,this.cb(uo,"rowdefs",this,null,x,null,a)}return y[a]},wt.oA=function(a){if(0>a&&En(a,">= 0",Pn,"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(yo,"rowdefs",this,x,null,a,null),this.v()}}};function h1(a,y,x){var E=a.rowDefs;if(!(0>y)){if(E[y]=x instanceof va?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}wt.Eb=function(a){0>a&&En(a,">= 0",Pn,"getColumnDefinition:idx"),a=Math.round(a);var y=this.colDefs;if(y[a]===void 0){var x=new va;x.wi(this),x.isRow=!1,x.index=a,y[a]=x,this.cb(uo,"coldefs",this,null,x,null,a)}return y[a]},wt.jA=function(a){if(0>a&&En(a,">= 0",Pn,"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(yo,"coldefs",this,x,null,a,null),this.v()}}};function d1(a,y,x){var E=a.colDefs;if(!(0>y)){if(E[y]=x instanceof va?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}wt.Gy=function(a){var y=null;return a.isRow?y=this.Fb(a.index):a.isRow||(y=this.Eb(a.index)),y&&km(y,a),this},wt.Hy=function(a,y){return(a=this.Fb(a))&&km(a,new va(y)),this},wt.By=function(a,y){return(a=this.Eb(a))&&km(a,new va(y)),this},wt.nz=function(a){if(0>a||this.type!==Pn.Table||this.rowCount===0)return-1;for(var y=0,x=this.rowDefs,E=x.length,b=this.topIndex;b<E;b++){var z=x[b];if(z!==void 0&&(y+=z.total,a<y))break}return b},wt.fz=function(a){if(0>a||this.type!==Pn.Table||this.columnCount===0)return-1;for(var y=0,x=this.colDefs,E=x.length,b=this.leftIndex;b<E;b++){var z=x[b];if(z!==void 0&&(y+=z.total,a<y))break}return b},wt.Fz=function(a,y){if(y===void 0&&(y=new At(NaN,NaN)),this.type!==Pn.Graduated)return y.h(NaN,NaN),y;a=Math.min(Math.max(a,this.graduatedMin),this.graduatedMax);var x=this.Pb();return x.geometry.Pu((a-this.graduatedMin)/this.graduatedRange,y),x.transform.Ga(y)},wt.Gz=function(a){if(this.type!==Pn.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 jl(a){var y=a.allBindings;if(y===null)a.data!==null&&Gt("Template cannot have .data be non-null: "+a),a.allBindings=y=new cn;else if(y._isFrozen)return;var x=new cn;Sv(a,!1),a.qm(a,function(lt,ut){ut.th();var ft=ut.localBindings;if(ft!==null)for(Dc(ut,!1),ft=ft.iterator;ft.next();){var yt=ft.value;yt.mode===Sp&&Dc(ut,!0);var xt=yt.sourceName;xt!==null&&(xt==="/"&&Sv(lt,!0),xt=FS(yt,lt,ut),xt!==null&&(x.add(xt),xt.srcBindings===null&&(xt.srcBindings=new cn),xt.srcBindings.add(yt))),y.add(yt)}if(ut instanceof Pn&&ut.type===Pn.Table){if(0<ut.rowCount){for(lt=ut.rowDefs,ft=lt.length,yt=0;yt<ft;yt++)if(xt=lt[yt],xt!==void 0&&xt.be!==null)for(var Ct=xt.be.iterator;Ct.next();){var bt=Ct.value;bt.xd=xt,bt.to=2,bt.wl=xt.index,y.add(bt)}}if(0<ut.columnCount){for(ut=ut.colDefs,lt=ut.length,ft=0;ft<lt;ft++)if(yt=ut[ft],yt!==void 0&&yt.be!==null)for(xt=yt.be.iterator;xt.next();)Ct=xt.value,Ct.xd=yt,Ct.to=1,Ct.wl=yt.index,y.add(Ct)}}});for(var E=x.iterator;E.next();){var b=E.value;if(b.srcBindings!==null){Dc(b,!0);for(var z=b.srcBindings.iterator;z.next();){var tt=z.value;b.localBindings===null&&(b.localBindings=new cn),b.localBindings.add(tt)}}b.srcBindings=null}for(E=y.iterator;E.next();)if(b=E.value,z=b.xd,z!==null){b.xd=null;var rt=b.targetProperty,ot=rt.indexOf(".");0<ot&&z instanceof Pn&&(tt=rt.substring(0,ot),rt=rt.substr(ot+1),ot=z.fb(tt),ot!==null?(z=ot,b.targetProperty=rt):Gn('Warning: unable to find GraphObject named "'+tt+'" for Binding: '+b.toString())),z instanceof va?(tt=zi(z.panel),b.Ai=tt===void 0?-1:tt,z.panel.bindingId=b.Ai):z instanceof fe?(tt=zi(z),b.Ai=tt===void 0?-1:tt,z.bindingId=b.Ai):Gt("Unknown type of binding target: "+z)}y.freeze(),a instanceof Ai&&a.Zc()&&a.Va()}wt.Uy=function(a){a===void 0&&(a=!1);var y=this.copy();return vx(y,function(x){x instanceof Pn&&(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&&jl(y),y},wt.La=function(a){var y=this.allBindings;if(y!==null)for(a===void 0&&(a=""),y=y.iterator;y.next();){var x=y.value,E=x.sourceProperty;if((a===""||E===""||E===a)&&(E=x.targetProperty,x.converter!==null||E!=="")){E=this.data;var b=x.sourceName;if(b!==null){if(b==="")E=this;else if(b==="/")E=this;else if(b===".")E=this;else if(b==="..")E=this;else if(E=this.fb(b),E===null)continue}else if(x.isToModel)if(E=this.diagram,E!==null)E=E.model.modelData;else continue;var z=this,tt=x.Ai;if(tt!==-1){if(z=this.ks(tt),z===null)continue}else x.xd!==null&&(z=x.xd);if(b==="/"?E=z.part:b==="."?E=z:b===".."&&(E=z.panel),b=x.to,b!==0){if(!(z instanceof Pn))continue;b===1?z=z.Eb(x.wl):b===2&&(z=z.Fb(x.wl))}z!==void 0&&x.Mv(z,E)}}},wt.sx=function(a){return a==null||this.ge===null?null:this.ge.I(a)};function yx(a,y){a=a.O.s;for(var x=a.length,E=y.length,b=0,z=null;b<x&&(z=a[b],!(z instanceof Pn&&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 Pn)||z.data!==y[tt])return!0;b++,tt++}return!1}function Qg(a){if(a.type===Pn.Spot||a.type===Pn.Auto)return Math.min(a.O.length,1);if(a.type===Pn.Link){a=a.O;for(var y=a.length,x=0;x<y;x++){var E=a.M(x);if(!(E instanceof fr&&E.isPanelMain))break}return x}return a.type===Pn.Table&&0<a.O.length&&(a=a.O.M(0),a.isPanelMain&&a instanceof Pn&&Th(a))?1:0}wt.mv=function(){for(var a=Qg(this);this.O.length>a;)this.pc(this.O.length-1,!1);f1(this,this.itemArray)};function f1(a,y){var x=Qg(a);if(y===null||y.length===0)for(;a.O.length>x;)a.pc(a.O.length-1,!1);else if(a.O.length<=x){x=y.length;for(var E=0;E<x;E++)Fm(a,y[E],E,!0)}else{E=x;for(var b=0;b<y.length;b++,E++){var z=y[b],tt=E<a.O.length?a.O.M(E):null;if(tt instanceof Pn){if(tt.data!==z){var rt=Pv(a,tt.data),ot=Pv(a,z),lt=ot!==rt;lt||(rt=wv(a,rt),lt=wv(a,ot)!==rt),lt?(a.pc(E,!1),Fm(a,z,b,!1)):tt.data=z}}else Fm(a,z,b,!1)}for(;E<a.O.length;)a.pc(E,!1);a.$g=null,xv(a,x,0),ul(a)||a.v(),a.graduatedIntervals=null,a.If()||Mm(a,a,!1),y=a.part,y!==null&&(y.Rh=null,y.ag=NaN,a.Te&&y instanceof qn&&(y.Te=!0),y.Te&&y instanceof qn&&(y.wc=null))}}function Fm(a,y,x,E){if(!(y==null||0>x)){var b=Pv(a,y);if(b=wv(a,b),b!==null){if(jl(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 Be),a.ge.add(y,b)),z=x+Qg(a),a.Gb(z,b),E&&(b.ub=y,xv(a,z,x),b.ub=null),b.data=y}}}function xv(a,y,x){for(a=a.O;y<a.length;){var E=a.M(y);if(E instanceof Pn){var b=y,z=x;E.type===Pn.TableRow?E.row=b:E.type===Pn.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=aa(y,a)}else return"";if(a===void 0)return"";if(typeof a=="string")return a;Gt("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,Gn('No item template Panel found for category "'+y+'" on '+a),Gn(" Using default item template."),a=new Pn,y=new To,y.bind(new la("text","",ji)),a.add(y),p1=a),E=p1)),E}function Mm(a,y,x){var E=y.enabledChanged;if(E!==null&&E(y,x),y instanceof Pn){y=y.O.s,E=y.length;for(var b=0;b<E;b++){var z=y[b];x&&z instanceof Pn&&!z.isEnabled||Mm(a,z,x)}}}function Nu(a,y){y.name=a,tu.add(a,y)}Se.Object.defineProperties(Pn.prototype,{type:{get:function(){return this.na},set:function(a){var y=this.na;y!==a&&(this.na=a,this.isAtomic=this.na===Pn.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&&En(a,">= 0",Pn,"padding"),a=new or(a)):(0>a.left&&En(a.left,">= 0",Pn,"padding:value.left"),0>a.right&&En(a.right,">= 0",Pn,"padding:value.right"),0>a.top&&En(a.top,">= 0",Pn,"padding:value.top"),0>a.bottom&&En(a.bottom,">= 0",Pn,"padding:value.bottom"));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.v(),this.g("padding",y,a))}},defaultAlignment:{get:function(){return this.Tm},set:function(a){var y=this.Tm;y.D(a)||(this.Tm=a=a.J(),this.v(),this.g("defaultAlignment",y,a))}},defaultStretch:{get:function(){return this.Uf},set:function(a){var y=this.Uf;y!==a&&(this.Uf=a,this.v(),this.g("defaultStretch",y,a))}},defaultSeparatorPadding:{get:function(){return this.T!==null?this.T.Qp:ca},set:function(a){typeof a=="number"&&(a=new or(a));var y=this.defaultSeparatorPadding;y.D(a)||(a=a.J(),this.T===null&&(this.T=new Ll),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 So)&&(a instanceof So&&a.freeze(),this.T===null&&(this.T=new Ll),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 Ll),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)||Gt("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 Ll),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 So)&&(a instanceof So&&a.freeze(),this.T===null&&(this.T=new Ll),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 Ll),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)||Gt("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 Ll),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 Ll),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||Gt("Invalid Panel.gridCellSize: "+a),this.jn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Mu(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()||Gt("Invalid Panel.gridOrigin: "+a),this.kn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Mu(x),this.N(),this.g("gridOrigin",y,a)}}},graduatedMin:{get:function(){return this.ra!==null?this.ra.lq:0},set:function(a){var y=this.graduatedMin;y!==a&&(this.ra===null&&(this.ra=new fh),this.ra.lq=a,this.v(),this.g("graduatedMin",y,a),Ua(this)&&(a=this.part,a!==null&&Ho(this,a,"graduatedRange")))}},graduatedMax:{get:function(){return this.ra!==null?this.ra.F:100},set:function(a){var y=this.graduatedMax;y!==a&&(this.ra===null&&(this.ra=new fh),this.ra.F=a,this.v(),this.g("graduatedMax",y,a),Ua(this)&&(a=this.part,a!==null&&Ho(this,a,"graduatedRange")))}},graduatedRange:{get:function(){return this.graduatedMax-this.graduatedMin}},graduatedTickUnit:{get:function(){return this.ra!==null?this.ra.ia:10},set:function(a){var y=this.graduatedTickUnit;y!==a&&0<a&&(this.ra===null&&(this.ra=new fh),this.ra.ia=a,this.v(),this.g("graduatedTickUnit",y,a))}},graduatedTickBase:{get:function(){return this.ra!==null?this.ra.V:0},set:function(a){var y=this.graduatedTickBase;y!==a&&(this.ra===null&&(this.ra=new fh),this.ra.V=a,this.v(),this.g("graduatedTickBase",y,a))}},graduatedMarks:{get:function(){return this.ra!==null?this.ra.u:null},set:function(a){this.ra!==null?this.ra.u=a:a!==null&&(this.ra=new fh,this.ra.u=a)}},graduatedBounds:{get:function(){return this.ra!==null?this.ra.j:null},set:function(a){this.ra!==null?this.ra.j=a:a!==null&&(this.ra=new fh,this.ra.j=a)}},graduatedIntervals:{get:function(){return this.ra!==null?this.ra.o:null},set:function(a){this.ra!==null?this.ra.o=a:a!==null&&(this.ra=new fh,this.ra.o=a)}},temporaryTextBlock:{get:function(){return this.ra!==null?this.ra.Zh:null},set:function(a){this.ra!==null?this.ra.Zh=a:a!==null&&(this.ra=new fh,this.ra.Zh=a)}},panelLayoutState:{get:function(){return this.F},set:function(a){this.F=a}},Te:{get:function(){return(this.l&8388608)!==0},set:function(a){(this.l&8388608)!==0!==a&&(this.l^=8388608)}},rowDefs:{get:function(){return this.T===null&&(this.T=new Ll),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new Ll),this.T.Oc}},columnCount:{get:function(){return this.T===null?0:this.colDefs.length}},rowSizing:{get:function(){return this.T!==null?this.T.ob:Nm},set:function(a){var y=this.rowSizing;y!==a&&(this.T===null&&(this.T=new Ll),this.T.ob=a,this.v(),this.g("rowSizing",y,a))}},columnSizing:{get:function(){return this.T!==null?this.T.j:Nm},set:function(a){var y=this.columnSizing;y!==a&&(this.T===null&&(this.T=new Ll),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)&&Gt("Panel.topIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Ll),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)&&Gt("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Ll),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 Ai&&!(this instanceof Qr);jl(this),this.ub=a;var E=this.diagram;E!==null&&(x?(x=E.partManager,this instanceof kn?(y!==null&&x.bf.remove(y),a!==null&&x.bf.add(a,this)):this instanceof Ai&&(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 Oc),this.A.nb=a)}},itemArray:{get:function(){return this.Hh},set:function(a){var y=this.Hh;if(y!==a||a!==null&&yx(this,a)){var x=this.diagram;y!==a&&(x!==null&&y!==null&&ly(x.partManager,this,x),this.Hh=a,x!==null&&a!==null&&sy(x.partManager,this)),this.g("itemArray",y,a),x!==null&&x.undoManager.isUndoingRedoing||f1(this,a)}}},itemTemplate:{get:function(){return this.itemTemplateMap===null?null:this.itemTemplateMap.I("")},set:function(a){if(this.itemTemplateMap===null){if(a===null)return;this.itemTemplateMap=new Be}var y=this.itemTemplateMap.I("");y!==a&&((a instanceof Ai||a.isPanelMain)&&Gt("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(););xr(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&&(xr(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 rr&&(this.tb=null),this.v(),this.g("isClipping",y,a))}},isOpposite:{get:function(){return(this.l&33554432)!==0},set:function(a){var y=(this.l&33554432)!==0;y!==a&&(this.l^=33554432,this.v(),this.g("isOpposite",y,a))}},isEnabled:{get:function(){return(this.l&4194304)!==0},set:function(a){var y=(this.l&4194304)!==0;if(y!==a){var x=this.panel===null||this.panel.If();this.l^=4194304,this.g("isEnabled",y,a),y=this.diagram,y!==null&&y.undoManager.isUndoingRedoing||x&&Mm(this,this,a)}}},alignmentFocusName:{get:function(){return this.$e},set:function(a){var y=this.$e;y!==a&&(this.$e=a,this.v(),this.g("alignmentFocusName",y,a))}}}),Se.Object.defineProperties(Pn,{Position:{get:function(){return tu.I("Position")}},Horizontal:{get:function(){return tu.I("Horizontal")}},Vertical:{get:function(){return tu.I("Vertical")}},Spot:{get:function(){return tu.I("Spot")}},Auto:{get:function(){return tu.I("Auto")}},Table:{get:function(){return tu.I("Table")}},Viewbox:{get:function(){return tu.I("Viewbox")}},TableRow:{get:function(){return tu.I("TableRow")}},TableColumn:{get:function(){return tu.I("TableColumn")}},Link:{get:function(){return tu.I("Link")}},Grid:{get:function(){return tu.I("Grid")}},Graduated:{get:function(){return tu.I("Graduated")}}}),Pn.prototype.rebuildItemElements=Pn.prototype.mv,Pn.prototype.findItemPanelForData=Pn.prototype.sx,Pn.prototype.updateTargetBindings=Pn.prototype.La,Pn.prototype.copyTemplate=Pn.prototype.Uy,Pn.prototype.graduatedValueForPoint=Pn.prototype.Gz,Pn.prototype.graduatedPointForValue=Pn.prototype.Fz,Pn.prototype.findColumnForLocalX=Pn.prototype.fz,Pn.prototype.findRowForLocalY=Pn.prototype.nz,Pn.prototype.addColumnDefinition=Pn.prototype.By,Pn.prototype.addRowDefinition=Pn.prototype.Hy,Pn.prototype.addRowColumnDefinition=Pn.prototype.Gy,Pn.prototype.removeColumnDefinition=Pn.prototype.jA,Pn.prototype.getColumnDefinition=Pn.prototype.Eb,Pn.prototype.removeRowDefinition=Pn.prototype.oA,Pn.prototype.getRowDefinition=Pn.prototype.Fb,Pn.prototype.removeAt=Pn.prototype.mb,Pn.prototype.remove=Pn.prototype.remove,Pn.prototype.insertAt=Pn.prototype.Gb,Pn.prototype.elt=Pn.prototype.M,Pn.prototype.add=Pn.prototype.add,Pn.prototype.findObject=Pn.prototype.fb,Pn.prototype.findInVisualTree=Pn.prototype.Nl,Pn.prototype.walkVisualTreeFrom=Pn.prototype.qm,Pn.prototype.findMainElement=Pn.prototype.Pb;var g1=!1,p1=null,tu=new Be;Pn.className="Panel",Pn.definePanelLayout=Nu,Nu("Position",new gm),Nu("Vertical",new mm),Nu("Auto",new ym),Nu("Link",new Em);function fh(){this.lq=0,this.F=100,this.ia=10,this.V=0,this.Zh=this.o=this.j=this.u=null}fh.prototype.copy=function(){var a=new fh;return a.lq=this.lq,a.F=this.F,a.ia=this.ia,a.V=this.V,a.u=this.u,a.j=this.j,a.o=this.o,a.Zh=this.Zh,a},fh.className="GradPanelSettings";function Ll(){this.Pc=[],this.Oc=[],this.j=this.ob=Nm,this.hb=this.Hb=0,this.Qp=ca,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}Ll.prototype.copy=function(a){for(var y=new Ll,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},Ll.className="TablePanelSettings";function va(a){Wi(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=xa,this.pa=this.oc=this.oa=0,this.be=null,this.oo=Cv,this.hg=sr,this.lo=this.dg=null,this.mo=NaN,this.Ma=this.tj=null,this.Pm=!1,a&&(Object.assign(this,a),a.column!==void 0?(this.isRow=!1,this.index=a.column):a.row!==void 0&&(this.isRow=!0,this.index=a.row))}va.prototype.copy=function(){var a=new va;return a.uq=this.uq,a.Za=this.Za,a.Hc=this.Hc,a.jj=this.jj,a.hj=this.hj,a.Jb=this.Jb,a.oa=this.oa,a.oc=this.oc,a.pa=this.pa,a.hg=this.hg,a.oo=this.oo,this.dg===null?a.dg=null:a.dg=this.dg.J(),a.lo=this.lo,a.mo=this.mo,a.tj=null,this.tj!==null&&(a.separatorDashArray=Nn(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=Nn(y.separatorDashArray)),a.background=y.background,a.coversSeparators=y.coversSeparators,a.be=y.be}wt=va.prototype,wt.qb=function(a){a.classType===va&&(this.sizing=a)},wt.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+zi(this)},wt.wi=function(a){this.Me=a},wt.Io=function(a){var y=0,x=this.Me;if(this.index!==a&&(a=this.separatorStroke,a===null&&x!==null&&(a=this.isRow?x.defaultRowSeparatorStroke:x.defaultColumnSeparatorStroke),a!==null&&(y=this.separatorStrokeWidth,isNaN(y)&&(x!==null?y=this.isRow?x.defaultRowSeparatorStrokeWidth:x.defaultColumnSeparatorStrokeWidth:y=0))),a=this.dg,a===null)if(x!==null)a=x.defaultSeparatorPadding;else return y;return y+(this.isRow?a.top:a.left)},wt.Wc=function(){var a=0,y=this.Me,x=0,E=this.isRow;if(y!==null&&y.type===Pn.Table)for(var b=E?y.rowDefs.length:y.colDefs.length,z=0;z<b;z++){var tt=E?y.rowDefs[z]:y.colDefs[z];if(tt!==void 0&&tt.oa!==0){x=tt.index;break}}if(this.index!==x&&(x=this.separatorStroke,x===null&&y!==null&&(x=E?y.defaultRowSeparatorStroke:y.defaultColumnSeparatorStroke),x!==null&&(a=this.separatorStrokeWidth,isNaN(a)&&(y!==null?a=E?y.defaultRowSeparatorStrokeWidth:y.defaultColumnSeparatorStrokeWidth:a=0))),E=this.dg,E===null)if(y!==null)E=y.defaultSeparatorPadding;else return a;return a+(this.isRow?E.top+E.bottom:E.left+E.right)},wt.Ob=function(a,y,x){var E=this.Me;if(E!==null&&(E.cb(pr,a,this,y,x,void 0,void 0),this.be!==null&&(y=E.diagram,y!==null&&!y.skipsModelSourceBindings&&(E=E.ih(),E!==null&&(y=E.data,y!==null)))))for(x=this.be.iterator;x.next();)x.value.sp(this,y,a,E)};function bm(a){if(a.sizing===Cv){var y=a.Me;return a.isRow?y.rowSizing:y.columnSizing}return a.sizing}wt.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new la(a,y,x,E):b=a,b.xd=this,a=this.panel,a!==null&&(y=a.ih(),y!==null&&c1(y)&&Gt("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+b+" on "+a)),this.be===null&&(this.be=new cn),this.be.add(b),this},Se.Object.defineProperties(va.prototype,{panel:{get:function(){return this.Me}},isRow:{get:function(){return this.uq},set:function(a){this.uq=a}},index:{get:function(){return this.Za},set:function(a){this.Za=a}},height:{get:function(){return this.Hc},set:function(a){var y=this.Hc;y!==a&&(0>a&&En(a,">= 0",va,"height"),this.Hc=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("height",y,a))}},width:{get:function(){return this.Hc},set:function(a){var y=this.Hc;y!==a&&(0>a&&En(a,">= 0",va,"width"),this.Hc=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("width",y,a))}},minimum:{get:function(){return this.jj},set:function(a){var y=this.jj;y!==a&&((0>a||!isFinite(a))&&En(a,">= 0",va,"minimum"),this.jj=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("minimum",y,a))}},maximum:{get:function(){return this.hj},set:function(a){var y=this.hj;y!==a&&(0>a&&En(a,">= 0",va,"maximum"),this.hj=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("maximum",y,a))}},alignment:{get:function(){return this.Jb},set:function(a){var y=this.Jb;y.D(a)||(this.Jb=a.J(),this.panel!==null&&this.panel.v(),this.Ob("alignment",y,a))}},stretch:{get:function(){return this.hg},set:function(a){var y=this.hg;y!==a&&(this.hg=a,this.panel!==null&&this.panel.v(),this.Ob("stretch",y,a))}},separatorPadding:{get:function(){return this.dg},set:function(a){typeof a=="number"&&(a=new or(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&&_c(a,"RowColumnDefinition.separatorStroke"),a instanceof So&&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)||Gt("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&&_c(a,"RowColumnDefinition.background"),a instanceof So&&a.freeze(),this.Ma=a,this.panel!==null&&this.panel.N(),this.Ob("background",y,a))}},coversSeparators:{get:function(){return this.Pm},set:function(a){var y=this.Pm;y!==a&&(this.Pm=a,this.panel!==null&&this.panel.N(),this.Ob("coversSeparators",y,a))}},sizing:{get:function(){return this.oo},set:function(a){var y=this.oo;y!==a&&(this.oo=a,this.panel!==null&&this.panel.v(),this.Ob("sizing",y,a))}},actual:{get:function(){return this.oa},set:function(a){this.oa=isNaN(this.Hc)?Math.max(Math.min(this.hj,a),this.jj):Math.max(Math.min(this.hj,this.Hc),this.jj)}},measured:{get:function(){return this.oc},set:function(a){this.oc=a}},total:{get:function(){return this.oa+this.Wc()}},position:{get:function(){return this.pa},set:function(a){this.pa=a}}}),va.prototype.computeEffectiveSpacing=va.prototype.Wc,va.prototype.computeEffectiveSpacingTop=va.prototype.Io;var Cv=new en(va,"Default",0),$g=new en(va,"None",1),Nm=new en(va,"ProportionalExtra",2);va.className="RowColumnDefinition",va.Default=Cv,va.None=$g,va.ProportionalExtra=Nm;function fr(a,y){fe.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)}Le(fr,fe),fr.prototype.cloneProtected=function(a){fe.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=Nn(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 qd(a){a.Na===null?a.Na=new Fv:a.Na.nc&&(a.Na=a.Na.copy())}wt=fr.prototype,wt.th=function(){fe.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},wt.qb=function(a){a===ln||a===wi||a===Hr||a===sr?this.geometryStretch=a:fe.prototype.qb.call(this,a)},wt.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+zi(this)};function Of(a,y,x,E){var b=x.length;if(!(4>b)){var z=E.measuredBounds,tt=Math.max(1,z.width);z=z.height;for(var rt=x[0],ot=x[1],lt,ut,ft,yt,xt,Ct,bt=0,Vt=Jn(),zt=2;zt<b;zt+=2)lt=x[zt],ut=x[zt+1],ft=lt-rt,rt=ut-ot,ft===0&&(ft=.001),yt=rt/ft,xt=Math.atan2(rt,ft),Ct=Math.sqrt(ft*ft+rt*rt),Vt.push([ft,xt,yt,Ct]),bt+=Ct,rt=lt,ot=ut;rt=x[0],ot=x[1],ft=E.measuredBounds.width,E instanceof fr&&(ft-=E.strokeWidth),1>ft&&(ft=1),b=x=ft,lt=tt/2,ut=lt!==0,zt=0,Ct=Vt[zt],ft=Ct[0],xt=Ct[1],yt=Ct[2],Ct=Ct[3];for(var $t=0;.1<=bt;){if($t===0&&(ut?(b=x,b-=lt,bt-=lt,ut=!1):b=x,b===0&&(b=1)),b>bt){li(Vt);return}b>Ct?($t=b-Ct,b=Ct):$t=0;var ie=Math.sqrt(b*b/(1+yt*yt));if(0>ft&&(ie=-ie),rt+=ie,ot+=yt*ie,a.translate(rt,ot),a.rotate(xt),a.translate(-(tt/2),-(z/2)),$t===0&&E.hh(a,y),a.translate(tt/2,z/2),a.rotate(-xt),a.translate(-rt,-ot),bt-=b,Ct-=b,$t!==0){if(zt++,zt===Vt.length){li(Vt);return}Ct=Vt[zt],ft=Ct[0],xt=Ct[1],yt=Ct[2],Ct=Ct[3],b=$t}}li(Vt)}}wt.hh=function(a,y){var x=this.xc,E=this.Ui;if(x!==null||E!==null){var b=this.ua;if(b!==null){a.yc();var z=this.actualBounds,tt=this.naturalBounds;E!==null&&ta(this,a,E,!0,!1,tt,z);var rt=this.part,ot=this.ig;if(x===null||ot!==0||rt===null||!this.isPanelMain&&rt.Pb()!==this||(ot=rt.type===Pn.Link&&rt instanceof Qr&&rt.category==="Selection"&&rt.adornedObject instanceof fr&&rt.adornedPart.Pb()===rt.adornedObject?rt.adornedObject.strokeWidth:0),ot===0&&(x=null),x!==null&&ot!==0&&(ta(this,a,x,!1,!1,tt,z),a.lineWidth=ot,a.lineJoin=this.strokeJoin,a.lineCap=this.strokeCap,a.miterLimit=this.strokeMiterLimit),z=!1,rt&&y.Gf("drawShadows")&&(z=rt.isShadowed),a.Il===!1&&(z=!1),rt=!0,x===null||E!==null&&E!=="transparent"||(rt=!1),tt=!1,ot=this.strokeDashArray,ot!==null&&(tt=!0,a.js(ot,this.strokeDashOffset)),b.type===ce.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===ce.u){var lt=b.startX;ot=b.startY;var ut=b.endX,ft=b.endY;b=Math.min(lt,ut);var yt=Math.min(ot,ft);lt=Math.abs(ut-lt),ot=Math.abs(ft-ot),a.beginPath(),a.rect(b,yt,lt,ot),E!==null&&a.ng(E),x!==null&&(rt&&z&&Wu(a),a.jk(),rt&&z&&uh(a)),a.Se()}else if(b.type===ce.F)lt=b.startX,ot=b.startY,ut=b.endX,ft=b.endY,b=Math.abs(ut-lt)/2,yt=Math.abs(ft-ot)/2,lt=Math.min(lt,ut)+b,ot=Math.min(ot,ft)+yt,a.beginPath(),a.moveTo(lt,ot-yt),a.bezierCurveTo(lt+_t.wg*b,ot-yt,lt+b,ot-_t.wg*yt,lt+b,ot),a.bezierCurveTo(lt+b,ot+_t.wg*yt,lt+_t.wg*b,ot+yt,lt,ot+yt),a.bezierCurveTo(lt-_t.wg*b,ot+yt,lt-b,ot+_t.wg*yt,lt-b,ot),a.bezierCurveTo(lt-b,ot-_t.wg*yt,lt-_t.wg*b,ot-yt,lt,ot-yt),a.closePath(),E!==null&&a.ng(E),x!==null&&(rt&&z&&Wu(a),a.jk(),rt&&z&&uh(a)),a.Se();else if(b.type===ce.o)for(b=b.figures,ot=b.length,yt=0;yt<ot;yt++){lt=b.s[yt],a.beginPath(),a.moveTo(lt.startX,lt.startY),ut=lt.segments.s,ft=ut.length;for(var xt=null,Ct=0;Ct<ft;Ct++){var bt=ut[Ct];switch(bt.type){case ar:a.moveTo(bt.endX,bt.endY);break;case Qi:a.lineTo(bt.endX,bt.endY);break;case br:a.bezierCurveTo(bt.point1X,bt.point1Y,bt.point2X,bt.point2Y,bt.endX,bt.endY);break;case Fr:a.quadraticCurveTo(bt.point1X,bt.point1Y,bt.endX,bt.endY);break;case Dr:if(bt.radiusX===bt.radiusY){var Vt=Math.PI/180;a.arc(bt.point1X,bt.point1Y,bt.radiusX,bt.startAngle*Vt,(bt.startAngle+bt.sweepAngle)*Vt,0>bt.sweepAngle,xt!==null?xt.endX:lt.startX,xt!==null?xt.endY:lt.startY)}else if(xt=eo(bt,lt),Vt=xt.length,Vt===0)a.lineTo(bt.centerX,bt.centerY);else for(var zt=0;zt<Vt;zt++){var $t=xt[zt];zt===0&&a.lineTo($t[0],$t[1]),a.bezierCurveTo($t[2],$t[3],$t[4],$t[5],$t[6],$t[7])}break;case no:if(zt=Vt=0,xt!==null&&xt.type===Dr){if(xt=eo(xt,lt),$t=xt.length,$t===0){a.lineTo(bt.endX,bt.endY);break}xt=xt[$t-1]||null,xt!==null&&(Vt=xt[6],zt=xt[7])}else Vt=xt!==null?xt.endX:lt.startX,zt=xt!==null?xt.endY:lt.startY;if(xt=Vi(bt,lt,Vt,zt),Vt=xt.length,Vt===0){a.lineTo(bt.endX,bt.endY);break}for(zt=0;zt<Vt;zt++)$t=xt[zt],a.bezierCurveTo($t[2],$t[3],$t[4],$t[5],$t[6],$t[7]);break;default:Gt("Segment not of valid type: "+bt.type)}bt.isClosed&&a.closePath(),xt=bt}ut=lt.isFilled,z?lt.isShadowed?(ut===!0&&E!=="transparent"&&E!==null&&a.ng(E,lt.isEvenOdd),x!==null&&(ut&&rt&&Wu(a),a.jk(),ut&&rt&&uh(a))):(Wu(a),ut&&E!=="transparent"&&E!==null&&a.ng(E,lt.isEvenOdd),x!==null&&a.jk(),uh(a)):(ut&&E!==null&&a.ng(E,lt.isEvenOdd),x!==null&&a.jk()),a.Se(yt)}if(tt&&a.fs(),this.pathPattern!==null){if(x=this.pathPattern,x.measure(1/0,1/0),E=x.measuredBounds,x.arrange(0,0,E.width,E.height),z=this.geometry,a.save(),a.beginPath(),E=Jn(),z.type===ce.j)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.endY),Of(a,y,E,x);else if(z.type===ce.o)for(z=z.figures.iterator;z.next();){for(rt=z.value,E.length=0,E.push(rt.startX),E.push(rt.startY),tt=rt.startX,b=rt.startY,ot=tt,yt=b,lt=rt.segments.s,ut=lt.length,ft=0;ft<ut;ft++){switch(Ct=lt[ft],Ct.type){case ar:Of(a,y,E,x),E.length=0,E.push(Ct.endX),E.push(Ct.endY),tt=Ct.endX,b=Ct.endY,ot=tt,yt=b;break;case Qi:E.push(Ct.endX),E.push(Ct.endY),tt=Ct.endX,b=Ct.endY;break;case br:_t.Qe(tt,b,Ct.point1X,Ct.point1Y,Ct.point2X,Ct.point2Y,Ct.endX,Ct.endY,.5,E),tt=Ct.endX,b=Ct.endY;break;case Fr:_t.ep(tt,b,Ct.point1X,Ct.point1Y,Ct.endX,Ct.endY,.5,E),tt=Ct.endX,b=Ct.endY;break;case Dr:if(bt=eo(Ct,rt),xt=bt.length,xt===0){E.push(Ct.centerX),E.push(Ct.centerY),tt=Ct.centerX,b=Ct.centerY;break}for(Vt=0;Vt<xt;Vt++)zt=bt[Vt],_t.Qe(tt,b,zt[2],zt[3],zt[4],zt[5],zt[6],zt[7],.5,E),tt=zt[6],b=zt[7];break;case no:if(bt=Vi(Ct,rt,tt,b),xt=bt.length,xt===0){E.push(Ct.endX),E.push(Ct.endY),tt=Ct.endX,b=Ct.endY;break}for(Vt=0;Vt<xt;Vt++)zt=bt[Vt],_t.Qe(tt,b,zt[2],zt[3],zt[4],zt[5],zt[6],zt[7],.5,E),tt=zt[6],b=zt[7];break;default:Gt("Segment not of valid type: "+Ct.type)}Ct.isClosed&&(E.push(ot),E.push(yt),Of(a,y,E,x))}Of(a,y,E,x)}else if(z.type===ce.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),Of(a,y,E,x);else if(z.type===ce.F){if(b=new Ir,b.startX=z.endX,b.startY=(z.startY+z.endY)/2,tt=new Ui(Dr),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=eo(tt,b),rt=z.length,rt===0)E.push(tt.centerX),E.push(tt.centerY);else for(tt=b.startX,b=b.startY,ot=0;ot<rt;ot++)yt=z[ot],_t.Qe(tt,b,yt[2],yt[3],yt[4],yt[5],yt[6],yt[7],.5,E),tt=yt[6],b=yt[7];Of(a,y,E,x)}li(E),a.restore(),a.Vc(!1)}}}},wt.kk=function(a,y,x){return!fe.prototype.kk.call(this,a,y,x)||this.xc===null&&this.Ui===null||this.ua===null||this.pathPattern!==null||this.geometry.figures.length!==this.svg.getElementsByTagName("path").length?!1:(a.Hl=this.svg,this.hh(a,y),a.Hl=null,!0)},wt.nk=function(a){return this.geometry!==null&&1<this.geometry.figures.length||this.pathPattern!==null?!0:fe.prototype.nk.call(this,a)},wt.Dv=function(a,y){if(a.nodeName!=="g")a.setAttributeNS(null,"filter",y);else{a=a.getElementsByTagName("path");for(var x=0;x<a.length;x++)a[x].setAttributeNS(null,"filter",y)}},wt.ga=function(a,y){if(y===void 0&&(y=new At),a instanceof gi){a.Mc()&&Gt("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var x=this.naturalBounds,E=this.strokeWidth;y.h(a.x*(x.width+E)-E/2+x.x+a.offsetX,a.y*(x.height+E)-E/2+x.y+a.offsetY)}else y.set(a);return this.oe.Ga(y),y},wt.mi=function(a){a===void 0&&(a=new Te);var y=this.naturalBounds,x=this.oe;y=Te.allocAt(y.x,y.y,y.width,y.height);var E=this.strokeWidth;return y.Bc(E/2,E/2),E=At.allocAt(y.x,y.y).transform(x),a.h(E.x,E.y,0,0),E.h(y.right,y.y).transform(x),zr(a,E.x,E.y,0,0),E.h(y.right,y.bottom).transform(x),zr(a,E.x,E.y,0,0),E.h(y.x,y.bottom).transform(x),zr(a,E.x,E.y,0,0),Te.free(y),At.free(E),a},wt.gh=function(a,y){var x=this.geometry;if(x===null||this.fill===null&&this.stroke===null)return!1;var E=x.bounds,b=this.strokeWidth/2;x.type!==ce.j||y||(b+=2);var z=Te.alloc();if(z.assign(E),z.Bc(b+2,b+2),!z.ca(a))return Te.free(z),!1;if(E=b+1e-4,x.type===ce.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:(Te.free(z),_t.Yb(x.startX,x.startY,x.endX,x.endY,b,a.x,a.y));if(x.type===ce.u){y=x.startX;var tt=x.startY,rt=x.endX;if(x=x.endY,z.x=Math.min(y,rt),z.y=Math.min(tt,x),z.width=Math.abs(rt-y),z.height=Math.abs(x-tt),this.fill===null){if(z.Bc(-E,-E),z.ca(a))return Te.free(z),!1;z.Bc(E,E)}return this.stroke!==null&&z.Bc(b,b),a=z.ca(a),Te.free(z),a}if(x.type===ce.F){tt=x.startX,b=x.startY,rt=x.endX;var ot=x.endY;if(x=Math.min(tt,rt),y=Math.min(b,ot),tt=Math.abs(rt-tt)/2,b=Math.abs(ot-b)/2,x=a.x-(x+tt),y=a.y-(y+b),this.fill===null){if(tt-=E,b-=E,0>=tt||0>=b||1>=x*x/(tt*tt)+y*y/(b*b))return Te.free(z),!1;tt+=E,b+=E}return this.stroke!==null&&(tt+=E,b+=E),Te.free(z),0>=tt||0>=b?!1:1>=x*x/(tt*tt)+y*y/(b*b)}if(x.type===ce.o)return Te.free(z),this.fill===null?wr(x,a.x,a.y,b):kr(x,a,b,1<this.strokeWidth,y);Gt("Unknown Geometry type: "+x.type)},wt.Wl=function(a,y,x,E){var b=this.desiredSize,z=this.ig;if(a=Math.max(a,0),y=Math.max(y,0),this.Rd!==null)var tt=this.geometry.bounds;else{var rt=this.figure,ot=Lv[rt];if(ot===void 0){var lt=_t.Ze[rt];typeof lt=="string"&&(lt=_t.Ze[lt]),typeof lt=="function"?(ot=lt(null,100,100),Lv[rt]=ot):Gt("Unsupported Figure: "+rt)}tt=ot.bounds}rt=tt.width,ot=tt.height,lt=tt.width;var ut=tt.height;switch(Ts(this,!0)){case ln:E=x=0;break;case yn:lt=Math.max(a-z,0),ut=Math.max(y-z,0);break;case Mi:lt=Math.max(a-z,0),E=0;break;case Ri:x=0,ut=Math.max(y-z,0)}isFinite(b.width)&&(lt=b.width),isFinite(b.height)&&(ut=b.height);var ft=this.maxSize,yt=this.minSize;switch(x=Math.max(x-z,yt.width),E=Math.max(E-z,yt.height),lt=Math.min(ft.width,lt),ut=Math.min(ft.height,ut),lt=isFinite(lt)?Math.max(x,lt):Math.max(rt,x),ut=isFinite(ut)?Math.max(E,ut):Math.max(ot,E),x=Ev(this),x){case ln:break;case yn:rt=lt,ot=ut;break;case wi:x=Math.min(lt/rt,ut/ot),isFinite(x)||(x=1),rt*=x,ot*=x;break;default:Gt(x+" is not a valid geometryStretch.")}this.Rd!==null?(rt===0&&(rt=.001),ot===0&&(ot=.001),x=this.Rd!==null?this.Rd:this.ua,tt=x.bounds,E=rt/tt.width,tt=ot/tt.height,isFinite(E)||(E=1),isFinite(tt)||(tt=1),this.ua=E===1&&tt===1?x:x.copy().scale(E,tt)):this.ua!==null&&_t.$(this.ua.Sk,a-z)&&_t.$(this.ua.Rk,y-z)||(this.ua=fr.makeGeometry(this,rt,ot)),tt=this.ua.bounds,a===1/0||y===1/0?this.Ge(tt.x-z/2,tt.y-z/2,a===0&&rt===0?0:tt.width+z,y===0&&ot===0?0:tt.height+z):this.Ge(-(z/2),-(z/2),lt+z,ut+z),b.w()?(lt=b.width,ut=b.height,lt=Math.min(ft.width,lt),ut=Math.min(ft.height,ut),lt=Math.max(yt.width,lt),ut=Math.max(yt.height,ut),this.dc.h(0,0,lt,ut)):this.dc.assign(tt)};function Ev(a){var y=a.geometryStretch;return a.Rd!==null?y===sr?yn:y:y===sr?Lv[a.figure].defaultStretch:y}wt.eh=function(a,y,x,E){ds(this,a,y,x,E)},wt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},wt.Sj=function(a,y,x,E,b){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),rt=z.m22*tt,ot=-z.m12*tt,lt=-z.m21*tt,ut=z.m11*tt,ft=tt*(z.m21*z.dy-z.m22*z.dx),yt=tt*(z.m12*z.dx-z.m11*z.dy);z=a*rt+y*lt+ft,tt=a*ot+y*ut+yt,rt=x*rt+E*lt+ft,ot=x*ot+E*ut+yt,ft=this.ig/2,lt=this.ua,lt===null&&(this.measure(1/0,1/0),lt=this.ua);var xt=lt.bounds;if(ut=!1,lt.type===ce.j)if(1.5>=this.strokeWidth)ut=_t.Ve(lt.startX,lt.startY,lt.endX,lt.endY,z,tt,rt,ot,b);else{if(lt.startX===lt.endX?(E=ft,ut=0):(y=(lt.endY-lt.startY)/(lt.endX-lt.startX),ut=ft/Math.sqrt(1+y*y),E=ut*y),y=Jn(),a=new At,_t.Ve(lt.startX+E,lt.startY+ut,lt.endX+E,lt.endY+ut,z,tt,rt,ot,a)&&y.push(a),a=new At,_t.Ve(lt.startX-E,lt.startY-ut,lt.endX-E,lt.endY-ut,z,tt,rt,ot,a)&&y.push(a),a=new At,_t.Ve(lt.startX+E,lt.startY+ut,lt.startX-E,lt.startY-ut,z,tt,rt,ot,a)&&y.push(a),a=new At,_t.Ve(lt.endX+E,lt.endY+ut,lt.endX-E,lt.endY-ut,z,tt,rt,ot,a)&&y.push(a),rt=y.length,rt===0)return li(y),!1;for(ut=!0,ot=1/0,E=0;E<rt;E++)a=y[E],x=(a.x-z)*(a.x-z)+(a.y-tt)*(a.y-tt),x<ot&&(ot=x,b.x=a.x,b.y=a.y);li(y)}else if(lt.type===ce.u)ut=_t.Ff(xt.x-ft,xt.y-ft,xt.x+xt.width+ft,xt.y+xt.height+ft,z,tt,rt,ot,b);else if(lt.type===ce.F){y=Te.allocAt(xt.x,xt.y,xt.width,xt.height).Bc(ft,ft);t:if(y.width===0)ut=_t.Ve(y.x,y.y,y.x,y.y+y.height,z,tt,rt,ot,b);else if(y.height===0)ut=_t.Ve(y.x,y.y,y.x+y.width,y.y,z,tt,rt,ot,b);else{if(a=y.width/2,lt=y.height/2,E=y.x+a,ut=y.y+lt,x=9999,z!==rt&&(x=(tt-ot)/(z-rt)),9999>Math.abs(x)){if(ot=tt-ut-x*(z-E),0>a*a*x*x+lt*lt-ot*ot){b.x=NaN,b.y=NaN,ut=!1;break t}ft=Math.sqrt(a*a*x*x+lt*lt-ot*ot),rt=(-(a*a*x*ot)+a*lt*ft)/(lt*lt+a*a*x*x)+E,a=(-(a*a*x*ot)-a*lt*ft)/(lt*lt+a*a*x*x)+E,lt=x*(rt-E)+ot+ut,ot=x*(a-E)+ot+ut,Math.abs((z-rt)*(z-rt))+Math.abs((tt-lt)*(tt-lt))<Math.abs((z-a)*(z-a))+Math.abs((tt-ot)*(tt-ot))?(b.x=rt,b.y=lt):(b.x=a,b.y=ot)}else{if(rt=lt*lt,ot=z-E,rt-=rt/(a*a)*ot*ot,0>rt){b.x=NaN,b.y=NaN,ut=!1;break t}ot=Math.sqrt(rt),rt=ut+ot,ot=ut-ot,Math.abs(rt-tt)<Math.abs(ot-tt)?(b.x=z,b.y=rt):(b.x=z,b.y=ot)}ut=!0}Te.free(y)}else if(lt.type===ce.o){yt=At.alloc();var Ct=rt-z,bt=ot-tt,Vt=Ct*Ct+bt*bt,zt=z,$t=tt;if(0<Vt&&xt.contains(zt,$t)&&(yt.x=zt,yt.y=$t,this.ca(yt)))for(Ct!==0&&.5>Math.abs(Ct)?(bt*=.5/Ct,Ct=.5):bt!==0&&.5>Math.abs(bt)&&(Ct*=.5/bt,bt=.5),zt-=Ct,$t-=bt;xt.contains(zt,$t);)zt-=Ct,$t-=bt;for(b.x=rt,b.y=ot,bt=0;bt<lt.figures.count;bt++){var ie=lt.figures.s[bt],oe=ie.isFilled?zt:z,de=ie.isFilled?$t:tt,ke=ie.segments;xt=ie.startX,Ct=ie.startY;for(var Hn=xt,ci=Ct,ai=0;ai<ke.count;ai++){var Fn=ke.s[ai],tn=Fn.type,nr=Fn.endX,Ji=Fn.endY,io=!1;switch(tn){case ar:Hn=nr,ci=Ji;break;case Qi:io=Am(xt,Ct,nr,Ji,oe,de,rt,ot,yt);break;case br:io=_t.Eo(xt,Ct,Fn.point1X,Fn.point1Y,Fn.point2X,Fn.point2Y,nr,Ji,oe,de,rt,ot,.6,yt);break;case Fr:io=_t.Eo(xt,Ct,xt+2/3*(Fn.point1X-xt),Ct+2/3*(Fn.point1Y-Ct),nr+2/3*(Fn.point1X-nr),Ji+2/3*(Fn.point1Y-Ji),nr,Ji,oe,de,rt,ot,.6,yt);break;case Dr:case no:tn=Fn.type===Dr?eo(Fn,ie):Vi(Fn,ie,xt,Ct);var No=tn.length;if(No===0){io=Am(xt,Ct,Fn.type===Dr?Fn.centerX:Fn.endX,Fn.type===Dr?Fn.centerY:Fn.endY,oe,de,rt,ot,yt);break}for(Ji=null,nr=0;nr<No;nr++){if(Ji=tn[nr],nr===0&&Am(xt,Ct,Ji[0],Ji[1],oe,de,rt,ot,yt)){var ba=Bm(oe,de,yt,Vt,b);ba<Vt&&(Vt=ba,ut=!0)}_t.Eo(Ji[0],Ji[1],Ji[2],Ji[3],Ji[4],Ji[5],Ji[6],Ji[7],oe,de,rt,ot,.6,yt)&&(ba=Bm(oe,de,yt,Vt,b),ba<Vt&&(Vt=ba,ut=!0))}nr=Ji[6],Ji=Ji[7];break;default:Gt("Unknown Segment type: "+tn)}xt=nr,Ct=Ji,io&&(io=Bm(oe,de,yt,Vt,b),io<Vt&&(Vt=io,ut=!0)),Fn.isClosed&&(nr=Hn,Ji=ci,Am(xt,Ct,nr,Ji,oe,de,rt,ot,yt)&&(Fn=Bm(oe,de,yt,Vt,b),Fn<Vt&&(Vt=Fn,ut=!0)))}}z=x-a,tt=E-y,rt=Math.sqrt(z*z+tt*tt),rt!==0&&(z/=rt,tt/=rt),b.x-=z*ft,b.y-=tt*ft,At.free(yt)}else Gt("Unknown Geometry type: "+lt.type);return ut?(this.transform.Ga(b),!0):!1};function Bm(a,y,x,E,b){return a=x.x-a,y=x.y-y,y=a*a+y*y,y<E?(b.x=x.x,b.y=x.y,y):E}function Am(a,y,x,E,b,z,tt,rt,ot){if(_t.$(a,x)&&_t.$(y,E)||_t.$(b,tt)&&_t.$(z,rt))return!1;var lt=!1,ut=(b-tt)*(y-E)-(z-rt)*(a-x);return ut===0?!1:(ot.x=((b*rt-z*tt)*(a-x)-(b-tt)*(a*E-y*x))/ut,ot.y=((b*rt-z*tt)*(y-E)-(z-rt)*(a*E-y*x))/ut,(a>x?a-x:x-a)<(y>E?y-E:E-y)?(a=y<E?y:E,y=y<E?E:y,(ot.y>a||_t.$(ot.y,a))&&(ot.y<y||_t.$(ot.y,y))&&(lt=!0)):(y=a<x?a:x,a=a<x?x:a,(ot.x>y||_t.$(ot.x,y))&&(ot.x<a||_t.$(ot.x,a))&&(lt=!0)),lt)}wt.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.ua;x===null&&(this.measure(1/0,1/0),x=this.ua),x=x.bounds;var E=this.strokeWidth/2,b=!1,z=At.alloc();return z.h(x.x-E,x.y-E),a.ca(y.Ga(z))&&(z.h(x.x-E,x.bottom+E),a.ca(y.Ga(z))&&(z.h(x.right+E,x.bottom+E),a.ca(y.Ga(z))&&(z.h(x.right+E,x.y-E),a.ca(y.Ga(z))&&(b=!0)))),At.free(z),b},wt.Yc=function(a,y){if(this.fh(a,y)||y===void 0&&(y=this.transform,a.Re(this.actualBounds)))return!0;var x=ae.alloc();x.set(y),x.Vj();var E=a.left,b=a.right,z=a.top;a=a.bottom;var tt=At.alloc();if(tt.h(E,z),x.Ga(tt),this.gh(tt,!0)||(tt.h(b,z),x.Ga(tt),this.gh(tt,!0))||(tt.h(E,a),x.Ga(tt),this.gh(tt,!0))||(tt.h(b,a),x.Ga(tt),this.gh(tt,!0)))return At.free(tt),!0;var rt=At.alloc(),ot=At.alloc();return x.set(y),x.bv(this.transform),x.Vj(),rt.x=b,rt.y=z,rt.transform(x),tt.x=E,tt.y=z,tt.transform(x),y=!1,tc(this,tt,rt,ot)?y=!0:(tt.x=b,tt.y=a,tt.transform(x),tc(this,tt,rt,ot)?y=!0:(rt.x=E,rt.y=a,rt.transform(x),tc(this,tt,rt,ot)?y=!0:(tt.x=E,tt.y=z,tt.transform(x),tc(this,tt,rt,ot)&&(y=!0)))),At.free(tt),ae.free(x),At.free(rt),At.free(ot),y};function tc(a,y,x,E){if(!a.rs(y,x,E))return!1;a=y.x,y=y.y;var b=x.x,z=x.y;return x=E.x,E=E.y,a===b?(y<z?(a=y,y=z):a=z,E>=a&&E<=y):(a<b?(E=a,a=b):E=b,x>=E&&x<=a)}wt.tx=function(a,y,x){function E(Vt,zt){for(var $t=Vt.length,ie=0;ie<$t;ie+=2)if(zt.zd(Vt[ie],Vt[ie+1])>b)return!0;return!1}if(x&&this.fill!==null&&this.gh(a,!0))return!0;var b=a.Bf(y),z=b;if(1.5<this.strokeWidth&&(b=this.strokeWidth/2+Math.sqrt(b),b*=b),y=this.ua,y===null&&(this.measure(1/0,1/0),y=this.ua,y===null))return!1;if(!x){var tt=y.bounds,rt=tt.x,ot=tt.y,lt=tt.x+tt.width;if(tt=tt.y+tt.height,Ti(a.x,a.y,rt,ot)<=b&&Ti(a.x,a.y,lt,ot)<=b&&Ti(a.x,a.y,rt,tt)<=b&&Ti(a.x,a.y,lt,tt)<=b)return!0}if(rt=y.startX,ot=y.startY,lt=y.endX,tt=y.endY,y.type===ce.j){if(x=(rt-lt)*(a.x-lt)+(ot-tt)*(a.y-tt),Un(a.x,a.y,rt,ot,lt,tt)<=(0<=(lt-rt)*(a.x-rt)+(tt-ot)*(a.y-ot)&&0<=x?b:z))return!0}else{if(y.type===ce.u)return y=!1,x&&(y=Un(a.x,a.y,rt,ot,rt,tt)<=b||Un(a.x,a.y,rt,ot,lt,ot)<=b||Un(a.x,a.y,lt,ot,lt,tt)<=b||Un(a.x,a.y,rt,tt,lt,tt)<=b),y;if(y.type===ce.F){y=a.x-(rt+lt)/2,z=a.y-(ot+tt)/2;var ut=Math.abs(lt-rt)/2,ft=Math.abs(tt-ot)/2;if(ut===0||ft===0)return Un(a.x,a.y,rt,ot,lt,tt)<=b;if(x){if(a=_t.$y(ut,ft,y,z),a*a<=b)return!0}else return!(Ti(y,z,-ut,0)>=b||Ti(y,z,0,-ft)>=b||Ti(y,z,0,ft)>=b||Ti(y,z,ut,0)>=b)}else if(y.type===ce.o){if(lt=y.bounds,z=lt.x,rt=lt.y,ot=lt.x+lt.width,lt=lt.y+lt.height,a.x>ot&&a.x<z&&a.y>lt&&a.y<rt&&Un(a.x,a.y,z,rt,z,lt)>b&&Un(a.x,a.y,z,rt,ot,rt)>b&&Un(a.x,a.y,ot,lt,z,lt)>b&&Un(a.x,a.y,ot,lt,ot,rt)>b)return!1;if(z=Math.sqrt(b),x){if(this.fill===null?wr(y,a.x,a.y,z):kr(y,a,z,!0,!1))return!0}else{for(x=y.figures,y=0;y<x.count;y++){if(z=x.s[y],tt=z.startX,ut=z.startY,a.zd(tt,ut)>b)return!1;for(rt=z.segments.s,ot=rt.length,lt=0;lt<ot;lt++)switch(ft=rt[lt],ft.type){case ar:case Qi:if(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b)return!1;break;case br:var yt=Jn();if(_t.Qe(tt,ut,ft.point1X,ft.point1Y,ft.point2X,ft.point2Y,ft.endX,ft.endY,.8,yt),tt=E(yt,a),li(yt),tt||(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b))return!1;break;case Fr:if(yt=Jn(),_t.ep(tt,ut,ft.point1X,ft.point1Y,ft.endX,ft.endY,.8,yt),tt=E(yt,a),li(yt),tt||(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b))return!1;break;case Dr:case no:yt=ft.type===Dr?eo(ft,z):Vi(ft,z,tt,ut);var xt=yt.length;if(xt===0){if(tt=ft.type===Dr?ft.centerX:ft.endX,ut=ft.type===Dr?ft.centerY:ft.endY,a.zd(tt,ut)>b)return!1;break}ft=null;for(var Ct=Jn(),bt=0;bt<xt;bt++)if(ft=yt[bt],Ct.length=0,_t.Qe(ft[0],ft[1],ft[2],ft[3],ft[4],ft[5],ft[6],ft[7],.8,Ct),E(Ct,a))return li(Ct),!1;li(Ct),ft!==null&&(tt=ft[6],ut=ft[7]);break;default:Gt("Unknown Segment type: "+ft.type)}}return!0}}}return!1},wt.qc=function(){this.ua=null},wt.kq=function(){return this.ig};function m1(a){var y=a.diagram;y!==null&&y.undoManager.isUndoingRedoing||(a.segmentOrientation=sp,a.toArrow!=="None"?(a.segmentIndex=-1,a.alignmentFocus=Aa):a.fromArrow!=="None"&&(a.segmentIndex=0,a.alignmentFocus=new gi(1-Aa.x,Aa.y)))}fr.makeGeometry=function(a,y,x){if(a.toArrow!=="None")var E=Ku[a.toArrow];else a.fromArrow!=="None"?E=Ku[a.fromArrow]:(E=_t.Ze[a.figure],typeof E=="string"&&(E=_t.Ze[E]),E===void 0&&Gt("Unknown Shape.figure: "+a.figure),E=E(a,y,x),E.Sk=y,E.Rk=x);if(E===null){var b=_t.Ze.Rectangle;typeof b=="function"&&(E=b(a,y,x))}return E};function v1(a){var y=Ku[a];if(y===void 0){var x=a.toLowerCase();if(x==="none")return"None";if(y=Ku[x],y===void 0){var E=null,b;for(b in _t.um)if(b.toLowerCase()===x){E=b;break}if(E!==null)return a=ce.parse(_t.um[E],!1),Ku[E]=a,x!==E&&(Ku[x]=E),E}}return typeof y=="string"?y:y instanceof ce?a:null}Se.Object.defineProperties(fr.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),Ua(this)&&(a=this.part,a!==null&&Ho(this,a,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(a){a=ce.parse(a);var y=a.normalize();this.geometry=a,this.position=a=At.allocAt(-y.x,-y.y),At.free(a)}},isGeometryPositioned:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.v(),this.g("isGeometryPositioned",y,a))}},fill:{get:function(){return this.Ui},set:function(a){var y=this.Ui;y!==a&&(a!==null&&_c(a,"Shape.fill"),a instanceof So&&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&&_c(a,"Shape.stroke"),a instanceof So&&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 En(a,"value >= 0",fr,"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"?En(a,'"butt", "round", or "square"',fr,"strokeCap"):(qd(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"?En(a,'"miter", "bevel", or "round"',fr,"strokeJoin"):(qd(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){qd(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)||Gt("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&&(qd(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=_t.Ze[a];typeof x=="function"?x=a:(x=_t.Ze[a.toLowerCase()])||Gt("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?Gt("Unknown Shape.toArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new dd),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?Gt("Unknown Shape.fromArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new dd),this.Ua.j=x,this.Rd=null,this.qc(),this.v(),m1(this),this.g("fromArrow",y,x))}}},spot1:{get:function(){return this.Na!==null?this.Na.fg:xa},set:function(a){var y=this.spot1;y.D(a)||(a=a.J(),qd(this),this.Na.fg=a,this.v(),this.g("spot1",y,a))}},spot2:{get:function(){return this.Na!==null?this.Na.gg:xa},set:function(a){var y=this.spot2;y.D(a)||(a=a.J(),qd(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&&(qd(this),this.Na.br=a,this.N(),this.g("pathPattern",y,a))}},geometryStretch:{get:function(){return this.Na!==null?this.Na.jq:sr},set:function(a){var y=this.geometryStretch;y!==a&&(qd(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 Uu),this.fa.Tk=a;var x=this.diagram;x!==null&&this.panel===x.grid&&Mu(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 Uu),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 Uu),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 Uu),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}}}),fr.prototype.intersectsRect=fr.prototype.Yc,fr.prototype.containedInRect=fr.prototype.fh,fr.prototype.getNearestIntersectionPoint=fr.prototype.rs,fr.prototype.getDocumentBounds=fr.prototype.mi,fr.prototype.getDocumentPoint=fr.prototype.ga;var Ku=new bi,Lv=new bi;fr.className="Shape",fr.getFigureGenerators=function(){var a=new Be,y;for(y in _t.Ze)y!==y.toLowerCase()&&a.add(y,_t.Ze[y]);return a.freeze(),a},fr.defineFigureGenerator=function(a,y){var x=a.toLowerCase(),E=_t.Ze;E[a]=y,E[x]=a},fr.getArrowheadGeometries=function(){var a=new Be;for(E in _t.um)if(Ku[E]===void 0){var y=ce.parse(_t.um[E],!1);Ku[E]=y,y=E.toLowerCase(),y!==E&&(Ku[y]=E)}for(var x in Ku)if(x!==x.toLowerCase()){var E=Ku[x];E instanceof ce&&a.add(x,E)}return a.freeze(),a},fr.defineArrowheadGeometry=function(a,y){var x=null;typeof y=="string"?x=ce.parse(y,!1):x=y,y=a.toLowerCase(),y!=="none"&&a!==y||Gt("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var E=Ku;E[a]=x,E[y]=a};function Fv(){this.nc=!1,this.Hr="butt",this.Ir="miter",this.Jr=10,this.uj=0,this.br=null,this.jq=sr,this.gg=this.fg=xa}Fv.prototype.copy=function(){var a=new Fv;return a.Hr=this.Hr,a.Ir=this.Ir,a.Jr=this.Jr,a.uj=this.uj,a.br=this.br,a.jq=this.jq,a.fg=this.fg.J(),a.gg=this.gg.J(),a};function To(a,y){return fe.call(this),_m||(Ds=Qo?new Rl(null).context:null,_m=!0),this.l|=2097152,this.ec="",this.xc="black",this.Ae="13px sans-serif",this.Lq=this.Cb=this.Gc=0,this.da=this.fa=this.Gm=null,this.Ih=0,this.df=null,this.Le=0,this.ze=this.Qb=this.Qc=null,typeof a=="string"?this.text=a:a&&Object.assign(this,a),y&&Object.assign(this,y),this}Le(To,fe),To.prototype.cloneProtected=function(a){fe.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 Bu(a){a.da===null?a.da=new Tv:a.da.nc&&(a.da=a.da.copy())}wt=To.prototype,wt.th=function(){fe.prototype.th.call(this),this.da!==null&&(this.da.nc=!0)};function y1(a,y){a.l=y.l|6144,a.pb=y.opacity,a.Ma=y.background,a.areaBackground=y.areaBackground,a.jd=y.desiredSize.J(),a.minSize=y.minSize.J(),a.maxSize=y.maxSize.J(),y.Lb!==null?a.Lb=y.Lb.copy():a.Lb=null,a.Ca=y.scale,a.Kb=y.angle,a.stretch=y.stretch,a.Kg=y.margin.J(),a.Jb=y.alignment.J(),a.sk=y.alignmentFocus.J(),a.segmentFraction=y.segmentFraction,a.segmentOffset=y.segmentOffset.J(),a.segmentOrientation=y.segmentOrientation,y.tb!==null&&(a.tb=y.tb.copy()),a.shadowVisible=y.shadowVisible,a.ec=y.ec,a.xc=y.xc,a.Ae=y.Ae,a.fa!==null&&(a.fa=y.fa.copy()),y.da!==null&&(a.da=y.da.nc?y.da:y.da.copy()),a.Ih=y.Ih}wt.qb=function(a){a.classType===To?this.wrap=a:fe.prototype.qb.call(this,a)},wt.toString=function(){return 22<this.ec.length?'TextBlock("'+this.ec.substring(0,20)+'"...)':'TextBlock("'+this.ec+'")'},wt.v=function(){fe.prototype.v.call(this)},wt.hh=function(a,y){if(this.xc!==null&&this.ec.length!==0&&this.Ae!==null){var x=this.naturalBounds,E=this.actualBounds,b=x.width,z=x.height,tt=tp(this),rt=a.textAlign=this.textAlign,ot=y.tn;rt==="start"?rt=ot?"right":"left":rt==="end"&&(rt=ot?"left":"right"),ot=this.isUnderline;var lt=this.isStrikethrough;ta(this,a,this.xc,!0,!1,x,E),(ot||lt)&&ta(this,a,this.xc,!1,!1,x,E),E=0,x=!1;var ut=this.oe,ft=ut.dx-(tt*ut.m21+ut.dx);ut=ut.dy-(tt*ut.m22+ut.dy);var yt=y.scale;switch(8>(ft*ft+ut*ut)*yt*yt&&(x=!0),y.ib!==a&&(x=!1),y.ib instanceof Qs&&(x=!1),y.Gf("textGreeking")===!1&&(x=!1),y=this.spacingAbove,ft=this.spacingBelow,this.flip){case Ur:a.translate(b,0),a.scale(-1,1);break;case Pr:a.translate(0,z),a.scale(1,-1);break;case Lo:a.translate(b,z),a.scale(-1,-1)}if(a.yc(),ut=this.Gc,yt=(y+tt+ft)*ut,z>yt&&(E=this.verticalAlignment,E=E.y*z-E.y*yt+E.offsetY),ut===1&&this.ze!==null)ft=this.Cb,ft>b&&(ft=b),this.Oj(this.ze,a,0,E+y,b,tt,ft,x,rt,ot,lt);else if(this.Qc!==null&&this.Qb!==null)for(yt=0;yt<ut;yt++){var xt=this.Qc[yt];xt>b&&(xt=b),E+=y,this.Oj(this.Qb[yt],a,0,E,b,tt,xt,x,rt,ot,lt),E+=tt+ft}switch(this.flip){case Ur:a.scale(-1,1),a.translate(-b,0);break;case Pr:a.scale(1,-1),a.translate(0,-z);break;case Lo:a.scale(-1,-1),a.translate(-b,-z)}}},wt.Oj=function(a,y,x,E,b,z,tt,rt,ot,lt,ut){var ft=0;if(rt)ot==="left"?ft=0:ot==="right"?ft=b-tt:ot==="center"&&(ft=(b-tt)/2),y.fillRect(x+ft,E+.25*z,tt,1);else{if(ot==="left"?ft=0:ot==="right"?ft=b:ot==="center"&&(ft=b/2),b=Tm!==null?Tm(this,z):.75*z,y.fillText(a,x+ft,E+b),a=z/20|0,a===0&&(a=1),ot==="right"?ft-=tt:ot==="center"&&(ft-=tt/2),lt){rt=Dm!==null?Dm(this,z):.8*z,ot=x+ft,lt=E+rt,b=x+ft+tt,rt=E+rt;var yt=a;y.beginPath(),y.lineWidth=yt,y.moveTo(ot,lt),y.lineTo(b,rt),y.stroke(),y.Se(),y instanceof Qs&&y.ad.classList.add("gojs-td")}ut&&(ut=E+z-z/2.2|0,a%2!==0&&(ut+=.5),E=x+ft,z=ut,x=x+ft+tt,tt=ut,ft=a,y.beginPath(),y.lineWidth=ft,y.moveTo(E,z),y.lineTo(x,tt),y.stroke(),y.Se(),y instanceof Qs&&y.ad.classList.add("gojs-td"))}},wt.kk=function(a,y,x){if(!fe.prototype.kk.call(this,a,y,x))return!1;if(ta(this,a,this.xc,!0,!1,this.naturalBounds,this.actualBounds),x){if(this.svg.getElementsByTagName("text").length===0)return!0;for(y=this.svg.getElementsByClassName("gojs-td"),x=0;x<y.length;x++)Qy(a,y[x],!1)}else y=this.svg,y.innerHTML=this.text,Qy(a,y,!0);return!0},wt.nk=function(a){return 1<this.lineCount||this.isUnderline||this.isStrikethrough?!0:fe.prototype.nk.call(this,a)},wt.Dv=function(a,y){if(a.nodeName!=="g")a.setAttributeNS(null,"filter",y);else{a=a.getElementsByTagName("text");for(var x=0;x<a.length;x++)a[x].setAttributeNS(null,"filter",y)}},wt.Wl=function(a,y,x,E){var b=this.Gc;this.Ih=a,this.l&=-16777217;var z=this.Ae;Ds!==null&&L1!==z&&(L1=Ds.font=z),this.Cb=this.Le=0,this.ze=this.Qb=this.Qc=this.df=null;var tt;if(isNaN(this.desiredSize.width)){if(z=this.ec.replace(/\r\n/g,`
`).replace(/\r/g,`
`),z.length===0)z=8;else if(this.isMultiline){for(var rt=tt=0,ot=!1;!ot;){var lt=z.indexOf(`
`,rt);lt===-1&&(lt=z.length,ot=!0),rt=z.substr(rt,lt-rt),this.formatting===ep&&(rt=rt.trim()),tt=Math.max(tt,eu(rt)),rt=lt+1}z=tt}else tt=z.indexOf(`
`,0),0<=tt&&(z=z.substr(0,tt)),z=eu(z);z=Math.min(z,a/this.scale)}else z=this.desiredSize.width;if(this.panel!==null&&(z=Math.min(z,this.panel.maxSize.width)),tt=x1(this,z),isNaN(this.desiredSize.height)?tt=Math.min(tt,y/this.scale):tt=this.desiredSize.height,ot=tt,this.Cb!==0&&this.Qc!==null&&this.Qb!==null&&this.overflow===Om&&(y=this.Ae,y=this.overflow===Om?S1(y):0,lt=this.spacingAbove+this.spacingBelow,lt=Math.max(0,tp(this)+lt),ot=Math.min(this.maxLines-1,Math.max(Math.floor(ot/lt+.01)-1,0)),!(ot+1>=this.Qb.length))){for(this.l|=16777216,lt=this.Qb[ot],y=Math.max(1,a-y);eu(lt)>y&&1<lt.length;)lt=lt.substr(0,lt.length-1);lt+=np,y=eu(lt),this.Qb[ot]=lt,this.Qb=this.Qb.slice(0,ot+1),this.Qc[ot]=y,this.Qc=this.Qc.slice(0,ot+1),this.Le=this.Qb.length,this.Cb=Math.max(this.Cb,y),this.Gc=this.Le,this.Gc===1&&(this.ze=this.Qb[0])}(this.wrap===P1||isNaN(this.desiredSize.width))&&(z=isNaN(a)?this.Cb:Math.min(a,this.Cb)),z=Math.max(x,z),tt=Math.max(E,tt),ao(this.dc,z,tt),this.Ge(0,0,z,tt),this.svg!==null&&b!==this.Gc&&(this.Uc=!0)},wt.eh=function(a,y,x,E){ds(this,a,y,x,E)};function qg(a,y,x){a.ze===null?(a.ze=y,a.Cb=x):((a.Qb===null||a.Qc===null)&&(a.Qb=[],a.Qc=[],a.Qb.push(a.ze),a.Qc.push(a.Cb)),a.Qb.push(y),a.Qc.push(x),a.Qb.length>a.maxLines&&(a.l|=16777216))}function Mv(a,y,x,E){var b=a.formatting===ep;b&&(y=y.trim());var z=0,tt=a.Ae,rt=a.spacingAbove+a.spacingBelow;rt=Math.max(0,tp(a)+rt);var ot=a.overflow===Om?S1(tt):0;if(a.Gc>=a.maxLines)E!==null&&E.h(0,rt);else if(tt=y,a.wrap===kv){a.Le=1;var lt=eu(y);if(ot===0||lt<=x)a.Cb=Math.max(a.Cb,lt),qg(a,y,a.Cb),E!==null&&E.h(lt,rt);else{for(z=If(a,tt),tt=tt.substr(z.length),y=If(a,tt),lt=eu(z+y);0<y.length&&lt<=x;)z+=y,tt=tt.substr(y.length),y=If(a,tt),lt=z+y,b&&(lt=lt.trim()),lt=eu(lt);for(b&&(y=y.trim()),z+=y,x=Math.max(1,x-ot);eu(z)>x&&1<z.length;)z=z.substr(0,z.length-1);a.l|=16777216,z+=np;var ut=eu(z);a.Cb=ut,qg(a,z,ut),E!==null&&E.h(ut,rt)}}else{for(ot=0,tt.length===0&&(ot=1,qg(a,tt,0));0<tt.length;){for(y=If(a,tt),tt=tt.substr(y.length);eu(y)>x;){var ft=1;for(lt=eu(y.substr(0,ft)),ut=0;lt<=x;)ft++,ut=lt,lt=eu(y.substr(0,ft));if(ft===1){var yt=lt;z=Math.max(z,lt)}else yt=ut,z=Math.max(z,ut);if(ft--,1>ft&&(ft=1),qg(a,y.substr(0,ft),yt),ot++,y=y.substr(ft),a.Gc+ot>a.maxLines)break}for(ut=If(a,tt),lt=eu(y+ut);0<ut.length&&lt<=x;)y+=ut,tt=tt.substr(ut.length),ut=If(a,tt),lt=y+ut,b&&(lt=lt.trim()),lt=eu(lt);if(b&&(y=y.trim()),y!==""&&(y[y.length-1]==="\xAD"&&(y=y.substring(0,y.length-1)+"\u2010"),ut.length===0?(ft=lt,z=Math.max(z,lt)):(ft=ut=eu(y),z=Math.max(z,ut)),qg(a,y,ft),ot++,a.Gc+ot>a.maxLines))break}a.Le=Math.min(a.maxLines,ot),a.Cb=Math.max(a.Cb,z),E!==null&&E.h(a.Cb,rt*a.Le)}}function If(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 eu(a){return Ds===null?8*a.length:Ds.measureText(a).width}function tp(a){if(a.df!==null)return a.df;var y=a.Ae;if(Ds===null){var x=16;return a.df=x}return Bv[y]!==void 0&&5e3>E1?x=Bv[y]:(x=1.3*Ds.measureText("M").width,Bv[y]=x,E1++),a.df=x}function S1(a){if(Ds===null)return 6;if(Im[a]!==void 0&&5e3>Av)var y=Im[a];else y=Ds.measureText(np).width,Im[a]=y,Av++;return y}function x1(a,y){var x=a.ec.replace(/\r\n/g,`
`).replace(/\r/g,`
`),E=a.spacingAbove+a.spacingBelow;if(E=Math.max(0,tp(a)+E),x.length===0)return a.Cb=0,a.Gc=1,E;if(!a.isMultiline){var b=x.indexOf(`
`,0);0<=b&&(x=x.substr(0,b))}b=0;for(var z=a.Gc=0,tt,rt=!1;!rt;){if(tt=x.indexOf(`
`,z),tt===-1&&(tt=x.length,rt=!0),z<=tt){if(z=x.substr(z,tt-z),a.wrap!==kv){a.Le=0;var ot=nn.alloc();Mv(a,z,y,ot),b+=ot.height,nn.free(ot),a.Gc+=a.Le}else Mv(a,z,y,null),b+=E,a.Gc++;a.Gc===a.maxLines&&(rt=!0)}z=tt+1}return a.Lq=b}Se.Object.defineProperties(To.prototype,{font:{get:function(){return this.Ae},set:function(a){var y=this.Ae;y!==a&&(this.Ae=a,this.df=null,this.v(),this.g("font",y,a))}},text:{get:function(){return this.ec},set:function(a){var y=this.ec;a!=null?a=a.toString():a="",y!==a&&(this.ec=a,this.v(),this.g("text",y,a),this.Uc=!0)}},textAlign:{get:function(){return this.da!==null?this.da.Or:"start"},set:function(a){var y=this.textAlign;y===a||a!=="start"&&a!=="end"&&a!=="left"&&a!=="right"&&a!=="center"||(Bu(this),this.da.Or=a,this.N(),this.g("textAlign",y,a))}},flip:{get:function(){return this.da!==null?this.da.Xf:ln},set:function(a){var y=this.flip;y!==a&&(Bu(this),this.da.Xf=a,this.N(),this.g("flip",y,a))}},verticalAlignment:{get:function(){return this.da!==null?this.da.Yr:Kl},set:function(a){var y=this.verticalAlignment;y.D(a)||(a=a.J(),Bu(this),this.da.Yr=a,ys(this),this.g("verticalAlignment",y,a))}},naturalBounds:{get:function(){if(!this.dc.w()){var a=nn.alloc();Mv(this,this.ec,999999,a);var y=a.width;nn.free(a),a=x1(this,y);var x=this.desiredSize;isNaN(x.width)||(y=x.width),isNaN(x.height)||(a=x.height),ao(this.dc,y,a)}return this.dc}},isMultiline:{get:function(){return(this.l&2097152)!==0},set:function(a){var y=(this.l&2097152)!==0;y!==a&&(this.l^=2097152,this.v(),this.g("isMultiline",y,a))}},isUnderline:{get:function(){return(this.l&4194304)!==0},set:function(a){var y=(this.l&4194304)!==0;y!==a&&(this.l^=4194304,this.Uc=!0,this.N(),this.g("isUnderline",y,a))}},isStrikethrough:{get:function(){return(this.l&8388608)!==0},set:function(a){var y=(this.l&8388608)!==0;y!==a&&(this.l^=8388608,this.Uc=!0,this.N(),this.g("isStrikethrough",y,a))}},wrap:{get:function(){return this.da!==null?this.da.$r:bv},set:function(a){var y=this.wrap;y!==a&&(Bu(this),this.da.$r=a,this.v(),this.g("wrap",y,a))}},overflow:{get:function(){return this.da!==null?this.da.$q:Nv},set:function(a){var y=this.overflow;y!==a&&(Bu(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&&_c(a,"TextBlock.stroke"),a instanceof So&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},lineCount:{get:function(){return this.Gc}},lineHeight:{get:function(){return tp(this)}},editable:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.g("editable",y,a))}},textEditor:{get:function(){return this.da!==null?this.da.Qr:null},set:function(a){var y=this.textEditor;y!==a&&(Bu(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&&(Bu(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 Uu),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 Uu),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 Uu),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 Uu),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 Uu),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&&(Bu(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&&(Bu(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&&(Bu(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&&(Bu(this),this.da.Er=a,this.v(),this.g("spacingBelow",y,a))}},formatting:{get:function(){return this.da!==null?this.da.gq:ep},set:function(a){var y=this.formatting;y!==a&&(Bu(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&&En(a,"> 0",To,"maxLines"),Bu(this),this.da.Jq=a,this.v(),this.g("maxLines",y,a))}},metrics:{get:function(){return{arrSize:this.Qc!==null?this.Qc:[this.Cb],arrText:this.Qb!==null?this.Qb:[this.ze],maxLineWidth:this.Cb,fontHeight:this.df}}},choices:{get:function(){return this.Gm},set:function(a){var y=this.Gm;y!==a&&(this.Gm=a,this.g("choices",y,a))}}});var Tm=null,Dm=null,kv=new en(To,"None",0),P1=new en(To,"WrapFit",1),bv=new en(To,"WrapDesiredSize",2),w1=new en(To,"WrapBreakAll",3),Nv=new en(To,"OverflowClip",0),Om=new en(To,"OverflowEllipsis",1),ep=new en(To,"FormatTrim",0),C1=new en(To,"FormatNone",0),Sx=/[ \u200b\u00ad]/,Bv=new bi,E1=0,Im=new bi,Av=0,np="...",L1="",Ds=null,_m=!1;To.className="TextBlock";function Tv(){this.nc=!1,this.Hd=null,this.Xf=ln,this.gq=ep,this.Jq=1/0,this.$q=Nv,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=Kl,this.$r=bv}Tv.prototype.copy=function(){var a=new Tv;return a.Hd=this.Hd,a.Xf=this.Xf,a.gq=this.gq,a.Jq=this.Jq,a.$q=this.$q,a.Dr=this.Dr,a.Er=this.Er,a.Or=this.Or,a.Pr=this.Pr,a.Qr=this.Qr,a.vj=this.vj,a.Yr=this.Yr,a.$r=this.$r,a},To.getEllipsis=function(){return np},To.setEllipsis=function(a){np=a,Im=new bi,Av=0},To.getBaseline=function(){return Tm},To.setBaseline=function(a){Tm=a},To.getUnderline=function(){return Dm},To.setUnderline=function(a){Dm=a},To.isValidFont=function(a){if(_m||(Ds=Qo?new Rl(null).context:null,_m=!0),Ds===null)return!0;var y=Ds.font;if(a===y||a==="10px sans-serif")return!0;Ds.font="10px sans-serif",Ds.font=a;var x=Ds.font;if(x!=="10px sans-serif")return Ds.font=y,!0;Ds.font="19px serif";var E=Ds.font;return Ds.font=a,x=Ds.font,Ds.font=y,x!==E},To.FormatNone=C1,To.FormatTrim=ep,To.None=kv,To.OverflowClip=Nv,To.OverflowEllipsis=Om,To.WrapBreakAll=w1,To.WrapDesiredSize=bv,To.WrapFit=P1;function Uu(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}Uu.prototype.copy=function(){var a=new Uu;return a.Tk=this.Tk,a.u=this.u,a.j=this.j,a.F=this.F,a.o=this.o,a},Uu.className="GradElementSettings";function Os(a,y){fe.call(this),this.Eg=null,this.qo="",this.Xg=bs,this.Nk=yn,this.Zg=this.Hd=null,this.Mk=dr,this.Xf=ln,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 _f;Le(Os,fe),Os.prototype.cloneProtected=function(a){fe.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},Os.prototype.qb=function(a){a===ln||a===wi||a===Hr?this.imageStretch=a:fe.prototype.qb.call(this,a)},Os.prototype.toString=function(){return"Picture("+this.source+")#"+zi(this)};function Rf(a){a===void 0&&(a=""),a!==""?_f[a]&&(delete _f[a],Rm--):(_f=new bi,Rm=0)}function F1(a,y){y.qy||(y.Fq=function(x){y.sq=!0,y.ln=!1;var E=y.Bg.copy();if(E!=null){for(E=E.iterator;E.next();){var b=E.value;b.N();var z=y.getAttribute("src")||"",tt=b.Og.I(z);if(tt!==null)for(var rt=tt.length,ot=0;ot<rt;ot++)z=tt[ot],b.Xn.add(z),z.Uc=!0,b.$b(),y.hn&&(y.eu===void 0&&(y.eu=x),z.Zg!==null&&z.Zg(z,x))}y.Bg.clear()}a.desiredSize.w()||(ma(a,!1),a.v())},y.Yp=function(x){y.ln=x;var E=y.Bg.copy();if(E!=null){for(E=E.iterator;E.next();){var b=E.value,z=y.getAttribute("src")||"",tt=b.Og.I(z);if(tt!==null){b=tt.length,z=Jn();for(var rt=0;rt<b;rt++)z.push(tt[rt]);if(y.hn)for(rt=0;rt<b;rt++)tt=z[rt],tt.Hd!==null&&tt.Hd(tt,x);li(z)}}y.Bg.clear()}},y.addEventListener("load",y.Fq),y.addEventListener("error",y.Yp),y.qy=!0)}Os.prototype.hA=function(){if(this.source!==""){Rf(this.source);var a=this.source;this.source="",this.source=a}},Os.prototype.redraw=function(){this.N(),this.Uc=!0},Os.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 Qd)){var b=a instanceof Qs;E=this.naturalBounds;var z=0,tt=0,rt=this.qn,ot=rt?+x.width:x.naturalWidth;if(rt=rt?+x.height:x.naturalHeight,ot===void 0&&x.videoWidth&&(ot=x.videoWidth),rt===void 0&&x.videoHeight&&(rt=x.videoHeight),ot=ot||E.width,rt=rt||E.height,ot!==0&&rt!==0){var lt=ot,ut=rt;this.sourceRect.w()&&(z=this.Xg.x,tt=this.Xg.y,ot=this.Xg.width,rt=this.Xg.height);var ft=ot,yt=rt,xt=this.Nk,Ct=this.Mk;switch(xt){case ln:if(this.sourceRect.w())break;ft>=E.width&&(z=z+Ct.offsetX+(ft*Ct.x-E.width*Ct.x)),yt>=E.height&&(tt=tt+Ct.offsetY+(yt*Ct.y-E.height*Ct.y)),ot=Math.min(E.width,ft),rt=Math.min(E.height,yt);break;case yn:ft=E.width,yt=E.height;break;case wi:case Hr:xt===wi?(xt=Math.min(E.height/yt,E.width/ft),ft*=xt,yt*=xt):xt===Hr&&(xt=Math.max(E.height/yt,E.width/ft),ft*=xt,yt*=xt,ft>=E.width&&(z=(z+Ct.offsetX+(ft*Ct.x-E.width*Ct.x)/ft)*ot),yt>=E.height&&(tt=(tt+Ct.offsetY+(yt*Ct.y-E.height*Ct.y)/yt)*rt),ot*=1/(ft/E.width),rt*=1/(yt/E.height),ft=E.width,yt=E.height)}xt=this.Df()*y.scale;var bt=ft*xt*yt*xt,Vt=ot*rt/bt,zt=x.__goCache;xt=null;var $t=xx;if(!b){if(x.sq&&zt!==void 0&&4<bt&&Vt>$t*$t)for(zt.gi===null&&(k1(zt,4,lt,ut,x),k1(zt,16,lt,ut,x)),b=zt.gi,lt=b.length,ut=0;ut<lt&&b[ut].ratio*b[ut].ratio<Vt;ut++)xt=b[ut];if(!y.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{b=new Rl(null).context;try{b.drawImage(this.Eg,0,0)}catch(ie){this.en=!1}try{b.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(ie){this.vl=!0}}if(this.vl)return}}switch(b=ft<E.width?Ct.offsetX+(E.width*Ct.x-ft*Ct.x):0,Ct=yt<E.height?Ct.offsetY+(E.height*Ct.y-yt*Ct.y):0,this.flip){case Ur:a.translate(Math.min(E.width,ft),0),a.scale(-1,1);break;case Pr:a.translate(0,Math.min(E.height,yt)),a.scale(1,-1);break;case Lo:a.translate(Math.min(E.width,ft),Math.min(E.height,yt)),a.scale(-1,-1)}if(a.yc(),y.Gf("pictureRatioOptimization")&&!y.$i&&zt!==void 0&&xt!==null&&xt.ratio!==1){a.save(),y=xt.ratio;try{a.drawImage(xt.source,z/y,tt/y,Math.min(xt.source.width,ot/y),Math.min(xt.source.height,rt/y),b,Ct,Math.min(E.width,ft),Math.min(E.height,yt)),a instanceof Qs&&(this.bt=[z/y,tt/y,Math.min(xt.source.width,ot/y),Math.min(xt.source.height,rt/y),b,Ct,Math.min(E.width,ft),Math.min(E.height,yt)])}catch(ie){this.en=!1}a.restore()}else try{a.drawImage(x,z,tt,ot,rt,b,Ct,Math.min(E.width,ft),Math.min(E.height,yt)),a instanceof Qs&&(this.bt=[z,tt,ot,rt,b,Ct,Math.min(E.width,ft),Math.min(E.height,yt)])}catch(ie){this.en=!1}switch(this.flip){case Ur:a.scale(-1,1),a.translate(-Math.min(E.width,ft),0);break;case Pr:a.scale(1,-1),a.translate(0,-Math.min(E.height,yt));break;case Lo:a.scale(-1,-1),a.translate(-Math.min(E.width,ft),-Math.min(E.height,yt))}}}}},Os.prototype.Wl=function(a,y,x,E){var b=this.desiredSize,z=Ts(this,!0),tt=this.Eg,rt=this.qn,ot=0,lt=0;(rt||!this.al&&tt&&tt.complete)&&(this.al=!0),tt===null?(isFinite(b.width)||(a=0),isFinite(b.height)||(y=0)):(ot=rt?+tt.width:tt.naturalWidth,lt=rt?+tt.height:tt.naturalHeight),isFinite(b.width)||z===yn||z===Mi?(isFinite(a)||(this.sourceRect.w()?a=this.sourceRect.width:tt!==null&&(a=ot)),x=0):tt!==null&&this.al!==!1&&(a=this.sourceRect.w()?this.sourceRect.width:ot),isFinite(b.height)||z===yn||z===Ri?(isFinite(y)||(this.sourceRect.w()?y=this.sourceRect.height:tt!==null&&(y=lt)),E=0):tt!==null&&this.al!==!1&&(y=this.sourceRect.w()?this.sourceRect.height:lt),isFinite(b.width)&&(a=b.width),isFinite(b.height)&&(y=b.height),b=this.maxSize,z=this.minSize,x=Math.max(x||0,z.width),E=Math.max(E||0,z.height),a=Math.min(b.width,a),y=Math.min(b.height,y),a=Math.max(x,a),y=Math.max(E,y),tt===null||tt.complete||(isFinite(a)||(a=0),isFinite(y)||(y=0)),ao(this.dc,a,y),this.Ge(0,0,a,y)},Os.prototype.eh=function(a,y,x,E){ds(this,a,y,x,E)},Se.Object.defineProperties(Os.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||Gt("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);var E=this.diagram;E!==null&&Og(E,this),this.Eg=a,a!==null&&x&&a.Bg===void 0&&(a.Bg=new gn),E!==null&&x&&ld(E,this),a!==null&&(this.qn||a.complete===!0?(a.hn&&(a.ln instanceof Event&&this.Hd!==null?this.Hd(this,a.ln):a.sq===!0&&!a.ln&&this.Zg!==null&&a.eu&&this.Zg(this,a.eu)),a.sq=!0,this.desiredSize.w()||(ma(this,!1),this.v())):x&&F1(this,a)),this.g("element",y,a),this.N()}}},source:{get:function(){return this.qo},set:function(a){var y=this.qo;if(y!==a){this.Uc=!0,this.qo=a;var x=_f;if(Qo){var E=null;if(x[a]!==void 0)E=x[a];else if(a!==""){30<Rm&&(Rf(),x=_f),E=Ki("img"),E.hn=!0,F1(this,E);var b=this.rl;b!==null&&(E.crossOrigin=b(this)),E.src=a,x[a]=E,Rm++}this.element=E,E!==null&&E.__goCache===void 0&&(E.__goCache=new M1),this.v(),this.N()}this.g("source",y,a)}}},sourceCrossOrigin:{get:function(){return this.rl},set:function(a){if(this.rl!==a&&(this.rl=a,this.element!==null)){var y=this.element.getAttribute("src");a===null&&typeof y=="string"?this.element.crossOrigin=null:a!==null&&(this.element.crossOrigin=a(this)),this.element.src=y}}},sourceRect:{get:function(){return this.Xg},set:function(a){var y=this.Xg;y.D(a)||(this.Xg=a=a.J(),this.N(),this.g("sourceRect",y,a))}},imageStretch:{get:function(){return this.Nk},set:function(a){var y=this.Nk;y!==a&&(this.Nk=a,this.N(),this.g("imageStretch",y,a))}},flip:{get:function(){return this.Xf},set:function(a){var y=this.Xf;y!==a&&(this.Xf=a,this.N(),this.g("flip",y,a))}},imageAlignment:{get:function(){return this.Mk},set:function(a){var y=this.Mk;y.D(a)||(this.Mk=a=a.J(),this.N(),this.g("imageAlignment",y,a))}},errorFunction:{get:function(){return this.Hd},set:function(a){var y=this.Hd;y!==a&&(this.Hd=a,this.g("errorFunction",y,a))}},successFunction:{get:function(){return this.Zg},set:function(a){var y=this.Zg;y!==a&&(this.Zg=a,this.g("successFunction",y,a))}},naturalBounds:{get:function(){return this.dc}}}),Os.prototype.redraw=Os.prototype.redraw,Os.prototype.reloadSource=Os.prototype.hA;var Rm=0,xx=4;Os.className="Picture",_f=new bi,Os.clearCache=Rf;function M1(){this.gi=null}function k1(a,y,x,E,b){a.gi===null&&(a.gi=[]);var z=new Rl(null),tt=z.context,rt=1/y;z.width=x/y,z.height=E/y,z.width!==0&&z.height!==0&&(y=new b1(z.Oa,y),x=1,0<a.gi.length&&(x=a.gi[a.gi.length-1],b=x.source,x=x.ratio),tt.setTransform(rt*x,0,0,rt*x,0,0),tt.yc(),tt.drawImage(b,0,0),a.gi.push(y))}M1.className="PictureCacheArray";function b1(a,y){this.source=a,this.ratio=y}b1.className="PictureCacheInstance";function jf(){this.os=new ce,this.mc=null}jf.prototype.reset=function(a){a!==null?(a.ka(),this.os=a,a.figures.clear()):this.os=new ce,this.mc=null};function zf(a,y,x,E,b,z){a.mc=new Ir,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()}jf.prototype.moveTo=function(a,y,x){x===void 0&&(x=!1);var E=new Ui(ar);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)},jf.prototype.lineTo=function(a,y,x){x===void 0&&(x=!1);var E=new Ui(Qi);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)};function Dh(a,y,x,E,b,z,tt){var rt;rt===void 0&&(rt=!1);var ot=new Ui(br);ot.point1X=y,ot.point1Y=x,ot.point2X=E,ot.point2Y=b,ot.endX=z,ot.endY=tt,rt&&ot.close(),a.mc.segments.add(ot)}function jm(a,y,x,E,b){var z;z===void 0&&(z=!1);var tt=new Ui(Fr);tt.point1X=y,tt.point1Y=x,tt.endX=E,tt.endY=b,z&&tt.close(),a.mc.segments.add(tt)}jf.prototype.arcTo=function(a,y,x,E,b,z,tt){z===void 0&&(z=0),tt===void 0&&(tt=!1);var rt=new Ui(Dr);rt.startAngle=a,rt.sweepAngle=y,rt.centerX=x,rt.centerY=E,rt.radiusX=b,rt.radiusY=z!==0?z:b,tt&&rt.close(),this.mc.segments.add(rt)};function wx(a,y,x,E,b,z,tt,rt){var ot;ot===void 0&&(ot=!1),y=new Ui(no,tt,rt,y,x,E,b,z),ot&&y.close(),a.mc.segments.add(y)}function N1(a){var y=zm;return y!==null?(zm=null,y.reset(a),y):(y=new jf,y.reset(a),y)}var zm=null;jf.className="StreamGeometryContext";function ss(a,y){var x=a.toLowerCase(),E=_t.Ze;E[a]=y,E[x]=a}ss("Rectangle",function(a,y,x){a="r"+y+","+x;var E=_t.Mf[a];return E!==void 0||(E=new ce(ce.u),E.endX=y,E.endY=x,_t.Nf<_t.vm&&(_t.Mf[a]=E,_t.Nf++)),E}),ss("Square",function(a,y,x){a="s"+y+","+x;var E=_t.Mf[a];return E!==void 0||(E=new ce(ce.u),E.endX=y,E.endY=x,E.defaultStretch=wi,_t.Nf<_t.vm&&(_t.Mf[a]=E,_t.Nf++)),E}),ss("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=_t.Mf[E];if(b!==void 0)return b;var z=a*_t.wg;return b=new ce().add(new Ir(a,0,!0).add(new Ui(Qi,y-a,0)).add(new Ui(br,y,a,y-z,0,y,z)).add(new Ui(Qi,y,x-a)).add(new Ui(br,y-a,x,y,x-z,y-z,x)).add(new Ui(Qi,a,x)).add(new Ui(br,0,x-a,z,x,0,x-z)).add(new Ui(Qi,0,a)).add(new Ui(br,a,0,0,z,z,0).close())),1<z&&(b.spot1=new gi(0,0,z,z),b.spot2=new gi(1,1,-z,-z)),_t.Nf<_t.vm&&(_t.Mf[E]=b,_t.Nf++),b}),ss("Border","RoundedRectangle"),ss("Ellipse",function(a,y,x){a="e"+y+","+x;var E=_t.Mf[a];return E!==void 0||(E=new ce(ce.F),E.endX=y,E.endY=x,E.spot1=Bl,E.spot2=ga,_t.Nf<_t.vm&&(_t.Mf[a]=E,_t.Nf++)),E}),ss("Circle",function(a,y,x){a="c"+y+","+x;var E=_t.Mf[a];return E!==void 0||(E=new ce(ce.F),E.endX=y,E.endY=x,E.spot1=Bl,E.spot2=ga,E.defaultStretch=wi,_t.Nf<_t.vm&&(_t.Mf[a]=E,_t.Nf++)),E}),ss("TriangleRight",function(a,y,x){return new ce().add(new Ir(0,0).add(new Ui(Qi,y,.5*x)).add(new Ui(Qi,0,x).close())).pm(0,.25,.5,.75)}),ss("TriangleDown",function(a,y,x){return new ce().add(new Ir(0,0).add(new Ui(Qi,y,0)).add(new Ui(Qi,.5*y,x).close())).pm(.25,0,.75,.5)}),ss("TriangleLeft",function(a,y,x){return new ce().add(new Ir(y,x).add(new Ui(Qi,0,.5*x)).add(new Ui(Qi,y,0).close())).pm(.5,.25,1,.75)}),ss("TriangleUp",function(a,y,x){return new ce().add(new Ir(y,x).add(new Ui(Qi,0,x)).add(new Ui(Qi,.5*y,0).close())).pm(.25,.5,.75,1)}),ss("Triangle","TriangleUp"),ss("Diamond",function(a,y,x){return new ce().add(new Ir(.5*y,0).add(new Ui(Qi,0,.5*x)).add(new Ui(Qi,.5*y,x)).add(new Ui(Qi,y,.5*x).close())).pm(.25,.25,.75,.75)}),ss("LineH",function(a,y,x){return a=new ce(ce.j),a.startX=0,a.startY=x/2,a.endX=y,a.endY=x/2,a}),ss("LineV",function(a,y,x){return a=new ce(ce.j),a.startX=y/2,a.startY=0,a.endX=y/2,a.endY=x,a}),ss("None","Rectangle"),ss("BarH","Rectangle"),ss("BarV","Rectangle"),ss("MinusLine","LineH"),ss("PlusLine",function(a,y,x){return new ce().add(new Ir(0,x/2,!1).add(new Ui(Qi,y,x/2)).add(new Ui(ar,y/2,0)).add(new Ui(Qi,y/2,x)))}),ss("XLine",function(a,y,x){return new ce().add(new Ir(0,x,!1).add(new Ui(Qi,y,0)).add(new Ui(ar,0,0)).add(new Ui(Qi,y,x)))}),ss("LineRight",function(a,y,x){return new ce().add(new Ir(.25*y,0,!1).add(new Ui(Qi,.75*y,.5*x)).add(new Ui(Qi,.25*y,x)))}),ss("LineDown",function(a,y,x){return new ce().add(new Ir(0,.25*x,!1).add(new Ui(Qi,.5*y,.75*x)).add(new Ui(Qi,y,.25*x)))}),ss("LineLeft",function(a,y,x){return new ce().add(new Ir(.75*y,0,!1).add(new Ui(Qi,.25*y,.5*x)).add(new Ui(Qi,.75*y,x)))}),ss("LineUp",function(a,y,x){return new ce().add(new Ir(0,.75*x,!1).add(new Ui(Qi,.5*y,.25*x)).add(new Ui(Qi,y,.75*x)))}),_t.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=$r,this.ir=null,this.jr="",this.lr=xa,this.Gq="",this.Hq=jr,this.Pq=Qn,this.Kq=Li,this.Up=null,this.Cq=127,this.zr=xi,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 Ai(a,y){a===void 0||a instanceof wa||typeof a=="string"?Pn.call(this,a):(Pn.call(this),a&&(y=a)),this.G=2408959,this.Tf="",this.P=null,this.Jg="",this.Qf=this.Ug=null,this.ec="",this.Ah=this.Ig=null,this.ke=new At(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new Te,this.Rh=null,this.ag=NaN,y&&Object.assign(this,y)}Le(Ai,Pn),Ai.prototype.cloneProtected=function(a){Pn.prototype.cloneProtected.call(this,a),a.G=this.G&-4097|49152,a.Tf=this.Tf,this.P!==null&&(a.P=this.P.nc?this.P:this.P.copy()),a.Jg=this.Jg,a.Qf=null,a.ec=this.ec,a.ke.assign(this.ke),a.Ao=this.Ao},wt=Ai.prototype,wt.Af=function(a){Pn.prototype.Af.call(this,a),a.oh(),a.Ug=null,a.nf=null,a.Rh=null},wt.toString=function(){var a=ni(this.constructor)+"#"+zi(this);return this.data!==null&&(a+="("+ji(this.data)+")"),a};function Is(a){a.P===null?a.P=new Dv:a.P.nc&&(a.P=a.P.copy())}wt.th=function(){Pn.prototype.th.call(this),this.P!==null&&(this.P.nc=!0)},wt.gk=function(a,y,x,E,b,z,tt){var rt=this.diagram;rt!==null&&(a===uo&&y==="elements"?b instanceof Pn?$d(b,function(ot){sy(rt.partManager,ot),Wd(rt,ot)}):ld(rt,b):a===yo&&y==="elements"&&(b instanceof Pn?$d(b,function(ot){ly(rt.partManager,ot,rt)}):Og(rt,b)),rt.cb(a,y,x,E,b,z,tt))},wt.La=function(a){if(Pn.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 Pn&&$d(b,function(z){z.data!==null&&z.La()})}for(y=this.adornments;y.next();)y.value.La(a)}},Ai.prototype.updateRelationshipsFromData=function(){var a;this.data!==null&&((a=this.diagram)===null||a===void 0||a.partManager.updateRelationshipsFromData(this))},Ai.prototype.Pj=function(a){var y=this.Qf;return y===null?null:y.I(a)},Ai.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 Be),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)))}}},Ai.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)}},Ai.prototype.Ej=function(){var a=this.Qf;if(a!==null){var y=Jn();for(a=a.iterator;a.next();)y.push(a.key);a=y.length;for(var x=0;x<a;x++)this.Jf(y[x]);li(y)}},Ai.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 rr?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate),!(x instanceof Qr))break t;jl(x),x=x.copy(),x!==null&&(this.ph()&&this.selectionObject===this.path&&(x.type=Pn.Link),x.adornedObject=y)}if(x!==null){x.type===Pn.Link&&x.v(),this.bh("Selection",x);break t}}this.Jf("Selection")}for(Cx(this,a),y=this.adornments;y.next();)y.value.La()}},Ai.prototype.Wb=function(){var a=this.diagram;a!==null&&(a.vd=!0,!(this.G&16384)&&(this.G|=16384))};function Ov(a){a.G&16384&&(a.updateAdornments(),a.G&=-16385)}function Cx(a,y){y.toolManager.mouseDownTools.each(function(x){x.isEnabled&&x.updateAdornments(a)}),y.toolManager.updateAdornments(a)}function Zm(a){if(cd(a)===!1){_v(a,!0),a.Uk();var y=a.diagram;y!==null&&(y.De.add(a),y.$b())}}function B1(a){if(a.G|=2097152,cd(a)!==!1){var y=a.position,x=a.location;x.w()&&y.w()||D1(a,y,x),x=a.Ib;var E=Te.alloc().assign(x);x.ka(),x.x=y.x,x.y=y.y,x.freeze(),a.Xl(E,x),Te.free(E),_v(a,!1)}}Ai.prototype.Ge=function(a,y,x,E){var b=this.uc;b.h(a,y,x,E),this.Lb===null&&(this.Lb=new ae);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),this.Lb=z,z.ws()||z.pp(b)},Ai.prototype.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=dr;this.locationSpot.sb()&&(z=this.locationSpot);var tt=At.alloc();if(this.locationObject!==this)for(y=this.locationObject,x=y.naturalBounds,tt.yi(x.x,x.y,x.width,x.height,z),y.Lb!==null&&y.Lb.Ga(tt),tt.offset(-y.measuredBounds.x,-y.measuredBounds.y),z=y.panel;z!==null&&z!==this;)z.Lb!==null&&z.Lb.Ga(tt),tt.offset(-z.measuredBounds.x,-z.measuredBounds.y),z=z.panel;else tt.yi(y,x,E,b,z);a.rotate(this.Kb,tt.x,tt.y),At.free(tt)}},Ai.prototype.move=function(a,y){y===!0?this.location=a:this.position=a},Ai.prototype.moveTo=function(a,y,x){a=At.allocAt(a,y),this.move(a,x),At.free(a)},Ai.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())},Ai.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())},Ai.prototype.fb=function(a){if(this.name===a)return this;var y=this.Rh;if(y===null&&(this.Rh=y=new Be),y.I(a)!==null)return y.I(a);var x=Pn.prototype.fb.call(this,a);return x!==null?(y.set(a,x),x):(y.set(a,null),null)};function Oh(a,y,x,E){E===void 0&&(E=new At),x=x.Mc()?dr: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}Ai.prototype.mi=function(a){return a===void 0&&(a=new Te),a.assign(this.actualBounds)},Ai.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function A1(a){var y=At.alloc(),x=a.locationObject,E=x.naturalBounds,b=x instanceof fr?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 ec(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}Ai.prototype.arrange=function(){if(Ss(this)===!1)B1(this);else{Hu(this,!1);var a=this.Ib,y=Te.alloc();y.assign(a);var x=fd(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()||_t.B(y.width,a.width)&&_t.B(y.height,a.height)||0<=this.vw&&this.C(16),Te.free(y),_v(this,!1)}},wt=Ai.prototype,wt.Xl=function(a,y){var x=this.diagram;if(x!==null){var E=!1;if(x.Zi===!1&&a.w()){var b=Te.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),Te.free(b)}!(this.G&65536)&&a.D(y)||_1(this,E,x),x.N(),!a.w()&&!y.w()||Wr(a,y)||(this instanceof qn&&!x.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}},wt.zv=function(a,y,x){if(this.ph()||!a.w())return!1;var E=this.diagram;return E!==null&&T1(this,E,a,y,x),this.pa=a,this.G&=-2097153,!this.ke.w()||E!==null&&!E.animationManager.isTicking&&E.undoManager.isUndoingRedoing||(E=this.ke,this.ke=new At(E.x+(a.x-y),E.y+(a.y-x)),this.g("location",E,this.ke.copy())),cd(this)===!1&&Ss(this)===!1&&(Zm(this),B1(this)),!0};function T1(a,y,x,E,b){y===null||a instanceof Qr||(y=y.animationManager,y.zb&&df(y,a,new At(E,b),x))}wt.mm=function(a,y,x){var E=this.ke,b=this.pa;if(x){if(E.x===a&&E.y===y)return;cd(this)||Ss(this)?b.h(NaN,NaN):b.h(b.x+a-E.x,b.y+y-E.y),E.h(a,y)}else{if(b.x===a&&b.y===y)return;E.h(E.x+a-b.x,E.y+y-b.y),b.h(a,y)}Zm(this)},wt.Av=function(){this.G&=-2097153,Zm(this)};function D1(a,y,x){var E=A1(a),b=a.diagram,z=x.w(),tt=y.w();z&&tt?a.G&2097152?O1(a,y,x,b,E):I1(a,y,x,b,E):z?O1(a,y,x,b,E):tt&&I1(a,y,x,b,E),a.G|=2097152,At.free(E),a.Uk()}function O1(a,y,x,E,b){var z=y.x,tt=y.y;y.h(x.x-b.x,x.y-b.y),E!==null&&(x=E.animationManager,(E=x.defaultAnimation.isAnimating)||!x.zb||a instanceof Qr||df(x,a,new At(z,tt),y),E||y.x===z&&y.y===tt||a.g("position",new At(z,tt),y.copy()))}function I1(a,y,x,E,b){var z=x.copy();x.h(y.x+b.x,y.y+b.y),x.D(z)||E===null||a.g("location",z,x.copy())}function _1(a,y,x){Rv(a,!1),a instanceof qn&&kh(x,a),a.layer.isTemporary||y||x.Ya(),y=a.Ib;var E=x.viewportBounds;E.w()?fd(a)?(Fo(y,E)||a.Fd(!1),a.updateAdornments()):a.isVisible()&&y.Yc(E)?(a.Fd(!0),a.updateAdornments()):a.Wb():x.vd=!0}wt.si=function(){return!0},wt.Zc=function(){return!0},wt.ph=function(){return!1},wt.Dd=function(){return!0};function Iv(a,y,x,E){y.constructor===a.constructor||z1||(z1=!0,Gn('Should not change the class of the Part when changing category from "'+x+'" to "'+E+'"'),Gn(" Old class: "+ni(a.constructor)+", new class: "+ni(y.constructor)+", part: "+a.toString())),a.Ej();var b=a.data;x=a.layerName;var z=a.isSelected,tt=a.isHighlighted,rt=!0,ot=!0,lt=!1;a instanceof qn&&(rt=a.isTreeLeaf,ot=a.isTreeExpanded,lt=a.wasTreeExpanded),y.Af(a),y.cloneProtected(a),a.Tf=E,a.svg!==null&&(a.svg.remove(),a.svg=null,a.Uc=!0),a.v(),a.N(),y=a.diagram,E=!0,y!==null&&(E=y.skipsUndoManager,y.skipsUndoManager=!0),a.ub=b,a.G=z?a.G|4096:a.G&-4097,a.G=tt?a.G|524288:a.G&-524289,a instanceof qn&&(a.U=rt?a.U|4:a.U&-5,a.U=ot?a.U|1:a.U&-2,a.U=lt?a.U|2:a.U&-3),b!==null&&a.La(),b=a.layerName,b!==x&&(a.Jg=x,a.layerName=b),y!==null&&(y.skipsUndoManager=E),a.Zc()&&a.C(64)}Ai.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},Ai.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},Ai.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},Ai.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},Ai.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},Ai.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},Ai.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},Ai.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},Ai.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 cd(a){return(a.G&32768)!==0}function _v(a,y){a.G=y?a.G|32768:a.G&-32769}function Rv(a,y){a.G=y?a.G|65536:a.G&-65537}function fd(a){return(a.G&131072)!==0}wt=Ai.prototype,wt.Fd=function(a){this.G=a?this.G|131072:this.G&-131073};function Gm(a,y){a.G=y?a.G|1048576:a.G&-1048577}wt.oh=function(){var a=this.containingGroup;a!==null&&(a.v(),a.placeholder!==null&&a.placeholder.v(),a.Bd())},wt.N=function(){var a=this.diagram;a!==null&&!Ss(this)&&!cd(this)&&this.isVisible()&&this.Ib.w()&&a.N(ec(this,this.Ib))},wt.v=function(){Pn.prototype.v.call(this);var a=this.diagram;a!==null&&(a.De.add(this),this instanceof qn&&this.labeledLink!==null&&ys(this.labeledLink),a.$b(!0))},wt.Vo=function(a){a||(a=this.Ah,a!==null&&Wv(a,this))},wt.Wo=function(a){a||(a=this.Ah,a!==null&&Vv(a,this))},wt.Lj=function(){var a=this.data;if(a!==null){var y=this.diagram;y!==null&&(y=y.model,y!==null&&y.cm(a))}},wt.oz=function(){return jv(this,this)};function jv(a,y){var x=y.containingGroup;return x!==null?1+jv(a,x):y instanceof qn&&(y=y.labeledLink,y!==null)?jv(a,y):0}wt.sz=function(){return R1(this,this)};function R1(a,y){var x=y.containingGroup;return x!==null||y instanceof qn&&(x=y.labeledLink,x!==null)?R1(a,x):y}wt.Td=function(a){return a instanceof rr?zv(this,this,a):!1};function zv(a,y,x){if(y===x||x===null)return!1;var E=y.containingGroup;return E===null||E!==x&&!zv(a,E,x)?y instanceof qn&&(y=y.labeledLink,y!==null)?zv(a,y,x):!1:!0}wt.px=function(a){if(a===null)return null;if(this===a)return this.containingGroup;for(var y=this;y!==null;){if(y instanceof rr&&Gm(y,!0),y instanceof qn){var x=y.labeledLink;x!==null&&(y=x)}y=y.containingGroup}for(x=null,y=a;y!==null;){if(y.G&1048576){x=y;break}y instanceof qn&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup}for(y=this;y!==null;)y instanceof rr&&Gm(y,!1),y instanceof qn&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup;return x},Ai.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return!(a!==null&&a.isTemporary||this instanceof qn&&this.isLinkLabel)},Ai.prototype.C=function(a){if(a===void 0&&(a=16777215),this.isLayoutPositioned&&a&this.layoutConditions){var y=this.layer;y!==null&&y.isTemporary||this instanceof qn&&this.isLinkLabel?y=!1:(y=this.diagram,y=!(y!==null&&y.undoManager.isUndoingRedoing))}else y=!1;if(y)if(y=this.Ah,y!==null){var x=y.layout;x!==null?x.C():y.C(a)}else a=this.diagram,a!==null&&(a=a.layout,a!==null&&a.C())};function j1(a){return a.isVisible()?(a=a.layer,!(a!==null&&a.isTemporary)):!1}function gd(a,y,x,E,b,z){if(z===void 0&&(z=null),!(a.contains(y)||z!==null&&!z(y)||y instanceof Qr)){if(a.add(y),y instanceof qn){if(x&&y instanceof rr)for(var tt=y.memberParts;tt.next();)gd(a,tt.value,x,E,b,z);if(b!==!1)for(tt=y.linksConnected;tt.next();){var rt=tt.value;if(!a.contains(rt)){var ot=rt.fromNode,lt=rt.toNode;ot=ot===null||a.contains(ot),lt=lt===null||a.contains(lt),(b?ot&&lt:ot||lt)&&gd(a,rt,x,E,b,z)}}if(1<E)for(y=y.Ou();y.next();)gd(a,y.value,x,E-1,b,z)}else if(y instanceof kn)for(y=y.labelNodes;y.next();)gd(a,y.value,x,E,b,z)}}Se.Object.defineProperties(Ai.prototype,{key:{get:function(){var a=this.diagram;if(a!==null)return a.model.wa(this.data)}},adornments:{get:function(){return this.Qf===null?yr: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(yo,"parts",y,this,null,E,!0),E=a.oi(99999999,this,!0),y.visible!==a.visible&&this.Zb(a.visible),0<=E&&x.cb(uo,"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&&(Is(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&&gf(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 Qr?this.type!==Pn.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:Qn},set:function(a){var y=this.minLocation;y.D(a)||(a=a.J(),Is(this),this.P.Pq=a,this.g("minLocation",y,a))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:Li},set:function(a){var y=this.maxLocation;y.D(a)||(a=a.J(),Is(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&&(Is(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:jr},set:function(a){var y=this.locationSpot;y.D(a)||(a=a.J(),Is(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,Ss(this)===!1&&(Zm(this),x=this.pa,x.w())){var b=this.diagram;if(b===null||b.animationManager.isTicking||!b.undoManager.isUndoingRedoing){var z=x.copy();x.h(x.x+(y.x-E.x),x.y+(y.y-E.y)),T1(this,b,x,z.x,z.y),this.g("position",z,x.copy())}}y=!0}y&&this.g("location",E,a.copy())}}},category:{get:function(){return this.Tf},set:function(a){var y=this.Tf;if(y!==a){this.svg!==null&&(this.svg.remove(),this.Uc=!0);var x=this.diagram,E=this.data,b=null;if(x!==null&&E!==null&&!(this instanceof Qr)){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 Qr?this instanceof Qr&&(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&&(jl(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&&(jl(x),x=x.copy(),x===null||x instanceof kn||(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&&(Is(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&&(Is(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&&(Is(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 kn?(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&&(Is(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&&(Is(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&&(Is(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:$r},set:function(a){var y=this.resizeCellSize;y.D(a)||(a=a.J(),Is(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&&(Is(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&&(Is(this),this.P.jr=a,this.g("rotateObjectName",y,a))}},rotateObject:{get:function(){var a=this.rotateObjectName;return a!==""&&(a=this.fb(a),a!==null)?a:this}},rotationSpot:{get:function(){return this.P!==null?this.P.lr:xa},set:function(a){var y=this.rotationSpot;y.D(a)||(a=a.J(),Is(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&&Gt("Cannot make a Group a member of itself: "+this.toString()),Gt("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString())),this.C(2);var x=this.diagram;if(y!==null?Vv(y,this):this instanceof rr&&x!==null&&x.ai.remove(this),this.Ah=a,a!==null?Wv(a,this):this instanceof rr&&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 rr){for(x=new gn,gd(x,this,!0,0,!0),x=x.iterator;x.next();)if(E=x.value,E instanceof qn)for(E=E.linksConnected;E.next();)Zf(E.value)}if(this instanceof qn){for(x=this.linksConnected;x.next();)Zf(x.value);x=this.labeledLink,x!==null&&Zf(x)}this.g("containingGroup",y,a),a!==null&&(y=a.layer,y!==null&&gf(y,-1,a))}}else Gt("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&&(Is(this),this.P.Kp=a,this.g("containingGroupChanged",y,a))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof qn&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(a){var y=this.layoutConditions;y!==a&&(Is(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&&(Is(this),this.P.Up=a,this.g("dragComputation",y,a))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:xi},set:function(a){var y=this.shadowOffset;y.D(a)||(a=a.J(),Is(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&&(Is(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&&(Is(this),this.P.Vg=a,this.N(),this.g("shadowBlur",y,a))}}}),Ai.prototype.invalidateLayout=Ai.prototype.C,Ai.prototype.findCommonContainingGroup=Ai.prototype.px,Ai.prototype.isMemberOf=Ai.prototype.Td,Ai.prototype.findTopLevelPart=Ai.prototype.sz,Ai.prototype.findSubGraphLevel=Ai.prototype.oz,Ai.prototype.ensureBounds=Ai.prototype.Va,Ai.prototype.getDocumentBounds=Ai.prototype.mi,Ai.prototype.findObject=Ai.prototype.fb,Ai.prototype.moveTo=Ai.prototype.moveTo,Ai.prototype.invalidateAdornments=Ai.prototype.Wb,Ai.prototype.clearAdornments=Ai.prototype.Ej,Ai.prototype.removeAdornment=Ai.prototype.Jf,Ai.prototype.addAdornment=Ai.prototype.bh,Ai.prototype.findAdornment=Ai.prototype.Pj,Ai.prototype.updateTargetBindings=Ai.prototype.La;var z1=!1;Ai.className="Part",Ai.LayoutNone=0,Ai.LayoutAdded=1,Ai.LayoutRemoved=2,Ai.LayoutShown=4,Ai.LayoutHidden=8,Ai.LayoutNodeSized=16,Ai.LayoutGroupLayout=32,Ai.LayoutNodeReplaced=64,Ai.LayoutStandard=127,Ai.LayoutAll=16777215;function Qr(a,y){a===void 0||a instanceof wa||typeof a=="string"?Ai.call(this,a):(Ai.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)}Le(Qr,Ai),Qr.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(a!==null?a.toString():"")},Qr.prototype.updateRelationshipsFromData=function(){},Qr.prototype.Ul=function(a){var y=this.adornedObject,x=y==null?void 0:y.part;if(x instanceof kn&&y instanceof fr){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 fr&&(b.ua=a)}}},Qr.prototype.si=function(){var a=this.ue;return a===null?!0:(a=a.part,a===null||!Ss(a))},Qr.prototype.Zc=function(){return!1},Qr.prototype.gk=function(a,y,x,E,b,z,tt){if(a===uo&&y==="elements"){if(b instanceof Ps)this.$a===null&&(this.$a=b);else if(b instanceof Pn){var rt=b.Nl(function(ot){return ot instanceof Ps});rt instanceof Ps&&this.$a===null&&(this.$a=rt)}}else a===yo&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof Pn&&this.$a.rg(E)&&(this.$a=null));Ai.prototype.gk.call(this,a,y,x,E,b,z,tt)},Qr.prototype.updateAdornments=function(){},Qr.prototype.Lj=function(){},Se.Object.defineProperties(Qr.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}}}),Qr.className="Adornment";function Zv(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=ia,this.er=Vm,this.Kr=this.ij=this.Nq=this.Mq=null}Zv.prototype.copy=function(){var a=new Zv;return a.Dq=this.Dq,a.Eq=this.Eq,a.gj=this.gj,a.Vr=this.Vr,a.yp=this.yp.J(),a.er=this.er,a.Mq=this.Mq,a.Nq=this.Nq,a.ij=this.ij,a.Kr=this.Kr,a};function qn(a,y){a===void 0||a instanceof wa||typeof a=="string"?Ai.call(this,a):(Ai.call(this),a&&(y=a)),this.U=13,this.Ba=null,this.jb=new cn,this.wc=this.af=this.Yk=null,this.ci=!1,y&&Object.assign(this,y)}Le(qn,Ai),qn.prototype.cloneProtected=function(a){Ai.prototype.cloneProtected.call(this,a),a.U=this.U,this.Ba!==null&&(a.Ba=this.Ba.nc?this.Ba:this.Ba.copy())},wt=qn.prototype,wt.Af=function(a){Ai.prototype.Af.call(this,a),a.Bd(),a.af=this.af,a.wc=null};function Ih(a){a.Ba===null?a.Ba=new Zv:a.Ba.nc&&(a.Ba=a.Ba.copy())}wt.th=function(){Ai.prototype.th.call(this),this.Ba!==null&&(this.Ba.nc=!0)};function Z1(a,y){y!==null&&(a.af===null&&(a.af=new gn),a.af.add(y))}function G1(a,y,x,E){if(y===null||a.af===null)return null;for(var b=a.af.iterator;b.next();){var z=b.value;if(z.Ds===a&&z.cv===y&&z.Ox===x&&z.Px===E||z.Ds===y&&z.cv===a&&z.Ox===E&&z.Px===x)return z}return null}wt.Lz=function(a,y,x){y==null&&(y=""),x==null&&(x=""),a=G1(this,a,y,x),a!==null&&a.Sl()},wt.gk=function(a,y,x,E,b,z,tt){a===uo&&y==="elements"?this.wc=null:a===yo&&y==="elements"&&(this.wc=null),Ai.prototype.gk.call(this,a,y,x,E,b,z,tt)},wt.Bd=function(a){for(var y=this.linksConnected;y.next();){var x=y.value;a!==void 0&&a.contains(x)||($s(x.fromPort),$s(x.toPort),x.bb())}};function H1(a,y){for(a=a.linksConnected;a.next();){var x=a.value;(x.fromPort===y||x.toPort===y)&&($s(x.fromPort),$s(x.toPort),x.bb())}}function $s(a){if(a!==null){var y=a.Zn;y!==null&&y.Sl(),a=a.part,y=a.containingGroup,y===null||a.isVisible()||$s(y.port)}}wt.si=function(){return!0},qn.prototype.getAvoidableRect=function(a){return a.set(this.actualBounds),a.Co(this.avoidableMargin),a},qn.prototype.findVisibleNode=function(){for(var a=this;a!==null&&!a.isVisible();)a=a.containingGroup;return a},qn.prototype.isVisible=function(){if(!Ai.prototype.isVisible.call(this))return!1;var a=!0,y=Nh,x=this.diagram;if(x!==null&&(a=x.isTreePathToChildren,y=x.treeCollapsePolicy),y===Nh){if(a=this.pg(),a!==null&&!a.isTreeExpanded)return!1}else if(y===pa){if(a=a?this.Oo():this.Po(),0<a.count&&a.all(function(E){return!E.isTreeExpanded}))return!1}else if(y===Ff&&(a=a?this.Oo():this.Po(),0<a.count&&a.any(function(E){return!E.isTreeExpanded})))return!1;return a=this.labeledLink,a!==null?a.isVisible():!0},qn.prototype.Zb=function(a){Ai.prototype.Zb.call(this,a);for(var y=this.linksConnected;y.next();){var x=y.value;if(a&&this.containingGroup!==null){var E=x.To(this);E===null||E.Td(this.containingGroup)||x.bb()}x.Zb(a)}},qn.prototype.qx=function(){var a=new gn,y=new gn;return W1(this,this,a,y),y.iterator};function W1(a,y,x,E){if(y!==null&&!x.has(y)){x.add(y);var b=!0,z=a.diagram;z!==null&&(b=z.isTreePathToChildren),y.linksConnected.each(function(tt){tt.isTreeLink?(b?tt.fromNode===y:tt.toNode===y)&&W1(a,b?tt.toNode:tt.fromNode,x,E):E.add(tt)})}}qn.prototype.findLinksConnected=function(a){if(a===void 0&&(a=null),a===null)return this.jb.iterator;var y=new _r(this.jb),x=this;return y.predicate=function(E){return E.fromNode===x&&E.fromPortId===a||E.toNode===x&&E.toPortId===a},y},wt=qn.prototype,wt.Mo=function(a){a===void 0&&(a=null);var y=new _r(this.jb),x=this;return y.predicate=function(E){return E.fromNode!==x?!1:a===null?!0:E.fromPortId===a},y},wt.Sd=function(a){a===void 0&&(a=null);var y=new _r(this.jb),x=this;return y.predicate=function(E){return E.toNode!==x?!1:a===null?!0:E.toPortId===a},y},wt.Mu=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.fromNode===this?(a===null||b.fromPortId===a)&&(b=b.toNode,y!==null?y.add(b):x!==null&&x!==b?(y=new gn,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 gn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new Nr(x):yr},wt.Po=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.fromNode!==this||a!==null&&b.fromPortId!==a||(b=b.toNode,y!==null?y.add(b):x!==null&&x!==b?(y=new gn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new Nr(x):yr},wt.Oo=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.toNode!==this||a!==null&&b.toPortId!==a||(b=b.fromNode,y!==null?y.add(b):x!==null&&x!==b?(y=new gn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new Nr(x):yr},wt.jz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new _r(this.jb),b=this;return E.predicate=function(z){return!((z.fromNode!==b||z.toNode!==a||y!==null&&z.fromPortId!==y||x!==null&&z.toPortId!==x)&&(z.fromNode!==a||z.toNode!==b||x!==null&&z.fromPortId!==x||y!==null&&z.toPortId!==y))},E},wt.kz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new _r(this.jb),b=this;return E.predicate=function(z){return!(z.fromNode!==b||z.toNode!==a||y!==null&&z.fromPortId!==y||x!==null&&z.toPortId!==x)},E};function Hm(a,y,x){$s(x);var E=a.jb.contains(y);if(E||a.jb.add(y),!E||y.fromNode===y.toNode){var b=a.linkConnected;if(b!==null){var z=!0,tt=a.diagram;tt!==null&&(z=tt.aa,tt.aa=!0),b(a,y,x),tt!==null&&(tt.aa=z)}}!E&&y.isTreeLink&&(x=y.fromNode,y=y.toNode,x!==null&&y!==null&&x!==y&&(E=!0,a=a.diagram,a!==null&&(E=a.isTreePathToChildren),b=E?y:x,z=E?x:y,b.ci||(b.ci=z),!z.isTreeLeaf||a!==null&&a.undoManager.isUndoingRedoing||(E?x===z&&(z.isTreeLeaf=!1):y===z&&(z.isTreeLeaf=!1))))}function Wm(a,y,x){$s(x);var E=a.jb.remove(y),b=null;if(E||y.toNode===y.fromNode){var z=a.linkDisconnected;if(b=a.diagram,z!==null){var tt=!0;b!==null&&(tt=b.aa,b.aa=!0),z(a,y,x),b!==null&&(b.aa=tt)}}E&&y.isTreeLink&&(x=!0,b!==null&&(x=b.isTreePathToChildren),a=x?y.toNode:y.fromNode,y=x?y.fromNode:y.toNode,a!==null&&(a.ci=!1),y===null||y.isTreeLeaf||(y.jb.count===0?(y.ci=null,b!==null&&b.undoManager.isUndoingRedoing||(y.isTreeLeaf=!0)):ip(y)))}function ip(a){if(a.ci=!1,a.jb.count!==0){var y=!0,x=a.diagram;if(x===null||!x.undoManager.isUndoingRedoing){for(x!==null&&(y=x.isTreePathToChildren),x=a.jb.iterator;x.next();){var E=x.value;if(E.isTreeLink){if(y){if(E.fromNode===a){a.isTreeLeaf=!1;return}}else if(E.toNode===a){a.isTreeLeaf=!1;return}}}a.isTreeLeaf=!0}}}qn.prototype.updateRelationshipsFromData=function(){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)},wt=qn.prototype,wt.Vo=function(a){Ai.prototype.Vo.call(this,a),a||(ip(this),a=this.Yk,a!==null&&q1(a,this))},wt.Wo=function(a){Ai.prototype.Wo.call(this,a),a||(a=this.Yk,a!==null&&a.wd!==null&&(a.wd.remove(this),a.v()))},wt.Lj=function(){if(0<this.jb.count){var a=this.diagram;if(a!==null)for(var y=a.commandHandler!==null?a.commandHandler.deletesConnectedLinks:!0,x=this.jb.copy().iterator;x.next();){var E=x.value;y?a.remove(E):(E.fromNode===this&&(E.fromNode=null),E.toNode===this&&(E.toNode=null))}}this.labeledLink=null,Ai.prototype.Lj.call(this)},wt.ns=function(a){if(this.wc===null){if(a===""&&this.Te===!1)return this;V1(this)}var y=this.wc.I(a);return y!==null||a!==""&&(y=this.wc.I(""),y!==null)?y:this};function V1(a){a.wc===null?a.wc=new Be:a.wc.clear(),a.qm(a,function(y,x){K1(y,x)}),a.wc.count===0&&a.wc.add("",a)}function K1(a,y){var x=y.portId;x!==null&&a.wc!==null&&a.wc.add(x,y)}function Gv(a,y,x){var E=y.portId;if(E!==null&&(a.wc!==null&&a.wc.remove(E),y=a.diagram,y!==null&&x)){for(x=null,a=a.findLinksConnected(E);a.next();)E=a.value,x===null&&(x=Jn()),x.push(E);if(x!==null){for(a=0;a<x.length;a++)y.remove(x[a]);li(x)}}}wt.Nz=function(a){if(a===null||a===this)return!1;var y=!0,x=this.diagram;if(x!==null&&(y=x.isTreePathToChildren),x=this,y)for(;x!==a;){y=null;for(var E=x.jb.iterator;E.next();){var b=E.value;if(b.isTreeLink&&(y=b.fromNode,y!==x&&y!==this))break}if(y===this||y===null||y===x)return!1;x=y}else for(;x!==a;){for(y=null,E=x.jb.iterator;E.next()&&(b=E.value,!b.isTreeLink||(y=b.toNode,y===x||y===this)););if(y===this||y===null||y===x)return!1;x=y}return!0},wt.xz=function(){var a=!0,y=this.diagram;if(y!==null&&(a=y.isTreePathToChildren),y=this,a)for(;;){a=null;for(var x=y.jb.iterator;x.next();){var E=x.value;if(E.isTreeLink&&(a=E.fromNode,a!==y&&a!==this))break}if(a===this)return this;if(a===null||a===y)return y;y=a}else for(;;){for(a=null,x=y.jb.iterator;x.next()&&(E=x.value,!E.isTreeLink||(a=E.toNode,a===y||a===this)););if(a===this)return this;if(a===null||a===y)return y;y=a}},wt.gz=function(a){if(a===null)return null;if(this===a)return this;for(var y=this;y!==null;)Gm(y,!0),y=y.pg();var x=null;for(y=a;y!==null;){if(y.G&1048576){x=y;break}y=y.pg()}for(y=this;y!==null;)Gm(y,!1),y=y.pg();return x},wt.kh=function(){var a=!0,y=this.diagram;if(y!==null&&(a=y.isTreePathToChildren),y=this.jb.iterator,a){for(;y.next();)if(a=y.value,a.isTreeLink&&a.fromNode!==this)return a}else for(;y.next();)if(a=y.value,a.isTreeLink&&a.toNode!==this)return a;return null},wt.pg=function(){var a=this.ci;if(a===null)return null;if(a instanceof qn)return a;a=this.diagram,a=a!==null?a.isTreePathToChildren:!0;for(var y=this.jb.iterator;y.next();){var x=y.value;if(x.isTreeLink&&(x=a?x.fromNode:x.toNode,x!==this))return this.ci=x}return this.ci=null},wt.vz=function(){function a(x,E){E.add(x);var b=x.kh();b!==null&&(E.add(b),x=x.pg(),x!==null&&a(x,E))}var y=new gn;return a(this,y),y},wt.uz=function(){return U1(this,this)};function U1(a,y){return y=y.pg(),y===null?0:1+U1(a,y)}wt.Qo=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren),y=new _r(this.jb);var x=this;return y.predicate=a?function(E){return!!(E.isTreeLink&&E.fromNode===x)}:function(E){return!!(E.isTreeLink&&E.toNode===x)},y},wt.Ou=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren);var x=y=null,E=this.jb.iterator;if(a)for(;E.next();)a=E.value,a.isTreeLink&&a.fromNode===this&&(a=a.toNode,y!==null?y.add(a):x!==null&&x!==a?(y=new cn,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 cn,y.add(x),y.add(a)):x=a);return y!==null?y.iterator:x!==null?new Nr(x):yr},wt.wz=function(a){a===void 0&&(a=1/0);var y=new gn;return gd(y,this,!1,a,!0),y},qn.prototype.collapseTree=function(a){a===void 0&&(a=1),1>a&&(a=1);var y=this.diagram;if(y!==null&&!y.Ue){y.Ue=!0;var x=new gn;x.add(this),Y1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Nh),y.Ue=!1}};function Y1(a,y,x,E,b,z,tt){if(1<E)for(var rt=x?a.Mo():a.Sd();rt.next();){var ot=rt.value;ot.isTreeLink&&(ot=ot.To(a),ot===null||ot===a||y.contains(ot)||(y.add(ot),Y1(ot,y,x,E-1,b,z,tt)))}else X1(a,y,x,b,z,tt)}function X1(a,y,x,E,b,z){for(var tt=b===a?!0:a.isTreeExpanded,rt=x?a.Mo():a.Sd(),ot={};rt.next();){var lt=rt.value;if(lt.isTreeLink&&(lt=lt.To(a),lt!==null&&lt!==a)){var ut=y.contains(lt);if(ut||y.add(lt),tt){var ft=x?lt.Oo():lt.Po();ot.uv=a,ft.all(function(yt){return function(xt){return xt===yt.uv||!xt.isTreeExpanded}}(ot))&&E.Aj(lt,b),lt.oh(),lt.Zb(!1)}lt.isTreeExpanded&&(lt.wasTreeExpanded=lt.isTreeExpanded,ut||X1(lt,y,x,E,b,z))}ot={uv:ot.uv}}a.isTreeExpanded=!1}qn.prototype.expandTree=function(a){a===void 0&&(a=2),2>a&&(a=2);var y=this.diagram;if(y!==null&&!y.Ue){y.Ue=!0;var x=new gn;x.add(this),J1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Nh),y.Ue=!1}};function J1(a,y,x,E,b,z,tt){for(var rt=z===a?!1:a.isTreeExpanded,ot=x?a.Mo():a.Sd(),lt={};ot.next();){var ut=ot.value;if(ut.isTreeLink&&(rt||ut.fd||ut.bb(),ut=ut.To(a),ut!==null&&ut!==a&&!y.contains(ut))){if(y.add(ut),!rt){ut.Zb(!0),ut.oh();var ft=x?ut.Oo():ut.Po();lt.vv=a,ft.all(function(yt){return function(xt){return xt===yt.vv||!xt.isTreeExpanded}}(lt))&&b.Cj(ut,z)}(2<E||ut.wasTreeExpanded)&&(ut.wasTreeExpanded=!1,J1(ut,y,x,E-1,b,z,tt))}lt={vv:lt.vv}}a.isTreeExpanded=!0}Se.Object.defineProperties(qn.prototype,{portSpreading:{get:function(){return this.Ba!==null?this.Ba.er:Vm},set:function(a){var y=this.portSpreading;y!==a&&(Ih(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&&kh(x,this),this.g("avoidable",y,a)}}},avoidableMargin:{get:function(){return this.Ba!==null?this.Ba.yp:ia},set:function(a){typeof a=="number"&&(a=new or(a));var y=this.avoidableMargin;if(!y.D(a)){a=a.J(),Ih(this),this.Ba.yp=a;var x=this.diagram;x!==null&&kh(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&&(Ih(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&&(Ih(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&&(Ih(this),this.Ba.gj=a,this.g("linkValidation",y,a))}},isLinkLabel:{get:function(){return this.Yk!==null}},labeledLink:{get:function(){return this.Yk},set:function(a){var y=this.Yk;if(y!==a){var x=this.diagram,E=this.data;if(y!==null){if(y.wd!==null&&(y.wd.remove(this),y.v()),x!==null&&E!==null&&!x.undoManager.isUndoingRedoing){var b=y.data,z=x.model;if(b!==null&&z.ri()){var tt=z.wa(E);tt!==void 0&&z.Qx(b,tt)}}this.containingGroup=null}this.Yk=a,a!==null&&(q1(a,this),x===null||E===null||x.undoManager.isUndoingRedoing||(b=a.data,x=x.model,b!==null&&x.ri()&&(E=x.wa(E),E!==void 0&&x.Bu(b,E))),this.containingGroup=a.containingGroup),ys(this),this.g("labeledLink",y,a)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return this.wc===null&&V1(this),this.wc.iteratorValues}},isTreeExpanded:{get:function(){return(this.U&1)!==0},set:function(a){var y=(this.U&1)!==0;if(y!==a){this.U^=1;var x=this.diagram;if(this.g("isTreeExpanded",y,a),y=this.treeExpandedChanged,y!==null){var E=!0;x!==null&&(E=x.aa,x.aa=!0),y(this),x!==null&&(x.aa=E)}x!==null&&x.undoManager.isUndoingRedoing?this.Zb(a):a?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{get:function(){return(this.U&2)!==0},set:function(a){var y=(this.U&2)!==0;y!==a&&(this.U^=2,this.g("wasTreeExpanded",y,a))}},treeExpandedChanged:{get:function(){return this.Ba!==null?this.Ba.Vr:null},set:function(a){var y=this.treeExpandedChanged;y!==a&&(Ih(this),this.Ba.Vr=a,this.g("treeExpandedChanged",y,a))}},isTreeLeaf:{get:function(){return(this.U&4)!==0},set:function(a){var y=(this.U&4)!==0;y!==a&&(this.U^=4,this.g("isTreeLeaf",y,a))}}}),qn.prototype.expandTree=qn.prototype.expandTree,qn.prototype.collapseTree=qn.prototype.collapseTree,qn.prototype.findTreeParts=qn.prototype.wz,qn.prototype.findTreeChildrenNodes=qn.prototype.Ou,qn.prototype.findTreeChildrenLinks=qn.prototype.Qo,qn.prototype.findTreeLevel=qn.prototype.uz,qn.prototype.findTreeParentChain=qn.prototype.vz,qn.prototype.findTreeParentNode=qn.prototype.pg,qn.prototype.findTreeParentLink=qn.prototype.kh,qn.prototype.findCommonTreeParent=qn.prototype.gz,qn.prototype.findTreeRoot=qn.prototype.xz,qn.prototype.isInTreeOf=qn.prototype.Nz,qn.prototype.findPort=qn.prototype.ns,qn.prototype.findLinksTo=qn.prototype.kz,qn.prototype.findLinksBetween=qn.prototype.jz,qn.prototype.findNodesInto=qn.prototype.Oo,qn.prototype.findNodesOutOf=qn.prototype.Po,qn.prototype.findNodesConnected=qn.prototype.Mu,qn.prototype.findLinksInto=qn.prototype.Sd,qn.prototype.findLinksOutOf=qn.prototype.Mo,qn.prototype.findExternalTreeLinksConnected=qn.prototype.qx,qn.prototype.invalidateConnectedLinks=qn.prototype.Bd,qn.prototype.invalidateLinkBundle=qn.prototype.Lz;var Ex=new en(qn,"SpreadingNone",10),Vm=new en(qn,"SpreadingEvenly",11),Hv=new en(qn,"SpreadingPacked",12);qn.className="Node",qn.SpreadingNone=Ex,qn.SpreadingEvenly=Vm,qn.SpreadingPacked=Hv;function rr(a,y){a===void 0||a instanceof wa||typeof a=="string"?qn.call(this,a):(qn.call(this),a&&(y=a)),this.U|=4608,this.Gn=new gn,this.$a=null,this.Sc=new Ko,this.Sc.group=this,this.gl=new gn,this.tb=this.$p=null,y&&Object.assign(this,y)}Le(rr,qn),rr.prototype.cloneProtected=function(a){qn.prototype.cloneProtected.call(this,a),this.U=this.U&-32769;var y=a.Nl(function(x){return x instanceof Ps});y instanceof Ps?a.$a=y:a.$a=null,this.Sc!==null?(a.Sc=this.Sc.copy(),a.Sc.group=a):(a.Sc!==null&&(a.Sc.group=null),a.Sc=null),this.tb!==null&&(a.tb=this.tb.copy())},wt=rr.prototype,wt.Af=function(a){qn.prototype.Af.call(this,a);var y=a.Rj();for(a=a.memberParts;a.next();){var x=a.value;if(x.v(),x.C(8),x.Ej(),x instanceof qn)x.Bd(y);else if(x instanceof kn)for(x=x.labelNodes;x.next();)x.value.Bd(y)}},wt.gk=function(a,y,x,E,b,z,tt){if(a===uo&&y==="elements"){if(b instanceof Ps)this.$a===null?this.$a=b:this.$a!==b&&Gt("Cannot insert a second Placeholder into the visual tree of a Group.");else if(b instanceof Pn){var rt=b.Nl(function(ot){return ot instanceof Ps});rt instanceof Ps&&(this.$a===null?this.$a=rt:this.$a!==rt&&Gt("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===yo&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof Pn&&this.$a.rg(E)&&(this.$a=null));qn.prototype.gk.call(this,a,y,x,E,b,z,tt)},wt.Xl=function(a,y){qn.prototype.Xl.call(this,a,y),this.isClipping&&this.type!==Pn.Spot&&this.isSubGraphExpanded&&(a=this.resizeObject,a instanceof Pn&&(a=a.Pb()),this.tb===null&&(this.tb=new Te),a.mi(this.tb),a instanceof fr&&this.tb.Bc(-a.strokeWidth,-a.strokeWidth))},wt.eh=function(a,y,x,E){this.nf=this.$a,qn.prototype.eh.call(this,a,y,x,E)},wt.Va=function(){var a=this;a.isSubGraphExpanded&&this.memberParts.each(function(y){!a.computesBoundsIncludingLinks&&y instanceof kn||y.Va()}),qn.prototype.Va.call(this)},wt.si=function(){if(!qn.prototype.si.call(this))return!1;for(var a=this.memberParts;a.next();){var y=a.value;if(y instanceof qn){if(y.isVisible()&&Ss(y))return!1}else if(y instanceof kn&&y.isVisible()&&Ss(y)&&y.fromNode!==this&&y.toNode!==this)return!1}return!0};function Wv(a,y){if(a.Gn.add(y)){y instanceof rr&&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 kn&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}function Vv(a,y){if(a.Gn.remove(y)){y instanceof rr&&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 kn&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}wt.Lj=function(){if(0<this.Gn.count){var a=this.diagram;if(a!==null)for(var y=this.Gn.copy().iterator;y.next();)a.remove(y.value)}qn.prototype.Lj.call(this)},rr.prototype.canAddMembers=function(a){var y=this.diagram;if(y===null)return!1;for(y=y.commandHandler,a=Ze(a).iterator;a.next();)if(!y.isValidMember(this,a.value))return!1;return!0},rr.prototype.addMembers=function(a,y){var x=this.diagram;if(x===null)return!1;x=x.commandHandler;var E=!0;for(a=Ze(a).iterator;a.next();){var b=a.value;!y||x.isValidMember(this,b)?b.containingGroup=this:E=!1}return E},rr.prototype.canUngroup=function(){if(!this.ungroupable)return!1;var a=this.layer;return a===null||!a.allowUngroup?!1:(a=a.diagram,!!(a===null||a.allowUngroup))},wt=rr.prototype,wt.Bd=function(a){var y=(this.U&65536)!==0;if(qn.prototype.Bd.call(this,a),!y)for(!(this.U&65536)&&(this.U=this.U^65536),y=this.Lu();y.next();){var x=y.value;if(a===void 0||!a.contains(x)){var E=x.fromNode;E!==null&&E!==this&&E.Td(this)&&!E.isVisible()?($s(x.fromPort),$s(x.toPort),x.bb()):(E=x.toNode,E!==null&&E!==this&&E.Td(this)&&!E.isVisible()&&($s(x.fromPort),$s(x.toPort),x.bb()))}}},wt.Lu=function(){var a=this.diagram!==null&&this.diagram.Pw;if(a&&this.$p!==null)return this.$p.iterator;var y=this.Rj();y.add(this);for(var x=new gn,E=y.iterator;E.next();){var b=E.value;if(b instanceof qn)for(b=b.linksConnected;b.next();){var z=b.value;y.contains(z)||x.add(z)}}return a&&(this.$p=x),x.iterator},wt.iz=function(){var a=this.Rj();a.add(this);for(var y=new gn,x=a.iterator;x.next();){var E=x.value;if(E instanceof qn)for(E=E.linksConnected;E.next();){var b=E.value,z=b.fromNode;z===null||a.contains(z)&&z!==this||y.add(z),b=b.toNode,b===null||a.contains(b)&&b!==this||y.add(b)}}return y.iterator},wt.hz=function(){function a(x,E){x!==null&&(E.add(x),a(x.containingGroup,E))}var y=new gn;return a(this,y),y},wt.Rj=function(){var a=new gn;return gd(a,this,!0,0,!0),a.remove(this),a},wt.Zb=function(a){qn.prototype.Zb.call(this,a);for(var y=this.memberParts;y.next();)y.value.Zb(a)},rr.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 rr&&z.isSubGraphExpanded&&(z.wasSubGraphExpanded=z.isSubGraphExpanded,Q1(z,y,x,E)),z instanceof qn)z.Bd(y),x.Aj(z,E);else if(z instanceof kn)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!1}rr.prototype.expandSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();$1(this,y,a,this),a.Ue=!1}};function $1(a,y,x,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!0),z instanceof rr&&z.wasSubGraphExpanded&&(z.wasSubGraphExpanded=!1,$1(z,y,x,E)),z instanceof qn)z.Bd(y),x.Cj(z,E);else if(z instanceof kn)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!0}rr.prototype.move=function(a,y){y===void 0&&(y=!1);var x=y?this.location:this.position,E=x.x;x=x.y;var b=a.x,z=a.y;if(!(E===b||isNaN(E)&&isNaN(b))||!(x===z||isNaN(x)&&isNaN(z))){for(E=b-(isNaN(E)?0:E),x=z-(isNaN(x)?0:x),z=At.alloc(),qn.prototype.move.call(this,a,y),a=new gn,y=this.Rj().iterator;y.next();)b=y.value,b instanceof kn&&(b.suspendsRouting&&a.add(b),b.fd||b.fromNode!==this&&b.toNode!==this)&&(b.suspendsRouting=!0);for(y.reset();y.next();)if(b=y.value,!(b.ph()||b instanceof qn&&b.isLinkLabel)){var tt=b.position,rt=b.location;tt.w()?(z.x=tt.x+E,z.y=tt.y+x,b.position=z):rt.w()&&(z.x=rt.x+E,z.y=rt.y+x,b.location=z)}for(y.reset();y.next();)b=y.value,b instanceof kn&&(b.suspendsRouting=a.contains(b),b.fd||b.fromNode!==this&&b.toNode!==this)&&(tt=b.position,z.x=tt.x+E,z.y=tt.y+x,z.w()?b.move(z):b.bb(),Uv(b)&&b.bb());At.free(z)}},Se.Object.defineProperties(rr.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&&Gt("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&&(Ih(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&&(Ih(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&&(Ih(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&&(Ih(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)}}}),rr.prototype.expandSubGraph=rr.prototype.expandSubGraph,rr.prototype.collapseSubGraph=rr.prototype.collapseSubGraph,rr.prototype.findSubGraphParts=rr.prototype.Rj,rr.prototype.findContainingGroupChain=rr.prototype.hz,rr.prototype.findExternalNodesConnected=rr.prototype.iz,rr.prototype.findExternalLinksConnected=rr.prototype.Lu,rr.prototype.ensureBounds=rr.prototype.Va,rr.className="Group";function Ps(a){fe.call(this),this.yb=ca,this.ko=new Te(NaN,NaN,NaN,NaN),a&&Object.assign(this,a)}Le(Ps,fe),Ps.prototype.cloneProtected=function(a){fe.prototype.cloneProtected.call(this,a),a.yb=this.yb.J(),a.ko=this.ko.copy()},Ps.prototype.gh=function(a){if(this.background===null&&this.areaBackground===null)return!1;var y=this.naturalBounds;return Zr(0,0,y.width,y.height,a.x,a.y)},Ps.prototype.Wl=function(){var a=this.part;if(a!==null&&(a instanceof rr||a instanceof Qr)||Gt("Placeholder is not inside a Group or Adornment."),a instanceof rr){var y=this.computeBorder(this.ko),x=this.minSize,E=this.dc;for(ao(E,(isFinite(x.width)?Math.max(x.width,y.width):y.width)||0,(isFinite(x.height)?Math.max(x.height,y.height):y.height)||0),this.Ge(0,0,E.width,E.height),E=a.memberParts,x=!1;E.next();)if(E.value.isVisible()){x=!0;break}E=a.diagram,!x||E===null||E.animationManager.Xu(a)||isNaN(y.x)||isNaN(y.y)||(x=At.alloc(),x.xi(y,a.locationSpot),x.D(a.location)||(a.location=x),At.free(x))}else{y=this.dc,x=this.yb,E=x.left+x.right;var b=x.top+x.bottom,z=a.adornedObject;a.angle=z.li();var tt=0;z instanceof fr&&(tt=z.strokeWidth);var rt=z.Df(),ot=z.naturalBounds,lt=(ot.width+tt)*rt;tt=(ot.height+tt)*rt,a.type!==Pn.Link&&(rt=z.ga(a.category==="Selection"?jr:a.locationSpot,At.alloc()),a.location=rt,At.free(rt)),isNaN(lt)||isNaN(tt)?(a=z.ga(jr,At.alloc()),lt=Te.allocAt(a.x,a.y,0,0),lt.Ye(z.ga(so,a)),lt.Ye(z.ga(mo,a)),lt.Ye(z.ga(da,a)),ao(y,lt.width+E||0,lt.height+b||0),this.Ge(-x.left,-x.top,y.width,y.height),At.free(a),Te.free(lt)):(ao(y,lt+E||0,tt+b||0),this.Ge(-x.left,-x.top,y.width,y.height))}},Ps.prototype.eh=function(a,y,x,E){this.actualBounds.h(a,y,x,E)},Ps.prototype.computeBorder=function(a){var y=this.part,x=y.diagram,E=x===null||!x.animationManager.isAnimating;if(x!==null&&y instanceof rr&&!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=Te.alloc(),b=this.computeMemberBounds(x);var z=this.yb;return y instanceof rr&&!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)),Te.free(x),E&&y instanceof rr&&y.computesBoundsIncludingLocation&&y.location.w()&&a.Ye(y.location),a},Ps.prototype.computeMemberBounds=function(a){if(!(this.part instanceof rr))return a.h(0,0,0,0),a;for(var y=this.part,x=1/0,E=1/0,b=-1/0,z=-1/0,tt=y.memberParts;tt.next();){var rt=tt.value;if(rt.isVisible()){if(rt instanceof kn&&(!y.computesBoundsIncludingLinks||ul(rt)||rt.fromNode===y||rt.toNode===y))continue;rt=rt.actualBounds,rt.left<x&&(x=rt.left),rt.top<E&&(E=rt.top),rt.right>b&&(b=rt.right),rt.bottom>z&&(z=rt.bottom)}}return isFinite(x)&&isFinite(E)?a.h(x,E,b-x,z-E):(y=y.location,a.h(y.x,y.y,0,0)),a},Se.Object.defineProperties(Ps.prototype,{padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new or(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.g("padding",y,a),this.v())}}}),Ps.className="Placeholder";function kn(a){Ai.call(this,Pn.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=ws,this.Om=0,this.Qm=ws,this.Rm=NaN,this.qj=Jv,this.po=.5,this.wd=null,this.Nb=new cn().freeze(),this.Tg=this.Mg=null,this.ml=new Te,this.ua=new ce,this.u=this.o=this.Sf=this.Wf=null,this.su=new At,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],a&&Object.assign(this,a)}Le(kn,Ai),kn.prototype.cloneProtected=function(a){Ai.prototype.cloneProtected.call(this,a),a.Qa=this.Qa&-113,a.ff=this.ff,a.gn=this.gn,a.vf=this.vf,a.uo=this.uo,a.qk=this.qk,a.Om=this.Om,a.Qm=this.Qm,a.Rm=this.Rm,a.qj=this.qj,a.po=this.po,this.ba!==null&&(a.ba=this.ba.copy())},wt=kn.prototype,wt.Af=function(a){Ai.prototype.Af.call(this,a),this.ff=a.ff,this.vf=a.vf,a.Mg=null,a.bb(),a.Sf=this.Sf;var y=a.fromPort;y!==null&&$s(y),a=a.toPort,a!==null&&$s(a)},wt.qb=function(a){a.classType===kn?(a.value&2)===2?this.routing=a:a===dl||a===Rh||a===Hf?this.curve=a:a===ap||a===Qm||a===$m?this.adjusting=a:a!==Jv&&a!==ws&&Gt("Unknown Link enum value for a Link property: "+a):Ai.prototype.qb.call(this,a)},wt.Xc=function(){this.ba===null&&(this.ba=new Kg)},wt.si=function(){var a=this.fromNode;if(a!==null){var y=a.findVisibleNode();if(y!==null&&(a=y),Ss(a)||cd(a))return!1}return a=this.toNode,!(a!==null&&(y=a.findVisibleNode(),y!==null&&(a=y),Ss(a)||cd(a)))},wt.zv=function(){return!1},wt.Av=function(){},wt.Zc=function(){return!1},kn.prototype.computeAngle=function(a,y,x){return kn.computeAngle(y,x)},kn.computeAngle=function(a,y){switch(a){default:case ws:a=0;break;case sp:a=y;break;case lp:a=y+90;break;case up:a=y-90;break;case Qv:a=y+180;break;case qm:a=_t.bp(y),90<a&&270>a&&(a-=180);break;case hp:a=_t.bp(y+90),90<a&&270>a&&(a-=180);break;case dp:a=_t.bp(y-90),90<a&&270>a&&(a-=180);break;case t0:if(a=_t.bp(y),45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return _t.bp(a)};function Zf(a){var y=a.fromNode,x=a.toNode,E=null;if(y!==null?E=x!==null?y.px(x):y.containingGroup:x!==null?E=x.containingGroup:E=null,y=E,x=a.Ah,x!==y){x!==null&&Vv(x,a),a.Ah=y,y!==null&&Wv(y,a);var b=a.containingGroupChanged;if(b!==null){var z=!0,tt=a.diagram;tt!==null&&(z=tt.aa,tt.aa=!0),b(a,x,y),tt!==null&&(tt.aa=z)}!a.fd||a.Lw!==x&&a.Mw!==x||a.bb()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=E}wt=kn.prototype,wt.oh=function(){var a=this.containingGroup;a!==null&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&Ai.prototype.oh.call(this)},wt.To=function(a){var y=this.fromNode;return a===y?this.toNode:y},wt.Cz=function(a){var y=this.fromPort;return a===y?this.toPort:y};function q1(a,y){a.wd===null&&(a.wd=new gn),a.wd.add(y),a.v()}wt.Vo=function(a){if(Ai.prototype.Vo.call(this,a),nc(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,Hm(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||Hm(x,this,E)}rp(this)}},wt.Wo=function(a){if(Ai.prototype.Wo.call(this,a),nc(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,Wm(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||Wm(x,this,E)}op(this)}},wt.Lj=function(){if(this.fd=!0,this.wd!==null){var a=this.diagram;if(a!==null)for(var y=this.wd.copy().iterator;y.next();)a.remove(y.value)}this.data!==null&&(a=this.diagram,a!==null&&a.partManager.removeDataForLink(this))},kn.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)}},kn.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?Ai.prototype.move.call(this,a,!1):(a=At.allocAt(x.x+E,x.y+b),Ai.prototype.move.call(this,a,!1),At.free(a)),_h(this,E,b),a=this.labelNodes;a.next();)y=a.value,x=y.position,y.moveTo(x.x+E,x.y+b)},kn.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},kn.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},kn.prototype.computeMidPoint=function(a){var y=this.pointsCount;if(y===0)return a.assign(ui),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()===dl))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()===dl){if(y===3){x=this.i(0),E=this.i(1);var b=this.i(2);return _t.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),_t.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},kn.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()===dl))return this.ua.wx(.5);if(this.computeCurve()===dl&&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),_t.My(a.x,a.y,y.x,y.y,E.x,E.y,x.x,x.y)}if(0<x&&x+1<a)return this.i(x-1).ab(this.i(x+1))}y=this.flattenedLengths,E=this.flattenedTotalLength;var b=0;x=0;for(var z;b<E/2&&x<a&&(z=y[x],!(b+z>E/2));)b+=z,x++;if(y=this.i(x),E=this.i(x+1),1>Math.abs(y.x-E.x)&&1>Math.abs(y.y-E.y)){if(0<x&&x+2<a)return this.i(x-1).ab(this.i(x+2))}else{if(1>Math.abs(y.x-E.x))return y.y>E.y?270:90;if(1>Math.abs(y.y-E.y))return y.x>E.x?180:0}return y.ab(E)},wt=kn.prototype,wt.i=function(a){return this.Nb.s[a]},wt.dd=function(a,y){this.Nb.cd(a,y)},wt.L=function(a,y,x){this.Nb.cd(a,new At(y,x))},wt.Kz=function(a,y){this.Nb.Gb(a,y)},wt.m=function(a,y,x){this.Nb.Gb(a,new At(y,x))},wt.ne=function(a){this.Nb.add(a)},wt.yf=function(a,y){this.Nb.add(new At(a,y))},wt.pv=function(a){this.Nb.mb(a)},wt.Fj=function(){this.Nb.clear()};function _h(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 cn,z=a.Nb.iterator;z.next();){var tt=z.value;b.add(new At(tt.x+y,tt.y+x).freeze())}b.freeze(),z=a.Nb,a.Nb=b,tt=a.diagram,isNaN(y)||isNaN(x)||tt!==null&&tt.animationManager.zb?a.v():(a.ke.h(a.ke.x+y,a.ke.y+x),a.pa.h(a.pa.x+y,a.pa.y+x),ys(a)),E?Km(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint=a.i(a.pointsCount-1))),tt!==null&&tt.animationManager.zb&&ff(tt.animationManager,a,b),a.g("points",z,b)}}wt.uh=function(){this.Mg===null&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},wt.zf=function(){if(this.Mg!==null){for(var a=this.Mg,y=this.Nb,x=1/0,E=1/0,b=a.s,z=b.length,tt=0;tt<z;tt++){var rt=b[tt];x=Math.min(rt.x,x),E=Math.min(rt.y,E)}rt=tt=1/0;for(var ot=y.s,lt=ot.length,ut=0;ut<lt;ut++){var ft=ot[ut];tt=Math.min(ft.x,tt),rt=Math.min(ft.y,rt),ft.freeze()}if(y.freeze(),lt===z){for(z=0;z<lt;z++)if(ut=b[z],ft=ot[z],ut.x-x!==ft.x-tt||ut.y-E!==ft.y-rt){this.qc();break}}else this.qc();this.Mg=null,x=this.diagram,x!==null&&x.animationManager.zb&&ff(x.animationManager,this,y),Km(this),this.g("points",a,y)}},wt.rv=function(){this.Mg!==null&&(this.Nb=this.Mg,this.Mg=null)};function Km(a){a.Nb.count===0?a.fd=!1:(a.fd=!0,a.cq=null,a.vt=NaN,a.defaultFromPoint=a.i(0),a.defaultToPoint=a.i(a.pointsCount-1),Jm(a,!1))}wt.bb=function(){if(!this.suspendsRouting){var a=this.diagram;if(a){if(a.As.contains(this)||a.undoManager.isUndoingRedoing||(a=a.animationManager,a.isTicking&&!a.isAnimating))return;this.Tg===null||a.isTicking||(this.Tg=null)}a=this.path,a!==null&&(this.fd=!1,this.v(),a.v())}},wt.vg=function(){if(!this.fd&&!this.computingPoints){var a=!0;try{this.computingPoints=!0,this.uh(),a=this.computePoints()}catch(y){this.computingPoints=!1,this.rv()}finally{this.computingPoints=!1,a?this.zf():this.rv()}}},kn.prototype.computePoints=function(){if(this.diagram===null)return!1;var a=this.fromNode,y=null;if(a===null?(zc||(zc=new qn,zc.desiredSize=Ni,zc.Va()),this.defaultFromPoint&&(zc.location=this.defaultFromPoint,zc.Va(),y=a=zc)):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?(Zc||(Zc=new qn,Zc.desiredSize=Ni,Zc.Va()),this.defaultToPoint&&(Zc.location=this.defaultToPoint,Zc.Va(),b=E=Zc)):b=this.toPort,b===null||E.isVisible()||(x=E.findVisibleNode(),x!==null&&x!==E?(E=x,b=x.port):E=x),this.Mw=E,E===null||!E.location.w())return!1;for(;!(b===null||b.actualBounds.w()&&b.Ed());)b=b.panel;if(b===null)return!1;var z=this.pointsCount,tt=this.computeSpot(!0,y);x=this.computeSpot(!1,b);var rt=Gf(tt),ot=Gf(x),lt=y===b&&y!==null,ut=this.isOrthogonal,ft=this.curve===dl;this.Wf=lt&&!ut?ft=!0:!1;var yt=this.computeAdjusting()===ws||lt;if(!ut&&!lt&&rt&&ot){if(rt=!1,!yt&&3<=z&&(yt=this.getLinkPoint(a,y,tt,!0,!1,E,b),ot=this.getLinkPoint(E,b,x,!1,!1,a,y),rt=this.adjustPoints(0,yt,z-1,ot))&&(yt=this.getLinkPoint(a,y,tt,!0,!1,E,b),ot=this.getLinkPoint(E,b,x,!1,!1,a,y),this.adjustPoints(0,yt,z-1,ot)),!rt)if(this.Fj(),ft){z=this.getLinkPoint(a,y,tt,!0,!1,E,b),yt=this.getLinkPoint(E,b,x,!1,!1,a,y),rt=yt.x-z.x,ot=yt.y-z.y,lt=this.computeCurviness(),ft=ut=0;var xt=z.x+rt/3,Ct=z.y+ot/3,bt=xt,Vt=Ct;_t.B(ot,0)?Vt=0<rt?Vt-lt:Vt+lt:(ut=-rt/ot,ft=Math.sqrt(lt*lt/(ut*ut+1)),0>lt&&(ft=-ft),bt=(0>ot?-1:1)*ft+xt,Vt=ut*(bt-xt)+Ct),xt=z.x+2*rt/3,Ct=z.y+2*ot/3;var zt=xt,$t=Ct;_t.B(ot,0)?$t=0<rt?$t-lt:$t+lt:(zt=(0>ot?-1:1)*ft+xt,$t=ut*(zt-xt)+Ct),this.Fj(),this.ne(z),this.yf(bt,Vt),this.yf(zt,$t),this.ne(yt),this.dd(0,this.getLinkPoint(a,y,tt,!0,!1,E,b)),this.dd(3,this.getLinkPoint(E,b,x,!1,!1,a,y))}else z=E,yt=b,E=this.getLinkPoint(a,y,tt,!0,!1,z,yt),b=this.getLinkPoint(z,yt,x,!1,!1,a,y),this.hasCurviness()?(yt=b.x-E.x,x=b.y-E.y,tt=this.computeCurviness(),a=E.x+yt/2,y=E.y+x/2,z=a,rt=y,_t.B(x,0)?rt=0<yt?rt-tt:rt+tt:(yt=-yt/x,z=Math.sqrt(tt*tt/(yt*yt+1)),0>tt&&(z=-z),z=(0>x?-1:1)*z+a,rt=yt*(z-a)+y),this.ne(E),this.yf(z,rt),this.ne(b)):(this.ne(E),this.ne(b),rt=Te.alloc(),y.mi(rt),ot=rt.ca(b),yt.mi(rt),lt=rt.ca(E),(ot||lt)&&(tt=y.ga(Ym(tt),new At),this.dd(0,this.getLinkPointFromPoint(a,y,tt,b,!0,tt)),x=yt.ga(Ym(x),new At),this.dd(1,this.getLinkPointFromPoint(z,yt,x,E,!1,x))),Te.free(rt))}else{ft=this.isAvoiding,yt&&(ut&&ft||lt)&&this.Fj();var ie=lt?this.computeCurviness():0;ft=this.getLinkPoint(a,y,tt,!0,ut,E,b),xt=bt=Ct=0,(ut||!rt||lt)&&(Vt=this.computeEndSegmentLength(a,y,tt,!0),xt=this.getLinkDirection(a,y,ft,tt,!0,ut,E,b),lt&&(rt||tt.D(x)||!ut&&tt.x+x.x===1&&tt.y+x.y===1)&&(xt-=ut?90:30,0>ie&&(xt-=180)),0>xt?xt+=360:360<=xt&&(xt-=360),lt&&(Vt+=Math.abs(ie)*(ut?1:2)),xt===0?Ct=Vt:xt===90?bt=Vt:xt===180?Ct=-Vt:xt===270?bt=-Vt:(Ct=Vt*Math.cos(xt*Math.PI/180),bt=Vt*Math.sin(xt*Math.PI/180)),tt.Mc()&&lt&&(Vt=y.ga(dr,At.alloc()),zt=At.allocAt(Vt.x+1e3*Ct,Vt.y+1e3*bt),this.getLinkPointFromPoint(a,y,Vt,zt,!0,ft),At.free(Vt),At.free(zt))),Vt=this.getLinkPoint(E,b,x,!1,ut,a,y);var oe=$t=zt=0;if(ut||!ot||lt){var de=this.computeEndSegmentLength(E,b,x,!1);oe=this.getLinkDirection(E,b,Vt,x,!1,ut,a,y),lt&&(ot||tt.D(x)||!ut&&tt.x+x.x===1&&tt.y+x.y===1)&&(oe+=ut?0:30,0>ie&&(oe+=180)),0>oe?oe+=360:360<=oe&&(oe-=360),lt&&(de+=Math.abs(ie)*(ut?1:2)),oe===0?zt=de:oe===90?$t=de:oe===180?zt=-de:oe===270?$t=-de:(zt=de*Math.cos(oe*Math.PI/180),$t=de*Math.sin(oe*Math.PI/180)),x.Mc()&&lt&&(x=b.ga(dr,At.alloc()),tt=At.allocAt(x.x+1e3*zt,x.y+1e3*$t),this.getLinkPointFromPoint(E,b,x,tt,!1,Vt),At.free(x),At.free(tt))}x=ft,(ut||!rt||lt)&&(x=new At(ft.x+Ct,ft.y+bt)),tt=Vt,(ut||!ot||lt)&&(tt=new At(Vt.x+zt,Vt.y+$t)),!yt&&!ut&&rt&&3<z&&this.adjustPoints(0,ft,z-2,tt)?this.dd(z-1,Vt):!yt&&!ut&&ot&&3<z&&this.adjustPoints(1,x,z-1,Vt)?this.dd(0,ft):!yt&&(ut?6<=z:4<z)&&this.adjustPoints(1,x,z-2,tt)?(this.dd(0,ft),this.dd(z-1,Vt)):(this.Fj(),this.ne(ft),(ut||!rt||lt)&&this.ne(x),ut&&this.addOrthoPoints(x,xt,tt,oe,a,E),(ut||!ot||lt)&&this.ne(tt),this.ne(Vt))}return!0};function Kv(a,y){return Math.abs(y.x-a.x)>Math.abs(y.y-a.y)?(y.x>=a.x?y.x=a.x+9e9:y.x=a.x-9e9,y.y=a.y):(y.y>=a.y?y.y=a.y+9e9:y.y=a.y-9e9,y.x=a.x),y}kn.prototype.getLinkPointFromPoint=function(a,y,x,E,b,z){if(z===void 0&&(z=new At),a===null||y===null)return z.assign(x),z;if(a.isVisible()||(b=a.findVisibleNode(),b!==null&&b!==a&&(y=b.port)),a=null,b=y.panel,b===null||b.se()||(b=b.panel),b===null){b=E.x,E=E.y;var tt=x.x;x=x.y}else{a=b.oe,b=1/(a.m11*a.m22-a.m12*a.m21),tt=a.m22*b;var rt=-a.m12*b,ot=-a.m21*b,lt=a.m11*b,ut=b*(a.m21*a.dy-a.m22*a.dx),ft=b*(a.m12*a.dx-a.m11*a.dy);b=E.x*tt+E.y*ot+ut,E=E.x*rt+E.y*lt+ft,tt=x.x*tt+x.y*ot+ut,x=x.x*rt+x.y*lt+ft}return y.Sj(b,E,tt,x,z),a!==null&&z.transform(a),z};function Um(a,y){var x=y.Zn;return x===null&&(x=new Gc,x.port=y,x.node=y.part,y.Zn=x),sS(x,a)}kn.prototype.getLinkPoint=function(a,y,x,E,b,z,tt,rt){if(rt===void 0&&(rt=new At),x.sb()&&!Gf(x))return y.ga(x,rt),rt;if(x.$c()){var ot=Um(this,y);if(ot!==null){if(rt.assign(ot.Zo),b&&this.routing===eS){var lt=Um(this,tt);if(lt!==null&&ot.Gl<lt.Gl){ot=At.alloc(),lt=At.alloc();var ut=new Te(y.ga(jr,ot),y.ga(so,lt)),ft=this.computeSpot(!E,tt);a=this.getLinkPoint(z,tt,ft,!E,b,a,y,lt),(x.Hf(ns)||x.Hf(Jo))&&a.y>=ut.y&&a.y<=ut.y+ut.height?rt.y=a.y:(x.Hf(Sa)||x.Hf(ps))&&a.x>=ut.x&&a.x<=ut.x+ut.width&&(rt.x=a.x),At.free(ot),At.free(lt)}}return rt}}return x=y.ga(Ym(x),At.alloc()),this.pointsCount>(b?6:2)?(tt=E?this.i(1):this.i(this.pointsCount-2),b&&(tt=Kv(x,tt.copy()))):(ot=this.computeSpot(!E,tt),z=At.alloc(),tt=tt.ga(Ym(ot),z),b&&(tt=Kv(x,tt)),At.free(z)),this.getLinkPointFromPoint(a,y,x,tt,E,rt),At.free(x),rt},kn.prototype.getLinkDirection=function(a,y,x,E,b,z,tt,rt){t:if(E.sb())var ot=E.x>E.y?E.x>1-E.y?0:E.x<1-E.y?270:315:E.x<E.y?E.x>1-E.y?90:E.x<1-E.y?180:135:.5>E.x?225:.5<E.x?45:0;else{if(E.$c()&&(ot=Um(this,y),ot!==null))switch(ot.Nc){case 1:ot=270;break t;case 2:ot=180;break t;default:case 4:ot=0;break t;case 8:ot=90;break t}ot=y.ga(dr,At.alloc()),this.pointsCount>(z?6:2)?(rt=b?this.i(1):this.i(this.pointsCount-2),rt=z?Kv(ot,rt.copy()):x):(x=At.alloc(),rt=rt.ga(dr,x),At.free(x)),x=Math.abs(rt.x-ot.x)>Math.abs(rt.y-ot.y)?rt.x>=ot.x?0:180:rt.y>=ot.y?90:270,At.free(ot),ot=x}return E.Mc()&&tt.Td(a)&&(ot+=180,360<=ot&&(ot-=360)),Gf(E)||(a=y.li(),a===0)||(45<=a&&135>a?ot+=90:135<=a&&225>a?ot+=180:225<=a&&315>a&&(ot+=270),360<=ot&&(ot-=360)),ot},kn.prototype.computeEndSegmentLength=function(a,y,x,E){return y!==null&&x.$c()&&(a=Um(this,y),a!==null)?a.Ju:(a=E?this.fromEndSegmentLength:this.toEndSegmentLength,y!==null&&isNaN(a)&&(a=E?y.fromEndSegmentLength:y.toEndSegmentLength),isNaN(a)&&(a=10),a)},kn.prototype.computeSpot=function(a,y){return y===void 0&&(y=null),a?(a=y||this.fromPort,a===null?a=dr:(y=this.fromSpot,y.Xb()&&(y=a.fromSpot),a=y===xa?lr:y)):(a=y||this.toPort,a===null?a=dr:(y=this.toSpot,y.Xb()&&(y=a.toSpot),a=y===xa?lr:y)),a};function Gf(a){return a===lr||a.x===.5&&a.y===.5}function Ym(a){return a.x===.5&&a.y===.5?a:dr}kn.prototype.computeOtherPoint=function(a,y){return this.computeAdjusting()!==ws&&4<this.pointsCount?this.computeMidPoint(new At):(a=y.Zn,a=a!==null?sS(a,this):null,a!==null?a.Zo:y.ga(dr))},kn.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},kn.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=ae.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&ae.free(tt),!0;if(this.Yc(a,tt)){var rt=!1;if(!this.isAtomic)for(var ot=this.O.s,lt=ot.length;lt--;){var ut=ot[lt];if(ut.visible||ut===this.locationObject){var ft=ut.actualBounds,yt=this.naturalBounds;if(!(ft.x>yt.width||ft.y>yt.height||0>ft.x+ft.width||0>ft.y+ft.height)){if(ft=ae.alloc(),ft.set(tt),ut instanceof Pn)rt=ut.Cf(a,y,x,E,b,ft);else if(this.path===ut){if(ut instanceof fr)if(rt=a,yt=E,ut.pickable===!1)rt=!1;else if(ft.multiply(ut.transform),yt)t:{var xt=rt,Ct=ft;if(ut.fh(xt,Ct))rt=!0;else{if(Ct===void 0&&(Ct=ut.transform,xt.Re(ut.actualBounds))){rt=!0;break t}rt=xt.left,yt=xt.right;var bt=xt.top;xt=xt.bottom;var Vt=At.alloc(),zt=At.alloc(),$t=At.alloc(),ie=ae.alloc();ie.set(Ct),ie.bv(ut.transform),ie.Vj(),zt.x=yt,zt.y=bt,zt.transform(ie),Vt.x=rt,Vt.y=bt,Vt.transform(ie),Ct=!1,tc(ut,Vt,zt,$t)?Ct=!0:(Vt.x=yt,Vt.y=xt,Vt.transform(ie),tc(ut,Vt,zt,$t)?Ct=!0:(zt.x=rt,zt.y=xt,zt.transform(ie),tc(ut,Vt,zt,$t)?Ct=!0:(Vt.x=rt,Vt.y=bt,Vt.transform(ie),tc(ut,Vt,zt,$t)&&(Ct=!0)))),ae.free(ie),At.free(Vt),At.free(zt),At.free($t),rt=Ct}}else rt=ut.fh(rt,ft)}else rt=ka(ut,a,E,ft);rt&&(yt=ut,y!==null&&(yt=y(ut)),yt&&(x===null||x(yt))&&b.add(yt)),ae.free(ft)}}}return z===void 0&&ae.free(tt),rt||this.background!==null||this.areaBackground!==null}return z===void 0&&ae.free(tt),!1},kn.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?dl:this.curve},kn.prototype.computeCorner=function(){if(this.curve===dl)return 0;var a=this.corner;return(isNaN(a)||0>a)&&(a=10),a},kn.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},kn.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a=iS;a=Math.max(a,this.computeThickness());var y=this.fromPort,x=this.toPort;if(y!==null&&x!==null){var E=this.findMidLabel();if(E!==null){var b=E.naturalBounds,z=E.margin,tt=isNaN(b.width)?30:b.width*E.scale+z.left+z.right;b=isNaN(b.height)?14:b.height*E.scale+z.top+z.bottom,E=E.segmentOrientation,E===sp||E===qm||E===Qv?a=Math.max(a,b):E===up||E===dp||E===lp||E===hp?a=Math.max(a,tt):(y=y.ga(dr).ab(x.ga(dr))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(y)*tt)+Math.abs(Math.cos(y)*b)+1)),this.curve===dl&&(a*=1.333)}}return a},kn.prototype.arrangeBundledLinks=function(a,y){if(y)for(y=0;y<a.length;y++){var x=a[y];x.computeAdjusting()===ws&&x.bb()}},kn.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=nS;var y=this.Sf;if(y!==null){for(var x=Jn(),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),li(x)}}return a},kn.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return a!==null?Math.max(a.strokeWidth,1):1},kn.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},kn.prototype.adjustPoints=function(a,y,x,E){var b=this.computeAdjusting();if(this.isOrthogonal){if(b===Qm)return!1;b===$m&&(b=ap)}switch(b){case Qm:var z=this.i(a),tt=this.i(x);if(!z.Xa(y)||!tt.Xa(E)){b=z.x,z=z.y;var rt=tt.x-b,ot=tt.y-z,lt=Math.sqrt(rt*rt+ot*ot);if(!_t.$(lt,0)){if(_t.$(rt,0))var ut=0>ot?-Math.PI/2:Math.PI/2;else ut=Math.atan(ot/Math.abs(rt)),0>rt&&(ut=Math.PI-ut);tt=y.x;var ft=y.y;rt=E.x-tt;var yt=E.y-ft;for(ot=Math.sqrt(rt*rt+yt*yt),_t.$(rt,0)?yt=0>yt?-Math.PI/2:Math.PI/2:(yt=Math.atan(yt/Math.abs(rt)),0>rt&&(yt=Math.PI-yt)),lt=ot/lt,ut=yt-ut,this.dd(a,y),a+=1;a<x;a++)y=this.i(a),rt=y.x-b,ot=y.y-z,y=Math.sqrt(rt*rt+ot*ot),_t.$(y,0)||(_t.$(rt,0)?ot=0>ot?-Math.PI/2:Math.PI/2:(ot=Math.atan(ot/Math.abs(rt)),0>rt&&(ot=Math.PI-ot)),rt=ot+ut,y*=lt,this.L(a,tt+y*Math.cos(rt),ft+y*Math.sin(rt)));this.dd(x,E)}}return!0;case $m:if(z=this.i(a),ft=this.i(x),!z.Xa(y)||!ft.Xa(E)){b=z.x,z=z.y,tt=ft.x,ft=ft.y,lt=(tt-b)*(tt-b)+(ft-z)*(ft-z),rt=y.x,ut=y.y,ot=E.x,yt=E.y;var xt=1;if(ot-rt!==0){var Ct=(yt-ut)/(ot-rt);xt=Math.sqrt(1+1/(Ct*Ct))}else Ct=9e9;for(this.dd(a,y),a+=1;a<x;a++){y=this.i(a);var bt=y.x,Vt=y.y,zt=.5;lt!==0&&(zt=((b-bt)*(b-tt)+(z-Vt)*(z-ft))/lt);var $t=b+zt*(tt-b),ie=z+zt*(ft-z);y=Math.sqrt((bt-$t)*(bt-$t)+(Vt-ie)*(Vt-ie)),Vt<Ct*(bt-$t)+ie&&(y=-y),0<Ct&&(y=-y),bt=rt+zt*(ot-rt),zt=ut+zt*(yt-ut),Ct!==0?(y=bt+y/xt,this.L(a,y,zt-(y-bt)/Ct)):this.L(a,bt,zt+y)}this.dd(x,E)}return!0;case ap:t:{if(this.isOrthogonal&&(b=this.i(a),z=this.i(a+1),tt=this.i(a+2),rt=z.x,ut=z.y,ft=rt,lt=ut,_t.B(b.y,z.y)?_t.B(z.x,tt.x)?ut=y.y:_t.B(z.y,tt.y)&&(rt=y.x):_t.B(b.x,z.x)&&(_t.B(z.y,tt.y)?rt=y.x:_t.B(z.x,tt.x)&&(ut=y.y)),this.L(a+1,rt,ut),b=this.i(x),z=this.i(x-1),tt=this.i(x-2),rt=z.x,ut=z.y,ot=rt,yt=ut,_t.B(b.y,z.y)?_t.B(z.x,tt.x)?ut=E.y:_t.B(z.y,tt.y)&&(rt=E.x):_t.B(b.x,z.x)&&(_t.B(z.y,tt.y)?rt=E.x:_t.B(z.x,tt.x)&&(ut=E.y)),this.L(x-1,rt,ut),Uv(this))){this.L(a+1,ft,lt),this.L(x-1,ot,yt),x=!1;break t}this.dd(a,y),this.dd(x,E),x=!0}return x;default:return!1}},kn.prototype.addOrthoPoints=function(a,y,x,E,b,z){0>y?y+=360:360<=y&&(y-=360),0>E?E+=360:360<=E&&(E-=360);var tt=E;y=315<=y||45>y?0:45<=y&&135>y?90:135<=y&&225>y?180:270,E=315<=E||45>E?0:45<=E&&135>E?90:135<=E&&225>E?180:270;var rt=b.actualBounds.copy(),ot=z.actualBounds.copy();if(rt.w()&&ot.w()){rt.Bc(cp,cp),ot.Bc(cp,cp),rt.Ye(a),ot.Ye(x);var lt=At.alloc(),ut=At.alloc();y===0?x.x>a.x||E===270&&x.y<a.y&&ot.right>a.x||E===90&&x.y>a.y&&ot.right>a.x?(lt.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),E===180?(lt.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),ut.x=lt.x,ut.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(lt.x=a.x<ot.left?this.computeMidOrthoPosition(a.x,a.y,ot.left,x.y,!1):a.x<ot.right&&(E===270&&a.y<ot.top||E===90&&a.y>ot.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):ot.right,ut.x=lt.x,ut.y=x.y):E===0&&a.x<ot.left&&a.y>ot.top&&a.y<ot.bottom&&(lt.x=a.x,lt.y=a.y<x.y?Math.min(x.y,ot.top):Math.max(x.y,ot.bottom),ut.y=lt.y)):(lt.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),(E===180||E===90&&x.y<rt.top||E===270&&x.y>rt.bottom)&&(E===180&&(ot.ca(a)||rt.ca(x))?lt.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===180||E===90)?lt.y=this.computeMidOrthoPosition(a.x,rt.top,x.x,Math.max(x.y,ot.bottom),!0):x.y>a.y&&(E===180||E===270)&&(lt.y=this.computeMidOrthoPosition(a.x,rt.bottom,x.x,Math.min(x.y,ot.top),!0)),ut.x=x.x,ut.y=lt.y),lt.y>rt.top&&lt.y<rt.bottom&&(x.x>=rt.left&&x.x<=a.x||a.x<=ot.right&&a.x>=x.x?(E===90||E===270)&&(lt.h(Math.max((a.x+x.x)/2,a.x),a.y),ut.h(lt.x,x.y)):(lt.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===0?rt.top:Math.min(rt.top,ot.top)):Math.max(x.y,E===0?rt.bottom:Math.max(rt.bottom,ot.bottom)),ut.x=x.x,ut.y=lt.y))):y===180?x.x<a.x||E===270&&x.y<a.y&&ot.left<a.x||E===90&&x.y>a.y&&ot.left<a.x?(lt.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),E===0?(lt.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),ut.x=lt.x,ut.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(lt.x=a.x>ot.right?this.computeMidOrthoPosition(a.x,a.y,ot.right,x.y,!1):a.x>ot.left&&(E===270&&a.y<ot.top||E===90&&a.y>ot.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):ot.left,ut.x=lt.x,ut.y=x.y):E===180&&a.x>ot.right&&a.y>ot.top&&a.y<ot.bottom&&(lt.x=a.x,lt.y=a.y<x.y?Math.min(x.y,ot.top):Math.max(x.y,ot.bottom),ut.y=lt.y)):(lt.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),(E===0||E===90&&x.y<rt.top||E===270&&x.y>rt.bottom)&&(E===0&&(ot.ca(a)||rt.ca(x))?lt.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===0||E===90)?lt.y=this.computeMidOrthoPosition(a.x,rt.top,x.x,Math.max(x.y,ot.bottom),!0):x.y>a.y&&(E===0||E===270)&&(lt.y=this.computeMidOrthoPosition(a.x,rt.bottom,x.x,Math.min(x.y,ot.top),!0)),ut.x=x.x,ut.y=lt.y),lt.y>rt.top&&lt.y<rt.bottom&&(x.x<=rt.right&&x.x>=a.x||a.x>=ot.left&&a.x<=x.x?(E===90||E===270)&&(lt.h(Math.min((a.x+x.x)/2,a.x),a.y),ut.h(lt.x,x.y)):(lt.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===180?rt.top:Math.min(rt.top,ot.top)):Math.max(x.y,E===180?rt.bottom:Math.max(rt.bottom,ot.bottom)),ut.x=x.x,ut.y=lt.y))):y===90?x.y>a.y||E===180&&x.x<a.x&&ot.bottom>a.y||E===0&&x.x>a.x&&ot.bottom>a.y?(lt.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),E===270?(lt.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),ut.x=x.x,ut.y=lt.y):E===180&&x.x<a.x||E===0&&x.x>a.x?(lt.y=a.y<ot.top?this.computeMidOrthoPosition(a.x,a.y,x.x,ot.top,!0):a.y<ot.bottom&&(E===180&&a.x<ot.left||E===0&&a.x>ot.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):ot.bottom,ut.x=x.x,ut.y=lt.y):E===90&&a.y<ot.top&&a.x>ot.left&&a.x<ot.right&&(lt.x=a.x<x.x?Math.min(x.x,ot.left):Math.max(x.x,ot.right),lt.y=a.y,ut.x=lt.x)):(lt.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),(E===270||E===0&&x.x<rt.left||E===180&&x.x>rt.right)&&(E===270&&(ot.ca(a)||rt.ca(x))?lt.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===270||E===0)?lt.x=this.computeMidOrthoPosition(rt.left,a.y,Math.max(x.x,ot.right),x.y,!1):x.x>a.x&&(E===270||E===180)&&(lt.x=this.computeMidOrthoPosition(rt.right,a.y,Math.min(x.x,ot.left),x.y,!1)),ut.x=lt.x,ut.y=x.y),lt.x>rt.left&&lt.x<rt.right&&(x.y>=rt.top&&x.y<=a.y||a.y<=ot.bottom&&a.y>=x.y?(E===0||E===180)&&(lt.h(a.x,Math.max((a.y+x.y)/2,a.y)),ut.h(x.x,lt.y)):(lt.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===90?rt.left:Math.min(rt.left,ot.left)):Math.max(x.x,E===90?rt.right:Math.max(rt.right,ot.right)),ut.x=lt.x,ut.y=x.y))):x.y<a.y||E===180&&x.x<a.x&&ot.top<a.y||E===0&&x.x>a.x&&ot.top<a.y?(lt.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),E===90?(lt.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),ut.x=x.x,ut.y=lt.y):E===180&&x.x<a.x||E===0&&x.x>=a.x?(lt.y=a.y>ot.bottom?this.computeMidOrthoPosition(a.x,a.y,x.x,ot.bottom,!0):a.y>ot.top&&(E===180&&a.x<ot.left||E===0&&a.x>ot.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):ot.top,ut.x=x.x,ut.y=lt.y):E===270&&a.y>ot.bottom&&a.x>ot.left&&a.x<ot.right&&(lt.x=a.x<x.x?Math.min(x.x,ot.left):Math.max(x.x,ot.right),lt.y=a.y,ut.x=lt.x)):(lt.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),(E===90||E===0&&x.x<rt.left||E===180&&x.x>rt.right)&&(E===90&&(ot.ca(a)||rt.ca(x))?lt.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===90||E===0)?lt.x=this.computeMidOrthoPosition(rt.left,a.y,Math.max(x.x,ot.right),x.y,!1):x.x>a.x&&(E===90||E===180)&&(lt.x=this.computeMidOrthoPosition(rt.right,a.y,Math.min(x.x,ot.left),x.y,!1)),ut.x=lt.x,ut.y=x.y),lt.x>rt.left&&lt.x<rt.right&&(x.y<=rt.bottom&&x.y>=a.y||a.y>=ot.top&&a.y<=x.y?(E===0||E===180)&&(lt.h(a.x,Math.min((a.y+x.y)/2,a.y)),ut.h(x.x,lt.y)):(lt.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===270?rt.left:Math.min(rt.left,ot.left)):Math.max(x.x,E===270?rt.right:Math.max(rt.right,ot.right)),ut.x=lt.x,ut.y=x.y)));var ft=x;if(this.isAvoiding){var yt=this.diagram;if(yt===null||b===z||this.layer.isTemporary||!wf(yt)||rt.ca(ft)&&!z.Td(b)||ot.ca(a)&&!b.Td(z))y=!1;else{var xt=Cf(yt,!0,this.containingGroup,null);if(this.segmentIndex!==17&&xt.Yj(Math.min(a.x,lt.x),Math.min(a.y,lt.y),Math.abs(a.x-lt.x),Math.abs(a.y-lt.y))&&xt.Yj(Math.min(lt.x,ut.x),Math.min(lt.y,ut.y),Math.abs(lt.x-ut.x),Math.abs(lt.y-ut.y))&&xt.Yj(Math.min(ut.x,ft.x),Math.min(ut.y,ft.y),Math.abs(ut.x-ft.x),Math.abs(ut.y-ft.y)))y=!1;else{b=a,z=ft;var Ct=x=null;if(yt.isVirtualized){yt=xt.bounds.copy(),yt.Bc(-xt.Ho,-xt.Go);var bt=At.alloc();Wf(xt,a.x,a.y)||(_t.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,a.x,a.y,lt.x,lt.y,bt)?(x=a=bt.copy(),y=bt.ab(lt)):_t.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,lt.x,lt.y,ut.x,ut.y,bt)?(x=a=bt.copy(),y=bt.ab(ut)):_t.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,ut.x,ut.y,ft.x,ft.y,bt)&&(x=a=bt.copy(),y=bt.ab(ft))),Wf(xt,ft.x,ft.y)||(_t.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,ft.x,ft.y,ut.x,ut.y,bt)?(Ct=ft=bt.copy(),E=ut.ab(bt)):_t.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,ut.x,ut.y,lt.x,lt.y,bt)?(Ct=ft=bt.copy(),E=lt.ab(bt)):_t.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,lt.x,lt.y,a.x,a.y,bt)&&(Ct=ft=bt.copy(),E=a.ab(bt))),At.free(bt)}rt=rt.copy().ed(ot),rt.Bc(xt.Ho*xt.Os,xt.Go*xt.Os),oS(xt,a,y,ft,E,rt,!0),ot=Yu(xt,ft.x,ft.y),!xt.abort&&ot>=Vf&&(rS(xt),rt.Bc(xt.Ho*xt.Hx,xt.Go*xt.Ix),oS(xt,a,y,ft,E,rt,!1),ot=Yu(xt,ft.x,ft.y)),!xt.abort&&ot<Vf&&Yu(xt,ft.x,ft.y)!==jh?(Yv(this,xt,ft.x,ft.y,E,!0,tt),rt=this.i(2),4>this.pointsCount?(y===0||y===180?(rt.x=a.x,rt.y=ft.y):(rt.x=ft.x,rt.y=a.y),this.L(2,rt.x,rt.y),this.m(3,rt.x,rt.y)):(tt=this.i(3),y===0||y===180?_t.B(rt.x,tt.x)?(rt=y===0?Math.max(rt.x,a.x):Math.min(rt.x,a.x),this.L(2,rt,a.y),this.L(3,rt,tt.y)):_t.B(rt.y,tt.y)?(Math.abs(a.y-rt.y)<=xt.Go/2&&(this.L(2,rt.x,a.y),this.L(3,tt.x,a.y)),this.m(2,rt.x,a.y)):this.L(2,a.x,rt.y):(y===90||y===270)&&(_t.B(rt.y,tt.y)?(rt=y===90?Math.max(rt.y,a.y):Math.min(rt.y,a.y),this.L(2,a.x,rt),this.L(3,tt.x,rt)):_t.B(rt.x,tt.x)?(Math.abs(a.x-rt.x)<=xt.Ho/2&&(this.L(2,a.x,rt.y),this.L(3,a.x,tt.y)),this.m(2,a.x,rt.y)):this.L(2,rt.x,a.y))),x!==null&&(a=this.i(1),tt=this.i(2),a.x!==tt.x&&a.y!==tt.y?y===0||y===180?this.m(2,a.x,tt.y):this.m(2,tt.x,a.y):y===0||y===180?this.m(2,b.x,x.y):this.m(2,x.x,b.y)),Ct!==null&&(E===0||E===180?this.yf(z.x,Ct.y):this.yf(Ct.x,z.y)),y=!0):y=!1}}}else y=!1;y||(this.ne(lt.copy()),this.ne(ut.copy())),At.free(lt),At.free(ut)}},kn.prototype.computeMidOrthoPosition=function(a,y,x,E,b){var z=0;return!this.hasCurviness()||this.computeSpot(!0,this.fromPort).$c()||this.computeSpot(!1,this.toPort).$c()||(z=this.computeCurviness()),b?(y+E)/2+z:(a+x)/2+z};function Uv(a){if(a.diagram===null||!a.isAvoiding||!wf(a.diagram))return!1;var y=a.points.s,x=y.length;if(4>x)return!1;a=Cf(a.diagram,!0,a.containingGroup,null);for(var E=1;E<x-2;E++){var b=y[E],z=y[E+1];if(!a.Yj(Math.min(b.x,z.x),Math.min(b.y,z.y),Math.abs(b.x-z.x),Math.abs(b.y-z.y)))return!0}return!1}function Yv(a,y,x,E,b,z,tt){var rt=y.Ho,ot=y.Go,lt=Yu(y,x,E),ut=x,ft=E;for(b===0?ut+=rt:b===90?ft+=ot:b===180?ut-=rt:ft-=ot,b!==tt&&lt>ic&&Yu(y,ut,ft)!==lt-1&&(Yu(y,x-rt,E)===lt-1?(b=180,ut=x-rt,ft=E):Yu(y,x+rt,E)===lt-1?(b=0,ut=x+rt,ft=E):Yu(y,x,E-ot)===lt-1?(b=270,ut=x,ft=E-ot):Yu(y,x,E+ot)===lt-1&&(b=90,ut=x,ft=E+ot));lt>ic&&Yu(y,ut,ft)===lt-1;)x=ut,E=ft,b===0?ut+=rt:b===90?ft+=ot:b===180?ut-=rt:ft-=ot,--lt;z?lt>ic&&(b===180||b===0?x=Math.floor(x/rt)*rt+rt/2:(b===90||b===270)&&(E=Math.floor(E/ot)*ot+ot/2)):(x=Math.floor(x/rt)*rt+rt/2,E=Math.floor(E/ot)*ot+ot/2),lt>ic&&(z=b,tt=x,ut=E,b===0?(z=90,ut+=ot):b===90?(z=180,tt-=rt):b===180?(z=270,ut-=ot):b===270&&(z=0,tt+=rt),Yu(y,tt,ut)===lt-1?Yv(a,y,tt,ut,z,!1,z):(tt=x,ut=E,b===0?(z=270,ut-=ot):b===90?(z=0,tt+=rt):b===180?(z=90,ut+=ot):b===270&&(z=180,tt-=rt),Yu(y,tt,ut)===lt-1&&Yv(a,y,tt,ut,z,!1,z))),a.yf(x,E)}kn.prototype.ez=function(a){var y=a.x;a=a.y;for(var x=this.i(0),E=this.i(1),b=Un(y,a,x.x,x.y,E.x,E.y),z=0,tt=1;tt<this.pointsCount-1;tt++){x=this.i(tt+1);var rt=Un(y,a,E.x,E.y,x.x,x.y);E=x,rt<b&&(z=tt,b=rt)}return z},kn.prototype.qc=function(){this.lk=!1,this.v()},kn.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 fr&&(b.ua=this.ua)}}},kn.prototype.makeGeometry=function(){var a=this.ua,y=this.pointsCount,x=!1,E=this.diagram;E!==null&&nc(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===dl&&3<=y&&!_t.$(this.smoothness,0))if(y===3){var rt=this.i(1);E=Math.min(b.x,rt.x);var ot=Math.min(b.y,rt.y);rt=this.i(2),E=Math.min(E,rt.x),ot=Math.min(ot,rt.y)}else{if(this.isOrthogonal)for(ot=0;ot<y;ot++)rt=E[ot],z.x=Math.min(rt.x,z.x),z.y=Math.min(rt.y,z.y);else for(E=3;E<y;E+=3)E+3>=y&&(E=y-1),ot=this.i(E),z.x=Math.min(ot.x,z.x),z.y=Math.min(ot.y,z.y);E=z.x,ot=z.y}else{for(ot=0;ot<y;ot++)rt=E[ot],z.x=Math.min(rt.x,z.x),z.y=Math.min(rt.y,z.y);E=z.x,ot=z.y}if(E-=this.su.x,ot-=this.su.y,b.x-=E,b.y-=ot,y!==2||nc(this)){if(a.type=ce.o,rt=N1(a),this.computeShortLength(!0)!==0&&(b=Rc(this,b,!0,z)),zf(rt,b.x,b.y,!1),tt===dl&&3<=y&&!_t.$(this.smoothness,0))if(y===3)x=this.i(1),y=x.x-E,x=x.y-ot,b=this.i(2).copy(),b.x-=E,b.y-=ot,this.computeShortLength(!1)!==0&&(b=Rc(this,b,!1,z)),Dh(rt,y,x,y,x,b.x,b.y);else if(this.isOrthogonal){y=At.allocAt(E,ot),x=At.alloc(),x.assign(this.i(1)),z=At.allocAt(E,ot),b=At.allocAt(E,ot),tt=this.i(0);for(var lt,ut=this.smoothness/3,ft=1;ft<this.pointsCount-1;ft++){lt=this.i(ft);var yt=tt,xt=lt,Ct=this.i(Xv(this,lt,ft,!1));if((!_t.$(yt.x,xt.x)||!_t.$(xt.x,Ct.x))&&(!_t.$(yt.y,xt.y)||!_t.$(xt.y,Ct.y))){var bt=ut;isNaN(bt)&&(bt=this.smoothness/3);var Vt=yt.x;yt=yt.y;var zt=xt.x;xt=xt.y;var $t=Ct.x;Ct=Ct.y;var ie=bt*Xm(Vt,yt,zt,xt);bt*=Xm(zt,xt,$t,Ct),_t.$(yt,xt)&&_t.$(zt,$t)&&(zt>Vt?Ct>xt?(z.x=zt-ie,z.y=xt-ie,b.x=zt+bt,b.y=xt+bt):(z.x=zt-ie,z.y=xt+ie,b.x=zt+bt,b.y=xt-bt):Ct>xt?(z.x=zt+ie,z.y=xt-ie,b.x=zt-bt,b.y=xt+bt):(z.x=zt+ie,z.y=xt+ie,b.x=zt-bt,b.y=xt-bt)),_t.$(Vt,zt)&&_t.$(xt,Ct)&&(xt>yt?($t>zt?(z.x=zt-ie,z.y=xt-ie,b.x=zt+bt):(z.x=zt+ie,z.y=xt-ie,b.x=zt-bt),b.y=xt+bt):($t>zt?(z.x=zt-ie,z.y=xt+ie,b.x=zt+bt):(z.x=zt+ie,z.y=xt+ie,b.x=zt-bt),b.y=xt-bt)),(_t.$(Vt,zt)&&_t.$(zt,$t)||_t.$(yt,xt)&&_t.$(xt,Ct))&&(Vt=.5*(Vt+$t),yt=.5*(yt+Ct),z.x=Vt,z.y=yt,b.x=Vt,b.y=yt),(ft===1||ft===2&&_t.$(tt.x,this.i(0).x)&&_t.$(tt.y,this.i(0).y))&&(x.x=.5*(tt.x+lt.x),x.y=.5*(tt.y+lt.y)),Dh(rt,x.x-E,x.y-ot,z.x-E,z.y-ot,lt.x-E,lt.y-ot),y.set(z),x.set(b),tt=lt}}lt=tt.x,tt=tt.y,ut=this.i(this.pointsCount-1),this.computeShortLength(!1)!==0&&(ut=Rc(this,ut.copy(),!1,jn)),lt=.5*(lt+ut.x),tt=.5*(tt+ut.y),Dh(rt,b.x-E,b.y-ot,lt-E,tt-ot,ut.x-E,ut.y-ot),At.free(y),At.free(x),At.free(z),At.free(b)}else for(x=3;x<y;x+=3)z=this.i(x-2),x+3>=y&&(x=y-1),b=this.i(x-1),tt=this.i(x),x===y-1&&this.computeShortLength(!1)!==0&&(tt=Rc(this,tt.copy(),!1,jn)),Dh(rt,z.x-E,z.y-ot,b.x-E,b.y-ot,tt.x-E,tt.y-ot);else{for(z=At.alloc(),z.assign(this.i(0)),b=At.alloc(),b.assign(z),tt=this.computeCorner(),ft=1,lt=0;ft<y;){if(ft=Xv(this,z,ft,1<ft),ut=this.i(ft),ft>=y-1){if(!z.D(ut))this.computeShortLength(!1)!==0&&(ut=Rc(this,ut.copy(),!1,jn)),jc(this,rt,-E,-ot,z,ut,x);else if(lt===0)for(ft=1;ft<y;)b.assign(z),ut=this.i(ft++),jc(this,rt,-E,-ot,z,ut,x),z.assign(ut);break}if(lt=Xv(this,ut,ft+1,ft<y-3),ft=-E,Vt=-ot,yt=ut,zt=this.i(lt),bt=x,_t.B(z.y,yt.y)&&_t.B(yt.x,zt.x))if(Ct=Math.min(tt,Math.abs(yt.x-b.x)/2),Ct=ie=Math.min(Ct,Math.abs(zt.y-yt.y)/2),_t.B(Ct,0))jc(this,rt,ft,Vt,z,yt,bt),z.assign(yt);else{var oe=yt.x,de=yt.y;xt=oe,$t=de,yt.x>z.x?oe=yt.x-Ct:oe=yt.x+Ct,zt.y>yt.y?$t=yt.y+ie:$t=yt.y-ie,zt=At.allocAt(oe,de),jc(this,rt,ft,Vt,z,zt,bt),At.free(zt),jm(rt,yt.x+ft,yt.y+Vt,xt+ft,$t+Vt),z.h(xt,$t)}else _t.B(z.x,yt.x)&&_t.B(yt.y,zt.y)?(Ct=Math.min(tt,Math.abs(yt.y-b.y)/2),Ct=ie=Math.min(Ct,Math.abs(zt.x-yt.x)/2),_t.B(ie,0)?(jc(this,rt,ft,Vt,z,yt,bt),z.assign(yt)):(oe=yt.x,de=yt.y,xt=oe,$t=de,yt.y>z.y?de=yt.y-Ct:de=yt.y+Ct,zt.x>yt.x?xt=yt.x+ie:xt=yt.x-ie,zt=At.allocAt(oe,de),jc(this,rt,ft,Vt,z,zt,bt),At.free(zt),jm(rt,yt.x+ft,yt.y+Vt,xt+ft,$t+Vt),z.h(xt,$t))):(jc(this,rt,ft,Vt,z,yt,bt),z.assign(yt));b.assign(ut),ft=lt}At.free(z)}zm=rt}else rt=this.i(1).copy(),rt.x-=E,rt.y-=ot,this.computeShortLength(!0)!==0&&(b=Rc(this,b,!0,z)),this.computeShortLength(!1)!==0&&(rt=Rc(this,rt,!1,z)),a.type=ce.j,a.startX=b.x,a.startY=b.y,a.endX=rt.x,a.endY=rt.y;return this.lk=!0,a};function Xm(a,y,x,E){return a=x-a,isNaN(a)||a===1/0||a===-1/0?NaN:(0>a&&(a=-a),y=E-y,isNaN(y)||y===1/0||y===-1/0?NaN:(0>y&&(y=-y),_t.$(a,0)?y:_t.$(y,0)?a:Math.sqrt(a*a+y*y)))}function Rc(a,y,x,E){var b=a.pointsCount;if(2>b)return y;if(x){var z=a.i(1);if(x=z.x-E.x,z=z.y-E.y,E=Xm(y.x,y.y,x,z),E===0)return y;b=b===2?.5*E:E,a=a.computeShortLength(!0),a>b&&(a=b),b=a*(z-y.y)/E,y.x+=a*(x-y.x)/E,y.y+=b}else{if(z=a.i(b-2),x=z.x-E.x,z=z.y-E.y,E=Xm(y.x,y.y,x,z),E===0)return y;b=b===2?.5*E:E,a=a.computeShortLength(!1),a>b&&(a=b),b=a*(y.y-z)/E,y.x-=a*(y.x-x)/E,y.y-=b}return y}function Xv(a,y,x,E){for(var b=a.pointsCount,z=y;_t.$(y.x,z.x)&&_t.$(y.y,z.y);){if(x>=b)return b-1;z=a.i(x++)}if(!_t.$(y.x,z.x)&&!_t.$(y.y,z.y))return x-1;for(var tt=z;_t.$(y.x,z.x)&&_t.$(z.x,tt.x)&&(!E||(y.y>=z.y?z.y>=tt.y:z.y<=tt.y))||_t.$(y.y,z.y)&&_t.$(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}kn.prototype.computeJumpLength=function(){return 10};function jc(a,y,x,E,b,z,tt){if(!tt&&nc(a)){tt=a.computeJumpLength();var rt=tt/2,ot=[],lt=0;if(a.isVisible()&&(lt=Lx(a,b,z,ot)),0<lt){if(_t.B(b.y,z.y))if(b.x<z.x)for(var ut=0;ut<lt;){var ft=Math.max(b.x,Math.min(ot[ut++]-rt,z.x-tt));y.lineTo(ft+x,z.y+E);for(var yt=ft+x,xt=Math.min(ft+tt,z.x);ut<lt&&(ft=ot[ut],ft<xt+tt);)ut++,xt=Math.min(ft+rt,z.x);ft=z.y-tt+E,xt+=x;var Ct=z.y+E;a.curve===Rh?zf(y,xt,Ct,!1):Dh(y,yt,ft,xt,ft,xt,Ct)}else for(--lt;0<=lt;){for(ut=Math.min(b.x,Math.max(ot[lt--]+rt,z.x+tt)),y.lineTo(ut+x,z.y+E),yt=ut+x,ft=Math.max(ut-tt,z.x);0<=lt&&(ut=ot[lt],ut>ft-tt);)lt--,ft=Math.max(ut-rt,z.x);ut=z.y-tt+E,ft+=x,xt=z.y+E,a.curve===Rh?zf(y,ft,xt,!1):Dh(y,yt,ut,ft,ut,ft,xt)}else if(_t.B(b.x,z.x))if(b.y<z.y)for(ut=0;ut<lt;){for(ft=Math.max(b.y,Math.min(ot[ut++]-rt,z.y-tt)),y.lineTo(z.x+x,ft+E),yt=ft+E,ft=Math.min(ft+tt,z.y);ut<lt&&(xt=ot[ut],xt<ft+tt);)ut++,ft=Math.min(xt+rt,z.y);xt=z.x-tt+x,Ct=z.x+x,ft+=E,a.curve===Rh?zf(y,Ct,ft,!1):Dh(y,xt,yt,xt,ft,Ct,ft)}else for(--lt;0<=lt;){for(ut=Math.min(b.y,Math.max(ot[lt--]+rt,z.y+tt)),y.lineTo(z.x+x,ut+E),yt=ut+E,ut=Math.max(ut-tt,z.y);0<=lt&&(ft=ot[lt],ft>ut-tt);)lt--,ut=Math.max(ft-rt,z.y);ft=z.x-tt+x,xt=z.x+x,ut+=E,a.curve===Rh?zf(y,xt,ut,!1):Dh(y,ft,yt,ft,ut,xt,ut)}}}y.lineTo(z.x+x,z.y+E)}function Lx(a,y,x,E){var b=a.diagram;if(b===null||y.D(x))return 0;for(b=b.layers;b.next();){var z=b.value;if(z!==null&&z.visible){z=z.Pa.s;for(var tt=z.length,rt=0;rt<tt;rt++){var ot=z[rt];if(ot instanceof kn){if(ot===a)return 0<E.length&&E.sort(function(ut,ft){return ut-ft}),E.length;if(ot.isVisible()&&nc(ot)){var lt=ot.routeBounds;lt.w()&&a.routeBounds.Yc(lt)&&!a.usesSamePort(ot)&&(lt=ot.path,lt!==null&&lt.Ed()&&Fx(y,x,E,ot))}}}}}return 0<E.length&&E.sort(function(ut,ft){return ut-ft}),E.length}function Fx(a,y,x,E){for(var b=_t.B(a.y,y.y),z=E.pointsCount,tt=E.i(0),rt=At.alloc(),ot=1;ot<z;ot++){var lt=E.i(ot);if(ot<z-1){var ut=E.i(ot+1);if(tt.y===lt.y&&lt.y===ut.y){if(lt.x>tt.x&&ut.x>=lt.x||lt.x<tt.x&&ut.x<=lt.x)continue}else if(tt.x===lt.x&&lt.x===ut.x&&(lt.y>tt.y&&ut.y>=lt.y||lt.y<tt.y&&ut.y<=lt.y))continue}t:{ut=a.x;var ft=a.y,yt=y.x,xt=y.y,Ct=tt.x;tt=tt.y;var bt=lt.x,Vt=lt.y;if(_t.B(ut,yt)){if(!_t.B(ft,xt)&&_t.B(tt,Vt)&&Math.min(ft,xt)<tt&&Math.max(ft,xt)>tt&&Math.min(Ct,bt)<ut&&Math.max(Ct,bt)>ut&&!_t.B(Ct,bt)){rt.x=ut,rt.y=tt,ut=!0;break t}}else if(_t.B(ft,xt)&&_t.B(Ct,bt)&&Math.min(ut,yt)<Ct&&Math.max(ut,yt)>Ct&&Math.min(tt,Vt)<ft&&Math.max(tt,Vt)>ft&&!_t.B(tt,Vt)){rt.x=Ct,rt.y=ft,ut=!0;break t}rt.x=0,rt.y=0,ut=!1}ut&&(b?x.push(rt.x):x.push(rt.y)),tt=lt}At.free(rt)}function nc(a){return a=a.curve,a===Hf||a===Rh}function Jm(a,y){(y||nc(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()))}kn.prototype.Xo=function(a){var y=this.layer;if(y!==null&&y.visible&&!y.isTemporary){var x=y.diagram;if(x!==null&&!x.animationManager.isTicking){var E=!1;for(x=x.layers;x.next();){var b=x.value;if(b.visible){if(b===y){E=!0;var z=!1;b=b.Pa.s;for(var tt=b.length,rt=0;rt<tt;rt++){var ot=b[rt];ot instanceof kn&&(ot===this?z=!0:z&&tS(this,ot,a))}}else if(E)for(z=b.Pa.s,b=z.length,tt=0;tt<b;tt++)rt=z[tt],rt instanceof kn&&tS(this,rt,a)}}}}};function tS(a,y,x){if(y!==null&&y.lk&&y.fd&&nc(y)){var E=y.routeBounds;E.w()&&(a.routeBounds.Yc(E)||x.Yc(E))&&(a.usesSamePort(y)||y.qc())}}kn.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},kn.prototype.isVisible=function(){if(!Ai.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},kn.prototype.Zb=function(a){if(Ai.prototype.Zb.call(this,a),a&&Jm(this,!1),this.Sf!==null&&this.Sf.Sl(),this.wd!==null)for(var y=this.wd.iterator;y.next();)y.value.Zb(a)},kn.prototype.computeAdjusting=function(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?ap:this.qk};function rp(a){var y=a.ef;if(y!==null){var x=a.uf;if(x!==null&&isNaN(a.curviness)){for(var E=a.ff,b=a.vf,z=a=null,tt=y.jb.s,rt=tt.length,ot=0;ot<rt;ot++){var lt=tt[ot];(lt.ef===y&&lt.ff===E&&lt.uf===x&&lt.vf===b||lt.ef===x&&lt.ff===b&&lt.uf===y&&lt.vf===E)&&(z===null?z=lt:(a===null&&(a=[],a.push(z)),a.push(lt)))}if(a!==null){for(z=G1(y,x,E,b),z===null&&(z=new e0(y,E,x,b),Z1(y,z),Z1(x,z)),z.links=a,y=0;y<a.length;y++)a[y].Sf=z;z.Sl()}}}}function op(a){var y=a.Sf;y!==null&&isNaN(a.curviness)&&(a.Sf=null,a=y.links.indexOf(a),0<=a&&(di(y.links,a),y.Sl()))}kn.prototype.ph=function(){return!0},Se.Object.defineProperties(kn.prototype,{fromNode:{get:function(){return this.ef},set:function(a){var y=this.ef;if(y!==a){var x=this.fromPort;y!==null&&(this.uf!==y&&Wm(y,this,x),op(this),this.C(2)),this.ef=a,a!==null&&this.Zb(a.isVisible()),this.Wf=null,this.bb();var E=this.diagram;E!==null&&E.aa&&E.partManager.setFromNodeForLink(this,a,y);var b=this.fromPort,z=this.fromPortChanged;if(z!==null){var tt=!0;E!==null&&(tt=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=tt)}a!==null&&(this.uf!==a&&Hm(a,this,b),rp(this),this.C(1)),this.g("fromNode",y,a),Zf(this)}}},fromPortId:{get:function(){return this.ff},set:function(a){var y=this.ff;if(y!==a){var x=this.fromPort;x!==null&&$s(x),op(this),this.ff=a;var E=this.fromPort;E!==null&&$s(E);var b=this.diagram;if(b!==null){var z=this.data,tt=b.model;z!==null&&tt.ri()&&tt.xv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.fromPortChanged,z!==null&&(tt=!0,b!==null&&(tt=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=tt))),rp(this),this.g("fromPortId",y,a)}}},fromPort:{get:function(){var a=this.ef;return a===null?null:a.ns(this.ff)}},fromPortChanged:{get:function(){return this.gn},set:function(a){var y=this.gn;y!==a&&(this.gn=a,this.g("fromPortChanged",y,a))}},toNode:{get:function(){return this.uf},set:function(a){var y=this.uf;if(y!==a){var x=this.toPort;y!==null&&(this.ef!==y&&Wm(y,this,x),op(this),this.C(2)),this.uf=a,a!==null&&this.Zb(a.isVisible()),this.Wf=null,this.bb();var E=this.diagram;E!==null&&E.aa&&E.partManager.setToNodeForLink(this,a,y);var b=this.toPort,z=this.toPortChanged;if(z!==null){var tt=!0;E!==null&&(tt=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=tt)}a!==null&&(this.ef!==a&&Hm(a,this,b),rp(this),this.C(1)),this.g("toNode",y,a),Zf(this)}}},toPortId:{get:function(){return this.vf},set:function(a){var y=this.vf;if(y!==a){var x=this.toPort;x!==null&&$s(x),op(this),this.vf=a;var E=this.toPort;E!==null&&$s(E);var b=this.diagram;if(b!==null){var z=this.data,tt=b.model;z!==null&&tt.ri()&&tt.Cv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.toPortChanged,z!==null&&(tt=!0,b!==null&&(tt=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=tt))),rp(this),this.g("toPortId",y,a)}}},toPort:{get:function(){var a=this.uf;return a===null?null:a.ns(this.vf)}},toPortChanged:{get:function(){return this.uo},set:function(a){var y=this.uo;y!==a&&(this.uo=a,this.g("toPortChanged",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:xa},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),(y.$c()||a.$c())&&this.fromNode!==null&&$s(this.fromPort),this.bb())}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:NaN},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&En(a,">= 0",kn,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),this.bb())}},fromShortLength:{get:function(){return this.ba!==null?this.ba.Wi:NaN},set:function(a){var y=this.fromShortLength;y!==a&&(this.Xc(),this.ba.Wi=a,this.qc(),this.g("fromShortLength",y,a))}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:xa},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),(y.$c()||a.$c())&&this.toNode!==null&&$s(this.toPort),this.bb())}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:NaN},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&En(a,">= 0",kn,"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?yr:this.wd.iterator}},relinkableFrom:{get:function(){return(this.Qa&1)!==0},set:function(a){var y=(this.Qa&1)!==0;y!==a&&(this.Qa^=1,this.g("relinkableFrom",y,a),this.Wb())}},relinkableTo:{get:function(){return(this.Qa&2)!==0},set:function(a){var y=(this.Qa&2)!==0;y!==a&&(this.Qa^=2,this.g("relinkableTo",y,a),this.Wb())}},resegmentable:{get:function(){return(this.Qa&4)!==0},set:function(a){var y=(this.Qa&4)!==0;y!==a&&(this.Qa^=4,this.g("resegmentable",y,a),this.Wb())}},isTreeLink:{get:function(){return(this.Qa&8)!==0},set:function(a){var y=(this.Qa&8)!==0;y!==a&&(this.Qa^=8,this.g("isTreeLink",y,a),this.fromNode!==null&&ip(this.fromNode),this.toNode!==null&&ip(this.toNode))}},path:{get:function(){var a=this.Pb();return a instanceof fr?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()===dl&&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),_t.Dl(b.x,b.y,E.x,E.y,E.x,E.y,z.x,z.y,.5,a)}else for(z=3;z<E;z+=3){var tt=this.i(z-2);z+3>=E&&(z=E-1);var rt=this.i(z-1),ot=this.i(z);_t.Dl(b.x,b.y,tt.x,tt.y,rt.x,rt.y,ot.x,ot.y,.5,a),y=Math.min(ot.x,y),x=Math.min(ot.y,x),b=ot}else for(b=this.i(0),z=this.i(1),y=Math.min(b.x,z.x),x=Math.min(b.y,z.y),a.h(b.x,b.y,0,0),a.Ye(z),b=2;b<E;b++)z=this.i(b),y=Math.min(z.x,y),x=Math.min(z.y,x),a.Ye(z);this.su.h(y-a.x,x-a.y)}return a}},midPoint:{get:function(){return this.vg(),this.computeMidPoint(new At)}},midAngle:{get:function(){return this.vg(),this.computeMidAngle()}},flattenedLengths:{get:function(){if(this.cq===null){this.fd||Km(this);for(var a=this.cq=[],y=this.pointsCount,x=0;x<y-1;x++){var E=this.i(x),b=this.i(x+1);_t.$(E.x,b.x)?(E=b.y-E.y,0>E&&(E=-E)):_t.$(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 cn,E=0;E<a.length/2;E++)b=new At(a[2*E],a[2*E+1]).freeze(),x.add(b);else{for(E=!0,b=0;b<a.length;b++){var z=a[b];if(!Re(z)||typeof z.x!="number"||isNaN(z.x)||typeof z.y!="number"||isNaN(z.y)){E=!1;break}}if(E)for(x=new cn,E=0;E<a.length;E++)b=a[E],x.add(new At(b.x,b.y).freeze())}}else if(a instanceof cn)for(x=a.copy(),a=x.iterator;a.next();)a.value.freeze();else Gt("Link.points value is not an instance of List or Array: "+a);x.freeze(),this.Nb=x,this.qc(),Km(this),a=this.diagram,a!==null&&(a.pi||a.undoManager.isUndoingRedoing||a.As.add(this),a.animationManager.zb&&ff(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||!Gf(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return a===0?0:2>=a?a-1:this.isOrthogonal||!Gf(this.computeSpot(!1))?a-2:a-1}},adjusting:{get:function(){return this.qk},set:function(a){var y=this.qk;y!==a&&(this.qk=a,this.g("adjusting",y,a))}},corner:{get:function(){return this.Om},set:function(a){var y=this.Om;y!==a&&(this.Om=a,this.qc(),this.g("corner",y,a))}},curve:{get:function(){return this.Qm},set:function(a){var y=this.Qm;y!==a&&(this.Qm=a,this.bb(),this.qc(),Jm(this,y===Rh||y===Hf||a===Rh||a===Hf),this.g("curve",y,a))}},curviness:{get:function(){return this.Rm},set:function(a){var y=this.Rm;y!==a&&(this.Rm=a,this.bb(),this.qc(),this.g("curviness",y,a))}},routing:{get:function(){return this.qj},set:function(a){var y=this.qj;y!==a&&(this.qj=a,this.Wf=null,this.bb(),Jm(this,(y.value&2)===2||(a.value&2)===2),this.g("routing",y,a))}},smoothness:{get:function(){return this.po},set:function(a){var y=this.po;y!==a&&(this.po=a,this.qc(),this.g("smoothness",y,a))}},key:{get:function(){var a=this.diagram;if(a!==null&&a.model.ri())return a.model.Ac(this.data)}}}),kn.prototype.invalidateOtherJumpOvers=kn.prototype.Xo,kn.prototype.findClosestSegment=kn.prototype.ez,kn.prototype.updateRoute=kn.prototype.vg,kn.prototype.invalidateRoute=kn.prototype.bb,kn.prototype.rollbackRoute=kn.prototype.rv,kn.prototype.commitRoute=kn.prototype.zf,kn.prototype.startRoute=kn.prototype.uh,kn.prototype.clearPoints=kn.prototype.Fj,kn.prototype.removePoint=kn.prototype.pv,kn.prototype.addPointAt=kn.prototype.yf,kn.prototype.addPoint=kn.prototype.ne,kn.prototype.insertPointAt=kn.prototype.m,kn.prototype.insertPoint=kn.prototype.Kz,kn.prototype.setPointAt=kn.prototype.L,kn.prototype.setPoint=kn.prototype.dd,kn.prototype.getPoint=kn.prototype.i,kn.prototype.getOtherPort=kn.prototype.Cz,kn.prototype.getOtherNode=kn.prototype.To;var zc=null,Zc=null,Jv=new en(kn,"Normal",1),Mx=new en(kn,"Orthogonal",2),kx=new en(kn,"AvoidsNodes",6),eS=new en(kn,"AvoidsNodesStraight",7),ws=new en(kn,"None",0),dl=new en(kn,"Bezier",9),Rh=new en(kn,"JumpGap",10),Hf=new en(kn,"JumpOver",11),ap=new en(kn,"End",17),Qm=new en(kn,"Scale",18),$m=new en(kn,"Stretch",19),sp=new en(kn,"OrientAlong",21),lp=new en(kn,"OrientPlus90",22),up=new en(kn,"OrientMinus90",23),Qv=new en(kn,"OrientOpposite",24),qm=new en(kn,"OrientUpright",25),hp=new en(kn,"OrientPlus90Upright",26),dp=new en(kn,"OrientMinus90Upright",27),t0=new en(kn,"OrientUpright45",28),nS=16,iS=14,cp=8;kn.className="Link",kn.Normal=Jv,kn.Orthogonal=Mx,kn.AvoidsNodes=kx,kn.AvoidsNodesStraight=eS,kn.None=ws,kn.Bezier=dl,kn.JumpGap=Rh,kn.JumpOver=Hf,kn.End=ap,kn.Scale=Qm,kn.Stretch=$m,kn.OrientAlong=sp,kn.OrientPlus90=lp,kn.OrientMinus90=up,kn.OrientOpposite=Qv,kn.OrientUpright=qm,kn.OrientPlus90Upright=hp,kn.OrientMinus90Upright=dp,kn.OrientUpright45=t0,kn.EndSegmentStep=8,kn.CurvinessStart=nS,kn.SpacingMin=iS,kn.OrthoShortCut=cp;function e0(a,y,x,E){Wi(this),this.Fe=this.qq=!1,this.Ds=a,this.Ox=y,this.cv=x,this.Px=E,this.links=[]}e0.prototype.Sl=function(){if(!this.qq){var a=this.links;0<a.length&&(a=a[0].diagram,a!==null&&(a.ow.add(this),this.Fe=a.undoManager.isUndoingRedoing))}this.qq=!0},e0.prototype.Nv=function(){if(this.qq){this.qq=!1;var a=this.links;if(0<a.length){var y=a[0],x=y.diagram;x=x===null||x.pi&&!this.Fe,this.Fe=!1,y.arrangeBundledLinks(a,x),a.length===1&&(y.Sf=null,a.length=0)}a.length===0&&(a=this.Ds,this!==null&&a.af!==null&&a.af.remove(this),a=this.cv,this!==null&&a.af!==null&&a.af.remove(this))}},e0.className="LinkBundle";function fp(a){Wi(this),this.Yx=this.group=null,this.vs=!0,this.abort=!1,this.Od=this.Nd=1,this.Fn=this.En=-1,this.rc=a.width,this.sc=a.height,this.ac=null,this.ei=this.di=0,this.Os=11,this.Ix=this.Hx=22}fp.prototype.initialize=function(a){if(!(0>=a.width||0>=a.height)){var y=a.y,x=a.x+a.width,E=a.y+a.height;if(this.Nd=Math.floor((a.x-this.rc)/this.rc)*this.rc,this.Od=Math.floor((y-this.sc)/this.sc)*this.sc,this.En=Math.ceil((x+2*this.rc)/this.rc)*this.rc,this.Fn=Math.ceil((E+2*this.sc)/this.sc)*this.sc,a=1+(Math.ceil((this.En-this.Nd)/this.rc)|0),y=1+(Math.ceil((this.Fn-this.Od)/this.sc)|0),this.ac===null||this.di<a-1||this.ei<y-1){for(x=[],E=0;E<=a;E++)x[E]=new Uint32Array(y);this.ac=x,this.di=a-1,this.ei=y-1}if(a=$v,this.ac!==null)for(y=0;y<=this.di;y++)if(x=this.ac[y],x.fill)x.fill(a);else for(E=0;E<=this.ei;E++)x[E]=a}};function Wf(a,y,x){return a.Nd<=y&&y<=a.En&&a.Od<=x&&x<=a.Fn}function Yu(a,y,x){return Wf(a,y,x)?(y-=a.Nd,y/=a.rc,x-=a.Od,x/=a.sc,a.ac[y|0][x|0]):$v}function rS(a){if(a.ac!==null)for(var y=0;y<=a.di;y++)for(var x=a.ac[y],E=0;E<=a.ei;E++)x[E]>=ic&&(x[E]=$v)}fp.prototype.Yj=function(a,y,x,E){if(a>this.En||a+x<this.Nd||y>this.Fn||y+E<this.Od)return!0;a=(a-this.Nd)/this.rc|0,y=(y-this.Od)/this.sc|0,x=Math.max(0,x)/this.rc+1|0;var b=Math.max(0,E)/this.sc+1|0;if(0>a&&(x+=a,a=0),0>y&&(b+=y,y=0),0>x||0>b)return!0;for(E=Math.min(a+x-1,this.di)|0,x=Math.min(y+b-1,this.ei)|0;a<=E;a++){b=this.ac[a];for(var z=y;z<=x;z++)if(b[z]===jh)return!1}return!0};function Xu(a,y,x,E,b,z,tt,rt,ot){if(!(y<z||y>tt||x<rt||x>ot)){var lt=y|0,ut=x|0,ft=a.ac[lt][ut];if(ft>=ic&&ft<Vf)for(b?ut+=E:lt+=E,ft+=1;z<=lt&&lt<=tt&&rt<=ut&&ut<=ot&&!(ft>=a.ac[lt][ut]);)a.ac[lt][ut]=ft,ft+=1,b?ut+=E:lt+=E;if(lt=b?ut:lt,b)if(0<E)for(x+=E;x<lt;x+=E)Xu(a,y,x,1,!b,z,tt,rt,ot),Xu(a,y,x,-1,!b,z,tt,rt,ot);else for(x+=E;x>lt;x+=E)Xu(a,y,x,1,!b,z,tt,rt,ot),Xu(a,y,x,-1,!b,z,tt,rt,ot);else if(0<E)for(y+=E;y<lt;y+=E)Xu(a,y,x,1,!b,z,tt,rt,ot),Xu(a,y,x,-1,!b,z,tt,rt,ot);else for(y+=E;y>lt;y+=E)Xu(a,y,x,1,!b,z,tt,rt,ot),Xu(a,y,x,-1,!b,z,tt,rt,ot)}}function n0(a,y,x,E,b,z,tt,rt,ot){y|=0,x|=0;var lt=jh,ut=ic;for(a.ac[y][x]=ut;lt===jh&&y>z&&y<tt&&x>rt&&x<ot;)ut+=1,a.ac[y][x]=ut,b?x+=E:y+=E,lt=a.ac[y][x]}function i0(a,y,x,E,b,z,tt,rt,ot){y|=0,x|=0;var lt=jh,ut=Vf;for(a.ac[y][x]=ut;lt===jh&&y>z&&y<tt&&x>rt&&x<ot;)a.ac[y][x]=ut,b?x+=E:y+=E,lt=a.ac[y][x]}function oS(a,y,x,E,b,z,tt){if(a.ac!==null){a.abort=!1;var rt=y.x,ot=y.y;if(Wf(a,rt,ot)){rt-=a.Nd,rt/=a.rc,ot-=a.Od,ot/=a.sc;var lt=E.x,ut=E.y;if(Wf(a,lt,ut))if(lt-=a.Nd,lt/=a.rc,ut-=a.Od,ut/=a.sc,1>=Math.abs(rt-lt)&&1>=Math.abs(ot-ut))a.abort=!0;else{var ft=z.x;E=z.y,y=z.x+z.width;var yt=z.y+z.height;ft-=a.Nd,ft/=a.rc,E-=a.Od,E/=a.sc,y-=a.Nd,y/=a.rc,yt-=a.Od,yt/=a.sc,z=Math.max(0,Math.min(a.di,ft|0)),y=Math.min(a.di,Math.max(0,y|0)),ft=Math.max(0,Math.min(a.ei,E|0)),yt=Math.min(a.ei,Math.max(0,yt|0)),E=a.ac,rt|=0,ot|=0,lt|=0,ut|=0;var xt=x===0||x===90?1:-1;if(x=x===90||x===270,E[rt][ot]===jh?(n0(a,rt,ot,xt,x,z,y,ft,yt),n0(a,rt,ot,1,!x,z,y,ft,yt),n0(a,rt,ot,-1,!x,z,y,ft,yt)):n0(a,rt,ot,xt,x,rt,ot,rt,ot),E[lt][ut]===jh?(i0(a,lt,ut,b===0||b===90?1:-1,b===90||b===270,z,y,ft,yt),i0(a,lt,ut,1,!(b===90||b===270),z,y,ft,yt),i0(a,lt,ut,-1,!(b===90||b===270),z,y,ft,yt)):i0(a,lt,ut,xt,x,lt,ut,lt,ut),x=Jn(),tt&&aS(a,lt,ut,b,rt,ot,x))for((x[0]!==lt||x[1]!==ut)&&(x.unshift(ut),x.unshift(lt)),(x[x.length-2]!==rt||x[x.length-1]!==ot)&&(x.push(rt),x.push(ot)),a=ic,b=x[x.length-2],tt=x[x.length-1],E[b][tt]=a++,z=x.length-4;0<=z;z-=2)for(b=x[z+2],tt=x[z+3],y=x[z],lt=x[z+1];y>b?b++:y<b?b--:lt>tt?tt++:lt<tt&&tt--,E[b][tt]=a++,b!==y||tt!==lt;);else Xu(a,rt,ot,1,!1,z,y,ft,yt),Xu(a,rt,ot,-1,!1,z,y,ft,yt),Xu(a,rt,ot,1,!0,z,y,ft,yt),Xu(a,rt,ot,-1,!0,z,y,ft,yt);li(x)}}}}function aS(a,y,x,E,b,z,tt){for(var rt=a.ac,ot=y,lt=x;;){if(ot===b&&lt===z)return!0;var ut=ot,ft=lt;if(E===0)if(ut<b)ut++;else break;else if(E===90)if(ft<z)ft++;else break;else if(E===180)if(ut>b)ut--;else break;else if(ft>z)ft--;else break;var yt=rt[ut][ft];if(yt===0||yt===qv)break;ot=ut,lt=ft}for(;;){if(ut=E,ft=ot,yt=lt,E===0?yt<z?(ut=90,yt++):yt>z&&(ut=270,yt--):E===90?ft<b?(ut=0,ft++):ft>b&&(ut=180,ft--):E===180?yt<z?(ut=90,yt++):yt>z&&(ut=270,yt--):ft<b?(ut=0,ft++):ft>b&&(ut=180,ft--),ft=rt[ft][yt],ut!==E&&ft!==0&&ft!==qv){if(tt.push(ot),tt.push(lt),aS(a,ot,lt,ut,b,z,tt))return!0;tt.pop(),tt.pop()}if(rt[ot][lt]=qv,E===0){if(ot===y)return!1;ot--}else if(E===90){if(lt===x)return!1;lt--}else if(E===180){if(ot===y)return!1;ot++}else{if(lt===x)return!1;lt++}}}Se.Object.defineProperties(fp.prototype,{bounds:{get:function(){return new Te(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 jh=0,ic=1,Vf=999999,$v=Vf+1,qv=Vf+2;fp.className="PositionArray";function Gc(){Wi(this),this.port=this.node=null,this.pe=[],this.ap=!1}Gc.prototype.toString=function(){for(var a=this.pe,y=this.node.toString()+" "+a.length.toString()+":",x=0;x<a.length;x++){var E=a[x];E!==null&&(y+=`
`+E.toString())}return y};function bx(a,y,x,E){switch(y=y.offsetY,y){case 8:return 90;case 2:return 180;case 1:return 270;case 4:return 0}switch(y){case 9:return 180<x?270:90;case 6:return 90<x&&270>=x?180:0}switch(a=180*Math.atan2(a.height,a.width)/Math.PI,y){case 3:return x>a&&x<=180+a?180:270;case 5:return x>180-a&&x<=360-a?270:0;case 12:return x>a&&x<=180+a?90:0;case 10:return x>180-a&&x<=360-a?180:90;case 7:return 90<x&&x<=180+a?180:x>180+a&&x<=360-a?270:0;case 13:return 180<x&&x<=360-a?270:x>a&&180>=x?90:0;case 14:return x>a&&x<=180-a?90:x>180-a&&270>=x?180:0;case 11:return x>180-a&&x<=180+a?180:x>180+a?270:90}return E&&y!==15&&(x-=15,0>x&&(x+=360)),x>a&&x<180-a?90:x>=180-a&&x<=180+a?180:x>180+a&&x<360-a?270:0}Gc.prototype.Sl=function(){this.pe.length=0};function sS(a,y){var x=a.pe;if(x.length===0){t:if(!a.ap){x=a.ap,a.ap=!0;var E=null,b=a.node,z=b instanceof rr?b:null;if(z===null||z.isSubGraphExpanded)var tt=b.isTreeExpanded?b.findLinksConnected(a.port.portId):b.qx();else{if(!z.actualBounds.w()){a.ap=x;break t}E=z,tt=E.Lu()}z=a.pe.length=0;var rt=a.port.ga(jr,At.alloc()),ot=a.port.ga(so,At.alloc());for(b=Te.allocAt(rt.x,rt.y,0,0),b.Ye(ot),At.free(rt),At.free(ot),rt=At.allocAt(b.x+b.width/2,b.y+b.height/2),ot=a.port.li(),tt=tt.iterator;tt.next();){var lt=tt.value;if(lt.isVisible()&&lt.fromPort!==lt.toPort){var ut=lt.fromPort===a.port||lt.fromNode!==null&&lt.fromNode.Td(E),ft=lt.computeSpot(ut,a.port);if(ft.$c()&&(ut=ut?lt.toPort:lt.fromPort,ut!==null)){var yt=ut.part;if(yt!==null){var xt=yt.findVisibleNode();xt!==null&&xt!==yt&&(yt=xt,ut=yt.port),ut=lt.computeOtherPoint(yt,ut),yt=rt.ab(ut),yt-=ot,0>yt?yt+=360:360<=yt&&(yt-=360),ft=bx(b,ft,yt,lt.isOrthogonal),ft===0?(ft=4,180<yt&&(yt-=360)):ft===90?(ft=8,270<yt&&(yt-=360)):ft===180?ft=2:(ft=1,90>yt&&(yt+=360)),xt=a.pe[z],xt===void 0?(xt=new ty(lt,yt,ft),a.pe[z]=xt):(xt.link=lt,xt.angle=yt,xt.Nc=ft),xt.hv.set(ut),z++}}}}for(At.free(rt),a.pe.sort(Gc.prototype.j),ot=a.pe.length,E=-1,z=rt=0;z<ot;z++)tt=a.pe[z],tt!==void 0&&(tt.Nc!==E&&(E=tt.Nc,rt=0),tt.Uo=rt,rt++);for(E=-1,rt=0,z=ot-1;0<=z;z--)ot=a.pe[z],ot!==void 0&&(ot.Nc!==E&&(E=ot.Nc,rt=ot.Uo+1),ot.Gl=rt);if(z=a.pe,ft=a.port,E=a.node.portSpreading,rt=At.alloc(),ot=At.alloc(),tt=At.alloc(),lt=At.alloc(),ft.ga(jr,rt),ft.ga(mo,ot),ft.ga(so,tt),ft.ga(da,lt),xt=yt=ut=ft=0,E===Hv)for(var Ct=0;Ct<z.length;Ct++){var bt=z[Ct];if(bt!==null){var Vt=bt.link.computeThickness();switch(bt.Nc){case 8:yt+=Vt;break;case 2:xt+=Vt;break;case 1:ft+=Vt;break;default:case 4:ut+=Vt}}}var zt=Ct=0,$t=1,ie=bt=0;for(Vt=0;Vt<z.length;Vt++){var oe=z[Vt];if(oe!==null){if(Ct!==oe.Nc){switch(Ct=oe.Nc,Ct){case 8:var de=tt;zt=lt;break;case 2:de=lt,zt=rt;break;case 1:de=rt,zt=ot;break;default:case 4:de=ot,zt=tt}switch(bt=zt.x-de.x,ie=zt.y-de.y,Ct){case 8:yt>Math.abs(bt)?($t=Math.abs(bt)/yt,yt=Math.abs(bt)):$t=1;break;case 2:xt>Math.abs(ie)?($t=Math.abs(ie)/xt,xt=Math.abs(ie)):$t=1;break;case 1:ft>Math.abs(bt)?($t=Math.abs(bt)/ft,ft=Math.abs(bt)):$t=1;break;default:case 4:ut>Math.abs(ie)?($t=Math.abs(ie)/ut,ut=Math.abs(ie)):$t=1}zt=0}var ke=oe.Zo;if(E===Hv){switch(oe=oe.link.computeThickness(),oe*=$t,ke.set(de),Ct){case 8:ke.x=de.x+bt/2+yt/2-zt-oe/2;break;case 2:ke.y=de.y+ie/2+xt/2-zt-oe/2;break;case 1:ke.x=de.x+bt/2-ft/2+zt+oe/2;break;default:case 4:ke.y=de.y+ie/2-ut/2+zt+oe/2}zt+=oe}else{var Hn=.5;E===Vm&&(Hn=(oe.Uo+1)/(oe.Gl+1)),ke.x=de.x+bt*Hn,ke.y=de.y+ie*Hn}}}for(At.free(rt),At.free(ot),At.free(tt),At.free(lt),de=a.pe,z=0;z<de.length;z++)E=de[z],E!==null&&(E.Ju=a.computeEndSegmentLength(E));a.ap=x,Te.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}Gc.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},Gc.prototype.computeEndSegmentLength=function(a){var y=a.link,x=y.computeEndSegmentLength(this.node,this.port,lr,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)},Gc.className="Knot";function ty(a,y,x){this.link=a,this.angle=y,this.Nc=x,this.hv=new At,this.Gl=this.Uo=0,this.Zo=new At,this.Ju=0}ty.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.Nc.toString()+":"+this.Uo.toString()+"/"+this.Gl.toString()+" "+this.Zo.toString()+" "+this.Ju.toString()+" "+this.hv.toString()},ty.className="LinkInfo";function Ko(a){Wi(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new At(0,0).freeze(),this.vn=!0,this.Em=this.un=null,this.xn=!1,this.j=null,a&&Object.assign(this,a)}Ko.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},Ko.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},Ko.prototype.qb=function(){},Ko.prototype.toString=function(){var a=ni(this.constructor);return a+="(",this.group!==null&&(a+=" in "+this.group),this.diagram!==null&&(a+=" for "+this.diagram),a+")"},Ko.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())}}},Ko.prototype.createNetwork=function(){return new Do(this)},Ko.prototype.makeNetwork=function(a){var y=this.createNetwork();return a instanceof be?(y.lg(a.nodes,!0),y.lg(a.links,!0)):a instanceof rr?y.lg(a.memberParts):y.lg(a.iterator),y},Ko.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")}},Ko.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()}},Ko.prototype.doLayout=function(a){var y=new gn;a instanceof be?(pd(this,y,a.nodes,!0,this.rh,!0,!1,!0),pd(this,y,a.parts,!0,this.rh,!0,!1,!0)):a instanceof rr?pd(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},Ko.prototype.doMinimalNoNetworkLayout=function(a){var y=Math.ceil(Math.sqrt(a.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var x=this.arrangementOrigin.x,E=x,b=this.arrangementOrigin.y,z=0,tt=0;for(a=a.iterator;a.next();){var rt=a.value;gp(rt);var ot=rt.measuredBounds,lt=ot.width;ot=ot.height,rt.moveTo(E,b),rt instanceof rr&&(rt.rh=!1),E+=Math.max(lt,50)+20,tt=Math.max(tt,Math.max(ot,50)),z>=y-1?(z=0,E=x,b+=tt+20,tt=0):z++}},Ko.prototype.doMinimalNetworkLayout=function(){var a=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var y=this.arrangementOrigin.x,x=y,E=this.arrangementOrigin.y,b=0,z=0,tt=this.network.vertexes.iterator;tt.next();){var rt=tt.value.node;if(!(rt===null||rt instanceof kn)&&(gp(rt),this.rh(rt))){var ot=rt.measuredBounds,lt=ot.width;ot=ot.height,rt.moveTo(x,E),rt instanceof rr&&(rt.rh=!1),x+=Math.max(lt,50)+20,z=Math.max(z,Math.max(ot,50)),b>=a-1?(b=0,x=y,E+=z+20,z=0):b++}}},Ko.prototype.rh=function(a){return!!(!a.location.w()||a instanceof rr&&a.rh)};function pd(a,y,x,E,b,z,tt,rt){for(x=x.iterator;x.next();){var ot=x.value;E&&!ot.isTopLevel||b!==null&&!b(ot)||!ot.canLayout()||(z&&ot instanceof qn?ot.isLinkLabel||(ot instanceof rr&&ot.layout===null?pd(a,y,ot.memberParts,!1,b,z,tt,rt):(gp(ot),y.add(ot))):tt&&ot instanceof kn?y.add(ot):!rt||!ot.Zc()||ot instanceof qn||(gp(ot),y.add(ot)))}}function gp(a){var y=a.actualBounds;(y.width===0||y.height===0||isNaN(y.width)||isNaN(y.height))&&a.Va()}Ko.prototype.ni=function(a,y){var x=this.boundsComputation;return x!==null?(y||(y=new Te),x(a,this,y)):y?(y.set(a.actualBounds),y):a.actualBounds},Ko.prototype.ex=function(a){var y=new gn;return a instanceof be?(pd(this,y,a.nodes,!0,null,!0,!0,!0),pd(this,y,a.links,!0,null,!0,!0,!0),pd(this,y,a.parts,!0,null,!0,!0,!0)):a instanceof rr?pd(this,y,a.memberParts,!1,null,!0,!0,!0):pd(this,y,a.iterator,!1,null,!0,!0,!0),y},Ko.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(jr),(isNaN(x.x)||isNaN(x.y))&&x.set(a),a=y.padding,x.x+=a.left,x.y+=a.top),x}return a},Se.Object.defineProperties(Ko.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())}}}),Ko.prototype.collectParts=Ko.prototype.ex,Ko.prototype.getLayoutBounds=Ko.prototype.ni,Ko.prototype.invalidateLayout=Ko.prototype.C,Ko.className="Layout";function Do(a){Wi(this),this.Sc=a,this.wf=new gn,this.ye=new gn,this.Es=new Be,this.zs=new Be}Do.prototype.clear=function(){if(this.wf)for(var a=this.wf.iterator;a.next();)a.value.clear();if(this.ye)for(a=this.ye.iterator;a.next();)a.value.clear();this.wf=new gn,this.ye=new gn,this.Es=new Be,this.zs=new Be},Do.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutNetwork"+(this.layout!==null?"("+this.layout.toString()+")":"");if(0>=a)return y;if(y+=" vertexes: "+this.wf.count+" edges: "+this.ye.count,1<a){for(var x=this.wf.iterator;x.next();)y+=`
`+x.value.toString(a-1);for(x=this.ye.iterator;x.next();)y+=`
`+x.value.toString(a-1)}return y},Do.prototype.createVertex=function(){return new Ca(this)},Do.prototype.createEdge=function(){return new qs(this)},Do.prototype.lg=function(a,y,x){if(a!==null){for(y===void 0&&(y=!1),x===void 0&&(x=null),x===null&&(x=function(tt){if(tt instanceof qn)return!tt.isLinkLabel;if(tt instanceof kn){var rt=tt.fromNode;return rt===null||rt.isLinkLabel?!1:(tt=tt.toNode,!(tt===null||tt.isLinkLabel))}return!1}),a=a.iterator;a.next();){var E=a.value;if(E instanceof qn&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)){if(E instanceof rr&&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 kn&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)&&this.Lo(E)===null){var z=E.fromNode;b=E.toNode,z!==null&&b!==null&&z!==b&&(z=this.findGroupVertex(z),b=this.findGroupVertex(b),z!==null&&b!==null&&this.Zj(z,b,E))}}},Do.prototype.findGroupVertex=function(a){if(a===null)return null;var y=a.findVisibleNode();if(y===null)return null;if(a=this.ki(y),a!==null)return a;for(y=y.containingGroup;y!==null;){if(a=this.ki(y),a!==null)return a;y=y.containingGroup}return null},wt=Do.prototype,wt.dh=function(a){if(a!==null){this.wf.add(a);var y=a.node;y!==null&&this.Es.add(y,a),a.network=this}},wt.Bl=function(a){if(a===null)return null;var y=this.ki(a);return y===null&&(y=this.createVertex(),y.node=a,this.dh(y)),y},wt.Iu=function(a){if(a!==null&&lS(this,a)){for(var y=a.tg,x=y.count-1;0<=x;x--){var E=y.M(x);this.Mj(E)}for(y=a.mg,a=y.count-1;0<=a;a--)x=y.M(a),this.Mj(x)}};function lS(a,y){if(y===null)return!1;var x=a.wf.remove(y);return x&&(y=y.node,y!==null&&a.Es.remove(y)),x}wt.Zy=function(a){a!==null&&(a=this.ki(a),a!==null&&this.Iu(a))},wt.ki=function(a){return a===null?null:this.Es.I(a)},wt.Bo=function(a){if(a!==null){ey(this,a);var y=a.toVertex;y!==null&&y.Cl(a),y=a.fromVertex,y!==null&&y.zl(a)}};function ey(a,y){if(y!==null){a.ye.add(y);var x=y.link;x!==null&&a.Lo(x)===null&&a.zs.add(x,y),y.network=a}}wt.Dy=function(a){if(a===null)return null;var y=a.fromNode,x=a.toNode,E=this.Lo(a);return E===null?(E=this.createEdge(),E.link=a,y!==null&&(E.fromVertex=this.Bl(y)),x!==null&&(E.toVertex=this.Bl(x)),this.Bo(E)):(y!==null?E.fromVertex=this.Bl(y):E.fromVertex=null,x!==null?E.toVertex=this.Bl(x):E.toVertex=null),E},wt.Mj=function(a){if(a!==null){var y=a.toVertex;y!==null&&y.Kl(a),y=a.fromVertex,y!==null&&y.Jl(a),ny(this,a)}};function ny(a,y){y!==null&&a.ye.remove(y)&&(y=y.link,y!==null&&a.zs.remove(y))}wt.Yy=function(a){a!==null&&(a=this.Lo(a),a!==null&&this.Mj(a))},wt.Lo=function(a){return a===null?null:this.zs.I(a)},wt.Zj=function(a,y,x){if(a===null||y===null)return null;if(a.network===this&&y.network===this){var E=this.createEdge();return E.link=x,E.fromVertex=a,E.toVertex=y,this.Bo(E),E}return null},wt.gm=function(a){if(a!==null){var y=a.fromVertex,x=a.toVertex;y!==null&&x!==null&&(y.Jl(a),x.Kl(a),a.gm(),y.Cl(a),x.zl(a))}},wt.Ko=function(){for(var a=Jn(),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]);li(a)},Do.prototype.deleteArtificialVertexes=function(){for(var a=Jn(),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=Jn(),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]);li(a),li(y)};function Nx(a){for(var y=Jn(),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]);li(y)}Do.prototype.Zx=function(a){a===void 0&&(a=!0),a&&(this.deleteArtificialVertexes(),Nx(this),this.Ko()),a=new cn;for(var y=!0;y;){y=!1;for(var x=this.wf.iterator;x.next();){var E=x.value;if(0<E.tg.count||0<E.mg.count){y=this.layout.createNetwork(),a.add(y),iy(this,y,E),y=!0;break}}}return a.sort(function(b,z){return b===null||z===null||b===z?0:z.vertexes.count-b.vertexes.count}),a};function iy(a,y,x){if(x!==null&&x.network!==y){lS(a,x),y.dh(x);for(var E=x.sourceEdges;E.next();){var b=E.value;b.network!==y&&(ny(a,b),ey(y,b),iy(a,y,b.fromVertex))}for(E=x.destinationEdges;E.next();)x=E.value,x.network!==y&&(ny(a,x),ey(y,x),iy(a,y,x.toVertex))}}Do.prototype.dz=function(){for(var a=new gn,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},Se.Object.defineProperties(Do.prototype,{layout:{get:function(){return this.Sc},set:function(a){a!==null&&(this.Sc=a)}},vertexes:{get:function(){return this.wf}},edges:{get:function(){return this.ye}}}),Do.prototype.findAllParts=Do.prototype.dz,Do.prototype.splitIntoSubNetworks=Do.prototype.Zx,Do.prototype.deleteSelfEdges=Do.prototype.Ko,Do.prototype.reverseEdge=Do.prototype.gm,Do.prototype.linkVertexes=Do.prototype.Zj,Do.prototype.findEdge=Do.prototype.Lo,Do.prototype.deleteLink=Do.prototype.Yy,Do.prototype.deleteEdge=Do.prototype.Mj,Do.prototype.addLink=Do.prototype.Dy,Do.prototype.addEdge=Do.prototype.Bo,Do.prototype.findVertex=Do.prototype.ki,Do.prototype.deleteNode=Do.prototype.Zy,Do.prototype.deleteVertex=Do.prototype.Iu,Do.prototype.addNode=Do.prototype.Bl,Do.prototype.addVertex=Do.prototype.dh,Do.prototype.addParts=Do.prototype.lg,Do.className="LayoutNetwork";function Ca(a){Wi(this),this.ob=a,this.j=new Te(0,0,10,10).freeze(),this.o=new At(5,5).freeze(),this.Sh=this.ub=null,this.tg=new cn,this.mg=new cn}Ca.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new cn,this.mg=new cn},Ca.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutVertex#"+zi(this);if(0<a&&(y+=this.node!==null?"("+this.node.toString()+")":"",1<a)){a="";for(var x=!0,E=this.tg.iterator;E.next();){var b=E.value;x?x=!1:a+=",",a+=b.toString(0)}for(b="",x=!0,E=this.mg.iterator;E.next();){var z=E.value;x?x=!1:b+=",",b+=z.toString(0)}y+=" sources: "+a+" destinations: "+b}return y},Ca.prototype.commit=function(){var a=this.ub;if(a!==null){var y=this.bounds,x=a.bounds;Re(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 rr)){x=Te.alloc(),a.Va();var E=this.network.layout.ni(a,x),b=a.locationObject.ga(dr);if(E.w()&&b.w()){a.moveTo(y.x+this.focusX-(b.x-E.x),y.y+this.focusY-(b.y-E.y)),Te.free(x);return}Te.free(x)}a.moveTo(y.x,y.y)}},Ca.prototype.Cl=function(a){a!==null&&(this.tg.contains(a)||this.tg.add(a))},Ca.prototype.Kl=function(a){a!==null&&this.tg.remove(a)},Ca.prototype.zl=function(a){a!==null&&(this.mg.contains(a)||this.mg.add(a))},Ca.prototype.Jl=function(a){a!==null&&this.mg.remove(a)};function ry(a,y){return a=a.Sh,y=y.Sh,a?y?(a=a.text,y=y.text,a<y?-1:a>y?1:0):1:y!==null?-1:0}Se.Object.defineProperties(Ca.prototype,{sourceEdgesArrayAccess:{get:function(){return this.tg._dataArray}},destinationEdgesArrayAccess:{get:function(){return this.mg._dataArray}},data:{get:function(){return this.ub},set:function(a){if(this.ub=a,a!==null&&a.bounds){var y=a.bounds;a=y.x;var x=y.y,E=y.width;y=y.height,this.o.h(E/2,y/2),this.j.h(a,x,E,y)}}},node:{get:function(){return this.Sh},set:function(a){if(this.Sh!==a){this.Sh=a,a.Va();var y=this.network.layout,x=Te.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),Te.free(x),!(a instanceof rr)&&(a=a.locationObject.ga(dr),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 gn,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new gn,y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new gn,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 cn,y=this.sourceEdges;y.next();)a.add(y.value);for(y=this.destinationEdges;y.next();)a.add(y.value);return a.iterator}},edgesCount:{get:function(){return this.tg.count+this.mg.count}}}),Ca.prototype.deleteDestinationEdge=Ca.prototype.Jl,Ca.prototype.addDestinationEdge=Ca.prototype.zl,Ca.prototype.deleteSourceEdge=Ca.prototype.Kl,Ca.prototype.addSourceEdge=Ca.prototype.Cl,Ca.className="LayoutVertex",Ca.standardComparer=ry,Ca.smartComparer=function(a,y){if(a!==null){if(y!==null){a=a.Sh;var x=y.Sh;if(a!==null){if(x!==null){for(y=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),a=x.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),x=0;x<y.length;x++)if(a[x]!==""&&a[x]!==void 0){var E=parseFloat(y[x]),b=parseFloat(a[x]);if(isNaN(E))if(isNaN(b)){if(y[x].localeCompare(a[x])!==0)return y[x].localeCompare(a[x])}else return 1;else{if(isNaN(b))return-1;if(E-b!==0)return E-b}}else if(y[x]!=="")return 1;return a[x]!==""&&a[x]!==void 0?-1:0}return 1}return x!==null?-1:0}return 1}return y!==null?-1:0};function qs(a){Wi(this),this.nb=a,this.qd=this.kd=this.$k=this.ub=null}qs.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},qs.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutEdge#"+zi(this);return 0<a&&(y+=this.$k!==null?"("+this.$k.toString()+")":"",1<a&&(y+=" "+(this.kd?this.kd.toString():"null")+" --> "+(this.qd?this.qd.toString():"null"))),y},qs.prototype.gm=function(){var a=this.kd;this.kd=this.qd,this.qd=a},qs.prototype.commit=function(){},qs.prototype.Ax=function(a){return this.qd===a?this.kd:this.kd===a?this.qd:null},Se.Object.defineProperties(qs.prototype,{network:{get:function(){return this.nb},set:function(a){this.nb=a}},data:{get:function(){return this.ub},set:function(a){this.ub!==a&&(this.ub=a)}},link:{get:function(){return this.$k},set:function(a){this.$k!==a&&(this.$k=a)}},fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}}}),qs.prototype.getOtherVertex=qs.prototype.Ax,qs.className="LayoutEdge";function Va(a){Ko.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new nn(NaN,NaN).freeze(),this.tf=new nn(10,10).freeze(),this.Jb=pp,this.Rb=o0,this.nd=mp,this.hd=uS,a&&Object.assign(this,a)}Le(Va,Ko),Va.prototype.cloneProtected=function(a){Ko.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},Va.prototype.qb=function(a){a.classType===Va?a===mp||a===s0||a===oy||a===a0?this.sorting=a:a===o0||a===gu?this.arrangement=a:a===pp||a===r0?this.alignment=a:Gt("Unknown enum value: "+a):Ko.prototype.qb.call(this,a)},Va.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 rr)for(E=E.memberParts;E.next();)y.remove(E.value)}else y.remove(E)}var b=y.Fa();if(b.length!==0){switch(this.sorting){case a0:b.reverse();break;case mp:b.sort(this.comparer);break;case s0:b.sort(this.comparer),b.reverse()}var z=this.wrappingColumn;isNaN(z)&&(z=0);var tt=this.wrappingWidth;switch(isNaN(tt)&&a!==null?(y=a.padding,tt=Math.max(a.viewportBounds.width-y.left-y.right,0)):tt=Math.max(this.wrappingWidth,0),0>=z&&0>=tt&&(z=1),y=this.spacing.width,isFinite(y)||(y=0),x=this.spacing.height,isFinite(x)||(x=0),a!==null&&a.Ea("Layout"),E=[],this.alignment){case r0:var rt=y,ot=x,lt=Te.alloc(),ut=Math.max(this.cellSize.width,1);if(!isFinite(ut))for(var ft=ut=0;ft<b.length;ft++){var yt=this.ni(b[ft],lt);ut=Math.max(ut,yt.width)}if(ut=Math.max(ut+rt,1),ft=Math.max(this.cellSize.height,1),!isFinite(ft))for(yt=ft=0;yt<b.length;yt++){var xt=this.ni(b[yt],lt);ft=Math.max(ft,xt.height)}ft=Math.max(ft+ot,1),yt=this.arrangement;for(var Ct=xt=this.arrangementOrigin.x,bt=this.arrangementOrigin.y,Vt=0,zt=0,$t=0;$t<b.length;$t++){var ie=b[$t],oe=this.ni(ie,lt),de=Math.ceil((oe.width+rt)/ut)*ut,ke=Math.ceil((oe.height+ot)/ft)*ft;switch(yt){case gu:var Hn=Math.abs(Ct-oe.width);break;default:Hn=Ct+oe.width}switch((0<z&&Vt>z-1||0<tt&&0<Vt&&Hn-xt>tt)&&(E.push(new Te(0,bt,tt+rt,zt)),Vt=0,Ct=xt,bt+=zt,zt=0),zt=Math.max(zt,ke),yt){case gu:oe=-oe.width;break;default:oe=0}switch(ie.moveTo(Ct+oe,bt),yt){case gu:Ct-=de;break;default:Ct+=de}Vt++}E.push(new Te(0,bt,tt+rt,zt)),Te.free(lt);break;case pp:for(ot=tt,ut=z,ft=y,yt=x,tt=Te.alloc(),xt=Math.max(this.cellSize.width,1),z=bt=lt=0,rt=At.alloc(),Ct=0;Ct<b.length;Ct++)zt=b[Ct],Vt=this.ni(zt,tt),zt=Oh(zt,zt.locationObject,zt.locationSpot,rt),lt=Math.max(lt,zt.x),bt=Math.max(bt,Vt.width-zt.x),z=Math.max(z,zt.y);switch(Ct=this.arrangement,Ct){case gu:lt+=ft;break;default:bt+=ft}xt=isFinite(xt)?Math.max(xt+ft,1):Math.max(lt+bt,1);var ci=zt=this.arrangementOrigin.x;for($t=this.arrangementOrigin.y,bt=0,ot>=lt&&(ot-=lt),lt=ie=0,de=Math.max(this.cellSize.height,1),oe=z=0,ke=!0,Vt=At.alloc(),Hn=0;Hn<b.length;Hn++){var ai=b[Hn],Fn=this.ni(ai,tt),tn=Oh(ai,ai.locationObject,ai.locationSpot,rt);if(0<bt)switch(Ct){case gu:ci=(ci-zt-(Fn.width-tn.x))/xt,ci=_t.$(Math.round(ci),ci)?Math.round(ci):Math.floor(ci),ci=ci*xt+zt;break;default:ci=(ci-zt+tn.x)/xt,ci=_t.$(Math.round(ci),ci)?Math.round(ci):Math.ceil(ci),ci=ci*xt+zt}else switch(Ct){case gu:ie=ci+tn.x+Fn.width;break;default:ie=ci-tn.x}switch(Ct){case gu:var nr=-(ci+tn.x)+ie;break;default:nr=ci+Fn.width-tn.x-ie}if(0<ut&&bt>ut-1||0<ot&&0<bt&&nr>ot){for(E.push(new Te(0,ke?$t-z:$t,ot+ft,oe+z+yt)),ci=0;ci<bt&&Hn!==bt;ci++){nr=b[Hn-bt+ci];var Ji=Oh(nr,nr.locationObject,nr.locationSpot,Vt);nr.moveTo(nr.position.x,nr.position.y+z-Ji.y)}oe+=yt,$t=ke?$t+oe:$t+(oe+z),bt=oe=z=0,ci=zt,ke=!1}switch(ci===zt&&(lt=Ct===gu?Math.max(lt,Fn.width-tn.x):Math.min(lt,-tn.x)),z=Math.max(z,tn.y),oe=Math.max(oe,Fn.height-tn.y),isFinite(de)&&(oe=Math.max(oe,Math.max(Fn.height,de)-tn.y)),ke?ai.moveTo(ci-tn.x,$t-tn.y):ai.moveTo(ci-tn.x,$t),Ct){case gu:ci-=tn.x+ft;break;default:ci+=Fn.width-tn.x+ft}bt++}if(E.push(new Te(0,$t,ot+ft,(ke?oe:oe+z)+yt)),b.length!==bt)for(ot=0;ot<bt;ot++)ut=b[b.length-bt+ot],ft=Oh(ut,ut.locationObject,ut.locationSpot,rt),ut.moveTo(ut.position.x,ut.position.y+z-ft.y);if(At.free(rt),At.free(Vt),Ct===gu)for(b=0;b<E.length;b++)z=E[b],z.width+=lt,z.x-=lt;else for(b=0;b<E.length;b++)z=E[b],z.x>lt&&(z.width+=z.x-lt,z.x=lt);Te.free(tt)}for(rt=z=tt=b=0;rt<E.length;rt++)ot=E[rt],b=Math.min(b,ot.x),tt=Math.min(tt,ot.y),z=Math.max(z,ot.x+ot.width);this.arrangement===gu?this.commitLayers(E,new At(b+y/2-(z+b),tt-x/2)):this.commitLayers(E,new At(b-y/2,tt-x/2)),a!==null&&a.eb("Layout"),this.isValidLayout=!0}},Va.prototype.commitLayers=function(){};function uS(a,y){return a=a.text,y=y.text,a<y?-1:a>y?1:0}Se.Object.defineProperties(Va.prototype,{wrappingWidth:{get:function(){return this.zo},set:function(a){this.zo!==a&&(0<a||isNaN(a))&&(this.zo=a,this.isViewportSized=isNaN(a),this.C())}},wrappingColumn:{get:function(){return this.yo},set:function(a){this.yo!==a&&(0<a||isNaN(a))&&(this.yo=a,this.C())}},cellSize:{get:function(){return this.yg},set:function(a){this.yg.D(a)||(this.yg.assign(a),this.C())}},spacing:{get:function(){return this.tf},set:function(a){this.tf.D(a)||(this.tf.assign(a),this.C())}},alignment:{get:function(){return this.Jb},set:function(a){this.Jb===a||a!==pp&&a!==r0||(this.Jb=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==o0&&a!==gu||(this.Rb=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==oy&&a!==a0&&a!==mp&&a!==s0||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}}});var r0=new en(Va,"Position",0),pp=new en(Va,"Location",1),o0=new en(Va,"LeftToRight",2),gu=new en(Va,"RightToLeft",3),oy=new en(Va,"Forward",4),a0=new en(Va,"Reverse",5),mp=new en(Va,"Ascending",6),s0=new en(Va,"Descending",7);Va.className="GridLayout",Va.standardComparer=uS,Va.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},Va.Position=r0,Va.Location=pp,Va.LeftToRight=o0,Va.RightToLeft=gu,Va.Forward=oy,Va.Reverse=a0,Va.Ascending=mp,Va.Descending=s0;function xo(){this.On=new gn,this.Dn=new gn,this.Pa=new gn,this.cf=new Be,this.bf=new Be,this.aj=new Be,this.H=null,this.tp=!1}wt=xo.prototype,wt.clear=function(){this.On.clear(),this.Dn.clear(),this.Pa.clear(),this.cf.clear(),this.bf.clear(),this.aj.clear()},wt.Xe=function(a){this.H=a},wt.oi=function(a){if(a instanceof qn){if(this.On.add(a),a instanceof rr){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 kn?this.Dn.add(a):a instanceof Qr||this.Pa.add(a);y=a.data,y===null||a instanceof Qr||(a instanceof kn?this.bf.add(y,a):this.cf.add(y,a))},wt.pc=function(a){if(a.Ej(),a instanceof qn){if(this.On.remove(a),a instanceof rr){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 kn?this.Dn.remove(a):a instanceof Qr||this.Pa.remove(a);y=a.data,y===null||a instanceof Qr||(a instanceof kn?this.bf.remove(y):this.cf.remove(y))},wt.Wd=function(){var a=this.H;if(a!==null){for(var y=a.nodeTemplateMap.iterator;y.next();){var x=y.value,E=y.key;(!x.Zc()||x instanceof rr)&&Gt('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 rr||Gt('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 kn||Gt('Invalid link template in Diagram.linkTemplateMap: template for "'+E+'" must be a Link, not a normal Node or simple Part: '+x);for(y=Jn(),x=a.selection.iterator;x.next();)(E=x.value.data)&&y.push(E);for(x=Jn(),a=a.highlighteds.iterator;a.next();)(E=a.value.data)&&x.push(E);for(a=Jn(),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]);li(y),li(x),li(a)}},xo.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},xo.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&&xf(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&&(jl(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)}}xo.prototype.insertLink=function(){return null},xo.prototype.resolveReferencesForData=function(){},xo.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,Gn('No Group template found for category "'+x+'"'),Gn(" Using default group template")),y=a.ly))):(y=a.nodeTemplateMap.I(x),y===null&&(y=a.nodeTemplateMap.I(""),y===null&&(fS||(fS=!0,Gn('No Node template found for category "'+x+'"'),Gn(" Using default node template")),y=a.ny))),y}xo.prototype.getLinkCategoryForData=function(){return""},xo.prototype.setLinkCategoryForData=function(){},xo.prototype.setFromNodeForLink=function(){},xo.prototype.setToNodeForLink=function(){},xo.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,Gn('No Link template found for category "'+a+'"'),Gn(" Using default link template")),x=y.my)),x},xo.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},xo.prototype.Gs=function(a){var y=this;a.forEach(function(x){y.ip(x)})},xo.prototype.ip=function(a){a=this.Lc(a),a!==null&&(Ng(this.diagram,a,!1),this.unresolveReferencesForPart(a))},xo.prototype.unresolveReferencesForPart=function(){},xo.prototype.removeDataForLink=function(){},xo.prototype.findPartForKey=function(a){return a==null?null:(a=this.H.model.hc(a),a!==null?this.cf.I(a):null)},xo.prototype.Vb=function(a){return a==null||(a=this.H.model.hc(a),a===null)?null:(a=this.cf.I(a),a instanceof qn?a:null)},xo.prototype.findLinkForKey=function(){return null},wt=xo.prototype,wt.Lc=function(a){if(a===null)return null;var y=this.cf.I(a);return y!==null?y:y=this.bf.I(a)},wt.ii=function(a){return a===null?null:(a=this.cf.I(a),a instanceof qn?a:null)},wt.Kc=function(a){return a===null?null:this.bf.I(a)},wt.ms=function(a){for(var y=0;y<arguments.length;++y);y=new gn;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(Re(tt)&&ay(this,b,tt)){y.add(E);break}}}return y.iterator},wt.ls=function(a){for(var y=0;y<arguments.length;++y);y=new gn;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(Re(tt)&&ay(this,b,tt)){y.add(E);break}}}return y.iterator};function ay(a,y,x){for(var E in x){var b=y[E],z=x[E];if($e(z)){if(!$e(b)||b.length<z.length)return!1;for(var tt=0;tt<b.length;tt++){var rt=z[tt];if(rt!==void 0&&!cS(a,b[tt],rt))return!1}}else if(!cS(a,b,z))return!1}return!0}function cS(a,y,x){if(typeof x=="function"){if(!x(y))return!1}else if(x instanceof RegExp){if(!y||!x.test(y.toString()))return!1}else if(Re(y)&&Re(x)){if(!ay(a,y,x))return!1}else if(y!==x)return!1;return!0}xo.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===pr){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===uo){var tt=a.newValue;E==="nodeDataArray"&&Re(tt)&&hS(this,tt),y.isModified=!0}else if(x===yo){var rt=a.oldValue;E==="nodeDataArray"&&Re(rt)&&this.ip(rt),y.isModified=!0}else x===$i&&(E==="SourceChanged"?a.object!==null?this.updateDataBindings(a.object,a.propertyName):(this.rp(),this.updateAllTargetBindings()):E==="ModelDisplaced"&&this.Wd());else if(x===pr){var ot=a.propertyName,lt=a.object;lt===y.model?(ot==="nodeKeyProperty"||ot==="nodeCategoryProperty")&&(y.undoManager.isUndoingRedoing||this.Wd()):this.updateDataBindings(lt,ot),y.isModified=!0}else if(x===uo||x===yo){var ut=a.change===uo,ft=ut?a.newParam:a.oldParam,yt=ut?a.newValue:a.oldValue,xt=this.aj.I(a.object);if(Array.isArray(xt))for(a=0;a<xt.length;a++){var Ct=xt[a];if(ut)Fm(Ct,yt,ft,!0);else if(!(0>ft)){var bt=ft+Qg(Ct);Ct.pc(bt,!0),xv(Ct,bt,ft)}}y.isModified=!0}}finally{y.aa=!0}}}}},xo.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)},xo.prototype.rp=function(){for(var a=this.H.model,y=new gn,x=a.nodeDataArray,E=0;E<x.length;E++)y.add(x[E]);var b=[];for(this.nodes.each(function(tt){tt.data===null||y.contains(tt.data)||b.push(tt.data)}),this.parts.each(function(tt){tt.data===null||y.contains(tt.data)||b.push(tt.data)}),b.forEach(function(tt){ES(a,tt,!1)}),E=0;E<x.length;E++){var z=x[E];this.Lc(z)===null&&CS(a,z,!1)}for(this.refreshDataBoundLinks(),x=this.parts.iterator;x.next();)x.value.updateRelationshipsFromData();for(x=this.nodes.iterator;x.next();)x.value.updateRelationshipsFromData();for(x=this.links.iterator;x.next();)x.value.updateRelationshipsFromData()},xo.prototype.refreshDataBoundLinks=function(){},xo.prototype.updateRelationshipsFromData=function(){},xo.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=Jn()),x.push(tt))}if(x!==null)break}if(x!==null){for(E=0;E<x.length;E++)x[E].La(y);li(x)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(y)}};function sy(a,y){var x=y.Hh;if($e(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){$d(y,function(tt){tt=tt.O.s;for(var rt=tt.length,ot=0;ot<rt;ot++)Og(x,tt[ot])});var E=y.Hh;if($e(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}}}}xo.prototype.Kj=function(a,y,x){x===void 0&&(x=!1);var E=new Be;if($e(a))for(var b=0;b<a.length;b++)l0(this,a[b],y,E,x);else for(a=a.iterator;a.next();)l0(this,a.value,y,E,x);if(y!==null){x=y.model,a=y.toolManager.findTool("Dragging"),a=a!==null?a.dragOptions.dragsLink:y.Wm.dragsLink,b=new gn;for(var z=new Be,tt=E.iterator;tt.next();){var rt=tt.value;if(rt instanceof kn)a||rt.fromNode!==null&&rt.toNode!==null||b.add(rt);else if(rt instanceof qn&&rt.data!==null&&x.Tl()){var ot=rt;rt=tt.key;var lt=rt.pg();lt!==null&&(lt=E.I(lt),lt!==null?(x.qe(ot.data,x.wa(lt.data)),ot=y.Kc(ot.data),rt=rt.kh(),rt!==null&&ot!==null&&z.add(rt,ot)):x.qe(ot.data,void 0))}}if(0<b.count&&y.Is(b,!1),0<z.count)for(x=z.iterator;x.next();)E.add(x.key,x.value)}if(y!==null&&this.H!==null&&(y=y.model,x=y.afterCopyFunction,x!==null)){var ut=new Be;E.each(function(ft){ft.key.data!==null&&ut.add(ft.key.data,ft.value.data)}),x(ut,y,this.H.model)}for(y=E.iterator;y.next();)y.value.La();return E};function l0(a,y,x,E,b){if(y===null||b&&!y.canCopy())return null;if(E.contains(y))return E.I(y);var z=a.copyPartData(y,x);if(!(z instanceof Ai))return null;if(z.isSelected=!1,z.isHighlighted=!1,E.add(y,z),y instanceof qn){for(var tt=y.linksConnected;tt.next();){var rt=tt.value;if(rt.fromNode===y){var ot=E.I(rt);ot!==null&&(ot.fromNode=z)}rt.toNode===y&&(rt=E.I(rt),rt!==null&&(rt.toNode=z))}if(y instanceof rr&&z instanceof rr)for(y=y.memberParts;y.next();)tt=l0(a,y.value,x,E,b),tt instanceof kn||tt===null||(tt.containingGroup=z)}else if(y instanceof kn&&z instanceof kn)for(tt=y.fromNode,tt!==null&&(tt=E.I(tt),tt!==null&&(z.fromNode=tt)),tt=y.toNode,tt!==null&&(tt=E.I(tt),tt!==null&&(z.toNode=tt)),y=y.labelNodes;y.next();)tt=l0(a,y.value,x,E,b),tt!==null&&tt instanceof qn&&(tt.labeledLink=z);return z}xo.prototype.copyPartData=function(a,y){var x=null,E=a.data;if(E!==null&&y!==null){var b=y.model;a instanceof kn||(E=b.copyNodeData(E),Re(E)&&(b.xf(E),x=y.Lc(E)))}else jl(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 kn||(b=y.copyNodeData(E)),Re(b)&&(x.data=b)));return x},Se.Object.defineProperties(xo.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}}}),xo.prototype.updateAllRelationshipsFromData=xo.prototype.rp,xo.prototype.findLinksByExample=xo.prototype.ls,xo.prototype.findNodesByExample=xo.prototype.ms,xo.prototype.findLinkForData=xo.prototype.Kc,xo.prototype.findNodeForData=xo.prototype.ii,xo.prototype.findPartForData=xo.prototype.Lc,xo.prototype.findNodeForKey=xo.prototype.Vb,xo.prototype.removeModeledPart=xo.prototype.ip,xo.prototype.removeModeledParts=xo.prototype.Gs,xo.prototype.rebuildParts=xo.prototype.Wd;var fS=!1,gS=!1,pS=!1;xo.className="PartManager";function Da(a){xo.apply(this,arguments)}Le(Da,xo),Da.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray),mS(this,a.linkDataArray)},Da.prototype.addModeledParts=function(a){for(xo.prototype.addModeledParts.call(this,a,!1),a=this.links.iterator;a.next();)Zf(a.value);xf(this.diagram,!1)};function mS(a,y){y.forEach(function(x){vS(a,x)}),xf(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){jl(E);var b=E.copy();if(b!==null){E=a.diagram.skipsModelSourceBindings,a.diagram.skipsModelSourceBindings=!0,b.Tf=x,b.ub=y,x=a.diagram.model;var z=c0(x,y,!0);z!==""&&(b.fromPortId=z),z=cl(x,y,!0),z!==void 0&&(z=a.Vb(z),z instanceof qn&&(b.fromNode=z)),z=c0(x,y,!1),z!==""&&(b.toPortId=z),z=cl(x,y,!1),z!==void 0&&(z=a.Vb(z),z instanceof qn&&(b.toNode=z)),x=x.Ef(y),Array.isArray(x)&&x.forEach(function(tt){tt=a.Vb(tt),tt!==null&&(tt.labeledLink=b)}),a.tp&&(b.Jg="Tool"),a.diagram.add(b),b.ub=null,b.data=y,a.diagram.skipsModelSourceBindings=E}}}}Da.prototype.removeAllModeledParts=function(){var a=this.diagram.model;yS(this,a.linkDataArray),this.Gs(a.nodeDataArray)};function yS(a,y){y.forEach(function(x){a.ip(x)})}Da.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ps(a)},Da.prototype.setLinkCategoryForData=function(a,y){return this.diagram.model.lp(a,y)},Da.prototype.setFromNodeForLink=function(a,y){var x=this.diagram.model;x.wv(a.data,x.wa(y!==null?y.data:null))},Da.prototype.setToNodeForLink=function(a,y){var x=this.diagram.model;x.Bv(a.data,x.wa(y!==null?y.data:null))},Da.prototype.removeDataForLink=function(a){this.diagram.model.bm(a.data)},Da.prototype.findPartForKey=function(a){var y=xo.prototype.findPartForKey.call(this,a);return y===null&&(a=this.diagram.model.jh(a),a!==null)?this.bf.I(a):y},Da.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.jh(a),a!==null?this.bf.I(a):null)},Da.prototype.doModelChanged=function(a){var y=this;if(xo.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===pr){if(b==="linkFromKey"){var z=this.Kc(a.object);if(z!==null){var tt=this.Vb(a.newValue);z.fromNode=tt}}else if(b==="linkToKey"){var rt=this.Kc(a.object);if(rt!==null){var ot=this.Vb(a.newValue);rt.toNode=ot}}else if(b==="linkFromPortId"){var lt=this.Kc(a.object);if(lt!==null){var ut=a.newValue;typeof ut=="string"&&(lt.fromPortId=ut)}}else if(b==="linkToPortId"){var ft=this.Kc(a.object);if(ft!==null){var yt=a.newValue;typeof yt=="string"&&(ft.toPortId=yt)}}else if(b==="nodeGroupKey"){var xt=this.Lc(a.object);if(xt!==null){var Ct=a.newValue;if(Ct!==void 0){var bt=this.Vb(Ct);bt instanceof rr?xt.containingGroup=bt:xt.containingGroup=null}else xt.containingGroup=null}}else if(b==="linkLabelKeys"){var Vt=this.Kc(a.object);if(Vt!==null){var zt=a.oldValue,$t=a.newValue;Array.isArray(zt)&&zt.forEach(function(tn){0<=$t.indexOf(tn)||(tn=y.Vb(tn),tn!==null&&(tn.labeledLink=null))}),Array.isArray($t)&&$t.forEach(function(tn){tn=y.Vb(tn),tn!==null&&(tn.labeledLink=Vt)})}}else if(b==="linkCategory"){var ie=this.Kc(a.object),oe=a.newValue;ie!==null&&typeof oe=="string"&&(ie.category=oe)}else b==="linkDataArray"&&(yS(this,a.oldValue),mS(this,a.newValue));x.isModified=!0}else if(E===uo){var de=a.newValue;if(b==="linkDataArray"&&typeof de=="object"&&de!==null)vS(this,de);else if(b==="linkLabelKeys"&&vd(de)){var ke=this.Kc(a.object),Hn=this.Vb(de);ke!==null&&Hn!==null&&(Hn.labeledLink=ke)}x.isModified=!0}else if(E===yo){var ci=a.oldValue;if(b==="linkDataArray"&&typeof ci=="object"&&ci!==null)this.ip(ci);else if(b==="linkLabelKeys"&&vd(ci)){var ai=this.Vb(ci);ai!==null&&(ai.labeledLink=null)}x.isModified=!0}}else if(E===pr){var Fn=a.propertyName;a.object!==x.model||Fn!=="linkFromKeyProperty"&&Fn!=="linkToKeyProperty"&&Fn!=="linkFromPortIdProperty"&&Fn!=="linkToPortIdProperty"&&Fn!=="linkLabelKeysProperty"&&Fn!=="nodeIsGroupProperty"&&Fn!=="nodeGroupKeyProperty"&&Fn!=="linkCategoryProperty"||x.undoManager.isUndoingRedoing||this.Wd(),x.isModified=!0}}finally{x.aa=!0}}}}},Da.prototype.refreshDataBoundLinks=function(){var a=this,y=this.diagram.model,x=new gn,E=y.linkDataArray;E.forEach(function(z){x.add(z)});var b=[];this.links.each(function(z){z.data===null||x.contains(z.data)||b.push(z.data)}),b.forEach(function(z){NS(y,z,!1)}),E.forEach(function(z){a.Kc(z)===null&&bS(y,z,!1)})},Da.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;if(a instanceof kn){var b=cl(E,y,!0);if(b=x.Vb(b),a.fromNode=b,b=cl(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 gn().addAll(y);var tt=new gn;a.labelNodes.each(function(rt){rt.data!==null&&(rt=E.wa(rt.data),rt!==void 0&&tt.add(rt))}),y=tt.copy(),y.hp(b),b=b.copy(),b.hp(tt),(0<y.count||0<b.count)&&(y.each(function(rt){rt=x.Vb(rt),rt!==null&&rt.labeledLink===a&&(rt.labeledLink=null)}),b.each(function(rt){rt=x.Vb(rt),rt!==null&&rt.labeledLink!==a&&(rt.labeledLink=a)}))}}else!(a instanceof Qr)&&(y=E.lh(y),y=x.findPartForKey(y),y===null||y instanceof rr)&&(a.containingGroup=y)}}},Da.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=vp(y,x),b=this.Lc(a);if(E!==null&&b!==null){E=E.iterator;for(var z={};E.next();){var tt=E.value;y.lb(tt)?b instanceof rr&&y.lh(tt)===x&&(tt=this.Lc(tt),tt!==null&&(tt.containingGroup=b)):(z.link=this.Kc(tt),z.link!==null&&b instanceof qn&&(cl(y,tt,!0)===x&&(z.link.fromNode=b),cl(y,tt,!1)===x&&(z.link.toNode=b),tt=y.Ef(tt),Array.isArray(tt)&&tt.some(function(rt){return function(ot){return ot===x?(b.labeledLink=rt.link,!0):!1}}(z)))),z={link:z.link}}mu(y,x)}a=y.lh(a),a!==void 0&&(a=this.Vb(a),a instanceof rr&&(b.containingGroup=a))}},Da.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof qn){var x=y.wa(a.data);if(x!==void 0){for(var E=a.linksConnected;E.next();)pu(y,x,E.value.data);if(a.isLinkLabel&&(E=a.labeledLink,E!==null&&pu(y,x,E.data)),a instanceof rr)for(a=a.memberParts;a.next();)E=a.value.data,y.lb(E)&&pu(y,x,E)}}},Da.prototype.copyPartData=function(a,y){var x=xo.prototype.copyPartData.call(this,a,y);if(a instanceof kn)if(a=a.data,a!==null&&y!==null){var E=y.model;a=E.Jo(a),typeof a=="object"&&a!==null&&(E.fi(a),x=y.Kc(a))}else x!==null&&(y=this.diagram,a!==null&&y!==null&&y.commandHandler!==null&&y.commandHandler.copiesClipboardData&&(y=y.model.Jo(a),typeof y=="object"&&y!==null&&(x.data=y)));return x},Da.prototype.insertLink=function(a,y,x,E){var b=this.diagram,z=b.model,tt=b.toolManager.findTool("Linking"),rt="";if(a!==null&&(y===null&&(y=a),rt=y.portId,rt===null&&(rt="")),y="",x!==null&&(E===null&&(E=x),y=E.portId,y===null&&(y="")),E=tt.archetypeLinkData,E instanceof kn){if(jl(E),z=E.copy(),z!==null)return z.fromNode=a,z.fromPortId=rt,z.toNode=x,z.toPortId=y,b.add(z),a=tt.archetypeLabelNodeData,a instanceof qn&&(jl(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&&Uf(z,E,z.wa(a.data),!0),Yf(z,E,rt,!0),x!==null&&Uf(z,E,z.wa(x.data),!1),Yf(z,E,y,!1),z.fi(E),a=tt.archetypeLabelNodeData,a===null||a instanceof qn||(a=z.copyNodeData(a),typeof a=="object"&&a!==null&&(z.xf(a),a=z.wa(a),a!==void 0&&z.Bu(E,a))),b.Kc(E);return null},Da.prototype.findLinkForKey=Da.prototype.findLinkForKey,Da.prototype.findPartForKey=Da.prototype.findPartForKey,Da.prototype.removeAllModeledParts=Da.prototype.removeAllModeledParts,Da.prototype.addModeledParts=Da.prototype.addModeledParts,Da.prototype.addAllModeledParts=Da.prototype.addAllModeledParts,Da.className="GraphLinksPartManager";function Fl(){xo.apply(this,arguments),this.Sg=null}Le(Fl,xo);function u0(a,y,x){if(y!==null&&x!==null&&x.kh()===null){var E=a.diagram.toolManager.findTool("Linking"),b=y,z=x;if(a.diagram.isTreePathToChildren||(b=x,z=y),(E===null||!Ci(E,b,z,null,!0))&&(y=a.getLinkCategoryForData(x.data),E=a.findLinkTemplateForCategory(y),E!==null&&(jl(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}}}Fl.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ss(a)},Fl.prototype.setLinkCategoryForData=function(a,y){this.diagram.model.Ms(a,y)},Fl.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}},Fl.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))},Fl.prototype.removeDataForLink=function(a){this.diagram.model.qe(a.data,void 0)},Fl.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.hc(a),a!==null?this.bf.I(a):null)},Fl.prototype.doModelChanged=function(a){if(xo.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===pr){if(E==="nodeParentKey"){var b=a.object,z=this.Vb(a.newValue),tt=this.ii(b);if(this.Sg!==null)z!==null&&(this.Sg.data=b,this.Sg.category=this.getLinkCategoryForData(b));else if(tt!==null){var rt=tt.kh();rt!==null?z===null?y.remove(rt):y.isTreePathToChildren?rt.fromNode=z:rt.toNode=z:u0(this,z,tt)}}else if(E==="parentLinkCategory"){var ot=this.ii(a.object),lt=a.newValue;if(ot!==null&&typeof lt=="string"){var ut=ot.kh();ut!==null&&(ut.category=lt)}}y.isModified=!0}}else if(x===pr){var ft=a.propertyName;a.object===y.model&&ft==="nodeParentKeyProperty"&&(y.undoManager.isUndoingRedoing||this.Wd()),y.isModified=!0}}finally{y.aa=!0}}}}},Fl.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;a instanceof qn&&(y=E.mh(y),y=x.Vb(y),E=a.pg(),y!==E&&(E=a.kh(),y!==null?E!==null?x.isTreePathToChildren?E.fromNode=y:E.toNode=y:u0(this,y,a):E!==null&&Ng(x,E,!1)))}}},Fl.prototype.updateDataBindings=function(a,y){xo.prototype.updateDataBindings.call(this,a,y),typeof y=="string"&&this.Lc(a)!==null&&(a=this.Kc(a),a!==null&&a.La(y))},Fl.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=vp(y,x),b=this.Lc(a);if(E!==null&&b!==null){for(E=E.iterator;E.next();){var z=E.value;y.lb(z)&&b instanceof qn&&y.mh(z)===x&&u0(this,b,this.ii(z))}mu(y,x)}a=y.mh(a),a!==void 0&&b instanceof qn&&(a=this.Vb(a),u0(this,a,b))}},Fl.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof qn){var x=y.wa(a.data),E=this.Kc(a.data);if(E!==null){E.isSelected=!1,E.isHighlighted=!1;var b=E.layer;if(b!==null){var z=b.pc(-1,E,!1);0<=z&&this.diagram.cb(yo,"parts",b,E,null,z,null),z=E.layerChanged,z!==null&&z(E,b,null)}}for(E=this.diagram.isTreePathToChildren,a=a.linksConnected;a.next();)b=a.value,b=(E?b.toNode:b.fromNode).data,y.lb(b)&&pu(y,x,b)}},Fl.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},Fl.prototype.findLinkForKey=Fl.prototype.findLinkForKey,Fl.className="TreePartManager";function Ei(a,y){this.kl=new gn,this.il=new gn,this.Wv=`,
"insertedNodeKeys": `,this.jy=`,
"modifiedNodeData": `,this.Yv=`,
"removedNodeKeys": `,this.vh=null,Wi(this),this.Sm=this.xa="",this.Gg=!1,this.j={},this.Tc=[],this.kb=new Be,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 Be,this.Lt=new cn,this.Wg=!1,this.o=null,this.undoManager=new qi,a!==void 0&&($e(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}Ei.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},Ei.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},Ei.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},Ei.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)+":"+ji(b)}}return y},Ei.prototype.xA=function(a){a.change!==$i&&Gt("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var y=a.object;return a.isTransactionFinished&&y instanceof Ro?(xS(this,y),a=this.Qv(y,a.propertyName==="FinishedUndo"),this.vh=null,a):null},Ei.prototype.Qv=function(a,y){var x=this,E=!1,b=new gn,z=new gn,tt=new gn,rt=this.vh;a.changes.each(function(ft){ft.model===x&&(ft.modelChange==="nodeDataArray"?ft.change===uo?b.add(ft.newValue):ft.change===yo&&tt.add(ft.oldValue):x.lb(ft.object)?z.add(ft.object):ft.change!==pr||x.modelData!==ft.object&&ft.propertyName!=="modelData"?ft.object!==null&&(rt&&rt.contains(ft.object)?rt.get(ft.object).each(function(yt){x.lb(yt)&&z.add(yt)}):ft.object instanceof Ei||x.ri()&&x.Jc(ft.object)||PS(x,ft.object).each(function(yt){z.add(yt)})):E=!0)});var ot=this.il;ot.clear(),b.each(function(ft){ot.add(x.wa(ft)),y||z.add(ft)});var lt=this.kl;lt.clear(),tt.each(function(ft){lt.add(x.wa(ft)),y&&z.add(ft)}),a=x.cloneDeep(z.Fa());var ut=null;return E&&(ut===null&&(ut={}),ut.modelData=this.cloneDeep(this.modelData)),0<ot.count&&(ut===null&&(ut={}),y?ut.removedNodeKeys=ot.Fa():ut.insertedNodeKeys=ot.Fa()),0<a.length&&(ut===null&&(ut={}),ut.modifiedNodeData=a),0<lt.count&&(ut===null&&(ut={}),y?ut.insertedNodeKeys=lt.Fa():ut.removedNodeKeys=lt.Fa()),lt.clear(),ot.clear(),ut},Ei.prototype.cloneDeep=function(a){return Kf(this,a,!0)};function Kf(a,y,x,E,b,z){function tt(ft,yt){rt?(ft.__gohashid===void 0&&z.push(ft),E.set(ft,yt)):(ft=wo++,E.set(ft,yt),b.set(ft,y))}if(!Re(y))return y;z||(z=[]);var rt=Object.isExtensible(y);if(E||(E=new Be),rt){var ot=E.get(y);if(ot)return ot}else for(b||(b=new Be),ot=b.iterator;ot.next();){var lt=ot.key;if(ot.value===y&&(lt=E.get(lt)))return lt}if(Array.isArray(y)){ot=[],tt(y,ot);for(var ut=0;ut<y.length;ut++)ot.push(Kf(a,y[ut],!1,E,b,z))}else if(y instanceof At||y instanceof nn||y instanceof Te||y instanceof or||y instanceof gi)ot=y.copy(),tt(y,ot);else{if(y instanceof So||y instanceof ce||y instanceof en)return y;if(y instanceof cn)ot=new cn().addAll(Kf(a,y.Fa(),!1,E,b,z)),tt(y,ot);else if(y instanceof gn)ot=new gn().addAll(Kf(a,y.Fa(),!1,E,b,z)),tt(y,ot);else if(y instanceof Be)ot=new Be().addAll(Kf(a,y.Fa(),!1,E,b,z)),tt(y,ot);else if(y instanceof Date)ot=new Date(y.getTime()),tt(y,ot);else if(y instanceof RegExp)ot=new RegExp(y),tt(y,ot),ot.lastIndex=y.lastIndex;else if(typeof y.copy=="function")ot=y.copy(),tt(y,ot);else for(ut in ot={},tt(y,ot),y)ut!=="__gohashid"&&(ot[ut]=Kf(a,y[ut],!1,E,b,z))}return x&&z.forEach(function(ft){delete ft.__gohashid}),ot}wt=Ei.prototype,wt.quote=function(a){return JSON.stringify(a).replace(/[\u007F-\uFFFF]/g,function(y){return"\\u"+("0000"+y.charCodeAt(0).toString(16)).substr(-4)})},wt.rm=function(){var a="";return this.name!==""&&(a+=`,
"name": `+this.quote(this.name)),this.dataFormat!==""&&(a+=`,
"dataFormat": `+this.quote(this.dataFormat)),this.isReadOnly&&(a+=`,
"isReadOnly": `+this.isReadOnly),this.nodeKeyProperty!=="key"&&typeof this.nodeKeyProperty=="string"&&(a+=`,
"nodeKeyProperty": `+this.quote(this.nodeKeyProperty)),this.copiesArrays&&(a+=`,
"copiesArrays": true`),this.copiesArrayObjects&&(a+=`,
"copiesArrayObjects": true`),this.copiesKey||(a+=`,
"copiesKey": false`),this.nodeCategoryProperty!=="category"&&typeof this.nodeCategoryProperty=="string"&&(a+=`,
"nodeCategoryProperty": `+this.quote(this.nodeCategoryProperty)),a},wt.gp=function(a){a.name&&(this.name=a.name),a.dataFormat&&(this.dataFormat=a.dataFormat),a.isReadOnly&&(this.isReadOnly=!0),a.nodeKeyProperty&&(this.nodeKeyProperty=a.nodeKeyProperty),a.copiesArrays&&(this.copiesArrays=!0),a.copiesArrayObjects&&(this.copiesArrayObjects=!0),a.copiesKey===!1&&(this.copiesKey=!1),a.nodeCategoryProperty&&(this.nodeCategoryProperty=a.nodeCategoryProperty)};function SS(a,y){y=y.modelData,Re(y)&&(a.dm(y),a.modelData=y)}wt.Rv=function(){var a=this.modelData,y=!1,x;for(x in a)if(!wS(x,a[x])){y=!0;break}return a="",y&&(a=`,
"modelData": `+uy(this,this.modelData)),a+`,
"nodeDataArray": `+md(this,this.nodeDataArray,!0)},wt.kv=function(a){SS(this,a),a=a.nodeDataArray,$e(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 gn,tt.add(z),E.add(b,tt)):tt.add(z)}}var E=a.vh;E===null&&(E=new Be,y.changes.each(function(b){if(b.diagram!==null){var z=b.change;z===pr?(b=b.object.panel)&&(z=b.data)&&x(z,b):(z===uo||z===yo)&&(b=b.object,(z=b.itemArray)&&x(z,b))}}),a.vh=E)}function PS(a,y){for(var x=new gn,E=0;E<a.nodeDataArray.length;E++){var b=a.nodeDataArray[E];h0(a,y,b,b,x)}return x}function h0(a,y,x,E,b){if(Array.isArray(x))for(var z=0;z<x.length;z++){var tt=x[z];if(tt===y)return b.add(E),!0;if(h0(a,y,tt,E,b))return!0}else if(Re(x)&&Object.getPrototypeOf(x)===Object.prototype)for(z in x){if(tt=x[z],tt===y)return b.add(E),!0;if(h0(a,y,tt,E,b))return!0}return!1}wt.Pv=function(a,y){var x=this,E=!1,b=new gn,z=new gn,tt=new gn,rt=this.vh;a.changes.each(function(ut){ut.model===x&&(ut.modelChange==="nodeDataArray"?ut.change===uo?b.add(ut.newValue):ut.change===yo&&tt.add(ut.oldValue):x.lb(ut.object)?z.add(ut.object):ut.change!==pr||x.modelData!==ut.object&&ut.propertyName!=="modelData"?ut.object!==null&&(rt&&rt.contains(ut.object)?rt.get(ut.object).each(function(ft){x.lb(ft)&&z.add(ft)}):ut.object instanceof Ei||x.ri()&&x.Jc(ut.object)||PS(x,ut.object).each(function(ft){z.add(ft)})):E=!0)});var ot=this.il;ot.clear(),b.each(function(ut){ot.add(x.wa(ut)),y||z.add(ut)});var lt=this.kl;return lt.clear(),tt.each(function(ut){lt.add(x.wa(ut)),y&&z.add(ut)}),a="",E&&(a+=`,
"modelData": `+uy(this,this.modelData)),0<ot.count&&(a+=(y?this.Yv:this.Wv)+md(this,ot.Fa(),!0)),0<z.count&&(a+=this.jy+md(this,z.Fa(),!0)),0<lt.count&&(a+=(y?this.Wv:this.Yv)+md(this,lt.Fa(),!0)),lt.clear(),ot.clear(),a},wt.fp=function(a){(a.name!==void 0&&a.name!==this.name||a.dataFormat!==void 0&&a.dataFormat!==this.dataFormat||a.isReadOnly!==void 0&&a.isReadOnly!==this.isReadOnly||a.nodeKeyProperty!==void 0&&a.nodeKeyProperty!==this.nodeKeyProperty||a.copiesArrays!==void 0&&a.copiesArrays!==this.copiesArrays||a.copiesArrayObjects!==void 0&&a.copiesArrayObjects!==this.copiesArrayObjects||a.copiesKey!==void 0&&a.copiesKey!==this.copiesKey||a.nodeCategoryProperty!==void 0&&a.nodeCategoryProperty!==this.nodeCategoryProperty)&&Gt("applyIncrementalJson cannot change Model properties"),SS(this,a);var y=a.insertedNodeKeys,x=a.modifiedNodeData,E=new Be;if(Array.isArray(x))for(var b=0;b<x.length;b++){var z=x[b],tt=this.wa(z);tt!=null&&E.set(tt,z)}if(Array.isArray(y))for(b=y.length,z=0;z<b;z++){tt=y[z];var rt=this.hc(tt);rt===null&&(rt=(rt=E.get(tt))?rt:this.copyNodeData({}),this.km(rt,tt),this.xf(rt))}if(Array.isArray(x)){for(y=x.length,E=0;E<y;E++)if(b=x[E],z=this.wa(b),z=this.hc(z),z!==null){for(var ot in b)ot==="__gohashid"||ot===this.nodeKeyProperty||this.Wj()&&ot===this.nodeIsGroupProperty||this.setDataProperty(z,ot,b[ot]);this.lm(b,z)}}if(a=a.removedNodeKeys,Array.isArray(a))for(x=a.length,ot=0;ot<x;ot++)y=this.hc(a[ot]),y!==null&&this.cm(y)},wt.$x=function(a,y){a.change!==$i&&Gt("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var x=a.object;return a.isTransactionFinished&&x instanceof Ro?(y===void 0&&(y=yp(this,this)),xS(this,x),a=this.Pv(x,a.propertyName==="FinishedUndo"),this.vh=null,y==="2"?'{ "incremental": 2'+a+"}":'{ "class": '+this.quote(y)+', "incremental": 1'+this.rm()+a+"}"):'{ "incremental": 0 }'},wt.yA=function(a,y){return this.$x(a,y)},wt.np=function(a){return a===void 0&&(a=yp(this,this)),'{ "class": '+this.quote(a)+this.rm()+this.Rv()+"}"},wt.toJSON=function(a){return this.np(a)},wt.Zw=function(a){var y=null;if(typeof a=="string")try{y=qe.JSON.parse(a)}catch(E){}else typeof a=="object"?y=a:Gt("Unable to modify a Model from: "+a);var x=y.incremental;typeof x!="number"&&Gt("Unable to apply non-incremental changes to Model: "+a),x!==0&&(this.Ea("applyIncrementalJson"),this.fp(y),this.eb("applyIncrementalJson"))},wt.Ky=function(a){return this.Zw(a)},Ei.constructGraphLinksModel=function(){return new Ei},wt=Ei.prototype,wt.dm=function(a){if($e(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];if(Re(E)){var b=x;E=this.dm(E),Array.isArray(a)?a[b]=E:Gt("Cannot replace an object in an HTMLCollection or NodeList at "+b)}}else if(Re(a)){for(y in a)if(x=a[y],Re(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 cn,E=0;E<x.length/2;E++)b.add(new At(x[2*E],x[2*E+1]));b.freeze(),a[y]=b}}return Bx(a)}return a},wt.sm=function(a){return a===void 0?"undefined":a===null?"null":a===!0?"true":a===!1?"false":typeof a=="string"?this.quote(a):typeof a=="number"?a===1/0?"9e9999":a===-1/0?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.sm(a.valueOf()):$e(a)?md(this,a):Re(a)?uy(this,a):typeof a=="function"?"null":a.toString()};function md(a,y,x){x===void 0&&(x=!1);var E=y.length;if(0>=E)return"[]";var b=new Bi;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 Cs(a){return isNaN(a)?"NaN":a===1/0?"9e9999":a===-1/0?"-9e9999":a}function uy(a,y){var x=y;if(x instanceof At)y={class:"go.Point",x:Cs(x.x),y:Cs(x.y)};else if(x instanceof nn)y={class:"go.Size",width:Cs(x.width),height:Cs(x.height)};else if(x instanceof Te)y={class:"go.Rect",x:Cs(x.x),y:Cs(x.y),width:Cs(x.width),height:Cs(x.height)};else if(x instanceof or)y={class:"go.Margin",top:Cs(x.top),right:Cs(x.right),bottom:Cs(x.bottom),left:Cs(x.left)};else if(x instanceof gi)x.sb()?y={class:"go.Spot",x:Cs(x.x),y:Cs(x.y),offsetX:Cs(x.offsetX),offsetY:Cs(x.offsetY)}:y={class:"go.Spot",enum:x.toString()};else if(x instanceof So){if(y={class:"go.Brush",type:x.type.name},x.type===Ah?y.color=x.color:(x.type===dh||x.type===El)&&(y.start=x.start,y.end=x.end,x.type===El&&(x.startRadius!==0&&(y.startRadius=Cs(x.startRadius)),isNaN(x.endRadius)||(y.endRadius=Cs(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 ce?(y={class:"go.Geometry",type:x.type.name},x.startX!==0&&(y.startX=Cs(x.startX)),x.startY!==0&&(y.startY=Cs(x.startY)),x.endX!==0&&(y.endX=Cs(x.endX)),x.endY!==0&&(y.endY=Cs(x.endY)),x.spot1.D(jr)||(y.spot1=x.spot1),x.spot2.D(so)||(y.spot2=x.spot2),x.type===ce.o&&(y.path=ce.ia(x))):x instanceof en&&(y={class:"go.EnumValue",classType:yp(a,x.classType),name:x.name});E="{",x=!0;for(var b in y){var z=aa(y,b);if(!wS(b,z))if(x?x=!1:E+=",",E+=a.quote(b)+":",b==="points"&&z instanceof cn){var tt="[";for(z=z.iterator;z.next();){var rt=z.value;1<tt.length&&(tt+=","),tt+=a.sm(rt.x),tt+=",",tt+=a.sm(rt.y)}tt+="]",E+=tt}else E+=a.sm(z)}return E+"}"}function Es(a){return typeof a=="number"?a:a==="NaN"?NaN:a==="9e9999"?1/0:a==="-9e9999"?-1/0:parseFloat(a)}function Bx(a){if(typeof a!="object")return a;var y=a.class||"";if(y==="NaN")return NaN;if(y==="Date")return new Date(a.value);if(y.indexOf("go.")!==0)return a;y=y.substr(3);var x=a;if(y==="Point")x=new At(Es(a.x),Es(a.y));else if(y==="Size")x=new nn(Es(a.width),Es(a.height));else if(y==="Rect")x=new Te(Es(a.x),Es(a.y),Es(a.width),Es(a.height));else if(y==="Margin")x=new or(Es(a.top),Es(a.right),Es(a.bottom),Es(a.left));else if(y==="Spot")typeof a.enum=="string"?x=Eo(a.enum):x=new gi(Es(a.x),Es(a.y),Es(a.offsetX),Es(a.offsetY));else if(y==="Brush"){if(x=new So,x.type=Tn(So,a.type),typeof a.color=="string"&&(x.color=a.color),a.start instanceof gi&&(x.start=a.start),a.end instanceof gi&&(x.end=a.end),typeof a.startRadius=="number"&&(x.startRadius=Es(a.startRadius)),typeof a.endRadius=="number"&&(x.endRadius=Es(a.endRadius)),a=a.colorStops,Re(a))for(var E in a)x.addColorStop(parseFloat(E),a[E])}else y==="Geometry"?(x=null,typeof a.path=="string"?x=ce.parse(a.path):x=new ce,x.type=Tn(ce,a.type),typeof a.startX=="number"&&(x.startX=Es(a.startX)),typeof a.startY=="number"&&(x.startY=Es(a.startY)),typeof a.endX=="number"&&(x.endX=Es(a.endX)),typeof a.endY=="number"&&(x.endY=Es(a.endY)),a.spot1 instanceof gi&&(x.spot1=a.spot1),a.spot2 instanceof gi&&(x.spot2=a.spot2)):y==="EnumValue"&&(E=a.classType,E.indexOf("go.")===0&&(E=E.substr(3)),E=dy(E),typeof E=="function"&&(x=Tn(E,a.name)));return x}wt.Pe=function(a){return this.Lt.add(a),this},wt.ik=function(a){this.Lt.remove(a)},wt.ds=function(a){this.skipsUndoManager||this.undoManager.Tu(a);for(var y=this.Lt,x=y.length,E=0;E<x;E++)y.M(E)(a)},wt.cb=function(a,y,x,E,b,z,tt){ya(this,"",a,y,x,E,b,z,tt)},wt.g=function(a,y,x,E,b){ya(this,"",pr,a,this,y,x,E,b)},wt.Fs=function(a,y,x,E,b,z){ya(this,"",pr,y,a,x,E,b,z)};function ya(a,y,x,E,b,z,tt,rt,ot){rt===void 0&&(rt=null),ot===void 0&&(ot=null);var lt=new Pi;lt.model=a,lt.change=x,lt.modelChange=y,lt.propertyName=E,lt.object=b,lt.oldValue=z,lt.oldParam=rt,lt.newValue=tt,lt.newParam=ot,a.ds(lt)}Ei.prototype.changeState=function(a,y){if(a!==null&&a.model===this)if(a.change===pr){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)),Vo(x,E,b)}else a.change===uo?(x=a.newParam,a.modelChange==="nodeDataArray"?(a=a.newValue,Re(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]===a&&di(this.Tc,x),E!==void 0&&this.kb.remove(E)):(this.Tc[x]!==a&&_n(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)))):a.modelChange===""?((E=a.object)&&!$e(E)&&a.propertyName&&(E=aa(a.object,a.propertyName)),$e(E)&&typeof x=="number"&&(a=a.newValue,y?di(E,x):_n(E,x,a))):Gt("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===yo?(x=a.oldParam,a.modelChange==="nodeDataArray"?(a=a.oldValue,Re(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]!==a&&_n(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)):(this.Tc[x]===a&&di(this.Tc,x),E!==void 0&&this.kb.remove(E)))):a.modelChange===""?((E=a.object)&&!$e(E)&&a.propertyName&&(E=aa(a.object,a.propertyName)),$e(E)&&typeof x=="number"&&(a=a.oldValue,y?_n(E,x,a):di(E,x))):Gt("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==$i&&Gt("unknown ChangedEvent: "+a.toString())},Ei.prototype.Ea=function(a){return this.undoManager.Ea(a)},Ei.prototype.eb=function(a){return this.undoManager.eb(a)},Ei.prototype.Kf=function(){return this.undoManager.Kf()},Ei.prototype.commit=function(a,y){y===void 0&&(y="");var x=this.skipsUndoManager;y===null&&(this.skipsUndoManager=!0,y=""),this.undoManager.Ea(y);var E=!1;try{a(this),E=!0}finally{E?this.undoManager.eb(y):this.undoManager.Kf(),this.skipsUndoManager=x}},wt=Ei.prototype,wt.La=function(a,y){y===void 0&&(y=""),ya(this,"SourceChanged",$i,y,a,null,null)},wt.wa=function(a){if(a!==null){var y=this.Th;if(y!==""&&(y=aa(a,y),y!==void 0)){if(vd(y))return y;Gt("Key value for node data "+a+" is not a number or a string: "+y)}}},wt.km=function(a,y){if(a!==null){var x=this.Th;if(x!=="")if(this.lb(a)){var E=aa(a,x);E!==y&&this.hc(y)===null&&(Vo(a,x,y),E!==void 0&&this.kb.remove(E),this.kb.add(y,a),ya(this,"nodeKey",pr,x,a,E,y),typeof x=="string"&&this.La(a,x),this.jp(E,y))}else Vo(a,x,y)}};function vd(a){return typeof a=="number"||typeof a=="string"}wt.lb=function(a){var y=this.wa(a);return y===void 0?!1:this.kb.I(y)===a},wt.hc=function(a){return a===null&&Gt("Model.findNodeDataForKey:key must not be null"),a!==void 0&&vd(a)?this.kb.I(a):null},wt.$u=function(a){if(a!==null){var y=this.Th;if(y!==""){var x=this.wa(a);if(x===void 0||this.kb.contains(x)){var E=this.bl;if(E!==null&&(x=E(this,a),x!=null&&!this.kb.contains(x))){Vo(a,y,x);return}if(typeof x=="string"){for(E=2;this.kb.contains(x+E);)E++;Vo(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.kb.count-1;this.kb.contains(x);)x--;Vo(a,y,x)}}}}},wt.xf=function(a){a!==null&&(Kr(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&&Gt("Model.makeNodeDataKeyUnique failed on "+y+". Data not added to Model."),a.kb.add(E,y),E=null,x&&(E=a.Tc.length,_n(a.Tc,E,y)),ya(a,"nodeDataArray",uo,"nodeDataArray",a,null,y,null,E),a.fm(y),a.em(y))}wt.Fy=function(a){if($e(a))for(var y=a.length,x=0;x<y;x++)this.xf(a[x]);else for(a=a.iterator;a.next();)this.xf(a.value)},wt.cm=function(a){a!==null&&ES(this,a,!0)};function ES(a,y,x){var E=a.wa(y);if(E!==void 0&&a.kb.remove(E),E=null,x){t:if(x=a.Tc,Array.isArray(x))E=x.indexOf(y);else{E=x.length;for(var b=0;b<E;b++)if(x[b]===y){E=b;break t}E=-1}if(0>E)return;di(a.Tc,E)}ya(a,"nodeDataArray",yo,"nodeDataArray",a,y,null,E,null),a.qp(y)}wt.nA=function(a){if($e(a))for(var y=a.length,x=0;x<y;x++)this.cm(a[x]);else for(a=a.iterator;a.next();)this.cm(a.value)},wt.$z=function(a){if(a!==this.nodeDataArray&&$e(a)){var y=this.kl;y.clear(),y.addAll(this.kb.iteratorKeys);var x=this.il;x.clear();for(var E=a.length,b=0;b<E;b++){var z=a[b],tt=this.wa(z);if(tt!==void 0){x.add(tt);var rt=this.hc(tt);rt!==z&&(rt!==null?(this.Do(rt,z),this.lm(z,rt)):(z=this.cloneDeep(z),this.km(z,tt),this.xf(z)))}else tt=this.cloneDeep(z),this.xf(tt),x.add(this.wa(tt))}for(a=y.iterator;a.next();)E=a.value,x.contains(E)||(E=this.hc(E))&&this.cm(E);y.clear(),x.clear()}},wt.jp=function(a,y){y!==void 0&&(a=vp(this,a),a instanceof gn&&this.Vf.add(y,a))},wt.Lv=function(){},wt.fm=function(){},wt.em=function(){},wt.qp=function(){};function pu(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E===null&&(E=new gn,a.Vf.add(y,E)),E.add(x)}}function mu(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E instanceof gn&&(x==null?a.Vf.remove(y):(E.remove(x),E.count===0&&a.Vf.remove(y)))}}function vp(a,y){return y===void 0?null:(a=a.Vf.I(y),a instanceof gn?a:null)}wt.Qy=function(a){a===void 0?this.Vf.clear():this.Vf.remove(a)},Ei.prototype.copyNodeData=function(a){if(a===null)return null;var y=this.Bk;return a=y!==null?y(a,this):d0(this,a,!0),Re(a)&&Wi(a),a};function d0(a,y,x){if(a.copiesArrays&&Array.isArray(y)){var E=[];for(x=0;x<y.length;x++){var b=d0(a,y[x],a.copiesArrayObjects);E.push(b)}return Wi(E),E}if(x&&Re(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=aa(y,E),tt=yp(a,z);tt==="GraphObject"||tt==="Diagram"||tt==="Layer"||tt==="RowColumnDefinition"||tt==="AnimationManager"||tt==="Tool"||tt==="CommandHandler"||tt==="Layout"||tt==="InputEvent"||tt==="DiagramEvent"||z instanceof Ei||z instanceof qi||z instanceof Ro||z instanceof Pi||(z=d0(a,z,!1)),Vo(x,E,z)}return Wi(x),x}return y instanceof At||y instanceof nn||y instanceof Te||y instanceof gi||y instanceof or?y.copy():y}Ei.prototype.setDataProperty=function(a,y,x){if(this.lb(a)){if(y===this.nodeKeyProperty){this.km(a,x);return}if(y===this.nodeCategoryProperty){this.jm(a,x);return}}else!LS&&a instanceof fe&&(LS=!0,Gn('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),Gn(" Is that really your intent?"));var E=aa(a,y);E!==x&&(Vo(a,y,x),this.Fs(a,y,E,x))},wt=Ei.prototype,wt.set=function(a,y,x){this.setDataProperty(a,y,x)},wt.Do=function(a,y){if(y){var x=this.lb(a),E;for(E in y)E==="__gohashid"||x&&E===this.nodeKeyProperty||this.setDataProperty(a,E,y[E])}},wt.Ay=function(a,y){this.ts(a,-1,y)},wt.ts=function(a,y,x){0>y&&(y=a.length),_n(a,y,x),ya(this,"",uo,"",a,null,x,null,y)},wt.ov=function(a,y){y===void 0&&(y=-1),a===this.Tc&&Gt("Model.removeArrayItem should not be called on the Model.nodeDataArray"),y===-1&&(y=a.length-1);var x=a[y];di(a,y),ya(this,"",yo,"",a,x,null,y,null)},wt.Ro=function(a){if(a===null)return"";var y=this.lj;if(y===""||(y=aa(a,y),y===void 0))return"";if(typeof y=="string")return y;Gt("getCategoryForNodeData found a non-string category for "+a+": "+y)},wt.jm=function(a,y){if(a!==null){var x=this.lj;if(x!=="")if(this.lb(a)){var E=aa(a,x);E===void 0&&(E=""),E!==y&&(Vo(a,x,y),ya(this,"nodeCategory",pr,x,a,E,y))}else Vo(a,x,y)}},wt.lm=function(a,y){this.jm(y,this.Ro(a))},wt.Tl=function(){return!1},wt.Wj=function(){return!1},wt.ri=function(){return!1},wt.xs=function(){return!1},wt.Xj=function(){return!1};function hy(){return new Ei}function yp(a,y){if(typeof y=="function"){if(y.className)return y.className;if(y.name)return y.name}else if(typeof y=="object"&&y!==null&&y.constructor)return yp(a,y.constructor);return typeof y}function dy(a){return nu[a]?nu[a]:qe.go!==void 0&&qe.go[a]?qe.go[a]:null}function aa(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 Vo(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){}}Se.Object.defineProperties(Ei.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===""&&Gt("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&Gt("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];Re(b)||Gt("Model.nodeDataArray must only contain Objects, not: "+b),Kr(b)}for(this.Tc=a,E=new cn,b=0;b<x;b++){var z=a[b],tt=this.wa(z);tt===void 0||this.kb.I(tt)!==null?E.add(z):this.kb.add(tt,z)}for(E=E.iterator;E.next();)b=E.value,this.$u(b),z=this.wa(b),z!==void 0&&this.kb.add(z,b);for(ya(this,"nodeDataArray",pr,"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"}}}),Ei.prototype.setCategoryForNodeData=Ei.prototype.jm,Ei.prototype.getCategoryForNodeData=Ei.prototype.Ro,Ei.prototype.removeArrayItem=Ei.prototype.ov,Ei.prototype.insertArrayItem=Ei.prototype.ts,Ei.prototype.addArrayItem=Ei.prototype.Ay,Ei.prototype.assignAllDataProperties=Ei.prototype.Do,Ei.prototype.set=Ei.prototype.set,Ei.prototype.clearUnresolvedReferences=Ei.prototype.Qy,Ei.prototype.mergeNodeDataArray=Ei.prototype.$z,Ei.prototype.removeNodeDataCollection=Ei.prototype.nA,Ei.prototype.removeNodeData=Ei.prototype.cm,Ei.prototype.addNodeDataCollection=Ei.prototype.Fy,Ei.prototype.addNodeData=Ei.prototype.xf,Ei.prototype.makeNodeDataKeyUnique=Ei.prototype.$u,Ei.prototype.findNodeDataForKey=Ei.prototype.hc,Ei.prototype.containsNodeData=Ei.prototype.lb,Ei.prototype.setKeyForNodeData=Ei.prototype.km,Ei.prototype.getKeyForNodeData=Ei.prototype.wa,Ei.prototype.updateTargetBindings=Ei.prototype.La,Ei.prototype.commit=Ei.prototype.commit,Ei.prototype.rollbackTransaction=Ei.prototype.Kf,Ei.prototype.commitTransaction=Ei.prototype.eb,Ei.prototype.startTransaction=Ei.prototype.Ea,Ei.prototype.raiseDataChanged=Ei.prototype.Fs,Ei.prototype.raiseChanged=Ei.prototype.g,Ei.prototype.raiseChangedEvent=Ei.prototype.cb,Ei.prototype.removeChangedListener=Ei.prototype.ik,Ei.prototype.addChangedListener=Ei.prototype.Pe,Ei.prototype.writeJsonValue=Ei.prototype.sm,Ei.prototype.replaceJsonObjects=Ei.prototype.dm,Ei.prototype.applyIncrementalJSON=Ei.prototype.Ky,Ei.prototype.applyIncrementalJson=Ei.prototype.Zw,Ei.prototype.toJSON=Ei.prototype.toJSON,Ei.prototype.toJson=Ei.prototype.np,Ei.prototype.toIncrementalJSON=Ei.prototype.yA,Ei.prototype.toIncrementalJson=Ei.prototype.$x,Ei.prototype.toIncrementalData=Ei.prototype.xA,Ei.prototype.clear=Ei.prototype.clear;var LS=!1,nu={};Ei.className="Model",Ei.fromJSON=Ei.fromJson=function(a,y){y===void 0&&(y=null);var x=null;if(typeof a=="string")try{x=qe.JSON.parse(a)}catch(z){}else typeof a=="object"?x=a:Gt("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=qe[E])),typeof b=="function"&&(a=new b)}catch(z){}a===null||a instanceof Ei?y=a:Gt("Unable to construct a Model of declared class: "+x.class)}return y===null&&(y=Ei.constructGraphLinksModel()),y.gp(x),y.kv(x),y},Ei.safePropertyValue=aa,Ei.safePropertySet=Vo,nu.Brush=So,nu.ChangedEvent=Pi,nu.Geometry=ce,nu.Margin=or,nu.Panel=Pn,nu.Point=At,nu.Rect=Te,nu.Size=nn,nu.Spot=gi,nu.Transaction=Ro,nu.UndoManager=qi;function la(a,y,x,E){Wi(this),this._isFrozen=!1,a===void 0&&(a=""),y===void 0&&(y=a),x===void 0&&(x=null),this.j=-1,this.xd=null,this.xl=a,this.wl=this.to=0,this.Cr=null,this.wn=!1,this.sl=y,this.Im=x,E===void 0?(this.el=MS,this.wk=null):(this.el=Sp,this.wk=E),this.st=new gn}la.prototype.copy=function(){var a=new la;return a.xl=this.xl,a.to=this.to,a.wl=this.wl,a.Cr=this.Cr,a.wn=this.wn,a.sl=this.sl,a.Im=this.Im,a.el=this.el,a.wk=this.wk,a},wt=la.prototype,wt.qb=function(a){a.classType===la&&(this.mode=a)},wt.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.Ai!==-1?" "+this.Ai:"")+" "+this.mode.name+")"},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.Kx=function(a){return a===void 0&&(a=null),this.mode=Sp,this.backConverter=a,this},wt.cp=function(a){return a===void 0&&(a=""),this.sourceName=a,this.isToModel=!1,this},wt.dA=function(){return this.sourceName=null,this.isToModel=!0,this};function FS(a,y,x){return a=a.sourceName,a===null||a===""?y:a==="/"?x.part:a==="."?x:a===".."?x.panel:y.fb(a)}wt.Mv=function(a,y,x){var E=this.sl;if(x===void 0||E===""||E===x){x=this.xl;var b=this.Im;if(b===null&&x==="")Gn("Binding error: target property is the empty string: "+this.toString());else{var z=y;if(E!==""&&(z=aa(y,E)),z!==void 0)if(b===null)x!==""&&Vo(a,x,z);else try{if(x!==""){var tt=b(z,a);Vo(a,x,tt)}else b(z,a)}catch(rt){}}}},wt.sp=function(a,y,x,E){if(this.el===Sp){var b=this.xl;if(x===void 0||b===x){x=this.sl;var z=this.wk,tt=a;if(b!==""&&(tt=aa(a,b)),tt!==void 0&&!this.st.contains(a))try{this.st.add(a);var rt=E!==null?E.diagram:null,ot=rt!==null?rt.model:null;if(z===null){if(x!=="")ot!==null?ot.setDataProperty(y,x,tt):Vo(y,x,tt);else if(ot!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var lt=E.itemIndex,ut=E.panel.itemArray;ot.ov(ut,lt),ot.ts(ut,lt,tt)}}else try{if(x!==""){var ft=z(tt,y,ot);ot!==null?ot.setDataProperty(y,x,ft):Vo(y,x,ft)}else{var yt=z(tt,y,ot);if(yt!==void 0&&ot!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var xt=E.itemIndex,Ct=E.panel.itemArray;ot.ov(Ct,xt),ot.ts(Ct,xt,yt)}}}catch(bt){}}finally{this.st.remove(a)}}}},Se.Object.defineProperties(la.prototype,{Ai:{get:function(){return this.j},set:function(a){this._isFrozen&&me(this),this.j=a}},targetProperty:{get:function(){return this.xl},set:function(a){this._isFrozen&&me(this),this.xl=a}},sourceName:{get:function(){return this.Cr},set:function(a){this._isFrozen&&me(this),this.Cr=a,a!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(a){this._isFrozen&&me(this),this.wn=a}},sourceProperty:{get:function(){return this.sl},set:function(a){this._isFrozen&&me(this),this.sl=a}},converter:{get:function(){return this.Im},set:function(a){this._isFrozen&&me(this),this.Im=a}},backConverter:{get:function(){return this.wk},set:function(a){this._isFrozen&&me(this),this.wk=a}},mode:{get:function(){return this.el},set:function(a){this._isFrozen&&me(this),this.el=a}}}),la.prototype.updateSource=la.prototype.sp,la.prototype.updateTarget=la.prototype.Mv,la.prototype.ofModel=la.prototype.dA,la.prototype.ofObject=la.prototype.cp,la.prototype.makeTwoWay=la.prototype.Kx;var Ax="Binding",MS=new en(la,"OneWay",1),Sp=new en(la,"TwoWay",2);la.className="Binding",la.parseEnum=function(a,y){return function(x){return x=Tn(a,x),x===null?y:x}},la.toString=ji,la.OneWay=MS,la.TwoWay=Sp;function Vr(a,y,x){Ei.call(this),this.Vv=`,
"insertedLinkKeys": `,this.iy=`,
"modifiedLinkData": `,this.Xv=`,
"removedLinkKeys": `,this.md=[],this.$f=new gn,this.wb=new Be,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&&($e(a)?this.nodeDataArray=a:x=a),x&&(Object.assign(this,x),a=x.Changed)&&(delete this.Changed,this.Pe(a))}Le(Vr,Ei),Vr.constructGraphLinksModel=Ei.constructGraphLinksModel,Vr.prototype.cloneProtected=function(a){Ei.prototype.cloneProtected.call(this,a),a.Jh=this.Jh,a.cl=this.cl,a.Ak=this.Ak,a.lf=this.lf,a.mf=this.mf,a.ej=this.ej,a.fj=this.fj,a.dj=this.dj,a.je=this.je,a.jl=this.jl,a.Je=this.Je,a.Lm=this.Lm},wt=Vr.prototype,wt.clear=function(){Ei.prototype.clear.call(this),this.md=[],this.wb.clear(),this.$f.clear()},wt.toString=function(a){if(a===void 0&&(a=0),2<=a)return this.np();var y=(this.name!==""?this.name:"")+" GraphLinksModel";if(0<a){y+=`
node data:`,a=this.nodeDataArray;var x=a.length,E;for(E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+ji(b)}for(y+=`
link data:`,a=this.linkDataArray,x=a.length,E=0;E<x;E++)b=a[E],y+=" "+cl(this,b,!0)+"-->"+cl(this,b,!1)}return y},wt.Qv=function(a,y){this.linkKeyProperty===""&&Gt("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var x=Ei.prototype.Qv.call(this,a,y),E=this,b=new gn,z=new gn,tt=new gn,rt=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===uo?b.add(ut.newValue):ut.change===yo&&tt.add(ut.oldValue):E.Jc(ut.object)?z.add(ut.object):ut.object!==null&&(ut.object!==null&&rt&&rt.contains(ut.object)?rt.get(ut.object).each(function(ft){E.Jc(ft)&&z.add(ft)}):ut.object instanceof Ei||E.lb(ut.object)||kS(E,ut.object).each(function(ft){z.add(ft)})))});var ot=this.il;ot.clear(),b.each(function(ut){ot.add(E.Ac(ut)),y||z.add(ut)});var lt=this.kl;return lt.clear(),tt.each(function(ut){lt.add(E.Ac(ut)),y&&z.add(ut)}),a=E.cloneDeep(z.Fa()),0<ot.count&&(x===null&&(x={}),y?x.removedLinkKeys=ot.Fa():x.insertedLinkKeys=ot.Fa()),0<a.length&&(x===null&&(x={}),x.modifiedLinkData=a),0<lt.count&&(x===null&&(x={}),y?x.insertedLinkKeys=lt.Fa():x.removedLinkKeys=lt.Fa()),lt.clear(),ot.clear(),x},wt.rm=function(){var a=Ei.prototype.rm.call(this),y="";return this.linkCategoryProperty!=="category"&&typeof this.linkCategoryProperty=="string"&&(y+=`,
"linkCategoryProperty": `+this.quote(this.linkCategoryProperty)),this.linkKeyProperty!==""&&typeof this.linkKeyProperty=="string"&&(y+=`,
"linkKeyProperty": `+this.quote(this.linkKeyProperty)),this.linkFromKeyProperty!=="from"&&typeof this.linkFromKeyProperty=="string"&&(y+=`,
"linkFromKeyProperty": `+this.quote(this.linkFromKeyProperty)),this.linkToKeyProperty!=="to"&&typeof this.linkToKeyProperty=="string"&&(y+=`,
"linkToKeyProperty": `+this.quote(this.linkToKeyProperty)),this.linkFromPortIdProperty!==""&&typeof this.linkFromPortIdProperty=="string"&&(y+=`,
"linkFromPortIdProperty": `+this.quote(this.linkFromPortIdProperty)),this.linkToPortIdProperty!==""&&typeof this.linkToPortIdProperty=="string"&&(y+=`,
"linkToPortIdProperty": `+this.quote(this.linkToPortIdProperty)),this.linkLabelKeysProperty!==""&&typeof this.linkLabelKeysProperty=="string"&&(y+=`,
"linkLabelKeysProperty": `+this.quote(this.linkLabelKeysProperty)),this.nodeIsGroupProperty!=="isGroup"&&typeof this.nodeIsGroupProperty=="string"&&(y+=`,
"nodeIsGroupProperty": `+this.quote(this.nodeIsGroupProperty)),this.nodeGroupKeyProperty!=="group"&&typeof this.nodeGroupKeyProperty=="string"&&(y+=`,
"nodeGroupKeyProperty": `+this.quote(this.nodeGroupKeyProperty)),a+y},wt.gp=function(a){Ei.prototype.gp.call(this,a),a.linkKeyProperty&&(this.linkKeyProperty=a.linkKeyProperty),a.linkFromKeyProperty&&(this.linkFromKeyProperty=a.linkFromKeyProperty),a.linkToKeyProperty&&(this.linkToKeyProperty=a.linkToKeyProperty),a.linkFromPortIdProperty&&(this.linkFromPortIdProperty=a.linkFromPortIdProperty),a.linkToPortIdProperty&&(this.linkToPortIdProperty=a.linkToPortIdProperty),a.linkCategoryProperty&&(this.linkCategoryProperty=a.linkCategoryProperty),a.linkLabelKeysProperty&&(this.linkLabelKeysProperty=a.linkLabelKeysProperty),a.nodeIsGroupProperty&&(this.nodeIsGroupProperty=a.nodeIsGroupProperty),a.nodeGroupKeyProperty&&(this.nodeGroupKeyProperty=a.nodeGroupKeyProperty)},wt.Rv=function(){var a=Ei.prototype.Rv.call(this),y=`,
"linkDataArray": `+md(this,this.linkDataArray,!0);return a+y},wt.kv=function(a){Ei.prototype.kv.call(this,a),a=a.linkDataArray,Array.isArray(a)&&(this.dm(a),this.linkDataArray=a)};function kS(a,y){for(var x=new gn,E=0;E<a.linkDataArray.length;E++){var b=a.linkDataArray[E];h0(a,y,b,b,x)}return x}wt.Pv=function(a,y){this.linkKeyProperty===""&&Gt("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var x=Ei.prototype.Pv.call(this,a,y),E=this,b=new gn,z=new gn,tt=new gn,rt=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===uo?b.add(ut.newValue):ut.change===yo&&tt.add(ut.oldValue):E.Jc(ut.object)?z.add(ut.object):ut.object!==null&&(ut.object!==null&&rt&&rt.contains(ut.object)?rt.get(ut.object).each(function(ft){E.Jc(ft)&&z.add(ft)}):ut.object instanceof Ei||E.lb(ut.object)||kS(E,ut.object).each(function(ft){z.add(ft)})))});var ot=this.il;ot.clear(),b.each(function(ut){ot.add(E.Ac(ut)),y||z.add(ut)});var lt=this.kl;return lt.clear(),tt.each(function(ut){lt.add(E.Ac(ut)),y&&z.add(ut)}),a=x,0<ot.count&&(a+=(y?this.Xv:this.Vv)+md(this,ot.Fa(),!0)),0<z.count&&(a+=this.iy+md(this,z.Fa(),!0)),0<lt.count&&(a+=(y?this.Vv:this.Xv)+md(this,lt.Fa(),!0)),lt.clear(),ot.clear(),a},wt.fp=function(a){(a.linkCategoryProperty!==void 0&&a.linkCategoryProperty!==this.linkCategoryProperty||a.linkKeyProperty!==void 0&&a.linkKeyProperty!==this.linkKeyProperty||a.linkFromKeyProperty!==void 0&&a.linkFromKeyProperty!==this.linkFromKeyProperty||a.linkToKeyProperty!==void 0&&a.linkToKeyProperty!==this.linkToKeyProperty||a.linkFromPortIdProperty!==void 0&&a.linkFromPortIdProperty!==this.linkFromPortIdProperty||a.linkToPortIdProperty!==void 0&&a.linkToPortIdProperty!==this.linkToPortIdProperty||a.linkLabelKeysProperty!==void 0&&a.linkLabelKeysProperty!==this.linkLabelKeysProperty||a.nodeIsGroupProperty!==void 0&&a.nodeIsGroupProperty!==this.nodeIsGroupProperty||a.nodeGroupKeyProperty!==void 0&&a.nodeGroupKeyProperty!==this.nodeGroupKeyProperty)&&Gt("applyIncrementalJson cannot change Model properties"),Ei.prototype.fp.call(this,a);var y=a.insertedLinkKeys;if(Array.isArray(y))for(var x=y.length,E=0;E<x;E++){var b=y[E],z=this.jh(b);z===null&&(z=this.Jo({}),this.Ks(z,b),this.fi(z))}if(y=a.modifiedLinkData,Array.isArray(y)){for(x=y.length,E=0;E<x;E++)if(b=y[E],z=this.Ac(b),z=this.jh(z),z!==null){for(var tt in b)tt!=="__gohashid"&&tt!==this.linkKeyProperty&&this.setDataProperty(z,tt,b[tt]);BS(this,b,z)}}if(a=a.removedLinkKeys,Array.isArray(a))for(tt=a.length,y=0;y<tt;y++)x=this.jh(a[y]),x!==null&&this.bm(x)},Vr.prototype.changeState=function(a,y){if(a!==null&&a.model===this){if(a.change===pr){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),Vo(x,E,b);return}}else if(a.change===uo){if(x=a.newParam,a.modelChange==="linkDataArray"){a=a.newValue,Re(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===yo){if(x=a.oldParam,a.modelChange==="linkDataArray"){a=a.oldValue,Re(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}}Ei.prototype.changeState.call(this,a,y)}},wt=Vr.prototype,wt.Vl=function(a){if(a!==void 0){var y=this.Ri;if(y!==null){var x=this.hc(a);x===null&&(x=this.copyNodeData(y),Vo(x,this.nodeKeyProperty,a),this.xf(x))}return a}},wt.yx=function(a){return cl(this,a,!0)},wt.wv=function(a,y){Uf(this,a,y,!0)},wt.Bx=function(a){return cl(this,a,!1)},wt.Bv=function(a,y){Uf(this,a,y,!1)};function cl(a,y,x){if(y!==null&&(a=x?a.lf:a.mf,a!==""&&(a=aa(y,a),a!==void 0))){if(vd(a))return a;Gt((x?"FromKey":"ToKey")+" value for link data "+y+" is not a number or a string: "+a)}}function Uf(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=aa(y,b);z!==x&&(mu(a,z,y),Vo(y,b,x),a.hc(x)===null&&pu(a,x,y),ya(a,E?"linkFromKey":"linkToKey",pr,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Vo(y,b,x)}}wt.zx=function(a){return c0(this,a,!0)},wt.xv=function(a,y){Yf(this,a,y,!0)},wt.Cx=function(a){return c0(this,a,!1)},wt.Cv=function(a,y){Yf(this,a,y,!1)};function c0(a,y,x){return y===null||(a=x?a.ej:a.fj,a==="")?"":(y=aa(y,a),y===void 0?"":y)}function Yf(a,y,x,E){if(y!==null){var b=E?a.ej:a.fj;if(b!=="")if(a.Jc(y)){var z=aa(y,b);z===void 0&&(z=""),z!==x&&(Vo(y,b,x),ya(a,E?"linkFromPortId":"linkToPortId",pr,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Vo(y,b,x)}}wt.Ef=function(a){if(a===null)return f0;var y=this.je;return y===""?f0:(a=aa(a,y),a===void 0?f0:a)},wt.Ls=function(a,y){if(a!==null){var x=this.je;if(x!=="")if(this.Jc(a)){var E=aa(a,x);if(E===void 0&&(E=f0),E!==y){if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)mu(this,E[z],a);for(Vo(a,x,y),b=y.length,z=0;z<b;z++){var tt=y[z];this.hc(tt)===null&&pu(this,tt,a)}ya(this,"linkLabelKeys",pr,x,a,E,y),typeof x=="string"&&this.La(a,x)}}else Vo(a,x,y)}},wt.Bu=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=aa(a,x);if(E===void 0)x=[],x.push(y),this.Ls(a,x);else if(Array.isArray(E)){var b=E.indexOf(y);0<=b||(b=E.length,E.push(y),this.Jc(a)&&(this.hc(y)===null&&pu(this,y,a),ya(this,"linkLabelKeys",uo,x,a,null,y,null,b)))}else Gt(x+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}},wt.Qx=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=aa(a,x);if(Array.isArray(E)){var b=E.indexOf(y);0>b||(E.splice(b,1),this.Jc(a)&&(mu(this,y,a),ya(this,"linkLabelKeys",yo,x,a,y,null,b,null)))}else E!==void 0&&Gt(x+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}},wt.Ac=function(a){if(a!==null){var y=this.Jh;if(y!==""&&(y=aa(a,y),y!==void 0)){if(vd(y))return y;Gt("Key value for link data "+a+" is not a number or a string: "+y)}}},wt.Ks=function(a,y){if(a!==null){var x=this.Jh;if(x!=="")if(this.Jc(a)){var E=aa(a,x);E!==y&&this.jh(y)===null&&(Vo(a,x,y),E!==void 0&&this.wb.remove(E),this.wb.add(y,a),ya(this,"linkKey",pr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},wt.jh=function(a){return a===null&&Gt("GraphLinksModel.findLinkDataForKey:key must not be null"),a!==void 0&&vd(a)?this.wb.I(a):null},wt.Bs=function(a){if(a!==null){var y=this.Jh;if(y!==""){var x=this.Ac(a);if(x===void 0||this.wb.contains(x)){var E=this.cl;if(E!==null&&(x=E(this,a),x!=null&&!this.wb.contains(x))){Vo(a,y,x);return}if(typeof x=="string"){for(E=2;this.wb.contains(x+E);)E++;Vo(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.wb.count-1;this.wb.contains(x);)x--;Vo(a,y,x)}}}}},wt.Jc=function(a){return a===null?!1:this.$f.contains(a)},wt.fi=function(a){a!==null&&(Kr(a),this.Jc(a)||bS(this,a,!0))};function bS(a,y,x){if(a.linkKeyProperty!==""){var E=a.Ac(y);if(E!==void 0&&a.wb.I(E)===y)return;a.Bs(y),E=a.Ac(y),E===void 0&&Gt("GraphLinksModel.makeLinkDataKeyUnique failed on "+y+". Data not added to model."),a.wb.add(E,y)}a.$f.add(y),E=null,x&&(E=a.md.length,a.md.splice(E,0,y)),ya(a,"linkDataArray",uo,"linkDataArray",a,null,y,null,E),cy(a,y)}wt.Ey=function(a){if(Array.isArray(a))for(var y=a.length,x=0;x<y;x++)this.fi(a[x]);else for(a=a.iterator;a.next();)this.fi(a.value)},wt.bm=function(a){a!==null&&NS(this,a,!0)};function NS(a,y,x){a.$f.remove(y);var E=a.Ac(y);if(E!==void 0&&a.wb.remove(E),E=null,x){if(E=a.md.indexOf(y),0>E)return;a.md.splice(E,1)}if(ya(a,"linkDataArray",yo,"linkDataArray",a,y,null,E,null),x=cl(a,y,!0),mu(a,x,y),x=cl(a,y,!1),mu(a,x,y),E=a.Ef(y),Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],mu(a,x,y)}wt.lA=function(a){if(Array.isArray(a))for(var y=a.length,x=0;x<y;x++)this.bm(a[x]);else for(a=a.iterator;a.next();)this.bm(a.value)},wt.Zz=function(a){if(this.linkKeyProperty===""&&Gt("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),a!==this.linkDataArray&&$e(a)){var y=this.kl;y.clear(),y.addAll(this.wb.iteratorKeys);var x=this.il;x.clear();for(var E=a.length,b=0;b<E;b++){var z=a[b],tt=this.Ac(z);if(tt!==void 0){x.add(tt);var rt=this.jh(tt);rt!==z&&(rt!==null?(this.Do(rt,z),BS(this,z,rt)):(z=this.cloneDeep(z),this.Ks(z,tt),this.fi(z)))}else tt=this.cloneDeep(z),this.fi(tt),x.add(this.Ac(tt))}for(a=y.iterator;a.next();)E=a.value,x.contains(E)||(E=this.jh(E))&&this.bm(E);y.clear(),x.clear()}};function cy(a,y){var x=cl(a,y,!0);x=a.Vl(x),a.hc(x)===null&&pu(a,x,y),x=cl(a,y,!1),x=a.Vl(x),a.hc(x)===null&&pu(a,x,y);var E=a.Ef(y);if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],a.hc(x)===null&&pu(a,x,y)}wt.Jo=function(a){if(a===null)return null;var y=this.Ak;return a=y!==null?y(a,this):d0(this,a,!0),Re(a)&&(Wi(a),this.lf!==""&&Vo(a,this.lf,void 0),this.mf!==""&&Vo(a,this.mf,void 0),this.je!==""&&Vo(a,this.je,[])),a},wt.Yu=function(a){if(a===null)return!1;var y=this.jl;return y===""?!1:!!aa(a,y)},wt.lh=function(a){if(a!==null){var y=this.Je;if(y!==""&&(y=aa(a,y),y!==void 0)){if(vd(y))return y;Gt("GroupKey value for node data "+a+" is not a number or a string: "+y)}}},wt.mp=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Je;if(x!=="")if(this.lb(a)){var E=aa(a,x);E!==y&&(mu(this,E,a),Vo(a,x,y),this.hc(y)===null&&pu(this,y,a),ya(this,"nodeGroupKey",pr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},Vr.prototype.copyNodeData=function(a){return a===null?null:(a=Ei.prototype.copyNodeData.call(this,a),this.Ij||this.Je===""||aa(a,this.Je)===void 0||Vo(a,this.Je,void 0),a)},Vr.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){Uf(this,a,x,!0);return}if(y===this.linkToKeyProperty){Uf(this,a,x,!1);return}if(y===this.linkFromPortIdProperty){Yf(this,a,x,!0);return}if(y===this.linkToPortIdProperty){Yf(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=aa(a,y);E!==x&&(Vo(a,y,x),this.Fs(a,y,E,x))},wt=Vr.prototype,wt.Do=function(a,y){if(y){var x=this.lb(a),E=this.Jc(a),b;for(b in y)b==="__gohashid"||x&&b===this.nodeKeyProperty||x&&b===this.nodeIsGroupProperty&&aa(a,b)===y[b]||E&&b===this.linkKeyProperty||this.setDataProperty(a,b,y[b])}},wt.jp=function(a,y){Ei.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(cl(this,E,!0)===b){var tt=this.lf;Vo(E,tt,z),ya(this,"linkFromKey",pr,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)}if(cl(this,E,!1)===b&&(tt=this.mf,Vo(E,tt,z),ya(this,"linkToKey",pr,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)),tt=this.Ef(E),Array.isArray(tt))for(var rt=tt.length,ot=this.je,lt=0;lt<rt;lt++)tt[lt]===b&&(tt[lt]=z,ya(this,"linkLabelKeys",uo,ot,E,b,z,lt,lt))}},wt.qv=function(a,y,x){if(this.lh(a)===y){var E=this.Je;Vo(a,E,x),ya(this,"nodeGroupKey",pr,E,a,y,x),typeof E=="string"&&this.La(a,E)}},wt.Lv=function(){Ei.prototype.Lv.call(this);for(var a=this.linkDataArray,y=a.length,x=0;x<y;x++)cy(this,a[x])},wt.fm=function(a){Ei.prototype.fm.call(this,a),a=this.wa(a);var y=vp(this,a);if(y!==null){var x=Jn();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)){if(this.lh(E)===a){var b=this.Je;ya(this,"nodeGroupKey",pr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}else if(cl(this,E,!0)===a&&(b=this.lf,ya(this,"linkFromKey",pr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),cl(this,E,!1)===a&&(b=this.mf,ya(this,"linkToKey",pr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),b=this.Ef(E),Array.isArray(b))for(var z=b.length,tt=this.je,rt=0;rt<z;rt++)b[rt]===a&&(ya(this,"linkLabelKeys",uo,tt,E,a,a,rt,rt),x.push(E))}for(y=0;y<x.length;y++)mu(this,a,x[y]);li(x)}},wt.em=function(a){Ei.prototype.em.call(this,a);var y=this.lh(a);this.hc(y)===null&&pu(this,y,a)},wt.qp=function(a){Ei.prototype.qp.call(this,a);var y=this.lh(a);mu(this,y,a)},wt.ps=function(a){if(a===null)return"";var y=this.dj;if(y===""||(y=aa(a,y),y===void 0))return"";if(typeof y=="string")return y;Gt("getCategoryForLinkData found a non-string category for "+a+": "+y)},Vr.prototype.getLinkCategoryForData=function(a){return this.ps(a)},Vr.prototype.lp=function(a,y){if(a!==null){var x=this.dj;if(x!=="")if(this.Jc(a)){var E=aa(a,x);E===void 0&&(E=""),E!==y&&(Vo(a,x,y),ya(this,"linkCategory",pr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},Vr.prototype.setLinkCategoryForData=function(a,y){this.lp(a,y)},wt=Vr.prototype,wt.lm=function(a,y){Ei.prototype.lm.call(this,a,y),this.mp(y,this.lh(a))};function BS(a,y,x){a.lp(x,a.ps(y)),a.wv(x,a.yx(y)),a.Bv(x,a.Bx(y)),a.Ls(x,a.Ef(y)),a.xv(x,a.zx(y)),a.Cv(x,a.Cx(y))}wt.Wj=function(){return!0},wt.ri=function(){return!0},wt.xs=function(){return!0},wt.Xj=function(){return!0},Se.Object.defineProperties(Vr.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];Re(b)||Gt("GraphLinksModel.linkDataArray must only contain Objects, not: "+b),Kr(b)}if(this.md=a,this.linkKeyProperty!==""){for(E=new cn,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 gn,b=0;b<x;b++)E.add(a[b]);for(this.$f=E,ya(this,"linkDataArray",pr,"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"}}}),Vr.prototype.setCategoryForLinkData=Vr.prototype.lp,Vr.prototype.getCategoryForLinkData=Vr.prototype.ps,Vr.prototype.assignAllDataProperties=Vr.prototype.Do,Vr.prototype.setGroupKeyForNodeData=Vr.prototype.mp,Vr.prototype.getGroupKeyForNodeData=Vr.prototype.lh,Vr.prototype.isGroupForNodeData=Vr.prototype.Yu,Vr.prototype.copyLinkData=Vr.prototype.Jo,Vr.prototype.mergeLinkDataArray=Vr.prototype.Zz,Vr.prototype.removeLinkDataCollection=Vr.prototype.lA,Vr.prototype.removeLinkData=Vr.prototype.bm,Vr.prototype.addLinkDataCollection=Vr.prototype.Ey,Vr.prototype.addLinkData=Vr.prototype.fi,Vr.prototype.containsLinkData=Vr.prototype.Jc,Vr.prototype.makeLinkDataKeyUnique=Vr.prototype.Bs,Vr.prototype.findLinkDataForKey=Vr.prototype.jh,Vr.prototype.setKeyForLinkData=Vr.prototype.Ks,Vr.prototype.getKeyForLinkData=Vr.prototype.Ac,Vr.prototype.removeLabelKeyForLinkData=Vr.prototype.Qx,Vr.prototype.addLabelKeyForLinkData=Vr.prototype.Bu,Vr.prototype.setLabelKeysForLinkData=Vr.prototype.Ls,Vr.prototype.getLabelKeysForLinkData=Vr.prototype.Ef,Vr.prototype.setToPortIdForLinkData=Vr.prototype.Cv,Vr.prototype.getToPortIdForLinkData=Vr.prototype.Cx,Vr.prototype.setFromPortIdForLinkData=Vr.prototype.xv,Vr.prototype.getFromPortIdForLinkData=Vr.prototype.zx,Vr.prototype.setToKeyForLinkData=Vr.prototype.Bv,Vr.prototype.getToKeyForLinkData=Vr.prototype.Bx,Vr.prototype.setFromKeyForLinkData=Vr.prototype.wv,Vr.prototype.getFromKeyForLinkData=Vr.prototype.yx,Vr.prototype.clear=Vr.prototype.clear;var f0=Object.freeze([]);Vr.className="GraphLinksModel",nu.GraphLinksModel=Vr,Ei.constructGraphLinksModel=Ei.constructGraphLinksModel=function(){return new Vr},Ei.initDiagramModel=hy=function(){return new Vr};function Ls(a,y){Ei.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",a!==void 0&&($e(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}Le(Ls,Ei),Ls.constructGraphLinksModel=Ei.constructGraphLinksModel,Ls.prototype.cloneProtected=function(a){Ei.prototype.cloneProtected.call(this,a),a.Ke=this.Ke,a.Nm=this.Nm,a.nj=this.nj},wt=Ls.prototype,wt.toString=function(a){if(a===void 0&&(a=0),2<=a)return this.np();var y=(this.name!==""?this.name:"")+" TreeModel";if(0<a){y+=`
node data:`,a=this.nodeDataArray;for(var x=a.length,E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+ji(b)}}return y},wt.rm=function(){var a=Ei.prototype.rm.call(this),y="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(y+=`,
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),a+y},wt.gp=function(a){Ei.prototype.gp.call(this,a),a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)},wt.fp=function(a){a.nodeParentKeyProperty!==void 0&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&Gt("applyIncrementalJson cannot change Model properties"),Ei.prototype.fp.call(this,a)},wt.Vl=function(a){return a},wt.mh=function(a){if(a!==null){var y=this.Ke;if(y!==""&&(y=aa(a,y),y!==void 0)){if(vd(y))return y;Gt("ParentKey value for node data "+a+" is not a number or a string: "+y)}}},wt.qe=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Ke;if(x!=="")if(y=this.Vl(y),this.lb(a)){var E=aa(a,x);E!==y&&(mu(this,E,a),Vo(a,x,y),this.hc(y)===null&&pu(this,y,a),ya(this,"nodeParentKey",pr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},wt.ss=function(a){if(a===null)return"";var y=this.nj;return y===""||(y=aa(a,y),y===void 0)?"":typeof y=="string"?y:(Gt("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+y),"")},Ls.prototype.getLinkCategoryForData=function(a){return this.ss(a)},Ls.prototype.Ms=function(a,y){if(a!==null){var x=this.nj;if(x!=="")if(this.lb(a)){var E=aa(a,x);E===void 0&&(E=""),E!==y&&(Vo(a,x,y),ya(this,"parentLinkCategory",pr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},Ls.prototype.setLinkCategoryForData=function(a,y){this.Ms(a,y)},Ls.prototype.copyNodeData=function(a){return a===null?null:(a=Ei.prototype.copyNodeData.call(this,a),this.Jj||this.Ke===""||aa(a,this.Ke)===void 0||Vo(a,this.Ke,void 0),a)},Ls.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=aa(a,y);E!==x&&(Vo(a,y,x),this.Fs(a,y,E,x))},wt=Ls.prototype,wt.jp=function(a,y){Ei.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y)},wt.qv=function(a,y,x){if(this.mh(a)===y){var E=this.Ke;Vo(a,E,x),ya(this,"nodeParentKey",pr,E,a,y,x),typeof E=="string"&&this.La(a,E)}},wt.fm=function(a){Ei.prototype.fm.call(this,a),a=this.wa(a);var y=vp(this,a);if(y!==null){var x=Jn();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)&&this.mh(E)===a){var b=this.Ke;ya(this,"nodeParentKey",pr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}for(y=0;y<x.length;y++)mu(this,a,x[y]);li(x)}},wt.em=function(a){Ei.prototype.em.call(this,a);var y=this.mh(a);y=this.Vl(y),this.hc(y)===null&&pu(this,y,a)},wt.qp=function(a){Ei.prototype.qp.call(this,a);var y=this.mh(a);mu(this,y,a)},wt.lm=function(a,y){Ei.prototype.lm.call(this,a,y),this.Ms(y,this.ss(a)),this.qe(y,this.mh(a))},wt.Tl=function(){return!0},wt.xs=function(){return!0},Se.Object.defineProperties(Ls.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"}}}),Ls.prototype.setParentLinkCategoryForNodeData=Ls.prototype.Ms,Ls.prototype.getParentLinkCategoryForNodeData=Ls.prototype.ss,Ls.prototype.setParentKeyForNodeData=Ls.prototype.qe,Ls.prototype.getParentKeyForNodeData=Ls.prototype.mh,Ls.className="TreeModel",nu.TreeModel=Ls;function Xo(a){Ko.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=iu,this.Ti=0,this.Zv=new At,this.Jp=this.me=0,this.Xr=new Cp,this.gt=this.mj=0,this.ty=600,this.eo=NaN,this.Cm=1,this.ro=0,this.ul=360,this.Rb=iu,this.K=Fs,this.nd=Jf,this.hd=ry,this.tf=6,this.Nn=x0,a&&Object.assign(this,a)}Le(Xo,Ko),Xo.prototype.cloneProtected=function(a){Ko.prototype.cloneProtected.call(this,a),a.eo=this.eo,a.Cm=this.Cm,a.ro=this.ro,a.ul=this.ul,a.Rb=this.Rb,a.K=this.K,a.nd=this.nd,a.hd=this.hd,a.tf=this.tf,a.Nn=this.Nn},Xo.prototype.qb=function(a){a.classType===Xo?a===y0||a===S0||a===m0||a===v0||a===Jf?this.sorting=a:a===rc||a===Xf||a===Fs||a===Sd?this.direction=a:a===zh||a===yd||a===iu||a===ru?this.arrangement=a:(a===Hc||a===x0)&&(this.nodeDiameterFormula=a):Ko.prototype.qb.call(this,a)},Xo.prototype.createNetwork=function(){return new Qf(this)},Xo.prototype.doLayout=function(a){if(this.network===null&&(this.network=this.makeNetwork(a)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),a=this.network.vertexes,1>=a.count)a.count===1&&(a=a.first(),a.centerX=0,a.centerY=0);else{var y=new cn;y.addAll(a.iterator),a=new cn;var x=new cn,E=this.sort(y),b,z,tt=this.Jp,rt=this.arrangement,ot=this.nodeDiameterFormula,lt=this.radius;(!isFinite(lt)||0>=lt)&&(lt=NaN);var ut=this.aspectRatio;(!isFinite(ut)||0>=ut)&&(ut=1);var ft=this.startAngle;isFinite(ft)||(ft=0);var yt=this.sweepAngle;if((!isFinite(yt)||360<yt||1>yt)&&(yt=360),y=this.spacing,isFinite(y)||(y=NaN),rt===ru&&ot===Hc?rt=iu:rt===ru&&ot!==Hc&&(rt=this.arrangement),(this.direction===rc||this.direction===Xf)&&this.sorting!==Jf){for(ot=0;!(ot>=E.length)&&(a.add(E.M(ot)),!(ot+1>=E.length));ot+=2)x.add(E.M(ot+1));this.direction===rc?(this.arrangement===ru&&a.reverse(),E=new cn,E.addAll(a),E.addAll(x)):(this.arrangement===ru&&x.reverse(),E=new cn,E.addAll(x),E.addAll(a))}ot=E.length;for(var xt=z=b=0;xt<E.length;xt++){var Ct=ft+yt*z*(this.direction===Fs?1:-1)/ot,bt=E.M(xt).diameter;isNaN(bt)&&(bt=xd(E.M(xt),Ct)),360>yt&&(xt===0||xt===E.length-1)&&(bt/=2),b+=bt,z++}if(isNaN(lt)||rt===ru){if(isNaN(y)&&(y=6),rt!==iu&&rt!==ru){for(z=-1/0,tt=0;tt<ot;tt++)xt=E.M(tt),b=E.M(tt===ot-1?0:tt+1),isNaN(xt.diameter)&&xd(xt,0),isNaN(b.diameter)&&xd(b,0),z=Math.max(z,(xt.diameter+b.diameter)/2);tt=z+y,rt===zh?lt=(z+y)/(2*Math.PI/ot):lt=g0(this,tt*(360<=yt?ot:ot-1),ut,ft*Math.PI/180,yt*Math.PI/180)}else lt=g0(this,b+(360<=yt?ot:ot-1)*(rt!==ru?y:1.6*y),ut,ft*Math.PI/180,yt*Math.PI/180);z=lt*ut}else if(z=lt*ut,xt=fy(this,lt,z,ft*Math.PI/180,yt*Math.PI/180),isNaN(y))(rt===iu||rt===ru)&&(y=(xt-b)/(360<=yt?ot:ot-1));else if(rt===iu||rt===ru)xt=(xt-b)/(360<=yt?ot:ot-1),xt<y?(lt=g0(this,b+y*(360<=yt?ot:ot-1),ut,ft*Math.PI/180,yt*Math.PI/180),z=lt*ut):y=xt;else{for(tt=-1/0,b=0;b<ot;b++)Ct=E.M(b),bt=E.M(b===ot-1?0:b+1),isNaN(Ct.diameter)&&xd(Ct,0),isNaN(bt.diameter)&&xd(bt,0),tt=Math.max(tt,(Ct.diameter+bt.diameter)/2);tt+=y,b=g0(this,tt*(360<=yt?ot:ot-1),ut,ft*Math.PI/180,yt*Math.PI/180),b>lt?(lt=b,z=lt*ut):tt=xt/(360<=yt?ot:ot-1)}if(this.kw=rt,this.lc=lt,this.Zm=ut,this.lw=ft,this.Wp=yt,this.Ti=y,this.me=z,this.Jp=tt,y=E,E=this.kw,rt=this.lc,lt=this.lw,ut=this.Wp,ft=this.Ti,yt=this.me,ot=this.Jp,this.direction!==rc&&this.direction!==Xf||E!==ru)if(this.direction===rc||this.direction===Xf){switch(tt=0,E){case yd:tt=180*p0(this,rt,yt,lt,ot)/Math.PI;break;case iu:ot=y=0,tt=a.first(),tt!==null&&(y=xd(tt,Math.PI/2)),tt=x.first(),tt!==null&&(ot=xd(tt,Math.PI/2)),tt=180*p0(this,rt,yt,lt,ft+(y+ot)/2)/Math.PI;break;case zh:tt=ut/y.length}if(this.direction===rc){switch(E){case yd:wp(this,a,lt,Sd);break;case iu:Pp(this,a,lt,Sd);break;case zh:xp(this,a,ut/2,lt,Sd)}switch(E){case yd:wp(this,x,lt+tt,Fs);break;case iu:Pp(this,x,lt+tt,Fs);break;case zh:xp(this,x,ut/2,lt+tt,Fs)}}else{switch(E){case yd:wp(this,x,lt,Sd);break;case iu:Pp(this,x,lt,Sd);break;case zh:xp(this,x,ut/2,lt,Sd)}switch(E){case yd:wp(this,a,lt+tt,Fs);break;case iu:Pp(this,a,lt+tt,Fs);break;case zh:xp(this,a,ut/2,lt+tt,Fs)}}}else switch(E){case yd:wp(this,y,lt,this.direction);break;case iu:Pp(this,y,lt,this.direction);break;case zh:xp(this,y,ut,lt,this.direction);break;case ru:AS(this,y,ut,lt,this.direction)}else AS(this,y,ut,lt-ut/2,Fs)}this.updateParts(),this.network=null,this.isValidLayout=!0};function xp(a,y,x,E,b){var z=a.Wp,tt=a.lc;a=a.me,E=E*Math.PI/180,x=x*Math.PI/180;for(var rt=y.length,ot=0;ot<rt;ot++){var lt=E+(b===Fs?ot*x/(360<=z?rt:rt-1):-(ot*x)/rt),ut=y.M(ot),ft=tt*Math.tan(lt)/a;ft=Math.sqrt((tt*tt+a*a*ft*ft)/(1+ft*ft)),ut.centerX=ft*Math.cos(lt),ut.centerY=ft*Math.sin(lt),ut.actualAngle=180*lt/Math.PI}}function Pp(a,y,x,E){var b=a.lc,z=a.me,tt=a.Ti;x=x*Math.PI/180;for(var rt=y.length,ot=0;ot<rt;ot++){var lt=y.M(ot),ut=y.M(ot===rt-1?0:ot+1),ft=z*Math.sin(x);lt.centerX=b*Math.cos(x),lt.centerY=ft,lt.actualAngle=180*x/Math.PI,isNaN(lt.diameter)&&xd(lt,0),isNaN(ut.diameter)&&xd(ut,0),lt=p0(a,b,z,E===Fs?x:-x,(lt.diameter+ut.diameter)/2+tt),x+=E===Fs?lt:-lt}}function wp(a,y,x,E){var b=a.lc,z=a.me,tt=a.Jp;x=x*Math.PI/180;for(var rt=y.length,ot=0;ot<rt;ot++){var lt=y.M(ot);lt.centerX=b*Math.cos(x),lt.centerY=z*Math.sin(x),lt.actualAngle=180*x/Math.PI,lt=p0(a,b,z,E===Fs?x:-x,tt),x+=E===Fs?lt:-lt}}function AS(a,y,x,E,b){var z=a.Wp;if(a.mj=0,a.Xr=new Cp,360>x){for(z=E+(b===Fs?z:-z);0>z;)z+=360;z%=360,180<z&&(z-=360),z*=Math.PI/180,a.gt=z,DS(a,y,x,E,b)}else TS(a,y,x,E,b);a.Xr.commit(y)}function TS(a,y,x,E,b){var z=a.lc,tt=a.Ti,rt=a.Zm,ot=z*Math.cos(E*Math.PI/180),lt=a.me*Math.sin(E*Math.PI/180),ut=y.Fa();if(ut.length===3)ut[0].centerX=z,ut[0].centerY=0,ut[1].centerX=ut[0].centerX-ut[0].width/2-ut[1].width/2-tt,ut[1].y=ut[0].y,ut[2].centerX=(ut[0].centerX+ut[1].centerX)/2,ut[2].y=ut[0].y-ut[2].height-tt;else if(ut.length===4)ut[0].centerX=z,ut[0].centerY=0,ut[2].centerX=-ut[0].centerX,ut[2].centerY=ut[0].centerY,ut[1].centerX=0,ut[1].y=Math.min(ut[0].y,ut[2].y)-ut[1].height-tt,ut[3].centerX=0,ut[3].y=Math.max(ut[0].y+ut[0].height+tt,ut[2].y+ut[2].height+tt);else{z=At.alloc();for(var ft=0;ft<ut.length&&(ut[ft].centerX=ot,ut[ft].centerY=lt,!(ft>=ut.length-1));ft++)OS(a,ot,lt,ut,ft,b,z)||IS(a,ot,lt,ut,ft,b,z),ot=z.x,lt=z.y;if(At.free(z),a.mj++,!(23<a.mj)){ot=ut[0].centerX,lt=ut[0].centerY,z=ut[ut.length-1].centerX,ft=ut[ut.length-1].centerY;var yt=Math.abs(ot-z)-((ut[0].width+ut[ut.length-1].width)/2+tt),xt=Math.abs(lt-ft)-((ut[0].height+ut[ut.length-1].height)/2+tt);tt=0,1>Math.abs(xt)?Math.abs(ot-z)<(ut[0].width+ut[ut.length-1].width)/2&&(tt=0):tt=0<xt?xt:1>Math.abs(yt)?0:yt,ot=Math.abs(z)>Math.abs(ft)?0<z!=lt>ft:0<ft!=ot<z,(ot=b===Fs?ot:!ot)&&(tt=-Math.abs(tt),tt=Math.min(tt,-ut[ut.length-1].width),tt=Math.min(tt,-ut[ut.length-1].height)),a.Xr.compare(tt,ut),1<Math.abs(tt)&&(a.lc=8>a.mj?a.lc-tt/(2*Math.PI):5>ut.length&&10<tt?a.lc/2:a.lc-(0<tt?1.7:-2.3),a.me=a.lc*rt,TS(a,y,x,E,b))}}}function DS(a,y,x,E,b){for(var z=a.lc,tt=a.me,rt=a.Zm,ot=z*Math.cos(E*Math.PI/180),lt=tt*Math.sin(E*Math.PI/180),ut=At.alloc(),ft=y.Fa(),yt=0;yt<ft.length&&(ft[yt].centerX=ot,ft[yt].centerY=lt,!(yt>=ft.length-1));yt++)OS(a,ot,lt,ft,yt,b,ut)||IS(a,ot,lt,ft,yt,b,ut),ot=ut.x,lt=ut.y;if(At.free(ut),a.mj++,!(23<a.mj)){if(ot=Math.atan2(lt,ot),ot=b===Fs?a.gt-ot:ot-a.gt,ot=Math.abs(ot)<Math.abs(ot-2*Math.PI)?ot:ot-2*Math.PI,z=ot*(z+tt)/2,tt=a.Xr,Math.abs(z)<Math.abs(tt.Pl))for(tt.Pl=z,tt.mk=[],tt.tm=[],ot=0;ot<ft.length;ot++)tt.mk[ot]=ft[ot].bounds.x,tt.tm[ot]=ft[ot].bounds.y;1<Math.abs(z)&&(a.lc=8>a.mj?a.lc-z/(2*Math.PI):a.lc-(0<z?1.7:-2.3),a.me=a.lc*rt,DS(a,y,x,E,b))}}function OS(a,y,x,E,b,z,tt){var rt=a.lc,ot=a.me,lt=0;a=(E[b].width+E[b+1].width)/2+a.Ti;var ut=!1;if(0<=x!=(z===Fs)){if(z=y+a,z>rt){if(z=y-a,z<-rt)return tt.x=z,tt.y=lt,!1;ut=!0}}else if(z=y-a,z<-rt){if(z=y+a,z>rt)return tt.x=z,tt.y=lt,!1;ut=!0}return lt=Math.sqrt(1-Math.min(1,z*z/(rt*rt)))*ot,0>x!==ut&&(lt=-lt),Math.abs(x-lt)>(E[b].height+E[b+1].height)/2?(tt.x=z,tt.y=lt,!1):(tt.x=z,tt.y=lt,!0)}function IS(a,y,x,E,b,z,tt){var rt=a.lc,ot=a.me,lt=0;if(a=(E[b].height+E[b+1].height)/2+a.Ti,E=!1,0<=y!=(z===Fs)){if(z=x-a,z<-ot){if(z=x+a,z>ot){tt.x=lt,tt.y=z;return}E=!0}}else if(z=x+a,z>ot){if(z=x-a,z<-ot){tt.x=lt,tt.y=z;return}E=!0}lt=Math.sqrt(1-Math.min(1,z*z/(ot*ot)))*rt,0>y!==E&&(lt=-lt),tt.x=lt,tt.y=z}Xo.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},Xo.prototype.commitNodes=function(){var a=this.group!==null&&this.group.placeholder!==null&&this.group.isSubGraphExpanded,y=a?this.group.location.copy():null,x=this.actualCenter;a?x=new At(0,0):(x.x=this.arrangementOrigin.x+this.lc,x.y=this.arrangementOrigin.y+this.me);for(var E=this.network.vertexes.iterator;E.next();){var b=E.value;b.x+=x.x,b.y+=x.y,b.commit()}a&&(this.group.Va(),a=this.group.position.copy(),x=this.group.location.copy(),y=y.re(x.re(a)),this.group.move(y),this.Zv=y.re(a))},Xo.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function fy(a,y,x,E,b){var z=a.ty;if(.001>Math.abs(a.Zm-1))return E!==void 0&&b!==void 0?b*y:2*Math.PI*y;a=y>x?Math.sqrt(y*y-x*x)/y:Math.sqrt(x*x-y*y)/x;for(var tt=0,rt=E!==void 0&&b!==void 0?b/(z+1):Math.PI/(2*(z+1)),ot=0,lt=0;lt<=z;lt++){E!==void 0&&b!==void 0?ot=E+lt*b/z:ot=lt*Math.PI/(2*z);var ut=Math.sin(ot);tt+=Math.sqrt(1-a*a*ut*ut)*rt}return E!==void 0&&b!==void 0?(y>x?y:x)*tt:4*(y>x?y:x)*tt}function g0(a,y,x,E,b){return y/(E!==void 0&&b!==void 0?fy(a,1,x,E,b):fy(a,1,x))}function p0(a,y,x,E,b){if(.001>Math.abs(a.Zm-1))return b/y;var z=y>x?Math.sqrt(y*y-x*x)/y:Math.sqrt(x*x-y*y)/x,tt=0;a=2*Math.PI/(700*a.network.vertexes.count),y>x&&(E+=Math.PI/2);for(var rt=0;;rt++){var ot=Math.sin(E+rt*a);if(tt+=(y>x?y:x)*Math.sqrt(1-z*z*ot*ot)*a,tt>=b)return rt*a}}Xo.prototype.sort=function(a){switch(this.sorting){case m0:break;case v0:a.reverse();break;case y0:a.sort(this.comparer);break;case S0:a.sort(this.comparer),a.reverse();break;case Jf:return this.ak(Tx(a));default:Gt("Invalid sorting type.")}return a};function Tx(a){for(var y=[],x=0;x<a.length;x++)y.push(0);x=new cn;for(var E=0;E<a.length;E++){var b=-1,z=-1;if(E===0)for(var tt=0;tt<a.length;tt++){var rt=a.M(tt).edgesCount;rt>b&&(b=rt,z=tt)}else for(tt=0;tt<a.length;tt++)rt=y[tt],rt>b&&(b=rt,z=tt);for(x.add(a.M(z)),y[z]=-1,z=a.M(z),tt=z.sourceEdges;tt.next();)b=a.indexOf(tt.value.fromVertex),0>b||0<=y[b]&&y[b]++;for(z=z.destinationEdges;z.next();)b=a.indexOf(z.value.toVertex),0>b||0<=y[b]&&y[b]++}return x}Xo.prototype.ak=function(a){for(var y=[],x=0;x<a.length;x++){var E=a.M(x);y[x]=[];for(var b,z=E.destinationEdges;z.next();)b=a.indexOf(z.value.toVertex),b!==x&&0>y[x].indexOf(b)&&y[x].push(b);for(E=E.sourceEdges;E.next();)b=a.indexOf(E.value.fromVertex),b!==x&&0>y[x].indexOf(b)&&y[x].push(b)}for(z=[],x=0;x<y.length;x++)z[x]=0;x=[];var tt=[],rt=[];E=[],b=new cn;for(var ot=0,lt=0;lt<y.length;lt++){var ut=y[lt].length;if(ut===1)E.push(lt);else if(ut===0)b.add(a.M(lt));else{if(ot===0)x.push(lt);else{for(var ft=ut=1/0,yt=-1,xt=[],Ct=0;Ct<x.length;Ct++)0>y[x[Ct]].indexOf(x[Ct===x.length-1?0:Ct+1])&&xt.push(Ct===x.length-1?0:Ct+1);if(xt.length===0)for(Ct=0;Ct<x.length;Ct++)xt.push(Ct);for(Ct=0;Ct<xt.length;Ct++){for(var bt=xt[Ct],Vt=y[lt],zt=0,$t=0;$t<tt.length;$t++){var ie=z[tt[$t]],oe=z[rt[$t]];if(ie<oe){var de=ie;ie=oe}else de=oe;if(de<bt&&bt<=ie)for(oe=0;oe<Vt.length;oe++){var ke=Vt[oe];0>x.indexOf(ke)||de<z[ke]&&z[ke]<ie||de===z[ke]||ie===z[ke]||zt++}else for(oe=0;oe<Vt.length;oe++)ke=Vt[oe],0>x.indexOf(ke)||de<z[ke]&&z[ke]<ie&&de!==z[ke]&&ie!==z[ke]&&zt++}for(Vt=zt,$t=zt=0;$t<y[lt].length;$t++)de=x.indexOf(y[lt][$t]),0<=de&&(de=Math.abs(bt-(de>=bt?de+1:de)),zt+=de<x.length+1-de?de:x.length+1-de);for($t=0;$t<tt.length;$t++)de=z[tt[$t]],ie=z[rt[$t]],de>=bt&&de++,ie>=bt&&ie++,de>ie&&(oe=ie,ie=de,de=oe),ie-de<(x.length+2)/2==(de<bt&&bt<=ie)&&zt++;(Vt<ut||Vt===ut&&zt<ft)&&(ut=Vt,ft=zt,yt=bt)}for(x.splice(yt,0,lt),ut=0;ut<x.length;ut++)z[x[ut]]=ut;for(ut=0;ut<y[lt].length;ut++)ft=y[lt][ut],0<=x.indexOf(ft)&&(tt.push(lt),rt.push(ft))}ot++}}for(tt=x.length;;){for(z=!0,rt=0;rt<E.length;rt++)if(ot=E[rt],lt=y[ot][0],ut=x.indexOf(lt),0<=ut){for(yt=ft=0;yt<y[lt].length;yt++)xt=x.indexOf(y[lt][yt]),0>xt||xt===ut||(Ct=xt>ut?xt-ut:ut-xt,ft+=xt<ut!=Ct>tt-Ct?1:-1);x.splice(0>ft?ut:ut+1,0,ot),E.splice(rt,1),rt--}else z=!1;if(z)break;x.push(E[0]),E.splice(0,1)}for(y=0;y<x.length;y++)b.add(a.M(x[y]));return b},Se.Object.defineProperties(Xo.prototype,{radius:{get:function(){return this.eo},set:function(a){this.eo!==a&&(0<a||isNaN(a))&&(this.eo=a,this.C())}},aspectRatio:{get:function(){return this.Cm},set:function(a){this.Cm!==a&&0<a&&(this.Cm=a,this.C())}},startAngle:{get:function(){return this.ro},set:function(a){this.ro!==a&&(this.ro=a,this.C())}},sweepAngle:{get:function(){return this.ul},set:function(a){this.ul!==a&&(0<a&&360>=a?this.ul=a:this.ul=360,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==ru&&a!==iu&&a!==yd&&a!==zh||(this.Rb=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==Fs&&a!==Sd&&a!==rc&&a!==Xf||(this.K=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==m0&&a!==v0&&a!==y0&&!S0&&a!==Jf||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}},spacing:{get:function(){return this.tf},set:function(a){this.tf!==a&&(this.tf=a,this.C())}},nodeDiameterFormula:{get:function(){return this.Nn},set:function(a){this.Nn===a||a!==x0&&a!==Hc||(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 iu=new en(Xo,"ConstantSpacing",0),yd=new en(Xo,"ConstantDistance",1),zh=new en(Xo,"ConstantAngle",2),ru=new en(Xo,"Packed",3),Fs=new en(Xo,"Clockwise",4),Sd=new en(Xo,"Counterclockwise",5),rc=new en(Xo,"BidirectionalLeft",6),Xf=new en(Xo,"BidirectionalRight",7),m0=new en(Xo,"Forwards",8),v0=new en(Xo,"Reverse",9),y0=new en(Xo,"Ascending",10),S0=new en(Xo,"Descending",11),Jf=new en(Xo,"Optimized",12),x0=new en(Xo,"Pythagorean",13),Hc=new en(Xo,"Circular",14);Xo.className="CircularLayout",Xo.ConstantSpacing=iu,Xo.ConstantDistance=yd,Xo.ConstantAngle=zh,Xo.Packed=ru,Xo.Clockwise=Fs,Xo.Counterclockwise=Sd,Xo.BidirectionalLeft=rc,Xo.BidirectionalRight=Xf,Xo.Forwards=m0,Xo.Reverse=v0,Xo.Ascending=y0,Xo.Descending=S0,Xo.Optimized=Jf,Xo.Pythagorean=x0,Xo.Circular=Hc;function Cp(){this.Pl=-1/0,this.tm=this.mk=null}Cp.prototype.compare=function(a,y){if(0<a&&0>this.Pl||Math.abs(a)<Math.abs(this.Pl)&&!(0>a&&0<this.Pl))for(this.Pl=a,this.mk=[],this.tm=[],a=0;a<y.length;a++)this.mk[a]=y[a].bounds.x,this.tm[a]=y[a].bounds.y},Cp.prototype.commit=function(a){if(this.mk!==null&&this.tm!==null)for(var y=0;y<this.mk.length;y++){var x=a.M(y);x.x=this.mk[y],x.y=this.tm[y]}},Cp.className="VertexArrangement";function Qf(a){Do.call(this,a)}Le(Qf,Do),Qf.prototype.createVertex=function(){return new Ep(this)},Qf.prototype.createEdge=function(){return new P0(this)},Qf.className="CircularNetwork";function Ep(a){Ca.call(this,a),this.u=this.Si=NaN}Le(Ep,Ca);function xd(a,y){var x=a.network;if(x===null)return NaN;if(x=x.layout,x===null)return NaN;if(x.arrangement===ru)if(x.nodeDiameterFormula===Hc)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===Hc?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.Si}Se.Object.defineProperties(Ep.prototype,{diameter:{get:function(){return this.Si},set:function(a){this.Si!==a&&(this.Si=a)}},actualAngle:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}}}),Ep.className="CircularVertex";function P0(a){qs.call(this,a)}Le(P0,qs),P0.className="CircularEdge";function es(a){Ko.call(this),this.ah=null,this.An=0,this.$d=new nn(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)}Le(es,Ko),es.prototype.cloneProtected=function(a){Ko.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},es.prototype.createNetwork=function(){return new Wc(this)},es.prototype.doLayout=function(a){if(this.network===null&&(this.network=this.makeNetwork(a)),a=this.maxIterations,0<this.network.vertexes.count){this.network.Ko();for(var y=this.network.vertexes.iterator;y.next();){var x=y.value;x.charge=this.electricalCharge(x),x.mass=this.gravitationalMass(x)}for(y=this.network.edges.iterator;y.next();)x=y.value,x.stiffness=this.springStiffness(x),x.length=this.springLength(x);if(this.Cu(),this.An=0,this.needsClusterLayout()){y=this.network,x=y.Zx();for(var E=x.iterator;E.next();){this.network=E.value;for(var b=this.network.vertexes.iterator;b.next();){var z=b.value;z.Vd=z.vertexes.count,z.sh=1,z.Hj=null,z.We=null}_S(this,0,a)}this.network=y;var tt=E=x.iterator;E=this.arrangementSpacing;var rt=tt.count,ot=!0;z=b=0;for(var lt=Jn(),ut=0;ut<rt+y.vertexes.count+2;ut++)lt[ut]=null;rt=0,tt.reset();for(var ft=Te.alloc();tt.next();)if(ut=tt.value,this.computeBounds(ut,ft),ot)ot=!1,b=ft.x+ft.width/2,z=ft.y+ft.height/2,lt[0]=new At(ft.x+ft.width+E.width,ft.y),lt[1]=new At(ft.x,ft.y+ft.height+E.height),rt=2;else{var yt=RS(lt,rt,b,z,ft.width,ft.height,E),xt=lt[yt],Ct=new At(xt.x+ft.width+E.width,xt.y),bt=new At(xt.x,xt.y+ft.height+E.height);for(yt+1<rt&&lt.splice(yt+1,0,null),lt[yt]=Ct,lt[yt+1]=bt,rt++,yt=xt.x-ft.x,xt=xt.y-ft.y,ut=ut.vertexes.iterator;ut.next();)Ct=ut.value,Ct.centerX+=yt,Ct.centerY+=xt}for(Te.free(ft),ut=y.vertexes.iterator;ut.next();)tt=ut.value,yt=tt.bounds,2>rt?(b=yt.x+yt.width/2,z=yt.y+yt.height/2,lt[0]=new At(yt.x+yt.width+E.width,yt.y),lt[1]=new At(yt.x,yt.y+yt.height+E.height),rt=2):(ot=RS(lt,rt,b,z,yt.width,yt.height,E),ft=lt[ot],xt=new At(ft.x+yt.width+E.width,ft.y),yt=new At(ft.x,ft.y+yt.height+E.height),ot+1<rt&&lt.splice(ot+1,0,null),lt[ot]=xt,lt[ot+1]=yt,rt++,tt.centerX=ft.x+tt.width/2,tt.centerY=ft.y+tt.height/2);for(li(lt),E=x.iterator;E.next();){for(x=E.value,b=x.vertexes.iterator;b.next();)y.dh(b.value);for(x=x.edges.iterator;x.next();)y.Bo(x.value)}}zS(this,a),this.updateParts()}this.dl=a,this.network=null,this.isValidLayout=!0},es.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},es.prototype.computeBounds=function(a,y){var x=!0;for(a=a.vertexes.iterator;a.next();){var E=a.value;x?(x=!1,y.set(E.bounds)):y.ed(E.bounds)}return y};function _S(a,y,x){if(Dx(a,y)){var E=a.Zf;a.Zf*=1+1/(y+1);var b=Ox(a,y),z=Math.max(0,Math.max(Math.min(a.network.vertexes.count,x*(y+1)/11),10));for(a.maxIterations+=z,_S(a,y+1,x),zS(a,z),Ix(a,b),y=b.vertexes.Fa(),y.sort(function(tt,rt){return tt===null||rt===null||tt===rt?0:rt.Vd-tt.Vd}),x=0;x<y.length;x++)_x(a,y[x]);a.Zf=E}}function Dx(a,y){if(10<y||3>a.network.vertexes.count)return!1;for(a.ah=a.network.vertexes.Fa(),a=a.ah,a.sort(function(x,E){return x===null||E===null||x===E?0:E.Vd-x.Vd}),y=a.length-1;0<=y&&1>=a[y].Vd;)y--;return 1<a.length-y}function Ox(a,y){for(var x=a.network,E=new Wc(a),b=0;b<a.ah.length;b++){var z=a.ah[b];if(1<z.Vd){E.dh(z);var tt=new ZS;tt.Rs=z.Vd,tt.Ss=z.width,tt.Qs=z.height,tt.Sv=z.focus.x,tt.Tv=z.focus.y,z.We===null&&(z.We=new cn),z.We.add(tt),z.sv=z.We.count-1}else break}for(z=x.edges.iterator;z.next();){var rt=z.value;b=rt.fromVertex,tt=rt.toVertex,b.network===E&&tt.network===E?E.Bo(rt):b.network===E?(rt=b.Hj,rt===null&&(rt=new cn,b.Hj=rt),rt.add(tt),b.Vd--,b.sh+=tt.sh):tt.network===E&&(rt=tt.Hj,rt===null&&(rt=new cn,tt.Hj=rt),rt.add(b),tt.Vd--,tt.sh+=b.sh)}for(b=E.edges.iterator;b.next();)z=b.value,z.length*=Math.max(1,_t.sqrt((z.fromVertex.sh+z.toVertex.sh)/(4*y+1)));for(y=E.vertexes.iterator;y.next();){b=y.value;var ot=b.Hj;if(ot!==null&&0<ot.count&&(tt=b.We.M(b.We.count-1).Rs-b.Vd,!(0>=tt))){for(var lt=rt=0,ut=ot.count-tt;ut<ot.count;ut++){var ft=ot.M(ut),yt=null;for(z=ft.edges.iterator;z.next();){var xt=z.value;if(xt.Ax(ft)===b){yt=xt;break}}yt!==null&&(lt+=yt.length,rt+=ft.width*ft.height)}z=b.centerX,ot=b.centerY,ut=b.width,ft=b.height,yt=b.focus,xt=ut*ft,1>xt&&(xt=1),rt=_t.sqrt((rt+xt+lt*lt*4/(tt*tt))/xt),tt=(rt-1)*ut/2,rt=(rt-1)*ft/2,b.bounds=new Te(z-yt.x-tt,ot-yt.y-rt,ut+2*tt,ft+2*rt),b.focus=new At(yt.x+tt,yt.y+rt)}}return a.network=E,x}function Ix(a,y){for(var x=a.network.vertexes.iterator;x.next();){var E=x.value;if(E.network=y,E.We!==null){var b=E.We.M(E.sv);E.Vd=b.Rs;var z=b.Sv,tt=b.Tv;E.bounds=new Te(E.centerX-z,E.centerY-tt,b.Ss,b.Qs),E.focus=new At(z,tt),E.sv--}}for(x=a.network.edges.iterator;x.next();)x.value.network=y;a.network=y}function _x(a,y){var x=y.Hj;if(x!==null&&x.count!==0){var E=y.centerX,b=y.centerY,z=y.width,tt=y.height;y.We!==null&&0<y.We.count&&(tt=y.We.M(0),z=tt.Ss,tt=tt.Qs),z=_t.sqrt(z*z+tt*tt)/2;for(var rt=!1,ot=tt=0,lt=0,ut=y.vertexes.iterator;ut.next();){var ft=ut.value;1>=ft.Vd?ot++:(rt=!0,lt++,tt+=Math.atan2(y.centerY-ft.centerY,y.centerX-ft.centerX))}if(ot!==0){for(0<lt&&(tt/=lt),lt=y=0,y=rt?2*Math.PI/(ot+1):2*Math.PI/ot,ot%2===0&&(lt=y/2),1<x.count&&x.sort(function(xt,Ct){return xt===null||Ct===null||xt===Ct?0:Ct.width*Ct.height-xt.width*xt.height}),rt=ot%2===0?0:1,x=x.iterator;x.next();)if(ot=x.value,!(1<ot.Vd||a.isFixed(ot))){for(ut=null,ft=ot.edges.iterator;ft.next();){ut=ft.value;break}ft=ot.width;var yt=ot.height;ft=_t.sqrt(ft*ft+yt*yt)/2,ut=z+ut.length+ft,ft=tt+(y*(rt/2>>1)+lt)*(rt%2===0?1:-1),ot.centerX=E+ut*Math.cos(ft),ot.centerY=b+ut*Math.sin(ft),rt++}}}}function RS(a,y,x,E,b,z,tt){var rt=9e19,ot=-1,lt=0;t:for(;lt<y;lt++){var ut=a[lt],ft=ut.x-x,yt=ut.y-E;if(ft=ft*ft+yt*yt,ft<rt){for(yt=lt-1;0<=yt;yt--)if(a[yt].y>ut.y&&a[yt].x-ut.x<b+tt.width)continue t;for(yt=lt+1;yt<y;yt++)if(a[yt].x>ut.x&&a[yt].y-ut.y<z+tt.height)continue t;ot=lt,rt=ft}}return ot}es.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},es.prototype.addComments=function(a){var y=a.node;if(y!==null)for(y=y.Mu();y.next();){var x=y.value;if(x.category==="Comment"&&x.isVisible()){var E=this.network.ki(x);E===null&&(E=this.network.Bl(x)),E.charge=this.defaultCommentElectricalCharge,x=null;for(var b=E.destinationEdges;b.next();){var z=b.value;if(z.toVertex===a){x=z;break}}if(x===null){for(b=E.sourceEdges;b.next();)if(z=b.value,z.fromVertex===a){x=z;break}}x===null&&(x=this.network.Zj(a,E,null)),x.length=this.defaultCommentSpringLength}}};function jS(a,y){var x=a.bounds,E=x.x;a=x.y;var b=x.width;x=x.height;var z=y.bounds,tt=z.x;y=z.y;var rt=z.width;return z=z.height,E+b<tt?a>y+z?(x=E+b-tt,a=a-y-z,_t.sqrt(x*x+a*a)):a+x<y?(E=E+b-tt,a=a+x-y,_t.sqrt(E*E+a*a)):tt-(E+b):E>tt+rt?a>y+z?(x=E-tt-rt,a=a-y-z,_t.sqrt(x*x+a*a)):a+x<y?(E=E-tt-rt,a=a+x-y,_t.sqrt(E*E+a*a)):E-(tt+rt):a>y+z?a-(y+z):a+x<y?y-(a+x):.1}function zS(a,y){for(a.ah=null,y=a.An+y;a.An<y&&(a.An++,Rx(a)););a.ah=null}function Rx(a){a.ah===null&&(a.ah=a.network.vertexes.Fa());var y=a.ah;if(0>=y.length)return!1;var x=y[0];x.forceX=0,x.forceY=0;for(var E=x.centerX,b=E,z=x=x.centerY,tt=1;tt<y.length;tt++){var rt=y[tt];rt.forceX=0,rt.forceY=0;var ot=rt.centerX;rt=rt.centerY,E=Math.min(E,ot),b=Math.max(b,ot),x=Math.min(x,rt),z=Math.max(z,rt)}(b=b-E>z-x)?y.sort(function(bt,Vt){return bt===null||Vt===null||bt===Vt?0:bt.centerX-Vt.centerX}):y.sort(function(bt,Vt){return bt===null||Vt===null||bt===Vt?0:bt.centerY-Vt.centerY}),x=a.Zf;var lt=E=rt=0;for(z=0;z<y.length;z++){tt=y[z],E=tt.bounds,rt=tt.focus,ot=E.x+rt.x;var ut=E.y+rt.y;E=tt.charge*a.electricalFieldX(ot,ut),lt=tt.charge*a.electricalFieldY(ot,ut),E+=tt.mass*a.gravitationalFieldX(ot,ut),lt+=tt.mass*a.gravitationalFieldY(ot,ut),tt.forceX+=E,tt.forceY+=lt;for(var ft=z+1;ft<y.length;ft++){var yt=y[ft];if(yt!==tt){E=yt.bounds,rt=yt.focus,lt=E.x+rt.x;var xt=E.y+rt.y;if(ot-lt>x||lt-ot>x){if(b)break}else if(ut-xt>x||xt-ut>x){if(!b)break}else{var Ct=jS(tt,yt);1>Ct?(E=a.randomNumberGenerator,E===null&&(a.randomNumberGenerator=E=new w0),Ct=E.random(),rt=E.random(),ot>lt?(E=Math.abs(yt.bounds.right-tt.bounds.x),E=(1+E)*Ct):ot<lt?(E=Math.abs(yt.bounds.x-tt.bounds.right),E=-(1+E)*Ct):(E=Math.max(yt.width,tt.width),E=(1+E)*Ct-E/2),ut>xt?(lt=Math.abs(yt.bounds.bottom-tt.bounds.y),lt=(1+lt)*rt):ot<lt?(lt=Math.abs(yt.bounds.y-tt.bounds.bottom),lt=-(1+lt)*rt):(lt=Math.max(yt.height,tt.height),lt=(1+lt)*rt-lt/2)):(rt=-(tt.charge*yt.charge)/(Ct*Ct),E=(lt-ot)/Ct*rt,lt=(xt-ut)/Ct*rt),tt.forceX+=E,tt.forceY+=lt,yt.forceX-=E,yt.forceY-=lt}}}}for(b=a.network.edges.iterator;b.next();)rt=b.value,x=rt.fromVertex,z=rt.toVertex,tt=x.bounds,ot=x.focus,E=tt.x+ot.x,tt=tt.y+ot.y,ut=z.bounds,ft=z.focus,ot=ut.x+ft.x,ut=ut.y+ft.y,ft=jS(x,z),1>ft?(ft=a.randomNumberGenerator,ft===null&&(a.randomNumberGenerator=ft=new w0),rt=ft.random(),ft=ft.random(),E=(E>ot?1:-1)*(1+(z.width>x.width?z.width:x.width))*rt,lt=(tt>ut?1:-1)*(1+(z.height>x.height?z.height:x.height))*ft):(rt=rt.stiffness*(ft-rt.length),E=(ot-E)/ft*rt,lt=(ut-tt)/ft*rt),x.forceX+=E,x.forceY+=lt,z.forceX-=E,z.forceY-=lt;for(b=E=0;b<y.length;b++)x=y[b],a.isFixed(x)?a.moveFixedVertex(x):E=Math.max(E,a.moveVertex(x)||0);return E>a.epsilonDistance*a.epsilonDistance}es.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},es.prototype.moveFixedVertex=function(){},es.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},es.prototype.yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var y=a.value.link;y!==null&&(y.fromSpot=xa,y.toSpot=xa)}},es.prototype.commitNodes=function(){var a=0,y=0;if(this.arrangesToOrigin){var x=Te.alloc();this.computeBounds(this.network,x),y=this.arrangementOrigin,a=y.x-x.x,y=y.y-x.y,Te.free(x)}x=Te.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()}Te.free(x)},es.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},es.prototype.springStiffness=function(a){return a=a.stiffness,isNaN(a)?this.Hk:a},es.prototype.springLength=function(a){return a=a.length,isNaN(a)?this.Gk:a},es.prototype.electricalCharge=function(a){return a=a.charge,isNaN(a)?this.Ek:a},es.prototype.electricalFieldX=function(){return 0},es.prototype.electricalFieldY=function(){return 0},es.prototype.gravitationalMass=function(a){return a=a.mass,isNaN(a)?this.Fk:a},es.prototype.gravitationalFieldX=function(){return 0},es.prototype.gravitationalFieldY=function(){return 0},es.prototype.isFixed=function(a){return a.isFixed},Se.Object.defineProperties(es.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"&&Gt('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())}}}),es.className="ForceDirectedLayout";function ZS(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}ZS.className="ForceDirectedSubnet";function Wc(a){Do.call(this,a)}Le(Wc,Do),Wc.prototype.createVertex=function(){return new Lp(this)},Wc.prototype.createEdge=function(){return new Fp(this)},Wc.className="ForceDirectedNetwork";function Lp(a){Ca.call(this,a),this.ia=!1,this.Ha=this.u=NaN,this.sh=this.Vd=this.V=this.F=0,this.We=this.Hj=null,this.sv=0}Le(Lp,Ca),Se.Object.defineProperties(Lp.prototype,{isFixed:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},charge:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},mass:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},forceX:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}},forceY:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}}}),Lp.className="ForceDirectedVertex";function Fp(a){qs.call(this,a),this.j=this.o=NaN}Le(Fp,qs),Se.Object.defineProperties(Fp.prototype,{stiffness:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},length:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}}}),Fp.className="ForceDirectedEdge";function w0(){var a=0;a===void 0&&(a=42),this.seed=a,this.ay=48271,this.ey=2147483647,this.Q=44488.07041494893,this.gy=3399,this.by=1/2147483647,this.random()}w0.prototype.random=function(){var a=this.seed%this.Q*this.ay-this.seed/this.Q*this.gy;return 0<a?this.seed=a:this.seed=a+this.ey,this.seed*this.by},w0.className="RandomNumberGenerator";function Po(a){Ko.call(this),this.kc=this.ie=25,this.K=0,this.Dk=M0,this.Zk=k0,this.Qk=b0,this.bj=4,this.rk=N0,this.bg=15,this.sf=!0,this.Cn=4,this.Ra=this.Iq=this.Ia=-1,this.Md=this.Hn=0,this.Ta=this.Kd=this.Ld=this.he=this.tc=null,this.Kn=0,this.Jn=this.kj=null,this.le=0,this.fl=null,this.Rf=new At,this.He=[],this.He.length=100,this.xw=this.ve=0,a&&Object.assign(this,a)}Le(Po,Ko),Po.prototype.cloneProtected=function(a){Ko.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},Po.prototype.qb=function(a){a.classType===Po?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:Gt("Unknown enum value: "+a):Ko.prototype.qb.call(this,a)},Po.prototype.createNetwork=function(){return new qf(this)},Po.prototype.doLayout=function(a){for(this.network===null&&(this.network=this.makeNetwork(a)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),this.Iq=-1,this.Md=this.Hn=0,this.fl=this.Jn=this.kj=null,a=0;a<this.He.length;a++)this.He[a]=null;if(0<this.network.vertexes.count){for(this.network.Ko(),this.cycleRemoveOption!==kp&&this.removeCycles(),a=this.network.vertexes.iterator;a.next();)a.value.layer=-1;for(this.Ia=-1,this.assignLayers(),a.reset();a.next();)this.Ia=Math.max(this.Ia,a.value.layer);this.cycleRemoveOption===kp&&this.removeCycles(),a=this.network;for(var y=[],x=a.edges.iterator;x.next();){var E=x.value;E.valid=!1,y.push(E)}for(x=0;x<y.length;x++){E=y[x];var b=E.fromVertex,z=E.toVertex;if(!(E.valid||(b.node===null&&b.data===null||z.node===null&&z.data===null)&&b.layer===z.layer)){var tt=0,rt=0,ot=0,lt=0;if(E.link!==null){if(rt=E.link,rt===null)continue;var ut=b.node;if(tt=z.node,ut===null||tt===null)continue;var ft=rt.fromNode;ot=rt.toNode;for(var yt=rt.fromPort;yt!==null&&!yt.Ed();)yt=yt.panel;for(rt=rt.toPort;rt!==null&&!rt.Ed();)rt=rt.panel;if(E.rev){lt=ft;var xt=yt;ft=ot,yt=rt,ot=lt,rt=xt}var Ct=b.focus;lt=z.focus;var bt=E.rev?z.bounds:b.bounds;xt=At.alloc(),ut!==ft?bt.w()&&ft.isVisible()?ft.actualBounds.w()?(Oh(ft,yt,dr,xt),xt.x+=ft.actualBounds.x-bt.x,xt.y+=ft.actualBounds.y-bt.y):(Oh(ft,yt,dr,xt),xt.w()||xt.assign(Ct)):xt.assign(Ct):bt.w()?(Oh(ft,yt,dr,xt),xt.w()||xt.assign(Ct)):xt.assign(Ct),ft=E.rev?b.bounds:z.bounds,ut=At.alloc(),tt!==ot?ft.w()&&ot.isVisible()?ot.actualBounds.w()?(Oh(ot,rt,dr,ut),ut.x+=ot.actualBounds.x-ft.x,ut.y+=ot.actualBounds.y-ft.y):(Oh(ot,rt,dr,ut),ut.w()||ut.assign(lt)):ut.assign(lt):ft.w()?(Oh(ot,rt,dr,ut),ut.w()||ut.assign(lt)):ut.assign(lt),this.K===90||this.K===270?(tt=Math.round((xt.x-Ct.x)/this.kc),ot=xt.x,rt=Math.round((ut.x-lt.x)/this.kc),lt=ut.x):(tt=Math.round((xt.y-Ct.y)/this.kc),ot=xt.y,rt=Math.round((ut.y-lt.y)/this.kc),lt=ut.y),At.free(xt),At.free(ut),E.portFromColOffset=tt,E.portFromPos=ot,E.portToColOffset=rt,E.portToPos=lt}else E.portFromColOffset=0,E.portFromPos=0,E.portToColOffset=0,E.portToPos=0;if(xt=b.layer,ut=z.layer,ft=0,bt=E.link,bt!==null){var Vt=bt.fromPort,zt=bt.toPort;if(Vt!==null&&zt!==null){var $t=bt.fromNode;if(yt=bt.toNode,$t!==null&&yt!==null){var ie=F0(this,!0),oe=F0(this,!1),de=this.setsPortSpots?ie:bt.computeSpot(!0,Vt);Ct=this.setsPortSpots?oe:bt.computeSpot(!1,zt);var ke=bt.isOrthogonal;de.$c()&&de.Hf(oe)&&Ct.$c()&&Ct.Hf(ie)?ft=0:(ie=bt.getLinkPoint($t,Vt,de,!0,ke,yt,zt,At.alloc()),oe=bt.getLinkDirection($t,Vt,ie,de,!0,ke,yt,zt),At.free(ie),de.ys()||oe!==JS(this,E,!0)?this.setsPortSpots&&$t!==null&&$t.ports.count===1&&E.rev&&(ft+=1):ft+=1,de=bt.getLinkPoint(yt,zt,Ct,!1,ke,$t,Vt,At.alloc()),bt=bt.getLinkDirection(yt,zt,de,Ct,!1,ke,$t,Vt),At.free(de),Ct.ys()||bt!==JS(this,E,!1)?this.setsPortSpots&&yt!==null&&yt.ports.count===1&&E.rev&&(ft+=2):ft+=2)}}}if(yt=ft,ft=yt===1||yt===3,(yt=yt===2||yt===3)&&(Ct=a.createVertex(),Ct.node=null,Ct.Dj=1,Ct.layer=xt,Ct.near=b,a.dh(Ct),b=a.Zj(b,Ct,E.link),b.valid=!1,b.rev=E.rev,b.portFromColOffset=tt,b.portToColOffset=0,b.portFromPos=ot,b.portToPos=0,b=Ct),bt=1,ft&&bt--,xt-ut>bt&&0<xt){for(E.valid=!1,Ct=a.createVertex(),Ct.node=null,Ct.Dj=2,Ct.layer=xt-1,a.dh(Ct),b=a.Zj(b,Ct,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=yt?0:tt,b.portToColOffset=0,b.portFromPos=yt?0:ot,b.portToPos=0,b=Ct,xt--;xt-ut>bt&&0<xt;)Ct=a.createVertex(),Ct.node=null,Ct.Dj=3,Ct.layer=xt-1,a.dh(Ct),b=a.Zj(b,Ct,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=0,b.portFromPos=0,b.portToPos=0,b=Ct,xt--;b=a.Zj(Ct,z,E.link),b.valid=!ft,ft&&(Ct.near=z),b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=rt,b.portFromPos=0,b.portToPos=lt}else E.valid=!0}}for(a=this.tc=[],y=0;y<=this.Ia;y++)a[y]=0;for(y=this.network.vertexes.iterator;y.next();)y.value.index=-1;for(this.initializeIndices(),this.Iq=-1,x=this.Md=this.Hn=0;x<=this.Ia;x++)a[x]>a[this.Md]&&(this.Iq=a[x]-1,this.Md=x),a[x]<a[this.Hn]&&(this.Hn=x);for(this.fl=[],x=0;x<a.length;x++)this.fl[x]=[];for(y.reset();y.next();)a=y.value,this.fl[a.layer][a.index]=a;for(this.Ra=-1,a=0;a<=this.Ia;a++){for(y=Pd(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),wd(this,a,y)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},Po.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}Po.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},Po.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 _s(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 Ml(a,y){var x=0;for(a=a.network.vertexes.iterator;a.next();){var E=a.value;E.layer=y[x],x++,E.column=y[x],x++,E.index=y[x],x++}}function GS(a,y,x){var E=Pd(a,y),b=a.tc[y];(a.Jn===null||a.Jn.length<b*b)&&(a.Jn=[]);for(var z=a.Jn,tt=0;tt<b;tt++){var rt=0,ot=E[tt],lt=ot.near;if(lt!==null&&lt.layer===ot.layer)if(ot=lt.index,ot>tt)for(var ut=tt+1;ut<ot;ut++){var ft=E[ut];ft.near===lt&&ft.Dj===lt.Dj||rt++}else for(ut=tt-1;ut>ot;ut--)ft=E[ut],ft.near===lt&&ft.Dj===lt.Dj||rt++;var yt;if(0<=x)for(ot=E[tt].sourceEdgesArrayAccess,lt=0;lt<ot.length;lt++){var xt=ot[lt];if(xt.valid&&xt.fromVertex.layer!==y)for(ft=xt.fromVertex.index,ut=xt.portToPos,xt=xt.portFromPos,yt=lt+1;yt<ot.length;yt++){var Ct=ot[yt];if(Ct.valid&&Ct.fromVertex.layer!==y){var bt=Ct.fromVertex.index,Vt=Ct.portToPos;Ct=Ct.portFromPos,ut<Vt&&(ft>bt||ft===bt&&xt>Ct)&&rt++,Vt<ut&&(bt>ft||bt===ft&&Ct>xt)&&rt++}}}if(0>=x){for(ot=E[tt].destinationEdgesArrayAccess,lt=0;lt<ot.length;lt++)if(xt=ot[lt],xt.valid&&xt.toVertex.layer!==y)for(ft=xt.toVertex.index,ut=xt.portToPos,xt=xt.portFromPos,yt=lt+1;yt<ot.length;yt++)Ct=ot[yt],Ct.valid&&Ct.toVertex.layer!==y&&(bt=Ct.toVertex.index,Vt=Ct.portToPos,Ct=Ct.portFromPos,xt<Ct&&(ft>bt||ft===bt&&ut>Vt)&&rt++,Ct<xt&&(bt>ft||bt===ft&&Vt>ut)&&rt++)}for(z[tt*b+tt]=rt,ot=tt+1;ot<b;ot++){var zt=0,$t=0;if(0<=x){rt=E[tt].sourceEdgesArrayAccess;var ie=E[ot].sourceEdgesArrayAccess;for(lt=0;lt<rt.length;lt++)if(xt=rt[lt],xt.valid&&xt.fromVertex.layer!==y)for(ft=xt.fromVertex.index,xt=xt.portFromPos,yt=0;yt<ie.length;yt++)Ct=ie[yt],Ct.valid&&Ct.fromVertex.layer!==y&&(bt=Ct.fromVertex.index,Ct=Ct.portFromPos,(ft<bt||ft===bt&&xt<Ct)&&$t++,(bt<ft||bt===ft&&Ct<xt)&&zt++)}if(0>=x){for(rt=E[tt].destinationEdgesArrayAccess,ie=E[ot].destinationEdgesArrayAccess,lt=0;lt<rt.length;lt++)if(xt=rt[lt],xt.valid&&xt.toVertex.layer!==y)for(ft=xt.toVertex.index,ut=xt.portToPos,yt=0;yt<ie.length;yt++)Ct=ie[yt],Ct.valid&&Ct.toVertex.layer!==y&&(bt=Ct.toVertex.index,Vt=Ct.portToPos,(ft<bt||ft===bt&&ut<Vt)&&$t++,(bt<ft||bt===ft&&Vt<ut)&&zt++)}z[tt*b+ot]=zt,z[ot*b+tt]=$t}}return wd(a,y,E),z}Po.prototype.countCrossings=function(){for(var a=0,y=0;y<=this.Ia;y++)for(var x=GS(this,y,1),E=this.tc[y],b=0;b<E;b++)for(var z=b;z<E;z++)a+=x[b*E+z];return a};function C0(a){for(var y=0,x=0;x<=a.Ia;x++){for(var E=a,b=x,z=Pd(E,b),tt=E.tc[b],rt=0,ot=0;ot<tt;ot++){var lt=z[ot].destinationEdgesArrayAccess;if(lt!==null)for(var ut=0;ut<lt.length;ut++){var ft=lt[ut];if(ft.valid&&ft.toVertex.layer!==b){var yt=ft.fromVertex.column+ft.portFromColOffset,xt=ft.toVertex.column+ft.portToColOffset;rt+=(Math.abs(yt-xt)+1)*gy(ft)}}}wd(E,b,z),y+=rt}return y}Po.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=Pd(a,y),b=a.tc[y],z=[],tt=0;tt<b;tt++){var rt=E[tt],ot=null;0>=x&&(ot=rt.sourceEdgesArrayAccess);var lt=null;0<=x&&(lt=rt.destinationEdgesArrayAccess);var ut=0,ft=0,yt=rt.near;if(yt!==null&&yt.layer===rt.layer&&(ut+=yt.column-1,ft++),ot!==null)for(yt=0;yt<ot.length;yt++){rt=ot[yt];var xt=rt.fromVertex;rt.valid&&!rt.rev&&xt.layer!==y&&(ut+=xt.column,ft++)}if(lt!==null)for(ot=0;ot<lt.length;ot++)rt=lt[ot],yt=rt.toVertex,rt.valid&&!rt.rev&&yt.layer!==y&&(ut+=yt.column,ft++);z[tt]=ft===0?-1:ut/ft}return wd(a,y,E),z}function HS(a,y,x){for(var E=Pd(a,y),b=a.tc[y],z=[],tt=0;tt<b;tt++){var rt=E[tt],ot=null;0>=x&&(ot=rt.sourceEdgesArrayAccess);var lt=null;0<=x&&(lt=rt.destinationEdgesArrayAccess);var ut=0,ft=[],yt=rt.near;if(yt!==null&&yt.layer===rt.layer&&(ft[ut]=yt.column-1,ut++),rt=void 0,ot!==null)for(yt=0;yt<ot.length;yt++){rt=ot[yt];var xt=rt.fromVertex;rt.valid&&!rt.rev&&xt.layer!==y&&(ft[ut]=xt.column+rt.portFromColOffset,ut++)}if(lt!==null)for(ot=0;ot<lt.length;ot++)rt=lt[ot],yt=rt.toVertex,rt.valid&&!rt.rev&&yt.layer!==y&&(ft[ut]=yt.column+rt.portToColOffset,ut++);ut===0?z[tt]=-1:(ft.sort(function(Ct,bt){return Ct-bt}),lt=ut>>1,z[tt]=ut&1?ft[lt]:ft[lt-1]+ft[lt]>>1)}return wd(a,y,E),z}function Mp(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var tt=y.destinationEdges;tt.next();){var rt=tt.value,ot=rt.toVertex,lt=y.layer-ot.layer;rt=a.linkMinLength(rt),lt===rt&&Mp(a,ot,x,E,b,z)}if(z)for(tt=y.sourceEdges;tt.next();)rt=tt.value,ot=rt.fromVertex,lt=ot.layer-y.layer,rt=a.linkMinLength(rt),lt===rt&&Mp(a,ot,x,E,b,z)}}function my(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var tt=y.destinationEdges;tt.next();)my(a,tt.value.toVertex,x,E,b,z);if(z)for(y=y.sourceEdges;y.next();)my(a,y.value.fromVertex,x,E,b,z)}}Po.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Dk){default:case Sy:a=this.network;var y=0,x=a.vertexes.count-1,E=[];E.length=x+1;for(var b=a.vertexes.iterator;b.next();)b.value.valid=!0;for(;jx(a)!==null;){for(b=WS(a);b!==null;)E[x]=b,x--,b.valid=!1,b=WS(a);for(b=VS(a);b!==null;)E[y]=b,y++,b.valid=!1,b=VS(a);b=null;for(var z=0,tt=this.network.vertexes.iterator;tt.next();){var rt=tt.value;if(rt.valid){for(var ot=0,lt=rt.destinationEdges;lt.next();)lt.value.toVertex.valid&&ot++;lt=0;for(var ut=rt.sourceEdges;ut.next();)ut.value.fromVertex.valid&&lt++;(b===null||z<ot-lt)&&(b=rt,z=ot-lt)}}b!==null&&(E[y]=b,y++,b.valid=!1)}for(y=0;y<a.vertexes.count;y++)E[y].index=y;for(E=a.edges.iterator;E.next();)y=E.value,y.fromVertex.index>y.toVertex.index&&(a.gm(y),y.rev=!0);break;case M0:for(E=this.network.vertexes.iterator;E.next();)a=E.value,a.Ll=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;for(this.Kn=0,E.reset();E.next();)y=E.value,y.sourceEdges.count===0&&vy(this,y);for(E.reset();E.next();)y=E.value,y.Ll===-1&&vy(this,y);for(a.reset();a.next();)E=a.value,E.forest||(y=E.fromVertex,x=y.finish,b=E.toVertex,z=b.finish,b.Ll<y.Ll&&x<z&&(this.network.gm(E),E.rev=!0));break;case kp:for(a=this.network,y=a.vertexes.iterator,E=1/0;y.next();)E=Math.min(E,y.value.layer);if(1/0>E){if(0>E)for(y.reset();y.next();)y.value.layer-=E;for(E=[],y.reset();y.next();)x=y.value,b=E[x.layer],b===void 0?E[x.layer]=[x]:b.push(x);for(x=y=0;x<E.length;x++)if(b=E[x],!b||b.length===0)y++;else if(0<x)for(z=0;z<b.length;z++)b[z].layer-=y;for(E=a.edges.iterator;E.next();)y=E.value,y.fromVertex.layer<y.toVertex.layer&&(a.gm(y),y.rev=!0)}}};function jx(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid)return y}return null}function WS(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid){for(var x=!0,E=y.destinationEdges;E.next();)if(E.value.toVertex.valid){x=!1;break}if(x)return y}}return null}function VS(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid){for(var x=!0,E=y.sourceEdges;E.next();)if(E.value.fromVertex.valid){x=!1;break}if(x)return y}}return null}function vy(a,y){y.Ll=a.Kn,a.Kn++;for(var x=y.destinationEdges;x.next();){var E=x.value,b=E.toVertex;b.Ll===-1&&(E.forest=!0,vy(a,b))}y.finish=a.Kn,a.Kn++}Po.prototype.assignLayers=function(){switch(this.Zk){case xy:KS(this);break;case Py:for(var a,y=this.network.vertexes.iterator;y.next();)a=YS(this,y.value),this.Ia=Math.max(a,this.Ia);for(y.reset();y.next();)a=y.value,a.layer=this.Ia-a.layer;break;default:case k0:for(KS(this),y=this.network.vertexes.iterator;y.next();)y.value.valid=!1;for(y.reset();y.next();)a=y.value,a.sourceEdges.count===0&&XS(this,a);for(a=1/0,y.reset();y.next();)a=Math.min(a,y.value.layer);for(this.Ia=-1,y.reset();y.next();){var x=y.value;x.layer-=a,this.Ia=Math.max(this.Ia,x.layer)}}};function KS(a){for(var y=a.network.vertexes.iterator;y.next();){var x=US(a,y.value);a.Ia=Math.max(x,a.Ia)}}function US(a,y){var x=0;if(y.layer===-1){for(var E=y.destinationEdges;E.next();){var b=E.value,z=b.toVertex;b=a.linkMinLength(b),x=Math.max(x,US(a,z)+b)}y.layer=x}else x=y.layer;return x}function YS(a,y){var x=0;if(y.layer===-1){for(var E=y.sourceEdges;E.next();){var b=E.value,z=b.fromVertex;b=a.linkMinLength(b),x=Math.max(x,YS(a,z)+b)}y.layer=x}else x=y.layer;return x}function XS(a,y){if(!y.valid){y.valid=!0;for(var x=y.destinationEdges;x.next();)XS(a,x.value.toVertex);for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(var E=y.sourceEdgesArrayAccess,b=E.length,z=0;z<b;z++){var tt=E[z],rt=tt.fromVertex,ot=tt.toVertex;tt=a.linkMinLength(tt),rt.layer-ot.layer>tt&&Mp(a,rt,0,-1,!0,!1)}for(Mp(a,y,1,-1,!0,!0);y.component!==0;){for(z=0,E=1/0,rt=0,ot=null,tt=a.network.vertexes.iterator;tt.next();){var lt=tt.value;if(lt.component===1){var ut=0,ft=!1,yt=lt.sourceEdgesArrayAccess;b=yt.length;for(var xt=0;xt<b;xt++){var Ct=yt[xt],bt=Ct.fromVertex;ut+=1,bt.component!==1&&(z+=1,bt=bt.layer-lt.layer,Ct=a.linkMinLength(Ct),E=Math.min(E,bt-Ct))}for(yt=lt.destinationEdgesArrayAccess,b=yt.length,xt=0;xt<b;xt++)Ct=yt[xt].toVertex,--ut,Ct.component!==1?--z:ft=!0;(ot===null||ut<rt)&&!ft&&(ot=lt,rt=ut)}}if(0<z){for(x.reset();x.next();)b=x.value,b.component===1&&(b.layer+=E);y.component=0}else ot.component=0}for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(Mp(a,y,1,-1,!0,!1);y.component!==0;){for(E=0,b=1/0,z=0,rt=null,ot=a.network.vertexes.iterator;ot.next();)if(tt=ot.value,tt.component===1){for(lt=0,ut=!1,yt=tt.sourceEdgesArrayAccess,ft=yt.length,xt=0;xt<ft;xt++)Ct=yt[xt].fromVertex,lt+=1,Ct.component!==1?E+=1:ut=!0;for(yt=tt.destinationEdgesArrayAccess,ft=yt.length,xt=0;xt<ft;xt++)Ct=yt[xt],bt=Ct.toVertex,--lt,bt.component!==1&&(--E,bt=tt.layer-bt.layer,Ct=a.linkMinLength(Ct),b=Math.min(b,bt-Ct));(rt===null||lt>z)&&!ut&&(rt=tt,z=lt)}if(0>E){for(x.reset();x.next();)E=x.value,E.component===1&&(E.layer-=b);y.component=0}else rt.component=0}}}function JS(a,y,x){return a.K===90?x&&!y.rev||!x&&y.rev?270:90:a.K===180?x&&!y.rev||!x&&y.rev?0:180:a.K===270?x&&!y.rev||!x&&y.rev?90:270:x&&!y.rev||!x&&y.rev?180:0}Po.prototype.initializeIndices=function(){switch(this.Qk){default:case Cy:for(var a=this.network.vertexes.iterator;a.next();){var y=a.value,x=y.layer;y.index=this.tc[x],this.tc[x]++}break;case b0:for(a=this.network.vertexes.iterator,y=this.Ia;0<=y;y--)for(a.reset();a.next();)x=a.value,x.layer===y&&x.index===-1&&QS(this,x);break;case wy:for(a=this.network.vertexes.iterator,y=0;y<=this.Ia;y++)for(a.reset();a.next();)x=a.value,x.layer===y&&x.index===-1&&$S(this,x)}};function QS(a,y){var x=y.layer;for(y.index=a.tc[x],a.tc[x]++,y=y.destinationEdgesArrayAccess,x=!0;x;){x=!1;for(var E=0;E<y.length-1;E++){var b=y[E],z=y[E+1];b.portFromColOffset>z.portFromColOffset&&(x=!0,y[E]=z,y[E+1]=b)}}for(x=0;x<y.length;x++)E=y[x],E.valid&&(E=E.toVertex,E.index===-1&&QS(a,E))}function $S(a,y){var x=y.layer;y.index=a.tc[x],a.tc[x]++,y=y.sourceEdgesArrayAccess;for(var E=!0;E;)for(E=!1,x=0;x<y.length-1;x++){var b=y[x],z=y[x+1];b.portToColOffset>z.portToColOffset&&(E=!0,y[x]=z,y[x+1]=b)}for(x=0;x<y.length;x++)E=y[x],E.valid&&(E=E.fromVertex,E.index===-1&&$S(a,E))}Po.prototype.reduceCrossings=function(){var a=this.countCrossings(),y=_s(this),x,E;for(x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)E0(this,E,1),zl(this,E,1);var b=this.countCrossings();for(b<a&&(a=b,y=_s(this)),E=this.Ia;0<=E;E--)E0(this,E,-1),zl(this,E,-1);b=this.countCrossings(),b<a&&(a=b,y=_s(this))}for(Ml(this,y),x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)E0(this,E,0),zl(this,E,0);for(b=this.countCrossings(),b<a&&(a=b,y=_s(this)),E=this.Ia;0<=E;E--)E0(this,E,0),zl(this,E,0);b=this.countCrossings(),b<a&&(a=b,y=_s(this))}Ml(this,y);var z,tt,rt;switch(this.rk){case Ey:break;case Ly:for(rt=a+1;(E=this.countCrossings())<rt;)for(rt=E,x=this.Ia;0<=x;x--)for(tt=0;tt<=x;tt++){for(z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=zl(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=zl(this,E,1)||z;for(b=this.countCrossings(),b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=zl(this,E,1)||z;for(b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=zl(this,E,-1)||z;for(b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=zl(this,E,0)||z;for(b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=zl(this,E,0)||z;b>=a?Ml(this,y):(a=b,y=_s(this))}break;default:case N0:for(x=this.Ia,tt=0,rt=a+1;(E=this.countCrossings())<rt;){for(rt=E,z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=zl(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=zl(this,E,1)||z;for(b=this.countCrossings(),b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=zl(this,E,1)||z;for(b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=zl(this,E,-1)||z;for(b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=zl(this,E,0)||z;for(b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=zl(this,E,0)||z;b>=a?Ml(this,y):(a=b,y=_s(this))}}Ml(this,y)};function E0(a,y,x){var E=Pd(a,y),b=a.tc[y],z=HS(a,y,x),tt=py(a,y,x);for(x=0;x<b;x++)tt[x]===-1&&(tt[x]=E[x].column),z[x]===-1&&(z[x]=E[x].column);for(var rt=!0,ot;rt;)for(rt=!1,x=0;x<b-1;x++)(z[x+1]<z[x]||z[x+1]===z[x]&&tt[x+1]<tt[x])&&(rt=!0,ot=z[x],z[x]=z[x+1],z[x+1]=ot,ot=tt[x],tt[x]=tt[x+1],tt[x+1]=ot,ot=E[x],E[x]=E[x+1],E[x+1]=ot);for(x=z=0;x<b;x++)ot=E[x],ot.index=x,z+=a.nodeMinColumnSpace(ot,!0),ot.column=z,z+=1,z+=a.nodeMinColumnSpace(ot,!1);wd(a,y,E)}function zl(a,y,x){var E=Pd(a,y),b=a.tc[y];x=GS(a,y,x);var z,tt=[];for(z=0;z<b;z++)tt[z]=-1;var rt=[];for(z=0;z<b;z++)rt[z]=-1;for(var ot=!1,lt=!0;lt;)for(lt=!1,z=0;z<b-1;z++){var ut=x[E[z].index*b+E[z+1].index],ft=x[E[z+1].index*b+E[z].index],yt=0,xt=0,Ct=E[z].column,bt=E[z+1].column,Vt=a.nodeMinColumnSpace(E[z],!0),zt=a.nodeMinColumnSpace(E[z],!1),$t=a.nodeMinColumnSpace(E[z+1],!0),ie=a.nodeMinColumnSpace(E[z+1],!1);Vt=Ct-Vt+$t,zt=bt-zt+ie;var oe=E[z].sourceEdges.iterator;for(oe.reset();oe.next();)if($t=oe.value,ie=$t.fromVertex,$t.valid&&ie.layer===y){for($t=0;E[$t]!==ie;)$t++;$t<z&&(yt+=2*(z-$t),xt+=2*(z+1-$t)),$t===z+1&&(yt+=1),$t>z+1&&(yt+=4*($t-z),xt+=4*($t-(z+1)))}for(oe=E[z].destinationEdges.iterator,oe.reset();oe.next();)if($t=oe.value,ie=$t.toVertex,$t.valid&&ie.layer===y){for($t=0;E[$t]!==ie;)$t++;$t===z+1&&(xt+=1)}for(oe=E[z+1].sourceEdges.iterator,oe.reset();oe.next();)if($t=oe.value,ie=$t.fromVertex,$t.valid&&ie.layer===y){for($t=0;E[$t]!==ie;)$t++;$t<z&&(yt+=2*(z+1-$t),xt+=2*(z-$t)),$t===z&&(xt+=1),$t>z+1&&(yt+=4*($t-(z+1)),xt+=4*($t-z))}for(oe=E[z+1].destinationEdges.iterator,oe.reset();oe.next();)if($t=oe.value,ie=$t.toVertex,$t.valid&&ie.layer===y){for($t=0;E[$t]!==ie;)$t++;$t===z&&(yt+=1)}$t=ie=0,oe=tt[E[z].index];var de=rt[E[z].index],ke=tt[E[z+1].index],Hn=rt[E[z+1].index];oe!==-1&&(ie+=Math.abs(oe-Ct),$t+=Math.abs(oe-zt)),de!==-1&&(ie+=Math.abs(de-Ct),$t+=Math.abs(de-zt)),ke!==-1&&(ie+=Math.abs(ke-bt),$t+=Math.abs(ke-Vt)),Hn!==-1&&(ie+=Math.abs(Hn-bt),$t+=Math.abs(Hn-Vt)),(xt<yt-.5||xt===yt&&ft<ut-.5||xt===yt&&ft===ut&&$t<ie-.5)&&(lt=ot=!0,E[z].column=zt,E[z+1].column=Vt,ut=E[z],E[z]=E[z+1],E[z+1]=ut)}for(z=0;z<b;z++)E[z].index=z;return wd(a,y,E),ot}Po.prototype.straightenAndPack=function(){if(this.ve===0){var a=(this.bg&1)!==0,y=(this.bg&Ux)!==0;if(1e3<this.network.edges.count&&y&&(a=!1),a){var x=[];for(y=0;y<=this.Ia;y++)x[y]=0;for(var E,b=this.network.vertexes.iterator;b.next();){var z=b.value;y=z.layer,E=z.column,z=this.nodeMinColumnSpace(z,!1),x[y]=Math.max(x[y],E+z)}for(b.reset();b.next();)z=b.value,y=z.layer,E=z.column,z.column=(8*(this.Ra-x[y])>>1)+8*E;this.Ra*=8}if(this.bg&2)for(x=!0;x;){for(x=!1,y=this.Md+1;y<=this.Ia;y++)x=$f(this,y,1)||x;for(y=this.Md-1;0<=y;y--)x=$f(this,y,-1)||x;x=$f(this,this.Md,0)||x}if(this.bg&4){for(y=this.Md+1;y<=this.Ia;y++)yy(this,y,1);for(y=this.Md-1;0<=y;y--)yy(this,y,-1);yy(this,this.Md,0)}if(a&&(qS(this,-1),qS(this,1)),this.bg&2)for(x=!0;x;){for(x=!1,x=$f(this,this.Md,0)||x,y=this.Md+1;y<=this.Ia;y++)x=$f(this,y,0)||x;for(y=this.Md-1;0<=y;y--)x=$f(this,y,0)||x}}else Hx(this)};function $f(a,y,x){for(var E=!1;zx(a,y,x);)E=!0;return E}function zx(a,y,x){var E,b=Pd(a,y),z=a.tc[y],tt=py(a,y,-1);if(0<x)for(E=0;E<z;E++)tt[E]=-1;var rt=py(a,y,1);if(0>x)for(E=0;E<z;E++)rt[E]=-1;for(var ot=!1,lt=!0;lt;)for(lt=!1,E=0;E<z;E++){var ut=b[E].column,ft=a.nodeMinColumnSpace(b[E],!0),yt=a.nodeMinColumnSpace(b[E],!1),xt=0;0>E-1||ut-b[E-1].column-1>ft+a.nodeMinColumnSpace(b[E-1],!1)?xt=ut-1:xt=ut,ft=E+1>=z||b[E+1].column-ut-1>yt+a.nodeMinColumnSpace(b[E+1],!0)?ut+1:ut;var Ct=yt=0,bt=0;if(0>=x)for(var Vt=b[E].sourceEdges.iterator;Vt.next();){var zt=Vt.value,$t=zt.fromVertex;if(zt.valid&&$t.layer!==y){var ie=gy(zt),oe=zt.portFromColOffset;zt=zt.portToColOffset,$t=$t.column,yt+=(Math.abs(ut+zt-($t+oe))+1)*ie,Ct+=(Math.abs(xt+zt-($t+oe))+1)*ie,bt+=(Math.abs(ft+zt-($t+oe))+1)*ie}}if(0<=x)for(Vt=b[E].destinationEdges.iterator;Vt.next();)zt=Vt.value,$t=zt.toVertex,zt.valid&&$t.layer!==y&&(ie=gy(zt),oe=zt.portFromColOffset,zt=zt.portToColOffset,$t=$t.column,yt+=(Math.abs(ut+oe-($t+zt))+1)*ie,Ct+=(Math.abs(xt+oe-($t+zt))+1)*ie,bt+=(Math.abs(ft+oe-($t+zt))+1)*ie);zt=oe=ie=0,Vt=tt[b[E].index],$t=rt[b[E].index],Vt!==-1&&(ie+=Math.abs(Vt-ut),oe+=Math.abs(Vt-xt),zt+=Math.abs(Vt-ft)),$t!==-1&&(ie+=Math.abs($t-ut),oe+=Math.abs($t-xt),zt+=Math.abs($t-ft)),Ct<yt||Ct===yt&&oe<ie?(lt=ot=!0,b[E].column=xt):(bt<yt||bt===yt&&zt<ie)&&(lt=ot=!0,b[E].column=ft)}return wd(a,y,b),a.normalize(),ot}function yy(a,y,x){var E=Pd(a,y),b=a.tc[y],z=HS(a,y,x),tt=[];for(x=0;x<b;x++)tt[x]=z[x];for(z=!0;z;)for(z=!1,x=0;x<b;x++){var rt=E[x].column,ot=a.nodeMinColumnSpace(E[x],!0),lt=a.nodeMinColumnSpace(E[x],!1),ut=0;if(tt[x]===-1)if(x===0&&x===b-1)ut=rt;else if(x===0){var ft=E[x+1].column;ft-rt===lt+a.nodeMinColumnSpace(E[x+1],!0)?ut=rt-1:ut=rt}else x===b-1?(ft=E[x-1].column,ut=rt-ft===ot+a.nodeMinColumnSpace(E[x-1],!1)?rt+1:rt):(ft=E[x-1].column,ot=ft+a.nodeMinColumnSpace(E[x-1],!1)+ot+1,ft=E[x+1].column,lt=ft-a.nodeMinColumnSpace(E[x+1],!0)-lt-1,ut=(ot+lt)/2|0);else x===0&&x===b-1?ut=tt[x]:x===0?(ft=E[x+1].column,lt=ft-a.nodeMinColumnSpace(E[x+1],!0)-lt-1,ut=Math.min(tt[x],lt)):x===b-1?(ft=E[x-1].column,ot=ft+a.nodeMinColumnSpace(E[x-1],!1)+ot+1,ut=Math.max(tt[x],ot)):(ft=E[x-1].column,ot=ft+a.nodeMinColumnSpace(E[x-1],!1)+ot+1,ft=E[x+1].column,lt=ft-a.nodeMinColumnSpace(E[x+1],!0)-lt-1,ot<tt[x]&&tt[x]<lt?ut=tt[x]:ot>=tt[x]?ut=ot:lt<=tt[x]&&(ut=lt));ut!==rt&&(z=!0,E[x].column=ut)}wd(a,y,E),a.normalize()}function Zx(a,y){for(var x=!0,E=a.network.vertexes.iterator;E.next();){var b=E.value,z=a.nodeMinColumnSpace(b,!0),tt=a.nodeMinColumnSpace(b,!1);if(b.column-z<=y&&b.column+tt>=y){x=!1;break}}if(a=!1,x)for(E.reset();E.next();)x=E.value,x.column>y&&(--x.column,a=!0);return a}function Gx(a,y){var x=y+1,E,b=[],z=[];for(E=0;E<=a.Ia;E++)b[E]=!1,z[E]=!1;for(var tt=a.network.vertexes.iterator;tt.next();){E=tt.value;var rt=E.column-a.nodeMinColumnSpace(E,!0),ot=E.column+a.nodeMinColumnSpace(E,!1);rt<=y&&ot>=y&&(b[E.layer]=!0),rt<=x&&ot>=x&&(z[E.layer]=!0)}for(rt=!0,x=!1,E=0;E<=a.Ia;E++)rt=rt&&!(b[E]&&z[E]);if(rt)for(tt.reset();tt.next();)a=tt.value,a.column>y&&(--a.column,x=!0);return x}function qS(a,y){for(var x=0;x<=a.Ra;x++)for(;Zx(a,x););for(a.normalize(),x=0;x<a.Ra;x++)for(;Gx(a,x););a.normalize();var E;if(0<y)for(x=0;x<=a.Ra;x++){var b=_s(a),z=C0(a);for(E=z+1;z<E;){E=z,tx(a,x,1);var tt=C0(a);tt>z?Ml(a,b):tt<z&&(z=tt,b=_s(a))}}if(0>y)for(x=a.Ra;0<=x;x--)for(b=_s(a),z=C0(a),E=z+1;z<E;)E=z,tx(a,x,-1),tt=C0(a),tt>z?Ml(a,b):tt<z&&(z=tt,b=_s(a));a.normalize()}function tx(a,y,x){a.le=0;for(var E=a.network.vertexes.iterator;E.next();)E.value.component=-1;if(0<x)for(E.reset();E.next();){var b=E.value;b.column-a.nodeMinColumnSpace(b,!0)<=y&&(b.component=a.le)}if(0>x)for(E.reset();E.next();)b=E.value,b.column+a.nodeMinColumnSpace(b,!1)>=y&&(b.component=a.le);for(a.le++,E.reset();E.next();)y=E.value,y.component===-1&&(my(a,y,a.le,-1,!0,!0),a.le++);var z;for(y=[],z=0;z<a.le*a.le;z++)y[z]=!1;for(b=[],z=0;z<(a.Ia+1)*(a.Ra+1);z++)b[z]=-1;for(E.reset();E.next();){z=E.value;for(var tt=z.layer,rt=Math.max(0,z.column-a.nodeMinColumnSpace(z,!0)),ot=Math.min(a.Ra,z.column+a.nodeMinColumnSpace(z,!1));rt<=ot;rt++)b[tt*(a.Ra+1)+rt]=z.component}for(z=0;z<=a.Ia;z++){if(0<x)for(tt=0;tt<a.Ra;tt++)b[z*(a.Ra+1)+tt]!==-1&&b[z*(a.Ra+1)+tt+1]!==-1&&b[z*(a.Ra+1)+tt]!==b[z*(a.Ra+1)+tt+1]&&(y[b[z*(a.Ra+1)+tt]*a.le+b[z*(a.Ra+1)+tt+1]]=!0);if(0>x)for(tt=a.Ra;0<tt;tt--)b[z*(a.Ra+1)+tt]!==-1&&b[z*(a.Ra+1)+tt-1]!==-1&&b[z*(a.Ra+1)+tt]!==b[z*(a.Ra+1)+tt-1]&&(y[b[z*(a.Ra+1)+tt]*a.le+b[z*(a.Ra+1)+tt-1]]=!0)}for(b=[],z=0;z<a.le;z++)b[z]=!0;for(tt=[],tt.push(0);tt.length!==0;)if(ot=tt[tt.length-1],tt.pop(),b[ot])for(b[ot]=!1,z=0;z<a.le;z++)y[ot*a.le+z]&&tt.splice(0,0,z);if(0<x)for(E.reset();E.next();)a=E.value,b[a.component]&&--a.column;if(0>x)for(E.reset();E.next();)x=E.value,b[x.component]&&(x.column+=1)}function Hx(a){for(var y=Jn(),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 gn,Wx(y,x);var z=null,tt=null,rt=null,ot=null,lt=(a.ve&1)!==0,ut=(a.ve&2)!==0,ft=(a.ve&4)!==0,yt=(a.ve&8)!==0;for(lt&&(a.verticalAlignment(y,x,!0),z=L0(a,y,!0,!1)),y.reverse(),ft&&(a.verticalAlignment(y,x,!1),rt=L0(a,y,!1,!1)),E=Zn(y),b=E.next();!b.done;b=E.next())b.value.reverse();yt&&(a.verticalAlignment(y,x,!1),ot=L0(a,y,!1,!0)),y.reverse(),ut&&(a.verticalAlignment(y,x,!0),tt=L0(a,y,!0,!0)),li(y),a.u(z,tt,rt,ot),a.network.vertexes.each(function(xt){var Ct=Jn();lt&&Ct.push(z.get(xt)),ut&&Ct.push(tt.get(xt)),ft&&Ct.push(rt.get(xt)),yt&&Ct.push(ot.get(xt)),Ct.sort(function(Vt,zt){return Vt-zt});var bt=Ct.length;bt=(Ct[Math.floor((bt-1)/2)]+Ct[Math.ceil((bt-1)/2)])/2,li(Ct),xt.zc=bt})}function Wx(a,y){for(var x=a.length,E=1;E<x-1;E++)for(var b=0,z=0,tt=a[E],rt=a[E+1],ot=0;z<rt.length;ot++){var lt=rt[ot];t:{if(lt.node===null){var ut=Fy(lt);if(0<ut.length){ut=ut[0].node===null;break t}}ut=!1}var ft=ut;if(ot===rt.length-1||ft){for(ut=tt.length-1,ft&&(ut=Fy(lt)[0].index);z<=ot;){if(lt=rt[z],!lt.bo){ft=[];for(var yt=Zn(lt.sourceEdgesArrayAccess),xt=yt.next();!xt.done;xt=yt.next())xt=xt.value,xt.valid&&ft.push(xt);lt.bo=ft}for(lt=Zn(lt.bo),ft=lt.next();!ft.done;ft=lt.next())ft=ft.value,yt=ft.fromVertex.index,(yt<b||yt>ut)&&y.add(ft);z++}b=ut}}}Po.prototype.verticalAlignment=function(a,y,x){Vx(a),a=Zn(a);for(var E=a.next();!E.done;E=a.next()){var b=-1;E=Zn(E.value);for(var z=E.next();!z.done;z=E.next()){z=z.value;var tt=x?Fy(z):Yx(z),rt=tt.length;if(0<rt){tt.sort(function(ft,yt){return ft.vi-yt.vi});var ot=(rt-1)/2;for(rt=Math.floor(ot),ot=Math.ceil(ot);rt<=ot;rt++)if(z.align===z){var lt=tt[rt],ut=void 0;ut=x?B0(lt,z):B0(z,lt),!y.contains(ut)&&b<lt.vi&&(lt.align=z,z.root=lt.root,z.align=lt.root,b=lt.vi)}}}}};function Vx(a){for(var y=0;y<a.length;y++)for(var x=a[y],E=0;E<x.length;E++){var b=x[E];b.root=b,b.align=b,b.Tz=y,b.vi=E}}function L0(a,y,x,E){for(var b=a.K===90||a.K===270,z=Zn(y),tt=z.next();!tt.done;tt=z.next()){var rt=Zn(tt.value);for(tt=rt.next();!tt.done;tt=rt.next())tt=tt.value,tt.sd=tt,tt.shift=1/0,tt.zc=NaN,tt.qg=0}for(tt=a.K===90||a.K===270,z=Zn(y),rt=z.next();!rt.done;rt=z.next()){rt=Zn(rt.value);for(var ot=rt.next();!ot.done;ot=rt.next())if(ot=ot.value,ot.root===ot){for(var lt=0,ut=ot;ut.align!==ot;){var ft=ut.align,yt=tt?ut.width:ut.height,xt=tt?ft.width:ft.height;if(x){var Ct=B0(ut,ft),bt=Ct.portFromPos,Vt=Ct.portToPos;Ct.link!==null&&(ut.node&&ut.node!==Ct.link.fromNode&&(bt=tt?ut.focusX:ut.focusY),ft.node&&ft.node!==Ct.link.toNode&&(Vt=tt?ft.focusX:ft.focusY))}else Ct=B0(ft,ut),bt=Ct.portToPos,Vt=Ct.portFromPos,Ct.link!==null&&(ut.node&&ut.node!==Ct.link.toNode&&(bt=tt?ut.focusX:ut.focusY),ft.node&&ft.node!==Ct.link.fromNode&&(Vt=tt?ft.focusX:ft.focusY));yt=E?ut.qg+(yt-bt)-(xt-Vt):ut.qg+bt-Vt,ft.qg=yt,lt=Math.min(lt,yt),ut=ut.align}ut=ot;do ut.qg=ut.qg-lt,ut=ut.align;while(ut!==ot)}}for(x=Zn(y),tt=x.next();!tt.done;tt=x.next())for(z=Zn(tt.value),tt=z.next();!tt.done;tt=z.next())tt=tt.value,tt.root===tt&&ex(a,tt,y);for(x=0;x<y.length;x++)if(!(0>=y[x].length)&&(tt=y[x][0],tt.sd===tt)){tt.sd.shift===1/0&&(tt.sd.shift=0),tt=x,rt=0;do{for(z=y[tt][rt];z.align!==z.root;)z=z.align,tt++,0<z.vi&&(rt=nx(z,y),rt.sd.shift=Math.min(rt.sd.shift,z.sd.shift+z.zc+z.qg-(rt.zc+rt.qg+(b?rt.width:rt.height)+a.columnSpacing)));rt=z.vi+1}while(tt<y.length&&rt<y[tt].length&&z.sd===y[tt][rt].sd)}for(a=new Be,y=Zn(y),tt=y.next();!tt.done;tt=y.next())for(x=Zn(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&&Gt("Could not determine previous vertex in layer"),y[x][a-1]}Po.prototype.u=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];x=-1;for(var E=Jn(),b=Jn(),z=1/0,tt=0;4>tt;tt++)if(y[tt]){var rt=Kx(this,y[tt],E,b,tt);rt<z&&(x=tt,z=rt)}for(z={},tt=0;4>tt;z={delta:z.delta},tt++)y[tt]&&(z.delta=tt===0||tt===2?E[x]-E[tt]:b[x]-b[tt],z.delta!==0&&y[tt].each(function(ot){return function(lt){lt.value+=ot.delta}}(z)));li(E),li(b)};function Kx(a,y,x,E,b){if(!y||y.count===0)return x[b]=0,E[b]=0,1/0;var z=1/0,tt=-1/0;return y.each(function(rt){var ot=rt.key;rt=rt.value,ot=a.K===90||a.K===270?ot.width:ot.height,rt<z&&(z=rt),rt+ot>tt&&(tt=rt+ot)}),x[b]=z,E[b]=tt,tt-z}Po.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=F0(this,!0),y=F0(this,!1),x=this.network.edges.iterator;x.next();){var E=x.value.link;E!==null&&(E.fromSpot=a,E.toSpot=y)}this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()};function F0(a,y){return a.K===270?y?Xa:Ga:a.K===90?y?Ga:Xa:a.K===180?y?Ja:Aa:y?Aa:Ja}Po.prototype.commitNodes=function(){this.he=[],this.Ld=[],this.Kd=[],this.Ta=[];for(var a=0;a<=this.Ia;a++)this.he[a]=0,this.Ld[a]=0,this.Kd[a]=0,this.Ta[a]=0;for(a=this.network.vertexes.iterator;a.next();){var y=a.value,x=y.layer;this.he[x]=Math.max(this.he[x],this.nodeMinLayerSpace(y,!0)),this.Ld[x]=Math.max(this.Ld[x],this.nodeMinLayerSpace(y,!1))}y=0,x=this.ie;for(var E=0;E<=this.Ia;E++){var b=x;0>=this.he[E]+this.Ld[E]&&(b=0),0<E&&(y+=b/2),this.K===90||this.K===0?(y+=this.Ld[E],this.Kd[E]=y,y+=this.he[E]):(y+=this.he[E],this.Kd[E]=y,y+=this.Ld[E]),E<this.Ia&&(y+=b/2),this.Ta[E]=y}for(x=y,y=this.arrangementOrigin,E=0;E<=this.Ia;E++)this.K===270?this.Kd[E]=y.y+this.Kd[E]:this.K===90?(this.Kd[E]=y.y+x-this.Kd[E],this.Ta[E]=x-this.Ta[E]):this.K===180?this.Kd[E]=y.x+this.Kd[E]:(this.Kd[E]=y.x+x-this.Kd[E],this.Ta[E]=x-this.Ta[E]);x=this.ve!==0,a.reset(),E=this.K===270||this.K===90;for(var z=1/0,tt=b=1/0,rt=-1/0;a.next();){var ot=a.value,lt=ot.layer,ut=ot.column|0;E?(tt=y.x+this.kc*ut,lt=this.Kd[lt]):(tt=this.Kd[lt],lt=y.y+this.kc*ut),ot.centerX=tt,ot.centerY=lt,x&&isFinite(ot.zc)&&(E?ot.node?ot.x=y.x+ot.zc:ot.centerX=y.x+ot.zc:ot.node?ot.y=y.y+ot.zc:ot.centerY=y.y+ot.zc),z=Math.min(ot.x,z),b=Math.min(ot.y,b),E?(tt=z,rt=Math.max(rt,ot.bounds.right)):(tt=b,rt=Math.max(rt,ot.bounds.bottom))}for(this.xw=rt-tt,z=y.x-z,y=y.y-b,this.Rf=new At(x&&E?0:z,x&&!E?0:y),a.reset();a.next();)x=a.value,x.x+=z,x.y+=y,x.commit()},Po.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 Te(0,0,x,Math.abs(this.Ta[0]))):y.push(new Te(0,this.Ta[E-1],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===90?E===0?y.push(new Te(0,this.Ta[0],x,Math.abs(this.Ta[0]-a))):y.push(new Te(0,this.Ta[E],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===180?E===0?y.push(new Te(0,0,Math.abs(this.Ta[0]),x)):y.push(new Te(this.Ta[E-1],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x)):E===0?y.push(new Te(this.Ta[0],0,Math.abs(this.Ta[0]-a),x)):y.push(new Te(this.Ta[E],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x));this.commitLayers(y,this.Rf)},Po.prototype.commitLayers=function(){},Po.prototype.commitLinks=function(){for(var a=this.network.edges.iterator,y;a.next();)y=a.value.link,y!==null&&(y.uh(),y.Fj(),y.zf());for(a.reset();a.next();)y=a.value.link,y!==null&&y.vg();for(a.reset();a.next();){var x=a.value;if(y=x.link,y!==null){y.uh();var E=y,b=E.fromNode,z=E.toNode,tt=E.fromPort,rt=E.toPort;if(b!==null){var ot=b.findVisibleNode();ot!==null&&ot!==b&&(b=ot,tt=ot.port)}z!==null&&(ot=z.findVisibleNode(),ot!==null&&ot!==z&&(z=ot,rt=ot.port));var lt=y.computeSpot(!0,tt);ot=y.computeSpot(!1,rt);var ut=x.fromVertex,ft=x.toVertex;if(x.valid)y.curve===dl&&y.pointsCount===4&&(ut.column===ft.column&&this.alignOption===0?(x=y.getLinkPoint(b,tt,lt,!0,!1,z,rt),rt=y.getLinkPoint(z,rt,ot,!1,!1,b,tt),x.w()||x.set(b.actualBounds.center),rt.w()||rt.set(z.actualBounds.center),y.Fj(),y.yf(x.x,x.y),y.yf((2*x.x+rt.x)/3,(2*x.y+rt.y)/3),y.yf((x.x+2*rt.x)/3,(x.y+2*rt.y)/3),y.yf(rt.x,rt.y)):(x=E=!1,tt!==null&&lt===lr&&(E=!0),rt!==null&&ot===lr&&(x=!0),(E||x)&&(ot=null,E&&(ot=y.getLinkPointFromPoint(b,tt,tt.ga(dr),y.i(3),!0),ot.w()||ot.set(b.actualBounds.center),y.L(0,ot.x,ot.y)),b=null,x&&(b=y.getLinkPointFromPoint(z,rt,rt.ga(dr),y.i(0),!1),b.w()||b.set(z.actualBounds.center),y.L(3,b.x,b.y)),ot&&(z=y.i(2),y.L(1,(2*ot.x+z.x)/3,(2*ot.y+z.y)/3)),b&&(z=y.i(1),y.L(2,(2*b.x+z.x)/3,(2*b.y+z.y)/3))))),y.zf();else if(ut.layer===ft.layer)y.zf();else{var yt=!1,xt=!1,Ct=this.ie,bt=y.firstPickIndex+1;if(y.isOrthogonal){xt=!0;var Vt=y.pointsCount;4<Vt&&y.points.removeRange(2,Vt-3)}else if(y.curve===dl)yt=!0,Vt=y.pointsCount,4<Vt&&y.points.removeRange(2,Vt-3),Vt===4&&(bt=2);else{Vt=y.pointsCount;var zt=lt===lr,$t=ot===lr;2<Vt&&zt&&$t?y.points.removeRange(1,Vt-2):3<Vt&&zt&&!$t?y.points.removeRange(1,Vt-3):3<Vt&&!zt&&$t?y.points.removeRange(2,Vt-2):4<Vt&&!zt&&!$t&&y.points.removeRange(2,Vt-3)}if(x.rev){for(;ft!==null&&ut!==ft;){var ie=Vt=null;for(zt=ft.sourceEdges.iterator;zt.next()&&($t=zt.value,$t.link!==x.link||(Vt=$t.fromVertex,ie=$t.toVertex,Vt.node!==null)););if(Vt===null)break;if(Vt!==ut){zt=y.i(bt-1).x,$t=y.i(bt-1).y;var oe=Vt.centerX,de=Vt.centerY;if(xt)this.K===180||this.K===0?bt===y.firstPickIndex+1?(y.m(bt++,zt,$t),y.m(bt++,zt,de)):(ie!==null?ie.centerY:$t)!==de&&(ie=this.Ta[Vt.layer-1]+this.Rf.x,y.m(bt++,ie,$t),y.m(bt++,ie,de)):bt===y.firstPickIndex+1?(y.m(bt++,zt,$t),y.m(bt++,oe,$t)):(ie!==null?ie.centerX:zt)!==oe&&(ie=this.Ta[Vt.layer-1]+this.Rf.y,y.m(bt++,zt,ie),y.m(bt++,oe,ie));else if(bt===y.firstPickIndex+1){ie=Math.max(10,this.he[ft.layer]);var ke=Math.max(10,this.Ld[ft.layer]);if(yt)this.K===180?oe<=ft.bounds.x?(ft=ft.bounds.x,y.m(bt++,ft-ie,de),y.m(bt++,ft,de),y.m(bt++,ft+ke,de)):(y.m(bt++,oe-ie,de),y.m(bt++,oe,de),y.m(bt++,oe+ke,de)):this.K===90?de>=ft.bounds.bottom?(ft=ft.bounds.y+ft.bounds.height,y.m(bt++,oe,ft+ke),y.m(bt++,oe,ft),y.m(bt++,oe,ft-ie)):(y.m(bt++,oe,de+ke),y.m(bt++,oe,de),y.m(bt++,oe,de-ie)):this.K===270?de<=ft.bounds.y?(ft=ft.bounds.y,y.m(bt++,oe,ft-ie),y.m(bt++,oe,ft),y.m(bt++,oe,ft+ke)):(y.m(bt++,oe,de-ie),y.m(bt++,oe,de),y.m(bt++,oe,de+ke)):this.K===0&&(oe>=ft.bounds.right?(ft=ft.bounds.x+ft.bounds.width,y.m(bt++,ft+ke,de),y.m(bt++,ft,de),y.m(bt++,ft-ie,de)):(y.m(bt++,oe+ke,de),y.m(bt++,oe,de),y.m(bt++,oe-ie,de)));else{y.m(bt++,zt,$t);var Hn=0;this.K===180||this.K===0?((this.K===180?oe>=ft.bounds.right:oe<=ft.bounds.x)&&(Hn=(this.K===0?-ie:ke)/2),y.m(bt++,zt+Hn,de)):((this.K===270?de>=ft.bounds.bottom:de<=ft.bounds.y)&&(Hn=(this.K===90?-ie:ke)/2),y.m(bt++,oe,$t+Hn)),y.m(bt++,oe,de)}}else ie=Math.max(10,this.he[Vt.layer]),ke=Math.max(10,this.Ld[Vt.layer]),yt?this.K===180?(y.m(bt++,oe-ie-Ct,de),y.m(bt++,Math.min(oe-ie+Ct/2,oe),de),y.m(bt++,oe,de),y.m(bt++,oe,de),y.m(bt++,Math.max(oe+ke-Ct/2,oe),de),y.m(bt++,oe+ke+Ct,de)):this.K===90?(y.m(bt++,oe,de+ke+Ct),y.m(bt++,oe,Math.max(de+ke-Ct/2,de)),y.m(bt++,oe,de),y.m(bt++,oe,de),y.m(bt++,oe,Math.min(de-ie+Ct/2,de)),y.m(bt++,oe,de-ie-Ct)):this.K===270?(y.m(bt++,oe,de-ie-Ct),y.m(bt++,oe,Math.min(de-ie+Ct/2,de)),y.m(bt++,oe,de),y.m(bt++,oe,de),y.m(bt++,oe,Math.max(de+ke-Ct/2,de)),y.m(bt++,oe,de+ke+Ct)):(y.m(bt++,oe+ke+Ct,de),y.m(bt++,Math.max(oe+ke-Ct/2,oe),de),y.m(bt++,oe,de),y.m(bt++,oe,de),y.m(bt++,Math.min(oe-ie+Ct/2,oe),de),y.m(bt++,oe-ie-Ct,de)):y.m(bt++,oe,de)}ft=Vt}(rt===null||lt!==lr||xt)&&(zt=y.i(bt-1).x,$t=y.i(bt-1).y,oe=y.i(bt).x,de=y.i(bt).y,xt?(Ct=this.Ld[ut.layer],this.K===180||this.K===0?(xt=$t,xt>=ut.bounds.y&&xt<=ut.bounds.bottom&&(this.K===180?oe>=ut.bounds.x:oe<=ut.bounds.right)&&(ft=ut.centerX+(this.K===180?-Ct:Ct),xt<ut.bounds.y+ut.bounds.height/2?xt=ut.bounds.y-this.kc/2:xt=ut.bounds.bottom+this.kc/2,y.m(bt++,ft,$t),y.m(bt++,ft,xt)),y.m(bt++,oe,xt)):(xt=zt,xt>=ut.bounds.x&&xt<=ut.bounds.right&&(this.K===270?de>=ut.bounds.y:de<=ut.bounds.bottom)&&(ft=ut.centerY+(this.K===270?-Ct:Ct),xt<ut.bounds.x+ut.bounds.width/2?xt=ut.bounds.x-this.kc/2:xt=ut.bounds.right+this.kc/2,y.m(bt++,zt,ft),y.m(bt++,xt,ft)),y.m(bt++,xt,de)),y.m(bt++,oe,de)):yt?(ie=Math.max(10,this.he[ut.layer]),ke=Math.max(10,this.Ld[ut.layer]),this.K===180&&oe>=ut.bounds.x?(ft=ut.bounds.x+ut.bounds.width,y.L(bt-2,ft,$t),y.L(bt-1,ft+ke,$t)):this.K===90&&de<=ut.bounds.bottom?(ft=ut.bounds.y,y.L(bt-2,zt,ft),y.L(bt-1,zt,ft-ie)):this.K===270&&de>=ut.bounds.y?(ft=ut.bounds.y+ut.bounds.height,y.L(bt-2,zt,ft),y.L(bt-1,zt,ft+ke)):this.K===0&&oe<=ut.bounds.right&&(ft=ut.bounds.x,y.L(bt-2,ft,$t),y.L(bt-1,ft-ie,$t))):(ie=Math.max(10,this.he[ut.layer]),ke=Math.max(10,this.Ld[ut.layer]),xt=0,this.K===180||this.K===0?((this.K===180?oe<=ut.bounds.x:oe>=ut.bounds.right)&&(xt=(this.K===0?ke:-ie)/2),y.m(bt++,oe+xt,$t)):((this.K===270?de<=ut.bounds.y:de>=ut.bounds.bottom)&&(xt=(this.K===90?ke:-ie)/2),y.m(bt++,zt,de+xt)),y.m(bt++,oe,de)))}else{for(;ut!==null&&ut!==ft;){for(ie=Vt=null,ut=ut.destinationEdges.iterator;ut.next()&&(zt=ut.value,zt.link!==x.link||(Vt=zt.toVertex,ie=zt.fromVertex,ie.node!==null&&(ie=null),Vt.node!==null)););if(Vt===null)break;Vt!==ft&&(zt=y.i(bt-1).x,$t=y.i(bt-1).y,oe=Vt.centerX,de=Vt.centerY,xt?this.K===180||this.K===0?(ie!==null?ie.centerY:$t)!==de&&(ie=this.Ta[Vt.layer]+this.Rf.x,bt===y.firstPickIndex+1&&(ie=this.K===0?Math.max(ie,zt):Math.min(ie,zt)),y.m(bt++,ie,$t),y.m(bt++,ie,de)):(ie!==null?ie.centerX:zt)!==oe&&(ie=this.Ta[Vt.layer]+this.Rf.y,bt===y.firstPickIndex+1&&(ie=this.K===90?Math.max(ie,$t):Math.min(ie,$t)),y.m(bt++,zt,ie),y.m(bt++,oe,ie)):(ie=Math.max(10,this.he[Vt.layer]),ke=Math.max(10,this.Ld[Vt.layer]),yt?this.K===180?(y.m(bt++,oe+ke+Ct,de),y.m(bt++,Math.max(oe+ke-Ct/2,oe),de),y.m(bt++,oe,de),y.m(bt++,oe,de),y.m(bt++,Math.min(oe-ie+Ct/2,oe),de),y.m(bt++,oe-ie-Ct,de)):this.K===90?(y.m(bt++,oe,de-ie-Ct),y.m(bt++,oe,Math.min(de-ie+Ct/2,de)),y.m(bt++,oe,de),y.m(bt++,oe,de),y.m(bt++,oe,Math.max(de+ke-Ct/2,de)),y.m(bt++,oe,de+ke+Ct)):this.K===270?(y.m(bt++,oe,de+ke+Ct),y.m(bt++,oe,Math.max(de+ke-Ct/2,de)),y.m(bt++,oe,de),y.m(bt++,oe,de),y.m(bt++,oe,Math.min(de-ie+Ct/2,de)),y.m(bt++,oe,de-ie-Ct)):(y.m(bt++,oe-ie-Ct,de),y.m(bt++,Math.min(oe-ie+Ct/2,oe),de),y.m(bt++,oe,de),y.m(bt++,oe,de),y.m(bt++,Math.max(oe+ke-Ct/2,oe),de),y.m(bt++,oe+ke+Ct,de)):this.K===180?(y.m(bt++,oe+ke,de),y.m(bt++,oe-ie,de)):this.K===90?(y.m(bt++,oe,de-ie),y.m(bt++,oe,de+ke)):this.K===270?(y.m(bt++,oe,de+ke),y.m(bt++,oe,de-ie)):(y.m(bt++,oe-ie,de),y.m(bt++,oe+ke,de)))),ut=Vt}xt&&(zt=y.i(bt-1).x,$t=y.i(bt-1).y,oe=y.i(bt).x,de=y.i(bt).y,this.K===180||this.K===0?$t!==de&&(ie=this.K===0?Math.min(Math.max((oe+zt)/2,this.Ta[ft.layer]+this.Rf.x),oe):Math.max(Math.min((oe+zt)/2,this.Ta[ft.layer]+this.Rf.x),oe),y.m(bt++,ie,$t),y.m(bt++,ie,de)):zt!==oe&&(ie=this.K===90?Math.min(Math.max((de+$t)/2,this.Ta[ft.layer]+this.Rf.y),de):Math.max(Math.min((de+$t)/2,this.Ta[ft.layer]+this.Rf.y),de),y.m(bt++,zt,ie),y.m(bt++,oe,ie)))}E!==null&&yt&&4<=y.pointsCount&&(tt!==null&&(tt=lt===lr?y.getLinkPointFromPoint(b,tt,tt.ga(dr),y.i(3),!0):y.i(0),lt===lr&&(lt=y.i(2),E=y.i(3),this.direction===90||this.direction===270?(y.L(1,(tt.x+lt.x)/2,lt.y),y.L(2,E.x,(lt.y+E.y)/2)):(y.L(1,lt.x,(tt.y+lt.y)/2),y.L(2,(lt.x+E.x)/2,E.y))),tt.w()||tt.set(b.actualBounds.center),y.L(0,tt.x,tt.y)),rt!==null&&(b=ot===lr?y.getLinkPointFromPoint(z,rt,rt.ga(dr),y.i(y.pointsCount-4),!1):y.i(y.pointsCount-1),ot===lr&&(rt=y.i(y.pointsCount-3),ot=y.i(y.pointsCount-4),this.direction===90||this.direction===270?(y.L(y.pointsCount-2,(b.x+rt.x)/2,rt.y),y.L(y.pointsCount-2,ot.x,(rt.y+ot.y)/2)):(y.L(y.pointsCount-2,rt.x,(b.y+rt.y)/2),y.L(y.pointsCount-3,(rt.x+ot.x)/2,ot.y))),b.w()||b.set(z.actualBounds.center),y.L(y.pointsCount-1,b.x,b.y))),y.zf(),x.commit()}}}this.avoidOrthogonalOverlaps()},Po.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new cn,y=this.network.edges.iterator;y.next();){var x=y.value.link;x!==null&&x.isOrthogonal&&!a.contains(x)&&a.add(x)}if(0<a.count)if(this.K===90||this.K===270){for(y=0,x=[],a=a.iterator;a.next();){var E=a.value;if(E!==null&&E.isOrthogonal)for(var b=2;b<E.pointsCount-3;b++){var z=E.i(b),tt=E.i(b+1);if(this.B(z.y,tt.y)&&!this.B(z.x,tt.x)){var rt=new Cd;rt.layer=Math.floor(z.y/2);var ot=E.i(0),lt=E.i(E.pointsCount-1);if(rt.first=ot.x*ot.x+ot.y,rt.jc=lt.x*lt.x+lt.y,rt.rd=Math.min(z.x,tt.x),rt.Ic=Math.max(z.x,tt.x),rt.index=b,rt.link=E,b+2<E.pointsCount){ot=E.i(b-1),lt=E.i(b+2);var ut=0;ot.y<z.y?ut=lt.y<z.y?3:z.x<tt.x?2:1:ot.y>z.y&&(ut=lt.y>z.y?0:tt.x<z.x?2:1),rt.j=ut}x.push(rt)}}}if(1<x.length)for(x.sort(this.Vx),a=0;a<x.length;){for(z=x[a].layer,E=a+1;E<x.length&&x[E].layer===z;)E++;if(1<E-a)for(z=a;z<E;){for(tt=x[z].Ic,b=a+1;b<E&&x[b].rd<tt;)tt=Math.max(tt,x[b].Ic),b++;if(tt=b-z,1<tt){for(this.zi(x,this.Js,z,z+tt),ut=1,rt=x[z].jc,ot=z;ot<b;ot++)lt=x[ot],lt.jc!==rt&&(ut++,rt=lt.jc);this.zi(x,this.Ux,z,z+tt);var ft=1;for(rt=x[z].first,ot=z;ot<b;ot++)lt=x[ot],lt.first!==rt&&(ft++,rt=lt.first);for(ot=!0,lt=ft,ut<ft?(ot=!1,lt=ut,rt=x[z].jc,this.zi(x,this.Js,z,z+tt)):rt=x[z].first,ut=0,ft=z;ft<b;ft++){var yt=x[ft];(ot?yt.first:yt.jc)!==rt&&(ut++,rt=ot?yt.first:yt.jc);var xt=yt.link;z=xt.i(yt.index),tt=xt.i(yt.index+1);var Ct=this.linkSpacing*(ut-(lt-1)/2);y++,xt.uh(),xt.L(yt.index,z.x,z.y+Ct),xt.L(yt.index+1,tt.x,tt.y+Ct),xt.zf()}}z=b}a=E}}else{for(y=0,x=[],a=a.iterator;a.next();)if(E=a.value,E!==null&&E.isOrthogonal)for(b=2;b<E.pointsCount-3;b++)z=E.i(b),tt=E.i(b+1),this.B(z.x,tt.x)&&!this.B(z.y,tt.y)&&(rt=new Cd,rt.layer=Math.floor(z.x/2),ot=E.i(0),lt=E.i(E.pointsCount-1),rt.first=ot.x+ot.y*ot.y,rt.jc=lt.x+lt.y*lt.y,rt.rd=Math.min(z.y,tt.y),rt.Ic=Math.max(z.y,tt.y),rt.index=b,rt.link=E,b+2<E.pointsCount&&(ot=E.i(b-1),lt=E.i(b+2),ut=0,ot.x<z.x?ut=lt.x<z.x?3:z.y<tt.y?2:1:ot.x>z.x&&(ut=lt.x>z.x?0:tt.y<z.y?2:1),rt.j=ut),x.push(rt));if(1<x.length)for(x.sort(this.Vx),a=0;a<x.length;){for(z=x[a].layer,E=a+1;E<x.length&&x[E].layer===z;)E++;if(1<E-a)for(z=a;z<E;){for(tt=x[z].Ic,b=a+1;b<E&&x[b].rd<tt;)tt=Math.max(tt,x[b].Ic),b++;if(tt=b-z,1<tt){for(this.zi(x,this.Js,z,z+tt),ut=1,rt=x[z].jc,ot=z;ot<b;ot++)lt=x[ot],lt.jc!==rt&&(ut++,rt=lt.jc);for(this.zi(x,this.Ux,z,z+tt),ft=1,rt=x[z].first,ot=z;ot<b;ot++)lt=x[ot],lt.first!==rt&&(ft++,rt=lt.first);for(ot=!0,lt=ft,ut<ft?(ot=!1,lt=ut,rt=x[z].jc,this.zi(x,this.Js,z,z+tt)):rt=x[z].first,ut=0,ft=z;ft<b;ft++)yt=x[ft],(ot?yt.first:yt.jc)!==rt&&(ut++,rt=ot?yt.first:yt.jc),xt=yt.link,z=xt.i(yt.index),tt=xt.i(yt.index+1),Ct=this.linkSpacing*(ut-(lt-1)/2),y++,xt.uh(),xt.L(yt.index,z.x+Ct,z.y),xt.L(yt.index+1,tt.x+Ct,tt.y),xt.zf()}z=b}a=E}}}},wt=Po.prototype,wt.Vx=function(a,y){return a instanceof Cd&&y instanceof Cd&&a!==y?a.layer<y.layer?-1:a.layer>y.layer?1:a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},wt.Ux=function(a,y){return a instanceof Cd&&y instanceof Cd&&a!==y?a.first<y.first?-1:a.first>y.first||a.j<y.j?1:a.j>y.j||a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},wt.Js=function(a,y){return a instanceof Cd&&y instanceof Cd&&a!==y?a.jc<y.jc?-1:a.jc>y.jc||a.j<y.j?1:a.j>y.j||a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},wt.B=function(a,y){return a-=y,-1<a&&1>a},wt.zi=function(a,y,x,E){var b=a.length,z=E-x;if(!(1>=z))if((0>x||x>=b-1)&&Gt("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 Pd(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 wd(a,y,x){a.He[a.tc[y]]=x}Se.Object.defineProperties(Po.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()):Gt("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{get:function(){return this.Dk},set:function(a){this.Dk===a||a!==Sy&&a!==M0&&a!==kp||(this.Dk=a,this.C())}},layeringOption:{get:function(){return this.Zk},set:function(a){this.Zk===a||a!==k0&&a!==xy&&a!==Py||(this.Zk=a,this.C())}},initializeOption:{get:function(){return this.Qk},set:function(a){this.Qk===a||a!==b0&&a!==wy&&a!==Cy||(this.Qk=a,this.C())}},iterations:{get:function(){return this.bj},set:function(a){this.bj!==a&&0<=a&&(this.bj=a,this.C())}},aggressiveOption:{get:function(){return this.rk},set:function(a){this.rk===a||a!==Ey&&a!==N0&&a!==Ly||(this.rk=a,this.C())}},packOption:{get:function(){return this.bg},set:function(a){this.bg!==a&&0<=a&&8>a&&(this.bg=a,this.C())}},alignOption:{get:function(){return this.ve},set:function(a){this.ve!==a&&0<=a&&16>a&&(this.ve=a,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(a){this.sf!==a&&(this.sf=a,this.C())}},linkSpacing:{get:function(){return this.Cn},set:function(a){this.Cn!==a&&0<=a&&(this.Cn=a,this.C())}},maxLayer:{get:function(){return this.Ia}},maxIndex:{get:function(){return this.Iq}},maxColumn:{get:function(){return this.Ra}},minIndexLayer:{get:function(){return this.Hn}},maxIndexLayer:{get:function(){return this.Md}}});var M0=new en(Po,"CycleDepthFirst",0),Sy=new en(Po,"CycleGreedy",1),kp=new en(Po,"CycleFromLayers",2),k0=new en(Po,"LayerOptimalLinkLength",0),xy=new en(Po,"LayerLongestPathSink",1),Py=new en(Po,"LayerLongestPathSource",2),b0=new en(Po,"InitDepthFirstOut",0),wy=new en(Po,"InitDepthFirstIn",1),Cy=new en(Po,"InitNaive",2),Ey=new en(Po,"AggressiveNone",0),N0=new en(Po,"AggressiveLess",1),Ly=new en(Po,"AggressiveMore",2),Ux=8;Po.className="LayeredDigraphLayout",Po.CycleDepthFirst=M0,Po.CycleGreedy=Sy,Po.CycleFromLayers=kp,Po.LayerOptimalLinkLength=k0,Po.LayerLongestPathSink=xy,Po.LayerLongestPathSource=Py,Po.InitDepthFirstOut=b0,Po.InitDepthFirstIn=wy,Po.InitNaive=Cy,Po.AggressiveNone=Ey,Po.AggressiveLess=N0,Po.AggressiveMore=Ly,Po.PackNone=0,Po.PackExpand=1,Po.PackStraighten=2,Po.PackMedian=4,Po.PackAll=15,Po.AlignNone=0,Po.AlignUpperLeft=1,Po.AlignUpperRight=2,Po.AlignLowerLeft=4,Po.AlignLowerRight=8,Po.AlignAll=15;function Cd(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}Cd.className="SegInfo";function qf(a){Do.call(this,a)}Le(qf,Do),qf.prototype.createVertex=function(){return new kl(this)},qf.prototype.createEdge=function(){return new bp(this)},qf.className="LayeredDigraphNetwork";function kl(a){Ca.call(this,a),this.$n=this.bo=this.ao=this.co=null,this.Za=this.Ag=this.Ig=-1,this.u=NaN,this.F=null,this.valid=!1,this.finish=this.Ll=NaN,this.Dj=0,this.dv=this.ev=null}Le(kl,Ca);function ix(a,y){return a.index-y.index}function B0(a,y){if(!a.$n){for(var x=[],E=Zn(a.destinationEdgesArrayAccess),b=E.next();!b.done;b=E.next())b=b.value,b.valid&&x.push(b);a.$n=x}for(a=Zn(a.$n),x=a.next();!x.done;x=a.next())if(x=x.value,x.toVertex===y)return x;Gt("Unable to find destination edge to given vertex")}function Fy(a){if(!a.co){for(var y=[],x=Zn(a.sourceEdgesArrayAccess),E=x.next();!E.done;E=x.next())E=E.value,E.valid&&y.push(E.fromVertex);y.sort(ix),a.co=y}return a.co}function Yx(a){if(!a.ao){for(var y=[],x=Zn(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}kl.prototype.Cl=function(a){Ca.prototype.Cl.call(this,a),this.bo=this.co=null},kl.prototype.Kl=function(a){Ca.prototype.Kl.call(this,a),this.bo=this.co=null},kl.prototype.zl=function(a){Ca.prototype.zl.call(this,a),this.$n=this.ao=null},kl.prototype.Jl=function(a){Ca.prototype.Jl.call(this,a),this.$n=this.ao=null},Se.Object.defineProperties(kl.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)}}}),kl.prototype.deleteDestinationEdge=kl.prototype.Jl,kl.prototype.addDestinationEdge=kl.prototype.zl,kl.prototype.deleteSourceEdge=kl.prototype.Kl,kl.prototype.addSourceEdge=kl.prototype.Cl,kl.className="LayeredDigraphVertex";function bp(a){qs.call(this,a),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}Le(bp,qs),Se.Object.defineProperties(bp.prototype,{fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}},valid:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},rev:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},forest:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}},portFromPos:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},portToPos:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}},portFromColOffset:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},portToColOffset:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}}}),bp.className="LayeredDigraphEdge";function Tr(a){Ko.call(this),this.Ub=new gn,this.Wn=O0,this.ud=Ju,this.vo=_0,this.Bq=_y,this.$v=[],this.td=!0,this.Rb=R0,this.$d=new nn(10,10).freeze();var y=new Yc(this);this.W=new Zl(y),this.Y=new Zl(y),this.ru=[],a&&Object.assign(this,a)}Le(Tr,Ko),Tr.prototype.cloneProtected=function(a){Ko.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)},Tr.prototype.qb=function(a){a.classType===Tr?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:Gt("Unknown enum value: "+a):Ko.prototype.qb.call(this,a)},Tr.prototype.createNetwork=function(){return new Yc(this)},Tr.prototype.makeNetwork=function(a){function y(E){if(E instanceof qn)return!E.isLinkLabel&&E.category!=="Comment";if(E instanceof kn){var b=E.fromNode;return b===null||b.isLinkLabel||b.category==="Comment"?!1:(E=E.toNode,!(E===null||E.isLinkLabel||E.category==="Comment"))}return!1}var x=this.createNetwork();return a instanceof be?(x.lg(a.nodes,!0,y),x.lg(a.links,!0,y)):a instanceof rr?x.lg(a.memberParts,!1,y):x.lg(a.iterator,!1,y),x},Tr.prototype.doLayout=function(a){this.network===null&&(this.network=this.makeNetwork(a)),this.arrangement!==j0&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var y=this.diagram;if(y===null&&a instanceof be&&(y=a),this.path===O0&&y!==null?this.ud=y.isTreePathToChildren?Ju:Kc:this.ud=this.path===O0?Ju: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 gn,y=this.Ub.iterator;y.next();){var x=y.value;x instanceof qn?(x=this.network.ki(x),x!==null&&a.add(x)):x instanceof Zl&&a.add(x)}this.Ub=a}for(this.Ub.count===0&&this.findRoots(),a=this.Ub.copy().iterator;a.next();)y=a.value,y.initialized||(y.initialized=!0,My(this,y));for(y=this.network.vertexes,a=null;a=Xx(y),0<a.count;)y=rx(this,a),y!==null&&this.Ub.add(y),y.initialized=!0,My(this,y),y=a;for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Zl&&ax(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Zl&&sx(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Zl&&lx(this,y);if(this.Cu(),this.layerStyle===z0){for(a=[],y=this.network.vertexes.iterator;y.next();){x=y.value;var E=x.parent;E===null&&(E=x),E=E.angle===0||E.angle===180;var b=a[x.level];b===void 0&&(b=0),a[x.level]=Math.max(b,E?x.width:x.height)}for(y=0;y<a.length;y++)a[y]===void 0&&(a[y]=0);for(this.$v=a,y=this.network.vertexes.iterator;y.next();)x=y.value,E=x.parent,E===null&&(E=x),E.angle===0||E.angle===180?(E.angle===180&&(x.focusX+=a[x.level]-x.width),x.width=a[x.level]):(E.angle===270&&(x.focusY+=a[x.level]-x.height),x.height=a[x.level])}else if(this.layerStyle===Ry)for(a=this.network.vertexes.iterator;a.next();){for(y=a.value,x=y.angle===0||y.angle===180,E=-1,b=0;b<y.children.length;b++){var z=y.children[b];E=Math.max(E,x?z.width:z.height)}if(0<=E)for(b=0;b<y.children.length;b++)z=y.children[b],x?(y.angle===180&&(z.focusX+=E-z.width),z.width=E):(y.angle===270&&(z.focusY+=E-z.height),z.height=E)}for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Zl&&this.layoutTree(y);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new gn,this.isValidLayout=!0};function Xx(a){var y=new gn;for(a=a.iterator;a.next();){var x=a.value;x.initialized||y.add(x)}return y}Tr.prototype.findRoots=function(){for(var a=this.network.vertexes,y=a.iterator;y.next();){var x=y.value;switch(this.ud){case Ju:x.sourceEdges.count===0&&this.Ub.add(x);break;case Kc:x.destinationEdges.count===0&&this.Ub.add(x);break;default:Gt("Unhandled path value "+this.ud.toString())}}this.Ub.count===0&&(a=rx(this,a),a!==null&&this.Ub.add(a))};function rx(a,y){var x=999999,E=null;for(y=y.iterator;y.next();){var b=y.value;switch(a.ud){case Ju:b.sourceEdges.count<x&&(x=b.sourceEdges.count,E=b);break;case Kc:b.destinationEdges.count<x&&(x=b.destinationEdges.count,E=b);break;default:Gt("Unhandled path value "+a.ud.toString())}}return E}function My(a,y){if(y!==null){switch(a.ud){case Ju:if(0<y.destinationEdges.count){for(var x=new cn,E=y.destinationVertexes;E.next();){var b=E.value;ox(a,y,b)&&x.add(b)}0<x.count&&(y.children=x.Fa())}break;case Kc:if(0<y.sourceEdges.count){for(x=new cn,E=y.sourceVertexes;E.next();)b=E.value,ox(a,y,b)&&x.add(b);0<x.count&&(y.children=x.Fa())}break;default:Gt("Unhandled path value"+a.ud.toString())}for(x=y.children,E=x.length,b=0;b<E;b++){var z=x[b];z.initialized=!0,z.level=y.level+1,z.parent=y,a.Ub.remove(z)}for(y=0;y<E;y++)My(a,x[y])}}function ox(a,y,x){if(x.initialized){if(y===null)var E=!1;else{for(E=y.parent;E!==null&&E!==x;)E=E.parent;E=E===x}if(E||x.level>y.level)return!1;a.removeChild(x.parent,x)}return!0}Tr.prototype.removeChild=function(a,y){if(a!==null&&y!==null){for(var x=a.children,E=0,b=0;b<x.length;b++)x[b]===y&&E++;if(0<E){E=Array(x.length-E);for(var z=b=0;z<x.length;z++)x[z]!==y&&(E[b++]=x[z]);a.children=E}}};function ax(a,y){if(y!==null){a.initializeTreeVertexValues(y),y.alignment===qu&&a.sortTreeVertexChildren(y);for(var x=0,E=y.childrenCount,b=0,z=y.children,tt=z.length,rt=0;rt<tt;rt++){var ot=z[rt];ax(a,ot),x+=ot.descendantCount+1,E=Math.max(E,ot.maxChildrenCount),b=Math.max(b,ot.maxGenerationCount)}y.descendantCount=x,y.maxChildrenCount=E,y.maxGenerationCount=0<E?b+1:0}}function Jx(a,y){switch(a.vo){default:case _0:return y.parent!==null?y.parent:a.W;case Oy:return y.parent===null?a.W:y.parent.parent===null?a.Y:y.parent;case Dy:return y.parent!==null?y.parent.parent!==null?y.parent.parent:a.Y:a.W;case Ty:var x=!0;if(y.childrenCount===0)x=!1;else for(var E=y.children,b=E.length,z=0;z<b;z++)if(0<E[z].childrenCount){x=!1;break}return x&&y.parent!==null?a.Y:y.parent!==null?y.parent:a.W}}Tr.prototype.initializeTreeVertexValues=function(a){if(a.copyInheritedPropertiesFrom(Jx(this,a)),a.parent!==null&&a.parent.alignment===qu){for(var y=a.angle,x=a.parent.children,E=0;E<x.length&&a!==x[E];)E++;E%2===0?E!==x.length-1&&(y=y===90?180:y===180?270:y===270?180:270):y=y===90?0:y===180?90:y===270?0:90,a.angle=y}a.initialized=!0};function sx(a,y){if(y!==null){a.assignTreeVertexValues(y),y=y.children;for(var x=y.length,E=0;E<x;E++)sx(a,y[E])}}Tr.prototype.assignTreeVertexValues=function(){};function lx(a,y){if(y!==null){y.alignment!==qu&&a.sortTreeVertexChildren(y),y=y.children;for(var x=y.length,E=0;E<x;E++)lx(a,y[E])}}Tr.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case tg:break;case Bp:a.children.reverse();break;case Ap:a.children.sort(a.comparer);break;case Tp:a.children.sort(a.comparer),a.children.reverse();break;default:Gt("Unhandled sorting value "+a.sorting.toString())}},Tr.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},Tr.prototype.addComments=function(a){var y=a.angle,x=a.parent,E=0,b=!1;x!==null&&(E=x.angle,b=x.alignment,b=Ed(b)),y=y===90||y===270,E=E===90||E===270,x=a.childrenCount===0;var z=0,tt=0,rt=0,ot=a.commentSpacing;if(a.node!==null)for(var lt=a.node.Mu();lt.next();){var ut=lt.value;ut.category==="Comment"&&ut.canLayout()&&(a.comments===null&&(a.comments=[]),a.comments.push(ut),ut.Va(),ut=ut.measuredBounds,y&&!x||!b&&!E&&x||b&&E&&x?(z=Math.max(z,ut.width),tt+=ut.height+Math.abs(rt)):(z+=ut.width+Math.abs(rt),tt=Math.max(tt,ut.height)),rt=ot)}a.comments!==null&&(y&&!x||!b&&!E&&x||b&&E&&x?(z+=Math.abs(a.commentMargin),tt=Math.max(0,tt-a.height)):(tt+=Math.abs(a.commentMargin),z=Math.max(0,z-a.width)),b=Te.allocAt(0,0,a.bounds.width+z,a.bounds.height+tt),a.bounds=b,Te.free(b))};function Ed(a){return a===Zh||a===qu||a===Gh||a===gh}function Np(a){return a===Zh||a===qu}function ky(a){var y=a.parent;if(y!==null){var x=y.alignment;if(Ed(x)){if(Np(x)){for(y=y.children,x=0;x<y.length&&a!==y[x];)x++;return x%2===0}if(x===Gh)return!0}}return!1}Tr.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=Ed(z)),E=E===90||E===270,x=b===90||b===270;for(var tt=a.childrenCount===0,rt=ky(a),ot=0,lt=a.comments,ut=lt.length,ft=At.alloc(),yt=0;yt<ut;yt++){var xt=lt[yt],Ct=xt.measuredBounds;if(E&&!tt||!z&&!x&&tt||z&&x&&tt){if(135<b&&!z||x&&rt)if(0<=a.commentMargin)for(ft.h(a.bounds.x-a.commentMargin-Ct.width,a.bounds.y+ot),xt.move(ft),xt=xt.Sd();xt.next();){var bt=xt.value;bt.fromSpot=Ja,bt.toSpot=Aa}else for(ft.h(a.bounds.x+2*a.focus.x-a.commentMargin,a.bounds.y+ot),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Aa,bt.toSpot=Ja;else if(0<=a.commentMargin)for(ft.h(a.bounds.x+2*a.focus.x+a.commentMargin,a.bounds.y+ot),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Aa,bt.toSpot=Ja;else for(ft.h(a.bounds.x+a.commentMargin-Ct.width,a.bounds.y+ot),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ja,bt.toSpot=Aa;ot=0<=a.commentSpacing?ot+(Ct.height+a.commentSpacing):ot+(a.commentSpacing-Ct.height)}else{if(135<b&&!z||!x&&rt)if(0<=a.commentMargin)for(ft.h(a.bounds.x+ot,a.bounds.y-a.commentMargin-Ct.height),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Xa,bt.toSpot=Ga;else for(ft.h(a.bounds.x+ot,a.bounds.y+2*a.focus.y-a.commentMargin),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ga,bt.toSpot=Xa;else if(0<=a.commentMargin)for(ft.h(a.bounds.x+ot,a.bounds.y+2*a.focus.y+a.commentMargin),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ga,bt.toSpot=Xa;else for(ft.h(a.bounds.x+ot,a.bounds.y+a.commentMargin-Ct.height),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Xa,bt.toSpot=Ga;ot=0<=a.commentSpacing?ot+(Ct.width+a.commentSpacing):ot+(a.commentSpacing-Ct.width)}}if(At.free(ft),y=ot-a.commentSpacing-(E?y.height:y.width),this.ud===Ju)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)}},Tr.prototype.layoutTree=function(a){if(a!==null){for(var y=a.children,x=y.length,E=0;E<x;E++)this.layoutTree(y[E]);switch(a.compaction){case I0:ux(this,a);break;case Dp:if(a.alignment===qu)ux(this,a);else if(a.childrenCount===0)E=a.parent,x=!1,y=0,E!==null&&(y=E.angle,x=E.alignment,x=Ed(x)),E=ky(a),a.S.h(0,0),a.Da.h(a.width,a.height),a.parent===null||a.comments===null||(y!==180&&y!==270||x)&&!E?a.la.h(0,0):y===180&&!x||(y===90||y===270)&&E?a.la.h(a.width-2*a.focus.x,0):a.la.h(0,a.height-2*a.focus.y),a.Yo=null,a.kp=null;else{var b=ou(a);y=b===90||b===270;var z=0,tt=a.children,rt=tt.length;for(x=0;x<rt;x++)E=tt[x],z=Math.max(z,y?E.Da.width:E.Da.height);var ot=a.alignment;E=ot===Qu;var lt=ot===$u,ut=Ed(ot),ft=Math.max(0,a.breadthLimit);x=this.computeLayerSpacing(a);var yt=a.nodeSpacing,xt=this.computeNodeIndent(a),Ct=a.rowSpacing,bt=0;(E||lt||a.hm||a.im&&a.maxGenerationCount===1)&&(bt=Math.max(0,a.rowIndent)),E=a.width;var Vt=a.height,zt=0,$t=0,ie=0,oe=null,de=null,ke=0,Hn=0,ci=0,ai=0,Fn=0,tn=0,nr=0,Ji=0;if(ut&&!Np(ot)&&135<b&&tt.reverse(),Np(ot))if(1<rt)for(var io=0;io<rt;io++)io%2===0&&io!==rt-1&&(Ji=Math.max(Ji,y?tt[io].Da.width:tt[io].Da.height));else rt===1&&(Ji=y?tt[0].Da.width:tt[0].Da.height);if(ut){switch(ot){case Zh:$t=135>b?hx(this,a,tt,Ji,zt,$t):dx(this,a,tt,Ji,zt,$t),Ji=$t.x,zt=$t.width,$t=$t.height;break;case Gh:for(oe=0;oe<rt;oe++)de=tt[oe],ft=de.Da,ie=tn===0?0:Ct,y?(de.S.h(z-ft.width,ai+ie),zt=Math.max(zt,ft.width),$t=Math.max($t,ai+ie+ft.height),ai+=ie+ft.height):(de.S.h(ci+ie,z-ft.height),zt=Math.max(zt,ci+ie+ft.width),$t=Math.max($t,ft.height),ci+=ie+ft.width),tn++;break;case gh:for(oe=0;oe<rt;oe++)de=tt[oe],z=de.Da,ft=tn===0?0:Ct,y?(de.S.h(yt/2+a.focus.x,ai+ft),zt=Math.max(zt,z.width),$t=Math.max($t,ai+ft+z.height),ai+=ft+z.height):(de.S.h(ci+ft,yt/2+a.focus.y),zt=Math.max(zt,ci+ft+z.width),$t=Math.max($t,z.height),ci+=ft+z.width),tn++}oe=Hs(this,2),de=Hs(this,2),y?(oe[0].h(0,0),oe[1].h(0,$t),de[0].h(zt,0)):(oe[0].h(0,0),oe[1].h(zt,0),de[0].h(0,$t)),de[1].h(zt,$t)}else for(io=0;io<rt;io++){var No=tt[io],ba=No.Da;if(y){0<ft&&0<tn&&ci+yt+ba.width>ft&&(ci<z&&oc(a,ot,z-ci,0,nr,io-1),Fn++,tn=0,nr=io,ie=$t,ci=0,ai=135<b?-$t-Ct:$t+Ct),T0(this,No,0,ai);var Oa=0;if(tn===0)oe=No.Yo,de=No.kp,ke=ba.width,Hn=ba.height,(oe===null||de===null||b!==ou(No))&&(oe=Hs(this,2),de=Hs(this,2),oe[0].h(0,0),oe[1].h(0,Hn),de[0].h(ke,0),de[1].h(ke,Hn));else{var cs=Jn();Hn=cx(this,a,No,oe,de,ke,Hn,cs),Oa=Hn.x,oe=cs[0],de=cs[1],ke=Hn.width,Hn=Hn.height,li(cs),ci<ba.width&&0>Oa&&(Vc(a,-Oa,0,nr,io-1),D0(oe,-Oa,0),D0(de,-Oa,0),Oa=0)}No.S.h(Oa,ai),zt=Math.max(zt,ke),$t=Math.max($t,ie+(Fn===0?0:Ct)+ba.height),ci=ke}else 0<ft&&0<tn&&ai+yt+ba.height>ft&&(ai<z&&oc(a,ot,0,z-ai,nr,io-1),Fn++,tn=0,nr=io,ie=zt,ai=0,ci=135<b?-zt-Ct:zt+Ct),T0(this,No,ci,0),Oa=0,tn===0?(oe=No.Yo,de=No.kp,ke=ba.width,Hn=ba.height,(oe===null||de===null||b!==ou(No))&&(oe=Hs(this,2),de=Hs(this,2),oe[0].h(0,0),oe[1].h(ke,0),de[0].h(0,Hn),de[1].h(ke,Hn))):(cs=Jn(),Hn=cx(this,a,No,oe,de,ke,Hn,cs),Oa=Hn.x,oe=cs[0],de=cs[1],ke=Hn.width,Hn=Hn.height,li(cs),ai<ba.height&&0>Oa&&(Vc(a,0,-Oa,nr,io-1),D0(oe,0,-Oa),D0(de,0,-Oa),Oa=0)),No.S.h(ci,Oa),$t=Math.max($t,Hn),zt=Math.max(zt,ie+(Fn===0?0:Ct)+ba.width),ai=Hn;tn++}switch(0<Fn&&(y?($t+=Math.max(0,x),ci<zt&&oc(a,ot,zt-ci,0,nr,rt-1),0<bt&&(lt||Vc(a,bt,0,0,rt-1),zt+=bt)):(zt+=Math.max(0,x),ai<$t&&oc(a,ot,0,$t-ai,nr,rt-1),0<bt&&(lt||Vc(a,0,bt,0,rt-1),$t+=bt))),bt=lt=0,ot){case eg:y?lt+=zt/2-a.focus.x-xt/2:bt+=$t/2-a.focus.y-xt/2;break;case Uc:0<Fn?y?lt+=zt/2-a.focus.x-xt/2:bt+=$t/2-a.focus.y-xt/2:y?(Ji=tt[0].S.x+tt[0].la.x,lt+=Ji+(tt[rt-1].S.x+tt[rt-1].la.x+2*tt[rt-1].focus.x-Ji)/2-a.focus.x-xt/2):(Ji=tt[0].S.y+tt[0].la.y,bt+=Ji+(tt[rt-1].S.y+tt[rt-1].la.y+2*tt[rt-1].focus.y-Ji)/2-a.focus.y-xt/2);break;case Qu:y?(lt-=xt,zt+=xt):(bt-=xt,$t+=xt);break;case $u:y?(lt+=zt-a.width+xt,zt+=xt):(bt+=$t-a.height+xt,$t+=xt);break;case Zh:y?1<rt?lt+=Ji+yt/2-a.focus.x:lt+=tt[0].focus.x-a.focus.x+tt[0].la.x:1<rt?bt+=Ji+yt/2-a.focus.y:bt+=tt[0].focus.y-a.focus.y+tt[0].la.y;break;case Gh:y?lt+=zt+yt/2-a.focus.x:bt+=$t+yt/2-a.focus.y;break;case gh:break;default:$t=this.customAlignment(a,lt,bt,zt,$t),lt=$t[0],bt=$t[1],zt=$t[2],$t=$t[3]}for(xt=0;xt<rt;xt++)Ji=tt[xt],y?Ji.S.h(Ji.S.x+Ji.la.x-lt,Ji.S.y+(135<b?(ut?-$t:-Ji.Da.height)+Ji.la.y-x:Vt+x+Ji.la.y)):Ji.S.h(Ji.S.x+(135<b?(ut?-zt:-Ji.Da.width)+Ji.la.x-x:E+x+Ji.la.x),Ji.S.y+Ji.la.y-bt);if(rt=tt=0,ut?y?(zt=by(a,zt,lt),0>lt&&(lt=0),135<b&&(bt+=$t+x),$t+=Vt+x,ot===gh&&(tt+=yt/2+a.focus.x),rt+=Vt+x):(135<b&&(lt+=zt+x),zt+=E+x,$t=Ny(a,$t,bt),0>bt&&(bt=0),ot===gh&&(rt+=yt/2+a.focus.y),tt+=E+x):y?(a.comments===null?E>zt&&(zt=By(ot,E-zt,0),tt=zt.x,rt=zt.y,zt=E,lt=0):zt=by(a,zt,lt),0>lt&&(tt-=lt,lt=0),135<b&&(bt+=$t+x),$t=Math.max(Math.max($t,Vt),$t+Vt+x),rt+=Vt+x):(135<b&&(lt+=zt+x),zt=Math.max(Math.max(zt,E),zt+E+x),a.comments===null?Vt>$t&&($t=By(ot,0,Vt-$t),tt=$t.x,rt=$t.y,$t=Vt,bt=0):$t=Ny(a,$t,bt),0>bt&&(rt-=bt,bt=0),tt+=E+x),0<Fn)b=Hs(this,4),Fn=Hs(this,4),y?(b[2].h(0,Vt+x),b[3].h(b[2].x,$t),Fn[2].h(zt,b[2].y),Fn[3].h(Fn[2].x,b[3].y)):(b[2].h(E+x,0),b[3].h(zt,b[2].y),Fn[2].h(b[2].x,$t),Fn[3].h(b[3].x,Fn[2].y));else{for(b=Hs(this,oe.length+2),Fn=Hs(this,de.length+2),ot=0;ot<oe.length;ot++)ut=oe[ot],b[ot+2].h(ut.x+tt,ut.y+rt);for(ot=0;ot<de.length;ot++)ut=de[ot],Fn[ot+2].h(ut.x+tt,ut.y+rt)}y?(b[0].h(lt,0),b[1].h(b[0].x,Vt),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])),Fn[0].h(lt+E,0),Fn[1].h(Fn[0].x,Vt),Fn[2].y<Fn[1].y&&(Fn[2].x<Fn[0].x?Fn[2].assign(Fn[1]):Fn[1].assign(Fn[2])),Fn[3].y<Fn[2].y&&(Fn[3].x<Fn[0].x?Fn[3].assign(Fn[2]):Fn[2].assign(Fn[3])),b[2].y-=x/2,Fn[2].y-=x/2):(b[0].h(0,bt),b[1].h(E,b[0].y),b[2].x<b[1].x&&(b[2].y>b[0].y?b[2].assign(b[1]):b[1].assign(b[2])),b[3].x<b[2].x&&(b[3].y>b[0].y?b[3].assign(b[2]):b[2].assign(b[3])),Fn[0].h(0,bt+Vt),Fn[1].h(E,Fn[0].y),Fn[2].x<Fn[1].x&&(Fn[2].y<Fn[0].y?Fn[2].assign(Fn[1]):Fn[1].assign(Fn[2])),Fn[3].x<Fn[2].x&&(Fn[3].y<Fn[0].y?Fn[3].assign(Fn[2]):Fn[2].assign(Fn[3])),b[2].x-=x/2,Fn[2].x-=x/2),vu(this,oe),vu(this,de),a.Yo=b,a.kp=Fn,a.la.h(lt,bt),a.Da.h(zt,$t)}break;default:Gt("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=Ed(x));var b=ky(y);y.S.h(0,0),y.Da.h(y.width,y.height),y.parent===null||y.comments===null||(E!==180&&E!==270||x)&&!b?y.la.h(0,0):E===180&&!x||(E===90||E===270)&&b?y.la.h(y.width-2*y.focus.x,0):y.la.h(0,y.height-2*y.focus.y)}else{E=ou(y),x=E===90||E===270;var z=0;b=y.children;for(var tt=b.length,rt=0;rt<tt;rt++){var ot=b[rt];z=Math.max(z,x?ot.Da.width:ot.Da.height)}var lt=y.alignment,ut=lt===Qu,ft=lt===$u;rt=Ed(lt);var yt=Math.max(0,y.breadthLimit);ot=a.computeLayerSpacing(y);var xt=y.nodeSpacing,Ct=a.computeNodeIndent(y),bt=ut||ft?0:Ct/2,Vt=y.rowSpacing,zt=0;(ut||ft||y.hm||y.im&&y.maxGenerationCount===1)&&(zt=Math.max(0,y.rowIndent)),ut=y.width;var $t=y.height,ie=0,oe=0,de=0,ke=0,Hn=0,ci=0,ai=0,Fn=0,tn=0,nr=0;if(rt&&!Np(lt)&&135<E&&b.reverse(),Np(lt))if(1<tt)for(var Ji=0;Ji<tt;Ji++){var io=b[Ji],No=io.Da;Ji%2===0&&Ji!==tt-1?tn=Math.max(tn,(x?No.width:No.height)+a.computeBusNodeSpacing(io)-xt):Ji%2!==0&&(nr=Math.max(nr,(x?No.width:No.height)+a.computeBusNodeSpacing(io)-xt))}else tt===1&&(tn=x?b[0].Da.width:b[0].Da.height);if(rt)switch(lt){case Zh:case qu:oe=135>E?hx(a,y,b,tn,ie,oe):dx(a,y,b,tn,ie,oe),tn=oe.x,ie=oe.width,oe=oe.height;break;case Gh:for(yt=0;yt<tt;yt++)bt=b[yt],de=bt.Da,nr=ai===0?0:Vt,x?(bt.S.h(z-de.width,Hn+nr),ie=Math.max(ie,de.width),oe=Math.max(oe,Hn+nr+de.height),Hn+=nr+de.height):(bt.S.h(ke+nr,z-de.height),ie=Math.max(ie,ke+nr+de.width),oe=Math.max(oe,de.height),ke+=nr+de.width),ai++;break;case gh:for(z=0;z<tt;z++)yt=b[z],bt=yt.Da,de=ai===0?0:Vt,x?(yt.S.h(xt/2+y.focus.x,Hn+de),ie=Math.max(ie,bt.width),oe=Math.max(oe,Hn+de+bt.height),Hn+=de+bt.height):(yt.S.h(ke+de,xt/2+y.focus.y),ie=Math.max(ie,ke+de+bt.width),oe=Math.max(oe,bt.height),ke+=de+bt.width),ai++}else for(nr=0;nr<tt;nr++)Ji=b[nr],io=Ji.Da,x?(0<yt&&0<ai&&ke+xt+io.width>yt&&(ke<z&&oc(y,lt,z-ke,0,Fn,nr-1),ci++,ai=0,Fn=nr,de=oe,ke=0,Hn=135<E?-oe-Vt:oe+Vt),No=ai===0?bt:xt,T0(a,Ji,0,Hn),Ji.S.h(ke+No,Hn),ie=Math.max(ie,ke+No+io.width),oe=Math.max(oe,de+(ci===0?0:Vt)+io.height),ke+=No+io.width):(0<yt&&0<ai&&Hn+xt+io.height>yt&&(Hn<z&&oc(y,lt,0,z-Hn,Fn,nr-1),ci++,ai=0,Fn=nr,de=ie,Hn=0,ke=135<E?-ie-Vt:ie+Vt),No=ai===0?bt:xt,T0(a,Ji,ke,0),Ji.S.h(ke,Hn+No),oe=Math.max(oe,Hn+No+io.height),ie=Math.max(ie,de+(ci===0?0:Vt)+io.width),Hn+=No+io.height),ai++;switch(0<ci&&(x?(oe+=Math.max(0,ot),ke<ie&&oc(y,lt,ie-ke,0,Fn,tt-1),0<zt&&(ft||Vc(y,zt,0,0,tt-1),ie+=zt)):(ie+=Math.max(0,ot),Hn<oe&&oc(y,lt,0,oe-Hn,Fn,tt-1),0<zt&&(ft||Vc(y,0,zt,0,tt-1),oe+=zt))),zt=ft=0,lt){case eg:x?ft+=ie/2-y.focus.x-Ct/2:zt+=oe/2-y.focus.y-Ct/2;break;case Uc:0<ci?x?ft+=ie/2-y.focus.x-Ct/2:zt+=oe/2-y.focus.y-Ct/2:x?(a=b[0].S.x+b[0].la.x,ft+=a+(b[tt-1].S.x+b[tt-1].la.x+2*b[tt-1].focus.x-a)/2-y.focus.x-Ct/2):(a=b[0].S.y+b[0].la.y,zt+=a+(b[tt-1].S.y+b[tt-1].la.y+2*b[tt-1].focus.y-a)/2-y.focus.y-Ct/2);break;case Qu:x?(ft-=Ct,ie+=Ct):(zt-=Ct,oe+=Ct);break;case $u:x?(ft+=ie-y.width+Ct,ie+=Ct):(zt+=oe-y.height+Ct,oe+=Ct);break;case Zh:case qu:x?1<tt?ft+=tn+xt/2-y.focus.x:ft+=b[0].focus.x-y.focus.x+b[0].la.x:1<tt?zt+=tn+xt/2-y.focus.y:zt+=b[0].focus.y-y.focus.y+b[0].la.y;break;case Gh:x?ft+=ie+xt/2-y.focus.x:zt+=oe+xt/2-y.focus.y;break;case gh:break;default:a=a.customAlignment(y,ft,zt,ie,oe),ft=a[0],zt=a[1],ie=a[2],oe=a[3]}for(a=0;a<tt;a++)Ct=b[a],x?Ct.S.h(Ct.S.x+Ct.la.x-ft,Ct.S.y+(135<E?(rt?-oe:-Ct.Da.height)+Ct.la.y-ot:$t+ot+Ct.la.y)):Ct.S.h(Ct.S.x+(135<E?(rt?-ie:-Ct.Da.width)+Ct.la.x-ot:ut+ot+Ct.la.x),Ct.S.y+Ct.la.y-zt);x?(ie=by(y,ie,ft),0>ft&&(ft=0),135<E&&(zt+=oe+ot),oe=Math.max(Math.max(oe,$t),oe+$t+ot)):(135<E&&(ft+=ie+ot),ie=Math.max(Math.max(ie,ut),ie+ut+ot),oe=Ny(y,oe,zt),0>zt&&(zt=0)),y.la.h(ft,zt),y.Da.h(ie,oe)}}Tr.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 Te(E,0,b,z);if(tt===1)return y=x[0],b=y.Da.width,z=y.Da.height,new Te(E,0,b,z);for(var rt=y.nodeSpacing,ot=y.rowSpacing,lt=ou(y)===90,ut=0,ft=0,yt=0,xt=0;xt<tt;xt++)if(!(xt%2!==0||1<tt&&xt===tt-1)){var Ct=x[xt],bt=Ct.Da,Vt=ut===0?0:ot;if(lt){var zt=a.computeBusNodeSpacing(Ct)-rt;Ct.S.h(E-(bt.width+zt),yt+Vt),b=Math.max(b,bt.width+zt),z=Math.max(z,yt+Vt+bt.height),yt+=Vt+bt.height}else zt=a.computeBusNodeSpacing(Ct)-rt,Ct.S.h(ft+Vt,E-(bt.height+zt)),z=Math.max(z,bt.height+zt),b=Math.max(b,ft+Vt+bt.width),ft+=Vt+bt.width;ut++}for(ut=0,Ct=ft,xt=yt,lt?(ft=E+rt,yt=0):(ft=0,yt=E+rt),bt=0;bt<tt;bt++)if(bt%2!==0){Vt=x[bt],zt=Vt.Da;var $t=ut===0?0:ot;if(lt){var ie=a.computeBusNodeSpacing(Vt)-rt;Vt.S.h(ft+ie,yt+$t),b=Math.max(b,ft+zt.width+ie),z=Math.max(z,yt+$t+zt.height),yt+=$t+zt.height}else ie=a.computeBusNodeSpacing(Vt)-rt,Vt.S.h(ft+$t,yt+ie),b=Math.max(b,ft+$t+zt.width),z=Math.max(z,yt+zt.height+ie),ft+=$t+zt.width;ut++}return 1<tt&&tt%2===1&&(x=x[tt-1],tt=x.Da,a=a.computeBusLastRowSpacing(x,lt?Math.max(Math.abs(xt),Math.abs(yt)):Math.max(Math.abs(Ct),Math.abs(ft))),lt?(x.S.h(E+rt/2-x.focus.x-x.la.x,z+a),lt=E+rt/2-x.focus.x-x.la.x,b=Math.max(b,lt+tt.width),0>lt&&(b-=lt),z=Math.max(z,Math.max(xt,yt)+a+tt.height),0>x.S.x&&(E=A0(y,x.S.x,!1,E,rt))):(x.S.h(b+a,E+rt/2-x.focus.y-x.la.y),b=Math.max(b,Math.max(Ct,ft)+a+tt.width),yt=E+rt/2-x.focus.y-x.la.y,z=Math.max(z,yt+tt.height),0>yt&&(z-=yt),0>x.S.y&&(E=A0(y,x.S.y,!0,E,rt)))),new Te(E,0,b,z)}function dx(a,y,x,E,b,z){var tt=x.length;if(tt===0)return new Te(E,0,b,z);if(tt===1)return x=x[0],b=x.Da.width,z=x.Da.height,new Te(E,0,b,z);for(var rt=y.nodeSpacing,ot=y.rowSpacing,lt=ou(y)===270,ut=0,ft=0,yt=0,xt=0;xt<tt;xt++)if(!(xt%2!==0||1<tt&&xt===tt-1)){var Ct=x[xt],bt=Ct.Da,Vt=ut===0?0:ot;if(lt){var zt=a.computeBusNodeSpacing(Ct)-rt;yt-=Vt+bt.height,Ct.S.h(E-(bt.width+zt),yt),b=Math.max(b,bt.width+zt),z=Math.max(z,Math.abs(yt))}else zt=a.computeBusNodeSpacing(Ct)-rt,ft-=Vt+bt.width,Ct.S.h(ft,E-(bt.height+zt)),z=Math.max(z,bt.height+zt),b=Math.max(b,Math.abs(ft));ut++}for(ut=0,Ct=ft,xt=yt,lt?(ft=E+rt,yt=0):(ft=0,yt=E+rt),bt=0;bt<tt;bt++)if(bt%2!==0){Vt=x[bt],zt=Vt.Da;var $t=ut===0?0:ot;if(lt){var ie=a.computeBusNodeSpacing(Vt)-rt;yt-=$t+zt.height,Vt.S.h(ft+ie,yt),b=Math.max(b,ft+zt.width+ie),z=Math.max(z,Math.abs(yt))}else ie=a.computeBusNodeSpacing(Vt)-rt,ft-=$t+zt.width,Vt.S.h(ft,yt+ie),z=Math.max(z,yt+zt.height+ie),b=Math.max(b,Math.abs(ft));ut++}for(1<tt&&tt%2===1&&(ot=x[tt-1],ut=ot.Da,a=a.computeBusLastRowSpacing(ot,lt?Math.max(Math.abs(xt),Math.abs(yt)):Math.max(Math.abs(Ct),Math.abs(ft))),lt?(ot.S.h(E+rt/2-ot.focus.x-ot.la.x,-z-ut.height-a),ft=E+rt/2-ot.focus.x-ot.la.x,b=Math.max(b,ft+ut.width),0>ft&&(b-=ft),z=Math.max(z,Math.abs(Math.min(xt,yt))+a+ut.height),0>ot.S.x&&(E=A0(y,ot.S.x,!1,E,rt))):(ot.S.h(-b-ut.width-a,E+rt/2-ot.focus.y-ot.la.y),b=Math.max(b,Math.abs(Math.min(Ct,ft))+a+ut.width),yt=E+rt/2-ot.focus.y-ot.la.y,z=Math.max(z,yt+ut.height),0>yt&&(z-=yt),0>ot.S.y&&(E=A0(y,ot.S.y,!0,E,rt)))),y=0;y<tt;y++)rt=x[y],lt?rt.S.h(rt.S.x,rt.S.y+z):rt.S.h(rt.S.x+b,rt.S.y);return new Te(E,0,b,z)}Tr.prototype.computeBusNodeSpacing=function(a){return a.parent===null?0:a.parent.nodeSpacing},Tr.prototype.computeBusLastRowSpacing=function(a){return a.parent===null?0:a.parent.rowSpacing};function A0(a,y,x,E,b){a=a.children;for(var z=a.length,tt=0;tt<z;tt++)x?a[tt].S.h(a[tt].S.x,a[tt].S.y-y):a[tt].S.h(a[tt].S.x-y,a[tt].S.y);return y=a[z-1],Math.max(E,x?y.la.y+y.focus.y-b/2:y.la.x+y.focus.x-b/2)}function by(a,y,x){switch(a.alignment){case Uc:case eg:return x+a.width>y&&(y=x+a.width),0>x&&(y-=x),y;case Qu:return a.width>y?a.width:y;case $u:return 2*a.focus.x>y?a.width:y+a.width-2*a.focus.x;case Zh:case qu:return Math.max(a.width,Math.max(y,x+a.width)-Math.min(0,x));case Gh:return a.width-a.focus.x+a.nodeSpacing/2+y;case gh:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+y);default:return y}}function Ny(a,y,x){switch(a.alignment){case Uc:case eg:return x+a.height>y&&(y=x+a.height),0>x&&(y-=x),y;case Qu:return a.height>y?a.height:y;case $u:return 2*a.focus.y>y?a.height:y+a.height-2*a.focus.y;case Zh:case qu:return Math.max(a.height,Math.max(y,x+a.height)-Math.min(0,x));case Gh:return a.height-a.focus.y+a.nodeSpacing/2+y;case gh:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+y);default:return y}}function By(a,y,x){switch(a){case eg:y/=2,x/=2;break;case Uc:y/=2,x/=2;break;case Qu:x=y=0;break;case $u:break;default:Gt("Unhandled alignment value "+a.toString())}return new At(y,x)}function oc(a,y,x,E,b,z){y=By(y,x,E),Vc(a,y.x,y.y,b,z)}function Vc(a,y,x,E,b){if(y!==0||x!==0)for(a=a.children;E<=b;E++){var z=a[E].S;z.x+=y,z.y+=x}}function T0(a,y,x,E){var b=y.parent;switch(a.ud){case Ju:for(a=y.sourceEdges;a.next();)y=a.value,y.fromVertex===b&&y.relativePoint.h(x,E);break;case Kc:for(a=y.destinationEdges;a.next();)y=a.value,y.toVertex===b&&y.relativePoint.h(x,E);break;default:Gt("Unhandled path value "+a.ud.toString())}}function D0(a,y,x){for(var E=0;E<a.length;E++){var b=a[E];b.x+=y,b.y+=x}}function cx(a,y,x,E,b,z,tt,rt){var ot=ou(y),lt=ot===90||ot===270,ut=y.nodeSpacing;y=E;var ft=b;E=z;var yt=tt,xt=x.Yo,Ct=x.kp;tt=x.Da;var bt=lt?Math.max(yt,tt.height):Math.max(E,tt.width);if((xt===null||ot!==ou(x))&&(xt=Hs(a,2),Ct=Hs(a,2),lt?(xt[0].h(0,0),xt[1].h(0,tt.height),Ct[0].h(tt.width,0),Ct[1].h(Ct[0].x,xt[1].y)):(xt[0].h(0,0),xt[1].h(tt.width,0),Ct[0].h(0,tt.height),Ct[1].h(xt[1].x,Ct[0].y))),lt){if(yt=9999999,!(ft===null||2>ft.length||xt===null||2>xt.length))for(b=x=0;x<ft.length&&b<xt.length;){z=ft[x];var Vt=xt[b];ot=Vt.x,lt=Vt.y,ot+=E;var zt=z;x+1<ft.length&&(zt=ft[x+1]);var $t=Vt;Vt=$t.x,$t=$t.y,b+1<xt.length&&($t=xt[b+1],Vt=$t.x,$t=$t.y,Vt+=E);var ie=yt;z.y===lt?ie=ot-z.x:z.y>lt&&z.y<$t?ie=ot+(z.y-lt)/($t-lt)*(Vt-ot)-z.x:lt>z.y&&lt<zt.y&&(ie=ot-(z.x+(lt-z.y)/(zt.y-z.y)*(zt.x-z.x))),ie<yt&&(yt=ie),zt.y<=z.y?x++:$t<=lt?b++:(zt.y<=$t&&x++,$t<=zt.y&&b++)}if(yt=E-yt,yt+=ut,x=xt,b=yt,y===null||2>y.length||x===null||2>x.length)E=null;else{for(ut=Hs(a,y.length+x.length),E=z=ot=0;z<x.length&&x[z].y<y[0].y;)lt=x[z++],ut[E++].h(lt.x+b,lt.y);for(;ot<y.length;)lt=y[ot++],ut[E++].h(lt.x,lt.y);for(ot=y[y.length-1].y;z<x.length&&x[z].y<=ot;)z++;for(;z<x.length&&x[z].y>ot;)lt=x[z++],ut[E++].h(lt.x+b,lt.y);for(x=Hs(a,E),ot=0;ot<E;ot++)x[ot].assign(ut[ot]);vu(a,ut),E=x}if(z=Ct,ot=yt,ft===null||2>ft.length||z===null||2>z.length)b=null;else{for(ut=Hs(a,ft.length+z.length),b=lt=x=0;x<ft.length&&ft[x].y<z[0].y;)zt=ft[x++],ut[b++].h(zt.x,zt.y);for(;lt<z.length;)zt=z[lt++],ut[b++].h(zt.x+ot,zt.y);for(z=z[z.length-1].y;x<ft.length&&ft[x].y<=z;)x++;for(;x<ft.length&&ft[x].y>z;)ot=ft[x++],ut[b++].h(ot.x,ot.y);for(z=Hs(a,b),x=0;x<b;x++)z[x].assign(ut[x]);vu(a,ut),b=z}return z=Math.max(0,yt)+tt.width,tt=bt,vu(a,y),vu(a,xt),vu(a,ft),vu(a,Ct),rt[0]=E,rt[1]=b,new Te(yt,0,z,tt)}if(E=9999999,!(ft===null||2>ft.length||xt===null||2>xt.length))for(b=x=0;x<ft.length&&b<xt.length;)z=ft[x],Vt=xt[b],ot=Vt.x,lt=Vt.y,lt+=yt,zt=z,x+1<ft.length&&(zt=ft[x+1]),$t=Vt,Vt=$t.x,$t=$t.y,b+1<xt.length&&($t=xt[b+1],Vt=$t.x,$t=$t.y,$t+=yt),ie=E,z.x===ot?ie=lt-z.y:z.x>ot&&z.x<Vt?ie=lt+(z.x-ot)/(Vt-ot)*($t-lt)-z.y:ot>z.x&&ot<zt.x&&(ie=lt-(z.y+(ot-z.x)/(zt.x-z.x)*(zt.y-z.y))),ie<E&&(E=ie),zt.x<=z.x?x++:Vt<=ot?b++:(zt.x<=Vt&&x++,Vt<=zt.x&&b++);if(yt-=E,yt+=ut,x=xt,b=yt,y===null||2>y.length||x===null||2>x.length)E=null;else{for(ut=Hs(a,y.length+x.length),E=z=ot=0;z<x.length&&x[z].x<y[0].x;)lt=x[z++],ut[E++].h(lt.x,lt.y+b);for(;ot<y.length;)lt=y[ot++],ut[E++].h(lt.x,lt.y);for(ot=y[y.length-1].x;z<x.length&&x[z].x<=ot;)z++;for(;z<x.length&&x[z].x>ot;)lt=x[z++],ut[E++].h(lt.x,lt.y+b);for(x=Hs(a,E),ot=0;ot<E;ot++)x[ot].assign(ut[ot]);vu(a,ut),E=x}if(z=Ct,ot=yt,ft===null||2>ft.length||z===null||2>z.length)b=null;else{for(ut=Hs(a,ft.length+z.length),b=lt=x=0;x<ft.length&&ft[x].x<z[0].x;)zt=ft[x++],ut[b++].h(zt.x,zt.y);for(;lt<z.length;)zt=z[lt++],ut[b++].h(zt.x,zt.y+ot);for(z=z[z.length-1].x;x<ft.length&&ft[x].x<=z;)x++;for(;x<ft.length&&ft[x].x>z;)ot=ft[x++],ut[b++].h(ot.x,ot.y);for(z=Hs(a,b),x=0;x<b;x++)z[x].assign(ut[x]);vu(a,ut),b=z}return z=bt,tt=Math.max(0,yt)+tt.height,vu(a,y),vu(a,xt),vu(a,ft),vu(a,Ct),rt[0]=E,rt[1]=b,new Te(yt,0,z,tt)}function Hs(a,y){if(a=a.ru[y],a!==void 0&&(a=a.pop(),a!==void 0))return a;a=[];for(var x=0;x<y;x++)a[x]=new At;return a}function vu(a,y){var x=y.length,E=a.ru[x];E===void 0&&(E=[],a.ru[x]=E),E.push(y)}Tr.prototype.arrangeTrees=function(){if(this.Rb===j0)for(var a=this.Ub.iterator;a.next();){var y=a.value;if(y instanceof Zl){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 Zl&&a.push(x);switch(this.sorting){case tg:break;case Bp:a.reverse();break;case Ap:a.sort(this.comparer);break;case Tp:a.sort(this.comparer),a.reverse();break;default:Gt("Unhandled sorting value "+this.sorting.toString())}for(x=this.arrangementOrigin,y=x.x,x=x.y,E=0;E<a.length;E++){var b=a[E];switch(Ay(this,b,y+b.la.x,x+b.la.y),this.Rb){case R0:x+=b.Da.height+this.$d.height;break;case Iy:y+=b.Da.width+this.$d.width;break;default:Gt("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)}}}Tr.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},Tr.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)},Tr.prototype.Gu=function(){if(this.layerStyle===z0){for(var a=this.$v,y=[],x=null,E=this.network.vertexes.iterator;E.next();){var b=E.value;x===null?x=b.bounds.copy():x.ed(b.bounds);var z=y[b.level];z===void 0?z=this.computeLayerSpacing(b):z=Math.max(z,this.computeLayerSpacing(b)),y[b.level]=z}for(E=0;E<y.length;E++)y[E]===void 0&&(y[E]=0);if(this.angle===90||this.angle===270?(x.Bc(this.nodeSpacing/2,this.layerSpacing),E=new At(-this.nodeSpacing/2,-this.layerSpacing/2)):(x.Bc(this.layerSpacing,this.nodeSpacing/2),E=new At(-this.layerSpacing/2,-this.nodeSpacing/2)),b=[],x=this.angle===90||this.angle===270?x.width:x.height,z=0,this.angle===180||this.angle===270)for(var tt=0;tt<a.length;tt++)z+=a[tt]+y[tt];for(tt=0;tt<a.length;tt++){var rt=a[tt]+y[tt];this.angle===270?(z-=rt,b.push(new Te(0,z,x,rt))):this.angle===90?(b.push(new Te(0,z,x,rt)),z+=rt):this.angle===180?(z-=rt,b.push(new Te(z,0,rt,x))):(b.push(new Te(z,0,rt,x)),z+=rt)}this.commitLayers(b,E)}},Tr.prototype.commitLayers=function(){},Tr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},Tr.prototype.yv=function(){for(var a=this.Ub.iterator;a.next();){var y=a.value;y instanceof Zl&&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])}}Tr.prototype.setPortSpots=function(a){var y=a.alignment;if(Ed(y)){var x=this.ud===Ju,E=ou(a);switch(E){case 0:var b=Aa;break;case 90:b=Ga;break;case 180:b=Ja;break;default:b=Xa}var z=a.children,tt=z.length;switch(y){case Zh:case qu:for(y=0;y<tt;y++){var rt=z[y];if(rt=(x?rt.sourceEdges:rt.destinationEdges).first(),rt!==null&&(rt=rt.link,rt!==null)){var ot=E===90||E===270?Ja:Xa;if(tt===1||y===tt-1&&tt%2===1)switch(E){case 0:ot=Ja;break;case 90:ot=Xa;break;case 180:ot=Aa;break;default:ot=Ga}else y%2===0&&(ot=E===90||E===270?Aa:Ga);x?(a.setsPortSpot&&(rt.fromSpot=b),a.setsChildPortSpot&&(rt.toSpot=ot)):(a.setsPortSpot&&(rt.fromSpot=ot),a.setsChildPortSpot&&(rt.toSpot=b))}}break;case Gh:for(E=E===90||E===270?Aa:Ga,z=x?a.destinationEdges:a.sourceEdges;z.next();)tt=z.value.link,tt!==null&&(x?(a.setsPortSpot&&(tt.fromSpot=b),a.setsChildPortSpot&&(tt.toSpot=E)):(a.setsPortSpot&&(tt.fromSpot=E),a.setsChildPortSpot&&(tt.toSpot=b)));break;case gh:for(E=E===90||E===270?Ja:Xa,z=x?a.destinationEdges:a.sourceEdges;z.next();)tt=z.value.link,tt!==null&&(x?(a.setsPortSpot&&(tt.fromSpot=b),a.setsChildPortSpot&&(tt.toSpot=E)):(a.setsPortSpot&&(tt.fromSpot=E),a.setsChildPortSpot&&(tt.toSpot=b)))}}else if(x=ou(a),this.ud===Ju){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=Aa;break;case 90:E.fromSpot=Ga;break;case 180:E.fromSpot=Ja;break;default:E.fromSpot=Xa}else E.fromSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.toSpot=Ja;break;case 90:E.toSpot=Xa;break;case 180:E.toSpot=Aa;break;default:E.toSpot=Ga}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=Aa;break;case 90:E.toSpot=Ga;break;case 180:E.toSpot=Ja;break;default:E.toSpot=Xa}else E.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.fromSpot=Ja;break;case 90:E.fromSpot=Xa;break;case 180:E.fromSpot=Aa;break;default:E.fromSpot=Ga}else E.fromSpot=a.childPortSpot}};function ou(a){return a=a.angle,45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}Tr.prototype.computeLayerSpacing=function(a){var y=ou(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},Tr.prototype.computeNodeIndent=function(a){var y=ou(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)},Se.Object.defineProperties(Tr.prototype,{roots:{get:function(){return this.Ub},set:function(a){this.Ub!==a&&(this.Ub=a,this.C())}},path:{get:function(){return this.Wn},set:function(a){this.Wn!==a&&(this.Wn=a,this.C())}},treeStyle:{get:function(){return this.vo},set:function(a){this.Rb===a||a!==_0&&a!==Dy&&a!==Ty&&a!==Oy||(this.vo=a,this.C())}},layerStyle:{get:function(){return this.Bq},set:function(a){this.Rb===a||a!==_y&&a!==Ry&&a!==z0||(this.Bq=a,this.C())}},comments:{get:function(){return this.td},set:function(a){this.td!==a&&(this.td=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==R0&&a!==Iy&&a!==j0||(this.Rb=a,this.C())}},arrangementSpacing:{get:function(){return this.$d},set:function(a){this.$d.D(a)||(this.$d.assign(a),this.C())}},rootDefaults:{get:function(){return this.W},set:function(a){this.W!==a&&(this.W=a,this.C())}},alternateDefaults:{get:function(){return this.Y},set:function(a){this.Y!==a&&(this.Y=a,this.C())}},sorting:{get:function(){return this.W.sorting},set:function(a){this.W.sorting===a||a!==tg&&a!==Bp&&a!==Ap&&!Tp||(this.W.sorting=a,this.C())}},comparer:{get:function(){return this.W.comparer},set:function(a){this.W.comparer!==a&&(this.W.comparer=a,this.C())}},angle:{get:function(){return this.W.angle},set:function(a){this.W.angle!==a&&(a===0||a===90||a===180||a===270?(this.W.angle=a,this.C()):Gt("TreeLayout.angle must be 0, 90, 180, or 270"))}},alignment:{get:function(){return this.W.alignment},set:function(a){this.W.alignment!==a&&(this.W.alignment=a,this.C())}},nodeIndent:{get:function(){return this.W.nodeIndent},set:function(a){this.W.nodeIndent!==a&&0<=a&&(this.W.nodeIndent=a,this.C())}},nodeIndentPastParent:{get:function(){return this.W.nodeIndentPastParent},set:function(a){this.W.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.W.nodeIndentPastParent=a,this.C())}},nodeSpacing:{get:function(){return this.W.nodeSpacing},set:function(a){this.W.nodeSpacing!==a&&(this.W.nodeSpacing=a,this.C())}},layerSpacing:{get:function(){return this.W.layerSpacing},set:function(a){this.W.layerSpacing!==a&&(this.W.layerSpacing=a,this.C())}},layerSpacingParentOverlap:{get:function(){return this.W.layerSpacingParentOverlap},set:function(a){this.W.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.W.layerSpacingParentOverlap=a,this.C())}},compaction:{get:function(){return this.W.compaction},set:function(a){this.W.compaction===a||a!==I0&&a!==Dp||(this.W.compaction=a,this.C())}},breadthLimit:{get:function(){return this.W.breadthLimit},set:function(a){this.W.breadthLimit!==a&&0<=a&&(this.W.breadthLimit=a,this.C())}},rowSpacing:{get:function(){return this.W.rowSpacing},set:function(a){this.W.rowSpacing!==a&&(this.W.rowSpacing=a,this.C())}},rowIndent:{get:function(){return this.W.rowIndent},set:function(a){this.W.rowIndent!==a&&0<=a&&(this.W.rowIndent=a,this.C())}},commentSpacing:{get:function(){return this.W.commentSpacing},set:function(a){this.W.commentSpacing!==a&&(this.W.commentSpacing=a,this.C())}},commentMargin:{get:function(){return this.W.commentMargin},set:function(a){this.W.commentMargin!==a&&(this.W.commentMargin=a,this.C())}},setsPortSpot:{get:function(){return this.W.setsPortSpot},set:function(a){this.W.setsPortSpot!==a&&(this.W.setsPortSpot=a,this.C())}},portSpot:{get:function(){return this.W.portSpot},set:function(a){this.W.portSpot.D(a)||(this.W.portSpot=a,this.C())}},setsChildPortSpot:{get:function(){return this.W.setsChildPortSpot},set:function(a){this.W.setsChildPortSpot!==a&&(this.W.setsChildPortSpot=a,this.C())}},childPortSpot:{get:function(){return this.W.childPortSpot},set:function(a){this.W.childPortSpot.D(a)||(this.W.childPortSpot=a,this.C())}},alternateSorting:{get:function(){return this.Y.sorting},set:function(a){this.Y.sorting===a||a!==tg&&a!==Bp&&a!==Ap&&!Tp||(this.Y.sorting=a,this.C())}},alternateComparer:{get:function(){return this.Y.comparer},set:function(a){this.Y.comparer!==a&&(this.Y.comparer=a,this.C())}},alternateAngle:{get:function(){return this.Y.angle},set:function(a){this.Y.angle===a||a!==0&&a!==90&&a!==180&&a!==270||(this.Y.angle=a,this.C())}},alternateAlignment:{get:function(){return this.Y.alignment},set:function(a){this.Y.alignment!==a&&(this.Y.alignment=a,this.C())}},alternateNodeIndent:{get:function(){return this.Y.nodeIndent},set:function(a){this.Y.nodeIndent!==a&&0<=a&&(this.Y.nodeIndent=a,this.C())}},alternateNodeIndentPastParent:{get:function(){return this.Y.nodeIndentPastParent},set:function(a){this.Y.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.Y.nodeIndentPastParent=a,this.C())}},alternateNodeSpacing:{get:function(){return this.Y.nodeSpacing},set:function(a){this.Y.nodeSpacing!==a&&(this.Y.nodeSpacing=a,this.C())}},alternateLayerSpacing:{get:function(){return this.Y.layerSpacing},set:function(a){this.Y.layerSpacing!==a&&(this.Y.layerSpacing=a,this.C())}},alternateLayerSpacingParentOverlap:{get:function(){return this.Y.layerSpacingParentOverlap},set:function(a){this.Y.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.Y.layerSpacingParentOverlap=a,this.C())}},alternateCompaction:{get:function(){return this.Y.compaction},set:function(a){this.Y.compaction===a||a!==I0&&a!==Dp||(this.Y.compaction=a,this.C())}},alternateBreadthLimit:{get:function(){return this.Y.breadthLimit},set:function(a){this.Y.breadthLimit!==a&&0<=a&&(this.Y.breadthLimit=a,this.C())}},alternateRowSpacing:{get:function(){return this.Y.rowSpacing},set:function(a){this.Y.rowSpacing!==a&&(this.Y.rowSpacing=a,this.C())}},alternateRowIndent:{get:function(){return this.Y.rowIndent},set:function(a){this.Y.rowIndent!==a&&0<=a&&(this.Y.rowIndent=a,this.C())}},alternateCommentSpacing:{get:function(){return this.Y.commentSpacing},set:function(a){this.Y.commentSpacing!==a&&(this.Y.commentSpacing=a,this.C())}},alternateCommentMargin:{get:function(){return this.Y.commentMargin},set:function(a){this.Y.commentMargin!==a&&(this.Y.commentMargin=a,this.C())}},alternateSetsPortSpot:{get:function(){return this.Y.setsPortSpot},set:function(a){this.Y.setsPortSpot!==a&&(this.Y.setsPortSpot=a,this.C())}},alternatePortSpot:{get:function(){return this.Y.portSpot},set:function(a){this.Y.portSpot.D(a)||(this.Y.portSpot=a,this.C())}},alternateSetsChildPortSpot:{get:function(){return this.Y.setsChildPortSpot},set:function(a){this.Y.setsChildPortSpot!==a&&(this.Y.setsChildPortSpot=a,this.C())}},alternateChildPortSpot:{get:function(){return this.Y.childPortSpot},set:function(a){this.Y.childPortSpot.D(a)||(this.Y.childPortSpot=a,this.C())}}});var O0=new en(Tr,"PathDefault",-1),Ju=new en(Tr,"PathDestination",0),Kc=new en(Tr,"PathSource",1),tg=new en(Tr,"SortingForwards",10),Bp=new en(Tr,"SortingReverse",11),Ap=new en(Tr,"SortingAscending",12),Tp=new en(Tr,"SortingDescending",13),eg=new en(Tr,"AlignmentCenterSubtrees",20),Uc=new en(Tr,"AlignmentCenterChildren",21),Qu=new en(Tr,"AlignmentStart",22),$u=new en(Tr,"AlignmentEnd",23),Zh=new en(Tr,"AlignmentBus",24),qu=new en(Tr,"AlignmentBusBranching",25),Gh=new en(Tr,"AlignmentTopLeftBus",26),gh=new en(Tr,"AlignmentBottomRightBus",27),I0=new en(Tr,"CompactionNone",30),Dp=new en(Tr,"CompactionBlock",31),_0=new en(Tr,"StyleLayered",40),Ty=new en(Tr,"StyleLastParents",41),Dy=new en(Tr,"StyleAlternating",42),Oy=new en(Tr,"StyleRootOnly",43),R0=new en(Tr,"ArrangementVertical",50),Iy=new en(Tr,"ArrangementHorizontal",51),j0=new en(Tr,"ArrangementFixedRoots",52),_y=new en(Tr,"LayerIndividual",60),Ry=new en(Tr,"LayerSiblings",61),z0=new en(Tr,"LayerUniform",62);Tr.className="TreeLayout",Tr.PathDefault=O0,Tr.PathDestination=Ju,Tr.PathSource=Kc,Tr.SortingForwards=tg,Tr.SortingReverse=Bp,Tr.SortingAscending=Ap,Tr.SortingDescending=Tp,Tr.AlignmentCenterSubtrees=eg,Tr.AlignmentCenterChildren=Uc,Tr.AlignmentStart=Qu,Tr.AlignmentEnd=$u,Tr.AlignmentBus=Zh,Tr.AlignmentBusBranching=qu,Tr.AlignmentTopLeftBus=Gh,Tr.AlignmentBottomRightBus=gh,Tr.CompactionNone=I0,Tr.CompactionBlock=Dp,Tr.StyleLayered=_0,Tr.StyleLastParents=Ty,Tr.StyleAlternating=Dy,Tr.StyleRootOnly=Oy,Tr.ArrangementVertical=R0,Tr.ArrangementHorizontal=Iy,Tr.ArrangementFixedRoots=j0,Tr.LayerIndividual=_y,Tr.LayerSiblings=Ry,Tr.LayerUniform=z0;function Yc(a){Do.call(this,a)}Le(Yc,Do),Yc.prototype.createVertex=function(){return new Zl(this)},Yc.prototype.createEdge=function(){return new ng(this)},Yc.className="TreeNetwork";function Zl(a){Ca.call(this,a),this.V=!1,this.hb=null,this.u=[],this.nb=this.Ha=this.F=this.ia=0,this.td=null,this.S=new At(0,0),this.Da=new nn(0,0),this.la=new At(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=tg,this.hd=ry,this.Kb=0,this.Jb=Uc,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=Dp,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=xa,this.wr=!0,this.Dp=xa}Le(Zl,Ca),Zl.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)},Se.Object.defineProperties(Zl.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)}}}),Zl.className="TreeVertex";function ng(a){qs.call(this,a),this.$t=new At(0,0)}Le(ng,qs),ng.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 Ju:x=this.fromVertex,E=this.toVertex;break;case Kc:x=this.toVertex,E=this.fromVertex;break;default:Gt("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=ou(x),tt=y.computeLayerSpacing(x),rt=x.rowSpacing;a.vg();var ot=a.curve===dl,lt=a.isOrthogonal,ut;if(a.uh(),lt||ot){for(ut=2;4<a.pointsCount;)a.pv(2);var ft=a.i(1),yt=a.i(2)}else{for(ut=1;3<a.pointsCount;)a.pv(1);ft=a.i(0),yt=a.i(a.pointsCount-1)}var xt=a.i(a.pointsCount-1);z===0?(x.alignment===$u?(z=E.bottom+b.y,b.y===0&&ft.y>xt.y+x.rowIndent&&(z=Math.min(z,Math.max(ft.y,z-y.computeNodeIndent(x))))):x.alignment===Qu?(z=E.top+b.y,b.y===0&&ft.y<xt.y-x.rowIndent&&(z=Math.max(z,Math.min(ft.y,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.top-x.la.y+b.y:E.y+E.height/2+b.y,ot?(a.m(ut,ft.x,z),ut++,a.m(ut,E.right+tt,z),ut++,a.m(ut,E.right+tt+(b.x-rt)/3,z),ut++,a.m(ut,E.right+tt+2*(b.x-rt)/3,z),ut++,a.m(ut,E.right+tt+(b.x-rt),z),ut++,a.m(ut,yt.x,z)):(lt&&(a.m(ut,E.right+tt/2,ft.y),ut++),a.m(ut,E.right+tt/2,z),ut++,a.m(ut,E.right+tt+b.x-(lt?rt/2:rt),z),ut++,lt&&a.m(ut,a.i(ut-1).x,yt.y))):z===90?(x.alignment===$u?(z=E.right+b.x,b.x===0&&ft.x>xt.x+x.rowIndent&&(z=Math.min(z,Math.max(ft.x,z-y.computeNodeIndent(x))))):x.alignment===Qu?(z=E.left+b.x,b.x===0&&ft.x<xt.x-x.rowIndent&&(z=Math.max(z,Math.min(ft.x,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.left-x.la.x+b.x:E.x+E.width/2+b.x,ot?(a.m(ut,z,ft.y),ut++,a.m(ut,z,E.bottom+tt),ut++,a.m(ut,z,E.bottom+tt+(b.y-rt)/3),ut++,a.m(ut,z,E.bottom+tt+2*(b.y-rt)/3),ut++,a.m(ut,z,E.bottom+tt+(b.y-rt)),ut++,a.m(ut,z,yt.y)):(lt&&(a.m(ut,ft.x,E.bottom+tt/2),ut++),a.m(ut,z,E.bottom+tt/2),ut++,a.m(ut,z,E.bottom+tt+b.y-(lt?rt/2:rt)),ut++,lt&&a.m(ut,yt.x,a.i(ut-1).y))):z===180?(x.alignment===$u?(z=E.bottom+b.y,b.y===0&&ft.y>xt.y+x.rowIndent&&(z=Math.min(z,Math.max(ft.y,z-y.computeNodeIndent(x))))):x.alignment===Qu?(z=E.top+b.y,b.y===0&&ft.y<xt.y-x.rowIndent&&(z=Math.max(z,Math.min(ft.y,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.top-x.la.y+b.y:E.y+E.height/2+b.y,ot?(a.m(ut,ft.x,z),ut++,a.m(ut,E.left-tt,z),ut++,a.m(ut,E.left-tt+(b.x+rt)/3,z),ut++,a.m(ut,E.left-tt+2*(b.x+rt)/3,z),ut++,a.m(ut,E.left-tt+(b.x+rt),z),ut++,a.m(ut,yt.x,z)):(lt&&(a.m(ut,E.left-tt/2,ft.y),ut++),a.m(ut,E.left-tt/2,z),ut++,a.m(ut,E.left-tt+b.x+(lt?rt/2:rt),z),ut++,lt&&a.m(ut,a.i(ut-1).x,yt.y))):z===270?(x.alignment===$u?(z=E.right+b.x,b.x===0&&ft.x>xt.x+x.rowIndent&&(z=Math.min(z,Math.max(ft.x,z-y.computeNodeIndent(x))))):x.alignment===Qu?(z=E.left+b.x,b.x===0&&ft.x<xt.x-x.rowIndent&&(z=Math.max(z,Math.min(ft.x,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.left-x.la.x+b.x:E.x+E.width/2+b.x,ot?(a.m(ut,z,ft.y),ut++,a.m(ut,z,E.top-tt),ut++,a.m(ut,z,E.top-tt+(b.y+rt)/3),ut++,a.m(ut,z,E.top-tt+2*(b.y+rt)/3),ut++,a.m(ut,z,E.top-tt+(b.y+rt)),ut++,a.m(ut,z,yt.y)):(lt&&(a.m(ut,ft.x,E.top-tt/2),ut++),a.m(ut,z,E.top-tt/2),ut++,a.m(ut,z,E.top-tt+b.y+(lt?rt/2:rt)),ut++,lt&&a.m(ut,yt.x,a.i(ut-1).y))):Gt("Invalid angle "+z),a.zf()}else b=E,a=this.link,E=this.network.layout,y=ou(x),y!==ou(b)&&(tt=E.computeLayerSpacing(x),rt=x.bounds,x=b.bounds,y===0&&x.left-rt.right<tt+1||y===90&&x.top-rt.bottom<tt+1||y===180&&rt.left-x.right<tt+1||y===270&&rt.top-x.bottom<tt+1||(a.vg(),x=a.curve===dl,b=a.isOrthogonal,E=Ed(this.fromVertex.alignment),a.uh(),y===0?(y=rt.right+tt/2,x?a.pointsCount===4&&(x=a.i(3).y,a.L(1,y-20,a.i(1).y),a.m(2,y-20,x),a.m(3,y,x),a.m(4,y+20,x),a.L(5,a.i(5).x,x)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,y,a.i(2).y),a.L(3,y,a.i(3).y)):a.pointsCount===4?a.m(2,y,a.i(2).y):a.pointsCount===3?a.L(1,y,a.i(2).y):a.pointsCount===2&&a.m(1,y,a.i(1).y)):y===90?(y=rt.bottom+tt/2,x?a.pointsCount===4&&(x=a.i(3).x,a.L(1,a.i(1).x,y-20),a.m(2,x,y-20),a.m(3,x,y),a.m(4,x,y+20),a.L(5,x,a.i(5).y)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,a.i(2).x,y),a.L(3,a.i(3).x,y)):a.pointsCount===4?a.m(2,a.i(2).x,y):a.pointsCount===3?a.L(1,a.i(2).x,y):a.pointsCount===2&&a.m(1,a.i(1).x,y)):y===180?(y=rt.left-tt/2,x?a.pointsCount===4&&(x=a.i(3).y,a.L(1,y+20,a.i(1).y),a.m(2,y+20,x),a.m(3,y,x),a.m(4,y-20,x),a.L(5,a.i(5).x,x)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,y,a.i(2).y),a.L(3,y,a.i(3).y)):a.pointsCount===4?a.m(2,y,a.i(2).y):a.pointsCount===3?a.L(1,y,a.i(2).y):a.pointsCount===2&&a.m(1,y,a.i(1).y)):y===270&&(y=rt.top-tt/2,x?a.pointsCount===4&&(x=a.i(3).x,a.L(1,a.i(1).x,y+20),a.m(2,x,y+20),a.m(3,x,y),a.m(4,x,y-20),a.L(5,x,a.i(5).y)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,a.i(2).x,y),a.L(3,a.i(3).x,y)):a.pointsCount===4?a.m(2,a.i(2).x,y):a.pointsCount===3?a.L(1,a.i(2).x,y):a.pointsCount===2&&a.m(1,a.i(1).x,y)),a.zf()))}}},Se.Object.defineProperties(ng.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)}}}),ng.className="TreeEdge",Ar.prototype.initializeStandardTools=function(){this.gb("Action",new Dl,this.mouseDownTools),this.gb("Relinking",new _a,this.mouseDownTools),this.gb("LinkReshaping",new er,this.mouseDownTools),this.gb("Rotating",new Ea,this.mouseDownTools),this.gb("Resizing",new Ma,this.mouseDownTools),this.gb("Linking",new jo,this.mouseMoveTools),this.gb("Dragging",new Oo,this.mouseMoveTools),this.gb("DragSelecting",new yl,this.mouseMoveTools),this.gb("Panning",new $a,this.mouseMoveTools),this.gb("ContextMenu",new vs,this.mouseUpTools),this.gb("TextEditing",new Go,this.mouseUpTools),this.gb("ClickCreating",new wh,this.mouseUpTools),this.gb("ClickSelecting",new Xl,this.mouseUpTools)},Nu("Horizontal",new pm),Nu("Spot",new vm),Nu("Table",new Sm),Nu("Viewbox",new wm),Nu("TableRow",new xm),Nu("TableColumn",new Pm),Nu("Graduated",new Jg),Nu("Grid",new Xg),Lf.add("GraphLinksModel",Da),Lf.add("TreeModel",Fl);var Z0=qe.go,jy={get licenseKey(){return be.licenseKey},set licenseKey(a){be.licenseKey=a},get version(){return be.version},Group:rr,EnumValue:en,List:cn,Set:gn,Map:Be,Point:At,Size:nn,Rect:Te,Margin:or,Spot:gi,Geometry:ce,PathFigure:Ir,PathSegment:Ui,InputEvent:Zi,DiagramEvent:Br,ChangedEvent:Pi,Model:Ei,GraphLinksModel:Vr,TreeModel:Ls,Binding:la,Transaction:Ro,UndoManager:qi,CommandHandler:Wt,Tool:Cr,DraggingTool:Oo,DraggingInfo:lh,DraggingOptions:at,LinkingBaseTool:mr,LinkingTool:jo,RelinkingTool:_a,LinkReshapingTool:er,ResizingTool:Ma,RotatingTool:Ea,ClickSelectingTool:Xl,ActionTool:Dl,ClickCreatingTool:wh,HTMLInfo:Lu,ContextMenuTool:vs,DragSelectingTool:yl,PanningTool:$a,TextEditingTool:Go,ToolManager:Ar,Animation:qa,AnimationManager:Js,AnimationTrigger:Ql,Layer:Ra,Diagram:be,Palette:ct,Overview:mt,Brush:So,GraphObject:fe,Panel:Pn,RowColumnDefinition:va,Shape:fr,TextBlock:To,Picture:Os,Part:Ai,Adornment:Qr,Node:qn,Link:kn,Placeholder:Ps,Layout:Ko,LayoutNetwork:Do,LayoutVertex:Ca,LayoutEdge:qs,GridLayout:Va,PanelLayout:wa,CircularLayout:Xo,CircularNetwork:Qf,CircularVertex:Ep,CircularEdge:P0,ForceDirectedLayout:es,ForceDirectedNetwork:Wc,ForceDirectedVertex:Lp,ForceDirectedEdge:Fp,LayeredDigraphLayout:Po,LayeredDigraphNetwork:qf,LayeredDigraphVertex:kl,LayeredDigraphEdge:bp,TreeLayout:Tr,TreeNetwork:Yc,TreeVertex:Zl,TreeEdge:ng};typeof Z0=="object"&&Z0.version&&Gn("WARNING: a `go` object on the root object is already defined. "+("Debug"in Z0?"debug ":"")+"version: "+Z0.version+", replaced with version: "+jy.version),be.prototype.go=jy,qe.go=jy,typeof Mn.exports=="object"&&(Mn.exports=typeof kt.g!="undefined"?kt.g.go:self.go)}();var gt=typeof kt.g!="undefined"?kt.g.go:self.go;const Ut=typeof kt.g!="undefined"?kt.g.go:self.go,ue=Ut.Group,Ee=Ut.EnumValue,he=Ut.List,Dt=Ut.Set,ee=Ut.Map,ge=Ut.Point,Qt=Ut.Size,jt=Ut.Rect,Ae=Ut.Margin,se=Ut.Spot,Pe=Ut.Geometry,Bt=Ut.PathFigure,nt=Ut.PathSegment,et=Ut.InputEvent,ht=Ut.DiagramEvent,st=Ut.ChangedEvent,pt=Ut.Model,vt=Ut.GraphLinksModel,St=Ut.TreeModel,Et=Ut.Binding,Tt=Ut.Transaction,It=Ut.UndoManager,qt=Ut.CommandHandler,Xt=Ut.Tool,Ht=Ut.DraggingTool,pe=Ut.DraggingInfo,re=Ut.LinkingBaseTool,Ne=Ut.LinkingTool,ye=Ut.RelinkingTool,xe=Ut.LinkReshapingTool,Ue=Ut.ResizingTool,je=Ut.RotatingTool,Je=Ut.ClickSelectingTool,fn=Ut.ActionTool,te=Ut.ClickCreatingTool,Jt=Ut.HTMLInfo,Xe=Ut.ContextMenuTool,On=Ut.DragSelectingTool,bn=Ut.PanningTool,De=Ut.TextEditingTool,on=Ut.ToolManager,un=Ut.Animation,Kn=Ut.AnimationManager,Me=Ut.AnimationTrigger,vn=Ut.Layer,ne=Ut.Diagram,wn=Ut.Palette,fi=Ut.Overview,Rt=Ut.Brush,Lt=Ut.GraphObject,Pt=Ut.Panel,Nt=Ut.RowColumnDefinition,Zt=Ut.Shape,Mt=Ut.TextBlock,Yt=Ut.TextBlockMetrics,Ge=Ut.Picture,Oe=Ut.Part,Ke=Ut.Adornment,we=Ut.Node,Ce=Ut.Link,Fe=Ut.Placeholder,He=Ut.Layout,Qe=Ut.LayoutNetwork,hn=Ut.LayoutVertex,dn=Ut.LayoutEdge,ri=Ut.GridLayout,ze=Ut.PanelLayout,We=Ut.CircularLayout,an=Ut.CircularNetwork,Xn=Ut.CircularVertex,pn=Ut.CircularEdge,rn=Ut.ForceDirectedLayout,In=Ut.ForceDirectedNetwork,pi=Ut.ForceDirectedVertex,ei=Ut.ForceDirectedEdge,mi=Ut.LayeredDigraphLayout,Hi=Ut.LayeredDigraphNetwork,Cn=Ut.LayeredDigraphVertex,Sn=Ut.LayeredDigraphEdge,Bn=Ut.TreeLayout,si=Ut.TreeNetwork,yi=Ut.TreeVertex,hi=Ut.TreeEdge,Gi=Ut.version},24334:function(Mn,Rn,kt){var gt,Ut;(function(ue,Ee){Mn.exports=Ee(ue)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof kt.g!="undefined"?kt.g:this,function(ue){"use strict";ue=ue||{};var Ee=ue.Base64,he="2.6.4",Dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ee=function(ye){for(var xe={},Ue=0,je=ye.length;Ue<je;Ue++)xe[ye.charAt(Ue)]=Ue;return xe}(Dt),ge=String.fromCharCode,Qt=function(ye){if(ye.length<2){var xe=ye.charCodeAt(0);return xe<128?ye:xe<2048?ge(192|xe>>>6)+ge(128|xe&63):ge(224|xe>>>12&15)+ge(128|xe>>>6&63)+ge(128|xe&63)}else{var xe=65536+(ye.charCodeAt(0)-55296)*1024+(ye.charCodeAt(1)-56320);return ge(240|xe>>>18&7)+ge(128|xe>>>12&63)+ge(128|xe>>>6&63)+ge(128|xe&63)}},jt=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Ae=function(ye){return ye.replace(jt,Qt)},se=function(ye){var xe=[0,2,1][ye.length%3],Ue=ye.charCodeAt(0)<<16|(ye.length>1?ye.charCodeAt(1):0)<<8|(ye.length>2?ye.charCodeAt(2):0),je=[Dt.charAt(Ue>>>18),Dt.charAt(Ue>>>12&63),xe>=2?"=":Dt.charAt(Ue>>>6&63),xe>=1?"=":Dt.charAt(Ue&63)];return je.join("")},Pe=ue.btoa&&typeof ue.btoa=="function"?function(ye){return ue.btoa(ye)}:function(ye){if(ye.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return ye.replace(/[\s\S]{1,3}/g,se)},Bt=function(ye){return Pe(Ae(String(ye)))},nt=function(ye){return ye.replace(/[+\/]/g,function(xe){return xe=="+"?"-":"_"}).replace(/=/g,"")},et=function(ye,xe){return xe?nt(Bt(ye)):Bt(ye)},ht=function(ye){return et(ye,!0)},st;ue.Uint8Array&&(st=function(ye,xe){for(var Ue="",je=0,Je=ye.length;je<Je;je+=3){var fn=ye[je],te=ye[je+1],Jt=ye[je+2],Xe=fn<<16|te<<8|Jt;Ue+=Dt.charAt(Xe>>>18)+Dt.charAt(Xe>>>12&63)+(typeof te!="undefined"?Dt.charAt(Xe>>>6&63):"=")+(typeof Jt!="undefined"?Dt.charAt(Xe&63):"=")}return xe?nt(Ue):Ue});var pt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,vt=function(ye){switch(ye.length){case 4:var xe=(7&ye.charCodeAt(0))<<18|(63&ye.charCodeAt(1))<<12|(63&ye.charCodeAt(2))<<6|63&ye.charCodeAt(3),Ue=xe-65536;return ge((Ue>>>10)+55296)+ge((Ue&1023)+56320);case 3:return ge((15&ye.charCodeAt(0))<<12|(63&ye.charCodeAt(1))<<6|63&ye.charCodeAt(2));default:return ge((31&ye.charCodeAt(0))<<6|63&ye.charCodeAt(1))}},St=function(ye){return ye.replace(pt,vt)},Et=function(ye){var xe=ye.length,Ue=xe%4,je=(xe>0?ee[ye.charAt(0)]<<18:0)|(xe>1?ee[ye.charAt(1)]<<12:0)|(xe>2?ee[ye.charAt(2)]<<6:0)|(xe>3?ee[ye.charAt(3)]:0),Je=[ge(je>>>16),ge(je>>>8&255),ge(je&255)];return Je.length-=[0,0,2,1][Ue],Je.join("")},Tt=ue.atob&&typeof ue.atob=="function"?function(ye){return ue.atob(ye)}:function(ye){return ye.replace(/\S{1,4}/g,Et)},It=function(ye){return Tt(String(ye).replace(/[^A-Za-z0-9\+\/]/g,""))},qt=function(ye){return St(Tt(ye))},Xt=function(ye){return String(ye).replace(/[-_]/g,function(xe){return xe=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},Ht=function(ye){return qt(Xt(ye))},pe;ue.Uint8Array&&(pe=function(ye){return Uint8Array.from(It(Xt(ye)),function(xe){return xe.charCodeAt(0)})});var re=function(){var ye=ue.Base64;return ue.Base64=Ee,ye};if(ue.Base64={VERSION:he,atob:It,btoa:Pe,fromBase64:Ht,toBase64:et,utob:Ae,encode:et,encodeURI:ht,btou:St,decode:Ht,noConflict:re,fromUint8Array:st,toUint8Array:pe},typeof Object.defineProperty=="function"){var Ne=function(ye){return{value:ye,enumerable:!1,writable:!0,configurable:!0}};ue.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",Ne(function(){return Ht(this)})),Object.defineProperty(String.prototype,"toBase64",Ne(function(ye){return et(this,ye)})),Object.defineProperty(String.prototype,"toBase64URI",Ne(function(){return et(this,!0)}))}}return ue.Meteor&&(Base64=ue.Base64),Mn.exports?Mn.exports.Base64=ue.Base64:(gt=[],Ut=function(){return ue.Base64}.apply(Rn,gt),Ut!==void 0&&(Mn.exports=Ut)),{Base64:ue.Base64}})},2859:function(Mn,Rn,kt){"use strict";kt.d(Rn,{hP:function(){return fi}});var gt=function(Rt,Lt){return(gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Pt,Nt){Pt.__proto__=Nt}||function(Pt,Nt){for(var Zt in Nt)Object.prototype.hasOwnProperty.call(Nt,Zt)&&(Pt[Zt]=Nt[Zt])})(Rt,Lt)};function Ut(Rt,Lt){function Pt(){this.constructor=Rt}gt(Rt,Lt),Rt.prototype=Lt===null?Object.create(Lt):(Pt.prototype=Lt.prototype,new Pt)}function ue(Rt,Lt,Pt,Nt){return new(Pt||(Pt=Promise))(function(Zt,Mt){function Yt(Ke){try{Oe(Nt.next(Ke))}catch(we){Mt(we)}}function Ge(Ke){try{Oe(Nt.throw(Ke))}catch(we){Mt(we)}}function Oe(Ke){var we;Ke.done?Zt(Ke.value):(we=Ke.value,we instanceof Pt?we:new Pt(function(Ce){Ce(we)})).then(Yt,Ge)}Oe((Nt=Nt.apply(Rt,Lt||[])).next())})}function Ee(Rt,Lt){var Pt,Nt,Zt,Mt,Yt={label:0,sent:function(){if(1&Zt[0])throw Zt[1];return Zt[1]},trys:[],ops:[]};return Mt={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(Mt[Symbol.iterator]=function(){return this}),Mt;function Ge(Oe){return function(Ke){return function(we){if(Pt)throw new TypeError("Generator is already executing.");for(;Yt;)try{if(Pt=1,Nt&&(Zt=2&we[0]?Nt.return:we[0]?Nt.throw||((Zt=Nt.return)&&Zt.call(Nt),0):Nt.next)&&!(Zt=Zt.call(Nt,we[1])).done)return Zt;switch(Nt=0,Zt&&(we=[2&we[0],Zt.value]),we[0]){case 0:case 1:Zt=we;break;case 4:return Yt.label++,{value:we[1],done:!1};case 5:Yt.label++,Nt=we[1],we=[0];continue;case 7:we=Yt.ops.pop(),Yt.trys.pop();continue;default:if(Zt=Yt.trys,!((Zt=Zt.length>0&&Zt[Zt.length-1])||we[0]!==6&&we[0]!==2)){Yt=0;continue}if(we[0]===3&&(!Zt||we[1]>Zt[0]&&we[1]<Zt[3])){Yt.label=we[1];break}if(we[0]===6&&Yt.label<Zt[1]){Yt.label=Zt[1],Zt=we;break}if(Zt&&Yt.label<Zt[2]){Yt.label=Zt[2],Yt.ops.push(we);break}Zt[2]&&Yt.ops.pop(),Yt.trys.pop();continue}we=Lt.call(Rt,Yt)}catch(Ce){we=[6,Ce],Nt=0}finally{Pt=Zt=0}if(5&we[0])throw we[1];return{value:we[0]?we[1]:void 0,done:!0}}([Oe,Ke])}}}function he(){for(var Rt=0,Lt=0,Pt=arguments.length;Lt<Pt;Lt++)Rt+=arguments[Lt].length;var Nt=Array(Rt),Zt=0;for(Lt=0;Lt<Pt;Lt++)for(var Mt=arguments[Lt],Yt=0,Ge=Mt.length;Yt<Ge;Yt++,Zt++)Nt[Zt]=Mt[Yt];return Nt}var Dt=function(){function Rt(){}return Rt.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Rt.setAttributes=function(Lt,Pt){for(var Nt=0,Zt=Pt;Nt<Zt.length;Nt++){var Mt=Zt[Nt],Yt=Mt[0],Ge=Mt[1];Lt.setAttribute(Yt,Ge)}},Rt.createRect=function(Lt,Pt,Nt){var Zt=document.createElementNS("http://www.w3.org/2000/svg","rect");return Zt.setAttribute("width",Lt.toString()),Zt.setAttribute("height",Pt.toString()),Nt&&Rt.setAttributes(Zt,Nt),Zt},Rt.createLine=function(Lt,Pt,Nt,Zt,Mt){var Yt=document.createElementNS("http://www.w3.org/2000/svg","line");return Yt.setAttribute("x1",Lt.toString()),Yt.setAttribute("y1",Pt.toString()),Yt.setAttribute("x2",Nt.toString()),Yt.setAttribute("y2",Zt.toString()),Mt&&Rt.setAttributes(Yt,Mt),Yt},Rt.createPolygon=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Nt.setAttribute("points",Lt),Pt&&Rt.setAttributes(Nt,Pt),Nt},Rt.createCircle=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","circle");return Nt.setAttribute("cx",(Lt/2).toString()),Nt.setAttribute("cy",(Lt/2).toString()),Nt.setAttribute("r",Lt.toString()),Pt&&Rt.setAttributes(Nt,Pt),Nt},Rt.createEllipse=function(Lt,Pt,Nt){var Zt=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Zt.setAttribute("cx",(Lt/2).toString()),Zt.setAttribute("cy",(Pt/2).toString()),Zt.setAttribute("rx",(Lt/2).toString()),Zt.setAttribute("ry",(Pt/2).toString()),Nt&&Rt.setAttributes(Zt,Nt),Zt},Rt.createGroup=function(Lt){var Pt=document.createElementNS("http://www.w3.org/2000/svg","g");return Lt&&Rt.setAttributes(Pt,Lt),Pt},Rt.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Rt.createMarker=function(Lt,Pt,Nt,Zt,Mt,Yt,Ge){var Oe=document.createElementNS("http://www.w3.org/2000/svg","marker");return Rt.setAttributes(Oe,[["id",Lt],["orient",Pt],["markerWidth",Nt.toString()],["markerHeight",Zt.toString()],["refX",Mt.toString()],["refY",Yt.toString()]]),Oe.appendChild(Ge),Oe},Rt.createText=function(Lt){var Pt=document.createElementNS("http://www.w3.org/2000/svg","text");return Pt.setAttribute("x","0"),Pt.setAttribute("y","0"),Lt&&Rt.setAttributes(Pt,Lt),Pt},Rt.createTSpan=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Nt.textContent=Lt,Pt&&Rt.setAttributes(Nt,Pt),Nt},Rt.createImage=function(Lt){var Pt=document.createElementNS("http://www.w3.org/2000/svg","image");return Lt&&Rt.setAttributes(Pt,Lt),Pt},Rt.createPoint=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Nt.x=Lt,Nt.y=Pt,Nt},Rt.createPath=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","path");return Nt.setAttribute("d",Lt),Pt&&Rt.setAttributes(Nt,Pt),Nt},Rt}(),ee=function(){function Rt(){}return Rt.addKey=function(Lt){Rt.key=Lt},Object.defineProperty(Rt,"isLicensed",{get:function(){return!!Rt.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Rt.key)},enumerable:!1,configurable:!0}),Rt}(),ge=function(){function Rt(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Rt.prototype.rasterize=function(Lt,Pt,Nt){var Zt=this;return new Promise(function(Mt){var Yt=Nt!==void 0?Nt:document.createElement("canvas");Lt===null&&(Zt.markersOnly=!0,Zt.naturalSize=!1);var Ge=document.createElementNS("http://www.w3.org/2000/svg","svg");Ge.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ge.setAttribute("width",Pt.width.baseVal.valueAsString),Ge.setAttribute("height",Pt.height.baseVal.valueAsString),Ge.setAttribute("viewBox","0 0 "+Pt.viewBox.baseVal.width.toString()+" "+Pt.viewBox.baseVal.height.toString()),Ge.innerHTML=Pt.innerHTML,Zt.naturalSize===!0?(Ge.width.baseVal.value=Lt.naturalWidth,Ge.height.baseVal.value=Lt.naturalHeight):Zt.width!==void 0&&Zt.height!==void 0&&(Ge.width.baseVal.value=Zt.width,Ge.height.baseVal.value=Zt.height),Yt.width=Ge.width.baseVal.value,Yt.height=Ge.height.baseVal.value;var Oe=Ge.outerHTML,Ke=Yt.getContext("2d");Zt.markersOnly!==!0&&Ke.drawImage(Lt,0,0,Yt.width,Yt.height);var we=window.URL,Ce=new Image(Yt.width,Yt.height);Ce.setAttribute("crossOrigin","anonymous");var Fe=new Blob([Oe],{type:"image/svg+xml"}),He=we.createObjectURL(Fe);Ce.onload=function(){Ke.drawImage(Ce,0,0),we.revokeObjectURL(He);var Qe=Yt.toDataURL(Zt.imageType,Zt.imageQuality);Mt(Qe)},Ce.src=He})},Rt}(),Qt=function(){},jt=function(){function Rt(Lt){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Lt+"_"}return Object.defineProperty(Rt.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.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(Rt.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Rt.prototype.addClass=function(Lt){return this.styleSheet===void 0&&this.addStyleSheet(),Lt.name=""+this.classNamePrefix+Lt.localName,this.classes.push(Lt),this.styleSheet.sheet.insertRule("."+Lt.name+" {"+Lt.style+"}",this.styleSheet.sheet.cssRules.length),Lt},Rt.prototype.addRule=function(Lt){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(Lt),this.styleSheet.sheet.insertRule(Lt.selector+" {"+Lt.style+"}",this.styleSheet.sheet.cssRules.length)},Rt.prototype.addStyleSheet=function(){var Lt;this.styleSheet=document.createElement("style"),((Lt=this.styleSheetRoot)!==null&&Lt!==void 0?Lt:document.head).appendChild(this.styleSheet),this.addRule(new Ae("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ae("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ae("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new se("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new se("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Rt.prototype.removeStyleSheet=function(){var Lt;this.styleSheet&&(((Lt=this.styleSheetRoot)!==null&&Lt!==void 0?Lt:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Rt}(),Ae=function(Rt,Lt){this.selector=Rt,this.style=Lt},se=function(Rt,Lt){this.localName=Rt,this.style=Lt},Pe=function(){function Rt(Lt,Pt,Nt,Zt,Mt){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=Lt,this.displayMode=Pt,this.markerItems=Nt,this.uiStyleSettings=Zt,this.styles=Mt,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Rt.prototype.show=function(Lt){var Pt=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Lt,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Nt=document.createElement("div");Nt.className=this.toolbarBlockStyleClass.name,Nt.style.whiteSpace="nowrap",this.uiContainer.appendChild(Nt),this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Mt){var Yt=document.createElement("div");Yt.className=""+Pt.toolbarButtonStyleClass.name,Yt.setAttribute("data-type-name",Mt.typeName),Yt.innerHTML=Mt.icon,Yt.addEventListener("click",function(){Pt.markerToolbarButtonClicked(Yt,Mt)}),Pt.buttons.push(Yt),Pt.markerButtons.push(Yt)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var Zt=document.createElement("div");Zt.className=this.toolbarBlockStyleClass.name,Zt.style.whiteSpace="nowrap",Zt.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Zt),this.addActionButton(Zt,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(Zt,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Rt.prototype.addButtonClickListener=function(Lt){this.buttonClickListeners.push(Lt)},Rt.prototype.removeButtonClickListener=function(Lt){this.buttonClickListeners.indexOf(Lt)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(Lt),1)},Rt.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Rt.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var Lt=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var Pt=0;Pt<this.markerButtons.length;Pt++)Pt<Lt||Pt===Lt&&this.markerButtons.length-1===Lt?this.markerButtonBlock.appendChild(this.markerButtons[Pt]):(Pt===Lt&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[Pt]))}},Rt.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")},Rt.prototype.resetButtonStyles=function(){var Lt=this;this.buttons.forEach(function(Pt){Pt.className=Pt.className.replace(Lt.uiStyleSettings.toolbarButtonStyleColorsClassName?Lt.uiStyleSettings.toolbarButtonStyleColorsClassName:Lt.toolbarButtonStyleColorsClass.name,"").trim(),Pt.className=Pt.className.replace(Lt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?Lt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:Lt.toolbarActiveButtonStyleColorsClass.name,"").trim(),Pt.className+=" "+(Lt.uiStyleSettings.toolbarButtonStyleColorsClassName?Lt.uiStyleSettings.toolbarButtonStyleColorsClassName:Lt.toolbarButtonStyleColorsClass.name)})},Rt.prototype.addActionButton=function(Lt,Pt,Nt){var Zt=this,Mt=document.createElement("div");switch(Mt.className=""+this.toolbarButtonStyleClass.name,Mt.innerHTML=Pt,Mt.setAttribute("data-action",Nt),Mt.addEventListener("click",function(){Zt.actionToolbarButtonClicked(Mt,Nt)}),Nt){case"select":Mt.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Mt.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Mt.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Mt.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Mt.style.fill=this.uiStyleSettings.closeButtonColor}Lt.appendChild(Mt),this.buttons.push(Mt)},Rt.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new se("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 se("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new se("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new se("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 se("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var Lt=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new se("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*Lt)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*Lt)+`px;
padding: `+Lt+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new se("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new se("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ae("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ae("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},Rt.prototype.markerToolbarButtonClicked=function(Lt,Pt){this.setActiveButton(Lt),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Nt){return Nt("marker",Pt)}),this.markerButtonOverflowBlock.style.display="none"},Rt.prototype.actionToolbarButtonClicked=function(Lt,Pt){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Nt){return Nt("action",Pt)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Rt.prototype.setActiveButton=function(Lt){this.resetButtonStyles(),Lt.className=Lt.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),Lt.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Rt.prototype.setActiveMarkerButton=function(Lt){var Pt=this.markerButtons.find(function(Nt){return Nt.getAttribute("data-type-name")===Lt});Pt&&this.setActiveButton(Pt)},Rt.prototype.setCurrentMarker=function(Lt){var Pt=this;this.currentMarker=Lt,this.buttons.filter(function(Nt){return/delete|notes/.test(Nt.getAttribute("data-action"))}).forEach(function(Nt){Pt.currentMarker===void 0?(Nt.style.fillOpacity="0.4",Nt.style.pointerEvents="none"):(Nt.style.fillOpacity="1",Nt.style.pointerEvents="all")})},Rt}(),Bt=function(){function Rt(Lt,Pt,Nt,Zt){this.panels=[],this.panelButtons=[],this.markerjsContainer=Lt,this.displayMode=Pt,this.uiStyleSettings=Nt,this.styles=Zt,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Rt.prototype.addStyles=function(){var Lt;this.toolboxStyleClass=this.styles.addClass(new se("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 se("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var Pt=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new se("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new se("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new se("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 se("toolbox-panel-row_colors",`
background-color: `+((Lt=this.uiStyleSettings.toolboxBackgroundColor)!==null&&Lt!==void 0?Lt:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new se("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*Pt)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*Pt)+`px;
padding: `+Pt+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new se("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new se("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ae("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ae("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},Rt.prototype.show=function(Lt){var Pt;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Lt,this.uiContainer.className=this.toolboxStyleClass.name+" "+((Pt=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&Pt!==void 0?Pt:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Rt.prototype.setPanelButtons=function(Lt){var Pt,Nt,Zt=this;this.panels=Lt,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((Pt=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&Pt!==void 0?Pt:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Nt=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Nt!==void 0?Nt:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Mt){var Yt;Mt.uiStyleSettings=Zt.uiStyleSettings;var Ge=document.createElement("div");Ge.className=Zt.toolboxButtonStyleClass.name+" "+((Yt=Zt.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Yt!==void 0?Yt:Zt.toolboxButtonStyleColorsClass.name),Ge.innerHTML=Mt.icon,Ge.title=Mt.title,Ge.addEventListener("click",function(){Zt.panelButtonClick(Mt)}),Zt.panelButtons.push(Ge),Zt.buttonRow.appendChild(Ge)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Rt.prototype.panelButtonClick=function(Lt){var Pt=this,Nt=-1;if(Lt!==this.activePanel){Nt=this.panels.indexOf(Lt),this.panelRow.innerHTML="";var Zt=Lt.getUi();Zt.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Zt),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=Lt}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){Pt.displayMode==="inline"?Pt.panelRow.style.display="none":Pt.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Mt,Yt){var Ge,Oe;Mt.className=Pt.toolboxButtonStyleClass.name+" "+(Yt===Nt?""+((Ge=Pt.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ge!==void 0?Ge:Pt.toolboxActiveButtonStyleColorsClass.name):""+((Oe=Pt.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Oe!==void 0?Oe:Pt.toolboxButtonStyleColorsClass.name))})},Rt}(),nt=function(Rt,Lt){this.title=Rt,this.icon=Lt},et=function(Rt){function Lt(Pt,Nt,Zt,Mt){var Yt=Rt.call(this,Pt,Mt||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Yt.colors=[],Yt.addTransparent=!1,Yt.colorBoxes=[],Yt.colors=Nt,Yt.currentColor=Zt,Yt.setCurrentColor=Yt.setCurrentColor.bind(Yt),Yt.getColorBox=Yt.getColorBox.bind(Yt),Yt}return Ut(Lt,Rt),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.overflow="hidden",Nt.style.whiteSpace="nowrap",this.colors.forEach(function(Zt){var Mt=Pt.getColorBox(Zt);Nt.appendChild(Mt),Pt.colorBoxes.push(Mt)}),Nt},Lt.prototype.getColorBox=function(Pt){var Nt=this,Zt=this.uiStyleSettings.toolbarHeight/4,Mt=this.uiStyleSettings.toolbarHeight-Zt,Yt=document.createElement("div");Yt.style.display="inline-block",Yt.style.boxSizing="content-box",Yt.style.width=Mt-2+"px",Yt.style.height=Mt-2+"px",Yt.style.padding="1px",Yt.style.marginRight="2px",Yt.style.marginBottom="2px",Yt.style.borderWidth="2px",Yt.style.borderStyle="solid",Yt.style.borderRadius=(Mt+2)/2+"px",Yt.style.borderColor=Pt===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Yt.addEventListener("click",function(){Nt.setCurrentColor(Pt,Yt)});var Ge=document.createElement("div");return Ge.style.display="inline-block",Ge.style.width=Mt-2+"px",Ge.style.height=Mt-2+"px",Ge.style.backgroundColor=Pt,Ge.style.borderRadius=Mt/2+"px",Pt==="transparent"&&(Ge.style.fill=this.uiStyleSettings.toolboxAccentColor,Ge.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>`),Yt.appendChild(Ge),Yt},Lt.prototype.setCurrentColor=function(Pt,Nt){var Zt=this;this.currentColor=Pt,this.colorBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?Zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(Pt)},Lt}(nt),ht=function(){function Rt(Lt,Pt,Nt){this._state="new",this._isSelected=!1,this._container=Lt,this._overlayContainer=Pt,this.globalSettings=Nt,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Rt.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Rt.prototype.ownsTarget=function(Lt){return!1},Object.defineProperty(Rt.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Rt.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Rt.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Rt.prototype.pointerDown=function(Lt,Pt){},Rt.prototype.dblClick=function(Lt,Pt){},Rt.prototype.manipulate=function(Lt){},Rt.prototype.pointerUp=function(Lt){this.stateChanged()},Rt.prototype.dispose=function(){},Rt.prototype.addMarkerVisualToContainer=function(Lt){this.container.childNodes.length>0?this.container.insertBefore(Lt,this.container.childNodes[0]):this.container.appendChild(Lt)},Rt.prototype.getState=function(){return{typeName:Rt.typeName,state:this.state,notes:this.notes}},Rt.prototype.restoreState=function(Lt){this._state=Lt.state,this.notes=Lt.notes},Rt.prototype.scale=function(Lt,Pt){},Rt.prototype.colorChanged=function(Lt){this.onColorChanged&&this.onColorChanged(Lt),this.stateChanged()},Rt.prototype.fillColorChanged=function(Lt){this.onFillColorChanged&&this.onFillColorChanged(Lt),this.stateChanged()},Rt.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var Lt=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),Lt.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(Lt)&&this.onStateChanged(this)}},Rt.typeName="MarkerBase",Rt}(),st=function(){function Rt(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Rt.prototype.findGripByVisual=function(Lt){return this.topLeft.ownsTarget(Lt)?this.topLeft:this.topCenter.ownsTarget(Lt)?this.topCenter:this.topRight.ownsTarget(Lt)?this.topRight:this.centerLeft.ownsTarget(Lt)?this.centerLeft:this.centerRight.ownsTarget(Lt)?this.centerRight:this.bottomLeft.ownsTarget(Lt)?this.bottomLeft:this.bottomCenter.ownsTarget(Lt)?this.bottomCenter:this.bottomRight.ownsTarget(Lt)?this.bottomRight:void 0},Rt}(),pt=function(){function Rt(){this.GRIP_SIZE=10,this.visual=Dt.createGroup(),this.visual.appendChild(Dt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Dt.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Rt.prototype.ownsTarget=function(Lt){return Lt===this.visual||Lt===this.visual.childNodes[0]||Lt===this.visual.childNodes[1]},Rt}(),vt=function(){function Rt(){}return Rt.toITransformMatrix=function(Lt){return{a:Lt.a,b:Lt.b,c:Lt.c,d:Lt.d,e:Lt.e,f:Lt.f}},Rt.toSVGMatrix=function(Lt,Pt){return Lt.a=Pt.a,Lt.b=Pt.b,Lt.c=Pt.c,Lt.d=Pt.d,Lt.e=Pt.e,Lt.f=Pt.f,Lt},Rt}(),St=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.left=0,Mt.top=0,Mt.width=0,Mt.height=0,Mt.defaultSize={x:50,y:20},Mt.offsetX=0,Mt.offsetY=0,Mt.rotationAngle=0,Mt.CB_DISTANCE=10,Mt._suppressMarkerCreateEvent=!1,Mt.container.transform.baseVal.appendItem(Dt.createTransform()),Mt.setupControlBox(),Mt}return Ut(Lt,Rt),Object.defineProperty(Lt.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(Lt.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(Lt.prototype,"visual",{get:function(){return this._visual},set:function(Pt){this._visual=Pt;var Nt=Dt.createTransform();this._visual.transform.baseVal.appendItem(Nt)},enumerable:!1,configurable:!0}),Lt.prototype.ownsTarget=function(Pt){return!!Rt.prototype.ownsTarget.call(this,Pt)||!!(this.controlGrips.findGripByVisual(Pt)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Pt))},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.left=Pt.x,this.top=Pt.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Zt=this.unrotatePoint(Pt);if(this.manipulationStartX=Zt.x,this.manipulationStartY=Zt.y,this.offsetX=Zt.x-this.left,this.offsetY=Zt.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Nt),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Nt)){this.activeGrip=this.rotatorGrip;var Mt=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Mt.x-this.width/2,this.top=Mt.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Yt=this.container.transform.baseVal.getItem(0);Yt.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Yt,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},Lt.prototype.pointerUp=function(Pt){var Nt=this.state;Rt.prototype.pointerUp.call(this,Pt),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(Pt),this._state="select",Nt==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},Lt.prototype.moveVisual=function(Pt){this.visual.style.transform="translate("+Pt.x+"px, "+Pt.y+"px)"},Lt.prototype.manipulate=function(Pt){var Nt=this.unrotatePoint(Pt);this.state==="creating"?this.resize(Pt):this.state==="move"?(this.left=this.manipulationStartLeft+(Nt.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Nt.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Nt):this.state==="rotate"&&this.rotate(Pt)},Lt.prototype.resize=function(Pt){var Nt=this.manipulationStartLeft,Zt=this.manipulationStartWidth,Mt=this.manipulationStartTop,Yt=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Nt=this.manipulationStartLeft+Pt.x-this.manipulationStartX,Zt=this.manipulationStartWidth+this.manipulationStartLeft-Nt;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Zt=this.manipulationStartWidth+Pt.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Mt=this.manipulationStartTop+Pt.y-this.manipulationStartY,Yt=this.manipulationStartHeight+this.manipulationStartTop-Mt;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Yt=this.manipulationStartHeight+Pt.y-this.manipulationStartY}Zt>=0?(this.left=Nt,this.width=Zt):(this.left=Nt+Zt,this.width=-Zt),Yt>=0?(this.top=Mt,this.height=Yt):(this.top=Mt+Yt,this.height=-Yt),this.setSize()},Lt.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},Lt.prototype.rotate=function(Pt){if(Math.abs(Pt.x-this.centerX)>.1){var Nt=Math.sign(Pt.x-this.centerX);this.rotationAngle=180*Math.atan((Pt.y-this.centerY)/(Pt.x-this.centerX))/Math.PI+90*Nt,this.applyRotation()}},Lt.prototype.applyRotation=function(){var Pt=this.container.transform.baseVal.getItem(0);Pt.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Pt,0)},Lt.prototype.rotatePoint=function(Pt){if(this.rotationAngle===0)return Pt;var Nt=this.container.getCTM(),Zt=Dt.createPoint(Pt.x,Pt.y);return{x:(Zt=Zt.matrixTransform(Nt)).x,y:Zt.y}},Lt.prototype.unrotatePoint=function(Pt){if(this.rotationAngle===0)return Pt;var Nt=this.container.getCTM();Nt=Nt.inverse();var Zt=Dt.createPoint(Pt.x,Pt.y);return{x:(Zt=Zt.matrixTransform(Nt)).x,y:Zt.y}},Lt.prototype.select=function(){Rt.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Lt.prototype.deselect=function(){Rt.prototype.deselect.call(this),this.controlBox.style.display="none"},Lt.prototype.setupControlBox=function(){this.controlBox=Dt.createGroup();var Pt=Dt.createTransform();Pt.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(Pt),this.container.appendChild(this.controlBox),this.controlRect=Dt.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=Dt.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new st,this.addControlGrips(),this.controlBox.style.display="none"},Lt.prototype.adjustControlBox=function(){var Pt=this.controlBox.transform.baseVal.getItem(0);Pt.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(Pt,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},Lt.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},Lt.prototype.createGrip=function(){var Pt=new pt;return Pt.visual.transform.baseVal.appendItem(Dt.createTransform()),this.controlBox.appendChild(Pt.visual),Pt},Lt.prototype.positionGrips=function(){var Pt=this.controlGrips.topLeft.GRIP_SIZE,Nt=-Pt/2,Zt=Nt,Mt=(this.width+this.CB_DISTANCE)/2-Pt/2,Yt=(this.height+this.CB_DISTANCE)/2-Pt/2,Ge=this.height+this.CB_DISTANCE-Pt/2,Oe=this.width+this.CB_DISTANCE-Pt/2;this.positionGrip(this.controlGrips.topLeft.visual,Nt,Zt),this.positionGrip(this.controlGrips.topCenter.visual,Mt,Zt),this.positionGrip(this.controlGrips.topRight.visual,Oe,Zt),this.positionGrip(this.controlGrips.centerLeft.visual,Nt,Yt),this.positionGrip(this.controlGrips.centerRight.visual,Oe,Yt),this.positionGrip(this.controlGrips.bottomLeft.visual,Nt,Ge),this.positionGrip(this.controlGrips.bottomCenter.visual,Mt,Ge),this.positionGrip(this.controlGrips.bottomRight.visual,Oe,Ge),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Mt,Zt-3*this.CB_DISTANCE)},Lt.prototype.positionGrip=function(Pt,Nt,Zt){var Mt=Pt.transform.baseVal.getItem(0);Mt.setTranslate(Nt,Zt),Pt.transform.baseVal.replaceItem(Mt,0)},Lt.prototype.hideControlBox=function(){this.controlBox.style.display="none"},Lt.prototype.showControlBox=function(){this.controlBox.style.display=""},Lt.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:vt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:vt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Rt.prototype.getState.call(this))},Lt.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt);var Nt=Pt;this.left=Nt.left,this.top=Nt.top,this.width=Nt.width,this.height=Nt.height,this.rotationAngle=Nt.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Nt.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Nt.containerTransformMatrix))},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt);var Zt=this.rotatePoint({x:this.left,y:this.top}),Mt=this.unrotatePoint({x:Zt.x*Pt,y:Zt.y*Nt});this.left=Mt.x,this.top=Mt.y,this.width=this.width*Pt,this.height=this.height*Nt,this.adjustControlBox()},Lt}(ht),Et=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.fillColor="transparent",Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.opacity=1,Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setFillColor=Mt.setFillColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.createVisual=Mt.createVisual.bind(Mt),Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual)},Lt.prototype.createVisual=function(){this.visual=Dt.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Lt.prototype.manipulate=function(Pt){Rt.prototype.manipulate.call(this,Pt)},Lt.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.setSize()},Lt.prototype.setSize=function(){Rt.prototype.setSize.call(this),Dt.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},Lt.prototype.pointerUp=function(Pt){Rt.prototype.pointerUp.call(this,Pt),this.setSize()},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Pt),this.stateChanged()},Lt.prototype.setFillColor=function(Pt){this.fillColor=Pt,this.visual&&Dt.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Lt.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Rt.prototype.getState.call(this))},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.fillColor=Nt.fillColor,this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.opacity=Nt.opacity,this.createVisual(),Rt.prototype.restoreState.call(this,Pt),this.setSize()},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setSize()},Lt.title="Rectangle marker",Lt}(St),Tt=function(Rt){function Lt(Pt,Nt,Zt,Mt){var Yt=Rt.call(this,Pt,Mt||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Yt.widths=[],Yt.widthBoxes=[],Yt.widths=Nt,Yt.currentWidth=Zt,Yt.setCurrentWidth=Yt.setCurrentWidth.bind(Yt),Yt}return Ut(Lt,Rt),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.display="flex",Nt.style.overflow="hidden",Nt.style.flexGrow="2",this.widths.forEach(function(Zt){var Mt=document.createElement("div");Mt.style.display="flex",Mt.style.flexGrow="2",Mt.style.alignItems="center",Mt.style.justifyContent="space-between",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.borderColor=Zt===Pt.currentWidth?Pt.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){Pt.setCurrentWidth(Zt,Mt)}),Nt.appendChild(Mt);var Yt=document.createElement("div");Yt.innerText=Zt.toString(),Yt.style.marginRight="5px",Mt.appendChild(Yt);var Ge=document.createElement("div");Ge.style.minHeight="20px",Ge.style.flexGrow="2",Ge.style.display="flex",Ge.style.alignItems="center";var Oe=document.createElement("hr");Oe.style.minWidth="20px",Oe.style.border="0px",Oe.style.borderTop=Zt+"px solid "+Pt.uiStyleSettings.toolboxColor,Oe.style.flexGrow="2",Ge.appendChild(Oe),Mt.appendChild(Ge),Pt.widthBoxes.push(Mt)}),Nt},Lt.prototype.setCurrentWidth=function(Pt,Nt){var Zt=this;this.currentWidth=Pt,this.widthBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?Zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},Lt}(nt),It=function(Rt){function Lt(Pt,Nt,Zt,Mt){var Yt=Rt.call(this,Pt,Mt||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Yt.styles=[],Yt.styleBoxes=[],Yt.styles=Nt,Yt.currentStyle=Zt,Yt.setCurrentStyle=Yt.setCurrentStyle.bind(Yt),Yt}return Ut(Lt,Rt),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.display="flex",Nt.style.overflow="hidden",Nt.style.flexGrow="2",this.styles.forEach(function(Zt){var Mt=document.createElement("div");Mt.style.display="flex",Mt.style.alignItems="center",Mt.style.justifyContent="space-between",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.overflow="hidden",Mt.style.maxWidth=100/Pt.styles.length-5+"%",Mt.style.borderColor=Zt===Pt.currentStyle?Pt.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){Pt.setCurrentStyle(Zt,Mt)}),Nt.appendChild(Mt);var Yt=document.createElement("div");Yt.style.minHeight="20px",Yt.style.flexGrow="2",Yt.style.overflow="hidden";var Ge=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+Pt.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(Zt!==""?'stroke-dasharray="'+Zt+'"':"")+` />
</svg>`;Yt.innerHTML=Ge,Mt.appendChild(Yt),Pt.styleBoxes.push(Mt)}),Nt},Lt.prototype.setCurrentStyle=function(Pt,Nt){var Zt=this;this.currentStyle=Pt,this.styleBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?Zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},Lt}(nt),qt=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.strokeColor=Zt.defaultColor,Mt.strokeWidth=Zt.defaultStrokeWidth,Mt.strokeDasharray=Zt.defaultStrokeDasharray,Mt.strokePanel=new et("Line color",Zt.defaultColorSet,Zt.defaultColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.strokeWidthPanel=new Tt("Line width",Zt.defaultStrokeWidths,Zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new It("Line style",Zt.defaultStrokeDasharrays,Zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt}return Ut(Lt,Rt),Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.typeName="FrameMarker",Lt.title="Frame marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',Lt}(Et),Xt=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"},Ht=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.x1=0,Mt.y1=0,Mt.x2=0,Mt.y2=0,Mt.defaultLength=50,Mt.manipulationStartX=0,Mt.manipulationStartY=0,Mt.manipulationStartX1=0,Mt.manipulationStartY1=0,Mt.manipulationStartX2=0,Mt.manipulationStartY2=0,Mt.setupControlBox(),Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!!Rt.prototype.ownsTarget.call(this,Pt)||!(!this.grip1.ownsTarget(Pt)&&!this.grip2.ownsTarget(Pt))},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.manipulationStartX=Pt.x,this.manipulationStartY=Pt.y,this.state==="new"&&(this.x1=Pt.x,this.y1=Pt.y,this.x2=Pt.x,this.y2=Pt.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(Nt)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Nt)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},Lt.prototype.pointerUp=function(Pt){var Nt=this.state;Rt.prototype.pointerUp.call(this,Pt),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(Pt),this._state="select",Nt==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},Lt.prototype.adjustVisual=function(){},Lt.prototype.manipulate=function(Pt){this.state==="creating"?this.resize(Pt):this.state==="move"?(this.x1=this.manipulationStartX1+Pt.x-this.manipulationStartX,this.y1=this.manipulationStartY1+Pt.y-this.manipulationStartY,this.x2=this.manipulationStartX2+Pt.x-this.manipulationStartX,this.y2=this.manipulationStartY2+Pt.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(Pt)},Lt.prototype.resize=function(Pt){switch(this.activeGrip){case this.grip1:this.x1=Pt.x,this.y1=Pt.y;break;case this.grip2:case void 0:this.x2=Pt.x,this.y2=Pt.y}this.adjustVisual(),this.adjustControlBox()},Lt.prototype.select=function(){Rt.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Lt.prototype.deselect=function(){Rt.prototype.deselect.call(this),this.controlBox.style.display="none"},Lt.prototype.setupControlBox=function(){this.controlBox=Dt.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},Lt.prototype.adjustControlBox=function(){this.positionGrips()},Lt.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},Lt.prototype.createGrip=function(){var Pt=new pt;return Pt.visual.transform.baseVal.appendItem(Dt.createTransform()),this.controlBox.appendChild(Pt.visual),Pt},Lt.prototype.positionGrips=function(){var Pt=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-Pt/2,this.y1-Pt/2),this.positionGrip(this.grip2.visual,this.x2-Pt/2,this.y2-Pt/2)},Lt.prototype.positionGrip=function(Pt,Nt,Zt){var Mt=Pt.transform.baseVal.getItem(0);Mt.setTranslate(Nt,Zt),Pt.transform.baseVal.replaceItem(Mt,0)},Lt.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Rt.prototype.getState.call(this))},Lt.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt);var Nt=Pt;this.x1=Nt.x1,this.y1=Nt.y1,this.x2=Nt.x2,this.y2=Nt.y2},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.x1=this.x1*Pt,this.y1=this.y1*Nt,this.x2=this.x2*Pt,this.y2=this.y2*Nt,this.adjustVisual(),this.adjustControlBox()},Lt}(ht),pe=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.strokeColor=Zt.defaultColor,Mt.strokeWidth=Zt.defaultStrokeWidth,Mt.strokeDasharray=Zt.defaultStrokeDasharray,Mt.strokePanel=new et("Line color",Zt.defaultColorSet,Zt.defaultColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.strokeWidthPanel=new Tt("Line width",Zt.defaultStrokeWidths,Zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new It("Line style",Zt.defaultStrokeDasharrays,Zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.selectorLine&&Pt!==this.visibleLine)},Lt.prototype.createVisual=function(){this.visual=Dt.createGroup(),this.selectorLine=Dt.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Dt.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},Lt.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),Dt.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Dt.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Dt.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.adjustVisual(),this.colorChanged(Pt)},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.adjustVisual()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt);var Nt=Pt;this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.createVisual(),this.adjustVisual()},Lt.typeName="LineMarker",Lt.title="Line marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',Lt}(Ht),re=function(Rt){function Lt(Pt,Nt,Zt,Mt){var Yt=Rt.call(this,Pt,Mt||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Yt.fonts=[],Yt.fontBoxes=[],Yt.fonts=Nt,Yt.currentFont=Zt,Yt.setCurrentFont=Yt.setCurrentFont.bind(Yt),Yt}return Ut(Lt,Rt),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.overflow="hidden",Nt.style.flexGrow="2",this.fonts.forEach(function(Zt){var Mt=document.createElement("div");Mt.style.display="inline-block",Mt.style.alignItems="center",Mt.style.justifyContent="space-between",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.overflow="hidden",Mt.style.maxWidth=100/Pt.fonts.length-5+"%",Mt.style.borderColor=Zt===Pt.currentFont?Pt.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){Pt.setCurrentFont(Zt,Mt)}),Nt.appendChild(Mt);var Yt=document.createElement("div");Yt.style.display="flex",Yt.style.minHeight="20px",Yt.style.flexGrow="2",Yt.style.fontFamily=Zt,Yt.style.overflow="hidden";var Ge=document.createElement("div");Ge.style.whiteSpace="nowrap",Ge.style.overflow="hidden",Ge.style.textOverflow="ellipsis",Ge.innerHTML="The quick brown fox jumps over the lazy dog",Yt.appendChild(Ge),Mt.appendChild(Yt),Pt.fontBoxes.push(Mt)}),Nt},Lt.prototype.setCurrentFont=function(Pt,Nt){var Zt=this;this.currentFont=Pt,this.fontBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?Zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},Lt}(nt),Ne=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.color="transparent",Mt.padding=5,Mt.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",Mt.text=Mt.DEFAULT_TEXT,Mt.isMoved=!1,Mt.color=Zt.defaultColor,Mt.fontFamily=Zt.defaultFontFamily,Mt.defaultSize={x:100,y:30},Mt.setColor=Mt.setColor.bind(Mt),Mt.setFont=Mt.setFont.bind(Mt),Mt.renderText=Mt.renderText.bind(Mt),Mt.sizeText=Mt.sizeText.bind(Mt),Mt.textEditDivClicked=Mt.textEditDivClicked.bind(Mt),Mt.showTextEditor=Mt.showTextEditor.bind(Mt),Mt.setSize=Mt.setSize.bind(Mt),Mt.positionTextEditor=Mt.positionTextEditor.bind(Mt),Mt.colorPanel=new et("Color",Zt.defaultColorSet,Zt.defaultColor),Mt.colorPanel.onColorChanged=Mt.setColor,Mt.fontFamilyPanel=new re("Font",Zt.defaultFontFamilies,Zt.defaultFontFamily),Mt.fontFamilyPanel.onFontChanged=Mt.setFont,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){if(Rt.prototype.ownsTarget.call(this,Pt)||Pt===this.visual||Pt===this.textElement||Pt===this.bgRectangle)return!0;var Nt=!1;return this.textElement.childNodes.forEach(function(Zt){Zt===Pt&&(Nt=!0)}),Nt},Lt.prototype.createVisual=function(){this.visual=Dt.createGroup(),this.bgRectangle=Dt.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Dt.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Dt.createTransform()),this.textElement.transform.baseVal.appendItem(Dt.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.isMoved=!1,this.pointerDownPoint=Pt,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Lt.prototype.renderText=function(){var Pt=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(Nt){Pt.textElement.appendChild(Dt.createTSpan(Nt.trim()===""?" ":Nt.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},Lt.prototype.getTextScale=function(){var Pt=this.textElement.getBBox(),Nt=1;if(Pt.width>0&&Pt.height>0){var Zt=(1*this.width-this.width*this.padding*2/100)/Pt.width,Mt=(1*this.height-this.height*this.padding*2/100)/Pt.height;Nt=Math.min(Zt,Mt)}return Nt},Lt.prototype.getTextPosition=function(Pt){var Nt=this.textElement.getBBox(),Zt=0,Mt=0;return Nt.width>0&&Nt.height>0&&(Zt=(this.width-Nt.width*Pt)/2,Mt=this.height/2-Nt.height*Pt/2),{x:Zt,y:Mt}},Lt.prototype.sizeText=function(){var Pt=this.textElement.getBBox(),Nt=this.getTextScale(),Zt=this.getTextPosition(Nt);Zt.y-=Pt.y*Nt,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Zt.x+"px, "+Zt.y+"px) scale("+Nt+", "+Nt+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Zt.x,Zt.y),this.textElement.transform.baseVal.getItem(1).setScale(Nt,Nt))},Lt.prototype.manipulate=function(Pt){Rt.prototype.manipulate.call(this,Pt),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Pt.x-this.pointerDownPoint.x)>5||Math.abs(Pt.y-this.pointerDownPoint.y)>5)},Lt.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.isMoved=!0,this.setSize(),this.sizeText()},Lt.prototype.setSize=function(){Rt.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Dt.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Dt.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},Lt.prototype.pointerUp=function(Pt){var Nt=this.state;Nt==="creating"&&(this._suppressMarkerCreateEvent=!0),Rt.prototype.pointerUp.call(this,Pt),this.setSize(),(Nt==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},Lt.prototype.showTextEditor=function(){var Pt=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(Nt){Nt.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Nt=Number.parseFloat(Pt.textEditor.style.fontSize);Pt.textEditor.clientWidth>=Number.parseInt(Pt.textEditor.style.maxWidth)&&Nt>.9;)Nt-=.1,Pt.textEditor.style.fontSize=Math.max(Nt,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Nt){Nt.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Nt){if(Nt.clipboardData){var Zt=Nt.clipboardData.getData("text"),Mt=window.getSelection();if(!Mt.rangeCount)return!1;Mt.deleteFromDocument(),Mt.getRangeAt(0).insertNode(document.createTextNode(Zt)),Nt.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){Pt.textEditDivClicked(Pt.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},Lt.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var Pt=this.getTextScale(),Nt=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Zt=this.textElement.getBBox(),Mt={x:Zt.width*Pt,y:Zt.height*Pt};Nt.x-=Mt.x/2,Nt.y-=Mt.y/2,this.textEditor.style.top=Nt.y+"px",this.textEditor.style.left=Nt.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Nt.x+"px",this.textEditor.style.fontSize=Math.max(16*Pt,12)+"px",this.textElement.style.display="none"}},Lt.prototype.textEditDivClicked=function(Pt){this.text=Pt.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},Lt.prototype.select=function(){Rt.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},Lt.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Rt.prototype.deselect.call(this)},Lt.prototype.dblClick=function(Pt,Nt){Rt.prototype.dblClick.call(this,Pt,Nt),this.showTextEditor()},Lt.prototype.setColor=function(Pt){this.textElement&&Dt.setAttributes(this.textElement,[["fill",Pt]]),this.color=Pt,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(Pt)},Lt.prototype.setFont=function(Pt){this.textElement&&Dt.setAttributes(this.textElement,[["font-family",Pt]]),this.fontFamily=Pt,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},Lt.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},Lt.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.color=Nt.color,this.fontFamily=Nt.fontFamily,this.padding=Nt.padding,this.text=Nt.text,this.createVisual(),Rt.prototype.restoreState.call(this,Pt),this.setSize()},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setSize(),this.sizeText(),this.positionTextEditor()},Lt.typeName="TextMarker",Lt.title="Text marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',Lt}(St),ye=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.color="transparent",Mt.lineWidth=3,Mt.drawing=!1,Mt.pixelRatio=1,Mt.color=Zt.defaultColor,Mt.lineWidth=Zt.defaultStrokeWidth,Mt.pixelRatio=Zt.freehandPixelRatio,Mt.setColor=Mt.setColor.bind(Mt),Mt.addCanvas=Mt.addCanvas.bind(Mt),Mt.finishCreation=Mt.finishCreation.bind(Mt),Mt.setLineWidth=Mt.setLineWidth.bind(Mt),Mt.colorPanel=new et("Color",Zt.defaultColorSet,Zt.defaultColor),Mt.colorPanel.onColorChanged=Mt.setColor,Mt.lineWidthPanel=new Tt("Line width",Zt.defaultStrokeWidths,Zt.defaultStrokeWidth),Mt.lineWidthPanel.onWidthChanged=Mt.setLineWidth,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.drawingImage)},Lt.prototype.createVisual=function(){this.visual=Dt.createGroup(),this.drawingImage=Dt.createImage(),this.visual.appendChild(this.drawingImage);var Pt=Dt.createTransform();this.visual.transform.baseVal.appendItem(Pt),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Pt,Nt){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(Pt.x,Pt.y),this.drawing=!0):Rt.prototype.pointerDown.call(this,Pt,Nt)},Lt.prototype.manipulate=function(Pt){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(Pt.x,Pt.y),this.canvasContext.stroke()):Rt.prototype.manipulate.call(this,Pt)},Lt.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),Dt.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Dt.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},Lt.prototype.pointerUp=function(Pt){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Rt.prototype.pointerUp.call(this,Pt)},Lt.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},Lt.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Rt.prototype.select.call(this)},Lt.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Rt.prototype.deselect.call(this)},Lt.prototype.finishCreation=function(){for(var Pt=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Nt=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Zt=Nt[0],Mt=Nt[1],Yt=Nt[2],Ge=Nt[3],Oe=!1,Ke=0;Ke<this.canvasElement.height;Ke++)for(var we=0;we<this.canvasElement.width;we++)Pt.data[Ke*this.canvasElement.width*4+4*we+3]>0&&(Oe=!0,Ke<Mt&&(Mt=Ke),we<Zt&&(Zt=we),Ke>Ge&&(Ge=Ke),we>Yt&&(Yt=we));if(Oe){this.left=Zt/this.pixelRatio,this.top=Mt/this.pixelRatio,this.width=(Yt-Zt)/this.pixelRatio,this.height=(Ge-Mt)/this.pixelRatio;var Ce=document.createElement("canvas");Ce.width=Yt-Zt,Ce.height=Ge-Mt,Ce.getContext("2d").putImageData(this.canvasContext.getImageData(Zt,Mt,Yt-Zt,Ge-Mt),0,0),this.drawingImgUrl=Ce.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},Lt.prototype.setDrawingImage=function(){Dt.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Dt.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},Lt.prototype.setColor=function(Pt){this.color=Pt,this.colorChanged(Pt)},Lt.prototype.setLineWidth=function(Pt){this.lineWidth=Pt},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({drawingImgUrl:this.drawingImgUrl},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){this.createVisual(),Rt.prototype.restoreState.call(this,Pt),this.drawingImgUrl=Pt.drawingImgUrl,this.setDrawingImage()},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setDrawingImage()},Lt.typeName="FreehandMarker",Lt.title="Freehand marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',Lt}(St),xe=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Zt||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Mt.typeBoxes=[],Mt.currentType=Nt,Mt.setCurrentType=Mt.setCurrentType.bind(Mt),Mt}return Ut(Lt,Rt),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");Nt.style.display="flex",Nt.style.overflow="hidden",Nt.style.flexGrow="2";for(var Zt=function(Ge){var Oe="both";switch(Ge){case 0:Oe="both";break;case 1:Oe="start";break;case 2:Oe="end";break;case 3:Oe="none"}var Ke=document.createElement("div");if(Ke.style.display="flex",Ke.style.flexGrow="2",Ke.style.alignItems="center",Ke.style.justifyContent="space-between",Ke.style.padding="5px",Ke.style.borderWidth="2px",Ke.style.borderStyle="solid",Ke.style.borderColor=Oe===Mt.currentType?Mt.uiStyleSettings.toolboxAccentColor:"transparent",Ke.addEventListener("click",function(){Pt.setCurrentType(Oe,Ke)}),Nt.appendChild(Ke),Oe==="both"||Oe==="start"){var we=document.createElement("div");we.style.display="flex",we.style.alignItems="center",we.style.minHeight="20px",we.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(Mt.uiStyleSettings!==void 0?Mt.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,we.style.marginLeft="5px",Ke.appendChild(we)}var Ce=document.createElement("div");Ce.style.display="flex",Ce.style.alignItems="center",Ce.style.minHeight="20px",Ce.style.flexGrow="2";var Fe=document.createElement("hr");if(Fe.style.minWidth="20px",Fe.style.border="0px",Fe.style.borderTop="3px solid "+(Mt.uiStyleSettings!==void 0?Mt.uiStyleSettings.toolboxColor:"#eeeeee"),Fe.style.flexGrow="2",Ce.appendChild(Fe),Ke.appendChild(Ce),Oe==="both"||Oe==="end"){var He=document.createElement("div");He.style.display="flex",He.style.alignItems="center",He.style.minHeight="20px",He.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(Mt.uiStyleSettings!==void 0?Mt.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,He.style.marginRight="5px",Ke.appendChild(He)}Mt.typeBoxes.push(Ke)},Mt=this,Yt=0;Yt<4;Yt++)Zt(Yt);return Nt},Lt.prototype.setCurrentType=function(Pt,Nt){var Zt=this;this.currentType=Pt,this.typeBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?Zt.uiStyleSettings!==void 0?Zt.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},Lt}(nt),Ue=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.arrowType="end",Mt.arrowBaseHeight=10,Mt.arrowBaseWidth=10,Mt.getArrowPoints=Mt.getArrowPoints.bind(Mt),Mt.setArrowType=Mt.setArrowType.bind(Mt),Mt.arrowTypePanel=new xe("Arrow type","end"),Mt.arrowTypePanel.onArrowTypeChanged=Mt.setArrowType,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.arrow1&&Pt!==this.arrow2)},Lt.prototype.getArrowPoints=function(Pt,Nt){var Zt=this.arrowBaseWidth+2*this.strokeWidth,Mt=this.arrowBaseHeight+2*this.strokeWidth;return Pt-Zt/2+","+(Nt+Mt/2)+" "+Pt+","+(Nt-Mt/2)+" "+(Pt+Zt/2)+","+(Nt+Mt/2)},Lt.prototype.createTips=function(){this.arrow1=Dt.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Dt.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Dt.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Dt.createTransform()),this.visual.appendChild(this.arrow2)},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="creating"&&this.createTips()},Lt.prototype.adjustVisual=function(){if(Rt.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",Dt.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Dt.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var Pt=0;Math.abs(this.x1-this.x2)>.1&&(Pt=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var Nt=this.arrow1.transform.baseVal.getItem(0);Nt.setRotate(Pt,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Nt,0);var Zt=this.arrow2.transform.baseVal.getItem(0);Zt.setRotate(Pt+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Zt,0)}},Lt.prototype.setArrowType=function(Pt){this.arrowType=Pt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({arrowType:this.arrowType},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt);var Nt=Pt;this.arrowType=Nt.arrowType,this.createTips(),this.adjustVisual()},Lt.typeName="ArrowMarker",Lt.title="Arrow marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',Lt}(pe),je=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.fillColor=Zt.defaultFillColor,Mt.strokeWidth=0,Mt.fillPanel=new et("Color",Zt.defaultColorSet,Zt.defaultFillColor),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt}return Ut(Lt,Rt),Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.typeName="CoverMarker",Lt.title="Cover marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',Lt}(Et),Je=function(Rt){function Lt(Pt,Nt,Zt,Mt){var Yt=Rt.call(this,Pt,Mt||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Yt.opacities=[],Yt.opacityBoxes=[],Yt.opacities=Nt,Yt.currentOpacity=Zt,Yt.setCurrentOpacity=Yt.setCurrentOpacity.bind(Yt),Yt}return Ut(Lt,Rt),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.display="flex",Nt.style.overflow="hidden",Nt.style.flexGrow="2",Nt.style.justifyContent="space-between",this.opacities.forEach(function(Zt){var Mt=document.createElement("div");Mt.style.display="flex",Mt.style.alignItems="center",Mt.style.justifyContent="center",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.borderColor=Zt===Pt.currentOpacity?Pt.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){Pt.setCurrentOpacity(Zt,Mt)}),Nt.appendChild(Mt);var Yt=document.createElement("div");Yt.innerText=100*Zt+"%",Mt.appendChild(Yt),Pt.opacityBoxes.push(Mt)}),Nt},Lt.prototype.setCurrentOpacity=function(Pt,Nt){var Zt=this;this.currentOpacity=Pt,this.opacityBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?Zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},Lt}(nt),fn=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.setOpacity=Mt.setOpacity.bind(Mt),Mt.fillColor=Zt.defaultHighlightColor,Mt.strokeWidth=0,Mt.opacity=Zt.defaultHighlightOpacity,Mt.fillPanel=new et("Color",Zt.defaultColorSet,Mt.fillColor),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt.opacityPanel=new Je("Opacity",Zt.defaultOpacitySteps,Mt.opacity),Mt.opacityPanel.onOpacityChanged=Mt.setOpacity,Mt}return Ut(Lt,Rt),Lt.prototype.setOpacity=function(Pt){this.opacity=Pt,this.visual&&Dt.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.typeName="HighlightMarker",Lt.title="Highlight marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',Lt}(je),te='<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>',Xe=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.bgColor="transparent",Mt.tipPosition={x:0,y:0},Mt.tipBase1Position={x:0,y:0},Mt.tipBase2Position={x:0,y:0},Mt.tipMoving=!1,Mt.color=Zt.defaultStrokeColor,Mt.bgColor=Zt.defaultFillColor,Mt.fontFamily=Zt.defaultFontFamily,Mt.defaultSize={x:100,y:30},Mt.setBgColor=Mt.setBgColor.bind(Mt),Mt.getTipPoints=Mt.getTipPoints.bind(Mt),Mt.positionTip=Mt.positionTip.bind(Mt),Mt.setTipPoints=Mt.setTipPoints.bind(Mt),Mt.colorPanel=new et("Text color",Zt.defaultColorSet,Mt.color,te),Mt.colorPanel.onColorChanged=Mt.setColor,Mt.bgColorPanel=new et("Fill color",Zt.defaultColorSet,Mt.bgColor,Jt),Mt.bgColorPanel.onColorChanged=Mt.setBgColor,Mt.fontFamilyPanel=new re("Font",Zt.defaultFontFamilies,Zt.defaultFontFamily),Mt.fontFamilyPanel.onFontChanged=Mt.setFont,Mt.tipGrip=new pt,Mt.tipGrip.visual.transform.baseVal.appendItem(Dt.createTransform()),Mt.controlBox.appendChild(Mt.tipGrip.visual),Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return Rt.prototype.ownsTarget.call(this,Pt)||this.tipGrip.ownsTarget(Pt)||this.tip===Pt},Lt.prototype.createTip=function(){Dt.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Dt.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},Lt.prototype.pointerDown=function(Pt,Nt){this.state==="new"&&Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Nt)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Rt.prototype.pointerDown.call(this,Pt,Nt)},Lt.prototype.pointerUp=function(Pt){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Rt.prototype.pointerUp.call(this,Pt);else{var Nt=this.state==="creating";Rt.prototype.pointerUp.call(this,Pt),this.setTipPoints(Nt),this.positionTip()}},Lt.prototype.manipulate=function(Pt){if(this.tipMoving){var Nt=this.unrotatePoint(Pt);this.tipPosition={x:Nt.x-this.manipulationStartLeft,y:Nt.y-this.manipulationStartTop},this.positionTip()}else Rt.prototype.manipulate.call(this,Pt)},Lt.prototype.setBgColor=function(Pt){this.bgRectangle&&this.tip&&(Dt.setAttributes(this.bgRectangle,[["fill",Pt]]),Dt.setAttributes(this.tip,[["fill",Pt]])),this.bgColor=Pt,this.fillColorChanged(Pt)},Lt.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},Lt.prototype.setTipPoints=function(Pt){Pt===void 0&&(Pt=!1);var Nt=Math.min(this.height/2,15),Zt=this.height/5;Pt&&(this.tipPosition={x:Nt+Zt/2,y:this.height+20});var Mt=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Mt<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(Zt=this.width/5,Nt=Math.min(this.width/2,15),this.tipBase1Position={x:Nt,y:0},this.tipBase2Position={x:Nt+Zt,y:0}):(this.tipBase1Position={x:0,y:Nt},this.tipBase2Position={x:0,y:Nt+Zt}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Mt<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(Zt=this.width/5,Nt=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Nt-Zt,y:0},this.tipBase2Position={x:this.width-Nt,y:0}):(this.tipBase1Position={x:this.width,y:Nt},this.tipBase2Position={x:this.width,y:Nt+Zt}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Mt<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(Zt=this.width/5,Nt=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Nt-Zt,y:this.height},this.tipBase2Position={x:this.width-Nt,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Nt-Zt},this.tipBase2Position={x:this.width,y:this.height-Nt}):Mt<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(Zt=this.width/5,Nt=Math.min(this.width/2,15),this.tipBase1Position={x:Nt,y:this.height},this.tipBase2Position={x:Nt+Zt,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Nt},this.tipBase2Position={x:0,y:this.height-Nt-Zt})},Lt.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.positionTip()},Lt.prototype.positionTip=function(){Dt.setAttributes(this.tip,[["points",this.getTipPoints()]]);var Pt=this.tipGrip.visual.transform.baseVal.getItem(0);Pt.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(Pt,0)},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Lt.prototype.select=function(){this.positionTip(),Rt.prototype.select.call(this)},Lt.prototype.getState=function(){var Pt=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.bgColor=Nt.bgColor,this.tipPosition=Nt.tipPosition,Rt.prototype.restoreState.call(this,Pt),this.createTip(),this.setTipPoints()},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.tipPosition={x:this.tipPosition.x*Pt,y:this.tipPosition.y*Nt},this.positionTip()},Lt.typeName="CalloutMarker",Lt.title="Callout marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',Lt}(Ne),On=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.fillColor="transparent",Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.opacity=1,Mt.strokeColor=Zt.defaultColor,Mt.strokeWidth=Zt.defaultStrokeWidth,Mt.strokeDasharray=Zt.defaultStrokeDasharray,Mt.fillColor=Zt.defaultFillColor,Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setFillColor=Mt.setFillColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.setOpacity=Mt.setOpacity.bind(Mt),Mt.createVisual=Mt.createVisual.bind(Mt),Mt.strokePanel=new et("Line color",he(Zt.defaultColorSet,["transparent"]),Zt.defaultColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.fillPanel=new et("Fill color",he(Zt.defaultColorSet,["transparent"]),Mt.fillColor,Jt),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt.strokeWidthPanel=new Tt("Line width",Zt.defaultStrokeWidths,Zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new It("Line style",Zt.defaultStrokeDasharrays,Zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt.opacityPanel=new Je("Opacity",Zt.defaultOpacitySteps,Mt.opacity),Mt.opacityPanel.onOpacityChanged=Mt.setOpacity,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual)},Lt.prototype.createVisual=function(){this.visual=Dt.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Lt.prototype.manipulate=function(Pt){Rt.prototype.manipulate.call(this,Pt)},Lt.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.setSize()},Lt.prototype.setSize=function(){Rt.prototype.setSize.call(this),Dt.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},Lt.prototype.pointerUp=function(Pt){Rt.prototype.pointerUp.call(this,Pt),this.setSize()},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Pt),this.stateChanged()},Lt.prototype.setFillColor=function(Pt){this.fillColor=Pt,this.visual&&Dt.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(Pt),this.stateChanged()},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Lt.prototype.setOpacity=function(Pt){this.opacity=Pt,this.visual&&Dt.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.fillColor=Nt.fillColor,this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.opacity=Nt.opacity,this.createVisual(),Rt.prototype.restoreState.call(this,Pt),this.setSize()},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setSize()},Lt.typeName="EllipseMarker",Lt.title="Ellipse marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',Lt}(St),bn=function(Rt){function Lt(Pt,Nt,Zt){return Rt.call(this,Pt,Nt,Zt)||this}return Ut(Lt,Rt),Object.defineProperty(Lt.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.tip1&&Pt!==this.tip2)},Lt.prototype.createTips=function(){this.tip1=Dt.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(Dt.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Dt.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(Dt.createTransform()),this.visual.appendChild(this.tip2)},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="creating"&&this.createTips()},Lt.prototype.adjustVisual=function(){if(Rt.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Dt.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()]]),Dt.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var Pt=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Nt=this.tip1.transform.baseVal.getItem(0);Nt.setRotate(Pt,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Nt,0);var Zt=this.tip2.transform.baseVal.getItem(0);Zt.setRotate(Pt+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Zt,0)}},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt),this.createTips(),this.adjustVisual()},Lt.typeName="MeasurementMarker",Lt.title="Measurement marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',Lt}(pe),De=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.strokePanel.colors=Zt.defaultColorSet,Mt.fillColor="transparent",Mt}return Ut(Lt,Rt),Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.typeName="EllipseFrameMarker",Lt.title="Ellipse frame marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',Lt}(On),on=function(){function Rt(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Rt.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Rt.prototype.addUndoStep=function(Lt){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(Lt)||(this.undoStack.push(Lt),JSON.stringify(this.lastRedoStep)!==JSON.stringify(Lt)&&this.redoStack.splice(0,this.redoStack.length))},Rt.prototype.replaceLastUndoStep=function(Lt){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=Lt)},Rt.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Rt.prototype.undo=function(){if(this.undoStack.length>1){var Lt=this.undoStack.pop();return Lt!==void 0&&this.redoStack.push(Lt),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Rt.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Rt}(),un=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.curveX=0,Mt.curveY=0,Mt.manipulationStartCurveX=0,Mt.manipulationStartCurveY=0,Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.positionGrips=Mt.positionGrips.bind(Mt),Mt.addControlGrips=Mt.addControlGrips.bind(Mt),Mt.adjustVisual=Mt.adjustVisual.bind(Mt),Mt.setupControlBox=Mt.setupControlBox.bind(Mt),Mt.resize=Mt.resize.bind(Mt),Mt.strokeColor=Zt.defaultColor,Mt.strokeWidth=Zt.defaultStrokeWidth,Mt.strokeDasharray=Zt.defaultStrokeDasharray,Mt.strokePanel=new et("Line color",Zt.defaultColorSet,Zt.defaultColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.strokeWidthPanel=new Tt("Line width",Zt.defaultStrokeWidths,Zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new It("Line style",Zt.defaultStrokeDasharrays,Zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.selectorCurve&&Pt!==this.visibleCurve&&!this.curveGrip.ownsTarget(Pt))},Lt.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},Lt.prototype.createVisual=function(){this.visual=Dt.createGroup(),this.selectorCurve=Dt.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Dt.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=Pt.x,this.curveY=Pt.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Nt)&&(this.activeGrip=this.curveGrip,this._state="resize")},Lt.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Dt.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Dt.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Dt.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},Lt.prototype.setupControlBox=function(){Rt.prototype.setupControlBox.call(this),this.curveControlLine1=Dt.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Dt.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},Lt.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Rt.prototype.addControlGrips.call(this)},Lt.prototype.positionGrips=function(){Rt.prototype.positionGrips.call(this);var Pt=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-Pt/2,this.curveY-Pt/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},Lt.prototype.manipulate=function(Pt){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+Pt.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+Pt.y-this.manipulationStartY),Rt.prototype.manipulate.call(this,Pt)},Lt.prototype.resize=function(Pt){this.activeGrip===this.curveGrip&&(this.curveX=Pt.x,this.curveY=Pt.y),Rt.prototype.resize.call(this,Pt),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.adjustVisual(),this.colorChanged(Pt)},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.adjustVisual()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.adjustVisual()},Lt.prototype.scale=function(Pt,Nt){this.curveX=this.curveX*Pt,this.curveY=this.curveY*Nt,Rt.prototype.scale.call(this,Pt,Nt)},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt);var Nt=Pt;this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.curveX=Nt.curveX,this.curveY=Nt.curveY,this.createVisual(),this.adjustVisual()},Lt.typeName="CurveMarker",Lt.title="Curve marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',Lt}(Ht),Kn=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.fillColor="transparent",Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.textColor="transparent",Mt.fontSize="1rem",Mt.isMoved=!1,Mt.captionText="Caption",Mt.PADDING=5,Mt.captionBoxWidth=0,Mt.captionBoxHeight=0,Mt.strokeColor=Zt.defaultColor,Mt.strokeWidth=Zt.defaultStrokeWidth,Mt.strokeDasharray=Zt.defaultStrokeDasharray,Mt.fillColor=Zt.defaultFillColor,Mt.textColor=Zt.defaultStrokeColor,Mt.fontFamily=Zt.defaultFontFamily,Mt.fontSize=Zt.defaultCaptionFontSize,Mt.captionText=Zt.defaultCaptionText,Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setFillColor=Mt.setFillColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.createVisual=Mt.createVisual.bind(Mt),Mt.sizeCaption=Mt.sizeCaption.bind(Mt),Mt.setCaptionText=Mt.setCaptionText.bind(Mt),Mt.showTextEditor=Mt.showTextEditor.bind(Mt),Mt.positionTextEditor=Mt.positionTextEditor.bind(Mt),Mt.finishTextEditing=Mt.finishTextEditing.bind(Mt),Mt.setFont=Mt.setFont.bind(Mt),Mt.setTextColor=Mt.setTextColor.bind(Mt),Mt.strokePanel=new et("Line color",he(Zt.defaultColorSet,["transparent"]),Mt.strokeColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.fillPanel=new et("Fill color",he(Zt.defaultColorSet,["transparent"]),Mt.fillColor,Jt),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt.strokeWidthPanel=new Tt("Line width",Zt.defaultStrokeWidths,Zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new It("Line style",Zt.defaultStrokeDasharrays,Zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt.fontFamilyPanel=new re("Font",Zt.defaultFontFamilies,Zt.defaultFontFamily),Mt.fontFamilyPanel.onFontChanged=Mt.setFont,Mt.textColorPanel=new et("Text color",Zt.defaultColorSet,Mt.textColor,te),Mt.textColorPanel.onColorChanged=Mt.setTextColor,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.frame&&Pt!==this.captionBg&&Pt!==this.captionElement)},Lt.prototype.createVisual=function(){this.visual=Dt.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=Dt.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=Dt.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=Dt.createRect(this.width,this.height,[["fill","transparent"],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray]]),this.visual.appendChild(this.frame),this.sizeCaption()},Lt.prototype.setCaptionText=function(Pt){this.captionText=Pt,this.captionElement.textContent=this.captionText,this.sizeCaption()},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.isMoved=!1,this.pointerDownPoint=Pt,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Lt.prototype.manipulate=function(Pt){Rt.prototype.manipulate.call(this,Pt),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Pt.x-this.pointerDownPoint.x)>5||Math.abs(Pt.y-this.pointerDownPoint.y)>5)},Lt.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.setSize()},Lt.prototype.sizeCaption=function(){var Pt=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=Pt.width+2*this.PADDING,this.captionBoxHeight=Pt.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),Dt.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')"]]),Dt.setAttributes(this.captionElement,[["x",this.PADDING.toString()],["y",this.PADDING.toString()],["clip-path","path('M0,0 H"+(this.width-this.PADDING)+" V"+this.height+" H"+(-this.width-this.PADDING)+" Z')"]])},Lt.prototype.showTextEditor=function(){var Pt=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditBox=document.createElement("input"),this.textEditBox.style.position="absolute",this.textEditBox.style.width=this.width+"px",this.captionBoxHeight>0&&(this.textEditBox.style.height=this.captionBoxHeight+"px"),this.textEditBox.style.fontSize=this.fontSize,this.textEditBox.style.fontFamily=this.fontFamily,this.textEditBox.style.backgroundColor=this.fillColor,this.textEditBox.style.color=this.textColor,this.textEditBox.style.borderWidth="0",this.textEditBox.setAttribute("value",this.captionText),this.textEditBox.select(),this.textEditDiv.appendChild(this.textEditBox),this.overlayContainer.appendChild(this.textEditDiv),this.textEditBox.addEventListener("pointerup",function(Nt){Nt.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(Nt){Nt.key==="Enter"&&Pt.finishTextEditing(Pt.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(Nt){Nt.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){Pt.finishTextEditing(Pt.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){Pt.finishTextEditing(Pt.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},Lt.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},Lt.prototype.finishTextEditing=function(Pt){this.setCaptionText(Pt.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},Lt.prototype.setFont=function(Pt){this.captionElement&&Dt.setAttributes(this.captionElement,[["font-family",Pt]]),this.fontFamily=Pt,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},Lt.prototype.setTextColor=function(Pt){this.captionElement&&Dt.setAttributes(this.captionElement,[["fill",Pt]]),this.textColor=Pt,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},Lt.prototype.setSize=function(){Rt.prototype.setSize.call(this),Dt.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},Lt.prototype.pointerUp=function(Pt){Rt.prototype.pointerUp.call(this,Pt),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},Lt.prototype.dblClick=function(Pt,Nt){Rt.prototype.dblClick.call(this,Pt,Nt),this.showTextEditor()},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.frame&&Dt.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(Pt),this.stateChanged()},Lt.prototype.setFillColor=function(Pt){this.fillColor=Pt,this.captionBg&&Dt.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(Pt),this.stateChanged()},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.frame&&Dt.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.frame&&Dt.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:1,textColor:this.textColor,fontFamily:this.fontFamily,fontSize:this.fontSize,captionText:this.captionText},Rt.prototype.getState.call(this));return Pt.typeName=this.typeName,Pt},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.fillColor=Nt.fillColor,this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.textColor=Nt.textColor,this.fontFamily=Nt.fontFamily,this.captionText=Nt.captionText,this.fontSize=Nt.fontSize,this.createVisual(),Rt.prototype.restoreState.call(this,Pt),this.setSize()},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setSize()},Lt.typeName="CaptionFrameMarker",Lt.title="Caption frame marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M5 3c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2H5m0 2h14v14H5V5m2 2v2h10V7H7z"/></svg>',Lt}(St),Me=function(){function Rt(Lt,Pt){Pt===void 0&&(Pt=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=Lt,this.cancelable=Pt}return Object.defineProperty(Rt.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Rt.prototype.preventDefault=function(){this._defaultPrevented=!0},Rt}(),vn=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,!1)||this;return Mt.dataUrl=Nt,Mt.state=Zt,Mt}return Ut(Lt,Rt),Lt}(Me),ne=function(Rt){function Lt(Pt,Nt,Zt){Zt===void 0&&(Zt=!1);var Mt=Rt.call(this,Pt,Zt)||this;return Mt.marker=Nt,Mt}return Ut(Lt,Rt),Lt}(Me),wn=function(){function Rt(){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 Rt.prototype.addEventListener=function(Lt,Pt){this[Lt].push(Pt)},Rt.prototype.removeEventListener=function(Lt,Pt){var Nt=this[Lt].indexOf(Pt);Nt>-1&&this[Lt].splice(Nt,1)},Rt}(),fi=function(){function Rt(Lt){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Xt,this._isOpen=!1,this.undoRedoManager=new on,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 wn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Rt.instanceCounter++,this.styles=new jt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=Lt,this.targetRoot=document.body,this.width=Lt.clientWidth,this.height=Lt.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(Rt.prototype,"ALL_MARKER_TYPES",{get:function(){return[qt,ye,Ue,Ne,De,On,fn,Xe,bn,je,pe,un,Kn]},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[qt,ye,Ue,Ne,On,fn,Xe]},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"BASIC_MARKER_TYPES",{get:function(){return[qt,ye,Ue,Ne,fn]},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(Lt){var Pt=this;this._availableMarkerTypes.splice(0),Lt.forEach(function(Nt){if(typeof Nt=="string"){var Zt=Pt.ALL_MARKER_TYPES.find(function(Mt){return Mt.typeName===Nt});Zt!==void 0&&Pt._availableMarkerTypes.push(Zt)}else Pt._availableMarkerTypes.push(Nt)})},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(Lt){this._zoomLevel=Lt,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Rt.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ee.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Rt.prototype.show=function(){var Lt=this;this.styles.styleSheetRoot===void 0&&Qt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Qt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(Pt){return Pt(new Me(Lt))})},Rt.prototype.render=function(){return ue(this,void 0,void 0,function(){var Lt;return Ee(this,function(Pt){switch(Pt.label){case 0:return this.setCurrentMarker(),(Lt=new ge).naturalSize=this.renderAtNaturalSize,Lt.imageType=this.renderImageType,Lt.imageQuality=this.renderImageQuality,Lt.markersOnly=this.renderMarkersOnly,Lt.width=this.renderWidth,Lt.height=this.renderHeight,[4,Lt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return Pt.sent(),[4,Lt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,Pt.sent()]}})})},Rt.prototype.close=function(Lt){var Pt=this;if(Lt===void 0&&(Lt=!1),this.isOpen){var Nt=!1;Lt||this.eventListeners.beforeclose.forEach(function(Zt){var Mt=new Me(Pt,!0);Zt(Mt),Mt.defaultPrevented&&(Nt=!0)}),Nt||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(Zt){return Zt(new Me(Pt))}),this.detachEvents(),this._isOpen=!1)}},Rt.prototype.addMarkersToToolbar=function(){for(var Lt,Pt=[],Nt=0;Nt<arguments.length;Nt++)Pt[Nt]=arguments[Nt];(Lt=this._availableMarkerTypes).push.apply(Lt,Pt)},Rt.prototype.addRenderEventListener=function(Lt){this.addEventListener("render",function(Pt){Lt(Pt.dataUrl,Pt.state)})},Rt.prototype.removeRenderEventListener=function(Lt){},Rt.prototype.addCloseEventListener=function(Lt){this.addEventListener("close",function(){Lt()})},Rt.prototype.removeCloseEventListener=function(Lt){},Rt.prototype.setupResizeObserver=function(){var Lt=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){Lt.resize(Lt.target.clientWidth,Lt.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return Lt.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Rt.prototype.onPopupTargetResize=function(){var Lt=1*this.target.clientWidth/this.target.clientHeight,Pt=this.editorCanvas.clientWidth/Lt>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*Lt:this.editorCanvas.clientWidth,Nt=Pt<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/Lt;this.resize(Pt,Nt)},Rt.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Rt.prototype.resize=function(Lt,Pt){this._isResizing=!0;var Nt=Lt/this.imageWidth,Zt=Pt/this.imageHeight;this.imageWidth=Math.round(Lt),this.imageHeight=Math.round(Pt),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(Nt,Zt),this._isResizing=!1},Rt.prototype.scaleMarkers=function(Lt,Pt){var Nt,Zt=this;this._currentMarker&&this._currentMarker instanceof Ne?this._currentMarker.scale(Lt,Pt):(Nt=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Mt){Mt!==Zt._currentMarker&&Mt.scale(Lt,Pt)}),Nt!==void 0&&this.setCurrentMarker(Nt)},Rt.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"},Rt.prototype.setTopLeft=function(){var Lt=this.editingTarget.getBoundingClientRect(),Pt=this.editorCanvas.getBoundingClientRect();this.left=Lt.left-Pt.left,this.top=Lt.top-Pt.top},Rt.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)},Rt.prototype.addDefs=function(){for(var Lt,Pt=[],Nt=0;Nt<arguments.length;Nt++)Pt[Nt]=arguments[Nt];this.defs=Dt.createDefs(),this.addDefsToImage(),(Lt=this.defs).append.apply(Lt,Pt)},Rt.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Rt.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)},Rt.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Rt.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Rt.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)},Rt.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Rt.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)},Rt.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var Lt=document.createElement("a");Lt.href="https://markerjs.com/",Lt.target="_blank",Lt.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',Lt.title="Powered by marker.js",Lt.style.display="grid",Lt.style.alignItems="center",Lt.style.justifyItems="center",Lt.style.padding="3px",Lt.style.width="20px",Lt.style.height="20px",this.logoUI.appendChild(Lt),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Rt.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")},Rt.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"},Rt.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Rt.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var Lt=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=Lt+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Pe(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.settings.uiOffsetTop===void 0&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Bt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Rt.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Rt.prototype.removeMarker=function(Lt){this.markerImage.removeChild(Lt.container),this.markers.indexOf(Lt)>-1&&this.markers.splice(this.markers.indexOf(Lt),1),Lt.dispose()},Rt.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())},Rt.prototype.toolbarButtonClicked=function(Lt,Pt){if(Lt==="marker"&&Pt!==void 0)this.createNewMarker(Pt);else if(Lt==="action")switch(Pt){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Rt.prototype.deleteSelectedMarker=function(){var Lt=this;if(this._currentMarker!==void 0){var Pt=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Zt){var Mt=new ne(Lt,Lt._currentMarker,!0);Zt(Mt),Mt.defaultPrevented&&(Pt=!0)}),!Pt){var Nt=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(Zt){return Zt(new ne(Lt,Nt))})}}},Rt.prototype.clear=function(){var Lt=this,Pt=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Yt){var Ge=new ne(Lt,void 0,!0);Yt(Ge),Ge.defaultPrevented&&(Pt=!0)}),!Pt)){this.setCurrentMarker();for(var Nt=function(Yt){var Ge=Zt.markers[Yt];Zt.setCurrentMarker(Zt.markers[Yt]),Zt._currentMarker.dispose(),Zt.markerImage.removeChild(Zt._currentMarker.container),Zt.markers.splice(Zt.markers.indexOf(Zt._currentMarker),1),Zt.eventListeners.markerdelete.forEach(function(Oe){return Oe(new ne(Lt,Ge))})},Zt=this,Mt=this.markers.length-1;Mt>=0;Mt--)Nt(Mt);this.addUndoStep()}},Object.defineProperty(Rt.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Rt.prototype.showNotesEditor=function(){var Lt;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(Lt=this._currentMarker.notes)!==null&&Lt!==void 0?Lt:"",this.overlayContainer.appendChild(this.notesArea))},Rt.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)},Rt.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Rt.prototype.addUndoStep=function(){var Lt=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var Pt=this.getState(),Nt=this.undoRedoManager.getLastUndoStep();if(!Nt||Nt.width===Pt.width&&Nt.height===Pt.height){var Zt=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(Pt),Zt<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Mt){return Mt(new Me(Lt))})}else this.undoRedoManager.replaceLastUndoStep(Pt),this.eventListeners.statechange.forEach(function(Mt){return Mt(new Me(Lt))})}},Rt.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Rt.prototype.undoStep=function(){var Lt=this,Pt=this.undoRedoManager.undo();Pt!==void 0&&(this.restoreState(Pt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Nt){return Nt(new Me(Lt))}))},Rt.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Rt.prototype.redoStep=function(){var Lt=this,Pt=this.undoRedoManager.redo();Pt!==void 0&&(this.restoreState(Pt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Nt){return Nt(new Me(Lt))}))},Rt.prototype.stepZoom=function(){var Lt=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=Lt<this.zoomSteps.length-1?this.zoomSteps[Lt+1]:this.zoomSteps[0]},Rt.prototype.panTo=function(Lt){this.contentDiv.scrollBy({left:this.prevPanPoint.x-Lt.x,top:this.prevPanPoint.y-Lt.y}),this.prevPanPoint=Lt},Rt.prototype.startRenderAndClose=function(){return ue(this,void 0,void 0,function(){var Lt,Pt,Nt=this;return Ee(this,function(Zt){switch(Zt.label){case 0:return[4,this.render()];case 1:return Lt=Zt.sent(),Pt=this.getState(),this.eventListeners.render.forEach(function(Mt){return Mt(new vn(Nt,Lt,Pt))}),this.close(!0),[2]}})})},Rt.prototype.getState=function(Lt){Lt===!0&&this.setCurrentMarker();var Pt={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Nt){return Pt.markers.push(Nt.getState())}),Pt},Rt.prototype.restoreState=function(Lt){var Pt=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);Lt.markers.forEach(function(Nt){var Zt=Pt._availableMarkerTypes.find(function(Yt){return Yt.typeName===Nt.typeName});if(Zt!==void 0){var Mt=Pt.addNewMarker(Zt);Mt.restoreState(Nt),Pt.markers.push(Mt)}}),Lt.width&&Lt.height&&(Lt.width!==this.imageWidth||Lt.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/Lt.width,this.imageHeight/Lt.height),this.eventListeners.restorestate.forEach(function(Nt){return Nt(new Me(Pt))})},Rt.prototype.addNewMarker=function(Lt){var Pt=Dt.createGroup();return this.markerImage.appendChild(Pt),new Lt(Pt,this.overlayContainer,this.settings)},Rt.prototype.createNewMarker=function(Lt){var Pt,Nt=this;(Pt=typeof Lt=="string"?this._availableMarkerTypes.find(function(Zt){return Zt.typeName===Lt}):Lt)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(Pt),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(Pt.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(Zt){return Zt(new ne(Nt,Nt._currentMarker))}))},Rt.prototype.markerCreated=function(Lt){var Pt=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(Lt),this.setCurrentMarker(Lt),Lt instanceof ye&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ye):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Nt){return Nt(new ne(Pt,Pt._currentMarker))})},Rt.prototype.colorChanged=function(Lt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=Lt,this.settings.defaultStrokeColor=Lt)},Rt.prototype.fillColorChanged=function(Lt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=Lt)},Rt.prototype.markerStateChanged=function(Lt){var Pt=this;this.eventListeners.markerchange.forEach(function(Nt){return Nt(new ne(Pt,Lt))})},Rt.prototype.setCurrentMarker=function(Lt){var Pt=this;this._currentMarker!==Lt&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Nt){return Nt(new ne(Pt,Pt._currentMarker))})),this._currentMarker=Lt,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(Nt){return Nt(new ne(Pt,Pt._currentMarker))}))},Rt.prototype.onPointerDown=function(Lt){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||Lt.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var Pt=this.markers.find(function(Nt){return Nt.ownsTarget(Lt.target)});Pt!==void 0?(this.setCurrentMarker(Pt),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY),Lt.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:Lt.clientX,y:Lt.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY))},Rt.prototype.onDblClick=function(Lt){if(this._isFocused||this.focus(),this.mode==="select"){var Pt=this.markers.find(function(Nt){return Nt.ownsTarget(Lt.target)});Pt!==void 0&&Pt!==this._currentMarker&&this.setCurrentMarker(Pt),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY),Lt.target):this.setCurrentMarker()}},Rt.prototype.onPointerMove=function(Lt){this.touchPoints!==1&&Lt.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||Lt.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY)):this.zoomLevel>1&&this.panTo({x:Lt.clientX,y:Lt.clientY}))},Rt.prototype.onPointerUp=function(Lt){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY)),this.isDragging=!1,this.addUndoStep()},Rt.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Rt.prototype.onKeyUp=function(Lt){this._currentMarker===void 0||this.notesArea!==void 0||Lt.key!=="Delete"&&Lt.key!=="Backspace"||this.deleteSelectedMarker()},Rt.prototype.clientToLocalCoordinates=function(Lt,Pt){var Nt=this.markerImage.getBoundingClientRect();return{x:(Lt-Nt.left)/this.zoomLevel,y:(Pt-Nt.top)/this.zoomLevel}},Rt.prototype.onWindowResize=function(){this.positionUI()},Rt.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var Lt=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=Lt+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},Rt.prototype.addLicenseKey=function(Lt){ee.addKey(Lt)},Rt.prototype.addEventListener=function(Lt,Pt){this.eventListeners.addEventListener(Lt,Pt)},Rt.prototype.removeEventListener=function(Lt,Pt){this.eventListeners.removeEventListener(Lt,Pt)},Rt.prototype.renderState=function(Lt){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(Lt),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Rt.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Rt.prototype.focus=function(){var Lt=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(Pt){return Pt(new Me(Lt))}))},Rt.prototype.blur=function(){var Lt=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(Pt){return Pt(new Me(Lt))}))},Rt.instanceCounter=0,Rt}()},63727:function(Mn,Rn,kt){"use strict";kt.d(Rn,{s:function(){return we},default:function(){return ri}});var gt=kt(14809),Ut=kt(20439),ue=kt(95190),Ee=kt(50298),he=kt(62646),Dt=kt(37463),ee=kt(6551),ge=kt(6089),Qt=kt(18929),jt=kt(59301),Ae=jt.createContext({}),se=Ae,Pe=kt(93664),Bt=kt(4635),nt="__rc_cascader_search_mark__",et=function(We,an,Xn){var pn=Xn.label,rn=pn===void 0?"":pn;return an.some(function(In){return String(In[rn]).toLowerCase().includes(We.toLowerCase())})},ht=function(We,an,Xn,pn){return an.map(function(rn){return rn[pn.label]}).join(" / ")},st=function(We,an,Xn,pn,rn,In){var pi=rn.filter,ei=pi===void 0?et:pi,mi=rn.render,Hi=mi===void 0?ht:mi,Cn=rn.limit,Sn=Cn===void 0?50:Cn,Bn=rn.sort;return jt.useMemo(function(){var si=[];if(!We)return[];function yi(hi,Gi){var wt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;hi.forEach(function(Ye){if(!(!Bn&&Sn!==!1&&Sn>0&&si.length>=Sn)){var Zn=[].concat((0,ue.Z)(Gi),[Ye]),Ln=Ye[Xn.children],zn=wt||Ye.disabled;if((!Ln||Ln.length===0||In)&&ei(We,Zn,{label:Xn.label})){var oi;si.push((0,Ut.Z)((0,Ut.Z)({},Ye),{},(oi={disabled:zn},(0,Bt.Z)(oi,Xn.label,Hi(We,Zn,pn,Xn)),(0,Bt.Z)(oi,nt,Zn),(0,Bt.Z)(oi,Xn.children,void 0),oi)))}Ln&&yi(Ye[Xn.children],Zn,zn)}})}return yi(an,[]),Bn&&si.sort(function(hi,Gi){return Bn(hi[nt],Gi[nt],We,Xn)}),Sn!==!1&&Sn>0?si.slice(0,Sn):si},[We,an,Xn,pn,Hi,In,ei,Bn,Sn])},pt=st,vt="__RC_CASCADER_SPLIT__",St="SHOW_PARENT",Et="SHOW_CHILD";function Tt(ze){return ze.join(vt)}function It(ze){return ze.map(Tt)}function qt(ze){return ze.split(vt)}function Xt(ze){var We=ze||{},an=We.label,Xn=We.value,pn=We.children,rn=Xn||"value";return{label:an||"label",value:rn,key:rn,children:pn||"children"}}function Ht(ze,We){var an,Xn;return(an=ze.isLeaf)!==null&&an!==void 0?an:!((Xn=ze[We.children])!==null&&Xn!==void 0&&Xn.length)}function pe(ze){var We=ze.parentElement;if(We){var an=ze.offsetTop-We.offsetTop;an-We.scrollTop<0?We.scrollTo({top:an}):an+ze.offsetHeight-We.scrollTop>We.offsetHeight&&We.scrollTo({top:an+ze.offsetHeight-We.offsetHeight})}}function re(ze,We){return ze.map(function(an){var Xn;return(Xn=an[nt])===null||Xn===void 0?void 0:Xn.map(function(pn){return pn[We.value]})})}function Ne(ze){return Array.isArray(ze)&&Array.isArray(ze[0])}function ye(ze){return ze?Ne(ze)?ze:(ze.length===0?[]:[ze]).map(function(We){return Array.isArray(We)?We:[We]}):[]}function xe(ze,We,an){var Xn=new Set(ze),pn=We();return ze.filter(function(rn){var In=pn[rn],pi=In?In.parent:null,ei=In?In.children:null;return In&&In.node.disabled?!0:an===Et?!(ei&&ei.some(function(mi){return mi.key&&Xn.has(mi.key)})):!(pi&&!pi.node.disabled&&Xn.has(pi.key))})}function Ue(ze,We,an){for(var Xn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,pn=We,rn=[],In=function(){var mi,Hi,Cn,Sn=ze[pi],Bn=(mi=pn)===null||mi===void 0?void 0:mi.findIndex(function(yi){var hi=yi[an.value];return Xn?String(hi)===String(Sn):hi===Sn}),si=Bn!==-1?(Hi=pn)===null||Hi===void 0?void 0:Hi[Bn]:null;rn.push({value:(Cn=si==null?void 0:si[an.value])!==null&&Cn!==void 0?Cn:Sn,index:Bn,option:si}),pn=si==null?void 0:si[an.children]},pi=0;pi<ze.length;pi+=1)In();return rn}var je=function(ze,We,an,Xn,pn){return jt.useMemo(function(){var rn=pn||function(In){var pi=Xn?In.slice(-1):In,ei=" / ";return pi.every(function(mi){return["string","number"].includes((0,Pe.Z)(mi))})?pi.join(ei):pi.reduce(function(mi,Hi,Cn){var Sn=jt.isValidElement(Hi)?jt.cloneElement(Hi,{key:Cn}):Hi;return Cn===0?[Sn]:[].concat((0,ue.Z)(mi),[ei,Sn])},[])};return ze.map(function(In){var pi,ei=Ue(In,We,an),mi=rn(ei.map(function(Cn){var Sn,Bn=Cn.option,si=Cn.value;return(Sn=Bn==null?void 0:Bn[an.label])!==null&&Sn!==void 0?Sn:si}),ei.map(function(Cn){var Sn=Cn.option;return Sn})),Hi=Tt(In);return{label:mi,value:Hi,key:Hi,valueCells:In,disabled:(pi=ei[ei.length-1])===null||pi===void 0||(pi=pi.option)===null||pi===void 0?void 0:pi.disabled}})},[ze,We,an,pn,Xn])};function Je(ze,We){return jt.useCallback(function(an){var Xn=[],pn=[];return an.forEach(function(rn){var In=Ue(rn,ze,We);In.every(function(pi){return pi.option})?pn.push(rn):Xn.push(rn)}),[pn,Xn]},[ze,We])}var fn=kt(34061),te=function(ze,We){var an=jt.useRef({options:[],info:{keyEntities:{},pathKeyEntities:{}}}),Xn=jt.useCallback(function(){return an.current.options!==ze&&(an.current.options=ze,an.current.info=(0,fn.I8)(ze,{fieldNames:We,initWrapper:function(rn){return(0,Ut.Z)((0,Ut.Z)({},rn),{},{pathKeyEntities:{}})},processEntity:function(rn,In){var pi=rn.nodes.map(function(ei){return ei[We.value]}).join(vt);In.pathKeyEntities[pi]=rn,rn.key=pi}})),an.current.info.pathKeyEntities},[We,ze]);return Xn};function Jt(ze,We){var an=jt.useMemo(function(){return We||[]},[We]),Xn=te(an,ze),pn=jt.useCallback(function(rn){var In=Xn();return rn.map(function(pi){var ei=In[pi].nodes;return ei.map(function(mi){return mi[ze.value]})})},[Xn,ze]);return[an,Xn,pn]}var Xe=kt(48736);function On(ze){return jt.useMemo(function(){if(!ze)return[!1,{}];var We={matchInputWidth:!0,limit:50};return ze&&(0,Pe.Z)(ze)==="object"&&(We=(0,Ut.Z)((0,Ut.Z)({},We),ze)),We.limit<=0&&(We.limit=!1),[!0,We]},[ze])}var bn=kt(34643);function De(ze,We,an,Xn,pn,rn,In,pi){return function(ei){if(!ze)We(ei);else{var mi=Tt(ei),Hi=It(an),Cn=It(Xn),Sn=Hi.includes(mi),Bn=pn.some(function(zn){return Tt(zn)===mi}),si=an,yi=pn;if(Bn&&!Sn)yi=pn.filter(function(zn){return Tt(zn)!==mi});else{var hi=Sn?Hi.filter(function(zn){return zn!==mi}):[].concat((0,ue.Z)(Hi),[mi]),Gi=rn(),wt;if(Sn){var Ye=(0,bn.S)(hi,{checked:!1,halfCheckedKeys:Cn},Gi);wt=Ye.checkedKeys}else{var Zn=(0,bn.S)(hi,!0,Gi);wt=Zn.checkedKeys}var Ln=xe(wt,rn,pi);si=In(Ln)}We([].concat((0,ue.Z)(yi),(0,ue.Z)(si)))}}}function on(ze,We,an,Xn,pn){return jt.useMemo(function(){var rn=pn(We),In=(0,Ee.Z)(rn,2),pi=In[0],ei=In[1];if(!ze||!We.length)return[pi,[],ei];var mi=It(pi),Hi=an(),Cn=(0,bn.S)(mi,!0,Hi),Sn=Cn.checkedKeys,Bn=Cn.halfCheckedKeys;return[Xn(Sn),Xn(Bn),ei]},[ze,We,an,Xn,pn])}var un=kt(92310),Kn=kt.n(un),Me=jt.memo(function(ze){var We=ze.children;return We},function(ze,We){return!We.open}),vn=Me;function ne(ze){var We,an=ze.prefixCls,Xn=ze.checked,pn=ze.halfChecked,rn=ze.disabled,In=ze.onClick,pi=ze.disableCheckbox,ei=jt.useContext(se),mi=ei.checkable,Hi=typeof mi!="boolean"?mi:null;return jt.createElement("span",{className:Kn()("".concat(an),(We={},(0,Bt.Z)(We,"".concat(an,"-checked"),Xn),(0,Bt.Z)(We,"".concat(an,"-indeterminate"),!Xn&&pn),(0,Bt.Z)(We,"".concat(an,"-disabled"),rn||pi),We)),onClick:In},Hi)}var wn="__cascader_fix_label__";function fi(ze){var We=ze.prefixCls,an=ze.multiple,Xn=ze.options,pn=ze.activeValue,rn=ze.prevValuePath,In=ze.onToggleOpen,pi=ze.onSelect,ei=ze.onActive,mi=ze.checkedSet,Hi=ze.halfCheckedSet,Cn=ze.loadingKeys,Sn=ze.isSelectable,Bn=ze.disabled,si="".concat(We,"-menu"),yi="".concat(We,"-menu-item"),hi=jt.useContext(se),Gi=hi.fieldNames,wt=hi.changeOnSelect,Ye=hi.expandTrigger,Zn=hi.expandIcon,Ln=hi.loadingIcon,zn=hi.dropdownMenuColumnStyle,oi=hi.optionRender,Si=Ye==="hover",Yi=function(Le){return Bn||Le},Fi=jt.useMemo(function(){return Xn.map(function(ve){var Le,Se=ve.disabled,ti=ve.disableCheckbox,Yn=ve[nt],Wn=(Le=ve[wn])!==null&&Le!==void 0?Le:ve[Gi.label],qe=ve[Gi.value],Dn=Ht(ve,Gi),ki=Yn?Yn.map(function(En){return En[Gi.value]}):[].concat((0,ue.Z)(rn),[qe]),Di=Tt(ki),Ki=Cn.includes(Di),Gt=mi.has(Di),me=Hi.has(Di);return{disabled:Se,label:Wn,value:qe,isLeaf:Dn,isLoading:Ki,checked:Gt,halfChecked:me,option:ve,disableCheckbox:ti,fullPath:ki,fullPathKey:Di}})},[Xn,mi,Gi,Hi,Cn,rn]);return jt.createElement("ul",{className:si,role:"menu"},Fi.map(function(ve){var Le,Se=ve.disabled,ti=ve.label,Yn=ve.value,Wn=ve.isLeaf,qe=ve.isLoading,Dn=ve.checked,ki=ve.halfChecked,Di=ve.option,Ki=ve.fullPath,Gt=ve.fullPathKey,me=ve.disableCheckbox,En=function(){if(!Yi(Se)){var Nn=(0,ue.Z)(Ki);Si&&Wn&&Nn.pop(),ei(Nn)}},Gn=function(){Sn(Di)&&!Yi(Se)&&pi(Ki,Wn)},Re;return typeof Di.title=="string"?Re=Di.title:typeof ti=="string"&&(Re=ti),jt.createElement("li",{key:Gt,className:Kn()(yi,(Le={},(0,Bt.Z)(Le,"".concat(yi,"-expand"),!Wn),(0,Bt.Z)(Le,"".concat(yi,"-active"),pn===Yn||pn===Gt),(0,Bt.Z)(Le,"".concat(yi,"-disabled"),Yi(Se)),(0,Bt.Z)(Le,"".concat(yi,"-loading"),qe),Le)),style:zn,role:"menuitemcheckbox",title:Re,"aria-checked":Dn,"data-path-key":Gt,onClick:function(){En(),!me&&(!an||Wn)&&Gn()},onDoubleClick:function(){wt&&In(!1)},onMouseEnter:function(){Si&&En()},onMouseDown:function(Nn){Nn.preventDefault()}},an&&jt.createElement(ne,{prefixCls:"".concat(We,"-checkbox"),checked:Dn,halfChecked:ki,disabled:Yi(Se)||me,disableCheckbox:me,onClick:function(Nn){me||(Nn.stopPropagation(),Gn())}}),jt.createElement("div",{className:"".concat(yi,"-content")},oi?oi(Di):ti),!qe&&Zn&&!Wn&&jt.createElement("div",{className:"".concat(yi,"-expand-icon")},Zn),qe&&Ln&&jt.createElement("div",{className:"".concat(yi,"-loading-icon")},Ln))}))}var Rt=function(We,an){var Xn=jt.useContext(se),pn=Xn.values,rn=pn[0],In=jt.useState([]),pi=(0,Ee.Z)(In,2),ei=pi[0],mi=pi[1];return jt.useEffect(function(){We||mi(rn||[])},[an,rn]),[ei,mi]},Lt=Rt,Pt=kt(10228),Nt=function(ze,We,an,Xn,pn,rn,In){var pi=In.direction,ei=In.searchValue,mi=In.toggleOpen,Hi=In.open,Cn=pi==="rtl",Sn=jt.useMemo(function(){for(var zn=-1,oi=We,Si=[],Yi=[],Fi=Xn.length,ve=re(We,an),Le=function(qe){var Dn=oi.findIndex(function(ki,Di){return(ve[Di]?Tt(ve[Di]):ki[an.value])===Xn[qe]});if(Dn===-1)return 1;zn=Dn,Si.push(zn),Yi.push(Xn[qe]),oi=oi[zn][an.children]},Se=0;Se<Fi&&oi&&!Le(Se);Se+=1);for(var ti=We,Yn=0;Yn<Si.length-1;Yn+=1)ti=ti[Si[Yn]][an.children];return[Yi,zn,ti,ve]},[Xn,an,We]),Bn=(0,Ee.Z)(Sn,4),si=Bn[0],yi=Bn[1],hi=Bn[2],Gi=Bn[3],wt=function(oi){pn(oi)},Ye=function(oi){var Si=hi.length,Yi=yi;Yi===-1&&oi<0&&(Yi=Si);for(var Fi=0;Fi<Si;Fi+=1){Yi=(Yi+oi+Si)%Si;var ve=hi[Yi];if(ve&&!ve.disabled){var Le=si.slice(0,-1).concat(Gi[Yi]?Tt(Gi[Yi]):ve[an.value]);wt(Le);return}}},Zn=function(){if(si.length>1){var oi=si.slice(0,-1);wt(oi)}else mi(!1)},Ln=function(){var oi,Si=((oi=hi[yi])===null||oi===void 0?void 0:oi[an.children])||[],Yi=Si.find(function(ve){return!ve.disabled});if(Yi){var Fi=[].concat((0,ue.Z)(si),[Yi[an.value]]);wt(Fi)}};jt.useImperativeHandle(ze,function(){return{onKeyDown:function(oi){var Si=oi.which;switch(Si){case Pt.Z.UP:case Pt.Z.DOWN:{var Yi=0;Si===Pt.Z.UP?Yi=-1:Si===Pt.Z.DOWN&&(Yi=1),Yi!==0&&Ye(Yi);break}case Pt.Z.LEFT:{if(ei)break;Cn?Ln():Zn();break}case Pt.Z.RIGHT:{if(ei)break;Cn?Zn():Ln();break}case Pt.Z.BACKSPACE:{ei||Zn();break}case Pt.Z.ENTER:{if(si.length){var Fi=hi[yi],ve=(Fi==null?void 0:Fi[nt])||[];ve.length?rn(ve.map(function(Le){return Le[an.value]}),ve[ve.length-1]):rn(si,hi[yi])}break}case Pt.Z.ESC:mi(!1),Hi&&oi.stopPropagation()}},onKeyUp:function(){}}})},Zt=jt.forwardRef(function(ze,We){var an,Xn,pn,rn=ze.prefixCls,In=ze.multiple,pi=ze.searchValue,ei=ze.toggleOpen,mi=ze.notFoundContent,Hi=ze.direction,Cn=ze.open,Sn=ze.disabled,Bn=jt.useRef(null),si=Hi==="rtl",yi=jt.useContext(se),hi=yi.options,Gi=yi.values,wt=yi.halfValues,Ye=yi.fieldNames,Zn=yi.changeOnSelect,Ln=yi.onSelect,zn=yi.searchOptions,oi=yi.dropdownPrefixCls,Si=yi.loadData,Yi=yi.expandTrigger,Fi=oi||rn,ve=jt.useState([]),Le=(0,Ee.Z)(ve,2),Se=Le[0],ti=Le[1],Yn=function(ji){if(!(!Si||pi)){var Oi=Ue(ji,hi,Ye),Ii=Oi.map(function(Mr){var ro=Mr.option;return ro}),Ve=Ii[Ii.length-1];if(Ve&&!Ht(Ve,Ye)){var vr=Tt(ji);ti(function(Mr){return[].concat((0,ue.Z)(Mr),[vr])}),Si(Ii)}}};jt.useEffect(function(){Se.length&&Se.forEach(function(ni){var ji=qt(ni),Oi=Ue(ji,hi,Ye,!0).map(function(Ve){var vr=Ve.option;return vr}),Ii=Oi[Oi.length-1];(!Ii||Ii[Ye.children]||Ht(Ii,Ye))&&ti(function(Ve){return Ve.filter(function(vr){return vr!==ni})})})},[hi,Se,Ye]);var Wn=jt.useMemo(function(){return new Set(It(Gi))},[Gi]),qe=jt.useMemo(function(){return new Set(It(wt))},[wt]),Dn=Lt(In,Cn),ki=(0,Ee.Z)(Dn,2),Di=ki[0],Ki=ki[1],Gt=function(ji){Ki(ji),Yn(ji)},me=function(ji){if(Sn)return!1;var Oi=ji.disabled,Ii=Ht(ji,Ye);return!Oi&&(Ii||Zn||In)},En=function(ji,Oi){var Ii=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Ln(ji),!In&&(Oi||Zn&&(Yi==="hover"||Ii))&&ei(!1)},Gn=jt.useMemo(function(){return pi?zn:hi},[pi,zn,hi]),Re=jt.useMemo(function(){for(var ni=[{options:Gn}],ji=Gn,Oi=re(ji,Ye),Ii=function(){var Mr=Di[Ve],ro=ji.find(function(Tn,Bi){return(Oi[Bi]?Tt(Oi[Bi]):Tn[Ye.value])===Mr}),en=ro==null?void 0:ro[Ye.children];if(!(en!=null&&en.length))return 1;ji=en,ni.push({options:en})},Ve=0;Ve<Di.length&&!Ii();Ve+=1);return ni},[Gn,Di,Ye]),$e=function(ji,Oi){me(Oi)&&En(ji,Ht(Oi,Ye),!0)};Nt(We,Gn,Ye,Di,Gt,$e,{direction:Hi,searchValue:pi,toggleOpen:ei,open:Cn}),jt.useEffect(function(){if(!pi)for(var ni=0;ni<Di.length;ni+=1){var ji,Oi=Di.slice(0,ni+1),Ii=Tt(Oi),Ve=(ji=Bn.current)===null||ji===void 0?void 0:ji.querySelector('li[data-path-key="'.concat(Ii.replace(/\\{0,2}"/g,'\\"'),'"]'));Ve&&pe(Ve)}},[Di,pi]);var Nn=!((an=Re[0])!==null&&an!==void 0&&(an=an.options)!==null&&an!==void 0&&an.length),_n=[(Xn={},(0,Bt.Z)(Xn,Ye.value,"__EMPTY__"),(0,Bt.Z)(Xn,wn,mi),(0,Bt.Z)(Xn,"disabled",!0),Xn)],di=(0,Ut.Z)((0,Ut.Z)({},ze),{},{multiple:!Nn&&In,onSelect:En,onActive:Gt,onToggleOpen:ei,checkedSet:Wn,halfCheckedSet:qe,loadingKeys:Se,isSelectable:me}),Jn=Nn?[{options:_n}]:Re,li=Jn.map(function(ni,ji){var Oi=Di.slice(0,ji),Ii=Di[ji];return jt.createElement(fi,(0,gt.Z)({key:ji},di,{prefixCls:Fi,options:ni.options,prevValuePath:Oi,activeValue:Ii}))});return jt.createElement(vn,{open:Cn},jt.createElement("div",{className:Kn()("".concat(Fi,"-menus"),(pn={},(0,Bt.Z)(pn,"".concat(Fi,"-menu-empty"),Nn),(0,Bt.Z)(pn,"".concat(Fi,"-rtl"),si),pn)),ref:Bn},li))}),Mt=Zt,Yt=jt.forwardRef(function(ze,We){var an=(0,Dt.lk)();return jt.createElement(Mt,(0,gt.Z)({},ze,an,{ref:We}))}),Ge=Yt,Oe=kt(70425);function Ke(){}function we(ze){var We,an=ze,Xn=an.prefixCls,pn=Xn===void 0?"rc-cascader":Xn,rn=an.style,In=an.className,pi=an.options,ei=an.checkable,mi=an.defaultValue,Hi=an.value,Cn=an.fieldNames,Sn=an.changeOnSelect,Bn=an.onChange,si=an.showCheckedStrategy,yi=an.loadData,hi=an.expandTrigger,Gi=an.expandIcon,wt=Gi===void 0?">":Gi,Ye=an.loadingIcon,Zn=an.direction,Ln=an.notFoundContent,zn=Ln===void 0?"Not Found":Ln,oi=an.disabled,Si=!!ei,Yi=(0,Oe.C8)(mi,{value:Hi,postState:ye}),Fi=(0,Ee.Z)(Yi,2),ve=Fi[0],Le=Fi[1],Se=jt.useMemo(function(){return Xt(Cn)},[JSON.stringify(Cn)]),ti=Jt(Se,pi),Yn=(0,Ee.Z)(ti,3),Wn=Yn[0],qe=Yn[1],Dn=Yn[2],ki=Je(Wn,Se),Di=on(Si,ve,qe,Dn,ki),Ki=(0,Ee.Z)(Di,3),Gt=Ki[0],me=Ki[1],En=Ki[2],Gn=(0,Oe.zX)(function(Jn){if(Le(Jn),Bn){var li=ye(Jn),ni=li.map(function(Ii){return Ue(Ii,Wn,Se).map(function(Ve){return Ve.option})}),ji=Si?li:li[0],Oi=Si?ni:ni[0];Bn(ji,Oi)}}),Re=De(Si,Gn,Gt,me,En,qe,Dn,si),$e=(0,Oe.zX)(function(Jn){Re(Jn)}),Nn=jt.useMemo(function(){return{options:Wn,fieldNames:Se,values:Gt,halfValues:me,changeOnSelect:Sn,onSelect:$e,checkable:ei,searchOptions:[],dropdownPrefixCls:void 0,loadData:yi,expandTrigger:hi,expandIcon:wt,loadingIcon:Ye,dropdownMenuColumnStyle:void 0}},[Wn,Se,Gt,me,Sn,$e,ei,yi,hi,wt,Ye]),_n="".concat(pn,"-panel"),di=!Wn.length;return jt.createElement(se.Provider,{value:Nn},jt.createElement("div",{className:Kn()(_n,(We={},(0,Bt.Z)(We,"".concat(_n,"-rtl"),Zn==="rtl"),(0,Bt.Z)(We,"".concat(_n,"-empty"),di),We),In),style:rn},di?zn:jt.createElement(Mt,{prefixCls:pn,searchValue:"",multiple:Si,toggleOpen:Ke,open:!0,direction:Zn,disabled:oi})))}function Ce(ze){var We=ze.onPopupVisibleChange,an=ze.popupVisible,Xn=ze.popupClassName,pn=ze.popupPlacement;warning(!We,"`onPopupVisibleChange` is deprecated. Please use `onDropdownVisibleChange` instead."),warning(an===void 0,"`popupVisible` is deprecated. Please use `open` instead."),warning(Xn===void 0,"`popupClassName` is deprecated. Please use `dropdownClassName` instead."),warning(pn===void 0,"`popupPlacement` is deprecated. Please use `placement` instead.")}function Fe(ze,We){if(ze){var an=function Xn(pn){for(var rn=0;rn<pn.length;rn++){var In=pn[rn];if(In[We==null?void 0:We.value]===null)return warning(!1,"`value` in Cascader options should not be `null`."),!0;if(Array.isArray(In[We==null?void 0:We.children])&&Xn(In[We==null?void 0:We.children]))return!0}};an(ze)}}var He=null,Qe=["id","prefixCls","fieldNames","defaultValue","value","changeOnSelect","onChange","displayRender","checkable","autoClearSearchValue","searchValue","onSearch","showSearch","expandTrigger","options","dropdownPrefixCls","loadData","popupVisible","open","popupClassName","dropdownClassName","dropdownMenuColumnStyle","dropdownStyle","popupPlacement","placement","onDropdownVisibleChange","onPopupVisibleChange","expandIcon","loadingIcon","children","dropdownMatchSelectWidth","showCheckedStrategy","optionRender"],hn=jt.forwardRef(function(ze,We){var an=ze.id,Xn=ze.prefixCls,pn=Xn===void 0?"rc-cascader":Xn,rn=ze.fieldNames,In=ze.defaultValue,pi=ze.value,ei=ze.changeOnSelect,mi=ze.onChange,Hi=ze.displayRender,Cn=ze.checkable,Sn=ze.autoClearSearchValue,Bn=Sn===void 0?!0:Sn,si=ze.searchValue,yi=ze.onSearch,hi=ze.showSearch,Gi=ze.expandTrigger,wt=ze.options,Ye=ze.dropdownPrefixCls,Zn=ze.loadData,Ln=ze.popupVisible,zn=ze.open,oi=ze.popupClassName,Si=ze.dropdownClassName,Yi=ze.dropdownMenuColumnStyle,Fi=ze.dropdownStyle,ve=ze.popupPlacement,Le=ze.placement,Se=ze.onDropdownVisibleChange,ti=ze.onPopupVisibleChange,Yn=ze.expandIcon,Wn=Yn===void 0?">":Yn,qe=ze.loadingIcon,Dn=ze.children,ki=ze.dropdownMatchSelectWidth,Di=ki===void 0?!1:ki,Ki=ze.showCheckedStrategy,Gt=Ki===void 0?St:Ki,me=ze.optionRender,En=(0,he.Z)(ze,Qe),Gn=(0,ee.ZP)(an),Re=!!Cn,$e=(0,Qt.Z)(In,{value:pi,postState:ye}),Nn=(0,Ee.Z)($e,2),_n=Nn[0],di=Nn[1],Jn=jt.useMemo(function(){return Xt(rn)},[JSON.stringify(rn)]),li=Jt(Jn,wt),ni=(0,Ee.Z)(li,3),ji=ni[0],Oi=ni[1],Ii=ni[2],Ve=(0,Qt.Z)("",{value:si,postState:function(Li){return Li||""}}),vr=(0,Ee.Z)(Ve,2),Mr=vr[0],ro=vr[1],en=function(Li,xi){ro(Li),xi.source!=="blur"&&yi&&yi(Li)},Tn=On(hi),Bi=(0,Ee.Z)(Tn,2),bi=Bi[0],_i=Bi[1],ir=pt(Mr,ji,Jn,Ye||pn,_i,ei||Re),yr=Je(ji,Jn),Nr=on(Re,_n,Oi,Ii,yr),_r=(0,Ee.Z)(Nr,3),Rr=_r[0],cn=_r[1],ho=_r[2],gn=jt.useMemo(function(){var Qn=It(Rr),Li=xe(Qn,Oi,Gt);return[].concat((0,ue.Z)(ho),(0,ue.Z)(Ii(Li)))},[Rr,Oi,Ii,ho,Gt]),Wi=je(gn,ji,Jn,Re,Hi),Kr=(0,ge.Z)(function(Qn){if(di(Qn),mi){var Li=ye(Qn),xi=Li.map(function(Vn){return Ue(Vn,ji,Jn).map(function($n){return $n.option})}),ui=Re?Li:Li[0],mn=Re?xi:xi[0];mi(ui,mn)}}),zi=De(Re,Kr,Rr,cn,ho,Oi,Ii,Gt),wo=(0,ge.Z)(function(Qn){(!Re||Bn)&&ro(""),zi(Qn)}),Yr=function(Li,xi){if(xi.type==="clear"){Kr([]);return}var ui=xi.values[0],mn=ui.valueCells;wo(mn)},Er=zn!==void 0?zn:Ln,Co=Si||oi,_e=Le||ve,xn=function(Li){Se==null||Se(Li),ti==null||ti(Li)},Be=jt.useMemo(function(){return{options:ji,fieldNames:Jn,values:Rr,halfValues:cn,changeOnSelect:ei,onSelect:wo,checkable:Cn,searchOptions:ir,dropdownPrefixCls:Ye,loadData:Zn,expandTrigger:Gi,expandIcon:Wn,loadingIcon:qe,dropdownMenuColumnStyle:Yi,optionRender:me}},[ji,Jn,Rr,cn,ei,wo,Cn,ir,Ye,Zn,Gi,Wn,qe,Yi,me]),At=!(Mr?ir:ji).length,jn=Mr&&_i.matchInputWidth||At?{}:{minWidth:"auto"};return jt.createElement(se.Provider,{value:Be},jt.createElement(Dt.Ac,(0,gt.Z)({},En,{ref:We,id:Gn,prefixCls:pn,autoClearSearchValue:Bn,dropdownMatchSelectWidth:Di,dropdownStyle:(0,Ut.Z)((0,Ut.Z)({},jn),Fi),displayValues:Wi,onDisplayValuesChange:Yr,mode:Re?"multiple":void 0,searchValue:Mr,onSearch:en,showSearch:bi,OptionList:Ge,emptyOptions:At,open:Er,dropdownClassName:Co,placement:_e,onDropdownVisibleChange:xn,getRawInputElement:function(){return Dn}})))});hn.SHOW_PARENT=St,hn.SHOW_CHILD=Et,hn.Panel=we;var dn=hn,ri=dn},98535:function(Mn,Rn,kt){"use strict";kt.r(Rn),kt.d(Rn,{Panel:function(){return ye},default:function(){return Ne}});var gt=kt(14809),Ut=kt(95190),ue=kt(50298),Ee=kt(93664),he=kt(92310),Dt=kt.n(he),ee=kt(18929),ge=kt(48736),Qt=kt(59301),jt=kt(62646),Ae=kt(11592),se=kt(20439),Pe=kt(4635),Bt=kt(77900),nt=kt(10228),et=Qt.forwardRef(function(xe,Ue){var je=xe.prefixCls,Je=xe.forceRender,fn=xe.className,te=xe.style,Jt=xe.children,Xe=xe.isActive,On=xe.role,bn=xe.classNames,De=xe.styles,on=Qt.useState(Xe||Je),un=(0,ue.Z)(on,2),Kn=un[0],Me=un[1];return Qt.useEffect(function(){(Je||Xe)&&Me(!0)},[Je,Xe]),Kn?Qt.createElement("div",{ref:Ue,className:Dt()("".concat(je,"-content"),(0,Pe.Z)((0,Pe.Z)({},"".concat(je,"-content-active"),Xe),"".concat(je,"-content-inactive"),!Xe),fn),style:te,role:On},Qt.createElement("div",{className:Dt()("".concat(je,"-content-box"),bn==null?void 0:bn.body),style:De==null?void 0:De.body},Jt)):null});et.displayName="PanelContent";var ht=et,st=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],pt=Qt.forwardRef(function(xe,Ue){var je=xe.showArrow,Je=je===void 0?!0:je,fn=xe.headerClass,te=xe.isActive,Jt=xe.onItemClick,Xe=xe.forceRender,On=xe.className,bn=xe.classNames,De=bn===void 0?{}:bn,on=xe.styles,un=on===void 0?{}:on,Kn=xe.prefixCls,Me=xe.collapsible,vn=xe.accordion,ne=xe.panelKey,wn=xe.extra,fi=xe.header,Rt=xe.expandIcon,Lt=xe.openMotion,Pt=xe.destroyInactivePanel,Nt=xe.children,Zt=(0,jt.Z)(xe,st),Mt=Me==="disabled",Yt=wn!=null&&typeof wn!="boolean",Ge=(0,Pe.Z)((0,Pe.Z)((0,Pe.Z)({onClick:function(){Jt==null||Jt(ne)},onKeyDown:function(Qe){(Qe.key==="Enter"||Qe.keyCode===nt.Z.ENTER||Qe.which===nt.Z.ENTER)&&(Jt==null||Jt(ne))},role:vn?"tab":"button"},"aria-expanded",te),"aria-disabled",Mt),"tabIndex",Mt?-1:0),Oe=typeof Rt=="function"?Rt(xe):Qt.createElement("i",{className:"arrow"}),Ke=Oe&&Qt.createElement("div",(0,gt.Z)({className:"".concat(Kn,"-expand-icon")},["header","icon"].includes(Me)?Ge:{}),Oe),we=Dt()("".concat(Kn,"-item"),(0,Pe.Z)((0,Pe.Z)({},"".concat(Kn,"-item-active"),te),"".concat(Kn,"-item-disabled"),Mt),On),Ce=Dt()(fn,"".concat(Kn,"-header"),(0,Pe.Z)({},"".concat(Kn,"-collapsible-").concat(Me),!!Me),De.header),Fe=(0,se.Z)({className:Ce,style:un.header},["header","icon"].includes(Me)?{}:Ge);return Qt.createElement("div",(0,gt.Z)({},Zt,{ref:Ue,className:we}),Qt.createElement("div",Fe,Je&&Ke,Qt.createElement("span",(0,gt.Z)({className:"".concat(Kn,"-header-text")},Me==="header"?Ge:{}),fi),Yt&&Qt.createElement("div",{className:"".concat(Kn,"-extra")},wn)),Qt.createElement(Bt.default,(0,gt.Z)({visible:te,leavedClassName:"".concat(Kn,"-content-hidden")},Lt,{forceRender:Xe,removeOnLeave:Pt}),function(He,Qe){var hn=He.className,dn=He.style;return Qt.createElement(ht,{ref:Qe,prefixCls:Kn,className:hn,classNames:De,style:dn,styles:un,isActive:te,forceRender:Xe,role:vn?"tabpanel":void 0},Nt)}))}),vt=pt,St=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],Et=function(Ue,je){var Je=je.prefixCls,fn=je.accordion,te=je.collapsible,Jt=je.destroyInactivePanel,Xe=je.onItemClick,On=je.activeKey,bn=je.openMotion,De=je.expandIcon;return Ue.map(function(on,un){var Kn=on.children,Me=on.label,vn=on.key,ne=on.collapsible,wn=on.onItemClick,fi=on.destroyInactivePanel,Rt=(0,jt.Z)(on,St),Lt=String(vn!=null?vn:un),Pt=ne!=null?ne:te,Nt=fi!=null?fi:Jt,Zt=function(Ge){Pt!=="disabled"&&(Xe(Ge),wn==null||wn(Ge))},Mt=!1;return fn?Mt=On[0]===Lt:Mt=On.indexOf(Lt)>-1,Qt.createElement(vt,(0,gt.Z)({},Rt,{prefixCls:Je,key:Lt,panelKey:Lt,isActive:Mt,accordion:fn,openMotion:bn,expandIcon:De,header:Me,collapsible:Pt,onItemClick:Zt,destroyInactivePanel:Nt}),Kn)})},Tt=function(Ue,je,Je){if(!Ue)return null;var fn=Je.prefixCls,te=Je.accordion,Jt=Je.collapsible,Xe=Je.destroyInactivePanel,On=Je.onItemClick,bn=Je.activeKey,De=Je.openMotion,on=Je.expandIcon,un=Ue.key||String(je),Kn=Ue.props,Me=Kn.header,vn=Kn.headerClass,ne=Kn.destroyInactivePanel,wn=Kn.collapsible,fi=Kn.onItemClick,Rt=!1;te?Rt=bn[0]===un:Rt=bn.indexOf(un)>-1;var Lt=wn!=null?wn:Jt,Pt=function(Mt){Lt!=="disabled"&&(On(Mt),fi==null||fi(Mt))},Nt={key:un,panelKey:un,header:Me,headerClass:vn,isActive:Rt,prefixCls:fn,destroyInactivePanel:ne!=null?ne:Xe,openMotion:De,accordion:te,children:Ue.props.children,onItemClick:Pt,expandIcon:on,collapsible:Lt};return typeof Ue.type=="string"?Ue:(Object.keys(Nt).forEach(function(Zt){typeof Nt[Zt]=="undefined"&&delete Nt[Zt]}),Qt.cloneElement(Ue,Nt))};function It(xe,Ue,je){return Array.isArray(xe)?Et(xe,je):(0,Ae.Z)(Ue).map(function(Je,fn){return Tt(Je,fn,je)})}var qt=It,Xt=kt(26112);function Ht(xe){var Ue=xe;if(!Array.isArray(Ue)){var je=(0,Ee.Z)(Ue);Ue=je==="number"||je==="string"?[Ue]:[]}return Ue.map(function(Je){return String(Je)})}var pe=Qt.forwardRef(function(xe,Ue){var je=xe.prefixCls,Je=je===void 0?"rc-collapse":je,fn=xe.destroyInactivePanel,te=fn===void 0?!1:fn,Jt=xe.style,Xe=xe.accordion,On=xe.className,bn=xe.children,De=xe.collapsible,on=xe.openMotion,un=xe.expandIcon,Kn=xe.activeKey,Me=xe.defaultActiveKey,vn=xe.onChange,ne=xe.items,wn=Dt()(Je,On),fi=(0,ee.Z)([],{value:Kn,onChange:function(Yt){return vn==null?void 0:vn(Yt)},defaultValue:Me,postState:Ht}),Rt=(0,ue.Z)(fi,2),Lt=Rt[0],Pt=Rt[1],Nt=function(Yt){return Pt(function(){if(Xe)return Lt[0]===Yt?[]:[Yt];var Ge=Lt.indexOf(Yt),Oe=Ge>-1;return Oe?Lt.filter(function(Ke){return Ke!==Yt}):[].concat((0,Ut.Z)(Lt),[Yt])})};(0,ge.ZP)(!bn,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var Zt=qt(ne,bn,{prefixCls:Je,accordion:Xe,openMotion:on,expandIcon:un,collapsible:De,destroyInactivePanel:te,onItemClick:Nt,activeKey:Lt});return Qt.createElement("div",(0,gt.Z)({ref:Ue,className:wn,style:Jt,role:Xe?"tablist":void 0},(0,Xt.Z)(xe,{aria:!0,data:!0})),Zt)}),re=Object.assign(pe,{Panel:vt}),Ne=re,ye=re.Panel},23425:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return It}});var gt=kt(4635),Ut=kt(14809),ue=kt(93664),Ee=kt(20439),he=kt(50298),Dt=kt(92310),ee=kt.n(Dt),ge=kt(18929),Qt=kt(10228),jt=kt(26112),Ae=kt(48736),se=kt(59301),Pe=kt(17119),Bt=[10,20,50,100],nt=function(Xt){var Ht=Xt.pageSizeOptions,pe=Ht===void 0?Bt:Ht,re=Xt.locale,Ne=Xt.changeSize,ye=Xt.pageSize,xe=Xt.goButton,Ue=Xt.quickGo,je=Xt.rootPrefixCls,Je=Xt.disabled,fn=Xt.buildOptionText,te=Xt.showSizeChanger,Jt=Xt.sizeChangerRender,Xe=se.useState(""),On=(0,he.Z)(Xe,2),bn=On[0],De=On[1],on=function(){return!bn||Number.isNaN(bn)?void 0:Number(bn)},un=typeof fn=="function"?fn:function(Pt){return"".concat(Pt," ").concat(re.items_per_page)},Kn=function(Nt){De(Nt.target.value)},Me=function(Nt){xe||bn===""||(De(""),!(Nt.relatedTarget&&(Nt.relatedTarget.className.indexOf("".concat(je,"-item-link"))>=0||Nt.relatedTarget.className.indexOf("".concat(je,"-item"))>=0))&&(Ue==null||Ue(on())))},vn=function(Nt){bn!==""&&(Nt.keyCode===Qt.Z.ENTER||Nt.type==="click")&&(De(""),Ue==null||Ue(on()))},ne=function(){return pe.some(function(Nt){return Nt.toString()===ye.toString()})?pe:pe.concat([ye]).sort(function(Nt,Zt){var Mt=Number.isNaN(Number(Nt))?0:Number(Nt),Yt=Number.isNaN(Number(Zt))?0:Number(Zt);return Mt-Yt})},wn="".concat(je,"-options");if(!te&&!Ue)return null;var fi=null,Rt=null,Lt=null;return te&&Jt&&(fi=Jt({disabled:Je,size:ye,onSizeChange:function(Nt){Ne==null||Ne(Number(Nt))},"aria-label":re.page_size,className:"".concat(wn,"-size-changer"),options:ne().map(function(Pt){return{label:un(Pt),value:Pt}})})),Ue&&(xe&&(Lt=typeof xe=="boolean"?se.createElement("button",{type:"button",onClick:vn,onKeyUp:vn,disabled:Je,className:"".concat(wn,"-quick-jumper-button")},re.jump_to_confirm):se.createElement("span",{onClick:vn,onKeyUp:vn},xe)),Rt=se.createElement("div",{className:"".concat(wn,"-quick-jumper")},re.jump_to,se.createElement("input",{disabled:Je,type:"text",value:bn,onChange:Kn,onKeyUp:vn,onBlur:Me,"aria-label":re.page}),re.page,Lt)),se.createElement("li",{className:wn},fi,Rt)},et=nt,ht=function(Xt){var Ht=Xt.rootPrefixCls,pe=Xt.page,re=Xt.active,Ne=Xt.className,ye=Xt.showTitle,xe=Xt.onClick,Ue=Xt.onKeyPress,je=Xt.itemRender,Je="".concat(Ht,"-item"),fn=ee()(Je,"".concat(Je,"-").concat(pe),(0,gt.Z)((0,gt.Z)({},"".concat(Je,"-active"),re),"".concat(Je,"-disabled"),!pe),Ne),te=function(){xe(pe)},Jt=function(bn){Ue(bn,xe,pe)},Xe=je(pe,"page",se.createElement("a",{rel:"nofollow"},pe));return Xe?se.createElement("li",{title:ye?String(pe):null,className:fn,onClick:te,onKeyDown:Jt,tabIndex:0},Xe):null},st=ht,pt=function(Xt,Ht,pe){return pe};function vt(){}function St(qt){var Xt=Number(qt);return typeof Xt=="number"&&!Number.isNaN(Xt)&&isFinite(Xt)&&Math.floor(Xt)===Xt}function Et(qt,Xt,Ht){var pe=typeof qt=="undefined"?Xt:qt;return Math.floor((Ht-1)/pe)+1}var Tt=function(Xt){var Ht=Xt.prefixCls,pe=Ht===void 0?"rc-pagination":Ht,re=Xt.selectPrefixCls,Ne=re===void 0?"rc-select":re,ye=Xt.className,xe=Xt.current,Ue=Xt.defaultCurrent,je=Ue===void 0?1:Ue,Je=Xt.total,fn=Je===void 0?0:Je,te=Xt.pageSize,Jt=Xt.defaultPageSize,Xe=Jt===void 0?10:Jt,On=Xt.onChange,bn=On===void 0?vt:On,De=Xt.hideOnSinglePage,on=Xt.align,un=Xt.showPrevNextJumpers,Kn=un===void 0?!0:un,Me=Xt.showQuickJumper,vn=Xt.showLessItems,ne=Xt.showTitle,wn=ne===void 0?!0:ne,fi=Xt.onShowSizeChange,Rt=fi===void 0?vt:fi,Lt=Xt.locale,Pt=Lt===void 0?Pe.Z:Lt,Nt=Xt.style,Zt=Xt.totalBoundaryShowSizeChanger,Mt=Zt===void 0?50:Zt,Yt=Xt.disabled,Ge=Xt.simple,Oe=Xt.showTotal,Ke=Xt.showSizeChanger,we=Ke===void 0?fn>Mt:Ke,Ce=Xt.sizeChangerRender,Fe=Xt.pageSizeOptions,He=Xt.itemRender,Qe=He===void 0?pt:He,hn=Xt.jumpPrevIcon,dn=Xt.jumpNextIcon,ri=Xt.prevIcon,ze=Xt.nextIcon,We=se.useRef(null),an=(0,ge.Z)(10,{value:te,defaultValue:Xe}),Xn=(0,he.Z)(an,2),pn=Xn[0],rn=Xn[1],In=(0,ge.Z)(1,{value:xe,defaultValue:je,postState:function(Kr){return Math.max(1,Math.min(Kr,Et(void 0,pn,fn)))}}),pi=(0,he.Z)(In,2),ei=pi[0],mi=pi[1],Hi=se.useState(ei),Cn=(0,he.Z)(Hi,2),Sn=Cn[0],Bn=Cn[1];(0,se.useEffect)(function(){Bn(ei)},[ei]);var si=bn!==vt,yi="current"in Xt,hi=Math.max(1,ei-(vn?3:5)),Gi=Math.min(Et(void 0,pn,fn),ei+(vn?3:5));function wt(Wi,Kr){var zi=Wi||se.createElement("button",{type:"button","aria-label":Kr,className:"".concat(pe,"-item-link")});return typeof Wi=="function"&&(zi=se.createElement(Wi,(0,Ee.Z)({},Xt))),zi}function Ye(Wi){var Kr=Wi.target.value,zi=Et(void 0,pn,fn),wo;return Kr===""?wo=Kr:Number.isNaN(Number(Kr))?wo=Sn:Kr>=zi?wo=zi:wo=Number(Kr),wo}function Zn(Wi){return St(Wi)&&Wi!==ei&&St(fn)&&fn>0}var Ln=fn>pn?Me:!1;function zn(Wi){(Wi.keyCode===Qt.Z.UP||Wi.keyCode===Qt.Z.DOWN)&&Wi.preventDefault()}function oi(Wi){var Kr=Ye(Wi);switch(Kr!==Sn&&Bn(Kr),Wi.keyCode){case Qt.Z.ENTER:Fi(Kr);break;case Qt.Z.UP:Fi(Kr-1);break;case Qt.Z.DOWN:Fi(Kr+1);break;default:break}}function Si(Wi){Fi(Ye(Wi))}function Yi(Wi){var Kr=Et(Wi,pn,fn),zi=ei>Kr&&Kr!==0?Kr:ei;rn(Wi),Bn(zi),Rt==null||Rt(ei,Wi),mi(zi),bn==null||bn(zi,Wi)}function Fi(Wi){if(Zn(Wi)&&!Yt){var Kr=Et(void 0,pn,fn),zi=Wi;return Wi>Kr?zi=Kr:Wi<1&&(zi=1),zi!==Sn&&Bn(zi),mi(zi),bn==null||bn(zi,pn),zi}return ei}var ve=ei>1,Le=ei<Et(void 0,pn,fn);function Se(){ve&&Fi(ei-1)}function ti(){Le&&Fi(ei+1)}function Yn(){Fi(hi)}function Wn(){Fi(Gi)}function qe(Wi,Kr){if(Wi.key==="Enter"||Wi.charCode===Qt.Z.ENTER||Wi.keyCode===Qt.Z.ENTER){for(var zi=arguments.length,wo=new Array(zi>2?zi-2:0),Yr=2;Yr<zi;Yr++)wo[Yr-2]=arguments[Yr];Kr.apply(void 0,wo)}}function Dn(Wi){qe(Wi,Se)}function ki(Wi){qe(Wi,ti)}function Di(Wi){qe(Wi,Yn)}function Ki(Wi){qe(Wi,Wn)}function Gt(Wi){var Kr=Qe(Wi,"prev",wt(ri,"prev page"));return se.isValidElement(Kr)?se.cloneElement(Kr,{disabled:!ve}):Kr}function me(Wi){var Kr=Qe(Wi,"next",wt(ze,"next page"));return se.isValidElement(Kr)?se.cloneElement(Kr,{disabled:!Le}):Kr}function En(Wi){(Wi.type==="click"||Wi.keyCode===Qt.Z.ENTER)&&Fi(Sn)}var Gn=null,Re=(0,jt.Z)(Xt,{aria:!0,data:!0}),$e=Oe&&se.createElement("li",{className:"".concat(pe,"-total-text")},Oe(fn,[fn===0?0:(ei-1)*pn+1,ei*pn>fn?fn:ei*pn])),Nn=null,_n=Et(void 0,pn,fn);if(De&&fn<=pn)return null;var di=[],Jn={rootPrefixCls:pe,onClick:Fi,onKeyPress:qe,showTitle:wn,itemRender:Qe,page:-1},li=ei-1>0?ei-1:0,ni=ei+1<_n?ei+1:_n,ji=Me&&Me.goButton,Oi=(0,ue.Z)(Ge)==="object"?Ge.readOnly:!Ge,Ii=ji,Ve=null;Ge&&(ji&&(typeof ji=="boolean"?Ii=se.createElement("button",{type:"button",onClick:En,onKeyUp:En},Pt.jump_to_confirm):Ii=se.createElement("span",{onClick:En,onKeyUp:En},ji),Ii=se.createElement("li",{title:wn?"".concat(Pt.jump_to).concat(ei,"/").concat(_n):null,className:"".concat(pe,"-simple-pager")},Ii)),Ve=se.createElement("li",{title:wn?"".concat(ei,"/").concat(_n):null,className:"".concat(pe,"-simple-pager")},Oi?Sn:se.createElement("input",{type:"text","aria-label":Pt.jump_to,value:Sn,disabled:Yt,onKeyDown:zn,onKeyUp:oi,onChange:oi,onBlur:Si,size:3}),se.createElement("span",{className:"".concat(pe,"-slash")},"/"),_n));var vr=vn?1:2;if(_n<=3+vr*2){_n||di.push(se.createElement(st,(0,Ut.Z)({},Jn,{key:"noPager",page:1,className:"".concat(pe,"-item-disabled")})));for(var Mr=1;Mr<=_n;Mr+=1)di.push(se.createElement(st,(0,Ut.Z)({},Jn,{key:Mr,page:Mr,active:ei===Mr})))}else{var ro=vn?Pt.prev_3:Pt.prev_5,en=vn?Pt.next_3:Pt.next_5,Tn=Qe(hi,"jump-prev",wt(hn,"prev page")),Bi=Qe(Gi,"jump-next",wt(dn,"next page"));Kn&&(Gn=Tn?se.createElement("li",{title:wn?ro:null,key:"prev",onClick:Yn,tabIndex:0,onKeyDown:Di,className:ee()("".concat(pe,"-jump-prev"),(0,gt.Z)({},"".concat(pe,"-jump-prev-custom-icon"),!!hn))},Tn):null,Nn=Bi?se.createElement("li",{title:wn?en:null,key:"next",onClick:Wn,tabIndex:0,onKeyDown:Ki,className:ee()("".concat(pe,"-jump-next"),(0,gt.Z)({},"".concat(pe,"-jump-next-custom-icon"),!!dn))},Bi):null);var bi=Math.max(1,ei-vr),_i=Math.min(ei+vr,_n);ei-1<=vr&&(_i=1+vr*2),_n-ei<=vr&&(bi=_n-vr*2);for(var ir=bi;ir<=_i;ir+=1)di.push(se.createElement(st,(0,Ut.Z)({},Jn,{key:ir,page:ir,active:ei===ir})));if(ei-1>=vr*2&&ei!==3&&(di[0]=se.cloneElement(di[0],{className:ee()("".concat(pe,"-item-after-jump-prev"),di[0].props.className)}),di.unshift(Gn)),_n-ei>=vr*2&&ei!==_n-2){var yr=di[di.length-1];di[di.length-1]=se.cloneElement(yr,{className:ee()("".concat(pe,"-item-before-jump-next"),yr.props.className)}),di.push(Nn)}bi!==1&&di.unshift(se.createElement(st,(0,Ut.Z)({},Jn,{key:1,page:1}))),_i!==_n&&di.push(se.createElement(st,(0,Ut.Z)({},Jn,{key:_n,page:_n})))}var Nr=Gt(li);if(Nr){var _r=!ve||!_n;Nr=se.createElement("li",{title:wn?Pt.prev_page:null,onClick:Se,tabIndex:_r?null:0,onKeyDown:Dn,className:ee()("".concat(pe,"-prev"),(0,gt.Z)({},"".concat(pe,"-disabled"),_r)),"aria-disabled":_r},Nr)}var Rr=me(ni);if(Rr){var cn,ho;Ge?(cn=!Le,ho=ve?0:null):(cn=!Le||!_n,ho=cn?null:0),Rr=se.createElement("li",{title:wn?Pt.next_page:null,onClick:ti,tabIndex:ho,onKeyDown:ki,className:ee()("".concat(pe,"-next"),(0,gt.Z)({},"".concat(pe,"-disabled"),cn)),"aria-disabled":cn},Rr)}var gn=ee()(pe,ye,(0,gt.Z)((0,gt.Z)((0,gt.Z)((0,gt.Z)((0,gt.Z)({},"".concat(pe,"-start"),on==="start"),"".concat(pe,"-center"),on==="center"),"".concat(pe,"-end"),on==="end"),"".concat(pe,"-simple"),Ge),"".concat(pe,"-disabled"),Yt));return se.createElement("ul",(0,Ut.Z)({className:gn,style:Nt,ref:We},Re),$e,Nr,Ge?Ve:di,Rr,se.createElement(et,{locale:Pt,rootPrefixCls:pe,disabled:Yt,selectPrefixCls:Ne,changeSize:Yi,pageSize:pn,pageSizeOptions:Fe,quickGo:Ln?Fi:null,goButton:Ii,showSizeChanger:we,sizeChangerRender:Ce}))},It=Tt},738:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return vt}});var gt=kt(14809),Ut=kt(4635),ue=kt(50298),Ee=kt(62646),he=kt(92310),Dt=kt.n(he),ee=kt(18929),ge=kt(10228),Qt=kt(26112),jt=kt(59301);function Ae(St,Et){var Tt=St.disabled,It=St.prefixCls,qt=St.character,Xt=St.characterRender,Ht=St.index,pe=St.count,re=St.value,Ne=St.allowHalf,ye=St.focused,xe=St.onHover,Ue=St.onClick,je=function(De){xe(De,Ht)},Je=function(De){Ue(De,Ht)},fn=function(De){De.keyCode===ge.Z.ENTER&&Ue(De,Ht)},te=Ht+1,Jt=new Set([It]);re===0&&Ht===0&&ye?Jt.add("".concat(It,"-focused")):Ne&&re+.5>=te&&re<te?(Jt.add("".concat(It,"-half")),Jt.add("".concat(It,"-active")),ye&&Jt.add("".concat(It,"-focused"))):(te<=re?Jt.add("".concat(It,"-full")):Jt.add("".concat(It,"-zero")),te===re&&ye&&Jt.add("".concat(It,"-focused")));var Xe=typeof qt=="function"?qt(St):qt,On=jt.createElement("li",{className:Dt()(Array.from(Jt)),ref:Et},jt.createElement("div",{onClick:Tt?null:Je,onKeyDown:Tt?null:fn,onMouseMove:Tt?null:je,role:"radio","aria-checked":re>Ht?"true":"false","aria-posinset":Ht+1,"aria-setsize":pe,tabIndex:Tt?-1:0},jt.createElement("div",{className:"".concat(It,"-first")},Xe),jt.createElement("div",{className:"".concat(It,"-second")},Xe)));return Xt&&(On=Xt(On,St)),On}var se=jt.forwardRef(Ae);function Pe(){var St=jt.useRef({});function Et(It){return St.current[It]}function Tt(It){return function(qt){St.current[It]=qt}}return[Et,Tt]}function Bt(St){var Et=St.pageXOffset,Tt="scrollLeft";if(typeof Et!="number"){var It=St.document;Et=It.documentElement[Tt],typeof Et!="number"&&(Et=It.body[Tt])}return Et}function nt(St){var Et,Tt,It=St.ownerDocument,qt=It.body,Xt=It&&It.documentElement,Ht=St.getBoundingClientRect();return Et=Ht.left,Tt=Ht.top,Et-=Xt.clientLeft||qt.clientLeft||0,Tt-=Xt.clientTop||qt.clientTop||0,{left:Et,top:Tt}}function et(St){var Et=nt(St),Tt=St.ownerDocument,It=Tt.defaultView||Tt.parentWindow;return Et.left+=Bt(It),Et.left}var ht=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function st(St,Et){var Tt=St.prefixCls,It=Tt===void 0?"rc-rate":Tt,qt=St.className,Xt=St.defaultValue,Ht=St.value,pe=St.count,re=pe===void 0?5:pe,Ne=St.allowHalf,ye=Ne===void 0?!1:Ne,xe=St.allowClear,Ue=xe===void 0?!0:xe,je=St.keyboard,Je=je===void 0?!0:je,fn=St.character,te=fn===void 0?"\u2605":fn,Jt=St.characterRender,Xe=St.disabled,On=St.direction,bn=On===void 0?"ltr":On,De=St.tabIndex,on=De===void 0?0:De,un=St.autoFocus,Kn=St.onHoverChange,Me=St.onChange,vn=St.onFocus,ne=St.onBlur,wn=St.onKeyDown,fi=St.onMouseLeave,Rt=(0,Ee.Z)(St,ht),Lt=Pe(),Pt=(0,ue.Z)(Lt,2),Nt=Pt[0],Zt=Pt[1],Mt=jt.useRef(null),Yt=function(){if(!Xe){var hi;(hi=Mt.current)===null||hi===void 0||hi.focus()}};jt.useImperativeHandle(Et,function(){return{focus:Yt,blur:function(){if(!Xe){var hi;(hi=Mt.current)===null||hi===void 0||hi.blur()}}}});var Ge=(0,ee.Z)(Xt||0,{value:Ht}),Oe=(0,ue.Z)(Ge,2),Ke=Oe[0],we=Oe[1],Ce=(0,ee.Z)(null),Fe=(0,ue.Z)(Ce,2),He=Fe[0],Qe=Fe[1],hn=function(hi,Gi){var wt=bn==="rtl",Ye=hi+1;if(ye){var Zn=Nt(hi),Ln=et(Zn),zn=Zn.clientWidth;(wt&&Gi-Ln>zn/2||!wt&&Gi-Ln<zn/2)&&(Ye-=.5)}return Ye},dn=function(hi){we(hi),Me==null||Me(hi)},ri=jt.useState(!1),ze=(0,ue.Z)(ri,2),We=ze[0],an=ze[1],Xn=function(){an(!0),vn==null||vn()},pn=function(){an(!1),ne==null||ne()},rn=jt.useState(null),In=(0,ue.Z)(rn,2),pi=In[0],ei=In[1],mi=function(hi,Gi){var wt=hn(Gi,hi.pageX);wt!==He&&(ei(wt),Qe(null)),Kn==null||Kn(wt)},Hi=function(hi){Xe||(ei(null),Qe(null),Kn==null||Kn(void 0)),hi&&(fi==null||fi(hi))},Cn=function(hi,Gi){var wt=hn(Gi,hi.pageX),Ye=!1;Ue&&(Ye=wt===Ke),Hi(),dn(Ye?0:wt),Qe(Ye?wt:null)},Sn=function(hi){var Gi=hi.keyCode,wt=bn==="rtl",Ye=ye?.5:1;Je&&(Gi===ge.Z.RIGHT&&Ke<re&&!wt?(dn(Ke+Ye),hi.preventDefault()):Gi===ge.Z.LEFT&&Ke>0&&!wt||Gi===ge.Z.RIGHT&&Ke>0&&wt?(dn(Ke-Ye),hi.preventDefault()):Gi===ge.Z.LEFT&&Ke<re&&wt&&(dn(Ke+Ye),hi.preventDefault())),wn==null||wn(hi)};jt.useEffect(function(){un&&!Xe&&Yt()},[]);var Bn=new Array(re).fill(0).map(function(yi,hi){return jt.createElement(se,{ref:Zt(hi),index:hi,count:re,disabled:Xe,prefixCls:"".concat(It,"-star"),allowHalf:ye,value:pi===null?Ke:pi,onClick:Cn,onHover:mi,key:yi||hi,character:te,characterRender:Jt,focused:We})}),si=Dt()(It,qt,(0,Ut.Z)((0,Ut.Z)({},"".concat(It,"-disabled"),Xe),"".concat(It,"-rtl"),bn==="rtl"));return jt.createElement("ul",(0,gt.Z)({className:si,onMouseLeave:Hi,tabIndex:Xe?-1:on,onFocus:Xe?null:Xn,onBlur:Xe?null:pn,onKeyDown:Xe?null:Sn,ref:Mt},(0,Qt.Z)(Rt,{aria:!0,data:!0,attr:!0})),Bn)}var pt=jt.forwardRef(st),vt=pt},6551:function(Mn,Rn,kt){"use strict";kt.d(Rn,{ZP:function(){return ee}});var gt=kt(50298),Ut=kt(59301),ue=kt(47273),Ee=0,he=(0,ue.Z)();function Dt(){var ge;return he?(ge=Ee,Ee+=1):ge="TEST_OR_SSR",ge}function ee(ge){var Qt=Ut.useState(),jt=(0,gt.Z)(Qt,2),Ae=jt[0],se=jt[1];return Ut.useEffect(function(){se("rc_select_".concat(Dt()))},[]),ge||Ae}},37463:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Ac:function(){return an},Xo:function(){return pn},Wx:function(){return In},ZP:function(){return Ki},lk:function(){return vt}});var gt=kt(14809),Ut=kt(95190),ue=kt(4635),Ee=kt(20439),he=kt(50298),Dt=kt(62646),ee=kt(93664),ge=kt(18929),Qt=kt(48736),jt=kt(59301),Ae=kt(92310),se=kt.n(Ae),Pe=kt(34280),Bt=kt(49658),nt=kt(8654),et=function(me){var En=me.className,Gn=me.customizeIcon,Re=me.customizeIconProps,$e=me.children,Nn=me.onMouseDown,_n=me.onClick,di=typeof Gn=="function"?Gn(Re):Gn;return jt.createElement("span",{className:En,onMouseDown:function(li){li.preventDefault(),Nn==null||Nn(li)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:_n,"aria-hidden":!0},di!==void 0?di:jt.createElement("span",{className:se()(En.split(/\s+/).map(function(Jn){return"".concat(Jn,"-icon")}))},$e))},ht=et,st=function(me,En,Gn,Re,$e){var Nn=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,_n=arguments.length>6?arguments[6]:void 0,di=arguments.length>7?arguments[7]:void 0,Jn=jt.useMemo(function(){if((0,ee.Z)(Re)==="object")return Re.clearIcon;if($e)return $e},[Re,$e]),li=jt.useMemo(function(){return!!(!Nn&&Re&&(Gn.length||_n)&&!(di==="combobox"&&_n===""))},[Re,Nn,Gn.length,_n,di]);return{allowClear:li,clearIcon:jt.createElement(ht,{className:"".concat(me,"-clear"),onMouseDown:En,customizeIcon:Jn},"\xD7")}},pt=jt.createContext(null);function vt(){return jt.useContext(pt)}function St(){var Gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,me=jt.useState(!1),En=(0,he.Z)(me,2),Gn=En[0],Re=En[1],$e=jt.useRef(null),Nn=function(){window.clearTimeout($e.current)};jt.useEffect(function(){return Nn},[]);var _n=function(Jn,li){Nn(),$e.current=window.setTimeout(function(){Re(Jn),li&&li()},Gt)};return[Gn,_n,Nn]}function Et(){var Gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,me=jt.useRef(null),En=jt.useRef(null);jt.useEffect(function(){return function(){window.clearTimeout(En.current)}},[]);function Gn(Re){(Re||me.current===null)&&(me.current=Re),window.clearTimeout(En.current),En.current=window.setTimeout(function(){me.current=null},Gt)}return[function(){return me.current},Gn]}function Tt(Gt,me,En,Gn){var Re=jt.useRef(null);Re.current={open:me,triggerOpen:En,customizedTrigger:Gn},jt.useEffect(function(){function $e(Nn){var _n;if(!((_n=Re.current)!==null&&_n!==void 0&&_n.customizedTrigger)){var di=Nn.target;di.shadowRoot&&Nn.composed&&(di=Nn.composedPath()[0]||di),Re.current.open&&Gt().filter(function(Jn){return Jn}).every(function(Jn){return!Jn.contains(di)&&Jn!==di})&&Re.current.triggerOpen(!1)}}return window.addEventListener("mousedown",$e),function(){return window.removeEventListener("mousedown",$e)}},[])}var It=kt(10228);function qt(Gt){return Gt&&![It.Z.ESC,It.Z.SHIFT,It.Z.BACKSPACE,It.Z.TAB,It.Z.WIN_KEY,It.Z.ALT,It.Z.META,It.Z.WIN_KEY_RIGHT,It.Z.CTRL,It.Z.SEMICOLON,It.Z.EQUALS,It.Z.CAPS_LOCK,It.Z.CONTEXT_MENU,It.Z.F1,It.Z.F2,It.Z.F3,It.Z.F4,It.Z.F5,It.Z.F6,It.Z.F7,It.Z.F8,It.Z.F9,It.Z.F10,It.Z.F11,It.Z.F12].includes(Gt)}var Xt=kt(26112),Ht=kt(11780);function pe(Gt,me,En){var Gn=(0,Ee.Z)((0,Ee.Z)({},Gt),En?me:{});return Object.keys(me).forEach(function(Re){var $e=me[Re];typeof $e=="function"&&(Gn[Re]=function(){for(var Nn,_n=arguments.length,di=new Array(_n),Jn=0;Jn<_n;Jn++)di[Jn]=arguments[Jn];return $e.apply(void 0,di),(Nn=Gt[Re])===null||Nn===void 0?void 0:Nn.call.apply(Nn,[Gt].concat(di))})}),Gn}var re=pe,Ne=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],ye=function(me,En){var Gn=me.prefixCls,Re=me.id,$e=me.inputElement,Nn=me.autoFocus,_n=me.autoComplete,di=me.editable,Jn=me.activeDescendantId,li=me.value,ni=me.open,ji=me.attrs,Oi=(0,Dt.Z)(me,Ne),Ii=$e||jt.createElement("input",null),Ve=Ii,vr=Ve.ref,Mr=Ve.props;return(0,Qt.Kp)(!("maxLength"in Ii.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Ii=jt.cloneElement(Ii,(0,Ee.Z)((0,Ee.Z)((0,Ee.Z)({type:"search"},re(Oi,Mr,!0)),{},{id:Re,ref:(0,nt.sQ)(En,vr),autoComplete:_n||"off",autoFocus:Nn,className:se()("".concat(Gn,"-selection-search-input"),Mr==null?void 0:Mr.className),role:"combobox","aria-expanded":ni||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Re,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Re,"_list"),"aria-activedescendant":ni?Jn:void 0},ji),{},{value:di?li:"",readOnly:!di,unselectable:di?null:"on",style:(0,Ee.Z)((0,Ee.Z)({},Mr.style),{},{opacity:di?null:0})})),Ii},xe=jt.forwardRef(ye),Ue=xe;function je(Gt){return Array.isArray(Gt)?Gt:Gt!==void 0?[Gt]:[]}var Je=typeof window!="undefined"&&window.document&&window.document.documentElement,fn=Je;function te(Gt){return Gt!=null}function Jt(Gt){return!Gt&&Gt!==0}function Xe(Gt){return["string","number"].includes((0,ee.Z)(Gt))}function On(Gt){var me=void 0;return Gt&&(Xe(Gt.title)?me=Gt.title.toString():Xe(Gt.label)&&(me=Gt.label.toString())),me}function bn(Gt,me){fn?jt.useLayoutEffect(Gt,me):jt.useEffect(Gt,me)}function De(Gt){var me;return(me=Gt.key)!==null&&me!==void 0?me:Gt.value}var on=function(me){me.preventDefault(),me.stopPropagation()},un=function(me){var En=me.id,Gn=me.prefixCls,Re=me.values,$e=me.open,Nn=me.searchValue,_n=me.autoClearSearchValue,di=me.inputRef,Jn=me.placeholder,li=me.disabled,ni=me.mode,ji=me.showSearch,Oi=me.autoFocus,Ii=me.autoComplete,Ve=me.activeDescendantId,vr=me.tabIndex,Mr=me.removeIcon,ro=me.maxTagCount,en=me.maxTagTextLength,Tn=me.maxTagPlaceholder,Bi=Tn===void 0?function($n){return"+ ".concat($n.length," ...")}:Tn,bi=me.tagRender,_i=me.onToggleOpen,ir=me.onRemove,yr=me.onInputChange,Nr=me.onInputPaste,_r=me.onInputKeyDown,Rr=me.onInputMouseDown,cn=me.onInputCompositionStart,ho=me.onInputCompositionEnd,gn=me.onInputBlur,Wi=jt.useRef(null),Kr=(0,jt.useState)(0),zi=(0,he.Z)(Kr,2),wo=zi[0],Yr=zi[1],Er=(0,jt.useState)(!1),Co=(0,he.Z)(Er,2),_e=Co[0],xn=Co[1],Be="".concat(Gn,"-selection"),At=$e||ni==="multiple"&&_n===!1||ni==="tags"?Nn:"",jn=ni==="tags"||ni==="multiple"&&_n===!1||ji&&($e||_e);bn(function(){Yr(Wi.current.scrollWidth)},[At]);var Qn=function(An,Un,Ti,vi,ii){return jt.createElement("span",{title:On(An),className:se()("".concat(Be,"-item"),(0,ue.Z)({},"".concat(Be,"-item-disabled"),Ti))},jt.createElement("span",{className:"".concat(Be,"-item-content")},Un),vi&&jt.createElement(ht,{className:"".concat(Be,"-item-remove"),onMouseDown:on,onClick:ii,customizeIcon:Mr},"\xD7"))},Li=function(An,Un,Ti,vi,ii,nn){var Ni=function(Or){on(Or),_i(!$e)};return jt.createElement("span",{onMouseDown:Ni},bi({label:Un,value:An,disabled:Ti,closable:vi,onClose:ii,isMaxTag:!!nn}))},xi=function(An){var Un=An.disabled,Ti=An.label,vi=An.value,ii=!li&&!Un,nn=Ti;if(typeof en=="number"&&(typeof Ti=="string"||typeof Ti=="number")){var Ni=String(nn);Ni.length>en&&(nn="".concat(Ni.slice(0,en),"..."))}var Xi=function(cr){cr&&cr.stopPropagation(),ir(An)};return typeof bi=="function"?Li(vi,nn,Un,ii,Xi):Qn(An,nn,Un,ii,Xi)},ui=function(An){if(!Re.length)return null;var Un=typeof Bi=="function"?Bi(An):Bi;return typeof bi=="function"?Li(void 0,Un,!1,!1,void 0,!0):Qn({title:Un},Un,!1)},mn=jt.createElement("div",{className:"".concat(Be,"-search"),style:{width:wo},onFocus:function(){xn(!0)},onBlur:function(){xn(!1)}},jt.createElement(Ue,{ref:di,open:$e,prefixCls:Gn,id:En,inputElement:null,disabled:li,autoFocus:Oi,autoComplete:Ii,editable:jn,activeDescendantId:Ve,value:At,onKeyDown:_r,onMouseDown:Rr,onChange:yr,onPaste:Nr,onCompositionStart:cn,onCompositionEnd:ho,onBlur:gn,tabIndex:vr,attrs:(0,Xt.Z)(me,!0)}),jt.createElement("span",{ref:Wi,className:"".concat(Be,"-search-mirror"),"aria-hidden":!0},At,"\xA0")),Vn=jt.createElement(Ht.Z,{prefixCls:"".concat(Be,"-overflow"),data:Re,renderItem:xi,renderRest:ui,suffix:mn,itemKey:De,maxCount:ro});return jt.createElement("span",{className:"".concat(Be,"-wrap")},Vn,!Re.length&&!At&&jt.createElement("span",{className:"".concat(Be,"-placeholder")},Jn))},Kn=un,Me=function(me){var En=me.inputElement,Gn=me.prefixCls,Re=me.id,$e=me.inputRef,Nn=me.disabled,_n=me.autoFocus,di=me.autoComplete,Jn=me.activeDescendantId,li=me.mode,ni=me.open,ji=me.values,Oi=me.placeholder,Ii=me.tabIndex,Ve=me.showSearch,vr=me.searchValue,Mr=me.activeValue,ro=me.maxLength,en=me.onInputKeyDown,Tn=me.onInputMouseDown,Bi=me.onInputChange,bi=me.onInputPaste,_i=me.onInputCompositionStart,ir=me.onInputCompositionEnd,yr=me.onInputBlur,Nr=me.title,_r=jt.useState(!1),Rr=(0,he.Z)(_r,2),cn=Rr[0],ho=Rr[1],gn=li==="combobox",Wi=gn||Ve,Kr=ji[0],zi=vr||"";gn&&Mr&&!cn&&(zi=Mr),jt.useEffect(function(){gn&&ho(!1)},[gn,Mr]);var wo=li!=="combobox"&&!ni&&!Ve?!1:!!zi,Yr=Nr===void 0?On(Kr):Nr,Er=jt.useMemo(function(){return Kr?null:jt.createElement("span",{className:"".concat(Gn,"-selection-placeholder"),style:wo?{visibility:"hidden"}:void 0},Oi)},[Kr,wo,Oi,Gn]);return jt.createElement("span",{className:"".concat(Gn,"-selection-wrap")},jt.createElement("span",{className:"".concat(Gn,"-selection-search")},jt.createElement(Ue,{ref:$e,prefixCls:Gn,id:Re,open:ni,inputElement:En,disabled:Nn,autoFocus:_n,autoComplete:di,editable:Wi,activeDescendantId:Jn,value:zi,onKeyDown:en,onMouseDown:Tn,onChange:function(_e){ho(!0),Bi(_e)},onPaste:bi,onCompositionStart:_i,onCompositionEnd:ir,onBlur:yr,tabIndex:Ii,attrs:(0,Xt.Z)(me,!0),maxLength:gn?ro:void 0})),!gn&&Kr?jt.createElement("span",{className:"".concat(Gn,"-selection-item"),title:Yr,style:wo?{visibility:"hidden"}:void 0},Kr.label):null,Er)},vn=Me,ne=function(me,En){var Gn=(0,jt.useRef)(null),Re=(0,jt.useRef)(!1),$e=me.prefixCls,Nn=me.open,_n=me.mode,di=me.showSearch,Jn=me.tokenWithEnter,li=me.disabled,ni=me.prefix,ji=me.autoClearSearchValue,Oi=me.onSearch,Ii=me.onSearchSubmit,Ve=me.onToggleOpen,vr=me.onInputKeyDown,Mr=me.onInputBlur,ro=me.domRef;jt.useImperativeHandle(En,function(){return{focus:function(Yr){Gn.current.focus(Yr)},blur:function(){Gn.current.blur()}}});var en=Et(0),Tn=(0,he.Z)(en,2),Bi=Tn[0],bi=Tn[1],_i=function(Yr){var Er=Yr.which,Co=Gn.current instanceof HTMLTextAreaElement;!Co&&Nn&&(Er===It.Z.UP||Er===It.Z.DOWN)&&Yr.preventDefault(),vr&&vr(Yr),Er===It.Z.ENTER&&_n==="tags"&&!Re.current&&!Nn&&(Ii==null||Ii(Yr.target.value)),!(Co&&!Nn&&~[It.Z.UP,It.Z.DOWN,It.Z.LEFT,It.Z.RIGHT].indexOf(Er))&&qt(Er)&&Ve(!0)},ir=function(){bi(!0)},yr=(0,jt.useRef)(null),Nr=function(Yr){Oi(Yr,!0,Re.current)!==!1&&Ve(!0)},_r=function(){Re.current=!0},Rr=function(Yr){Re.current=!1,_n!=="combobox"&&Nr(Yr.target.value)},cn=function(Yr){var Er=Yr.target.value;if(Jn&&yr.current&&/[\r\n]/.test(yr.current)){var Co=yr.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Er=Er.replace(Co,yr.current)}yr.current=null,Nr(Er)},ho=function(Yr){var Er=Yr.clipboardData,Co=Er==null?void 0:Er.getData("text");yr.current=Co||""},gn=function(Yr){var Er=Yr.target;if(Er!==Gn.current){var Co=document.body.style.msTouchAction!==void 0;Co?setTimeout(function(){Gn.current.focus()}):Gn.current.focus()}},Wi=function(Yr){var Er=Bi();Yr.target!==Gn.current&&!Er&&!(_n==="combobox"&&li)&&Yr.preventDefault(),(_n!=="combobox"&&(!di||!Er)||!Nn)&&(Nn&&ji!==!1&&Oi("",!0,!1),Ve())},Kr={inputRef:Gn,onInputKeyDown:_i,onInputMouseDown:ir,onInputChange:cn,onInputPaste:ho,onInputCompositionStart:_r,onInputCompositionEnd:Rr,onInputBlur:Mr},zi=_n==="multiple"||_n==="tags"?jt.createElement(Kn,(0,gt.Z)({},me,Kr)):jt.createElement(vn,(0,gt.Z)({},me,Kr));return jt.createElement("div",{ref:ro,className:"".concat($e,"-selector"),onClick:gn,onMouseDown:Wi},ni&&jt.createElement("div",{className:"".concat($e,"-prefix")},ni),zi)},wn=jt.forwardRef(ne),fi=wn,Rt=kt(65352),Lt=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Pt=function(me){var En=me===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:En,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:En,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:En,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:En,adjustY:1},htmlRegion:"scroll"}}},Nt=function(me,En){var Gn=me.prefixCls,Re=me.disabled,$e=me.visible,Nn=me.children,_n=me.popupElement,di=me.animation,Jn=me.transitionName,li=me.dropdownStyle,ni=me.dropdownClassName,ji=me.direction,Oi=ji===void 0?"ltr":ji,Ii=me.placement,Ve=me.builtinPlacements,vr=me.dropdownMatchSelectWidth,Mr=me.dropdownRender,ro=me.dropdownAlign,en=me.getPopupContainer,Tn=me.empty,Bi=me.getTriggerDOMNode,bi=me.onPopupVisibleChange,_i=me.onPopupMouseEnter,ir=(0,Dt.Z)(me,Lt),yr="".concat(Gn,"-dropdown"),Nr=_n;Mr&&(Nr=Mr(_n));var _r=jt.useMemo(function(){return Ve||Pt(vr)},[Ve,vr]),Rr=di?"".concat(yr,"-").concat(di):Jn,cn=typeof vr=="number",ho=jt.useMemo(function(){return cn?null:vr===!1?"minWidth":"width"},[vr,cn]),gn=li;cn&&(gn=(0,Ee.Z)((0,Ee.Z)({},gn),{},{width:vr}));var Wi=jt.useRef(null);return jt.useImperativeHandle(En,function(){return{getPopupElement:function(){var zi;return(zi=Wi.current)===null||zi===void 0?void 0:zi.popupElement}}}),jt.createElement(Rt.Z,(0,gt.Z)({},ir,{showAction:bi?["click"]:[],hideAction:bi?["click"]:[],popupPlacement:Ii||(Oi==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:_r,prefixCls:yr,popupTransitionName:Rr,popup:jt.createElement("div",{onMouseEnter:_i},Nr),ref:Wi,stretch:ho,popupAlign:ro,popupVisible:$e,getPopupContainer:en,popupClassName:se()(ni,(0,ue.Z)({},"".concat(yr,"-empty"),Tn)),popupStyle:gn,getTriggerDOMNode:Bi,onPopupVisibleChange:bi}),Nn)},Zt=jt.forwardRef(Nt),Mt=Zt,Yt=kt(21696);function Ge(Gt,me){var En=Gt.key,Gn;return"value"in Gt&&(Gn=Gt.value),En!=null?En:Gn!==void 0?Gn:"rc-index-key-".concat(me)}function Oe(Gt){return typeof Gt!="undefined"&&!Number.isNaN(Gt)}function Ke(Gt,me){var En=Gt||{},Gn=En.label,Re=En.value,$e=En.options,Nn=En.groupLabel,_n=Gn||(me?"children":"label");return{label:_n,value:Re||"value",options:$e||"options",groupLabel:Nn||_n}}function we(Gt){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},En=me.fieldNames,Gn=me.childrenAsData,Re=[],$e=Ke(En,!1),Nn=$e.label,_n=$e.value,di=$e.options,Jn=$e.groupLabel;function li(ni,ji){Array.isArray(ni)&&ni.forEach(function(Oi){if(ji||!(di in Oi)){var Ii=Oi[_n];Re.push({key:Ge(Oi,Re.length),groupOption:ji,data:Oi,label:Oi[Nn],value:Ii})}else{var Ve=Oi[Jn];Ve===void 0&&Gn&&(Ve=Oi.label),Re.push({key:Ge(Oi,Re.length),group:!0,data:Oi,label:Ve}),li(Oi[di],!0)}})}return li(Gt,!1),Re}function Ce(Gt){var me=(0,Ee.Z)({},Gt);return"props"in me||Object.defineProperty(me,"props",{get:function(){return(0,Qt.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),me}}),me}var Fe=function(me,En,Gn){if(!En||!En.length)return null;var Re=!1,$e=function _n(di,Jn){var li=(0,Yt.Z)(Jn),ni=li[0],ji=li.slice(1);if(!ni)return[di];var Oi=di.split(ni);return Re=Re||Oi.length>1,Oi.reduce(function(Ii,Ve){return[].concat((0,Ut.Z)(Ii),(0,Ut.Z)(_n(Ve,ji)))},[]).filter(Boolean)},Nn=$e(me,En);return Re?typeof Gn!="undefined"?Nn.slice(0,Gn):Nn:null},He=jt.createContext(null),Qe=He;function hn(Gt){var me=Gt.visible,En=Gt.values;if(!me)return null;var Gn=50;return jt.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(En.slice(0,Gn).map(function(Re){var $e=Re.label,Nn=Re.value;return["number","string"].includes((0,ee.Z)($e))?$e:Nn}).join(", ")),En.length>Gn?", ...":null)}var dn=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],ri=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],ze=function(me){return me==="tags"||me==="multiple"},We=jt.forwardRef(function(Gt,me){var En,Gn=Gt.id,Re=Gt.prefixCls,$e=Gt.className,Nn=Gt.showSearch,_n=Gt.tagRender,di=Gt.direction,Jn=Gt.omitDomProps,li=Gt.displayValues,ni=Gt.onDisplayValuesChange,ji=Gt.emptyOptions,Oi=Gt.notFoundContent,Ii=Oi===void 0?"Not Found":Oi,Ve=Gt.onClear,vr=Gt.mode,Mr=Gt.disabled,ro=Gt.loading,en=Gt.getInputElement,Tn=Gt.getRawInputElement,Bi=Gt.open,bi=Gt.defaultOpen,_i=Gt.onDropdownVisibleChange,ir=Gt.activeValue,yr=Gt.onActiveValueChange,Nr=Gt.activeDescendantId,_r=Gt.searchValue,Rr=Gt.autoClearSearchValue,cn=Gt.onSearch,ho=Gt.onSearchSplit,gn=Gt.tokenSeparators,Wi=Gt.allowClear,Kr=Gt.prefix,zi=Gt.suffixIcon,wo=Gt.clearIcon,Yr=Gt.OptionList,Er=Gt.animation,Co=Gt.transitionName,_e=Gt.dropdownStyle,xn=Gt.dropdownClassName,Be=Gt.dropdownMatchSelectWidth,At=Gt.dropdownRender,jn=Gt.dropdownAlign,Qn=Gt.placement,Li=Gt.builtinPlacements,xi=Gt.getPopupContainer,ui=Gt.showAction,mn=ui===void 0?[]:ui,Vn=Gt.onFocus,$n=Gt.onBlur,An=Gt.onKeyUp,Un=Gt.onKeyDown,Ti=Gt.onMouseDown,vi=(0,Dt.Z)(Gt,dn),ii=ze(vr),nn=(Nn!==void 0?Nn:ii)||vr==="combobox",Ni=(0,Ee.Z)({},vi);ri.forEach(function(Eo){delete Ni[Eo]}),Jn==null||Jn.forEach(function(Eo){delete Ni[Eo]});var Xi=jt.useState(!1),Or=(0,he.Z)(Xi,2),cr=Or[0],oo=Or[1];jt.useEffect(function(){oo((0,Bt.Z)())},[]);var to=jt.useRef(null),$r=jt.useRef(null),po=jt.useRef(null),lo=jt.useRef(null),Bo=jt.useRef(null),Te=jt.useRef(!1),ao=St(),Jr=(0,he.Z)(ao,3),gr=Jr[0],Wr=Jr[1],Lr=Jr[2];jt.useImperativeHandle(me,function(){var Eo,Ao;return{focus:(Eo=lo.current)===null||Eo===void 0?void 0:Eo.focus,blur:(Ao=lo.current)===null||Ao===void 0?void 0:Ao.blur,scrollTo:function(ae){var Ie;return(Ie=Bo.current)===null||Ie===void 0?void 0:Ie.scrollTo(ae)},nativeElement:to.current||$r.current}});var Mo=jt.useMemo(function(){var Eo;if(vr!=="combobox")return _r;var Ao=(Eo=li[0])===null||Eo===void 0?void 0:Eo.value;return typeof Ao=="string"||typeof Ao=="number"?String(Ao):""},[_r,vr,li]),Fo=vr==="combobox"&&typeof en=="function"&&en()||null,zr=typeof Tn=="function"&&Tn(),Zr=(0,nt.x1)($r,zr==null||(En=zr.props)===null||En===void 0?void 0:En.ref),Za=jt.useState(!1),ra=(0,he.Z)(Za,2),bs=ra[0],Ba=ra[1];(0,Pe.Z)(function(){Ba(!0)},[]);var or=(0,ge.Z)(!1,{defaultValue:bi,value:Bi}),$o=(0,he.Z)(or,2),qo=$o[0],ca=$o[1],ia=bs?qo:!1,fa=!Ii&&ji;(Mr||fa&&ia&&vr==="combobox")&&(ia=!1);var gi=fa?!1:ia,lr=jt.useCallback(function(Eo){var Ao=Eo!==void 0?Eo:!ia;Mr||(ca(Ao),ia!==Ao&&(_i==null||_i(Ao)))},[Mr,ia,ca,_i]),jr=jt.useMemo(function(){return(gn||[]).some(function(Eo){return[`
`,`\r
`].includes(Eo)})},[gn]),qr=jt.useContext(Qe)||{},mo=qr.maxCount,zo=qr.rawValues,dr=function(Ao,Ta,ae){if(!(ii&&Oe(mo)&&(zo==null?void 0:zo.size)>=mo)){var Ie=!0,_t=Ao;yr==null||yr(null);var ce=Fe(Ao,gn,Oe(mo)?mo-zo.size:void 0),Gr=ae?null:ce;return vr!=="combobox"&&Gr&&(_t="",ho==null||ho(Gr),lr(!1),Ie=!1),cn&&Mo!==_t&&cn(_t,{source:Ta?"typing":"effect"}),Ie}},Ya=function(Ao){!Ao||!Ao.trim()||cn(Ao,{source:"submit"})};jt.useEffect(function(){!ia&&!ii&&vr!=="combobox"&&dr("",!1,!1)},[ia]),jt.useEffect(function(){qo&&Mr&&ca(!1),Mr&&!Te.current&&Wr(!1)},[Mr]);var da=Et(),Yo=(0,he.Z)(da,2),so=Yo[0],Sa=Yo[1],ns=jt.useRef(!1),Jo=function(Ao){var Ta=so(),ae=Ao.key,Ie=ae==="Enter";if(Ie&&(vr!=="combobox"&&Ao.preventDefault(),ia||lr(!0)),Sa(!!Mo),ae==="Backspace"&&!Ta&&ii&&!Mo&&li.length){for(var _t=(0,Ut.Z)(li),ce=null,Gr=_t.length-1;Gr>=0;Gr-=1){var Sr=_t[Gr];if(!Sr.disabled){_t.splice(Gr,1),ce=Sr;break}}ce&&ni(_t,{type:"remove",values:[ce]})}for(var kr=arguments.length,ur=new Array(kr>1?kr-1:0),wr=1;wr<kr;wr++)ur[wr-1]=arguments[wr];if(ia&&(!Ie||!ns.current)){var vo;Ie&&(ns.current=!0),(vo=Bo.current)===null||vo===void 0||vo.onKeyDown.apply(vo,[Ao].concat(ur))}Un==null||Un.apply(void 0,[Ao].concat(ur))},ps=function(Ao){for(var Ta=arguments.length,ae=new Array(Ta>1?Ta-1:0),Ie=1;Ie<Ta;Ie++)ae[Ie-1]=arguments[Ie];if(ia){var _t;(_t=Bo.current)===null||_t===void 0||_t.onKeyUp.apply(_t,[Ao].concat(ae))}Ao.key==="Enter"&&(ns.current=!1),An==null||An.apply(void 0,[Ao].concat(ae))},ms=function(Ao){var Ta=li.filter(function(ae){return ae!==Ao});ni(Ta,{type:"remove",values:[Ao]})},Rs=function(){ns.current=!1},La=jt.useRef(!1),Iu=function(){Wr(!0),Mr||(Vn&&!La.current&&Vn.apply(void 0,arguments),mn.includes("focus")&&lr(!0)),La.current=!0},Cu=function(){Te.current=!0,Wr(!1,function(){La.current=!1,Te.current=!1,lr(!1)}),!Mr&&(Mo&&(vr==="tags"?cn(Mo,{source:"submit"}):vr==="multiple"&&cn("",{source:"blur"})),$n&&$n.apply(void 0,arguments))},js=[];jt.useEffect(function(){return function(){js.forEach(function(Eo){return clearTimeout(Eo)}),js.splice(0,js.length)}},[]);var Nl=function(Ao){var Ta,ae=Ao.target,Ie=(Ta=po.current)===null||Ta===void 0?void 0:Ta.getPopupElement();if(Ie&&Ie.contains(ae)){var _t=setTimeout(function(){var kr=js.indexOf(_t);if(kr!==-1&&js.splice(kr,1),Lr(),!cr&&!Ie.contains(document.activeElement)){var ur;(ur=lo.current)===null||ur===void 0||ur.focus()}});js.push(_t)}for(var ce=arguments.length,Gr=new Array(ce>1?ce-1:0),Sr=1;Sr<ce;Sr++)Gr[Sr-1]=arguments[Sr];Ti==null||Ti.apply(void 0,[Ao].concat(Gr))},zs=jt.useState({}),Vl=(0,he.Z)(zs,2),lu=Vl[1];function Eu(){lu({})}var xa;zr&&(xa=function(Ao){lr(Ao)}),Tt(function(){var Eo;return[to.current,(Eo=po.current)===null||Eo===void 0?void 0:Eo.getPopupElement()]},gi,lr,!!zr);var rl=jt.useMemo(function(){return(0,Ee.Z)((0,Ee.Z)({},Gt),{},{notFoundContent:Ii,open:ia,triggerOpen:gi,id:Gn,showSearch:nn,multiple:ii,toggleOpen:lr})},[Gt,Ii,gi,ia,Gn,nn,ii,lr]),_u=!!zi||ro,Kl;_u&&(Kl=jt.createElement(ht,{className:se()("".concat(Re,"-arrow"),(0,ue.Z)({},"".concat(Re,"-arrow-loading"),ro)),customizeIcon:zi,customizeIconProps:{loading:ro,searchValue:Mo,open:ia,focused:gr,showSearch:nn}}));var uu=function(){var Ao;Ve==null||Ve(),(Ao=lo.current)===null||Ao===void 0||Ao.focus(),ni([],{type:"clear",values:li}),dr("",!1,!1)},Xa=st(Re,uu,li,Wi,wo,Mr,Mo,vr),Ja=Xa.allowClear,Aa=Xa.clearIcon,Ga=jt.createElement(Yr,{ref:Bo}),Bl=se()(Re,$e,(0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)({},"".concat(Re,"-focused"),gr),"".concat(Re,"-multiple"),ii),"".concat(Re,"-single"),!ii),"".concat(Re,"-allow-clear"),Wi),"".concat(Re,"-show-arrow"),_u),"".concat(Re,"-disabled"),Mr),"".concat(Re,"-loading"),ro),"".concat(Re,"-open"),ia),"".concat(Re,"-customize-input"),Fo),"".concat(Re,"-show-search"),nn)),ga=jt.createElement(Mt,{ref:po,disabled:Mr,prefixCls:Re,visible:gi,popupElement:Ga,animation:Er,transitionName:Co,dropdownStyle:_e,dropdownClassName:xn,direction:di,dropdownMatchSelectWidth:Be,dropdownRender:At,dropdownAlign:jn,placement:Qn,builtinPlacements:Li,getPopupContainer:xi,empty:ji,getTriggerDOMNode:function(Ao){return $r.current||Ao},onPopupVisibleChange:xa,onPopupMouseEnter:Eu},zr?jt.cloneElement(zr,{ref:Zr}):jt.createElement(fi,(0,gt.Z)({},Gt,{domRef:$r,prefixCls:Re,inputElement:Fo,ref:lo,id:Gn,prefix:Kr,showSearch:nn,autoClearSearchValue:Rr,mode:vr,activeDescendantId:Nr,tagRender:_n,values:li,open:ia,onToggleOpen:lr,activeValue:ir,searchValue:Mo,onSearch:dr,onSearchSubmit:Ya,onRemove:ms,tokenWithEnter:jr,onInputBlur:Rs}))),_o;return zr?_o=ga:_o=jt.createElement("div",(0,gt.Z)({className:Bl},Ni,{ref:to,onMouseDown:Nl,onKeyDown:Jo,onKeyUp:ps,onFocus:Iu,onBlur:Cu}),jt.createElement(hn,{visible:gr&&!ia,values:li}),ga,Kl,Ja&&Aa),jt.createElement(pt.Provider,{value:rl},_o)}),an=We,Xn=function(){return null};Xn.isSelectOptGroup=!0;var pn=Xn,rn=function(){return null};rn.isSelectOption=!0;var In=rn,pi=kt(80547),ei=kt(2738),mi=kt(65283);function Hi(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Cn=["disabled","title","children","style","className"];function Sn(Gt){return typeof Gt=="string"||typeof Gt=="number"}var Bn=function(me,En){var Gn=vt(),Re=Gn.prefixCls,$e=Gn.id,Nn=Gn.open,_n=Gn.multiple,di=Gn.mode,Jn=Gn.searchValue,li=Gn.toggleOpen,ni=Gn.notFoundContent,ji=Gn.onPopupScroll,Oi=jt.useContext(Qe),Ii=Oi.maxCount,Ve=Oi.flattenOptions,vr=Oi.onActiveValue,Mr=Oi.defaultActiveFirstOption,ro=Oi.onSelect,en=Oi.menuItemSelectedIcon,Tn=Oi.rawValues,Bi=Oi.fieldNames,bi=Oi.virtual,_i=Oi.direction,ir=Oi.listHeight,yr=Oi.listItemHeight,Nr=Oi.optionRender,_r="".concat(Re,"-item"),Rr=(0,pi.Z)(function(){return Ve},[Nn,Ve],function(ui,mn){return mn[0]&&ui[1]!==mn[1]}),cn=jt.useRef(null),ho=jt.useMemo(function(){return _n&&Oe(Ii)&&(Tn==null?void 0:Tn.size)>=Ii},[_n,Ii,Tn==null?void 0:Tn.size]),gn=function(mn){mn.preventDefault()},Wi=function(mn){var Vn;(Vn=cn.current)===null||Vn===void 0||Vn.scrollTo(typeof mn=="number"?{index:mn}:mn)},Kr=jt.useCallback(function(ui){return di==="combobox"?!1:Tn.has(ui)},[di,(0,Ut.Z)(Tn).toString(),Tn.size]),zi=function(mn){for(var Vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,$n=Rr.length,An=0;An<$n;An+=1){var Un=(mn+An*Vn+$n)%$n,Ti=Rr[Un]||{},vi=Ti.group,ii=Ti.data;if(!vi&&!(ii!=null&&ii.disabled)&&(Kr(ii.value)||!ho))return Un}return-1},wo=jt.useState(function(){return zi(0)}),Yr=(0,he.Z)(wo,2),Er=Yr[0],Co=Yr[1],_e=function(mn){var Vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Co(mn);var $n={source:Vn?"keyboard":"mouse"},An=Rr[mn];if(!An){vr(null,-1,$n);return}vr(An.value,mn,$n)};(0,jt.useEffect)(function(){_e(Mr!==!1?zi(0):-1)},[Rr.length,Jn]);var xn=jt.useCallback(function(ui){return di==="combobox"?String(ui).toLowerCase()===Jn.toLowerCase():Tn.has(ui)},[di,Jn,(0,Ut.Z)(Tn).toString(),Tn.size]);(0,jt.useEffect)(function(){var ui=setTimeout(function(){if(!_n&&Nn&&Tn.size===1){var Vn=Array.from(Tn)[0],$n=Rr.findIndex(function(An){var Un=An.data;return Jn?String(Un.value).startsWith(Jn):Un.value===Vn});$n!==-1&&(_e($n),Wi($n))}});if(Nn){var mn;(mn=cn.current)===null||mn===void 0||mn.scrollTo(void 0)}return function(){return clearTimeout(ui)}},[Nn,Jn]);var Be=function(mn){mn!==void 0&&ro(mn,{selected:!Tn.has(mn)}),_n||li(!1)};if(jt.useImperativeHandle(En,function(){return{onKeyDown:function(mn){var Vn=mn.which,$n=mn.ctrlKey;switch(Vn){case It.Z.N:case It.Z.P:case It.Z.UP:case It.Z.DOWN:{var An=0;if(Vn===It.Z.UP?An=-1:Vn===It.Z.DOWN?An=1:Hi()&&$n&&(Vn===It.Z.N?An=1:Vn===It.Z.P&&(An=-1)),An!==0){var Un=zi(Er+An,An);Wi(Un),_e(Un,!0)}break}case It.Z.TAB:case It.Z.ENTER:{var Ti,vi=Rr[Er];vi&&!(vi!=null&&(Ti=vi.data)!==null&&Ti!==void 0&&Ti.disabled)&&!ho?Be(vi.value):Be(void 0),Nn&&mn.preventDefault();break}case It.Z.ESC:li(!1),Nn&&mn.stopPropagation()}},onKeyUp:function(){},scrollTo:function(mn){Wi(mn)}}}),Rr.length===0)return jt.createElement("div",{role:"listbox",id:"".concat($e,"_list"),className:"".concat(_r,"-empty"),onMouseDown:gn},ni);var At=Object.keys(Bi).map(function(ui){return Bi[ui]}),jn=function(mn){return mn.label};function Qn(ui,mn){var Vn=ui.group;return{role:Vn?"presentation":"option",id:"".concat($e,"_list_").concat(mn)}}var Li=function(mn){var Vn=Rr[mn];if(!Vn)return null;var $n=Vn.data||{},An=$n.value,Un=Vn.group,Ti=(0,Xt.Z)($n,!0),vi=jn(Vn);return Vn?jt.createElement("div",(0,gt.Z)({"aria-label":typeof vi=="string"&&!Un?vi:null},Ti,{key:mn},Qn(Vn,mn),{"aria-selected":xn(An)}),An):null},xi={role:"listbox",id:"".concat($e,"_list")};return jt.createElement(jt.Fragment,null,bi&&jt.createElement("div",(0,gt.Z)({},xi,{style:{height:0,width:0,overflow:"hidden"}}),Li(Er-1),Li(Er),Li(Er+1)),jt.createElement(mi.Z,{itemKey:"key",ref:cn,data:Rr,height:ir,itemHeight:yr,fullHeight:!1,onMouseDown:gn,onScroll:ji,virtual:bi,direction:_i,innerProps:bi?null:xi},function(ui,mn){var Vn=ui.group,$n=ui.groupOption,An=ui.data,Un=ui.label,Ti=ui.value,vi=An.key;if(Vn){var ii,nn=(ii=An.title)!==null&&ii!==void 0?ii:Sn(Un)?Un.toString():void 0;return jt.createElement("div",{className:se()(_r,"".concat(_r,"-group"),An.className),title:nn},Un!==void 0?Un:vi)}var Ni=An.disabled,Xi=An.title,Or=An.children,cr=An.style,oo=An.className,to=(0,Dt.Z)(An,Cn),$r=(0,ei.Z)(to,At),po=Kr(Ti),lo=Ni||!po&&ho,Bo="".concat(_r,"-option"),Te=se()(_r,Bo,oo,(0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)({},"".concat(Bo,"-grouped"),$n),"".concat(Bo,"-active"),Er===mn&&!lo),"".concat(Bo,"-disabled"),lo),"".concat(Bo,"-selected"),po)),ao=jn(ui),Jr=!en||typeof en=="function"||po,gr=typeof ao=="number"?ao:ao||Ti,Wr=Sn(gr)?gr.toString():void 0;return Xi!==void 0&&(Wr=Xi),jt.createElement("div",(0,gt.Z)({},(0,Xt.Z)($r),bi?{}:Qn(ui,mn),{"aria-selected":xn(Ti),className:Te,title:Wr,onMouseMove:function(){Er===mn||lo||_e(mn)},onClick:function(){lo||Be(Ti)},style:cr}),jt.createElement("div",{className:"".concat(Bo,"-content")},typeof Nr=="function"?Nr(ui,{index:mn}):gr),jt.isValidElement(en)||po,Jr&&jt.createElement(ht,{className:"".concat(_r,"-option-state"),customizeIcon:en,customizeIconProps:{value:Ti,disabled:lo,isSelected:po}},po?"\u2713":null))}))},si=jt.forwardRef(Bn),yi=si,hi=function(Gt,me){var En=jt.useRef({values:new Map,options:new Map}),Gn=jt.useMemo(function(){var $e=En.current,Nn=$e.values,_n=$e.options,di=Gt.map(function(ni){if(ni.label===void 0){var ji;return(0,Ee.Z)((0,Ee.Z)({},ni),{},{label:(ji=Nn.get(ni.value))===null||ji===void 0?void 0:ji.label})}return ni}),Jn=new Map,li=new Map;return di.forEach(function(ni){Jn.set(ni.value,ni),li.set(ni.value,me.get(ni.value)||_n.get(ni.value))}),En.current.values=Jn,En.current.options=li,di},[Gt,me]),Re=jt.useCallback(function($e){return me.get($e)||En.current.options.get($e)},[me]);return[Gn,Re]};function Gi(Gt,me){return je(Gt).join("").toUpperCase().includes(me)}var wt=function(Gt,me,En,Gn,Re){return jt.useMemo(function(){if(!En||Gn===!1)return Gt;var $e=me.options,Nn=me.label,_n=me.value,di=[],Jn=typeof Gn=="function",li=En.toUpperCase(),ni=Jn?Gn:function(Oi,Ii){return Re?Gi(Ii[Re],li):Ii[$e]?Gi(Ii[Nn!=="children"?Nn:"label"],li):Gi(Ii[_n],li)},ji=Jn?function(Oi){return Ce(Oi)}:function(Oi){return Oi};return Gt.forEach(function(Oi){if(Oi[$e]){var Ii=ni(En,ji(Oi));if(Ii)di.push(Oi);else{var Ve=Oi[$e].filter(function(vr){return ni(En,ji(vr))});Ve.length&&di.push((0,Ee.Z)((0,Ee.Z)({},Oi),{},(0,ue.Z)({},$e,Ve)))}return}ni(En,ji(Oi))&&di.push(Oi)}),di},[Gt,Gn,Re,En,me])},Ye=kt(6551),Zn=kt(11592),Ln=["children","value"],zn=["children"];function oi(Gt){var me=Gt,En=me.key,Gn=me.props,Re=Gn.children,$e=Gn.value,Nn=(0,Dt.Z)(Gn,Ln);return(0,Ee.Z)({key:En,value:$e!==void 0?$e:En,children:Re},Nn)}function Si(Gt){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,Zn.Z)(Gt).map(function(En,Gn){if(!jt.isValidElement(En)||!En.type)return null;var Re=En,$e=Re.type.isSelectOptGroup,Nn=Re.key,_n=Re.props,di=_n.children,Jn=(0,Dt.Z)(_n,zn);return me||!$e?oi(En):(0,Ee.Z)((0,Ee.Z)({key:"__RC_SELECT_GRP__".concat(Nn===null?Gn:Nn,"__"),label:Nn},Jn),{},{options:Si(di)})}).filter(function(En){return En})}var Yi=function(me,En,Gn,Re,$e){return jt.useMemo(function(){var Nn=me,_n=!me;_n&&(Nn=Si(En));var di=new Map,Jn=new Map,li=function(Oi,Ii,Ve){Ve&&typeof Ve=="string"&&Oi.set(Ii[Ve],Ii)},ni=function ji(Oi){for(var Ii=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ve=0;Ve<Oi.length;Ve+=1){var vr=Oi[Ve];!vr[Gn.options]||Ii?(di.set(vr[Gn.value],vr),li(Jn,vr,Gn.label),li(Jn,vr,Re),li(Jn,vr,$e)):ji(vr[Gn.options],!0)}};return ni(Nn),{options:Nn,valueOptions:di,labelOptions:Jn}},[me,En,Gn,Re,$e])},Fi=Yi;function ve(Gt){var me=jt.useRef();me.current=Gt;var En=jt.useCallback(function(){return me.current.apply(me,arguments)},[]);return En}function Le(Gt){var me=Gt.mode,En=Gt.options,Gn=Gt.children,Re=Gt.backfill,$e=Gt.allowClear,Nn=Gt.placeholder,_n=Gt.getInputElement,di=Gt.showSearch,Jn=Gt.onSearch,li=Gt.defaultOpen,ni=Gt.autoFocus,ji=Gt.labelInValue,Oi=Gt.value,Ii=Gt.inputValue,Ve=Gt.optionLabelProp,vr=isMultiple(me),Mr=di!==void 0?di:vr||me==="combobox",ro=En||convertChildrenToData(Gn);if(warning(me!=="tags"||ro.every(function(bi){return!bi.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),me==="tags"||me==="combobox"){var en=ro.some(function(bi){return bi.options?bi.options.some(function(_i){return typeof("value"in _i?_i.value:_i.key)=="number"}):typeof("value"in bi?bi.value:bi.key)=="number"});warning(!en,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(me!=="combobox"||!Ve,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(me==="combobox"||!Re,"`backfill` only works with `combobox` mode."),warning(me==="combobox"||!_n,"`getInputElement` only work with `combobox` mode."),noteOnce(me!=="combobox"||!_n||!$e||!Nn,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Jn&&!Mr&&me!=="combobox"&&me!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!li||ni,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Oi!=null){var Tn=toArray(Oi);warning(!ji||Tn.every(function(bi){return _typeof(bi)==="object"&&("key"in bi||"value"in bi)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!vr||Array.isArray(Oi),"`value` should be array when `mode` is `multiple` or `tags`")}if(Gn){var Bi=null;toNodeArray(Gn).some(function(bi){if(!React.isValidElement(bi)||!bi.type)return!1;var _i=bi,ir=_i.type;if(ir.isSelectOption)return!1;if(ir.isSelectOptGroup){var yr=toNodeArray(bi.props.children).every(function(Nr){return!React.isValidElement(Nr)||!bi.type||Nr.type.isSelectOption?!0:(Bi=Nr.type,!1)});return!yr}return Bi=ir,!0}),Bi&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Bi.displayName||Bi.name||Bi,"`.")),warning(Ii===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Se(Gt,me){if(Gt){var En=function Gn(Re){for(var $e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Nn=0;Nn<Re.length;Nn++){var _n=Re[Nn];if(_n[me==null?void 0:me.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!$e&&Array.isArray(_n[me==null?void 0:me.options])&&Gn(_n[me==null?void 0:me.options],!0))break}};En(Gt)}}var ti=null,Yn=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],Wn=["inputValue"];function qe(Gt){return!Gt||(0,ee.Z)(Gt)!=="object"}var Dn=jt.forwardRef(function(Gt,me){var En=Gt.id,Gn=Gt.mode,Re=Gt.prefixCls,$e=Re===void 0?"rc-select":Re,Nn=Gt.backfill,_n=Gt.fieldNames,di=Gt.inputValue,Jn=Gt.searchValue,li=Gt.onSearch,ni=Gt.autoClearSearchValue,ji=ni===void 0?!0:ni,Oi=Gt.onSelect,Ii=Gt.onDeselect,Ve=Gt.dropdownMatchSelectWidth,vr=Ve===void 0?!0:Ve,Mr=Gt.filterOption,ro=Gt.filterSort,en=Gt.optionFilterProp,Tn=Gt.optionLabelProp,Bi=Gt.options,bi=Gt.optionRender,_i=Gt.children,ir=Gt.defaultActiveFirstOption,yr=Gt.menuItemSelectedIcon,Nr=Gt.virtual,_r=Gt.direction,Rr=Gt.listHeight,cn=Rr===void 0?200:Rr,ho=Gt.listItemHeight,gn=ho===void 0?20:ho,Wi=Gt.labelRender,Kr=Gt.value,zi=Gt.defaultValue,wo=Gt.labelInValue,Yr=Gt.onChange,Er=Gt.maxCount,Co=(0,Dt.Z)(Gt,Yn),_e=(0,Ye.ZP)(En),xn=ze(Gn),Be=!!(!Bi&&_i),At=jt.useMemo(function(){return Mr===void 0&&Gn==="combobox"?!1:Mr},[Mr,Gn]),jn=jt.useMemo(function(){return Ke(_n,Be)},[JSON.stringify(_n),Be]),Qn=(0,ge.Z)("",{value:Jn!==void 0?Jn:di,postState:function(jr){return jr||""}}),Li=(0,he.Z)(Qn,2),xi=Li[0],ui=Li[1],mn=Fi(Bi,_i,jn,en,Tn),Vn=mn.valueOptions,$n=mn.labelOptions,An=mn.options,Un=jt.useCallback(function(lr){var jr=je(lr);return jr.map(function(qr){var mo,zo,dr,Ya,da;if(qe(qr))mo=qr;else{var Yo;dr=qr.key,zo=qr.label,mo=(Yo=qr.value)!==null&&Yo!==void 0?Yo:dr}var so=Vn.get(mo);if(so){var Sa;if(zo===void 0&&(zo=so==null?void 0:so[Tn||jn.label]),dr===void 0&&(dr=(Sa=so==null?void 0:so.key)!==null&&Sa!==void 0?Sa:mo),Ya=so==null?void 0:so.disabled,da=so==null?void 0:so.title,0)var ns}return{label:zo,value:mo,key:dr,disabled:Ya,title:da}})},[jn,Tn,Vn]),Ti=(0,ge.Z)(zi,{value:Kr}),vi=(0,he.Z)(Ti,2),ii=vi[0],nn=vi[1],Ni=jt.useMemo(function(){var lr,jr=xn&&ii===null?[]:ii,qr=Un(jr);return Gn==="combobox"&&Jt((lr=qr[0])===null||lr===void 0?void 0:lr.value)?[]:qr},[ii,Un,Gn,xn]),Xi=hi(Ni,Vn),Or=(0,he.Z)(Xi,2),cr=Or[0],oo=Or[1],to=jt.useMemo(function(){if(!Gn&&cr.length===1){var lr=cr[0];if(lr.value===null&&(lr.label===null||lr.label===void 0))return[]}return cr.map(function(jr){var qr;return(0,Ee.Z)((0,Ee.Z)({},jr),{},{label:(qr=typeof Wi=="function"?Wi(jr):jr.label)!==null&&qr!==void 0?qr:jr.value})})},[Gn,cr,Wi]),$r=jt.useMemo(function(){return new Set(cr.map(function(lr){return lr.value}))},[cr]);jt.useEffect(function(){if(Gn==="combobox"){var lr,jr=(lr=cr[0])===null||lr===void 0?void 0:lr.value;ui(te(jr)?String(jr):"")}},[cr]);var po=ve(function(lr,jr){var qr=jr!=null?jr:lr;return(0,ue.Z)((0,ue.Z)({},jn.value,lr),jn.label,qr)}),lo=jt.useMemo(function(){if(Gn!=="tags")return An;var lr=(0,Ut.Z)(An),jr=function(mo){return Vn.has(mo)};return(0,Ut.Z)(cr).sort(function(qr,mo){return qr.value<mo.value?-1:1}).forEach(function(qr){var mo=qr.value;jr(mo)||lr.push(po(mo,qr.label))}),lr},[po,An,Vn,cr,Gn]),Bo=wt(lo,jn,xi,At,en),Te=jt.useMemo(function(){return Gn!=="tags"||!xi||Bo.some(function(lr){return lr[en||"value"]===xi})||Bo.some(function(lr){return lr[jn.value]===xi})?Bo:[po(xi)].concat((0,Ut.Z)(Bo))},[po,en,Gn,Bo,xi,jn]),ao=function lr(jr){var qr=(0,Ut.Z)(jr).sort(function(mo,zo){return ro(mo,zo,{searchValue:xi})});return qr.map(function(mo){return Array.isArray(mo.options)?(0,Ee.Z)((0,Ee.Z)({},mo),{},{options:mo.options.length>0?lr(mo.options):mo.options}):mo})},Jr=jt.useMemo(function(){return ro?ao(Te):Te},[Te,ro,xi]),gr=jt.useMemo(function(){return we(Jr,{fieldNames:jn,childrenAsData:Be})},[Jr,jn,Be]),Wr=function(jr){var qr=Un(jr);if(nn(qr),Yr&&(qr.length!==cr.length||qr.some(function(dr,Ya){var da;return((da=cr[Ya])===null||da===void 0?void 0:da.value)!==(dr==null?void 0:dr.value)}))){var mo=wo?qr:qr.map(function(dr){return dr.value}),zo=qr.map(function(dr){return Ce(oo(dr.value))});Yr(xn?mo:mo[0],xn?zo:zo[0])}},Lr=jt.useState(null),Mo=(0,he.Z)(Lr,2),Fo=Mo[0],zr=Mo[1],Zr=jt.useState(0),Za=(0,he.Z)(Zr,2),ra=Za[0],bs=Za[1],Ba=ir!==void 0?ir:Gn!=="combobox",or=jt.useCallback(function(lr,jr){var qr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},mo=qr.source,zo=mo===void 0?"keyboard":mo;bs(jr),Nn&&Gn==="combobox"&&lr!==null&&zo==="keyboard"&&zr(String(lr))},[Nn,Gn]),$o=function(jr,qr,mo){var zo=function(){var ms,Rs=oo(jr);return[wo?{label:Rs==null?void 0:Rs[jn.label],value:jr,key:(ms=Rs==null?void 0:Rs.key)!==null&&ms!==void 0?ms:jr}:jr,Ce(Rs)]};if(qr&&Oi){var dr=zo(),Ya=(0,he.Z)(dr,2),da=Ya[0],Yo=Ya[1];Oi(da,Yo)}else if(!qr&&Ii&&mo!=="clear"){var so=zo(),Sa=(0,he.Z)(so,2),ns=Sa[0],Jo=Sa[1];Ii(ns,Jo)}},qo=ve(function(lr,jr){var qr,mo=xn?jr.selected:!0;mo?qr=xn?[].concat((0,Ut.Z)(cr),[lr]):[lr]:qr=cr.filter(function(zo){return zo.value!==lr}),Wr(qr),$o(lr,mo),Gn==="combobox"?zr(""):(!ze||ji)&&(ui(""),zr(""))}),ca=function(jr,qr){Wr(jr);var mo=qr.type,zo=qr.values;(mo==="remove"||mo==="clear")&&zo.forEach(function(dr){$o(dr.value,!1,mo)})},ia=function(jr,qr){if(ui(jr),zr(null),qr.source==="submit"){var mo=(jr||"").trim();if(mo){var zo=Array.from(new Set([].concat((0,Ut.Z)($r),[mo])));Wr(zo),$o(mo,!0),ui("")}return}qr.source!=="blur"&&(Gn==="combobox"&&Wr(jr),li==null||li(jr))},fa=function(jr){var qr=jr;Gn!=="tags"&&(qr=jr.map(function(zo){var dr=$n.get(zo);return dr==null?void 0:dr.value}).filter(function(zo){return zo!==void 0}));var mo=Array.from(new Set([].concat((0,Ut.Z)($r),(0,Ut.Z)(qr))));Wr(mo),mo.forEach(function(zo){$o(zo,!0)})},gi=jt.useMemo(function(){var lr=Nr!==!1&&vr!==!1;return(0,Ee.Z)((0,Ee.Z)({},mn),{},{flattenOptions:gr,onActiveValue:or,defaultActiveFirstOption:Ba,onSelect:qo,menuItemSelectedIcon:yr,rawValues:$r,fieldNames:jn,virtual:lr,direction:_r,listHeight:cn,listItemHeight:gn,childrenAsData:Be,maxCount:Er,optionRender:bi})},[Er,mn,gr,or,Ba,qo,yr,$r,jn,Nr,vr,_r,cn,gn,Be,bi]);return jt.createElement(Qe.Provider,{value:gi},jt.createElement(an,(0,gt.Z)({},Co,{id:_e,prefixCls:$e,ref:me,omitDomProps:Wn,mode:Gn,displayValues:to,onDisplayValuesChange:ca,direction:_r,searchValue:xi,onSearch:ia,autoClearSearchValue:ji,onSearchSplit:fa,dropdownMatchSelectWidth:vr,OptionList:yi,emptyOptions:!gr.length,activeValue:Fo,activeDescendantId:"".concat(_e,"_list_").concat(ra)})))}),ki=Dn;ki.Option=In,ki.OptGroup=pn;var Di=ki,Ki=Di},63158:function(Mn,Rn,kt){"use strict";var gt=kt(14809),Ut=kt(4635),ue=kt(50298),Ee=kt(62646),he=kt(59301),Dt=kt(92310),ee=kt.n(Dt),ge=kt(18929),Qt=kt(10228),jt=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Ae=he.forwardRef(function(se,Pe){var Bt,nt=se.prefixCls,et=nt===void 0?"rc-switch":nt,ht=se.className,st=se.checked,pt=se.defaultChecked,vt=se.disabled,St=se.loadingIcon,Et=se.checkedChildren,Tt=se.unCheckedChildren,It=se.onClick,qt=se.onChange,Xt=se.onKeyDown,Ht=(0,Ee.Z)(se,jt),pe=(0,ge.Z)(!1,{value:st,defaultValue:pt}),re=(0,ue.Z)(pe,2),Ne=re[0],ye=re[1];function xe(fn,te){var Jt=Ne;return vt||(Jt=fn,ye(Jt),qt==null||qt(Jt,te)),Jt}function Ue(fn){fn.which===Qt.Z.LEFT?xe(!1,fn):fn.which===Qt.Z.RIGHT&&xe(!0,fn),Xt==null||Xt(fn)}function je(fn){var te=xe(!Ne,fn);It==null||It(te,fn)}var Je=ee()(et,ht,(Bt={},(0,Ut.Z)(Bt,"".concat(et,"-checked"),Ne),(0,Ut.Z)(Bt,"".concat(et,"-disabled"),vt),Bt));return he.createElement("button",(0,gt.Z)({},Ht,{type:"button",role:"switch","aria-checked":Ne,disabled:vt,className:Je,ref:Pe,onKeyDown:Ue,onClick:je}),St,he.createElement("span",{className:"".concat(et,"-inner")},he.createElement("span",{className:"".concat(et,"-inner-checked")},Et),he.createElement("span",{className:"".concat(et,"-inner-unchecked")},Tt)))});Ae.displayName="Switch",Rn.Z=Ae},86351:function(Mn,Rn,kt){"use strict";kt.d(Rn,{R:function(){return Ut},w:function(){return gt}});var gt={},Ut="rc-table-internal-hook"},97347:function(Mn,Rn,kt){"use strict";kt.d(Rn,{L:function(){return et},Z:function(){return St}});var gt=kt(50298),Ut=kt(4635),ue=kt(95190),Ee=kt(93664),he=kt(20439),Dt=kt(62646),ee=kt(11592),ge=kt(48736),Qt=kt(59301),jt=kt(86351),Ae=kt(54451);function se(Et){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return typeof Tt=="number"?Tt:Tt.endsWith("%")?Et*parseFloat(Tt)/100:null}function Pe(Et,Tt,It){return Qt.useMemo(function(){if(Tt&&Tt>0){var qt=0,Xt=0;Et.forEach(function(je){var Je=se(Tt,je.width);Je?qt+=Je:Xt+=1});var Ht=Math.max(Tt,It),pe=Math.max(Ht-qt,Xt),re=Xt,Ne=pe/Xt,ye=0,xe=Et.map(function(je){var Je=(0,he.Z)({},je),fn=se(Tt,Je.width);if(fn)Je.width=fn;else{var te=Math.floor(Ne);Je.width=re===1?pe:te,pe-=te,re-=1}return ye+=Je.width,Je});if(ye<Ht){var Ue=Ht/ye;pe=Ht,xe.forEach(function(je,Je){var fn=Math.floor(je.width*Ue);je.width=Je===xe.length-1?pe:fn,pe-=fn})}return[xe,Math.max(ye,Ht)]}return[Et,Tt]},[Et,Tt,It])}var Bt=["children"],nt=["fixed"];function et(Et){return(0,ee.Z)(Et).filter(function(Tt){return Qt.isValidElement(Tt)}).map(function(Tt){var It=Tt.key,qt=Tt.props,Xt=qt.children,Ht=(0,Dt.Z)(qt,Bt),pe=(0,he.Z)({key:It},Ht);return Xt&&(pe.children=et(Xt)),pe})}function ht(Et){return Et.filter(function(Tt){return Tt&&(0,Ee.Z)(Tt)==="object"&&!Tt.hidden}).map(function(Tt){var It=Tt.children;return It&&It.length>0?(0,he.Z)((0,he.Z)({},Tt),{},{children:ht(It)}):Tt})}function st(Et){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key";return Et.filter(function(It){return It&&(0,Ee.Z)(It)==="object"}).reduce(function(It,qt,Xt){var Ht=qt.fixed,pe=Ht===!0?"left":Ht,re="".concat(Tt,"-").concat(Xt),Ne=qt.children;return Ne&&Ne.length>0?[].concat((0,ue.Z)(It),(0,ue.Z)(st(Ne,re).map(function(ye){return(0,he.Z)({fixed:pe},ye)}))):[].concat((0,ue.Z)(It),[(0,he.Z)((0,he.Z)({key:re},qt),{},{fixed:pe})])},[])}function pt(Et){return Et.map(function(Tt){var It=Tt.fixed,qt=(0,Dt.Z)(Tt,nt),Xt=It;return It==="left"?Xt="right":It==="right"&&(Xt="left"),(0,he.Z)({fixed:Xt},qt)})}function vt(Et,Tt){var It=Et.prefixCls,qt=Et.columns,Xt=Et.children,Ht=Et.expandable,pe=Et.expandedKeys,re=Et.columnTitle,Ne=Et.getRowKey,ye=Et.onTriggerExpand,xe=Et.expandIcon,Ue=Et.rowExpandable,je=Et.expandIconColumnIndex,Je=Et.direction,fn=Et.expandRowByClick,te=Et.columnWidth,Jt=Et.fixed,Xe=Et.scrollWidth,On=Et.clientWidth,bn=Qt.useMemo(function(){var fi=qt||et(Xt)||[];return ht(fi.slice())},[qt,Xt]),De=Qt.useMemo(function(){if(Ht){var fi=bn.slice();if(!fi.includes(jt.w)){var Rt=je||0;Rt>=0&&(Rt||Jt==="left"||!Jt)&&fi.splice(Rt,0,jt.w),Jt==="right"&&fi.splice(bn.length,0,jt.w)}var Lt=fi.indexOf(jt.w);fi=fi.filter(function(Mt,Yt){return Mt!==jt.w||Yt===Lt});var Pt=bn[Lt],Nt;Jt?Nt=Jt:Nt=Pt?Pt.fixed:null;var Zt=(0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)({},Ae.v,{className:"".concat(It,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",re),"fixed",Nt),"className","".concat(It,"-row-expand-icon-cell")),"width",te),"render",function(Yt,Ge,Oe){var Ke=Ne(Ge,Oe),we=pe.has(Ke),Ce=Ue?Ue(Ge):!0,Fe=xe({prefixCls:It,expanded:we,expandable:Ce,record:Ge,onExpand:ye});return fn?Qt.createElement("span",{onClick:function(Qe){return Qe.stopPropagation()}},Fe):Fe});return fi.map(function(Mt){return Mt===jt.w?Zt:Mt})}return bn.filter(function(Mt){return Mt!==jt.w})},[Ht,bn,Ne,pe,xe,Je]),on=Qt.useMemo(function(){var fi=De;return Tt&&(fi=Tt(fi)),fi.length||(fi=[{render:function(){return null}}]),fi},[Tt,De,Je]),un=Qt.useMemo(function(){return Je==="rtl"?pt(st(on)):st(on)},[on,Je,Xe]),Kn=Qt.useMemo(function(){for(var fi=-1,Rt=un.length-1;Rt>=0;Rt-=1){var Lt=un[Rt].fixed;if(Lt==="left"||Lt===!0){fi=Rt;break}}if(fi>=0)for(var Pt=0;Pt<=fi;Pt+=1){var Nt=un[Pt].fixed;if(Nt!=="left"&&Nt!==!0)return!0}var Zt=un.findIndex(function(Ge){var Oe=Ge.fixed;return Oe==="right"});if(Zt>=0)for(var Mt=Zt;Mt<un.length;Mt+=1){var Yt=un[Mt].fixed;if(Yt!=="right")return!0}return!1},[un]),Me=Pe(un,Xe,On),vn=(0,gt.Z)(Me,2),ne=vn[0],wn=vn[1];return[on,ne,wn,Kn]}var St=vt},4030:function(Mn,Rn,kt){"use strict";kt.d(Rn,{w2:function(){return gt.w},vP:function(){return Sn.v},RQ:function(){return gt.R},ER:function(){return Ke},Q$:function(){return Mr},TN:function(){return Yr}});var gt=kt(86351),Ut=kt(50298),ue=kt(6089),Ee=kt(34280),he=kt(13697),Dt=kt(59301),ee=kt(4676);function ge(_e){var xn=Dt.createContext(void 0),Be=function(jn){var Qn=jn.value,Li=jn.children,xi=Dt.useRef(Qn);xi.current=Qn;var ui=Dt.useState(function(){return{getValue:function(){return xi.current},listeners:new Set}}),mn=(0,Ut.Z)(ui,1),Vn=mn[0];return(0,Ee.Z)(function(){(0,ee.unstable_batchedUpdates)(function(){Vn.listeners.forEach(function($n){$n(Qn)})})},[Qn]),Dt.createElement(xn.Provider,{value:Vn},Li)};return{Context:xn,Provider:Be,defaultValue:_e}}function Qt(_e,xn){var Be=(0,ue.Z)(typeof xn=="function"?xn:function($n){if(xn===void 0)return $n;if(!Array.isArray(xn))return $n[xn];var An={};return xn.forEach(function(Un){An[Un]=$n[Un]}),An}),At=Dt.useContext(_e==null?void 0:_e.Context),jn=At||{},Qn=jn.listeners,Li=jn.getValue,xi=Dt.useRef();xi.current=Be(At?Li():_e==null?void 0:_e.defaultValue);var ui=Dt.useState({}),mn=(0,Ut.Z)(ui,2),Vn=mn[1];return(0,Ee.Z)(function(){if(!At)return;function $n(An){var Un=Be(An);(0,he.Z)(xi.current,Un,!0)||Vn({})}return Qn.add($n),function(){Qn.delete($n)}},[At]),xi.current}var jt=kt(14809),Ae=kt(8654);function se(){var _e=Dt.createContext(null);function xn(){return Dt.useContext(_e)}function Be(jn,Qn){var Li=(0,Ae.Yr)(jn),xi=function(mn,Vn){var $n=Li?{ref:Vn}:{},An=Dt.useRef(0),Un=Dt.useRef(mn),Ti=xn();return Ti!==null?Dt.createElement(jn,(0,jt.Z)({},mn,$n)):((!Qn||Qn(Un.current,mn))&&(An.current+=1),Un.current=mn,Dt.createElement(_e.Provider,{value:An.current},Dt.createElement(jn,(0,jt.Z)({},mn,$n))))};return Li?Dt.forwardRef(xi):xi}function At(jn,Qn){var Li=(0,Ae.Yr)(jn),xi=function(mn,Vn){var $n=Li?{ref:Vn}:{};return xn(),Dt.createElement(jn,(0,jt.Z)({},mn,$n))};return Li?Dt.memo(Dt.forwardRef(xi),Qn):Dt.memo(xi,Qn)}return{makeImmutable:Be,responseImmutable:At,useImmutableMark:xn}}var Pe=se(),Bt=Pe.makeImmutable,nt=Pe.responseImmutable,et=Pe.useImmutableMark,ht=se(),st=ht.makeImmutable,pt=ht.responseImmutable,vt=ht.useImmutableMark,St=ge(),Et=St;function Tt(_e,xn){var Be=React.useRef(0);Be.current+=1;var At=React.useRef(_e),jn=[];Object.keys(_e||{}).map(function(Li){var xi;(_e==null?void 0:_e[Li])!==((xi=At.current)===null||xi===void 0?void 0:xi[Li])&&jn.push(Li)}),At.current=_e;var Qn=React.useRef([]);return jn.length&&(Qn.current=jn),React.useDebugValue(Be.current),React.useDebugValue(Qn.current.join(", ")),xn&&console.log("".concat(xn,":"),Be.current,Qn.current),Be.current}var It=null,qt=null,Xt=kt(93664),Ht=kt(20439),pe=kt(4635),re=kt(92310),Ne=kt.n(re),ye=kt(80547),xe=kt(97938),Ue=kt(48736),je=Dt.createContext({renderWithProps:!1}),Je=je,fn="RC_TABLE_KEY";function te(_e){return _e==null?[]:Array.isArray(_e)?_e:[_e]}function Jt(_e){var xn=[],Be={};return _e.forEach(function(At){for(var jn=At||{},Qn=jn.key,Li=jn.dataIndex,xi=Qn||te(Li).join("-")||fn;Be[xi];)xi="".concat(xi,"_next");Be[xi]=!0,xn.push(xi)}),xn}function Xe(_e){return _e!=null}function On(_e){return typeof _e=="number"&&!Number.isNaN(_e)}function bn(_e){return _e&&(0,Xt.Z)(_e)==="object"&&!Array.isArray(_e)&&!Dt.isValidElement(_e)}function De(_e,xn,Be,At,jn,Qn){var Li=Dt.useContext(Je),xi=vt(),ui=(0,ye.Z)(function(){if(Xe(At))return[At];var mn=xn==null||xn===""?[]:Array.isArray(xn)?xn:[xn],Vn=(0,xe.Z)(_e,mn),$n=Vn,An=void 0;if(jn){var Un=jn(Vn,_e,Be);bn(Un)?($n=Un.children,An=Un.props,Li.renderWithProps=!0):$n=Un}return[$n,An]},[xi,_e,At,xn,jn,Be],function(mn,Vn){if(Qn){var $n=(0,Ut.Z)(mn,2),An=$n[1],Un=(0,Ut.Z)(Vn,2),Ti=Un[1];return Qn(Ti,An)}return Li.renderWithProps?!0:!(0,he.Z)(mn,Vn,!0)});return ui}function on(_e,xn,Be,At){var jn=_e+xn-1;return _e<=At&&jn>=Be}function un(_e,xn){return Qt(Et,function(Be){var At=on(_e,xn||1,Be.hoverStartRow,Be.hoverEndRow);return[At,Be.onHover]})}var Kn=kt(70425),Me=function(xn){var Be=xn.ellipsis,At=xn.rowType,jn=xn.children,Qn,Li=Be===!0?{showTitle:!0}:Be;return Li&&(Li.showTitle||At==="header")&&(typeof jn=="string"||typeof jn=="number"?Qn=jn.toString():Dt.isValidElement(jn)&&typeof jn.props.children=="string"&&(Qn=jn.props.children)),Qn};function vn(_e){var xn,Be,At,jn,Qn,Li,xi,ui,mn=_e.component,Vn=_e.children,$n=_e.ellipsis,An=_e.scope,Un=_e.prefixCls,Ti=_e.className,vi=_e.align,ii=_e.record,nn=_e.render,Ni=_e.dataIndex,Xi=_e.renderIndex,Or=_e.shouldCellUpdate,cr=_e.index,oo=_e.rowType,to=_e.colSpan,$r=_e.rowSpan,po=_e.fixLeft,lo=_e.fixRight,Bo=_e.firstFixLeft,Te=_e.lastFixLeft,ao=_e.firstFixRight,Jr=_e.lastFixRight,gr=_e.appendNode,Wr=_e.additionalProps,Lr=Wr===void 0?{}:Wr,Mo=_e.isSticky,Fo="".concat(Un,"-cell"),zr=Qt(Et,["supportSticky","allColumnsFixedLeft","rowHoverable"]),Zr=zr.supportSticky,Za=zr.allColumnsFixedLeft,ra=zr.rowHoverable,bs=De(ii,Ni,Xi,Vn,nn,Or),Ba=(0,Ut.Z)(bs,2),or=Ba[0],$o=Ba[1],qo={},ca=typeof po=="number"&&Zr,ia=typeof lo=="number"&&Zr;ca&&(qo.position="sticky",qo.left=po),ia&&(qo.position="sticky",qo.right=lo);var fa=(xn=(Be=(At=$o==null?void 0:$o.colSpan)!==null&&At!==void 0?At:Lr.colSpan)!==null&&Be!==void 0?Be:to)!==null&&xn!==void 0?xn:1,gi=(jn=(Qn=(Li=$o==null?void 0:$o.rowSpan)!==null&&Li!==void 0?Li:Lr.rowSpan)!==null&&Qn!==void 0?Qn:$r)!==null&&jn!==void 0?jn:1,lr=un(cr,gi),jr=(0,Ut.Z)(lr,2),qr=jr[0],mo=jr[1],zo=(0,Kn.zX)(function(ns){var Jo;ii&&mo(cr,cr+gi-1),Lr==null||(Jo=Lr.onMouseEnter)===null||Jo===void 0||Jo.call(Lr,ns)}),dr=(0,Kn.zX)(function(ns){var Jo;ii&&mo(-1,-1),Lr==null||(Jo=Lr.onMouseLeave)===null||Jo===void 0||Jo.call(Lr,ns)});if(fa===0||gi===0)return null;var Ya=(xi=Lr.title)!==null&&xi!==void 0?xi:Me({rowType:oo,ellipsis:$n,children:or}),da=Ne()(Fo,Ti,(ui={},(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)(ui,"".concat(Fo,"-fix-left"),ca&&Zr),"".concat(Fo,"-fix-left-first"),Bo&&Zr),"".concat(Fo,"-fix-left-last"),Te&&Zr),"".concat(Fo,"-fix-left-all"),Te&&Za&&Zr),"".concat(Fo,"-fix-right"),ia&&Zr),"".concat(Fo,"-fix-right-first"),ao&&Zr),"".concat(Fo,"-fix-right-last"),Jr&&Zr),"".concat(Fo,"-ellipsis"),$n),"".concat(Fo,"-with-append"),gr),"".concat(Fo,"-fix-sticky"),(ca||ia)&&Mo&&Zr),(0,pe.Z)(ui,"".concat(Fo,"-row-hover"),!$o&&qr)),Lr.className,$o==null?void 0:$o.className),Yo={};vi&&(Yo.textAlign=vi);var so=(0,Ht.Z)((0,Ht.Z)((0,Ht.Z)((0,Ht.Z)({},$o==null?void 0:$o.style),qo),Yo),Lr.style),Sa=or;return(0,Xt.Z)(Sa)==="object"&&!Array.isArray(Sa)&&!Dt.isValidElement(Sa)&&(Sa=null),$n&&(Te||ao)&&(Sa=Dt.createElement("span",{className:"".concat(Fo,"-content")},Sa)),Dt.createElement(mn,(0,jt.Z)({},$o,Lr,{className:da,style:so,title:Ya,scope:An,onMouseEnter:ra?zo:void 0,onMouseLeave:ra?dr:void 0,colSpan:fa!==1?fa:null,rowSpan:gi!==1?gi:null}),gr,Sa)}var ne=Dt.memo(vn);function wn(_e,xn,Be,At,jn){var Qn=Be[_e]||{},Li=Be[xn]||{},xi,ui;Qn.fixed==="left"?xi=At.left[jn==="rtl"?xn:_e]:Li.fixed==="right"&&(ui=At.right[jn==="rtl"?_e:xn]);var mn=!1,Vn=!1,$n=!1,An=!1,Un=Be[xn+1],Ti=Be[_e-1],vi=Un&&!Un.fixed||Ti&&!Ti.fixed||Be.every(function(Or){return Or.fixed==="left"});if(jn==="rtl"){if(xi!==void 0){var ii=Ti&&Ti.fixed==="left";An=!ii&&vi}else if(ui!==void 0){var nn=Un&&Un.fixed==="right";$n=!nn&&vi}}else if(xi!==void 0){var Ni=Un&&Un.fixed==="left";mn=!Ni&&vi}else if(ui!==void 0){var Xi=Ti&&Ti.fixed==="right";Vn=!Xi&&vi}return{fixLeft:xi,fixRight:ui,lastFixLeft:mn,firstFixRight:Vn,lastFixRight:$n,firstFixLeft:An,isSticky:At.isSticky}}var fi=Dt.createContext({}),Rt=fi;function Lt(_e){var xn=_e.className,Be=_e.index,At=_e.children,jn=_e.colSpan,Qn=jn===void 0?1:jn,Li=_e.rowSpan,xi=_e.align,ui=Qt(Et,["prefixCls","direction"]),mn=ui.prefixCls,Vn=ui.direction,$n=Dt.useContext(Rt),An=$n.scrollColumnIndex,Un=$n.stickyOffsets,Ti=$n.flattenColumns,vi=Be+Qn-1,ii=vi+1===An?Qn+1:Qn,nn=wn(Be,Be+ii-1,Ti,Un,Vn);return Dt.createElement(ne,(0,jt.Z)({className:xn,index:Be,component:"td",prefixCls:mn,record:null,dataIndex:null,align:xi,colSpan:ii,rowSpan:Li,render:function(){return At}},nn))}var Pt=kt(62646),Nt=["children"];function Zt(_e){var xn=_e.children,Be=(0,Pt.Z)(_e,Nt);return Dt.createElement("tr",Be,xn)}function Mt(_e){var xn=_e.children;return xn}Mt.Row=Zt,Mt.Cell=Lt;var Yt=Mt;function Ge(_e){var xn=_e.children,Be=_e.stickyOffsets,At=_e.flattenColumns,jn=Qt(Et,"prefixCls"),Qn=At.length-1,Li=At[Qn],xi=Dt.useMemo(function(){return{stickyOffsets:Be,flattenColumns:At,scrollColumnIndex:Li!=null&&Li.scrollbar?Qn:null}},[Li,At,Qn,Be]);return Dt.createElement(Rt.Provider,{value:xi},Dt.createElement("tfoot",{className:"".concat(jn,"-summary")},xn))}var Oe=pt(Ge),Ke=Yt,we=kt(29301),Ce=kt(24514),Fe=kt(75152),He=kt(26112);function Qe(_e,xn,Be,At,jn,Qn,Li){_e.push({record:xn,indent:Be,index:Li});var xi=Qn(xn),ui=jn==null?void 0:jn.has(xi);if(xn&&Array.isArray(xn[At])&&ui)for(var mn=0;mn<xn[At].length;mn+=1)Qe(_e,xn[At][mn],Be+1,At,jn,Qn,mn)}function hn(_e,xn,Be,At){var jn=Dt.useMemo(function(){if(Be!=null&&Be.size){for(var Qn=[],Li=0;Li<(_e==null?void 0:_e.length);Li+=1){var xi=_e[Li];Qe(Qn,xi,0,xn,Be,At,Li)}return Qn}return _e==null?void 0:_e.map(function(ui,mn){return{record:ui,indent:0,index:mn}})},[_e,xn,Be,At]);return jn}function dn(_e,xn,Be,At){var jn=Qt(Et,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),Qn=jn.flattenColumns,Li=jn.expandableType,xi=jn.expandedKeys,ui=jn.childrenColumnName,mn=jn.onTriggerExpand,Vn=jn.rowExpandable,$n=jn.onRow,An=jn.expandRowByClick,Un=jn.rowClassName,Ti=Li==="nest",vi=Li==="row"&&(!Vn||Vn(_e)),ii=vi||Ti,nn=xi&&xi.has(xn),Ni=ui&&_e&&_e[ui],Xi=(0,Kn.zX)(mn),Or=$n==null?void 0:$n(_e,Be),cr=Or==null?void 0:Or.onClick,oo=function(lo){An&&ii&&mn(_e,lo);for(var Bo=arguments.length,Te=new Array(Bo>1?Bo-1:0),ao=1;ao<Bo;ao++)Te[ao-1]=arguments[ao];cr==null||cr.apply(void 0,[lo].concat(Te))},to;typeof Un=="string"?to=Un:typeof Un=="function"&&(to=Un(_e,Be,At));var $r=Jt(Qn);return(0,Ht.Z)((0,Ht.Z)({},jn),{},{columnsKey:$r,nestExpandable:Ti,expanded:nn,hasNestChildren:Ni,record:_e,onTriggerExpand:Xi,rowSupportExpand:vi,expandable:ii,rowProps:(0,Ht.Z)((0,Ht.Z)({},Or),{},{className:Ne()(to,Or==null?void 0:Or.className),onClick:oo})})}function ri(_e){var xn=_e.prefixCls,Be=_e.children,At=_e.component,jn=_e.cellComponent,Qn=_e.className,Li=_e.expanded,xi=_e.colSpan,ui=_e.isEmpty,mn=Qt(Et,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]),Vn=mn.scrollbarSize,$n=mn.fixHeader,An=mn.fixColumn,Un=mn.componentWidth,Ti=mn.horizonScroll,vi=Be;return(ui?Ti&&Un:An)&&(vi=Dt.createElement("div",{style:{width:Un-($n&&!ui?Vn:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(xn,"-expanded-row-fixed")},vi)),Dt.createElement(At,{className:Qn,style:{display:Li?null:"none"}},Dt.createElement(ne,{component:jn,prefixCls:xn,colSpan:xi},vi))}var ze=ri;function We(_e){var xn=_e.prefixCls,Be=_e.record,At=_e.onExpand,jn=_e.expanded,Qn=_e.expandable,Li="".concat(xn,"-row-expand-icon");if(!Qn)return Dt.createElement("span",{className:Ne()(Li,"".concat(xn,"-row-spaced"))});var xi=function(mn){At(Be,mn),mn.stopPropagation()};return Dt.createElement("span",{className:Ne()(Li,(0,pe.Z)((0,pe.Z)({},"".concat(xn,"-row-expanded"),jn),"".concat(xn,"-row-collapsed"),!jn)),onClick:xi})}function an(_e,xn,Be){var At=[];function jn(Qn){(Qn||[]).forEach(function(Li,xi){At.push(xn(Li,xi)),jn(Li[Be])})}return jn(_e),At}function Xn(_e,xn,Be,At){return typeof _e=="string"?_e:typeof _e=="function"?_e(xn,Be,At):""}function pn(_e,xn,Be,At,jn){var Qn=_e.record,Li=_e.prefixCls,xi=_e.columnsKey,ui=_e.fixedInfoList,mn=_e.expandIconColumnIndex,Vn=_e.nestExpandable,$n=_e.indentSize,An=_e.expandIcon,Un=_e.expanded,Ti=_e.hasNestChildren,vi=_e.onTriggerExpand,ii=xi[Be],nn=ui[Be],Ni;Be===(mn||0)&&Vn&&(Ni=Dt.createElement(Dt.Fragment,null,Dt.createElement("span",{style:{paddingLeft:"".concat($n*At,"px")},className:"".concat(Li,"-row-indent indent-level-").concat(At)}),An({prefixCls:Li,expanded:Un,expandable:Ti,record:Qn,onExpand:vi})));var Xi;return xn.onCell&&(Xi=xn.onCell(Qn,jn)),{key:ii,fixedInfo:nn,appendCellNode:Ni,additionalCellProps:Xi||{}}}function rn(_e){var xn=_e.className,Be=_e.style,At=_e.record,jn=_e.index,Qn=_e.renderIndex,Li=_e.rowKey,xi=_e.indent,ui=xi===void 0?0:xi,mn=_e.rowComponent,Vn=_e.cellComponent,$n=_e.scopeCellComponent,An=dn(At,Li,jn,ui),Un=An.prefixCls,Ti=An.flattenColumns,vi=An.expandedRowClassName,ii=An.expandedRowRender,nn=An.rowProps,Ni=An.expanded,Xi=An.rowSupportExpand,Or=Dt.useRef(!1);Or.current||(Or.current=Ni);var cr=Xn(vi,At,jn,ui),oo=Dt.createElement(mn,(0,jt.Z)({},nn,{"data-row-key":Li,className:Ne()(xn,"".concat(Un,"-row"),"".concat(Un,"-row-level-").concat(ui),nn==null?void 0:nn.className,(0,pe.Z)({},cr,ui>=1)),style:(0,Ht.Z)((0,Ht.Z)({},Be),nn==null?void 0:nn.style)}),Ti.map(function(po,lo){var Bo=po.render,Te=po.dataIndex,ao=po.className,Jr=pn(An,po,lo,ui,jn),gr=Jr.key,Wr=Jr.fixedInfo,Lr=Jr.appendCellNode,Mo=Jr.additionalCellProps;return Dt.createElement(ne,(0,jt.Z)({className:ao,ellipsis:po.ellipsis,align:po.align,scope:po.rowScope,component:po.rowScope?$n:Vn,prefixCls:Un,key:gr,record:At,index:jn,renderIndex:Qn,dataIndex:Te,render:Bo,shouldCellUpdate:po.shouldCellUpdate},Wr,{appendNode:Lr,additionalProps:Mo}))})),to;if(Xi&&(Or.current||Ni)){var $r=ii(At,jn,ui+1,Ni);to=Dt.createElement(ze,{expanded:Ni,className:Ne()("".concat(Un,"-expanded-row"),"".concat(Un,"-expanded-row-level-").concat(ui+1),cr),prefixCls:Un,component:mn,cellComponent:Vn,colSpan:Ti.length,isEmpty:!1},$r)}return Dt.createElement(Dt.Fragment,null,oo,to)}var In=pt(rn);function pi(_e){var xn=_e.columnKey,Be=_e.onColumnResize,At=Dt.useRef();return(0,Ee.Z)(function(){At.current&&Be(xn,At.current.offsetWidth)},[]),Dt.createElement(we.Z,{data:xn},Dt.createElement("td",{ref:At,style:{padding:0,border:0,height:0}},Dt.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}var ei=kt(29194);function mi(_e){var xn=_e.prefixCls,Be=_e.columnsKey,At=_e.onColumnResize,jn=Dt.useRef(null);return Dt.createElement("tr",{"aria-hidden":"true",className:"".concat(xn,"-measure-row"),style:{height:0,fontSize:0},ref:jn},Dt.createElement(we.Z.Collection,{onBatchResize:function(Li){(0,ei.Z)(jn.current)&&Li.forEach(function(xi){var ui=xi.data,mn=xi.size;At(ui,mn.offsetWidth)})}},Be.map(function(Qn){return Dt.createElement(pi,{key:Qn,columnKey:Qn,onColumnResize:At})})))}function Hi(_e){var xn=_e.data,Be=_e.measureColumnWidth,At=Qt(Et,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode"]),jn=At.prefixCls,Qn=At.getComponent,Li=At.onColumnResize,xi=At.flattenColumns,ui=At.getRowKey,mn=At.expandedKeys,Vn=At.childrenColumnName,$n=At.emptyNode,An=hn(xn,Vn,mn,ui),Un=Dt.useRef({renderWithProps:!1}),Ti=Qn(["body","wrapper"],"tbody"),vi=Qn(["body","row"],"tr"),ii=Qn(["body","cell"],"td"),nn=Qn(["body","cell"],"th"),Ni;xn.length?Ni=An.map(function(Or,cr){var oo=Or.record,to=Or.indent,$r=Or.index,po=ui(oo,cr);return Dt.createElement(In,{key:po,rowKey:po,record:oo,index:cr,renderIndex:$r,rowComponent:vi,cellComponent:ii,scopeCellComponent:nn,indent:to})}):Ni=Dt.createElement(ze,{expanded:!0,className:"".concat(jn,"-placeholder"),prefixCls:jn,component:vi,cellComponent:ii,colSpan:xi.length,isEmpty:!0},$n);var Xi=Jt(xi);return Dt.createElement(Je.Provider,{value:Un.current},Dt.createElement(Ti,{className:"".concat(jn,"-tbody")},Be&&Dt.createElement(mi,{prefixCls:jn,columnsKey:Xi,onColumnResize:Li}),Ni))}var Cn=pt(Hi),Sn=kt(54451),Bn=["columnType"];function si(_e){for(var xn=_e.colWidths,Be=_e.columns,At=_e.columCount,jn=Qt(Et,["tableLayout"]),Qn=jn.tableLayout,Li=[],xi=At||Be.length,ui=!1,mn=xi-1;mn>=0;mn-=1){var Vn=xn[mn],$n=Be&&Be[mn],An=void 0,Un=void 0;if($n&&(An=$n[Sn.v],Qn==="auto"&&(Un=$n.minWidth)),Vn||Un||An||ui){var Ti=An||{},vi=Ti.columnType,ii=(0,Pt.Z)(Ti,Bn);Li.unshift(Dt.createElement("col",(0,jt.Z)({key:mn,style:{width:Vn,minWidth:Un}},ii))),ui=!0}}return Dt.createElement("colgroup",null,Li)}var yi=si,hi=kt(95190),Gi=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function wt(_e,xn){return(0,Dt.useMemo)(function(){for(var Be=[],At=0;At<xn;At+=1){var jn=_e[At];if(jn!==void 0)Be[At]=jn;else return null}return Be},[_e.join("_"),xn])}var Ye=Dt.forwardRef(function(_e,xn){var Be=_e.className,At=_e.noData,jn=_e.columns,Qn=_e.flattenColumns,Li=_e.colWidths,xi=_e.columCount,ui=_e.stickyOffsets,mn=_e.direction,Vn=_e.fixHeader,$n=_e.stickyTopOffset,An=_e.stickyBottomOffset,Un=_e.stickyClassName,Ti=_e.onScroll,vi=_e.maxContentScroll,ii=_e.children,nn=(0,Pt.Z)(_e,Gi),Ni=Qt(Et,["prefixCls","scrollbarSize","isSticky","getComponent"]),Xi=Ni.prefixCls,Or=Ni.scrollbarSize,cr=Ni.isSticky,oo=Ni.getComponent,to=oo(["header","table"],"table"),$r=cr&&!Vn?0:Or,po=Dt.useRef(null),lo=Dt.useCallback(function(Mo){(0,Ae.mH)(xn,Mo),(0,Ae.mH)(po,Mo)},[]);Dt.useEffect(function(){var Mo;function Fo(zr){var Zr=zr,Za=Zr.currentTarget,ra=Zr.deltaX;ra&&(Ti({currentTarget:Za,scrollLeft:Za.scrollLeft+ra}),zr.preventDefault())}return(Mo=po.current)===null||Mo===void 0||Mo.addEventListener("wheel",Fo,{passive:!1}),function(){var zr;(zr=po.current)===null||zr===void 0||zr.removeEventListener("wheel",Fo)}},[]);var Bo=Dt.useMemo(function(){return Qn.every(function(Mo){return Mo.width})},[Qn]),Te=Qn[Qn.length-1],ao={fixed:Te?Te.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(Xi,"-cell-scrollbar")}}},Jr=(0,Dt.useMemo)(function(){return $r?[].concat((0,hi.Z)(jn),[ao]):jn},[$r,jn]),gr=(0,Dt.useMemo)(function(){return $r?[].concat((0,hi.Z)(Qn),[ao]):Qn},[$r,Qn]),Wr=(0,Dt.useMemo)(function(){var Mo=ui.right,Fo=ui.left;return(0,Ht.Z)((0,Ht.Z)({},ui),{},{left:mn==="rtl"?[].concat((0,hi.Z)(Fo.map(function(zr){return zr+$r})),[0]):Fo,right:mn==="rtl"?Mo:[].concat((0,hi.Z)(Mo.map(function(zr){return zr+$r})),[0]),isSticky:cr})},[$r,ui,cr]),Lr=wt(Li,xi);return Dt.createElement("div",{style:(0,Ht.Z)({overflow:"hidden"},cr?{top:$n,bottom:An}:{}),ref:lo,className:Ne()(Be,(0,pe.Z)({},Un,!!Un))},Dt.createElement(to,{style:{tableLayout:"fixed",visibility:At||Lr?null:"hidden"}},(!At||!vi||Bo)&&Dt.createElement(yi,{colWidths:Lr?[].concat((0,hi.Z)(Lr),[$r]):[],columCount:xi+1,columns:gr}),ii((0,Ht.Z)((0,Ht.Z)({},nn),{},{stickyOffsets:Wr,columns:Jr,flattenColumns:gr}))))}),Zn=Dt.memo(Ye),Ln=function(xn){var Be=xn.cells,At=xn.stickyOffsets,jn=xn.flattenColumns,Qn=xn.rowComponent,Li=xn.cellComponent,xi=xn.onHeaderRow,ui=xn.index,mn=Qt(Et,["prefixCls","direction"]),Vn=mn.prefixCls,$n=mn.direction,An;xi&&(An=xi(Be.map(function(Ti){return Ti.column}),ui));var Un=Jt(Be.map(function(Ti){return Ti.column}));return Dt.createElement(Qn,An,Be.map(function(Ti,vi){var ii=Ti.column,nn=wn(Ti.colStart,Ti.colEnd,jn,At,$n),Ni;return ii&&ii.onHeaderCell&&(Ni=Ti.column.onHeaderCell(ii)),Dt.createElement(ne,(0,jt.Z)({},Ti,{scope:ii.title?Ti.colSpan>1?"colgroup":"col":null,ellipsis:ii.ellipsis,align:ii.align,component:Li,prefixCls:Vn,key:Un[vi]},nn,{additionalProps:Ni,rowType:"header"}))}))},zn=Ln;function oi(_e){var xn=[];function Be(Li,xi){var ui=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;xn[ui]=xn[ui]||[];var mn=xi,Vn=Li.filter(Boolean).map(function($n){var An={key:$n.key,className:$n.className||"",children:$n.title,column:$n,colStart:mn},Un=1,Ti=$n.children;return Ti&&Ti.length>0&&(Un=Be(Ti,mn,ui+1).reduce(function(vi,ii){return vi+ii},0),An.hasSubColumns=!0),"colSpan"in $n&&(Un=$n.colSpan),"rowSpan"in $n&&(An.rowSpan=$n.rowSpan),An.colSpan=Un,An.colEnd=An.colStart+Un-1,xn[ui].push(An),mn+=Un,Un});return Vn}Be(_e,0);for(var At=xn.length,jn=function(xi){xn[xi].forEach(function(ui){!("rowSpan"in ui)&&!ui.hasSubColumns&&(ui.rowSpan=At-xi)})},Qn=0;Qn<At;Qn+=1)jn(Qn);return xn}var Si=function(xn){var Be=xn.stickyOffsets,At=xn.columns,jn=xn.flattenColumns,Qn=xn.onHeaderRow,Li=Qt(Et,["prefixCls","getComponent"]),xi=Li.prefixCls,ui=Li.getComponent,mn=Dt.useMemo(function(){return oi(At)},[At]),Vn=ui(["header","wrapper"],"thead"),$n=ui(["header","row"],"tr"),An=ui(["header","cell"],"th");return Dt.createElement(Vn,{className:"".concat(xi,"-thead")},mn.map(function(Un,Ti){var vi=Dt.createElement(zn,{key:Ti,flattenColumns:jn,cells:Un,stickyOffsets:Be,rowComponent:$n,cellComponent:An,onHeaderRow:Qn,index:Ti});return vi}))},Yi=pt(Si),Fi=kt(97347);function ve(_e,xn,Be){var At=(0,Sn.g)(_e),jn=At.expandIcon,Qn=At.expandedRowKeys,Li=At.defaultExpandedRowKeys,xi=At.defaultExpandAllRows,ui=At.expandedRowRender,mn=At.onExpand,Vn=At.onExpandedRowsChange,$n=At.childrenColumnName,An=jn||We,Un=$n||"children",Ti=Dt.useMemo(function(){return ui?"row":_e.expandable&&_e.internalHooks===gt.R&&_e.expandable.__PARENT_RENDER_ICON__||xn.some(function(cr){return cr&&(0,Xt.Z)(cr)==="object"&&cr[Un]})?"nest":!1},[!!ui,xn]),vi=Dt.useState(function(){return Li||(xi?an(xn,Be,Un):[])}),ii=(0,Ut.Z)(vi,2),nn=ii[0],Ni=ii[1],Xi=Dt.useMemo(function(){return new Set(Qn||nn||[])},[Qn,nn]),Or=Dt.useCallback(function(cr){var oo=Be(cr,xn.indexOf(cr)),to,$r=Xi.has(oo);$r?(Xi.delete(oo),to=(0,hi.Z)(Xi)):to=[].concat((0,hi.Z)(Xi),[oo]),Ni(to),mn&&mn(!$r,cr),Vn&&Vn(to)},[Be,Xi,xn,mn,Vn]);return[At,Ti,Xi,An,Un,Or]}function Le(_e,xn,Be){var At=_e.map(function(jn,Qn){return wn(Qn,Qn,_e,xn,Be)});return(0,ye.Z)(function(){return At},[At],function(jn,Qn){return!(0,he.Z)(jn,Qn)})}function Se(_e){var xn=(0,Dt.useRef)(_e),Be=(0,Dt.useState)({}),At=(0,Ut.Z)(Be,2),jn=At[1],Qn=(0,Dt.useRef)(null),Li=(0,Dt.useRef)([]);function xi(ui){Li.current.push(ui);var mn=Promise.resolve();Qn.current=mn,mn.then(function(){if(Qn.current===mn){var Vn=Li.current,$n=xn.current;Li.current=[],Vn.forEach(function(An){xn.current=An(xn.current)}),Qn.current=null,$n!==xn.current&&jn({})}})}return(0,Dt.useEffect)(function(){return function(){Qn.current=null}},[]),[xn.current,xi]}function ti(_e){var xn=(0,Dt.useRef)(_e||null),Be=(0,Dt.useRef)();function At(){window.clearTimeout(Be.current)}function jn(Li){xn.current=Li,At(),Be.current=window.setTimeout(function(){xn.current=null,Be.current=void 0},100)}function Qn(){return xn.current}return(0,Dt.useEffect)(function(){return At},[]),[jn,Qn]}function Yn(){var _e=Dt.useState(-1),xn=(0,Ut.Z)(_e,2),Be=xn[0],At=xn[1],jn=Dt.useState(-1),Qn=(0,Ut.Z)(jn,2),Li=Qn[0],xi=Qn[1],ui=Dt.useCallback(function(mn,Vn){At(mn),xi(Vn)},[]);return[Be,Li,ui]}var Wn=kt(47273),qe=(0,Wn.Z)()?window:null;function Dn(_e,xn){var Be=(0,Xt.Z)(_e)==="object"?_e:{},At=Be.offsetHeader,jn=At===void 0?0:At,Qn=Be.offsetSummary,Li=Qn===void 0?0:Qn,xi=Be.offsetScroll,ui=xi===void 0?0:xi,mn=Be.getContainer,Vn=mn===void 0?function(){return qe}:mn,$n=Vn()||qe,An=!!_e;return Dt.useMemo(function(){return{isSticky:An,stickyClassName:An?"".concat(xn,"-sticky-holder"):"",offsetHeader:jn,offsetSummary:Li,offsetScroll:ui,container:$n}},[An,ui,jn,Li,xn,$n])}function ki(_e,xn,Be){var At=(0,Dt.useMemo)(function(){var jn=xn.length,Qn=function(mn,Vn,$n){for(var An=[],Un=0,Ti=mn;Ti!==Vn;Ti+=$n)An.push(Un),xn[Ti].fixed&&(Un+=_e[Ti]||0);return An},Li=Qn(0,jn,1),xi=Qn(jn-1,-1,-1).reverse();return Be==="rtl"?{left:xi,right:Li}:{left:Li,right:xi}},[_e,xn,Be]);return At}var Di=ki;function Ki(_e){var xn=_e.className,Be=_e.children;return Dt.createElement("div",{className:xn},Be)}var Gt=Ki,me=kt(8224),En=kt(16089),Gn=kt(76846);function Re(_e){var xn=(0,Gn.bn)(_e),Be=xn.getBoundingClientRect(),At=document.documentElement;return{left:Be.left+(window.pageXOffset||At.scrollLeft)-(At.clientLeft||document.body.clientLeft||0),top:Be.top+(window.pageYOffset||At.scrollTop)-(At.clientTop||document.body.clientTop||0)}}var $e=function(xn,Be){var At,jn,Qn=xn.scrollBodyRef,Li=xn.onScroll,xi=xn.offsetScroll,ui=xn.container,mn=xn.direction,Vn=Qt(Et,"prefixCls"),$n=((At=Qn.current)===null||At===void 0?void 0:At.scrollWidth)||0,An=((jn=Qn.current)===null||jn===void 0?void 0:jn.clientWidth)||0,Un=$n&&An*(An/$n),Ti=Dt.useRef(),vi=Se({scrollLeft:0,isHiddenScrollBar:!0}),ii=(0,Ut.Z)(vi,2),nn=ii[0],Ni=ii[1],Xi=Dt.useRef({delta:0,x:0}),Or=Dt.useState(!1),cr=(0,Ut.Z)(Or,2),oo=cr[0],to=cr[1],$r=Dt.useRef(null);Dt.useEffect(function(){return function(){En.Z.cancel($r.current)}},[]);var po=function(){to(!1)},lo=function(gr){gr.persist(),Xi.current.delta=gr.pageX-nn.scrollLeft,Xi.current.x=0,to(!0),gr.preventDefault()},Bo=function(gr){var Wr,Lr=gr||((Wr=window)===null||Wr===void 0?void 0:Wr.event),Mo=Lr.buttons;if(!oo||Mo===0){oo&&to(!1);return}var Fo=Xi.current.x+gr.pageX-Xi.current.x-Xi.current.delta,zr=mn==="rtl";Fo=Math.max(zr?Un-An:0,Math.min(zr?0:An-Un,Fo));var Zr=!zr||Math.abs(Fo)+Math.abs(Un)<An;Zr&&(Li({scrollLeft:Fo/An*($n+2)}),Xi.current.x=gr.pageX)},Te=function(){En.Z.cancel($r.current),$r.current=(0,En.Z)(function(){if(Qn.current){var gr=Re(Qn.current).top,Wr=gr+Qn.current.offsetHeight,Lr=ui===window?document.documentElement.scrollTop+window.innerHeight:Re(ui).top+ui.clientHeight;Wr-(0,Fe.Z)()<=Lr||gr>=Lr-xi?Ni(function(Mo){return(0,Ht.Z)((0,Ht.Z)({},Mo),{},{isHiddenScrollBar:!0})}):Ni(function(Mo){return(0,Ht.Z)((0,Ht.Z)({},Mo),{},{isHiddenScrollBar:!1})})}})},ao=function(gr){Ni(function(Wr){return(0,Ht.Z)((0,Ht.Z)({},Wr),{},{scrollLeft:gr/$n*An||0})})};return Dt.useImperativeHandle(Be,function(){return{setScrollLeft:ao,checkScrollBarVisible:Te}}),Dt.useEffect(function(){var Jr=(0,me.Z)(document.body,"mouseup",po,!1),gr=(0,me.Z)(document.body,"mousemove",Bo,!1);return Te(),function(){Jr.remove(),gr.remove()}},[Un,oo]),Dt.useEffect(function(){if(Qn.current){for(var Jr=[],gr=(0,Gn.bn)(Qn.current);gr;)Jr.push(gr),gr=gr.parentElement;return Jr.forEach(function(Wr){return Wr.addEventListener("scroll",Te,!1)}),window.addEventListener("resize",Te,!1),window.addEventListener("scroll",Te,!1),ui.addEventListener("scroll",Te,!1),function(){Jr.forEach(function(Wr){return Wr.removeEventListener("scroll",Te)}),window.removeEventListener("resize",Te),window.removeEventListener("scroll",Te),ui.removeEventListener("scroll",Te)}}},[ui]),Dt.useEffect(function(){nn.isHiddenScrollBar||Ni(function(Jr){var gr=Qn.current;return gr?(0,Ht.Z)((0,Ht.Z)({},Jr),{},{scrollLeft:gr.scrollLeft/gr.scrollWidth*gr.clientWidth}):Jr})},[nn.isHiddenScrollBar]),$n<=An||!Un||nn.isHiddenScrollBar?null:Dt.createElement("div",{style:{height:(0,Fe.Z)(),width:An,bottom:xi},className:"".concat(Vn,"-sticky-scroll")},Dt.createElement("div",{onMouseDown:lo,ref:Ti,className:Ne()("".concat(Vn,"-sticky-scroll-bar"),(0,pe.Z)({},"".concat(Vn,"-sticky-scroll-bar-active"),oo)),style:{width:"".concat(Un,"px"),transform:"translate3d(".concat(nn.scrollLeft,"px, 0, 0)")}}))},Nn=Dt.forwardRef($e);function _n(_e){return null}var di=_n;function Jn(_e){return null}var li=Jn,ni="rc-table",ji=[],Oi={};function Ii(){return"No Data"}function Ve(_e,xn){var Be=(0,Ht.Z)({rowKey:"key",prefixCls:ni,emptyText:Ii},_e),At=Be.prefixCls,jn=Be.className,Qn=Be.rowClassName,Li=Be.style,xi=Be.data,ui=Be.rowKey,mn=Be.scroll,Vn=Be.tableLayout,$n=Be.direction,An=Be.title,Un=Be.footer,Ti=Be.summary,vi=Be.caption,ii=Be.id,nn=Be.showHeader,Ni=Be.components,Xi=Be.emptyText,Or=Be.onRow,cr=Be.onHeaderRow,oo=Be.onScroll,to=Be.internalHooks,$r=Be.transformColumns,po=Be.internalRefs,lo=Be.tailor,Bo=Be.getContainerWidth,Te=Be.sticky,ao=Be.rowHoverable,Jr=ao===void 0?!0:ao,gr=xi||ji,Wr=!!gr.length,Lr=to===gt.R,Mo=Dt.useCallback(function(bo,Wo){return(0,xe.Z)(Ni,bo)||Wo},[Ni]),Fo=Dt.useMemo(function(){return typeof ui=="function"?ui:function(bo){var Wo=bo&&bo[ui];return Wo}},[ui]),zr=Mo(["body"]),Zr=Yn(),Za=(0,Ut.Z)(Zr,3),ra=Za[0],bs=Za[1],Ba=Za[2],or=ve(Be,gr,Fo),$o=(0,Ut.Z)(or,6),qo=$o[0],ca=$o[1],ia=$o[2],fa=$o[3],gi=$o[4],lr=$o[5],jr=mn==null?void 0:mn.x,qr=Dt.useState(0),mo=(0,Ut.Z)(qr,2),zo=mo[0],dr=mo[1],Ya=(0,Fi.Z)((0,Ht.Z)((0,Ht.Z)((0,Ht.Z)({},Be),qo),{},{expandable:!!qo.expandedRowRender,columnTitle:qo.columnTitle,expandedKeys:ia,getRowKey:Fo,onTriggerExpand:lr,expandIcon:fa,expandIconColumnIndex:qo.expandIconColumnIndex,direction:$n,scrollWidth:Lr&&lo&&typeof jr=="number"?jr:null,clientWidth:zo}),Lr?$r:null),da=(0,Ut.Z)(Ya,4),Yo=da[0],so=da[1],Sa=da[2],ns=da[3],Jo=Sa!=null?Sa:jr,ps=Dt.useMemo(function(){return{columns:Yo,flattenColumns:so}},[Yo,so]),ms=Dt.useRef(),Rs=Dt.useRef(),La=Dt.useRef(),Iu=Dt.useRef();Dt.useImperativeHandle(xn,function(){return{nativeElement:ms.current,scrollTo:function(Wo){var Pa;if(La.current instanceof HTMLElement){var is=Wo.index,Qa=Wo.top,pl=Wo.key;if(On(Qa)){var Yl;(Yl=La.current)===null||Yl===void 0||Yl.scrollTo({top:Qa})}else{var du,al=pl!=null?pl:Fo(gr[is]);(du=La.current.querySelector('[data-row-key="'.concat(al,'"]')))===null||du===void 0||du.scrollIntoView()}}else(Pa=La.current)!==null&&Pa!==void 0&&Pa.scrollTo&&La.current.scrollTo(Wo)}}});var Cu=Dt.useRef(),js=Dt.useState(!1),Nl=(0,Ut.Z)(js,2),zs=Nl[0],Vl=Nl[1],lu=Dt.useState(!1),Eu=(0,Ut.Z)(lu,2),xa=Eu[0],rl=Eu[1],_u=Dt.useState(new Map),Kl=(0,Ut.Z)(_u,2),uu=Kl[0],Xa=Kl[1],Ja=Jt(so),Aa=Ja.map(function(bo){return uu.get(bo)}),Ga=Dt.useMemo(function(){return Aa},[Aa.join("_")]),Bl=Di(Ga,so,$n),ga=mn&&Xe(mn.y),_o=mn&&Xe(Jo)||!!qo.fixed,Eo=_o&&so.some(function(bo){var Wo=bo.fixed;return Wo}),Ao=Dt.useRef(),Ta=Dn(Te,At),ae=Ta.isSticky,Ie=Ta.offsetHeader,_t=Ta.offsetSummary,ce=Ta.offsetScroll,Gr=Ta.stickyClassName,Sr=Ta.container,kr=Dt.useMemo(function(){return Ti==null?void 0:Ti(gr)},[Ti,gr]),ur=(ga||ae)&&Dt.isValidElement(kr)&&kr.type===Yt&&kr.props.fixed,wr,vo,Xr;ga&&(vo={overflowY:Wr?"scroll":"auto",maxHeight:mn.y}),_o&&(wr={overflowX:"auto"},ga||(vo={overflowY:"hidden"}),Xr={width:Jo===!0?"auto":Jo,minWidth:"100%"});var Ir=Dt.useCallback(function(bo,Wo){Xa(function(Pa){if(Pa.get(bo)!==Wo){var is=new Map(Pa);return is.set(bo,Wo),is}return Pa})},[]),Ui=ti(null),eo=(0,Ut.Z)(Ui,2),Vi=eo[0],ar=eo[1];function Qi(bo,Wo){Wo&&(typeof Wo=="function"?Wo(bo):Wo.scrollLeft!==bo&&(Wo.scrollLeft=bo,Wo.scrollLeft!==bo&&setTimeout(function(){Wo.scrollLeft=bo},0)))}var br=(0,ue.Z)(function(bo){var Wo=bo.currentTarget,Pa=bo.scrollLeft,is=$n==="rtl",Qa=typeof Pa=="number"?Pa:Wo.scrollLeft,pl=Wo||Oi;if(!ar()||ar()===pl){var Yl;Vi(pl),Qi(Qa,Rs.current),Qi(Qa,La.current),Qi(Qa,Cu.current),Qi(Qa,(Yl=Ao.current)===null||Yl===void 0?void 0:Yl.setScrollLeft)}var du=Wo||Rs.current;if(du){var al=Lr&&lo&&typeof Jo=="number"?Jo:du.scrollWidth,ml=du.clientWidth;if(al===ml){Vl(!1),rl(!1);return}is?(Vl(-Qa<al-ml),rl(-Qa>0)):(Vl(Qa>0),rl(Qa<al-ml))}}),Fr=(0,ue.Z)(function(bo){br(bo),oo==null||oo(bo)}),Dr=function(){if(_o&&La.current){var Wo;br({currentTarget:(0,Gn.bn)(La.current),scrollLeft:(Wo=La.current)===null||Wo===void 0?void 0:Wo.scrollLeft})}else Vl(!1),rl(!1)},no=function(Wo){var Pa,is=Wo.width;(Pa=Ao.current)===null||Pa===void 0||Pa.checkScrollBarVisible();var Qa=ms.current?ms.current.offsetWidth:is;Lr&&Bo&&ms.current&&(Qa=Bo(ms.current,Qa)||Qa),Qa!==zo&&(Dr(),dr(Qa))},Zi=Dt.useRef(!1);Dt.useEffect(function(){Zi.current&&Dr()},[_o,xi,Yo.length]),Dt.useEffect(function(){Zi.current=!0},[]);var Br=Dt.useState(0),Pi=(0,Ut.Z)(Br,2),$i=Pi[0],pr=Pi[1],uo=Dt.useState(!0),yo=(0,Ut.Z)(uo,2),Ro=yo[0],qi=yo[1];(0,Ee.Z)(function(){(!lo||!Lr)&&(La.current instanceof Element?pr((0,Fe.o)(La.current).width):pr((0,Fe.o)(Iu.current).width)),qi((0,Ce.G)("position","sticky"))},[]),Dt.useEffect(function(){Lr&&po&&(po.body.current=La.current)});var Ia=Dt.useCallback(function(bo){return Dt.createElement(Dt.Fragment,null,Dt.createElement(Yi,bo),ur==="top"&&Dt.createElement(Oe,bo,kr))},[ur,kr]),Cr=Dt.useCallback(function(bo){return Dt.createElement(Oe,bo,kr)},[kr]),co=Mo(["table"],"table"),Ar=Dt.useMemo(function(){return Vn||(Eo?Jo==="max-content"?"auto":"fixed":ga||ae||so.some(function(bo){var Wo=bo.ellipsis;return Wo})?"fixed":"auto")},[ga,Eo,so,Vn,ae]),ea,Zo={colWidths:Ga,columCount:so.length,stickyOffsets:Bl,onHeaderRow:cr,fixHeader:ga,scroll:mn},Fa=Dt.useMemo(function(){return Wr?null:typeof Xi=="function"?Xi():Xi},[Wr,Xi]),Al=Dt.createElement(Cn,{data:gr,measureColumnWidth:ga||_o||ae}),hu=Dt.createElement(yi,{colWidths:so.map(function(bo){var Wo=bo.width;return Wo}),columns:so}),Ys=vi!=null?Dt.createElement("caption",{className:"".concat(At,"-caption")},vi):void 0,Tl=(0,He.Z)(Be,{data:!0}),Oo=(0,He.Z)(Be,{aria:!0});if(ga||ae){var Ns;typeof zr=="function"?(Ns=zr(gr,{scrollbarSize:$i,ref:La,onScroll:br}),Zo.colWidths=so.map(function(bo,Wo){var Pa=bo.width,is=Wo===so.length-1?Pa-$i:Pa;return typeof is=="number"&&!Number.isNaN(is)?is:0})):Ns=Dt.createElement("div",{style:(0,Ht.Z)((0,Ht.Z)({},wr),vo),onScroll:Fr,ref:La,className:Ne()("".concat(At,"-body"))},Dt.createElement(co,(0,jt.Z)({style:(0,Ht.Z)((0,Ht.Z)({},Xr),{},{tableLayout:Ar})},Oo),Ys,hu,Al,!ur&&kr&&Dt.createElement(Oe,{stickyOffsets:Bl,flattenColumns:so},kr)));var gl=(0,Ht.Z)((0,Ht.Z)((0,Ht.Z)({noData:!gr.length,maxContentScroll:_o&&Jo==="max-content"},Zo),ps),{},{direction:$n,stickyClassName:Gr,onScroll:br});ea=Dt.createElement(Dt.Fragment,null,nn!==!1&&Dt.createElement(Zn,(0,jt.Z)({},gl,{stickyTopOffset:Ie,className:"".concat(At,"-header"),ref:Rs}),Ia),Ns,ur&&ur!=="top"&&Dt.createElement(Zn,(0,jt.Z)({},gl,{stickyBottomOffset:_t,className:"".concat(At,"-summary"),ref:Cu}),Cr),ae&&La.current&&La.current instanceof Element&&Dt.createElement(Nn,{ref:Ao,offsetScroll:ce,scrollBodyRef:La,onScroll:br,container:Sr,direction:$n}))}else ea=Dt.createElement("div",{style:(0,Ht.Z)((0,Ht.Z)({},wr),vo),className:Ne()("".concat(At,"-content")),onScroll:br,ref:La},Dt.createElement(co,(0,jt.Z)({style:(0,Ht.Z)((0,Ht.Z)({},Xr),{},{tableLayout:Ar})},Oo),Ys,hu,nn!==!1&&Dt.createElement(Yi,(0,jt.Z)({},Zo,ps)),Al,kr&&Dt.createElement(Oe,{stickyOffsets:Bl,flattenColumns:so},kr)));var ol=Dt.createElement("div",(0,jt.Z)({className:Ne()(At,jn,(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(At,"-rtl"),$n==="rtl"),"".concat(At,"-ping-left"),zs),"".concat(At,"-ping-right"),xa),"".concat(At,"-layout-fixed"),Vn==="fixed"),"".concat(At,"-fixed-header"),ga),"".concat(At,"-fixed-column"),Eo),"".concat(At,"-fixed-column-gapped"),Eo&&ns),"".concat(At,"-scroll-horizontal"),_o),"".concat(At,"-has-fix-left"),so[0]&&so[0].fixed),"".concat(At,"-has-fix-right"),so[so.length-1]&&so[so.length-1].fixed==="right")),style:Li,id:ii,ref:ms},Tl),An&&Dt.createElement(Gt,{className:"".concat(At,"-title")},An(gr)),Dt.createElement("div",{ref:Iu,className:"".concat(At,"-container")},ea),Un&&Dt.createElement(Gt,{className:"".concat(At,"-footer")},Un(gr)));_o&&(ol=Dt.createElement(we.Z,{onResize:no},ol));var Ph=Le(so,Bl,$n),Ul=Dt.useMemo(function(){return{scrollX:Jo,prefixCls:At,getComponent:Mo,scrollbarSize:$i,direction:$n,fixedInfoList:Ph,isSticky:ae,supportSticky:Ro,componentWidth:zo,fixHeader:ga,fixColumn:Eo,horizonScroll:_o,tableLayout:Ar,rowClassName:Qn,expandedRowClassName:qo.expandedRowClassName,expandIcon:fa,expandableType:ca,expandRowByClick:qo.expandRowByClick,expandedRowRender:qo.expandedRowRender,onTriggerExpand:lr,expandIconColumnIndex:qo.expandIconColumnIndex,indentSize:qo.indentSize,allColumnsFixedLeft:so.every(function(bo){return bo.fixed==="left"}),emptyNode:Fa,columns:Yo,flattenColumns:so,onColumnResize:Ir,hoverStartRow:ra,hoverEndRow:bs,onHover:Ba,rowExpandable:qo.rowExpandable,onRow:Or,getRowKey:Fo,expandedKeys:ia,childrenColumnName:gi,rowHoverable:Jr}},[Jo,At,Mo,$i,$n,Ph,ae,Ro,zo,ga,Eo,_o,Ar,Qn,qo.expandedRowClassName,fa,ca,qo.expandRowByClick,qo.expandedRowRender,lr,qo.expandIconColumnIndex,qo.indentSize,Fa,Yo,so,Ir,ra,bs,Ba,qo.rowExpandable,Or,Fo,ia,gi,Jr]);return Dt.createElement(Et.Provider,{value:Ul},ol)}var vr=Dt.forwardRef(Ve);function Mr(_e){return st(vr,_e)}var ro=Mr();ro.EXPAND_COLUMN=gt.w,ro.INTERNAL_HOOKS=gt.R,ro.Column=di,ro.ColumnGroup=li,ro.Summary=Ke;var en=ro,Tn=kt(65283),Bi=ge(null),bi=ge(null);function _i(_e,xn,Be){var At=xn||1;return Be[_e+At]-(Be[_e]||0)}function ir(_e){var xn=_e.rowInfo,Be=_e.column,At=_e.colIndex,jn=_e.indent,Qn=_e.index,Li=_e.component,xi=_e.renderIndex,ui=_e.record,mn=_e.style,Vn=_e.className,$n=_e.inverse,An=_e.getHeight,Un=Be.render,Ti=Be.dataIndex,vi=Be.className,ii=Be.width,nn=Qt(bi,["columnsOffset"]),Ni=nn.columnsOffset,Xi=pn(xn,Be,At,jn,Qn),Or=Xi.key,cr=Xi.fixedInfo,oo=Xi.appendCellNode,to=Xi.additionalCellProps,$r=to.style,po=to.colSpan,lo=po===void 0?1:po,Bo=to.rowSpan,Te=Bo===void 0?1:Bo,ao=At-1,Jr=_i(ao,lo,Ni),gr=lo>1?ii-Jr:0,Wr=(0,Ht.Z)((0,Ht.Z)((0,Ht.Z)({},$r),mn),{},{flex:"0 0 ".concat(Jr,"px"),width:"".concat(Jr,"px"),marginRight:gr,pointerEvents:"auto"}),Lr=Dt.useMemo(function(){return $n?Te<=1:lo===0||Te===0||Te>1},[Te,lo,$n]);Lr?Wr.visibility="hidden":$n&&(Wr.height=An==null?void 0:An(Te));var Mo=Lr?function(){return null}:Un,Fo={};return(Te===0||lo===0)&&(Fo.rowSpan=1,Fo.colSpan=1),Dt.createElement(ne,(0,jt.Z)({className:Ne()(vi,Vn),ellipsis:Be.ellipsis,align:Be.align,scope:Be.rowScope,component:Li,prefixCls:xn.prefixCls,key:Or,record:ui,index:Qn,renderIndex:xi,dataIndex:Ti,render:Mo,shouldCellUpdate:Be.shouldCellUpdate},cr,{appendNode:oo,additionalProps:(0,Ht.Z)((0,Ht.Z)({},to),{},{style:Wr},Fo)}))}var yr=ir,Nr=["data","index","className","rowKey","style","extra","getHeight"],_r=Dt.forwardRef(function(_e,xn){var Be=_e.data,At=_e.index,jn=_e.className,Qn=_e.rowKey,Li=_e.style,xi=_e.extra,ui=_e.getHeight,mn=(0,Pt.Z)(_e,Nr),Vn=Be.record,$n=Be.indent,An=Be.index,Un=Qt(Et,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),Ti=Un.scrollX,vi=Un.flattenColumns,ii=Un.prefixCls,nn=Un.fixColumn,Ni=Un.componentWidth,Xi=Qt(Bi,["getComponent"]),Or=Xi.getComponent,cr=dn(Vn,Qn,At,$n),oo=Or(["body","row"],"div"),to=Or(["body","cell"],"div"),$r=cr.rowSupportExpand,po=cr.expanded,lo=cr.rowProps,Bo=cr.expandedRowRender,Te=cr.expandedRowClassName,ao;if($r&&po){var Jr=Bo(Vn,At,$n+1,po),gr=Xn(Te,Vn,At,$n),Wr={};nn&&(Wr={style:(0,pe.Z)({},"--virtual-width","".concat(Ni,"px"))});var Lr="".concat(ii,"-expanded-row-cell");ao=Dt.createElement(oo,{className:Ne()("".concat(ii,"-expanded-row"),"".concat(ii,"-expanded-row-level-").concat($n+1),gr)},Dt.createElement(ne,{component:to,prefixCls:ii,className:Ne()(Lr,(0,pe.Z)({},"".concat(Lr,"-fixed"),nn)),additionalProps:Wr},Jr))}var Mo=(0,Ht.Z)((0,Ht.Z)({},Li),{},{width:Ti});xi&&(Mo.position="absolute",Mo.pointerEvents="none");var Fo=Dt.createElement(oo,(0,jt.Z)({},lo,mn,{"data-row-key":Qn,ref:$r?null:xn,className:Ne()(jn,"".concat(ii,"-row"),lo==null?void 0:lo.className,(0,pe.Z)({},"".concat(ii,"-row-extra"),xi)),style:(0,Ht.Z)((0,Ht.Z)({},Mo),lo==null?void 0:lo.style)}),vi.map(function(zr,Zr){return Dt.createElement(yr,{key:Zr,component:to,rowInfo:cr,column:zr,colIndex:Zr,indent:$n,index:At,renderIndex:An,record:Vn,inverse:xi,getHeight:ui})}));return $r?Dt.createElement("div",{ref:xn},Fo,ao):Fo}),Rr=pt(_r),cn=Rr,ho=Dt.forwardRef(function(_e,xn){var Be=_e.data,At=_e.onScroll,jn=Qt(Et,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","scrollX","direction"]),Qn=jn.flattenColumns,Li=jn.onColumnResize,xi=jn.getRowKey,ui=jn.expandedKeys,mn=jn.prefixCls,Vn=jn.childrenColumnName,$n=jn.scrollX,An=jn.direction,Un=Qt(Bi),Ti=Un.sticky,vi=Un.scrollY,ii=Un.listItemHeight,nn=Un.getComponent,Ni=Un.onScroll,Xi=Dt.useRef(),Or=hn(Be,Vn,ui,xi),cr=Dt.useMemo(function(){var ao=0;return Qn.map(function(Jr){var gr=Jr.width,Wr=Jr.key;return ao+=gr,[Wr,gr,ao]})},[Qn]),oo=Dt.useMemo(function(){return cr.map(function(ao){return ao[2]})},[cr]);Dt.useEffect(function(){cr.forEach(function(ao){var Jr=(0,Ut.Z)(ao,2),gr=Jr[0],Wr=Jr[1];Li(gr,Wr)})},[cr]),Dt.useImperativeHandle(xn,function(){var ao,Jr={scrollTo:function(Wr){var Lr;(Lr=Xi.current)===null||Lr===void 0||Lr.scrollTo(Wr)},nativeElement:(ao=Xi.current)===null||ao===void 0?void 0:ao.nativeElement};return Object.defineProperty(Jr,"scrollLeft",{get:function(){var Wr;return((Wr=Xi.current)===null||Wr===void 0?void 0:Wr.getScrollInfo().x)||0},set:function(Wr){var Lr;(Lr=Xi.current)===null||Lr===void 0||Lr.scrollTo({left:Wr})}}),Jr});var to=function(Jr,gr){var Wr,Lr=(Wr=Or[gr])===null||Wr===void 0?void 0:Wr.record,Mo=Jr.onCell;if(Mo){var Fo,zr=Mo(Lr,gr);return(Fo=zr==null?void 0:zr.rowSpan)!==null&&Fo!==void 0?Fo:1}return 1},$r=function(Jr){var gr=Jr.start,Wr=Jr.end,Lr=Jr.getSize,Mo=Jr.offsetY;if(Wr<0)return null;for(var Fo=Qn.filter(function(fa){return to(fa,gr)===0}),zr=gr,Zr=function(gi){if(Fo=Fo.filter(function(lr){return to(lr,gi)===0}),!Fo.length)return zr=gi,1},Za=gr;Za>=0&&!Zr(Za);Za-=1);for(var ra=Qn.filter(function(fa){return to(fa,Wr)!==1}),bs=Wr,Ba=function(gi){if(ra=ra.filter(function(lr){return to(lr,gi)!==1}),!ra.length)return bs=Math.max(gi-1,Wr),1},or=Wr;or<Or.length&&!Ba(or);or+=1);for(var $o=[],qo=function(gi){var lr=Or[gi];if(!lr)return 1;Qn.some(function(jr){return to(jr,gi)>1})&&$o.push(gi)},ca=zr;ca<=bs;ca+=1)qo(ca);var ia=$o.map(function(fa){var gi=Or[fa],lr=xi(gi.record,fa),jr=function(zo){var dr=fa+zo-1,Ya=xi(Or[dr].record,dr),da=Lr(lr,Ya);return da.bottom-da.top},qr=Lr(lr);return Dt.createElement(cn,{key:fa,data:gi,rowKey:lr,index:fa,style:{top:-Mo+qr.top},extra:!0,getHeight:jr})});return ia},po=Dt.useMemo(function(){return{columnsOffset:oo}},[oo]),lo="".concat(mn,"-tbody"),Bo=nn(["body","wrapper"]),Te={};return Ti&&(Te.position="sticky",Te.bottom=0,(0,Xt.Z)(Ti)==="object"&&Ti.offsetScroll&&(Te.bottom=Ti.offsetScroll)),Dt.createElement(bi.Provider,{value:po},Dt.createElement(Tn.Z,{fullHeight:!1,ref:Xi,prefixCls:"".concat(lo,"-virtual"),styles:{horizontalScrollBar:Te},className:lo,height:vi,itemHeight:ii||24,data:Or,itemKey:function(Jr){return xi(Jr.record)},component:Bo,scrollWidth:$n,direction:An,onVirtualScroll:function(Jr){var gr,Wr=Jr.x;At({currentTarget:(gr=Xi.current)===null||gr===void 0?void 0:gr.nativeElement,scrollLeft:Wr})},onScroll:Ni,extraRender:$r},function(ao,Jr,gr){var Wr=xi(ao.record,Jr);return Dt.createElement(cn,{data:ao,rowKey:Wr,index:Jr,style:gr.style})}))}),gn=pt(ho),Wi=gn,Kr=function(xn,Be){var At=Be.ref,jn=Be.onScroll;return Dt.createElement(Wi,{ref:At,data:xn,onScroll:jn})};function zi(_e,xn){var Be=_e.data,At=_e.columns,jn=_e.scroll,Qn=_e.sticky,Li=_e.prefixCls,xi=Li===void 0?ni:Li,ui=_e.className,mn=_e.listItemHeight,Vn=_e.components,$n=_e.onScroll,An=jn||{},Un=An.x,Ti=An.y;typeof Un!="number"&&(Un=1),typeof Ti!="number"&&(Ti=500);var vi=(0,Kn.zX)(function(Ni,Xi){return(0,xe.Z)(Vn,Ni)||Xi}),ii=(0,Kn.zX)($n),nn=Dt.useMemo(function(){return{sticky:Qn,scrollY:Ti,listItemHeight:mn,getComponent:vi,onScroll:ii}},[Qn,Ti,mn,vi,ii]);return Dt.createElement(Bi.Provider,{value:nn},Dt.createElement(en,(0,jt.Z)({},_e,{className:Ne()(ui,"".concat(xi,"-virtual")),scroll:(0,Ht.Z)((0,Ht.Z)({},jn),{},{x:Un}),components:(0,Ht.Z)((0,Ht.Z)({},Vn),{},{body:Be!=null&&Be.length?Kr:void 0}),columns:At,internalHooks:gt.R,tailor:!0,ref:xn})))}var wo=Dt.forwardRef(zi);function Yr(_e){return st(wo,_e)}var Er=Yr(),Co=null},54451:function(Mn,Rn,kt){"use strict";kt.d(Rn,{g:function(){return Dt},v:function(){return he}});var gt=kt(20439),Ut=kt(62646),ue=kt(48736),Ee=["expandable"],he="RC_TABLE_INTERNAL_COL_DEFINE";function Dt(ee){var ge=ee.expandable,Qt=(0,Ut.Z)(ee,Ee),jt;return"expandable"in ee?jt=(0,gt.Z)((0,gt.Z)({},Qt),ge):jt=Qt,jt.showExpandColumn===!1&&(jt.expandIconColumnIndex=-1),jt}},22711:function(Mn,Rn,kt){"use strict";kt.r(Rn),kt.d(Rn,{ResizableTextArea:function(){return re},default:function(){return Ue}});var gt=kt(14809),Ut=kt(4635),ue=kt(20439),Ee=kt(95190),he=kt(50298),Dt=kt(62646),ee=kt(92310),ge=kt.n(ee),Qt=kt(36901),jt=kt(66003),Ae=kt(30292),se=kt(18929),Pe=kt(59301),Bt=kt(93664),nt=kt(29301),et=kt(34280),ht=kt(16089),st=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
pointer-events: none !important;
`,pt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],vt={},St;function Et(je){var Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,fn=je.getAttribute("id")||je.getAttribute("data-reactid")||je.getAttribute("name");if(Je&&vt[fn])return vt[fn];var te=window.getComputedStyle(je),Jt=te.getPropertyValue("box-sizing")||te.getPropertyValue("-moz-box-sizing")||te.getPropertyValue("-webkit-box-sizing"),Xe=parseFloat(te.getPropertyValue("padding-bottom"))+parseFloat(te.getPropertyValue("padding-top")),On=parseFloat(te.getPropertyValue("border-bottom-width"))+parseFloat(te.getPropertyValue("border-top-width")),bn=pt.map(function(on){return"".concat(on,":").concat(te.getPropertyValue(on))}).join(";"),De={sizingStyle:bn,paddingSize:Xe,borderSize:On,boxSizing:Jt};return Je&&fn&&(vt[fn]=De),De}function Tt(je){var Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,fn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;St||(St=document.createElement("textarea"),St.setAttribute("tab-index","-1"),St.setAttribute("aria-hidden","true"),St.setAttribute("name","hiddenTextarea"),document.body.appendChild(St)),je.getAttribute("wrap")?St.setAttribute("wrap",je.getAttribute("wrap")):St.removeAttribute("wrap");var Jt=Et(je,Je),Xe=Jt.paddingSize,On=Jt.borderSize,bn=Jt.boxSizing,De=Jt.sizingStyle;St.setAttribute("style","".concat(De,";").concat(st)),St.value=je.value||je.placeholder||"";var on=void 0,un=void 0,Kn,Me=St.scrollHeight;if(bn==="border-box"?Me+=On:bn==="content-box"&&(Me-=Xe),fn!==null||te!==null){St.value=" ";var vn=St.scrollHeight-Xe;fn!==null&&(on=vn*fn,bn==="border-box"&&(on=on+Xe+On),Me=Math.max(on,Me)),te!==null&&(un=vn*te,bn==="border-box"&&(un=un+Xe+On),Kn=Me>un?"":"hidden",Me=Math.min(un,Me))}var ne={height:Me,overflowY:Kn,resize:"none"};return on&&(ne.minHeight=on),un&&(ne.maxHeight=un),ne}var It=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],qt=0,Xt=1,Ht=2,pe=Pe.forwardRef(function(je,Je){var fn=je,te=fn.prefixCls,Jt=fn.defaultValue,Xe=fn.value,On=fn.autoSize,bn=fn.onResize,De=fn.className,on=fn.style,un=fn.disabled,Kn=fn.onChange,Me=fn.onInternalAutoSize,vn=(0,Dt.Z)(fn,It),ne=(0,se.Z)(Jt,{value:Xe,postState:function(In){return In!=null?In:""}}),wn=(0,he.Z)(ne,2),fi=wn[0],Rt=wn[1],Lt=function(In){Rt(In.target.value),Kn==null||Kn(In)},Pt=Pe.useRef();Pe.useImperativeHandle(Je,function(){return{textArea:Pt.current}});var Nt=Pe.useMemo(function(){return On&&(0,Bt.Z)(On)==="object"?[On.minRows,On.maxRows]:[]},[On]),Zt=(0,he.Z)(Nt,2),Mt=Zt[0],Yt=Zt[1],Ge=!!On,Oe=function(){try{if(document.activeElement===Pt.current){var In=Pt.current,pi=In.selectionStart,ei=In.selectionEnd,mi=In.scrollTop;Pt.current.setSelectionRange(pi,ei),Pt.current.scrollTop=mi}}catch(Hi){}},Ke=Pe.useState(Ht),we=(0,he.Z)(Ke,2),Ce=we[0],Fe=we[1],He=Pe.useState(),Qe=(0,he.Z)(He,2),hn=Qe[0],dn=Qe[1],ri=function(){Fe(qt)};(0,et.Z)(function(){Ge&&ri()},[Xe,Mt,Yt,Ge]),(0,et.Z)(function(){if(Ce===qt)Fe(Xt);else if(Ce===Xt){var rn=Tt(Pt.current,!1,Mt,Yt);Fe(Ht),dn(rn)}else Oe()},[Ce]);var ze=Pe.useRef(),We=function(){ht.Z.cancel(ze.current)},an=function(In){Ce===Ht&&(bn==null||bn(In),On&&(We(),ze.current=(0,ht.Z)(function(){ri()})))};Pe.useEffect(function(){return We},[]);var Xn=Ge?hn:null,pn=(0,ue.Z)((0,ue.Z)({},on),Xn);return(Ce===qt||Ce===Xt)&&(pn.overflowY="hidden",pn.overflowX="hidden"),Pe.createElement(nt.Z,{onResize:an,disabled:!(On||bn)},Pe.createElement("textarea",(0,gt.Z)({},vn,{ref:Pt,style:pn,className:ge()(te,De,(0,Ut.Z)({},"".concat(te,"-disabled"),un)),disabled:un,value:fi,onChange:Lt})))}),re=pe,Ne=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],ye=Pe.forwardRef(function(je,Je){var fn,te=je.defaultValue,Jt=je.value,Xe=je.onFocus,On=je.onBlur,bn=je.onChange,De=je.allowClear,on=je.maxLength,un=je.onCompositionStart,Kn=je.onCompositionEnd,Me=je.suffix,vn=je.prefixCls,ne=vn===void 0?"rc-textarea":vn,wn=je.showCount,fi=je.count,Rt=je.className,Lt=je.style,Pt=je.disabled,Nt=je.hidden,Zt=je.classNames,Mt=je.styles,Yt=je.onResize,Ge=je.onClear,Oe=je.onPressEnter,Ke=je.readOnly,we=je.autoSize,Ce=je.onKeyDown,Fe=(0,Dt.Z)(je,Ne),He=(0,se.Z)(te,{value:Jt,defaultValue:te}),Qe=(0,he.Z)(He,2),hn=Qe[0],dn=Qe[1],ri=hn==null?"":String(hn),ze=Pe.useState(!1),We=(0,he.Z)(ze,2),an=We[0],Xn=We[1],pn=Pe.useRef(!1),rn=Pe.useState(null),In=(0,he.Z)(rn,2),pi=In[0],ei=In[1],mi=(0,Pe.useRef)(null),Hi=(0,Pe.useRef)(null),Cn=function(){var ki;return(ki=Hi.current)===null||ki===void 0?void 0:ki.textArea},Sn=function(){Cn().focus()};(0,Pe.useImperativeHandle)(Je,function(){var Dn;return{resizableTextArea:Hi.current,focus:Sn,blur:function(){Cn().blur()},nativeElement:((Dn=mi.current)===null||Dn===void 0?void 0:Dn.nativeElement)||Cn()}}),(0,Pe.useEffect)(function(){Xn(function(Dn){return!Pt&&Dn})},[Pt]);var Bn=Pe.useState(null),si=(0,he.Z)(Bn,2),yi=si[0],hi=si[1];Pe.useEffect(function(){if(yi){var Dn;(Dn=Cn()).setSelectionRange.apply(Dn,(0,Ee.Z)(yi))}},[yi]);var Gi=(0,jt.Z)(fi,wn),wt=(fn=Gi.max)!==null&&fn!==void 0?fn:on,Ye=Number(wt)>0,Zn=Gi.strategy(ri),Ln=!!wt&&Zn>wt,zn=function(ki,Di){var Ki=Di;!pn.current&&Gi.exceedFormatter&&Gi.max&&Gi.strategy(Di)>Gi.max&&(Ki=Gi.exceedFormatter(Di,{max:Gi.max}),Di!==Ki&&hi([Cn().selectionStart||0,Cn().selectionEnd||0])),dn(Ki),(0,Ae.rJ)(ki.currentTarget,ki,bn,Ki)},oi=function(ki){pn.current=!0,un==null||un(ki)},Si=function(ki){pn.current=!1,zn(ki,ki.currentTarget.value),Kn==null||Kn(ki)},Yi=function(ki){zn(ki,ki.target.value)},Fi=function(ki){ki.key==="Enter"&&Oe&&Oe(ki),Ce==null||Ce(ki)},ve=function(ki){Xn(!0),Xe==null||Xe(ki)},Le=function(ki){Xn(!1),On==null||On(ki)},Se=function(ki){dn(""),Sn(),(0,Ae.rJ)(Cn(),ki,bn)},ti=Me,Yn;Gi.show&&(Gi.showFormatter?Yn=Gi.showFormatter({value:ri,count:Zn,maxLength:wt}):Yn="".concat(Zn).concat(Ye?" / ".concat(wt):""),ti=Pe.createElement(Pe.Fragment,null,ti,Pe.createElement("span",{className:ge()("".concat(ne,"-data-count"),Zt==null?void 0:Zt.count),style:Mt==null?void 0:Mt.count},Yn)));var Wn=function(ki){var Di;Yt==null||Yt(ki),(Di=Cn())!==null&&Di!==void 0&&Di.style.height&&ei(!0)},qe=!we&&!wn&&!De;return Pe.createElement(Qt.BaseInput,{ref:mi,value:ri,allowClear:De,handleReset:Se,suffix:ti,prefixCls:ne,classNames:(0,ue.Z)((0,ue.Z)({},Zt),{},{affixWrapper:ge()(Zt==null?void 0:Zt.affixWrapper,(0,Ut.Z)((0,Ut.Z)({},"".concat(ne,"-show-count"),wn),"".concat(ne,"-textarea-allow-clear"),De))}),disabled:Pt,focused:an,className:ge()(Rt,Ln&&"".concat(ne,"-out-of-range")),style:(0,ue.Z)((0,ue.Z)({},Lt),pi&&!qe?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Yn=="string"?Yn:void 0}},hidden:Nt,readOnly:Ke,onClear:Ge},Pe.createElement(re,(0,gt.Z)({},Fe,{autoSize:we,maxLength:on,onKeyDown:Fi,onChange:Yi,onFocus:ve,onBlur:Le,onCompositionStart:oi,onCompositionEnd:Si,className:ge()(Zt==null?void 0:Zt.textarea),style:(0,ue.Z)((0,ue.Z)({},Mt==null?void 0:Mt.textarea),{},{resize:Lt==null?void 0:Lt.resize}),disabled:Pt,prefixCls:ne,onResize:Wn,ref:Hi,readOnly:Ke})))}),xe=ye,Ue=xe},639:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return vt}});var gt=kt(14809),Ut=kt(4635),ue=kt(20439),Ee=kt(50298),he=kt(62646),Dt=kt(59301),ee=kt(92310),ge=kt.n(ee),Qt=kt(26112),jt=kt(30699),Ae=function(Et){for(var Tt=Et.prefixCls,It=Et.level,qt=Et.isStart,Xt=Et.isEnd,Ht="".concat(Tt,"-indent-unit"),pe=[],re=0;re<It;re+=1)pe.push(Dt.createElement("span",{key:re,className:ge()(Ht,(0,Ut.Z)((0,Ut.Z)({},"".concat(Ht,"-start"),qt[re]),"".concat(Ht,"-end"),Xt[re]))}));return Dt.createElement("span",{"aria-hidden":"true",className:"".concat(Tt,"-indent")},pe)},se=Dt.memo(Ae),Pe=kt(65065),Bt=kt(34061),nt=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],et="open",ht="close",st="---",pt=function(Et){var Tt,It,qt,Xt=Et.eventKey,Ht=Et.className,pe=Et.style,re=Et.dragOver,Ne=Et.dragOverGapTop,ye=Et.dragOverGapBottom,xe=Et.isLeaf,Ue=Et.isStart,je=Et.isEnd,Je=Et.expanded,fn=Et.selected,te=Et.checked,Jt=Et.halfChecked,Xe=Et.loading,On=Et.domRef,bn=Et.active,De=Et.data,on=Et.onMouseMove,un=Et.selectable,Kn=(0,he.Z)(Et,nt),Me=Dt.useContext(jt.k),vn=Dt.useContext(jt.y),ne=Dt.useRef(null),wn=Dt.useState(!1),fi=(0,Ee.Z)(wn,2),Rt=fi[0],Lt=fi[1],Pt=!!(Me.disabled||Et.disabled||(Tt=vn.nodeDisabled)!==null&&Tt!==void 0&&Tt.call(vn,De)),Nt=Dt.useMemo(function(){return!Me.checkable||Et.checkable===!1?!1:Me.checkable},[Me.checkable,Et.checkable]),Zt=function(Zn){Pt||Me.onNodeSelect(Zn,(0,Bt.F)(Et))},Mt=function(Zn){Pt||!Nt||Et.disableCheckbox||Me.onNodeCheck(Zn,(0,Bt.F)(Et),!te)},Yt=Dt.useMemo(function(){return typeof un=="boolean"?un:Me.selectable},[un,Me.selectable]),Ge=function(Zn){Me.onNodeClick(Zn,(0,Bt.F)(Et)),Yt?Zt(Zn):Mt(Zn)},Oe=function(Zn){Me.onNodeDoubleClick(Zn,(0,Bt.F)(Et))},Ke=function(Zn){Me.onNodeMouseEnter(Zn,(0,Bt.F)(Et))},we=function(Zn){Me.onNodeMouseLeave(Zn,(0,Bt.F)(Et))},Ce=function(Zn){Me.onNodeContextMenu(Zn,(0,Bt.F)(Et))},Fe=Dt.useMemo(function(){return!!(Me.draggable&&(!Me.draggable.nodeDraggable||Me.draggable.nodeDraggable(De)))},[Me.draggable,De]),He=function(Zn){Zn.stopPropagation(),Lt(!0),Me.onNodeDragStart(Zn,Et);try{Zn.dataTransfer.setData("text/plain","")}catch(Ln){}},Qe=function(Zn){Zn.preventDefault(),Zn.stopPropagation(),Me.onNodeDragEnter(Zn,Et)},hn=function(Zn){Zn.preventDefault(),Zn.stopPropagation(),Me.onNodeDragOver(Zn,Et)},dn=function(Zn){Zn.stopPropagation(),Me.onNodeDragLeave(Zn,Et)},ri=function(Zn){Zn.stopPropagation(),Lt(!1),Me.onNodeDragEnd(Zn,Et)},ze=function(Zn){Zn.preventDefault(),Zn.stopPropagation(),Lt(!1),Me.onNodeDrop(Zn,Et)},We=function(Zn){Xe||Me.onNodeExpand(Zn,(0,Bt.F)(Et))},an=Dt.useMemo(function(){var Ye=(0,Pe.Z)(Me.keyEntities,Xt)||{},Zn=Ye.children;return!!(Zn||[]).length},[Me.keyEntities,Xt]),Xn=Dt.useMemo(function(){return xe===!1?!1:xe||!Me.loadData&&!an||Me.loadData&&Et.loaded&&!an},[xe,Me.loadData,an,Et.loaded]);Dt.useEffect(function(){Xe||typeof Me.loadData=="function"&&Je&&!Xn&&!Et.loaded&&Me.onNodeLoad((0,Bt.F)(Et))},[Xe,Me.loadData,Me.onNodeLoad,Je,Xn,Et]);var pn=Dt.useMemo(function(){var Ye;return(Ye=Me.draggable)!==null&&Ye!==void 0&&Ye.icon?Dt.createElement("span",{className:"".concat(Me.prefixCls,"-draggable-icon")},Me.draggable.icon):null},[Me.draggable]),rn=function(Zn){var Ln=Et.switcherIcon||Me.switcherIcon;return typeof Ln=="function"?Ln((0,ue.Z)((0,ue.Z)({},Et),{},{isLeaf:Zn})):Ln},In=function(){if(Xn){var Zn=rn(!0);return Zn!==!1?Dt.createElement("span",{className:ge()("".concat(Me.prefixCls,"-switcher"),"".concat(Me.prefixCls,"-switcher-noop"))},Zn):null}var Ln=rn(!1);return Ln!==!1?Dt.createElement("span",{onClick:We,className:ge()("".concat(Me.prefixCls,"-switcher"),"".concat(Me.prefixCls,"-switcher_").concat(Je?et:ht))},Ln):null},pi=Dt.useMemo(function(){if(!Nt)return null;var Ye=typeof Nt!="boolean"?Nt:null;return Dt.createElement("span",{className:ge()("".concat(Me.prefixCls,"-checkbox"),(0,Ut.Z)((0,Ut.Z)((0,Ut.Z)({},"".concat(Me.prefixCls,"-checkbox-checked"),te),"".concat(Me.prefixCls,"-checkbox-indeterminate"),!te&&Jt),"".concat(Me.prefixCls,"-checkbox-disabled"),Pt||Et.disableCheckbox)),onClick:Mt,role:"checkbox","aria-checked":Jt?"mixed":te,"aria-disabled":Pt||Et.disableCheckbox,"aria-label":"Select ".concat(typeof Et.title=="string"?Et.title:"tree node")},Ye)},[Nt,te,Jt,Pt,Et.disableCheckbox,Et.title]),ei=Dt.useMemo(function(){return Xn?null:Je?et:ht},[Xn,Je]),mi=Dt.useMemo(function(){return Dt.createElement("span",{className:ge()("".concat(Me.prefixCls,"-iconEle"),"".concat(Me.prefixCls,"-icon__").concat(ei||"docu"),(0,Ut.Z)({},"".concat(Me.prefixCls,"-icon_loading"),Xe))})},[Me.prefixCls,ei,Xe]),Hi=Dt.useMemo(function(){var Ye=!!Me.draggable,Zn=!Et.disabled&&Ye&&Me.dragOverNodeKey===Xt;return Zn?Me.dropIndicatorRender({dropPosition:Me.dropPosition,dropLevelOffset:Me.dropLevelOffset,indent:Me.indent,prefixCls:Me.prefixCls,direction:Me.direction}):null},[Me.dropPosition,Me.dropLevelOffset,Me.indent,Me.prefixCls,Me.direction,Me.draggable,Me.dragOverNodeKey,Me.dropIndicatorRender]),Cn=Dt.useMemo(function(){var Ye=Et.title,Zn=Ye===void 0?st:Ye,Ln="".concat(Me.prefixCls,"-node-content-wrapper"),zn;if(Me.showIcon){var oi=Et.icon||Me.icon;zn=oi?Dt.createElement("span",{className:ge()("".concat(Me.prefixCls,"-iconEle"),"".concat(Me.prefixCls,"-icon__customize"))},typeof oi=="function"?oi(Et):oi):mi}else Me.loadData&&Xe&&(zn=mi);var Si;return typeof Zn=="function"?Si=Zn(De):Me.titleRender?Si=Me.titleRender(De):Si=Zn,Dt.createElement("span",{ref:ne,title:typeof Zn=="string"?Zn:"",className:ge()(Ln,"".concat(Ln,"-").concat(ei||"normal"),(0,Ut.Z)({},"".concat(Me.prefixCls,"-node-selected"),!Pt&&(fn||Rt))),onMouseEnter:Ke,onMouseLeave:we,onContextMenu:Ce,onClick:Ge,onDoubleClick:Oe},zn,Dt.createElement("span",{className:"".concat(Me.prefixCls,"-title")},Si),Hi)},[Me.prefixCls,Me.showIcon,Et,Me.icon,mi,Me.titleRender,De,ei,Ke,we,Ce,Ge,Oe]),Sn=(0,Qt.Z)(Kn,{aria:!0,data:!0}),Bn=(0,Pe.Z)(Me.keyEntities,Xt)||{},si=Bn.level,yi=je[je.length-1],hi=!Pt&&Fe,Gi=Me.draggingNodeKey===Xt,wt=un!==void 0?{"aria-selected":!!un}:void 0;return Dt.createElement("div",(0,gt.Z)({ref:On,role:"treeitem","aria-expanded":xe?void 0:Je,className:ge()(Ht,"".concat(Me.prefixCls,"-treenode"),(qt={},(0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)(qt,"".concat(Me.prefixCls,"-treenode-disabled"),Pt),"".concat(Me.prefixCls,"-treenode-switcher-").concat(Je?"open":"close"),!xe),"".concat(Me.prefixCls,"-treenode-checkbox-checked"),te),"".concat(Me.prefixCls,"-treenode-checkbox-indeterminate"),Jt),"".concat(Me.prefixCls,"-treenode-selected"),fn),"".concat(Me.prefixCls,"-treenode-loading"),Xe),"".concat(Me.prefixCls,"-treenode-active"),bn),"".concat(Me.prefixCls,"-treenode-leaf-last"),yi),"".concat(Me.prefixCls,"-treenode-draggable"),Fe),"dragging",Gi),(0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)(qt,"drop-target",Me.dropTargetKey===Xt),"drop-container",Me.dropContainerKey===Xt),"drag-over",!Pt&&re),"drag-over-gap-top",!Pt&&Ne),"drag-over-gap-bottom",!Pt&&ye),"filter-node",(It=Me.filterTreeNode)===null||It===void 0?void 0:It.call(Me,(0,Bt.F)(Et))),"".concat(Me.prefixCls,"-treenode-leaf"),Xn))),style:pe,draggable:hi,onDragStart:hi?He:void 0,onDragEnter:Fe?Qe:void 0,onDragOver:Fe?hn:void 0,onDragLeave:Fe?dn:void 0,onDrop:Fe?ze:void 0,onDragEnd:Fe?ri:void 0,onMouseMove:on},wt,Sn),Dt.createElement(se,{prefixCls:Me.prefixCls,level:si,isStart:Ue,isEnd:je}),pn,In(),pi,Cn)};pt.isTreeNode=1;var vt=pt},30699:function(Mn,Rn,kt){"use strict";kt.d(Rn,{k:function(){return Ut},y:function(){return ue}});var gt=kt(59301),Ut=gt.createContext(null),ue=gt.createContext({})},29530:function(Mn,Rn,kt){"use strict";kt.d(Rn,{OF:function(){return Xt.Z},y6:function(){return ht.y},ZP:function(){return Pt}});var gt=kt(14809),Ut=kt(93664),ue=kt(20439),Ee=kt(95190),he=kt(99153),Dt=kt(84851),ee=kt(13028),ge=kt(19257),Qt=kt(93046),jt=kt(4635),Ae=kt(92310),se=kt.n(Ae),Pe=kt(10228),Bt=kt(26112),nt=kt(48736),et=kt(59301),ht=kt(30699),st=function(Zt){var Mt=Zt.dropPosition,Yt=Zt.dropLevelOffset,Ge=Zt.indent,Oe={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(Mt){case-1:Oe.top=0,Oe.left=-Yt*Ge;break;case 1:Oe.bottom=0,Oe.left=-Yt*Ge;break;case 0:Oe.bottom=0,Oe.left=Ge;break}return et.createElement("div",{style:Oe})},pt=st;function vt(Nt){if(Nt==null)throw new TypeError("Cannot destructure "+Nt)}var St=kt(50298),Et=kt(62646),Tt=kt(34280),It=kt(65283),qt=kt(77900),Xt=kt(639);function Ht(Nt,Zt){var Mt=et.useState(!1),Yt=(0,St.Z)(Mt,2),Ge=Yt[0],Oe=Yt[1];(0,Tt.Z)(function(){if(Ge)return Nt(),function(){Zt()}},[Ge]),(0,Tt.Z)(function(){return Oe(!0),function(){Oe(!1)}},[])}var pe=Ht,re=kt(34061),Ne=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],ye=et.forwardRef(function(Nt,Zt){var Mt=Nt.className,Yt=Nt.style,Ge=Nt.motion,Oe=Nt.motionNodes,Ke=Nt.motionType,we=Nt.onMotionStart,Ce=Nt.onMotionEnd,Fe=Nt.active,He=Nt.treeNodeRequiredProps,Qe=(0,Et.Z)(Nt,Ne),hn=et.useState(!0),dn=(0,St.Z)(hn,2),ri=dn[0],ze=dn[1],We=et.useContext(ht.k),an=We.prefixCls,Xn=Oe&&Ke!=="hide";(0,Tt.Z)(function(){Oe&&Xn!==ri&&ze(Xn)},[Oe]);var pn=function(){Oe&&we()},rn=et.useRef(!1),In=function(){Oe&&!rn.current&&(rn.current=!0,Ce())};pe(pn,In);var pi=function(mi){Xn===mi&&In()};return Oe?et.createElement(qt.default,(0,gt.Z)({ref:Zt,visible:ri},Ge,{motionAppear:Ke==="show",onVisibleChanged:pi}),function(ei,mi){var Hi=ei.className,Cn=ei.style;return et.createElement("div",{ref:mi,className:se()("".concat(an,"-treenode-motion"),Hi),style:Cn},Oe.map(function(Sn){var Bn=Object.assign({},(vt(Sn.data),Sn.data)),si=Sn.title,yi=Sn.key,hi=Sn.isStart,Gi=Sn.isEnd;delete Bn.children;var wt=(0,re.H8)(yi,He);return et.createElement(Xt.Z,(0,gt.Z)({},Bn,wt,{title:si,active:Fe,data:Sn.data,key:yi,isStart:hi,isEnd:Gi}))}))}):et.createElement(Xt.Z,(0,gt.Z)({domRef:Zt,className:Mt,style:Yt},Qe,{active:Fe}))}),xe=ye;function Ue(){var Nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Zt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Mt=Nt.length,Yt=Zt.length;if(Math.abs(Mt-Yt)!==1)return{add:!1,key:null};function Ge(Oe,Ke){var we=new Map;Oe.forEach(function(Fe){we.set(Fe,!0)});var Ce=Ke.filter(function(Fe){return!we.has(Fe)});return Ce.length===1?Ce[0]:null}return Mt<Yt?{add:!0,key:Ge(Nt,Zt)}:{add:!1,key:Ge(Zt,Nt)}}function je(Nt,Zt,Mt){var Yt=Nt.findIndex(function(we){return we.key===Mt}),Ge=Nt[Yt+1],Oe=Zt.findIndex(function(we){return we.key===Mt});if(Ge){var Ke=Zt.findIndex(function(we){return we.key===Ge.key});return Zt.slice(Oe+1,Ke)}return Zt.slice(Oe+1)}var Je=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],fn={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},te=function(){},Jt="RC_TREE_MOTION_".concat(Math.random()),Xe={key:Jt},On={key:Jt,level:0,index:0,pos:"0",node:Xe,nodes:[Xe]},bn={parent:null,children:[],pos:On.pos,data:Xe,title:null,key:Jt,isStart:[],isEnd:[]};function De(Nt,Zt,Mt,Yt){return Zt===!1||!Mt?Nt:Nt.slice(0,Math.ceil(Mt/Yt)+1)}function on(Nt){var Zt=Nt.key,Mt=Nt.pos;return(0,re.km)(Zt,Mt)}function un(Nt){for(var Zt=String(Nt.data.key),Mt=Nt;Mt.parent;)Mt=Mt.parent,Zt="".concat(Mt.data.key," > ").concat(Zt);return Zt}var Kn=et.forwardRef(function(Nt,Zt){var Mt=Nt.prefixCls,Yt=Nt.data,Ge=Nt.selectable,Oe=Nt.checkable,Ke=Nt.expandedKeys,we=Nt.selectedKeys,Ce=Nt.checkedKeys,Fe=Nt.loadedKeys,He=Nt.loadingKeys,Qe=Nt.halfCheckedKeys,hn=Nt.keyEntities,dn=Nt.disabled,ri=Nt.dragging,ze=Nt.dragOverNodeKey,We=Nt.dropPosition,an=Nt.motion,Xn=Nt.height,pn=Nt.itemHeight,rn=Nt.virtual,In=Nt.scrollWidth,pi=Nt.focusable,ei=Nt.activeItem,mi=Nt.focused,Hi=Nt.tabIndex,Cn=Nt.onKeyDown,Sn=Nt.onFocus,Bn=Nt.onBlur,si=Nt.onActiveChange,yi=Nt.onListChangeStart,hi=Nt.onListChangeEnd,Gi=(0,Et.Z)(Nt,Je),wt=et.useRef(null),Ye=et.useRef(null);et.useImperativeHandle(Zt,function(){return{scrollTo:function(_n){wt.current.scrollTo(_n)},getIndentWidth:function(){return Ye.current.offsetWidth}}});var Zn=et.useState(Ke),Ln=(0,St.Z)(Zn,2),zn=Ln[0],oi=Ln[1],Si=et.useState(Yt),Yi=(0,St.Z)(Si,2),Fi=Yi[0],ve=Yi[1],Le=et.useState(Yt),Se=(0,St.Z)(Le,2),ti=Se[0],Yn=Se[1],Wn=et.useState([]),qe=(0,St.Z)(Wn,2),Dn=qe[0],ki=qe[1],Di=et.useState(null),Ki=(0,St.Z)(Di,2),Gt=Ki[0],me=Ki[1],En=et.useRef(Yt);En.current=Yt;function Gn(){var Nn=En.current;ve(Nn),Yn(Nn),ki([]),me(null),hi()}(0,Tt.Z)(function(){oi(Ke);var Nn=Ue(zn,Ke);if(Nn.key!==null)if(Nn.add){var _n=Fi.findIndex(function(Oi){var Ii=Oi.key;return Ii===Nn.key}),di=De(je(Fi,Yt,Nn.key),rn,Xn,pn),Jn=Fi.slice();Jn.splice(_n+1,0,bn),Yn(Jn),ki(di),me("show")}else{var li=Yt.findIndex(function(Oi){var Ii=Oi.key;return Ii===Nn.key}),ni=De(je(Yt,Fi,Nn.key),rn,Xn,pn),ji=Yt.slice();ji.splice(li+1,0,bn),Yn(ji),ki(ni),me("hide")}else Fi!==Yt&&(ve(Yt),Yn(Yt))},[Ke,Yt]),et.useEffect(function(){ri||Gn()},[ri]);var Re=an?ti:Yt,$e={expandedKeys:Ke,selectedKeys:we,loadedKeys:Fe,loadingKeys:He,checkedKeys:Ce,halfCheckedKeys:Qe,dragOverNodeKey:ze,dropPosition:We,keyEntities:hn};return et.createElement(et.Fragment,null,mi&&ei&&et.createElement("span",{style:fn,"aria-live":"assertive"},un(ei)),et.createElement("div",null,et.createElement("input",{style:fn,disabled:pi===!1||dn,tabIndex:pi!==!1?Hi:null,onKeyDown:Cn,onFocus:Sn,onBlur:Bn,value:"",onChange:te,"aria-label":"for screen reader"})),et.createElement("div",{className:"".concat(Mt,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},et.createElement("div",{className:"".concat(Mt,"-indent")},et.createElement("div",{ref:Ye,className:"".concat(Mt,"-indent-unit")}))),et.createElement(It.Z,(0,gt.Z)({},Gi,{data:Re,itemKey:on,height:Xn,fullHeight:!1,virtual:rn,itemHeight:pn,scrollWidth:In,prefixCls:"".concat(Mt,"-list"),ref:wt,role:"tree",onVisibleChange:function(_n){_n.every(function(di){return on(di)!==Jt})&&Gn()}}),function(Nn){var _n=Nn.pos,di=Object.assign({},(vt(Nn.data),Nn.data)),Jn=Nn.title,li=Nn.key,ni=Nn.isStart,ji=Nn.isEnd,Oi=(0,re.km)(li,_n);delete di.key,delete di.children;var Ii=(0,re.H8)(Oi,$e);return et.createElement(xe,(0,gt.Z)({},di,Ii,{title:Jn,active:!!ei&&li===ei.key,pos:_n,data:Nn.data,isStart:ni,isEnd:ji,motion:an,motionNodes:li===Jt?Dn:null,motionType:Gt,onMotionStart:yi,onMotionEnd:Gn,treeNodeRequiredProps:$e,onMouseMove:function(){si(null)}}))}))}),Me=Kn,vn=kt(82661),ne=kt(34643),wn=kt(65065),fi=10,Rt=function(Nt){(0,ge.Z)(Mt,Nt);var Zt=(0,Qt.Z)(Mt);function Mt(){var Yt;(0,he.Z)(this,Mt);for(var Ge=arguments.length,Oe=new Array(Ge),Ke=0;Ke<Ge;Ke++)Oe[Ke]=arguments[Ke];return Yt=Zt.call.apply(Zt,[this].concat(Oe)),(0,jt.Z)((0,ee.Z)(Yt),"destroyed",!1),(0,jt.Z)((0,ee.Z)(Yt),"delayedDragEnterLogic",void 0),(0,jt.Z)((0,ee.Z)(Yt),"loadingRetryTimes",{}),(0,jt.Z)((0,ee.Z)(Yt),"state",{keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:(0,re.w$)()}),(0,jt.Z)((0,ee.Z)(Yt),"dragStartMousePosition",null),(0,jt.Z)((0,ee.Z)(Yt),"dragNodeProps",null),(0,jt.Z)((0,ee.Z)(Yt),"currentMouseOverDroppableNodeKey",null),(0,jt.Z)((0,ee.Z)(Yt),"listRef",et.createRef()),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDragStart",function(we,Ce){var Fe=Yt.state,He=Fe.expandedKeys,Qe=Fe.keyEntities,hn=Yt.props.onDragStart,dn=Ce.eventKey;Yt.dragNodeProps=Ce,Yt.dragStartMousePosition={x:we.clientX,y:we.clientY};var ri=(0,vn._5)(He,dn);Yt.setState({draggingNodeKey:dn,dragChildrenKeys:(0,vn.wA)(dn,Qe),indent:Yt.listRef.current.getIndentWidth()}),Yt.setExpandedKeys(ri),window.addEventListener("dragend",Yt.onWindowDragEnd),hn==null||hn({event:we,node:(0,re.F)(Ce)})}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDragEnter",function(we,Ce){var Fe=Yt.state,He=Fe.expandedKeys,Qe=Fe.keyEntities,hn=Fe.dragChildrenKeys,dn=Fe.flattenNodes,ri=Fe.indent,ze=Yt.props,We=ze.onDragEnter,an=ze.onExpand,Xn=ze.allowDrop,pn=ze.direction,rn=Ce.pos,In=Ce.eventKey;if(Yt.currentMouseOverDroppableNodeKey!==In&&(Yt.currentMouseOverDroppableNodeKey=In),!Yt.dragNodeProps){Yt.resetDragState();return}var pi=(0,vn.OM)(we,Yt.dragNodeProps,Ce,ri,Yt.dragStartMousePosition,Xn,dn,Qe,He,pn),ei=pi.dropPosition,mi=pi.dropLevelOffset,Hi=pi.dropTargetKey,Cn=pi.dropContainerKey,Sn=pi.dropTargetPos,Bn=pi.dropAllowed,si=pi.dragOverNodeKey;if(hn.includes(Hi)||!Bn){Yt.resetDragState();return}if(Yt.delayedDragEnterLogic||(Yt.delayedDragEnterLogic={}),Object.keys(Yt.delayedDragEnterLogic).forEach(function(yi){clearTimeout(Yt.delayedDragEnterLogic[yi])}),Yt.dragNodeProps.eventKey!==Ce.eventKey&&(we.persist(),Yt.delayedDragEnterLogic[rn]=window.setTimeout(function(){if(Yt.state.draggingNodeKey!==null){var yi=(0,Ee.Z)(He),hi=(0,wn.Z)(Qe,Ce.eventKey);hi&&(hi.children||[]).length&&(yi=(0,vn.L0)(He,Ce.eventKey)),Yt.props.hasOwnProperty("expandedKeys")||Yt.setExpandedKeys(yi),an==null||an(yi,{node:(0,re.F)(Ce),expanded:!0,nativeEvent:we.nativeEvent})}},800)),Yt.dragNodeProps.eventKey===Hi&&mi===0){Yt.resetDragState();return}Yt.setState({dragOverNodeKey:si,dropPosition:ei,dropLevelOffset:mi,dropTargetKey:Hi,dropContainerKey:Cn,dropTargetPos:Sn,dropAllowed:Bn}),We==null||We({event:we,node:(0,re.F)(Ce),expandedKeys:He})}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDragOver",function(we,Ce){var Fe=Yt.state,He=Fe.dragChildrenKeys,Qe=Fe.flattenNodes,hn=Fe.keyEntities,dn=Fe.expandedKeys,ri=Fe.indent,ze=Yt.props,We=ze.onDragOver,an=ze.allowDrop,Xn=ze.direction;if(Yt.dragNodeProps){var pn=(0,vn.OM)(we,Yt.dragNodeProps,Ce,ri,Yt.dragStartMousePosition,an,Qe,hn,dn,Xn),rn=pn.dropPosition,In=pn.dropLevelOffset,pi=pn.dropTargetKey,ei=pn.dropContainerKey,mi=pn.dropTargetPos,Hi=pn.dropAllowed,Cn=pn.dragOverNodeKey;He.includes(pi)||!Hi||(Yt.dragNodeProps.eventKey===pi&&In===0?Yt.state.dropPosition===null&&Yt.state.dropLevelOffset===null&&Yt.state.dropTargetKey===null&&Yt.state.dropContainerKey===null&&Yt.state.dropTargetPos===null&&Yt.state.dropAllowed===!1&&Yt.state.dragOverNodeKey===null||Yt.resetDragState():rn===Yt.state.dropPosition&&In===Yt.state.dropLevelOffset&&pi===Yt.state.dropTargetKey&&ei===Yt.state.dropContainerKey&&mi===Yt.state.dropTargetPos&&Hi===Yt.state.dropAllowed&&Cn===Yt.state.dragOverNodeKey||Yt.setState({dropPosition:rn,dropLevelOffset:In,dropTargetKey:pi,dropContainerKey:ei,dropTargetPos:mi,dropAllowed:Hi,dragOverNodeKey:Cn}),We==null||We({event:we,node:(0,re.F)(Ce)}))}}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDragLeave",function(we,Ce){Yt.currentMouseOverDroppableNodeKey===Ce.eventKey&&!we.currentTarget.contains(we.relatedTarget)&&(Yt.resetDragState(),Yt.currentMouseOverDroppableNodeKey=null);var Fe=Yt.props.onDragLeave;Fe==null||Fe({event:we,node:(0,re.F)(Ce)})}),(0,jt.Z)((0,ee.Z)(Yt),"onWindowDragEnd",function(we){Yt.onNodeDragEnd(we,null,!0),window.removeEventListener("dragend",Yt.onWindowDragEnd)}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDragEnd",function(we,Ce){var Fe=Yt.props.onDragEnd;Yt.setState({dragOverNodeKey:null}),Yt.cleanDragState(),Fe==null||Fe({event:we,node:(0,re.F)(Ce)}),Yt.dragNodeProps=null,window.removeEventListener("dragend",Yt.onWindowDragEnd)}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDrop",function(we,Ce){var Fe,He=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Qe=Yt.state,hn=Qe.dragChildrenKeys,dn=Qe.dropPosition,ri=Qe.dropTargetKey,ze=Qe.dropTargetPos,We=Qe.dropAllowed;if(We){var an=Yt.props.onDrop;if(Yt.setState({dragOverNodeKey:null}),Yt.cleanDragState(),ri!==null){var Xn=(0,ue.Z)((0,ue.Z)({},(0,re.H8)(ri,Yt.getTreeNodeRequiredProps())),{},{active:((Fe=Yt.getActiveItem())===null||Fe===void 0?void 0:Fe.key)===ri,data:(0,wn.Z)(Yt.state.keyEntities,ri).node}),pn=hn.includes(ri);(0,nt.ZP)(!pn,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var rn=(0,vn.yx)(ze),In={event:we,node:(0,re.F)(Xn),dragNode:Yt.dragNodeProps?(0,re.F)(Yt.dragNodeProps):null,dragNodesKeys:[Yt.dragNodeProps.eventKey].concat(hn),dropToGap:dn!==0,dropPosition:dn+Number(rn[rn.length-1])};He||an==null||an(In),Yt.dragNodeProps=null}}}),(0,jt.Z)((0,ee.Z)(Yt),"cleanDragState",function(){var we=Yt.state.draggingNodeKey;we!==null&&Yt.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),Yt.dragStartMousePosition=null,Yt.currentMouseOverDroppableNodeKey=null}),(0,jt.Z)((0,ee.Z)(Yt),"triggerExpandActionExpand",function(we,Ce){var Fe=Yt.state,He=Fe.expandedKeys,Qe=Fe.flattenNodes,hn=Ce.expanded,dn=Ce.key,ri=Ce.isLeaf;if(!(ri||we.shiftKey||we.metaKey||we.ctrlKey)){var ze=Qe.filter(function(an){return an.key===dn})[0],We=(0,re.F)((0,ue.Z)((0,ue.Z)({},(0,re.H8)(dn,Yt.getTreeNodeRequiredProps())),{},{data:ze.data}));Yt.setExpandedKeys(hn?(0,vn._5)(He,dn):(0,vn.L0)(He,dn)),Yt.onNodeExpand(we,We)}}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeClick",function(we,Ce){var Fe=Yt.props,He=Fe.onClick,Qe=Fe.expandAction;Qe==="click"&&Yt.triggerExpandActionExpand(we,Ce),He==null||He(we,Ce)}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDoubleClick",function(we,Ce){var Fe=Yt.props,He=Fe.onDoubleClick,Qe=Fe.expandAction;Qe==="doubleClick"&&Yt.triggerExpandActionExpand(we,Ce),He==null||He(we,Ce)}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeSelect",function(we,Ce){var Fe=Yt.state.selectedKeys,He=Yt.state,Qe=He.keyEntities,hn=He.fieldNames,dn=Yt.props,ri=dn.onSelect,ze=dn.multiple,We=Ce.selected,an=Ce[hn.key],Xn=!We;Xn?ze?Fe=(0,vn.L0)(Fe,an):Fe=[an]:Fe=(0,vn._5)(Fe,an);var pn=Fe.map(function(rn){var In=(0,wn.Z)(Qe,rn);return In?In.node:null}).filter(Boolean);Yt.setUncontrolledState({selectedKeys:Fe}),ri==null||ri(Fe,{event:"select",selected:Xn,node:Ce,selectedNodes:pn,nativeEvent:we.nativeEvent})}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeCheck",function(we,Ce,Fe){var He=Yt.state,Qe=He.keyEntities,hn=He.checkedKeys,dn=He.halfCheckedKeys,ri=Yt.props,ze=ri.checkStrictly,We=ri.onCheck,an=Ce.key,Xn,pn={event:"check",node:Ce,checked:Fe,nativeEvent:we.nativeEvent};if(ze){var rn=Fe?(0,vn.L0)(hn,an):(0,vn._5)(hn,an),In=(0,vn._5)(dn,an);Xn={checked:rn,halfChecked:In},pn.checkedNodes=rn.map(function(Sn){return(0,wn.Z)(Qe,Sn)}).filter(Boolean).map(function(Sn){return Sn.node}),Yt.setUncontrolledState({checkedKeys:rn})}else{var pi=(0,ne.S)([].concat((0,Ee.Z)(hn),[an]),!0,Qe),ei=pi.checkedKeys,mi=pi.halfCheckedKeys;if(!Fe){var Hi=new Set(ei);Hi.delete(an);var Cn=(0,ne.S)(Array.from(Hi),{checked:!1,halfCheckedKeys:mi},Qe);ei=Cn.checkedKeys,mi=Cn.halfCheckedKeys}Xn=ei,pn.checkedNodes=[],pn.checkedNodesPositions=[],pn.halfCheckedKeys=mi,ei.forEach(function(Sn){var Bn=(0,wn.Z)(Qe,Sn);if(Bn){var si=Bn.node,yi=Bn.pos;pn.checkedNodes.push(si),pn.checkedNodesPositions.push({node:si,pos:yi})}}),Yt.setUncontrolledState({checkedKeys:ei},!1,{halfCheckedKeys:mi})}We==null||We(Xn,pn)}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeLoad",function(we){var Ce,Fe=we.key,He=Yt.state.keyEntities,Qe=(0,wn.Z)(He,Fe);if(!(Qe!=null&&(Ce=Qe.children)!==null&&Ce!==void 0&&Ce.length)){var hn=new Promise(function(dn,ri){Yt.setState(function(ze){var We=ze.loadedKeys,an=We===void 0?[]:We,Xn=ze.loadingKeys,pn=Xn===void 0?[]:Xn,rn=Yt.props,In=rn.loadData,pi=rn.onLoad;if(!In||an.includes(Fe)||pn.includes(Fe))return null;var ei=In(we);return ei.then(function(){var mi=Yt.state.loadedKeys,Hi=(0,vn.L0)(mi,Fe);pi==null||pi(Hi,{event:"load",node:we}),Yt.setUncontrolledState({loadedKeys:Hi}),Yt.setState(function(Cn){return{loadingKeys:(0,vn._5)(Cn.loadingKeys,Fe)}}),dn()}).catch(function(mi){if(Yt.setState(function(Cn){return{loadingKeys:(0,vn._5)(Cn.loadingKeys,Fe)}}),Yt.loadingRetryTimes[Fe]=(Yt.loadingRetryTimes[Fe]||0)+1,Yt.loadingRetryTimes[Fe]>=fi){var Hi=Yt.state.loadedKeys;(0,nt.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),Yt.setUncontrolledState({loadedKeys:(0,vn.L0)(Hi,Fe)}),dn()}ri(mi)}),{loadingKeys:(0,vn.L0)(pn,Fe)}})});return hn.catch(function(){}),hn}}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeMouseEnter",function(we,Ce){var Fe=Yt.props.onMouseEnter;Fe==null||Fe({event:we,node:Ce})}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeMouseLeave",function(we,Ce){var Fe=Yt.props.onMouseLeave;Fe==null||Fe({event:we,node:Ce})}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeContextMenu",function(we,Ce){var Fe=Yt.props.onRightClick;Fe&&(we.preventDefault(),Fe({event:we,node:Ce}))}),(0,jt.Z)((0,ee.Z)(Yt),"onFocus",function(){var we=Yt.props.onFocus;Yt.setState({focused:!0});for(var Ce=arguments.length,Fe=new Array(Ce),He=0;He<Ce;He++)Fe[He]=arguments[He];we==null||we.apply(void 0,Fe)}),(0,jt.Z)((0,ee.Z)(Yt),"onBlur",function(){var we=Yt.props.onBlur;Yt.setState({focused:!1}),Yt.onActiveChange(null);for(var Ce=arguments.length,Fe=new Array(Ce),He=0;He<Ce;He++)Fe[He]=arguments[He];we==null||we.apply(void 0,Fe)}),(0,jt.Z)((0,ee.Z)(Yt),"getTreeNodeRequiredProps",function(){var we=Yt.state,Ce=we.expandedKeys,Fe=we.selectedKeys,He=we.loadedKeys,Qe=we.loadingKeys,hn=we.checkedKeys,dn=we.halfCheckedKeys,ri=we.dragOverNodeKey,ze=we.dropPosition,We=we.keyEntities;return{expandedKeys:Ce||[],selectedKeys:Fe||[],loadedKeys:He||[],loadingKeys:Qe||[],checkedKeys:hn||[],halfCheckedKeys:dn||[],dragOverNodeKey:ri,dropPosition:ze,keyEntities:We}}),(0,jt.Z)((0,ee.Z)(Yt),"setExpandedKeys",function(we){var Ce=Yt.state,Fe=Ce.treeData,He=Ce.fieldNames,Qe=(0,re.oH)(Fe,we,He);Yt.setUncontrolledState({expandedKeys:we,flattenNodes:Qe},!0)}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeExpand",function(we,Ce){var Fe=Yt.state.expandedKeys,He=Yt.state,Qe=He.listChanging,hn=He.fieldNames,dn=Yt.props,ri=dn.onExpand,ze=dn.loadData,We=Ce.expanded,an=Ce[hn.key];if(!Qe){var Xn=Fe.includes(an),pn=!We;if((0,nt.ZP)(We&&Xn||!We&&!Xn,"Expand state not sync with index check"),Fe=pn?(0,vn.L0)(Fe,an):(0,vn._5)(Fe,an),Yt.setExpandedKeys(Fe),ri==null||ri(Fe,{node:Ce,expanded:pn,nativeEvent:we.nativeEvent}),pn&&ze){var rn=Yt.onNodeLoad(Ce);rn&&rn.then(function(){var In=(0,re.oH)(Yt.state.treeData,Fe,hn);Yt.setUncontrolledState({flattenNodes:In})}).catch(function(){var In=Yt.state.expandedKeys,pi=(0,vn._5)(In,an);Yt.setExpandedKeys(pi)})}}}),(0,jt.Z)((0,ee.Z)(Yt),"onListChangeStart",function(){Yt.setUncontrolledState({listChanging:!0})}),(0,jt.Z)((0,ee.Z)(Yt),"onListChangeEnd",function(){setTimeout(function(){Yt.setUncontrolledState({listChanging:!1})})}),(0,jt.Z)((0,ee.Z)(Yt),"onActiveChange",function(we){var Ce=Yt.state.activeKey,Fe=Yt.props,He=Fe.onActiveChange,Qe=Fe.itemScrollOffset,hn=Qe===void 0?0:Qe;Ce!==we&&(Yt.setState({activeKey:we}),we!==null&&Yt.scrollTo({key:we,offset:hn}),He==null||He(we))}),(0,jt.Z)((0,ee.Z)(Yt),"getActiveItem",function(){var we=Yt.state,Ce=we.activeKey,Fe=we.flattenNodes;return Ce===null?null:Fe.find(function(He){var Qe=He.key;return Qe===Ce})||null}),(0,jt.Z)((0,ee.Z)(Yt),"offsetActiveKey",function(we){var Ce=Yt.state,Fe=Ce.flattenNodes,He=Ce.activeKey,Qe=Fe.findIndex(function(ri){var ze=ri.key;return ze===He});Qe===-1&&we<0&&(Qe=Fe.length),Qe=(Qe+we+Fe.length)%Fe.length;var hn=Fe[Qe];if(hn){var dn=hn.key;Yt.onActiveChange(dn)}else Yt.onActiveChange(null)}),(0,jt.Z)((0,ee.Z)(Yt),"onKeyDown",function(we){var Ce=Yt.state,Fe=Ce.activeKey,He=Ce.expandedKeys,Qe=Ce.checkedKeys,hn=Ce.fieldNames,dn=Yt.props,ri=dn.onKeyDown,ze=dn.checkable,We=dn.selectable;switch(we.which){case Pe.Z.UP:{Yt.offsetActiveKey(-1),we.preventDefault();break}case Pe.Z.DOWN:{Yt.offsetActiveKey(1),we.preventDefault();break}}var an=Yt.getActiveItem();if(an&&an.data){var Xn=Yt.getTreeNodeRequiredProps(),pn=an.data.isLeaf===!1||!!(an.data[hn.children]||[]).length,rn=(0,re.F)((0,ue.Z)((0,ue.Z)({},(0,re.H8)(Fe,Xn)),{},{data:an.data,active:!0}));switch(we.which){case Pe.Z.LEFT:{pn&&He.includes(Fe)?Yt.onNodeExpand({},rn):an.parent&&Yt.onActiveChange(an.parent.key),we.preventDefault();break}case Pe.Z.RIGHT:{pn&&!He.includes(Fe)?Yt.onNodeExpand({},rn):an.children&&an.children.length&&Yt.onActiveChange(an.children[0].key),we.preventDefault();break}case Pe.Z.ENTER:case Pe.Z.SPACE:{ze&&!rn.disabled&&rn.checkable!==!1&&!rn.disableCheckbox?Yt.onNodeCheck({},rn,!Qe.includes(Fe)):!ze&&We&&!rn.disabled&&rn.selectable!==!1&&Yt.onNodeSelect({},rn);break}}}ri==null||ri(we)}),(0,jt.Z)((0,ee.Z)(Yt),"setUncontrolledState",function(we){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!Yt.destroyed){var He=!1,Qe=!0,hn={};Object.keys(we).forEach(function(dn){if(Yt.props.hasOwnProperty(dn)){Qe=!1;return}He=!0,hn[dn]=we[dn]}),He&&(!Ce||Qe)&&Yt.setState((0,ue.Z)((0,ue.Z)({},hn),Fe))}}),(0,jt.Z)((0,ee.Z)(Yt),"scrollTo",function(we){Yt.listRef.current.scrollTo(we)}),Yt}return(0,Dt.Z)(Mt,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var Ge=this.props,Oe=Ge.activeKey,Ke=Ge.itemScrollOffset,we=Ke===void 0?0:Ke;Oe!==void 0&&Oe!==this.state.activeKey&&(this.setState({activeKey:Oe}),Oe!==null&&this.scrollTo({key:Oe,offset:we}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var Ge=this.state,Oe=Ge.focused,Ke=Ge.flattenNodes,we=Ge.keyEntities,Ce=Ge.draggingNodeKey,Fe=Ge.activeKey,He=Ge.dropLevelOffset,Qe=Ge.dropContainerKey,hn=Ge.dropTargetKey,dn=Ge.dropPosition,ri=Ge.dragOverNodeKey,ze=Ge.indent,We=this.props,an=We.prefixCls,Xn=We.className,pn=We.style,rn=We.showLine,In=We.focusable,pi=We.tabIndex,ei=pi===void 0?0:pi,mi=We.selectable,Hi=We.showIcon,Cn=We.icon,Sn=We.switcherIcon,Bn=We.draggable,si=We.checkable,yi=We.checkStrictly,hi=We.disabled,Gi=We.motion,wt=We.loadData,Ye=We.filterTreeNode,Zn=We.height,Ln=We.itemHeight,zn=We.scrollWidth,oi=We.virtual,Si=We.titleRender,Yi=We.dropIndicatorRender,Fi=We.onContextMenu,ve=We.onScroll,Le=We.direction,Se=We.rootClassName,ti=We.rootStyle,Yn=(0,Bt.Z)(this.props,{aria:!0,data:!0}),Wn;Bn&&((0,Ut.Z)(Bn)==="object"?Wn=Bn:typeof Bn=="function"?Wn={nodeDraggable:Bn}:Wn={});var qe={prefixCls:an,selectable:mi,showIcon:Hi,icon:Cn,switcherIcon:Sn,draggable:Wn,draggingNodeKey:Ce,checkable:si,checkStrictly:yi,disabled:hi,keyEntities:we,dropLevelOffset:He,dropContainerKey:Qe,dropTargetKey:hn,dropPosition:dn,dragOverNodeKey:ri,indent:ze,direction:Le,dropIndicatorRender:Yi,loadData:wt,filterTreeNode:Ye,titleRender:Si,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return et.createElement(ht.k.Provider,{value:qe},et.createElement("div",{className:se()(an,Xn,Se,(0,jt.Z)((0,jt.Z)((0,jt.Z)({},"".concat(an,"-show-line"),rn),"".concat(an,"-focused"),Oe),"".concat(an,"-active-focused"),Fe!==null)),style:ti},et.createElement(Me,(0,gt.Z)({ref:this.listRef,prefixCls:an,style:pn,data:Ke,disabled:hi,selectable:mi,checkable:!!si,motion:Gi,dragging:Ce!==null,height:Zn,itemHeight:Ln,virtual:oi,focusable:In,focused:Oe,tabIndex:ei,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Fi,onScroll:ve,scrollWidth:zn},this.getTreeNodeRequiredProps(),Yn))))}}],[{key:"getDerivedStateFromProps",value:function(Ge,Oe){var Ke=Oe.prevProps,we={prevProps:Ge};function Ce(ei){return!Ke&&Ge.hasOwnProperty(ei)||Ke&&Ke[ei]!==Ge[ei]}var Fe,He=Oe.fieldNames;if(Ce("fieldNames")&&(He=(0,re.w$)(Ge.fieldNames),we.fieldNames=He),Ce("treeData")?Fe=Ge.treeData:Ce("children")&&((0,nt.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Fe=(0,re.zn)(Ge.children)),Fe){we.treeData=Fe;var Qe=(0,re.I8)(Fe,{fieldNames:He});we.keyEntities=(0,ue.Z)((0,jt.Z)({},Jt,On),Qe.keyEntities)}var hn=we.keyEntities||Oe.keyEntities;if(Ce("expandedKeys")||Ke&&Ce("autoExpandParent"))we.expandedKeys=Ge.autoExpandParent||!Ke&&Ge.defaultExpandParent?(0,vn.r7)(Ge.expandedKeys,hn):Ge.expandedKeys;else if(!Ke&&Ge.defaultExpandAll){var dn=(0,ue.Z)({},hn);delete dn[Jt];var ri=[];Object.keys(dn).forEach(function(ei){var mi=dn[ei];mi.children&&mi.children.length&&ri.push(mi.key)}),we.expandedKeys=ri}else!Ke&&Ge.defaultExpandedKeys&&(we.expandedKeys=Ge.autoExpandParent||Ge.defaultExpandParent?(0,vn.r7)(Ge.defaultExpandedKeys,hn):Ge.defaultExpandedKeys);if(we.expandedKeys||delete we.expandedKeys,Fe||we.expandedKeys){var ze=(0,re.oH)(Fe||Oe.treeData,we.expandedKeys||Oe.expandedKeys,He);we.flattenNodes=ze}if(Ge.selectable&&(Ce("selectedKeys")?we.selectedKeys=(0,vn.BT)(Ge.selectedKeys,Ge):!Ke&&Ge.defaultSelectedKeys&&(we.selectedKeys=(0,vn.BT)(Ge.defaultSelectedKeys,Ge))),Ge.checkable){var We;if(Ce("checkedKeys")?We=(0,vn.E6)(Ge.checkedKeys)||{}:!Ke&&Ge.defaultCheckedKeys?We=(0,vn.E6)(Ge.defaultCheckedKeys)||{}:Fe&&(We=(0,vn.E6)(Ge.checkedKeys)||{checkedKeys:Oe.checkedKeys,halfCheckedKeys:Oe.halfCheckedKeys}),We){var an=We,Xn=an.checkedKeys,pn=Xn===void 0?[]:Xn,rn=an.halfCheckedKeys,In=rn===void 0?[]:rn;if(!Ge.checkStrictly){var pi=(0,ne.S)(pn,!0,hn);pn=pi.checkedKeys,In=pi.halfCheckedKeys}we.checkedKeys=pn,we.halfCheckedKeys=In}}return Ce("loadedKeys")&&(we.loadedKeys=Ge.loadedKeys),we}}]),Mt}(et.Component);(0,jt.Z)(Rt,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:pt,allowDrop:function(){return!0},expandAction:!1}),(0,jt.Z)(Rt,"TreeNode",Xt.Z);var Lt=Rt,Pt=Lt},82661:function(Mn,Rn,kt){"use strict";kt.d(Rn,{BT:function(){return et},E6:function(){return pt},L0:function(){return jt},OM:function(){return nt},_5:function(){return Qt},r7:function(){return vt},wA:function(){return se},yx:function(){return Ae}});var gt=kt(95190),Ut=kt(93664),ue=kt(48736),Ee=kt(59301),he=kt(639),Dt=kt(65065),ee=kt(34061),ge=null;function Qt(St,Et){if(!St)return[];var Tt=St.slice(),It=Tt.indexOf(Et);return It>=0&&Tt.splice(It,1),Tt}function jt(St,Et){var Tt=(St||[]).slice();return Tt.indexOf(Et)===-1&&Tt.push(Et),Tt}function Ae(St){return St.split("-")}function se(St,Et){var Tt=[],It=(0,Dt.Z)(Et,St);function qt(){var Xt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Xt.forEach(function(Ht){var pe=Ht.key,re=Ht.children;Tt.push(pe),qt(re)})}return qt(It.children),Tt}function Pe(St){if(St.parent){var Et=Ae(St.pos);return Number(Et[Et.length-1])===St.parent.children.length-1}return!1}function Bt(St){var Et=Ae(St.pos);return Number(Et[Et.length-1])===0}function nt(St,Et,Tt,It,qt,Xt,Ht,pe,re,Ne){var ye,xe=St.clientX,Ue=St.clientY,je=St.target.getBoundingClientRect(),Je=je.top,fn=je.height,te=(Ne==="rtl"?-1:1)*(((qt==null?void 0:qt.x)||0)-xe),Jt=(te-12)/It,Xe=re.filter(function(Pt){var Nt;return(Nt=pe[Pt])===null||Nt===void 0||(Nt=Nt.children)===null||Nt===void 0?void 0:Nt.length}),On=(0,Dt.Z)(pe,Tt.eventKey);if(Ue<Je+fn/2){var bn=Ht.findIndex(function(Pt){return Pt.key===On.key}),De=bn<=0?0:bn-1,on=Ht[De].key;On=(0,Dt.Z)(pe,on)}var un=On.key,Kn=On,Me=On.key,vn=0,ne=0;if(!Xe.includes(un))for(var wn=0;wn<Jt&&Pe(On);wn+=1)On=On.parent,ne+=1;var fi=Et.data,Rt=On.node,Lt=!0;return Bt(On)&&On.level===0&&Ue<Je+fn/2&&Xt({dragNode:fi,dropNode:Rt,dropPosition:-1})&&On.key===Tt.eventKey?vn=-1:(Kn.children||[]).length&&Xe.includes(Me)?Xt({dragNode:fi,dropNode:Rt,dropPosition:0})?vn=0:Lt=!1:ne===0?Jt>-1.5?Xt({dragNode:fi,dropNode:Rt,dropPosition:1})?vn=1:Lt=!1:Xt({dragNode:fi,dropNode:Rt,dropPosition:0})?vn=0:Xt({dragNode:fi,dropNode:Rt,dropPosition:1})?vn=1:Lt=!1:Xt({dragNode:fi,dropNode:Rt,dropPosition:1})?vn=1:Lt=!1,{dropPosition:vn,dropLevelOffset:ne,dropTargetKey:On.key,dropTargetPos:On.pos,dragOverNodeKey:Me,dropContainerKey:vn===0?null:((ye=On.parent)===null||ye===void 0?void 0:ye.key)||null,dropAllowed:Lt}}function et(St,Et){if(St){var Tt=Et.multiple;return Tt?St.slice():St.length?[St[0]]:St}}var ht=function(Et){return Et};function st(St,Et){if(!St)return[];var Tt=Et||{},It=Tt.processProps,qt=It===void 0?ht:It,Xt=Array.isArray(St)?St:[St];return Xt.map(function(Ht){var pe=Ht.children,re=_objectWithoutProperties(Ht,ge),Ne=st(pe,Et);return React.createElement(TreeNode,_extends({key:re.key},qt(re)),Ne)})}function pt(St){if(!St)return null;var Et;if(Array.isArray(St))Et={checkedKeys:St,halfCheckedKeys:void 0};else if((0,Ut.Z)(St)==="object")Et={checkedKeys:St.checked||void 0,halfCheckedKeys:St.halfChecked||void 0};else return(0,ue.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return Et}function vt(St,Et){var Tt=new Set;function It(qt){if(!Tt.has(qt)){var Xt=(0,Dt.Z)(Et,qt);if(Xt){Tt.add(qt);var Ht=Xt.parent,pe=Xt.node;pe.disabled||Ht&&It(Ht.key)}}}return(St||[]).forEach(function(qt){It(qt)}),(0,gt.Z)(Tt)}},34643:function(Mn,Rn,kt){"use strict";kt.d(Rn,{S:function(){return ee}});var gt=kt(48736),Ut=kt(65065);function ue(ge,Qt){var jt=new Set;return ge.forEach(function(Ae){Qt.has(Ae)||jt.add(Ae)}),jt}function Ee(ge){var Qt=ge||{},jt=Qt.disabled,Ae=Qt.disableCheckbox,se=Qt.checkable;return!!(jt||Ae)||se===!1}function he(ge,Qt,jt,Ae){for(var se=new Set(ge),Pe=new Set,Bt=0;Bt<=jt;Bt+=1){var nt=Qt.get(Bt)||new Set;nt.forEach(function(pt){var vt=pt.key,St=pt.node,Et=pt.children,Tt=Et===void 0?[]:Et;se.has(vt)&&!Ae(St)&&Tt.filter(function(It){return!Ae(It.node)}).forEach(function(It){se.add(It.key)})})}for(var et=new Set,ht=jt;ht>=0;ht-=1){var st=Qt.get(ht)||new Set;st.forEach(function(pt){var vt=pt.parent,St=pt.node;if(!(Ae(St)||!pt.parent||et.has(pt.parent.key))){if(Ae(pt.parent.node)){et.add(vt.key);return}var Et=!0,Tt=!1;(vt.children||[]).filter(function(It){return!Ae(It.node)}).forEach(function(It){var qt=It.key,Xt=se.has(qt);Et&&!Xt&&(Et=!1),!Tt&&(Xt||Pe.has(qt))&&(Tt=!0)}),Et&&se.add(vt.key),Tt&&Pe.add(vt.key),et.add(vt.key)}})}return{checkedKeys:Array.from(se),halfCheckedKeys:Array.from(ue(Pe,se))}}function Dt(ge,Qt,jt,Ae,se){for(var Pe=new Set(ge),Bt=new Set(Qt),nt=0;nt<=Ae;nt+=1){var et=jt.get(nt)||new Set;et.forEach(function(vt){var St=vt.key,Et=vt.node,Tt=vt.children,It=Tt===void 0?[]:Tt;!Pe.has(St)&&!Bt.has(St)&&!se(Et)&&It.filter(function(qt){return!se(qt.node)}).forEach(function(qt){Pe.delete(qt.key)})})}Bt=new Set;for(var ht=new Set,st=Ae;st>=0;st-=1){var pt=jt.get(st)||new Set;pt.forEach(function(vt){var St=vt.parent,Et=vt.node;if(!(se(Et)||!vt.parent||ht.has(vt.parent.key))){if(se(vt.parent.node)){ht.add(St.key);return}var Tt=!0,It=!1;(St.children||[]).filter(function(qt){return!se(qt.node)}).forEach(function(qt){var Xt=qt.key,Ht=Pe.has(Xt);Tt&&!Ht&&(Tt=!1),!It&&(Ht||Bt.has(Xt))&&(It=!0)}),Tt||Pe.delete(St.key),It&&Bt.add(St.key),ht.add(St.key)}})}return{checkedKeys:Array.from(Pe),halfCheckedKeys:Array.from(ue(Bt,Pe))}}function ee(ge,Qt,jt,Ae){var se=[],Pe;Ae?Pe=Ae:Pe=Ee;var Bt=new Set(ge.filter(function(st){var pt=!!(0,Ut.Z)(jt,st);return pt||se.push(st),pt})),nt=new Map,et=0;Object.keys(jt).forEach(function(st){var pt=jt[st],vt=pt.level,St=nt.get(vt);St||(St=new Set,nt.set(vt,St)),St.add(pt),et=Math.max(et,vt)}),(0,gt.ZP)(!se.length,"Tree missing follow keys: ".concat(se.slice(0,100).map(function(st){return"'".concat(st,"'")}).join(", ")));var ht;return Qt===!0?ht=he(Bt,nt,et,Pe):ht=Dt(Bt,Qt.halfCheckedKeys,nt,et,Pe),ht}},65065:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return gt}});function gt(Ut,ue){return Ut[ue]}},34061:function(Mn,Rn,kt){"use strict";kt.d(Rn,{F:function(){return vt},H8:function(){return pt},I8:function(){return st},km:function(){return se},oH:function(){return et},w$:function(){return Pe},zn:function(){return nt}});var gt=kt(93664),Ut=kt(95190),ue=kt(20439),Ee=kt(62646),he=kt(11592),Dt=kt(2738),ee=kt(48736),ge=kt(65065),Qt=["children"];function jt(St,Et){return"".concat(St,"-").concat(Et)}function Ae(St){return St&&St.type&&St.type.isTreeNode}function se(St,Et){return St!=null?St:Et}function Pe(St){var Et=St||{},Tt=Et.title,It=Et._title,qt=Et.key,Xt=Et.children,Ht=Tt||"title";return{title:Ht,_title:It||[Ht],key:qt||"key",children:Xt||"children"}}function Bt(St,Et){var Tt=new Map;function It(qt){var Xt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(qt||[]).forEach(function(Ht){var pe=Ht[Et.key],re=Ht[Et.children];warning(pe!=null,"Tree node must have a certain key: [".concat(Xt).concat(pe,"]"));var Ne=String(pe);warning(!Tt.has(Ne)||pe===null||pe===void 0,"Same 'key' exist in the Tree: ".concat(Ne)),Tt.set(Ne,!0),It(re,"".concat(Xt).concat(Ne," > "))})}It(St)}function nt(St){function Et(Tt){var It=(0,he.Z)(Tt);return It.map(function(qt){if(!Ae(qt))return(0,ee.ZP)(!qt,"Tree/TreeNode can only accept TreeNode as children."),null;var Xt=qt.key,Ht=qt.props,pe=Ht.children,re=(0,Ee.Z)(Ht,Qt),Ne=(0,ue.Z)({key:Xt},re),ye=Et(pe);return ye.length&&(Ne.children=ye),Ne}).filter(function(qt){return qt})}return Et(St)}function et(St,Et,Tt){var It=Pe(Tt),qt=It._title,Xt=It.key,Ht=It.children,pe=new Set(Et===!0?[]:Et),re=[];function Ne(ye){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return ye.map(function(Ue,je){for(var Je=jt(xe?xe.pos:"0",je),fn=se(Ue[Xt],Je),te,Jt=0;Jt<qt.length;Jt+=1){var Xe=qt[Jt];if(Ue[Xe]!==void 0){te=Ue[Xe];break}}var On=Object.assign((0,Dt.Z)(Ue,[].concat((0,Ut.Z)(qt),[Xt,Ht])),{title:te,key:fn,parent:xe,pos:Je,children:null,data:Ue,isStart:[].concat((0,Ut.Z)(xe?xe.isStart:[]),[je===0]),isEnd:[].concat((0,Ut.Z)(xe?xe.isEnd:[]),[je===ye.length-1])});return re.push(On),Et===!0||pe.has(fn)?On.children=Ne(Ue[Ht]||[],On):On.children=[],On})}return Ne(St),re}function ht(St,Et,Tt){var It={};(0,gt.Z)(Tt)==="object"?It=Tt:It={externalGetKey:Tt},It=It||{};var qt=It,Xt=qt.childrenPropName,Ht=qt.externalGetKey,pe=qt.fieldNames,re=Pe(pe),Ne=re.key,ye=re.children,xe=Xt||ye,Ue;Ht?typeof Ht=="string"?Ue=function(fn){return fn[Ht]}:typeof Ht=="function"&&(Ue=function(fn){return Ht(fn)}):Ue=function(fn,te){return se(fn[Ne],te)};function je(Je,fn,te,Jt){var Xe=Je?Je[xe]:St,On=Je?jt(te.pos,fn):"0",bn=Je?[].concat((0,Ut.Z)(Jt),[Je]):[];if(Je){var De=Ue(Je,On),on={node:Je,index:fn,pos:On,key:De,parentPos:te.node?te.pos:null,level:te.level+1,nodes:bn};Et(on)}Xe&&Xe.forEach(function(un,Kn){je(un,Kn,{node:Je,pos:On,level:te?te.level+1:-1},bn)})}je(null)}function st(St){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Tt=Et.initWrapper,It=Et.processEntity,qt=Et.onProcessFinished,Xt=Et.externalGetKey,Ht=Et.childrenPropName,pe=Et.fieldNames,re=arguments.length>2?arguments[2]:void 0,Ne=Xt||re,ye={},xe={},Ue={posEntities:ye,keyEntities:xe};return Tt&&(Ue=Tt(Ue)||Ue),ht(St,function(je){var Je=je.node,fn=je.index,te=je.pos,Jt=je.key,Xe=je.parentPos,On=je.level,bn=je.nodes,De={node:Je,nodes:bn,index:fn,key:Jt,pos:te,level:On},on=se(Jt,te);ye[te]=De,xe[on]=De,De.parent=ye[Xe],De.parent&&(De.parent.children=De.parent.children||[],De.parent.children.push(De)),It&&It(De,Ue)},{externalGetKey:Ne,childrenPropName:Ht,fieldNames:pe}),qt&&qt(Ue),Ue}function pt(St,Et){var Tt=Et.expandedKeys,It=Et.selectedKeys,qt=Et.loadedKeys,Xt=Et.loadingKeys,Ht=Et.checkedKeys,pe=Et.halfCheckedKeys,re=Et.dragOverNodeKey,Ne=Et.dropPosition,ye=Et.keyEntities,xe=(0,ge.Z)(ye,St),Ue={eventKey:St,expanded:Tt.indexOf(St)!==-1,selected:It.indexOf(St)!==-1,loaded:qt.indexOf(St)!==-1,loading:Xt.indexOf(St)!==-1,checked:Ht.indexOf(St)!==-1,halfChecked:pe.indexOf(St)!==-1,pos:String(xe?xe.pos:""),dragOver:re===St&&Ne===0,dragOverGapTop:re===St&&Ne===-1,dragOverGapBottom:re===St&&Ne===1};return Ue}function vt(St){var Et=St.data,Tt=St.expanded,It=St.selected,qt=St.checked,Xt=St.loaded,Ht=St.loading,pe=St.halfChecked,re=St.dragOver,Ne=St.dragOverGapTop,ye=St.dragOverGapBottom,xe=St.pos,Ue=St.active,je=St.eventKey,Je=(0,ue.Z)((0,ue.Z)({},Et),{},{expanded:Tt,selected:It,checked:qt,loaded:Xt,loading:Ht,halfChecked:pe,dragOver:re,dragOverGapTop:Ne,dragOverGapBottom:ye,pos:xe,active:Ue,key:je});return"props"in Je||Object.defineProperty(Je,"props",{get:function(){return(0,ee.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),St}}),Je}},8224:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Ut}});var gt=kt(4676);function Ut(ue,Ee,he,Dt){var ee=gt.unstable_batchedUpdates?function(Qt){gt.unstable_batchedUpdates(he,Qt)}:he;return ue!=null&&ue.addEventListener&&ue.addEventListener(Ee,ee,Dt),{remove:function(){ue!=null&&ue.removeEventListener&&ue.removeEventListener(Ee,ee,Dt)}}}},24514:function(Mn,Rn,kt){"use strict";kt.d(Rn,{G:function(){return Ee}});var gt=kt(47273),Ut=function(Dt){if((0,gt.Z)()&&window.document.documentElement){var ee=Array.isArray(Dt)?Dt:[Dt],ge=window.document.documentElement;return ee.some(function(Qt){return Qt in ge.style})}return!1},ue=function(Dt,ee){if(!Ut(Dt))return!1;var ge=document.createElement("div"),Qt=ge.style[Dt];return ge.style[Dt]=ee,ge.style[Dt]!==Qt};function Ee(he,Dt){return!Array.isArray(he)&&Dt!==void 0?ue(he,Dt):Ut(he)}},65283:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return fi}});var gt=kt(14809),Ut=kt(93664),ue=kt(20439),Ee=kt(4635),he=kt(50298),Dt=kt(62646),ee=kt(92310),ge=kt.n(ee),Qt=kt(29301),jt=kt(70425),Ae=kt(34280),se=kt(59301),Pe=kt(4676),Bt=se.forwardRef(function(Rt,Lt){var Pt=Rt.height,Nt=Rt.offsetY,Zt=Rt.offsetX,Mt=Rt.children,Yt=Rt.prefixCls,Ge=Rt.onInnerResize,Oe=Rt.innerProps,Ke=Rt.rtl,we=Rt.extra,Ce={},Fe={display:"flex",flexDirection:"column"};return Nt!==void 0&&(Ce={height:Pt,position:"relative",overflow:"hidden"},Fe=(0,ue.Z)((0,ue.Z)({},Fe),{},(0,Ee.Z)((0,Ee.Z)((0,Ee.Z)((0,Ee.Z)((0,Ee.Z)({transform:"translateY(".concat(Nt,"px)")},Ke?"marginRight":"marginLeft",-Zt),"position","absolute"),"left",0),"right",0),"top",0))),se.createElement("div",{style:Ce},se.createElement(Qt.Z,{onResize:function(Qe){var hn=Qe.offsetHeight;hn&&Ge&&Ge()}},se.createElement("div",(0,gt.Z)({style:Fe,className:ge()((0,Ee.Z)({},"".concat(Yt,"-holder-inner"),Yt)),ref:Lt},Oe),Mt,we)))});Bt.displayName="Filler";var nt=Bt;function et(Rt){var Lt=Rt.children,Pt=Rt.setRef,Nt=se.useCallback(function(Zt){Pt(Zt)},[]);return se.cloneElement(Lt,{ref:Nt})}function ht(Rt,Lt,Pt,Nt,Zt,Mt,Yt,Ge){var Oe=Ge.getKey;return Rt.slice(Lt,Pt+1).map(function(Ke,we){var Ce=Lt+we,Fe=Yt(Ke,Ce,{style:{width:Nt},offsetX:Zt}),He=Oe(Ke);return se.createElement(et,{key:He,setRef:function(hn){return Mt(Ke,hn)}},Fe)})}function st(Rt,Lt,Pt,Nt){var Zt=Pt-Rt,Mt=Lt-Pt,Yt=Math.min(Zt,Mt)*2;if(Nt<=Yt){var Ge=Math.floor(Nt/2);return Nt%2?Pt+Ge+1:Pt-Ge}return Zt>Mt?Pt-(Nt-Mt):Pt+(Nt-Zt)}function pt(Rt,Lt,Pt){var Nt=Rt.length,Zt=Lt.length,Mt,Yt;if(Nt===0&&Zt===0)return null;Nt<Zt?(Mt=Rt,Yt=Lt):(Mt=Lt,Yt=Rt);var Ge={__EMPTY_ITEM__:!0};function Oe(Qe){return Qe!==void 0?Pt(Qe):Ge}for(var Ke=null,we=Math.abs(Nt-Zt)!==1,Ce=0;Ce<Yt.length;Ce+=1){var Fe=Oe(Mt[Ce]),He=Oe(Yt[Ce]);if(Fe!==He){Ke=Ce,we=we||Fe!==Oe(Yt[Ce+1]);break}}return Ke===null?null:{index:Ke,multiple:we}}function vt(Rt,Lt,Pt){var Nt=se.useState(Rt),Zt=(0,he.Z)(Nt,2),Mt=Zt[0],Yt=Zt[1],Ge=se.useState(null),Oe=(0,he.Z)(Ge,2),Ke=Oe[0],we=Oe[1];return se.useEffect(function(){var Ce=pt(Mt||[],Rt||[],Lt);(Ce==null?void 0:Ce.index)!==void 0&&(Pt==null||Pt(Ce.index),we(Rt[Ce.index])),Yt(Rt)},[Rt]),[Ke]}var St=kt(16089),Et=(typeof navigator=="undefined"?"undefined":(0,Ut.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Tt=Et,It=function(Rt,Lt,Pt,Nt){var Zt=(0,se.useRef)(!1),Mt=(0,se.useRef)(null);function Yt(){clearTimeout(Mt.current),Zt.current=!0,Mt.current=setTimeout(function(){Zt.current=!1},50)}var Ge=(0,se.useRef)({top:Rt,bottom:Lt,left:Pt,right:Nt});return Ge.current.top=Rt,Ge.current.bottom=Lt,Ge.current.left=Pt,Ge.current.right=Nt,function(Oe,Ke){var we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Ce=Oe?Ke<0&&Ge.current.left||Ke>0&&Ge.current.right:Ke<0&&Ge.current.top||Ke>0&&Ge.current.bottom;return we&&Ce?(clearTimeout(Mt.current),Zt.current=!1):(!Ce||Zt.current)&&Yt(),!Zt.current&&Ce}};function qt(Rt,Lt,Pt,Nt,Zt,Mt,Yt){var Ge=(0,se.useRef)(0),Oe=(0,se.useRef)(null),Ke=(0,se.useRef)(null),we=(0,se.useRef)(!1),Ce=It(Lt,Pt,Nt,Zt);function Fe(ze,We){if(St.Z.cancel(Oe.current),!Ce(!1,We)){var an=ze;if(!an._virtualHandled)an._virtualHandled=!0;else return;Ge.current+=We,Ke.current=We,Tt||an.preventDefault(),Oe.current=(0,St.Z)(function(){var Xn=we.current?10:1;Yt(Ge.current*Xn,!1),Ge.current=0})}}function He(ze,We){Yt(We,!0),Tt||ze.preventDefault()}var Qe=(0,se.useRef)(null),hn=(0,se.useRef)(null);function dn(ze){if(Rt){St.Z.cancel(hn.current),hn.current=(0,St.Z)(function(){Qe.current=null},2);var We=ze.deltaX,an=ze.deltaY,Xn=ze.shiftKey,pn=We,rn=an;(Qe.current==="sx"||!Qe.current&&Xn&&an&&!We)&&(pn=an,rn=0,Qe.current="sx");var In=Math.abs(pn),pi=Math.abs(rn);Qe.current===null&&(Qe.current=Mt&&In>pi?"x":"y"),Qe.current==="y"?Fe(ze,rn):He(ze,pn)}}function ri(ze){Rt&&(we.current=ze.detail===Ke.current)}return[dn,ri]}function Xt(Rt,Lt,Pt,Nt){var Zt=se.useMemo(function(){return[new Map,[]]},[Rt,Pt.id,Nt]),Mt=(0,he.Z)(Zt,2),Yt=Mt[0],Ge=Mt[1],Oe=function(we){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:we,Fe=Yt.get(we),He=Yt.get(Ce);if(Fe===void 0||He===void 0)for(var Qe=Rt.length,hn=Ge.length;hn<Qe;hn+=1){var dn,ri=Rt[hn],ze=Lt(ri);Yt.set(ze,hn);var We=(dn=Pt.get(ze))!==null&&dn!==void 0?dn:Nt;if(Ge[hn]=(Ge[hn-1]||0)+We,ze===we&&(Fe=hn),ze===Ce&&(He=hn),Fe!==void 0&&He!==void 0)break}return{top:Ge[Fe-1]||0,bottom:Ge[He]}};return Oe}var Ht=kt(99153),pe=kt(84851),re=function(){function Rt(){(0,Ht.Z)(this,Rt),(0,Ee.Z)(this,"maps",void 0),(0,Ee.Z)(this,"id",0),(0,Ee.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,pe.Z)(Rt,[{key:"set",value:function(Pt,Nt){this.diffRecords.set(Pt,this.maps[Pt]),this.maps[Pt]=Nt,this.id+=1}},{key:"get",value:function(Pt){return this.maps[Pt]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),Rt}(),Ne=re;function ye(Rt){var Lt=parseFloat(Rt);return isNaN(Lt)?0:Lt}function xe(Rt,Lt,Pt){var Nt=se.useState(0),Zt=(0,he.Z)(Nt,2),Mt=Zt[0],Yt=Zt[1],Ge=(0,se.useRef)(new Map),Oe=(0,se.useRef)(new Ne),Ke=(0,se.useRef)(0);function we(){Ke.current+=1}function Ce(){var He=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;we();var Qe=function(){var ri=!1;Ge.current.forEach(function(ze,We){if(ze&&ze.offsetParent){var an=ze.offsetHeight,Xn=getComputedStyle(ze),pn=Xn.marginTop,rn=Xn.marginBottom,In=ye(pn),pi=ye(rn),ei=an+In+pi;Oe.current.get(We)!==ei&&(Oe.current.set(We,ei),ri=!0)}}),ri&&Yt(function(ze){return ze+1})};if(He)Qe();else{Ke.current+=1;var hn=Ke.current;Promise.resolve().then(function(){hn===Ke.current&&Qe()})}}function Fe(He,Qe){var hn=Rt(He),dn=Ge.current.get(hn);Qe?(Ge.current.set(hn,Qe),Ce()):Ge.current.delete(hn),!dn!=!Qe&&(Qe?Lt==null||Lt(He):Pt==null||Pt(He))}return(0,se.useEffect)(function(){return we},[]),[Fe,Ce,Oe.current,Mt]}var Ue=14/15;function je(Rt,Lt,Pt){var Nt=(0,se.useRef)(!1),Zt=(0,se.useRef)(0),Mt=(0,se.useRef)(0),Yt=(0,se.useRef)(null),Ge=(0,se.useRef)(null),Oe,Ke=function(He){if(Nt.current){var Qe=Math.ceil(He.touches[0].pageX),hn=Math.ceil(He.touches[0].pageY),dn=Zt.current-Qe,ri=Mt.current-hn,ze=Math.abs(dn)>Math.abs(ri);ze?Zt.current=Qe:Mt.current=hn;var We=Pt(ze,ze?dn:ri,!1,He);We&&He.preventDefault(),clearInterval(Ge.current),We&&(Ge.current=setInterval(function(){ze?dn*=Ue:ri*=Ue;var an=Math.floor(ze?dn:ri);(!Pt(ze,an,!0)||Math.abs(an)<=.1)&&clearInterval(Ge.current)},16))}},we=function(){Nt.current=!1,Oe()},Ce=function(He){Oe(),He.touches.length===1&&!Nt.current&&(Nt.current=!0,Zt.current=Math.ceil(He.touches[0].pageX),Mt.current=Math.ceil(He.touches[0].pageY),Yt.current=He.target,Yt.current.addEventListener("touchmove",Ke,{passive:!1}),Yt.current.addEventListener("touchend",we,{passive:!0}))};Oe=function(){Yt.current&&(Yt.current.removeEventListener("touchmove",Ke),Yt.current.removeEventListener("touchend",we))},(0,Ae.Z)(function(){return Rt&&Lt.current.addEventListener("touchstart",Ce,{passive:!0}),function(){var Fe;(Fe=Lt.current)===null||Fe===void 0||Fe.removeEventListener("touchstart",Ce),Oe(),clearInterval(Ge.current)}},[Rt])}function Je(Rt){return Math.floor(Math.pow(Rt,.5))}function fn(Rt,Lt){var Pt="touches"in Rt?Rt.touches[0]:Rt;return Pt[Lt?"pageX":"pageY"]-window[Lt?"scrollX":"scrollY"]}function te(Rt,Lt,Pt){se.useEffect(function(){var Nt=Lt.current;if(Rt&&Nt){var Zt=!1,Mt,Yt,Ge=function(){St.Z.cancel(Mt)},Oe=function Fe(){Ge(),Mt=(0,St.Z)(function(){Pt(Yt),Fe()})},Ke=function(He){if(!(He.target.draggable||He.button!==0)){var Qe=He;Qe._virtualHandled||(Qe._virtualHandled=!0,Zt=!0)}},we=function(){Zt=!1,Ge()},Ce=function(He){if(Zt){var Qe=fn(He,!1),hn=Nt.getBoundingClientRect(),dn=hn.top,ri=hn.bottom;if(Qe<=dn){var ze=dn-Qe;Yt=-Je(ze),Oe()}else if(Qe>=ri){var We=Qe-ri;Yt=Je(We),Oe()}else Ge()}};return Nt.addEventListener("mousedown",Ke),Nt.ownerDocument.addEventListener("mouseup",we),Nt.ownerDocument.addEventListener("mousemove",Ce),function(){Nt.removeEventListener("mousedown",Ke),Nt.ownerDocument.removeEventListener("mouseup",we),Nt.ownerDocument.removeEventListener("mousemove",Ce),Ge()}}},[Rt])}var Jt=10;function Xe(Rt,Lt,Pt,Nt,Zt,Mt,Yt,Ge){var Oe=se.useRef(),Ke=se.useState(null),we=(0,he.Z)(Ke,2),Ce=we[0],Fe=we[1];return(0,Ae.Z)(function(){if(Ce&&Ce.times<Jt){if(!Rt.current){Fe(function(Gi){return(0,ue.Z)({},Gi)});return}Mt();var He=Ce.targetAlign,Qe=Ce.originAlign,hn=Ce.index,dn=Ce.offset,ri=Rt.current.clientHeight,ze=!1,We=He,an=null;if(ri){for(var Xn=He||Qe,pn=0,rn=0,In=0,pi=Math.min(Lt.length-1,hn),ei=0;ei<=pi;ei+=1){var mi=Zt(Lt[ei]);rn=pn;var Hi=Pt.get(mi);In=rn+(Hi===void 0?Nt:Hi),pn=In}for(var Cn=Xn==="top"?dn:ri-dn,Sn=pi;Sn>=0;Sn-=1){var Bn=Zt(Lt[Sn]),si=Pt.get(Bn);if(si===void 0){ze=!0;break}if(Cn-=si,Cn<=0)break}switch(Xn){case"top":an=rn-dn;break;case"bottom":an=In-ri+dn;break;default:{var yi=Rt.current.scrollTop,hi=yi+ri;rn<yi?We="top":In>hi&&(We="bottom")}}an!==null&&Yt(an),an!==Ce.lastTop&&(ze=!0)}ze&&Fe((0,ue.Z)((0,ue.Z)({},Ce),{},{times:Ce.times+1,targetAlign:We,lastTop:an}))}},[Ce,Rt.current]),function(He){if(He==null){Ge();return}if(St.Z.cancel(Oe.current),typeof He=="number")Yt(He);else if(He&&(0,Ut.Z)(He)==="object"){var Qe,hn=He.align;"index"in He?Qe=He.index:Qe=Lt.findIndex(function(ze){return Zt(ze)===He.key});var dn=He.offset,ri=dn===void 0?0:dn;Fe({times:0,index:Qe,offset:ri,originAlign:hn})}}}var On=se.forwardRef(function(Rt,Lt){var Pt=Rt.prefixCls,Nt=Rt.rtl,Zt=Rt.scrollOffset,Mt=Rt.scrollRange,Yt=Rt.onStartMove,Ge=Rt.onStopMove,Oe=Rt.onScroll,Ke=Rt.horizontal,we=Rt.spinSize,Ce=Rt.containerSize,Fe=Rt.style,He=Rt.thumbStyle,Qe=Rt.showScrollBar,hn=se.useState(!1),dn=(0,he.Z)(hn,2),ri=dn[0],ze=dn[1],We=se.useState(null),an=(0,he.Z)(We,2),Xn=an[0],pn=an[1],rn=se.useState(null),In=(0,he.Z)(rn,2),pi=In[0],ei=In[1],mi=!Nt,Hi=se.useRef(),Cn=se.useRef(),Sn=se.useState(Qe),Bn=(0,he.Z)(Sn,2),si=Bn[0],yi=Bn[1],hi=se.useRef(),Gi=function(){Qe===!0||Qe===!1||(clearTimeout(hi.current),yi(!0),hi.current=setTimeout(function(){yi(!1)},3e3))},wt=Mt-Ce||0,Ye=Ce-we||0,Zn=se.useMemo(function(){if(Zt===0||wt===0)return 0;var Se=Zt/wt;return Se*Ye},[Zt,wt,Ye]),Ln=function(ti){ti.stopPropagation(),ti.preventDefault()},zn=se.useRef({top:Zn,dragging:ri,pageY:Xn,startTop:pi});zn.current={top:Zn,dragging:ri,pageY:Xn,startTop:pi};var oi=function(ti){ze(!0),pn(fn(ti,Ke)),ei(zn.current.top),Yt(),ti.stopPropagation(),ti.preventDefault()};se.useEffect(function(){var Se=function(qe){qe.preventDefault()},ti=Hi.current,Yn=Cn.current;return ti.addEventListener("touchstart",Se,{passive:!1}),Yn.addEventListener("touchstart",oi,{passive:!1}),function(){ti.removeEventListener("touchstart",Se),Yn.removeEventListener("touchstart",oi)}},[]);var Si=se.useRef();Si.current=wt;var Yi=se.useRef();Yi.current=Ye,se.useEffect(function(){if(ri){var Se,ti=function(qe){var Dn=zn.current,ki=Dn.dragging,Di=Dn.pageY,Ki=Dn.startTop;St.Z.cancel(Se);var Gt=Hi.current.getBoundingClientRect(),me=Ce/(Ke?Gt.width:Gt.height);if(ki){var En=(fn(qe,Ke)-Di)*me,Gn=Ki;!mi&&Ke?Gn-=En:Gn+=En;var Re=Si.current,$e=Yi.current,Nn=$e?Gn/$e:0,_n=Math.ceil(Nn*Re);_n=Math.max(_n,0),_n=Math.min(_n,Re),Se=(0,St.Z)(function(){Oe(_n,Ke)})}},Yn=function(){ze(!1),Ge()};return window.addEventListener("mousemove",ti,{passive:!0}),window.addEventListener("touchmove",ti,{passive:!0}),window.addEventListener("mouseup",Yn,{passive:!0}),window.addEventListener("touchend",Yn,{passive:!0}),function(){window.removeEventListener("mousemove",ti),window.removeEventListener("touchmove",ti),window.removeEventListener("mouseup",Yn),window.removeEventListener("touchend",Yn),St.Z.cancel(Se)}}},[ri]),se.useEffect(function(){return Gi(),function(){clearTimeout(hi.current)}},[Zt]),se.useImperativeHandle(Lt,function(){return{delayHidden:Gi}});var Fi="".concat(Pt,"-scrollbar"),ve={position:"absolute",visibility:si?null:"hidden"},Le={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return Ke?(ve.height=8,ve.left=0,ve.right=0,ve.bottom=0,Le.height="100%",Le.width=we,mi?Le.left=Zn:Le.right=Zn):(ve.width=8,ve.top=0,ve.bottom=0,mi?ve.right=0:ve.left=0,Le.width="100%",Le.height=we,Le.top=Zn),se.createElement("div",{ref:Hi,className:ge()(Fi,(0,Ee.Z)((0,Ee.Z)((0,Ee.Z)({},"".concat(Fi,"-horizontal"),Ke),"".concat(Fi,"-vertical"),!Ke),"".concat(Fi,"-visible"),si)),style:(0,ue.Z)((0,ue.Z)({},ve),Fe),onMouseDown:Ln,onMouseMove:Gi},se.createElement("div",{ref:Cn,className:ge()("".concat(Fi,"-thumb"),(0,Ee.Z)({},"".concat(Fi,"-thumb-moving"),ri)),style:(0,ue.Z)((0,ue.Z)({},Le),He),onMouseDown:oi}))}),bn=On,De=20;function on(){var Rt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Pt=Rt/Lt*Rt;return isNaN(Pt)&&(Pt=0),Pt=Math.max(Pt,De),Math.floor(Pt)}var un=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],Kn=[],Me={overflowY:"auto",overflowAnchor:"none"};function vn(Rt,Lt){var Pt=Rt.prefixCls,Nt=Pt===void 0?"rc-virtual-list":Pt,Zt=Rt.className,Mt=Rt.height,Yt=Rt.itemHeight,Ge=Rt.fullHeight,Oe=Ge===void 0?!0:Ge,Ke=Rt.style,we=Rt.data,Ce=Rt.children,Fe=Rt.itemKey,He=Rt.virtual,Qe=Rt.direction,hn=Rt.scrollWidth,dn=Rt.component,ri=dn===void 0?"div":dn,ze=Rt.onScroll,We=Rt.onVirtualScroll,an=Rt.onVisibleChange,Xn=Rt.innerProps,pn=Rt.extraRender,rn=Rt.styles,In=Rt.showScrollBar,pi=In===void 0?"optional":In,ei=(0,Dt.Z)(Rt,un),mi=se.useCallback(function(mn){return typeof Fe=="function"?Fe(mn):mn==null?void 0:mn[Fe]},[Fe]),Hi=xe(mi,null,null),Cn=(0,he.Z)(Hi,4),Sn=Cn[0],Bn=Cn[1],si=Cn[2],yi=Cn[3],hi=!!(He!==!1&&Mt&&Yt),Gi=se.useMemo(function(){return Object.values(si.maps).reduce(function(mn,Vn){return mn+Vn},0)},[si.id,si.maps]),wt=hi&&we&&(Math.max(Yt*we.length,Gi)>Mt||!!hn),Ye=Qe==="rtl",Zn=ge()(Nt,(0,Ee.Z)({},"".concat(Nt,"-rtl"),Ye),Zt),Ln=we||Kn,zn=(0,se.useRef)(),oi=(0,se.useRef)(),Si=(0,se.useRef)(),Yi=(0,se.useState)(0),Fi=(0,he.Z)(Yi,2),ve=Fi[0],Le=Fi[1],Se=(0,se.useState)(0),ti=(0,he.Z)(Se,2),Yn=ti[0],Wn=ti[1],qe=(0,se.useState)(!1),Dn=(0,he.Z)(qe,2),ki=Dn[0],Di=Dn[1],Ki=function(){Di(!0)},Gt=function(){Di(!1)},me={getKey:mi};function En(mn){Le(function(Vn){var $n;typeof mn=="function"?$n=mn(Vn):$n=mn;var An=ir($n);return zn.current.scrollTop=An,An})}var Gn=(0,se.useRef)({start:0,end:Ln.length}),Re=(0,se.useRef)(),$e=vt(Ln,mi),Nn=(0,he.Z)($e,1),_n=Nn[0];Re.current=_n;var di=se.useMemo(function(){if(!hi)return{scrollHeight:void 0,start:0,end:Ln.length-1,offset:void 0};if(!wt){var mn;return{scrollHeight:((mn=oi.current)===null||mn===void 0?void 0:mn.offsetHeight)||0,start:0,end:Ln.length-1,offset:void 0}}for(var Vn=0,$n,An,Un,Ti=Ln.length,vi=0;vi<Ti;vi+=1){var ii=Ln[vi],nn=mi(ii),Ni=si.get(nn),Xi=Vn+(Ni===void 0?Yt:Ni);Xi>=ve&&$n===void 0&&($n=vi,An=Vn),Xi>ve+Mt&&Un===void 0&&(Un=vi),Vn=Xi}return $n===void 0&&($n=0,An=0,Un=Math.ceil(Mt/Yt)),Un===void 0&&(Un=Ln.length-1),Un=Math.min(Un+1,Ln.length-1),{scrollHeight:Vn,start:$n,end:Un,offset:An}},[wt,hi,ve,Ln,yi,Mt]),Jn=di.scrollHeight,li=di.start,ni=di.end,ji=di.offset;Gn.current.start=li,Gn.current.end=ni,se.useLayoutEffect(function(){var mn=si.getRecord();if(mn.size===1){var Vn=Array.from(mn.keys())[0],$n=mn.get(Vn),An=Ln[li];if(An&&$n===void 0){var Un=mi(An);if(Un===Vn){var Ti=si.get(Vn),vi=Ti-Yt;En(function(ii){return ii+vi})}}}si.resetRecord()},[Jn]);var Oi=se.useState({width:0,height:Mt}),Ii=(0,he.Z)(Oi,2),Ve=Ii[0],vr=Ii[1],Mr=function(Vn){vr({width:Vn.offsetWidth,height:Vn.offsetHeight})},ro=(0,se.useRef)(),en=(0,se.useRef)(),Tn=se.useMemo(function(){return on(Ve.width,hn)},[Ve.width,hn]),Bi=se.useMemo(function(){return on(Ve.height,Jn)},[Ve.height,Jn]),bi=Jn-Mt,_i=(0,se.useRef)(bi);_i.current=bi;function ir(mn){var Vn=mn;return Number.isNaN(_i.current)||(Vn=Math.min(Vn,_i.current)),Vn=Math.max(Vn,0),Vn}var yr=ve<=0,Nr=ve>=bi,_r=Yn<=0,Rr=Yn>=hn,cn=It(yr,Nr,_r,Rr),ho=function(){return{x:Ye?-Yn:Yn,y:ve}},gn=(0,se.useRef)(ho()),Wi=(0,jt.zX)(function(mn){if(We){var Vn=(0,ue.Z)((0,ue.Z)({},ho()),mn);(gn.current.x!==Vn.x||gn.current.y!==Vn.y)&&(We(Vn),gn.current=Vn)}});function Kr(mn,Vn){var $n=mn;Vn?((0,Pe.flushSync)(function(){Wn($n)}),Wi()):En($n)}function zi(mn){var Vn=mn.currentTarget.scrollTop;Vn!==ve&&En(Vn),ze==null||ze(mn),Wi()}var wo=function(Vn){var $n=Vn,An=hn?hn-Ve.width:0;return $n=Math.max($n,0),$n=Math.min($n,An),$n},Yr=(0,jt.zX)(function(mn,Vn){Vn?((0,Pe.flushSync)(function(){Wn(function($n){var An=$n+(Ye?-mn:mn);return wo(An)})}),Wi()):En(function($n){var An=$n+mn;return An})}),Er=qt(hi,yr,Nr,_r,Rr,!!hn,Yr),Co=(0,he.Z)(Er,2),_e=Co[0],xn=Co[1];je(hi,zn,function(mn,Vn,$n,An){var Un=An;return cn(mn,Vn,$n)?!1:!Un||!Un._virtualHandled?(Un&&(Un._virtualHandled=!0),_e({preventDefault:function(){},deltaX:mn?Vn:0,deltaY:mn?0:Vn}),!0):!1}),te(wt,zn,function(mn){En(function(Vn){return Vn+mn})}),(0,Ae.Z)(function(){function mn($n){var An=yr&&$n.detail<0,Un=Nr&&$n.detail>0;hi&&!An&&!Un&&$n.preventDefault()}var Vn=zn.current;return Vn.addEventListener("wheel",_e,{passive:!1}),Vn.addEventListener("DOMMouseScroll",xn,{passive:!0}),Vn.addEventListener("MozMousePixelScroll",mn,{passive:!1}),function(){Vn.removeEventListener("wheel",_e),Vn.removeEventListener("DOMMouseScroll",xn),Vn.removeEventListener("MozMousePixelScroll",mn)}},[hi,yr,Nr]),(0,Ae.Z)(function(){if(hn){var mn=wo(Yn);Wn(mn),Wi({x:mn})}},[Ve.width,hn]);var Be=function(){var Vn,$n;(Vn=ro.current)===null||Vn===void 0||Vn.delayHidden(),($n=en.current)===null||$n===void 0||$n.delayHidden()},At=Xe(zn,Ln,si,Yt,mi,function(){return Bn(!0)},En,Be);se.useImperativeHandle(Lt,function(){return{nativeElement:Si.current,getScrollInfo:ho,scrollTo:function(Vn){function $n(An){return An&&(0,Ut.Z)(An)==="object"&&("left"in An||"top"in An)}$n(Vn)?(Vn.left!==void 0&&Wn(wo(Vn.left)),At(Vn.top)):At(Vn)}}}),(0,Ae.Z)(function(){if(an){var mn=Ln.slice(li,ni+1);an(mn,Ln)}},[li,ni,Ln]);var jn=Xt(Ln,mi,si,Yt),Qn=pn==null?void 0:pn({start:li,end:ni,virtual:wt,offsetX:Yn,offsetY:ji,rtl:Ye,getSize:jn}),Li=ht(Ln,li,ni,hn,Yn,Sn,Ce,me),xi=null;Mt&&(xi=(0,ue.Z)((0,Ee.Z)({},Oe?"height":"maxHeight",Mt),Me),hi&&(xi.overflowY="hidden",hn&&(xi.overflowX="hidden"),ki&&(xi.pointerEvents="none")));var ui={};return Ye&&(ui.dir="rtl"),se.createElement("div",(0,gt.Z)({ref:Si,style:(0,ue.Z)((0,ue.Z)({},Ke),{},{position:"relative"}),className:Zn},ui,ei),se.createElement(Qt.Z,{onResize:Mr},se.createElement(ri,{className:"".concat(Nt,"-holder"),style:xi,ref:zn,onScroll:zi,onMouseEnter:Be},se.createElement(nt,{prefixCls:Nt,height:Jn,offsetX:Yn,offsetY:ji,scrollWidth:hn,onInnerResize:Bn,ref:oi,innerProps:Xn,rtl:Ye,extra:Qn},Li))),wt&&Jn>Mt&&se.createElement(bn,{ref:ro,prefixCls:Nt,scrollOffset:ve,scrollRange:Jn,rtl:Ye,onScroll:Kr,onStartMove:Ki,onStopMove:Gt,spinSize:Bi,containerSize:Ve.height,style:rn==null?void 0:rn.verticalScrollBar,thumbStyle:rn==null?void 0:rn.verticalScrollBarThumb,showScrollBar:pi}),wt&&hn>Ve.width&&se.createElement(bn,{ref:en,prefixCls:Nt,scrollOffset:Yn,scrollRange:hn,rtl:Ye,onScroll:Kr,onStartMove:Ki,onStopMove:Gt,spinSize:Tn,containerSize:Ve.width,horizontal:!0,style:rn==null?void 0:rn.horizontalScrollBar,thumbStyle:rn==null?void 0:rn.horizontalScrollBarThumb,showScrollBar:pi}))}var ne=se.forwardRef(vn);ne.displayName="List";var wn=ne,fi=wn},32637:function(Mn,Rn,kt){"use strict";Mn.exports=kt.p+"static/AssistantCode3.a8740efb.jpeg"},93314:function(Mn){"use strict";Mn.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(Mn){"use strict";Mn.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(Mn){"use strict";Mn.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(Mn){"use strict";Mn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAAA8CAYAAADGxTD9AAAAAXNSR0IArs4c6QAAFoFJREFUeF7tXQl4k1W6fv8sTbqvlJa2tJSy74ugsiMqq4AKIlDUueNwR2dGHR0XdLwixW3uuF6Xq3O9o15nxuUiIIsCsijK1pa20NJ937eke5tmmec7f/40TfInaUNK6+R7nj5Jk7Of93z/t55w8JBnBYbwCnBDeOyeoXtWAB4Ae0AwpFeA+1SWbbA1A07KQSID6JWT0ivAyThIpBwgBSQy4+fCq0T4jANnrEdlWFkpjK/0ndAetd/znpMaTO0LZcz74tsxti0xjqVXfeNYZcZyxvHSuK3GbDYX03iMbbLy5nOz+pzGbGDrwpfj52DQG2DQAwad8Gcwvudf9ToDQN/pDdBrDYBFWfqMry/UAytP9fjPjJ/rYVHf2L7Qph4GaA0tOj1UnBYqvd6gMugMKr0OKoOOq+UMhhQ5DGfHPRNWMaSRaxy8bQBzPGAZAI3AFMAoAIJtnBnA2WaagdlU39iOAKKeje85FKY2TYDkwWh+APi2ebD0AJ8HMn/AzAHFA4x9Jxwss7bN5yXUpbnwB4SvY3Nu9LmwLr36NIKWAEhA1BlMgOUBCAZYBtJe761Byx+A3vV54Av1efDrtUawm4G+N+D5MfUcHH5s7H890KnqNjRWNGkaqlXqhgp1VV1JwxkOSJUAqUB0xk4s0Q4FgIty4KEweM8Yba+ARCmBzBuQeksgVXKQKugVkAdIoRwhhU+EHJycg0GrNz01Whs6UJhegtLsCmi7tI0GYC8H7osYTPhuO2Z3D9a19gB4sO6Mm8flFSKBd4QcyuFS+MbKIfOWMM6v69KjIq8WhVlFaKpvAQeuFsCr/gh45wmsbXHzsPrcvAfAfV6yn18FjgN8YmUInKiAd4TMJObUlNQj42wWutq7SNtXA9zrIVC88nts7Bgsq+AB8GDZiUEyDrm/BAFj5PBLUAASniNnpeSgvLCSjZADl8dBev8ubD41GIbsAfBg2IVBOAaSnUNnK6GM5DlyQ5UKmSlZ6GjvJBiT5epdGRSP7MRGzbUcvgfA13L1h0DfPtFyBE9VMKuMVqNH2rl0NNapBG78vQ98b9+B2xuu1VQ8AL5WKz+E+pV6cQiaqoAyXAp9tx5pyZfQUNdoBDEKAG5VEhJzrsWUPAC+Fqs+RPsMnOgF3xg5dBod0i9eRmM9D2IAFYB03m5sKRnoqXkAPNArPsT7CxingE+UFDqdHpfSMtHYYJIecn2hnL8DG+sGcooeAA/kav9M+gpIkEMZJYdBq0PqxXS0NDcLMvEFKRTzB1Kx8wD4ZwKqgZ6G/2g5vCPlaGttR+rFZMaRiSSQvLILW58YqPF4ADxQK/1z64cDs05IlByqqiqRX5gvKHV6gLspCYknB2LKHgAPxCr/TPuQ+XAImOQFzsDh0pVLUDcJ5jWUSaGcuBMbW9099WsOYDKYU8Qbi5zqshnZ6e41uGrtSxScU3NQhErR1UBhae4hstkaBiiWzDtSykSJri4NLmYmQ6s1dfz6bmx7xD0z7Gn1mgN4bX48CyapP9eBI/NLXZ5v3JYAzHlnOGvnyMJSqNO7TG36xMjYe41KB22r+GGR+nC48aNIVrb4780o2+OYkYTOVWLRnijk/JcKee+qoVHzMqE5zXlvOGLW+0MRIsXBGUVouuweJ9bys7HwjpJBldaJk2vcH/brP9aLRb1V11aisLzAKEpwWimks3Zic4bLm2qngUED4K5GHWpOttuda+U3bSj83ya7ZeLvCcD1f+HBd3hOMVQXeQDL/DhsVI1l71MerUXOm/zjzhYRV1lfmsC+Sn28FtmviZcV6t/wUSRGbQ5g/575RRWKPuE1c3Ma8+sgXPcmf7gynqvH5d3OO7DkARIowigzwDEtPxcLryApmrK7cGqtYwB31evQ3Wx94Bz3xJcgOThwrBd0Wj1Ssi6gW8sfTA44swuJ8zje9ewWGjQAdmZ2OW+rkPIwRfeJ09UAsH+CHGuuxLNOzj9Yjfz37R8axTAp1hWPBnmsOuu02BtXCL3Ges8IhOvLRkPmI0FjSie+ud55u//YB4Iw+w0e/Febkh+qQe47apea9Y2VQeYrQXlNGcpqeubFQfKrJGz9wKXG7VQeNADuqNKi6FNrrmU+9rqfOlDxtf3HudMAfkuFmPV+iN0QgMyXG6BK6xE1gqYpsDI5jnX9071VKHYwrklPhWDa88NY+csvNiDj2XrRJZ/7fgRG3xfIvv8qrgAdFc4Jq4MdwHQoCcQkA6fmXIBOz8v4HNAog2zcc9gsviguoNutAKZHsdRHYnd4y76LgU+UHKr0TvxwFx+y54iIu7WX9Ww8SwGS8/mp8YkBmPNuBHv/7fwSHph6A0jBshQhVqbGIWiKAgUfqnFue42p22HzvHHzyZHs/+83VKB8r/ihoRQjkuMp6IVShvYlFGLyjlCEzVXanIZXiJS5Y4laizSij+78/2lisrRA8kAJCz53RKO2BLL+ic5tr0btaftiGZXrrNGhu6n/IoQwJt+RMrbOJTVFqG4030vJX3dj632Oxt6f790K4CWHohF5s29/xmW3DoH98Oyex9TY3wRh9mvij1f15S4cWVBiBWCBW2vb9fhqZIFpEyNv9sGSQzFsDCdWlqHqqDgIiIsv+DyKlS39/xac3lSJpd9EI+Im1+Z9+YUGZPyHbaYVMlOB0DneNtdo5J3+GL7Ih31HcraYtYPmXPSx/SdeXzeORAifETJ0dnYivTgFBoMgRpEMLF24G5tP97VNR+WHJIBL97TgtBm37i+AJV4c1hbEsywEc8XOHJRHl5Si7rTtBASZLwfi4n7xXmydT60rR8XBNkx/IQwhM3s4cMgsJVOqCDT1Z5xLZij6W7MowMxFFkcbLPZ9R7UWX8XwFoOrSd4jOUilMuRWZkHdZq78cpdliJ5xtZNFBwTAxAW+u7nMap1uOhbDTEo1p9qR8oh95Ywe9YJp68fESpT8oyc9K+x6JUas8GPtB09TIGoV/55Eg45qHTprtSj8qMmmFWLKs6GY8scwNOdqcGBSEas3KjEAN3xotGRcV9xLPjafBJnFEv4tyPTRsZtKUfu9NUBJTApf6NOrD1dAYw7gikOt0Hc7r+SHTFcys6W7AOwVLIFXoBQ16iqU1BdaTvOJ3dj2iitzt6w7IADuqNHiq2jr0357xWgow2UoP9CK8/9eDZ8YOXxjZPAZaXyNkcN7uBRHF5dh7gcRGH1vIHQaA/ZE5ovKjk4rcUYzmt9oOW7L5i0Ox28tQ/Xxdkz+YyimPhvGPvsyPA8albV8GLXaF4u+iu61nqIAPhGD8Pk+aM7R4MBk/pC4QuYA3juqAJo+yK/XvRUOkpPdBWB6qpHuo9F0I73sgsU0uTYZFOShc93gb2x5wAD89YQiDLteyUBKDgVSZGI3+bOUb0e0L6EAEx8PRfQaP6gyOnFytbhts68Apr5vOT0SYXO9Uba3BT9sqMSNn0QiblMAOuu12BNpffDIbLYqLY4dPnMSA/CKlFgET1UyRdVcdnc0b7HvB7MIQWP2jiJlk8OVqgy0a6wU4H27sW1df+d+zTjwiRXlTF60R6TFd1Rq0VbSjbYyLdpLu9FW2s2UoxG3+qK1RIumzC67GnN/AEwmqmlJw5D3ngppO+pBjgCSYet+bGfc35IW7olih4mIQK4M44EsBuC1hfHswDYkd+LECuv2zNunC0wcORXMAaxR060nzsNB6ith9mp3cWAaiVewFBQnUaEqRVVzudXgOEjWJGHrAedHLV5ywDjw/rGFWF86Gu2lWrSV8cCM3xbIjPoElB+3VjHw0gbaIsHlXPyPZvyUWCU6I0sAtxV3Y/QvApH332pRTxx56TgJZwLOBtUYyP0kKPhrE87dX92rL6k3hzvrEtiTgwBZ+HGTybsmBuCN6jHMyO8M0eElU5w9MgfwF2F5fTKBCXZodwKY3MoE4rauVmTX2vQkF4dCOfFqpOcPGIBtycArLsQieLoS3a16ZL/WaFOWkyo4hN3gjejVPMdLe7oOWa+YUlms9tkcwAR2Uuh0HXrsH1folCuZYgjWF4/m+9pRh6w/Wfe1+EAUgiYp8M0NJezJILiubQGYAmvu7hjnDHZZmeY8DQ5MtC8nmwOY5Gq6b81Z8o6UMYuIOwFM3gvv4TLGjDJqkqHVWcd8SICXdmHbU86OW6zcNQWwI/OX5aAJ6IdnFqO1yPZNR8RJJz8dhomPhfSqShz/4NQipwAcscwHSw/zNuDv76hA+X5rJwYFDJFtmQKFzA+MLQCbx1VUHmlD9bE2m3sx/qFg5tBRZ3bh0PRipzlwfwHgVgADkAdL2F1zZc1FqG/v/RQzjrmbg9e0JGy60t85UD23AniZUfsmj9P+sdZchTRWAgxxMb943jtli7Tt5HnrRsnnLWg4T/cS9KaEXwZi5EZ/pulLjB45KkHyYe7bauS8pWIXdDgTzDPrtXCM+00w62BPTD46q+2HPToCcNQqXyzay1srLM1/5rNYkRyL4GlKNKZ24pu59mMkzDnwoZnF0DQ5H5o546VhzH3ubgBLlRLI/Tk0dzQjX51pc185cCeTkLhk0AL4ttxR8BvlxdyZx5bwygu5Q8l1KRDJpxTk0pKnYU4Aoti7/EEu1/Zyba/YB3Kn2nJ5Lvh8BAtTtKRvbyxBwwUe8M5Go60rjudd2xmdODzLcbCNIwBPfT4Mk5/iXbv2QihXpsUxsaTuTAeOLrRvZTIHcOmXLcy06CyRJYgcL+4GMF1XJQ+RsvvWLjcmQ0fXadogCbh7diHxY2fHb1nOrRz4rtYxTNkp+byZhQ7OejUc4Yt9cHBKEVryeDFAUM7MvWurMuIQOEGB6hNtOH4Lr8WS6eq23HhUHm5F+tP1vcSIcb8NwqQdoaDNNHQD437Lc1BnwinZ3b7G8xS+0BvLvuNjILLfaETqY44TbB0BeOmRaEQs8WXOhs8CckUDzVdfHoWAcV6oOtYGstjYo8FuRhPGToyJ4lRKW4rQ2NUTa2I+N7o8UAq/cTuxvl/hcG4DMGUd3FHNx9ReebWRKV7ktiVtPPcdFZIf4j1vzgJ4WlIYJj0RCl0nKWRFzGIhELl0dZ383bt9MaORy3j6i8NwfHk5yFohgI3abS3U4OCMYuja7XM3ewCmw3Fn3RjQfWP15ztwZJ44Z70tLx5+cXKTLdpZAP90TxW0rc4H4ox9MAgRS33dzoFp/BTYQ0p4i6YZha1Z9qb03m5s+3V/uLDbAEw3uaxM4e2+KY/VIucNFWb+aRjGPxzCrA57YwuY2coZAFMg9205o9j9tln/2Yi0p8Q5oxiAzZUpciuTB45kZqLkR2qgvtSFZcd47isQZVc4cnHbA/DIDf6Y/7cRrDlH1hMyMZKFoOj/mnDmvt5KD3FmWk+BYtb5IXYjHzx/9pdVIB3BWRqzPYgF+5B+cP6BHq6ozuhinsKrSSRGyPwl7B7izJZU6ETynDhAL4X0hp3Ycr6v/bsNwObKy+m7K9njnUxUxIVJO039Qy2yX1c5BeDrP4xAfGIgU1b2jym06doVJi4GYOK0ltYJqlN9vA2Xkhow+9VwZtKjCKqa4+0smozeH1taJhrMQ/XtAfjmUyMx7EY+auzriYUmscnWJt1Zn8BiCLLfVCH10d5xIRMeDcaMl8L7urd9Kn/xyVpc+bPjzJM+NUpc2FsCCQeUdRRA1S3OeDjg4lQor9uIjc5rpO60Qlz39nCM+RUf6GKuTC3aH4WoFX4sFpZEgbV5fE6cmAx8OanBJJemP1uHzBfFbcCWgBJkYP8xcqzJ4uMdiAiYFBif+VIjU/JINhfk5rz31YzDr8kZxTxsZJc9NKNYNFlTDMAhsxRYfpZ/AjnjQt7UOZYd7LRn6pD1cu85DmUAc3L6SQgJ2rXNKOiwK0ZQbu9Du7Dtzb4cErdwYDLe316eAJKDyQa7L77HsxS9zg8Lv4hC7Q/tOL25EreejrULYJKdKZWGLBDkzeuLTGquxJFiSMmHJZ+1IOvlBjRl8Y9LYTz0XrAXU8KneQaEvYMjBmDzWGjhCSS2MaSg3lHJ6wskEhR+ZB2nS8qQJUUs8wVF01Ecx8Wn6pD9qu3DPeU53hJCQVXkkcx/X42uut6MTswD2hcwiZUlzxz9NkduZxq6DeJiCgeu2RsY/zTsuFotOnELgEes9MXifbzt0zLFhsBNFgaSOYmckYFJGfIf44XmbMcy2vTdYSzwh+jgtCITUClIvTmvmylrAo1Y7osFX45glhLiyidXlZuC16nPVem8ZYBk9q8nFNq0CdsCsLmVwBnuO/EPIZj+Ap+SRFkkDeesbd3CmAkMI1b4ghwfw+bxMjwRJcSeWF1u/aTggDlvDwc5X8htT0Q28eK/tzD7OMm+7ibBNl+tKUO9zn7WDQd8loRtm5wdk1sALERz0SBI9qOYh/GP8KYtSxKi0djPTxnjWsnBwXEcA5Wt5Ehq48y91UyuJgpf5I15n4xgSiEBjoiSK/dEFYgGukTe4ouFe3rAe+GBGuT/pXfyprkcbysugvqxBDB9tvRIDBMHaPxkEqv+js/oGLbAGzNfCYeuXQ9dFz9fUlDDjNkVFAdB4ZZkUbEkGi/FKUet9mNxGgK1FGhw8ck6u2lPVJZMWgRicvpQZJwJ+KfaWYZ2OeUaOq8LOosvVo7iTCgxuVuvQW53msO6UnC3PI/Eow4LuksGnvnncIz/XTDqz3bgyIJSZqqypUA5M0CxMj9urWTiABFpuhvqE/iFMpKjDGaSUZedGMnuM7jwYA3yP7CdeXzT0RgMX+xjU7myBWAy7y0+EA3/0V649Hw9Lu3qSZ2nQKA7ahLYD6pYEkXiHVtSivqztrmv5RqSKzv/AzX70/fxN4ToYFL0XdBk3rJBThvy/rnzMhT62TNyahTpMtFhsO1OF9aEfsYgHKFTfoeVDh8PbuHANJCJj4ewC0QIGOQgEMvh6i+IKw609hIpxv8+mAWp0O0+ZftanLo0hOKRyUYrBl4aG5mvKOWo6ojtRY+72x+z3+Lz8egOhrofOxhXpUd8+h+tc9oS7g9EAF0EYvwJLNJc6n/qQOW3bb0SVS3XhTyYK5LjUL6vlUXJNSaLixlOrSnHZ55MeSaU5fE1pjrEilPNOiqkMtSiSmc/1oNxbXDPJSFxp6P23AZgRx17vu/HCtAD5mo/5t3Rpp2p6aFHji4VBgdaIwd0SsFN2YlE/tZAEfIAuB848lRxbQUq9Plo0ts3hxp7+HY3ti33ANi19fbUvsor0GFoRZHOvk1Y6FIC7q5dSPzcw4Gv8iZ4mnNtBQp0l9BlcHzFAAeu0h8B48V+JdQjQri2D57a/VyBBkMNanSOw1WNCt0bSUh82FZXHgD3cwM81VxbAT10yNWlQm+6vceupKuTQTJ7J7ZYGZE9AHZtHzy1XViBSn0B1Hpnr5jlziZh642WV7V6AOzCBniqurYCnWhDodZ2upGtliXA9l3Y9r75dx4Au7YHntourkChLhOdDjxzPV1wKl8oxpn/Fp0HwC5ugKe6ayvQbGhAuc75SwY5cB8lIfFeoVcPgF1bf09tl1fAgDxdut0wS+supIt2Y8v3zELxqSz7ajsnXZ6Sp4F/rRVoMFShRmf/yq3eK8JljcSE6dsxu9sD4H8trAzK2eqgQ54uDXohPdyJUXLgnkxC4sseADuxWJ4i7l+Ban0JGvW2U+9t9c4B7QZIJ3oA7P698fTgxAo0GepRobN/qaFlMxy4/f8E90wA8RE2tUgAAAAASUVORK5CYII="},16722:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return ge}});const gt=Qt=>typeof Qt=="object"&&Qt!=null&&Qt.nodeType===1,Ut=(Qt,jt)=>(!jt||Qt!=="hidden")&&Qt!=="visible"&&Qt!=="clip",ue=(Qt,jt)=>{if(Qt.clientHeight<Qt.scrollHeight||Qt.clientWidth<Qt.scrollWidth){const Ae=getComputedStyle(Qt,null);return Ut(Ae.overflowY,jt)||Ut(Ae.overflowX,jt)||(se=>{const Pe=(Bt=>{if(!Bt.ownerDocument||!Bt.ownerDocument.defaultView)return null;try{return Bt.ownerDocument.defaultView.frameElement}catch(nt){return null}})(se);return!!Pe&&(Pe.clientHeight<se.scrollHeight||Pe.clientWidth<se.scrollWidth)})(Qt)}return!1},Ee=(Qt,jt,Ae,se,Pe,Bt,nt,et)=>Bt<Qt&&nt>jt||Bt>Qt&&nt<jt?0:Bt<=Qt&&et<=Ae||nt>=jt&&et>=Ae?Bt-Qt-se:nt>jt&&et<Ae||Bt<Qt&&et>Ae?nt-jt+Pe:0,he=Qt=>{const jt=Qt.parentElement;return jt==null?Qt.getRootNode().host||null:jt},Dt=(Qt,jt)=>{var Ae,se,Pe,Bt;if(typeof document=="undefined")return[];const{scrollMode:nt,block:et,inline:ht,boundary:st,skipOverflowHiddenElements:pt}=jt,vt=typeof st=="function"?st:bn=>bn!==st;if(!gt(Qt))throw new TypeError("Invalid target");const St=document.scrollingElement||document.documentElement,Et=[];let Tt=Qt;for(;gt(Tt)&&vt(Tt);){if(Tt=he(Tt),Tt===St){Et.push(Tt);break}Tt!=null&&Tt===document.body&&ue(Tt)&&!ue(document.documentElement)||Tt!=null&&ue(Tt,pt)&&Et.push(Tt)}const It=(se=(Ae=window.visualViewport)==null?void 0:Ae.width)!=null?se:innerWidth,qt=(Bt=(Pe=window.visualViewport)==null?void 0:Pe.height)!=null?Bt:innerHeight,{scrollX:Xt,scrollY:Ht}=window,{height:pe,width:re,top:Ne,right:ye,bottom:xe,left:Ue}=Qt.getBoundingClientRect(),{top:je,right:Je,bottom:fn,left:te}=(bn=>{const De=window.getComputedStyle(bn);return{top:parseFloat(De.scrollMarginTop)||0,right:parseFloat(De.scrollMarginRight)||0,bottom:parseFloat(De.scrollMarginBottom)||0,left:parseFloat(De.scrollMarginLeft)||0}})(Qt);let Jt=et==="start"||et==="nearest"?Ne-je:et==="end"?xe+fn:Ne+pe/2-je+fn,Xe=ht==="center"?Ue+re/2-te+Je:ht==="end"?ye+Je:Ue-te;const On=[];for(let bn=0;bn<Et.length;bn++){const De=Et[bn],{height:on,width:un,top:Kn,right:Me,bottom:vn,left:ne}=De.getBoundingClientRect();if(nt==="if-needed"&&Ne>=0&&Ue>=0&&xe<=qt&&ye<=It&&(De===St&&!ue(De)||Ne>=Kn&&xe<=vn&&Ue>=ne&&ye<=Me))return On;const wn=getComputedStyle(De),fi=parseInt(wn.borderLeftWidth,10),Rt=parseInt(wn.borderTopWidth,10),Lt=parseInt(wn.borderRightWidth,10),Pt=parseInt(wn.borderBottomWidth,10);let Nt=0,Zt=0;const Mt="offsetWidth"in De?De.offsetWidth-De.clientWidth-fi-Lt:0,Yt="offsetHeight"in De?De.offsetHeight-De.clientHeight-Rt-Pt:0,Ge="offsetWidth"in De?De.offsetWidth===0?0:un/De.offsetWidth:0,Oe="offsetHeight"in De?De.offsetHeight===0?0:on/De.offsetHeight:0;if(St===De)Nt=et==="start"?Jt:et==="end"?Jt-qt:et==="nearest"?Ee(Ht,Ht+qt,qt,Rt,Pt,Ht+Jt,Ht+Jt+pe,pe):Jt-qt/2,Zt=ht==="start"?Xe:ht==="center"?Xe-It/2:ht==="end"?Xe-It:Ee(Xt,Xt+It,It,fi,Lt,Xt+Xe,Xt+Xe+re,re),Nt=Math.max(0,Nt+Ht),Zt=Math.max(0,Zt+Xt);else{Nt=et==="start"?Jt-Kn-Rt:et==="end"?Jt-vn+Pt+Yt:et==="nearest"?Ee(Kn,vn,on,Rt,Pt+Yt,Jt,Jt+pe,pe):Jt-(Kn+on/2)+Yt/2,Zt=ht==="start"?Xe-ne-fi:ht==="center"?Xe-(ne+un/2)+Mt/2:ht==="end"?Xe-Me+Lt+Mt:Ee(ne,Me,un,fi,Lt+Mt,Xe,Xe+re,re);const{scrollLeft:Ke,scrollTop:we}=De;Nt=Oe===0?0:Math.max(0,Math.min(we+Nt/Oe,De.scrollHeight-on/Oe+Yt)),Zt=Ge===0?0:Math.max(0,Math.min(Ke+Zt/Ge,De.scrollWidth-un/Ge+Mt)),Jt+=we-Nt,Xe+=Ke-Zt}On.push({el:De,top:Nt,left:Zt})}return On},ee=Qt=>Qt===!1?{block:"end",inline:"nearest"}:(jt=>jt===Object(jt)&&Object.keys(jt).length!==0)(Qt)?Qt:{block:"start",inline:"nearest"};function ge(Qt,jt){if(!Qt.isConnected||!(Pe=>{let Bt=Pe;for(;Bt&&Bt.parentNode;){if(Bt.parentNode===document)return!0;Bt=Bt.parentNode instanceof ShadowRoot?Bt.parentNode.host:Bt.parentNode}return!1})(Qt))return;const Ae=(Pe=>{const Bt=window.getComputedStyle(Pe);return{top:parseFloat(Bt.scrollMarginTop)||0,right:parseFloat(Bt.scrollMarginRight)||0,bottom:parseFloat(Bt.scrollMarginBottom)||0,left:parseFloat(Bt.scrollMarginLeft)||0}})(Qt);if((Pe=>typeof Pe=="object"&&typeof Pe.behavior=="function")(jt))return jt.behavior(Dt(Qt,jt));const se=typeof jt=="boolean"||jt==null?void 0:jt.behavior;for(const{el:Pe,top:Bt,left:nt}of Dt(Qt,ee(jt))){const et=Bt-Ae.top+Ae.bottom,ht=nt-Ae.left+Ae.right;Pe.scroll({top:et,left:ht,behavior:se})}}}}]);