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

1252 lines
2.3 MiB

(self.webpackChunk=self.webpackChunk||[]).push([[5816],{8336:function(){"use strict"},12469:function(){"use strict"},99587:function(Zn,ei){"use strict";ei.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},8423:function(Zn,ei){"use strict";ei.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(Zn,ei,Le){"use strict";var le=Le(59301),Ke=Object.defineProperty,it=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable,Oe=(ot,We,Tt)=>We in ot?Ke(ot,We,{enumerable:!0,configurable:!0,writable:!0,value:Tt}):ot[We]=Tt,st=(ot,We)=>{for(var Tt in We||(We={}))bt.call(We,Tt)&&Oe(ot,Tt,We[Tt]);if(it)for(var Tt of it(We))vt.call(We,Tt)&&Oe(ot,Tt,We[Tt]);return ot};const Et=ot=>React.createElement("svg",st({width:14,height:14,xmlns:"http://www.w3.org/2000/svg"},ot),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"})));ei.Z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGQ0IwNDEiIGN4PSI3IiBjeT0iNyIgcj0iNyIvPjxwYXRoIGQ9Ik03LjUzMSA5LjYzOGEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwdi0uMDJhLjYxNi42MTYgMCAxIDEgMS4yMzEgMHYuMDJabTAtMi4yNWEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwVjQuMTE3YS42MTYuNjE2IDAgMSAxIDEuMjMxIDB2My4yNzNaIiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+"},63720:function(){"use strict";function Zn(De,ne,te,de){te===void 0&&(te=0),de===void 0&&(de=1/0),this._name=De,this._defaultValue=ne,this._minimum=te,this._maximum=de}Object.defineProperty(Zn.prototype,"name",{get:function(){return this._name},set:function(De){if(typeof De!="string"||De==="")throw new Error("Shape name must be a valid string.");this._name=De}}),Object.defineProperty(Zn.prototype,"defaultValue",{get:function(){return this._defaultValue},set:function(De){if(typeof De!="number"||isNaN(De))throw new Error("The default value must be a real number, not: "+De);this._defaultValue=De}}),Object.defineProperty(Zn.prototype,"minimum",{get:function(){return this._minimum},set:function(De){if(typeof De!="number"||isNaN(De))throw new Error("Minimum must be a real number, not: "+De);this._minimum=De}}),Object.defineProperty(Zn.prototype,"maximum",{get:function(){return this._maximum},set:function(De){if(typeof De!="number"||isNaN(De))throw new Error("Maximum must be a real number, not: "+De);this._maximum=De}}),go.Shape._FigureParameters={},go.Shape.getFigureParameter=function(De,ne){var te=go.Shape._FigureParameters[De];return te?te[ne]:null},go.Shape.setFigureParameter=function(De,ne,te){if(!(te instanceof Zn))throw new Error("Third argument to Shape.setFigureParameter is not FigureParameter: "+te);if(te.defaultValue<te.minimum||te.defaultValue>te.maximum)throw new Error("defaultValue must be between minimum and maximum, not: "+te.defaultValue);var de=go.Shape._FigureParameters[De];de||(de=[],go.Shape._FigureParameters[De]=de),de[ne]=te};var ei=[];function Le(De,ne){var te=ei.pop();return te===void 0?new go.Point(De,ne):(te.x=De,te.y=ne,te)}function le(){var De=ei.pop();return De===void 0?new go.Point:De}function Ke(De){ei.push(De)}function it(De,ne,te,de,se,ge,ye,we,Ce){Ce||(Ce=new go.Point);var _e=De-te,Ze=se-ye,lt=NaN,Qe=NaN;if(_e===0)if(Ze===0)De===te&&(lt=De,Qe=ne);else{var Ue=(ge-we)/Ze,dt=ge-Ue*se;lt=De,Qe=Ue*lt+dt}else if(Ze===0){var $e=(ne-de)/_e,wt=ne-$e*De;lt=se,Qe=$e*lt+wt}else{var $e=(ne-de)/_e,Ue=(ge-we)/Ze,wt=ne-$e*De,dt=ge-Ue*se;lt=(dt-wt)/($e-Ue),Qe=$e*lt+wt}return Ce.x=lt,Ce.y=Qe,Ce}function bt(De,ne,te,de,se,ge,ye,we,Ce,_e,Ze,lt,Qe,Ue){var dt=1-Ce,$e=Ce,wt=De*dt+te*$e,St=ne*dt+de*$e,Lt=te*dt+se*$e,pn=de*dt+ge*$e,en=se*dt+ye*$e,vn=ge*dt+we*$e,rn=wt*dt+Lt*$e,nt=St*dt+pn*$e,rt=Lt*dt+en*$e,dn=pn*dt+vn*$e,ri=rn*dt+rt*$e,Hn=nt*dt+dn*$e;_e.x=wt,_e.y=St,Ze.x=rn,Ze.y=nt,lt.x=ri,lt.y=Hn,Qe.x=rt,Qe.y=dn,Ue.x=en,Ue.y=vn}var vt=new go.Spot(.156,.156),Oe=new go.Spot(.844,.844),st=4*((Math.sqrt(2)-1)/3);go.Shape.setFigureParameter("RoundedRectangle",0,new Zn("CornerRounding",5)),go.Shape.defineFigureGenerator("RoundedRectangle",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=5),de=Math.min(de,ne/3),de=Math.min(de,te/3);var se=de*st,ge=new go.Geometry().add(new go.PathFigure(de,0,!0).add(new go.PathSegment(go.PathSegment.Line,ne-de,0)).add(new go.PathSegment(go.PathSegment.Bezier,ne,de,ne-se,0,ne,se)).add(new go.PathSegment(go.PathSegment.Line,ne,te-de)).add(new go.PathSegment(go.PathSegment.Bezier,ne-de,te,ne,te-se,ne-se,te)).add(new go.PathSegment(go.PathSegment.Line,de,te)).add(new go.PathSegment(go.PathSegment.Bezier,0,te-de,se,te,0,te-se)).add(new go.PathSegment(go.PathSegment.Line,0,de)).add(new go.PathSegment(go.PathSegment.Bezier,de,0,0,se,se,0).close()));return se>1&&(ge.spot1=new go.Spot(0,0,se,se),ge.spot2=new go.Spot(1,1,-se,-se)),ge}),go.Shape.defineFigureGenerator("Border","RoundedRectangle"),go.Shape.defineFigureGenerator("TriangleRight",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())).setSpots(0,.25,.5,.75)}),go.Shape.defineFigureGenerator("TriangleDown",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,te).close())).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("TriangleLeft",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(ne,te).add(new go.PathSegment(go.PathSegment.Line,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,ne,0).close())).setSpots(.5,.25,1,.75)}),go.Shape.defineFigureGenerator("TriangleUp",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(ne,te).add(new go.PathSegment(go.PathSegment.Line,0,te)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,0).close())).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("Triangle","TriangleUp"),go.Shape.defineFigureGenerator("Diamond",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.5*ne,0).add(new go.PathSegment(go.PathSegment.Line,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te).close())).setSpots(.25,.25,.75,.75)}),go.Shape.defineFigureGenerator("LineH",function(De,ne,te){var de=new go.Geometry(go.Geometry.Line);return de.startX=0,de.startY=te/2,de.endX=ne,de.endY=te/2,de}),go.Shape.defineFigureGenerator("LineV",function(De,ne,te){var de=new go.Geometry(go.Geometry.Line);return de.startX=ne/2,de.startY=0,de.endX=ne/2,de.endY=te,de}),go.Shape.defineFigureGenerator("BarH","Rectangle"),go.Shape.defineFigureGenerator("BarV","Rectangle"),go.Shape.defineFigureGenerator("MinusLine","LineH"),go.Shape.defineFigureGenerator("PlusLine",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,te/2,!1).add(new go.PathSegment(go.PathSegment.Line,ne,te/2)).add(new go.PathSegment(go.PathSegment.Move,ne/2,0)).add(new go.PathSegment(go.PathSegment.Line,ne/2,te)))}),go.Shape.defineFigureGenerator("XLine",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,te,!1).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Move,0,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)))}),go.Shape.defineFigureGenerator("LineRight",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.25*ne,0,!1).add(new go.PathSegment(go.PathSegment.Line,.75*ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,.25*ne,te)))}),go.Shape.defineFigureGenerator("LineDown",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,.25*te,!1).add(new go.PathSegment(go.PathSegment.Line,.5*ne,.75*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)))}),go.Shape.defineFigureGenerator("LineLeft",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.75*ne,0,!1).add(new go.PathSegment(go.PathSegment.Line,.25*ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,.75*ne,te)))}),go.Shape.defineFigureGenerator("LineUp",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,.75*te,!1).add(new go.PathSegment(go.PathSegment.Line,.5*ne,.25*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.75*te)))}),go.Shape.defineFigureGenerator("AsteriskLine",function(De,ne,te){var de=.2/Math.SQRT2;return new go.Geometry().add(new go.PathFigure(de*ne,(1-de)*te,!1).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,de*te)).add(new go.PathSegment(go.PathSegment.Move,de*ne,de*te)).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,(1-de)*te)).add(new go.PathSegment(go.PathSegment.Move,0,te/2)).add(new go.PathSegment(go.PathSegment.Line,ne,te/2)).add(new go.PathSegment(go.PathSegment.Move,ne/2,0)).add(new go.PathSegment(go.PathSegment.Line,ne/2,te)))}),go.Shape.defineFigureGenerator("CircleLine",function(De,ne,te){var de=ne/2,se=new go.Geometry().add(new go.PathFigure(ne,ne/2,!1).add(new go.PathSegment(go.PathSegment.Arc,0,360,de,de,de,de).close()));return se.spot1=vt,se.spot2=Oe,se.defaultStretch=go.GraphObject.Uniform,se}),go.Shape.defineFigureGenerator("Line1",function(De,ne,te){var de=new go.Geometry(go.Geometry.Line);return de.startX=0,de.startY=0,de.endX=ne,de.endY=te,de}),go.Shape.defineFigureGenerator("Line2",function(De,ne,te){var de=new go.Geometry(go.Geometry.Line);return de.startX=ne,de.startY=0,de.endX=0,de.endY=te,de}),go.Shape.defineFigureGenerator("Curve1",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,ne,te,st*ne,0,ne,(1-st)*te)))}),go.Shape.defineFigureGenerator("Curve2",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,ne,te,0,st*te,(1-st)*ne,te)))}),go.Shape.defineFigureGenerator("Curve3",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(ne,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,te,ne,st*te,st*ne,te)))}),go.Shape.defineFigureGenerator("Curve4",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(ne,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,te,(1-st)*ne,0,0,(1-st)*te)))}),go.Shape.defineFigureGenerator("TriangleDownLeft",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())).setSpots(0,.5,.5,1)}),go.Shape.defineFigureGenerator("TriangleDownRight",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(ne,0,!0).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())).setSpots(.5,.5,1,1)}),go.Shape.defineFigureGenerator("TriangleUpLeft",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())).setSpots(0,0,.5,.5)}),go.Shape.defineFigureGenerator("TriangleUpRight",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te).close())).setSpots(.5,0,1,.5)}),go.Shape.defineFigureGenerator("RightTriangle","TriangleDownLeft"),go.Shape.setFigureParameter("Parallelogram1",0,new Zn("Indent",.1,-.99,.99)),go.Shape.defineFigureGenerator("Parallelogram1",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)?de=.1:de<-1?de=-1:de>1&&(de=1);var se=Math.abs(de)*ne;if(de===0){var ge=new go.Geometry(go.Geometry.Rectangle);return ge.startX=0,ge.startY=0,ge.endX=ne,ge.endY=te,ge}else{var ge=new go.Geometry;return de>0?ge.add(new go.PathFigure(se,0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne-se,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())):ge.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne-se,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,se,te).close())),se<ne/2&&ge.setSpots(se/ne,0,(ne-se)/ne,1),ge}}),go.Shape.defineFigureGenerator("Parallelogram","Parallelogram1"),go.Shape.setFigureParameter("Parallelogram2",0,new Zn("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("Parallelogram2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)?de=10:de<-ne?de=-ne:de>ne&&(de=ne);var se=Math.abs(de);if(de===0){var ge=new go.Geometry(go.Geometry.Rectangle);return ge.startX=0,ge.startY=0,ge.endX=ne,ge.endY=te,ge}else{var ge=new go.Geometry;return de>0?ge.add(new go.PathFigure(se,0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne-se,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())):ge.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne-se,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,se,te).close())),se<ne/2&&ge.setSpots(se/ne,0,(ne-se)/ne,1),ge}}),go.Shape.setFigureParameter("Trapezoid1",0,new Zn("Indent",.2,-.99,.99)),go.Shape.defineFigureGenerator("Trapezoid1",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)?de=.2:de<.5?de=-.5:de>.5&&(de=.5);var se=Math.abs(de)*ne;if(de===0){var ge=new go.Geometry(go.Geometry.Rectangle);return ge.startX=0,ge.startY=0,ge.endX=ne,ge.endY=te,ge}else{var ge=new go.Geometry;return de>0?ge.add(new go.PathFigure(se,0).add(new go.PathSegment(go.PathSegment.Line,ne-se,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())):ge.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne-se,te)).add(new go.PathSegment(go.PathSegment.Line,se,te).close())),se<ne/2&&ge.setSpots(se/ne,0,(ne-se)/ne,1),ge}}),go.Shape.defineFigureGenerator("Trapezoid","Trapezoid1"),go.Shape.setFigureParameter("Trapezoid2",0,new Zn("Indent",20,-1/0,1/0)),go.Shape.defineFigureGenerator("Trapezoid2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)?de=20:de<-ne?de=-ne/2:de>ne&&(de=ne/2);var se=Math.abs(de);if(de===0){var ge=new go.Geometry(go.Geometry.Rectangle);return ge.startX=0,ge.startY=0,ge.endX=ne,ge.endY=te,ge}else{var ge=new go.Geometry;return de>0?ge.add(new go.PathFigure(se,0).add(new go.PathSegment(go.PathSegment.Line,ne-se,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())):ge.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne-se,te)).add(new go.PathSegment(go.PathSegment.Line,se,te).close())),se<ne/2&&ge.setSpots(se/ne,0,(ne-se)/ne,1),ge}}),go.Shape.setFigureParameter("ManualOperation",0,new Zn("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("ManualOperation",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)?de=10:de<-ne?de=-ne/2:de>ne&&(de=ne/2);var se=Math.abs(de);if(de===0){var ge=new go.Geometry(go.Geometry.Rectangle);return ge.startX=0,ge.startY=0,ge.endX=ne,ge.endY=te,ge}else{var ge=new go.Geometry;return de>0?ge.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne-se,te)).add(new go.PathSegment(go.PathSegment.Line,se,te).close())):ge.add(new go.PathFigure(se,0).add(new go.PathSegment(go.PathSegment.Line,ne-se,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close())),se<ne/2&&ge.setSpots(se/ne,0,(ne-se)/ne,1),ge}});var Et=[];function ot(){var De=Et.pop();return De===void 0?[]:De}function We(De){De.length=0,Et.push(De)}function Tt(De){for(var ne=ot(),te=.5,de=.5,se=Math.PI*1.5,ge=0,ye=0;ye<De;ye++)ge=2*Math.PI/De*ye+se,ne[ye]=new go.Point(de+te*Math.cos(ge),de+te*Math.sin(ge));return ne.push(ne[0]),ne}function ct(De){var ne=At(De),te=ot();te[0]=ne[0];for(var de=1,se=1;de<ne.length;de+=2,se+=3)te[se]=ne[de],te[se+1]=ne[de],te[se+2]=ne[de+1];return We(ne),te}function At(De){for(var ne=Tt(De),te=ot(),de=Math.floor(ne.length/2),se=ne.length-1,ge=De%2===0?2:1,ye=0;ye<se;ye++){var we=ne[ye],Ce=ne[ye+1],_e=ne[(de+ye-1)%se],Ze=ne[(de+ye+ge)%se];te[ye*2]=we,te[ye*2+1]=it(we.x,we.y,_e.x,_e.y,Ce.x,Ce.y,Ze.x,Ze.y,new go.Point)}return te[te.length]=te[0],We(ne),te}go.Shape.defineFigureGenerator("Pentagon",function(De,ne,te){var de=Tt(5),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<5;ye++)ge.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return ge.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.2,.22),se.spot2=new go.Spot(.8,.9),se}),go.Shape.defineFigureGenerator("Hexagon",function(De,ne,te){var de=Tt(6),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<6;ye++)ge.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return ge.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.07,.25),se.spot2=new go.Spot(.93,.75),se}),go.Shape.defineFigureGenerator("Heptagon",function(De,ne,te){var de=Tt(7),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<7;ye++)ge.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return ge.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.2,.15),se.spot2=new go.Spot(.8,.85),se}),go.Shape.defineFigureGenerator("Octagon",function(De,ne,te){var de=Tt(8),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<8;ye++)ge.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return ge.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.15,.15),se.spot2=new go.Spot(.85,.85),se}),go.Shape.defineFigureGenerator("Nonagon",function(De,ne,te){var de=Tt(9),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<9;ye++)ge.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return ge.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.17,.13),se.spot2=new go.Spot(.82,.82),se}),go.Shape.defineFigureGenerator("Decagon",function(De,ne,te){var de=Tt(10),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<10;ye++)ge.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return ge.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.16,.16),se.spot2=new go.Spot(.84,.84),se}),go.Shape.defineFigureGenerator("Dodecagon",function(De,ne,te){var de=Tt(12),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<12;ye++)ge.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return ge.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.16,.16),se.spot2=new go.Spot(.84,.84),se}),go.Shape.defineFigureGenerator("FivePointedStar",function(De,ne,te){var de=At(5),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<10;ye++)ge.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return ge.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.266,.333),se.spot2=new go.Spot(.733,.733),se}),go.Shape.defineFigureGenerator("SixPointedStar",function(De,ne,te){var de=At(6),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<12;ye++)ge.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return ge.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.17,.25),se.spot2=new go.Spot(.83,.75),se}),go.Shape.defineFigureGenerator("SevenPointedStar",function(De,ne,te){var de=At(7),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<14;ye++)ge.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return ge.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.222,.277),se.spot2=new go.Spot(.777,.666),se}),go.Shape.defineFigureGenerator("EightPointedStar",function(De,ne,te){var de=At(8),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<16;ye++)ge.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return ge.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.25,.25),se.spot2=new go.Spot(.75,.75),se}),go.Shape.defineFigureGenerator("NinePointedStar",function(De,ne,te){var de=At(9),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<18;ye++)ge.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return ge.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.222,.277),se.spot2=new go.Spot(.777,.666),se}),go.Shape.defineFigureGenerator("TenPointedStar",function(De,ne,te){var de=At(10),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<20;ye++)ge.add(new go.PathSegment(go.PathSegment.Line,de[ye].x*ne,de[ye].y*te));return ge.add(new go.PathSegment(go.PathSegment.Line,de[0].x*ne,de[0].y*te).close()),We(de),se.spot1=new go.Spot(.281,.261),se.spot2=new go.Spot(.723,.748),se}),go.Shape.defineFigureGenerator("FivePointedBurst",function(De,ne,te){var de=ct(5),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<de.length;ye+=3)ge.add(new go.PathSegment(go.PathSegment.Bezier,de[ye+2].x*ne,de[ye+2].y*te,de[ye].x*ne,de[ye].y*te,de[ye+1].x*ne,de[ye+1].y*te));return ge.segments.last().close(),We(de),se.spot1=new go.Spot(.222,.277),se.spot2=new go.Spot(.777,.777),se}),go.Shape.defineFigureGenerator("SixPointedBurst",function(De,ne,te){var de=ct(6),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<de.length;ye+=3)ge.add(new go.PathSegment(go.PathSegment.Bezier,de[ye+2].x*ne,de[ye+2].y*te,de[ye].x*ne,de[ye].y*te,de[ye+1].x*ne,de[ye+1].y*te));return ge.segments.last().close(),We(de),se.spot1=new go.Spot(.17,.222),se.spot2=new go.Spot(.833,.777),se}),go.Shape.defineFigureGenerator("SevenPointedBurst",function(De,ne,te){var de=ct(7),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<de.length;ye+=3)ge.add(new go.PathSegment(go.PathSegment.Bezier,de[ye+2].x*ne,de[ye+2].y*te,de[ye].x*ne,de[ye].y*te,de[ye+1].x*ne,de[ye+1].y*te));return ge.segments.last().close(),We(de),se.spot1=new go.Spot(.222,.222),se.spot2=new go.Spot(.777,.777),se}),go.Shape.defineFigureGenerator("EightPointedBurst",function(De,ne,te){var de=ct(8),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<de.length;ye+=3)ge.add(new go.PathSegment(go.PathSegment.Bezier,de[ye+2].x*ne,de[ye+2].y*te,de[ye].x*ne,de[ye].y*te,de[ye+1].x*ne,de[ye+1].y*te));return ge.segments.last().close(),We(de),se.spot1=new go.Spot(.222,.222),se.spot2=new go.Spot(.777,.777),se}),go.Shape.defineFigureGenerator("NinePointedBurst",function(De,ne,te){var de=ct(9),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<de.length;ye+=3)ge.add(new go.PathSegment(go.PathSegment.Bezier,de[ye+2].x*ne,de[ye+2].y*te,de[ye].x*ne,de[ye].y*te,de[ye+1].x*ne,de[ye+1].y*te));return ge.segments.last().close(),We(de),se.spot1=new go.Spot(.222,.222),se.spot2=new go.Spot(.777,.777),se}),go.Shape.defineFigureGenerator("TenPointedBurst",function(De,ne,te){var de=ct(10),se=new go.Geometry,ge=new go.PathFigure(de[0].x*ne,de[0].y*te,!0);se.add(ge);for(var ye=1;ye<de.length;ye+=3)ge.add(new go.PathSegment(go.PathSegment.Bezier,de[ye+2].x*ne,de[ye+2].y*te,de[ye].x*ne,de[ye].y*te,de[ye+1].x*ne,de[ye+1].y*te));return ge.segments.last().close(),We(de),se.spot1=new go.Spot(.222,.222),se.spot2=new go.Spot(.777,.777),se}),go.Shape.setFigureParameter("FramedRectangle",0,new Zn("ThicknessX",8)),go.Shape.setFigureParameter("FramedRectangle",1,new Zn("ThicknessY",8)),go.Shape.defineFigureGenerator("FramedRectangle",function(De,ne,te){var de=De?De.parameter1:NaN,se=De?De.parameter2:NaN;isNaN(de)&&(de=8),isNaN(se)&&(se=8);var ge=new go.Geometry,ye=new go.PathFigure(0,0,!0);return ge.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de<ne/2&&se<te/2&&(ye.add(new go.PathSegment(go.PathSegment.Move,de,se)),ye.add(new go.PathSegment(go.PathSegment.Line,de,te-se)),ye.add(new go.PathSegment(go.PathSegment.Line,ne-de,te-se)),ye.add(new go.PathSegment(go.PathSegment.Line,ne-de,se).close())),ge.setSpots(0,0,1,1,de,se,-de,-se),ge}),go.Shape.setFigureParameter("Ring",0,new Zn("Thickness",8)),go.Shape.defineFigureGenerator("Ring",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=8);var se=ne/2,ge=new go.Geometry,ye=new go.PathFigure(ne,ne/2,!0);ge.add(ye),ye.add(new go.PathSegment(go.PathSegment.Arc,0,360,se,se,se,se).close());var we=Math.max(se-de,0);return we>0&&(ye.add(new go.PathSegment(go.PathSegment.Move,ne/2+we,ne/2)),ye.add(new go.PathSegment(go.PathSegment.Arc,0,-360,se,se,we,we).close())),ge.spot1=vt,ge.spot2=Oe,ge.defaultStretch=go.GraphObject.Uniform,ge}),go.Shape.defineFigureGenerator("Cloud",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.08034461*ne,.1944299*te,!0).add(new go.PathSegment(go.PathSegment.Bezier,.2008615*ne,.05349299*te,-.09239631*ne,.07836421*te,.1406031*ne,-.0542823*te)).add(new go.PathSegment(go.PathSegment.Bezier,.4338609*ne,.074219*te,.2450511*ne,-.00697547*te,.3776197*ne,-.01112067*te)).add(new go.PathSegment(go.PathSegment.Bezier,.6558228*ne,.07004196*te,.4539471*ne,0,.6066018*ne,-.02526587*te)).add(new go.PathSegment(go.PathSegment.Bezier,.8921095*ne,.08370865*te,.6914277*ne,-.01904177*te,.8921095*ne,-.01220843*te)).add(new go.PathSegment(go.PathSegment.Bezier,.9147671*ne,.3194596*te,1.036446*ne,.04105738*te,1.020377*ne,.3022052*te)).add(new go.PathSegment(go.PathSegment.Bezier,.9082935*ne,.562044*te,1.04448*ne,.360238*te,.992256*ne,.5219009*te)).add(new go.PathSegment(go.PathSegment.Bezier,.9212406*ne,.8217117*te,1.032337*ne,.5771781*te,1.018411*ne,.8120651*te)).add(new go.PathSegment(go.PathSegment.Bezier,.7592566*ne,.9156953*te,1.028411*ne,.9571472*te,.8556702*ne,1.052487*te)).add(new go.PathSegment(go.PathSegment.Bezier,.5101666*ne,.9310455*te,.7431877*ne,1.009325*te,.5624123*ne,1.021761*te)).add(new go.PathSegment(go.PathSegment.Bezier,.2609328*ne,.9344623*te,.4820677*ne,1.031761*te,.3030112*ne,1.002796*te)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*ne,.870098*te,.2329994*ne,1.01518*te,.03213784*ne,1.01518*te)).add(new go.PathSegment(go.PathSegment.Bezier,.06829292*ne,.6545475*te,-.02812061*ne,.9032597*te,-.01205169*ne,.6835638*te)).add(new go.PathSegment(go.PathSegment.Bezier,.06427569*ne,.4265613*te,-.01812061*ne,.6089503*te,-.00606892*ne,.4555777*te)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*ne,.1944299*te,-.01606892*ne,.3892545*te,-.01205169*ne,.1944299*te))).setSpots(.1,.1,.9,.9)}),go.Shape.defineFigureGenerator("StopSign",function(De,ne,te){var de=1/(Math.SQRT2+2);return new go.Geometry().add(new go.PathFigure(de*ne,0,!0).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,de*te)).add(new go.PathSegment(go.PathSegment.Line,ne,(1-de)*te)).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,te)).add(new go.PathSegment(go.PathSegment.Line,de*ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,(1-de)*te)).add(new go.PathSegment(go.PathSegment.Line,0,de*te).close())).setSpots(de/2,de/2,1-de/2,1-de/2)}),go.Shape.setFigureParameter("Pie",0,new Zn("Start",0,-360,360)),go.Shape.setFigureParameter("Pie",1,new Zn("Sweep",315,-360,360)),go.Shape.defineFigureGenerator("Pie",function(De,ne,te){var de=De?De.parameter1:NaN,se=De?De.parameter2:NaN;isNaN(de)&&(de=0),isNaN(se)&&(se=315);var ge=de%360;ge<0&&(ge+=360);var ye=se%360,we=Math.min(ne,te)/2;return new go.Geometry().add(new go.PathFigure(we,we).add(new go.PathSegment(go.PathSegment.Arc,ge,ye,we,we,we,we).close()))}),go.Shape.defineFigureGenerator("PiePiece",function(De,ne,te){var de=st/Math.SQRT2*.5,se=Math.SQRT2/2,ge=1-Math.SQRT2/2;return new go.Geometry().add(new go.PathFigure(ne,te,!0).add(new go.PathSegment(go.PathSegment.Bezier,se*ne,ge*te,ne,(1-de)*te,(se+de)*ne,(ge+de)*te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close()))}),go.Shape.setFigureParameter("ThickCross",0,new Zn("Thickness",30)),go.Shape.defineFigureGenerator("ThickCross",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=30);var se=Math.min(de,ne)/2,ge=ne/2,ye=te/2;return new go.Geometry().add(new go.PathFigure(ge-se,0,!0).add(new go.PathSegment(go.PathSegment.Line,ge+se,0)).add(new go.PathSegment(go.PathSegment.Line,ge+se,ye-se)).add(new go.PathSegment(go.PathSegment.Line,ne,ye-se)).add(new go.PathSegment(go.PathSegment.Line,ne,ye+se)).add(new go.PathSegment(go.PathSegment.Line,ge+se,ye+se)).add(new go.PathSegment(go.PathSegment.Line,ge+se,te)).add(new go.PathSegment(go.PathSegment.Line,ge-se,te)).add(new go.PathSegment(go.PathSegment.Line,ge-se,ye+se)).add(new go.PathSegment(go.PathSegment.Line,0,ye+se)).add(new go.PathSegment(go.PathSegment.Line,0,ye-se)).add(new go.PathSegment(go.PathSegment.Line,ge-se,ye-se).close()))}),go.Shape.setFigureParameter("ThinCross",0,new Zn("Thickness",10)),go.Shape.defineFigureGenerator("ThinCross",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=10);var se=Math.min(de,ne)/2,ge=ne/2,ye=te/2;return new go.Geometry().add(new go.PathFigure(ge-se,0,!0).add(new go.PathSegment(go.PathSegment.Line,ge+se,0)).add(new go.PathSegment(go.PathSegment.Line,ge+se,ye-se)).add(new go.PathSegment(go.PathSegment.Line,ne,ye-se)).add(new go.PathSegment(go.PathSegment.Line,ne,ye+se)).add(new go.PathSegment(go.PathSegment.Line,ge+se,ye+se)).add(new go.PathSegment(go.PathSegment.Line,ge+se,te)).add(new go.PathSegment(go.PathSegment.Line,ge-se,te)).add(new go.PathSegment(go.PathSegment.Line,ge-se,ye+se)).add(new go.PathSegment(go.PathSegment.Line,0,ye+se)).add(new go.PathSegment(go.PathSegment.Line,0,ye-se)).add(new go.PathSegment(go.PathSegment.Line,ge-se,ye-se).close()))}),go.Shape.setFigureParameter("ThickX",0,new Zn("Thickness",30)),go.Shape.defineFigureGenerator("ThickX",function(De,ne,te){var de=De?De.parameter1:NaN;if((isNaN(de)||de<0)&&(de=30),ne===0||te===0){var se=new go.Geometry(go.Geometry.Rectangle);return se.startX=0,se.startY=0,se.endX=ne,se.endY=te,se}else{var ge=ne/2,ye=te/2,we=Math.atan2(te,ne),Ce=de-Math.min(Math.cos(we)*de/2,ge),_e=de-Math.min(Math.sin(we)*de/2,ye),se=new go.Geometry,Ze=new go.PathFigure(Ce,0,!0);return se.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Line,ge,.2*te)),Ze.add(new go.PathSegment(go.PathSegment.Line,ne-Ce,0)),Ze.add(new go.PathSegment(go.PathSegment.Line,ne,_e)),Ze.add(new go.PathSegment(go.PathSegment.Line,.8*ne,ye)),Ze.add(new go.PathSegment(go.PathSegment.Line,ne,te-_e)),Ze.add(new go.PathSegment(go.PathSegment.Line,ne-Ce,te)),Ze.add(new go.PathSegment(go.PathSegment.Line,ge,.8*te)),Ze.add(new go.PathSegment(go.PathSegment.Line,Ce,te)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,te-_e)),Ze.add(new go.PathSegment(go.PathSegment.Line,.2*ne,ye)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,_e).close()),se}}),go.Shape.setFigureParameter("ThinX",0,new Zn("Thickness",10)),go.Shape.defineFigureGenerator("ThinX",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=10);var se=new go.Geometry,ge=new go.PathFigure(.1*ne,0,!0);return se.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.4*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.9*ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,.1*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.5*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,.9*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.9*ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.6*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.1*ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,.9*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.5*te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,.1*te).close()),se}),go.Shape.setFigureParameter("SquareIBeam",0,new Zn("BeamWidth",.2,.1,.9)),go.Shape.defineFigureGenerator("SquareIBeam",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.2);var se=new go.Geometry,ge=new go.PathFigure(0,0,!0);return se.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,de*te)),ge.add(new go.PathSegment(go.PathSegment.Line,(.5+de/2)*ne,de*te)),ge.add(new go.PathSegment(go.PathSegment.Line,(.5+de/2)*ne,(1-de)*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,(1-de)*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,(1-de)*te)),ge.add(new go.PathSegment(go.PathSegment.Line,(.5-de/2)*ne,(1-de)*te)),ge.add(new go.PathSegment(go.PathSegment.Line,(.5-de/2)*ne,de*te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,de*te).close()),se}),go.Shape.setFigureParameter("RoundedIBeam",0,new Zn("Curviness",.5,.05,.65)),go.Shape.defineFigureGenerator("RoundedIBeam",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.5);var se=new go.Geometry,ge=new go.PathFigure(0,0,!0);return se.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ge.add(new go.PathSegment(go.PathSegment.Bezier,ne,te,Math.abs(1-de)*ne,.25*te,Math.abs(1-de)*ne,.75*te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te)),ge.add(new go.PathSegment(go.PathSegment.Bezier,0,0,de*ne,.75*te,de*ne,.25*te).close()),se}),go.Shape.defineFigureGenerator("HalfEllipse",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,st*ne,0,ne,(.5-st/2)*te)).add(new go.PathSegment(go.PathSegment.Bezier,0,te,ne,(.5+st/2)*te,st*ne,te).close())).setSpots(0,.156,.844,.844)}),go.Shape.defineFigureGenerator("Crescent",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,te,ne,0,ne,te)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.5*ne,.75*te,.5*ne,.25*te).close())).setSpots(.311,.266,.744,.744)}),go.Shape.defineFigureGenerator("Heart",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.5*ne,te,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,.3*te,.1*ne,.8*te,0,.5*te)).add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.3*te,0,0,.45*ne,0)).add(new go.PathSegment(go.PathSegment.Bezier,ne,.3*te,.55*ne,0,ne,0)).add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,.5*te,.9*ne,.8*te).close())).setSpots(.14,.29,.86,.78)}),go.Shape.defineFigureGenerator("Spade",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.5*ne,0,!0).add(new go.PathSegment(go.PathSegment.Line,.51*ne,.01*te)).add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,.6*ne,.2*te,ne,.25*te)).add(new go.PathSegment(go.PathSegment.Bezier,.55*ne,.7*te,ne,.8*te,.6*ne,.8*te)).add(new go.PathSegment(go.PathSegment.Bezier,.75*ne,te,.5*ne,.75*te,.55*ne,.95*te)).add(new go.PathSegment(go.PathSegment.Line,.25*ne,te)).add(new go.PathSegment(go.PathSegment.Bezier,.45*ne,.7*te,.45*ne,.95*te,.5*ne,.75*te)).add(new go.PathSegment(go.PathSegment.Bezier,0,.5*te,.4*ne,.8*te,0,.8*te)).add(new go.PathSegment(go.PathSegment.Bezier,.49*ne,.01*te,0,.25*te,.4*ne,.2*te).close())).setSpots(.14,.26,.86,.78)}),go.Shape.defineFigureGenerator("Club",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.4*ne,.6*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,.15*ne,te,.5*ne,.75*te,.45*ne,.95*te)),se.add(new go.PathSegment(go.PathSegment.Line,.85*ne,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.6*ne,.6*te,.55*ne,.95*te,.5*ne,.75*te));var ge=.2,ye=.3,we=0,Ce=ge*st;return se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5+ge+we)*te,(.5-ge+ye)*ne,(.5+Ce+we)*te,(.5-Ce+ye)*ne,(.5+ge+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+ge+ye)*ne,(.5+we)*te,(.5+Ce+ye)*ne,(.5+ge+we)*te,(.5+ge+ye)*ne,(.5+Ce+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5-ge+we)*te,(1-.5+ge+ye)*ne,(.5-Ce+we)*te,(.5+Ce+ye)*ne,(.5-ge+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.65*ne,.36771243*te,(.5-Ce+ye)*ne,(.5-ge+we)*te,(.5-ge+ye+.05)*ne,(.5-Ce+we-.02)*te)),ge=.2,ye=0,we=-.3,Ce=ge*st,se.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+ge+ye)*ne,(.5+we)*te,(.5+Ce+ye)*ne,(.5+ge+we)*te,(.5+ge+ye)*ne,(.5+Ce+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5-ge+we)*te,(1-.5+ge+ye)*ne,(.5-Ce+we)*te,(.5+Ce+ye)*ne,(.5-ge+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5-ge+ye)*ne,(.5+we)*te,(.5-Ce+ye)*ne,(.5-ge+we)*te,(.5-ge+ye)*ne,(.5-Ce+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5-Ce+ye)*ne,(.5+ge+we)*te,(.5-ge+ye)*ne,(.5+Ce+we)*te,(.5-Ce+ye)*ne,(.5+ge+we)*te)),ge=.2,ye=-.3,we=0,Ce=ge*st,se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5-ge+we)*te,(1-.5+ge+ye-.05)*ne,(.5-Ce+we-.02)*te,(.5+Ce+ye)*ne,(.5-ge+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5-ge+ye)*ne,(.5+we)*te,(.5-Ce+ye)*ne,(.5-ge+we)*te,(.5-ge+ye)*ne,(.5-Ce+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5+ge+we)*te,(.5-ge+ye)*ne,(.5+Ce+we)*te,(.5-Ce+ye)*ne,(.5+ge+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.4*ne,.6*te,(.5+Ce+ye)*ne,(.5+ge+we)*te,(.5+ge+ye)*ne,(.5+Ce+we)*te).close()),de.setSpots(.06,.33,.93,.68),de}),go.Shape.defineFigureGenerator("YinYang",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*.5,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Arc,270,180,ne*.5,ne*.5,ne*.5,ne*.5)),se.add(new go.PathSegment(go.PathSegment.Arc,90,-180,ne*.5,ne*.75,ne*.25,ne*.25)),se.add(new go.PathSegment(go.PathSegment.Arc,90,180,ne*.5,ne*.25,ne*.25,ne*.25));var ge=.1,ye=.5,we=.25;return se.add(new go.PathSegment(go.PathSegment.Move,(ye+ge)*ne,we*te)),se.add(new go.PathSegment(go.PathSegment.Arc,0,-360,ne*ye,te*we,ge*ne,ge*ne).close()),se=new go.PathFigure(ne*.5,0,!1),de.add(se),se.add(new go.PathSegment(go.PathSegment.Arc,270,-180,ne*.5,ne*.5,ne*.5,ne*.5)),we=.75,se=new go.PathFigure((ye+ge)*ne,we*te,!0),de.add(se),se.add(new go.PathSegment(go.PathSegment.Arc,0,360,ne*ye,te*we,ge*ne,ge*ne).close()),de.defaultStretch=go.GraphObject.Uniform,de}),go.Shape.defineFigureGenerator("Peace",function(De,ne,te){var de=.8535533905932737,se=.5*ne,ge=.5*te;return new go.Geometry().add(new go.PathFigure(se,0,!1).add(new go.PathSegment(go.PathSegment.Arc,270,360,se,ge,se,ge)).add(new go.PathSegment(go.PathSegment.Line,se,te)).add(new go.PathSegment(go.PathSegment.Move,se,ge)).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,de*te)).add(new go.PathSegment(go.PathSegment.Move,se,ge)).add(new go.PathSegment(go.PathSegment.Line,de*ne,de*te)))}),go.Shape.defineFigureGenerator("NotAllowed",function(De,ne,te){var de=new go.Geometry,se=st*.5,ge=.5,ye=.5,we=.5,Ce=new go.PathFigure(ye*ne,(we-ge)*te);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye-ge)*ne,we*te,(ye-se)*ne,(we-ge)*te,(ye-ge)*ne,(we-se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+ge)*te,(ye-ge)*ne,(we+se)*te,(ye-se)*ne,(we+ge)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+ge)*ne,we*te,(ye+se)*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-ge)*te,(ye+ge)*ne,(we-se)*te,(ye+se)*ne,(we-ge)*te)),ge=.4,se=st*.4;var _e=le(),Ze=le(),lt=le(),Qe=le();bt(ye,we-ge,ye+se,we-ge,ye+ge,we-se,ye+ge,we,.42,_e,Ze,lt,Qe,Qe);var Ue=le(),dt=le(),$e=le();bt(ye,we-ge,ye+se,we-ge,ye+ge,we-se,ye+ge,we,.58,Qe,Qe,$e,Ue,dt);var wt=le(),St=le(),Lt=le();bt(ye,we+ge,ye-se,we+ge,ye-ge,we+se,ye-ge,we,.42,wt,St,Lt,Qe,Qe);var pn=le(),en=le(),vn=le();return bt(ye,we+ge,ye-se,we+ge,ye-ge,we+se,ye-ge,we,.58,Qe,Qe,vn,pn,en),Ce.add(new go.PathSegment(go.PathSegment.Move,vn.x*ne,vn.y*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye-ge)*ne,we*te,pn.x*ne,pn.y*te,en.x*ne,en.y*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-ge)*te,(ye-ge)*ne,(we-se)*te,(ye-se)*ne,(we-ge)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,lt.x*ne,lt.y*te,_e.x*ne,_e.y*te,Ze.x*ne,Ze.y*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,vn.x*ne,vn.y*te).close()),Ce.add(new go.PathSegment(go.PathSegment.Move,Lt.x*ne,Lt.y*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,$e.x*ne,$e.y*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+ge)*ne,we*te,Ue.x*ne,Ue.y*te,dt.x*ne,dt.y*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te,(ye+se)*ne,(we+ge)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,Lt.x*ne,Lt.y*te,wt.x*ne,wt.y*te,St.x*ne,St.y*te).close()),Ke(_e),Ke(Ze),Ke(lt),Ke(Qe),Ke(Ue),Ke(dt),Ke($e),Ke(wt),Ke(St),Ke(Lt),Ke(pn),Ke(en),Ke(vn),de.defaultStretch=go.GraphObject.Uniform,de}),go.Shape.defineFigureGenerator("Fragile",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.25*ne,0)).add(new go.PathSegment(go.PathSegment.Line,.2*ne,.15*te)).add(new go.PathSegment(go.PathSegment.Line,.3*ne,.25*te)).add(new go.PathSegment(go.PathSegment.Line,.29*ne,.33*te)).add(new go.PathSegment(go.PathSegment.Line,.35*ne,.25*te)).add(new go.PathSegment(go.PathSegment.Line,.3*ne,.15*te)).add(new go.PathSegment(go.PathSegment.Line,.4*ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Bezier,.55*ne,.5*te,ne,.25*te,.75*ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,.55*ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.7*ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)).add(new go.PathSegment(go.PathSegment.Line,.3*ne,te)).add(new go.PathSegment(go.PathSegment.Line,.3*ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.45*ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.45*ne,.5*te)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*ne,.5*te,0,.25*te).close()))}),go.Shape.setFigureParameter("HourGlass",0,new Zn("Thickness",30)),go.Shape.defineFigureGenerator("HourGlass",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=30),de>ne&&(de=ne);var se=(ne-de)/2,ge=se+de;return new go.Geometry().add(new go.PathFigure(ge,.5*te).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te)).add(new go.PathSegment(go.PathSegment.Line,se,.5*te)).add(new go.PathSegment(go.PathSegment.Line,0,0)).add(new go.PathSegment(go.PathSegment.Line,ne,0).close()))}),go.Shape.defineFigureGenerator("Lightning",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,.55*te).add(new go.PathSegment(go.PathSegment.Line,.6*ne,0)).add(new go.PathSegment(go.PathSegment.Line,.3*ne,.45*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.45*te)).add(new go.PathSegment(go.PathSegment.Line,.4*ne,te)).add(new go.PathSegment(go.PathSegment.Line,.7*ne,.55*te).close()))}),go.Shape.defineFigureGenerator("GenderMale",function(De,ne,te){var de=new go.Geometry,se=st*.4,ge=.4,ye=.5,we=.5,Ce=le(),_e=le(),Ze=le(),lt=le(),Qe=new go.PathFigure((ye-ge)*ne,we*te,!1);de.add(Qe),Qe.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-ge)*te,(ye-ge)*ne,(we-se)*te,(ye-se)*ne,(we-ge)*te)),bt(ye,we-ge,ye+se,we-ge,ye+ge,we-se,ye+ge,we,.44,Ze,lt,_e,Ce,Ce),Qe.add(new go.PathSegment(go.PathSegment.Bezier,_e.x*ne,_e.y*te,Ze.x*ne,Ze.y*te,lt.x*ne,lt.y*te));var Ue=Le(_e.x,_e.y);bt(ye,we-ge,ye+se,we-ge,ye+ge,we-se,ye+ge,we,.56,Ce,Ce,_e,Ze,lt);var dt=Le(_e.x,_e.y);Qe.add(new go.PathSegment(go.PathSegment.Line,(Ue.x*.1+.95*.9)*ne,Ue.y*.1*te)),Qe.add(new go.PathSegment(go.PathSegment.Line,.85*ne,Ue.y*.1*te)),Qe.add(new go.PathSegment(go.PathSegment.Line,.85*ne,0)),Qe.add(new go.PathSegment(go.PathSegment.Line,ne,0)),Qe.add(new go.PathSegment(go.PathSegment.Line,ne,.15*te)),Qe.add(new go.PathSegment(go.PathSegment.Line,(dt.x*.1+.9)*ne,.15*te)),Qe.add(new go.PathSegment(go.PathSegment.Line,(dt.x*.1+.9)*ne,(dt.y*.1+.05*.9)*te)),Qe.add(new go.PathSegment(go.PathSegment.Line,dt.x*ne,dt.y*te)),Qe.add(new go.PathSegment(go.PathSegment.Bezier,(ye+ge)*ne,we*te,Ze.x*ne,Ze.y*te,lt.x*ne,lt.y*te)),Qe.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te,(ye+se)*ne,(we+ge)*te)),Qe.add(new go.PathSegment(go.PathSegment.Bezier,(ye-ge)*ne,we*te,(ye-se)*ne,(we+ge)*te,(ye-ge)*ne,(we+se)*te)),ge=.35,se=st*.35;var $e=new go.PathFigure(ye*ne,(we-ge)*te,!1);de.add($e),$e.add(new go.PathSegment(go.PathSegment.Bezier,(ye-ge)*ne,we*te,(ye-se)*ne,(we-ge)*te,(ye-ge)*ne,(we-se)*te)),$e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+ge)*te,(ye-ge)*ne,(we+se)*te,(ye-se)*ne,(we+ge)*te)),$e.add(new go.PathSegment(go.PathSegment.Bezier,(ye+ge)*ne,we*te,(ye+se)*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te)),$e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-ge)*te,(ye+ge)*ne,(we-se)*te,(ye+se)*ne,(we-ge)*te));var wt=new go.PathFigure((ye-ge)*ne,we*te,!1);return de.add(wt),Ke(Ce),Ke(_e),Ke(Ze),Ke(lt),Ke(Ue),Ke(dt),de.spot1=new go.Spot(.202,.257),de.spot2=new go.Spot(.792,.739),de.defaultStretch=go.GraphObject.Uniform,de}),go.Shape.defineFigureGenerator("GenderFemale",function(De,ne,te){var de=new go.Geometry,se=.375,ge=0,ye=-.125,we=se*st,Ce=new go.PathFigure((.525+ge)*ne,(.5+se+ye)*te,!1);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+se+ge)*ne,(.5+ye)*te,(.5+we+ge)*ne,(.5+se+ye)*te,(.5+se+ge)*ne,(.5+we+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ge)*ne,(.5-se+ye)*te,(1-.5+se+ge)*ne,(.5-we+ye)*te,(.5+we+ge)*ne,(.5-se+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(.5-se+ge)*ne,(.5+ye)*te,(.5-we+ge)*ne,(.5-se+ye)*te,(.5-se+ge)*ne,(.5-we+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(.475+ge)*ne,(.5+se+ye)*te,(.5-se+ge)*ne,(.5+we+ye)*te,(.5-we+ge)*ne,(.5+se+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.475*ne,.85*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.425*ne,.85*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.425*ne,.9*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.475*ne,.9*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.475*ne,te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.525*ne,te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.525*ne,.9*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.575*ne,.9*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.575*ne,.85*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.525*ne,.85*te).close()),se=.325,ge=0,ye=-.125,we=se*st;var Ce=new go.PathFigure((1-.5+se+ge)*ne,(.5+ye)*te,!1);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ge)*ne,(.5+se+ye)*te,(.5+se+ge)*ne,(.5+we+ye)*te,(.5+we+ge)*ne,(.5+se+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(.5-se+ge)*ne,(.5+ye)*te,(.5-we+ge)*ne,(.5+se+ye)*te,(.5-se+ge)*ne,(.5+we+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ge)*ne,(.5-se+ye)*te,(.5-se+ge)*ne,(.5-we+ye)*te,(.5-we+ge)*ne,(.5-se+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+se+ge)*ne,(.5+ye)*te,(.5+we+ge)*ne,(.5-se+ye)*te,(1-.5+se+ge)*ne,(.5-we+ye)*te));var Ce=new go.PathFigure((.525+ge)*ne,(.5+se+ye)*te,!1);return de.add(Ce),de.spot1=new go.Spot(.232,.136),de.spot2=new go.Spot(.682,.611),de.defaultStretch=go.GraphObject.Uniform,de}),go.Shape.defineFigureGenerator("LogicImplies",function(De,ne,te){var de=De?De.parameter1:NaN;return isNaN(de)&&(de=.2),new go.Geometry().add(new go.PathFigure((1-de)*ne,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,te)).add(new go.PathSegment(go.PathSegment.Move,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te))).setSpots(0,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicIff",function(De,ne,te){var de=De?De.parameter1:NaN;return isNaN(de)&&(de=.2),new go.Geometry().add(new go.PathFigure((1-de)*ne,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,(1-de)*ne,te)).add(new go.PathSegment(go.PathSegment.Move,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Move,de*ne,0)).add(new go.PathSegment(go.PathSegment.Line,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,de*ne,te))).setSpots(.2,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicNot",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)))}),go.Shape.defineFigureGenerator("LogicAnd",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,te,!1).add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te))).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("LogicOr",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)).add(new go.PathSegment(go.PathSegment.Line,ne,0))).setSpots(.219,0,.78,.409)}),go.Shape.defineFigureGenerator("LogicXor",function(De,ne,te){var de=new go.Geometry().add(new go.PathFigure(.5*ne,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)).add(new go.PathSegment(go.PathSegment.Move,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Arc,0,360,.5*ne,.5*te,.5*ne,.5*te)));return de.defaultStretch=go.GraphObject.Uniform,de}),go.Shape.defineFigureGenerator("LogicTruth",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Move,.5*ne,0)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)))}),go.Shape.defineFigureGenerator("LogicFalsity",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,te,!1).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Move,.5*ne,te)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)))}),go.Shape.defineFigureGenerator("LogicThereExists",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,0,.5*te)).add(new go.PathSegment(go.PathSegment.Move,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te)))}),go.Shape.defineFigureGenerator("LogicForAll",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Move,.25*ne,.5*te)).add(new go.PathSegment(go.PathSegment.Line,.75*ne,.5*te))).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("LogicIsDefinedAs",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Move,0,.5*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)).add(new go.PathSegment(go.PathSegment.Move,0,te)).add(new go.PathSegment(go.PathSegment.Line,ne,te))).setSpots(.01,.01,.99,.49)}),go.Shape.defineFigureGenerator("LogicIntersect",function(De,ne,te){var de=.5;return new go.Geometry().add(new go.PathFigure(0,te,!1).add(new go.PathSegment(go.PathSegment.Line,0,de*te)).add(new go.PathSegment(go.PathSegment.Arc,180,180,de*ne,de*te,de*ne,de*te)).add(new go.PathSegment(go.PathSegment.Line,ne,te))).setSpots(0,.5,1,1)}),go.Shape.defineFigureGenerator("LogicUnion",function(De,ne,te){var de=.5;return new go.Geometry().add(new go.PathFigure(ne,0,!1).add(new go.PathSegment(go.PathSegment.Line,ne,de*te)).add(new go.PathSegment(go.PathSegment.Arc,0,180,de*ne,de*te,de*ne,de*te)).add(new go.PathSegment(go.PathSegment.Line,0,0))).setSpots(0,0,1,.5)}),go.Shape.setFigureParameter("Arrow",0,new Zn("ArrowheadWidth",.3,.01,.99)),go.Shape.setFigureParameter("Arrow",1,new Zn("TailHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("Arrow",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.3);var se=De?De.parameter2:NaN;isNaN(se)&&(se=.3);var ge=(1-de)*ne,ye=(.5-se/2)*te,we=(.5+se/2)*te,Ce=new go.Geometry,_e=new go.PathFigure(0,ye,!0);Ce.add(_e),_e.add(new go.PathSegment(go.PathSegment.Line,ge,ye)),_e.add(new go.PathSegment(go.PathSegment.Line,ge,0)),_e.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),_e.add(new go.PathSegment(go.PathSegment.Line,ge,te)),_e.add(new go.PathSegment(go.PathSegment.Line,ge,we)),_e.add(new go.PathSegment(go.PathSegment.Line,0,we).close()),Ce.spot1=new go.Spot(0,ye/te);var Ze=it(0,we/te,1,we/te,ge/ne,1,1,.5,le());return Ce.spot2=new go.Spot(Ze.x,Ze.y),Ke(Ze),Ce}),go.Shape.setFigureParameter("Arrow2",0,new Zn("ArrowheadWidth",30)),go.Shape.setFigureParameter("Arrow2",0,new Zn("TailHeight",30)),go.Shape.defineFigureGenerator("Arrow2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=30),de>ne&&(de=ne);var se=De?De.parameter2:NaN;isNaN(se)&&(se=30),se=Math.min(se,te/2);var ge=ne-de,ye=(te-se)/2,we=ye+se,Ce=new go.Geometry,_e=new go.PathFigure(0,ye,!0);Ce.add(_e),_e.add(new go.PathSegment(go.PathSegment.Line,ge,ye)),_e.add(new go.PathSegment(go.PathSegment.Line,ge,0)),_e.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),_e.add(new go.PathSegment(go.PathSegment.Line,ge,te)),_e.add(new go.PathSegment(go.PathSegment.Line,ge,we)),_e.add(new go.PathSegment(go.PathSegment.Line,0,we).close()),Ce.spot1=new go.Spot(0,ye/te);var Ze=it(0,we/te,1,we/te,ge/ne,1,1,.5,le());return Ce.spot2=new go.Spot(Ze.x,Ze.y),Ke(Ze),Ce}),go.Shape.defineFigureGenerator("Chevron",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te).close()),de}),go.Shape.defineFigureGenerator("DoubleArrow",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,.214*te)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,1*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,1*te)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,.786*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,1*te).close()),de}),go.Shape.setFigureParameter("DoubleEndArrow",0,new Zn("ConnecterHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("DoubleEndArrow",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.3);var se=(.5-de/2)*te,ge=(.5+de/2)*te,ye=new go.Geometry,we=new go.PathFigure(ne,.5*te,!0);ye.add(we),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,ge)),we.add(new go.PathSegment(go.PathSegment.Line,.3*ne,ge)),we.add(new go.PathSegment(go.PathSegment.Line,.3*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,0,.5*te)),we.add(new go.PathSegment(go.PathSegment.Line,.3*ne,0)),we.add(new go.PathSegment(go.PathSegment.Line,.3*ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,0).close());var Ce=it(0,.5,.3,0,0,se/te,.1,se/te,le());return ye.spot1=new go.Spot(Ce.x,Ce.y),Ce=it(.7,1,1,.5,0,ge/te,1,ge/te,Ce),ye.spot2=new go.Spot(Ce.x,Ce.y),Ke(Ce),ye}),go.Shape.setFigureParameter("DoubleEndArrow2",0,new Zn("ConnecterHeight",40)),go.Shape.setFigureParameter("DoubleEndArrow2",1,new Zn("ArrowHeight",100)),go.Shape.defineFigureGenerator("DoubleEndArrow2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=40);var se=De?De.parameter2:NaN;isNaN(se)&&(se=100);var ge=(te-de)/2,ye=ge+de,we=(te-se)/2,Ce=we+se;(de>te||se>te)&&(se>de?(de=de*te/se,ge=(te-de)/2,ye=ge+de,we=0,Ce=te):(ge=0,ye=te,we=0,Ce=te));var _e=new go.Geometry,Ze=new go.PathFigure(ne,.5*te,!0);_e.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,Ce)),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,ye)),Ze.add(new go.PathSegment(go.PathSegment.Line,.3*ne,ye)),Ze.add(new go.PathSegment(go.PathSegment.Line,.3*ne,Ce)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,.5*te)),Ze.add(new go.PathSegment(go.PathSegment.Line,.3*ne,we)),Ze.add(new go.PathSegment(go.PathSegment.Line,.3*ne,ge)),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,ge)),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,we).close());var lt=it(0,.5,.3,we/te,0,ge/te,1,ge/te,le());return _e.spot1=new go.Spot(lt.x,lt.y),lt=it(.7,Ce/te,1,.5,0,ye/te,1,ye/te,lt),_e.spot2=new go.Spot(lt.x,lt.y),Ke(lt),_e}),go.Shape.setFigureParameter("IBeamArrow",0,new Zn("ConnectorHeight",.7,.51,.97)),go.Shape.defineFigureGenerator("IBeamArrow",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.3);var se=(.5-de/2)*te,ge=(.5+de/2)*te,ye=new go.Geometry,we=new go.PathFigure(ne,.5*te,!0);ye.add(we),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,ge)),we.add(new go.PathSegment(go.PathSegment.Line,.2*ne,ge)),we.add(new go.PathSegment(go.PathSegment.Line,.2*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,0,te)),we.add(new go.PathSegment(go.PathSegment.Line,0,0)),we.add(new go.PathSegment(go.PathSegment.Line,.2*ne,0)),we.add(new go.PathSegment(go.PathSegment.Line,.2*ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,0).close()),ye.spot1=new go.Spot(0,se/te);var Ce=it(.7,1,1,.5,0,ge/te,1,ge/te,le());return ye.spot2=new go.Spot(Ce.x,Ce.y),Ke(Ce),ye}),go.Shape.setFigureParameter("IBeamArrow2",0,new Zn("ConnectorHeight",40)),go.Shape.setFigureParameter("IBeamArrow2",1,new Zn("BeamArrowHeight",100)),go.Shape.defineFigureGenerator("IBeamArrow2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=40);var se=De?De.parameter2:NaN;isNaN(se)&&(se=100);var ge=(te-de)/2,ye=ge+de,we=(te-se)/2,Ce=we+se;(de>te||se>te)&&(se>de?(de=de*te/se,ge=(te-de)/2,ye=ge+de,we=0,Ce=te):(ge=0,ye=te,we=0,Ce=te));var _e=new go.Geometry,Ze=new go.PathFigure(ne,.5*te,!0);_e.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,Ce)),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,ye)),Ze.add(new go.PathSegment(go.PathSegment.Line,.2*ne,ye)),Ze.add(new go.PathSegment(go.PathSegment.Line,.2*ne,Ce)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,Ce)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,we)),Ze.add(new go.PathSegment(go.PathSegment.Line,.2*ne,we)),Ze.add(new go.PathSegment(go.PathSegment.Line,.2*ne,ge)),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,ge)),Ze.add(new go.PathSegment(go.PathSegment.Line,.7*ne,we).close()),_e.spot1=new go.Spot(0,ge/te);var lt=it(.7,Ce/te,1,.5,0,ye/te,1,ye/te,le());return _e.spot2=new go.Spot(lt.x,lt.y),Ke(lt),_e}),go.Shape.setFigureParameter("Pointer",0,new Zn("BackPoint",.1,0,.2)),go.Shape.defineFigureGenerator("Pointer",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.1);var se=new go.Geometry,ge=new go.PathFigure(ne,.5*te,!0);se.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,0,te)),ge.add(new go.PathSegment(go.PathSegment.Line,de*ne,.5*te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,0).close()),se.spot1=new go.Spot(de,.35);var ye=it(.2,.65,1,.65,0,1,1,.5,le());return se.spot2=new go.Spot(ye.x,ye.y),Ke(ye),se}),go.Shape.setFigureParameter("RoundedPointer",0,new Zn("RoundedEdge",.3,0,.5)),go.Shape.defineFigureGenerator("RoundedPointer",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.3);var se=new go.Geometry,ge=new go.PathFigure(ne,.5*te,!0);se.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,0,te)),ge.add(new go.PathSegment(go.PathSegment.Bezier,0,0,de*ne,.75*te,de*ne,.25*te).close()),se.spot1=new go.Spot(de,.35);var ye=it(0,.65,1,.65,0,1,1,.5,le());return se.spot2=new go.Spot(ye.x,ye.y),Ke(ye),se}),go.Shape.setFigureParameter("SplitEndArrow",0,new Zn("TailHeight",.4,.01,.99)),go.Shape.defineFigureGenerator("SplitEndArrow",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.4);var se=(.5-de/2)*te,ge=(.5+de/2)*te,ye=new go.Geometry,we=new go.PathFigure(ne,.5*te,!0);ye.add(we),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,ge)),we.add(new go.PathSegment(go.PathSegment.Line,0,ge)),we.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.5*te)),we.add(new go.PathSegment(go.PathSegment.Line,0,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,0).close()),ye.spot1=new go.Spot(.2,.3);var Ce=it(.7,1,1,.5,0,ge/te,1,ge/te,le());return ye.spot2=new go.Spot(Ce.x,Ce.y),Ke(Ce),ye}),go.Shape.setFigureParameter("SplitEndArrow2",0,new Zn("TailThickness",50)),go.Shape.defineFigureGenerator("SplitEndArrow2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=50);var se=(te-de)/2,ge=se+de;de>te&&(se=0,ge=te);var ye=new go.Geometry,we=new go.PathFigure(ne,.5*te,!0);ye.add(we),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,ge)),we.add(new go.PathSegment(go.PathSegment.Line,0,ge)),we.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.5*te)),we.add(new go.PathSegment(go.PathSegment.Line,0,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,.7*ne,0).close()),ye.spot1=new go.Spot(.2,se/te);var Ce=it(.7,1,1,.5,0,ge/te,1,ge/te,le());return ye.spot2=new go.Spot(Ce.x,Ce.y),Ke(Ce),ye}),go.Shape.setFigureParameter("SquareArrow",0,new Zn("ArrowPoint",.7,.2,.9)),go.Shape.defineFigureGenerator("SquareArrow",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.7);var se=new go.Geometry,ge=new go.PathFigure(ne,.5*te,!0);return se.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,de*ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,0)),ge.add(new go.PathSegment(go.PathSegment.Line,de*ne,0).close()),se.spot1=go.Spot.TopLeft,se.spot2=new go.Spot(de,1),se}),go.Shape.defineFigureGenerator("Cone1",function(De,ne,te){var de=new go.Geometry,se=st*.5,ge=st*.1,ye=new go.PathFigure(0,.9*te,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,(.9+ge)*te,(.5+se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*te,(.5-se)*ne,te,0,(.9+ge)*te).close()),de.spot1=new go.Spot(.25,.5),de.spot2=new go.Spot(.75,.97),de}),go.Shape.defineFigureGenerator("Cone2",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.9*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,.9*te,(1-.85/.9)*ne,te,.85/.9*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,0,.9*te).close());var ge=new go.PathFigure(0,.9*te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Bezier,ne,.9*te,(1-.85/.9)*ne,.8*te,.85/.9*ne,.8*te)),de.spot1=new go.Spot(.25,.5),de.spot2=new go.Spot(.75,.82),de}),go.Shape.defineFigureGenerator("Cube1",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.15*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,0,.15*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.85*te).close());var ge=new go.PathFigure(.5*ne,te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.3*te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,.15*te)),ge.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.3*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,.15*te)),de.spot1=new go.Spot(0,.3),de.spot2=new go.Spot(.5,.85),de}),go.Shape.defineFigureGenerator("Cube2",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.3*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,0).close());var ge=new go.PathFigure(0,.3*te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.3*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ge.add(new go.PathSegment(go.PathSegment.Move,.7*ne,.3*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.7*ne,te)),de.spot1=new go.Spot(0,.3),de.spot2=new go.Spot(.7,1),de}),go.Shape.defineFigureGenerator("Cylinder1",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=5),de=Math.min(de,te/3);var se=new go.Geometry,ge=st*.5,ye=new go.PathFigure(0,de,!0);se.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,0,st*de,(.5-ge)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,1*ne,de,(.5+ge)*ne,0,1*ne,st*de)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te-de)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,1*te,1*ne,te-st*de,(.5+ge)*ne,1*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,te-de,(.5-ge)*ne,1*te,0,te-st*de)),ye.add(new go.PathSegment(go.PathSegment.Line,0,de));var we=new go.PathFigure(ne,de,!1);return se.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,2*de,1*ne,2*de-st*de,(.5+ge)*ne,2*de)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,de,(.5-ge)*ne,2*de,0,2*de-st*de)),se.spot1=new go.Spot(0,0,0,2*de),se.spot2=new go.Spot(1,1),se}),go.Shape.defineFigureGenerator("Cylinder2",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=5),de=Math.min(de,te/3);var se=new go.Geometry,ge=st*.5,ye=new go.PathFigure(0,te-de,!0);se.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,0,de)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,0,st*de,(.5-ge)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,de,(.5+ge)*ne,0,ne,st*de)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te-de)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,te-st*de,(.5+ge)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,te-de,(.5-ge)*ne,te,0,te-st*de));var we=new go.PathFigure(0,te-de,!1);return se.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te-2*de,0,te-de-st*de,(.5-ge)*ne,te-2*de)),we.add(new go.PathSegment(go.PathSegment.Bezier,ne,te-de,(.5+ge)*ne,te-2*de,ne,te-de-st*de)),se.spot1=new go.Spot(0,0),se.spot2=new go.Spot(1,1,0,-2*de),se}),go.Shape.defineFigureGenerator("Cylinder3",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=5),de=Math.min(de,ne/3);var se=new go.Geometry,ge=st*.5,ye=new go.PathFigure(de,0,!0);se.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne-de,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,ne-st*de,0,ne,(.5-ge)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne-de,te,ne,(.5+ge)*te,ne-st*de,te)),ye.add(new go.PathSegment(go.PathSegment.Line,de,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*te,st*de,te,0,(.5+ge)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,de,0,0,(.5-ge)*te,st*de,0));var we=new go.PathFigure(de,0,!1);return se.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,2*de,.5*te,de+st*de,0,2*de,(.5-ge)*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,de,te,2*de,(.5+ge)*te,de+st*de,te)),se.spot1=new go.Spot(0,0,2*de,0),se.spot2=new go.Spot(1,1),se}),go.Shape.defineFigureGenerator("Cylinder4",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=5),de=Math.min(de,ne/3);var se=new go.Geometry,ge=st*.5,ye=new go.PathFigure(ne-de,0,!0);se.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,ne-st*de,0,ne,(.5-ge)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne-de,te,ne,(.5+ge)*te,ne-st*de,te)),ye.add(new go.PathSegment(go.PathSegment.Line,de,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*te,st*de,te,0,(.5+ge)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,de,0,0,(.5-ge)*te,st*de,0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne-de,0));var we=new go.PathFigure(ne-de,0,!1);return se.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,ne-2*de,.5*te,ne-de-st*de,0,ne-2*de,(.5-ge)*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,ne-de,te,ne-2*de,(.5+ge)*te,ne-de-st*de,te)),se.spot1=new go.Spot(0,0),se.spot2=new go.Spot(1,1,-2*de,0),se}),go.Shape.defineFigureGenerator("Prism1",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.25*ne,.25*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ge=new go.PathFigure(.25*ne,.25*te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),de.spot1=new go.Spot(.408,.172),de.spot2=new go.Spot(.833,.662),de}),go.Shape.defineFigureGenerator("Prism2",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.25*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ge=new go.PathFigure(0,te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.25*ne,.5*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)),ge.add(new go.PathSegment(go.PathSegment.Move,0,.25*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.25*ne,.5*te)),de.spot1=new go.Spot(.25,.5),de.spot2=new go.Spot(.75,.75),de}),go.Shape.defineFigureGenerator("Pyramid1",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.75*te).close());var ge=new go.PathFigure(.5*ne,0,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),de.spot1=new go.Spot(.25,.367),de.spot2=new go.Spot(.75,.875),de}),go.Shape.defineFigureGenerator("Pyramid2",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.85*te).close());var ge=new go.PathFigure(.5*ne,0,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.7*te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,.85*te)),ge.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.7*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,.85*te)),de.spot1=new go.Spot(.25,.367),de.spot2=new go.Spot(.75,.875),de}),go.Shape.defineFigureGenerator("Actor",function(De,ne,te){var de=new go.Geometry,se=.2,ge=.1,ye=st*se,we=st*ge,Ce=.5,_e=.1,Ze=new go.PathFigure(Ce*ne,(_e+ge)*te,!0);de.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-se)*ne,_e*te,(Ce-ye)*ne,(_e+ge)*te,(Ce-se)*ne,(_e+we)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-ge)*te,(Ce-se)*ne,(_e-we)*te,(Ce-ye)*ne,(_e-ge)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+se)*ne,_e*te,(Ce+ye)*ne,(_e-ge)*te,(Ce+se)*ne,(_e-we)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e+ge)*te,(Ce+se)*ne,(_e+we)*te,(Ce+ye)*ne,(_e+ge)*te));var lt=.05,Qe=st*lt;Ce=.05,_e=.25;var Ue=new go.PathFigure(.5*ne,.2*te,!0);return de.add(Ue),Ue.add(new go.PathSegment(go.PathSegment.Line,.95*ne,.2*te)),Ce=.95,_e=.25,Ue.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+lt)*ne,_e*te,(Ce+Qe)*ne,(_e-lt)*te,(Ce+lt)*ne,(_e-Qe)*te)),Ue.add(new go.PathSegment(go.PathSegment.Line,ne,.6*te)),Ue.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.6*te)),Ue.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.35*te)),lt=.025,Qe=st*lt,Ce=.825,_e=.35,Ue.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-lt)*te,(Ce+lt)*ne,(_e-Qe)*te,(Ce+Qe)*ne,(_e-lt)*te)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-lt)*ne,_e*te,(Ce-Qe)*ne,(_e-lt)*te,(Ce-lt)*ne,(_e-Qe)*te)),Ue.add(new go.PathSegment(go.PathSegment.Line,.8*ne,te)),Ue.add(new go.PathSegment(go.PathSegment.Line,.55*ne,te)),Ue.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.7*te)),lt=.05,Qe=st*lt,Ce=.5,_e=.7,Ue.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-lt)*te,(Ce+lt)*ne,(_e-Qe)*te,(Ce+Qe)*ne,(_e-lt)*te)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-lt)*ne,_e*te,(Ce-Qe)*ne,(_e-lt)*te,(Ce-lt)*ne,(_e-Qe)*te)),Ue.add(new go.PathSegment(go.PathSegment.Line,.45*ne,te)),Ue.add(new go.PathSegment(go.PathSegment.Line,.2*ne,te)),Ue.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.35*te)),lt=.025,Qe=st*lt,Ce=.175,_e=.35,Ue.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-lt)*te,(Ce+lt)*ne,(_e-Qe)*te,(Ce+Qe)*ne,(_e-lt)*te)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-lt)*ne,_e*te,(Ce-Qe)*ne,(_e-lt)*te,(Ce-lt)*ne,(_e-Qe)*te)),Ue.add(new go.PathSegment(go.PathSegment.Line,.15*ne,.6*te)),Ue.add(new go.PathSegment(go.PathSegment.Line,0,.6*te)),Ue.add(new go.PathSegment(go.PathSegment.Line,0,.25*te)),lt=.05,Qe=st*lt,Ce=.05,_e=.25,Ue.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-lt)*te,(Ce-lt)*ne,(_e-Qe)*te,(Ce-Qe)*ne,(_e-lt)*te)),Ue.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.2*te)),de.spot1=new go.Spot(.2,.2),de.spot2=new go.Spot(.8,.65),de}),go.Shape.setFigureParameter("Card",0,new Zn("CornerCutoutSize",.2,.1,.9)),go.Shape.defineFigureGenerator("Card",function(De,ne,te){var de=De?De.parameter1:NaN;isNaN(de)&&(de=.2);var se=new go.Geometry,ge=new go.PathFigure(ne,0,!0);return se.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,de*te)),ge.add(new go.PathSegment(go.PathSegment.Line,de*ne,0).close()),se.spot1=new go.Spot(0,de),se.spot2=go.Spot.BottomRight,se}),go.Shape.defineFigureGenerator("Collate",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,.5*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te));var ge=new go.PathFigure(.5*ne,.5*te,!0);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te)),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),de.spot1=new go.Spot(.25,0),de.spot2=new go.Spot(.75,.25),de}),go.Shape.defineFigureGenerator("CreateRequest",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.1);var ge=new go.PathFigure(0,0,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ye=new go.PathFigure(0,se*te,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,se*te)),ye.add(new go.PathSegment(go.PathSegment.Move,0,(1-se)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,(1-se)*te)),de}),go.Shape.defineFigureGenerator("Database",function(De,ne,te){var de=new go.Geometry,se=st*.5,ge=st*.1,ye=new go.PathFigure(ne,.1*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,(.9+ge)*te,(.5+se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*te,(.5-se)*ne,te,0,(.9+ge)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,.1*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,0,(.1-ge)*te,(.5-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,.1*te,(.5+se)*ne,0,ne,(.1-ge)*te));var we=new go.PathFigure(ne,.1*te,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.2*te,ne,(.1+ge)*te,(.5+se)*ne,.2*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*te,(.5-se)*ne,.2*te,0,(.1+ge)*te)),we.add(new go.PathSegment(go.PathSegment.Move,ne,.2*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.3*te,ne,(.2+ge)*te,(.5+se)*ne,.3*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*te,(.5-se)*ne,.3*te,0,(.2+ge)*te)),we.add(new go.PathSegment(go.PathSegment.Move,ne,.3*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.4*te,ne,(.3+ge)*te,(.5+se)*ne,.4*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,.3*te,(.5-se)*ne,.4*te,0,(.3+ge)*te)),de.spot1=new go.Spot(0,.4),de.spot2=new go.Spot(1,.9),de}),go.Shape.defineFigureGenerator("DataStorage",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,.75*ne,te,ne,0,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*ne,.9*te,.25*ne,.1*te).close()),de.spot1=new go.Spot(.226,0),de.spot2=new go.Spot(.81,1),de}),go.Shape.defineFigureGenerator("DiskStorage",function(De,ne,te){var de=new go.Geometry,se=st*.5,ge=st*.1,ye=new go.PathFigure(ne,.1*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,(.9+ge)*te,(.5+se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*te,(.5-se)*ne,te,0,(.9+ge)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,.1*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,0,(.1-ge)*te,(.5-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,.1*te,(.5+se)*ne,0,ne,(.1-ge)*te));var we=new go.PathFigure(ne,.1*te,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.2*te,ne,(.1+ge)*te,(.5+se)*ne,.2*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*te,(.5-se)*ne,.2*te,0,(.1+ge)*te)),we.add(new go.PathSegment(go.PathSegment.Move,ne,.2*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.3*te,ne,(.2+ge)*te,(.5+se)*ne,.3*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*te,(.5-se)*ne,.3*te,0,(.2+ge)*te)),de.spot1=new go.Spot(0,.3),de.spot2=new go.Spot(1,.9),de}),go.Shape.defineFigureGenerator("Display",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.25*ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,.75*ne,te,ne,0,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.25*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.5*te).close()),de.spot1=new go.Spot(.25,0),de.spot2=new go.Spot(.75,1),de}),go.Shape.defineFigureGenerator("DividedEvent",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)?se=.2:se<.15&&(se=.15);var ge=st*.2,ye=new go.PathFigure(0,.2*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,.2*ne,0,0,(.2-ge)*te,(.2-ge)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,.8*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,.2*te,(.8+ge)*ne,0,ne,(.2-ge)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.8*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,te,ne,(.8+ge)*te,(.8+ge)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,.2*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,.8*te,(.2-ge)*ne,te,0,(.8+ge)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,.2*te));var we=new go.PathFigure(0,se*te,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne,se*te)),de}),go.Shape.defineFigureGenerator("DividedProcess",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;(isNaN(se)||se<.1)&&(se=.1);var ge=new go.PathFigure(0,0,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ye=new go.PathFigure(0,se*te,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,se*te)),de}),go.Shape.defineFigureGenerator("Document",function(De,ne,te){var de=new go.Geometry;te=te/.8;var se=new go.PathFigure(0,.7*te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*te,.5*ne,.4*te,.5*ne,te).close()),de.spot1=go.Spot.TopLeft,de.spot2=new go.Spot(1,.6),de}),go.Shape.defineFigureGenerator("ExternalOrganization",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;(isNaN(se)||se<.2)&&(se=.2);var ge=new go.PathFigure(0,0,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ye=new go.PathFigure(se*ne,0,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,0,se*te)),ye.add(new go.PathSegment(go.PathSegment.Move,ne,se*te)),ye.add(new go.PathSegment(go.PathSegment.Line,(1-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Move,0,(1-se)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,se*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Move,(1-se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,(1-se)*te)),de}),go.Shape.defineFigureGenerator("ExternalProcess",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.5*te).close());var ge=new go.PathFigure(.1*ne,.4*te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.6*te)),ge.add(new go.PathSegment(go.PathSegment.Move,.9*ne,.6*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.4*te)),ge.add(new go.PathSegment(go.PathSegment.Move,.6*ne,.1*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.1*te)),ge.add(new go.PathSegment(go.PathSegment.Move,.4*ne,.9*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.9*te)),de.spot1=new go.Spot(.25,.25),de.spot2=new go.Spot(.75,.75),de}),go.Shape.defineFigureGenerator("File",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ge=new go.PathFigure(.75*ne,0,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.25*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)),de.spot1=new go.Spot(0,.25),de.spot2=go.Spot.BottomRight,de}),go.Shape.defineFigureGenerator("Interrupt",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne,.5*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te));var ge=new go.PathFigure(ne,.5*te,!1);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,te));var ye=new go.PathFigure(ne,.5*te,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,0)),de.spot1=new go.Spot(0,.25),de.spot2=new go.Spot(.5,.75),de}),go.Shape.defineFigureGenerator("InternalStorage",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN,ge=De?De.parameter2:NaN;isNaN(se)&&(se=.1),isNaN(ge)&&(ge=.1);var ye=new go.PathFigure(0,0,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var we=new go.PathFigure(se*ne,0,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,se*ne,te)),we.add(new go.PathSegment(go.PathSegment.Move,0,ge*te)),we.add(new go.PathSegment(go.PathSegment.Line,ne,ge*te)),de}),go.Shape.defineFigureGenerator("Junction",function(De,ne,te){var de=new go.Geometry,se=1/Math.SQRT2,ge=(1-1/Math.SQRT2)/2,ye=st*.5,we=.5,Ce=new go.PathFigure(ne,we*te,!0);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,we*ne,te,ne,(we+ye)*te,(we+ye)*ne,te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,0,we*te,(we-ye)*ne,te,0,(we+ye)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,we*ne,0,0,(we-ye)*te,(we-ye)*ne,0)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ne,we*te,(we+ye)*ne,0,ne,(we-ye)*te));var _e=new go.PathFigure((ge+se)*ne,(ge+se)*te,!1);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Line,ge*ne,ge*te)),_e.add(new go.PathSegment(go.PathSegment.Move,ge*ne,(ge+se)*te)),_e.add(new go.PathSegment(go.PathSegment.Line,(ge+se)*ne,ge*te)),de}),go.Shape.defineFigureGenerator("LinedDocument",function(De,ne,te){var de=new go.Geometry;te=te/.8;var se=new go.PathFigure(0,.7*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*te,.5*ne,.4*te,.5*ne,te).close());var ge=new go.PathFigure(.1*ne,0,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.75*te)),de.spot1=new go.Spot(.1,0),de.spot2=new go.Spot(1,.6),de}),go.Shape.defineFigureGenerator("LoopLimit",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,.25*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te).close()),de.spot1=new go.Spot(0,.25),de.spot2=go.Spot.BottomRight,de}),go.Shape.defineFigureGenerator("MagneticTape",function(De,ne,te){var de=new go.Geometry,se=st*.5,ge=.5,ye=new go.PathFigure(.5*ne,te,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,ge*te,(ge-se)*ne,te,0,(ge+se)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ge*ne,0,0,(ge-se)*te,(ge-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,ge*te,(ge+se)*ne,0,ne,(ge-se)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,(ge+.1)*ne,.9*te,ne,(ge+se)*te,(ge+se)*ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),de.spot1=new go.Spot(.15,.15),de.spot2=new go.Spot(.85,.8),de}),go.Shape.defineFigureGenerator("ManualInput",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.25*te).close()),de.spot1=new go.Spot(0,.25),de.spot2=go.Spot.BottomRight,de}),go.Shape.defineFigureGenerator("MessageFromUser",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.7);var ge=new go.PathFigure(0,0,!0);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,se*ne,.5*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de.spot1=go.Spot.TopLeft,de}),go.Shape.defineFigureGenerator("MicroformProcessing",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.25);var ge=new go.PathFigure(0,0,!0);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,se*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,(1-se)*te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de}),go.Shape.defineFigureGenerator("MicroformRecording",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.15*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de.spot1=new go.Spot(0,.25),de.spot2=new go.Spot(1,.75),de}),go.Shape.defineFigureGenerator("MultiDocument",function(De,ne,te){var de=new go.Geometry;te=te/.8;var se=new go.PathFigure(ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.9*ne,.44*te,.96*ne,.47*te,.93*ne,.45*te)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.54*te,.86*ne,.57*te,.83*ne,.55*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*te,.4*ne,.4*te,.4*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,0).close());var ge=new go.PathFigure(.1*ne,.2*te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.2*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.54*te)),ge.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.1*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.1*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.44*te)),de.spot1=new go.Spot(0,.25),de.spot2=new go.Spot(.8,.77),de}),go.Shape.defineFigureGenerator("MultiProcess",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.1*ne,.1*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.9*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.9*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.2*te).close());var ge=new go.PathFigure(.2*ne,.1*te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.1*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.8*te)),ge.add(new go.PathSegment(go.PathSegment.Move,.1*ne,.2*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.2*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.9*te)),de.spot1=new go.Spot(0,.2),de.spot2=new go.Spot(.8,1),de}),go.Shape.defineFigureGenerator("OfflineStorage",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.1);var ge=1-se,ye=new go.PathFigure(0,0,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te).close());var we=new go.PathFigure(.5*se*ne,se*te,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,(1-.5*se)*ne,se*te)),de}),go.Shape.defineFigureGenerator("OffPageConnector",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de.spot1=go.Spot.TopLeft,de.spot2=new go.Spot(.75,1),de}),go.Shape.defineFigureGenerator("Or",function(De,ne,te){var de=new go.Geometry,se=st*.5,ge=.5,ye=new go.PathFigure(ne,ge*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,ge*ne,te,ne,(ge+se)*te,(ge+se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,ge*te,(ge-se)*ne,te,0,(ge+se)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ge*ne,0,0,(ge-se)*te,(ge-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,ge*te,(ge+se)*ne,0,ne,(ge-se)*te));var we=new go.PathFigure(ne,.5*te,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,0,.5*te)),we.add(new go.PathSegment(go.PathSegment.Move,.5*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),de}),go.Shape.defineFigureGenerator("PaperTape",function(De,ne,te){var de=new go.Geometry;te=te/.8;var se=new go.PathFigure(0,.7*te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.3*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,.3*te,.5*ne,.6*te,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*te,.5*ne,.4*te,.5*ne,te).close()),de.spot1=new go.Spot(0,.49),de.spot2=new go.Spot(1,.75),de}),go.Shape.defineFigureGenerator("PrimitiveFromCall",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN,ge=De?De.parameter2:NaN;isNaN(se)&&(se=.1),isNaN(ge)&&(ge=.3);var ye=new go.PathFigure(0,0,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,(1-ge)*ne,.5*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de}),go.Shape.defineFigureGenerator("PrimitiveToCall",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN,ge=De?De.parameter2:NaN;isNaN(se)&&(se=.1),isNaN(ge)&&(ge=.3);var ye=new go.PathFigure(0,0,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,(1-ge)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),ye.add(new go.PathSegment(go.PathSegment.Line,(1-ge)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de}),go.Shape.defineFigureGenerator("Procedure",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.1);var ge=new go.PathFigure(0,0,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ye=new go.PathFigure((1-se)*ne,0,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,(1-se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Move,se*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,se*ne,te)),de}),go.Shape.defineFigureGenerator("Process",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.1);var ge=new go.PathFigure(0,0,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ye=new go.PathFigure(se*ne,0,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,se*ne,te)),de.spot2=go.Spot.BottomRight,de}),go.Shape.defineFigureGenerator("Sort",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.5*te).close());var ge=new go.PathFigure(0,.5*te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),de.spot1=new go.Spot(.25,.25),de.spot2=new go.Spot(.75,.5),de}),go.Shape.defineFigureGenerator("Start",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.25);var ge=new go.PathFigure(se*ne,0,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*ne,.5*te,.25*ne,.5*te)),ge.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*ne,.5*te,.25*ne,.5*te));var ye=new go.PathFigure(se*ne,0,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,se*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Move,(1-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,(1-se)*ne,te)),de.spot1=new go.Spot(se,0),de.spot2=new go.Spot(1-se,1),de}),go.Shape.defineFigureGenerator("Terminator",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.25*ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*ne,.5*te,.25*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*ne,.5*te,.25*ne,.5*te)),de.spot1=new go.Spot(.23,0),de.spot2=new go.Spot(.77,1),de}),go.Shape.defineFigureGenerator("TransmittalTape",function(De,ne,te){var de=new go.Geometry,se=De?De.parameter1:NaN;isNaN(se)&&(se=.1);var ge=new go.PathFigure(0,0,!0);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,.75*ne,(1-se)*te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,(1-se)*te).close()),de.spot1=go.Spot.TopLeft,de}),go.Shape.defineFigureGenerator("AndGate",function(De,ne,te){var de=new go.Geometry,se=st*.5,ge=new go.PathFigure(0,0,!0);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),ge.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,(.5+se)*ne,0,ne,(.5-se)*te)),ge.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,(.5+se)*te,(.5+se)*ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de.spot1=go.Spot.TopLeft,de.spot2=new go.Spot(.55,1),de}),go.Shape.defineFigureGenerator("Buffer",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de.spot1=new go.Spot(0,.25),de.spot2=new go.Spot(.5,.75),de}),go.Shape.defineFigureGenerator("Clock",function(De,ne,te){var de=new go.Geometry,se=st*.5,ge=.5,ye=new go.PathFigure(ne,ge*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,ge*ne,te,ne,(ge+se)*te,(ge+se)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,ge*te,(ge-se)*ne,te,0,(ge+se)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ge*ne,0,0,(ge-se)*te,(ge-se)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,ge*te,(ge+se)*ne,0,ne,(ge-se)*te));var we=new go.PathFigure(ne,ge*te,!1);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne,ge*te));var Ce=new go.PathFigure(.8*ne,.75*te,!1);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.25*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.25*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.75*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.75*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.25*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.25*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.75*te)),de}),go.Shape.defineFigureGenerator("Ground",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Move,.3*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Move,.4*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,te)),de}),go.Shape.defineFigureGenerator("Inverter",function(De,ne,te){var de=new go.Geometry,se=st*.1,ge=.1,ye=.9,we=.5,Ce=new go.PathFigure(.8*ne,.5*te,!0);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,0,te)),Ce.add(new go.PathSegment(go.PathSegment.Line,0,0)),Ce.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.5*te));var _e=new go.PathFigure((ye+ge)*ne,we*te,!0);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te,(ye+se)*ne,(we+ge)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(ye-ge)*ne,we*te,(ye-se)*ne,(we+ge)*te,(ye-ge)*ne,(we+se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-ge)*te,(ye-ge)*ne,(we-se)*te,(ye-se)*ne,(we-ge)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(ye+ge)*ne,we*te,(ye+se)*ne,(we-ge)*te,(ye+ge)*ne,(we-se)*te)),de.spot1=new go.Spot(0,.25),de.spot2=new go.Spot(.4,.75),de}),go.Shape.defineFigureGenerator("NandGate",function(De,ne,te){var de=new go.Geometry,se=st*.5,ge=st*.4,ye=st*.1,we=.1,Ce=.9,_e=.5,Ze=new go.PathFigure(.8*ne,.5*te,!0);de.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Bezier,.4*ne,te,.8*ne,(.5+ge)*te,(.4+se)*ne,te)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,te)),Ze.add(new go.PathSegment(go.PathSegment.Line,0,0)),Ze.add(new go.PathSegment(go.PathSegment.Line,.4*ne,0)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.5*te,(.4+se)*ne,0,.8*ne,(.5-ge)*te));var lt=new go.PathFigure((Ce+we)*ne,_e*te,!0);return de.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e+we)*te,(Ce+we)*ne,(_e+ye)*te,(Ce+ye)*ne,(_e+we)*te)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-we)*ne,_e*te,(Ce-ye)*ne,(_e+we)*te,(Ce-we)*ne,(_e+ye)*te)),lt.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-we)*te,(Ce-we)*ne,(_e-ye)*te,(Ce-ye)*ne,(_e-we)*te)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+we)*ne,_e*te,(Ce+ye)*ne,(_e-we)*te,(Ce+we)*ne,(_e-ye)*te)),de.spot1=new go.Spot(0,.05),de.spot2=new go.Spot(.55,.95),de}),go.Shape.defineFigureGenerator("NorGate",function(De,ne,te){var de=new go.Geometry,se=.5,ge=st*se,ye=0,we=.5,Ce=new go.PathFigure(.8*ne,.5*te,!0);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,0,te,.7*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*ne,.75*te,.25*ne,.25*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.5*te,(ye+ge)*ne,(we-se)*te,.7*ne,(we-ge)*te)),se=.1,ge=st*.1,ye=.9,we=.5;var _e=new go.PathFigure((ye-se)*ne,we*te,!0);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-ge)*te,(ye-ge)*ne,(we-se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+ge)*ne,(we-se)*te,(ye+se)*ne,(we-ge)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(ye-se)*ne,we*te,(ye-ge)*ne,(we+se)*te,(ye-se)*ne,(we+ge)*te)),de.spot1=new go.Spot(.2,.25),de.spot2=new go.Spot(.6,.75),de}),go.Shape.defineFigureGenerator("OrGate",function(De,ne,te){var de=new go.Geometry,se=.5,ge=st*se,ye=0,we=.5,Ce=new go.PathFigure(0,0,!0);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,(ye+ge+ge)*ne,(we-se)*te,.8*ne,(we-ge)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,0,te,.8*ne,(we+ge)*te,(ye+ge+ge)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*ne,.75*te,.25*ne,.25*te).close()),de.spot1=new go.Spot(.2,.25),de.spot2=new go.Spot(.75,.75),de}),go.Shape.defineFigureGenerator("XnorGate",function(De,ne,te){var de=new go.Geometry,se=.5,ge=st*se,ye=.2,we=.5,Ce=new go.PathFigure(.1*ne,0,!1);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,.1*ne,te,.35*ne,.25*te,.35*ne,.75*te));var _e=new go.PathFigure(.8*ne,.5*te,!0);de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,.2*ne,te,.7*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,.2*ne,0,.45*ne,.75*te,.45*ne,.25*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.5*te,(ye+ge)*ne,(we-se)*te,.7*ne,(we-ge)*te)),se=.1,ge=st*.1,ye=.9,we=.5;var Ze=new go.PathFigure((ye-se)*ne,we*te,!0);return de.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-ge)*te,(ye-ge)*ne,(we-se)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+ge)*ne,(we-se)*te,(ye+se)*ne,(we-ge)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,(ye-se)*ne,we*te,(ye-ge)*ne,(we+se)*te,(ye-se)*ne,(we+ge)*te)),de.spot1=new go.Spot(.4,.25),de.spot2=new go.Spot(.65,.75),de}),go.Shape.defineFigureGenerator("XorGate",function(De,ne,te){var de=new go.Geometry,se=.5,ge=st*se,ye=.2,we=.5,Ce=new go.PathFigure(.1*ne,0,!1);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,.1*ne,te,.35*ne,.25*te,.35*ne,.75*te));var _e=new go.PathFigure(.2*ne,0,!0);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,(ye+ge)*ne,(we-se)*te,.9*ne,(we-ge)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,.2*ne,te,.9*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,.2*ne,0,.45*ne,.75*te,.45*ne,.25*te).close()),de.spot1=new go.Spot(.4,.25),de.spot2=new go.Spot(.8,.75),de}),go.Shape.defineFigureGenerator("Capacitor",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Move,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),de}),go.Shape.defineFigureGenerator("Resistor",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.5*te,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.5*te)),de}),go.Shape.defineFigureGenerator("Inductor",function(De,ne,te){var de=new go.Geometry,se=st*.1,ge=.1,ye=.1,we=.5,Ce=new go.PathFigure((ye-se*.5)*ne,te,!1);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+ge)*ne,0,(ye-se)*ne,te,(ye-ge)*ne,0)),ye=.3,Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,te,(ye+ge)*ne,0,(ye+se)*ne,te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+ge)*ne,0,(ye-se)*ne,te,(ye-ge)*ne,0)),ye=.5,Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,te,(ye+ge)*ne,0,(ye+se)*ne,te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+ge)*ne,0,(ye-se)*ne,te,(ye-ge)*ne,0)),ye=.7,Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,te,(ye+ge)*ne,0,(ye+se)*ne,te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+ge)*ne,0,(ye-se)*ne,te,(ye-ge)*ne,0)),ye=.9,Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se*.5)*ne,te,(ye+ge)*ne,0,(ye+se)*ne,te)),de}),go.Shape.defineFigureGenerator("ACvoltageSource",function(De,ne,te){var de=new go.Geometry,se=st*.5,ge=.5,ye=.5,we=.5,Ce=new go.PathFigure((ye-ge)*ne,we*te,!1);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-ge)*te,(ye-ge)*ne,(we-se)*te,(ye-se)*ne,(we-ge)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+ge)*ne,we*te,(ye+se)*ne,(we-ge)*te,(ye+ge)*ne,(we-se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te,(ye+se)*ne,(we+ge)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye-ge)*ne,we*te,(ye-se)*ne,(we+ge)*te,(ye-ge)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Move,(ye-ge+.1)*ne,we*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+ge-.1)*ne,we*te,ye*ne,(we-ge)*te,ye*ne,(we+ge)*te)),de}),go.Shape.defineFigureGenerator("DCvoltageSource",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.75*te,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.25*te)),se.add(new go.PathSegment(go.PathSegment.Move,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),de}),go.Shape.defineFigureGenerator("Diode",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),de.spot1=new go.Spot(0,.25),de.spot2=new go.Spot(.5,.75),de}),go.Shape.defineFigureGenerator("Wifi",function(De,ne,te){var de=new go.Geometry,se=ne,ge=te;ne=ne*.38,te=te*.6;var ye=st*.8,we=.8,Ce=0,_e=.5,Ze=(se-ne)/2,lt=(ge-te)/2,Qe=new go.PathFigure(Ce*ne+Ze,(_e+we)*te+lt,!0);de.add(Qe),Qe.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-we)*ne+Ze,_e*te+lt,(Ce-ye)*ne+Ze,(_e+we)*te+lt,(Ce-we)*ne+Ze,(_e+ye)*te+lt)),Qe.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e-we)*te+lt,(Ce-we)*ne+Ze,(_e-ye)*te+lt,(Ce-ye)*ne+Ze,(_e-we)*te+lt)),Qe.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-we+ye*.5)*ne+Ze,_e*te+lt,Ce*ne+Ze,(_e-we)*te+lt,(Ce-we+ye*.5)*ne+Ze,(_e-ye)*te+lt)),Qe.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e+we)*te+lt,(Ce-we+ye*.5)*ne+Ze,(_e+ye)*te+lt,Ce*ne+Ze,(_e+we)*te+lt).close()),ye=st*.4,we=.4,Ce=.2,_e=.5;var Ue=new go.PathFigure(Ce*ne+Ze,(_e+we)*te+lt,!0);de.add(Ue),Ue.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-we)*ne+Ze,_e*te+lt,(Ce-ye)*ne+Ze,(_e+we)*te+lt,(Ce-we)*ne+Ze,(_e+ye)*te+lt)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e-we)*te+lt,(Ce-we)*ne+Ze,(_e-ye)*te+lt,(Ce-ye)*ne+Ze,(_e-we)*te+lt)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-we+ye*.5)*ne+Ze,_e*te+lt,Ce*ne+Ze,(_e-we)*te+lt,(Ce-we+ye*.5)*ne+Ze,(_e-ye)*te+lt)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e+we)*te+lt,(Ce-we+ye*.5)*ne+Ze,(_e+ye)*te+lt,Ce*ne+Ze,(_e+we)*te+lt).close()),ye=st*.2,we=.2,Ce=.5,_e=.5;var dt=new go.PathFigure((Ce-we)*ne+Ze,_e*te+lt,!0);de.add(dt),dt.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e-we)*te+lt,(Ce-we)*ne+Ze,(_e-ye)*te+lt,(Ce-ye)*ne+Ze,(_e-we)*te+lt)),dt.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+we)*ne+Ze,_e*te+lt,(Ce+ye)*ne+Ze,(_e-we)*te+lt,(Ce+we)*ne+Ze,(_e-ye)*te+lt)),dt.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e+we)*te+lt,(Ce+we)*ne+Ze,(_e+ye)*te+lt,(Ce+ye)*ne+Ze,(_e+we)*te+lt)),dt.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-we)*ne+Ze,_e*te+lt,(Ce-ye)*ne+Ze,(_e+we)*te+lt,(Ce-we)*ne+Ze,(_e+ye)*te+lt)),ye=st*.4,we=.4,Ce=.8,_e=.5;var $e=new go.PathFigure(Ce*ne+Ze,(_e-we)*te+lt,!0);de.add($e),$e.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+we)*ne+Ze,_e*te+lt,(Ce+ye)*ne+Ze,(_e-we)*te+lt,(Ce+we)*ne+Ze,(_e-ye)*te+lt)),$e.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e+we)*te+lt,(Ce+we)*ne+Ze,(_e+ye)*te+lt,(Ce+ye)*ne+Ze,(_e+we)*te+lt)),$e.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+we-ye*.5)*ne+Ze,_e*te+lt,Ce*ne+Ze,(_e+we)*te+lt,(Ce+we-ye*.5)*ne+Ze,(_e+ye)*te+lt)),$e.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e-we)*te+lt,(Ce+we-ye*.5)*ne+Ze,(_e-ye)*te+lt,Ce*ne+Ze,(_e-we)*te+lt).close()),ye=st*.8,we=.8,Ce=1,_e=.5;var wt=new go.PathFigure(Ce*ne+Ze,(_e-we)*te+lt,!0);return de.add(wt),wt.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+we)*ne+Ze,_e*te+lt,(Ce+ye)*ne+Ze,(_e-we)*te+lt,(Ce+we)*ne+Ze,(_e-ye)*te+lt)),wt.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e+we)*te+lt,(Ce+we)*ne+Ze,(_e+ye)*te+lt,(Ce+ye)*ne+Ze,(_e+we)*te+lt)),wt.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+we-ye*.5)*ne+Ze,_e*te+lt,Ce*ne+Ze,(_e+we)*te+lt,(Ce+we-ye*.5)*ne+Ze,(_e+ye)*te+lt)),wt.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne+Ze,(_e-we)*te+lt,(Ce+we-ye*.5)*ne+Ze,(_e-ye)*te+lt,Ce*ne+Ze,(_e-we)*te+lt).close()),de}),go.Shape.defineFigureGenerator("Email",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var ge=new go.PathFigure(0,0,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.6*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,0)),ge.add(new go.PathSegment(go.PathSegment.Move,0,te)),ge.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.54*te)),ge.add(new go.PathSegment(go.PathSegment.Move,ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.54*te)),de}),go.Shape.defineFigureGenerator("Ethernet",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.35*ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.65*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.35*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.35*ne,0).close());var ge=new go.PathFigure(.1*ne,te,!0,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.4*ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.6*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.6*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.1*ne,te).close());var ye=new go.PathFigure(.6*ne,te,!0,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.9*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.6*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.6*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.6*ne,te).close());var we=new go.PathFigure(0,.5*te,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),we.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.5*te)),we.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.4*te)),we.add(new go.PathSegment(go.PathSegment.Move,.75*ne,.5*te)),we.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.6*te)),we.add(new go.PathSegment(go.PathSegment.Move,.25*ne,.5*te)),we.add(new go.PathSegment(go.PathSegment.Line,.25*ne,.6*te)),de}),go.Shape.defineFigureGenerator("Power",function(De,ne,te){var de=new go.Geometry,se=st*.4,ge=.4,ye=.5,we=.5,Ce=le(),_e=le(),Ze=le(),lt=le();bt(ye,we-ge,ye+se,we-ge,ye+ge,we-se,ye+ge,we,.5,Ce,Ce,_e,Ze,lt);var Qe=Le(_e.x,_e.y),Ue=new go.PathFigure(_e.x*ne,_e.y*te,!0);de.add(Ue),Ue.add(new go.PathSegment(go.PathSegment.Bezier,(ye+ge)*ne,we*te,Ze.x*ne,Ze.y*te,lt.x*ne,lt.y*te)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te,(ye+se)*ne,(we+ge)*te)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,(ye-ge)*ne,we*te,(ye-se)*ne,(we+ge)*te,(ye-ge)*ne,(we+se)*te)),bt(ye-ge,we,ye-ge,we-se,ye-se,we-ge,ye,we-ge,.5,Ze,lt,_e,Ce,Ce),Ue.add(new go.PathSegment(go.PathSegment.Bezier,_e.x*ne,_e.y*te,Ze.x*ne,Ze.y*te,lt.x*ne,lt.y*te)),se=st*.3,ge=.3,bt(ye-ge,we,ye-ge,we-se,ye-se,we-ge,ye,we-ge,.5,Ze,lt,_e,Ce,Ce),Ue.add(new go.PathSegment(go.PathSegment.Line,_e.x*ne,_e.y*te)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,(ye-ge)*ne,we*te,lt.x*ne,lt.y*te,Ze.x*ne,Ze.y*te)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+ge)*te,(ye-ge)*ne,(we+se)*te,(ye-se)*ne,(we+ge)*te)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,(ye+ge)*ne,we*te,(ye+se)*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te)),bt(ye,we-ge,ye+se,we-ge,ye+ge,we-se,ye+ge,we,.5,Ce,Ce,_e,Ze,lt),Ue.add(new go.PathSegment(go.PathSegment.Bezier,_e.x*ne,_e.y*te,lt.x*ne,lt.y*te,Ze.x*ne,Ze.y*te).close());var Ue=new go.PathFigure(.45*ne,0,!0);return de.add(Ue),Ue.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.5*te)),Ue.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.5*te)),Ue.add(new go.PathSegment(go.PathSegment.Line,.55*ne,0).close()),Ke(Ce),Ke(_e),Ke(Ze),Ke(lt),Ke(Qe),de.spot1=new go.Spot(.25,.45),de.spot2=new go.Spot(.75,.8),de}),go.Shape.defineFigureGenerator("Fallout",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te/2,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Arc,180,360,ne/2,te/2,ne/2,te/2));function ge(ye,we,Ce){ye.add(new go.PathSegment(go.PathSegment.Move,(.3+we)*ne,(.8+Ce)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,(.5+we)*ne,(.5+Ce)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,(.1+we)*ne,(.5+Ce)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,(.3+we)*ne,(.8+Ce)*te).close())}return ge(se,0,0),ge(se,.4,0),ge(se,.2,-.3),de}),go.Shape.defineFigureGenerator("IrritationHazard",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.2*ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.3*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.2*te).close()),de.spot1=new go.Spot(.3,.3),de.spot2=new go.Spot(.7,.7),de}),go.Shape.defineFigureGenerator("ElectricalHazard",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.37*ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.11*te)),se.add(new go.PathSegment(go.PathSegment.Line,.77*ne,.04*te)),se.add(new go.PathSegment(go.PathSegment.Line,.33*ne,.49*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.37*te)),se.add(new go.PathSegment(go.PathSegment.Line,.63*ne,.86*te)),se.add(new go.PathSegment(go.PathSegment.Line,.77*ne,.91*te)),se.add(new go.PathSegment(go.PathSegment.Line,.34*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.34*ne,.78*te)),se.add(new go.PathSegment(go.PathSegment.Line,.44*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.56*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.68*te).close()),de}),go.Shape.defineFigureGenerator("FireHazard",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.1*ne,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,.29*ne,0,-.25*ne,.63*te,.45*ne,.44*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.51*ne,.42*te,.48*ne,.17*te,.54*ne,.35*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.59*ne,.18*te,.59*ne,.29*te,.58*ne,.28*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.75*ne,.6*te,.8*ne,.34*te,.88*ne,.43*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.88*ne,.31*te,.87*ne,.48*te,.88*ne,.43*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.9*ne,te,1.17*ne,.76*te,.82*ne,.8*te).close()),de.spot1=new go.Spot(.07,.445),de.spot2=new go.Spot(.884,.958),de}),go.Shape.defineFigureGenerator("BpmnActivityLoop",function(De,ne,te){var de=new go.Geometry,se=.5,ge=0,ye=0,we=se*st,Ce=.4*Math.SQRT2/2+.5,_e=.5-.5*Math.SQRT2/2,Ze=1,lt=.5,Qe=.5,Ue=0,dt=new go.PathFigure(Ce*ne,(1-_e)*te,!1);return de.add(dt),dt.add(new go.PathSegment(go.PathSegment.Bezier,Ze*ne,lt*te,Ze*ne,.7*te,Ze*ne,lt*te)),dt.add(new go.PathSegment(go.PathSegment.Bezier,(Qe+ge)*ne,(Ue+ge)*te,(.5+se+ge)*ne,(.5-we+ge)*te,(.5+we+ge)*ne,(.5-se+ge)*te)),dt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-se+ge)*ne,(.5+ye)*te,(.5-we+ge)*ne,(.5-se+ye)*te,(.5-se+ge)*ne,(.5-we+ye)*te)),dt.add(new go.PathSegment(go.PathSegment.Bezier,(.35+ge)*ne,.9*te,(.5-se+ge)*ne,(.5+we+ye)*te,(.5-we+ge)*ne,.9*te)),dt.add(new go.PathSegment(go.PathSegment.Move,(.25+ge)*ne,.8*te)),dt.add(new go.PathSegment(go.PathSegment.Line,(.35+ge)*ne,.9*te)),dt.add(new go.PathSegment(go.PathSegment.Line,(.2+ge)*ne,.95*te)),de}),go.Shape.defineFigureGenerator("BpmnActivityParallel",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Move,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),de}),go.Shape.defineFigureGenerator("BpmnActivitySequential",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Move,0,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Move,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),de}),go.Shape.defineFigureGenerator("BpmnActivityAdHoc",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);de.add(se);var ge=new go.PathFigure(ne,te,!1);de.add(ge);var ye=new go.PathFigure(0,.5*te,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.5*te,.2*ne,.35*te,.3*ne,.35*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,.7*ne,.65*te,.8*ne,.65*te)),de}),go.Shape.defineFigureGenerator("BpmnActivityCompensation",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.5*te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te).close()),de}),go.Shape.defineFigureGenerator("BpmnTaskMessage",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.2*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.8*te).close());var se=new go.PathFigure(0,.2*te,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.2*te)),de}),go.Shape.defineFigureGenerator("BpmnTaskScript",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.7*ne,te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.3*ne,0,.6*ne,.5*te,0,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.7*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,.7*ne,te,.4*ne,.5*te,ne,.5*te).close());var ge=new go.PathFigure(.45*ne,.73*te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.73*te)),ge.add(new go.PathSegment(go.PathSegment.Move,.38*ne,.5*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.63*ne,.5*te)),ge.add(new go.PathSegment(go.PathSegment.Move,.31*ne,.27*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.56*ne,.27*te)),de}),go.Shape.defineFigureGenerator("BpmnTaskUser",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);de.add(se);var ge=new go.PathFigure(.335*ne,(1-.555)*te,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.335*ne,(1-.405)*te)),ge.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*ne,(1-.405)*te)),ge.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*ne,(1-.555)*te)),ge.add(new go.PathSegment(go.PathSegment.Bezier,ne,.68*te,(1-.12)*ne,.46*te,(1-.02)*ne,.54*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,.68*te)),ge.add(new go.PathSegment(go.PathSegment.Bezier,.335*ne,(1-.555)*te,.02*ne,.54*te,.12*ne,.46*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.365*ne,(1-.595)*te));var ye=.5-.285,we=.5,Ce=ye,_e=Math.PI/4,Ze=4*(1-Math.cos(_e))/(3*Math.sin(_e)),lt=Ze*.5,Qe=ye,Ue=ye,dt=Ze*Qe,$e=Ze*Ue;ge.add(new go.PathSegment(go.PathSegment.Bezier,(we-Qe)*ne,Ce*te,(we-(dt+Qe)/2)*ne,(Ce+(Ue+$e)/2)*te,(we-Qe)*ne,(Ce+$e)*te)),ge.add(new go.PathSegment(go.PathSegment.Bezier,we*ne,(Ce-Ue)*te,(we-Qe)*ne,(Ce-$e)*te,(we-dt)*ne,(Ce-Ue)*te)),ge.add(new go.PathSegment(go.PathSegment.Bezier,(we+Qe)*ne,Ce*te,(we+dt)*ne,(Ce-Ue)*te,(we+Qe)*ne,(Ce-$e)*te)),ge.add(new go.PathSegment(go.PathSegment.Bezier,(1-.365)*ne,(1-.595)*te,(we+Qe)*ne,(Ce+$e)*te,(we+(dt+Qe)/2)*ne,(Ce+(Ue+$e)/2)*te)),ge.add(new go.PathSegment(go.PathSegment.Line,(1-.365)*ne,(1-.595)*te)),ge.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*ne,(1-.555)*te)),ge.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*ne,(1-.405)*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.335*ne,(1-.405)*te));var wt=new go.PathFigure(.2*ne,te,!1);de.add(wt),wt.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.8*te));var St=new go.PathFigure(.8*ne,te,!1);return de.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.8*te)),de}),go.Shape.defineFigureGenerator("BpmnEventConditional",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.1*ne,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,te).close());var ge=new go.PathFigure(.2*ne,.2*te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.2*te)),ge.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.4*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.4*te)),ge.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.6*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.6*te)),ge.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.8*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.8*te)),de}),go.Shape.defineFigureGenerator("BpmnEventError",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.33*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.66*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.66*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.33*ne,.5*te).close()),de}),go.Shape.defineFigureGenerator("BpmnEventEscalation",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);de.add(se);var ge=new go.PathFigure(ne,te,!1);de.add(ge);var ye=new go.PathFigure(.1*ne,te,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Line,.9*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te).close()),de}),go.Shape.defineFigureGenerator("Caution",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.05*ne,te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,.1*ne,.8*te,0,te,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.55*ne,.1*te,.5*ne,0,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.95*ne,.9*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.9*ne,te,ne,te,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.05*ne,te));var ge=.05;return se.add(new go.PathSegment(go.PathSegment.Move,(.5-ge)*ne,.875*te)),se.add(new go.PathSegment(go.PathSegment.Arc,180,-360,.5*ne,.875*te,ge*ne,ge*te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.325*te,.575*ne,.725*te,.625*ne,.375*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.75*te,.375*ne,.375*te,.425*ne,.725*te)),de}),go.Shape.defineFigureGenerator("Recycle",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.45*ne,.95*te,!1);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.95*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.185*ne,.85*te,.17*ne,.95*te,.15*ne,.9*te)),se.add(new go.PathSegment(go.PathSegment.Line,.235*ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Line,.3*ne,.625*te)),se.add(new go.PathSegment(go.PathSegment.Line,.35*ne,.65*te)),se.add(new go.PathSegment(go.PathSegment.Line,.275*ne,.45*te)),se.add(new go.PathSegment(go.PathSegment.Line,.05*ne,.45*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.05*ne,.575*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.1875*ne,.95*te,0,.675*te,0,.7*te)),se.add(new go.PathSegment(go.PathSegment.Move,.45*ne,.95*te)),se.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.775*te)),se.add(new go.PathSegment(go.PathSegment.Line,.22*ne,.775*te));var ge=new go.PathFigure(.475*ne,.2*te,!1);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.4*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.225*ne,.3*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.275*ne,.175*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.325*ne,.05*te)),ge.add(new go.PathSegment(go.PathSegment.Bezier,.4*ne,.05*te,.35*ne,0,.375*ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,.575*ne,.375*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.525*ne,.4*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.475*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.315*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.32*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.05*te)),ge.add(new go.PathSegment(go.PathSegment.Bezier,.575*ne,0,.65*ne,.05*te,.625*ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,.38*ne,.0105*te));var ye=new go.PathFigure(.675*ne,.575*te,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.875*ne,.525*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.775*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,.85*ne,.95*te,ne,.8*te,ne,.85*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.95*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.65*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.85*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.725*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.775*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.775*te)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.775*te)),ye.add(new go.PathSegment(go.PathSegment.Move,.675*ne,.575*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.775*ne,.775*te)),de}),go.Shape.defineFigureGenerator("BpmnEventTimer",function(De,ne,te){var de=new go.Geometry,se=.5,ge=st*.5,ye=new go.PathFigure(ne,se*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Bezier,se*ne,te,ne,(se+ge)*te,(se+ge)*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,se*te,(se-ge)*ne,te,0,(se+ge)*te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,se*ne,0,0,(se-ge)*te,(se-ge)*ne,0)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne,se*te,(se+ge)*ne,0,ne,(se-ge)*te));var we=new go.PathFigure(se*ne,0,!1);return de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,se*ne,.15*te)),we.add(new go.PathSegment(go.PathSegment.Move,se*ne,te)),we.add(new go.PathSegment(go.PathSegment.Line,se*ne,.85*te)),we.add(new go.PathSegment(go.PathSegment.Move,0,se*te)),we.add(new go.PathSegment(go.PathSegment.Line,.15*ne,se*te)),we.add(new go.PathSegment(go.PathSegment.Move,ne,se*te)),we.add(new go.PathSegment(go.PathSegment.Line,.85*ne,se*te)),we.add(new go.PathSegment(go.PathSegment.Move,se*ne,se*te)),we.add(new go.PathSegment(go.PathSegment.Line,.58*ne,.1*te)),we.add(new go.PathSegment(go.PathSegment.Move,se*ne,se*te)),we.add(new go.PathSegment(go.PathSegment.Line,.78*ne,.54*te)),de}),go.Shape.defineFigureGenerator("Package",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.15*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,.15*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close());var ge=new go.PathFigure(0,.15*te,!0);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,0,0)),ge.add(new go.PathSegment(go.PathSegment.Line,.6*ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.15*te).close()),de.spot1=new go.Spot(0,.1),de.spot2=new go.Spot(1,1),de}),go.Shape.defineFigureGenerator("Class",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var ge=new go.PathFigure(0,.2*te,!1);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,.2*te).close());var ye=new go.PathFigure(0,.5*te,!1);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te).close()),de}),go.Shape.defineFigureGenerator("Component",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne,te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.15*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.15*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te).close());var ge=new go.PathFigure(0,.2*te,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.2*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.4*te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,.4*te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,.2*te).close());var ye=new go.PathFigure(0,.6*te,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.6*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.8*te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,.8*te)),ye.add(new go.PathSegment(go.PathSegment.Line,0,.6*te).close()),de}),go.Shape.defineFigureGenerator("Boat Shipment",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.15*ne,.6*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.15*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,.15*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.85*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.15*ne,.6*te));var ge=new go.PathFigure(.15*ne,.6*te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.6*te)),de}),go.Shape.defineFigureGenerator("Customer/Supplier",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.66*ne,.33*te)),se.add(new go.PathSegment(go.PathSegment.Line,.66*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.33*ne,.33*te)),se.add(new go.PathSegment(go.PathSegment.Line,.33*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,0,.33*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te).close()),de}),go.Shape.defineFigureGenerator("Workcell",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.65*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.65*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.35*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.35*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),de}),go.Shape.defineFigureGenerator("Supermarket",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.33*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.33*te)),se.add(new go.PathSegment(go.PathSegment.Move,ne,.33*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.66*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.66*te)),se.add(new go.PathSegment(go.PathSegment.Move,ne,.66*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),de}),go.Shape.defineFigureGenerator("TruckShipment",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var ge=new go.PathFigure(ne,.8*te,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,.4*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.4*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.8*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,.8*te).close());var ye=.1,we=st*.1,Ce=.2,_e=.9,Ze=new go.PathFigure((Ce-ye)*ne,_e*te,!0);de.add(Ze),Ze.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-ye)*te,(Ce-ye)*ne,(_e-we)*te,(Ce-we)*ne,(_e-ye)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+ye)*ne,_e*te,(Ce+we)*ne,(_e-ye)*te,(Ce+ye)*ne,(_e-we)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e+ye)*te,(Ce+ye)*ne,(_e+we)*te,(Ce+we)*ne,(_e+ye)*te)),Ze.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-ye)*ne,_e*te,(Ce-we)*ne,(_e+ye)*te,(Ce-ye)*ne,(_e+we)*te).close()),ye=.1,we=st*.1,Ce=.8,_e=.9;var lt=new go.PathFigure((Ce-ye)*ne,_e*te,!0);return de.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e-ye)*te,(Ce-ye)*ne,(_e-we)*te,(Ce-we)*ne,(_e-ye)*te)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(Ce+ye)*ne,_e*te,(Ce+we)*ne,(_e-ye)*te,(Ce+ye)*ne,(_e-we)*te)),lt.add(new go.PathSegment(go.PathSegment.Bezier,Ce*ne,(_e+ye)*te,(Ce+ye)*ne,(_e+we)*te,(Ce+we)*ne,(_e+ye)*te)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(Ce-ye)*ne,_e*te,(Ce-we)*ne,(_e+ye)*te,(Ce-ye)*ne,(_e+we)*te).close()),de}),go.Shape.defineFigureGenerator("KanbanPost",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.2*ne,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,0)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,te)),de}),go.Shape.defineFigureGenerator("Forklift",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,0,0));var ge=new go.PathFigure(0,.5*te,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,0,.8*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.8*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),ge.add(new go.PathSegment(go.PathSegment.Line,0,.5*te));var ye=new go.PathFigure(.5*ne,.8*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.1*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.1*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.8*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.8*te));var we=new go.PathFigure(.5*ne,.7*te,!1);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne,.7*te));var Ce=.1,_e=st*.1,Ze=.1,lt=.9,Qe=new go.PathFigure((Ze-Ce)*ne,lt*te,!0);de.add(Qe),Qe.add(new go.PathSegment(go.PathSegment.Bezier,Ze*ne,(lt-Ce)*te,(Ze-Ce)*ne,(lt-_e)*te,(Ze-_e)*ne,(lt-Ce)*te)),Qe.add(new go.PathSegment(go.PathSegment.Bezier,(Ze+Ce)*ne,lt*te,(Ze+_e)*ne,(lt-Ce)*te,(Ze+Ce)*ne,(lt-_e)*te)),Qe.add(new go.PathSegment(go.PathSegment.Bezier,Ze*ne,(lt+Ce)*te,(Ze+Ce)*ne,(lt+_e)*te,(Ze+_e)*ne,(lt+Ce)*te)),Qe.add(new go.PathSegment(go.PathSegment.Bezier,(Ze-Ce)*ne,lt*te,(Ze-_e)*ne,(lt+Ce)*te,(Ze-Ce)*ne,(lt+_e)*te)),Ce=.1,_e=st*.1,Ze=.4,lt=.9;var Ue=new go.PathFigure((Ze-Ce)*ne,lt*te,!0);return de.add(Ue),Ue.add(new go.PathSegment(go.PathSegment.Bezier,Ze*ne,(lt-Ce)*te,(Ze-Ce)*ne,(lt-_e)*te,(Ze-_e)*ne,(lt-Ce)*te)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,(Ze+Ce)*ne,lt*te,(Ze+_e)*ne,(lt-Ce)*te,(Ze+Ce)*ne,(lt-_e)*te)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,Ze*ne,(lt+Ce)*te,(Ze+Ce)*ne,(lt+_e)*te,(Ze+_e)*ne,(lt+Ce)*te)),Ue.add(new go.PathSegment(go.PathSegment.Bezier,(Ze-Ce)*ne,lt*te,(Ze-_e)*ne,(lt+Ce)*te,(Ze-Ce)*ne,(lt+_e)*te)),de}),go.Shape.defineFigureGenerator("RailShipment",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.1*ne,.4*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.45*ne,.9*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.9*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.4*te).close());var ge=new go.PathFigure(.45*ne,.7*te,!1);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.7*te));var ye=new go.PathFigure(.55*ne,.4*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.4*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.9*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.55*ne,.4*te).close());var Ze=.05,lt=st*.05,Qe=.175,Ue=.95,we=new go.PathFigure((Qe-Ze)*ne,Ue*te,!0);de.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,Qe*ne,(Ue-Ze)*te,(Qe-Ze)*ne,(Ue-lt)*te,(Qe-lt)*ne,(Ue-Ze)*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,(Qe+Ze)*ne,Ue*te,(Qe+lt)*ne,(Ue-Ze)*te,(Qe+Ze)*ne,(Ue-lt)*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,Qe*ne,(Ue+Ze)*te,(Qe+Ze)*ne,(Ue+lt)*te,(Qe+lt)*ne,(Ue+Ze)*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,(Qe-Ze)*ne,Ue*te,(Qe-lt)*ne,(Ue+Ze)*te,(Qe-Ze)*ne,(Ue+lt)*te));var Ze=.05,lt=st*.05,Qe=.375,Ue=.95,Ce=new go.PathFigure((Qe-Ze)*ne,Ue*te,!0);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,Qe*ne,(Ue-Ze)*te,(Qe-Ze)*ne,(Ue-lt)*te,(Qe-lt)*ne,(Ue-Ze)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(Qe+Ze)*ne,Ue*te,(Qe+lt)*ne,(Ue-Ze)*te,(Qe+Ze)*ne,(Ue-lt)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,Qe*ne,(Ue+Ze)*te,(Qe+Ze)*ne,(Ue+lt)*te,(Qe+lt)*ne,(Ue+Ze)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(Qe-Ze)*ne,Ue*te,(Qe-lt)*ne,(Ue+Ze)*te,(Qe-Ze)*ne,(Ue+lt)*te));var Ze=.05,lt=st*.05,Qe=.625,Ue=.95,_e=new go.PathFigure((Qe-Ze)*ne,Ue*te,!0);de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,Qe*ne,(Ue-Ze)*te,(Qe-Ze)*ne,(Ue-lt)*te,(Qe-lt)*ne,(Ue-Ze)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(Qe+Ze)*ne,Ue*te,(Qe+lt)*ne,(Ue-Ze)*te,(Qe+Ze)*ne,(Ue-lt)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,Qe*ne,(Ue+Ze)*te,(Qe+Ze)*ne,(Ue+lt)*te,(Qe+lt)*ne,(Ue+Ze)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(Qe-Ze)*ne,Ue*te,(Qe-lt)*ne,(Ue+Ze)*te,(Qe-Ze)*ne,(Ue+lt)*te));var Ze=.05,lt=st*.05,Qe=.825,Ue=.95,dt=new go.PathFigure((Qe-Ze)*ne,Ue*te,!0);de.add(dt),dt.add(new go.PathSegment(go.PathSegment.Bezier,Qe*ne,(Ue-Ze)*te,(Qe-Ze)*ne,(Ue-lt)*te,(Qe-lt)*ne,(Ue-Ze)*te)),dt.add(new go.PathSegment(go.PathSegment.Bezier,(Qe+Ze)*ne,Ue*te,(Qe+lt)*ne,(Ue-Ze)*te,(Qe+Ze)*ne,(Ue-lt)*te)),dt.add(new go.PathSegment(go.PathSegment.Bezier,Qe*ne,(Ue+Ze)*te,(Qe+Ze)*ne,(Ue+lt)*te,(Qe+lt)*ne,(Ue+Ze)*te)),dt.add(new go.PathSegment(go.PathSegment.Bezier,(Qe-Ze)*ne,Ue*te,(Qe-lt)*ne,(Ue+Ze)*te,(Qe-Ze)*ne,(Ue+lt)*te).close());var $e=new go.PathFigure(0,te,!1);return de.add($e),$e.add(new go.PathSegment(go.PathSegment.Line,ne,te).close()),de}),go.Shape.defineFigureGenerator("Warehouse",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var ge=new go.PathFigure(0,.2*te,!1);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,.2*te).close());var ye=new go.PathFigure(.15*ne,te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.15*ne,.5*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.5*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.4*ne,te)),ye.add(new go.PathSegment(go.PathSegment.Line,.15*ne,te).close());var we=.05,Ce=st*.05,_e=.35,Ze=.775,lt=new go.PathFigure((_e-we)*ne,Ze*te,!0);return de.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,_e*ne,(Ze-we)*te,(_e-we)*ne,(Ze-Ce)*te,(_e-Ce)*ne,(Ze-we)*te)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(_e+we)*ne,Ze*te,(_e+Ce)*ne,(Ze-we)*te,(_e+we)*ne,(Ze-Ce)*te)),lt.add(new go.PathSegment(go.PathSegment.Bezier,_e*ne,(Ze+we)*te,(_e+we)*ne,(Ze+Ce)*te,(_e+Ce)*ne,(Ze+we)*te)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(_e-we)*ne,Ze*te,(_e-Ce)*ne,(Ze+we)*te,(_e-we)*ne,(Ze+Ce)*te).close()),de}),go.Shape.defineFigureGenerator("ControlCenter",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Move,.1*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.8*te).close()),de}),go.Shape.defineFigureGenerator("Bluetooth",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.75*te,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.75*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.25*te)),de}),go.Shape.defineFigureGenerator("Bookmark",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.4*te)),de}),go.Shape.defineFigureGenerator("Bookmark",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,0,0)),se.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.4*te)),de}),go.Shape.defineFigureGenerator("Globe",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Move,0,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,.75*ne,0,ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,ne,.75*te,.75*ne,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*te,.25*ne,te,0,.75*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,0,.25*te,.25*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,te,.15*ne,.25*te,.15*ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,.85*ne,.75*te,.85*ne,.25*te)),se.add(new go.PathSegment(go.PathSegment.Move,.1675*ne,.15*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.8325*ne,.15*te,.35*ne,.3*te,.65*ne,.3*te)),se.add(new go.PathSegment(go.PathSegment.Move,.1675*ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.8325*ne,.85*te,.35*ne,.7*te,.65*ne,.7*te)),de}),go.Shape.defineFigureGenerator("Wave",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.25*te,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,.3*ne,.25*te,.1*ne,0,.2*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,.7*ne,.25*te,.425*ne,.5*te,.575*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,.25*te,.8*ne,0,.9*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.75*te)),se.add(new go.PathSegment(go.PathSegment.Move,0,.25*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.75*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.3*ne,.75*te,.1*ne,.5*te,.2*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.7*ne,.75*te,.425*ne,te,.575*ne,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,.75*te,.8*ne,.5*te,.9*ne,.5*te)),de}),go.Shape.defineFigureGenerator("Operator",function(De,ne,te){var de=new go.Geometry,se=.3,ge=st*.3,ye=.5,we=.7,Ce=new go.PathFigure((ye-se)*ne,we*te,!0);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-ge)*te,(ye-ge)*ne,(we-se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+ge)*ne,(we-se)*te,(ye+se)*ne,(we-ge)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye-se)*ne,we*te,(ye-ge)*ne,(we+se)*te,(ye-se)*ne,(we+ge)*te));var _e=new go.PathFigure(0,.7*te,!1);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,ne,.7*te,0,0,ne,0)),de}),go.Shape.defineFigureGenerator("TripleFanBlades",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.5*ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.65*te,.65*ne,.3*te,.65*ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,.35*ne,.5*te,.35*ne,.3*te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.65*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,te,.3*ne,.6*te,.1*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.65*te,.2*ne,te,.35*ne,.95*te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.65*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,te,.7*ne,.6*te,.9*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.65*te,.8*ne,te,.65*ne,.95*te)),de}),go.Shape.defineFigureGenerator("CentrifugalPump",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne,0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*te,0,.075*te,0,.5*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.4*ne,te,0,te,.4*ne,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.4*te,.8*ne,te,.85*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,0)),de}),go.Shape.defineFigureGenerator("Battery",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,.1*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Move,.4*ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.1*te));var ge=new go.PathFigure(0,.6*te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Move,0,.4*te)),ge.add(new go.PathSegment(go.PathSegment.Line,ne,.4*te)),de}),go.Shape.defineFigureGenerator("Delete",function(De,ne,te){var de=new go.Geometry,se=.5,ge=st*.5,ye=.5,we=.5,Ce=new go.PathFigure((ye-se)*ne,we*te,!0);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-ge)*te,(ye-ge)*ne,(we-se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+ge)*ne,(we-se)*te,(ye+se)*ne,(we-ge)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye-se)*ne,we*te,(ye-ge)*ne,(we+se)*te,(ye-se)*ne,(we+ge)*te));var _e=new go.PathFigure(.15*ne,.5*te,!1);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.5*te)),de}),go.Shape.defineFigureGenerator("Flag",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.1*te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Move,0,.1*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.1*te,.15*ne,0,.35*ne,0)),se.add(new go.PathSegment(go.PathSegment.Bezier,ne,.1*te,.65*ne,.2*te,.85*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.5*te,.85*ne,.6*te,.65*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*te,.35*ne,.4*te,.15*ne,.4*te).close()),de}),go.Shape.defineFigureGenerator("Help",function(De,ne,te){var de=new go.Geometry,se=.5,ge=st*.5,ye=.5,we=.5,Ce=new go.PathFigure((ye-se)*ne,we*te,!1);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-ge)*te,(ye-ge)*ne,(we-se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+ge)*ne,(we-se)*te,(ye+se)*ne,(we-ge)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te)),Ce.add(new go.PathSegment(go.PathSegment.Bezier,(ye-se)*ne,we*te,(ye-ge)*ne,(we+se)*te,(ye-se)*ne,(we+ge)*te).close()),se=.05,ge=st*.05,ye=.5,we=.8;var _e=new go.PathFigure((ye-se)*ne,we*te,!1);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-ge)*te,(ye-ge)*ne,(we-se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+ge)*ne,(we-se)*te,(ye+se)*ne,(we-ge)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+ge)*te,(ye+ge)*ne,(we+se)*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,(ye-se)*ne,we*te,(ye-ge)*ne,(we+se)*te,(ye-se)*ne,(we+ge)*te).close()),_e.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.7*te)),_e.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.2*te,.75*ne,.475*te,.75*ne,.225*te)),_e.add(new go.PathSegment(go.PathSegment.Bezier,.3*ne,.35*te,.4*ne,.2*te,.3*ne,.25*te)),de}),go.Shape.defineFigureGenerator("Location",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.5*ne,te,!0).add(new go.PathSegment(go.PathSegment.Line,.75*ne,.5*te)).add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,0,.975*ne,.025*te,.5*ne,0)).add(new go.PathSegment(go.PathSegment.Bezier,.25*ne,.5*te,.5*ne,0,.025*ne,.025*te).close()).add(new go.PathSegment(go.PathSegment.Move,.5*ne,.2*te)).add(new go.PathSegment(go.PathSegment.Arc,270,360,.5*ne,.3*te,.1*ne,.1*te).close()))}),go.Shape.defineFigureGenerator("Lock",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.5*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.5*te));var ge=new go.PathFigure(.2*ne,.5*te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.5*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.3*te)),ge.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.3*te,.25*ne,0,.75*ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.5*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.3*te)),de}),go.Shape.defineFigureGenerator("Unlocked",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.5*te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.5*te));var ge=new go.PathFigure(.2*ne,.5*te,!1);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Move,.2*ne,.5*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.3*te)),ge.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.3*te,.25*ne,0,.75*ne,0)),ge.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.35*te)),de}),go.Shape.defineFigureGenerator("Gear",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(.9375*ne,.56246875*te,!0).add(new go.PathSegment(go.PathSegment.Line,.9375*ne,.4375*te)).add(new go.PathSegment(go.PathSegment.Line,.80621875*ne,.4375*te)).add(new go.PathSegment(go.PathSegment.Bezier,.763*ne,.3316875*te,.79840625*ne,.39915625*te,.7834375*ne,.3635*te)).add(new go.PathSegment(go.PathSegment.Line,.8566875*ne,.23796875*te)).add(new go.PathSegment(go.PathSegment.Line,.76825*ne,.14959375*te)).add(new go.PathSegment(go.PathSegment.Line,.67596875*ne,.24184375*te)).add(new go.PathSegment(go.PathSegment.Bezier,.5625*ne,.19378125*te,.64228125*ne,.2188125*te,.603875*ne,.2021875*te)).add(new go.PathSegment(go.PathSegment.Line,.5625*ne,.0625*te)).add(new go.PathSegment(go.PathSegment.Line,.4375*ne,.0625*te)).add(new go.PathSegment(go.PathSegment.Line,.4375*ne,.19378125*te)).add(new go.PathSegment(go.PathSegment.Bezier,.32775*ne,.239375*te,.39759375*ne,.20190625*te,.36053125*ne,.2176875*te)).add(new go.PathSegment(go.PathSegment.Line,.2379375*ne,.14959375*te)).add(new go.PathSegment(go.PathSegment.Line,.14953125*ne,.2379375*te)).add(new go.PathSegment(go.PathSegment.Line,.23934375*ne,.3278125*te)).add(new go.PathSegment(go.PathSegment.Bezier,.19378125*ne,.4375*te,.21765625*ne,.36059375*te,.201875*ne,.397625*te)).add(new go.PathSegment(go.PathSegment.Line,.0625*ne,.4375*te)).add(new go.PathSegment(go.PathSegment.Line,.0625*ne,.5625*te)).add(new go.PathSegment(go.PathSegment.Line,.1938125*ne,.5625*te)).add(new go.PathSegment(go.PathSegment.Bezier,.241875*ne,.67596875*te,.20221875*ne,.603875*te,.21884375*ne,.64228125*te)).add(new go.PathSegment(go.PathSegment.Line,.1495625*ne,.76825*te)).add(new go.PathSegment(go.PathSegment.Line,.238*ne,.8566875*te)).add(new go.PathSegment(go.PathSegment.Line,.3316875*ne,.76296875*te)).add(new go.PathSegment(go.PathSegment.Bezier,.43753125*ne,.80621875*te,.36353125*ne,.78340625*te,.3991875*ne,.79840625*te)).add(new go.PathSegment(go.PathSegment.Line,.43753125*ne,.9375*te)).add(new go.PathSegment(go.PathSegment.Line,.5625*ne,.9375*te)).add(new go.PathSegment(go.PathSegment.Line,.5625*ne,.80621875*te)).add(new go.PathSegment(go.PathSegment.Bezier,.67225*ne,.760625*te,.602375*ne,.79809375*te,.63946875*ne,.78234375*te)).add(new go.PathSegment(go.PathSegment.Line,.76828125*ne,.8566875*te)).add(new go.PathSegment(go.PathSegment.Line,.85671875*ne,.76825*te)).add(new go.PathSegment(go.PathSegment.Line,.76065625*ne,.67221875*te)).add(new go.PathSegment(go.PathSegment.Bezier,.80621875*ne,.56246875*te,.78234375*ne,.63940625*te,.798125*ne,.602375*te)).add(new go.PathSegment(go.PathSegment.Line,.9375*ne,.56246875*te).close()).add(new go.PathSegment(go.PathSegment.Move,.5*ne,.6*te)).add(new go.PathSegment(go.PathSegment.Arc,90,360,.5*ne,.5*te,.1*ne,.1*te).close()))}),go.Shape.defineFigureGenerator("Hand",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.5*te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Bezier,.1*ne,.3*te,0,.375*te,.05*ne,.325*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.45*ne,.075*te,.3*ne,.225*te,.4*ne,.175*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.525*ne,.075*te,.46*ne,.05*te,.525*ne,.05*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.3*ne,.4*te,.525*ne,.275*te,.475*ne,.325*te)),se.add(new go.PathSegment(go.PathSegment.Line,.9*ne,.4*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.9*ne,.55*te,ne,.4*te,ne,.55*te)),se.add(new go.PathSegment(go.PathSegment.Line,.425*ne,.55*te)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.55*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.6*ne,.7*te,.675*ne,.55*te,.675*ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Line,.575*ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.575*ne,.85*te,.65*ne,.7*te,.65*ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Line,.525*ne,.85*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.535*ne,te,.61*ne,.85*te,.61*ne,te)),se.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*te,.435*ne,te,0,te).close()),de}),go.Shape.defineFigureGenerator("Map",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,.2*te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.25*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,.25*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,te).close()),se.add(new go.PathSegment(go.PathSegment.Move,.25*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.25*ne,.8*te)),se.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te)),se.add(new go.PathSegment(go.PathSegment.Move,.75*ne,0)),se.add(new go.PathSegment(go.PathSegment.Line,.75*ne,.8*te)),de}),go.Shape.defineFigureGenerator("Eject",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne,te)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te*.7)),se.add(new go.PathSegment(go.PathSegment.Line,0,te*.7).close());var ge=new go.PathFigure(0,te*.6,!0);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne,.6*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.5*ne,0).close()),de}),go.Shape.defineFigureGenerator("Pencil",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.2*ne,.1*te)).add(new go.PathSegment(go.PathSegment.Line,ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.9*ne,te)).add(new go.PathSegment(go.PathSegment.Line,.1*ne,.2*te).close()))}),go.Shape.defineFigureGenerator("Building",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*1,te*1,!1);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,0,te*.85)),se.add(new go.PathSegment(go.PathSegment.Line,.046*ne,te*.85)),se.add(new go.PathSegment(go.PathSegment.Line,.046*ne,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,0,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,0,te*.3)),se.add(new go.PathSegment(go.PathSegment.Line,.046*ne,te*.3)),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*ne,te*.3)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te*.3)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*ne,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*ne,te*.85)),se.add(new go.PathSegment(go.PathSegment.Line,ne,te*.85).close());var ge=new go.PathFigure(.126*ne,.85*te,!1);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,.126*ne,.45*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.322*ne,.45*te)),ge.add(new go.PathSegment(go.PathSegment.Line,.322*ne,.85*te).close());var ye=new go.PathFigure(.402*ne,.85*te,!1);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,.402*ne,.45*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.598*ne,.45*te)),ye.add(new go.PathSegment(go.PathSegment.Line,.598*ne,.85*te).close());var we=new go.PathFigure(.678*ne,.85*te,!1);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,.678*ne,.45*te)),we.add(new go.PathSegment(go.PathSegment.Line,.874*ne,.45*te)),we.add(new go.PathSegment(go.PathSegment.Line,.874*ne,.85*te).close());var Ce=new go.PathFigure(.5*ne,.1*te,!1);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,(.046+.15)*ne,.3*te)),Ce.add(new go.PathSegment(go.PathSegment.Line,(1-(.046+.15))*ne,.3*te).close()),de}),go.Shape.defineFigureGenerator("Staircase",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te*1,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.2,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.2,te*.8)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.8)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.6)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*.6)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*.4)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*.4)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*.2)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.2)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.15)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*.15)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*.35)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.55,te*.35)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.55,te*.55)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.35,te*.55)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.35,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.15,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.15,te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,0,te*.95).close()),de}),go.Shape.defineFigureGenerator("5Bars",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,te*1,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.184,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.184,te*(1-.184)).close());var ge=new go.PathFigure(ne*.204,te,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.204,te*(1-.184))),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.388,te*(1-.184*2))),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.388,te*1).close());var ye=new go.PathFigure(ne*.408,te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.408,te*(1-.184*2))),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.592,te*(1-.184*3))),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.592,te*1).close());var we=new go.PathFigure(ne*.612,te,!0);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne*.612,te*(1-.184*3))),we.add(new go.PathSegment(go.PathSegment.Line,ne*.796,te*(1-.184*4))),we.add(new go.PathSegment(go.PathSegment.Line,ne*.796,te*1).close());var Ce=new go.PathFigure(ne*.816,te,!0);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*.816,te*(1-.184*4))),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*(1-.184*5))),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1).close()),de}),go.Shape.defineFigureGenerator("PC",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,0,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,0).close());var ge=new go.PathFigure(ne*.055,.07*te,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.245,te*.07)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.245,te*.1)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.055,te*.1).close());var ye=new go.PathFigure(ne*.055,.13*te,!0);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.245,te*.13)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.245,te*.16)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.055,te*.16).close());var we=new go.PathFigure(ne*.055,.18*te,!0);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne*.245,te*.18)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.245,te*.21)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.055,te*.21).close());var Ce=new go.PathFigure(ne*1,0,!0);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*.4,0)),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.65)),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.65).close()),de}),go.Shape.defineFigureGenerator("Plane",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(.55*ne,te,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.7*te)),se.add(new go.PathSegment(go.PathSegment.Line,.1*ne,.475*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.35*ne,.525*te,0,.4*te,.225*ne,.45*te)),se.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.475*te)),se.add(new go.PathSegment(go.PathSegment.Line,.15*ne,.35*te)),se.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.325*te)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.325*te)),se.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.1*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.9*ne,.2*te,.975*ne,0,ne,.08*te)),se.add(new go.PathSegment(go.PathSegment.Line,.7*ne,.45*te)),se.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.95*te)),se.add(new go.PathSegment(go.PathSegment.Line,.55*ne,te).close()),de}),go.Shape.defineFigureGenerator("Key",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*1,te*.5,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.9,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,.4*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,.35*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.45,.35*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.15,.2*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.35*te)),se.add(new go.PathSegment(go.PathSegment.Line,0,.65*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.15,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,.8*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.45,.65*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,.65*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.6,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.65,.55*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.7,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,.55*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.8,.6*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.85,.575*te)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.9,.6*te).close()),se.add(new go.PathSegment(go.PathSegment.Move,.17*ne,.425*te)),se.add(new go.PathSegment(go.PathSegment.Arc,270,360,.17*ne,.5*te,.075*ne,.075*te).close()),de}),go.Shape.defineFigureGenerator("FilmTape",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(0,0,!1);de.add(se),se.add(new go.PathSegment(go.PathSegment.Arc,270,180,ne*0,ne*.3,ne*.055)),se.add(new go.PathSegment(go.PathSegment.Line,0,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.08,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.08,te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*1),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*1),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*2),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*2),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*3),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*3),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*4),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*4),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*5),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*5),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*6),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*6),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*7),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*7),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*8),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*8),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*9),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*9),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*10),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*10),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*11),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*11),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*12),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*12),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*13),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*13),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*14),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*14),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*15),te*.95)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(.08+.056*15),te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1));var ge=new go.PathFigure(0,0,!1);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*0)),ge.add(new go.PathSegment(go.PathSegment.Arc,270,-180,ne*1,ne*.3,ne*.055)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1));var ye=new go.PathFigure(ne*.11,te*.1,!1);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*1+.028*0),te*.1)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*1+.028*0),te*.8)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.11,te*.8).close());var we=new go.PathFigure(ne*(.11+.24133333*1+.028*1),te*.1,!1);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*2+.028*1),te*.1)),we.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*2+.028*1),te*.8)),we.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*1+.028*1),te*.8).close());var Ce=new go.PathFigure(ne*(.11+.24133333*2+.028*2),te*.1,!1);return de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*3+.028*2),te*.1)),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*3+.028*2),te*.8)),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*2+.028*2),te*.8).close()),de}),go.Shape.defineFigureGenerator("FloppyDisk",function(De,ne,te){var de=new go.Geometry,se=8,ge=se*st,ye=new go.PathFigure(se,0,!1);de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.86,0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.14)),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te-se)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne-se,te,ne,te-ge,ne-ge,te)),ye.add(new go.PathSegment(go.PathSegment.Line,se,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,te-se,ge,te,0,te-ge)),ye.add(new go.PathSegment(go.PathSegment.Line,0,se)),ye.add(new go.PathSegment(go.PathSegment.Bezier,se,0,0,ge,ge,0).close());var we=new go.PathFigure(ne*.83,0,!1);de.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne*.83,te*.3)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.17,te*.3)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.17,te*0).close());var Ce=new go.PathFigure(ne*.83,te*1,!1);de.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*.83,te*.5)),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*.17,te*.5)),Ce.add(new go.PathSegment(go.PathSegment.Line,ne*.17,te*1).close());var _e=new go.PathFigure(ne*.78,te*.05,!1);return de.add(_e),_e.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*.05)),_e.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*.25)),_e.add(new go.PathSegment(go.PathSegment.Line,ne*.78,te*.25).close()),de}),go.Shape.defineFigureGenerator("SpeechBubble",function(De,ne,te){var de=De?De.parameter1:NaN;(isNaN(de)||de<0)&&(de=15),de=Math.min(de,ne/3),de=Math.min(de,te/3);var se=de*st,ge=te*.8,ye=new go.Geometry,we=new go.PathFigure(de,0,!0);return ye.add(we),we.add(new go.PathSegment(go.PathSegment.Line,ne-de,0)),we.add(new go.PathSegment(go.PathSegment.Bezier,ne,de,ne-se,0,ne,se)),we.add(new go.PathSegment(go.PathSegment.Line,ne,ge-de)),we.add(new go.PathSegment(go.PathSegment.Bezier,ne-de,ge,ne,ge-se,ne-se,ge)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.7,ge)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.7,te)),we.add(new go.PathSegment(go.PathSegment.Line,ne*.55,ge)),we.add(new go.PathSegment(go.PathSegment.Line,de,ge)),we.add(new go.PathSegment(go.PathSegment.Bezier,0,ge-de,se,ge,0,ge-se)),we.add(new go.PathSegment(go.PathSegment.Line,0,de)),we.add(new go.PathSegment(go.PathSegment.Bezier,de,0,0,se,se,0).close()),se>1?(ye.spot1=new go.Spot(0,0,se,se),ye.spot2=new go.Spot(1,.8,-se,-se)):(ye.spot1=go.Spot.TopLeft,ye.spot2=new go.Spot(1,.8)),ye}),go.Shape.defineFigureGenerator("Repeat",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*0,te*.45,!0);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.25,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,te*.9)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*.9)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.65,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.2,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.2,te*.45).close());var ge=new go.PathFigure(ne*1,te*.55,!0);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*1)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*.55)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.7,te*.55)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.7,te*.1)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.1)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.35,te*0)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*0)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*.55).close()),de}),go.Shape.defineFigureGenerator("Windows",function(De,ne,te){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,ne,0)).add(new go.PathSegment(go.PathSegment.Line,ne,te)).add(new go.PathSegment(go.PathSegment.Line,0,te).close()).add(new go.PathSegment(go.PathSegment.Move,.4*ne,.4*te)).add(new go.PathSegment(go.PathSegment.Line,.4*ne,.8*te)).add(new go.PathSegment(go.PathSegment.Line,.9*ne,.8*te)).add(new go.PathSegment(go.PathSegment.Line,.9*ne,.4*te).close()).add(new go.PathSegment(go.PathSegment.Move,.2*ne,.1*te)).add(new go.PathSegment(go.PathSegment.Line,.2*ne,.6*te)).add(new go.PathSegment(go.PathSegment.Line,.7*ne,.6*te)).add(new go.PathSegment(go.PathSegment.Line,.7*ne,.1*te).close()).add(new go.PathSegment(go.PathSegment.Move,.1*ne,.6*te)).add(new go.PathSegment(go.PathSegment.Line,.1*ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,.9*te)).add(new go.PathSegment(go.PathSegment.Line,.5*ne,.6*te).close()))}),go.Shape.defineFigureGenerator("Terminal",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*0,te*.1,!1);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.9)),se.add(new go.PathSegment(go.PathSegment.Line,ne*0,te*.9).close());var ge=new go.PathFigure(ne*.1,te*.2,!0);de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.1,te*.25)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.22,te*.285)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.1,te*.32)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.1,te*.37)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.275,te*.32)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.275,te*.25).close());var ye=new go.PathFigure(ne*.28,te*.37,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.45,te*.37)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.45,te*.41)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.28,te*.41).close()),de}),go.Shape.defineFigureGenerator("Beaker",function(De,ne,te){var de=new go.Geometry,se=15,ge=se*st,ye=new go.PathFigure(ne*.62,te*.475,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne,te-se)),ye.add(new go.PathSegment(go.PathSegment.Bezier,ne-se,te,ne,te-ge,ne-ge,te)),ye.add(new go.PathSegment(go.PathSegment.Line,se,te)),ye.add(new go.PathSegment(go.PathSegment.Bezier,0,te-se,ge,te,0,te-ge)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.38,te*.475)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.38,te*.03)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.36,te*0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.64,te*0)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.62,te*.03).close()),ge>1?(de.spot1=new go.Spot(0,0,ge,ge),de.spot2=new go.Spot(1,1,-ge,-ge)):(de.spot1=go.Spot.TopLeft,de.spot2=go.Spot.BottomRight),de}),go.Shape.defineFigureGenerator("Download",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*0,te*1,!0);de.add(se);var ge=.1/.3;se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.755,te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.93,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.64,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.61,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.39,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.36,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.07,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.755),te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.66),te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.66),te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.8),te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*0,te*(1-ge)).close());var ye=new go.PathFigure(ne*.4,te*0,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.44)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.26,te*.44)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*.66)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.26),te*.44)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*.44)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*0).close()),de}),go.Shape.defineFigureGenerator("Bin",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*0,te*1,!0);de.add(se);var ge=.1/.3;return se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.755,te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.93,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.64,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.61,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.39,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.36,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.07,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.755),te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.66),te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.66),te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.8),te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*0,te*(1-ge)).close()),de}),go.Shape.defineFigureGenerator("Upload",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*0,te*1,!0);de.add(se);var ge=.1/.3;se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.8,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.755,te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.93,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.64,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.61,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.39,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.36,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*.07,te*(1-ge))),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.755),te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.66),te*.055)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.66),te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*(1-.8),te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*0,te*(1-ge)).close());var ye=new go.PathFigure(ne*.5,te*0,!0);return de.add(ye),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.26,te*.25)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.25)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.63)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*.63)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.6,te*.25)),ye.add(new go.PathSegment(go.PathSegment.Line,ne*.74,te*.25).close()),de}),go.Shape.defineFigureGenerator("EmptyDrink",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*.15,te*0,!1);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.85,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.7,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,te*1).close()),de}),go.Shape.defineFigureGenerator("Drink",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*.15,te*0,!1);de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.85,te*0)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.7,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.3,te*1).close());var ge=new go.PathFigure(ne*.235,te*.28,!0);return de.add(ge),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.765,te*.28)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.655,te*.97)),ge.add(new go.PathSegment(go.PathSegment.Line,ne*.345,te*.97).close()),de}),go.Shape.defineFigureGenerator("4Arrows",function(De,ne,te){var de=new go.Geometry,se=new go.PathFigure(ne*.5,te*0,!0);return de.add(se),se.add(new go.PathSegment(go.PathSegment.Line,ne*.65,te*.25)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.55,te*.25)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.55,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*.35)),se.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.5)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*.65)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.75,te*.55)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.55,te*.55)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.55,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.65,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.5,te*1)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.35,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.45,te*.75)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.45,te*.55)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.25,te*.55)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.25,te*.65)),se.add(new go.PathSegment(go.PathSegment.Line,ne*0,te*.5)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.25,te*.35)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.25,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.45,te*.45)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.45,te*.25)),se.add(new go.PathSegment(go.PathSegment.Line,ne*.35,te*.25).close()),de}),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 Zn={},ei="5.0",Le={},le=null,Ke=!1,it=!1,bt=null,vt=!1,Oe=null,st=null,Et=0;Et<arguments.length;Et++){var ot=arguments[Et];if(ot!==null)switch(typeof ot){case"number":ei=ot.toFixed(1);break;case"string":ot.match(new RegExp("^[0-9]\\.[0-9]+$"))?ei=ot:bt=ot;break;case"object":typeof ot.is3D!="undefined"?le=ot:Le=ot;break;case"boolean":Ke=ot,it=!0;break}}le===null&&(le={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},Le.material_id!==void 0&&!it&&(Ke=!0)),bt!==null&&Le.id===void 0&&(Le.id=bt);var We="",Tt="",ct=!1,At=null,De=null,ne=null,te=!1,de=null,se=null,ge=null,ye=null,we=null;Le.height!==void 0&&(Le.height=Math.round(Le.height)),Le.width!==void 0&&(Le.width=Math.round(Le.width));var Ce=function(Wt){return parseFloat(Wt)>4?parseFloat(Wt):5};Zn.setHTML5Codebase=function(Wt,En){st=Wt,dn(Wt,En)},Zn.setJavaCodebase=Zn.setJavaCodebaseVersion=Zn.isCompiledInstalled=Zn.setPreCompiledScriptPath=Zn.setPreCompiledResourcePath=function(){},Zn.setHTML5CodebaseVersion=function(Wt,En){var An=parseFloat(Wt);if(An!==NaN&&An<5){console.log("The GeoGebra HTML5 codebase version "+An+" is deprecated. Using version latest instead.");return}Oe=Wt,rt(Wt,En)},Zn.getHTML5CodebaseVersion=function(){return De},Zn.getParameters=function(){return Le},Zn.setFontsCSSURL=function(Wt){ye=Wt},Zn.setGiacJSURL=function(Wt){},Zn.setJNLPFile=function(Wt){We=Wt},Zn.setJNLPBaseDir=function(Wt){},Zn.inject=function(){function Wt(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var En="auto",An=Le.id,ci,It=!1,Pt=0;Pt<arguments.length;Pt++){var Nt=arguments[Pt];typeof Nt=="string"?(Nt=Nt.toLowerCase(),Nt.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?En=Nt:An=arguments[Pt]):typeof Nt=="boolean"?It=Nt:Nt instanceof HTMLElement&&(ci=Nt)}ii();function ii(){if(!vt){setTimeout(ii,200);return}En=rn(En);var Gi=ci||document.getElementById(An);if(!Gi){console.log("possibly bug on ajax loading? ");return}if(Zn.removeExistingApplet(Gi,!1),Le.width===void 0&&Gi.clientWidth&&(Le.width=Gi.clientWidth),Le.height===void 0&&Gi.clientHeight&&(Le.height=Gi.clientHeight),!(Le.width&&Le.height)&&En==="html5"&&(delete Le.width,delete Le.height),At=En,En==="screenshot")St(Gi,Le);else{var ze=!1;Le.hasOwnProperty("playButton")&&Le.playButton||Le.hasOwnProperty("clickToLoad")&&Le.clickToLoad?ze=!0:Le.hasOwnProperty("playButtonAutoDecide")&&Le.playButtonAutoDecide&&(ze=(!_e()||Wt())&&Ze()),ze?(At="screenshot",pn(Gi,Le,It,En)):wt(Gi,Le,It)}}};function _e(){try{return window.self!==window.top}catch(Wt){return!0}}function Ze(){return Le.hasOwnProperty("screenshotGenerator")&&Le.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}Zn.getViews=function(){return le},Zn.isJavaInstalled=function(){return!1};var lt=function(Wt){var En=function(Pt){var Nt=JSON.parse(Pt),ii=function(Me){return Me.type=="G"||Me.type=="E"},Gi=Nt.elements?Nt.elements.filter(ii)[0]:Nt;if(!Gi||!Gi.url){An();return}Le.fileName=Gi.url,Qe(Gi.settings||{}),le.is3D=!0;var ze="https://www.geogebra.org/images/";Zn.setPreviewImage(de||Gi.previewUrl,ze+"GeoGebra_loading.png",ze+"applet_play.png"),Wt()},An=function(){Le.onError&&Le.onError(),ri("Error: Fetching material (id "+Le.material_id+") failed.",Le)},ci=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",It="/materials/"+Le.material_id+"?scope=basic";Ue("https://"+ci+"/api/proxy.php?path="+encodeURIComponent(It),En,An)};function Qe(Wt){var En=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(An){Wt[An]=!!Wt[An]}),En.forEach(function(An){Le[An]===void 0&&Wt[An]!==void 0&&(Le[An]=Wt[An])}),Le.showToolBarHelp===void 0&&(Le.showToolBarHelp=Le.showToolBar)}function Ue(Wt,En,An){var ci=new XMLHttpRequest;ci.open("GET",Wt),ci.onload=function(){En(ci.responseText)},ci.onerror=An,ci.send()}Zn.isHTML5Installed=function(){return!0},Zn.getLoadedAppletType=function(){return At},Zn.setPreviewImage=function(Wt,En,An){de=Wt,se=En,ge=An},Zn.removeExistingApplet=function(Wt,En){var An;typeof Wt=="string"&&(Wt=document.getElementById(Wt)),At=null;var ci=null;for(An=0;An<Wt.childNodes.length;An++){var It=Wt.childNodes[An],Pt=It.className;Pt==="applet_screenshot"?En?(It.style.display="block",At="screenshot"):It.style.display="none":Pt!=="applet_scaler prerender"&&(Wt.removeChild(It),ci=Pt&&Pt.indexOf("appletParameters")!=-1?It.id:null,An--)}var Nt=Le.id!==void 0?Le.id:ci,ii=window[Nt];ii&&typeof ii.getBase64=="function"&&(ii.remove(),window[Nt]=null)},Zn.refreshHitPoints=function(){if(Ce(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Wt=Zn.getAppletObject();return Wt&&typeof Wt.recalculateEnvironments=="function"?(Wt.recalculateEnvironments(),!0):!1},Zn.startAnimation=function(){var Wt=Zn.getAppletObject();return Wt&&typeof Wt.startAnimation=="function"?(Wt.startAnimation(),!0):!1},Zn.stopAnimation=function(){var Wt=Zn.getAppletObject();return Wt&&typeof Wt.stopAnimation=="function"?(Wt.stopAnimation(),!0):!1},Zn.getAppletObject=function(){var Wt=Le.id!==void 0?Le.id:"ggbApplet";return window[Wt]},Zn.resize=function(){};var dt=function(Wt,En,An){var ci=document.createElement("param");ci.setAttribute("name",En),ci.setAttribute("value",An),Wt.appendChild(ci)},$e=function(Wt){return Wt&&Wt!=="false"},wt=function(Wt,En,An){Ce(De)<=4.2&&(An=!0);var ci=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==De||ggbHTML5LoadedCodebaseIsWebSimple&&!te)&&(ci=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var It=document.createElement("div");It.classList.add("appletParameters","notranslate");var Pt=En.width,Nt=En.height;if(En.disableAutoScale=En.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():En.disableAutoScale,En.width!==void 0)if(Ce(De)<=4.4)$e(En.showToolBar)&&(En.height-=7),$e(En.showAlgebraInput)&&(En.height-=37),En.width<605&&$e(En.showToolBar)&&(En.width=605,Pt=605);else{var ii=100;($e(En.showToolBar)||$e(En.showMenuBar))&&(En.hasOwnProperty("customToolBar")&&(En.customToolbar=En.customToolBar),ii=$e(En.showMenuBar)?245:155),Pt<ii&&(En.width=ii,Pt=ii)}It.style.border="none",It.style.display="inline-block";for(var Gi in En)En.hasOwnProperty(Gi)&&Gi!=="appletOnLoad"&&It.setAttribute("data-param-"+Gi,En[Gi]);ye&&It.setAttribute("data-param-fontscssurl",ye),Zn.resize=function(){GGBAppletUtils.responsiveResize(Wt,En)},window.addEventListener("resize",function(Zt){Zn.resize()});var ze=typeof En.appletOnLoad=="function"?En.appletOnLoad:function(){};if(!An&&En.width!==void 0){En.hasOwnProperty("showSplash")||It.setAttribute("data-param-showSplash","false");var Me=Wt.querySelector(".applet_scaler.prerender"),Ee=Me!==null;if(Ee)var Te=Me.querySelector(".ggb_preview");else{var Te=vn(Pt,Nt,En.borderColor,!1);Me=document.createElement("div"),Me.className="applet_scaler",Me.style.position="relative",Me.style.display="block",Me.style.width=Pt+"px",Me.style.height=Nt+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Me,"66%"),Ce(De)>=5?(En.appletOnLoad=function(Zt){var hn=Wt.querySelector(".ggb_preview");hn&&hn.parentNode.removeChild(hn),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Me),window.GGBT_wsf_view&&$(window).trigger("resize"),ze(Zt)},Ee||Me.appendChild(Te)):It.appendChild(Te),Me.appendChild(It),Ee||Wt.appendChild(Me),setTimeout(function(){Zn.resize()},1)}else{var He=document.createElement("div");He.className="applet_scaler",He.style.position="relative",He.style.display="block",He.appendChild(It),Wt.appendChild(He),En.appletOnLoad=function(Zt){Zn.resize(),ze(Zt)}}function Ae(Zt,hn){hn&&typeof hn.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(Zt,hn.appletOnLoad):renderGGBElement(Zt),ri("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",hn)}function qe(Zt,hn){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:Zt,params:hn}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(wn){Ae(wn.article,wn.params)}),html5AppletsToProcess=null)},Ce(De)<5&&(Zt.className+=" geogebraweb")):Ae(Zt,hn)}if(ci){scriptLoadStarted=!0;for(var an=0;an<It.childNodes.length;an++){var Xt=It.childNodes[an].tagName;Xt==="TABLE"&&(It.removeChild(It.childNodes[an]),an--)}if(ggbHTML5LoadedScript!==null){var yn=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');yn!=null&&yn.parentNode.removeChild(yn)}var kt=document.createElement("script"),Dt=function(){qe(It,En)};kt.src=Tt+ne,ggbHTML5LoadedCodebaseIsWebSimple=te,ggbHTML5LoadedCodebaseVersion=De,ggbHTML5LoadedScript=kt.src,ri("GeoGebra HTML5 codebase loaded: '"+Tt+"'.",En),!st&&(!Oe||Oe=="5.0")?(te?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),Dt()):Tt.requirejs?__webpack_require__.e(7963).then(function(){var Zt=[__webpack_require__(87963)];Dt.apply(null,Zt)}.bind(this)).catch(__webpack_require__.oe):(kt.onload=Dt,Wt.appendChild(kt))}else qe(It,En);En.height=Nt,En.width=Pt},St=function(Wt,En,An){var ci=vn(En.width,En.height,En.borderColor,An),It=document.createElement("div");It.style.position="relative",It.style.display="block",It.style.width=En.width+"px",It.style.height=En.height+"px",It.className="applet_screenshot applet_scaler"+(An?" applet_screenshot_play":""),It.appendChild(ci);var Pt=GGBAppletUtils.getScale(En,Wt,An);An?(Wt.appendChild(en()),window.GGBT_wsf_view||(Wt.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(It,"66%"),Wt.appendChild(It),Pt!==1&&!isNaN(Pt)&&(GGBAppletUtils.scaleElement(It,Pt),It.style.width=En.width+"px",It.style.height=En.height+"px",It.parentNode.style.width=En.width*Pt+"px",It.parentNode.style.height=En.height*Pt+"px"),Zn.resize=function(){Lt(Wt,ci,It,An)},window.addEventListener("resize",function(Nt){Zn.resize()}),Zn.resize()};function Lt(Wt,En,An,ci){if(Wt.contains(En)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Wt.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Wt)}var It=GGBAppletUtils.getScale(Le,Wt,ci);An.parentNode!==null&&(!isNaN(It)&&It!==1?(GGBAppletUtils.scaleElement(An,It),An.parentNode.style.width=Le.width*It+"px",An.parentNode.style.height=Le.height*It+"px"):(GGBAppletUtils.scaleElement(An,1),An.parentNode.style.width=Le.width+"px",An.parentNode.style.height=Le.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Wt),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}Zn.onExitFullscreen=function(Wt,En){En.appendChild(Wt)};var pn=function(Wt,En,An,ci){St(Wt,En,!0);for(var It=function(){var ii=[];for(Nt=0;Nt<Wt.childNodes.length;Nt++)ii.push(Wt.childNodes[Nt]);if(window.GGBT_wsf_view){var Gi=window.GGBT_wsf_view.renderFullScreen(Wt,En.id),ze=document.getElementById("fullscreencontainer"),Me=jQuery(Wt).find(".fullscreencontent");Me.length>0?(Gi.remove(),Me.attr("id","fullscreencontent").show(),jQuery(ze).append(Me),window.dispatchEvent(new Event("resize"))):wt(Gi,En,!1),window.GGBT_wsf_view.launchFullScreen(ze)}else At=ci,wt(Wt,En,!1);if(!window.GGBT_wsf_view)for(Nt=0;Nt<ii.length;Nt++)Wt.removeChild(ii[Nt])},Pt=Wt.getElementsByClassName("ggb_preview_play"),Nt=0;Nt<Pt.length;Nt++)Pt[Nt].addEventListener("click",It,!1),Pt[Nt].addEventListener("ontouchstart",It,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Wt),Ze()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},en=function(){var Wt=document.createElement("div");if(Wt.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var En='.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");}',An=document.createElement("style");An.styleSheet?An.styleSheet.cssText=En:An.appendChild(document.createTextNode(En)),document.getElementsByTagName("head")[0].appendChild(An)}return Wt},vn=function(Wt,En,An,ci){var It=document.createElement("div");It.className="ggb_preview",It.style.position="absolute",It.style.zIndex="90",It.style.width=Wt-2+"px",It.style.height=En-2+"px",It.style.top="0px",It.style.left="0px",It.style.overflow="hidden",It.style.backgroundColor="white";var Pt="lightgrey";An!==void 0&&(An==="none"?Pt="transparent":Pt=An),It.style.border="1px solid "+Pt;var Nt=document.createElement("img");if(Nt.style.position="relative",Nt.style.zIndex="1000",Nt.style.top="-1px",Nt.style.left="-1px",de!==null&&Nt.setAttribute("src",de),Nt.style.opacity=.7,se!==null){var ii,Gi,ze;if(!ci){ii=document.createElement("img"),ii.style.position="absolute",ii.style.zIndex="1001",ii.style.opacity=1,Nt.style.opacity=.3,Gi=360,Gi>Wt/4*3&&(Gi=Wt/4*3),ze=Gi/5.8,ii.setAttribute("src",se),ii.setAttribute("width",Gi),ii.setAttribute("height",ze);var Me=(Wt-Gi)/2,Ee=(En-ze)/2;ii.style.left=Me+"px",ii.style.top=Ee+"px",It.appendChild(ii)}}return It.appendChild(Nt),It},rn=function(Wt){return Wt=Wt.toLowerCase(),Wt==="html5"||Wt==="screenshot"?Wt:"html5"},nt=["web","webSimple","web3d","tablet","tablet3d","phone"],rt=function(Wt,En){if(De=Wt,En){dn(De,!0);return}var An=!Ke;if(An){var ci=Ce(De);!isNaN(ci)&&ci<4.4&&(An=!1)}var It,Pt;window.location.protocol.substr(0,4)==="http"?It=window.location.protocol:It="http:";var Nt=De.indexOf("//");Nt>0?Pt=De:Nt===0?Pt=It+De:Pt="https://www.geogebra.org/apps/5.2.814.0/";for(var ii in nt)if(De.slice(nt[ii].length*-1)===nt[ii]||De.slice((nt[ii].length+1)*-1)===nt[ii]+"/"){dn(Pt,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&An&&!le.is3D&&!le.AV&&!le.SV&&!le.CV&&!le.EV2&&!le.CP&&!le.PC&&!le.DA&&!le.FI&&!le.PV&&!$e(Le.showToolBar)&&!$e(Le.showMenuBar)&&!$e(Le.showAlgebraInput)&&!$e(Le.enableRightClick)&&(!Le.appName||Le.appName=="classic")?Pt+="webSimple/":Pt+="web3d/",dn(Pt,!1)},dn=function(Wt,En){if(Wt.requirejs){Tt=Wt;return}Wt.slice(-1)!=="/"&&(Wt+="/"),Tt=Wt,En===null&&(En=Wt.indexOf("http")===-1),ct=En,ne="web.nocache.js",te=!1;var An=Tt.split("/");An.length>1&&(!En&&An[An.length-2]==="webSimple"?(ne="webSimple.nocache.js",te=!0):nt.indexOf(An[An.length-2])>=0&&(ne=An[An.length-2]+".nocache.js")),An=Wt.split("/"),De=An[An.length-3],De.substr(0,4)==="test"?De=De.substr(4,1)+"."+De.substr(5,1):(De.substr(0,3)==="war"||De.substr(0,4)==="beta")&&(De="5.0");var ci=parseFloat(De);ci!==NaN&&ci<5&&Wt.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+ci+" is deprecated. Using version latest instead."),rt("5.0",En))},ri=function(Wt,En){window.console&&window.console.log&&(!En||typeof En.showLogging=="undefined"||En.showLogging&&En.showLogging!=="false")&&console.log(Wt)};Le.material_id!==void 0?lt(Hn):Hn();function Hn(){var Wt=ei;Oe!==null?Wt=Oe:parseFloat(Wt)<5&&(Wt="5.0"),rt(Wt,!1),st!==null&&dn(st,ct),vt=!0}return Zn},GGBAppletUtils=function(){"use strict";function Zn(){return window.GGBT_wsf_edit!==void 0}function ei(vt,Oe){Oe!=1?(vt.style.transformOrigin="0% 0% 0px",vt.style.webkitTransformOrigin="0% 0% 0px",vt.style.transform="scale("+Oe+","+Oe+")",vt.style.webkitTransform="scale("+Oe+","+Oe+")",vt.style.maxWidth="initial",vt.querySelector(".ggb_preview")!==null&&(vt.querySelector(".ggb_preview").style.maxWidth="initial"),vt.querySelectorAll(".ggb_preview img")[0]!==void 0&&(vt.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),vt.querySelectorAll(".ggb_preview img")[1]!==void 0&&(vt.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(vt.style.transform="none",vt.style.webkitTransform="none")}function Le(vt,Oe,st,Et,ot,We){var Tt=null;if(We!=null&&We!="")for(var ct=vt.parentNode;ct!=null;)if((" "+ct.className+" ").indexOf(" "+We+" ")>-1){Tt=ct;break}else ct=ct.parentNode;var At=0,De=0,ne=0,te=0,de=0,se=0,ge=0;if(Tt)At=Tt.offsetWidth,De=Math.max(Et?Tt.offsetWidth:0,Tt.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(At=Math.min(window.innerWidth,document.documentElement.clientWidth),De=Math.min(window.innerHeight,document.documentElement.clientHeight),ne=At):(At=window.innerWidth,De=window.innerHeight,ne=window.innerWidth),vt){var ye=vt.getBoundingClientRect();ye.left>0&&ye.left<=At&&(ot===void 0||!ot)&&(document.dir==="rtl"?(de=At-ye.width-ye.left,se=ne<=480?10:30):(se=ye.left,de=ne<=480?10:30),te=se+de)}if(vt&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var we=vt.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(te=40,ge=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(te=0,ge=40)}}return vt&&((st===void 0||!st)&&Oe>0&&Oe+te<At?At=Oe:At-=te,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(st===void 0||!st)&&(De-=ge)),{width:At,height:De}}function le(vt,Oe,st,Et,ot){if(vt.isScreenshoGenerator)return 1;var We=Et!==void 0&&Et,Tt=vt.noScaleMargin!=null&&vt.noScaleMargin,ct=function(we){return we&&we!=="false"},At=ct(vt.autoHeight),De=Le(Oe,vt.width,st,At,We&&window.GGBT_wsf_view||Tt,ot),ne=parseInt(De.width),te=vt.width,de=vt.height;if(te===void 0){var se=Oe.querySelector(".appletParameters");se&&(te=se.offsetWidth,de=se.offsetHeight)}var ge=ne/te,ye=We?1:De.height/de;return st!==void 0&&!st&&(ge=Math.min(1,ge),ye=Math.min(1,ye)),Math.min(ge,ye)}function Ke(vt,Oe,st){var Et=1,ot,We=!1;if(vt.hasOwnProperty("allowUpscale")&&(We=vt.allowUpscale),vt.hasOwnProperty("scale")&&(Et=parseFloat(vt.scale),(isNaN(Et)||Et===null||Et===0)&&(Et=1),Et>1&&(We=!0)),Oe&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(We=!0),!(vt.hasOwnProperty("disableAutoScale")&&vt.disableAutoScale))ot=le(vt,Oe,We,st,vt.scaleContainerClass);else return Et;return We&&(!vt.hasOwnProperty("scale")||Et===1)?ot:Math.min(Et,ot)}function it(vt){var Oe=Math.min(window.innerWidth,document.documentElement.clientWidth),st=Math.min(window.innerHeight,document.documentElement.clientHeight),Et=vt.getBoundingClientRect(),ot=(Oe-Et.width)/2,We=(st-Et.height)/2;We<0&&(We=0),vt.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(ot<40?vt.style.left="40px":vt.style.left=ot+"px",vt.style.top=We+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(We<40?vt.style.top="40px":vt.style.top=We+"px",vt.style.left=ot+"px")}function bt(vt,Oe){var st=vt.querySelector(".appletParameters");if(st){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Oe.id!==st.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(vt)}if(st.parentElement&&/fullscreen/.test(st.parentElement.className))return;var Et=Ke(Oe,vt);Zn()&&st.setAttribute("data-param-scale",Et);for(var ot=null,We=0;We<vt.childNodes.length;We++)if(vt.childNodes[We].className!==void 0&&vt.childNodes[We].className.match(/^applet_scaler/)){ot=vt.childNodes[We];break}if(ot!==null&&ot.querySelector(".noscale")!==null)return;var Tt=Oe.id!==void 0?Oe.id:"ggbApplet",ct=window[Tt];(ct==null||!ct.recalculateEnvironments)&&ot!==null&&!ot.className.match(/fullscreen/)&&(ot.parentNode.style.transform="",!isNaN(Et)&&Et!==1?(ot.parentNode.style.width=Oe.width*Et+"px",ot.parentNode.style.height=Oe.height*Et+"px",ei(ot,Et)):(ei(ot,1),ot.parentNode.style.width=Oe.width+"px",ot.parentNode.style.height=Oe.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&it(vt),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(st).parents(".content-added-content"))}}return{responsiveResize:bt,isFlexibleWorksheetEditor:Zn,positionCenter:it,getScale:Ke,scaleElement:ei}}();__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 Zn=n.location.search;return Zn.indexOf(J)!=-1||Zn.indexOf(K)!=-1}function q(Zn,ei){}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(Zn){var ei=s[L].bindings;s[L].bindings=function(){for(var Le=ei?ei():{},le=Zn[webModule.__softPermutationId],Ke=O;Ke<le.length;Ke++){var it=le[Ke];Le[it[O]]=it[P]}return Le}};var t;function u(){return v(),t}function v(){if(!t){var Zn=o.createElement(Q);if(Zn.id=L,Zn.style.cssText=R+S,Zn.tabIndex=-1,o.body.appendChild(Zn),t=Zn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var ei=document.compatMode==U?V:W;t.write(ei+X),t.close()}}}function w(Zn){function ei(le){function Ke(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var it=Ke();if(it){le();return}function bt(){if(!it){if(!Ke())return;it=!0,le(),o.removeEventListener&&o.removeEventListener(Z,bt,!1),vt&&clearInterval(vt)}}o.addEventListener&&o.addEventListener(Z,bt,!1);var vt=setInterval(function(){bt()},$)}function Le(le){var Ke=u(),it=Ke.body,bt=Ke.createElement(_);bt.language=ab,bt.crossOrigin=W,bt.src=le,webModule.__errFn&&(bt.onerror=function(){webModule.__errFn(L,new Error(bb+le))}),it.appendChild(bt)}ei(function(){Le(Zn)})}webModule.__startLoadingFragment=function(Zn){return C(Zn)},webModule.__installRunAsyncCode=function(Zn){var ei=u(),Le=ei.body,le=ei.createElement(_);le.language=ab,le.text=Zn,Le.appendChild(le),Le.removeChild(le)};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(Zn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(Zn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(Zn){var ei=c[Zn];return ei==null?null:ei},r=d,webModule.__errFn=e}function B(){function Zn(vt){var Oe=vt.lastIndexOf(rb);Oe==-1&&(Oe=vt.length);var st=vt.indexOf(sb);st==-1&&(st=vt.length);var Et=vt.lastIndexOf(tb,Math.min(st,Oe));return Et>=O?vt.substring(O,Et+P):W}function ei(vt){if(!vt.match(/^\w+:\/\//)){var Oe=o.createElement(ub);Oe.src=vt+vb,vt=Zn(Oe.src)}return vt}function Le(){var vt=__gwt_getMetaProperty(wb);return vt!=null?vt:W}function le(){for(var vt=o.getElementsByTagName(_),Oe=O;Oe<vt.length;++Oe)if(vt[Oe].src.indexOf(xb)!=-1)return Zn(vt[Oe].src);return W}function Ke(){var vt=o.getElementsByTagName(yb);return vt.length>O?vt[vt.length-P].href:W}function it(){var vt=o.location;return vt.href==vt.protocol+zb+vt.host+vt.pathname+vt.search+vt.hash}var bt=Le();return bt==W&&(bt=le()),bt==W&&(bt=Ke()),bt==W&&it()&&(bt=Zn(o.location.href)),bt=ei(bt),bt}function C(Zn){return Zn.match(/^\//)||Zn.match(/^[a-zA-Z]+:\/\//)?Zn:webModule.__moduleBase+Zn}function D(){var Zn=[],ei=O,Le=[],le=[];function Ke(vt){var Oe=le[vt](),st=Le[vt];if(Oe in st)return Oe;var Et=[];for(var ot in st)Et[st[ot]]=ot;throw r&&r(vt,Et,Oe),null}if(__gwt_isKnownPropertyValue=function(vt,Oe){return Oe in Le[vt]},webModule.__getPropMap=function(){var vt={};for(var Oe in Le)Le.hasOwnProperty(Oe)&&(vt[Oe]=Ke(Oe));return vt},webModule.__computePropValue=Ke,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var it;try{it=Cb;var bt=it.indexOf(Db);bt!=-1&&(ei=parseInt(it.substring(bt+P),$),it=it.substring(O,bt))}catch(vt){}return webModule.__softPermutationId=ei,C(it+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(Zn,ei,Le){"use strict";Le.d(ei,{Ax:function(){return bt},Ds:function(){return vt},KI:function(){return st},SI:function(){return it},f1:function(){return Ke}});var le=Le(346);function Ke(Et){let ot=!0;if(Et.length>0){for(let We=0;We<Et.length;We++)if(Et[We].compile_success==0||!Et[We].compile_success){ot=!1;break}}else ot=!1;return ot}function it(Et,ot=""){let We=[];for(let Tt=0;Tt<Et.length;Tt++){let ct=Et[Tt],At=ot?`${ot}/${ct.name}`:`${ct.name}`;We.push({title:ct.name,type:ct.type,isLeaf:ct.type!=="tree",key:At})}return We}function bt(Et,ot,We){for(let Tt=0;Tt<Et.length;Tt++){let ct=Et[Tt];if(ct.key===ot){ct.children=We;break}ct.children&&bt(ct.children,ot,We)}return Et}function vt(Et,ot,We){let Tt;return function(){let ct=this,At=arguments,De=function(){Tt=null,We||Et.apply(ct,At)},ne=We&&!Tt;clearTimeout(Tt),Tt=setTimeout(De,ot),ne&&Et.apply(ct,At)}}const Oe=!0,st=le.Z.API_SERVER},84842:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return De}});var le=Le(99571),Ke=Le(59301),it=Object.defineProperty,bt=Object.defineProperties,vt=Object.getOwnPropertyDescriptors,Oe=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,ot=(ne,te,de)=>te in ne?it(ne,te,{enumerable:!0,configurable:!0,writable:!0,value:de}):ne[te]=de,We=(ne,te)=>{for(var de in te||(te={}))st.call(te,de)&&ot(ne,de,te[de]);if(Oe)for(var de of Oe(te))Et.call(te,de)&&ot(ne,de,te[de]);return ne},Tt=(ne,te)=>bt(ne,vt(te)),ct=(ne,te)=>{var de={};for(var se in ne)st.call(ne,se)&&te.indexOf(se)<0&&(de[se]=ne[se]);if(ne!=null&&Oe)for(var se of Oe(ne))te.indexOf(se)<0&&Et.call(ne,se)&&(de[se]=ne[se]);return de},At=(ne,te,de)=>new Promise((se,ge)=>{var ye=_e=>{try{Ce(de.next(_e))}catch(Ze){ge(Ze)}},we=_e=>{try{Ce(de.throw(_e))}catch(Ze){ge(Ze)}},Ce=_e=>_e.done?se(_e.value):Promise.resolve(_e.value).then(ye,we);Ce((de=de.apply(ne,te)).next())});const De=ne=>{var te=ne,{children:de}=te,se=ct(te,["children"]);const[ge,ye]=(0,Ke.useState)(!1);return Ke.createElement(le.ZP,Tt(We({},se),{loading:ge,onClick:we=>At(void 0,null,function*(){try{ye(!0),yield se.onClick(we),ye(!1)}catch(Ce){console.error(Ce),ye(!1)}})}),de)}},54650:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return At}});var le=Le(59301),Ke=Le(6767),it=Le(37568),bt={codeBox:"codeBox___WpkVl"},vt=Le(92310),Oe=Le.n(vt),st=Object.defineProperty,Et=(De,ne,te)=>ne in De?st(De,ne,{enumerable:!0,configurable:!0,writable:!0,value:te}):De[ne]=te,ot=(De,ne,te)=>Et(De,typeof ne!="symbol"?ne+"":ne,te),We=(De,ne,te)=>new Promise((de,se)=>{var ge=Ce=>{try{we(te.next(Ce))}catch(_e){se(_e)}},ye=Ce=>{try{we(te.throw(Ce))}catch(_e){se(_e)}},we=Ce=>Ce.done?de(Ce.value):Promise.resolve(Ce.value).then(ge,ye);we((te=te.apply(De,ne)).next())});class Tt extends le.Component{constructor(ne){super(ne),ot(this,"canvas"),ot(this,"randomNum",(te,de)=>Math.floor(Math.random()*(de-te)+te)),ot(this,"drawPic",()=>{this.randomCode()}),ot(this,"reloadPic",()=>{this.drawPic()}),ot(this,"changeCode",te=>{console.log(te.target.value,222),this.setState({value:te.target.value,showError:!1})}),ot(this,"onVerify",()=>{let te;return this.state.value.toLowerCase()!==""&&this.state.value.toLowerCase()!==this.state.code.toLowerCase()?(te=!0,Ke.ZP.error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801"),this.reloadPic()):this.state.value.toLowerCase()===""?(te=!0,Ke.ZP.error("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801")):this.state.value.toLowerCase()===this.state.code.toLowerCase()&&(te=!1),this.setState({showError:te}),te}),this.canvas=le.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(ne,te){const de=this.randomNum(ne,te),se=this.randomNum(ne,te),ge=this.randomNum(ne,te);return`rgb(${de}, ${se}, ${ge})`}drawText(ne,te,de){ne.fillStyle=this.randomColor(this.state.colorMin,this.state.colorMax);const se=this.randomNum(this.state.fontSizeMin,this.state.fontSizeMax);ne.font=se+"px SimHei";const ge=10,ye=(this.state.contentWidth-40)/(this.state.code.length-1);let we=ge;de>0&&(we=ge+de*ye);let Ce=this.randomNum(this.state.fontSizeMax,this.state.contentHeight-5);se>40&&(Ce=40);const _e=this.randomNum(-10,10);ne.translate(we,Ce),ne.rotate(_e*Math.PI/180),ne.fillText(te,0,0),ne.rotate(-_e*Math.PI/180),ne.translate(-we,-Ce)}drawLine(ne){for(let te=0;te<1;te++)ne.strokeStyle=this.randomColor(this.state.lineColorMin,this.state.lineColorMax),ne.beginPath(),ne.moveTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),ne.lineTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),ne.stroke()}drawDot(ne){for(let te=0;te<100;te++)ne.fillStyle=this.randomColor(0,255),ne.beginPath(),ne.arc(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight),1,0,2*Math.PI),ne.fill()}randomCode(){let ne="";const te="QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890";for(let de=0;de<this.state.codeLength;de++){const se=Math.floor(Math.random()*57);ne+=te[se]}this.setState({code:ne},()=>{const se=this.canvas.current.getContext("2d");se.textBaseline="bottom",se.fillStyle=this.randomColor(this.state.backgroundColorMin,this.state.backgroundColorMax),se.fillRect(0,0,this.state.contentWidth,this.state.contentHeight);for(let ge=0;ge<this.state.code.length;ge++)this.drawText(se,this.state.code[ge],ge);this.drawLine(se),this.drawDot(se)})}render(){const{className:ne,width:te=300}=this.props;return le.createElement("div",{className:Oe()(bt.codeBox,ne),style:{width:te}},le.createElement("aside",null,le.createElement(it.default,{value:this.state.value,onChange:this.changeCode,placeholder:"\u8BF7\u8F93\u5165\u56FE\u7247\u4E2D\u7684\u9A8C\u8BC1\u7801"})),le.createElement("div",null,le.createElement("canvas",{onClick:this.reloadPic,ref:this.canvas,width:"100",height:"30"}),le.createElement("div",{className:"current",onClick:this.reloadPic},"\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u5F20")))}}const ct=(De,ne)=>{let te;Modal.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:React.createElement("div",null,React.createElement("p",null,ne),React.createElement(Tt,{ref:de=>te=de})),onOk:()=>We(void 0,null,function*(){if(te.onVerify())return Promise.reject();De()})})};var At=Tt},30371:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return ot}});var le=Le(59301),Ke=Le(37568),it=Le(96599),bt=Le(6767),vt={flex:"flex___eLcnP",flex1:"flex1___yUTT7",color666:"color666___TiUhG",error:"error___gTTtv",deleteIcon:"deleteIcon___mnZW1",addIcon:"addIcon___JC5NS"},Oe=Le(62772);const{TextArea:st}=Ke.default;class Et extends le.Component{constructor(Tt){super(Tt),this.state={inputVisible:!1,EditInputIndex:-1}}render(){let{index:Tt,onAnswerChange:ct,addChildAnswer:At,exerciseIsPublish:De,answers:ne,activeOptionErrorIndex:te,flex:de="0 0 1000px"}=this.props;console.log("----",ne);let{inputVisible:se,EditInputIndex:ge}=this.state;return le.createElement("div",{className:vt.flex},le.createElement("div",{className:`${vt.color666} mb5 mt6`,style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",Tt+1,"):"),le.createElement("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10}},ne==null?void 0:ne.map((ye,we)=>le.createElement(le.Fragment,null,ge!==we?(ye==null?void 0:ye.length)>0?le.createElement(it.default,{className:"edit-tag",key:ye,closable:!((ne==null?void 0:ne.length)===1&&we===0),onClose:Ce=>{Ce.preventDefault(),(ne==null?void 0:ne.length)===1&&we===0?this.props.deleteChildAnswermain(Tt,we):this.props.deleteChildAnswer(Tt,we)}},le.createElement("span",{onDoubleClick:Ce=>{this.setState({EditInputIndex:we}),Ce.preventDefault()}},ye)):le.createElement(Ke.default,{defaultValue:ye,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Ce=>{if(Ce.target.value.replaceAll(" ","").length<=0){bt.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}ct(Tt,we,Ce.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}):le.createElement(Ke.default,{defaultValue:ye,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Ce=>{if(Ce.target.value.replaceAll(" ","").length<=0){bt.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}ct(Tt,we,Ce.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}))),!se&&le.createElement(it.default,{className:"site-tag-plus",onClick:()=>{At(Tt),this.setState({inputVisible:!0})}},le.createElement(Oe.Z,null)," \u65B0\u589E\u7B54\u6848")))}}var ot=Et},61011:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return De}});var le=Le(59301),Ke=Le(39793),it=Object.defineProperty,bt=Object.defineProperties,vt=Object.getOwnPropertyDescriptors,Oe=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,ot=(ne,te,de)=>te in ne?it(ne,te,{enumerable:!0,configurable:!0,writable:!0,value:de}):ne[te]=de,We=(ne,te)=>{for(var de in te||(te={}))st.call(te,de)&&ot(ne,de,te[de]);if(Oe)for(var de of Oe(te))Et.call(te,de)&&ot(ne,de,te[de]);return ne},Tt=(ne,te)=>bt(ne,vt(te)),ct=(ne,te,de)=>ot(ne,typeof te!="symbol"?te+"":te,de);const At="\u2581";class De extends le.Component{constructor(){super(...arguments),ct(this,"getChCountBeforeCursor",(te,de)=>{const se=de.line;let ge=0;for(let we=0;we<se;we++)ge+=te.getLine(we).split(At).length-1;const ye=te.getLine(se).substring(0,de.ch);return ge+=ye.split(At).length-1,ge}),ct(this,"onCMBeforeChange",(te,de)=>{const se=te.getRange(de.from,de.to);let ge=0;if(de.text.forEach(ye=>{ge+=ye.split(At).length-1}),se&&se.indexOf(At)!=-1){const ye=se.split(At).length-1,we=this.getChCountBeforeCursor(te,de.from);console.log(`\u5220\u9664${ye}\u4E2A\uFF0C \u4E4B\u524D\u6709${we}\u4E2A\uFF0C\u65B0\u589E${ge}\u4E2A`),this.props.deleteEmptyDisabled?de.cancel():this.props.onPlaceholderChange&&this.props.onPlaceholderChange(we,ye,ge)}else if(ge){const ye=this.getChCountBeforeCursor(te,de.from);console.log(`\u65B0\u589E${ge}\u4E2A\uFF0C\u4E4B\u524D\u6709${ye}\u4E2A`),this.props.onPlaceholderChange&&this.props.onPlaceholderChange(ye,0,ge)}})}render(){return le.createElement(Ke.Z,Tt(We({},this.props),{onCMBeforeChange:this.onCMBeforeChange}))}}},81868:function(Zn,ei,Le){"use strict";Le.d(ei,{d4:function(){return At},VP:function(){return ot}});var le=Le(59301),Ke={digitalLabel:"digitalLabel___hkWuZ",active:"active___jawU1",titleEditor:"titleEditor___wX1lW",title:"title___SuT2h",editIcon:"editIcon___XrTIi",paperTab:"paperTab___GUxeB",tabItem:"tabItem___or0fY",dottedLine:"dottedLine___Ln0Xr"};const it=({number:De,active:ne,className:te})=>le.createElement("div",{className:`${Ke.digitalLabel} ${ne?Ke.active:""} ${te}`},De);var bt=Le(25399),vt=Le(37568),Oe=Le(6767),st=Le(59301),Et=(De,ne,te)=>new Promise((de,se)=>{var ge=Ce=>{try{we(te.next(Ce))}catch(_e){se(_e)}},ye=Ce=>{try{we(te.throw(Ce))}catch(_e){se(_e)}},we=Ce=>Ce.done?de(Ce.value):Promise.resolve(Ce.value).then(ge,ye);we((te=te.apply(De,ne)).next())});const ot=({defaultValue:De,onFinish:ne})=>{const[te,de]=(0,le.useState)(!1),[se,ge]=(0,le.useState)(De);return(0,le.useEffect)(()=>{ge(De)},[De]),st.createElement("div",{className:Ke.titleEditor},te?st.createElement(vt.default,{autoFocus:!0,maxLength:60,style:{textAlign:"center",marginTop:20,marginBottom:20},value:se,onChange:ye=>{ge(ye.target.value)},onBlur:()=>Et(void 0,null,function*(){var ye;if(((ye=se==null?void 0:se.replaceAll(" ",""))==null?void 0:ye.length)<=0){Oe.ZP.error("\u8BD5\u5377\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A");return}(yield ne(se))&&de(!1)}),onPressEnter:()=>Et(void 0,null,function*(){var ye;if(((ye=se==null?void 0:se.replaceAll(" ",""))==null?void 0:ye.length)<=0){Oe.ZP.error("\u8BD5\u5377\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A");return}(yield ne(se))&&de(!1)})}):st.createElement("div",{className:Ke.title,onDoubleClick:()=>de(!0)},se,st.createElement(bt.Z,{title:"\u7F16\u8F91\u8BD5\u5377\u540D\u79F0"},st.createElement("i",{className:`${Ke.editIcon} iconfont icon-bianji_Hover`,onClick:()=>de(!0)}))))};var We=Le(77019),Tt=Le(5269),ct=(De,ne,te)=>new Promise((de,se)=>{var ge=Ce=>{try{we(te.next(Ce))}catch(_e){se(_e)}},ye=Ce=>{try{we(te.throw(Ce))}catch(_e){se(_e)}},we=Ce=>Ce.done?de(Ce.value):Promise.resolve(Ce.value).then(ge,ye);we((te=te.apply(De,ne)).next())});const At=({onChange:De=()=>ct(void 0,null,function*(){}),tabs:ne,activeKey:te,defaultActiveKey:de,className:se=""})=>{var ge,ye,we,Ce,_e,Ze,lt;const[Qe,Ue]=(0,le.useState)(de===void 0?(ge=ne[0])==null?void 0:ge.key:de);return(0,le.useEffect)(()=>{te!==void 0&&Ue(te)},[te]),le.createElement(We.Z,{justify:"center",align:"middle",className:`${Ke.paperTab} ${se}`},le.createElement(Tt.Z,{className:`${Ke.tabItem} ${Qe===((ye=ne[0])==null?void 0:ye.key)?Ke.active:""}`,onClick:()=>ct(void 0,null,function*(){var dt;yield De(ne[0].key),Ue((dt=ne[0])==null?void 0:dt.key)})},le.createElement(it,{number:1,active:Qe===((we=ne[0])==null?void 0:we.key),className:"mr10"}),le.createElement("span",null,(Ce=ne[0])==null?void 0:Ce.label)),le.createElement(Tt.Z,{flex:"188px",className:`${Ke.dottedLine} ml30 mr30`}),le.createElement(Tt.Z,{className:`${Ke.tabItem} ${Qe===((_e=ne[1])==null?void 0:_e.key)?Ke.active:""}`,onClick:()=>ct(void 0,null,function*(){var dt,$e;yield De((dt=ne[1])==null?void 0:dt.key),Ue(($e=ne[1])==null?void 0:$e.key)})},le.createElement(it,{number:2,active:Qe===((Ze=ne[1])==null?void 0:Ze.key),className:"mr10"}),le.createElement("span",null,(lt=ne[1])==null?void 0:lt.label)))}},94361:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Oe}});var le=Le(37639),Ke={text:"text___FxbAX",wrap:"wrap___UlBQ1",contact:"contact____pUDq",img:"img___BapAv"},it=Le(32637),bt=Le(59301),Oe=({type:st,style:Et})=>{const ot=bt.createElement("div",{className:Ke.wrap,onClick:We=>{We.preventDefault(),We.stopPropagation()}},bt.createElement("p",null,st==="shixun"||st==="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",bt.createElement("br",null),"\u6839\u636E\u5E73\u53F0\u4F7F\u7528\u89C4\u5219\uFF0C\u9700\u8981\u6388\u6743\u624D\u80FD\u4F7F\u7528\u3002",st==="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"),bt.createElement("div",{className:Ke.contact},bt.createElement("div",{className:Ke.img},bt.createElement("img",{src:it,width:"124px",height:"124px"})),bt.createElement("div",{className:"tc font14 mt10",style:{color:"#777A93"}},"\u626B\u4E00\u626B\uFF0C\u83B7\u53D6\u6388\u6743\u7801")));return bt.createElement(le.Z,{content:ot},bt.createElement("span",{className:Ke.text,style:Et},"\u9AD8\u6D88\u8017"))}},9507:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Tt}});var le=Le(59301),Ke={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},it=Le(92310),bt=Le.n(it),vt=Le(29787),Oe=Le(2859),st=Le(38986),Et=Le(51257),ot=(ct,At,De)=>new Promise((ne,te)=>{var de=ye=>{try{ge(De.next(ye))}catch(we){te(we)}},se=ye=>{try{ge(De.throw(ye))}catch(we){te(we)}},ge=ye=>ye.done?ne(ye.value):Promise.resolve(ye.value).then(de,se);ge((De=De.apply(ct,At)).next())}),Tt=({data:ct,className:At,fullWidth:De,style:ne={},onClose:te,onOk:de,showFullTools:se,noAssociationId:ge})=>{const ye=(0,le.useRef)(null),we=(0,le.useRef)(null),Ce=(0,le.useRef)(null),_e=(0,le.useRef)(null),[Ze,lt]=(0,le.useState)(!1),[Qe,Ue]=(0,le.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,le.useEffect)(()=>(Ce.current||(Ce.current=document.createElement("style"),document.head.appendChild(Ce.current)),ct!=null&&ct.visible?(document.body.setAttribute("data-custom","y-hidden"),Ce.current.innerHTML=" html { overflow-y: hidden; }",ct!=null&&ct.src&&dt()):(document.body.removeAttribute("data-custom"),Ce.current&&(document.head.removeChild(Ce.current),Ce.current=null)),()=>{document.body.removeAttribute("data-custom"),Ce.current&&(document.head.removeChild(Ce.current),Ce.current=null)}),[ct==null?void 0:ct.visible]);const dt=()=>ot(void 0,null,function*(){lt(!0),Ue("\u6B63\u5728\u52A0\u8F7D\u4E2D");const Lt=yield(0,Et.ZJ)(ct==null?void 0:ct.src);ye.current.src="",ye.current.src=Lt,ye.current.onload=function(){St()},lt(!1),Ue("")}),$e=Lt=>ot(void 0,null,function*(){lt(!0),Ue("\u6B63\u5728\u4FDD\u5B58\u4E2D");const pn=yield(0,st.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:ct.title,file:Lt.dataUrl}});pn!=null&&pn.id&&!ge?(yield(0,st.ZP)(`/api/attachments/${ct.id}/add_subitem.json`,{method:"post",body:{subitem_id:pn==null?void 0:pn.id,settings:JSON.stringify(Lt.state)}})).status===0&&de():pn!=null&&pn.id&&de(pn),lt(!1),Ue("")}),wt=()=>{const Lt=document.querySelector('a[href="https://markerjs.com/"]');Lt&&Lt.parentNode&&(Lt.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(en=>{const vn=document.querySelector(en.name);vn&&vn.setAttribute("title",en.title)})},St=()=>{we.current=new Oe.hP(ye.current),we.current.targetRoot=_e.current,we.current.addEventListener("render",$e),we.current.addEventListener("beforeclose",te),se&&(we.current.availableMarkerTypes=we.current.ALL_MARKER_TYPES,we.current.uiStyleSettings.redoButtonVisible=!0,we.current.uiStyleSettings.notesButtonVisible=!0,we.current.uiStyleSettings.zoomButtonVisible=!0,we.current.uiStyleSettings.zoomOutButtonVisible=!0,we.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=we.current.uiStyleSettings,we.current.show(),ct!=null&&ct.snapshotData&&we.current.restoreState(ct.snapshotData),setTimeout(()=>{window.scrollTo(0,0),wt()},300)};return le.createElement(le.Fragment,null,(ct==null?void 0:ct.visible)&&le.createElement(vt.Z,{spinning:Ze,tip:Qe,style:{position:"absolute",width:"100vw"}},le.createElement("div",{ref:_e,className:bt()(Ke.imageDimensions,At,De?Ke.fullWidth:""),style:ne},le.createElement("img",{className:Ke.img,ref:ye}))))}},19105:function(Zn,ei,Le){"use strict";var le=Le(59301),Ke=Le(99587),it=Le(48136),bt=Le(76562),vt=Le(62957),Oe=Le(59301);const st=(0,le.forwardRef)(({callback:Et,width:ot,onChange:We,disabled:Tt,readOnly:ct,type:At="",value:De="",style:ne={}},te)=>{const de=(0,le.useRef)(),se=(0,le.useRef)(),[ge,ye]=(0,le.useState)(0),[we,Ce]=(0,le.useState)(0),[_e,Ze]=(0,le.useState)(!1),lt=()=>{var $e=document.createElement("div");$e.innerHTML=de.current.getValue();var wt=$e.innerText;return Et&&Et(wt),wt};(0,le.useImperativeHandle)(te,()=>({getData:lt}));const Qe=$e=>{$e.preventDefault();const wt=$e.clientX-ge,St=$e.clientY-we;document.body.onmousemove=Lt=>{let pn=Lt.clientX-wt,en=Lt.clientY-St;const vn=document.getElementsByClassName("markdown-popup-form")[0],rn=window.innerWidth-vn.offsetWidth,nt=window.innerHeight-vn.offsetHeight;pn=Math.max(0,Math.min(pn,rn)),en=Math.max(0,Math.min(en,nt)),Ue(Lt.clientX,Lt.clientY,wt,St)&&(ye(pn),Ce(en))},document.body.onmouseup=function(){document.body.onmousemove=null}},Ue=($e,wt,St,Lt)=>{const pn=document.body.clientHeight,en=document.body.clientWidth;return $e<20&&St>$e||$e>en-20&&St<$e||wt<20&&Lt>wt||wt>pn-20&&Lt<wt?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};(0,le.useEffect)(()=>{_e&&setTimeout(()=>{const $e=document.getElementsByClassName("markdown-popup-form")[0],wt=window.innerWidth/2-$e.offsetWidth/2,St=window.innerHeight/2-$e.offsetHeight/2;ye(wt),Ce(St)},0)},[_e]);const dt=()=>{Tt||ct||Ze(!0)};return Oe.createElement("div",{style:ne},Oe.createElement("div",{style:{width:ot||"100%",position:"relative"},className:`${Ke.Z.mathFillWrap} ${Tt||ct?"cursorDefault":""}`,onClick:()=>dt()},Oe.createElement("math-field",{disabled:Tt,locale:"zh_cn",class:`${Ke.Z.mathField} ${At}`,readOnly:ct,placeholder:"\u8BF7\u8F93\u5165\u516C\u5F0F",ref:de,style:{width:"100%",fontSize:De?18:14},value:De||""})),Oe.createElement(vt.default,{maskClosable:!1,centered:!0,width:860,style:{position:"absolute",left:ge,top:we},title:Oe.createElement("div",{style:{cursor:"move"},onMouseDown:Qe},"\u8F93\u5165\u516C\u5F0F"),open:_e,onOk:()=>{const $e=se.current.getData();de.current.setValue($e),We($e),Ze(!1)},onCancel:()=>{Ze(!1)},destroyOnClose:!0,className:"markdown-popup-form"},Oe.createElement(bt.Z,{value:De,ref:se,onChange:We,showSaveButton:!1})))});ei.Z=st},76562:function(Zn,ei,Le){"use strict";var le=Le(59301),Ke=Le(77019),it=Le(5269),bt=Le(20554),vt=Le(99571),Oe=Le(76902),st=Le(99587),Et=Le(48136),ot=Le(59301);const We=(0,le.forwardRef)(({callback:Tt,showSaveButton:ct,value:At=""},De)=>{const ne=(0,le.useRef)(),te=[{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 "}]}]}],de=[{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}`}]}]}],se=we=>{ne.current.setValue(ne.current.getValue()+" "+we.value+" ")},ge=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:ot.createElement(Ke.Z,{className:st.Z.lists,gutter:[10,10]},te.map((we,Ce)=>ot.createElement(it.Z,{flex:"110px",className:st.Z.item},ot.createElement("div",null,ot.createElement(Oe.Z,{value:`$$${we.value}$$`}),we.name),ot.createElement("div",{className:st.Z.children},we.children.map((_e,Ze)=>ot.createElement("div",{key:Ze},ot.createElement("h1",null,_e.name),ot.createElement(Ke.Z,{gutter:[10,10]},_e.data.map((lt,Qe)=>ot.createElement(it.Z,{key:Qe,onClick:()=>se(lt),className:st.Z.diamond},ot.createElement(Oe.Z,{value:"`$$"+lt.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:ot.createElement(Ke.Z,{className:st.Z.lists,gutter:[10,10]},de.map((we,Ce)=>ot.createElement(it.Z,{flex:"110px",className:st.Z.item},ot.createElement("div",null,ot.createElement(Oe.Z,{value:"`$$"+we.value+"$$`"}),we.name),ot.createElement("div",{className:st.Z.children},we.children.map((_e,Ze)=>ot.createElement("div",{key:Ze},_e.name&&ot.createElement("h1",null,_e.name),ot.createElement(Ke.Z,{gutter:[10,10]},_e.data.map((lt,Qe)=>ot.createElement(it.Z,{key:Qe,onClick:()=>se(lt),className:st.Z.diamond},ot.createElement(Oe.Z,{value:"`$$"+lt.value+"$$`"}))))))))))}],ye=()=>{var we=document.createElement("div");we.innerHTML=ne.current.getValue();var Ce=we.innerText;return Tt&&Tt(Ce),Ce};return(0,le.useImperativeHandle)(De,()=>({getData:ye})),ot.createElement("div",{className:st.Z.mathWrap},ot.createElement(bt.default,{defaultActiveKey:"1",items:ge}),ot.createElement("math-field",{locale:"zh_cn",className:st.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:ne,style:{width:800,marginTop:30,fontSize:18}},At||""),ct&&ot.createElement("div",{className:st.Z.button},ot.createElement(vt.ZP,{size:"large",onClick:ye,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});ei.Z=We},28426:function(Zn,ei,Le){"use strict";var le=Le(59301),Ke=Le(93314),it=Le(99571),bt=Object.defineProperty,vt=Object.defineProperties,Oe=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,Et=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,We=(De,ne,te)=>ne in De?bt(De,ne,{enumerable:!0,configurable:!0,writable:!0,value:te}):De[ne]=te,Tt=(De,ne)=>{for(var te in ne||(ne={}))Et.call(ne,te)&&We(De,te,ne[te]);if(st)for(var te of st(ne))ot.call(ne,te)&&We(De,te,ne[te]);return De},ct=(De,ne)=>vt(De,Oe(ne));const At=({img:De,buttonProps:ne={},styles:te={},customText:de,ButtonText:se,ButtonClick:ge,Buttonclass:ye,ButtonTwo:we,imgStyles:Ce,loading:_e=!1,className:Ze=""})=>le.createElement("section",{className:`tc animated fadeIn ${Ze}`,style:Tt({color:"#999",margin:"100px auto",visibility:_e?"hidden":"visible"},te)},le.createElement("img",{src:De||Ke,style:ct(Tt({},Ce),{pointerEvents:"none",userSelect:"none"})}),le.createElement("p",{className:"mt20 font14"},de||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),se&&le.createElement(it.ZP,Tt({className:ye,onClick:ge},ne),se),we&&we);ei.Z=At},45677:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return ye}});var le=Le(59301),Ke={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},it=Le(99571),bt=Le(70557),vt=Le(75975),Oe=Le(25399),st=Le(51257),Et=Le(81722),ot=Le(28426),We=Le(346),Tt=Le(44203),ct=Le(59301),At=Object.defineProperty,De=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,de=(we,Ce,_e)=>Ce in we?At(we,Ce,{enumerable:!0,configurable:!0,writable:!0,value:_e}):we[Ce]=_e,se=(we,Ce)=>{for(var _e in Ce||(Ce={}))ne.call(Ce,_e)&&de(we,_e,Ce[_e]);if(De)for(var _e of De(Ce))te.call(Ce,_e)&&de(we,_e,Ce[_e]);return we},ge=(we,Ce,_e)=>new Promise((Ze,lt)=>{var Qe=$e=>{try{dt(_e.next($e))}catch(wt){lt(wt)}},Ue=$e=>{try{dt(_e.throw($e))}catch(wt){lt(wt)}},dt=$e=>$e.done?Ze($e.value):Promise.resolve($e.value).then(Qe,Ue);dt((_e=_e.apply(we,Ce)).next())}),ye=({editOffice:we="view",data:Ce,issaver:_e,onSaver:Ze,theme:lt,type:Qe,filename:Ue,monacoEditor:dt,className:$e,style:wt,close:St,onClose:Lt,hasMask:pn,disabledDownload:en,onImgDimensions:vn,showNodata:rn,recordInfo:nt})=>{const[rt,dn]=(0,le.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[ri,Hn]=(0,le.useState)(""),[Wt,En]=(0,le.useState)(),An=window.ENV==="build"?"/react/build":"",ci=location.host.startsWith("localhost")?We.Z.PROXY_SERVER:We.Z.API_SERVER,Pt=10*(1024*1024),Nt=(0,le.useRef)();Ce!=null&&Ce.startsWith("/api")&&Qe!=="txt"&&(Ce=We.Z.API_SERVER+Ce);const ii=Te=>Te.substring(Te.lastIndexOf("/")+1).split(".").pop();Ue&&dt&&(dt.filename=Ue),(0,le.useEffect)(()=>{var Te,He;const Ae=(He=(Te=document.cookie)==null?void 0:Te.replace(/\s/g,""))==null?void 0:He.split(";");Ae==null||Ae.map(qe=>{let an=qe.split("=");an[0]==="_educoder_session"&&Hn(an[1])})},[]),(0,le.useEffect)(()=>{Qe==="office"&&(Ce.indexOf("bigfilescdn.")>-1||Ce.indexOf("bigfiles1")>-1?En({url:Ce,fileType:ii(Ce),model:Ce.indexOf("model=edit")?"edit":"view"}):ze())},[Qe,Ce]);function Gi(Te){return ge(this,null,function*(){Te.data.type==="pdfdata"&&(Ze(Te.data.data),window.removeEventListener("message",Gi,!1)),console.log("mess---:",Te.data)})}const ze=()=>ge(void 0,null,function*(){console.log("data:",Ce);let Te=Ce;Ce.startsWith("http")||(Te=location.origin+Te);let He=new URL(Te).pathname.split("/").pop();const Ae=yield(0,Et.gJ)({attachment_id:He});Ae.url=ci+Ae.url,En(Ae)}),Me=()=>{if(Ce.startsWith("http")||Ce.startsWith("blob:")){Ee();return}(0,st.Sv)(Ue||"educoder",Ce,Ue)},Ee=()=>{nt&&(0,Tt.fc)({id:nt==null?void 0:nt.id,watch_type:1,course_id:nt==null?void 0:nt.course_id}),(0,st.Nd)(Ue||"educoder",decodeURIComponent(Ce))};return ct.createElement("div",{style:se({},wt||{}),className:`${pn&&Ke.bgBlack} ${Qe?Ke.wrp:"hide"}`},St&&ct.createElement("div",{className:Ke.close,ref:Nt},!!vn&&ct.createElement(Oe.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Nt.current},ct.createElement("span",{onClick:()=>{Lt(),vn()}},ct.createElement("i",{className:"icon-yulanpizhu"}))),!en&&ct.createElement(Oe.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Nt.current},ct.createElement("span",{onClick:Ee},ct.createElement("i",{className:"icon-quxiaozhiding"}))),_e&&ct.createElement(Oe.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>Nt.current},ct.createElement("span",{className:"",onClick:()=>{const Te=document.getElementById("pdfiframe");window.addEventListener("message",Gi,!1),setTimeout(()=>{Te.contentWindow.postMessage("getData","*")},300)}},ct.createElement("i",{className:"icon-baocun"}))),ct.createElement(Oe.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Nt.current},ct.createElement("span",{className:"",onClick:()=>{Lt()}},ct.createElement("i",{className:"icon-guanbi1"})))),ct.createElement("div",{className:`${Ke[$e]} ${$e} ${Ke.monaco} ${Qe==="txt"?"show":"hide"}`},Qe==="txt"&&ct.createElement(ct.Fragment,null,ct.createElement(vt.ZP,se({},dt)))),Qe==="audio"&&ct.createElement("audio",{src:`${(Ce==null?void 0:Ce.indexOf("http://"))>-1||(Ce==null?void 0:Ce.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${Ce}`,autoPlay:!0}),Qe==="video"&&ct.createElement(ct.Fragment,null,(Ce==null?void 0:Ce.indexOf("http"))>-1?ct.createElement("video",{controls:!0,src:`${Ce}`,autoPlay:!0}):ct.createElement("video",{controls:!0,src:`data:video/mp4;base64,${Ce}`,autoPlay:!0})),Qe==="office"&&Wt&&ct.createElement("iframe",{src:`${An}/office.html?key=${Wt.key}&url=${btoa(Wt.url)}&callbackUrl=${ci+(Wt.callbackUrl||"")}&fileType=${Wt.fileType}&title=${Wt.title||""}&model=${we}&officeServer=${We.Z.ONLYOFFICE}&disabledDownload=${!!en}`}),Qe==="html"&&ct.createElement("iframe",{src:Ce+"&disposition=inline"}),Qe==="pdf"&&ct.createElement("iframe",{id:"pdfiframe",src:`${An}/js/pdfview/index.html?filename=${Ue||"educoder.pdf"}&url=${encodeURIComponent(Ce)}&disabledDownload=${!!en}&model=${we}`}),Qe==="image"&&ct.createElement("img",{src:`${(Ce==null?void 0:Ce.indexOf("http://"))>-1||(Ce==null?void 0:Ce.indexOf("https://"))>-1?"":"data:image/png;base64,"}${Ce}`}),(Qe==="other"||Qe==="download")&&ct.createElement(ct.Fragment,null,rn?ct.createElement(ot.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:ct.createElement(it.ZP,{icon:ct.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Me,disabled:en},"\u4E0B\u8F7D")}):ct.createElement(it.ZP,{type:"primary",size:"middle",onClick:Me,disabled:en},ct.createElement(bt.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},68571:function(Zn,ei,Le){"use strict";Le.d(ei,{t:function(){return Ee}});var le=Le(59301),Ke=Le(37568),it=Le(28284),bt=Le(62957),vt=Le(77019),Oe=Le(5269),st=Le(71051),Et=Le(82326),ot=Le(47889),We=Le(31457),Tt=Le(25690),ct=Le(8423),At=Le(6767),De=Le(99571),ne=Le(29787),te=Le(24334),de={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"},se=Le(38986),ge=Le(81072),ye=Le(39793),we=Le(56102),Ce=Le(37345),_e=Le(59301),Ze=Object.defineProperty,lt=Object.defineProperties,Qe=Object.getOwnPropertyDescriptors,Ue=Object.getOwnPropertySymbols,dt=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,wt=(Te,He,Ae)=>He in Te?Ze(Te,He,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):Te[He]=Ae,St=(Te,He)=>{for(var Ae in He||(He={}))dt.call(He,Ae)&&wt(Te,Ae,He[Ae]);if(Ue)for(var Ae of Ue(He))$e.call(He,Ae)&&wt(Te,Ae,He[Ae]);return Te},Lt=(Te,He)=>lt(Te,Qe(He)),pn=(Te,He,Ae)=>new Promise((qe,an)=>{var Xt=Dt=>{try{kt(Ae.next(Dt))}catch(Zt){an(Zt)}},yn=Dt=>{try{kt(Ae.throw(Dt))}catch(Zt){an(Zt)}},kt=Dt=>Dt.done?qe(Dt.value):Promise.resolve(Dt.value).then(Xt,yn);kt((Ae=Ae.apply(Te,He)).next())}),vn=({buttonProps:Te,buttonText:He,form:Ae,hackIdentifier:qe="",answerKey:an,data:Xt})=>{const[yn,kt]=(0,le.useState)(!1),[Dt,Zt]=(0,le.useState)(!1),[hn,wn]=(0,le.useState)(!1),[Dn,Tn]=(0,le.useState)({}),[Mi,tn]=(0,le.useState)(""),[qt,un]=(0,le.useState)(""),zn=(0,le.useRef)(qe),on=(0,le.useRef)(""),Sn=(0,le.useRef)(!1);(0,le.useEffect)(()=>{hn&&Hi()},[hn]),(0,le.useEffect)(()=>()=>{sessionStorage.removeItem("projectFill")},[]);const di=()=>new Date().getTime(),Ui=Xt==null?void 0:Xt.code,gi=()=>{var On,Xn;let wi=Ui?Xt==null?void 0:Xt.code:(On=Ae.getFieldValue("hack_codes"))==null?void 0:On.code,nr=Ui?Xt==null?void 0:Xt.answer_content:Ae.getFieldValue(an),ji=Ui?Xt==null?void 0:Xt.input:(Xn=Ae.getFieldValue("hack_sets"))==null?void 0:Xn.input;nr==null||nr.forEach(Cr=>{const be=Cr.value||Cr.answer_text||"";wi=wi.replace(/(@▁@|@▁▁@)/,be)}),un(ji),tn(wi),Tn({}),wn(!0)},Hi=()=>pn(void 0,null,function*(){var On,Xn,wi,nr;const ji=di(),Cr=Ui?Xt==null?void 0:Xt.time_limit:(On=Ae.getFieldsValue())==null?void 0:On.hack.time_limit,be=Ui?(Xn=Xt==null?void 0:Xt.answer_content)==null?void 0:Xn.length:(nr=(wi=Ae.getFieldsValue())==null?void 0:wi.standard_answers)==null?void 0:nr.length;kt(!0),yield(0,ge.bM)(on.current,{test_hack_code:Mi,test_input:qt});function mn(){return pn(this,null,function*(){const{status:fi,data:Vn}=yield(0,ge.rX)(on.current,"submit"),Di=di()-ji>(Cr+3)*1e3*be;if(Sn.current){if(Di){At.ZP.error("\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"),kt(!1);return}if(fi===0){kt(!1),Tn(Lt(St({},Vn),{showText:!0}));return}setTimeout(mn,1e3)}})}mn()}),kr=()=>pn(void 0,null,function*(){var On,Xn,wi,nr,ji,Cr,be;if(!Xt){try{yield Ae.validateFields()}catch(si){(wi=(Xn=(On=si==null?void 0:si.errorFields)==null?void 0:On[0])==null?void 0:Xn.name)!=null&&wi.includes("standard_answers")?At.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):At.ZP.error(si.errorFields[0].errors[0]),Ae.scrollToField(si.errorFields[0].name,{behavior:"smooth",block:"center"});return}Zt(!0);let fi="";const Vn=Ae.getFieldsValue();zn.current?fi=yield(0,se.ZP)(`/api/problems/${zn.current}.json`,{method:"put",body:Lt(St({},Vn),{hack:Lt(St({},Vn==null?void 0:Vn.hack),{sub_discipline_id:(be=(Cr=Vn==null?void 0:Vn.hack)==null?void 0:Cr.sub_discipline_id)==null?void 0:be[1],difficult:Vn.difficulty,item_banks_group_id:Vn.item_banks_group_id}),hack_codes:Lt(St({},Vn.hack_codes),{code:te.Base64.encode(Vn.hack_codes.code)}),update_hack_sets:[St({},Vn.hack_sets)],is_blank:!0,item_type:"BPROGRAM"})}):(fi=yield(0,se.ZP)("/api/problems.json",{method:"post",body:Lt(St({},Vn),{hack:Lt(St({},Vn==null?void 0:Vn.hack),{sub_discipline_id:(ji=(nr=Vn==null?void 0:Vn.hack)==null?void 0:nr.sub_discipline_id)==null?void 0:ji[1],difficult:Vn.difficulty,item_banks_group_id:Vn.item_banks_group_id}),hack_codes:Lt(St({},Vn.hack_codes),{code:te.Base64.encode(Vn.hack_codes.code)}),hack_sets:[St({},Vn.hack_sets)],is_blank:!0,item_type:"BPROGRAM"})}),zn.current=fi==null?void 0:fi.identifier,sessionStorage.projectFill=fi==null?void 0:fi.identifier)}const mn=yield(0,se.ZP)(`/api/problems/${zn.current}/start.json`,{method:"get"});if((mn==null?void 0:mn.status)===0){on.current=mn==null?void 0:mn.identifier,Sn.current=!0,Zt(!1),gi();return}Zt(!1)}),Gn=On=>{const{status:Xn,error_msg:wi,execute_time:nr,output:ji,input:Cr,expected_output:be}=On;let mn=null;switch(Xn){case Ce.h.OK:mn=_e.createElement(_e.Fragment,null,_e.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",nr/1e3,"\u79D2"),_e.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A\u8C03\u8BD5\u901A\u8FC7"));break;case Ce.h.NOMATCH:mn=_e.createElement(_e.Fragment,null,_e.createElement("div",null,"\u8F93\u5165\uFF1A"),_e.createElement("pre",{style:{fontFamily:"initial"}},Cr),_e.createElement("div",null,"\u8F93\u51FA\uFF1A"),_e.createElement("pre",{style:{fontFamily:"initial"}},ji&&te.Base64.decode(ji)),_e.createElement("div",null,"\u9884\u671F\u8F93\u51FA\uFF1A"),_e.createElement("pre",{style:{fontFamily:"initial"}},be&&te.Base64.decode(be)));break;case Ce.h.EXECUTEFAILURE:mn=_e.createElement(_e.Fragment,null,_e.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",_e.createElement("pre",null,Cr)),_e.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),_e.createElement("pre",{className:"error"},te.Base64.decode(wi)));break;case Ce.h.COMPILEFAILURE:mn=_e.createElement(_e.Fragment,null,_e.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",_e.createElement("pre",null,Cr)),_e.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),_e.createElement("pre",{className:"error"},te.Base64.decode(wi)));break;case Ce.h.PODFAILURE:mn=_e.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case Ce.h.TIMEOUT:mn=_e.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return _e.createElement(_e.Fragment,null," ",mn," ")};return _e.createElement("div",null,_e.createElement(De.ZP,Lt(St({loading:Dt},Te),{onClick:kr}),He),_e.createElement(bt.default,{open:hn,title:"\u8C03\u8BD5\u4EE3\u7801",destroyOnClose:!0,width:1200,okText:"\u8FD0\u884C\u6D4B\u8BD5",confirmLoading:yn,cancelButtonProps:{style:{display:"none"}},onOk:()=>Hi(),onCancel:()=>{Sn.current=!1,wn(!1)}},_e.createElement("div",{className:de.result},_e.createElement("div",{className:de.left},_e.createElement("div",{className:"mb20"},_e.createElement("span",{className:"c-black"},"\u6267\u884C\u4EE3\u7801"),!Xt&&_e.createElement(we.CopyToClipboard,{text:Mi,onCopy:()=>At.ZP.success("\u590D\u5236\u6210\u529F")},_e.createElement("span",{style:{float:"right"},className:"current c-light-primary"},_e.createElement("i",{className:"iconfont icon-fuzhi8 mr5"}),"\u590D\u5236"))),_e.createElement(ye.Z,{height:510,className:"mb0",hidetoolBar:!0,defaultValue:Mi,onChange:On=>tn(On)})),_e.createElement("div",{className:de.right},_e.createElement("div",{className:"c-black mb20"},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B"),_e.createElement("div",{className:de.box},_e.createElement("div",{className:de.li},_e.createElement(Ke.default.TextArea,{placeholder:"\u8BF7\u8F93\u5165",value:qt,onChange:On=>un(On.target.value),bordered:!1,style:{height:180}}))),_e.createElement("div",{className:"c-black mb20 mt30"},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"),_e.createElement("div",{className:de.box},_e.createElement(ne.Z,{spinning:yn,tip:"\u4EE3\u7801\u6267\u884C\u4E2D"},_e.createElement("div",{className:de.li,style:{height:196,overflow:"auto",padding:10}},Gn(Dn))))))))},rn=Le(87169),nt=Le(59301),rt=Object.defineProperty,dn=Object.defineProperties,ri=Object.getOwnPropertyDescriptors,Hn=Object.getOwnPropertySymbols,Wt=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,An=(Te,He,Ae)=>He in Te?rt(Te,He,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):Te[He]=Ae,ci=(Te,He)=>{for(var Ae in He||(He={}))Wt.call(He,Ae)&&An(Te,Ae,He[Ae]);if(Hn)for(var Ae of Hn(He))En.call(He,Ae)&&An(Te,Ae,He[Ae]);return Te},It=(Te,He)=>dn(Te,ri(He)),Pt=(Te,He)=>{var Ae={};for(var qe in Te)Wt.call(Te,qe)&&He.indexOf(qe)<0&&(Ae[qe]=Te[qe]);if(Te!=null&&Hn)for(var qe of Hn(Te))He.indexOf(qe)<0&&En.call(Te,qe)&&(Ae[qe]=Te[qe]);return Ae};const{TextArea:Nt}=Ke.default,ii=[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"}],Gi=({value:Te,onChange:He})=>nt.createElement(Switch,{checked:Te,onChange:Ae=>{He(Ae)}}),ze="@\u2581@",Me="@\u2581\u2581@",Ee=({questionTitlePlaceholder:Te,form:He,scoreByBlank:Ae=!1,hackidentifier:qe,answerKey:an})=>{const[Xt,yn]=(0,le.useState)(!1),[kt,Dt]=(0,le.useState)(!1),hn=(0,Tt.useParams)().type==="edit",wn=(on,Sn)=>{const di=Sn.line;let Ui=0;for(let Hi=0;Hi<di;Hi++)Ui+=on.getLine(Hi).split(ze).length-1;for(let Hi=0;Hi<di;Hi++)Ui+=on.getLine(Hi).split(Me).length-1;const gi=on.getLine(di).substring(0,Sn.ch);return Ui+=gi.split(ze).length-1,Ui+=gi.split(Me).length-1,Ui},Dn=(on,Sn,di,Ui)=>{const gi=on.getRange(Sn.from,Sn.to);let Hi=0;if(Sn.text.forEach(kr=>{Hi+=kr.split(ze).length-1}),Sn.text.forEach(kr=>{Hi+=kr.split(Me).length-1}),Sn.origin!=="setValue"){if(gi&&(gi.indexOf(ze)!==-1||gi.indexOf(Me)!==-1)){const kr=gi.split(ze).length-1+gi.split(Me).length-1,Gn=wn(on,Sn.from);if(console.log(`\u5220\u9664${kr}\u4E2A\uFF0C \u524D\u9762\u6709${Gn}\u4E2A\uFF0C\u65B0\u589E${Hi}\u4E2A`),kr>1){const On=Array.from({length:kr},(Xn,wi)=>Gn+wi);Ui(On)}else Ui(Gn)}else if(Hi>0){const kr=wn(on,Sn.from);console.log(`\u65B0\u589E${Hi}\u4E2A\uFF0C\u4E4B\u524D\u6709${kr}\u4E2A`),di(Hi,kr)}}},Tn=()=>{const on=He.getFieldValue(an);He.setFieldsValue({[an]:on==null?void 0:on.map((Sn,di)=>It(ci({},Sn),{position:di+1}))})},Mi=(0,le.useRef)(),tn=(on,Sn)=>{for(let di=0;di<on;di++)Mi.current({position:null,answer_text:""},Sn+di);Tn()},qt=(0,le.useRef)(),un=on=>{qt.current(on),Tn()},zn=it.default.useWatch(an,He);return nt.createElement("div",{className:ct.Z.wrap},nt.createElement(it.default.Item,{label:"\u8BD5\u9898\u63CF\u8FF0",name:["hack","description"],style:{display:"table"},className:"w100",labelCol:{span:24},rules:[{required:!0}]},nt.createElement(We.h,{scrollId:"name",watch:!0,height:140})),nt.createElement("div",{className:ct.Z.questionTitleEditorWrap},nt.createElement(it.default.Item,{label:"\u7A0B\u5E8F\u4EE3\u7801",name:["hack_codes","code"],labelCol:{span:24},rules:[{required:!0}]},nt.createElement(We.h,{scrollId:"name",watch:!0,height:400,showNullProgramButton:!0,onChange:(on,Sn)=>{const di=He.getFieldValue(an);console.log("--preAnswerData",di,Sn),He.setFieldsValue({[an]:di==null?void 0:di.map((Ui,gi)=>{var Hi;return It(ci({},Ui),{position:gi+1,multi_line:(Hi=Sn==null?void 0:Sn[gi])==null?void 0:Hi.multiLine})})})},placeholder:Te,onCMBeforeChange:(on,Sn)=>{Dn(on,Sn,tn,un)}}))),nt.createElement(it.default.List,{name:an,rules:[{validator(on,Sn){if(!(Sn!=null&&Sn.length))return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const di of Sn){const{answer_text:Ui}=di||{};if((Ui==null?void 0:Ui.length)===0)return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(on,{add:Sn,remove:di},{errors:Ui})=>(Mi.current=Sn,qt.current=di,nt.createElement(nt.Fragment,null,nt.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},nt.createElement(it.default.Item,{label:"\u586B\u7A7A\u9879\u7B54\u6848",required:!0,labelCol:{span:24}}),nt.createElement("div",{onClick:()=>{bt.default.warning({title:"\u7ED9\u5206\u8BF4\u660E",icon:null,width:700,centered:!0,content:nt.createElement("div",null,nt.createElement("div",null,"1.\u5B66\u751F\u586B\u5199\u7B54\u6848\u4E4B\u540E\uFF0C\u5FC5\u987B\u63D0\u4EA4\u4EE3\u7801",nt.createElement("span",{style:{color:"#e30000"}},"\u8FDB\u884C\u8BC4\u6D4B"),"\u624D\u80FD\u5F97\u5206\u3002"),nt.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"}},nt.createElement(rn.Z,{style:{marginRight:3,color:"#3061D0"}}),nt.createElement("span",null," \u7ED9\u5206\u8BF4\u660E"))),on.map((gi,Hi)=>{var kr=gi,{key:Gn,name:On}=kr,Xn=Pt(kr,["key","name"]),wi,nr;return nt.createElement(vt.Z,{className:"mb20",key:Gn,align:"middle",wrap:!1},nt.createElement(Oe.Z,{flex:"0 0 auto",className:`${ct.Z.blankIndex}`},"\u586B\u7A7A\u9879",Hi+1),nt.createElement(Oe.Z,{flex:1},nt.createElement(vt.Z,{align:"top",justify:"space-between",wrap:!1},nt.createElement(Oe.Z,null,nt.createElement(it.default.Item,It(ci({},Xn),{name:[On,"answer_text"],noStyle:!0}),(wi=zn==null?void 0:zn[On])!=null&&wi.multi_line||(nr=zn==null?void 0:zn[On])!=null&&nr.multiLine?nt.createElement(Nt,{spellCheck:!1,style:{marginLeft:10,width:550}}):nt.createElement(Ke.default,{style:{marginLeft:10,width:550},className:ct.Z.blankInput,size:"large",maxLength:1e3,onBlur:ji=>{}}))),Ae&&nt.createElement(Oe.Z,{flex:"224px"},nt.createElement(it.default.Item,It(ci({},Xn),{name:[On,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),nt.createElement(st.Z,{size:"large",className:ct.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"}))))))})))),nt.createElement("div",{onClick:()=>yn(!0)},nt.createElement(it.default.Item,{name:["hack","analysis"],label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},nt.createElement(We.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Xt}))),nt.createElement(it.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"}]},nt.createElement(Et.default,{size:"large"},ii.map(on=>nt.createElement(Et.default.Option,{key:on.title,value:on.key}," ",on.title)))),nt.createElement(it.default.Item,{label:"\u6700\u5927\u8BC4\u6D4B\u65F6\u957F\uFF08\u79D2\uFF09",style:{marginTop:30},labelCol:{span:24},required:!0},nt.createElement(it.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},nt.createElement(st.Z,{precision:0,max:10,min:3,size:"large",style:{width:"97%"}})),nt.createElement("span",{className:"ml10 font14"},"\u79D2")),nt.createElement(it.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"}]},nt.createElement(ot.ZP.Group,{style:{marginTop:-10}},nt.createElement(ot.ZP,{value:0},"\u4E0D\u5FFD\u7565\u7A7A\u683C"),nt.createElement(ot.ZP,{value:1},"\u5FFD\u7565\u9996\u5C3E\u7A7A\u683C"),nt.createElement(ot.ZP,{value:2},"\u5FFD\u7565\u6240\u6709\u7A7A\u683C"))),nt.createElement(it.default.Item,{label:"\u6D4B\u8BD5\u7528\u4F8B",required:!0,style:{marginTop:30}}),nt.createElement("div",{style:{background:"#F6F7F9",padding:15}},nt.createElement(it.default.Item,{label:"\u8F93\u5165",labelCol:{span:24},name:["hack_sets","input"]},nt.createElement(Nt,{rows:4})),nt.createElement(it.default.Item,{label:"\u8F93\u51FA",labelCol:{span:24},name:["hack_sets","output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},nt.createElement(Nt,{rows:4}))),nt.createElement(vn,{form:He,answerKey:an,hackIdentifier:qe,buttonText:"\u8FD0\u884C\u8C03\u8BD5",buttonProps:{ghost:!0,icon:nt.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(Zn,ei,Le){"use strict";Le.d(ei,{u:function(){return _e}});var le=Le(59301),Ke=Le(77019),it=Le(5269),bt=Le(25399),vt=Le(28284),Oe=Le(8423),st=Le(32134),Et=Le(12893),ot=Le(31457),We=Le(59301),Tt=Object.defineProperty,ct=Object.defineProperties,At=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,de=(Ze,lt,Qe)=>lt in Ze?Tt(Ze,lt,{enumerable:!0,configurable:!0,writable:!0,value:Qe}):Ze[lt]=Qe,se=(Ze,lt)=>{for(var Qe in lt||(lt={}))ne.call(lt,Qe)&&de(Ze,Qe,lt[Qe]);if(De)for(var Qe of De(lt))te.call(lt,Qe)&&de(Ze,Qe,lt[Qe]);return Ze},ge=(Ze,lt)=>ct(Ze,At(lt)),ye=(Ze,lt)=>{var Qe={};for(var Ue in Ze)ne.call(Ze,Ue)&&lt.indexOf(Ue)<0&&(Qe[Ue]=Ze[Ue]);if(Ze!=null&&De)for(var Ue of De(Ze))lt.indexOf(Ue)<0&&te.call(Ze,Ue)&&(Qe[Ue]=Ze[Ue]);return Qe};const we=["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"],Ce=({value:Ze,onChange:lt,choiceTextKey:Qe,answerKey:Ue,index:dt,isEdit:$e,setInputActive:wt,form:St,choiceOptionsPath:Lt,allowChangeMode:pn,showAddIcon:en,addItem:vn,deleteItem:rn})=>{console.log(Ze,"value");const nt=(Ze==null?void 0:Ze[Ue])===1,rt=()=>{const ri=St.getFieldValue(Lt);St.setFieldValue(Lt,ri.map(Hn=>ge(se({},Hn),{[Ue]:0})))},dn=()=>{nt?lt(ge(se({},Ze),{[Ue]:0})):(pn||rt(),lt(ge(se({},Ze),{[Ue]:1})))};return We.createElement(Ke.Z,{className:Oe.Z.choiceWrap,align:"middle",wrap:!1},We.createElement(it.Z,{onClick:dn,className:`${Oe.Z.choiceIndex} ${nt?Oe.Z.activeAnswer:""}`},we[dt]),We.createElement(it.Z,{flex:1,className:`${Oe.Z.editorWrap} ml15`,onClick:wt},We.createElement(ot.x,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:$e,value:Ze==null?void 0:Ze[Qe],onChange:ri=>{lt(ge(se({},Ze),{[Qe]:ri}))}})),We.createElement(it.Z,{flex:"0 0 auto",className:"ml15"},We.createElement("div",{onClick:dn,className:`${Oe.Z.setAnswerBtn} ${nt?Oe.Z.activeAnswer:""}`},nt?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),We.createElement(it.Z,{className:Oe.Z.actionWrapper},We.createElement(bt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},We.createElement(st.Z,{className:Oe.Z.addIcon,onClick:vn,style:{visibility:en?"visible":"hidden"}})),We.createElement(bt.Z,{title:"\u5220\u9664"},We.createElement(Et.Z,{className:Oe.Z.deleteIcon,onClick:rn,style:{visibility:dt>1?"visible":"hidden"}}))))},_e=({questionTitlePlaceholder:Ze,titleKey:lt,choiceKey:Qe,analysisKey:Ue,choiceTextKey:dt,answerKey:$e,choiceOptionsPath:wt,allowChangeMode:St=!0,form:Lt,showAnalysis:pn=!0})=>{const[en,vn]=(0,le.useState)(),[rn,nt]=(0,le.useState)(!1);return We.createElement("div",{className:Oe.Z.wrap},We.createElement("div",{className:Oe.Z.questionTitleEditorWrap},We.createElement(vt.default.Item,{label:"\u9898\u5E72",name:lt,labelCol:{span:24},rules:[{required:!0}]},We.createElement(ot.h,{scrollId:Array.isArray(lt)?lt.join("_"):`${lt}`,watch:!0,height:140,placeholder:Ze}))),We.createElement(vt.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),We.createElement(vt.default.List,{name:Qe,rules:[{validator(rt,dn){const ri=dn.some(Wt=>Wt[$e]===1),Hn=dn.findIndex(Wt=>{var En;return((En=Wt[dt])==null?void 0:En.length)<=0});return Hn!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${we[Hn]}\u9009\u9879\u7684\u5185\u5BB9`)):ri?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(rt,{add:dn,remove:ri})=>We.createElement("div",{id:Array.isArray(wt)?wt.join("_"):`${wt}`},rt.map((Hn,Wt)=>{var En=Hn,{key:An,name:ci}=En,It=ye(En,["key","name"]);const Pt=en===An,Nt=()=>{vn(An)},ii=Wt<7&&Wt===rt.length-1,Gi=()=>dn({[dt]:"",[$e]:0}),ze=()=>ri(ci);return We.createElement(vt.default.Item,ge(se({},It),{key:An,name:ci,className:Oe.Z.choiceListWrap,rules:[{validator(Me,Ee){return Ee!=null&&Ee.choice_text?Promise.resolve():Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${we[Wt]}\u9009\u9879\u7684\u5185\u5BB9`))}}]}),We.createElement(Ce,{choiceTextKey:dt,answerKey:$e,index:Wt,isEdit:Pt,setInputActive:Nt,form:Lt,choiceOptionsPath:wt,allowChangeMode:St,showAddIcon:ii,addItem:Gi,deleteItem:ze}))}),rt.length<8&&We.createElement("div",{className:`${Oe.Z.addBtn} mb30`,onClick:()=>dn({[dt]:"",[$e]:0})},"\u6DFB\u52A0\u9009\u9879"))),pn&&We.createElement("div",{onClick:()=>nt(!0)},We.createElement(vt.default.Item,{name:Ue,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},We.createElement(ot.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:rn}))))}},92046:function(Zn,ei,Le){"use strict";Le.d(ei,{u:function(){return St}});var le=Le(59301),Ke=Le(62957),it=Le(77019),bt=Le(5269),vt=Le(37568),Oe=Le(25399),st=Le(71411),Et=Le(28284),ot=Le(47889),We=Le(71051),Tt=Le(31457),ct=Le(12893),At=Le(61485),De=Le(8423),ne=Le(19105),te=Le(59301),de=Object.defineProperty,se=Object.defineProperties,ge=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,_e=(Lt,pn,en)=>pn in Lt?de(Lt,pn,{enumerable:!0,configurable:!0,writable:!0,value:en}):Lt[pn]=en,Ze=(Lt,pn)=>{for(var en in pn||(pn={}))we.call(pn,en)&&_e(Lt,en,pn[en]);if(ye)for(var en of ye(pn))Ce.call(pn,en)&&_e(Lt,en,pn[en]);return Lt},lt=(Lt,pn)=>se(Lt,ge(pn)),Qe=(Lt,pn)=>{var en={};for(var vn in Lt)we.call(Lt,vn)&&pn.indexOf(vn)<0&&(en[vn]=Lt[vn]);if(Lt!=null&&ye)for(var vn of ye(Lt))pn.indexOf(vn)<0&&Ce.call(Lt,vn)&&(en[vn]=Lt[vn]);return en};const Ue=({value:Lt,onChange:pn})=>{const en=rn=>{Ke.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:De.Z.modal,onOk:()=>{const nt=[...Lt];nt.splice(rn,1),pn(nt)}})},vn=()=>{const rn=[...Lt];rn.push(""),pn(rn)};return te.createElement(it.Z,{className:"ml20"},te.createElement(bt.Z,{flex:1},Lt==null?void 0:Lt.map((rn,nt)=>te.createElement(it.Z,{key:`${rn}_${nt}`,className:"mb20"},te.createElement(vt.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:rn,autoSize:{maxRows:3},maxLength:1e3,onBlur:rt=>{const dn=[...Lt],ri=rt.target.value.trim();dn[nt]=ri,pn(dn)}}),te.createElement(Oe.Z,{title:"\u5220\u9664"},te.createElement(ct.Z,{className:De.Z.deleteIcon,style:{marginLeft:15,visibility:nt>0?"visible":"hidden"},onClick:()=>en(nt)}))))),te.createElement(bt.Z,null,te.createElement("div",{className:`${De.Z.addBtn}`,onClick:()=>{vn()}},"\u65B0\u589E\u7B54\u6848")))},dt=({value:Lt,onChange:pn})=>{const en=rn=>{Ke.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:De.Z.modal,onOk:()=>{const nt=[...Lt];nt.splice(rn,1),pn(nt)}})},vn=()=>{const rn=[...Lt];rn.push(""),pn(rn)};return te.createElement(it.Z,{className:"ml20"},te.createElement(bt.Z,{flex:1},Lt==null?void 0:Lt.map((rn,nt)=>te.createElement(it.Z,{key:`${rn}_${nt}`,align:"middle",className:"mb20"},te.createElement(ne.Z,{value:rn,style:{flex:1},onChange:rt=>{const dn=[...Lt];dn[nt]=rt,pn(dn)}}),te.createElement(Oe.Z,{title:"\u5220\u9664"},te.createElement(ct.Z,{className:De.Z.deleteIcon,style:{marginLeft:15,visibility:nt>0?"visible":"hidden"},onClick:()=>en(nt)}))))),te.createElement(bt.Z,null,te.createElement("div",{className:`${De.Z.addBtn}`,onClick:()=>{vn()}},"\u65B0\u589E\u7B54\u6848")))},$e=({value:Lt=!0,onChange:pn})=>te.createElement(st.Z,{checked:!Lt,onChange:en=>{pn(!en)}}),wt="\u2581",St=({questionTitlePlaceholder:Lt,form:pn,scoreByBlank:en=!1,answerKey:vn})=>{const[rn,nt]=(0,le.useState)(!1),rt=(It,Pt)=>{const Nt=Pt.line;let ii=0;for(let ze=0;ze<Nt;ze++)ii+=It.getLine(ze).split(wt).length-1;const Gi=It.getLine(Nt).substring(0,Pt.ch);return ii+=Gi.split(wt).length-1,ii},dn=(It,Pt,Nt,ii)=>{const Gi=It.getRange(Pt.from,Pt.to);let ze=0;if(Pt.text.forEach(Me=>{ze+=Me.split(wt).length-1}),Pt.origin!=="setValue"){if(Gi&&Gi.indexOf(wt)!==-1){const Me=Gi.split(wt).length-1,Ee=rt(It,Pt.from);if(console.log(`\u5220\u9664${Me}\u4E2A\uFF0C \u524D\u9762\u6709${Ee}\u4E2A\uFF0C\u65B0\u589E${ze}\u4E2A`),Me>1){const Te=Array.from({length:Me},(He,Ae)=>Ee+Ae);ii(Te)}else ii(Ee)}else if(ze>0){const Me=rt(It,Pt.from);console.log(`\u65B0\u589E${ze}\u4E2A\uFF0C\u4E4B\u524D\u6709${Me}\u4E2A`),Nt(ze,Me)}}},ri=()=>{const It=pn.getFieldValue(vn);pn.setFieldsValue({[vn]:It.map((Pt,Nt)=>lt(Ze({},Pt),{position:Nt+1}))})},Hn=(0,le.useRef)(),Wt=(It,Pt)=>{for(let Nt=0;Nt<It;Nt++)Hn.current({position:null,answer_text:[""],model:1},Pt+Nt);ri()},En=(0,le.useRef)(),An=It=>{En.current(It),ri()},ci=Et.default.useWatch(vn,pn);return te.createElement("div",{className:De.Z.wrap},te.createElement("div",{className:De.Z.questionTitleEditorWrap},te.createElement(Et.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},te.createElement(Tt.h,{scrollId:"name",watch:!0,height:140,placeholder:Lt,showNullButton:!0,onCMBeforeChange:(It,Pt)=>{dn(It,Pt,Wt,An)}}))),te.createElement(Et.default.List,{name:vn,rules:[{validator(It,Pt){if(!(Pt!=null&&Pt.length))return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const Nt of Pt){const{answer_text:ii}=Nt||{};if(ii!=null&&ii.some(Gi=>(Gi==null?void 0:Gi.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(It,{add:Pt,remove:Nt},{errors:ii})=>(Hn.current=Pt,En.current=Nt,te.createElement(te.Fragment,null,te.createElement(Et.default.Item,{label:te.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(It!=null&&It.length)&&te.createElement("span",{style:{color:"#E99237"}},"\uFF08\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879\uFF09")),required:!0,labelCol:{span:24}}),It.map((Gi,ze)=>{var Me=Gi,{key:Ee,name:Te}=Me,He=Qe(Me,["key","name"]),Ae,qe;return te.createElement("div",{style:{marginBottom:10},key:Ee},te.createElement(it.Z,{className:"mb20",align:"middle",wrap:!1},te.createElement(bt.Z,{style:{marginRight:10},flex:"0 0 auto",className:`${De.Z.blankIndex}`},"\u586B\u7A7A\u9879",ze+1),te.createElement(Et.default.Item,lt(Ze({},He),{name:[Te,"model"],noStyle:!0}),te.createElement(ot.ZP.Group,{onChange:()=>{const an=pn.getFieldValue(vn);pn.setFieldsValue({[vn]:an.map((Xt,yn)=>lt(Ze({},Xt),{answer_text:Te===yn?[""]:Xt.answer_text}))})}},te.createElement(ot.ZP,{value:1},"\u6587\u672C\u6A21\u5F0F ",te.createElement(Oe.Z,{title:"\u5B66\u751F\u7B54\u9898\u65F6\uFF0C\u9700\u8981\u5728\u6587\u672C\u6846\u4E2D\u586B\u5199\u6587\u672C\u7B54\u6848"},te.createElement(At.Z,null))),te.createElement(ot.ZP,{value:2},"\u6570\u5B66\u516C\u5F0F\u6A21\u5F0F ",te.createElement(Oe.Z,{title:"\u5B66\u751F\u7B54\u9898\u65F6\uFF0C\u9700\u8981\u7F16\u5199\u6570\u5B66\u516C\u5F0F\u4F5C\u4E3A\u7B54\u6848"},te.createElement(At.Z,null)))))),te.createElement(it.Z,{style:{marginLeft:20},align:"middle",wrap:!1},te.createElement(bt.Z,{flex:1},te.createElement(it.Z,{align:"top",justify:"space-between",wrap:!1},te.createElement(bt.Z,{flex:1},te.createElement(Et.default.Item,lt(Ze({},He),{name:[Te,"answer_text"],noStyle:!0}),((qe=(Ae=pn.getFieldValue(vn))==null?void 0:Ae[Te])==null?void 0:qe.model)===1?te.createElement(Ue,null):te.createElement(dt,null))),en&&te.createElement(bt.Z,{flex:"224px",style:{margin:"-7px 0 0 20px"}},te.createElement(Et.default.Item,lt(Ze({},He),{name:[Te,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:De.Z.blankInputNumberWrapper}),te.createElement(We.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"})))),te.createElement(Et.default.Item,lt(Ze({},He),{name:[Te,"position"],noStyle:!0}),te.createElement(vt.default,{type:"hidden"})))))})))),te.createElement(it.Z,{align:"middle"},te.createElement(Et.default.Item,{name:"downcase",valuePropName:"checked"},te.createElement(st.Z,null)),te.createElement(bt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),te.createElement(it.Z,{align:"middle"},te.createElement(Et.default.Item,{name:"no_space",valuePropName:"checked"},te.createElement(st.Z,null)),te.createElement(bt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(ci==null?void 0:ci.length)>1&&te.createElement(it.Z,{align:"middle",className:(ci==null?void 0:ci.length)>1?"mb30":`${De.Z.hide}`},te.createElement(Et.default.Item,{name:"is_ordered"},te.createElement($e,null)),te.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")),te.createElement("div",{onClick:()=>nt(!0)},te.createElement(Et.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},te.createElement(Tt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:rn}))))}},14289:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return ye}});var le=Le(59301),Ke=Le(77019),it=Le(5269),bt=Le(28284),vt=Le(8423),Oe=Le(31457),st=Le(59301),Et=Object.defineProperty,ot=Object.defineProperties,We=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,ct=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,De=(we,Ce,_e)=>Ce in we?Et(we,Ce,{enumerable:!0,configurable:!0,writable:!0,value:_e}):we[Ce]=_e,ne=(we,Ce)=>{for(var _e in Ce||(Ce={}))ct.call(Ce,_e)&&De(we,_e,Ce[_e]);if(Tt)for(var _e of Tt(Ce))At.call(Ce,_e)&&De(we,_e,Ce[_e]);return we},te=(we,Ce)=>ot(we,We(Ce)),de=(we,Ce)=>{var _e={};for(var Ze in we)ct.call(we,Ze)&&Ce.indexOf(Ze)<0&&(_e[Ze]=we[Ze]);if(we!=null&&Tt)for(var Ze of Tt(we))Ce.indexOf(Ze)<0&&At.call(we,Ze)&&(_e[Ze]=we[Ze]);return _e};const se={\u6B63\u786E:"T",\u9519\u8BEF:"F"},ge=({value:we,onChange:Ce,form:_e})=>{const Ze=(we==null?void 0:we.is_answer)===1,lt=we==null?void 0:we.choice_text,Qe=()=>{const Ue=_e.getFieldsValue().choices.map(dt=>({choice_text:dt.choice_text,is_answer:0}));_e.setFieldsValue({choices:Ue}),Ce(te(ne({},we),{is_answer:1}))};return st.createElement(Ke.Z,{className:vt.Z.choiceWrap,align:"middle",wrap:!1,style:{marginBottom:"20px"}},st.createElement(it.Z,{onClick:Qe,className:`${vt.Z.choiceIndex} ${vt.Z.judgementIndex} ${Ze?vt.Z.activeAnswer:""}`},se[lt]),st.createElement(it.Z,{flex:1,className:`${vt.Z.editorWrap} ml15`},st.createElement("div",{className:`${vt.Z.inputBorder} ${vt.Z.placeholder} ${Ze?vt.Z.activeJudgementAnswer:""}`},lt)),st.createElement(it.Z,{flex:"0 0 auto",className:"ml15"},st.createElement("div",{onClick:Qe,className:`${vt.Z.setAnswerBtn} ${Ze?vt.Z.activeAnswer:""}`},Ze?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},ye=({questionTitlePlaceholder:we,choiceKey:Ce,form:_e})=>{const[Ze,lt]=(0,le.useState)(!1);return st.createElement("div",{className:vt.Z.wrap},st.createElement("div",{className:vt.Z.questionTitleEditorWrap},st.createElement(bt.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},st.createElement(Oe.h,{scrollId:"name",watch:!0,height:140,placeholder:we}))),st.createElement(bt.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},st.createElement(bt.default.List,{name:"choices",rules:[{validator(Qe,Ue){return Ue.some($e=>($e==null?void 0:$e.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},Qe=>st.createElement("div",{id:"choices"},Qe.map(Ue=>{var dt=Ue,{key:$e,name:wt}=dt,St=de(dt,["key","name"]);return st.createElement(bt.default.Item,te(ne({},St),{key:$e,name:wt,noStyle:!0}),st.createElement(ge,{form:_e}))})))),st.createElement("div",{onClick:()=>lt(!0)},st.createElement(bt.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},st.createElement(Oe.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ze}))))}},31457:function(Zn,ei,Le){"use strict";Le.d(ei,{h:function(){return ne},x:function(){return te}});var le=Le(39793),Ke=Le(8423),it=Le(76902),bt=Le(59301),vt=Object.defineProperty,Oe=Object.defineProperties,st=Object.getOwnPropertyDescriptors,Et=Object.getOwnPropertySymbols,ot=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,Tt=(de,se,ge)=>se in de?vt(de,se,{enumerable:!0,configurable:!0,writable:!0,value:ge}):de[se]=ge,ct=(de,se)=>{for(var ge in se||(se={}))ot.call(se,ge)&&Tt(de,ge,se[ge]);if(Et)for(var ge of Et(se))We.call(se,ge)&&Tt(de,ge,se[ge]);return de},At=(de,se)=>Oe(de,st(se)),De=(de,se)=>{var ge={};for(var ye in de)ot.call(de,ye)&&se.indexOf(ye)<0&&(ge[ye]=de[ye]);if(de!=null&&Et)for(var ye of Et(de))se.indexOf(ye)<0&&We.call(de,ye)&&(ge[ye]=de[ye]);return ge};const ne=de=>{var se=de,{value:ge,onChange:ye,scrollId:we}=se,Ce=De(se,["value","onChange","scrollId"]);return bt.createElement("div",{id:we||""},bt.createElement(le.Z,At(ct({},Ce),{defaultValue:ge,onChange:(_e,Ze)=>{Ze!=null&&Ze.length?ye(_e,Ze):ye(_e)}})))},te=({value:de,onChange:se,placeholder:ge,height:ye=140,isEdit:we,miniToolbar:Ce,watch:_e=!0})=>we?bt.createElement(le.Z,{watch:_e,isFocus:!0,height:ye||void 0,placeholder:ge,defaultValue:de,onChange:se,miniToolbar:Ce}):bt.createElement("div",{style:{cursor:"pointer"}},de?bt.createElement(it.Z,{className:Ke.Z.inputBorder,value:de}):bt.createElement("div",{className:`${Ke.Z.inputBorder} ${Ke.Z.placeholder} inputBorderError`},ge))},44272:function(Zn,ei,Le){"use strict";Le.d(ei,{W:function(){return dt}});var le=Le(59301),Ke=Le(6767),it=Le(96599),bt=Le(28284),vt=Le(71411),Oe=Le(77019),st=Le(5269),Et=Le(25399),ot=Le(37568),We=Le(71051),Tt=Le(8423),ct=Le(31457),At=Le(39793),De=Le(61485),ne=Object.defineProperty,te=Object.defineProperties,de=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,ge=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,we=($e,wt,St)=>wt in $e?ne($e,wt,{enumerable:!0,configurable:!0,writable:!0,value:St}):$e[wt]=St,Ce=($e,wt)=>{for(var St in wt||(wt={}))ge.call(wt,St)&&we($e,St,wt[St]);if(se)for(var St of se(wt))ye.call(wt,St)&&we($e,St,wt[St]);return $e},_e=($e,wt)=>te($e,de(wt)),Ze=($e,wt)=>{var St={};for(var Lt in $e)ge.call($e,Lt)&&wt.indexOf(Lt)<0&&(St[Lt]=$e[Lt]);if($e!=null&&se)for(var Lt of se($e))wt.indexOf(Lt)<0&&ye.call($e,Lt)&&(St[Lt]=$e[Lt]);return St};const lt=$e=>{var wt=$e,{value:St,onChange:Lt}=wt,pn=Ze(wt,["value","onChange"]);const en=vn=>{Lt([vn])};return le.createElement(At.Z,_e(Ce({},pn),{defaultValue:St==null?void 0:St[0],onChange:en}))},Qe=$e=>{if(!$e)return!1;if(/^s*$/.test($e)||$e.trim()===""){Ke.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let wt=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 $e==="|"?(Ke.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Ue=({value:$e=[],onClose:wt})=>le.createElement(it.default,{closable:!0,onClose:wt,className:Tt.Z.keywordTag},le.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},$e.join(" \u6216 "))),dt=({questionTitlePlaceholder:$e,form:wt,showKeywords:St,isMustKeyWords:Lt=St})=>{const[pn,en]=(0,le.useState)(!1),[vn,rn]=(0,le.useState)(""),nt=bt.default.useWatch("use_keywords",wt),rt=bt.default.useWatch("question_score",wt);return le.createElement("div",{className:Tt.Z.wrap},le.createElement("div",{className:Tt.Z.questionTitleEditorWrap},le.createElement(bt.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},le.createElement(ct.h,{scrollId:"name",watch:!0,height:140,placeholder:$e}))),le.createElement(bt.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:"answer_texts",labelCol:{span:24}},le.createElement(lt,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),St&&!Lt&&le.createElement(bt.default.Item,{hidden:!0,name:"use_keywords",valuePropName:"checked"},le.createElement(vt.Z,{defaultChecked:!0})),St&&Lt&&le.createElement(Oe.Z,{align:"middle",className:"mb30"},le.createElement(bt.default.Item,{name:"use_keywords",valuePropName:"checked"},le.createElement(vt.Z,null)),le.createElement(st.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),le.createElement(st.Z,null,le.createElement(Et.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"},le.createElement(De.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(nt||!Lt)&&le.createElement(bt.default.List,{name:"keywords",rules:[{validator(dn,ri){return Lt?ri!=null&&ri.length?(ri==null?void 0:ri.reduce((Wt,En)=>Wt+En.score,0))>parseFloat(rt)?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()}}]},(dn,{add:ri,remove:Hn})=>le.createElement(le.Fragment,null,le.createElement("div",{className:`${Tt.Z.title} mb10`},Lt?"\u5173\u952E\u8BCD":le.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),le.createElement(Oe.Z,{align:"middle",className:"font14 mb30"},le.createElement(st.Z,{flex:1},le.createElement(ot.default,{value:vn,onChange:Wt=>{rn(Wt.target.value)},maxLength:50,allowClear:!0,onPressEnter:Wt=>{var En,An,ci,It;const Pt=`${(En=Wt.target)==null?void 0:En.value}`,Nt=(ci=(An=Pt==null?void 0:Pt.split("|"))==null?void 0:An.filter(ze=>!!ze))==null?void 0:ci.map(ze=>ze==null?void 0:ze.trim()),ii=wt.getFieldValue("keywords"),Gi=((It=ii==null?void 0:ii.map(ze=>ze==null?void 0:ze.keyword))==null?void 0:It.flat())||[];for(const ze of Nt)if(Gi.includes(ze)){Ke.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Qe(Pt)&&(ri({keyword:Nt,score:1}),rn(""))},className:Tt.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"})),le.createElement(st.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),dn.map(Wt=>{var En=Wt,{key:An,name:ci}=En,It=Ze(En,["key","name"]);return le.createElement(Oe.Z,{key:An,className:"mb20",style:{marginRight:148}},le.createElement(st.Z,{flex:1},le.createElement(Oe.Z,{align:"middle",justify:"space-between"},le.createElement(bt.default.Item,_e(Ce({},It),{name:[ci,"keyword"]}),le.createElement(Ue,{onClose:()=>Hn(ci)})),Lt&&le.createElement(bt.default.Item,_e(Ce({},It),{name:[ci,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Tt.Z.blankInputNumberWrapper}),le.createElement(We.Z,{className:Tt.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),le.createElement("div",{onClick:()=>en(!0)},le.createElement(bt.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},le.createElement(ct.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:pn}))))}},77762:function(Zn,ei,Le){"use strict";Le.d(ei,{tc:function(){return kr.t},uh:function(){return le.u},rL:function(){return Hi},u8:function(){return it.u},ZZ:function(){return Ke.Z},Wk:function(){return bt.W}});var le=Le(81727),Ke=Le(14289),it=Le(92046),bt=Le(44272),vt=Le(59301),Oe=Le(8848),st=Le(28284),Et=Le(77019),ot=Le(5269),We=Le(71051),Tt=Le(25399),ct=Le(75727),At=Le(8423),De=Le(12893),ne=Le(31457),te=Le(62957),de=Le(37568),se=Le(71411),ge=Le(59301),ye=Object.defineProperty,we=Object.defineProperties,Ce=Object.getOwnPropertyDescriptors,_e=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable,Qe=(Gn,On,Xn)=>On in Gn?ye(Gn,On,{enumerable:!0,configurable:!0,writable:!0,value:Xn}):Gn[On]=Xn,Ue=(Gn,On)=>{for(var Xn in On||(On={}))Ze.call(On,Xn)&&Qe(Gn,Xn,On[Xn]);if(_e)for(var Xn of _e(On))lt.call(On,Xn)&&Qe(Gn,Xn,On[Xn]);return Gn},dt=(Gn,On)=>we(Gn,Ce(On)),$e=(Gn,On)=>{var Xn={};for(var wi in Gn)Ze.call(Gn,wi)&&On.indexOf(wi)<0&&(Xn[wi]=Gn[wi]);if(Gn!=null&&_e)for(var wi of _e(Gn))On.indexOf(wi)<0&&lt.call(Gn,wi)&&(Xn[wi]=Gn[wi]);return Xn};const wt=({value:Gn,onChange:On})=>{const Xn=nr=>{te.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:At.Z.modal,onOk:()=>{const ji=[...Gn];ji.splice(nr,1),On(ji)}})},wi=()=>{const nr=[...Gn];nr.push(""),On(nr)};return ge.createElement(Et.Z,{className:"ml20"},ge.createElement(ot.Z,{flex:1},Gn==null?void 0:Gn.map((nr,ji)=>ge.createElement(Et.Z,{key:`${nr}_${ji}`,align:"middle",className:"mb20"},ge.createElement(de.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:nr,autoSize:{maxRows:3},maxLength:1e3,onBlur:Cr=>{const be=[...Gn],mn=Cr.target.value.trim();be[ji]=mn,On(be)}}),ge.createElement(Tt.Z,{title:"\u5220\u9664"},ge.createElement(De.Z,{className:At.Z.deleteIcon,style:{marginLeft:15,visibility:ji>0?"visible":"hidden"},onClick:()=>Xn(ji)}))))),ge.createElement(ot.Z,null,ge.createElement("div",{className:`${At.Z.addBtn}`,onClick:()=>{wi()}},"\u65B0\u589E\u7B54\u6848")))},St=({value:Gn=!0,onChange:On})=>ge.createElement(se.Z,{checked:!Gn,onChange:Xn=>{On(!Xn)}}),Lt="\u2581",pn=({questionTitlePlaceholder:Gn,form:On,name:Xn,scoreByBlank:wi=!1,answerKey:nr,titleKey:ji="name",analysisKey:Cr="analysis",isOrdered:be="is_ordered"})=>{var mn,fi;const[Vn,si]=(0,vt.useState)(!1),Di=(mi,$i)=>{const xn=$i.line;let ni=0;for(let br=0;br<xn;br++)ni+=mi.getLine(br).split(Lt).length-1;const sr=mi.getLine(xn).substring(0,$i.ch);return ni+=sr.split(Lt).length-1,ni},Ni=(mi,$i,xn,ni)=>{const sr=mi.getRange($i.from,$i.to);let br=0;if($i.text.forEach(Yn=>{br+=Yn.split(Lt).length-1}),$i.origin!=="setValue"){if(sr&&sr.indexOf(Lt)!==-1){const Yn=sr.split(Lt).length-1,at=Di(mi,$i.from);if(console.log(`\u5220\u9664${Yn}\u4E2A\uFF0C \u524D\u9762\u6709${at}\u4E2A\uFF0C\u65B0\u589E${br}\u4E2A`),Yn>1){const Bt=Array.from({length:Yn},(Kn,li)=>at+li);ni(Bt)}else ni(at)}else if(br>0){const Yn=Di(mi,$i.from);console.log(`\u65B0\u589E${br}\u4E2A\uFF0C\u4E4B\u524D\u6709${Yn}\u4E2A`),xn(br,Yn)}}},yr=()=>{const mi=On.getFieldValue(["sub_item_banks",...nr]);On.setFieldValue(["sub_item_banks",...nr],mi==null?void 0:mi.map(($i,xn)=>dt(Ue({},$i),{position:xn+1})))},zt=(0,vt.useRef)(),Mt=(mi,$i)=>{for(let xn=0;xn<mi;xn++)zt.current({position:null,answer_text:[""]},$i+xn);yr()},_t=(0,vt.useRef)(),fn=mi=>{_t.current(mi),yr()},Ji=(fi=(mn=On.getFieldValue("sub_item_banks"))==null?void 0:mn[nr==null?void 0:nr[0]])==null?void 0:fi[nr==null?void 0:nr[1]];return(0,vt.useEffect)(()=>{console.log("========",On.getFieldsValue())},[On]),ge.createElement("div",{className:At.Z.wrap},ge.createElement("div",{className:At.Z.questionTitleEditorWrap},ge.createElement(st.default.Item,{label:"\u9898\u5E72",name:ji,labelCol:{span:24},rules:[{required:!0}]},ge.createElement(ne.h,{scrollId:"name",watch:!0,height:140,placeholder:Gn,showNullButton:!0,onCMBeforeChange:(mi,$i)=>{Ni(mi,$i,Mt,fn)}}))),ge.createElement(st.default.List,{name:nr,rules:[{validator(mi,$i){if(($i==null?void 0:$i.length)===0)return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const xn of $i){const{answer_text:ni}=xn||{};if(ni!=null&&ni.some(sr=>(sr==null?void 0:sr.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(mi,{add:$i,remove:xn},{errors:ni})=>(zt.current=$i,_t.current=xn,ge.createElement(ge.Fragment,null,ge.createElement(st.default.Item,{label:ge.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(mi!=null&&mi.length)&&ge.createElement("span",{style:{color:"#E99237"}},"\uFF08\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879\uFF09")),required:!0,labelCol:{span:24}}),mi.map((sr,br)=>{var Yn=sr,{key:at,name:Bt}=Yn,Kn=$e(Yn,["key","name"]);return ge.createElement(Et.Z,{align:"top",key:at},ge.createElement(ot.Z,{className:`${At.Z.blankIndex} pt5`},"\u586B\u7A7A\u9879",br+1),ge.createElement(ot.Z,{flex:1},ge.createElement(Et.Z,{align:"top",justify:"space-between"},ge.createElement(ot.Z,{flex:1},ge.createElement(st.default.Item,dt(Ue({},Kn),{name:[Bt,"answer_text"],noStyle:!0}),ge.createElement(wt,null))),wi&&ge.createElement(ot.Z,{flex:"224px"},ge.createElement(st.default.Item,dt(Ue({},Kn),{name:[Bt,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:At.Z.blankInputNumberWrapper}),ge.createElement(We.Z,{className:At.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"})))),ge.createElement(st.default.Item,dt(Ue({},Kn),{name:[Bt,"position"],noStyle:!0}),ge.createElement(de.default,{type:"hidden"}))))})))),ge.createElement(Et.Z,{align:"middle"},ge.createElement(st.default.Item,{name:[Xn,"downcase"],valuePropName:"checked"},ge.createElement(se.Z,null)),ge.createElement(ot.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),ge.createElement(Et.Z,{align:"middle"},ge.createElement(st.default.Item,{name:[Xn,"no_space"],valuePropName:"checked"},ge.createElement(se.Z,null)),ge.createElement(ot.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(Ji==null?void 0:Ji.length)>1&&ge.createElement(Et.Z,{align:"middle",className:(Ji==null?void 0:Ji.length)>1?"mb30":`${At.Z.hide}`},ge.createElement(st.default.Item,{name:be},ge.createElement(St,null)),ge.createElement(ot.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")),ge.createElement("div",{className:"mt30",onClick:()=>si(!0)},ge.createElement(st.default.Item,{name:Cr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ge.createElement(ne.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Vn}))))};var en=Le(59301),vn=Object.defineProperty,rn=Object.defineProperties,nt=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,dn=Object.prototype.hasOwnProperty,ri=Object.prototype.propertyIsEnumerable,Hn=(Gn,On,Xn)=>On in Gn?vn(Gn,On,{enumerable:!0,configurable:!0,writable:!0,value:Xn}):Gn[On]=Xn,Wt=(Gn,On)=>{for(var Xn in On||(On={}))dn.call(On,Xn)&&Hn(Gn,Xn,On[Xn]);if(rt)for(var Xn of rt(On))ri.call(On,Xn)&&Hn(Gn,Xn,On[Xn]);return Gn},En=(Gn,On)=>rn(Gn,nt(On)),An=(Gn,On)=>{var Xn={};for(var wi in Gn)dn.call(Gn,wi)&&On.indexOf(wi)<0&&(Xn[wi]=Gn[wi]);if(Gn!=null&&rt)for(var wi of rt(Gn))On.indexOf(wi)<0&&ri.call(Gn,wi)&&(Xn[wi]=Gn[wi]);return Xn};const ci={\u6B63\u786E:"T",\u9519\u8BEF:"F"},It=({value:Gn,onChange:On,form:Xn,choiceKey:wi})=>{const nr=(Gn==null?void 0:Gn.is_answer)===1,ji=Gn==null?void 0:Gn.choice_text,Cr=()=>{var be;const mn=(be=Xn==null?void 0:Xn.getFieldValue(["sub_item_banks",...wi]))==null?void 0:be.map(fi=>({choice_text:fi.choice_text,is_answer:0}));Xn==null||Xn.setFieldValue(["sub_item_banks",...wi],mn),On(En(Wt({},Gn),{is_answer:1}))};return en.createElement(Et.Z,{className:At.Z.choiceWrap,align:"middle",wrap:!1},en.createElement(ot.Z,{onClick:Cr,className:`${At.Z.choiceIndex} ${At.Z.judgementIndex} ${nr?At.Z.activeAnswer:""}`},ci[ji]),en.createElement(ot.Z,{flex:1,className:`${At.Z.editorWrap} ml15`},en.createElement("div",{className:`${At.Z.inputBorder} ${At.Z.placeholder} ${nr?At.Z.activeJudgementAnswer:""}`},ji)),en.createElement(ot.Z,{flex:"0 0 auto",className:"ml15"},en.createElement("div",{onClick:Cr,className:`${At.Z.setAnswerBtn} ${nr?At.Z.activeAnswer:""}`},nr?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},Pt=({questionTitlePlaceholder:Gn,choiceKey:On="choices",form:Xn,titleKey:wi="name",analysisKey:nr="analysis"})=>{const[ji,Cr]=(0,vt.useState)(!1);return en.createElement("div",{className:At.Z.wrap},en.createElement("div",{className:At.Z.questionTitleEditorWrap},en.createElement(st.default.Item,{label:"\u9898\u5E72",name:wi,labelCol:{span:24},rules:[{required:!0}]},en.createElement(ne.h,{scrollId:"name",watch:!0,height:140,placeholder:Gn}))),en.createElement(st.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},en.createElement(st.default.List,{name:On,rules:[{validator(be,mn){return mn.some(Vn=>(Vn==null?void 0:Vn.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},be=>en.createElement("div",{id:"choices",style:{display:"flex",flexDirection:"column",gap:"20px"}},be.map(mn=>{var fi=mn,{key:Vn,name:si}=fi,Di=An(fi,["key","name"]);return en.createElement(st.default.Item,En(Wt({},Di),{key:Vn,name:si,noStyle:!0}),en.createElement(It,{form:Xn,choiceKey:On}))})))),en.createElement("div",{className:"mt30",onClick:()=>Cr(!0)},en.createElement(st.default.Item,{name:nr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},en.createElement(ne.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:ji}))))};var Nt=Le(6767),ii=Le(96599),Gi=Le(39793),ze=Le(61485),Me=Object.defineProperty,Ee=Object.defineProperties,Te=Object.getOwnPropertyDescriptors,He=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable,an=(Gn,On,Xn)=>On in Gn?Me(Gn,On,{enumerable:!0,configurable:!0,writable:!0,value:Xn}):Gn[On]=Xn,Xt=(Gn,On)=>{for(var Xn in On||(On={}))Ae.call(On,Xn)&&an(Gn,Xn,On[Xn]);if(He)for(var Xn of He(On))qe.call(On,Xn)&&an(Gn,Xn,On[Xn]);return Gn},yn=(Gn,On)=>Ee(Gn,Te(On)),kt=(Gn,On)=>{var Xn={};for(var wi in Gn)Ae.call(Gn,wi)&&On.indexOf(wi)<0&&(Xn[wi]=Gn[wi]);if(Gn!=null&&He)for(var wi of He(Gn))On.indexOf(wi)<0&&qe.call(Gn,wi)&&(Xn[wi]=Gn[wi]);return Xn};const Dt=Gn=>{var On=Gn,{value:Xn,onChange:wi}=On,nr=kt(On,["value","onChange"]);const ji=Cr=>{wi([Cr])};return vt.createElement(Gi.Z,yn(Xt({},nr),{defaultValue:Xn==null?void 0:Xn[0],onChange:ji}))},Zt=Gn=>{if(!Gn)return!1;let On=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 Gn==="|"?(Nt.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},hn=({value:Gn=[],onClose:On})=>vt.createElement(ii.default,{closable:!0,onClose:On,className:At.Z.keywordTag},vt.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},Gn.join(" \u6216 "))),wn=({questionTitlePlaceholder:Gn,form:On,showKeywords:Xn,isMustKeyWords:wi=Xn,titleKey:nr="name",analysisKey:ji="analysis",answerTexts:Cr="answer_texts",keywords:be="keywords",useKeywords:mn="use_keywords",indexs:fi})=>{const[Vn,si]=(0,vt.useState)(!1),[Di,Ni]=(0,vt.useState)(""),[yr,zt]=(0,vt.useState)(!1),Mt=st.default.useWatch("question_score",On);return vt.createElement("div",{className:At.Z.wrap},vt.createElement("div",{className:At.Z.questionTitleEditorWrap},vt.createElement(st.default.Item,{label:"\u9898\u5E72",name:nr,labelCol:{span:24},rules:[{required:!0}]},vt.createElement(ne.h,{scrollId:"name",watch:!0,height:140,placeholder:Gn}))),vt.createElement(st.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:Cr,labelCol:{span:24}},vt.createElement(Dt,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),Xn&&!wi&&vt.createElement(st.default.Item,{hidden:!0,name:mn,valuePropName:"checked"},vt.createElement(se.Z,{defaultChecked:!0})),Xn&&wi&&vt.createElement(Et.Z,{align:"middle",className:"mb30"},vt.createElement(st.default.Item,{name:mn,valuePropName:"checked"},vt.createElement(se.Z,{onChange:()=>{var _t,fn,Ji,mi,$i,xn;console.log(On.getFieldsValue()),zt((Ji=(fn=(_t=On.getFieldsValue())==null?void 0:_t.sub_item_banks)==null?void 0:fn[fi])==null?void 0:Ji.use_keywords),console.log((xn=($i=(mi=On.getFieldsValue())==null?void 0:mi.sub_item_banks)==null?void 0:$i[fi])==null?void 0:xn.use_keywords),console.log(yr)}})),vt.createElement(ot.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),vt.createElement(ot.Z,null,vt.createElement(Tt.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"},vt.createElement(ze.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(yr||!wi)&&vt.createElement(st.default.List,{name:be,rules:[{validator(_t,fn){return wi?fn!=null&&fn.length?(fn==null?void 0:fn.reduce((mi,$i)=>mi+$i.score,0))>parseFloat(Mt)?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()}}]},(_t,{add:fn,remove:Ji})=>vt.createElement(vt.Fragment,null,vt.createElement("div",{className:`${At.Z.title} mb10`},wi?"\u5173\u952E\u8BCD":vt.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),vt.createElement(Et.Z,{align:"middle",className:"font14 mb30"},vt.createElement(ot.Z,{flex:1},vt.createElement(de.default,{value:Di,onChange:mi=>{Ni(mi.target.value)},maxLength:50,allowClear:!0,onPressEnter:mi=>{var $i,xn,ni,sr;const br=`${($i=mi.target)==null?void 0:$i.value}`,Yn=(ni=(xn=br==null?void 0:br.split("|"))==null?void 0:xn.filter(Kn=>!!Kn))==null?void 0:ni.map(Kn=>Kn==null?void 0:Kn.trim()),at=On.getFieldValue(["sub_item_banks",...be]),Bt=((sr=at==null?void 0:at.map(Kn=>Kn==null?void 0:Kn.keyword))==null?void 0:sr.flat())||[];for(const Kn of Yn)if(Bt.includes(Kn)){Nt.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Zt(br)&&(fn({keyword:Yn,score:1}),Ni(""))},className:At.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"})),vt.createElement(ot.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),_t.map(mi=>{var $i=mi,{key:xn,name:ni}=$i,sr=kt($i,["key","name"]);return vt.createElement(Et.Z,{key:xn,className:"mb20",style:{marginRight:148}},vt.createElement(ot.Z,{flex:1},vt.createElement(Et.Z,{align:"middle",justify:"space-between"},vt.createElement(st.default.Item,yn(Xt({},sr),{name:[ni,"keyword"]}),vt.createElement(hn,{onClose:()=>Ji(ni)})),wi&&vt.createElement(st.default.Item,yn(Xt({},sr),{name:[ni,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:At.Z.blankInputNumberWrapper}),vt.createElement(We.Z,{className:At.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),vt.createElement("div",{onClick:()=>si(!0)},vt.createElement(st.default.Item,{name:ji,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},vt.createElement(ne.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Vn}))))};var Dn=Le(59301),Tn=Object.defineProperty,Mi=Object.defineProperties,tn=Object.getOwnPropertyDescriptors,qt=Object.getOwnPropertySymbols,un=Object.prototype.hasOwnProperty,zn=Object.prototype.propertyIsEnumerable,on=(Gn,On,Xn)=>On in Gn?Tn(Gn,On,{enumerable:!0,configurable:!0,writable:!0,value:Xn}):Gn[On]=Xn,Sn=(Gn,On)=>{for(var Xn in On||(On={}))un.call(On,Xn)&&on(Gn,Xn,On[Xn]);if(qt)for(var Xn of qt(On))zn.call(On,Xn)&&on(Gn,Xn,On[Xn]);return Gn},di=(Gn,On)=>Mi(Gn,tn(On)),Ui=(Gn,On)=>{var Xn={};for(var wi in Gn)un.call(Gn,wi)&&On.indexOf(wi)<0&&(Xn[wi]=Gn[wi]);if(Gn!=null&&qt)for(var wi of qt(Gn))On.indexOf(wi)<0&&zn.call(Gn,wi)&&(Xn[wi]=Gn[wi]);return Xn};const{Panel:gi}=Oe.default,Hi=({questionTitlePlaceholder:Gn,choiceKey:On,form:Xn,withScore:wi})=>{const[nr,ji]=(0,vt.useState)([]),Cr=be=>{ji(be)};return Dn.createElement("div",{className:At.Z.wrap},Dn.createElement("div",{className:At.Z.questionTitleEditorWrap},Dn.createElement(st.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},Dn.createElement(ne.h,{scrollId:"name",watch:!0,height:140,placeholder:Gn}))),Dn.createElement(st.default.Item,{label:"\u5C0F\u9898",required:!0,labelCol:{span:24}}),Dn.createElement(st.default.List,{name:"sub_item_banks",rules:[{validator(be,mn){return mn?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(be,{add:mn,remove:fi,move:Vn})=>{const si=Xn.getFieldValue("sub_item_banks");return Dn.createElement(Dn.Fragment,null,Dn.createElement(Oe.default,{className:be.length>0?At.Z.collapseWrapper:"",bordered:!1,activeKey:nr,onChange:Cr,expandIcon:({isActive:Di})=>Dn.createElement("i",{className:`iconfont icon-weizhankai ${Di?At.Z.open:At.Z.close}`,style:{fontSize:14,transition:"all .2s"}})},be.map((Di,Ni)=>{var yr=Di,{key:zt,name:Mt}=yr,_t=Ui(yr,["key","name"]),fn,Ji,mi,$i,xn,ni,sr,br,Yn,at;return Dn.createElement(gi,{className:At.Z.panel,forceRender:!0,header:Dn.createElement("div",{className:At.Z.panelHeader},"\u7B2C",Ni+1,"\u5C0F\u9898",Dn.createElement("span",null,"\uFF08",((fn=si==null?void 0:si[Mt])==null?void 0:fn.item_type)=="SINGLE"?"\u5355\u9009\u9898":((Ji=si==null?void 0:si[Mt])==null?void 0:Ji.item_type)=="MULTIPLE"?"\u591A\u9009\u9898":((mi=si==null?void 0:si[Mt])==null?void 0:mi.item_type)=="COMPLETION"?"\u586B\u7A7A\u9898":(($i=si==null?void 0:si[Mt])==null?void 0:$i.item_type)=="JUDGMENT"?"\u5224\u65AD\u9898":"\u7B80\u7B54\u9898","\uFF09")),key:Mt,extra:Dn.createElement(Et.Z,{align:"middle",onClick:Bt=>Bt.stopPropagation()},wi&&Dn.createElement(ot.Z,null,Dn.createElement(st.default.Item,di(Sn({},_t),{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5C0F\u9898\u5206\u503C"}],label:"\u5206\u503C",name:[Mt,"question_score"],className:At.Z.blankInputNumberWrapper}),Dn.createElement(We.Z,{className:At.Z.blankInput,placeholder:"\u8BF7\u8F93\u5165\u5F53\u524D\u5C0F\u9898\u5206\u6570",min:.1,precision:1,max:100,style:{width:150}}))),Dn.createElement(ot.Z,null,Dn.createElement(Et.Z,{align:"middle",className:"pl40",justify:"end"},Ni!==0&&Dn.createElement("div",{onClick:()=>{var Bt;Vn(Ni,Ni-1);const Kn=(Bt=Xn.getFieldValue("sub_item_banks"))==null?void 0:Bt.map((li,Qt)=>(be.map((jt,Un)=>{Qt===Un&&(li.q_position=Number(jt.name)+1)}),li));Xn.setFieldValue("sub_item_banks",Kn)}},Dn.createElement(Tt.Z,{title:"\u4E0A\u79FB"},Dn.createElement("i",{className:"iconfont icon-shangyi3 c-grey-999 primary-hover"}))),Ni<be.length-1&&Dn.createElement("div",{onClick:()=>{var Bt;Vn(Ni,Ni+1);const Kn=(Bt=Xn.getFieldValue("sub_item_banks"))==null?void 0:Bt.map((li,Qt)=>(be.map((jt,Un)=>{Qt===Un&&(li.q_position=Number(jt.name)+1)}),li));Xn.setFieldValue("sub_item_banks",Kn)},className:Ni===0?"":"ml15"},Dn.createElement(Tt.Z,{title:"\u4E0B\u79FB"},Dn.createElement("i",{className:"iconfont icon-xiayi3 c-grey-999 primary-hover"}))))),Dn.createElement(ot.Z,null,Dn.createElement(Tt.Z,{title:"\u5220\u9664"},Dn.createElement(De.Z,{className:`${At.Z.deleteIcon} ml15`,onClick:()=>fi(Mt)}))))},Dn.createElement(st.default.Item,di(Sn({},_t),{name:Mt}),(((xn=si==null?void 0:si[Mt])==null?void 0:xn.item_type)=="SINGLE"||((ni=si==null?void 0:si[Mt])==null?void 0:ni.item_type)=="MULTIPLE")&&Dn.createElement(le.u,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((sr=si==null?void 0:si[Mt])==null?void 0:sr.item_type)=="MULTIPLE",form:Xn,choiceKey:[Mt,"choices"],titleKey:[Mt,"name"],analysisKey:[Mt,"analysis"],choiceOptionsPath:["sub_item_banks",Mt,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((br=si==null?void 0:si[Mt])==null?void 0:br.item_type)=="COMPLETION"&&Dn.createElement(pn,{form:Xn,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,name:Mt,titleKey:[Mt,"name"],analysisKey:[Mt,"analysis"],isOrdered:[Mt,"is_ordered"],answerKey:[Mt,"standard_answers"]}),((Yn=si==null?void 0:si[Mt])==null?void 0:Yn.item_type)=="JUDGMENT"&&Dn.createElement(Pt,{form:Xn,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[Mt,"name"],analysisKey:[Mt,"analysis"],choiceKey:[Mt,"choices"]}),((at=si==null?void 0:si[Mt])==null?void 0:at.item_type)=="SUBJECTIVE"&&Dn.createElement(wn,{showKeywords:!0,isMustKeyWords:!1,form:Xn,titleKey:[Mt,"name"],analysisKey:[Mt,"analysis"],answerTexts:[Mt,"answer_texts"],useKeywords:[Mt,"use_keywords"],keywords:[Mt,"keywords"],indexs:Mt,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})),be.length<20&&Dn.createElement(ct.Z,{menu:{items:[{label:Dn.createElement("div",{onClick:()=>{mn({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"SINGLE"}),ji([be==null?void 0:be.length,...nr])}},"\u5355\u9009\u9898"),key:"1",show:!0},{label:Dn.createElement("div",{onClick:()=>{mn({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"MULTIPLE"}),ji([be==null?void 0:be.length,...nr])}},"\u591A\u9009\u9898"),key:"2",show:!0},{label:Dn.createElement("div",{onClick:()=>{mn({name:"",choices:[{choice_text:"\u6B63\u786E",is_answer:0},{choice_text:"\u9519\u8BEF",is_answer:0}],analysis:"",item_type:"JUDGMENT"}),ji([be==null?void 0:be.length,...nr])}},"\u5224\u65AD\u9898"),key:"3",show:!0},{label:Dn.createElement("div",{onClick:()=>{mn({name:"",analysis:"",is_ordered:!0,standard_answers:[],item_type:"COMPLETION",downcase:!0,no_space:!0}),ji([be==null?void 0:be.length,...nr])}},"\u586B\u7A7A\u9898"),key:"4",show:!0},{label:Dn.createElement("div",{onClick:()=>{mn({name:"",answer_texts:[],keywords:[],use_keywords:!0,analysis:"",item_type:"SUBJECTIVE"}),ji([be==null?void 0:be.length,...nr])}},"\u7B80\u7B54\u9898"),key:"5",show:!0}].filter(Di=>Di.show).map(Di=>({label:Di.label,key:Di.key}))}},Dn.createElement("div",{className:`${At.Z.addBtn}`},"\u6DFB\u52A0\u5C0F\u9898")))}))};var kr=Le(68571)},76902:function(Zn,ei,Le){"use strict";Le.d(ei,{z:function(){return lt},Z:function(){return Qe}});var le=Le(59301),Ke=Le(8944),it=Le(81428),bt=Le(64018),vt=Le(15360),Oe=Le(346),st=Le(51257),Et=Le(15342),ot=Le(1012),We=Le(45677),Tt=Le(59301),At=({html:Ue})=>{const dt=(0,le.useRef)(null),$e=(0,le.useRef)(null),wt=`.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,le.useEffect)(()=>{const St=dt.current.attachShadow({mode:"open"});$e.current=document.createElement("div"),$e.current.className="markdown-body",$e.current.innerHTML=Ue,St.appendChild($e.current);const Lt=document.createElement("style");return Lt.textContent=wt,St.appendChild(Lt),()=>{St.innerHTML=""}},[]),(0,le.useEffect)(()=>{$e.current&&($e.current.innerHTML=Ue)},[Ue]),Tt.createElement("div",{ref:dt})};function De(Ue){const dt=["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"],$e=new RegExp(`\\b(${dt.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return Ue.replace($e,"").trim()}var ne=Object.defineProperty,te=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,ge=(Ue,dt,$e)=>dt in Ue?ne(Ue,dt,{enumerable:!0,configurable:!0,writable:!0,value:$e}):Ue[dt]=$e,ye=(Ue,dt)=>{for(var $e in dt||(dt={}))de.call(dt,$e)&&ge(Ue,$e,dt[$e]);if(te)for(var $e of te(dt))se.call(dt,$e)&&ge(Ue,$e,dt[$e]);return Ue};const we="@\u2581\u2581@",Ce="@\u2581@",_e=/<pre[^>]*>/g;function Ze(Ue){let dt=document.createElement("div");return dt.innerHTML=Ue,dt.childNodes.length===0?"":dt.childNodes[0].nodeValue}const lt=(Ue,dt)=>{Ue=Ue||"";const $e=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,wt=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,St=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Lt=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return dt?Ue.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace($e,(pn,en,vn,rn,nt,rt,dn)=>{const ri=en||rn||rt,Hn=vn||nt||dn||"?";return Oe.Z.API_SERVER+"/api/attachments/"+ri+Hn+"&t="+(0,st.Jn)(ri,Date.now())+(pn.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(Ue=Ue.replace(Lt,(pn,en,vn,rn,nt,rt,dn)=>{const ri=en||rn||rt,Hn=vn||nt||dn||"?";return Oe.Z.API_SERVER+"/attachments/download/"+ri+Hn+"&t="+(0,st.Jn)(ri,Date.now())+(pn.indexOf(")")>-1?")":"&")}).replace($e,(pn,en,vn,rn,nt,rt,dn)=>{const ri=en||rn||rt,Hn=vn||nt||dn||"?";return Oe.Z.API_SERVER+"/api/attachments/"+ri+Hn+"&t="+(0,st.Jn)(ri,Date.now())+(pn.indexOf(")")>-1?")":"&")}).replace(wt,(pn,en,vn,rn,nt)=>{const rt=en||rn,dn=vn||nt||"";return'"'+Oe.Z.API_SERVER+"/api/attachments/"+rt+dn+rt+dn+"&t="+(0,st.Jn)(rt,Date.now())}).replace(St,(pn,en,vn,rn,nt)=>{const rt=en||rn,dn=vn||nt||"";return"("+Oe.Z.API_SERVER+"/files/uploads/"+rt+dn+rt+dn+"&t="+(0,st.Jn)(rt,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,`
`),Ue)};var Qe=({value:Ue="",className:dt,showTextOnly:$e,showLines:wt,style:St={},stylesPrev:Lt={},highlightKeywords:pn,showProgramFill:en,isProgramFill:vn,disabledFill:rn=!1,programFillValue:nt,onFillChange:rt=Hn=>{},onFillBlur:dn=()=>{},onFillFocus:ri=()=>{}})=>{let Hn=De(String(Ue||""));const[Wt,En]=(0,le.useState)(""),[An,ci]=(0,le.useState)("office"),[It,Pt]=(0,le.useState)([]),Nt=(0,le.useRef)("a"+(0,ot.Z)()),ii={},Gi=Dt=>/<style[\s\S]*?>/i.test(Dt||""),ze=(Dt,Zt,hn)=>{const wn=document.createElement(Dt===Ce?"input":"textarea");wn.style.width="100%",wn.style.height=Dt===Ce?"40px":"151px",wn.rows=5,wn.spellcheck=!1,wn.name="edu-program-fill",wn.placeholder="\u8BF7\u8F93\u5165",wn.dataset.id=Zt;const Dn=Object.keys(ii).length;return ii[Dn]=wn,`<span class="edu-program-fill-wrap ${Dt===Ce?"":"show"}" style="width:${Dt===Ce?"400px":"100%"}" title=${hn||""}><span>${wn.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Me(Dt){return Dt=Dt.replace(/!\[.*?\]\(.*?\)/g,""),Dt=Dt.replace(/\[.*?\]\(.*?\)/g,""),Dt=Dt.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),Dt=Dt.replace(/<embed.*?>/g,""),Dt=Dt.replace(/<img.*?>/g,""),Dt=Dt.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),Dt=Dt.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),Dt=Dt.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),Dt=Dt.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),Dt}const Ee=Dt=>!$e&&Gi(Hn)?Dt:Dt.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Zt,hn){let wn=hn.replace(/(\n|\r)/g,"").split("}"),Dn=[];return wn.map(Tn=>{Tn!=""&&Dn.push(`.${Nt.current} ${Tn}`)}),`<style>${Dn.join("}")}</style>`}),Te=(0,le.useMemo)(()=>{try{const wn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,Dn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Tn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,Mi=/\(\/attachments\/download\//g;Hn=Hn.replace(Mi,"("+Oe.Z.API_SERVER+"/attachments/download/").replace(wn,"("+Oe.Z.API_SERVER+"/api/attachments/").replace(Dn,'"'+Oe.Z.API_SERVER+"/api/attachments/").replace(Tn,'"'+Oe.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(wn){}if(en){let wn=-1;return Hn=Hn.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,function(Dn,Tn,Mi){var tn;return++wn,ze(Dn,wn,(tn=nt==null?void 0:nt[wn])==null?void 0:tn.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))}),`<pre style="background:#fff;padding:4px">${Ee(Hn||"")}</pre>`}let Dt=Ee(Hn);Dt=(0,it.ZP)(Dt);const Zt=(0,it.ez)();Hn.match(/\[TOC\]/)&&(Dt=Dt.replace("<p>[TOC]</p>",(0,it.Qv)()),(0,it.Iy)()),Dt=Dt.replace(/(__special_katext_id_\d+__)/g,(wn,Dn)=>{const{type:Tn,expression:Mi}=Zt[Dn];return(0,Et.renderToString)(Ze(Mi)||"",{displayMode:Tn==="block",throwOnError:!1,output:"html"})}),Dt=Dt.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,it.AL)();const hn=document.createElement("div");if(hn.innerHTML=Dt,$e)return hn.innerText;if(pn){const wn=pn.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return an(hn,wn),hn.innerHTML}return setTimeout(()=>kt(),500),hn.innerHTML},[Hn,pn]);(0,le.useEffect)(()=>{Xt.current&&Xt.current.querySelectorAll(["input","textarea"]).forEach(Zt=>{Zt.oninput=He,Zt.onblur=Ae,Zt.onfocus=qe})},[It]),(0,le.useEffect)(()=>{var Dt,Zt,hn,wn,Dn;if(nt!=null&&nt.length)try{const Tn=Xt.current.querySelectorAll(".edu-program-fill-score"),Mi=Xt.current.querySelectorAll('[name="edu-program-fill"]');for(const[tn,qt]of Mi.entries())qt.value=((Dt=nt==null?void 0:nt[tn])==null?void 0:Dt.value)||"",((Zt=nt==null?void 0:nt[tn])==null?void 0:Zt.type)==="warning"?qt.className="program-fill-warning":((hn=nt==null?void 0:nt[tn])==null?void 0:hn.type)==="success"?qt.className="program-fill-success":qt.className="";for(const[tn,qt]of Tn.entries())qt.innerHTML=(wn=nt==null?void 0:nt[tn])!=null&&wn.score?`${(Dn=nt==null?void 0:nt[tn])==null?void 0:Dn.score}\u5206`:"";Pt(nt)}catch(Tn){console.log(Tn,"error")}},[nt]);const He=Dt=>{It[Dt.target.dataset.id]=It[Dt.target.dataset.id]||{},It[Dt.target.dataset.id].value=Dt.target.value,Pt([...It]),rt(It,Dt.target.dataset.id)},Ae=Dt=>{It[Dt.target.dataset.id]=It[Dt.target.dataset.id]||{},It[Dt.target.dataset.id].value=Dt.target.value,Pt([...It]),dn(It,Dt.target.dataset.id)},qe=Dt=>{It[Dt.target.dataset.id]=It[Dt.target.dataset.id]||{},It[Dt.target.dataset.id].value=Dt.target.value,Pt([...It]),ri(It,Dt.target.dataset.id)};function an(Dt,Zt){return Dt.childNodes.forEach(hn=>{var wn;if(hn.childNodes.length>0)an(hn,Zt);else if(hn.nodeName!=="IMG")if(hn.innerHTML)hn.innerHTML=(wn=hn.innerHTML)==null?void 0:wn.replace(new RegExp(Zt,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const Dn=document.createElement("span");Dn.innerHTML=hn.textContent.replace(new RegExp(Zt,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),hn.replaceWith(Dn)}})}const Xt=(0,le.useRef)();it.jb.WebkitLineClamp=wt,wt&&(St=ye(ye({},St),it.jb));function yn(Dt){let Zt=Dt.target;if(Zt.tagName.toUpperCase()==="A"){let hn=Zt.getAttribute("href");if(hn.indexOf("office")>-1)Dt.preventDefault(),En(hn),ci("office");else if(hn.indexOf("application/pdf")>-1)Dt.preventDefault(),En(hn),ci("pdf");else if(hn.indexOf("text/html")>-1)Dt.preventDefault(),En(hn),ci("html");else if(hn.startsWith("#")){Dt.preventDefault();let wn=document.getElementById(hn.replace("#",""));wn&&wn.scrollIntoView(!0)}}}const kt=()=>{var Dt;const Zt=(Dt=Xt.current)==null?void 0:Dt.querySelectorAll("video");Zt==null||Zt.forEach(hn=>{if(hn.oncontextmenu=()=>!1,hn.src.indexOf(".m3u8")>-1&&!hn.canPlayType("application/vnd.apple.mpegurl")){if(vt.ZP.isSupported()){var wn=new vt.ZP;wn.loadSource(hn.src),wn.attachMedia(hn)}}})};return(0,le.useEffect)(()=>{if(Xt.current&&Te&&Te.match(_e)&&window.PR.prettyPrint(),Xt.current)return Xt.current.addEventListener("click",yn),()=>{var Dt;(Dt=Xt.current)==null||Dt.removeEventListener("click",yn),(0,it.AL)(),(0,it.Iy)()}},[Te,Xt.current,yn]),(0,le.useEffect)(()=>{var Dt;const Zt=hn=>{hn.preventDefault(),hn.clipboardData.setData("text",window.getSelection().toString())};return(Dt=Xt.current)==null||Dt.addEventListener("copy",Zt),()=>{var hn;(hn=Xt.current)==null||hn.removeEventListener("copy",Zt)}},[Xt.current]),le.createElement(le.Fragment,null,$e&&le.createElement("div",{ref:Xt},Te),!$e&&!Gi(Te)&&le.createElement("div",{ref:Xt,style:ye({},St),className:`${dt||""} ${rn?"disabled-fill":""} markdown-body ${Nt.current}`,dangerouslySetInnerHTML:{__html:Te}}),!$e&&Gi(Te)&&le.createElement(At,{html:Te}),le.createElement(We.Z,{close:!0,data:Wt,type:Wt!=null&&Wt.length?An:"",style:ye({},Lt),onClose:()=>En("")}))}},60572:function(Zn,ei,Le){"use strict";Le.d(ei,{C:function(){return pn}});var le=Le(59301),Ke={recalculation:"recalculation____i9AE",tips:"tips___GoMu8",filter:"filter___Vx7VO",input:"input___OEMMv",operating:"operating___TS9iA",operatingItem:"operatingItem___AT84q"},it=Le(92310),bt=Le.n(it),vt=Le(62673),Oe=Le(77019),st=Le(6767),Et=Le(25399),ot=Le(99571),We=Le(62957),Tt=Le(54172),ct=Le(71051),At=Le(28284),De=Le(29787),ne=Le(51257),te=Le(38986),de=Le(48790),se=Le(54650),ge=Le(9148),ye=Object.defineProperty,we=Object.defineProperties,Ce=Object.getOwnPropertyDescriptors,_e=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable,Qe=(en,vn,rn)=>vn in en?ye(en,vn,{enumerable:!0,configurable:!0,writable:!0,value:rn}):en[vn]=rn,Ue=(en,vn)=>{for(var rn in vn||(vn={}))Ze.call(vn,rn)&&Qe(en,rn,vn[rn]);if(_e)for(var rn of _e(vn))lt.call(vn,rn)&&Qe(en,rn,vn[rn]);return en},dt=(en,vn)=>we(en,Ce(vn)),$e=(en,vn,rn)=>new Promise((nt,rt)=>{var dn=Wt=>{try{Hn(rn.next(Wt))}catch(En){rt(En)}},ri=Wt=>{try{Hn(rn.throw(Wt))}catch(En){rt(En)}},Hn=Wt=>Wt.done?nt(Wt.value):Promise.resolve(Wt.value).then(dn,ri);Hn((rn=rn.apply(en,vn)).next())});const wt=vt.default.Group,St=({className:en,title:vn,items:rn=[],value:nt,onChange:rt})=>{const dn=(rn==null?void 0:rn.length)===(nt==null?void 0:nt.length),ri=(nt==null?void 0:nt.length)>0&&(nt==null?void 0:nt.length)<(rn==null?void 0:rn.length),Hn=Wt=>{const En=rn.map(An=>An.id);rt(Wt.target.checked?En:[])};return le.createElement(Oe.Z,{align:"middle",className:en},!!vn&&le.createElement("div",{className:"mr20",style:{color:"#5F6368"}},vn),le.createElement(vt.default,{indeterminate:ri,onChange:Hn,checked:dn},"\u5168\u90E8"),le.createElement(wt,{value:nt,onChange:rt},rn.map(Wt=>le.createElement(vt.default,{className:"ml30 c-black",key:Wt.id,value:Wt.id},Wt.name,le.createElement("span",null,`(${Wt.count})`)))))};var pn=({className:en,style:vn,dataSource:rn})=>{var nt,rt,dn,ri,Hn,Wt,En;const[An,ci]=(0,le.useState)({}),[It,Pt]=(0,le.useState)(!0),[Nt,ii]=(0,le.useState)(!1),[Gi,ze]=(0,le.useState)(!1),[Me,Ee]=(0,le.useState)(null),[Te,He]=(0,le.useState)(0),[Ae,qe]=(0,le.useState)({}),[an,Xt]=(0,le.useState)(!0),[yn,kt]=(0,le.useState)(0),[Dt,Zt]=(0,le.useState)(0),[hn,wn]=(0,le.useState)(!1),Dn=(0,le.useRef)(null),[Tn,Mi]=(0,le.useState)(!1),[tn,qt]=(0,le.useState)(!0),[un,zn]=(0,le.useState)([]),on={page:1,per_page:5,keyword:"",review:[],question_status:[],success_status:[],sort_by:null,direction:null},[Sn,di]=(0,le.useState)(Ue({},on));(0,le.useEffect)(()=>{rn!=null&&rn.question_id&&ci(rn)},[rn==null?void 0:rn.question_id]),(0,le.useEffect)(()=>{var mn;if(((mn=An==null?void 0:An.exercise_question_resubmit)==null?void 0:mn.status)==="running"){const fi=setInterval(()=>{Hi()},3e3);return()=>clearInterval(fi)}},[(nt=An==null?void 0:An.exercise_question_resubmit)==null?void 0:nt.status]),(0,le.useEffect)(()=>{var mn;Gi&&(Gi===1&&(Sn.question_status=kr.map(fi=>fi.value),Sn.review=Gn.map(fi=>fi.value)),Gi===2&&(Sn.exercise_question_resubmit_id=(mn=An==null?void 0:An.exercise_question_resubmit)==null?void 0:mn.id,Me===1&&(Sn.success_status=[1]),Me===2&&(Sn.success_status=[0])),di(Ue({},Sn)),Ui(Sn),Zt(An!=null&&An.is_mirror?3:10),kt(An!=null&&An.is_mirror?1:5))},[Gi]),(0,le.useEffect)(()=>{Tn&&gi()},[Tn]);const Ui=mn=>$e(void 0,null,function*(){Pt(!0);const fi=yield(0,te.ZP)(`/api/exercise_questions/${An==null?void 0:An.question_id}/resubmit_student_list.json`,{method:"get",params:mn});(fi==null?void 0:fi.status)==0&&(qe(fi||[]),He(fi==null?void 0:fi.count)),Pt(!1)}),gi=()=>$e(void 0,null,function*(){qt(!0);const mn=yield(0,te.ZP)(`/api/exercise_questions/${An==null?void 0:An.question_id}/resubmit_history.json`,{method:"get"});(mn==null?void 0:mn.status)==0&&zn((mn==null?void 0:mn.data)||[]),qt(!1)}),Hi=()=>$e(void 0,null,function*(){const mn=yield(0,te.ZP)(`/api/exercise_questions/${An==null?void 0:An.question_id}/resubmit_status.json`,{method:"get"});(mn==null?void 0:mn.status)==0&&ci(dt(Ue({},An),{show_resubmit_history:!0,exercise_question_resubmit:(mn==null?void 0:mn.data)||{}}))}),kr=[{label:"\u672A\u8BC4\u6D4B",value:2,color:"#9096A3"},{label:"\u672A\u901A\u5173",value:0,color:"#E30000"},{label:"\u5DF2\u901A\u5173",value:1,color:"#00B187"}],Gn=[{label:"\u672A\u8BC4\u9605",value:0,color:"#9096A3"},{label:"\u8BC4\u9605\u4E2D",value:2,color:"#FF9D18"},{label:"\u5DF2\u8BC4\u9605",value:1,color:"#3061D0"}],On=[{label:"\u6210\u529F",value:1,color:"#00B187"},{label:"\u5931\u8D25",value:0,color:"#E30000"}],Xn=[{title:"\u5E8F\u53F7",dataIndex:"key",render:(mn,fi,Vn)=>le.createElement("span",{className:"c-black"},Vn+1+(Sn.page-1)*Sn.per_page)},{title:"\u59D3\u540D",dataIndex:"user_name",render:mn=>le.createElement("span",{className:"c-black"},mn)},{title:"\u5B66\u53F7",dataIndex:"student_id",sorter:!0,render:mn=>le.createElement("span",{className:"c-grey-666"},mn||"--")},{title:"\u5206\u73ED",dataIndex:"group_name",render:mn=>le.createElement("span",{className:"c-black"},mn)},{title:"\u9898\u76EE\u72B6\u6001",dataIndex:"question_status",render:mn=>{const{label:fi,color:Vn}=kr.find(si=>si.value===mn)||{};return le.createElement("span",{style:{color:Vn}},fi)}},{title:"\u9898\u76EE\u5F97\u5206",dataIndex:"question_score",sorter:!0,render:mn=>le.createElement("span",{className:"c-black"},mn)},{title:"\u6700\u7EC8\u6210\u7EE9",dataIndex:"score",sorter:!0,render:mn=>le.createElement("span",{className:"c-black"},mn)},{title:"\u8BC4\u9605\u72B6\u6001",dataIndex:"review",render:mn=>{const{label:fi,color:Vn}=Gn.find(si=>si.value===mn)||{};return le.createElement("span",{style:{color:Vn}},fi)}},Gi===2&&{title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",dataIndex:"success_status",render:mn=>{const{label:fi,color:Vn}=On.find(si=>si.value===mn)||{};return le.createElement("span",{style:{color:Vn}},fi)}}].filter(Boolean),wi=(mn,fi,Vn)=>{Sn.page=mn==null?void 0:mn.current,Sn.per_page=mn==null?void 0:mn.pageSize,Vn!=null&&Vn.order?(Sn.sort_by=Vn==null?void 0:Vn.field,Sn.direction=(Vn==null?void 0:Vn.order)==="ascend"?"asc":"desc"):(Sn.sort_by=null,Sn.direction=null),di(Ue({},Sn)),Ui(Sn)},nr=()=>{if(!yn){st.ZP.warning("\u8BF7\u8F93\u5165\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570");return}wn(!0)},ji=()=>$e(void 0,null,function*(){var mn,fi;if((mn=Dn.current)!=null&&mn.onVerify())return;ii(!0);const Vn=yield(0,te.ZP)(`/api/exercise_questions/${An==null?void 0:An.question_id}/resubmit.json`,{method:"post",body:{keyword:Sn.keyword,question_status:Sn.question_status,review:Sn.review_status,success_status:Sn.success_status,use_max_score:an,permits:yn,exercise_question_resubmit_id:Gi===1?null:(fi=An==null?void 0:An.exercise_question_resubmit)==null?void 0:fi.id}});(Vn==null?void 0:Vn.status)==0&&(yield Hi(),st.ZP.success("\u64CD\u4F5C\u6210\u529F"),wn(!1),ze(!1)),ii(!1)}),Cr=(mn,fi)=>{Sn.page=1,Sn[fi]=mn,di(Ue({},Sn)),Ui(Sn)},be=["","\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 le.createElement(le.Fragment,null,le.createElement("div",{className:bt()(Ke.recalculation,en),style:vn},le.createElement(Et.Z,{title:be[(An==null?void 0:An.disable_resubmit_reason)||0]},le.createElement(ot.ZP,{disabled:(An==null?void 0:An.disable_resubmit)||((rt=An==null?void 0:An.exercise_question_resubmit)==null?void 0:rt.status)==="running",onClick:()=>ze(1),icon:le.createElement("i",{className:"iconfont icon-zhongxinpingce font14"}),type:"primary",ghost:!0},"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206")),(An==null?void 0:An.show_resubmit_history)&&le.createElement(le.Fragment,null,((dn=An==null?void 0:An.exercise_question_resubmit)==null?void 0:dn.status)==="running"?le.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",le.createElement("span",{className:"c-light-primary ml3"},(ri=An==null?void 0:An.exercise_question_resubmit)==null?void 0:ri.rate)):le.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",le.createElement("span",{onClick:()=>{ze(2),Ee(1)},className:"current",style:{color:"#3061D0",textDecoration:"underline",margin:"0 3px"}},(Hn=An==null?void 0:An.exercise_question_resubmit)==null?void 0:Hn.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",le.createElement("span",{onClick:()=>{ze(2),Ee(2)},className:"current",style:{color:"#E30000",textDecoration:"underline",margin:"0 3px"}},(Wt=An==null?void 0:An.exercise_question_resubmit)==null?void 0:Wt.fail_count),"\u4EBA"),le.createElement(Et.Z,{title:"\u64CD\u4F5C\u8BB0\u5F55"},le.createElement("i",{onClick:()=>Mi(!0),className:"iconfont icon-chakanshenqingjilu c-light-primary current font14"})))),le.createElement(We.default,{centered:!0,open:!!Gi,title:`\u91CD\u65B0\u8BC4\u6D4B${Gi===1?"\u7B97\u5206":"\u7ED3\u679C"}`,width:870,okText:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",onCancel:()=>ze(!1),onOk:nr,afterClose:()=>{Xt(!0),Ee(null),di(Ue({},on))}},le.createElement("div",{className:Ke.filter},Gi===1&&le.createElement(le.Fragment,null,le.createElement("div",{className:Ke.tips},le.createElement("div",{className:"mb5",style:{color:"#FF9D18"}},le.createElement("i",{className:"iconfont icon-tishi9 mr10 font14"}),"\u6E29\u99A8\u63D0\u793A"),le.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"),le.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"),le.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")),le.createElement(St,{className:"mt10",title:"\u9898\u76EE\u72B6\u6001",items:(Ae==null?void 0:Ae.question_status)||[],value:Sn.question_status,onChange:mn=>Cr(mn,"question_status")}),le.createElement(St,{className:"mt10",title:"\u8BC4\u9605\u72B6\u6001",items:(Ae==null?void 0:Ae.review_status)||[],value:Sn.review,onChange:mn=>Cr(mn,"review")})),Gi===2&&le.createElement(le.Fragment,null,le.createElement(St,{className:"mt10",title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",items:(Ae==null?void 0:Ae.success_status)||[],value:Sn.success_status,onChange:mn=>Cr(mn,"success_status")})),le.createElement(ge.t7,{className:Ke.input,style:{bottom:Gi===1?10:-5},value:Sn.keyword,onChange:mn=>Cr(mn,"keyword"),placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22"})),le.createElement(Tt.default,{className:"mt20",columns:Xn,scroll:((En=Ae==null?void 0:Ae.data)==null?void 0:En.length)>7?{y:300}:{},dataSource:(Ae==null?void 0:Ae.data)||[],loading:It,onChange:wi,pagination:{total:Te,pageSize:Sn.per_page,current:Sn.page,hideOnSinglePage:!Te,showSizeChanger:!0,pageSizeOptions:["5","10","20","50","100"],showQuickJumper:!0,size:"default",showTotal:ne.rU}}),le.createElement(Oe.Z,{justify:"space-between",align:"middle",className:"mt10"},le.createElement(vt.default,{className:"c-black",checked:an,onChange:mn=>Xt(mn.target.checked)},"\u91CD\u65B0\u8BC4\u6D4B\u540E\u7684\u5206\u6570\u5927\u4E8E\u539F\u6765\u7684\u5206\u6570\u624D\u66F4\u65B0\u6210\u7EE9"),(0,de.Ny)()&&le.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570",le.createElement(ct.Z,{className:"ml10 mr10",value:yn,max:Dt,min:1,precision:0,onChange:mn=>kt(mn)}),"\u4EBA",le.createElement(Et.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"},le.createElement("i",{style:{color:"#9096A3"},className:"iconfont icon-tishi5 font13 ml10"}))))),le.createElement(We.default,{centered:!0,title:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",open:hn,width:494,zIndex:1001,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Nt,destroyOnClose:!0,onOk:ji,onCancel:()=>wn(!1)},le.createElement(At.default.Item,{className:"mb0",colon:!1,label:"\u9A8C\u8BC1\u7801",name:"code",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"}]},le.createElement(se.Z,{ref:mn=>Dn.current=mn}))),le.createElement(We.default,{centered:!0,title:"\u64CD\u4F5C\u8BB0\u5F55",open:Tn,width:710,onCancel:()=>Mi(!1),footer:null},le.createElement(De.Z,{spinning:tn},le.createElement("div",{className:Ke.operating},un.map((mn,fi)=>le.createElement("div",{key:fi,className:Ke.operatingItem},le.createElement("div",{style:{flex:"0 0 180px"},className:"c-grey-666"},mn==null?void 0:mn.created_at),le.createElement("div",{className:"c-black"},mn==null?void 0:mn.user_name,"\u64CD\u4F5C\u4E86\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206"),(mn==null?void 0:mn.status)==="running"?le.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",le.createElement("span",{className:"c-light-primary ml3"},mn==null?void 0:mn.rate)):le.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",le.createElement("span",{style:{color:"#3061D0",margin:"0 3px"}},mn==null?void 0:mn.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",le.createElement("span",{style:{color:"#E30000",margin:"0 3px"}},mn==null?void 0:mn.fail_count),"\u4EBA")))),le.createElement("div",{style:{height:20}}))))}},3039:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Et}});var le=Le(59301),Ke={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"},it=Le(62957),bt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAPCAYAAADUFP50AAAAAXNSR0IArs4c6QAAAUFJREFUOE+V0ktKw1AUxvH/rVqIxT4wkgwEUSmK4APRBfiYCKU7cOZEBOkadAMZiwhuwJETBQciFRTtwJkPBLW2BRGrRanU9kpN2sSYiGaWc/PjuznnCN2Qh8AkPo+AzXxKLLiPhW7ICtDqB4GzQkqM/huGFZgZcDCBBDaaicsTMKbZH2xfwdY5/ICAEGSasC0AwRYblj+gKkENwfy4WS9V4LHsgsk49EZteJKHdBa6w7AybdZzr3D64ILxGKjtNrx9gfsSRBSYtf6xZh1/u+qQClrIhtdFuHmGvhisJcz65RPsZl2Jc/3QE7FhpgDHuT80x2+O9cR1K/GiCDt3rkQ/+Ns43gDFD0YVmHIuQGOOmiGTARhxwkGd1cZ7Vwd0OppWr3911StpcV++Iwn67q/kyBMuHchErcqwFxT1XZXsfQJqo2zI6kdI4QAAAABJRU5ErkJggg==",vt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAW1JREFUOE+dkj1IQmEUht9z/blp4VQEjS39eW+oSCFCpFCI4BiKFGWWQUSrCjVVg+lQNJZQDZGNTm1B4NTibS3n2lo0wuqEN8i/a0HfeN7v+d73nO+QJEcKAJzQPAwCnSpKNtoqkyRHqgDrtUFAb6Rnedx43KgT6O5P0GQijFiNLe/Sy3/B8g+YTIRRrb5jP32JYNADr8eOldU0RJEqVlm8r1kyuA/AIEB10OWy4vBgA4ryCIdjCJlMDmfn1zAY6EmyGY/UrAwrgGATWKsn4mGEQl4Uiw+YX9hT73aZiEcl8eMbZAGA0AT6/ZPY3Ykiny/A55tA7uoGqdQFBD2VbDbDugoSTTEj3gTGYgG8Vt7UeG63hNkZJ7a2s+gw1XqPnf5REKhkt4kxNakO08ycbOtRC/7FcakCwNTJ0WwmDI+1LUCZZDkSYGa5Eewf0G0KAnprNYtFQHdPbZhNS1cmLafF5bUTJsyBSVMHPm+/ADTrfrtCH68WAAAAAElFTkSuQmCC",Oe=(ot,We,Tt)=>new Promise((ct,At)=>{var De=de=>{try{te(Tt.next(de))}catch(se){At(se)}},ne=de=>{try{te(Tt.throw(de))}catch(se){At(se)}},te=de=>de.done?ct(de.value):Promise.resolve(de.value).then(De,ne);te((Tt=Tt.apply(ot,We)).next())}),Et=({type:ot,resdata:We,onok:Tt,oktext:ct,okloading:At})=>{const[De,ne]=(0,le.useState)(!1),{can_copy_list:te,can_copy_num:de,challenge_type:se,course_data_list:ge,no_copy_list:ye,no_copy_num:we,no_use_list:Ce,no_use_num:_e,repeat_shixun_num:Ze,student_count:lt,total_num:Qe,use_num:Ue}=We;let dt=de>0||ot==="exercise";(0,le.useEffect)(()=>{(We==null?void 0:We.student_count)>0&&ne(!0)},[We]),console.log("---11",At),(0,le.useEffect)(()=>{At||ne(!1)},[At]);const $e=()=>{if(ot==="exercise"&&se===1)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ke.orangeColor},lt),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",le.createElement("span",{className:Ke.orangeColor},Ue),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",le.createElement("span",{className:Ke.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(ot==="exercise"&&se===2)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ke.orangeColor},lt),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",le.createElement("span",{className:Ke.orangeColor},Ue),"\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",le.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ot==="shixun"&&se===1)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ke.orangeColor},lt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\uFF0C",le.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ot==="shixun"&&se===2)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ke.orangeColor},lt),"\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",le.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ot==="subject"&&se===1)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ke.orangeColor},lt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",le.createElement("span",{className:Ke.orangeColor},Ue),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",le.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ot==="subject"&&se===2)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709 ",le.createElement("span",{className:Ke.orangeColor},lt)," \u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u6311\u6218\u8FC7\u5176\u4E2D\u7684 ",le.createElement("span",{className:Ke.orangeColor},Ue)," \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",le.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ot==="exercisepush")return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ke.orangeColor},lt),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BD5\u5377\u4E2D\u7684",le.createElement("span",{className:Ke.orangeColor},Ue),"\u4E2A\u5B9E\u8DF5\u9879\u76EE \uFF0C",le.createElement("span",{className:Ke.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(ot==="shixunpush"&&se===1)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ke.orangeColor},lt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",le.createElement("span",{className:Ke.orangeColor},Ue),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",le.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ot==="shixunpush"&&se===2)return le.createElement(le.Fragment,null,"\u8BFE\u5802\u5185\u6709",le.createElement("span",{className:Ke.orangeColor},lt),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7",le.createElement("span",{className:Ke.orangeColor},Ue),"\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",le.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"))},wt=()=>{if(ot==="exercise"||ot==="subject"||ot==="exercisepush"||ot==="shixunpush")return le.createElement("div",{style:{marginTop:20}},we>0&&le.createElement("div",null,le.createElement("span",{className:Ke.flex},le.createElement("img",{src:vt,style:{width:14}}),le.createElement("span",{className:Ke.statustitle},"\u4E0D\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),le.createElement("div",{className:Ke.statusbody},ot==="exercise"&&le.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",le.createElement("span",{className:Ke.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"),(ot==="subject"||ot==="exercisepush")&&le.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",dt&&le.createElement("span",{className:Ke.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"),ot==="shixunpush"&&le.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",dt&&le.createElement("span",{className:Ke.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"),le.createElement("div",null,ye==null?void 0:ye.map((St,Lt)=>le.createElement("a",{href:`/shixuns/${St.identifier}/challenges`,target:"_blank"},"\u300A",St==null?void 0:St.name,"\u300B",Lt+1!==we&&"\u3001"))))),de>0&&le.createElement("div",{style:{marginTop:20}},le.createElement("span",{className:Ke.flex},le.createElement("img",{src:bt,style:{width:14}}),le.createElement("span",{className:Ke.statustitle},"\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),le.createElement("div",{className:Ke.statusbody},ot==="exercise"&&le.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"),(ot==="subject"||ot==="exercisepush")&&le.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"),ot==="shixunpush"&&le.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"),le.createElement("div",null,te==null?void 0:te.map((St,Lt)=>le.createElement("a",{href:`/shixuns/${St.identifier}/challenges`,target:"_blank"},"\u300A",St==null?void 0:St.name,"\u300B",Lt+1!==de&&"\u3001"))))));if(ot==="shixun")return le.createElement("div",{style:{marginTop:20}},de>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 le.createElement(it.default,{open:De,onCancel:()=>{ne(!1)},cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",width:700,centered:!0,cancelButtonProps:{style:{display:!dt&&"none"}},zIndex:1003,confirmLoading:At,okText:dt?ct:"\u6211\u77E5\u9053\u4E86",onOk:()=>Oe(void 0,null,function*(){dt?yield Tt([...te,...Ce]):ne(!1)})},le.createElement("div",{style:{maxHeight:600,overflow:"auto"}},$e(),wt()))}},90283:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Oe}});var le=Le(59301),Ke={btn:"btn___kReTL",redBtn:"redBtn___UFEL0"},it=Le(92310),bt=Le.n(it),Oe=({className:st,style:Et,state:ot,onClick:We})=>{var Tt,ct;return le.createElement("div",{onClick:We,className:bt()(ot?(Tt=Ke)==null?void 0:Tt.redBtn:(ct=Ke)==null?void 0:ct.btn,st),style:Et},ot?le.createElement(le.Fragment,null,le.createElement("i",{className:"iconfont icon-biaoji1"}),le.createElement("span",null,"\u53D6\u6D88\u6807\u8BB0\u9519\u9898")):le.createElement(le.Fragment,null,le.createElement("i",{className:"iconfont icon-biaojigaiti"}),le.createElement("span",null,"\u6807\u8BB0\u9519\u9898")))}},69720:function(Zn,ei,Le){"use strict";Le.d(ei,{h:function(){return we}});var le=Le(59301),Ke=Le(82326),it=Le(28284),bt=Le(99571),vt=Le(89780),Oe=Le.n(vt),st=Le(8336),Et=Le(12469),ot=Object.defineProperty,We=Object.defineProperties,Tt=Object.getOwnPropertyDescriptors,ct=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,ne=(Ce,_e,Ze)=>_e in Ce?ot(Ce,_e,{enumerable:!0,configurable:!0,writable:!0,value:Ze}):Ce[_e]=Ze,te=(Ce,_e)=>{for(var Ze in _e||(_e={}))At.call(_e,Ze)&&ne(Ce,Ze,_e[Ze]);if(ct)for(var Ze of ct(_e))De.call(_e,Ze)&&ne(Ce,Ze,_e[Ze]);return Ce},de=(Ce,_e)=>We(Ce,Tt(_e));const se=Ke.default.Option,ge={labelCol:{span:4},wrapperCol:{span:20}},ye={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"]};ei.Z=({callback:Ce,onCancel:_e})=>{const[Ze,lt]=(0,le.useState)("python");function Qe(dt){lt(ye[dt][1])}function Ue(dt){Ce(dt)}return le.createElement(it.default,de(te({},ge),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Ue,style:{width:500}}),le.createElement(it.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},le.createElement(Ke.default,{getPopupContainer:dt=>dt.parentNode,onChange:Qe},Object.keys(ye).map(dt=>le.createElement(se,{key:dt,value:dt},ye[dt][0])))),le.createElement(it.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},le.createElement(we,{mode:Ze})),le.createElement("div",{className:"flex-container flex-end"},le.createElement(bt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),le.createElement(bt.ZP,{type:"ghost",onClick:_e},"\u53D6\u6D88")))};function we({value:Ce,onChange:_e,mode:Ze,options:lt={}}){const Qe=(0,le.useRef)(),[Ue,dt]=(0,le.useState)();return(0,le.useEffect)(()=>{if(Ue){let $e=function(wt){const St=wt.getValue();_e&&_e(St)};return Ue.on("change",$e),()=>{Ue.off("change",$e)}}},[Ue,_e]),(0,le.useEffect)(()=>{Ue&&Ue.setOption("mode",Ze)},[Ue,Ze]),(0,le.useEffect)(()=>{Ue&&(Ce!==Ue.getValue()||Ce==="")&&setTimeout(()=>{Ue.setValue(Ce||"")},300)},[Ue,Ce]),(0,le.useEffect)(()=>{if(Qe.current&&!Ue){const $e=Oe().fromTextArea(Qe.current,te({mode:Ze,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},lt));dt($e)}},[Qe.current,Ue]),le.createElement("div",{className:"my-codemirror-container"},le.createElement("textarea",{ref:Qe}))}},39793:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return yr}});var le=Le(59301),Ke=Le(89780),it=Le.n(Ke),bt=Le(76374),vt=Le(8336),Oe=Le(6313),st=Le(25717),Et=Le(99498),ot=Le(25419),We=Le(67549),Tt=Le(76902),ct=({value:zt="",className:Mt,showTextOnly:_t,showLines:fn,style:Ji={}})=>{const mi=(0,le.useMemo)(()=>"",[zt]);return le.createElement(le.Fragment,null,le.createElement("div",{dangerouslySetInnerHTML:{__html:mi}}))},At=Object.defineProperty,De=Object.defineProperties,ne=Object.getOwnPropertyDescriptors,te=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,ge=(zt,Mt,_t)=>Mt in zt?At(zt,Mt,{enumerable:!0,configurable:!0,writable:!0,value:_t}):zt[Mt]=_t,ye=(zt,Mt)=>{for(var _t in Mt||(Mt={}))de.call(Mt,_t)&&ge(zt,_t,Mt[_t]);if(te)for(var _t of te(Mt))se.call(Mt,_t)&&ge(zt,_t,Mt[_t]);return zt},we=(zt,Mt)=>De(zt,ne(Mt));let Ce=[{title:"\u7C97\u4F53",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"md-iconfont icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"\u6570\u5B66\u516C\u5F0F",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"md-iconfont icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function _e({onActionCallback:zt,title:Mt,icon:_t,actionName:fn,className:Ji="",children:mi}){function $i(){zt(fn)}return le.createElement("a",{title:Mt,className:Ji,onClick:$i},le.createElement("i",{className:`${_t}`}),mi)}var Ze=({watch:zt,showNullButton:Mt,showNullProgramButton:_t,onActionCallback:fn,fullScreen:Ji,insertTemp:mi,hidetoolBar:$i,extraUse:xn})=>{const ni=[...Ce,{title:`${zt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${zt?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return le.createElement("ul",{className:"markdown-toolbar-container"},!$i&&ni.map((sr,br)=>le.createElement("li",{key:br},sr.actionName?le.createElement(_e,we(ye({},sr),{onActionCallback:fn})):le.createElement("span",{className:"v-line"}))),Mt?le.createElement("li",null,le.createElement(_e,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:fn},le.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,_t?le.createElement(le.Fragment,null,le.createElement("li",null,le.createElement(_e,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:fn},le.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u5355\u884C\u586B\u7A7A\u9879"))),le.createElement("li",null,le.createElement(_e,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:fn},le.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u591A\u884C\u586B\u7A7A\u9879")))):null,mi&&le.createElement("li",null,le.createElement(_e,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${mi}`,onActionCallback:fn},le.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),xn&&le.createElement("li",null,xn),le.createElement("li",{className:"btn-full-screen"},le.createElement(_e,{icon:`${Ji?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Ji?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:fn})))},lt=Le(91558),Qe=Le(28284),Ue=Le(37568),dt=Le(99571),$e=Object.defineProperty,wt=Object.defineProperties,St=Object.getOwnPropertyDescriptors,Lt=Object.getOwnPropertySymbols,pn=Object.prototype.hasOwnProperty,en=Object.prototype.propertyIsEnumerable,vn=(zt,Mt,_t)=>Mt in zt?$e(zt,Mt,{enumerable:!0,configurable:!0,writable:!0,value:_t}):zt[Mt]=_t,rn=(zt,Mt)=>{for(var _t in Mt||(Mt={}))pn.call(Mt,_t)&&vn(zt,_t,Mt[_t]);if(Lt)for(var _t of Lt(Mt))en.call(Mt,_t)&&vn(zt,_t,Mt[_t]);return zt},nt=(zt,Mt)=>wt(zt,St(Mt));const rt={labelCol:{span:4},wrapperCol:{span:20}};var dn=({callback:zt,onCancel:Mt})=>{function _t(fn){zt(fn)}return le.createElement(Qe.default,nt(rn({},rt),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:_t,style:{width:500}}),le.createElement(Qe.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},le.createElement(Ue.default,null)),le.createElement(Qe.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},le.createElement(Ue.default,null)),le.createElement("div",{className:"flex-container flex-end"},le.createElement(dt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),le.createElement(dt.ZP,{type:"ghost",onClick:Mt},"\u53D6\u6D88")))},ri=Le(69720),Hn=Le(17077),Wt=Le(62957),En=Le(77019),An=Le(9507),ci=Le(59301),It=({callback:zt,onCancel:Mt})=>{const _t=document.createElement("canvas"),fn=_t.getContext("2d");_t.width=1e3,_t.height=800,fn.fillStyle="#ffffff",fn.fillRect(0,0,_t.width,_t.height);const Ji=_t.toDataURL("image/png");return ci.createElement(Wt.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},ci.createElement(En.Z,{style:{height:"100vh"}},ci.createElement(An.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Ji,visible:!0,title:String(Date.now())},onOk:mi=>{zt({src:mi.url})},onClose:Mt})))},Pt=Le(12378);function Nt(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(Nt,go.CommandHandler),Nt.prototype.canAlignSelection=function(){var zt=this.diagram;return!(zt===null||zt.isReadOnly||zt.isModelReadOnly||zt.selection.count<2)},Nt.prototype.alignLeft=function(){var zt=this.diagram;zt.startTransaction("aligning left");var Mt=1/0;zt.selection.each(function(_t){_t instanceof go.Link||(Mt=Math.min(_t.position.x,Mt))}),zt.selection.each(function(_t){_t instanceof go.Link||_t.move(new go.Point(Mt,_t.position.y))}),zt.commitTransaction("aligning left")},Nt.prototype.alignRight=function(){var zt=this.diagram;zt.startTransaction("aligning right");var Mt=-1/0;zt.selection.each(function(_t){if(!(_t instanceof go.Link)){var fn=_t.actualBounds.x+_t.actualBounds.width;Mt=Math.max(fn,Mt)}}),zt.selection.each(function(_t){_t instanceof go.Link||_t.move(new go.Point(Mt-_t.actualBounds.width,_t.position.y))}),zt.commitTransaction("aligning right")},Nt.prototype.alignTop=function(){var zt=this.diagram;zt.startTransaction("alignTop");var Mt=1/0;zt.selection.each(function(_t){_t instanceof go.Link||(Mt=Math.min(_t.position.y,Mt))}),zt.selection.each(function(_t){_t instanceof go.Link||_t.move(new go.Point(_t.position.x,Mt))}),zt.commitTransaction("alignTop")},Nt.prototype.alignBottom=function(){var zt=this.diagram;zt.startTransaction("aligning bottom");var Mt=-1/0;zt.selection.each(function(_t){if(!(_t instanceof go.Link)){var fn=_t.actualBounds.y+_t.actualBounds.height;Mt=Math.max(fn,Mt)}}),zt.selection.each(function(_t){_t instanceof go.Link||_t.move(new go.Point(_t.actualBounds.x,Mt-_t.actualBounds.height))}),zt.commitTransaction("aligning bottom")},Nt.prototype.alignCenterX=function(){var zt=this.diagram,Mt=zt.selection.first();if(Mt){zt.startTransaction("aligning Center X");var _t=Mt.actualBounds.x+Mt.actualBounds.width/2;zt.selection.each(function(fn){fn instanceof go.Link||fn.move(new go.Point(_t-fn.actualBounds.width/2,fn.actualBounds.y))}),zt.commitTransaction("aligning Center X")}},Nt.prototype.alignCenterY=function(){var zt=this.diagram,Mt=zt.selection.first();if(Mt){zt.startTransaction("aligning Center Y");var _t=Mt.actualBounds.y+Mt.actualBounds.height/2;zt.selection.each(function(fn){fn instanceof go.Link||fn.move(new go.Point(fn.actualBounds.x,_t-fn.actualBounds.height/2))}),zt.commitTransaction("aligning Center Y")}},Nt.prototype.alignColumn=function(zt){var Mt=this.diagram;Mt.startTransaction("align Column"),zt===void 0&&(zt=0),zt=parseFloat(zt);var _t=new Array;Mt.selection.each(function(xn){xn instanceof go.Link||_t.push(xn)});for(var fn=0;fn<_t.length-1;fn++){var Ji=_t[fn],mi=Ji.actualBounds.y+Ji.actualBounds.height+zt,$i=_t[fn+1];$i.move(new go.Point(Ji.actualBounds.x,mi))}Mt.commitTransaction("align Column")},Nt.prototype.alignRow=function(zt){zt===void 0&&(zt=0),zt=parseFloat(zt);var Mt=this.diagram;Mt.startTransaction("align Row");var _t=new Array;Mt.selection.each(function(xn){xn instanceof go.Link||_t.push(xn)});for(var fn=0;fn<_t.length-1;fn++){var Ji=_t[fn],mi=Ji.actualBounds.x+Ji.actualBounds.width+zt,$i=_t[fn+1];$i.move(new go.Point(mi,Ji.actualBounds.y))}Mt.commitTransaction("align Row")},Nt.prototype.canRotate=function(zt){var Mt=this.diagram;return!(Mt===null||Mt.isReadOnly||Mt.isModelReadOnly||Mt.selection.count<1)},Nt.prototype.rotate=function(zt){zt===void 0&&(zt=90);var Mt=this.diagram;Mt.startTransaction("rotate "+zt.toString());var Mt=this.diagram;Mt.selection.each(function(_t){_t instanceof go.Link||_t instanceof go.Group||(_t.angle+=zt)}),Mt.commitTransaction("rotate "+zt.toString())},Nt.prototype.pullToFront=function(){var zt=this.diagram;zt.startTransaction("pullToFront");var Mt=new go.Map;zt.selection.each(function(_t){Mt.set(_t.layer,0)}),Mt.iteratorKeys.each(function(_t){var fn=0;_t.parts.each(function(Ji){if(!Ji.isSelected){var mi=Ji.zOrder;isNaN(mi)?Ji.zOrder=0:fn=Math.max(fn,mi)}}),Mt.set(_t,fn)}),zt.selection.each(function(_t){Nt._assignZOrder(_t,Mt.get(_t.layer)+1)}),zt.commitTransaction("pullToFront")},Nt.prototype.pushToBack=function(){var zt=this.diagram;zt.startTransaction("pushToBack");var Mt=new go.Map;zt.selection.each(function(_t){Mt.set(_t.layer,0)}),Mt.iteratorKeys.each(function(_t){var fn=0;_t.parts.each(function(Ji){if(!Ji.isSelected){var mi=Ji.zOrder;isNaN(mi)?Ji.zOrder=0:fn=Math.min(fn,mi)}}),Mt.set(_t,fn)}),zt.selection.each(function(_t){Nt._assignZOrder(_t,Mt.get(_t.layer)-1-Nt._findGroupDepth(_t))}),zt.commitTransaction("pushToBack")},Nt._assignZOrder=function(zt,Mt,_t){_t===void 0&&(_t=zt),zt.layer===_t.layer&&(zt.zOrder=Mt),zt instanceof go.Group&&zt.memberParts.each(function(fn){Nt._assignZOrder(fn,Mt+1,_t)})},Nt._findGroupDepth=function(zt){if(zt instanceof go.Group){var Mt=0;return zt.memberParts.each(function(_t){Mt=Math.max(Mt,Nt._findGroupDepth(_t))}),Mt+1}else return 0},Nt.prototype.doKeyDown=function(){var zt=this.diagram;if(zt!==null){var Mt=zt.lastInput;if(Mt.key==="Up"||Mt.key==="Down"||Mt.key==="Left"||Mt.key==="Right"){var _t=this.arrowKeyBehavior;if(_t==="none")return;if(_t==="select"){this._arrowKeySelect();return}else if(_t==="move"){this._arrowKeyMove();return}else if(_t==="tree"){this._arrowKeyTree();return}}go.CommandHandler.prototype.doKeyDown.call(this)}},Nt.prototype._getAllParts=function(){var zt=new Array;return this.diagram.nodes.each(function(Mt){zt.push(Mt)}),this.diagram.parts.each(function(Mt){zt.push(Mt)}),zt},Nt.prototype._arrowKeyMove=function(){var zt=this.diagram,Mt=zt.lastInput,_t=0,fn=0;if(Mt.control||Mt.meta)_t=1,fn=1;else if(zt.grid!==null){var Ji=zt.grid.gridCellSize;fn=Ji.width,_t=Ji.height}zt.startTransaction("arrowKeyMove"),zt.selection.each(function(mi){Mt.key==="Up"?mi.move(new go.Point(mi.actualBounds.x,mi.actualBounds.y-_t)):Mt.key==="Down"?mi.move(new go.Point(mi.actualBounds.x,mi.actualBounds.y+_t)):Mt.key==="Left"?mi.move(new go.Point(mi.actualBounds.x-fn,mi.actualBounds.y)):Mt.key==="Right"&&mi.move(new go.Point(mi.actualBounds.x+fn,mi.actualBounds.y))}),zt.commitTransaction("arrowKeyMove")},Nt.prototype._arrowKeySelect=function(){var zt=this.diagram,Mt=zt.lastInput,_t=null;Mt.key==="Up"?_t=this._findNearestPartTowards(270):Mt.key==="Down"?_t=this._findNearestPartTowards(90):Mt.key==="Left"?_t=this._findNearestPartTowards(180):Mt.key==="Right"&&(_t=this._findNearestPartTowards(0)),_t!==null&&(Mt.shift?_t.isSelected=!0:Mt.control||Mt.meta?_t.isSelected=!_t.isSelected:zt.select(_t))},Nt.prototype._findNearestPartTowards=function(zt){var Mt=this.diagram.selection.first();if(Mt===null)return null;for(var _t=Mt.actualBounds.center,fn=this._getAllParts(),Ji=1/0,mi=Mt,$i=0;$i<fn.length;$i++){var xn=fn[$i];if(xn!==Mt&&xn.canSelect()){var ni=xn.actualBounds.center,sr=_t.directionPoint(ni),br=this._angleCloseness(sr,zt);if(br<=45){var Yn=_t.distanceSquaredPoint(ni);Yn*=1+Math.sin(br*Math.PI/180),Yn<Ji&&(Ji=Yn,mi=xn)}}}return mi},Nt.prototype._angleCloseness=function(zt,Mt){return Math.min(Math.abs(Mt-zt),Math.min(Math.abs(Mt+360-zt),Math.abs(Mt-360-zt)))},Nt.prototype._arrowKeyTree=function(){var zt=this.diagram,Mt=zt.selection.first();if(Mt instanceof go.Node){var _t=zt.lastInput;if(_t.key==="Right"){if(!Mt.isTreeLeaf)if(!Mt.isTreeExpanded)zt.commandHandler.canExpandTree(Mt)&&zt.commandHandler.expandTree(Mt);else{var fn=this._sortTreeChildrenByY(Mt).first();fn!==null&&zt.select(fn)}}else if(_t.key==="Left")if(!Mt.isTreeLeaf&&Mt.isTreeExpanded)zt.commandHandler.canCollapseTree(Mt)&&zt.commandHandler.collapseTree(Mt);else{var Ji=Mt.findTreeParentNode();Ji!==null&&zt.select(Ji)}else if(_t.key==="Up"){var Ji=Mt.findTreeParentNode();if(Ji!==null){var mi=this._sortTreeChildrenByY(Ji),$i=mi.indexOf(Mt);if($i>0){for(var xn=mi.elt($i-1);xn!==null&&xn.isTreeExpanded&&!xn.isTreeLeaf;){var ni=this._sortTreeChildrenByY(xn);xn=ni.last()}xn!==null&&zt.select(xn)}else zt.select(Ji)}}else if(_t.key==="Down")if(Mt.isTreeExpanded&&!Mt.isTreeLeaf){var fn=this._sortTreeChildrenByY(Mt).first();fn!==null&&zt.select(fn)}else for(;Mt!==null;){var Ji=Mt.findTreeParentNode();if(Ji===null)break;var mi=this._sortTreeChildrenByY(Ji),$i=mi.indexOf(Mt);if($i<mi.length-1){zt.select(mi.elt($i+1));break}else Mt=Ji}var sr=zt.selection.first();sr!==null&&zt.scrollToRect(sr.actualBounds)}},Nt.prototype._sortTreeChildrenByY=function(zt){var Mt=new go.List().addAll(zt.findTreeChildrenNodes());return Mt.sort(function(_t,fn){var Ji=_t.location,mi=fn.location;return Ji.y<mi.y?-1:Ji.y>mi.y?1:Ji.x<mi.x?-1:Ji.x>mi.x?1:0}),Mt},Nt.prototype.copyToClipboard=function(zt){go.CommandHandler.prototype.copyToClipboard.call(this,zt),this._lastPasteOffset.set(this.pasteOffset)},Nt.prototype.pasteFromClipboard=function(){var zt=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(zt,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),zt},Object.defineProperty(Nt.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(zt){if(zt!=="move"&&zt!=="select"&&zt!=="scroll"&&zt!=="tree"&&zt!=="none")throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+zt);this._arrowKeyBehavior=zt}}),Object.defineProperty(Nt.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(zt){if(!(zt instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+zt);this._pasteOffset.set(zt)}});var ii=Nt,Gi=Le(63720),ze=Le(5269),Me=Le(38986),Ee={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},Te=Le(48790),He=Le(59301),Ae=(zt,Mt,_t)=>new Promise((fn,Ji)=>{var mi=ni=>{try{xn(_t.next(ni))}catch(sr){Ji(sr)}},$i=ni=>{try{xn(_t.throw(ni))}catch(sr){Ji(sr)}},xn=ni=>ni.done?fn(ni.value):Promise.resolve(ni.value).then(mi,$i);xn((_t=_t.apply(zt,Mt)).next())});function qe({onCancel:zt,callback:Mt}){let _t=(0,le.useRef)(),fn=(0,le.useRef)(),Ji=(0,le.useRef)(),mi=(0,le.useRef)(!1);const $i=(0,le.useRef)(!1),[xn,ni]=(0,le.useState)(0);function sr(){const Yn=Pt.bx.make,at={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"};_t.current=new Pt.S0(fn.current,{padding:20,grid:Yn(Pt.s_,"Grid",Yn(Pt.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Yn(Pt.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:Ot=>{var Li=Ot.diagram.commandHandler.addTopLevelParts(Ot.diagram.selection,!0);Li||Ot.diagram.currentTool.doCancel()},commandHandler:Yn(ii),"clickCreatingTool.archetypeNodeData":{text:"\u672A\u547D\u540D",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:Ot=>{var Li=Ot.subject;Li.location=Li.location.copy().snapToGridPoint(Ot.diagram.grid.gridOrigin,Ot.diagram.grid.gridCellSize),setTimeout(()=>{Ot.diagram.commandHandler.editTextBlock()},20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:Ot=>{var Li=Ot.subject;setTimeout(()=>{Ot.diagram.commandHandler.editTextBlock()})},LinkRelinked:Ot=>{var Li=Ot.parameter.part;Li.invalidateConnectedLinks();var Sr=Ot.subject;Ot.diagram.toolManager.linkingTool.isForwards?Sr.toNode.invalidateConnectedLinks():Sr.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),_t.current.nodeTemplate=Yn(Pt.NB,"Auto",{locationSpot:Pt.z6.Center,locationObjectName:"SHAPE",desiredSize:new Pt.$u(120,60),minSize:new Pt.$u(40,40),resizable:!0,resizeCellSize:new Pt.$u(10,10),rotatable:!0},new Pt.KX("location","loc",Pt.E9.parse).makeTwoWay(Pt.E9.stringify),new Pt.KX("desiredSize","size",Pt.$u.parse).makeTwoWay(Pt.$u.stringify),Yn(Pt.bn,{name:"SHAPE",fill:at.white,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:Pt.z6.AllSides,toSpot:Pt.z6.AllSides},new Pt.KX("figure"),new Pt.KX("fill"),new Pt.KX("stroke","borderColor"),new Pt.KX("strokeWidth","thickness"),new Pt.KX("strokeDashArray","dash")),Yn(Pt.bn,{width:100,height:20,strokeWidth:0,fill:"transparent"}),Yn(Pt.al,{margin:1,textAlign:"center",overflow:Pt.al.OverflowEllipsis,editable:!0},new Pt.KX("text").makeTwoWay(),new Pt.KX("stroke","color"))),_t.current.nodeTemplate.toolTip=Yn("ToolTip",Yn(Pt.s_,"Vertical",{maxSize:new Pt.$u(200,NaN)},Yn(Pt.al,{font:"bold 10pt sans-serif",textAlign:"center"},new Pt.KX("text")),Yn(Pt.al,{font:"10pt sans-serif",textAlign:"center"},new Pt.KX("text","details"))));function Bt(Ot,Li){var Sr=(Ri,po)=>{Ri.handled=!0,Ri.diagram.model.commit(Qr=>{var mo=po.part.adornedPart,fo=new Pt.E9().setRectSpot(mo.actualBounds,Ot);fo.subtract(mo.location),fo.scale(2,2),fo.x+=Math.sign(fo.x)*130,fo.y+=Math.sign(fo.y)*130,fo.add(mo.location),fo.snapToGridPoint(Ri.diagram.grid.gridOrigin,Ri.diagram.grid.gridCellSize);var wo=Qr.copyNodeData(mo.data);Qr.setGroupKeyForNodeData(wo,Qr.getGroupKeyForNodeData(mo.data)),Qr.addNodeData(wo);var Io={from:mo.key,to:Qr.getKeyForNodeData(wo)};Qr.addLinkData(Io);var Bn=Ri.diagram.findNodeForData(wo);Bn.location=fo,Ri.diagram.select(Bn),setTimeout(()=>{Ri.diagram.commandHandler.editTextBlock()},20)})};return Yn(Pt.bn,{figure:Li,alignment:Ot,alignmentFocus:Ot.opposite(),width:Ot.equals(Pt.z6.Top)||Ot.equals(Pt.z6.Bottom)?25:18,height:Ot.equals(Pt.z6.Top)||Ot.equals(Pt.z6.Bottom)?18:25,fill:"orange",stroke:at.white,strokeWidth:4,mouseEnter:(Ri,po)=>po.fill="dodgerblue",mouseLeave:(Ri,po)=>po.fill="orange",isActionable:!0,click:Sr,contextClick:Sr})}function Kn(Ot){return Yn(Pt.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:(Li,Sr)=>Sr.fill="dodgerblue",mouseLeave:(Li,Sr)=>Sr.fill="orange",click:(Li,Sr)=>{Li.diagram.commandHandler.showContextMenu(Sr.part.adornedPart)}},Ot||{})}_t.current.nodeTemplate.selectionAdornmentTemplate=Yn(Pt.uz,"Spot",Yn(Pt.Vm,{padding:10}),Bt(Pt.z6.Top,"TriangleUp"),Bt(Pt.z6.Left,"TriangleLeft"),Bt(Pt.z6.Right,"TriangleRight"),Bt(Pt.z6.Bottom,"TriangleDown"),Kn({alignment:new Pt.z6(.75,0)}));function li(Ot,Li){return(Sr,Ri)=>{Sr.handled=!0,Sr.diagram.model.commit(po=>{po.set(Ri.part.adornedPart.data,Ot,Li)})}}function Qt(Ot,Li){return Li||(Li="color"),Yn(Pt.bn,{width:16,height:16,stroke:"lightgray",fill:Ot,margin:1,background:"transparent",mouseEnter:(Sr,Ri)=>Ri.stroke="dodgerblue",mouseLeave:(Sr,Ri)=>Ri.stroke="lightgray",click:li(Li,Ot),contextClick:li(Li,Ot)})}function jt(){return[Yn("ContextMenuButton",Yn(Pt.s_,"Horizontal",Qt(at.white,"fill"),Qt(at.beige,"fill"),Qt(at.extralightblue,"fill"),Qt(at.extralightred,"fill"))),Yn("ContextMenuButton",Yn(Pt.s_,"Horizontal",Qt(at.lightgray,"fill"),Qt(at.lightgreen,"fill"),Qt(at.lightblue,"fill"),Qt(at.lightred,"fill")))]}function Un(){return[Yn("ContextMenuButton",Yn(Pt.s_,"Horizontal",Qt(at.black),Qt(at.green),Qt(at.blue),Qt(at.red))),Yn("ContextMenuButton",Yn(Pt.s_,"Horizontal",Qt(at.white),Qt(at.magenta),Qt(at.purple),Qt(at.orange)))]}function ai(Ot,Li){return Li||(Li="thickness"),Yn(Pt.bn,"LineH",{width:16,height:16,strokeWidth:Ot,margin:1,background:"transparent",mouseEnter:(Sr,Ri)=>Ri.background="dodgerblue",mouseLeave:(Sr,Ri)=>Ri.background="transparent",click:li(Li,Ot),contextClick:li(Li,Ot)})}function Vi(Ot,Li){return Li||(Li="dash"),Yn(Pt.bn,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:Ot,margin:1,background:"transparent",mouseEnter:(Sr,Ri)=>Ri.background="dodgerblue",mouseLeave:(Sr,Ri)=>Ri.background="transparent",click:li(Li,Ot),contextClick:li(Li,Ot)})}function xi(){return[Yn("ContextMenuButton",Yn(Pt.s_,"Horizontal",ai(1),ai(2),ai(3),ai(4))),Yn("ContextMenuButton",Yn(Pt.s_,"Horizontal",Vi(null),Vi([2,4]),Vi([4,4])))]}function Bi(Ot,Li){return Li||(Li="figure"),Yn(Pt.bn,{width:32,height:32,scale:.5,fill:"lightgray",figure:Ot,margin:1,background:"transparent",mouseEnter:(Sr,Ri)=>Ri.fill="dodgerblue",mouseLeave:(Sr,Ri)=>Ri.fill="lightgray",click:li(Li,Ot),contextClick:li(Li,Ot)})}_t.current.nodeTemplate.contextMenu=Yn("ContextMenu",Yn("ContextMenuButton",Yn(Pt.s_,"Horizontal",Bi("Rectangle"),Bi("RoundedRectangle"),Bi("Ellipse"),Bi("Diamond"))),Yn("ContextMenuButton",Yn(Pt.s_,"Horizontal",Bi("Parallelogram2"),Bi("ManualOperation"),Bi("Procedure"),Bi("Cylinder1"))),Yn("ContextMenuButton",Yn(Pt.s_,"Horizontal",Bi("Terminator"),Bi("CreateRequest"),Bi("Document"),Bi("TriangleDown"))),jt(),Un(),xi()),_t.current.groupTemplate=Yn(Pt.ZA,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:Pt.z6.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:(Ot,Li)=>{var Sr=Li.addMembers(Li.diagram.selection,!0);Sr||Li.diagram.currentTool.doCancel()},avoidable:!1},new Pt.KX("location","loc",Pt.E9.parse).makeTwoWay(Pt.E9.stringify),Yn(Pt.s_,"Auto",{name:"BODY"},Yn(Pt.bn,{parameter1:10,fill:at.white,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:Pt.z6.AllSides,toSpot:Pt.z6.AllSides},new Pt.KX("fill"),new Pt.KX("stroke","color"),new Pt.KX("strokeWidth","thickness"),new Pt.KX("strokeDashArray","dash")),Yn(Pt.Vm,{background:"transparent",margin:20})),Yn(Pt.al,{alignment:Pt.z6.Top,alignmentFocus:Pt.z6.Bottom,font:"bold 12pt sans-serif",editable:!0},new Pt.KX("text"),new Pt.KX("stroke","color"))),_t.current.groupTemplate.selectionAdornmentTemplate=Yn(Pt.uz,"Spot",Yn(Pt.s_,"Auto",Yn(Pt.bn,{fill:null,stroke:"dodgerblue",strokeWidth:3}),Yn(Pt.Vm,{margin:1.5})),Kn({alignment:Pt.z6.TopRight,alignmentFocus:Pt.z6.BottomRight})),_t.current.groupTemplate.contextMenu=Yn("ContextMenu",jt(),Un(),xi()),_t.current.linkTemplate=Yn(Pt.rU,{layerName:"Foreground",routing:Pt.rU.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new Pt.KX("fromSpot","fromSpot",Pt.z6.parse),new Pt.KX("toSpot","toSpot",Pt.z6.parse),new Pt.KX("fromShortLength","dir",Ot=>Ot>=1?10:0),new Pt.KX("toShortLength","dir",Ot=>Ot>=1?10:0),new Pt.KX("points").makeTwoWay(),Yn(Pt.bn,{strokeWidth:2},new Pt.KX("stroke","color"),new Pt.KX("strokeWidth","thickness"),new Pt.KX("strokeDashArray","dash")),Yn(Pt.bn,{segmentIndex:0,segmentOffset:new Pt.E9(15,0),segmentOrientation:Pt.rU.OrientAlong,alignmentFocus:Pt.z6.Right,figure:"circle",width:10,strokeWidth:0},new Pt.KX("fill","color"),new Pt.KX("visible","dir",Ot=>Ot===1)),Yn(Pt.bn,{segmentIndex:-1,segmentOffset:new Pt.E9(-10,6),segmentOrientation:Pt.rU.OrientPlus90,alignmentFocus:Pt.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new Pt.KX("fill","color"),new Pt.KX("visible","dir",Ot=>Ot>=1),new Pt.KX("width","thickness",Ot=>7+3*Ot),new Pt.KX("height","thickness",Ot=>7+3*Ot),new Pt.KX("segmentOffset","thickness",Ot=>new Pt.E9(-15,4+1.5*Ot))),Yn(Pt.bn,{segmentIndex:0,segmentOffset:new Pt.E9(15,-6),segmentOrientation:Pt.rU.OrientMinus90,alignmentFocus:Pt.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new Pt.KX("fill","color"),new Pt.KX("visible","dir",Ot=>Ot===2),new Pt.KX("width","thickness",Ot=>7+3*Ot),new Pt.KX("height","thickness",Ot=>7+3*Ot),new Pt.KX("segmentOffset","thickness",Ot=>new Pt.E9(-15,4+1.5*Ot))),Yn(Pt.al,{alignmentFocus:new Pt.z6(0,1,-4,0),editable:!0},new Pt.KX("text").makeTwoWay(),new Pt.KX("stroke","color"))),_t.current.linkTemplate.selectionAdornmentTemplate=Yn(Pt.uz,Yn(Pt.bn,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:Ii(2)},new Pt.KX("pathPattern","thickness",Ii)),Kn({alignmentFocus:new Pt.z6(0,0,-6,-4)}));function Ii(Ot){return Yn(Pt.bn,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(Ot+4).toString()+" H3"})}function Pr(Ot){var Li="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return Ot===0?Li="M0 0 M16 16 M0 8 L16 8":Ot===2&&(Li="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),Yn(Pt.bn,{geometryString:Li,margin:2,background:"transparent",mouseEnter:(Sr,Ri)=>Ri.background="dodgerblue",mouseLeave:(Sr,Ri)=>Ri.background="transparent",click:li("dir",Ot),contextClick:li("dir",Ot)})}function xr(Ot){var Li=(Sr,Ri)=>{Sr.handled=!0,Sr.diagram.model.commit(po=>{var Qr=Ri.part.adornedPart;po.set(Qr.data,Ot?"toSpot":"fromSpot",Pt.z6.stringify(Pt.z6.AllSides)),(Ot?Qr.toNode:Qr.fromNode).invalidateConnectedLinks()})};return Yn(Pt.bn,{width:12,height:12,fill:"transparent",mouseEnter:(Sr,Ri)=>Ri.background="dodgerblue",mouseLeave:(Sr,Ri)=>Ri.background="transparent",click:Li,contextClick:Li})}function _n(Ot,Li){var Sr=0,Ri=Pt.z6.RightSide;Ot.equals(Pt.z6.Top)?(Sr=270,Ri=Pt.z6.TopSide):Ot.equals(Pt.z6.Left)?(Sr=180,Ri=Pt.z6.LeftSide):Ot.equals(Pt.z6.Bottom)&&(Sr=90,Ri=Pt.z6.BottomSide),Li||(Sr-=180);var po=(Qr,mo)=>{Qr.handled=!0,Qr.diagram.model.commit(fo=>{var wo=mo.part.adornedPart;fo.set(wo.data,Li?"toSpot":"fromSpot",Pt.z6.stringify(Ri)),(Li?wo.toNode:wo.fromNode).invalidateConnectedLinks()})};return Yn(Pt.bn,{alignment:Ot,alignmentFocus:Ot.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:Sr,background:"transparent",mouseEnter:(Qr,mo)=>mo.background="dodgerblue",mouseLeave:(Qr,mo)=>mo.background="transparent",click:po,contextClick:po})}_t.current.linkTemplate.contextMenu=Yn("ContextMenu",Un(),xi(),Yn("ContextMenuButton",Yn(Pt.s_,"Horizontal",Pr(0),Pr(1),Pr(2))),Yn("ContextMenuButton",Yn(Pt.s_,"Horizontal",Yn(Pt.s_,"Spot",xr(!1),_n(Pt.z6.Top,!1),_n(Pt.z6.Left,!1),_n(Pt.z6.Right,!1),_n(Pt.z6.Bottom,!1)),Yn(Pt.s_,"Spot",{margin:new Pt.Zt(0,0,0,2)},xr(!0),_n(Pt.z6.Top,!0),_n(Pt.z6.Left,!0),_n(Pt.z6.Right,!0),_n(Pt.z6.Bottom,!0)))));const ki=`{ "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 Ar=["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 Vr(Ot){return console.log("shapeName:",Ot),Ar.indexOf(Ot)>=0}var xo=new Pt.YI(Ji.current,{maxSelectionCount:1,linkTemplate:Yn(Pt.rU,{locationSpot:Pt.z6.Center,selectionAdornmentTemplate:Yn(Pt.uz,"Link",{locationSpot:Pt.z6.Center},Yn(Pt.bn,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),Yn(Pt.bn,{toArrow:"Standard",stroke:null}))},{routing:Pt.rU.AvoidsNodes,curve:Pt.rU.JumpOver,corner:5,toShortLength:4},new Pt.KX("points"),Yn(Pt.bn,{isPanelMain:!0,strokeWidth:2}),Yn(Pt.bn,{toArrow:"Standard",stroke:null})),model:new Pt.FJ([{text:"\u672A\u547D\u540D",size:"100 100",fill:null,stroke:"#000"},...Pt.bn.getFigureGenerators().toArray().map(Ot=>({text:"\u672A\u547D\u540D",size:"100 100",figure:Ot.key,fill:"white",stroke:"#666",borderColor:"#000"}))])});return _t.current.addDiagramListener("TextEdited",function(Ot){var Li;const Sr=Ot.subject.part;var Ri=(Li=document.activeElement)==null?void 0:Li.value;typeof Ri=="string"&&Ri.trim()===""&&_t.current.model.commit(function(po){po.set(Sr.data,"text","\u672A\u547D\u540D"),_t.current.commandHandler.stopCommand()},"increment")}),xo.nodeTemplate=Yn(Pt.NB,"Auto",{locationSpot:Pt.z6.Center},new Pt.KX("location","location",Pt.E9.parse).makeTwoWay(Pt.E9.stringify),Yn(Pt.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 Pt.KX("stroke").makeTwoWay(),new Pt.KX("fill").makeTwoWay(),new Pt.KX("figure")),Yn(Pt.al,{margin:new Pt.Zt(5,5,3,5),font:"10pt sans-serif",minSize:new Pt.$u(16,16),maxSize:new Pt.$u(10,NaN),textAlign:"center",editable:!0},new Pt.KX("key").makeTwoWay())),setTimeout(()=>{_t.current.grid=Yn(Pt.s_,"Grid",Yn(Pt.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Yn(Pt.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),_t.current.grid.visible=!0,_t.current.grid.gridCellStroke="darkgray",_t.current.grid.gridCellStrokeWidth=1},300),window.myDiagrams=_t.current,_t.current}const br=()=>Ae(this,null,function*(){var Yn,at=_t.current.makeImage();const Bt=yield(0,Me.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:at.src,file_data:JSON.stringify({login:(Yn=(0,Te.eY)())==null?void 0:Yn.login,data:JSON.parse(_t.current.model.toJson())})}});Mt({src:Bt.url})});return(0,le.useEffect)(()=>(setTimeout(()=>{sr()},500),ni(xn+1),()=>{_t.current=null}),[]),He.createElement("div",{ref:$i,className:"body-overflow-initial"},He.createElement(Wt.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!xn,destroyOnClose:!0,maskClosable:!1,rootClassName:"zIndex-9999",title:He.createElement(En.Z,null,He.createElement(ze.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),He.createElement(ze.Z,{onClick:()=>{var Yn,at,Bt=_t.current.selection.first();if(mi.current=!mi.current,document.activeElement&&Bt){let Kn=(at=(Yn=document.activeElement)==null?void 0:Yn.value)==null?void 0:at.trim();typeof Kn=="string"&&_t.current.model.commit(function(li){li.set(Bt.data,"text",Kn||"\u672A\u547D\u540D"),_t.current.commandHandler.stopCommand()},"increment")}ni(xn+1)}},He.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:zt},He.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative",display:mi.current?"none":"block"},className:Ee.flowChartWrp},He.createElement("div",{style:{display:"flex",height:"100%"}},He.createElement("div",{style:{width:"300px",height:"100%"}},He.createElement("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"}},"\u56FE\u5F62\u5E93"),He.createElement("div",{style:{height:"calc(100% - 50px)"},className:Ee.myPaletteDiv,ref:Ji})),He.createElement("div",{style:{flex:1,position:"relative"}},He.createElement("div",{ref:fn,style:{height:"80vh"}}))),He.createElement("div",{className:"tr"},He.createElement(dt.ZP,{size:"large",onClick:br,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var an=qe,Xt=Le(47889),yn=Le(71051);const kt=Xt.ZP.Group,Dt={margin:"0 8px"};var Zt=({callback:zt,onCancel:Mt})=>{function _t(fn){zt(fn)}return le.createElement(Qe.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:_t},le.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},le.createElement("span",{style:Dt},"\u5355\u5143\u683C\u6570\uFF1A"),le.createElement("span",{style:Dt},"\u884C\u6570"),le.createElement(Qe.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},le.createElement(yn.Z,null)),le.createElement("span",{style:Dt},"\u5217\u6570"),le.createElement(Qe.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},le.createElement(yn.Z,null))),le.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},le.createElement("span",{style:Dt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),le.createElement(Qe.default.Item,{name:"align"},le.createElement(kt,null,le.createElement(Xt.ZP,{value:"default"},le.createElement("i",{className:"fa fa-align-justify"})),le.createElement(Xt.ZP,{value:"left"},le.createElement("i",{className:"fa fa-align-left"})),le.createElement(Xt.ZP,{value:"center"},le.createElement("i",{className:"fa fa-align-center"})),le.createElement(Xt.ZP,{value:"right"},le.createElement("i",{className:"fa fa-align-right"}))))),le.createElement("div",{className:"flex-container flex-end"},le.createElement(dt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),le.createElement(dt.ZP,{type:"ghost",onClick:Mt},"\u53D6\u6D88")))},hn=Le(71411),wn=Le(43001),Dn=Le.n(wn),Mi=(0,le.forwardRef)(({use3d:zt,width:Mt,height:_t,callback:fn,showSaveButton:Ji},mi)=>{const $i=(0,le.useRef)(),xn=(0,le.useRef)(),[ni,sr]=(0,le.useState)(!1),br=(0,le.useRef)({id:$i,appName:"graphing",width:Mt||1e3,height:_t||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,le.useEffect)(()=>{xn.current=new(Dn())(br.current,!0),window.onload=function(){xn.current.inject("applet_container")}},[]);const Yn=()=>{var at=window.ggbApplet.getPNGBase64(1,!0,72);return fn&&fn(at),at};return(0,le.useEffect)(()=>{br.current.appName=ni?"3D":"graphing",xn.current.inject("applet_container")},[ni]),(0,le.useEffect)(()=>{sr(zt)},[zt]),(0,le.useImperativeHandle)(mi,()=>({getImgData:Yn})),le.createElement(le.Fragment,null,le.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:$i}),le.createElement(En.Z,{align:"middle"},le.createElement(ze.Z,{flex:1},le.createElement(hn.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:ni,onChange:at=>sr(at)})),le.createElement(ze.Z,null,le.createElement(dt.ZP,{size:"large",onClick:Yn,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),tn=Le(76562),qt=Le(6767);const un="link",zn="upload-image",on="add-flowchart",Sn="draw-image",di="add-flowchart",Ui="code-block",gi="add-table",Hi="------------",kr={default:Hi,left:`:${Hi}`,center:`:${Hi}:`,right:`${Hi}:`};var Gn=Le(37808);function On(){}let Xn=0;const wi=1e4,nr="\u2581",ji="@\u2581\u2581@",Cr="@\u2581@",be=`
**\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`,mn=["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 fi(zt){return/^\d+$/.test(zt)?`${zt}px`:zt}const si=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",Di={[si+"-B"]:"bold",[si+"-I"]:"italic"},Ni={[un]:"\u6DFB\u52A0\u94FE\u63A5",[Ui]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[zn]:"\u6DFB\u52A0\u56FE\u7247",[Sn]:"\u6DFB\u52A0\u753B\u56FE",[on]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[gi]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var yr=({defaultValue:zt="",onChange:Mt,width:_t="100%",height:fn=400,miniToolbar:Ji=!1,isFocus:mi=!1,watch:$i,insertTemp:xn,mode:ni="markdown",id:sr="markdown-editor-id",showResizeBar:br=!1,noStorage:Yn=!1,showNullButton:at=!1,showNullProgramButton:Bt=!1,hidetoolBar:Kn=!1,fullScreen:li=!1,onBlur:Qt,onCMBeforeChange:jt,onFullScreen:Un,className:ai="",disablePaste:Vi=!1,disabled:xi=!1,disabledFill:Bi=!1,placeholder:Ii="",values:Pr="",extraUse:xr})=>{const[_n,ki]=(0,le.useState)(null),[Ar,Vr]=(0,le.useState)(zt),[xo,Ot]=(0,le.useState)($i),[Li,Sr]=(0,le.useState)(li),[Ri,po]=(0,le.useState)(""),[Qr,mo]=(0,le.useState)(0),[fo,wo]=(0,le.useState)(fn),[Io,Bn]=(0,le.useState)(!1),[ca,In]=(0,le.useState)(0),[Er,Do]=(0,le.useState)(0),wr=(0,le.useRef)(),Qo=(0,le.useRef)(),To=(0,le.useRef)(),ro=(0,le.useRef)();(0,le.useEffect)(()=>{const hi=window.scrollY||window.pageYOffset;Vr(Pr),_n==null||_n.setValue(Pr),window.scrollTo(0,hi)},[Pr]),(0,le.useEffect)(()=>{Un==null||Un(Li)},[Li]),(0,le.useEffect)(()=>{if(wr.current){let hi=function(Yi,Pn){var Rr;if(Vi){Pn.preventDefault();return}const cr=Pn.clipboardData;if(cr){const Mo=cr.types.toString(),Wr=cr.items;if(Mo==="Files"||cr.types.indexOf("Files")>-1){if(Pn.preventDefault(),ni=="stex")return;try{let Vo=Wr[1];((Rr=Wr[0])==null?void 0:Rr.kind)==="file"&&(Vo=Wr[0]);const Wo=Vo.getAsFile(),ua=Wo.name.split(".").pop();(0,Hn.I)(Wo,Xo=>{var aa,Pa,Gt;Xo.id?((aa=Wo==null?void 0:Wo.type)==null?void 0:aa.indexOf("image"))>-1?Ti.replaceSelection(`<img width="100%" src="/api/attachments/${Xo.id}?type=${Xo.content_type})" alt="" />`):((Pa=Wo==null?void 0:Wo.type)==null?void 0:Pa.indexOf("video"))>-1?Ti.replaceSelection(`<video width="100%" controls src="/api/attachments/${Xo.id}"></video>`):((Gt=Wo==null?void 0:Wo.type)==null?void 0:Gt.indexOf("pdf"))>-1?Ti.replaceSelection(`<a href="/api/attachments/${Xo.id}?type=${Wo.type}&disposition=inline" target="_blank">${Wo.name}</a>`):mn.includes(ua)?Ti.replaceSelection(`<a href="/api/attachments/${Xo.id}?type=office&disposition=inline" target="_blank">${Wo.name}</a>`):Ti.replaceSelection(`[${Wo.name}](/api/attachments/${Xo.id}?type=${Xo.content_type})`):(Xo==null?void 0:Xo.status)===401&&(document.location.href="/user/login")})}catch(Vo){qt.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const Ti=it().fromTextArea(wr.current,{mode:ni,lineNumbers:!Ji,lineWrapping:!0,value:zt,autoCloseTags:!0,autoCloseBrackets:!0});return Ti.on("keyup",function(Yi,Pn){Pn.keyCode===8&&(Yi.getValue()==""?Ti.setOption("placeholder",Ii):Ti.setOption("placeholder",null))}),Ti.on("keydown",function(Yi,Pn){if(Pn.keyCode===8){var Rr=Yt(Yi);Rr&&Pn.preventDefault()}}),mi&&Ti.focus(),Ti.on("paste",hi),xi&&Ti.on("beforeChange",function(Yi,Pn){(Pn.origin==="paste"||Pn.origin==="+input")&&Pn.cancel()}),ki(Ti),()=>{Ti.off("paste",hi)}}},[]);const fa=(0,le.useCallback)(()=>{if(Qo.current)try{}catch(hi){console.log(hi,"---- to set md editor body height")}},[fo,Qo,Li]);(0,le.useEffect)(()=>{function hi(){let Ti=new bt.Z(Yi=>{for(let Pn of Yi)(Pn.target.offsetHeight>0||Pn.target.offsetWidth>0)&&(fa(),_n.setSize("100%","100%"),_n.refresh())});return Ti.observe(wr.current.parentElement),Ti}if(_n){const Ti=hi();return()=>{var Yi,Pn;(Yi=wr.current)!=null&&Yi.parentElement&&Ti.unobserve((Pn=wr.current)==null?void 0:Pn.parentElement)}}},[_n,fa]),(0,le.useEffect)(()=>{if(_n){let hi=[];for(const[Ti,Yi]of Object.entries(Di)){let Pn={[Ti]:()=>{Rn(Yi)}};hi.push(Pn),_n.addKeyMap(Pn)}return()=>{for(let Ti of hi)_n.removeKeyMap(Ti)}}},[_n]),(0,le.useEffect)(()=>{li!==Li&&Sr(li)},[li]),(0,Gn.Z)(()=>{if(!Yn&&Qr>0){let hi=new Date().getTime(),Ti=window.sessionStorage.getItem(sr);hi>=Qr+wi&&(!Ti||Ti!==Ar)&&(window.sessionStorage.setItem(sr,Ar),Bn(!0))}},wi),(0,le.useEffect)(()=>{Ot($i)},[_n,$i]),(0,le.useEffect)(()=>{_n&&mi&&_n.focus()},[_n,mi]),(0,le.useEffect)(()=>{if(xo&&_n){let hi=function(Yi){let Pn=Yi.target;if(ro.current){let Rr=Pn.scrollTop/Pn.scrollHeight;ro.current.scrollTop=ro.current.scrollHeight*Rr}};const Ti=_n.getScrollerElement();return Ti.addEventListener("scroll",hi),()=>{Ti.removeEventListener("scroll",hi)}}},[_n,xo]),(0,le.useEffect)(()=>{if(_n&&jt){let hi=function(Ti,Yi){jt(Ti,Yi)};return _n.on("beforeChange",hi),()=>{_n.off("beforeChange",hi)}}},[_n,jt]),(0,le.useEffect)(()=>{if(_n&&Qt){let hi=function(){Qt(_n.getValue())};return _n.on("blur",hi),()=>{_n.off("blur",hi)}}},[_n,Qt]);function Yt(hi,Ti){var Yi=hi.getDoc(),Pn=Yi.getCursor(),Rr=Yi.getLine(Pn.line),cr=Rr.charAt(Pn.ch-1),Mo=Rr.lastIndexOf("@\u2581@",Pn.ch),Wr=Rr.lastIndexOf("@\u2581\u2581@",Pn.ch),Vo=Mo>Wr?Mo:Wr,Wo=Mo>Wr?3:4;if(ji.indexOf(cr)===-1)return null;if(console.log("change1:",Ti,hi,Rr,Pn,Vo,Mo,Wr,cr),Vo>=0&&Pn.ch-Vo<5){var ua=Vo+Wo;return Yi.replaceRange("",{line:Pn.line,ch:Vo},{line:Pn.line,ch:ua}),{line:Pn.line,ch:ua}}return null}(0,le.useEffect)(()=>{if(_n){let hi=function(Ti,Yi){const Pn=Ti.getValue();Vr(Pn),mo(new Date().getTime()),Ti.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Mt&&(Bt?Mt(Pn,Nn(Pn)):Mt(Pn))};return _n.on("change",hi),()=>{_n.off("change",hi)}}},[_n,Mt]),(0,le.useEffect)(()=>{if(_n)if(zt==null)_n.setValue(""),Vr("");else{const hi=window.scrollY||window.pageYOffset;zt!==_n.getValue()&&(_n.setValue(zt),Vr(zt),_n.setCursor(xi?1:_n.lineCount(),0),window.scrollTo(0,hi))}},[_n,zt]);const Rn=(0,le.useCallback)(hi=>{const Ti=_n.getCursor(),Yi=_n.getSelection();let Pn=Yi.split(`
`);switch(hi){case"bold":return _n.replaceSelection("**"+Yi+"**"),Yi===""&&_n.setCursor(Ti.line,Ti.ch+2),_n.focus();case"italic":return _n.replaceSelection("*"+Yi+"*"),Yi===""&&_n.setCursor(Ti.line,Ti.ch+1),_n.focus();case"code":return _n.replaceSelection("`"+Yi+"`"),Yi===""&&_n.setCursor(Ti.line,Ti.ch+1),_n.focus();case"inline-latex":return po("inline-latex"),_n.focus();case"latex":return _n.replaceSelection("```latex\n"+Yi+"\n```"),_n.setCursor(Ti.line+1,Yi.length+1),_n.focus();case"line-break":return _n.replaceSelection(`<br/>
`),_n.focus();case"list-ul":return Yi===""?_n.replaceSelection("- "+Yi):_n.replaceSelection(Pn.map(Rr=>Rr===""?"":`- ${Rr}`).join(`
`)),_n.focus();case"list-ol":return Yi===""?_n.replaceSelection("1. "+Yi):_n.replaceSelection(Pn.map((Rr,cr)=>Rr===""?"":`${cr+1}. ${Rr}`).join(`
`)),_n.focus();case"add-null-ch":return Yi===""&&_n.setCursor(Ti.line,Ti.ch),_n.replaceSelection(nr),_n.focus();case"add-signal":return Yi===""&&_n.setCursor(Ti.line,Ti.ch),_n.replaceSelection(Cr),_n.focus();case"add-multiple":return Yi===""&&_n.setCursor(Ti.line,Ti.ch),_n.replaceSelection(ji),_n.focus();case"inster-template-1":return Yi===""&&_n.setCursor(Ti.line,Ti.ch),_n.replaceSelection(be),_n.focus();case"eraser":return _n.setValue(""),_n.focus();case"trigger-watch":return Ot(!xo),_n.focus();case"trigger-full-screen":return Sr(!Li),_n.focus();case un:po(un);return;case Ui:po(Ui);return;case zn:po(zn);return;case Sn:po(Sn);return;case"maths-latex":po("maths-latex");return;case on:po(on);return;case gi:po(gi);return;default:throw new Error}},[_n,xo,Li]),Rt=(0,le.useCallback)((hi,Ti)=>{var Yi,Pn,Rr,cr,Mo,Wr;switch(po(""),Ri){case un:const{title:aa,link:Pa}=hi;return _n.replaceSelection(`[${aa}](${Pa})`),_n.focus();case Ui:const{language:Gt,content:qo}=hi;return _n.replaceSelection(["```"+Gt,qo,"```"].join(`
`)),_n.focus();case"maths-latex":for(var Vo=atob(hi),Wo=new Uint8Array(Vo.length),ua=0;ua<Vo.length;ua++)Wo[ua]=Vo.charCodeAt(ua);var Xo=new Blob([Wo],{type:"image/png"});(0,Hn.I)(Xo,$a=>{$a.id?_n.replaceSelection(`![,](/api/attachments/${$a.id}?type=${$a.content_type})`):($a==null?void 0:$a.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":_n.replaceSelection("`$$"+hi+"$$`");break;case zn:case Sn:case di:const{src:fr,alt:ao}=hi,zr=Ti,Jo=(Rr=(Pn=(Yi=zr==null?void 0:zr.name)==null?void 0:Yi.split("."))==null?void 0:Pn.pop)==null?void 0:Rr.call(Pn);return((cr=zr==null?void 0:zr.type)==null?void 0:cr.indexOf("image"))>-1||!(zr!=null&&zr.type)?zr!=null&&zr.align||zr!=null&&zr.width?_n.replaceSelection(`<p style="text-align:${zr.align||"initial"}"><img width="${zr.width?zr.width+"%":"initial"}" src="${fr}" alt="${ao||""}" /></p>`):_n.replaceSelection(`<img width="100%" src="${fr}" alt="${ao||""}" />`):((Mo=zr==null?void 0:zr.type)==null?void 0:Mo.indexOf("video"))>-1?_n.replaceSelection(`<video width="100%" controls src="${fr}"></video>`):((Wr=zr==null?void 0:zr.type)==null?void 0:Wr.indexOf("pdf"))>-1?_n.replaceSelection(`<a href="${fr}?type=${zr.type}&disposition=inline" target="_blank">${zr.name}</a>`):mn.includes(Jo)?_n.replaceSelection(`<a href="${fr}?type=office&disposition=inline" target="_blank">${zr.name}</a>`):_n.replaceSelection(`[${zr.name}](${fr})`),_n.focus();case gi:const{row:va,col:ma,align:ko}=hi;let So=`
`;for(let $a=0;$a<va;$a++){let gs=[],ls=[];for(let ps=0;ps<ma;ps++)$a===1&&ls.push(kr[ko]),gs.push(" ");$a===1&&(So+=`| ${ls.join(" | ")} |
`),So+=`| ${gs.join(ma===1?"":" | ")} |
`}return _n.replaceSelection(So+`
`),_n.focus();default:throw new Error}},[_n,Ri]),Ie=(0,le.useMemo)(()=>{switch(Ri){case un:return le.createElement(dn,{callback:Rt,onCancel:qn});case Ui:return le.createElement(ri.Z,{callback:Rt,onCancel:qn});case zn:return le.createElement(Hn.Z,{callback:Rt,onCancel:qn});case on:return le.createElement(an,{callback:Rt,onCancel:qn});case gi:return le.createElement(Zt,{callback:Rt,onCancel:qn});case"maths-latex":return le.createElement(Mi,{showSaveButton:!0,callback:Rt});case"inline-latex":return le.createElement(tn.Z,{showSaveButton:!0,callback:Rt});default:return null}},[Ri]);function qn(){po("")}(0,le.useEffect)(()=>{if(To.current){let hi=function(Mo){Rr=!0,cr=Mo.pageY},Ti=function(){Rr=!1},Yi=function(Mo){if(Rr){let Wr=Mo.pageY-cr;Wr<0&&(Wr=0),Wr>300&&(Wr=300);let Vo=fn+Wr+"px";wo(Vo)}},Pn=To.current,Rr=!1,cr=0;return Pn.addEventListener("mousedown",hi),document.addEventListener("mousemove",Yi),document.addEventListener("mouseup",Ti),()=>{Pn.removeEventListener("mousedown",hi),document.removeEventListener("mousemove",Yi),document.removeEventListener("mouseup",Ti)}}},[_n,To]),(0,le.useEffect)(()=>{wo(fn)},[fn]);const Ci=fi(_t),Oi=fi(fo),qi={width:Ci,height:Oi},zi=(0,le.useMemo)(()=>{if(Qr){let hi=new Date(Qr),Ti=hi.getHours(),Yi=hi.getMinutes(),Pn=hi.getSeconds();return Ti=Ti<10?"0"+Ti:Ti,Yi=Yi<10?"0"+Yi:Yi,Pn=Pn<10?"0"+Pn:Pn,`${Ti}:${Yi}:${Pn}`}return 0},[Qr]),Nn=hi=>{const Ti=[];if(Bt){let Yi=-1;hi=hi.replace(/(@▁▁@|@▁@)/g,function(Pn,Rr,cr){Ti.push({multiLine:Pn!==Cr})})}return Ti};function pi(){window.sessionStorage.removeItem(sr),Bn(!1),mo(0)}function vi(){Bn(!1),mo(0),_n.setValue(window.sessionStorage.getItem(sr))}(0,le.useEffect)(()=>{Ni[Ri]&&Ri!==Sn&&Ri!==on&&setTimeout(()=>{const hi=document.getElementsByClassName("markdown-popup-form")[0],Ti=window.innerWidth/2-hi.offsetWidth/2,Yi=window.innerHeight/2-hi.offsetHeight/2;In(Ti),Do(Yi)},0)},[Ri]);const ti=hi=>{hi.preventDefault();const Ti=hi.clientX-ca,Yi=hi.clientY-Er;document.body.onmousemove=Pn=>{let Rr=Pn.clientX-Ti,cr=Pn.clientY-Yi;const Mo=document.getElementsByClassName("markdown-popup-form")[0],Wr=window.innerWidth-Mo.offsetWidth,Vo=window.innerHeight-Mo.offsetHeight;Rr=Math.max(0,Math.min(Rr,Wr)),cr=Math.max(0,Math.min(cr,Vo)),ui(Pn.clientX,Pn.clientY,Ti,Yi)&&(In(Rr),Do(cr))},document.body.onmouseup=function(){document.body.onmousemove=null}},ui=(hi,Ti,Yi,Pn)=>{const Rr=document.body.clientHeight,cr=document.body.clientWidth;return hi<20&&Yi>hi||hi>cr-20&&Yi<hi||Ti<20&&Pn>Ti||Ti>Rr-20&&Pn<Ti?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return le.createElement(le.Fragment,null,le.createElement("div",{className:"markdown-editor-wrapper",ref:Qo},le.createElement("div",{className:`markdown-editor-container ${ai} ${xo?"on-preview":""} ${Ji?"mini":""} ${Li?"full-screen":""}`,style:qi},le.createElement(Ze,{insertTemp:xn,watch:xo,fullScreen:Li,showNullButton:at,showNullProgramButton:Bt,onActionCallback:Rn,hidetoolBar:Kn,extraUse:xr}),le.createElement("div",{className:"markdown-editor-body"},le.createElement("div",{className:"codemirror-container"},le.createElement("textarea",{ref:wr,placeholder:Ii})),xo?le.createElement("div",{ref:ro,className:"preview-container"},ni==="stex"&&le.createElement(ct,{value:Ar}),ni!=="stex"&&le.createElement(Tt.Z,{disabledFill:Bi,showProgramFill:Bt,value:Ar})):null))),br?le.createElement("a",{ref:To,className:"editor-resize"}):null,Ri===Sn&&le.createElement(It,{callback:Rt,onCancel:qn}),Ri===on&&le.createElement(an,{callback:Rt,onCancel:qn}),le.createElement(lt.Z,null,Ni[Ri]&&Ri!==Sn&&Ri!==on?le.createElement(Wt.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:ca,top:Er},title:le.createElement("div",{style:{cursor:"move"},onMouseDown:ti},Ni[Ri]),open:!0,onCancel:qn,footer:null,destroyOnClose:!0,width:Ri===on?"1200px":null,height:Ri===on?"80vh":null,className:"markdown-popup-form"},Ie):null))}},17077:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return _e},I:function(){return lt}});var le=Le(28284),Ke=Le(6767),it=Le(37568),bt=Le(77736),vt=Le(71051),Oe=Le(47889),st=Le(99571),Et=Le(46699),ot=Le(59301),We=Le(59301),Tt=Object.defineProperty,ct=Object.defineProperties,At=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,de=(Qe,Ue,dt)=>Ue in Qe?Tt(Qe,Ue,{enumerable:!0,configurable:!0,writable:!0,value:dt}):Qe[Ue]=dt,se=(Qe,Ue)=>{for(var dt in Ue||(Ue={}))ne.call(Ue,dt)&&de(Qe,dt,Ue[dt]);if(De)for(var dt of De(Ue))te.call(Ue,dt)&&de(Qe,dt,Ue[dt]);return Qe},ge=(Qe,Ue)=>ct(Qe,At(Ue));const{useForm:ye}=le.default,we={width:280,marginRight:10},Ce={labelCol:{span:5},wrapperCol:{span:19}};var _e=({callback:Qe,onCancel:Ue})=>{const[dt]=ye();let $e=(0,ot.useRef)();function wt(pn){$e.current.width=dt.getFieldValue("width"),$e.current.align=dt.getFieldValue("align"),Qe(pn,$e.current)}function St(pn,en){if(pn.status===-1){Ke.ZP.error(pn.message);return}dt.setFieldsValue({src:`/api/attachments/${pn.id}`,type:en.type})}function Lt(pn){let en=pn.target.files[0];$e.current=en,lt(en,St)}return We.createElement(le.default,ge(se({form:dt},Ce),{className:"upload-image-panel",onFinish:wt,style:{width:470,overflow:"hidden"}}),We.createElement(le.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},We.createElement("div",{className:"flex-container"},We.createElement(le.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},We.createElement(it.default,{style:we})),We.createElement(Ze,{onFileChange:Lt}))),We.createElement(le.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},We.createElement(it.default,{style:{width:264}})),We.createElement(le.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},We.createElement(bt.Z,null,We.createElement(le.default.Item,{name:"width",style:{margin:0}},We.createElement(vt.Z,{style:{width:264}})),We.createElement("span",{className:"ml8"},"%"))),We.createElement(le.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},We.createElement(Oe.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"}]})),We.createElement("aside",null,We.createElement(le.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},We.createElement(st.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),We.createElement(st.ZP,{type:"default",onClick:Ue},"\u53D6\u6D88"))))};function Ze({onFileChange:Qe}){return We.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",We.createElement("input",{type:"file",onChange:Qe}))}function lt(Qe,Ue){if(!Qe)throw new String("\u6CA1\u6709\u6587\u4EF6");let dt=new FormData;dt.append("editormd-image-file",Qe),dt.append("file_param_name","editormd-image-file"),dt.append("byxhr","true");var $e=new window.XMLHttpRequest;$e.withCredentials=!0,$e.addEventListener("load",function(wt){Ue(JSON.parse(wt.target.responseText),Qe)},!1),$e.addEventListener("error",function(wt){console.error(wt)},!1),$e.open("POST",`${Et.KI}/api/attachments.json`),$e.send(dt)}},91558:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return it}});var le=Le(59301),Ke=Le(4676);class it extends le.Component{constructor(vt){super(vt);const Oe=window.document;this.node=Oe.createElement("div"),Oe.body.appendChild(this.node)}render(){const{children:vt}=this.props;return(0,Ke.createPortal)(vt,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},75975:function(Zn,ei,Le){"use strict";Le.d(ei,{SV:function(){return an},ZP:function(){return qe}});var le=Le(59301),Ke=Le(76374);const it={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"]},bt={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"]},vt={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(`
`)}]},Oe={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(`
`)}]},st={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 Et=Le(53184),ot=Le.n(Et),We=Object.defineProperty,Tt=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,At=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable,te=(Xt,yn,kt)=>yn in Xt?We(Xt,yn,{enumerable:!0,configurable:!0,writable:!0,value:kt}):Xt[yn]=kt,de=(Xt,yn)=>{for(var kt in yn||(yn={}))De.call(yn,kt)&&te(Xt,kt,yn[kt]);if(At)for(var kt of At(yn))ne.call(yn,kt)&&te(Xt,kt,yn[kt]);return Xt},se=(Xt,yn)=>Tt(Xt,ct(yn)),ge=(Xt,yn,kt)=>new Promise((Dt,Zt)=>{var hn=Tn=>{try{Dn(kt.next(Tn))}catch(Mi){Zt(Mi)}},wn=Tn=>{try{Dn(kt.throw(Tn))}catch(Mi){Zt(Mi)}},Dn=Tn=>Tn.done?Dt(Tn.value):Promise.resolve(Tn.value).then(hn,wn);Dn((kt=kt.apply(Xt,yn)).next())});const ye={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"]}},we=(Xt,yn)=>yn.map(kt=>({label:kt,kind:Xt.languages.CompletionItemKind.Keyword,insertText:kt})),Ce=Xt=>Object.keys(ye.tables).map(yn=>({label:yn,kind:Xt.languages.CompletionItemKind.Variable,insertText:yn})),_e=(Xt,yn)=>{const kt=ye.tables[Xt];return kt?kt.map(Dt=>({label:Dt,kind:yn.languages.CompletionItemKind.Field,insertText:Dt})):[]};function Ze(Xt,yn,kt,Dt,Zt){let hn=yn.getWordUntilPosition(kt),wn={startLineNumber:kt.lineNumber,endLineNumber:kt.lineNumber,startColumn:hn.startColumn,endColumn:hn.endColumn},Dn=Dt.map(Tn=>({label:Tn,kind:Xt.languages.CompletionItemKind.Keyword,insertText:Tn,insertTextRules:Xt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:wn}));return Zt.map(Tn=>{Dn.push(se(de({},Tn),{range:wn}))}),Dn}var lt=Xt=>{ye.languages.map(Zt=>(Xt.languages.registerDocumentFormattingEditProvider(Zt,{provideDocumentFormattingEdits(hn,wn,Dn){return ge(this,null,function*(){const Tn=ot()(hn.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:hn.getFullModelRange(),text:Tn}]})}}),Zt));const yn=vt.quickKey.map(Zt=>({label:Zt.label,kind:Xt.languages.CompletionItemKind.Method,insertText:Zt.content,insertTextRules:Xt.languages.CompletionItemInsertTextRule.InsertAsSnippet})),kt=Oe.quickKey.map(Zt=>({label:Zt.label,kind:Xt.languages.CompletionItemKind.Method,insertText:Zt.content,insertTextRules:Xt.languages.CompletionItemInsertTextRule.InsertAsSnippet})),Dt=bt.quickKey.map(Zt=>({label:Zt.label,kind:Xt.languages.CompletionItemKind.Method,insertText:Zt.content,insertTextRules:Xt.languages.CompletionItemInsertTextRule.InsertAsSnippet}));Xt.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Zt,hn){var wn=Zt.getWordUntilPosition(hn),Dn={startLineNumber:hn.lineNumber,endLineNumber:hn.lineNumber,startColumn:wn.startColumn,endColumn:wn.endColumn},Tn=Zt.getLineContent(hn.lineNumber).substring(wn.startColumn-2,wn.endColumn);return{suggestions:[...vt.keywords.map(Mi=>({label:Mi,kind:Xt.languages.CompletionItemKind.Function,documentation:Mi,insertText:Mi,insertTextRules:Xt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Dn})),...vt.quickKey.map(Mi=>({label:Mi.label,kind:Xt.languages.CompletionItemKind.Function,documentation:Mi.content,insertText:Tn.startsWith("#")?Mi.content.replace(/#/,""):Mi.content,insertTextRules:Xt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Dn}))]}}}),Xt.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Zt,hn){var wn=Zt.getWordUntilPosition(hn),Dn={startLineNumber:hn.lineNumber,endLineNumber:hn.lineNumber,startColumn:wn.startColumn,endColumn:wn.endColumn};return{suggestions:[...it.keywords.map(Tn=>({label:Tn,kind:Xt.languages.CompletionItemKind.Function,documentation:Tn,insertText:Tn,insertTextRules:Xt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Dn}))]}}}),Xt.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Zt,hn){var wn=Zt.getWordUntilPosition(hn),Dn={startLineNumber:hn.lineNumber,endLineNumber:hn.lineNumber,startColumn:wn.startColumn,endColumn:wn.endColumn},Tn=Zt.getLineContent(hn.lineNumber).substring(wn.startColumn-2,wn.endColumn);return{suggestions:[...bt.keywords.map(Mi=>({label:Mi,kind:Xt.languages.CompletionItemKind.Function,documentation:Mi,insertText:Mi,insertTextRules:Xt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Dn})),...bt.quickKey.map(Mi=>({label:Mi.label,kind:Xt.languages.CompletionItemKind.Function,documentation:Mi.content,insertText:Tn.startsWith("#")?Mi.content.replace(/#/,""):Mi.content,insertTextRules:Xt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Dn}))]}}}),Xt.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(Zt,hn){var wn=Zt.getWordUntilPosition(hn),Dn={startLineNumber:hn.lineNumber,endLineNumber:hn.lineNumber,startColumn:wn.startColumn,endColumn:wn.endColumn},Tn=Zt.getLineContent(hn.lineNumber).substring(wn.startColumn-2,wn.endColumn);return{suggestions:[...st.keywords.map(Mi=>({label:Mi,kind:Xt.languages.CompletionItemKind.Function,documentation:Mi,insertText:Mi,insertTextRules:Xt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Dn})),...st.quickKey.map(Mi=>({label:Mi.label,kind:Xt.languages.CompletionItemKind.Function,documentation:Mi.content,insertText:Tn.startsWith("#")?Mi.content.replace(/#/,""):Mi.content,insertTextRules:Xt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Dn}))]}}}),Xt.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Zt,hn){var wn=Zt.getWordUntilPosition(hn),Dn={startLineNumber:hn.lineNumber,endLineNumber:hn.lineNumber,startColumn:wn.startColumn,endColumn:wn.endColumn},Tn=Zt.getLineContent(hn.lineNumber).substring(wn.startColumn-2,wn.endColumn);return{suggestions:[...Oe.keywords.map(Mi=>({label:Mi,kind:Xt.languages.CompletionItemKind.Function,documentation:Mi,insertText:Mi,insertTextRules:Xt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Dn})),...Oe.quickKey.map(Mi=>({label:Mi.label,kind:Xt.languages.CompletionItemKind.Function,documentation:Mi.content,insertText:Tn.startsWith("#")?Mi.content.replace(/#/,""):Mi.content,insertTextRules:Xt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Dn}))]}}})};const Qe="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var Ue=Object.defineProperty,dt=(Xt,yn,kt)=>yn in Xt?Ue(Xt,yn,{enumerable:!0,configurable:!0,writable:!0,value:kt}):Xt[yn]=kt,$e=(Xt,yn,kt)=>dt(Xt,typeof yn!="symbol"?yn+"":yn,kt);const wt=class mS{constructor(yn,kt,Dt){this.placeholder=yn,this.editor=kt,this.monaco=Dt,kt.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return mS.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)}};$e(wt,"ID","editor.widget.placeholderHint");var Lt=wt,pn=Le(96236),en=Le(6767),vn=Le(25399),rn=Le(89392),nt=Le(49535),rt=Le(56102),dn=Object.defineProperty,ri=Object.defineProperties,Hn=Object.getOwnPropertyDescriptors,Wt=Object.getOwnPropertySymbols,En=Object.prototype.hasOwnProperty,An=Object.prototype.propertyIsEnumerable,ci=(Xt,yn,kt)=>yn in Xt?dn(Xt,yn,{enumerable:!0,configurable:!0,writable:!0,value:kt}):Xt[yn]=kt,It=(Xt,yn)=>{for(var kt in yn||(yn={}))En.call(yn,kt)&&ci(Xt,kt,yn[kt]);if(Wt)for(var kt of Wt(yn))An.call(yn,kt)&&ci(Xt,kt,yn[kt]);return Xt},Pt=(Xt,yn)=>ri(Xt,Hn(yn)),Nt=(Xt,yn)=>{var kt={};for(var Dt in Xt)En.call(Xt,Dt)&&yn.indexOf(Dt)<0&&(kt[Dt]=Xt[Dt]);if(Xt!=null&&Wt)for(var Dt of Wt(Xt))yn.indexOf(Dt)<0&&An.call(Xt,Dt)&&(kt[Dt]=Xt[Dt]);return kt},ii=(Xt,yn,kt)=>new Promise((Dt,Zt)=>{var hn=Tn=>{try{Dn(kt.next(Tn))}catch(Mi){Zt(Mi)}},wn=Tn=>{try{Dn(kt.throw(Tn))}catch(Mi){Zt(Mi)}},Dn=Tn=>Tn.done?Dt(Tn.value):Promise.resolve(Tn.value).then(hn,wn);Dn((kt=kt.apply(Xt,yn)).next())});function Gi(Xt){return/^\d+$/.test(Xt)?`${Xt}px`:Xt}function ze(){}let Me=!1;const Ee={"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 Te(Xt=[]){let yn=Xt;if(Array.isArray(Xt)){for(let kt=0;kt<Xt.length;kt++){let Dt=Ee[Xt[kt]];if(Dt)return Dt}return yn[0]}return Ee[yn]||yn}let He=null;const Ae=()=>ii(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(Xt){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",Xt)}});var qe=Xt=>{var yn=Xt,{width:kt="100%",height:Dt="100%",value:Zt,language:hn="javascript",style:wn={},options:Dn={},overrideServices:Tn={},theme:Mi="vs-dark",onEditBlur:tn,isCopy:qt=!1,onSave:un,autoHeight:zn=!1,forbidCopy:on=!1,onChange:Sn=ze,editorDidMount:di=ze,onFocus:Ui=ze,onBreakPoint:gi=ze,breakPointValue:Hi=[],filename:kr="educoder.txt",errorLine:Gn,errorContent:On="",highlightLine:Xn,openBreakPoint:wi=!1,placeholder:nr="",showMiniMap:ji=!0}=yn,Cr=Nt(yn,["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 be=(0,le.useRef)(),mn=(0,le.useRef)({}),fi=(0,le.useRef)(),Vn=(0,le.useRef)(),si=(0,le.useRef)([]),Di=(0,le.useRef)(!1),Ni=(0,le.useRef)(),yr=(0,le.useRef)(),zt=(0,le.useRef)(!1),[Mt,_t]=(0,le.useState)(!1);function fn(){let Un;return be.current&&(Un=new Ke.Z(ai=>{for(let Vi of ai)(Vi.target.offsetHeight>0||Vi.target.offsetWidth>0)&&mn.current.instance.layout()}),Un.observe(be.current)),Un}function Ji(){en.ZP.warning({content:decodeURIComponent(Qe),key:"monaco-editor-tip"})}const mi=()=>{let Un=mn.current.instance;if(Zt!=null&&Un&&Mt){const ai=Un.getModel();ai&&Zt!==ai.getValue()&&(Me=!0,ai.setValue(Zt),Un.layout(),Me=!1)}};(0,le.useEffect)(()=>{const Un=nt.Z.subscribe("formatDocument",ai=>{var Vi;let xi=mn.current.instance;(Vi=xi==null?void 0:xi.getAction)==null||Vi.call(xi,"editor.action.formatDocument").run()});return window.updateMonacoValue=ai=>{Sn(ai)},Un},[]),(0,le.useEffect)(()=>{var Un;let ai=mn.current.instance;Vn.current&&clearTimeout(Vn.current),Vn.current=setTimeout(()=>{mi()},500),Zt&&(Zt!=null&&Zt.length)&&((Un=ai==null?void 0:ai.updateOptions)==null||Un.call(ai,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Zt.split(/\r\n|\r|\n/g).length))+3,5)}))},[Zt,Mt,mn.current]),(0,le.useEffect)(()=>{if(Gn&&mn.current&&mn.current.instance){let ai=mn.current.instance;ai.changeViewZones(function(Vi){var xi=document.createElement("div");xi.style.padding="10px 20px",xi.style.width="calc(100% - 20px)",xi.className="my-error-line-wrp",xi.innerHTML=On,Vi.addZone({afterLineNumber:Gn||11,heightInLines:3,domNode:xi})});var Un={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}};ai.addOverlayWidget(Un),ai.revealPositionInCenter({lineNumber:20,column:1})}},[Gn,mn.current,Mt]);const $i=(Un="",ai)=>{if(!Un||Un.trim()==="")return!0;const xi=mn.current.instance.getModel().getLineTokens(ai);let Bi=!1;for(let Ii=0;Ii<2;Ii++)xi.getStandardTokenType(Ii)===1&&(Bi=!0);return Bi};(0,le.useEffect)(()=>{var Un;const ai=(Un=mn.current)==null?void 0:Un.instance;if(ai&&Mt&&on){const Vi=ai.onDidBlurEditorWidget(()=>{zt.current=!1}),xi=ai.onDidFocusEditorText(()=>{zt.current=!0});return()=>{Vi.dispose(),xi.dispose()}}},[mn.current,Mt,on]),(0,le.useEffect)(()=>{var Un;if((Un=mn.current)!=null&&Un.instance&&Mt&&wi){let ai=mn.current.instance,Vi=ai.getModel();if(!Vi)return;(()=>{var Li;let Sr=[],Ri=[];const po=Vi.getAllDecorations();for(let mo of po)mo.options.className==="highlighted-line"&&(Sr.push((Li=mo==null?void 0:mo.range)==null?void 0:Li.startLineNumber),Ri.push(mo==null?void 0:mo.id));if(Xn===Sr[0])return;Vi.deltaDecorations(Ri,[]);const Qr=Vi.getLineCount();Xn&&Xn<=Qr&&(ai.deltaDecorations([],[{range:new He.Range(Xn,1,Xn,Vi.getLineMaxColumn(Xn)),options:{isWholeLine:!0,className:"highlighted-line"}}]),ai.revealLineInCenter(Xn))})();const Bi=(Li=!1)=>{var Sr;let Ri=[],po=[];const Qr=Vi.getAllDecorations();for(let mo of Qr)mo.options.linesDecorationsClassName==="breakpoints-select"&&(Ri.push((Sr=mo==null?void 0:mo.range)==null?void 0:Sr.startLineNumber),po.push(mo==null?void 0:mo.id));if(Li)return{lines:Ri,ids:po};gi(Ri)},Ii=Li=>ii(void 0,null,function*(){let Sr={range:new He.Range(Li,1,Li,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield Vi.deltaDecorations([],[Sr]),Bi()}),Pr=Li=>ii(void 0,null,function*(){let Sr=[];const Ri=ai.getLineDecorations(Li);for(let po of Ri)po.options.linesDecorationsClassName==="breakpoints-select"&&Sr.push(po.id);yield Vi.deltaDecorations(Sr,[]),Bi()}),xr=Li=>{let Sr=ai.getLineDecorations(Li);for(let Ri of Sr)if(Ri.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,rn.isEqual)(Hi,Bi(!0).lines)){Vi.deltaDecorations(Bi(!0).ids,[]);const Li=Hi.map(Sr=>({range:new He.Range(Sr,1,Sr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));Vi.deltaDecorations([],Li)}const _n=ai.onDidChangeModelContent(Li=>{let Sr=ai.getPosition();if(Sr){let Ri=Sr.lineNumber;clearTimeout(yr.current),yr.current=setTimeout(()=>{$i(Vi.getLineContent(Ri),Ri)?Pr(Ri):xr(Ri)?(Pr(Ri),Ii(Ri)):Bi()},100)}}),ki=ai.onMouseDown(Li=>{var Sr,Ri,po;if(Li.target.detail&&((po=(Ri=(Sr=Li.target)==null?void 0:Sr.element)==null?void 0:Ri.className)!=null&&po.includes("line-numbers"))){let Qr=Li.target.position.lineNumber;if($i(Vi.getLineContent(Qr),Qr))return;xr(Qr)?Pr(Qr):Ii(Qr)}}),Ar=Li=>{let Sr={range:new He.Range(Li,1,Li,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};si.current=ai.deltaDecorations(si.current,[Sr])},Vr=()=>{si.current=ai.deltaDecorations(si.current,[])},xo=ai.onMouseMove(Li=>{var Sr,Ri,po;if(Vr(),Li.target.detail&&((po=(Ri=(Sr=Li.target)==null?void 0:Sr.element)==null?void 0:Ri.className)!=null&&po.includes("line-numbers"))){let Qr=Li.target.position.lineNumber;if($i(Vi.getLineContent(Qr),Qr))return;Ar(Qr)}}),Ot=ai.onMouseLeave(()=>{Vr()});return()=>{_n.dispose(),ki.dispose(),xo.dispose(),Ot.dispose()}}},[mn.current,Mt,Hi,Xn,wi,hn]),(0,le.useEffect)(()=>{var Un;(Un=mn.current)!=null&&Un.instance&&wi&&mn.current.instance.setPosition({lineNumber:0,column:0})},[Xn]);function xn(){let Un=mn.current.instance;if(Un){const ai=Un.getSelection(),Vi=mn.current.pastePos||{},xi=new He.Range(Vi.startLineNumber||ai.endLineNumber,Vi.startColumn||ai.endColumn,Vi.endLineNumber||ai.endLineNumber,Vi.endColumn||ai.endColumn);setTimeout(()=>{Un.executeEdits("",[{range:xi,text:""}])},300)}}function ni(Un){(window.navigator.platform.match("Mac")?Un.metaKey:Un.ctrlKey)&&Un.keyCode==83&&(Un.preventDefault(),un())}const sr=()=>{if(zn&&mn.current.instance){const Un=mn.current.instance.getContentHeight();Qt(Un<Dt?Dt:Un)}else Qt(Dt)};function br(Un){var ai=document.createEvent("MouseEvents");ai.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Un.dispatchEvent(ai)}const Yn=Un=>{if(!zt.current)return;const{keyCode:ai,ctrlKey:Vi,metaKey:xi,target:Bi,type:Ii}=Un;return(Ii==="paste"||(ai===67||ai===86)&&(xi||Vi))&&Bi.nodeName==="TEXTAREA"&&(Ji(),Un.preventDefault()),!1};function at(Un,ai){var Vi=window.URL||window.webkitURL||window,xi=new Blob([ai]),Bi=document.createElementNS("http://www.w3.org/1999/xhtml","a");Bi.href=Vi.createObjectURL(xi),Bi.download=Un,br(Bi)}(0,le.useEffect)(()=>{sr()},[sr]),(0,le.useEffect)(()=>{be.current&&!Mt&&Promise.all([Le.e(8909),Le.e(6656)]).then(Le.bind(Le,71448)).then(Un=>{try{He=Un,mn.current.instance=He.editor.create(be.current,{value:Zt,language:Te(hn),theme:Mi,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:ji||!1}},Tn);const ai=mn.current.instance;let Bi=[...pn.BH._menuItems].find(_n=>_n[0]._debugName=="EditorContext")[1],Ii=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Pr=(_n,ki)=>{var Ar,Vr;let xo=_n._first;do ki.includes((Vr=(Ar=xo.element)==null?void 0:Ar.command)==null?void 0:Vr.id)&&_n._remove(xo);while(xo=xo.next)};if(di(ai,He),setTimeout(()=>{sr(),mn.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{at(kr||"educoder.txt",ai.getValue())}})},500),mn.current.subscription=ai.onDidChangeModelContent(_n=>{Di.current?clearTimeout(Ni.current):(sr(),Sn(ai.getValue(),_n)),Ni.current=setTimeout(()=>{Di.current=!1},500)}),window.Monaco||lt(He,Te(hn)),on&&(Pr(Bi,Ii),be.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Yn),window.removeEventListener("paste",Yn),window.addEventListener("keydown",Yn),window.addEventListener("paste",Yn)),window.Monaco=He,tn&&ai.onDidBlurEditorWidget(()=>{tn(ai.getValue())}),Ui&&ai.onDidFocusEditorText(()=>{on&&Ae(),Ui(ai.getValue())}),on){Ae();try{ai.onDidPaste(_n=>{const ki=ai.getSelection(),Ar=mn.current.pastePos||{},Vr=new He.Range(Ar.startLineNumber||ki.endLineNumber,Ar.startColumn||ki.endColumn,Ar.endLineNumber||ki.endLineNumber,Ar.endColumn||ki.endColumn);ai.executeEdits("",[{range:_n.range,text:""}])})}catch(_n){}}let xr=fn();return nr&&typeof nr=="string"&&new Lt(nr,ai,He),_t(!0),()=>{const _n=mn.current.instance;_n.dispose();const ki=_n.getModel();ki&&ki.dispose(),mn.current.subscription&&mn.current.subscription.dispose(),xr.unobserve(be.current)}}catch(ai){}})},[]),(0,le.useEffect)(()=>{if(mn.current.instance&&Mt)return document.addEventListener("keydown",ni,!1),()=>{document.removeEventListener("keydown",ni)}},[un,Mt]),(0,le.useEffect)(()=>{let Un=mn.current.instance;if(Un&&Mt){let ai=Te(hn);He.editor.setModelLanguage(Un.getModel(),ai)}},[hn,Mt]),(0,le.useEffect)(()=>{mn.current.instance&&Mt&&He.editor.setTheme(Mi)},[Mi,Mt]),(0,le.useEffect)(()=>{let Un=mn.current.instance;fi.current=Dn,Un&&Mt&&(Un.updateOptions(It({},Dn)),setTimeout(()=>{Un.getModel().updateOptions(It({},Dn))},200))},[JSON.stringify(Dn),Mt]),(0,le.useEffect)(()=>{let Un=mn.current.instance;Un&&Mt&&Un.layout()},[kt,Dt,Mt]);const[Bt,Kn]=(0,le.useState)(Gi(kt)),[li,Qt]=(0,le.useState)(Gi(Dt)),jt=Pt(It({},wn),{width:Bt,height:li,position:"relative"});return le.createElement("div",{className:"my-monaco-editor",ref:be,style:jt},qt&&le.createElement(rt.CopyToClipboard,{text:Zt,onCopy:()=>en.ZP.success("\u590D\u5236\u6210\u529F")},le.createElement(vn.Z,{title:"\u590D\u5236\u4EE3\u7801"},le.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},le.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function an({width:Xt="100%",height:yn="100%",original:kt,modified:Dt,language:Zt,options:hn={}}){const wn=(0,le.useRef)(),[Dn,Tn]=(0,le.useState)(null);function Mi(zn){let on;return wn.current&&(on=new Ke.Z(Sn=>{for(let di of Sn)(di.target.offsetHeight>0||di.target.offsetWidth>0)&&zn.layout()}),on.observe(wn.current)),on}(0,le.useEffect)(()=>(wn.current&&Promise.all([Le.e(8909),Le.e(9404)]).then(Le.bind(Le,2550)).then(zn=>{He=zn;const on=He.editor.createDiffEditor(wn.current,Pt(It({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},hn),{wordWrap:!0}));Tn(on);let Sn=Mi(on);return()=>{on.dispose();const di=on.getModel();di&&di.dispose(),Sn.unobserve(wn.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,le.useEffect)(()=>{Dn&&Dn.setModel({original:He.editor.createModel(kt,Zt),modified:He.editor.createModel(Dt,Zt)})},[kt,Dt,Zt,Dn]);const tn=Gi(Xt),qt=Gi(yn),un={width:tn,height:qt};return le.createElement("div",{className:"my-diff-editor",ref:wn,style:un})}},10661:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Tt}});var le={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"},Ke=Le(29787),it=Le(25399),bt=Le(92310),vt=Le.n(bt),Oe=Le(51257),st=Le(28426),Et=Le(48790),ot=Le(59301),Tt=({className:ct,dataSource:At=[],col:De=4,right:ne,bottom:te=23,precision:de=0,wrapWidth:se=1200,trackEventItems:ge,loading:ye,onRemove:we=()=>{},isCurrent:Ce=!0,showAlias:_e=!1})=>{const Ze=Math.floor((se-(De-1)*ne)/De),lt=[{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 ot.createElement(Ke.Z,{spinning:ye},ot.createElement("div",{className:vt()(le.list,ct)},!!(At!=null&&At.length)&&(At==null?void 0:At.map((Qe,Ue)=>{var dt;const{name:$e,id:wt,identifier:St,featured:Lt,school_name:pn,image_url:en,excellent:vn,is_plan:rn}=Qe;return ot.createElement("div",{key:wt,className:le.wrap,style:{width:Ze,marginRight:(1+Ue)%De===0?0:ne+de,marginBottom:te}},ot.createElement("a",{className:le.li,onClick:nt=>{nt.preventDefault(),nt.stopPropagation(),ge&&(0,Oe.L9)([ge]),(0,Oe.xg)(`/paths/${St}`)}},ot.createElement("div",{className:le.img},ot.createElement("img",{className:le.cover,src:`${en}`}),Ce&&(0,Et.bg)()&&(Qe==null?void 0:Qe.studying)&&ot.createElement("div",{className:`${le.movebq} user-path-items`,onClick:nt=>{nt.stopPropagation(),we(Qe)}},ot.createElement("i",{className:"iconfont icon-yichu1 mr5 c-red"}),ot.createElement("span",{className:"c-red"},"\u79FB\u9664")),(dt=Qe==null?void 0:Qe.subject_tags)==null?void 0:dt.map((nt,rt)=>{var dn,ri;if(rt===0){const Wt=(dn=lt.find(En=>En.name==nt))==null?void 0:dn.swimg;return ot.createElement("img",{className:le.sign,src:Wt,style:{left:"-4px"}})}const Hn=(ri=lt.find(Wt=>Wt.name==nt))==null?void 0:ri.ptimg;return ot.createElement("img",{className:le.sign,src:Hn,style:{left:`${48+52*(rt-1)+2*rt}px`}})}),ot.createElement("div",{style:{position:"absolute",top:"150px",left:"4px"}},(Qe==null?void 0:Qe.excellent)&&ot.createElement("div",{className:le.bq},"\u5F00\u653E\u8BFE\u7A0B"))),ot.createElement("div",{className:le.name},ot.createElement(it.Z,{title:_e&&(Qe!=null&&Qe.excellent_alias_name)?ot.createElement("span",null,`\u8BFE\u7A0B\u539F\u540D\uFF1A${$e}`,ot.createElement("br",null),ot.createElement("span",null,`\u8BFE\u7A0B\u522B\u540D\uFF1A${Qe==null?void 0:Qe.excellent_alias_name}`)):$e},ot.createElement("span",{className:le.e},_e&&(Qe==null?void 0:Qe.excellent_alias_name)||$e))),ot.createElement(it.Z,{title:`\u53D1\u5E03\u5355\u4F4D\uFF1A${pn}`},ot.createElement("div",{className:le.unit},ot.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),pn)),ot.createElement("div",{className:le.tags},ot.createElement("div",null,ot.createElement(it.Z,{placement:"bottom",title:"\u7AE0\u8282\u6570"},ot.createElement("span",null,ot.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),ot.createElement("span",null,Qe.stages_count))),ot.createElement(it.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},ot.createElement("span",null,ot.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),ot.createElement("span",null,Qe.members_count)))))))})),!At.length&&ot.createElement(st.Z,null)))}},9148:function(Zn,ei,Le){"use strict";Le.d(ei,{jL:function(){return vt},w9:function(){return dn},QD:function(){return tn},cQ:function(){return en.Z},op:function(){return Zt},O5:function(){return fi},_b:function(){return di},t7:function(){return se},Gi:function(){return ci},YG:function(){return En},qp:function(){return Tt},vr:function(){return zn},qE:function(){return Dn},Je:function(){return we},wb:function(){return pn},cq:function(){return ze},tp:function(){return De}});var le=Le(59301),Ke={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"},it="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==",vt=({dataSource:Vn=[],img:si,imgWidth:Di=346,title:Ni,sunTitle:yr,bannerExtraContent:zt})=>le.createElement("div",{className:Ke.banner},le.createElement("div",{className:Ke.content},le.createElement("aside",null,le.createElement("p",null,le.createElement("b",null,Ni),le.createElement("span",null,yr)),Vn.length>0&&le.createElement("div",{className:Ke.btns},Vn.map((Mt,_t)=>le.createElement("div",{key:_t,onClick:Mt.click},Mt.name,Mt.sign?le.createElement("img",{src:it,width:39}):null))),zt),si&&le.createElement("img",{style:{marginTop:33,marginRight:38},src:si,width:Di}))),Oe={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"},st=Le(92310),Et=Le.n(st),ot=Le(89392),Tt=({dataSource:Vn=[],value:si,onChange:Di,onTitleChange:Ni,className:yr,title:zt,titleWidth:Mt=41,style:_t={},fontColor:fn="#6A7283",showCount:Ji})=>{const[mi,$i]=(0,le.useState)(0),[xn,ni]=(0,le.useState)(!1),sr=(0,le.useRef)(null),br=(0,le.useRef)(null);return(0,le.useEffect)(()=>{var Yn;Vn.length!==0&&(((Yn=sr==null?void 0:sr.current)==null?void 0:Yn.clientHeight)>97?$i(1):$i(0)),Vn.length===0&&$i(0),ni(!1)},[Vn]),le.createElement("div",{className:Et()(Oe.row,yr),style:_t},le.createElement("div",{onClick:(0,ot.throttle)(()=>Ni==null?void 0:Ni(),2e3),style:{width:Mt,marginTop:xn?12:4},className:`${Oe.title} ${Ni?"current":""}`},zt),le.createElement("div",{className:xn?`${Oe.tagsWrap} ${Oe.tagsBorderWrap}`:Oe.tagsWrap},le.createElement("div",{className:Oe.bar,ref:br,style:mi>0?{height:mi===1?97:"auto",overflow:mi===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},le.createElement("div",{className:Oe.tag,ref:sr},Vn==null?void 0:Vn.map(Yn=>le.createElement("span",{onClick:()=>Di(Yn.id),key:Yn.id,style:{color:fn},className:si===Yn.id?Oe.active:""},le.createElement("span",{title:Yn.name,className:Oe.name},Yn.name),!!Ji&&le.createElement("span",{className:Oe.num},Yn.count))))),!!mi&&le.createElement(le.Fragment,null,mi===1?le.createElement("div",{onClick:()=>{var Yn;$i(2),((Yn=sr==null?void 0:sr.current)==null?void 0:Yn.clientHeight)>245?ni(!0):ni(!1)},className:Oe.action},"\u5C55\u5F00",le.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):le.createElement("div",{onClick:()=>{br.current.scrollTop=0,$i(1),ni(!1)},className:Oe.action},"\u6536\u8D77",le.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},ct={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"},De=({dataSource:Vn=[],value:si,onChange:Di,className:Ni,style:yr={}})=>le.createElement("div",{style:yr,className:Et()(ct.tabs,Ni)},Vn.map(zt=>le.createElement("span",{onClick:()=>Di(zt.id),className:si===zt.id?ct.active:"",key:zt.id},zt.name))),ne={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"},te=Le(37568),se=({dataSource:Vn=[],value:si="",onChange:Di,onInputChange:Ni=()=>{},className:yr,style:zt={},placeholder:Mt,allowClear:_t=!1})=>{var fn;const[Ji,mi]=(0,le.useState)(""),[$i,xn]=(0,le.useState)("");(0,le.useEffect)(()=>{var br;let Yn=si;(br=JSON.stringify(si))!=null&&br.includes("{")&&(mi(si.id),Yn=si.value||"");try{xn(decodeURIComponent(Yn||""))}catch(at){xn(decodeURIComponent(Yn||""))}},[si]);const ni=()=>{Di(encodeURIComponent($i),Ji||null)},sr=br=>{br!==Ji&&(mi(br),Di(encodeURIComponent($i),br))};return le.createElement("div",{className:Et()(ne.input,yr),style:zt},!!Vn.length&&le.createElement("div",{className:ne.dropdown},le.createElement("div",{className:ne.text},(fn=Vn.find(br=>br.id===Ji))==null?void 0:fn.name,le.createElement("i",{className:"iconfont icon-zhankai4"}),le.createElement("b",{className:ne.b1}),le.createElement("b",{className:ne.b2})),le.createElement("div",{className:ne.menu},Vn.map((br,Yn)=>le.createElement("div",{key:Yn,onClick:()=>sr(br.id)},br.name)))),le.createElement(te.default,{onPressEnter:ni,value:$i,onChange:br=>{xn(br.target.value),Ni(encodeURIComponent(br.target.value),Ji||null)},bordered:!1,placeholder:Mt}),le.createElement("i",{onClick:ni,className:"iconfont icon-sousuo9 font14 pl10 current"}))},ge={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"},we=({value:Vn,onChange:si,className:Di,total:Ni,pageSize:yr,style:zt={}})=>{const Mt=Vn<2,_t=Vn>=Math.ceil(Ni/yr);return Ni<=yr?le.createElement(le.Fragment,null):le.createElement("div",{className:Et()(ge.quickPager,Di),style:zt},le.createElement("div",{onClick:()=>{Mt||si(Vn-1,"prev")},className:Mt?ge.disabled:""},"\u4E0A\u4E00\u9875"),le.createElement("div",{onClick:()=>{_t||si(Vn+1,"next")},className:_t?ge.disabled:""},"\u4E0B\u4E00\u9875"))},Ce={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"},_e=Le(29787),Ze=Le(25399),lt=Le(58018),Qe=Le(346),Ue=Le(51257),dt=Le(96908),$e=Le(57177),wt=Le(81378),St=Le(28426),pn=({className:Vn,dataSource:si=[],col:Di=4,right:Ni,bottom:yr=23,precision:zt=0,wrapWidth:Mt=1200,trackEventItems:_t,loading:fn})=>{const Ji=Math.floor((Mt-(Di-1)*Ni)/Di);return le.createElement(_e.Z,{spinning:fn},le.createElement("div",{className:Et()(Ce.list,Vn)},!!si.length&&si.map((mi,$i)=>{const{name:xn,id:ni,identifier:sr,power:br,cover_image_id:Yn,pic:at}=mi;return le.createElement("div",{className:Ce.wrap,key:ni,style:{width:Ji,marginRight:(1+$i)%Di===0?0:Ni+zt,marginBottom:yr}},le.createElement("a",{target:"_blank",href:`/shixuns/${sr}/challenges`,className:Ce.li,onClick:Bt=>{Bt.preventDefault(),_t&&(0,Ue.L9)([_t]),br&&(0,Ue.xg)(`/shixuns/${sr}/challenges`)}},le.createElement("div",{className:Ce.img},le.createElement("img",{className:Ce.cover,src:`${at}`}),mi.is_jupyter&&le.createElement("img",{className:Ce.sign,src:dt}),mi.is_jupyter_lab&&le.createElement("img",{className:Ce.sign,src:$e}),mi.is_unity_3d&&le.createElement("img",{className:Ce.sign,src:wt})),le.createElement("div",{className:Ce.name},le.createElement(Ze.Z,{title:xn||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},le.createElement("span",{className:Ce.e},xn||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),le.createElement("div",{className:Ce.tags},le.createElement(Ze.Z,{placement:"bottom",title:"\u5173\u5361\u6570"},le.createElement("span",null,le.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr2"}),le.createElement("span",null,mi.challenges_count))),!!mi.myshixuns_count&&le.createElement(Ze.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},le.createElement("span",null,le.createElement("i",{className:"iconfont icon-chengyuan font14 mr2"}),le.createElement("span",null,mi.myshixuns_count))),le.createElement(Ze.Z,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},le.createElement("span",null,le.createElement("span",null,mi.level))),le.createElement("div",{className:Ce.rate},le.createElement(lt.Z,{allowHalf:!0,disabled:!0,defaultValue:mi.score_info}),le.createElement("span",null,"\xA0",mi.score_info?`${mi.score_info}\u5206`:"5\u5206")))),!br&&le.createElement("div",{className:Ce.lockWrap},le.createElement("img",{src:`${Qe.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),le.createElement("span",{className:"mt15 font16 c-white"},"\u5B9A\u5411\u5F00\u653E\u5185\u5BB9\uFF0C\u9700\u8981\u6388\u6743")))}),!si.length&&le.createElement(St.Z,null)))},en=Le(10661),vn={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"},rn="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",nt=Le(59301),dn=({className:Vn,dataSource:si=[],col:Di=4,right:Ni,bottom:yr=23,precision:zt=0,wrapWidth:Mt=1200,trackEventItems:_t,loading:fn,handleVery:Ji=()=>!0})=>{const mi=Math.floor((Mt-(Di-1)*Ni)/Di);return nt.createElement(_e.Z,{spinning:fn},nt.createElement("div",{className:Et()(vn.list,Vn)},!!si.length&&si.map(($i,xn)=>{const{subject_identifier:ni,id:sr,identifier:br,power:Yn}=$i,at=$i.is_public!=0&&$i.is_public;return nt.createElement("div",{className:vn.wrap,key:sr,style:{width:mi,marginRight:(1+xn)%Di===0?0:Ni+zt,marginBottom:yr}},nt.createElement("a",{className:vn.li,onClick:Bt=>{Bt.preventDefault(),Ji($i==null?void 0:$i.first_category_url)&&(_t&&(0,Ue.L9)([_t]),(0,Ue.xg)($i.first_category_url))}},nt.createElement("div",{className:vn.top},nt.createElement(Ze.Z,{title:$i.name},nt.createElement("div",{className:vn.name},$i.name)),nt.createElement("img",{className:vn.img,src:Qe.Z.IMG_SERVER+"/images/"+$i.avatar_url}),nt.createElement("div",{className:vn.text,title:$i.creator},$i.creator),ni&&nt.createElement("div",{className:vn.btns},nt.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),nt.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),at&&nt.createElement("div",{className:vn.sign},"\u516C\u5F00")),nt.createElement("div",{className:vn.bottom},$i.visits>0&&nt.createElement(Ze.Z,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},nt.createElement("span",null,nt.createElement("i",{className:"iconfont icon-liulanyan"}),nt.createElement("span",null,$i.visits))),$i.course_members_count>0&&nt.createElement(Ze.Z,{title:"\u6210\u5458",placement:"bottom"},nt.createElement("span",null,nt.createElement("i",{className:"iconfont icon-chengyuan"}),$i.course_members_count)),$i.tasks_count>0&&nt.createElement(Ze.Z,{title:"\u4F5C\u4E1A",placement:"bottom"},nt.createElement("span",null,nt.createElement("i",{className:"iconfont icon-zuoye"}),$i.tasks_count)),$i.is_end?nt.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):nt.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),!$i.is_accessible&&nt.createElement("div",{className:vn.lockWrap},nt.createElement("img",{src:`${Qe.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),nt.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165")))}),!si.length&&nt.createElement(St.Z,null)))},ri={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"},Hn=Le(25690),En=({dataSource:Vn=[],value:si,onChange:Di,className:Ni,style:yr={},tabBarExtraContent:zt})=>le.createElement("div",{className:Et()(ri.tabs,Ni),style:yr},le.createElement("div",{className:ri.tabsWrap},Vn.map((Mt,_t)=>!(Mt!=null&&Mt.hide)&&le.createElement("aside",{className:ri.tab,onClick:()=>{Di(Mt.id),Mt.link&&Hn.history.push(Mt.link)},key:_t},le.createElement("div",{className:si===Mt.id?ri.active:""},Mt.name),(Mt==null?void 0:Mt.resetCount)==null&&(Mt==null?void 0:Mt.total)!==void 0&&le.createElement("span",null,"\uFF08",Mt==null?void 0:Mt.total,"\uFF09"),(Mt==null?void 0:Mt.resetCount)!==void 0&&(Mt==null?void 0:Mt.total)!==void 0&&le.createElement(Ze.Z,{title:(Mt==null?void 0:Mt.tip)!=null?Mt==null?void 0:Mt.tip:""},le.createElement("span",{style:{color:"#9096A3"}},"\uFF08",le.createElement("span",{style:{color:"#000"}},Mt==null?void 0:Mt.resetCount),"/",le.createElement("span",null,Mt==null?void 0:Mt.total),"\uFF09"))))),le.createElement("div",{className:ri.tabBar},zt)),ci=({className:Vn,style:si={},children:Di})=>le.createElement("div",{className:Et()(Vn),style:si},Di),It={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"},Pt=Le(75727),Nt=Le(93041);const ii=[{id:"updated_at",name:"\u6700\u65B0\u52A8\u6001"},{id:"created_at",name:"\u6700\u65B0\u521B\u5EFA"},{id:"name",name:"\u540D\u79F0\u6392\u5E8F"}];var ze=({sortValue:Vn,dropValue:si,className:Di,onSort:Ni,onDrop:yr,dataSource:zt=ii})=>{var Mt;return le.createElement("div",{className:Et()(It.orderWrap,Di)},le.createElement(Pt.Z,{dropdownRender:()=>le.createElement(Nt.default,null,zt.map((_t,fn)=>le.createElement(Nt.default.Item,{key:fn,onClick:()=>yr(_t.id)},_t.name)))},le.createElement("span",{className:It.orderTextWrap},(Mt=zt.find(_t=>si===_t.id))==null?void 0:Mt.name)),le.createElement("span",{className:It.orderIconWrap},le.createElement("span",{className:It.orderAsc},le.createElement("i",{className:Vn==="asc"?`iconfont icon-sanjiaoxing-up font12 ${It.cursorPointer} ${It.active}`:`iconfont icon-sanjiaoxing-up font12 ${It.cursorPointer}`,onClick:()=>Ni(Vn==="asc"?"desc":"asc")})),le.createElement("span",{className:It.orderDesc},le.createElement("i",{className:Vn==="desc"?`iconfont icon-sanjiaoxing-down font12 ${It.cursorPointer} ${It.active}`:`iconfont icon-sanjiaoxing-down font12 ${It.cursorPointer}`,onClick:()=>Ni(Vn==="asc"?"desc":"asc")}))))},Me={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"},Ee=Le(99571),Te=Object.defineProperty,He=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable,an=(Vn,si,Di)=>si in Vn?Te(Vn,si,{enumerable:!0,configurable:!0,writable:!0,value:Di}):Vn[si]=Di,Xt=(Vn,si)=>{for(var Di in si||(si={}))Ae.call(si,Di)&&an(Vn,Di,si[Di]);if(He)for(var Di of He(si))qe.call(si,Di)&&an(Vn,Di,si[Di]);return Vn},yn=(Vn,si)=>{var Di={};for(var Ni in Vn)Ae.call(Vn,Ni)&&si.indexOf(Ni)<0&&(Di[Ni]=Vn[Ni]);if(Vn!=null&&He)for(var Ni of He(Vn))si.indexOf(Ni)<0&&qe.call(Vn,Ni)&&(Di[Ni]=Vn[Ni]);return Di},kt=(Vn,si,Di)=>new Promise((Ni,yr)=>{var zt=fn=>{try{_t(Di.next(fn))}catch(Ji){yr(Ji)}},Mt=fn=>{try{_t(Di.throw(fn))}catch(Ji){yr(Ji)}},_t=fn=>fn.done?Ni(fn.value):Promise.resolve(fn.value).then(zt,Mt);_t((Di=Di.apply(Vn,si)).next())}),Zt=Vn=>{var si=Vn,{className:Di,style:Ni,children:yr,loading:zt=!1,openLoading:Mt,onClick:_t=()=>{},size:fn="middle",shape:Ji="round"}=si,mi=yn(si,["className","style","children","loading","openLoading","onClick","size","shape"]);const[$i,xn]=(0,le.useState)(!1);return le.createElement(Ee.ZP,Xt({onClick:(0,ot.throttle)(ni=>kt(void 0,null,function*(){Mt&&xn(!0);try{yield _t(ni)}catch(sr){console.log("error",sr)}Mt&&xn(!1)}),2e3,{leading:!0,trailing:!1}),className:Et()(Me.btn,Me[`${fn}-${Ji}`],Di),style:Ni,size:fn,shape:Ji,loading:$i||zt},mi),yr)},hn={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"},Dn=({className:Vn,style:si,children:Di=null,onClick:Ni,title:yr})=>le.createElement("div",{className:Et()(hn.head,Vn),style:si},le.createElement("span",{className:"primary-hover",onClick:Ni},le.createElement("i",{className:"iconfont icon-fanhui2 font12"}),"\u8FD4\u56DE"),le.createElement("b",{title:yr},yr),le.createElement("div",{className:hn.node},Di)),Tn={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"},tn=({confirmShow:Vn=!0,confirmTitle:si,confirmClick:Di,cancelShow:Ni=!0,cancelTitle:yr,cancelClick:zt,className:Mt,style:_t,confirmLoading:fn=!1})=>le.createElement("div",{className:Et()(Tn.btns,Mt),style:_t},Vn&&le.createElement(Ee.ZP,{loading:fn,onClick:Di,type:"primary",className:Tn.confirm},si),Ni&&le.createElement(Ee.ZP,{onClick:zt,className:Tn.cancel},yr)),qt={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"},zn=({className:Vn,style:si={},LeftContent:Di,children:Ni,RightContent:yr})=>le.createElement("div",{className:Et()(qt.fixedBottom,Vn),style:si},le.createElement("div",{className:qt.wrap},le.createElement("div",{className:qt.left},Di),le.createElement("div",{className:qt.center},Ni),le.createElement("div",{className:qt.right},yr))),on={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"},di=({className:Vn,style:si={},dataSource:Di=[]})=>le.createElement("div",{className:Et()(on.crumbs,Vn),style:si},Di.map((Ni,yr)=>yr<Di.length-1?le.createElement(le.Fragment,{key:yr},Ni.path||Ni.onClick?le.createElement("span",{className:on.hover,onClick:Ni!=null&&Ni.onClick?Ni.onClick:()=>Hn.history.push(Ni.path)},Ni.name):le.createElement("span",null,Ni.name),le.createElement("span",null,"\xA0",">","\xA0")):le.createElement("span",{key:yr,style:{color:"#5F6368"}},Ni.name))),Ui=Le(11938),gi=Object.defineProperty,Hi=Object.defineProperties,kr=Object.getOwnPropertyDescriptors,Gn=Object.getOwnPropertySymbols,On=Object.prototype.hasOwnProperty,Xn=Object.prototype.propertyIsEnumerable,wi=(Vn,si,Di)=>si in Vn?gi(Vn,si,{enumerable:!0,configurable:!0,writable:!0,value:Di}):Vn[si]=Di,nr=(Vn,si)=>{for(var Di in si||(si={}))On.call(si,Di)&&wi(Vn,Di,si[Di]);if(Gn)for(var Di of Gn(si))Xn.call(si,Di)&&wi(Vn,Di,si[Di]);return Vn},ji=(Vn,si)=>Hi(Vn,kr(si)),Cr=(Vn,si)=>{var Di={};for(var Ni in Vn)On.call(Vn,Ni)&&si.indexOf(Ni)<0&&(Di[Ni]=Vn[Ni]);if(Vn!=null&&Gn)for(var Ni of Gn(Vn))si.indexOf(Ni)<0&&Xn.call(Vn,Ni)&&(Di[Ni]=Vn[Ni]);return Di};const{Countdown:be}=Ui.default;var fi=Vn=>{var si=Vn,{onChange:Di}=si,Ni=Cr(si,["onChange"]);const[yr,zt]=(0,le.useState)(null);(0,le.useEffect)(()=>{typeof yr=="number"&&yr>=0&&Di(yr)},[yr]);const Mt=_t=>{const fn=Math.floor(_t/1e3);zt(fn)};return le.createElement(be,ji(nr({},Ni),{onChange:Mt}))}},37808:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Ke}});var le=Le(59301);function Ke(it,bt){const vt=(0,le.useRef)();(0,le.useEffect)(()=>{vt.current=it}),(0,le.useEffect)(()=>{function Oe(){vt.current()}if(bt!==null){let st=setInterval(Oe,bt);return()=>clearInterval(st)}},[bt])}},37345:function(Zn,ei,Le){"use strict";Le.d(ei,{h:function(){return le}});var le=(Ke=>(Ke[Ke.NOMATCH=-1]="NOMATCH",Ke[Ke.OK=0]="OK",Ke[Ke.TIMEOUT=2]="TIMEOUT",Ke[Ke.PODFAILURE=3]="PODFAILURE",Ke[Ke.COMPILEFAILURE=4]="COMPILEFAILURE",Ke[Ke.EXECUTEFAILURE=5]="EXECUTEFAILURE",Ke[Ke.HIDE_COMPILE_STATUS=11]="HIDE_COMPILE_STATUS",Ke))(le||{})},81072:function(Zn,ei,Le){"use strict";Le.d(ei,{H7:function(){return ne},MK:function(){return De},MU:function(){return We},X6:function(){return ct},bM:function(){return ot},fi:function(){return te},fu:function(){return Et},n4:function(){return de},rX:function(){return At},vl:function(){return se},zO:function(){return Tt}});var le=Le(38986),Ke=Object.defineProperty,it=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable,Oe=(ge,ye,we)=>ye in ge?Ke(ge,ye,{enumerable:!0,configurable:!0,writable:!0,value:we}):ge[ye]=we,st=(ge,ye)=>{for(var we in ye||(ye={}))bt.call(ye,we)&&Oe(ge,we,ye[we]);if(it)for(var we of it(ye))vt.call(ye,we)&&Oe(ge,we,ye[we]);return ge};function Et(ge,ye){return(0,le.U2)(`myproblems/${ge}.json`,st({hidePopLogin:!0},ye||{}))}function ot(ge,ye){return(0,le.v_)(`myproblems/${ge}/code_submit.json`,ye)}function We(ge,ye){return(0,le.v_)(`myproblems/${ge}/code_debug.json`,ye)}function Tt(ge,ye){return ye.language&&(ye.language=encodeURIComponent(ye.language)),(0,le.U2)(`myproblems/${ge}/submit_records.json`,ye)}function ct(ge){return(0,le.U2)("myproblems/record_detail.json",{id:ge})}function At(ge,ye){return(0,le.U2)(`myproblems/${ge}/result.json`,{mode:ye})}function De(ge,ye){return(0,le.v_)(`myproblems/${ge}/add_notes.json`,ye)}function ne(ge,ye){return(0,le.v_)(`myproblems/${ge}/restore_initial_code.json`,ye)}function te(ge){return(0,le.v_)(`myproblems/${ge}/sync_code.json`)}function de(ge,ye){return(0,le.v_)(`myproblems/${ge}/update_code.json`,ye)}function se(ge,ye){return(0,le.v_)(`discusses/${ge}/plus.json`,ye)}},43554:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Ua}});var le=Le(59301),Ke={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"},it=Le(28284),bt=Le(25399),vt=Le(99571),Oe=Le(62957),st=Le(71051),Et=Le(6767),ot=Le(37568),We=Le(37285),Tt=Le(62673),ct=Le(37639),At=Le(77019),De=Le(5269),ne=Le(13747),te=Object.defineProperty,de=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,ye=(pt,Ut,Re)=>Ut in pt?te(pt,Ut,{enumerable:!0,configurable:!0,writable:!0,value:Re}):pt[Ut]=Re,we=(pt,Ut)=>{for(var Re in Ut||(Ut={}))se.call(Ut,Re)&&ye(pt,Re,Ut[Re]);if(de)for(var Re of de(Ut))ge.call(Ut,Re)&&ye(pt,Re,Ut[Re]);return pt};const Ce=pt=>React.createElement("svg",we({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},pt),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 _e="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTRFNkZEIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0iTTEzLjgwOCAxMS40NDhhLjU1OC41NTggMCAwIDEgMCAuNzg4bC0xLjU2NCAxLjU2NWEuNTU4LjU1OCAwIDEgMS0uNzg5LS43OWwxLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDAgMSAuNzkgMFptOS44ODIgMi40NjJhLjU1OC41NTggMCAwIDEtLjc4OSAwbC0xLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDEgMSAuNzg5LS43ODlsMS41NjQgMS41NjRhLjU1Ni41NTYgMCAwIDEgMCAuNzg4WiIgZmlsbD0iIzY2NzhFQiIvPjxwYXRoIGQ9Ik0yMS43NTMgMjEuNzA3YTUuOTM3IDUuOTM3IDAgMSAwLTguNTguMDE1bC0uOTM3LjkzNmEuNTU4LjU1OCAwIDEgMCAuNzg5Ljc4OGwuOTk1LS45OTRhNS45MSA1LjkxIDAgMCAwIDMuNDM2IDEuMDk1YzEuMjg3IDAgMi40OC0uNDEgMy40NTItMS4xMDZsLjk5Mi45OTJhLjU1OC41NTggMCAxIDAgLjc4OS0uNzg5bC0uOTM2LS45MzdaIiBmaWxsPSIjNjY3OEVCIi8+PHBhdGggZD0ibTIwLjg1OCAxOC45NS0zLjAyNC0xLjc0NXYtMi4wNTRhLjU1OC41NTggMCAxIDAtMS4xMTcgMHYyLjM1MWMwIC4wNjQuMDExLjEyNi4wMzEuMTg0YS41NTEuNTUxIDAgMCAwIC4yNTguMzNsMy4yOTMgMS45YS41NTcuNTU3IDAgMCAwIC41NTktLjk2NloiIGZpbGw9IiNGRkYiLz48L2c+PC9nPjwvc3ZnPg==",Ze=Le(76902),lt=Le(25690),Qe=Le(51257),Ue=Le(38986),dt=Object.defineProperty,$e=Object.getOwnPropertySymbols,wt=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable,Lt=(pt,Ut,Re)=>Ut in pt?dt(pt,Ut,{enumerable:!0,configurable:!0,writable:!0,value:Re}):pt[Ut]=Re,pn=(pt,Ut)=>{for(var Re in Ut||(Ut={}))wt.call(Ut,Re)&&Lt(pt,Re,Ut[Re]);if($e)for(var Re of $e(Ut))St.call(Ut,Re)&&Lt(pt,Re,Ut[Re]);return pt};const en=pt=>React.createElement("svg",pn({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},pt),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 vn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIgZmlsbD0iI0VBRjNGNCIvPjxwYXRoIGQ9Ik0yNS45MDUgMTUuMzdhLjc3NS43NzUgMCAwIDAtLjYyNi0uNTI5bC00LjgxNC0uNy0yLjE1Mi00LjM2MmEuNzc2Ljc3NiAwIDAgMC0xLjM5MiAwbC0yLjE1MyA0LjM2My00LjgxNC42OTlhLjc3NS43NzUgMCAwIDAtLjQzIDEuMzIzbDMuNDg0IDMuMzk2LS44MjMgNC43OTRhLjc3Ny43NzcgMCAwIDAgMS4xMjYuODE4bDQuMzA2LTIuMjY0IDQuMzA1IDIuMjY0YS43NzguNzc4IDAgMCAwIC44MTctLjA1OS43NzcuNzc3IDAgMCAwIC4zMS0uNzU5bC0uODIzLTQuNzk0IDMuNDgzLTMuMzk2YS43NzcuNzc3IDAgMCAwIC4xOTYtLjc5NVoiIGZpbGw9IiMyMUMwQTYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4=",rn=Object.defineProperty,nt=Object.getOwnPropertySymbols,rt=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable,ri=(pt,Ut,Re)=>Ut in pt?rn(pt,Ut,{enumerable:!0,configurable:!0,writable:!0,value:Re}):pt[Ut]=Re,Hn=(pt,Ut)=>{for(var Re in Ut||(Ut={}))rt.call(Ut,Re)&&ri(pt,Re,Ut[Re]);if(nt)for(var Re of nt(Ut))dn.call(Ut,Re)&&ri(pt,Re,Ut[Re]);return pt};const Wt=pt=>React.createElement("svg",Hn({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},pt),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 En="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTdGM0ZGIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGw9IiM0QzZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0ibTIzLjcxOSAxMy4zMjUtNC4wOTgtMy45NGMtLjA5Ny0uMTMtLjIyNS0uMTYyLS4zNTUtLjE2Mi0uMTI5IDAtLjI1OC4wNjQtLjM4Ny4xNjFsLTcuNTUgNy43NTNjLS4wNjUuMDY1LS4wOTguMTYyLS4xMy4yMjdsLTEuMDMyIDUuNDI3Yy0uMDMzLjE5NC4wMzIuMzIzLjE2LjQ4NC4xMy4xMy4yMjcuMTYyLjM4OS4xNjJoLjA5Nmw0Ljc3Ni0xLjA5OWMuMDk3LS4wMzIuMTk0LS4wNjQuMjU4LS4xNjFsNy44NDEtOC4xMDhjLjE5NC0uMTYyLjE5NC0uNTE3LjAzMy0uNzQ0aC0uMDAxWm0tOC4xIDguMDQ0YS41MzQuNTM0IDAgMCAxLS4zODYuMTYyLjU2LjU2IDAgMCAxLS4zODgtLjE2MmwtMy0yLjgxYy0uMjI2LS4xOTQtLjIyNi0uNTE3LS4wMzMtLjc0My4xOTQtLjIyNy41MTctLjIyNy43NDMtLjAzM2wzIDIuODExYy4yNTkuMjI2LjI5MS41NS4wNjUuNzc2Wk0xNyAyMi45Mmg2Ljg0NHYxLjA1NUgxN3oiLz48L2c+PC9nPjwvc3ZnPg==",An=Le(12327),ci=Le(39793),It=Le(61011),Pt=Le(30371),Nt={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"},ii=Le(59301),Gi=Object.defineProperty,ze=Object.defineProperties,Me=Object.getOwnPropertyDescriptors,Ee=Object.getOwnPropertySymbols,Te=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,Ae=(pt,Ut,Re)=>Ut in pt?Gi(pt,Ut,{enumerable:!0,configurable:!0,writable:!0,value:Re}):pt[Ut]=Re,qe=(pt,Ut)=>{for(var Re in Ut||(Ut={}))Te.call(Ut,Re)&&Ae(pt,Re,Ut[Re]);if(Ee)for(var Re of Ee(Ut))He.call(Ut,Re)&&Ae(pt,Re,Ut[Re]);return pt},an=(pt,Ut)=>ze(pt,Me(Ut)),Xt=(pt,Ut)=>{var Re={};for(var ut in pt)Te.call(pt,ut)&&Ut.indexOf(ut)<0&&(Re[ut]=pt[ut]);if(pt!=null&&Ee)for(var ut of Ee(pt))Ut.indexOf(ut)<0&&He.call(pt,ut)&&(Re[ut]=pt[ut]);return Re};const yn=null,kt=(pt,Ut)=>{var Re=pt,{globalSetting:ut,loading:dr,dispatch:lr,isEdit:gr,editData:Qi}=Re,Jn=Xt(Re,["globalSetting","loading","dispatch","isEdit","editData"]);const[Fr,Br]=(0,le.useState)(""),[Zr,mr]=(0,le.useState)(""),[Po,Ki]=(0,le.useState)([]),[Ei,bi]=(0,le.useState)(""),[Jr,Ur]=(0,le.useState)(),[Mr,Fo]=(0,le.useState)(!1),[vr,so]=(0,le.useState)({}),[er,Tr]=(0,le.useState)([]);(0,le.useEffect)(()=>{!Qi||!gr||(Br(Qi==null?void 0:Qi.name),mr(Qi==null?void 0:Qi.analysis),Ur(Qi==null?void 0:Qi.is_ordered),so(Qi),Fo(!0))},[Qi]),(0,le.useEffect)(()=>{if(!Mr)return;const na=Qi==null?void 0:Qi.standard_answer.map(Xa=>Xa==null?void 0:Xa.answer_text);Ki(na);const Eo=Qi==null?void 0:Qi.standard_answer.map(Xa=>Xa==null?void 0:Xa.score);Tr(Eo),Fo(!1)},[Mr]),(0,le.useImperativeHandle)(Ut,()=>({onSave:oo,Clear:Go}));const oo=()=>{let na=[],Eo=!1;return Fr?(Po.forEach((Xa,Ia)=>{na.push({position:Ia+1,answer_text:[],score:er[Ia]}),Xa==null||Xa.forEach((xs,Yl)=>{na[Ia].answer_text.push(xs),(!xs||!(0,Qe.eR)(xs,1e4))&&(bi(`${Ia}-${Yl}`),Et.ZP.info(xs?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Eo=!0)})}),Eo?!1:(na==null?void 0:na.length)>20?(Et.ZP.warning("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:Fr,analysis:Zr,standard_answers:na,is_ordered:Jr,downcase:vr==null?void 0:vr.downcase,no_space:vr==null?void 0:vr.no_space,use_blank_score:vr==null?void 0:vr.use_blank_score}):(Et.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Go=()=>{Br(""),mr(""),Ki([]),Ur(!1)},ha=(na,Eo,Xa)=>{const Ia=Po.slice();if(Eo&&Ia.splice(na,Eo),Xa)for(let xs=0;xs<Xa;xs++)Ia.splice(na+xs,0,[""]);Ki(Ia)},_a=(na,Eo,Xa)=>{bi("");let Ia=Po.slice();Ia[na][Eo]=Xa,Ki(Ia)},jr=na=>{let Eo=Po.slice();Eo[na]=[...Eo[na],""],Ki(Eo)},Ls=(na,Eo)=>{let Xa=Po.slice();if(!Xa[na][Eo]){Xa[na]=Xa[na].filter((Ia,xs)=>xs!==Eo),Ki(Xa);return}Oe.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:Nt.modal,onOk:()=>{Xa[na]=Xa[na].filter((Ia,xs)=>xs!==Eo),Ki(Xa)}})},vo=na=>{Oe.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:Nt.modal,onOk:()=>{let Eo=Po.slice();Eo=Po.filter((Xa,Ia)=>na!==Ia),Ki(Eo)}})};return ii.createElement("section",{className:Nt.wrap},ii.createElement("p",{className:Nt.titleWrap},ii.createElement("span",{className:Nt.required},"*"),ii.createElement("span",{className:Nt.title},"\u9898\u5E72\uFF1A")),ii.createElement("div",null,ii.createElement(It.Z,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:Fr,onChange:na=>Br(na),showNullButton:!0,onPlaceholderChange:ha})),ii.createElement("div",{className:"mt20"},Po.map((na,Eo)=>ii.createElement("div",{style:{display:"flex"}},ii.createElement("div",{style:{flex:1}},ii.createElement(Pt.Z,{key:Eo,answers:na,index:Eo,flex:1,is_md:!0,activeOptionErrorIndex:Ei,onAnswerChange:_a,addChildAnswer:jr,deleteChildAnswer:Ls,deleteChildAnswermain:vo})),vr.use_blank_score&&ii.createElement("div",{style:{display:"flex",alignItems:"center",width:"165px"}},ii.createElement("span",{style:{color:"red",margin:"auto 5px auto 10px"}},"*"),"\u5206\u503C\uFF1A",ii.createElement(st.Z,{style:{width:"100px"},size:"large",defaultValue:er[Eo],onBlur:Xa=>{er[Eo]=Xa.target.value,Tr([...er])}}))))),ii.createElement("div",null,ii.createElement(Tt.default,{className:`${Nt.color333} font14 mt20`,checked:vr.use_blank_score,onChange:na=>so(an(qe({},vr),{use_blank_score:na.target.checked}))},"\u5224\u5206\u65F6\u6309\u7A7A\u7ED9\u5206"),ii.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")),ii.createElement("div",null,ii.createElement(Tt.default,{className:`${Nt.color333} font14 mt20`,checked:vr.downcase,onChange:na=>so(an(qe({},vr),{downcase:na.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),ii.createElement("div",null,ii.createElement(Tt.default,{className:`${Nt.color333} font14 mt20`,checked:vr.no_space,onChange:na=>so(an(qe({},vr),{no_space:na.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),ii.createElement("div",{className:"mt20"},(Po==null?void 0:Po.length)>1&&ii.createElement("span",null,ii.createElement(Tt.default,{checked:Jr,onChange:na=>Ur(na.target.checked),className:`${Nt.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),ii.createElement("span",{className:`${Nt.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"))),ii.createElement("p",{className:Nt.titleWrap},ii.createElement("span",{className:Nt.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),ii.createElement(ci.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Zr,onChange:na=>mr(na)}))};var Dt=(0,lt.connect)(({loading:pt,globalSetting:Ut})=>({globalSetting:Ut,loading:pt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(kt)),Zt=Le(47889),hn=Object.getOwnPropertySymbols,wn=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable,Tn=(pt,Ut)=>{var Re={};for(var ut in pt)wn.call(pt,ut)&&Ut.indexOf(ut)<0&&(Re[ut]=pt[ut]);if(pt!=null&&hn)for(var ut of hn(pt))Ut.indexOf(ut)<0&&Dn.call(pt,ut)&&(Re[ut]=pt[ut]);return Re};const Mi=null,tn=(pt,Ut)=>{var Re=pt,{globalSetting:ut,loading:dr,editData:lr,dispatch:gr,onRef:Qi=()=>{},isEdit:Jn}=Re,Fr=Tn(Re,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[Br,Zr]=(0,le.useState)(),[mr,Po]=(0,le.useState)(""),[Ki,Ei]=(0,le.useState)("");(0,le.useEffect)(()=>{if(!lr||!Jn)return;Po(lr==null?void 0:lr.name),Ei(lr==null?void 0:lr.analysis);const Ur=lr==null?void 0:lr.choices.find(Mr=>Mr.is_answer);Zr(Ur.choice_text==="\u6B63\u786E"?"0":"1")},[lr]),(0,le.useImperativeHandle)(Ut,()=>({onSave:bi,Clear:Jr}));const bi=()=>mr?Br?{name:mr,choices:[{choice_text:"\u6B63\u786E",is_answer:Br==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Br==="1"?1:0}],analysis:Ki}:(Et.ZP.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1):(Et.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1),Jr=()=>{Po(""),Ei(""),Zr("")};return le.createElement("section",{className:Nt.wrap},le.createElement("p",{className:Nt.titleWrap},le.createElement("span",{className:Nt.required},"*"),le.createElement("span",{className:Nt.title},"\u9898\u5E72\uFF1A")),le.createElement(ci.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:mr,onChange:Ur=>Po(Ur)}),le.createElement("p",{className:Nt.titleWrap},le.createElement("span",{className:Nt.required},"*"),le.createElement("span",{className:Nt.title},"\u7B54\u6848\u9009\u9879\uFF1A",le.createElement("span",{className:Nt.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),le.createElement(Zt.ZP.Group,{buttonStyle:"solid",value:Br,onChange:Ur=>Zr(Ur.target.value)},le.createElement(Zt.ZP.Button,{value:"0",className:`${Nt.radio} mr40`},"\u6B63\u786E"),le.createElement(Zt.ZP.Button,{value:"1",className:Nt.radio},"\u9519\u8BEF")),le.createElement("p",{className:Nt.titleWrap},le.createElement("span",{className:Nt.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),le.createElement(ci.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ki,onChange:Ur=>Ei(Ur)}))};var qt=(0,lt.connect)(({loading:pt,globalSetting:Ut})=>({globalSetting:Ut,loading:pt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(tn)),un=Object.getOwnPropertySymbols,zn=Object.prototype.hasOwnProperty,on=Object.prototype.propertyIsEnumerable,Sn=(pt,Ut)=>{var Re={};for(var ut in pt)zn.call(pt,ut)&&Ut.indexOf(ut)<0&&(Re[ut]=pt[ut]);if(pt!=null&&un)for(var ut of un(pt))Ut.indexOf(ut)<0&&on.call(pt,ut)&&(Re[ut]=pt[ut]);return Re};const di=null,Ui=(pt,Ut)=>{var Re=pt,{globalSetting:ut,loading:dr,editData:lr,dispatch:gr,onRef:Qi=()=>{},isEdit:Jn}=Re,Fr=Sn(Re,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[Br,Zr]=(0,le.useState)([]);(0,le.useEffect)(()=>{var Ei;if(!lr||!Jn)return;const bi=(Ei=lr==null?void 0:lr.shixun)==null?void 0:Ei.challenges.map(Jr=>({id:Jr==null?void 0:Jr.id,score:Jr.score}));Zr(bi)},[lr]),(0,le.useImperativeHandle)(Ut,()=>({onSave:mr,Clear:Po}));const mr=()=>({challenges:[...Br]}),Po=()=>{Zr([])};console.log("editData--",lr);const Ki=Ei=>{var bi,Jr;return le.createElement("div",null,(Jr=(bi=Ei==null?void 0:Ei.shixun)==null?void 0:bi.challenges)==null?void 0:Jr.map((Ur,Mr)=>{var Fo;return le.createElement("div",{className:"c-grey-666 font14 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"15px"}},le.createElement("div",null,le.createElement("span",{className:"mr5"},"\u7B2C",Mr+1,"\u5173"),le.createElement(bt.Z,{key:Mr,title:Ur==null?void 0:Ur.challenge_name},le.createElement("span",null,(0,Qe.Pq)(Ur==null?void 0:Ur.challenge_name,44)))),le.createElement("p",{style:{marginBottom:0}},le.createElement("span",{className:Nt.required},"*"),le.createElement("span",{className:Nt.title},"\u5206\u503C\uFF1A"),le.createElement(st.Z,{precision:1,min:1,max:100,className:Nt.baseFormItem,style:{width:176},value:(Fo=Br.find(vr=>vr.id===Ur.id))==null?void 0:Fo.score,onChange:vr=>{Br.find(so=>so.id===Ur.id).score=vr,Zr([...Br])}})))}),le.createElement("div",{style:{clear:"both"}}))};return le.createElement("section",{className:Nt.wrap},le.createElement(Ze.Z,{style:{paddingRight:10},className:Nt.titleHtml,value:`${lr==null?void 0:lr.position}\u3001${lr==null?void 0:lr.name}`}),le.createElement("p",{style:{marginBottom:"10px",marginTop:"25px"}},le.createElement("span",{className:Nt.required},"*"),le.createElement("span",{className:Nt.title},"\u5173\u5361")),Ki(lr))};var gi=(0,lt.connect)(({loading:pt,globalSetting:Ut})=>({globalSetting:Ut,loading:pt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(Ui)),Hi=Object.getOwnPropertySymbols,kr=Object.prototype.hasOwnProperty,Gn=Object.prototype.propertyIsEnumerable,On=(pt,Ut)=>{var Re={};for(var ut in pt)kr.call(pt,ut)&&Ut.indexOf(ut)<0&&(Re[ut]=pt[ut]);if(pt!=null&&Hi)for(var ut of Hi(pt))Ut.indexOf(ut)<0&&Gn.call(pt,ut)&&(Re[ut]=pt[ut]);return Re};const Xn=["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=(pt,Ut)=>{var Re=pt,{editData:ut,globalSetting:dr,loading:lr,dispatch:gr,onRef:Qi=()=>{},isEdit:Jn}=Re,Fr=On(Re,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Br,Zr]=(0,le.useState)([]),[mr,Po]=(0,le.useState)(),[Ki,Ei]=(0,le.useState)([]),[bi,Jr]=(0,le.useState)(""),[Ur,Mr]=(0,le.useState)("");(0,le.useEffect)(()=>{Zr(["","","",""])},[]),(0,le.useEffect)(()=>{if(!ut||!Jn)return;Jr(ut==null?void 0:ut.name),Mr(ut==null?void 0:ut.analysis),Zr(ut==null?void 0:ut.choices.map(er=>er.choice_text));const so=[];ut==null||ut.choices.map((er,Tr)=>{er.is_answer&&so.push(Tr)}),Ei(so)},[ut]),(0,le.useImperativeHandle)(Ut,()=>({onSave:Fo,Clear:vr}));const Fo=()=>{if(!bi)return Et.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const so=Br.findIndex(Tr=>!Tr);if(so>-1)return Et.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Xn[so]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Ki.length)return Et.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(Ki.length<2)return Et.ZP.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;const er=Br.map((Tr,oo)=>({choice_text:Tr,is_answer:Ki.includes(oo)?1:0}));return{name:bi,choices:er,analysis:Ur}},vr=()=>{Zr(["","","",""]),Jr(""),Mr(""),Ei("")};return le.createElement("section",{className:Nt.wrap},le.createElement("p",{className:Nt.titleWrap},le.createElement("span",{className:Nt.required},"*"),le.createElement("span",{className:Nt.title},"\u9898\u5E72\uFF1A")),le.createElement(ci.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:bi,onChange:so=>Jr(so)}),le.createElement("p",{className:Nt.titleWrap},le.createElement("span",{className:Nt.required},"*"),le.createElement("span",{className:Nt.title},"\u7B54\u6848\u9009\u9879\uFF1A",le.createElement("span",{className:Nt.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Br.map((so,er)=>le.createElement("div",{className:Nt.choiceWrap,key:er},le.createElement(bt.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},le.createElement("div",{className:`${Nt.answer} ${Ki.includes(er)?Nt.activeAnswer:""}`,onClick:()=>{Ki.includes(er)?Ei(Ki.filter(Tr=>Tr!==er)):Ei([...Ki,er])}},Xn[er])),le.createElement("div",{className:Nt.editorWrap},mr===er?le.createElement(ci.Z,{id:`single-question-option-${er}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:so,onChange:Tr=>{Br[er]=Tr,Zr(Br)}}):le.createElement("div",{className:Nt.htmlWrap,onClick:()=>Po(er)},le.createElement(Ze.Z,{value:so}))),er>1&&le.createElement(bt.Z,{title:"\u5220\u9664"},le.createElement("i",{className:`${Nt.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Zr(Br.filter((Tr,oo)=>oo!==er)),Ki.includes(er)?Ei(Ki.filter(Tr=>Tr!==er)):Ei([...Ki,er])}})),er<7&&er===Br.length-1&&le.createElement(bt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},le.createElement("i",{className:`${Nt.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Zr([...Br,""])})))),le.createElement("p",{className:Nt.titleWrap},le.createElement("span",{className:Nt.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),le.createElement(ci.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ur,onChange:so=>Mr(so)}))};var nr=(0,lt.connect)(({loading:pt,globalSetting:Ut})=>({globalSetting:Ut,loading:pt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(wi)),ji=Object.getOwnPropertySymbols,Cr=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,mn=(pt,Ut)=>{var Re={};for(var ut in pt)Cr.call(pt,ut)&&Ut.indexOf(ut)<0&&(Re[ut]=pt[ut]);if(pt!=null&&ji)for(var ut of ji(pt))Ut.indexOf(ut)<0&&be.call(pt,ut)&&(Re[ut]=pt[ut]);return Re};const fi=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Vn=(pt,Ut)=>{var Re=pt,{editData:ut,globalSetting:dr,loading:lr,dispatch:gr,onRef:Qi=()=>{},isEdit:Jn}=Re,Fr=mn(Re,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Br,Zr]=(0,le.useState)([]),[mr,Po]=(0,le.useState)(),[Ki,Ei]=(0,le.useState)(),[bi,Jr]=(0,le.useState)(""),[Ur,Mr]=(0,le.useState)("");(0,le.useEffect)(()=>{Zr(["","","",""])},[]),(0,le.useEffect)(()=>{if(!ut||!Jn)return;const so=[],er=[];ut==null||ut.choices.forEach((Tr,oo)=>{so.push(Tr.choice_text),Tr.is_answer&&er.push(oo)}),Jr(ut==null?void 0:ut.name),Mr(ut==null?void 0:ut.analysis),Zr(so),Ei(er)},[ut]),(0,le.useImperativeHandle)(Ut,()=>({onSave:Fo,Clear:vr}));const Fo=()=>{if(!bi)return Et.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const so=Br.findIndex(Tr=>!Tr);if(so>-1)return Et.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${fi[so]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Array.isArray(Ki))return Et.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 er=Br.map((Tr,oo)=>({choice_text:Tr,is_answer:Ki.includes(oo)?1:0}));return{name:bi,choices:er,analysis:Ur}},vr=()=>{Zr(["","","",""]),Jr(""),Mr(""),Ei("")};return le.createElement("section",{className:Nt.wrap},le.createElement("p",{className:Nt.titleWrap},le.createElement("span",{className:Nt.required},"*"),le.createElement("span",{className:Nt.title},"\u9898\u5E72\uFF1A")),le.createElement(ci.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:bi,onChange:so=>Jr(so)}),le.createElement("p",{className:Nt.titleWrap},le.createElement("span",{className:Nt.required},"*"),le.createElement("span",{className:Nt.title},"\u7B54\u6848\u9009\u9879\uFF1A",le.createElement("span",{className:Nt.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Br.map((so,er)=>le.createElement("div",{className:Nt.choiceWrap,key:er},le.createElement(bt.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},le.createElement("div",{className:`${Nt.answer} ${Ki!=null&&Ki.includes(er)?Nt.activeAnswer:""}`,onClick:()=>Ei([er])},fi[er])),le.createElement("div",{className:Nt.editorWrap},mr===er?le.createElement(ci.Z,{id:`single-question-option-${er}`,watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:so,onChange:Tr=>{Br[er]=Tr,Zr(Br)}}):le.createElement("div",{className:Nt.htmlWrap,onClick:()=>Po(er)},le.createElement(Ze.Z,{value:so}))),er>1&&le.createElement(bt.Z,{title:"\u5220\u9664"},le.createElement("i",{className:`${Nt.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Zr(Br.filter((Tr,oo)=>oo!==er)),er===Ki&&Ei(null)}})),er<7&&er===Br.length-1&&le.createElement(bt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},le.createElement("i",{className:`${Nt.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Zr([...Br,""])})))),le.createElement("p",{className:Nt.titleWrap},le.createElement("span",{className:Nt.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),le.createElement(ci.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ur,onChange:so=>Mr(so)}))};var si=(0,lt.connect)(({loading:pt,globalSetting:Ut})=>({globalSetting:Ut,loading:pt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(Vn)),Di=Le(96599),Ni=Le(71411),yr=Le(61485),zt=Le(59301),Mt=Object.defineProperty,_t=Object.defineProperties,fn=Object.getOwnPropertyDescriptors,Ji=Object.getOwnPropertySymbols,mi=Object.prototype.hasOwnProperty,$i=Object.prototype.propertyIsEnumerable,xn=(pt,Ut,Re)=>Ut in pt?Mt(pt,Ut,{enumerable:!0,configurable:!0,writable:!0,value:Re}):pt[Ut]=Re,ni=(pt,Ut)=>{for(var Re in Ut||(Ut={}))mi.call(Ut,Re)&&xn(pt,Re,Ut[Re]);if(Ji)for(var Re of Ji(Ut))$i.call(Ut,Re)&&xn(pt,Re,Ut[Re]);return pt},sr=(pt,Ut)=>_t(pt,fn(Ut)),br=(pt,Ut)=>{var Re={};for(var ut in pt)mi.call(pt,ut)&&Ut.indexOf(ut)<0&&(Re[ut]=pt[ut]);if(pt!=null&&Ji)for(var ut of Ji(pt))Ut.indexOf(ut)<0&&$i.call(pt,ut)&&(Re[ut]=pt[ut]);return Re},Yn=(pt,Ut,Re)=>new Promise((ut,dr)=>{var lr=Jn=>{try{Qi(Re.next(Jn))}catch(Fr){dr(Fr)}},gr=Jn=>{try{Qi(Re.throw(Jn))}catch(Fr){dr(Fr)}},Qi=Jn=>Jn.done?ut(Jn.value):Promise.resolve(Jn.value).then(lr,gr);Qi((Re=Re.apply(pt,Ut)).next())});const at=pt=>{if(!pt)return!1;if(/^s*$/.test(pt)||pt.trim()===""){Et.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let Ut=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 pt==="|"?(Et.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Bt=({value:pt=[],onClose:Ut})=>zt.createElement(Di.default,{closable:!0,onClose:Ut,className:Nt.keywordTag},zt.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},pt.join(" \u6216 "))),Kn=(pt,Ut)=>{var Re=pt,{editData:ut,globalSetting:dr,loading:lr,dispatch:gr,onRef:Qi=()=>{},isEdit:Jn}=Re,Fr=br(Re,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Br,Zr]=(0,le.useState)(""),[mr,Po]=(0,le.useState)(""),[Ki,Ei]=(0,le.useState)(""),[bi,Jr]=(0,le.useState)(""),[Ur]=it.default.useForm(),Mr=it.default.useWatch("use_keywords",Ur);(0,le.useEffect)(()=>{var er;!ut||!Jn||(Zr(ut==null?void 0:ut.name),Po(ut==null?void 0:ut.analysis),Ei((er=ut==null?void 0:ut.answer_texts)==null?void 0:er[0]),Ur.setFieldsValue(ni({},ut)))},[ut]),(0,le.useImperativeHandle)(Ut,()=>({onSave:Fo,Clear:vr}));const Fo=()=>Yn(void 0,null,function*(){if(!Br)return Et.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield Ur.validateFields()}catch(Tr){Et.ZP.error(Tr.errorFields[0].errors[0]);return}const er=Ur.getFieldsValue();return console.log(er,"values"),ni({name:Br,answer_texts:[Ki],analysis:mr},er)}),vr=()=>{Zr(""),Po(""),Ei(""),Ur.resetFields()},so=ut==null?void 0:ut.score;return zt.createElement("section",{className:Nt.wrap},zt.createElement("p",{className:Nt.titleWrap},zt.createElement("span",{className:Nt.required},"*"),zt.createElement("span",{className:Nt.title},"\u9898\u5E72\uFF1A")),zt.createElement(ci.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Br,onChange:er=>Zr(er)}),zt.createElement("p",{className:Nt.titleWrap},zt.createElement("span",{className:Nt.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),zt.createElement(ci.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Ki,onChange:er=>Ei(er)}),zt.createElement("p",{className:Nt.titleWrap},zt.createElement("span",{className:Nt.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),zt.createElement(ci.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:mr,onChange:er=>Po(er)}),zt.createElement(it.default,{form:Ur,size:"large",onFinishFailed:er=>Yn(void 0,null,function*(){var Tr,oo;Et.ZP.error(er.errorFields[0].errors[0]),Ur.scrollToField((oo=(Tr=er==null?void 0:er.errorFields)==null?void 0:Tr[0])==null?void 0:oo.name,{behavior:"smooth",block:"center"})})},zt.createElement(At.Z,{align:"middle",className:"mb30 mt20"},zt.createElement(it.default.Item,{noStyle:!0,name:"use_keywords",valuePropName:"checked"},zt.createElement(Ni.Z,null)),zt.createElement(De.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),zt.createElement(De.Z,null,zt.createElement(bt.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"},zt.createElement(yr.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),Mr&&zt.createElement(it.default.List,{name:"keywords",rules:[{validator(er,Tr){return Tr!=null&&Tr.length?(Tr==null?void 0:Tr.reduce((Go,ha)=>Go+ha.score,0))>parseFloat(so)?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"))}}]},(er,{add:Tr,remove:oo})=>zt.createElement(zt.Fragment,null,zt.createElement("div",{className:"mb10"},"\u5173\u952E\u8BCD"),zt.createElement(At.Z,{align:"middle",className:"font14 mb30"},zt.createElement(De.Z,{flex:1},zt.createElement(ot.default,{value:bi,onChange:Go=>{Jr(Go.target.value)},maxLength:50,allowClear:!0,onPressEnter:Go=>{var ha,_a,jr,Ls;const vo=`${(ha=Go.target)==null?void 0:ha.value}`,na=(jr=(_a=vo==null?void 0:vo.split("|"))==null?void 0:_a.filter(Ia=>!!Ia))==null?void 0:jr.map(Ia=>Ia==null?void 0:Ia.trim()),Eo=Ur.getFieldValue("keywords"),Xa=((Ls=Eo==null?void 0:Eo.map(Ia=>Ia==null?void 0:Ia.keyword))==null?void 0:Ls.flat())||[];for(const Ia of na)if(Xa.includes(Ia)){Et.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}at(vo)&&(Tr({keyword:na,score:1}),Jr(""))},className:Nt.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"})),zt.createElement(De.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),er.map(Go=>{var ha=Go,{key:_a,name:jr}=ha,Ls=br(ha,["key","name"]);return zt.createElement(At.Z,{key:_a,style:{marginRight:148}},zt.createElement(De.Z,{flex:1},zt.createElement(At.Z,{align:"middle",justify:"space-between"},zt.createElement(it.default.Item,sr(ni({},Ls),{name:[jr,"keyword"]}),zt.createElement(Bt,{onClose:()=>oo(jr)})),zt.createElement(it.default.Item,sr(ni({},Ls),{name:[jr,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),zt.createElement(st.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))})))))};var li=(0,lt.connect)(({loading:pt,globalSetting:Ut})=>({globalSetting:Ut,loading:pt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(Kn)),Qt=Le(8848),jt={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"},Un=Le(32134),ai=Le(12893),Vi=Object.defineProperty,xi=Object.defineProperties,Bi=Object.getOwnPropertyDescriptors,Ii=Object.getOwnPropertySymbols,Pr=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,_n=(pt,Ut,Re)=>Ut in pt?Vi(pt,Ut,{enumerable:!0,configurable:!0,writable:!0,value:Re}):pt[Ut]=Re,ki=(pt,Ut)=>{for(var Re in Ut||(Ut={}))Pr.call(Ut,Re)&&_n(pt,Re,Ut[Re]);if(Ii)for(var Re of Ii(Ut))xr.call(Ut,Re)&&_n(pt,Re,Ut[Re]);return pt},Ar=(pt,Ut)=>xi(pt,Bi(Ut)),Vr=(pt,Ut)=>{var Re={};for(var ut in pt)Pr.call(pt,ut)&&Ut.indexOf(ut)<0&&(Re[ut]=pt[ut]);if(pt!=null&&Ii)for(var ut of Ii(pt))Ut.indexOf(ut)<0&&xr.call(pt,ut)&&(Re[ut]=pt[ut]);return Re};const xo=pt=>{var Ut=pt,{value:Re,onChange:ut,scrollId:dr}=Ut,lr=Vr(Ut,["value","onChange","scrollId"]);return le.createElement("div",{id:dr||""},le.createElement(ci.Z,Ar(ki({},lr),{defaultValue:Re,onChange:(gr,Qi)=>{Qi!=null&&Qi.length?ut(gr,Qi):ut(gr)}})))},Ot=({value:pt,onChange:Ut,placeholder:Re,height:ut=140,isEdit:dr})=>dr?le.createElement(ci.Z,{watch:!0,isFocus:!0,height:ut,placeholder:Re,defaultValue:pt,onChange:Ut}):le.createElement("div",{style:{cursor:"pointer"}},pt?le.createElement(Ze.Z,{className:jt.inputBorder,value:pt}):le.createElement("div",{className:`${jt.inputBorder} ${jt.placeholder}`},Re));var Li=Le(59301),Sr=Object.defineProperty,Ri=Object.defineProperties,po=Object.getOwnPropertyDescriptors,Qr=Object.getOwnPropertySymbols,mo=Object.prototype.hasOwnProperty,fo=Object.prototype.propertyIsEnumerable,wo=(pt,Ut,Re)=>Ut in pt?Sr(pt,Ut,{enumerable:!0,configurable:!0,writable:!0,value:Re}):pt[Ut]=Re,Io=(pt,Ut)=>{for(var Re in Ut||(Ut={}))mo.call(Ut,Re)&&wo(pt,Re,Ut[Re]);if(Qr)for(var Re of Qr(Ut))fo.call(Ut,Re)&&wo(pt,Re,Ut[Re]);return pt},Bn=(pt,Ut)=>Ri(pt,po(Ut)),ca=(pt,Ut)=>{var Re={};for(var ut in pt)mo.call(pt,ut)&&Ut.indexOf(ut)<0&&(Re[ut]=pt[ut]);if(pt!=null&&Qr)for(var ut of Qr(pt))Ut.indexOf(ut)<0&&fo.call(pt,ut)&&(Re[ut]=pt[ut]);return Re};const In=["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"],Er=({value:pt,onChange:Ut,choiceTextKey:Re,answerKey:ut,index:dr,isEdit:lr,setInputActive:gr,form:Qi,choiceOptionsPath:Jn,allowChangeMode:Fr,showAddIcon:Br,addItem:Zr,deleteItem:mr})=>{const Po=(pt==null?void 0:pt[ut])===!0,Ki=()=>{const bi=Qi.getFieldValue(Jn);Qi.setFieldValue(Jn,bi.map(Jr=>Bn(Io({},Jr),{[ut]:!1})))},Ei=()=>{Po?Ut(Bn(Io({},pt),{[ut]:!1})):(Fr||Ki(),Ut(Bn(Io({},pt),{[ut]:!0})))};return Li.createElement(At.Z,{className:jt.choiceWrap,align:"middle",wrap:!1},Li.createElement(De.Z,{onClick:Ei,className:`${jt.choiceIndex} ${Po?jt.activeAnswer:""}`},In[dr]),Li.createElement(De.Z,{flex:1,className:`${jt.editorWrap} ml15`,onClick:gr},Li.createElement(Ot,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:lr,value:pt==null?void 0:pt[Re],onChange:bi=>{Ut(Bn(Io({},pt),{[Re]:bi}))}})),Li.createElement(De.Z,{flex:"0 0 auto",className:"ml15"},Li.createElement("div",{onClick:Ei,className:`${jt.setAnswerBtn} ${Po?jt.activeAnswer:""}`},Po?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),Li.createElement(De.Z,{className:jt.actionWrapper},Li.createElement(bt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},Li.createElement(Un.Z,{className:jt.addIcon,onClick:Zr,style:{visibility:Br?"visible":"hidden"}})),Li.createElement(bt.Z,{title:"\u5220\u9664"},Li.createElement(ai.Z,{className:jt.deleteIcon,onClick:mr,style:{visibility:dr>1?"visible":"hidden"}}))))},Do=({questionTitlePlaceholder:pt,titleKey:Ut,choiceKey:Re,analysisKey:ut,choiceTextKey:dr,answerKey:lr,choiceOptionsPath:gr,allowChangeMode:Qi=!0,form:Jn,showAnalysis:Fr=!0})=>{const[Br,Zr]=(0,le.useState)(),[mr,Po]=(0,le.useState)(!1);return Li.createElement("div",{className:jt.wrap},Li.createElement("div",{className:jt.questionTitleEditorWrap},Li.createElement(it.default.Item,{label:"\u9898\u5E72",name:Ut,labelCol:{span:24},rules:[{required:!0}]},Li.createElement(xo,{scrollId:Array.isArray(Ut)?Ut.join("_"):`${Ut}`,watch:!0,height:140,placeholder:pt}))),Li.createElement(it.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),Li.createElement(it.default.List,{name:Re,rules:[{validator(Ki,Ei){const bi=Ei.some(Ur=>Ur[lr]),Jr=Ei.findIndex(Ur=>{var Mr;return((Mr=Ur[dr])==null?void 0:Mr.length)<=0});return Jr!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${In[Jr]}\u9009\u9879\u7684\u5185\u5BB9`)):bi?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(Ki,{add:Ei,remove:bi})=>Li.createElement("div",{id:Array.isArray(gr)?gr.join("_"):`${gr}`},Ki.map((Jr,Ur)=>{var Mr=Jr,{key:Fo,name:vr}=Mr,so=ca(Mr,["key","name"]);const er=Br===Fo,Tr=()=>{Zr(Fo)},oo=Ur<7&&Ur===Ki.length-1,Go=()=>Ei({[dr]:"",[lr]:0}),ha=()=>bi(vr);return Li.createElement(it.default.Item,Bn(Io({},so),{key:Fo,name:vr,noStyle:!0}),Li.createElement(Er,{choiceTextKey:dr,answerKey:lr,index:Ur,isEdit:er,setInputActive:Tr,form:Jn,choiceOptionsPath:gr,allowChangeMode:Qi,showAddIcon:oo,addItem:Go,deleteItem:ha}))}),Ki.length<8&&Li.createElement("div",{className:`${jt.addBtn} mb30`,onClick:()=>Ei({[dr]:"",[lr]:0})},"\u6DFB\u52A0\u9009\u9879"))),Fr&&Li.createElement("div",{onClick:()=>Po(!0)},Li.createElement(it.default.Item,{name:ut,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},Li.createElement(Ot,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:mr}))))};var wr=Le(59301),Qo=Object.defineProperty,To=Object.defineProperties,ro=Object.getOwnPropertyDescriptors,fa=Object.getOwnPropertySymbols,Yt=Object.prototype.hasOwnProperty,Rn=Object.prototype.propertyIsEnumerable,Rt=(pt,Ut,Re)=>Ut in pt?Qo(pt,Ut,{enumerable:!0,configurable:!0,writable:!0,value:Re}):pt[Ut]=Re,Ie=(pt,Ut)=>{for(var Re in Ut||(Ut={}))Yt.call(Ut,Re)&&Rt(pt,Re,Ut[Re]);if(fa)for(var Re of fa(Ut))Rn.call(Ut,Re)&&Rt(pt,Re,Ut[Re]);return pt},qn=(pt,Ut)=>To(pt,ro(Ut)),Ci=(pt,Ut)=>{var Re={};for(var ut in pt)Yt.call(pt,ut)&&Ut.indexOf(ut)<0&&(Re[ut]=pt[ut]);if(pt!=null&&fa)for(var ut of fa(pt))Ut.indexOf(ut)<0&&Rn.call(pt,ut)&&(Re[ut]=pt[ut]);return Re};const Oi=({value:pt,onChange:Ut})=>{const Re=dr=>{Oe.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:jt.modal,onOk:()=>{const lr=[...pt];lr.splice(dr,1),Ut(lr)}})},ut=()=>{const dr=[...pt];dr.push(""),Ut(dr)};return wr.createElement(At.Z,{align:"middle",className:"ml20",gutter:[40,20]},pt==null?void 0:pt.map((dr,lr)=>wr.createElement(De.Z,{key:`${dr}_${lr}`,className:jt.blankWrapper},wr.createElement(ot.default,{className:jt.blankInput,defaultValue:dr,maxLength:1e3,onBlur:gr=>{const Qi=[...pt],Jn=gr.target.value.trim();Qi[lr]=Jn,Ut(Qi)}}),wr.createElement(bt.Z,{title:"\u5220\u9664"},wr.createElement(ai.Z,{className:jt.deleteIcon,style:{marginLeft:15,visibility:lr>0?"visible":"hidden"},onClick:()=>Re(lr)})))),wr.createElement(De.Z,null,wr.createElement("div",{className:`${jt.addBtn}`,onClick:()=>{ut()}},"\u65B0\u589E\u7B54\u6848")))},qi=({value:pt=!0,onChange:Ut})=>wr.createElement(Ni.Z,{checked:!pt,onChange:Re=>{Ut(!Re)}}),zi="\u2581",Nn=({questionTitlePlaceholder:pt,form:Ut,name:Re,scoreByBlank:ut="use_blank_score",answerKey:dr,titleKey:lr="name",analysisKey:gr="analysis",isOrdered:Qi="is_ordered"})=>{var Jn,Fr;const[Br,Zr]=(0,le.useState)(!1),mr=(Fo,vr)=>{const so=vr.line;let er=0;for(let oo=0;oo<so;oo++)er+=Fo.getLine(oo).split(zi).length-1;const Tr=Fo.getLine(so).substring(0,vr.ch);return er+=Tr.split(zi).length-1,er},Po=(Fo,vr,so,er)=>{const Tr=Fo.getRange(vr.from,vr.to);let oo=0;if(vr.text.forEach(Go=>{oo+=Go.split(zi).length-1}),vr.origin!=="setValue"){if(Tr&&Tr.indexOf(zi)!==-1){const Go=Tr.split(zi).length-1,ha=mr(Fo,vr.from);if(console.log(`\u5220\u9664${Go}\u4E2A\uFF0C \u524D\u9762\u6709${ha}\u4E2A\uFF0C\u65B0\u589E${oo}\u4E2A`),Go>1){const _a=Array.from({length:Go},(jr,Ls)=>ha+Ls);er(_a)}else er(ha)}else if(oo>0){const Go=mr(Fo,vr.from);console.log(`\u65B0\u589E${oo}\u4E2A\uFF0C\u4E4B\u524D\u6709${Go}\u4E2A`),so(oo,Go)}}},Ki=()=>{const Fo=Ut.getFieldValue(["sub_item_banks",...dr]);Ut.setFieldValue(["sub_item_banks",...dr],Fo==null?void 0:Fo.map((vr,so)=>qn(Ie({},vr),{position:so+1})))},Ei=(0,le.useRef)(),bi=(Fo,vr)=>{for(let so=0;so<Fo;so++)Ei.current({position:null,answer_text:[""]},vr+so);Ki()},Jr=(0,le.useRef)(),Ur=Fo=>{Jr.current(Fo),Ki()},Mr=(Fr=(Jn=Ut.getFieldValue("sub_item_banks"))==null?void 0:Jn[dr==null?void 0:dr[0]])==null?void 0:Fr[dr==null?void 0:dr[1]];return wr.createElement("div",{className:jt.wrap},wr.createElement("div",{className:jt.questionTitleEditorWrap},wr.createElement(it.default.Item,{label:"\u9898\u5E72",name:lr,labelCol:{span:24},rules:[{required:!0}]},wr.createElement(xo,{scrollId:"name",watch:!0,height:140,placeholder:pt,showNullButton:!0,onCMBeforeChange:(Fo,vr)=>{Po(Fo,vr,bi,Ur)}}))),wr.createElement(it.default.List,{name:dr,rules:[{validator(Fo,vr){if((vr==null?void 0:vr.length)===0)return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const so of vr){const{answer_text:er}=so||{};if(er!=null&&er.some(Tr=>(Tr==null?void 0:Tr.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(Fo,{add:vr,remove:so},{errors:er})=>(Ei.current=vr,Jr.current=so,wr.createElement(wr.Fragment,null,wr.createElement(it.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),Fo.map((Tr,oo)=>{var Go=Tr,{key:ha,name:_a}=Go,jr=Ci(Go,["key","name"]);return wr.createElement(At.Z,{className:"mb20",key:ha,align:"middle",wrap:!1},wr.createElement(De.Z,{flex:"0 0 auto",className:`${jt.blankIndex}`},"\u586B\u7A7A\u9879",oo+1),wr.createElement(De.Z,{flex:1},wr.createElement(At.Z,{align:"top",justify:"space-between",wrap:!1},wr.createElement(De.Z,null,wr.createElement(it.default.Item,qn(Ie({},jr),{name:[_a,"answer_text"],noStyle:!0}),wr.createElement(Oi,null))),(Ut==null?void 0:Ut.getFieldValue(["sub_item_banks",...ut]))&&wr.createElement(De.Z,{flex:"224px"},wr.createElement(it.default.Item,qn(Ie({},jr),{name:[_a,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:jt.blankInputNumberWrapper}),wr.createElement(st.Z,{className:jt.blankInput,min:.1,max:100,style:{width:"100%"},placeholder:"\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"})))),wr.createElement(it.default.Item,qn(Ie({},jr),{name:[_a,"position"],noStyle:!0}),wr.createElement(ot.default,{type:"hidden"}))))})))),wr.createElement(At.Z,{align:"middle"},wr.createElement(it.default.Item,{name:[Re,"downcase"],valuePropName:"checked"},wr.createElement(Ni.Z,null)),wr.createElement(De.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),wr.createElement(At.Z,{align:"middle"},wr.createElement(it.default.Item,{name:[Re,"no_space"],valuePropName:"checked"},wr.createElement(Ni.Z,null)),wr.createElement(De.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(Mr==null?void 0:Mr.length)>1&&wr.createElement(At.Z,{align:"middle",className:(Mr==null?void 0:Mr.length)>1?"mb30":`${jt.hide}`},wr.createElement(it.default.Item,{name:Qi},wr.createElement(qi,null)),wr.createElement(De.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")),wr.createElement("div",{onClick:()=>Zr(!0)},wr.createElement(it.default.Item,{name:gr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},wr.createElement(Ot,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Br}))))};var pi=Object.defineProperty,vi=Object.defineProperties,ti=Object.getOwnPropertyDescriptors,ui=Object.getOwnPropertySymbols,hi=Object.prototype.hasOwnProperty,Ti=Object.prototype.propertyIsEnumerable,Yi=(pt,Ut,Re)=>Ut in pt?pi(pt,Ut,{enumerable:!0,configurable:!0,writable:!0,value:Re}):pt[Ut]=Re,Pn=(pt,Ut)=>{for(var Re in Ut||(Ut={}))hi.call(Ut,Re)&&Yi(pt,Re,Ut[Re]);if(ui)for(var Re of ui(Ut))Ti.call(Ut,Re)&&Yi(pt,Re,Ut[Re]);return pt},Rr=(pt,Ut)=>vi(pt,ti(Ut)),cr=(pt,Ut)=>{var Re={};for(var ut in pt)hi.call(pt,ut)&&Ut.indexOf(ut)<0&&(Re[ut]=pt[ut]);if(pt!=null&&ui)for(var ut of ui(pt))Ut.indexOf(ut)<0&&Ti.call(pt,ut)&&(Re[ut]=pt[ut]);return Re};const Mo={\u6B63\u786E:"T",\u9519\u8BEF:"F"},Wr=({value:pt,onChange:Ut,form:Re,choiceKey:ut})=>{const dr=(pt==null?void 0:pt.is_answer)===!0,lr=pt==null?void 0:pt.choice_text,gr=()=>{var Qi;const Jn=(Qi=Re==null?void 0:Re.getFieldValue(["sub_item_banks",...ut]))==null?void 0:Qi.map(Fr=>({choice_text:Fr==null?void 0:Fr.choice_text,is_answer:!1}));Re==null||Re.setFieldValue(["sub_item_banks",...ut],Jn),Ut(Rr(Pn({},pt),{is_answer:!0}))};return le.createElement(At.Z,{className:jt.choiceWrap,align:"middle",wrap:!1},le.createElement(De.Z,{onClick:gr,className:`${jt.choiceIndex} ${jt.judgementIndex} ${dr?jt.activeAnswer:""}`},Mo[lr]),le.createElement(De.Z,{flex:1,className:`${jt.editorWrap} ml15`},le.createElement("div",{className:`${jt.inputBorder} ${jt.placeholder} ${dr?jt.activeJudgementAnswer:""}`},lr)),le.createElement(De.Z,{flex:"0 0 auto",className:"ml15"},le.createElement("div",{onClick:gr,className:`${jt.setAnswerBtn} ${dr?jt.activeAnswer:""}`},dr?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},Vo=({questionTitlePlaceholder:pt,choiceKey:Ut="choices",form:Re,titleKey:ut="name",analysisKey:dr="analysis"})=>{const[lr,gr]=(0,le.useState)(!1);return le.createElement("div",{className:jt.wrap},le.createElement("div",{className:jt.questionTitleEditorWrap},le.createElement(it.default.Item,{label:"\u9898\u5E72",name:ut,labelCol:{span:24},rules:[{required:!0}]},le.createElement(xo,{scrollId:"name",watch:!0,height:140,placeholder:pt}))),le.createElement(it.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},le.createElement(it.default.List,{name:Ut,rules:[{validator(Qi,Jn){return Jn.some(Br=>(Br==null?void 0:Br.is_answer)===!0)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},Qi=>le.createElement("div",{id:"choices"},Qi.map(Jn=>{var Fr=Jn,{key:Br,name:Zr}=Fr,mr=cr(Fr,["key","name"]);return le.createElement(it.default.Item,Rr(Pn({},mr),{key:Br,name:Zr,noStyle:!0}),le.createElement(Wr,{form:Re,choiceKey:Ut}))})))),le.createElement("div",{onClick:()=>gr(!0)},le.createElement(it.default.Item,{name:dr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},le.createElement(Ot,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:lr}))))};var Wo=Object.defineProperty,ua=Object.defineProperties,Xo=Object.getOwnPropertyDescriptors,aa=Object.getOwnPropertySymbols,Pa=Object.prototype.hasOwnProperty,Gt=Object.prototype.propertyIsEnumerable,qo=(pt,Ut,Re)=>Ut in pt?Wo(pt,Ut,{enumerable:!0,configurable:!0,writable:!0,value:Re}):pt[Ut]=Re,fr=(pt,Ut)=>{for(var Re in Ut||(Ut={}))Pa.call(Ut,Re)&&qo(pt,Re,Ut[Re]);if(aa)for(var Re of aa(Ut))Gt.call(Ut,Re)&&qo(pt,Re,Ut[Re]);return pt},ao=(pt,Ut)=>ua(pt,Xo(Ut)),zr=(pt,Ut)=>{var Re={};for(var ut in pt)Pa.call(pt,ut)&&Ut.indexOf(ut)<0&&(Re[ut]=pt[ut]);if(pt!=null&&aa)for(var ut of aa(pt))Ut.indexOf(ut)<0&&Gt.call(pt,ut)&&(Re[ut]=pt[ut]);return Re};const Jo=pt=>{var Ut=pt,{value:Re,onChange:ut}=Ut,dr=zr(Ut,["value","onChange"]);const lr=gr=>{ut([gr])};return le.createElement(ci.Z,ao(fr({},dr),{defaultValue:Re==null?void 0:Re[0],onChange:lr}))},va=pt=>{if(!pt)return!1;let Ut=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 pt==="|"?(Et.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},ma=({value:pt=[],onClose:Ut})=>le.createElement(Di.default,{closable:!0,onClose:Ut,className:jt.keywordTag},pt==null?void 0:pt.join(" \u6216 ")),ko=({questionTitlePlaceholder:pt,form:Ut,showKeywords:Re,isMustKeyWords:ut=Re,titleKey:dr="name",analysisKey:lr="analysis",answerTexts:gr="answer_texts",keywords:Qi="keywords",useKeywords:Jn="use_keywords",indexs:Fr})=>{const[Br,Zr]=(0,le.useState)(!1),[mr,Po]=(0,le.useState)(""),Ki=it.default.useWatch("sub_item_banks",Ut),{use_keywords:Ei,score:bi}=(Ki==null?void 0:Ki[Fr])||{};return console.log(Ei,bi,"itemValues"),le.createElement("div",{className:jt.wrap},le.createElement("div",{className:jt.questionTitleEditorWrap},le.createElement(it.default.Item,{label:"\u9898\u5E72",name:dr,labelCol:{span:24},rules:[{required:!0}]},le.createElement(xo,{scrollId:"name",watch:!0,height:140,placeholder:pt}))),le.createElement(it.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:gr,labelCol:{span:24}},le.createElement(Jo,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),Re&&!ut&&le.createElement(it.default.Item,{hidden:!0,name:Jn,valuePropName:"checked"},le.createElement(Ni.Z,{defaultChecked:!0})),Re&&ut&&le.createElement(At.Z,{align:"middle",className:"mb30"},le.createElement(it.default.Item,{name:Jn,valuePropName:"checked"},le.createElement(Ni.Z,null)),le.createElement(De.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),le.createElement(De.Z,null,le.createElement(bt.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"},le.createElement(yr.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(Ei||!ut)&&le.createElement(it.default.List,{name:Qi,rules:[{validator(Jr,Ur){return ut?Ur!=null&&Ur.length?(Ur==null?void 0:Ur.reduce((Fo,vr)=>Fo+vr.score,0))>parseFloat(bi)?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()}}]},(Jr,{add:Ur,remove:Mr})=>le.createElement(le.Fragment,null,le.createElement("div",{className:`${jt.title} mb10`},ut?"\u5173\u952E\u8BCD":le.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),le.createElement(At.Z,{align:"middle",className:"font14 mb30"},le.createElement(De.Z,{flex:1},le.createElement(ot.default,{value:mr,onChange:Fo=>{Po(Fo.target.value)},maxLength:50,allowClear:!0,onPressEnter:Fo=>{var vr,so,er,Tr;const oo=`${(vr=Fo.target)==null?void 0:vr.value}`,Go=(er=(so=oo==null?void 0:oo.split("|"))==null?void 0:so.filter(jr=>!!jr))==null?void 0:er.map(jr=>jr==null?void 0:jr.trim()),ha=Ut.getFieldValue(["sub_item_banks",...Qi]),_a=((Tr=ha==null?void 0:ha.map(jr=>jr==null?void 0:jr.keyword))==null?void 0:Tr.flat())||[];for(const jr of Go)if(_a.includes(jr)){Et.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}va(oo)&&(Ur({keyword:Go,score:1}),Po(""))},className:jt.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"})),le.createElement(De.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Jr.map(Fo=>{var vr=Fo,{key:so,name:er}=vr,Tr=zr(vr,["key","name"]);return le.createElement(At.Z,{key:so,className:"mb20",style:{marginRight:148}},le.createElement(De.Z,{flex:1},le.createElement(At.Z,{align:"middle",justify:"space-between"},le.createElement(it.default.Item,ao(fr({},Tr),{name:[er,"keyword"]}),le.createElement(ma,{onClose:()=>Mr(er)})),ut&&le.createElement(it.default.Item,ao(fr({},Tr),{name:[er,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:jt.blankInputNumberWrapper}),le.createElement(st.Z,{className:jt.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),le.createElement("div",{onClick:()=>Zr(!0)},le.createElement(it.default.Item,{name:lr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},le.createElement(Ot,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Br}))))};var So=Le(59301),$a=Object.defineProperty,gs=Object.defineProperties,ls=Object.getOwnPropertyDescriptors,ps=Object.getOwnPropertySymbols,$r=Object.prototype.hasOwnProperty,Ka=Object.prototype.propertyIsEnumerable,Ma=(pt,Ut,Re)=>Ut in pt?$a(pt,Ut,{enumerable:!0,configurable:!0,writable:!0,value:Re}):pt[Ut]=Re,ns=(pt,Ut)=>{for(var Re in Ut||(Ut={}))$r.call(Ut,Re)&&Ma(pt,Re,Ut[Re]);if(ps)for(var Re of ps(Ut))Ka.call(Ut,Re)&&Ma(pt,Re,Ut[Re]);return pt},qa=(pt,Ut)=>gs(pt,ls(Ut)),ts=(pt,Ut)=>{var Re={};for(var ut in pt)$r.call(pt,ut)&&Ut.indexOf(ut)<0&&(Re[ut]=pt[ut]);if(pt!=null&&ps)for(var ut of ps(pt))Ut.indexOf(ut)<0&&Ka.call(pt,ut)&&(Re[ut]=pt[ut]);return Re},Xi=(pt,Ut,Re)=>new Promise((ut,dr)=>{var lr=Jn=>{try{Qi(Re.next(Jn))}catch(Fr){dr(Fr)}},gr=Jn=>{try{Qi(Re.throw(Jn))}catch(Fr){dr(Fr)}},Qi=Jn=>Jn.done?ut(Jn.value):Promise.resolve(Jn.value).then(lr,gr);Qi((Re=Re.apply(pt,Ut)).next())});const{Panel:Xr}=Qt.default,Co=null,Zo=(pt,Ut)=>{var Re=pt,{globalSetting:ut,loading:dr,dispatch:lr,editData:gr,onRef:Qi=()=>{},isEdit:Jn}=Re,Fr=ts(Re,["globalSetting","loading","dispatch","editData","onRef","isEdit"]);const[Br,Zr]=(0,le.useState)(""),[mr,Po]=(0,le.useState)([]),[Ki]=it.default.useForm();(0,le.useEffect)(()=>{!gr||!Jn||(Zr(gr==null?void 0:gr.name),Po(gr==null?void 0:gr.sub_item_banks),Ki.setFieldsValue(ns({},gr)))},[gr]),(0,le.useEffect)(()=>{Po(Ki.getFieldValue("sub_item_banks"))},[it.default.useWatch("sub_item_banks",Ki)]),(0,le.useImperativeHandle)(Ut,()=>({onSave:Ei,Clear:bi}));const Ei=()=>Xi(void 0,null,function*(){if(!Br)return Et.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield Ki.validateFields()}catch(so){return console.log(so,"errInfo"),Et.ZP.error(so.errorFields[0].errors[0]),!1}const vr=mr.map(so=>ns({id:so.id>1?so.id:null},so));return{name:Br,sub_item_banks:vr}}),bi=()=>{Zr(""),Po([])},Jr={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"},Ur=({value:vr})=>So.createElement("div",{style:{textAlign:"center",color:"#DF3065",margin:"0 5px"}},vr),[Mr,Fo]=(0,le.useState)();return So.createElement("section",{className:Nt.wrap},So.createElement("p",{className:Nt.titleWrap},So.createElement("span",{className:Nt.required},"*"),So.createElement("span",{className:Nt.title},"\u9898\u5E72\uFF1A")),So.createElement(ci.Z,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Br,onChange:vr=>Zr(vr)}),So.createElement(it.default,{form:Ki,autoComplete:"off"},So.createElement(it.default.List,{name:"sub_item_banks",rules:[{validator(vr,so){return so?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(vr,{add:so,remove:er})=>{const Tr=Ki.getFieldValue("sub_item_banks");return So.createElement(So.Fragment,null,So.createElement(Qt.default,{className:vr.length>0?Nt.collapseWrapper:"",bordered:!1,expandIcon:({isActive:oo})=>So.createElement("i",{className:`iconfont icon-weizhankai ${oo?Nt.open:Nt.close}`,style:{fontSize:14,transition:"all .2s"}})},vr.map((oo,Go)=>{var ha=oo,{key:_a,name:jr}=ha,Ls=ts(ha,["key","name"]),vo,na,Eo,Xa,Ia,xs,Yl,zu,Ll,lu,ka,qs;return So.createElement(Xr,{className:Nt.panel,forceRender:!0,header:So.createElement("div",{className:Nt.panelHeader},"\u7B2C",Go+1,"\u5C0F\u9898",So.createElement("span",null,"\uFF08",Jr[(vo=Tr==null?void 0:Tr[jr])==null?void 0:vo.item_type],"\uFF09")),extra:So.createElement(At.Z,{align:"middle",onClick:al=>al.stopPropagation(),style:{display:"flex",alignItems:"center"}},((na=Tr==null?void 0:Tr[jr])==null?void 0:na.item_type)=="completion"&&So.createElement(it.default.Item,qa(ns({},Ls),{name:[jr,"score"],className:Nt.blankInputNumberWrapper,style:{marginBottom:0}}),((Eo=Tr==null?void 0:Tr[jr])==null?void 0:Eo.item_type)=="completion"&&So.createElement("div",{style:{display:"flex",alignItems:"center",color:"#191919"}},"\u5171",So.createElement(Ur,{value:(Xa=Tr==null?void 0:Tr[jr])==null?void 0:Xa.score}),"\u5206")),((Ia=Tr==null?void 0:Tr[jr])==null?void 0:Ia.item_type)=="completion"&&So.createElement(So.Fragment,null,So.createElement(Zt.ZP.Group,{defaultValue:(xs=Tr==null?void 0:Tr[jr])==null?void 0:xs.use_blank_score,className:Nt.scoreByBlankRadio,style:{marginRight:10},optionType:"button",options:[{label:"\u6309\u7A7A\u7ED9\u5206",value:!0},{label:"\u6309\u9898\u7ED9\u5206",value:!1}],onChange:al=>{var fl;console.log(Ki.getFieldsValue()),Ki==null||Ki.setFieldValue(["sub_item_banks",jr,"use_blank_score"],(fl=al==null?void 0:al.target)==null?void 0:fl.value),Fo(new Date)}}),So.createElement(bt.Z,{overlayInnerStyle:{width:460},title:So.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",So.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")},So.createElement("i",{className:"icon-tishixiaowenhao font18 c-3061d0"})))),key:_a},So.createElement(it.default.Item,qa(ns({},Ls),{name:jr}),(((Yl=Tr==null?void 0:Tr[jr])==null?void 0:Yl.item_type)=="single"||((zu=Tr==null?void 0:Tr[jr])==null?void 0:zu.item_type)=="multiple")&&So.createElement(Do,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((Ll=Tr==null?void 0:Tr[jr])==null?void 0:Ll.item_type)!="single",form:Ki,choiceKey:[jr,"choices"],titleKey:[jr,"name"],analysisKey:[jr,"analysis"],choiceOptionsPath:["sub_item_banks",jr,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((lu=Tr==null?void 0:Tr[jr])==null?void 0:lu.item_type)=="completion"&&So.createElement(Nn,{form:Ki,name:jr,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:[jr,"use_blank_score"],titleKey:[jr,"name"],analysisKey:[jr,"analysis"],isOrdered:[jr,"is_ordered"],answerKey:[jr,"standard_answer"],key:Mr}),((ka=Tr==null?void 0:Tr[jr])==null?void 0:ka.item_type)=="judgement"&&So.createElement(Vo,{form:Ki,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[jr,"name"],analysisKey:[jr,"analysis"],choiceKey:[jr,"choices"]}),((qs=Tr==null?void 0:Tr[jr])==null?void 0:qs.item_type)=="subjective"&&So.createElement(ko,{showKeywords:!0,form:Ki,titleKey:[jr,"name"],analysisKey:[jr,"analysis"],answerTexts:[jr,"answer_texts"],useKeywords:[jr,"use_keywords"],keywords:[jr,"keywords"],indexs:jr,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})))})))};var Ko=(0,lt.connect)(({loading:pt,globalSetting:Ut})=>({globalSetting:Ut,loading:pt.effects}),null,null,{forwardRef:!0})((0,le.forwardRef)(Zo)),ba=Le(84842),Kr=Le(17149),Rs=Le(82326),Za=Le(54172),nn={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"},Ht=Le(9148),Fn=Le(58433),Wi=Le(82264),Si=Le(45937),_i=Le(28426),Pi=Le(94361),oi=({open:pt,onCancel:Ut,onOk:Re})=>{const ut=(0,Fn.g)(),[dr,lr,gr,Qi]=(0,Si.U)(Wi.Gm,{page:1,limit:10,keyword:"",diff:"",shixun_publish_status:"",discipline_id:"",sub_discipline_id:"",type:0,include_shixuns:!0,item_type:"SHIXUN"}),[Jn,Fr]=(0,le.useState)(!1);(0,le.useEffect)(()=>{pt&&gr({page:1,limit:10,type:0},!0).then(Ki=>{(Ki==null?void 0:Ki.shixuns_count)===0&&Fr(!0)})},[pt]);const[Br,Zr]=(0,le.useState)([]),[mr,Po]=(0,le.useState)([]);return le.createElement(Oe.default,{title:"\u9009\u62E9\u5B9E\u8BAD\u9898",open:pt,width:948,centered:!0,closable:!0,onCancel:Ut,onOk:()=>Re(mr),destroyOnClose:!0},le.createElement(At.Z,{justify:"space-between",className:"mb20",style:{maxHeight:650}},le.createElement(De.Z,null,le.createElement(Kr.Z,{style:{width:160},size:"large",placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:ut,onChange:Ki=>{gr({page:1,discipline_id:Ki==null?void 0:Ki[0],sub_discipline_id:Ki==null?void 0:Ki[1]})}}),le.createElement(Rs.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:Ki=>gr({page:1,diff:Ki})}),le.createElement(Rs.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:Ki=>gr({page:1,shixun_publish_status:Ki})})),le.createElement(Ht.t7,{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",style:{width:290},onChange:Ki=>{gr({keyword:Ki,page:1})}})),Jn?le.createElement("div",null,le.createElement(_i.Z,{customText:"\u6682\u65E0\u6570\u636E",ButtonText:"\u524D\u5F80\u5B9E\u8DF5\u9879\u76EE\u5E93\uFF0C\u6DFB\u52A0\u66F4\u591A\u8BD5\u9898>",ButtonClick:()=>(0,Qe.xg)("/shixuns")})):le.createElement(Za.default,{loading:lr,rowKey:"id",columns:[{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:"30%",ellipsis:{showTitle:!0},render:(Ki,Ei)=>le.createElement("div",{style:{display:"flex",alignItems:"center"}},le.createElement("div",{className:Ei!=null&&Ei.high_resources_consume?nn.title:"",title:Ki||"--"},le.createElement(Ze.Z,{key:1,showLines:1,showTextOnly:!0,value:Ki||"--"})),(Ei==null?void 0:Ei.high_resources_consume)&&le.createElement(Pi.Z,{type:"shixun",style:{marginLeft:10}}))},{title:"\u96BE\u5EA6",dataIndex:"level"},{title:"\u5173\u5361\u6570\u91CF",dataIndex:"challenges_count",key:"challenges_count",render:(Ki,Ei,bi)=>le.createElement("span",null,Ki||"- -")},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"study_count"},{title:le.createElement("span",null,"\u53D1\u5E03\u72B6\u6001 ",le.createElement(bt.Z,{title:"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528"},le.createElement(yr.Z,null))),dataIndex:"shixun_tag_num_name",key:"shixun_tag_num_name",width:100,render:(Ki,Ei,bi)=>le.createElement("span",null,Ki||"- -")},{title:"\u64CD\u4F5C",render(Ki,Ei){const{title:bi,challenge_names:Jr,author_name:Ur,identifier:Mr,author_school_name:Fo,study_count:vr}=Ei||{};return le.createElement("div",null,le.createElement("span",{style:{color:"#165DFF",cursor:"pointer"},onClick:()=>{Oe.default.confirm({title:"\u9898\u76EE\u8BE6\u60C5",closable:!0,width:1e3,centered:!0,icon:null,footer:null,content:le.createElement("div",null,le.createElement(Ze.Z,{value:bi,style:{marginBottom:18}}),le.createElement("div",{className:nn.challengeNameWrapper},Jr.map((so,er)=>le.createElement("div",{className:nn.challengeName,key:er},"\u7B2C",(0,Qe.EM)(er+1),"\u9898\xA0",so))),le.createElement(At.Z,{className:nn.shixunPreviewFooter,justify:"space-between",style:{alignItems:"center"}},le.createElement(De.Z,{className:nn.shixunInfoWrapper},le.createElement("span",null,"\u521B\u5EFA\u8005"),le.createElement("span",{className:nn.shixunInfo},Ur.split("\u3001")[0]),le.createElement("span",null,"\u6240\u5C5E\u5355\u4F4D"),le.createElement("span",{className:nn.shixunInfo},Fo),le.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),le.createElement("span",{className:nn.shixunInfo},vr)),le.createElement(vt.ZP,{type:"primary",className:nn.btnToDetail,onClick:()=>(0,Qe.xg)(`/shixuns/${Mr}/challenges?exercise=true`)},le.createElement("i",{className:"iconfont icon-shixunkecheng"}),"\u5B9E\u8BAD\u8BE6\u60C5")))})}},"\u67E5\u770B"),(Ei==null?void 0:Ei.shixun_tag_num)===1&&le.createElement("a",{target:"_blank",href:`/shixuns/${Ei==null?void 0:Ei.identifier}/challenges`,style:{marginLeft:10}},"\u53BB\u53D1\u5E03"))}}],dataSource:Qi==null?void 0:Qi.items,rowSelection:{type:"radio",selectedRowKeys:Br,preserveSelectedRowKeys:!0,getCheckboxProps:Ki=>({disabled:Ki.shixun_tag_num===1}),onChange(Ki,Ei){var bi,Jr,Ur;console.log(Ki),Zr(Ki);const Mr=[];for(const vr of mr)Ki.includes(vr.id)&&Mr.push(vr);const Fo=Mr.map(vr=>vr.id);for(const vr of Ei)vr&&Ki.includes(vr.id)&&!Fo.includes(vr.id)&&Mr.push({id:vr.id,difficulty:vr.level,identifier:vr.identifier,name:vr.name,real_name:(bi=vr==null?void 0:vr.author_name)==null?void 0:bi.split("\u3001")[0],school_name:vr.author_school_name,challenge_names:vr.challenge_names,challenges:(Jr=vr.challenge_names)==null?void 0:Jr.map((so,er)=>({subject:so,id:er,score:5})),score:((Ur=vr.challenge_names)==null?void 0:Ur.length)*5,study_count:vr.study_count,challenges_count:vr.challenges_count});Po(Mr)}},pagination:{current:dr.page,pageSize:dr.limit,total:Qi==null?void 0:Qi.items_count,showTotal:Ki=>le.createElement("span",null,"\u5171\xA0",le.createElement("span",{style:{color:"#165DFF"}},Ki),"\xA0\u6761\u6570\u636E"),showQuickJumper:!0,onChange(Ki,Ei){gr({page:Ki,limit:Ei})},size:"default"},scroll:{y:400}}))},ur=Le(3039),Nr=Le(75736),yo=(pt,Ut,Re)=>new Promise((ut,dr)=>{var lr=Jn=>{try{Qi(Re.next(Jn))}catch(Fr){dr(Fr)}},gr=Jn=>{try{Qi(Re.throw(Jn))}catch(Fr){dr(Fr)}},Qi=Jn=>Jn.done?ut(Jn.value):Promise.resolve(Jn.value).then(lr,gr);Qi((Re=Re.apply(pt,Ut)).next())}),La=({visible:pt,getdata:Ut,onCancel:Re,onRandomExchange:ut,selectFromProblemSet:dr,questionParams:lr})=>{const[gr,Qi]=(0,le.useState)(!1),[Jn,Fr]=(0,le.useState)(!1),[Br,Zr]=(0,le.useState)({}),mr=(0,lt.useParams)(),[Po,Ki]=(0,le.useState)(),Ei=(bi,Jr)=>yo(void 0,null,function*(){Fr(!0);const Ur=yield(0,Ue.ZP)(`/api/exercises/${mr.categoryId}/toggle_random_question.json`,{method:"post",body:{question_id:lr.id,item_bank_id:bi,shixuns_info:[{id:bi,is_copy:Jr!=1,is_use:Jr!=1}]}});Fr(!1),Ur!=null&&Ur.status||(Et.ZP.info("\u6362\u9898\u6210\u529F"),Re(),Ut())});return le.createElement(Oe.default,{title:"\u8BF7\u9009\u62E9\u66FF\u6362\u65B9\u5F0F",open:pt,onCancel:Re,centered:!0,maskClosable:!0,footer:null},le.createElement(At.Z,{justify:"center",className:"pb20"},le.createElement(ba.Z,{onClick:ut},"\u968F\u673A\u66F4\u6362"),(lr==null?void 0:lr.type)!=="PRACTICAL"&&le.createElement(vt.ZP,{style:{marginLeft:24},onClick:dr},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"),(lr==null?void 0:lr.type)==="PRACTICAL"&&le.createElement(vt.ZP,{style:{marginLeft:24},onClick:()=>{Qi(!0)}},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9")),le.createElement(oi,{open:gr,onCancel:()=>Qi(!1),onOk:bi=>yo(void 0,null,function*(){if(console.log("----selectedRows",bi,mr),(bi==null?void 0:bi.length)<=0){Et.ZP.info("\u8BF7\u9009\u62E9\u5B9E\u8BAD");return}let Jr=bi==null?void 0:bi.map(Mr=>Mr==null?void 0:Mr.id),Ur=yield(0,Nr.Tr)({id:[...Jr],course_id:mr.coursesId,type:"shixun"});(Ur==null?void 0:Ur.student_count)===0?Ei(Jr==null?void 0:Jr[0],1):(Ki(Jr),Zr(Ur)),Qi(!1)})}),le.createElement(ur.Z,{resdata:Br,type:"shixun",okloading:Jn,oktext:(Br==null?void 0:Br.can_copy_num)===0?"\u786E\u5B9A":"\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362",onok:bi=>yo(void 0,null,function*(){Ei(Po==null?void 0:Po[0],2)})}))},ga=Le(77762),bo=Le(24334),Dr=Le(90283),or=Le(60572),ta=Le(32162),sa=Le(48790),Ta=Object.defineProperty,Ga=Object.defineProperties,Oo=Object.getOwnPropertyDescriptors,pa=Object.getOwnPropertySymbols,Lo=Object.prototype.hasOwnProperty,Ir=Object.prototype.propertyIsEnumerable,Ba=(pt,Ut,Re)=>Ut in pt?Ta(pt,Ut,{enumerable:!0,configurable:!0,writable:!0,value:Re}):pt[Ut]=Re,ra=(pt,Ut)=>{for(var Re in Ut||(Ut={}))Lo.call(Ut,Re)&&Ba(pt,Re,Ut[Re]);if(pa)for(var Re of pa(Ut))Ir.call(Ut,Re)&&Ba(pt,Re,Ut[Re]);return pt},Uo=(pt,Ut)=>Ga(pt,Oo(Ut)),_o=(pt,Ut,Re)=>new Promise((ut,dr)=>{var lr=Jn=>{try{Qi(Re.next(Jn))}catch(Fr){dr(Fr)}},gr=Jn=>{try{Qi(Re.throw(Jn))}catch(Fr){dr(Fr)}},Qi=Jn=>Jn.done?ut(Jn.value):Promise.resolve(Jn.value).then(lr,gr);Qi((Re=Re.apply(pt,Ut)).next())});const oa=({data:pt,submit:Ut,goBack:Re,loading:ut,onTypeScore:dr,editPreview:lr=!1,onSkipExamination:gr,selectValue:Qi,onExchange:Jn,getdata:Fr,handleMarkWrongQuestion:Br,dispatch:Zr})=>{var mr,Po,Ki,Ei,bi,Jr,Ur,Mr,Fo,vr,so;const er=(0,le.useRef)(),[Tr,oo]=(0,le.useState)(null),[Go,ha]=(0,le.useState)(!1),[_a,jr]=(0,le.useState)(!1),Ls=(0,le.useRef)(),[vo]=it.default.useForm(),na=(0,lt.useParams)(),[Eo,Xa]=(0,le.useState)(!1),[Ia,xs]=(0,le.useState)([]);(0,le.useEffect)(()=>{ha(!0)},[]),(0,le.useEffect)(()=>{lr||(0,Qe.Dk)("\u8BD5\u5377\u9884\u89C8")},[lr]),(0,le.useEffect)(()=>{var Mn;((Mn=pt==null?void 0:pt.questionList)==null?void 0:Mn.length)>0&&(pt==null||pt.questionList.forEach(Gr=>{var uo;Gr.type==="PRACTICAL"&&((uo=Gr==null?void 0:Gr.questions)==null||uo.forEach((io,rr)=>{var la;Ia[rr]=!((la=io==null?void 0:io.shixun)!=null&&la.ignore_prompt),xs([...Ia])}))}))},[pt]);const Yl=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],zu={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"},Ll={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"},lu=Mn=>{var Gr;const uo=[];return le.createElement(le.Fragment,null,le.createElement("aside",{className:Ke.single},(Gr=Mn==null?void 0:Mn.choices)==null?void 0:Gr.map((io,rr)=>(io.is_answer&&uo.push(ta.k4[rr]),le.createElement("ul",{key:rr},le.createElement("li",null,ta.k4[rr],"\u3001"),le.createElement("li",null,le.createElement(Ze.Z,{value:io.choice_text})))))),le.createElement("div",{className:Ke.analysis},le.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",uo.join(""),le.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Yl[Mn.difficulty])),le.createElement("aside",null,le.createElement("span",{className:Ke.text},"\u89E3\u6790:"),le.createElement(Ze.Z,{value:Mn.analysis?Mn.analysis:"\u6682\u65E0\u89E3\u6790"})),le.createElement("ul",null,le.createElement("li",null,le.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Mn==null?void 0:Mn.discipline_name)||"--"}/${Mn==null?void 0:Mn.sub_discipline_name}`),le.createElement(bt.Z,{title:Mn==null?void 0:Mn.tag_discipline_name},le.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Mn==null?void 0:Mn.tag_discipline_name)))))},ka=(Mn,Gr)=>{var uo;const io=(uo=Mn==null?void 0:Mn.standard_answer)==null?void 0:uo.map((rr,la)=>{var Wa;return le.createElement("div",{key:la},`\u7B54\u6848\uFF08\u586B\u7A7A${rr==null?void 0:rr.position}\uFF09\uFF1A${(Wa=rr==null?void 0:rr.answer_text)==null?void 0:Wa.join("\u3001")}`)});return le.createElement(le.Fragment,null,le.createElement("div",{className:Ke.analysis},le.createElement("div",{style:{display:"flex"}},le.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),le.createElement("div",null,io)),le.createElement("aside",null,le.createElement("span",{className:Ke.text},"\u89E3\u6790:"),le.createElement(Ze.Z,{value:Mn.analysis?Mn.analysis:"\u6682\u65E0\u89E3\u6790"})),le.createElement("ul",null,le.createElement("li",null,le.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),Gr?`${(Gr==null?void 0:Gr.discipline_name)||"--"}/${Gr==null?void 0:Gr.sub_discipline_name}`:`${(Mn==null?void 0:Mn.discipline_name)||"--"}/${Mn==null?void 0:Mn.sub_discipline_name}`),le.createElement(bt.Z,{title:Gr?Gr==null?void 0:Gr.tag_discipline_name:Mn==null?void 0:Mn.tag_discipline_name},le.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Gr?Gr==null?void 0:Gr.tag_discipline_name:Mn==null?void 0:Mn.tag_discipline_name)))))},qs=Mn=>{var Gr;const uo=(Gr=Mn==null?void 0:Mn.standard_answer)==null?void 0:Gr.map((io,rr)=>le.createElement("div",{key:rr},`\u7B54\u6848\uFF08\u586B\u7A7A${(io==null?void 0:io.position)||(io==null?void 0:io.exercise_choice_id)}\uFF09\uFF1A${io==null?void 0:io.answer_text}`));return le.createElement(le.Fragment,null,le.createElement("div",{className:Ke.analysis},le.createElement("div",{style:{display:"flex"}},le.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),le.createElement("div",null,uo)),le.createElement("aside",null,le.createElement("span",{className:Ke.text},"\u89E3\u6790:"),le.createElement(Ze.Z,{value:Mn.analysis?Mn.analysis:"\u6682\u65E0\u89E3\u6790"})),le.createElement("ul",null,le.createElement("li",null,le.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Mn==null?void 0:Mn.discipline_name)||"--"}/${Mn==null?void 0:Mn.sub_discipline_name}`),le.createElement(bt.Z,{title:Mn==null?void 0:Mn.tag_discipline_name},le.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Mn==null?void 0:Mn.tag_discipline_name)))))},al=(Mn,Gr)=>{var uo;return le.createElement("div",{className:Ke.analysis},le.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",(uo=Mn==null?void 0:Mn.answer_texts)==null?void 0:uo[0]),le.createElement("aside",null,le.createElement("span",{className:Ke.text},"\u89E3\u6790:"),le.createElement(Ze.Z,{value:Mn.analysis?Mn.analysis:"\u6682\u65E0\u89E3\u6790"})),le.createElement("ul",null,le.createElement("li",null,le.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),Gr?`${(Gr==null?void 0:Gr.discipline_name)||"--"}/${Gr==null?void 0:Gr.sub_discipline_name}`:`${(Mn==null?void 0:Mn.discipline_name)||"--"}/${Mn==null?void 0:Mn.sub_discipline_name}`),le.createElement(bt.Z,{title:Gr?Gr==null?void 0:Gr.tag_discipline_name:Mn==null?void 0:Mn.tag_discipline_name},le.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Gr?Gr==null?void 0:Gr.tag_discipline_name:Mn==null?void 0:Mn.tag_discipline_name))))},fl=Mn=>{var Gr,uo;return le.createElement("div",{className:Ke.analysis},le.createElement("aside",null,le.createElement("span",{className:Ke.text},"\u9884\u671F\u8F93\u51FA:"),le.createElement(Ze.Z,{value:(Gr=Mn==null?void 0:Mn.program_attr)==null?void 0:Gr.description})),le.createElement("div",{style:{marginTop:20}},"\u6B63\u786E\u7B54\u6848\uFF1A",((uo=Mn==null?void 0:Mn.program_attr)==null?void 0:uo.answer_text)||"--"),le.createElement("aside",null,le.createElement("span",{className:Ke.text},"\u89E3\u6790:"),le.createElement(Ze.Z,{value:Mn.analysis?Mn.analysis:"\u6682\u65E0\u89E3\u6790"})),le.createElement("ul",null,le.createElement("li",null,le.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Mn==null?void 0:Mn.discipline_name)||"--"}/${Mn==null?void 0:Mn.sub_discipline_name}`),le.createElement(bt.Z,{title:Mn==null?void 0:Mn.tag_discipline_name},le.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Mn==null?void 0:Mn.tag_discipline_name))))},uu=(Mn,Gr)=>{var uo;return le.createElement("div",null,(uo=Mn==null?void 0:Mn.sub_item_banks)==null?void 0:uo.map((io,rr)=>{var la,Wa;const Fa=[];return le.createElement(le.Fragment,null,le.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333",paddingTop:"15px"}},Gr+1+"."+(rr+1),"\uFF08",zu[io.item_type]||Ll[io.item_type],"\uFF09",io.name),(io.item_type=="SINGLE"||io.item_type=="MULTIPLE"||io.item_type=="JUDGMENT"||io.item_type=="single"||io.item_type=="multiple"||io.item_type=="judgement")&&le.createElement(le.Fragment,null,le.createElement("aside",{className:Ke.single},(la=io==null?void 0:io.choices)==null?void 0:la.map((ya,Ks)=>(ya.is_answer&&Fa.push(ta.k4[Ks]),le.createElement("ul",{key:Ks},le.createElement("li",null,ta.k4[Ks],"\u3001"),le.createElement("li",null,le.createElement(Ze.Z,{value:ya.choice_text})))))),le.createElement("div",{className:Ke.analysis},le.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Fa.join(""),le.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Yl[io.difficulty])),le.createElement("aside",null,le.createElement("span",{className:Ke.text},"\u89E3\u6790:"),le.createElement(Ze.Z,{value:io.analysis?io.analysis:"\u6682\u65E0\u89E3\u6790"})),le.createElement("ul",null,le.createElement("li",null,le.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Mn==null?void 0:Mn.discipline_name)||"--"}/${Mn==null?void 0:Mn.sub_discipline_name}`),le.createElement(bt.Z,{title:Mn==null?void 0:Mn.tag_discipline_name},le.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Mn==null?void 0:Mn.tag_discipline_name))))),(io.item_type=="COMPLETION"||io.item_type=="completion")&&ka(io,Mn),(io.item_type=="SUBJECTIVE"||io.item_type=="subjective")&&al(io,Mn),((Wa=pt==null?void 0:pt.exam)==null?void 0:Wa.exercise_status)===3&&le.createElement("div",{className:"flex gap-20px mt20"},le.createElement(Dr.Z,{state:io==null?void 0:io.is_wrong,onClick:()=>{Br==null||Br({value:Uo(ra({},io),{question_id:io==null?void 0:io.id,question_score:io==null?void 0:io.score})})}}),io.item_type=="single"&&le.createElement(vt.ZP,{style:{color:"#3061D0"},onClick:()=>{Xl({value:io})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848")))}))},Bl=Mn=>{var Gr,uo,io;return le.createElement("div",{style:{marginTop:"12px"}},(uo=(Gr=Mn==null?void 0:Mn.shixun)==null?void 0:Gr.challenges)==null?void 0:uo.map((rr,la)=>le.createElement("div",{className:"c-grey-666 font14 mb10 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},le.createElement("div",null,le.createElement("span",{className:"mr5"},"\u7B2C",la+1,"\u5173"),le.createElement(bt.Z,{key:la,title:rr==null?void 0:rr.challenge_name},le.createElement("span",null,(0,Qe.Pq)(rr==null?void 0:rr.challenge_name,44)))),lr&&le.createElement("div",null,"\u5206\u503C\uFF1A",rr.score,"\u5206"))),le.createElement(lt.Link,{style:{float:"right"},target:"_blank",to:`/shixuns/${(io=Mn==null?void 0:Mn.shixun)==null?void 0:io.identifier}/challenges`},"\u5B9E\u8BAD\u8BE6\u60C5"),le.createElement("div",{style:{clear:"both"}}))},Ea=Mn=>{let Gr=Mn.questions_score/Mn.questions_count;Oe.default.confirm({icon:null,centered:!0,title:"\u5206\u6570\u8BBE\u7F6E",content:le.createElement("div",{className:Ke.modalColumn},le.createElement("div",{className:Ke.modalRow,style:{justifyContent:"flex-start"}},le.createElement("sup",{className:Ke.sup},"*"),le.createElement("span",null,Mn==null?void 0:Mn.name,"\uFF1A"),le.createElement(st.Z,{min:0,precision:1,defaultValue:Gr,onChange:uo=>{Gr=uo}}),le.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>_o(void 0,null,function*(){var uo;if(!Gr)return Et.ZP.warning("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),Promise.reject();const io={type:Mn==null?void 0:Mn.type,score:Gr,scoreTotal:Number((uo=Gr*Mn.questions_count)==null?void 0:uo.toFixed(1))};dr(io)})})},Oa=()=>{let Mn="";Oe.default.confirm({icon:null,centered:!0,title:"\u4FDD\u5B58\u8BD5\u5377",content:le.createElement("div",{className:Ke.modalColumn},le.createElement("div",{style:{color:"#676A6C",display:"flex",alignItems:"center"},className:"font14 mt20"},le.createElement("img",{style:{marginRight:5},src:An.Z}),"\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"),le.createElement("div",{className:Ke.modalRow,style:{marginTop:20}},le.createElement("sup",{className:Ke.sup},"*"),le.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),le.createElement(ot.default,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:Mn,onChange:Gr=>{Mn=Gr.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>_o(void 0,null,function*(){var Gr;if(!Mn)return Et.ZP.warning("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),Promise.reject();const uo=[],io=[],rr=[],la=[];(Gr=pt==null?void 0:pt.questionList)==null||Gr.forEach(Fa=>{var ya;(ya=Fa.questions)==null||ya.forEach(Ks=>{let rs=Fa.questions_score/Fa.questions_count;rs=rs&&rs.toFixed(1),Fa.type==="COMBINATION"&&rr.push({id:Ks.id,sub_item_bank_ids:Ks.sub_item_banks.map(Bs=>Bs.id)}),Fa.type==="PRACTICAL"?la.push(Ks.id):(uo.push(Ks.id),io.push(rs))})}),console.log("-----",rr),yield Ut({item_bank_ids:uo,item_bank_scores:io,name:Mn,combination_item_banks:rr,shixun_ids:la})})})},us=(Mn,Gr,uo,io)=>{var rr;const la=`${location.pathname}${location.search}`,Wa=(rr=io.questions)==null?void 0:rr.map(Fa=>Fa==null?void 0:Fa.id);if(la.includes("exercise"))Ls.current={id:Mn,ids:Wa,type:Gr,index:uo},jr(!0);else{let Fa=Oe.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:()=>_o(void 0,null,function*(){Fa.update({cancelButtonProps:{disabled:!0}}),yield Jn({single_question_id:Mn,seleted_item_bank_ids:Wa},{type:Gr,index:uo}),Fa.update({cancelButtonProps:{disabled:!1}}),Et.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898")})})}},Zs=Mn=>{var Gr;const uo=(Gr=Mn.questions)==null?void 0:Gr.map(la=>la==null?void 0:la.id),io=Mn.name;let rr=Oe.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:`\u786E\u8BA4\u66F4\u6362${io}\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F`,cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>_o(void 0,null,function*(){rr.update({cancelButtonProps:{disabled:!0}}),yield Jn({seleted_item_bank_ids:uo},{type:Mn.type}),rr.update({cancelButtonProps:{disabled:!1}}),Et.ZP.success(`\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210${io}\u8BD5\u9898`)})})},Gs=()=>{let Mn=Oe.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:()=>_o(void 0,null,function*(){Mn.update({cancelButtonProps:{disabled:!0}}),yield Jn(),Mn.update({cancelButtonProps:{disabled:!1}}),Et.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898")})})},Il=Mn=>{console.log(Mn,"key"),gr(Mn-1)},mu=(Mn,Gr)=>{var uo,io;if(Gr==="SINGLE")return le.createElement(le.Fragment,null,le.createElement(si,{ref:er,editData:Mn,isEdit:!0}),le.createElement(We.Z,null));if(Gr==="MULTIPLE")return le.createElement(le.Fragment,null,le.createElement(nr,{ref:er,editData:Mn,isEdit:!0}),le.createElement(We.Z,null));if(Gr==="JUDGMENT")return le.createElement(le.Fragment,null,le.createElement(qt,{ref:er,editData:Mn,isEdit:!0}),le.createElement(We.Z,null));if(Gr==="COMPLETION")return le.createElement(le.Fragment,null,le.createElement(Dt,{ref:er,editData:Mn,isEdit:!0}),le.createElement(We.Z,null));if(Gr==="SUBJECTIVE")return le.createElement(le.Fragment,null,le.createElement(li,{ref:er,editData:Mn,isEdit:!0}),le.createElement(We.Z,null));if(Gr==="COMBINATION")return le.createElement(le.Fragment,null,le.createElement(Ko,{ref:er,editData:Mn,isEdit:!0}),le.createElement(We.Z,null));if(Gr==="BPROGRAM")return le.createElement(le.Fragment,null,le.createElement(it.default,{form:vo,style:{marginTop:20},onFinishFailed:rr=>{var la,Wa;rr.errorFields[0].name.includes("standard_answers")?Et.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):Et.ZP.error(rr.errorFields[0].errors[0]),vo.scrollToField((Wa=(la=rr==null?void 0:rr.errorFields)==null?void 0:la[0])==null?void 0:Wa.name,{behavior:"smooth",block:"center"})},onFinish:rr=>_o(void 0,null,function*(){var la;let Wa=Uo(ra({question_score:Mn.score},rr),{question_type:8,hack:Uo(ra({},rr.hack),{difficult:Mn.program_attr.difficult}),hack_codes:Uo(ra({},rr.hack_codes),{code:bo.Base64.encode((la=rr.hack_codes)==null?void 0:la.code)})});Eo&&(Wa.is_cover=1);const Fa=yield(0,Ue.ZP)(`/api/exercise_questions/${Mn.id}.json`,{method:"put",body:Wa});(Fa==null?void 0:Fa.status)===0&&(Et.ZP.success("\u7F16\u8F91\u6210\u529F"),Il(Qi+1)),oo(null)})},le.createElement(ga.tc,{form:vo,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,hackidentifier:(uo=Mn==null?void 0:Mn.program_attr)==null?void 0:uo.identifier,answerKey:"standard_answers"}),le.createElement(We.Z,null)));if(Gr==="PROGRAM"&&lt.history.push(`/problems/${(io=Mn==null?void 0:Mn.program_attr)==null?void 0:io.identifier}/edit?type=exercises&express_id=${na.categoryId}&question_id=${Mn==null?void 0:Mn.id}&score=${Mn==null?void 0:Mn.score}&callback_url=${location.pathname}&select=${Qi}&exercise=true`),Gr==="PRACTICAL")return le.createElement(le.Fragment,null,le.createElement(gi,{ref:er,editData:Mn,isEdit:!0}),le.createElement(We.Z,null))},Fu=(Mn,Gr)=>_o(void 0,null,function*(){var uo,io,rr,la,Wa,Fa;const ya=yield(uo=er.current)==null?void 0:uo.onSave();if(!ya)return;const Ks=Hr=>{const el=Hr.map(Ns=>Ns.choice_text.trim().replace(/^\s+|\s+$/g,""));return new Set(el).size!==el.length},rs={question_score:Gr.score,analysis:ya.analysis};if(Mn==="SINGLE"||Mn==="MULTIPLE"||Mn==="JUDGMENT"){if(Mn!=="JUDGMENT"&&Ks(ya==null?void 0:ya.choices)){Et.ZP.error("\u9009\u62E9\u9898\u9009\u9879\u5185\u5BB9\u4E0D\u80FD\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58");return}const Hr=[],el=[];rs.question_type=Mn==="JUDGMENT"?2:1,rs.question_title=ya==null?void 0:ya.name,(io=ya==null?void 0:ya.choices)==null||io.forEach((Jl,Ns)=>{Hr.push(Jl.choice_text),Jl!=null&&Jl.is_answer&&el.push(Ns+1)}),rs.question_choices=Hr,rs.standard_answers=el}if(Mn==="COMPLETION"){let Hr=(rr=ya==null?void 0:ya.standard_answers)==null?void 0:rr.map((Ns,Ml)=>(Ns==null?void 0:Ns.score)<=0?Ml+1:null).filter(Ns=>Ns!==null);if((Hr==null?void 0:Hr.length)>0)return Et.ZP.warning(`\u7B2C${Hr.join("\u3001")}\u9879\u7684\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A`),!1;let el=(la=ya==null?void 0:ya.standard_answers)==null?void 0:la.reduce((Ns,Ml)=>Ns+(Number(Ml==null?void 0:Ml.score)||0),0);if(parseFloat(el.toFixed(2))!=(rs==null?void 0:rs.question_score))return Et.ZP.warning("\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E\u8BE5\u5C0F\u9898\u5206\u503C\uFF01"),!1;rs.is_ordered=ya.is_ordered,rs.question_title=ya==null?void 0:ya.name,rs.use_blank_score=ya==null?void 0:ya.use_blank_score,rs.question_type=3;const Jl=[];(Wa=ya==null?void 0:ya.standard_answers)==null||Wa.forEach((Ns,Ml)=>{Jl.push({choice_id:Ns.position,answer_text:Ns.answer_text,score:Ns.score})}),rs.standard_answers=Jl,rs.downcase=ya==null?void 0:ya.downcase,rs.no_space=ya==null?void 0:ya.no_space}if(Mn==="SUBJECTIVE"&&(console.log("editorData"),console.log(ya),rs.question_title=ya==null?void 0:ya.name,rs.question_type=4,rs.answer_texts=ya==null?void 0:ya.answer_texts,rs.use_keywords=ya==null?void 0:ya.use_keywords,rs.keywords=ya==null?void 0:ya.keywords),Mn==="COMBINATION"){rs.question_title=ya==null?void 0:ya.name,rs.question_type=7;try{rs.sub_questions=(Fa=ya==null?void 0:ya.sub_item_banks)==null?void 0:Fa.map((Hr,el)=>{var Jl,Ns,Ml;if((Hr==null?void 0:Hr.item_type)=="single"||(Hr==null?void 0:Hr.item_type)=="multiple"){if(Ks(Hr==null?void 0:Hr.choices))throw new Error(`\u7B2C${el+1}\u5C0F\u9898\u9009\u9879\u5185\u5BB9\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58`);const xh=[],Ss=[];return(Jl=Hr==null?void 0:Hr.choices)==null||Jl.forEach((ms,Ql)=>{xh.push(ms.choice_text),ms!=null&&ms.is_answer&&Ss.push(Ql+1)}),{id:Hr.id,question_id:Hr.id,question_title:Hr.name,difficulty:Hr.difficulty,question_type:(Hr==null?void 0:Hr.item_type)=="single"?0:(Hr==null?void 0:Hr.item_type)=="multiple"?1:2,question_choices:xh,standard_answers:Ss,analysis:Hr.analysis,question_score:Hr==null?void 0:Hr.score}}else if((Hr==null?void 0:Hr.item_type)=="completion"){let xh=(Ns=Hr==null?void 0:Hr.standard_answer)==null?void 0:Ns.reduce((ms,Ql)=>ms+(Number(Ql==null?void 0:Ql.score)||0),0);if(parseFloat(xh.toFixed(2))!=(Hr==null?void 0:Hr.score))throw new Error("\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E\u8BE5\u5C0F\u9898\u5206\u503C\uFF01");const Ss=[];return(Ml=Hr==null?void 0:Hr.standard_answer)==null||Ml.forEach((ms,Ql)=>{Ss.push({choice_id:ms.position,answer_text:ms.answer_text,score:ms.score})}),{id:Hr.id,question_id:Hr.id,is_ordered:Hr.is_ordered,question_title:Hr.name,difficulty:Hr.difficulty,question_type:3,standard_answers:Ss,use_blank_score:Hr.use_blank_score,analysis:Hr.analysis,downcase:Hr==null?void 0:Hr.downcase,no_space:Hr==null?void 0:Hr.no_space,question_score:Hr==null?void 0:Hr.score}}else if((Hr==null?void 0:Hr.item_type)=="subjective")return{id:Hr.id,question_id:Hr.id,question_title:Hr.name,question_type:4,difficulty:Hr.difficulty,answer_texts:Hr==null?void 0:Hr.answer_texts,analysis:Hr.analysis,question_score:Hr==null?void 0:Hr.score,use_keywords:Hr.use_keywords,keywords:Hr==null?void 0:Hr.keywords}})}catch(Hr){Et.ZP.warning(Hr.message);return}delete rs.analysis}let Bs=!1;(Gr==null?void 0:Gr.is_my)===1&&(Bs=yield new Promise((el,Jl)=>{Oe.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:()=>{el(!0)},onCancel:()=>{el(!1)}})})),Bs&&(rs.is_cover=1);const oh=Mn!=="PRACTICAL"?yield(0,Ue.ZP)(`/api/exercise_questions/${Gr.id}.json`,{method:"put",body:rs}):yield(0,Ue.ZP)(`/api/exercise_questions/${Gr.id}/update_shixun_score.json`,{method:"post",body:ra({},ya)});(oh==null?void 0:oh.status)===0&&(Et.ZP.success("\u7F16\u8F91\u6210\u529F"),Il(Qi+1),oo(null))}),Ol=()=>_o(void 0,null,function*(){(0,lt.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u66F4\u65B0\u8BD5\u5377\uFF0C\u8BF7\u7A0D\u540E..."}}),(yield(0,Ue.ZP)(`/api/exercises/${na.categoryId}/sync_random_question.json`,{method:"post"})).status===0&&(yield gr(Qi),Et.ZP.success("\u66F4\u65B0\u6210\u529F")),(0,lt.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1}})}),Xl=({value:Mn}={})=>{var Gr;const uo=[];let io=[];const rr=(Gr=Mn==null?void 0:Mn.choices)==null?void 0:Gr.map((Wa,Fa)=>{var ya;const Ks=Fa+1;return Wa!=null&&Wa.is_answer&&(uo.push(Ks),io.push(Ks)),{value:Ks,label:le.createElement(Ze.Z,{className:"c-black font14",value:`${(ya=ta.k4)==null?void 0:ya[Fa]}. ${Wa==null?void 0:Wa.choice_text}`}),disabled:Wa==null?void 0:Wa.origin_standard_answer}}),la=Oe.default.confirm({centered:!0,icon:null,title:"\u589E\u8BBE\u6B63\u786E\u7B54\u6848",width:800,content:le.createElement(le.Fragment,null,"\u5F53\u524D\u8BD5\u9898\u7684\u6B63\u786E\u7B54\u6848\u4E3A ",uo==null?void 0:uo.map(Wa=>{var Fa;return(Fa=ta.k4)==null?void 0:Fa[Wa-1]}),"\uFF0C\u8BF7\u9009\u62E9\u9700\u8981\u589E\u8BBE\u4E3A\u6B63\u786E\u7B54\u6848\u7684\u9009\u9879\u3002",le.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",le.createElement("br",null),le.createElement(Tt.default.Group,{className:"flex-col mt20",options:rr,defaultValue:io,onChange:Wa=>{io=Wa}})),onOk:()=>_o(void 0,null,function*(){const Wa=yield(0,Ue.ZP)(`/api/exercises/${na.categoryId}/questions/${Mn==null?void 0:Mn.id}/add_standard_answers.json`,{method:"put",body:{standard_answer:io}});(Wa==null?void 0:Wa.status)===0&&(Et.ZP.success("\u4FEE\u6539\u6210\u529F"),Il(Qi+1))})})},df=(mr=pt==null?void 0:pt.questionList)==null?void 0:mr.reduce((Mn,Gr)=>Mn+Number(Gr.questions_score),0),xc=lr&&((Po=pt==null?void 0:pt.exam)==null?void 0:Po.exercise_status)!==1,Uf=Mn=>_o(void 0,null,function*(){const Gr=yield(0,Ue.ZP)(`/api/courses/${na==null?void 0:na.coursesId}/sync_shixuns.json`,{method:"post",body:{exercise_ids:[na==null?void 0:na.categoryId],exercise_question_id:Mn.id}});(Gr==null?void 0:Gr.status)===0&&(Zr({type:"classroomList/setActionTabs",payload:{}}),Et.ZP.info("\u5B9E\u8BAD\u540C\u6B65\u4E2D\uFF0C\u8BF7\u7A0D\u540E"))}),cf=(Mn,Gr)=>_o(void 0,null,function*(){let uo=yield(0,Ue.ZP)(`/api/courses/${na==null?void 0:na.coursesId}/ignore_prompt.json`,{method:"post",body:{container_type:"Exercise",container_id:na==null?void 0:na.categoryId,exercise_question_id:Mn==null?void 0:Mn.id}});(uo==null?void 0:uo.status)===0&&(Ia[Gr]=!1,xs([...Ia]))});return le.createElement("section",{className:Ke.wrap},le.createElement("div",{id:"id_left_preview",className:Ke.left,onMouseEnter:Mn=>{const Gr=document.getElementById("id_left_preview");Gr.style.overflowY="auto"},onMouseLeave:Mn=>{const Gr=document.getElementById("id_left_preview");Gr.style.overflowY="hidden"}},le.createElement("div",{className:Ke.title},le.createElement("div",{className:"body-overflow-initial"},le.createElement("b",null),le.createElement("span",null,"\u7B54\u9898\u5361"))),le.createElement("div",{className:Ke.total},le.createElement("div",null,le.createElement("img",{src:vn}),le.createElement("span",null,"\u9898\u6570(\u9053)"),le.createElement("aside",null,pt==null?void 0:pt.all_questions_count)),le.createElement("div",{className:"mr30 ml30"},le.createElement("img",{src:En}),le.createElement("span",null,"\u603B\u5206(\u5206)"),le.createElement("aside",null,df&&df.toFixed(1))),le.createElement("div",null,le.createElement("img",{src:_e}),le.createElement("span",null,"\u65F6\u957F(\u5206)"),le.createElement("aside",null,((Ki=pt==null?void 0:pt.exam)==null?void 0:Ki.time)===-1||((Ei=pt==null?void 0:pt.exam)==null?void 0:Ei.time)===null?"\u4E0D\u9650":(bi=pt==null?void 0:pt.exam)==null?void 0:bi.time))),(Jr=pt==null?void 0:pt.questionList)==null?void 0:Jr.map((Mn,Gr)=>{var uo;return le.createElement("div",{className:Ke.list,key:Gr},le.createElement("div",{className:Ke.name},le.createElement("b",null),le.createElement("span",null,Mn.name)),le.createElement("aside",null,le.createElement("div",null,"\u5171",le.createElement("span",{className:Ke.b},Mn.questions_count),"\u9898 ",le.createElement("span",{className:Ke.l},"|"),"\u5171",le.createElement("span",{className:Ke.r},Mn.questions_score),"\u5206"),le.createElement("div",{className:Ke.answerSheet},(uo=Mn==null?void 0:Mn.questions)==null?void 0:uo.map((io,rr)=>le.createElement("div",{onClick:()=>{const la=`Anchor_${io==null?void 0:io.id}`;let Wa=document.getElementById(la);Wa&&setTimeout(()=>Wa.scrollIntoView({block:"center",behavior:"smooth"}))},key:io==null?void 0:io.id,className:Ke.tag},rr+1)))))})),le.createElement("div",{className:Ke.right},le.createElement("div",{className:Ke.examName,id:"examName"},le.createElement("div",{className:Ke.name},le.createElement(bt.Z,{title:(Ur=pt==null?void 0:pt.exam)==null?void 0:Ur.name,getPopupContainer:Mn=>Mn.parentNode},le.createElement("span",{className:Ke.t},(Mr=pt==null?void 0:pt.exam)==null?void 0:Mr.name))),lr&&((Fo=pt==null?void 0:pt.exam)==null?void 0:Fo.exercise_status)===1&&le.createElement(Ht.op,{openLoading:!0,shape:"default",onClick:()=>{Oe.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:()=>{Ol()}})},type:"primary"},"\u66F4\u65B0\u8BD5\u5377"),!lr&&le.createElement(vt.ZP,{onClick:Gs,type:"primary"},"\u968F\u673A\u66F4\u6362")),le.createElement("div",{className:Ke.topWarp},(vr=pt==null?void 0:pt.questionList)==null?void 0:vr.map((Mn,Gr)=>{var uo,io;return le.createElement(le.Fragment,{key:Gr},le.createElement("div",{className:Ke.head,style:Gr===0?{border:0,marginTop:-16}:{}},le.createElement("div",{className:Ke.name},le.createElement("b",null),le.createElement("span",null,Mn.name)),le.createElement("div",{className:Ke.so},"\u5171",le.createElement("span",{className:Ke.b},Mn.questions_count," "),"\u9898 ",Mn.type==="COMBINATION"&&`\uFF08\u5305\u542B${(uo=Mn==null?void 0:Mn.questions)==null?void 0:uo.map(rr=>{var la;return(la=rr==null?void 0:rr.sub_item_banks)==null?void 0:la.length}).reduce((rr,la)=>rr+la)}\u5C0F\u9898\uFF09`,le.createElement("span",{className:Ke.l},"|"),"\u5171",le.createElement("span",{className:Ke.r},Mn.questions_score),"\u5206"),!lr&&le.createElement("div",{className:Ke.btn},le.createElement(vt.ZP,{onClick:()=>{Ea(Mn)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),le.createElement(vt.ZP,{onClick:()=>Zs(Mn),type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),(io=Mn==null?void 0:Mn.questions)==null?void 0:io.map((rr,la)=>{var Wa,Fa,ya,Ks,rs;return Tr===(rr==null?void 0:rr.id)?le.createElement("div",{id:`Anchor_${rr==null?void 0:rr.id}`,className:Ke.content,style:{padding:0,marginTop:24},key:rr==null?void 0:rr.id},le.createElement("div",{style:{float:"right",marginTop:`${(Mn==null?void 0:Mn.type)==="PRACTICAL"?"-2px":"-6px"}`}},le.createElement(vt.ZP,{onClick:()=>oo(null),className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),le.createElement(vt.ZP,{onClick:()=>{Fu(Mn==null?void 0:Mn.type,rr)},type:"primary"},"\u4FDD\u5B58")),mu(rr,Mn.type)):le.createElement("div",{id:`Anchor_${rr==null?void 0:rr.id}`,className:Ke.content,key:rr==null?void 0:rr.id},le.createElement("div",{className:Ke.titleWrap},(rr==null?void 0:rr.item_type)==="bprogram"?le.createElement(Ze.Z,{style:{paddingRight:10},value:la+1+"\u3001"+((Wa=rr==null?void 0:rr.program_attr)==null?void 0:Wa.description)}):le.createElement(Ze.Z,{style:{paddingRight:10},className:Ke.titleHtml,value:la+1+`\u3001${(rr==null?void 0:rr.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":""}`+(rr==null?void 0:rr.name)}),(0,sa.G5)()&&((Fa=rr==null?void 0:rr.shixun)==null?void 0:Fa.shixun_change)&&le.createElement(ct.Z,{trigger:"click",open:Ia[la],onOpenChange:Bs=>{Ia[la]=!0,xs([...Ia])},placement:"bottomLeft",autoAdjustOverflow:!1,title:null,content:le.createElement("div",{style:{width:"310px",color:"#000"}},le.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"),le.createElement("div",{className:Ke.btn_warp},le.createElement(vt.ZP,{size:"small",onClick:()=>cf(rr,la)},"\u5FFD\u7565"),le.createElement(vt.ZP,{className:"ml20",size:"small",type:"primary",onClick:()=>{Ia[la]=!1,xs([...Ia]),Zr({type:"classroomList/setActionTabs",payload:{key:"\u5B9E\u8BAD\u540C\u6B65\u786E\u8BA4",onOK:()=>Uf(rr)}})}},"\u786E\u8BA4\u540C\u6B65"),le.createElement(vt.ZP,{className:"ml20",size:"small",type:"primary",onClick:()=>(0,Qe.xg)(`/shixuns/${rr==null?void 0:rr.forked_shixun_identifier}/challenges?exercise=true`)},"\u524D\u5F80\u67E5\u770B")))},le.createElement("i",{className:"iconfont icon-tongzhi1 pl10 current",style:{fontSize:"16px",color:"#F7B500"},onClick:Bs=>Bs.stopPropagation()})),lr&&le.createElement(vt.ZP,{onClick:()=>{var Bs,oh,Hr;if(Tr){Et.ZP.warning("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}vo.setFieldsValue({standard_answers:rr==null?void 0:rr.standard_answer,hack:ra(ra({},rr),rr==null?void 0:rr.program_attr),hack_codes:Uo(ra({},rr==null?void 0:rr.program_attr),{code:bo.Base64.decode(((Bs=rr==null?void 0:rr.program_attr)==null?void 0:Bs.code)||"")}),hack_sets:ra({},(oh=rr==null?void 0:rr.hack_sets)==null?void 0:oh[0])}),(rr==null?void 0:rr.item_type)=="program"?lt.history.push(`/problems/newedit/${(Hr=rr==null?void 0:rr.program_attr)==null?void 0:Hr.identifier}?type=exercises&express_id=${na.categoryId}&question_id=${rr==null?void 0:rr.id}&score=${rr==null?void 0:rr.score}&exercise=true&callback_url=/classrooms/${na.coursesId}/exercise/${na.categoryId}/detail?random=true`):oo(rr==null?void 0:rr.id)},type:"primary",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),!xc&&le.createElement(vt.ZP,{disabled:xc,className:"ml20",onClick:()=>us(rr==null?void 0:rr.id,Mn.type,la,Mn),type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(rr==null?void 0:rr.item_type)==="bprogram"&&le.createElement(Ze.Z,{style:{paddingRight:10,paddingLeft:25},showProgramFill:!0,disabledFill:!0,className:Ke.titleHtml,value:bo.Base64.decode(((ya=rr==null?void 0:rr.program_attr)==null?void 0:ya.code)||"")}),(Mn.type==="SINGLE"||Mn.type==="JUDGMENT"||Mn.type==="MULTIPLE")&&lu(rr),Mn.type==="COMPLETION"&&ka(rr),Mn.type==="SUBJECTIVE"&&al(rr),Mn.type==="PROGRAM"&&fl(rr),Mn.type==="BPROGRAM"&&qs(rr),Mn.type==="COMBINATION"&&uu(rr,la),Mn.type==="PRACTICAL"&&Bl(rr),le.createElement(At.Z,{className:"mt20",wrap:!1,align:"middle",gutter:20},((Ks=pt==null?void 0:pt.exam)==null?void 0:Ks.exercise_status)===3&&!["PROGRAM","BPROGRAM","PRACTICAL","COMBINATION"].includes(Mn.type)&&le.createElement(De.Z,null,le.createElement(Dr.Z,{state:rr==null?void 0:rr.is_wrong,onClick:()=>{Br==null||Br({value:Uo(ra({},rr),{question_id:rr==null?void 0:rr.id,question_score:rr==null?void 0:rr.score})})}})),["PROGRAM","BPROGRAM","PRACTICAL"].includes(Mn.type)&&(rr==null?void 0:rr.show_resubmit)&&le.createElement(De.Z,null,le.createElement(or.C,{dataSource:Uo(ra({},rr),{question_id:rr==null?void 0:rr.id})})),((rs=pt==null?void 0:pt.exam)==null?void 0:rs.exercise_status)===3&&["SINGLE"].includes(Mn.type)&&le.createElement(De.Z,null,le.createElement(vt.ZP,{style:{color:"#3061D0"},onClick:()=>{Xl({value:rr})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848"))))}))}))),lr?le.createElement(Ht.vr,null,le.createElement(ne.Z,{showTotal:Qe.rU,total:(so=pt==null?void 0:pt.exam)==null?void 0:so.total_num,pageSize:1,current:Qi+1,showSizeChanger:!1,onChange:Il,showQuickJumper:!1,hideOnSinglePage:!1})):le.createElement(Ht.vr,{LeftContent:le.createElement(Ht.op,{onClick:Re,shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u8FD4\u56DE"),RightContent:le.createElement(At.Z,{align:"middle"},le.createElement(ct.Z,{color:"#55575D",overlayClassName:Ke.popover,open:Go,getPopupContainer:Mn=>Mn==null?void 0:Mn.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"},le.createElement(Ht.op,{onMouseEnter:()=>ha(!0),onMouseLeave:()=>ha(!1),onClick:()=>Oa(),shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u4FDD\u5B58")),le.createElement(Ht.op,{shape:"default",type:"primary",onClick:()=>Ut(),style:{height:38,marginLeft:20}},"\u63D0\u4EA4"))}),le.createElement(La,{visible:_a,questionParams:Ls.current,getdata:Fr,onRandomExchange:()=>_o(void 0,null,function*(){const Mn=Ls.current;yield Jn({single_question_id:Mn.id,seleted_item_bank_ids:Mn.ids},{type:Mn.type,index:Mn.index}),jr(!1)}),selectFromProblemSet:()=>{const Mn=Ls.current,Gr=`${location.pathname}${location.search}`;Gr.includes("exercise")&&lt.history.push(`/paperlibrary/exchangequestion?type=exercise&qid=${Mn.id}&qtype=${Mn.type}&exerciseid=${na.categoryId}&from=${Gr}`)},onCancel:()=>{jr(!1)}}))};var Ua=(0,lt.connect)(({classroomList:pt})=>({classroomList:pt}))(oa)},12624:function(Zn,ei,Le){"use strict";Le.r(ei),Le.d(ei,{default:function(){return Za}});var le=Le(59301),Ke={wrapper:"wrapper___KtBVT",breadCrumbWrapper:"breadCrumbWrapper___k9tSB",baseInfo:"baseInfo____j5EY",radioBtnWrapper:"radioBtnWrapper___k9OCh",baseLineHeight:"baseLineHeight___O_QXK",radiogroup:"radiogroup___e2fW6",easy:"easy___WcUAp",medium:"medium___U_o3j",hard:"hard___dAXLS",formWrap:"formWrap___wt5tC",baseFormItem:"baseFormItem___zV64d",cascaderPopup:"cascaderPopup___qm63f",fixedBottom:"fixedBottom___liDZ4",cancelBtn:"cancelBtn___ZV9Mi",confirmBtn:"confirmBtn___DwH6m",previewBtn:"previewBtn___aLYCy",concat:"concat___ZuLMo"},it=Le(6767),bt=Le(28284),vt=Le(91882),Oe=Le(25690),st=Le(81868),Et=Le(29787),ot=Le(37568),We=Le(17149),Tt=Le(47889),ct=Le(77019),At=Le(71051),De=Le(99571),ne=Le(38986),te=Object.defineProperty,de=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,ye=(nn,Ht,Fn)=>Ht in nn?te(nn,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):nn[Ht]=Fn,we=(nn,Ht)=>{for(var Fn in Ht||(Ht={}))se.call(Ht,Fn)&&ye(nn,Fn,Ht[Fn]);if(de)for(var Fn of de(Ht))ge.call(Ht,Fn)&&ye(nn,Fn,Ht[Fn]);return nn},Ce=(nn,Ht,Fn)=>new Promise((Wi,Si)=>{var _i=oi=>{try{Ln(Fn.next(oi))}catch(ur){Si(ur)}},Pi=oi=>{try{Ln(Fn.throw(oi))}catch(ur){Si(ur)}},Ln=oi=>oi.done?Wi(oi.value):Promise.resolve(oi.value).then(_i,Pi);Ln((Fn=Fn.apply(nn,Ht)).next())});function _e(nn){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/examination_banks/${nn}/edit_random_exam_new.json`,{method:"get"})})}function Ze(nn,Ht){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/examination_banks/${nn}/update_random_exam.json`,{method:"post",body:Ht})})}function lt(nn){return Ce(this,null,function*(){return(0,ne.ZP)("/api/examination_banks/create_random_exam.json",{method:"post",body:nn})})}function Qe(nn){return Ce(this,null,function*(){return(0,ne.ZP)("/api/disciplines.json",{method:"get",params:nn})})}function Ue(nn){return Ce(this,null,function*(){return(0,ne.ZP)("/api/item_banks/item_difficulty_count.json",{method:"get",params:nn})})}function dt(nn,Ht){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/examination_banks/${nn}/set_item_type_score.json`,{method:"post",body:Ht})})}function $e(nn,Ht){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/exercises/${nn}/set_item_type_score.json`,{method:"post",body:Ht})})}function wt(nn,Ht){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/examination_banks/${nn}/delete_item_type.json`,{method:"post",body:Ht})})}function St(nn,Ht){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/exercises/${nn}/delete_item_type.json`,{method:"post",body:Ht})})}function Lt(nn){return Ce(this,null,function*(){return(0,ne.ZP)("/api/examination_banks/preview_random_questions.json",{method:"post",body:nn})})}function pn(nn){return Ce(this,null,function*(){return(0,ne.ZP)("/api/examination_banks/toggle_random_questions.json",{method:"post",body:nn})})}function en(nn){return Ce(this,null,function*(){return(0,ne.ZP)("/api/examination_banks/save_question_list.json",{method:"post",body:nn})})}function vn(nn){return Ce(this,null,function*(){return(0,ne.ZP)(`/api/exercises/${nn.categoryId}/edit.json`,{method:"get",params:we({},nn)})})}var rn=(nn=>(nn.OnlyFileFolder="1",nn.OnlyKnowledge="2",nn.OnlyDifficulty="3",nn.FileFolderAndDiff="4",nn.FileFolderAndKnowledge="5",nn.KnowledgeAndDiff="6",nn.All="7",nn.Shixun="8",nn))(rn||{}),nt=Le(89392),rt=Object.defineProperty,dn=Object.defineProperties,ri=Object.getOwnPropertyDescriptors,Hn=Object.getOwnPropertySymbols,Wt=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,An=(nn,Ht,Fn)=>Ht in nn?rt(nn,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):nn[Ht]=Fn,ci=(nn,Ht)=>{for(var Fn in Ht||(Ht={}))Wt.call(Ht,Fn)&&An(nn,Fn,Ht[Fn]);if(Hn)for(var Fn of Hn(Ht))En.call(Ht,Fn)&&An(nn,Fn,Ht[Fn]);return nn},It=(nn,Ht)=>dn(nn,ri(Ht)),Pt=(nn=>(nn[nn.FileFolder=1]="FileFolder",nn[nn.Difficulty=2]="Difficulty",nn[nn.Knowledge=3]="Knowledge",nn))(Pt||{});const Nt=(0,le.createContext)(null),ii={[rn.OnlyFileFolder]:[1],[rn.OnlyKnowledge]:[3],[rn.OnlyDifficulty]:[2],[rn.FileFolderAndDiff]:[1,2],[rn.FileFolderAndKnowledge]:[1,3],[rn.KnowledgeAndDiff]:[3,2],[rn.All]:[3,2,1]},Gi=(nn,Ht)=>{if(nn.length!==Ht.length)return!1;for(const Fn of Ht)if(!nn.includes(Fn))return!1;return!0},ze=nn=>{for(const[Ht,Fn]of Object.entries(ii))if(Gi(nn,Fn))return Ht},Me={SINGLE:"\u5355\u9009\u9898",MULTIPLE:"\u591A\u9009\u9898",COMPLETION:"\u586B\u7A7A\u9898",JUDGMENT:"\u5224\u65AD\u9898",SUBJECTIVE:"\u7B80\u7B54\u9898",PROGRAM:"\u7F16\u7A0B\u9898",BPROGRAM:"\u7A0B\u5E8F\u586B\u7A7A\u9898",COMBINATION:"\u7EC4\u5408\u9898",PRACTICAL:"\u5B9E\u8BAD\u9898"},Ee={1:{label:"\u7B80\u5355",color:"#46B70E"},2:{label:"\u9002\u4E2D",color:"#165DFF"},3:{label:"\u56F0\u96BE",color:"#EE6F1A"}},Te=nn=>nn&&parseFloat(nn.toFixed(1)),He=(nn,Ht)=>{var Fn,Wi,Si;switch(Ht.type){case"init":return Ht.payload;case"updateBaseInfo":return It(ci({},nn),{examination_bank:Ht.payload});case"deleteQuestionType":{const{item_types:_i}=nn,Pi=_i.filter(Ln=>Ln.item_type!==Ht.payload);return nn.examination_bank.question_count=Te(Pi.reduce((Ln,oi)=>Ln+oi.item_bank_count,0)),nn.examination_bank.total_score=Te(Pi.reduce((Ln,oi)=>Ln+oi.total_score,0)),It(ci({},nn),{item_types:Pi})}case"setQuestionType":{const{item_types:_i=[]}=nn,Pi=_i.map(oi=>oi.item_type),Ln=_i.filter(oi=>Ht.payload.includes(oi.item_type));for(const oi of Ht.payload)Pi.includes(oi)||(oi==="PRACTICAL"?Ln.push({item_type:oi,contents:[],item_banks:[],item_bank_count:0,item_bank_num:0,item_type_text:Me[oi],random_rule_type:rn.Shixun,score:0,total_score:0}):Ln.push({item_type:oi,contents:[],item_bank_count:0,item_type_text:Me[oi],score:0,total_score:0}));return It(ci({},nn),{item_types:Ln})}case"updateItemTypes":return It(ci({},nn),{item_types:Ht.payload});case"deleteRule":{const _i=(0,nt.cloneDeep)(nn),Pi=_i.item_types.find(oi=>oi.item_type===Ht.payload.itemType),Ln=Pi.contents.find(oi=>oi.id===Ht.payload.id&&oi.is_share==Ht.payload.is_share);return Pi.contents=Pi.contents.filter(oi=>oi!==Ln),((Fn=Pi.contents)==null?void 0:Fn.length)===0&&(Pi.random_rule_type=[]),Pi.item_bank_count-=Ln==null?void 0:Ln.quanlity,_i.examination_bank.question_count-=Ln==null?void 0:Ln.quanlity,Pi.total_score-=(Ln==null?void 0:Ln.quanlity)*Pi.score,_i.examination_bank.total_score-=(Ln==null?void 0:Ln.quanlity)*Pi.score,Pi.total_score=Te(Pi.total_score),_i.examination_bank.total_score=Te(_i.examination_bank.total_score),_i.contents=Pi.contents,_i}case"changeQuestionNum":{const _i=(0,nt.cloneDeep)(nn),Pi=_i.item_types.find(yo=>yo.item_type===Ht.payload.itemType),Ln=(Wi=Pi==null?void 0:Pi.contents)==null?void 0:Wi.find(yo=>yo.id===Ht.payload.id);if(Ht.payload.itemType==="PRACTICAL")return Ht.payload.num&&(_i.examination_bank.question_count=_i.examination_bank.question_count-Pi.item_bank_count+Ht.payload.num,_i.examination_bank.total_score=Te(_i.examination_bank.total_score-Pi.total_score+Ht.payload.num*Pi.score)),Ht.payload.score&&(_i.examination_bank.total_score=Te(_i.examination_bank.total_score-Pi.total_score+Ht.payload.num*Pi.score)),Pi.item_bank_count=Ht.payload.num,Pi.total_score=Te(Pi.item_bank_count*Pi.score),_i;_i.examination_bank.question_count=_i.examination_bank.question_count-(Ln==null?void 0:Ln.quanlity)+Ht.payload.num;const oi=Pi.contents.find(yo=>yo.id===Ht.payload.id&&yo.teacher_group_id===Ht.payload.teacher_group_id);oi.quanlity=Ht.payload.num;let ur=0,Nr=0;for(const yo of Pi.contents)ur+=yo==null?void 0:yo.quanlity,Nr+=(yo==null?void 0:yo.quanlity)*Pi.score;return _i.examination_bank.total_score=Te(_i.examination_bank.total_score-Pi.total_score+Nr),Pi.item_bank_count=ur,Pi.total_score=Te(Nr),_i}case"changeQuestionScore":{const _i=(0,nt.cloneDeep)(nn),Pi=_i.item_types.find(Ln=>Ln.item_type===Ht.payload.itemType);return Pi.score=Ht.payload.score,Pi.total_score=Te(Pi.item_bank_count*Pi.score),_i.examination_bank.total_score=Te(_i.item_types.reduce((Ln,oi)=>Ln+oi.total_score,0)),_i}case"editRule":{const _i=(0,nt.cloneDeep)(nn),Pi=_i.item_types.find(Ln=>Ln.item_type===Ht.payload.itemType);return Pi.contents=Ht.payload.tableData.map(Ln=>It(ci({},Ln),{item_type:Ht.payload.itemType,random_rule_type:Ht.payload.randomRuleType})),Pi.random_rule_type=Ht.payload.randomRuleType,Pi.item_bank_count=Pi.contents.reduce((Ln,oi)=>Ln+(oi==null?void 0:oi.quanlity),0),Pi.score=Pi.score||1,Pi.total_score=Te(Pi.item_bank_count*Pi.score),_i.examination_bank.question_count=_i.item_types.reduce((Ln,oi)=>Ln+oi.item_bank_count,0),_i.examination_bank.total_score=Te(_i.item_types.reduce((Ln,oi)=>Ln+oi.total_score,0)),_i}case"addShixun":{const _i=(0,nt.cloneDeep)(nn),Pi=_i.item_types.find(Ln=>Ln.item_type==="PRACTICAL");return Pi.item_banks=Ht.payload.shixunList,_i.examination_bank.question_count=_i.examination_bank.question_count+1,Pi.item_bank_num=Pi.item_banks.length,Pi.item_bank_count=Pi.item_bank_count||1,Pi.score=Pi.score||1,Pi.total_score=Pi.total_score||Pi.score*Pi.item_bank_count,_i.examination_bank.total_score=(Si=_i==null?void 0:_i.item_types)==null?void 0:Si.map(Ln=>Ln.total_score).reduce((Ln,oi)=>Ln+oi),_i}case"deleteShixunQuestion":{const _i=(0,nt.cloneDeep)(nn),Pi=_i.item_types.find(Ln=>Ln.item_type==="PRACTICAL");return Pi.item_banks=Pi.item_banks.filter(Ln=>Ln.id!==Ht.payload.shixunId),Pi.item_bank_num-=1,Pi.item_bank_count>Pi.item_bank_num&&(Pi.item_bank_count-=1,Pi.total_score-=Pi.score,Pi.total_score=Te(Pi.total_score)),_i}}};var Ae=Le(52154),qe=Object.defineProperty,an=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,yn=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,Zt=(nn,Ht,Fn)=>Ht in nn?qe(nn,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):nn[Ht]=Fn,hn=(nn,Ht)=>{for(var Fn in Ht||(Ht={}))kt.call(Ht,Fn)&&Zt(nn,Fn,Ht[Fn]);if(yn)for(var Fn of yn(Ht))Dt.call(Ht,Fn)&&Zt(nn,Fn,Ht[Fn]);return nn},wn=(nn,Ht)=>an(nn,Xt(Ht)),Dn=(nn,Ht,Fn)=>new Promise((Wi,Si)=>{var _i=oi=>{try{Ln(Fn.next(oi))}catch(ur){Si(ur)}},Pi=oi=>{try{Ln(Fn.throw(oi))}catch(ur){Si(ur)}},Ln=oi=>oi.done?Wi(oi.value):Promise.resolve(oi.value).then(_i,Pi);Ln((Fn=Fn.apply(nn,Ht)).next())}),Mi=({courseOptions:nn,setCurrentKey:Ht,loading:Fn,form:Wi})=>{const{data:Si,disabled:_i,dispatch:Pi}=(0,le.useContext)(Nt),Ln=(0,Oe.useParams)(),oi=(0,le.useRef)(!0),[ur,Nr]=(0,le.useState)(!1),yo=(0,le.useMemo)(()=>{var ea,La,ga,bo,Dr;if(!nn.length||!Si)return;const or=(ea=Si==null?void 0:Si.examination_bank)==null?void 0:ea.sub_discipline_id,ta=((La=Si==null?void 0:Si.examination_bank)==null?void 0:La.time)===-1?void 0:oi.current?Ln.id?(ga=Si==null?void 0:Si.examination_bank)==null?void 0:ga.time:((bo=Si==null?void 0:Si.examination_bank)==null?void 0:bo.time)||60:(Dr=Si==null?void 0:Si.examination_bank)==null?void 0:Dr.time;oi.current=!1;let sa=[];for(const Ta of nn)for(const Ga of Ta.children)Ga.value===or&&(sa=[Ta.value,Ga.value]);return wn(hn({},Si.examination_bank),{time:ta,course:sa})},[Si,nn]);return(0,le.useEffect)(()=>{Wi.setFieldsValue(hn({},yo))},[yo]),le.createElement(Et.Z,{spinning:Fn,size:"large",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},le.createElement("div",{className:Ke.formWrap},le.createElement(bt.default,{form:Wi,autoComplete:"off",colon:!1,labelCol:{span:4},wrapperCol:{span:20},initialValues:yo||{difficulty:2,time:60},onValuesChange:(ea,La)=>{const{course:ga=[]}=La,bo=wn(hn({},La),{sub_discipline_id:ga[1]||0});Pi({type:"updateBaseInfo",payload:bo})}},le.createElement(bt.default.Item,{name:"name",label:"\u8BD5\u5377\u540D\u79F0",className:Ke.baseLineHeight,rules:[{required:!0,validator:(ea,La)=>{var ga;return((ga=La==null?void 0:La.replaceAll(" ",""))==null?void 0:ga.length)>0?Promise.resolve():Promise.reject("\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0")}}]},le.createElement(ot.default,{maxLength:60,className:Ke.baseFormItem,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",showCount:!0})),le.createElement(bt.default.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B",name:"course",className:Ke.baseLineHeight},le.createElement(We.Z,{className:Ke.baseFormItem,disabled:_i,size:"large",allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:nn,dropdownMenuColumnStyle:{padding:"8px 12px",fontSize:14}})),le.createElement("div",{className:Ke.concat},"\u6CA1\u6709\u5408\u9002\u7684\u65B9\u5411&\u8BFE\u7A0B\uFF1F",le.createElement("span",{onClick:()=>Nr(!0)},"\u8054\u7CFB\u6559\u7814\u52A9\u7406")),le.createElement(bt.default.Item,{label:"\u96BE\u5EA6",name:"difficulty",className:Ke.radioBtnWrapper,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},le.createElement(Tt.ZP.Group,{disabled:_i,className:Ke.radiogroup},le.createElement(Tt.ZP.Button,{className:Ke.easy,value:1},"\u7B80\u5355"),le.createElement(Tt.ZP.Button,{className:Ke.medium,value:2},"\u9002\u4E2D"),le.createElement(Tt.ZP.Button,{className:Ke.hard,value:3},"\u56F0\u96BE"))),le.createElement(bt.default.Item,{label:"\u7B54\u9898\u65F6\u957F",className:Ke.baseLineHeight},le.createElement(ct.Z,{align:"middle"},le.createElement(bt.default.Item,{name:"time",noStyle:!0},le.createElement(At.Z,{className:Ke.baseFormItem,min:1,disabled:_i,size:"large",max:9999,style:{width:220},placeholder:"\u8BF7\u586B\u5199\u7B54\u9898\u65F6\u957F"})),le.createElement("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"46px",fontSize:14}},"\u5206\u949F"))),le.createElement(bt.default.Item,{label:"\u8BD5\u5377\u987B\u77E5",name:"exam_notes"},le.createElement(ot.default.TextArea,{rows:6,disabled:_i,maxLength:65535,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u987B\u77E5"})))),le.createElement("div",{className:Ke.fixedBottom},le.createElement(De.ZP,{className:`${Ke.cancelBtn} mr5`,onClick:()=>{Ln.id||window.location.href.indexOf("randompaper")>-1?Oe.history.push("/paperlibrary"):Oe.history.push(`/classrooms/${Ln.coursesId}/exercise`)}},"\u53D6\u6D88"),le.createElement(De.ZP,{className:`${Ke.confirmBtn} ml15`,type:"primary",size:"large",onClick:()=>Dn(void 0,null,function*(){if(yield Wi.validateFields(),!Ln.id&&!Ln.coursesId){const ea=yield lt(Si);ea.status===0&&(Oe.history.replace(`/randompaper/edit/${ea==null?void 0:ea.examination_bank_id}?type=settings`),Ht("settings"))}else Ht("settings")})},"\u4E0B\u4E00\u6B65")),le.createElement(Ae.Z,{open:ur,onCancel:()=>{Nr(!1)}}))},tn=Le(62957),qt=Le(5269),un={flex_box_center:"flex_box_center___NXYwj",flex_space_between:"flex_space_between___Oy2UZ",flex_box_vertical_center:"flex_box_vertical_center___ybBar",flex_box_center_end:"flex_box_center_end___yyQPf",flex_box_column:"flex_box_column____kuXY",questionInfo:"questionInfo___U9mnu",label:"label___PP7Ng",content:"content___PUXFl",leftPart:"leftPart___uoQeo",rightPart:"rightPart___mCG7H",dragItem:"dragItem___djmPG",blackText:"blackText___KqEaU",greyText:"greyText___VamKm",iconWrapper:"iconWrapper___o1C0y",contentArea:"contentArea___Fj7D0",dragging:"dragging___mX3Il",hidden:"hidden___KWDLK",dragIcon:"dragIcon___yPuB3",deleteIcon:"deleteIcon___go29y",disabled:"disabled___uSK9k",challengeNameWrapper:"challengeNameWrapper___DFjRy",challengeName:"challengeName___m7v0x",shixunPreviewFooter:"shixunPreviewFooter___iaciG",shixunInfoWrapper:"shixunInfoWrapper___aSihg",shixunInfo:"shixunInfo___WYBm1",btnToDetail:"btnToDetail___WVmtj",fixedBottom:"fixedBottom___oeMSX",cancelBtn:"cancelBtn___ac73V",confirmBtn:"confirmBtn___sYh2O",previewBtn:"previewBtn___c2uQz",setScoreModalTable:"setScoreModalTable___kPddX",title:"title___lP1E2",tipcontent:"tipcontent___tV6uE",name:"name___YLyPW",tip:"tip___FYIzt",info:"info___rSdr9",img:"img___ft7eS"},zn=Le(28426),on=Le(9148),Sn=Le(62673);const di=[{label:"\u5355\u9009\u9898",value:"SINGLE"},{label:"\u591A\u9009\u9898",value:"MULTIPLE"},{label:"\u586B\u7A7A\u9898",value:"COMPLETION"},{label:"\u5224\u65AD\u9898",value:"JUDGMENT"},{label:"\u7B80\u7B54\u9898",value:"SUBJECTIVE"},{label:"\u7F16\u7A0B\u9898",value:"PROGRAM"},{label:"\u7EC4\u5408\u9898",value:"COMBINATION"},{label:"\u5B9E\u8BAD\u9898",value:"PRACTICAL"},{label:"\u7A0B\u5E8F\u586B\u7A7A\u9898",value:"BPROGRAM"}];var gi=({open:nn,onCancel:Ht,onOk:Fn})=>{const{data:Wi,dispatch:Si}=(0,le.useContext)(Nt);(0,le.useEffect)(()=>{if(nn){const{item_types:Ln}=Wi||{};Pi(Ln==null?void 0:Ln.map(oi=>oi.item_type))}},[nn,Wi]);const[_i,Pi]=(0,le.useState)([]);return le.createElement(tn.default,{title:le.createElement("div",null,"\u9898\u578B\u8BBE\u7F6E",le.createElement("span",{className:"c-grey-333",style:{fontSize:14,fontWeight:400}},"\uFF08\u901A\u8FC7\u52FE\u9009\u53EF\u5BF9\u9898\u578B\u8FDB\u884C\u6DFB\u52A0/\u5220\u9664\uFF09")),closable:!0,centered:!0,open:nn,onCancel:Ht,onOk:()=>Fn(_i)},le.createElement(Sn.default.Group,{value:_i,onChange:Ln=>Pi(Ln)},le.createElement(ct.Z,{gutter:[0,20]},di.map(Ln=>le.createElement(qt.Z,{key:Ln.value,span:6},le.createElement(Sn.default,{value:Ln.value},Ln.label))))))},Hi=Le(54172),kr=Object.defineProperty,Gn=Object.getOwnPropertySymbols,On=Object.prototype.hasOwnProperty,Xn=Object.prototype.propertyIsEnumerable,wi=(nn,Ht,Fn)=>Ht in nn?kr(nn,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):nn[Ht]=Fn,nr=(nn,Ht)=>{for(var Fn in Ht||(Ht={}))On.call(Ht,Fn)&&wi(nn,Fn,Ht[Fn]);if(Gn)for(var Fn of Gn(Ht))Xn.call(Ht,Fn)&&wi(nn,Fn,Ht[Fn]);return nn},Cr=({open:nn,onCancel:Ht,onOk:Fn})=>{const{data:Wi}=(0,le.useContext)(Nt),[Si,_i]=(0,le.useState)();console.log("--xxx-",Si),(0,le.useEffect)(()=>{nn&&_i((0,nt.cloneDeep)(Wi))},[nn,Wi]);const Pi=(0,le.useMemo)(()=>{var Ln;let oi;return oi=(Ln=Si==null?void 0:Si.item_types)==null?void 0:Ln.map(ur=>ur.total_score).reduce((ur,Nr)=>parseFloat(ur)+parseFloat(Nr)),oi==null?void 0:oi.toFixed(1)},[Si]);return nn?le.createElement(tn.default,{title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u503C",open:nn,width:640,centered:!0,closable:!0,onCancel:Ht,onOk:()=>{Fn(Si)}},le.createElement("div",{className:"c-black mb20"},"\u603B\u5206",le.createElement("span",{className:"ml10 c-light-primary"},Pi)),le.createElement(Hi.default,{columns:[{title:"\u9898\u578B\u540D\u79F0",dataIndex:"item_type_text",width:130},{title:"\u5C0F\u9898\u603B\u6570",dataIndex:"item_bank_count",width:130},{title:"\u9898\u578B\u603B\u5206",dataIndex:"total_score",width:130},{title:"\u64CD\u4F5C",render(Ln,oi){const{score:ur,item_type:Nr}=oi;return le.createElement("div",{style:{color:"#9096A3"}},"\u6BCF",((oi==null?void 0:oi.item_type)==="PRACTICAL","\u9898"),le.createElement(At.Z,{precision:1,size:"large",className:"ml10 mr10",min:.1,disabled:(oi==null?void 0:oi.item_bank_count)===0,max:100,onChange:yo=>{const ea=Si,La=ea.item_types.find(bo=>bo.item_type===Nr);La.score=Number(yo);const ga=yo*La.item_bank_count;La.total_score=ga&&Number(ga.toFixed(1)),ea.examination_bank.total_score=ea.item_types.reduce((bo,Dr)=>Number(bo)+Number(Dr.total_score),0),_i(nr({},ea))}}),"\u5206")}}],className:un.setScoreModalTable,dataSource:Si==null?void 0:Si.item_types,rowKey:"item_type",pagination:!1})):null},be=Le(20554),mn=Le(82326),fi=Le(18287),Vn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAtFJREFUWEftWL9rU1EYPffFpCCKEEEJVUQHB10qAUHFHwguDg4ORRDq4uDg4CBIJ6GD0D/B3UEFJ5cugjbQChIqokWKClVrFDGIg2B8yZX3Xl/z/O5LzvfyKhTJXV7g/jrfOfc797sx1toCNnAzQ4A51RkymJNA/CcMvpoYhf0xDWtPwqICWEKM+QSYGgojt3Hw3mweFjmD9YlR+N8WAJSdjYwBrAWCb1oL+jzvMbzSFKoPBgLKAc6dugPbuRDtHzAXgGEMxmjjsXEAYr4MMOw2DcA8wcjWG6g+XOEAZ8c+wNpKtCXZMI+WMn6DJrbsOMQBPtrr9ySM4ZX9LEApkOfd5QBntvvhuhqFswKOz2/wDQWSZ9o0FADLfji5fBTYPwmUduYVMmV+IrLWF2DpFtCcizDTu3hmFeCBKaC4LR2cJpvjMZrwfn8HFm8qATan/bWslWckq6SuTyWcIfi5allrkmsY/DoZSZzanCwQo0REAwTIJf583e9txNIWic9p5E2OCQilZ7BxzY/8L60RSqRkcgnHqKXERgFw5eq/80EagIbB91cSPigilMabNWmYD6okXr7cZdABIAE7Gv6dpfIuZxJDI/G7S32ymJx6CoDP50ny5mIXIJPQ2Y8kEVVEw+DSeCKLWbkldlQA6JZwaZe9BuDr8xkAZjU6Pp5LvHiu9xmkWej6Wt8KXOK1VuGDL89272IaMLv6yAID3cUvzvS5SZyQyZOAZZl7hrnEz0/rjZoxzAhOyUEOcOFEH6MWhDGCWAApPs8B1o/p68GsANgbRVVRPzu8fvVg5gA0xcLTsV/wCtF/iKz6cABkfBfL+Z12m0tc2/cWXnFPODf3zZCxmOj4yxzg/O4qWv48LDwHIHOZrO/i5HoGHRQ3HeEAg0m1ShWtn/dh27tgUAilTqOUMcyqm7AfbZjCR5Q2j+N4o64DOMDhXq8pQ4B5mdzwDP4B5kHmZrL/eyAAAAAASUVORK5CYII=",si="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAA4RJREFUWEftWEtrE1EYPXfSh5VWSlMfNSi4sokLK30pWtuKIChVVBBBWpfiRhcKghii7tp/4FrBBxREXbhQ0Bj7gqokahe+kNZWqa21tLGtk7kymY5J79yZL5NUKNLZZHHnzj33fOec+90wzrkHS/hhywBzrM4ygzkSiP+EwTdtPvDJdnDeCI4KgBPEsGGAPYOn8Bq23A7nwiLNYH+bD+rYSwBlloUYAzgH9F/Zo48pyhMoBVdR3ZkVUBpgV9MNcO24sb7OnA6GYtBEa75rbkCYL24wOcxGAPYUhSUXUH3/Cw0wXDUIziuMJYkFc6mluH+GcRSv2UYDfLxJtSWMwiuOUxsUC6Qot2iAD71q8ruZVNgtYFO/+m+yQKKm2UgGAMvU5GTvbqDyClC4LmUMuw+LTFiYdNDC7FdgIASMG57KHGDNdSB/tVyKltIJAESmRHziBmZHgf5WlwBrb6bihFrQmkdpCSDRiiyu+ozgyJzBujtpy1Jiy9XOAPqOuQRY35mKP8qdFvELBFJu1qH1HnUL8K59iV0DFtwqc3PPIQnAH+3noGmXAK1k4YnhxoaS8joqQgFYOaBUAlBSedbTIgCcuLwBc78+SW3qWnJUzkjG8/yAZ3Nqd937BYDfghvB4x+NQJ5vAMycozRvOVOF+Rk1FaVAkQEquX73PkmJh89EwXngn5+5dhsuPgwopYYZu/ZKAA6dDkLTQhaAlhKLDAsvuJWE+X5RDbCi1jBjpEkCcPCsH4mpmKXEVIksbZiAkDxz5zWZVwaUnjS6pkiDTcx8aI2CscCCRtStJqmjzKmtLD8FeLxAZKcNwPcnguCJ0II1SAYERJSJnUxX0gysagbC2+0YbPNDnY79rZrk6LR+n0DkRsP5a4GK80C4xuEkeXswCvCAfaOawV3E1K2+DGUaUeO+i4AlB9NpeX0gCGihpA6zeahcpBB7W4Bo0IHBgSN+zP2MGVuX1ZiihHKJOC5IpMAHfH7gAFAfetUYBUcgGwIXZc73d0BixqEffNGQ5mYi1yjCSFdLKhIfA6ZHHQBGm/2YmYpJ2bAEN4nAmVRZjKmzwOQQcWnq3focnNdTBwV9n88yhuKj95xb/i5/HdSpRwBbmfpXIRPTCIS5ycF0U3o8O+g7SWR9FebiHeCJXQArkNdKYIiqODXO2G9A6cCeiRANcFEsmf1HlgFmz50xc8kz+AfHHTJwrKNsNwAAAABJRU5ErkJggg==",Di="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAABWlJREFUWEftV1tsVEUY/ubspUu3W9mWGlttwXqJVRNBbqIFDbyA8mCCkAYtpEaIGBODhBCECiG+UE1EnzTempYqtSAE45saBMX40JC0IRojpd1GKM1uW7bd7V7OOWPmnD3bPTNndxYbE2I6L2dzdubMN9/3/ZchlFIXbuNB5gDOUp05BmdJIP4fDPZcxt2xaRzVgadBUQ3QDDEE5m/2zBkE1whwoYTg461LcX42LEoZZOCiMXoJoBUCHEIASgH2dBqUgijKORfBkW3/EqgUYNsPieMAmtj+Fhb2NIfFXvaFnUhCQBlI6wD8dGcBrisEP5V7fft2NuJvKcC9p6PDoLSa7cwTJgKejZj8WjLm93iWSAG2tI+qEsdlvywl6BZPqBByQgpw44fDKskEAQUF+82e5rBrxCvGz7fWZr+XkZ/ZwFTIbgkKel0K8LkPhlW2uLbSh9UNQfh9btGLIrIZ7E7WyDkaf8xYQsX538cwHE4YgKUAnz0WMgC+/EwNSn1uR5MVEcxZ/xbjUgbyi3PXDNNLAW44FjIk3rOxNpvtCseuCEFCMGcUc/2734YMFaQA178fUhlDB56vy+4s27AYlgrOocA7Z0IG60UDPLypLm8BEQBncnc2X3ITijng4ZMhM8vK+kHGIIuyI5sXZgsGn//ECmOvgMJ8rgA5/f92T8hM8rkAX/psZI+u4yClesAWhhLNhPTBpSMhfeSkF7eLoP5OHzY8FoSizGzU+vWQmXosgLvPTNTGJpNXi8lvPF4hPwoZW0YZsKw+gMWLSrMV1ASYE8V7e27WTUwnB7IzsrFVjOXzdDVWOpfgY+YO+j3YvKrCWMEkP9g9ZHjeJvErnaN9oHhYgCSrYQ5F2echKPcpSGkUE9PU3vXkMeWWJxcg6HcZAA+cGDIosgHc0THaqun0EN8ViFFqdij5SlTT8jKsa5gHJdPF/DaQwCcXotkCme+8y+/zY1m937D/W19yHmSs7eoeb0gm0v1Wi2QBEGpuAcm8buCjF6tmWqyMHPu/iWAkahQlseZm0lKw1I2mRlPm/V2D9iCxZG1pH+2j4GR2KB1lJaaE8TSTUDf88kiNB2sfKsWCMgWlXgVVARfG4xp+/iuBU72xmca7gGW2NlYaMu/vYgxyaYaBbGkPt+pUP5Trw1xGa4Nu7FhdjkULPBlDUwxGVLgVgsFIGj/+MY0rYdXwzzwvQTzFOiDHi4Fj9K14wI+V9/uxr3PQuZLs6hxviKnpfttVI+fERzdVoPoOsWmYiGt4ozsCncnFA+JeFGp0KwJuNK+pwL6OPBKzYzV/npHZoZN/74UK3OUAMJ7S8VpXBJoRsPYgEhBLskLzmkq0nR7OX+q2t4fNaHYYtUEXdq4O4N6MxGzKnzfSiExpqJnvRm8oiYtXkhiJasZqj8vMMCqzaebAsvbsiQf9OHXxRv5+kEXzZFzvt+5qgiQEmO8jhseSGjAW0w0wJW7g8Tovnqovgb+EGO+XLvTCRYBITEd3bxy/DqREQrnmojLgRt/VMaN7z9ssNLeP94GPZotR2d2CECy5x40315XZNIgldbz61U15aSLASHgSqqblB9hyfKpV07WMzHaXi3lS3NPrAnav9ePRGjOgVI3i5KUEvrucEm6HfFix2h6dnMbNqen8AHd1pxpiyWS/mS0lYSncj2cWVJURBHwEI1Ed8VQ+8sSoSasqro9OFL40beuM/UIpXSnczvjbF387484jK+VODDL/3QiPny3YsG7vGFsRT+rfE5BSC6QjB7IWWfY/91FrrwRRV0k76i2fhhcnk2obqN4IQrxOAGWevEV8UIiS1iltO/t69SEpQHnI/bcz5gDOlt/bnsF/AOXAMnuF/cdAAAAAAElFTkSuQmCC",Ni="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAABpxJREFUWAntWE2IHFUQrtfzk5nNbrKbRGPcRSU/oIEkmERjMAQhCBIjKBpFEBER9OZNL4IevOhFbyGHRA9BhKBeouJFIkTNwaxGg16ikN1k0WR3M5ndnf/ptr56r7p7+s1mkYCHkILpev1e1VdfVb3X0zNEt+Qmr4Dpl9+xs9FYq0XvR0SPUETriC9WYI6x72YML0T0By99Gxj68KWd5k/ndEPKiwRy7RadZSKrDEdDVGiRxfnZ9YjJM1MTUScydIwn371Roh7BD042P2Hg5xHRxRON+6R6WlE7m1wzGRjT4ZnTjNOFjQkYIbQ68UlGURhSYIIpTu7k6N7CkWeN6XoE3zoxP8WMuK22kemG6ngxel4CWQeubpw1AmQrkFpnyx9HVg/uy8MuLbPV5uJ7DuloUDhlA8hWSAxS8SSEZy6zi152V2pX3/YJzjVlH8EtYkTDUaAhOobuJ0vZL7XuJWzoKY9gtd6JY5eKAQ0PFOL7/2NQqbWp0eKNCjFmk0fQVsvQ2Opl9Pj2NZQPeGdnWpu5jbtu68zA2uV4QsIll+sAdPigfPXzNF2cafKBCo1HUFF2bRiikQEmx/If9042H49vdm9qTKsDenD9EE1O263mbaaDhy7FeWf3jBe5F5mXe5+b+gyFhiy17rWKK+NVcGQ5ppRjpheZW680/oQQSy5LAiSmGHGpPYKyB/WUZnurvFUDJD32eodFJQXjrGAN4nQ2Hq/4BGHsgtrHChKxAH38BT6+wED8LUCOt/CejSW6czhPF2badPqvJoUO2/o4ew0Y+yaE+xBkVwkEniBrd5KScEsOnwNo1TCjY5fQ6/uG6b51RXWlLWMNOvxdNaZD/J2GEKLF340dP+xZe0xjCPBxQTmIjqHtx67DRIiKDTuDUMb+3jsKPeQQYufdJRrjaiqezR/xgKGYVgM/5ItHEJZog22FHSuCEOZ1DQAbjPvZryz1gWYeQ2XMW0ahBOEYrPFhuFhjDDuvxWBtATi4GCUat7Ls5j0DVwW8tYyOeNBUa4Z0/nLbJQ8QJGu1XlMvd2LnoaQN4NQryBxi9YbbCrRpbYGa7Yh+mWzS7EKXxlbl6ZWHV9DalTn6+twC7V5f4q/LHE3Pd+nIqSrV2VYF1dfvd8xl97yts1o7/eLRf7B1RbSWCaSd5zdmem3vCtrFwVVanYjOTDTpgXuW0e9TLfr4hzmaWQhlew4WDc01JbwUfTF8zGtM4GLcp4JYSiRLDisHtg70kMNcMW+kWsfPzNOJX2uYEkELQQ6CVwCQcK8C8ThNGHYaE9ojCAPZu6xxOBEAGqLjvZvKdqLPFb7qn11WcjEhDNheW6b40BAsewR1EQYIJKApB8ytkJMIC1/WDuX8STfjYJIK4fWfA+BngIiOEdSJ9ywAAQAJmBvrhM5NzCbvjAqk+mKlI4kJDjuoRuI6hsYHotreKTNoe8I9grZmzkDqx4YwFgerPxtfYGAXwSLLFXMHdwzS09uXU6nAGFwe+ZpEmVJjzOm8aqwLpNM69vqx9ck337G8AML8BTsQQKHNL7CX50KavNqljbfnaYDfuiHnptr03jfX6O9qSAe2DNCjm8s034hocrbLEIa2jRVp22iRupxXpY7kBK1HG7wcY4a1EHerMqmXFz6aZW9bHWTBCbmHaTLGHATrq5YbarSJai2usbMt86+EJ7aW6bHNJZq61qU5JrplNPnp8OlPNfryHL8xS1/QFRsPsBg5eMH3WyzRYcJ5S0ZWy5grqho/cjG+WjdU51+/adsG3x8fb9AbX1TlEZMmx8D0zP1ld9A4TioeyTcvYoOWxfcJCrEcB0T3Edhqm5clvtg4TRLjGX4c/jblH6h8ztCawRwFjI1tBI0PyKoW4nzvPWZ03zE7tgGhRMf1tx2xPHt6wlNI2a0b/g/k/BV9hgiUXOq8HS5ei43iPSQJ8r6xiVocv4JBwJ79K5WtEOx0Tny0XdD8QfXPT0f0+dmWvKWAHfbqoe8b1MafGpKN0xiLn2r2z+X0GS6JyeW5o5VmPhfIW2b2y5xduDh44CABFqhUBa9nP1xGWw1dqoRUcy8M6JD6CF7mVLbDqOW1uF5vjpeK+YfEYQkCWYYZc4HQyxU+6Veqeme1Jpuc4t4CNFqdcY9g1yzbX2/WL+QCM9QLhzstl90/S1fUdg2FgWQT6EVLbNHpThjNhaa8Hz6e7DgcFVbPTxwNcrk9JgqH9bBkCWYDZPh7uNmWanuhVfhIVaIwOjUzeNfLZ141XPdbcpNX4F/ikyqlsA/6bwAAAABJRU5ErkJggg==",yr={ruleCheckBox:"ruleCheckBox___Onj2f",folderAreaWrapper:"folderAreaWrapper___ut2mr",folderAreaHeader:"folderAreaHeader___fOIDA",folderWrapper:"folderWrapper___IpJ50",folderIcon:"folderIcon___zBoRM",shareFolderIcon:"shareFolderIcon____5s3p",treeNodeItem:"treeNodeItem___quqla",treeNodeDifficulty:"treeNodeDifficulty___en0gk"},zt=Le(46722),Mt=Object.defineProperty,_t=Object.defineProperties,fn=Object.getOwnPropertyDescriptors,Ji=Object.getOwnPropertySymbols,mi=Object.prototype.hasOwnProperty,$i=Object.prototype.propertyIsEnumerable,xn=(nn,Ht,Fn)=>Ht in nn?Mt(nn,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):nn[Ht]=Fn,ni=(nn,Ht)=>{for(var Fn in Ht||(Ht={}))mi.call(Ht,Fn)&&xn(nn,Fn,Ht[Fn]);if(Ji)for(var Fn of Ji(Ht))$i.call(Ht,Fn)&&xn(nn,Fn,Ht[Fn]);return nn},sr=(nn,Ht)=>_t(nn,fn(Ht)),br=(nn,Ht,Fn)=>new Promise((Wi,Si)=>{var _i=oi=>{try{Ln(Fn.next(oi))}catch(ur){Si(ur)}},Pi=oi=>{try{Ln(Fn.throw(oi))}catch(ur){Si(ur)}},Ln=oi=>oi.done?Wi(oi.value):Promise.resolve(oi.value).then(_i,Pi);Ln((Fn=Fn.apply(nn,Ht)).next())});const Yn=(nn,Ht,Fn)=>nn.map(Wi=>Wi.key===Ht?ni(ni({},Wi),Fn):Wi.children?sr(ni({},Wi),{children:Yn(Wi.children,Ht,Fn)}):Wi),at={\u7B80\u5355:1,\u9002\u4E2D:2,\u56F0\u96BE:3},Bt=(nn,Ht,Fn)=>nn.map(Wi=>{var Si;const _i=Wi==null?void 0:Wi.tag_disciplines.map(Ln=>{const oi=Ln==null?void 0:Ln.difficulty_count.map(ur=>({label:ur==null?void 0:ur.name,value:at[ur.name]}));return{title:ze(Ht)===rn.All&&oi.length>0?le.createElement(ct.Z,{justify:"space-between"},le.createElement(qt.Z,null,`${Ln.name}\uFF08${Ln.child_count}\uFF09`),le.createElement(qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(bt.default.Item,{noStyle:!0,name:[`${Wi.id}_${Ln.id}`,"diffValue"]},le.createElement(Sn.default.Group,{style:{columnGap:12},options:oi})),le.createElement(bt.default.Item,{noStyle:!0,name:[`${Wi.id}_${Ln.id}`,"diffNum"],initialValue:Ln==null?void 0:Ln.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(bt.default.Item,{noStyle:!0,name:[`${Wi.id}_${Ln.id}`,"extra"],initialValue:sr(ni({},Wi),{type:Fn})},le.createElement("input",{type:"hidden"})))):`${Ln.name}\uFF08${Ln.child_count}\uFF09`,key:`${Wi.id}_${Ln.id}`,name:Ln.name,parentName:Wi.name,item_banks_count:Ln.child_count,icon:null,isLeaf:!0,checkable:ze(Ht)===rn.FileFolderAndKnowledge,disableCheckbox:Ln.child_count===0}}),Pi=Wi==null?void 0:Wi.difficulty_count.map(Ln=>({label:Ln==null?void 0:Ln.name,value:at[Ln.name]}));return{title:ze(Ht)===rn.FileFolderAndDiff&&Pi.length>0?le.createElement(ct.Z,{justify:"space-between"},le.createElement(qt.Z,null,`${Wi.name}\uFF08${Wi.item_banks_count}\uFF09`),le.createElement(qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(bt.default.Item,{noStyle:!0,name:[`${Wi.id}`,"diffValue"]},le.createElement(Sn.default.Group,{style:{columnGap:12},options:Pi})),le.createElement(bt.default.Item,{noStyle:!0,name:[`${Wi.id}`,"diffNum"],initialValue:Wi==null?void 0:Wi.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(bt.default.Item,{noStyle:!0,name:[`${Wi.id}`,"extra"],initialValue:sr(ni({},Wi),{type:Fn})},le.createElement("input",{type:"hidden"})))):`${Wi.name}\uFF08${Wi.item_banks_count}\uFF09`,key:`${Wi.id}`,name:Wi.name,item_banks_count:Wi.item_banks_count,icon:Ln=>Ln.expanded?Fn==="0"?le.createElement("img",{src:si,className:yr.folderIcon}):le.createElement("img",{src:Di,className:yr.shareFolderIcon}):Fn==="0"?le.createElement("img",{src:Vn,className:yr.folderIcon}):le.createElement("img",{src:Ni,className:yr.shareFolderIcon}),isLeaf:!Wi.have_child&&!((Si=Wi.tag_disciplines)!=null&&Si.length),checkable:ze(Ht)===rn.OnlyFileFolder,disableCheckbox:Wi.item_banks_count===0,children:Wi.children.length?ze(Ht)===rn.All||ze(Ht)===rn.FileFolderAndKnowledge?[...Bt(Wi.children,Ht,Fn),..._i]:Bt(Wi.children,Ht,Fn):[]}}),Kn=(nn,Ht,Fn)=>nn.map(Wi=>{var Si;const _i=Wi==null?void 0:Wi.tag_disciplines.map(Ln=>{console.log("tagItem:",Ln);const oi=Ln==null?void 0:Ln.difficulty_count.map(ur=>({label:ur==null?void 0:ur.name,value:at[ur.name]}));return{title:ze(Ht)===rn.All&&oi.length>0?le.createElement(ct.Z,{justify:"space-between"},le.createElement(qt.Z,null,`${Ln.name}\uFF08${Ln.child_count}\uFF09`),le.createElement(qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(bt.default.Item,{noStyle:!0,name:[`${Wi.id}_${Ln.id}`,"diffValue"]},le.createElement(Sn.default.Group,{style:{columnGap:12},options:oi})),le.createElement(bt.default.Item,{noStyle:!0,name:[`${Wi.id}_${Ln.id}`,"diffNum"],initialValue:Ln==null?void 0:Ln.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(bt.default.Item,{noStyle:!0,name:[`${Wi.id}_${Ln.id}`,"extra"],initialValue:sr(ni({},Wi),{type:Fn})},le.createElement("input",{type:"hidden"})))):`${Ln.name}\uFF08${Ln.child_count}\uFF09`,key:`${Wi.id}_${Ln.id}`,name:Ln.name,parentName:Wi.name,item_banks_count:Ln.child_count,icon:null,isLeaf:!0,checkable:ze(Ht)===rn.FileFolderAndKnowledge,disableCheckbox:Ln.child_count===0}}),Pi=Wi==null?void 0:Wi.difficulty_count.map(Ln=>({label:Ln==null?void 0:Ln.name,value:at[Ln.name]}));return{title:ze(Ht)===rn.FileFolderAndDiff&&Pi.length>0?le.createElement(ct.Z,{justify:"space-between"},le.createElement(qt.Z,null,`${Wi.name}\uFF08${Wi.item_banks_count}\uFF09`),le.createElement(qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(bt.default.Item,{noStyle:!0,name:[`${Wi.id}`,"diffValue"]},le.createElement(Sn.default.Group,{style:{columnGap:12},options:Pi})),le.createElement(bt.default.Item,{noStyle:!0,name:[`${Wi.id}`,"diffNum"],initialValue:Wi==null?void 0:Wi.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(bt.default.Item,{noStyle:!0,name:[`${Wi.id}`,"extra"],initialValue:sr(ni({},Wi),{type:Fn})},le.createElement("input",{type:"hidden"})))):`${Wi.name}\uFF08${Wi.item_banks_count}\uFF09`,key:`${Wi.id}`,name:Wi.name,item_banks_count:Wi.item_banks_count,icon:Ln=>Ln.expanded?Fn==="0"?le.createElement("img",{src:si,className:yr.folderIcon}):le.createElement("img",{src:Di,className:yr.shareFolderIcon}):Fn==="0"?le.createElement("img",{src:Vn,className:yr.folderIcon}):le.createElement("img",{src:Ni,className:yr.shareFolderIcon}),isLeaf:!Wi.have_child&&!((Si=Wi.tag_disciplines)!=null&&Si.length),checkable:ze(Ht)===rn.OnlyFileFolder,disableCheckbox:Wi.item_banks_count===0,children:[...Kn(Wi.children,Ht,Fn),..._i]}});var Qt=({ruleValue:nn,defaultData:Ht,setSelectData:Fn,currentItemType:Wi,selectData:Si})=>{const[_i,Pi]=(0,le.useState)("1"),[Ln,oi]=(0,le.useState)(!0),[ur]=bt.default.useForm(),[Nr,yo]=(0,le.useState)([]),[ea,La]=(0,le.useState)("all"),ga=(ut,dr,lr)=>{const{checkedNodes:gr}=dr;console.log("type:",lr,gr,Si),lr==="0"?(Dr(ut),ze(nn)===rn.OnlyFileFolder?(Fn(Qi=>sr(ni({},Qi),{my:gr.map(Jn=>({id:Jn.key,group_id:Jn.key,group_name:Jn.name,item_bank_num:Jn.item_banks_count,folderType:"0",quanlity:1}))})),Re(gr.reduce((Qi,Jn)=>Qi+Jn.item_banks_count,0))):(console.log(gr),Fn(Qi=>sr(ni({},Qi),{my:gr.map(Jn=>{const[Fr,Br]=Jn.key.split("_");return{id:Jn.key,tag_discipline_name:Jn.name,group_id:Fr,tag_discipline_id:Br,folderType:"0",group_name:Jn.parentName,item_bank_num:Jn.item_banks_count,quanlity:1}})})),Re(gr.reduce((Qi,Jn)=>Qi+Jn.item_banks_count,0)))):(ta(ut),ze(nn)===rn.OnlyFileFolder?Fn(Qi=>(console.log("pre:",Qi),sr(ni({},Qi),{public:gr.map(Jn=>({id:Jn.key==="0"?"00":Jn.key,teacher_group_name:Jn.name,teacher_group_id:Jn.key,folderType:"3",item_bank_num:Jn.item_banks_count,quanlity:1}))}))):Fn(Qi=>sr(ni({},Qi),{public:gr.map(Jn=>{const[Fr,Br]=Jn.key.split("_");return{id:Jn.key==="0"?"00":Jn.key,tag_discipline_name:Jn.name,teacher_group_id:Fr,tag_discipline_id:Br,folderType:"3",teacher_group_name:Jn.parentName,item_bank_num:Jn.item_banks_count,quanlity:1}})})),Re(gr.reduce((Qi,Jn)=>Qi+Jn.item_banks_count,0)))},[bo,Dr]=(0,le.useState)([]),[or,ta]=(0,le.useState)([]),[sa,Ta]=(0,le.useState)([]),[Ga,Oo]=(0,le.useState)([]),[pa,Lo]=(0,le.useState)([]),[Ir,Ba]=(0,le.useState)([]),[ra,Uo]=(0,le.useState)(!1),[_o,oa]=(0,le.useState)(!1);function Ua(){return br(this,null,function*(){let ut=yield(0,ne.ZP)("/api/teach_group_shares.json",{method:"get"});ut&&yo(ut==null?void 0:ut.groups)})}(0,le.useEffect)(()=>{Ua()},[]);const pt=ut=>br(void 0,null,function*(){var dr,lr,gr,Qi,Jn,Fr,Br,Zr,mr,Po,Ki,Ei;ut.type==="0"?Uo(!0):oa(!0);const bi=yield(0,zt.ex)(ut);ut.type==="0"?Uo(!1):oa(!1),ut.type==="0"?Lo(bi):Ba(bi);const Jr=(dr=bi.navigation[0])==null?void 0:dr.difficulty_count.map(Mr=>({label:Mr==null?void 0:Mr.name,value:at[Mr.name]})),Ur=(lr=bi.navigation[0])==null?void 0:lr.tag_disciplines.map(Mr=>{const Fo=Mr==null?void 0:Mr.difficulty_count.map(vr=>({label:vr==null?void 0:vr.name,value:at[vr.name]}));return{title:ze(nn)===rn.All&&Fo.length>0?le.createElement(ct.Z,{justify:"space-between",style:{color:"#232B40"}},le.createElement(qt.Z,null,`${Mr.name}\uFF08${Mr.child_count}\uFF09`),le.createElement(qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(bt.default.Item,{noStyle:!0,name:[`0_${Mr.id}`,"diffValue"]},le.createElement(Sn.default.Group,{style:{columnGap:12},options:Fo})),le.createElement(bt.default.Item,{noStyle:!0,name:[`0_${Mr.id}`,"diffNum"],initialValue:Mr==null?void 0:Mr.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(bt.default.Item,{noStyle:!0,name:[`0_${Mr.id}`,"extra"],initialValue:{tag_discipline_name:Mr.name,name:"\u6839\u76EE\u5F55",type:ut.type}},le.createElement("input",{type:"hidden"})))):le.createElement("span",{style:{color:"#232B40"}},Mr.name,"\uFF08",Mr.child_count,"\uFF09"),key:`0_${Mr.id}`,name:Mr.name,parentName:"\u6839\u76EE\u5F55",item_banks_count:Mr.child_count,icon:null,isLeaf:!0,checkable:ze(nn)===rn.FileFolderAndKnowledge,disableCheckbox:Mr.child_count===0}});if(ut.type==="0"){const Mr=Bt(bi.data,nn,"0"),Fo=Kn(bi.data,nn,"0");console.log("normalChildren2:",Fo),Ta([{title:ze(nn)===rn.FileFolderAndDiff?le.createElement(ct.Z,{justify:"space-between",style:{color:"#232B40"}},le.createElement(qt.Z,null,`\u6839\u76EE\u5F55\uFF08${(gr=bi.navigation[0])==null?void 0:gr.child_count}\uFF09`),le.createElement(qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(bt.default.Item,{noStyle:!0,name:["0","diffValue"],initialValue:[]},le.createElement(Sn.default.Group,{style:{columnGap:12},options:Jr})),le.createElement(bt.default.Item,{noStyle:!0,name:["0","diffNum"],initialValue:(Qi=bi.navigation[0])==null?void 0:Qi.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(bt.default.Item,{noStyle:!0,name:["0","extra"],initialValue:{type:"0",group_id:"0",name:"\u6839\u76EE\u5F55"}},le.createElement("input",{type:"hidden"})))):le.createElement("span",{style:{color:"#232B40"}},`\u6839\u76EE\u5F55\uFF08${(Jn=bi.navigation[0])==null?void 0:Jn.child_count}\uFF09`),key:"0",name:"\u6839\u76EE\u5F55",item_banks_count:(Fr=bi.navigation[0])==null?void 0:Fr.child_count,disabled:!(((Br=bi.navigation[0])==null?void 0:Br.child_count)>0),checkable:ze(nn)===rn.OnlyFileFolder,icon:vr=>vr.expanded?le.createElement("img",{src:si,className:yr.folderIcon}):le.createElement("img",{src:Vn,className:yr.folderIcon}),isLeaf:!1,children:ze(nn)===rn.OnlyFileFolder||ze(nn)===rn.FileFolderAndDiff?Mr:[...Fo,...Ur]}])}else{const Mr=Bt(bi.data,nn,"3");Oo([{title:ze(nn)===rn.FileFolderAndDiff?le.createElement(ct.Z,{justify:"space-between"},le.createElement(qt.Z,null,`\u6839\u76EE\u5F55\uFF08${(Zr=bi.navigation[0])==null?void 0:Zr.child_count}\uFF09`),le.createElement(qt.Z,null,le.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(bt.default.Item,{noStyle:!0,name:["0","diffValue"]},le.createElement(Sn.default.Group,{style:{columnGap:12},options:Jr})),le.createElement(bt.default.Item,{noStyle:!0,name:["0","diffNum"],initialValue:(mr=bi.navigation[0])==null?void 0:mr.difficulty_count},le.createElement("input",{type:"hidden"})),le.createElement(bt.default.Item,{noStyle:!0,name:["0","extra"],initialValue:{type:"3",group_id:"0",name:"\u6839\u76EE\u5F55"}},le.createElement("input",{type:"hidden"})))):le.createElement("span",{style:{color:"#232B40"}},`\u6839\u76EE\u5F55\uFF08${(Po=bi.navigation[0])==null?void 0:Po.child_count}\uFF09`),key:"0",name:"\u6839\u76EE\u5F55",item_banks_count:(Ki=bi.navigation[0])==null?void 0:Ki.child_count,checkable:ze(nn)===rn.OnlyFileFolder,icon:Fo=>Fo.expanded?le.createElement("img",{src:Di,className:yr.shareFolderIcon}):le.createElement("img",{src:Ni,className:yr.shareFolderIcon}),isLeaf:!1,disabled:!(((Ei=bi.navigation[0])==null?void 0:Ei.child_count)>0),children:ze(nn)===rn.OnlyFileFolder||ze(nn)===rn.FileFolderAndDiff?Mr:[...Mr,...Ur]}])}});(0,le.useEffect)(()=>{_i==="1"?pt({type:"0",group_id:0,item_type:Wi,show_children:!0}):_i==="2"&&pt({type:"3",except_mine:!0,item_type:Wi,show_children:!0,teach_group_id:ea==="all"?"":ea})},[nn,_i,ea]),(0,le.useEffect)(()=>{var ut,dr,lr,gr,Qi,Jn,Fr,Br,Zr,mr,Po,Ki;console.log("selectData-active:",Si,Ht,_i),_i==="1"?(Dr((ut=Si==null?void 0:Si.my)==null?void 0:ut.map(Ei=>Ei.id)),Re(((lr=(dr=Si==null?void 0:Si.my)==null?void 0:dr.reduce)==null?void 0:lr.call(dr,(Ei,bi)=>Ei+bi.item_bank_num,0))||0)):_i==="2"&&(ta((gr=Si==null?void 0:Si.public)==null?void 0:gr.map(Ei=>Ei.id)),Re(((Jn=(Qi=Si==null?void 0:Si.public)==null?void 0:Qi.reduce)==null?void 0:Jn.call(Qi,(Ei,bi)=>Ei+bi.item_bank_num,0))||0)),ze(nn)===rn.All&&(_i==="1"?(Dr((Fr=Si==null?void 0:Si.my)==null?void 0:Fr.map(Ei=>Ei.id)),Re((Si==null?void 0:Si.filter(Ei=>!Ei.is_share).reduce((Ei,bi)=>Ei+bi.item_bank_num,0))||0),(Br=Si==null?void 0:Si.filter(Ei=>!Ei.is_share))==null||Br.forEach(Ei=>{const bi=ur.getFieldValue([`${Ei.group_id||0}_${Ei.tag_discipline_id}`,"diffValue"])||[];console.log("prev:",bi),bi!=null&&bi.includes[Ei.difficulty]||ur.setFieldValue([`${Ei.group_id||0}_${Ei.tag_discipline_id}`,"diffValue"],Array.from(new Set([...bi,Ei.difficulty])))})):_i==="2"&&(ta((Zr=Si==null?void 0:Si.public)==null?void 0:Zr.map(Ei=>Ei.id)),Re((Si==null?void 0:Si.filter(Ei=>!!Ei.is_share).reduce((Ei,bi)=>Ei+bi.item_bank_num,0))||0),(mr=Si==null?void 0:Si.filter(Ei=>!!Ei.is_share))==null||mr.forEach(Ei=>{const bi=ur.getFieldValue([`${Ei.teacher_group_id||0}_${Ei.tag_discipline_id}`,"diffValue"])||[];bi!=null&&bi.includes[Ei.difficulty]||ur.setFieldValue([`${Ei.teacher_group_id||0}_${Ei.tag_discipline_id}`,"diffValue"],Array.from(new Set([...bi,Ei.difficulty])))}))),ze(nn)===rn.FileFolderAndDiff&&(ur.resetFields(),setTimeout(()=>{Fn(Si)},300),_i==="1"?(Re((Si==null?void 0:Si.filter(Ei=>!Ei.is_share).reduce((Ei,bi)=>Ei+bi.item_bank_num,0))||0),(Po=Si==null?void 0:Si.filter(Ei=>!Ei.is_share))==null||Po.forEach(Ei=>{const bi=ur.getFieldValue([`${Ei.group_id}`,"diffValue"])||[];console.log("prev:",bi),bi!=null&&bi.includes[Ei.difficulty]||ur.setFieldValue([`${Ei.group_id}`,"diffValue"],Array.from(new Set([...bi,Ei.difficulty])))})):(Re((Si==null?void 0:Si.filter(Ei=>!!Ei.is_share).reduce((Ei,bi)=>Ei+bi.item_bank_num,0))||0),(Ki=Si==null?void 0:Si.filter(Ei=>!!Ei.is_share))==null||Ki.forEach(Ei=>{const bi=ur.getFieldValue([`${Ei.teacher_group_id}`,"diffValue"])||[];bi!=null&&bi.includes[Ei.difficulty]||ur.setFieldValue([`${Ei.teacher_group_id}`,"diffValue"],Array.from(new Set([...bi,Ei.difficulty])))})))},[_i]),console.log("1111111111:",bo,or),(0,le.useEffect)(()=>{setTimeout(()=>{var ut,dr,lr,gr,Qi;switch(ze(nn)){case rn.OnlyFileFolder:{const Jn=[],Fr=[];for(const Br of Si.my||[])Jn.push(Br);for(const Br of Si.public||[])Fr.push(Br);Dr(Jn.map(Br=>`${Br.group_id}`)),ta(Fr.map(Br=>`${Br.teacher_group_id}`)),Re(_i==="1"?Jn.reduce((Br,Zr)=>Br+Zr.item_bank_num,0):Fr.reduce((Br,Zr)=>Br+Zr.item_bank_num,0));break}case rn.FileFolderAndKnowledge:{const Jn=[],Fr=[];for(const Br of(Si==null?void 0:Si.my)||[])Jn.push(Br);for(const Br of(Si==null?void 0:Si.public)||[])Fr.push(Br);Re((ut=_i==="1"?Jn:Fr)==null?void 0:ut.reduce((Br,Zr)=>Br+Zr.item_bank_num,0)),Dr(Jn.map(Br=>`${Br.group_id}_${Br.tag_discipline_id}`)),ta(Fr.map(Br=>`${Br.teacher_group_id}_${Br.tag_discipline_id}`));break}case rn.All:{_i==="1"?(Re((Si==null?void 0:Si.filter(Jn=>!Jn.is_share).reduce((Jn,Fr)=>Jn+Fr.item_bank_num,0))||0),(dr=Si==null?void 0:Si.filter(Jn=>!Jn.is_share))==null||dr.forEach(Jn=>{const Fr=ur.getFieldValue([`${Jn.group_id||0}_${Jn.tag_discipline_id}`,"diffValue"])||[];console.log("prev:",Fr,Jn.difficulty,Jn),Fr!=null&&Fr.includes[Jn.difficulty]||ur.setFieldValue([`${Jn.group_id||0}_${Jn.tag_discipline_id}`,"diffValue"],Array.from(new Set([...Fr,Jn.difficulty])))})):(Re((Si==null?void 0:Si.filter(Jn=>!!Jn.is_share).reduce((Jn,Fr)=>Jn+Fr.item_bank_num,0))||0),(lr=Si==null?void 0:Si.filter(Jn=>!!Jn.is_share))==null||lr.forEach(Jn=>{const Fr=ur.getFieldValue([`${Jn.group_id||0}_${Jn.tag_discipline_id}`,"diffValue"])||[];console.log("prev:",Fr,Jn.difficulty,Jn),Fr!=null&&Fr.includes[Jn.difficulty]||ur.setFieldValue([`${Jn.group_id||0}_${Jn.tag_discipline_id}`,"diffValue"],Array.from(new Set([...Fr,Jn.difficulty])))}));break}case rn.FileFolderAndDiff:{_i==="1"?(Re((Si==null?void 0:Si.filter(Jn=>!Jn.is_share).reduce((Jn,Fr)=>Jn+Fr.item_bank_num,0))||0),(gr=Si==null?void 0:Si.filter(Jn=>!Jn.is_share))==null||gr.forEach(Jn=>{const Fr=ur.getFieldValue([`${Jn.group_id}`,"diffValue"])||[];console.log("prev:",Fr,Jn.difficulty),Fr!=null&&Fr.includes[Jn.difficulty]||ur.setFieldValue([`${Jn.group_id}`,"diffValue"],Array.from(new Set([...Fr,Jn.difficulty])))})):(Re((Si==null?void 0:Si.filter(Jn=>!!Jn.is_share).reduce((Jn,Fr)=>Jn+Fr.item_bank_num,0))||0),(Qi=Si==null?void 0:Si.filter(Jn=>!!Jn.is_share))==null||Qi.forEach(Jn=>{const Fr=ur.getFieldValue([`${Jn.group_id}`,"diffValue"])||[];Fr!=null&&Fr.includes[Jn.difficulty]||ur.setFieldValue([`${Jn.group_id}`,"diffValue"],Array.from(new Set([...Fr,Jn.difficulty])))}));break}}},800)},[Ht,nn,sa,Ga]);const[Ut,Re]=(0,le.useState)(0);return le.createElement(bt.default,{form:ur,onValuesChange:(ut,dr)=>br(void 0,null,function*(){var lr,gr,Qi,Jn;console.log("onValuesChange:",dr,ut);let Fr=0;if(ze(nn)===rn.FileFolderAndDiff){const Br=yield ur.getFieldValue(),Zr=[],mr=[];for(const Ki of Object.keys(Br))if((gr=(lr=Br[Ki])==null?void 0:lr.diffValue)!=null&&gr.length&&Ki!=="null"&&Ki!==null){const Ei=Br[Ki];Zr.push(ni({id:Ki},Ei))}const Po={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"};Zr.map(Ki=>{var Ei,bi,Jr,Ur,Mr;Ki.id==0&&(Ki.diffNum=_i==="1"?(bi=(Ei=pa==null?void 0:pa.navigation)==null?void 0:Ei[0])==null?void 0:bi.difficulty_count:(Ur=(Jr=Ir==null?void 0:Ir.navigation)==null?void 0:Jr[0])==null?void 0:Ur.difficulty_count),(Mr=Ki==null?void 0:Ki.diffValue)==null||Mr.map(Fo=>{var vr,so,er,Tr,oo;const Go={group_name:((vr=Ki.extra)==null?void 0:vr.name)||"",teacher_group_name:"",id:`${Ki.id}_${Fo}`,group_id:Ki.id,difficulty:Fo,item_bank_num:(Tr=(er=(so=Ki.diffNum)==null?void 0:so.filter(ha=>ha.name===Po[Fo]))==null?void 0:er[0])==null?void 0:Tr.value};_i==="2"&&(Go.is_share=!0,Go.teacher_group_id=Ki.id,Go.teacher_group_name=(oo=Ki.extra)==null?void 0:oo.name),mr.push(Go)})}),Fr=mr.reduce((Ki,Ei)=>Ki+Ei.item_bank_num,0),Fn([...mr,...Si==null?void 0:Si.filter(Ki=>_i==="1"?Ki.is_share:!Ki.is_share)])}else if(ze(nn)===rn.All){const Br=[];for(const Zr of Object.keys(dr)){const{diffNum:mr=[],diffValue:Po=[],extra:Ki={}}=dr[Zr];console.log("---",Ki);const[Ei,bi]=Zr.split("_");let Jr=(Jn=(Qi=Ki.tag_disciplines)==null?void 0:Qi.filter(Ur=>parseInt(Ur.id)===parseInt(bi)))==null?void 0:Jn[0];Po.forEach(Ur=>{var Mr;const Fo={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},vr=(Mr=mr==null?void 0:mr.find(er=>er.name===Fo[Ur]))==null?void 0:Mr.value,so={group_name:"",teacher_group_name:"",tag_discipline_name:(Jr==null?void 0:Jr.name)||Ki.tag_discipline_name,id:`${Zr}_${Ur}`,group_id:Ei,is_share:!!(Jr!=null&&Jr.is_share||(Ki==null?void 0:Ki.type)==="3"),tag_discipline_id:bi,difficulty:Ur,item_bank_num:vr};Fr+=vr,Ki.type==="0"?so.group_name=Ki.name:so.teacher_group_name=Ki.name,_i==="2"&&(so.is_share=!0,so.teacher_group_id=Ki.id||0,so.teacher_group_name=Ki.name),vr>0&&Br.push(so)})}Fn([...Br,...Si==null?void 0:Si.filter(Zr=>_i==="1"?Zr.is_share:!Zr.is_share)])}Re(Fr)})},le.createElement(be.default,{destroyInactiveTabPane:!0,activeKey:_i,onChange:ut=>Pi(ut),style:{minHeight:260},tabBarExtraContent:{right:_i==="2"&&(Nr==null?void 0:Nr.length)>0&&le.createElement(mn.default,{onChange:ut=>{La(ut)},value:ea,style:{width:120}},le.createElement(mn.default.Option,{key:"all",value:"all"},"\u5168\u90E8"),Nr==null?void 0:Nr.map(ut=>le.createElement(mn.default.Option,{key:ut==null?void 0:ut.group_id,value:ut==null?void 0:ut.group_id},ut==null?void 0:ut.name)))},items:[{key:"1",label:"\u6211\u521B\u5EFA\u7684",children:(sa==null?void 0:sa.length)===0?le.createElement(Et.Z,{spinning:ra},le.createElement(zn.Z,{ButtonTwo:le.createElement("a",{target:"_blank",href:"/problemset"},"\u524D\u5F80\u9898\u5E93\uFF0C\u65B0\u589E\u66F4\u591A\u8BD5\u9898",">")})):le.createElement("div",{className:yr.folderAreaWrapper},le.createElement(ct.Z,{justify:"space-between",align:"middle",className:yr.folderAreaHeader},le.createElement("span",null,"\u6587\u4EF6\u5939"),le.createElement("span",{className:"mr20"},"\u5DF2\u9009",le.createElement("span",{style:{color:"#3061D0"}}," ",Ut," "),"\u9898")),le.createElement(Et.Z,{spinning:ra},le.createElement("div",{style:{minHeight:200}},sa.length>0&&le.createElement(fi.default,{checkable:!0,className:yr.folderWrapper,rootStyle:{paddingLeft:15,paddingRight:0,paddingTop:10},selectable:!1,onCheck:(ut,dr)=>ga(ut,dr,"0"),checkedKeys:bo,checkStrictly:!0,treeData:sa,showIcon:!0,blockNode:!0,defaultExpandAll:!0}))))},{key:"2",label:"\u56E2\u961F\u5171\u4EAB",children:(Ga==null?void 0:Ga.length)===0?le.createElement(Et.Z,{spinning:_o},le.createElement(zn.Z,{ButtonTwo:le.createElement("a",{target:"_blank",href:"/problemset"},"\u524D\u5F80\u9898\u5E93\uFF0C\u65B0\u589E\u66F4\u591A\u8BD5\u9898",">")})):le.createElement("div",{className:yr.folderAreaWrapper},le.createElement(ct.Z,{justify:"space-between",align:"middle",className:yr.folderAreaHeader},le.createElement("span",null,"\u6587\u4EF6\u5939"),le.createElement("span",{className:"mr20"},"\u5DF2\u9009",le.createElement("span",{style:{color:"#3061D0"}}," ",Ut||0," "),"\u9898")),le.createElement(Et.Z,{spinning:_o},le.createElement("div",{style:{minHeight:200}},(Ga==null?void 0:Ga.length)>0&&le.createElement(fi.default,{checkable:!0,className:yr.folderWrapper,selectable:!1,rootStyle:{paddingLeft:15,paddingRight:0,paddingTop:10},onCheck:(ut,dr)=>ga(ut,dr,"3"),checkedKeys:or,checkStrictly:!0,treeData:Ga,showIcon:!0,blockNode:!0,defaultExpandAll:!0}))))}]}))},jt=Le(55305),Un=Le(45937),ai=Object.defineProperty,Vi=Object.defineProperties,xi=Object.getOwnPropertyDescriptors,Bi=Object.getOwnPropertySymbols,Ii=Object.prototype.hasOwnProperty,Pr=Object.prototype.propertyIsEnumerable,xr=(nn,Ht,Fn)=>Ht in nn?ai(nn,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):nn[Ht]=Fn,_n=(nn,Ht)=>{for(var Fn in Ht||(Ht={}))Ii.call(Ht,Fn)&&xr(nn,Fn,Ht[Fn]);if(Bi)for(var Fn of Bi(Ht))Pr.call(Ht,Fn)&&xr(nn,Fn,Ht[Fn]);return nn},ki=(nn,Ht)=>Vi(nn,xi(Ht)),Ar=(nn,Ht,Fn)=>new Promise((Wi,Si)=>{var _i=oi=>{try{Ln(Fn.next(oi))}catch(ur){Si(ur)}},Pi=oi=>{try{Ln(Fn.throw(oi))}catch(ur){Si(ur)}},Ln=oi=>oi.done?Wi(oi.value):Promise.resolve(oi.value).then(_i,Pi);Ln((Fn=Fn.apply(nn,Ht)).next())});const Vr={\u7B80\u5355:1,\u9002\u4E2D:2,\u56F0\u96BE:3};var Ot=({ruleValue:nn,setSelectData:Ht,currentItemType:Fn,defaultData:Wi,isFirst:Si})=>{const[_i,Pi]=(0,le.useState)([]),[Ln,oi,ur,Nr]=(0,Un.U)(Qe,{source:"question",page:1,per_page:10,group_id:0,keyword:"",group_type:0,clazz:"ItemBanksGroup",sub_discipline_id:void 0,item_type:Fn,show_children:!0});(0,le.useEffect)(()=>{Ar(void 0,null,function*(){const or=yield ur({},!0);Pi((0,jt.L)(or.disciplines))})},[]),console.log(Wi),(0,le.useEffect)(()=>{if(Si)switch(ze(nn)){case rn.OnlyKnowledge:{bo(Wi.map(or=>or.tag_discipline_id));break}case rn.KnowledgeAndDiff:{const or=new Map;Wi.forEach(ta=>{ta&&(or.has(ta.tag_discipline_id)?or.set(ta.tag_discipline_id,[...or.get(ta.tag_discipline_id),ta.difficulty]):or.set(ta.tag_discipline_id,[ta.difficulty]))});for(const[ta,sa]of or.entries())yo.setFieldValue([ta,"diff"],sa);break}}},[Wi,nn,Si]);const[yo]=bt.default.useForm(),ea=(0,le.useMemo)(()=>{const or=[];let ta="",sa="";const Ta={};for(const Ga of(Nr==null?void 0:Nr.disciplines)||[]){ta=Ga.name;for(const Oo of Ga.sub_disciplines){sa=Oo.name;for(const pa of Oo.tag_disciplines){const Lo={sub_discipline_name:`${ta}&${sa}`,sub_discipline_id:Oo.id,tag_discipline_name:pa.name,id:pa.id,item_bank_num:pa.total_count,difficulty_count:pa.difficulty_count,tag_discipline_id:pa.id};or.push(Lo)}}}return or},[Nr,Wi]),La=[{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline_name",show:!0,render:(or,ta)=>{const{item_bank_num:sa}=ta;return le.createElement("div",null,or,`(${sa})`)}},{title:"\u65B9\u5411&\u8BFE\u7A0B",dataIndex:"sub_discipline_name",ellipsis:!0,show:!0},{title:"\u96BE\u5EA6",width:"35%",show:nn.includes(Pt.Difficulty),render:(or,ta)=>{const{id:sa,difficulty_count:Ta,total_count:Ga,sub_discipline_name:Oo,tag_discipline_name:pa}=ta;return le.createElement(le.Fragment,null,le.createElement(bt.default.Item,{name:[sa,"diff"],noStyle:!0},le.createElement(Sn.default.Group,{style:{columnGap:12},options:Ta.map(Lo=>({label:Lo.name,value:Vr[Lo.name]}))})),le.createElement(bt.default.Item,{name:[sa,"extra"],initialValue:{difficulty_count:Ta,total_count:Ga,sub_discipline_name:Oo,tag_discipline_name:pa},noStyle:!0},le.createElement("input",{type:"hidden"})))}}].filter(or=>or.show),[ga,bo]=(0,le.useState)([]),Dr=(0,le.useRef)(new Map);return le.createElement("div",{style:{marginTop:12}},le.createElement(ct.Z,{className:"mb20",align:"middle",gutter:20},le.createElement(qt.Z,null,le.createElement(We.Z,{placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",size:"large",style:{width:240},options:_i,onChange:or=>{ur({sub_discipline_id:or==null?void 0:or[1]})}})),le.createElement(qt.Z,null,le.createElement(on.t7,{style:{width:300},placeholder:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0\u8FDB\u884C\u641C\u7D22",value:Ln.keyword,onChange:or=>ur({keyword:or})}))),le.createElement(bt.default,{form:yo,onValuesChange:(or,ta)=>{var sa;console.log(ta),Dr.current.clear();for(const Ta of Object.keys(ta)){const Ga={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},Oo=ta[Ta],{difficulty_count:pa,total_count:Lo}=Oo.extra||{};(sa=Oo==null?void 0:Oo.diff)==null||sa.forEach(Ir=>{var Ba;const ra=(Ba=pa==null?void 0:pa.find(_o=>_o.name===Ga[Ir]))==null?void 0:Ba.value,Uo=ki(_n({},Oo.extra),{id:`${Ta}_${Ir}`,difficulty:Ir,item_bank_num:ra,tag_discipline_id:Ta});ra>0&&Dr.current.set(`${Ta}_${Ir}`,Uo)})}Ht([...Dr.current.values()])}},(ea==null?void 0:ea.length)===0?le.createElement(zn.Z,{ButtonTwo:le.createElement("a",{target:"_blank",href:"/problemset"},"\u524D\u5F80\u9898\u5E93\uFF0C\u65B0\u589E\u66F4\u591A\u8BD5\u9898",">")}):le.createElement(Hi.default,{rowSelection:ze(nn)===rn.OnlyKnowledge?{preserveSelectedRowKeys:!0,type:"checkbox",onChange(or,ta){console.log("table-selectedRowKeys:",or,ta),bo(or),Ht(ta)},getCheckboxProps:or=>({disabled:or.item_bank_num===0}),selectedRowKeys:ga}:void 0,columns:La,dataSource:ea,loading:oi,scroll:{y:480},rowKey:"id",pagination:!1})))},Li=Object.defineProperty,Sr=Object.defineProperties,Ri=Object.getOwnPropertyDescriptors,po=Object.getOwnPropertySymbols,Qr=Object.prototype.hasOwnProperty,mo=Object.prototype.propertyIsEnumerable,fo=(nn,Ht,Fn)=>Ht in nn?Li(nn,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):nn[Ht]=Fn,wo=(nn,Ht)=>{for(var Fn in Ht||(Ht={}))Qr.call(Ht,Fn)&&fo(nn,Fn,Ht[Fn]);if(po)for(var Fn of po(Ht))mo.call(Ht,Fn)&&fo(nn,Fn,Ht[Fn]);return nn},Io=(nn,Ht)=>Sr(nn,Ri(Ht)),Bn=(nn,Ht,Fn)=>new Promise((Wi,Si)=>{var _i=oi=>{try{Ln(Fn.next(oi))}catch(ur){Si(ur)}},Pi=oi=>{try{Ln(Fn.throw(oi))}catch(ur){Si(ur)}},Ln=oi=>oi.done?Wi(oi.value):Promise.resolve(oi.value).then(_i,Pi);Ln((Fn=Fn.apply(nn,Ht)).next())});const ca={\u7B80\u5355:1,\u9002\u4E2D:2,\u56F0\u96BE:3};var Er=({open:nn,onCancel:Ht,setVisibleModalType:Fn,currentItemType:Wi})=>{var Si;const{data:_i,dispatch:Pi}=(0,le.useContext)(Nt),[Ln,oi]=(0,le.useState)([]),[ur,Nr]=(0,le.useState)(),yo=(Si=_i==null?void 0:_i.item_types)==null?void 0:Si.find(sa=>sa.item_type===Wi);(0,le.useEffect)(()=>{var sa,Ta,Ga;if(nn){const Oo=(sa=_i==null?void 0:_i.item_types)==null?void 0:sa.find(pa=>pa.item_type===Wi);if((Oo==null?void 0:Oo.random_rule_type)!==rn.Shixun){const pa=ii[Oo==null?void 0:Oo.random_rule_type]||[];oi(pa);const Lo=(Ga=(Ta=_i==null?void 0:_i.item_types)==null?void 0:Ta.find(Ir=>Ir.item_type===Wi))==null?void 0:Ga.contents;switch(console.log("----xxx",ze(pa)),ze(pa)){case rn.OnlyDifficulty:{bo(Lo.map(Ir=>Ir.difficulty));break}case rn.OnlyFileFolder:{bo({my:Lo==null?void 0:Lo.filter(Ir=>parseInt(Ir.teacher_group_id)!=="NaN"&&!Ir.teacher_group_id&&Ir.teacher_group_id!==0),public:Lo==null?void 0:Lo.filter(Ir=>parseInt(Ir.teacher_group_id)>=0)}),Nr({my:Lo==null?void 0:Lo.filter(Ir=>parseInt(Ir.teacher_group_id)!=="NaN"&&!Ir.teacher_group_id&&Ir.teacher_group_id!==0),public:Lo==null?void 0:Lo.filter(Ir=>parseInt(Ir.teacher_group_id)>=0)});break}case rn.FileFolderAndKnowledge:{bo({my:Lo==null?void 0:Lo.filter(Ir=>parseInt(Ir.teacher_group_id)!=="NaN"&&!Ir.teacher_group_id&&Ir.teacher_group_id!==0),public:Lo==null?void 0:Lo.filter(Ir=>parseInt(Ir.teacher_group_id)>=0)}),Nr({my:Lo==null?void 0:Lo.filter(Ir=>parseInt(Ir.teacher_group_id)!=="NaN"&&!Ir.teacher_group_id&&Ir.teacher_group_id!==0),public:Lo==null?void 0:Lo.filter(Ir=>parseInt(Ir.teacher_group_id)>=0)});break}case rn.FileFolderAndDiff:{bo(Lo),Nr(Lo);break}case rn.All:{bo(Lo),Nr(Lo);break}default:bo(Lo)}}}},[nn]);const[ea,La]=(0,le.useState)([]);(0,le.useEffect)(()=>{nn&&Ue({item_type:Wi}).then(sa=>{sa.status===0&&La(sa.data)})},[nn]),(0,le.useEffect)(()=>{console.log("selectData",ur)},[ur]);const[ga,bo]=(0,le.useState)(),[Dr,or]=(0,le.useState)(!0);console.log("isFirst:",Dr);const ta=sa=>{oi(sa),Nr([]),bo([]),or(!1)};return le.createElement(tn.default,{title:"\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219",width:948,closable:!0,centered:!0,open:nn,onCancel:Ht,destroyOnClose:!0,onOk:()=>Bn(void 0,null,function*(){var sa,Ta,Ga,Oo,pa,Lo,Ir;if(ur===void 0){Fn("");return}if(Object.prototype.toString.call(ur)==="[object Object]"&&!((sa=ur.my)!=null&&sa.length)&&!((Ta=ur.public)!=null&&Ta.length)){it.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}if(!Object.keys(ur).length&&!(ur!=null&&ur.length)){it.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}const Ba=ze(Ln);switch(Ba){case rn.OnlyFileFolder:{Pi({type:"editRule",payload:{itemType:Wi,tableData:[...ur.my||[],...ur.public||[]],randomRuleType:Ba}});break}case rn.OnlyDifficulty:{const ra=(Oo=(Ga=_i==null?void 0:_i.item_types)==null?void 0:Ga.find(_o=>_o.item_type===Wi))==null?void 0:Oo.contents;let Uo=[{},{value:(pa=ea.find(_o=>_o.name==="\u7B80\u5355"))==null?void 0:pa.value},{value:(Lo=ea.find(_o=>_o.name==="\u9002\u4E2D"))==null?void 0:Lo.value},{value:(Ir=ea.find(_o=>_o.name==="\u56F0\u96BE"))==null?void 0:Ir.value}];Pi({type:"editRule",payload:{itemType:Wi,tableData:ur.map((_o,oa)=>{var Ua,pt,Ut,Re;return{difficulty:_o,id:oa,quanlity:((pt=(Ua=ra==null?void 0:ra.filter(ut=>ut.id===oa))==null?void 0:Ua[0])==null?void 0:pt.quanlity)||1,item_bank_num:(ea==null?void 0:ea.length)===1?(Ut=ea[0])==null?void 0:Ut.value:(Re=Uo==null?void 0:Uo[_o])==null?void 0:Re.value}}),randomRuleType:Ba}});break}case rn.OnlyKnowledge:{Pi({type:"editRule",payload:{itemType:Wi,tableData:ur.map(ra=>Io(wo({},ra),{quanlity:ra.quanlity||1})),randomRuleType:Ba}});break}case rn.KnowledgeAndDiff:{Pi({type:"editRule",payload:{itemType:Wi,tableData:ur.map(ra=>Io(wo({},ra),{quanlity:ra.quanlity||1})),randomRuleType:Ba}});break}case rn.FileFolderAndDiff:{Pi({type:"editRule",payload:{itemType:Wi,tableData:ur.map(ra=>Io(wo({},ra),{quanlity:ra.quanlity||1})),randomRuleType:Ba}});break}case rn.FileFolderAndKnowledge:{Pi({type:"editRule",payload:{itemType:Wi,tableData:[...ur.my||[],...ur.public||[]],randomRuleType:Ba}});break}case rn.All:{Pi({type:"editRule",payload:{itemType:Wi,tableData:ur.map(ra=>Io(wo({},ra),{quanlity:ra.quanlity||1})),randomRuleType:Ba}});break}}Fn("")})},le.createElement(Sn.default.Group,{className:`${yr.ruleCheckBox}`,style:{marginBottom:8},value:Ln,onChange:sa=>{var Ta;Ln!=null&&Ln.length&&((Ta=yo==null?void 0:yo.contents)==null?void 0:Ta.length)>0?tn.default.confirm({title:"\u63D0\u793A",content:"\u5207\u6362\u89C4\u5219\u540E\uFF0C\u4E4B\u524D\u7684\u62BD\u9898\u914D\u7F6E\u5C06\u88AB\u6E05\u7A7A\uFF01",okText:"\u7ACB\u5373\u5207\u6362",cancelText:"\u6682\u4E0D\u5207\u6362",onOk:()=>ta(sa)}):ta(sa)},options:[{label:"\u6307\u5B9A\u6587\u4EF6\u5939\u62BD\u9898",value:Pt.FileFolder},{label:"\u6307\u5B9A\u96BE\u5EA6\u62BD\u9898",value:Pt.Difficulty},{label:"\u6307\u5B9A\u77E5\u8BC6\u70B9\u62BD\u9898",value:Pt.Knowledge}]}),Ln.includes(Pt.FileFolder)?le.createElement(Qt,{defaultData:ga,selectData:ur,ruleValue:Ln,setSelectData:Nr,currentItemType:Wi}):Ln.includes(Pt.Knowledge)?le.createElement(Ot,{defaultData:ga,isFirst:Dr,ruleValue:Ln,setSelectData:Nr,currentItemType:Wi}):Ln.includes(Pt.Difficulty)?le.createElement("div",{style:{marginTop:12}},le.createElement("span",{className:"mr20",style:{color:"#666"}},"\u96BE\u5EA6"),le.createElement(Sn.default.Group,{style:{columnGap:12},options:ea.map(sa=>({label:sa.name,value:ca[sa.name]})),value:ur||ga,onChange:sa=>Nr(sa)})):null)},wr=({open:nn,onCancel:Ht,setVisibleModalType:Fn,currentItemType:Wi})=>nn?le.createElement(Er,{open:nn,onCancel:Ht,setVisibleModalType:Fn,currentItemType:Wi}):null,Qo=Le(25399),To=Le(58433),ro=Le(82264),fa=Le(76902),Yt=Le(51257),Rn=Le(61485),Rt=Le(94361),qn=({open:nn,onCancel:Ht,onOk:Fn})=>{const{data:Wi}=(0,le.useContext)(Nt),Si=(0,To.g)(),[_i,Pi,Ln,oi]=(0,Un.U)(ro.Gm,{page:1,limit:10,keyword:"",diff:"",shixun_publish_status:"",discipline_id:"",sub_discipline_id:"",type:0,include_shixuns:!0,item_type:"SHIXUN"}),[ur,Nr]=(0,le.useState)(!1);(0,le.useEffect)(()=>{if(nn){Ln({page:1,limit:10,type:0},!0).then(Dr=>{(Dr==null?void 0:Dr.shixuns_count)===0&&Nr(!0)});const bo=Wi.item_types.find(Dr=>Dr.item_type==="PRACTICAL");ea(bo.item_banks.map(Dr=>Dr.id)),ga(bo.item_banks)}},[nn,Wi]);const[yo,ea]=(0,le.useState)([]),[La,ga]=(0,le.useState)([]);return le.createElement(tn.default,{title:"\u9009\u62E9\u5B9E\u8BAD\u9898",open:nn,width:948,centered:!0,closable:!0,onCancel:Ht,onOk:()=>Fn(La),destroyOnClose:!0},le.createElement(ct.Z,{justify:"space-between",className:"mb20",style:{maxHeight:650}},le.createElement(qt.Z,null,le.createElement(We.Z,{style:{width:160},size:"large",placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:Si,onChange:bo=>{Ln({page:1,discipline_id:bo==null?void 0:bo[0],sub_discipline_id:bo==null?void 0:bo[1]})}}),le.createElement(mn.default,{className:"ml20",style:{width:118},size:"large",placeholder:"\u96BE\u5EA6",allowClear:!0,options:[{label:"\u7B80\u5355",value:1},{label:"\u9002\u4E2D",value:2},{label:"\u56F0\u96BE",value:3}],onChange:bo=>Ln({page:1,diff:bo})}),le.createElement(mn.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:bo=>Ln({page:1,shixun_publish_status:bo})})),le.createElement(on.t7,{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",style:{width:290},onChange:bo=>{Ln({keyword:bo,page:1})}})),ur?le.createElement("div",null,le.createElement(zn.Z,{customText:"\u6682\u65E0\u6570\u636E",ButtonText:"\u524D\u5F80\u5B9E\u8DF5\u9879\u76EE\u5E93\uFF0C\u6DFB\u52A0\u66F4\u591A\u8BD5\u9898>",ButtonClick:()=>(0,Yt.xg)("/shixuns")})):le.createElement(Hi.default,{loading:Pi,rowKey:"id",columns:[{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:"30%",ellipsis:{showTitle:!0},render:(bo,Dr)=>le.createElement("div",{style:{display:"flex",alignItems:"center"}},le.createElement("div",{className:Dr!=null&&Dr.high_resources_consume?un.title:"",title:bo||"--"},le.createElement(fa.Z,{key:1,showLines:1,showTextOnly:!0,value:bo||"--"})),(Dr==null?void 0:Dr.high_resources_consume)&&le.createElement(Rt.Z,{type:"shixun",style:{marginLeft:10}}))},{title:"\u96BE\u5EA6",dataIndex:"level"},{title:"\u5173\u5361\u6570\u91CF",dataIndex:"challenges_count",key:"challenges_count",render:(bo,Dr,or)=>le.createElement("span",null,bo||"- -")},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"study_count"},{title:le.createElement("span",null,"\u53D1\u5E03\u72B6\u6001 ",le.createElement(Qo.Z,{title:"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528"},le.createElement(Rn.Z,null))),dataIndex:"shixun_tag_num_name",key:"shixun_tag_num_name",width:100,render:(bo,Dr,or)=>le.createElement("span",null,bo||"- -")},{title:"\u64CD\u4F5C",render(bo,Dr){const{title:or,challenge_names:ta,author_name:sa,identifier:Ta,author_school_name:Ga,study_count:Oo}=Dr||{};return le.createElement("div",null,le.createElement("span",{style:{color:"#165DFF",cursor:"pointer"},onClick:()=>{tn.default.confirm({title:"\u9898\u76EE\u8BE6\u60C5",closable:!0,width:1e3,centered:!0,icon:null,footer:null,content:le.createElement("div",null,le.createElement(fa.Z,{value:or,style:{marginBottom:18}}),le.createElement("div",{className:un.challengeNameWrapper},ta.map((pa,Lo)=>le.createElement("div",{className:un.challengeName,key:Lo},"\u7B2C",(0,Yt.EM)(Lo+1),"\u9898\xA0",pa))),le.createElement(ct.Z,{className:un.shixunPreviewFooter,justify:"space-between",style:{alignItems:"center"}},le.createElement(qt.Z,{className:un.shixunInfoWrapper},le.createElement("span",null,"\u521B\u5EFA\u8005"),le.createElement("span",{className:un.shixunInfo},sa.split("\u3001")[0]),le.createElement("span",null,"\u6240\u5C5E\u5355\u4F4D"),le.createElement("span",{className:un.shixunInfo},Ga),le.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),le.createElement("span",{className:un.shixunInfo},Oo)),le.createElement(De.ZP,{type:"primary",className:un.btnToDetail,onClick:()=>(0,Yt.xg)(`/shixuns/${Ta}/challenges?exercise=true`)},le.createElement("i",{className:"iconfont icon-shixunkecheng"}),"\u5B9E\u8BAD\u8BE6\u60C5")))})}},"\u67E5\u770B"),(Dr==null?void 0:Dr.shixun_tag_num)===1&&le.createElement("a",{target:"_blank",href:`/shixuns/${Dr==null?void 0:Dr.identifier}/challenges`,style:{marginLeft:10}},"\u53BB\u53D1\u5E03"))}}],dataSource:oi==null?void 0:oi.items,rowSelection:{selectedRowKeys:yo,preserveSelectedRowKeys:!0,getCheckboxProps:bo=>({disabled:bo.shixun_tag_num===1}),onChange(bo,Dr){var or,ta,sa;console.log(bo),ea(bo);const Ta=[];for(const Oo of La)bo.includes(Oo.id)&&Ta.push(Oo);const Ga=Ta.map(Oo=>Oo.id);for(const Oo of Dr)Oo&&bo.includes(Oo.id)&&!Ga.includes(Oo.id)&&Ta.push({id:Oo.id,difficulty:Oo.level,identifier:Oo.identifier,name:Oo.name,real_name:(or=Oo==null?void 0:Oo.author_name)==null?void 0:or.split("\u3001")[0],school_name:Oo.author_school_name,challenge_names:Oo.challenge_names,challenges:(ta=Oo.challenge_names)==null?void 0:ta.map((pa,Lo)=>({subject:pa,id:Lo,score:5})),score:((sa=Oo.challenge_names)==null?void 0:sa.length)*5,study_count:Oo.study_count,challenges_count:Oo.challenges_count});ga(Ta)}},pagination:{current:_i.page,pageSize:_i.limit,total:oi==null?void 0:oi.items_count,showTotal:bo=>le.createElement("span",null,"\u5171\xA0",le.createElement("span",{style:{color:"#165DFF"}},bo),"\xA0\u6761\u6570\u636E"),showQuickJumper:!0,onChange(bo,Dr){Ln({page:bo,limit:Dr})},size:"default"},scroll:{y:400}}))},Ci=Le(22061),Oi=Le(59301),qi=Object.defineProperty,zi=Object.defineProperties,Nn=Object.getOwnPropertyDescriptors,pi=Object.getOwnPropertySymbols,vi=Object.prototype.hasOwnProperty,ti=Object.prototype.propertyIsEnumerable,ui=(nn,Ht,Fn)=>Ht in nn?qi(nn,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):nn[Ht]=Fn,hi=(nn,Ht)=>{for(var Fn in Ht||(Ht={}))vi.call(Ht,Fn)&&ui(nn,Fn,Ht[Fn]);if(pi)for(var Fn of pi(Ht))ti.call(Ht,Fn)&&ui(nn,Fn,Ht[Fn]);return nn},Ti=(nn,Ht)=>zi(nn,Nn(Ht)),Pn=({onDelete:nn,list:Ht,onSelect:Fn})=>{const[Wi,Si]=(0,le.useState)(!1),{dispatch:_i,disabled:Pi}=(0,le.useContext)(Nt),Ln=(ea,La,ga)=>{const bo=Array.from(ea),[Dr]=bo.splice(La,1);return bo.splice(ga,0,Dr),bo},[oi,ur]=(0,le.useState)(null),[Nr,yo]=(0,le.useState)(!1);return Oi.createElement(Ci.Z5,{onDragStart:()=>{yo(!0)},onDragEnd:ea=>{if(yo(!1),!ea.destination)return;const La=Ln(Ht,ea.source.index,ea.destination.index);_i({type:"updateItemTypes",payload:La})}},Oi.createElement(Ci.bK,{droppableId:"droppable"},(ea,La)=>Oi.createElement("div",Ti(hi({},ea.droppableProps),{ref:ea.innerRef}),Oi.createElement(Et.Z,{spinning:Wi},Ht.map((ga,bo)=>Oi.createElement(Ci._l,{key:bo,draggableId:bo.toString(),index:bo,isDragDisabled:oi!==ga.item_type},(Dr,or)=>Oi.createElement(ct.Z,Ti(hi(hi({align:"middle",wrap:!1,ref:Dr.innerRef},Dr.draggableProps),Dr.dragHandleProps),{className:`${un.dragItem} ${Nr?un.dragging:""}`}),Oi.createElement(qt.Z,{className:un.contentArea,onClick:()=>{Fn(ga.item_type),(0,Yt.k3)()}},Oi.createElement("span",{className:un.blackText},(0,Yt.EM)(bo+1),"\u3001\u3010",ga.item_type_text,"\u3011"),Oi.createElement(Qo.Z,{title:`\uFF08${ga.item_bank_count}\u5C0F\u9898\uFF0C\u5171${parseFloat(ga.total_score).toFixed(1)}\u5206\uFF09`},Oi.createElement("span",{className:un.greyText},`\uFF08${ga.item_bank_count}\u5C0F\u9898\uFF0C\u5171${parseFloat(ga.total_score).toFixed(1)}\u5206\uFF09`))),!Pi&&Oi.createElement(Oi.Fragment,null,Oi.createElement(Qo.Z,{title:"\u957F\u6309\u53EF\u8FDB\u884C\u62D6\u62FD\u6392\u5E8F",open:oi===ga.item_type&&!Nr},Oi.createElement("div",{style:{cursor:"grab"},className:`${un.iconWrapper} ${Nr?un.hidden:""}`,onMouseEnter:()=>{ur(ga.item_type)},onMouseLeave:()=>ur(null)},Oi.createElement("i",{className:`iconfont icon-tuodong1 ${un.dragIcon}`}))),Oi.createElement(Qo.Z,{title:"\u5220\u9664"},Oi.createElement("div",{className:`${un.iconWrapper} ${Nr?un.hidden:""}`,style:{cursor:"pointer"},onClick:()=>nn(ga.item_type)},Oi.createElement("i",{className:`iconfont icon-shanchu12 ${un.deleteIcon}`})))))))),ea.placeholder)))},Rr=Le(71114),cr={flex_box_center:"flex_box_center___ppkzA",flex_space_between:"flex_space_between___Z1syx",flex_box_vertical_center:"flex_box_vertical_center___twJ9S",flex_box_center_end:"flex_box_center_end___uI0uW",flex_box_column:"flex_box_column___JRp7D",timelineWrapper:"timelineWrapper___LP9aM",title:"title___KUHj_",desc:"desc___ubc8E",titles:"titles___njkjf",questionDetailWrapper:"questionDetailWrapper___p4SFM",questionTitle:"questionTitle___JC9X6",questionScoreInfo:"questionScoreInfo___NgOJI",deleteIcon:"deleteIcon___oMVTN",deleteBtn:"deleteBtn___JUPEl",normalText:"normalText___FW9Y_",folderIcon:"folderIcon___gvacQ",challengeNameWrapper:"challengeNameWrapper___fG7Vv",challengeName:"challengeName___Ia1Xs",shixunPreviewFooter:"shixunPreviewFooter___rKsnN",shixunInfoWrapper:"shixunInfoWrapper___FEnDb",shixunInfo:"shixunInfo___TbrA2",btnToDetail:"btnToDetail___dqLQP",q_title:"q_title___qnv4p"},Mo=Le(73631),Wr=Le(31328);const Vo=(nn,Ht,Fn,Wi)=>{const Si={[rn.OnlyDifficulty]:[{title:"\u96BE\u5EA6",key:"difficulty",render(_i,Pi){const{difficulty:Ln}=Pi;return le.createElement("span",{style:{color:Ee[Ln].color}},Ee[Ln].label)}}],[rn.OnlyKnowledge]:[{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline_name",ellipsis:!0},{title:"\u65B9\u5411&\u8BFE\u7A0B",dataIndex:"sub_discipline_name",width:180,ellipsis:{showTitle:!0},render(_i,Pi){return`${_i}`}}],[rn.OnlyFileFolder]:[{title:"\u6587\u4EF6\u5939",render(_i,Pi,Ln){const{group_name:oi,teacher_group_name:ur}=Pi,Nr=oi||ur,yo=ur?Wr:Mo;return le.createElement("div",{style:{display:"flex"}},le.createElement("img",{src:yo,className:cr.folderIcon})," ",le.createElement(Qo.Z,{title:Nr},le.createElement("span",{className:cr.titles},Nr)))}},{title:"\u7C7B\u578B",render(_i,Pi){const{teacher_group_name:Ln}=Pi;return le.createElement("span",null,Ln?"\u56E2\u961F\u5171\u4EAB":"\u6211\u521B\u5EFA\u7684")}}],[rn.KnowledgeAndDiff]:[{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline_name",ellipsis:{showTitle:!0}},{title:"\u65B9\u5411&\u8BFE\u7A0B",width:180,dataIndex:"sub_discipline_name",ellipsis:{showTitle:!0}},{title:"\u96BE\u5EA6",key:"difficulty",render(_i,Pi){const{difficulty:Ln}=Pi;return le.createElement("span",{style:{color:Ee[Ln].color}},Ee[Ln].label)}}],[rn.FileFolderAndKnowledge]:[{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline_name",ellipsis:!0},{title:"\u6587\u4EF6\u5939",render(_i,Pi){const{group_name:Ln,teacher_group_name:oi}=Pi,ur=Ln||oi,Nr=oi?Wr:Mo;return le.createElement("div",{style:{display:"flex"}},le.createElement("img",{src:Nr,className:cr.folderIcon})," ",le.createElement(Qo.Z,{title:ur},le.createElement("span",{className:cr.titles},ur)))}},{title:"\u7C7B\u578B",render(_i,Pi){const{teacher_group_name:Ln}=Pi;return le.createElement("span",null,Ln?"\u56E2\u961F\u5171\u4EAB":"\u6211\u521B\u5EFA\u7684")}}],[rn.FileFolderAndDiff]:[{title:"\u6587\u4EF6\u5939",render(_i,Pi){const{group_name:Ln,teacher_group_name:oi}=Pi,ur=Ln||oi,Nr=oi?Wr:Mo;return le.createElement("div",{style:{display:"flex"}},le.createElement("img",{src:Nr,className:cr.folderIcon})," ",le.createElement(Qo.Z,{title:ur},le.createElement("span",{className:cr.titles},ur)))}},{title:"\u7C7B\u578B",render(_i,Pi){const{teacher_group_name:Ln}=Pi;return le.createElement("span",null,Ln?"\u56E2\u961F\u5171\u4EAB":"\u6211\u521B\u5EFA\u7684")}},{title:"\u96BE\u5EA6",key:"difficulty",render(_i,Pi){const{difficulty:Ln}=Pi;return le.createElement("span",{style:{color:Ee[Ln].color}},Ee[Ln].label)}}],[rn.All]:[{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline_name",ellipsis:!0},{title:"\u6587\u4EF6\u5939",render(_i,Pi){const{group_name:Ln,teacher_group_name:oi,teacher_group_id:ur}=Pi,Nr=Ln||oi,yo=ur||ur===0?Wr:Mo;return le.createElement("div",{style:{display:"flex"}},le.createElement("img",{src:yo,className:cr.folderIcon})," ",le.createElement(Qo.Z,{title:Nr},le.createElement("span",{className:cr.titles},Nr)))}},{title:"\u7C7B\u578B",render(_i,Pi){const{teacher_group_id:Ln}=Pi;return le.createElement("span",null,Ln||Ln===0?"\u56E2\u961F\u5171\u4EAB":"\u6211\u521B\u5EFA\u7684")}},{title:"\u96BE\u5EA6",key:"difficulty",render(_i,Pi){const{difficulty:Ln}=Pi;return le.createElement("span",{style:{color:Ee[Ln].color}},Ee[Ln].label)}}],[rn.Shixun]:[]};for(const _i of Object.values(Si))_i.push({title:"\u62BD\u9898\u6570\u91CF",key:"quanlity",render(Pi,Ln){const{item_bank_num:oi,quanlity:ur,id:Nr,teacher_group_id:yo}=Ln||{};return le.createElement(ct.Z,{align:"middle"},le.createElement(At.Z,{disabled:Wi,min:1,max:oi,size:"large",precision:0,value:ur,onChange:ea=>{Ht({type:"changeQuestionNum",payload:{itemType:Fn,id:Nr,num:ea,teacher_group_id:yo}})}}),le.createElement("span",{className:"ml10 font14",style:{color:"#333333"}},"/",oi))}},{title:"\u64CD\u4F5C",key:"action",align:"right",render(Pi,Ln){const{id:oi,is_share:ur}=Ln;return Wi?le.createElement("span",{className:"cursorNotAllowed c-grey-999"},"\u5220\u9664"):le.createElement("span",{className:cr.deleteBtn,onClick:()=>{Ht({type:"deleteRule",payload:{itemType:Fn,id:oi,is_share:ur}})}},"\u5220\u9664")}});return Si[nn]},Wo=({setVisibleModalType:nn})=>{var Ht,Fn,Wi,Si;const{data:_i,dispatch:Pi,disabled:Ln}=(0,le.useContext)(Nt),oi=(Ht=_i==null?void 0:_i.item_types)==null?void 0:Ht.find(ur=>ur.item_type==="PRACTICAL");return le.createElement(Rr.Z,{className:cr.timelineWrapper,items:[{children:le.createElement("div",{style:{transform:"translateY(-4px)"}},le.createElement(ct.Z,{className:"mb20",align:"middle",justify:"space-between"},le.createElement(qt.Z,null,le.createElement("span",{className:cr.title},"\u9898\u5E93\u9009\u9898"),le.createElement("span",{className:cr.desc},"\uFF08\u9700\u8981\u5148\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9\u5B9E\u8BAD\u9898\uFF0C\u518D\u8BBE\u7F6E\u4ECE\u5DF2\u9009\u5B9E\u8BAD\u9898\u4E2D\u968F\u673A\u62BD\u9898\u7684\u6570\u91CF\uFF09")),!Ln&&le.createElement(on.op,{style:{width:102},onClick:()=>nn("selectShixun")},"\u4ECE\u9898\u5E93\u9009\u62E9")),((Fn=oi==null?void 0:oi.item_banks)==null?void 0:Fn.length)===0?le.createElement(zn.Z,{customText:"\u6682\u65E0\u5F85\u62BD\u8BD5\u9898\uFF0C\u8BF7\u5148\u4ECE\u9898\u5E93\u8FDB\u884C\u9009\u62E9\uFF5E"}):le.createElement(Hi.default,{rowKey:"id",className:"mb10",columns:[{title:"\u5E8F\u53F7",width:60,render(ur,Nr,yo){return le.createElement("span",null,yo+1)}},{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:"40%",ellipsis:{showTitle:!0},render:(ur,Nr)=>le.createElement("div",{style:{display:"flex",alignItems:"center"}},le.createElement("div",{className:Nr!=null&&Nr.high_resources_consume?cr.q_title:"",title:ur||"--"},le.createElement(fa.Z,{key:1,showLines:1,showTextOnly:!0,value:ur})),(Nr==null?void 0:Nr.high_resources_consume)&&le.createElement(Rt.Z,{type:"shixun",style:{marginLeft:10}}))},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"study_count"},{title:"\u5173\u5361\u6570\u91CF",dataIndex:"challenges_count",key:"challenges_count",render:(ur,Nr,yo)=>le.createElement("span",null,ur||"- -")},{title:"\u96BE\u5EA6",dataIndex:"difficulty"},{title:"\u64CD\u4F5C",align:"right",width:180,render(ur,Nr,yo){const{id:ea,identifier:La,name:ga,challenge_names:bo=[],real_name:Dr,school_name:or,study_count:ta,challenges:sa=[]}=Nr||{};return le.createElement("div",null,le.createElement("span",{style:{color:"#165DFF",cursor:"pointer",marginLeft:20},onClick:()=>{tn.default.confirm({title:"\u9898\u76EE\u8BE6\u60C5",closable:!0,width:1e3,centered:!0,icon:null,footer:null,content:le.createElement("div",null,le.createElement(fa.Z,{value:ga,style:{marginBottom:18}}),le.createElement("div",{className:cr.challengeNameWrapper},sa==null?void 0:sa.map((Ta,Ga)=>le.createElement("div",{className:cr.challengeName,key:Ga},"\u7B2C",(0,Yt.EM)(Ga+1),"\u9898\xA0",Ta==null?void 0:Ta.subject))),le.createElement(ct.Z,{className:cr.shixunPreviewFooter,justify:"space-between",style:{alignItems:"center"}},le.createElement(qt.Z,{className:cr.shixunInfoWrapper},le.createElement("span",null,"\u521B\u5EFA\u8005"),le.createElement("span",{className:cr.shixunInfo},Dr),le.createElement("span",null,"\u6240\u5C5E\u5355\u4F4D"),le.createElement("span",{className:cr.shixunInfo},or),le.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),le.createElement("span",{className:cr.shixunInfo},ta)),le.createElement(De.ZP,{type:"primary",className:cr.btnToDetail,onClick:()=>(0,Yt.xg)(`/shixuns/${La}/challenges?exercise=true`)},le.createElement("i",{className:"iconfont icon-shixunkecheng"}),"\u5B9E\u8BAD\u8BE6\u60C5")))})}},"\u67E5\u770B"),!Ln&&le.createElement("span",{onClick:()=>{Pi({type:"deleteShixunQuestion",payload:{shixunId:ea}})},className:`ml20 ${cr.deleteBtn}`},"\u5220\u9664"))}}],dataSource:(oi==null?void 0:oi.item_banks)||[],pagination:!1}))},{children:le.createElement(ct.Z,{style:{transform:(Wi=oi==null?void 0:oi.item_banks)!=null&&Wi.length?"translateY(-8px)":"none"},align:"middle",justify:"space-between"},le.createElement("span",{className:cr.title},"\u5DF2\u9009\u5B9E\u8BAD\u9898\u4E2D\u968F\u673A\u62BD\u9898"),!!((Si=oi==null?void 0:oi.item_banks)!=null&&Si.length)&&le.createElement(qt.Z,null,le.createElement(ct.Z,{align:"middle"},le.createElement("span",{className:cr.normalText},"\u62BD\u9898\u6570\u91CF"),le.createElement(At.Z,{min:0,disabled:Ln,max:oi==null?void 0:oi.item_bank_num,size:"large",className:"ml10 mr10",value:(oi==null?void 0:oi.item_bank_count)||1,onChange:ur=>Pi({type:"changeQuestionNum",payload:{num:ur||1,itemType:"PRACTICAL"}})}),le.createElement("span",{className:`${cr.normalText} mr30`},"/",oi==null?void 0:oi.item_bank_num),le.createElement("span",{className:cr.normalText},"\u6BCF\u9898\u5206\u503C"),le.createElement(At.Z,{disabled:Ln,min:0,max:100,size:"large",precision:1,className:"ml10 mr10",value:oi==null?void 0:oi.score,onChange:ur=>Pi({type:"changeQuestionScore",payload:{score:ur,itemType:"PRACTICAL"}})}),le.createElement("span",{className:cr.normalText},"\u5206"))))}]})};var Xo=({setVisibleModalType:nn,currentItemType:Ht,onDelete:Fn})=>{var Wi,Si;const _i=(0,Oe.useParams)(),{data:Pi,dispatch:Ln,disabled:oi}=(0,le.useContext)(Nt),ur=((Wi=Pi==null?void 0:Pi.item_types)==null?void 0:Wi.findIndex(yo=>yo.item_type===Ht))+1,Nr=(Si=Pi==null?void 0:Pi.item_types)==null?void 0:Si.find(yo=>yo.item_type===Ht);return le.createElement("div",{className:cr.questionDetailWrapper},le.createElement(ct.Z,{justify:"space-between",align:"middle",className:"mb30"},le.createElement(qt.Z,null,le.createElement("span",{className:cr.questionTitle},`${(0,Yt.EM)(ur)}\u3001${Nr==null?void 0:Nr.item_type_text}`),le.createElement("span",{className:cr.questionScoreInfo},"\uFF08",le.createElement("span",{style:{color:"#3061D0"}},Nr==null?void 0:Nr.item_bank_count),"\u5C0F\u9898 ",le.createElement("span",null,"\uFF0C\u5171",le.createElement("span",{style:{color:"#3061D0"}},Nr==null?void 0:Nr.total_score),"\u5206"),"\uFF09")),!oi&&le.createElement("i",{className:`iconfont icon-shanchutimu ${cr.deleteIcon}`,onClick:()=>Fn(Ht)})),Ht==="PRACTICAL"?le.createElement(Wo,{setVisibleModalType:nn}):le.createElement(le.Fragment,null,(Nr==null?void 0:Nr.contents.length)===0?le.createElement(zn.Z,{styles:{margin:"70px auto 100px auto"},customText:le.createElement("span",null,"\u6682\u65E0\u62BD\u9898\u89C4\u5219\uFF0C\u652F\u6301",le.createElement("span",{style:{color:"#EA9741"}},"\u6307\u5B9A\u6587\u4EF6\u5939\u3001\u96BE\u5EA6\u3001\u77E5\u8BC6\u70B9"),"\u8FDB\u884C\u62BD\u9898\uFF5E"),ButtonTwo:(_i==null?void 0:_i.id)&&le.createElement(ct.Z,{justify:"center",className:"mt30"},le.createElement(on.op,{style:{width:136,marginTop:-10},onClick:()=>nn("rule")},"\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219"))}):le.createElement(le.Fragment,null,le.createElement(ct.Z,{justify:"space-between",align:"middle",className:"mb20"},le.createElement(qt.Z,null,le.createElement(ct.Z,{align:"middle"},le.createElement("span",{className:`${cr.normalText}`},"\u6BCF\u9898\u5206\u503C"),le.createElement(At.Z,{disabled:oi,size:"large",className:"ml10 mr10",min:.1,max:100,value:Nr==null?void 0:Nr.score,precision:1,onChange:yo=>Ln({type:"changeQuestionScore",payload:{score:yo,itemType:Ht}})}),le.createElement("span",{className:cr.normalText},"\u5206"))),(_i==null?void 0:_i.id)&&le.createElement(on.op,{onClick:()=>nn("rule")},"\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219")),le.createElement(Hi.default,{columns:Vo(Nr==null?void 0:Nr.random_rule_type,Ln,Ht,oi),dataSource:Nr==null?void 0:Nr.contents,pagination:!1,rowKey:"id"}))))},aa=Le(84842),Pa=Le(81722),Gt=Le(48790),qo=Le(32637),fr=Le(59301),ao=Object.defineProperty,zr=Object.defineProperties,Jo=Object.getOwnPropertyDescriptors,va=Object.getOwnPropertySymbols,ma=Object.prototype.hasOwnProperty,ko=Object.prototype.propertyIsEnumerable,So=(nn,Ht,Fn)=>Ht in nn?ao(nn,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):nn[Ht]=Fn,$a=(nn,Ht)=>{for(var Fn in Ht||(Ht={}))ma.call(Ht,Fn)&&So(nn,Fn,Ht[Fn]);if(va)for(var Fn of va(Ht))ko.call(Ht,Fn)&&So(nn,Fn,Ht[Fn]);return nn},gs=(nn,Ht)=>zr(nn,Jo(Ht)),ls=(nn,Ht,Fn)=>new Promise((Wi,Si)=>{var _i=oi=>{try{Ln(Fn.next(oi))}catch(ur){Si(ur)}},Pi=oi=>{try{Ln(Fn.throw(oi))}catch(ur){Si(ur)}},Ln=oi=>oi.done?Wi(oi.value):Promise.resolve(oi.value).then(_i,Pi);Ln((Fn=Fn.apply(nn,Ht)).next())}),$r=({})=>{var nn,Ht,Fn,Wi,Si,_i,Pi,Ln,oi,ur,Nr,yo,ea,La,ga;const[bo]=(0,Oe.useSearchParams)(),Dr=(0,Oe.useParams)(),{data:or,dispatch:ta,setPreview:sa,getData:Ta,handlePreview:Ga,disabled:Oo}=(0,le.useContext)(Nt),[pa,Lo]=(0,le.useState)(""),[Ir,Ba]=(0,le.useState)((Ht=(nn=or==null?void 0:or.item_types)==null?void 0:nn[0])==null?void 0:Ht.item_type),[ra,Uo]=(0,le.useState)(!0),[_o,oa]=(0,le.useState)(!1),Ua=(ut,dr)=>ls(void 0,null,function*(){var lr,gr,Qi,Jn,Fr,Br;const Zr=or.item_types.map(bi=>bi.item_type_text),mr=(lr=or==null?void 0:or.item_types)==null?void 0:lr.filter(bi=>{var Jr,Ur;return((Jr=bi.contents)==null?void 0:Jr.length)>0||((Ur=bi==null?void 0:bi.item_banks)==null?void 0:Ur.length)>0});if(or.sort_by_item_type=Zr,!((gr=or.item_types)!=null&&gr.length)){it.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}if((mr==null?void 0:mr.length)===0){it.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}let Po=()=>ls(void 0,null,function*(){const bi=(0,nt.cloneDeep)(or),{item_types:Jr}=bi||{};bi.item_types=Jr.filter(Mr=>Mr.item_type===Ir),(yield Ze(Dr.id||Dr.categoryId,bi)).status===0&&(Ba(dr),it.ZP.success("\u4FDD\u5B58\u6210\u529F"),ut||Oe.history.push("/paperlibrary"))}),Ki=(Jn=(Qi=or==null?void 0:or.item_types)==null?void 0:Qi.filter(bi=>bi.item_type_text==="\u5B9E\u8BAD\u9898")[0])==null?void 0:Jn.item_banks,Ei=0;Ki==null||Ki.map(bi=>{bi.high_resources_consume&&(Ei=Ei+1)}),console.log(Ei),Ei>0?tn.default.info({centered:!0,icon:null,width:600,okText:"\u6211\u77E5\u9053\u4E86",title:"\u63D0\u793A",content:fr.createElement("div",null,fr.createElement("div",{className:un.tipcontent},fr.createElement("div",null,fr.createElement("div",{className:un.name},"\u60A8\u597D\uFF01",(Fr=(0,Gt.eY)())==null?void 0:Fr.username,"\uFF08",(Br=(0,Gt.eY)())==null?void 0:Br.login,"\uFF09\uFF1A"),fr.createElement("div",{className:un.tip},"\u5F53\u524D\u8BD5\u5377\u5305\u542B\u9AD8\u6D88\u8017\u7C7B\u578B\u7684\u5B9E\u9A8C\u3002",fr.createElement("br",null),"\u6839\u636E\u5E73\u53F0\u4F7F\u7528\u89C4\u5219\uFF0C\u9700\u8981\u6388\u6743\u624D\u80FD\u4F7F\u7528\u3002\u53D1\u5E03\u8003\u8BD5\u524D\uFF0C\u8BF7\u5148\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u83B7\u53D6\u6388\u6743\u7801\u3002"),fr.createElement("div",{className:un.info},fr.createElement("i",{className:"iconfont icon-xunifangzhenti1 mr10 font26"}),fr.createElement("span",{className:"mr10",style:{color:"#6A7283"}},"\u9AD8\u6D88\u8017\u5B9E\u9A8C"),fr.createElement("span",{style:{color:"#232B40"}},`${Ei}\u4E2A`))),fr.createElement("div",null,fr.createElement("div",{className:un.img},fr.createElement("img",{src:qo,width:"124px",height:"124px"})),fr.createElement("div",{className:"tc font14 mt10",style:{color:"#777A93"}},"\u626B\u4E00\u626B\uFF0C\u83B7\u53D6\u6388\u6743\u7801")))),onOk:()=>{Po()}}):Po()}),pt=(ut,dr,lr,gr=!1)=>ls(void 0,null,function*(){console.log(or);const Qi=gs($a($a({},or.exercise),Dr),{exerciseId:Dr.categoryId,sort_by_item_type:or.sort_by_item_type,difficulty:or.examination_bank.difficulty,exam_notes:or.examination_bank.exam_notes,exercise_name:or.examination_bank.name,time:or.examination_bank.time,changed_item_type:Ir,item_types:or.item_types,sub_discipline_id:or.examination_bank.sub_discipline_id});(!ut||dr===1)&&(Qi.is_reset=1);const Jn=yield(0,Pa.wy)(Qi);return Jn.status===0&&(gr||it.ZP.success("\u4FEE\u6539\u6210\u529F "),Ba(lr),ut||Oe.history.push(`/classrooms/${Dr.coursesId}/exercise/${Dr.categoryId}/detail?random=true`)),Jn}),Ut=ut=>{tn.default.confirm({title:"\u63D0\u793A",icon:null,centered:!0,closable:!0,content:fr.createElement("div",null,"\u786E\u8BA4\u5220\u9664\u8BE5\u9898\u578B\uFF1F"),onOk:()=>ls(void 0,null,function*(){var dr,lr,gr,Qi;if(Dr.id){if((yield wt(Dr.id,{item_type:[ut]})).status!==0)return}else{const Jn=yield St(Dr.categoryId,{item_type:[ut]});if(Ta(),Jn.status!==0)return}if(ta({type:"deleteQuestionType",payload:ut}),ut===Ir){const Jn=He(or,{type:"deleteQuestionType",payload:ut});Ba(Jn.item_types.length?Jn.item_types[0].item_type:(lr=(dr=or==null?void 0:or.item_types)==null?void 0:dr[0])==null?void 0:lr.item_type)}else Ba((Qi=(gr=or==null?void 0:or.item_types)==null?void 0:gr[0])==null?void 0:Qi.item_type)})})};(0,le.useEffect)(()=>{var ut;(ut=or==null?void 0:or.examination_bank)!=null&&ut.name&&Uo(!1),(0,Yt.Dk)("\u968F\u673A\u7EC4\u5377")},[(Fn=or==null?void 0:or.examination_bank)==null?void 0:Fn.name]);const Re=()=>ls(void 0,null,function*(){var ut;let dr=yield pt(!0,1,Ir,!0);if((dr==null?void 0:dr.status)===0){const lr=yield(0,ne.ZP)(`/api/exercises/${Dr==null?void 0:Dr.categoryId}/simulate_start_answer.json`,{method:"get",params:{coursesId:Dr==null?void 0:Dr.coursesId,categoryId:Dr==null?void 0:Dr.categoryId}});(lr==null?void 0:lr.status)!=-1&&window.open(`/classrooms/${Dr.coursesId}/exercise/${Dr.categoryId}/${(ut=(0,Gt.eY)())==null?void 0:ut.login}/initate_answer`)}});return fr.createElement("div",{className:un.questionInfo},fr.createElement("div",{className:"tc mb20"},fr.createElement(st.VP,{defaultValue:(Wi=or==null?void 0:or.examination_bank)==null?void 0:Wi.name,onFinish:ut=>ls(void 0,null,function*(){return ta({type:"updateBaseInfo",payload:gs($a({},or.examination_bank),{name:ut})}),Dr!=null&&Dr.id?(0,Pa.se)({name:ut,exerciseId:(Dr==null?void 0:Dr.categoryId)||(Dr==null?void 0:Dr.id)}):(0,Pa.wy)({exercise_name:ut,exerciseId:(Dr==null?void 0:Dr.categoryId)||(Dr==null?void 0:Dr.id)}),!0})})),fr.createElement(ct.Z,{justify:"center",className:"mb20"},fr.createElement(qt.Z,{className:"mr30"},fr.createElement("span",{className:un.label},"\u7B54\u9898\u65F6\u957F"),fr.createElement("span",null,((Si=or==null?void 0:or.examination_bank)==null?void 0:Si.time)===-1?"\u4E0D\u9650":((_i=or==null?void 0:or.examination_bank)==null?void 0:_i.time)||"\u4E0D\u9650")),fr.createElement(qt.Z,{className:"mr30"},fr.createElement("span",{className:un.label},"\u96BE\u5EA6"),fr.createElement("span",null,(Ln=Ee[`${(Pi=or==null?void 0:or.examination_bank)==null?void 0:Pi.difficulty}`])==null?void 0:Ln.label)),fr.createElement(qt.Z,{className:"mr30"},fr.createElement("span",{className:un.label},"\u8BD5\u9898\u603B\u6570"),fr.createElement("span",null,((oi=or==null?void 0:or.examination_bank)==null?void 0:oi.question_count)||0)),fr.createElement(qt.Z,null,fr.createElement("span",{className:un.label},"\u603B\u5206"),fr.createElement("span",null,((Nr=(ur=or==null?void 0:or.examination_bank)==null?void 0:ur.total_score)==null?void 0:Nr.toFixed(1))||0))),fr.createElement("div",{className:un.content,style:{border:((yo=or==null?void 0:or.item_types)==null?void 0:yo.length)<=0&&"none"}},((ea=or==null?void 0:or.item_types)==null?void 0:ea.length)>0?fr.createElement(ct.Z,{wrap:!1},fr.createElement(qt.Z,{flex:"260px",className:un.leftPart},!Oo&&fr.createElement(ct.Z,{className:"mb20"},fr.createElement(on.op,{style:{margin:"0 15px",borderRadius:2},onClick:()=>Lo("setScore")},"\u6279\u91CF\u8BBE\u7F6E\u5206\u503C"),(Dr==null?void 0:Dr.id)&&fr.createElement(on.op,{shape:"default",onClick:()=>Lo("questionType")},"\u6DFB\u52A0\u9898\u578B")),fr.createElement(Pn,{list:or.item_types,onSelect:ut=>ls(void 0,null,function*(){if(ut===Ir)return;Uo(!0);const dr=or.item_types.find(lr=>lr.item_type===Ir);if(Ir!=="PRACTICAL"&&dr.contents.length>0&&(Dr!=null&&Dr.id)){const lr=(0,nt.cloneDeep)(or),{item_types:gr}=lr||{};lr.item_types=gr.filter(Qi=>Qi.item_type===Ir);try{(yield Ze(Dr.id||Dr.categoryId,lr)).status===0&&Ba(ut)}catch(Qi){}}else Dr.categoryId?pt(!0,2,ut):Ua(!0,ut);Uo(!1)}),onDelete:Ut})),fr.createElement(qt.Z,{flex:1,className:un.rightPart},fr.createElement(Et.Z,{spinning:ra},fr.createElement(Xo,{setVisibleModalType:Lo,currentItemType:Ir,onDelete:Ut})))):fr.createElement(zn.Z,{customText:"\u8BF7\u5148\u8BBE\u7F6E\u8BD5\u5377\u9898\u578B",styles:{margin:"70px auto"},ButtonTwo:fr.createElement(ct.Z,{justify:"center",className:"mt20"},(Dr==null?void 0:Dr.id)&&fr.createElement(on.op,{style:{width:88},onClick:()=>Lo("questionType")},"\u6DFB\u52A0\u9898\u578B"))})),!!(Dr!=null&&Dr.id)&&fr.createElement("div",{className:un.fixedBottom},fr.createElement(aa.Z,{className:`${un.previewBtn} mr20`,onClick:()=>ls(void 0,null,function*(){var ut,dr;const lr=(ut=or==null?void 0:or.item_types)==null?void 0:ut.filter(gr=>{var Qi,Jn;return((Qi=gr.contents)==null?void 0:Qi.length)>0||((Jn=gr==null?void 0:gr.item_banks)==null?void 0:Jn.length)>0});if(!((dr=or.item_types)!=null&&dr.length)){it.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}if((lr==null?void 0:lr.length)===0){it.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}yield Ua(!0,Ir),Ga()})},"\u8BD5\u5377\u9884\u89C8"),fr.createElement(aa.Z,{type:"primary",className:un.confirmBtn,onClick:()=>Ua()},fr.createElement("i",{className:"iconfont icon-baocun1 mr5"}),"\u4FDD\u5B58\u8BD5\u5377")),!!(Dr!=null&&Dr.categoryId)&&fr.createElement("div",{className:un.fixedBottom,style:{justifyContent:((La=or==null?void 0:or.exercise)==null?void 0:La.exercise_status)!==1?"end":"center"}},fr.createElement(aa.Z,{className:`${un.previewBtn} mr20`,onClick:()=>ls(void 0,null,function*(){var ut,dr;document.body.scrollIntoView(),Oe.history.push(`/classrooms/${Dr.coursesId}/exercise/${(ut=or==null?void 0:or.exercise)==null?void 0:ut.id}/detail?random=${(dr=or==null?void 0:or.exercise)==null?void 0:dr.is_random}`)})},"\u8FD4\u56DE"),((ga=or==null?void 0:or.exercise)==null?void 0:ga.exercise_status)===1&&fr.createElement(aa.Z,{className:`${un.previewBtn} mr20`,onClick:Re},"\u6A21\u62DF\u8003\u8BD5"),(or==null?void 0:or.exercise.exercise_status)===1&&fr.createElement(aa.Z,{type:"primary",className:un.confirmBtn,onClick:()=>pt()},"\u63D0\u4EA4")),fr.createElement(gi,{open:pa==="questionType",onCancel:()=>Lo(""),onOk:ut=>ls(void 0,null,function*(){var dr,lr;const gr=[],Qi=He(or,{type:"setQuestionType",payload:ut}),Jn=((dr=Qi==null?void 0:Qi.item_types)==null?void 0:dr.map(Fr=>Fr.item_type))||[];for(const Fr of((lr=or==null?void 0:or.item_types)==null?void 0:lr.map(Br=>Br.item_type))||[])Jn.includes(Fr)||gr.push(Fr);Dr.id&&gr.length>0&&(yield wt(Dr.id,{item_type:gr})).status!==0||(ta({type:"setQuestionType",payload:ut}),Ba(Ir||Qi.item_types[0].item_type),Lo(""))})}),fr.createElement(Cr,{open:pa==="setScore",onCancel:()=>{Lo("")},onOk:ut=>ls(void 0,null,function*(){console.log("---newData",ut);const dr=ut.item_types.map(lr=>({item_type:lr.item_type,score:lr.score}));Dr.id?(yield dt(Dr.id,{score_settings:dr})).status===0&&ta({type:"init",payload:ut}):(yield $e(Dr.categoryId,{score_settings:dr})).status===0&&ta({type:"init",payload:ut}),Lo("")})}),fr.createElement(wr,{open:pa==="rule",onCancel:()=>Lo(""),currentItemType:Ir,setVisibleModalType:Lo}),bo.get("type")==="settings"&&fr.createElement(qn,{open:pa==="selectShixun",onCancel:()=>Lo(""),onOk:ut=>{if(console.log(ut),(ut==null?void 0:ut.length)<=0){it.ZP.info("\u5B9E\u8BAD\u6570\u4E0D\u80FD\u4E3A0");return}ta({type:"addShixun",payload:{shixunList:[...ut]}}),Lo("")}}))},Ka=Le(43554),Ma=Le(59301),ns=Object.defineProperty,qa=Object.defineProperties,ts=Object.getOwnPropertyDescriptors,Xi=Object.getOwnPropertySymbols,Xr=Object.prototype.hasOwnProperty,Co=Object.prototype.propertyIsEnumerable,Zo=(nn,Ht,Fn)=>Ht in nn?ns(nn,Ht,{enumerable:!0,configurable:!0,writable:!0,value:Fn}):nn[Ht]=Fn,Ko=(nn,Ht)=>{for(var Fn in Ht||(Ht={}))Xr.call(Ht,Fn)&&Zo(nn,Fn,Ht[Fn]);if(Xi)for(var Fn of Xi(Ht))Co.call(Ht,Fn)&&Zo(nn,Fn,Ht[Fn]);return nn},ba=(nn,Ht)=>qa(nn,ts(Ht)),Kr=(nn,Ht,Fn)=>new Promise((Wi,Si)=>{var _i=oi=>{try{Ln(Fn.next(oi))}catch(ur){Si(ur)}},Pi=oi=>{try{Ln(Fn.throw(oi))}catch(ur){Si(ur)}},Ln=oi=>oi.done?Wi(oi.value):Promise.resolve(oi.value).then(_i,Pi);Ln((Fn=Fn.apply(nn,Ht)).next())}),Za=()=>{var nn,Ht,Fn,Wi;const[Si,_i]=(0,le.useState)("baseInfo"),Pi=(0,Oe.useDispatch)();(0,le.useEffect)(()=>{Pi({type:"globalSetting/footerToggle",payload:!1})},[]);const Ln=(0,Oe.useParams)(),oi=!!(Ln.id||Ln.categoryId),[ur]=(0,Oe.useSearchParams)();(0,le.useEffect)(()=>{ur.get("type")==="settings"&&_i("settings")},[]);const[Nr,yo]=(0,le.useReducer)(He,null),[ea,La]=(0,le.useState)(!1),ga=()=>Kr(void 0,null,function*(){La(!0);let Ir;Ln.categoryId?Ir=yield vn(Ln):Ir=yield _e(Ln.id),La(!1),Ir.status===0&&yo({type:"init",payload:Ir})});(0,le.useEffect)(()=>{oi?ga():yo({type:"init",payload:{examination_bank:{difficulty:2}}})},[Ln]);const[bo,Dr]=(0,le.useState)(""),or=(Ir,Ba)=>Kr(void 0,null,function*(){var ra,Uo,_o,oa;const Ua=(ra=Nr==null?void 0:Nr.item_types)==null?void 0:ra.filter(Re=>{var ut;return((ut=Re==null?void 0:Re.item_type)==null?void 0:ut.toUpperCase())===(Ba==null?void 0:Ba.type)}),pt={sort_by_item_type:Nr.sort_by_item_type,difficulty:Nr.examination_bank.difficulty,exam_notes:Nr.examination_bank.exam_notes,name:Nr.examination_bank.name,time:Nr.examination_bank.time,item_types:Nr.item_types};if(Ir!==void 0&&!(Ir!=null&&Ir.single_question_id)){pt.seleted_item_bank_ids=Ir==null?void 0:Ir.seleted_item_bank_ids,pt.item_types=Ua;const Re=yield pn(pt);if((Re==null?void 0:Re.status)===0){let ut=(0,nt.cloneDeep)(Oo.data);ut.questionList=(Uo=ut==null?void 0:ut.questionList)==null?void 0:Uo.map(dr=>{var lr;return dr.type===Ba.type?ba(Ko({},dr),{questions:((lr=Re==null?void 0:Re.questions)==null?void 0:lr.questions)||[]}):dr}),pa({show:!0,data:ut})}return}if(Ir!==void 0&&(Ir!=null&&Ir.single_question_id)){pt.seleted_item_bank_ids=Ir==null?void 0:Ir.seleted_item_bank_ids,pt.single_question_id=Ir==null?void 0:Ir.single_question_id,pt.item_types=Ua;const Re=yield pn(pt);if((Re==null?void 0:Re.status)===0){let ut=(0,nt.cloneDeep)(Oo.data);ut.questionList=(_o=ut==null?void 0:ut.questionList)==null?void 0:_o.map(dr=>{var lr,gr;if(dr.type===Ba.type){const Qi=(0,nt.cloneDeep)(dr==null?void 0:dr.questions);return Qi.splice(Ba.index,1,(gr=(lr=Re==null?void 0:Re.questions)==null?void 0:lr.questions)==null?void 0:gr[0]),console.log(dr==null?void 0:dr.questions,Qi,Ba.index,"new_questions"),ba(Ko({},dr),{questions:Qi})}return dr}),pa({show:!0,data:ut})}return}const Ut=yield Lt(pt);if((Ut==null?void 0:Ut.status)===0){const Re=(0,Yt.ad)(Ut);let ut=[];(oa=Nr==null?void 0:Nr.item_types)==null||oa.forEach(dr=>{var lr;const gr=(lr=Re==null?void 0:Re.questionList)==null?void 0:lr.find(Qi=>dr.item_type===Qi.type);ut.push(gr)}),console.log(Nr,"sortList"),ut=(0,nt.compact)(ut),Re.questionList=ut,pa({show:!0,data:Re}),Dr(new Date)}}),ta=Ir=>{var Ba;let ra=(0,nt.cloneDeep)(Oo.data);ra.questionList=(Ba=ra==null?void 0:ra.questionList)==null?void 0:Ba.map(Uo=>Uo.type===Ir.type?ba(Ko({},Uo),{questions_score:Ir.scoreTotal}):Uo),yo({type:"changeQuestionScore",payload:{score:Ir.score,itemType:Ir.type}}),pa({show:!0,data:ra})},sa=Ir=>Kr(void 0,null,function*(){const Ba={sort_by_item_type:Nr.sort_by_item_type,difficulty:Nr.examination_bank.difficulty,exam_notes:Nr.examination_bank.exam_notes,name:Nr.examination_bank.name,time:Nr.examination_bank.time,item_types:Nr.item_types,sub_discipline_id:Nr.examination_bank.sub_discipline_id};if(Ir){(yield en(Ko(Ko({},Ba),Ir))).status===0&&it.ZP.success("\u4FDD\u5B58\u6210\u529F");return}(yield Ze(Ln.id,Ba)).status===0&&(it.ZP.success("\u63D0\u4EA4\u6210\u529F"),Oe.history.push("/paperlibrary?defaultActiveKey=0"))}),Ta=(0,To.g)(),[Ga]=bt.default.useForm(),[Oo,pa]=(0,le.useState)({show:!1,data:{}}),Lo=!!((nn=Nr==null?void 0:Nr.exercise)!=null&&nn.exercise_status)&&((Ht=Nr==null?void 0:Nr.exercise)==null?void 0:Ht.exercise_status)!==1;return Ma.createElement(Nt.Provider,{value:{data:Nr,disabled:Lo,dispatch:yo,setPreview:pa,getData:ga,handlePreview:or}},Oo.show?Ma.createElement(Ka.Z,{key:bo,data:Oo.data,onExchange:or,onTypeScore:ta,submit:sa,goBack:()=>pa({show:!1,data:{}})}):Ma.createElement("div",{className:Ke.wrapper},Ma.createElement("div",{className:"edu-container"},Ma.createElement(vt.Z,{className:Ke.breadCrumbWrapper,separator:">",items:Ln!=null&&Ln.categoryId?[{title:Ma.createElement(Oe.Link,{to:`/classrooms/${Ln.coursesId}/exercise`},(Wi=(Fn=(0,Gt.eY)())==null?void 0:Fn.course)==null?void 0:Wi.course_name)},{title:Ma.createElement(Oe.Link,{to:`/classrooms/${Ln.coursesId}/exercise`},"\u8BD5\u5377\u5217\u8868")},{title:"\u7F16\u8F91\u8BD5\u5377"}]:[{title:Ma.createElement(Oe.Link,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")},{title:"\u968F\u673A\u7EC4\u5377"}]}),Ma.createElement(st.d4,{activeKey:Si,tabs:[{key:"baseInfo",label:"\u8BD5\u5377\u57FA\u7840\u4FE1\u606F"},{key:"settings",label:"\u7EC4\u5377\u914D\u7F6E"}],onChange:Ir=>Kr(void 0,null,function*(){if(Ir==="settings"&&(yield Ga.validateFields(),!oi)){const Ba=yield lt(Nr);Ba.status===0&&Oe.history.replace(`/randompaper/edit/${Ba==null?void 0:Ba.examination_bank_id}?type=settings`)}_i(Ir)})}),Si==="baseInfo"&&Ma.createElement(Mi,{courseOptions:Ta,setCurrentKey:_i,loading:ea,form:Ga}),Ma.createElement("div",{style:{display:Si==="settings"?"block":"none"}},Nr&&Ma.createElement($r,null)))))}},52154:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return We}});var le=Le(62957),Ke={ul:"ul___TdfYY"},it=Le(32637),bt=Le(59301),vt=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,Et=(Tt,ct)=>{var At={};for(var De in Tt)Oe.call(Tt,De)&&ct.indexOf(De)<0&&(At[De]=Tt[De]);if(Tt!=null&&vt)for(var De of vt(Tt))ct.indexOf(De)<0&&st.call(Tt,De)&&(At[De]=Tt[De]);return At},We=Tt=>{var ct=Tt,{open:At,onCancel:De}=ct,ne=Et(ct,["open","onCancel"]);return bt.createElement(le.default,{centered:!0,open:At,title:bt.createElement("div",{style:{fontWeight:"bold"}},"\u8054\u7CFB\u6559\u7814\u52A9\u7406"),width:"696px",onCancel:De,footer:null},bt.createElement("div",null,bt.createElement("div",{className:"tc"},bt.createElement("img",{className:"mt10",src:it,width:"182px",height:"181px",style:{borderRadius:"2px",border:"1px solid #D8E3E9"}})),bt.createElement("div",{style:{color:"#191919",fontWeight:"bold"},className:"tc font16 mt10"},"\u514D\u8D39\u6559\u7814\u52A9\u7406"),bt.createElement("div",{style:{color:"#191919",fontWeight:"bold"},className:"tc font16"},"\u5FAE\u4FE1\u626B\u4E00\u626B\u6DFB\u52A0"),bt.createElement("div",{style:{color:"#333"},className:"pt30 font14"},bt.createElement("ul",{className:Ke.ul},bt.createElement("li",null,"1\u3001\u89E3\u7B54\u8001\u5E08\u7591\u60D1\u3001\u5E2E\u52A9\u8001\u5E08\u66F4\u5FEB\u719F\u6089\u548C\u4F7F\u7528\u5E73\u53F0\u6559\u5B66\u3002"),bt.createElement("li",null,"2\u3001\u534F\u52A9\u8001\u5E08\u521B\u5EFA\u8BFE\u5802\u3001\u8BFE\u7A0B\u8BBE\u8BA1\u3001\u505A\u597D\u6559\u5B66\u5DE5\u4F5C\u3002"),bt.createElement("li",null,"3\u3001\u6839\u636E\u8001\u5E08\u6559\u5B66\u65B9\u5411\uFF0C\u5206\u4EAB\u5934\u6B4C\u5E73\u53F0C9\u9662\u6821\u3001985\u9AD8\u6821\u3001211\u9AD8\u6821\u3001\u53CC\u4E00\u6D41\u9AD8\u6821\u8001\u5E08\u7ECF\u5178\u5B9E\u8DF5\u6559\u5B66\u6848\u4F8B\u3002")))))}},58433:function(Zn,ei,Le){"use strict";Le.d(ei,{g:function(){return vt}});var le=Le(59301),Ke=Le(93629),it=Le(55305),bt=(Oe,st,Et)=>new Promise((ot,We)=>{var Tt=De=>{try{At(Et.next(De))}catch(ne){We(ne)}},ct=De=>{try{At(Et.throw(De))}catch(ne){We(ne)}},At=De=>De.done?ot(De.value):Promise.resolve(De.value).then(Tt,ct);At((Et=Et.apply(Oe,st)).next())});const vt=()=>{const[Oe,st]=(0,le.useState)([]);return(0,le.useEffect)(()=>{bt(void 0,null,function*(){const ot=yield(0,Ke.d1)({source:"question"});ot!=null&&ot.disciplines&&st((0,it.L)(ot==null?void 0:ot.disciplines))})},[]),Oe}},45937:function(Zn,ei,Le){"use strict";Le.d(ei,{U:function(){return ot}});var le=Le(59301),Ke=Object.defineProperty,it=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable,Oe=(We,Tt,ct)=>Tt in We?Ke(We,Tt,{enumerable:!0,configurable:!0,writable:!0,value:ct}):We[Tt]=ct,st=(We,Tt)=>{for(var ct in Tt||(Tt={}))bt.call(Tt,ct)&&Oe(We,ct,Tt[ct]);if(it)for(var ct of it(Tt))vt.call(Tt,ct)&&Oe(We,ct,Tt[ct]);return We},Et=(We,Tt,ct)=>new Promise((At,De)=>{var ne=se=>{try{de(ct.next(se))}catch(ge){De(ge)}},te=se=>{try{de(ct.throw(se))}catch(ge){De(ge)}},de=se=>se.done?At(se.value):Promise.resolve(se.value).then(ne,te);de((ct=ct.apply(We,Tt)).next())});function ot(We,Tt){const[ct,At]=(0,le.useState)(Tt),[De,ne]=(0,le.useState)(!1),[te,de]=(0,le.useState)();return[ct,De,(ge,ye=!1)=>Et(this,null,function*(){const we=ye?Tt:st(st({},ct),ge);ne(!0),At(we);const Ce=yield We(we);return ne(!1),de(Ce),Ce}),te,de]}},81428:function(Zn,ei,Le){"use strict";Le.d(ei,{AL:function(){return we},Iy:function(){return Tt},Qv:function(){return De},ez:function(){return ye},jb:function(){return ct}});var le=Le(32834),Ke=Le.n(le),it=Le(11690),bt=Le.n(it);let vt=1;function Oe(Qe,Ue){const dt=Qe.match(/^(\s+)(?:```)/);if(dt===null)return Ue;const $e=dt[1];return Ue.split(`
`).map(wt=>{const St=wt.match(/^\s+/);if(St===null)return wt;const[Lt]=St;return Lt.length>=$e.length?wt.slice($e.length):wt}).join(`
`)}let st=[],Et=["<ul>"];const ot=new(Ke()).Renderer,We=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Tt(){st.length=0,Et=["<ul>"]}const ct={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function At(Qe,Ue,dt,$e){if(Ue>=Qe.length||Qe[Ue].level<=dt)return Ue;var wt=Qe[Ue];$e.push("<li><a href='#"+vt+wt.anchor+"'>"+wt.text+"</a>"),Ue++;var St=[];return Ue=At(Qe,Ue,wt.level,St),St.length>0&&($e.push("<ul>"),St.forEach(function(Lt){$e.push(Lt)}),$e.push("</ul>")),$e.push("</li>"),Ue=At(Qe,Ue,dt,$e),Ue}function De(){return At(st,0,0,Et),Et.push("</ul>"),Et.join("")}const ne={heading(Qe){const Ue=We.exec(Qe);if(vt+=1,Ue)return{type:"heading",raw:Ue[0],depth:Ue[1].length,text:Ue[2]}},fences(Qe){const Ue=this.rules.block.fences.exec(Qe);if(Ue){const dt=Ue[0];let $e=Oe(dt,Ue[3]||"");const wt=Ue[2]?Ue[2].trim():Ue[2];if(["latex","katex","math"].indexOf(wt)>=0){const St=se(),Lt=$e;$e=St,ge[St]={type:"block",expression:Lt}}return{type:"code",raw:dt,lang:wt,text:$e}}}},te=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let de=0;const se=()=>`__special_katext_id_${de++}__`;let ge={};function ye(){return ge}function we(){de=0,ge={}}function Ce(Qe){return Qe=Qe.replace(te,(Ue,dt)=>{const $e=se();return ge[$e]={type:"inline",expression:dt},$e}),Qe}const _e=ot.listitem;ot.listitem=function(Qe){return _e(Ce(Qe))};const Ze=ot.paragraph;ot.paragraph=function(Qe){return Ze(Ce(Qe))};const lt=ot.tablecell;ot.tablecell=function(Qe,Ue){return lt(Ce(Qe),Ue)},ot.code=function(Qe,Ue,dt){const $e=(Ue||"").match(/\S*/)[0];return $e?["latex","katex","math"].indexOf($e)>=0?`<p class='editormd-tex'>${Qe}</p>`:`<pre class="prettyprint linenums"><code class="language-${Ue}">${dt?Qe:(0,it.escape)(Qe,!0)}</code></pre>
`:'<pre class="prettyprint linenums"><code>'+(dt?Qe:(0,it.escape)(Qe,!0))+"</code></pre>"},ot.heading=function(Qe,Ue,dt){let $e=this.options.headerPrefix+dt.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return st.push({anchor:$e,level:Ue,text:Qe}),"<h"+Ue+' id="'+vt+$e+'">'+Qe+"</h"+Ue+">"},Ke().setOptions({silent:!0,gfm:!0,pedantic:!1}),Ke().use({tokenizer:ne,renderer:ot}),ei.ZP=Ke()},71114:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Ue}});var le=Le(59301),Ke=Le(92310),it=Le.n(Ke),bt=Le(48755),vt=Le(83397),Oe=Le(93083),st=Le(63356),Et=Le(16931),ot=Le(51636);const We=dt=>{const{componentCls:$e,calc:wt}=dt;return{[$e]:Object.assign(Object.assign({},(0,st.Wf)(dt)),{margin:0,padding:0,listStyle:"none",[`${$e}-item`]:{position:"relative",margin:0,paddingBottom:dt.itemPaddingBottom,fontSize:dt.fontSize,listStyle:"none","&-tail":{position:"absolute",insetBlockStart:dt.itemHeadSize,insetInlineStart:wt(wt(dt.itemHeadSize).sub(dt.tailWidth)).div(2).equal(),height:`calc(100% - ${(0,Oe.unit)(dt.itemHeadSize)})`,borderInlineStart:`${(0,Oe.unit)(dt.tailWidth)} ${dt.lineType} ${dt.tailColor}`},"&-pending":{[`${$e}-item-head`]:{fontSize:dt.fontSizeSM,backgroundColor:"transparent"},[`${$e}-item-tail`]:{display:"none"}},"&-head":{position:"absolute",width:dt.itemHeadSize,height:dt.itemHeadSize,backgroundColor:dt.dotBg,border:`${(0,Oe.unit)(dt.dotBorderWidth)} ${dt.lineType} transparent`,borderRadius:"50%","&-blue":{color:dt.colorPrimary,borderColor:dt.colorPrimary},"&-red":{color:dt.colorError,borderColor:dt.colorError},"&-green":{color:dt.colorSuccess,borderColor:dt.colorSuccess},"&-gray":{color:dt.colorTextDisabled,borderColor:dt.colorTextDisabled}},"&-head-custom":{position:"absolute",insetBlockStart:wt(dt.itemHeadSize).div(2).equal(),insetInlineStart:wt(dt.itemHeadSize).div(2).equal(),width:"auto",height:"auto",marginBlockStart:0,paddingBlock:dt.customHeadPaddingVertical,lineHeight:1,textAlign:"center",border:0,borderRadius:0,transform:"translate(-50%, -50%)"},"&-content":{position:"relative",insetBlockStart:wt(wt(dt.fontSize).mul(dt.lineHeight).sub(dt.fontSize)).mul(-1).add(dt.lineWidth).equal(),marginInlineStart:wt(dt.margin).add(dt.itemHeadSize).equal(),marginInlineEnd:0,marginBlockStart:0,marginBlockEnd:0,wordBreak:"break-word"},"&-last":{[`> ${$e}-item-tail`]:{display:"none"},[`> ${$e}-item-content`]:{minHeight:wt(dt.controlHeightLG).mul(1.2).equal()}}},[`&${$e}-alternate,
&${$e}-right,
&${$e}-label`]:{[`${$e}-item`]:{"&-tail, &-head, &-head-custom":{insetInlineStart:"50%"},"&-head":{marginInlineStart:wt(dt.marginXXS).mul(-1).equal(),"&-custom":{marginInlineStart:wt(dt.tailWidth).div(2).equal()}},"&-left":{[`${$e}-item-content`]:{insetInlineStart:`calc(50% - ${(0,Oe.unit)(dt.marginXXS)})`,width:`calc(50% - ${(0,Oe.unit)(dt.marginSM)})`,textAlign:"start"}},"&-right":{[`${$e}-item-content`]:{width:`calc(50% - ${(0,Oe.unit)(dt.marginSM)})`,margin:0,textAlign:"end"}}}},[`&${$e}-right`]:{[`${$e}-item-right`]:{[`${$e}-item-tail,
${$e}-item-head,
${$e}-item-head-custom`]:{insetInlineStart:`calc(100% - ${(0,Oe.unit)(wt(wt(dt.itemHeadSize).add(dt.tailWidth)).div(2).equal())})`},[`${$e}-item-content`]:{width:`calc(100% - ${(0,Oe.unit)(wt(dt.itemHeadSize).add(dt.marginXS).equal())})`}}},[`&${$e}-pending
${$e}-item-last
${$e}-item-tail`]:{display:"block",height:`calc(100% - ${(0,Oe.unit)(dt.margin)})`,borderInlineStart:`${(0,Oe.unit)(dt.tailWidth)} dotted ${dt.tailColor}`},[`&${$e}-reverse
${$e}-item-last
${$e}-item-tail`]:{display:"none"},[`&${$e}-reverse ${$e}-item-pending`]:{[`${$e}-item-tail`]:{insetBlockStart:dt.margin,display:"block",height:`calc(100% - ${(0,Oe.unit)(dt.margin)})`,borderInlineStart:`${(0,Oe.unit)(dt.tailWidth)} dotted ${dt.tailColor}`},[`${$e}-item-content`]:{minHeight:wt(dt.controlHeightLG).mul(1.2).equal()}},[`&${$e}-label`]:{[`${$e}-item-label`]:{position:"absolute",insetBlockStart:wt(wt(dt.fontSize).mul(dt.lineHeight).sub(dt.fontSize)).mul(-1).add(dt.tailWidth).equal(),width:`calc(50% - ${(0,Oe.unit)(dt.marginSM)})`,textAlign:"end"},[`${$e}-item-right`]:{[`${$e}-item-label`]:{insetInlineStart:`calc(50% + ${(0,Oe.unit)(dt.marginSM)})`,width:`calc(50% - ${(0,Oe.unit)(dt.marginSM)})`,textAlign:"start"}}},"&-rtl":{direction:"rtl",[`${$e}-item-head-custom`]:{transform:"translate(50%, -50%)"}}})}},Tt=dt=>({tailColor:dt.colorSplit,tailWidth:dt.lineWidthBold,dotBorderWidth:dt.wireframe?dt.lineWidthBold:dt.lineWidth*3,dotBg:dt.colorBgContainer,itemPaddingBottom:dt.padding*1.25});var ct=(0,Et.I$)("Timeline",dt=>{const $e=(0,ot.mergeToken)(dt,{itemHeadSize:10,customHeadPaddingVertical:dt.paddingXXS,paddingInlineEnd:2});return[We($e)]},Tt),At=function(dt,$e){var wt={};for(var St in dt)Object.prototype.hasOwnProperty.call(dt,St)&&$e.indexOf(St)<0&&(wt[St]=dt[St]);if(dt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,St=Object.getOwnPropertySymbols(dt);Lt<St.length;Lt++)$e.indexOf(St[Lt])<0&&Object.prototype.propertyIsEnumerable.call(dt,St[Lt])&&(wt[St[Lt]]=dt[St[Lt]]);return wt},ne=dt=>{var{prefixCls:$e,className:wt,color:St="blue",dot:Lt,pending:pn=!1,position:en,label:vn,children:rn}=dt,nt=At(dt,["prefixCls","className","color","dot","pending","position","label","children"]);const{getPrefixCls:rt}=le.useContext(bt.E_),dn=rt("timeline",$e),ri=it()(`${dn}-item`,{[`${dn}-item-pending`]:pn},wt),Hn=/blue|red|green|gray/.test(St||"")?void 0:St,Wt=it()(`${dn}-item-head`,{[`${dn}-item-head-custom`]:!!Lt,[`${dn}-item-head-${St}`]:!Hn});return le.createElement("li",Object.assign({},nt,{className:ri}),vn&&le.createElement("div",{className:`${dn}-item-label`},vn),le.createElement("div",{className:`${dn}-item-tail`}),le.createElement("div",{className:Wt,style:{borderColor:Hn,color:Hn}},Lt),le.createElement("div",{className:`${dn}-item-content`},rn))},te=Le(95190),de=Le(58617),se=function(dt,$e){var wt={};for(var St in dt)Object.prototype.hasOwnProperty.call(dt,St)&&$e.indexOf(St)<0&&(wt[St]=dt[St]);if(dt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,St=Object.getOwnPropertySymbols(dt);Lt<St.length;Lt++)$e.indexOf(St[Lt])<0&&Object.prototype.propertyIsEnumerable.call(dt,St[Lt])&&(wt[St[Lt]]=dt[St[Lt]]);return wt},ye=dt=>{var{prefixCls:$e,className:wt,pending:St=!1,children:Lt,items:pn,rootClassName:en,reverse:vn=!1,direction:rn,hashId:nt,pendingDot:rt,mode:dn=""}=dt,ri=se(dt,["prefixCls","className","pending","children","items","rootClassName","reverse","direction","hashId","pendingDot","mode"]);const Hn=(ii,Gi)=>dn==="alternate"?ii==="right"?`${$e}-item-right`:ii==="left"?`${$e}-item-left`:Gi%2===0?`${$e}-item-left`:`${$e}-item-right`:dn==="left"?`${$e}-item-left`:dn==="right"?`${$e}-item-right`:ii==="right"?`${$e}-item-right`:"",Wt=(0,te.Z)(pn||[]),En=typeof St=="boolean"?null:St;St&&Wt.push({pending:!!St,dot:rt||le.createElement(de.Z,null),children:En}),vn&&Wt.reverse();const An=Wt.length,ci=`${$e}-item-last`,It=Wt.filter(ii=>!!ii).map((ii,Gi)=>{var ze;const Me=Gi===An-2?ci:"",Ee=Gi===An-1?ci:"",{className:Te}=ii,He=se(ii,["className"]);return le.createElement(ne,Object.assign({},He,{className:it()([Te,!vn&&St?Me:Ee,Hn((ze=ii==null?void 0:ii.position)!==null&&ze!==void 0?ze:"",Gi)]),key:(ii==null?void 0:ii.key)||Gi}))}),Pt=Wt.some(ii=>!!(ii!=null&&ii.label)),Nt=it()($e,{[`${$e}-pending`]:!!St,[`${$e}-reverse`]:!!vn,[`${$e}-${dn}`]:!!dn&&!Pt,[`${$e}-label`]:Pt,[`${$e}-rtl`]:rn==="rtl"},wt,en,nt);return le.createElement("ul",Object.assign({},ri,{className:Nt}),It)},we=Le(11592);function Ce(dt,$e){return dt&&Array.isArray(dt)?dt:(0,we.Z)($e).map(wt=>{var St,Lt;return Object.assign({children:(Lt=(St=wt==null?void 0:wt.props)===null||St===void 0?void 0:St.children)!==null&&Lt!==void 0?Lt:""},wt.props)})}var _e=Ce,Ze=function(dt,$e){var wt={};for(var St in dt)Object.prototype.hasOwnProperty.call(dt,St)&&$e.indexOf(St)<0&&(wt[St]=dt[St]);if(dt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,St=Object.getOwnPropertySymbols(dt);Lt<St.length;Lt++)$e.indexOf(St[Lt])<0&&Object.prototype.propertyIsEnumerable.call(dt,St[Lt])&&(wt[St[Lt]]=dt[St[Lt]]);return wt};const lt=dt=>{const{getPrefixCls:$e,direction:wt,timeline:St}=le.useContext(bt.E_),{prefixCls:Lt,children:pn,items:en,className:vn,style:rn}=dt,nt=Ze(dt,["prefixCls","children","items","className","style"]),rt=$e("timeline",Lt),dn=(0,vt.Z)(rt),[ri,Hn,Wt]=ct(rt,dn),En=_e(en,pn);return ri(le.createElement(ye,Object.assign({},nt,{className:it()(St==null?void 0:St.className,vn,Wt,dn),style:Object.assign(Object.assign({},St==null?void 0:St.style),rn),prefixCls:rt,direction:wt,items:En,hashId:Hn})))};lt.Item=ne;var Qe=lt,Ue=Qe},99498:function(Zn,ei,Le){(function(le){le(Le(89780))})(function(le){le.defineOption("placeholder","",function(Et,ot,We){var Tt=We&&We!=le.Init;if(ot&&!Tt)Et.on("blur",vt),Et.on("change",Oe),Et.on("swapDoc",Oe),le.on(Et.getInputField(),"compositionupdate",Et.state.placeholderCompose=function(){bt(Et)}),Oe(Et);else if(!ot&&Tt){Et.off("blur",vt),Et.off("change",Oe),Et.off("swapDoc",Oe),le.off(Et.getInputField(),"compositionupdate",Et.state.placeholderCompose),Ke(Et);var ct=Et.getWrapperElement();ct.className=ct.className.replace(" CodeMirror-empty","")}ot&&!Et.hasFocus()&&vt(Et)});function Ke(Et){Et.state.placeholder&&(Et.state.placeholder.parentNode.removeChild(Et.state.placeholder),Et.state.placeholder=null)}function it(Et){Ke(Et);var ot=Et.state.placeholder=document.createElement("pre");ot.style.cssText="height: 0; overflow: visible",ot.style.direction=Et.getOption("direction"),ot.className="CodeMirror-placeholder CodeMirror-line-like";var We=Et.getOption("placeholder");typeof We=="string"&&(We=document.createTextNode(We)),ot.appendChild(We),Et.display.lineSpace.insertBefore(ot,Et.display.lineSpace.firstChild)}function bt(Et){setTimeout(function(){var ot=!1,We=Et.getInputField();We.nodeName=="TEXTAREA"?ot=!We.value:Et.lineCount()==1&&(ot=!/[^\u200b]/.test(We.querySelector(".CodeMirror-line").textContent)),ot?it(Et):Ke(Et)},20)}function vt(Et){st(Et)&&it(Et)}function Oe(Et){var ot=Et.getWrapperElement(),We=st(Et);ot.className=ot.className.replace(" CodeMirror-empty","")+(We?" CodeMirror-empty":""),We?it(Et):Ke(Et)}function st(Et){return Et.lineCount()===1&&Et.getLine(0)===""}})},25717:function(Zn,ei,Le){(function(le){le(Le(89780))})(function(le){var Ke={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},it=le.Pos;le.defineOption("autoCloseBrackets",!1,function(ne,te,de){de&&de!=le.Init&&(ne.removeKeyMap(vt),ne.state.closeBrackets=null),te&&(Oe(bt(te,"pairs")),ne.state.closeBrackets=te,ne.addKeyMap(vt))});function bt(ne,te){return te=="pairs"&&typeof ne=="string"?ne:typeof ne=="object"&&ne[te]!=null?ne[te]:Ke[te]}var vt={Backspace:ot,Enter:We};function Oe(ne){for(var te=0;te<ne.length;te++){var de=ne.charAt(te),se="'"+de+"'";vt[se]||(vt[se]=st(de))}}Oe(Ke.pairs+"`");function st(ne){return function(te){return ct(te,ne)}}function Et(ne){var te=ne.state.closeBrackets;if(!te||te.override)return te;var de=ne.getModeAt(ne.getCursor());return de.closeBrackets||te}function ot(ne){var te=Et(ne);if(!te||ne.getOption("disableInput"))return le.Pass;for(var de=bt(te,"pairs"),se=ne.listSelections(),ge=0;ge<se.length;ge++){if(!se[ge].empty())return le.Pass;var ye=At(ne,se[ge].head);if(!ye||de.indexOf(ye)%2!=0)return le.Pass}for(var ge=se.length-1;ge>=0;ge--){var we=se[ge].head;ne.replaceRange("",it(we.line,we.ch-1),it(we.line,we.ch+1),"+delete")}}function We(ne){var te=Et(ne),de=te&&bt(te,"explode");if(!de||ne.getOption("disableInput"))return le.Pass;for(var se=ne.listSelections(),ge=0;ge<se.length;ge++){if(!se[ge].empty())return le.Pass;var ye=At(ne,se[ge].head);if(!ye||de.indexOf(ye)%2!=0)return le.Pass}ne.operation(function(){var we=ne.lineSeparator()||`
`;ne.replaceSelection(we+we,null),ne.execCommand("goCharLeft"),se=ne.listSelections();for(var Ce=0;Ce<se.length;Ce++){var _e=se[Ce].head.line;ne.indentLine(_e,null,!0),ne.indentLine(_e+1,null,!0)}})}function Tt(ne){var te=le.cmpPos(ne.anchor,ne.head)>0;return{anchor:new it(ne.anchor.line,ne.anchor.ch+(te?-1:1)),head:new it(ne.head.line,ne.head.ch+(te?1:-1))}}function ct(ne,te){var de=Et(ne);if(!de||ne.getOption("disableInput"))return le.Pass;var se=bt(de,"pairs"),ge=se.indexOf(te);if(ge==-1)return le.Pass;for(var ye=bt(de,"closeBefore"),we=bt(de,"triples"),Ce=se.charAt(ge+1)==te,_e=ne.listSelections(),Ze=ge%2==0,lt,Qe=0;Qe<_e.length;Qe++){var Ue=_e[Qe],dt=Ue.head,$e,wt=ne.getRange(dt,it(dt.line,dt.ch+1));if(Ze&&!Ue.empty())$e="surround";else if((Ce||!Ze)&&wt==te)Ce&&De(ne,dt)?$e="both":we.indexOf(te)>=0&&ne.getRange(dt,it(dt.line,dt.ch+3))==te+te+te?$e="skipThree":$e="skip";else if(Ce&&dt.ch>1&&we.indexOf(te)>=0&&ne.getRange(it(dt.line,dt.ch-2),dt)==te+te){if(dt.ch>2&&/\bstring/.test(ne.getTokenTypeAt(it(dt.line,dt.ch-2))))return le.Pass;$e="addFour"}else if(Ce){var St=dt.ch==0?" ":ne.getRange(it(dt.line,dt.ch-1),dt);if(!le.isWordChar(wt)&&St!=te&&!le.isWordChar(St))$e="both";else return le.Pass}else if(Ze&&(wt.length===0||/\s/.test(wt)||ye.indexOf(wt)>-1))$e="both";else return le.Pass;if(!lt)lt=$e;else if(lt!=$e)return le.Pass}var Lt=ge%2?se.charAt(ge-1):te,pn=ge%2?te:se.charAt(ge+1);ne.operation(function(){if(lt=="skip")ne.execCommand("goCharRight");else if(lt=="skipThree")for(var en=0;en<3;en++)ne.execCommand("goCharRight");else if(lt=="surround"){for(var vn=ne.getSelections(),en=0;en<vn.length;en++)vn[en]=Lt+vn[en]+pn;ne.replaceSelections(vn,"around"),vn=ne.listSelections().slice();for(var en=0;en<vn.length;en++)vn[en]=Tt(vn[en]);ne.setSelections(vn)}else lt=="both"?(ne.replaceSelection(Lt+pn,null),ne.triggerElectric(Lt+pn),ne.execCommand("goCharLeft")):lt=="addFour"&&(ne.replaceSelection(Lt+Lt+Lt+Lt,"before"),ne.execCommand("goCharRight"))})}function At(ne,te){var de=ne.getRange(it(te.line,te.ch-1),it(te.line,te.ch+1));return de.length==2?de:null}function De(ne,te){var de=ne.getTokenAt(it(te.line,te.ch+1));return/\bstring/.test(de.type)&&de.start==te.ch&&(te.ch==0||!/\bstring/.test(ne.getTokenTypeAt(te)))}})},6313:function(Zn,ei,Le){(function(le){le(Le(89780),Le(32855))})(function(le){le.defineOption("autoCloseTags",!1,function(ot,We,Tt){if(Tt!=le.Init&&Tt&&ot.removeKeyMap("autoCloseTags"),!!We){var ct={name:"autoCloseTags"};(typeof We!="object"||We.whenClosing!==!1)&&(ct["'/'"]=function(At){return Oe(At)}),(typeof We!="object"||We.whenOpening!==!1)&&(ct["'>'"]=function(At){return bt(At)}),ot.addKeyMap(ct)}});var Ke=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],it=["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 bt(ot){if(ot.getOption("disableInput"))return le.Pass;for(var We=ot.listSelections(),Tt=[],ct=ot.getOption("autoCloseTags"),At=0;At<We.length;At++){if(!We[At].empty())return le.Pass;var De=We[At].head,ne=ot.getTokenAt(De),te=le.innerMode(ot.getMode(),ne.state),de=te.state,se=te.mode.xmlCurrentTag&&te.mode.xmlCurrentTag(de),ge=se&&se.name;if(!ge)return le.Pass;var ye=te.mode.configuration=="html",we=typeof ct=="object"&&ct.dontCloseTags||ye&&Ke,Ce=typeof ct=="object"&&ct.indentTags||ye&&it;ne.end>De.ch&&(ge=ge.slice(0,ge.length-ne.end+De.ch));var _e=ge.toLowerCase();if(!ge||ne.type=="string"&&(ne.end!=De.ch||!/[\"\']/.test(ne.string.charAt(ne.string.length-1))||ne.string.length==1)||ne.type=="tag"&&se.close||ne.string.indexOf("/")==De.ch-ne.start-1||we&&st(we,_e)>-1||Et(ot,te.mode.xmlCurrentContext&&te.mode.xmlCurrentContext(de)||[],ge,De,!0))return le.Pass;var Ze=typeof ct=="object"&&ct.emptyTags;if(Ze&&st(Ze,ge)>-1){Tt[At]={text:"/>",newPos:le.Pos(De.line,De.ch+2)};continue}var lt=Ce&&st(Ce,_e)>-1;Tt[At]={indent:lt,text:">"+(lt?`
`:"")+"</"+ge+">",newPos:lt?le.Pos(De.line+1,0):le.Pos(De.line,De.ch+1)}}for(var Qe=typeof ct=="object"&&ct.dontIndentOnAutoClose,At=We.length-1;At>=0;At--){var Ue=Tt[At];ot.replaceRange(Ue.text,We[At].head,We[At].anchor,"+insert");var dt=ot.listSelections().slice(0);dt[At]={head:Ue.newPos,anchor:Ue.newPos},ot.setSelections(dt),!Qe&&Ue.indent&&(ot.indentLine(Ue.newPos.line,null,!0),ot.indentLine(Ue.newPos.line+1,null,!0))}}function vt(ot,We){for(var Tt=ot.listSelections(),ct=[],At=We?"/":"</",De=ot.getOption("autoCloseTags"),ne=typeof De=="object"&&De.dontIndentOnSlash,te=0;te<Tt.length;te++){if(!Tt[te].empty())return le.Pass;var de=Tt[te].head,se=ot.getTokenAt(de),ge=le.innerMode(ot.getMode(),se.state),ye=ge.state;if(We&&(se.type=="string"||se.string.charAt(0)!="<"||se.start!=de.ch-1))return le.Pass;var we,Ce=ge.mode.name!="xml"&&ot.getMode().name=="htmlmixed";if(Ce&&ge.mode.name=="javascript")we=At+"script";else if(Ce&&ge.mode.name=="css")we=At+"style";else{var _e=ge.mode.xmlCurrentContext&&ge.mode.xmlCurrentContext(ye);if(!_e||_e.length&&Et(ot,_e,_e[_e.length-1],de))return le.Pass;we=At+_e[_e.length-1]}ot.getLine(de.line).charAt(se.end)!=">"&&(we+=">"),ct[te]=we}if(ot.replaceSelections(ct),Tt=ot.listSelections(),!ne)for(var te=0;te<Tt.length;te++)(te==Tt.length-1||Tt[te].head.line<Tt[te+1].head.line)&&ot.indentLine(Tt[te].head.line)}function Oe(ot){return ot.getOption("disableInput")?le.Pass:vt(ot,!0)}le.commands.closeTag=function(ot){return vt(ot)};function st(ot,We){if(ot.indexOf)return ot.indexOf(We);for(var Tt=0,ct=ot.length;Tt<ct;++Tt)if(ot[Tt]==We)return Tt;return-1}function Et(ot,We,Tt,ct,At){if(!le.scanForClosingTag)return!1;var De=Math.min(ot.lastLine()+1,ct.line+500),ne=le.scanForClosingTag(ot,ct,null,De);if(!ne||ne.tag!=Tt)return!1;for(var te=At?1:0,de=We.length-1;de>=0&&We[de]==Tt;de--)++te;ct=ne.to;for(var de=1;de<te;de++){var se=le.scanForClosingTag(ot,ct,null,De);if(!se||se.tag!=Tt)return!1;ct=se.to}return!0}})},32855:function(Zn,ei,Le){(function(le){le(Le(89780))})(function(le){"use strict";var Ke=le.Pos;function it(de,se){return de.line-se.line||de.ch-se.ch}var bt="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",vt=bt+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Oe=new RegExp("<(/?)(["+bt+"]["+vt+"]*)","g");function st(de,se,ge,ye){this.line=se,this.ch=ge,this.cm=de,this.text=de.getLine(se),this.min=ye?Math.max(ye.from,de.firstLine()):de.firstLine(),this.max=ye?Math.min(ye.to-1,de.lastLine()):de.lastLine()}function Et(de,se){var ge=de.cm.getTokenTypeAt(Ke(de.line,se));return ge&&/\btag\b/.test(ge)}function ot(de){if(!(de.line>=de.max))return de.ch=0,de.text=de.cm.getLine(++de.line),!0}function We(de){if(!(de.line<=de.min))return de.text=de.cm.getLine(--de.line),de.ch=de.text.length,!0}function Tt(de){for(;;){var se=de.text.indexOf(">",de.ch);if(se==-1){if(ot(de))continue;return}if(!Et(de,se+1)){de.ch=se+1;continue}var ge=de.text.lastIndexOf("/",se),ye=ge>-1&&!/\S/.test(de.text.slice(ge+1,se));return de.ch=se+1,ye?"selfClose":"regular"}}function ct(de){for(;;){var se=de.ch?de.text.lastIndexOf("<",de.ch-1):-1;if(se==-1){if(We(de))continue;return}if(!Et(de,se+1)){de.ch=se;continue}Oe.lastIndex=se,de.ch=se;var ge=Oe.exec(de.text);if(ge&&ge.index==se)return ge}}function At(de){for(;;){Oe.lastIndex=de.ch;var se=Oe.exec(de.text);if(!se){if(ot(de))continue;return}if(!Et(de,se.index+1)){de.ch=se.index+1;continue}return de.ch=se.index+se[0].length,se}}function De(de){for(;;){var se=de.ch?de.text.lastIndexOf(">",de.ch-1):-1;if(se==-1){if(We(de))continue;return}if(!Et(de,se+1)){de.ch=se;continue}var ge=de.text.lastIndexOf("/",se),ye=ge>-1&&!/\S/.test(de.text.slice(ge+1,se));return de.ch=se+1,ye?"selfClose":"regular"}}function ne(de,se){for(var ge=[];;){var ye=At(de),we,Ce=de.line,_e=de.ch-(ye?ye[0].length:0);if(!ye||!(we=Tt(de)))return;if(we!="selfClose")if(ye[1]){for(var Ze=ge.length-1;Ze>=0;--Ze)if(ge[Ze]==ye[2]){ge.length=Ze;break}if(Ze<0&&(!se||se==ye[2]))return{tag:ye[2],from:Ke(Ce,_e),to:Ke(de.line,de.ch)}}else ge.push(ye[2])}}function te(de,se){for(var ge=[];;){var ye=De(de);if(!ye)return;if(ye=="selfClose"){ct(de);continue}var we=de.line,Ce=de.ch,_e=ct(de);if(!_e)return;if(_e[1])ge.push(_e[2]);else{for(var Ze=ge.length-1;Ze>=0;--Ze)if(ge[Ze]==_e[2]){ge.length=Ze;break}if(Ze<0&&(!se||se==_e[2]))return{tag:_e[2],from:Ke(de.line,de.ch),to:Ke(we,Ce)}}}}le.registerHelper("fold","xml",function(de,se){for(var ge=new st(de,se.line,0);;){var ye=At(ge);if(!ye||ge.line!=se.line)return;var we=Tt(ge);if(!we)return;if(!ye[1]&&we!="selfClose"){var Ce=Ke(ge.line,ge.ch),_e=ne(ge,ye[2]);return _e&&it(_e.from,Ce)>0?{from:Ce,to:_e.from}:null}}}),le.findMatchingTag=function(de,se,ge){var ye=new st(de,se.line,se.ch,ge);if(!(ye.text.indexOf(">")==-1&&ye.text.indexOf("<")==-1)){var we=Tt(ye),Ce=we&&Ke(ye.line,ye.ch),_e=we&&ct(ye);if(!(!we||!_e||it(ye,se)>0)){var Ze={from:Ke(ye.line,ye.ch),to:Ce,tag:_e[2]};return we=="selfClose"?{open:Ze,close:null,at:"open"}:_e[1]?{open:te(ye,_e[2]),close:Ze,at:"close"}:(ye=new st(de,Ce.line,Ce.ch,ge),{open:Ze,close:ne(ye,_e[2]),at:"open"})}}},le.findEnclosingTag=function(de,se,ge,ye){for(var we=new st(de,se.line,se.ch,ge);;){var Ce=te(we,ye);if(!Ce)break;var _e=new st(de,se.line,se.ch,ge),Ze=ne(_e,Ce.tag);if(Ze)return{open:Ce,close:Ze}}},le.scanForClosingTag=function(de,se,ge,ye){var we=new st(de,se.line,se.ch,ye?{from:0,to:ye}:null);return ne(we,ge)}})},89780:function(Zn){(function(ei,Le){Zn.exports=Le()})(this,function(){"use strict";var ei=navigator.userAgent,Le=navigator.platform,le=/gecko\/\d/i.test(ei),Ke=/MSIE \d/.test(ei),it=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ei),bt=/Edge\/(\d+)/.exec(ei),vt=Ke||it||bt,Oe=vt&&(Ke?document.documentMode||6:+(bt||it)[1]),st=!bt&&/WebKit\//.test(ei),Et=st&&/Qt\/\d+\.\d+/.test(ei),ot=!bt&&/Chrome\//.test(ei),We=/Opera\//.test(ei),Tt=/Apple Computer/.test(navigator.vendor),ct=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ei),At=/PhantomJS/.test(ei),De=!bt&&/AppleWebKit/.test(ei)&&/Mobile\/\w+/.test(ei),ne=/Android/.test(ei),te=De||ne||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ei),de=De||/Mac/.test(Le),se=/\bCrOS\b/.test(ei),ge=/win/i.test(Le),ye=We&&ei.match(/Version\/(\d*\.\d*)/);ye&&(ye=Number(ye[1])),ye&&ye>=15&&(We=!1,st=!0);var we=de&&(Et||We&&(ye==null||ye<12.11)),Ce=le||vt&&Oe>=9;function _e(ie){return new RegExp("(^|\\s)"+ie+"(?:$|\\s)\\s*")}var Ze=function(ie,ae){var fe=ie.className,ce=_e(ae).exec(fe);if(ce){var me=fe.slice(ce.index+ce[0].length);ie.className=fe.slice(0,ce.index)+(me?ce[1]+me:"")}};function lt(ie){for(var ae=ie.childNodes.length;ae>0;--ae)ie.removeChild(ie.firstChild);return ie}function Qe(ie,ae){return lt(ie).appendChild(ae)}function Ue(ie,ae,fe,ce){var me=document.createElement(ie);if(fe&&(me.className=fe),ce&&(me.style.cssText=ce),typeof ae=="string")me.appendChild(document.createTextNode(ae));else if(ae)for(var ke=0;ke<ae.length;++ke)me.appendChild(ae[ke]);return me}function dt(ie,ae,fe,ce){var me=Ue(ie,ae,fe,ce);return me.setAttribute("role","presentation"),me}var $e;document.createRange?$e=function(ie,ae,fe,ce){var me=document.createRange();return me.setEnd(ce||ie,fe),me.setStart(ie,ae),me}:$e=function(ie,ae,fe){var ce=document.body.createTextRange();try{ce.moveToElementText(ie.parentNode)}catch(me){return ce}return ce.collapse(!0),ce.moveEnd("character",fe),ce.moveStart("character",ae),ce};function wt(ie,ae){if(ae.nodeType==3&&(ae=ae.parentNode),ie.contains)return ie.contains(ae);do if(ae.nodeType==11&&(ae=ae.host),ae==ie)return!0;while(ae=ae.parentNode)}function St(){var ie;try{ie=document.activeElement}catch(ae){ie=document.body||null}for(;ie&&ie.shadowRoot&&ie.shadowRoot.activeElement;)ie=ie.shadowRoot.activeElement;return ie}function Lt(ie,ae){var fe=ie.className;_e(ae).test(fe)||(ie.className+=(fe?" ":"")+ae)}function pn(ie,ae){for(var fe=ie.split(" "),ce=0;ce<fe.length;ce++)fe[ce]&&!_e(fe[ce]).test(ae)&&(ae+=" "+fe[ce]);return ae}var en=function(ie){ie.select()};De?en=function(ie){ie.selectionStart=0,ie.selectionEnd=ie.value.length}:vt&&(en=function(ie){try{ie.select()}catch(ae){}});function vn(ie){var ae=Array.prototype.slice.call(arguments,1);return function(){return ie.apply(null,ae)}}function rn(ie,ae,fe){ae||(ae={});for(var ce in ie)ie.hasOwnProperty(ce)&&(fe!==!1||!ae.hasOwnProperty(ce))&&(ae[ce]=ie[ce]);return ae}function nt(ie,ae,fe,ce,me){ae==null&&(ae=ie.search(/[^\s\u00a0]/),ae==-1&&(ae=ie.length));for(var ke=ce||0,Ge=me||0;;){var Je=ie.indexOf(" ",ke);if(Je<0||Je>=ae)return Ge+(ae-ke);Ge+=Je-ke,Ge+=fe-Ge%fe,ke=Je+1}}var rt=function(){this.id=null,this.f=null,this.time=0,this.handler=vn(this.onTimeout,this)};rt.prototype.onTimeout=function(ie){ie.id=0,ie.time<=+new Date?ie.f():setTimeout(ie.handler,ie.time-+new Date)},rt.prototype.set=function(ie,ae){this.f=ae;var fe=+new Date+ie;(!this.id||fe<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,ie),this.time=fe)};function dn(ie,ae){for(var fe=0;fe<ie.length;++fe)if(ie[fe]==ae)return fe;return-1}var ri=50,Hn={toString:function(){return"CodeMirror.Pass"}},Wt={scroll:!1},En={origin:"*mouse"},An={origin:"+move"};function ci(ie,ae,fe){for(var ce=0,me=0;;){var ke=ie.indexOf(" ",ce);ke==-1&&(ke=ie.length);var Ge=ke-ce;if(ke==ie.length||me+Ge>=ae)return ce+Math.min(Ge,ae-me);if(me+=ke-ce,me+=fe-me%fe,ce=ke+1,me>=ae)return ce}}var It=[""];function Pt(ie){for(;It.length<=ie;)It.push(Nt(It)+" ");return It[ie]}function Nt(ie){return ie[ie.length-1]}function ii(ie,ae){for(var fe=[],ce=0;ce<ie.length;ce++)fe[ce]=ae(ie[ce],ce);return fe}function Gi(ie,ae,fe){for(var ce=0,me=fe(ae);ce<ie.length&&fe(ie[ce])<=me;)ce++;ie.splice(ce,0,ae)}function ze(){}function Me(ie,ae){var fe;return Object.create?fe=Object.create(ie):(ze.prototype=ie,fe=new ze),ae&&rn(ae,fe),fe}var Ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Te(ie){return/\w/.test(ie)||ie>"\x80"&&(ie.toUpperCase()!=ie.toLowerCase()||Ee.test(ie))}function He(ie,ae){return ae?ae.source.indexOf("\\w")>-1&&Te(ie)?!0:ae.test(ie):Te(ie)}function Ae(ie){for(var ae in ie)if(ie.hasOwnProperty(ae)&&ie[ae])return!1;return!0}var qe=/[\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 an(ie){return ie.charCodeAt(0)>=768&&qe.test(ie)}function Xt(ie,ae,fe){for(;(fe<0?ae>0:ae<ie.length)&&an(ie.charAt(ae));)ae+=fe;return ae}function yn(ie,ae,fe){for(var ce=ae>fe?-1:1;;){if(ae==fe)return ae;var me=(ae+fe)/2,ke=ce<0?Math.ceil(me):Math.floor(me);if(ke==ae)return ie(ke)?ae:fe;ie(ke)?fe=ke:ae=ke+ce}}function kt(ie,ae,fe,ce){if(!ie)return ce(ae,fe,"ltr",0);for(var me=!1,ke=0;ke<ie.length;++ke){var Ge=ie[ke];(Ge.from<fe&&Ge.to>ae||ae==fe&&Ge.to==ae)&&(ce(Math.max(Ge.from,ae),Math.min(Ge.to,fe),Ge.level==1?"rtl":"ltr",ke),me=!0)}me||ce(ae,fe,"ltr")}var Dt=null;function Zt(ie,ae,fe){var ce;Dt=null;for(var me=0;me<ie.length;++me){var ke=ie[me];if(ke.from<ae&&ke.to>ae)return me;ke.to==ae&&(ke.from!=ke.to&&fe=="before"?ce=me:Dt=me),ke.from==ae&&(ke.from!=ke.to&&fe!="before"?ce=me:Dt=me)}return ce!=null?ce:Dt}var hn=function(){var ie="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",ae="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function fe(yt){return yt<=247?ie.charAt(yt):1424<=yt&&yt<=1524?"R":1536<=yt&&yt<=1785?ae.charAt(yt-1536):1774<=yt&&yt<=2220?"r":8192<=yt&&yt<=8203?"w":yt==8204?"b":"L"}var ce=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,me=/[stwN]/,ke=/[LRr]/,Ge=/[Lb1n]/,Je=/[1n]/;function Ye(yt,sn,Ft){this.level=yt,this.from=sn,this.to=Ft}return function(yt,sn){var Ft=sn=="ltr"?"L":"R";if(yt.length==0||sn=="ltr"&&!ce.test(yt))return!1;for(var jn=yt.length,kn=[],ir=0;ir<jn;++ir)kn.push(fe(yt.charCodeAt(ir)));for(var hr=0,Lr=Ft;hr<jn;++hr){var qr=kn[hr];qr=="m"?kn[hr]=Lr:Lr=qr}for(var Ao=0,ho=Ft;Ao<jn;++Ao){var jo=kn[Ao];jo=="1"&&ho=="r"?kn[Ao]="n":ke.test(jo)&&(ho=jo,jo=="r"&&(kn[Ao]="R"))}for(var xa=1,co=kn[0];xa<jn-1;++xa){var Ra=kn[xa];Ra=="+"&&co=="1"&&kn[xa+1]=="1"?kn[xa]="1":Ra==","&&co==kn[xa+1]&&(co=="1"||co=="n")&&(kn[xa]=co),co=Ra}for(var Es=0;Es<jn;++Es){var nl=kn[Es];if(nl==",")kn[Es]="N";else if(nl=="%"){var Ms=void 0;for(Ms=Es+1;Ms<jn&&kn[Ms]=="%";++Ms);for(var zl=Es&&kn[Es-1]=="!"||Ms<jn&&kn[Ms]=="1"?"1":"N",ml=Es;ml<Ms;++ml)kn[ml]=zl;Es=Ms-1}}for(var Us=0,eu=Ft;Us<jn;++Us){var ll=kn[Us];eu=="L"&&ll=="1"?kn[Us]="L":ke.test(ll)&&(eu=ll)}for(var Ws=0;Ws<jn;++Ws)if(me.test(kn[Ws])){var Qa=void 0;for(Qa=Ws+1;Qa<jn&&me.test(kn[Qa]);++Qa);for(var Ds=(Ws?kn[Ws-1]:Ft)=="L",il=(Qa<jn?kn[Qa]:Ft)=="L",ul=Ds==il?Ds?"L":"R":Ft,ku=Ws;ku<Qa;++ku)kn[ku]=ul;Ws=Qa-1}for(var Fs=[],ve,xe=0;xe<jn;)if(Ge.test(kn[xe])){var Be=xe;for(++xe;xe<jn&&Ge.test(kn[xe]);++xe);Fs.push(new Ye(0,Be,xe))}else{var je=xe,et=Fs.length,tt=sn=="rtl"?1:0;for(++xe;xe<jn&&kn[xe]!="L";++xe);for(var gt=je;gt<xe;)if(Je.test(kn[gt])){je<gt&&(Fs.splice(et,0,new Ye(1,je,gt)),et+=tt);var xt=gt;for(++gt;gt<xe&&Je.test(kn[gt]);++gt);Fs.splice(et,0,new Ye(2,xt,gt)),et+=tt,je=gt}else++gt;je<xe&&Fs.splice(et,0,new Ye(1,je,xe))}return sn=="ltr"&&(Fs[0].level==1&&(ve=yt.match(/^\s+/))&&(Fs[0].from=ve[0].length,Fs.unshift(new Ye(0,0,ve[0].length))),Nt(Fs).level==1&&(ve=yt.match(/\s+$/))&&(Nt(Fs).to-=ve[0].length,Fs.push(new Ye(0,jn-ve[0].length,jn)))),sn=="rtl"?Fs.reverse():Fs}}();function wn(ie,ae){var fe=ie.order;return fe==null&&(fe=ie.order=hn(ie.text,ae)),fe}var Dn=[],Tn=function(ie,ae,fe){if(ie.addEventListener)ie.addEventListener(ae,fe,!1);else if(ie.attachEvent)ie.attachEvent("on"+ae,fe);else{var ce=ie._handlers||(ie._handlers={});ce[ae]=(ce[ae]||Dn).concat(fe)}};function Mi(ie,ae){return ie._handlers&&ie._handlers[ae]||Dn}function tn(ie,ae,fe){if(ie.removeEventListener)ie.removeEventListener(ae,fe,!1);else if(ie.detachEvent)ie.detachEvent("on"+ae,fe);else{var ce=ie._handlers,me=ce&&ce[ae];if(me){var ke=dn(me,fe);ke>-1&&(ce[ae]=me.slice(0,ke).concat(me.slice(ke+1)))}}}function qt(ie,ae){var fe=Mi(ie,ae);if(fe.length)for(var ce=Array.prototype.slice.call(arguments,2),me=0;me<fe.length;++me)fe[me].apply(null,ce)}function un(ie,ae,fe){return typeof ae=="string"&&(ae={type:ae,preventDefault:function(){this.defaultPrevented=!0}}),qt(ie,fe||ae.type,ie,ae),gi(ae)||ae.codemirrorIgnore}function zn(ie){var ae=ie._handlers&&ie._handlers.cursorActivity;if(ae)for(var fe=ie.curOp.cursorActivityHandlers||(ie.curOp.cursorActivityHandlers=[]),ce=0;ce<ae.length;++ce)dn(fe,ae[ce])==-1&&fe.push(ae[ce])}function on(ie,ae){return Mi(ie,ae).length>0}function Sn(ie){ie.prototype.on=function(ae,fe){Tn(this,ae,fe)},ie.prototype.off=function(ae,fe){tn(this,ae,fe)}}function di(ie){ie.preventDefault?ie.preventDefault():ie.returnValue=!1}function Ui(ie){ie.stopPropagation?ie.stopPropagation():ie.cancelBubble=!0}function gi(ie){return ie.defaultPrevented!=null?ie.defaultPrevented:ie.returnValue==!1}function Hi(ie){di(ie),Ui(ie)}function kr(ie){return ie.target||ie.srcElement}function Gn(ie){var ae=ie.which;return ae==null&&(ie.button&1?ae=1:ie.button&2?ae=3:ie.button&4&&(ae=2)),de&&ie.ctrlKey&&ae==1&&(ae=3),ae}var On=function(){if(vt&&Oe<9)return!1;var ie=Ue("div");return"draggable"in ie||"dragDrop"in ie}(),Xn;function wi(ie){if(Xn==null){var ae=Ue("span","\u200B");Qe(ie,Ue("span",[ae,document.createTextNode("x")])),ie.firstChild.offsetHeight!=0&&(Xn=ae.offsetWidth<=1&&ae.offsetHeight>2&&!(vt&&Oe<8))}var fe=Xn?Ue("span","\u200B"):Ue("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return fe.setAttribute("cm-text",""),fe}var nr;function ji(ie){if(nr!=null)return nr;var ae=Qe(ie,document.createTextNode("A\u062EA")),fe=$e(ae,0,1).getBoundingClientRect(),ce=$e(ae,1,2).getBoundingClientRect();return lt(ie),!fe||fe.left==fe.right?!1:nr=ce.right-fe.right<3}var Cr=`
b`.split(/\n/).length!=3?function(ie){for(var ae=0,fe=[],ce=ie.length;ae<=ce;){var me=ie.indexOf(`
`,ae);me==-1&&(me=ie.length);var ke=ie.slice(ae,ie.charAt(me-1)=="\r"?me-1:me),Ge=ke.indexOf("\r");Ge!=-1?(fe.push(ke.slice(0,Ge)),ae+=Ge+1):(fe.push(ke),ae=me+1)}return fe}:function(ie){return ie.split(/\r\n?|\n/)},be=window.getSelection?function(ie){try{return ie.selectionStart!=ie.selectionEnd}catch(ae){return!1}}:function(ie){var ae;try{ae=ie.ownerDocument.selection.createRange()}catch(fe){}return!ae||ae.parentElement()!=ie?!1:ae.compareEndPoints("StartToEnd",ae)!=0},mn=function(){var ie=Ue("div");return"oncopy"in ie?!0:(ie.setAttribute("oncopy","return;"),typeof ie.oncopy=="function")}(),fi=null;function Vn(ie){if(fi!=null)return fi;var ae=Qe(ie,Ue("span","x")),fe=ae.getBoundingClientRect(),ce=$e(ae,0,1).getBoundingClientRect();return fi=Math.abs(fe.left-ce.left)>1}var si={},Di={};function Ni(ie,ae){arguments.length>2&&(ae.dependencies=Array.prototype.slice.call(arguments,2)),si[ie]=ae}function yr(ie,ae){Di[ie]=ae}function zt(ie){if(typeof ie=="string"&&Di.hasOwnProperty(ie))ie=Di[ie];else if(ie&&typeof ie.name=="string"&&Di.hasOwnProperty(ie.name)){var ae=Di[ie.name];typeof ae=="string"&&(ae={name:ae}),ie=Me(ae,ie),ie.name=ae.name}else{if(typeof ie=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(ie))return zt("application/xml");if(typeof ie=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(ie))return zt("application/json")}return typeof ie=="string"?{name:ie}:ie||{name:"null"}}function Mt(ie,ae){ae=zt(ae);var fe=si[ae.name];if(!fe)return Mt(ie,"text/plain");var ce=fe(ie,ae);if(_t.hasOwnProperty(ae.name)){var me=_t[ae.name];for(var ke in me)me.hasOwnProperty(ke)&&(ce.hasOwnProperty(ke)&&(ce["_"+ke]=ce[ke]),ce[ke]=me[ke])}if(ce.name=ae.name,ae.helperType&&(ce.helperType=ae.helperType),ae.modeProps)for(var Ge in ae.modeProps)ce[Ge]=ae.modeProps[Ge];return ce}var _t={};function fn(ie,ae){var fe=_t.hasOwnProperty(ie)?_t[ie]:_t[ie]={};rn(ae,fe)}function Ji(ie,ae){if(ae===!0)return ae;if(ie.copyState)return ie.copyState(ae);var fe={};for(var ce in ae){var me=ae[ce];me instanceof Array&&(me=me.concat([])),fe[ce]=me}return fe}function mi(ie,ae){for(var fe;ie.innerMode&&(fe=ie.innerMode(ae),!(!fe||fe.mode==ie));)ae=fe.state,ie=fe.mode;return fe||{mode:ie,state:ae}}function $i(ie,ae,fe){return ie.startState?ie.startState(ae,fe):!0}var xn=function(ie,ae,fe){this.pos=this.start=0,this.string=ie,this.tabSize=ae||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=fe};xn.prototype.eol=function(){return this.pos>=this.string.length},xn.prototype.sol=function(){return this.pos==this.lineStart},xn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},xn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},xn.prototype.eat=function(ie){var ae=this.string.charAt(this.pos),fe;if(typeof ie=="string"?fe=ae==ie:fe=ae&&(ie.test?ie.test(ae):ie(ae)),fe)return++this.pos,ae},xn.prototype.eatWhile=function(ie){for(var ae=this.pos;this.eat(ie););return this.pos>ae},xn.prototype.eatSpace=function(){for(var ie=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>ie},xn.prototype.skipToEnd=function(){this.pos=this.string.length},xn.prototype.skipTo=function(ie){var ae=this.string.indexOf(ie,this.pos);if(ae>-1)return this.pos=ae,!0},xn.prototype.backUp=function(ie){this.pos-=ie},xn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=nt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?nt(this.string,this.lineStart,this.tabSize):0)},xn.prototype.indentation=function(){return nt(this.string,null,this.tabSize)-(this.lineStart?nt(this.string,this.lineStart,this.tabSize):0)},xn.prototype.match=function(ie,ae,fe){if(typeof ie=="string"){var ce=function(Ge){return fe?Ge.toLowerCase():Ge},me=this.string.substr(this.pos,ie.length);if(ce(me)==ce(ie))return ae!==!1&&(this.pos+=ie.length),!0}else{var ke=this.string.slice(this.pos).match(ie);return ke&&ke.index>0?null:(ke&&ae!==!1&&(this.pos+=ke[0].length),ke)}},xn.prototype.current=function(){return this.string.slice(this.start,this.pos)},xn.prototype.hideFirstChars=function(ie,ae){this.lineStart+=ie;try{return ae()}finally{this.lineStart-=ie}},xn.prototype.lookAhead=function(ie){var ae=this.lineOracle;return ae&&ae.lookAhead(ie)},xn.prototype.baseToken=function(){var ie=this.lineOracle;return ie&&ie.baseToken(this.pos)};function ni(ie,ae){if(ae-=ie.first,ae<0||ae>=ie.size)throw new Error("There is no line "+(ae+ie.first)+" in the document.");for(var fe=ie;!fe.lines;)for(var ce=0;;++ce){var me=fe.children[ce],ke=me.chunkSize();if(ae<ke){fe=me;break}ae-=ke}return fe.lines[ae]}function sr(ie,ae,fe){var ce=[],me=ae.line;return ie.iter(ae.line,fe.line+1,function(ke){var Ge=ke.text;me==fe.line&&(Ge=Ge.slice(0,fe.ch)),me==ae.line&&(Ge=Ge.slice(ae.ch)),ce.push(Ge),++me}),ce}function br(ie,ae,fe){var ce=[];return ie.iter(ae,fe,function(me){ce.push(me.text)}),ce}function Yn(ie,ae){var fe=ae-ie.height;if(fe)for(var ce=ie;ce;ce=ce.parent)ce.height+=fe}function at(ie){if(ie.parent==null)return null;for(var ae=ie.parent,fe=dn(ae.lines,ie),ce=ae.parent;ce;ae=ce,ce=ce.parent)for(var me=0;ce.children[me]!=ae;++me)fe+=ce.children[me].chunkSize();return fe+ae.first}function Bt(ie,ae){var fe=ie.first;e:do{for(var ce=0;ce<ie.children.length;++ce){var me=ie.children[ce],ke=me.height;if(ae<ke){ie=me;continue e}ae-=ke,fe+=me.chunkSize()}return fe}while(!ie.lines);for(var Ge=0;Ge<ie.lines.length;++Ge){var Je=ie.lines[Ge],Ye=Je.height;if(ae<Ye)break;ae-=Ye}return fe+Ge}function Kn(ie,ae){return ae>=ie.first&&ae<ie.first+ie.size}function li(ie,ae){return String(ie.lineNumberFormatter(ae+ie.firstLineNumber))}function Qt(ie,ae,fe){if(fe===void 0&&(fe=null),!(this instanceof Qt))return new Qt(ie,ae,fe);this.line=ie,this.ch=ae,this.sticky=fe}function jt(ie,ae){return ie.line-ae.line||ie.ch-ae.ch}function Un(ie,ae){return ie.sticky==ae.sticky&&jt(ie,ae)==0}function ai(ie){return Qt(ie.line,ie.ch)}function Vi(ie,ae){return jt(ie,ae)<0?ae:ie}function xi(ie,ae){return jt(ie,ae)<0?ie:ae}function Bi(ie,ae){return Math.max(ie.first,Math.min(ae,ie.first+ie.size-1))}function Ii(ie,ae){if(ae.line<ie.first)return Qt(ie.first,0);var fe=ie.first+ie.size-1;return ae.line>fe?Qt(fe,ni(ie,fe).text.length):Pr(ae,ni(ie,ae.line).text.length)}function Pr(ie,ae){var fe=ie.ch;return fe==null||fe>ae?Qt(ie.line,ae):fe<0?Qt(ie.line,0):ie}function xr(ie,ae){for(var fe=[],ce=0;ce<ae.length;ce++)fe[ce]=Ii(ie,ae[ce]);return fe}var _n=function(ie,ae){this.state=ie,this.lookAhead=ae},ki=function(ie,ae,fe,ce){this.state=ae,this.doc=ie,this.line=fe,this.maxLookAhead=ce||0,this.baseTokens=null,this.baseTokenPos=1};ki.prototype.lookAhead=function(ie){var ae=this.doc.getLine(this.line+ie);return ae!=null&&ie>this.maxLookAhead&&(this.maxLookAhead=ie),ae},ki.prototype.baseToken=function(ie){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=ie;)this.baseTokenPos+=2;var ae=this.baseTokens[this.baseTokenPos+1];return{type:ae&&ae.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-ie}},ki.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ki.fromSaved=function(ie,ae,fe){return ae instanceof _n?new ki(ie,Ji(ie.mode,ae.state),fe,ae.lookAhead):new ki(ie,Ji(ie.mode,ae),fe)},ki.prototype.save=function(ie){var ae=ie!==!1?Ji(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new _n(ae,this.maxLookAhead):ae};function Ar(ie,ae,fe,ce){var me=[ie.state.modeGen],ke={};mo(ie,ae.text,ie.doc.mode,fe,function(yt,sn){return me.push(yt,sn)},ke,ce);for(var Ge=fe.state,Je=function(yt){fe.baseTokens=me;var sn=ie.state.overlays[yt],Ft=1,jn=0;fe.state=!0,mo(ie,ae.text,sn.mode,fe,function(kn,ir){for(var hr=Ft;jn<kn;){var Lr=me[Ft];Lr>kn&&me.splice(Ft,1,kn,me[Ft+1],Lr),Ft+=2,jn=Math.min(kn,Lr)}if(ir)if(sn.opaque)me.splice(hr,Ft-hr,kn,"overlay "+ir),Ft=hr+2;else for(;hr<Ft;hr+=2){var qr=me[hr+1];me[hr+1]=(qr?qr+" ":"")+"overlay "+ir}},ke),fe.state=Ge,fe.baseTokens=null,fe.baseTokenPos=1},Ye=0;Ye<ie.state.overlays.length;++Ye)Je(Ye);return{styles:me,classes:ke.bgClass||ke.textClass?ke:null}}function Vr(ie,ae,fe){if(!ae.styles||ae.styles[0]!=ie.state.modeGen){var ce=xo(ie,at(ae)),me=ae.text.length>ie.options.maxHighlightLength&&Ji(ie.doc.mode,ce.state),ke=Ar(ie,ae,ce);me&&(ce.state=me),ae.stateAfter=ce.save(!me),ae.styles=ke.styles,ke.classes?ae.styleClasses=ke.classes:ae.styleClasses&&(ae.styleClasses=null),fe===ie.doc.highlightFrontier&&(ie.doc.modeFrontier=Math.max(ie.doc.modeFrontier,++ie.doc.highlightFrontier))}return ae.styles}function xo(ie,ae,fe){var ce=ie.doc,me=ie.display;if(!ce.mode.startState)return new ki(ce,!0,ae);var ke=fo(ie,ae,fe),Ge=ke>ce.first&&ni(ce,ke-1).stateAfter,Je=Ge?ki.fromSaved(ce,Ge,ke):new ki(ce,$i(ce.mode),ke);return ce.iter(ke,ae,function(Ye){Ot(ie,Ye.text,Je);var yt=Je.line;Ye.stateAfter=yt==ae-1||yt%5==0||yt>=me.viewFrom&&yt<me.viewTo?Je.save():null,Je.nextLine()}),fe&&(ce.modeFrontier=Je.line),Je}function Ot(ie,ae,fe,ce){var me=ie.doc.mode,ke=new xn(ae,ie.options.tabSize,fe);for(ke.start=ke.pos=ce||0,ae==""&&Li(me,fe.state);!ke.eol();)Sr(me,ke,fe.state),ke.start=ke.pos}function Li(ie,ae){if(ie.blankLine)return ie.blankLine(ae);if(ie.innerMode){var fe=mi(ie,ae);if(fe.mode.blankLine)return fe.mode.blankLine(fe.state)}}function Sr(ie,ae,fe,ce){for(var me=0;me<10;me++){ce&&(ce[0]=mi(ie,fe).mode);var ke=ie.token(ae,fe);if(ae.pos>ae.start)return ke}throw new Error("Mode "+ie.name+" failed to advance stream.")}var Ri=function(ie,ae,fe){this.start=ie.start,this.end=ie.pos,this.string=ie.current(),this.type=ae||null,this.state=fe};function po(ie,ae,fe,ce){var me=ie.doc,ke=me.mode,Ge;ae=Ii(me,ae);var Je=ni(me,ae.line),Ye=xo(ie,ae.line,fe),yt=new xn(Je.text,ie.options.tabSize,Ye),sn;for(ce&&(sn=[]);(ce||yt.pos<ae.ch)&&!yt.eol();)yt.start=yt.pos,Ge=Sr(ke,yt,Ye.state),ce&&sn.push(new Ri(yt,Ge,Ji(me.mode,Ye.state)));return ce?sn:new Ri(yt,Ge,Ye.state)}function Qr(ie,ae){if(ie)for(;;){var fe=ie.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!fe)break;ie=ie.slice(0,fe.index)+ie.slice(fe.index+fe[0].length);var ce=fe[1]?"bgClass":"textClass";ae[ce]==null?ae[ce]=fe[2]:new RegExp("(?:^|\\s)"+fe[2]+"(?:$|\\s)").test(ae[ce])||(ae[ce]+=" "+fe[2])}return ie}function mo(ie,ae,fe,ce,me,ke,Ge){var Je=fe.flattenSpans;Je==null&&(Je=ie.options.flattenSpans);var Ye=0,yt=null,sn=new xn(ae,ie.options.tabSize,ce),Ft,jn=ie.options.addModeClass&&[null];for(ae==""&&Qr(Li(fe,ce.state),ke);!sn.eol();){if(sn.pos>ie.options.maxHighlightLength?(Je=!1,Ge&&Ot(ie,ae,ce,sn.pos),sn.pos=ae.length,Ft=null):Ft=Qr(Sr(fe,sn,ce.state,jn),ke),jn){var kn=jn[0].name;kn&&(Ft="m-"+(Ft?kn+" "+Ft:kn))}if(!Je||yt!=Ft){for(;Ye<sn.start;)Ye=Math.min(sn.start,Ye+5e3),me(Ye,yt);yt=Ft}sn.start=sn.pos}for(;Ye<sn.pos;){var ir=Math.min(sn.pos,Ye+5e3);me(ir,yt),Ye=ir}}function fo(ie,ae,fe){for(var ce,me,ke=ie.doc,Ge=fe?-1:ae-(ie.doc.mode.innerMode?1e3:100),Je=ae;Je>Ge;--Je){if(Je<=ke.first)return ke.first;var Ye=ni(ke,Je-1),yt=Ye.stateAfter;if(yt&&(!fe||Je+(yt instanceof _n?yt.lookAhead:0)<=ke.modeFrontier))return Je;var sn=nt(Ye.text,null,ie.options.tabSize);(me==null||ce>sn)&&(me=Je-1,ce=sn)}return me}function wo(ie,ae){if(ie.modeFrontier=Math.min(ie.modeFrontier,ae),!(ie.highlightFrontier<ae-10)){for(var fe=ie.first,ce=ae-1;ce>fe;ce--){var me=ni(ie,ce).stateAfter;if(me&&(!(me instanceof _n)||ce+me.lookAhead<ae)){fe=ce+1;break}}ie.highlightFrontier=Math.min(ie.highlightFrontier,fe)}}var Io=!1,Bn=!1;function ca(){Io=!0}function In(){Bn=!0}function Er(ie,ae,fe){this.marker=ie,this.from=ae,this.to=fe}function Do(ie,ae){if(ie)for(var fe=0;fe<ie.length;++fe){var ce=ie[fe];if(ce.marker==ae)return ce}}function wr(ie,ae){for(var fe,ce=0;ce<ie.length;++ce)ie[ce]!=ae&&(fe||(fe=[])).push(ie[ce]);return fe}function Qo(ie,ae){ie.markedSpans=ie.markedSpans?ie.markedSpans.concat([ae]):[ae],ae.marker.attachLine(ie)}function To(ie,ae,fe){var ce;if(ie)for(var me=0;me<ie.length;++me){var ke=ie[me],Ge=ke.marker,Je=ke.from==null||(Ge.inclusiveLeft?ke.from<=ae:ke.from<ae);if(Je||ke.from==ae&&Ge.type=="bookmark"&&(!fe||!ke.marker.insertLeft)){var Ye=ke.to==null||(Ge.inclusiveRight?ke.to>=ae:ke.to>ae);(ce||(ce=[])).push(new Er(Ge,ke.from,Ye?null:ke.to))}}return ce}function ro(ie,ae,fe){var ce;if(ie)for(var me=0;me<ie.length;++me){var ke=ie[me],Ge=ke.marker,Je=ke.to==null||(Ge.inclusiveRight?ke.to>=ae:ke.to>ae);if(Je||ke.from==ae&&Ge.type=="bookmark"&&(!fe||ke.marker.insertLeft)){var Ye=ke.from==null||(Ge.inclusiveLeft?ke.from<=ae:ke.from<ae);(ce||(ce=[])).push(new Er(Ge,Ye?null:ke.from-ae,ke.to==null?null:ke.to-ae))}}return ce}function fa(ie,ae){if(ae.full)return null;var fe=Kn(ie,ae.from.line)&&ni(ie,ae.from.line).markedSpans,ce=Kn(ie,ae.to.line)&&ni(ie,ae.to.line).markedSpans;if(!fe&&!ce)return null;var me=ae.from.ch,ke=ae.to.ch,Ge=jt(ae.from,ae.to)==0,Je=To(fe,me,Ge),Ye=ro(ce,ke,Ge),yt=ae.text.length==1,sn=Nt(ae.text).length+(yt?me:0);if(Je)for(var Ft=0;Ft<Je.length;++Ft){var jn=Je[Ft];if(jn.to==null){var kn=Do(Ye,jn.marker);kn?yt&&(jn.to=kn.to==null?null:kn.to+sn):jn.to=me}}if(Ye)for(var ir=0;ir<Ye.length;++ir){var hr=Ye[ir];if(hr.to!=null&&(hr.to+=sn),hr.from==null){var Lr=Do(Je,hr.marker);Lr||(hr.from=sn,yt&&(Je||(Je=[])).push(hr))}else hr.from+=sn,yt&&(Je||(Je=[])).push(hr)}Je&&(Je=Yt(Je)),Ye&&Ye!=Je&&(Ye=Yt(Ye));var qr=[Je];if(!yt){var Ao=ae.text.length-2,ho;if(Ao>0&&Je)for(var jo=0;jo<Je.length;++jo)Je[jo].to==null&&(ho||(ho=[])).push(new Er(Je[jo].marker,null,null));for(var xa=0;xa<Ao;++xa)qr.push(ho);qr.push(Ye)}return qr}function Yt(ie){for(var ae=0;ae<ie.length;++ae){var fe=ie[ae];fe.from!=null&&fe.from==fe.to&&fe.marker.clearWhenEmpty!==!1&&ie.splice(ae--,1)}return ie.length?ie:null}function Rn(ie,ae,fe){var ce=null;if(ie.iter(ae.line,fe.line+1,function(kn){if(kn.markedSpans)for(var ir=0;ir<kn.markedSpans.length;++ir){var hr=kn.markedSpans[ir].marker;hr.readOnly&&(!ce||dn(ce,hr)==-1)&&(ce||(ce=[])).push(hr)}}),!ce)return null;for(var me=[{from:ae,to:fe}],ke=0;ke<ce.length;++ke)for(var Ge=ce[ke],Je=Ge.find(0),Ye=0;Ye<me.length;++Ye){var yt=me[Ye];if(!(jt(yt.to,Je.from)<0||jt(yt.from,Je.to)>0)){var sn=[Ye,1],Ft=jt(yt.from,Je.from),jn=jt(yt.to,Je.to);(Ft<0||!Ge.inclusiveLeft&&!Ft)&&sn.push({from:yt.from,to:Je.from}),(jn>0||!Ge.inclusiveRight&&!jn)&&sn.push({from:Je.to,to:yt.to}),me.splice.apply(me,sn),Ye+=sn.length-3}}return me}function Rt(ie){var ae=ie.markedSpans;if(ae){for(var fe=0;fe<ae.length;++fe)ae[fe].marker.detachLine(ie);ie.markedSpans=null}}function Ie(ie,ae){if(ae){for(var fe=0;fe<ae.length;++fe)ae[fe].marker.attachLine(ie);ie.markedSpans=ae}}function qn(ie){return ie.inclusiveLeft?-1:0}function Ci(ie){return ie.inclusiveRight?1:0}function Oi(ie,ae){var fe=ie.lines.length-ae.lines.length;if(fe!=0)return fe;var ce=ie.find(),me=ae.find(),ke=jt(ce.from,me.from)||qn(ie)-qn(ae);if(ke)return-ke;var Ge=jt(ce.to,me.to)||Ci(ie)-Ci(ae);return Ge||ae.id-ie.id}function qi(ie,ae){var fe=Bn&&ie.markedSpans,ce;if(fe)for(var me=void 0,ke=0;ke<fe.length;++ke)me=fe[ke],me.marker.collapsed&&(ae?me.from:me.to)==null&&(!ce||Oi(ce,me.marker)<0)&&(ce=me.marker);return ce}function zi(ie){return qi(ie,!0)}function Nn(ie){return qi(ie,!1)}function pi(ie,ae){var fe=Bn&&ie.markedSpans,ce;if(fe)for(var me=0;me<fe.length;++me){var ke=fe[me];ke.marker.collapsed&&(ke.from==null||ke.from<ae)&&(ke.to==null||ke.to>ae)&&(!ce||Oi(ce,ke.marker)<0)&&(ce=ke.marker)}return ce}function vi(ie,ae,fe,ce,me){var ke=ni(ie,ae),Ge=Bn&&ke.markedSpans;if(Ge)for(var Je=0;Je<Ge.length;++Je){var Ye=Ge[Je];if(Ye.marker.collapsed){var yt=Ye.marker.find(0),sn=jt(yt.from,fe)||qn(Ye.marker)-qn(me),Ft=jt(yt.to,ce)||Ci(Ye.marker)-Ci(me);if(!(sn>=0&&Ft<=0||sn<=0&&Ft>=0)&&(sn<=0&&(Ye.marker.inclusiveRight&&me.inclusiveLeft?jt(yt.to,fe)>=0:jt(yt.to,fe)>0)||sn>=0&&(Ye.marker.inclusiveRight&&me.inclusiveLeft?jt(yt.from,ce)<=0:jt(yt.from,ce)<0)))return!0}}}function ti(ie){for(var ae;ae=zi(ie);)ie=ae.find(-1,!0).line;return ie}function ui(ie){for(var ae;ae=Nn(ie);)ie=ae.find(1,!0).line;return ie}function hi(ie){for(var ae,fe;ae=Nn(ie);)ie=ae.find(1,!0).line,(fe||(fe=[])).push(ie);return fe}function Ti(ie,ae){var fe=ni(ie,ae),ce=ti(fe);return fe==ce?ae:at(ce)}function Yi(ie,ae){if(ae>ie.lastLine())return ae;var fe=ni(ie,ae),ce;if(!Pn(ie,fe))return ae;for(;ce=Nn(fe);)fe=ce.find(1,!0).line;return at(fe)+1}function Pn(ie,ae){var fe=Bn&&ae.markedSpans;if(fe){for(var ce=void 0,me=0;me<fe.length;++me)if(ce=fe[me],!!ce.marker.collapsed){if(ce.from==null)return!0;if(!ce.marker.widgetNode&&ce.from==0&&ce.marker.inclusiveLeft&&Rr(ie,ae,ce))return!0}}}function Rr(ie,ae,fe){if(fe.to==null){var ce=fe.marker.find(1,!0);return Rr(ie,ce.line,Do(ce.line.markedSpans,fe.marker))}if(fe.marker.inclusiveRight&&fe.to==ae.text.length)return!0;for(var me=void 0,ke=0;ke<ae.markedSpans.length;++ke)if(me=ae.markedSpans[ke],me.marker.collapsed&&!me.marker.widgetNode&&me.from==fe.to&&(me.to==null||me.to!=fe.from)&&(me.marker.inclusiveLeft||fe.marker.inclusiveRight)&&Rr(ie,ae,me))return!0}function cr(ie){ie=ti(ie);for(var ae=0,fe=ie.parent,ce=0;ce<fe.lines.length;++ce){var me=fe.lines[ce];if(me==ie)break;ae+=me.height}for(var ke=fe.parent;ke;fe=ke,ke=fe.parent)for(var Ge=0;Ge<ke.children.length;++Ge){var Je=ke.children[Ge];if(Je==fe)break;ae+=Je.height}return ae}function Mo(ie){if(ie.height==0)return 0;for(var ae=ie.text.length,fe,ce=ie;fe=zi(ce);){var me=fe.find(0,!0);ce=me.from.line,ae+=me.from.ch-me.to.ch}for(ce=ie;fe=Nn(ce);){var ke=fe.find(0,!0);ae-=ce.text.length-ke.from.ch,ce=ke.to.line,ae+=ce.text.length-ke.to.ch}return ae}function Wr(ie){var ae=ie.display,fe=ie.doc;ae.maxLine=ni(fe,fe.first),ae.maxLineLength=Mo(ae.maxLine),ae.maxLineChanged=!0,fe.iter(function(ce){var me=Mo(ce);me>ae.maxLineLength&&(ae.maxLineLength=me,ae.maxLine=ce)})}var Vo=function(ie,ae,fe){this.text=ie,Ie(this,ae),this.height=fe?fe(this):1};Vo.prototype.lineNo=function(){return at(this)},Sn(Vo);function Wo(ie,ae,fe,ce){ie.text=ae,ie.stateAfter&&(ie.stateAfter=null),ie.styles&&(ie.styles=null),ie.order!=null&&(ie.order=null),Rt(ie),Ie(ie,fe);var me=ce?ce(ie):1;me!=ie.height&&Yn(ie,me)}function ua(ie){ie.parent=null,Rt(ie)}var Xo={},aa={};function Pa(ie,ae){if(!ie||/^\s*$/.test(ie))return null;var fe=ae.addModeClass?aa:Xo;return fe[ie]||(fe[ie]=ie.replace(/\S+/g,"cm-$&"))}function Gt(ie,ae){var fe=dt("span",null,null,st?"padding-right: .1px":null),ce={pre:dt("pre",[fe],"CodeMirror-line"),content:fe,col:0,pos:0,cm:ie,trailingSpace:!1,splitSpaces:ie.getOption("lineWrapping")};ae.measure={};for(var me=0;me<=(ae.rest?ae.rest.length:0);me++){var ke=me?ae.rest[me-1]:ae.line,Ge=void 0;ce.pos=0,ce.addToken=fr,ji(ie.display.measure)&&(Ge=wn(ke,ie.doc.direction))&&(ce.addToken=zr(ce.addToken,Ge)),ce.map=[];var Je=ae!=ie.display.externalMeasured&&at(ke);va(ke,ce,Vr(ie,ke,Je)),ke.styleClasses&&(ke.styleClasses.bgClass&&(ce.bgClass=pn(ke.styleClasses.bgClass,ce.bgClass||"")),ke.styleClasses.textClass&&(ce.textClass=pn(ke.styleClasses.textClass,ce.textClass||""))),ce.map.length==0&&ce.map.push(0,0,ce.content.appendChild(wi(ie.display.measure))),me==0?(ae.measure.map=ce.map,ae.measure.cache={}):((ae.measure.maps||(ae.measure.maps=[])).push(ce.map),(ae.measure.caches||(ae.measure.caches=[])).push({}))}if(st){var Ye=ce.content.lastChild;(/\bcm-tab\b/.test(Ye.className)||Ye.querySelector&&Ye.querySelector(".cm-tab"))&&(ce.content.className="cm-tab-wrap-hack")}return qt(ie,"renderLine",ie,ae.line,ce.pre),ce.pre.className&&(ce.textClass=pn(ce.pre.className,ce.textClass||"")),ce}function qo(ie){var ae=Ue("span","\u2022","cm-invalidchar");return ae.title="\\u"+ie.charCodeAt(0).toString(16),ae.setAttribute("aria-label",ae.title),ae}function fr(ie,ae,fe,ce,me,ke,Ge){if(ae){var Je=ie.splitSpaces?ao(ae,ie.trailingSpace):ae,Ye=ie.cm.state.specialChars,yt=!1,sn;if(!Ye.test(ae))ie.col+=ae.length,sn=document.createTextNode(Je),ie.map.push(ie.pos,ie.pos+ae.length,sn),vt&&Oe<9&&(yt=!0),ie.pos+=ae.length;else{sn=document.createDocumentFragment();for(var Ft=0;;){Ye.lastIndex=Ft;var jn=Ye.exec(ae),kn=jn?jn.index-Ft:ae.length-Ft;if(kn){var ir=document.createTextNode(Je.slice(Ft,Ft+kn));vt&&Oe<9?sn.appendChild(Ue("span",[ir])):sn.appendChild(ir),ie.map.push(ie.pos,ie.pos+kn,ir),ie.col+=kn,ie.pos+=kn}if(!jn)break;Ft+=kn+1;var hr=void 0;if(jn[0]==" "){var Lr=ie.cm.options.tabSize,qr=Lr-ie.col%Lr;hr=sn.appendChild(Ue("span",Pt(qr),"cm-tab")),hr.setAttribute("role","presentation"),hr.setAttribute("cm-text"," "),ie.col+=qr}else jn[0]=="\r"||jn[0]==`
`?(hr=sn.appendChild(Ue("span",jn[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),hr.setAttribute("cm-text",jn[0]),ie.col+=1):(hr=ie.cm.options.specialCharPlaceholder(jn[0]),hr.setAttribute("cm-text",jn[0]),vt&&Oe<9?sn.appendChild(Ue("span",[hr])):sn.appendChild(hr),ie.col+=1);ie.map.push(ie.pos,ie.pos+1,hr),ie.pos++}}if(ie.trailingSpace=Je.charCodeAt(ae.length-1)==32,fe||ce||me||yt||ke||Ge){var Ao=fe||"";ce&&(Ao+=ce),me&&(Ao+=me);var ho=Ue("span",[sn],Ao,ke);if(Ge)for(var jo in Ge)Ge.hasOwnProperty(jo)&&jo!="style"&&jo!="class"&&ho.setAttribute(jo,Ge[jo]);return ie.content.appendChild(ho)}ie.content.appendChild(sn)}}function ao(ie,ae){if(ie.length>1&&!/ /.test(ie))return ie;for(var fe=ae,ce="",me=0;me<ie.length;me++){var ke=ie.charAt(me);ke==" "&&fe&&(me==ie.length-1||ie.charCodeAt(me+1)==32)&&(ke="\xA0"),ce+=ke,fe=ke==" "}return ce}function zr(ie,ae){return function(fe,ce,me,ke,Ge,Je,Ye){me=me?me+" cm-force-border":"cm-force-border";for(var yt=fe.pos,sn=yt+ce.length;;){for(var Ft=void 0,jn=0;jn<ae.length&&(Ft=ae[jn],!(Ft.to>yt&&Ft.from<=yt));jn++);if(Ft.to>=sn)return ie(fe,ce,me,ke,Ge,Je,Ye);ie(fe,ce.slice(0,Ft.to-yt),me,ke,null,Je,Ye),ke=null,ce=ce.slice(Ft.to-yt),yt=Ft.to}}}function Jo(ie,ae,fe,ce){var me=!ce&&fe.widgetNode;me&&ie.map.push(ie.pos,ie.pos+ae,me),!ce&&ie.cm.display.input.needsContentAttribute&&(me||(me=ie.content.appendChild(document.createElement("span"))),me.setAttribute("cm-marker",fe.id)),me&&(ie.cm.display.input.setUneditable(me),ie.content.appendChild(me)),ie.pos+=ae,ie.trailingSpace=!1}function va(ie,ae,fe){var ce=ie.markedSpans,me=ie.text,ke=0;if(!ce){for(var Ge=1;Ge<fe.length;Ge+=2)ae.addToken(ae,me.slice(ke,ke=fe[Ge]),Pa(fe[Ge+1],ae.cm.options));return}for(var Je=me.length,Ye=0,yt=1,sn="",Ft,jn,kn=0,ir,hr,Lr,qr,Ao;;){if(kn==Ye){ir=hr=Lr=jn="",Ao=null,qr=null,kn=1/0;for(var ho=[],jo=void 0,xa=0;xa<ce.length;++xa){var co=ce[xa],Ra=co.marker;if(Ra.type=="bookmark"&&co.from==Ye&&Ra.widgetNode)ho.push(Ra);else if(co.from<=Ye&&(co.to==null||co.to>Ye||Ra.collapsed&&co.to==Ye&&co.from==Ye)){if(co.to!=null&&co.to!=Ye&&kn>co.to&&(kn=co.to,hr=""),Ra.className&&(ir+=" "+Ra.className),Ra.css&&(jn=(jn?jn+";":"")+Ra.css),Ra.startStyle&&co.from==Ye&&(Lr+=" "+Ra.startStyle),Ra.endStyle&&co.to==kn&&(jo||(jo=[])).push(Ra.endStyle,co.to),Ra.title&&((Ao||(Ao={})).title=Ra.title),Ra.attributes)for(var Es in Ra.attributes)(Ao||(Ao={}))[Es]=Ra.attributes[Es];Ra.collapsed&&(!qr||Oi(qr.marker,Ra)<0)&&(qr=co)}else co.from>Ye&&kn>co.from&&(kn=co.from)}if(jo)for(var nl=0;nl<jo.length;nl+=2)jo[nl+1]==kn&&(hr+=" "+jo[nl]);if(!qr||qr.from==Ye)for(var Ms=0;Ms<ho.length;++Ms)Jo(ae,0,ho[Ms]);if(qr&&(qr.from||0)==Ye){if(Jo(ae,(qr.to==null?Je+1:qr.to)-Ye,qr.marker,qr.from==null),qr.to==null)return;qr.to==Ye&&(qr=!1)}}if(Ye>=Je)break;for(var zl=Math.min(Je,kn);;){if(sn){var ml=Ye+sn.length;if(!qr){var Us=ml>zl?sn.slice(0,zl-Ye):sn;ae.addToken(ae,Us,Ft?Ft+ir:ir,Lr,Ye+Us.length==kn?hr:"",jn,Ao)}if(ml>=zl){sn=sn.slice(zl-Ye),Ye=zl;break}Ye=ml,Lr=""}sn=me.slice(ke,ke=fe[yt++]),Ft=Pa(fe[yt++],ae.cm.options)}}}function ma(ie,ae,fe){this.line=ae,this.rest=hi(ae),this.size=this.rest?at(Nt(this.rest))-fe+1:1,this.node=this.text=null,this.hidden=Pn(ie,ae)}function ko(ie,ae,fe){for(var ce=[],me,ke=ae;ke<fe;ke=me){var Ge=new ma(ie.doc,ni(ie.doc,ke),ke);me=ke+Ge.size,ce.push(Ge)}return ce}var So=null;function $a(ie){So?So.ops.push(ie):ie.ownsGroup=So={ops:[ie],delayedCallbacks:[]}}function gs(ie){var ae=ie.delayedCallbacks,fe=0;do{for(;fe<ae.length;fe++)ae[fe].call(null);for(var ce=0;ce<ie.ops.length;ce++){var me=ie.ops[ce];if(me.cursorActivityHandlers)for(;me.cursorActivityCalled<me.cursorActivityHandlers.length;)me.cursorActivityHandlers[me.cursorActivityCalled++].call(null,me.cm)}}while(fe<ae.length)}function ls(ie,ae){var fe=ie.ownsGroup;if(fe)try{gs(fe)}finally{So=null,ae(fe)}}var ps=null;function $r(ie,ae){var fe=Mi(ie,ae);if(fe.length){var ce=Array.prototype.slice.call(arguments,2),me;So?me=So.delayedCallbacks:ps?me=ps:(me=ps=[],setTimeout(Ka,0));for(var ke=function(Je){me.push(function(){return fe[Je].apply(null,ce)})},Ge=0;Ge<fe.length;++Ge)ke(Ge)}}function Ka(){var ie=ps;ps=null;for(var ae=0;ae<ie.length;++ae)ie[ae]()}function Ma(ie,ae,fe,ce){for(var me=0;me<ae.changes.length;me++){var ke=ae.changes[me];ke=="text"?Xi(ie,ae):ke=="gutter"?Co(ie,ae,fe,ce):ke=="class"?Xr(ie,ae):ke=="widget"&&Zo(ie,ae,ce)}ae.changes=null}function ns(ie){return ie.node==ie.text&&(ie.node=Ue("div",null,null,"position: relative"),ie.text.parentNode&&ie.text.parentNode.replaceChild(ie.node,ie.text),ie.node.appendChild(ie.text),vt&&Oe<8&&(ie.node.style.zIndex=2)),ie.node}function qa(ie,ae){var fe=ae.bgClass?ae.bgClass+" "+(ae.line.bgClass||""):ae.line.bgClass;if(fe&&(fe+=" CodeMirror-linebackground"),ae.background)fe?ae.background.className=fe:(ae.background.parentNode.removeChild(ae.background),ae.background=null);else if(fe){var ce=ns(ae);ae.background=ce.insertBefore(Ue("div",null,fe),ce.firstChild),ie.display.input.setUneditable(ae.background)}}function ts(ie,ae){var fe=ie.display.externalMeasured;return fe&&fe.line==ae.line?(ie.display.externalMeasured=null,ae.measure=fe.measure,fe.built):Gt(ie,ae)}function Xi(ie,ae){var fe=ae.text.className,ce=ts(ie,ae);ae.text==ae.node&&(ae.node=ce.pre),ae.text.parentNode.replaceChild(ce.pre,ae.text),ae.text=ce.pre,ce.bgClass!=ae.bgClass||ce.textClass!=ae.textClass?(ae.bgClass=ce.bgClass,ae.textClass=ce.textClass,Xr(ie,ae)):fe&&(ae.text.className=fe)}function Xr(ie,ae){qa(ie,ae),ae.line.wrapClass?ns(ae).className=ae.line.wrapClass:ae.node!=ae.text&&(ae.node.className="");var fe=ae.textClass?ae.textClass+" "+(ae.line.textClass||""):ae.line.textClass;ae.text.className=fe||""}function Co(ie,ae,fe,ce){if(ae.gutter&&(ae.node.removeChild(ae.gutter),ae.gutter=null),ae.gutterBackground&&(ae.node.removeChild(ae.gutterBackground),ae.gutterBackground=null),ae.line.gutterClass){var me=ns(ae);ae.gutterBackground=Ue("div",null,"CodeMirror-gutter-background "+ae.line.gutterClass,"left: "+(ie.options.fixedGutter?ce.fixedPos:-ce.gutterTotalWidth)+"px; width: "+ce.gutterTotalWidth+"px"),ie.display.input.setUneditable(ae.gutterBackground),me.insertBefore(ae.gutterBackground,ae.text)}var ke=ae.line.gutterMarkers;if(ie.options.lineNumbers||ke){var Ge=ns(ae),Je=ae.gutter=Ue("div",null,"CodeMirror-gutter-wrapper","left: "+(ie.options.fixedGutter?ce.fixedPos:-ce.gutterTotalWidth)+"px");if(ie.display.input.setUneditable(Je),Ge.insertBefore(Je,ae.text),ae.line.gutterClass&&(Je.className+=" "+ae.line.gutterClass),ie.options.lineNumbers&&(!ke||!ke["CodeMirror-linenumbers"])&&(ae.lineNumber=Je.appendChild(Ue("div",li(ie.options,fe),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+ce.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+ie.display.lineNumInnerWidth+"px"))),ke)for(var Ye=0;Ye<ie.display.gutterSpecs.length;++Ye){var yt=ie.display.gutterSpecs[Ye].className,sn=ke.hasOwnProperty(yt)&&ke[yt];sn&&Je.appendChild(Ue("div",[sn],"CodeMirror-gutter-elt","left: "+ce.gutterLeft[yt]+"px; width: "+ce.gutterWidth[yt]+"px"))}}}function Zo(ie,ae,fe){ae.alignable&&(ae.alignable=null);for(var ce=_e("CodeMirror-linewidget"),me=ae.node.firstChild,ke=void 0;me;me=ke)ke=me.nextSibling,ce.test(me.className)&&ae.node.removeChild(me);ba(ie,ae,fe)}function Ko(ie,ae,fe,ce){var me=ts(ie,ae);return ae.text=ae.node=me.pre,me.bgClass&&(ae.bgClass=me.bgClass),me.textClass&&(ae.textClass=me.textClass),Xr(ie,ae),Co(ie,ae,fe,ce),ba(ie,ae,ce),ae.node}function ba(ie,ae,fe){if(Kr(ie,ae.line,ae,fe,!0),ae.rest)for(var ce=0;ce<ae.rest.length;ce++)Kr(ie,ae.rest[ce],ae,fe,!1)}function Kr(ie,ae,fe,ce,me){if(ae.widgets)for(var ke=ns(fe),Ge=0,Je=ae.widgets;Ge<Je.length;++Ge){var Ye=Je[Ge],yt=Ue("div",[Ye.node],"CodeMirror-linewidget"+(Ye.className?" "+Ye.className:""));Ye.handleMouseEvents||yt.setAttribute("cm-ignore-events","true"),Rs(Ye,yt,fe,ce),ie.display.input.setUneditable(yt),me&&Ye.above?ke.insertBefore(yt,fe.gutter||fe.text):ke.appendChild(yt),$r(Ye,"redraw")}}function Rs(ie,ae,fe,ce){if(ie.noHScroll){(fe.alignable||(fe.alignable=[])).push(ae);var me=ce.wrapperWidth;ae.style.left=ce.fixedPos+"px",ie.coverGutter||(me-=ce.gutterTotalWidth,ae.style.paddingLeft=ce.gutterTotalWidth+"px"),ae.style.width=me+"px"}ie.coverGutter&&(ae.style.zIndex=5,ae.style.position="relative",ie.noHScroll||(ae.style.marginLeft=-ce.gutterTotalWidth+"px"))}function Za(ie){if(ie.height!=null)return ie.height;var ae=ie.doc.cm;if(!ae)return 0;if(!wt(document.body,ie.node)){var fe="position: relative;";ie.coverGutter&&(fe+="margin-left: -"+ae.display.gutters.offsetWidth+"px;"),ie.noHScroll&&(fe+="width: "+ae.display.wrapper.clientWidth+"px;"),Qe(ae.display.measure,Ue("div",[ie.node],null,fe))}return ie.height=ie.node.parentNode.offsetHeight}function nn(ie,ae){for(var fe=kr(ae);fe!=ie.wrapper;fe=fe.parentNode)if(!fe||fe.nodeType==1&&fe.getAttribute("cm-ignore-events")=="true"||fe.parentNode==ie.sizer&&fe!=ie.mover)return!0}function Ht(ie){return ie.lineSpace.offsetTop}function Fn(ie){return ie.mover.offsetHeight-ie.lineSpace.offsetHeight}function Wi(ie){if(ie.cachedPaddingH)return ie.cachedPaddingH;var ae=Qe(ie.measure,Ue("pre","x","CodeMirror-line-like")),fe=window.getComputedStyle?window.getComputedStyle(ae):ae.currentStyle,ce={left:parseInt(fe.paddingLeft),right:parseInt(fe.paddingRight)};return!isNaN(ce.left)&&!isNaN(ce.right)&&(ie.cachedPaddingH=ce),ce}function Si(ie){return ri-ie.display.nativeBarWidth}function _i(ie){return ie.display.scroller.clientWidth-Si(ie)-ie.display.barWidth}function Pi(ie){return ie.display.scroller.clientHeight-Si(ie)-ie.display.barHeight}function Ln(ie,ae,fe){var ce=ie.options.lineWrapping,me=ce&&_i(ie);if(!ae.measure.heights||ce&&ae.measure.width!=me){var ke=ae.measure.heights=[];if(ce){ae.measure.width=me;for(var Ge=ae.text.firstChild.getClientRects(),Je=0;Je<Ge.length-1;Je++){var Ye=Ge[Je],yt=Ge[Je+1];Math.abs(Ye.bottom-yt.bottom)>2&&ke.push((Ye.bottom+yt.top)/2-fe.top)}}ke.push(fe.bottom-fe.top)}}function oi(ie,ae,fe){if(ie.line==ae)return{map:ie.measure.map,cache:ie.measure.cache};for(var ce=0;ce<ie.rest.length;ce++)if(ie.rest[ce]==ae)return{map:ie.measure.maps[ce],cache:ie.measure.caches[ce]};for(var me=0;me<ie.rest.length;me++)if(at(ie.rest[me])>fe)return{map:ie.measure.maps[me],cache:ie.measure.caches[me],before:!0}}function ur(ie,ae){ae=ti(ae);var fe=at(ae),ce=ie.display.externalMeasured=new ma(ie.doc,ae,fe);ce.lineN=fe;var me=ce.built=Gt(ie,ce);return ce.text=me.pre,Qe(ie.display.lineMeasure,me.pre),ce}function Nr(ie,ae,fe,ce){return La(ie,ea(ie,ae),fe,ce)}function yo(ie,ae){if(ae>=ie.display.viewFrom&&ae<ie.display.viewTo)return ie.display.view[Ki(ie,ae)];var fe=ie.display.externalMeasured;if(fe&&ae>=fe.lineN&&ae<fe.lineN+fe.size)return fe}function ea(ie,ae){var fe=at(ae),ce=yo(ie,fe);ce&&!ce.text?ce=null:ce&&ce.changes&&(Ma(ie,ce,fe,Fr(ie)),ie.curOp.forceUpdate=!0),ce||(ce=ur(ie,ae));var me=oi(ce,ae,fe);return{line:ae,view:ce,rect:null,map:me.map,cache:me.cache,before:me.before,hasHeights:!1}}function La(ie,ae,fe,ce,me){ae.before&&(fe=-1);var ke=fe+(ce||""),Ge;return ae.cache.hasOwnProperty(ke)?Ge=ae.cache[ke]:(ae.rect||(ae.rect=ae.view.text.getBoundingClientRect()),ae.hasHeights||(Ln(ie,ae.view,ae.rect),ae.hasHeights=!0),Ge=or(ie,ae,fe,ce),Ge.bogus||(ae.cache[ke]=Ge)),{left:Ge.left,right:Ge.right,top:me?Ge.rtop:Ge.top,bottom:me?Ge.rbottom:Ge.bottom}}var ga={left:0,right:0,top:0,bottom:0};function bo(ie,ae,fe){for(var ce,me,ke,Ge,Je,Ye,yt=0;yt<ie.length;yt+=3)if(Je=ie[yt],Ye=ie[yt+1],ae<Je?(me=0,ke=1,Ge="left"):ae<Ye?(me=ae-Je,ke=me+1):(yt==ie.length-3||ae==Ye&&ie[yt+3]>ae)&&(ke=Ye-Je,me=ke-1,ae>=Ye&&(Ge="right")),me!=null){if(ce=ie[yt+2],Je==Ye&&fe==(ce.insertLeft?"left":"right")&&(Ge=fe),fe=="left"&&me==0)for(;yt&&ie[yt-2]==ie[yt-3]&&ie[yt-1].insertLeft;)ce=ie[(yt-=3)+2],Ge="left";if(fe=="right"&&me==Ye-Je)for(;yt<ie.length-3&&ie[yt+3]==ie[yt+4]&&!ie[yt+5].insertLeft;)ce=ie[(yt+=3)+2],Ge="right";break}return{node:ce,start:me,end:ke,collapse:Ge,coverStart:Je,coverEnd:Ye}}function Dr(ie,ae){var fe=ga;if(ae=="left")for(var ce=0;ce<ie.length&&(fe=ie[ce]).left==fe.right;ce++);else for(var me=ie.length-1;me>=0&&(fe=ie[me]).left==fe.right;me--);return fe}function or(ie,ae,fe,ce){var me=bo(ae.map,fe,ce),ke=me.node,Ge=me.start,Je=me.end,Ye=me.collapse,yt;if(ke.nodeType==3){for(var sn=0;sn<4;sn++){for(;Ge&&an(ae.line.text.charAt(me.coverStart+Ge));)--Ge;for(;me.coverStart+Je<me.coverEnd&&an(ae.line.text.charAt(me.coverStart+Je));)++Je;if(vt&&Oe<9&&Ge==0&&Je==me.coverEnd-me.coverStart?yt=ke.parentNode.getBoundingClientRect():yt=Dr($e(ke,Ge,Je).getClientRects(),ce),yt.left||yt.right||Ge==0)break;Je=Ge,Ge=Ge-1,Ye="right"}vt&&Oe<11&&(yt=ta(ie.display.measure,yt))}else{Ge>0&&(Ye=ce="right");var Ft;ie.options.lineWrapping&&(Ft=ke.getClientRects()).length>1?yt=Ft[ce=="right"?Ft.length-1:0]:yt=ke.getBoundingClientRect()}if(vt&&Oe<9&&!Ge&&(!yt||!yt.left&&!yt.right)){var jn=ke.parentNode.getClientRects()[0];jn?yt={left:jn.left,right:jn.left+Jn(ie.display),top:jn.top,bottom:jn.bottom}:yt=ga}for(var kn=yt.top-ae.rect.top,ir=yt.bottom-ae.rect.top,hr=(kn+ir)/2,Lr=ae.view.measure.heights,qr=0;qr<Lr.length-1&&!(hr<Lr[qr]);qr++);var Ao=qr?Lr[qr-1]:0,ho=Lr[qr],jo={left:(Ye=="right"?yt.right:yt.left)-ae.rect.left,right:(Ye=="left"?yt.left:yt.right)-ae.rect.left,top:Ao,bottom:ho};return!yt.left&&!yt.right&&(jo.bogus=!0),ie.options.singleCursorHeightPerLine||(jo.rtop=kn,jo.rbottom=ir),jo}function ta(ie,ae){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Vn(ie))return ae;var fe=screen.logicalXDPI/screen.deviceXDPI,ce=screen.logicalYDPI/screen.deviceYDPI;return{left:ae.left*fe,right:ae.right*fe,top:ae.top*ce,bottom:ae.bottom*ce}}function sa(ie){if(ie.measure&&(ie.measure.cache={},ie.measure.heights=null,ie.rest))for(var ae=0;ae<ie.rest.length;ae++)ie.measure.caches[ae]={}}function Ta(ie){ie.display.externalMeasure=null,lt(ie.display.lineMeasure);for(var ae=0;ae<ie.display.view.length;ae++)sa(ie.display.view[ae])}function Ga(ie){Ta(ie),ie.display.cachedCharWidth=ie.display.cachedTextHeight=ie.display.cachedPaddingH=null,ie.options.lineWrapping||(ie.display.maxLineChanged=!0),ie.display.lineNumChars=null}function Oo(){return ot&&ne?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function pa(){return ot&&ne?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Lo(ie){var ae=0;if(ie.widgets)for(var fe=0;fe<ie.widgets.length;++fe)ie.widgets[fe].above&&(ae+=Za(ie.widgets[fe]));return ae}function Ir(ie,ae,fe,ce,me){if(!me){var ke=Lo(ae);fe.top+=ke,fe.bottom+=ke}if(ce=="line")return fe;ce||(ce="local");var Ge=cr(ae);if(ce=="local"?Ge+=Ht(ie.display):Ge-=ie.display.viewOffset,ce=="page"||ce=="window"){var Je=ie.display.lineSpace.getBoundingClientRect();Ge+=Je.top+(ce=="window"?0:pa());var Ye=Je.left+(ce=="window"?0:Oo());fe.left+=Ye,fe.right+=Ye}return fe.top+=Ge,fe.bottom+=Ge,fe}function Ba(ie,ae,fe){if(fe=="div")return ae;var ce=ae.left,me=ae.top;if(fe=="page")ce-=Oo(),me-=pa();else if(fe=="local"||!fe){var ke=ie.display.sizer.getBoundingClientRect();ce+=ke.left,me+=ke.top}var Ge=ie.display.lineSpace.getBoundingClientRect();return{left:ce-Ge.left,top:me-Ge.top}}function ra(ie,ae,fe,ce,me){return ce||(ce=ni(ie.doc,ae.line)),Ir(ie,ce,Nr(ie,ce,ae.ch,me),fe)}function Uo(ie,ae,fe,ce,me,ke){ce=ce||ni(ie.doc,ae.line),me||(me=ea(ie,ce));function Ge(ir,hr){var Lr=La(ie,me,ir,hr?"right":"left",ke);return hr?Lr.left=Lr.right:Lr.right=Lr.left,Ir(ie,ce,Lr,fe)}var Je=wn(ce,ie.doc.direction),Ye=ae.ch,yt=ae.sticky;if(Ye>=ce.text.length?(Ye=ce.text.length,yt="before"):Ye<=0&&(Ye=0,yt="after"),!Je)return Ge(yt=="before"?Ye-1:Ye,yt=="before");function sn(ir,hr,Lr){var qr=Je[hr],Ao=qr.level==1;return Ge(Lr?ir-1:ir,Ao!=Lr)}var Ft=Zt(Je,Ye,yt),jn=Dt,kn=sn(Ye,Ft,yt=="before");return jn!=null&&(kn.other=sn(Ye,jn,yt!="before")),kn}function _o(ie,ae){var fe=0;ae=Ii(ie.doc,ae),ie.options.lineWrapping||(fe=Jn(ie.display)*ae.ch);var ce=ni(ie.doc,ae.line),me=cr(ce)+Ht(ie.display);return{left:fe,right:fe,top:me,bottom:me+ce.height}}function oa(ie,ae,fe,ce,me){var ke=Qt(ie,ae,fe);return ke.xRel=me,ce&&(ke.outside=ce),ke}function Ua(ie,ae,fe){var ce=ie.doc;if(fe+=ie.display.viewOffset,fe<0)return oa(ce.first,0,null,-1,-1);var me=Bt(ce,fe),ke=ce.first+ce.size-1;if(me>ke)return oa(ce.first+ce.size-1,ni(ce,ke).text.length,null,1,1);ae<0&&(ae=0);for(var Ge=ni(ce,me);;){var Je=ut(ie,Ge,me,ae,fe),Ye=pi(Ge,Je.ch+(Je.xRel>0||Je.outside>0?1:0));if(!Ye)return Je;var yt=Ye.find(1);if(yt.line==me)return yt;Ge=ni(ce,me=yt.line)}}function pt(ie,ae,fe,ce){ce-=Lo(ae);var me=ae.text.length,ke=yn(function(Ge){return La(ie,fe,Ge-1).bottom<=ce},me,0);return me=yn(function(Ge){return La(ie,fe,Ge).top>ce},ke,me),{begin:ke,end:me}}function Ut(ie,ae,fe,ce){fe||(fe=ea(ie,ae));var me=Ir(ie,ae,La(ie,fe,ce),"line").top;return pt(ie,ae,fe,me)}function Re(ie,ae,fe,ce){return ie.bottom<=fe?!1:ie.top>fe?!0:(ce?ie.left:ie.right)>ae}function ut(ie,ae,fe,ce,me){me-=cr(ae);var ke=ea(ie,ae),Ge=Lo(ae),Je=0,Ye=ae.text.length,yt=!0,sn=wn(ae,ie.doc.direction);if(sn){var Ft=(ie.options.lineWrapping?lr:dr)(ie,ae,fe,ke,sn,ce,me);yt=Ft.level!=1,Je=yt?Ft.from:Ft.to-1,Ye=yt?Ft.to:Ft.from-1}var jn=null,kn=null,ir=yn(function(xa){var co=La(ie,ke,xa);return co.top+=Ge,co.bottom+=Ge,Re(co,ce,me,!1)?(co.top<=me&&co.left<=ce&&(jn=xa,kn=co),!0):!1},Je,Ye),hr,Lr,qr=!1;if(kn){var Ao=ce-kn.left<kn.right-ce,ho=Ao==yt;ir=jn+(ho?0:1),Lr=ho?"after":"before",hr=Ao?kn.left:kn.right}else{!yt&&(ir==Ye||ir==Je)&&ir++,Lr=ir==0?"after":ir==ae.text.length?"before":La(ie,ke,ir-(yt?1:0)).bottom+Ge<=me==yt?"after":"before";var jo=Uo(ie,Qt(fe,ir,Lr),"line",ae,ke);hr=jo.left,qr=me<jo.top?-1:me>=jo.bottom?1:0}return ir=Xt(ae.text,ir,1),oa(fe,ir,Lr,qr,ce-hr)}function dr(ie,ae,fe,ce,me,ke,Ge){var Je=yn(function(Ft){var jn=me[Ft],kn=jn.level!=1;return Re(Uo(ie,Qt(fe,kn?jn.to:jn.from,kn?"before":"after"),"line",ae,ce),ke,Ge,!0)},0,me.length-1),Ye=me[Je];if(Je>0){var yt=Ye.level!=1,sn=Uo(ie,Qt(fe,yt?Ye.from:Ye.to,yt?"after":"before"),"line",ae,ce);Re(sn,ke,Ge,!0)&&sn.top>Ge&&(Ye=me[Je-1])}return Ye}function lr(ie,ae,fe,ce,me,ke,Ge){var Je=pt(ie,ae,ce,Ge),Ye=Je.begin,yt=Je.end;/\s/.test(ae.text.charAt(yt-1))&&yt--;for(var sn=null,Ft=null,jn=0;jn<me.length;jn++){var kn=me[jn];if(!(kn.from>=yt||kn.to<=Ye)){var ir=kn.level!=1,hr=La(ie,ce,ir?Math.min(yt,kn.to)-1:Math.max(Ye,kn.from)).right,Lr=hr<ke?ke-hr+1e9:hr-ke;(!sn||Ft>Lr)&&(sn=kn,Ft=Lr)}}return sn||(sn=me[me.length-1]),sn.from<Ye&&(sn={from:Ye,to:sn.to,level:sn.level}),sn.to>yt&&(sn={from:sn.from,to:yt,level:sn.level}),sn}var gr;function Qi(ie){if(ie.cachedTextHeight!=null)return ie.cachedTextHeight;if(gr==null){gr=Ue("pre",null,"CodeMirror-line-like");for(var ae=0;ae<49;++ae)gr.appendChild(document.createTextNode("x")),gr.appendChild(Ue("br"));gr.appendChild(document.createTextNode("x"))}Qe(ie.measure,gr);var fe=gr.offsetHeight/50;return fe>3&&(ie.cachedTextHeight=fe),lt(ie.measure),fe||1}function Jn(ie){if(ie.cachedCharWidth!=null)return ie.cachedCharWidth;var ae=Ue("span","xxxxxxxxxx"),fe=Ue("pre",[ae],"CodeMirror-line-like");Qe(ie.measure,fe);var ce=ae.getBoundingClientRect(),me=(ce.right-ce.left)/10;return me>2&&(ie.cachedCharWidth=me),me||10}function Fr(ie){for(var ae=ie.display,fe={},ce={},me=ae.gutters.clientLeft,ke=ae.gutters.firstChild,Ge=0;ke;ke=ke.nextSibling,++Ge){var Je=ie.display.gutterSpecs[Ge].className;fe[Je]=ke.offsetLeft+ke.clientLeft+me,ce[Je]=ke.clientWidth}return{fixedPos:Br(ae),gutterTotalWidth:ae.gutters.offsetWidth,gutterLeft:fe,gutterWidth:ce,wrapperWidth:ae.wrapper.clientWidth}}function Br(ie){return ie.scroller.getBoundingClientRect().left-ie.sizer.getBoundingClientRect().left}function Zr(ie){var ae=Qi(ie.display),fe=ie.options.lineWrapping,ce=fe&&Math.max(5,ie.display.scroller.clientWidth/Jn(ie.display)-3);return function(me){if(Pn(ie.doc,me))return 0;var ke=0;if(me.widgets)for(var Ge=0;Ge<me.widgets.length;Ge++)me.widgets[Ge].height&&(ke+=me.widgets[Ge].height);return fe?ke+(Math.ceil(me.text.length/ce)||1)*ae:ke+ae}}function mr(ie){var ae=ie.doc,fe=Zr(ie);ae.iter(function(ce){var me=fe(ce);me!=ce.height&&Yn(ce,me)})}function Po(ie,ae,fe,ce){var me=ie.display;if(!fe&&kr(ae).getAttribute("cm-not-content")=="true")return null;var ke,Ge,Je=me.lineSpace.getBoundingClientRect();try{ke=ae.clientX-Je.left,Ge=ae.clientY-Je.top}catch(Ft){return null}var Ye=Ua(ie,ke,Ge),yt;if(ce&&Ye.xRel>0&&(yt=ni(ie.doc,Ye.line).text).length==Ye.ch){var sn=nt(yt,yt.length,ie.options.tabSize)-yt.length;Ye=Qt(Ye.line,Math.max(0,Math.round((ke-Wi(ie.display).left)/Jn(ie.display))-sn))}return Ye}function Ki(ie,ae){if(ae>=ie.display.viewTo||(ae-=ie.display.viewFrom,ae<0))return null;for(var fe=ie.display.view,ce=0;ce<fe.length;ce++)if(ae-=fe[ce].size,ae<0)return ce}function Ei(ie,ae,fe,ce){ae==null&&(ae=ie.doc.first),fe==null&&(fe=ie.doc.first+ie.doc.size),ce||(ce=0);var me=ie.display;if(ce&&fe<me.viewTo&&(me.updateLineNumbers==null||me.updateLineNumbers>ae)&&(me.updateLineNumbers=ae),ie.curOp.viewChanged=!0,ae>=me.viewTo)Bn&&Ti(ie.doc,ae)<me.viewTo&&Jr(ie);else if(fe<=me.viewFrom)Bn&&Yi(ie.doc,fe+ce)>me.viewFrom?Jr(ie):(me.viewFrom+=ce,me.viewTo+=ce);else if(ae<=me.viewFrom&&fe>=me.viewTo)Jr(ie);else if(ae<=me.viewFrom){var ke=Ur(ie,fe,fe+ce,1);ke?(me.view=me.view.slice(ke.index),me.viewFrom=ke.lineN,me.viewTo+=ce):Jr(ie)}else if(fe>=me.viewTo){var Ge=Ur(ie,ae,ae,-1);Ge?(me.view=me.view.slice(0,Ge.index),me.viewTo=Ge.lineN):Jr(ie)}else{var Je=Ur(ie,ae,ae,-1),Ye=Ur(ie,fe,fe+ce,1);Je&&Ye?(me.view=me.view.slice(0,Je.index).concat(ko(ie,Je.lineN,Ye.lineN)).concat(me.view.slice(Ye.index)),me.viewTo+=ce):Jr(ie)}var yt=me.externalMeasured;yt&&(fe<yt.lineN?yt.lineN+=ce:ae<yt.lineN+yt.size&&(me.externalMeasured=null))}function bi(ie,ae,fe){ie.curOp.viewChanged=!0;var ce=ie.display,me=ie.display.externalMeasured;if(me&&ae>=me.lineN&&ae<me.lineN+me.size&&(ce.externalMeasured=null),!(ae<ce.viewFrom||ae>=ce.viewTo)){var ke=ce.view[Ki(ie,ae)];if(ke.node!=null){var Ge=ke.changes||(ke.changes=[]);dn(Ge,fe)==-1&&Ge.push(fe)}}}function Jr(ie){ie.display.viewFrom=ie.display.viewTo=ie.doc.first,ie.display.view=[],ie.display.viewOffset=0}function Ur(ie,ae,fe,ce){var me=Ki(ie,ae),ke,Ge=ie.display.view;if(!Bn||fe==ie.doc.first+ie.doc.size)return{index:me,lineN:fe};for(var Je=ie.display.viewFrom,Ye=0;Ye<me;Ye++)Je+=Ge[Ye].size;if(Je!=ae){if(ce>0){if(me==Ge.length-1)return null;ke=Je+Ge[me].size-ae,me++}else ke=Je-ae;ae+=ke,fe+=ke}for(;Ti(ie.doc,fe)!=fe;){if(me==(ce<0?0:Ge.length-1))return null;fe+=ce*Ge[me-(ce<0?1:0)].size,me+=ce}return{index:me,lineN:fe}}function Mr(ie,ae,fe){var ce=ie.display,me=ce.view;me.length==0||ae>=ce.viewTo||fe<=ce.viewFrom?(ce.view=ko(ie,ae,fe),ce.viewFrom=ae):(ce.viewFrom>ae?ce.view=ko(ie,ae,ce.viewFrom).concat(ce.view):ce.viewFrom<ae&&(ce.view=ce.view.slice(Ki(ie,ae))),ce.viewFrom=ae,ce.viewTo<fe?ce.view=ce.view.concat(ko(ie,ce.viewTo,fe)):ce.viewTo>fe&&(ce.view=ce.view.slice(0,Ki(ie,fe)))),ce.viewTo=fe}function Fo(ie){for(var ae=ie.display.view,fe=0,ce=0;ce<ae.length;ce++){var me=ae[ce];!me.hidden&&(!me.node||me.changes)&&++fe}return fe}function vr(ie){ie.display.input.showSelection(ie.display.input.prepareSelection())}function so(ie,ae){ae===void 0&&(ae=!0);for(var fe=ie.doc,ce={},me=ce.cursors=document.createDocumentFragment(),ke=ce.selection=document.createDocumentFragment(),Ge=0;Ge<fe.sel.ranges.length;Ge++)if(!(!ae&&Ge==fe.sel.primIndex)){var Je=fe.sel.ranges[Ge];if(!(Je.from().line>=ie.display.viewTo||Je.to().line<ie.display.viewFrom)){var Ye=Je.empty();(Ye||ie.options.showCursorWhenSelecting)&&er(ie,Je.head,me),Ye||oo(ie,Je,ke)}}return ce}function er(ie,ae,fe){var ce=Uo(ie,ae,"div",null,null,!ie.options.singleCursorHeightPerLine),me=fe.appendChild(Ue("div","\xA0","CodeMirror-cursor"));if(me.style.left=ce.left+"px",me.style.top=ce.top+"px",me.style.height=Math.max(0,ce.bottom-ce.top)*ie.options.cursorHeight+"px",ce.other){var ke=fe.appendChild(Ue("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));ke.style.display="",ke.style.left=ce.other.left+"px",ke.style.top=ce.other.top+"px",ke.style.height=(ce.other.bottom-ce.other.top)*.85+"px"}}function Tr(ie,ae){return ie.top-ae.top||ie.left-ae.left}function oo(ie,ae,fe){var ce=ie.display,me=ie.doc,ke=document.createDocumentFragment(),Ge=Wi(ie.display),Je=Ge.left,Ye=Math.max(ce.sizerWidth,_i(ie)-ce.sizer.offsetLeft)-Ge.right,yt=me.direction=="ltr";function sn(ho,jo,xa,co){jo<0&&(jo=0),jo=Math.round(jo),co=Math.round(co),ke.appendChild(Ue("div",null,"CodeMirror-selected","position: absolute; left: "+ho+`px;
top: `+jo+"px; width: "+(xa==null?Ye-ho:xa)+`px;
height: `+(co-jo)+"px"))}function Ft(ho,jo,xa){var co=ni(me,ho),Ra=co.text.length,Es,nl;function Ms(Us,eu){return ra(ie,Qt(ho,Us),"div",co,eu)}function zl(Us,eu,ll){var Ws=Ut(ie,co,null,Us),Qa=eu=="ltr"==(ll=="after")?"left":"right",Ds=ll=="after"?Ws.begin:Ws.end-(/\s/.test(co.text.charAt(Ws.end-1))?2:1);return Ms(Ds,Qa)[Qa]}var ml=wn(co,me.direction);return kt(ml,jo||0,xa==null?Ra:xa,function(Us,eu,ll,Ws){var Qa=ll=="ltr",Ds=Ms(Us,Qa?"left":"right"),il=Ms(eu-1,Qa?"right":"left"),ul=jo==null&&Us==0,ku=xa==null&&eu==Ra,Fs=Ws==0,ve=!ml||Ws==ml.length-1;if(il.top-Ds.top<=3){var xe=(yt?ul:ku)&&Fs,Be=(yt?ku:ul)&&ve,je=xe?Je:(Qa?Ds:il).left,et=Be?Ye:(Qa?il:Ds).right;sn(je,Ds.top,et-je,Ds.bottom)}else{var tt,gt,xt,Jt;Qa?(tt=yt&&ul&&Fs?Je:Ds.left,gt=yt?Ye:zl(Us,ll,"before"),xt=yt?Je:zl(eu,ll,"after"),Jt=yt&&ku&&ve?Ye:il.right):(tt=yt?zl(Us,ll,"before"):Je,gt=!yt&&ul&&Fs?Ye:Ds.right,xt=!yt&&ku&&ve?Je:il.left,Jt=yt?zl(eu,ll,"after"):Ye),sn(tt,Ds.top,gt-tt,Ds.bottom),Ds.bottom<il.top&&sn(Je,Ds.bottom,null,il.top),sn(xt,il.top,Jt-xt,il.bottom)}(!Es||Tr(Ds,Es)<0)&&(Es=Ds),Tr(il,Es)<0&&(Es=il),(!nl||Tr(Ds,nl)<0)&&(nl=Ds),Tr(il,nl)<0&&(nl=il)}),{start:Es,end:nl}}var jn=ae.from(),kn=ae.to();if(jn.line==kn.line)Ft(jn.line,jn.ch,kn.ch);else{var ir=ni(me,jn.line),hr=ni(me,kn.line),Lr=ti(ir)==ti(hr),qr=Ft(jn.line,jn.ch,Lr?ir.text.length+1:null).end,Ao=Ft(kn.line,Lr?0:null,kn.ch).start;Lr&&(qr.top<Ao.top-2?(sn(qr.right,qr.top,null,qr.bottom),sn(Je,Ao.top,Ao.left,Ao.bottom)):sn(qr.right,qr.top,Ao.left-qr.right,qr.bottom)),qr.bottom<Ao.top&&sn(Je,qr.bottom,null,Ao.top)}fe.appendChild(ke)}function Go(ie){if(ie.state.focused){var ae=ie.display;clearInterval(ae.blinker);var fe=!0;ae.cursorDiv.style.visibility="",ie.options.cursorBlinkRate>0?ae.blinker=setInterval(function(){ie.hasFocus()||Ls(ie),ae.cursorDiv.style.visibility=(fe=!fe)?"":"hidden"},ie.options.cursorBlinkRate):ie.options.cursorBlinkRate<0&&(ae.cursorDiv.style.visibility="hidden")}}function ha(ie){ie.state.focused||(ie.display.input.focus(),jr(ie))}function _a(ie){ie.state.delayingBlurEvent=!0,setTimeout(function(){ie.state.delayingBlurEvent&&(ie.state.delayingBlurEvent=!1,Ls(ie))},100)}function jr(ie,ae){ie.state.delayingBlurEvent&&(ie.state.delayingBlurEvent=!1),ie.options.readOnly!="nocursor"&&(ie.state.focused||(qt(ie,"focus",ie,ae),ie.state.focused=!0,Lt(ie.display.wrapper,"CodeMirror-focused"),!ie.curOp&&ie.display.selForContextMenu!=ie.doc.sel&&(ie.display.input.reset(),st&&setTimeout(function(){return ie.display.input.reset(!0)},20)),ie.display.input.receivedFocus()),Go(ie))}function Ls(ie,ae){ie.state.delayingBlurEvent||(ie.state.focused&&(qt(ie,"blur",ie,ae),ie.state.focused=!1,Ze(ie.display.wrapper,"CodeMirror-focused")),clearInterval(ie.display.blinker),setTimeout(function(){ie.state.focused||(ie.display.shift=!1)},150))}function vo(ie){for(var ae=ie.display,fe=ae.lineDiv.offsetTop,ce=0;ce<ae.view.length;ce++){var me=ae.view[ce],ke=ie.options.lineWrapping,Ge=void 0,Je=0;if(!me.hidden){if(vt&&Oe<8){var Ye=me.node.offsetTop+me.node.offsetHeight;Ge=Ye-fe,fe=Ye}else{var yt=me.node.getBoundingClientRect();Ge=yt.bottom-yt.top,!ke&&me.text.firstChild&&(Je=me.text.firstChild.getBoundingClientRect().right-yt.left-1)}var sn=me.line.height-Ge;if((sn>.005||sn<-.005)&&(Yn(me.line,Ge),na(me.line),me.rest))for(var Ft=0;Ft<me.rest.length;Ft++)na(me.rest[Ft]);if(Je>ie.display.sizerWidth){var jn=Math.ceil(Je/Jn(ie.display));jn>ie.display.maxLineLength&&(ie.display.maxLineLength=jn,ie.display.maxLine=me.line,ie.display.maxLineChanged=!0)}}}}function na(ie){if(ie.widgets)for(var ae=0;ae<ie.widgets.length;++ae){var fe=ie.widgets[ae],ce=fe.node.parentNode;ce&&(fe.height=ce.offsetHeight)}}function Eo(ie,ae,fe){var ce=fe&&fe.top!=null?Math.max(0,fe.top):ie.scroller.scrollTop;ce=Math.floor(ce-Ht(ie));var me=fe&&fe.bottom!=null?fe.bottom:ce+ie.wrapper.clientHeight,ke=Bt(ae,ce),Ge=Bt(ae,me);if(fe&&fe.ensure){var Je=fe.ensure.from.line,Ye=fe.ensure.to.line;Je<ke?(ke=Je,Ge=Bt(ae,cr(ni(ae,Je))+ie.wrapper.clientHeight)):Math.min(Ye,ae.lastLine())>=Ge&&(ke=Bt(ae,cr(ni(ae,Ye))-ie.wrapper.clientHeight),Ge=Ye)}return{from:ke,to:Math.max(Ge,ke+1)}}function Xa(ie,ae){if(!un(ie,"scrollCursorIntoView")){var fe=ie.display,ce=fe.sizer.getBoundingClientRect(),me=null;if(ae.top+ce.top<0?me=!0:ae.bottom+ce.top>(window.innerHeight||document.documentElement.clientHeight)&&(me=!1),me!=null&&!At){var ke=Ue("div","\u200B",null,`position: absolute;
top: `+(ae.top-fe.viewOffset-Ht(ie.display))+`px;
height: `+(ae.bottom-ae.top+Si(ie)+fe.barHeight)+`px;
left: `+ae.left+"px; width: "+Math.max(2,ae.right-ae.left)+"px;");ie.display.lineSpace.appendChild(ke),ke.scrollIntoView(me),ie.display.lineSpace.removeChild(ke)}}}function Ia(ie,ae,fe,ce){ce==null&&(ce=0);var me;!ie.options.lineWrapping&&ae==fe&&(ae=ae.ch?Qt(ae.line,ae.sticky=="before"?ae.ch-1:ae.ch,"after"):ae,fe=ae.sticky=="before"?Qt(ae.line,ae.ch+1,"before"):ae);for(var ke=0;ke<5;ke++){var Ge=!1,Je=Uo(ie,ae),Ye=!fe||fe==ae?Je:Uo(ie,fe);me={left:Math.min(Je.left,Ye.left),top:Math.min(Je.top,Ye.top)-ce,right:Math.max(Je.left,Ye.left),bottom:Math.max(Je.bottom,Ye.bottom)+ce};var yt=Yl(ie,me),sn=ie.doc.scrollTop,Ft=ie.doc.scrollLeft;if(yt.scrollTop!=null&&(fl(ie,yt.scrollTop),Math.abs(ie.doc.scrollTop-sn)>1&&(Ge=!0)),yt.scrollLeft!=null&&(Bl(ie,yt.scrollLeft),Math.abs(ie.doc.scrollLeft-Ft)>1&&(Ge=!0)),!Ge)break}return me}function xs(ie,ae){var fe=Yl(ie,ae);fe.scrollTop!=null&&fl(ie,fe.scrollTop),fe.scrollLeft!=null&&Bl(ie,fe.scrollLeft)}function Yl(ie,ae){var fe=ie.display,ce=Qi(ie.display);ae.top<0&&(ae.top=0);var me=ie.curOp&&ie.curOp.scrollTop!=null?ie.curOp.scrollTop:fe.scroller.scrollTop,ke=Pi(ie),Ge={};ae.bottom-ae.top>ke&&(ae.bottom=ae.top+ke);var Je=ie.doc.height+Fn(fe),Ye=ae.top<ce,yt=ae.bottom>Je-ce;if(ae.top<me)Ge.scrollTop=Ye?0:ae.top;else if(ae.bottom>me+ke){var sn=Math.min(ae.top,(yt?Je:ae.bottom)-ke);sn!=me&&(Ge.scrollTop=sn)}var Ft=ie.options.fixedGutter?0:fe.gutters.offsetWidth,jn=ie.curOp&&ie.curOp.scrollLeft!=null?ie.curOp.scrollLeft:fe.scroller.scrollLeft-Ft,kn=_i(ie)-fe.gutters.offsetWidth,ir=ae.right-ae.left>kn;return ir&&(ae.right=ae.left+kn),ae.left<10?Ge.scrollLeft=0:ae.left<jn?Ge.scrollLeft=Math.max(0,ae.left+Ft-(ir?0:10)):ae.right>kn+jn-3&&(Ge.scrollLeft=ae.right+(ir?0:10)-kn),Ge}function zu(ie,ae){ae!=null&&(qs(ie),ie.curOp.scrollTop=(ie.curOp.scrollTop==null?ie.doc.scrollTop:ie.curOp.scrollTop)+ae)}function Ll(ie){qs(ie);var ae=ie.getCursor();ie.curOp.scrollToPos={from:ae,to:ae,margin:ie.options.cursorScrollMargin}}function lu(ie,ae,fe){(ae!=null||fe!=null)&&qs(ie),ae!=null&&(ie.curOp.scrollLeft=ae),fe!=null&&(ie.curOp.scrollTop=fe)}function ka(ie,ae){qs(ie),ie.curOp.scrollToPos=ae}function qs(ie){var ae=ie.curOp.scrollToPos;if(ae){ie.curOp.scrollToPos=null;var fe=_o(ie,ae.from),ce=_o(ie,ae.to);al(ie,fe,ce,ae.margin)}}function al(ie,ae,fe,ce){var me=Yl(ie,{left:Math.min(ae.left,fe.left),top:Math.min(ae.top,fe.top)-ce,right:Math.max(ae.right,fe.right),bottom:Math.max(ae.bottom,fe.bottom)+ce});lu(ie,me.scrollLeft,me.scrollTop)}function fl(ie,ae){Math.abs(ie.doc.scrollTop-ae)<2||(le||el(ie,{top:ae}),uu(ie,ae,!0),le&&el(ie),Wa(ie,100))}function uu(ie,ae,fe){ae=Math.max(0,Math.min(ie.display.scroller.scrollHeight-ie.display.scroller.clientHeight,ae)),!(ie.display.scroller.scrollTop==ae&&!fe)&&(ie.doc.scrollTop=ae,ie.display.scrollbars.setScrollTop(ae),ie.display.scroller.scrollTop!=ae&&(ie.display.scroller.scrollTop=ae))}function Bl(ie,ae,fe,ce){ae=Math.max(0,Math.min(ae,ie.display.scroller.scrollWidth-ie.display.scroller.clientWidth)),!((fe?ae==ie.doc.scrollLeft:Math.abs(ie.doc.scrollLeft-ae)<2)&&!ce)&&(ie.doc.scrollLeft=ae,xh(ie),ie.display.scroller.scrollLeft!=ae&&(ie.display.scroller.scrollLeft=ae),ie.display.scrollbars.setScrollLeft(ae))}function Ea(ie){var ae=ie.display,fe=ae.gutters.offsetWidth,ce=Math.round(ie.doc.height+Fn(ie.display));return{clientHeight:ae.scroller.clientHeight,viewHeight:ae.wrapper.clientHeight,scrollWidth:ae.scroller.scrollWidth,clientWidth:ae.scroller.clientWidth,viewWidth:ae.wrapper.clientWidth,barLeft:ie.options.fixedGutter?fe:0,docHeight:ce,scrollHeight:ce+Si(ie)+ae.barHeight,nativeBarWidth:ae.nativeBarWidth,gutterWidth:fe}}var Oa=function(ie,ae,fe){this.cm=fe;var ce=this.vert=Ue("div",[Ue("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),me=this.horiz=Ue("div",[Ue("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");ce.tabIndex=me.tabIndex=-1,ie(ce),ie(me),Tn(ce,"scroll",function(){ce.clientHeight&&ae(ce.scrollTop,"vertical")}),Tn(me,"scroll",function(){me.clientWidth&&ae(me.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,vt&&Oe<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Oa.prototype.update=function(ie){var ae=ie.scrollWidth>ie.clientWidth+1,fe=ie.scrollHeight>ie.clientHeight+1,ce=ie.nativeBarWidth;if(fe){this.vert.style.display="block",this.vert.style.bottom=ae?ce+"px":"0";var me=ie.viewHeight-(ae?ce:0);this.vert.firstChild.style.height=Math.max(0,ie.scrollHeight-ie.clientHeight+me)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(ae){this.horiz.style.display="block",this.horiz.style.right=fe?ce+"px":"0",this.horiz.style.left=ie.barLeft+"px";var ke=ie.viewWidth-ie.barLeft-(fe?ce:0);this.horiz.firstChild.style.width=Math.max(0,ie.scrollWidth-ie.clientWidth+ke)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&ie.clientHeight>0&&(ce==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:fe?ce:0,bottom:ae?ce:0}},Oa.prototype.setScrollLeft=function(ie){this.horiz.scrollLeft!=ie&&(this.horiz.scrollLeft=ie),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Oa.prototype.setScrollTop=function(ie){this.vert.scrollTop!=ie&&(this.vert.scrollTop=ie),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Oa.prototype.zeroWidthHack=function(){var ie=de&&!ct?"12px":"18px";this.horiz.style.height=this.vert.style.width=ie,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new rt,this.disableVert=new rt},Oa.prototype.enableZeroWidthBar=function(ie,ae,fe){ie.style.pointerEvents="auto";function ce(){var me=ie.getBoundingClientRect(),ke=fe=="vert"?document.elementFromPoint(me.right-1,(me.top+me.bottom)/2):document.elementFromPoint((me.right+me.left)/2,me.bottom-1);ke!=ie?ie.style.pointerEvents="none":ae.set(1e3,ce)}ae.set(1e3,ce)},Oa.prototype.clear=function(){var ie=this.horiz.parentNode;ie.removeChild(this.horiz),ie.removeChild(this.vert)};var us=function(){};us.prototype.update=function(){return{bottom:0,right:0}},us.prototype.setScrollLeft=function(){},us.prototype.setScrollTop=function(){},us.prototype.clear=function(){};function Zs(ie,ae){ae||(ae=Ea(ie));var fe=ie.display.barWidth,ce=ie.display.barHeight;Gs(ie,ae);for(var me=0;me<4&&fe!=ie.display.barWidth||ce!=ie.display.barHeight;me++)fe!=ie.display.barWidth&&ie.options.lineWrapping&&vo(ie),Gs(ie,Ea(ie)),fe=ie.display.barWidth,ce=ie.display.barHeight}function Gs(ie,ae){var fe=ie.display,ce=fe.scrollbars.update(ae);fe.sizer.style.paddingRight=(fe.barWidth=ce.right)+"px",fe.sizer.style.paddingBottom=(fe.barHeight=ce.bottom)+"px",fe.heightForcer.style.borderBottom=ce.bottom+"px solid transparent",ce.right&&ce.bottom?(fe.scrollbarFiller.style.display="block",fe.scrollbarFiller.style.height=ce.bottom+"px",fe.scrollbarFiller.style.width=ce.right+"px"):fe.scrollbarFiller.style.display="",ce.bottom&&ie.options.coverGutterNextToScrollbar&&ie.options.fixedGutter?(fe.gutterFiller.style.display="block",fe.gutterFiller.style.height=ce.bottom+"px",fe.gutterFiller.style.width=ae.gutterWidth+"px"):fe.gutterFiller.style.display=""}var Il={native:Oa,null:us};function mu(ie){ie.display.scrollbars&&(ie.display.scrollbars.clear(),ie.display.scrollbars.addClass&&Ze(ie.display.wrapper,ie.display.scrollbars.addClass)),ie.display.scrollbars=new Il[ie.options.scrollbarStyle](function(ae){ie.display.wrapper.insertBefore(ae,ie.display.scrollbarFiller),Tn(ae,"mousedown",function(){ie.state.focused&&setTimeout(function(){return ie.display.input.focus()},0)}),ae.setAttribute("cm-not-content","true")},function(ae,fe){fe=="horizontal"?Bl(ie,ae):fl(ie,ae)},ie),ie.display.scrollbars.addClass&&Lt(ie.display.wrapper,ie.display.scrollbars.addClass)}var Fu=0;function Ol(ie){ie.curOp={cm:ie,viewChanged:!1,startHeight:ie.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:++Fu},$a(ie.curOp)}function Xl(ie){var ae=ie.curOp;ae&&ls(ae,function(fe){for(var ce=0;ce<fe.ops.length;ce++)fe.ops[ce].cm.curOp=null;df(fe)})}function df(ie){for(var ae=ie.ops,fe=0;fe<ae.length;fe++)xc(ae[fe]);for(var ce=0;ce<ae.length;ce++)Uf(ae[ce]);for(var me=0;me<ae.length;me++)cf(ae[me]);for(var ke=0;ke<ae.length;ke++)Mn(ae[ke]);for(var Ge=0;Ge<ae.length;Ge++)Gr(ae[Ge])}function xc(ie){var ae=ie.cm,fe=ae.display;Ks(ae),ie.updateMaxLine&&Wr(ae),ie.mustUpdate=ie.viewChanged||ie.forceUpdate||ie.scrollTop!=null||ie.scrollToPos&&(ie.scrollToPos.from.line<fe.viewFrom||ie.scrollToPos.to.line>=fe.viewTo)||fe.maxLineChanged&&ae.options.lineWrapping,ie.update=ie.mustUpdate&&new ya(ae,ie.mustUpdate&&{top:ie.scrollTop,ensure:ie.scrollToPos},ie.forceUpdate)}function Uf(ie){ie.updatedDisplay=ie.mustUpdate&&oh(ie.cm,ie.update)}function cf(ie){var ae=ie.cm,fe=ae.display;ie.updatedDisplay&&vo(ae),ie.barMeasure=Ea(ae),fe.maxLineChanged&&!ae.options.lineWrapping&&(ie.adjustWidthTo=Nr(ae,fe.maxLine,fe.maxLine.text.length).left+3,ae.display.sizerWidth=ie.adjustWidthTo,ie.barMeasure.scrollWidth=Math.max(fe.scroller.clientWidth,fe.sizer.offsetLeft+ie.adjustWidthTo+Si(ae)+ae.display.barWidth),ie.maxScrollLeft=Math.max(0,fe.sizer.offsetLeft+ie.adjustWidthTo-_i(ae))),(ie.updatedDisplay||ie.selectionChanged)&&(ie.preparedSelection=fe.input.prepareSelection())}function Mn(ie){var ae=ie.cm;ie.adjustWidthTo!=null&&(ae.display.sizer.style.minWidth=ie.adjustWidthTo+"px",ie.maxScrollLeft<ae.doc.scrollLeft&&Bl(ae,Math.min(ae.display.scroller.scrollLeft,ie.maxScrollLeft),!0),ae.display.maxLineChanged=!1);var fe=ie.focus&&ie.focus==St();ie.preparedSelection&&ae.display.input.showSelection(ie.preparedSelection,fe),(ie.updatedDisplay||ie.startHeight!=ae.doc.height)&&Zs(ae,ie.barMeasure),ie.updatedDisplay&&Ml(ae,ie.barMeasure),ie.selectionChanged&&Go(ae),ae.state.focused&&ie.updateInput&&ae.display.input.reset(ie.typing),fe&&ha(ie.cm)}function Gr(ie){var ae=ie.cm,fe=ae.display,ce=ae.doc;if(ie.updatedDisplay&&Hr(ae,ie.update),fe.wheelStartX!=null&&(ie.scrollTop!=null||ie.scrollLeft!=null||ie.scrollToPos)&&(fe.wheelStartX=fe.wheelStartY=null),ie.scrollTop!=null&&uu(ae,ie.scrollTop,ie.forceScroll),ie.scrollLeft!=null&&Bl(ae,ie.scrollLeft,!0,!0),ie.scrollToPos){var me=Ia(ae,Ii(ce,ie.scrollToPos.from),Ii(ce,ie.scrollToPos.to),ie.scrollToPos.margin);Xa(ae,me)}var ke=ie.maybeHiddenMarkers,Ge=ie.maybeUnhiddenMarkers;if(ke)for(var Je=0;Je<ke.length;++Je)ke[Je].lines.length||qt(ke[Je],"hide");if(Ge)for(var Ye=0;Ye<Ge.length;++Ye)Ge[Ye].lines.length&&qt(Ge[Ye],"unhide");fe.wrapper.offsetHeight&&(ce.scrollTop=ae.display.scroller.scrollTop),ie.changeObjs&&qt(ae,"changes",ae,ie.changeObjs),ie.update&&ie.update.finish()}function uo(ie,ae){if(ie.curOp)return ae();Ol(ie);try{return ae()}finally{Xl(ie)}}function io(ie,ae){return function(){if(ie.curOp)return ae.apply(ie,arguments);Ol(ie);try{return ae.apply(ie,arguments)}finally{Xl(ie)}}}function rr(ie){return function(){if(this.curOp)return ie.apply(this,arguments);Ol(this);try{return ie.apply(this,arguments)}finally{Xl(this)}}}function la(ie){return function(){var ae=this.cm;if(!ae||ae.curOp)return ie.apply(this,arguments);Ol(ae);try{return ie.apply(this,arguments)}finally{Xl(ae)}}}function Wa(ie,ae){ie.doc.highlightFrontier<ie.display.viewTo&&ie.state.highlight.set(ae,vn(Fa,ie))}function Fa(ie){var ae=ie.doc;if(!(ae.highlightFrontier>=ie.display.viewTo)){var fe=+new Date+ie.options.workTime,ce=xo(ie,ae.highlightFrontier),me=[];ae.iter(ce.line,Math.min(ae.first+ae.size,ie.display.viewTo+500),function(ke){if(ce.line>=ie.display.viewFrom){var Ge=ke.styles,Je=ke.text.length>ie.options.maxHighlightLength?Ji(ae.mode,ce.state):null,Ye=Ar(ie,ke,ce,!0);Je&&(ce.state=Je),ke.styles=Ye.styles;var yt=ke.styleClasses,sn=Ye.classes;sn?ke.styleClasses=sn:yt&&(ke.styleClasses=null);for(var Ft=!Ge||Ge.length!=ke.styles.length||yt!=sn&&(!yt||!sn||yt.bgClass!=sn.bgClass||yt.textClass!=sn.textClass),jn=0;!Ft&&jn<Ge.length;++jn)Ft=Ge[jn]!=ke.styles[jn];Ft&&me.push(ce.line),ke.stateAfter=ce.save(),ce.nextLine()}else ke.text.length<=ie.options.maxHighlightLength&&Ot(ie,ke.text,ce),ke.stateAfter=ce.line%5==0?ce.save():null,ce.nextLine();if(+new Date>fe)return Wa(ie,ie.options.workDelay),!0}),ae.highlightFrontier=ce.line,ae.modeFrontier=Math.max(ae.modeFrontier,ce.line),me.length&&uo(ie,function(){for(var ke=0;ke<me.length;ke++)bi(ie,me[ke],"text")})}}var ya=function(ie,ae,fe){var ce=ie.display;this.viewport=ae,this.visible=Eo(ce,ie.doc,ae),this.editorIsHidden=!ce.wrapper.offsetWidth,this.wrapperHeight=ce.wrapper.clientHeight,this.wrapperWidth=ce.wrapper.clientWidth,this.oldDisplayWidth=_i(ie),this.force=fe,this.dims=Fr(ie),this.events=[]};ya.prototype.signal=function(ie,ae){on(ie,ae)&&this.events.push(arguments)},ya.prototype.finish=function(){for(var ie=0;ie<this.events.length;ie++)qt.apply(null,this.events[ie])};function Ks(ie){var ae=ie.display;!ae.scrollbarsClipped&&ae.scroller.offsetWidth&&(ae.nativeBarWidth=ae.scroller.offsetWidth-ae.scroller.clientWidth,ae.heightForcer.style.height=Si(ie)+"px",ae.sizer.style.marginBottom=-ae.nativeBarWidth+"px",ae.sizer.style.borderRightWidth=Si(ie)+"px",ae.scrollbarsClipped=!0)}function rs(ie){if(ie.hasFocus())return null;var ae=St();if(!ae||!wt(ie.display.lineDiv,ae))return null;var fe={activeElt:ae};if(window.getSelection){var ce=window.getSelection();ce.anchorNode&&ce.extend&&wt(ie.display.lineDiv,ce.anchorNode)&&(fe.anchorNode=ce.anchorNode,fe.anchorOffset=ce.anchorOffset,fe.focusNode=ce.focusNode,fe.focusOffset=ce.focusOffset)}return fe}function Bs(ie){if(!(!ie||!ie.activeElt||ie.activeElt==St())&&(ie.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(ie.activeElt.nodeName)&&ie.anchorNode&&wt(document.body,ie.anchorNode)&&wt(document.body,ie.focusNode))){var ae=window.getSelection(),fe=document.createRange();fe.setEnd(ie.anchorNode,ie.anchorOffset),fe.collapse(!1),ae.removeAllRanges(),ae.addRange(fe),ae.extend(ie.focusNode,ie.focusOffset)}}function oh(ie,ae){var fe=ie.display,ce=ie.doc;if(ae.editorIsHidden)return Jr(ie),!1;if(!ae.force&&ae.visible.from>=fe.viewFrom&&ae.visible.to<=fe.viewTo&&(fe.updateLineNumbers==null||fe.updateLineNumbers>=fe.viewTo)&&fe.renderedView==fe.view&&Fo(ie)==0)return!1;Ss(ie)&&(Jr(ie),ae.dims=Fr(ie));var me=ce.first+ce.size,ke=Math.max(ae.visible.from-ie.options.viewportMargin,ce.first),Ge=Math.min(me,ae.visible.to+ie.options.viewportMargin);fe.viewFrom<ke&&ke-fe.viewFrom<20&&(ke=Math.max(ce.first,fe.viewFrom)),fe.viewTo>Ge&&fe.viewTo-Ge<20&&(Ge=Math.min(me,fe.viewTo)),Bn&&(ke=Ti(ie.doc,ke),Ge=Yi(ie.doc,Ge));var Je=ke!=fe.viewFrom||Ge!=fe.viewTo||fe.lastWrapHeight!=ae.wrapperHeight||fe.lastWrapWidth!=ae.wrapperWidth;Mr(ie,ke,Ge),fe.viewOffset=cr(ni(ie.doc,fe.viewFrom)),ie.display.mover.style.top=fe.viewOffset+"px";var Ye=Fo(ie);if(!Je&&Ye==0&&!ae.force&&fe.renderedView==fe.view&&(fe.updateLineNumbers==null||fe.updateLineNumbers>=fe.viewTo))return!1;var yt=rs(ie);return Ye>4&&(fe.lineDiv.style.display="none"),Jl(ie,fe.updateLineNumbers,ae.dims),Ye>4&&(fe.lineDiv.style.display=""),fe.renderedView=fe.view,Bs(yt),lt(fe.cursorDiv),lt(fe.selectionDiv),fe.gutters.style.height=fe.sizer.style.minHeight=0,Je&&(fe.lastWrapHeight=ae.wrapperHeight,fe.lastWrapWidth=ae.wrapperWidth,Wa(ie,400)),fe.updateLineNumbers=null,!0}function Hr(ie,ae){for(var fe=ae.viewport,ce=!0;;ce=!1){if(!ce||!ie.options.lineWrapping||ae.oldDisplayWidth==_i(ie)){if(fe&&fe.top!=null&&(fe={top:Math.min(ie.doc.height+Fn(ie.display)-Pi(ie),fe.top)}),ae.visible=Eo(ie.display,ie.doc,fe),ae.visible.from>=ie.display.viewFrom&&ae.visible.to<=ie.display.viewTo)break}else ce&&(ae.visible=Eo(ie.display,ie.doc,fe));if(!oh(ie,ae))break;vo(ie);var me=Ea(ie);vr(ie),Zs(ie,me),Ml(ie,me),ae.force=!1}ae.signal(ie,"update",ie),(ie.display.viewFrom!=ie.display.reportedViewFrom||ie.display.viewTo!=ie.display.reportedViewTo)&&(ae.signal(ie,"viewportChange",ie,ie.display.viewFrom,ie.display.viewTo),ie.display.reportedViewFrom=ie.display.viewFrom,ie.display.reportedViewTo=ie.display.viewTo)}function el(ie,ae){var fe=new ya(ie,ae);if(oh(ie,fe)){vo(ie),Hr(ie,fe);var ce=Ea(ie);vr(ie),Zs(ie,ce),Ml(ie,ce),fe.finish()}}function Jl(ie,ae,fe){var ce=ie.display,me=ie.options.lineNumbers,ke=ce.lineDiv,Ge=ke.firstChild;function Je(ir){var hr=ir.nextSibling;return st&&de&&ie.display.currentWheelTarget==ir?ir.style.display="none":ir.parentNode.removeChild(ir),hr}for(var Ye=ce.view,yt=ce.viewFrom,sn=0;sn<Ye.length;sn++){var Ft=Ye[sn];if(!Ft.hidden)if(!Ft.node||Ft.node.parentNode!=ke){var jn=Ko(ie,Ft,yt,fe);ke.insertBefore(jn,Ge)}else{for(;Ge!=Ft.node;)Ge=Je(Ge);var kn=me&&ae!=null&&ae<=yt&&Ft.lineNumber;Ft.changes&&(dn(Ft.changes,"gutter")>-1&&(kn=!1),Ma(ie,Ft,yt,fe)),kn&&(lt(Ft.lineNumber),Ft.lineNumber.appendChild(document.createTextNode(li(ie.options,yt)))),Ge=Ft.node.nextSibling}yt+=Ft.size}for(;Ge;)Ge=Je(Ge)}function Ns(ie){var ae=ie.gutters.offsetWidth;ie.sizer.style.marginLeft=ae+"px"}function Ml(ie,ae){ie.display.sizer.style.minHeight=ae.docHeight+"px",ie.display.heightForcer.style.top=ae.docHeight+"px",ie.display.gutters.style.height=ae.docHeight+ie.display.barHeight+Si(ie)+"px"}function xh(ie){var ae=ie.display,fe=ae.view;if(!(!ae.alignWidgets&&(!ae.gutters.firstChild||!ie.options.fixedGutter))){for(var ce=Br(ae)-ae.scroller.scrollLeft+ie.doc.scrollLeft,me=ae.gutters.offsetWidth,ke=ce+"px",Ge=0;Ge<fe.length;Ge++)if(!fe[Ge].hidden){ie.options.fixedGutter&&(fe[Ge].gutter&&(fe[Ge].gutter.style.left=ke),fe[Ge].gutterBackground&&(fe[Ge].gutterBackground.style.left=ke));var Je=fe[Ge].alignable;if(Je)for(var Ye=0;Ye<Je.length;Ye++)Je[Ye].style.left=ke}ie.options.fixedGutter&&(ae.gutters.style.left=ce+me+"px")}}function Ss(ie){if(!ie.options.lineNumbers)return!1;var ae=ie.doc,fe=li(ie.options,ae.first+ae.size-1),ce=ie.display;if(fe.length!=ce.lineNumChars){var me=ce.measure.appendChild(Ue("div",[Ue("div",fe)],"CodeMirror-linenumber CodeMirror-gutter-elt")),ke=me.firstChild.offsetWidth,Ge=me.offsetWidth-ke;return ce.lineGutter.style.width="",ce.lineNumInnerWidth=Math.max(ke,ce.lineGutter.offsetWidth-Ge)+1,ce.lineNumWidth=ce.lineNumInnerWidth+Ge,ce.lineNumChars=ce.lineNumInnerWidth?fe.length:-1,ce.lineGutter.style.width=ce.lineNumWidth+"px",Ns(ie.display),!0}return!1}function ms(ie,ae){for(var fe=[],ce=!1,me=0;me<ie.length;me++){var ke=ie[me],Ge=null;if(typeof ke!="string"&&(Ge=ke.style,ke=ke.className),ke=="CodeMirror-linenumbers")if(ae)ce=!0;else continue;fe.push({className:ke,style:Ge})}return ae&&!ce&&fe.push({className:"CodeMirror-linenumbers",style:null}),fe}function Ql(ie){var ae=ie.gutters,fe=ie.gutterSpecs;lt(ae),ie.lineGutter=null;for(var ce=0;ce<fe.length;++ce){var me=fe[ce],ke=me.className,Ge=me.style,Je=ae.appendChild(Ue("div",null,"CodeMirror-gutter "+ke));Ge&&(Je.style.cssText=Ge),ke=="CodeMirror-linenumbers"&&(ie.lineGutter=Je,Je.style.width=(ie.lineNumWidth||1)+"px")}ae.style.display=fe.length?"":"none",Ns(ie)}function hu(ie){Ql(ie.display),Ei(ie),xh(ie)}function Sh(ie,ae,fe,ce){var me=this;this.input=fe,me.scrollbarFiller=Ue("div",null,"CodeMirror-scrollbar-filler"),me.scrollbarFiller.setAttribute("cm-not-content","true"),me.gutterFiller=Ue("div",null,"CodeMirror-gutter-filler"),me.gutterFiller.setAttribute("cm-not-content","true"),me.lineDiv=dt("div",null,"CodeMirror-code"),me.selectionDiv=Ue("div",null,null,"position: relative; z-index: 1"),me.cursorDiv=Ue("div",null,"CodeMirror-cursors"),me.measure=Ue("div",null,"CodeMirror-measure"),me.lineMeasure=Ue("div",null,"CodeMirror-measure"),me.lineSpace=dt("div",[me.measure,me.lineMeasure,me.selectionDiv,me.cursorDiv,me.lineDiv],null,"position: relative; outline: none");var ke=dt("div",[me.lineSpace],"CodeMirror-lines");me.mover=Ue("div",[ke],null,"position: relative"),me.sizer=Ue("div",[me.mover],"CodeMirror-sizer"),me.sizerWidth=null,me.heightForcer=Ue("div",null,null,"position: absolute; height: "+ri+"px; width: 1px;"),me.gutters=Ue("div",null,"CodeMirror-gutters"),me.lineGutter=null,me.scroller=Ue("div",[me.sizer,me.heightForcer,me.gutters],"CodeMirror-scroll"),me.scroller.setAttribute("tabIndex","-1"),me.wrapper=Ue("div",[me.scrollbarFiller,me.gutterFiller,me.scroller],"CodeMirror"),vt&&Oe<8&&(me.gutters.style.zIndex=-1,me.scroller.style.paddingRight=0),!st&&!(le&&te)&&(me.scroller.draggable=!0),ie&&(ie.appendChild?ie.appendChild(me.wrapper):ie(me.wrapper)),me.viewFrom=me.viewTo=ae.first,me.reportedViewFrom=me.reportedViewTo=ae.first,me.view=[],me.renderedView=null,me.externalMeasured=null,me.viewOffset=0,me.lastWrapHeight=me.lastWrapWidth=0,me.updateLineNumbers=null,me.nativeBarWidth=me.barHeight=me.barWidth=0,me.scrollbarsClipped=!1,me.lineNumWidth=me.lineNumInnerWidth=me.lineNumChars=null,me.alignWidgets=!1,me.cachedCharWidth=me.cachedTextHeight=me.cachedPaddingH=null,me.maxLine=null,me.maxLineLength=0,me.maxLineChanged=!1,me.wheelDX=me.wheelDY=me.wheelStartX=me.wheelStartY=null,me.shift=!1,me.selForContextMenu=null,me.activeTouch=null,me.gutterSpecs=ms(ce.gutters,ce.lineNumbers),Ql(me),fe.init(me)}var Rl=0,js=null;vt?js=-.53:le?js=15:ot?js=-.7:Tt&&(js=-1/3);function Zu(ie){var ae=ie.wheelDeltaX,fe=ie.wheelDeltaY;return ae==null&&ie.detail&&ie.axis==ie.HORIZONTAL_AXIS&&(ae=ie.detail),fe==null&&ie.detail&&ie.axis==ie.VERTICAL_AXIS?fe=ie.detail:fe==null&&(fe=ie.wheelDelta),{x:ae,y:fe}}function du(ie){var ae=Zu(ie);return ae.x*=js,ae.y*=js,ae}function tl(ie,ae){var fe=Zu(ae),ce=fe.x,me=fe.y,ke=ie.display,Ge=ke.scroller,Je=Ge.scrollWidth>Ge.clientWidth,Ye=Ge.scrollHeight>Ge.clientHeight;if(ce&&Je||me&&Ye){if(me&&de&&st){e:for(var yt=ae.target,sn=ke.view;yt!=Ge;yt=yt.parentNode)for(var Ft=0;Ft<sn.length;Ft++)if(sn[Ft].node==yt){ie.display.currentWheelTarget=yt;break e}}if(ce&&!le&&!We&&js!=null){me&&Ye&&fl(ie,Math.max(0,Ge.scrollTop+me*js)),Bl(ie,Math.max(0,Ge.scrollLeft+ce*js)),(!me||me&&Ye)&&di(ae),ke.wheelStartX=null;return}if(me&&js!=null){var jn=me*js,kn=ie.doc.scrollTop,ir=kn+ke.wrapper.clientHeight;jn<0?kn=Math.max(0,kn+jn-50):ir=Math.min(ie.doc.height,ir+jn+50),el(ie,{top:kn,bottom:ir})}Rl<20&&(ke.wheelStartX==null?(ke.wheelStartX=Ge.scrollLeft,ke.wheelStartY=Ge.scrollTop,ke.wheelDX=ce,ke.wheelDY=me,setTimeout(function(){if(ke.wheelStartX!=null){var hr=Ge.scrollLeft-ke.wheelStartX,Lr=Ge.scrollTop-ke.wheelStartY,qr=Lr&&ke.wheelDY&&Lr/ke.wheelDY||hr&&ke.wheelDX&&hr/ke.wheelDX;ke.wheelStartX=ke.wheelStartY=null,qr&&(js=(js*Rl+qr)/(Rl+1),++Rl)}},200)):(ke.wheelDX+=ce,ke.wheelDY+=me))}}var vu=function(ie,ae){this.ranges=ie,this.primIndex=ae};vu.prototype.primary=function(){return this.ranges[this.primIndex]},vu.prototype.equals=function(ie){if(ie==this)return!0;if(ie.primIndex!=this.primIndex||ie.ranges.length!=this.ranges.length)return!1;for(var ae=0;ae<this.ranges.length;ae++){var fe=this.ranges[ae],ce=ie.ranges[ae];if(!Un(fe.anchor,ce.anchor)||!Un(fe.head,ce.head))return!1}return!0},vu.prototype.deepCopy=function(){for(var ie=[],ae=0;ae<this.ranges.length;ae++)ie[ae]=new os(ai(this.ranges[ae].anchor),ai(this.ranges[ae].head));return new vu(ie,this.primIndex)},vu.prototype.somethingSelected=function(){for(var ie=0;ie<this.ranges.length;ie++)if(!this.ranges[ie].empty())return!0;return!1},vu.prototype.contains=function(ie,ae){ae||(ae=ie);for(var fe=0;fe<this.ranges.length;fe++){var ce=this.ranges[fe];if(jt(ae,ce.from())>=0&&jt(ie,ce.to())<=0)return fe}return-1};var os=function(ie,ae){this.anchor=ie,this.head=ae};os.prototype.from=function(){return xi(this.anchor,this.head)},os.prototype.to=function(){return Vi(this.anchor,this.head)},os.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Lu(ie,ae,fe){var ce=ie&&ie.options.selectionsMayTouch,me=ae[fe];ae.sort(function(jn,kn){return jt(jn.from(),kn.from())}),fe=dn(ae,me);for(var ke=1;ke<ae.length;ke++){var Ge=ae[ke],Je=ae[ke-1],Ye=jt(Je.to(),Ge.from());if(ce&&!Ge.empty()?Ye>0:Ye>=0){var yt=xi(Je.from(),Ge.from()),sn=Vi(Je.to(),Ge.to()),Ft=Je.empty()?Ge.from()==Ge.head:Je.from()==Je.head;ke<=fe&&--fe,ae.splice(--ke,2,new os(Ft?sn:yt,Ft?yt:sn))}}return new vu(ae,fe)}function wh(ie,ae){return new vu([new os(ie,ae||ie)],0)}function Oh(ie){return ie.text?Qt(ie.from.line+ie.text.length-1,Nt(ie.text).length+(ie.text.length==1?ie.from.ch:0)):ie.to}function od(ie,ae){if(jt(ie,ae.from)<0)return ie;if(jt(ie,ae.to)<=0)return Oh(ae);var fe=ie.line+ae.text.length-(ae.to.line-ae.from.line)-1,ce=ie.ch;return ie.line==ae.to.line&&(ce+=Oh(ae).ch-ae.to.ch),Qt(fe,ce)}function Bu(ie,ae){for(var fe=[],ce=0;ce<ie.sel.ranges.length;ce++){var me=ie.sel.ranges[ce];fe.push(new os(od(me.anchor,ae),od(me.head,ae)))}return Lu(ie.cm,fe,ie.sel.primIndex)}function Dd(ie,ae,fe){return ie.line==ae.line?Qt(fe.line,ie.ch-ae.ch+fe.ch):Qt(fe.line+(ie.line-ae.line),ie.ch)}function Td(ie,ae,fe){for(var ce=[],me=Qt(ie.first,0),ke=me,Ge=0;Ge<ae.length;Ge++){var Je=ae[Ge],Ye=Dd(Je.from,me,ke),yt=Dd(Oh(Je),me,ke);if(me=Je.to,ke=yt,fe=="around"){var sn=ie.sel.ranges[Ge],Ft=jt(sn.head,sn.anchor)<0;ce[Ge]=new os(Ft?yt:Ye,Ft?Ye:yt)}else ce[Ge]=new os(Ye,Ye)}return new vu(ce,ie.sel.primIndex)}function Aa(ie){ie.doc.mode=Mt(ie.options,ie.doc.modeOption),Sc(ie)}function Sc(ie){ie.doc.iter(function(ae){ae.stateAfter&&(ae.stateAfter=null),ae.styles&&(ae.styles=null)}),ie.doc.modeFrontier=ie.doc.highlightFrontier=ie.doc.first,Wa(ie,100),ie.state.modeGen++,ie.curOp&&Ei(ie)}function ff(ie,ae){return ae.from.ch==0&&ae.to.ch==0&&Nt(ae.text)==""&&(!ie.cm||ie.cm.options.wholeLineUpdateBefore)}function wc(ie,ae,fe,ce){function me(Ao){return fe?fe[Ao]:null}function ke(Ao,ho,jo){Wo(Ao,ho,jo,ce),$r(Ao,"change",Ao,ae)}function Ge(Ao,ho){for(var jo=[],xa=Ao;xa<ho;++xa)jo.push(new Vo(yt[xa],me(xa),ce));return jo}var Je=ae.from,Ye=ae.to,yt=ae.text,sn=ni(ie,Je.line),Ft=ni(ie,Ye.line),jn=Nt(yt),kn=me(yt.length-1),ir=Ye.line-Je.line;if(ae.full)ie.insert(0,Ge(0,yt.length)),ie.remove(yt.length,ie.size-yt.length);else if(ff(ie,ae)){var hr=Ge(0,yt.length-1);ke(Ft,Ft.text,kn),ir&&ie.remove(Je.line,ir),hr.length&&ie.insert(Je.line,hr)}else if(sn==Ft)if(yt.length==1)ke(sn,sn.text.slice(0,Je.ch)+jn+sn.text.slice(Ye.ch),kn);else{var Lr=Ge(1,yt.length-1);Lr.push(new Vo(jn+sn.text.slice(Ye.ch),kn,ce)),ke(sn,sn.text.slice(0,Je.ch)+yt[0],me(0)),ie.insert(Je.line+1,Lr)}else if(yt.length==1)ke(sn,sn.text.slice(0,Je.ch)+yt[0]+Ft.text.slice(Ye.ch),me(0)),ie.remove(Je.line+1,ir);else{ke(sn,sn.text.slice(0,Je.ch)+yt[0],me(0)),ke(Ft,jn+Ft.text.slice(Ye.ch),kn);var qr=Ge(1,yt.length-1);ir>1&&ie.remove(Je.line+1,ir-1),ie.insert(Je.line+1,qr)}$r(ie,"change",ie,ae)}function Gu(ie,ae,fe){function ce(me,ke,Ge){if(me.linked)for(var Je=0;Je<me.linked.length;++Je){var Ye=me.linked[Je];if(Ye.doc!=ke){var yt=Ge&&Ye.sharedHist;fe&&!yt||(ae(Ye.doc,yt),ce(Ye.doc,me,yt))}}}ce(ie,null,!0)}function Pc(ie,ae){if(ae.cm)throw new Error("This document is already in use.");ie.doc=ae,ae.cm=ie,mr(ie),Aa(ie),_d(ie),ie.options.lineWrapping||Wr(ie),ie.options.mode=ae.modeOption,Ei(ie)}function _d(ie){(ie.doc.direction=="rtl"?Lt:Ze)(ie.display.lineDiv,"CodeMirror-rtl")}function zp(ie){uo(ie,function(){_d(ie),Ei(ie)})}function Id(ie){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=ie||1}function Ec(ie,ae){var fe={from:ai(ae.from),to:Oh(ae),text:sr(ie,ae.from,ae.to)};return jh(ie,fe,ae.from.line,ae.to.line+1),Gu(ie,function(ce){return jh(ce,fe,ae.from.line,ae.to.line+1)},!0),fe}function Od(ie){for(;ie.length;){var ae=Nt(ie);if(ae.ranges)ie.pop();else break}}function ad(ie,ae){if(ae)return Od(ie.done),Nt(ie.done);if(ie.done.length&&!Nt(ie.done).ranges)return Nt(ie.done);if(ie.done.length>1&&!ie.done[ie.done.length-2].ranges)return ie.done.pop(),Nt(ie.done)}function Rd(ie,ae,fe,ce){var me=ie.history;me.undone.length=0;var ke=+new Date,Ge,Je;if((me.lastOp==ce||me.lastOrigin==ae.origin&&ae.origin&&(ae.origin.charAt(0)=="+"&&me.lastModTime>ke-(ie.cm?ie.cm.options.historyEventDelay:500)||ae.origin.charAt(0)=="*"))&&(Ge=ad(me,me.lastOp==ce)))Je=Nt(Ge.changes),jt(ae.from,ae.to)==0&&jt(ae.from,Je.to)==0?Je.to=Oh(ae):Ge.changes.push(Ec(ie,ae));else{var Ye=Nt(me.done);for((!Ye||!Ye.ranges)&&Rh(ie.sel,me.done),Ge={changes:[Ec(ie,ae)],generation:me.generation},me.done.push(Ge);me.done.length>me.undoDepth;)me.done.shift(),me.done[0].ranges||me.done.shift()}me.done.push(fe),me.generation=++me.maxGeneration,me.lastModTime=me.lastSelTime=ke,me.lastOp=me.lastSelOp=ce,me.lastOrigin=me.lastSelOrigin=ae.origin,Je||qt(ie,"historyAdded")}function Cc(ie,ae,fe,ce){var me=ae.charAt(0);return me=="*"||me=="+"&&fe.ranges.length==ce.ranges.length&&fe.somethingSelected()==ce.somethingSelected()&&new Date-ie.history.lastSelTime<=(ie.cm?ie.cm.options.historyEventDelay:500)}function bc(ie,ae,fe,ce){var me=ie.history,ke=ce&&ce.origin;fe==me.lastSelOp||ke&&me.lastSelOrigin==ke&&(me.lastModTime==me.lastSelTime&&me.lastOrigin==ke||Cc(ie,ke,Nt(me.done),ae))?me.done[me.done.length-1]=ae:Rh(ae,me.done),me.lastSelTime=+new Date,me.lastSelOrigin=ke,me.lastSelOp=fe,ce&&ce.clearRedo!==!1&&Od(me.undone)}function Rh(ie,ae){var fe=Nt(ae);fe&&fe.ranges&&fe.equals(ie)||ae.push(ie)}function jh(ie,ae,fe,ce){var me=ae["spans_"+ie.id],ke=0;ie.iter(Math.max(ie.first,fe),Math.min(ie.first+ie.size,ce),function(Ge){Ge.markedSpans&&((me||(me=ae["spans_"+ie.id]={}))[ke]=Ge.markedSpans),++ke})}function kl(ie){if(!ie)return null;for(var ae,fe=0;fe<ie.length;++fe)ie[fe].marker.explicitlyCleared?ae||(ae=ie.slice(0,fe)):ae&&ae.push(ie[fe]);return ae?ae.length?ae:null:ie}function ah(ie,ae){var fe=ae["spans_"+ie.id];if(!fe)return null;for(var ce=[],me=0;me<ae.text.length;++me)ce.push(kl(fe[me]));return ce}function Fc(ie,ae){var fe=ah(ie,ae),ce=fa(ie,ae);if(!fe)return ce;if(!ce)return fe;for(var me=0;me<fe.length;++me){var ke=fe[me],Ge=ce[me];if(ke&&Ge)e:for(var Je=0;Je<Ge.length;++Je){for(var Ye=Ge[Je],yt=0;yt<ke.length;++yt)if(ke[yt].marker==Ye.marker)continue e;ke.push(Ye)}else Ge&&(fe[me]=Ge)}return fe}function Ph(ie,ae,fe){for(var ce=[],me=0;me<ie.length;++me){var ke=ie[me];if(ke.ranges){ce.push(fe?vu.prototype.deepCopy.call(ke):ke);continue}var Ge=ke.changes,Je=[];ce.push({changes:Je});for(var Ye=0;Ye<Ge.length;++Ye){var yt=Ge[Ye],sn=void 0;if(Je.push({from:yt.from,to:yt.to,text:yt.text}),ae)for(var Ft in yt)(sn=Ft.match(/^spans_(\d+)$/))&&dn(ae,Number(sn[1]))>-1&&(Nt(Je)[Ft]=yt[Ft],delete yt[Ft])}}return ce}function gf(ie,ae,fe,ce){if(ce){var me=ie.anchor;if(fe){var ke=jt(ae,me)<0;ke!=jt(fe,me)<0?(me=ae,ae=fe):ke!=jt(ae,fe)<0&&(ae=fe)}return new os(me,ae)}else return new os(fe||ae,ae)}function pf(ie,ae,fe,ce,me){me==null&&(me=ie.cm&&(ie.cm.display.shift||ie.extend)),gl(ie,new vu([gf(ie.sel.primary(),ae,fe,me)],0),ce)}function sd(ie,ae,fe){for(var ce=[],me=ie.cm&&(ie.cm.display.shift||ie.extend),ke=0;ke<ie.sel.ranges.length;ke++)ce[ke]=gf(ie.sel.ranges[ke],ae[ke],null,me);var Ge=Lu(ie.cm,ce,ie.sel.primIndex);gl(ie,Ge,fe)}function yu(ie,ae,fe,ce){var me=ie.sel.ranges.slice(0);me[ae]=fe,gl(ie,Lu(ie.cm,me,ie.sel.primIndex),ce)}function Eh(ie,ae,fe,ce){gl(ie,wh(ae,fe),ce)}function Gg(ie,ae,fe){var ce={ranges:ae.ranges,update:function(me){this.ranges=[];for(var ke=0;ke<me.length;ke++)this.ranges[ke]=new os(Ii(ie,me[ke].anchor),Ii(ie,me[ke].head))},origin:fe&&fe.origin};return qt(ie,"beforeSelectionChange",ie,ce),ie.cm&&qt(ie.cm,"beforeSelectionChange",ie.cm,ce),ce.ranges!=ae.ranges?Lu(ie.cm,ce.ranges,ce.ranges.length-1):ae}function Lc(ie,ae,fe){var ce=ie.history.done,me=Nt(ce);me&&me.ranges?(ce[ce.length-1]=ae,Wu(ie,ae,fe)):gl(ie,ae,fe)}function gl(ie,ae,fe){Wu(ie,ae,fe),bc(ie,ie.sel,ie.cm?ie.cm.curOp.id:NaN,fe)}function Wu(ie,ae,fe){(on(ie,"beforeSelectionChange")||ie.cm&&on(ie.cm,"beforeSelectionChange"))&&(ae=Gg(ie,ae,fe));var ce=fe&&fe.bias||(jt(ae.primary().head,ie.sel.primary().head)<0?-1:1);Yf(ie,Al(ie,ae,ce,!0)),!(fe&&fe.scroll===!1)&&ie.cm&&Ll(ie.cm)}function Yf(ie,ae){ae.equals(ie.sel)||(ie.sel=ae,ie.cm&&(ie.cm.curOp.updateInput=1,ie.cm.curOp.selectionChanged=!0,zn(ie.cm)),$r(ie,"cursorActivity",ie))}function Bc(ie){Yf(ie,Al(ie,ie.sel,null,!1))}function Al(ie,ae,fe,ce){for(var me,ke=0;ke<ae.ranges.length;ke++){var Ge=ae.ranges[ke],Je=ae.ranges.length==ie.sel.ranges.length&&ie.sel.ranges[ke],Ye=jd(ie,Ge.anchor,Je&&Je.anchor,fe,ce),yt=jd(ie,Ge.head,Je&&Je.head,fe,ce);(me||Ye!=Ge.anchor||yt!=Ge.head)&&(me||(me=ae.ranges.slice(0,ke)),me[ke]=new os(Ye,yt))}return me?Lu(ie.cm,me,ae.primIndex):ae}function Hu(ie,ae,fe,ce,me){var ke=ni(ie,ae.line);if(ke.markedSpans)for(var Ge=0;Ge<ke.markedSpans.length;++Ge){var Je=ke.markedSpans[Ge],Ye=Je.marker,yt="selectLeft"in Ye?!Ye.selectLeft:Ye.inclusiveLeft,sn="selectRight"in Ye?!Ye.selectRight:Ye.inclusiveRight;if((Je.from==null||(yt?Je.from<=ae.ch:Je.from<ae.ch))&&(Je.to==null||(sn?Je.to>=ae.ch:Je.to>ae.ch))){if(me&&(qt(Ye,"beforeCursorEnter"),Ye.explicitlyCleared))if(ke.markedSpans){--Ge;continue}else break;if(!Ye.atomic)continue;if(fe){var Ft=Ye.find(ce<0?1:-1),jn=void 0;if((ce<0?sn:yt)&&(Ft=Xf(ie,Ft,-ce,Ft&&Ft.line==ae.line?ke:null)),Ft&&Ft.line==ae.line&&(jn=jt(Ft,fe))&&(ce<0?jn<0:jn>0))return Hu(ie,Ft,ae,ce,me)}var kn=Ye.find(ce<0?-1:1);return(ce<0?yt:sn)&&(kn=Xf(ie,kn,ce,kn.line==ae.line?ke:null)),kn?Hu(ie,kn,ae,ce,me):null}}return ae}function jd(ie,ae,fe,ce,me){var ke=ce||1,Ge=Hu(ie,ae,fe,ke,me)||!me&&Hu(ie,ae,fe,ke,!0)||Hu(ie,ae,fe,-ke,me)||!me&&Hu(ie,ae,fe,-ke,!0);return Ge||(ie.cantEdit=!0,Qt(ie.first,0))}function Xf(ie,ae,fe,ce){return fe<0&&ae.ch==0?ae.line>ie.first?Ii(ie,Qt(ae.line-1)):null:fe>0&&ae.ch==(ce||ni(ie,ae.line)).text.length?ae.line<ie.first+ie.size-1?Qt(ae.line+1,0):null:new Qt(ae.line,ae.ch+fe)}function zs(ie){ie.setSelection(Qt(ie.firstLine(),0),Qt(ie.lastLine()),Wt)}function Ch(ie,ae,fe){var ce={canceled:!1,from:ae.from,to:ae.to,text:ae.text,origin:ae.origin,cancel:function(){return ce.canceled=!0}};return fe&&(ce.update=function(me,ke,Ge,Je){me&&(ce.from=Ii(ie,me)),ke&&(ce.to=Ii(ie,ke)),Ge&&(ce.text=Ge),Je!==void 0&&(ce.origin=Je)}),qt(ie,"beforeChange",ie,ce),ie.cm&&qt(ie.cm,"beforeChange",ie.cm,ce),ce.canceled?(ie.cm&&(ie.cm.curOp.updateInput=2),null):{from:ce.from,to:ce.to,text:ce.text,origin:ce.origin}}function bh(ie,ae,fe){if(ie.cm){if(!ie.cm.curOp)return io(ie.cm,bh)(ie,ae,fe);if(ie.cm.state.suppressEdits)return}if(!((on(ie,"beforeChange")||ie.cm&&on(ie.cm,"beforeChange"))&&(ae=Ch(ie,ae,!0),!ae))){var ce=Io&&!fe&&Rn(ie,ae.from,ae.to);if(ce)for(var me=ce.length-1;me>=0;--me)ld(ie,{from:ce[me].from,to:ce[me].to,text:me?[""]:ae.text,origin:ae.origin});else ld(ie,ae)}}function ld(ie,ae){if(!(ae.text.length==1&&ae.text[0]==""&&jt(ae.from,ae.to)==0)){var fe=Bu(ie,ae);Rd(ie,ae,fe,ie.cm?ie.cm.curOp.id:NaN),zh(ie,ae,fe,fa(ie,ae));var ce=[];Gu(ie,function(me,ke){!ke&&dn(ce,me.history)==-1&&(mf(me.history,ae),ce.push(me.history)),zh(me,ae,null,fa(me,ae))})}}function Mc(ie,ae,fe){var ce=ie.cm&&ie.cm.state.suppressEdits;if(!(ce&&!fe)){for(var me=ie.history,ke,Ge=ie.sel,Je=ae=="undo"?me.done:me.undone,Ye=ae=="undo"?me.undone:me.done,yt=0;yt<Je.length&&(ke=Je[yt],!(fe?ke.ranges&&!ke.equals(ie.sel):!ke.ranges));yt++);if(yt!=Je.length){for(me.lastOrigin=me.lastSelOrigin=null;;)if(ke=Je.pop(),ke.ranges){if(Rh(ke,Ye),fe&&!ke.equals(ie.sel)){gl(ie,ke,{clearRedo:!1});return}Ge=ke}else if(ce){Je.push(ke);return}else break;var sn=[];Rh(Ge,Ye),Ye.push({changes:sn,generation:me.generation}),me.generation=ke.generation||++me.maxGeneration;for(var Ft=on(ie,"beforeChange")||ie.cm&&on(ie.cm,"beforeChange"),jn=function(hr){var Lr=ke.changes[hr];if(Lr.origin=ae,Ft&&!Ch(ie,Lr,!1))return Je.length=0,{};sn.push(Ec(ie,Lr));var qr=hr?Bu(ie,Lr):Nt(Je);zh(ie,Lr,qr,Fc(ie,Lr)),!hr&&ie.cm&&ie.cm.scrollIntoView({from:Lr.from,to:Oh(Lr)});var Ao=[];Gu(ie,function(ho,jo){!jo&&dn(Ao,ho.history)==-1&&(mf(ho.history,Lr),Ao.push(ho.history)),zh(ho,Lr,null,Fc(ho,Lr))})},kn=ke.changes.length-1;kn>=0;--kn){var ir=jn(kn);if(ir)return ir.v}}}}function Jf(ie,ae){if(ae!=0&&(ie.first+=ae,ie.sel=new vu(ii(ie.sel.ranges,function(me){return new os(Qt(me.anchor.line+ae,me.anchor.ch),Qt(me.head.line+ae,me.head.ch))}),ie.sel.primIndex),ie.cm)){Ei(ie.cm,ie.first,ie.first-ae,ae);for(var fe=ie.cm.display,ce=fe.viewFrom;ce<fe.viewTo;ce++)bi(ie.cm,ce,"gutter")}}function zh(ie,ae,fe,ce){if(ie.cm&&!ie.cm.curOp)return io(ie.cm,zh)(ie,ae,fe,ce);if(ae.to.line<ie.first){Jf(ie,ae.text.length-1-(ae.to.line-ae.from.line));return}if(!(ae.from.line>ie.lastLine())){if(ae.from.line<ie.first){var me=ae.text.length-1-(ie.first-ae.from.line);Jf(ie,me),ae={from:Qt(ie.first,0),to:Qt(ae.to.line+me,ae.to.ch),text:[Nt(ae.text)],origin:ae.origin}}var ke=ie.lastLine();ae.to.line>ke&&(ae={from:ae.from,to:Qt(ke,ni(ie,ke).text.length),text:[ae.text[0]],origin:ae.origin}),ae.removed=sr(ie,ae.from,ae.to),fe||(fe=Bu(ie,ae)),ie.cm?zd(ie.cm,ae,ce):wc(ie,ae,ce),Wu(ie,fe,Wt),ie.cantEdit&&jd(ie,Qt(ie.firstLine(),0))&&(ie.cantEdit=!1)}}function zd(ie,ae,fe){var ce=ie.doc,me=ie.display,ke=ae.from,Ge=ae.to,Je=!1,Ye=ke.line;ie.options.lineWrapping||(Ye=at(ti(ni(ce,ke.line))),ce.iter(Ye,Ge.line+1,function(kn){if(kn==me.maxLine)return Je=!0,!0})),ce.sel.contains(ae.from,ae.to)>-1&&zn(ie),wc(ce,ae,fe,Zr(ie)),ie.options.lineWrapping||(ce.iter(Ye,ke.line+ae.text.length,function(kn){var ir=Mo(kn);ir>me.maxLineLength&&(me.maxLine=kn,me.maxLineLength=ir,me.maxLineChanged=!0,Je=!1)}),Je&&(ie.curOp.updateMaxLine=!0)),wo(ce,ke.line),Wa(ie,400);var yt=ae.text.length-(Ge.line-ke.line)-1;ae.full?Ei(ie):ke.line==Ge.line&&ae.text.length==1&&!ff(ie.doc,ae)?bi(ie,ke.line,"text"):Ei(ie,ke.line,Ge.line+1,yt);var sn=on(ie,"changes"),Ft=on(ie,"change");if(Ft||sn){var jn={from:ke,to:Ge,text:ae.text,removed:ae.removed,origin:ae.origin};Ft&&$r(ie,"change",ie,jn),sn&&(ie.curOp.changeObjs||(ie.curOp.changeObjs=[])).push(jn)}ie.display.selForContextMenu=null}function ud(ie,ae,fe,ce,me){var ke;ce||(ce=fe),jt(ce,fe)<0&&(ke=[ce,fe],fe=ke[0],ce=ke[1]),typeof ae=="string"&&(ae=ie.splitLines(ae)),bh(ie,{from:fe,to:ce,text:ae,origin:me})}function xu(ie,ae,fe,ce){fe<ie.line?ie.line+=ce:ae<ie.line&&(ie.line=ae,ie.ch=0)}function Wg(ie,ae,fe,ce){for(var me=0;me<ie.length;++me){var ke=ie[me],Ge=!0;if(ke.ranges){ke.copied||(ke=ie[me]=ke.deepCopy(),ke.copied=!0);for(var Je=0;Je<ke.ranges.length;Je++)xu(ke.ranges[Je].anchor,ae,fe,ce),xu(ke.ranges[Je].head,ae,fe,ce);continue}for(var Ye=0;Ye<ke.changes.length;++Ye){var yt=ke.changes[Ye];if(fe<yt.from.line)yt.from=Qt(yt.from.line+ce,yt.from.ch),yt.to=Qt(yt.to.line+ce,yt.to.ch);else if(ae<=yt.to.line){Ge=!1;break}}Ge||(ie.splice(0,me+1),me=0)}}function mf(ie,ae){var fe=ae.from.line,ce=ae.to.line,me=ae.text.length-(ce-fe)-1;Wg(ie.done,fe,ce,me),Wg(ie.undone,fe,ce,me)}function hd(ie,ae,fe,ce){var me=ae,ke=ae;return typeof ae=="number"?ke=ni(ie,Bi(ie,ae)):me=at(ae),me==null?null:(ce(ke,me)&&ie.cm&&bi(ie.cm,me,fe),ke)}function Zd(ie){this.lines=ie,this.parent=null;for(var ae=0,fe=0;fe<ie.length;++fe)ie[fe].parent=this,ae+=ie[fe].height;this.height=ae}Zd.prototype={chunkSize:function(){return this.lines.length},removeInner:function(ie,ae){for(var fe=ie,ce=ie+ae;fe<ce;++fe){var me=this.lines[fe];this.height-=me.height,ua(me),$r(me,"delete")}this.lines.splice(ie,ae)},collapse:function(ie){ie.push.apply(ie,this.lines)},insertInner:function(ie,ae,fe){this.height+=fe,this.lines=this.lines.slice(0,ie).concat(ae).concat(this.lines.slice(ie));for(var ce=0;ce<ae.length;++ce)ae[ce].parent=this},iterN:function(ie,ae,fe){for(var ce=ie+ae;ie<ce;++ie)if(fe(this.lines[ie]))return!0}};function ws(ie){this.children=ie;for(var ae=0,fe=0,ce=0;ce<ie.length;++ce){var me=ie[ce];ae+=me.chunkSize(),fe+=me.height,me.parent=this}this.size=ae,this.height=fe,this.parent=null}ws.prototype={chunkSize:function(){return this.size},removeInner:function(ie,ae){this.size-=ae;for(var fe=0;fe<this.children.length;++fe){var ce=this.children[fe],me=ce.chunkSize();if(ie<me){var ke=Math.min(ae,me-ie),Ge=ce.height;if(ce.removeInner(ie,ke),this.height-=Ge-ce.height,me==ke&&(this.children.splice(fe--,1),ce.parent=null),(ae-=ke)==0)break;ie=0}else ie-=me}if(this.size-ae<25&&(this.children.length>1||!(this.children[0]instanceof Zd))){var Je=[];this.collapse(Je),this.children=[new Zd(Je)],this.children[0].parent=this}},collapse:function(ie){for(var ae=0;ae<this.children.length;++ae)this.children[ae].collapse(ie)},insertInner:function(ie,ae,fe){this.size+=ae.length,this.height+=fe;for(var ce=0;ce<this.children.length;++ce){var me=this.children[ce],ke=me.chunkSize();if(ie<=ke){if(me.insertInner(ie,ae,fe),me.lines&&me.lines.length>50){for(var Ge=me.lines.length%25+25,Je=Ge;Je<me.lines.length;){var Ye=new Zd(me.lines.slice(Je,Je+=25));me.height-=Ye.height,this.children.splice(++ce,0,Ye),Ye.parent=this}me.lines=me.lines.slice(0,Ge),this.maybeSpill()}break}ie-=ke}},maybeSpill:function(){if(!(this.children.length<=10)){var ie=this;do{var ae=ie.children.splice(ie.children.length-5,5),fe=new ws(ae);if(ie.parent){ie.size-=fe.size,ie.height-=fe.height;var me=dn(ie.parent.children,ie);ie.parent.children.splice(me+1,0,fe)}else{var ce=new ws(ie.children);ce.parent=ie,ie.children=[ce,fe],ie=ce}fe.parent=ie.parent}while(ie.children.length>10);ie.parent.maybeSpill()}},iterN:function(ie,ae,fe){for(var ce=0;ce<this.children.length;++ce){var me=this.children[ce],ke=me.chunkSize();if(ie<ke){var Ge=Math.min(ae,ke-ie);if(me.iterN(ie,Ge,fe))return!0;if((ae-=Ge)==0)break;ie=0}else ie-=ke}}};var Fh=function(ie,ae,fe){if(fe)for(var ce in fe)fe.hasOwnProperty(ce)&&(this[ce]=fe[ce]);this.doc=ie,this.node=ae};Fh.prototype.clear=function(){var ie=this.doc.cm,ae=this.line.widgets,fe=this.line,ce=at(fe);if(!(ce==null||!ae)){for(var me=0;me<ae.length;++me)ae[me]==this&&ae.splice(me--,1);ae.length||(fe.widgets=null);var ke=Za(this);Yn(fe,Math.max(0,fe.height-ke)),ie&&(uo(ie,function(){Hg(ie,fe,-ke),bi(ie,ce,"widget")}),$r(ie,"lineWidgetCleared",ie,this,ce))}},Fh.prototype.changed=function(){var ie=this,ae=this.height,fe=this.doc.cm,ce=this.line;this.height=null;var me=Za(this)-ae;me&&(Pn(this.doc,ce)||Yn(ce,ce.height+me),fe&&uo(fe,function(){fe.curOp.forceUpdate=!0,Hg(fe,ce,me),$r(fe,"lineWidgetChanged",fe,ie,at(ce))}))},Sn(Fh);function Hg(ie,ae,fe){cr(ae)<(ie.curOp&&ie.curOp.scrollTop||ie.doc.scrollTop)&&zu(ie,fe)}function dd(ie,ae,fe,ce){var me=new Fh(ie,fe,ce),ke=ie.cm;return ke&&me.noHScroll&&(ke.display.alignWidgets=!0),hd(ie,ae,"widget",function(Ge){var Je=Ge.widgets||(Ge.widgets=[]);if(me.insertAt==null?Je.push(me):Je.splice(Math.min(Je.length-1,Math.max(0,me.insertAt)),0,me),me.line=Ge,ke&&!Pn(ie,Ge)){var Ye=cr(Ge)<ie.scrollTop;Yn(Ge,Ge.height+Za(me)),Ye&&zu(ke,me.height),ke.curOp.forceUpdate=!0}return!0}),ke&&$r(ke,"lineWidgetAdded",ke,me,typeof ae=="number"?ae:at(ae)),me}var Vg=0,Vt=function(ie,ae){this.lines=[],this.type=ae,this.doc=ie,this.id=++Vg};Vt.prototype.clear=function(){if(!this.explicitlyCleared){var ie=this.doc.cm,ae=ie&&!ie.curOp;if(ae&&Ol(ie),on(this,"clear")){var fe=this.find();fe&&$r(this,"clear",fe.from,fe.to)}for(var ce=null,me=null,ke=0;ke<this.lines.length;++ke){var Ge=this.lines[ke],Je=Do(Ge.markedSpans,this);ie&&!this.collapsed?bi(ie,at(Ge),"text"):ie&&(Je.to!=null&&(me=at(Ge)),Je.from!=null&&(ce=at(Ge))),Ge.markedSpans=wr(Ge.markedSpans,Je),Je.from==null&&this.collapsed&&!Pn(this.doc,Ge)&&ie&&Yn(Ge,Qi(ie.display))}if(ie&&this.collapsed&&!ie.options.lineWrapping)for(var Ye=0;Ye<this.lines.length;++Ye){var yt=ti(this.lines[Ye]),sn=Mo(yt);sn>ie.display.maxLineLength&&(ie.display.maxLine=yt,ie.display.maxLineLength=sn,ie.display.maxLineChanged=!0)}ce!=null&&ie&&this.collapsed&&Ei(ie,ce,me+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,ie&&Bc(ie.doc)),ie&&$r(ie,"markerCleared",ie,this,ce,me),ae&&Xl(ie),this.parent&&this.parent.clear()}},Vt.prototype.find=function(ie,ae){ie==null&&this.type=="bookmark"&&(ie=1);for(var fe,ce,me=0;me<this.lines.length;++me){var ke=this.lines[me],Ge=Do(ke.markedSpans,this);if(Ge.from!=null&&(fe=Qt(ae?ke:at(ke),Ge.from),ie==-1))return fe;if(Ge.to!=null&&(ce=Qt(ae?ke:at(ke),Ge.to),ie==1))return ce}return fe&&{from:fe,to:ce}},Vt.prototype.changed=function(){var ie=this,ae=this.find(-1,!0),fe=this,ce=this.doc.cm;!ae||!ce||uo(ce,function(){var me=ae.line,ke=at(ae.line),Ge=yo(ce,ke);if(Ge&&(sa(Ge),ce.curOp.selectionChanged=ce.curOp.forceUpdate=!0),ce.curOp.updateMaxLine=!0,!Pn(fe.doc,me)&&fe.height!=null){var Je=fe.height;fe.height=null;var Ye=Za(fe)-Je;Ye&&Yn(me,me.height+Ye)}$r(ce,"markerChanged",ce,ie)})},Vt.prototype.attachLine=function(ie){if(!this.lines.length&&this.doc.cm){var ae=this.doc.cm.curOp;(!ae.maybeHiddenMarkers||dn(ae.maybeHiddenMarkers,this)==-1)&&(ae.maybeUnhiddenMarkers||(ae.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(ie)},Vt.prototype.detachLine=function(ie){if(this.lines.splice(dn(this.lines,ie),1),!this.lines.length&&this.doc.cm){var ae=this.doc.cm.curOp;(ae.maybeHiddenMarkers||(ae.maybeHiddenMarkers=[])).push(this)}},Sn(Vt);function Zh(ie,ae,fe,ce,me){if(ce&&ce.shared)return Kg(ie,ae,fe,ce,me);if(ie.cm&&!ie.cm.curOp)return io(ie.cm,Zh)(ie,ae,fe,ce,me);var ke=new Vt(ie,me),Ge=jt(ae,fe);if(ce&&rn(ce,ke,!1),Ge>0||Ge==0&&ke.clearWhenEmpty!==!1)return ke;if(ke.replacedWith&&(ke.collapsed=!0,ke.widgetNode=dt("span",[ke.replacedWith],"CodeMirror-widget"),ce.handleMouseEvents||ke.widgetNode.setAttribute("cm-ignore-events","true"),ce.insertLeft&&(ke.widgetNode.insertLeft=!0)),ke.collapsed){if(vi(ie,ae.line,ae,fe,ke)||ae.line!=fe.line&&vi(ie,fe.line,ae,fe,ke))throw new Error("Inserting collapsed marker partially overlapping an existing one");In()}ke.addToHistory&&Rd(ie,{from:ae,to:fe,origin:"markText"},ie.sel,NaN);var Je=ae.line,Ye=ie.cm,yt;if(ie.iter(Je,fe.line+1,function(Ft){Ye&&ke.collapsed&&!Ye.options.lineWrapping&&ti(Ft)==Ye.display.maxLine&&(yt=!0),ke.collapsed&&Je!=ae.line&&Yn(Ft,0),Qo(Ft,new Er(ke,Je==ae.line?ae.ch:null,Je==fe.line?fe.ch:null)),++Je}),ke.collapsed&&ie.iter(ae.line,fe.line+1,function(Ft){Pn(ie,Ft)&&Yn(Ft,0)}),ke.clearOnEnter&&Tn(ke,"beforeCursorEnter",function(){return ke.clear()}),ke.readOnly&&(ca(),(ie.history.done.length||ie.history.undone.length)&&ie.clearHistory()),ke.collapsed&&(ke.id=++Vg,ke.atomic=!0),Ye){if(yt&&(Ye.curOp.updateMaxLine=!0),ke.collapsed)Ei(Ye,ae.line,fe.line+1);else if(ke.className||ke.startStyle||ke.endStyle||ke.css||ke.attributes||ke.title)for(var sn=ae.line;sn<=fe.line;sn++)bi(Ye,sn,"text");ke.atomic&&Bc(Ye.doc),$r(Ye,"markerAdded",Ye,ke)}return ke}var sh=function(ie,ae){this.markers=ie,this.primary=ae;for(var fe=0;fe<ie.length;++fe)ie[fe].parent=this};sh.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var ie=0;ie<this.markers.length;++ie)this.markers[ie].clear();$r(this,"clear")}},sh.prototype.find=function(ie,ae){return this.primary.find(ie,ae)},Sn(sh);function Kg(ie,ae,fe,ce,me){ce=rn(ce),ce.shared=!1;var ke=[Zh(ie,ae,fe,ce,me)],Ge=ke[0],Je=ce.widgetNode;return Gu(ie,function(Ye){Je&&(ce.widgetNode=Je.cloneNode(!0)),ke.push(Zh(Ye,Ii(Ye,ae),Ii(Ye,fe),ce,me));for(var yt=0;yt<Ye.linked.length;++yt)if(Ye.linked[yt].isParent)return;Ge=Nt(ke)}),new sh(ke,Ge)}function Ug(ie){return ie.findMarks(Qt(ie.first,0),ie.clipPos(Qt(ie.lastLine())),function(ae){return ae.parent})}function Yg(ie,ae){for(var fe=0;fe<ae.length;fe++){var ce=ae[fe],me=ce.find(),ke=ie.clipPos(me.from),Ge=ie.clipPos(me.to);if(jt(ke,Ge)){var Je=Zh(ie,ke,Ge,ce.primary,ce.primary.type);ce.markers.push(Je),Je.parent=ce}}}function Xg(ie){for(var ae=function(ce){var me=ie[ce],ke=[me.primary.doc];Gu(me.primary.doc,function(Ye){return ke.push(Ye)});for(var Ge=0;Ge<me.markers.length;Ge++){var Je=me.markers[Ge];dn(ke,Je.doc)==-1&&(Je.parent=null,me.markers.splice(Ge--,1))}},fe=0;fe<ie.length;fe++)ae(fe)}var kc=0,sl=function(ie,ae,fe,ce,me){if(!(this instanceof sl))return new sl(ie,ae,fe,ce,me);fe==null&&(fe=0),ws.call(this,[new Zd([new Vo("",null)])]),this.first=fe,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=fe;var ke=Qt(fe,0);this.sel=wh(ke),this.history=new Id(null),this.id=++kc,this.modeOption=ae,this.lineSep=ce,this.direction=me=="rtl"?"rtl":"ltr",this.extend=!1,typeof ie=="string"&&(ie=this.splitLines(ie)),wc(this,{from:ke,to:ke,text:ie}),gl(this,wh(ke),Wt)};sl.prototype=Me(ws.prototype,{constructor:sl,iter:function(ie,ae,fe){fe?this.iterN(ie-this.first,ae-ie,fe):this.iterN(this.first,this.first+this.size,ie)},insert:function(ie,ae){for(var fe=0,ce=0;ce<ae.length;++ce)fe+=ae[ce].height;this.insertInner(ie-this.first,ae,fe)},remove:function(ie,ae){this.removeInner(ie-this.first,ae)},getValue:function(ie){var ae=br(this,this.first,this.first+this.size);return ie===!1?ae:ae.join(ie||this.lineSeparator())},setValue:la(function(ie){var ae=Qt(this.first,0),fe=this.first+this.size-1;bh(this,{from:ae,to:Qt(fe,ni(this,fe).text.length),text:this.splitLines(ie),origin:"setValue",full:!0},!0),this.cm&&lu(this.cm,0,0),gl(this,wh(ae),Wt)}),replaceRange:function(ie,ae,fe,ce){ae=Ii(this,ae),fe=fe?Ii(this,fe):ae,ud(this,ie,ae,fe,ce)},getRange:function(ie,ae,fe){var ce=sr(this,Ii(this,ie),Ii(this,ae));return fe===!1?ce:ce.join(fe||this.lineSeparator())},getLine:function(ie){var ae=this.getLineHandle(ie);return ae&&ae.text},getLineHandle:function(ie){if(Kn(this,ie))return ni(this,ie)},getLineNumber:function(ie){return at(ie)},getLineHandleVisualStart:function(ie){return typeof ie=="number"&&(ie=ni(this,ie)),ti(ie)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(ie){return Ii(this,ie)},getCursor:function(ie){var ae=this.sel.primary(),fe;return ie==null||ie=="head"?fe=ae.head:ie=="anchor"?fe=ae.anchor:ie=="end"||ie=="to"||ie===!1?fe=ae.to():fe=ae.from(),fe},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:la(function(ie,ae,fe){Eh(this,Ii(this,typeof ie=="number"?Qt(ie,ae||0):ie),null,fe)}),setSelection:la(function(ie,ae,fe){Eh(this,Ii(this,ie),Ii(this,ae||ie),fe)}),extendSelection:la(function(ie,ae,fe){pf(this,Ii(this,ie),ae&&Ii(this,ae),fe)}),extendSelections:la(function(ie,ae){sd(this,xr(this,ie),ae)}),extendSelectionsBy:la(function(ie,ae){var fe=ii(this.sel.ranges,ie);sd(this,xr(this,fe),ae)}),setSelections:la(function(ie,ae,fe){if(ie.length){for(var ce=[],me=0;me<ie.length;me++)ce[me]=new os(Ii(this,ie[me].anchor),Ii(this,ie[me].head));ae==null&&(ae=Math.min(ie.length-1,this.sel.primIndex)),gl(this,Lu(this.cm,ce,ae),fe)}}),addSelection:la(function(ie,ae,fe){var ce=this.sel.ranges.slice(0);ce.push(new os(Ii(this,ie),Ii(this,ae||ie))),gl(this,Lu(this.cm,ce,ce.length-1),fe)}),getSelection:function(ie){for(var ae=this.sel.ranges,fe,ce=0;ce<ae.length;ce++){var me=sr(this,ae[ce].from(),ae[ce].to());fe=fe?fe.concat(me):me}return ie===!1?fe:fe.join(ie||this.lineSeparator())},getSelections:function(ie){for(var ae=[],fe=this.sel.ranges,ce=0;ce<fe.length;ce++){var me=sr(this,fe[ce].from(),fe[ce].to());ie!==!1&&(me=me.join(ie||this.lineSeparator())),ae[ce]=me}return ae},replaceSelection:function(ie,ae,fe){for(var ce=[],me=0;me<this.sel.ranges.length;me++)ce[me]=ie;this.replaceSelections(ce,ae,fe||"+input")},replaceSelections:la(function(ie,ae,fe){for(var ce=[],me=this.sel,ke=0;ke<me.ranges.length;ke++){var Ge=me.ranges[ke];ce[ke]={from:Ge.from(),to:Ge.to(),text:this.splitLines(ie[ke]),origin:fe}}for(var Je=ae&&ae!="end"&&Td(this,ce,ae),Ye=ce.length-1;Ye>=0;Ye--)bh(this,ce[Ye]);Je?Lc(this,Je):this.cm&&Ll(this.cm)}),undo:la(function(){Mc(this,"undo")}),redo:la(function(){Mc(this,"redo")}),undoSelection:la(function(){Mc(this,"undo",!0)}),redoSelection:la(function(){Mc(this,"redo",!0)}),setExtending:function(ie){this.extend=ie},getExtending:function(){return this.extend},historySize:function(){for(var ie=this.history,ae=0,fe=0,ce=0;ce<ie.done.length;ce++)ie.done[ce].ranges||++ae;for(var me=0;me<ie.undone.length;me++)ie.undone[me].ranges||++fe;return{undo:ae,redo:fe}},clearHistory:function(){var ie=this;this.history=new Id(this.history.maxGeneration),Gu(this,function(ae){return ae.history=ie.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(ie){return ie&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(ie){return this.history.generation==(ie||this.cleanGeneration)},getHistory:function(){return{done:Ph(this.history.done),undone:Ph(this.history.undone)}},setHistory:function(ie){var ae=this.history=new Id(this.history.maxGeneration);ae.done=Ph(ie.done.slice(0),null,!0),ae.undone=Ph(ie.undone.slice(0),null,!0)},setGutterMarker:la(function(ie,ae,fe){return hd(this,ie,"gutter",function(ce){var me=ce.gutterMarkers||(ce.gutterMarkers={});return me[ae]=fe,!fe&&Ae(me)&&(ce.gutterMarkers=null),!0})}),clearGutter:la(function(ie){var ae=this;this.iter(function(fe){fe.gutterMarkers&&fe.gutterMarkers[ie]&&hd(ae,fe,"gutter",function(){return fe.gutterMarkers[ie]=null,Ae(fe.gutterMarkers)&&(fe.gutterMarkers=null),!0})})}),lineInfo:function(ie){var ae;if(typeof ie=="number"){if(!Kn(this,ie)||(ae=ie,ie=ni(this,ie),!ie))return null}else if(ae=at(ie),ae==null)return null;return{line:ae,handle:ie,text:ie.text,gutterMarkers:ie.gutterMarkers,textClass:ie.textClass,bgClass:ie.bgClass,wrapClass:ie.wrapClass,widgets:ie.widgets}},addLineClass:la(function(ie,ae,fe){return hd(this,ie,ae=="gutter"?"gutter":"class",function(ce){var me=ae=="text"?"textClass":ae=="background"?"bgClass":ae=="gutter"?"gutterClass":"wrapClass";if(!ce[me])ce[me]=fe;else{if(_e(fe).test(ce[me]))return!1;ce[me]+=" "+fe}return!0})}),removeLineClass:la(function(ie,ae,fe){return hd(this,ie,ae=="gutter"?"gutter":"class",function(ce){var me=ae=="text"?"textClass":ae=="background"?"bgClass":ae=="gutter"?"gutterClass":"wrapClass",ke=ce[me];if(ke)if(fe==null)ce[me]=null;else{var Ge=ke.match(_e(fe));if(!Ge)return!1;var Je=Ge.index+Ge[0].length;ce[me]=ke.slice(0,Ge.index)+(!Ge.index||Je==ke.length?"":" ")+ke.slice(Je)||null}else return!1;return!0})}),addLineWidget:la(function(ie,ae,fe){return dd(this,ie,ae,fe)}),removeLineWidget:function(ie){ie.clear()},markText:function(ie,ae,fe){return Zh(this,Ii(this,ie),Ii(this,ae),fe,fe&&fe.type||"range")},setBookmark:function(ie,ae){var fe={replacedWith:ae&&(ae.nodeType==null?ae.widget:ae),insertLeft:ae&&ae.insertLeft,clearWhenEmpty:!1,shared:ae&&ae.shared,handleMouseEvents:ae&&ae.handleMouseEvents};return ie=Ii(this,ie),Zh(this,ie,ie,fe,"bookmark")},findMarksAt:function(ie){ie=Ii(this,ie);var ae=[],fe=ni(this,ie.line).markedSpans;if(fe)for(var ce=0;ce<fe.length;++ce){var me=fe[ce];(me.from==null||me.from<=ie.ch)&&(me.to==null||me.to>=ie.ch)&&ae.push(me.marker.parent||me.marker)}return ae},findMarks:function(ie,ae,fe){ie=Ii(this,ie),ae=Ii(this,ae);var ce=[],me=ie.line;return this.iter(ie.line,ae.line+1,function(ke){var Ge=ke.markedSpans;if(Ge)for(var Je=0;Je<Ge.length;Je++){var Ye=Ge[Je];!(Ye.to!=null&&me==ie.line&&ie.ch>=Ye.to||Ye.from==null&&me!=ie.line||Ye.from!=null&&me==ae.line&&Ye.from>=ae.ch)&&(!fe||fe(Ye.marker))&&ce.push(Ye.marker.parent||Ye.marker)}++me}),ce},getAllMarks:function(){var ie=[];return this.iter(function(ae){var fe=ae.markedSpans;if(fe)for(var ce=0;ce<fe.length;++ce)fe[ce].from!=null&&ie.push(fe[ce].marker)}),ie},posFromIndex:function(ie){var ae,fe=this.first,ce=this.lineSeparator().length;return this.iter(function(me){var ke=me.text.length+ce;if(ke>ie)return ae=ie,!0;ie-=ke,++fe}),Ii(this,Qt(fe,ae))},indexFromPos:function(ie){ie=Ii(this,ie);var ae=ie.ch;if(ie.line<this.first||ie.ch<0)return 0;var fe=this.lineSeparator().length;return this.iter(this.first,ie.line,function(ce){ae+=ce.text.length+fe}),ae},copy:function(ie){var ae=new sl(br(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return ae.scrollTop=this.scrollTop,ae.scrollLeft=this.scrollLeft,ae.sel=this.sel,ae.extend=!1,ie&&(ae.history.undoDepth=this.history.undoDepth,ae.setHistory(this.getHistory())),ae},linkedDoc:function(ie){ie||(ie={});var ae=this.first,fe=this.first+this.size;ie.from!=null&&ie.from>ae&&(ae=ie.from),ie.to!=null&&ie.to<fe&&(fe=ie.to);var ce=new sl(br(this,ae,fe),ie.mode||this.modeOption,ae,this.lineSep,this.direction);return ie.sharedHist&&(ce.history=this.history),(this.linked||(this.linked=[])).push({doc:ce,sharedHist:ie.sharedHist}),ce.linked=[{doc:this,isParent:!0,sharedHist:ie.sharedHist}],Yg(ce,Ug(this)),ce},unlinkDoc:function(ie){if(ie instanceof Ja&&(ie=ie.doc),this.linked)for(var ae=0;ae<this.linked.length;++ae){var fe=this.linked[ae];if(fe.doc==ie){this.linked.splice(ae,1),ie.unlinkDoc(this),Xg(Ug(this));break}}if(ie.history==this.history){var ce=[ie.id];Gu(ie,function(me){return ce.push(me.id)},!0),ie.history=new Id(null),ie.history.done=Ph(this.history.done,ce),ie.history.undone=Ph(this.history.undone,ce)}},iterLinkedDocs:function(ie){Gu(this,ie)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(ie){return this.lineSep?ie.split(this.lineSep):Cr(ie)},lineSeparator:function(){return this.lineSep||`
`},setDirection:la(function(ie){ie!="rtl"&&(ie="ltr"),ie!=this.direction&&(this.direction=ie,this.iter(function(ae){return ae.order=null}),this.cm&&zp(this.cm))})}),sl.prototype.eachLine=sl.prototype.iter;var cd=0;function Qf(ie){var ae=this;if(vf(ae),!(un(ae,ie)||nn(ae.display,ie))){di(ie),vt&&(cd=+new Date);var fe=Po(ae,ie,!0),ce=ie.dataTransfer.files;if(!(!fe||ae.isReadOnly()))if(ce&&ce.length&&window.FileReader&&window.File)for(var me=ce.length,ke=Array(me),Ge=0,Je=function(){++Ge==me&&io(ae,function(){fe=Ii(ae.doc,fe);var kn={from:fe,to:fe,text:ae.doc.splitLines(ke.filter(function(ir){return ir!=null}).join(ae.doc.lineSeparator())),origin:"paste"};bh(ae.doc,kn),Lc(ae.doc,wh(Ii(ae.doc,fe),Ii(ae.doc,Oh(kn))))})()},Ye=function(kn,ir){if(ae.options.allowDropFileTypes&&dn(ae.options.allowDropFileTypes,kn.type)==-1){Je();return}var hr=new FileReader;hr.onerror=function(){return Je()},hr.onload=function(){var Lr=hr.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Lr)){Je();return}ke[ir]=Lr,Je()},hr.readAsText(kn)},yt=0;yt<ce.length;yt++)Ye(ce[yt],yt);else{if(ae.state.draggingText&&ae.doc.sel.contains(fe)>-1){ae.state.draggingText(ie),setTimeout(function(){return ae.display.input.focus()},20);return}try{var sn=ie.dataTransfer.getData("Text");if(sn){var Ft;if(ae.state.draggingText&&!ae.state.draggingText.copy&&(Ft=ae.listSelections()),Wu(ae.doc,wh(fe,fe)),Ft)for(var jn=0;jn<Ft.length;++jn)ud(ae.doc,"",Ft[jn].anchor,Ft[jn].head,"drag");ae.replaceSelection(sn,"around","paste"),ae.display.input.focus()}}catch(kn){}}}}function Jg(ie,ae){if(vt&&(!ie.state.draggingText||+new Date-cd<100)){Hi(ae);return}if(!(un(ie,ae)||nn(ie.display,ae))&&(ae.dataTransfer.setData("Text",ie.getSelection()),ae.dataTransfer.effectAllowed="copyMove",ae.dataTransfer.setDragImage&&!Tt)){var fe=Ue("img",null,null,"position: fixed; left: 0; top: 0;");fe.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",We&&(fe.width=fe.height=1,ie.display.wrapper.appendChild(fe),fe._top=fe.offsetTop),ae.dataTransfer.setDragImage(fe,0,0),We&&fe.parentNode.removeChild(fe)}}function Qg(ie,ae){var fe=Po(ie,ae);if(fe){var ce=document.createDocumentFragment();er(ie,fe,ce),ie.display.dragCursor||(ie.display.dragCursor=Ue("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),ie.display.lineSpace.insertBefore(ie.display.dragCursor,ie.display.cursorDiv)),Qe(ie.display.dragCursor,ce)}}function vf(ie){ie.display.dragCursor&&(ie.display.lineSpace.removeChild(ie.display.dragCursor),ie.display.dragCursor=null)}function $f(ie){if(document.getElementsByClassName){for(var ae=document.getElementsByClassName("CodeMirror"),fe=[],ce=0;ce<ae.length;ce++){var me=ae[ce].CodeMirror;me&&fe.push(me)}fe.length&&fe[0].operation(function(){for(var ke=0;ke<fe.length;ke++)ie(fe[ke])})}}var qf=!1;function cu(){qf||(Gd(),qf=!0)}function Gd(){var ie;Tn(window,"resize",function(){ie==null&&(ie=setTimeout(function(){ie=null,$f(eg)},100))}),Tn(window,"blur",function(){return $f(Ls)})}function eg(ie){var ae=ie.display;ae.cachedCharWidth=ae.cachedTextHeight=ae.cachedPaddingH=null,ae.scrollbarsClipped=!1,ie.setSize()}for(var lh={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"},Ac=0;Ac<10;Ac++)lh[Ac+48]=lh[Ac+96]=String(Ac);for(var yf=65;yf<=90;yf++)lh[yf]=String.fromCharCode(yf);for(var Nc=1;Nc<=12;Nc++)lh[Nc+111]=lh[Nc+63235]="F"+Nc;var pl={};pl.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"},pl.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"},pl.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"},pl.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"]},pl.default=de?pl.macDefault:pl.pcDefault;function tg(ie){var ae=ie.split(/-(?!$)/);ie=ae[ae.length-1];for(var fe,ce,me,ke,Ge=0;Ge<ae.length-1;Ge++){var Je=ae[Ge];if(/^(cmd|meta|m)$/i.test(Je))ke=!0;else if(/^a(lt)?$/i.test(Je))fe=!0;else if(/^(c|ctrl|control)$/i.test(Je))ce=!0;else if(/^s(hift)?$/i.test(Je))me=!0;else throw new Error("Unrecognized modifier name: "+Je)}return fe&&(ie="Alt-"+ie),ce&&(ie="Ctrl-"+ie),ke&&(ie="Cmd-"+ie),me&&(ie="Shift-"+ie),ie}function xf(ie){var ae={};for(var fe in ie)if(ie.hasOwnProperty(fe)){var ce=ie[fe];if(/^(name|fallthrough|(de|at)tach)$/.test(fe))continue;if(ce=="..."){delete ie[fe];continue}for(var me=ii(fe.split(" "),tg),ke=0;ke<me.length;ke++){var Ge=void 0,Je=void 0;ke==me.length-1?(Je=me.join(" "),Ge=ce):(Je=me.slice(0,ke+1).join(" "),Ge="...");var Ye=ae[Je];if(!Ye)ae[Je]=Ge;else if(Ye!=Ge)throw new Error("Inconsistent bindings for "+Je)}delete ie[fe]}for(var yt in ae)ie[yt]=ae[yt];return ie}function jl(ie,ae,fe,ce){ae=Gh(ae);var me=ae.call?ae.call(ie,ce):ae[ie];if(me===!1)return"nothing";if(me==="...")return"multi";if(me!=null&&fe(me))return"handled";if(ae.fallthrough){if(Object.prototype.toString.call(ae.fallthrough)!="[object Array]")return jl(ie,ae.fallthrough,fe,ce);for(var ke=0;ke<ae.fallthrough.length;ke++){var Ge=jl(ie,ae.fallthrough[ke],fe,ce);if(Ge)return Ge}}}function fd(ie){var ae=typeof ie=="string"?ie:lh[ie.keyCode];return ae=="Ctrl"||ae=="Alt"||ae=="Shift"||ae=="Mod"}function Sf(ie,ae,fe){var ce=ie;return ae.altKey&&ce!="Alt"&&(ie="Alt-"+ie),(we?ae.metaKey:ae.ctrlKey)&&ce!="Ctrl"&&(ie="Ctrl-"+ie),(we?ae.ctrlKey:ae.metaKey)&&ce!="Mod"&&(ie="Cmd-"+ie),!fe&&ae.shiftKey&&ce!="Shift"&&(ie="Shift-"+ie),ie}function $g(ie,ae){if(We&&ie.keyCode==34&&ie.char)return!1;var fe=lh[ie.keyCode];return fe==null||ie.altGraphKey?!1:(ie.keyCode==3&&ie.code&&(fe=ie.code),Sf(fe,ie,ae))}function Gh(ie){return typeof ie=="string"?pl[ie]:ie}function $l(ie,ae){for(var fe=ie.doc.sel.ranges,ce=[],me=0;me<fe.length;me++){for(var ke=ae(fe[me]);ce.length&&jt(ke.from,Nt(ce).to)<=0;){var Ge=ce.pop();if(jt(Ge.from,ke.from)<0){ke.from=Ge.from;break}}ce.push(ke)}uo(ie,function(){for(var Je=ce.length-1;Je>=0;Je--)ud(ie.doc,"",ce[Je].from,ce[Je].to,"+delete");Ll(ie)})}function ng(ie,ae,fe){var ce=Xt(ie.text,ae+fe,fe);return ce<0||ce>ie.text.length?null:ce}function Ps(ie,ae,fe){var ce=ng(ie,ae.ch,fe);return ce==null?null:new Qt(ae.line,ce,fe<0?"after":"before")}function Dc(ie,ae,fe,ce,me){if(ie){ae.doc.direction=="rtl"&&(me=-me);var ke=wn(fe,ae.doc.direction);if(ke){var Ge=me<0?Nt(ke):ke[0],Je=me<0==(Ge.level==1),Ye=Je?"after":"before",yt;if(Ge.level>0||ae.doc.direction=="rtl"){var sn=ea(ae,fe);yt=me<0?fe.text.length-1:0;var Ft=La(ae,sn,yt).top;yt=yn(function(jn){return La(ae,sn,jn).top==Ft},me<0==(Ge.level==1)?Ge.from:Ge.to-1,yt),Ye=="before"&&(yt=ng(fe,yt,1))}else yt=me<0?Ge.to:Ge.from;return new Qt(ce,yt,Ye)}}return new Qt(ce,me<0?fe.text.length:0,me<0?"before":"after")}function wf(ie,ae,fe,ce){var me=wn(ae,ie.doc.direction);if(!me)return Ps(ae,fe,ce);fe.ch>=ae.text.length?(fe.ch=ae.text.length,fe.sticky="before"):fe.ch<=0&&(fe.ch=0,fe.sticky="after");var ke=Zt(me,fe.ch,fe.sticky),Ge=me[ke];if(ie.doc.direction=="ltr"&&Ge.level%2==0&&(ce>0?Ge.to>fe.ch:Ge.from<fe.ch))return Ps(ae,fe,ce);var Je=function(qr,Ao){return ng(ae,qr instanceof Qt?qr.ch:qr,Ao)},Ye,yt=function(qr){return ie.options.lineWrapping?(Ye=Ye||ea(ie,ae),Ut(ie,ae,Ye,qr)):{begin:0,end:ae.text.length}},sn=yt(fe.sticky=="before"?Je(fe,-1):fe.ch);if(ie.doc.direction=="rtl"||Ge.level==1){var Ft=Ge.level==1==ce<0,jn=Je(fe,Ft?1:-1);if(jn!=null&&(Ft?jn<=Ge.to&&jn<=sn.end:jn>=Ge.from&&jn>=sn.begin)){var kn=Ft?"before":"after";return new Qt(fe.line,jn,kn)}}var ir=function(qr,Ao,ho){for(var jo=function(Es,nl){return nl?new Qt(fe.line,Je(Es,1),"before"):new Qt(fe.line,Es,"after")};qr>=0&&qr<me.length;qr+=Ao){var xa=me[qr],co=Ao>0==(xa.level!=1),Ra=co?ho.begin:Je(ho.end,-1);if(xa.from<=Ra&&Ra<xa.to||(Ra=co?xa.from:Je(xa.to,-1),ho.begin<=Ra&&Ra<ho.end))return jo(Ra,co)}},hr=ir(ke+ce,ce,sn);if(hr)return hr;var Lr=ce>0?sn.end:Je(sn.begin,-1);return Lr!=null&&!(ce>0&&Lr==ae.text.length)&&(hr=ir(ce>0?0:me.length-1,ce,yt(Lr)),hr)?hr:null}var Wh={selectAll:zs,singleSelection:function(ie){return ie.setSelection(ie.getCursor("anchor"),ie.getCursor("head"),Wt)},killLine:function(ie){return $l(ie,function(ae){if(ae.empty()){var fe=ni(ie.doc,ae.head.line).text.length;return ae.head.ch==fe&&ae.head.line<ie.lastLine()?{from:ae.head,to:Qt(ae.head.line+1,0)}:{from:ae.head,to:Qt(ae.head.line,fe)}}else return{from:ae.from(),to:ae.to()}})},deleteLine:function(ie){return $l(ie,function(ae){return{from:Qt(ae.from().line,0),to:Ii(ie.doc,Qt(ae.to().line+1,0))}})},delLineLeft:function(ie){return $l(ie,function(ae){return{from:Qt(ae.from().line,0),to:ae.from()}})},delWrappedLineLeft:function(ie){return $l(ie,function(ae){var fe=ie.charCoords(ae.head,"div").top+5,ce=ie.coordsChar({left:0,top:fe},"div");return{from:ce,to:ae.from()}})},delWrappedLineRight:function(ie){return $l(ie,function(ae){var fe=ie.charCoords(ae.head,"div").top+5,ce=ie.coordsChar({left:ie.display.lineDiv.offsetWidth+100,top:fe},"div");return{from:ae.from(),to:ce}})},undo:function(ie){return ie.undo()},redo:function(ie){return ie.redo()},undoSelection:function(ie){return ie.undoSelection()},redoSelection:function(ie){return ie.redoSelection()},goDocStart:function(ie){return ie.extendSelection(Qt(ie.firstLine(),0))},goDocEnd:function(ie){return ie.extendSelection(Qt(ie.lastLine()))},goLineStart:function(ie){return ie.extendSelectionsBy(function(ae){return Wd(ie,ae.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(ie){return ie.extendSelectionsBy(function(ae){return ig(ie,ae.head)},{origin:"+move",bias:1})},goLineEnd:function(ie){return ie.extendSelectionsBy(function(ae){return Hh(ie,ae.head.line)},{origin:"+move",bias:-1})},goLineRight:function(ie){return ie.extendSelectionsBy(function(ae){var fe=ie.cursorCoords(ae.head,"div").top+5;return ie.coordsChar({left:ie.display.lineDiv.offsetWidth+100,top:fe},"div")},An)},goLineLeft:function(ie){return ie.extendSelectionsBy(function(ae){var fe=ie.cursorCoords(ae.head,"div").top+5;return ie.coordsChar({left:0,top:fe},"div")},An)},goLineLeftSmart:function(ie){return ie.extendSelectionsBy(function(ae){var fe=ie.cursorCoords(ae.head,"div").top+5,ce=ie.coordsChar({left:0,top:fe},"div");return ce.ch<ie.getLine(ce.line).search(/\S/)?ig(ie,ae.head):ce},An)},goLineUp:function(ie){return ie.moveV(-1,"line")},goLineDown:function(ie){return ie.moveV(1,"line")},goPageUp:function(ie){return ie.moveV(-1,"page")},goPageDown:function(ie){return ie.moveV(1,"page")},goCharLeft:function(ie){return ie.moveH(-1,"char")},goCharRight:function(ie){return ie.moveH(1,"char")},goColumnLeft:function(ie){return ie.moveH(-1,"column")},goColumnRight:function(ie){return ie.moveH(1,"column")},goWordLeft:function(ie){return ie.moveH(-1,"word")},goGroupRight:function(ie){return ie.moveH(1,"group")},goGroupLeft:function(ie){return ie.moveH(-1,"group")},goWordRight:function(ie){return ie.moveH(1,"word")},delCharBefore:function(ie){return ie.deleteH(-1,"codepoint")},delCharAfter:function(ie){return ie.deleteH(1,"char")},delWordBefore:function(ie){return ie.deleteH(-1,"word")},delWordAfter:function(ie){return ie.deleteH(1,"word")},delGroupBefore:function(ie){return ie.deleteH(-1,"group")},delGroupAfter:function(ie){return ie.deleteH(1,"group")},indentAuto:function(ie){return ie.indentSelection("smart")},indentMore:function(ie){return ie.indentSelection("add")},indentLess:function(ie){return ie.indentSelection("subtract")},insertTab:function(ie){return ie.replaceSelection(" ")},insertSoftTab:function(ie){for(var ae=[],fe=ie.listSelections(),ce=ie.options.tabSize,me=0;me<fe.length;me++){var ke=fe[me].from(),Ge=nt(ie.getLine(ke.line),ke.ch,ce);ae.push(Pt(ce-Ge%ce))}ie.replaceSelections(ae)},defaultTab:function(ie){ie.somethingSelected()?ie.indentSelection("add"):ie.execCommand("insertTab")},transposeChars:function(ie){return uo(ie,function(){for(var ae=ie.listSelections(),fe=[],ce=0;ce<ae.length;ce++)if(ae[ce].empty()){var me=ae[ce].head,ke=ni(ie.doc,me.line).text;if(ke){if(me.ch==ke.length&&(me=new Qt(me.line,me.ch-1)),me.ch>0)me=new Qt(me.line,me.ch+1),ie.replaceRange(ke.charAt(me.ch-1)+ke.charAt(me.ch-2),Qt(me.line,me.ch-2),me,"+transpose");else if(me.line>ie.doc.first){var Ge=ni(ie.doc,me.line-1).text;Ge&&(me=new Qt(me.line,1),ie.replaceRange(ke.charAt(0)+ie.doc.lineSeparator()+Ge.charAt(Ge.length-1),Qt(me.line-1,Ge.length-1),me,"+transpose"))}}fe.push(new os(me,me))}ie.setSelections(fe)})},newlineAndIndent:function(ie){return uo(ie,function(){for(var ae=ie.listSelections(),fe=ae.length-1;fe>=0;fe--)ie.replaceRange(ie.doc.lineSeparator(),ae[fe].anchor,ae[fe].head,"+input");ae=ie.listSelections();for(var ce=0;ce<ae.length;ce++)ie.indentLine(ae[ce].from().line,null,!0);Ll(ie)})},openLine:function(ie){return ie.replaceSelection(`
`,"start")},toggleOverwrite:function(ie){return ie.toggleOverwrite()}};function Wd(ie,ae){var fe=ni(ie.doc,ae),ce=ti(fe);return ce!=fe&&(ae=at(ce)),Dc(!0,ie,ce,ae,1)}function Hh(ie,ae){var fe=ni(ie.doc,ae),ce=ui(fe);return ce!=fe&&(ae=at(ce)),Dc(!0,ie,fe,ae,-1)}function ig(ie,ae){var fe=Wd(ie,ae.line),ce=ni(ie.doc,fe.line),me=wn(ce,ie.doc.direction);if(!me||me[0].level==0){var ke=Math.max(fe.ch,ce.text.search(/\S/)),Ge=ae.line==fe.line&&ae.ch<=ke&&ae.ch;return Qt(fe.line,Ge?0:ke,fe.sticky)}return fe}function Hd(ie,ae,fe){if(typeof ae=="string"&&(ae=Wh[ae],!ae))return!1;ie.display.input.ensurePolled();var ce=ie.display.shift,me=!1;try{ie.isReadOnly()&&(ie.state.suppressEdits=!0),fe&&(ie.display.shift=!1),me=ae(ie)!=Hn}finally{ie.display.shift=ce,ie.state.suppressEdits=!1}return me}function rg(ie,ae,fe){for(var ce=0;ce<ie.state.keyMaps.length;ce++){var me=jl(ae,ie.state.keyMaps[ce],fe,ie);if(me)return me}return ie.options.extraKeys&&jl(ae,ie.options.extraKeys,fe,ie)||jl(ae,ie.options.keyMap,fe,ie)}var uh=new rt;function gd(ie,ae,fe,ce){var me=ie.state.keySeq;if(me){if(fd(ae))return"handled";if(/\'$/.test(ae)?ie.state.keySeq=null:uh.set(50,function(){ie.state.keySeq==me&&(ie.state.keySeq=null,ie.display.input.reset())}),Pf(ie,me+" "+ae,fe,ce))return!0}return Pf(ie,ae,fe,ce)}function Pf(ie,ae,fe,ce){var me=rg(ie,ae,ce);return me=="multi"&&(ie.state.keySeq=ae),me=="handled"&&$r(ie,"keyHandled",ie,ae,fe),(me=="handled"||me=="multi")&&(di(fe),Go(ie)),!!me}function Ef(ie,ae){var fe=$g(ae,!0);return fe?ae.shiftKey&&!ie.state.keySeq?gd(ie,"Shift-"+fe,ae,function(ce){return Hd(ie,ce,!0)})||gd(ie,fe,ae,function(ce){if(typeof ce=="string"?/^go[A-Z]/.test(ce):ce.motion)return Hd(ie,ce)}):gd(ie,fe,ae,function(ce){return Hd(ie,ce)}):!1}function Tc(ie,ae,fe){return gd(ie,"'"+fe+"'",ae,function(ce){return Hd(ie,ce,!0)})}var pd=null;function og(ie){var ae=this;if(!(ie.target&&ie.target!=ae.display.input.getField())&&(ae.curOp.focus=St(),!un(ae,ie))){vt&&Oe<11&&ie.keyCode==27&&(ie.returnValue=!1);var fe=ie.keyCode;ae.display.shift=fe==16||ie.shiftKey;var ce=Ef(ae,ie);We&&(pd=ce?fe:null,!ce&&fe==88&&!mn&&(de?ie.metaKey:ie.ctrlKey)&&ae.replaceSelection("",null,"cut")),le&&!de&&!ce&&fe==46&&ie.shiftKey&&!ie.ctrlKey&&document.execCommand&&document.execCommand("cut"),fe==18&&!/\bCodeMirror-crosshair\b/.test(ae.display.lineDiv.className)&&ag(ae)}}function ag(ie){var ae=ie.display.lineDiv;Lt(ae,"CodeMirror-crosshair");function fe(ce){(ce.keyCode==18||!ce.altKey)&&(Ze(ae,"CodeMirror-crosshair"),tn(document,"keyup",fe),tn(document,"mouseover",fe))}Tn(document,"keyup",fe),Tn(document,"mouseover",fe)}function sg(ie){ie.keyCode==16&&(this.doc.sel.shift=!1),un(this,ie)}function Mu(ie){var ae=this;if(!(ie.target&&ie.target!=ae.display.input.getField())&&!(nn(ae.display,ie)||un(ae,ie)||ie.ctrlKey&&!ie.altKey||de&&ie.metaKey)){var fe=ie.keyCode,ce=ie.charCode;if(We&&fe==pd){pd=null,di(ie);return}if(!(We&&(!ie.which||ie.which<10)&&Ef(ae,ie))){var me=String.fromCharCode(ce==null?fe:ce);me!="\b"&&(Tc(ae,ie,me)||ae.display.input.onKeyPress(ie))}}}var qg=400,lg=function(ie,ae,fe){this.time=ie,this.pos=ae,this.button=fe};lg.prototype.compare=function(ie,ae,fe){return this.time+qg>ie&&jt(ae,this.pos)==0&&fe==this.button};var Vd,md;function ug(ie,ae){var fe=+new Date;return md&&md.compare(fe,ie,ae)?(Vd=md=null,"triple"):Vd&&Vd.compare(fe,ie,ae)?(md=new lg(fe,ie,ae),Vd=null,"double"):(Vd=new lg(fe,ie,ae),md=null,"single")}function Vu(ie){var ae=this,fe=ae.display;if(!(un(ae,ie)||fe.activeTouch&&fe.input.supportsTouch())){if(fe.input.ensurePolled(),fe.shift=ie.shiftKey,nn(fe,ie)){st||(fe.scroller.draggable=!1,setTimeout(function(){return fe.scroller.draggable=!0},100));return}if(!Ic(ae,ie)){var ce=Po(ae,ie),me=Gn(ie),ke=ce?ug(ce,me):"single";window.focus(),me==1&&ae.state.selectingText&&ae.state.selectingText(ie),!(ce&&Kd(ae,me,ce,ke,ie))&&(me==1?ce?ep(ae,ce,ke,ie):kr(ie)==fe.scroller&&di(ie):me==2?(ce&&pf(ae.doc,ce),setTimeout(function(){return fe.input.focus()},20)):me==3&&(Ce?ae.display.input.onContextMenu(ie):_a(ae)))}}}function Kd(ie,ae,fe,ce,me){var ke="Click";return ce=="double"?ke="Double"+ke:ce=="triple"&&(ke="Triple"+ke),ke=(ae==1?"Left":ae==2?"Middle":"Right")+ke,gd(ie,Sf(ke,me),me,function(Ge){if(typeof Ge=="string"&&(Ge=Wh[Ge]),!Ge)return!1;var Je=!1;try{ie.isReadOnly()&&(ie.state.suppressEdits=!0),Je=Ge(ie,fe)!=Hn}finally{ie.state.suppressEdits=!1}return Je})}function _c(ie,ae,fe){var ce=ie.getOption("configureMouse"),me=ce?ce(ie,ae,fe):{};if(me.unit==null){var ke=se?fe.shiftKey&&fe.metaKey:fe.altKey;me.unit=ke?"rectangle":ae=="single"?"char":ae=="double"?"word":"line"}return(me.extend==null||ie.doc.extend)&&(me.extend=ie.doc.extend||fe.shiftKey),me.addNew==null&&(me.addNew=de?fe.metaKey:fe.ctrlKey),me.moveOnDrag==null&&(me.moveOnDrag=!(de?fe.altKey:fe.ctrlKey)),me}function ep(ie,ae,fe,ce){vt?setTimeout(vn(ha,ie),0):ie.curOp.focus=St();var me=_c(ie,fe,ce),ke=ie.doc.sel,Ge;ie.options.dragDrop&&On&&!ie.isReadOnly()&&fe=="single"&&(Ge=ke.contains(ae))>-1&&(jt((Ge=ke.ranges[Ge]).from(),ae)<0||ae.xRel>0)&&(jt(Ge.to(),ae)>0||ae.xRel<0)?hg(ie,ce,ae,me):Zp(ie,ce,ae,me)}function hg(ie,ae,fe,ce){var me=ie.display,ke=!1,Ge=io(ie,function(yt){st&&(me.scroller.draggable=!1),ie.state.draggingText=!1,tn(me.wrapper.ownerDocument,"mouseup",Ge),tn(me.wrapper.ownerDocument,"mousemove",Je),tn(me.scroller,"dragstart",Ye),tn(me.scroller,"drop",Ge),ke||(di(yt),ce.addNew||pf(ie.doc,fe,null,null,ce.extend),st&&!Tt||vt&&Oe==9?setTimeout(function(){me.wrapper.ownerDocument.body.focus({preventScroll:!0}),me.input.focus()},20):me.input.focus())}),Je=function(yt){ke=ke||Math.abs(ae.clientX-yt.clientX)+Math.abs(ae.clientY-yt.clientY)>=10},Ye=function(){return ke=!0};st&&(me.scroller.draggable=!0),ie.state.draggingText=Ge,Ge.copy=!ce.moveOnDrag,me.scroller.dragDrop&&me.scroller.dragDrop(),Tn(me.wrapper.ownerDocument,"mouseup",Ge),Tn(me.wrapper.ownerDocument,"mousemove",Je),Tn(me.scroller,"dragstart",Ye),Tn(me.scroller,"drop",Ge),_a(ie),setTimeout(function(){return me.input.focus()},20)}function dg(ie,ae,fe){if(fe=="char")return new os(ae,ae);if(fe=="word")return ie.findWordAt(ae);if(fe=="line")return new os(Qt(ae.line,0),Ii(ie.doc,Qt(ae.line+1,0)));var ce=fe(ie,ae);return new os(ce.from,ce.to)}function Zp(ie,ae,fe,ce){var me=ie.display,ke=ie.doc;di(ae);var Ge,Je,Ye=ke.sel,yt=Ye.ranges;if(ce.addNew&&!ce.extend?(Je=ke.sel.contains(fe),Je>-1?Ge=yt[Je]:Ge=new os(fe,fe)):(Ge=ke.sel.primary(),Je=ke.sel.primIndex),ce.unit=="rectangle")ce.addNew||(Ge=new os(fe,fe)),fe=Po(ie,ae,!0,!0),Je=-1;else{var sn=dg(ie,fe,ce.unit);ce.extend?Ge=gf(Ge,sn.anchor,sn.head,ce.extend):Ge=sn}ce.addNew?Je==-1?(Je=yt.length,gl(ke,Lu(ie,yt.concat([Ge]),Je),{scroll:!1,origin:"*mouse"})):yt.length>1&&yt[Je].empty()&&ce.unit=="char"&&!ce.extend?(gl(ke,Lu(ie,yt.slice(0,Je).concat(yt.slice(Je+1)),0),{scroll:!1,origin:"*mouse"}),Ye=ke.sel):yu(ke,Je,Ge,En):(Je=0,gl(ke,new vu([Ge],0),En),Ye=ke.sel);var Ft=fe;function jn(ho){if(jt(Ft,ho)!=0)if(Ft=ho,ce.unit=="rectangle"){for(var jo=[],xa=ie.options.tabSize,co=nt(ni(ke,fe.line).text,fe.ch,xa),Ra=nt(ni(ke,ho.line).text,ho.ch,xa),Es=Math.min(co,Ra),nl=Math.max(co,Ra),Ms=Math.min(fe.line,ho.line),zl=Math.min(ie.lastLine(),Math.max(fe.line,ho.line));Ms<=zl;Ms++){var ml=ni(ke,Ms).text,Us=ci(ml,Es,xa);Es==nl?jo.push(new os(Qt(Ms,Us),Qt(Ms,Us))):ml.length>Us&&jo.push(new os(Qt(Ms,Us),Qt(Ms,ci(ml,nl,xa))))}jo.length||jo.push(new os(fe,fe)),gl(ke,Lu(ie,Ye.ranges.slice(0,Je).concat(jo),Je),{origin:"*mouse",scroll:!1}),ie.scrollIntoView(ho)}else{var eu=Ge,ll=dg(ie,ho,ce.unit),Ws=eu.anchor,Qa;jt(ll.anchor,Ws)>0?(Qa=ll.head,Ws=xi(eu.from(),ll.anchor)):(Qa=ll.anchor,Ws=Vi(eu.to(),ll.head));var Ds=Ye.ranges.slice(0);Ds[Je]=Ud(ie,new os(Ii(ke,Ws),Qa)),gl(ke,Lu(ie,Ds,Je),En)}}var kn=me.wrapper.getBoundingClientRect(),ir=0;function hr(ho){var jo=++ir,xa=Po(ie,ho,!0,ce.unit=="rectangle");if(xa)if(jt(xa,Ft)!=0){ie.curOp.focus=St(),jn(xa);var co=Eo(me,ke);(xa.line>=co.to||xa.line<co.from)&&setTimeout(io(ie,function(){ir==jo&&hr(ho)}),150)}else{var Ra=ho.clientY<kn.top?-20:ho.clientY>kn.bottom?20:0;Ra&&setTimeout(io(ie,function(){ir==jo&&(me.scroller.scrollTop+=Ra,hr(ho))}),50)}}function Lr(ho){ie.state.selectingText=!1,ir=1/0,ho&&(di(ho),me.input.focus()),tn(me.wrapper.ownerDocument,"mousemove",qr),tn(me.wrapper.ownerDocument,"mouseup",Ao),ke.history.lastSelOrigin=null}var qr=io(ie,function(ho){ho.buttons===0||!Gn(ho)?Lr(ho):hr(ho)}),Ao=io(ie,Lr);ie.state.selectingText=Ao,Tn(me.wrapper.ownerDocument,"mousemove",qr),Tn(me.wrapper.ownerDocument,"mouseup",Ao)}function Ud(ie,ae){var fe=ae.anchor,ce=ae.head,me=ni(ie.doc,fe.line);if(jt(fe,ce)==0&&fe.sticky==ce.sticky)return ae;var ke=wn(me);if(!ke)return ae;var Ge=Zt(ke,fe.ch,fe.sticky),Je=ke[Ge];if(Je.from!=fe.ch&&Je.to!=fe.ch)return ae;var Ye=Ge+(Je.from==fe.ch==(Je.level!=1)?0:1);if(Ye==0||Ye==ke.length)return ae;var yt;if(ce.line!=fe.line)yt=(ce.line-fe.line)*(ie.doc.direction=="ltr"?1:-1)>0;else{var sn=Zt(ke,ce.ch,ce.sticky),Ft=sn-Ge||(ce.ch-fe.ch)*(Je.level==1?-1:1);sn==Ye-1||sn==Ye?yt=Ft<0:yt=Ft>0}var jn=ke[Ye+(yt?-1:0)],kn=yt==(jn.level==1),ir=kn?jn.from:jn.to,hr=kn?"after":"before";return fe.ch==ir&&fe.sticky==hr?ae:new os(new Qt(fe.line,ir,hr),ce)}function Cf(ie,ae,fe,ce){var me,ke;if(ae.touches)me=ae.touches[0].clientX,ke=ae.touches[0].clientY;else try{me=ae.clientX,ke=ae.clientY}catch(jn){return!1}if(me>=Math.floor(ie.display.gutters.getBoundingClientRect().right))return!1;ce&&di(ae);var Ge=ie.display,Je=Ge.lineDiv.getBoundingClientRect();if(ke>Je.bottom||!on(ie,fe))return gi(ae);ke-=Je.top-Ge.viewOffset;for(var Ye=0;Ye<ie.display.gutterSpecs.length;++Ye){var yt=Ge.gutters.childNodes[Ye];if(yt&&yt.getBoundingClientRect().right>=me){var sn=Bt(ie.doc,ke),Ft=ie.display.gutterSpecs[Ye];return qt(ie,fe,ie,sn,Ft.className,ae),gi(ae)}}}function Ic(ie,ae){return Cf(ie,ae,"gutterClick",!0)}function bf(ie,ae){nn(ie.display,ae)||tp(ie,ae)||un(ie,ae,"contextmenu")||Ce||ie.display.input.onContextMenu(ae)}function tp(ie,ae){return on(ie,"gutterContextMenu")?Cf(ie,ae,"gutterContextMenu",!1):!1}function cg(ie){ie.display.wrapper.className=ie.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+ie.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ga(ie)}var Vh={toString:function(){return"CodeMirror.Init"}},Oc={},Rc={};function np(ie){var ae=ie.optionHandlers;function fe(ce,me,ke,Ge){ie.defaults[ce]=me,ke&&(ae[ce]=Ge?function(Je,Ye,yt){yt!=Vh&&ke(Je,Ye,yt)}:ke)}ie.defineOption=fe,ie.Init=Vh,fe("value","",function(ce,me){return ce.setValue(me)},!0),fe("mode",null,function(ce,me){ce.doc.modeOption=me,Aa(ce)},!0),fe("indentUnit",2,Aa,!0),fe("indentWithTabs",!1),fe("smartIndent",!0),fe("tabSize",4,function(ce){Sc(ce),Ga(ce),Ei(ce)},!0),fe("lineSeparator",null,function(ce,me){if(ce.doc.lineSep=me,!!me){var ke=[],Ge=ce.doc.first;ce.doc.iter(function(Ye){for(var yt=0;;){var sn=Ye.text.indexOf(me,yt);if(sn==-1)break;yt=sn+me.length,ke.push(Qt(Ge,sn))}Ge++});for(var Je=ke.length-1;Je>=0;Je--)ud(ce.doc,me,ke[Je],Qt(ke[Je].line,ke[Je].ch+me.length))}}),fe("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(ce,me,ke){ce.state.specialChars=new RegExp(me.source+(me.test(" ")?"":"| "),"g"),ke!=Vh&&ce.refresh()}),fe("specialCharPlaceholder",qo,function(ce){return ce.refresh()},!0),fe("electricChars",!0),fe("inputStyle",te?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),fe("spellcheck",!1,function(ce,me){return ce.getInputField().spellcheck=me},!0),fe("autocorrect",!1,function(ce,me){return ce.getInputField().autocorrect=me},!0),fe("autocapitalize",!1,function(ce,me){return ce.getInputField().autocapitalize=me},!0),fe("rtlMoveVisually",!ge),fe("wholeLineUpdateBefore",!0),fe("theme","default",function(ce){cg(ce),hu(ce)},!0),fe("keyMap","default",function(ce,me,ke){var Ge=Gh(me),Je=ke!=Vh&&Gh(ke);Je&&Je.detach&&Je.detach(ce,Ge),Ge.attach&&Ge.attach(ce,Je||null)}),fe("extraKeys",null),fe("configureMouse",null),fe("lineWrapping",!1,fg,!0),fe("gutters",[],function(ce,me){ce.display.gutterSpecs=ms(me,ce.options.lineNumbers),hu(ce)},!0),fe("fixedGutter",!0,function(ce,me){ce.display.gutters.style.left=me?Br(ce.display)+"px":"0",ce.refresh()},!0),fe("coverGutterNextToScrollbar",!1,function(ce){return Zs(ce)},!0),fe("scrollbarStyle","native",function(ce){mu(ce),Zs(ce),ce.display.scrollbars.setScrollTop(ce.doc.scrollTop),ce.display.scrollbars.setScrollLeft(ce.doc.scrollLeft)},!0),fe("lineNumbers",!1,function(ce,me){ce.display.gutterSpecs=ms(ce.options.gutters,me),hu(ce)},!0),fe("firstLineNumber",1,hu,!0),fe("lineNumberFormatter",function(ce){return ce},hu,!0),fe("showCursorWhenSelecting",!1,vr,!0),fe("resetSelectionOnContextMenu",!0),fe("lineWiseCopyCut",!0),fe("pasteLinesPerSelection",!0),fe("selectionsMayTouch",!1),fe("readOnly",!1,function(ce,me){me=="nocursor"&&(Ls(ce),ce.display.input.blur()),ce.display.input.readOnlyChanged(me)}),fe("screenReaderLabel",null,function(ce,me){me=me===""?null:me,ce.display.input.screenReaderLabelChanged(me)}),fe("disableInput",!1,function(ce,me){me||ce.display.input.reset()},!0),fe("dragDrop",!0,Ff),fe("allowDropFileTypes",null),fe("cursorBlinkRate",530),fe("cursorScrollMargin",0),fe("cursorHeight",1,vr,!0),fe("singleCursorHeightPerLine",!0,vr,!0),fe("workTime",100),fe("workDelay",100),fe("flattenSpans",!0,Sc,!0),fe("addModeClass",!1,Sc,!0),fe("pollInterval",100),fe("undoDepth",200,function(ce,me){return ce.doc.history.undoDepth=me}),fe("historyEventDelay",1250),fe("viewportMargin",10,function(ce){return ce.refresh()},!0),fe("maxHighlightLength",1e4,Sc,!0),fe("moveInputWithCursor",!0,function(ce,me){me||ce.display.input.resetPosition()}),fe("tabindex",null,function(ce,me){return ce.display.input.getField().tabIndex=me||""}),fe("autofocus",null),fe("direction","ltr",function(ce,me){return ce.doc.setDirection(me)},!0),fe("phrases",null)}function Ff(ie,ae,fe){var ce=fe&&fe!=Vh;if(!ae!=!ce){var me=ie.display.dragFunctions,ke=ae?Tn:tn;ke(ie.display.scroller,"dragstart",me.start),ke(ie.display.scroller,"dragenter",me.enter),ke(ie.display.scroller,"dragover",me.over),ke(ie.display.scroller,"dragleave",me.leave),ke(ie.display.scroller,"drop",me.drop)}}function fg(ie){ie.options.lineWrapping?(Lt(ie.display.wrapper,"CodeMirror-wrap"),ie.display.sizer.style.minWidth="",ie.display.sizerWidth=null):(Ze(ie.display.wrapper,"CodeMirror-wrap"),Wr(ie)),mr(ie),Ei(ie),Ga(ie),setTimeout(function(){return Zs(ie)},100)}function Ja(ie,ae){var fe=this;if(!(this instanceof Ja))return new Ja(ie,ae);this.options=ae=ae?rn(ae):{},rn(Oc,ae,!1);var ce=ae.value;typeof ce=="string"?ce=new sl(ce,ae.mode,null,ae.lineSeparator,ae.direction):ae.mode&&(ce.modeOption=ae.mode),this.doc=ce;var me=new Ja.inputStyles[ae.inputStyle](this),ke=this.display=new Sh(ie,ce,me,ae);ke.wrapper.CodeMirror=this,cg(this),ae.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),mu(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 rt,keySeq:null,specialChars:null},ae.autofocus&&!te&&ke.input.focus(),vt&&Oe<11&&setTimeout(function(){return fe.display.input.reset(!0)},20),vd(this),cu(),Ol(this),this.curOp.forceUpdate=!0,Pc(this,ce),ae.autofocus&&!te||this.hasFocus()?setTimeout(function(){fe.hasFocus()&&!fe.state.focused&&jr(fe)},20):Ls(this);for(var Ge in Rc)Rc.hasOwnProperty(Ge)&&Rc[Ge](this,ae[Ge],Vh);Ss(this),ae.finishInit&&ae.finishInit(this);for(var Je=0;Je<yd.length;++Je)yd[Je](this);Xl(this),st&&ae.lineWrapping&&getComputedStyle(ke.lineDiv).textRendering=="optimizelegibility"&&(ke.lineDiv.style.textRendering="auto")}Ja.defaults=Oc,Ja.optionHandlers=Rc;function vd(ie){var ae=ie.display;Tn(ae.scroller,"mousedown",io(ie,Vu)),vt&&Oe<11?Tn(ae.scroller,"dblclick",io(ie,function(Ye){if(!un(ie,Ye)){var yt=Po(ie,Ye);if(!(!yt||Ic(ie,Ye)||nn(ie.display,Ye))){di(Ye);var sn=ie.findWordAt(yt);pf(ie.doc,sn.anchor,sn.head)}}})):Tn(ae.scroller,"dblclick",function(Ye){return un(ie,Ye)||di(Ye)}),Tn(ae.scroller,"contextmenu",function(Ye){return bf(ie,Ye)}),Tn(ae.input.getField(),"contextmenu",function(Ye){ae.scroller.contains(Ye.target)||bf(ie,Ye)});var fe,ce={end:0};function me(){ae.activeTouch&&(fe=setTimeout(function(){return ae.activeTouch=null},1e3),ce=ae.activeTouch,ce.end=+new Date)}function ke(Ye){if(Ye.touches.length!=1)return!1;var yt=Ye.touches[0];return yt.radiusX<=1&&yt.radiusY<=1}function Ge(Ye,yt){if(yt.left==null)return!0;var sn=yt.left-Ye.left,Ft=yt.top-Ye.top;return sn*sn+Ft*Ft>20*20}Tn(ae.scroller,"touchstart",function(Ye){if(!un(ie,Ye)&&!ke(Ye)&&!Ic(ie,Ye)){ae.input.ensurePolled(),clearTimeout(fe);var yt=+new Date;ae.activeTouch={start:yt,moved:!1,prev:yt-ce.end<=300?ce:null},Ye.touches.length==1&&(ae.activeTouch.left=Ye.touches[0].pageX,ae.activeTouch.top=Ye.touches[0].pageY)}}),Tn(ae.scroller,"touchmove",function(){ae.activeTouch&&(ae.activeTouch.moved=!0)}),Tn(ae.scroller,"touchend",function(Ye){var yt=ae.activeTouch;if(yt&&!nn(ae,Ye)&&yt.left!=null&&!yt.moved&&new Date-yt.start<300){var sn=ie.coordsChar(ae.activeTouch,"page"),Ft;!yt.prev||Ge(yt,yt.prev)?Ft=new os(sn,sn):!yt.prev.prev||Ge(yt,yt.prev.prev)?Ft=ie.findWordAt(sn):Ft=new os(Qt(sn.line,0),Ii(ie.doc,Qt(sn.line+1,0))),ie.setSelection(Ft.anchor,Ft.head),ie.focus(),di(Ye)}me()}),Tn(ae.scroller,"touchcancel",me),Tn(ae.scroller,"scroll",function(){ae.scroller.clientHeight&&(fl(ie,ae.scroller.scrollTop),Bl(ie,ae.scroller.scrollLeft,!0),qt(ie,"scroll",ie))}),Tn(ae.scroller,"mousewheel",function(Ye){return tl(ie,Ye)}),Tn(ae.scroller,"DOMMouseScroll",function(Ye){return tl(ie,Ye)}),Tn(ae.wrapper,"scroll",function(){return ae.wrapper.scrollTop=ae.wrapper.scrollLeft=0}),ae.dragFunctions={enter:function(Ye){un(ie,Ye)||Hi(Ye)},over:function(Ye){un(ie,Ye)||(Qg(ie,Ye),Hi(Ye))},start:function(Ye){return Jg(ie,Ye)},drop:io(ie,Qf),leave:function(Ye){un(ie,Ye)||vf(ie)}};var Je=ae.input.getField();Tn(Je,"keyup",function(Ye){return sg.call(ie,Ye)}),Tn(Je,"keydown",io(ie,og)),Tn(Je,"keypress",io(ie,Mu)),Tn(Je,"focus",function(Ye){return jr(ie,Ye)}),Tn(Je,"blur",function(Ye){return Ls(ie,Ye)})}var yd=[];Ja.defineInitHook=function(ie){return yd.push(ie)};function Ys(ie,ae,fe,ce){var me=ie.doc,ke;fe==null&&(fe="add"),fe=="smart"&&(me.mode.indent?ke=xo(ie,ae).state:fe="prev");var Ge=ie.options.tabSize,Je=ni(me,ae),Ye=nt(Je.text,null,Ge);Je.stateAfter&&(Je.stateAfter=null);var yt=Je.text.match(/^\s*/)[0],sn;if(!ce&&!/\S/.test(Je.text))sn=0,fe="not";else if(fe=="smart"&&(sn=me.mode.indent(ke,Je.text.slice(yt.length),Je.text),sn==Hn||sn>150)){if(!ce)return;fe="prev"}fe=="prev"?ae>me.first?sn=nt(ni(me,ae-1).text,null,Ge):sn=0:fe=="add"?sn=Ye+ie.options.indentUnit:fe=="subtract"?sn=Ye-ie.options.indentUnit:typeof fe=="number"&&(sn=Ye+fe),sn=Math.max(0,sn);var Ft="",jn=0;if(ie.options.indentWithTabs)for(var kn=Math.floor(sn/Ge);kn;--kn)jn+=Ge,Ft+=" ";if(jn<sn&&(Ft+=Pt(sn-jn)),Ft!=yt)return ud(me,Ft,Qt(ae,0),Qt(ae,yt.length),"+input"),Je.stateAfter=null,!0;for(var ir=0;ir<me.sel.ranges.length;ir++){var hr=me.sel.ranges[ir];if(hr.head.line==ae&&hr.head.ch<yt.length){var Lr=Qt(ae,yt.length);yu(me,ir,new os(Lr,Lr));break}}}var ql=null;function Lh(ie){ql=ie}function jc(ie,ae,fe,ce,me){var ke=ie.doc;ie.display.shift=!1,ce||(ce=ke.sel);var Ge=+new Date-200,Je=me=="paste"||ie.state.pasteIncoming>Ge,Ye=Cr(ae),yt=null;if(Je&&ce.ranges.length>1)if(ql&&ql.text.join(`
`)==ae){if(ce.ranges.length%ql.text.length==0){yt=[];for(var sn=0;sn<ql.text.length;sn++)yt.push(ke.splitLines(ql.text[sn]))}}else Ye.length==ce.ranges.length&&ie.options.pasteLinesPerSelection&&(yt=ii(Ye,function(qr){return[qr]}));for(var Ft=ie.curOp.updateInput,jn=ce.ranges.length-1;jn>=0;jn--){var kn=ce.ranges[jn],ir=kn.from(),hr=kn.to();kn.empty()&&(fe&&fe>0?ir=Qt(ir.line,ir.ch-fe):ie.state.overwrite&&!Je?hr=Qt(hr.line,Math.min(ni(ke,hr.line).text.length,hr.ch+Nt(Ye).length)):Je&&ql&&ql.lineWise&&ql.text.join(`
`)==Ye.join(`
`)&&(ir=hr=Qt(ir.line,0)));var Lr={from:ir,to:hr,text:yt?yt[jn%yt.length]:Ye,origin:me||(Je?"paste":ie.state.cutIncoming>Ge?"cut":"+input")};bh(ie.doc,Lr),$r(ie,"inputRead",ie,Lr)}ae&&!Je&&pg(ie,ae),Ll(ie),ie.curOp.updateInput<2&&(ie.curOp.updateInput=Ft),ie.curOp.typing=!0,ie.state.pasteIncoming=ie.state.cutIncoming=-1}function gg(ie,ae){var fe=ie.clipboardData&&ie.clipboardData.getData("Text");if(fe)return ie.preventDefault(),!ae.isReadOnly()&&!ae.options.disableInput&&uo(ae,function(){return jc(ae,fe,0,null,"paste")}),!0}function pg(ie,ae){if(!(!ie.options.electricChars||!ie.options.smartIndent))for(var fe=ie.doc.sel,ce=fe.ranges.length-1;ce>=0;ce--){var me=fe.ranges[ce];if(!(me.head.ch>100||ce&&fe.ranges[ce-1].head.line==me.head.line)){var ke=ie.getModeAt(me.head),Ge=!1;if(ke.electricChars){for(var Je=0;Je<ke.electricChars.length;Je++)if(ae.indexOf(ke.electricChars.charAt(Je))>-1){Ge=Ys(ie,me.head.line,"smart");break}}else ke.electricInput&&ke.electricInput.test(ni(ie.doc,me.head.line).text.slice(0,me.head.ch))&&(Ge=Ys(ie,me.head.line,"smart"));Ge&&$r(ie,"electricInput",ie,me.head.line)}}}function mg(ie){for(var ae=[],fe=[],ce=0;ce<ie.doc.sel.ranges.length;ce++){var me=ie.doc.sel.ranges[ce].head.line,ke={anchor:Qt(me,0),head:Qt(me+1,0)};fe.push(ke),ae.push(ie.getRange(ke.anchor,ke.head))}return{text:ae,ranges:fe}}function vg(ie,ae,fe,ce){ie.setAttribute("autocorrect",fe?"":"off"),ie.setAttribute("autocapitalize",ce?"":"off"),ie.setAttribute("spellcheck",!!ae)}function yg(){var ie=Ue("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),ae=Ue("div",[ie],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return st?ie.style.width="1000px":ie.setAttribute("wrap","off"),De&&(ie.style.border="1px solid black"),vg(ie),ae}function Kh(ie){var ae=ie.optionHandlers,fe=ie.helpers={};ie.prototype={constructor:ie,focus:function(){window.focus(),this.display.input.focus()},setOption:function(ce,me){var ke=this.options,Ge=ke[ce];ke[ce]==me&&ce!="mode"||(ke[ce]=me,ae.hasOwnProperty(ce)&&io(this,ae[ce])(this,me,Ge),qt(this,"optionChange",this,ce))},getOption:function(ce){return this.options[ce]},getDoc:function(){return this.doc},addKeyMap:function(ce,me){this.state.keyMaps[me?"push":"unshift"](Gh(ce))},removeKeyMap:function(ce){for(var me=this.state.keyMaps,ke=0;ke<me.length;++ke)if(me[ke]==ce||me[ke].name==ce)return me.splice(ke,1),!0},addOverlay:rr(function(ce,me){var ke=ce.token?ce:ie.getMode(this.options,ce);if(ke.startState)throw new Error("Overlays may not be stateful.");Gi(this.state.overlays,{mode:ke,modeSpec:ce,opaque:me&&me.opaque,priority:me&&me.priority||0},function(Ge){return Ge.priority}),this.state.modeGen++,Ei(this)}),removeOverlay:rr(function(ce){for(var me=this.state.overlays,ke=0;ke<me.length;++ke){var Ge=me[ke].modeSpec;if(Ge==ce||typeof ce=="string"&&Ge.name==ce){me.splice(ke,1),this.state.modeGen++,Ei(this);return}}}),indentLine:rr(function(ce,me,ke){typeof me!="string"&&typeof me!="number"&&(me==null?me=this.options.smartIndent?"smart":"prev":me=me?"add":"subtract"),Kn(this.doc,ce)&&Ys(this,ce,me,ke)}),indentSelection:rr(function(ce){for(var me=this.doc.sel.ranges,ke=-1,Ge=0;Ge<me.length;Ge++){var Je=me[Ge];if(Je.empty())Je.head.line>ke&&(Ys(this,Je.head.line,ce,!0),ke=Je.head.line,Ge==this.doc.sel.primIndex&&Ll(this));else{var Ye=Je.from(),yt=Je.to(),sn=Math.max(ke,Ye.line);ke=Math.min(this.lastLine(),yt.line-(yt.ch?0:1))+1;for(var Ft=sn;Ft<ke;++Ft)Ys(this,Ft,ce);var jn=this.doc.sel.ranges;Ye.ch==0&&me.length==jn.length&&jn[Ge].from().ch>0&&yu(this.doc,Ge,new os(Ye,jn[Ge].to()),Wt)}}}),getTokenAt:function(ce,me){return po(this,ce,me)},getLineTokens:function(ce,me){return po(this,Qt(ce),me,!0)},getTokenTypeAt:function(ce){ce=Ii(this.doc,ce);var me=Vr(this,ni(this.doc,ce.line)),ke=0,Ge=(me.length-1)/2,Je=ce.ch,Ye;if(Je==0)Ye=me[2];else for(;;){var yt=ke+Ge>>1;if((yt?me[yt*2-1]:0)>=Je)Ge=yt;else if(me[yt*2+1]<Je)ke=yt+1;else{Ye=me[yt*2+2];break}}var sn=Ye?Ye.indexOf("overlay "):-1;return sn<0?Ye:sn==0?null:Ye.slice(0,sn-1)},getModeAt:function(ce){var me=this.doc.mode;return me.innerMode?ie.innerMode(me,this.getTokenAt(ce).state).mode:me},getHelper:function(ce,me){return this.getHelpers(ce,me)[0]},getHelpers:function(ce,me){var ke=[];if(!fe.hasOwnProperty(me))return ke;var Ge=fe[me],Je=this.getModeAt(ce);if(typeof Je[me]=="string")Ge[Je[me]]&&ke.push(Ge[Je[me]]);else if(Je[me])for(var Ye=0;Ye<Je[me].length;Ye++){var yt=Ge[Je[me][Ye]];yt&&ke.push(yt)}else Je.helperType&&Ge[Je.helperType]?ke.push(Ge[Je.helperType]):Ge[Je.name]&&ke.push(Ge[Je.name]);for(var sn=0;sn<Ge._global.length;sn++){var Ft=Ge._global[sn];Ft.pred(Je,this)&&dn(ke,Ft.val)==-1&&ke.push(Ft.val)}return ke},getStateAfter:function(ce,me){var ke=this.doc;return ce=Bi(ke,ce==null?ke.first+ke.size-1:ce),xo(this,ce+1,me).state},cursorCoords:function(ce,me){var ke,Ge=this.doc.sel.primary();return ce==null?ke=Ge.head:typeof ce=="object"?ke=Ii(this.doc,ce):ke=ce?Ge.from():Ge.to(),Uo(this,ke,me||"page")},charCoords:function(ce,me){return ra(this,Ii(this.doc,ce),me||"page")},coordsChar:function(ce,me){return ce=Ba(this,ce,me||"page"),Ua(this,ce.left,ce.top)},lineAtHeight:function(ce,me){return ce=Ba(this,{top:ce,left:0},me||"page").top,Bt(this.doc,ce+this.display.viewOffset)},heightAtLine:function(ce,me,ke){var Ge=!1,Je;if(typeof ce=="number"){var Ye=this.doc.first+this.doc.size-1;ce<this.doc.first?ce=this.doc.first:ce>Ye&&(ce=Ye,Ge=!0),Je=ni(this.doc,ce)}else Je=ce;return Ir(this,Je,{top:0,left:0},me||"page",ke||Ge).top+(Ge?this.doc.height-cr(Je):0)},defaultTextHeight:function(){return Qi(this.display)},defaultCharWidth:function(){return Jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(ce,me,ke,Ge,Je){var Ye=this.display;ce=Uo(this,Ii(this.doc,ce));var yt=ce.bottom,sn=ce.left;if(me.style.position="absolute",me.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(me),Ye.sizer.appendChild(me),Ge=="over")yt=ce.top;else if(Ge=="above"||Ge=="near"){var Ft=Math.max(Ye.wrapper.clientHeight,this.doc.height),jn=Math.max(Ye.sizer.clientWidth,Ye.lineSpace.clientWidth);(Ge=="above"||ce.bottom+me.offsetHeight>Ft)&&ce.top>me.offsetHeight?yt=ce.top-me.offsetHeight:ce.bottom+me.offsetHeight<=Ft&&(yt=ce.bottom),sn+me.offsetWidth>jn&&(sn=jn-me.offsetWidth)}me.style.top=yt+"px",me.style.left=me.style.right="",Je=="right"?(sn=Ye.sizer.clientWidth-me.offsetWidth,me.style.right="0px"):(Je=="left"?sn=0:Je=="middle"&&(sn=(Ye.sizer.clientWidth-me.offsetWidth)/2),me.style.left=sn+"px"),ke&&xs(this,{left:sn,top:yt,right:sn+me.offsetWidth,bottom:yt+me.offsetHeight})},triggerOnKeyDown:rr(og),triggerOnKeyPress:rr(Mu),triggerOnKeyUp:sg,triggerOnMouseDown:rr(Vu),execCommand:function(ce){if(Wh.hasOwnProperty(ce))return Wh[ce].call(null,this)},triggerElectric:rr(function(ce){pg(this,ce)}),findPosH:function(ce,me,ke,Ge){var Je=1;me<0&&(Je=-1,me=-me);for(var Ye=Ii(this.doc,ce),yt=0;yt<me&&(Ye=Yd(this.doc,Ye,Je,ke,Ge),!Ye.hitSide);++yt);return Ye},moveH:rr(function(ce,me){var ke=this;this.extendSelectionsBy(function(Ge){return ke.display.shift||ke.doc.extend||Ge.empty()?Yd(ke.doc,Ge.head,ce,me,ke.options.rtlMoveVisually):ce<0?Ge.from():Ge.to()},An)}),deleteH:rr(function(ce,me){var ke=this.doc.sel,Ge=this.doc;ke.somethingSelected()?Ge.replaceSelection("",null,"+delete"):$l(this,function(Je){var Ye=Yd(Ge,Je.head,ce,me,!1);return ce<0?{from:Ye,to:Je.head}:{from:Je.head,to:Ye}})}),findPosV:function(ce,me,ke,Ge){var Je=1,Ye=Ge;me<0&&(Je=-1,me=-me);for(var yt=Ii(this.doc,ce),sn=0;sn<me;++sn){var Ft=Uo(this,yt,"div");if(Ye==null?Ye=Ft.left:Ft.left=Ye,yt=Ku(this,Ft,Je,ke),yt.hitSide)break}return yt},moveV:rr(function(ce,me){var ke=this,Ge=this.doc,Je=[],Ye=!this.display.shift&&!Ge.extend&&Ge.sel.somethingSelected();if(Ge.extendSelectionsBy(function(sn){if(Ye)return ce<0?sn.from():sn.to();var Ft=Uo(ke,sn.head,"div");sn.goalColumn!=null&&(Ft.left=sn.goalColumn),Je.push(Ft.left);var jn=Ku(ke,Ft,ce,me);return me=="page"&&sn==Ge.sel.primary()&&zu(ke,ra(ke,jn,"div").top-Ft.top),jn},An),Je.length)for(var yt=0;yt<Ge.sel.ranges.length;yt++)Ge.sel.ranges[yt].goalColumn=Je[yt]}),findWordAt:function(ce){var me=this.doc,ke=ni(me,ce.line).text,Ge=ce.ch,Je=ce.ch;if(ke){var Ye=this.getHelper(ce,"wordChars");(ce.sticky=="before"||Je==ke.length)&&Ge?--Ge:++Je;for(var yt=ke.charAt(Ge),sn=He(yt,Ye)?function(Ft){return He(Ft,Ye)}:/\s/.test(yt)?function(Ft){return/\s/.test(Ft)}:function(Ft){return!/\s/.test(Ft)&&!He(Ft)};Ge>0&&sn(ke.charAt(Ge-1));)--Ge;for(;Je<ke.length&&sn(ke.charAt(Je));)++Je}return new os(Qt(ce.line,Ge),Qt(ce.line,Je))},toggleOverwrite:function(ce){ce!=null&&ce==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Lt(this.display.cursorDiv,"CodeMirror-overwrite"):Ze(this.display.cursorDiv,"CodeMirror-overwrite"),qt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==St()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:rr(function(ce,me){lu(this,ce,me)}),getScrollInfo:function(){var ce=this.display.scroller;return{left:ce.scrollLeft,top:ce.scrollTop,height:ce.scrollHeight-Si(this)-this.display.barHeight,width:ce.scrollWidth-Si(this)-this.display.barWidth,clientHeight:Pi(this),clientWidth:_i(this)}},scrollIntoView:rr(function(ce,me){ce==null?(ce={from:this.doc.sel.primary().head,to:null},me==null&&(me=this.options.cursorScrollMargin)):typeof ce=="number"?ce={from:Qt(ce,0),to:null}:ce.from==null&&(ce={from:ce,to:null}),ce.to||(ce.to=ce.from),ce.margin=me||0,ce.from.line!=null?ka(this,ce):al(this,ce.from,ce.to,ce.margin)}),setSize:rr(function(ce,me){var ke=this,Ge=function(Ye){return typeof Ye=="number"||/^\d+$/.test(String(Ye))?Ye+"px":Ye};ce!=null&&(this.display.wrapper.style.width=Ge(ce)),me!=null&&(this.display.wrapper.style.height=Ge(me)),this.options.lineWrapping&&Ta(this);var Je=this.display.viewFrom;this.doc.iter(Je,this.display.viewTo,function(Ye){if(Ye.widgets){for(var yt=0;yt<Ye.widgets.length;yt++)if(Ye.widgets[yt].noHScroll){bi(ke,Je,"widget");break}}++Je}),this.curOp.forceUpdate=!0,qt(this,"refresh",this)}),operation:function(ce){return uo(this,ce)},startOperation:function(){return Ol(this)},endOperation:function(){return Xl(this)},refresh:rr(function(){var ce=this.display.cachedTextHeight;Ei(this),this.curOp.forceUpdate=!0,Ga(this),lu(this,this.doc.scrollLeft,this.doc.scrollTop),Ns(this.display),(ce==null||Math.abs(ce-Qi(this.display))>.5||this.options.lineWrapping)&&mr(this),qt(this,"refresh",this)}),swapDoc:rr(function(ce){var me=this.doc;return me.cm=null,this.state.selectingText&&this.state.selectingText(),Pc(this,ce),Ga(this),this.display.input.reset(),lu(this,ce.scrollLeft,ce.scrollTop),this.curOp.forceScroll=!0,$r(this,"swapDoc",this,me),me}),phrase:function(ce){var me=this.options.phrases;return me&&Object.prototype.hasOwnProperty.call(me,ce)?me[ce]:ce},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}},Sn(ie),ie.registerHelper=function(ce,me,ke){fe.hasOwnProperty(ce)||(fe[ce]=ie[ce]={_global:[]}),fe[ce][me]=ke},ie.registerGlobalHelper=function(ce,me,ke,Ge){ie.registerHelper(ce,me,Ge),fe[ce]._global.push({pred:ke,val:Ge})}}function Yd(ie,ae,fe,ce,me){var ke=ae,Ge=fe,Je=ni(ie,ae.line),Ye=me&&ie.direction=="rtl"?-fe:fe;function yt(){var Ao=ae.line+Ye;return Ao<ie.first||Ao>=ie.first+ie.size?!1:(ae=new Qt(Ao,ae.ch,ae.sticky),Je=ni(ie,Ao))}function sn(Ao){var ho;if(ce=="codepoint"){var jo=Je.text.charCodeAt(ae.ch+(ce>0?0:-1));isNaN(jo)?ho=null:ho=new Qt(ae.line,Math.max(0,Math.min(Je.text.length,ae.ch+fe*(jo>=55296&&jo<56320?2:1))),-fe)}else me?ho=wf(ie.cm,Je,ae,fe):ho=Ps(Je,ae,fe);if(ho==null)if(!Ao&&yt())ae=Dc(me,ie.cm,Je,ae.line,Ye);else return!1;else ae=ho;return!0}if(ce=="char"||ce=="codepoint")sn();else if(ce=="column")sn(!0);else if(ce=="word"||ce=="group")for(var Ft=null,jn=ce=="group",kn=ie.cm&&ie.cm.getHelper(ae,"wordChars"),ir=!0;!(fe<0&&!sn(!ir));ir=!1){var hr=Je.text.charAt(ae.ch)||`
`,Lr=He(hr,kn)?"w":jn&&hr==`
`?"n":!jn||/\s/.test(hr)?null:"p";if(jn&&!ir&&!Lr&&(Lr="s"),Ft&&Ft!=Lr){fe<0&&(fe=1,sn(),ae.sticky="after");break}if(Lr&&(Ft=Lr),fe>0&&!sn(!ir))break}var qr=jd(ie,ae,ke,Ge,!0);return Un(ke,qr)&&(qr.hitSide=!0),qr}function Ku(ie,ae,fe,ce){var me=ie.doc,ke=ae.left,Ge;if(ce=="page"){var Je=Math.min(ie.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Ye=Math.max(Je-.5*Qi(ie.display),3);Ge=(fe>0?ae.bottom:ae.top)+fe*Ye}else ce=="line"&&(Ge=fe>0?ae.bottom+3:ae.top-3);for(var yt;yt=Ua(ie,ke,Ge),!!yt.outside;){if(fe<0?Ge<=0:Ge>=me.height){yt.hitSide=!0;break}Ge+=fe*5}return yt}var as=function(ie){this.cm=ie,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new rt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};as.prototype.init=function(ie){var ae=this,fe=this,ce=fe.cm,me=fe.div=ie.lineDiv;vg(me,ce.options.spellcheck,ce.options.autocorrect,ce.options.autocapitalize);function ke(Je){for(var Ye=Je.target;Ye;Ye=Ye.parentNode){if(Ye==me)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Ye.className))break}return!1}Tn(me,"paste",function(Je){!ke(Je)||un(ce,Je)||gg(Je,ce)||Oe<=11&&setTimeout(io(ce,function(){return ae.updateFromDOM()}),20)}),Tn(me,"compositionstart",function(Je){ae.composing={data:Je.data,done:!1}}),Tn(me,"compositionupdate",function(Je){ae.composing||(ae.composing={data:Je.data,done:!1})}),Tn(me,"compositionend",function(Je){ae.composing&&(Je.data!=ae.composing.data&&ae.readFromDOMSoon(),ae.composing.done=!0)}),Tn(me,"touchstart",function(){return fe.forceCompositionEnd()}),Tn(me,"input",function(){ae.composing||ae.readFromDOMSoon()});function Ge(Je){if(!(!ke(Je)||un(ce,Je))){if(ce.somethingSelected())Lh({lineWise:!1,text:ce.getSelections()}),Je.type=="cut"&&ce.replaceSelection("",null,"cut");else if(ce.options.lineWiseCopyCut){var Ye=mg(ce);Lh({lineWise:!0,text:Ye.text}),Je.type=="cut"&&ce.operation(function(){ce.setSelections(Ye.ranges,0,Wt),ce.replaceSelection("",null,"cut")})}else return;if(Je.clipboardData){Je.clipboardData.clearData();var yt=ql.text.join(`
`);if(Je.clipboardData.setData("Text",yt),Je.clipboardData.getData("Text")==yt){Je.preventDefault();return}}var sn=yg(),Ft=sn.firstChild;ce.display.lineSpace.insertBefore(sn,ce.display.lineSpace.firstChild),Ft.value=ql.text.join(`
`);var jn=document.activeElement;en(Ft),setTimeout(function(){ce.display.lineSpace.removeChild(sn),jn.focus(),jn==me&&fe.showPrimarySelection()},50)}}Tn(me,"copy",Ge),Tn(me,"cut",Ge)},as.prototype.screenReaderLabelChanged=function(ie){ie?this.div.setAttribute("aria-label",ie):this.div.removeAttribute("aria-label")},as.prototype.prepareSelection=function(){var ie=so(this.cm,!1);return ie.focus=document.activeElement==this.div,ie},as.prototype.showSelection=function(ie,ae){!ie||!this.cm.display.view.length||((ie.focus||ae)&&this.showPrimarySelection(),this.showMultipleSelections(ie))},as.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},as.prototype.showPrimarySelection=function(){var ie=this.getSelection(),ae=this.cm,fe=ae.doc.sel.primary(),ce=fe.from(),me=fe.to();if(ae.display.viewTo==ae.display.viewFrom||ce.line>=ae.display.viewTo||me.line<ae.display.viewFrom){ie.removeAllRanges();return}var ke=Zc(ae,ie.anchorNode,ie.anchorOffset),Ge=Zc(ae,ie.focusNode,ie.focusOffset);if(!(ke&&!ke.bad&&Ge&&!Ge.bad&&jt(xi(ke,Ge),ce)==0&&jt(Vi(ke,Ge),me)==0)){var Je=ae.display.view,Ye=ce.line>=ae.display.viewFrom&&Lf(ae,ce)||{node:Je[0].measure.map[2],offset:0},yt=me.line<ae.display.viewTo&&Lf(ae,me);if(!yt){var sn=Je[Je.length-1].measure,Ft=sn.maps?sn.maps[sn.maps.length-1]:sn.map;yt={node:Ft[Ft.length-1],offset:Ft[Ft.length-2]-Ft[Ft.length-3]}}if(!Ye||!yt){ie.removeAllRanges();return}var jn=ie.rangeCount&&ie.getRangeAt(0),kn;try{kn=$e(Ye.node,Ye.offset,yt.offset,yt.node)}catch(ir){}kn&&(!le&&ae.state.focused?(ie.collapse(Ye.node,Ye.offset),kn.collapsed||(ie.removeAllRanges(),ie.addRange(kn))):(ie.removeAllRanges(),ie.addRange(kn)),jn&&ie.anchorNode==null?ie.addRange(jn):le&&this.startGracePeriod()),this.rememberSelection()}},as.prototype.startGracePeriod=function(){var ie=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){ie.gracePeriod=!1,ie.selectionChanged()&&ie.cm.operation(function(){return ie.cm.curOp.selectionChanged=!0})},20)},as.prototype.showMultipleSelections=function(ie){Qe(this.cm.display.cursorDiv,ie.cursors),Qe(this.cm.display.selectionDiv,ie.selection)},as.prototype.rememberSelection=function(){var ie=this.getSelection();this.lastAnchorNode=ie.anchorNode,this.lastAnchorOffset=ie.anchorOffset,this.lastFocusNode=ie.focusNode,this.lastFocusOffset=ie.focusOffset},as.prototype.selectionInEditor=function(){var ie=this.getSelection();if(!ie.rangeCount)return!1;var ae=ie.getRangeAt(0).commonAncestorContainer;return wt(this.div,ae)},as.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},as.prototype.blur=function(){this.div.blur()},as.prototype.getField=function(){return this.div},as.prototype.supportsTouch=function(){return!0},as.prototype.receivedFocus=function(){var ie=this;this.selectionInEditor()?this.pollSelection():uo(this.cm,function(){return ie.cm.curOp.selectionChanged=!0});function ae(){ie.cm.state.focused&&(ie.pollSelection(),ie.polling.set(ie.cm.options.pollInterval,ae))}this.polling.set(this.cm.options.pollInterval,ae)},as.prototype.selectionChanged=function(){var ie=this.getSelection();return ie.anchorNode!=this.lastAnchorNode||ie.anchorOffset!=this.lastAnchorOffset||ie.focusNode!=this.lastFocusNode||ie.focusOffset!=this.lastFocusOffset},as.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var ie=this.getSelection(),ae=this.cm;if(ne&&ot&&this.cm.display.gutterSpecs.length&&zc(ie.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var fe=Zc(ae,ie.anchorNode,ie.anchorOffset),ce=Zc(ae,ie.focusNode,ie.focusOffset);fe&&ce&&uo(ae,function(){gl(ae.doc,wh(fe,ce),Wt),(fe.bad||ce.bad)&&(ae.curOp.selectionChanged=!0)})}}},as.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var ie=this.cm,ae=ie.display,fe=ie.doc.sel.primary(),ce=fe.from(),me=fe.to();if(ce.ch==0&&ce.line>ie.firstLine()&&(ce=Qt(ce.line-1,ni(ie.doc,ce.line-1).length)),me.ch==ni(ie.doc,me.line).text.length&&me.line<ie.lastLine()&&(me=Qt(me.line+1,0)),ce.line<ae.viewFrom||me.line>ae.viewTo-1)return!1;var ke,Ge,Je;ce.line==ae.viewFrom||(ke=Ki(ie,ce.line))==0?(Ge=at(ae.view[0].line),Je=ae.view[0].node):(Ge=at(ae.view[ke].line),Je=ae.view[ke-1].node.nextSibling);var Ye=Ki(ie,me.line),yt,sn;if(Ye==ae.view.length-1?(yt=ae.viewTo-1,sn=ae.lineDiv.lastChild):(yt=at(ae.view[Ye+1].line)-1,sn=ae.view[Ye+1].node.previousSibling),!Je)return!1;for(var Ft=ie.doc.splitLines(Xd(ie,Je,sn,Ge,yt)),jn=sr(ie.doc,Qt(Ge,0),Qt(yt,ni(ie.doc,yt).text.length));Ft.length>1&&jn.length>1;)if(Nt(Ft)==Nt(jn))Ft.pop(),jn.pop(),yt--;else if(Ft[0]==jn[0])Ft.shift(),jn.shift(),Ge++;else break;for(var kn=0,ir=0,hr=Ft[0],Lr=jn[0],qr=Math.min(hr.length,Lr.length);kn<qr&&hr.charCodeAt(kn)==Lr.charCodeAt(kn);)++kn;for(var Ao=Nt(Ft),ho=Nt(jn),jo=Math.min(Ao.length-(Ft.length==1?kn:0),ho.length-(jn.length==1?kn:0));ir<jo&&Ao.charCodeAt(Ao.length-ir-1)==ho.charCodeAt(ho.length-ir-1);)++ir;if(Ft.length==1&&jn.length==1&&Ge==ce.line)for(;kn&&kn>ce.ch&&Ao.charCodeAt(Ao.length-ir-1)==ho.charCodeAt(ho.length-ir-1);)kn--,ir++;Ft[Ft.length-1]=Ao.slice(0,Ao.length-ir).replace(/^\u200b+/,""),Ft[0]=Ft[0].slice(kn).replace(/\u200b+$/,"");var xa=Qt(Ge,kn),co=Qt(yt,jn.length?Nt(jn).length-ir:0);if(Ft.length>1||Ft[0]||jt(xa,co))return ud(ie.doc,Ft,xa,co,"+input"),!0},as.prototype.ensurePolled=function(){this.forceCompositionEnd()},as.prototype.reset=function(){this.forceCompositionEnd()},as.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},as.prototype.readFromDOMSoon=function(){var ie=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(ie.readDOMTimeout=null,ie.composing)if(ie.composing.done)ie.composing=null;else return;ie.updateFromDOM()},80))},as.prototype.updateFromDOM=function(){var ie=this;(this.cm.isReadOnly()||!this.pollContent())&&uo(this.cm,function(){return Ei(ie.cm)})},as.prototype.setUneditable=function(ie){ie.contentEditable="false"},as.prototype.onKeyPress=function(ie){ie.charCode==0||this.composing||(ie.preventDefault(),this.cm.isReadOnly()||io(this.cm,jc)(this.cm,String.fromCharCode(ie.charCode==null?ie.keyCode:ie.charCode),0))},as.prototype.readOnlyChanged=function(ie){this.div.contentEditable=String(ie!="nocursor")},as.prototype.onContextMenu=function(){},as.prototype.resetPosition=function(){},as.prototype.needsContentAttribute=!0;function Lf(ie,ae){var fe=yo(ie,ae.line);if(!fe||fe.hidden)return null;var ce=ni(ie.doc,ae.line),me=oi(fe,ce,ae.line),ke=wn(ce,ie.doc.direction),Ge="left";if(ke){var Je=Zt(ke,ae.ch);Ge=Je%2?"right":"left"}var Ye=bo(me.map,ae.ch,Ge);return Ye.offset=Ye.collapse=="right"?Ye.end:Ye.start,Ye}function zc(ie){for(var ae=ie;ae;ae=ae.parentNode)if(/CodeMirror-gutter-wrapper/.test(ae.className))return!0;return!1}function xd(ie,ae){return ae&&(ie.bad=!0),ie}function Xd(ie,ae,fe,ce,me){var ke="",Ge=!1,Je=ie.doc.lineSeparator(),Ye=!1;function yt(kn){return function(ir){return ir.id==kn}}function sn(){Ge&&(ke+=Je,Ye&&(ke+=Je),Ge=Ye=!1)}function Ft(kn){kn&&(sn(),ke+=kn)}function jn(kn){if(kn.nodeType==1){var ir=kn.getAttribute("cm-text");if(ir){Ft(ir);return}var hr=kn.getAttribute("cm-marker"),Lr;if(hr){var qr=ie.findMarks(Qt(ce,0),Qt(me+1,0),yt(+hr));qr.length&&(Lr=qr[0].find(0))&&Ft(sr(ie.doc,Lr.from,Lr.to).join(Je));return}if(kn.getAttribute("contenteditable")=="false")return;var Ao=/^(pre|div|p|li|table|br)$/i.test(kn.nodeName);if(!/^br$/i.test(kn.nodeName)&&kn.textContent.length==0)return;Ao&&sn();for(var ho=0;ho<kn.childNodes.length;ho++)jn(kn.childNodes[ho]);/^(pre|p)$/i.test(kn.nodeName)&&(Ye=!0),Ao&&(Ge=!0)}else kn.nodeType==3&&Ft(kn.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;jn(ae),ae!=fe;)ae=ae.nextSibling,Ye=!1;return ke}function Zc(ie,ae,fe){var ce;if(ae==ie.display.lineDiv){if(ce=ie.display.lineDiv.childNodes[fe],!ce)return xd(ie.clipPos(Qt(ie.display.viewTo-1)),!0);ae=null,fe=0}else for(ce=ae;;ce=ce.parentNode){if(!ce||ce==ie.display.lineDiv)return null;if(ce.parentNode&&ce.parentNode==ie.display.lineDiv)break}for(var me=0;me<ie.display.view.length;me++){var ke=ie.display.view[me];if(ke.node==ce)return ip(ke,ae,fe)}}function ip(ie,ae,fe){var ce=ie.text.firstChild,me=!1;if(!ae||!wt(ce,ae))return xd(Qt(at(ie.line),0),!0);if(ae==ce&&(me=!0,ae=ce.childNodes[fe],fe=0,!ae)){var ke=ie.rest?Nt(ie.rest):ie.line;return xd(Qt(at(ke),ke.text.length),me)}var Ge=ae.nodeType==3?ae:null,Je=ae;for(!Ge&&ae.childNodes.length==1&&ae.firstChild.nodeType==3&&(Ge=ae.firstChild,fe&&(fe=Ge.nodeValue.length));Je.parentNode!=ce;)Je=Je.parentNode;var Ye=ie.measure,yt=Ye.maps;function sn(Lr,qr,Ao){for(var ho=-1;ho<(yt?yt.length:0);ho++)for(var jo=ho<0?Ye.map:yt[ho],xa=0;xa<jo.length;xa+=3){var co=jo[xa+2];if(co==Lr||co==qr){var Ra=at(ho<0?ie.line:ie.rest[ho]),Es=jo[xa]+Ao;return(Ao<0||co!=Lr)&&(Es=jo[xa+(Ao?1:0)]),Qt(Ra,Es)}}}var Ft=sn(Ge,Je,fe);if(Ft)return xd(Ft,me);for(var jn=Je.nextSibling,kn=Ge?Ge.nodeValue.length-fe:0;jn;jn=jn.nextSibling){if(Ft=sn(jn,jn.firstChild,0),Ft)return xd(Qt(Ft.line,Ft.ch-kn),me);kn+=jn.textContent.length}for(var ir=Je.previousSibling,hr=fe;ir;ir=ir.previousSibling){if(Ft=sn(ir,ir.firstChild,-1),Ft)return xd(Qt(Ft.line,Ft.ch+hr),me);hr+=ir.textContent.length}}var Xs=function(ie){this.cm=ie,this.prevInput="",this.pollingFast=!1,this.polling=new rt,this.hasSelection=!1,this.composing=null};Xs.prototype.init=function(ie){var ae=this,fe=this,ce=this.cm;this.createField(ie);var me=this.textarea;ie.wrapper.insertBefore(this.wrapper,ie.wrapper.firstChild),De&&(me.style.width="0px"),Tn(me,"input",function(){vt&&Oe>=9&&ae.hasSelection&&(ae.hasSelection=null),fe.poll()}),Tn(me,"paste",function(Ge){un(ce,Ge)||gg(Ge,ce)||(ce.state.pasteIncoming=+new Date,fe.fastPoll())});function ke(Ge){if(!un(ce,Ge)){if(ce.somethingSelected())Lh({lineWise:!1,text:ce.getSelections()});else if(ce.options.lineWiseCopyCut){var Je=mg(ce);Lh({lineWise:!0,text:Je.text}),Ge.type=="cut"?ce.setSelections(Je.ranges,null,Wt):(fe.prevInput="",me.value=Je.text.join(`
`),en(me))}else return;Ge.type=="cut"&&(ce.state.cutIncoming=+new Date)}}Tn(me,"cut",ke),Tn(me,"copy",ke),Tn(ie.scroller,"paste",function(Ge){if(!(nn(ie,Ge)||un(ce,Ge))){if(!me.dispatchEvent){ce.state.pasteIncoming=+new Date,fe.focus();return}var Je=new Event("paste");Je.clipboardData=Ge.clipboardData,me.dispatchEvent(Je)}}),Tn(ie.lineSpace,"selectstart",function(Ge){nn(ie,Ge)||di(Ge)}),Tn(me,"compositionstart",function(){var Ge=ce.getCursor("from");fe.composing&&fe.composing.range.clear(),fe.composing={start:Ge,range:ce.markText(Ge,ce.getCursor("to"),{className:"CodeMirror-composing"})}}),Tn(me,"compositionend",function(){fe.composing&&(fe.poll(),fe.composing.range.clear(),fe.composing=null)})},Xs.prototype.createField=function(ie){this.wrapper=yg(),this.textarea=this.wrapper.firstChild},Xs.prototype.screenReaderLabelChanged=function(ie){ie?this.textarea.setAttribute("aria-label",ie):this.textarea.removeAttribute("aria-label")},Xs.prototype.prepareSelection=function(){var ie=this.cm,ae=ie.display,fe=ie.doc,ce=so(ie);if(ie.options.moveInputWithCursor){var me=Uo(ie,fe.sel.primary().head,"div"),ke=ae.wrapper.getBoundingClientRect(),Ge=ae.lineDiv.getBoundingClientRect();ce.teTop=Math.max(0,Math.min(ae.wrapper.clientHeight-10,me.top+Ge.top-ke.top)),ce.teLeft=Math.max(0,Math.min(ae.wrapper.clientWidth-10,me.left+Ge.left-ke.left))}return ce},Xs.prototype.showSelection=function(ie){var ae=this.cm,fe=ae.display;Qe(fe.cursorDiv,ie.cursors),Qe(fe.selectionDiv,ie.selection),ie.teTop!=null&&(this.wrapper.style.top=ie.teTop+"px",this.wrapper.style.left=ie.teLeft+"px")},Xs.prototype.reset=function(ie){if(!(this.contextMenuPending||this.composing)){var ae=this.cm;if(ae.somethingSelected()){this.prevInput="";var fe=ae.getSelection();this.textarea.value=fe,ae.state.focused&&en(this.textarea),vt&&Oe>=9&&(this.hasSelection=fe)}else ie||(this.prevInput=this.textarea.value="",vt&&Oe>=9&&(this.hasSelection=null))}},Xs.prototype.getField=function(){return this.textarea},Xs.prototype.supportsTouch=function(){return!1},Xs.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!te||St()!=this.textarea))try{this.textarea.focus()}catch(ie){}},Xs.prototype.blur=function(){this.textarea.blur()},Xs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Xs.prototype.receivedFocus=function(){this.slowPoll()},Xs.prototype.slowPoll=function(){var ie=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){ie.poll(),ie.cm.state.focused&&ie.slowPoll()})},Xs.prototype.fastPoll=function(){var ie=!1,ae=this;ae.pollingFast=!0;function fe(){var ce=ae.poll();!ce&&!ie?(ie=!0,ae.polling.set(60,fe)):(ae.pollingFast=!1,ae.slowPoll())}ae.polling.set(20,fe)},Xs.prototype.poll=function(){var ie=this,ae=this.cm,fe=this.textarea,ce=this.prevInput;if(this.contextMenuPending||!ae.state.focused||be(fe)&&!ce&&!this.composing||ae.isReadOnly()||ae.options.disableInput||ae.state.keySeq)return!1;var me=fe.value;if(me==ce&&!ae.somethingSelected())return!1;if(vt&&Oe>=9&&this.hasSelection===me||de&&/[\uf700-\uf7ff]/.test(me))return ae.display.input.reset(),!1;if(ae.doc.sel==ae.display.selForContextMenu){var ke=me.charCodeAt(0);if(ke==8203&&!ce&&(ce="\u200B"),ke==8666)return this.reset(),this.cm.execCommand("undo")}for(var Ge=0,Je=Math.min(ce.length,me.length);Ge<Je&&ce.charCodeAt(Ge)==me.charCodeAt(Ge);)++Ge;return uo(ae,function(){jc(ae,me.slice(Ge),ce.length-Ge,null,ie.composing?"*compose":null),me.length>1e3||me.indexOf(`
`)>-1?fe.value=ie.prevInput="":ie.prevInput=me,ie.composing&&(ie.composing.range.clear(),ie.composing.range=ae.markText(ie.composing.start,ae.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Xs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Xs.prototype.onKeyPress=function(){vt&&Oe>=9&&(this.hasSelection=null),this.fastPoll()},Xs.prototype.onContextMenu=function(ie){var ae=this,fe=ae.cm,ce=fe.display,me=ae.textarea;ae.contextMenuPending&&ae.contextMenuPending();var ke=Po(fe,ie),Ge=ce.scroller.scrollTop;if(!ke||We)return;var Je=fe.options.resetSelectionOnContextMenu;Je&&fe.doc.sel.contains(ke)==-1&&io(fe,gl)(fe.doc,wh(ke),Wt);var Ye=me.style.cssText,yt=ae.wrapper.style.cssText,sn=ae.wrapper.offsetParent.getBoundingClientRect();ae.wrapper.style.cssText="position: static",me.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(ie.clientY-sn.top-5)+"px; left: "+(ie.clientX-sn.left-5)+`px;
z-index: 1000; background: `+(vt?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ft;st&&(Ft=window.scrollY),ce.input.focus(),st&&window.scrollTo(null,Ft),ce.input.reset(),fe.somethingSelected()||(me.value=ae.prevInput=" "),ae.contextMenuPending=kn,ce.selForContextMenu=fe.doc.sel,clearTimeout(ce.detectingSelectAll);function jn(){if(me.selectionStart!=null){var hr=fe.somethingSelected(),Lr="\u200B"+(hr?me.value:"");me.value="\u21DA",me.value=Lr,ae.prevInput=hr?"":"\u200B",me.selectionStart=1,me.selectionEnd=Lr.length,ce.selForContextMenu=fe.doc.sel}}function kn(){if(ae.contextMenuPending==kn&&(ae.contextMenuPending=!1,ae.wrapper.style.cssText=yt,me.style.cssText=Ye,vt&&Oe<9&&ce.scrollbars.setScrollTop(ce.scroller.scrollTop=Ge),me.selectionStart!=null)){(!vt||vt&&Oe<9)&&jn();var hr=0,Lr=function(){ce.selForContextMenu==fe.doc.sel&&me.selectionStart==0&&me.selectionEnd>0&&ae.prevInput=="\u200B"?io(fe,zs)(fe):hr++<10?ce.detectingSelectAll=setTimeout(Lr,500):(ce.selForContextMenu=null,ce.input.reset())};ce.detectingSelectAll=setTimeout(Lr,200)}}if(vt&&Oe>=9&&jn(),Ce){Hi(ie);var ir=function(){tn(window,"mouseup",ir),setTimeout(kn,20)};Tn(window,"mouseup",ir)}else setTimeout(kn,50)},Xs.prototype.readOnlyChanged=function(ie){ie||this.reset(),this.textarea.disabled=ie=="nocursor",this.textarea.readOnly=!!ie},Xs.prototype.setUneditable=function(){},Xs.prototype.needsContentAttribute=!1;function Bf(ie,ae){if(ae=ae?rn(ae):{},ae.value=ie.value,!ae.tabindex&&ie.tabIndex&&(ae.tabindex=ie.tabIndex),!ae.placeholder&&ie.placeholder&&(ae.placeholder=ie.placeholder),ae.autofocus==null){var fe=St();ae.autofocus=fe==ie||ie.getAttribute("autofocus")!=null&&fe==document.body}function ce(){ie.value=Je.getValue()}var me;if(ie.form&&(Tn(ie.form,"submit",ce),!ae.leaveSubmitMethodAlone)){var ke=ie.form;me=ke.submit;try{var Ge=ke.submit=function(){ce(),ke.submit=me,ke.submit(),ke.submit=Ge}}catch(Ye){}}ae.finishInit=function(Ye){Ye.save=ce,Ye.getTextArea=function(){return ie},Ye.toTextArea=function(){Ye.toTextArea=isNaN,ce(),ie.parentNode.removeChild(Ye.getWrapperElement()),ie.style.display="",ie.form&&(tn(ie.form,"submit",ce),!ae.leaveSubmitMethodAlone&&typeof ie.form.submit=="function"&&(ie.form.submit=me))}},ie.style.display="none";var Je=Ja(function(Ye){return ie.parentNode.insertBefore(Ye,ie.nextSibling)},ae);return Je}function Sd(ie){ie.off=tn,ie.on=Tn,ie.wheelEventPixels=du,ie.Doc=sl,ie.splitLines=Cr,ie.countColumn=nt,ie.findColumn=ci,ie.isWordChar=Te,ie.Pass=Hn,ie.signal=qt,ie.Line=Vo,ie.changeEnd=Oh,ie.scrollbarModel=Il,ie.Pos=Qt,ie.cmpPos=jt,ie.modes=si,ie.mimeModes=Di,ie.resolveMode=zt,ie.getMode=Mt,ie.modeExtensions=_t,ie.extendMode=fn,ie.copyState=Ji,ie.startState=$i,ie.innerMode=mi,ie.commands=Wh,ie.keyMap=pl,ie.keyName=$g,ie.isModifierKey=fd,ie.lookupKey=jl,ie.normalizeKeyMap=xf,ie.StringStream=xn,ie.SharedTextMarker=sh,ie.TextMarker=Vt,ie.LineWidget=Fh,ie.e_preventDefault=di,ie.e_stopPropagation=Ui,ie.e_stop=Hi,ie.addClass=Lt,ie.contains=wt,ie.rmClass=Ze,ie.keyNames=lh}np(Ja),Kh(Ja);var Uu="iter insert remove copy getEditor constructor".split(" ");for(var wd in sl.prototype)sl.prototype.hasOwnProperty(wd)&&dn(Uu,wd)<0&&(Ja.prototype[wd]=function(ie){return function(){return ie.apply(this.doc,arguments)}}(sl.prototype[wd]));return Sn(sl),Ja.inputStyles={textarea:Xs,contenteditable:as},Ja.defineMode=function(ie){!Ja.defaults.mode&&ie!="null"&&(Ja.defaults.mode=ie),Ni.apply(this,arguments)},Ja.defineMIME=yr,Ja.defineMode("null",function(){return{token:function(ie){return ie.skipToEnd()}}}),Ja.defineMIME("text/plain","null"),Ja.defineExtension=function(ie,ae){Ja.prototype[ie]=ae},Ja.defineDocExtension=function(ie,ae){sl.prototype[ie]=ae},Ja.fromTextArea=Bf,Sd(Ja),Ja.version="5.58.2",Ja})},25419:function(Zn,ei,Le){(function(le){le(Le(89780),Le(15525),Le(98101))})(function(le){"use strict";le.defineMode("markdown",function(Ke,it){var bt=le.getMode(Ke,"text/html"),vt=bt.name=="null";function Oe(nt){if(le.findModeByName){var rt=le.findModeByName(nt);rt&&(nt=rt.mime||rt.mimes[0])}var dn=le.getMode(Ke,nt);return dn.name=="null"?null:dn}it.highlightFormatting===void 0&&(it.highlightFormatting=!1),it.maxBlockquoteDepth===void 0&&(it.maxBlockquoteDepth=0),it.taskLists===void 0&&(it.taskLists=!1),it.strikethrough===void 0&&(it.strikethrough=!1),it.emoji===void 0&&(it.emoji=!1),it.fencedCodeBlockHighlighting===void 0&&(it.fencedCodeBlockHighlighting=!0),it.fencedCodeBlockDefaultMode===void 0&&(it.fencedCodeBlockDefaultMode="text/plain"),it.xml===void 0&&(it.xml=!0),it.tokenTypeOverrides===void 0&&(it.tokenTypeOverrides={});var st={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 Et in st)st.hasOwnProperty(Et)&&it.tokenTypeOverrides[Et]&&(st[Et]=it.tokenTypeOverrides[Et]);var ot=/^([*\-_])(?:\s*\1){2,}\s*$/,We=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,Tt=/^\[(x| )\](?=\s)/i,ct=it.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,At=/^ {0,3}(?:\={1,}|-{2,})\s*$/,De=/^[^#!\[\]*_\\<>` "'(~:]+/,ne=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,te=/^\s*\[[^\]]+?\]:.*$/,de=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,se=" ";function ge(nt,rt,dn){return rt.f=rt.inline=dn,dn(nt,rt)}function ye(nt,rt,dn){return rt.f=rt.block=dn,dn(nt,rt)}function we(nt){return!nt||!/\S/.test(nt.string)}function Ce(nt){if(nt.linkTitle=!1,nt.linkHref=!1,nt.linkText=!1,nt.em=!1,nt.strong=!1,nt.strikethrough=!1,nt.quote=0,nt.indentedCode=!1,nt.f==Ze){var rt=vt;if(!rt){var dn=le.innerMode(bt,nt.htmlState);rt=dn.mode.name=="xml"&&dn.state.tagStart===null&&!dn.state.context&&dn.state.tokenize.isInText}rt&&(nt.f=dt,nt.block=_e,nt.htmlState=null)}return nt.trailingSpace=0,nt.trailingSpaceNewLine=!1,nt.prevLine=nt.thisLine,nt.thisLine={stream:null},null}function _e(nt,rt){var dn=nt.column()===rt.indentation,ri=we(rt.prevLine.stream),Hn=rt.indentedCode,Wt=rt.prevLine.hr,En=rt.list!==!1,An=(rt.listStack[rt.listStack.length-1]||0)+3;rt.indentedCode=!1;var ci=rt.indentation;if(rt.indentationDiff===null&&(rt.indentationDiff=rt.indentation,En)){for(rt.list=null;ci<rt.listStack[rt.listStack.length-1];)rt.listStack.pop(),rt.listStack.length?rt.indentation=rt.listStack[rt.listStack.length-1]:rt.list=!1;rt.list!==!1&&(rt.indentationDiff=ci-rt.listStack[rt.listStack.length-1])}var It=!ri&&!Wt&&!rt.prevLine.header&&(!En||!Hn)&&!rt.prevLine.fencedCodeEnd,Pt=(rt.list===!1||Wt||ri)&&rt.indentation<=An&&nt.match(ot),Nt=null;if(rt.indentationDiff>=4&&(Hn||rt.prevLine.fencedCodeEnd||rt.prevLine.header||ri))return nt.skipToEnd(),rt.indentedCode=!0,st.code;if(nt.eatSpace())return null;if(dn&&rt.indentation<=An&&(Nt=nt.match(ct))&&Nt[1].length<=6)return rt.quote=0,rt.header=Nt[1].length,rt.thisLine.header=!0,it.highlightFormatting&&(rt.formatting="header"),rt.f=rt.inline,Qe(rt);if(rt.indentation<=An&&nt.eat(">"))return rt.quote=dn?1:rt.quote+1,it.highlightFormatting&&(rt.formatting="quote"),nt.eatSpace(),Qe(rt);if(!Pt&&!rt.setext&&dn&&rt.indentation<=An&&(Nt=nt.match(We))){var ii=Nt[1]?"ol":"ul";return rt.indentation=ci+nt.current().length,rt.list=!0,rt.quote=0,rt.listStack.push(rt.indentation),rt.em=!1,rt.strong=!1,rt.code=!1,rt.strikethrough=!1,it.taskLists&&nt.match(Tt,!1)&&(rt.taskList=!0),rt.f=rt.inline,it.highlightFormatting&&(rt.formatting=["list","list-"+ii]),Qe(rt)}else{if(dn&&rt.indentation<=An&&(Nt=nt.match(ne,!0)))return rt.quote=0,rt.fencedEndRE=new RegExp(Nt[1]+"+ *$"),rt.localMode=it.fencedCodeBlockHighlighting&&Oe(Nt[2]||it.fencedCodeBlockDefaultMode),rt.localMode&&(rt.localState=le.startState(rt.localMode)),rt.f=rt.block=lt,it.highlightFormatting&&(rt.formatting="code-block"),rt.code=-1,Qe(rt);if(rt.setext||(!It||!En)&&!rt.quote&&rt.list===!1&&!rt.code&&!Pt&&!te.test(nt.string)&&(Nt=nt.lookAhead(1))&&(Nt=Nt.match(At)))return rt.setext?(rt.header=rt.setext,rt.setext=0,nt.skipToEnd(),it.highlightFormatting&&(rt.formatting="header")):(rt.header=Nt[0].charAt(0)=="="?1:2,rt.setext=rt.header),rt.thisLine.header=!0,rt.f=rt.inline,Qe(rt);if(Pt)return nt.skipToEnd(),rt.hr=!0,rt.thisLine.hr=!0,st.hr;if(nt.peek()==="[")return ge(nt,rt,pn)}return ge(nt,rt,rt.inline)}function Ze(nt,rt){var dn=bt.token(nt,rt.htmlState);if(!vt){var ri=le.innerMode(bt,rt.htmlState);(ri.mode.name=="xml"&&ri.state.tagStart===null&&!ri.state.context&&ri.state.tokenize.isInText||rt.md_inside&&nt.current().indexOf(">")>-1)&&(rt.f=dt,rt.block=_e,rt.htmlState=null)}return dn}function lt(nt,rt){var dn=rt.listStack[rt.listStack.length-1]||0,ri=rt.indentation<dn,Hn=dn+3;if(rt.fencedEndRE&&rt.indentation<=Hn&&(ri||nt.match(rt.fencedEndRE))){it.highlightFormatting&&(rt.formatting="code-block");var Wt;return ri||(Wt=Qe(rt)),rt.localMode=rt.localState=null,rt.block=_e,rt.f=dt,rt.fencedEndRE=null,rt.code=0,rt.thisLine.fencedCodeEnd=!0,ri?ye(nt,rt,rt.block):Wt}else return rt.localMode?rt.localMode.token(nt,rt.localState):(nt.skipToEnd(),st.code)}function Qe(nt){var rt=[];if(nt.formatting){rt.push(st.formatting),typeof nt.formatting=="string"&&(nt.formatting=[nt.formatting]);for(var dn=0;dn<nt.formatting.length;dn++)rt.push(st.formatting+"-"+nt.formatting[dn]),nt.formatting[dn]==="header"&&rt.push(st.formatting+"-"+nt.formatting[dn]+"-"+nt.header),nt.formatting[dn]==="quote"&&(!it.maxBlockquoteDepth||it.maxBlockquoteDepth>=nt.quote?rt.push(st.formatting+"-"+nt.formatting[dn]+"-"+nt.quote):rt.push("error"))}if(nt.taskOpen)return rt.push("meta"),rt.length?rt.join(" "):null;if(nt.taskClosed)return rt.push("property"),rt.length?rt.join(" "):null;if(nt.linkHref?rt.push(st.linkHref,"url"):(nt.strong&&rt.push(st.strong),nt.em&&rt.push(st.em),nt.strikethrough&&rt.push(st.strikethrough),nt.emoji&&rt.push(st.emoji),nt.linkText&&rt.push(st.linkText),nt.code&&rt.push(st.code),nt.image&&rt.push(st.image),nt.imageAltText&&rt.push(st.imageAltText,"link"),nt.imageMarker&&rt.push(st.imageMarker)),nt.header&&rt.push(st.header,st.header+"-"+nt.header),nt.quote&&(rt.push(st.quote),!it.maxBlockquoteDepth||it.maxBlockquoteDepth>=nt.quote?rt.push(st.quote+"-"+nt.quote):rt.push(st.quote+"-"+it.maxBlockquoteDepth)),nt.list!==!1){var ri=(nt.listStack.length-1)%3;ri?ri===1?rt.push(st.list2):rt.push(st.list3):rt.push(st.list1)}return nt.trailingSpaceNewLine?rt.push("trailing-space-new-line"):nt.trailingSpace&&rt.push("trailing-space-"+(nt.trailingSpace%2?"a":"b")),rt.length?rt.join(" "):null}function Ue(nt,rt){if(nt.match(De,!0))return Qe(rt)}function dt(nt,rt){var dn=rt.text(nt,rt);if(typeof dn!="undefined")return dn;if(rt.list)return rt.list=null,Qe(rt);if(rt.taskList){var ri=nt.match(Tt,!0)[1]===" ";return ri?rt.taskOpen=!0:rt.taskClosed=!0,it.highlightFormatting&&(rt.formatting="task"),rt.taskList=!1,Qe(rt)}if(rt.taskOpen=!1,rt.taskClosed=!1,rt.header&&nt.match(/^#+$/,!0))return it.highlightFormatting&&(rt.formatting="header"),Qe(rt);var Hn=nt.next();if(rt.linkTitle){rt.linkTitle=!1;var Wt=Hn;Hn==="("&&(Wt=")"),Wt=(Wt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var En="^\\s*(?:[^"+Wt+"\\\\]+|\\\\\\\\|\\\\.)"+Wt;if(nt.match(new RegExp(En),!0))return st.linkHref}if(Hn==="`"){var An=rt.formatting;it.highlightFormatting&&(rt.formatting="code"),nt.eatWhile("`");var ci=nt.current().length;if(rt.code==0&&(!rt.quote||ci==1))return rt.code=ci,Qe(rt);if(ci==rt.code){var It=Qe(rt);return rt.code=0,It}else return rt.formatting=An,Qe(rt)}else if(rt.code)return Qe(rt);if(Hn==="\\"&&(nt.next(),it.highlightFormatting)){var Pt=Qe(rt),Nt=st.formatting+"-escape";return Pt?Pt+" "+Nt:Nt}if(Hn==="!"&&nt.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return rt.imageMarker=!0,rt.image=!0,it.highlightFormatting&&(rt.formatting="image"),Qe(rt);if(Hn==="["&&rt.imageMarker&&nt.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return rt.imageMarker=!1,rt.imageAltText=!0,it.highlightFormatting&&(rt.formatting="image"),Qe(rt);if(Hn==="]"&&rt.imageAltText){it.highlightFormatting&&(rt.formatting="image");var Pt=Qe(rt);return rt.imageAltText=!1,rt.image=!1,rt.inline=rt.f=wt,Pt}if(Hn==="["&&!rt.image)return rt.linkText&&nt.match(/^.*?\]/)||(rt.linkText=!0,it.highlightFormatting&&(rt.formatting="link")),Qe(rt);if(Hn==="]"&&rt.linkText){it.highlightFormatting&&(rt.formatting="link");var Pt=Qe(rt);return rt.linkText=!1,rt.inline=rt.f=nt.match(/\(.*?\)| ?\[.*?\]/,!1)?wt:dt,Pt}if(Hn==="<"&&nt.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){rt.f=rt.inline=$e,it.highlightFormatting&&(rt.formatting="link");var Pt=Qe(rt);return Pt?Pt+=" ":Pt="",Pt+st.linkInline}if(Hn==="<"&&nt.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){rt.f=rt.inline=$e,it.highlightFormatting&&(rt.formatting="link");var Pt=Qe(rt);return Pt?Pt+=" ":Pt="",Pt+st.linkEmail}if(it.xml&&Hn==="<"&&nt.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ii=nt.string.indexOf(">",nt.pos);if(ii!=-1){var Gi=nt.string.substring(nt.start,ii);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Gi)&&(rt.md_inside=!0)}return nt.backUp(1),rt.htmlState=le.startState(bt),ye(nt,rt,Ze)}if(it.xml&&Hn==="<"&&nt.match(/^\/\w*?>/))return rt.md_inside=!1,"tag";if(Hn==="*"||Hn==="_"){for(var ze=1,Me=nt.pos==1?" ":nt.string.charAt(nt.pos-2);ze<3&&nt.eat(Hn);)ze++;var Ee=nt.peek()||" ",Te=!/\s/.test(Ee)&&(!de.test(Ee)||/\s/.test(Me)||de.test(Me)),He=!/\s/.test(Me)&&(!de.test(Me)||/\s/.test(Ee)||de.test(Ee)),Ae=null,qe=null;if(ze%2&&(!rt.em&&Te&&(Hn==="*"||!He||de.test(Me))?Ae=!0:rt.em==Hn&&He&&(Hn==="*"||!Te||de.test(Ee))&&(Ae=!1)),ze>1&&(!rt.strong&&Te&&(Hn==="*"||!He||de.test(Me))?qe=!0:rt.strong==Hn&&He&&(Hn==="*"||!Te||de.test(Ee))&&(qe=!1)),qe!=null||Ae!=null){it.highlightFormatting&&(rt.formatting=Ae==null?"strong":qe==null?"em":"strong em"),Ae===!0&&(rt.em=Hn),qe===!0&&(rt.strong=Hn);var It=Qe(rt);return Ae===!1&&(rt.em=!1),qe===!1&&(rt.strong=!1),It}}else if(Hn===" "&&(nt.eat("*")||nt.eat("_"))){if(nt.peek()===" ")return Qe(rt);nt.backUp(1)}if(it.strikethrough){if(Hn==="~"&&nt.eatWhile(Hn)){if(rt.strikethrough){it.highlightFormatting&&(rt.formatting="strikethrough");var It=Qe(rt);return rt.strikethrough=!1,It}else if(nt.match(/^[^\s]/,!1))return rt.strikethrough=!0,it.highlightFormatting&&(rt.formatting="strikethrough"),Qe(rt)}else if(Hn===" "&&nt.match(/^~~/,!0)){if(nt.peek()===" ")return Qe(rt);nt.backUp(2)}}if(it.emoji&&Hn===":"&&nt.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){rt.emoji=!0,it.highlightFormatting&&(rt.formatting="emoji");var an=Qe(rt);return rt.emoji=!1,an}return Hn===" "&&(nt.match(/^ +$/,!1)?rt.trailingSpace++:rt.trailingSpace&&(rt.trailingSpaceNewLine=!0)),Qe(rt)}function $e(nt,rt){var dn=nt.next();if(dn===">"){rt.f=rt.inline=dt,it.highlightFormatting&&(rt.formatting="link");var ri=Qe(rt);return ri?ri+=" ":ri="",ri+st.linkInline}return nt.match(/^[^>]+/,!0),st.linkInline}function wt(nt,rt){if(nt.eatSpace())return null;var dn=nt.next();return dn==="("||dn==="["?(rt.f=rt.inline=Lt(dn==="("?")":"]"),it.highlightFormatting&&(rt.formatting="link-string"),rt.linkHref=!0,Qe(rt)):"error"}var St={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function Lt(nt){return function(rt,dn){var ri=rt.next();if(ri===nt){dn.f=dn.inline=dt,it.highlightFormatting&&(dn.formatting="link-string");var Hn=Qe(dn);return dn.linkHref=!1,Hn}return rt.match(St[nt]),dn.linkHref=!0,Qe(dn)}}function pn(nt,rt){return nt.match(/^([^\]\\]|\\.)*\]:/,!1)?(rt.f=en,nt.next(),it.highlightFormatting&&(rt.formatting="link"),rt.linkText=!0,Qe(rt)):ge(nt,rt,dt)}function en(nt,rt){if(nt.match(/^\]:/,!0)){rt.f=rt.inline=vn,it.highlightFormatting&&(rt.formatting="link");var dn=Qe(rt);return rt.linkText=!1,dn}return nt.match(/^([^\]\\]|\\.)+/,!0),st.linkText}function vn(nt,rt){return nt.eatSpace()?null:(nt.match(/^[^\s]+/,!0),nt.peek()===void 0?rt.linkTitle=!0:nt.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),rt.f=rt.inline=dt,st.linkHref+" url")}var rn={startState:function(){return{f:_e,prevLine:{stream:null},thisLine:{stream:null},block:_e,htmlState:null,indentation:0,inline:dt,text:Ue,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(nt){return{f:nt.f,prevLine:nt.prevLine,thisLine:nt.thisLine,block:nt.block,htmlState:nt.htmlState&&le.copyState(bt,nt.htmlState),indentation:nt.indentation,localMode:nt.localMode,localState:nt.localMode?le.copyState(nt.localMode,nt.localState):null,inline:nt.inline,text:nt.text,formatting:!1,linkText:nt.linkText,linkTitle:nt.linkTitle,linkHref:nt.linkHref,code:nt.code,em:nt.em,strong:nt.strong,strikethrough:nt.strikethrough,emoji:nt.emoji,header:nt.header,setext:nt.setext,hr:nt.hr,taskList:nt.taskList,list:nt.list,listStack:nt.listStack.slice(0),quote:nt.quote,indentedCode:nt.indentedCode,trailingSpace:nt.trailingSpace,trailingSpaceNewLine:nt.trailingSpaceNewLine,md_inside:nt.md_inside,fencedEndRE:nt.fencedEndRE}},token:function(nt,rt){if(rt.formatting=!1,nt!=rt.thisLine.stream){if(rt.header=0,rt.hr=!1,nt.match(/^\s*$/,!0))return Ce(rt),null;if(rt.prevLine=rt.thisLine,rt.thisLine={stream:nt},rt.taskList=!1,rt.trailingSpace=0,rt.trailingSpaceNewLine=!1,!rt.localState&&(rt.f=rt.block,rt.f!=Ze)){var dn=nt.match(/^\s*/,!0)[0].replace(/\t/g,se).length;if(rt.indentation=dn,rt.indentationDiff=null,dn>0)return null}}return rt.f(nt,rt)},innerMode:function(nt){return nt.block==Ze?{state:nt.htmlState,mode:bt}:nt.localState?{state:nt.localState,mode:nt.localMode}:{state:nt,mode:rn}},indent:function(nt,rt,dn){return nt.block==Ze&&bt.indent?bt.indent(nt.htmlState,rt,dn):nt.localState&&nt.localMode.indent?nt.localMode.indent(nt.localState,rt,dn):le.Pass},blankLine:Ce,getType:Qe,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return rn},"xml"),le.defineMIME("text/markdown","markdown"),le.defineMIME("text/x-markdown","markdown")})},98101:function(Zn,ei,Le){(function(le){le(Le(89780))})(function(le){"use strict";le.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 Ke=0;Ke<le.modeInfo.length;Ke++){var it=le.modeInfo[Ke];it.mimes&&(it.mime=it.mimes[0])}le.findModeByMIME=function(bt){bt=bt.toLowerCase();for(var vt=0;vt<le.modeInfo.length;vt++){var Oe=le.modeInfo[vt];if(Oe.mime==bt)return Oe;if(Oe.mimes){for(var st=0;st<Oe.mimes.length;st++)if(Oe.mimes[st]==bt)return Oe}}if(/\+xml$/.test(bt))return le.findModeByMIME("application/xml");if(/\+json$/.test(bt))return le.findModeByMIME("application/json")},le.findModeByExtension=function(bt){bt=bt.toLowerCase();for(var vt=0;vt<le.modeInfo.length;vt++){var Oe=le.modeInfo[vt];if(Oe.ext){for(var st=0;st<Oe.ext.length;st++)if(Oe.ext[st]==bt)return Oe}}},le.findModeByFileName=function(bt){for(var vt=0;vt<le.modeInfo.length;vt++){var Oe=le.modeInfo[vt];if(Oe.file&&Oe.file.test(bt))return Oe}var st=bt.lastIndexOf("."),Et=st>-1&&bt.substring(st+1,bt.length);if(Et)return le.findModeByExtension(Et)},le.findModeByName=function(bt){bt=bt.toLowerCase();for(var vt=0;vt<le.modeInfo.length;vt++){var Oe=le.modeInfo[vt];if(Oe.name.toLowerCase()==bt)return Oe;if(Oe.alias){for(var st=0;st<Oe.alias.length;st++)if(Oe.alias[st].toLowerCase()==bt)return Oe}}}})},67549:function(Zn,ei,Le){(function(le){le(Le(89780))})(function(le){"use strict";le.defineMode("stex",function(Ke,it){"use strict";function bt(De,ne){De.cmdState.push(ne)}function vt(De){return De.cmdState.length>0?De.cmdState[De.cmdState.length-1]:null}function Oe(De){var ne=De.cmdState.pop();ne&&ne.closeBracket()}function st(De){for(var ne=De.cmdState,te=ne.length-1;te>=0;te--){var de=ne[te];if(de.name!="DEFAULT")return de}return{styleIdentifier:function(){return null}}}function Et(De,ne,te){return function(){this.name=De,this.bracketNo=0,this.style=ne,this.styles=te,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var ot={};ot.importmodule=Et("importmodule","tag",["string","builtin"]),ot.documentclass=Et("documentclass","tag",["","atom"]),ot.usepackage=Et("usepackage","tag",["atom"]),ot.begin=Et("begin","tag",["atom"]),ot.end=Et("end","tag",["atom"]),ot.label=Et("label","tag",["atom"]),ot.ref=Et("ref","tag",["atom"]),ot.eqref=Et("eqref","tag",["atom"]),ot.cite=Et("cite","tag",["atom"]),ot.bibitem=Et("bibitem","tag",["atom"]),ot.Bibitem=Et("Bibitem","tag",["atom"]),ot.RBibitem=Et("RBibitem","tag",["atom"]),ot.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function We(De,ne){De.f=ne}function Tt(De,ne){var te;if(De.match(/^\\[a-zA-Z@]+/)){var de=De.current().slice(1);return te=ot.hasOwnProperty(de)?ot[de]:ot.DEFAULT,te=new te,bt(ne,te),We(ne,At),te.style}if(De.match(/^\\[$&%#{}_]/)||De.match(/^\\[,;!\/\\]/))return"tag";if(De.match("\\["))return We(ne,function(ge,ye){return ct(ge,ye,"\\]")}),"keyword";if(De.match("\\("))return We(ne,function(ge,ye){return ct(ge,ye,"\\)")}),"keyword";if(De.match("$$"))return We(ne,function(ge,ye){return ct(ge,ye,"$$")}),"keyword";if(De.match("$"))return We(ne,function(ge,ye){return ct(ge,ye,"$")}),"keyword";var se=De.next();if(se=="%")return De.skipToEnd(),"comment";if(se=="}"||se=="]"){if(te=vt(ne),te)te.closeBracket(se),We(ne,At);else return"error";return"bracket"}else return se=="{"||se=="["?(te=ot.DEFAULT,te=new te,bt(ne,te),"bracket"):/\d/.test(se)?(De.eatWhile(/[\w.%]/),"atom"):(De.eatWhile(/[\w\-_]/),te=st(ne),te.name=="begin"&&(te.argument=De.current()),te.styleIdentifier())}function ct(De,ne,te){if(De.eatSpace())return null;if(te&&De.match(te))return We(ne,Tt),"keyword";if(De.match(/^\\[a-zA-Z@]+/))return"tag";if(De.match(/^[a-zA-Z]+/))return"variable-2";if(De.match(/^\\[$&%#{}_]/)||De.match(/^\\[,;!\/]/)||De.match(/^[\^_&]/))return"tag";if(De.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(De.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var de=De.next();return de=="{"||de=="}"||de=="["||de=="]"||de=="("||de==")"?"bracket":de=="%"?(De.skipToEnd(),"comment"):"error"}function At(De,ne){var te=De.peek(),de;return te=="{"||te=="["?(de=vt(ne),de.openBracket(te),De.eat(te),We(ne,Tt),"bracket"):/[ \t\r]/.test(te)?(De.eat(te),null):(We(ne,Tt),Oe(ne),Tt(De,ne))}return{startState:function(){var De=it.inMathMode?function(ne,te){return ct(ne,te)}:Tt;return{cmdState:[],f:De}},copyState:function(De){return{cmdState:De.cmdState.slice(),f:De.f}},token:function(De,ne){return ne.f(De,ne)},blankLine:function(De){De.f=Tt,De.cmdState.length=0},lineComment:"%"}}),le.defineMIME("text/x-stex","stex"),le.defineMIME("text/x-latex","stex")})},15525:function(Zn,ei,Le){(function(le){le(Le(89780))})(function(le){"use strict";var Ke={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},it={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};le.defineMode("xml",function(bt,vt){var Oe=bt.indentUnit,st={},Et=vt.htmlMode?Ke:it;for(var ot in Et)st[ot]=Et[ot];for(var ot in vt)st[ot]=vt[ot];var We,Tt;function ct($e,wt){function St(en){return wt.tokenize=en,en($e,wt)}var Lt=$e.next();if(Lt=="<")return $e.eat("!")?$e.eat("[")?$e.match("CDATA[")?St(ne("atom","]]>")):null:$e.match("--")?St(ne("comment","-->")):$e.match("DOCTYPE",!0,!0)?($e.eatWhile(/[\w\._\-]/),St(te(1))):null:$e.eat("?")?($e.eatWhile(/[\w\._\-]/),wt.tokenize=ne("meta","?>"),"meta"):(We=$e.eat("/")?"closeTag":"openTag",wt.tokenize=At,"tag bracket");if(Lt=="&"){var pn;return $e.eat("#")?$e.eat("x")?pn=$e.eatWhile(/[a-fA-F\d]/)&&$e.eat(";"):pn=$e.eatWhile(/[\d]/)&&$e.eat(";"):pn=$e.eatWhile(/[\w\.\-:]/)&&$e.eat(";"),pn?"atom":"error"}else return $e.eatWhile(/[^&<]/),null}ct.isInText=!0;function At($e,wt){var St=$e.next();if(St==">"||St=="/"&&$e.eat(">"))return wt.tokenize=ct,We=St==">"?"endTag":"selfcloseTag","tag bracket";if(St=="=")return We="equals",null;if(St=="<"){wt.tokenize=ct,wt.state=ye,wt.tagName=wt.tagStart=null;var Lt=wt.tokenize($e,wt);return Lt?Lt+" tag error":"tag error"}else return/[\'\"]/.test(St)?(wt.tokenize=De(St),wt.stringStartCol=$e.column(),wt.tokenize($e,wt)):($e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function De($e){var wt=function(St,Lt){for(;!St.eol();)if(St.next()==$e){Lt.tokenize=At;break}return"string"};return wt.isInAttribute=!0,wt}function ne($e,wt){return function(St,Lt){for(;!St.eol();){if(St.match(wt)){Lt.tokenize=ct;break}St.next()}return $e}}function te($e){return function(wt,St){for(var Lt;(Lt=wt.next())!=null;){if(Lt=="<")return St.tokenize=te($e+1),St.tokenize(wt,St);if(Lt==">")if($e==1){St.tokenize=ct;break}else return St.tokenize=te($e-1),St.tokenize(wt,St)}return"meta"}}function de($e,wt,St){this.prev=$e.context,this.tagName=wt,this.indent=$e.indented,this.startOfLine=St,(st.doNotIndent.hasOwnProperty(wt)||$e.context&&$e.context.noIndent)&&(this.noIndent=!0)}function se($e){$e.context&&($e.context=$e.context.prev)}function ge($e,wt){for(var St;;){if(!$e.context||(St=$e.context.tagName,!st.contextGrabbers.hasOwnProperty(St)||!st.contextGrabbers[St].hasOwnProperty(wt)))return;se($e)}}function ye($e,wt,St){return $e=="openTag"?(St.tagStart=wt.column(),we):$e=="closeTag"?Ce:ye}function we($e,wt,St){return $e=="word"?(St.tagName=wt.current(),Tt="tag",lt):st.allowMissingTagName&&$e=="endTag"?(Tt="tag bracket",lt($e,wt,St)):(Tt="error",we)}function Ce($e,wt,St){if($e=="word"){var Lt=wt.current();return St.context&&St.context.tagName!=Lt&&st.implicitlyClosed.hasOwnProperty(St.context.tagName)&&se(St),St.context&&St.context.tagName==Lt||st.matchClosing===!1?(Tt="tag",_e):(Tt="tag error",Ze)}else return st.allowMissingTagName&&$e=="endTag"?(Tt="tag bracket",_e($e,wt,St)):(Tt="error",Ze)}function _e($e,wt,St){return $e!="endTag"?(Tt="error",_e):(se(St),ye)}function Ze($e,wt,St){return Tt="error",_e($e,wt,St)}function lt($e,wt,St){if($e=="word")return Tt="attribute",Qe;if($e=="endTag"||$e=="selfcloseTag"){var Lt=St.tagName,pn=St.tagStart;return St.tagName=St.tagStart=null,$e=="selfcloseTag"||st.autoSelfClosers.hasOwnProperty(Lt)?ge(St,Lt):(ge(St,Lt),St.context=new de(St,Lt,pn==St.indented)),ye}return Tt="error",lt}function Qe($e,wt,St){return $e=="equals"?Ue:(st.allowMissing||(Tt="error"),lt($e,wt,St))}function Ue($e,wt,St){return $e=="string"?dt:$e=="word"&&st.allowUnquoted?(Tt="string",lt):(Tt="error",lt($e,wt,St))}function dt($e,wt,St){return $e=="string"?dt:lt($e,wt,St)}return{startState:function($e){var wt={tokenize:ct,state:ye,indented:$e||0,tagName:null,tagStart:null,context:null};return $e!=null&&(wt.baseIndent=$e),wt},token:function($e,wt){if(!wt.tagName&&$e.sol()&&(wt.indented=$e.indentation()),$e.eatSpace())return null;We=null;var St=wt.tokenize($e,wt);return(St||We)&&St!="comment"&&(Tt=null,wt.state=wt.state(We||St,$e,wt),Tt&&(St=Tt=="error"?St+" error":Tt)),St},indent:function($e,wt,St){var Lt=$e.context;if($e.tokenize.isInAttribute)return $e.tagStart==$e.indented?$e.stringStartCol+1:$e.indented+Oe;if(Lt&&Lt.noIndent)return le.Pass;if($e.tokenize!=At&&$e.tokenize!=ct)return St?St.match(/^(\s*)/)[0].length:0;if($e.tagName)return st.multilineTagIndentPastTag!==!1?$e.tagStart+$e.tagName.length+2:$e.tagStart+Oe*(st.multilineTagIndentFactor||1);if(st.alignCDATA&&/<!\[CDATA\[/.test(wt))return 0;var pn=wt&&/^<(\/)?([\w_:\.-]*)/.exec(wt);if(pn&&pn[1])for(;Lt;)if(Lt.tagName==pn[2]){Lt=Lt.prev;break}else if(st.implicitlyClosed.hasOwnProperty(Lt.tagName))Lt=Lt.prev;else break;else if(pn)for(;Lt;){var en=st.contextGrabbers[Lt.tagName];if(en&&en.hasOwnProperty(pn[2]))Lt=Lt.prev;else break}for(;Lt&&Lt.prev&&!Lt.startOfLine;)Lt=Lt.prev;return Lt?Lt.indent+Oe:$e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:st.htmlMode?"html":"xml",helperType:st.htmlMode?"html":"xml",skipAttribute:function($e){$e.state==Ue&&($e.state=lt)},xmlCurrentTag:function($e){return $e.tagName?{name:$e.tagName,close:$e.type=="closeTag"}:null},xmlCurrentContext:function($e){for(var wt=[],St=$e.context;St;St=St.prev)St.tagName&&wt.push(St.tagName);return wt.reverse()}}}),le.defineMIME("text/xml","xml"),le.defineMIME("application/xml","xml"),le.mimeModes.hasOwnProperty("text/html")||le.defineMIME("text/html",{name:"xml",htmlMode:!0})})},12378:function(Zn,ei,Le){"use strict";Le.d(ei,{$u:function(){return ot},BD:function(){return ze},E9:function(){return Et},FF:function(){return Xn},FJ:function(){return ye},Hn:function(){return ge},KX:function(){return Ce},NB:function(){return kt},S0:function(){return Nt},UL:function(){return We},Vk:function(){return se},Vm:function(){return Zt},YI:function(){return ii},ZA:function(){return it},Zt:function(){return Tt},al:function(){return Ae},bn:function(){return He},bx:function(){return Me},g2:function(){return Gi},h1:function(){return Ue},hD:function(){return Sn},l4:function(){return Oe},rU:function(){return Dt},s_:function(){return Ee},uz:function(){return yn},z6:function(){return ct}}),Zn=Le.hmd(Zn),function(){var be;function mn(a){var y=0;return function(){return y<a.length?{done:!1,value:a[y++]}:{done:!0}}}function fi(a){var y=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];return y?y.call(a):{next:mn(a)}}function Vn(a){for(var y,x=[];!(y=a.next()).done;)x.push(y.value);return x}var si=typeof Object.create=="function"?Object.create:function(a){function y(){}return y.prototype=a,new y},Di;if(typeof Object.setPrototypeOf=="function")Di=Object.setPrototypeOf;else{var Ni;e:{var yr={a:!0},zt={};try{zt.__proto__=yr,Ni=zt.a;break e}catch(a){}Ni=!1}Di=Ni?function(a,y){if(a.__proto__=y,a.__proto__!==y)throw new TypeError(a+" is not extensible");return a}:null}var Mt=Di;function _t(a,y){if(a.prototype=si(y.prototype),a.prototype.constructor=a,Mt)Mt(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 fn=typeof Le.g!="undefined"&&Le.g!=null?Le.g:self,Ji=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},mi=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,y,x){a!=Array.prototype&&a!=Object.prototype&&(a[y]=x.value)};function $i(a,y){if(y){var x=fn;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&&mi(x,a,{writable:!0,value:y})}}$i("Object.assign",function(a){return a||Ji}),$i("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 xn=typeof globalThis=="object"&&globalThis||typeof Le.g=="object"&&Le.g.global===Le.g&&Le.g||typeof self=="object"&&self.self===self&&self||{};xn.requestAnimationFrame===void 0&&(xn.setImmediate===void 0?xn.requestAnimationFrame=function(a){xn.setTimeout(a,0)}:xn.requestAnimationFrame=xn.setImmediate);function ni(){}function sr(a,y){var x=-1;return function(){var E=this,b=arguments;x!==-1&&xn.clearTimeout(x),x=br(function(){x=-1,a.apply(E,b)},y)}}function br(a,y){return xn.setTimeout(a,y)}function Yn(a){return xn.document.createElement(a)}function at(a){throw Error(a)}function Bt(a,y){a="The object is frozen, so its properties cannot be set: "+a.toString(),y!==void 0&&(a+=" to value: "+y),at(a)}function Kn(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),at(x+" is not in the range "+y+": "+a)}function li(a){xn.console&&xn.console.log(a)}function Qt(a){return typeof a=="object"&&a!==null}function jt(a){return Array.isArray(a)||xn.NodeList&&a instanceof xn.NodeList||xn.HTMLCollection&&a instanceof xn.HTMLCollection}function Un(a){return Array.prototype.slice.call(a)}function ai(a,y,x){Array.isArray(a)?y>=a.length?a.push(x):a.splice(y,0,x):at("Cannot insert an object into an HTMLCollection or NodeList: "+x+" at "+y)}function Vi(a,y){Array.isArray(a)?y>=a.length?a.pop():a.splice(y,1):at("Cannot remove an object from an HTMLCollection or NodeList at "+y)}function xi(){var a=xo.pop();return a===void 0?[]:a}function Bi(a){a.length=0,xo.push(a)}function Ii(a){if(typeof a=="function"){if(a.className)return a.className;if(a.name)return a.name;var y=a.toString();if(y=y.substring(9,y.indexOf("(")).trim(),y!=="")return a._className=y}else if(Qt(a)&&a.constructor)return Ii(a.constructor);return typeof a}function Pr(a){var y=a;return Qt(a)&&(a.text?y=a.text:a.name?y=a.name:a.key!==void 0?y=a.key:a.id!==void 0?y=a.id:a.constructor===Object&&(a.Text?y=a.Text:a.Name?y=a.Name:a.Key!==void 0?y=a.Key:a.Id!==void 0?y=a.Id:a.ID!==void 0&&(y=a.ID))),y===void 0?"undefined":y===null?"null":y.toString()}function xr(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 _n(a,y,x){Object.defineProperty(Eo.prototype,a,{get:y,set:x})}function ki(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="",ee=0;ee<a.length;ee++)x=(x+1)%256,E=(E+y[x])%256,b=y[x],y[x]=y[E],y[E]=b,z+=String.fromCharCode(a.charCodeAt(ee)^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 Ar=xn.navigator!==void 0&&0<xn.navigator.userAgent.indexOf("Trident/7"),Vr=xn.navigator!==void 0&&xn.navigator.platform!==void 0&&xn.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,xo=[];Object.freeze([]),ni.className="Util",ni.Dx="32ab5ff3b26f42dc0ed90f21472913b5",ni.adym="gojs.net",ni.vfo="28e645fdb266",ni.className="Util";function Ot(a,y,x){Er(this),this.j=a,this.xa=y,this.o=x}Ot.prototype.toString=function(){return"EnumValue."+this.xa};function Li(a,y){return y==null||y===""?null:a[y]}fn.Object.defineProperties(Ot.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),Ot.className="EnumValue";function Sr(){this.ew=[]}Sr.prototype.toString=function(){return this.ew.join("")},Sr.prototype.add=function(a){a!==""&&this.ew.push(a)},Sr.className="StringBuilder";function Ri(){}Ri.className="PropertyCollection";var po={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(a){xn.console&&xn.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(ee,re){return function(){throw Error("Property "+ee.Zl[re.Tj]+" of "+ee.x+" is read-only.")}}(y,b)})}}}y={Zl:y.Zl,x:y.x}}}};function Qr(){}Qr.prototype.reset=function(){},Qr.prototype.next=function(){return!1},Qr.prototype.Ad=function(){return!1},Qr.prototype.first=function(){return null},Qr.prototype.any=function(){return!1},Qr.prototype.all=function(){return!0},Qr.prototype.each=function(){return this},Qr.prototype.map=function(){return this},Qr.prototype.filter=function(){return this},Qr.prototype.de=function(){},Qr.prototype.toString=function(){return"EmptyIterator"},fn.Object.defineProperties(Qr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),Qr.prototype.first=Qr.prototype.first,Qr.prototype.hasNext=Qr.prototype.Ad,Qr.prototype.next=Qr.prototype.next,Qr.prototype.reset=Qr.prototype.reset;var mo=null;Qr.className="EmptyIterator",mo=new Qr;function fo(a){this.key=-1,this.value=a}fo.prototype.reset=function(){this.key=-1},fo.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},fo.prototype.Ad=function(){return this.next()},fo.prototype.first=function(){return this.key=0,this.value},fo.prototype.any=function(a){return this.key=-1,a(this.value)},fo.prototype.all=function(a){return this.key=-1,a(this.value)},fo.prototype.each=function(a){return this.key=-1,a(this.value),this},fo.prototype.map=function(a){return new fo(a(this.value))},fo.prototype.filter=function(a){return a(this.value)?new fo(this.value):mo},fo.prototype.de=function(){this.value=null},fo.prototype.toString=function(){return"SingletonIterator("+this.value+")"},fn.Object.defineProperties(fo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),fo.prototype.first=fo.prototype.first,fo.prototype.hasNext=fo.prototype.Ad,fo.prototype.next=fo.prototype.next,fo.prototype.reset=fo.prototype.reset,fo.className="SingletonIterator";function wo(a){this.Bb=a,this.qf=null,a.Sa=null,this.qa=a.Ja,this.Za=-1}wo.prototype.reset=function(){var a=this.Bb;a.Sa=null,this.qa=a.Ja,this.Za=-1},wo.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},wo.prototype.Ad=function(){return this.next()},wo.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},wo.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},wo.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},wo.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},wo.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 ee=y[z];(b===null||b(ee))&&x.push(a(ee))}return a=new Bn,a.s=x,a.xb(),a.iterator},wo.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 ee=y[z];(b===null||b(ee))&&a(ee)&&x.push(ee)}return a=new Bn,a.s=x,a.xb(),a.iterator},wo.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},wo.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},fn.Object.defineProperties(wo.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}}}),wo.prototype.first=wo.prototype.first,wo.prototype.hasNext=wo.prototype.Ad,wo.prototype.next=wo.prototype.next,wo.prototype.reset=wo.prototype.reset,wo.className="ListIterator";function Io(a){this.Bb=a,a.Hg=null,this.qa=a.Ja,this.Za=a.s.length}Io.prototype.reset=function(){var a=this.Bb;a.Hg=null,this.qa=a.Ja,this.Za=a.s.length},Io.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)},Io.prototype.Ad=function(){return this.next()},Io.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},Io.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},Io.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},Io.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},Io.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 Bn,a.s=x,a.xb(),a.iterator},Io.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 Bn,a.s=x,a.xb(),a.iterator},Io.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},Io.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},fn.Object.defineProperties(Io.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),Io.prototype.first=Io.prototype.first,Io.prototype.hasNext=Io.prototype.Ad,Io.prototype.next=Io.prototype.next,Io.prototype.reset=Io.prototype.reset,Io.className="ListIteratorBackwards";function Bn(a){Er(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof a=="string"&&at("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}be=Bn.prototype,be.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return this._isFrozen=!1,this},be.toString=function(){return"List()#"+wr(this)},be.add=function(a){return a===null?this:(this._isFrozen&&Bt(this,a),this.s.push(a),this.xb(),this)},be.push=function(a){this.add(a)},be.addAll=function(a){if(a===null)return this;this._isFrozen&&Bt(this);var y=this.s;if(jt(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},be.clear=function(){this._isFrozen&&Bt(this),this.s.length=0,this.xb()},be.contains=function(a){return a===null?!1:this.s.indexOf(a)!==-1},be.has=function(a){return this.contains(a)},be.indexOf=function(a){return a===null?-1:this.s.indexOf(a)},be.M=function(a){var y=this.s;return(0>a||a>=y.length)&&Kn(a,"0 <= i < length",Bn,"elt:i"),y[a]},be.get=function(a){return this.M(a)},be.cd=function(a,y){var x=this.s;(0>a||a>=x.length)&&Kn(a,"0 <= i < length",Bn,"setElt:i"),this._isFrozen&&Bt(this,a),x[a]=y},be.set=function(a,y){this.cd(a,y)},be.first=function(){var a=this.s;return a.length===0?null:a[0]},be.jc=function(){var a=this.s,y=a.length;return 0<y?a[y-1]:null},be.pop=function(){this._isFrozen&&Bt(this);var a=this.s;return 0<a.length?a.pop():null},Bn.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},Bn.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},Bn.prototype.each=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)a(y[E]);return this},Bn.prototype.map=function(a){for(var y=new Bn,x=[],E=this.s,b=E.length,z=0;z<b;z++)x.push(a(E[z]));return y.s=x,y.xb(),y},Bn.prototype.filter=function(a){for(var y=new Bn,x=[],E=this.s,b=E.length,z=0;z<b;z++){var ee=E[z];a(ee)&&x.push(ee)}return y.s=x,y.xb(),y},be=Bn.prototype,be.Gb=function(a,y){0>a&&Kn(a,">= 0",Bn,"insertAt:i"),this._isFrozen&&Bt(this,a);var x=this.s;a>=x.length?x.push(y):x.splice(a,0,y),this.xb()},be.remove=function(a){if(a===null)return!1;this._isFrozen&&Bt(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)},be.delete=function(a){return this.remove(a)},be.mb=function(a){var y=this.s;(0>a||a>=y.length)&&Kn(a,"0 <= i < length",Bn,"removeAt:i"),this._isFrozen&&Bt(this,a),a===y.length-1?y.pop():y.splice(a,1),this.xb()},be.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&&Bt(this);for(var b=a,z=y+1;z<E;)x[b++]=x[z++];return x.length=E-(y-a+1),this.xb(),this},Bn.prototype.copy=function(){var a=new Bn,y=this.s;return 0<y.length&&(a.s=Array.prototype.slice.call(y)),a},be=Bn.prototype,be.Fa=function(){for(var a=this.s,y=this.count,x=Array(y),E=0;E<y;E++)x[E]=a[E];return x},be.Iv=function(){for(var a=new In,y=this.s,x=this.count,E=0;E<x;E++)a.add(y[E]);return a},be.sort=function(a){return this._isFrozen&&Bt(this),this.s.sort(a),this.xb(),this},be.zi=function(a,y,x){var E=this.s,b=E.length;y===void 0&&(y=0),x===void 0&&(x=b),this._isFrozen&&Bt(this);var z=x-y;if(1>=z)return this;if((0>y||y>=b-1)&&Kn(y,"0 <= from < length",Bn,"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},be.reverse=function(){return this._isFrozen&&Bt(this),this.s.reverse(),this.xb(),this},fn.Object.defineProperties(Bn.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 mo;var a=this.Sa;return a!==null?(a.reset(),a):new wo(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return mo;var a=this.Hg;return a!==null?(a.reset(),a):new Io(this)}}}),Bn.prototype.reverse=Bn.prototype.reverse,Bn.prototype.sortRange=Bn.prototype.zi,Bn.prototype.sort=Bn.prototype.sort,Bn.prototype.toSet=Bn.prototype.Iv,Bn.prototype.toArray=Bn.prototype.Fa,Bn.prototype.removeRange=Bn.prototype.removeRange,Bn.prototype.removeAt=Bn.prototype.mb,Bn.prototype.delete=Bn.prototype.delete,Bn.prototype.remove=Bn.prototype.remove,Bn.prototype.insertAt=Bn.prototype.Gb,Bn.prototype.pop=Bn.prototype.pop,Bn.prototype.last=Bn.prototype.jc,Bn.prototype.first=Bn.prototype.first,Bn.prototype.set=Bn.prototype.set,Bn.prototype.setElt=Bn.prototype.cd,Bn.prototype.get=Bn.prototype.get,Bn.prototype.elt=Bn.prototype.M,Bn.prototype.indexOf=Bn.prototype.indexOf,Bn.prototype.has=Bn.prototype.has,Bn.prototype.contains=Bn.prototype.contains,Bn.prototype.clear=Bn.prototype.clear,Bn.prototype.addAll=Bn.prototype.addAll,Bn.prototype.push=Bn.prototype.push,Bn.prototype.add=Bn.prototype.add,Bn.prototype.thaw=Bn.prototype.ka,Bn.prototype.freeze=Bn.prototype.freeze,Bn.className="List";function ca(a){this.eg=a,a.Sa=null,this.qa=a.Ja,this.sa=null}ca.prototype.reset=function(){var a=this.eg;a.Sa=null,this.qa=a.Ja,this.sa=null},ca.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)},ca.prototype.Ad=function(){return this.next()},ca.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},ca.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},ca.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},ca.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},ca.prototype.map=function(a){var y=this.eg;y.Sa=null;var x=new Bn;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},ca.prototype.filter=function(a){var y=this.eg;y.Sa=null;var x=new Bn;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},ca.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},ca.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},fn.Object.defineProperties(ca.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),ca.prototype.first=ca.prototype.first,ca.prototype.hasNext=ca.prototype.Ad,ca.prototype.next=ca.prototype.next,ca.prototype.reset=ca.prototype.reset,ca.className="SetIterator";function In(a){Er(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&at("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}be=In.prototype,be.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return this._isFrozen=!1,this},be.toString=function(){return"Set()#"+wr(this)},be.add=function(a){if(a===null)return this;this._isFrozen&&Bt(this,a);var y=a;return Qt(a)&&(y=Do(a)),this.Tb[y]===void 0&&(this.Sb++,a=new Yt(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},be.addAll=function(a){if(a===null)return this;if(this._isFrozen&&Bt(this),jt(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},be.contains=function(a){if(a===null)return!1;var y=a;return Qt(a)&&(y=wr(a),y===void 0)?!1:this.Tb[y]!==void 0},be.has=function(a){return this.contains(a)},be.Sy=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0},be.Ty=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1},be.first=function(){var a=this.ea;return a===null?null:a.value},In.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},In.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},In.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y.value),y=y.va;return this},In.prototype.map=function(a){for(var y=new In,x=this.ea;x!==null;)y.add(a(x.value)),x=x.va;return y},In.prototype.filter=function(a){for(var y=new In,x=this.ea;x!==null;){var E=x.value;a(E)&&y.add(E),x=x.va}return y},be=In.prototype,be.remove=function(a){if(a===null)return!1;this._isFrozen&&Bt(this,a);var y=a;if(Qt(a)&&(y=wr(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},be.delete=function(a){return this.remove(a)},be.hp=function(a){if(a===null)return this;if(this._isFrozen&&Bt(this),jt(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},be.pA=function(a){if(a===null||this.count===0)return this;this._isFrozen&&Bt(this);var y=new In;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},be.clear=function(){this._isFrozen&&Bt(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},In.prototype.copy=function(){var a=new In,y=this.Tb,x;for(x in y)a.add(y[x].value);return a},In.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},In.prototype.Hv=function(){var a=new Bn,y=this.Tb,x;for(x in y)a.add(y[x].value);return a};function Er(a){a.__gohashid=Qo++}function Do(a){var y=a.__gohashid;return y===void 0&&(y=Qo++,a.__gohashid=y),y}function wr(a){return a.__gohashid}fn.Object.defineProperties(In.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return mo;var a=this.Sa;return a!==null?(a.reset(),a):new ca(this)}}}),In.prototype.toList=In.prototype.Hv,In.prototype.toArray=In.prototype.Fa,In.prototype.clear=In.prototype.clear,In.prototype.retainAll=In.prototype.pA,In.prototype.removeAll=In.prototype.hp,In.prototype.delete=In.prototype.delete,In.prototype.remove=In.prototype.remove,In.prototype.first=In.prototype.first,In.prototype.containsAny=In.prototype.Ty,In.prototype.containsAll=In.prototype.Sy,In.prototype.has=In.prototype.has,In.prototype.contains=In.prototype.contains,In.prototype.addAll=In.prototype.addAll,In.prototype.add=In.prototype.add,In.prototype.thaw=In.prototype.ka,In.prototype.freeze=In.prototype.freeze;var Qo=1;In.className="Set",In.uniqueHash=Er,In.hashIdUnique=Do,In.hashId=wr;function To(a){this.ma=a,this.qa=a.Ja,this.sa=null}To.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},To.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)},To.prototype.Ad=function(){return this.next()},To.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},To.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},To.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},To.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},To.prototype.map=function(a){var y=this.ma;this.sa=null;var x=new Bn;for(y=y.ea;y!==null;)x.add(a(y.key)),y=y.va;return x.iterator},To.prototype.filter=function(a){var y=this.ma;this.sa=null;var x=new Bn;for(y=y.ea;y!==null;){var E=y.key;a(E)&&x.add(E),y=y.va}return x.iterator},To.prototype.de=function(){this.value=this.key=null,this.qa=-1},To.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},fn.Object.defineProperties(To.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),To.prototype.first=To.prototype.first,To.prototype.hasNext=To.prototype.Ad,To.prototype.next=To.prototype.next,To.prototype.reset=To.prototype.reset,To.className="MapKeySetIterator";function ro(a){In.call(this),Er(this),this._isFrozen=!0,this.ma=a}_t(ro,In),be=ro.prototype,be.freeze=function(){return this},be.ka=function(){return this},be.toString=function(){return"MapKeySet("+this.ma.toString()+")"},be.add=function(){at("This Set is read-only: "+this.toString())},be.contains=function(a){return this.ma.contains(a)},be.has=function(a){return this.contains(a)},be.remove=function(){at("This Set is read-only: "+this.toString())},be.delete=function(a){return this.remove(a)},be.clear=function(){at("This Set is read-only: "+this.toString())},be.first=function(){var a=this.ma.ea;return a!==null?a.key:null},ro.prototype.any=function(a){for(var y=this.ma.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},ro.prototype.all=function(a){for(var y=this.ma.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},ro.prototype.each=function(a){for(var y=this.ma.ea;y!==null;)a(y.key),y=y.va;return this},ro.prototype.map=function(a){for(var y=new In,x=this.ma.ea;x!==null;)y.add(a(x.key)),x=x.va;return y},ro.prototype.filter=function(a){for(var y=new In,x=this.ma.ea;x!==null;){var E=x.key;a(E)&&y.add(E),x=x.va}return y},ro.prototype.copy=function(){return new ro(this.ma)},ro.prototype.Iv=function(){var a=new In,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},ro.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},ro.prototype.Hv=function(){var a=new Bn,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},fn.Object.defineProperties(ro.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?mo:new To(this.ma)}}}),ro.prototype.toList=ro.prototype.Hv,ro.prototype.toArray=ro.prototype.Fa,ro.prototype.toSet=ro.prototype.Iv,ro.prototype.first=ro.prototype.first,ro.prototype.clear=ro.prototype.clear,ro.prototype.delete=ro.prototype.delete,ro.prototype.remove=ro.prototype.remove,ro.prototype.has=ro.prototype.has,ro.prototype.contains=ro.prototype.contains,ro.prototype.add=ro.prototype.add,ro.prototype.thaw=ro.prototype.ka,ro.prototype.freeze=ro.prototype.freeze,ro.className="MapKeySet";function fa(a){this.ma=a,a.jf=null,this.qa=a.Ja,this.sa=null}fa.prototype.reset=function(){var a=this.ma;a.jf=null,this.qa=a.Ja,this.sa=null},fa.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)},fa.prototype.Ad=function(){return this.next()},fa.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},fa.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},fa.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},fa.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},fa.prototype.map=function(a){var y=this.ma;this.sa=y.jf=null;var x=new Bn;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},fa.prototype.filter=function(a){var y=this.ma;this.sa=y.jf=null;var x=new Bn;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},fa.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},fa.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},fn.Object.defineProperties(fa.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),fa.prototype.first=fa.prototype.first,fa.prototype.hasNext=fa.prototype.Ad,fa.prototype.next=fa.prototype.next,fa.prototype.reset=fa.prototype.reset,fa.className="MapValueSetIterator";function Yt(a,y){this.key=a,this.value=y,this.ll=this.va=null}Yt.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},Yt.className="KeyValuePair";function Rn(a){this.ma=a,a.Sa=null,this.qa=a.Ja,this.sa=null}Rn.prototype.reset=function(){var a=this.ma;a.Sa=null,this.qa=a.Ja,this.sa=null},Rn.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)},Rn.prototype.Ad=function(){return this.next()},Rn.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},Rn.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},Rn.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},Rn.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},Rn.prototype.map=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new Bn;for(y=y.ea;y!==null;)x.add(a(y)),y=y.va;return x.iterator},Rn.prototype.filter=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new Bn;for(y=y.ea;y!==null;)a(y)&&x.add(y),y=y.va;return x.iterator},Rn.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},Rn.prototype.toString=function(){return this.sa!==null?"MapIterator@"+this.sa:"MapIterator"},fn.Object.defineProperties(Rn.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Rn.prototype.first=Rn.prototype.first,Rn.prototype.hasNext=Rn.prototype.Ad,Rn.prototype.next=Rn.prototype.next,Rn.prototype.reset=Rn.prototype.reset,Rn.className="MapIterator";function Rt(a){Er(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"&&at("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}be=Rt.prototype,be.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return this._isFrozen=!1,this},be.toString=function(){return"Map()#"+wr(this)},be.add=function(a,y){this._isFrozen&&Bt(this,a);var x=a;Qt(a)&&(x=Do(a));var E=this.Tb[x];return E===void 0?(this.Sb++,a=new Yt(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},be.set=function(a,y){return this.add(a,y)},be.addAll=function(a){if(a===null)return this;if(jt(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 Rt)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},be.first=function(){return this.ea},Rt.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},Rt.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},Rt.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y),y=y.va;return this},Rt.prototype.map=function(a){for(var y=new Rt,x=this.ea;x!==null;)y.add(x.key,a(x)),x=x.va;return y},Rt.prototype.filter=function(a){for(var y=new Rt,x=this.ea;x!==null;)a(x)&&y.add(x.key,x.value),x=x.va;return y},be=Rt.prototype,be.contains=function(a){var y=a;return Qt(a)&&(y=wr(a),y===void 0)?!1:this.Tb[y]!==void 0},be.has=function(a){return this.contains(a)},be.I=function(a){var y=a;return Qt(a)&&(y=wr(a),y===void 0)?null:(a=this.Tb[y],a===void 0?null:a.value)},be.get=function(a){return this.I(a)},be.remove=function(a){if(a===null)return!1;this._isFrozen&&Bt(this,a);var y=a;if(Qt(a)&&(y=wr(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},be.delete=function(a){return this.remove(a)},be.clear=function(){this._isFrozen&&Bt(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()},Rt.prototype.copy=function(){var a=new Rt,y=this.Tb,x;for(x in y){var E=y[x];a.add(E.key,E.value)}return a},Rt.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 Yt(b.key,b.value),x++}return y},Rt.prototype.Lf=function(){return new ro(this)},fn.Object.defineProperties(Rt.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return mo;var a=this.Sa;return a!==null?(a.reset(),a):new Rn(this)}},iteratorKeys:{get:function(){return 0>=this.count?mo:new To(this)}},iteratorValues:{get:function(){if(0>=this.count)return mo;var a=this.jf;return a!==null?(a.reset(),a):new fa(this)}}}),Rt.prototype.toKeySet=Rt.prototype.Lf,Rt.prototype.toArray=Rt.prototype.Fa,Rt.prototype.clear=Rt.prototype.clear,Rt.prototype.delete=Rt.prototype.delete,Rt.prototype.remove=Rt.prototype.remove,Rt.prototype.get=Rt.prototype.get,Rt.prototype.getValue=Rt.prototype.I,Rt.prototype.has=Rt.prototype.has,Rt.prototype.contains=Rt.prototype.contains,Rt.prototype.first=Rt.prototype.first,Rt.prototype.addAll=Rt.prototype.addAll,Rt.prototype.set=Rt.prototype.set,Rt.prototype.add=Rt.prototype.add,Rt.prototype.thaw=Rt.prototype.ka,Rt.prototype.freeze=Rt.prototype.freeze,Rt.className="Map";function Ie(a,y){a===void 0?this.y=this.x=0:typeof a=="number"&&typeof y=="number"?(this.x=a,this.y=y):at("Invalid arguments to Point constructor: "+a+", "+y),this._isFrozen=!1}var qn,Ci,Oi,qi,zi;Ie.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this},Ie.prototype.h=function(a,y){return this.x=a,this.y=y,this},Ie.prototype.sg=function(a,y){return this.x=a,this.y=y,this},Ie.prototype.set=function(a){return this.x=a.x,this.y=a.y,this},Ie.prototype.copy=function(){var a=new Ie;return a.x=this.x,a.y=this.y,a},be=Ie.prototype,be.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},be.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return Object.isFrozen(this)&&at("cannot thaw constant: "+this),this._isFrozen=!1,this};function Nn(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 Ie(x,b)}return new Ie}function pi(a){return a.x.toString()+" "+a.y.toString()}be.toString=function(){return"Point("+this.x+","+this.y+")"},be.D=function(a){return a instanceof Ie?this.x===a.x&&this.y===a.y:!1},be.hi=function(a,y){return this.x===a&&this.y===y},be.Xa=function(a){return Re.B(this.x,a.x)&&Re.B(this.y,a.y)},be.add=function(a){return this.x+=a.x,this.y+=a.y,this},be.re=function(a){return this.x-=a.x,this.y-=a.y,this},be.offset=function(a,y){return this.x+=a,this.y+=y,this},Ie.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},be=Ie.prototype,be.scale=function(a,y){return this.x*=a,this.y*=y,this},be.Bf=function(a){var y=a.x-this.x;return a=a.y-this.y,y*y+a*a},be.zd=function(a,y){return a-=this.x,y-=this.y,a*a+y*y},be.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},be.ab=function(a){return vi(a.x-this.x,a.y-this.y)},be.direction=function(a,y){return vi(a-this.x,y-this.y)};function vi(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}be.Ry=function(a,y){return Re.Fl(a.x,a.y,y.x,y.y,this.x,this.y)},be.fA=function(a,y,x,E){return Re.qh(a,y,x,E,this.x,this.y,this),this},be.gA=function(a,y){return Re.qh(a.x,a.y,y.x,y.y,this.x,this.y,this),this},be.uA=function(a,y,x,E){return Re.No(this.x,this.y,a,y,x,E,this),this},be.vA=function(a,y){return Re.No(this.x,this.y,a.x,a.y,y.width,y.height,this),this},be.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},be.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},be.transform=function(a){return a.Ga(this),this};function ti(a,y){return y.Cd(a),a}function ui(a,y,x,E,b,z){var ee=b-x,re=z-E,oe=ee*ee+re*re;x-=a,E-=y;var ue=-x*ee-E*re;return 0>=ue||ue>=oe?(ee=b-a,re=z-y,Math.min(x*x+E*E,ee*ee+re*re)):(a=ee*E-re*x,a*a/oe)}function hi(a,y,x,E){return a=x-a,y=E-y,a*a+y*y}function Ti(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)}be.w=function(){return isFinite(this.x)&&isFinite(this.y)},Ie.alloc=function(){var a=Yi.pop();return a===void 0?new Ie:a},Ie.allocAt=function(a,y){var x=Yi.pop();return x===void 0?new Ie(a,y):(x.x=a,x.y=y,x)},Ie.free=function(a){Yi.push(a)},Ie.prototype.isReal=Ie.prototype.w,Ie.prototype.setSpot=Ie.prototype.yi,Ie.prototype.setRectSpot=Ie.prototype.xi,Ie.prototype.snapToGridPoint=Ie.prototype.vA,Ie.prototype.snapToGrid=Ie.prototype.uA,Ie.prototype.projectOntoLineSegmentPoint=Ie.prototype.gA,Ie.prototype.projectOntoLineSegment=Ie.prototype.fA,Ie.intersectingLineSegments=function(a,y,x,E,b,z,ee,re){return Re.Rl(a,y,x,E,b,z,ee,re)},Ie.prototype.compareWithLineSegmentPoint=Ie.prototype.Ry,Ie.compareWithLineSegment=function(a,y,x,E,b,z){return Re.Fl(a,y,x,E,b,z)},Ie.prototype.direction=Ie.prototype.direction,Ie.prototype.directionPoint=Ie.prototype.ab,Ie.prototype.normalize=Ie.prototype.normalize,Ie.prototype.distanceSquared=Ie.prototype.zd,Ie.prototype.distanceSquaredPoint=Ie.prototype.Bf,Ie.prototype.scale=Ie.prototype.scale,Ie.prototype.rotate=Ie.prototype.rotate,Ie.prototype.offset=Ie.prototype.offset,Ie.prototype.subtract=Ie.prototype.re,Ie.prototype.add=Ie.prototype.add,Ie.prototype.equalsApprox=Ie.prototype.Xa,Ie.prototype.equalTo=Ie.prototype.hi,Ie.prototype.equals=Ie.prototype.D,Ie.prototype.set=Ie.prototype.set,Ie.prototype.setTo=Ie.prototype.sg;var Yi=[];Ie.className="Point",Ie.parse=Nn,Ie.stringify=pi,Ie.distanceLineSegmentSquared=ui,Ie.distanceSquared=hi,Ie.direction=Ti,Ie.Origin=qn=new Ie(0,0).ja(),Ie.InfiniteTopLeft=Ci=new Ie(-1/0,-1/0).ja(),Ie.InfiniteBottomRight=Oi=new Ie(1/0,1/0).ja(),Ie.SixPoint=qi=new Ie(6,6).ja(),Ie.NoPoint=zi=new Ie(NaN,NaN).ja(),Ie.parse=Nn,Ie.stringify=pi,Ie.distanceLineSegmentSquared=ui,Ie.distanceSquared=hi,Ie.direction=Ti;function Pn(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):at("Invalid arguments to Size constructor: "+a+", "+y),this._isFrozen=!1}var Rr,cr,Mo,Wr,Vo,Wo,ua;Pn.prototype.assign=function(a){return this.width=a.width,this.height=a.height,this},Pn.prototype.h=function(a,y){return this.width=a,this.height=y,this},Pn.prototype.sg=function(a,y){return this.width=a,this.height=y,this},Pn.prototype.set=function(a){return this.width=a.width,this.height=a.height,this},Pn.prototype.copy=function(){var a=new Pn;return a.width=this.width,a.height=this.height,a},be=Pn.prototype,be.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},be.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return Object.isFrozen(this)&&at("cannot thaw constant: "+this),this._isFrozen=!1,this};function Xo(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 Pn(x,b)}return new Pn}function aa(a){return a.width.toString()+" "+a.height.toString()}be.toString=function(){return"Size("+this.width+","+this.height+")"},be.D=function(a){return a instanceof Pn?this.width===a.width&&this.height===a.height:!1},be.hi=function(a,y){return this.width===a&&this.height===y},be.Xa=function(a){return Re.B(this.width,a.width)&&Re.B(this.height,a.height)},be.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},be.w=function(){return isFinite(this.width)&&isFinite(this.height)},Pn.alloc=function(){var a=Pa.pop();return a===void 0?new Pn:a},Pn.free=function(a){Pa.push(a)},Pn.prototype.isReal=Pn.prototype.w,Pn.prototype.inflate=Pn.prototype.Bc,Pn.prototype.equalsApprox=Pn.prototype.Xa,Pn.prototype.equalTo=Pn.prototype.hi,Pn.prototype.equals=Pn.prototype.D,Pn.prototype.set=Pn.prototype.set,Pn.prototype.setTo=Pn.prototype.sg;var Pa=[];Pn.className="Size",Pn.parse=Xo,Pn.stringify=aa,Pn.ZeroSize=Rr=new Pn(0,0).ja(),Pn.OneSize=cr=new Pn(1,1).ja(),Pn.SixSize=Mo=new Pn(6,6).ja(),Pn.EightSize=Wr=new Pn(8,8).ja(),Pn.TenSize=Vo=new Pn(10,10).ja(),Pn.InfiniteSize=Wo=new Pn(1/0,1/0).ja(),Pn.NoSize=ua=new Pn(NaN,NaN).ja(),Pn.parse=Xo,Pn.stringify=aa;function Gt(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 Ie?(x=a.x,a=a.y,y instanceof Ie?(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 Pn?(this.x=x,this.y=a,this.width=y.width,this.height=y.height):at("Incorrect second argument supplied to Rect constructor "+y)):at("Invalid arguments to Rect constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}be=Gt.prototype,be.assign=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},be.h=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this};function qo(a,y,x){a.width=y,a.height=x}be.sg=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this},be.set=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},be.dd=function(a){return this.x=a.x,this.y=a.y,this},be.tA=function(a){return this.width=a.width,this.height=a.height,this},Gt.prototype.copy=function(){var a=new Gt;return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},be=Gt.prototype,be.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},be.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return Object.isFrozen(this)&&at("cannot thaw constant: "+this),this._isFrozen=!1,this};function fr(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 ee=0;a[y]==="";)y++;return(E=a[y++])&&(ee=parseFloat(E)),new Gt(x,b,z,ee)}return new Gt}function ao(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}be.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},be.D=function(a){return a instanceof Gt?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1},be.hi=function(a,y,x,E){return this.x===a&&this.y===y&&this.width===x&&this.height===E},be.Xa=function(a){return Re.B(this.x,a.x)&&Re.B(this.y,a.y)&&Re.B(this.width,a.width)&&Re.B(this.height,a.height)};function zr(a,y){return Re.$(a.x,y.x)&&Re.$(a.y,y.y)&&Re.$(a.width,y.width)&&Re.$(a.height,y.height)}be.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y},be.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},be.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},be.offset=function(a,y){return this.x+=a,this.y+=y,this},be.Bc=function(a,y){return Jo(this,y,a,y,a)},be.Co=function(a){return Jo(this,a.top,a.right,a.bottom,a.left)},be.Fv=function(a){return Jo(this,-a.top,-a.right,-a.bottom,-a.left)},be.Hz=function(a,y,x,E){return Jo(this,a,y,x,E)};function Jo(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}be.Ex=function(a){return va(this,a.x,a.y,a.width,a.height)},be.Uu=function(a,y,x,E){return va(this,a,y,x,E)};function va(a,y,x,E,b){var z=Math.max(a.x,y),ee=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=ee,a.width=Math.max(0,y-z),a.height=Math.max(0,x-ee),a}be.Yc=function(a){return this.Vu(a.x,a.y,a.width,a.height)},be.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 ma(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))}be.Ye=function(a){return ko(this,a.x,a.y,0,0)},be.ed=function(a){return ko(this,a.x,a.y,a.width,a.height)},be.Kv=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),ko(this,a,y,x,E)};function ko(a,y,x,E,b){var z=Math.min(a.x,y),ee=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=ee,a.width=y-z,a.height=x-ee,a}be.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 So(a,y,x,E,b,z,ee,re){return ee===void 0&&(ee=0),re===void 0&&(re=0),a<=b&&b+ee<=a+x&&y<=z&&z+re<=y+E}function $a(a,y,x,E,b,z,ee,re){return a>ee+b||b>x+a?!1:!(y>re+z||z>E+y)}be.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},be.Mz=function(){return this.width===0&&this.height===0},Gt.alloc=function(){var a=ps.pop();return a===void 0?new Gt:a},Gt.allocAt=function(a,y,x,E){var b=ps.pop();return b===void 0?new Gt(a,y,x,E):b.h(a,y,x,E)},Gt.free=function(a){ps.push(a)},fn.Object.defineProperties(Gt.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 Ie(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}},size:{get:function(){return new Pn(this.width,this.height)},set:function(a){this.width=a.width,this.height=a.height}},center:{get:function(){return new Ie(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}}}),Gt.prototype.isEmpty=Gt.prototype.Mz,Gt.prototype.isReal=Gt.prototype.w,Gt.intersectsLineSegment=function(a,y,x,E,b,z,ee,re){return Re.Fx(a,y,x,E,b,z,ee,re)},Gt.prototype.setSpot=Gt.prototype.yi,Gt.prototype.union=Gt.prototype.Kv,Gt.prototype.unionRect=Gt.prototype.ed,Gt.prototype.unionPoint=Gt.prototype.Ye,Gt.prototype.intersects=Gt.prototype.Vu,Gt.prototype.intersectsRect=Gt.prototype.Yc,Gt.prototype.intersect=Gt.prototype.Uu,Gt.prototype.intersectRect=Gt.prototype.Ex,Gt.prototype.grow=Gt.prototype.Hz,Gt.prototype.subtractMargin=Gt.prototype.Fv,Gt.prototype.addMargin=Gt.prototype.Co,Gt.prototype.inflate=Gt.prototype.Bc,Gt.prototype.offset=Gt.prototype.offset,Gt.prototype.contains=Gt.prototype.contains,Gt.prototype.containsRect=Gt.prototype.Re,Gt.prototype.containsPoint=Gt.prototype.ca,Gt.prototype.equalsApprox=Gt.prototype.Xa,Gt.prototype.equalTo=Gt.prototype.hi,Gt.prototype.equals=Gt.prototype.D,Gt.prototype.setSize=Gt.prototype.tA,Gt.prototype.setPoint=Gt.prototype.dd,Gt.prototype.set=Gt.prototype.set,Gt.prototype.setTo=Gt.prototype.sg;var gs=null,ls=null,ps=[];Gt.className="Rect",Gt.parse=fr,Gt.stringify=ao,Gt.contains=So,Gt.intersects=$a,Gt.ZeroRect=gs=new Gt(0,0,0,0).ja(),Gt.NoRect=ls=new Gt(NaN,NaN,NaN,NaN).ja(),Gt.parse=fr,Gt.stringify=ao,Gt.contains=So,Gt.intersects=$a;function $r(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):at("Invalid arguments to Margin constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}$r.prototype.assign=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},$r.prototype.sg=function(a,y,x,E){return this.top=a,this.right=y,this.bottom=x,this.left=E,this},$r.prototype.set=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},$r.prototype.copy=function(){var a=new $r;return a.top=this.top,a.right=this.right,a.bottom=this.bottom,a.left=this.left,a},be=$r.prototype,be.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},be.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return Object.isFrozen(this)&&at("cannot thaw constant: "+this),this._isFrozen=!1,this};function Ka(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 $r;for(var b=NaN;a[y]==="";)y++;if((E=a[y++])&&(b=parseFloat(E)),isNaN(b))return new $r(x);for(var z=NaN;a[y]==="";)y++;if((E=a[y++])&&(z=parseFloat(E)),isNaN(z))return new $r(x,b);for(var ee=NaN;a[y]==="";)y++;return(E=a[y++])&&(ee=parseFloat(E)),isNaN(ee)?new $r(x,b):new $r(x,b,z,ee)}return new $r}function Ma(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}be.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},be.D=function(a){return a instanceof $r?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1},be.hi=function(a,y,x,E){return this.top===a&&this.right===y&&this.bottom===x&&this.left===E},be.Xa=function(a){return Re.B(this.top,a.top)&&Re.B(this.right,a.right)&&Re.B(this.bottom,a.bottom)&&Re.B(this.left,a.left)},be.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},$r.alloc=function(){var a=ts.pop();return a===void 0?new $r:a},$r.free=function(a){ts.push(a)},$r.prototype.isReal=$r.prototype.w,$r.prototype.equalsApprox=$r.prototype.Xa,$r.prototype.equalTo=$r.prototype.hi,$r.prototype.equals=$r.prototype.D,$r.prototype.set=$r.prototype.set,$r.prototype.setTo=$r.prototype.sg;var ns=null,qa=null,ts=[];$r.className="Margin",$r.parse=Ka,$r.stringify=Ma,$r.ZeroMargin=ns=new $r(0,0,0,0).ja(),$r.TwoMargin=qa=new $r(2,2,2,2).ja(),$r.parse=Ka,$r.stringify=Ma;function Xi(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 Xr,Co,Zo,Ko,ba,Kr,Rs,Za,nn,Ht,Fn,Wi,Si,_i,Pi,Ln,oi,ur,Nr,yo,ea,La,ga,bo,Dr,or,ta,sa,Ta,Ga,Oo,pa,Lo,Ir,Ba,ra;Xi.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},Xi.prototype.sg=function(a,y,x,E){return this.x=a,this.y=y,this.offsetX=x,this.offsetY=E,this},Xi.prototype.set=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},Xi.prototype.copy=function(){var a=new Xi;return a.x=this.x,a.y=this.y,a.offsetX=this.offsetX,a.offsetY=this.offsetY,a},be=Xi.prototype,be.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},be.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return Object.isFrozen(this)&&at("cannot thaw constant: "+this),this._isFrozen=!1,this};function Uo(a,y){return a.x=NaN,a.y=NaN,a.offsetX=y,a}function _o(a){if(typeof a=="string"){if(a=a.trim(),a==="None")return Xr;if(a==="TopLeft")return Co;if(a==="Top"||a==="TopCenter"||a==="MiddleTop")return Zo;if(a==="TopRight")return Ko;if(a==="Left"||a==="LeftCenter"||a==="MiddleLeft")return ba;if(a==="Center")return Kr;if(a==="Right"||a==="RightCenter"||a==="MiddleRight")return Rs;if(a==="BottomLeft")return Za;if(a==="Bottom"||a==="BottomCenter"||a==="MiddleBottom")return nn;if(a==="BottomRight")return Ht;if(a==="TopSide")return Fn;if(a==="LeftSide")return Wi;if(a==="RightSide")return Si;if(a==="BottomSide")return _i;if(a==="TopBottomSides")return Pi;if(a==="LeftRightSides")return Ln;if(a==="TopLeftSides")return oi;if(a==="TopRightSides")return ur;if(a==="BottomLeftSides")return Nr;if(a==="BottomRightSides")return yo;if(a==="NotTopSide")return ea;if(a==="NotLeftSide")return La;if(a==="NotRightSide")return ga;if(a==="NotBottomSide")return bo;if(a==="AllSides")return Dr;if(a==="Default")return or;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 ee=0;a[y]==="";)y++;return E=a[y++],E!==void 0&&0<E.length&&(ee=parseFloat(E)),new Xi(x,b,z,ee)}return new Xi}function oa(a){return a.sb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()}be.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(Xr)?"None":this.D(Co)?"TopLeft":this.D(Zo)?"Top":this.D(Ko)?"TopRight":this.D(ba)?"Left":this.D(Kr)?"Center":this.D(Rs)?"Right":this.D(Za)?"BottomLeft":this.D(nn)?"Bottom":this.D(Ht)?"BottomRight":this.D(Fn)?"TopSide":this.D(Wi)?"LeftSide":this.D(Si)?"RightSide":this.D(_i)?"BottomSide":this.D(Pi)?"TopBottomSides":this.D(Ln)?"LeftRightSides":this.D(oi)?"TopLeftSides":this.D(ur)?"TopRightSides":this.D(Nr)?"BottomLeftSides":this.D(yo)?"BottomRightSides":this.D(ea)?"NotTopSide":this.D(La)?"NotLeftSide":this.D(ga)?"NotRightSide":this.D(bo)?"NotBottomSide":this.D(Dr)?"AllSides":this.D(or)?"Default":"None"},be.D=function(a){return a instanceof Xi?(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},be.gv=function(){return new Xi(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},be.Hf=function(a){if(!this.$c())return!1;if(!a.$c())if(a.D(ta))a=Wi;else if(a.D(sa))a=Si;else if(a.D(Ta))a=Fn;else if(a.D(Ga))a=_i;else return!1;return a=a.offsetY,(this.offsetY&a)===a},be.sb=function(){return!isNaN(this.x)&&!isNaN(this.y)},be.Mc=function(){return isNaN(this.x)||isNaN(this.y)},be.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0},be.ys=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0},be.Xb=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0},Xi.alloc=function(){var a=Ua.pop();return a===void 0?new Xi:a},Xi.free=function(a){Ua.push(a)},Xi.prototype.isDefault=Xi.prototype.Xb,Xi.prototype.isNone=Xi.prototype.ys,Xi.prototype.isSide=Xi.prototype.$c,Xi.prototype.isNoSpot=Xi.prototype.Mc,Xi.prototype.isSpot=Xi.prototype.sb,Xi.prototype.includesSide=Xi.prototype.Hf,Xi.prototype.opposite=Xi.prototype.gv,Xi.prototype.equals=Xi.prototype.D,Xi.prototype.set=Xi.prototype.set,Xi.prototype.setTo=Xi.prototype.sg;var Ua=[];Xi.className="Spot",Xi.parse=_o,Xi.stringify=oa,Xi.None=Xr=Uo(new Xi(0,0,0,0),0).ja(),Xi.Default=or=Uo(new Xi(0,0,-1,0),-1).ja(),Xi.TopLeft=Co=new Xi(0,0,0,0).ja(),Xi.TopCenter=Zo=new Xi(.5,0,0,0).ja(),Xi.TopRight=Ko=new Xi(1,0,0,0).ja(),Xi.LeftCenter=ba=new Xi(0,.5,0,0).ja(),Xi.Center=Kr=new Xi(.5,.5,0,0).ja(),Xi.RightCenter=Rs=new Xi(1,.5,0,0).ja(),Xi.BottomLeft=Za=new Xi(0,1,0,0).ja(),Xi.BottomCenter=nn=new Xi(.5,1,0,0).ja(),Xi.BottomRight=Ht=new Xi(1,1,0,0).ja(),Xi.MiddleTop=Oo=Zo,Xi.MiddleLeft=pa=ba,Xi.MiddleRight=Lo=Rs,Xi.MiddleBottom=Ir=nn,Xi.Top=Ta=Zo,Xi.Left=ta=ba,Xi.Right=sa=Rs,Xi.Bottom=Ga=nn,Xi.TopSide=Fn=Uo(new Xi(0,0,1,1),1).ja(),Xi.LeftSide=Wi=Uo(new Xi(0,0,1,2),1).ja(),Xi.RightSide=Si=Uo(new Xi(0,0,1,4),1).ja(),Xi.BottomSide=_i=Uo(new Xi(0,0,1,8),1).ja(),Xi.TopBottomSides=Pi=Uo(new Xi(0,0,1,9),1).ja(),Xi.LeftRightSides=Ln=Uo(new Xi(0,0,1,6),1).ja(),Xi.TopLeftSides=oi=Uo(new Xi(0,0,1,3),1).ja(),Xi.TopRightSides=ur=Uo(new Xi(0,0,1,5),1).ja(),Xi.BottomLeftSides=Nr=Uo(new Xi(0,0,1,10),1).ja(),Xi.BottomRightSides=yo=Uo(new Xi(0,0,1,12),1).ja(),Xi.NotTopSide=ea=Uo(new Xi(0,0,1,14),1).ja(),Xi.NotLeftSide=La=Uo(new Xi(0,0,1,13),1).ja(),Xi.NotRightSide=ga=Uo(new Xi(0,0,1,11),1).ja(),Xi.NotBottomSide=bo=Uo(new Xi(0,0,1,7),1).ja(),Xi.AllSides=Dr=Uo(new Xi(0,0,1,15),1).ja(),Ba=new Xi(.156,.156).ja(),ra=new Xi(.844,.844).ja(),Xi.parse=_o,Xi.stringify=oa;function pt(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}pt.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},pt.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},pt.prototype.copy=function(){var a=new pt;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},pt.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},pt.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},pt.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},pt.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},pt.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},pt.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,ee=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*ee+this.m21*a+this.dx,this.dy=this.m12*ee+this.m22*a+this.dy,this.m11=y,this.m12=x,this.m21=E,this.m22=b,this},pt.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},pt.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,ee=this.m12*-E+this.m22*a;return this.m11=this.m11*a+this.m21*E,this.m12=b,this.m21=z,this.m22=ee,this.translate(-y,-x),this},be=pt.prototype,be.translate=function(a,y){return this.dx+=this.m11*a+this.m21*y,this.dy+=this.m12*a+this.m22*y,this},be.scale=function(a,y){return y===void 0&&(y=a),this.m11*=a,this.m12*=a,this.m21*=y,this.m22*=y,this},be.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)},be.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))},be.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))},be.pp=function(a){var y=a.x,x=a.y,E=y+a.width,b=x+a.height,z=this.m11,ee=this.m12,re=this.m21,oe=this.m22,ue=this.dx,he=this.dy,pe=y*z+x*re+ue,Se=y*ee+x*oe+he,Pe=E*z+x*re+ue,Fe=E*ee+x*oe+he;return x=y*z+b*re+ue,y=y*ee+b*oe+he,z=E*z+b*re+ue,E=E*ee+b*oe+he,b=Math.min(pe,Pe),pe=Math.max(pe,Pe),Pe=Math.min(Se,Fe),Se=Math.max(Se,Fe),b=Math.min(b,x),pe=Math.max(pe,x),Pe=Math.min(Pe,y),Se=Math.max(Se,y),b=Math.min(b,z),pe=Math.max(pe,z),Pe=Math.min(Pe,E),Se=Math.max(Se,E),a.h(b,Pe,pe-b,Se-Pe),a},pt.alloc=function(){var a=Ut.pop();return a===void 0?new pt:a},pt.free=function(a){Ut.push(a)},pt.prototype.transformRect=pt.prototype.pp,pt.prototype.transformPoint=pt.prototype.Ga,pt.prototype.scale=pt.prototype.scale,pt.prototype.translate=pt.prototype.translate,pt.prototype.rotate=pt.prototype.rotate,pt.prototype.invert=pt.prototype.Vj,pt.prototype.multiplyInverted=pt.prototype.bv,pt.prototype.multiply=pt.prototype.multiply,pt.prototype.reset=pt.prototype.reset,pt.prototype.isIdentity=pt.prototype.ws,pt.prototype.equals=pt.prototype.D,pt.prototype.setTransform=pt.prototype.setTransform,pt.prototype.set=pt.prototype.set;var Ut=[];pt.className="Transform",pt.xF="54a702f3e53909c447824c6706603faf4c";var Re={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(a){if(0>=a)return 0;var y=Re.Uv;if(y===null){y=[];for(var x=0;2e3>=x;x++)y[x]=Math.sqrt(x);Re.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,ee){if(0>=b&&(b=1e-6),a<x)var re=a,oe=x;else re=x,oe=a;if(y<E)var ue=y,he=E;else ue=E,he=y;if(a===x)return ue<=ee&&ee<=he&&a-b<=z&&z<=a+b;if(y===E)return re<=z&&z<=oe&&y-b<=ee&&ee<=y+b;if(oe+=b,re-=b,re<=z&&z<=oe&&(he+=b,ue-=b,ue<=ee&&ee<=he))if(oe-re>he-ue)if(a-x>b||x-a>b){if(z=(E-y)/(x-a)*(z-a)+y,z-b<=ee&&ee<=z+b)return!0}else return!0;else if(y-E>b||E-y>b){if(ee=(x-a)/(E-y)*(ee-y)+a,ee-b<=z&&z<=ee+b)return!0}else return!0;return!1},cs:function(a,y,x,E,b,z,ee,re,oe,ue,he,pe){if(Re.Yb(a,y,ee,re,pe,x,E)&&Re.Yb(a,y,ee,re,pe,b,z))return Re.Yb(a,y,ee,re,pe,ue,he);var Se=(a+x)/2,Pe=(y+E)/2,Fe=(x+b)/2,Ne=(E+z)/2;b=(b+ee)/2,z=(z+re)/2,E=(Se+Fe)/2,x=(Pe+Ne)/2,Fe=(Fe+b)/2,Ne=(Ne+z)/2;var Xe=(E+Fe)/2,Ve=(x+Ne)/2;return Re.cs(a,y,Se,Pe,E,x,Xe,Ve,oe,ue,he,pe)||Re.cs(Xe,Ve,Fe,Ne,b,z,ee,re,oe,ue,he,pe)},ax:function(a,y,x,E,b,z,ee,re,oe){var ue=(x+b)/2,he=(E+z)/2;return oe.h((((a+x)/2+ue)/2+(ue+(b+ee)/2)/2)/2,(((y+E)/2+he)/2+(he+(z+re)/2)/2)/2),oe},My:function(a,y,x,E,b,z,ee,re){var oe=(x+b)/2,ue=(E+z)/2;return Ti(((a+x)/2+oe)/2,((y+E)/2+ue)/2,(oe+(b+ee)/2)/2,(ue+(z+re)/2)/2)},Dl:function(a,y,x,E,b,z,ee,re,oe,ue){if(Re.Yb(a,y,ee,re,oe,x,E)&&Re.Yb(a,y,ee,re,oe,b,z))ko(ue,a,y,0,0),ko(ue,ee,re,0,0);else{var he=(a+x)/2,pe=(y+E)/2,Se=(x+b)/2,Pe=(E+z)/2;b=(b+ee)/2,z=(z+re)/2,E=(he+Se)/2,x=(pe+Pe)/2,Se=(Se+b)/2,Pe=(Pe+z)/2;var Fe=(E+Se)/2,Ne=(x+Pe)/2;Re.Dl(a,y,he,pe,E,x,Fe,Ne,oe,ue),Re.Dl(Fe,Ne,Se,Pe,b,z,ee,re,oe,ue)}return ue},Qe:function(a,y,x,E,b,z,ee,re,oe,ue){if(Re.Yb(a,y,ee,re,oe,x,E)&&Re.Yb(a,y,ee,re,oe,b,z))ue.length===0&&(ue.push(a),ue.push(y)),ue.push(ee),ue.push(re);else{var he=(a+x)/2,pe=(y+E)/2,Se=(x+b)/2,Pe=(E+z)/2;b=(b+ee)/2,z=(z+re)/2,E=(he+Se)/2,x=(pe+Pe)/2,Se=(Se+b)/2,Pe=(Pe+z)/2;var Fe=(E+Se)/2,Ne=(x+Pe)/2;Re.Qe(a,y,he,pe,E,x,Fe,Ne,oe,ue),Re.Qe(Fe,Ne,Se,Pe,b,z,ee,re,oe,ue)}return ue},jv:function(a,y,x,E,b,z,ee,re,oe,ue){if(Re.Yb(a,y,b,z,ue,x,E))return Re.Yb(a,y,b,z,ue,re,oe);var he=(a+x)/2,pe=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var Se=(he+x)/2,Pe=(pe+E)/2;return Re.jv(a,y,he,pe,Se,Pe,ee,re,oe,ue)||Re.jv(Se,Pe,x,E,b,z,ee,re,oe,ue)},OA:function(a,y,x,E,b,z,ee){return ee.h(((a+x)/2+(x+b)/2)/2,((y+E)/2+(E+z)/2)/2),ee},iv:function(a,y,x,E,b,z,ee,re){if(Re.Yb(a,y,b,z,ee,x,E))ko(re,a,y,0,0),ko(re,b,z,0,0);else{var oe=(a+x)/2,ue=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var he=(oe+x)/2,pe=(ue+E)/2;Re.iv(a,y,oe,ue,he,pe,ee,re),Re.iv(he,pe,x,E,b,z,ee,re)}return re},ep:function(a,y,x,E,b,z,ee,re){if(Re.Yb(a,y,b,z,ee,x,E))re.length===0&&(re.push(a),re.push(y)),re.push(b),re.push(z);else{var oe=(a+x)/2,ue=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var he=(oe+x)/2,pe=(ue+E)/2;Re.ep(a,y,oe,ue,he,pe,ee,re),Re.ep(he,pe,x,E,b,z,ee,re)}return re},Eo:function(a,y,x,E,b,z,ee,re,oe,ue,he,pe,Se,Pe){if(Re.Yb(a,y,ee,re,Se,x,E)&&Re.Yb(a,y,ee,re,Se,b,z))return!Re.Rl(a,y,ee,re,oe,ue,he,pe)||(Se=(a-ee)*(ue-pe)-(y-re)*(oe-he),Se===0)?!1:(Pe.h(((a*re-y*ee)*(oe-he)-(a-ee)*(oe*pe-ue*he))/Se,((a*re-y*ee)*(ue-pe)-(y-re)*(oe*pe-ue*he))/Se),!0);var Fe=(a+x)/2,Ne=(y+E)/2,Xe=(x+b)/2,Ve=(E+z)/2;b=(b+ee)/2,z=(z+re)/2,E=(Fe+Xe)/2,x=(Ne+Ve)/2,Xe=(Xe+b)/2,Ve=(Ve+z)/2;var ht=(E+Xe)/2,ft=(x+Ve)/2,mt=1/0,Ct=!1,Kt=0,yi=0;return Re.Eo(a,y,Fe,Ne,E,x,ht,ft,oe,ue,he,pe,Se,Pe)&&(a=(Pe.x-oe)*(Pe.x-oe)+(Pe.y-ue)*(Pe.y-ue),a<mt&&(mt=a,Ct=!0,Kt=Pe.x,yi=Pe.y)),Re.Eo(ht,ft,Xe,Ve,b,z,ee,re,oe,ue,he,pe,Se,Pe)&&(Pe.x-oe)*(Pe.x-oe)+(Pe.y-ue)*(Pe.y-ue)<mt&&(Ct=!0,Kt=Pe.x,yi=Pe.y),Ct&&(Pe.x=Kt,Pe.y=yi),Ct},Fo:function(a,y,x,E,b,z,ee,re,oe,ue,he,pe,Se){var Pe=0;if(Re.Yb(a,y,ee,re,Se,x,E)&&Re.Yb(a,y,ee,re,Se,b,z)){if(Se=(a-ee)*(ue-pe)-(y-re)*(oe-he),Se===0)return Pe;var Fe=((a*re-y*ee)*(oe-he)-(a-ee)*(oe*pe-ue*he))/Se,Ne=((a*re-y*ee)*(ue-pe)-(y-re)*(oe*pe-ue*he))/Se;if(Fe>=he)return Pe;if((oe>he?oe-he:he-oe)<(ue>pe?ue-pe:pe-ue)){if(y<re?(oe=y,a=re):(oe=re,a=y),Ne<oe||Ne>a)return Pe}else if(a<ee?(oe=a,a=ee):oe=ee,Fe<oe||Fe>a)return Pe;0<Se?Pe++:0>Se&&Pe--}else{Fe=(a+x)/2,Ne=(y+E)/2;var Xe=(x+b)/2,Ve=(E+z)/2;b=(b+ee)/2,z=(z+re)/2,E=(Fe+Xe)/2,x=(Ne+Ve)/2,Xe=(Xe+b)/2,Ve=(Ve+z)/2;var ht=(E+Xe)/2,ft=(x+Ve)/2;Pe+=Re.Fo(a,y,Fe,Ne,E,x,ht,ft,oe,ue,he,pe,Se),Pe+=Re.Fo(ht,ft,Xe,Ve,b,z,ee,re,oe,ue,he,pe,Se)}return Pe},qh:function(a,y,x,E,b,z,ee){return Re.$(a,x)?(y<E?(x=y,y=E):x=E,z<x?(ee.h(a,x),!1):z>y?(ee.h(a,y),!1):(ee.h(a,z),!0)):Re.$(y,E)?(a<x?(E=a,a=x):E=x,b<E?(ee.h(E,y),!1):b>a?(ee.h(a,y),!1):(ee.h(b,y),!0)):(b=((a-b)*(a-x)+(y-z)*(y-E))/((x-a)*(x-a)+(E-y)*(E-y)),-5e-6>b?(ee.h(a,y),!1):1.000005<b?(ee.h(x,E),!1):(ee.h(a+b*(x-a),y+b*(E-y)),!0))},Ve:function(a,y,x,E,b,z,ee,re,oe){return Re.B(a,x)&&Re.B(y,E)?(oe.h(a,y),!1):Re.$(b,ee)?Re.$(a,x)?(Re.qh(a,y,x,E,b,z,oe),!1):Re.qh(a,y,x,E,b,(E-y)/(x-a)*(b-a)+y,oe):(re=(re-z)/(ee-b),Re.$(a,x)?(x=re*(a-b)+z,y<E?(b=y,y=E):b=E,x<b?(oe.h(a,b),!1):x>y?(oe.h(a,y),!1):(oe.h(a,x),!0)):(ee=(E-y)/(x-a),Re.$(re,ee)?(Re.qh(a,y,x,E,b,z,oe),!1):(b=(ee*a-re*b+z-y)/(ee-re),Re.$(ee,0)?(a<x?(E=a,a=x):E=x,b<E?(oe.h(E,y),!1):b>a?(oe.h(a,y),!1):(oe.h(b,y),!0)):Re.qh(a,y,x,E,b,ee*(b-a)+y,oe))))},MA:function(a,y,x,E,b){return Re.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,ee,re,oe,ue){function he(Xe,Ve){var ht=(Xe-a)*(Xe-a)+(Ve-y)*(Ve-y);ht<pe&&(pe=ht,oe.h(Xe,Ve))}var pe=1/0;he(oe.x,oe.y);var Se=0,Pe=0,Fe=0,Ne=0;if(b<ee?(Se=b,Pe=ee):(Se=ee,Pe=b),z<re?(Fe=b,Ne=ee):(Fe=ee,Ne=b),Se=(Pe-Se)/2+ue,ue=(Ne-Fe)/2+ue,b=(b+ee)/2,z=(z+re)/2,Se===0||ue===0)return oe;if(.5>(x>a?x-a:a-x)){if(Se=1-(x-b)*(x-b)/(Se*Se),0>Se)return oe;Se=Math.sqrt(Se),E=-ue*Se+z,he(x,ue*Se+z),he(x,E)}else{if(x=(E-y)/(x-a),E=1/(Se*Se)+x*x/(ue*ue),re=2*x*(y-x*a)/(ue*ue)-2*x*z/(ue*ue)-2*b/(Se*Se),Se=re*re-4*E*(2*x*a*z/(ue*ue)-2*y*z/(ue*ue)+z*z/(ue*ue)+b*b/(Se*Se)-1+(y-x*a)*(y-x*a)/(ue*ue)),0>Se)return oe;Se=Math.sqrt(Se),ue=(-re+Se)/(2*E),he(ue,x*ue-x*a+y),Se=(-re-Se)/(2*E),he(Se,x*Se-x*a+y)}return oe},Ff:function(a,y,x,E,b,z,ee,re,oe){var ue=1e21,he=a,pe=y;if(Re.Ve(a,y,a,E,b,z,ee,re,oe)){var Se=(oe.x-b)*(oe.x-b)+(oe.y-z)*(oe.y-z);Se<ue&&(ue=Se,he=oe.x,pe=oe.y)}return Re.Ve(x,y,x,E,b,z,ee,re,oe)&&(Se=(oe.x-b)*(oe.x-b)+(oe.y-z)*(oe.y-z),Se<ue&&(ue=Se,he=oe.x,pe=oe.y)),Re.Ve(a,y,x,y,b,z,ee,re,oe)&&(y=(oe.x-b)*(oe.x-b)+(oe.y-z)*(oe.y-z),y<ue&&(ue=y,he=oe.x,pe=oe.y)),Re.Ve(a,E,x,E,b,z,ee,re,oe)&&(a=(oe.x-b)*(oe.x-b)+(oe.y-z)*(oe.y-z),a<ue&&(ue=a,he=oe.x,pe=oe.y)),oe.h(he,pe),1e21>ue},us:function(a,y,x){return Re.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,ee,re){var oe=a+x,ue=y+E;return b===ee?(z<re?(ee=z,z=re):ee=re,a<=b&&b<=oe&&ee<=ue&&z>=y):z===re?(b<ee?(re=b,b=ee):re=ee,y<=z&&z<=ue&&re<=oe&&b>=a):!!(So(a,y,x,E,b,z)||So(a,y,x,E,ee,re)||Re.Rl(a,y,oe,y,b,z,ee,re)||Re.Rl(oe,y,oe,ue,b,z,ee,re)||Re.Rl(oe,ue,a,ue,b,z,ee,re)||Re.Rl(a,ue,a,y,b,z,ee,re))},Rl:function(a,y,x,E,b,z,ee,re){return a===x&&y===E&&b===ee&&z===re?a===b&&y===z:0>=Re.Fl(a,y,x,E,b,z)*Re.Fl(a,y,x,E,ee,re)&&0>=Re.Fl(b,z,ee,re,a,y)*Re.Fl(b,z,ee,re,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 ee=Math.PI;z||(E*=ee/180,b*=ee/180);var re=E>b?-1:1;z=[];var oe=ee/2,ue=E;if(E=Math.min(2*ee,Math.abs(b-E)),1e-5>E)return oe=ue+re*Math.min(E,oe),re=a+x*Math.cos(ue),ue=y+x*Math.sin(ue),a+=x*Math.cos(oe),y+=x*Math.sin(oe),x=(re+a)/2,oe=(ue+y)/2,z.push([re,ue,x,oe,x,oe,a,y]),z;for(;1e-5<E;)b=ue+re*Math.min(E,oe),z.push(Re.Vy(x,ue,b,a,y)),E-=Math.abs(b-ue),ue=b;return z},Vy:function(a,y,x,E,b){var z=(x-y)/2,ee=a*Math.cos(z),re=a*Math.sin(z),oe=-re,ue=ee*ee+oe*oe,he=ue+ee*ee+oe*re;return ue=4/3*(Math.sqrt(2*ue*he)-he)/(ee*re-oe*ee),re=ee-ue*oe,ee=oe+ue*ee,oe=-ee,ue=z+y,z=Math.cos(ue),ue=Math.sin(ue),[E+a*Math.cos(y),b+a*Math.sin(y),E+re*z-ee*ue,b+re*ue+ee*z,E+re*z-oe*ue,b+re*ue+oe*z,E+a*Math.cos(x),b+a*Math.sin(x)]},No:function(a,y,x,E,b,z,ee){x=Math.floor((a-x)/b)*b+x,E=Math.floor((y-E)/z)*z+E;var re=x;return x+b-a<b/2&&(re=x+b),a=E,E+z-y<z/2&&(a=E+z),ee.h(re,a),ee},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 ee=1,re=0;else ee=0,re=1;var oe=ee===0?a:y,ue=ee===0?x:E;return(ee===0?b:z)&&(ue=-ue),ee=re,x=ee===0?x:E,(ee===0?b:z)&&(x=-x),Re.az(oe,ee===0?a:y,ue,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 ee=y*E,re=-z+ee,oe=-z+Math.sqrt(a*a+ee*ee);y=re;for(var ue=0;9999999999>ue&&(y=.5*(re+oe),!(y===re||y===oe));++ue){var he=a/(y+b),pe=ee/(y+z);if(he=he*he+pe*pe-1,0<he)re=y;else if(0>he)oe=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 Ri,um:new Ri,Mf:new Ri,Nf:0,vm:100};Re.za=Re.AA;function ut(a){Er(this),this.l=2,a===void 0&&(a=ut.o),this.na=a,this.Ec=this.Dc=this.pd=this.od=0,a===ut.o?this.ee=new Bn:(ut.V===null&&(ut.V=new Bn().freeze()),this.ee=ut.V),this.aq=this.ee.Ja,this.Ip=new Gt().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=Co,this.gg=Ht,this.Rk=this.Sk=NaN,this.Uf=jn}ut.prototype.copy=function(){var a=new ut;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===ut.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},ut.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},ut.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==ut.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},ut.prototype.ka=function(){if(Object.isFrozen(this)&&at("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==ut.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},ut.prototype.Xa=function(a){if(!(a instanceof ut))return!1;if(this.type!==a.type)return this.type===ut.j&&a.type===ut.o?dr(this,a):a.type===ut.j&&this.type===ut.o?dr(a,this):!1;if(this.type===ut.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 Re.B(this.startX,a.startX)&&Re.B(this.startY,a.startY)&&Re.B(this.endX,a.endX)&&Re.B(this.endY,a.endY)};function dr(a,y){return a.type!==ut.j||y.type!==ut.o?!1:!!(y.figures.count===1&&(y=y.figures.M(0),y.segments.count===1&&Re.B(a.startX,y.startX)&&Re.B(a.startY,y.startY)&&(y=y.segments.M(0),y.type===bi&&Re.B(a.endX,y.endX)&&Re.B(a.endY,y.endY))))}ut.ia=function(a){return a.toString()},ut.prototype.qb=function(a){a.classType===ut&&(this.type=a)},ut.prototype.toString=function(a){switch(a===void 0&&(a=-1),this.type){case ut.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 ut.u:var y=new Gt(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 ut.F:if(y=new Gt(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 ut.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()}},ut.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},ut.parse=function(a,y){function x(){return Ne>=mt-1?!0:ue[Ne+1].match(Ct)!==null}function E(){return Ne++,ue[Ne]}function b(to){var _r=parseFloat(E()),ia=parseFloat(E());Xe===Xe.toLowerCase()&&(_r=ft.x+_r,ia=ft.y+ia),to.h(_r,ia)}function z(){return b(ft),ft}function ee(){return b(ht),ht}function re(){var to=Ve.toLowerCase();return to!=="c"&&to!=="s"&&to!=="q"&&to!=="t"?ft:new Ie(2*ft.x-ht.x,2*ft.y-ht.y)}y===void 0&&(y=!1);var oe=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm;a=a.replace(/,/gm," "),a=a.replace(oe,"$1 $2"),a=a.replace(oe,"$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 ue=a.split(" ");for(a=0;a<ue.length;a++){var he=ue[a];if(he.match(/(\.[0-9]*)(\.)/gm)!==null){oe=xi();for(var pe="",Se=!1,Pe=0;Pe<he.length;Pe++){var Fe=he[Pe];Fe!=="."||Se?Fe==="."?(oe.push(pe),pe="."):pe+=Fe:(Se=!0,pe+=Fe)}for(oe.push(pe),ue.splice(a,1),he=0;he<oe.length;he++)ue.splice(a+he,0,oe[he]);a+=oe.length-1,Bi(oe)}}var Ne=-1,Xe="",Ve="";oe=new Ie(0,0);var ht=new Ie(0,0),ft=new Ie(0,0),mt=ue.length;a=A1(null),Se=pe=he=!1,Pe=!0,Fe=null;for(var Ct=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(Ne>=mt-1);)if(Ve=Xe,Xe=E(),Xe!=="")switch(Xe.toUpperCase()){case"X":Pe=!0,pe=he=!1;break;case"M":for(Fe=z(),a.mc===null||Pe===!0?(fp(a,Fe.x,Fe.y,he,!pe,Se),Pe=!1):a.moveTo(Fe.x,Fe.y),oe.assign(ft);!x();)Fe=z(),a.lineTo(Fe.x,Fe.y);break;case"L":for(;!x();)Fe=z(),a.lineTo(Fe.x,Fe.y);break;case"H":for(;!x();)ft=new Ie((Xe===Xe.toLowerCase()?ft.x:0)+parseFloat(E()),ft.y),a.lineTo(ft.x,ft.y);break;case"V":for(;!x();)ft=new Ie(ft.x,(Xe===Xe.toLowerCase()?ft.y:0)+parseFloat(E())),a.lineTo(ft.x,ft.y);break;case"C":for(;!x();){Fe=new Ie,b(Fe);var Kt=ee(),yi=z();tc(a,Fe.x,Fe.y,Kt.x,Kt.y,yi.x,yi.y)}break;case"S":for(;!x();)Fe=re(),Kt=ee(),yi=z(),tc(a,Fe.x,Fe.y,Kt.x,Kt.y,yi.x,yi.y);break;case"Q":for(;!x();)Fe=ee(),Kt=z(),u0(a,Fe.x,Fe.y,Kt.x,Kt.y);break;case"T":for(;!x();)ht=Fe=re(),Kt=z(),u0(a,Fe.x,Fe.y,Kt.x,Kt.y);break;case"B":for(;!x();){Fe=parseFloat(E()),Kt=parseFloat(E()),yi=parseFloat(E());var tr=parseFloat(E()),Zi=parseFloat(E()),Qn=Zi,bn=!1;x()||(Qn=parseFloat(E()),x()||(bn=parseFloat(E())!==0)),Xe===Xe.toLowerCase()&&(yi+=ft.x,tr+=ft.y),a.arcTo(Fe,Kt,yi,tr,Zi,Qn,bn)}break;case"A":for(;!x();)Fe=Math.abs(parseFloat(E())),Kt=Math.abs(parseFloat(E())),yi=parseFloat(E()),Zi=tr=!1,bn=Qn=0,Qn=E(),Qn.length===1?(tr=!!parseFloat(Qn),Zi=!!parseFloat(E()),Qn=parseFloat(E())):Qn.length===2?(tr=!!parseFloat(Qn[0]),Zi=!!parseFloat(Qn[1]),Qn=parseFloat(E())):(tr=!!parseFloat(Qn[0]),Zi=!!parseFloat(Qn[1]),Qn=parseFloat(Qn.slice(2))),bn=parseFloat(E()),Xe===Xe.toLowerCase()&&(Qn=ft.x+Qn,bn=ft.y+bn),ft.h(Qn,bn),PS(a,Fe,Kt,yi,tr,Zi,Qn,bn);break;case"Z":wS(a),ft.assign(oe);break;case"F":for(Fe="",Kt=1;ue[Ne+Kt];)if(ue[Ne+Kt]==="0")Se=!0,Kt++;else if(ue[Ne+Kt].match(/[Uu]/)!==null)Kt++;else if(ue[Ne+Kt].match(Ct)===null)Kt++;else{Fe=ue[Ne+Kt];break}Fe.match(/[Mm]/)?he=!0:0<a.mc.segments.length&&(a.mc.isFilled=!0);break;case"U":for(Fe="",Kt=1;ue[Ne+Kt];)if(ue[Ne+Kt].match(/[Ff]/)!==null)Kt++;else if(ue[Ne+Kt].match(Ct)===null)Kt++;else{Fe=ue[Ne+Kt];break}Fe.match(/[Mm]/)?pe=!0:a.mc.isShadowed=!1}if(oe=a.os,h0=a,y)for(y=oe.figures.iterator;y.next();)y.value.isFilled=!0;return oe},ut.Ha=function(a,y){for(var x=a.length,E=Ie.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}Ie.free(E)},ut.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===ut.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},ut.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===ut.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 ee=E[z];ee._isInvalidBounds=!1,ee.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),lr(this,a,!1),ko(a,0,0,0,0),a.freeze()},ut.prototype.ix=function(){var a=new Gt;return lr(this,a,!0),a};function lr(a,y,x){switch(a.type){case ut.j:case ut.u:case ut.F:x?y.h(a.od,a.pd,0,0):ko(y,a.od,a.pd,0,0),ko(y,a.Dc,a.Ec,0,0);break;case ut.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):ko(y,z.startX,z.startY,0,0);for(var ee=z.segments.s,re=ee.length,oe=z.startX,ue=z.startY,he=0;he<re;he++){var pe=ee[he];switch(pe.type){case bi:case Ei:oe=pe.endX,ue=pe.endY,ko(y,oe,ue,0,0);break;case Jr:Re.Dl(oe,ue,pe.point1X,pe.point1Y,pe.point2X,pe.point2Y,pe.endX,pe.endY,.5,y),oe=pe.endX,ue=pe.endY;break;case Ur:Re.iv(oe,ue,pe.point1X,pe.point1Y,pe.endX,pe.endY,.5,y),oe=pe.endX,ue=pe.endY;break;case Mr:case Fo:var Se=pe.type===Mr?Po(pe,z):Ki(pe,z,oe,ue),Pe=Se.length;if(Pe===0){oe=pe.type===Mr?pe.centerX:pe.endX,ue=pe.type===Mr?pe.centerY:pe.endY,ko(y,oe,ue,0,0);break}pe=null;for(var Fe=0;Fe<Pe;Fe++)pe=Se[Fe],Re.Dl(pe[0],pe[1],pe[2],pe[3],pe[4],pe[5],pe[6],pe[7],.5,y);pe!==null&&(oe=pe[6],ue=pe[7]);break;default:at("Unknown Segment type: "+pe.type)}}}break;default:at("Unknown Geometry type: "+a.type)}}ut.prototype.normalize=function(){this._isFrozen&&Bt(this);var a=this.ix();return this.offset(-a.x,-a.y),new Ie(-a.x,-a.y)},ut.prototype.offset=function(a,y){return this._isFrozen&&Bt(this),this.transform(1,0,0,1,a,y),this},ut.prototype.scale=function(a,y){return this._isFrozen&&Bt(this),this.transform(a,0,0,y,0,0),this},ut.prototype.rotate=function(a,y,x){this._isFrozen&&Bt(this),y===void 0&&(y=0),x===void 0&&(x=0);var E=pt.alloc();return E.reset(),E.rotate(a,y,x),this.transform(E.m11,E.m12,E.m21,E.m22,E.dx,E.dy),pt.free(E),this},be=ut.prototype,be.transform=function(a,y,x,E,b,z){switch(this.type){case ut.j:case ut.u:case ut.F:var ee=this.od,re=this.pd;this.od=ee*a+re*x+b,this.pd=ee*y+re*E+z,ee=this.Dc,re=this.Ec,this.Dc=ee*a+re*x+b,this.Ec=ee*y+re*E+z;break;case ut.o:for(var oe=this.figures.s,ue=oe.length,he=0;he<ue;he++){var pe=oe[he];ee=pe.startX,re=pe.startY,pe.startX=ee*a+re*x+b,pe.startY=ee*y+re*E+z,pe=pe.segments.s;for(var Se=pe.length,Pe=0;Pe<Se;Pe++){var Fe=pe[Pe];switch(Fe.type){case bi:case Ei:ee=Fe.endX,re=Fe.endY,Fe.endX=ee*a+re*x+b,Fe.endY=ee*y+re*E+z;break;case Jr:ee=Fe.point1X,re=Fe.point1Y,Fe.point1X=ee*a+re*x+b,Fe.point1Y=ee*y+re*E+z,ee=Fe.point2X,re=Fe.point2Y,Fe.point2X=ee*a+re*x+b,Fe.point2Y=ee*y+re*E+z,ee=Fe.endX,re=Fe.endY,Fe.endX=ee*a+re*x+b,Fe.endY=ee*y+re*E+z;break;case Ur:ee=Fe.point1X,re=Fe.point1Y,Fe.point1X=ee*a+re*x+b,Fe.point1Y=ee*y+re*E+z,ee=Fe.endX,re=Fe.endY,Fe.endX=ee*a+re*x+b,Fe.endY=ee*y+re*E+z;break;case Mr:ee=Fe.centerX,re=Fe.centerY,Fe.centerX=ee*a+re*x+b,Fe.centerY=ee*y+re*E+z,y!==0&&(ee=180*Math.atan2(y,a)/Math.PI,0>ee&&(ee+=360),Fe.startAngle+=ee),0>a&&(Fe.startAngle=180-Fe.startAngle,Fe.sweepAngle=-Fe.sweepAngle),0>E&&(Fe.startAngle=-Fe.startAngle,Fe.sweepAngle=-Fe.sweepAngle),Fe.radiusX*=Math.sqrt(a*a+x*x),Fe.radiusY!==void 0&&(Fe.radiusY*=Math.sqrt(y*y+E*E));break;case Fo:if(ee=Fe.endX,re=Fe.endY,Fe.endX=ee*a+re*x+b,Fe.endY=ee*y+re*E+z,Fe.radiusX===0||Fe.radiusY===0)break;y!==0&&(ee=180*Math.atan2(y,a)/Math.PI,0>ee&&(ee+=360),Fe.xAxisRotation+=ee),0>a&&(Fe.xAxisRotation=180-Fe.xAxisRotation,Fe.isClockwiseArc=!Fe.isClockwiseArc),0>E&&(Fe.xAxisRotation=-Fe.xAxisRotation,Fe.isClockwiseArc=!Fe.isClockwiseArc),Fe.radiusX*=Math.sqrt(a*a+x*x),Fe.radiusY*=Math.sqrt(y*y+E*E);break;default:at("Unknown Segment type: "+Fe.type)}}}}return this._isInvalidBounds=!0,this},be.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 ut.j:return Re.Yb(x,E,b,z,y,a.x,a.y);case ut.u:var ee=Gt.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=ee.ca(a),Gt.free(ee),a;case ut.F:ee=Math.min(x,b)-y;var re=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:(ee=a.x-(ee+x),re=a.y-(re+y),1>=ee*ee/(x*x)+re*re/(y*y));case ut.o:return gr(this,a,y,!0,!1);default:return!1}};function gr(a,y,x,E,b){var z=y.x;y=y.y;for(var ee=a.bounds.x-20,re=0,oe,ue,he,pe,Se=a.figures.s,Pe=Se.length,Fe=0;Fe<Pe;Fe++){var Ne=Se[Fe],Xe=!Ne.isEvenOdd;if(Ne.isFilled){if(E&&Ne.ca(z,y,x))return!0;var Ve=Ne.segments;oe=Ne.startX,ue=Ne.startY;for(var ht=oe,ft=ue,mt=Ve.s,Ct=0;Ct<=Ve.length;Ct++){var Kt=void 0;if(Ct!==Ve.length){Kt=mt[Ct];var yi=Kt.type;a=Kt.endX,pe=Kt.endY}else yi=bi,a=ht,pe=ft;switch(yi){case Ei:if(ht=Qi(z,y,ee,y,oe,ue,ht,ft),isNaN(ht))return!0;re+=ht,ht=a,ft=pe;break;case bi:if(oe=Qi(z,y,ee,y,oe,ue,a,pe),isNaN(oe))return!0;re+=oe;break;case Jr:he=Re.Fo(oe,ue,Kt.point1X,Kt.point1Y,Kt.point2X,Kt.point2Y,a,pe,ee,y,z,y,.5),re+=he;break;case Ur:he=Re.Fo(oe,ue,(oe+2*Kt.point1X)/3,(ue+2*Kt.point1Y)/3,(2*Kt.point1X+a)/3,(2*Kt.point1Y+pe)/3,a,pe,ee,y,z,y,.5),re+=he;break;case Mr:case Fo:yi=Kt.type===Mr?Po(Kt,Ne):Ki(Kt,Ne,oe,ue);var tr=yi.length;if(tr===0){if(oe=Qi(z,y,ee,y,oe,ue,Kt.type===Mr?Kt.centerX:Kt.endX,Kt.type===Mr?Kt.centerY:Kt.endY),isNaN(oe))return!0;re+=oe;break}Kt=null;for(var Zi=0;Zi<tr;Zi++){if(Kt=yi[Zi],Zi===0){if(he=Qi(z,y,ee,y,oe,ue,Kt[0],Kt[1]),isNaN(he))return!0;re+=he}he=Re.Fo(Kt[0],Kt[1],Kt[2],Kt[3],Kt[4],Kt[5],Kt[6],Kt[7],ee,y,z,y,.5),re+=he}Kt!==null&&(a=Kt[6],pe=Kt[7]);break;default:at("Unknown Segment type: "+Kt.type)}oe=a,ue=pe}if(Xe){if(re!==0)return!0}else if(re%2!==0)return!0;re=0}else if(Ne.ca(z,y,b?x:x+2))return!0}return!1}function Qi(a,y,x,E,b,z,ee,re){if(Re.Yb(b,z,ee,re,.05,a,y))return NaN;var oe=(a-x)*(z-re);if(oe===0)return 0;var ue=((a*E-y*x)*(b-ee)-(a-x)*(b*re-z*ee))/oe;if(y=(a*E-y*x)*(z-re)/oe,ue>=a)return 0;if((b>ee?b-ee:ee-b)<(z>re?z-re:re-z)){if(z<re){if(y<z||y>re)return 0}else if(y<re||y>z)return 0}else if(b<ee){if(ue<b||ue>ee)return 0}else if(ue<ee||ue>b)return 0;return 0<oe?1:-1}function Jn(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}be.Pu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=new Ie),this.type===ut.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,ee=0,re=0;re<b;re++){var oe=E[re],ue=oe.length;for(a=0;a<ue;a++){var he=oe[a];if(ee+he>=z)return E=z-ee,E=he===0?0:E/he,x=x[re],re=x[2*a],b=x[2*a+1],y.h(re+(x[2*a+2]-re)*E,b+(x[2*a+3]-b)*E),y;ee+=he}}return y},be.wx=function(a){if(0>a?a=0:1<a&&(a=1),this.type===ut.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,ee=0;ee<E;ee++){var re=x[ee],oe=re.length;for(a=0;a<oe;a++){var ue=re[a];if(z+ue>=b)return b=y[ee],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+=ue}}return NaN},be.Qu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=[]),y.length=3,this.type===ut.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,ee=0,re=0;re<b;re++){var oe=E[re],ue=oe.length;for(a=0;a<ue;a++){var he=oe[a];if(ee+he>=z)return E=z-ee,E=he===0?0:E/he,he=x[re],x=he[2*a],re=he[2*a+1],b=he[2*a+2],a=he[2*a+3],y[0]=x+(b-x)*E,y[1]=re+(a-re)*E,y[2]=1>Math.abs(b-x)&&1>Math.abs(a-re)?0:1>Math.abs(b-x)?0<=a-re?90:270:1>Math.abs(a-re)?0<=b-x?0:180:180*Math.atan2(a-re,b-x)/Math.PI,y;ee+=he}}return y},be.xx=function(a){if(this.type===ut.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 ee=x;E=b}else ee=b,E=x;return a<=ee?ee===x?0:1:a>=E?E===x?0:1:Math.abs(a-x)/(E-ee)}if(x===b)return y<E?ee=y:(ee=E,E=y),z<=ee?ee===y?0:1:z>=E?E===y?0:1:Math.abs(z-y)/(E-ee);ee=(E-y)*(E-y)+(b-x)*(b-x);var re=Ie.alloc();return Re.qh(y,x,E,b,z,a,re),a=re.x,z=re.y,Ie.free(re),Math.sqrt(((a-y)*(a-y)+(z-x)*(z-x))/ee)}}else if(this.type===ut.u){ee=this.startX,re=this.startY;var oe=this.endX;if(b=this.endY,ee!==oe||re!==b){y=oe-ee,x=b-re,z=2*y+2*x,E=a.x,a=a.y,E=Math.min(Math.max(E,ee),oe),a=Math.min(Math.max(a,re),b),ee=Math.abs(E-ee),oe=Math.abs(E-oe),re=Math.abs(a-re),b=Math.abs(a-b);var ue=Math.min(ee,oe,re,b);if(ue===re)return E/z;if(ue===oe)return(y+a)/z;if(ue===b)return(2*y+x-E)/z;if(ue===ee)return(2*y+2*x-a)/z}}else{y=this.flattenedSegments,x=this.flattenedLengths,z=this.flattenedTotalLength,E=Ie.alloc(),b=1/0,re=ee=0,oe=y.length;for(var he=ue=0,pe=0;pe<oe;pe++)for(var Se=y[pe],Pe=x[pe],Fe=Se.length,Ne=0;Ne<Fe;Ne+=2){var Xe=Se[Ne],Ve=Se[Ne+1];if(Ne!==0){Re.qh(ue,he,Xe,Ve,a.x,a.y,E);var ht=(E.x-a.x)*(E.x-a.x)+(E.y-a.y)*(E.y-a.y);ht<b&&(b=ht,ee=re,ee+=Math.sqrt((E.x-ue)*(E.x-ue)+(E.y-he)*(E.y-he))),re+=Pe[(Ne-2)/2]}ue=Xe,he=Ve}return Ie.free(E),a=ee/z,0>a?0:1<a?1:a}return 0};function Fr(a){if(a.tk===null){var y=a.tk=[],x=a.ym=[],E=[],b=[];if(a.type===ut.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===ut.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===ut.F){var z=new Zr;z.startX=a.endX,z.startY=(a.startY+a.endY)/2;var ee=new mr(Mr);if(ee.startAngle=0,ee.sweepAngle=360,ee.centerX=(a.startX+a.endX)/2,ee.centerY=(a.startY+a.endY)/2,ee.radiusX=Math.abs(a.startX-a.endX)/2,ee.radiusY=Math.abs(a.startY-a.endY)/2,z.add(ee),a=Po(ee,z),b=a.length,b===0)E.push(ee.centerX),E.push(ee.centerY);else{ee=z.startX,z=z.startY;for(var re=0;re<b;re++){var oe=a[re];Re.Qe(ee,z,oe[2],oe[3],oe[4],oe[5],oe[6],oe[7],.5,E),ee=oe[6],z=oe[7]}}y.push(E),x.push(Br(E))}else for(a=a.figures.iterator;a.next();){b=a.value,E=[],E.push(b.startX),E.push(b.startY),ee=b.startX,z=b.startY,re=ee,oe=z;for(var ue=b.segments.s,he=ue.length,pe=0;pe<he;pe++){var Se=ue[pe];switch(Se.type){case Ei:4<=E.length&&(y.push(E),x.push(Br(E))),E=[],E.push(Se.endX),E.push(Se.endY),ee=Se.endX,z=Se.endY,re=ee,oe=z;break;case bi:E.push(Se.endX),E.push(Se.endY),ee=Se.endX,z=Se.endY;break;case Jr:Re.Qe(ee,z,Se.point1X,Se.point1Y,Se.point2X,Se.point2Y,Se.endX,Se.endY,.5,E),ee=Se.endX,z=Se.endY;break;case Ur:Re.ep(ee,z,Se.point1X,Se.point1Y,Se.endX,Se.endY,.5,E),ee=Se.endX,z=Se.endY;break;case Mr:var Pe=Po(Se,b),Fe=Pe.length;if(Fe===0){E.push(Se.centerX),E.push(Se.centerY),ee=Se.centerX,z=Se.centerY;break}for(var Ne=0;Ne<Fe;Ne++){var Xe=Pe[Ne];Re.Qe(ee,z,Xe[2],Xe[3],Xe[4],Xe[5],Xe[6],Xe[7],.5,E),ee=Xe[6],z=Xe[7]}break;case Fo:if(Pe=Ki(Se,b,ee,z),Fe=Pe.length,Ne=Se.endX,Xe=Se.endY,Fe===0){E.push(Ne),E.push(Xe),ee=Ne,z=Xe;break}for(Ne=0;Ne<Fe;Ne++)Xe=Pe[Ne],Re.Qe(ee,z,Xe[2],Xe[3],Xe[4],Xe[5],Xe[6],Xe[7],.5,E),ee=Xe[6],z=Xe[7];break;default:at("Segment not of valid type: "+Se.type)}Se.isClosed&&(E.push(re),E.push(oe))}4<=E.length&&(y.push(E),x.push(Br(E)))}}}function Br(a){for(var y=[],x=0,E=0,b=a.length,z=0;z<b;z+=2){var ee=a[z],re=a[z+1];z!==0&&y.push(Math.sqrt(hi(x,E,ee,re))),x=ee,E=re}return y}be.add=function(a){return this.ee.add(a),this},be.pm=function(a,y,x,E,b,z,ee,re){return this._isFrozen&&Bt(this),this.fg=new Xi(a,y,b,z).freeze(),this.gg=new Xi(x,E,ee,re).freeze(),this},fn.Object.defineProperties(ut.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 Fr(this),this.tk}},flattenedLengths:{get:function(){return Fr(this),this.ym}},flattenedTotalLength:{get:function(){var a=this.zm;if(isNaN(a)){if(this.type===ut.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===ut.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,ee=0;ee<z;ee++)a+=b[ee]}this.zm=a}return a}},type:{get:function(){return this.na},set:function(a){this.na!==a&&(this._isFrozen&&Bt(this,a),this.na=a,a===ut.o?this.ee=new Bn:(ut.V===null&&(ut.V=new Bn().freeze()),this.ee=ut.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(a){this.od!==a&&(this._isFrozen&&Bt(this,a),this.od=a,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(a){this.pd!==a&&(this._isFrozen&&Bt(this,a),this.pd=a,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(a){this.Dc!==a&&(this._isFrozen&&Bt(this,a),this.Dc=a,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(a){this.Ec!==a&&(this._isFrozen&&Bt(this,a),this.Ec=a,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(a){this.ee!==a&&(this._isFrozen&&Bt(this,a),this.ee=a,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(a){this._isFrozen&&Bt(this,a),this.fg=a.J()}},spot2:{get:function(){return this.gg},set:function(a){this._isFrozen&&Bt(this,a),this.gg=a.J()}},defaultStretch:{get:function(){return this.Uf},set:function(a){this._isFrozen&&Bt(this,a),this.Uf=a}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),ut.prototype.setSpots=ut.prototype.pm,ut.prototype.add=ut.prototype.add,ut.prototype.getFractionForPoint=ut.prototype.xx,ut.prototype.getPointAndAngleAlongPath=ut.prototype.Qu,ut.prototype.getAngleAlongPath=ut.prototype.wx,ut.prototype.getPointAlongPath=ut.prototype.Pu,ut.prototype.containsPoint=ut.prototype.ca,ut.prototype.transform=ut.prototype.transform,ut.prototype.rotate=ut.prototype.rotate,ut.prototype.scale=ut.prototype.scale,ut.prototype.offset=ut.prototype.offset,ut.prototype.normalize=ut.prototype.normalize,ut.prototype.computeBoundsWithoutOrigin=ut.prototype.ix,ut.prototype.equalsApprox=ut.prototype.Xa,ut.className="Geometry",ut.j=new Ot(ut,"Line",0),ut.u=new Ot(ut,"Rectangle",1),ut.F=new Ot(ut,"Ellipse",2),ut.o=new Ot(ut,"Path",3),ut.V=null,ut.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",ut.className="Geometry",ut.stringify=ut.ia,ut.fillPath=ut.nb,ut.parse=ut.parse,ut.Line=ut.j,ut.Rectangle=ut.u,ut.Ellipse=ut.F,ut.Path=ut.o;function Zr(a,y,x,E,b){Er(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 Bn,this.sr=this.pl.Ja,this.fw=null}Zr.prototype.copy=function(){var a=new Zr;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},be=Zr.prototype,be.Xa=function(a){if(!(a instanceof Zr&&Re.B(this.startX,a.startX)&&Re.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},be.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},be.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},be.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},be.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},be.add=function(a){return this.pl.add(a),this},be.ca=function(a,y,x){for(var E=this.startX,b=this.startY,z=E,ee=b,re=this.segments.s,oe=re.length,ue=0;ue<oe;ue++){var he=re[ue];switch(he.type){case Ei:z=he.endX,ee=he.endY,E=he.endX,b=he.endY;break;case bi:if(Re.Yb(E,b,he.endX,he.endY,x,a,y))return!0;E=he.endX,b=he.endY;break;case Jr:if(Re.cs(E,b,he.point1X,he.point1Y,he.point2X,he.point2Y,he.endX,he.endY,.5,a,y,x))return!0;E=he.endX,b=he.endY;break;case Ur:if(Re.jv(E,b,he.point1X,he.point1Y,he.endX,he.endY,.5,a,y,x))return!0;E=he.endX,b=he.endY;break;case Mr:case Fo:var pe=he.type===Mr?Po(he,this):Ki(he,this,E,b),Se=pe.length,Pe=he.type===Mr?he.centerX:he.endX,Fe=he.type===Mr?he.centerY:he.endY;if(Se===0){if(Re.Yb(E,b,Pe,Fe,x,a,y))return!0;E=Pe,b=Fe;break}for(Pe=null,Fe=0;Fe<Se;Fe++)if(Pe=pe[Fe],Fe===0&&Re.Yb(E,b,Pe[0],Pe[1],x,a,y)||Re.cs(Pe[0],Pe[1],Pe[2],Pe[3],Pe[4],Pe[5],Pe[6],Pe[7],.5,a,y,x))return!0;Pe!==null&&(E=Pe[6],b=Pe[7]);break;default:at("Unknown Segment type: "+he.type)}if(he.isClosed&&(E!==z||b!==ee)&&Re.Yb(E,b,z,ee,x,a,y))return!0}return!1},fn.Object.defineProperties(Zr.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&&Bt(this,a),this.l=a?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(a){this._isFrozen&&Bt(this,a),this.l=a?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&Bt(this,a),this.l=a?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(a){this._isFrozen&&Bt(this,a),this.od=a,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(a){this._isFrozen&&Bt(this,a),this.pd=a,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(a){this._isFrozen&&Bt(this,a),this.pl=a,this._isInvalidBounds=!0}}}),Zr.prototype.add=Zr.prototype.add,Zr.prototype.equalsApprox=Zr.prototype.Xa,Zr.className="PathFigure";function mr(a,y,x,E,b,z,ee,re){Er(this),a===void 0&&(a=bi),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),ee===void 0&&(ee=0),a===Fo?(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 ee=="boolean"?ee&&(this.isLargeArc=!0):typeof ee=="number"&&ee&&(this.isLargeArc=!0),re&&(this.isClockwiseArc=!0)):(this.Ne=E,this.Vh=b,a===Mr&&(z=Math.max(z,0)),this.Wh=z,typeof ee=="number"?(a===Mr&&(ee=Math.max(ee,0)),this.Pg=ee):this.Pg=0),this.ae=null}mr.prototype.copy=function(){var a=new mr;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},be=mr.prototype,be.Xa=function(a){if(!(a instanceof mr)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case Ei:case bi:return Re.B(this.endX,a.endX)&&Re.B(this.endY,a.endY);case Jr:return Re.B(this.endX,a.endX)&&Re.B(this.endY,a.endY)&&Re.B(this.point1X,a.point1X)&&Re.B(this.point1Y,a.point1Y)&&Re.B(this.point2X,a.point2X)&&Re.B(this.point2Y,a.point2Y);case Ur:return Re.B(this.endX,a.endX)&&Re.B(this.endY,a.endY)&&Re.B(this.point1X,a.point1X)&&Re.B(this.point1Y,a.point1Y);case Mr:return Re.B(this.startAngle,a.startAngle)&&Re.B(this.sweepAngle,a.sweepAngle)&&Re.B(this.centerX,a.centerX)&&Re.B(this.centerY,a.centerY)&&Re.B(this.radiusX,a.radiusX)&&Re.B(this.radiusY,a.radiusY);case Fo:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&Re.B(this.xAxisRotation,a.xAxisRotation)&&Re.B(this.endX,a.endX)&&Re.B(this.endY,a.endY)&&Re.B(this.radiusX,a.radiusX)&&Re.B(this.radiusY,a.radiusY);default:return!1}},be.qb=function(a){a.classType===mr&&(this.type=a)},be.toString=function(a){switch(a===void 0&&(a=-1),this.type){case Ei:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case bi:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Jr: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 Ur: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 Mr: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 Fo: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":"")},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return this._isFrozen=!1,this},be.close=function(){return this.isClosed=!0,this};function Po(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=Re.jx(0,0,x<E?x:E,a.startAngle,a.startAngle+a.sweepAngle,!1);if(x!==E){var ee=pt.alloc();ee.reset(),x<E?ee.scale(1,E/x):ee.scale(x/E,1),ut.Ha(z,ee),pt.free(ee)}for(x=z.length,E=0;E<x;E++)ee=z[E],ee[0]+=y,ee[1]+=b,ee[2]+=y,ee[3]+=b,ee[4]+=y,ee[5]+=b,ee[6]+=y,ee[7]+=b;return a.ae=z,a.ae}function Ki(a,y,x,E){function b(Ne,Xe,Ve,ht){return(Ne*ht<Xe*Ve?-1:1)*Math.acos((Ne*Ve+Xe*ht)/(Math.sqrt(Ne*Ne+Xe*Xe)*Math.sqrt(Ve*Ve+ht*ht)))}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 ee=Math.PI/180*a.Ne,re=a.isLargeArc,oe=a.isClockwiseArc,ue=a.Dc,he=a.Ec,pe=Math.cos(ee),Se=Math.sin(ee),Pe=pe*(x-ue)/2+Se*(E-he)/2;ee=-Se*(x-ue)/2+pe*(E-he)/2;var Fe=Pe*Pe/(y*y)+ee*ee/(z*z);return 1<Fe&&(y*=Math.sqrt(Fe),z*=Math.sqrt(Fe)),Fe=(re===oe?-1:1)*Math.sqrt((y*y*z*z-y*y*ee*ee-z*z*Pe*Pe)/(y*y*ee*ee+z*z*Pe*Pe)),isNaN(Fe)&&(Fe=0),re=Fe*y*ee/z,Fe=Fe*-z*Pe/y,isNaN(re)&&(re=0),isNaN(Fe)&&(Fe=0),x=(x+ue)/2+pe*re-Se*Fe,E=(E+he)/2+Se*re+pe*Fe,he=b(1,0,(Pe-re)/y,(ee-Fe)/z),pe=(Pe-re)/y,ue=(ee-Fe)/z,Pe=(-Pe-re)/y,re=(-ee-Fe)/z,ee=b(pe,ue,Pe,re),Pe=(pe*Pe+ue*re)/(Math.sqrt(pe*pe+ue*ue)*Math.sqrt(Pe*Pe+re*re)),-1>=Pe?ee=Math.PI:1<=Pe&&(ee=0),!oe&&0<ee&&(ee-=2*Math.PI),oe&&0>ee&&(ee+=2*Math.PI),oe=y>z?1:y/z,Pe=y>z?z/y:1,y=Re.jx(0,0,y>z?y:z,he,he+ee,!0),z=pt.alloc(),z.reset(),z.translate(x,E),z.rotate(a.Ne,0,0),z.scale(oe,Pe),ut.Ha(y,z),pt.free(z),a.ae=y,a.ae}fn.Object.defineProperties(mr.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&&Bt(this,a),this.na=a,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(a){this._isFrozen&&Bt(this,a),this.Dc=a,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(a){this._isFrozen&&Bt(this,a),this.Ec=a,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(a){this._isFrozen&&Bt(this,a),this.Ne=a,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(a){this._isFrozen&&Bt(this,a),this.Vh=a,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(a){this._isFrozen&&Bt(this,a),this.Wh=a,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(a){this._isFrozen&&Bt(this,a),this.Pg=a,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(a){this._isFrozen&&Bt(this,a),this.Ne=a,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(a){this._isFrozen&&Bt(this,a),this.Vh=a,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(a){0>a&&Kn(a,">= zero",mr,"radiusX"),this._isFrozen&&Bt(this,a),this.Wh=a,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(a){0>a&&Kn(a,">= zero",mr,"radiusY"),this._isFrozen&&Bt(this,a),this.Pg=a,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(a){this._isFrozen&&Bt(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&&Bt(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&&Bt(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&&Bt(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&&Bt(this,a),a%=360,0>a&&(a+=360),this.Ne=a,this._isInvalidBounds=!0}}}),mr.prototype.equalsApprox=mr.prototype.Xa;var Ei=new Ot(mr,"Move",0),bi=new Ot(mr,"Line",1),Jr=new Ot(mr,"Bezier",2),Ur=new Ot(mr,"QuadraticBezier",3),Mr=new Ot(mr,"Arc",4),Fo=new Ot(mr,"SvgArc",4);mr.className="PathSegment",mr.Move=Ei,mr.Line=bi,mr.Bezier=Jr,mr.QuadraticBezier=Ur,mr.Arc=Mr,mr.SvgArc=Fo;function vr(){this.H=null,this.xu=new Ie(0,0).freeze(),this.mt=new Ie(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}vr.prototype.copy=function(){var a=new vr;return this.clone(a)},vr.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},vr.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},vr.prototype.So=function(a,y){var x=this.diagram;return x===null||Sf(x,a,y),y},vr.prototype.Bz=function(a,y){var x=this.diagram;return x===null||(Sf(x,a,y),y.assign(x.Ps(y))),y},fn.Object.defineProperties(vr.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}}}),vr.prototype.getMultiTouchDocumentPoint=vr.prototype.Bz,vr.prototype.getMultiTouchViewPoint=vr.prototype.So,vr.className="InputEvent";function so(){this.H=null,this.xa="",this.ar=this.Lr=null}so.prototype.copy=function(){var a=new so;return a.H=this.H,a.xa=this.xa,a.Lr=this.Lr,a.ar=this.ar,a},so.prototype.toString=function(){var a="*"+this.name;return this.subject!==null&&(a+=":"+this.subject.toString()),this.parameter!==null&&(a+="("+this.parameter.toString()+")"),a},fn.Object.defineProperties(so.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}}}),so.className="DiagramEvent";function er(){this.Fm=oo,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}er.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},er.prototype.copy=function(){var a=new er;a.Fm=this.Fm,a.Qq=this.Qq,a.rf=this.rf,a.cc=this.cc,a.H=this.H,a.Qn=this.Qn;var y=this.Sn;return a.Sn=Qt(y)&&typeof y.J=="function"?y.J():y,y=this.Rn,a.Rn=Qt(y)&&typeof y.J=="function"?y.J():y,y=this.Mn,a.Mn=Qt(y)&&typeof y.J=="function"?y.J():y,y=this.Ln,a.Ln=Qt(y)&&typeof y.J=="function"?y.J():y,a},er.prototype.qb=function(a){a.classType===er&&(this.change=a)},er.prototype.toString=function(){var a="";return a=this.change===Tr?a+"* ":this.change===oo?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===Tr?this.oldValue!==null&&(a+=" "+this.oldValue):(this.object!==null&&(a+=Pr(this.object)),this.oldValue!==null&&(a+=" old: "+Pr(this.oldValue)),this.oldParam!==null&&(a+=" "+this.oldParam),this.newValue!==null&&(a+=" new: "+Pr(this.newValue)),this.newParam!==null&&(a+=" "+this.newParam)),a},er.prototype.I=function(a){return a?this.oldValue:this.newValue},er.prototype.Dz=function(a){return a?this.oldParam:this.newParam},er.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},er.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},er.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},er.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},fn.Object.defineProperties(er.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===Tr&&(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}}}),er.prototype.redo=er.prototype.redo,er.prototype.canRedo=er.prototype.canRedo,er.prototype.undo=er.prototype.undo,er.prototype.canUndo=er.prototype.canUndo,er.prototype.getParam=er.prototype.Dz,er.prototype.getValue=er.prototype.I,er.prototype.clear=er.prototype.clear;var Tr=new Ot(er,"Transaction",-1),oo=new Ot(er,"Property",0),Go=new Ot(er,"Insert",1),ha=new Ot(er,"Remove",2);er.className="ChangedEvent",er.Transaction=Tr,er.Property=oo,er.Insert=Go,er.Remove=ha;function _a(){this.o=new Bn().freeze(),this.xa="",this.j=!1}_a.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},_a.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()},_a.prototype.canUndo=function(){return this.isComplete},_a.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()}},_a.prototype.canRedo=function(){return this.isComplete},_a.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()}},_a.prototype.ak=function(){if(this.isComplete){var a=this.changes;a.ka();for(var y=new Rt,x=0;x<a.count;x++){var E=a.M(x);if(E!==null&&E.change===oo&&E.object){var b=y.get(E.object);b||(b=new Rt,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()}},fn.Object.defineProperties(_a.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}}}),_a.prototype.optimize=_a.prototype.ak,_a.prototype.redo=_a.prototype.redo,_a.prototype.canRedo=_a.prototype.canRedo,_a.prototype.undo=_a.prototype.undo,_a.prototype.canUndo=_a.prototype.canUndo,_a.prototype.clear=_a.prototype.clear,_a.className="Transaction";function jr(){this.Pt=new In,this.Jd=!1,this.u=new Bn().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new Bn().freeze(),this.hl=new Bn,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}jr.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},jr.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},jr.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled,this.maxHistoryLength=a.maxHistoryLength,this.checksTransactionLevel=a.checksTransactionLevel},be=jr.prototype,be.Xw=function(a){this.Pt.add(a)},be.Rx=function(a){this.Pt.remove(a)},be.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},be.eb=function(a){return a===void 0&&(a=""),Ls(this,!0,a)},be.Kf=function(){return Ls(this,!1,"")};function Ls(a,y,x){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&li("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 ee=a.Ie.count;0<ee&&(x===""&&(x=a.Ie.M(0)),a.Ie.ka(),a.Ie.mb(ee-1),a.Ie.freeze()),ee=a.hl.count,0<ee&&(z=a.hl.M(ee-1),a.hl.mb(ee-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}be.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()}},jr.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return!!(a!==null&&a.canUndo())},jr.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){li("undo error: "+y.toString())}finally{this.Ob("FinishedUndo","Undo",a),this.Fe=!1}}},jr.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return!!(a!==null&&a.canRedo())},jr.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){li("redo error: "+y.toString())}finally{this.Ob("FinishedRedo","Redo",a),this.Fe=!1}}},jr.prototype.Ob=function(a,y,x){x===void 0&&(x=null);var E=new er;for(E.change=Tr,E.propertyName=a,E.object=x,E.oldValue=y,a=this.models;a.next();)y=a.value,E.model=y,y.ds(E)},jr.prototype.Tu=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var y=this.currentTransaction;y===null&&(this.Np=y=new _a);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||li("Change not within a transaction: "+x.toString()))}},jr.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},fn.Object.defineProperties(jr.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}}}),jr.prototype.handleChanged=jr.prototype.Tu,jr.prototype.redo=jr.prototype.redo,jr.prototype.undo=jr.prototype.undo,jr.prototype.canUndo=jr.prototype.canUndo,jr.prototype.discardHistoryAfterIndex=jr.prototype.lx,jr.prototype.rollbackTransaction=jr.prototype.Kf,jr.prototype.commitTransaction=jr.prototype.eb,jr.prototype.startTransaction=jr.prototype.Ea,jr.prototype.removeModel=jr.prototype.Rx,jr.prototype.addModel=jr.prototype.Xw,jr.prototype.clear=jr.prototype.clear,jr.className="UndoManager";function vo(){Er(this),this.H=sh,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new vr,this.Zr=-1}vo.prototype.toString=function(){return this.name!==""?this.name+" Tool":Ii(this.constructor)},vo.prototype.updateAdornments=function(){},vo.prototype.canStart=function(){return this.isEnabled},vo.prototype.doStart=function(){},vo.prototype.doActivate=function(){this.isActive=!0},vo.prototype.doDeactivate=function(){this.isActive=!1},vo.prototype.doStop=function(){},vo.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},vo.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")},vo.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},vo.prototype.doMouseMove=function(){},vo.prototype.doMouseUp=function(){this.stopTool()},vo.prototype.doMouseWheel=function(){},vo.prototype.canStartMultiTouch=function(){return!0},vo.prototype.standardPinchZoomStart=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,Ie.allocAt(NaN,NaN)),E=y.So(1,Ie.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}Ie.free(x),Ie.free(E)},vo.prototype.standardPinchZoomMove=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,Ie.allocAt(NaN,NaN)),E=y.So(1,Ie.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 Ie((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 ee=a.commandHandler;if(z!==a.scale&&ee.canResetZoom(z)){var re=a.zoomPoint;a.zoomPoint=b,ee.resetZoom(z),a.zoomPoint=re}y.bubbles=!1}Ie.free(x),Ie.free(E)},vo.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},vo.prototype.doKeyUp=function(){},vo.prototype.Ea=function(a){return a===void 0&&(a=this.name),this.transactionResult=null,this.diagram.Ea(a)},vo.prototype.stopTransaction=function(){var a=this.diagram;return this.transactionResult===null?a.Kf():a.eb(this.transactionResult)},vo.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.lastInput,x=a.Ol(y.documentPoint,!1);if(x!==null){if(Vr?y.meta:y.control){for(a.R("ChangingSelection",a.selection),y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&(y.isSelected=!y.isSelected),a.R("ChangedSelection",a.selection)}else if(y.shift){if(!x.isSelected){for(a.R("ChangingSelection",a.selection),y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&(y.isSelected=!0),a.R("ChangedSelection",a.selection)}}else if(!x.isSelected){for(y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&a.select(y)}}else!y.left||(Vr?y.meta:y.control)||y.shift||a.clearSelection()}},vo.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,na(a,E,x),E.handled};function na(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)}}}vo.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,ee=z;for(a.Ck=E,this.doCurrentObjectChanged(z,E),y.handled=!1;z!==null;){var re=z.mouseLeave;if(re!==null&&(E===z||E!==null&&E.rg(z)||(re(y,z,E),b=!0,y.handled)))break;z=z.panel}for(z=ee,y.handled=!1;E!==null&&(ee=E.mouseEnter,!(ee!==null&&(z===E||z!==null&&z.rg(E)||(ee(y,E,z),b=!0,y.handled))));)E=E.panel;E=a.Ck}if(E!==null){for(z=E,ee="";z!==null&&(ee=z.cursor,ee==="");)z=z.panel;for(a.currentCursor=ee,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}},vo.prototype.doUpdateCursor=function(){var a=this.diagram;a&&(a.currentCursor="")},vo.prototype.doCurrentObjectChanged=function(){},vo.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===xs&&!y.shift||b===Ia&&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===xs&&y.shift||b===Ia&&!y.control){E=a.position.copy();var z=y.event;b=z.deltaMode;var ee=z.deltaX;z=z.deltaY;var re="pixel";if(ee===0&&z===0||y.shift)!y.shift&&a.allowVerticalScroll?(x=3*x*a.scrollVerticalLineChange,a.scroll(re,0<x?"up":"down",Math.abs(x))):y.shift&&a.allowHorizontalScroll&&(x=3*x*a.scrollHorizontalLineChange,a.scroll(re,0<x?"left":"right",Math.abs(x)));else{switch(b){case 0:re="pixel";break;case 1:re="line";break;case 2:re="page"}ee!==0&&a.allowHorizontalScroll&&(ee*=a.scrollHorizontalLineChange/16,a.scroll(re,0<ee?"right":"left",Math.abs(ee))),z!==0&&a.allowVerticalScroll&&(z*=a.scrollVerticalLineChange/16,a.scroll(re,0<z?"down":"up",Math.abs(z)))}this.doWheelChange(a,E,y)}}},vo.prototype.doWheelChange=function(a,y,x){a.position.D(y)&&x.event.wheelDeltaX===0||(x.bubbles=!1)},vo.prototype.standardWaitAfter=function(a,y){y===void 0&&(y=this.diagram.lastInput),this.cancelWaitAfter();var x=this,E=y.clone(this.yy);this.Zr=br(function(){x.doWaitAfter(E)},a)},vo.prototype.cancelWaitAfter=function(){this.Zr!==-1&&xn.clearTimeout(this.Zr),this.Zr=-1},vo.prototype.doWaitAfter=function(){},vo.prototype.findToolHandleAt=function(a,y){return a=this.diagram.ic(a,function(x){for(;x!==null&&!(x.panel instanceof Yo);)x=x.panel;return x}),a===null?null:a.part.category===y?a:null},vo.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},fn.Object.defineProperties(vo.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof Vt&&(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}}}),vo.prototype.startTransaction=vo.prototype.Ea,vo.className="Tool";function Eo(){vo.call(this),this.name="ToolManager",this.hb=new Bn,this.ob=new Bn,this.Hb=new Bn,this.F=this.V=850,this.o=new Pn(2,2).ja(),this.Ha=5e3,this.ia=Ia,this.u=zu,this.Mp=this.j=null,this.zj=-1}_t(Eo,vo),Eo.prototype.initializeStandardTools=function(){},Eo.prototype.updateAdornments=function(a){var y=this.currentToolTip;if(y instanceof Yo&&this.Mp===a){var x=y.adornedObject;(a!==null?x.part===a:x===null)?this.showToolTip(y,x):this.hideToolTip()}},Eo.prototype.doMouseDown=function(){var a=this.diagram,y=a.lastInput;if(y.isTouchEvent&&this.gestureBehavior===Ll&&(y.bubbles=!1),y.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===lu){y.bubbles=!0;return}if(this.gestureBehavior===Ll)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===Ia?this.mouseWheelBehavior=xs:this.mouseWheelBehavior===xs&&(this.mouseWheelBehavior=Ia)),this.doActivate(),this.standardWaitAfter(this.holdDelay,y)},Eo.prototype.doMouseMove=function(){var a=this.diagram,y=a.lastInput;if(y.isMultiTouch){if(this.gestureBehavior===lu){y.bubbles=!0;return}if(this.gestureBehavior===Ll)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}}Xa(this,a),a=y.event,a===null||a.type!=="pointermove"&&a.cancelable||(y.bubbles=!0)};function Xa(a,y){a.standardMouseOver(),a.isBeyondDragSize()&&a.standardWaitAfter(a.isActive?a.holdDelay:a.hoverDelay,y.lastInput)}Eo.prototype.doCurrentObjectChanged=function(a,y){a=this.currentToolTip,a===null||y!==null&&a instanceof Yo&&(y===a||y.rg(a))||this.hideToolTip()},Eo.prototype.doWaitAfter=function(a){var y=this.diagram;y.ta!==null&&(this.doMouseHover(),this.isActive||this.doToolTip(),a.isTouchEvent&&!y.lastInput.handled&&(a=a.copy(),a.button=2,a.buttons=2,y.lastInput=a,y.qu=!0,y.doMouseUp()))},Eo.prototype.doMouseHover=function(){var a=this.diagram,y=a.lastInput;y.targetObject===null&&(y.targetObject=a.ic(y.documentPoint,null,null));var x=y.targetObject;if(x!==null)for(y.handled=!1;x!==null&&(a=this.isActive?x.mouseHold:x.mouseHover,!(a!==null&&(a(y,x),y.handled)));)x=x.panel;else x=this.isActive?a.mouseHold:a.mouseHover,x!==null&&x(y)},Eo.prototype.doToolTip=function(){var a=this.diagram,y=a.lastInput;if(y.targetObject===null&&(y.targetObject=a.ic(y.documentPoint,null,null)),y=y.targetObject,y!==null){if(a=this.currentToolTip,!(a instanceof Yo)||y!==a&&!y.rg(a)){for(;y!==null;){if(a=y.toolTip,a!==null){this.showToolTip(a,y);return}y=y.panel}this.hideToolTip()}}else y=a.toolTip,y!==null?this.showToolTip(y,null):this.hideToolTip()},Eo.prototype.showToolTip=function(a,y){var x=this.diagram;if(a!==this.currentToolTip&&this.hideToolTip(),a instanceof Yo){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 Zu&&a!==this.currentToolTip&&a.show(y,x,this);if(this.currentToolTip=a,this.zj!==-1&&(xn.clearTimeout(this.zj),this.zj=-1),a=this.toolTipDuration,0<a&&a!==1/0){var b=this;this.zj=br(function(){b.hideToolTip()},a)}},Eo.prototype.positionToolTip=function(a){if(a.placeholder===null){var y=this.diagram,x=y.lastInput.documentPoint.copy(),E=a.measuredBounds,b=y.viewportBounds;y.lastInput.isTouchEvent&&(x.x-=E.width),x.x+E.width>b.right&&(x.x-=E.width+5/y.scale),x.x<b.x&&(x.x=b.x),x.y=x.y+20/y.scale+E.height>b.bottom?x.y-(E.height+5/y.scale):x.y+20/y.scale,x.y<b.y&&(x.y=b.y),a.position=x}},Eo.prototype.hideToolTip=function(){this.zj!==-1&&(xn.clearTimeout(this.zj),this.zj=-1);var a=this.diagram,y=this.currentToolTip;y!==null&&(y instanceof Yo?(a.remove(y),this.Mp!==null&&this.Mp.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Zu&&y.hide!==null&&y.hide(a,this),this.currentToolTip=null)},Eo.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.diagram;if(this.isActive)for(var y=this.mouseUpTools.length,x=0;x<y;x++){var E=this.mouseUpTools.M(x);if(E.diagram=this.diagram,E.canStart()){a.doFocus(),a.currentTool=E,a.currentTool===E&&(E.isActive||E.doActivate(),E.doMouseUp());return}}a.doFocus(),this.doDeactivate()},Eo.prototype.doMouseWheel=function(){this.standardMouseWheel()},Eo.prototype.doKeyDown=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyDown()},Eo.prototype.doKeyUp=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyUp()},Eo.prototype.findTool=function(a){for(var y=this.mouseDownTools.length,x=0;x<y;x++){var E=this.mouseDownTools.M(x);if(E.name===a)return E}for(y=this.mouseMoveTools.length,x=0;x<y;x++)if(E=this.mouseMoveTools.M(x),E.name===a)return E;for(y=this.mouseUpTools.length,x=0;x<y;x++)if(E=this.mouseUpTools.M(x),E.name===a)return E;return null},Eo.prototype.replaceTool=function(a,y){y!==null&&(y.diagram=this.diagram);for(var x=this.mouseDownTools.length,E=0;E<x;E++){var b=this.mouseDownTools.M(E);if(b.name===a)return y!==null?this.mouseDownTools.cd(E,y):this.mouseDownTools.mb(E),b}for(x=this.mouseMoveTools.length,E=0;E<x;E++)if(b=this.mouseMoveTools.M(E),b.name===a)return y!==null?this.mouseMoveTools.cd(E,y):this.mouseMoveTools.mb(E),b;for(x=this.mouseUpTools.length,E=0;E<x;E++)if(b=this.mouseUpTools.M(E),b.name===a)return y!==null?this.mouseUpTools.cd(E,y):this.mouseUpTools.mb(E),b;return null},Eo.prototype.gb=function(a,y,x){y!==null&&(y.name=a,y.diagram=this.diagram),this.findTool(a)?this.replaceTool(a,y):y!==null&&x.add(y)},fn.Object.defineProperties(Eo.prototype,{mouseWheelBehavior:{get:function(){return this.ia},set:function(a){this.ia=a}},gestureBehavior:{get:function(){return this.u},set:function(a){this.u=a}},currentToolTip:{get:function(){return this.j},set:function(a){this.j=a,this.Mp=a!==null&&a instanceof Yo?a.adornedPart:null}},mouseDownTools:{get:function(){return this.hb}},mouseMoveTools:{get:function(){return this.ob}},mouseUpTools:{get:function(){return this.Hb}},hoverDelay:{get:function(){return this.V},set:function(a){this.V=a}},holdDelay:{get:function(){return this.F},set:function(a){this.F=a}},dragSize:{get:function(){return this.o},set:function(a){this.o=a.J()}},toolTipDuration:{get:function(){return this.Ha},set:function(a){this.Ha=a}}}),Eo.prototype.replaceStandardTool=Eo.prototype.gb;var Ia=new Ot(Eo,"WheelScroll",0),xs=new Ot(Eo,"WheelZoom",1),Yl=new Ot(Eo,"WheelNone",2),zu=new Ot(Eo,"GestureZoom",3),Ll=new Ot(Eo,"GestureCancel",4),lu=new Ot(Eo,"GestureNone",5);Eo.className="ToolManager",Eo.WheelScroll=Ia,Eo.WheelZoom=xs,Eo.WheelNone=Yl,Eo.GestureZoom=zu,Eo.GestureCancel=Ll,Eo.GestureNone=lu;function ka(){vo.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 Ie(NaN,NaN),this.Fr=new Ie,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new In().freeze(),this.ia=new ae,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var qs;_t(ka,vo),ka.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},ka.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},ka.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.Ol(a.firstInput.documentPoint,!1);if(y!==null){for(;y!==null&&!y.canSelect();)y=y.containingGroup;this.currentPart=y,this.currentPart===null||this.currentPart.isSelected||(a.R("ChangingSelection",a.selection),y=a.lastInput,(Vr?y.meta:y.control)||y.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.R("ChangedSelection",a.selection))}}},ka.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),Mn=null,this.isActive=!0,this.tl.set(a.position),al(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&&sl(a),Tc(a,this.draggedParts),this.Ea("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,Mn=this,Gr=this.diagram,this.doSimulatedDragOut()))};function al(a,y){if(a.dragsLink){var x=a.diagram;x.allowRelink&&(x.model.Wj()&&y.count===1&&y.first()instanceof $n?(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 Bs,a.Oe.diagram=x),a.Oe.originalLink=a.draggedLink):(a.draggedLink=null,a.Oe=null))}}ka.prototype.computeEffectiveCollection=function(a,y){return this.diagram.commandHandler.computeEffectiveCollection(a,y)},ka.prototype.Pd=function(a){return a===void 0?new Uu(qn):this.isGridSnapEnabled?new Uu(new Ie(Math.round(1e3*a.x)/1e3,Math.round(1e3*a.y)/1e3)):new Uu(a.copy())},ka.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,a.Fu(!1),a.ug(),fl(this),pd(a,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<qs.count){for(var y=qs,x=y.length,E=0;E<x;E++){var b=y.M(E);Oa(b),Ea(b),fl(b),b.diagram.ug()}y.clear()}Oa(this),this.tl.h(NaN,NaN),Gr!==null&&(Gr.currentCursor=""),Mn=Gr=null,Ea(this),a.isMouseCaptured=!1,a.currentCursor="",a.Ns=!1,this.stopTransaction(),cd(a,!0)},ka.prototype.stopTransaction=function(){var a=this.diagram,y=vo.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y};function fl(a){var y=a.diagram,x=y.skipsUndoManager;y.skipsUndoManager=!0,Il(a,y.lastInput,null),y.skipsUndoManager=x,a.Cg.length=0}function uu(){var a=Mn;Ea(a),Zs(a);var y=a.diagram;a.tl.w()&&(y.position=a.tl),y.ug()}ka.prototype.doCancel=function(){Ea(this),Zs(this);var a=this.diagram;this.tl.w()&&(a.position=this.tl),this.stopTool()},ka.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput;this.isActive&&(y.key==="Esc"?this.doCancel():y.key!==a.previousInput.key&&this.doMouseMove())},ka.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function Bl(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")):Zs(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 Rt,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 $n&&E.canCopy()&&x.add(E,a.Pd());a.copiedParts=x,al(a,x.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,rc(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}function Ea(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 $n&&(x.value.point=new Ie(0,0));a.doUpdateCursor(null)}y.skipsUndoManager=!1,y.partManager.addsToTemporaryLayer=!1,a.startPoint=y.firstInput.documentPoint}function Oa(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 us(a,y,x){var E=a.diagram,b=a.startPoint,z=Ie.alloc();z.assign(E.lastInput.documentPoint),a.moveParts(y,z.re(b),x),Ie.free(z),E.Gf("temporaryPixelRatio")===!0&&E.Yh===null&&30<E.$w&&(sl(E),E.hk())}ka.prototype.moveParts=function(a,y,x){x===void 0&&(x=!1);var E=this.diagram;E!==null&&gd(E,a,y,this.dragOptions,x)};function Zs(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 $n&&E.suspendsRouting){var b=x.value.point;a.draggedParts.add(E,a.Pd()),rc(E,-b.x,-b.y)}y.bd()}}function Gs(a,y){var x=a.diagram;a.dragsLink&&(a.draggedLink!==null&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),Ol(a,!1));var E=a.findDragOverObject(y),b=x.lastInput;b.targetObject=E,a.doUpdateCursor(E);var z=x.skipsUndoManager,ee=!1;try{if(x.skipsUndoManager=!0,ee=Il(a,b,E),!a.isActive&&Mn===null)return;var re=E!==null?E.part:null;if(re===null||x.handlesDragDropForTopLevelParts&&re.isTopLevel&&!(re instanceof no)){var oe=x.mouseDragOver;oe!==null&&(oe(b),ee=!0)}if(!a.isActive&&Mn===null||(a.doDragOver(y,E),!a.isActive&&Mn===null))return}finally{x.skipsUndoManager=z,ee&&x.bd()}a.Bn=E,x.isReadOnly||!x.allowMove&&!x.allowCopy||!x.allowHorizontalScroll&&!x.allowVerticalScroll||x.gs(b.viewPoint)}ka.prototype.findDragOverObject=function(a){var y=this;return lh(this.diagram,a,null,function(x){return x===null?x=!0:(x=x.part,x=!!(x===null||x instanceof Yo||x.layer.isTemporary||y.draggedParts&&y.draggedParts.contains(x)||y.copiedParts&&y.copiedParts.contains(x))),!x})},ka.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 Il(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 ee=0;ee<b;ee++){var re=a.Cg[ee],oe=re.mouseDragLeave;if(oe!==null&&(oe(y,re,x),E=!0,y.handled))break}if(a.Cg.length=0,!a.isActive&&Mn===null||x===null)return E;for(y.handled=!1,b=x;b!==null;)a.Cg.push(b),b=mu(b);for(b=a.Cg.length,x=0;x<b&&(ee=a.Cg[x],re=ee.mouseDragEnter,re===null||(re(y,ee,z),E=!0,!y.handled));x++);return E}function mu(a){var y=a.panel;return y!==null?y:a instanceof pr&&!(a instanceof no)&&(a=a.containingGroup,a!==null&&a.handlesDragDropForMembers)?a:null}function Fu(a,y,x){var E=a.Oe;if(E===null)return null;var b=a.diagram.og(y,E.portGravity,function(ue){return E.findValidLinkablePort(ue,x)});a=Ie.alloc();var z=1/0,ee=null;for(b=b.iterator;b.next();){var re=b.value;if(re.part!==null){var oe=re.ga(Kr,a);oe=y.Bf(oe),oe<z&&(ee=re,z=oe)}}return Ie.free(a),ee}function Ol(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,ee=null;x.fromNode===null&&(z=Fu(a,x.i(0),!1),z!==null&&(ee=z.part));var re=null,oe=null;x.toNode===null&&(re=Fu(a,x.i(x.pointsCount-1),!0),re!==null&&(oe=re.part)),b.isValidLink(ee,z,oe,re)?y?(x.defaultFromPoint=x.i(0),x.defaultToPoint=x.i(x.pointsCount-1),x.suspendsRouting=!1,x.fromNode=ee,z!==null&&(x.fromPortId=z.portId),x.toNode=oe,re!==null&&(x.toPortId=re.portId),x.fromPort!==E.Mx&&E.R("LinkRelinked",x,E.Mx),x.toPort!==E.Nx&&E.R("LinkRelinked",x,E.Nx)):oh(b,ee,z,oe,re):oh(b,null,null,null,null)}}}}ka.prototype.doDragOver=function(){};function Xl(a,y){var x=a.diagram;a.dragsLink&&Ol(a,!0),fl(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 ee=z.mouseDrop;if(ee!==null&&(ee(b,z),b.handled))break;df(a,b,z),z=mu(z)}}else z=x.mouseDrop,z!==null&&z(b);if(a.isActive||Mn!==null){for(b=(a.copiedParts||a.draggedParts).iterator;b.next();)z=b.key,z instanceof Fi&&z.linksConnected.each(function(re){re.suspendsRouting=!1});if(a.doDropOnto(y,E),a.isActive||Mn!==null){for(a=Gt.alloc(),y=x.selection.iterator;y.next();)E=y.value,E instanceof Fi&&xc(x,E,a);Gt.free(a)}}}function df(a,y,x){a=a.diagram,x=x.part,!a.handlesDragDropForTopLevelParts||!x.isTopLevel||x instanceof no||(x=a.mouseDrop,x!==null&&x(y))}function xc(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 $n},!0,function(b){return b instanceof $n},E),a.count!==0)for(a=a.iterator;a.next();)x=a.value,!x.Td(y)&&x.isAvoiding&&x.bb()}ka.prototype.doDropOnto=function(){},ka.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()?(Bl(this,!1),Tc(a,this.copiedParts),us(this,this.copiedParts,!1),pd(a,this.copiedParts)):this.mayMove()?(Ea(this),us(this,this.draggedParts,!0)):this.mayDragOut()?(Bl(this,!1),us(this,this.copiedParts,!1)):Ea(this),Gs(this,a.lastInput.documentPoint))}},ka.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?(Ea(this),Bl(this,!0),Tc(a,this.copiedParts),us(this,this.copiedParts,!1),pd(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,Ea(this),this.mayMove()&&(us(this,this.draggedParts,!0),Gs(this,a.lastInput.documentPoint))),this.Ym=!0,Xl(this,a.lastInput.documentPoint),this.isActive){var E=x?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,y&&Uf(this),a.Ya(),pd(a,this.draggedParts),this.transactionResult=x?"Copy":"Move",a.R(x?"SelectionCopied":"SelectionMoved",E)}this.stopTool(),x&&a.R("ChangedSelection",a.selection)}}},ka.prototype.simulatedMouseMove=function(a,y,x){if(Mn===null)return!1;var E=Mn.diagram;x instanceof Vt||(x=null);var b=Gr;return x!==b&&(b!==null&&b!==E&&(b.ug(),Mn.isDragOutStarted=!1,b=b.toolManager.findTool("Dragging"),b!==null&&b.doSimulatedDragLeave()),Gr=x,x!==null&&x!==E&&(uu(),b=x.toolManager.findTool("Dragging"),b!==null&&(qs.contains(b)||qs.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)},ka.prototype.simulatedMouseUp=function(a,y,x){if(Mn===null)return!1;var E=Gr,b=Mn.diagram;if(x===null)return Mn.doCancel(),!0;if(x!==E){var z=E.toolManager.findTool("Dragging");if(E!==null&&E!==b&&z!==null)return E.ug(),Mn.isDragOutStarted=!1,z.doSimulatedDragLeave(),!1;Gr=x,E=x.toolManager.findTool("Dragging"),E!==null&&(uu(),qs.contains(E)||qs.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 Ie),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=Mn,a!==null&&(x=a.mayCopy(),a.transactionResult=x?"Copy":"Move",a.stopTool()),!0):!1};function Uf(a){if(a.draggedParts!==null)for(var y=a.draggedParts.iterator;y.next();){var x=y.key;x instanceof Fi&&(x=x.containingGroup,x===null||x.placeholder===null||a.draggedParts.contains(x)||x.placeholder.v())}}ka.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(Vr?!a.lastInput.alt:!a.lastInput.control))return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},ka.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())},ka.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())},ka.prototype.computeBorder=function(a,y,x){return this.Ym||this.draggedParts===null||this.draggedParts.contains(a)?null:x.assign(y)},ka.prototype.Az=function(){return Mn},ka.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var y=Mn;return!(y===null||y.diagram.model.dataFormat!==a.model.dataFormat)},ka.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Cc(),$l(a),a.animationManager.Cc(),a=Mn,a!==null&&(a.diagram.Ns=!1),this.doUpdateCursor(null)}},ka.prototype.doSimulatedDragLeave=function(){var a=Mn;a!==null&&a.doSimulatedDragOut(),this.doCancel()},ka.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.Dm=!0;var y=Mn;if(y!==null&&y.draggedParts!==null){if(!this.mayDragIn())return;cf(this,y.draggedParts.Lf(),!1,a.firstInput),us(this,this.copiedParts,!1),Gs(this,a.lastInput.documentPoint)}a.animationManager.Dm=!1},ka.prototype.doSimulatedDrop=function(){var a=this.diagram,y=Mn;if(y!==null){var x=y.diagram;if(y.Ym=!0,Ea(this),!this.mayDragIn())return;a.animationManager.Dm=!0,a.R("ChangingSelection",a.selection),this.Ea("Drop"),cf(this,y.draggedParts.Lf(),!0,a.lastInput),us(this,this.copiedParts,!1);var E=new In;this.copiedParts!==null&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0,E.add(b)})),Xl(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 cf(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=Gt.alloc();b=E=1/0;for(var ee=-1/0,re=-1/0,oe=y.iterator;oe.next();){var ue=oe.value;if(ue.isVisible()){var he=ue.location;ue=he.x,he=he.y,isNaN(ue)||isNaN(he)||(ue<E&&(E=ue),he<b&&(b=he),ue>ee&&(ee=ue),he>re&&(re=he))}}for(E===1/0?z.h(0,0,0,0):z.h(E,b,ee-E,re-b),E=z.x+z.width/2,b=z.y+z.height/2,Gt.free(z),z=a.Fr,ee=new Rt,re=Ie.alloc(),oe=y.iterator;oe.next();)ue=oe.value,ue instanceof $n&&ue.canCopy()&&(he=x.I(ue),he!==null&&(he.points=ue.points,rc(he,z.x-E,z.y-b),he.suspendsRouting=!0,ee.add(he,a.Pd())));for(y=y.iterator;y.next();)ue=y.value,ue.Zc()&&ue.canCopy()&&(oe=x.I(ue),oe!==null&&(ue=ue.location,re.h(z.x-(E-ue.x),z.y-(b-ue.y)),oe.location=re,oe.Va(),ee.add(oe,a.Pd(re))));Ie.free(re),a.copiedParts=ee,al(a,ee.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,rc(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}ka.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ns=!1,this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor,this.Bn=null},ka.prototype.computeMove=function(a,y,x,E){return x=this.diagram,x!==null?x.computeMove(a,y,this.dragOptions,E):new Ie},fn.Object.defineProperties(ka.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}}}),ka.prototype.getDraggingSource=ka.prototype.Az;var Mn=null,Gr=null;ka.className="DraggingTool",qs=new Bn,_n("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)}),Eo.prototype.doCancel=function(){Mn!==null&&Mn.doCancel(),vo.prototype.doCancel.call(this)};function uo(){vo.call(this),this.te=100,this.Ha=!1,this.u="pointer";var a=new $n,y=new lo;y.isPanelMain=!0,y.stroke="blue",a.add(y),y=new lo,y.toArrow="Standard",y.fill="blue",y.stroke="blue",a.add(y),a.layerName="Tool",this.Ci=a,a=new Fi,y=new lo,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=cr,a.add(y),a.selectable=!1,a.layerName="Tool",this.Bi=a,this.j=y,a=new Fi,y=new lo,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=cr,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 Rt,this.Of=this.gj=this.Pf=null}_t(uo,vo),uo.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},uo.prototype.copyPortProperties=function(a,y,x,E,b){if(a!==null&&y!==null&&x!==null&&E!==null){var z=y.Df(),ee=Pn.alloc();ee.width=y.naturalBounds.width*z,ee.height=y.naturalBounds.height*z,E.desiredSize=ee,Pn.free(ee),b?(E.toSpot=y.toSpot,E.toEndSegmentLength=y.toEndSegmentLength):(E.fromSpot=y.fromSpot,E.fromEndSegmentLength=y.fromEndSegmentLength),x.locationSpot=Kr,z=Ie.alloc(),x.location=y.ga(Kr,z),Ie.free(z),E.angle=y.li(),this.portTargeted!==null&&this.portTargeted(a,y,x,E,b)}},uo.prototype.setNoTargetPortProperties=function(a,y,x){y!==null&&(y.desiredSize=cr,y.fromSpot=Xr,y.toSpot=Xr),a!==null&&(a.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,a,y,x)},uo.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},uo.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof Fi){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)}},uo.prototype.findValidLinkablePort=function(a,y){if(a===null)return null;var x=a.part;if(!(x instanceof Fi))return null;for(;a!==null;){var E=y?a.toLinkable:a.fromLinkable;if(E===!0&&(a.portId!==null||a instanceof Fi)&&(y?this.isValidTo(x,a):this.isValidFrom(x,a)))return a;if(E===!1)break;a=a.panel}return null},uo.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(pe){return b.findValidLinkablePort(pe,a)},null,!0);for(E=1/0,y=null,z=z.iterator;z.next();){var ee=z.value,re=ee.part;if(re instanceof Fi){var oe=ee.ga(Kr,Ie.alloc()),ue=x.x-oe.x,he=x.y-oe.y;Ie.free(oe),oe=ue*ue+he*he,oe<E&&(ue=this.validPortsCache.I(ee),ue!==null?ue&&(y=ee,E=oe):a&&this.isValidLink(this.originalFromNode,this.originalFromPort,re,ee)||!a&&this.isValidLink(re,ee,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(ee,!0),y=ee,E=oe):this.validPortsCache.add(ee,!1))}}return y!==null&&(x=y.part,x instanceof Fi&&(x.layer===null||x.layer.allowLink))?y:null},uo.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},uo.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},uo.prototype.isInSameNode=function(a,y){return a===null||y===null?!1:a===y?!0:(a=a.part,y=y.part,a!==null&&a===y)},uo.prototype.isLinked=function(a,y){if(a===null||y===null)return!1;var x=a.part;if(!(x instanceof Fi))return!1;a=a.portId,a===null&&(a="");var E=y.part;if(!(E instanceof Fi))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},uo.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)},uo.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 In;return E.add(a),io(this,x,y,E)};function io(a,y,x,E){if(y===x)return!0;var b=y.fromNode;return b!==null&&b.isLinkLabel&&(E.add(b),io(a,b.labeledLink,x,E))?!0:(y=y.toNode,!!(y!==null&&y.isLinkLabel&&(E.add(y),io(a,y.labeledLink,x,E))))}uo.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!==jc){if(E===vg){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!rr(this,a,y,x,!0)}if(E===yg){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!rr(this,a,y,x,!0)}if(E===gg)return a===y?a=!0:(E=new In,E.add(y),a=la(this,E,a,y,x)),!a;if(E===pg)return!rr(this,a,y,x,!1);if(E===mg)return a===y?a=!0:(E=new In,E.add(y),a=Wa(this,E,a,y,x)),!a}return!0};function rr(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 ee=z.value;if(ee!==E&&(!b||ee.isTreeLink)&&ee.toNode===y&&(ee=ee.fromNode,ee!==y&&rr(a,ee,x,E,b)))return!0}return!1}function la(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 ee=z.value;if(ee!==b&&ee.toNode===x&&(ee=ee.fromNode,ee!==x&&la(a,y,ee,E,b)))return!0}return!1}function Wa(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 ee=z.value;if(ee!==b){var re=ee.fromNode;if(ee=ee.toNode,re=re===x?ee:re,re!==x&&Wa(a,y,re,E,b))return!0}}return!1}fn.Object.defineProperties(uo.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}}}),uo.className="LinkingBaseTool";function Fa(){uo.call(this),this.name="Linking",this.V={},this.F=null,this.K=ya,this.Xd=null}_t(Fa,uo),Fa.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},Fa.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 Fi)))return null;var x=this.direction;if(x===ya||x===Ks){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===ya||x===rs)&&(y=this.findValidLinkablePort(y,!0),y!==null||this.startObject===a&&(y=a.port,this.findValidLinkablePort(y,!0)))?(this.isForwards=!1,y):null},Fa.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 Fi&&(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 Fi&&(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)},Fa.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()},Fa.prototype.doStop=function(){uo.prototype.doStop.call(this),this.startObject=null},Fa.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,y=this.transactionResult=null,x=null,E=null,b=null,z=null;try{var ee=this.targetPort=this.findTargetPort(this.isForwards);if(ee!==null){var re=ee.part;re instanceof Fi&&(this.isForwards?(this.originalFromNode!==null&&(y=this.originalFromNode,x=this.originalFromPort),E=re,b=ee):(y=re,x=ee,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?(ee===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)}}},Fa.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(a===null)return!0;if(a instanceof $n)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)},Fa.prototype.insertLink=function(a,y,x,E){return this.diagram.partManager.insertLink(a,y,x,E)},Fa.prototype.doNoLink=function(){},fn.Object.defineProperties(Fa.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 ya=new Ot(Fa,"Either",0),Ks=new Ot(Fa,"ForwardsOnly",0),rs=new Ot(Fa,"BackwardsOnly",0);Fa.className="LinkingTool",Fa.Either=ya,Fa.ForwardsOnly=Ks,Fa.BackwardsOnly=rs;function Bs(){uo.call(this),this.name="Relinking";var a=new lo;a.figure="Diamond",a.desiredSize=Wr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=0,this.V=a,a=new lo,a.figure="Diamond",a.desiredSize=Wr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=-1,this.Xd=a,this.F=null,this.Ew=new Gt}_t(Bs,uo),Bs.prototype.updateAdornments=function(a){if(a!==null&&a instanceof $n){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)}},Bs.prototype.makeAdornment=function(a,y){var x=new Yo;return x.type=Wn.Link,y=y?this.toHandleArchetype:this.fromHandleArchetype,y!==null&&x.add(y.copy()),x.adornedObject=a,x},Bs.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},Bs.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 Yo&&x.adornedPart instanceof $n))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=Rr),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=Rr),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},Bs.prototype.copyLinkProperties=function(a,y){if(a!==null&&y!==null){y.adjusting=a.adjusting,y.corner=a.corner;var x=a.curve;(x===mp||x===oc)&&(x=Sl),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}},Bs.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()},Bs.prototype.doStop=function(){uo.prototype.doStop.call(this),this.handle=null},Bs.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 ee=this.targetPort.part;ee instanceof Fi&&(this.isForwards?(E=ee,b=this.targetPort):(y=ee,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()}}},Bs.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},Bs.prototype.doNoRelink=function(){};function oh(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)}fn.Object.defineProperties(Bs.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 Yo))throw Error("new handle is not in an Adornment: "+a);this.F=a}}}),Bs.className="RelinkingTool",_n("linkingTool",function(){return this.findTool("Linking")},function(a){this.gb("Linking",a,this.mouseMoveTools)}),_n("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.gb("Relinking",a,this.mouseDownTools)});function Hr(){vo.call(this),this.name="LinkReshaping";var a=new lo;a.figure="Rectangle",a.desiredSize=Mo,a.fill="lightblue",a.stroke="dodgerblue",this.o=a,a=new lo,a.figure="Diamond",a.desiredSize=Wr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor="move",this.u=a,this.F=3,this.Ts=this.j=null,this.Fw=new Ie,this.Yq=new Bn}_t(Hr,vo),Hr.prototype.Ru=function(a){return a&&a.reshapingBehavior.value!==0?a.reshapingBehavior:Jl},Hr.prototype.om=function(a,y){a.reshapingBehavior=y},Hr.prototype.updateAdornments=function(a){if(a!==null&&a instanceof $n){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)}},Hr.prototype.makeAdornment=function(a){var y=a.part,x=y.pointsCount,E=y.isOrthogonal,b=null;if(y.points!==null&&1<x){b=new Yo,b.type=Wn.Link,x=y.firstPickIndex;var z=y.lastPickIndex,ee=E?1:0;if(y.resegmentable&&y.computeCurve()!==fu)for(var re=x+ee;re<z-ee;re++){var oe=this.makeResegmentHandle(a,re);oe!==null&&(oe.segmentIndex=re,oe.segmentFraction=.5,oe.fromMaxLinks=999,b.add(oe))}for(ee=x+1;ee<z;ee++)if(re=this.makeHandle(a,ee),re!==null){if(re.segmentIndex=ee,ee!==x)if(ee===x+1&&E){oe=y.i(x);var ue=y.i(x+1);Re.B(oe.x,ue.x)&&Re.B(oe.y,ue.y)&&(ue=y.i(x-1)),Re.B(oe.x,ue.x)?(this.om(re,Ml),re.cursor="n-resize"):Re.B(oe.y,ue.y)&&(this.om(re,Ns),re.cursor="w-resize")}else ee===z-1&&E?(oe=y.i(z-1),ue=y.i(z),Re.B(oe.x,ue.x)&&Re.B(oe.y,ue.y)&&(oe=y.i(z+1)),Re.B(oe.x,ue.x)?(this.om(re,Ml),re.cursor="n-resize"):Re.B(oe.y,ue.y)&&(this.om(re,Ns),re.cursor="w-resize")):ee!==z&&(this.om(re,xh),re.cursor="move");b.add(re)}b.adornedObject=a}return b},Hr.prototype.makeHandle=function(){var a=this.handleArchetype;return a===null?null:a.copy()},Hr.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return a===null?null:a.copy()},Hr.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},Hr.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 $n){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}}},Hr.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},Hr.prototype.stopTransaction=function(){var a=this.diagram,y=vo.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Hr.prototype.doCancel=function(){var a=this.adornedLink;a!==null&&(a.points=this.Yq),this.stopTool()},Hr.prototype.getResegmentingPoint=function(){return this.handle.ga(Kr)},Hr.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))},Hr.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 ee=y.i(x-2);if(Math.abs(E.x-b.x)<this.resegmentingDistance&&Math.abs(E.y-b.y)<this.resegmentingDistance&&(el(this,ee,E,b,z,!0)||el(this,ee,E,b,z,!1))){var re=y.points.copy();el(this,ee,E,b,z,!0)?(re.cd(x-2,new Ie(ee.x,(z.y+ee.y)/2)),re.cd(x+1,new Ie(z.x,(z.y+ee.y)/2))):(re.cd(x-2,new Ie((z.x+ee.x)/2,ee.y)),re.cd(x+1,new Ie((z.x+ee.x)/2,z.y))),re.mb(x),re.mb(x-1),y.points=re,y.Wb()}else ee=y.i(x+2),Math.abs(b.x-z.x)<this.resegmentingDistance&&Math.abs(b.y-z.y)<this.resegmentingDistance&&(el(this,E,b,z,ee,!0)||el(this,E,b,z,ee,!1))&&(re=y.points.copy(),el(this,E,b,z,ee,!0)?(re.cd(x-1,new Ie(E.x,(E.y+ee.y)/2)),re.cd(x+2,new Ie(ee.x,(E.y+ee.y)/2))):(re.cd(x-1,new Ie((E.x+ee.x)/2,E.y)),re.cd(x+2,new Ie((E.x+ee.x)/2,ee.y))),re.mb(x+1),re.mb(x),y.points=re,y.Wb())}}else ee=Ie.alloc(),Re.qh(E.x,E.y,z.x,z.y,b.x,b.y,ee)&&ee.Bf(b)<this.resegmentingDistance*this.resegmentingDistance&&(E=y.points.copy(),E.mb(x),y.points=E,y.Wb()),Ie.free(ee)}a.Ya(),this.transactionResult=this.name,a.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function el(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}Hr.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===Ml?(y.L(x,y.i(x-1).x,a.y),y.L(x+1,y.i(x+2).x,a.y)):E===Ns&&(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===Ml?(y.L(x-1,y.i(x-2).x,a.y),y.L(x,y.i(x+1).x,a.y)):E===Ns&&(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),ee=y.i(E+1);Re.B(z.x,b.x)&&Re.B(b.y,ee.y)?(Re.B(z.x,y.i(E-2).x)&&!Re.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),Re.B(ee.y,y.i(E+2).y)&&!Re.B(ee.x,y.i(E+2).x)?y.m(E+1,ee.x,a.y):y.L(E+1,ee.x,a.y)):Re.B(z.y,b.y)&&Re.B(b.x,ee.x)?(Re.B(z.y,y.i(E-2).y)&&!Re.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),Re.B(ee.x,y.i(E+2).x)&&!Re.B(ee.y,y.i(E+2).y)?y.m(E+1,a.x,ee.y):y.L(E+1,a.x,ee.y)):Re.B(z.x,b.x)&&Re.B(b.x,ee.x)?(Re.B(z.x,y.i(E-2).x)&&!Re.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),Re.B(ee.x,y.i(E+2).x)&&!Re.B(ee.y,y.i(E+2).y)?y.m(E+1,a.x,ee.y):y.L(E+1,a.x,ee.y)):Re.B(z.y,b.y)&&Re.B(b.y,ee.y)&&(Re.B(z.y,y.i(E-2).y)&&!Re.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),Re.B(ee.y,y.i(E+2).y)&&!Re.B(ee.x,y.i(E+2).x)?y.m(E+1,ee.x,a.y):y.L(E+1,ee.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(Kr,Ie.alloc()),E=y.getLinkPointFromPoint(E,b,z,a,!0,Ie.alloc()),y.L(0,E.x,E.y),Ie.free(z),Ie.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(Kr,Ie.alloc()),a=y.getLinkPointFromPoint(E,b,x,a,!1,Ie.alloc()),y.L(y.pointsCount-1,a.x,a.y),Ie.free(x),Ie.free(a));y.zf()},Hr.prototype.computeReshape=function(a){var y=this.adornedLink,x=this.handle.segmentIndex;switch(this.Ru(this.handle)){case xh:return a;case Ml:return new Ie(y.i(x).x,a.y);case Ns:return new Ie(a.x,y.i(x).y);default:case Jl:return y.i(x)}},fn.Object.defineProperties(Hr.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 Yo))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}}}),Hr.prototype.setReshapingBehavior=Hr.prototype.om,Hr.prototype.getReshapingBehavior=Hr.prototype.Ru;var Jl=new Ot(Hr,"None",0),Ns=new Ot(Hr,"Horizontal",1),Ml=new Ot(Hr,"Vertical",2),xh=new Ot(Hr,"All",3);Hr.className="LinkReshapingTool",Hr.None=Jl,Hr.Horizontal=Ns,Hr.Vertical=Ml,Hr.All=xh,_n("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.gb("LinkReshaping",a,this.mouseDownTools)});function Ss(){vo.call(this),this.name="Resizing",this.o=new Pn(1,1).freeze(),this.j=new Pn(9999,9999).freeze(),this.yg=new Pn(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var a=new lo;a.alignmentFocus=Kr,a.figure="Rectangle",a.desiredSize=Mo,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.F=a,this.u=null,this.Xq=new Ie,this.Dw=new Pn,this.Tn=new Ie,this.rt=new Pn(0,0),this.qt=new Pn(1/0,1/0),this.pt=new Pn(1,1)}_t(Ss,vo),Ss.prototype.updateAdornments=function(a){if(!(a===null||a instanceof $n)){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(),Hc(a)&&this.updateResizeHandles(x,y),a.bh(this.name,x);return}}a.Jf(this.name)}},Ss.prototype.makeAdornment=function(a){var y=a.part.resizeAdornmentTemplate;if(y===null){y=new Yo,y.type=Wn.Spot,y.locationSpot=Kr;var x=new xl;x.isPanelMain=!0,y.add(x),y.add(this.makeHandle(a,Co)),y.add(this.makeHandle(a,Ko)),y.add(this.makeHandle(a,Ht)),y.add(this.makeHandle(a,Za)),y.add(this.makeHandle(a,Oo)),y.add(this.makeHandle(a,Lo)),y.add(this.makeHandle(a,Ir)),y.add(this.makeHandle(a,pa))}else if(Tu(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Ss.prototype.makeHandle=function(a,y){return a=this.handleArchetype,a===null?null:(a=a.copy(),a.alignment=y,a)},Ss.prototype.updateResizeHandles=function(a,y){if(a!==null){if(!a.alignment.Xb()&&(a.cursor==="pointer"||0<a.cursor.indexOf("resize")))e:{var x=a.alignment;if(x.Mc()&&(x=Kr),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 e;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 Wn)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,y)}},Ss.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},Ss.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))},Ss.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=a.isMouseCaptured=!1},Ss.prototype.stopTransaction=function(){var a=this.diagram,y=vo.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Ss.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},Ss.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,Ie.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),a.bd(),Ie.free(b)}},Ss.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,Ie.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),Ie.free(b),a.Ya(),this.transactionResult=this.name,a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},Ss.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 no){var E=new Bn;if(E.add(a),!this.dragsMembers&&a.placeholder===null){var b=new ae;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()}},Ss.prototype.computeResize=function(a,y,x,E,b,z){y.Mc()&&(y=Kr);var ee=this.adornedObject.naturalBounds,re=ee.x,oe=ee.y,ue=ee.x+ee.width,he=ee.y+ee.height,pe=1;if(!z){pe=ee.width;var Se=ee.height;0>=pe&&(pe=1),0>=Se&&(Se=1),pe=Se/pe}return Se=Ie.alloc(),Re.No(a.x,a.y,re,oe,b.width,b.height,Se),a=ee.copy(),0>=y.x?0>=y.y?(a.x=Math.max(Se.x,ue-E.width),a.x=Math.min(a.x,ue-x.width),a.width=Math.max(ue-a.x,x.width),a.y=Math.max(Se.y,he-E.height),a.y=Math.min(a.y,he-x.height),a.height=Math.max(he-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(pe*a.width,E.height),x.height),a.width=a.height/pe):(a.width=Math.max(Math.min(a.height/pe,E.width),x.width),a.height=pe*a.width),a.x=ue-a.width,a.y=he-a.height)):1<=y.y?(a.x=Math.max(Se.x,ue-E.width),a.x=Math.min(a.x,ue-x.width),a.width=Math.max(ue-a.x,x.width),a.height=Math.max(Math.min(Se.y-oe,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(pe*a.width,E.height),x.height),a.width=a.height/pe):(a.width=Math.max(Math.min(a.height/pe,E.width),x.width),a.height=pe*a.width),a.x=ue-a.width)):(a.x=Math.max(Se.x,ue-E.width),a.x=Math.min(a.x,ue-x.width),a.width=ue-a.x,z||(a.height=Math.max(Math.min(pe*a.width,E.height),x.height),a.width=a.height/pe,a.y=oe+.5*(he-oe-a.height))):1<=y.x?0>=y.y?(a.width=Math.max(Math.min(Se.x-re,E.width),x.width),a.y=Math.max(Se.y,he-E.height),a.y=Math.min(a.y,he-x.height),a.height=Math.max(he-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(pe*a.width,E.height),x.height),a.width=a.height/pe):(a.width=Math.max(Math.min(a.height/pe,E.width),x.width),a.height=pe*a.width),a.y=he-a.height)):1<=y.y?(a.width=Math.max(Math.min(Se.x-re,E.width),x.width),a.height=Math.max(Math.min(Se.y-oe,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(pe*a.width,E.height),x.height),a.width=a.height/pe):(a.width=Math.max(Math.min(a.height/pe,E.width),x.width),a.height=pe*a.width))):(a.width=Math.max(Math.min(Se.x-re,E.width),x.width),z||(a.height=Math.max(Math.min(pe*a.width,E.height),x.height),a.width=a.height/pe,a.y=oe+.5*(he-oe-a.height))):0>=y.y?(a.y=Math.max(Se.y,he-E.height),a.y=Math.min(a.y,he-x.height),a.height=he-a.y,z||(a.width=Math.max(Math.min(a.height/pe,E.width),x.width),a.height=pe*a.width,a.x=re+.5*(ue-re-a.width))):1<=y.y&&(a.height=Math.max(Math.min(Se.y-oe,E.height),x.height),z||(a.width=Math.max(Math.min(a.height/pe,E.width),x.width),a.height=pe*a.width,a.x=re+.5*(ue-re-a.width))),Ie.free(Se),a},Ss.prototype.computeReshape=function(){var a=kn;return this.adornedObject instanceof lo&&(a=Tv(this.adornedObject)),!(a===ir||this.diagram.lastInput.shift)},Ss.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},Ss.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},Ss.prototype.computeCellSize=function(){var a=new Pn(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},fn.Object.defineProperties(Ss.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 Yo))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 Yo)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}}}),Ss.className="ResizingTool",_n("resizingTool",function(){return this.findTool("Resizing")},function(a){this.gb("Resizing",a,this.mouseDownTools)});function ms(){vo.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new Ie,this.ue=null;var a=new lo;a.figure="Ellipse",a.desiredSize=Wr,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.o=a,this.j=null,this.Cw=0,this.kr=new Ie(NaN,NaN),this.u=0,this.F=50}_t(ms,vo),ms.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)}},ms.prototype.makeAdornment=function(a){var y=a.part.rotateAdornmentTemplate;if(y===null){y=new Yo,y.type=Wn.Position,y.locationSpot=Kr;var x=this.handleArchetype;x!==null&&y.add(x.copy())}else if(Tu(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},ms.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},ms.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)},ms.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(Kr)},ms.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)},ms.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new Ie(NaN,NaN),this.isActive=a.isMouseCaptured=!1},ms.prototype.stopTransaction=function(){var a=this.diagram,y=vo.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},ms.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},ms.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))},ms.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()},ms.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()}},ms.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},fn.Object.defineProperties(ms.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 Yo))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 Yo)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}}}),ms.className="RotatingTool",_n("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function Ql(){vo.call(this),this.name="ClickSelecting"}_t(Ql,vo),Ql.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},Ql.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},Ql.className="ClickSelectingTool";function hu(){vo.call(this),this.name="Action",this.pk=null}_t(hu,vo),hu.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},hu.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()},hu.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))}},hu.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()},hu.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())},hu.prototype.doStop=function(){this.pk=null},hu.className="ActionTool";function Sh(){vo.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new Ie(0,0)}_t(Sh,vo),Sh.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)},Sh.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint),this.stopTool()},Sh.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 pr)x.Zc()&&(Tu(x),E=x.copy(),E!==null&&y.add(E));else if(x!==null){var b=y.model.copyNodeData(x);Qt(b)&&(y.model.xf(b),E=y.Lc(b))}if(E!==null){var z=Ie.allocAt(a.x,a.y);this.isGridSnapEnabled&&Ef(this.diagram,E,a,z),E.location=z,y.allowSelect&&(y.clearSelection(!0),E.isSelected=!0),Ie.free(z)}y.Ya(),this.transactionResult=this.name,y.R("PartCreated",E)}finally{this.stopTransaction(),y.R("ChangedSelection",y.selection)}return E},fn.Object.defineProperties(Sh.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}}}),Sh.className="ClickCreatingTool";function Rl(){vo.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var a=new pr;a.layerName="Tool",a.selectable=!1;var y=new lo;y.name="SHAPE",y.figure="Rectangle",y.fill=null,y.stroke="magenta",a.add(y),this.j=a}_t(Rl,vo),Rl.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))},Rl.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0,a.isMouseCaptured=!0,a.skipsUndoManager=!0,a.add(this.box),this.doMouseMove()},Rl.prototype.doDeactivate=function(){var a=this.diagram;a.ug(),a.remove(this.box),a.skipsUndoManager=!1,this.isActive=a.isMouseCaptured=!1},Rl.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=Pn.alloc().h(y.width,y.height);x.desiredSize=E,this.box.mm(y.x,y.y,!1),Pn.free(E),(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},Rl.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()},Rl.prototype.computeBoxBounds=function(){var a=this.diagram;return new Gt(a.firstInput.documentPoint,a.lastInput.documentPoint)},Rl.prototype.selectInRect=function(a){var y=this.diagram,x=y.lastInput;if(a=y.ux(a,this.isPartialInclusion),Vr?x.meta:x.control)if(x.shift)for(a=a.iterator;a.next();)y=a.value,y.isSelected&&(y.isSelected=!1);else for(a=a.iterator;a.next();)y=a.value,y.isSelected=!y.isSelected;else if(x.shift)for(a=a.iterator;a.next();)y=a.value,y.isSelected||(y.isSelected=!0);else{for(x=new Bn,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)}},fn.Object.defineProperties(Rl.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}}}),Rl.className="DragSelectingTool";function js(){vo.call(this),this.name="Panning",this.Xt=new Ie,this.xy=new Ie,this.xg=!1;var a=this;this.Kw=function(){var y=a.diagram;y!==null&&y.removeEventListener(xn.document,"scroll",a.Kw,!1),a.stopTool()}}_t(js,vo),js.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())},js.prototype.doActivate=function(){var a=this.diagram;this.xg?(a.lastInput.bubbles=!0,a.addEventListener(xn.document,"scroll",this.Kw,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Xt.assign(a.position)),this.isActive=!0},js.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="",this.isActive=a.isMouseCaptured=!1},js.prototype.doCancel=function(){var a=this.diagram;a.position=this.Xt,a.isMouseCaptured=!1,this.stopTool()},js.prototype.doMouseMove=function(){this.move()},js.prototype.doMouseUp=function(){this.move(),this.stopTool()},js.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)}},fn.Object.defineProperties(js.prototype,{bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},originalPosition:{get:function(){return this.Xt}}}),js.className="PanningTool",_n("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.gb("ClickCreating",a,this.mouseUpTools)}),_n("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.gb("ClickSelecting",a,this.mouseUpTools)}),_n("panningTool",function(){return this.findTool("Panning")},function(a){this.gb("Panning",a,this.mouseMoveTools)}),_n("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.gb("DragSelecting",a,this.mouseMoveTools)}),_n("actionTool",function(){return this.findTool("Action")},function(a){this.gb("Action",a,this.mouseDownTools)});function Zu(){this.F=this.u=this.j=this.o=null}fn.Object.defineProperties(Zu.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}}}),Zu.className="HTMLInfo";function du(a,y,x){this.text=a,this.hx=y,this.visible=x}du.className="ContextMenuButtonInfo";function tl(){vo.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new Ie,this.jt=null,this.Et=!1;var a=this;this.tu=function(){a.stopTool()}}_t(tl,vo);function vu(a){var y=new Zu;y.show=function(b,z,ee){ee.showDefaultContextMenu()},y.hide=function(b,z){z.hideDefaultContextMenu()},od=y,a.tu=function(){a.stopTool()},y=Yn("div");var x=Yn("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=Yn("style");xn.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",os,!1),E.addEventListener(y,"selectstart",os,!1),E.addEventListener(x,"contextmenu",os,!1)),y.className="goCXforeground",x.className="goCXbackground",xn.document.body&&(xn.document.body.appendChild(y),xn.document.body.appendChild(x)),Td=y,Dd=x,Bu=!0}function os(a){return a.preventDefault(),!1}tl.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)},tl.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},tl.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},tl.prototype.findObjectWithContextMenu=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.lastInput,E=null;if(a instanceof Vt||(a instanceof Ft?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},tl.prototype.doActivate=function(){},tl.prototype.doMouseDown=function(){if(vo.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof Yo){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doMouseDown(),a.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&Lu(this)},tl.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof Yo){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doCancel(),a.doDeactivate())}Lu(this)};function Lu(a){var y=a.diagram;if(a.isActive){var x=a.currentContextMenu;if(x!==null){var E=null;x instanceof Zu||(E=y.ic(y.lastInput.documentPoint,null,null),E!==null&&E.rg(x)&&a.standardMouseClick(null,null)),a.maybeStopTool(E)}}else a.canStart()&&(wh(a,!0),a.isActive||a.stopTool())}tl.prototype.maybeStopTool=function(){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this,this.doMouseUp())};function wh(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=od,x===null&&(x=a.findObjectWithContextMenu()),x!==null){var E=x.contextMenu;E!==null?(a.currentObject=x instanceof Ft?x:null,a.showContextMenu(E,a.currentObject)):y!==null&&a.showContextMenu(y,a.currentObject)}else y!==null&&a.showContextMenu(y,null);a.currentContextMenu instanceof Yo&&!a.currentContextMenu.visible&&a.stopTool()}}tl.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},tl.prototype.showContextMenu=function(a,y){var x=this.diagram;if(a!==this.currentContextMenu&&this.hideContextMenu(),a instanceof Yo){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 Zu&&a.show(y,x,this);this.currentContextMenu=a},tl.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}},tl.prototype.hideContextMenu=function(){var a=this.diagram,y=this.currentContextMenu;y!==null&&(y instanceof Yo?(a.remove(y),this.ht!==null&&this.ht.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Zu&&(y.hide!==null?y.hide(a,this):y.mainElement!==null&&(y.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};function Oh(a){var y=new Bn;return y.add(new du("Copy",function(x){x.commandHandler.copySelection()},function(x){return x.commandHandler.canCopySelection()})),y.add(new du("Cut",function(x){x.commandHandler.cutSelection()},function(x){return x.commandHandler.canCutSelection()})),y.add(new du("Delete",function(x){x.commandHandler.deleteSelection()},function(x){return x.commandHandler.canDeleteSelection()})),y.add(new du("Paste",function(x){x.commandHandler.pasteSelection(a.mouseDownPoint)},function(x){return x.commandHandler.canPasteSelection(a.mouseDownPoint)})),y.add(new du("Select All",function(x){x.commandHandler.selectAll()},function(x){return x.commandHandler.canSelectAll()})),y.add(new du("Undo",function(x){x.commandHandler.undo()},function(x){return x.commandHandler.canUndo()})),y.add(new du("Redo",function(x){x.commandHandler.redo()},function(x){return x.commandHandler.canRedo()})),y.add(new du("Scroll To Part",function(x){x.commandHandler.scrollToPart()},function(x){return x.commandHandler.canScrollToPart()})),y.add(new du("Zoom To Fit",function(x){x.commandHandler.zoomToFit()},function(x){return x.commandHandler.canZoomToFit()})),y.add(new du("Reset Zoom",function(x){x.commandHandler.resetZoom()},function(x){return x.commandHandler.canResetZoom()})),y.add(new du("Group Selection",function(x){x.commandHandler.groupSelection()},function(x){return x.commandHandler.canGroupSelection()})),y.add(new du("Ungroup Selection",function(x){x.commandHandler.ungroupSelection()},function(x){return x.commandHandler.canUngroupSelection()})),y.add(new du("Edit Text",function(x){x.commandHandler.editTextBlock()},function(x){return x.commandHandler.canEditTextBlock()})),y}tl.prototype.showDefaultContextMenu=function(){var a=this.diagram;this.jt===null&&(this.jt=Oh(this)),Td.innerHTML="",Dd.addEventListener("pointerdown",this.tu,!1);var y=this,x=Yn("ul");x.className="goCXul",Td.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=Yn("li"),z.className="goCXli";var ee=Yn("a");ee.className="goCXa",ee.href="#",ee.ky=b.hx,ee.addEventListener("pointerdown",function(re){return this.ky(a),y.stopTool(),re.preventDefault(),!1},!1),ee.textContent=b.text,z.appendChild(ee),x.appendChild(z)}}Td.style.display="block",Dd.style.display="block"},tl.prototype.hideDefaultContextMenu=function(){if(this.currentContextMenu!==null&&this.currentContextMenu===od){Td.style.display="none",Dd.style.display="none";var a=this.diagram;a!==null&&a.removeEventListener(Dd,"pointerdown",this.tu,!1),this.currentContextMenu=null}},fn.Object.defineProperties(tl.prototype,{currentContextMenu:{get:function(){return this.j},set:function(a){this.j=a,this.ht=a instanceof Yo?a.adornedPart:null}},defaultTouchContextMenu:{get:function(){return Bu===!1&&od===null&&Ja&&vu(this),od},set:function(a){a===null&&(Bu=!0),od=a}},currentObject:{get:function(){return this.o},set:function(a){this.o=a}},mouseDownPoint:{get:function(){return this.yw}}});var od=null,Bu=!1,Dd=null,Td=null;tl.className="ContextMenuTool",_n("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.gb("ContextMenu",a,this.mouseUpTools)});function Aa(){vo.call(this),this.name="TextEditing",this.Zh=new ja,this.ia=null,this.V=Id,this.vj=null,this.qa=Od,this.u=1,this.F=!0,this.o=null,this.j=new Zu,this.kt=null,Sc(this,this.j)}_t(Aa,vo);function Sc(a,y){if(Ja){var x=Yn("textarea");a.kt=x,x.addEventListener("input",function(){if(a.textBlock!==null){var E=a.Lx(this.value);this.style.width=20+E.measuredBounds.width*this.wA+"px",this.rows=E.lineCount}},!1),x.addEventListener("keydown",function(E){if(!E.isComposing&&a.textBlock!==null){var b=E.key;b==="Enter"?(a.textBlock.isMultiline===!1&&E.preventDefault(),a.acceptText(_d)):b==="Tab"?(a.acceptText(Pc),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===ad&&(a.qa=Rd),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 ja&&z instanceof Aa)if(z.state===bc)x.style.border="3px solid red",x.focus();else{var ee=E.ga(Kr),re=b.position,oe=b.scale,ue=E.Df()*oe;ue<z.minimumEditorScale&&(ue=z.minimumEditorScale);var he=E.naturalBounds.width*ue+6,pe=E.naturalBounds.height*ue+2,Se=(ee.x-re.x)*oe;ee=(ee.y-re.y)*oe,re=E.verticalAlignment,oe=(E.lineHeight+E.spacingAbove+E.spacingBelow)*E.lineCount*ue,pe=re.y*pe-re.y*oe+re.offsetY-(.5*pe-.5*oe)-oe/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*ue+"%",x.style.lineHeight="normal",x.style.width=he+"px",x.style.left=(Se-he/2|0)-1+"px",x.style.top=(ee+pe|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=ue,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)}}}Aa.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||a.isReadOnly||jh&&jh!==this&&(jh.acceptText(Gu),jh&&jh!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var y=a.ic(a.lastInput.documentPoint);return y!==null&&y instanceof ja&&y.editable&&y.part.canEdit()?(y=y.part,!(y===null||this.starting===Id&&!y.isSelected||this.starting===Ec&&2>a.lastInput.clickCount)):!1},Aa.prototype.doStart=function(){jh=this,this.textBlock!==null&&this.doActivate()},Aa.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 ja&&(this.textBlock=y,y.part!==null)){a.animationManager.Cc(),this.isActive=!0,this.qa=ad;var x=this.defaultTextEditor;y.textEditor!==null&&(x=y.textEditor),this.Zh=this.textBlock.copy();var E=new Gt(this.textBlock.ga(Co),this.textBlock.ga(Ht));a.tv(E),x.show(y,a,this),this.currentTextEditor=x}}}},Aa.prototype.doCancel=function(){this.stopTool()},Aa.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},Aa.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Gu)},Aa.prototype.acceptText=function(a){switch(a){case Gu:this.qa===Rh?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.qa===ad||this.qa===bc||this.qa===Rd)&&(this.qa=Cc,ff(this));break;case wc:case _d:case Pc:(_d!==a||this.textBlock.isMultiline!==!0)&&(this.qa===ad||this.qa===bc||this.qa===Rd)&&(this.qa=Cc,ff(this))}};function ff(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=Rh,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=bc,a.doError(b,z))}}Aa.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)},Aa.prototype.doSuccess=function(a,y){var x=this.textBlock;x.textEdited!==null&&x.textEdited(x,a,y)},Aa.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)},Aa.prototype.doStop=function(){jh=null},Aa.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)))},Aa.prototype.Lx=function(a){var y=this.Zh;return y.text=a,y.measure(this.textBlock.Ih,1/0),y},fn.Object.defineProperties(Aa.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)}}}),Aa.prototype.measureTemporaryTextBlock=Aa.prototype.Lx;var wc=new Ot(Aa,"LostFocus",0),Gu=new Ot(Aa,"MouseDown",1),Pc=new Ot(Aa,"Tab",2),_d=new Ot(Aa,"Enter",3),zp=new Ot(Aa,"SingleClick",0),Id=new Ot(Aa,"SingleClickSelected",1),Ec=new Ot(Aa,"DoubleClick",2),Od=new Ot(Aa,"StateNone",0),ad=new Ot(Aa,"StateActive",1),Rd=new Ot(Aa,"StateEditing",2),Cc=new Ot(Aa,"StateValidating",3),bc=new Ot(Aa,"StateInvalid",4),Rh=new Ot(Aa,"StateValidated",5),jh=null;Aa.className="TextEditingTool",Aa.LostFocus=wc,Aa.MouseDown=Gu,Aa.Tab=Pc,Aa.Enter=_d,Aa.SingleClick=zp,Aa.SingleClickSelected=Id,Aa.DoubleClick=Ec,Aa.StateNone=Od,Aa.StateActive=ad,Aa.StateEditing=Rd,Aa.StateValidating=Cc,Aa.StateInvalid=bc,Aa.StateValidated=Rh,_n("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)});function kl(a){Al||(Yf(),Al=!0),this.H=sh,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=Hu,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new In,this.ce=new zs,this.ce.Yd=this,this.Ei=new In,this.pu=new In,this.Sr=new In,this.pr=new In,a&&Object.assign(this,a)}kl.prototype.Xe=function(a){this.H=a},kl.prototype.canStart=function(){return!0};function ah(a,y){a.Jd&&a.canStart(y)&&(a.Zd.add(y),a.defaultAnimation.isAnimating&&a.Cc(),Ps(a.H),a.zb=!0)}function Fc(a){if(a.Jd&&a.zb){var y=a.ce,x=a.H,E=a.Zd.contains("Model");E&&(a.Ok=!0,a.Pk===Hu?(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===Xf&&y.vc.clear(),a.Qw=!!(a.Pk===jd&&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(),Ch(y,x),a.Ok=!1,x.N()):(a.Zd.clear(),x.kg=!1,E=y.vc.get(x),x.autoScale!==Ys&&E!==null&&(delete E.start.scale,delete E.end.scale),xn.requestAnimationFrame(function(){a.zb===!1||y.bc||(x.Gf("temporaryPixelRatio")&&sl(x),Qf(x),a.zb=!1,y.start(),y.bc&&(yu(a),x.Ya(),Jf(y,0),$l(x,!0),Eh(a),x.R("AnimationStarting",a)))}))}}function Ph(a){return a.Zd.contains("Trigger")&&a.Zd.count===1}function gf(a,y,x,E){a.isTicking||Ph(a)||y instanceof $n&&(y.fromNode!==null||y.toNode!==null)||a.ce.add(y,"position",x,E,!1)}be=kl.prototype,be.fv=function(a){return this.ce.fv(a)},be.Xu=function(a){return this.ce.Xu(a)};function pf(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 ee=z.value;if(ee.bc!==!1){e:if(0<ee.yl.count)var re=!0;else{for(re=ee.vc.iterator;re.next();){var oe=re.key;if(oe instanceof Ft&&oe.diagram!==null||oe instanceof Vt){re=!0;break e}}re=!1}re?Mc(ee,!1):ee.Xk=!0}}b.pu.clear(),b.bc!==!1&&(yu(b),$l(b.H),Eh(b)),xn.requestAnimationFrame(x)}}var E=a.Ei,b=a;a.bc?a.Sr.add(y):(a.bc=!0,E.add(y),xn.requestAnimationFrame(function(){x()}))}function sd(a){for(a=a.Ei.iterator;a.next();)a.value.Xk=!1}function yu(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 Eh(a){var y=a.H;y.skipsUndoManager=a.Ow,y.skipsModelSourceBindings=a.cw,a.vq=!1}be.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(),Ch(y,null),a===!0)for(a=this.Ei.Fa(),y=0;y<a.length;y++)a[y].Ml(!0)}else y.vc.clear(),Ch(y,this.H)},be.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))},be.Cj=function(a,y){this.zb&&(this.Zd.contains("Expand Tree")||this.Zd.contains("Expand SubGraph"))&&(this.ce.Cj(a,y),gl(this,a))},be.Aj=function(a,y){this.zb&&(this.Zd.contains("Collapse Tree")||this.Zd.contains("Collapse SubGraph"))&&(this.ce.Aj(a,y),bh(this.ce,y,"position",y.position,y.position),gl(this,a))};function Gg(a,y,x){!a.zb||y.D(x)||Ph(a)||(a.H.pi||(y=x.copy()),bh(a.ce,a.H,"position",y,x))}function Lc(a,y,x){y.fd&&(y.Tg=x,a.pr.add(y))}function gl(a,y){for(y=y.findLinksConnected();y.next();){var x=y.value;x.fd&&(x.Tg=x.points.copy(),a.pr.add(x))}}function Wu(a,y,x,E,b){a===null&&(a=[0,0,0,0]),y===null&&(y=[0,0,0,0]);var z=a[0],ee=a[1],re=a[2];a=a[3];var oe=y[0],ue=y[1],he=y[2];return y=y[3],re===0||re===100?(z=oe,ee=ue):(he===0||he===100)&&(oe=z,ue=ee),180<Math.abs(oe-z)&&(oe>z?z+=360:oe+=360),z=b(x,z,oe-z,E)%360,ee=b(x,ee,ue-ee,E),re=b(x,re,he-re,E),x=b(x,a,y-a,E),"hsla("+z+", "+ee+"%, "+re+"%, "+x+")"}function Yf(){function a(x,E,b,z,ee,re){x.position=new Ie(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re))}var y=new Rt;y.add("position:diagram",a),y.add("position",a),y.add("position:part",function(x,E,b,z,ee,re){ee<re?x.mm(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re),!1):x.position=new Ie(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re))}),y.add("location",function(x,E,b,z,ee,re){ee<re?x.mm(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re),!0):x.location=new Ie(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re))}),y.add("position:placeholder",function(x,E,b,z,ee,re){ee<re?x.mm(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re),!1):x.position=new Ie(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re))}),y.add("position:nodeCollapse",function(x,E,b,z,ee,re){var oe=x.actualBounds,ue=b.actualBounds;b=ue.x+ue.width/2-oe.width/2,oe=ue.y+ue.height/2-oe.height/2,ee<re?x.mm(z(ee,E.x,b-E.x,re),z(ee,E.y,oe-E.y,re),!1):x.position=new Ie(z(ee,E.x,b-E.x,re),z(ee,E.y,oe-E.y,re))}),y.add("desiredSize",function(x,E,b,z,ee,re){x.desiredSize=new Gt(z(ee,E.width,b.width-E.width,re),z(ee,E.height,b.height-E.height,re))}),y.add("width",function(x,E,b,z,ee,re){x.width=z(ee,E,b-E,re)}),y.add("height",function(x,E,b,z,ee,re){x.height=z(ee,E,b-E,re)}),y.add("fill",function(x,E,b,z,ee,re){x.fill=Wu(E,b,ee,re,z)}),y.add("stroke",function(x,E,b,z,ee,re){x.stroke=Wu(E,b,ee,re,z)}),y.add("strokeWidth",function(x,E,b,z,ee,re){x.strokeWidth=z(ee,E,b-E,re)}),y.add("strokeDashOffset",function(x,E,b,z,ee,re){x.strokeDashOffset=z(ee,E,b-E,re)}),y.add("background",function(x,E,b,z,ee,re){x.background=Wu(E,b,ee,re,z)}),y.add("areaBackground",function(x,E,b,z,ee,re){x.areaBackground=Wu(E,b,ee,re,z)}),y.add("opacity",function(x,E,b,z,ee,re){x.opacity=z(ee,E,b-E,re)}),y.add("scale",function(x,E,b,z,ee,re){x.scale=z(ee,E,b-E,re)}),y.add("angle",function(x,E,b,z,ee,re){x.angle=z(ee,E,b-E,re)}),Bc=y}fn.Object.defineProperties(kl.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&&Kn(a,">= 1",kl,"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}}}),kl.prototype.stopAnimation=kl.prototype.Cc;var Bc=null,Al=!1,Hu=new Ot(kl,"Default",1),jd=new Ot(kl,"AnimateLocations",2),Xf=new Ot(kl,"None",3);kl.className="AnimationManager",kl.defineAnimationEffect=function(a,y){Al||(Yf(),Al=!0),Bc.add(a,y)},kl.Default=Hu,kl.AnimateLocations=jd,kl.None=Xf;function zs(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=zh,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=qn,this.vc=new Rt,this.Tt=new Rt,this.yl=new In,this.Ut=new In,this.dw=Kh,a&&Object.assign(this,a)}zs.prototype.suspend=function(){this.Xk=!0},zs.prototype.advanceTo=function(a,y){y&&(this.Xk=!1),this.ho&&a>=this.Gd&&(this.Wk=!0,a-=this.Gd),this.gw=a,Mc(this,!0),yu(this.Yd),$l(this.H),Eh(this.Yd),this.H.redraw()};function Ch(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}be=zs.prototype,be.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 Vt?a=x:x instanceof Ft&&(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===Hu&&this===y.defaultAnimation&&(this.Lp=zd,this.Gd=isNaN(this.Dg)?y.duration===600?900:y.duration:this.Dg),this.dw=a.scrollMode,this.isViewportUnconstrained&&(a.sj=Yd),yu(y),this.yl.each(function(E){E.data=null,a.add(E)}),Eh(y),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,pf(y,this),this)},be.Iy=function(a,y){return a.Zc()?(this.yl.add(a),this.H=y,this):this},be.add=function(a,y,x,E,b){if(y==="position"&&x.Xa(E))return this;if(this.H===null&&(a instanceof Vt?this.H=a:a instanceof Ft&&a.diagram!==null&&(this.H=a.diagram)),a instanceof pr){if(!a.isAnimated)return this;y==="position"&&(y="position:part")}return bh(this,a,y,x,E,b),this};function bh(a,y,x,E,b,z){var ee=a.vc;if(y instanceof Vt&&x==="position"&&(x="position:diagram"),(x==="fill"||x==="stroke"||x==="background"||x==="areaBackground")&&(Du(E),Mf(),E=[rl.j,rl.u,rl.o,rl.F],Du(b),Mf(),b=[rl.j,rl.u,rl.o,rl.F]),ee.contains(y)){var re=ee.I(y),oe=re.start,ue=re.end;oe[x]===void 0&&(oe[x]=ld(E)),ue[x]=ld(b)}else oe={},ue={},oe[x]=ld(E),ue[x]=ld(b),re=oe.position,y instanceof Ft&&re instanceof Ie&&!re.w()&&y.diagram.animationManager.Zd.contains("Expand SubGraph")&&re.assign(ue.position),re=new ud(oe,ue,z),ee.add(y,re);ee=oe[x],ee instanceof Ie&&!ee.w()&&ee.assign(a.o),z&&x.indexOf("position:")===0&&y instanceof pr?re.Ku.location=ld(y.location):z&&(re.Ku[x]=ld(E))}function ld(a){return a instanceof Ie||a instanceof Pn?a.copy():a}be.fv=function(a){return this.bc?(a=this.vc.I(a),a!==null&&a.nv):!1},be.Xu=function(a){return this.bc?(a=this.vc.I(a),a!==null&&(a.start.position||a.start.location)):!1};function Mc(a,y){if(!a.Xk||y){var x=a.Yd;if(a.bc!==!1){var E=+new Date,b=E>a.cn?a.Gd:E-a.Qd;y&&(b=a.gw,b<a.Gd?(a.Qd=+new Date-b,a.cn=a.Qd+a.Gd):b=a.Gd),yu(x),Jf(a,b),$l(a.H,!0),Eh(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 Jf(a,y){for(var x=a.Gd,E=a.vc.iterator,b=a.Wk;E.next();){var z=E.key;if(!(z instanceof Ft&&z.diagram===null)){var ee=E.value,re=b?ee.end:ee.start;ee=b?ee.start:ee.end;var oe=Bc,ue;for(ue in ee)ue==="position"&&(ee["position:placeholder"]||ee["position:nodeCollapse"])||oe.get(ue)===null||oe.get(ue)(z,re[ue],ee[ue],a.Lp,y,x,a)}}}be.stop=function(){return this.bc?(this.Ml(!0),this):this},be.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,yu(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=Bc;E.next();){var ee=E.key,re=E.value,oe=b?re.end:re.start,ue=b?re.start:re.end,he=re.Ku,pe;for(pe in ue)if(z.get(pe)!==null){var Se=pe;!re.Hu||Se!=="position:nodeCollapse"&&Se!=="position:placeholder"||(Se="position"),z.get(Se)(ee,oe[pe],he[pe]!==void 0?he[pe]:re.Hu?oe[pe]:ue[pe],this.Lp,this.Gd,this.Gd,this)}re.Hu&&he.location!==void 0&&ee instanceof pr&&(ee.location=he.location),re.nv&&ee instanceof pr&&ee.Zb(!1)}if(y.As.clear(),cd(y,!1),y.Ya(),y.N(),$l(y,!0),x.defaultAnimation===this){for(pe=x.pr.iterator;pe.next();)b=pe.value,b.Tg!==null&&(b.points=b.Tg,b.Tg=null);x.pr.clear()}$l(y,!0),this.isViewportUnconstrained&&(y.scrollMode=this.dw),Eh(x),this.au++,!a&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),Ch(this,null),x.Ml(this),y.$b())}},be.Cj=function(a,y){var x=y.actualBounds,E=null;if(y instanceof no&&(E=y.placeholder),E!==null?(x=E.ga(Co),E=E.padding,x.x+=E.left,x.y+=E.top,this.add(a,"position",x,a.position,!1)):this.add(a,"position",new Ie(x.x+x.width/2,x.y+x.height/2),a.position,!1),this.add(a,"scale",.01,a.scale,!1),a instanceof no)for(a=a.memberParts;a.next();)E=a.value,E instanceof Fi&&this.Cj(E,y)},be.Aj=function(a,y){if(a.isVisible()){var x=null;if(y instanceof no&&(x=y.placeholder),x!==null){var E=x.ga(Co);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 no)for(a=a.memberParts;a.next();)E=a.value,E instanceof Fi&&this.Aj(E,y)}},be.Ez=function(a){var y=this.Tt.get(a);return y===null&&(y={},this.Tt.add(a,y)),y},fn.Object.defineProperties(zs.prototype,{duration:{get:function(){return this.Dg},set:function(a){1>a&&Kn(a,">= 1",zs,"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:at("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}}}),zs.prototype.getTemporaryState=zs.prototype.Ez,zs.prototype.stop=zs.prototype.stop,zs.prototype.add=zs.prototype.add,zs.prototype.addTemporaryPart=zs.prototype.Iy;function zh(a,y,x,E){return a/=E/2,1>a?x/2*a*a+y:-x/2*(--a*(a-2)-1)+y}function zd(a,y,x,E){return a===E?y+x:x*(-Math.pow(2,-10*a/E)+1)+y}zs.className="Animation",zs.EaseLinear=function(a,y,x,E){return x*a/E+y},zs.EaseInOutQuad=zh,zs.EaseInQuad=function(a,y,x,E){return x*(a/=E)*a+y},zs.EaseOutQuad=function(a,y,x,E){return-x*(a/=E)*(a-2)+y},zs.EaseInExpo=function(a,y,x,E){return a===0?y:x*Math.pow(2,10*(a/E-1))+y},zs.EaseOutExpo=zd;function ud(a,y,x){this.start=a,this.end=y,this.Ku={},this.Hu=x,this.nv=!1}ud.className="AnimationState";function xu(a,y,x){this.xd=null,this.rf=a,this.so=x||mf,this.uk=null,y!==void 0&&(this.uk=y,x===void 0&&(this.so=hd))}xu.prototype.copy=function(){var a=new xu(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 Wg(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))}fn.Object.defineProperties(xu.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 mf=new Ot(xu,"Default",1),hd=new Ot(xu,"Immediate",2),Zd=new Ot(xu,"Bundled",3);xu.className="AnimationTrigger",xu.Default=mf,xu.Immediate=hd,xu.Bundled=Zd;function ws(a){Er(this),this.H=null,this.Pa=new Bn,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)}be=ws.prototype,be.clear=function(){for(var a=this.Pa,y=0;y<a.length;y++){var x=a.s[y];x.Ig=null,Ws(x)}a.clear(),this.Zq.length=0},be.Xe=function(a){this.H=a},be.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,ee=0,re=this.Pa.iterator;re.next();){var oe=re.value;oe instanceof no?b++:oe instanceof Fi?E++:oe instanceof $n?z++:oe instanceof Yo?ee++:x++}if(re="",0<x&&(re+=x+" Parts "),0<E&&(re+=E+" Nodes "),0<b&&(re+=b+" Groups "),0<z&&(re+=z+" Links "),0<ee&&(re+=ee+" Adornments "),1<a)for(a=this.Pa.iterator;a.next();)x=a.value,re+=`
`+x.toString(),E=x.data,E!==null&&wr(E)&&(re+=" #"+wr(E)),x instanceof Fi?re+=" "+Pr(E):x instanceof $n&&(re+=" "+Pr(x.fromNode)+" "+Pr(x.toNode));return y+" "+this.Pa.count+": "+re},be.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=Ie.alloc(),z=this.Pa.s,ee=z.length;ee--;){var re=z[ee];if((E!==!0||Hc(re)!==!1)&&re.isVisible()&&(b.assign(a),ti(b,re.oe),re=re.ic(b,y,x),re!==null&&(y!==null&&(re=y(re)),re!==null&&(x===null||x(re)))))return Ie.free(b),re}return Ie.free(b),null},be.ji=function(a,y,x,E){if(y===void 0&&(y=null),x===void 0&&(x=null),E instanceof Bn||E instanceof In||(E=new In),this.Uh===!1)return E;var b=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(b=!0);for(var z=Ie.alloc(),ee=this.Pa.s,re=ee.length;re--;){var oe=ee[re];if((b!==!0||Hc(oe)!==!1)&&oe.isVisible()){z.assign(a),ti(z,oe.oe);var ue=oe;oe.ji(z,y,x,E)&&(y!==null&&(ue=y(ue)),ue===null||x!==null&&!x(ue)||E.add(ue))}}return Ie.free(z),E},be.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 Bn||b instanceof In||(b=new In),this.Uh===!1)return b;var z=!1;this.diagram!==null&&this.diagram.viewportBounds.Re(a)&&(z=!0);for(var ee=this.Pa.s,re=ee.length;re--;){var oe=ee[re];if((z!==!0||Hc(oe)!==!1)&&oe.isVisible()){var ue=oe;oe.Cf(a,y,x,E,b)&&(y!==null&&(ue=y(ue)),ue===null||x!==null&&!x(ue)||b.add(ue))}}return b},be.Nu=function(a,y,x,E,b,z,ee){if(this.Uh===!1)return b;for(var re=this.Pa.s,oe=re.length;oe--;){var ue=re[oe];if((ee!==!0||Hc(ue)!==!1)&&z(ue)&&ue.isVisible()){var he=ue;ue.Cf(a,y,x,E,b)&&(y!==null&&(he=y(he)),he===null||x!==null&&!x(he)||b.add(he))}}return b},be.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 Bn||b instanceof In)&&(z=b),b=!0),z instanceof Bn||z instanceof In||(z=new In),this.Uh===!1)return z;var ee=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(ee=!0);for(var re=Ie.alloc(),oe=Ie.alloc(),ue=this.Pa.s,he=ue.length;he--;){var pe=ue[he];if((ee!==!0||Hc(pe)!==!1)&&pe.isVisible()){re.assign(a),ti(re,pe.oe),oe.h(a.x+y,a.y),ti(oe,pe.oe);var Se=pe;pe.og(re,oe,x,E,b,z)&&(x!==null&&(Se=x(Se)),Se===null||E!==null&&!E(Se)||z.add(Se))}}return Ie.free(re),Ie.free(oe),z},be.Fd=function(a,y){if(this.visible){var x=this.Pa.s,E=x.length;if(E!==0){a=xi();for(var b=xi(),z=0;z<E;z++){var ee=x[z];if(ee.vw=z,ee instanceof $n){if(ee.fd===!1)continue}else if(ee instanceof Yo&&ee.adornedPart!==null)continue;var re=ee.actualBounds;ee.isVisible()&&ma(re,y)?(ee.Fd(!0),a.push(ee)):(ee.Fd(!1),ee.adornments!==null&&0<ee.adornments.count&&b.push(ee))}for(y=0;y<a.length;y++)for(x=a[y],Vv(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++)Vv(b[y]);Bi(a),Bi(b)}}};function Fh(a,y){var x=1;return a.pb!==1&&(x=y.globalAlpha,y.globalAlpha=x*a.pb),x}be.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=Fh(this,a);var z=this.Zq;z.length=0;for(var ee=y.scale,re=Gt.alloc(),oe=0;oe<E;oe++)this.Oj(a,x[oe],y,z,ee,re,!0);if(Gt.free(re),a.isTemporary)for(y=0;y<E;y++)x[y].Gj();a.globalAlpha=b}}};function Hg(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 ee=Fh(a,y),re=a.Zq;re.length=0;for(var oe=x.scale,ue=Gt.alloc(),he=0;he<z;he++){var pe=b[he];E.contains(pe)&&a.Oj(y,pe,x,re,oe,ue,!1)}Gt.free(ue),y.globalAlpha=ee}}}be.Oj=function(a,y,x,E,b,z,ee){if(ee&&!Hc(y))a.Hs(y);else{if(E!==null&&y instanceof $n&&(y.isOrthogonal&&E.push(y),y.fd===!1)){a.Hs(y);return}for(ee=!1,E=y.containingGroup;E!==null;)ee?E.tb!==null&&z.Ex(E.tb):E.tb!==null&&(ee=!0,z.assign(E.tb)),E=E.containingGroup;var re=y.actualBounds;if(E=!1,ee&&y.isVisible()){if(!z.Yc(re)){a.Hs(y);return}E=!z.Re(re)}E&&(a.save(),a instanceof da?a.bk=z.copy():(a.beginPath(),a.rect(z.x,z.y,z.width,z.height),a.clip())),re.width*b>x.Oq||re.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&&(Qa(y,a,y.areaBackground,!0,!0,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.areaBackground===null&&y.background===null&&(Qa(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),Qa(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))}},be.g=function(a,y,x,E,b){var z=this.diagram;z!==null&&z.cb(oo,a,this,y,x,E,b)},be.oi=function(a,y,x){var E=this.Pa;if(y.Ig=this,this===null&&Ws(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)),dd(this,a,y),a},be.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,Ws(y),a};function dd(a,y,x){if(y=Vg(a,y,x),x instanceof no&&x!==null&&isNaN(x.zOrder)){if(x.memberParts.count!==0){for(var E=-1,b=a.Pa.s,z=b.length,ee=0;ee<z;ee++){var re=b[ee];if(re===x&&(y=ee,0<=E)||0>E&&re.containingGroup===x&&(E=ee,0<=y))break}!(0>E)&&E<y&&(b=a.Pa,b.mb(y),b.Gb(E,x))}y=x.containingGroup,y!==null&&dd(a,-1,y)}x.svg!==null&&x.svg.remove()}function Vg(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,ee=NaN;0<=z&&(ee=a.M(z).zOrder,!!isNaN(ee));)z--;for(var re=y+1,oe=NaN;re<b&&(oe=a.M(re).zOrder,!!isNaN(oe));)re++;if(!isNaN(ee)&&ee>E)for(;;){if(z===-1||ee<=E){if(z++,z===y)break;return a.mb(y),a.Gb(z,x),z}for(ee=NaN;0<=--z&&(ee=a.M(z).zOrder,isNaN(ee)););}else if(!isNaN(oe)&&oe<E)for(;;){if(re===b||oe>=E){if(re--,re===y)break;return a.mb(y),a.Gb(re,x),re}for(oe=NaN;++re<b&&(oe=a.M(re).zOrder,isNaN(oe)););}return y}fn.Object.defineProperties(ws.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===""&&at("Cannot rename default Layer to: "+a),x=x.layers;x.next();)x.value.name===a&&at("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)&&Kn(a,"0 <= value <= 1",ws,"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))}}}),ws.prototype.findObjectsNear=ws.prototype.og,ws.prototype.findObjectsIn=ws.prototype.Cf,ws.prototype.findObjectsAt=ws.prototype.ji,ws.prototype.findObjectAt=ws.prototype.ic,ws.className="Layer";function Vt(a,y){if(ip||(Xs(),ip=!0),Er(this),sh=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,Ja){var x=this,E=function(){x.removeEventListener(xn.document,"DOMContentLoaded",E,!1),x.setRTL()};xn.document.body!==null?this.setRTL():x.addEventListener(xn.document,"DOMContentLoaded",E,!1)}this.ol=null,Ff.add("Model",Sa);var b=this;return this.Hb=function(z){var ee=b.partManager;if(z.model===ee.diagram.model&&ee.diagram.aa){ee.diagram.aa=!1;try{var re=z.change;z.modelChange===""&&re===oo&&ee.updateDataBindings(z.object,z.propertyName)}finally{ee.diagram.aa=!0}}},this.Oc=function(z){b.partManager.doModelChanged(z)},this.hu=this.ku=null,Kg(this),this.model=Sy(),this.Wg=!0,Jg(this),this.layout=new Va,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 Bf,a!==void 0&&(typeof a=="string"||xn.Element&&a instanceof Element?Xg(this,a):y=a),this.vb=!1,y&&this.nm(y),this}var Zh,sh;function Kg(a){a.Yd=new kl,a.Yd.Xe(a),a.Db=17,a.Gw=!1,a.tn=!1,a.bu="default",a.Wa=new Bn,a.pj=new Rt,a.nl="default",a.Tx(),a.Sx(),a.pb=1,a.pa=new Ie(NaN,NaN).freeze(),a.du=new Ie(NaN,NaN),a.Ca=1,a.Pp=1,a.zt=new Ie(NaN,NaN).freeze(),a.At=NaN,a.Ot=1e-4,a.Mt=100,a.Ab=new pt,a.zu=new Ie(NaN,NaN).freeze(),a.ut=new Gt(NaN,NaN,NaN,NaN).freeze(),a.rj=new $r(0,0,0,0).freeze(),a.sj=Kh,a.nu=!1,a.Zt=null,a.fu=null,a.yh=Ys,a.zk=or,a.Fg=Ys,a.pq=or,a.yt=Co,a.Bt=Co,a.Fc=!0,a.pn=!1,a.De=new In,a.Eh=new Rt,a.Xm=!0,a.vp=250,a.vk=-1,a.xp=new $r(16,16,16,16).freeze(),a.kg=!1,a.Jk=!1,a.fn=!0,a.bq=new vr,a.bq.diagram=a,a.Qg=new vr,a.Qg.diagram=a,a.cj=new vr,a.cj.diagram=a,a.zg=null,a.pf=null,a.qu=!1,Zp(a),a.ai=new In,a.Ht=!0,a.uu=Ku,a.pw=!1,a.wu=jc,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 Rt,a.Xn=new Bn,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 $r(5).freeze(),a.Hw=new In().freeze(),a.Nt=999999999,a.nw=new In().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 In,a.ow=new In,a.Xh=null,a.aw=new Pn(8,8),a.bw=999,a.Bw=1,a.Jw=0,a.fc={scale:1,position:new Ie,bounds:new Gt,Py:new Pn,bA:new Pn,Oz:!1},a.fc.canvasSize=a.fc.Py,a.fc.newCanvasSize=a.fc.bA,a.fc.isScroll=!1,a.Rw=new Gt(NaN,NaN,NaN,NaN).freeze(),a.wo=new Pn(NaN,NaN).freeze(),a.Sp=new Gt(NaN,NaN,NaN,NaN).freeze(),a.It=!1,a.Lg=new Rt;var y=new Fi,x=new ja;x.bind(new ds("text","",Pr)),y.add(x),a.ny=y,a.Lg.add("",y),y=new Fi,x=new ja,x.stroke="brown",x.bind(new ds("text","",Pr)),y.add(x),a.Lg.add("Comment",y),y=new Fi,y.selectable=!1,y.avoidable=!1,x=new lo,x.figure="Ellipse",x.fill="black",x.stroke=null,x.desiredSize=new Pn(3,3).ja(),y.add(x),a.Lg.add("LinkLabel",y),a.Yi=new Rt,y=new no,y.selectionObjectName="GROUPPANEL",y.type=Wn.Vertical,x=new ja,x.font="bold 12pt sans-serif",x.bind(new ds("text","",Pr)),y.add(x),x=new Wn(Wn.Auto),x.name="GROUPPANEL";var E=new lo;E.figure="Rectangle",E.fill="rgba(128,128,128,0.2)",E.stroke="black",x.add(E),E=new xl,E.padding=new $r(5,5,5,5).ja(),x.add(E),y.add(x),a.ly=y,a.Yi.add("",y),a.Kh=new Rt,y=new $n,x=new lo,x.isPanelMain=!0,y.add(x),x=new lo,x.toArrow="Standard",x.fill="black",x.stroke=null,x.strokeWidth=0,y.add(x),a.my=y,a.Kh.add("",y),y=new $n,x=new lo,x.isPanelMain=!0,x.stroke="brown",y.add(x),a.Kh.add("Comment",y),y=new Yo,y.type=Wn.Auto,x=new lo,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),x=new xl,x.margin=new $r(1.5,1.5,1.5,1.5).ja(),y.add(x),a.St=y,a.wt=y,y=new Yo,y.type=Wn.Link,x=new lo,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 Sa,a.toolManager=new Eo,a.toolManager.initializeStandardTools(),a.defaultTool=a.toolManager,a.currentTool=a.defaultTool,a.nt=null,a.Wm=new ae,a.Vt=null,a.Wt=null,a.Mr=!1,a.commandHandler=Yg(),a.eq=null,a.fq=zi,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 Ie,a.zy=500,a.wp=new Ie,a.wq=!1}Vt.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),vd=null,yd="",Ug(this,!1),this.Xn.clear(),dp(),this.Og.clear(),this.Xh=null,this.Ya(),this.Va(),this.N()};function Ug(a,y){a.animationManager.Cc(!0),a.Hw=new In().freeze(),a.nw=new In().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=[],ee=a.Wa.length;if(y){for(y=0;y<ee;y++)for(var re=a.Wa.s[y].parts;re.next();){var oe=re.value;oe!==b&&oe.data===null&&z.push(oe)}for(y=0;y<z.length;y++)a.remove(z[y])}for(y=0;y<ee;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(),dp(),a.Og.clear(),xo=[],b!==null&&(a.add(b),a.partManager.parts.remove(b)),E&&(a.skipsUndoManager=x),z}function Yg(){return null}Vt.prototype.reset=function(){this.clear(),this.vb=!0,Kg(this),Vu(this),this.Wg=!0,Jg(this),this.layout=new Va,this.Wg=!1,this.model=Sy(),this.model.undoManager=new jr,this.vb=this.rn=!1,this.N()},Vt.prototype.setRTL=function(a){a=a===void 0?this.div:a,a===null&&(a=xn.document.body);var y=Yn("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},Vt.prototype.setScrollWidth=function(a){a=a===void 0?this.div:a,a===null&&(a=xn.document.body);var y=0;if(Ja){var x=fg;y=Zh,x===null&&(x=fg=Yn("p"),x.style.width="100%",x.style.height="200px",x.style.boxSizing="content-box",y=Zh=Yn("div"),y.style.position="absolute",y.style.visibility="hidden",y.style.width="200px",y.style.height="150px",y.style.boxSizing="content-box",y.appendChild(x)),y.style.overflow="hidden",a.appendChild(y);var E=x.offsetWidth;y.style.overflow="scroll",x=x.offsetWidth,E===x&&(x=y.clientWidth),a.removeChild(y),y=E-x,y!==0||Vr||(y=11)}this.Db=y,this.Gw=!0},Vt.prototype.qb=function(a){a.classType===Vt&&(this.autoScale=a)},Vt.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 Xg(a,y){if(Ja){if(y!=null||at("Diagram setup requires an argument DIV."),a.Ka!==null&&at("Diagram has already completed setup."),typeof y=="string"?a.Ka=xn.document.getElementById(y):y instanceof HTMLDivElement?a.Ka=y:at("No DIV or DIV id supplied: "+y),a.Ka===null&&at("Invalid DIV id; could not get element with id: "+y),a.Ka.H!==void 0&&at("Invalid div id; div already has a Diagram associated with it."),!a.ol&&xn.ResizeObserver){var x=sr(function(){a.$b()},250);a.ol=new xn.ResizeObserver(function(){x()}),a.ol.observe(a.Ka)}xn.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=xn.go;var b=new yl(a);if(b.style!==void 0&&(b.style.position="absolute",b.style.top="0px",b.style.left="0px",xn.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),ig(a,a.Aa,a.ya),a.Ka.insertBefore(b.Oa,a.Ka.firstChild),b=new yl(null),b.width=1,b.height=1,a.jw=b,a.oy=b.context,Ja){b=Yn("div");var z=Yn("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=vf,b.addEventListener("pointerdown",$f),b.H=a,b.uy=!0,b.vy=!0,a.ku=b,a.hu=z}a.hk=sr(function(){a.Yh=null,a.N()},300),a.Ov=sr(function(){Qf(a)},250),a.preventDefault=function(ee){return ee.preventDefault(),!1},a.$j=function(ee){if(a.isEnabled){var re=pl(a,ee,!0);re.bubbles=!0;var oe=0,ue=0;re.delta=0,ee.deltaX!==void 0?(ee.deltaX!==0&&(oe=0<ee.deltaX?1:-1),ee.deltaY!==0&&(ue=0<ee.deltaY?1:-1),re.delta=Math.abs(ee.deltaX)>Math.abs(ee.deltaY)?-oe:-ue):ee.wheelDeltaX!==void 0?(ee.wheelDeltaX!==0&&(oe=0<ee.wheelDeltaX?-1:1),ee.wheelDeltaY!==0&&(ue=0<ee.wheelDeltaY?-1:1),re.delta=Math.abs(ee.wheelDeltaX)>Math.abs(ee.wheelDeltaY)?-oe:-ue):ee.wheelDelta!==void 0&&ee.wheelDelta!==0&&(re.delta=0<ee.wheelDelta?1:-1),a.doMouseWheel(),jl(re,ee)}},a.aA=function(ee){a.isEnabled&&(a.Vk=!1,pl(a,ee,!0),ee=a.currentTool,ee.cancelWaitAfter(),ee.standardMouseOver())},a.ui=function(ee){if(a.isEnabled){a.Vk=!0;var re=a.Yt;re[ee.pointerId]===void 0&&(re[ee.pointerId]=ee),re=a.oj;var oe=!1;if(re[0]===null||re[0].pointerId!==ee.pointerId&&re[0].pointerType===ee.pointerType)if(re[1]!==null&&re[1].pointerId===ee.pointerId)re[1]=ee,oe=!0;else if(re[0]===null)re[0]=ee;else if(re[1]===null)re[1]=ee,oe=!0;else{ee.preventDefault();return}else re[0]=ee;(re=ee.pointerType==="touch"||ee.pointerType==="pen")&&(a.qu=!1,a.wq=!0);var ue=oe;oe=xf(a,ee,!0,!1,!0,ue),fd(a,ee,oe),oe.targetDiagram=tg(ee,ee.target),oe.targetObject=null,ue||oe.clone(a.bq),ue=a.uw,re=re?25:10,ee.timeStamp-a.tw<a.zy&&!(Math.abs(ue.x-ee.screenX)>re||Math.abs(ue.y-ee.screenY)>re)?a.yq++:a.yq=1,oe.clickCount=a.yq,a.tw=ee.timeStamp,a.uw.sg(ee.screenX,ee.screenY),a.doMouseDown(),ee.button===1?ee.preventDefault():jl(oe,ee)}},a.dk=function(ee){if(a.isEnabled){a.Vk=!0;var re=a.oj;if(re[0]===null||re[0].pointerId!==ee.pointerId&&re[0].pointerType===ee.pointerType){if(re[1]!==null&&re[1].pointerId===ee.pointerId){re[1]=ee;return}if(re[0]===null)re[0]=ee;else return}else re[0]=ee;if(re[0].pointerId===ee.pointerId){re=xf(a,ee,!1,!1,!1,re[1]!==null);var oe=xn.document.elementFromPoint(ee.clientX,ee.clientY)||null;oe!==null&&oe.shadowRoot!==void 0&&oe.shadowRoot!==null&&(oe=oe.shadowRoot.elementFromPoint(ee.clientX,ee.clientY));var ue=a,he=ee;oe&&oe.H&&(he=ee,ue=oe.H),re.targetDiagram=ue,fd(a,he,re),re.targetObject=null,a.doMouseMove(),jl(re,ee)}}},a.fk=function(ee){if(a.isEnabled){a.Vk=!0;var re=ee.pointerType==="touch"||ee.pointerType==="pen",oe=a.Yt;if(re&&a.qu)delete oe[ee.pointerId],ee.preventDefault();else if(oe=a.oj,oe[0]===null||oe[0].pointerId!==ee.pointerId&&oe[0].pointerType===ee.pointerType)oe[1]!==null&&oe[1].pointerId===ee.pointerId&&(oe[1]=null);else{oe[0]=null,oe=xf(a,ee,!1,!0,!0,!1);var ue=xn.document.elementFromPoint(ee.clientX,ee.clientY)||null;ue!==null&&ue.shadowRoot!==void 0&&ue.shadowRoot!==null&&(ue=ue.shadowRoot.elementFromPoint(ee.clientX,ee.clientY)),ue!==null&&ue.H instanceof Vt&&ue.H!==a&&fd(ue.H,ee,oe),ue===null&&(ue=ee.target),fd(a,ee,oe),oe.clickCount=a.yq,oe.targetDiagram=tg(ee,ue),oe.targetObject=null,a.doMouseUp(),jl(oe,ee),re&&(a.wq=!1)}}},a.ek=function(ee){if(a.isEnabled){a.Vk=!1;var re=a.Yt;re[ee.pointerId]&&delete re[ee.pointerId],re=a.oj,re[0]!==null&&re[0].pointerId===ee.pointerId&&(re[0]=null),re[1]!==null&&re[1].pointerId===ee.pointerId&&(re[1]=null),ee.pointerType!=="touch"&&ee.pointerType!=="pen"&&(ee=a.currentTool,ee.cancelWaitAfter(),ee.standardMouseOver())}},a.ck=function(ee){var re=a.oj;re[0]!==null&&re[0].pointerId===ee.pointerId?(re[0]=null,a.wq=!1):re[1]!==null&&re[1].pointerId===ee.pointerId&&(re[1]=null)},a.Vp=E.Z["d"+wd[1]+wd[2]+"wI"+Xd.slice(1,5)]["b"+NS.slice(1,y)](E.Z,Zc,y,y),E.Vc(!0),kc(a),a.nl==="svg"&&(y=a.pj.get("svg"),a.Ka.appendChild(y.Oa),a.ib=y.context)}}Vt.prototype.addEventListener=function(a,y,x,E){a.addEventListener(y,x,{capture:E,passive:!1})},Vt.prototype.removeEventListener=function(a,y,x,E){a.removeEventListener(y,x,{capture:E})};function kc(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(xn,"resize",a.Ov,!1)}function sl(a){30<a.Sq&&(a.Yh=1)}function cd(a,y){a.Yh!==null&&(a.Yh=null,y&&a.hk(),po&&po.nx||(a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0))}Vt.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:xn.devicePixelRatio||1},Vt.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},Vt.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},Vt.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},Vt.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},Vt.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},Vt.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},Vt.prototype.doFocus=function(){this.focus()},Vt.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var a=xn.scrollX||xn.pageXOffset,y=xn.scrollY||xn.pageYOffset;this.ta.focus(),xn.scrollTo(a,y)}},Vt.prototype.Oy=function(){this.H.R("GainedFocus")},Vt.prototype.Ny=function(){this.H.R("LostFocus")};function Qf(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===Ys&&(a.Jk=!0,y.C()),a.ld||a.$b())}}}function Jg(a){var y=new ws;y.name="Background",a.Al(y),y=new ws,y.name="",a.Al(y),y=new ws,y.name="Foreground",a.Al(y),y=new ws,y.name="Adornment",y.isTemporary=!0,y.isInDocumentBounds=!1,a.Al(y),y=new ws,y.name="Tool",y.isTemporary=!0,y.isInDocumentBounds=!0,a.Al(y),y=new ws,y.name="Grid",y.allowSelect=!1,y.pickable=!1,y.isTemporary=!0,y.isInDocumentBounds=!1,a.Ww(y,a.Qj("Background"))}function Qg(a){var y=new Wn(Wn.Grid);y.name="GRID";var x=new lo;return x.figure="LineH",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new lo,x.figure="LineH",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new lo,x.figure="LineH",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new lo,x.figure="LineV",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new lo,x.figure="LineV",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new lo,x.figure="LineV",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new pr,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 vf(){this.H.gu?this.H.gu=!1:this.H.isEnabled?this.H.kx(this):Hd(this.H)}function $f(a){this.H.isEnabled?(this.H.lu=a.target.scrollTop,this.H.ju=a.target.scrollLeft):Hd(this.H)}Vt.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,ee=E.x-z.left,re=E.y-z.top,oe=E.width+z.left+z.right,ue=E.height+z.top+z.bottom,he=E.right+z.right;z=E.bottom+z.bottom;var pe=b.x;E=b.y;var Se=b.width,Pe=b.height,Fe=b.right,Ne=b.bottom;b=this.scale;var Xe=a.scrollLeft;if(this.tn)switch(this.bu){case"negative":Xe=Xe+a.scrollWidth-a.clientWidth;break;case"reverse":Xe=a.scrollWidth-Xe-a.clientWidth}var Ve=Xe;Se<oe||Pe<ue?(Xe=Ie.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==Ve&&(Xe.x=Ve/b+ee,this.ju=Ve),this.allowVerticalScroll&&this.lu!==a.scrollTop&&(Xe.y=a.scrollTop/b+re,this.lu=a.scrollTop),this.position=Xe,Ie.free(Xe),this.Ee=this.qr=!1):(Xe=Ie.alloc(),a.uy&&this.allowHorizontalScroll&&(ee<pe&&(this.position=Xe.h(Ve+ee,this.position.y)),he>Fe&&(this.position=Xe.h(-(y.scrollWidth-this.Aa)+Ve-this.Aa/b+he,this.position.y))),a.vy&&this.allowVerticalScroll&&(re<E&&(this.position=Xe.h(this.position.x,a.scrollTop+re)),z>Ne&&(this.position=Xe.h(this.position.x,-(y.scrollHeight-this.ya)+a.scrollTop-this.ya/b+z))),Ie.free(Xe),this.vd=!0,this.Ee=this.qr=!1,E=this.documentBounds,b=this.viewportBounds,he=E.right,Fe=b.right,z=E.bottom,Ne=b.bottom,ee=E.x,pe=b.x,re=E.y,E=b.y,Se>=oe&&ee>=pe&&he<=Fe&&(x.style.width="1px"),Pe>=ue&&re>=E&&z<=Ne&&(x.style.height="1px"))}},Vt.prototype.computeBounds=function(a){return a===void 0&&(a=new Gt),Ps(this),qf(this,a)};function qf(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 ee=E[z];if(ee.visible&&ee.isInDocumentBounds){ee=ee.Pa.s;for(var re=ee.length,oe=0;oe<re;oe++){var ue=ee[oe];ue.isInDocumentBounds&&ue.isVisible()&&(ue=ue.actualBounds,ue.w()&&(x?(x=!1,y.assign(ue)):y.ed(ue)))}}}return x&&y.h(0,0,0,0),y.Co(a.yb),y}Vt.prototype.computePartsBounds=function(a,y){y===void 0&&(y=!1);var x=null;if(jt(a))for(var E=0;E<a.length;E++){var b=a[E];!y&&b instanceof $n||(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 $n||(E.Va(),x===null?x=E.actualBounds.copy():x.ed(E.actualBounds));return x===null?new Gt(NaN,NaN,0,0):x};function cu(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=Ie.alloc(),x.xi(a.documentBounds,a.initialDocumentSpot);var E=a.viewportBounds;E=Gt.allocAt(0,0,E.width,E.height);var b=Ie.alloc();b.xi(E,a.initialViewportSpot),b.h(x.x-b.x,x.y-b.y),a.position=b,Gt.free(E),Ie.free(b),Ie.free(x)}x=a.yh,y&&a.Fg!==Ys&&(x=a.Fg);var z=x!==Ys?Gd(a,x):a.scale;x=a.pa.x,E=a.pa.y,b=a.Aa/z;var ee=a.ya/z,re=a.zk,oe=a.pq;y&&!re.sb()&&(oe.sb()||oe.Xb())&&(re=oe.Xb()?Kr:oe),eg(a,a.documentBounds,b,ee,re,y),y=a.scale,a.scale=z,a.vb=!1,z=a.viewportBounds,Re.B(z.x,x)&&Re.B(z.y,E)&&Re.B(z.width,b)&&Re.B(z.height,ee)||a.onViewportBoundsChanged(new Gt(x,E,b,ee),z,y,!1)}}function Gd(a,y){var x=a.Pp;if(a.ta===null)return x;a.Va();var E=a.documentBounds;if(!E.w())return x;var b=E.width;E=E.height;var z=a.Aa+(a.gf?a.Db:0),ee=a.ya+(a.Be?a.Db:0),re=z/b,oe=ee/E;return y===ql?(y=Math.min(oe,re),y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):y===Lh?(y=oe>re?(ee-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}Vt.prototype.zoomToFit=function(){var a=this.sj;this.sj=Kh,this.scale=Gd(this,ql),a!==Kh&&(cu(this,!1),eg(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=a},be=Vt.prototype,be.BA=function(a,y){y===void 0&&(y=ql);var x=a.width,E=a.height;if(!(x===0||E===0||isNaN(x)&&isNaN(E))){var b=1;if(y===ql||y===Lh)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===Lh?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 Ie(a.x,a.y)}},be.Jy=function(a,y){this.Va();var x=this.documentBounds,E=this.viewportBounds;this.position=new Ie(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))},be.zz=function(a){if(a instanceof Ft){this.eq=a;var y=Ie.alloc();this.fq=this.op(a.ga(Co,y)),Ie.free(y)}else this.eq=null,this.fq=zi};function eg(a,y,x,E,b,z){var ee=Ie.allocAt(a.pa.x,a.pa.y),re=ee.x,oe=ee.y;if(a.eq!==null){var ue=Ie.alloc();ue=a.eq.ga(Co,ue),re=ue.x-a.fq.x/a.scale,oe=ue.y-a.fq.y/a.scale,b=Xr,Ie.free(ue)}(z||a.scrollMode===Kh)&&(b.sb()&&(x>y.width&&(re=y.x+(b.x*y.width+b.offsetX)-(b.x*x-b.offsetX)),E>y.height&&(oe=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?(re=Math.min(re+x/2,y.right+Math.max(z,b.right)-x/2),re=Math.max(re,y.left-Math.max(z,b.left)+x/2),re-=x/2):re>y.left?re=y.left:re<y.right-x&&(re=y.right-x),x=E-y.height,E<y.height+b.top+b.bottom?(oe=Math.min(oe+E/2,y.bottom+Math.max(x,b.bottom)-E/2),oe=Math.max(oe,y.top-Math.max(x,b.top)+E/2),oe-=E/2):oe>y.top?oe=y.top:oe<y.bottom-E&&(oe=y.bottom-E)),ee.x=isFinite(re)?re:-a.yb.left,ee.y=isFinite(oe)?oe:-a.yb.top,a.positionComputation!==null&&(y=a.positionComputation(a,ee),ee.x=y.x,ee.y=y.y),Gg(a.Yd,a.pa,ee),a.pa.h(ee.x,ee.y),Vu(a),Ie.free(ee)}be.Ol=function(a,y){if(y===void 0&&(y=!0),y){if(a=lh(this,a,function(x){return x.part},function(x){return x.canSelect()}),a instanceof pr)return a}else if(a=lh(this,a,function(x){return x.part}),a instanceof pr)return a;return null},be.ic=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null),Ps(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 lh(a,y,x,E){for(x===void 0&&(x=null),E===void 0&&(E=null),Ps(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}be.lz=function(a,y,x){return y===void 0&&(y=!0),Ac(this,a,function(E){return E.part},y?function(E){return E instanceof pr&&E.canSelect()}:null,x)};function Ac(a,y,x,E,b){for(x===void 0&&(x=null),E===void 0&&(E=null),b instanceof Bn||b instanceof In||(b=new In),Ps(a),a=a.Wa.iteratorBackwards;a.next();){var z=a.value;z.visible&&!z.isTemporary&&z.ji(y,x,E,b)}return b}be.ji=function(a,y,x,E){y===void 0&&(y=null),x===void 0&&(x=null),E instanceof Bn||E instanceof In||(E=new In),Ps(this);for(var b=this.Wa.iteratorBackwards;b.next();){var z=b.value;z.visible&&z.ji(a,y,x,E)}return E},be.ux=function(a,y,x,E){return y===void 0&&(y=!1),x===void 0&&(x=!0),yf(this,a,function(b){return b instanceof pr&&(!x||b.canSelect())},y,E)},be.Cf=function(a,y,x,E,b){y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof Bn||b instanceof In||(b=new In),Ps(this);for(var z=this.Wa.iteratorBackwards;z.next();){var ee=z.value;ee.visible&&ee.Cf(a,y,x,E,b)}return b},be.Nu=function(a,y,x,E,b,z){var ee=new In;Ps(this);for(var re=this.Wa.iteratorBackwards;re.next();){var oe=re.value;oe.visible&&oe.Nu(a,y,x,E,ee,b,z)}return ee};function yf(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 Bn||b instanceof In||(b=new In),Ps(a),a=a.Wa.iteratorBackwards;a.next();){var ee=a.value;ee.visible&&!ee.isTemporary&&ee.Cf(y,z,x,E,b)}return b}be.mz=function(a,y,x,E,b){return x===void 0&&(x=!0),E===void 0&&(E=!0),Nc(this,a,y,function(z){return z instanceof pr&&(!E||z.canSelect())},x,b)},be.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 Bn||b instanceof In)&&(z=b),b=!0),z instanceof Bn||z instanceof In||(z=new In),Ps(this);for(var ee=this.Wa.iteratorBackwards;ee.next();){var re=ee.value;re.visible&&re.og(a,y,x,E,b,z)}return z};function Nc(a,y,x,E,b,z){var ee=null;for(ee===void 0&&(ee=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof Bn||b instanceof In)&&(z=b),b=!0),z instanceof Bn||z instanceof In||(z=new In),Ps(a),a=a.Wa.iteratorBackwards;a.next();){var re=a.value;re.visible&&!re.isTemporary&&re.og(y,x,ee,E,b,z)}return z}Vt.prototype.acceptEvent=function(a){return pl(this,a,a instanceof MouseEvent)};function pl(a,y,x){var E=a.Qg;return a.Qg=a.cj,a.cj=E,E.diagram=a,E.event=y,x?fd(a,y,E):(E.viewPoint=a.Qg.viewPoint,E.documentPoint=a.Qg.documentPoint),a=0,y.ctrlKey&&(a+=1),y.altKey&&(a+=2),y.shiftKey&&(a+=4),y.metaKey&&(a+=8),E.modifiers=a,E.button=y.button,y.buttons!==void 0&&(E.buttons=y.buttons),Vr&&y.button===0&&y.ctrlKey&&(E.button=2),E.down=!1,E.up=!1,E.clickCount=1,E.delta=0,E.handled=!1,E.bubbles=!1,E.timestamp=y.timeStamp,E.isMultiTouch=!1,E.targetDiagram=tg(y,y.target),E.targetObject=null,E}function tg(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 xf(a,y,x,E,b,z){var ee=a.Qg;return a.Qg=a.cj,a.cj=ee,ee.diagram=a,ee.clickCount=1,a=ee.delta=0,y.ctrlKey&&(a+=1),y.altKey&&(a+=2),y.shiftKey&&(a+=4),y.metaKey&&(a+=8),ee.modifiers=a,ee.event=y,ee.timestamp=y.timeStamp,ee.button=y.button,ee.buttons=y.buttons,Vr&&y.button===0&&y.ctrlKey&&(ee.button=2),ee.down=x,ee.up=E,ee.handled=!1,ee.bubbles=b,ee.isMultiTouch=z,ee}function jl(a,y){return a.bubbles?!0:(y.stopPropagation!==void 0&&y.stopPropagation(),y.cancelable!==!1&&y.preventDefault(),y.cancelBubble=!0,!1)}Vt.prototype.Qz=function(a){var y=this.H;if(!this.H.isEnabled)return!1;var x=pl(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(),jl(x,a)},Vt.prototype.Rz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=pl(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(),jl(x,a)},Vt.prototype.bz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=pl(y,a,!0);return y.mouseEnter!==null&&y.mouseEnter(x),y.currentTool.standardMouseOver(),jl(x,a)},Vt.prototype.cz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=pl(y,a,!0);return y.mouseLeave!==null&&y.mouseLeave(x),jl(x,a)},Vt.prototype.getMouse=function(a){var y=this.ta;if(y===null)return new Ie(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?ti(new Ie(y,a),this.Ab):new Ie(y,a)};function fd(a,y,x){var E=a.ta,b=a.Aa,z=a.ya,ee=0,re=0;E!==null&&(E=E.getBoundingClientRect(),ee=y.clientX-b/E.width*E.left,re=y.clientY-z/E.height*E.top),x.viewPoint.h(ee,re),a.Ab!==null?(y=Ie.allocAt(ee,re),a.Ab.Cd(y),x.documentPoint.assign(y),Ie.free(y)):x.documentPoint.h(ee,re)}function Sf(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))}}Vt.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function $g(a){a.ld||Ps(a),a.Va()}Vt.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},be=Vt.prototype,be.Pz=function(){return this.kg},be.Xy=function(a){a===void 0&&(a=null);var y=this.animationManager,x=y.isEnabled;y.Cc(),y.isEnabled=!1,$l(this),this.hf=!1,this.du=new Ie(NaN,NaN),y.isEnabled=x,this.ld=!0;var E=this;a!==null&&br(function(){E.ld=!1,ah(y,"Model"),a(E)},1)},be.$b=function(a){if(a===void 0&&(a=!1),this.kg!==!0&&!(this.vb||a===!1&&this.ld)){this.kg=!0;var y=this;xn.requestAnimationFrame(function(){y.kg&&y.bd()})}},be.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),$l(this))};function Gh(a,y,x){!a.Ee||a.vb||a.animationManager.defaultAnimation.isAnimating||Hd(a)||(y&&Ps(a),x&&cu(a,!1))}function $l(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,ee=0;ee<z;ee++){var re=b[ee];gt(re,!1),re.v()}E.clear()}E=a.ow,0<E.count&&(E.each(function(oe){oe.Nv()}),E.clear()),b=E=!1,x.defaultAnimation.isAnimating&&(b=!0,E=a.skipsUndoManager,a.skipsUndoManager=!0),x.zb||Qf(a),Gh(a,!1,!0),a.fe!==null&&(a.fe.visible&&!a.mq&&(Mu(a),a.mq=!0),!a.fe.visible&&a.mq&&(a.mq=!1)),Ps(a),z=!1,(!a.hf||a.xh)&&(a.hf?hg(a,!a.Jk):(a.Ea("Initial Layout"),x.isEnabled===!1&&x.Cc(),hg(a,!1)),z=!0),a.Jk=!1,Ps(a),a.ou||$g(a),Gh(a,!0,!1),ee=!1,z?(x=Gt.alloc(),x.assign(a.viewportBounds),a.hf||(ee=a.hf=!0,a.skipsUndoManager||(a.undoManager.isPendingClear=!0),a.undoManager.isPendingUnmodified=!0,ng(a)),a.R("LayoutCompleted"),Gh(a,!0,!1),Gt.free(x)):x.Ok&&x.Qw&&(a.Fg!==Ys?a.scale=Gd(a,a.Fg):a.yh!==Ys?a.scale=Gd(a,a.yh):(x=a.initialScale,isFinite(x)&&0<x&&(a.scale=x)),cu(a,!0)),z&&ee&&a.eb("Initial Layout"),Ps(a),y||a.gc(a.ib),b&&(a.skipsUndoManager=E),a.ld=!1}}function ng(a){if(a.Fg!==Ys)a.scale=Gd(a,a.Fg);else if(a.yh!==Ys)a.scale=Gd(a,a.yh);else{var y=a.initialScale;isFinite(y)&&0<y&&(a.scale=y)}cu(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 Ps(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 In,a.Nv(x,a.De)}a.nodes.each(function(E){E instanceof no&&E.U&65536&&(E.U=E.U^65536)})}}be.Nv=function(a,y){for(a.reset();a.next();){var x=a.value;!x.Zc()||x instanceof no||(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))}for(a.reset();a.next();)x=a.value,x instanceof no&&x.isVisible()&&Dc(this,x);for(a.reset();a.next();)x=a.value,x instanceof $n&&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 Yo&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))};function Dc(a,y){for(var x=xi(),E=xi(),b=y.memberParts;b.next();){var z=b.value;z.isVisible()&&(z instanceof no?(tt(z)||xt(z)||Wc(z))&&Dc(a,z):z instanceof $n?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(Bi(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();Bi(E)}be.Fd=function(a,y,x,E){if(this.vd||this.animationManager.isAnimating)for(var b=0;b<y;b++)a[b].Fd(x,E)},be.gc=function(a){if(this.Ka!==null){if(this.ta===null&&at("No canvas specified"),this.nl==="svg"){if(this.Ka!==null){var y=this.animationManager;if(!y.zb&&(!y.isAnimating||y.isTicking)){Hh(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,ee=Math.round(y.y*b)/b,re=this.Ab;for(re.reset(),b!==1&&re.scale(b),y.x===0&&y.y===0||re.translate(-z,-ee),a.ti=null,es(a,re.m11,re.m12,re.m21,re.m22,re.dx,re.dy),this.pb!==1&&(a.globalAlpha=this.pb),Wh(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?Sd(this.Yf,this)&&(a=this.Vp()):a=!0,a&&(pt.prototype.Cd=pt.prototype.Eu),this.Fc=this.vd=!1}}}}else e:if(z=this.animationManager,!z.zb&&(!z.isAnimating||z.isTicking)&&(x=new Date,Hh(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 e;z=this.Ab,z.reset(),ee=this.Mb,re=this.pa;var oe=this.Ca,ue=Math.round(re.x*oe)/oe,he=Math.round(re.y*oe)/oe;for(oe!==1&&z.scale(oe),re.x===0&&re.y===0||z.translate(-ue,-he),a.setTransform(ee,0,0,ee,0,0),a.clearRect(0,0,this.Aa,this.ya),this.pb!==1&&(a.globalAlpha=this.pb),Wh(this,a),re=0;re<b;re++)a.setTransform(ee,0,0,ee,0,0),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),a.yc(),y[re].gc(a,this);if(y=!1,this.Yf?Sd(this.Yf,this)&&(y=this.Vp()):y=!0,y&&(pt.prototype.Cd=pt.prototype.Eu),E?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,y=+new Date-+x,E=po&&po.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 wf(a,y,x,E,b,z,ee,re,oe,ue){if(a.Ka!==null){a.ta===null&&at("No canvas specified"),ee===void 0&&(ee=null),re===void 0&&(re=null),oe===void 0&&(oe=!1),ue===void 0&&(ue=!1),Hh(a),a.ib.Vc(!0),a.vd=!0,a.$i=!0;var he=a.Ca;a.Ca=b;var pe=a.Wa.s,Se=pe.length;try{var Pe=new Gt(z.x,z.y,E.width/b,E.height/b),Fe=Pe.copy();Fe.Co(x),Mu(a,Fe),Ps(a),a.Fd(pe,Se,a,Pe),y.setTransform(1,0,0,1,0,0),y.clearRect(0,0,E.width,E.height),re!==null&&re!==""&&(y.fillStyle=re,y.ox(0,0,E.width,E.height));var Ne=a.Mb;y.scale(Ne,Ne);var Xe=pt.alloc();Xe.reset(),Xe.translate(x.left,x.top),Xe.scale(b),z.x===0&&z.y===0||Xe.translate(-z.x,-z.y),y.setTransform(Xe.m11,Xe.m12,Xe.m21,Xe.m22,Xe.dx,Xe.dy),y.yc(),y instanceof da&&es(y,Xe.m11,Xe.m12,Xe.m21,Xe.m22,Xe.dx,Xe.dy),pt.free(Xe),Wh(a,y),y.globalAlpha=a.pb;var Ve=a.Qj("Grid");if(ee){var ht=new In,ft=ee.iterator;for(ft.reset();ft.next();){var mt=ft.value;mt instanceof pr&&(ue||mt.layer!==Ve)&&(mt.Gj(),ht.add(mt))}for(ue=0;ue<Se;ue++)Hg(pe[ue],y,a,ht,oe);ht.each(function(Kt){return Kt.Gj()})}else for(ht=0;ht<Se;ht++){var Ct=pe[ht];Ct===Ve?ue&&Ct.gc(y,a,!0):Ct.gc(y,a,oe)}a.$i=!1,a.Yf&&Sd(a.Yf,a)&&a.Vp()}finally{a.Ca=he,a.ib.Vc(!0),a.vd=!0,a.Fd(pe,Se,a,a.viewportBounds),Mu(a),a.ib instanceof da&&(a.ib.Nj.PA(),a.redraw())}}}be.Gf=function(a){return this.Rg[a]},be.Xx=function(a,y){a==="minDrawingLength"&&(this.Oq=y),this.Rg[a]=y,this.redraw()},be.Tx=function(){this.Rg=new Ri,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(Vr||Ar),this.Rg.temporaryPixelRatio=!0,this.Rg.pictureRatioOptimization=!0,this.Oq=this.Rg.minDrawingLength=1};function Wh(a,y){a=a.Rg,a!==null&&(a.imageSmoothingEnabled!==void 0&&y.Wx(!!a.imageSmoothingEnabled),a=a.defaultFont,a!=null&&(y.font=a))}be.Ql=function(a){return this.on[a]},be.sA=function(a,y){this.on[a]=y},be.Sx=function(){this.on=new Ri,this.on.extraTouchArea=10,this.on.extraTouchThreshold=10,this.on.hasGestureZoom=!0},be.set=function(a){return Object.assign(this,a),this},be.Du=function(a){return this.nm(a)},be.nm=function(a){return Wd(this,a),this};function Wd(a,y){var x=a instanceof Wn,E=a instanceof Vt,b;for(b in y){b===""&&at("Setting properties requires non-empty property names");var z=a,ee=b;if(x||E){var re=b.indexOf(".");if(0<re){var oe=b.substring(0,re);x?z=a.fb(oe):(z=a[oe],z==null&&(z=a.toolManager[oe])),Qt(z)?ee=b.substr(re+1):at("Unable to find object named: "+oe+" in "+a.toString()+" when trying to set property: "+b)}}if(ee[0]!=="_"&&!xr(z,ee))if(E&&ee==="ModelChanged"){a.Yw(y[ee]);continue}else if(E&&ee==="Changed"){a.Pe(y[ee]);continue}else if(E&&xr(a.toolManager,ee))z=a.toolManager;else if(E&&Ud(a,ee)){a.Bj(ee,y[ee]);continue}else if(a instanceof ar&&ee==="Changed"){a.Pe(y[ee]);continue}else at('Trying to set undefined property "'+ee+'" on object: '+z.toString());z[ee]=y[b],ee[0]==="_"&&z instanceof Ft&&z.Vw(ee)}}be.bx=function(){if(this.Eh.count!==0&&!(1<this.undoManager.transactionLevel)){for(;0<this.Eh.count;){var a=this.Eh;for(this.Eh=new Rt,a=a.iterator;a.next();){var y=a.key;y.Xo(a.value),y.qc()}}this.N()}},be.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")},Vt.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!==Yd&&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=Gt.alloc(),Kd(this,this.computeBounds(E)),Gt.free(E)),E=this.ta,E===null||E instanceof Ca)))){var ee=this.Mb;b=this.Aa*ee;var re=this.ya*ee,oe=this.scale*ee;z=Math.round(Math.round(y.x*oe)-Math.round(a.x*oe)),y=Math.round(Math.round(y.y*oe)-Math.round(a.y*oe)),oe=this.jw,a=this.oy,oe.width!==b&&(oe.width=b),oe.height!==re&&(oe.height=re),a.clearRect(0,0,b,re),oe=190*ee;var ue=70*ee,he=Math.max(z,0),pe=Math.max(y,0),Se=Math.floor(b-he),Pe=Math.floor(re-pe);a.drawImage(E.Oa,he,pe,Se,Pe,0,0,Se,Pe),Sd(this.Yf,this)&&a.clearRect(0,0,oe,ue),E=xi(),a=xi(),Pe=Math.abs(z),Se=Math.abs(y);var Fe=he===0?0:b-Pe;he=Ie.allocAt(Fe,0),Pe=Ie.allocAt(Pe+Fe,re),a.push(new Gt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y)));var Ne=this.Ab;if(Ne.reset(),Ne.scale(ee,ee),this.Ca!==1&&Ne.scale(this.Ca),ee=this.pa,(ee.x!==0||ee.y!==0)&&isFinite(ee.x)&&isFinite(ee.y)&&Ne.translate(-ee.x,-ee.y),ti(he,Ne),ti(Pe,Ne),E.push(new Gt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y))),Fe=pe===0?0:re-Se,he.h(0,Fe),Pe.h(b,Se+Fe),a.push(new Gt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y))),ti(he,Ne),ti(Pe,Ne),E.push(new Gt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y))),Sd(this.Yf,this)&&(b=0<z?0:-z,re=0<y?0:-y,he.h(b,re),Pe.h(oe+b,ue+re),a.push(new Gt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y))),ti(he,Ne),ti(Pe,Ne),E.push(new Gt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y)))),Ie.free(he),Ie.free(Pe),Gh(this,!1,!0),this.Ka===null&&at("No div specified"),this.ta===null&&at("No canvas specified"),!this.animationManager.zb&&(b=this.ib,this.Fc)){for(Hh(this),re=this.Mb,b.setTransform(1,0,0,1,0,0),b.clearRect(0,0,this.Aa*re,this.ya*re),b.drawImage(this.jw.Oa,0<z?0:Math.round(-z),0<y?0:Math.round(-y)),z=this.pa,ee=this.Ca,oe=Math.round(z.x*ee)/ee,ue=Math.round(z.y*ee)/ee,y=this.Ab,y.reset(),ee!==1&&y.scale(ee),z.x===0&&z.y===0||y.translate(-oe,-ue),b.save(),b.beginPath(),z=a.length,ee=0;ee<z;ee++)oe=a[ee],oe.width!==0&&oe.height!==0&&b.rect(Math.floor(oe.x),Math.floor(oe.y),Math.ceil(oe.width),Math.ceil(oe.height));for(b.clip(),b.setTransform(re,0,0,re,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),Wh(this,b),b.globalAlpha=this.pb,re=0;re<z;re++)if(ee=y[re],oe=E,ee.visible&&ee.pb!==0){ue=Fh(ee,b),pe=ee.Zq,pe.length=0,he=this.scale,Se=Gt.alloc(),Pe=ee.Pa.s,Ne=Pe.length,Fe=oe.length;for(var Xe=0;Xe<Ne;Xe++){var Ve=Pe[Xe],ht=_f(Ve,Ve.actualBounds);e:{for(var ft=2/he,mt=4/he,Ct=0;Ct<Fe;Ct++){var Kt=oe[Ct];if(Kt.width!==0&&Kt.height!==0&&ht.Vu(Kt.x-ft,Kt.y-ft,Kt.width+mt,Kt.height+mt)){ht=!0;break e}}ht=!1}ht&&ee.Oj(b,Ve,this,pe,he,Se,!0)}Gt.free(Se),b.globalAlpha=ue}b.restore(),b.Vc(!0),this.Yf&&Sd(this.Yf,this)&&this.Vp(),this.Fc=this.vd=!1,this.hk()}Bi(E),Bi(a),this.ld=!1}}else this.bd();x&&(sl(this),this.bd(),cd(this,!0))}else x?(sl(this),this.bd(),cd(this,!0)):this.bd()}};function Hh(a){a.pn!==!1&&(a.pn=!1,ig(a,a.Aa,a.ya))}function ig(a,y,x){Vu(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,ee=a.gf?a.Db:0,re=a.Be?a.Db:0,oe=b.clientWidth||x+ee,ue=b.clientHeight||E+re,he=a.viewportBounds;b=he.x;var pe=he.y,Se=he.width,Pe=he.height;if((oe!==x+ee||ue!==E+re)&&(a.gf=!1,a.Be=!1,re=ee=0,a.Aa=oe,a.ya=ue,z=a.pn=!0,Vu(a)),!a.hf||!a.viewportBounds.w())return!0;var Fe=a.ku,Ne=a.hu;if(a.Ee=!1,!(z||a.gf||a.Be||a.mn||a.nn))return!0;var Xe=a.documentBounds,Ve=0,ht=0,ft=0,mt=0,Ct=he.width,Kt=he.height,yi=a.rj;a.contentAlignment.sb()?(Xe.width>Ct&&(Ve=yi.left,ht=yi.right),Xe.height>Kt&&(ft=yi.top,mt=yi.bottom)):(Ve=yi.left,ht=yi.right,ft=yi.top,mt=yi.bottom);var tr=Xe.width+Ve+ht,Zi=Xe.height+ft+mt;yi=a.scale;var Qn=tr>oe/yi,bn=Zi>ue/yi;if(!(z||a.gf||a.Be||Qn||bn))return!0;Ve=Xe.x-Ve,oe=he.x,ht=Xe.right+ht,ue=he.right+ee,ft=Xe.y-ft;var to=he.y;Xe=Xe.bottom+mt,he=he.bottom+re;var _r="1px";if(mt="1px",a.scrollMode===Kh&&(Qn||bn)&&(Qn&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(Qn=1,Ve+1<oe&&(Qn=Math.max((oe-Ve)*yi+a.Aa,Qn)),ht>ue+1&&(Qn=Math.max((ht-ue)*yi+a.Aa,Qn)),Ct+ee+1<tr&&(Qn=Math.max((tr-Ct)*yi+a.Aa,Qn)),_r=Qn.toString()+"px"),bn&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(Qn=1,ft+1<to&&(Qn=Math.max((to-ft)*yi+a.ya,Qn)),Xe>he+1&&(Qn=Math.max((Xe-he)*yi+a.ya,Qn)),Kt+re+1<Zi&&(Qn=Math.max((Zi-Kt)*yi+a.ya,Qn)),mt=Qn.toString()+"px")),Qn=_r!=="1px",bn=mt!=="1px",Qn&&bn||!Qn&&!bn||(bn&&(ue-=a.Db),Qn&&(he-=a.Db),tr<Ct+ee||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(ee=1,Ve+1<oe&&(ee=Math.max((oe-Ve)*yi+a.Aa,ee)),ht>ue+1&&(ee=Math.max((ht-ue)*yi+a.Aa,ee)),Ct+1<tr&&(ee=Math.max((tr-Ct)*yi+a.Aa,ee)),_r=ee.toString()+"px"),Qn=_r!=="1px",ee=a.ya,Qn!==a.Be&&(ee=Qn?a.ya-a.Db:a.ya+a.Db),Zi<Kt+re||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(re=1,ft+1<to&&(re=Math.max((to-ft)*yi+ee,re)),Xe>he+1&&(re=Math.max((Xe-he)*yi+ee,re)),Kt+1<Zi&&(re=Math.max((Zi-Kt)*yi+ee,re)),mt=re.toString()+"px"),bn=mt!=="1px"),a.qr&&Qn===a.Be&&bn===a.gf)return x===a.Aa&&E===a.ya||a.bd(),!1;if(Qn!==a.Be&&(_r==="1px"?a.ya=a.ya+a.Db:a.ya=Math.max(a.ya-a.Db,1),z=!0),a.Be=Qn,Ne.style.width=_r,bn!==a.gf&&(mt==="1px"?a.Aa=a.Aa+a.Db:a.Aa=Math.max(a.Aa-a.Db,1),z=!0,a.tn&&(re=Ie.alloc(),bn?(y.style.left=a.Db+"px",a.position=re.h(a.pa.x+a.Db/a.scale,a.pa.y)):(y.style.left="0px",a.position=re.h(a.pa.x-a.Db/a.scale,a.pa.y)),Ie.free(re))),z&&Vu(a),a.gf=bn,Ne.style.height=mt,a.gu=!0,z&&(a.pn=!0),y=Fe.scrollLeft,a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(Ct+1<tr?y=(a.position.x-Ve)*yi:Ve+1<oe?y=Fe.scrollWidth-Fe.clientWidth:ht>ue+1&&(y=a.position.x*yi)),a.tn)switch(a.bu){case"negative":y=-(Fe.scrollWidth-y-Fe.clientWidth);break;case"reverse":y=Fe.scrollWidth-y-Fe.clientWidth}return Fe.scrollLeft=y,a.hasVerticalScrollbar&&a.allowVerticalScroll&&(Kt+1<Zi?Fe.scrollTop=(a.position.y-ft)*yi:ft+1<to?Fe.scrollTop=Fe.scrollHeight-Fe.clientHeight:Xe>he+1&&(Fe.scrollTop=a.position.y*yi)),oe=a.Aa,ue=a.ya,Fe.style.width=oe+(a.gf?a.Db:0)+"px",Fe.style.height=ue+(a.Be?a.Db:0)+"px",x!==oe||E!==ue||a.animationManager.zb?(x=Gt.allocAt(b,pe,Se,Pe),a.onViewportBoundsChanged(x,a.viewportBounds,yi,z),Gt.free(x),!1):!0}be=Vt.prototype,be.add=function(a){var y=a.diagram;if(y!==this&&(y!==null&&at("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&&at('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(Go,"parts",y,null,a,null,x),y.isTemporary||this.Ya(),a.C(1),x=a.layerChanged,x!==null&&x(a,null,y)}},be.oi=function(a){this.partManager.oi(a);var y=this;Nf(a,function(x){Vd(y,x)}),(a instanceof Yo||a instanceof no&&a.placeholder!==null)&&a.v(),a.data!==null&&Nf(a,function(x){vy(y.partManager,x)}),xt(a)!==!0&&Wc(a)!==!0||this.De.add(a),R1(a,!0,this),z1(a)?(a.actualBounds.w()&&this.N(_f(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(_f(a,a.actualBounds)),this.$b()},be.pc=function(a){a.Ej(),this.partManager.pc(a);var y=this;a.data!==null&&Nf(a,function(x){yy(y.partManager,x,y)}),this.De.remove(a),z1(a)?(a.actualBounds.w()&&this.N(_f(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(_f(a,a.actualBounds)),this.$b()},be.remove=function(a){rg(this,a,!0)};function rg(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(ha,"parts",E,y,null,x,null),a=y.layerChanged,a!==null&&a(y,E,null))}be.Is=function(a,y){if(y===void 0&&(y=!1),jt(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 In,x.addAll(a),a=x.iterator;a.next();)x=a.value,y&&!x.canDelete()||this.remove(x)},be.Kj=function(a,y,x){return x===void 0&&(x=!1),this.partManager.Kj(a,y,x)},Vt.prototype.moveParts=function(a,y,x,E){if(x===void 0&&(x=!1),E===void 0&&(E=Pf(this)),this.toolManager!==null){var b=new Rt;if(a!==null)if(jt(a))for(var z=0;z<a.length;z++)uh(this,b,a[z],x,E);else for(a=a.iterator;a.next();)uh(this,b,a.value,x,E);else{for(a=this.parts;a.next();)uh(this,b,a.value,x,E);for(a=this.nodes;a.next();)uh(this,b,a.value,x,E);for(a=this.links;a.next();)uh(this,b,a.value,x,E)}gd(this,b,y,E,x)}};function uh(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=Pf(a)),x instanceof Fi){if(y.add(x,a.Pd(b,x,x.location)),x instanceof no&&(x.placeholder!==null||b.dragsMembers))for(z=x.memberParts;z.next();)uh(a,y,z.value,E,b,b.groupsAlwaysMove);for(z=x.linksConnected;z.next();){var ee=z.value;if(!y.contains(ee)){var re=ee.fromNode,oe=ee.toNode;re!==null&&y.contains(re)&&oe!==null&&y.contains(oe)&&uh(a,y,ee,E,b)}}if(b.dragsTree)for(x=x.Ou();x.next();)uh(a,y,x.value,E,b)}else if(x instanceof $n)for(y.add(x,a.Pd(b,x)),x=x.labelNodes;x.next();)uh(a,y,x.value,E,b);else x instanceof Yo||y.add(x,a.Pd(b,x,x.location))}function gd(a,y,x,E,b){if(y!==null&&y.count!==0){var z=Ie.alloc(),ee=Ie.alloc();ee.assign(x),isNaN(ee.x)&&(ee.x=0),isNaN(ee.y)&&(ee.y=0),(x=a.Mr)||Tc(a,y);for(var re=xi(),oe=xi(),ue=y.iterator,he=Ie.alloc();ue.next();){var pe=ue.key,Se=ue.value;if(pe.Zc()){var Pe=og(a,pe,y);Pe!==null?re.push(new ie(pe,Se,Pe)):(!b||pe.canMove())&&(Pe=Se.point,z.assign(Pe),a.computeMove(pe,z.add(ee),E,he),pe.location=he,Se.shifted===void 0&&(Se.shifted=new Ie),Se.shifted.assign(he.re(Pe)))}else ue.key instanceof $n&&oe.push(ue.sa)}for(Ie.free(he),b=re.length,ue=0;ue<b;ue++)pe=re[ue],z.assign(pe.info.point),pe.Su.shifted===void 0&&(pe.Su.shifted=new Ie),pe.node.location=z.add(pe.Su.shifted);for(b=Ie.alloc(),ue=Ie.alloc(),pe=oe.length,Se=0;Se<pe;Se++){var Fe=oe[Se];if(Pe=Fe.key,Pe instanceof $n)if(Pe.suspendsRouting){Pe.Tg=null,he=Pe.fromNode;var Ne=Pe.toNode;if(a.draggedLink!==null&&E.dragsLink)if(Ne=Fe.value.point,Pe.dragComputation===null)y.add(Pe,a.Pd(E,Pe,ee)),rc(Pe,ee.x-Ne.x,ee.y-Ne.y);else{Fe=Ie.allocAt(0,0),(he=Pe.i(0))&&he.w()&&Fe.assign(he);var Xe=he=Ie.alloc().assign(Fe).add(ee);E.isGridSnapEnabled&&(E.isGridSnapRealtime||a.lastInput.up)&&(Xe=Ie.alloc(),Ef(a,Pe,he,Xe,E)),he.assign(Pe.dragComputation(Pe,he,Xe)).re(Fe),y.add(Pe,a.Pd(E,Pe,he)),rc(Pe,he.x-Ne.x,he.y-Ne.y),Ie.free(Fe),Ie.free(he),Xe!==he&&Ie.free(Xe)}else he!==null&&(b.assign(he.location),Xe=y.I(he),Xe!==null&&b.re(Xe.point)),Ne!==null&&(ue.assign(Ne.location),Xe=y.I(Ne),Xe!==null&&ue.re(Xe.point)),he!==null&&Ne!==null?b.Xa(ue)?(he=Fe.value.point,Ne=z,Ne.assign(b),Ne.re(he),y.add(Pe,a.Pd(E,Pe,b)),rc(Pe,Ne.x,Ne.y)):(Pe.suspendsRouting=!1,Pe.bb()):(Fe=Fe.value.point,he=he!==null?b:Ne!==null?ue:ee,y.add(Pe,a.Pd(E,Pe,he)),rc(Pe,he.x-Fe.x,he.y-Fe.y))}else(Pe.fromNode===null||Pe.toNode===null)&&(he=Fe.value.point,y.add(Pe,a.Pd(E,Pe,ee)),rc(Pe,ee.x-he.x,ee.y-he.y))}Ie.free(z),Ie.free(ee),Ie.free(b),Ie.free(ue),Bi(re),Bi(oe),x||(Ps(a),pd(a,y))}}Vt.prototype.computeMove=function(a,y,x,E){if(E===void 0&&(E=new Ie),E.assign(y),a===null)return E;var b=y,z=x.isGridSnapEnabled;z&&(x.isGridSnapRealtime||this.lastInput.up)&&(b=Ie.alloc(),Ef(this,a,y,b,x)),x=a.dragComputation!==null?a.dragComputation(a,y,b):b;var ee=a.minLocation,re=ee.x;isNaN(re)&&(re=z?Math.round(1e3*a.location.x)/1e3:a.location.x),ee=ee.y,isNaN(ee)&&(ee=z?Math.round(1e3*a.location.y)/1e3:a.location.y);var oe=a.maxLocation,ue=oe.x;return isNaN(ue)&&(ue=z?Math.round(1e3*a.location.x)/1e3:a.location.x),oe=oe.y,isNaN(oe)&&(oe=z?Math.round(1e3*a.location.y)/1e3:a.location.y),E.h(Math.max(re,Math.min(x.x,ue)),Math.max(ee,Math.min(x.y,oe))),b!==y&&Ie.free(b),E};function Pf(a){var y=a.toolManager.findTool("Dragging");return y!==null?y.dragOptions:a.Wm}function Ef(a,y,x,E,b){if(b===void 0&&(b=Pf(a)),E.assign(x),y!==null){var z=a.grid;y=b.gridSnapCellSize,a=y.width,y=y.height;var ee=b.gridSnapOrigin,re=ee.x;if(ee=ee.y,b=b.gridSnapCellSpot,z!==null){var oe=z.gridCellSize;isNaN(a)&&(a=oe.width),isNaN(y)&&(y=oe.height),z=z.gridOrigin,isNaN(re)&&(re=z.x),isNaN(ee)&&(ee=z.y)}z=Ie.allocAt(0,0),z.yi(0,0,a,y,b),Re.No(x.x,x.y,re+z.x,ee+z.y,a,y,E),Ie.free(z)}}function Tc(a,y){if(y!==null)for(a.Mr=!0,a=y.iterator;a.next();)y=a.key,y instanceof $n&&(y.suspendsRouting=!0)}function pd(a,y){if(y!==null){for(y=y.iterator;y.next();){var x=y.key;x instanceof $n&&(x.suspendsRouting=!1,iy(x)&&x.bb())}a.Mr=!1}}function og(a,y,x){return y=y.containingGroup,y!==null&&(a=og(a,y,x),a!==null||(a=x.I(y),a!==null))?a:null}be=Vt.prototype,be.Pd=function(a,y,x){if(x===void 0)return new Uu(qn);var E=a.isGridSnapEnabled;return a.groupsSnapMembers||y.containingGroup===null||(E=!1),E?new Uu(new Ie(Math.round(1e3*x.x)/1e3,Math.round(1e3*x.y)/1e3)):new Uu(x.copy())};function ag(a,y,x){if(y.diagram!==null&&y.diagram!==a&&at("Cannot share a Layer with another Diagram: "+y+" of "+y.diagram),x===null?y.diagram!==null&&at("Cannot add an existing Layer to this Diagram again: "+y):(x.diagram!==a&&at("Existing Layer must be in this Diagram: "+x+" not in "+x.diagram),y===x&&at("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&&at("Cannot add Layer with the name '"+y+"'; a Layer with the same name is already present in this Diagram.")}}be.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(Go,"layers",this,null,a,null,x+1),this.N(),this.Ya(),this},be.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(ha,"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(Go,"layers",this,null,a,null,z),this.N(),0>E&&this.Ya(),this},be.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(ha,"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(Go,"layers",this,null,a,null,z+1),this.N(),0>E&&this.Ya(),this},be.kA=function(a){if(a.diagram!==this&&at("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(ha,"layers",this,a,null,x,null),this.N(),this.Ya()}}},be.Qj=function(a){for(var y=this.layers;y.next();){var x=y.value;if(x.name===a)return x}return null},be.Yw=function(a){return this.pf===null&&(this.pf=new Bn),this.pf.add(a),this.model.Pe(a),this},be.mA=function(a){this.pf!==null&&(this.pf.remove(a),this.pf.count===0&&(this.pf=null)),this.model.ik(a)},be.Pe=function(a){return this.zg===null&&(this.zg=new Bn),this.zg.add(a),this},be.ik=function(a){this.zg!==null&&(this.zg.remove(a),this.zg.count===0&&(this.zg=null))},be.ds=function(a){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(a),a.change!==Tr&&(this.isModified=!0),this.zg!==null)for(var y=this.zg,x=y.length,E=0;E<x;E++)y.M(E)(a)},be.cb=function(a,y,x,E,b,z,ee){z===void 0&&(z=null),ee===void 0&&(ee=null);var re=new er;re.diagram=this,re.change=a,re.propertyName=y,re.object=x,re.oldValue=E,re.oldParam=z,re.newValue=b,re.newParam=ee,this.ds(re)},be.g=function(a,y,x,E,b){this.cb(oo,a,this,y,x,E,b)},Vt.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===oo){var b=a.object;if(Ha(b,a.propertyName,a.I(y)),b instanceof Ft){var z=b.part;z!==null&&z.Wb()}this.isModified=!0}else if(E===Go){var ee=a.object,re=a.newParam,oe=a.newValue;if(ee instanceof Wn)if(typeof re=="number"&&oe instanceof Ft){y?ee.pc(re):ee.Gb(re,oe);var ue=ee.part;ue!==null&&ue.Wb()}else typeof re=="number"&&oe instanceof vs&&(oe.isRow?d1(ee,re,y?void 0:oe):c1(ee,re,y?void 0:oe));else if(ee instanceof ws){var he=a.oldParam===!0;typeof re=="number"&&oe instanceof pr&&(y?(oe.isSelected=!1,oe.isHighlighted=!1,oe.Wb(),ee.pc(he?re:-1,oe,he)):ee.oi(re,oe,he))}else ee instanceof Vt?typeof re=="number"&&oe instanceof ws&&(y?this.Wa.mb(re):(oe.Xe(this),this.Wa.Gb(re,oe))):at("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(E===ha){var pe=a.object,Se=a.oldParam,Pe=a.oldValue;if(pe instanceof Wn)typeof Se=="number"&&Pe instanceof Ft?y?pe.Gb(Se,Pe):pe.pc(Se):typeof Se=="number"&&Pe instanceof vs&&(Pe.isRow?d1(pe,Se,y?Pe:void 0):c1(pe,Se,y?Pe:void 0));else if(pe instanceof ws){var Fe=a.newParam===!0;typeof Se=="number"&&Pe instanceof pr&&(y?0>pe.Pa.indexOf(Pe)&&pe.oi(Se,Pe,Fe):(Pe.isSelected=!1,Pe.isHighlighted=!1,Pe.Wb(),pe.pc(Fe?Se:-1,Pe,Fe)))}else pe instanceof Vt?typeof Se=="number"&&Pe instanceof ws&&(y?(Pe.Xe(this),this.Wa.Gb(Se,Pe)):this.Wa.mb(Se)):at("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else E!==Tr&&at("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=x}}},Vt.prototype.Ea=function(a){return this.undoManager.Ea(a)},Vt.prototype.eb=function(a){return this.undoManager.eb(a)},Vt.prototype.Kf=function(){return this.undoManager.Kf()},Vt.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}},Vt.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)},Vt.prototype.rp=function(){this.partManager.rp()};function sg(a,y,x){var E=a.animationManager;if(a.vb||a.ld)a.Ca=x,Vu(a),a.N(),a.Ee=!0,E.zb&&(Ph(E)||E.ce.add(E.H,"scale",y,a.Ca));else if(a.ta===null)a.Ca=x,Vu(a);else{a.vb=!0;var b=a.viewportBounds.copy(),z=a.Aa,ee=a.ya,re=a.zoomPoint.x,oe=a.zoomPoint.y,ue=a.contentAlignment;isNaN(re)&&(ue.$c()?ue.Hf(Wi)?re=0:ue.Hf(Si)&&(re=z-1):re=ue.sb()?ue.x*(z-1):z/2),isNaN(oe)&&(ue.$c()?ue.Hf(Fn)?oe=0:ue.Hf(_i)&&(oe=ee-1):oe=ue.sb()?ue.y*(ee-1):ee/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=Ie.allocAt(a.pa.x+re/y-re/x,a.pa.y+oe/y-oe/x),a.position=z,Ie.free(z),a.Ca=x,Vu(a),a.vb=!1,a.onViewportBoundsChanged(b,a.viewportBounds,y,!1),cu(a,!1),E.zb&&(Ph(E)||E.ce.add(E.H,"scale",y,a.Ca))}}Vt.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!==Ys||a.width===y.width&&a.height===y.height||b.C(),b=this.currentTool,this.Vk===!0&&b instanceof Eo&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),Xa(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=Pn.alloc(),b=1,z=1,ee=x.O.s,re=ee.length,oe=0;oe<re;oe++){var ue=ee[oe],he=Math.abs(ue.interval);2>he||(bv(ue.figure)?z=z*he/Re.vx(z,he):b=b*he/Re.vx(b,he))}if(ee=x.gridCellSize,E.h(z*ee.width,b*ee.height),y!==void 0)b=y.width,z=y.height,a=y.x,ee=y.y;else{if(y=Gt.alloc(),a=a.viewportBounds,y.h(a.x,a.y,a.width,a.height),!y.w()){Gt.free(y);return}b=y.width,z=y.height,a=y.x,ee=y.y,Gt.free(y)}x.width=b+2*E.width,x.height=z+2*E.height,y=Ie.alloc(),Re.No(a,ee,0,0,E.width,E.height,y),y.offset(-E.width,-E.height),Pn.free(E),x.part.location=y,Ie.free(y)}}Vt.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)}},Vt.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))},Vt.prototype.rA=function(a){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),jt(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];E instanceof pr||at("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 pr||at("Diagram.selectCollection given something that is not a Part: "+y),y.isSelected=!0;this.R("ChangedSelection",this.selection)},Vt.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()}},be=Vt.prototype,be.Iz=function(a){a!==null&&a.diagram===this&&(!a.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),a.isHighlighted=!0)},be.Jz=function(a){a=new In().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 pr||at("Diagram.highlightCollection given something that is not a Part: "+y),y.isHighlighted=!0},be.scroll=function(a,y,x){x===void 0&&(x=1);var E=y==="up"||y==="down",b=0,z=Ie.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)),Ie.free(z);return}at("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):at("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+y),Ie.free(z)},be.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)},be.es=function(a){var y=this.viewportBounds;a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a},be.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)},be.zA=function(a){var y=this.Ab,x=a.x,E=a.y,b=x+a.width,z=E+a.height,ee=y.m11,re=y.m12,oe=y.m21,ue=y.m22,he=y.dx,pe=y.dy,Se=x*ee+E*oe+he;y=x*re+E*ue+pe;var Pe=b*ee+E*oe+he;return a=b*re+E*ue+pe,E=x*ee+z*oe+he,x=x*re+z*ue+pe,ee=b*ee+z*oe+he,b=b*re+z*ue+pe,z=Math.min(Se,Pe),Se=Math.max(Se,Pe),Pe=Math.min(y,a),y=Math.max(y,a),z=Math.min(z,E),Se=Math.max(Se,E),Pe=Math.min(Pe,x),y=Math.max(y,x),z=Math.min(z,ee),Se=Math.max(Se,ee),Pe=Math.min(Pe,b),y=Math.max(y,b),new Gt(z,Pe,Se-z,y-Pe)},be.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),ti(a.copy(),this.Ab)};function qg(a){var y=a.isModified;a.Tw!==y&&(a.Tw=y,a.R("Modified"))}function lg(a){return a=Ff.get(a),a!==null?new a:new Sa}Vt.prototype.doModelChanged=function(a){var y=this;if(a.model===this.model){var x=a.change,E=a.propertyName;if(x===Tr&&E[0]==="S")if(E==="StartingFirstTransaction"){var b=this;a=this.toolManager,a.mouseDownTools.each(function(oe){return oe.diagram=b}),a.mouseMoveTools.each(function(oe){return oe.diagram=b}),a.mouseUpTools.each(function(oe){return oe.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===Tr){(E==="FinishedUndo"||E==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),Ps(this));var z=this.animationManager;E==="RolledBackTransaction"&&z.Cc(),this.bx(),this.Jk=!0,this.bd(),this.undoManager.transactionLevel!==0&&this.undoManager.transactionLevel!==1||Fc(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 ee=a.isTransactionFinished;if(ee&&(qg(this),this.As.clear(),sd(this.animationManager)),!this.Rt&&ee&&this.lastInput.targetDiagram){this.Rt=!0;var re=this;br(function(){re.currentTool.standardMouseOver(),re.Rt=!1},10)}}}finally{this.aa=!0}}}};function Vd(a,y){y=y.O.s;for(var x=y.length,E=0;E<x;E++)md(a,y[E])}function md(a,y){if(y instanceof Dl){var x=y.element;if(x!==null&&x instanceof HTMLImageElement){x.Bg instanceof In&&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 ug(a,y){if(y instanceof Dl){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 In&&x.Bg.remove(a),dp(E));break}}}}}Vt.prototype.Wd=function(){this.partManager.Wd()},Vt.prototype.Aj=function(a,y){this.Yd.Aj(a,y)},Vt.prototype.Cj=function(a,y){this.Yd.Cj(a,y)},Vt.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)},Vt.prototype.Vb=function(a){return this.partManager.Vb(a)},Vt.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)},be=Vt.prototype,be.Lc=function(a){return this.partManager.Lc(a)},be.ii=function(a){return this.partManager.ii(a)},be.Kc=function(a){return this.partManager.Kc(a)},be.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:Vn(fi(y)))},be.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:Vn(fi(y)))};function Vu(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 Kd(a,y){a.Zi=!1;var x=a.Sp;x.D(y)||(x=x.copy(),a.Sp.assign(y),cu(a,!1),a.R("DocumentBoundsChanged",void 0,x),a.Ee=!0,a.N())}be.Va=function(){if(this.Zi){var a=Gt.alloc();Kd(this,this.computeBounds(a)),Gt.free(a)}},be.rz=function(){for(var a=new In,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},be.qz=function(){return this.ai.iterator},be.Uz=function(a){Ps(this),a&&_c(this,!0),this.ld?hg(this,!1):(this.Jk=!0,$l(this))};function _c(a,y){for(var x=a.ai.iterator;x.next();)ep(a,x.value,y);a.layout&&(y?a.layout.isValidLayout=!1:a.layout.C())}function ep(a,y,x){if(y!==null){for(var E=y.gl.iterator;E.next();)ep(a,E.value,x);y.layout!==null&&(x?y.layout.isValidLayout=!1:y.layout.C())}}function hg(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||ah(z,"Layout")),a.xh=!1;for(var ee=a.ai.iterator;ee.next();)dg(a,ee.value,y,E);b.isValidLayout||(!y||b.isRealtime||b.isRealtime===null||E===0?(b.doLayout(a),Ps(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||Fc(z),a.aa=x}}}function dg(a,y,x,E){if(y!==null){for(var b=y.gl.iterator;b.next();)dg(a,b.value,x,E);b=y.layout,b===null||b.isValidLayout||(!x||b.isRealtime||E===0?(y.rh=!y.location.w(),b.doLayout(y),y.C(32),Dc(a,y),b.isValidLayout=!0):a.xh=!0)}}be.yz=function(){for(var a=new Bn,y=this.nodes;y.next();){var x=y.value;x.isTopLevel&&x.kh()===null&&a.add(x)}return a.iterator};function Zp(a){function y(b){var z=b.toLowerCase(),ee=new Bn;x.add(b,ee),x.add(z,ee),E.add(b,b),E.add(z,b)}var x=new Rt,E=new Rt;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 Ud(a,y){var x=a.hw.I(y);return x!==null?x:a.hw.I(y.toLowerCase())}function Cf(a,y){var x=a.iw.I(y);if(x!==null||(x=a.iw.I(y.toLowerCase()),x!==null))return x;at("Unknown DiagramEvent name: "+y)}be.Bj=function(a,y){return a=Cf(this,a),a!==null&&a.add(y),this},be.am=function(a,y){a=Cf(this,a),a!==null&&a.remove(y)},be.R=function(a,y,x){var E=Cf(this,a),b=new so;if(b.diagram=this,a=Ud(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 Ic(a){if(a.animationManager.isTicking)return!1;var y=a.currentTool;return y===a.toolManager.findTool("Dragging")?!a.Mr||y.isComplexRoutingRealtime:!0}be.Yj=function(a,y){return bf(this,!1,null,y||null).Yj(a.x,a.y,a.width,a.height)},Vt.prototype.computeOccupiedArea=function(a){return this.isVirtualized?this.viewportBounds.copy():this.Zi?qf(this,a):a.assign(this.documentBounds)};function bf(a,y,x,E){var b=a.Xh;if(b===null&&(a.Xh=b=new sm(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=tp(a,x)),x===null){y=Gt.alloc(),a.computeOccupiedArea(y),y.Bc(100,100),b.initialize(y);for(var z=a.nodes;z.next();){var ee=z.value,re=ee.layer;re!==null&&re.visible&&!re.isTemporary&&cg(a,ee,E,y)}Gt.free(y)}else{for(0<x.memberParts.count&&(y=a.computePartsBounds(x.memberParts,!1),y.Bc(20,20),b.initialize(y)),y=Gt.alloc(),z=x.memberParts;z.next();)ee=z.value,ee instanceof Fi&&cg(a,ee,E,y);Gt.free(y)}b.group=x,b.Yx=E,b.vs=!1}else y&&ox(b);return b}function tp(a,y){return y.avoidable&&!y.isLinkLabel?y:y.containingGroup!==null?tp(a,y.containingGroup):null}function cg(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(vp(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(ac,x,y+1);else for(var ee=x;ee<=y;ee++)z[ee]=ac}else if(y instanceof no)for(y=y.memberParts;y.next();)b=y.value,b instanceof Fi&&cg(a,b,x,E)}}function Vh(a,y){a.Xh===null||a.Xh.vs||y!==void 0&&(!y.avoidable||y.isLinkLabel)||(a.Xh.vs=!0)}Vt.prototype.gs=function(a){this.wp.assign(a),this.computeAutoScrollPosition(this.wp).Xa(this.position)?this.ug():Oc(this)};function Oc(a){a.vk===-1&&(a.vk=br(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=Gt.alloc(),a.computeBounds(y),y.ed(a.documentBounds),Kd(a,y),Gt.free(y),a.Fc=!0,a.bd(),Oc(a))}},a.vp))}Vt.prototype.ug=function(){this.vk!==-1&&(xn.clearTimeout(this.vk),this.vk=-1)},Vt.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=Gt.allocAt(0,0,E.width*b,E.height*b);var z=Ie.allocAt(0,0);if(a.x>=E.x&&a.x<E.x+x.left&&this.allowHorizontalScroll){var ee=Math.max(this.scrollHorizontalLineChange,1);ee|=0,z.x-=ee,a.x<E.x+x.left/2&&(z.x-=ee),a.x<E.x+x.left/4&&(z.x-=4*ee)}else a.x<=E.x+E.width&&a.x>E.x+E.width-x.right&&this.allowHorizontalScroll&&(ee=Math.max(this.scrollHorizontalLineChange,1),ee|=0,z.x+=ee,a.x>E.x+E.width-x.right/2&&(z.x+=ee),a.x>E.x+E.width-x.right/4&&(z.x+=4*ee));return a.y>=E.y&&a.y<E.y+x.top&&this.allowVerticalScroll?(ee=Math.max(this.scrollVerticalLineChange,1),ee|=0,z.y-=ee,a.y<E.y+x.top/2&&(z.y-=ee),a.y<E.y+x.top/4&&(z.y-=4*ee)):a.y<=E.y+E.height&&a.y>E.y+E.height-x.bottom&&this.allowVerticalScroll&&(ee=Math.max(this.scrollVerticalLineChange,1),ee|=0,z.y+=ee,a.y>E.y+E.height-x.bottom/2&&(z.y+=ee),a.y>E.y+E.height-x.bottom/4&&(z.y+=4*ee)),z.Xa(qn)||(y=new Ie(y.x+z.x/b,y.y+z.y/b)),Gt.free(E),Ie.free(z),y},be=Vt.prototype,be.Cs=function(){return null},be.av=function(){return null},be.bs=function(a,y){this.pj.add(a,y)},be.Fu=function(a){(this.Pw=a)||this.nodes.each(function(y){y instanceof no&&(y.$p=null)})};function Rc(a,y,x){function E(){var he=+new Date;for(z=!0,ee.reset();ee.next();)if(!ee.value[0].al){z=!1;break}z||he-ue>oe?y(x,b,re):xn.requestAnimationFrame(E)}for(var b=x.callback,z=!0,ee=a.Og.iterator;ee.next();)if(!ee.value[0].al){z=!1;break}if(typeof b!="function"||z)return y(x,b,a);var re=a,oe=x.callbackTimeout||300,ue=+new Date;return xn.requestAnimationFrame(function(){E()}),null}be.Wz=function(a){return Ja?(a===void 0&&(a={}),a.returnType="Image",this.Jx(a)):null},be.Jx=function(a){return a===void 0&&(a={}),Rc(this,this.Xz,a)},be.Xz=function(a,y,x){var E=np(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 Xd+"data":b=E.getImageData(0,0,x.width,x.height);break;case Xd:E=(a.document||document).createElement("img"),E.src=x.toDataURL(a.type,a.details),b=E;break;case"blob":return typeof y!="function"&&at('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 np(a,y,x,E){if(a.animationManager.Cc(),a.bd(),a.ta===null)return null;typeof y!="object"&&at("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 ee=y.maxSize;y.maxSize===void 0&&(ee=x==="SVG"?new Pn(1/0,1/0):new Pn(2e3,2e3));var re=y.position||null,oe=y.parts||null,ue=y.padding===void 0?1:y.padding,he=y.background||null,pe=y.omitTemporary;pe===void 0&&(pe=!0);var Se=y.document||document,Pe=y.elementFinished||null,Fe=y.showTemporary;Fe===void 0&&(Fe=!pe),y=y.showGrid,y===void 0&&(y=Fe),b!==null&&isNaN(b.width)&&isNaN(b.height)&&(b=null),typeof ue=="number"?ue=new $r(ue):ue instanceof $r||at("MakeImage padding must be a Margin or a number."),ue.left=Math.max(ue.left,0),ue.right=Math.max(ue.right,0),ue.top=Math.max(ue.top,0),ue.bottom=Math.max(ue.bottom,0),a.ib.Vc(!0),pe=new yl(null,Se,void 0,!0);var Ne=pe.context;if(!(b||z||oe||re))return pe.width=a.Aa+Math.ceil(ue.left+ue.right),pe.height=a.ya+Math.ceil(ue.top+ue.bottom),x==="SVG"?E===null?null:(E.resize(pe.width,pe.height,pe.width,pe.height),E.ownerDocument=Se,E.hs=Pe,wf(a,E.context,ue,new Pn(pe.width,pe.height),a.Ca,a.pa,oe,he,Fe,y),E.context):(a.Xm=!1,wf(a,Ne,ue,new Pn(pe.width,pe.height),a.Ca,a.pa,oe,he,Fe,y),a.Xm=!0,pe.context);var Xe=a.Pp,Ve=a.documentBounds.copy();if(Ve.Fv(a.yb),Fe)for(var ht=a.Wa.s,ft=ht.length,mt=0;mt<ft;mt++){var Ct=ht[mt];if(Ct.visible&&Ct.isTemporary){Ct=Ct.Pa.s;for(var Kt=Ct.length,yi=0;yi<Kt;yi++){var tr=Ct[yi];tr.isInDocumentBounds&&tr.isVisible()&&(tr=tr.actualBounds,tr.w()&&Ve.ed(tr))}}}if(ht=new Ie(Ve.x,Ve.y),oe!==null){for(ft=new Gt(0,0,0,0),mt=!0,Ct=oe.iterator,Ct.reset();Ct.next();)Kt=Ct.value,Kt instanceof pr&&(yi=Kt.layer,yi!==null&&!yi.visible||yi!==null&&!Fe&&yi.isTemporary||!Kt.isVisible()||(Kt=Kt.actualBounds,Kt.w()&&(mt?(mt=!1,ft.assign(Kt)):ft.ed(Kt))));Ve.width=ft.width,Ve.height=ft.height,ht.x=ft.x,ht.y=ft.y}return re!==null&&re.w()&&(ht=re,z||(z=Xe)),ft=re=0,ue!==null&&(re=ue.left+ue.right,ft=ue.top+ue.bottom),mt=Ct=0,b!==null&&(Ct=b.width,mt=b.height,isFinite(Ct)&&(Ct=Math.max(0,Ct-re)),isFinite(mt)&&(mt=Math.max(0,mt-ft))),b!==null&&z!==null?(z==="NaN"&&(z=Xe),b.w()?(b=Ct,Ve=mt):isNaN(mt)?(b=Ct,Ve=Ve.height*z):(b=Ve.width*z,Ve=mt)):b!==null?b.w()?(z=Math.min(Ct/Ve.width,mt/Ve.height),b=Ct,Ve=mt):isNaN(mt)?(z=Ct/Ve.width,b=Ct,Ve=Ve.height*z):(z=mt/Ve.height,b=Ve.width*z,Ve=mt):z!==null?z==="NaN"&&ee.w()?(z=Math.min((ee.width-re)/Ve.width,(ee.height-ft)/Ve.height),z>Xe?(z=Xe,b=Ve.width,Ve=Ve.height):(b=ee.width,Ve=ee.height)):(b=Ve.width*z,Ve=Ve.height*z):(z=Xe,b=Ve.width,Ve=Ve.height),ue!==null?(b+=re,Ve+=ft):ue=new $r(0),ee!==null&&(Xe=ee.width,ee=ee.height,isNaN(Xe)&&(Xe=2e3),isNaN(ee)&&(ee=2e3),isFinite(Xe)&&(b=Math.min(b,Xe)),isFinite(ee)&&(Ve=Math.min(Ve,ee))),pe.width=Math.ceil(b),pe.height=Math.ceil(Ve),x==="SVG"?E===null?null:(E.resize(pe.width,pe.height,pe.width,pe.height),E.ownerDocument=Se,E.hs=Pe,wf(a,E.context,ue,new Pn(Math.ceil(b),Math.ceil(Ve)),z,ht,oe,he,Fe,y),E.context):(a.Xm=!1,wf(a,Ne,ue,new Pn(Math.ceil(b),Math.ceil(Ve)),z,ht,oe,he,Fe,y),a.Xm=!0,pe.context)}fn.Object.defineProperties(Vt.prototype,{renderer:{get:function(){return this.nl},set:function(a){this instanceof me||(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 Ca(this,xn.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 Ca(this,xn.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(xn,"resize",this.Ov,!1),this.removeEventListener(xn,"wheel",this.$j,!0),sh===this&&(sh=null)):this.ui===null&&(this.hf=!1),this.Ka=null,a!==null&&((y=a.H)&&(y.div=null),Xg(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)&&Kn(a,"0 <= value <= 1",Vt,"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),cu(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),cu(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),cu(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),cu(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(a){var y=this.iu;y!==a&&(0>a&&Kn(a,">= 0",Vt,"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&&Kn(a,">= 0",Vt,"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 Kn(a,">= 0",Vt,"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||qg(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&&at("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var x=Ug(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var E=this.vb;this.vb=!0,ah(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=lg(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(xn,"pointermove",this.dk,!0),this.addEventListener(xn,"pointerdown",this.ui,!0),this.addEventListener(xn,"pointerup",this.fk,!0),this.addEventListener(xn,"pointerout",this.ek,!0),this.addEventListener(xn,"pointercancel",this.ck,!0),this.removeEventListener(y,"wheel",this.$j,!1),this.addEventListener(xn,"wheel",this.$j,!0),this.addEventListener(xn,"selectstart",this.preventDefault,!1)):(this.removeEventListener(xn,"pointermove",this.dk,!0),this.removeEventListener(xn,"pointerdown",this.ui,!0),this.removeEventListener(xn,"pointerup",this.fk,!0),this.removeEventListener(xn,"pointerout",this.ek,!0),this.removeEventListener(xn,"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(xn,"wheel",this.$j,!0),this.removeEventListener(xn,"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=Ie.alloc().assign(this.pa);if(!y.D(a)){var x=this.viewportBounds.copy();this.pa.assign(a),Gg(this.animationManager,y,this.pa),this.vb||this.ta===null&&!this.wo.w()?Vu(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)}Ie.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=Qg(this)),this.fe},set:function(a){var y=this.fe;if(y!==a){y===null&&(y=this.fe=Qg(this)),a.type!==Wn.Grid&&at("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),Vu(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||at("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 $r(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===Kh&&cu(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,cu(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,sg(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&&sg(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!==Ys&&cu(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()||at("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()||at("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)):Kn(a,"> 0",Vt,"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)):Kn(a,"> 0",Vt,"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),cu(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 $r(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&&at("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();)Qp(a.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(a){var y=this.uu;y!==a&&(a!==Ku&&a!==as&&a!==Lf&&at("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 Pn(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 $r(a));var y=this.xp;y.D(a)||(this.xp=a=a.J(),this.Ya(),this.g("autoScrollRegion",y,a))}}}),fn.Object.defineProperties(Vt,{licenseKey:{get:function(){return zc.jc()},set:function(a){zc.add(a.replace(/\s/g,""))}},version:{get:function(){return xd}}}),Vt.prototype.makeImageData=Vt.prototype.Jx,Vt.prototype.makeImage=Vt.prototype.Wz,Vt.prototype.cacheGroupExternalLinks=Vt.prototype.Fu,Vt.prototype.addRenderer=Vt.prototype.bs,Vt.prototype.makeSVG=Vt.prototype.av,Vt.prototype.makeSvg=Vt.prototype.Cs,Vt.prototype.stopAutoScroll=Vt.prototype.ug,Vt.prototype.doAutoScroll=Vt.prototype.gs,Vt.prototype.isUnoccupied=Vt.prototype.Yj,Vt.prototype.raiseDiagramEvent=Vt.prototype.R,Vt.prototype.removeDiagramListener=Vt.prototype.am,Vt.prototype.addDiagramListener=Vt.prototype.Bj,Vt.prototype.findTreeRoots=Vt.prototype.yz,Vt.prototype.layoutDiagram=Vt.prototype.Uz,Vt.prototype.findTopLevelGroups=Vt.prototype.qz,Vt.prototype.findTopLevelNodesAndLinks=Vt.prototype.rz,Vt.prototype.ensureBounds=Vt.prototype.Va,Vt.prototype.findLinksByExample=Vt.prototype.ls,Vt.prototype.findNodesByExample=Vt.prototype.ms,Vt.prototype.findLinkForData=Vt.prototype.Kc,Vt.prototype.findNodeForData=Vt.prototype.ii,Vt.prototype.findPartForData=Vt.prototype.Lc,Vt.prototype.findLinkForKey=Vt.prototype.findLinkForKey,Vt.prototype.findNodeForKey=Vt.prototype.Vb,Vt.prototype.findPartForKey=Vt.prototype.findPartForKey,Vt.prototype.rebuildParts=Vt.prototype.Wd,Vt.prototype.transformViewToDoc=Vt.prototype.Ps,Vt.prototype.transformRectDocToView=Vt.prototype.zA,Vt.prototype.transformDocToView=Vt.prototype.op,Vt.prototype.centerRect=Vt.prototype.es,Vt.prototype.scrollToRect=Vt.prototype.tv,Vt.prototype.scroll=Vt.prototype.scroll,Vt.prototype.highlightCollection=Vt.prototype.Jz,Vt.prototype.highlight=Vt.prototype.Iz,Vt.prototype.selectCollection=Vt.prototype.rA,Vt.prototype.select=Vt.prototype.select,Vt.prototype.updateAllRelationshipsFromData=Vt.prototype.rp,Vt.prototype.updateAllTargetBindings=Vt.prototype.updateAllTargetBindings,Vt.prototype.commit=Vt.prototype.commit,Vt.prototype.rollbackTransaction=Vt.prototype.Kf,Vt.prototype.commitTransaction=Vt.prototype.eb,Vt.prototype.startTransaction=Vt.prototype.Ea,Vt.prototype.raiseChanged=Vt.prototype.g,Vt.prototype.raiseChangedEvent=Vt.prototype.cb,Vt.prototype.removeChangedListener=Vt.prototype.ik,Vt.prototype.addChangedListener=Vt.prototype.Pe,Vt.prototype.removeModelChangedListener=Vt.prototype.mA,Vt.prototype.addModelChangedListener=Vt.prototype.Yw,Vt.prototype.findLayer=Vt.prototype.Qj,Vt.prototype.removeLayer=Vt.prototype.kA,Vt.prototype.addLayerAfter=Vt.prototype.Cy,Vt.prototype.addLayerBefore=Vt.prototype.Ww,Vt.prototype.addLayer=Vt.prototype.Al,Vt.prototype.moveParts=Vt.prototype.moveParts,Vt.prototype.copyParts=Vt.prototype.Kj,Vt.prototype.removeParts=Vt.prototype.Is,Vt.prototype.remove=Vt.prototype.remove,Vt.prototype.add=Vt.prototype.add,Vt.prototype.clearDelayedGeometries=Vt.prototype.bx,Vt.prototype.setProperties=Vt.prototype.nm,Vt.prototype.attach=Vt.prototype.Du,Vt.prototype.set=Vt.prototype.set,Vt.prototype.resetInputOptions=Vt.prototype.Sx,Vt.prototype.setInputOption=Vt.prototype.sA,Vt.prototype.getInputOption=Vt.prototype.Ql,Vt.prototype.resetRenderingHints=Vt.prototype.Tx,Vt.prototype.setRenderingHint=Vt.prototype.Xx,Vt.prototype.getRenderingHint=Vt.prototype.Gf,Vt.prototype.maybeUpdate=Vt.prototype.bd,Vt.prototype.requestUpdate=Vt.prototype.$b,Vt.prototype.delayInitialization=Vt.prototype.Xy,Vt.prototype.isUpdateRequested=Vt.prototype.Pz,Vt.prototype.invalidateDocumentBounds=Vt.prototype.Ya,Vt.prototype.findObjectsNear=Vt.prototype.og,Vt.prototype.findPartsNear=Vt.prototype.mz,Vt.prototype.findObjectsIn=Vt.prototype.Cf,Vt.prototype.findPartsIn=Vt.prototype.ux,Vt.prototype.findObjectsAt=Vt.prototype.ji,Vt.prototype.findPartsAt=Vt.prototype.lz,Vt.prototype.findObjectAt=Vt.prototype.ic,Vt.prototype.findPartAt=Vt.prototype.Ol,Vt.prototype.focusObject=Vt.prototype.zz,Vt.prototype.alignDocument=Vt.prototype.Jy,Vt.prototype.zoomToRect=Vt.prototype.BA,Vt.prototype.zoomToFit=Vt.prototype.zoomToFit,Vt.prototype.diagramScroll=Vt.prototype.kx,Vt.prototype.focus=Vt.prototype.focus;var Ff=new Rt,fg=null,Ja=xn.document!==void 0,vd=null,yd="",Ys=new Ot(Vt,"None",0),ql=new Ot(Vt,"Uniform",1),Lh=new Ot(Vt,"UniformToFill",2),jc=new Ot(Vt,"CycleAll",10),gg=new Ot(Vt,"CycleNotDirected",11),pg=new Ot(Vt,"CycleNotDirectedFast",12),mg=new Ot(Vt,"CycleNotUndirected",13),vg=new Ot(Vt,"CycleDestinationTree",14),yg=new Ot(Vt,"CycleSourceTree",15),Kh=new Ot(Vt,"DocumentScroll",1),Yd=new Ot(Vt,"InfiniteScroll",2),Ku=new Ot(Vt,"TreeParentCollapsed",21),as=new Ot(Vt,"AllParentsCollapsed",22),Lf=new Ot(Vt,"AnyParentsCollapsed",23),zc=new Bn,xd="2.3.10",Xd="image",Zc=null,ip=!1;function Xs(){if(Ja){var a=xn.document.createElement("canvas"),y=a.getContext("2d"),x=ki("7ca11abfd022028846");y[x]=ki("398c3597c01238");for(var E=["5da73c80a36455d7038e4972187c3cae51fd22",ni.Dx+"4ae6247590da4bb21c324ba3a84e385776",pt.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",Re.za],b=1;5>b;b++)y[ki("7ca11abfd7330390")](ki(E[b-1]),10,15*b);for(y[x]=ki("39f046ebb36e4b"),x=1;5>x;x++)y[ki("7ca11abfd7330390")](ki(E[x-1]),10,15*x);(E.length!==4||E[0][0]!=="5"||E[3][0]!=="7")&&(pt.prototype.Cd=pt.prototype.Eu),Zc=a}}Vt.className="Diagram",Vt.fromDiv=function(a){var y=a;return typeof a=="string"&&(y=xn.document.getElementById(a)),y instanceof HTMLDivElement&&y.H instanceof Vt?y.H:null},Vt.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},Vt.useDOM=function(a){Ja=a?xn.document!==void 0:!1},Vt.isUsingDOM=function(){return Ja},Vt.None=Ys,Vt.Uniform=ql,Vt.UniformToFill=Lh,Vt.CycleAll=jc,Vt.CycleNotDirected=gg,Vt.CycleNotDirectedFast=pg,Vt.CycleNotUndirected=mg,Vt.CycleDestinationTree=vg,Vt.CycleSourceTree=yg,Vt.DocumentScroll=Kh,Vt.InfiniteScroll=Yd,Vt.TreeParentCollapsed=Ku,Vt.AllParentsCollapsed=as,Vt.AnyParentsCollapsed=Lf;function Bf(){this.wy=null,this.j="zz@orderNum",this._tk==="63ad05bbe23a1786468a4c741b6d2"?this.Rc=this.j=!0:this.Rc=null}function Sd(a,y){if(y.ib.setTransform(y.Mb,0,0,y.Mb,0,0),y.ib.yc(),a.Rc===null)e:{y="f";var x=xn[ki("76a715b2f73f148a")][ki("72ba13b5")]||"";if(a.Rc=!0,Ja){var E=Vt[ki("76a115b6ed251eaf4692")];if(E)for(var b=zc.iterator;b.next()&&(E=b.value,E=ki(E).split(ki("39e9")),!(6>E.length));){var z=ki(E[1]).split(".");if(E[4]!=="7da71ca0")break;var ee=ki(ni[ki("6cae19")]).split(".");if(z[0]>ee[0]||z[0]===ee[0]&&z[1]>=ee[1]){var re=xn[ki("74a900bae4370f8b51")][ki("6fbb13a1c2311e8a57")].toLowerCase();if(ee=re[ki("73a612b6fb191d")](ki("3aad1ab6e022098b4dc4")),z=ki(E[2]),-1<ee&&(re=re[ki("73a612b6fb191d")](z.toLowerCase()+"/"),a.Rc=!(-1<re&&re<ee),!a.Rc))break;for(ee=x[ki("76ad18b4f73e")],re=x[ki("73a612b6fb191d")](ki("35e7"))+2;re<ee;re++)y+=x[re];if(ee=y[ki("73a612b6fb191d")](z),0>ee&&z!==ki("7da71ca0ad381e90")&&(ee=y[ki("73a612b6fb191d")](ki("76a715b2ef3e149757"))),0>ee&&(ee=y[ki("73a612b6fb191d")](ki("76a715b2ef3e149757"))),0>ee&&(ee=y[ki("73a612b6fb191d")](ki("2bfa41fdb3784bca12"))),0>ee&&(ee=x[ki("73a612b6fb191d")](ki("7baa19a6f76c1988428554"))),a.Rc=!(0<=ee&&ee<y[ki("73a612b6fb191d")](ki("35"))||y[ki("73a612b6fb191d")](ki("35"))===-1),!a.Rc||x[ki("73a612b6fb191d")](ki("7fb002b6ed25128b4da25b2e"))&&(a.Rc=!(-1<x[ki("73a612b6fb191d")](z)),!a.Rc)||(ee=xn[ki("76a715b2f73f148a")][ki("69ad17a1e03e")],re=ee[ki("73a612b6fb191d")](ki("7fb002b6ed25128b4da25b2e")),-1<re&&(a.Rc=!(ee[ki("73a612b6fb191d")](z)>re),!a.Rc)))break;if(z[0]==="#"){ee=xn.document.createElement("div");for(var oe=E[0].replace(/[A-Za-z]/g,"");4>oe.length;)oe+="9";if(re=oe,oe=oe.substr(oe.length-4),E="",E+=["gsh","gsf"][parseInt(oe.substr(0,1),10)%2],E+=["Header","Background","Display","Feedback"][parseInt(oe.substr(0,1),10)%4],ee[ki("79a417a0f0181a8946")]=E,xn.document[ki("78a712aa")]){xn.document[ki("78a712aa")][ki("7bb806b6ed32388c4a875b")](ee),oe=xn.getComputedStyle(ee).getPropertyValue(ki("78a704b7e62456904c9b12701b6532a8"));var ue=xn.getComputedStyle(ee).getPropertyValue(ki("75b817b0ea2202"));if(xn.document[ki("78a712aa")][ki("68ad1bbcf533388c4a875b")](ee),oe){if(ee=xn[ki("77a902b0eb1b1e804a8a")],ue==="0."+parseInt(re,10)%100||oe.indexOf(parseInt(z[1]+z[2],16))!==-1&&oe.indexOf(parseInt(z[3]+z[4],16))!==-1){a.Rc=!1;break}else if(ee&&ee(ki("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(E="."+E,z=0;z<document.styleSheets.length;z++){ee=document.styleSheets[z].rules||document.styleSheets[z].cssRules;for(var he in ee)if(E===ee[he].selectorText){a.Rc=!1;break e}}}}else a.Rc=null,a.Rc=!1}}}else{for(he=x[ki("76ad18b4f73e")],b=x[ki("73a612b6fb191d")](ki("35e7"))+2;b<he;b++)y+=x[b];x=y[ki("73a612b6fb191d")](ki("7da71ca0ad381e90")),a.Rc=!(0<=x&&x<y[ki("73a612b6fb191d")](ki("35")))}}}return 0<a.Rc&&a!==a.wy}Bf.className="DiagramHelper";function Uu(a){this.j=a===void 0?new Ie:a,this.o=new Ie}fn.Object.defineProperties(Uu.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 wd="DraggingInfo";Uu.className="DraggingInfo";function ie(a,y,x){this.node=a,this.info=y,this.Su=x}ie.className="DraggingNodeInfoPair";function ae(){this.reset()}ae.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new Pn(NaN,NaN).freeze(),this.gridSnapCellSpot=Co,this.gridSnapOrigin=new Ie(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},ae.className="DraggingOptions";function fe(a,y){if(typeof a=="string"||xn.Element&&a instanceof Element)var x=Vt.call(this,a)||this;else x=Vt.call(this)||this,y=a;return ce(x),y&&x.nm(y),x}_t(fe,Vt);function ce(a){a.allowDragOut=!0,a.allowMove=!1,a.isReadOnly=!0,a.contentAlignment=Zo,a.layout=new Hs}fe.prototype.reset=function(){Vt.prototype.reset.call(this),ce(this)},fe.className="Palette";function me(a,y){if(typeof a=="string"||xn.Element&&a instanceof Element)var x=Vt.call(this,a)||this;else x=Vt.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 pr;var b=new lo;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 $r(0,0,0,0),x.pa.h(0,0),x.toolManager.gb("Dragging",new Je,x.toolManager.mouseMoveTools),x.click=function(){var z=E.observed;if(z!==null){var ee=z.viewportBounds,re=E.lastInput.documentPoint;z.position=new Ie(re.x-ee.width/2,re.y-ee.height/2)}},x.Pf=function(){E.Ya(),Ge(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&&Ge(E)},x.autoScale=ql,x.vb=!1,y&&Object.assign(x,y),x}_t(me,Vt),me.prototype.computePixelRatio=function(){return 1},me.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(Hh(this),this.ql===null){var x=new yl(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),ke(this)}finally{this.ta=a,this.ib=y}}}Vt.prototype.redraw.call(this)},me.prototype.gc=function(){if(this.Ka===null&&at("No div specified"),this.ta===null&&at("No canvas specified"),!(this.ta instanceof Ca)&&(Vv(this.box),this.Fc)){var a=this.observed;if(a!==null&&!a.animationManager.defaultAnimation.isAnimating&&a.pi){Hh(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?ke(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 ke(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=Gt.alloc().assign(a.viewportBounds).ed(y.viewportBounds),Mu(y,b),Gt.free(b),Ps(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 ee=0;ee<z;ee++){var re=y[ee],oe=a;if(re.visible&&re.opacity!==0){var ue=re.diagram.grid.part;if(!x&&re.isTemporary)E&&ue.layer===re&&(re=Fh(re,b),ue.gc(b,oe),b.globalAlpha=re);else{for(var he=Fh(re,b),pe=oe.scale,Se=Gt.alloc(),Pe=re.Pa.s,Fe=Pe.length,Ne=0;Ne<Fe;Ne++){var Xe=Pe[Ne];(E||Xe!==ue)&&re.Oj(b,Xe,oe,null,pe,Se,!1)}Gt.free(Se),b.globalAlpha=he}}}}}function Ge(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=Pn.alloc();b.h(x.width,x.height),E.desiredSize=b,Pn.free(b),a=2/a.scale,E instanceof lo&&(E.strokeWidth=a),y.location=new Ie(x.x-a/2,x.y-a/2),y.isSelected=!0}}}me.prototype.computeBounds=function(){var a=this.observed;if(a===null)return gs;var y=a.documentBounds.copy();return y.ed(a.viewportBounds),y},me.prototype.invalidateViewport=function(){this.Fc!==!0&&(this.Fc=!0,this.$b())},me.prototype.onViewportBoundsChanged=function(a,y,x,E){this.vb||(this.vd=!0,this.N(),this.Ee=!0,this.Ya(),Ge(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))},fn.Object.defineProperties(me.prototype,{observed:{get:function(){return this.V},set:function(a){var y=this.V;if(a instanceof me&&at("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),Ge(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),Ge(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)}}}),me.className="Overview";function Je(){ka.call(this),this.j=null}_t(Je,ka),Je.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 Ie(x.width/2,x.height/2),a=a.firstInput.documentPoint,y.position=new Ie(a.x-this.j.x,a.y-this.j.y)),!0)},Je.prototype.doActivate=function(){this.j=null,ka.prototype.doActivate.call(this)},Je.prototype.doUpdateCursor=function(){var a=this.diagram,y=a.box;y!==null&&y.cursor&&(a.currentCursor=y.cursor)},Je.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 Ie(E.x-x.x,E.y-x.y)}a=a.lastInput.documentPoint,y.position=new Ie(a.x-this.j.x,a.y-this.j.y)}}},Je.className="OverviewDraggingTool";function Ye(){Er(this),this.H=sh,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=gs,this.hb=!0,this.cg=null,this.ob=200}Ye.prototype.toString=function(){return"CommandHandler"},Ye.prototype.Xe=function(a){this.H=a},Ye.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput,x=Vr?y.meta:y.control,E=y.shift,b=y.alt,z=y.key;!x||z!=="C"&&z!=="Insert"?x&&z==="X"||E&&z==="Del"?this.canCutSelection()&&this.cutSelection():x&&z==="V"||E&&z==="Insert"?this.canPasteSelection()&&this.pasteSelection():x&&z==="Y"||b&&E&&z==="Backspace"?this.canRedo()&&this.redo():x&&z==="Z"||b&&z==="Backspace"?this.canUndo()&&this.undo():z==="Del"||z==="Backspace"?this.canDeleteSelection()&&this.deleteSelection():x&&z==="A"?this.canSelectAll()&&this.selectAll():z==="Esc"?this.canStopCommand()&&this.stopCommand():z==="Up"?a.allowVerticalScroll&&(x?a.scroll("pixel","up"):a.scroll("line","up")):z==="Down"?a.allowVerticalScroll&&(x?a.scroll("pixel","down"):a.scroll("line","down")):z==="Left"?a.allowHorizontalScroll&&(x?a.scroll("pixel","left"):a.scroll("line","left")):z==="Right"?a.allowHorizontalScroll&&(x?a.scroll("pixel","right"):a.scroll("line","right")):z==="PageUp"?E&&a.allowHorizontalScroll?a.scroll("page","left"):a.allowVerticalScroll&&a.scroll("page","up"):z==="PageDown"?E&&a.allowHorizontalScroll?a.scroll("page","right"):a.allowVerticalScroll&&a.scroll("page","down"):z==="Home"?x&&a.allowVerticalScroll?a.scroll("document","up"):!x&&a.allowHorizontalScroll&&a.scroll("document","left"):z==="End"?x&&a.allowVerticalScroll?a.scroll("document","down"):!x&&a.allowHorizontalScroll&&a.scroll("document","right"):z===" "?this.canScrollToPart()&&this.scrollToPart():z==="Subtract"?this.canDecreaseZoom()&&this.decreaseZoom():z==="Add"?this.canIncreaseZoom()&&this.increaseZoom():x&&z==="0"?this.canResetZoom()&&this.resetZoom():E&&z==="Z"?this.canZoomToFit()&&this.zoomToFit():x&&!E&&z==="G"?this.canGroupSelection()&&this.groupSelection():x&&E&&z==="G"?this.canUngroupSelection()&&this.ungroupSelection():z==="F2"||y.event&&y.event.key==="F2"?this.canEditTextBlock()&&this.editTextBlock():z==="ContextMenu"||y.event&&y.event.key==="ContextMenu"?this.canShowContextMenu()&&this.showContextMenu():y.bubbles=!0:this.canCopySelection()&&this.copySelection()},Ye.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},Ye.prototype.stopCommand=function(){var a=this.diagram,y=a.currentTool;y instanceof Eo&&a.allowSelect&&a.clearSelection(),y!==null&&y.doCancel()},Ye.prototype.canStopCommand=function(){return!0},Ye.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=""}},Ye.prototype.canSelectAll=function(){return this.diagram.allowSelect},Ye.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 In,x=a.selection.iterator;x.next();)Vc(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=""}},Ye.prototype.canDeleteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowDelete||a.selection.count===0)},Ye.prototype.copySelection=function(){var a=this.diagram,y=new In;for(a=a.selection.iterator;a.next();)Vc(y,a.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,function(x){return x.canCopy()});this.copyToClipboard(y)},Ye.prototype.canCopySelection=function(){var a=this.diagram;return!!(a.allowCopy&&a.allowClipboard&&a.selection.count!==0)},Ye.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},Ye.prototype.canCutSelection=function(){var a=this.diagram;return!!(!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&a.selection.count!==0)},Ye.prototype.copyToClipboard=function(a){var y=this.diagram,x=null;if(a===null)vd=null,yd="";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 Bn,x.addAll(z),vd=x,yd=y.model.dataFormat}}y.R("ClipboardChanged",x)},Ye.prototype.pasteFromClipboard=function(){var a=new In,y=vd;if(y===null)return a;var x=this.diagram;if(yd!==x.model.dataFormat)return a;var E=x.model,b=!1,z=!1,ee=null;try{E.Tl()&&(b=E.Jj,E.Jj=this.copiesParentKey),E.Wj()&&(z=E.Ij,E.Ij=this.copiesGroupKey),ee=x.Kj(y,x,!1)}finally{for(E.Tl()&&(E.Jj=b),E.Wj()&&(E.Ij=z),y=ee.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},Ye.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);gd(y,z,new Ie(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=""}},Ye.prototype.canPasteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||vd===null||vd.count===0||yd!==a.model.dataFormat)},Ye.prototype.undo=function(){this.diagram.undoManager.undo()},Ye.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()},Ye.prototype.redo=function(){this.diagram.undoManager.redo()},Ye.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()},Ye.prototype.decreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;y.autoScale===Ys&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Ye.prototype.canDecreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;return y.autoScale!==Ys?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Ye.prototype.increaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;y.autoScale===Ys&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Ye.prototype.canIncreaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;return y.autoScale!==Ys?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Ye.prototype.resetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;a<y.minScale||a>y.maxScale||(y.scale=a)},Ye.prototype.canResetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;return a<y.minScale||a>y.maxScale?!1:y.allowZoom},Ye.prototype.zoomToFit=function(){var a=this.diagram,y=a.animationManager;y.Cc(),a.redraw();var x=a.position,E=a.scale;ah(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=gs):(this.Jt=E,this.sw=x.copy(),a.zoomToFit(),this.Au=a.scale,this.yu=a.documentBounds.copy()),Fc(y)},Ye.prototype.canZoomToFit=function(){return this.diagram.allowZoom},Ye.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(oe){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;ah(x,"Scroll To Part");var E=this.scrollToPartPause;if(0<E){var b=yt(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 oe=b.pop();0<b.length&&oe instanceof Fi&&oe.isTreeExpanded&&(!(oe instanceof no)||oe.isSubGraphExpanded);)oe=b.pop();0<b.length?(oe instanceof pr&&y.tv(oe.actualBounds),oe instanceof Fi&&!oe.isTreeExpanded&&(oe.isTreeExpanded=!0),oe instanceof no&&!oe.isSubGraphExpanded&&(oe.isSubGraphExpanded=!0)):(oe instanceof pr&&y.es(oe.actualBounds),y.am("LayoutCompleted",ee)),y.eb("Scroll To Part")},ee=function(){br(z,(x.isEnabled?x.duration:0)+E)};y.Bj("LayoutCompleted",ee),z()}}else{var re=y.position.copy();y.es(a.actualBounds),re.Xa(y.position)&&x.Cc()}}};function yt(a,y,x){if(y.isVisible())return x;if(y instanceof Yo)yt(a,y.adornedPart,x);else if(y instanceof $n){var E=y.fromNode;E!==null&&yt(a,E,x),y=y.toNode,y!==null&&yt(a,y,x)}else y instanceof Fi&&(E=y.labeledLink,E!==null&&yt(a,E,x),E=y.pg(),E!==null&&(E.isTreeExpanded||E.wasTreeExpanded||x.push(E),yt(a,E,x))),y=y.containingGroup,y!==null&&(y.isSubGraphExpanded||y.wasSubGraphExpanded||x.push(y),yt(a,y,x));return x}Ye.prototype.canScrollToPart=function(a){return a===void 0&&(a=null),a!==null&&!(a instanceof pr)?!1:(a=this.diagram,a.selection.count===0&&a.highlighteds.count===0?!1:a.allowHorizontalScroll&&a.allowVerticalScroll)},Ye.prototype.collapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse Tree"),ah(y.animationManager,"Collapse Tree");var x=new Bn;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 Fi&&b.isTreeExpanded&&(b.collapseTree(),x.add(b))}y.R("TreeCollapsed",x)}finally{y.eb("Collapse Tree")}},Ye.prototype.canCollapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof Fi&&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 Fi&&y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Ye.prototype.expandTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand Tree"),ah(y.animationManager,"Expand Tree");var x=new Bn;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 Fi&&!b.isTreeExpanded&&(b.expandTree(),x.add(b))}y.R("TreeExpanded",x)}finally{y.eb("Expand Tree")}},Ye.prototype.canExpandTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof Fi)||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 Fi&&!y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Ye.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 Bn,z=a.selection.iterator;z.next();){var ee=z.value;ee.Zc()&&ee.canGroup()&&b.add(ee)}for(var re=new Bn,oe=b.iterator;oe.next();){var ue=oe.value;z=!1;for(var he=b.iterator;he.next();)if(ue.Td(he.value)){z=!0;break}z||re.add(ue)}if(0<re.count){var pe=re.first().containingGroup;if(pe!==null)for(;pe!==null;){b=!1;for(var Se=re.iterator;Se.next();)if(!Se.value.Td(pe)){b=!0;break}if(b)pe=pe.containingGroup;else break}if(x instanceof no)Tu(x),E=x.copy(),E!==null&&a.add(E);else if(y.Yu(x)){var Pe=y.copyNodeData(x);Qt(Pe)&&(y.xf(Pe),E=a.ii(Pe))}if(E!==null){pe!==null&&this.isValidMember(pe,E)&&(E.containingGroup=pe);for(var Fe=re.iterator;Fe.next();){var Ne=Fe.value;this.isValidMember(E,Ne)&&(Ne.containingGroup=E)}a.clearSelection(!0),E.isSelected=!0}}a.R("SelectionGrouped",E)}finally{a.eb("Group"),a.R("ChangedSelection",a.selection),a.currentCursor=""}}}},Ye.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 sn(a){var y=xi();for(a=a.iterator;a.next();){var x=a.value;x instanceof $n||y.push(x)}a=new In,x=y.length;for(var E=0;E<x;E++){for(var b=y[E],z=!0,ee=0;ee<x;ee++)if(b.Td(y[ee])){z=!1;break}z&&a.add(b)}return Bi(y),a}Ye.prototype.isValidMember=function(a,y){if(y===null||a===y||y instanceof $n)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},Ye.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 Bn;if(a!==null)E.add(a);else for(var b=y.selection.iterator;b.next();){var z=b.value;z instanceof no&&z.canUngroup()&&E.add(z)}var ee=new Bn;if(0<E.count){y.clearSelection(!0);for(var re=E.iterator;re.next();){var oe=re.value;oe.expandSubGraph();var ue=oe.containingGroup,he=ue!==null&&ue.data!==null?x.wa(ue.data):void 0;ee.addAll(oe.memberParts);for(var pe=ee.iterator;pe.next();){var Se=pe.value;if(Se.isSelected=!0,!(Se instanceof $n)){var Pe=Se.data;Pe!==null?x.mp(Pe,he):Se.containingGroup=ue}}y.remove(oe)}}y.R("SelectionUngrouped",E,ee)}finally{y.eb("Ungroup"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Ye.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 no))return!1;if(a.canUngroup())return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof no&&y.canUngroup())return!0;return!1},Ye.prototype.addTopLevelParts=function(a,y){var x=!0;for(a=sn(a).iterator;a.next();){var E=a.value;E.containingGroup!==null&&(!y||this.isValidMember(null,E)?E.containingGroup=null:x=!1)}return x},Ye.prototype.collapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse SubGraph"),ah(y.animationManager,"Collapse SubGraph");var x=new Bn;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 no&&b.isSubGraphExpanded&&(b.collapseSubGraph(),x.add(b))}y.R("SubGraphCollapsed",x)}finally{y.eb("Collapse SubGraph")}},Ye.prototype.canCollapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return!!(a instanceof no&&a.isSubGraphExpanded);for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof no&&y.isSubGraphExpanded)return!0;return!1},Ye.prototype.expandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand SubGraph"),ah(y.animationManager,"Expand SubGraph");var x=new Bn;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 no&&!b.isSubGraphExpanded&&(b.expandSubGraph(),x.add(b))}y.R("SubGraphExpanded",x)}finally{y.eb("Expand SubGraph")}},Ye.prototype.canExpandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return a instanceof no&&!a.isSubGraphExpanded;for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof no&&!y.isSubGraphExpanded)return!0;return!1},Ye.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 ja&&z.editable})}a!==null&&(y.currentTool=null,x.textBlock=a,y.currentTool=x)}},Ye.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 ja))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 ja&&x.editable}),a!==null))return!0;return!1},Ye.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 Ft?b=a.ga(Kr):y.viewportBounds.ca(E.documentPoint)||(b=y.viewportBounds,b=new Ie(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,wh(x,!1,a)}},Ye.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)},Ye.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 Rt,a===null)return E;for(var z=a.iterator;z.next();)uh(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 $n&&(y=a.fromNode,y===null||E.contains(y)?(y=a.toNode,y===null||E.contains(y)||E.remove(a)):E.remove(a));return E},fn.Object.defineProperties(Ye.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||at("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}}}),Ye.className="CommandHandler",Yg=function(){return new Ye};function Ft(){Er(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new Ie(NaN,NaN).freeze(),this.jd=ua,this.Ab=new pt,this.wh=new pt,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=ns,this.uc=new Gt(NaN,NaN,NaN,NaN).freeze(),this.Ib=new Gt(NaN,NaN,NaN,NaN).freeze(),this.dc=new Gt(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=or,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 jn,kn,ir,hr,Lr,qr,Ao,ho,jo,xa;Ft.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=Un(this.Dh)),this.tb!==null&&(a.tb=this.tb.copy())},Ft.prototype.Vw=function(a){var y=this.Dh;if(jt(y)){for(var x=0;x<y.length;x++)if(y[x]===a)return}else this.Dh=y=[];y.push(a)},Ft.prototype.Af=function(a){a.Zn=null,a.Ng=null,a.v()},Ft.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},Ft.prototype.copy=function(){return this.clone()},be=Ft.prototype,be.qb=function(a){a.classType===$n?a.name.indexOf("Orient")===0?this.segmentOrientation=a:at("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===Ft&&(this.stretch=a)},be.toString=function(){return Ii(this.constructor)+"#"+wr(this)},be.th=function(){this.A!==null&&(this.A.nc=!0)};function co(a){a.A===null?a.A=new Yr:a.A.nc&&(a.A=a.A.copy())}be.Xc=function(){if(this.ba===null){var a=new No;a.Xi=Xr,a.yj=Xr,a.Vi=10,a.wj=10,a.Wi=0,a.xj=0,this.ba=a}},be.cb=function(a,y,x,E,b,z,ee){var re=this.part;if(re!==null&&(re.gk(a,y,x,E,b,z,ee),x===this&&a===oo&&xe(this)&&Ra(this,re,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 Rt),ee=z.undoManager.transactionLevel===0,a.startCondition===hd?ee=!0:a.startCondition===Zd&&(ee=!1),ee?(z=new zs,Wg(a,z),ee=this.jo.get(a),ee!==null&&ee.stop(),this.jo.add(a,z),z.vu=this,z.Nw=a,z.add(this,y,E,b),z.start()):(ah(z.animationManager,"Trigger"),z.animationManager.defaultAnimation.add(this,y,E,b)))),this instanceof Wn&&x===re&&(re.l&16777216)!==0&&re.data!==null))for(x=this.O.s,E=x.length,b=0;b<E;b++)re=x[b],re instanceof Wn&&Nf(re,function(oe){oe.data!==null&&oe.l&16777216&&oe.La(y)})};function Ra(a,y,x){var E=a.ih();if(E!==null)for(var b=a.localBindings.iterator;b.next();){var z=b.value,ee=null;if(z.sourceName!==null){if(ee=Lx(z,E,a),ee===null)continue;z.sp(a,ee,x,null)}else if(z.isToModel){var re=y.diagram;re===null||re.skipsModelSourceBindings||z.sp(a,re.model.modelData,x,E)}else{if(re=E.data,re===null)continue;var oe=y.diagram;oe===null||oe.skipsModelSourceBindings||z.sp(a,re,x,E)}ee===a&&(re=E.ks(z.Ai),re!==null&&z.Mv(re,ee,x))}}be.ks=function(a){return this.bindingId===a?this:null},be.g=function(a,y,x){this.cb(oo,a,this,y,x)},be.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 pt);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),z.pp(b)}};function Es(a,y,x,E){return a.pickable===!1?!1:(E.multiply(a.transform),x?a.Yc(y,E):a.fh(y,E))}be.tx=function(a,y,x){if(this.pickable===!1)return!1;var E=this.naturalBounds;return y=a.Bf(y),x?ui(a.x,a.y,0,0,0,E.height)<=y||ui(a.x,a.y,0,E.height,E.width,E.height)<=y||ui(a.x,a.y,E.width,E.height,E.width,0)<=y||ui(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},be.se=function(){return!0},be.ca=function(a){var y=Ie.alloc();y.assign(a),this.transform.Ga(y);var x=this.actualBounds;if(!x.w())return Ie.free(y),!1;var E=this.diagram;if(E!==null&&E.wq){var b=E.Ql("extraTouchThreshold"),z=E.Ql("extraTouchArea"),ee=z/2,re=this.naturalBounds;E=this.Df()*E.scale;var oe=1/E;if(re.width*E<b&&re.height*E<b)return a=So(x.x-ee*oe,x.y-ee*oe,x.width+z*oe,x.height+z*oe,y.x,y.y),Ie.free(y),a}return b=!1,(this instanceof Yo||this instanceof lo?So(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)),Ie.free(y),b},be.gh=function(a){var y=this.naturalBounds;return So(0,0,y.width,y.height,a.x,a.y)},be.Re=function(a){if(this.angle===0)return this.actualBounds.Re(a);var y=this.naturalBounds;y=Gt.allocAt(0,0,y.width,y.height);var x=this.transform,E=!1,b=Ie.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)))),Ie.free(b),Gt.free(y),E},be.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.naturalBounds,E=!1,b=Ie.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)))),Ie.free(b),E},be.Yc=function(a,y){if(y===void 0&&(y=this.transform,this.angle===0))return a.Yc(this.actualBounds);var x=this.naturalBounds,E=Ie.allocAt(0,0),b=Ie.allocAt(0,x.height),z=Ie.allocAt(x.width,x.height),ee=Ie.allocAt(x.width,0),re=!1;if(a.ca(y.Ga(E))||a.ca(y.Ga(b))||a.ca(y.Ga(z))||a.ca(y.Ga(ee)))re=!0;else{x=Gt.allocAt(0,0,x.width,x.height);var oe=Ie.allocAt(a.x,a.y);x.ca(y.Cd(oe))?re=!0:(oe.h(a.x,a.bottom),x.ca(y.Cd(oe))?re=!0:(oe.h(a.right,a.bottom),x.ca(y.Cd(oe))?re=!0:(oe.h(a.right,a.y),x.ca(y.Cd(oe))&&(re=!0)))),Ie.free(oe),Gt.free(x),!re&&(Re.us(a,E,b)||Re.us(a,b,z)||Re.us(a,z,ee)||Re.us(a,ee,E))&&(re=!0)}return Ie.free(E),Ie.free(b),Ie.free(z),Ie.free(ee),re},be.ga=function(a,y){if(y===void 0&&(y=new Ie),a instanceof Xi){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},be.mi=function(a){a===void 0&&(a=new Gt);var y=this.naturalBounds,x=this.oe,E=Ie.allocAt(0,0).transform(x);return a.h(E.x,E.y,0,0),E.h(y.width,0).transform(x),ko(a,E.x,E.y,0,0),E.h(y.width,y.height).transform(x),ko(a,E.x,E.y,0,0),E.h(0,y.height).transform(x),ko(a,E.x,E.y,0,0),Ie.free(E),a},be.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},be.Df=function(){if(!(this.l&4096))return this.Kk;var a=this.Ca;return this.panel!==null?a*this.panel.Df():a},be.qs=function(a,y){return y===void 0&&(y=new Ie),y.assign(a),this.oe.Cd(y),y},be.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},be.Sj=function(a,y,x,E,b){var z=this.transform,ee=1/(z.m11*z.m22-z.m12*z.m21),re=z.m22*ee,oe=-z.m12*ee,ue=-z.m21*ee,he=z.m11*ee,pe=ee*(z.m21*z.dy-z.m22*z.dx),Se=ee*(z.m12*z.dx-z.m11*z.dy);return this.areaBackground!==null?(z=this.actualBounds,Re.Ff(z.left,z.top,z.right,z.bottom,a,y,x,E,b)):(ee=a*re+y*ue+pe,a=a*oe+y*he+Se,y=x*re+E*ue+pe,x=x*oe+E*he+Se,b.h(0,0),E=this.naturalBounds,x=Re.Ff(0,0,E.width,E.height,ee,a,y,x,b),b.transform(z),x)},Ft.prototype.measure=function(a,y,x,E){if(tt(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 ee=this.kq();z===90||z===270?(a=isFinite(b.height)?b.height+ee:a,y=isFinite(b.width)?b.width+ee:y):(a=isFinite(b.width)?b.width+ee:a,y=isFinite(b.height)?b.height+ee:y),b=x||0,ee=E||0;var re=this instanceof Wn;switch(ul(this,!0)){case kn:ee=b=0,re&&(y=a=1/0);break;case jn:isFinite(a)&&a>x&&(b=a),isFinite(y)&&y>E&&(ee=y);break;case hr:isFinite(a)&&a>x&&(b=a),ee=0,re&&(y=1/0);break;case Lr:isFinite(y)&&y>E&&(ee=y),b=0,re&&(a=1/0)}re=this.maxSize;var oe=this.minSize;b>re.width&&oe.width<re.width&&(b=re.width),ee>re.height&&oe.height<re.height&&(ee=re.height),x=Math.max(b,oe.width),E=Math.max(ee,oe.height),re.width<x&&(x=Math.min(oe.width,x)),re.height<E&&(E=Math.min(oe.height,E)),a=Math.min(re.width,a),y=Math.min(re.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()||at("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),gt(this,!1)}},Ft.prototype.Wl=function(){},Ft.prototype.Dd=function(){return!1},Ft.prototype.arrange=function(a,y,x,E,b){this.Uk();var z=Gt.alloc();z.assign(this.Ib),this.Ib.ka(),xt(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&&ec(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 ja&&(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()||at("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(z,this.Ib),Jt(this,!1),Gt.free(z)},be=Ft.prototype,be.eh=function(){};function nl(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 ee=x.top+x.bottom;switch(x=z.width+y,z=z.height+ee,E+=y,b+=ee,y=ul(a,!0),x===E&&z===b&&(y=kn),y){case kn:(x>E||z>b)&&(gt(a,!0),a.measure(x>E?E:x,z>b?b:z,0,0));break;case jn:gt(a,!0),a.measure(E,b,0,0);break;case hr:gt(a,!0),a.measure(E,z,0,0);break;case Lr:gt(a,!0),a.measure(x,b,0,0)}}}be.Xl=function(a,y){var x=this.part;x!==null&&x.diagram!==null&&(x.selectionObject!==this&&x.resizeObject!==this&&x.rotateObject!==this||Yv(x,!0),this.N(),zr(a,y)||(x.oh(),this.Pn(x)))},be.Pn=function(a){this.portId!==null&&(Yv(a,!0),a instanceof Fi&&H1(a,this))},be.gc=function(a,y){if(!eu(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 Wn&&ec(this),ee=this.Ib;if(z){var re=this.Ib,oe=this.dc,ue=this.areaBackground,he=this.Ma;ue===null&&he===null||a.yc(),ue!==null&&(Qa(this,a,ue,!0,!0,oe,re),ue instanceof $o&&ue.type===Su?(a.beginPath(),a.rect(re.x,re.y,re.width,re.height),a.ng(ue)):a.fillRect(re.x,re.y,re.width,re.height)),he!==null&&(Qa(this,a,he,!0,!1,oe,re),he instanceof $o&&he.type===Su?(a.beginPath(),a.rect(re.x,re.y,re.width,re.height),a.ng(he)):a.fillRect(re.x,re.y,re.width,re.height)),this.hh(a,y)}if(!z&&(z||ee.width!==0&&ee.height!==0&&!isNaN(ee.x)&&!isNaN(ee.y))){z=this.transform,re=this.panel,this.l&4096&&Ds(this),ue=this.part,oe=!1;var pe=0;ue&&y.Gf("drawShadows")&&(oe=ue.isShadowed)&&(he=ue.shadowOffset,pe=Math.max(he.y,he.x)*y.scale*y.Mb),he=this.Dd();var Se;if(!(Se=y.$i||!he)){var Pe=this.naturalBounds;Se=this.wh;var Fe=Se.m11,Ne=Se.m21,Xe=Se.dx,Ve=Se.m12,ht=Se.m22,ft=Se.dy,mt,Ct=mt=0;Se=mt*Fe+Ct*Ne+Xe;var Kt=mt*Ve+Ct*ht+ft;mt=Pe.width+pe,Ct=0;var yi=mt*Fe+Ct*Ne+Xe;mt=mt*Ve+Ct*ht+ft,Ct=Math.min(Se,yi);var tr=Math.min(Kt,mt),Zi=Math.max(Se+0,yi)-Ct,Qn=Math.max(Kt+0,mt)-tr;Se=Ct,Kt=tr,mt=Pe.width+pe,Ct=Pe.height+pe,yi=mt*Fe+Ct*Ne+Xe,mt=mt*Ve+Ct*ht+ft,Ct=Math.min(Se,yi),tr=Math.min(Kt,mt),Zi=Math.max(Se+Zi,yi)-Ct,Qn=Math.max(Kt+Qn,mt)-tr,Se=Ct,Kt=tr,mt=0,Ct=Pe.height+pe,yi=mt*Fe+Ct*Ne+Xe,mt=mt*Ve+Ct*ht+ft,Ct=Math.min(Se,yi),tr=Math.min(Kt,mt),Zi=Math.max(Se+Zi,yi)-Ct,Qn=Math.max(Kt+Qn,mt)-tr,Se=Ct,Kt=tr,pe=y.viewportBounds,Pe=pe.x,Fe=pe.y,Se=!(Se>pe.width+Pe||Pe>Zi+Se||Kt>pe.height+Fe||Fe>Qn+Kt)}if(Se){if(Se=(this.l&256)!==0,a.clipInsteadOfFill&&(Se=!1),this instanceof ja&&(a.font=this.font),Se){if(Kt=re.se()?re.naturalBounds:re.actualBounds,Zi=Math.max(ee.x,Kt.x),Qn=Math.max(ee.y,Kt.y),pe=Math.min(ee.right,Kt.right)-Zi,Pe=Math.min(ee.bottom,Kt.bottom)-Qn,Fe=this.tb,Fe!==null&&(Zi=Fe.x,Qn=Fe.y,pe=Fe.width,Pe=Fe.height),Zi>ee.width+ee.x||ee.x>Kt.width+Kt.x){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}a.save(),a.beginPath(),a.rect(Zi,Qn,pe,Pe),a.clip()}if(he){if(!ue.isVisible()){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}oe&&(Kt=ue.shadowOffset,a.Ev(Kt.x*y.scale*this.scale*y.Mb,Kt.y*y.scale*this.scale*y.Mb,ue.shadowBlur),Gl(a),a.shadowColor=ue.shadowColor)}oe&&this.shadowVisible===!0?Gl(a):oe&&this.shadowVisible===!1&&_s(a),ue=this.naturalBounds,this.areaBackground!==null&&(a.yc(),zl(this,a,ue,ee)),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),oe&&Ms(this,re)&&this.shadowVisible===null&&_s(a),this.Ma!==null&&(a.yc(),ml(this,a,ue,ee)),oe&&(this.Ma!==null||this.areaBackground!==null||Ms(this,re))?(ve(this,!0),this.shadowVisible===null&&_s(a)):ve(this,!1),this.hh(a,y),oe&&this.l&512&&Gl(a),he&&oe&&_s(a),Se&&(a.restore(),a.Vc(this instanceof Wn)),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 Ms(a,y){return y===null?!1:(ec(y)&&(y=y.panel),(y.l&512)!==0||(y.type===Wn.Auto||y.type===Wn.Spot)&&y.Pb()!==a)}be.Dv=function(){};function zl(a,y,x,E){Qa(a,y,a.areaBackground,!0,!0,x,E),a.areaBackground instanceof $o&&a.areaBackground.type===Su?(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 ml(a,y,x,E){var b=a.kq(),z=x.x,ee=x.y,re=x.width+b,oe=x.height+b;Qa(a,y,a.Ma,!0,!1,x,E),a.Ma instanceof $o&&a.Ma.type===Su?(y.beginPath(),y.rect(z-b/2,ee-b/2,re,oe),y.ng(a.Ma)):y.fillRect(z-b/2,ee-b/2,re,oe)}function Us(a,y,x){for(var E=y.O.s,b=E.length,z=-1,ee=0;ee<b;ee++)if(E[ee]===a){z=ee;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===Wn.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 eu(a,y,x){if(!(y instanceof da))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&&Us(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),Gl(y),y.shadowColor=a.shadowColor}a instanceof ja&&(y.font=a.font),y.yd=null;var ee=a.transform;z=a instanceof Wn;var re=a instanceof Wn?ec(a):!1;a.l&4096&&Ds(a);var oe=a.Ib;if(y.rb.ha=[1,0,0,1,0,0],y.o=!1,b&&(y.o=!0,z&&re?(tu(y,1,0,0,1,0,0),a.svg=y.ad):z?(tu(y,ee.m11,ee.m12,ee.m21,ee.m22,ee.dx,ee.dy),a.svg=y.ad):tu(y,1,0,0,1,0,0)),b=a.naturalBounds,a.areaBackground!==null){var ue=ee.copy().Vj();y.rb.ha=[ue.m11,ue.m12,ue.m21,ue.m22,ue.dx,ue.dy],zl(a,y,b,oe),y.rb.ha=[1,0,0,1,0,0],y.yd.gd=y.ad,y.yd.prepend(y.ad)}return z||(y.rb.ha=[ee.m11,ee.m12,ee.m21,ee.m22,ee.dx,ee.dy]),a.background!==null&&(z?(re&&(y.rb.ha=[ee.m11,ee.m12,ee.m21,ee.m22,ee.dx,ee.dy]),ml(a,y,b,oe),re&&(y.rb.ha=[1,0,0,1,0,0])):(y.rb.ha=[ee.m11,ee.m12,ee.m21,ee.m22,ee.dx,ee.dy],ml(a,y,b,oe)),y.yd.Ma=y.ad,y.yd.prepend(y.ad)),ee=y.yd,b=a.part,re=!1,b&&x.Gf("drawShadows")&&(re=b.isShadowed),y.clipInsteadOfFill&&(re=!1),a.Dd()&&re&&Gl(y),re&&a.shadowVisible===!0?Gl(y):re&&a.shadowVisible===!1&&_s(y),b=a.panel,re&&Ms(a,b)&&a.shadowVisible===null&&_s(y),y.Il&&(ue=x.computePixelRatio(),ue="drop-shadow("+y.shadowOffsetX/ue+"px "+y.shadowOffsetY/ue+"px "+y.shadowBlur/ue/2+"px "+y.shadowColor+")",a.background!==null&&ee.Ma.setAttributeNS(null,"filter",ue),a.areaBackground!==null&&ee.gd.setAttributeNS(null,"filter",ue)),re&&(a.Ma!==null||a.areaBackground!==null||Ms(a,b))?(ve(a,!0),a.shadowVisible===null&&_s(y)):ve(a,!1),b=re,a.hh(y,x),z&&y.nh.pop(),y.o&&y.nh.pop(),ee=y.Gv.hs,re=z?a.svg:y.yd,ue=a.svg,!z&&ue!==null&&re!==ue&&ue.parentNode===a.panel.svg?(a.svg.replaceWith(re),a.svg=re,re!==null&&a.$o(y,E,oe,re),ll(y,ue),!0):(a.svg=re,ee!==null&&re===null&&(Xu(y),y.nh.pop()),re===null||(a.$o(y,E,oe,re),y.Il&&(x=x.computePixelRatio(),a.Dv(re,"drop-shadow("+y.shadowOffsetX/x+"px "+y.shadowOffsetY/x+"px "+y.shadowBlur/x/2+"px "+y.shadowColor+")")),b&&a.l&512&&Gl(y),a.Dd()&&_s(y),x=a.Dd()?a.opacity*y.globalAlpha:a.opacity,x!==1&&re.setAttributeNS(null,"opacity",x.toString()),a.filter!==""&&re.setAttributeNS(null,"filter",a.filter),a.Dd()?(y.ti?y.ti.after(re):y.Nj.prepend(re),y.ti=re):E!==null&&Us(a,E,re),ee!==null&&ee(a,re)),!0)}be.$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 ee=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,ee=z.width,x=z.height),z=E.getAttribute("clip-path");var re=null;z!==null&&(re=a.svg.getElementById(z.split("#")[1].slice(0,-1))),re===null?(z="CLIP"+Qo++,re=a.Ud("clipPath",{id:z}),y=a.Ud("rect",{x:y,y:b,width:ee,height:x}),this instanceof Wn&&(b=this.transform.copy().Vj(),y.setAttribute("transform","matrix("+b.m11+", "+b.m12+", "+b.m21+", "+b.m22+", "+b.dx+", "+b.dy+")")),re.appendChild(y),a.svg.appendChild(re),E.setAttributeNS(null,"clip-path","url(#"+z+")")):(a=re.firstElementChild,a.setAttribute("x",y.toString()),a.setAttribute("y",b.toString()),a.setAttribute("width",ee.toString()),a.setAttribute("height",x.toString()))}else E.removeAttributeNS(null,"clip-path"),ll(a,E)};function ll(a,y){y=y.getAttribute("clip-path"),y!==null&&(a=a.svg.getElementById(y.split("#")[1].slice(0,-1)),a!==null&&a.remove())}function Ws(a){if(a.svg!==null){var y=a.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),x=a.svg.ownerDocument;if(y!==null){y=fi(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()}}be.hh=function(){},be.lv=function(){this.Uc=!0},be.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 Wn?ec(this):!1;if(!(this instanceof Wn&&b))if(this instanceof Dl){var z=this.bt;a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy],z!==null&&Js(a,z[0],z[1],z[2],z[3],z[4],z[5],z[6],z[7]),x?y.lastElementChild.setAttributeNS(null,"transform",is(a)):y.setAttributeNS(null,"transform",is(a))}else if(!x||this instanceof Wn)y.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")");else if(this instanceof lo){z=y.getElementsByTagName("path");for(var ee=0;ee<z.length;ee++)z[ee].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):(ee=E.copy().Vj(),a.rb.ha=[ee.m11,ee.m12,ee.m21,ee.m22,ee.dx,ee.dy],zl(this,a,this.naturalBounds,this.actualBounds),a.rb.ha=[1,0,0,1,0,0],y.gd?(ee=y.gd.getAttribute("filter"),ee!==null&&a.ad.setAttribute("filter",ee),y.gd.replaceWith(a.ad)):y.prepend(a.ad),y.gd=a.ad),z&&Ju(a,z)),(this.background!==null||y.Ma!==void 0)&&(z=y.Ma,this.background===null?(Ju(a,y.Ma),y.Ma.remove(),y.Ma=void 0):((b||x&&!(this instanceof Wn))&&(a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy]),ml(this,a,this.naturalBounds,this.actualBounds),y.Ma?(Ju(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&&Ju(a,z)),this.$o(a,this.panel,this.actualBounds,y),!0},be.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 Qa(a,y,x,E,b,z,ee){if(x!==null){var re=1,oe=1;if(typeof x=="string")E?y.fillStyle=x:y.strokeStyle=x;else if(x.type===qd)E?y.fillStyle=x.color:y.strokeStyle=x.color;else{var ue=a.kq();if(re=z.width,oe=z.height,b?(re=ee.width,oe=ee.height):E||(re+=ue,oe+=ue),(z=y instanceof Au)&&x.xe&&(x.type===ap||x.yk===re&&x.ft===oe))var he=x.xe;else{var pe=0,Se=0,Pe=0,Fe=0,Ne=0,Xe=0;if(Xe=Ne=0,b?(Ne=ee.x,Xe=ee.y):E||(Ne-=ue/2,Xe-=ue/2),pe=x.start.x*re+x.start.offsetX,Se=x.start.y*oe+x.start.offsetY,Pe=x.end.x*re+x.end.offsetX,Fe=x.end.y*oe+x.end.offsetY,pe+=Ne,Pe+=Ne,Se+=Xe,Fe+=Xe,x.type===Ed)he=y.createLinearGradient(pe,Se,Pe,Fe);else if(x.type===Su)Xe=isNaN(x.endRadius)?Math.max(re,oe)/2:x.endRadius,isNaN(x.startRadius)?(Ne=0,Xe=Math.max(re,oe)/2):Ne=x.startRadius,he=y.createRadialGradient(pe,Se,Ne,Pe,Fe,Xe);else if(x.type===ap)try{he=y.createPattern(x.pattern,"repeat")}catch(ht){he=null}if(x.type!==ap&&(b=x.colorStops,b!==null))for(b=b.iterator;b.next();)he.addColorStop(b.key,b.value);if(z&&(x.xe=he,he!==null&&(x.yk=re,x.ft=oe),he===null&&x.type===ap&&x.yk!==-1)){x.yk=-1;var Ve=a.diagram;Ve!==null&&x.yk===-1&&br(function(){Ve.redraw()},600)}}E?y.fillStyle=he:y.strokeStyle=he}}}be.rg=function(a){if(a instanceof Wn)e:{if(this!==a&&a!==null)for(var y=this.panel;y!==null;){if(y===a){a=!0;break e}y=y.panel}a=!1}else a=!1;return a},be.Ed=function(){if(!this.visible)return!1;var a=this.panel;return a!==null?a.Ed():!0},be.If=function(){for(var a=this instanceof Wn?this:this.panel;a!==null&&a.isEnabled;)a=a.panel;return a===null};function Ds(a){if(a.l&2048){var y=a.Ab;if(y.reset(),!a.Ib.w()||!a.uc.w()){je(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)}je(a,!1),et(a,!0)}a.l&4096&&(y=a.panel,y===null?(a.wh.set(a.Ab),a.Kk=a.scale,et(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,et(a,!1)))}be.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=Ie.alloc();z.yi(y,x,E,b,Kr),a.rotate(this.Kb,z.x,z.y),Ie.free(z)}},be.v=function(a){if(!tt(this)){a===void 0&&(a=!1),gt(this,!0),Jt(this,!0);var y=this.panel;y===null||a||y.v()}},be.Uj=function(){tt(this)||(gt(this,!0),Jt(this,!0))};function il(a){if(!xt(a)){var y=a.panel;y!==null?y.v():a.Dd()&&(y=a.diagram,y!==null&&(y.De.add(a),a instanceof Fi&&a.Bd(),y.$b())),Jt(a,!0)}}be.Uk=function(){!(this.l&2048)&&(je(this,!0),et(this,!0))},be.Wu=function(){et(this,!0)},be.N=function(){var a=this.part;a!==null&&a.N()};function ul(a,y){var x=a.stretch,E=a.panel;return E!==null&&E.type===Wn.Table?ku(a,E.Fb(a.row),E.Eb(a.column),y):E!==null&&E.type===Wn.Auto&&E.Pb()===a?Fs(a,jn,y):x===qr?E!==null?E.type===Wn.Spot&&E.Pb()===a?Fs(a,jn,y):(x=E.defaultStretch,x===qr?Fs(a,kn,y):Fs(a,x,y)):Fs(a,kn,y):Fs(a,x,y)}function ku(a,y,x,E){var b=a.stretch;if(b!==qr)return Fs(a,b,E);var z=b=null;switch(y.stretch){case Lr:z=!0;break;case jn:z=!0}switch(x.stretch){case hr:b=!0;break;case jn:b=!0}return y=a.panel.defaultStretch,b===null&&(b=y===hr||y===jn),z===null&&(z=y===Lr||y===jn),b===!0&&z===!0?Fs(a,jn,E):b===!0?Fs(a,hr,E):z===!0?Fs(a,Lr,E):Fs(a,kn,E)}function Fs(a,y,x){if(x)return y;if(y===kn||(x=a.desiredSize,x.w()))return kn;if(a=a.angle,!isNaN(x.width))if(a!==90&&a!==270){if(y===hr)return kn;if(y===jn)return Lr}else{if(y===Lr)return kn;if(y===jn)return hr}if(!isNaN(x.height))if(a!==90&&a!==270){if(y===Lr)return kn;if(y===jn)return hr}else{if(y===hr)return kn;if(y===jn)return Lr}return y}function ve(a,y){a.l=y?a.l|512:a.l&-513}function xe(a){return(a.l&1024)!==0}function Be(a,y){a.l=y?a.l|1024:a.l&-1025}function je(a,y){a.l=y?a.l|2048:a.l&-2049}function et(a,y){a.l=y?a.l|4096:a.l&-4097}function tt(a){return(a.l&8192)!==0}function gt(a,y){a.l=y?a.l|8192:a.l&-8193}function xt(a){return(a.l&16384)!==0}function Jt(a,y){a.l=y?a.l|16384:a.l&-16385}be.Gj=function(){this.svg=null},be.wi=function(a){this.Me=a,this.svg!==null&&this.svg.remove()},be.Av=function(){},be.zv=function(a){return this.pa=a,il(this),!0},be.mm=function(a,y){(this.pa.x!==a||this.pa.y!==y)&&(this.pa.h(a,y),this.Uk())},be.kq=function(){return 0};function gn(a){var y=a.part;if(y instanceof Fi&&(a.portId!==null||a===y.port)){var x=y.diagram;x===null||x.undoManager.isUndoingRedoing||H1(y,a)}}function cn(a){var y=a.diagram;y===null||y.undoManager.isUndoingRedoing||(a instanceof Wn?a instanceof Fi?a.Bd():a.qm(a,function(x){gn(x)}):gn(a))}be.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new ds(a,y,x,E):b=a,b.xd=this,a=this.ih(),a!==null&&f1(a)&&at("Cannot add a Binding to a template that has already been copied: "+b),this.localBindings===null&&(this.localBindings=new Bn),this.localBindings.add(b),this},be.set=function(a){return Object.assign(this,a),this},be.Du=function(a){return ln(this,a),this},be.apply=function(a){return a(this),this},be.nm=function(a){return Wd(this,a),this},be.pz=function(){return this.ih()},be.ih=function(){for(var a=this instanceof Wn?this:this.panel;a!==null;){if(a.allBindings!==null)return a;a=a.panel}return null},be.Jv=function(a){return a.xd=this,this.animationTriggers===null&&(this.animationTriggers=new Rt),this.animationTriggers.add(a.propertyName,a),this};function $t(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=Or.I(a);typeof z=="function"?(x=Un(arguments),E=z(x),Qt(E)||at('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):b=xn.go[a]}if(E===null&&(b!=null&&b.constructor||at("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 Vt&&1<x.length){z=E;var ee=x[1];(typeof ee=="string"||ee instanceof HTMLDivElement)&&(Xg(z,ee),b++)}for(;b<x.length;b++)z=x[b],z===void 0?at("Undefined value at argument "+b+" for object being constructed by GraphObject.make: "+E):ln(E,z);return E}function ln(a,y){if(typeof y=="string")if(a instanceof ja)a.text=y;else if(a instanceof lo)a.figure=y;else if(a instanceof Dl)a.source=y;else if(a instanceof Wn)y=Qu.I(y),y!==null&&(a.type=y);else if(a instanceof $o){var x=Li($o,y);x!==null?a.type=x:at("Unknown Brush type as an argument to GraphObject.make: "+y)}else a instanceof ut?(y=Li(ut,y),y!==null&&(a.type=y)):a instanceof mr&&(y=Li(mr,y),y!==null&&(a.type=y));else if(y instanceof Ft)a instanceof Wn||at("A GraphObject can only be added to a Panel, not to: "+a),a.add(y);else if(y instanceof vs){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 vs?$m(E,y):at("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(y instanceof Ot)typeof a.qb=="function"&&a.qb(y);else if(y instanceof Cs)a.type=y;else if(y instanceof ds)a instanceof Ft||a instanceof vs?a.bind(y):at("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(y instanceof xu)a instanceof Ft?a.Jv(y):at("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(y instanceof Zr)a instanceof ut&&a.type===ut.o?a.figures.add(y):at("A PathFigure can only be added to a Path Geometry, not to: "+a);else if(y instanceof mr)a instanceof Zr?a.segments.add(y):at("A PathSegment can only be added to a PathFigure, not to: "+a);else if(y instanceof Va)a instanceof Vt||a instanceof no?a.layout=y:at("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++)ln(a,y[x]);else if(typeof y=="object"&&y!==null)if(a instanceof $o){x=new Ri;for(var b in y)E=parseFloat(b),isNaN(E)?x[b]=y[b]:a.addColorStop(E,y[b]);Wd(a,x)}else if(a instanceof vs){y.row!==void 0?(b=y.row,(b==null||b===1/0||isNaN(b)||0>b)&&at("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)&&at("Must specify non-negative integer column for RowColumnDefinition "+y+", not: "+b),a.isRow=!1,a.index=b),b=new Ri;for(x in y)x!=="row"&&x!=="column"&&(b[x]=y[x]);Wd(a,b)}else Wd(a,y);else at('Unknown initializer "'+y+'" for object being constructed by GraphObject.make: '+a)}function Cn(a,y){Or.add(a,y)}function Ai(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}fn.Object.defineProperties(Ft.prototype,{bindingId:{get:function(){return this.A!==null?this.A.zp:-1},set:function(a){this.bindingId!==a&&(this.A===null&&(this.A=new Yr),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 Yr),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 Yr),this.A.wm=a)}},shadowVisible:{get:function(){return this.A!==null?this.A.Ci:null},set:function(a){var y=this.shadowVisible;y!==a&&(co(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&&(co(this),this.A.Hb=a,this.g("enabledChanged",y,a))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:Sl},set:function(a){var y=this.segmentOrientation;y!==a&&(this.Ua===null&&(this.Ua=new eo),this.Ua.rr=a,this.v(),this.g("segmentOrientation",y,a),a===Sl&&(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 eo),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 eo),this.Ua.o=a,this.v(),this.g("segmentFraction",y,a))}},segmentOffset:{get:function(){return this.Ua!==null?this.Ua.F:qn},set:function(a){var y=this.segmentOffset;y.D(a)||(a=a.J(),this.Ua===null&&(this.Ua=new eo),this.Ua.F=a,this.v(),this.g("segmentOffset",y,a))}},stretch:{get:function(){return this.A!==null?this.A.hg:qr},set:function(a){var y=this.stretch;y!==a&&(co(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&&(co(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)&&Kn(a,"0 <= value <= 1",Ft,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(_f(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(_f(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(),cn(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&&Qd(a,"GraphObject.areaBackground"),a instanceof $o&&a.freeze(),co(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&&Qd(a,"GraphObject.background"),a instanceof $o&&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 pr)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 Ie(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&&at("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,cn(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 lo&&this.qc(),this.g("desiredSize",E,a),xe(this)&&(a=this.part,a!==null&&(Ra(this,a,"width"),Ra(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 Pn(a,this.jd.height).freeze(),this.v(),this instanceof lo&&this.qc(),this.g("desiredSize",y,a),xe(this)&&(a=this.part,a!==null&&Ra(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 Pn(this.jd.width,a).freeze(),this.v(),this instanceof lo&&this.qc(),this.g("desiredSize",y,a),xe(this)&&(a=this.part,a!==null&&Ra(this,a,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:Rr},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(),co(this),this.A.u=a,this.v(),this.g("minSize",y,a))}},maxSize:{get:function(){return this.A!==null?this.A.o:Wo},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(),co(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 $r(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&&Ds(this),this.Ab}},oe:{get:function(){return this.l&4096&&Ds(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(a){this.animationTriggers!==a&&(co(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:kn},set:function(a){this.reshapingBehavior!==a&&(co(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()&&at("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Jb=a=a.J(),il(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&&Kn(a,">= 0",Ft,"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&&Kn(a,">= 1",Ft,"columnSpan"),co(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&&Kn(a,">= 0",Ft,"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&&Kn(a,">= 1",Ft,"rowSpan"),co(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&&(co(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 Fi||at("Cannot set portID on a Link: "+a),y!==null&&x!==null&&$v(x,this),this.Yn=a,a!==null&&x!==null&&(x.Te=!0,U1(x,this)),this.g("portId",y,a)}}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:Xr},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),gn(this))}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:10},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&Kn(a,">= 0",Ft,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),gn(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),gn(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&&Kn(a,">= 0",Ft,"toMaxLinks"),this.Xc(),this.ba.Ur=a,this.g("toMaxLinks",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:Xr},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),gn(this))}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:10},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&Kn(a,">= 0",Ft,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),gn(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),gn(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&&Kn(a,">= 0",Ft,"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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(this),this.A.Ch=a,this.g("contextMenu",y,a))}}}),Ft.prototype.trigger=Ft.prototype.Jv,Ft.prototype.findBindingPanel=Ft.prototype.ih,Ft.prototype.findTemplateBinder=Ft.prototype.pz,Ft.prototype.setProperties=Ft.prototype.nm,Ft.prototype.apply=Ft.prototype.apply,Ft.prototype.attach=Ft.prototype.Du,Ft.prototype.set=Ft.prototype.set,Ft.prototype.isEnabledObject=Ft.prototype.If,Ft.prototype.isVisibleObject=Ft.prototype.Ed,Ft.prototype.isContainedBy=Ft.prototype.rg,Ft.prototype.getNearestIntersectionPoint=Ft.prototype.rs,Ft.prototype.getLocalPoint=Ft.prototype.qs,Ft.prototype.getDocumentScale=Ft.prototype.Df,Ft.prototype.getDocumentAngle=Ft.prototype.li,Ft.prototype.getDocumentBounds=Ft.prototype.mi,Ft.prototype.getDocumentPoint=Ft.prototype.ga,Ft.prototype.intersectsRect=Ft.prototype.Yc,Ft.prototype.containedInRect=Ft.prototype.fh,Ft.prototype.containsRect=Ft.prototype.Re,Ft.prototype.containsPoint=Ft.prototype.ca,Ft.prototype.raiseChanged=Ft.prototype.g,Ft.prototype.raiseChangedEvent=Ft.prototype.cb,Ft.prototype.addCopyProperty=Ft.prototype.Vw;var Or=null;Ft.className="GraphObject",Or=new Rt,Cn("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=$t(Wn,Wn.Auto,{isActionable:!0,enabledChanged:function(x,E){if(x instanceof Wn){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"},$t(lo,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new Xi(0,0,2.76142374915397,2.761423749153969),spot2:new Xi(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 Wn&&(x=E.fb("ButtonBorder"),x instanceof lo)){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 Wn&&(x=E.fb("ButtonBorder"),x instanceof lo&&(x.fill=E._buttonFillNormal,x.stroke=E._buttonStrokeNormal))},y.actionDown=function(x,E){if(E.If()&&E instanceof Wn&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof lo){x=x.diagram;var z=x.skipsUndoManager;x.skipsUndoManager=!0;var ee=E._buttonFillPressed;E._buttonFillOver=b.fill,b.fill=ee,ee=E._buttonStrokePressed,E._buttonStrokeOver=b.stroke,b.stroke=ee,x.skipsUndoManager=z}}},y.actionUp=function(x,E){if(E.If()&&E instanceof Wn&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof lo){var z=x.diagram,ee=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=ee}}},y.actionCancel=function(x,E){if(E.If()&&E instanceof Wn&&E._buttonFillPressed!==null){var b=E.fb("ButtonBorder");if(b instanceof lo){var z=x.diagram,ee=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=ee}}},y.actionMove=function(x,E){if(E.If()&&E instanceof Wn&&E._buttonFillPressed!==null){var b=x.diagram;if(b.firstInput.button===0&&(b.currentTool.standardMouseOver(),a(x,E)&&(x=E.fb("ButtonBorder"),x instanceof lo))){var z=b.skipsUndoManager;b.skipsUndoManager=!0;var ee=E._buttonFillPressed;x.fill!==ee&&(x.fill=ee),ee=E._buttonStrokePressed,x.stroke!==ee&&(x.stroke=ee),b.skipsUndoManager=z}}},y}),Cn("TreeExpanderButton",function(){var a=$t("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},$t(lo,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Wr},new ds("figure","isTreeExpanded",function(y,x){return x=x.panel,y?x._treeExpandedFigure:x._treeCollapsedFigure}).cp()),{visible:!1},new ds("visible","isTreeLeaf",function(y){return!y}).cp());return a.click=function(y,x){if(x=x.part,x instanceof Yo&&(x=x.adornedPart),x instanceof Fi){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}),Cn("SubGraphExpanderButton",function(){var a=$t("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},$t(lo,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Wr},new ds("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 Yo&&(x=x.adornedPart),x instanceof no){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}),Cn("ToolTip",function(){return $t(Yo,Wn.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new Ie(0,3),shadowBlur:5},$t(lo,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new Xi(0,0,4,6),spot2:new Xi(1,1,-4,-4)}))}),Cn("ContextMenu",function(){return $t(Yo,Wn.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new Ie(0,3),shadowBlur:5},new ds("background","",function(a){return a.adornedPart!==null&&a.placeholder!==null?null:"#F5F5F5"}))}),Cn("ContextMenuButton",function(){var a=$t("Button");a.stretch=hr;var y=a.fb("ButtonBorder");return y instanceof lo&&(y.figure="Rectangle",y.strokeWidth=0,y.spot1=new Xi(0,0,2,3),y.spot2=new Xi(1,1,-2,-2)),a}),Cn("PanelExpanderButton",function(a){var y=Ai(a,"COLLAPSIBLE"),x=$t("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},$t(lo,{name:"ButtonIcon",strokeWidth:2},new ds("geometryString","visible",function(E){return E?x._buttonExpandedFigure:x._buttonCollapsedFigure}).cp(y)));return a=x.fb("ButtonBorder"),a instanceof lo&&(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 ee=b.ih();ee===null&&(ee=b.part),ee!==null&&(b=ee.fb(y),b!==null&&(E.handled=!0,z.Ea("Collapse/Expand Panel"),b.visible=!b.visible,z.eb("Collapse/Expand Panel")))}},x}),Cn("CheckBoxButton",function(a){var y=Ai(a);return a=$t("Button",{desiredSize:new Pn(14,14)},$t(lo,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:jn,geometryStretch:ir,visible:!1},y!==""?new ds("visible",y).Kx():[])),a.click=function(x,E){if(E instanceof Wn){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}),Cn("CheckBox",function(a){a=Ai(a),a=$t("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new $r(0,1,0,0)});var y=$t(Wn,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new $r(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}),Ft.None=kn=new Ot(Ft,"None",0),Ft.Default=qr=new Ot(Ft,"Default",0),Ft.Vertical=Lr=new Ot(Ft,"Vertical",4),Ft.Horizontal=hr=new Ot(Ft,"Horizontal",5),Ft.Fill=jn=new Ot(Ft,"Fill",3),Ft.Uniform=ir=new Ot(Ft,"Uniform",1),Ft.UniformToFill=Ao=new Ot(Ft,"UniformToFill",2),Ft.FlipVertical=ho=new Ot(Ft,"FlipVertical",1),Ft.FlipHorizontal=jo=new Ot(Ft,"FlipHorizontal",2),Ft.FlipBoth=xa=new Ot(Ft,"FlipBoth",3),Ft.make=$t,Ft.getBuilders=function(){var a=new Rt,y;for(y in Or)if(y!==y.toLowerCase()){var x=Or.I(y);typeof x=="function"&&a.add(y,x)}return a.freeze(),a},Ft.defineBuilder=Cn,Ft.build=function(a,y,x){for(var E=[],b=2;b<arguments.length;++b)E[b-2]=arguments[b];if(b=Or.I(a),typeof b=="function"&&(E=b([a].concat(E)),E instanceof Ft))return y&&E.set(y),E;at('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')},Ft.takeBuilderArgument=Ai;function Yr(){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=Rr,this.o=Wo,this.hg=qr,this.ob=this.Bi=1,this.Pf=kn,this.Pc=this.Ci=this.gd=null,this.Oc="category"}Yr.prototype.copy=function(){var a=new Yr;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 eo(){this.u=-1/0,this.o=0,this.F=qn,this.rr=Sl,this.j=this.V="None"}eo.prototype.copy=function(){var a=new eo;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},eo.className="LinkElementSettings";function No(){this.yj=this.Xi=or,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}No.prototype.copy=function(){var a=new No;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},No.className="LinkSettings";function Ro(){this.ha=[1,0,0,1,0,0]}Ro.prototype.copy=function(){var a=new Ro;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},Ro.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},Ro.prototype.scale=function(a,y){this.ha[0]*=a,this.ha[1]*=a,this.ha[2]*=y,this.ha[3]*=y},Ro.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,ee=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]=ee,this.translate(-y,-x)}},Ro.className="STransform";function Ho(a){this.type=a,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}Ho.prototype.addColorStop=function(a,y){this.gx.push({offset:a,color:y})},Ho.className="SGradient";function Ca(a,y,x){this.ownerDocument=a=y===void 0?xn.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 da(this,x)}Ca.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},Ca.prototype.Ud=function(a,y,x){if(a=this.ownerDocument.createElementNS(this.cA,a),Qt(y))for(var E in y)a.setAttributeNS(E==="href"?"http://www.w3.org/1999/xlink":"",E,y[E]);return x!==void 0&&(a.textContent=x),a},Ca.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},Ca.prototype.focus=function(){this.Oa.focus()},Ca.prototype.mx=function(){this.ownerDocument=null},fn.Object.defineProperties(Ca.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}}}),Ca.className="SVGSurface";function da(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 Ro,this.j=Xu(this),this.Nj=Xu(this,"gojs-diagram"),this.Hl=this.ti=null;var x=Qo++,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 es(a,y,x,E,b,z,ee){a.Nj===void 0?tu(a,y,x,E,b,z,ee):a.Nj.setAttribute("transform","matrix("+y+", "+x+", "+E+", "+b+", "+z+", "+ee+")")}be=da.prototype,be.arc=function(a,y,x,E,b,z,ee,re){var oe=2*Math.PI,ue=oe-1e-6,he=x*Math.cos(E),pe=x*Math.sin(E),Se=a+he,Pe=y+pe,Fe=z?0:1;E=z?E-b:b-E,(1e-6<Math.abs(ee-Se)||1e-6<Math.abs(re-Pe))&&this.path.push(["L",Se,+Pe]),0>E&&(E=E%oe+oe),E>ue?(this.path.push(["A",x,x,0,1,Fe,a-he,y-pe]),this.path.push(["A",x,x,0,1,Fe,Se,Pe])):1e-6<E&&this.path.push(["A",x,x,0,+(E>=Math.PI),Fe,a+x*Math.cos(b),y+x*Math.sin(b)])},be.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},be.Se=function(a){this.addPath(this.path,this.rb,a||0)},be.bezierCurveTo=function(a,y,x,E,b,z){this.path.push(["C",a,y,x,E,b,z])},be.clearRect=function(){},be.clip=function(){this.Yl.clipPath=!0},be.closePath=function(){this.path.push(["z"])},be.createLinearGradient=function(a,y,x,E){var b=new Ho("linear");return b.x1=a,b.y1=y,b.x2=x,b.y2=E,b},be.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"+Qo++,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(Xd,b)),this.svg.appendChild(a),x[y]=E,"url(#"+E+")"},be.createRadialGradient=function(a,y,x,E,b,z){var ee=new Ho("radial");return ee.x1=a,ee.y1=y,ee.r1=x,ee.x2=E,ee.y2=b,ee.r2=z,ee};function Js(a,y,x,E,b,z,ee,re,oe){E=re/E,b=oe/b,z===0&&ee===0||a.rb.translate(z,ee),E===1&&b===1||a.rb.scale(E,b),y===0&&x===0||a.rb.translate(-y,-x)}be.drawImage=function(a,y,x,E,b,z,ee,re,oe){var ue="";a instanceof HTMLCanvasElement&&(ue=a.toDataURL()),a instanceof HTMLImageElement&&(ue=a.getAttribute("src"));var he=a instanceof HTMLImageElement?a.naturalWidth:a.width;a=a instanceof HTMLImageElement?a.naturalHeight:a.height,E===void 0&&(z=y,ee=x,re=E=he,oe=b=a),E=E||0,b=b||0,re=re||0,oe=oe||0,Js(this,y,x,E,b,z||0,ee||0,re,oe),z={x:0,y:0,width:he||E,height:a||b,href:ue},Re.$(E,re)&&Re.$(b,oe)?ue.toLowerCase().indexOf(".svg")===-1&&ue.toLowerCase().indexOf("data:image/svg")===-1&&(z.preserveAspectRatio="xMidYMid slice"):z.preserveAspectRatio="none",(y!==0||x!==0||E!==he||b!==a)&&(E+=y,b+=x,z["clip-path"]="path('M "+y+","+x+" L "+E+" "+x+" L "+E+" "+b+" L "+y+" "+b+" z')"),Ts(this,Xd,z,this.rb),this.addElement(Xd,z)},be.fill=function(a){a&&(this.Yl["fill-rule"]="evenodd"),vl(this,this.Yl)},be.ng=function(a,y){this.clipInsteadOfFill?this.clip():this.fill(y)},be.fillRect=function(a,y,x,E){a=[a,y,x,E],a={x:a[0],y:a[1],width:a[2],height:a[3]},Ts(this,"fill",a,this.rb),this.addElement("rect",a)},be.ox=function(a,y,x,E){a={x:a,y,width:x,height:E},Ts(this,"fill",a,this.rb),vl(this,a),this.svg.prepend(this.Ud("rect",a))},be.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},Ts(this,"fill",y,this.rb),this.addElement("text",y,a[0])},be.lineTo=function(a,y){this.path.push(["L",a,y])},be.moveTo=function(a,y){this.path.push(["M",a,y])},be.quadraticCurveTo=function(a,y,x,E){this.path.push(["Q",a,y,x,E])},be.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"])},be.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},be.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())},be.setTransform=function(a,y,x,E,b,z){a===1&&y===0&&x===0&&E===1&&b===0&&z===0||tu(this,a,y,x,E,b,z)};function is(a){return a=a.rb.ha,"matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"}be.scale=function(a,y){this.rb.scale(a,y)},be.translate=function(a,y){this.rb.translate(a,y)},be.transform=function(){},be.yc=function(){},be.stroke=function(){Bh(this,this.Yl)},be.jk=function(){this.clipInsteadOfFill||this.stroke()},be.Ud=function(a,y,x){return this.Gv.Ud(a,y,x)},be.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 Ts(a,y,x,E){y==="fill"?vl(a,x):y==="stroke"&&Bh(a,x),E!==null&&(a=E.ha,x.transform="matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")")}function vl(a,y){a.fillStyle instanceof Ho?y.fill=Yu(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 Zl(a,y,x){x=x?"fill":"stroke",a.fillStyle instanceof Ho?y.setAttributeNS(null,"fill",Yu(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 Bh(a,y){if(a.strokeStyle instanceof Ho)y.stroke=Yu(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 Yu(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"+Qo++,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=[],ee=0;ee<y;ee++){var re=b[ee],oe=re.color;re={offset:re.offset,"stop-color":oe},/^rgba\(/.test(oe)&&(oe=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(oe),re["stop-color"]="rgb("+oe[1]+","+oe[2]+","+oe[3]+")",re["stop-opacity"]=oe[4]),z.push(re)}for(z.sort(function(ue,he){return ue.offset>he.offset?1:-1}),b=0;b<y;b++)x.appendChild(a.Ud("stop",z[b]));return a.svg.appendChild(x),"url(#"+E+")"}be.addPath=function(a,y,x){for(var E=[],b=0;b<a.length;b++){var z=Un(a[b]),ee=[z.shift()];if(ee[0]==="A")ee.push(z.shift()+","+z.shift(),z.shift(),z.shift()+","+z.shift(),z.shift()+","+z.shift());else for(;z.length;)ee.push(z.shift()+","+z.shift());E.push(ee.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,Ts(this,"",a,y),this.Hl!==null)if(y=this.Hl,y.nodeName!=="g")for(var re in a)re!=="transform"&&y.setAttributeNS(null,re,a[re]);else{re=y.getElementsByTagName("path");for(var oe in a)oe!=="transform"&&re[x].setAttributeNS(null,oe,a[oe])}else this.addElement("path",a)};function tu(a,y,x,E,b,z,ee){var re=new Ro;re.ha=[y,x,E,b,z,ee],y={},Ts(a,"g",y,re),re=a.addElement("g",y),a.nh.push(re)}function Xu(a,y){var x={};return y&&(x.class=y),y=a.addElement("g",x),a.nh.push(y),y}be.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x};function _s(a){a.Il=!1,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0}function Gl(a){a.Il=!0,a.shadowOffsetX=a.Ar,a.shadowOffsetY=a.Br,a.shadowBlur=a.Vg}be.js=function(a,y){this.Ct=!0,this.Yg=a,this.uj=y},be.fs=function(){this.Ct=!1},be.Vc=function(){},be.Wx=function(){},da.prototype.rotate=function(a){this.rb.rotate(57.2958*a,0,0)},da.prototype.getImageData=function(){return null},da.prototype.measureText=function(){return null};function Ju(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()))}da.prototype.Hs=function(a){a.svg!==null&&a.svg.parentNode===this.Nj&&a.svg.remove()},da.className="SVGContext",Vt.prototype.Cs=function(a){this.pj.contains("SVG")||this.bs("SVG",new Ca(this,xn.document));var y=new Ca(this,xn.document,!0);a===void 0&&(a=new Ri);var x=this;return Rc(this,function(E,b){return E=np(x,E,"SVG",y),E=E!==null?E.svg:null,typeof b=="function"?(b(E),null):E},a)},Vt.prototype.makeSvg=Vt.prototype.Cs,Vt.prototype.av=function(a){return this.Cs(a)},Vt.prototype.makeSVG=Vt.prototype.av;function yl(a,y,x,E){this.ownerDocument=y=y===void 0?xn.document:y,this.hs=null,y=y.createElement("canvas"),y.tabIndex=0,this.Oa=y,this.context=new Au(y,x,E),y.H=a}yl.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},yl.prototype.toDataURL=function(a,y){return this.Oa.toDataURL(a,y)},yl.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},yl.prototype.focus=function(){this.Oa.focus()},yl.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},fn.Object.defineProperties(yl.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}}}),yl.className="CanvasSurface";function Au(a,y,x){this.Z=a.getContext?a.getContext("2d",y):null,this.Z===null&&at("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 pt,this.isTemporary=!!x}be=Au.prototype,be.Wx=function(a){this.Z.imageSmoothingEnabled=a},be.arc=function(a,y,x,E,b,z){this.Z.arc(a,y,x,E,b,z)},be.beginPath=function(){this.Z.beginPath()},be.Se=function(){},be.bezierCurveTo=function(a,y,x,E,b,z){this.Z.bezierCurveTo(a,y,x,E,b,z)},be.clearRect=function(a,y,x,E){this.yc(),this.Z.clearRect(a,y,x,E)},be.clip=function(){this.Z.clip()},be.closePath=function(){this.Z.closePath()},be.createLinearGradient=function(a,y,x,E){return this.Z.createLinearGradient(a,y,x,E)},be.createPattern=function(a,y){return this.Z.createPattern(a,y)},be.createRadialGradient=function(a,y,x,E,b,z){return this.Z.createRadialGradient(a,y,x,E,b,z)},be.drawImage=function(a,y,x,E,b,z,ee,re,oe){E===void 0?this.Z.drawImage(a,y,x):this.Z.drawImage(a,y,x,E,b,z,ee,re,oe)},be.fill=function(a){this.Z.fill(a?"evenodd":"nonzero")},be.fillRect=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},be.ox=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},be.fillText=function(a,y,x){this.Z.fillText(a,y,x)},be.getImageData=function(a,y,x,E){return this.Z.getImageData(a,y,x,E)},be.lineTo=function(a,y){this.Z.lineTo(a,y)},be.measureText=function(a){return this.Z.measureText(a)},be.moveTo=function(a,y){this.Z.moveTo(a,y)},be.quadraticCurveTo=function(a,y,x,E){this.Z.quadraticCurveTo(a,y,x,E)},be.rect=function(a,y,x,E){this.Z.rect(a,y,x,E)},be.restore=function(){this.Z.restore()},be.save=function(){this.yc(),this.Z.save()},Au.prototype.rotate=function(a){this.El.rotate(57.2958*a,0,0)},be=Au.prototype,be.setTransform=function(a,y,x,E,b,z){this.El.setTransform(a,y,x,E,b,z)},be.scale=function(a,y){this.El.scale(a,y)},be.translate=function(a,y){this.El.translate(a,y)},be.stroke=function(){this.Z.stroke()},be.transform=function(a,y,x,E,b,z){if(a!==1||y!==0||x!==0||E!==1||b!==0||z!==0){var ee=this.El,re=ee.m11*a+ee.m21*y;a=ee.m12*a+ee.m22*y,y=ee.m11*x+ee.m21*E,x=ee.m12*x+ee.m22*E,ee.dx=ee.m11*b+ee.m21*z+ee.dx,ee.dy=ee.m12*b+ee.m22*z+ee.dy,ee.m11=re,ee.m12=a,ee.m21=y,ee.m22=x}},be.yc=function(){var a=this.El;this.Z.setTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy)},be.ng=function(a,y){if(a instanceof $o&&a.type===Su){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)},be.jk=function(){this.Hm||this.stroke()},be.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x},be.js=function(a,y){var x=this.Z;x.setLineDash!==void 0&&(x.setLineDash(a),x.lineDashOffset=y)},be.fs=function(){var a=this.Z;a.setLineDash!==void 0&&(a.setLineDash(Jd),a.lineDashOffset=0)},be.Vc=function(a){a&&(this.dt=""),this.ct=this.et=""},be.Hs=function(){},fn.Object.defineProperties(Au.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 Jd=Object.freeze([]);Au.className="CanvasSurfaceContext";function Nu(){this.F=this.o=this.u=this.j=0}Nu.className="ColorNumbers";function $o(a,y){op||(Sg(),op=!0),Er(this),this._isFrozen=!1,a===void 0?(this.na=qd,this.xk="black"):typeof a=="string"?(this.na=qd,this.xk=a):(this.na=a,this.xk="black"),a=this.na,a===Ed?(this.Qd=Zo,this.Lk=nn):this.Lk=a===Su?this.Qd=Kr:this.Qd=Xr,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,y&&Object.assign(this,y)}$o.prototype.copy=function(){var a=new $o;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},be=$o.prototype,be.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},be.ka=function(){return Object.isFrozen(this)&&at("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},be.qb=function(a){a.classType===$o&&(this.type=a)},be.toString=function(){var a="Brush(";if(this.type===qd)a+=this.color;else if(a=this.type===Ed?a+"Linear ":this.type===Su?a+"Radial ":this.type===ap?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+")"},be.addColorStop=function(a,y){return this._isFrozen&&Bt(this),(typeof a!="number"||!isFinite(a)||1<a||0>a)&&Kn(a,"0 <= loc <= 1",$o,"addColorStop:loc"),this.we===null&&(this.we=new Rt),this.we.add(a,y),this.na===qd&&(this.type=Ed),this.xe=null,this},be.Vz=function(a,y){if(this._isFrozen&&Bt(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?sp:y,this.type===qd)Du(this.color),this.color=kh(a,y);else if((this.type===Ed||this.type===Su)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)Du(x.value),this.addColorStop(x.key,kh(a,y));return this};function xg(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?sp:x,Du(a),kh(y,x)}be.Wy=function(a,y){if(this._isFrozen&&Bt(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?sp:y,this.type===qd)Du(this.color),this.color=kh(-a,y);else if((this.type===Ed||this.type===Su)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)Du(x.value),this.addColorStop(x.key,kh(-a,y));return this};function Mh(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?sp:x,Du(a),kh(-y,x)}function Gc(a,y,x){Du(a),a=Na.j;var E=Na.u,b=Na.o,z=Na.F;return Du(y),x===void 0&&(x=.5),"rgba("+Math.round((Na.j-a)*x+a)+", "+Math.round((Na.u-E)*x+E)+", "+Math.round((Na.o-b)*x+b)+", "+Math.round((Na.F-z)*x+z)+")"}be.Gx=function(){if(this.type===qd)return Pd(this.color);if((this.type===Ed||this.type===Su)&&this.colorStops!==null){var a=this.colorStops;if(this.type===Su)return Pd(a.first().value);if(a.get(.5)!==null)return Pd(a.get(.5));if(a.count===2)return a=a.Fa(),Pd(Gc(a[0].value,a[1].value));for(var y=a.iterator,x=-1,E=-1,b=1,z=1;y.next();){var ee=y.key,re=Math.abs(.5-y.key);b>z&&re<b?(x=ee,b=re):z>=b&&re<z&&(E=ee,z=re)}return x>E&&(z=x,x=E,E=z,z=b),b=E-x,Pd(Gc(a.get(x),a.get(E),1-z/b))}return!1};function Pd(a){return a?a instanceof $o?a.Gx():(Du(a),128>(299*Na.j+587*Na.u+114*Na.o)/1e3):!1}function kh(a,y){switch(y){case sp:y=100*rp(Na.j);var x=100*rp(Na.u),E=100*rp(Na.o);return Qs.j=.4124564*y+.3575761*x+.1804375*E,Qs.u=.2126729*y+.7151522*x+.072175*E,Qs.o=.0193339*y+.119192*x+.9503041*E,Qs.F=Na.F,y=kf(Qs.j/$d[0]),x=kf(Qs.u/$d[1]),E=kf(Qs.o/$d[2]),Uh.j=116*x-16,Uh.u=500*(y-x),Uh.o=200*(x-E),Uh.F=Qs.F,Uh.j=Math.min(100,Math.max(0,Uh.j+100*a)),a=(Uh.j+16)/116,y=a-Uh.o/200,Qs.j=$d[0]*Om(Uh.u/500+a),Qs.u=$d[1]*(Uh.j>wg*Af?Math.pow(a,3):Uh.j/wg),Qs.o=$d[2]*Om(y),Qs.F=Uh.F,a=-.969266*Qs.j+1.8760108*Qs.u+.041556*Qs.o,y=.0556434*Qs.j+-.2040259*Qs.u+1.0572252*Qs.o,Na.j=255*Gp((3.2404542*Qs.j+-1.5371385*Qs.u+-.4985314*Qs.o)/100),Na.u=255*Gp(a/100),Na.o=255*Gp(y/100),Na.F=Qs.F,Na.j=Math.round(Na.j),255<Na.j?Na.j=255:0>Na.j&&(Na.j=0),Na.u=Math.round(Na.u),255<Na.u?Na.u=255:0>Na.u&&(Na.u=0),Na.o=Math.round(Na.o),255<Na.o?Na.o=255:0>Na.o&&(Na.o=0),"rgba("+Na.j+", "+Na.u+", "+Na.o+", "+Na.F+")";case i1:return Mf(),rl.o=Math.min(100,Math.max(0,rl.o+100*a)),"hsla("+rl.j+", "+rl.u+"%, "+rl.o+"%, "+rl.F+")";default:at("Unknown color space: "+y)}}function Du(a){op||(Sg(),op=!0);var y=Pg;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,Na.j=a[0],Na.u=a[1],Na.o=a[2],Na.F=a[3]/255):(y.fillStyle="#FFFFFF",y.fillStyle=a,Na.j=0,Na.u=0,Na.o=0,Na.F=1)}}function Mf(){var a=Na.j/255,y=Na.u/255,x=Na.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 ee=a=0;else{switch(E){case a:ee=(y-x)/z%6;break;case y:ee=(x-a)/z+2;break;case x:ee=(a-y)/z+4}ee*=60,0>ee&&(ee+=360),a=z/(1-Math.abs(2*b-1))}rl.j=Math.round(ee),rl.u=Math.round(100*a),rl.o=Math.round(100*b),rl.F=Na.F}function rp(a){return a/=255,.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Gp(a){return .0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}function kf(a){return a>Af?Math.pow(a,1/3):(wg*a+16)/116}function Om(a){var y=a*a*a;return y>Af?y:(116*a-16)/wg}function Qd(a,y){typeof a!="string"&&(a instanceof $o||at("Value for "+y+" must be a color string or a Brush, not "+a))}function Sg(){Pg=Ja?new yl(null,void 0,{willReadFrequently:!0}).context:null}fn.Object.defineProperties($o.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&Bt(this,a),this.na=a,this.start.Mc()&&(a===Ed?this.start=Zo:a===Su&&(this.start=Kr)),this.end.Mc()&&(a===Ed?this.end=nn:a===Su&&(this.end=Kr)),this.xe=null}},color:{get:function(){return this.xk},set:function(a){this._isFrozen&&Bt(this,a),this.xk=a,this.xe=null}},start:{get:function(){return this.Qd},set:function(a){this._isFrozen&&Bt(this,a),this.Qd=a.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(a){this._isFrozen&&Bt(this,a),this.Lk=a.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(a){this._isFrozen&&Bt(this,a),0>a&&Kn(a,">= zero",$o,"startRadius"),this.Gr=a,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(a){this._isFrozen&&Bt(this,a),0>a&&Kn(a,">= zero",$o,"endRadius"),this.Xp=a,this.xe=null}},colorStops:{get:function(){return this.we},set:function(a){this._isFrozen&&Bt(this,a),this.we=a,this.xe=null}},pattern:{get:function(){return this.cr},set:function(a){this._isFrozen&&Bt(this,a),this.cr=a,this.xe=null}}}),$o.prototype.isDark=$o.prototype.Gx,$o.prototype.darkenBy=$o.prototype.Wy,$o.prototype.lightenBy=$o.prototype.Vz,$o.prototype.addColorStop=$o.prototype.addColorStop;var Af=216/24389,wg=24389/27,$d=[95.047,100,108.883],Pg=null,Na=new Nu,rl=new Nu,Qs=new Nu,Uh=new Nu,op=!1;$o.className="Brush";var qd;$o.Solid=qd=new Ot($o,"Solid",0);var Ed;$o.Linear=Ed=new Ot($o,"Linear",1);var Su;$o.Radial=Su=new Ot($o,"Radial",2);var ap;$o.Pattern=ap=new Ot($o,"Pattern",4);var sp;$o.Lab=sp=new Ot($o,"Lab",5);var i1;$o.HSL=i1=new Ot($o,"HSL",6),$o.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},$o.isValidColor=function(a){if(a==="black")return!0;if(a==="")return!1;op||(Sg(),op=!0);var y=Pg;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)},$o.lighten=function(a){return xg(a)},$o.lightenBy=xg,$o.darken=function(a){return Mh(a)},$o.darkenBy=Mh,$o.mix=Gc,$o.isDark=Pd;function Cs(){this.xa="Base"}Cs.prototype.measure=function(){},Cs.prototype.Yz=function(a,y,x,E,b){a.measure(y,x,E,b)},Cs.prototype.arrange=function(){},Cs.prototype.Ly=function(a,y,x,E,b,z){a.arrange(y,x,E,b,z)},Cs.prototype.iA=function(a){a.Uj()},Cs.prototype.gc=function(){},fn.Object.defineProperties(Cs.prototype,{name:{get:function(){return this.xa},set:function(a){this.xa=a}},classType:{get:function(){return Wn}}}),Cs.prototype.remeasureObject=Cs.prototype.iA,Cs.prototype.arrangeElement=Cs.prototype.Ly,Cs.prototype.measureElement=Cs.prototype.Yz,Cs.className="PanelLayout";function Rm(){this.xa="Base"}_t(Rm,Cs),Rm.prototype.measure=function(a,y,x,E,b,z,ee){var re=E.length;a=Cd(a);for(var oe=0;oe<re;oe++){var ue=E[oe];if(ue.visible||ue===a){var he=ue.margin,pe=he.right+he.left;he=he.top+he.bottom,ue.measure(y,x,z,ee);var Se=ue.measuredBounds;pe=Math.max(Se.width+pe,0),he=Math.max(Se.height+he,0),Se=ue.position.x;var Pe=ue.position.y;isFinite(Se)||(Se=0),isFinite(Pe)||(Pe=0),ue instanceof lo&&ue.isGeometryPositioned&&(ue=ue.strokeWidth/2,Se-=ue,Pe-=ue),ko(b,Se,Pe,pe,he)}}},Rm.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],ee=z.measuredBounds,re=z.margin,oe=z.position.x,ue=z.position.y;if(oe=isNaN(oe)?-a:oe-a,ue=isNaN(ue)?-x:ue-x,z instanceof lo&&z.isGeometryPositioned){var he=z.strokeWidth/2;oe-=he,ue-=he}z.visible&&z.arrange(oe+re.left,ue+re.top,ee.width,ee.height)}};function jm(){this.xa="Base"}_t(jm,Cs),jm.prototype.measure=function(a,y,x,E,b,z,ee){var re=E.length;y=xi(),z=Cd(a);for(var oe=0;oe<re;oe++){var ue=E[oe];if(ue.visible||ue===z){var he=ul(ue,!1);if(he!==kn&&he!==hr)y.push(ue);else{ue.measure(1/0,x,0,ee),he=ue.margin,ue=ue.measuredBounds;var pe=Math.max(ue.height+he.top+he.bottom,0);b.width+=Math.max(ue.width+he.right+he.left,0),b.height=Math.max(b.height,pe)}}}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++)oe=y[a],(oe.visible||oe===z)&&(he=oe.margin,re=he.right+he.left,he=he.top+he.bottom,oe.measure(1/0,x,0,ee),oe=oe.measuredBounds,he=Math.max(oe.height+he,0),b.width+=Math.max(oe.width+re,0),b.height=Math.max(b.height,he));Bi(y)},jm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.top,ee=a.isOpposite,re=ee?x.width:b.left,oe=0;oe<E;oe++){var ue=z,he=y[oe];if(he.visible){var pe=he.measuredBounds,Se=he.margin,Pe=Se.top+Se.bottom,Fe=z+b.bottom,Ne=pe.height,Xe=ul(he,!1);(isNaN(he.desiredSize.height)&&Xe===jn||Xe===Lr)&&(Ne=Math.max(x.height-Pe-Fe,0)),Pe=Ne+Pe+Fe,Fe=he.alignment,Fe.Xb()&&(Fe=a.defaultAlignment),Fe.sb()||(Fe=Kr),ee&&(re-=pe.width+Se.left+Se.right),he.arrange(re+Fe.offsetX+Se.left,ue+Fe.offsetY+Se.top+(x.height*Fe.y-Pe*Fe.y),pe.width,Ne),ee||(re+=pe.width+Se.left+Se.right)}}};function zm(){this.xa="Base"}_t(zm,Cs),zm.prototype.measure=function(a,y,x,E,b,z){var ee=E.length;x=xi();for(var re=Cd(a),oe=0;oe<ee;oe++){var ue=E[oe];if(ue.visible||ue===re){var he=ul(ue,!1);if(he!==kn&&he!==Lr)x.push(ue);else{var pe=ue.margin;he=pe.right+pe.left,pe=pe.top+pe.bottom,ue.measure(y,1/0,z,0),ue=ue.measuredBounds,qo(b,Math.max(b.width,Math.max(ue.width+he,0)),b.height+Math.max(ue.height+pe,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++)oe=x[a],(oe.visible||oe===re)&&(ue=oe.margin,ee=ue.right+ue.left,ue=ue.top+ue.bottom,oe.measure(y,1/0,z,0),oe=oe.measuredBounds,ue=Math.max(oe.height+ue,0),b.width=Math.max(b.width,Math.max(oe.width+ee,0)),b.height+=ue);Bi(x)}},zm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.left,ee=a.isOpposite,re=ee?x.height:b.top,oe=0;oe<E;oe++){var ue=z,he=y[oe];if(he.visible){var pe=he.measuredBounds,Se=he.margin,Pe=Se.left+Se.right,Fe=z+b.right,Ne=pe.width,Xe=ul(he,!1);(isNaN(he.desiredSize.width)&&Xe===jn||Xe===hr)&&(Ne=Math.max(x.width-Pe-Fe,0)),Pe=Ne+Pe+Fe,Fe=he.alignment,Fe.Xb()&&(Fe=a.defaultAlignment),Fe.sb()||(Fe=Kr),ee&&(re-=pe.height+Se.bottom+Se.top),he.arrange(ue+Fe.offsetX+Se.left+(x.width*Fe.x-Pe*Fe.x),re+Fe.offsetY+Se.top,Ne,pe.height),ee||(re+=pe.height+Se.bottom+Se.top)}}};function Zm(){this.xa="Base"}_t(Zm,Cs),Zm.prototype.measure=function(a,y,x,E,b,z,ee){var re=E.length,oe=a.Pb(),ue=oe.margin,he=ue.right+ue.left,pe=ue.top+ue.bottom;oe.measure(y,x,z,ee);var Se=oe.measuredBounds;z=Se.width,ee=Se.height;var Pe=Math.max(z+he,0),Fe=Math.max(ee+pe,0),Ne=a.isClipping,Xe=Gt.allocAt(-ue.left,-ue.top,Pe,Fe),Ve=Gt.allocAt(0,0,z,ee);Ev(oe,Ve,!0),z=Ve.width,ee=Ve.height;for(var ht=!0,ft=Cd(a),mt=0;mt<re;mt++){var Ct=E[mt];Se=y;var Kt=x;if(Ct!==oe&&(Ct.visible||Ct===ft)){ue=Ct.margin;var yi=ue.left,tr=ue.top;switch(Pe=ue.right+ue.left,Fe=ue.top+ue.bottom,ue=ul(Ct,!1),ue){case jn:Se=z,Kt=ee,tr=yi=Fe=Pe=0;break;case hr:Se=z,yi=Pe=0;break;case Lr:Kt=ee,tr=Fe=0}Ct.measure(Se,Kt,0,0),Se=Ct.measuredBounds,Pe=Math.max(Se.width+Pe,0),Fe=Math.max(Se.height+Fe,0),ue=Ct.alignment,ue.Xb()&&(ue=a.defaultAlignment),ue.sb()||(ue=Kr);var Zi=Ct.alignmentFocus;if(Zi.Xb()&&(Zi=Kr),Kt=null,Ct instanceof Wn&&Ct.$e!==""&&(Kt=Ct.fb(Ct.$e),Kt===Ct&&(Kt=null)),yi=Ve.x-yi,tr=Ve.y-tr,Kt!==null){for(Ct.arrange(0,0,Se.width,Se.height),Se=Kt.actualBounds,Se=Ie.allocAt(Se.x+(Zi.x*Se.width-Zi.offsetX),Se.y+(Zi.y*Se.height-Zi.offsetY)),Kt=Kt.panel;Kt!==Ct;)Kt.transform.Ga(Se),Kt=Kt.panel;yi+=ue.x*z+ue.offsetX-Se.x,tr+=ue.y*ee+ue.offsetY-Se.y,Ie.free(Se)}else yi+=ue.x*z+ue.offsetX-(Zi.x*Se.width+Zi.offsetX),tr+=ue.y*ee+ue.offsetY-(Zi.y*Se.height+Zi.offsetY);ht?(ht=!1,b.h(yi,tr,Pe,Fe)):ko(b,yi,tr,Pe,Fe)}}switch(ht?b.assign(Xe):Ne?b.Uu(Ve.x,Ve.y,Ve.width,Ve.height):ko(b,Xe.x,Xe.y,Xe.width,Xe.height),Gt.free(Xe),Gt.free(Ve),ue=oe.stretch,ue===qr&&(ue=ul(oe,!1)),ue){case kn:return;case jn:if(!isFinite(y)&&!isFinite(x))return;break;case hr:if(!isFinite(y))return;break;case Lr:if(!isFinite(x))return}for(Se=oe.measuredBounds,z=Se.width,ee=Se.height,Pe=Math.max(z+he,0),Fe=Math.max(ee+pe,0),ue=oe.margin,Ve=Gt.allocAt(-ue.left,-ue.top,Pe,Fe),Ev(oe,Ve,!0),z=Ve.width,ee=Ve.height,y=0;y<re;y++)x=E[y],x===oe||!x.visible&&x!==ft||(ue=x.margin,Pe=ue.right+ue.left,Fe=ue.top+ue.bottom,Se=x.measuredBounds,Pe=Math.max(Se.width+Pe,0),Fe=Math.max(Se.height+Fe,0),he=x.alignment,he.Xb()&&(he=a.defaultAlignment),he.sb()||(he=Kr),x=x.alignmentFocus,x.Xb()&&(x=Kr),ht?(ht=!1,b.h(he.x*z+he.offsetX-(x.x*Se.width+x.offsetX)-ue.left,he.y*ee+he.offsetY-(x.y*Se.height+x.offsetY)-ue.top,Pe,Fe)):ko(b,he.x*z+he.offsetX-(x.x*Se.width+x.offsetX)-ue.left,he.y*ee+he.offsetY-(x.y*Se.height+x.offsetY)-ue.top,Pe,Fe));ht?b.assign(Xe):Ne?b.Uu(Ve.x,Ve.y,Ve.width,Ve.height):ko(b,Xe.x,Xe.y,Xe.width,Xe.height),Gt.free(Ve)},Zm.prototype.arrange=function(a,y,x){var E=y.length,b=a.Pb(),z=b.measuredBounds,ee=z.width,re=z.height,oe=a.padding;z=oe.left,oe=oe.top;var ue=z-x.x,he=oe-x.y;for(b.arrange(ue,he,ee,re),ee=Gt.allocAt(0,0,ee,re),Ev(b,ee,!1),re=0;re<E;re++){var pe=y[re];if(pe!==b){ue=pe.measuredBounds;var Se=ue.width,Pe=ue.height;he=pe.alignment,he.Xb()&&(he=a.defaultAlignment),he.sb()||(he=Kr);var Fe=pe.alignmentFocus;if(Fe.Xb()&&(Fe=Kr),ue=null,pe instanceof Wn&&pe.$e!==""&&(ue=pe.fb(pe.$e),ue===pe&&(ue=null)),ue!==null){var Ne=ue.actualBounds;for(Fe=Ie.allocAt(Ne.x+(Fe.x*Ne.width-Fe.offsetX),Ne.y+(Fe.y*Ne.height-Fe.offsetY)),ue=ue.panel;ue!==pe;)ue.transform.Ga(Fe),ue=ue.panel;ue=he.x*ee.width+he.offsetX-Fe.x,he=he.y*ee.height+he.offsetY-Fe.y,Ie.free(Fe)}else ue=he.x*ee.width+he.offsetX-(Fe.x*Se+Fe.offsetX),he=he.y*ee.height+he.offsetY-(Fe.y*Pe+Fe.offsetY);ue+=ee.x-x.x,he+=ee.y-x.y,pe.visible&&pe.arrange(z+ue,oe+he,Se,Pe)}}Gt.free(ee)};function Ev(a,y,x){var E=null;if(a instanceof Wn&&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 Gm(){this.xa="Base"}_t(Gm,Cs),Gm.prototype.measure=function(a,y,x,E,b,z,ee){var re=E.length,oe=a.Pb(),ue=oe.margin,he=y,pe=x,Se=ue.right+ue.left,Pe=ue.top+ue.bottom;oe.measure(y,x,z,ee),ue=oe.measuredBounds;var Fe=0,Ne=null;oe instanceof lo&&(Ne=oe,Fe=Ne.strokeWidth*Ne.scale);var Xe=Math.max(ue.width+Se,0);ue=Math.max(ue.height+Pe,0);var Ve=Lv(oe),ht=Ve.x*Xe+Ve.offsetX;Ve=Ve.y*ue+Ve.offsetY;var ft=Bv(oe),mt=ft.x*Xe+ft.offsetX;for(ft=ft.y*ue+ft.offsetY,isFinite(y)&&(he=Math.max(Math.abs(ht-mt)-Fe,0)),isFinite(x)&&(pe=Math.max(Math.abs(Ve-ft)-Fe,0)),Fe=Pn.alloc(),Fe.h(0,0),a=Cd(a),ft=0;ft<re;ft++)Ve=E[ft],Ve===oe||!Ve.visible&&Ve!==a||(ue=Ve.margin,Xe=ue.right+ue.left,ht=ue.top+ue.bottom,Ve.measure(he,pe,0,0),ue=Ve.measuredBounds,Xe=Math.max(ue.width+Xe,0),ue=Math.max(ue.height+ht,0),Fe.h(Math.max(Xe,Fe.width),Math.max(ue,Fe.height)));if(re===1)b.width=Xe,b.height=ue,Pn.free(Fe);else{switch(Ve=Lv(oe),ft=Bv(oe),re=E=0,ft.x!==Ve.x&&ft.y!==Ve.y&&(E=Fe.width/Math.abs(ft.x-Ve.x),re=Fe.height/Math.abs(ft.y-Ve.y)),Pn.free(Fe),Fe=0,Ne!==null&&(Fe=Ne.strokeWidth*Ne.scale,Tv(Ne)===ir&&(E=re=Math.max(E,re))),E+=Math.abs(Ve.offsetX)+Math.abs(ft.offsetX)+Fe,re+=Math.abs(Ve.offsetY)+Math.abs(ft.offsetY)+Fe,Ne=oe.stretch,Ne===qr&&(Ne=ul(oe,!1)),Ne){case kn:ee=z=0;break;case jn:isFinite(y)&&(E=y),isFinite(x)&&(re=x);break;case hr:isFinite(y)&&(E=y),ee=0;break;case Lr:z=0,isFinite(x)&&(re=x)}oe.Uj(),oe.measure(E,re,z,ee),b.width=oe.measuredBounds.width+Se,b.height=oe.measuredBounds.height+Pe}},Gm.prototype.arrange=function(a,y){var x=y.length,E=a.Pb(),b=E.measuredBounds,z=Gt.alloc();z.h(0,0,1,1);var ee=E.margin,re=ee.left;ee=ee.top;var oe=a.padding,ue=oe.left;oe=oe.top,E.arrange(ue+re,oe+ee,b.width,b.height);var he=Lv(E),pe=Bv(E),Se=he.y*b.height+he.offsetY,Pe=pe.x*b.width+pe.offsetX;for(pe=pe.y*b.height+pe.offsetY,z.x=he.x*b.width+he.offsetX,z.y=Se,ko(z,Pe,pe,0,0),z.x+=re+ue,z.y+=ee+oe,b=0;b<x;b++)re=y[b],re!==E&&(ue=re.measuredBounds,ee=re.margin,oe=Math.max(ue.width+ee.right+ee.left,0),he=Math.max(ue.height+ee.top+ee.bottom,0),Se=re.alignment,Se.Xb()&&(Se=a.defaultAlignment),Se.sb()||(Se=Kr),oe=z.width*Se.x+Se.offsetX-oe*Se.x+ee.left+z.x,ee=z.height*Se.y+Se.offsetY-he*Se.y+ee.top+z.y,re.visible&&(So(z.x,z.y,z.width,z.height,oe,ee,ue.width,ue.height)?re.arrange(oe,ee,ue.width,ue.height):re.arrange(oe,ee,ue.width,ue.height,new Gt(z.x,z.y,z.width,z.height))));Gt.free(z)};function Wm(){this.xa="Base",this.name="Table"}_t(Wm,Cs),Wm.prototype.measure=function(a,y,x,E,b){for(var z=E.length,ee=xi(),re=xi(),oe=0;oe<z;oe++){var ue=E[oe],he=ue instanceof Wn?ue:null;if(he!==null&&ec(he)&&ue.visible){re.push(he);for(var pe=he.O.s,Se=pe.length,Pe=0;Pe<Se;Pe++){var Fe=pe[Pe];he.type===Wn.TableRow?Fe.row=ue.row:he.type===Wn.TableColumn&&(Fe.column=ue.column),ee.push(Fe)}}else ee.push(ue)}z=ee.length,z===0&&(a.Fb(0),a.Eb(0));for(var Ne=[],Xe=0;Xe<z;Xe++){var Ve=ee[Xe];Ve.visible&&(gt(Ve,!0),Jt(Ve,!0),Ne[Ve.row]||(Ne[Ve.row]=[]),Ne[Ve.row][Ve.column]||(Ne[Ve.row][Ve.column]=[]),Ne[Ve.row][Ve.column].push(Ve))}Bi(ee);var ht=xi(),ft=xi(),mt=xi(),Ct={count:0},Kt={count:0},yi=y,tr=x,Zi=a.rowDefs,Qn=a.colDefs,bn=null;z=Zi.length;for(var to=0;to<z;to++)bn=Zi[to],bn!==void 0&&(bn.actual=0);z=Qn.length;for(var _r=0;_r<z;_r++)bn=Qn[_r],bn!==void 0&&(bn.actual=0);for(var ia=Ne.length,Da=0,ks=0;ks<ia;ks++)Ne[ks]&&(Da=Math.max(Da,Ne[ks].length));var Os=Math.min(a.topIndex,ia-1),hl=Math.min(a.leftIndex,Da-1),As=0;ia=Ne.length;for(var hc=Cd(a),cs=0;cs<ia;cs++)if(Ne[cs]){Da=Ne[cs].length;var gh=a.Fb(cs);gh.actual=0;for(var dl=gh.oc=0;dl<Da;dl++)if(Ne[cs][dl]){var dc=a.Eb(dl);ht[dl]===void 0&&(dc.actual=0,dc.oc=0,ht[dl]=!0);for(var pu=Ne[cs][dl],Ou=pu.length,ru=0;ru<Ou;ru++){var Hl=pu[ru];if(Hl.visible||Hl===hc){var nf=1<Hl.rowSpan||1<Hl.columnSpan;nf&&(cs<Os||dl<hl||ft.push(Hl));var ph=Hl.margin,kp=ph.right+ph.left,ou=ph.top+ph.bottom,cl=ku(Hl,gh,dc,!1),Mm=Hl.desiredSize,Tg=!isNaN(Mm.height),Dh=!isNaN(Mm.width)&&Tg;if(nf||cl===kn||Dh||cs<Os||dl<hl||(Ct[dl]!==void 0||cl!==jn&&cl!==hr||(Ct[dl]=-1,Ct.count++),Kt[cs]!==void 0||cl!==jn&&cl!==Lr||(Kt[cs]=-1,Kt.count++),mt.push(Hl)),Hl.measure(1/0,1/0,0,0),!(cs<Os||dl<hl)){var Vl=Hl.measuredBounds,zf=Math.max(Vl.width+kp,0),au=Math.max(Vl.height+ou,0);if(Hl.rowSpan===1&&(cl===kn||cl===hr)){bn=a.Fb(cs);var rf=bn.Wc();As=Math.max(au-bn.actual,0),As+rf>tr&&(As=Math.max(tr-rf,0));var cv=bn.oa===0;bn.oc=bn.oc+As,bn.actual=bn.oa+As,tr=Math.max(tr-(As+(cv?rf:0)),0)}if(Hl.columnSpan===1&&(cl===kn||cl===Lr)){bn=a.Eb(dl);var km=bn.Wc();As=Math.max(zf-bn.actual,0),As+km>yi&&(As=Math.max(yi-km,0));var Jy=bn.oa===0;bn.oc=bn.oc+As,bn.actual=bn.oa+As,yi=Math.max(yi-(As+(Jy?km:0)),0)}nf&&Hl.Uj()}}}}}Bi(ht);var nd=0,Ld=0;z=a.columnCount;for(var _g=0;_g<z;_g++){var of=Qn[_g];of!==void 0&&(nd+=isNaN(of.Hc)?of.oc:of.Hc,of.oc!==0&&(nd+=of.Wc()))}z=a.rowCount;for(var Ap=0;Ap<z;Ap++){var af=Zi[Ap];af!==void 0&&(Ld+=isNaN(af.Hc)?af.oc:af.Hc,af.oc!==0&&(Ld+=af.Wc()))}yi=Math.max(y-nd,0);var id=tr=Math.max(x-Ld,0),cc=yi;z=mt.length;for(var Kl=0;Kl<z;Kl++){var Th=mt[Kl],fv=a.Fb(Th.row),Bd=a.Eb(Th.column),Np=Th.measuredBounds,mh=Th.margin,Zf=mh.right+mh.left,_h=mh.top+mh.bottom;Ct[Th.column]=Bd.oc===0&&Ct[Th.column]!==void 0?Math.max(Np.width+Zf,Ct[Th.column]):null,Kt[Th.row]=fv.oc===0&&Kt[Th.row]!==void 0?Math.max(Np.height+_h,Kt[Th.row]):null}var Ig=0,Dp=0,ih;for(ih in Kt)ih!=="count"&&(Ig+=Kt[ih]);for(ih in Ct)ih!=="count"&&(Dp+=Ct[ih]);for(var Vs=Pn.alloc(),Am=0;Am<z;Am++){var bl=mt[Am];if(bl.visible||bl===hc){var fs=a.Fb(bl.row),Fl=a.Eb(bl.column),Md=0;isFinite(Fl.width)?Md=Fl.width:(isFinite(yi)&&Ct[bl.column]!==null?Dp===0?Md=Fl.actual+yi:Md=Ct[bl.column]/Dp*cc:Ct[bl.column]!==null?Md=yi:Md=Fl.actual||yi,Md=Math.max(0,Md-Fl.Wc()));var fc=0;switch(isFinite(fs.height)?fc=fs.height:(isFinite(tr)&&Kt[bl.row]!==null?Ig===0?fc=fs.actual+tr:fc=Kt[bl.row]/Ig*id:Kt[bl.row]!==null?fc=tr:fc=fs.actual||tr,fc=Math.max(0,fc-fs.Wc())),Vs.h(Math.max(Fl.minimum,Math.min(Md,Fl.maximum)),Math.max(fs.minimum,Math.min(fc,fs.maximum))),cl=ku(bl,fs,Fl,!1),cl){case hr:Vs.height=Math.max(Vs.height,fs.actual+tr);break;case Lr:Vs.width=Math.max(Vs.width,Fl.actual+yi)}var Gf=bl.margin,Qy=Gf.right+Gf.left,gv=Gf.top+Gf.bottom;bl.Uj(),bl.measure(Vs.width,Vs.height,Fl.minimum,fs.minimum);var Tp=bl.measuredBounds,Wf=Math.max(Tp.width+Qy,0),Og=Math.max(Tp.height+gv,0);isFinite(yi)&&(Wf=Math.min(Wf,Vs.width)),isFinite(tr)&&(Og=Math.min(Og,Vs.height));var Ul=0;Ul=fs.actual,fs.actual=Math.max(fs.actual,Og),fs.oc=Math.max(fs.oc,Og),As=fs.actual-Ul,tr=Math.max(tr-As,0),Kt[bl.row]===null&&(id=Math.max(id-As,0)),Ul=Fl.actual,Fl.actual=Math.max(Fl.actual,Wf),Fl.oc=Math.max(Fl.oc,Wf),As=Fl.actual-Ul,yi=Math.max(yi-As,0),Ct[bl.column]===null&&(cc=Math.max(cc-As,0))}}Bi(mt);var kd=Pn.alloc(),vh=xi(),bu=xi();if(z=ft.length,z!==0){for(var sf=0;sf<ia;sf++)if(Ne[sf]){Da=Ne[sf].length;var _p=a.Fb(sf);vh[sf]=_p.actual;for(var lf=0;lf<Da;lf++)if(Ne[sf][lf]){var pv=a.Eb(lf);bu[lf]=pv.actual}}}for(var Ip=0;Ip<z;Ip++){var ss=ft[Ip];if(ss.visible||ss===hc){var rh=a.Fb(ss.row),Ru=a.Eb(ss.column);switch(Vs.h(Math.max(Ru.minimum,Math.min(y,Ru.maximum)),Math.max(rh.minimum,Math.min(x,rh.maximum))),cl=ku(ss,rh,Ru,!1),cl){case jn:bu[Ru.index]!==0&&(Vs.width=Math.min(Vs.width,bu[Ru.index])),vh[rh.index]!==0&&(Vs.height=Math.min(Vs.height,vh[rh.index]));break;case hr:bu[Ru.index]!==0&&(Vs.width=Math.min(Vs.width,bu[Ru.index]));break;case Lr:vh[rh.index]!==0&&(Vs.height=Math.min(Vs.height,vh[rh.index]))}isFinite(Ru.width)&&(Vs.width=Ru.width),isFinite(rh.height)&&(Vs.height=rh.height),kd.h(0,0);for(var mv=Ru.minimum,su=rh.minimum,gc=1;gc<ss.rowSpan&&!(ss.row+gc>=a.rowCount);gc++)bn=a.Fb(ss.row+gc),As=0,As=cl===jn||cl===Lr?Math.max(bn.minimum,vh[ss.row+gc]===0?bn.maximum:Math.min(vh[ss.row+gc],bn.maximum)):Math.max(bn.minimum,isNaN(bn.Hc)?bn.maximum:Math.min(bn.Hc,bn.maximum)),kd.height+=As,su+=bn.minimum;for(var ju=1;ju<ss.columnSpan&&!(ss.column+ju>=a.columnCount);ju++)bn=a.Eb(ss.column+ju),As=0,As=cl===jn||cl===hr?Math.max(bn.minimum,bu[ss.column+ju]===0?bn.maximum:Math.min(bu[ss.column+ju],bn.maximum)):Math.max(bn.minimum,isNaN(bn.Hc)?bn.maximum:Math.min(bn.Hc,bn.maximum)),kd.width+=As,mv+=bn.minimum;Vs.width+=kd.width,Vs.height+=kd.height;var Op=ss.margin,uf=Op.right+Op.left,Nm=Op.top+Op.bottom;ss.measure(Vs.width,Vs.height,mv,su);for(var Rp=ss.measuredBounds,Ih=Math.max(Rp.width+uf,0),Hf=Math.max(Rp.height+Nm,0),hf=0,jp=0;jp<ss.rowSpan&&!(ss.row+jp>=a.rowCount);jp++)bn=a.Fb(ss.row+jp),hf+=bn.total||0;if(hf<Hf){var pc=Hf-hf,rd=Hf-hf;if(ss.spanAllocation!==null)for(var mc=ss.spanAllocation,Ad=0;Ad<ss.rowSpan&&!(0>=pc)&&!(ss.row+Ad>=a.rowCount);Ad++){bn=a.Fb(ss.row+Ad);var vc=bn.oa||0,Vf=mc(ss,bn,rd);bn.actual=Math.min(bn.maximum,vc+Vf),bn.oa!==vc&&(pc-=bn.oa-vc)}for(;0<pc;){var yh=bn.oa||0;if(isNaN(bn.height)&&bn.maximum>yh&&(bn.actual=Math.min(bn.maximum,yh+pc),bn.oa!==yh&&(pc-=bn.oa-yh)),bn.index===0)break;bn=a.Fb(bn.index-1)}}for(var Rg=0,yc=0;yc<ss.columnSpan&&!(ss.column+yc>=a.columnCount);yc++)bn=a.Eb(ss.column+yc),Rg+=bn.total||0;if(Rg<Ih){var jg=Ih-Rg,$y=Ih-Rg;if(ss.spanAllocation!==null)for(var Nd=ss.spanAllocation,Kf=0;Kf<ss.columnSpan&&!(0>=jg)&&!(ss.column+Kf>=a.columnCount);Kf++){bn=a.Eb(ss.column+Kf);var Dm=bn.oa||0,qy=Nd(ss,bn,$y);bn.actual=Math.min(bn.maximum,Dm+qy),bn.oa!==Dm&&(jg-=bn.oa-Dm)}for(;0<jg;){var vv=bn.oa||0;if(isNaN(bn.width)&&bn.maximum>vv&&(bn.actual=Math.min(bn.maximum,vv+jg),bn.oa!==vv&&(jg-=bn.oa-vv)),bn.index===0)break;bn=a.Eb(bn.index-1)}}}}Bi(ft),Pn.free(kd),Pn.free(Vs),vh!==void 0&&Bi(vh),bu!==void 0&&Bi(bu);var zg=0,Zg=0,yv=a.desiredSize,pS=a.maxSize;cl=ul(a,!0);var Tm=Ld=nd=0,_m=0;z=a.columnCount;for(var xv=0;xv<z;xv++)Qn[xv]!==void 0&&(bn=a.Eb(xv),isFinite(bn.width)?(Tm+=bn.width,Tm+=bn.Wc()):qm(bn)===Kp?(Tm+=bn.oa,Tm+=bn.Wc()):bn.oa!==0&&(nd+=bn.oa,nd+=bn.Wc()));isFinite(yv.width)?zg=Math.min(yv.width,pS.width):zg=cl!==kn&&isFinite(y)?y:nd,zg=Math.max(zg,a.minSize.width),zg=Math.max(zg-Tm,0);for(var QS=nd===0?1:Math.max(zg/nd,1),Sv=0;Sv<z;Sv++)Qn[Sv]!==void 0&&(bn=a.Eb(Sv),isFinite(bn.width)||qm(bn)===Kp||(bn.actual=bn.oa*QS),bn.position=b.width,bn.oa!==0&&(b.width+=bn.oa,b.width+=bn.Wc()));z=a.rowCount;for(var wv=0;wv<z;wv++)Zi[wv]!==void 0&&(bn=a.Fb(wv),isFinite(bn.height)?(_m+=bn.height,_m+=bn.Wc()):qm(bn)===Kp?(_m+=bn.oa,_m+=bn.Wc()):bn.oa!==0&&(Ld+=bn.oa,Ld+=bn.Wc()));isFinite(yv.height)?Zg=Math.min(yv.height,pS.height):Zg=cl!==kn&&isFinite(x)?x:Ld,Zg=Math.max(Zg,a.minSize.height),Zg=Math.max(Zg-_m,0);for(var $S=Ld===0?1:Math.max(Zg/Ld,1),Pv=0;Pv<z;Pv++)Zi[Pv]!==void 0&&(bn=a.Fb(Pv),isFinite(bn.height)||qm(bn)===Kp||(bn.actual=bn.oa*$S),bn.position=b.height,bn.oa!==0&&(b.height+=bn.oa,b.height+=bn.Wc()));z=re.length;for(var e1=0;e1<z;e1++){var Im=re[e1],t1=0,n1=0;Im.type===Wn.TableRow?(t1=b.width,bn=a.Fb(Im.row),n1=bn.actual):(bn=a.Eb(Im.column),t1=bn.actual,n1=b.height),Im.measuredBounds.h(0,0,t1,n1),gt(Im,!1)}Bi(re),a.inRowsCols=Ne},Wm.prototype.arrange=function(a,y,x){var E=y.length,b=a.padding,z=b.left;b=b.top;var ee=a.inRowsCols;if(ee!==null){for(var re,oe,ue=ee.length,he=0,pe=0;pe<ue;pe++)ee[pe]&&(he=Math.max(he,ee[pe].length));oe=a.rowDefs,re=a.colDefs;var Se=pe=0,Pe=Math.min(a.topIndex,ue-1);if(0<oe.length){for(;Pe!==ue&&(oe[Pe]===void 0||oe[Pe].oa===0);)Pe++;Pe=Math.max(Math.min(Pe,ue-1),0),pe=-oe[Pe].position}var Fe=Math.min(a.leftIndex,he-1);if(0<re.length){for(;Fe!==he&&(re[Fe]===void 0||re[Fe].oa===0);)Fe++;Fe=Math.max(Math.min(Fe,he-1),0),Se=-re[Fe].position}for(var Ne=0,Xe=0;Ne!==ue&&oe[Ne]===void 0;)Ne++;for(;Xe!==ue&&re[Xe]===void 0;)Xe++;he=a.part,a.Fb(Ne),a.Eb(Xe);for(var Ve=0;Ve<y.length;Ve++){var ht=y[Ve];if(ht instanceof Wn&&ht.visible&&ec(ht)){if(ht.type===Wn.TableRow){re=a.Fb(ht.row);var ft=a.Eb(Xe)}else re=a.Fb(Ne),ft=a.Eb(ht.column);oe=re.position+pe+b,re.oa!==0&&(oe+=re.Io(Math.max(Ne,Pe))),re=ft.position+Se+z,ft.oa!==0&&(re+=ft.Io(Math.max(Xe,Fe))),ft=ht.measuredBounds,ht.Uk(),ht.actualBounds.ka();var mt=ht.actualBounds,Ct=Gt.allocAt(mt.x,mt.y,mt.width,mt.height);mt.x=ht.type===Wn.TableRow?z:re,mt.y=ht.type===Wn.TableColumn?b:oe,mt.width=ft.width,mt.height=ft.height,ht.actualBounds.freeze(),Jt(ht,!1),zr(Ct,mt)||he===null||(he.oh(),ht.Pn(he)),Gt.free(Ct)}}for(Ve=Pn.alloc(),ht=0;ht<ue;ht++)if(ee[ht]){for(he=ee[ht].length,ft=a.Fb(ht),oe=ft.position+pe+b,ft.oa!==0&&(oe+=ft.Io(Math.max(Ne,Pe))),mt=0;mt<he;mt++)if(ee[ht][mt]){Ct=a.Eb(mt),re=Ct.position+Se+z,Ct.oa!==0&&(re+=Ct.Io(Math.max(Xe,Fe)));for(var Kt=ee[ht][mt],yi=Kt.length,tr=0;tr<yi;tr++){var Zi=Kt[tr],Qn=Zi.measuredBounds;Ve.h(0,0);for(var bn=1;bn<Zi.rowSpan&&!(ht+bn>=a.rowCount);bn++){var to=a.Fb(ht+bn);to.oa!==0&&(Ve.height+=to.total)}for(bn=1;bn<Zi.columnSpan&&!(mt+bn>=a.columnCount);bn++)to=a.Eb(mt+bn),to.oa!==0&&(Ve.width+=to.total);var _r=Ct.oa+Ve.width,ia=ft.oa+Ve.height;bn=re,to=oe;var Da=_r,ks=ia,Os=re,hl=oe,As=_r,hc=ia;re+_r>x.width&&(As=Math.max(x.width-re,0)),oe+ia>x.height&&(hc=Math.max(x.height-oe,0));var cs=Zi.alignment;if(cs.Xb()){cs=a.defaultAlignment,cs.sb()||(cs=Kr);var gh=cs.x,dl=cs.y,dc=cs.offsetX;cs=cs.offsetY;var pu=Ct.alignment,Ou=ft.alignment;pu.sb()&&(gh=pu.x,dc=pu.offsetX),Ou.sb()&&(dl=Ou.y,cs=Ou.offsetY)}else gh=cs.x,dl=cs.y,dc=cs.offsetX,cs=cs.offsetY;(isNaN(gh)||isNaN(dl))&&(dl=gh=.5,cs=dc=0),pu=Qn.width,Ou=Qn.height;var ru=Zi.margin,Hl=ru.left+ru.right,nf=ru.top+ru.bottom,ph=ku(Zi,ft,Ct,!1);!isNaN(Zi.desiredSize.width)||ph!==jn&&ph!==hr||(pu=Math.max(_r-Hl,0)),!isNaN(Zi.desiredSize.height)||ph!==jn&&ph!==Lr||(Ou=Math.max(ia-nf,0)),_r=Zi.maxSize,ia=Zi.minSize,pu=Math.min(_r.width,pu),Ou=Math.min(_r.height,Ou),pu=Math.max(ia.width,pu),Ou=Math.max(ia.height,Ou),_r=Ou+nf,bn+=Da*gh-(pu+Hl)*gh+dc+ru.left,to+=ks*dl-_r*dl+cs+ru.top,Zi.visible&&(So(Os,hl,As,hc,bn,to,Qn.width,Qn.height)?Zi.arrange(bn,to,pu,Ou):Zi.arrange(bn,to,pu,Ou,new Gt(Os,hl,As,hc)))}}}for(Pn.free(Ve),a=0;a<E;a++)x=y[a],z=x instanceof Wn?x:null,z!==null&&ec(z)&&(z=x.actualBounds,x.naturalBounds.ka(),x.naturalBounds.h(0,0,z.width,z.height),x.naturalBounds.freeze())}};function Hm(){this.xa="Base"}_t(Hm,Cs),Hm.prototype.measure=function(){},Hm.prototype.arrange=function(){};function Vm(){this.xa="Base"}_t(Vm,Cs),Vm.prototype.measure=function(){},Vm.prototype.arrange=function(){};function Km(){this.xa="Base"}_t(Km,Cs),Km.prototype.measure=function(a,y,x,E,b,z,ee){1<E.length&&at("Viewbox Panel cannot contain more than one GraphObject."),E=E[0],E.Ca=1,E.Uj(),E.measure(1/0,1/0,z,ee);var re=E.measuredBounds,oe=E.margin,ue=oe.right+oe.left;if(oe=oe.top+oe.bottom,isFinite(y)||isFinite(x)){var he=E.scale,pe=re.width;re=re.height;var Se=Math.max(y-ue,0),Pe=Math.max(x-oe,0),Fe=1;a.viewboxStretch===ir?pe!==0&&re!==0&&(Fe=Math.min(Se/pe,Pe/re)):pe!==0&&re!==0&&(Fe=Math.max(Se/pe,Pe/re)),Fe===0&&(Fe=1e-4),E.Ca*=Fe,he!==E.scale&&(gt(E,!0),E.measure(1/0,1/0,z,ee))}re=E.measuredBounds,b.width=isFinite(y)?y:Math.max(re.width+ue,0),b.height=isFinite(x)?x:Math.max(re.height+oe,0)},Km.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 ee=y.alignment;ee.Xb()&&(ee=a.defaultAlignment),ee.sb()||(ee=Kr),y.arrange(x.width*ee.x-z*ee.x+ee.offsetX,x.height*ee.y-b*ee.y+ee.offsetY,E.width,E.height)};function Wp(){this.xa="Base"}_t(Wp,Cs),Wp.prototype.measure=function(){},Wp.prototype.arrange=function(){},Wp.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,ee=a.actualBounds,re=z.width,oe=z.height,ue=Math.ceil(re/b),he=Math.ceil(oe/E),pe=a.gridOrigin,Se=pe.x;pe=pe.y,y.save(),y.beginPath(),y.rect(0,0,re,oe),y.clip(),y.Se();for(var Pe=[],Fe=a.O.s,Ne=Fe.length,Xe=0;Xe<Ne;Xe++){var Ve=Fe[Xe],ht=[];if(Pe.push(ht),Ve.visible){var ft=Ve.interval;if(!(0>ft)){Ve=bv(Ve.figure);for(var mt=0;mt<Ne;mt++)if(mt!==Xe){var Ct=Fe[mt];Ct.visible&&bv(Ct.figure)===Ve&&(Ct=Ct.interval,Ct>ft&&ht.push(Ct))}}}}for(Fe=a.O.s,Ne=Fe.length,Xe=0;Xe<Ne;Xe++){var Kt=Fe[Xe];if(Kt.visible&&(ht=Kt.interval||1,Ve=Math.abs(ht),!(2>b*Ve*x))){if(ft=Kt.segmentIndex,(!isFinite(ft)||isNaN(ft))&&(ft=0),0>ft&&(ft=Ve-Math.min(-ft,Ve)),ft=Math.round(ft%Ve),Ve=Kt.opacity,mt=1,Ve!==1){if(Ve===0)continue;mt=y.globalAlpha,y.globalAlpha=mt*Ve}Ct=Pe[Xe];var yi=!1,tr=Kt.strokeDashArray;if(tr!==null&&(yi=!0,y.js(tr,Kt.strokeDashOffset)),Kt.figure==="LineV"&&Kt.stroke!==null&&0<Kt.strokeWidth){for(y.lineWidth=Kt.strokeWidth,Qa(a,y,Kt.stroke,!1,!1,z,ee),y.beginPath(),tr=Kt=Math.floor((Se-b)/b);tr<=Kt+ue;tr++){var Zi=tr*b+Se;0<=Zi&&Zi<=re&&Um(tr,ht,ft,Ct)&&(y.moveTo(Zi,0),y.lineTo(Zi,oe))}y.stroke(),y.Se()}else if(Kt.figure==="LineH"&&Kt.stroke!==null&&0<Kt.strokeWidth){for(y.lineWidth=Kt.strokeWidth,Qa(a,y,Kt.stroke,!1,!1,z,ee),y.beginPath(),tr=Kt=Math.floor((pe-E)/E);tr<=Kt+he;tr++)Zi=tr*E+pe,0<=Zi&&Zi<=oe&&Um(tr,ht,ft,Ct)&&(y.moveTo(0,Zi),y.lineTo(re,Zi));y.stroke(),y.Se()}else if(Kt.figure==="BarV"&&Kt.fill!==null)for(Qa(a,y,Kt.fill,!0,!1,z,ee),Kt=Kt.width,isNaN(Kt)&&(Kt=b),Zi=tr=Math.floor((Se-b)/b);Zi<=tr+ue;Zi++){var Qn=Zi*b+Se;0<=Qn+Kt&&Qn<=re&&Um(Zi,ht,ft,Ct)&&y.fillRect(Qn,0,Kt,oe)}else if(Kt.figure==="BarH"&&Kt.fill!==null)for(Qa(a,y,Kt.fill,!0,!1,z,ee),Kt=Kt.height,isNaN(Kt)&&(Kt=E),Zi=tr=Math.floor((pe-E)/E);Zi<=tr+he;Zi++)Qn=Zi*E+pe,0<=Qn+Kt&&Qn<=oe&&Um(Zi,ht,ft,Ct)&&y.fillRect(0,Qn,re,Kt);yi&&y.fs(),Ve!==1&&(y.globalAlpha=mt)}}y.restore(),y.Vc(!1)};function Um(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 Ym(){this.xa="Base"}_t(Ym,Cs),Ym.prototype.measure=function(a,y,x,E,b){var z=E.length;if(a instanceof Yo||a instanceof $n){var ee=null,re=null;if(a instanceof $n&&(ee=a),a instanceof Yo&&(re=a,ee=re.adornedPart,a.j===null&&(a.j=[])),ee instanceof $n){var oe=ee;if(z===0)qo(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var ue=a instanceof Yo?null:ee.path;y=ee.routeBounds,x=a.jg,x.h(0,0,y.width,y.height);var he=oe.points,pe=ee.pointsCount;re!==null?re.Ul(!1):ee!==null&&ee.Ul(!1),re=y.width;var Se=y.height,Pe=a.j;if(Pe.length=0,ue!==null){r1(a,re,Se,ue);var Fe=ue.measuredBounds;x.ed(Fe),Pe.push(Fe)}Fe=pt.alloc();for(var Ne=Ie.alloc(),Xe=Ie.alloc(),Ve=0;Ve<z;Ve++){var ht=E[Ve];if(ht!==ue)if(ht.isPanelMain&&ht instanceof lo){r1(a,re,Se,ht);var ft=ht.measuredBounds;x.ed(ft),Pe.push(ft)}else if(2>pe)ht.measure(1/0,1/0,0,0),ft=ht.measuredBounds,x.ed(ft),Pe.push(ft);else{var mt=ht.segmentIndex,Ct=ht.segmentFraction,Kt=ht.alignmentFocus;Kt.Mc()&&(Kt=Kr);var yi=ht.segmentOrientation,tr=ht.segmentOffset;if(isNaN(mt)){var Zi=oe.ua;ft=xi(),Zi.Qu(Ct,ft);var Qn=Ie.allocAt(ft[0],ft[1]);if(Qn.add(oe.i(0)),Zi.type===ut.j?Qn.offset(-Zi.startX,-Zi.startY):(Zi=Zi.figures.first(),Zi!==null&&Qn.offset(-Zi.startX,-Zi.startY)),Zi=ft[2],yi!==Sl){var bn=oe.computeAngle(ht,yi,Zi);ht.Kb=bn}bn=Qn.x-y.x;var to=Qn.y-y.y;Ie.free(Qn),Bi(ft)}else if(mt<-pe||mt>=pe)ft=Ie.alloc(),oe.vg(),oe.computeMidPoint(ft),Zi=oe.midAngle,yi!==Sl&&(bn=oe.computeAngle(ht,yi,Zi),ht.Kb=bn),bn=ft.x-y.x,to=ft.y-y.y,Ie.free(ft);else{if(bn=0,0<=mt?(to=he.M(mt),ft=mt<pe-1?he.M(mt+1):to):(bn=pe+mt,to=he.M(bn),ft=0<bn?he.M(bn-1):to),to.Xa(ft)){0<=mt?(Zi=0<mt?he.M(mt-1):to,bn=mt<pe-2?he.M(mt+2):ft):(Zi=bn<pe-1?he.M(bn+1):to,bn=1<bn?he.M(bn-2):ft),Qn=Zi.Bf(to);var _r=ft.Bf(bn);Zi=Qn>_r+10?0<=mt?Zi.ab(to):to.ab(Zi):_r>Qn+10?0<=mt?ft.ab(bn):bn.ab(ft):0<=mt?Zi.ab(bn):bn.ab(Zi)}else Zi=0<=mt?to.ab(ft):ft.ab(to);yi!==Sl&&(bn=oe.computeAngle(ht,yi,Zi),ht.Kb=bn),bn=to.x+(ft.x-to.x)*Ct-y.x,to=to.y+(ft.y-to.y)*Ct-y.y}ht.measure(1/0,1/0,0,0),ft=ht.measuredBounds,Qn=ht.naturalBounds;var ia=0;ht instanceof lo&&(ia=ht.strokeWidth),_r=Qn.width+ia;var Da=Qn.height+ia;Fe.reset(),Fe.translate(-ft.x,-ft.y),Fe.scale(ht.scale,ht.scale),Fe.rotate(yi===Sl?ht.angle:Zi,_r/2,Da/2),yi!==nm&&yi!==rm||Fe.rotate(90,_r/2,Da/2),yi!==im&&yi!==om||Fe.rotate(-90,_r/2,Da/2),yi===C0&&(45<Zi&&135>Zi||225<Zi&&315>Zi)&&Fe.rotate(-Zi,_r/2,Da/2),Qn=new Gt(0,0,_r,Da),Ne.xi(Qn,Kt),Fe.Ga(Ne),Kt=-Ne.x+ia/2*ht.scale,ht=-Ne.y+ia/2*ht.scale,Xe.assign(tr),ia=isNaN(tr.x);var ks=isNaN(tr.y);if(ia||ks){_r=_r/2+3,Da=Da/2+3;var Os=45<=Zi&&135>=Zi,hl=225<=Zi&&315>=Zi;yi===Sl&&(Os||hl)?(Xe.x=ks?_r:tr.y,Xe.y=ia?Da:tr.x,Os?0<=mt||isNaN(mt)&&.5>Ct||!ia||(Xe.y=-Da):hl&&((0<=mt||isNaN(mt)&&.5>Ct)&&ia&&(Xe.y=-Da),ks&&(Xe.x=-_r))):(ia&&(Xe.x=0<=mt||isNaN(mt)&&.5>Ct?_r:-_r),ks&&(Xe.y=-Da),Xe.rotate(Zi))}else Xe.rotate(Zi);bn+=Xe.x,to+=Xe.y,Qn.set(ft),Qn.h(bn+Kt,to+ht,ft.width,ft.height),Pe.push(Qn),x.ed(Qn)}}if(ee!==null)for(E=ee.labelNodes;E.next();)E.value.measure(1/0,1/0);a.jg=x,a.position.h(y.x+x.x,y.y+x.y),qo(b,x.width||0,x.height||0),pt.free(Fe),Ie.free(Ne),Ie.free(Xe)}}}},Ym.prototype.arrange=function(a,y){var x=y.length;if(a instanceof Yo||a instanceof $n){var E=a,b=null;a instanceof Yo&&(b=a,E=b.adornedPart);var z=a instanceof Yo?null:E.path,ee=a.j;if(ee.length!==0){var re=0;if(z!==null&&re<ee.length){var oe=ee[re];re++,z.arrange(oe.x-a.jg.x,oe.y-a.jg.y,oe.width,oe.height)}for(oe=0;oe<x;oe++){var ue=y[oe];if(ue!==z&&re<ee.length){var he=ee[re];re++,ue.arrange(he.x-a.jg.x,he.y-a.jg.y,he.width,he.height)}}}if(y=E.points,x=y.count,2<=x&&a instanceof $n)for(z=a.labelNodes;z.next();){var pe=a;ee=z.value,re=ee.segmentIndex,oe=ee.segmentFraction;var Se=ee.alignmentFocus;if(ue=ee.segmentOrientation,he=ee.segmentOffset,isNaN(re)){var Pe=pe.ua,Fe=xi();Pe.Qu(oe,Fe);var Ne=Ie.allocAt(Fe[0],Fe[1]);Ne.add(pe.i(0)),Pe.type===ut.j||(Pe=Pe.figures.first()),Ne.offset(-Pe.startX,-Pe.startY),Pe=Fe[2],ue!==Sl&&(pe=pe.computeAngle(ee,ue,Pe),ee.angle=pe),pe=Ne.x;var Xe=Ne.y;Ie.free(Ne),Bi(Fe)}else if(re<-x||re>=x)Fe=Ie.alloc(),Pe=pe,Xe=Fe,Pe.vg(),Pe.computeMidPoint(Xe),Pe=pe.midAngle,ue!==Sl&&(pe=pe.computeAngle(ee,ue,Pe),ee.angle=pe),pe=Fe.x,Xe=Fe.y,Ie.free(Fe);else{if(Ne=0,0<=re?(Fe=y.s[re],Xe=re<x-1?y.s[re+1]:Fe):(Ne=x+re,Fe=y.s[Ne],Xe=0<Ne?y.s[Ne-1]:Fe),Fe.Xa(Xe)){0<=re?(Pe=0<re?y.s[re-1]:Fe,Ne=re<x-2?y.s[re+2]:Xe):(Pe=Ne<x-1?y.s[Ne+1]:Fe,Ne=1<Ne?y.s[Ne-2]:Xe);var Ve=Pe.Bf(Fe),ht=Xe.Bf(Ne);Pe=Ve>ht+10?0<=re?Pe.ab(Fe):Fe.ab(Pe):ht>Ve+10?0<=re?Xe.ab(Ne):Ne.ab(Xe):0<=re?Pe.ab(Ne):Ne.ab(Pe)}else Pe=0<=re?Fe.ab(Xe):Xe.ab(Fe);ue!==Sl&&(pe=pe.computeAngle(ee,ue,Pe),ee.angle=pe),pe=Fe.x+(Xe.x-Fe.x)*oe,Xe=Fe.y+(Xe.y-Fe.y)*oe}if(Se.ys())ee.location=new Ie(pe,Xe);else{Se.Mc()&&(Se=Kr),Fe=pt.alloc(),Fe.reset(),Fe.scale(ee.scale,ee.scale),Fe.rotate(ee.angle,0,0);var ft=ee.naturalBounds;Ne=Gt.allocAt(0,0,ft.width,ft.height),Ve=Ie.alloc(),Ve.xi(Ne,Se),Fe.Ga(Ve),Se=-Ve.x,ht=-Ve.y;var mt=ft.width,Ct=ft.height;ft=Ie.alloc(),ft.assign(he);var Kt=isNaN(he.x),yi=isNaN(he.y);if(Kt||yi){mt=mt/2+3,Ct=Ct/2+3;var tr=45<=Pe&&135>=Pe,Zi=225<=Pe&&315>=Pe;ue===Sl&&(tr||Zi)?(ft.x=yi?mt:he.y,ft.y=Kt?Ct:he.x,tr?0<=re||isNaN(re)&&.5>oe||!Kt||(ft.y=-Ct):Zi&&((0<=re||isNaN(re)&&.5>oe)&&Kt&&(ft.y=-Ct),yi&&(ft.x=-mt))):(Kt&&(ft.x=0<=re||isNaN(re)&&.5>oe?mt:-mt),yi&&(ft.y=-Ct),ft.rotate(Pe))}else ft.rotate(Pe);pe+=ft.x,Xe+=ft.y,Fe.pp(Ne),Se+=Ne.x,ht+=Ne.y,re=Ie.allocAt(pe+Se,Xe+ht),ee.move(re),Ie.free(re),Ie.free(ft),Ie.free(Ve),Gt.free(Ne),pt.free(Fe)}}b!==null?b.Ul(!1):E.Ul(!1),E=D1(a),a.location.h(a.position.x+E.x,a.position.y+E.y),Ie.free(E)}};function r1(a,y,x,E){if(tt(E)!==!1){var b=E.strokeWidth;b===0&&a instanceof Yo&&a.type===Wn.Link&&a.adornedObject instanceof lo&&(b=a.adornedObject.strokeWidth),b*=E.Ca,a instanceof $n&&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 Yo&&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),gt(E,!1)}}function Hp(){this.xa="Base"}_t(Hp,Cs),Hp.prototype.measure=function(a,y,x,E,b,z,ee){var re=a.Pb();a.graduatedBounds=[];var oe=re.margin,ue=oe.right+oe.left,he=oe.top+oe.bottom;re.measure(y,x,z,ee);var pe=re.measuredBounds,Se=new Gt(-oe.left,-oe.top,Math.max(pe.width+ue,0),Math.max(pe.height+he,0));a.graduatedBounds.push(Se),b.assign(Se);for(var Pe=re.geometry,Fe=re.strokeWidth,Ne=Pe.flattenedSegments,Xe=Pe.flattenedLengths,Ve=Pe.flattenedTotalLength,ht=Ne.length,ft=0,mt=0,Ct=xi(),Kt=0;Kt<ht;Kt++){var yi=Ne[Kt],tr=[];mt=ft=0;for(var Zi=yi.length,Qn=0;Qn<Zi;Qn+=2){var bn=yi[Qn],to=yi[Qn+1];if(Qn!==0){var _r=180*Math.atan2(to-mt,bn-ft)/Math.PI;0>_r&&(_r+=360),tr.push(_r)}ft=bn,mt=to}Ct.push(tr)}if(a.graduatedIntervals===null){for(var ia=[],Da=a.O.s,ks=Da.length,Os=0;Os<ks;Os++){var hl=Da[Os],As=[];if(ia.push(As),hl.visible){var hc=hl.interval;if(!(0>hc)){for(var cs=0;cs<ks;cs++)if(cs!==Os){var gh=Da[cs];if(gh.visible&&hl.constructor===gh.constructor){var dl=gh.interval;dl>hc&&As.push(dl)}}}}}a.graduatedIntervals=ia}var dc=a.graduatedIntervals,pu=a.O.s,Ou=pu.length,ru=0,Hl=0,nf=Ve;a.graduatedMarks=[];for(var ph,kp=0;kp<Ou;kp++){var ou=pu[kp];if(ph=[],ou.visible&&ou!==re){var cl=Math.abs(ou.interval),Mm=a.graduatedTickUnit;if(!(2>Mm*cl*Ve/a.graduatedRange&&ou.graduatedSkip===null)){var Tg=Xe[0][0],Dh=0,Vl=0;Hl=Ve*ou.graduatedStart-1e-4,nf=Ve*ou.graduatedEnd+1e-4;var zf=Mm*cl,au=a.graduatedTickBase;if(au<a.graduatedMin){var rf=(a.graduatedMin-au)/zf;rf=rf%1===0?rf:Math.floor(rf+1),au+=rf*zf}else au>a.graduatedMin+zf&&(au-=Math.floor((au-a.graduatedMin)/zf)*zf);for(var cv=dc[kp],km=au,Jy=1e-6*a.graduatedMax,nd=1;au<=a.graduatedMax+Jy;nd++){e:{for(var Ld=cv.length,_g=0;_g<Ld;_g++){var of=(au-a.graduatedTickBase)%(cv[_g]*a.graduatedTickUnit),Ap=1e-6*a.graduatedTickUnit;if(of<Ap&&of>-Ap){var af=!1;break e}}af=!0}if(af&&(au>a.graduatedMax&&(au=a.graduatedMax),ou.graduatedSkip===null||ou instanceof ja&&!ou.graduatedSkip(au,ou)||ou instanceof lo&&!ou.graduatedSkip(au,ou))&&(ru=(au-a.graduatedMin)*Ve/a.graduatedRange,ru>Ve&&(ru=Ve),Hl<=ru&&ru<=nf)){for(var id=Ct[Dh][Vl],cc=Xe[Dh][Vl];Dh<Xe.length;){for(;ru>Tg&&Vl<Xe[Dh].length-1;)Vl++,id=Ct[Dh][Vl],cc=Xe[Dh][Vl],Tg+=cc;if(ru<=Tg)break;Dh++,Vl=0,id=Ct[Dh][Vl],cc=Xe[Dh][Vl],Tg+=cc}var Kl=Ne[Dh],Th=Kl[2*Vl],fv=Kl[2*Vl+1],Bd=(ru-(Tg-cc))/cc,Np=new Ie(Th+(Kl[2*Vl+2]-Th)*Bd+Fe/2-Pe.bounds.x,fv+(Kl[2*Vl+3]-fv)*Bd+Fe/2-Pe.bounds.y);Np.scale(re.scale,re.scale);e:{var mh=id,Zf=Ct[Dh];if(!(.5005>Bd&&.4995<Bd)){var _h=mh;if(.5>Bd?0<Vl?_h=Zf[Vl-1]:Re.$(Kl[0],Kl[Kl.length-2])&&Re.$(Kl[1],Kl[Kl.length-1])&&(_h=Zf[Zf.length-1]):.5<Bd&&(Vl+1<Zf.length?_h=Zf[Vl+1]:Re.$(Kl[0],Kl[Kl.length-2])&&Re.$(Kl[1],Kl[Kl.length-1])&&(_h=Zf[0])),mh!==_h){var Ig=Math.abs(mh-_h);if(180<Ig&&(mh<_h?mh+=360:_h+=360,Ig=Math.abs(mh-_h)),5e-4>Bd||.9995<Bd){id=(mh+_h)/2%360;break e}if(10>Ig){var Dp=1-Math.abs(.5-Bd);id=(mh*Dp+_h*(1-Dp))%360;break e}}}id=mh}if(ou instanceof ja){var ih="";ou.graduatedFunction!==null?(ih=ou.graduatedFunction(au,ou),ih=ih!=null?ih.toString():""):ih=(+au.toFixed(2)).toString(),ih!==""&&ph.push({$l:Np,angle:id,text:ih})}else ph.push({$l:Np,angle:id})}au=km+nd*zf}}}a.graduatedMarks.push(ph)}Bi(Ct);var Vs=a.graduatedMarks;if(Vs!==null)for(var Am=E.length,bl=0;bl<Am;bl++){var fs=E[bl],Fl=Vs[bl];if(fs.visible&&fs!==re&&Fl.length!==0){if(fs instanceof lo){var Md=a,fc=b,Gf=fs.alignmentFocus;Gf.Mc()&&(Gf=Zo);var Qy=fs.angle;fs.Kb=0,fs.measure(1/0,1/0,0,0),fs.Kb=Qy;var gv=fs.measuredBounds,Tp=gv.width,Wf=gv.height,Og=Gt.allocAt(0,0,Tp,Wf),Ul=Ie.alloc();Ul.xi(Og,Gf),Gt.free(Og);for(var kd=-Ul.x,vh=-Ul.y,bu=new Gt,sf=Fl.length,_p=0;_p<sf;_p++)for(var lf=Fl[_p],pv=lf.$l.x,Ip=lf.$l.y,ss=lf.angle,rh=0;4>rh;rh++){switch(rh){case 0:Ul.h(kd,vh);break;case 1:Ul.h(kd+Tp,vh);break;case 2:Ul.h(kd,vh+Wf);break;case 3:Ul.h(kd+Tp,vh+Wf)}Ul.rotate(ss+fs.angle),Ul.offset(pv,Ip),_p===0&&rh===0?bu.h(Ul.x,Ul.y,0,0):bu.Ye(Ul),Ul.offset(-pv,-Ip),Ul.rotate(-ss-fs.angle)}Ie.free(Ul),Md.graduatedBounds!==null&&Md.graduatedBounds.push(bu),ko(fc,bu.x,bu.y,bu.width,bu.height)}else if(fs instanceof ja){var Ru=a,mv=b;Ru.temporaryTextBlock===null&&(Ru.temporaryTextBlock=new ja);var su=Ru.temporaryTextBlock;x1(su,fs);var gc=fs.alignmentFocus;gc.Mc()&&(gc=Zo);for(var ju=fs.segmentOrientation,Op=fs.segmentOffset,uf=new Gt,Nm=0,Rp=0,Ih=0,Hf=0,hf=0,jp=Fl.length,pc=0;pc<jp;pc++){var rd=Fl[pc];Nm=rd.$l.x,Rp=rd.$l.y,Ih=rd.angle,hf=Hf=fs.angle,ju!==Sl&&(hf=ju===tm||ju===E0?Ih+fs.angle:Ih,Hf=$n.computeAngle(ju,hf)),su.Kb=Hf,su.text=rd.text||"",su.measure(1/0,1/0,0,0);var mc=su.measuredBounds,Ad=su.naturalBounds,vc=Ad.width,Vf=Ad.height,yh=pt.alloc();yh.reset(),yh.translate(-mc.x,-mc.y),yh.scale(su.scale,su.scale),yh.rotate(hf,vc/2,Vf/2),ju!==nm&&ju!==rm||yh.rotate(90,vc/2,Vf/2),ju!==im&&ju!==om||yh.rotate(-90,vc/2,Vf/2),ju===C0&&(45<Ih&&135>Ih||225<Ih&&315>Ih)&&yh.rotate(-Ih,vc/2,Vf/2);var Rg=Gt.allocAt(0,0,vc,Vf),yc=Ie.alloc();yc.xi(Rg,gc),yh.Ga(yc);var jg=-yc.x,$y=-yc.y,Nd=Ie.alloc();Nd.assign(Op),isNaN(Nd.x)&&(Nd.x=vc/2+3),isNaN(Nd.y)&&(Nd.y=-(Vf/2+3)),Nd.rotate(Ih),Nm+=Nd.x+jg,Rp+=Nd.y+$y;var Kf=new Gt(Nm,Rp,mc.width,mc.height),Dm=new Gt(mc.x,mc.y,mc.width,mc.height),qy=new Gt(Ad.x,Ad.y,Ad.width,Ad.height);rd.Sz=Hf,rd.lineCount=su.lineCount,rd.lines=[su.Cb,su.Ih,su.df,su.Le,su.Qc,su.Qb,su.ze],rd.actualBounds=Kf,rd.measuredBounds=Dm,rd.naturalBounds=qy,pc===0?uf.assign(Kf):uf.ed(Kf),Ie.free(Nd),Ie.free(yc),Gt.free(Rg),pt.free(yh)}Ru.graduatedBounds!==null&&Ru.graduatedBounds.push(uf),ko(mv,uf.x,uf.y,uf.width,uf.height)}gt(fs,!1)}}},Hp.prototype.arrange=function(a,y,x){if(a.graduatedBounds!==null){var E=a.Pb(),b=a.graduatedMarks;if(b!==null){var z=a.graduatedBounds,ee=0,re=z[ee];ee++,E!==null&&E.arrange(re.x-x.x,re.y-x.y,re.width,re.height);for(var oe=y.length,ue=0;ue<oe;ue++){var he=y[ue];re=b[ue],he.visible&&he!==E&&re.length!==0&&(re=z[ee],ee++,he.arrange(re.x-x.x,re.y-x.y,re.width,re.height))}a.graduatedBounds=null}}},Hp.prototype.gc=function(a,y,x){var E=x.$i;x.$i=!0;var b=a.naturalBounds,z=b.width,ee=b.height;b=y instanceof da,y.save(),y.beginPath(),y.rect(-1,-1,z+1,ee+1),y.clip(),y.Se(),z=a.Pb(),z.gc(y,x),ee=a.Df()*x.scale,0>=ee&&(ee=1);for(var re=z.actualBounds,oe=a.O.s,ue=a.graduatedMarks,he=oe.length,pe=0;pe<he;pe++){var Se=oe[pe],Pe=ue[pe],Fe=Pe.length;if(Se.visible&&Se!==z&&Pe.length!==0){if(Se instanceof lo){if(!(2>a.graduatedTickUnit*Se.interval*z.geometry.flattenedTotalLength/a.graduatedRange*ee&&Se.graduatedSkip===null)){var Ne=Se.measuredBounds,Xe=Se.strokeWidth*Se.scale,Ve=Se.alignmentFocus;Ve.Mc()&&(Ve=Zo);for(var ht=0;ht<Fe;ht++){var ft=Pe[ht].$l,mt=Pe[ht].angle,Ct=Ve,Kt=Se.Ab;Kt.reset(),Kt.translate(ft.x+re.x,ft.y+re.y),Kt.rotate(mt+Se.angle,0,0),Kt.translate(-Ne.width*Ct.x+Ct.offsetX+Xe/2,-Ne.height*Ct.y+Ct.offsetY+Xe/2),Kt.scale(Se.scale,Se.scale),je(Se,!1),Se.wh.set(Se.Ab),Se.Kk=Se.scale,et(Se,!1),Se.gc(y,x),b&&(a.svg.appendChild(Se.svg),Se.svg=null),Se.Ab.reset()}}}else if(Se instanceof ja)for(a.temporaryTextBlock===null&&(a.temporaryTextBlock=new ja),Ne=a.temporaryTextBlock,x1(Ne,Se),Xe=0;Xe<Fe;Xe++)Ve=Pe[Xe],Ve.actualBounds&&Ve.measuredBounds&&Ve.naturalBounds&&(Ne.ec=Ve.text||"",Ne.Kb=Ve.Sz||0,Ne.Gc=Ve.lineCount||0,ht=Ve.lines,ht!==void 0&&(Ne.Cb=ht[0],Ne.Ih=ht[1],Ne.df=ht[2],Ne.Le=ht[3],Ne.Qc=ht[4],Ne.Qb=ht[5],Ne.ze=ht[6]),Ve.naturalBounds&&(Ne.dc=Ve.naturalBounds),Ve.actualBounds&&(ht=Ve.actualBounds,Ne.arrange(ht.x,ht.y,ht.width,ht.height)),ht=Ve.actualBounds,Ne.arrange(ht.x,ht.y,ht.width,ht.height),ft=Ve.measuredBounds,Ve=Ve.naturalBounds,mt=Ne.Ab,mt.reset(),mt.translate(ht.x+re.x,ht.y+re.y),mt.translate(-ft.x,-ft.y),Ne.no(mt,Ve.x,Ve.y,Ve.width,Ve.height),je(Ne,!1),Ne.wh.set(Ne.Ab),Ne.Kk=Ne.scale,et(Ne,!1),Ne.Ng=Se.part,Ne.Me=Se.panel,Ne.gc(y,x),Ne.Me=null,Ne.Ng=null,b&&(a.svg.appendChild(Ne.svg),Ne.svg=null))}}x.$i=E,y.restore(),y.Vc(!0)};function Wn(a,y){if(Ft.call(this),this.na=null,a===void 0)this.na=Wn.Position;else if(typeof a=="string"){var x=Qu.I(a);x!==null&&(this.na=x)}else a instanceof Cs?this.na=a:a&&(this.na=Wn.Position,y=a);this.na===null&&at("Panel type not specified or PanelLayout not loaded: "+a),this.l=this.l|4194304|(this.na===Wn.Grid?1048576:0),this.O=new Bn,this.yb=ns,this.Tm=or,this.Uf=qr,this.$g=null,this.$e="",this.jg=new Gt(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=ir,this.jn=Vo,this.kn=qn,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,y&&Object.assign(this,y)}_t(Wn,Ft),Wn.prototype.cloneProtected=function(a){Ft.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},Wn.prototype.Af=function(a){Ft.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},Wn.prototype.copy=function(){var a=Ft.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,ee=z.count;if(z.Gb(ee,b),z=a.part,z!==null){z.Rh=null,b.portId!==null&&z instanceof Fi&&(z.Te=!0);var re=a.diagram;re!==null&&re.undoManager.isUndoingRedoing||z.cb(Go,"elements",a,null,b,null,ee)}}return a}return null},be=Wn.prototype,be.toString=function(){return"Panel("+this.type.name+")#"+wr(this)},be.Pn=function(a){Ft.prototype.Pn.call(this,a);for(var y=this.O.s,x=y.length,E=0;E<x;E++)y[E].Pn(a)},be.hh=function(a,y){if(this.na===Wn.Grid)a.yc(),this.na.gc(this,a,y);else if(this.na===Wn.Graduated)a.yc(),this.na.gc(this,a,y);else{if(this.na===Wn.Table)if(a.yc(),a instanceof da){var x=a.yd;a.yd=Xu(a,"gojs-ts"),Cv(this,a),a.nh.pop(),a.yd=x}else Cv(this,a);(x=this.isClipping&&this.na===Wn.Spot)&&a.save();for(var E=this.Pb(),b=this.O.s,z=b.length,ee=0;ee<z;ee++){var re=b[ee];x&&re===E&&(a.clipInsteadOfFill=!0),re.gc(a,y),x&&re===E&&(a.clipInsteadOfFill=!1)}x&&(a.restore(),a.Vc(!0))}};function Cv(a,y){y.lineCap="butt";var x=0<a.rowCount?a.rowDefs:null,E=0<a.columnCount?a.colDefs:null;x!==null&&Xm(a,y,!0,x,!0),E!==null&&Xm(a,y,!1,E,!0),x!==null&&o1(a,y,!0,x),E!==null&&o1(a,y,!1,E),x!==null&&Xm(a,y,!0,x,!1),E!==null&&Xm(a,y,!1,E,!1)}function o1(a,y,x,E){for(var b=E.length,z=a.actualBounds,ee=a.naturalBounds,re=!0,oe=0;oe<b;oe++){var ue=E[oe];if(ue!==void 0&&ue.actual!==0)if(re)re=!1;else{if(x){if(ue.position>ee.height)continue}else if(ue.position>ee.width)continue;var he=ue.separatorStrokeWidth;isNaN(he)&&(he=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var pe=ue.separatorStroke;if(pe===null&&(pe=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),he!==0&&pe!==null){Qa(a,y,pe,!1,!1,ee,z),pe=!1;var Se=ue.separatorDashArray;Se===null&&(Se=x?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray),Se!==null&&(pe=!0,y.js(Se,0)),y.beginPath(),Se=ue.position+he,x?Se>ee.height&&(he-=Se-ee.height):Se>ee.width&&(he-=Se-ee.width),ue=ue.position+he/2,y.lineWidth=he,he=a.yb,x?(ue+=he.top,Se=ee.width-he.right,y.moveTo(he.left,ue),y.lineTo(Se,ue)):(ue+=he.left,Se=ee.height-he.bottom,y.moveTo(ue,he.top),y.lineTo(ue,Se)),y.stroke(),y.Se(),pe&&y.fs()}}}}function Xm(a,y,x,E,b){for(var z=E.length,ee=a.actualBounds,re=a.naturalBounds,oe=a1(a,!0),ue=a1(a,!1),he=0;he<z;he++){var pe=E[he];if(pe!==void 0&&pe.background!==null&&pe.coversSeparators!==b&&pe.actual!==0){var Se=x?ee.height:ee.width;if(!(pe.position>Se)){var Pe=pe.Wc(),Fe=pe.separatorStrokeWidth;isNaN(Fe)&&(Fe=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var Ne=pe.separatorStroke;Ne===null&&(Ne=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),(Ne===null||pe.index===(x?oe:ue))&&(Fe=0),Pe-=Fe,Fe=pe.position+Fe,Pe+=pe.actual,Fe+Pe>Se&&(Pe=Se-Fe),0>=Pe||(Se=a.yb,Qa(a,y,pe.background,!0,!1,re,ee),x?y.fillRect(Se.left,Fe+Se.top,ee.width-(Se.left+Se.right),Pe):y.fillRect(Fe+Se.left,Se.top,Pe,ee.height-(Se.top+Se.bottom)))}}}}function a1(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 bv(a){return a==="LineV"||a==="BarV"}be.lv=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].lv();this.Uc=!0},be.kk=function(a,y,x){if(!Ft.prototype.kk.call(this,a,y,x))return!1;if(this.type===Wn.Table)x=this.svg.getElementsByClassName("gojs-ts"),x=x.length!==0?x[0]:null,x!==null&&(x.innerHTML=""),a.yd=x,Cv(this,a),a.yd=null;else if(this.na===Wn.Grid||this.na===Wn.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},be.nk=function(){return!0},be.$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,ee=0;ee<y.length;ee++)if(y[ee].Ed()){var re=y[ee].actualBounds;b=ee===0?re.x:Math.min(re.x,b),z=ee===0?re.y:Math.min(re.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 Ft.prototype.$o.call(this,a,y,x,E)},be.Sj=function(a,y,x,E,b){var z=this.se(),ee=this.transform,re=1/(ee.m11*ee.m22-ee.m12*ee.m21),oe=ee.m22*re,ue=-ee.m12*re,he=-ee.m21*re,pe=ee.m11*re,Se=re*(ee.m21*ee.dy-ee.m22*ee.dx),Pe=re*(ee.m12*ee.dx-ee.m11*ee.dy);if(this.areaBackground!==null)return ee=this.actualBounds,Re.Ff(ee.left,ee.top,ee.right,ee.bottom,a,y,x,E,b);if(this.background!==null)return z=a*oe+y*he+Se,re=a*ue+y*pe+Pe,a=x*oe+E*he+Se,oe=x*ue+E*pe+Pe,b.h(0,0),x=this.naturalBounds,z=Re.Ff(0,0,x.width,x.height,z,re,a,oe,b),b.transform(ee),z;z||(oe=1,he=ue=0,pe=1,Pe=Se=0),re=a*oe+y*he+Se,a=a*ue+y*pe+Pe,oe=x*oe+E*he+Se,x=x*ue+E*pe+Pe,b.h(oe,x),E=(oe-re)*(oe-re)+(x-a)*(x-a),ue=!1,pe=this.O.s,Pe=pe.length,he=Ie.alloc(),Se=null,y=1/0;var Fe=null,Ne=this.isClipping&&this.na===Wn.Spot;Ne&&(Fe=Ie.alloc(),Se=this.Pb(),(ue=Se.Sj(re,a,oe,x,Fe))&&(y=(re-Fe.x)*(re-Fe.x)+(a-Fe.y)*(a-Fe.y)));for(var Xe=0;Xe<Pe;Xe++){var Ve=pe[Xe];Ve.visible&&Ve!==Se&&Ve.Sj(re,a,oe,x,he)&&(ue=!0,Ve=(re-he.x)*(re-he.x)+(a-he.y)*(a-he.y),Ve<E&&(E=Ve,b.set(he)))}return Ne&&(y>E&&b.set(Fe),Ie.free(Fe)),Ie.free(he),z&&b.transform(ee),ue},be.Gj=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Gj();Ft.prototype.Gj.call(this)},be.v=function(a){if(!tt(this)){Ft.prototype.v.call(this,a),a=null,(this.na===Wn.Auto||this.na===Wn.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=ul(b,!1);(b instanceof xl||b instanceof Wn||b instanceof ja||z!==kn)&&b.v(!0)}}}},be.Uj=function(){if(!tt(this)){gt(this,!0),Jt(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Uj()}},be.Uk=function(){if(!(this.l&2048)){je(this,!0),et(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()}},be.Wu=function(){et(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()},be.Wl=function(a,y,x,E){var b=this.jg;b.h(0,0,0,0);var z=this.desiredSize,ee=this.minSize;x===void 0&&(x=ee.width,E=ee.height),x=Math.max(x,ee.width),E=Math.max(E,ee.height);var re=this.maxSize;isNaN(z.width)||(a=Math.min(z.width,re.width)),isNaN(z.height)||(y=Math.min(z.height,re.height)),a=Math.max(x,a),y=Math.max(E,y);var oe=this.yb;a=Math.max(a-oe.left-oe.right,0),y=Math.max(y-oe.top-oe.bottom,0);var ue=this.O.s;ue.length!==0&&this.na.measure(this,a,y,ue,b,x,E),a=b.width+oe.left+oe.right,oe=b.height+oe.top+oe.bottom,isFinite(z.width)&&(a=z.width),isFinite(z.height)&&(oe=z.height),a=Math.min(re.width,a),oe=Math.min(re.height,oe),a=Math.max(ee.width,a),oe=Math.max(ee.height,oe),a=Math.max(x,a),oe=Math.max(E,oe),qo(b,a,oe),qo(this.naturalBounds,a,oe),this.Ge(0,0,a,oe)},be.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 Cd(a){return a.part!==null?a.part.locationObject:null}be.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=ul(this,!0);var z=this.measuredBounds;y=z.width,z=z.height;var ee=this.Kg,re=ee.left+ee.right;switch(ee=ee.top+ee.bottom,y===x&&z===E&&(a=kn),a){case kn:(y>x||z>E)&&(this.v(),this.measure(y>x?x:y,z>E?E:z,0,0));break;case jn:this.v(!0),this.measure(x+re,E+ee,0,0);break;case hr:this.v(!0),this.measure(x+re,z+ee,0,0);break;case Lr:this.v(!0),this.measure(y+re,E+ee,0,0)}}this.na.arrange(this,b,this.jg)}},be.gh=function(a){var y=this.naturalBounds,x=Cd(this);if(So(0,0,y.width,y.height,a.x,a.y)){y=this.O.s;for(var E=y.length,b=Ie.allocAt(0,0);E--;){var z=y[E];if((z.visible||z===x)&&(ti(b.set(a),z.transform),z.ca(b)))return Ie.free(b),!0}return Ie.free(b),!(this.Ma===null&&this.areaBackground===null)}return!1},be.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},be.qm=function(a,y){if(y(this,a),a instanceof Wn){a=a.O.s;for(var x=a.length,E=0;E<x;E++)this.qm(a[E],y)}};function Nf(a,y){s1(a,a,y)}function s1(a,y,x){x(y),y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=y[b];z instanceof Wn&&s1(a,z,x)}}function vS(a,y){l1(a,a,y)}function l1(a,y,x){if(x(y),y instanceof Wn){y=y.O.s;for(var E=y.length,b=0;b<E;b++)l1(a,y[b],x)}}be.Nl=function(a){return u1(this,this,a)};function u1(a,y,x){if(x(y))return y;if(y instanceof Wn){y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=u1(a,y[b],x);if(z!==null)return z}}return null}be.fb=function(a){if(this.name===a)return this;var y=this.O.s,x=y.length;this.Hh===null&&this.itemTemplateMap===null||(x=Vp(this));for(var E=0;E<x;E++){var b=y[E];if(b instanceof Wn){var z=b.fb(a);if(z!==null)return z}if(b.name===a)return b}return null};function h1(a){a=a.O.s;for(var y=a.length,x=0,E=0;E<y;E++){var b=a[E];b instanceof Wn?x=Math.max(x,h1(b)):b instanceof lo&&(x=Math.max(x,b.ig/2*b.strokeMiterLimit*b.Df()))}return x}be.se=function(){return!(this.type===Wn.TableRow||this.type===Wn.TableColumn)};function ec(a){return a.type===Wn.TableRow||a.type===Wn.TableColumn}be.ic=function(a,y,x){if(this.pickable===!1||(y===void 0&&(y=null),x===void 0&&(x=null),xt(this)))return null;var E=this.naturalBounds,b=1/this.Df(),z=this.se(),ee=z?a:ti(Ie.allocAt(a.x,a.y),this.transform),re=this.diagram,oe=10,ue=5;if(re!==null&&(oe=re.Ql("extraTouchArea"),ue=oe/2),So(-(ue*b),-(ue*b),E.width+oe*b,E.height+oe*b,ee.x,ee.y)){if(!this.isAtomic){b=this.O.s;var he=b.length;if(re=Ie.alloc(),ue=(oe=this.isClipping&&this.na===Wn.Spot)?this.Pb():null,oe&&(ue.se()?ti(re.set(a),ue.transform):re.set(a),!ue.ca(re)))return Ie.free(re),z||Ie.free(ee),null;for(var pe=Cd(this);he--;){var Se=b[he];if((Se.visible||Se===pe)&&(Se.se()?ti(re.set(a),Se.transform):re.set(a),!oe||Se!==ue)){var Pe=null;if(Se instanceof Wn?Pe=Se.ic(re,y,x):Se.pickable===!0&&Se.ca(re)&&(Pe=Se),Pe!==null&&(y!==null&&(Pe=y(Pe)),Pe!==null&&(x===null||x(Pe))))return Ie.free(re),z||Ie.free(ee),Pe}}Ie.free(re)}return this.background===null&&this.areaBackground===null?(z||Ie.free(ee),null):(a=So(0,0,E.width,E.height,ee.x,ee.y)?this:null,z||Ie.free(ee),a)}return z||Ie.free(ee),null},be.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(),ee=z?a:ti(Ie.allocAt(a.x,a.y),this.transform);if(b=So(0,0,b.width,b.height,ee.x,ee.y),ec(this)||b){if(!this.isAtomic){for(var re=this.O.s,oe=re.length,ue=Ie.alloc(),he=Cd(this);oe--;){var pe=re[oe];if(pe.visible||pe===he){pe.se()?ti(ue.set(a),pe.transform):ue.set(a);var Se=pe;pe=pe instanceof Wn?pe:null,(pe!==null?pe.ji(ue,y,x,E):Se.ca(ue))&&Se.pickable!==!1&&(y!==null&&(Se=y(Se)),Se===null||x!==null&&!x(Se)||E.add(Se))}}Ie.free(ue)}return z||Ie.free(ee),b&&(this.background!==null||this.areaBackground!==null)}return z||Ie.free(ee),!1},be.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 ee=z;if(z===void 0&&(ee=pt.alloc(),ee.reset()),ee.multiply(this.transform),this.fh(a,ee))return Fv(this,y,x,b),z===void 0&&pt.free(ee),!0;if(this.Yc(a,ee)){if(!this.isAtomic)for(var re=Cd(this),oe=this.O.s,ue=oe.length;ue--;){var he=oe[ue];if(he.visible||he===re){var pe=he.actualBounds,Se=this.naturalBounds;pe.x>Se.width||pe.y>Se.height||0>pe.x+pe.width||0>pe.y+pe.height||(pe=he,he=he instanceof Wn?he:null,Se=pt.alloc(),Se.set(ee),(he!==null?he.Cf(a,y,x,E,b,Se):Es(pe,a,E,Se))&&(y!==null&&(pe=y(pe)),pe===null||x!==null&&!x(pe)||b.add(pe)),pt.free(Se))}}return z===void 0&&pt.free(ee),E}return z===void 0&&pt.free(ee),!1};function Fv(a,y,x,E){for(var b=a.O.s,z=b.length;z--;){var ee=b[z];if(ee.visible){var re=ee.actualBounds,oe=a.naturalBounds;re.x>oe.width||re.y>oe.height||0>re.x+re.width||0>re.y+re.height||(ee instanceof Wn&&Fv(ee,y,x,E),y!==null&&(ee=y(ee)),ee===null||x!==null&&!x(ee)||E.add(ee))}}}be.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 ee=this.naturalBounds,re=this.se(),oe=re?a:ti(Ie.allocAt(a.x,a.y),this.transform),ue=re?y:ti(Ie.allocAt(y.x,y.y),this.transform),he=oe.Bf(ue),pe=0<oe.x&&oe.x<ee.width&&0<oe.y&&oe.y<ee.height||ui(oe.x,oe.y,0,0,0,ee.height)<=he||ui(oe.x,oe.y,0,ee.height,ee.width,ee.height)<=he||ui(oe.x,oe.y,ee.width,ee.height,ee.width,0)<=he||ui(oe.x,oe.y,ee.width,0,0,0)<=he;if(ee=oe.zd(0,0)<=he&&oe.zd(0,ee.height)<=he&&oe.zd(ee.width,0)<=he&&oe.zd(ee.width,ee.height)<=he,re||(Ie.free(oe),Ie.free(ue)),pe){if(!this.isAtomic){oe=Ie.alloc(),ue=Ie.alloc(),he=Cd(this);for(var Se=this.O.s,Pe=Se.length;Pe--;){var Fe=Se[Pe];if(Fe.visible||Fe===he){var Ne=Fe.actualBounds,Xe=this.naturalBounds;(!re||!(Ne.x>Xe.width||Ne.y>Xe.height||0>Ne.x+Ne.width||0>Ne.y+Ne.height))&&(Fe.se()?(Ne=Fe.transform,ti(oe.set(a),Ne),ti(ue.set(y),Ne)):(oe.set(a),ue.set(y)),Ne=Fe,Fe=Fe instanceof Wn?Fe:null,(Fe!==null?Fe.og(oe,ue,x,E,b,z):Ne.tx(oe,ue,b))&&(x!==null&&(Ne=x(Ne)),Ne===null||E!==null&&!E(Ne)||z.add(Ne)))}}Ie.free(oe),Ie.free(ue)}return b?pe:ee}return!1};function Lv(a){var y=null;return a instanceof lo&&(y=a.spot1,y===or&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot1)),y===null&&(y=Co),y}function Bv(a){var y=null;return a instanceof lo&&(y=a.spot2,y===or&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot2)),y===null&&(y=Ht),y}be.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},be.M=function(a){return this.O.M(a)},be.Gb=function(a,y){y instanceof pr&&at("Cannot add a Part to a Panel: "+y+"; use a Panel instead"),(this===y||this.rg(y))&&(this===y&&at("Cannot make a Panel contain itself: "+this.toString()),at("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+y.toString()));var x=y.panel;if(x!==null&&x!==this&&at("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!==Wn.Grid||y instanceof lo||at("Can only add Shapes to a Grid Panel, not: "+y),this.na!==Wn.Graduated||y instanceof lo||y instanceof ja||at("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 Rt),this.ge.add(E,y))}var b=this.O;if(E=-1,x===this){for(var z=-1,ee=this.O.s,re=ee.length,oe=0;oe<re;oe++)if(ee[oe]===y){z=oe;break}if(z!==-1){if(z===a||z+1>=b.count&&a>=b.count)return;b.mb(z),E=z}else at("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),tt(this)||this.v(),y.v(!1),y.portId!==null?this.Te=!0:y instanceof Wn&&y.Te===!0&&(this.Te=!0),this.graduatedIntervals=null,this.If()||Qm(this,y,!1),x=this.part,x!==null&&(x.Rh=null,x.ag=NaN,this.Te&&x instanceof Fi&&(x.Te=!0),x.Te&&x instanceof Fi&&(x.wc=null),b=this.diagram,b!==null&&b.undoManager.isUndoingRedoing||(E!==-1&&x.cb(ha,"elements",this,y,null,E,null),x.cb(Go,"elements",this,null,y,null,a)))};function Mv(a,y){a.l=y?a.l|16777216:a.l&-16777217}be.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)},be.mb=function(a){0<=a&&this.pc(a,!0)},be.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),gt(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 Fi&&(E instanceof Wn?E.qm(E,function(ee,re){$v(z,re,y)}):$v(z,E,y)),x=this.diagram,x!==null&&x.undoManager.isUndoingRedoing||z.cb(ha,"elements",this,E,null,a,null))},be.Fb=function(a){0>a&&Kn(a,">= 0",Wn,"getRowDefinition:idx"),a=Math.round(a);var y=this.rowDefs;if(y[a]===void 0){var x=new vs;x.wi(this),x.isRow=!0,x.index=a,y[a]=x,this.cb(Go,"rowdefs",this,null,x,null,a)}return y[a]},be.oA=function(a){if(0>a&&Kn(a,">= 0",Wn,"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(ha,"rowdefs",this,x,null,a,null),this.v()}}};function d1(a,y,x){var E=a.rowDefs;if(!(0>y)){if(E[y]=x instanceof vs?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}be.Eb=function(a){0>a&&Kn(a,">= 0",Wn,"getColumnDefinition:idx"),a=Math.round(a);var y=this.colDefs;if(y[a]===void 0){var x=new vs;x.wi(this),x.isRow=!1,x.index=a,y[a]=x,this.cb(Go,"coldefs",this,null,x,null,a)}return y[a]},be.jA=function(a){if(0>a&&Kn(a,">= 0",Wn,"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(ha,"coldefs",this,x,null,a,null),this.v()}}};function c1(a,y,x){var E=a.colDefs;if(!(0>y)){if(E[y]=x instanceof vs?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}be.Gy=function(a){var y=null;return a.isRow?y=this.Fb(a.index):a.isRow||(y=this.Eb(a.index)),y&&$m(y,a),this},be.Hy=function(a,y){return(a=this.Fb(a))&&$m(a,new vs(y)),this},be.By=function(a,y){return(a=this.Eb(a))&&$m(a,new vs(y)),this},be.nz=function(a){if(0>a||this.type!==Wn.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},be.fz=function(a){if(0>a||this.type!==Wn.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},be.Fz=function(a,y){if(y===void 0&&(y=new Ie(NaN,NaN)),this.type!==Wn.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)},be.Gz=function(a){if(this.type!==Wn.Graduated)return NaN;var y=this.Pb();return y.transform.Cd(a),y.geometry.xx(a)*this.graduatedRange+this.graduatedMin};function f1(a){return a=a.allBindings,a!==null&&a._isFrozen}function Tu(a){var y=a.allBindings;if(y===null)a.data!==null&&at("Template cannot have .data be non-null: "+a),a.allBindings=y=new Bn;else if(y._isFrozen)return;var x=new Bn;Mv(a,!1),a.qm(a,function(ue,he){he.th();var pe=he.localBindings;if(pe!==null)for(Be(he,!1),pe=pe.iterator;pe.next();){var Se=pe.value;Se.mode===fm&&Be(he,!0);var Pe=Se.sourceName;Pe!==null&&(Pe==="/"&&Mv(ue,!0),Pe=Lx(Se,ue,he),Pe!==null&&(x.add(Pe),Pe.srcBindings===null&&(Pe.srcBindings=new Bn),Pe.srcBindings.add(Se))),y.add(Se)}if(he instanceof Wn&&he.type===Wn.Table){if(0<he.rowCount){for(ue=he.rowDefs,pe=ue.length,Se=0;Se<pe;Se++)if(Pe=ue[Se],Pe!==void 0&&Pe.be!==null)for(var Fe=Pe.be.iterator;Fe.next();){var Ne=Fe.value;Ne.xd=Pe,Ne.to=2,Ne.wl=Pe.index,y.add(Ne)}}if(0<he.columnCount){for(he=he.colDefs,ue=he.length,pe=0;pe<ue;pe++)if(Se=he[pe],Se!==void 0&&Se.be!==null)for(Pe=Se.be.iterator;Pe.next();)Fe=Pe.value,Fe.xd=Se,Fe.to=1,Fe.wl=Se.index,y.add(Fe)}}});for(var E=x.iterator;E.next();){var b=E.value;if(b.srcBindings!==null){Be(b,!0);for(var z=b.srcBindings.iterator;z.next();){var ee=z.value;b.localBindings===null&&(b.localBindings=new Bn),b.localBindings.add(ee)}}b.srcBindings=null}for(E=y.iterator;E.next();)if(b=E.value,z=b.xd,z!==null){b.xd=null;var re=b.targetProperty,oe=re.indexOf(".");0<oe&&z instanceof Wn&&(ee=re.substring(0,oe),re=re.substr(oe+1),oe=z.fb(ee),oe!==null?(z=oe,b.targetProperty=re):li('Warning: unable to find GraphObject named "'+ee+'" for Binding: '+b.toString())),z instanceof vs?(ee=wr(z.panel),b.Ai=ee===void 0?-1:ee,z.panel.bindingId=b.Ai):z instanceof Ft?(ee=wr(z),b.Ai=ee===void 0?-1:ee,z.bindingId=b.Ai):at("Unknown type of binding target: "+z)}y.freeze(),a instanceof pr&&a.Zc()&&a.Va()}be.Uy=function(a){a===void 0&&(a=!1);var y=this.copy();return vS(y,function(x){x instanceof Wn&&(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&&Tu(y),y},be.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,ee=x.Ai;if(ee!==-1){if(z=this.ks(ee),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 Wn))continue;b===1?z=z.Eb(x.wl):b===2&&(z=z.Fb(x.wl))}z!==void 0&&x.Mv(z,E)}}},be.sx=function(a){return a==null||this.ge===null?null:this.ge.I(a)};function yS(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 Wn&&z.data!==null));)b++,z=a[b];if(x-b!==E)return!0;if(z===null)return 0<E;for(var ee=0;b<x&&ee<E;){if(z=a[b],!(z instanceof Wn)||z.data!==y[ee])return!0;b++,ee++}return!1}function Vp(a){if(a.type===Wn.Spot||a.type===Wn.Auto)return Math.min(a.O.length,1);if(a.type===Wn.Link){a=a.O;for(var y=a.length,x=0;x<y;x++){var E=a.M(x);if(!(E instanceof lo&&E.isPanelMain))break}return x}return a.type===Wn.Table&&0<a.O.length&&(a=a.O.M(0),a.isPanelMain&&a instanceof Wn&&ec(a))?1:0}be.mv=function(){for(var a=Vp(this);this.O.length>a;)this.pc(this.O.length-1,!1);g1(this,this.itemArray)};function g1(a,y){var x=Vp(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++)Jm(a,y[E],E,!0)}else{E=x;for(var b=0;b<y.length;b++,E++){var z=y[b],ee=E<a.O.length?a.O.M(E):null;if(ee instanceof Wn){if(ee.data!==z){var re=Av(a,ee.data),oe=Av(a,z),ue=oe!==re;ue||(re=Nv(a,re),ue=Nv(a,oe)!==re),ue?(a.pc(E,!1),Jm(a,z,b,!1)):ee.data=z}}else Jm(a,z,b,!1)}for(;E<a.O.length;)a.pc(E,!1);a.$g=null,kv(a,x,0),tt(a)||a.v(),a.graduatedIntervals=null,a.If()||Qm(a,a,!1),y=a.part,y!==null&&(y.Rh=null,y.ag=NaN,a.Te&&y instanceof Fi&&(y.Te=!0),y.Te&&y instanceof Fi&&(y.wc=null))}}function Jm(a,y,x,E){if(!(y==null||0>x)){var b=Av(a,y);if(b=Nv(a,b),b!==null){if(Tu(b),b=b.copy(),b.l&16777216){var z=a.ih();z!==null&&Mv(z,!0)}typeof y=="object"&&(a.ge===null&&(a.ge=new Rt),a.ge.add(y,b)),z=x+Vp(a),a.Gb(z,b),E&&(b.ub=y,kv(a,z,x),b.ub=null),b.data=y}}}function kv(a,y,x){for(a=a.O;y<a.length;){var E=a.M(y);if(E instanceof Wn){var b=y,z=x;E.type===Wn.TableRow?E.row=b:E.type===Wn.TableColumn&&(E.column=b),E.itemIndex=z}y++,x++}}function Av(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=hs(y,a)}else return"";if(a===void 0)return"";if(typeof a=="string")return a;at("Panel.getCategoryForItemData found a non-string category for "+y+": "+a)}function Nv(a,y){var x=a.itemTemplateMap,E=null;return x!==null&&(E=x.I(y)),E===null&&(x!==null&&(E=x.I("")),E===null&&(p1||(p1=!0,li('No item template Panel found for category "'+y+'" on '+a),li(" Using default item template."),a=new Wn,y=new ja,y.bind(new ds("text","",Pr)),a.add(y),m1=a),E=m1)),E}function Qm(a,y,x){var E=y.enabledChanged;if(E!==null&&E(y,x),y instanceof Wn){y=y.O.s,E=y.length;for(var b=0;b<E;b++){var z=y[b];x&&z instanceof Wn&&!z.isEnabled||Qm(a,z,x)}}}function Ah(a,y){y.name=a,Qu.add(a,y)}fn.Object.defineProperties(Wn.prototype,{type:{get:function(){return this.na},set:function(a){var y=this.na;y!==a&&(this.na=a,this.isAtomic=this.na===Wn.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&&Kn(a,">= 0",Wn,"padding"),a=new $r(a)):(0>a.left&&Kn(a.left,">= 0",Wn,"padding:value.left"),0>a.right&&Kn(a.right,">= 0",Wn,"padding:value.right"),0>a.top&&Kn(a.top,">= 0",Wn,"padding:value.top"),0>a.bottom&&Kn(a.bottom,">= 0",Wn,"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:ns},set:function(a){typeof a=="number"&&(a=new $r(a));var y=this.defaultSeparatorPadding;y.D(a)||(a=a.J(),this.T===null&&(this.T=new wu),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 $o)&&(a instanceof $o&&a.freeze(),this.T===null&&(this.T=new wu),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 wu),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)||at("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 wu),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 $o)&&(a instanceof $o&&a.freeze(),this.T===null&&(this.T=new wu),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 wu),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)||at("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 wu),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 wu),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||at("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()||at("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 bd),this.ra.lq=a,this.v(),this.g("graduatedMin",y,a),xe(this)&&(a=this.part,a!==null&&Ra(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 bd),this.ra.F=a,this.v(),this.g("graduatedMax",y,a),xe(this)&&(a=this.part,a!==null&&Ra(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 bd),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 bd),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 bd,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 bd,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 bd,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 bd,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 wu),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new wu),this.T.Oc}},columnCount:{get:function(){return this.T===null?0:this.colDefs.length}},rowSizing:{get:function(){return this.T!==null?this.T.ob:e0},set:function(a){var y=this.rowSizing;y!==a&&(this.T===null&&(this.T=new wu),this.T.ob=a,this.v(),this.g("rowSizing",y,a))}},columnSizing:{get:function(){return this.T!==null?this.T.j:e0},set:function(a){var y=this.columnSizing;y!==a&&(this.T===null&&(this.T=new wu),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)&&at("Panel.topIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new wu),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)&&at("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new wu),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 pr&&!(this instanceof Yo);Tu(this),this.ub=a;var E=this.diagram;E!==null&&(x?(x=E.partManager,this instanceof $n?(y!==null&&x.bf.remove(y),a!==null&&x.bf.add(a,this)):this instanceof pr&&(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 Yr),this.A.nb=a)}},itemArray:{get:function(){return this.Hh},set:function(a){var y=this.Hh;if(y!==a||a!==null&&yS(this,a)){var x=this.diagram;y!==a&&(x!==null&&y!==null&&yy(x.partManager,this,x),this.Hh=a,x!==null&&a!==null&&vy(x.partManager,this)),this.g("itemArray",y,a),x!==null&&x.undoManager.isUndoingRedoing||g1(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 Rt}var y=this.itemTemplateMap.I("");y!==a&&((a instanceof pr||a.isPanelMain)&&at("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(););co(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&&(co(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 no&&(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&&Qm(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))}}}),fn.Object.defineProperties(Wn,{Position:{get:function(){return Qu.I("Position")}},Horizontal:{get:function(){return Qu.I("Horizontal")}},Vertical:{get:function(){return Qu.I("Vertical")}},Spot:{get:function(){return Qu.I("Spot")}},Auto:{get:function(){return Qu.I("Auto")}},Table:{get:function(){return Qu.I("Table")}},Viewbox:{get:function(){return Qu.I("Viewbox")}},TableRow:{get:function(){return Qu.I("TableRow")}},TableColumn:{get:function(){return Qu.I("TableColumn")}},Link:{get:function(){return Qu.I("Link")}},Grid:{get:function(){return Qu.I("Grid")}},Graduated:{get:function(){return Qu.I("Graduated")}}}),Wn.prototype.rebuildItemElements=Wn.prototype.mv,Wn.prototype.findItemPanelForData=Wn.prototype.sx,Wn.prototype.updateTargetBindings=Wn.prototype.La,Wn.prototype.copyTemplate=Wn.prototype.Uy,Wn.prototype.graduatedValueForPoint=Wn.prototype.Gz,Wn.prototype.graduatedPointForValue=Wn.prototype.Fz,Wn.prototype.findColumnForLocalX=Wn.prototype.fz,Wn.prototype.findRowForLocalY=Wn.prototype.nz,Wn.prototype.addColumnDefinition=Wn.prototype.By,Wn.prototype.addRowDefinition=Wn.prototype.Hy,Wn.prototype.addRowColumnDefinition=Wn.prototype.Gy,Wn.prototype.removeColumnDefinition=Wn.prototype.jA,Wn.prototype.getColumnDefinition=Wn.prototype.Eb,Wn.prototype.removeRowDefinition=Wn.prototype.oA,Wn.prototype.getRowDefinition=Wn.prototype.Fb,Wn.prototype.removeAt=Wn.prototype.mb,Wn.prototype.remove=Wn.prototype.remove,Wn.prototype.insertAt=Wn.prototype.Gb,Wn.prototype.elt=Wn.prototype.M,Wn.prototype.add=Wn.prototype.add,Wn.prototype.findObject=Wn.prototype.fb,Wn.prototype.findInVisualTree=Wn.prototype.Nl,Wn.prototype.walkVisualTreeFrom=Wn.prototype.qm,Wn.prototype.findMainElement=Wn.prototype.Pb;var p1=!1,m1=null,Qu=new Rt;Wn.className="Panel",Wn.definePanelLayout=Ah,Ah("Position",new Rm),Ah("Vertical",new zm),Ah("Auto",new Gm),Ah("Link",new Ym);function bd(){this.lq=0,this.F=100,this.ia=10,this.V=0,this.Zh=this.o=this.j=this.u=null}bd.prototype.copy=function(){var a=new bd;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},bd.className="GradPanelSettings";function wu(){this.Pc=[],this.Oc=[],this.j=this.ob=e0,this.hb=this.Hb=0,this.Qp=ns,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}wu.prototype.copy=function(a){for(var y=new wu,x=this.Pc,E=x.length,b=y.Pc,z=0;z<E;z++)if(x[z]!==void 0){var ee=x[z].copy();ee.wi(a),b[z]=ee}for(x=this.Oc,E=x.length,b=y.Oc,z=0;z<E;z++)x[z]!==void 0&&(ee=x[z].copy(),ee.wi(a),b[z]=ee);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},wu.className="TablePanelSettings";function vs(a){Er(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=or,this.pa=this.oc=this.oa=0,this.be=null,this.oo=Dv,this.hg=qr,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))}vs.prototype.copy=function(){var a=new vs;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=Un(this.separatorDashArray)),a.Ma=this.Ma,a.Pm=this.Pm,a.be=this.be,a};function $m(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=Un(y.separatorDashArray)),a.background=y.background,a.coversSeparators=y.coversSeparators,a.be=y.be}be=vs.prototype,be.qb=function(a){a.classType===vs&&(this.sizing=a)},be.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+wr(this)},be.wi=function(a){this.Me=a},be.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)},be.Wc=function(){var a=0,y=this.Me,x=0,E=this.isRow;if(y!==null&&y.type===Wn.Table)for(var b=E?y.rowDefs.length:y.colDefs.length,z=0;z<b;z++){var ee=E?y.rowDefs[z]:y.colDefs[z];if(ee!==void 0&&ee.oa!==0){x=ee.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)},be.Ob=function(a,y,x){var E=this.Me;if(E!==null&&(E.cb(oo,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 qm(a){if(a.sizing===Dv){var y=a.Me;return a.isRow?y.rowSizing:y.columnSizing}return a.sizing}be.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new ds(a,y,x,E):b=a,b.xd=this,a=this.panel,a!==null&&(y=a.ih(),y!==null&&f1(y)&&at("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+b+" on "+a)),this.be===null&&(this.be=new Bn),this.be.add(b),this},fn.Object.defineProperties(vs.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&&Kn(a,">= 0",vs,"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&&Kn(a,">= 0",vs,"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))&&Kn(a,">= 0",vs,"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&&Kn(a,">= 0",vs,"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 $r(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&&Qd(a,"RowColumnDefinition.separatorStroke"),a instanceof $o&&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)||at("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&&Qd(a,"RowColumnDefinition.background"),a instanceof $o&&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}}}),vs.prototype.computeEffectiveSpacing=vs.prototype.Wc,vs.prototype.computeEffectiveSpacingTop=vs.prototype.Io;var Dv=new Ot(vs,"Default",0),Kp=new Ot(vs,"None",1),e0=new Ot(vs,"ProportionalExtra",2);vs.className="RowColumnDefinition",vs.Default=Dv,vs.None=Kp,vs.ProportionalExtra=e0;function lo(a,y){Ft.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)}_t(lo,Ft),lo.prototype.cloneProtected=function(a){Ft.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=Un(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 Df(a){a.Na===null?a.Na=new Iv:a.Na.nc&&(a.Na=a.Na.copy())}be=lo.prototype,be.th=function(){Ft.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},be.qb=function(a){a===kn||a===ir||a===Ao||a===qr?this.geometryStretch=a:Ft.prototype.qb.call(this,a)},be.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+wr(this)};function lp(a,y,x,E){var b=x.length;if(!(4>b)){var z=E.measuredBounds,ee=Math.max(1,z.width);z=z.height;for(var re=x[0],oe=x[1],ue,he,pe,Se,Pe,Fe,Ne=0,Xe=xi(),Ve=2;Ve<b;Ve+=2)ue=x[Ve],he=x[Ve+1],pe=ue-re,re=he-oe,pe===0&&(pe=.001),Se=re/pe,Pe=Math.atan2(re,pe),Fe=Math.sqrt(pe*pe+re*re),Xe.push([pe,Pe,Se,Fe]),Ne+=Fe,re=ue,oe=he;re=x[0],oe=x[1],pe=E.measuredBounds.width,E instanceof lo&&(pe-=E.strokeWidth),1>pe&&(pe=1),b=x=pe,ue=ee/2,he=ue!==0,Ve=0,Fe=Xe[Ve],pe=Fe[0],Pe=Fe[1],Se=Fe[2],Fe=Fe[3];for(var ht=0;.1<=Ne;){if(ht===0&&(he?(b=x,b-=ue,Ne-=ue,he=!1):b=x,b===0&&(b=1)),b>Ne){Bi(Xe);return}b>Fe?(ht=b-Fe,b=Fe):ht=0;var ft=Math.sqrt(b*b/(1+Se*Se));if(0>pe&&(ft=-ft),re+=ft,oe+=Se*ft,a.translate(re,oe),a.rotate(Pe),a.translate(-(ee/2),-(z/2)),ht===0&&E.hh(a,y),a.translate(ee/2,z/2),a.rotate(-Pe),a.translate(-re,-oe),Ne-=b,Fe-=b,ht!==0){if(Ve++,Ve===Xe.length){Bi(Xe);return}Fe=Xe[Ve],pe=Fe[0],Pe=Fe[1],Se=Fe[2],Fe=Fe[3],b=ht}}Bi(Xe)}}be.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,ee=this.naturalBounds;E!==null&&Qa(this,a,E,!0,!1,ee,z);var re=this.part,oe=this.ig;if(x===null||oe!==0||re===null||!this.isPanelMain&&re.Pb()!==this||(oe=re.type===Wn.Link&&re instanceof Yo&&re.category==="Selection"&&re.adornedObject instanceof lo&&re.adornedPart.Pb()===re.adornedObject?re.adornedObject.strokeWidth:0),oe===0&&(x=null),x!==null&&oe!==0&&(Qa(this,a,x,!1,!1,ee,z),a.lineWidth=oe,a.lineJoin=this.strokeJoin,a.lineCap=this.strokeCap,a.miterLimit=this.strokeMiterLimit),z=!1,re&&y.Gf("drawShadows")&&(z=re.isShadowed),a.Il===!1&&(z=!1),re=!0,x===null||E!==null&&E!=="transparent"||(re=!1),ee=!1,oe=this.strokeDashArray,oe!==null&&(ee=!0,a.js(oe,this.strokeDashOffset)),b.type===ut.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===ut.u){var ue=b.startX;oe=b.startY;var he=b.endX,pe=b.endY;b=Math.min(ue,he);var Se=Math.min(oe,pe);ue=Math.abs(he-ue),oe=Math.abs(pe-oe),a.beginPath(),a.rect(b,Se,ue,oe),E!==null&&a.ng(E),x!==null&&(re&&z&&_s(a),a.jk(),re&&z&&Gl(a)),a.Se()}else if(b.type===ut.F)ue=b.startX,oe=b.startY,he=b.endX,pe=b.endY,b=Math.abs(he-ue)/2,Se=Math.abs(pe-oe)/2,ue=Math.min(ue,he)+b,oe=Math.min(oe,pe)+Se,a.beginPath(),a.moveTo(ue,oe-Se),a.bezierCurveTo(ue+Re.wg*b,oe-Se,ue+b,oe-Re.wg*Se,ue+b,oe),a.bezierCurveTo(ue+b,oe+Re.wg*Se,ue+Re.wg*b,oe+Se,ue,oe+Se),a.bezierCurveTo(ue-Re.wg*b,oe+Se,ue-b,oe+Re.wg*Se,ue-b,oe),a.bezierCurveTo(ue-b,oe-Re.wg*Se,ue-Re.wg*b,oe-Se,ue,oe-Se),a.closePath(),E!==null&&a.ng(E),x!==null&&(re&&z&&_s(a),a.jk(),re&&z&&Gl(a)),a.Se();else if(b.type===ut.o)for(b=b.figures,oe=b.length,Se=0;Se<oe;Se++){ue=b.s[Se],a.beginPath(),a.moveTo(ue.startX,ue.startY),he=ue.segments.s,pe=he.length;for(var Pe=null,Fe=0;Fe<pe;Fe++){var Ne=he[Fe];switch(Ne.type){case Ei:a.moveTo(Ne.endX,Ne.endY);break;case bi:a.lineTo(Ne.endX,Ne.endY);break;case Jr:a.bezierCurveTo(Ne.point1X,Ne.point1Y,Ne.point2X,Ne.point2Y,Ne.endX,Ne.endY);break;case Ur:a.quadraticCurveTo(Ne.point1X,Ne.point1Y,Ne.endX,Ne.endY);break;case Mr:if(Ne.radiusX===Ne.radiusY){var Xe=Math.PI/180;a.arc(Ne.point1X,Ne.point1Y,Ne.radiusX,Ne.startAngle*Xe,(Ne.startAngle+Ne.sweepAngle)*Xe,0>Ne.sweepAngle,Pe!==null?Pe.endX:ue.startX,Pe!==null?Pe.endY:ue.startY)}else if(Pe=Po(Ne,ue),Xe=Pe.length,Xe===0)a.lineTo(Ne.centerX,Ne.centerY);else for(var Ve=0;Ve<Xe;Ve++){var ht=Pe[Ve];Ve===0&&a.lineTo(ht[0],ht[1]),a.bezierCurveTo(ht[2],ht[3],ht[4],ht[5],ht[6],ht[7])}break;case Fo:if(Ve=Xe=0,Pe!==null&&Pe.type===Mr){if(Pe=Po(Pe,ue),ht=Pe.length,ht===0){a.lineTo(Ne.endX,Ne.endY);break}Pe=Pe[ht-1]||null,Pe!==null&&(Xe=Pe[6],Ve=Pe[7])}else Xe=Pe!==null?Pe.endX:ue.startX,Ve=Pe!==null?Pe.endY:ue.startY;if(Pe=Ki(Ne,ue,Xe,Ve),Xe=Pe.length,Xe===0){a.lineTo(Ne.endX,Ne.endY);break}for(Ve=0;Ve<Xe;Ve++)ht=Pe[Ve],a.bezierCurveTo(ht[2],ht[3],ht[4],ht[5],ht[6],ht[7]);break;default:at("Segment not of valid type: "+Ne.type)}Ne.isClosed&&a.closePath(),Pe=Ne}he=ue.isFilled,z?ue.isShadowed?(he===!0&&E!=="transparent"&&E!==null&&a.ng(E,ue.isEvenOdd),x!==null&&(he&&re&&_s(a),a.jk(),he&&re&&Gl(a))):(_s(a),he&&E!=="transparent"&&E!==null&&a.ng(E,ue.isEvenOdd),x!==null&&a.jk(),Gl(a)):(he&&E!==null&&a.ng(E,ue.isEvenOdd),x!==null&&a.jk()),a.Se(Se)}if(ee&&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=xi(),z.type===ut.j)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.endY),lp(a,y,E,x);else if(z.type===ut.o)for(z=z.figures.iterator;z.next();){for(re=z.value,E.length=0,E.push(re.startX),E.push(re.startY),ee=re.startX,b=re.startY,oe=ee,Se=b,ue=re.segments.s,he=ue.length,pe=0;pe<he;pe++){switch(Fe=ue[pe],Fe.type){case Ei:lp(a,y,E,x),E.length=0,E.push(Fe.endX),E.push(Fe.endY),ee=Fe.endX,b=Fe.endY,oe=ee,Se=b;break;case bi:E.push(Fe.endX),E.push(Fe.endY),ee=Fe.endX,b=Fe.endY;break;case Jr:Re.Qe(ee,b,Fe.point1X,Fe.point1Y,Fe.point2X,Fe.point2Y,Fe.endX,Fe.endY,.5,E),ee=Fe.endX,b=Fe.endY;break;case Ur:Re.ep(ee,b,Fe.point1X,Fe.point1Y,Fe.endX,Fe.endY,.5,E),ee=Fe.endX,b=Fe.endY;break;case Mr:if(Ne=Po(Fe,re),Pe=Ne.length,Pe===0){E.push(Fe.centerX),E.push(Fe.centerY),ee=Fe.centerX,b=Fe.centerY;break}for(Xe=0;Xe<Pe;Xe++)Ve=Ne[Xe],Re.Qe(ee,b,Ve[2],Ve[3],Ve[4],Ve[5],Ve[6],Ve[7],.5,E),ee=Ve[6],b=Ve[7];break;case Fo:if(Ne=Ki(Fe,re,ee,b),Pe=Ne.length,Pe===0){E.push(Fe.endX),E.push(Fe.endY),ee=Fe.endX,b=Fe.endY;break}for(Xe=0;Xe<Pe;Xe++)Ve=Ne[Xe],Re.Qe(ee,b,Ve[2],Ve[3],Ve[4],Ve[5],Ve[6],Ve[7],.5,E),ee=Ve[6],b=Ve[7];break;default:at("Segment not of valid type: "+Fe.type)}Fe.isClosed&&(E.push(oe),E.push(Se),lp(a,y,E,x))}lp(a,y,E,x)}else if(z.type===ut.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),lp(a,y,E,x);else if(z.type===ut.F){if(b=new Zr,b.startX=z.endX,b.startY=(z.startY+z.endY)/2,ee=new mr(Mr),ee.startAngle=0,ee.sweepAngle=360,ee.centerX=(z.startX+z.endX)/2,ee.centerY=(z.startY+z.endY)/2,ee.radiusX=Math.abs(z.startX-z.endX)/2,ee.radiusY=Math.abs(z.startY-z.endY)/2,b.add(ee),z=Po(ee,b),re=z.length,re===0)E.push(ee.centerX),E.push(ee.centerY);else for(ee=b.startX,b=b.startY,oe=0;oe<re;oe++)Se=z[oe],Re.Qe(ee,b,Se[2],Se[3],Se[4],Se[5],Se[6],Se[7],.5,E),ee=Se[6],b=Se[7];lp(a,y,E,x)}Bi(E),a.restore(),a.Vc(!1)}}}},be.kk=function(a,y,x){return!Ft.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)},be.nk=function(a){return this.geometry!==null&&1<this.geometry.figures.length||this.pathPattern!==null?!0:Ft.prototype.nk.call(this,a)},be.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)}},be.ga=function(a,y){if(y===void 0&&(y=new Ie),a instanceof Xi){a.Mc()&&at("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},be.mi=function(a){a===void 0&&(a=new Gt);var y=this.naturalBounds,x=this.oe;y=Gt.allocAt(y.x,y.y,y.width,y.height);var E=this.strokeWidth;return y.Bc(E/2,E/2),E=Ie.allocAt(y.x,y.y).transform(x),a.h(E.x,E.y,0,0),E.h(y.right,y.y).transform(x),ko(a,E.x,E.y,0,0),E.h(y.right,y.bottom).transform(x),ko(a,E.x,E.y,0,0),E.h(y.x,y.bottom).transform(x),ko(a,E.x,E.y,0,0),Gt.free(y),Ie.free(E),a},be.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!==ut.j||y||(b+=2);var z=Gt.alloc();if(z.assign(E),z.Bc(b+2,b+2),!z.ca(a))return Gt.free(z),!1;if(E=b+1e-4,x.type===ut.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:(Gt.free(z),Re.Yb(x.startX,x.startY,x.endX,x.endY,b,a.x,a.y));if(x.type===ut.u){y=x.startX;var ee=x.startY,re=x.endX;if(x=x.endY,z.x=Math.min(y,re),z.y=Math.min(ee,x),z.width=Math.abs(re-y),z.height=Math.abs(x-ee),this.fill===null){if(z.Bc(-E,-E),z.ca(a))return Gt.free(z),!1;z.Bc(E,E)}return this.stroke!==null&&z.Bc(b,b),a=z.ca(a),Gt.free(z),a}if(x.type===ut.F){ee=x.startX,b=x.startY,re=x.endX;var oe=x.endY;if(x=Math.min(ee,re),y=Math.min(b,oe),ee=Math.abs(re-ee)/2,b=Math.abs(oe-b)/2,x=a.x-(x+ee),y=a.y-(y+b),this.fill===null){if(ee-=E,b-=E,0>=ee||0>=b||1>=x*x/(ee*ee)+y*y/(b*b))return Gt.free(z),!1;ee+=E,b+=E}return this.stroke!==null&&(ee+=E,b+=E),Gt.free(z),0>=ee||0>=b?!1:1>=x*x/(ee*ee)+y*y/(b*b)}if(x.type===ut.o)return Gt.free(z),this.fill===null?Jn(x,a.x,a.y,b):gr(x,a,b,1<this.strokeWidth,y);at("Unknown Geometry type: "+x.type)},be.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 ee=this.geometry.bounds;else{var re=this.figure,oe=_v[re];if(oe===void 0){var ue=Re.Ze[re];typeof ue=="string"&&(ue=Re.Ze[ue]),typeof ue=="function"?(oe=ue(null,100,100),_v[re]=oe):at("Unsupported Figure: "+re)}ee=oe.bounds}re=ee.width,oe=ee.height,ue=ee.width;var he=ee.height;switch(ul(this,!0)){case kn:E=x=0;break;case jn:ue=Math.max(a-z,0),he=Math.max(y-z,0);break;case hr:ue=Math.max(a-z,0),E=0;break;case Lr:x=0,he=Math.max(y-z,0)}isFinite(b.width)&&(ue=b.width),isFinite(b.height)&&(he=b.height);var pe=this.maxSize,Se=this.minSize;switch(x=Math.max(x-z,Se.width),E=Math.max(E-z,Se.height),ue=Math.min(pe.width,ue),he=Math.min(pe.height,he),ue=isFinite(ue)?Math.max(x,ue):Math.max(re,x),he=isFinite(he)?Math.max(E,he):Math.max(oe,E),x=Tv(this),x){case kn:break;case jn:re=ue,oe=he;break;case ir:x=Math.min(ue/re,he/oe),isFinite(x)||(x=1),re*=x,oe*=x;break;default:at(x+" is not a valid geometryStretch.")}this.Rd!==null?(re===0&&(re=.001),oe===0&&(oe=.001),x=this.Rd!==null?this.Rd:this.ua,ee=x.bounds,E=re/ee.width,ee=oe/ee.height,isFinite(E)||(E=1),isFinite(ee)||(ee=1),this.ua=E===1&&ee===1?x:x.copy().scale(E,ee)):this.ua!==null&&Re.$(this.ua.Sk,a-z)&&Re.$(this.ua.Rk,y-z)||(this.ua=lo.makeGeometry(this,re,oe)),ee=this.ua.bounds,a===1/0||y===1/0?this.Ge(ee.x-z/2,ee.y-z/2,a===0&&re===0?0:ee.width+z,y===0&&oe===0?0:ee.height+z):this.Ge(-(z/2),-(z/2),ue+z,he+z),b.w()?(ue=b.width,he=b.height,ue=Math.min(pe.width,ue),he=Math.min(pe.height,he),ue=Math.max(Se.width,ue),he=Math.max(Se.height,he),this.dc.h(0,0,ue,he)):this.dc.assign(ee)};function Tv(a){var y=a.geometryStretch;return a.Rd!==null?y===qr?jn:y:y===qr?_v[a.figure].defaultStretch:y}be.eh=function(a,y,x,E){nl(this,a,y,x,E)},be.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},be.Sj=function(a,y,x,E,b){var z=this.transform,ee=1/(z.m11*z.m22-z.m12*z.m21),re=z.m22*ee,oe=-z.m12*ee,ue=-z.m21*ee,he=z.m11*ee,pe=ee*(z.m21*z.dy-z.m22*z.dx),Se=ee*(z.m12*z.dx-z.m11*z.dy);z=a*re+y*ue+pe,ee=a*oe+y*he+Se,re=x*re+E*ue+pe,oe=x*oe+E*he+Se,pe=this.ig/2,ue=this.ua,ue===null&&(this.measure(1/0,1/0),ue=this.ua);var Pe=ue.bounds;if(he=!1,ue.type===ut.j)if(1.5>=this.strokeWidth)he=Re.Ve(ue.startX,ue.startY,ue.endX,ue.endY,z,ee,re,oe,b);else{if(ue.startX===ue.endX?(E=pe,he=0):(y=(ue.endY-ue.startY)/(ue.endX-ue.startX),he=pe/Math.sqrt(1+y*y),E=he*y),y=xi(),a=new Ie,Re.Ve(ue.startX+E,ue.startY+he,ue.endX+E,ue.endY+he,z,ee,re,oe,a)&&y.push(a),a=new Ie,Re.Ve(ue.startX-E,ue.startY-he,ue.endX-E,ue.endY-he,z,ee,re,oe,a)&&y.push(a),a=new Ie,Re.Ve(ue.startX+E,ue.startY+he,ue.startX-E,ue.startY-he,z,ee,re,oe,a)&&y.push(a),a=new Ie,Re.Ve(ue.endX+E,ue.endY+he,ue.endX-E,ue.endY-he,z,ee,re,oe,a)&&y.push(a),re=y.length,re===0)return Bi(y),!1;for(he=!0,oe=1/0,E=0;E<re;E++)a=y[E],x=(a.x-z)*(a.x-z)+(a.y-ee)*(a.y-ee),x<oe&&(oe=x,b.x=a.x,b.y=a.y);Bi(y)}else if(ue.type===ut.u)he=Re.Ff(Pe.x-pe,Pe.y-pe,Pe.x+Pe.width+pe,Pe.y+Pe.height+pe,z,ee,re,oe,b);else if(ue.type===ut.F){y=Gt.allocAt(Pe.x,Pe.y,Pe.width,Pe.height).Bc(pe,pe);e:if(y.width===0)he=Re.Ve(y.x,y.y,y.x,y.y+y.height,z,ee,re,oe,b);else if(y.height===0)he=Re.Ve(y.x,y.y,y.x+y.width,y.y,z,ee,re,oe,b);else{if(a=y.width/2,ue=y.height/2,E=y.x+a,he=y.y+ue,x=9999,z!==re&&(x=(ee-oe)/(z-re)),9999>Math.abs(x)){if(oe=ee-he-x*(z-E),0>a*a*x*x+ue*ue-oe*oe){b.x=NaN,b.y=NaN,he=!1;break e}pe=Math.sqrt(a*a*x*x+ue*ue-oe*oe),re=(-(a*a*x*oe)+a*ue*pe)/(ue*ue+a*a*x*x)+E,a=(-(a*a*x*oe)-a*ue*pe)/(ue*ue+a*a*x*x)+E,ue=x*(re-E)+oe+he,oe=x*(a-E)+oe+he,Math.abs((z-re)*(z-re))+Math.abs((ee-ue)*(ee-ue))<Math.abs((z-a)*(z-a))+Math.abs((ee-oe)*(ee-oe))?(b.x=re,b.y=ue):(b.x=a,b.y=oe)}else{if(re=ue*ue,oe=z-E,re-=re/(a*a)*oe*oe,0>re){b.x=NaN,b.y=NaN,he=!1;break e}oe=Math.sqrt(re),re=he+oe,oe=he-oe,Math.abs(re-ee)<Math.abs(oe-ee)?(b.x=z,b.y=re):(b.x=z,b.y=oe)}he=!0}Gt.free(y)}else if(ue.type===ut.o){Se=Ie.alloc();var Fe=re-z,Ne=oe-ee,Xe=Fe*Fe+Ne*Ne,Ve=z,ht=ee;if(0<Xe&&Pe.contains(Ve,ht)&&(Se.x=Ve,Se.y=ht,this.ca(Se)))for(Fe!==0&&.5>Math.abs(Fe)?(Ne*=.5/Fe,Fe=.5):Ne!==0&&.5>Math.abs(Ne)&&(Fe*=.5/Ne,Ne=.5),Ve-=Fe,ht-=Ne;Pe.contains(Ve,ht);)Ve-=Fe,ht-=Ne;for(b.x=re,b.y=oe,Ne=0;Ne<ue.figures.count;Ne++){var ft=ue.figures.s[Ne],mt=ft.isFilled?Ve:z,Ct=ft.isFilled?ht:ee,Kt=ft.segments;Pe=ft.startX,Fe=ft.startY;for(var yi=Pe,tr=Fe,Zi=0;Zi<Kt.count;Zi++){var Qn=Kt.s[Zi],bn=Qn.type,to=Qn.endX,_r=Qn.endY,ia=!1;switch(bn){case Ei:yi=to,tr=_r;break;case bi:ia=n0(Pe,Fe,to,_r,mt,Ct,re,oe,Se);break;case Jr:ia=Re.Eo(Pe,Fe,Qn.point1X,Qn.point1Y,Qn.point2X,Qn.point2Y,to,_r,mt,Ct,re,oe,.6,Se);break;case Ur:ia=Re.Eo(Pe,Fe,Pe+2/3*(Qn.point1X-Pe),Fe+2/3*(Qn.point1Y-Fe),to+2/3*(Qn.point1X-to),_r+2/3*(Qn.point1Y-_r),to,_r,mt,Ct,re,oe,.6,Se);break;case Mr:case Fo:bn=Qn.type===Mr?Po(Qn,ft):Ki(Qn,ft,Pe,Fe);var Da=bn.length;if(Da===0){ia=n0(Pe,Fe,Qn.type===Mr?Qn.centerX:Qn.endX,Qn.type===Mr?Qn.centerY:Qn.endY,mt,Ct,re,oe,Se);break}for(_r=null,to=0;to<Da;to++){if(_r=bn[to],to===0&&n0(Pe,Fe,_r[0],_r[1],mt,Ct,re,oe,Se)){var ks=t0(mt,Ct,Se,Xe,b);ks<Xe&&(Xe=ks,he=!0)}Re.Eo(_r[0],_r[1],_r[2],_r[3],_r[4],_r[5],_r[6],_r[7],mt,Ct,re,oe,.6,Se)&&(ks=t0(mt,Ct,Se,Xe,b),ks<Xe&&(Xe=ks,he=!0))}to=_r[6],_r=_r[7];break;default:at("Unknown Segment type: "+bn)}Pe=to,Fe=_r,ia&&(ia=t0(mt,Ct,Se,Xe,b),ia<Xe&&(Xe=ia,he=!0)),Qn.isClosed&&(to=yi,_r=tr,n0(Pe,Fe,to,_r,mt,Ct,re,oe,Se)&&(Qn=t0(mt,Ct,Se,Xe,b),Qn<Xe&&(Xe=Qn,he=!0)))}}z=x-a,ee=E-y,re=Math.sqrt(z*z+ee*ee),re!==0&&(z/=re,ee/=re),b.x-=z*pe,b.y-=ee*pe,Ie.free(Se)}else at("Unknown Geometry type: "+ue.type);return he?(this.transform.Ga(b),!0):!1};function t0(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 n0(a,y,x,E,b,z,ee,re,oe){if(Re.$(a,x)&&Re.$(y,E)||Re.$(b,ee)&&Re.$(z,re))return!1;var ue=!1,he=(b-ee)*(y-E)-(z-re)*(a-x);return he===0?!1:(oe.x=((b*re-z*ee)*(a-x)-(b-ee)*(a*E-y*x))/he,oe.y=((b*re-z*ee)*(y-E)-(z-re)*(a*E-y*x))/he,(a>x?a-x:x-a)<(y>E?y-E:E-y)?(a=y<E?y:E,y=y<E?E:y,(oe.y>a||Re.$(oe.y,a))&&(oe.y<y||Re.$(oe.y,y))&&(ue=!0)):(y=a<x?a:x,a=a<x?x:a,(oe.x>y||Re.$(oe.x,y))&&(oe.x<a||Re.$(oe.x,a))&&(ue=!0)),ue)}be.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=Ie.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)))),Ie.free(z),b},be.Yc=function(a,y){if(this.fh(a,y)||y===void 0&&(y=this.transform,a.Re(this.actualBounds)))return!0;var x=pt.alloc();x.set(y),x.Vj();var E=a.left,b=a.right,z=a.top;a=a.bottom;var ee=Ie.alloc();if(ee.h(E,z),x.Ga(ee),this.gh(ee,!0)||(ee.h(b,z),x.Ga(ee),this.gh(ee,!0))||(ee.h(E,a),x.Ga(ee),this.gh(ee,!0))||(ee.h(b,a),x.Ga(ee),this.gh(ee,!0)))return Ie.free(ee),!0;var re=Ie.alloc(),oe=Ie.alloc();return x.set(y),x.bv(this.transform),x.Vj(),re.x=b,re.y=z,re.transform(x),ee.x=E,ee.y=z,ee.transform(x),y=!1,Tf(this,ee,re,oe)?y=!0:(ee.x=b,ee.y=a,ee.transform(x),Tf(this,ee,re,oe)?y=!0:(re.x=E,re.y=a,re.transform(x),Tf(this,ee,re,oe)?y=!0:(ee.x=E,ee.y=z,ee.transform(x),Tf(this,ee,re,oe)&&(y=!0)))),Ie.free(ee),pt.free(x),Ie.free(re),Ie.free(oe),y};function Tf(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)}be.tx=function(a,y,x){function E(Xe,Ve){for(var ht=Xe.length,ft=0;ft<ht;ft+=2)if(Ve.zd(Xe[ft],Xe[ft+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 ee=y.bounds,re=ee.x,oe=ee.y,ue=ee.x+ee.width;if(ee=ee.y+ee.height,hi(a.x,a.y,re,oe)<=b&&hi(a.x,a.y,ue,oe)<=b&&hi(a.x,a.y,re,ee)<=b&&hi(a.x,a.y,ue,ee)<=b)return!0}if(re=y.startX,oe=y.startY,ue=y.endX,ee=y.endY,y.type===ut.j){if(x=(re-ue)*(a.x-ue)+(oe-ee)*(a.y-ee),ui(a.x,a.y,re,oe,ue,ee)<=(0<=(ue-re)*(a.x-re)+(ee-oe)*(a.y-oe)&&0<=x?b:z))return!0}else{if(y.type===ut.u)return y=!1,x&&(y=ui(a.x,a.y,re,oe,re,ee)<=b||ui(a.x,a.y,re,oe,ue,oe)<=b||ui(a.x,a.y,ue,oe,ue,ee)<=b||ui(a.x,a.y,re,ee,ue,ee)<=b),y;if(y.type===ut.F){y=a.x-(re+ue)/2,z=a.y-(oe+ee)/2;var he=Math.abs(ue-re)/2,pe=Math.abs(ee-oe)/2;if(he===0||pe===0)return ui(a.x,a.y,re,oe,ue,ee)<=b;if(x){if(a=Re.$y(he,pe,y,z),a*a<=b)return!0}else return!(hi(y,z,-he,0)>=b||hi(y,z,0,-pe)>=b||hi(y,z,0,pe)>=b||hi(y,z,he,0)>=b)}else if(y.type===ut.o){if(ue=y.bounds,z=ue.x,re=ue.y,oe=ue.x+ue.width,ue=ue.y+ue.height,a.x>oe&&a.x<z&&a.y>ue&&a.y<re&&ui(a.x,a.y,z,re,z,ue)>b&&ui(a.x,a.y,z,re,oe,re)>b&&ui(a.x,a.y,oe,ue,z,ue)>b&&ui(a.x,a.y,oe,ue,oe,re)>b)return!1;if(z=Math.sqrt(b),x){if(this.fill===null?Jn(y,a.x,a.y,z):gr(y,a,z,!0,!1))return!0}else{for(x=y.figures,y=0;y<x.count;y++){if(z=x.s[y],ee=z.startX,he=z.startY,a.zd(ee,he)>b)return!1;for(re=z.segments.s,oe=re.length,ue=0;ue<oe;ue++)switch(pe=re[ue],pe.type){case Ei:case bi:if(ee=pe.endX,he=pe.endY,a.zd(ee,he)>b)return!1;break;case Jr:var Se=xi();if(Re.Qe(ee,he,pe.point1X,pe.point1Y,pe.point2X,pe.point2Y,pe.endX,pe.endY,.8,Se),ee=E(Se,a),Bi(Se),ee||(ee=pe.endX,he=pe.endY,a.zd(ee,he)>b))return!1;break;case Ur:if(Se=xi(),Re.ep(ee,he,pe.point1X,pe.point1Y,pe.endX,pe.endY,.8,Se),ee=E(Se,a),Bi(Se),ee||(ee=pe.endX,he=pe.endY,a.zd(ee,he)>b))return!1;break;case Mr:case Fo:Se=pe.type===Mr?Po(pe,z):Ki(pe,z,ee,he);var Pe=Se.length;if(Pe===0){if(ee=pe.type===Mr?pe.centerX:pe.endX,he=pe.type===Mr?pe.centerY:pe.endY,a.zd(ee,he)>b)return!1;break}pe=null;for(var Fe=xi(),Ne=0;Ne<Pe;Ne++)if(pe=Se[Ne],Fe.length=0,Re.Qe(pe[0],pe[1],pe[2],pe[3],pe[4],pe[5],pe[6],pe[7],.8,Fe),E(Fe,a))return Bi(Fe),!1;Bi(Fe),pe!==null&&(ee=pe[6],he=pe[7]);break;default:at("Unknown Segment type: "+pe.type)}}return!0}}}return!1},be.qc=function(){this.ua=null},be.kq=function(){return this.ig};function v1(a){var y=a.diagram;y!==null&&y.undoManager.isUndoingRedoing||(a.segmentOrientation=tm,a.toArrow!=="None"?(a.segmentIndex=-1,a.alignmentFocus=Lo):a.fromArrow!=="None"&&(a.segmentIndex=0,a.alignmentFocus=new Xi(1-Lo.x,Lo.y)))}lo.makeGeometry=function(a,y,x){if(a.toArrow!=="None")var E=Yh[a.toArrow];else a.fromArrow!=="None"?E=Yh[a.fromArrow]:(E=Re.Ze[a.figure],typeof E=="string"&&(E=Re.Ze[E]),E===void 0&&at("Unknown Shape.figure: "+a.figure),E=E(a,y,x),E.Sk=y,E.Rk=x);if(E===null){var b=Re.Ze.Rectangle;typeof b=="function"&&(E=b(a,y,x))}return E};function y1(a){var y=Yh[a];if(y===void 0){var x=a.toLowerCase();if(x==="none")return"None";if(y=Yh[x],y===void 0){var E=null,b;for(b in Re.um)if(b.toLowerCase()===x){E=b;break}if(E!==null)return a=ut.parse(Re.um[E],!1),Yh[E]=a,x!==E&&(Yh[x]=E),E}}return typeof y=="string"?y:y instanceof ut?a:null}fn.Object.defineProperties(lo.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),xe(this)&&(a=this.part,a!==null&&Ra(this,a,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(a){a=ut.parse(a);var y=a.normalize();this.geometry=a,this.position=a=Ie.allocAt(-y.x,-y.y),Ie.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&&Qd(a,"Shape.fill"),a instanceof $o&&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&&Qd(a,"Shape.stroke"),a instanceof $o&&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 Kn(a,"value >= 0",lo,"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"?Kn(a,'"butt", "round", or "square"',lo,"strokeCap"):(Df(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"?Kn(a,'"miter", "bevel", or "round"',lo,"strokeJoin"):(Df(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){Df(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)||at("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&&(Df(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=Re.Ze[a];typeof x=="function"?x=a:(x=Re.Ze[a.toLowerCase()])||at("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=y1(a);x===null?at("Unknown Shape.toArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new eo),this.Ua.V=x,this.Rd=null,this.qc(),this.v(),v1(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=y1(a);x===null?at("Unknown Shape.fromArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new eo),this.Ua.j=x,this.Rd=null,this.qc(),this.v(),v1(this),this.g("fromArrow",y,x))}}},spot1:{get:function(){return this.Na!==null?this.Na.fg:or},set:function(a){var y=this.spot1;y.D(a)||(a=a.J(),Df(this),this.Na.fg=a,this.v(),this.g("spot1",y,a))}},spot2:{get:function(){return this.Na!==null?this.Na.gg:or},set:function(a){var y=this.spot2;y.D(a)||(a=a.J(),Df(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&&(Df(this),this.Na.br=a,this.N(),this.g("pathPattern",y,a))}},geometryStretch:{get:function(){return this.Na!==null?this.Na.jq:qr},set:function(a){var y=this.geometryStretch;y!==a&&(Df(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 Xh),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 Xh),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 Xh),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 Xh),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}}}),lo.prototype.intersectsRect=lo.prototype.Yc,lo.prototype.containedInRect=lo.prototype.fh,lo.prototype.getNearestIntersectionPoint=lo.prototype.rs,lo.prototype.getDocumentBounds=lo.prototype.mi,lo.prototype.getDocumentPoint=lo.prototype.ga;var Yh=new Ri,_v=new Ri;lo.className="Shape",lo.getFigureGenerators=function(){var a=new Rt,y;for(y in Re.Ze)y!==y.toLowerCase()&&a.add(y,Re.Ze[y]);return a.freeze(),a},lo.defineFigureGenerator=function(a,y){var x=a.toLowerCase(),E=Re.Ze;E[a]=y,E[x]=a},lo.getArrowheadGeometries=function(){var a=new Rt;for(E in Re.um)if(Yh[E]===void 0){var y=ut.parse(Re.um[E],!1);Yh[E]=y,y=E.toLowerCase(),y!==E&&(Yh[y]=E)}for(var x in Yh)if(x!==x.toLowerCase()){var E=Yh[x];E instanceof ut&&a.add(x,E)}return a.freeze(),a},lo.defineArrowheadGeometry=function(a,y){var x=null;typeof y=="string"?x=ut.parse(y,!1):x=y,y=a.toLowerCase(),y!=="none"&&a!==y||at("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var E=Yh;E[a]=x,E[y]=a};function Iv(){this.nc=!1,this.Hr="butt",this.Ir="miter",this.Jr=10,this.uj=0,this.br=null,this.jq=qr,this.gg=this.fg=or}Iv.prototype.copy=function(){var a=new Iv;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 ja(a,y){return Ft.call(this),s0||(Nl=Ja?new yl(null).context:null,s0=!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}_t(ja,Ft),ja.prototype.cloneProtected=function(a){Ft.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 Nh(a){a.da===null?a.da=new Wv:a.da.nc&&(a.da=a.da.copy())}be=ja.prototype,be.th=function(){Ft.prototype.th.call(this),this.da!==null&&(this.da.nc=!0)};function x1(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}be.qb=function(a){a.classType===ja?this.wrap=a:Ft.prototype.qb.call(this,a)},be.toString=function(){return 22<this.ec.length?'TextBlock("'+this.ec.substring(0,20)+'"...)':'TextBlock("'+this.ec+'")'},be.v=function(){Ft.prototype.v.call(this)},be.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,ee=Yp(this),re=a.textAlign=this.textAlign,oe=y.tn;re==="start"?re=oe?"right":"left":re==="end"&&(re=oe?"left":"right"),oe=this.isUnderline;var ue=this.isStrikethrough;Qa(this,a,this.xc,!0,!1,x,E),(oe||ue)&&Qa(this,a,this.xc,!1,!1,x,E),E=0,x=!1;var he=this.oe,pe=he.dx-(ee*he.m21+he.dx);he=he.dy-(ee*he.m22+he.dy);var Se=y.scale;switch(8>(pe*pe+he*he)*Se*Se&&(x=!0),y.ib!==a&&(x=!1),y.ib instanceof da&&(x=!1),y.Gf("textGreeking")===!1&&(x=!1),y=this.spacingAbove,pe=this.spacingBelow,this.flip){case jo:a.translate(b,0),a.scale(-1,1);break;case ho:a.translate(0,z),a.scale(1,-1);break;case xa:a.translate(b,z),a.scale(-1,-1)}if(a.yc(),he=this.Gc,Se=(y+ee+pe)*he,z>Se&&(E=this.verticalAlignment,E=E.y*z-E.y*Se+E.offsetY),he===1&&this.ze!==null)pe=this.Cb,pe>b&&(pe=b),this.Oj(this.ze,a,0,E+y,b,ee,pe,x,re,oe,ue);else if(this.Qc!==null&&this.Qb!==null)for(Se=0;Se<he;Se++){var Pe=this.Qc[Se];Pe>b&&(Pe=b),E+=y,this.Oj(this.Qb[Se],a,0,E,b,ee,Pe,x,re,oe,ue),E+=ee+pe}switch(this.flip){case jo:a.scale(-1,1),a.translate(-b,0);break;case ho:a.scale(1,-1),a.translate(0,-z);break;case xa:a.scale(-1,-1),a.translate(-b,-z)}}},be.Oj=function(a,y,x,E,b,z,ee,re,oe,ue,he){var pe=0;if(re)oe==="left"?pe=0:oe==="right"?pe=b-ee:oe==="center"&&(pe=(b-ee)/2),y.fillRect(x+pe,E+.25*z,ee,1);else{if(oe==="left"?pe=0:oe==="right"?pe=b:oe==="center"&&(pe=b/2),b=i0!==null?i0(this,z):.75*z,y.fillText(a,x+pe,E+b),a=z/20|0,a===0&&(a=1),oe==="right"?pe-=ee:oe==="center"&&(pe-=ee/2),ue){re=r0!==null?r0(this,z):.8*z,oe=x+pe,ue=E+re,b=x+pe+ee,re=E+re;var Se=a;y.beginPath(),y.lineWidth=Se,y.moveTo(oe,ue),y.lineTo(b,re),y.stroke(),y.Se(),y instanceof da&&y.ad.classList.add("gojs-td")}he&&(he=E+z-z/2.2|0,a%2!==0&&(he+=.5),E=x+pe,z=he,x=x+pe+ee,ee=he,pe=a,y.beginPath(),y.lineWidth=pe,y.moveTo(E,z),y.lineTo(x,ee),y.stroke(),y.Se(),y instanceof da&&y.ad.classList.add("gojs-td"))}},be.kk=function(a,y,x){if(!Ft.prototype.kk.call(this,a,y,x))return!1;if(Qa(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++)Zl(a,y[x],!1)}else y=this.svg,y.innerHTML=this.text,Zl(a,y,!0);return!0},be.nk=function(a){return 1<this.lineCount||this.isUnderline||this.isStrikethrough?!0:Ft.prototype.nk.call(this,a)},be.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)}},be.Wl=function(a,y,x,E){var b=this.Gc;this.Ih=a,this.l&=-16777217;var z=this.Ae;Nl!==null&&F1!==z&&(F1=Nl.font=z),this.Cb=this.Le=0,this.ze=this.Qb=this.Qc=this.df=null;var ee;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 re=ee=0,oe=!1;!oe;){var ue=z.indexOf(`
`,re);ue===-1&&(ue=z.length,oe=!0),re=z.substr(re,ue-re),this.formatting===Xp&&(re=re.trim()),ee=Math.max(ee,$u(re)),re=ue+1}z=ee}else ee=z.indexOf(`
`,0),0<=ee&&(z=z.substr(0,ee)),z=$u(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)),ee=w1(this,z),isNaN(this.desiredSize.height)?ee=Math.min(ee,y/this.scale):ee=this.desiredSize.height,oe=ee,this.Cb!==0&&this.Qc!==null&&this.Qb!==null&&this.overflow===o0&&(y=this.Ae,y=this.overflow===o0?S1(y):0,ue=this.spacingAbove+this.spacingBelow,ue=Math.max(0,Yp(this)+ue),oe=Math.min(this.maxLines-1,Math.max(Math.floor(oe/ue+.01)-1,0)),!(oe+1>=this.Qb.length))){for(this.l|=16777216,ue=this.Qb[oe],y=Math.max(1,a-y);$u(ue)>y&&1<ue.length;)ue=ue.substr(0,ue.length-1);ue+=Jp,y=$u(ue),this.Qb[oe]=ue,this.Qb=this.Qb.slice(0,oe+1),this.Qc[oe]=y,this.Qc=this.Qc.slice(0,oe+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),ee=Math.max(E,ee),qo(this.dc,z,ee),this.Ge(0,0,z,ee),this.svg!==null&&b!==this.Gc&&(this.Uc=!0)},be.eh=function(a,y,x,E){nl(this,a,y,x,E)};function Up(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 Ov(a,y,x,E){var b=a.formatting===Xp;b&&(y=y.trim());var z=0,ee=a.Ae,re=a.spacingAbove+a.spacingBelow;re=Math.max(0,Yp(a)+re);var oe=a.overflow===o0?S1(ee):0;if(a.Gc>=a.maxLines)E!==null&&E.h(0,re);else if(ee=y,a.wrap===Rv){a.Le=1;var ue=$u(y);if(oe===0||ue<=x)a.Cb=Math.max(a.Cb,ue),Up(a,y,a.Cb),E!==null&&E.h(ue,re);else{for(z=up(a,ee),ee=ee.substr(z.length),y=up(a,ee),ue=$u(z+y);0<y.length&&ue<=x;)z+=y,ee=ee.substr(y.length),y=up(a,ee),ue=z+y,b&&(ue=ue.trim()),ue=$u(ue);for(b&&(y=y.trim()),z+=y,x=Math.max(1,x-oe);$u(z)>x&&1<z.length;)z=z.substr(0,z.length-1);a.l|=16777216,z+=Jp;var he=$u(z);a.Cb=he,Up(a,z,he),E!==null&&E.h(he,re)}}else{for(oe=0,ee.length===0&&(oe=1,Up(a,ee,0));0<ee.length;){for(y=up(a,ee),ee=ee.substr(y.length);$u(y)>x;){var pe=1;for(ue=$u(y.substr(0,pe)),he=0;ue<=x;)pe++,he=ue,ue=$u(y.substr(0,pe));if(pe===1){var Se=ue;z=Math.max(z,ue)}else Se=he,z=Math.max(z,he);if(pe--,1>pe&&(pe=1),Up(a,y.substr(0,pe),Se),oe++,y=y.substr(pe),a.Gc+oe>a.maxLines)break}for(he=up(a,ee),ue=$u(y+he);0<he.length&&ue<=x;)y+=he,ee=ee.substr(he.length),he=up(a,ee),ue=y+he,b&&(ue=ue.trim()),ue=$u(ue);if(b&&(y=y.trim()),y!==""&&(y[y.length-1]==="\xAD"&&(y=y.substring(0,y.length-1)+"\u2010"),he.length===0?(pe=ue,z=Math.max(z,ue)):(pe=he=$u(y),z=Math.max(z,he)),Up(a,y,pe),oe++,a.Gc+oe>a.maxLines))break}a.Le=Math.min(a.maxLines,oe),a.Cb=Math.max(a.Cb,z),E!==null&&E.h(a.Cb,re*a.Le)}}function up(a,y){if(a.wrap===E1)return y.substr(0,1);for(var x=y.length,E=0,b=xS;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 $u(a){return Nl===null?8*a.length:Nl.measureText(a).width}function Yp(a){if(a.df!==null)return a.df;var y=a.Ae;if(Nl===null){var x=16;return a.df=x}return Zv[y]!==void 0&&5e3>b1?x=Zv[y]:(x=1.3*Nl.measureText("M").width,Zv[y]=x,b1++),a.df=x}function S1(a){if(Nl===null)return 6;if(a0[a]!==void 0&&5e3>Gv)var y=a0[a];else y=Nl.measureText(Jp).width,a0[a]=y,Gv++;return y}function w1(a,y){var x=a.ec.replace(/\r\n/g,`
`).replace(/\r/g,`
`),E=a.spacingAbove+a.spacingBelow;if(E=Math.max(0,Yp(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,ee,re=!1;!re;){if(ee=x.indexOf(`
`,z),ee===-1&&(ee=x.length,re=!0),z<=ee){if(z=x.substr(z,ee-z),a.wrap!==Rv){a.Le=0;var oe=Pn.alloc();Ov(a,z,y,oe),b+=oe.height,Pn.free(oe),a.Gc+=a.Le}else Ov(a,z,y,null),b+=E,a.Gc++;a.Gc===a.maxLines&&(re=!0)}z=ee+1}return a.Lq=b}fn.Object.defineProperties(ja.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"||(Nh(this),this.da.Or=a,this.N(),this.g("textAlign",y,a))}},flip:{get:function(){return this.da!==null?this.da.Xf:kn},set:function(a){var y=this.flip;y!==a&&(Nh(this),this.da.Xf=a,this.N(),this.g("flip",y,a))}},verticalAlignment:{get:function(){return this.da!==null?this.da.Yr:Ta},set:function(a){var y=this.verticalAlignment;y.D(a)||(a=a.J(),Nh(this),this.da.Yr=a,il(this),this.g("verticalAlignment",y,a))}},naturalBounds:{get:function(){if(!this.dc.w()){var a=Pn.alloc();Ov(this,this.ec,999999,a);var y=a.width;Pn.free(a),a=w1(this,y);var x=this.desiredSize;isNaN(x.width)||(y=x.width),isNaN(x.height)||(a=x.height),qo(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:jv},set:function(a){var y=this.wrap;y!==a&&(Nh(this),this.da.$r=a,this.v(),this.g("wrap",y,a))}},overflow:{get:function(){return this.da!==null?this.da.$q:zv},set:function(a){var y=this.overflow;y!==a&&(Nh(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&&Qd(a,"TextBlock.stroke"),a instanceof $o&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},lineCount:{get:function(){return this.Gc}},lineHeight:{get:function(){return Yp(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&&(Nh(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&&(Nh(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 Xh),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 Xh),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 Xh),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 Xh),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 Xh),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&&(Nh(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&&(Nh(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&&(Nh(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&&(Nh(this),this.da.Er=a,this.v(),this.g("spacingBelow",y,a))}},formatting:{get:function(){return this.da!==null?this.da.gq:Xp},set:function(a){var y=this.formatting;y!==a&&(Nh(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&&Kn(a,"> 0",ja,"maxLines"),Nh(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 i0=null,r0=null,Rv=new Ot(ja,"None",0),P1=new Ot(ja,"WrapFit",1),jv=new Ot(ja,"WrapDesiredSize",2),E1=new Ot(ja,"WrapBreakAll",3),zv=new Ot(ja,"OverflowClip",0),o0=new Ot(ja,"OverflowEllipsis",1),Xp=new Ot(ja,"FormatTrim",0),C1=new Ot(ja,"FormatNone",0),xS=/[ \u200b\u00ad]/,Zv=new Ri,b1=0,a0=new Ri,Gv=0,Jp="...",F1="",Nl=null,s0=!1;ja.className="TextBlock";function Wv(){this.nc=!1,this.Hd=null,this.Xf=kn,this.gq=Xp,this.Jq=1/0,this.$q=zv,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=Ta,this.$r=jv}Wv.prototype.copy=function(){var a=new Wv;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},ja.getEllipsis=function(){return Jp},ja.setEllipsis=function(a){Jp=a,a0=new Ri,Gv=0},ja.getBaseline=function(){return i0},ja.setBaseline=function(a){i0=a},ja.getUnderline=function(){return r0},ja.setUnderline=function(a){r0=a},ja.isValidFont=function(a){if(s0||(Nl=Ja?new yl(null).context:null,s0=!0),Nl===null)return!0;var y=Nl.font;if(a===y||a==="10px sans-serif")return!0;Nl.font="10px sans-serif",Nl.font=a;var x=Nl.font;if(x!=="10px sans-serif")return Nl.font=y,!0;Nl.font="19px serif";var E=Nl.font;return Nl.font=a,x=Nl.font,Nl.font=y,x!==E},ja.FormatNone=C1,ja.FormatTrim=Xp,ja.None=Rv,ja.OverflowClip=zv,ja.OverflowEllipsis=o0,ja.WrapBreakAll=E1,ja.WrapDesiredSize=jv,ja.WrapFit=P1;function Xh(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}Xh.prototype.copy=function(){var a=new Xh;return a.Tk=this.Tk,a.u=this.u,a.j=this.j,a.F=this.F,a.o=this.o,a},Xh.className="GradElementSettings";function Dl(a,y){Ft.call(this),this.Eg=null,this.qo="",this.Xg=ls,this.Nk=jn,this.Zg=this.Hd=null,this.Mk=Kr,this.Xf=kn,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 hp;_t(Dl,Ft),Dl.prototype.cloneProtected=function(a){Ft.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},Dl.prototype.qb=function(a){a===kn||a===ir||a===Ao?this.imageStretch=a:Ft.prototype.qb.call(this,a)},Dl.prototype.toString=function(){return"Picture("+this.source+")#"+wr(this)};function dp(a){a===void 0&&(a=""),a!==""?hp[a]&&(delete hp[a],l0--):(hp=new Ri,l0=0)}function L1(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")||"",ee=b.Og.I(z);if(ee!==null)for(var re=ee.length,oe=0;oe<re;oe++)z=ee[oe],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()||(gt(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")||"",ee=b.Og.I(z);if(ee!==null){b=ee.length,z=xi();for(var re=0;re<b;re++)z.push(ee[re]);if(y.hn)for(re=0;re<b;re++)ee=z[re],ee.Hd!==null&&ee.Hd(ee,x);Bi(z)}}y.Bg.clear()}},y.addEventListener("load",y.Fq),y.addEventListener("error",y.Yp),y.qy=!0)}Dl.prototype.hA=function(){if(this.source!==""){dp(this.source);var a=this.source;this.source="",this.source=a}},Dl.prototype.redraw=function(){this.N(),this.Uc=!0},Dl.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 Au)){var b=a instanceof da;E=this.naturalBounds;var z=0,ee=0,re=this.qn,oe=re?+x.width:x.naturalWidth;if(re=re?+x.height:x.naturalHeight,oe===void 0&&x.videoWidth&&(oe=x.videoWidth),re===void 0&&x.videoHeight&&(re=x.videoHeight),oe=oe||E.width,re=re||E.height,oe!==0&&re!==0){var ue=oe,he=re;this.sourceRect.w()&&(z=this.Xg.x,ee=this.Xg.y,oe=this.Xg.width,re=this.Xg.height);var pe=oe,Se=re,Pe=this.Nk,Fe=this.Mk;switch(Pe){case kn:if(this.sourceRect.w())break;pe>=E.width&&(z=z+Fe.offsetX+(pe*Fe.x-E.width*Fe.x)),Se>=E.height&&(ee=ee+Fe.offsetY+(Se*Fe.y-E.height*Fe.y)),oe=Math.min(E.width,pe),re=Math.min(E.height,Se);break;case jn:pe=E.width,Se=E.height;break;case ir:case Ao:Pe===ir?(Pe=Math.min(E.height/Se,E.width/pe),pe*=Pe,Se*=Pe):Pe===Ao&&(Pe=Math.max(E.height/Se,E.width/pe),pe*=Pe,Se*=Pe,pe>=E.width&&(z=(z+Fe.offsetX+(pe*Fe.x-E.width*Fe.x)/pe)*oe),Se>=E.height&&(ee=(ee+Fe.offsetY+(Se*Fe.y-E.height*Fe.y)/Se)*re),oe*=1/(pe/E.width),re*=1/(Se/E.height),pe=E.width,Se=E.height)}Pe=this.Df()*y.scale;var Ne=pe*Pe*Se*Pe,Xe=oe*re/Ne,Ve=x.__goCache;Pe=null;var ht=SS;if(!b){if(x.sq&&Ve!==void 0&&4<Ne&&Xe>ht*ht)for(Ve.gi===null&&(M1(Ve,4,ue,he,x),M1(Ve,16,ue,he,x)),b=Ve.gi,ue=b.length,he=0;he<ue&&b[he].ratio*b[he].ratio<Xe;he++)Pe=b[he];if(!y.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{b=new yl(null).context;try{b.drawImage(this.Eg,0,0)}catch(ft){this.en=!1}try{b.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(ft){this.vl=!0}}if(this.vl)return}}switch(b=pe<E.width?Fe.offsetX+(E.width*Fe.x-pe*Fe.x):0,Fe=Se<E.height?Fe.offsetY+(E.height*Fe.y-Se*Fe.y):0,this.flip){case jo:a.translate(Math.min(E.width,pe),0),a.scale(-1,1);break;case ho:a.translate(0,Math.min(E.height,Se)),a.scale(1,-1);break;case xa:a.translate(Math.min(E.width,pe),Math.min(E.height,Se)),a.scale(-1,-1)}if(a.yc(),y.Gf("pictureRatioOptimization")&&!y.$i&&Ve!==void 0&&Pe!==null&&Pe.ratio!==1){a.save(),y=Pe.ratio;try{a.drawImage(Pe.source,z/y,ee/y,Math.min(Pe.source.width,oe/y),Math.min(Pe.source.height,re/y),b,Fe,Math.min(E.width,pe),Math.min(E.height,Se)),a instanceof da&&(this.bt=[z/y,ee/y,Math.min(Pe.source.width,oe/y),Math.min(Pe.source.height,re/y),b,Fe,Math.min(E.width,pe),Math.min(E.height,Se)])}catch(ft){this.en=!1}a.restore()}else try{a.drawImage(x,z,ee,oe,re,b,Fe,Math.min(E.width,pe),Math.min(E.height,Se)),a instanceof da&&(this.bt=[z,ee,oe,re,b,Fe,Math.min(E.width,pe),Math.min(E.height,Se)])}catch(ft){this.en=!1}switch(this.flip){case jo:a.scale(-1,1),a.translate(-Math.min(E.width,pe),0);break;case ho:a.scale(1,-1),a.translate(0,-Math.min(E.height,Se));break;case xa:a.scale(-1,-1),a.translate(-Math.min(E.width,pe),-Math.min(E.height,Se))}}}}},Dl.prototype.Wl=function(a,y,x,E){var b=this.desiredSize,z=ul(this,!0),ee=this.Eg,re=this.qn,oe=0,ue=0;(re||!this.al&&ee&&ee.complete)&&(this.al=!0),ee===null?(isFinite(b.width)||(a=0),isFinite(b.height)||(y=0)):(oe=re?+ee.width:ee.naturalWidth,ue=re?+ee.height:ee.naturalHeight),isFinite(b.width)||z===jn||z===hr?(isFinite(a)||(this.sourceRect.w()?a=this.sourceRect.width:ee!==null&&(a=oe)),x=0):ee!==null&&this.al!==!1&&(a=this.sourceRect.w()?this.sourceRect.width:oe),isFinite(b.height)||z===jn||z===Lr?(isFinite(y)||(this.sourceRect.w()?y=this.sourceRect.height:ee!==null&&(y=ue)),E=0):ee!==null&&this.al!==!1&&(y=this.sourceRect.w()?this.sourceRect.height:ue),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),ee===null||ee.complete||(isFinite(a)||(a=0),isFinite(y)||(y=0)),qo(this.dc,a,y),this.Ge(0,0,a,y)},Dl.prototype.eh=function(a,y,x,E){nl(this,a,y,x,E)},fn.Object.defineProperties(Dl.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||at("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);var E=this.diagram;E!==null&&ug(E,this),this.Eg=a,a!==null&&x&&a.Bg===void 0&&(a.Bg=new In),E!==null&&x&&md(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()||(gt(this,!1),this.v())):x&&L1(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=hp;if(Ja){var E=null;if(x[a]!==void 0)E=x[a];else if(a!==""){30<l0&&(dp(),x=hp),E=Yn("img"),E.hn=!0,L1(this,E);var b=this.rl;b!==null&&(E.crossOrigin=b(this)),E.src=a,x[a]=E,l0++}this.element=E,E!==null&&E.__goCache===void 0&&(E.__goCache=new B1),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}}}),Dl.prototype.redraw=Dl.prototype.redraw,Dl.prototype.reloadSource=Dl.prototype.hA;var l0=0,SS=4;Dl.className="Picture",hp=new Ri,Dl.clearCache=dp;function B1(){this.gi=null}function M1(a,y,x,E,b){a.gi===null&&(a.gi=[]);var z=new yl(null),ee=z.context,re=1/y;z.width=x/y,z.height=E/y,z.width!==0&&z.height!==0&&(y=new k1(z.Oa,y),x=1,0<a.gi.length&&(x=a.gi[a.gi.length-1],b=x.source,x=x.ratio),ee.setTransform(re*x,0,0,re*x,0,0),ee.yc(),ee.drawImage(b,0,0),a.gi.push(y))}B1.className="PictureCacheArray";function k1(a,y){this.source=a,this.ratio=y}k1.className="PictureCacheInstance";function cp(){this.os=new ut,this.mc=null}cp.prototype.reset=function(a){a!==null?(a.ka(),this.os=a,a.figures.clear()):this.os=new ut,this.mc=null};function fp(a,y,x,E,b,z){a.mc=new Zr,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 wS(a){var y=a.mc.segments.length;0<y&&a.mc.segments.M(y-1).close()}cp.prototype.moveTo=function(a,y,x){x===void 0&&(x=!1);var E=new mr(Ei);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)},cp.prototype.lineTo=function(a,y,x){x===void 0&&(x=!1);var E=new mr(bi);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)};function tc(a,y,x,E,b,z,ee){var re;re===void 0&&(re=!1);var oe=new mr(Jr);oe.point1X=y,oe.point1Y=x,oe.point2X=E,oe.point2Y=b,oe.endX=z,oe.endY=ee,re&&oe.close(),a.mc.segments.add(oe)}function u0(a,y,x,E,b){var z;z===void 0&&(z=!1);var ee=new mr(Ur);ee.point1X=y,ee.point1Y=x,ee.endX=E,ee.endY=b,z&&ee.close(),a.mc.segments.add(ee)}cp.prototype.arcTo=function(a,y,x,E,b,z,ee){z===void 0&&(z=0),ee===void 0&&(ee=!1);var re=new mr(Mr);re.startAngle=a,re.sweepAngle=y,re.centerX=x,re.centerY=E,re.radiusX=b,re.radiusY=z!==0?z:b,ee&&re.close(),this.mc.segments.add(re)};function PS(a,y,x,E,b,z,ee,re){var oe;oe===void 0&&(oe=!1),y=new mr(Fo,ee,re,y,x,E,b,z),oe&&y.close(),a.mc.segments.add(y)}function A1(a){var y=h0;return y!==null?(h0=null,y.reset(a),y):(y=new cp,y.reset(a),y)}var h0=null;cp.className="StreamGeometryContext";function ol(a,y){var x=a.toLowerCase(),E=Re.Ze;E[a]=y,E[x]=a}ol("Rectangle",function(a,y,x){a="r"+y+","+x;var E=Re.Mf[a];return E!==void 0||(E=new ut(ut.u),E.endX=y,E.endY=x,Re.Nf<Re.vm&&(Re.Mf[a]=E,Re.Nf++)),E}),ol("Square",function(a,y,x){a="s"+y+","+x;var E=Re.Mf[a];return E!==void 0||(E=new ut(ut.u),E.endX=y,E.endY=x,E.defaultStretch=ir,Re.Nf<Re.vm&&(Re.Mf[a]=E,Re.Nf++)),E}),ol("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=Re.Mf[E];if(b!==void 0)return b;var z=a*Re.wg;return b=new ut().add(new Zr(a,0,!0).add(new mr(bi,y-a,0)).add(new mr(Jr,y,a,y-z,0,y,z)).add(new mr(bi,y,x-a)).add(new mr(Jr,y-a,x,y,x-z,y-z,x)).add(new mr(bi,a,x)).add(new mr(Jr,0,x-a,z,x,0,x-z)).add(new mr(bi,0,a)).add(new mr(Jr,a,0,0,z,z,0).close())),1<z&&(b.spot1=new Xi(0,0,z,z),b.spot2=new Xi(1,1,-z,-z)),Re.Nf<Re.vm&&(Re.Mf[E]=b,Re.Nf++),b}),ol("Border","RoundedRectangle"),ol("Ellipse",function(a,y,x){a="e"+y+","+x;var E=Re.Mf[a];return E!==void 0||(E=new ut(ut.F),E.endX=y,E.endY=x,E.spot1=Ba,E.spot2=ra,Re.Nf<Re.vm&&(Re.Mf[a]=E,Re.Nf++)),E}),ol("Circle",function(a,y,x){a="c"+y+","+x;var E=Re.Mf[a];return E!==void 0||(E=new ut(ut.F),E.endX=y,E.endY=x,E.spot1=Ba,E.spot2=ra,E.defaultStretch=ir,Re.Nf<Re.vm&&(Re.Mf[a]=E,Re.Nf++)),E}),ol("TriangleRight",function(a,y,x){return new ut().add(new Zr(0,0).add(new mr(bi,y,.5*x)).add(new mr(bi,0,x).close())).pm(0,.25,.5,.75)}),ol("TriangleDown",function(a,y,x){return new ut().add(new Zr(0,0).add(new mr(bi,y,0)).add(new mr(bi,.5*y,x).close())).pm(.25,0,.75,.5)}),ol("TriangleLeft",function(a,y,x){return new ut().add(new Zr(y,x).add(new mr(bi,0,.5*x)).add(new mr(bi,y,0).close())).pm(.5,.25,1,.75)}),ol("TriangleUp",function(a,y,x){return new ut().add(new Zr(y,x).add(new mr(bi,0,x)).add(new mr(bi,.5*y,0).close())).pm(.25,.5,.75,1)}),ol("Triangle","TriangleUp"),ol("Diamond",function(a,y,x){return new ut().add(new Zr(.5*y,0).add(new mr(bi,0,.5*x)).add(new mr(bi,.5*y,x)).add(new mr(bi,y,.5*x).close())).pm(.25,.25,.75,.75)}),ol("LineH",function(a,y,x){return a=new ut(ut.j),a.startX=0,a.startY=x/2,a.endX=y,a.endY=x/2,a}),ol("LineV",function(a,y,x){return a=new ut(ut.j),a.startX=y/2,a.startY=0,a.endX=y/2,a.endY=x,a}),ol("None","Rectangle"),ol("BarH","Rectangle"),ol("BarV","Rectangle"),ol("MinusLine","LineH"),ol("PlusLine",function(a,y,x){return new ut().add(new Zr(0,x/2,!1).add(new mr(bi,y,x/2)).add(new mr(Ei,y/2,0)).add(new mr(bi,y/2,x)))}),ol("XLine",function(a,y,x){return new ut().add(new Zr(0,x,!1).add(new mr(bi,y,0)).add(new mr(Ei,0,0)).add(new mr(bi,y,x)))}),ol("LineRight",function(a,y,x){return new ut().add(new Zr(.25*y,0,!1).add(new mr(bi,.75*y,.5*x)).add(new mr(bi,.25*y,x)))}),ol("LineDown",function(a,y,x){return new ut().add(new Zr(0,.25*x,!1).add(new mr(bi,.5*y,.75*x)).add(new mr(bi,y,.25*x)))}),ol("LineLeft",function(a,y,x){return new ut().add(new Zr(.75*y,0,!1).add(new mr(bi,.25*y,.5*x)).add(new mr(bi,.75*y,x)))}),ol("LineUp",function(a,y,x){return new ut().add(new Zr(0,.75*x,!1).add(new mr(bi,.5*y,.25*x)).add(new mr(bi,y,.75*x)))}),Re.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 Hv(){this.nc=!1,this.tr=this.Kp=this.zq=null,this.vr="",this.fr=this.oq=this.ur=null,this.hr="",this.gr=ua,this.ir=null,this.jr="",this.lr=or,this.Gq="",this.Hq=Co,this.Pq=Ci,this.Kq=Oi,this.Up=null,this.Cq=127,this.zr=qi,this.yr="gray",this.Vg=4}Hv.prototype.copy=function(){var a=new Hv;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 pr(a,y){a===void 0||a instanceof Cs||typeof a=="string"?Wn.call(this,a):(Wn.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 Ie(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new Gt,this.Rh=null,this.ag=NaN,y&&Object.assign(this,y)}_t(pr,Wn),pr.prototype.cloneProtected=function(a){Wn.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},be=pr.prototype,be.Af=function(a){Wn.prototype.Af.call(this,a),a.oh(),a.Ug=null,a.nf=null,a.Rh=null},be.toString=function(){var a=Ii(this.constructor)+"#"+wr(this);return this.data!==null&&(a+="("+Pr(this.data)+")"),a};function Tl(a){a.P===null?a.P=new Hv:a.P.nc&&(a.P=a.P.copy())}be.th=function(){Wn.prototype.th.call(this),this.P!==null&&(this.P.nc=!0)},be.gk=function(a,y,x,E,b,z,ee){var re=this.diagram;re!==null&&(a===Go&&y==="elements"?b instanceof Wn?Nf(b,function(oe){vy(re.partManager,oe),Vd(re,oe)}):md(re,b):a===ha&&y==="elements"&&(b instanceof Wn?Nf(b,function(oe){yy(re.partManager,oe,re)}):ug(re,b)),re.cb(a,y,x,E,b,z,ee))},be.La=function(a){if(Wn.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 Wn&&Nf(b,function(z){z.data!==null&&z.La()})}for(y=this.adornments;y.next();)y.value.La(a)}},pr.prototype.updateRelationshipsFromData=function(){var a;this.data!==null&&((a=this.diagram)===null||a===void 0||a.partManager.updateRelationshipsFromData(this))},pr.prototype.Pj=function(a){var y=this.Qf;return y===null?null:y.I(a)},pr.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 Rt),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)))}}},pr.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)}},pr.prototype.Ej=function(){var a=this.Qf;if(a!==null){var y=xi();for(a=a.iterator;a.next();)y.push(a.key);a=y.length;for(var x=0;x<a;x++)this.Jf(y[x]);Bi(y)}},pr.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()}e:{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 no?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate),!(x instanceof Yo))break e;Tu(x),x=x.copy(),x!==null&&(this.ph()&&this.selectionObject===this.path&&(x.type=Wn.Link),x.adornedObject=y)}if(x!==null){x.type===Wn.Link&&x.v(),this.bh("Selection",x);break e}}this.Jf("Selection")}for(ES(this,a),y=this.adornments;y.next();)y.value.La()}},pr.prototype.Wb=function(){var a=this.diagram;a!==null&&(a.vd=!0,!(this.G&16384)&&(this.G|=16384))};function Vv(a){a.G&16384&&(a.updateAdornments(),a.G&=-16385)}function ES(a,y){y.toolManager.mouseDownTools.each(function(x){x.isEnabled&&x.updateAdornments(a)}),y.toolManager.updateAdornments(a)}function d0(a){if(Wc(a)===!1){Uv(a,!0),a.Uk();var y=a.diagram;y!==null&&(y.De.add(a),y.$b())}}function N1(a){if(a.G|=2097152,Wc(a)!==!1){var y=a.position,x=a.location;x.w()&&y.w()||_1(a,y,x),x=a.Ib;var E=Gt.alloc().assign(x);x.ka(),x.x=y.x,x.y=y.y,x.freeze(),a.Xl(E,x),Gt.free(E),Uv(a,!1)}}pr.prototype.Ge=function(a,y,x,E){var b=this.uc;b.h(a,y,x,E),this.Lb===null&&(this.Lb=new pt);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),this.Lb=z,z.ws()||z.pp(b)},pr.prototype.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=Kr;this.locationSpot.sb()&&(z=this.locationSpot);var ee=Ie.alloc();if(this.locationObject!==this)for(y=this.locationObject,x=y.naturalBounds,ee.yi(x.x,x.y,x.width,x.height,z),y.Lb!==null&&y.Lb.Ga(ee),ee.offset(-y.measuredBounds.x,-y.measuredBounds.y),z=y.panel;z!==null&&z!==this;)z.Lb!==null&&z.Lb.Ga(ee),ee.offset(-z.measuredBounds.x,-z.measuredBounds.y),z=z.panel;else ee.yi(y,x,E,b,z);a.rotate(this.Kb,ee.x,ee.y),Ie.free(ee)}},pr.prototype.move=function(a,y){y===!0?this.location=a:this.position=a},pr.prototype.moveTo=function(a,y,x){a=Ie.allocAt(a,y),this.move(a,x),Ie.free(a)},pr.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())},pr.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())},pr.prototype.fb=function(a){if(this.name===a)return this;var y=this.Rh;if(y===null&&(this.Rh=y=new Rt),y.I(a)!==null)return y.I(a);var x=Wn.prototype.fb.call(this,a);return x!==null?(y.set(a,x),x):(y.set(a,null),null)};function nc(a,y,x,E){E===void 0&&(E=new Ie),x=x.Mc()?Kr: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}pr.prototype.mi=function(a){return a===void 0&&(a=new Gt),a.assign(this.actualBounds)},pr.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function D1(a){var y=Ie.alloc(),x=a.locationObject,E=x.naturalBounds,b=x instanceof lo?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 _f(a,y){var x=a.py;isNaN(a.ag)&&(a.ag=h1(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 ee=a.shadowBlur;return a=a.shadowOffset,z+=ee,y+=ee,E-=ee/2,b-=ee/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}pr.prototype.arrange=function(){if(xt(this)===!1)N1(this);else{Jt(this,!1);var a=this.Ib,y=Gt.alloc();y.assign(a);var x=Hc(this);this.eh(0,0,this.uc.width,this.uc.height);var E=this.position;_1(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()||Re.B(y.width,a.width)&&Re.B(y.height,a.height)||0<=this.vw&&this.C(16),Gt.free(y),Uv(this,!1)}},be=pr.prototype,be.Xl=function(a,y){var x=this.diagram;if(x!==null){var E=!1;if(x.Zi===!1&&a.w()){var b=Gt.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),Gt.free(b)}!(this.G&65536)&&a.D(y)||R1(this,E,x),x.N(),!a.w()&&!y.w()||zr(a,y)||(this instanceof Fi&&!x.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}},be.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 Ie(E.x+(a.x-y),E.y+(a.y-x)),this.g("location",E,this.ke.copy())),Wc(this)===!1&&xt(this)===!1&&(d0(this),N1(this)),!0};function T1(a,y,x,E,b){y===null||a instanceof Yo||(y=y.animationManager,y.zb&&gf(y,a,new Ie(E,b),x))}be.mm=function(a,y,x){var E=this.ke,b=this.pa;if(x){if(E.x===a&&E.y===y)return;Wc(this)||xt(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)}d0(this)},be.Av=function(){this.G&=-2097153,d0(this)};function _1(a,y,x){var E=D1(a),b=a.diagram,z=x.w(),ee=y.w();z&&ee?a.G&2097152?I1(a,y,x,b,E):O1(a,y,x,b,E):z?I1(a,y,x,b,E):ee&&O1(a,y,x,b,E),a.G|=2097152,Ie.free(E),a.Uk()}function I1(a,y,x,E,b){var z=y.x,ee=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 Yo||gf(x,a,new Ie(z,ee),y),E||y.x===z&&y.y===ee||a.g("position",new Ie(z,ee),y.copy()))}function O1(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 R1(a,y,x){Yv(a,!1),a instanceof Fi&&Vh(x,a),a.layer.isTemporary||y||x.Ya(),y=a.Ib;var E=x.viewportBounds;E.w()?Hc(a)?(ma(y,E)||a.Fd(!1),a.updateAdornments()):a.isVisible()&&y.Yc(E)?(a.Fd(!0),a.updateAdornments()):a.Wb():x.vd=!0}be.si=function(){return!0},be.Zc=function(){return!0},be.ph=function(){return!1},be.Dd=function(){return!0};function Kv(a,y,x,E){y.constructor===a.constructor||Z1||(Z1=!0,li('Should not change the class of the Part when changing category from "'+x+'" to "'+E+'"'),li(" Old class: "+Ii(a.constructor)+", new class: "+Ii(y.constructor)+", part: "+a.toString())),a.Ej();var b=a.data;x=a.layerName;var z=a.isSelected,ee=a.isHighlighted,re=!0,oe=!0,ue=!1;a instanceof Fi&&(re=a.isTreeLeaf,oe=a.isTreeExpanded,ue=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=ee?a.G|524288:a.G&-524289,a instanceof Fi&&(a.U=re?a.U|4:a.U&-5,a.U=oe?a.U|1:a.U&-2,a.U=ue?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)}pr.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},pr.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},pr.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},pr.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},pr.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},pr.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},pr.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},pr.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},pr.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 Wc(a){return(a.G&32768)!==0}function Uv(a,y){a.G=y?a.G|32768:a.G&-32769}function Yv(a,y){a.G=y?a.G|65536:a.G&-65537}function Hc(a){return(a.G&131072)!==0}be=pr.prototype,be.Fd=function(a){this.G=a?this.G|131072:this.G&-131073};function c0(a,y){a.G=y?a.G|1048576:a.G&-1048577}be.oh=function(){var a=this.containingGroup;a!==null&&(a.v(),a.placeholder!==null&&a.placeholder.v(),a.Bd())},be.N=function(){var a=this.diagram;a!==null&&!xt(this)&&!Wc(this)&&this.isVisible()&&this.Ib.w()&&a.N(_f(this,this.Ib))},be.v=function(){Wn.prototype.v.call(this);var a=this.diagram;a!==null&&(a.De.add(this),this instanceof Fi&&this.labeledLink!==null&&il(this.labeledLink),a.$b(!0))},be.Vo=function(a){a||(a=this.Ah,a!==null&&ey(a,this))},be.Wo=function(a){a||(a=this.Ah,a!==null&&ty(a,this))},be.Lj=function(){var a=this.data;if(a!==null){var y=this.diagram;y!==null&&(y=y.model,y!==null&&y.cm(a))}},be.oz=function(){return Xv(this,this)};function Xv(a,y){var x=y.containingGroup;return x!==null?1+Xv(a,x):y instanceof Fi&&(y=y.labeledLink,y!==null)?Xv(a,y):0}be.sz=function(){return j1(this,this)};function j1(a,y){var x=y.containingGroup;return x!==null||y instanceof Fi&&(x=y.labeledLink,x!==null)?j1(a,x):y}be.Td=function(a){return a instanceof no?Jv(this,this,a):!1};function Jv(a,y,x){if(y===x||x===null)return!1;var E=y.containingGroup;return E===null||E!==x&&!Jv(a,E,x)?y instanceof Fi&&(y=y.labeledLink,y!==null)?Jv(a,y,x):!1:!0}be.px=function(a){if(a===null)return null;if(this===a)return this.containingGroup;for(var y=this;y!==null;){if(y instanceof no&&c0(y,!0),y instanceof Fi){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 Fi&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup}for(y=this;y!==null;)y instanceof no&&c0(y,!1),y instanceof Fi&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup;return x},pr.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return!(a!==null&&a.isTemporary||this instanceof Fi&&this.isLinkLabel)},pr.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 Fi&&this.isLinkLabel?y=!1:(y=this.diagram,y=!(y!==null&&y.undoManager.isUndoingRedoing))}else y=!1;if(y)if(y=this.Ah,y!==null){var x=y.layout;x!==null?x.C():y.C(a)}else a=this.diagram,a!==null&&(a=a.layout,a!==null&&a.C())};function z1(a){return a.isVisible()?(a=a.layer,!(a!==null&&a.isTemporary)):!1}function Vc(a,y,x,E,b,z){if(z===void 0&&(z=null),!(a.contains(y)||z!==null&&!z(y)||y instanceof Yo)){if(a.add(y),y instanceof Fi){if(x&&y instanceof no)for(var ee=y.memberParts;ee.next();)Vc(a,ee.value,x,E,b,z);if(b!==!1)for(ee=y.linksConnected;ee.next();){var re=ee.value;if(!a.contains(re)){var oe=re.fromNode,ue=re.toNode;oe=oe===null||a.contains(oe),ue=ue===null||a.contains(ue),(b?oe&&ue:oe||ue)&&Vc(a,re,x,E,b,z)}}if(1<E)for(y=y.Ou();y.next();)Vc(a,y.value,x,E-1,b,z)}else if(y instanceof $n)for(y=y.labelNodes;y.next();)Vc(a,y.value,x,E,b,z)}}fn.Object.defineProperties(pr.prototype,{key:{get:function(){var a=this.diagram;if(a!==null)return a.model.wa(this.data)}},adornments:{get:function(){return this.Qf===null?mo: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(ha,"parts",y,this,null,E,!0),E=a.oi(99999999,this,!0),y.visible!==a.visible&&this.Zb(a.visible),0<=E&&x.cb(Go,"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&&(Tl(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&&dd(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 Yo?this.type!==Wn.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:Ci},set:function(a){var y=this.minLocation;y.D(a)||(a=a.J(),Tl(this),this.P.Pq=a,this.g("minLocation",y,a))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:Oi},set:function(a){var y=this.maxLocation;y.D(a)||(a=a.J(),Tl(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&&(Tl(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:Co},set:function(a){var y=this.locationSpot;y.D(a)||(a=a.J(),Tl(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,xt(this)===!1&&(d0(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 Yo)){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 Yo?this instanceof Yo&&(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&&(Tu(x),x=x.copy(),x!==null&&Kv(this,x,y,a))):(z!==null&&z.jm(E,a),x=cx(x.partManager,E,a),x!==null&&(Tu(x),x=x.copy(),x===null||x instanceof $n||(E=this.location.copy(),Kv(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){Kv(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&&(Tl(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&&(Tl(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&&(Tl(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 $n?(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&&(Tl(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&&(Tl(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&&(Tl(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:ua},set:function(a){var y=this.resizeCellSize;y.D(a)||(a=a.J(),Tl(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&&(Tl(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&&(Tl(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:or},set:function(a){var y=this.rotationSpot;y.D(a)||(a=a.J(),Tl(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&&at("Cannot make a Group a member of itself: "+this.toString()),at("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString())),this.C(2);var x=this.diagram;if(y!==null?ty(y,this):this instanceof no&&x!==null&&x.ai.remove(this),this.Ah=a,a!==null?ey(a,this):this instanceof no&&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 no){for(x=new In,Vc(x,this,!0,0,!0),x=x.iterator;x.next();)if(E=x.value,E instanceof Fi)for(E=E.linksConnected;E.next();)gp(E.value)}if(this instanceof Fi){for(x=this.linksConnected;x.next();)gp(x.value);x=this.labeledLink,x!==null&&gp(x)}this.g("containingGroup",y,a),a!==null&&(y=a.layer,y!==null&&dd(y,-1,a))}}else at("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&&(Tl(this),this.P.Kp=a,this.g("containingGroupChanged",y,a))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof Fi&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(a){var y=this.layoutConditions;y!==a&&(Tl(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&&(Tl(this),this.P.Up=a,this.g("dragComputation",y,a))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:qi},set:function(a){var y=this.shadowOffset;y.D(a)||(a=a.J(),Tl(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&&(Tl(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&&(Tl(this),this.P.Vg=a,this.N(),this.g("shadowBlur",y,a))}}}),pr.prototype.invalidateLayout=pr.prototype.C,pr.prototype.findCommonContainingGroup=pr.prototype.px,pr.prototype.isMemberOf=pr.prototype.Td,pr.prototype.findTopLevelPart=pr.prototype.sz,pr.prototype.findSubGraphLevel=pr.prototype.oz,pr.prototype.ensureBounds=pr.prototype.Va,pr.prototype.getDocumentBounds=pr.prototype.mi,pr.prototype.findObject=pr.prototype.fb,pr.prototype.moveTo=pr.prototype.moveTo,pr.prototype.invalidateAdornments=pr.prototype.Wb,pr.prototype.clearAdornments=pr.prototype.Ej,pr.prototype.removeAdornment=pr.prototype.Jf,pr.prototype.addAdornment=pr.prototype.bh,pr.prototype.findAdornment=pr.prototype.Pj,pr.prototype.updateTargetBindings=pr.prototype.La;var Z1=!1;pr.className="Part",pr.LayoutNone=0,pr.LayoutAdded=1,pr.LayoutRemoved=2,pr.LayoutShown=4,pr.LayoutHidden=8,pr.LayoutNodeSized=16,pr.LayoutGroupLayout=32,pr.LayoutNodeReplaced=64,pr.LayoutStandard=127,pr.LayoutAll=16777215;function Yo(a,y){a===void 0||a instanceof Cs||typeof a=="string"?pr.call(this,a):(pr.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)}_t(Yo,pr),Yo.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(a!==null?a.toString():"")},Yo.prototype.updateRelationshipsFromData=function(){},Yo.prototype.Ul=function(a){var y=this.adornedObject,x=y==null?void 0:y.part;if(x instanceof $n&&y instanceof lo){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 lo&&(b.ua=a)}}},Yo.prototype.si=function(){var a=this.ue;return a===null?!0:(a=a.part,a===null||!xt(a))},Yo.prototype.Zc=function(){return!1},Yo.prototype.gk=function(a,y,x,E,b,z,ee){if(a===Go&&y==="elements"){if(b instanceof xl)this.$a===null&&(this.$a=b);else if(b instanceof Wn){var re=b.Nl(function(oe){return oe instanceof xl});re instanceof xl&&this.$a===null&&(this.$a=re)}}else a===ha&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof Wn&&this.$a.rg(E)&&(this.$a=null));pr.prototype.gk.call(this,a,y,x,E,b,z,ee)},Yo.prototype.updateAdornments=function(){},Yo.prototype.Lj=function(){},fn.Object.defineProperties(Yo.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}}}),Yo.className="Adornment";function Qv(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=qa,this.er=p0,this.Kr=this.ij=this.Nq=this.Mq=null}Qv.prototype.copy=function(){var a=new Qv;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 Fi(a,y){a===void 0||a instanceof Cs||typeof a=="string"?pr.call(this,a):(pr.call(this),a&&(y=a)),this.U=13,this.Ba=null,this.jb=new Bn,this.wc=this.af=this.Yk=null,this.ci=!1,y&&Object.assign(this,y)}_t(Fi,pr),Fi.prototype.cloneProtected=function(a){pr.prototype.cloneProtected.call(this,a),a.U=this.U,this.Ba!==null&&(a.Ba=this.Ba.nc?this.Ba:this.Ba.copy())},be=Fi.prototype,be.Af=function(a){pr.prototype.Af.call(this,a),a.Bd(),a.af=this.af,a.wc=null};function ic(a){a.Ba===null?a.Ba=new Qv:a.Ba.nc&&(a.Ba=a.Ba.copy())}be.th=function(){pr.prototype.th.call(this),this.Ba!==null&&(this.Ba.nc=!0)};function G1(a,y){y!==null&&(a.af===null&&(a.af=new In),a.af.add(y))}function W1(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}be.Lz=function(a,y,x){y==null&&(y=""),x==null&&(x=""),a=W1(this,a,y,x),a!==null&&a.Sl()},be.gk=function(a,y,x,E,b,z,ee){a===Go&&y==="elements"?this.wc=null:a===ha&&y==="elements"&&(this.wc=null),pr.prototype.gk.call(this,a,y,x,E,b,z,ee)},be.Bd=function(a){for(var y=this.linksConnected;y.next();){var x=y.value;a!==void 0&&a.contains(x)||(nu(x.fromPort),nu(x.toPort),x.bb())}};function H1(a,y){for(a=a.linksConnected;a.next();){var x=a.value;(x.fromPort===y||x.toPort===y)&&(nu(x.fromPort),nu(x.toPort),x.bb())}}function nu(a){if(a!==null){var y=a.Zn;y!==null&&y.Sl(),a=a.part,y=a.containingGroup,y===null||a.isVisible()||nu(y.port)}}be.si=function(){return!0},Fi.prototype.getAvoidableRect=function(a){return a.set(this.actualBounds),a.Co(this.avoidableMargin),a},Fi.prototype.findVisibleNode=function(){for(var a=this;a!==null&&!a.isVisible();)a=a.containingGroup;return a},Fi.prototype.isVisible=function(){if(!pr.prototype.isVisible.call(this))return!1;var a=!0,y=Ku,x=this.diagram;if(x!==null&&(a=x.isTreePathToChildren,y=x.treeCollapsePolicy),y===Ku){if(a=this.pg(),a!==null&&!a.isTreeExpanded)return!1}else if(y===as){if(a=a?this.Oo():this.Po(),0<a.count&&a.all(function(E){return!E.isTreeExpanded}))return!1}else if(y===Lf&&(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},Fi.prototype.Zb=function(a){pr.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)}},Fi.prototype.qx=function(){var a=new In,y=new In;return V1(this,this,a,y),y.iterator};function V1(a,y,x,E){if(y!==null&&!x.has(y)){x.add(y);var b=!0,z=a.diagram;z!==null&&(b=z.isTreePathToChildren),y.linksConnected.each(function(ee){ee.isTreeLink?(b?ee.fromNode===y:ee.toNode===y)&&V1(a,b?ee.toNode:ee.fromNode,x,E):E.add(ee)})}}Fi.prototype.findLinksConnected=function(a){if(a===void 0&&(a=null),a===null)return this.jb.iterator;var y=new wo(this.jb),x=this;return y.predicate=function(E){return E.fromNode===x&&E.fromPortId===a||E.toNode===x&&E.toPortId===a},y},be=Fi.prototype,be.Mo=function(a){a===void 0&&(a=null);var y=new wo(this.jb),x=this;return y.predicate=function(E){return E.fromNode!==x?!1:a===null?!0:E.fromPortId===a},y},be.Sd=function(a){a===void 0&&(a=null);var y=new wo(this.jb),x=this;return y.predicate=function(E){return E.toNode!==x?!1:a===null?!0:E.toPortId===a},y},be.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 In,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 In,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new fo(x):mo},be.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 In,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new fo(x):mo},be.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 In,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new fo(x):mo},be.jz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new wo(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},be.kz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new wo(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 f0(a,y,x){nu(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,ee=a.diagram;ee!==null&&(z=ee.aa,ee.aa=!0),b(a,y,x),ee!==null&&(ee.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 g0(a,y,x){nu(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 ee=!0;b!==null&&(ee=b.aa,b.aa=!0),z(a,y,x),b!==null&&(b.aa=ee)}}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)):Qp(y)))}function Qp(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}}}Fi.prototype.updateRelationshipsFromData=function(){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)},be=Fi.prototype,be.Vo=function(a){pr.prototype.Vo.call(this,a),a||(Qp(this),a=this.Yk,a!==null&&ex(a,this))},be.Wo=function(a){pr.prototype.Wo.call(this,a),a||(a=this.Yk,a!==null&&a.wd!==null&&(a.wd.remove(this),a.v()))},be.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,pr.prototype.Lj.call(this)},be.ns=function(a){if(this.wc===null){if(a===""&&this.Te===!1)return this;K1(this)}var y=this.wc.I(a);return y!==null||a!==""&&(y=this.wc.I(""),y!==null)?y:this};function K1(a){a.wc===null?a.wc=new Rt:a.wc.clear(),a.qm(a,function(y,x){U1(y,x)}),a.wc.count===0&&a.wc.add("",a)}function U1(a,y){var x=y.portId;x!==null&&a.wc!==null&&a.wc.add(x,y)}function $v(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=xi()),x.push(E);if(x!==null){for(a=0;a<x.length;a++)y.remove(x[a]);Bi(x)}}}be.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},be.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}},be.gz=function(a){if(a===null)return null;if(this===a)return this;for(var y=this;y!==null;)c0(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;)c0(y,!1),y=y.pg();return x},be.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},be.pg=function(){var a=this.ci;if(a===null)return null;if(a instanceof Fi)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},be.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 In;return a(this,y),y},be.uz=function(){return Y1(this,this)};function Y1(a,y){return y=y.pg(),y===null?0:1+Y1(a,y)}be.Qo=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren),y=new wo(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},be.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 Bn,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 Bn,y.add(x),y.add(a)):x=a);return y!==null?y.iterator:x!==null?new fo(x):mo},be.wz=function(a){a===void 0&&(a=1/0);var y=new In;return Vc(y,this,!1,a,!0),y},Fi.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 In;x.add(this),X1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Ku),y.Ue=!1}};function X1(a,y,x,E,b,z,ee){if(1<E)for(var re=x?a.Mo():a.Sd();re.next();){var oe=re.value;oe.isTreeLink&&(oe=oe.To(a),oe===null||oe===a||y.contains(oe)||(y.add(oe),X1(oe,y,x,E-1,b,z,ee)))}else J1(a,y,x,b,z,ee)}function J1(a,y,x,E,b,z){for(var ee=b===a?!0:a.isTreeExpanded,re=x?a.Mo():a.Sd(),oe={};re.next();){var ue=re.value;if(ue.isTreeLink&&(ue=ue.To(a),ue!==null&&ue!==a)){var he=y.contains(ue);if(he||y.add(ue),ee){var pe=x?ue.Oo():ue.Po();oe.uv=a,pe.all(function(Se){return function(Pe){return Pe===Se.uv||!Pe.isTreeExpanded}}(oe))&&E.Aj(ue,b),ue.oh(),ue.Zb(!1)}ue.isTreeExpanded&&(ue.wasTreeExpanded=ue.isTreeExpanded,he||J1(ue,y,x,E,b,z))}oe={uv:oe.uv}}a.isTreeExpanded=!1}Fi.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 In;x.add(this),Q1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Ku),y.Ue=!1}};function Q1(a,y,x,E,b,z,ee){for(var re=z===a?!1:a.isTreeExpanded,oe=x?a.Mo():a.Sd(),ue={};oe.next();){var he=oe.value;if(he.isTreeLink&&(re||he.fd||he.bb(),he=he.To(a),he!==null&&he!==a&&!y.contains(he))){if(y.add(he),!re){he.Zb(!0),he.oh();var pe=x?he.Oo():he.Po();ue.vv=a,pe.all(function(Se){return function(Pe){return Pe===Se.vv||!Pe.isTreeExpanded}}(ue))&&b.Cj(he,z)}(2<E||he.wasTreeExpanded)&&(he.wasTreeExpanded=!1,Q1(he,y,x,E-1,b,z,ee))}ue={vv:ue.vv}}a.isTreeExpanded=!0}fn.Object.defineProperties(Fi.prototype,{portSpreading:{get:function(){return this.Ba!==null?this.Ba.er:p0},set:function(a){var y=this.portSpreading;y!==a&&(ic(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&&Vh(x,this),this.g("avoidable",y,a)}}},avoidableMargin:{get:function(){return this.Ba!==null?this.Ba.yp:qa},set:function(a){typeof a=="number"&&(a=new $r(a));var y=this.avoidableMargin;if(!y.D(a)){a=a.J(),ic(this),this.Ba.yp=a;var x=this.diagram;x!==null&&Vh(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&&(ic(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&&(ic(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&&(ic(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 ee=z.wa(E);ee!==void 0&&z.Qx(b,ee)}}this.containingGroup=null}this.Yk=a,a!==null&&(ex(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),il(this),this.g("labeledLink",y,a)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return this.wc===null&&K1(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&&(ic(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))}}}),Fi.prototype.expandTree=Fi.prototype.expandTree,Fi.prototype.collapseTree=Fi.prototype.collapseTree,Fi.prototype.findTreeParts=Fi.prototype.wz,Fi.prototype.findTreeChildrenNodes=Fi.prototype.Ou,Fi.prototype.findTreeChildrenLinks=Fi.prototype.Qo,Fi.prototype.findTreeLevel=Fi.prototype.uz,Fi.prototype.findTreeParentChain=Fi.prototype.vz,Fi.prototype.findTreeParentNode=Fi.prototype.pg,Fi.prototype.findTreeParentLink=Fi.prototype.kh,Fi.prototype.findCommonTreeParent=Fi.prototype.gz,Fi.prototype.findTreeRoot=Fi.prototype.xz,Fi.prototype.isInTreeOf=Fi.prototype.Nz,Fi.prototype.findPort=Fi.prototype.ns,Fi.prototype.findLinksTo=Fi.prototype.kz,Fi.prototype.findLinksBetween=Fi.prototype.jz,Fi.prototype.findNodesInto=Fi.prototype.Oo,Fi.prototype.findNodesOutOf=Fi.prototype.Po,Fi.prototype.findNodesConnected=Fi.prototype.Mu,Fi.prototype.findLinksInto=Fi.prototype.Sd,Fi.prototype.findLinksOutOf=Fi.prototype.Mo,Fi.prototype.findExternalTreeLinksConnected=Fi.prototype.qx,Fi.prototype.invalidateConnectedLinks=Fi.prototype.Bd,Fi.prototype.invalidateLinkBundle=Fi.prototype.Lz;var CS=new Ot(Fi,"SpreadingNone",10),p0=new Ot(Fi,"SpreadingEvenly",11),qv=new Ot(Fi,"SpreadingPacked",12);Fi.className="Node",Fi.SpreadingNone=CS,Fi.SpreadingEvenly=p0,Fi.SpreadingPacked=qv;function no(a,y){a===void 0||a instanceof Cs||typeof a=="string"?Fi.call(this,a):(Fi.call(this),a&&(y=a)),this.U|=4608,this.Gn=new In,this.$a=null,this.Sc=new Va,this.Sc.group=this,this.gl=new In,this.tb=this.$p=null,y&&Object.assign(this,y)}_t(no,Fi),no.prototype.cloneProtected=function(a){Fi.prototype.cloneProtected.call(this,a),this.U=this.U&-32769;var y=a.Nl(function(x){return x instanceof xl});y instanceof xl?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())},be=no.prototype,be.Af=function(a){Fi.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 Fi)x.Bd(y);else if(x instanceof $n)for(x=x.labelNodes;x.next();)x.value.Bd(y)}},be.gk=function(a,y,x,E,b,z,ee){if(a===Go&&y==="elements"){if(b instanceof xl)this.$a===null?this.$a=b:this.$a!==b&&at("Cannot insert a second Placeholder into the visual tree of a Group.");else if(b instanceof Wn){var re=b.Nl(function(oe){return oe instanceof xl});re instanceof xl&&(this.$a===null?this.$a=re:this.$a!==re&&at("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===ha&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof Wn&&this.$a.rg(E)&&(this.$a=null));Fi.prototype.gk.call(this,a,y,x,E,b,z,ee)},be.Xl=function(a,y){Fi.prototype.Xl.call(this,a,y),this.isClipping&&this.type!==Wn.Spot&&this.isSubGraphExpanded&&(a=this.resizeObject,a instanceof Wn&&(a=a.Pb()),this.tb===null&&(this.tb=new Gt),a.mi(this.tb),a instanceof lo&&this.tb.Bc(-a.strokeWidth,-a.strokeWidth))},be.eh=function(a,y,x,E){this.nf=this.$a,Fi.prototype.eh.call(this,a,y,x,E)},be.Va=function(){var a=this;a.isSubGraphExpanded&&this.memberParts.each(function(y){!a.computesBoundsIncludingLinks&&y instanceof $n||y.Va()}),Fi.prototype.Va.call(this)},be.si=function(){if(!Fi.prototype.si.call(this))return!1;for(var a=this.memberParts;a.next();){var y=a.value;if(y instanceof Fi){if(y.isVisible()&&xt(y))return!1}else if(y instanceof $n&&y.isVisible()&&xt(y)&&y.fromNode!==this&&y.toNode!==this)return!1}return!0};function ey(a,y){if(a.Gn.add(y)){y instanceof no&&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 $n&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}function ty(a,y){if(a.Gn.remove(y)){y instanceof no&&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 $n&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}be.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)}Fi.prototype.Lj.call(this)},no.prototype.canAddMembers=function(a){var y=this.diagram;if(y===null)return!1;for(y=y.commandHandler,a=sn(a).iterator;a.next();)if(!y.isValidMember(this,a.value))return!1;return!0},no.prototype.addMembers=function(a,y){var x=this.diagram;if(x===null)return!1;x=x.commandHandler;var E=!0;for(a=sn(a).iterator;a.next();){var b=a.value;!y||x.isValidMember(this,b)?b.containingGroup=this:E=!1}return E},no.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))},be=no.prototype,be.Bd=function(a){var y=(this.U&65536)!==0;if(Fi.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()?(nu(x.fromPort),nu(x.toPort),x.bb()):(E=x.toNode,E!==null&&E!==this&&E.Td(this)&&!E.isVisible()&&(nu(x.fromPort),nu(x.toPort),x.bb()))}}},be.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 In,E=y.iterator;E.next();){var b=E.value;if(b instanceof Fi)for(b=b.linksConnected;b.next();){var z=b.value;y.contains(z)||x.add(z)}}return a&&(this.$p=x),x.iterator},be.iz=function(){var a=this.Rj();a.add(this);for(var y=new In,x=a.iterator;x.next();){var E=x.value;if(E instanceof Fi)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},be.hz=function(){function a(x,E){x!==null&&(E.add(x),a(x.containingGroup,E))}var y=new In;return a(this,y),y},be.Rj=function(){var a=new In;return Vc(a,this,!0,0,!0),a.remove(this),a},be.Zb=function(a){Fi.prototype.Zb.call(this,a);for(var y=this.memberParts;y.next();)y.value.Zb(a)},no.prototype.collapseSubGraph=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(!1),z instanceof no&&z.isSubGraphExpanded&&(z.wasSubGraphExpanded=z.isSubGraphExpanded,$1(z,y,x,E)),z instanceof Fi)z.Bd(y),x.Aj(z,E);else if(z instanceof $n)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!1}no.prototype.expandSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();q1(this,y,a,this),a.Ue=!1}};function q1(a,y,x,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!0),z instanceof no&&z.wasSubGraphExpanded&&(z.wasSubGraphExpanded=!1,q1(z,y,x,E)),z instanceof Fi)z.Bd(y),x.Cj(z,E);else if(z instanceof $n)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!0}no.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=Ie.alloc(),Fi.prototype.move.call(this,a,y),a=new In,y=this.Rj().iterator;y.next();)b=y.value,b instanceof $n&&(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 Fi&&b.isLinkLabel)){var ee=b.position,re=b.location;ee.w()?(z.x=ee.x+E,z.y=ee.y+x,b.position=z):re.w()&&(z.x=re.x+E,z.y=re.y+x,b.location=z)}for(y.reset();y.next();)b=y.value,b instanceof $n&&(b.suspendsRouting=a.contains(b),b.fd||b.fromNode!==this&&b.toNode!==this)&&(ee=b.position,z.x=ee.x+E,z.y=ee.y+x,z.w()?b.move(z):b.bb(),iy(b)&&b.bb());Ie.free(z)}},fn.Object.defineProperties(no.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&&at("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&&(ic(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&&(ic(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&&(ic(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&&(ic(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)}}}),no.prototype.expandSubGraph=no.prototype.expandSubGraph,no.prototype.collapseSubGraph=no.prototype.collapseSubGraph,no.prototype.findSubGraphParts=no.prototype.Rj,no.prototype.findContainingGroupChain=no.prototype.hz,no.prototype.findExternalNodesConnected=no.prototype.iz,no.prototype.findExternalLinksConnected=no.prototype.Lu,no.prototype.ensureBounds=no.prototype.Va,no.className="Group";function xl(a){Ft.call(this),this.yb=ns,this.ko=new Gt(NaN,NaN,NaN,NaN),a&&Object.assign(this,a)}_t(xl,Ft),xl.prototype.cloneProtected=function(a){Ft.prototype.cloneProtected.call(this,a),a.yb=this.yb.J(),a.ko=this.ko.copy()},xl.prototype.gh=function(a){if(this.background===null&&this.areaBackground===null)return!1;var y=this.naturalBounds;return So(0,0,y.width,y.height,a.x,a.y)},xl.prototype.Wl=function(){var a=this.part;if(a!==null&&(a instanceof no||a instanceof Yo)||at("Placeholder is not inside a Group or Adornment."),a instanceof no){var y=this.computeBorder(this.ko),x=this.minSize,E=this.dc;for(qo(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=Ie.alloc(),x.xi(y,a.locationSpot),x.D(a.location)||(a.location=x),Ie.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 ee=0;z instanceof lo&&(ee=z.strokeWidth);var re=z.Df(),oe=z.naturalBounds,ue=(oe.width+ee)*re;ee=(oe.height+ee)*re,a.type!==Wn.Link&&(re=z.ga(a.category==="Selection"?Co:a.locationSpot,Ie.alloc()),a.location=re,Ie.free(re)),isNaN(ue)||isNaN(ee)?(a=z.ga(Co,Ie.alloc()),ue=Gt.allocAt(a.x,a.y,0,0),ue.Ye(z.ga(Ht,a)),ue.Ye(z.ga(Ko,a)),ue.Ye(z.ga(Za,a)),qo(y,ue.width+E||0,ue.height+b||0),this.Ge(-x.left,-x.top,y.width,y.height),Ie.free(a),Gt.free(ue)):(qo(y,ue+E||0,ee+b||0),this.Ge(-x.left,-x.top,y.width,y.height))}},xl.prototype.eh=function(a,y,x,E){this.actualBounds.h(a,y,x,E)},xl.prototype.computeBorder=function(a){var y=this.part,x=y.diagram,E=x===null||!x.animationManager.isAnimating;if(x!==null&&y instanceof no&&!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=Gt.alloc(),b=this.computeMemberBounds(x);var z=this.yb;return y instanceof no&&!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)),Gt.free(x),E&&y instanceof no&&y.computesBoundsIncludingLocation&&y.location.w()&&a.Ye(y.location),a},xl.prototype.computeMemberBounds=function(a){if(!(this.part instanceof no))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,ee=y.memberParts;ee.next();){var re=ee.value;if(re.isVisible()){if(re instanceof $n&&(!y.computesBoundsIncludingLinks||tt(re)||re.fromNode===y||re.toNode===y))continue;re=re.actualBounds,re.left<x&&(x=re.left),re.top<E&&(E=re.top),re.right>b&&(b=re.right),re.bottom>z&&(z=re.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},fn.Object.defineProperties(xl.prototype,{padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new $r(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.g("padding",y,a),this.v())}}}),xl.className="Placeholder";function $n(a){pr.call(this,Wn.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=Sl,this.Om=0,this.Qm=Sl,this.Rm=NaN,this.qj=ay,this.po=.5,this.wd=null,this.Nb=new Bn().freeze(),this.Tg=this.Mg=null,this.ml=new Gt,this.ua=new ut,this.u=this.o=this.Sf=this.Wf=null,this.su=new Ie,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],a&&Object.assign(this,a)}_t($n,pr),$n.prototype.cloneProtected=function(a){pr.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())},be=$n.prototype,be.Af=function(a){pr.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&&nu(y),a=a.toPort,a!==null&&nu(a)},be.qb=function(a){a.classType===$n?(a.value&2)===2?this.routing=a:a===fu||a===oc||a===mp?this.curve=a:a===em||a===w0||a===P0?this.adjusting=a:a!==ay&&a!==Sl&&at("Unknown Link enum value for a Link property: "+a):pr.prototype.qb.call(this,a)},be.Xc=function(){this.ba===null&&(this.ba=new No)},be.si=function(){var a=this.fromNode;if(a!==null){var y=a.findVisibleNode();if(y!==null&&(a=y),xt(a)||Wc(a))return!1}return a=this.toNode,!(a!==null&&(y=a.findVisibleNode(),y!==null&&(a=y),xt(a)||Wc(a)))},be.zv=function(){return!1},be.Av=function(){},be.Zc=function(){return!1},$n.prototype.computeAngle=function(a,y,x){return $n.computeAngle(y,x)},$n.computeAngle=function(a,y){switch(a){default:case Sl:a=0;break;case tm:a=y;break;case nm:a=y+90;break;case im:a=y-90;break;case sy:a=y+180;break;case E0:a=Re.bp(y),90<a&&270>a&&(a-=180);break;case rm:a=Re.bp(y+90),90<a&&270>a&&(a-=180);break;case om:a=Re.bp(y-90),90<a&&270>a&&(a-=180);break;case C0:if(a=Re.bp(y),45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return Re.bp(a)};function gp(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&&ty(x,a),a.Ah=y,y!==null&&ey(y,a);var b=a.containingGroupChanged;if(b!==null){var z=!0,ee=a.diagram;ee!==null&&(z=ee.aa,ee.aa=!0),b(a,x,y),ee!==null&&(ee.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}be=$n.prototype,be.oh=function(){var a=this.containingGroup;a!==null&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&pr.prototype.oh.call(this)},be.To=function(a){var y=this.fromNode;return a===y?this.toNode:y},be.Cz=function(a){var y=this.fromPort;return a===y?this.toPort:y};function ex(a,y){a.wd===null&&(a.wd=new In),a.wd.add(y),a.v()}be.Vo=function(a){if(pr.prototype.Vo.call(this,a),If(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,f0(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||f0(x,this,E)}$p(this)}},be.Wo=function(a){if(pr.prototype.Wo.call(this,a),If(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,g0(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||g0(x,this,E)}qp(this)}},be.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))},$n.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)}},$n.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?pr.prototype.move.call(this,a,!1):(a=Ie.allocAt(x.x+E,x.y+b),pr.prototype.move.call(this,a,!1),Ie.free(a)),rc(this,E,b),a=this.labelNodes;a.next();)y=a.value,x=y.position,y.moveTo(x.x+E,x.y+b)},$n.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},$n.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},$n.prototype.computeMidPoint=function(a){var y=this.pointsCount;if(y===0)return a.assign(zi),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()===fu))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()===fu){if(y===3){x=this.i(0),E=this.i(1);var b=this.i(2);return Re.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),Re.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 ee=this.flattenedLengths;for(x=this.flattenedTotalLength,b=z=E=0;E<x/2&&z<y&&(b=ee[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},$n.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()===fu))return this.ua.wx(.5);if(this.computeCurve()===fu&&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),Re.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)},be=$n.prototype,be.i=function(a){return this.Nb.s[a]},be.dd=function(a,y){this.Nb.cd(a,y)},be.L=function(a,y,x){this.Nb.cd(a,new Ie(y,x))},be.Kz=function(a,y){this.Nb.Gb(a,y)},be.m=function(a,y,x){this.Nb.Gb(a,new Ie(y,x))},be.ne=function(a){this.Nb.add(a)},be.yf=function(a,y){this.Nb.add(new Ie(a,y))},be.pv=function(a){this.Nb.mb(a)},be.Fj=function(){this.Nb.clear()};function rc(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 Bn,z=a.Nb.iterator;z.next();){var ee=z.value;b.add(new Ie(ee.x+y,ee.y+x).freeze())}b.freeze(),z=a.Nb,a.Nb=b,ee=a.diagram,isNaN(y)||isNaN(x)||ee!==null&&ee.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),il(a)),E?m0(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint=a.i(a.pointsCount-1))),ee!==null&&ee.animationManager.zb&&Lc(ee.animationManager,a,b),a.g("points",z,b)}}be.uh=function(){this.Mg===null&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},be.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,ee=0;ee<z;ee++){var re=b[ee];x=Math.min(re.x,x),E=Math.min(re.y,E)}re=ee=1/0;for(var oe=y.s,ue=oe.length,he=0;he<ue;he++){var pe=oe[he];ee=Math.min(pe.x,ee),re=Math.min(pe.y,re),pe.freeze()}if(y.freeze(),ue===z){for(z=0;z<ue;z++)if(he=b[z],pe=oe[z],he.x-x!==pe.x-ee||he.y-E!==pe.y-re){this.qc();break}}else this.qc();this.Mg=null,x=this.diagram,x!==null&&x.animationManager.zb&&Lc(x.animationManager,this,y),m0(this),this.g("points",a,y)}},be.rv=function(){this.Mg!==null&&(this.Nb=this.Mg,this.Mg=null)};function m0(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),S0(a,!1))}be.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())}},be.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()}}},$n.prototype.computePoints=function(){if(this.diagram===null)return!1;var a=this.fromNode,y=null;if(a===null?(bg||(bg=new Fi,bg.desiredSize=Rr,bg.Va()),this.defaultFromPoint&&(bg.location=this.defaultFromPoint,bg.Va(),y=a=bg)):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?(Fg||(Fg=new Fi,Fg.desiredSize=Rr,Fg.Va()),this.defaultToPoint&&(Fg.location=this.defaultToPoint,Fg.Va(),b=E=Fg)):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,ee=this.computeSpot(!0,y);x=this.computeSpot(!1,b);var re=pp(ee),oe=pp(x),ue=y===b&&y!==null,he=this.isOrthogonal,pe=this.curve===fu;this.Wf=ue&&!he?pe=!0:!1;var Se=this.computeAdjusting()===Sl||ue;if(!he&&!ue&&re&&oe){if(re=!1,!Se&&3<=z&&(Se=this.getLinkPoint(a,y,ee,!0,!1,E,b),oe=this.getLinkPoint(E,b,x,!1,!1,a,y),re=this.adjustPoints(0,Se,z-1,oe))&&(Se=this.getLinkPoint(a,y,ee,!0,!1,E,b),oe=this.getLinkPoint(E,b,x,!1,!1,a,y),this.adjustPoints(0,Se,z-1,oe)),!re)if(this.Fj(),pe){z=this.getLinkPoint(a,y,ee,!0,!1,E,b),Se=this.getLinkPoint(E,b,x,!1,!1,a,y),re=Se.x-z.x,oe=Se.y-z.y,ue=this.computeCurviness(),pe=he=0;var Pe=z.x+re/3,Fe=z.y+oe/3,Ne=Pe,Xe=Fe;Re.B(oe,0)?Xe=0<re?Xe-ue:Xe+ue:(he=-re/oe,pe=Math.sqrt(ue*ue/(he*he+1)),0>ue&&(pe=-pe),Ne=(0>oe?-1:1)*pe+Pe,Xe=he*(Ne-Pe)+Fe),Pe=z.x+2*re/3,Fe=z.y+2*oe/3;var Ve=Pe,ht=Fe;Re.B(oe,0)?ht=0<re?ht-ue:ht+ue:(Ve=(0>oe?-1:1)*pe+Pe,ht=he*(Ve-Pe)+Fe),this.Fj(),this.ne(z),this.yf(Ne,Xe),this.yf(Ve,ht),this.ne(Se),this.dd(0,this.getLinkPoint(a,y,ee,!0,!1,E,b)),this.dd(3,this.getLinkPoint(E,b,x,!1,!1,a,y))}else z=E,Se=b,E=this.getLinkPoint(a,y,ee,!0,!1,z,Se),b=this.getLinkPoint(z,Se,x,!1,!1,a,y),this.hasCurviness()?(Se=b.x-E.x,x=b.y-E.y,ee=this.computeCurviness(),a=E.x+Se/2,y=E.y+x/2,z=a,re=y,Re.B(x,0)?re=0<Se?re-ee:re+ee:(Se=-Se/x,z=Math.sqrt(ee*ee/(Se*Se+1)),0>ee&&(z=-z),z=(0>x?-1:1)*z+a,re=Se*(z-a)+y),this.ne(E),this.yf(z,re),this.ne(b)):(this.ne(E),this.ne(b),re=Gt.alloc(),y.mi(re),oe=re.ca(b),Se.mi(re),ue=re.ca(E),(oe||ue)&&(ee=y.ga(y0(ee),new Ie),this.dd(0,this.getLinkPointFromPoint(a,y,ee,b,!0,ee)),x=Se.ga(y0(x),new Ie),this.dd(1,this.getLinkPointFromPoint(z,Se,x,E,!1,x))),Gt.free(re))}else{pe=this.isAvoiding,Se&&(he&&pe||ue)&&this.Fj();var ft=ue?this.computeCurviness():0;pe=this.getLinkPoint(a,y,ee,!0,he,E,b),Pe=Ne=Fe=0,(he||!re||ue)&&(Xe=this.computeEndSegmentLength(a,y,ee,!0),Pe=this.getLinkDirection(a,y,pe,ee,!0,he,E,b),ue&&(re||ee.D(x)||!he&&ee.x+x.x===1&&ee.y+x.y===1)&&(Pe-=he?90:30,0>ft&&(Pe-=180)),0>Pe?Pe+=360:360<=Pe&&(Pe-=360),ue&&(Xe+=Math.abs(ft)*(he?1:2)),Pe===0?Fe=Xe:Pe===90?Ne=Xe:Pe===180?Fe=-Xe:Pe===270?Ne=-Xe:(Fe=Xe*Math.cos(Pe*Math.PI/180),Ne=Xe*Math.sin(Pe*Math.PI/180)),ee.Mc()&&ue&&(Xe=y.ga(Kr,Ie.alloc()),Ve=Ie.allocAt(Xe.x+1e3*Fe,Xe.y+1e3*Ne),this.getLinkPointFromPoint(a,y,Xe,Ve,!0,pe),Ie.free(Xe),Ie.free(Ve))),Xe=this.getLinkPoint(E,b,x,!1,he,a,y);var mt=ht=Ve=0;if(he||!oe||ue){var Ct=this.computeEndSegmentLength(E,b,x,!1);mt=this.getLinkDirection(E,b,Xe,x,!1,he,a,y),ue&&(oe||ee.D(x)||!he&&ee.x+x.x===1&&ee.y+x.y===1)&&(mt+=he?0:30,0>ft&&(mt+=180)),0>mt?mt+=360:360<=mt&&(mt-=360),ue&&(Ct+=Math.abs(ft)*(he?1:2)),mt===0?Ve=Ct:mt===90?ht=Ct:mt===180?Ve=-Ct:mt===270?ht=-Ct:(Ve=Ct*Math.cos(mt*Math.PI/180),ht=Ct*Math.sin(mt*Math.PI/180)),x.Mc()&&ue&&(x=b.ga(Kr,Ie.alloc()),ee=Ie.allocAt(x.x+1e3*Ve,x.y+1e3*ht),this.getLinkPointFromPoint(E,b,x,ee,!1,Xe),Ie.free(x),Ie.free(ee))}x=pe,(he||!re||ue)&&(x=new Ie(pe.x+Fe,pe.y+Ne)),ee=Xe,(he||!oe||ue)&&(ee=new Ie(Xe.x+Ve,Xe.y+ht)),!Se&&!he&&re&&3<z&&this.adjustPoints(0,pe,z-2,ee)?this.dd(z-1,Xe):!Se&&!he&&oe&&3<z&&this.adjustPoints(1,x,z-1,Xe)?this.dd(0,pe):!Se&&(he?6<=z:4<z)&&this.adjustPoints(1,x,z-2,ee)?(this.dd(0,pe),this.dd(z-1,Xe)):(this.Fj(),this.ne(pe),(he||!re||ue)&&this.ne(x),he&&this.addOrthoPoints(x,Pe,ee,mt,a,E),(he||!oe||ue)&&this.ne(ee),this.ne(Xe))}return!0};function ny(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}$n.prototype.getLinkPointFromPoint=function(a,y,x,E,b,z){if(z===void 0&&(z=new Ie),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 ee=x.x;x=x.y}else{a=b.oe,b=1/(a.m11*a.m22-a.m12*a.m21),ee=a.m22*b;var re=-a.m12*b,oe=-a.m21*b,ue=a.m11*b,he=b*(a.m21*a.dy-a.m22*a.dx),pe=b*(a.m12*a.dx-a.m11*a.dy);b=E.x*ee+E.y*oe+he,E=E.x*re+E.y*ue+pe,ee=x.x*ee+x.y*oe+he,x=x.x*re+x.y*ue+pe}return y.Sj(b,E,ee,x,z),a!==null&&z.transform(a),z};function v0(a,y){var x=y.Zn;return x===null&&(x=new Lg,x.port=y,x.node=y.part,y.Zn=x),lx(x,a)}$n.prototype.getLinkPoint=function(a,y,x,E,b,z,ee,re){if(re===void 0&&(re=new Ie),x.sb()&&!pp(x))return y.ga(x,re),re;if(x.$c()){var oe=v0(this,y);if(oe!==null){if(re.assign(oe.Zo),b&&this.routing===nx){var ue=v0(this,ee);if(ue!==null&&oe.Gl<ue.Gl){oe=Ie.alloc(),ue=Ie.alloc();var he=new Gt(y.ga(Co,oe),y.ga(Ht,ue)),pe=this.computeSpot(!E,ee);a=this.getLinkPoint(z,ee,pe,!E,b,a,y,ue),(x.Hf(Wi)||x.Hf(Si))&&a.y>=he.y&&a.y<=he.y+he.height?re.y=a.y:(x.Hf(Fn)||x.Hf(_i))&&a.x>=he.x&&a.x<=he.x+he.width&&(re.x=a.x),Ie.free(oe),Ie.free(ue)}}return re}}return x=y.ga(y0(x),Ie.alloc()),this.pointsCount>(b?6:2)?(ee=E?this.i(1):this.i(this.pointsCount-2),b&&(ee=ny(x,ee.copy()))):(oe=this.computeSpot(!E,ee),z=Ie.alloc(),ee=ee.ga(y0(oe),z),b&&(ee=ny(x,ee)),Ie.free(z)),this.getLinkPointFromPoint(a,y,x,ee,E,re),Ie.free(x),re},$n.prototype.getLinkDirection=function(a,y,x,E,b,z,ee,re){e:if(E.sb())var oe=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()&&(oe=v0(this,y),oe!==null))switch(oe.Nc){case 1:oe=270;break e;case 2:oe=180;break e;default:case 4:oe=0;break e;case 8:oe=90;break e}oe=y.ga(Kr,Ie.alloc()),this.pointsCount>(z?6:2)?(re=b?this.i(1):this.i(this.pointsCount-2),re=z?ny(oe,re.copy()):x):(x=Ie.alloc(),re=re.ga(Kr,x),Ie.free(x)),x=Math.abs(re.x-oe.x)>Math.abs(re.y-oe.y)?re.x>=oe.x?0:180:re.y>=oe.y?90:270,Ie.free(oe),oe=x}return E.Mc()&&ee.Td(a)&&(oe+=180,360<=oe&&(oe-=360)),pp(E)||(a=y.li(),a===0)||(45<=a&&135>a?oe+=90:135<=a&&225>a?oe+=180:225<=a&&315>a&&(oe+=270),360<=oe&&(oe-=360)),oe},$n.prototype.computeEndSegmentLength=function(a,y,x,E){return y!==null&&x.$c()&&(a=v0(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)},$n.prototype.computeSpot=function(a,y){return y===void 0&&(y=null),a?(a=y||this.fromPort,a===null?a=Kr:(y=this.fromSpot,y.Xb()&&(y=a.fromSpot),a=y===or?Xr:y)):(a=y||this.toPort,a===null?a=Kr:(y=this.toSpot,y.Xb()&&(y=a.toSpot),a=y===or?Xr:y)),a};function pp(a){return a===Xr||a.x===.5&&a.y===.5}function y0(a){return a.x===.5&&a.y===.5?a:Kr}$n.prototype.computeOtherPoint=function(a,y){return this.computeAdjusting()!==Sl&&4<this.pointsCount?this.computeMidPoint(new Ie):(a=y.Zn,a=a!==null?lx(a,this):null,a!==null?a.Zo:y.ga(Kr))},$n.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},$n.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 ee=z;if(z===void 0&&(ee=pt.alloc(),ee.reset()),ee.multiply(this.transform),this.fh(a,ee))return Fv(this,y,x,b),z===void 0&&pt.free(ee),!0;if(this.Yc(a,ee)){var re=!1;if(!this.isAtomic)for(var oe=this.O.s,ue=oe.length;ue--;){var he=oe[ue];if(he.visible||he===this.locationObject){var pe=he.actualBounds,Se=this.naturalBounds;if(!(pe.x>Se.width||pe.y>Se.height||0>pe.x+pe.width||0>pe.y+pe.height)){if(pe=pt.alloc(),pe.set(ee),he instanceof Wn)re=he.Cf(a,y,x,E,b,pe);else if(this.path===he){if(he instanceof lo)if(re=a,Se=E,he.pickable===!1)re=!1;else if(pe.multiply(he.transform),Se)e:{var Pe=re,Fe=pe;if(he.fh(Pe,Fe))re=!0;else{if(Fe===void 0&&(Fe=he.transform,Pe.Re(he.actualBounds))){re=!0;break e}re=Pe.left,Se=Pe.right;var Ne=Pe.top;Pe=Pe.bottom;var Xe=Ie.alloc(),Ve=Ie.alloc(),ht=Ie.alloc(),ft=pt.alloc();ft.set(Fe),ft.bv(he.transform),ft.Vj(),Ve.x=Se,Ve.y=Ne,Ve.transform(ft),Xe.x=re,Xe.y=Ne,Xe.transform(ft),Fe=!1,Tf(he,Xe,Ve,ht)?Fe=!0:(Xe.x=Se,Xe.y=Pe,Xe.transform(ft),Tf(he,Xe,Ve,ht)?Fe=!0:(Ve.x=re,Ve.y=Pe,Ve.transform(ft),Tf(he,Xe,Ve,ht)?Fe=!0:(Xe.x=re,Xe.y=Ne,Xe.transform(ft),Tf(he,Xe,Ve,ht)&&(Fe=!0)))),pt.free(ft),Ie.free(Xe),Ie.free(Ve),Ie.free(ht),re=Fe}}else re=he.fh(re,pe)}else re=Es(he,a,E,pe);re&&(Se=he,y!==null&&(Se=y(he)),Se&&(x===null||x(Se))&&b.add(Se)),pt.free(pe)}}}return z===void 0&&pt.free(ee),re||this.background!==null||this.areaBackground!==null}return z===void 0&&pt.free(ee),!1},$n.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?fu:this.curve},$n.prototype.computeCorner=function(){if(this.curve===fu)return 0;var a=this.corner;return(isNaN(a)||0>a)&&(a=10),a},$n.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},$n.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a=rx;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,ee=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===tm||E===E0||E===sy?a=Math.max(a,b):E===im||E===om||E===nm||E===rm?a=Math.max(a,ee):(y=y.ga(Kr).ab(x.ga(Kr))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(y)*ee)+Math.abs(Math.cos(y)*b)+1)),this.curve===fu&&(a*=1.333)}}return a},$n.prototype.arrangeBundledLinks=function(a,y){if(y)for(y=0;y<a.length;y++){var x=a[y];x.computeAdjusting()===Sl&&x.bb()}},$n.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=ix;var y=this.Sf;if(y!==null){for(var x=xi(),E=0,b=y.links,z=0;z<b.length;z++){var ee=b[z].computeSpacing();x.push(ee),E+=ee}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),Bi(x)}}return a},$n.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return a!==null?Math.max(a.strokeWidth,1):1},$n.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},$n.prototype.adjustPoints=function(a,y,x,E){var b=this.computeAdjusting();if(this.isOrthogonal){if(b===w0)return!1;b===P0&&(b=em)}switch(b){case w0:var z=this.i(a),ee=this.i(x);if(!z.Xa(y)||!ee.Xa(E)){b=z.x,z=z.y;var re=ee.x-b,oe=ee.y-z,ue=Math.sqrt(re*re+oe*oe);if(!Re.$(ue,0)){if(Re.$(re,0))var he=0>oe?-Math.PI/2:Math.PI/2;else he=Math.atan(oe/Math.abs(re)),0>re&&(he=Math.PI-he);ee=y.x;var pe=y.y;re=E.x-ee;var Se=E.y-pe;for(oe=Math.sqrt(re*re+Se*Se),Re.$(re,0)?Se=0>Se?-Math.PI/2:Math.PI/2:(Se=Math.atan(Se/Math.abs(re)),0>re&&(Se=Math.PI-Se)),ue=oe/ue,he=Se-he,this.dd(a,y),a+=1;a<x;a++)y=this.i(a),re=y.x-b,oe=y.y-z,y=Math.sqrt(re*re+oe*oe),Re.$(y,0)||(Re.$(re,0)?oe=0>oe?-Math.PI/2:Math.PI/2:(oe=Math.atan(oe/Math.abs(re)),0>re&&(oe=Math.PI-oe)),re=oe+he,y*=ue,this.L(a,ee+y*Math.cos(re),pe+y*Math.sin(re)));this.dd(x,E)}}return!0;case P0:if(z=this.i(a),pe=this.i(x),!z.Xa(y)||!pe.Xa(E)){b=z.x,z=z.y,ee=pe.x,pe=pe.y,ue=(ee-b)*(ee-b)+(pe-z)*(pe-z),re=y.x,he=y.y,oe=E.x,Se=E.y;var Pe=1;if(oe-re!==0){var Fe=(Se-he)/(oe-re);Pe=Math.sqrt(1+1/(Fe*Fe))}else Fe=9e9;for(this.dd(a,y),a+=1;a<x;a++){y=this.i(a);var Ne=y.x,Xe=y.y,Ve=.5;ue!==0&&(Ve=((b-Ne)*(b-ee)+(z-Xe)*(z-pe))/ue);var ht=b+Ve*(ee-b),ft=z+Ve*(pe-z);y=Math.sqrt((Ne-ht)*(Ne-ht)+(Xe-ft)*(Xe-ft)),Xe<Fe*(Ne-ht)+ft&&(y=-y),0<Fe&&(y=-y),Ne=re+Ve*(oe-re),Ve=he+Ve*(Se-he),Fe!==0?(y=Ne+y/Pe,this.L(a,y,Ve-(y-Ne)/Fe)):this.L(a,Ne,Ve+y)}this.dd(x,E)}return!0;case em:e:{if(this.isOrthogonal&&(b=this.i(a),z=this.i(a+1),ee=this.i(a+2),re=z.x,he=z.y,pe=re,ue=he,Re.B(b.y,z.y)?Re.B(z.x,ee.x)?he=y.y:Re.B(z.y,ee.y)&&(re=y.x):Re.B(b.x,z.x)&&(Re.B(z.y,ee.y)?re=y.x:Re.B(z.x,ee.x)&&(he=y.y)),this.L(a+1,re,he),b=this.i(x),z=this.i(x-1),ee=this.i(x-2),re=z.x,he=z.y,oe=re,Se=he,Re.B(b.y,z.y)?Re.B(z.x,ee.x)?he=E.y:Re.B(z.y,ee.y)&&(re=E.x):Re.B(b.x,z.x)&&(Re.B(z.y,ee.y)?re=E.x:Re.B(z.x,ee.x)&&(he=E.y)),this.L(x-1,re,he),iy(this))){this.L(a+1,pe,ue),this.L(x-1,oe,Se),x=!1;break e}this.dd(a,y),this.dd(x,E),x=!0}return x;default:return!1}},$n.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 ee=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 re=b.actualBounds.copy(),oe=z.actualBounds.copy();if(re.w()&&oe.w()){re.Bc(am,am),oe.Bc(am,am),re.Ye(a),oe.Ye(x);var ue=Ie.alloc(),he=Ie.alloc();y===0?x.x>a.x||E===270&&x.y<a.y&&oe.right>a.x||E===90&&x.y>a.y&&oe.right>a.x?(ue.h(x.x,a.y),he.h(x.x,(a.y+x.y)/2),E===180?(ue.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),he.x=ue.x,he.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(ue.x=a.x<oe.left?this.computeMidOrthoPosition(a.x,a.y,oe.left,x.y,!1):a.x<oe.right&&(E===270&&a.y<oe.top||E===90&&a.y>oe.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):oe.right,he.x=ue.x,he.y=x.y):E===0&&a.x<oe.left&&a.y>oe.top&&a.y<oe.bottom&&(ue.x=a.x,ue.y=a.y<x.y?Math.min(x.y,oe.top):Math.max(x.y,oe.bottom),he.y=ue.y)):(ue.h(a.x,x.y),he.h((a.x+x.x)/2,x.y),(E===180||E===90&&x.y<re.top||E===270&&x.y>re.bottom)&&(E===180&&(oe.ca(a)||re.ca(x))?ue.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===180||E===90)?ue.y=this.computeMidOrthoPosition(a.x,re.top,x.x,Math.max(x.y,oe.bottom),!0):x.y>a.y&&(E===180||E===270)&&(ue.y=this.computeMidOrthoPosition(a.x,re.bottom,x.x,Math.min(x.y,oe.top),!0)),he.x=x.x,he.y=ue.y),ue.y>re.top&&ue.y<re.bottom&&(x.x>=re.left&&x.x<=a.x||a.x<=oe.right&&a.x>=x.x?(E===90||E===270)&&(ue.h(Math.max((a.x+x.x)/2,a.x),a.y),he.h(ue.x,x.y)):(ue.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===0?re.top:Math.min(re.top,oe.top)):Math.max(x.y,E===0?re.bottom:Math.max(re.bottom,oe.bottom)),he.x=x.x,he.y=ue.y))):y===180?x.x<a.x||E===270&&x.y<a.y&&oe.left<a.x||E===90&&x.y>a.y&&oe.left<a.x?(ue.h(x.x,a.y),he.h(x.x,(a.y+x.y)/2),E===0?(ue.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),he.x=ue.x,he.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(ue.x=a.x>oe.right?this.computeMidOrthoPosition(a.x,a.y,oe.right,x.y,!1):a.x>oe.left&&(E===270&&a.y<oe.top||E===90&&a.y>oe.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):oe.left,he.x=ue.x,he.y=x.y):E===180&&a.x>oe.right&&a.y>oe.top&&a.y<oe.bottom&&(ue.x=a.x,ue.y=a.y<x.y?Math.min(x.y,oe.top):Math.max(x.y,oe.bottom),he.y=ue.y)):(ue.h(a.x,x.y),he.h((a.x+x.x)/2,x.y),(E===0||E===90&&x.y<re.top||E===270&&x.y>re.bottom)&&(E===0&&(oe.ca(a)||re.ca(x))?ue.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===0||E===90)?ue.y=this.computeMidOrthoPosition(a.x,re.top,x.x,Math.max(x.y,oe.bottom),!0):x.y>a.y&&(E===0||E===270)&&(ue.y=this.computeMidOrthoPosition(a.x,re.bottom,x.x,Math.min(x.y,oe.top),!0)),he.x=x.x,he.y=ue.y),ue.y>re.top&&ue.y<re.bottom&&(x.x<=re.right&&x.x>=a.x||a.x>=oe.left&&a.x<=x.x?(E===90||E===270)&&(ue.h(Math.min((a.x+x.x)/2,a.x),a.y),he.h(ue.x,x.y)):(ue.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===180?re.top:Math.min(re.top,oe.top)):Math.max(x.y,E===180?re.bottom:Math.max(re.bottom,oe.bottom)),he.x=x.x,he.y=ue.y))):y===90?x.y>a.y||E===180&&x.x<a.x&&oe.bottom>a.y||E===0&&x.x>a.x&&oe.bottom>a.y?(ue.h(a.x,x.y),he.h((a.x+x.x)/2,x.y),E===270?(ue.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),he.x=x.x,he.y=ue.y):E===180&&x.x<a.x||E===0&&x.x>a.x?(ue.y=a.y<oe.top?this.computeMidOrthoPosition(a.x,a.y,x.x,oe.top,!0):a.y<oe.bottom&&(E===180&&a.x<oe.left||E===0&&a.x>oe.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):oe.bottom,he.x=x.x,he.y=ue.y):E===90&&a.y<oe.top&&a.x>oe.left&&a.x<oe.right&&(ue.x=a.x<x.x?Math.min(x.x,oe.left):Math.max(x.x,oe.right),ue.y=a.y,he.x=ue.x)):(ue.h(x.x,a.y),he.h(x.x,(a.y+x.y)/2),(E===270||E===0&&x.x<re.left||E===180&&x.x>re.right)&&(E===270&&(oe.ca(a)||re.ca(x))?ue.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===270||E===0)?ue.x=this.computeMidOrthoPosition(re.left,a.y,Math.max(x.x,oe.right),x.y,!1):x.x>a.x&&(E===270||E===180)&&(ue.x=this.computeMidOrthoPosition(re.right,a.y,Math.min(x.x,oe.left),x.y,!1)),he.x=ue.x,he.y=x.y),ue.x>re.left&&ue.x<re.right&&(x.y>=re.top&&x.y<=a.y||a.y<=oe.bottom&&a.y>=x.y?(E===0||E===180)&&(ue.h(a.x,Math.max((a.y+x.y)/2,a.y)),he.h(x.x,ue.y)):(ue.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===90?re.left:Math.min(re.left,oe.left)):Math.max(x.x,E===90?re.right:Math.max(re.right,oe.right)),he.x=ue.x,he.y=x.y))):x.y<a.y||E===180&&x.x<a.x&&oe.top<a.y||E===0&&x.x>a.x&&oe.top<a.y?(ue.h(a.x,x.y),he.h((a.x+x.x)/2,x.y),E===90?(ue.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),he.x=x.x,he.y=ue.y):E===180&&x.x<a.x||E===0&&x.x>=a.x?(ue.y=a.y>oe.bottom?this.computeMidOrthoPosition(a.x,a.y,x.x,oe.bottom,!0):a.y>oe.top&&(E===180&&a.x<oe.left||E===0&&a.x>oe.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):oe.top,he.x=x.x,he.y=ue.y):E===270&&a.y>oe.bottom&&a.x>oe.left&&a.x<oe.right&&(ue.x=a.x<x.x?Math.min(x.x,oe.left):Math.max(x.x,oe.right),ue.y=a.y,he.x=ue.x)):(ue.h(x.x,a.y),he.h(x.x,(a.y+x.y)/2),(E===90||E===0&&x.x<re.left||E===180&&x.x>re.right)&&(E===90&&(oe.ca(a)||re.ca(x))?ue.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===90||E===0)?ue.x=this.computeMidOrthoPosition(re.left,a.y,Math.max(x.x,oe.right),x.y,!1):x.x>a.x&&(E===90||E===180)&&(ue.x=this.computeMidOrthoPosition(re.right,a.y,Math.min(x.x,oe.left),x.y,!1)),he.x=ue.x,he.y=x.y),ue.x>re.left&&ue.x<re.right&&(x.y<=re.bottom&&x.y>=a.y||a.y>=oe.top&&a.y<=x.y?(E===0||E===180)&&(ue.h(a.x,Math.min((a.y+x.y)/2,a.y)),he.h(x.x,ue.y)):(ue.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===270?re.left:Math.min(re.left,oe.left)):Math.max(x.x,E===270?re.right:Math.max(re.right,oe.right)),he.x=ue.x,he.y=x.y)));var pe=x;if(this.isAvoiding){var Se=this.diagram;if(Se===null||b===z||this.layer.isTemporary||!Ic(Se)||re.ca(pe)&&!z.Td(b)||oe.ca(a)&&!b.Td(z))y=!1;else{var Pe=bf(Se,!0,this.containingGroup,null);if(this.segmentIndex!==17&&Pe.Yj(Math.min(a.x,ue.x),Math.min(a.y,ue.y),Math.abs(a.x-ue.x),Math.abs(a.y-ue.y))&&Pe.Yj(Math.min(ue.x,he.x),Math.min(ue.y,he.y),Math.abs(ue.x-he.x),Math.abs(ue.y-he.y))&&Pe.Yj(Math.min(he.x,pe.x),Math.min(he.y,pe.y),Math.abs(he.x-pe.x),Math.abs(he.y-pe.y)))y=!1;else{b=a,z=pe;var Fe=x=null;if(Se.isVirtualized){Se=Pe.bounds.copy(),Se.Bc(-Pe.Ho,-Pe.Go);var Ne=Ie.alloc();vp(Pe,a.x,a.y)||(Re.Ff(Se.x,Se.y,Se.x+Se.width,Se.y+Se.height,a.x,a.y,ue.x,ue.y,Ne)?(x=a=Ne.copy(),y=Ne.ab(ue)):Re.Ff(Se.x,Se.y,Se.x+Se.width,Se.y+Se.height,ue.x,ue.y,he.x,he.y,Ne)?(x=a=Ne.copy(),y=Ne.ab(he)):Re.Ff(Se.x,Se.y,Se.x+Se.width,Se.y+Se.height,he.x,he.y,pe.x,pe.y,Ne)&&(x=a=Ne.copy(),y=Ne.ab(pe))),vp(Pe,pe.x,pe.y)||(Re.Ff(Se.x,Se.y,Se.x+Se.width,Se.y+Se.height,pe.x,pe.y,he.x,he.y,Ne)?(Fe=pe=Ne.copy(),E=he.ab(Ne)):Re.Ff(Se.x,Se.y,Se.x+Se.width,Se.y+Se.height,he.x,he.y,ue.x,ue.y,Ne)?(Fe=pe=Ne.copy(),E=ue.ab(Ne)):Re.Ff(Se.x,Se.y,Se.x+Se.width,Se.y+Se.height,ue.x,ue.y,a.x,a.y,Ne)&&(Fe=pe=Ne.copy(),E=a.ab(Ne))),Ie.free(Ne)}re=re.copy().ed(oe),re.Bc(Pe.Ho*Pe.Os,Pe.Go*Pe.Os),ax(Pe,a,y,pe,E,re,!0),oe=Jh(Pe,pe.x,pe.y),!Pe.abort&&oe>=yp&&(ox(Pe),re.Bc(Pe.Ho*Pe.Hx,Pe.Go*Pe.Ix),ax(Pe,a,y,pe,E,re,!1),oe=Jh(Pe,pe.x,pe.y)),!Pe.abort&&oe<yp&&Jh(Pe,pe.x,pe.y)!==ac?(ry(this,Pe,pe.x,pe.y,E,!0,ee),re=this.i(2),4>this.pointsCount?(y===0||y===180?(re.x=a.x,re.y=pe.y):(re.x=pe.x,re.y=a.y),this.L(2,re.x,re.y),this.m(3,re.x,re.y)):(ee=this.i(3),y===0||y===180?Re.B(re.x,ee.x)?(re=y===0?Math.max(re.x,a.x):Math.min(re.x,a.x),this.L(2,re,a.y),this.L(3,re,ee.y)):Re.B(re.y,ee.y)?(Math.abs(a.y-re.y)<=Pe.Go/2&&(this.L(2,re.x,a.y),this.L(3,ee.x,a.y)),this.m(2,re.x,a.y)):this.L(2,a.x,re.y):(y===90||y===270)&&(Re.B(re.y,ee.y)?(re=y===90?Math.max(re.y,a.y):Math.min(re.y,a.y),this.L(2,a.x,re),this.L(3,ee.x,re)):Re.B(re.x,ee.x)?(Math.abs(a.x-re.x)<=Pe.Ho/2&&(this.L(2,a.x,re.y),this.L(3,a.x,ee.y)),this.m(2,a.x,re.y)):this.L(2,re.x,a.y))),x!==null&&(a=this.i(1),ee=this.i(2),a.x!==ee.x&&a.y!==ee.y?y===0||y===180?this.m(2,a.x,ee.y):this.m(2,ee.x,a.y):y===0||y===180?this.m(2,b.x,x.y):this.m(2,x.x,b.y)),Fe!==null&&(E===0||E===180?this.yf(z.x,Fe.y):this.yf(Fe.x,z.y)),y=!0):y=!1}}}else y=!1;y||(this.ne(ue.copy()),this.ne(he.copy())),Ie.free(ue),Ie.free(he)}},$n.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 iy(a){if(a.diagram===null||!a.isAvoiding||!Ic(a.diagram))return!1;var y=a.points.s,x=y.length;if(4>x)return!1;a=bf(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 ry(a,y,x,E,b,z,ee){var re=y.Ho,oe=y.Go,ue=Jh(y,x,E),he=x,pe=E;for(b===0?he+=re:b===90?pe+=oe:b===180?he-=re:pe-=oe,b!==ee&&ue>Of&&Jh(y,he,pe)!==ue-1&&(Jh(y,x-re,E)===ue-1?(b=180,he=x-re,pe=E):Jh(y,x+re,E)===ue-1?(b=0,he=x+re,pe=E):Jh(y,x,E-oe)===ue-1?(b=270,he=x,pe=E-oe):Jh(y,x,E+oe)===ue-1&&(b=90,he=x,pe=E+oe));ue>Of&&Jh(y,he,pe)===ue-1;)x=he,E=pe,b===0?he+=re:b===90?pe+=oe:b===180?he-=re:pe-=oe,--ue;z?ue>Of&&(b===180||b===0?x=Math.floor(x/re)*re+re/2:(b===90||b===270)&&(E=Math.floor(E/oe)*oe+oe/2)):(x=Math.floor(x/re)*re+re/2,E=Math.floor(E/oe)*oe+oe/2),ue>Of&&(z=b,ee=x,he=E,b===0?(z=90,he+=oe):b===90?(z=180,ee-=re):b===180?(z=270,he-=oe):b===270&&(z=0,ee+=re),Jh(y,ee,he)===ue-1?ry(a,y,ee,he,z,!1,z):(ee=x,he=E,b===0?(z=270,he-=oe):b===90?(z=0,ee+=re):b===180?(z=90,he+=oe):b===270&&(z=180,ee-=re),Jh(y,ee,he)===ue-1&&ry(a,y,ee,he,z,!1,z))),a.yf(x,E)}$n.prototype.ez=function(a){var y=a.x;a=a.y;for(var x=this.i(0),E=this.i(1),b=ui(y,a,x.x,x.y,E.x,E.y),z=0,ee=1;ee<this.pointsCount-1;ee++){x=this.i(ee+1);var re=ui(y,a,E.x,E.y,x.x,x.y);E=x,re<b&&(z=ee,b=re)}return z},$n.prototype.qc=function(){this.lk=!1,this.v()},$n.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 lo&&(b.ua=this.ua)}}},$n.prototype.makeGeometry=function(){var a=this.ua,y=this.pointsCount,x=!1,E=this.diagram;E!==null&&If(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 ee=this.computeCurve();if(ee===fu&&3<=y&&!Re.$(this.smoothness,0))if(y===3){var re=this.i(1);E=Math.min(b.x,re.x);var oe=Math.min(b.y,re.y);re=this.i(2),E=Math.min(E,re.x),oe=Math.min(oe,re.y)}else{if(this.isOrthogonal)for(oe=0;oe<y;oe++)re=E[oe],z.x=Math.min(re.x,z.x),z.y=Math.min(re.y,z.y);else for(E=3;E<y;E+=3)E+3>=y&&(E=y-1),oe=this.i(E),z.x=Math.min(oe.x,z.x),z.y=Math.min(oe.y,z.y);E=z.x,oe=z.y}else{for(oe=0;oe<y;oe++)re=E[oe],z.x=Math.min(re.x,z.x),z.y=Math.min(re.y,z.y);E=z.x,oe=z.y}if(E-=this.su.x,oe-=this.su.y,b.x-=E,b.y-=oe,y!==2||If(this)){if(a.type=ut.o,re=A1(a),this.computeShortLength(!0)!==0&&(b=Eg(this,b,!0,z)),fp(re,b.x,b.y,!1),ee===fu&&3<=y&&!Re.$(this.smoothness,0))if(y===3)x=this.i(1),y=x.x-E,x=x.y-oe,b=this.i(2).copy(),b.x-=E,b.y-=oe,this.computeShortLength(!1)!==0&&(b=Eg(this,b,!1,z)),tc(re,y,x,y,x,b.x,b.y);else if(this.isOrthogonal){y=Ie.allocAt(E,oe),x=Ie.alloc(),x.assign(this.i(1)),z=Ie.allocAt(E,oe),b=Ie.allocAt(E,oe),ee=this.i(0);for(var ue,he=this.smoothness/3,pe=1;pe<this.pointsCount-1;pe++){ue=this.i(pe);var Se=ee,Pe=ue,Fe=this.i(oy(this,ue,pe,!1));if((!Re.$(Se.x,Pe.x)||!Re.$(Pe.x,Fe.x))&&(!Re.$(Se.y,Pe.y)||!Re.$(Pe.y,Fe.y))){var Ne=he;isNaN(Ne)&&(Ne=this.smoothness/3);var Xe=Se.x;Se=Se.y;var Ve=Pe.x;Pe=Pe.y;var ht=Fe.x;Fe=Fe.y;var ft=Ne*x0(Xe,Se,Ve,Pe);Ne*=x0(Ve,Pe,ht,Fe),Re.$(Se,Pe)&&Re.$(Ve,ht)&&(Ve>Xe?Fe>Pe?(z.x=Ve-ft,z.y=Pe-ft,b.x=Ve+Ne,b.y=Pe+Ne):(z.x=Ve-ft,z.y=Pe+ft,b.x=Ve+Ne,b.y=Pe-Ne):Fe>Pe?(z.x=Ve+ft,z.y=Pe-ft,b.x=Ve-Ne,b.y=Pe+Ne):(z.x=Ve+ft,z.y=Pe+ft,b.x=Ve-Ne,b.y=Pe-Ne)),Re.$(Xe,Ve)&&Re.$(Pe,Fe)&&(Pe>Se?(ht>Ve?(z.x=Ve-ft,z.y=Pe-ft,b.x=Ve+Ne):(z.x=Ve+ft,z.y=Pe-ft,b.x=Ve-Ne),b.y=Pe+Ne):(ht>Ve?(z.x=Ve-ft,z.y=Pe+ft,b.x=Ve+Ne):(z.x=Ve+ft,z.y=Pe+ft,b.x=Ve-Ne),b.y=Pe-Ne)),(Re.$(Xe,Ve)&&Re.$(Ve,ht)||Re.$(Se,Pe)&&Re.$(Pe,Fe))&&(Xe=.5*(Xe+ht),Se=.5*(Se+Fe),z.x=Xe,z.y=Se,b.x=Xe,b.y=Se),(pe===1||pe===2&&Re.$(ee.x,this.i(0).x)&&Re.$(ee.y,this.i(0).y))&&(x.x=.5*(ee.x+ue.x),x.y=.5*(ee.y+ue.y)),tc(re,x.x-E,x.y-oe,z.x-E,z.y-oe,ue.x-E,ue.y-oe),y.set(z),x.set(b),ee=ue}}ue=ee.x,ee=ee.y,he=this.i(this.pointsCount-1),this.computeShortLength(!1)!==0&&(he=Eg(this,he.copy(),!1,qn)),ue=.5*(ue+he.x),ee=.5*(ee+he.y),tc(re,b.x-E,b.y-oe,ue-E,ee-oe,he.x-E,he.y-oe),Ie.free(y),Ie.free(x),Ie.free(z),Ie.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),ee=this.i(x),x===y-1&&this.computeShortLength(!1)!==0&&(ee=Eg(this,ee.copy(),!1,qn)),tc(re,z.x-E,z.y-oe,b.x-E,b.y-oe,ee.x-E,ee.y-oe);else{for(z=Ie.alloc(),z.assign(this.i(0)),b=Ie.alloc(),b.assign(z),ee=this.computeCorner(),pe=1,ue=0;pe<y;){if(pe=oy(this,z,pe,1<pe),he=this.i(pe),pe>=y-1){if(!z.D(he))this.computeShortLength(!1)!==0&&(he=Eg(this,he.copy(),!1,qn)),Cg(this,re,-E,-oe,z,he,x);else if(ue===0)for(pe=1;pe<y;)b.assign(z),he=this.i(pe++),Cg(this,re,-E,-oe,z,he,x),z.assign(he);break}if(ue=oy(this,he,pe+1,pe<y-3),pe=-E,Xe=-oe,Se=he,Ve=this.i(ue),Ne=x,Re.B(z.y,Se.y)&&Re.B(Se.x,Ve.x))if(Fe=Math.min(ee,Math.abs(Se.x-b.x)/2),Fe=ft=Math.min(Fe,Math.abs(Ve.y-Se.y)/2),Re.B(Fe,0))Cg(this,re,pe,Xe,z,Se,Ne),z.assign(Se);else{var mt=Se.x,Ct=Se.y;Pe=mt,ht=Ct,Se.x>z.x?mt=Se.x-Fe:mt=Se.x+Fe,Ve.y>Se.y?ht=Se.y+ft:ht=Se.y-ft,Ve=Ie.allocAt(mt,Ct),Cg(this,re,pe,Xe,z,Ve,Ne),Ie.free(Ve),u0(re,Se.x+pe,Se.y+Xe,Pe+pe,ht+Xe),z.h(Pe,ht)}else Re.B(z.x,Se.x)&&Re.B(Se.y,Ve.y)?(Fe=Math.min(ee,Math.abs(Se.y-b.y)/2),Fe=ft=Math.min(Fe,Math.abs(Ve.x-Se.x)/2),Re.B(ft,0)?(Cg(this,re,pe,Xe,z,Se,Ne),z.assign(Se)):(mt=Se.x,Ct=Se.y,Pe=mt,ht=Ct,Se.y>z.y?Ct=Se.y-Fe:Ct=Se.y+Fe,Ve.x>Se.x?Pe=Se.x+ft:Pe=Se.x-ft,Ve=Ie.allocAt(mt,Ct),Cg(this,re,pe,Xe,z,Ve,Ne),Ie.free(Ve),u0(re,Se.x+pe,Se.y+Xe,Pe+pe,ht+Xe),z.h(Pe,ht))):(Cg(this,re,pe,Xe,z,Se,Ne),z.assign(Se));b.assign(he),pe=ue}Ie.free(z)}h0=re}else re=this.i(1).copy(),re.x-=E,re.y-=oe,this.computeShortLength(!0)!==0&&(b=Eg(this,b,!0,z)),this.computeShortLength(!1)!==0&&(re=Eg(this,re,!1,z)),a.type=ut.j,a.startX=b.x,a.startY=b.y,a.endX=re.x,a.endY=re.y;return this.lk=!0,a};function x0(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),Re.$(a,0)?y:Re.$(y,0)?a:Math.sqrt(a*a+y*y)))}function Eg(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=x0(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=x0(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 oy(a,y,x,E){for(var b=a.pointsCount,z=y;Re.$(y.x,z.x)&&Re.$(y.y,z.y);){if(x>=b)return b-1;z=a.i(x++)}if(!Re.$(y.x,z.x)&&!Re.$(y.y,z.y))return x-1;for(var ee=z;Re.$(y.x,z.x)&&Re.$(z.x,ee.x)&&(!E||(y.y>=z.y?z.y>=ee.y:z.y<=ee.y))||Re.$(y.y,z.y)&&Re.$(z.y,ee.y)&&(!E||(y.x>=z.x?z.x>=ee.x:z.x<=ee.x));){if(x>=b)return b-1;ee=a.i(x++)}return x-2}$n.prototype.computeJumpLength=function(){return 10};function Cg(a,y,x,E,b,z,ee){if(!ee&&If(a)){ee=a.computeJumpLength();var re=ee/2,oe=[],ue=0;if(a.isVisible()&&(ue=bS(a,b,z,oe)),0<ue){if(Re.B(b.y,z.y))if(b.x<z.x)for(var he=0;he<ue;){var pe=Math.max(b.x,Math.min(oe[he++]-re,z.x-ee));y.lineTo(pe+x,z.y+E);for(var Se=pe+x,Pe=Math.min(pe+ee,z.x);he<ue&&(pe=oe[he],pe<Pe+ee);)he++,Pe=Math.min(pe+re,z.x);pe=z.y-ee+E,Pe+=x;var Fe=z.y+E;a.curve===oc?fp(y,Pe,Fe,!1):tc(y,Se,pe,Pe,pe,Pe,Fe)}else for(--ue;0<=ue;){for(he=Math.min(b.x,Math.max(oe[ue--]+re,z.x+ee)),y.lineTo(he+x,z.y+E),Se=he+x,pe=Math.max(he-ee,z.x);0<=ue&&(he=oe[ue],he>pe-ee);)ue--,pe=Math.max(he-re,z.x);he=z.y-ee+E,pe+=x,Pe=z.y+E,a.curve===oc?fp(y,pe,Pe,!1):tc(y,Se,he,pe,he,pe,Pe)}else if(Re.B(b.x,z.x))if(b.y<z.y)for(he=0;he<ue;){for(pe=Math.max(b.y,Math.min(oe[he++]-re,z.y-ee)),y.lineTo(z.x+x,pe+E),Se=pe+E,pe=Math.min(pe+ee,z.y);he<ue&&(Pe=oe[he],Pe<pe+ee);)he++,pe=Math.min(Pe+re,z.y);Pe=z.x-ee+x,Fe=z.x+x,pe+=E,a.curve===oc?fp(y,Fe,pe,!1):tc(y,Pe,Se,Pe,pe,Fe,pe)}else for(--ue;0<=ue;){for(he=Math.min(b.y,Math.max(oe[ue--]+re,z.y+ee)),y.lineTo(z.x+x,he+E),Se=he+E,he=Math.max(he-ee,z.y);0<=ue&&(pe=oe[ue],pe>he-ee);)ue--,he=Math.max(pe-re,z.y);pe=z.x-ee+x,Pe=z.x+x,he+=E,a.curve===oc?fp(y,Pe,he,!1):tc(y,pe,Se,pe,he,Pe,he)}}}y.lineTo(z.x+x,z.y+E)}function bS(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 ee=z.length,re=0;re<ee;re++){var oe=z[re];if(oe instanceof $n){if(oe===a)return 0<E.length&&E.sort(function(he,pe){return he-pe}),E.length;if(oe.isVisible()&&If(oe)){var ue=oe.routeBounds;ue.w()&&a.routeBounds.Yc(ue)&&!a.usesSamePort(oe)&&(ue=oe.path,ue!==null&&ue.Ed()&&FS(y,x,E,oe))}}}}}return 0<E.length&&E.sort(function(he,pe){return he-pe}),E.length}function FS(a,y,x,E){for(var b=Re.B(a.y,y.y),z=E.pointsCount,ee=E.i(0),re=Ie.alloc(),oe=1;oe<z;oe++){var ue=E.i(oe);if(oe<z-1){var he=E.i(oe+1);if(ee.y===ue.y&&ue.y===he.y){if(ue.x>ee.x&&he.x>=ue.x||ue.x<ee.x&&he.x<=ue.x)continue}else if(ee.x===ue.x&&ue.x===he.x&&(ue.y>ee.y&&he.y>=ue.y||ue.y<ee.y&&he.y<=ue.y))continue}e:{he=a.x;var pe=a.y,Se=y.x,Pe=y.y,Fe=ee.x;ee=ee.y;var Ne=ue.x,Xe=ue.y;if(Re.B(he,Se)){if(!Re.B(pe,Pe)&&Re.B(ee,Xe)&&Math.min(pe,Pe)<ee&&Math.max(pe,Pe)>ee&&Math.min(Fe,Ne)<he&&Math.max(Fe,Ne)>he&&!Re.B(Fe,Ne)){re.x=he,re.y=ee,he=!0;break e}}else if(Re.B(pe,Pe)&&Re.B(Fe,Ne)&&Math.min(he,Se)<Fe&&Math.max(he,Se)>Fe&&Math.min(ee,Xe)<pe&&Math.max(ee,Xe)>pe&&!Re.B(ee,Xe)){re.x=Fe,re.y=pe,he=!0;break e}re.x=0,re.y=0,he=!1}he&&(b?x.push(re.x):x.push(re.y)),ee=ue}Ie.free(re)}function If(a){return a=a.curve,a===mp||a===oc}function S0(a,y){(y||If(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()))}$n.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 ee=b.length,re=0;re<ee;re++){var oe=b[re];oe instanceof $n&&(oe===this?z=!0:z&&tx(this,oe,a))}}else if(E)for(z=b.Pa.s,b=z.length,ee=0;ee<b;ee++)re=z[ee],re instanceof $n&&tx(this,re,a)}}}}};function tx(a,y,x){if(y!==null&&y.lk&&y.fd&&If(y)){var E=y.routeBounds;E.w()&&(a.routeBounds.Yc(E)||x.Yc(E))&&(a.usesSamePort(y)||y.qc())}}$n.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},$n.prototype.isVisible=function(){if(!pr.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},$n.prototype.Zb=function(a){if(pr.prototype.Zb.call(this,a),a&&S0(this,!1),this.Sf!==null&&this.Sf.Sl(),this.wd!==null)for(var y=this.wd.iterator;y.next();)y.value.Zb(a)},$n.prototype.computeAdjusting=function(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?em:this.qk};function $p(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,ee=y.jb.s,re=ee.length,oe=0;oe<re;oe++){var ue=ee[oe];(ue.ef===y&&ue.ff===E&&ue.uf===x&&ue.vf===b||ue.ef===x&&ue.ff===b&&ue.uf===y&&ue.vf===E)&&(z===null?z=ue:(a===null&&(a=[],a.push(z)),a.push(ue)))}if(a!==null){for(z=W1(y,x,E,b),z===null&&(z=new b0(y,E,x,b),G1(y,z),G1(x,z)),z.links=a,y=0;y<a.length;y++)a[y].Sf=z;z.Sl()}}}}function qp(a){var y=a.Sf;y!==null&&isNaN(a.curviness)&&(a.Sf=null,a=y.links.indexOf(a),0<=a&&(Vi(y.links,a),y.Sl()))}$n.prototype.ph=function(){return!0},fn.Object.defineProperties($n.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&&g0(y,this,x),qp(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 ee=!0;E!==null&&(ee=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=ee)}a!==null&&(this.uf!==a&&f0(a,this,b),$p(this),this.C(1)),this.g("fromNode",y,a),gp(this)}}},fromPortId:{get:function(){return this.ff},set:function(a){var y=this.ff;if(y!==a){var x=this.fromPort;x!==null&&nu(x),qp(this),this.ff=a;var E=this.fromPort;E!==null&&nu(E);var b=this.diagram;if(b!==null){var z=this.data,ee=b.model;z!==null&&ee.ri()&&ee.xv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.fromPortChanged,z!==null&&(ee=!0,b!==null&&(ee=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=ee))),$p(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&&g0(y,this,x),qp(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 ee=!0;E!==null&&(ee=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=ee)}a!==null&&(this.ef!==a&&f0(a,this,b),$p(this),this.C(1)),this.g("toNode",y,a),gp(this)}}},toPortId:{get:function(){return this.vf},set:function(a){var y=this.vf;if(y!==a){var x=this.toPort;x!==null&&nu(x),qp(this),this.vf=a;var E=this.toPort;E!==null&&nu(E);var b=this.diagram;if(b!==null){var z=this.data,ee=b.model;z!==null&&ee.ri()&&ee.Cv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.toPortChanged,z!==null&&(ee=!0,b!==null&&(ee=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=ee))),$p(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:or},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&&nu(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&&Kn(a,">= 0",$n,"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:or},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&&nu(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&&Kn(a,">= 0",$n,"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?mo: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&&Qp(this.fromNode),this.toNode!==null&&Qp(this.toNode))}},path:{get:function(){var a=this.Pb();return a instanceof lo?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()===fu&&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),Re.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 ee=this.i(z-2);z+3>=E&&(z=E-1);var re=this.i(z-1),oe=this.i(z);Re.Dl(b.x,b.y,ee.x,ee.y,re.x,re.y,oe.x,oe.y,.5,a),y=Math.min(oe.x,y),x=Math.min(oe.y,x),b=oe}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 Ie)}},midAngle:{get:function(){return this.vg(),this.computeMidAngle()}},flattenedLengths:{get:function(){if(this.cq===null){this.fd||m0(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);Re.$(E.x,b.x)?(E=b.y-E.y,0>E&&(E=-E)):Re.$(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 Bn,E=0;E<a.length/2;E++)b=new Ie(a[2*E],a[2*E+1]).freeze(),x.add(b);else{for(E=!0,b=0;b<a.length;b++){var z=a[b];if(!Qt(z)||typeof z.x!="number"||isNaN(z.x)||typeof z.y!="number"||isNaN(z.y)){E=!1;break}}if(E)for(x=new Bn,E=0;E<a.length;E++)b=a[E],x.add(new Ie(b.x,b.y).freeze())}}else if(a instanceof Bn)for(x=a.copy(),a=x.iterator;a.next();)a.value.freeze();else at("Link.points value is not an instance of List or Array: "+a);x.freeze(),this.Nb=x,this.qc(),m0(this),a=this.diagram,a!==null&&(a.pi||a.undoManager.isUndoingRedoing||a.As.add(this),a.animationManager.zb&&Lc(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||!pp(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return a===0?0:2>=a?a-1:this.isOrthogonal||!pp(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(),S0(this,y===oc||y===mp||a===oc||a===mp),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(),S0(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)}}}),$n.prototype.invalidateOtherJumpOvers=$n.prototype.Xo,$n.prototype.findClosestSegment=$n.prototype.ez,$n.prototype.updateRoute=$n.prototype.vg,$n.prototype.invalidateRoute=$n.prototype.bb,$n.prototype.rollbackRoute=$n.prototype.rv,$n.prototype.commitRoute=$n.prototype.zf,$n.prototype.startRoute=$n.prototype.uh,$n.prototype.clearPoints=$n.prototype.Fj,$n.prototype.removePoint=$n.prototype.pv,$n.prototype.addPointAt=$n.prototype.yf,$n.prototype.addPoint=$n.prototype.ne,$n.prototype.insertPointAt=$n.prototype.m,$n.prototype.insertPoint=$n.prototype.Kz,$n.prototype.setPointAt=$n.prototype.L,$n.prototype.setPoint=$n.prototype.dd,$n.prototype.getPoint=$n.prototype.i,$n.prototype.getOtherPort=$n.prototype.Cz,$n.prototype.getOtherNode=$n.prototype.To;var bg=null,Fg=null,ay=new Ot($n,"Normal",1),LS=new Ot($n,"Orthogonal",2),BS=new Ot($n,"AvoidsNodes",6),nx=new Ot($n,"AvoidsNodesStraight",7),Sl=new Ot($n,"None",0),fu=new Ot($n,"Bezier",9),oc=new Ot($n,"JumpGap",10),mp=new Ot($n,"JumpOver",11),em=new Ot($n,"End",17),w0=new Ot($n,"Scale",18),P0=new Ot($n,"Stretch",19),tm=new Ot($n,"OrientAlong",21),nm=new Ot($n,"OrientPlus90",22),im=new Ot($n,"OrientMinus90",23),sy=new Ot($n,"OrientOpposite",24),E0=new Ot($n,"OrientUpright",25),rm=new Ot($n,"OrientPlus90Upright",26),om=new Ot($n,"OrientMinus90Upright",27),C0=new Ot($n,"OrientUpright45",28),ix=16,rx=14,am=8;$n.className="Link",$n.Normal=ay,$n.Orthogonal=LS,$n.AvoidsNodes=BS,$n.AvoidsNodesStraight=nx,$n.None=Sl,$n.Bezier=fu,$n.JumpGap=oc,$n.JumpOver=mp,$n.End=em,$n.Scale=w0,$n.Stretch=P0,$n.OrientAlong=tm,$n.OrientPlus90=nm,$n.OrientMinus90=im,$n.OrientOpposite=sy,$n.OrientUpright=E0,$n.OrientPlus90Upright=rm,$n.OrientMinus90Upright=om,$n.OrientUpright45=C0,$n.EndSegmentStep=8,$n.CurvinessStart=ix,$n.SpacingMin=rx,$n.OrthoShortCut=am;function b0(a,y,x,E){Er(this),this.Fe=this.qq=!1,this.Ds=a,this.Ox=y,this.cv=x,this.Px=E,this.links=[]}b0.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},b0.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))}},b0.className="LinkBundle";function sm(a){Er(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}sm.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=ly,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 vp(a,y,x){return a.Nd<=y&&y<=a.En&&a.Od<=x&&x<=a.Fn}function Jh(a,y,x){return vp(a,y,x)?(y-=a.Nd,y/=a.rc,x-=a.Od,x/=a.sc,a.ac[y|0][x|0]):ly}function ox(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]>=Of&&(x[E]=ly)}sm.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]===ac)return!1}return!0};function Qh(a,y,x,E,b,z,ee,re,oe){if(!(y<z||y>ee||x<re||x>oe)){var ue=y|0,he=x|0,pe=a.ac[ue][he];if(pe>=Of&&pe<yp)for(b?he+=E:ue+=E,pe+=1;z<=ue&&ue<=ee&&re<=he&&he<=oe&&!(pe>=a.ac[ue][he]);)a.ac[ue][he]=pe,pe+=1,b?he+=E:ue+=E;if(ue=b?he:ue,b)if(0<E)for(x+=E;x<ue;x+=E)Qh(a,y,x,1,!b,z,ee,re,oe),Qh(a,y,x,-1,!b,z,ee,re,oe);else for(x+=E;x>ue;x+=E)Qh(a,y,x,1,!b,z,ee,re,oe),Qh(a,y,x,-1,!b,z,ee,re,oe);else if(0<E)for(y+=E;y<ue;y+=E)Qh(a,y,x,1,!b,z,ee,re,oe),Qh(a,y,x,-1,!b,z,ee,re,oe);else for(y+=E;y>ue;y+=E)Qh(a,y,x,1,!b,z,ee,re,oe),Qh(a,y,x,-1,!b,z,ee,re,oe)}}function F0(a,y,x,E,b,z,ee,re,oe){y|=0,x|=0;var ue=ac,he=Of;for(a.ac[y][x]=he;ue===ac&&y>z&&y<ee&&x>re&&x<oe;)he+=1,a.ac[y][x]=he,b?x+=E:y+=E,ue=a.ac[y][x]}function L0(a,y,x,E,b,z,ee,re,oe){y|=0,x|=0;var ue=ac,he=yp;for(a.ac[y][x]=he;ue===ac&&y>z&&y<ee&&x>re&&x<oe;)a.ac[y][x]=he,b?x+=E:y+=E,ue=a.ac[y][x]}function ax(a,y,x,E,b,z,ee){if(a.ac!==null){a.abort=!1;var re=y.x,oe=y.y;if(vp(a,re,oe)){re-=a.Nd,re/=a.rc,oe-=a.Od,oe/=a.sc;var ue=E.x,he=E.y;if(vp(a,ue,he))if(ue-=a.Nd,ue/=a.rc,he-=a.Od,he/=a.sc,1>=Math.abs(re-ue)&&1>=Math.abs(oe-he))a.abort=!0;else{var pe=z.x;E=z.y,y=z.x+z.width;var Se=z.y+z.height;pe-=a.Nd,pe/=a.rc,E-=a.Od,E/=a.sc,y-=a.Nd,y/=a.rc,Se-=a.Od,Se/=a.sc,z=Math.max(0,Math.min(a.di,pe|0)),y=Math.min(a.di,Math.max(0,y|0)),pe=Math.max(0,Math.min(a.ei,E|0)),Se=Math.min(a.ei,Math.max(0,Se|0)),E=a.ac,re|=0,oe|=0,ue|=0,he|=0;var Pe=x===0||x===90?1:-1;if(x=x===90||x===270,E[re][oe]===ac?(F0(a,re,oe,Pe,x,z,y,pe,Se),F0(a,re,oe,1,!x,z,y,pe,Se),F0(a,re,oe,-1,!x,z,y,pe,Se)):F0(a,re,oe,Pe,x,re,oe,re,oe),E[ue][he]===ac?(L0(a,ue,he,b===0||b===90?1:-1,b===90||b===270,z,y,pe,Se),L0(a,ue,he,1,!(b===90||b===270),z,y,pe,Se),L0(a,ue,he,-1,!(b===90||b===270),z,y,pe,Se)):L0(a,ue,he,Pe,x,ue,he,ue,he),x=xi(),ee&&sx(a,ue,he,b,re,oe,x))for((x[0]!==ue||x[1]!==he)&&(x.unshift(he),x.unshift(ue)),(x[x.length-2]!==re||x[x.length-1]!==oe)&&(x.push(re),x.push(oe)),a=Of,b=x[x.length-2],ee=x[x.length-1],E[b][ee]=a++,z=x.length-4;0<=z;z-=2)for(b=x[z+2],ee=x[z+3],y=x[z],ue=x[z+1];y>b?b++:y<b?b--:ue>ee?ee++:ue<ee&&ee--,E[b][ee]=a++,b!==y||ee!==ue;);else Qh(a,re,oe,1,!1,z,y,pe,Se),Qh(a,re,oe,-1,!1,z,y,pe,Se),Qh(a,re,oe,1,!0,z,y,pe,Se),Qh(a,re,oe,-1,!0,z,y,pe,Se);Bi(x)}}}}function sx(a,y,x,E,b,z,ee){for(var re=a.ac,oe=y,ue=x;;){if(oe===b&&ue===z)return!0;var he=oe,pe=ue;if(E===0)if(he<b)he++;else break;else if(E===90)if(pe<z)pe++;else break;else if(E===180)if(he>b)he--;else break;else if(pe>z)pe--;else break;var Se=re[he][pe];if(Se===0||Se===uy)break;oe=he,ue=pe}for(;;){if(he=E,pe=oe,Se=ue,E===0?Se<z?(he=90,Se++):Se>z&&(he=270,Se--):E===90?pe<b?(he=0,pe++):pe>b&&(he=180,pe--):E===180?Se<z?(he=90,Se++):Se>z&&(he=270,Se--):pe<b?(he=0,pe++):pe>b&&(he=180,pe--),pe=re[pe][Se],he!==E&&pe!==0&&pe!==uy){if(ee.push(oe),ee.push(ue),sx(a,oe,ue,he,b,z,ee))return!0;ee.pop(),ee.pop()}if(re[oe][ue]=uy,E===0){if(oe===y)return!1;oe--}else if(E===90){if(ue===x)return!1;ue--}else if(E===180){if(oe===y)return!1;oe++}else{if(ue===x)return!1;ue++}}}fn.Object.defineProperties(sm.prototype,{bounds:{get:function(){return new Gt(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 ac=0,Of=1,yp=999999,ly=yp+1,uy=yp+2;sm.className="PositionArray";function Lg(){Er(this),this.port=this.node=null,this.pe=[],this.ap=!1}Lg.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 MS(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}Lg.prototype.Sl=function(){this.pe.length=0};function lx(a,y){var x=a.pe;if(x.length===0){e:if(!a.ap){x=a.ap,a.ap=!0;var E=null,b=a.node,z=b instanceof no?b:null;if(z===null||z.isSubGraphExpanded)var ee=b.isTreeExpanded?b.findLinksConnected(a.port.portId):b.qx();else{if(!z.actualBounds.w()){a.ap=x;break e}E=z,ee=E.Lu()}z=a.pe.length=0;var re=a.port.ga(Co,Ie.alloc()),oe=a.port.ga(Ht,Ie.alloc());for(b=Gt.allocAt(re.x,re.y,0,0),b.Ye(oe),Ie.free(re),Ie.free(oe),re=Ie.allocAt(b.x+b.width/2,b.y+b.height/2),oe=a.port.li(),ee=ee.iterator;ee.next();){var ue=ee.value;if(ue.isVisible()&&ue.fromPort!==ue.toPort){var he=ue.fromPort===a.port||ue.fromNode!==null&&ue.fromNode.Td(E),pe=ue.computeSpot(he,a.port);if(pe.$c()&&(he=he?ue.toPort:ue.fromPort,he!==null)){var Se=he.part;if(Se!==null){var Pe=Se.findVisibleNode();Pe!==null&&Pe!==Se&&(Se=Pe,he=Se.port),he=ue.computeOtherPoint(Se,he),Se=re.ab(he),Se-=oe,0>Se?Se+=360:360<=Se&&(Se-=360),pe=MS(b,pe,Se,ue.isOrthogonal),pe===0?(pe=4,180<Se&&(Se-=360)):pe===90?(pe=8,270<Se&&(Se-=360)):pe===180?pe=2:(pe=1,90>Se&&(Se+=360)),Pe=a.pe[z],Pe===void 0?(Pe=new hy(ue,Se,pe),a.pe[z]=Pe):(Pe.link=ue,Pe.angle=Se,Pe.Nc=pe),Pe.hv.set(he),z++}}}}for(Ie.free(re),a.pe.sort(Lg.prototype.j),oe=a.pe.length,E=-1,z=re=0;z<oe;z++)ee=a.pe[z],ee!==void 0&&(ee.Nc!==E&&(E=ee.Nc,re=0),ee.Uo=re,re++);for(E=-1,re=0,z=oe-1;0<=z;z--)oe=a.pe[z],oe!==void 0&&(oe.Nc!==E&&(E=oe.Nc,re=oe.Uo+1),oe.Gl=re);if(z=a.pe,pe=a.port,E=a.node.portSpreading,re=Ie.alloc(),oe=Ie.alloc(),ee=Ie.alloc(),ue=Ie.alloc(),pe.ga(Co,re),pe.ga(Ko,oe),pe.ga(Ht,ee),pe.ga(Za,ue),Pe=Se=he=pe=0,E===qv)for(var Fe=0;Fe<z.length;Fe++){var Ne=z[Fe];if(Ne!==null){var Xe=Ne.link.computeThickness();switch(Ne.Nc){case 8:Se+=Xe;break;case 2:Pe+=Xe;break;case 1:pe+=Xe;break;default:case 4:he+=Xe}}}var Ve=Fe=0,ht=1,ft=Ne=0;for(Xe=0;Xe<z.length;Xe++){var mt=z[Xe];if(mt!==null){if(Fe!==mt.Nc){switch(Fe=mt.Nc,Fe){case 8:var Ct=ee;Ve=ue;break;case 2:Ct=ue,Ve=re;break;case 1:Ct=re,Ve=oe;break;default:case 4:Ct=oe,Ve=ee}switch(Ne=Ve.x-Ct.x,ft=Ve.y-Ct.y,Fe){case 8:Se>Math.abs(Ne)?(ht=Math.abs(Ne)/Se,Se=Math.abs(Ne)):ht=1;break;case 2:Pe>Math.abs(ft)?(ht=Math.abs(ft)/Pe,Pe=Math.abs(ft)):ht=1;break;case 1:pe>Math.abs(Ne)?(ht=Math.abs(Ne)/pe,pe=Math.abs(Ne)):ht=1;break;default:case 4:he>Math.abs(ft)?(ht=Math.abs(ft)/he,he=Math.abs(ft)):ht=1}Ve=0}var Kt=mt.Zo;if(E===qv){switch(mt=mt.link.computeThickness(),mt*=ht,Kt.set(Ct),Fe){case 8:Kt.x=Ct.x+Ne/2+Se/2-Ve-mt/2;break;case 2:Kt.y=Ct.y+ft/2+Pe/2-Ve-mt/2;break;case 1:Kt.x=Ct.x+Ne/2-pe/2+Ve+mt/2;break;default:case 4:Kt.y=Ct.y+ft/2-he/2+Ve+mt/2}Ve+=mt}else{var yi=.5;E===p0&&(yi=(mt.Uo+1)/(mt.Gl+1)),Kt.x=Ct.x+Ne*yi,Kt.y=Ct.y+ft*yi}}}for(Ie.free(re),Ie.free(oe),Ie.free(ee),Ie.free(ue),Ct=a.pe,z=0;z<Ct.length;z++)E=Ct[z],E!==null&&(E.Ju=a.computeEndSegmentLength(E));a.ap=x,Gt.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}Lg.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},Lg.prototype.computeEndSegmentLength=function(a){var y=a.link,x=y.computeEndSegmentLength(this.node,this.port,Xr,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)},Lg.className="Knot";function hy(a,y,x){this.link=a,this.angle=y,this.Nc=x,this.hv=new Ie,this.Gl=this.Uo=0,this.Zo=new Ie,this.Ju=0}hy.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()},hy.className="LinkInfo";function Va(a){Er(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new Ie(0,0).freeze(),this.vn=!0,this.Em=this.un=null,this.xn=!1,this.j=null,a&&Object.assign(this,a)}Va.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},Va.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},Va.prototype.qb=function(){},Va.prototype.toString=function(){var a=Ii(this.constructor);return a+="(",this.group!==null&&(a+=" in "+this.group),this.diagram!==null&&(a+=" for "+this.diagram),a+")"},Va.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())}}},Va.prototype.createNetwork=function(){return new za(this)},Va.prototype.makeNetwork=function(a){var y=this.createNetwork();return a instanceof Vt?(y.lg(a.nodes,!0),y.lg(a.links,!0)):a instanceof no?y.lg(a.memberParts):y.lg(a.iterator),y},Va.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")}},Va.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()}},Va.prototype.doLayout=function(a){var y=new In;a instanceof Vt?(Kc(this,y,a.nodes,!0,this.rh,!0,!1,!0),Kc(this,y,a.parts,!0,this.rh,!0,!1,!0)):a instanceof no?Kc(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},Va.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,ee=0;for(a=a.iterator;a.next();){var re=a.value;lm(re);var oe=re.measuredBounds,ue=oe.width;oe=oe.height,re.moveTo(E,b),re instanceof no&&(re.rh=!1),E+=Math.max(ue,50)+20,ee=Math.max(ee,Math.max(oe,50)),z>=y-1?(z=0,E=x,b+=ee+20,ee=0):z++}},Va.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,ee=this.network.vertexes.iterator;ee.next();){var re=ee.value.node;if(!(re===null||re instanceof $n)&&(lm(re),this.rh(re))){var oe=re.measuredBounds,ue=oe.width;oe=oe.height,re.moveTo(x,E),re instanceof no&&(re.rh=!1),x+=Math.max(ue,50)+20,z=Math.max(z,Math.max(oe,50)),b>=a-1?(b=0,x=y,E+=z+20,z=0):b++}}},Va.prototype.rh=function(a){return!!(!a.location.w()||a instanceof no&&a.rh)};function Kc(a,y,x,E,b,z,ee,re){for(x=x.iterator;x.next();){var oe=x.value;E&&!oe.isTopLevel||b!==null&&!b(oe)||!oe.canLayout()||(z&&oe instanceof Fi?oe.isLinkLabel||(oe instanceof no&&oe.layout===null?Kc(a,y,oe.memberParts,!1,b,z,ee,re):(lm(oe),y.add(oe))):ee&&oe instanceof $n?y.add(oe):!re||!oe.Zc()||oe instanceof Fi||(lm(oe),y.add(oe)))}}function lm(a){var y=a.actualBounds;(y.width===0||y.height===0||isNaN(y.width)||isNaN(y.height))&&a.Va()}Va.prototype.ni=function(a,y){var x=this.boundsComputation;return x!==null?(y||(y=new Gt),x(a,this,y)):y?(y.set(a.actualBounds),y):a.actualBounds},Va.prototype.ex=function(a){var y=new In;return a instanceof Vt?(Kc(this,y,a.nodes,!0,null,!0,!0,!0),Kc(this,y,a.links,!0,null,!0,!0,!0),Kc(this,y,a.parts,!0,null,!0,!0,!0)):a instanceof no?Kc(this,y,a.memberParts,!1,null,!0,!0,!0):Kc(this,y,a.iterator,!1,null,!0,!0,!0),y},Va.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(Co),(isNaN(x.x)||isNaN(x.y))&&x.set(a),a=y.padding,x.x+=a.left,x.y+=a.top),x}return a},fn.Object.defineProperties(Va.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())}}}),Va.prototype.collectParts=Va.prototype.ex,Va.prototype.getLayoutBounds=Va.prototype.ni,Va.prototype.invalidateLayout=Va.prototype.C,Va.className="Layout";function za(a){Er(this),this.Sc=a,this.wf=new In,this.ye=new In,this.Es=new Rt,this.zs=new Rt}za.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 In,this.ye=new In,this.Es=new Rt,this.zs=new Rt},za.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},za.prototype.createVertex=function(){return new bs(this)},za.prototype.createEdge=function(){return new iu(this)},za.prototype.lg=function(a,y,x){if(a!==null){for(y===void 0&&(y=!1),x===void 0&&(x=null),x===null&&(x=function(ee){if(ee instanceof Fi)return!ee.isLinkLabel;if(ee instanceof $n){var re=ee.fromNode;return re===null||re.isLinkLabel?!1:(ee=ee.toNode,!(ee===null||ee.isLinkLabel))}return!1}),a=a.iterator;a.next();){var E=a.value;if(E instanceof Fi&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)){if(E instanceof no&&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 $n&&(!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))}}},za.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},be=za.prototype,be.dh=function(a){if(a!==null){this.wf.add(a);var y=a.node;y!==null&&this.Es.add(y,a),a.network=this}},be.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},be.Iu=function(a){if(a!==null&&ux(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 ux(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}be.Zy=function(a){a!==null&&(a=this.ki(a),a!==null&&this.Iu(a))},be.ki=function(a){return a===null?null:this.Es.I(a)},be.Bo=function(a){if(a!==null){dy(this,a);var y=a.toVertex;y!==null&&y.Cl(a),y=a.fromVertex,y!==null&&y.zl(a)}};function dy(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}}be.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},be.Mj=function(a){if(a!==null){var y=a.toVertex;y!==null&&y.Kl(a),y=a.fromVertex,y!==null&&y.Jl(a),cy(this,a)}};function cy(a,y){y!==null&&a.ye.remove(y)&&(y=y.link,y!==null&&a.zs.remove(y))}be.Yy=function(a){a!==null&&(a=this.Lo(a),a!==null&&this.Mj(a))},be.Lo=function(a){return a===null?null:this.zs.I(a)},be.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},be.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))}},be.Ko=function(){for(var a=xi(),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]);Bi(a)},za.prototype.deleteArtificialVertexes=function(){for(var a=xi(),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=xi(),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]);Bi(a),Bi(y)};function kS(a){for(var y=xi(),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]);Bi(y)}za.prototype.Zx=function(a){a===void 0&&(a=!0),a&&(this.deleteArtificialVertexes(),kS(this),this.Ko()),a=new Bn;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),fy(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 fy(a,y,x){if(x!==null&&x.network!==y){ux(a,x),y.dh(x);for(var E=x.sourceEdges;E.next();){var b=E.value;b.network!==y&&(cy(a,b),dy(y,b),fy(a,y,b.fromVertex))}for(E=x.destinationEdges;E.next();)x=E.value,x.network!==y&&(cy(a,x),dy(y,x),fy(a,y,x.toVertex))}}za.prototype.dz=function(){for(var a=new In,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},fn.Object.defineProperties(za.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}}}),za.prototype.findAllParts=za.prototype.dz,za.prototype.splitIntoSubNetworks=za.prototype.Zx,za.prototype.deleteSelfEdges=za.prototype.Ko,za.prototype.reverseEdge=za.prototype.gm,za.prototype.linkVertexes=za.prototype.Zj,za.prototype.findEdge=za.prototype.Lo,za.prototype.deleteLink=za.prototype.Yy,za.prototype.deleteEdge=za.prototype.Mj,za.prototype.addLink=za.prototype.Dy,za.prototype.addEdge=za.prototype.Bo,za.prototype.findVertex=za.prototype.ki,za.prototype.deleteNode=za.prototype.Zy,za.prototype.deleteVertex=za.prototype.Iu,za.prototype.addNode=za.prototype.Bl,za.prototype.addVertex=za.prototype.dh,za.prototype.addParts=za.prototype.lg,za.className="LayoutNetwork";function bs(a){Er(this),this.ob=a,this.j=new Gt(0,0,10,10).freeze(),this.o=new Ie(5,5).freeze(),this.Sh=this.ub=null,this.tg=new Bn,this.mg=new Bn}bs.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new Bn,this.mg=new Bn},bs.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutVertex#"+wr(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},bs.prototype.commit=function(){var a=this.ub;if(a!==null){var y=this.bounds,x=a.bounds;Qt(x)?(x.x=y.x,x.y=y.y,x.width=y.width,x.height=y.height):a.bounds=y.copy()}else if(a=this.node,a!==null){if(y=this.bounds,!(a instanceof no)){x=Gt.alloc(),a.Va();var E=this.network.layout.ni(a,x),b=a.locationObject.ga(Kr);if(E.w()&&b.w()){a.moveTo(y.x+this.focusX-(b.x-E.x),y.y+this.focusY-(b.y-E.y)),Gt.free(x);return}Gt.free(x)}a.moveTo(y.x,y.y)}},bs.prototype.Cl=function(a){a!==null&&(this.tg.contains(a)||this.tg.add(a))},bs.prototype.Kl=function(a){a!==null&&this.tg.remove(a)},bs.prototype.zl=function(a){a!==null&&(this.mg.contains(a)||this.mg.add(a))},bs.prototype.Jl=function(a){a!==null&&this.mg.remove(a)};function gy(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}fn.Object.defineProperties(bs.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=Gt.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),Gt.free(x),!(a instanceof no)&&(a=a.locationObject.ga(Kr),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 In,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new In,y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new In,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 Bn,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}}}),bs.prototype.deleteDestinationEdge=bs.prototype.Jl,bs.prototype.addDestinationEdge=bs.prototype.zl,bs.prototype.deleteSourceEdge=bs.prototype.Kl,bs.prototype.addSourceEdge=bs.prototype.Cl,bs.className="LayoutVertex",bs.standardComparer=gy,bs.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 iu(a){Er(this),this.nb=a,this.qd=this.kd=this.$k=this.ub=null}iu.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},iu.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutEdge#"+wr(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},iu.prototype.gm=function(){var a=this.kd;this.kd=this.qd,this.qd=a},iu.prototype.commit=function(){},iu.prototype.Ax=function(a){return this.qd===a?this.kd:this.kd===a?this.qd:null},fn.Object.defineProperties(iu.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)}}}),iu.prototype.getOtherVertex=iu.prototype.Ax,iu.className="LayoutEdge";function Hs(a){Va.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new Pn(NaN,NaN).freeze(),this.tf=new Pn(10,10).freeze(),this.Jb=um,this.Rb=M0,this.nd=hm,this.hd=hx,a&&Object.assign(this,a)}_t(Hs,Va),Hs.prototype.cloneProtected=function(a){Va.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},Hs.prototype.qb=function(a){a.classType===Hs?a===hm||a===A0||a===py||a===k0?this.sorting=a:a===M0||a===hh?this.arrangement=a:a===um||a===B0?this.alignment=a:at("Unknown enum value: "+a):Va.prototype.qb.call(this,a)},Hs.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 no)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 k0:b.reverse();break;case hm:b.sort(this.comparer);break;case A0:b.sort(this.comparer),b.reverse()}var z=this.wrappingColumn;isNaN(z)&&(z=0);var ee=this.wrappingWidth;switch(isNaN(ee)&&a!==null?(y=a.padding,ee=Math.max(a.viewportBounds.width-y.left-y.right,0)):ee=Math.max(this.wrappingWidth,0),0>=z&&0>=ee&&(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 B0:var re=y,oe=x,ue=Gt.alloc(),he=Math.max(this.cellSize.width,1);if(!isFinite(he))for(var pe=he=0;pe<b.length;pe++){var Se=this.ni(b[pe],ue);he=Math.max(he,Se.width)}if(he=Math.max(he+re,1),pe=Math.max(this.cellSize.height,1),!isFinite(pe))for(Se=pe=0;Se<b.length;Se++){var Pe=this.ni(b[Se],ue);pe=Math.max(pe,Pe.height)}pe=Math.max(pe+oe,1),Se=this.arrangement;for(var Fe=Pe=this.arrangementOrigin.x,Ne=this.arrangementOrigin.y,Xe=0,Ve=0,ht=0;ht<b.length;ht++){var ft=b[ht],mt=this.ni(ft,ue),Ct=Math.ceil((mt.width+re)/he)*he,Kt=Math.ceil((mt.height+oe)/pe)*pe;switch(Se){case hh:var yi=Math.abs(Fe-mt.width);break;default:yi=Fe+mt.width}switch((0<z&&Xe>z-1||0<ee&&0<Xe&&yi-Pe>ee)&&(E.push(new Gt(0,Ne,ee+re,Ve)),Xe=0,Fe=Pe,Ne+=Ve,Ve=0),Ve=Math.max(Ve,Kt),Se){case hh:mt=-mt.width;break;default:mt=0}switch(ft.moveTo(Fe+mt,Ne),Se){case hh:Fe-=Ct;break;default:Fe+=Ct}Xe++}E.push(new Gt(0,Ne,ee+re,Ve)),Gt.free(ue);break;case um:for(oe=ee,he=z,pe=y,Se=x,ee=Gt.alloc(),Pe=Math.max(this.cellSize.width,1),z=Ne=ue=0,re=Ie.alloc(),Fe=0;Fe<b.length;Fe++)Ve=b[Fe],Xe=this.ni(Ve,ee),Ve=nc(Ve,Ve.locationObject,Ve.locationSpot,re),ue=Math.max(ue,Ve.x),Ne=Math.max(Ne,Xe.width-Ve.x),z=Math.max(z,Ve.y);switch(Fe=this.arrangement,Fe){case hh:ue+=pe;break;default:Ne+=pe}Pe=isFinite(Pe)?Math.max(Pe+pe,1):Math.max(ue+Ne,1);var tr=Ve=this.arrangementOrigin.x;for(ht=this.arrangementOrigin.y,Ne=0,oe>=ue&&(oe-=ue),ue=ft=0,Ct=Math.max(this.cellSize.height,1),mt=z=0,Kt=!0,Xe=Ie.alloc(),yi=0;yi<b.length;yi++){var Zi=b[yi],Qn=this.ni(Zi,ee),bn=nc(Zi,Zi.locationObject,Zi.locationSpot,re);if(0<Ne)switch(Fe){case hh:tr=(tr-Ve-(Qn.width-bn.x))/Pe,tr=Re.$(Math.round(tr),tr)?Math.round(tr):Math.floor(tr),tr=tr*Pe+Ve;break;default:tr=(tr-Ve+bn.x)/Pe,tr=Re.$(Math.round(tr),tr)?Math.round(tr):Math.ceil(tr),tr=tr*Pe+Ve}else switch(Fe){case hh:ft=tr+bn.x+Qn.width;break;default:ft=tr-bn.x}switch(Fe){case hh:var to=-(tr+bn.x)+ft;break;default:to=tr+Qn.width-bn.x-ft}if(0<he&&Ne>he-1||0<oe&&0<Ne&&to>oe){for(E.push(new Gt(0,Kt?ht-z:ht,oe+pe,mt+z+Se)),tr=0;tr<Ne&&yi!==Ne;tr++){to=b[yi-Ne+tr];var _r=nc(to,to.locationObject,to.locationSpot,Xe);to.moveTo(to.position.x,to.position.y+z-_r.y)}mt+=Se,ht=Kt?ht+mt:ht+(mt+z),Ne=mt=z=0,tr=Ve,Kt=!1}switch(tr===Ve&&(ue=Fe===hh?Math.max(ue,Qn.width-bn.x):Math.min(ue,-bn.x)),z=Math.max(z,bn.y),mt=Math.max(mt,Qn.height-bn.y),isFinite(Ct)&&(mt=Math.max(mt,Math.max(Qn.height,Ct)-bn.y)),Kt?Zi.moveTo(tr-bn.x,ht-bn.y):Zi.moveTo(tr-bn.x,ht),Fe){case hh:tr-=bn.x+pe;break;default:tr+=Qn.width-bn.x+pe}Ne++}if(E.push(new Gt(0,ht,oe+pe,(Kt?mt:mt+z)+Se)),b.length!==Ne)for(oe=0;oe<Ne;oe++)he=b[b.length-Ne+oe],pe=nc(he,he.locationObject,he.locationSpot,re),he.moveTo(he.position.x,he.position.y+z-pe.y);if(Ie.free(re),Ie.free(Xe),Fe===hh)for(b=0;b<E.length;b++)z=E[b],z.width+=ue,z.x-=ue;else for(b=0;b<E.length;b++)z=E[b],z.x>ue&&(z.width+=z.x-ue,z.x=ue);Gt.free(ee)}for(re=z=ee=b=0;re<E.length;re++)oe=E[re],b=Math.min(b,oe.x),ee=Math.min(ee,oe.y),z=Math.max(z,oe.x+oe.width);this.arrangement===hh?this.commitLayers(E,new Ie(b+y/2-(z+b),ee-x/2)):this.commitLayers(E,new Ie(b-y/2,ee-x/2)),a!==null&&a.eb("Layout"),this.isValidLayout=!0}},Hs.prototype.commitLayers=function(){};function hx(a,y){return a=a.text,y=y.text,a<y?-1:a>y?1:0}fn.Object.defineProperties(Hs.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!==um&&a!==B0||(this.Jb=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==M0&&a!==hh||(this.Rb=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==py&&a!==k0&&a!==hm&&a!==A0||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}}});var B0=new Ot(Hs,"Position",0),um=new Ot(Hs,"Location",1),M0=new Ot(Hs,"LeftToRight",2),hh=new Ot(Hs,"RightToLeft",3),py=new Ot(Hs,"Forward",4),k0=new Ot(Hs,"Reverse",5),hm=new Ot(Hs,"Ascending",6),A0=new Ot(Hs,"Descending",7);Hs.className="GridLayout",Hs.standardComparer=hx,Hs.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},Hs.Position=B0,Hs.Location=um,Hs.LeftToRight=M0,Hs.RightToLeft=hh,Hs.Forward=py,Hs.Reverse=k0,Hs.Ascending=hm,Hs.Descending=A0;function Sa(){this.On=new In,this.Dn=new In,this.Pa=new In,this.cf=new Rt,this.bf=new Rt,this.aj=new Rt,this.H=null,this.tp=!1}be=Sa.prototype,be.clear=function(){this.On.clear(),this.Dn.clear(),this.Pa.clear(),this.cf.clear(),this.bf.clear(),this.aj.clear()},be.Xe=function(a){this.H=a},be.oi=function(a){if(a instanceof Fi){if(this.On.add(a),a instanceof no){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 $n?this.Dn.add(a):a instanceof Yo||this.Pa.add(a);y=a.data,y===null||a instanceof Yo||(a instanceof $n?this.bf.add(y,a):this.cf.add(y,a))},be.pc=function(a){if(a.Ej(),a instanceof Fi){if(this.On.remove(a),a instanceof no){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 $n?this.Dn.remove(a):a instanceof Yo||this.Pa.remove(a);y=a.data,y===null||a instanceof Yo||(a instanceof $n?this.bf.remove(y):this.cf.remove(y))},be.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 no)&&at('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 no||at('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 $n||at('Invalid link template in Diagram.linkTemplateMap: template for "'+E+'" must be a Link, not a normal Node or simple Part: '+x);for(y=xi(),x=a.selection.iterator;x.next();)(E=x.value.data)&&y.push(E);for(x=xi(),a=a.highlighteds.iterator;a.next();)(E=a.value.data)&&x.push(E);for(a=xi(),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]);Bi(y),Bi(x),Bi(a)}},Sa.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},Sa.prototype.addModeledParts=function(a,y){var x=this,E=this.diagram.model;a.forEach(function(b){E.lb(b)&&dx(x,b,!1)}),a.forEach(function(b){E.lb(b)&&x.resolveReferencesForData(b)}),y!==!1&&_c(this.diagram,!1)};function dx(a,y,x){if(y!=null&&!a.diagram.undoManager.isUndoingRedoing&&!a.cf.contains(y)){x===void 0&&(x=!0);e:{if(y!=null&&!a.H.undoManager.isUndoingRedoing&&!a.cf.contains(y)){var E=a.Ro(y),b=cx(a,y,E);if(b!==null&&(Tu(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 e}}E=null}E!==null&&x&&a.resolveReferencesForData(y)}}Sa.prototype.insertLink=function(){return null},Sa.prototype.resolveReferencesForData=function(){},Sa.prototype.Ro=function(a){return this.H.model.Ro(a)};function cx(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&&(px||(px=!0,li('No Group template found for category "'+x+'"'),li(" Using default group template")),y=a.ly))):(y=a.nodeTemplateMap.I(x),y===null&&(y=a.nodeTemplateMap.I(""),y===null&&(gx||(gx=!0,li('No Node template found for category "'+x+'"'),li(" Using default node template")),y=a.ny))),y}Sa.prototype.getLinkCategoryForData=function(){return""},Sa.prototype.setLinkCategoryForData=function(){},Sa.prototype.setFromNodeForLink=function(){},Sa.prototype.setToNodeForLink=function(){},Sa.prototype.findLinkTemplateForCategory=function(a){var y=this.H,x=y.linkTemplateMap.I(a);return x===null&&(x=y.linkTemplateMap.I(""),x===null&&(mx||(mx=!0,li('No Link template found for category "'+a+'"'),li(" Using default link template")),x=y.my)),x},Sa.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},Sa.prototype.Gs=function(a){var y=this;a.forEach(function(x){y.ip(x)})},Sa.prototype.ip=function(a){a=this.Lc(a),a!==null&&(rg(this.diagram,a,!1),this.unresolveReferencesForPart(a))},Sa.prototype.unresolveReferencesForPart=function(){},Sa.prototype.removeDataForLink=function(){},Sa.prototype.findPartForKey=function(a){return a==null?null:(a=this.H.model.hc(a),a!==null?this.cf.I(a):null)},Sa.prototype.Vb=function(a){return a==null||(a=this.H.model.hc(a),a===null)?null:(a=this.cf.I(a),a instanceof Fi?a:null)},Sa.prototype.findLinkForKey=function(){return null},be=Sa.prototype,be.Lc=function(a){if(a===null)return null;var y=this.cf.I(a);return y!==null?y:y=this.bf.I(a)},be.ii=function(a){return a===null?null:(a=this.cf.I(a),a instanceof Fi?a:null)},be.Kc=function(a){return a===null?null:this.bf.I(a)},be.ms=function(a){for(var y=0;y<arguments.length;++y);y=new In;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 ee=arguments[z];if(Qt(ee)&&my(this,b,ee)){y.add(E);break}}}return y.iterator},be.ls=function(a){for(var y=0;y<arguments.length;++y);y=new In;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 ee=arguments[z];if(Qt(ee)&&my(this,b,ee)){y.add(E);break}}}return y.iterator};function my(a,y,x){for(var E in x){var b=y[E],z=x[E];if(jt(z)){if(!jt(b)||b.length<z.length)return!1;for(var ee=0;ee<b.length;ee++){var re=z[ee];if(re!==void 0&&!fx(a,b[ee],re))return!1}}else if(!fx(a,b,z))return!1}return!0}function fx(a,y,x){if(typeof x=="function"){if(!x(y))return!1}else if(x instanceof RegExp){if(!y||!x.test(y.toString()))return!1}else if(Qt(y)&&Qt(x)){if(!my(a,y,x))return!1}else if(y!==x)return!1;return!0}Sa.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===oo){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===Go){var ee=a.newValue;E==="nodeDataArray"&&Qt(ee)&&dx(this,ee),y.isModified=!0}else if(x===ha){var re=a.oldValue;E==="nodeDataArray"&&Qt(re)&&this.ip(re),y.isModified=!0}else x===Tr&&(E==="SourceChanged"?a.object!==null?this.updateDataBindings(a.object,a.propertyName):(this.rp(),this.updateAllTargetBindings()):E==="ModelDisplaced"&&this.Wd());else if(x===oo){var oe=a.propertyName,ue=a.object;ue===y.model?(oe==="nodeKeyProperty"||oe==="nodeCategoryProperty")&&(y.undoManager.isUndoingRedoing||this.Wd()):this.updateDataBindings(ue,oe),y.isModified=!0}else if(x===Go||x===ha){var he=a.change===Go,pe=he?a.newParam:a.oldParam,Se=he?a.newValue:a.oldValue,Pe=this.aj.I(a.object);if(Array.isArray(Pe))for(a=0;a<Pe.length;a++){var Fe=Pe[a];if(he)Jm(Fe,Se,pe,!0);else if(!(0>pe)){var Ne=pe+Vp(Fe);Fe.pc(Ne,!0),kv(Fe,Ne,pe)}}y.isModified=!0}}finally{y.aa=!0}}}}},Sa.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)},Sa.prototype.rp=function(){for(var a=this.H.model,y=new In,x=a.nodeDataArray,E=0;E<x.length;E++)y.add(x[E]);var b=[];for(this.nodes.each(function(ee){ee.data===null||y.contains(ee.data)||b.push(ee.data)}),this.parts.each(function(ee){ee.data===null||y.contains(ee.data)||b.push(ee.data)}),b.forEach(function(ee){bx(a,ee,!1)}),E=0;E<x.length;E++){var z=x[E];this.Lc(z)===null&&Cx(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()},Sa.prototype.refreshDataBoundLinks=function(){},Sa.prototype.updateRelationshipsFromData=function(){},Sa.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 ee=b[z].sx(a);ee!==null&&(x===null&&(x=xi()),x.push(ee))}if(x!==null)break}if(x!==null){for(E=0;E<x.length;E++)x[E].La(y);Bi(x)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(y)}};function vy(a,y){var x=y.Hh;if(jt(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 yy(a,y,x){Nf(y,function(ee){ee=ee.O.s;for(var re=ee.length,oe=0;oe<re;oe++)ug(x,ee[oe])});var E=y.Hh;if(jt(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}}}}Sa.prototype.Kj=function(a,y,x){x===void 0&&(x=!1);var E=new Rt;if(jt(a))for(var b=0;b<a.length;b++)N0(this,a[b],y,E,x);else for(a=a.iterator;a.next();)N0(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 In;for(var z=new Rt,ee=E.iterator;ee.next();){var re=ee.value;if(re instanceof $n)a||re.fromNode!==null&&re.toNode!==null||b.add(re);else if(re instanceof Fi&&re.data!==null&&x.Tl()){var oe=re;re=ee.key;var ue=re.pg();ue!==null&&(ue=E.I(ue),ue!==null?(x.qe(oe.data,x.wa(ue.data)),oe=y.Kc(oe.data),re=re.kh(),re!==null&&oe!==null&&z.add(re,oe)):x.qe(oe.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 he=new Rt;E.each(function(pe){pe.key.data!==null&&he.add(pe.key.data,pe.value.data)}),x(he,y,this.H.model)}for(y=E.iterator;y.next();)y.value.La();return E};function N0(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 pr))return null;if(z.isSelected=!1,z.isHighlighted=!1,E.add(y,z),y instanceof Fi){for(var ee=y.linksConnected;ee.next();){var re=ee.value;if(re.fromNode===y){var oe=E.I(re);oe!==null&&(oe.fromNode=z)}re.toNode===y&&(re=E.I(re),re!==null&&(re.toNode=z))}if(y instanceof no&&z instanceof no)for(y=y.memberParts;y.next();)ee=N0(a,y.value,x,E,b),ee instanceof $n||ee===null||(ee.containingGroup=z)}else if(y instanceof $n&&z instanceof $n)for(ee=y.fromNode,ee!==null&&(ee=E.I(ee),ee!==null&&(z.fromNode=ee)),ee=y.toNode,ee!==null&&(ee=E.I(ee),ee!==null&&(z.toNode=ee)),y=y.labelNodes;y.next();)ee=N0(a,y.value,x,E,b),ee!==null&&ee instanceof Fi&&(ee.labeledLink=z);return z}Sa.prototype.copyPartData=function(a,y){var x=null,E=a.data;if(E!==null&&y!==null){var b=y.model;a instanceof $n||(E=b.copyNodeData(E),Qt(E)&&(b.xf(E),x=y.Lc(E)))}else Tu(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 $n||(b=y.copyNodeData(E)),Qt(b)&&(x.data=b)));return x},fn.Object.defineProperties(Sa.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}}}),Sa.prototype.updateAllRelationshipsFromData=Sa.prototype.rp,Sa.prototype.findLinksByExample=Sa.prototype.ls,Sa.prototype.findNodesByExample=Sa.prototype.ms,Sa.prototype.findLinkForData=Sa.prototype.Kc,Sa.prototype.findNodeForData=Sa.prototype.ii,Sa.prototype.findPartForData=Sa.prototype.Lc,Sa.prototype.findNodeForKey=Sa.prototype.Vb,Sa.prototype.removeModeledPart=Sa.prototype.ip,Sa.prototype.removeModeledParts=Sa.prototype.Gs,Sa.prototype.rebuildParts=Sa.prototype.Wd;var gx=!1,px=!1,mx=!1;Sa.className="PartManager";function Is(a){Sa.apply(this,arguments)}_t(Is,Sa),Is.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray),vx(this,a.linkDataArray)},Is.prototype.addModeledParts=function(a){for(Sa.prototype.addModeledParts.call(this,a,!1),a=this.links.iterator;a.next();)gp(a.value);_c(this.diagram,!1)};function vx(a,y){y.forEach(function(x){yx(a,x)}),_c(a.diagram,!1)}function yx(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){Tu(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=I0(x,y,!0);z!==""&&(b.fromPortId=z),z=gu(x,y,!0),z!==void 0&&(z=a.Vb(z),z instanceof Fi&&(b.fromNode=z)),z=I0(x,y,!1),z!==""&&(b.toPortId=z),z=gu(x,y,!1),z!==void 0&&(z=a.Vb(z),z instanceof Fi&&(b.toNode=z)),x=x.Ef(y),Array.isArray(x)&&x.forEach(function(ee){ee=a.Vb(ee),ee!==null&&(ee.labeledLink=b)}),a.tp&&(b.Jg="Tool"),a.diagram.add(b),b.ub=null,b.data=y,a.diagram.skipsModelSourceBindings=E}}}}Is.prototype.removeAllModeledParts=function(){var a=this.diagram.model;xx(this,a.linkDataArray),this.Gs(a.nodeDataArray)};function xx(a,y){y.forEach(function(x){a.ip(x)})}Is.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ps(a)},Is.prototype.setLinkCategoryForData=function(a,y){return this.diagram.model.lp(a,y)},Is.prototype.setFromNodeForLink=function(a,y){var x=this.diagram.model;x.wv(a.data,x.wa(y!==null?y.data:null))},Is.prototype.setToNodeForLink=function(a,y){var x=this.diagram.model;x.Bv(a.data,x.wa(y!==null?y.data:null))},Is.prototype.removeDataForLink=function(a){this.diagram.model.bm(a.data)},Is.prototype.findPartForKey=function(a){var y=Sa.prototype.findPartForKey.call(this,a);return y===null&&(a=this.diagram.model.jh(a),a!==null)?this.bf.I(a):y},Is.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.jh(a),a!==null?this.bf.I(a):null)},Is.prototype.doModelChanged=function(a){var y=this;if(Sa.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===oo){if(b==="linkFromKey"){var z=this.Kc(a.object);if(z!==null){var ee=this.Vb(a.newValue);z.fromNode=ee}}else if(b==="linkToKey"){var re=this.Kc(a.object);if(re!==null){var oe=this.Vb(a.newValue);re.toNode=oe}}else if(b==="linkFromPortId"){var ue=this.Kc(a.object);if(ue!==null){var he=a.newValue;typeof he=="string"&&(ue.fromPortId=he)}}else if(b==="linkToPortId"){var pe=this.Kc(a.object);if(pe!==null){var Se=a.newValue;typeof Se=="string"&&(pe.toPortId=Se)}}else if(b==="nodeGroupKey"){var Pe=this.Lc(a.object);if(Pe!==null){var Fe=a.newValue;if(Fe!==void 0){var Ne=this.Vb(Fe);Ne instanceof no?Pe.containingGroup=Ne:Pe.containingGroup=null}else Pe.containingGroup=null}}else if(b==="linkLabelKeys"){var Xe=this.Kc(a.object);if(Xe!==null){var Ve=a.oldValue,ht=a.newValue;Array.isArray(Ve)&&Ve.forEach(function(bn){0<=ht.indexOf(bn)||(bn=y.Vb(bn),bn!==null&&(bn.labeledLink=null))}),Array.isArray(ht)&&ht.forEach(function(bn){bn=y.Vb(bn),bn!==null&&(bn.labeledLink=Xe)})}}else if(b==="linkCategory"){var ft=this.Kc(a.object),mt=a.newValue;ft!==null&&typeof mt=="string"&&(ft.category=mt)}else b==="linkDataArray"&&(xx(this,a.oldValue),vx(this,a.newValue));x.isModified=!0}else if(E===Go){var Ct=a.newValue;if(b==="linkDataArray"&&typeof Ct=="object"&&Ct!==null)yx(this,Ct);else if(b==="linkLabelKeys"&&Yc(Ct)){var Kt=this.Kc(a.object),yi=this.Vb(Ct);Kt!==null&&yi!==null&&(yi.labeledLink=Kt)}x.isModified=!0}else if(E===ha){var tr=a.oldValue;if(b==="linkDataArray"&&typeof tr=="object"&&tr!==null)this.ip(tr);else if(b==="linkLabelKeys"&&Yc(tr)){var Zi=this.Vb(tr);Zi!==null&&(Zi.labeledLink=null)}x.isModified=!0}}else if(E===oo){var Qn=a.propertyName;a.object!==x.model||Qn!=="linkFromKeyProperty"&&Qn!=="linkToKeyProperty"&&Qn!=="linkFromPortIdProperty"&&Qn!=="linkToPortIdProperty"&&Qn!=="linkLabelKeysProperty"&&Qn!=="nodeIsGroupProperty"&&Qn!=="nodeGroupKeyProperty"&&Qn!=="linkCategoryProperty"||x.undoManager.isUndoingRedoing||this.Wd(),x.isModified=!0}}finally{x.aa=!0}}}}},Is.prototype.refreshDataBoundLinks=function(){var a=this,y=this.diagram.model,x=new In,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){Ax(y,z,!1)}),E.forEach(function(z){a.Kc(z)===null&&kx(y,z,!1)})},Is.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 $n){var b=gu(E,y,!0);if(b=x.Vb(b),a.fromNode=b,b=gu(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 In().addAll(y);var ee=new In;a.labelNodes.each(function(re){re.data!==null&&(re=E.wa(re.data),re!==void 0&&ee.add(re))}),y=ee.copy(),y.hp(b),b=b.copy(),b.hp(ee),(0<y.count||0<b.count)&&(y.each(function(re){re=x.Vb(re),re!==null&&re.labeledLink===a&&(re.labeledLink=null)}),b.each(function(re){re=x.Vb(re),re!==null&&re.labeledLink!==a&&(re.labeledLink=a)}))}}else!(a instanceof Yo)&&(y=E.lh(y),y=x.findPartForKey(y),y===null||y instanceof no)&&(a.containingGroup=y)}}},Is.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=dm(y,x),b=this.Lc(a);if(E!==null&&b!==null){E=E.iterator;for(var z={};E.next();){var ee=E.value;y.lb(ee)?b instanceof no&&y.lh(ee)===x&&(ee=this.Lc(ee),ee!==null&&(ee.containingGroup=b)):(z.link=this.Kc(ee),z.link!==null&&b instanceof Fi&&(gu(y,ee,!0)===x&&(z.link.fromNode=b),gu(y,ee,!1)===x&&(z.link.toNode=b),ee=y.Ef(ee),Array.isArray(ee)&&ee.some(function(re){return function(oe){return oe===x?(b.labeledLink=re.link,!0):!1}}(z)))),z={link:z.link}}ch(y,x)}a=y.lh(a),a!==void 0&&(a=this.Vb(a),a instanceof no&&(b.containingGroup=a))}},Is.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof Fi){var x=y.wa(a.data);if(x!==void 0){for(var E=a.linksConnected;E.next();)dh(y,x,E.value.data);if(a.isLinkLabel&&(E=a.labeledLink,E!==null&&dh(y,x,E.data)),a instanceof no)for(a=a.memberParts;a.next();)E=a.value.data,y.lb(E)&&dh(y,x,E)}}},Is.prototype.copyPartData=function(a,y){var x=Sa.prototype.copyPartData.call(this,a,y);if(a instanceof $n)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},Is.prototype.insertLink=function(a,y,x,E){var b=this.diagram,z=b.model,ee=b.toolManager.findTool("Linking"),re="";if(a!==null&&(y===null&&(y=a),re=y.portId,re===null&&(re="")),y="",x!==null&&(E===null&&(E=x),y=E.portId,y===null&&(y="")),E=ee.archetypeLinkData,E instanceof $n){if(Tu(E),z=E.copy(),z!==null)return z.fromNode=a,z.fromPortId=re,z.toNode=x,z.toPortId=y,b.add(z),a=ee.archetypeLabelNodeData,a instanceof Fi&&(Tu(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&&Sp(z,E,z.wa(a.data),!0),wp(z,E,re,!0),x!==null&&Sp(z,E,z.wa(x.data),!1),wp(z,E,y,!1),z.fi(E),a=ee.archetypeLabelNodeData,a===null||a instanceof Fi||(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},Is.prototype.findLinkForKey=Is.prototype.findLinkForKey,Is.prototype.findPartForKey=Is.prototype.findPartForKey,Is.prototype.removeAllModeledParts=Is.prototype.removeAllModeledParts,Is.prototype.addModeledParts=Is.prototype.addModeledParts,Is.prototype.addAllModeledParts=Is.prototype.addAllModeledParts,Is.className="GraphLinksPartManager";function Pu(){Sa.apply(this,arguments),this.Sg=null}_t(Pu,Sa);function D0(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||!rr(E,b,z,null,!0))&&(y=a.getLinkCategoryForData(x.data),E=a.findLinkTemplateForCategory(y),E!==null&&(Tu(E),E=E.copy(),E!==null))){var ee=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=ee}}}Pu.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ss(a)},Pu.prototype.setLinkCategoryForData=function(a,y){this.diagram.model.Ms(a,y)},Pu.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}},Pu.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))},Pu.prototype.removeDataForLink=function(a){this.diagram.model.qe(a.data,void 0)},Pu.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.hc(a),a!==null?this.bf.I(a):null)},Pu.prototype.doModelChanged=function(a){if(Sa.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===oo){if(E==="nodeParentKey"){var b=a.object,z=this.Vb(a.newValue),ee=this.ii(b);if(this.Sg!==null)z!==null&&(this.Sg.data=b,this.Sg.category=this.getLinkCategoryForData(b));else if(ee!==null){var re=ee.kh();re!==null?z===null?y.remove(re):y.isTreePathToChildren?re.fromNode=z:re.toNode=z:D0(this,z,ee)}}else if(E==="parentLinkCategory"){var oe=this.ii(a.object),ue=a.newValue;if(oe!==null&&typeof ue=="string"){var he=oe.kh();he!==null&&(he.category=ue)}}y.isModified=!0}}else if(x===oo){var pe=a.propertyName;a.object===y.model&&pe==="nodeParentKeyProperty"&&(y.undoManager.isUndoingRedoing||this.Wd()),y.isModified=!0}}finally{y.aa=!0}}}}},Pu.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;a instanceof Fi&&(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:D0(this,y,a):E!==null&&rg(x,E,!1)))}}},Pu.prototype.updateDataBindings=function(a,y){Sa.prototype.updateDataBindings.call(this,a,y),typeof y=="string"&&this.Lc(a)!==null&&(a=this.Kc(a),a!==null&&a.La(y))},Pu.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=dm(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 Fi&&y.mh(z)===x&&D0(this,b,this.ii(z))}ch(y,x)}a=y.mh(a),a!==void 0&&b instanceof Fi&&(a=this.Vb(a),D0(this,a,b))}},Pu.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof Fi){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(ha,"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)&&dh(y,x,b)}},Pu.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},Pu.prototype.findLinkForKey=Pu.prototype.findLinkForKey,Pu.className="TreePartManager";function ar(a,y){this.kl=new In,this.il=new In,this.Wv=`,
"insertedNodeKeys": `,this.jy=`,
"modifiedNodeData": `,this.Yv=`,
"removedNodeKeys": `,this.vh=null,Er(this),this.Sm=this.xa="",this.Gg=!1,this.j={},this.Tc=[],this.kb=new Rt,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 Rt,this.Lt=new Bn,this.Wg=!1,this.o=null,this.undoManager=new jr,a!==void 0&&(jt(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}ar.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},ar.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},ar.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},ar.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)+":"+Pr(b)}}return y},ar.prototype.xA=function(a){a.change!==Tr&&at("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var y=a.object;return a.isTransactionFinished&&y instanceof _a?(wx(this,y),a=this.Qv(y,a.propertyName==="FinishedUndo"),this.vh=null,a):null},ar.prototype.Qv=function(a,y){var x=this,E=!1,b=new In,z=new In,ee=new In,re=this.vh;a.changes.each(function(pe){pe.model===x&&(pe.modelChange==="nodeDataArray"?pe.change===Go?b.add(pe.newValue):pe.change===ha&&ee.add(pe.oldValue):x.lb(pe.object)?z.add(pe.object):pe.change!==oo||x.modelData!==pe.object&&pe.propertyName!=="modelData"?pe.object!==null&&(re&&re.contains(pe.object)?re.get(pe.object).each(function(Se){x.lb(Se)&&z.add(Se)}):pe.object instanceof ar||x.ri()&&x.Jc(pe.object)||Px(x,pe.object).each(function(Se){z.add(Se)})):E=!0)});var oe=this.il;oe.clear(),b.each(function(pe){oe.add(x.wa(pe)),y||z.add(pe)});var ue=this.kl;ue.clear(),ee.each(function(pe){ue.add(x.wa(pe)),y&&z.add(pe)}),a=x.cloneDeep(z.Fa());var he=null;return E&&(he===null&&(he={}),he.modelData=this.cloneDeep(this.modelData)),0<oe.count&&(he===null&&(he={}),y?he.removedNodeKeys=oe.Fa():he.insertedNodeKeys=oe.Fa()),0<a.length&&(he===null&&(he={}),he.modifiedNodeData=a),0<ue.count&&(he===null&&(he={}),y?he.insertedNodeKeys=ue.Fa():he.removedNodeKeys=ue.Fa()),ue.clear(),oe.clear(),he},ar.prototype.cloneDeep=function(a){return xp(this,a,!0)};function xp(a,y,x,E,b,z){function ee(pe,Se){re?(pe.__gohashid===void 0&&z.push(pe),E.set(pe,Se)):(pe=Qo++,E.set(pe,Se),b.set(pe,y))}if(!Qt(y))return y;z||(z=[]);var re=Object.isExtensible(y);if(E||(E=new Rt),re){var oe=E.get(y);if(oe)return oe}else for(b||(b=new Rt),oe=b.iterator;oe.next();){var ue=oe.key;if(oe.value===y&&(ue=E.get(ue)))return ue}if(Array.isArray(y)){oe=[],ee(y,oe);for(var he=0;he<y.length;he++)oe.push(xp(a,y[he],!1,E,b,z))}else if(y instanceof Ie||y instanceof Pn||y instanceof Gt||y instanceof $r||y instanceof Xi)oe=y.copy(),ee(y,oe);else{if(y instanceof $o||y instanceof ut||y instanceof Ot)return y;if(y instanceof Bn)oe=new Bn().addAll(xp(a,y.Fa(),!1,E,b,z)),ee(y,oe);else if(y instanceof In)oe=new In().addAll(xp(a,y.Fa(),!1,E,b,z)),ee(y,oe);else if(y instanceof Rt)oe=new Rt().addAll(xp(a,y.Fa(),!1,E,b,z)),ee(y,oe);else if(y instanceof Date)oe=new Date(y.getTime()),ee(y,oe);else if(y instanceof RegExp)oe=new RegExp(y),ee(y,oe),oe.lastIndex=y.lastIndex;else if(typeof y.copy=="function")oe=y.copy(),ee(y,oe);else for(he in oe={},ee(y,oe),y)he!=="__gohashid"&&(oe[he]=xp(a,y[he],!1,E,b,z))}return x&&z.forEach(function(pe){delete pe.__gohashid}),oe}be=ar.prototype,be.quote=function(a){return JSON.stringify(a).replace(/[\u007F-\uFFFF]/g,function(y){return"\\u"+("0000"+y.charCodeAt(0).toString(16)).substr(-4)})},be.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},be.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 Sx(a,y){y=y.modelData,Qt(y)&&(a.dm(y),a.modelData=y)}be.Rv=function(){var a=this.modelData,y=!1,x;for(x in a)if(!Ex(x,a[x])){y=!0;break}return a="",y&&(a=`,
"modelData": `+xy(this,this.modelData)),a+`,
"nodeDataArray": `+Uc(this,this.nodeDataArray,!0)},be.kv=function(a){Sx(this,a),a=a.nodeDataArray,jt(a)&&(this.dm(a),this.nodeDataArray=a)};function wx(a,y){function x(b,z){if((z=z.part)&&(z=z.data,b!==z)){var ee=E.get(b);ee===null?(ee=new In,ee.add(z),E.add(b,ee)):ee.add(z)}}var E=a.vh;E===null&&(E=new Rt,y.changes.each(function(b){if(b.diagram!==null){var z=b.change;z===oo?(b=b.object.panel)&&(z=b.data)&&x(z,b):(z===Go||z===ha)&&(b=b.object,(z=b.itemArray)&&x(z,b))}}),a.vh=E)}function Px(a,y){for(var x=new In,E=0;E<a.nodeDataArray.length;E++){var b=a.nodeDataArray[E];T0(a,y,b,b,x)}return x}function T0(a,y,x,E,b){if(Array.isArray(x))for(var z=0;z<x.length;z++){var ee=x[z];if(ee===y)return b.add(E),!0;if(T0(a,y,ee,E,b))return!0}else if(Qt(x)&&Object.getPrototypeOf(x)===Object.prototype)for(z in x){if(ee=x[z],ee===y)return b.add(E),!0;if(T0(a,y,ee,E,b))return!0}return!1}be.Pv=function(a,y){var x=this,E=!1,b=new In,z=new In,ee=new In,re=this.vh;a.changes.each(function(he){he.model===x&&(he.modelChange==="nodeDataArray"?he.change===Go?b.add(he.newValue):he.change===ha&&ee.add(he.oldValue):x.lb(he.object)?z.add(he.object):he.change!==oo||x.modelData!==he.object&&he.propertyName!=="modelData"?he.object!==null&&(re&&re.contains(he.object)?re.get(he.object).each(function(pe){x.lb(pe)&&z.add(pe)}):he.object instanceof ar||x.ri()&&x.Jc(he.object)||Px(x,he.object).each(function(pe){z.add(pe)})):E=!0)});var oe=this.il;oe.clear(),b.each(function(he){oe.add(x.wa(he)),y||z.add(he)});var ue=this.kl;return ue.clear(),ee.each(function(he){ue.add(x.wa(he)),y&&z.add(he)}),a="",E&&(a+=`,
"modelData": `+xy(this,this.modelData)),0<oe.count&&(a+=(y?this.Yv:this.Wv)+Uc(this,oe.Fa(),!0)),0<z.count&&(a+=this.jy+Uc(this,z.Fa(),!0)),0<ue.count&&(a+=(y?this.Wv:this.Yv)+Uc(this,ue.Fa(),!0)),ue.clear(),oe.clear(),a},be.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)&&at("applyIncrementalJson cannot change Model properties"),Sx(this,a);var y=a.insertedNodeKeys,x=a.modifiedNodeData,E=new Rt;if(Array.isArray(x))for(var b=0;b<x.length;b++){var z=x[b],ee=this.wa(z);ee!=null&&E.set(ee,z)}if(Array.isArray(y))for(b=y.length,z=0;z<b;z++){ee=y[z];var re=this.hc(ee);re===null&&(re=(re=E.get(ee))?re:this.copyNodeData({}),this.km(re,ee),this.xf(re))}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 oe in b)oe==="__gohashid"||oe===this.nodeKeyProperty||this.Wj()&&oe===this.nodeIsGroupProperty||this.setDataProperty(z,oe,b[oe]);this.lm(b,z)}}if(a=a.removedNodeKeys,Array.isArray(a))for(x=a.length,oe=0;oe<x;oe++)y=this.hc(a[oe]),y!==null&&this.cm(y)},be.$x=function(a,y){a.change!==Tr&&at("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var x=a.object;return a.isTransactionFinished&&x instanceof _a?(y===void 0&&(y=cm(this,this)),wx(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 }'},be.yA=function(a,y){return this.$x(a,y)},be.np=function(a){return a===void 0&&(a=cm(this,this)),'{ "class": '+this.quote(a)+this.rm()+this.Rv()+"}"},be.toJSON=function(a){return this.np(a)},be.Zw=function(a){var y=null;if(typeof a=="string")try{y=xn.JSON.parse(a)}catch(E){}else typeof a=="object"?y=a:at("Unable to modify a Model from: "+a);var x=y.incremental;typeof x!="number"&&at("Unable to apply non-incremental changes to Model: "+a),x!==0&&(this.Ea("applyIncrementalJson"),this.fp(y),this.eb("applyIncrementalJson"))},be.Ky=function(a){return this.Zw(a)},ar.constructGraphLinksModel=function(){return new ar},be=ar.prototype,be.dm=function(a){if(jt(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];if(Qt(E)){var b=x;E=this.dm(E),Array.isArray(a)?a[b]=E:at("Cannot replace an object in an HTMLCollection or NodeList at "+b)}}else if(Qt(a)){for(y in a)if(x=a[y],Qt(x)&&(x=this.dm(x),a[y]=x,y==="points"&&Array.isArray(x))){for(b=x.length%2===0,E=0;E<x.length;E++)if(typeof x[E]!="number"){b=!1;break}if(b){for(b=new Bn,E=0;E<x.length/2;E++)b.add(new Ie(x[2*E],x[2*E+1]));b.freeze(),a[y]=b}}return AS(a)}return a},be.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()):jt(a)?Uc(this,a):Qt(a)?xy(this,a):typeof a=="function"?"null":a.toString()};function Uc(a,y,x){x===void 0&&(x=!1);var E=y.length;if(0>=E)return"[]";var b=new Sr;b.add("["),x&&1<E&&b.add(`
`);for(var z=0;z<E;z++){var ee=y[z];ee!==void 0&&(0<z&&(b.add(","),x&&b.add(`
`)),b.add(a.sm(ee)))}return x&&1<E&&b.add(`
`),b.add("]"),b.toString()}function Ex(a,y){return y===void 0||a==="__gohashid"||a[0]==="_"||typeof y=="function"}function wl(a){return isNaN(a)?"NaN":a===1/0?"9e9999":a===-1/0?"-9e9999":a}function xy(a,y){var x=y;if(x instanceof Ie)y={class:"go.Point",x:wl(x.x),y:wl(x.y)};else if(x instanceof Pn)y={class:"go.Size",width:wl(x.width),height:wl(x.height)};else if(x instanceof Gt)y={class:"go.Rect",x:wl(x.x),y:wl(x.y),width:wl(x.width),height:wl(x.height)};else if(x instanceof $r)y={class:"go.Margin",top:wl(x.top),right:wl(x.right),bottom:wl(x.bottom),left:wl(x.left)};else if(x instanceof Xi)x.sb()?y={class:"go.Spot",x:wl(x.x),y:wl(x.y),offsetX:wl(x.offsetX),offsetY:wl(x.offsetY)}:y={class:"go.Spot",enum:x.toString()};else if(x instanceof $o){if(y={class:"go.Brush",type:x.type.name},x.type===qd?y.color=x.color:(x.type===Ed||x.type===Su)&&(y.start=x.start,y.end=x.end,x.type===Su&&(x.startRadius!==0&&(y.startRadius=wl(x.startRadius)),isNaN(x.endRadius)||(y.endRadius=wl(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 ut?(y={class:"go.Geometry",type:x.type.name},x.startX!==0&&(y.startX=wl(x.startX)),x.startY!==0&&(y.startY=wl(x.startY)),x.endX!==0&&(y.endX=wl(x.endX)),x.endY!==0&&(y.endY=wl(x.endY)),x.spot1.D(Co)||(y.spot1=x.spot1),x.spot2.D(Ht)||(y.spot2=x.spot2),x.type===ut.o&&(y.path=ut.ia(x))):x instanceof Ot&&(y={class:"go.EnumValue",classType:cm(a,x.classType),name:x.name});E="{",x=!0;for(var b in y){var z=hs(y,b);if(!Ex(b,z))if(x?x=!1:E+=",",E+=a.quote(b)+":",b==="points"&&z instanceof Bn){var ee="[";for(z=z.iterator;z.next();){var re=z.value;1<ee.length&&(ee+=","),ee+=a.sm(re.x),ee+=",",ee+=a.sm(re.y)}ee+="]",E+=ee}else E+=a.sm(z)}return E+"}"}function Pl(a){return typeof a=="number"?a:a==="NaN"?NaN:a==="9e9999"?1/0:a==="-9e9999"?-1/0:parseFloat(a)}function AS(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 Ie(Pl(a.x),Pl(a.y));else if(y==="Size")x=new Pn(Pl(a.width),Pl(a.height));else if(y==="Rect")x=new Gt(Pl(a.x),Pl(a.y),Pl(a.width),Pl(a.height));else if(y==="Margin")x=new $r(Pl(a.top),Pl(a.right),Pl(a.bottom),Pl(a.left));else if(y==="Spot")typeof a.enum=="string"?x=_o(a.enum):x=new Xi(Pl(a.x),Pl(a.y),Pl(a.offsetX),Pl(a.offsetY));else if(y==="Brush"){if(x=new $o,x.type=Li($o,a.type),typeof a.color=="string"&&(x.color=a.color),a.start instanceof Xi&&(x.start=a.start),a.end instanceof Xi&&(x.end=a.end),typeof a.startRadius=="number"&&(x.startRadius=Pl(a.startRadius)),typeof a.endRadius=="number"&&(x.endRadius=Pl(a.endRadius)),a=a.colorStops,Qt(a))for(var E in a)x.addColorStop(parseFloat(E),a[E])}else y==="Geometry"?(x=null,typeof a.path=="string"?x=ut.parse(a.path):x=new ut,x.type=Li(ut,a.type),typeof a.startX=="number"&&(x.startX=Pl(a.startX)),typeof a.startY=="number"&&(x.startY=Pl(a.startY)),typeof a.endX=="number"&&(x.endX=Pl(a.endX)),typeof a.endY=="number"&&(x.endY=Pl(a.endY)),a.spot1 instanceof Xi&&(x.spot1=a.spot1),a.spot2 instanceof Xi&&(x.spot2=a.spot2)):y==="EnumValue"&&(E=a.classType,E.indexOf("go.")===0&&(E=E.substr(3)),E=wy(E),typeof E=="function"&&(x=Li(E,a.name)));return x}be.Pe=function(a){return this.Lt.add(a),this},be.ik=function(a){this.Lt.remove(a)},be.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)},be.cb=function(a,y,x,E,b,z,ee){ys(this,"",a,y,x,E,b,z,ee)},be.g=function(a,y,x,E,b){ys(this,"",oo,a,this,y,x,E,b)},be.Fs=function(a,y,x,E,b,z){ys(this,"",oo,y,a,x,E,b,z)};function ys(a,y,x,E,b,z,ee,re,oe){re===void 0&&(re=null),oe===void 0&&(oe=null);var ue=new er;ue.model=a,ue.change=x,ue.modelChange=y,ue.propertyName=E,ue.object=b,ue.oldValue=z,ue.oldParam=re,ue.newValue=ee,ue.newParam=oe,a.ds(ue)}ar.prototype.changeState=function(a,y){if(a!==null&&a.model===this)if(a.change===oo){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)),Ha(x,E,b)}else a.change===Go?(x=a.newParam,a.modelChange==="nodeDataArray"?(a=a.newValue,Qt(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]===a&&Vi(this.Tc,x),E!==void 0&&this.kb.remove(E)):(this.Tc[x]!==a&&ai(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)))):a.modelChange===""?((E=a.object)&&!jt(E)&&a.propertyName&&(E=hs(a.object,a.propertyName)),jt(E)&&typeof x=="number"&&(a=a.newValue,y?Vi(E,x):ai(E,x,a))):at("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===ha?(x=a.oldParam,a.modelChange==="nodeDataArray"?(a=a.oldValue,Qt(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]!==a&&ai(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)):(this.Tc[x]===a&&Vi(this.Tc,x),E!==void 0&&this.kb.remove(E)))):a.modelChange===""?((E=a.object)&&!jt(E)&&a.propertyName&&(E=hs(a.object,a.propertyName)),jt(E)&&typeof x=="number"&&(a=a.oldValue,y?ai(E,x,a):Vi(E,x))):at("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==Tr&&at("unknown ChangedEvent: "+a.toString())},ar.prototype.Ea=function(a){return this.undoManager.Ea(a)},ar.prototype.eb=function(a){return this.undoManager.eb(a)},ar.prototype.Kf=function(){return this.undoManager.Kf()},ar.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=ar.prototype,be.La=function(a,y){y===void 0&&(y=""),ys(this,"SourceChanged",Tr,y,a,null,null)},be.wa=function(a){if(a!==null){var y=this.Th;if(y!==""&&(y=hs(a,y),y!==void 0)){if(Yc(y))return y;at("Key value for node data "+a+" is not a number or a string: "+y)}}},be.km=function(a,y){if(a!==null){var x=this.Th;if(x!=="")if(this.lb(a)){var E=hs(a,x);E!==y&&this.hc(y)===null&&(Ha(a,x,y),E!==void 0&&this.kb.remove(E),this.kb.add(y,a),ys(this,"nodeKey",oo,x,a,E,y),typeof x=="string"&&this.La(a,x),this.jp(E,y))}else Ha(a,x,y)}};function Yc(a){return typeof a=="number"||typeof a=="string"}be.lb=function(a){var y=this.wa(a);return y===void 0?!1:this.kb.I(y)===a},be.hc=function(a){return a===null&&at("Model.findNodeDataForKey:key must not be null"),a!==void 0&&Yc(a)?this.kb.I(a):null},be.$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))){Ha(a,y,x);return}if(typeof x=="string"){for(E=2;this.kb.contains(x+E);)E++;Ha(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.kb.count-1;this.kb.contains(x);)x--;Ha(a,y,x)}}}}},be.xf=function(a){a!==null&&(Do(a),this.lb(a)||Cx(this,a,!0))};function Cx(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&&at("Model.makeNodeDataKeyUnique failed on "+y+". Data not added to Model."),a.kb.add(E,y),E=null,x&&(E=a.Tc.length,ai(a.Tc,E,y)),ys(a,"nodeDataArray",Go,"nodeDataArray",a,null,y,null,E),a.fm(y),a.em(y))}be.Fy=function(a){if(jt(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)},be.cm=function(a){a!==null&&bx(this,a,!0)};function bx(a,y,x){var E=a.wa(y);if(E!==void 0&&a.kb.remove(E),E=null,x){e: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 e}E=-1}if(0>E)return;Vi(a.Tc,E)}ys(a,"nodeDataArray",ha,"nodeDataArray",a,y,null,E,null),a.qp(y)}be.nA=function(a){if(jt(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)},be.$z=function(a){if(a!==this.nodeDataArray&&jt(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],ee=this.wa(z);if(ee!==void 0){x.add(ee);var re=this.hc(ee);re!==z&&(re!==null?(this.Do(re,z),this.lm(z,re)):(z=this.cloneDeep(z),this.km(z,ee),this.xf(z)))}else ee=this.cloneDeep(z),this.xf(ee),x.add(this.wa(ee))}for(a=y.iterator;a.next();)E=a.value,x.contains(E)||(E=this.hc(E))&&this.cm(E);y.clear(),x.clear()}},be.jp=function(a,y){y!==void 0&&(a=dm(this,a),a instanceof In&&this.Vf.add(y,a))},be.Lv=function(){},be.fm=function(){},be.em=function(){},be.qp=function(){};function dh(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E===null&&(E=new In,a.Vf.add(y,E)),E.add(x)}}function ch(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E instanceof In&&(x==null?a.Vf.remove(y):(E.remove(x),E.count===0&&a.Vf.remove(y)))}}function dm(a,y){return y===void 0?null:(a=a.Vf.I(y),a instanceof In?a:null)}be.Qy=function(a){a===void 0?this.Vf.clear():this.Vf.remove(a)},ar.prototype.copyNodeData=function(a){if(a===null)return null;var y=this.Bk;return a=y!==null?y(a,this):_0(this,a,!0),Qt(a)&&Er(a),a};function _0(a,y,x){if(a.copiesArrays&&Array.isArray(y)){var E=[];for(x=0;x<y.length;x++){var b=_0(a,y[x],a.copiesArrayObjects);E.push(b)}return Er(E),E}if(x&&Qt(y)){x=(x=y.constructor)?new x:{},b=a.copiesKey||typeof a.nodeKeyProperty!="string"?null:a.nodeKeyProperty;for(E in y)if(E==="__gohashid")x.__gohashid=void 0;else if(E===b)x[b]=void 0;else{var z=hs(y,E),ee=cm(a,z);ee==="GraphObject"||ee==="Diagram"||ee==="Layer"||ee==="RowColumnDefinition"||ee==="AnimationManager"||ee==="Tool"||ee==="CommandHandler"||ee==="Layout"||ee==="InputEvent"||ee==="DiagramEvent"||z instanceof ar||z instanceof jr||z instanceof _a||z instanceof er||(z=_0(a,z,!1)),Ha(x,E,z)}return Er(x),x}return y instanceof Ie||y instanceof Pn||y instanceof Gt||y instanceof Xi||y instanceof $r?y.copy():y}ar.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!Fx&&a instanceof Ft&&(Fx=!0,li('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),li(" Is that really your intent?"));var E=hs(a,y);E!==x&&(Ha(a,y,x),this.Fs(a,y,E,x))},be=ar.prototype,be.set=function(a,y,x){this.setDataProperty(a,y,x)},be.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])}},be.Ay=function(a,y){this.ts(a,-1,y)},be.ts=function(a,y,x){0>y&&(y=a.length),ai(a,y,x),ys(this,"",Go,"",a,null,x,null,y)},be.ov=function(a,y){y===void 0&&(y=-1),a===this.Tc&&at("Model.removeArrayItem should not be called on the Model.nodeDataArray"),y===-1&&(y=a.length-1);var x=a[y];Vi(a,y),ys(this,"",ha,"",a,x,null,y,null)},be.Ro=function(a){if(a===null)return"";var y=this.lj;if(y===""||(y=hs(a,y),y===void 0))return"";if(typeof y=="string")return y;at("getCategoryForNodeData found a non-string category for "+a+": "+y)},be.jm=function(a,y){if(a!==null){var x=this.lj;if(x!=="")if(this.lb(a)){var E=hs(a,x);E===void 0&&(E=""),E!==y&&(Ha(a,x,y),ys(this,"nodeCategory",oo,x,a,E,y))}else Ha(a,x,y)}},be.lm=function(a,y){this.jm(y,this.Ro(a))},be.Tl=function(){return!1},be.Wj=function(){return!1},be.ri=function(){return!1},be.xs=function(){return!1},be.Xj=function(){return!1};function Sy(){return new ar}function cm(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 cm(a,y.constructor);return typeof y}function wy(a){return qu[a]?qu[a]:xn.go!==void 0&&xn.go[a]?xn.go[a]:null}function hs(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 Ha(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){}}fn.Object.defineProperties(ar.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===""&&at("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&at("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Th=a,this.g("nodeKeyProperty",y,a))}},makeUniqueKeyFunction:{get:function(){return this.bl},set:function(a){var y=this.bl;y!==a&&(this.bl=a,this.g("makeUniqueKeyFunction",y,a))}},nodeDataArray:{get:function(){return this.Tc},set:function(a){var y=this.Tc;if(y!==a){this.kb.clear(),this.Lv();for(var x=a.length,E=0;E<x;E++){var b=a[E];Qt(b)||at("Model.nodeDataArray must only contain Objects, not: "+b),Do(b)}for(this.Tc=a,E=new Bn,b=0;b<x;b++){var z=a[b],ee=this.wa(z);ee===void 0||this.kb.I(ee)!==null?E.add(z):this.kb.add(ee,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(ys(this,"nodeDataArray",oo,"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"}}}),ar.prototype.setCategoryForNodeData=ar.prototype.jm,ar.prototype.getCategoryForNodeData=ar.prototype.Ro,ar.prototype.removeArrayItem=ar.prototype.ov,ar.prototype.insertArrayItem=ar.prototype.ts,ar.prototype.addArrayItem=ar.prototype.Ay,ar.prototype.assignAllDataProperties=ar.prototype.Do,ar.prototype.set=ar.prototype.set,ar.prototype.clearUnresolvedReferences=ar.prototype.Qy,ar.prototype.mergeNodeDataArray=ar.prototype.$z,ar.prototype.removeNodeDataCollection=ar.prototype.nA,ar.prototype.removeNodeData=ar.prototype.cm,ar.prototype.addNodeDataCollection=ar.prototype.Fy,ar.prototype.addNodeData=ar.prototype.xf,ar.prototype.makeNodeDataKeyUnique=ar.prototype.$u,ar.prototype.findNodeDataForKey=ar.prototype.hc,ar.prototype.containsNodeData=ar.prototype.lb,ar.prototype.setKeyForNodeData=ar.prototype.km,ar.prototype.getKeyForNodeData=ar.prototype.wa,ar.prototype.updateTargetBindings=ar.prototype.La,ar.prototype.commit=ar.prototype.commit,ar.prototype.rollbackTransaction=ar.prototype.Kf,ar.prototype.commitTransaction=ar.prototype.eb,ar.prototype.startTransaction=ar.prototype.Ea,ar.prototype.raiseDataChanged=ar.prototype.Fs,ar.prototype.raiseChanged=ar.prototype.g,ar.prototype.raiseChangedEvent=ar.prototype.cb,ar.prototype.removeChangedListener=ar.prototype.ik,ar.prototype.addChangedListener=ar.prototype.Pe,ar.prototype.writeJsonValue=ar.prototype.sm,ar.prototype.replaceJsonObjects=ar.prototype.dm,ar.prototype.applyIncrementalJSON=ar.prototype.Ky,ar.prototype.applyIncrementalJson=ar.prototype.Zw,ar.prototype.toJSON=ar.prototype.toJSON,ar.prototype.toJson=ar.prototype.np,ar.prototype.toIncrementalJSON=ar.prototype.yA,ar.prototype.toIncrementalJson=ar.prototype.$x,ar.prototype.toIncrementalData=ar.prototype.xA,ar.prototype.clear=ar.prototype.clear;var Fx=!1,qu={};ar.className="Model",ar.fromJSON=ar.fromJson=function(a,y){y===void 0&&(y=null);var x=null;if(typeof a=="string")try{x=xn.JSON.parse(a)}catch(z){}else typeof a=="object"?x=a:at("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=wy(E)):(b=wy(E),b===null&&(b=xn[E])),typeof b=="function"&&(a=new b)}catch(z){}a===null||a instanceof ar?y=a:at("Unable to construct a Model of declared class: "+x.class)}return y===null&&(y=ar.constructGraphLinksModel()),y.gp(x),y.kv(x),y},ar.safePropertyValue=hs,ar.safePropertySet=Ha,qu.Brush=$o,qu.ChangedEvent=er,qu.Geometry=ut,qu.Margin=$r,qu.Panel=Wn,qu.Point=Ie,qu.Rect=Gt,qu.Size=Pn,qu.Spot=Xi,qu.Transaction=_a,qu.UndoManager=jr;function ds(a,y,x,E){Er(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=Bx,this.wk=null):(this.el=fm,this.wk=E),this.st=new In}ds.prototype.copy=function(){var a=new ds;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},be=ds.prototype,be.qb=function(a){a.classType===ds&&(this.mode=a)},be.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.Ai!==-1?" "+this.Ai:"")+" "+this.mode.name+")"},be.freeze=function(){return this._isFrozen=!0,this},be.ka=function(){return this._isFrozen=!1,this},be.Kx=function(a){return a===void 0&&(a=null),this.mode=fm,this.backConverter=a,this},be.cp=function(a){return a===void 0&&(a=""),this.sourceName=a,this.isToModel=!1,this},be.dA=function(){return this.sourceName=null,this.isToModel=!0,this};function Lx(a,y,x){return a=a.sourceName,a===null||a===""?y:a==="/"?x.part:a==="."?x:a===".."?x.panel:y.fb(a)}be.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==="")li("Binding error: target property is the empty string: "+this.toString());else{var z=y;if(E!==""&&(z=hs(y,E)),z!==void 0)if(b===null)x!==""&&Ha(a,x,z);else try{if(x!==""){var ee=b(z,a);Ha(a,x,ee)}else b(z,a)}catch(re){}}}},be.sp=function(a,y,x,E){if(this.el===fm){var b=this.xl;if(x===void 0||b===x){x=this.sl;var z=this.wk,ee=a;if(b!==""&&(ee=hs(a,b)),ee!==void 0&&!this.st.contains(a))try{this.st.add(a);var re=E!==null?E.diagram:null,oe=re!==null?re.model:null;if(z===null){if(x!=="")oe!==null?oe.setDataProperty(y,x,ee):Ha(y,x,ee);else if(oe!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var ue=E.itemIndex,he=E.panel.itemArray;oe.ov(he,ue),oe.ts(he,ue,ee)}}else try{if(x!==""){var pe=z(ee,y,oe);oe!==null?oe.setDataProperty(y,x,pe):Ha(y,x,pe)}else{var Se=z(ee,y,oe);if(Se!==void 0&&oe!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var Pe=E.itemIndex,Fe=E.panel.itemArray;oe.ov(Fe,Pe),oe.ts(Fe,Pe,Se)}}}catch(Ne){}}finally{this.st.remove(a)}}}},fn.Object.defineProperties(ds.prototype,{Ai:{get:function(){return this.j},set:function(a){this._isFrozen&&Bt(this),this.j=a}},targetProperty:{get:function(){return this.xl},set:function(a){this._isFrozen&&Bt(this),this.xl=a}},sourceName:{get:function(){return this.Cr},set:function(a){this._isFrozen&&Bt(this),this.Cr=a,a!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(a){this._isFrozen&&Bt(this),this.wn=a}},sourceProperty:{get:function(){return this.sl},set:function(a){this._isFrozen&&Bt(this),this.sl=a}},converter:{get:function(){return this.Im},set:function(a){this._isFrozen&&Bt(this),this.Im=a}},backConverter:{get:function(){return this.wk},set:function(a){this._isFrozen&&Bt(this),this.wk=a}},mode:{get:function(){return this.el},set:function(a){this._isFrozen&&Bt(this),this.el=a}}}),ds.prototype.updateSource=ds.prototype.sp,ds.prototype.updateTarget=ds.prototype.Mv,ds.prototype.ofModel=ds.prototype.dA,ds.prototype.ofObject=ds.prototype.cp,ds.prototype.makeTwoWay=ds.prototype.Kx;var NS="Binding",Bx=new Ot(ds,"OneWay",1),fm=new Ot(ds,"TwoWay",2);ds.className="Binding",ds.parseEnum=function(a,y){return function(x){return x=Li(a,x),x===null?y:x}},ds.toString=Pr,ds.OneWay=Bx,ds.TwoWay=fm;function zo(a,y,x){ar.call(this),this.Vv=`,
"insertedLinkKeys": `,this.iy=`,
"modifiedLinkData": `,this.Xv=`,
"removedLinkKeys": `,this.md=[],this.$f=new In,this.wb=new Rt,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&&(jt(a)?this.nodeDataArray=a:x=a),x&&(Object.assign(this,x),a=x.Changed)&&(delete this.Changed,this.Pe(a))}_t(zo,ar),zo.constructGraphLinksModel=ar.constructGraphLinksModel,zo.prototype.cloneProtected=function(a){ar.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},be=zo.prototype,be.clear=function(){ar.prototype.clear.call(this),this.md=[],this.wb.clear(),this.$f.clear()},be.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)+":"+Pr(b)}for(y+=`
link data:`,a=this.linkDataArray,x=a.length,E=0;E<x;E++)b=a[E],y+=" "+gu(this,b,!0)+"-->"+gu(this,b,!1)}return y},be.Qv=function(a,y){this.linkKeyProperty===""&&at("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var x=ar.prototype.Qv.call(this,a,y),E=this,b=new In,z=new In,ee=new In,re=this.vh;a.changes.each(function(he){he.model===E&&(he.modelChange==="linkDataArray"?he.change===Go?b.add(he.newValue):he.change===ha&&ee.add(he.oldValue):E.Jc(he.object)?z.add(he.object):he.object!==null&&(he.object!==null&&re&&re.contains(he.object)?re.get(he.object).each(function(pe){E.Jc(pe)&&z.add(pe)}):he.object instanceof ar||E.lb(he.object)||Mx(E,he.object).each(function(pe){z.add(pe)})))});var oe=this.il;oe.clear(),b.each(function(he){oe.add(E.Ac(he)),y||z.add(he)});var ue=this.kl;return ue.clear(),ee.each(function(he){ue.add(E.Ac(he)),y&&z.add(he)}),a=E.cloneDeep(z.Fa()),0<oe.count&&(x===null&&(x={}),y?x.removedLinkKeys=oe.Fa():x.insertedLinkKeys=oe.Fa()),0<a.length&&(x===null&&(x={}),x.modifiedLinkData=a),0<ue.count&&(x===null&&(x={}),y?x.insertedLinkKeys=ue.Fa():x.removedLinkKeys=ue.Fa()),ue.clear(),oe.clear(),x},be.rm=function(){var a=ar.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},be.gp=function(a){ar.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)},be.Rv=function(){var a=ar.prototype.Rv.call(this),y=`,
"linkDataArray": `+Uc(this,this.linkDataArray,!0);return a+y},be.kv=function(a){ar.prototype.kv.call(this,a),a=a.linkDataArray,Array.isArray(a)&&(this.dm(a),this.linkDataArray=a)};function Mx(a,y){for(var x=new In,E=0;E<a.linkDataArray.length;E++){var b=a.linkDataArray[E];T0(a,y,b,b,x)}return x}be.Pv=function(a,y){this.linkKeyProperty===""&&at("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var x=ar.prototype.Pv.call(this,a,y),E=this,b=new In,z=new In,ee=new In,re=this.vh;a.changes.each(function(he){he.model===E&&(he.modelChange==="linkDataArray"?he.change===Go?b.add(he.newValue):he.change===ha&&ee.add(he.oldValue):E.Jc(he.object)?z.add(he.object):he.object!==null&&(he.object!==null&&re&&re.contains(he.object)?re.get(he.object).each(function(pe){E.Jc(pe)&&z.add(pe)}):he.object instanceof ar||E.lb(he.object)||Mx(E,he.object).each(function(pe){z.add(pe)})))});var oe=this.il;oe.clear(),b.each(function(he){oe.add(E.Ac(he)),y||z.add(he)});var ue=this.kl;return ue.clear(),ee.each(function(he){ue.add(E.Ac(he)),y&&z.add(he)}),a=x,0<oe.count&&(a+=(y?this.Xv:this.Vv)+Uc(this,oe.Fa(),!0)),0<z.count&&(a+=this.iy+Uc(this,z.Fa(),!0)),0<ue.count&&(a+=(y?this.Vv:this.Xv)+Uc(this,ue.Fa(),!0)),ue.clear(),oe.clear(),a},be.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)&&at("applyIncrementalJson cannot change Model properties"),ar.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 ee in b)ee!=="__gohashid"&&ee!==this.linkKeyProperty&&this.setDataProperty(z,ee,b[ee]);Nx(this,b,z)}}if(a=a.removedLinkKeys,Array.isArray(a))for(ee=a.length,y=0;y<ee;y++)x=this.jh(a[y]),x!==null&&this.bm(x)},zo.prototype.changeState=function(a,y){if(a!==null&&a.model===this){if(a.change===oo){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),Ha(x,E,b);return}}else if(a.change===Go){if(x=a.newParam,a.modelChange==="linkDataArray"){a=a.newValue,Qt(a)&&typeof x=="number"&&(E=this.Ac(a),y?(this.$f.remove(a),this.md[x]===a&&this.md.splice(x,1),E!==void 0&&this.wb.remove(E)):(this.$f.add(a),this.md[x]!==a&&this.md.splice(x,0,a),E!==void 0&&this.wb.add(E,a)));return}if(a.modelChange==="linkLabelKeys"){E=this.Ef(a.object),Array.isArray(E)&&typeof x=="number"&&(y?(x=E.indexOf(a.newValue),0<=x&&E.splice(x,1)):0>E.indexOf(a.newValue)&&E.splice(x,0,a.newValue));return}}else if(a.change===ha){if(x=a.oldParam,a.modelChange==="linkDataArray"){a=a.oldValue,Qt(a)&&typeof x=="number"&&(E=this.Ac(a),y?(this.$f.add(a),this.md[x]!==a&&this.md.splice(x,0,a),E!==void 0&&this.wb.add(E,a)):(this.$f.remove(a),this.md[x]===a&&this.md.splice(x,1),E!==void 0&&this.wb.remove(E)));return}if(a.modelChange==="linkLabelKeys"){E=this.Ef(a.object),Array.isArray(E)&&typeof x=="number"&&(y?0>E.indexOf(a.newValue)&&E.splice(x,0,a.newValue):(x=E.indexOf(a.newValue),0<=x&&E.splice(x,1)));return}}ar.prototype.changeState.call(this,a,y)}},be=zo.prototype,be.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),Ha(x,this.nodeKeyProperty,a),this.xf(x))}return a}},be.yx=function(a){return gu(this,a,!0)},be.wv=function(a,y){Sp(this,a,y,!0)},be.Bx=function(a){return gu(this,a,!1)},be.Bv=function(a,y){Sp(this,a,y,!1)};function gu(a,y,x){if(y!==null&&(a=x?a.lf:a.mf,a!==""&&(a=hs(y,a),a!==void 0))){if(Yc(a))return a;at((x?"FromKey":"ToKey")+" value for link data "+y+" is not a number or a string: "+a)}}function Sp(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=hs(y,b);z!==x&&(ch(a,z,y),Ha(y,b,x),a.hc(x)===null&&dh(a,x,y),ys(a,E?"linkFromKey":"linkToKey",oo,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Ha(y,b,x)}}be.zx=function(a){return I0(this,a,!0)},be.xv=function(a,y){wp(this,a,y,!0)},be.Cx=function(a){return I0(this,a,!1)},be.Cv=function(a,y){wp(this,a,y,!1)};function I0(a,y,x){return y===null||(a=x?a.ej:a.fj,a==="")?"":(y=hs(y,a),y===void 0?"":y)}function wp(a,y,x,E){if(y!==null){var b=E?a.ej:a.fj;if(b!=="")if(a.Jc(y)){var z=hs(y,b);z===void 0&&(z=""),z!==x&&(Ha(y,b,x),ys(a,E?"linkFromPortId":"linkToPortId",oo,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Ha(y,b,x)}}be.Ef=function(a){if(a===null)return O0;var y=this.je;return y===""?O0:(a=hs(a,y),a===void 0?O0:a)},be.Ls=function(a,y){if(a!==null){var x=this.je;if(x!=="")if(this.Jc(a)){var E=hs(a,x);if(E===void 0&&(E=O0),E!==y){if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)ch(this,E[z],a);for(Ha(a,x,y),b=y.length,z=0;z<b;z++){var ee=y[z];this.hc(ee)===null&&dh(this,ee,a)}ys(this,"linkLabelKeys",oo,x,a,E,y),typeof x=="string"&&this.La(a,x)}}else Ha(a,x,y)}},be.Bu=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=hs(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&&dh(this,y,a),ys(this,"linkLabelKeys",Go,x,a,null,y,null,b)))}else at(x+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}},be.Qx=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=hs(a,x);if(Array.isArray(E)){var b=E.indexOf(y);0>b||(E.splice(b,1),this.Jc(a)&&(ch(this,y,a),ys(this,"linkLabelKeys",ha,x,a,y,null,b,null)))}else E!==void 0&&at(x+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}},be.Ac=function(a){if(a!==null){var y=this.Jh;if(y!==""&&(y=hs(a,y),y!==void 0)){if(Yc(y))return y;at("Key value for link data "+a+" is not a number or a string: "+y)}}},be.Ks=function(a,y){if(a!==null){var x=this.Jh;if(x!=="")if(this.Jc(a)){var E=hs(a,x);E!==y&&this.jh(y)===null&&(Ha(a,x,y),E!==void 0&&this.wb.remove(E),this.wb.add(y,a),ys(this,"linkKey",oo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ha(a,x,y)}},be.jh=function(a){return a===null&&at("GraphLinksModel.findLinkDataForKey:key must not be null"),a!==void 0&&Yc(a)?this.wb.I(a):null},be.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))){Ha(a,y,x);return}if(typeof x=="string"){for(E=2;this.wb.contains(x+E);)E++;Ha(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.wb.count-1;this.wb.contains(x);)x--;Ha(a,y,x)}}}}},be.Jc=function(a){return a===null?!1:this.$f.contains(a)},be.fi=function(a){a!==null&&(Do(a),this.Jc(a)||kx(this,a,!0))};function kx(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&&at("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)),ys(a,"linkDataArray",Go,"linkDataArray",a,null,y,null,E),Py(a,y)}be.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)},be.bm=function(a){a!==null&&Ax(this,a,!0)};function Ax(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(ys(a,"linkDataArray",ha,"linkDataArray",a,y,null,E,null),x=gu(a,y,!0),ch(a,x,y),x=gu(a,y,!1),ch(a,x,y),E=a.Ef(y),Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],ch(a,x,y)}be.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)},be.Zz=function(a){if(this.linkKeyProperty===""&&at("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),a!==this.linkDataArray&&jt(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],ee=this.Ac(z);if(ee!==void 0){x.add(ee);var re=this.jh(ee);re!==z&&(re!==null?(this.Do(re,z),Nx(this,z,re)):(z=this.cloneDeep(z),this.Ks(z,ee),this.fi(z)))}else ee=this.cloneDeep(z),this.fi(ee),x.add(this.Ac(ee))}for(a=y.iterator;a.next();)E=a.value,x.contains(E)||(E=this.jh(E))&&this.bm(E);y.clear(),x.clear()}};function Py(a,y){var x=gu(a,y,!0);x=a.Vl(x),a.hc(x)===null&&dh(a,x,y),x=gu(a,y,!1),x=a.Vl(x),a.hc(x)===null&&dh(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&&dh(a,x,y)}be.Jo=function(a){if(a===null)return null;var y=this.Ak;return a=y!==null?y(a,this):_0(this,a,!0),Qt(a)&&(Er(a),this.lf!==""&&Ha(a,this.lf,void 0),this.mf!==""&&Ha(a,this.mf,void 0),this.je!==""&&Ha(a,this.je,[])),a},be.Yu=function(a){if(a===null)return!1;var y=this.jl;return y===""?!1:!!hs(a,y)},be.lh=function(a){if(a!==null){var y=this.Je;if(y!==""&&(y=hs(a,y),y!==void 0)){if(Yc(y))return y;at("GroupKey value for node data "+a+" is not a number or a string: "+y)}}},be.mp=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Je;if(x!=="")if(this.lb(a)){var E=hs(a,x);E!==y&&(ch(this,E,a),Ha(a,x,y),this.hc(y)===null&&dh(this,y,a),ys(this,"nodeGroupKey",oo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ha(a,x,y)}},zo.prototype.copyNodeData=function(a){return a===null?null:(a=ar.prototype.copyNodeData.call(this,a),this.Ij||this.Je===""||hs(a,this.Je)===void 0||Ha(a,this.Je,void 0),a)},zo.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){Sp(this,a,x,!0);return}if(y===this.linkToKeyProperty){Sp(this,a,x,!1);return}if(y===this.linkFromPortIdProperty){wp(this,a,x,!0);return}if(y===this.linkToPortIdProperty){wp(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=hs(a,y);E!==x&&(Ha(a,y,x),this.Fs(a,y,E,x))},be=zo.prototype,be.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&&hs(a,b)===y[b]||E&&b===this.linkKeyProperty||this.setDataProperty(a,b,y[b])}},be.jp=function(a,y){ar.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(gu(this,E,!0)===b){var ee=this.lf;Ha(E,ee,z),ys(this,"linkFromKey",oo,ee,E,b,z),typeof ee=="string"&&this.La(E,ee)}if(gu(this,E,!1)===b&&(ee=this.mf,Ha(E,ee,z),ys(this,"linkToKey",oo,ee,E,b,z),typeof ee=="string"&&this.La(E,ee)),ee=this.Ef(E),Array.isArray(ee))for(var re=ee.length,oe=this.je,ue=0;ue<re;ue++)ee[ue]===b&&(ee[ue]=z,ys(this,"linkLabelKeys",Go,oe,E,b,z,ue,ue))}},be.qv=function(a,y,x){if(this.lh(a)===y){var E=this.Je;Ha(a,E,x),ys(this,"nodeGroupKey",oo,E,a,y,x),typeof E=="string"&&this.La(a,E)}},be.Lv=function(){ar.prototype.Lv.call(this);for(var a=this.linkDataArray,y=a.length,x=0;x<y;x++)Py(this,a[x])},be.fm=function(a){ar.prototype.fm.call(this,a),a=this.wa(a);var y=dm(this,a);if(y!==null){var x=xi();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)){if(this.lh(E)===a){var b=this.Je;ys(this,"nodeGroupKey",oo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}else if(gu(this,E,!0)===a&&(b=this.lf,ys(this,"linkFromKey",oo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),gu(this,E,!1)===a&&(b=this.mf,ys(this,"linkToKey",oo,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,ee=this.je,re=0;re<z;re++)b[re]===a&&(ys(this,"linkLabelKeys",Go,ee,E,a,a,re,re),x.push(E))}for(y=0;y<x.length;y++)ch(this,a,x[y]);Bi(x)}},be.em=function(a){ar.prototype.em.call(this,a);var y=this.lh(a);this.hc(y)===null&&dh(this,y,a)},be.qp=function(a){ar.prototype.qp.call(this,a);var y=this.lh(a);ch(this,y,a)},be.ps=function(a){if(a===null)return"";var y=this.dj;if(y===""||(y=hs(a,y),y===void 0))return"";if(typeof y=="string")return y;at("getCategoryForLinkData found a non-string category for "+a+": "+y)},zo.prototype.getLinkCategoryForData=function(a){return this.ps(a)},zo.prototype.lp=function(a,y){if(a!==null){var x=this.dj;if(x!=="")if(this.Jc(a)){var E=hs(a,x);E===void 0&&(E=""),E!==y&&(Ha(a,x,y),ys(this,"linkCategory",oo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ha(a,x,y)}},zo.prototype.setLinkCategoryForData=function(a,y){this.lp(a,y)},be=zo.prototype,be.lm=function(a,y){ar.prototype.lm.call(this,a,y),this.mp(y,this.lh(a))};function Nx(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))}be.Wj=function(){return!0},be.ri=function(){return!0},be.xs=function(){return!0},be.Xj=function(){return!0},fn.Object.defineProperties(zo.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(a){var y=this.Ri;y!==a&&(this.Ri=a,this.g("archetypeNodeData",y,a))}},linkFromKeyProperty:{get:function(){return this.lf},set:function(a){var y=this.lf;y!==a&&(this.lf=a,this.g("linkFromKeyProperty",y,a))}},linkToKeyProperty:{get:function(){return this.mf},set:function(a){var y=this.mf;y!==a&&(this.mf=a,this.g("linkToKeyProperty",y,a))}},linkFromPortIdProperty:{get:function(){return this.ej},set:function(a){var y=this.ej;y!==a&&(this.ej=a,this.g("linkFromPortIdProperty",y,a))}},linkToPortIdProperty:{get:function(){return this.fj},set:function(a){var y=this.fj;y!==a&&(this.fj=a,this.g("linkToPortIdProperty",y,a))}},linkLabelKeysProperty:{get:function(){return this.je},set:function(a){var y=this.je;y!==a&&(this.je=a,this.g("linkLabelKeysProperty",y,a))}},linkDataArray:{get:function(){return this.md},set:function(a){var y=this.md;if(y!==a){this.wb.clear();for(var x=a.length,E=0;E<x;E++){var b=a[E];Qt(b)||at("GraphLinksModel.linkDataArray must only contain Objects, not: "+b),Do(b)}if(this.md=a,this.linkKeyProperty!==""){for(E=new Bn,b=0;b<x;b++){var z=a[b],ee=this.Ac(z);ee===void 0||this.wb.I(ee)!==null?E.add(z):this.wb.add(ee,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 In,b=0;b<x;b++)E.add(a[b]);for(this.$f=E,ys(this,"linkDataArray",oo,"linkDataArray",this,y,a),y=0;y<x;y++)Py(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"}}}),zo.prototype.setCategoryForLinkData=zo.prototype.lp,zo.prototype.getCategoryForLinkData=zo.prototype.ps,zo.prototype.assignAllDataProperties=zo.prototype.Do,zo.prototype.setGroupKeyForNodeData=zo.prototype.mp,zo.prototype.getGroupKeyForNodeData=zo.prototype.lh,zo.prototype.isGroupForNodeData=zo.prototype.Yu,zo.prototype.copyLinkData=zo.prototype.Jo,zo.prototype.mergeLinkDataArray=zo.prototype.Zz,zo.prototype.removeLinkDataCollection=zo.prototype.lA,zo.prototype.removeLinkData=zo.prototype.bm,zo.prototype.addLinkDataCollection=zo.prototype.Ey,zo.prototype.addLinkData=zo.prototype.fi,zo.prototype.containsLinkData=zo.prototype.Jc,zo.prototype.makeLinkDataKeyUnique=zo.prototype.Bs,zo.prototype.findLinkDataForKey=zo.prototype.jh,zo.prototype.setKeyForLinkData=zo.prototype.Ks,zo.prototype.getKeyForLinkData=zo.prototype.Ac,zo.prototype.removeLabelKeyForLinkData=zo.prototype.Qx,zo.prototype.addLabelKeyForLinkData=zo.prototype.Bu,zo.prototype.setLabelKeysForLinkData=zo.prototype.Ls,zo.prototype.getLabelKeysForLinkData=zo.prototype.Ef,zo.prototype.setToPortIdForLinkData=zo.prototype.Cv,zo.prototype.getToPortIdForLinkData=zo.prototype.Cx,zo.prototype.setFromPortIdForLinkData=zo.prototype.xv,zo.prototype.getFromPortIdForLinkData=zo.prototype.zx,zo.prototype.setToKeyForLinkData=zo.prototype.Bv,zo.prototype.getToKeyForLinkData=zo.prototype.Bx,zo.prototype.setFromKeyForLinkData=zo.prototype.wv,zo.prototype.getFromKeyForLinkData=zo.prototype.yx,zo.prototype.clear=zo.prototype.clear;var O0=Object.freeze([]);zo.className="GraphLinksModel",qu.GraphLinksModel=zo,ar.constructGraphLinksModel=ar.constructGraphLinksModel=function(){return new zo},ar.initDiagramModel=Sy=function(){return new zo};function El(a,y){ar.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",a!==void 0&&(jt(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}_t(El,ar),El.constructGraphLinksModel=ar.constructGraphLinksModel,El.prototype.cloneProtected=function(a){ar.prototype.cloneProtected.call(this,a),a.Ke=this.Ke,a.Nm=this.Nm,a.nj=this.nj},be=El.prototype,be.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)+":"+Pr(b)}}return y},be.rm=function(){var a=ar.prototype.rm.call(this),y="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(y+=`,
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),a+y},be.gp=function(a){ar.prototype.gp.call(this,a),a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)},be.fp=function(a){a.nodeParentKeyProperty!==void 0&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&at("applyIncrementalJson cannot change Model properties"),ar.prototype.fp.call(this,a)},be.Vl=function(a){return a},be.mh=function(a){if(a!==null){var y=this.Ke;if(y!==""&&(y=hs(a,y),y!==void 0)){if(Yc(y))return y;at("ParentKey value for node data "+a+" is not a number or a string: "+y)}}},be.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=hs(a,x);E!==y&&(ch(this,E,a),Ha(a,x,y),this.hc(y)===null&&dh(this,y,a),ys(this,"nodeParentKey",oo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ha(a,x,y)}},be.ss=function(a){if(a===null)return"";var y=this.nj;return y===""||(y=hs(a,y),y===void 0)?"":typeof y=="string"?y:(at("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+y),"")},El.prototype.getLinkCategoryForData=function(a){return this.ss(a)},El.prototype.Ms=function(a,y){if(a!==null){var x=this.nj;if(x!=="")if(this.lb(a)){var E=hs(a,x);E===void 0&&(E=""),E!==y&&(Ha(a,x,y),ys(this,"parentLinkCategory",oo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ha(a,x,y)}},El.prototype.setLinkCategoryForData=function(a,y){this.Ms(a,y)},El.prototype.copyNodeData=function(a){return a===null?null:(a=ar.prototype.copyNodeData.call(this,a),this.Jj||this.Ke===""||hs(a,this.Ke)===void 0||Ha(a,this.Ke,void 0),a)},El.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=hs(a,y);E!==x&&(Ha(a,y,x),this.Fs(a,y,E,x))},be=El.prototype,be.jp=function(a,y){ar.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y)},be.qv=function(a,y,x){if(this.mh(a)===y){var E=this.Ke;Ha(a,E,x),ys(this,"nodeParentKey",oo,E,a,y,x),typeof E=="string"&&this.La(a,E)}},be.fm=function(a){ar.prototype.fm.call(this,a),a=this.wa(a);var y=dm(this,a);if(y!==null){var x=xi();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)&&this.mh(E)===a){var b=this.Ke;ys(this,"nodeParentKey",oo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}for(y=0;y<x.length;y++)ch(this,a,x[y]);Bi(x)}},be.em=function(a){ar.prototype.em.call(this,a);var y=this.mh(a);y=this.Vl(y),this.hc(y)===null&&dh(this,y,a)},be.qp=function(a){ar.prototype.qp.call(this,a);var y=this.mh(a);ch(this,y,a)},be.lm=function(a,y){ar.prototype.lm.call(this,a,y),this.Ms(y,this.ss(a)),this.qe(y,this.mh(a))},be.Tl=function(){return!0},be.xs=function(){return!0},fn.Object.defineProperties(El.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"}}}),El.prototype.setParentLinkCategoryForNodeData=El.prototype.Ms,El.prototype.getParentLinkCategoryForNodeData=El.prototype.ss,El.prototype.setParentKeyForNodeData=El.prototype.qe,El.prototype.getParentKeyForNodeData=El.prototype.mh,El.className="TreeModel",qu.TreeModel=El;function Ya(a){Va.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=eh,this.Ti=0,this.Zv=new Ie,this.Jp=this.me=0,this.Xr=new vm,this.gt=this.mj=0,this.ty=600,this.eo=NaN,this.Cm=1,this.ro=0,this.ul=360,this.Rb=eh,this.K=Cl,this.nd=Ep,this.hd=gy,this.tf=6,this.Nn=H0,a&&Object.assign(this,a)}_t(Ya,Va),Ya.prototype.cloneProtected=function(a){Va.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},Ya.prototype.qb=function(a){a.classType===Ya?a===G0||a===W0||a===z0||a===Z0||a===Ep?this.sorting=a:a===Rf||a===Pp||a===Cl||a===Jc?this.direction=a:a===sc||a===Xc||a===eh||a===th?this.arrangement=a:(a===Bg||a===H0)&&(this.nodeDiameterFormula=a):Va.prototype.qb.call(this,a)},Ya.prototype.createNetwork=function(){return new Cp(this)},Ya.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 Bn;y.addAll(a.iterator),a=new Bn;var x=new Bn,E=this.sort(y),b,z,ee=this.Jp,re=this.arrangement,oe=this.nodeDiameterFormula,ue=this.radius;(!isFinite(ue)||0>=ue)&&(ue=NaN);var he=this.aspectRatio;(!isFinite(he)||0>=he)&&(he=1);var pe=this.startAngle;isFinite(pe)||(pe=0);var Se=this.sweepAngle;if((!isFinite(Se)||360<Se||1>Se)&&(Se=360),y=this.spacing,isFinite(y)||(y=NaN),re===th&&oe===Bg?re=eh:re===th&&oe!==Bg&&(re=this.arrangement),(this.direction===Rf||this.direction===Pp)&&this.sorting!==Ep){for(oe=0;!(oe>=E.length)&&(a.add(E.M(oe)),!(oe+1>=E.length));oe+=2)x.add(E.M(oe+1));this.direction===Rf?(this.arrangement===th&&a.reverse(),E=new Bn,E.addAll(a),E.addAll(x)):(this.arrangement===th&&x.reverse(),E=new Bn,E.addAll(x),E.addAll(a))}oe=E.length;for(var Pe=z=b=0;Pe<E.length;Pe++){var Fe=pe+Se*z*(this.direction===Cl?1:-1)/oe,Ne=E.M(Pe).diameter;isNaN(Ne)&&(Ne=Qc(E.M(Pe),Fe)),360>Se&&(Pe===0||Pe===E.length-1)&&(Ne/=2),b+=Ne,z++}if(isNaN(ue)||re===th){if(isNaN(y)&&(y=6),re!==eh&&re!==th){for(z=-1/0,ee=0;ee<oe;ee++)Pe=E.M(ee),b=E.M(ee===oe-1?0:ee+1),isNaN(Pe.diameter)&&Qc(Pe,0),isNaN(b.diameter)&&Qc(b,0),z=Math.max(z,(Pe.diameter+b.diameter)/2);ee=z+y,re===sc?ue=(z+y)/(2*Math.PI/oe):ue=R0(this,ee*(360<=Se?oe:oe-1),he,pe*Math.PI/180,Se*Math.PI/180)}else ue=R0(this,b+(360<=Se?oe:oe-1)*(re!==th?y:1.6*y),he,pe*Math.PI/180,Se*Math.PI/180);z=ue*he}else if(z=ue*he,Pe=Ey(this,ue,z,pe*Math.PI/180,Se*Math.PI/180),isNaN(y))(re===eh||re===th)&&(y=(Pe-b)/(360<=Se?oe:oe-1));else if(re===eh||re===th)Pe=(Pe-b)/(360<=Se?oe:oe-1),Pe<y?(ue=R0(this,b+y*(360<=Se?oe:oe-1),he,pe*Math.PI/180,Se*Math.PI/180),z=ue*he):y=Pe;else{for(ee=-1/0,b=0;b<oe;b++)Fe=E.M(b),Ne=E.M(b===oe-1?0:b+1),isNaN(Fe.diameter)&&Qc(Fe,0),isNaN(Ne.diameter)&&Qc(Ne,0),ee=Math.max(ee,(Fe.diameter+Ne.diameter)/2);ee+=y,b=R0(this,ee*(360<=Se?oe:oe-1),he,pe*Math.PI/180,Se*Math.PI/180),b>ue?(ue=b,z=ue*he):ee=Pe/(360<=Se?oe:oe-1)}if(this.kw=re,this.lc=ue,this.Zm=he,this.lw=pe,this.Wp=Se,this.Ti=y,this.me=z,this.Jp=ee,y=E,E=this.kw,re=this.lc,ue=this.lw,he=this.Wp,pe=this.Ti,Se=this.me,oe=this.Jp,this.direction!==Rf&&this.direction!==Pp||E!==th)if(this.direction===Rf||this.direction===Pp){switch(ee=0,E){case Xc:ee=180*j0(this,re,Se,ue,oe)/Math.PI;break;case eh:oe=y=0,ee=a.first(),ee!==null&&(y=Qc(ee,Math.PI/2)),ee=x.first(),ee!==null&&(oe=Qc(ee,Math.PI/2)),ee=180*j0(this,re,Se,ue,pe+(y+oe)/2)/Math.PI;break;case sc:ee=he/y.length}if(this.direction===Rf){switch(E){case Xc:mm(this,a,ue,Jc);break;case eh:pm(this,a,ue,Jc);break;case sc:gm(this,a,he/2,ue,Jc)}switch(E){case Xc:mm(this,x,ue+ee,Cl);break;case eh:pm(this,x,ue+ee,Cl);break;case sc:gm(this,x,he/2,ue+ee,Cl)}}else{switch(E){case Xc:mm(this,x,ue,Jc);break;case eh:pm(this,x,ue,Jc);break;case sc:gm(this,x,he/2,ue,Jc)}switch(E){case Xc:mm(this,a,ue+ee,Cl);break;case eh:pm(this,a,ue+ee,Cl);break;case sc:gm(this,a,he/2,ue+ee,Cl)}}}else switch(E){case Xc:mm(this,y,ue,this.direction);break;case eh:pm(this,y,ue,this.direction);break;case sc:gm(this,y,he,ue,this.direction);break;case th:Dx(this,y,he,ue,this.direction)}else Dx(this,y,he,ue-he/2,Cl)}this.updateParts(),this.network=null,this.isValidLayout=!0};function gm(a,y,x,E,b){var z=a.Wp,ee=a.lc;a=a.me,E=E*Math.PI/180,x=x*Math.PI/180;for(var re=y.length,oe=0;oe<re;oe++){var ue=E+(b===Cl?oe*x/(360<=z?re:re-1):-(oe*x)/re),he=y.M(oe),pe=ee*Math.tan(ue)/a;pe=Math.sqrt((ee*ee+a*a*pe*pe)/(1+pe*pe)),he.centerX=pe*Math.cos(ue),he.centerY=pe*Math.sin(ue),he.actualAngle=180*ue/Math.PI}}function pm(a,y,x,E){var b=a.lc,z=a.me,ee=a.Ti;x=x*Math.PI/180;for(var re=y.length,oe=0;oe<re;oe++){var ue=y.M(oe),he=y.M(oe===re-1?0:oe+1),pe=z*Math.sin(x);ue.centerX=b*Math.cos(x),ue.centerY=pe,ue.actualAngle=180*x/Math.PI,isNaN(ue.diameter)&&Qc(ue,0),isNaN(he.diameter)&&Qc(he,0),ue=j0(a,b,z,E===Cl?x:-x,(ue.diameter+he.diameter)/2+ee),x+=E===Cl?ue:-ue}}function mm(a,y,x,E){var b=a.lc,z=a.me,ee=a.Jp;x=x*Math.PI/180;for(var re=y.length,oe=0;oe<re;oe++){var ue=y.M(oe);ue.centerX=b*Math.cos(x),ue.centerY=z*Math.sin(x),ue.actualAngle=180*x/Math.PI,ue=j0(a,b,z,E===Cl?x:-x,ee),x+=E===Cl?ue:-ue}}function Dx(a,y,x,E,b){var z=a.Wp;if(a.mj=0,a.Xr=new vm,360>x){for(z=E+(b===Cl?z:-z);0>z;)z+=360;z%=360,180<z&&(z-=360),z*=Math.PI/180,a.gt=z,_x(a,y,x,E,b)}else Tx(a,y,x,E,b);a.Xr.commit(y)}function Tx(a,y,x,E,b){var z=a.lc,ee=a.Ti,re=a.Zm,oe=z*Math.cos(E*Math.PI/180),ue=a.me*Math.sin(E*Math.PI/180),he=y.Fa();if(he.length===3)he[0].centerX=z,he[0].centerY=0,he[1].centerX=he[0].centerX-he[0].width/2-he[1].width/2-ee,he[1].y=he[0].y,he[2].centerX=(he[0].centerX+he[1].centerX)/2,he[2].y=he[0].y-he[2].height-ee;else if(he.length===4)he[0].centerX=z,he[0].centerY=0,he[2].centerX=-he[0].centerX,he[2].centerY=he[0].centerY,he[1].centerX=0,he[1].y=Math.min(he[0].y,he[2].y)-he[1].height-ee,he[3].centerX=0,he[3].y=Math.max(he[0].y+he[0].height+ee,he[2].y+he[2].height+ee);else{z=Ie.alloc();for(var pe=0;pe<he.length&&(he[pe].centerX=oe,he[pe].centerY=ue,!(pe>=he.length-1));pe++)Ix(a,oe,ue,he,pe,b,z)||Ox(a,oe,ue,he,pe,b,z),oe=z.x,ue=z.y;if(Ie.free(z),a.mj++,!(23<a.mj)){oe=he[0].centerX,ue=he[0].centerY,z=he[he.length-1].centerX,pe=he[he.length-1].centerY;var Se=Math.abs(oe-z)-((he[0].width+he[he.length-1].width)/2+ee),Pe=Math.abs(ue-pe)-((he[0].height+he[he.length-1].height)/2+ee);ee=0,1>Math.abs(Pe)?Math.abs(oe-z)<(he[0].width+he[he.length-1].width)/2&&(ee=0):ee=0<Pe?Pe:1>Math.abs(Se)?0:Se,oe=Math.abs(z)>Math.abs(pe)?0<z!=ue>pe:0<pe!=oe<z,(oe=b===Cl?oe:!oe)&&(ee=-Math.abs(ee),ee=Math.min(ee,-he[he.length-1].width),ee=Math.min(ee,-he[he.length-1].height)),a.Xr.compare(ee,he),1<Math.abs(ee)&&(a.lc=8>a.mj?a.lc-ee/(2*Math.PI):5>he.length&&10<ee?a.lc/2:a.lc-(0<ee?1.7:-2.3),a.me=a.lc*re,Tx(a,y,x,E,b))}}}function _x(a,y,x,E,b){for(var z=a.lc,ee=a.me,re=a.Zm,oe=z*Math.cos(E*Math.PI/180),ue=ee*Math.sin(E*Math.PI/180),he=Ie.alloc(),pe=y.Fa(),Se=0;Se<pe.length&&(pe[Se].centerX=oe,pe[Se].centerY=ue,!(Se>=pe.length-1));Se++)Ix(a,oe,ue,pe,Se,b,he)||Ox(a,oe,ue,pe,Se,b,he),oe=he.x,ue=he.y;if(Ie.free(he),a.mj++,!(23<a.mj)){if(oe=Math.atan2(ue,oe),oe=b===Cl?a.gt-oe:oe-a.gt,oe=Math.abs(oe)<Math.abs(oe-2*Math.PI)?oe:oe-2*Math.PI,z=oe*(z+ee)/2,ee=a.Xr,Math.abs(z)<Math.abs(ee.Pl))for(ee.Pl=z,ee.mk=[],ee.tm=[],oe=0;oe<pe.length;oe++)ee.mk[oe]=pe[oe].bounds.x,ee.tm[oe]=pe[oe].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*re,_x(a,y,x,E,b))}}function Ix(a,y,x,E,b,z,ee){var re=a.lc,oe=a.me,ue=0;a=(E[b].width+E[b+1].width)/2+a.Ti;var he=!1;if(0<=x!=(z===Cl)){if(z=y+a,z>re){if(z=y-a,z<-re)return ee.x=z,ee.y=ue,!1;he=!0}}else if(z=y-a,z<-re){if(z=y+a,z>re)return ee.x=z,ee.y=ue,!1;he=!0}return ue=Math.sqrt(1-Math.min(1,z*z/(re*re)))*oe,0>x!==he&&(ue=-ue),Math.abs(x-ue)>(E[b].height+E[b+1].height)/2?(ee.x=z,ee.y=ue,!1):(ee.x=z,ee.y=ue,!0)}function Ox(a,y,x,E,b,z,ee){var re=a.lc,oe=a.me,ue=0;if(a=(E[b].height+E[b+1].height)/2+a.Ti,E=!1,0<=y!=(z===Cl)){if(z=x-a,z<-oe){if(z=x+a,z>oe){ee.x=ue,ee.y=z;return}E=!0}}else if(z=x+a,z>oe){if(z=x-a,z<-oe){ee.x=ue,ee.y=z;return}E=!0}ue=Math.sqrt(1-Math.min(1,z*z/(oe*oe)))*re,0>y!==E&&(ue=-ue),ee.x=ue,ee.y=z}Ya.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},Ya.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 Ie(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))},Ya.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function Ey(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 ee=0,re=E!==void 0&&b!==void 0?b/(z+1):Math.PI/(2*(z+1)),oe=0,ue=0;ue<=z;ue++){E!==void 0&&b!==void 0?oe=E+ue*b/z:oe=ue*Math.PI/(2*z);var he=Math.sin(oe);ee+=Math.sqrt(1-a*a*he*he)*re}return E!==void 0&&b!==void 0?(y>x?y:x)*ee:4*(y>x?y:x)*ee}function R0(a,y,x,E,b){return y/(E!==void 0&&b!==void 0?Ey(a,1,x,E,b):Ey(a,1,x))}function j0(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,ee=0;a=2*Math.PI/(700*a.network.vertexes.count),y>x&&(E+=Math.PI/2);for(var re=0;;re++){var oe=Math.sin(E+re*a);if(ee+=(y>x?y:x)*Math.sqrt(1-z*z*oe*oe)*a,ee>=b)return re*a}}Ya.prototype.sort=function(a){switch(this.sorting){case z0:break;case Z0:a.reverse();break;case G0:a.sort(this.comparer);break;case W0:a.sort(this.comparer),a.reverse();break;case Ep:return this.ak(DS(a));default:at("Invalid sorting type.")}return a};function DS(a){for(var y=[],x=0;x<a.length;x++)y.push(0);x=new Bn;for(var E=0;E<a.length;E++){var b=-1,z=-1;if(E===0)for(var ee=0;ee<a.length;ee++){var re=a.M(ee).edgesCount;re>b&&(b=re,z=ee)}else for(ee=0;ee<a.length;ee++)re=y[ee],re>b&&(b=re,z=ee);for(x.add(a.M(z)),y[z]=-1,z=a.M(z),ee=z.sourceEdges;ee.next();)b=a.indexOf(ee.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}Ya.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 ee=[],re=[];E=[],b=new Bn;for(var oe=0,ue=0;ue<y.length;ue++){var he=y[ue].length;if(he===1)E.push(ue);else if(he===0)b.add(a.M(ue));else{if(oe===0)x.push(ue);else{for(var pe=he=1/0,Se=-1,Pe=[],Fe=0;Fe<x.length;Fe++)0>y[x[Fe]].indexOf(x[Fe===x.length-1?0:Fe+1])&&Pe.push(Fe===x.length-1?0:Fe+1);if(Pe.length===0)for(Fe=0;Fe<x.length;Fe++)Pe.push(Fe);for(Fe=0;Fe<Pe.length;Fe++){for(var Ne=Pe[Fe],Xe=y[ue],Ve=0,ht=0;ht<ee.length;ht++){var ft=z[ee[ht]],mt=z[re[ht]];if(ft<mt){var Ct=ft;ft=mt}else Ct=mt;if(Ct<Ne&&Ne<=ft)for(mt=0;mt<Xe.length;mt++){var Kt=Xe[mt];0>x.indexOf(Kt)||Ct<z[Kt]&&z[Kt]<ft||Ct===z[Kt]||ft===z[Kt]||Ve++}else for(mt=0;mt<Xe.length;mt++)Kt=Xe[mt],0>x.indexOf(Kt)||Ct<z[Kt]&&z[Kt]<ft&&Ct!==z[Kt]&&ft!==z[Kt]&&Ve++}for(Xe=Ve,ht=Ve=0;ht<y[ue].length;ht++)Ct=x.indexOf(y[ue][ht]),0<=Ct&&(Ct=Math.abs(Ne-(Ct>=Ne?Ct+1:Ct)),Ve+=Ct<x.length+1-Ct?Ct:x.length+1-Ct);for(ht=0;ht<ee.length;ht++)Ct=z[ee[ht]],ft=z[re[ht]],Ct>=Ne&&Ct++,ft>=Ne&&ft++,Ct>ft&&(mt=ft,ft=Ct,Ct=mt),ft-Ct<(x.length+2)/2==(Ct<Ne&&Ne<=ft)&&Ve++;(Xe<he||Xe===he&&Ve<pe)&&(he=Xe,pe=Ve,Se=Ne)}for(x.splice(Se,0,ue),he=0;he<x.length;he++)z[x[he]]=he;for(he=0;he<y[ue].length;he++)pe=y[ue][he],0<=x.indexOf(pe)&&(ee.push(ue),re.push(pe))}oe++}}for(ee=x.length;;){for(z=!0,re=0;re<E.length;re++)if(oe=E[re],ue=y[oe][0],he=x.indexOf(ue),0<=he){for(Se=pe=0;Se<y[ue].length;Se++)Pe=x.indexOf(y[ue][Se]),0>Pe||Pe===he||(Fe=Pe>he?Pe-he:he-Pe,pe+=Pe<he!=Fe>ee-Fe?1:-1);x.splice(0>pe?he:he+1,0,oe),E.splice(re,1),re--}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},fn.Object.defineProperties(Ya.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!==th&&a!==eh&&a!==Xc&&a!==sc||(this.Rb=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==Cl&&a!==Jc&&a!==Rf&&a!==Pp||(this.K=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==z0&&a!==Z0&&a!==G0&&!W0&&a!==Ep||(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!==H0&&a!==Bg||(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 eh=new Ot(Ya,"ConstantSpacing",0),Xc=new Ot(Ya,"ConstantDistance",1),sc=new Ot(Ya,"ConstantAngle",2),th=new Ot(Ya,"Packed",3),Cl=new Ot(Ya,"Clockwise",4),Jc=new Ot(Ya,"Counterclockwise",5),Rf=new Ot(Ya,"BidirectionalLeft",6),Pp=new Ot(Ya,"BidirectionalRight",7),z0=new Ot(Ya,"Forwards",8),Z0=new Ot(Ya,"Reverse",9),G0=new Ot(Ya,"Ascending",10),W0=new Ot(Ya,"Descending",11),Ep=new Ot(Ya,"Optimized",12),H0=new Ot(Ya,"Pythagorean",13),Bg=new Ot(Ya,"Circular",14);Ya.className="CircularLayout",Ya.ConstantSpacing=eh,Ya.ConstantDistance=Xc,Ya.ConstantAngle=sc,Ya.Packed=th,Ya.Clockwise=Cl,Ya.Counterclockwise=Jc,Ya.BidirectionalLeft=Rf,Ya.BidirectionalRight=Pp,Ya.Forwards=z0,Ya.Reverse=Z0,Ya.Ascending=G0,Ya.Descending=W0,Ya.Optimized=Ep,Ya.Pythagorean=H0,Ya.Circular=Bg;function vm(){this.Pl=-1/0,this.tm=this.mk=null}vm.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},vm.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]}},vm.className="VertexArrangement";function Cp(a){za.call(this,a)}_t(Cp,za),Cp.prototype.createVertex=function(){return new ym(this)},Cp.prototype.createEdge=function(){return new V0(this)},Cp.className="CircularNetwork";function ym(a){bs.call(this,a),this.u=this.Si=NaN}_t(ym,bs);function Qc(a,y){var x=a.network;if(x===null)return NaN;if(x=x.layout,x===null)return NaN;if(x.arrangement===th)if(x.nodeDiameterFormula===Bg)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===Bg?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.Si}fn.Object.defineProperties(ym.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)}}}),ym.className="CircularVertex";function V0(a){iu.call(this,a)}_t(V0,iu),V0.className="CircularEdge";function $s(a){Va.call(this),this.ah=null,this.An=0,this.$d=new Pn(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)}_t($s,Va),$s.prototype.cloneProtected=function(a){Va.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},$s.prototype.createNetwork=function(){return new Mg(this)},$s.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}Rx(this,0,a)}this.network=y;var ee=E=x.iterator;E=this.arrangementSpacing;var re=ee.count,oe=!0;z=b=0;for(var ue=xi(),he=0;he<re+y.vertexes.count+2;he++)ue[he]=null;re=0,ee.reset();for(var pe=Gt.alloc();ee.next();)if(he=ee.value,this.computeBounds(he,pe),oe)oe=!1,b=pe.x+pe.width/2,z=pe.y+pe.height/2,ue[0]=new Ie(pe.x+pe.width+E.width,pe.y),ue[1]=new Ie(pe.x,pe.y+pe.height+E.height),re=2;else{var Se=jx(ue,re,b,z,pe.width,pe.height,E),Pe=ue[Se],Fe=new Ie(Pe.x+pe.width+E.width,Pe.y),Ne=new Ie(Pe.x,Pe.y+pe.height+E.height);for(Se+1<re&&ue.splice(Se+1,0,null),ue[Se]=Fe,ue[Se+1]=Ne,re++,Se=Pe.x-pe.x,Pe=Pe.y-pe.y,he=he.vertexes.iterator;he.next();)Fe=he.value,Fe.centerX+=Se,Fe.centerY+=Pe}for(Gt.free(pe),he=y.vertexes.iterator;he.next();)ee=he.value,Se=ee.bounds,2>re?(b=Se.x+Se.width/2,z=Se.y+Se.height/2,ue[0]=new Ie(Se.x+Se.width+E.width,Se.y),ue[1]=new Ie(Se.x,Se.y+Se.height+E.height),re=2):(oe=jx(ue,re,b,z,Se.width,Se.height,E),pe=ue[oe],Pe=new Ie(pe.x+Se.width+E.width,pe.y),Se=new Ie(pe.x,pe.y+Se.height+E.height),oe+1<re&&ue.splice(oe+1,0,null),ue[oe]=Pe,ue[oe+1]=Se,re++,ee.centerX=pe.x+ee.width/2,ee.centerY=pe.y+ee.height/2);for(Bi(ue),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)}}Zx(this,a),this.updateParts()}this.dl=a,this.network=null,this.isValidLayout=!0},$s.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},$s.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 Rx(a,y,x){if(TS(a,y)){var E=a.Zf;a.Zf*=1+1/(y+1);var b=_S(a,y),z=Math.max(0,Math.max(Math.min(a.network.vertexes.count,x*(y+1)/11),10));for(a.maxIterations+=z,Rx(a,y+1,x),Zx(a,z),IS(a,b),y=b.vertexes.Fa(),y.sort(function(ee,re){return ee===null||re===null||ee===re?0:re.Vd-ee.Vd}),x=0;x<y.length;x++)OS(a,y[x]);a.Zf=E}}function TS(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 _S(a,y){for(var x=a.network,E=new Mg(a),b=0;b<a.ah.length;b++){var z=a.ah[b];if(1<z.Vd){E.dh(z);var ee=new Gx;ee.Rs=z.Vd,ee.Ss=z.width,ee.Qs=z.height,ee.Sv=z.focus.x,ee.Tv=z.focus.y,z.We===null&&(z.We=new Bn),z.We.add(ee),z.sv=z.We.count-1}else break}for(z=x.edges.iterator;z.next();){var re=z.value;b=re.fromVertex,ee=re.toVertex,b.network===E&&ee.network===E?E.Bo(re):b.network===E?(re=b.Hj,re===null&&(re=new Bn,b.Hj=re),re.add(ee),b.Vd--,b.sh+=ee.sh):ee.network===E&&(re=ee.Hj,re===null&&(re=new Bn,ee.Hj=re),re.add(b),ee.Vd--,ee.sh+=b.sh)}for(b=E.edges.iterator;b.next();)z=b.value,z.length*=Math.max(1,Re.sqrt((z.fromVertex.sh+z.toVertex.sh)/(4*y+1)));for(y=E.vertexes.iterator;y.next();){b=y.value;var oe=b.Hj;if(oe!==null&&0<oe.count&&(ee=b.We.M(b.We.count-1).Rs-b.Vd,!(0>=ee))){for(var ue=re=0,he=oe.count-ee;he<oe.count;he++){var pe=oe.M(he),Se=null;for(z=pe.edges.iterator;z.next();){var Pe=z.value;if(Pe.Ax(pe)===b){Se=Pe;break}}Se!==null&&(ue+=Se.length,re+=pe.width*pe.height)}z=b.centerX,oe=b.centerY,he=b.width,pe=b.height,Se=b.focus,Pe=he*pe,1>Pe&&(Pe=1),re=Re.sqrt((re+Pe+ue*ue*4/(ee*ee))/Pe),ee=(re-1)*he/2,re=(re-1)*pe/2,b.bounds=new Gt(z-Se.x-ee,oe-Se.y-re,he+2*ee,pe+2*re),b.focus=new Ie(Se.x+ee,Se.y+re)}}return a.network=E,x}function IS(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,ee=b.Tv;E.bounds=new Gt(E.centerX-z,E.centerY-ee,b.Ss,b.Qs),E.focus=new Ie(z,ee),E.sv--}}for(x=a.network.edges.iterator;x.next();)x.value.network=y;a.network=y}function OS(a,y){var x=y.Hj;if(x!==null&&x.count!==0){var E=y.centerX,b=y.centerY,z=y.width,ee=y.height;y.We!==null&&0<y.We.count&&(ee=y.We.M(0),z=ee.Ss,ee=ee.Qs),z=Re.sqrt(z*z+ee*ee)/2;for(var re=!1,oe=ee=0,ue=0,he=y.vertexes.iterator;he.next();){var pe=he.value;1>=pe.Vd?oe++:(re=!0,ue++,ee+=Math.atan2(y.centerY-pe.centerY,y.centerX-pe.centerX))}if(oe!==0){for(0<ue&&(ee/=ue),ue=y=0,y=re?2*Math.PI/(oe+1):2*Math.PI/oe,oe%2===0&&(ue=y/2),1<x.count&&x.sort(function(Pe,Fe){return Pe===null||Fe===null||Pe===Fe?0:Fe.width*Fe.height-Pe.width*Pe.height}),re=oe%2===0?0:1,x=x.iterator;x.next();)if(oe=x.value,!(1<oe.Vd||a.isFixed(oe))){for(he=null,pe=oe.edges.iterator;pe.next();){he=pe.value;break}pe=oe.width;var Se=oe.height;pe=Re.sqrt(pe*pe+Se*Se)/2,he=z+he.length+pe,pe=ee+(y*(re/2>>1)+ue)*(re%2===0?1:-1),oe.centerX=E+he*Math.cos(pe),oe.centerY=b+he*Math.sin(pe),re++}}}}function jx(a,y,x,E,b,z,ee){var re=9e19,oe=-1,ue=0;e:for(;ue<y;ue++){var he=a[ue],pe=he.x-x,Se=he.y-E;if(pe=pe*pe+Se*Se,pe<re){for(Se=ue-1;0<=Se;Se--)if(a[Se].y>he.y&&a[Se].x-he.x<b+ee.width)continue e;for(Se=ue+1;Se<y;Se++)if(a[Se].x>he.x&&a[Se].y-he.y<z+ee.height)continue e;oe=ue,re=pe}}return oe}$s.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},$s.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 zx(a,y){var x=a.bounds,E=x.x;a=x.y;var b=x.width;x=x.height;var z=y.bounds,ee=z.x;y=z.y;var re=z.width;return z=z.height,E+b<ee?a>y+z?(x=E+b-ee,a=a-y-z,Re.sqrt(x*x+a*a)):a+x<y?(E=E+b-ee,a=a+x-y,Re.sqrt(E*E+a*a)):ee-(E+b):E>ee+re?a>y+z?(x=E-ee-re,a=a-y-z,Re.sqrt(x*x+a*a)):a+x<y?(E=E-ee-re,a=a+x-y,Re.sqrt(E*E+a*a)):E-(ee+re):a>y+z?a-(y+z):a+x<y?y-(a+x):.1}function Zx(a,y){for(a.ah=null,y=a.An+y;a.An<y&&(a.An++,RS(a)););a.ah=null}function RS(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,ee=1;ee<y.length;ee++){var re=y[ee];re.forceX=0,re.forceY=0;var oe=re.centerX;re=re.centerY,E=Math.min(E,oe),b=Math.max(b,oe),x=Math.min(x,re),z=Math.max(z,re)}(b=b-E>z-x)?y.sort(function(Ne,Xe){return Ne===null||Xe===null||Ne===Xe?0:Ne.centerX-Xe.centerX}):y.sort(function(Ne,Xe){return Ne===null||Xe===null||Ne===Xe?0:Ne.centerY-Xe.centerY}),x=a.Zf;var ue=E=re=0;for(z=0;z<y.length;z++){ee=y[z],E=ee.bounds,re=ee.focus,oe=E.x+re.x;var he=E.y+re.y;E=ee.charge*a.electricalFieldX(oe,he),ue=ee.charge*a.electricalFieldY(oe,he),E+=ee.mass*a.gravitationalFieldX(oe,he),ue+=ee.mass*a.gravitationalFieldY(oe,he),ee.forceX+=E,ee.forceY+=ue;for(var pe=z+1;pe<y.length;pe++){var Se=y[pe];if(Se!==ee){E=Se.bounds,re=Se.focus,ue=E.x+re.x;var Pe=E.y+re.y;if(oe-ue>x||ue-oe>x){if(b)break}else if(he-Pe>x||Pe-he>x){if(!b)break}else{var Fe=zx(ee,Se);1>Fe?(E=a.randomNumberGenerator,E===null&&(a.randomNumberGenerator=E=new K0),Fe=E.random(),re=E.random(),oe>ue?(E=Math.abs(Se.bounds.right-ee.bounds.x),E=(1+E)*Fe):oe<ue?(E=Math.abs(Se.bounds.x-ee.bounds.right),E=-(1+E)*Fe):(E=Math.max(Se.width,ee.width),E=(1+E)*Fe-E/2),he>Pe?(ue=Math.abs(Se.bounds.bottom-ee.bounds.y),ue=(1+ue)*re):oe<ue?(ue=Math.abs(Se.bounds.y-ee.bounds.bottom),ue=-(1+ue)*re):(ue=Math.max(Se.height,ee.height),ue=(1+ue)*re-ue/2)):(re=-(ee.charge*Se.charge)/(Fe*Fe),E=(ue-oe)/Fe*re,ue=(Pe-he)/Fe*re),ee.forceX+=E,ee.forceY+=ue,Se.forceX-=E,Se.forceY-=ue}}}}for(b=a.network.edges.iterator;b.next();)re=b.value,x=re.fromVertex,z=re.toVertex,ee=x.bounds,oe=x.focus,E=ee.x+oe.x,ee=ee.y+oe.y,he=z.bounds,pe=z.focus,oe=he.x+pe.x,he=he.y+pe.y,pe=zx(x,z),1>pe?(pe=a.randomNumberGenerator,pe===null&&(a.randomNumberGenerator=pe=new K0),re=pe.random(),pe=pe.random(),E=(E>oe?1:-1)*(1+(z.width>x.width?z.width:x.width))*re,ue=(ee>he?1:-1)*(1+(z.height>x.height?z.height:x.height))*pe):(re=re.stiffness*(pe-re.length),E=(oe-E)/pe*re,ue=(he-ee)/pe*re),x.forceX+=E,x.forceY+=ue,z.forceX-=E,z.forceY-=ue;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}$s.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},$s.prototype.moveFixedVertex=function(){},$s.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},$s.prototype.yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var y=a.value.link;y!==null&&(y.fromSpot=or,y.toSpot=or)}},$s.prototype.commitNodes=function(){var a=0,y=0;if(this.arrangesToOrigin){var x=Gt.alloc();this.computeBounds(this.network,x),y=this.arrangementOrigin,a=y.x-x.x,y=y.y-x.y,Gt.free(x)}x=Gt.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()}Gt.free(x)},$s.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},$s.prototype.springStiffness=function(a){return a=a.stiffness,isNaN(a)?this.Hk:a},$s.prototype.springLength=function(a){return a=a.length,isNaN(a)?this.Gk:a},$s.prototype.electricalCharge=function(a){return a=a.charge,isNaN(a)?this.Ek:a},$s.prototype.electricalFieldX=function(){return 0},$s.prototype.electricalFieldY=function(){return 0},$s.prototype.gravitationalMass=function(a){return a=a.mass,isNaN(a)?this.Fk:a},$s.prototype.gravitationalFieldX=function(){return 0},$s.prototype.gravitationalFieldY=function(){return 0},$s.prototype.isFixed=function(a){return a.isFixed},fn.Object.defineProperties($s.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"&&at('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())}}}),$s.className="ForceDirectedLayout";function Gx(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}Gx.className="ForceDirectedSubnet";function Mg(a){za.call(this,a)}_t(Mg,za),Mg.prototype.createVertex=function(){return new xm(this)},Mg.prototype.createEdge=function(){return new Sm(this)},Mg.className="ForceDirectedNetwork";function xm(a){bs.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}_t(xm,bs),fn.Object.defineProperties(xm.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)}}}),xm.className="ForceDirectedVertex";function Sm(a){iu.call(this,a),this.j=this.o=NaN}_t(Sm,iu),fn.Object.defineProperties(Sm.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)}}}),Sm.className="ForceDirectedEdge";function K0(){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()}K0.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},K0.className="RandomNumberGenerator";function wa(a){Va.call(this),this.kc=this.ie=25,this.K=0,this.Dk=Q0,this.Zk=$0,this.Qk=q0,this.bj=4,this.rk=ev,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 Ie,this.He=[],this.He.length=100,this.xw=this.ve=0,a&&Object.assign(this,a)}_t(wa,Va),wa.prototype.cloneProtected=function(a){Va.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},wa.prototype.qb=function(a){a.classType===wa?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:at("Unknown enum value: "+a):Va.prototype.qb.call(this,a)},wa.prototype.createNetwork=function(){return new Fp(this)},wa.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!==Pm&&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===Pm&&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 ee=0,re=0,oe=0,ue=0;if(E.link!==null){if(re=E.link,re===null)continue;var he=b.node;if(ee=z.node,he===null||ee===null)continue;var pe=re.fromNode;oe=re.toNode;for(var Se=re.fromPort;Se!==null&&!Se.Ed();)Se=Se.panel;for(re=re.toPort;re!==null&&!re.Ed();)re=re.panel;if(E.rev){ue=pe;var Pe=Se;pe=oe,Se=re,oe=ue,re=Pe}var Fe=b.focus;ue=z.focus;var Ne=E.rev?z.bounds:b.bounds;Pe=Ie.alloc(),he!==pe?Ne.w()&&pe.isVisible()?pe.actualBounds.w()?(nc(pe,Se,Kr,Pe),Pe.x+=pe.actualBounds.x-Ne.x,Pe.y+=pe.actualBounds.y-Ne.y):(nc(pe,Se,Kr,Pe),Pe.w()||Pe.assign(Fe)):Pe.assign(Fe):Ne.w()?(nc(pe,Se,Kr,Pe),Pe.w()||Pe.assign(Fe)):Pe.assign(Fe),pe=E.rev?b.bounds:z.bounds,he=Ie.alloc(),ee!==oe?pe.w()&&oe.isVisible()?oe.actualBounds.w()?(nc(oe,re,Kr,he),he.x+=oe.actualBounds.x-pe.x,he.y+=oe.actualBounds.y-pe.y):(nc(oe,re,Kr,he),he.w()||he.assign(ue)):he.assign(ue):pe.w()?(nc(oe,re,Kr,he),he.w()||he.assign(ue)):he.assign(ue),this.K===90||this.K===270?(ee=Math.round((Pe.x-Fe.x)/this.kc),oe=Pe.x,re=Math.round((he.x-ue.x)/this.kc),ue=he.x):(ee=Math.round((Pe.y-Fe.y)/this.kc),oe=Pe.y,re=Math.round((he.y-ue.y)/this.kc),ue=he.y),Ie.free(Pe),Ie.free(he),E.portFromColOffset=ee,E.portFromPos=oe,E.portToColOffset=re,E.portToPos=ue}else E.portFromColOffset=0,E.portFromPos=0,E.portToColOffset=0,E.portToPos=0;if(Pe=b.layer,he=z.layer,pe=0,Ne=E.link,Ne!==null){var Xe=Ne.fromPort,Ve=Ne.toPort;if(Xe!==null&&Ve!==null){var ht=Ne.fromNode;if(Se=Ne.toNode,ht!==null&&Se!==null){var ft=J0(this,!0),mt=J0(this,!1),Ct=this.setsPortSpots?ft:Ne.computeSpot(!0,Xe);Fe=this.setsPortSpots?mt:Ne.computeSpot(!1,Ve);var Kt=Ne.isOrthogonal;Ct.$c()&&Ct.Hf(mt)&&Fe.$c()&&Fe.Hf(ft)?pe=0:(ft=Ne.getLinkPoint(ht,Xe,Ct,!0,Kt,Se,Ve,Ie.alloc()),mt=Ne.getLinkDirection(ht,Xe,ft,Ct,!0,Kt,Se,Ve),Ie.free(ft),Ct.ys()||mt!==Qx(this,E,!0)?this.setsPortSpots&&ht!==null&&ht.ports.count===1&&E.rev&&(pe+=1):pe+=1,Ct=Ne.getLinkPoint(Se,Ve,Fe,!1,Kt,ht,Xe,Ie.alloc()),Ne=Ne.getLinkDirection(Se,Ve,Ct,Fe,!1,Kt,ht,Xe),Ie.free(Ct),Fe.ys()||Ne!==Qx(this,E,!1)?this.setsPortSpots&&Se!==null&&Se.ports.count===1&&E.rev&&(pe+=2):pe+=2)}}}if(Se=pe,pe=Se===1||Se===3,(Se=Se===2||Se===3)&&(Fe=a.createVertex(),Fe.node=null,Fe.Dj=1,Fe.layer=Pe,Fe.near=b,a.dh(Fe),b=a.Zj(b,Fe,E.link),b.valid=!1,b.rev=E.rev,b.portFromColOffset=ee,b.portToColOffset=0,b.portFromPos=oe,b.portToPos=0,b=Fe),Ne=1,pe&&Ne--,Pe-he>Ne&&0<Pe){for(E.valid=!1,Fe=a.createVertex(),Fe.node=null,Fe.Dj=2,Fe.layer=Pe-1,a.dh(Fe),b=a.Zj(b,Fe,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=Se?0:ee,b.portToColOffset=0,b.portFromPos=Se?0:oe,b.portToPos=0,b=Fe,Pe--;Pe-he>Ne&&0<Pe;)Fe=a.createVertex(),Fe.node=null,Fe.Dj=3,Fe.layer=Pe-1,a.dh(Fe),b=a.Zj(b,Fe,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=0,b.portFromPos=0,b.portToPos=0,b=Fe,Pe--;b=a.Zj(Fe,z,E.link),b.valid=!pe,pe&&(Fe.near=z),b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=re,b.portFromPos=0,b.portToPos=ue}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=$c(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),qc(this,a,y)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},wa.prototype.linkMinLength=function(){return 1};function Cy(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}wa.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},wa.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 _l(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 Eu(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 Wx(a,y,x){var E=$c(a,y),b=a.tc[y];(a.Jn===null||a.Jn.length<b*b)&&(a.Jn=[]);for(var z=a.Jn,ee=0;ee<b;ee++){var re=0,oe=E[ee],ue=oe.near;if(ue!==null&&ue.layer===oe.layer)if(oe=ue.index,oe>ee)for(var he=ee+1;he<oe;he++){var pe=E[he];pe.near===ue&&pe.Dj===ue.Dj||re++}else for(he=ee-1;he>oe;he--)pe=E[he],pe.near===ue&&pe.Dj===ue.Dj||re++;var Se;if(0<=x)for(oe=E[ee].sourceEdgesArrayAccess,ue=0;ue<oe.length;ue++){var Pe=oe[ue];if(Pe.valid&&Pe.fromVertex.layer!==y)for(pe=Pe.fromVertex.index,he=Pe.portToPos,Pe=Pe.portFromPos,Se=ue+1;Se<oe.length;Se++){var Fe=oe[Se];if(Fe.valid&&Fe.fromVertex.layer!==y){var Ne=Fe.fromVertex.index,Xe=Fe.portToPos;Fe=Fe.portFromPos,he<Xe&&(pe>Ne||pe===Ne&&Pe>Fe)&&re++,Xe<he&&(Ne>pe||Ne===pe&&Fe>Pe)&&re++}}}if(0>=x){for(oe=E[ee].destinationEdgesArrayAccess,ue=0;ue<oe.length;ue++)if(Pe=oe[ue],Pe.valid&&Pe.toVertex.layer!==y)for(pe=Pe.toVertex.index,he=Pe.portToPos,Pe=Pe.portFromPos,Se=ue+1;Se<oe.length;Se++)Fe=oe[Se],Fe.valid&&Fe.toVertex.layer!==y&&(Ne=Fe.toVertex.index,Xe=Fe.portToPos,Fe=Fe.portFromPos,Pe<Fe&&(pe>Ne||pe===Ne&&he>Xe)&&re++,Fe<Pe&&(Ne>pe||Ne===pe&&Xe>he)&&re++)}for(z[ee*b+ee]=re,oe=ee+1;oe<b;oe++){var Ve=0,ht=0;if(0<=x){re=E[ee].sourceEdgesArrayAccess;var ft=E[oe].sourceEdgesArrayAccess;for(ue=0;ue<re.length;ue++)if(Pe=re[ue],Pe.valid&&Pe.fromVertex.layer!==y)for(pe=Pe.fromVertex.index,Pe=Pe.portFromPos,Se=0;Se<ft.length;Se++)Fe=ft[Se],Fe.valid&&Fe.fromVertex.layer!==y&&(Ne=Fe.fromVertex.index,Fe=Fe.portFromPos,(pe<Ne||pe===Ne&&Pe<Fe)&&ht++,(Ne<pe||Ne===pe&&Fe<Pe)&&Ve++)}if(0>=x){for(re=E[ee].destinationEdgesArrayAccess,ft=E[oe].destinationEdgesArrayAccess,ue=0;ue<re.length;ue++)if(Pe=re[ue],Pe.valid&&Pe.toVertex.layer!==y)for(pe=Pe.toVertex.index,he=Pe.portToPos,Se=0;Se<ft.length;Se++)Fe=ft[Se],Fe.valid&&Fe.toVertex.layer!==y&&(Ne=Fe.toVertex.index,Xe=Fe.portToPos,(pe<Ne||pe===Ne&&he<Xe)&&ht++,(Ne<pe||Ne===pe&&Xe<he)&&Ve++)}z[ee*b+oe]=Ve,z[oe*b+ee]=ht}}return qc(a,y,E),z}wa.prototype.countCrossings=function(){for(var a=0,y=0;y<=this.Ia;y++)for(var x=Wx(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 U0(a){for(var y=0,x=0;x<=a.Ia;x++){for(var E=a,b=x,z=$c(E,b),ee=E.tc[b],re=0,oe=0;oe<ee;oe++){var ue=z[oe].destinationEdgesArrayAccess;if(ue!==null)for(var he=0;he<ue.length;he++){var pe=ue[he];if(pe.valid&&pe.toVertex.layer!==b){var Se=pe.fromVertex.column+pe.portFromColOffset,Pe=pe.toVertex.column+pe.portToColOffset;re+=(Math.abs(Se-Pe)+1)*Cy(pe)}}}qc(E,b,z),y+=re}return y}wa.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 by(a,y,x){for(var E=$c(a,y),b=a.tc[y],z=[],ee=0;ee<b;ee++){var re=E[ee],oe=null;0>=x&&(oe=re.sourceEdgesArrayAccess);var ue=null;0<=x&&(ue=re.destinationEdgesArrayAccess);var he=0,pe=0,Se=re.near;if(Se!==null&&Se.layer===re.layer&&(he+=Se.column-1,pe++),oe!==null)for(Se=0;Se<oe.length;Se++){re=oe[Se];var Pe=re.fromVertex;re.valid&&!re.rev&&Pe.layer!==y&&(he+=Pe.column,pe++)}if(ue!==null)for(oe=0;oe<ue.length;oe++)re=ue[oe],Se=re.toVertex,re.valid&&!re.rev&&Se.layer!==y&&(he+=Se.column,pe++);z[ee]=pe===0?-1:he/pe}return qc(a,y,E),z}function Hx(a,y,x){for(var E=$c(a,y),b=a.tc[y],z=[],ee=0;ee<b;ee++){var re=E[ee],oe=null;0>=x&&(oe=re.sourceEdgesArrayAccess);var ue=null;0<=x&&(ue=re.destinationEdgesArrayAccess);var he=0,pe=[],Se=re.near;if(Se!==null&&Se.layer===re.layer&&(pe[he]=Se.column-1,he++),re=void 0,oe!==null)for(Se=0;Se<oe.length;Se++){re=oe[Se];var Pe=re.fromVertex;re.valid&&!re.rev&&Pe.layer!==y&&(pe[he]=Pe.column+re.portFromColOffset,he++)}if(ue!==null)for(oe=0;oe<ue.length;oe++)re=ue[oe],Se=re.toVertex,re.valid&&!re.rev&&Se.layer!==y&&(pe[he]=Se.column+re.portToColOffset,he++);he===0?z[ee]=-1:(pe.sort(function(Fe,Ne){return Fe-Ne}),ue=he>>1,z[ee]=he&1?pe[ue]:pe[ue-1]+pe[ue]>>1)}return qc(a,y,E),z}function wm(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var ee=y.destinationEdges;ee.next();){var re=ee.value,oe=re.toVertex,ue=y.layer-oe.layer;re=a.linkMinLength(re),ue===re&&wm(a,oe,x,E,b,z)}if(z)for(ee=y.sourceEdges;ee.next();)re=ee.value,oe=re.fromVertex,ue=oe.layer-y.layer,re=a.linkMinLength(re),ue===re&&wm(a,oe,x,E,b,z)}}function Fy(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var ee=y.destinationEdges;ee.next();)Fy(a,ee.value.toVertex,x,E,b,z);if(z)for(y=y.sourceEdges;y.next();)Fy(a,y.value.fromVertex,x,E,b,z)}}wa.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Dk){default:case My: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(;jS(a)!==null;){for(b=Vx(a);b!==null;)E[x]=b,x--,b.valid=!1,b=Vx(a);for(b=Kx(a);b!==null;)E[y]=b,y++,b.valid=!1,b=Kx(a);b=null;for(var z=0,ee=this.network.vertexes.iterator;ee.next();){var re=ee.value;if(re.valid){for(var oe=0,ue=re.destinationEdges;ue.next();)ue.value.toVertex.valid&&oe++;ue=0;for(var he=re.sourceEdges;he.next();)he.value.fromVertex.valid&&ue++;(b===null||z<oe-ue)&&(b=re,z=oe-ue)}}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 Q0: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&&Ly(this,y);for(E.reset();E.next();)y=E.value,y.Ll===-1&&Ly(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 Pm: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 jS(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid)return y}return null}function Vx(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 Kx(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 Ly(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,Ly(a,b))}y.finish=a.Kn,a.Kn++}wa.prototype.assignLayers=function(){switch(this.Zk){case ky:Ux(this);break;case Ay:for(var a,y=this.network.vertexes.iterator;y.next();)a=Xx(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 $0:for(Ux(this),y=this.network.vertexes.iterator;y.next();)y.value.valid=!1;for(y.reset();y.next();)a=y.value,a.sourceEdges.count===0&&Jx(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 Ux(a){for(var y=a.network.vertexes.iterator;y.next();){var x=Yx(a,y.value);a.Ia=Math.max(x,a.Ia)}}function Yx(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,Yx(a,z)+b)}y.layer=x}else x=y.layer;return x}function Xx(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,Xx(a,z)+b)}y.layer=x}else x=y.layer;return x}function Jx(a,y){if(!y.valid){y.valid=!0;for(var x=y.destinationEdges;x.next();)Jx(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 ee=E[z],re=ee.fromVertex,oe=ee.toVertex;ee=a.linkMinLength(ee),re.layer-oe.layer>ee&&wm(a,re,0,-1,!0,!1)}for(wm(a,y,1,-1,!0,!0);y.component!==0;){for(z=0,E=1/0,re=0,oe=null,ee=a.network.vertexes.iterator;ee.next();){var ue=ee.value;if(ue.component===1){var he=0,pe=!1,Se=ue.sourceEdgesArrayAccess;b=Se.length;for(var Pe=0;Pe<b;Pe++){var Fe=Se[Pe],Ne=Fe.fromVertex;he+=1,Ne.component!==1&&(z+=1,Ne=Ne.layer-ue.layer,Fe=a.linkMinLength(Fe),E=Math.min(E,Ne-Fe))}for(Se=ue.destinationEdgesArrayAccess,b=Se.length,Pe=0;Pe<b;Pe++)Fe=Se[Pe].toVertex,--he,Fe.component!==1?--z:pe=!0;(oe===null||he<re)&&!pe&&(oe=ue,re=he)}}if(0<z){for(x.reset();x.next();)b=x.value,b.component===1&&(b.layer+=E);y.component=0}else oe.component=0}for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(wm(a,y,1,-1,!0,!1);y.component!==0;){for(E=0,b=1/0,z=0,re=null,oe=a.network.vertexes.iterator;oe.next();)if(ee=oe.value,ee.component===1){for(ue=0,he=!1,Se=ee.sourceEdgesArrayAccess,pe=Se.length,Pe=0;Pe<pe;Pe++)Fe=Se[Pe].fromVertex,ue+=1,Fe.component!==1?E+=1:he=!0;for(Se=ee.destinationEdgesArrayAccess,pe=Se.length,Pe=0;Pe<pe;Pe++)Fe=Se[Pe],Ne=Fe.toVertex,--ue,Ne.component!==1&&(--E,Ne=ee.layer-Ne.layer,Fe=a.linkMinLength(Fe),b=Math.min(b,Ne-Fe));(re===null||ue>z)&&!he&&(re=ee,z=ue)}if(0>E){for(x.reset();x.next();)E=x.value,E.component===1&&(E.layer-=b);y.component=0}else re.component=0}}}function Qx(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}wa.prototype.initializeIndices=function(){switch(this.Qk){default:case Dy: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 q0: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&&$x(this,x);break;case Ny: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&&qx(this,x)}};function $x(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&&$x(a,E))}function qx(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&&qx(a,E))}wa.prototype.reduceCrossings=function(){var a=this.countCrossings(),y=_l(this),x,E;for(x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)Y0(this,E,1),_u(this,E,1);var b=this.countCrossings();for(b<a&&(a=b,y=_l(this)),E=this.Ia;0<=E;E--)Y0(this,E,-1),_u(this,E,-1);b=this.countCrossings(),b<a&&(a=b,y=_l(this))}for(Eu(this,y),x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)Y0(this,E,0),_u(this,E,0);for(b=this.countCrossings(),b<a&&(a=b,y=_l(this)),E=this.Ia;0<=E;E--)Y0(this,E,0),_u(this,E,0);b=this.countCrossings(),b<a&&(a=b,y=_l(this))}Eu(this,y);var z,ee,re;switch(this.rk){case Ty:break;case _y:for(re=a+1;(E=this.countCrossings())<re;)for(re=E,x=this.Ia;0<=x;x--)for(ee=0;ee<=x;ee++){for(z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=_u(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Eu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=_u(this,E,1)||z;for(b=this.countCrossings(),b>=a?Eu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=_u(this,E,1)||z;for(b>=a?Eu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=_u(this,E,-1)||z;for(b>=a?Eu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=_u(this,E,0)||z;for(b>=a?Eu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=_u(this,E,0)||z;b>=a?Eu(this,y):(a=b,y=_l(this))}break;default:case ev:for(x=this.Ia,ee=0,re=a+1;(E=this.countCrossings())<re;){for(re=E,z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=_u(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Eu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=_u(this,E,1)||z;for(b=this.countCrossings(),b>=a?Eu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=_u(this,E,1)||z;for(b>=a?Eu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=_u(this,E,-1)||z;for(b>=a?Eu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=_u(this,E,0)||z;for(b>=a?Eu(this,y):(a=b,y=_l(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=_u(this,E,0)||z;b>=a?Eu(this,y):(a=b,y=_l(this))}}Eu(this,y)};function Y0(a,y,x){var E=$c(a,y),b=a.tc[y],z=Hx(a,y,x),ee=by(a,y,x);for(x=0;x<b;x++)ee[x]===-1&&(ee[x]=E[x].column),z[x]===-1&&(z[x]=E[x].column);for(var re=!0,oe;re;)for(re=!1,x=0;x<b-1;x++)(z[x+1]<z[x]||z[x+1]===z[x]&&ee[x+1]<ee[x])&&(re=!0,oe=z[x],z[x]=z[x+1],z[x+1]=oe,oe=ee[x],ee[x]=ee[x+1],ee[x+1]=oe,oe=E[x],E[x]=E[x+1],E[x+1]=oe);for(x=z=0;x<b;x++)oe=E[x],oe.index=x,z+=a.nodeMinColumnSpace(oe,!0),oe.column=z,z+=1,z+=a.nodeMinColumnSpace(oe,!1);qc(a,y,E)}function _u(a,y,x){var E=$c(a,y),b=a.tc[y];x=Wx(a,y,x);var z,ee=[];for(z=0;z<b;z++)ee[z]=-1;var re=[];for(z=0;z<b;z++)re[z]=-1;for(var oe=!1,ue=!0;ue;)for(ue=!1,z=0;z<b-1;z++){var he=x[E[z].index*b+E[z+1].index],pe=x[E[z+1].index*b+E[z].index],Se=0,Pe=0,Fe=E[z].column,Ne=E[z+1].column,Xe=a.nodeMinColumnSpace(E[z],!0),Ve=a.nodeMinColumnSpace(E[z],!1),ht=a.nodeMinColumnSpace(E[z+1],!0),ft=a.nodeMinColumnSpace(E[z+1],!1);Xe=Fe-Xe+ht,Ve=Ne-Ve+ft;var mt=E[z].sourceEdges.iterator;for(mt.reset();mt.next();)if(ht=mt.value,ft=ht.fromVertex,ht.valid&&ft.layer===y){for(ht=0;E[ht]!==ft;)ht++;ht<z&&(Se+=2*(z-ht),Pe+=2*(z+1-ht)),ht===z+1&&(Se+=1),ht>z+1&&(Se+=4*(ht-z),Pe+=4*(ht-(z+1)))}for(mt=E[z].destinationEdges.iterator,mt.reset();mt.next();)if(ht=mt.value,ft=ht.toVertex,ht.valid&&ft.layer===y){for(ht=0;E[ht]!==ft;)ht++;ht===z+1&&(Pe+=1)}for(mt=E[z+1].sourceEdges.iterator,mt.reset();mt.next();)if(ht=mt.value,ft=ht.fromVertex,ht.valid&&ft.layer===y){for(ht=0;E[ht]!==ft;)ht++;ht<z&&(Se+=2*(z+1-ht),Pe+=2*(z-ht)),ht===z&&(Pe+=1),ht>z+1&&(Se+=4*(ht-(z+1)),Pe+=4*(ht-z))}for(mt=E[z+1].destinationEdges.iterator,mt.reset();mt.next();)if(ht=mt.value,ft=ht.toVertex,ht.valid&&ft.layer===y){for(ht=0;E[ht]!==ft;)ht++;ht===z&&(Se+=1)}ht=ft=0,mt=ee[E[z].index];var Ct=re[E[z].index],Kt=ee[E[z+1].index],yi=re[E[z+1].index];mt!==-1&&(ft+=Math.abs(mt-Fe),ht+=Math.abs(mt-Ve)),Ct!==-1&&(ft+=Math.abs(Ct-Fe),ht+=Math.abs(Ct-Ve)),Kt!==-1&&(ft+=Math.abs(Kt-Ne),ht+=Math.abs(Kt-Xe)),yi!==-1&&(ft+=Math.abs(yi-Ne),ht+=Math.abs(yi-Xe)),(Pe<Se-.5||Pe===Se&&pe<he-.5||Pe===Se&&pe===he&&ht<ft-.5)&&(ue=oe=!0,E[z].column=Ve,E[z+1].column=Xe,he=E[z],E[z]=E[z+1],E[z+1]=he)}for(z=0;z<b;z++)E[z].index=z;return qc(a,y,E),oe}wa.prototype.straightenAndPack=function(){if(this.ve===0){var a=(this.bg&1)!==0,y=(this.bg&US)!==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=bp(this,y,1)||x;for(y=this.Md-1;0<=y;y--)x=bp(this,y,-1)||x;x=bp(this,this.Md,0)||x}if(this.bg&4){for(y=this.Md+1;y<=this.Ia;y++)By(this,y,1);for(y=this.Md-1;0<=y;y--)By(this,y,-1);By(this,this.Md,0)}if(a&&(eS(this,-1),eS(this,1)),this.bg&2)for(x=!0;x;){for(x=!1,x=bp(this,this.Md,0)||x,y=this.Md+1;y<=this.Ia;y++)x=bp(this,y,0)||x;for(y=this.Md-1;0<=y;y--)x=bp(this,y,0)||x}}else WS(this)};function bp(a,y,x){for(var E=!1;zS(a,y,x);)E=!0;return E}function zS(a,y,x){var E,b=$c(a,y),z=a.tc[y],ee=by(a,y,-1);if(0<x)for(E=0;E<z;E++)ee[E]=-1;var re=by(a,y,1);if(0>x)for(E=0;E<z;E++)re[E]=-1;for(var oe=!1,ue=!0;ue;)for(ue=!1,E=0;E<z;E++){var he=b[E].column,pe=a.nodeMinColumnSpace(b[E],!0),Se=a.nodeMinColumnSpace(b[E],!1),Pe=0;0>E-1||he-b[E-1].column-1>pe+a.nodeMinColumnSpace(b[E-1],!1)?Pe=he-1:Pe=he,pe=E+1>=z||b[E+1].column-he-1>Se+a.nodeMinColumnSpace(b[E+1],!0)?he+1:he;var Fe=Se=0,Ne=0;if(0>=x)for(var Xe=b[E].sourceEdges.iterator;Xe.next();){var Ve=Xe.value,ht=Ve.fromVertex;if(Ve.valid&&ht.layer!==y){var ft=Cy(Ve),mt=Ve.portFromColOffset;Ve=Ve.portToColOffset,ht=ht.column,Se+=(Math.abs(he+Ve-(ht+mt))+1)*ft,Fe+=(Math.abs(Pe+Ve-(ht+mt))+1)*ft,Ne+=(Math.abs(pe+Ve-(ht+mt))+1)*ft}}if(0<=x)for(Xe=b[E].destinationEdges.iterator;Xe.next();)Ve=Xe.value,ht=Ve.toVertex,Ve.valid&&ht.layer!==y&&(ft=Cy(Ve),mt=Ve.portFromColOffset,Ve=Ve.portToColOffset,ht=ht.column,Se+=(Math.abs(he+mt-(ht+Ve))+1)*ft,Fe+=(Math.abs(Pe+mt-(ht+Ve))+1)*ft,Ne+=(Math.abs(pe+mt-(ht+Ve))+1)*ft);Ve=mt=ft=0,Xe=ee[b[E].index],ht=re[b[E].index],Xe!==-1&&(ft+=Math.abs(Xe-he),mt+=Math.abs(Xe-Pe),Ve+=Math.abs(Xe-pe)),ht!==-1&&(ft+=Math.abs(ht-he),mt+=Math.abs(ht-Pe),Ve+=Math.abs(ht-pe)),Fe<Se||Fe===Se&&mt<ft?(ue=oe=!0,b[E].column=Pe):(Ne<Se||Ne===Se&&Ve<ft)&&(ue=oe=!0,b[E].column=pe)}return qc(a,y,b),a.normalize(),oe}function By(a,y,x){var E=$c(a,y),b=a.tc[y],z=Hx(a,y,x),ee=[];for(x=0;x<b;x++)ee[x]=z[x];for(z=!0;z;)for(z=!1,x=0;x<b;x++){var re=E[x].column,oe=a.nodeMinColumnSpace(E[x],!0),ue=a.nodeMinColumnSpace(E[x],!1),he=0;if(ee[x]===-1)if(x===0&&x===b-1)he=re;else if(x===0){var pe=E[x+1].column;pe-re===ue+a.nodeMinColumnSpace(E[x+1],!0)?he=re-1:he=re}else x===b-1?(pe=E[x-1].column,he=re-pe===oe+a.nodeMinColumnSpace(E[x-1],!1)?re+1:re):(pe=E[x-1].column,oe=pe+a.nodeMinColumnSpace(E[x-1],!1)+oe+1,pe=E[x+1].column,ue=pe-a.nodeMinColumnSpace(E[x+1],!0)-ue-1,he=(oe+ue)/2|0);else x===0&&x===b-1?he=ee[x]:x===0?(pe=E[x+1].column,ue=pe-a.nodeMinColumnSpace(E[x+1],!0)-ue-1,he=Math.min(ee[x],ue)):x===b-1?(pe=E[x-1].column,oe=pe+a.nodeMinColumnSpace(E[x-1],!1)+oe+1,he=Math.max(ee[x],oe)):(pe=E[x-1].column,oe=pe+a.nodeMinColumnSpace(E[x-1],!1)+oe+1,pe=E[x+1].column,ue=pe-a.nodeMinColumnSpace(E[x+1],!0)-ue-1,oe<ee[x]&&ee[x]<ue?he=ee[x]:oe>=ee[x]?he=oe:ue<=ee[x]&&(he=ue));he!==re&&(z=!0,E[x].column=he)}qc(a,y,E),a.normalize()}function ZS(a,y){for(var x=!0,E=a.network.vertexes.iterator;E.next();){var b=E.value,z=a.nodeMinColumnSpace(b,!0),ee=a.nodeMinColumnSpace(b,!1);if(b.column-z<=y&&b.column+ee>=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 GS(a,y){var x=y+1,E,b=[],z=[];for(E=0;E<=a.Ia;E++)b[E]=!1,z[E]=!1;for(var ee=a.network.vertexes.iterator;ee.next();){E=ee.value;var re=E.column-a.nodeMinColumnSpace(E,!0),oe=E.column+a.nodeMinColumnSpace(E,!1);re<=y&&oe>=y&&(b[E.layer]=!0),re<=x&&oe>=x&&(z[E.layer]=!0)}for(re=!0,x=!1,E=0;E<=a.Ia;E++)re=re&&!(b[E]&&z[E]);if(re)for(ee.reset();ee.next();)a=ee.value,a.column>y&&(--a.column,x=!0);return x}function eS(a,y){for(var x=0;x<=a.Ra;x++)for(;ZS(a,x););for(a.normalize(),x=0;x<a.Ra;x++)for(;GS(a,x););a.normalize();var E;if(0<y)for(x=0;x<=a.Ra;x++){var b=_l(a),z=U0(a);for(E=z+1;z<E;){E=z,tS(a,x,1);var ee=U0(a);ee>z?Eu(a,b):ee<z&&(z=ee,b=_l(a))}}if(0>y)for(x=a.Ra;0<=x;x--)for(b=_l(a),z=U0(a),E=z+1;z<E;)E=z,tS(a,x,-1),ee=U0(a),ee>z?Eu(a,b):ee<z&&(z=ee,b=_l(a));a.normalize()}function tS(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&&(Fy(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 ee=z.layer,re=Math.max(0,z.column-a.nodeMinColumnSpace(z,!0)),oe=Math.min(a.Ra,z.column+a.nodeMinColumnSpace(z,!1));re<=oe;re++)b[ee*(a.Ra+1)+re]=z.component}for(z=0;z<=a.Ia;z++){if(0<x)for(ee=0;ee<a.Ra;ee++)b[z*(a.Ra+1)+ee]!==-1&&b[z*(a.Ra+1)+ee+1]!==-1&&b[z*(a.Ra+1)+ee]!==b[z*(a.Ra+1)+ee+1]&&(y[b[z*(a.Ra+1)+ee]*a.le+b[z*(a.Ra+1)+ee+1]]=!0);if(0>x)for(ee=a.Ra;0<ee;ee--)b[z*(a.Ra+1)+ee]!==-1&&b[z*(a.Ra+1)+ee-1]!==-1&&b[z*(a.Ra+1)+ee]!==b[z*(a.Ra+1)+ee-1]&&(y[b[z*(a.Ra+1)+ee]*a.le+b[z*(a.Ra+1)+ee-1]]=!0)}for(b=[],z=0;z<a.le;z++)b[z]=!0;for(ee=[],ee.push(0);ee.length!==0;)if(oe=ee[ee.length-1],ee.pop(),b[oe])for(b[oe]=!1,z=0;z<a.le;z++)y[oe*a.le+z]&&ee.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 WS(a){for(var y=xi(),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 In,HS(y,x);var z=null,ee=null,re=null,oe=null,ue=(a.ve&1)!==0,he=(a.ve&2)!==0,pe=(a.ve&4)!==0,Se=(a.ve&8)!==0;for(ue&&(a.verticalAlignment(y,x,!0),z=X0(a,y,!0,!1)),y.reverse(),pe&&(a.verticalAlignment(y,x,!1),re=X0(a,y,!1,!1)),E=fi(y),b=E.next();!b.done;b=E.next())b.value.reverse();Se&&(a.verticalAlignment(y,x,!1),oe=X0(a,y,!1,!0)),y.reverse(),he&&(a.verticalAlignment(y,x,!0),ee=X0(a,y,!0,!0)),Bi(y),a.u(z,ee,re,oe),a.network.vertexes.each(function(Pe){var Fe=xi();ue&&Fe.push(z.get(Pe)),he&&Fe.push(ee.get(Pe)),pe&&Fe.push(re.get(Pe)),Se&&Fe.push(oe.get(Pe)),Fe.sort(function(Xe,Ve){return Xe-Ve});var Ne=Fe.length;Ne=(Fe[Math.floor((Ne-1)/2)]+Fe[Math.ceil((Ne-1)/2)])/2,Bi(Fe),Pe.zc=Ne})}function HS(a,y){for(var x=a.length,E=1;E<x-1;E++)for(var b=0,z=0,ee=a[E],re=a[E+1],oe=0;z<re.length;oe++){var ue=re[oe];e:{if(ue.node===null){var he=Iy(ue);if(0<he.length){he=he[0].node===null;break e}}he=!1}var pe=he;if(oe===re.length-1||pe){for(he=ee.length-1,pe&&(he=Iy(ue)[0].index);z<=oe;){if(ue=re[z],!ue.bo){pe=[];for(var Se=fi(ue.sourceEdgesArrayAccess),Pe=Se.next();!Pe.done;Pe=Se.next())Pe=Pe.value,Pe.valid&&pe.push(Pe);ue.bo=pe}for(ue=fi(ue.bo),pe=ue.next();!pe.done;pe=ue.next())pe=pe.value,Se=pe.fromVertex.index,(Se<b||Se>he)&&y.add(pe);z++}b=he}}}wa.prototype.verticalAlignment=function(a,y,x){VS(a),a=fi(a);for(var E=a.next();!E.done;E=a.next()){var b=-1;E=fi(E.value);for(var z=E.next();!z.done;z=E.next()){z=z.value;var ee=x?Iy(z):YS(z),re=ee.length;if(0<re){ee.sort(function(pe,Se){return pe.vi-Se.vi});var oe=(re-1)/2;for(re=Math.floor(oe),oe=Math.ceil(oe);re<=oe;re++)if(z.align===z){var ue=ee[re],he=void 0;he=x?tv(ue,z):tv(z,ue),!y.contains(he)&&b<ue.vi&&(ue.align=z,z.root=ue.root,z.align=ue.root,b=ue.vi)}}}}};function VS(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 X0(a,y,x,E){for(var b=a.K===90||a.K===270,z=fi(y),ee=z.next();!ee.done;ee=z.next()){var re=fi(ee.value);for(ee=re.next();!ee.done;ee=re.next())ee=ee.value,ee.sd=ee,ee.shift=1/0,ee.zc=NaN,ee.qg=0}for(ee=a.K===90||a.K===270,z=fi(y),re=z.next();!re.done;re=z.next()){re=fi(re.value);for(var oe=re.next();!oe.done;oe=re.next())if(oe=oe.value,oe.root===oe){for(var ue=0,he=oe;he.align!==oe;){var pe=he.align,Se=ee?he.width:he.height,Pe=ee?pe.width:pe.height;if(x){var Fe=tv(he,pe),Ne=Fe.portFromPos,Xe=Fe.portToPos;Fe.link!==null&&(he.node&&he.node!==Fe.link.fromNode&&(Ne=ee?he.focusX:he.focusY),pe.node&&pe.node!==Fe.link.toNode&&(Xe=ee?pe.focusX:pe.focusY))}else Fe=tv(pe,he),Ne=Fe.portToPos,Xe=Fe.portFromPos,Fe.link!==null&&(he.node&&he.node!==Fe.link.toNode&&(Ne=ee?he.focusX:he.focusY),pe.node&&pe.node!==Fe.link.fromNode&&(Xe=ee?pe.focusX:pe.focusY));Se=E?he.qg+(Se-Ne)-(Pe-Xe):he.qg+Ne-Xe,pe.qg=Se,ue=Math.min(ue,Se),he=he.align}he=oe;do he.qg=he.qg-ue,he=he.align;while(he!==oe)}}for(x=fi(y),ee=x.next();!ee.done;ee=x.next())for(z=fi(ee.value),ee=z.next();!ee.done;ee=z.next())ee=ee.value,ee.root===ee&&nS(a,ee,y);for(x=0;x<y.length;x++)if(!(0>=y[x].length)&&(ee=y[x][0],ee.sd===ee)){ee.sd.shift===1/0&&(ee.sd.shift=0),ee=x,re=0;do{for(z=y[ee][re];z.align!==z.root;)z=z.align,ee++,0<z.vi&&(re=iS(z,y),re.sd.shift=Math.min(re.sd.shift,z.sd.shift+z.zc+z.qg-(re.zc+re.qg+(b?re.width:re.height)+a.columnSpacing)));re=z.vi+1}while(ee<y.length&&re<y[ee].length&&z.sd===y[ee][re].sd)}for(a=new Rt,y=fi(y),ee=y.next();!ee.done;ee=y.next())for(x=fi(ee.value),ee=x.next();!ee.done;ee=x.next())ee=ee.value,ee.zc=ee.zc+ee.sd.shift+ee.qg,z=b?ee.width:ee.height,a.add(ee,E?-ee.zc-z:ee.zc);return a}function nS(a,y,x){if(isNaN(y.zc)){y.zc=0;var E=y;do{if(0<E.vi){var b=iS(E,x),z=b.root;nS(a,z,x),y.sd===y&&(y.sd=z.sd);var ee=a.K===90||a.K===270?b.width:b.height;y.sd===z.sd&&(y.zc=Math.max(y.zc,z.zc+b.qg+ee-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 iS(a,y){var x=a.Tz;return a=a.vi,1>a&&at("Could not determine previous vertex in layer"),y[x][a-1]}wa.prototype.u=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];x=-1;for(var E=xi(),b=xi(),z=1/0,ee=0;4>ee;ee++)if(y[ee]){var re=KS(this,y[ee],E,b,ee);re<z&&(x=ee,z=re)}for(z={},ee=0;4>ee;z={delta:z.delta},ee++)y[ee]&&(z.delta=ee===0||ee===2?E[x]-E[ee]:b[x]-b[ee],z.delta!==0&&y[ee].each(function(oe){return function(ue){ue.value+=oe.delta}}(z)));Bi(E),Bi(b)};function KS(a,y,x,E,b){if(!y||y.count===0)return x[b]=0,E[b]=0,1/0;var z=1/0,ee=-1/0;return y.each(function(re){var oe=re.key;re=re.value,oe=a.K===90||a.K===270?oe.width:oe.height,re<z&&(z=re),re+oe>ee&&(ee=re+oe)}),x[b]=z,E[b]=ee,ee-z}wa.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=J0(this,!0),y=J0(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 J0(a,y){return a.K===270?y?Oo:Ir:a.K===90?y?Ir:Oo:a.K===180?y?pa:Lo:y?Lo:pa}wa.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,ee=b=1/0,re=-1/0;a.next();){var oe=a.value,ue=oe.layer,he=oe.column|0;E?(ee=y.x+this.kc*he,ue=this.Kd[ue]):(ee=this.Kd[ue],ue=y.y+this.kc*he),oe.centerX=ee,oe.centerY=ue,x&&isFinite(oe.zc)&&(E?oe.node?oe.x=y.x+oe.zc:oe.centerX=y.x+oe.zc:oe.node?oe.y=y.y+oe.zc:oe.centerY=y.y+oe.zc),z=Math.min(oe.x,z),b=Math.min(oe.y,b),E?(ee=z,re=Math.max(re,oe.bounds.right)):(ee=b,re=Math.max(re,oe.bounds.bottom))}for(this.xw=re-ee,z=y.x-z,y=y.y-b,this.Rf=new Ie(x&&E?0:z,x&&!E?0:y),a.reset();a.next();)x=a.value,x.x+=z,x.y+=y,x.commit()},wa.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 Gt(0,0,x,Math.abs(this.Ta[0]))):y.push(new Gt(0,this.Ta[E-1],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===90?E===0?y.push(new Gt(0,this.Ta[0],x,Math.abs(this.Ta[0]-a))):y.push(new Gt(0,this.Ta[E],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===180?E===0?y.push(new Gt(0,0,Math.abs(this.Ta[0]),x)):y.push(new Gt(this.Ta[E-1],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x)):E===0?y.push(new Gt(this.Ta[0],0,Math.abs(this.Ta[0]-a),x)):y.push(new Gt(this.Ta[E],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x));this.commitLayers(y,this.Rf)},wa.prototype.commitLayers=function(){},wa.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,ee=E.fromPort,re=E.toPort;if(b!==null){var oe=b.findVisibleNode();oe!==null&&oe!==b&&(b=oe,ee=oe.port)}z!==null&&(oe=z.findVisibleNode(),oe!==null&&oe!==z&&(z=oe,re=oe.port));var ue=y.computeSpot(!0,ee);oe=y.computeSpot(!1,re);var he=x.fromVertex,pe=x.toVertex;if(x.valid)y.curve===fu&&y.pointsCount===4&&(he.column===pe.column&&this.alignOption===0?(x=y.getLinkPoint(b,ee,ue,!0,!1,z,re),re=y.getLinkPoint(z,re,oe,!1,!1,b,ee),x.w()||x.set(b.actualBounds.center),re.w()||re.set(z.actualBounds.center),y.Fj(),y.yf(x.x,x.y),y.yf((2*x.x+re.x)/3,(2*x.y+re.y)/3),y.yf((x.x+2*re.x)/3,(x.y+2*re.y)/3),y.yf(re.x,re.y)):(x=E=!1,ee!==null&&ue===Xr&&(E=!0),re!==null&&oe===Xr&&(x=!0),(E||x)&&(oe=null,E&&(oe=y.getLinkPointFromPoint(b,ee,ee.ga(Kr),y.i(3),!0),oe.w()||oe.set(b.actualBounds.center),y.L(0,oe.x,oe.y)),b=null,x&&(b=y.getLinkPointFromPoint(z,re,re.ga(Kr),y.i(0),!1),b.w()||b.set(z.actualBounds.center),y.L(3,b.x,b.y)),oe&&(z=y.i(2),y.L(1,(2*oe.x+z.x)/3,(2*oe.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(he.layer===pe.layer)y.zf();else{var Se=!1,Pe=!1,Fe=this.ie,Ne=y.firstPickIndex+1;if(y.isOrthogonal){Pe=!0;var Xe=y.pointsCount;4<Xe&&y.points.removeRange(2,Xe-3)}else if(y.curve===fu)Se=!0,Xe=y.pointsCount,4<Xe&&y.points.removeRange(2,Xe-3),Xe===4&&(Ne=2);else{Xe=y.pointsCount;var Ve=ue===Xr,ht=oe===Xr;2<Xe&&Ve&&ht?y.points.removeRange(1,Xe-2):3<Xe&&Ve&&!ht?y.points.removeRange(1,Xe-3):3<Xe&&!Ve&&ht?y.points.removeRange(2,Xe-2):4<Xe&&!Ve&&!ht&&y.points.removeRange(2,Xe-3)}if(x.rev){for(;pe!==null&&he!==pe;){var ft=Xe=null;for(Ve=pe.sourceEdges.iterator;Ve.next()&&(ht=Ve.value,ht.link!==x.link||(Xe=ht.fromVertex,ft=ht.toVertex,Xe.node!==null)););if(Xe===null)break;if(Xe!==he){Ve=y.i(Ne-1).x,ht=y.i(Ne-1).y;var mt=Xe.centerX,Ct=Xe.centerY;if(Pe)this.K===180||this.K===0?Ne===y.firstPickIndex+1?(y.m(Ne++,Ve,ht),y.m(Ne++,Ve,Ct)):(ft!==null?ft.centerY:ht)!==Ct&&(ft=this.Ta[Xe.layer-1]+this.Rf.x,y.m(Ne++,ft,ht),y.m(Ne++,ft,Ct)):Ne===y.firstPickIndex+1?(y.m(Ne++,Ve,ht),y.m(Ne++,mt,ht)):(ft!==null?ft.centerX:Ve)!==mt&&(ft=this.Ta[Xe.layer-1]+this.Rf.y,y.m(Ne++,Ve,ft),y.m(Ne++,mt,ft));else if(Ne===y.firstPickIndex+1){ft=Math.max(10,this.he[pe.layer]);var Kt=Math.max(10,this.Ld[pe.layer]);if(Se)this.K===180?mt<=pe.bounds.x?(pe=pe.bounds.x,y.m(Ne++,pe-ft,Ct),y.m(Ne++,pe,Ct),y.m(Ne++,pe+Kt,Ct)):(y.m(Ne++,mt-ft,Ct),y.m(Ne++,mt,Ct),y.m(Ne++,mt+Kt,Ct)):this.K===90?Ct>=pe.bounds.bottom?(pe=pe.bounds.y+pe.bounds.height,y.m(Ne++,mt,pe+Kt),y.m(Ne++,mt,pe),y.m(Ne++,mt,pe-ft)):(y.m(Ne++,mt,Ct+Kt),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Ct-ft)):this.K===270?Ct<=pe.bounds.y?(pe=pe.bounds.y,y.m(Ne++,mt,pe-ft),y.m(Ne++,mt,pe),y.m(Ne++,mt,pe+Kt)):(y.m(Ne++,mt,Ct-ft),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Ct+Kt)):this.K===0&&(mt>=pe.bounds.right?(pe=pe.bounds.x+pe.bounds.width,y.m(Ne++,pe+Kt,Ct),y.m(Ne++,pe,Ct),y.m(Ne++,pe-ft,Ct)):(y.m(Ne++,mt+Kt,Ct),y.m(Ne++,mt,Ct),y.m(Ne++,mt-ft,Ct)));else{y.m(Ne++,Ve,ht);var yi=0;this.K===180||this.K===0?((this.K===180?mt>=pe.bounds.right:mt<=pe.bounds.x)&&(yi=(this.K===0?-ft:Kt)/2),y.m(Ne++,Ve+yi,Ct)):((this.K===270?Ct>=pe.bounds.bottom:Ct<=pe.bounds.y)&&(yi=(this.K===90?-ft:Kt)/2),y.m(Ne++,mt,ht+yi)),y.m(Ne++,mt,Ct)}}else ft=Math.max(10,this.he[Xe.layer]),Kt=Math.max(10,this.Ld[Xe.layer]),Se?this.K===180?(y.m(Ne++,mt-ft-Fe,Ct),y.m(Ne++,Math.min(mt-ft+Fe/2,mt),Ct),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Ct),y.m(Ne++,Math.max(mt+Kt-Fe/2,mt),Ct),y.m(Ne++,mt+Kt+Fe,Ct)):this.K===90?(y.m(Ne++,mt,Ct+Kt+Fe),y.m(Ne++,mt,Math.max(Ct+Kt-Fe/2,Ct)),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Math.min(Ct-ft+Fe/2,Ct)),y.m(Ne++,mt,Ct-ft-Fe)):this.K===270?(y.m(Ne++,mt,Ct-ft-Fe),y.m(Ne++,mt,Math.min(Ct-ft+Fe/2,Ct)),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Math.max(Ct+Kt-Fe/2,Ct)),y.m(Ne++,mt,Ct+Kt+Fe)):(y.m(Ne++,mt+Kt+Fe,Ct),y.m(Ne++,Math.max(mt+Kt-Fe/2,mt),Ct),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Ct),y.m(Ne++,Math.min(mt-ft+Fe/2,mt),Ct),y.m(Ne++,mt-ft-Fe,Ct)):y.m(Ne++,mt,Ct)}pe=Xe}(re===null||ue!==Xr||Pe)&&(Ve=y.i(Ne-1).x,ht=y.i(Ne-1).y,mt=y.i(Ne).x,Ct=y.i(Ne).y,Pe?(Fe=this.Ld[he.layer],this.K===180||this.K===0?(Pe=ht,Pe>=he.bounds.y&&Pe<=he.bounds.bottom&&(this.K===180?mt>=he.bounds.x:mt<=he.bounds.right)&&(pe=he.centerX+(this.K===180?-Fe:Fe),Pe<he.bounds.y+he.bounds.height/2?Pe=he.bounds.y-this.kc/2:Pe=he.bounds.bottom+this.kc/2,y.m(Ne++,pe,ht),y.m(Ne++,pe,Pe)),y.m(Ne++,mt,Pe)):(Pe=Ve,Pe>=he.bounds.x&&Pe<=he.bounds.right&&(this.K===270?Ct>=he.bounds.y:Ct<=he.bounds.bottom)&&(pe=he.centerY+(this.K===270?-Fe:Fe),Pe<he.bounds.x+he.bounds.width/2?Pe=he.bounds.x-this.kc/2:Pe=he.bounds.right+this.kc/2,y.m(Ne++,Ve,pe),y.m(Ne++,Pe,pe)),y.m(Ne++,Pe,Ct)),y.m(Ne++,mt,Ct)):Se?(ft=Math.max(10,this.he[he.layer]),Kt=Math.max(10,this.Ld[he.layer]),this.K===180&&mt>=he.bounds.x?(pe=he.bounds.x+he.bounds.width,y.L(Ne-2,pe,ht),y.L(Ne-1,pe+Kt,ht)):this.K===90&&Ct<=he.bounds.bottom?(pe=he.bounds.y,y.L(Ne-2,Ve,pe),y.L(Ne-1,Ve,pe-ft)):this.K===270&&Ct>=he.bounds.y?(pe=he.bounds.y+he.bounds.height,y.L(Ne-2,Ve,pe),y.L(Ne-1,Ve,pe+Kt)):this.K===0&&mt<=he.bounds.right&&(pe=he.bounds.x,y.L(Ne-2,pe,ht),y.L(Ne-1,pe-ft,ht))):(ft=Math.max(10,this.he[he.layer]),Kt=Math.max(10,this.Ld[he.layer]),Pe=0,this.K===180||this.K===0?((this.K===180?mt<=he.bounds.x:mt>=he.bounds.right)&&(Pe=(this.K===0?Kt:-ft)/2),y.m(Ne++,mt+Pe,ht)):((this.K===270?Ct<=he.bounds.y:Ct>=he.bounds.bottom)&&(Pe=(this.K===90?Kt:-ft)/2),y.m(Ne++,Ve,Ct+Pe)),y.m(Ne++,mt,Ct)))}else{for(;he!==null&&he!==pe;){for(ft=Xe=null,he=he.destinationEdges.iterator;he.next()&&(Ve=he.value,Ve.link!==x.link||(Xe=Ve.toVertex,ft=Ve.fromVertex,ft.node!==null&&(ft=null),Xe.node!==null)););if(Xe===null)break;Xe!==pe&&(Ve=y.i(Ne-1).x,ht=y.i(Ne-1).y,mt=Xe.centerX,Ct=Xe.centerY,Pe?this.K===180||this.K===0?(ft!==null?ft.centerY:ht)!==Ct&&(ft=this.Ta[Xe.layer]+this.Rf.x,Ne===y.firstPickIndex+1&&(ft=this.K===0?Math.max(ft,Ve):Math.min(ft,Ve)),y.m(Ne++,ft,ht),y.m(Ne++,ft,Ct)):(ft!==null?ft.centerX:Ve)!==mt&&(ft=this.Ta[Xe.layer]+this.Rf.y,Ne===y.firstPickIndex+1&&(ft=this.K===90?Math.max(ft,ht):Math.min(ft,ht)),y.m(Ne++,Ve,ft),y.m(Ne++,mt,ft)):(ft=Math.max(10,this.he[Xe.layer]),Kt=Math.max(10,this.Ld[Xe.layer]),Se?this.K===180?(y.m(Ne++,mt+Kt+Fe,Ct),y.m(Ne++,Math.max(mt+Kt-Fe/2,mt),Ct),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Ct),y.m(Ne++,Math.min(mt-ft+Fe/2,mt),Ct),y.m(Ne++,mt-ft-Fe,Ct)):this.K===90?(y.m(Ne++,mt,Ct-ft-Fe),y.m(Ne++,mt,Math.min(Ct-ft+Fe/2,Ct)),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Math.max(Ct+Kt-Fe/2,Ct)),y.m(Ne++,mt,Ct+Kt+Fe)):this.K===270?(y.m(Ne++,mt,Ct+Kt+Fe),y.m(Ne++,mt,Math.max(Ct+Kt-Fe/2,Ct)),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Math.min(Ct-ft+Fe/2,Ct)),y.m(Ne++,mt,Ct-ft-Fe)):(y.m(Ne++,mt-ft-Fe,Ct),y.m(Ne++,Math.min(mt-ft+Fe/2,mt),Ct),y.m(Ne++,mt,Ct),y.m(Ne++,mt,Ct),y.m(Ne++,Math.max(mt+Kt-Fe/2,mt),Ct),y.m(Ne++,mt+Kt+Fe,Ct)):this.K===180?(y.m(Ne++,mt+Kt,Ct),y.m(Ne++,mt-ft,Ct)):this.K===90?(y.m(Ne++,mt,Ct-ft),y.m(Ne++,mt,Ct+Kt)):this.K===270?(y.m(Ne++,mt,Ct+Kt),y.m(Ne++,mt,Ct-ft)):(y.m(Ne++,mt-ft,Ct),y.m(Ne++,mt+Kt,Ct)))),he=Xe}Pe&&(Ve=y.i(Ne-1).x,ht=y.i(Ne-1).y,mt=y.i(Ne).x,Ct=y.i(Ne).y,this.K===180||this.K===0?ht!==Ct&&(ft=this.K===0?Math.min(Math.max((mt+Ve)/2,this.Ta[pe.layer]+this.Rf.x),mt):Math.max(Math.min((mt+Ve)/2,this.Ta[pe.layer]+this.Rf.x),mt),y.m(Ne++,ft,ht),y.m(Ne++,ft,Ct)):Ve!==mt&&(ft=this.K===90?Math.min(Math.max((Ct+ht)/2,this.Ta[pe.layer]+this.Rf.y),Ct):Math.max(Math.min((Ct+ht)/2,this.Ta[pe.layer]+this.Rf.y),Ct),y.m(Ne++,Ve,ft),y.m(Ne++,mt,ft)))}E!==null&&Se&&4<=y.pointsCount&&(ee!==null&&(ee=ue===Xr?y.getLinkPointFromPoint(b,ee,ee.ga(Kr),y.i(3),!0):y.i(0),ue===Xr&&(ue=y.i(2),E=y.i(3),this.direction===90||this.direction===270?(y.L(1,(ee.x+ue.x)/2,ue.y),y.L(2,E.x,(ue.y+E.y)/2)):(y.L(1,ue.x,(ee.y+ue.y)/2),y.L(2,(ue.x+E.x)/2,E.y))),ee.w()||ee.set(b.actualBounds.center),y.L(0,ee.x,ee.y)),re!==null&&(b=oe===Xr?y.getLinkPointFromPoint(z,re,re.ga(Kr),y.i(y.pointsCount-4),!1):y.i(y.pointsCount-1),oe===Xr&&(re=y.i(y.pointsCount-3),oe=y.i(y.pointsCount-4),this.direction===90||this.direction===270?(y.L(y.pointsCount-2,(b.x+re.x)/2,re.y),y.L(y.pointsCount-2,oe.x,(re.y+oe.y)/2)):(y.L(y.pointsCount-2,re.x,(b.y+re.y)/2),y.L(y.pointsCount-3,(re.x+oe.x)/2,oe.y))),b.w()||b.set(z.actualBounds.center),y.L(y.pointsCount-1,b.x,b.y))),y.zf(),x.commit()}}}this.avoidOrthogonalOverlaps()},wa.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new Bn,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),ee=E.i(b+1);if(this.B(z.y,ee.y)&&!this.B(z.x,ee.x)){var re=new ef;re.layer=Math.floor(z.y/2);var oe=E.i(0),ue=E.i(E.pointsCount-1);if(re.first=oe.x*oe.x+oe.y,re.jc=ue.x*ue.x+ue.y,re.rd=Math.min(z.x,ee.x),re.Ic=Math.max(z.x,ee.x),re.index=b,re.link=E,b+2<E.pointsCount){oe=E.i(b-1),ue=E.i(b+2);var he=0;oe.y<z.y?he=ue.y<z.y?3:z.x<ee.x?2:1:oe.y>z.y&&(he=ue.y>z.y?0:ee.x<z.x?2:1),re.j=he}x.push(re)}}}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(ee=x[z].Ic,b=a+1;b<E&&x[b].rd<ee;)ee=Math.max(ee,x[b].Ic),b++;if(ee=b-z,1<ee){for(this.zi(x,this.Js,z,z+ee),he=1,re=x[z].jc,oe=z;oe<b;oe++)ue=x[oe],ue.jc!==re&&(he++,re=ue.jc);this.zi(x,this.Ux,z,z+ee);var pe=1;for(re=x[z].first,oe=z;oe<b;oe++)ue=x[oe],ue.first!==re&&(pe++,re=ue.first);for(oe=!0,ue=pe,he<pe?(oe=!1,ue=he,re=x[z].jc,this.zi(x,this.Js,z,z+ee)):re=x[z].first,he=0,pe=z;pe<b;pe++){var Se=x[pe];(oe?Se.first:Se.jc)!==re&&(he++,re=oe?Se.first:Se.jc);var Pe=Se.link;z=Pe.i(Se.index),ee=Pe.i(Se.index+1);var Fe=this.linkSpacing*(he-(ue-1)/2);y++,Pe.uh(),Pe.L(Se.index,z.x,z.y+Fe),Pe.L(Se.index+1,ee.x,ee.y+Fe),Pe.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),ee=E.i(b+1),this.B(z.x,ee.x)&&!this.B(z.y,ee.y)&&(re=new ef,re.layer=Math.floor(z.x/2),oe=E.i(0),ue=E.i(E.pointsCount-1),re.first=oe.x+oe.y*oe.y,re.jc=ue.x+ue.y*ue.y,re.rd=Math.min(z.y,ee.y),re.Ic=Math.max(z.y,ee.y),re.index=b,re.link=E,b+2<E.pointsCount&&(oe=E.i(b-1),ue=E.i(b+2),he=0,oe.x<z.x?he=ue.x<z.x?3:z.y<ee.y?2:1:oe.x>z.x&&(he=ue.x>z.x?0:ee.y<z.y?2:1),re.j=he),x.push(re));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(ee=x[z].Ic,b=a+1;b<E&&x[b].rd<ee;)ee=Math.max(ee,x[b].Ic),b++;if(ee=b-z,1<ee){for(this.zi(x,this.Js,z,z+ee),he=1,re=x[z].jc,oe=z;oe<b;oe++)ue=x[oe],ue.jc!==re&&(he++,re=ue.jc);for(this.zi(x,this.Ux,z,z+ee),pe=1,re=x[z].first,oe=z;oe<b;oe++)ue=x[oe],ue.first!==re&&(pe++,re=ue.first);for(oe=!0,ue=pe,he<pe?(oe=!1,ue=he,re=x[z].jc,this.zi(x,this.Js,z,z+ee)):re=x[z].first,he=0,pe=z;pe<b;pe++)Se=x[pe],(oe?Se.first:Se.jc)!==re&&(he++,re=oe?Se.first:Se.jc),Pe=Se.link,z=Pe.i(Se.index),ee=Pe.i(Se.index+1),Fe=this.linkSpacing*(he-(ue-1)/2),y++,Pe.uh(),Pe.L(Se.index,z.x+Fe,z.y),Pe.L(Se.index+1,ee.x+Fe,ee.y),Pe.zf()}z=b}a=E}}}},be=wa.prototype,be.Vx=function(a,y){return a instanceof ef&&y instanceof ef&&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},be.Ux=function(a,y){return a instanceof ef&&y instanceof ef&&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},be.Js=function(a,y){return a instanceof ef&&y instanceof ef&&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},be.B=function(a,y){return a-=y,-1<a&&1>a},be.zi=function(a,y,x,E){var b=a.length,z=E-x;if(!(1>=z))if((0>x||x>=b-1)&&at("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 $c(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 qc(a,y,x){a.He[a.tc[y]]=x}fn.Object.defineProperties(wa.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()):at("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{get:function(){return this.Dk},set:function(a){this.Dk===a||a!==My&&a!==Q0&&a!==Pm||(this.Dk=a,this.C())}},layeringOption:{get:function(){return this.Zk},set:function(a){this.Zk===a||a!==$0&&a!==ky&&a!==Ay||(this.Zk=a,this.C())}},initializeOption:{get:function(){return this.Qk},set:function(a){this.Qk===a||a!==q0&&a!==Ny&&a!==Dy||(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!==Ty&&a!==ev&&a!==_y||(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 Q0=new Ot(wa,"CycleDepthFirst",0),My=new Ot(wa,"CycleGreedy",1),Pm=new Ot(wa,"CycleFromLayers",2),$0=new Ot(wa,"LayerOptimalLinkLength",0),ky=new Ot(wa,"LayerLongestPathSink",1),Ay=new Ot(wa,"LayerLongestPathSource",2),q0=new Ot(wa,"InitDepthFirstOut",0),Ny=new Ot(wa,"InitDepthFirstIn",1),Dy=new Ot(wa,"InitNaive",2),Ty=new Ot(wa,"AggressiveNone",0),ev=new Ot(wa,"AggressiveLess",1),_y=new Ot(wa,"AggressiveMore",2),US=8;wa.className="LayeredDigraphLayout",wa.CycleDepthFirst=Q0,wa.CycleGreedy=My,wa.CycleFromLayers=Pm,wa.LayerOptimalLinkLength=$0,wa.LayerLongestPathSink=ky,wa.LayerLongestPathSource=Ay,wa.InitDepthFirstOut=q0,wa.InitDepthFirstIn=Ny,wa.InitNaive=Dy,wa.AggressiveNone=Ty,wa.AggressiveLess=ev,wa.AggressiveMore=_y,wa.PackNone=0,wa.PackExpand=1,wa.PackStraighten=2,wa.PackMedian=4,wa.PackAll=15,wa.AlignNone=0,wa.AlignUpperLeft=1,wa.AlignUpperRight=2,wa.AlignLowerLeft=4,wa.AlignLowerRight=8,wa.AlignAll=15;function ef(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}ef.className="SegInfo";function Fp(a){za.call(this,a)}_t(Fp,za),Fp.prototype.createVertex=function(){return new Cu(this)},Fp.prototype.createEdge=function(){return new Em(this)},Fp.className="LayeredDigraphNetwork";function Cu(a){bs.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}_t(Cu,bs);function rS(a,y){return a.index-y.index}function tv(a,y){if(!a.$n){for(var x=[],E=fi(a.destinationEdgesArrayAccess),b=E.next();!b.done;b=E.next())b=b.value,b.valid&&x.push(b);a.$n=x}for(a=fi(a.$n),x=a.next();!x.done;x=a.next())if(x=x.value,x.toVertex===y)return x;at("Unable to find destination edge to given vertex")}function Iy(a){if(!a.co){for(var y=[],x=fi(a.sourceEdgesArrayAccess),E=x.next();!E.done;E=x.next())E=E.value,E.valid&&y.push(E.fromVertex);y.sort(rS),a.co=y}return a.co}function YS(a){if(!a.ao){for(var y=[],x=fi(a.destinationEdgesArrayAccess),E=x.next();!E.done;E=x.next())E=E.value,E.valid&&y.push(E.toVertex);y.sort(rS),a.ao=y}return a.ao}Cu.prototype.Cl=function(a){bs.prototype.Cl.call(this,a),this.bo=this.co=null},Cu.prototype.Kl=function(a){bs.prototype.Kl.call(this,a),this.bo=this.co=null},Cu.prototype.zl=function(a){bs.prototype.zl.call(this,a),this.$n=this.ao=null},Cu.prototype.Jl=function(a){bs.prototype.Jl.call(this,a),this.$n=this.ao=null},fn.Object.defineProperties(Cu.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)}}}),Cu.prototype.deleteDestinationEdge=Cu.prototype.Jl,Cu.prototype.addDestinationEdge=Cu.prototype.zl,Cu.prototype.deleteSourceEdge=Cu.prototype.Kl,Cu.prototype.addSourceEdge=Cu.prototype.Cl,Cu.className="LayeredDigraphVertex";function Em(a){iu.call(this,a),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}_t(Em,iu),fn.Object.defineProperties(Em.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)}}}),Em.className="LayeredDigraphEdge";function Bo(a){Va.call(this),this.Ub=new In,this.Wn=ov,this.ud=$h,this.vo=sv,this.Bq=Uy,this.$v=[],this.td=!0,this.Rb=lv,this.$d=new Pn(10,10).freeze();var y=new Dg(this);this.W=new Iu(y),this.Y=new Iu(y),this.ru=[],a&&Object.assign(this,a)}_t(Bo,Va),Bo.prototype.cloneProtected=function(a){Va.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)},Bo.prototype.qb=function(a){a.classType===Bo?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:at("Unknown enum value: "+a):Va.prototype.qb.call(this,a)},Bo.prototype.createNetwork=function(){return new Dg(this)},Bo.prototype.makeNetwork=function(a){function y(E){if(E instanceof Fi)return!E.isLinkLabel&&E.category!=="Comment";if(E instanceof $n){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 Vt?(x.lg(a.nodes,!0,y),x.lg(a.links,!0,y)):a instanceof no?x.lg(a.memberParts,!1,y):x.lg(a.iterator,!1,y),x},Bo.prototype.doLayout=function(a){this.network===null&&(this.network=this.makeNetwork(a)),this.arrangement!==uv&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var y=this.diagram;if(y===null&&a instanceof Vt&&(y=a),this.path===ov&&y!==null?this.ud=y.isTreePathToChildren?$h:Ag:this.ud=this.path===ov?$h: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 In,y=this.Ub.iterator;y.next();){var x=y.value;x instanceof Fi?(x=this.network.ki(x),x!==null&&a.add(x)):x instanceof Iu&&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,Oy(this,y));for(y=this.network.vertexes,a=null;a=XS(y),0<a.count;)y=oS(this,a),y!==null&&this.Ub.add(y),y.initialized=!0,Oy(this,y),y=a;for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Iu&&sS(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Iu&&lS(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Iu&&uS(this,y);if(this.Cu(),this.layerStyle===hv){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===Yy)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 Iu&&this.layoutTree(y);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new In,this.isValidLayout=!0};function XS(a){var y=new In;for(a=a.iterator;a.next();){var x=a.value;x.initialized||y.add(x)}return y}Bo.prototype.findRoots=function(){for(var a=this.network.vertexes,y=a.iterator;y.next();){var x=y.value;switch(this.ud){case $h:x.sourceEdges.count===0&&this.Ub.add(x);break;case Ag:x.destinationEdges.count===0&&this.Ub.add(x);break;default:at("Unhandled path value "+this.ud.toString())}}this.Ub.count===0&&(a=oS(this,a),a!==null&&this.Ub.add(a))};function oS(a,y){var x=999999,E=null;for(y=y.iterator;y.next();){var b=y.value;switch(a.ud){case $h:b.sourceEdges.count<x&&(x=b.sourceEdges.count,E=b);break;case Ag:b.destinationEdges.count<x&&(x=b.destinationEdges.count,E=b);break;default:at("Unhandled path value "+a.ud.toString())}}return E}function Oy(a,y){if(y!==null){switch(a.ud){case $h:if(0<y.destinationEdges.count){for(var x=new Bn,E=y.destinationVertexes;E.next();){var b=E.value;aS(a,y,b)&&x.add(b)}0<x.count&&(y.children=x.Fa())}break;case Ag:if(0<y.sourceEdges.count){for(x=new Bn,E=y.sourceVertexes;E.next();)b=E.value,aS(a,y,b)&&x.add(b);0<x.count&&(y.children=x.Fa())}break;default:at("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++)Oy(a,x[y])}}function aS(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}Bo.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 sS(a,y){if(y!==null){a.initializeTreeVertexValues(y),y.alignment===td&&a.sortTreeVertexChildren(y);for(var x=0,E=y.childrenCount,b=0,z=y.children,ee=z.length,re=0;re<ee;re++){var oe=z[re];sS(a,oe),x+=oe.descendantCount+1,E=Math.max(E,oe.maxChildrenCount),b=Math.max(b,oe.maxGenerationCount)}y.descendantCount=x,y.maxChildrenCount=E,y.maxGenerationCount=0<E?b+1:0}}function JS(a,y){switch(a.vo){default:case sv:return y.parent!==null?y.parent:a.W;case Vy:return y.parent===null?a.W:y.parent.parent===null?a.Y:y.parent;case Hy:return y.parent!==null?y.parent.parent!==null?y.parent.parent:a.Y:a.W;case Wy: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}}Bo.prototype.initializeTreeVertexValues=function(a){if(a.copyInheritedPropertiesFrom(JS(this,a)),a.parent!==null&&a.parent.alignment===td){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 lS(a,y){if(y!==null){a.assignTreeVertexValues(y),y=y.children;for(var x=y.length,E=0;E<x;E++)lS(a,y[E])}}Bo.prototype.assignTreeVertexValues=function(){};function uS(a,y){if(y!==null){y.alignment!==td&&a.sortTreeVertexChildren(y),y=y.children;for(var x=y.length,E=0;E<x;E++)uS(a,y[E])}}Bo.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case Lp:break;case bm:a.children.reverse();break;case Fm:a.children.sort(a.comparer);break;case Lm:a.children.sort(a.comparer),a.children.reverse();break;default:at("Unhandled sorting value "+a.sorting.toString())}},Bo.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},Bo.prototype.addComments=function(a){var y=a.angle,x=a.parent,E=0,b=!1;x!==null&&(E=x.angle,b=x.alignment,b=tf(b)),y=y===90||y===270,E=E===90||E===270,x=a.childrenCount===0;var z=0,ee=0,re=0,oe=a.commentSpacing;if(a.node!==null)for(var ue=a.node.Mu();ue.next();){var he=ue.value;he.category==="Comment"&&he.canLayout()&&(a.comments===null&&(a.comments=[]),a.comments.push(he),he.Va(),he=he.measuredBounds,y&&!x||!b&&!E&&x||b&&E&&x?(z=Math.max(z,he.width),ee+=he.height+Math.abs(re)):(z+=he.width+Math.abs(re),ee=Math.max(ee,he.height)),re=oe)}a.comments!==null&&(y&&!x||!b&&!E&&x||b&&E&&x?(z+=Math.abs(a.commentMargin),ee=Math.max(0,ee-a.height)):(ee+=Math.abs(a.commentMargin),z=Math.max(0,z-a.width)),b=Gt.allocAt(0,0,a.bounds.width+z,a.bounds.height+ee),a.bounds=b,Gt.free(b))};function tf(a){return a===lc||a===td||a===uc||a===Fd}function Cm(a){return a===lc||a===td}function Ry(a){var y=a.parent;if(y!==null){var x=y.alignment;if(tf(x)){if(Cm(x)){for(y=y.children,x=0;x<y.length&&a!==y[x];)x++;return x%2===0}if(x===uc)return!0}}return!1}Bo.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=tf(z)),E=E===90||E===270,x=b===90||b===270;for(var ee=a.childrenCount===0,re=Ry(a),oe=0,ue=a.comments,he=ue.length,pe=Ie.alloc(),Se=0;Se<he;Se++){var Pe=ue[Se],Fe=Pe.measuredBounds;if(E&&!ee||!z&&!x&&ee||z&&x&&ee){if(135<b&&!z||x&&re)if(0<=a.commentMargin)for(pe.h(a.bounds.x-a.commentMargin-Fe.width,a.bounds.y+oe),Pe.move(pe),Pe=Pe.Sd();Pe.next();){var Ne=Pe.value;Ne.fromSpot=pa,Ne.toSpot=Lo}else for(pe.h(a.bounds.x+2*a.focus.x-a.commentMargin,a.bounds.y+oe),Pe.move(pe),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=Lo,Ne.toSpot=pa;else if(0<=a.commentMargin)for(pe.h(a.bounds.x+2*a.focus.x+a.commentMargin,a.bounds.y+oe),Pe.move(pe),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=Lo,Ne.toSpot=pa;else for(pe.h(a.bounds.x+a.commentMargin-Fe.width,a.bounds.y+oe),Pe.move(pe),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=pa,Ne.toSpot=Lo;oe=0<=a.commentSpacing?oe+(Fe.height+a.commentSpacing):oe+(a.commentSpacing-Fe.height)}else{if(135<b&&!z||!x&&re)if(0<=a.commentMargin)for(pe.h(a.bounds.x+oe,a.bounds.y-a.commentMargin-Fe.height),Pe.move(pe),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=Oo,Ne.toSpot=Ir;else for(pe.h(a.bounds.x+oe,a.bounds.y+2*a.focus.y-a.commentMargin),Pe.move(pe),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=Ir,Ne.toSpot=Oo;else if(0<=a.commentMargin)for(pe.h(a.bounds.x+oe,a.bounds.y+2*a.focus.y+a.commentMargin),Pe.move(pe),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=Ir,Ne.toSpot=Oo;else for(pe.h(a.bounds.x+oe,a.bounds.y+a.commentMargin-Fe.height),Pe.move(pe),Pe=Pe.Sd();Pe.next();)Ne=Pe.value,Ne.fromSpot=Oo,Ne.toSpot=Ir;oe=0<=a.commentSpacing?oe+(Fe.width+a.commentSpacing):oe+(a.commentSpacing-Fe.width)}}if(Ie.free(pe),y=oe-a.commentSpacing-(E?y.height:y.width),this.ud===$h)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)}},Bo.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 av:hS(this,a);break;case Bm:if(a.alignment===td)hS(this,a);else if(a.childrenCount===0)E=a.parent,x=!1,y=0,E!==null&&(y=E.angle,x=E.alignment,x=tf(x)),E=Ry(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=nh(a);y=b===90||b===270;var z=0,ee=a.children,re=ee.length;for(x=0;x<re;x++)E=ee[x],z=Math.max(z,y?E.Da.width:E.Da.height);var oe=a.alignment;E=oe===qh;var ue=oe===ed,he=tf(oe),pe=Math.max(0,a.breadthLimit);x=this.computeLayerSpacing(a);var Se=a.nodeSpacing,Pe=this.computeNodeIndent(a),Fe=a.rowSpacing,Ne=0;(E||ue||a.hm||a.im&&a.maxGenerationCount===1)&&(Ne=Math.max(0,a.rowIndent)),E=a.width;var Xe=a.height,Ve=0,ht=0,ft=0,mt=null,Ct=null,Kt=0,yi=0,tr=0,Zi=0,Qn=0,bn=0,to=0,_r=0;if(he&&!Cm(oe)&&135<b&&ee.reverse(),Cm(oe))if(1<re)for(var ia=0;ia<re;ia++)ia%2===0&&ia!==re-1&&(_r=Math.max(_r,y?ee[ia].Da.width:ee[ia].Da.height));else re===1&&(_r=y?ee[0].Da.width:ee[0].Da.height);if(he){switch(oe){case lc:ht=135>b?dS(this,a,ee,_r,Ve,ht):cS(this,a,ee,_r,Ve,ht),_r=ht.x,Ve=ht.width,ht=ht.height;break;case uc:for(mt=0;mt<re;mt++)Ct=ee[mt],pe=Ct.Da,ft=bn===0?0:Fe,y?(Ct.S.h(z-pe.width,Zi+ft),Ve=Math.max(Ve,pe.width),ht=Math.max(ht,Zi+ft+pe.height),Zi+=ft+pe.height):(Ct.S.h(tr+ft,z-pe.height),Ve=Math.max(Ve,tr+ft+pe.width),ht=Math.max(ht,pe.height),tr+=ft+pe.width),bn++;break;case Fd:for(mt=0;mt<re;mt++)Ct=ee[mt],z=Ct.Da,pe=bn===0?0:Fe,y?(Ct.S.h(Se/2+a.focus.x,Zi+pe),Ve=Math.max(Ve,z.width),ht=Math.max(ht,Zi+pe+z.height),Zi+=pe+z.height):(Ct.S.h(tr+pe,Se/2+a.focus.y),Ve=Math.max(Ve,tr+pe+z.width),ht=Math.max(ht,z.height),tr+=pe+z.width),bn++}mt=Wl(this,2),Ct=Wl(this,2),y?(mt[0].h(0,0),mt[1].h(0,ht),Ct[0].h(Ve,0)):(mt[0].h(0,0),mt[1].h(Ve,0),Ct[0].h(0,ht)),Ct[1].h(Ve,ht)}else for(ia=0;ia<re;ia++){var Da=ee[ia],ks=Da.Da;if(y){0<pe&&0<bn&&tr+Se+ks.width>pe&&(tr<z&&jf(a,oe,z-tr,0,to,ia-1),Qn++,bn=0,to=ia,ft=ht,tr=0,Zi=135<b?-ht-Fe:ht+Fe),iv(this,Da,0,Zi);var Os=0;if(bn===0)mt=Da.Yo,Ct=Da.kp,Kt=ks.width,yi=ks.height,(mt===null||Ct===null||b!==nh(Da))&&(mt=Wl(this,2),Ct=Wl(this,2),mt[0].h(0,0),mt[1].h(0,yi),Ct[0].h(Kt,0),Ct[1].h(Kt,yi));else{var hl=xi();yi=fS(this,a,Da,mt,Ct,Kt,yi,hl),Os=yi.x,mt=hl[0],Ct=hl[1],Kt=yi.width,yi=yi.height,Bi(hl),tr<ks.width&&0>Os&&(kg(a,-Os,0,to,ia-1),rv(mt,-Os,0),rv(Ct,-Os,0),Os=0)}Da.S.h(Os,Zi),Ve=Math.max(Ve,Kt),ht=Math.max(ht,ft+(Qn===0?0:Fe)+ks.height),tr=Kt}else 0<pe&&0<bn&&Zi+Se+ks.height>pe&&(Zi<z&&jf(a,oe,0,z-Zi,to,ia-1),Qn++,bn=0,to=ia,ft=Ve,Zi=0,tr=135<b?-Ve-Fe:Ve+Fe),iv(this,Da,tr,0),Os=0,bn===0?(mt=Da.Yo,Ct=Da.kp,Kt=ks.width,yi=ks.height,(mt===null||Ct===null||b!==nh(Da))&&(mt=Wl(this,2),Ct=Wl(this,2),mt[0].h(0,0),mt[1].h(Kt,0),Ct[0].h(0,yi),Ct[1].h(Kt,yi))):(hl=xi(),yi=fS(this,a,Da,mt,Ct,Kt,yi,hl),Os=yi.x,mt=hl[0],Ct=hl[1],Kt=yi.width,yi=yi.height,Bi(hl),Zi<ks.height&&0>Os&&(kg(a,0,-Os,to,ia-1),rv(mt,0,-Os),rv(Ct,0,-Os),Os=0)),Da.S.h(tr,Os),ht=Math.max(ht,yi),Ve=Math.max(Ve,ft+(Qn===0?0:Fe)+ks.width),Zi=yi;bn++}switch(0<Qn&&(y?(ht+=Math.max(0,x),tr<Ve&&jf(a,oe,Ve-tr,0,to,re-1),0<Ne&&(ue||kg(a,Ne,0,0,re-1),Ve+=Ne)):(Ve+=Math.max(0,x),Zi<ht&&jf(a,oe,0,ht-Zi,to,re-1),0<Ne&&(ue||kg(a,0,Ne,0,re-1),ht+=Ne))),Ne=ue=0,oe){case Bp:y?ue+=Ve/2-a.focus.x-Pe/2:Ne+=ht/2-a.focus.y-Pe/2;break;case Ng:0<Qn?y?ue+=Ve/2-a.focus.x-Pe/2:Ne+=ht/2-a.focus.y-Pe/2:y?(_r=ee[0].S.x+ee[0].la.x,ue+=_r+(ee[re-1].S.x+ee[re-1].la.x+2*ee[re-1].focus.x-_r)/2-a.focus.x-Pe/2):(_r=ee[0].S.y+ee[0].la.y,Ne+=_r+(ee[re-1].S.y+ee[re-1].la.y+2*ee[re-1].focus.y-_r)/2-a.focus.y-Pe/2);break;case qh:y?(ue-=Pe,Ve+=Pe):(Ne-=Pe,ht+=Pe);break;case ed:y?(ue+=Ve-a.width+Pe,Ve+=Pe):(Ne+=ht-a.height+Pe,ht+=Pe);break;case lc:y?1<re?ue+=_r+Se/2-a.focus.x:ue+=ee[0].focus.x-a.focus.x+ee[0].la.x:1<re?Ne+=_r+Se/2-a.focus.y:Ne+=ee[0].focus.y-a.focus.y+ee[0].la.y;break;case uc:y?ue+=Ve+Se/2-a.focus.x:Ne+=ht+Se/2-a.focus.y;break;case Fd:break;default:ht=this.customAlignment(a,ue,Ne,Ve,ht),ue=ht[0],Ne=ht[1],Ve=ht[2],ht=ht[3]}for(Pe=0;Pe<re;Pe++)_r=ee[Pe],y?_r.S.h(_r.S.x+_r.la.x-ue,_r.S.y+(135<b?(he?-ht:-_r.Da.height)+_r.la.y-x:Xe+x+_r.la.y)):_r.S.h(_r.S.x+(135<b?(he?-Ve:-_r.Da.width)+_r.la.x-x:E+x+_r.la.x),_r.S.y+_r.la.y-Ne);if(re=ee=0,he?y?(Ve=jy(a,Ve,ue),0>ue&&(ue=0),135<b&&(Ne+=ht+x),ht+=Xe+x,oe===Fd&&(ee+=Se/2+a.focus.x),re+=Xe+x):(135<b&&(ue+=Ve+x),Ve+=E+x,ht=zy(a,ht,Ne),0>Ne&&(Ne=0),oe===Fd&&(re+=Se/2+a.focus.y),ee+=E+x):y?(a.comments===null?E>Ve&&(Ve=Zy(oe,E-Ve,0),ee=Ve.x,re=Ve.y,Ve=E,ue=0):Ve=jy(a,Ve,ue),0>ue&&(ee-=ue,ue=0),135<b&&(Ne+=ht+x),ht=Math.max(Math.max(ht,Xe),ht+Xe+x),re+=Xe+x):(135<b&&(ue+=Ve+x),Ve=Math.max(Math.max(Ve,E),Ve+E+x),a.comments===null?Xe>ht&&(ht=Zy(oe,0,Xe-ht),ee=ht.x,re=ht.y,ht=Xe,Ne=0):ht=zy(a,ht,Ne),0>Ne&&(re-=Ne,Ne=0),ee+=E+x),0<Qn)b=Wl(this,4),Qn=Wl(this,4),y?(b[2].h(0,Xe+x),b[3].h(b[2].x,ht),Qn[2].h(Ve,b[2].y),Qn[3].h(Qn[2].x,b[3].y)):(b[2].h(E+x,0),b[3].h(Ve,b[2].y),Qn[2].h(b[2].x,ht),Qn[3].h(b[3].x,Qn[2].y));else{for(b=Wl(this,mt.length+2),Qn=Wl(this,Ct.length+2),oe=0;oe<mt.length;oe++)he=mt[oe],b[oe+2].h(he.x+ee,he.y+re);for(oe=0;oe<Ct.length;oe++)he=Ct[oe],Qn[oe+2].h(he.x+ee,he.y+re)}y?(b[0].h(ue,0),b[1].h(b[0].x,Xe),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])),Qn[0].h(ue+E,0),Qn[1].h(Qn[0].x,Xe),Qn[2].y<Qn[1].y&&(Qn[2].x<Qn[0].x?Qn[2].assign(Qn[1]):Qn[1].assign(Qn[2])),Qn[3].y<Qn[2].y&&(Qn[3].x<Qn[0].x?Qn[3].assign(Qn[2]):Qn[2].assign(Qn[3])),b[2].y-=x/2,Qn[2].y-=x/2):(b[0].h(0,Ne),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])),Qn[0].h(0,Ne+Xe),Qn[1].h(E,Qn[0].y),Qn[2].x<Qn[1].x&&(Qn[2].y<Qn[0].y?Qn[2].assign(Qn[1]):Qn[1].assign(Qn[2])),Qn[3].x<Qn[2].x&&(Qn[3].y<Qn[0].y?Qn[3].assign(Qn[2]):Qn[2].assign(Qn[3])),b[2].x-=x/2,Qn[2].x-=x/2),fh(this,mt),fh(this,Ct),a.Yo=b,a.kp=Qn,a.la.h(ue,Ne),a.Da.h(Ve,ht)}break;default:at("Unhandled compaction value "+a.compaction.toString())}}};function hS(a,y){if(y.childrenCount===0){var x=!1,E=0;y.parent!==null&&(E=y.parent.angle,x=y.parent.alignment,x=tf(x));var b=Ry(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=nh(y),x=E===90||E===270;var z=0;b=y.children;for(var ee=b.length,re=0;re<ee;re++){var oe=b[re];z=Math.max(z,x?oe.Da.width:oe.Da.height)}var ue=y.alignment,he=ue===qh,pe=ue===ed;re=tf(ue);var Se=Math.max(0,y.breadthLimit);oe=a.computeLayerSpacing(y);var Pe=y.nodeSpacing,Fe=a.computeNodeIndent(y),Ne=he||pe?0:Fe/2,Xe=y.rowSpacing,Ve=0;(he||pe||y.hm||y.im&&y.maxGenerationCount===1)&&(Ve=Math.max(0,y.rowIndent)),he=y.width;var ht=y.height,ft=0,mt=0,Ct=0,Kt=0,yi=0,tr=0,Zi=0,Qn=0,bn=0,to=0;if(re&&!Cm(ue)&&135<E&&b.reverse(),Cm(ue))if(1<ee)for(var _r=0;_r<ee;_r++){var ia=b[_r],Da=ia.Da;_r%2===0&&_r!==ee-1?bn=Math.max(bn,(x?Da.width:Da.height)+a.computeBusNodeSpacing(ia)-Pe):_r%2!==0&&(to=Math.max(to,(x?Da.width:Da.height)+a.computeBusNodeSpacing(ia)-Pe))}else ee===1&&(bn=x?b[0].Da.width:b[0].Da.height);if(re)switch(ue){case lc:case td:mt=135>E?dS(a,y,b,bn,ft,mt):cS(a,y,b,bn,ft,mt),bn=mt.x,ft=mt.width,mt=mt.height;break;case uc:for(Se=0;Se<ee;Se++)Ne=b[Se],Ct=Ne.Da,to=Zi===0?0:Xe,x?(Ne.S.h(z-Ct.width,yi+to),ft=Math.max(ft,Ct.width),mt=Math.max(mt,yi+to+Ct.height),yi+=to+Ct.height):(Ne.S.h(Kt+to,z-Ct.height),ft=Math.max(ft,Kt+to+Ct.width),mt=Math.max(mt,Ct.height),Kt+=to+Ct.width),Zi++;break;case Fd:for(z=0;z<ee;z++)Se=b[z],Ne=Se.Da,Ct=Zi===0?0:Xe,x?(Se.S.h(Pe/2+y.focus.x,yi+Ct),ft=Math.max(ft,Ne.width),mt=Math.max(mt,yi+Ct+Ne.height),yi+=Ct+Ne.height):(Se.S.h(Kt+Ct,Pe/2+y.focus.y),ft=Math.max(ft,Kt+Ct+Ne.width),mt=Math.max(mt,Ne.height),Kt+=Ct+Ne.width),Zi++}else for(to=0;to<ee;to++)_r=b[to],ia=_r.Da,x?(0<Se&&0<Zi&&Kt+Pe+ia.width>Se&&(Kt<z&&jf(y,ue,z-Kt,0,Qn,to-1),tr++,Zi=0,Qn=to,Ct=mt,Kt=0,yi=135<E?-mt-Xe:mt+Xe),Da=Zi===0?Ne:Pe,iv(a,_r,0,yi),_r.S.h(Kt+Da,yi),ft=Math.max(ft,Kt+Da+ia.width),mt=Math.max(mt,Ct+(tr===0?0:Xe)+ia.height),Kt+=Da+ia.width):(0<Se&&0<Zi&&yi+Pe+ia.height>Se&&(yi<z&&jf(y,ue,0,z-yi,Qn,to-1),tr++,Zi=0,Qn=to,Ct=ft,yi=0,Kt=135<E?-ft-Xe:ft+Xe),Da=Zi===0?Ne:Pe,iv(a,_r,Kt,0),_r.S.h(Kt,yi+Da),mt=Math.max(mt,yi+Da+ia.height),ft=Math.max(ft,Ct+(tr===0?0:Xe)+ia.width),yi+=Da+ia.height),Zi++;switch(0<tr&&(x?(mt+=Math.max(0,oe),Kt<ft&&jf(y,ue,ft-Kt,0,Qn,ee-1),0<Ve&&(pe||kg(y,Ve,0,0,ee-1),ft+=Ve)):(ft+=Math.max(0,oe),yi<mt&&jf(y,ue,0,mt-yi,Qn,ee-1),0<Ve&&(pe||kg(y,0,Ve,0,ee-1),mt+=Ve))),Ve=pe=0,ue){case Bp:x?pe+=ft/2-y.focus.x-Fe/2:Ve+=mt/2-y.focus.y-Fe/2;break;case Ng:0<tr?x?pe+=ft/2-y.focus.x-Fe/2:Ve+=mt/2-y.focus.y-Fe/2:x?(a=b[0].S.x+b[0].la.x,pe+=a+(b[ee-1].S.x+b[ee-1].la.x+2*b[ee-1].focus.x-a)/2-y.focus.x-Fe/2):(a=b[0].S.y+b[0].la.y,Ve+=a+(b[ee-1].S.y+b[ee-1].la.y+2*b[ee-1].focus.y-a)/2-y.focus.y-Fe/2);break;case qh:x?(pe-=Fe,ft+=Fe):(Ve-=Fe,mt+=Fe);break;case ed:x?(pe+=ft-y.width+Fe,ft+=Fe):(Ve+=mt-y.height+Fe,mt+=Fe);break;case lc:case td:x?1<ee?pe+=bn+Pe/2-y.focus.x:pe+=b[0].focus.x-y.focus.x+b[0].la.x:1<ee?Ve+=bn+Pe/2-y.focus.y:Ve+=b[0].focus.y-y.focus.y+b[0].la.y;break;case uc:x?pe+=ft+Pe/2-y.focus.x:Ve+=mt+Pe/2-y.focus.y;break;case Fd:break;default:a=a.customAlignment(y,pe,Ve,ft,mt),pe=a[0],Ve=a[1],ft=a[2],mt=a[3]}for(a=0;a<ee;a++)Fe=b[a],x?Fe.S.h(Fe.S.x+Fe.la.x-pe,Fe.S.y+(135<E?(re?-mt:-Fe.Da.height)+Fe.la.y-oe:ht+oe+Fe.la.y)):Fe.S.h(Fe.S.x+(135<E?(re?-ft:-Fe.Da.width)+Fe.la.x-oe:he+oe+Fe.la.x),Fe.S.y+Fe.la.y-Ve);x?(ft=jy(y,ft,pe),0>pe&&(pe=0),135<E&&(Ve+=mt+oe),mt=Math.max(Math.max(mt,ht),mt+ht+oe)):(135<E&&(pe+=ft+oe),ft=Math.max(Math.max(ft,he),ft+he+oe),mt=zy(y,mt,Ve),0>Ve&&(Ve=0)),y.la.h(pe,Ve),y.Da.h(ft,mt)}}Bo.prototype.customAlignment=function(a,y,x,E,b){return[y,x,E,b]};function dS(a,y,x,E,b,z){var ee=x.length;if(ee===0)return new Gt(E,0,b,z);if(ee===1)return y=x[0],b=y.Da.width,z=y.Da.height,new Gt(E,0,b,z);for(var re=y.nodeSpacing,oe=y.rowSpacing,ue=nh(y)===90,he=0,pe=0,Se=0,Pe=0;Pe<ee;Pe++)if(!(Pe%2!==0||1<ee&&Pe===ee-1)){var Fe=x[Pe],Ne=Fe.Da,Xe=he===0?0:oe;if(ue){var Ve=a.computeBusNodeSpacing(Fe)-re;Fe.S.h(E-(Ne.width+Ve),Se+Xe),b=Math.max(b,Ne.width+Ve),z=Math.max(z,Se+Xe+Ne.height),Se+=Xe+Ne.height}else Ve=a.computeBusNodeSpacing(Fe)-re,Fe.S.h(pe+Xe,E-(Ne.height+Ve)),z=Math.max(z,Ne.height+Ve),b=Math.max(b,pe+Xe+Ne.width),pe+=Xe+Ne.width;he++}for(he=0,Fe=pe,Pe=Se,ue?(pe=E+re,Se=0):(pe=0,Se=E+re),Ne=0;Ne<ee;Ne++)if(Ne%2!==0){Xe=x[Ne],Ve=Xe.Da;var ht=he===0?0:oe;if(ue){var ft=a.computeBusNodeSpacing(Xe)-re;Xe.S.h(pe+ft,Se+ht),b=Math.max(b,pe+Ve.width+ft),z=Math.max(z,Se+ht+Ve.height),Se+=ht+Ve.height}else ft=a.computeBusNodeSpacing(Xe)-re,Xe.S.h(pe+ht,Se+ft),b=Math.max(b,pe+ht+Ve.width),z=Math.max(z,Se+Ve.height+ft),pe+=ht+Ve.width;he++}return 1<ee&&ee%2===1&&(x=x[ee-1],ee=x.Da,a=a.computeBusLastRowSpacing(x,ue?Math.max(Math.abs(Pe),Math.abs(Se)):Math.max(Math.abs(Fe),Math.abs(pe))),ue?(x.S.h(E+re/2-x.focus.x-x.la.x,z+a),ue=E+re/2-x.focus.x-x.la.x,b=Math.max(b,ue+ee.width),0>ue&&(b-=ue),z=Math.max(z,Math.max(Pe,Se)+a+ee.height),0>x.S.x&&(E=nv(y,x.S.x,!1,E,re))):(x.S.h(b+a,E+re/2-x.focus.y-x.la.y),b=Math.max(b,Math.max(Fe,pe)+a+ee.width),Se=E+re/2-x.focus.y-x.la.y,z=Math.max(z,Se+ee.height),0>Se&&(z-=Se),0>x.S.y&&(E=nv(y,x.S.y,!0,E,re)))),new Gt(E,0,b,z)}function cS(a,y,x,E,b,z){var ee=x.length;if(ee===0)return new Gt(E,0,b,z);if(ee===1)return x=x[0],b=x.Da.width,z=x.Da.height,new Gt(E,0,b,z);for(var re=y.nodeSpacing,oe=y.rowSpacing,ue=nh(y)===270,he=0,pe=0,Se=0,Pe=0;Pe<ee;Pe++)if(!(Pe%2!==0||1<ee&&Pe===ee-1)){var Fe=x[Pe],Ne=Fe.Da,Xe=he===0?0:oe;if(ue){var Ve=a.computeBusNodeSpacing(Fe)-re;Se-=Xe+Ne.height,Fe.S.h(E-(Ne.width+Ve),Se),b=Math.max(b,Ne.width+Ve),z=Math.max(z,Math.abs(Se))}else Ve=a.computeBusNodeSpacing(Fe)-re,pe-=Xe+Ne.width,Fe.S.h(pe,E-(Ne.height+Ve)),z=Math.max(z,Ne.height+Ve),b=Math.max(b,Math.abs(pe));he++}for(he=0,Fe=pe,Pe=Se,ue?(pe=E+re,Se=0):(pe=0,Se=E+re),Ne=0;Ne<ee;Ne++)if(Ne%2!==0){Xe=x[Ne],Ve=Xe.Da;var ht=he===0?0:oe;if(ue){var ft=a.computeBusNodeSpacing(Xe)-re;Se-=ht+Ve.height,Xe.S.h(pe+ft,Se),b=Math.max(b,pe+Ve.width+ft),z=Math.max(z,Math.abs(Se))}else ft=a.computeBusNodeSpacing(Xe)-re,pe-=ht+Ve.width,Xe.S.h(pe,Se+ft),z=Math.max(z,Se+Ve.height+ft),b=Math.max(b,Math.abs(pe));he++}for(1<ee&&ee%2===1&&(oe=x[ee-1],he=oe.Da,a=a.computeBusLastRowSpacing(oe,ue?Math.max(Math.abs(Pe),Math.abs(Se)):Math.max(Math.abs(Fe),Math.abs(pe))),ue?(oe.S.h(E+re/2-oe.focus.x-oe.la.x,-z-he.height-a),pe=E+re/2-oe.focus.x-oe.la.x,b=Math.max(b,pe+he.width),0>pe&&(b-=pe),z=Math.max(z,Math.abs(Math.min(Pe,Se))+a+he.height),0>oe.S.x&&(E=nv(y,oe.S.x,!1,E,re))):(oe.S.h(-b-he.width-a,E+re/2-oe.focus.y-oe.la.y),b=Math.max(b,Math.abs(Math.min(Fe,pe))+a+he.width),Se=E+re/2-oe.focus.y-oe.la.y,z=Math.max(z,Se+he.height),0>Se&&(z-=Se),0>oe.S.y&&(E=nv(y,oe.S.y,!0,E,re)))),y=0;y<ee;y++)re=x[y],ue?re.S.h(re.S.x,re.S.y+z):re.S.h(re.S.x+b,re.S.y);return new Gt(E,0,b,z)}Bo.prototype.computeBusNodeSpacing=function(a){return a.parent===null?0:a.parent.nodeSpacing},Bo.prototype.computeBusLastRowSpacing=function(a){return a.parent===null?0:a.parent.rowSpacing};function nv(a,y,x,E,b){a=a.children;for(var z=a.length,ee=0;ee<z;ee++)x?a[ee].S.h(a[ee].S.x,a[ee].S.y-y):a[ee].S.h(a[ee].S.x-y,a[ee].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 jy(a,y,x){switch(a.alignment){case Ng:case Bp:return x+a.width>y&&(y=x+a.width),0>x&&(y-=x),y;case qh:return a.width>y?a.width:y;case ed:return 2*a.focus.x>y?a.width:y+a.width-2*a.focus.x;case lc:case td:return Math.max(a.width,Math.max(y,x+a.width)-Math.min(0,x));case uc:return a.width-a.focus.x+a.nodeSpacing/2+y;case Fd:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+y);default:return y}}function zy(a,y,x){switch(a.alignment){case Ng:case Bp:return x+a.height>y&&(y=x+a.height),0>x&&(y-=x),y;case qh:return a.height>y?a.height:y;case ed:return 2*a.focus.y>y?a.height:y+a.height-2*a.focus.y;case lc:case td:return Math.max(a.height,Math.max(y,x+a.height)-Math.min(0,x));case uc:return a.height-a.focus.y+a.nodeSpacing/2+y;case Fd:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+y);default:return y}}function Zy(a,y,x){switch(a){case Bp:y/=2,x/=2;break;case Ng:y/=2,x/=2;break;case qh:x=y=0;break;case ed:break;default:at("Unhandled alignment value "+a.toString())}return new Ie(y,x)}function jf(a,y,x,E,b,z){y=Zy(y,x,E),kg(a,y.x,y.y,b,z)}function kg(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 iv(a,y,x,E){var b=y.parent;switch(a.ud){case $h:for(a=y.sourceEdges;a.next();)y=a.value,y.fromVertex===b&&y.relativePoint.h(x,E);break;case Ag:for(a=y.destinationEdges;a.next();)y=a.value,y.toVertex===b&&y.relativePoint.h(x,E);break;default:at("Unhandled path value "+a.ud.toString())}}function rv(a,y,x){for(var E=0;E<a.length;E++){var b=a[E];b.x+=y,b.y+=x}}function fS(a,y,x,E,b,z,ee,re){var oe=nh(y),ue=oe===90||oe===270,he=y.nodeSpacing;y=E;var pe=b;E=z;var Se=ee,Pe=x.Yo,Fe=x.kp;ee=x.Da;var Ne=ue?Math.max(Se,ee.height):Math.max(E,ee.width);if((Pe===null||oe!==nh(x))&&(Pe=Wl(a,2),Fe=Wl(a,2),ue?(Pe[0].h(0,0),Pe[1].h(0,ee.height),Fe[0].h(ee.width,0),Fe[1].h(Fe[0].x,Pe[1].y)):(Pe[0].h(0,0),Pe[1].h(ee.width,0),Fe[0].h(0,ee.height),Fe[1].h(Pe[1].x,Fe[0].y))),ue){if(Se=9999999,!(pe===null||2>pe.length||Pe===null||2>Pe.length))for(b=x=0;x<pe.length&&b<Pe.length;){z=pe[x];var Xe=Pe[b];oe=Xe.x,ue=Xe.y,oe+=E;var Ve=z;x+1<pe.length&&(Ve=pe[x+1]);var ht=Xe;Xe=ht.x,ht=ht.y,b+1<Pe.length&&(ht=Pe[b+1],Xe=ht.x,ht=ht.y,Xe+=E);var ft=Se;z.y===ue?ft=oe-z.x:z.y>ue&&z.y<ht?ft=oe+(z.y-ue)/(ht-ue)*(Xe-oe)-z.x:ue>z.y&&ue<Ve.y&&(ft=oe-(z.x+(ue-z.y)/(Ve.y-z.y)*(Ve.x-z.x))),ft<Se&&(Se=ft),Ve.y<=z.y?x++:ht<=ue?b++:(Ve.y<=ht&&x++,ht<=Ve.y&&b++)}if(Se=E-Se,Se+=he,x=Pe,b=Se,y===null||2>y.length||x===null||2>x.length)E=null;else{for(he=Wl(a,y.length+x.length),E=z=oe=0;z<x.length&&x[z].y<y[0].y;)ue=x[z++],he[E++].h(ue.x+b,ue.y);for(;oe<y.length;)ue=y[oe++],he[E++].h(ue.x,ue.y);for(oe=y[y.length-1].y;z<x.length&&x[z].y<=oe;)z++;for(;z<x.length&&x[z].y>oe;)ue=x[z++],he[E++].h(ue.x+b,ue.y);for(x=Wl(a,E),oe=0;oe<E;oe++)x[oe].assign(he[oe]);fh(a,he),E=x}if(z=Fe,oe=Se,pe===null||2>pe.length||z===null||2>z.length)b=null;else{for(he=Wl(a,pe.length+z.length),b=ue=x=0;x<pe.length&&pe[x].y<z[0].y;)Ve=pe[x++],he[b++].h(Ve.x,Ve.y);for(;ue<z.length;)Ve=z[ue++],he[b++].h(Ve.x+oe,Ve.y);for(z=z[z.length-1].y;x<pe.length&&pe[x].y<=z;)x++;for(;x<pe.length&&pe[x].y>z;)oe=pe[x++],he[b++].h(oe.x,oe.y);for(z=Wl(a,b),x=0;x<b;x++)z[x].assign(he[x]);fh(a,he),b=z}return z=Math.max(0,Se)+ee.width,ee=Ne,fh(a,y),fh(a,Pe),fh(a,pe),fh(a,Fe),re[0]=E,re[1]=b,new Gt(Se,0,z,ee)}if(E=9999999,!(pe===null||2>pe.length||Pe===null||2>Pe.length))for(b=x=0;x<pe.length&&b<Pe.length;)z=pe[x],Xe=Pe[b],oe=Xe.x,ue=Xe.y,ue+=Se,Ve=z,x+1<pe.length&&(Ve=pe[x+1]),ht=Xe,Xe=ht.x,ht=ht.y,b+1<Pe.length&&(ht=Pe[b+1],Xe=ht.x,ht=ht.y,ht+=Se),ft=E,z.x===oe?ft=ue-z.y:z.x>oe&&z.x<Xe?ft=ue+(z.x-oe)/(Xe-oe)*(ht-ue)-z.y:oe>z.x&&oe<Ve.x&&(ft=ue-(z.y+(oe-z.x)/(Ve.x-z.x)*(Ve.y-z.y))),ft<E&&(E=ft),Ve.x<=z.x?x++:Xe<=oe?b++:(Ve.x<=Xe&&x++,Xe<=Ve.x&&b++);if(Se-=E,Se+=he,x=Pe,b=Se,y===null||2>y.length||x===null||2>x.length)E=null;else{for(he=Wl(a,y.length+x.length),E=z=oe=0;z<x.length&&x[z].x<y[0].x;)ue=x[z++],he[E++].h(ue.x,ue.y+b);for(;oe<y.length;)ue=y[oe++],he[E++].h(ue.x,ue.y);for(oe=y[y.length-1].x;z<x.length&&x[z].x<=oe;)z++;for(;z<x.length&&x[z].x>oe;)ue=x[z++],he[E++].h(ue.x,ue.y+b);for(x=Wl(a,E),oe=0;oe<E;oe++)x[oe].assign(he[oe]);fh(a,he),E=x}if(z=Fe,oe=Se,pe===null||2>pe.length||z===null||2>z.length)b=null;else{for(he=Wl(a,pe.length+z.length),b=ue=x=0;x<pe.length&&pe[x].x<z[0].x;)Ve=pe[x++],he[b++].h(Ve.x,Ve.y);for(;ue<z.length;)Ve=z[ue++],he[b++].h(Ve.x,Ve.y+oe);for(z=z[z.length-1].x;x<pe.length&&pe[x].x<=z;)x++;for(;x<pe.length&&pe[x].x>z;)oe=pe[x++],he[b++].h(oe.x,oe.y);for(z=Wl(a,b),x=0;x<b;x++)z[x].assign(he[x]);fh(a,he),b=z}return z=Ne,ee=Math.max(0,Se)+ee.height,fh(a,y),fh(a,Pe),fh(a,pe),fh(a,Fe),re[0]=E,re[1]=b,new Gt(Se,0,z,ee)}function Wl(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 Ie;return a}function fh(a,y){var x=y.length,E=a.ru[x];E===void 0&&(E=[],a.ru[x]=E),E.push(y)}Bo.prototype.arrangeTrees=function(){if(this.Rb===uv)for(var a=this.Ub.iterator;a.next();){var y=a.value;if(y instanceof Iu){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),Gy(this,y,x,E)}}}else{for(a=[],y=this.Ub.iterator;y.next();)x=y.value,x instanceof Iu&&a.push(x);switch(this.sorting){case Lp:break;case bm:a.reverse();break;case Fm:a.sort(this.comparer);break;case Lm:a.sort(this.comparer),a.reverse();break;default:at("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(Gy(this,b,y+b.la.x,x+b.la.y),this.Rb){case lv:x+=b.Da.height+this.$d.height;break;case Ky:y+=b.Da.width+this.$d.width;break;default:at("Unhandled arrangement value "+this.Rb.toString())}}}};function Gy(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 ee=y[z];Gy(a,ee,x+ee.S.x,E+ee.S.y)}}}Bo.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},Bo.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)},Bo.prototype.Gu=function(){if(this.layerStyle===hv){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 Ie(-this.nodeSpacing/2,-this.layerSpacing/2)):(x.Bc(this.layerSpacing,this.nodeSpacing/2),E=new Ie(-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 ee=0;ee<a.length;ee++)z+=a[ee]+y[ee];for(ee=0;ee<a.length;ee++){var re=a[ee]+y[ee];this.angle===270?(z-=re,b.push(new Gt(0,z,x,re))):this.angle===90?(b.push(new Gt(0,z,x,re)),z+=re):this.angle===180?(z-=re,b.push(new Gt(z,0,re,x))):(b.push(new Gt(z,0,re,x)),z+=re)}this.commitLayers(b,E)}},Bo.prototype.commitLayers=function(){},Bo.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},Bo.prototype.yv=function(){for(var a=this.Ub.iterator;a.next();){var y=a.value;y instanceof Iu&&gS(this,y)}};function gS(a,y){if(y!==null){a.setPortSpots(y),y=y.children;for(var x=y.length,E=0;E<x;E++)gS(a,y[E])}}Bo.prototype.setPortSpots=function(a){var y=a.alignment;if(tf(y)){var x=this.ud===$h,E=nh(a);switch(E){case 0:var b=Lo;break;case 90:b=Ir;break;case 180:b=pa;break;default:b=Oo}var z=a.children,ee=z.length;switch(y){case lc:case td:for(y=0;y<ee;y++){var re=z[y];if(re=(x?re.sourceEdges:re.destinationEdges).first(),re!==null&&(re=re.link,re!==null)){var oe=E===90||E===270?pa:Oo;if(ee===1||y===ee-1&&ee%2===1)switch(E){case 0:oe=pa;break;case 90:oe=Oo;break;case 180:oe=Lo;break;default:oe=Ir}else y%2===0&&(oe=E===90||E===270?Lo:Ir);x?(a.setsPortSpot&&(re.fromSpot=b),a.setsChildPortSpot&&(re.toSpot=oe)):(a.setsPortSpot&&(re.fromSpot=oe),a.setsChildPortSpot&&(re.toSpot=b))}}break;case uc:for(E=E===90||E===270?Lo:Ir,z=x?a.destinationEdges:a.sourceEdges;z.next();)ee=z.value.link,ee!==null&&(x?(a.setsPortSpot&&(ee.fromSpot=b),a.setsChildPortSpot&&(ee.toSpot=E)):(a.setsPortSpot&&(ee.fromSpot=E),a.setsChildPortSpot&&(ee.toSpot=b)));break;case Fd:for(E=E===90||E===270?pa:Oo,z=x?a.destinationEdges:a.sourceEdges;z.next();)ee=z.value.link,ee!==null&&(x?(a.setsPortSpot&&(ee.fromSpot=b),a.setsChildPortSpot&&(ee.toSpot=E)):(a.setsPortSpot&&(ee.fromSpot=E),a.setsChildPortSpot&&(ee.toSpot=b)))}}else if(x=nh(a),this.ud===$h){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=Lo;break;case 90:E.fromSpot=Ir;break;case 180:E.fromSpot=pa;break;default:E.fromSpot=Oo}else E.fromSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.toSpot=pa;break;case 90:E.toSpot=Oo;break;case 180:E.toSpot=Lo;break;default:E.toSpot=Ir}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=Lo;break;case 90:E.toSpot=Ir;break;case 180:E.toSpot=pa;break;default:E.toSpot=Oo}else E.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.fromSpot=pa;break;case 90:E.fromSpot=Oo;break;case 180:E.fromSpot=Lo;break;default:E.fromSpot=Ir}else E.fromSpot=a.childPortSpot}};function nh(a){return a=a.angle,45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}Bo.prototype.computeLayerSpacing=function(a){var y=nh(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},Bo.prototype.computeNodeIndent=function(a){var y=nh(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)},fn.Object.defineProperties(Bo.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!==sv&&a!==Hy&&a!==Wy&&a!==Vy||(this.vo=a,this.C())}},layerStyle:{get:function(){return this.Bq},set:function(a){this.Rb===a||a!==Uy&&a!==Yy&&a!==hv||(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!==lv&&a!==Ky&&a!==uv||(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!==Lp&&a!==bm&&a!==Fm&&!Lm||(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()):at("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!==av&&a!==Bm||(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!==Lp&&a!==bm&&a!==Fm&&!Lm||(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!==av&&a!==Bm||(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 ov=new Ot(Bo,"PathDefault",-1),$h=new Ot(Bo,"PathDestination",0),Ag=new Ot(Bo,"PathSource",1),Lp=new Ot(Bo,"SortingForwards",10),bm=new Ot(Bo,"SortingReverse",11),Fm=new Ot(Bo,"SortingAscending",12),Lm=new Ot(Bo,"SortingDescending",13),Bp=new Ot(Bo,"AlignmentCenterSubtrees",20),Ng=new Ot(Bo,"AlignmentCenterChildren",21),qh=new Ot(Bo,"AlignmentStart",22),ed=new Ot(Bo,"AlignmentEnd",23),lc=new Ot(Bo,"AlignmentBus",24),td=new Ot(Bo,"AlignmentBusBranching",25),uc=new Ot(Bo,"AlignmentTopLeftBus",26),Fd=new Ot(Bo,"AlignmentBottomRightBus",27),av=new Ot(Bo,"CompactionNone",30),Bm=new Ot(Bo,"CompactionBlock",31),sv=new Ot(Bo,"StyleLayered",40),Wy=new Ot(Bo,"StyleLastParents",41),Hy=new Ot(Bo,"StyleAlternating",42),Vy=new Ot(Bo,"StyleRootOnly",43),lv=new Ot(Bo,"ArrangementVertical",50),Ky=new Ot(Bo,"ArrangementHorizontal",51),uv=new Ot(Bo,"ArrangementFixedRoots",52),Uy=new Ot(Bo,"LayerIndividual",60),Yy=new Ot(Bo,"LayerSiblings",61),hv=new Ot(Bo,"LayerUniform",62);Bo.className="TreeLayout",Bo.PathDefault=ov,Bo.PathDestination=$h,Bo.PathSource=Ag,Bo.SortingForwards=Lp,Bo.SortingReverse=bm,Bo.SortingAscending=Fm,Bo.SortingDescending=Lm,Bo.AlignmentCenterSubtrees=Bp,Bo.AlignmentCenterChildren=Ng,Bo.AlignmentStart=qh,Bo.AlignmentEnd=ed,Bo.AlignmentBus=lc,Bo.AlignmentBusBranching=td,Bo.AlignmentTopLeftBus=uc,Bo.AlignmentBottomRightBus=Fd,Bo.CompactionNone=av,Bo.CompactionBlock=Bm,Bo.StyleLayered=sv,Bo.StyleLastParents=Wy,Bo.StyleAlternating=Hy,Bo.StyleRootOnly=Vy,Bo.ArrangementVertical=lv,Bo.ArrangementHorizontal=Ky,Bo.ArrangementFixedRoots=uv,Bo.LayerIndividual=Uy,Bo.LayerSiblings=Yy,Bo.LayerUniform=hv;function Dg(a){za.call(this,a)}_t(Dg,za),Dg.prototype.createVertex=function(){return new Iu(this)},Dg.prototype.createEdge=function(){return new Mp(this)},Dg.className="TreeNetwork";function Iu(a){bs.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 Ie(0,0),this.Da=new Pn(0,0),this.la=new Ie(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=Lp,this.hd=gy,this.Kb=0,this.Jb=Ng,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=Bm,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=or,this.wr=!0,this.Dp=or}_t(Iu,bs),Iu.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)},fn.Object.defineProperties(Iu.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)}}}),Iu.className="TreeVertex";function Mp(a){iu.call(this,a),this.$t=new Ie(0,0)}_t(Mp,iu),Mp.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 $h:x=this.fromVertex,E=this.toVertex;break;case Ag:x=this.toVertex,E=this.fromVertex;break;default:at("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=nh(x),ee=y.computeLayerSpacing(x),re=x.rowSpacing;a.vg();var oe=a.curve===fu,ue=a.isOrthogonal,he;if(a.uh(),ue||oe){for(he=2;4<a.pointsCount;)a.pv(2);var pe=a.i(1),Se=a.i(2)}else{for(he=1;3<a.pointsCount;)a.pv(1);pe=a.i(0),Se=a.i(a.pointsCount-1)}var Pe=a.i(a.pointsCount-1);z===0?(x.alignment===ed?(z=E.bottom+b.y,b.y===0&&pe.y>Pe.y+x.rowIndent&&(z=Math.min(z,Math.max(pe.y,z-y.computeNodeIndent(x))))):x.alignment===qh?(z=E.top+b.y,b.y===0&&pe.y<Pe.y-x.rowIndent&&(z=Math.max(z,Math.min(pe.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,oe?(a.m(he,pe.x,z),he++,a.m(he,E.right+ee,z),he++,a.m(he,E.right+ee+(b.x-re)/3,z),he++,a.m(he,E.right+ee+2*(b.x-re)/3,z),he++,a.m(he,E.right+ee+(b.x-re),z),he++,a.m(he,Se.x,z)):(ue&&(a.m(he,E.right+ee/2,pe.y),he++),a.m(he,E.right+ee/2,z),he++,a.m(he,E.right+ee+b.x-(ue?re/2:re),z),he++,ue&&a.m(he,a.i(he-1).x,Se.y))):z===90?(x.alignment===ed?(z=E.right+b.x,b.x===0&&pe.x>Pe.x+x.rowIndent&&(z=Math.min(z,Math.max(pe.x,z-y.computeNodeIndent(x))))):x.alignment===qh?(z=E.left+b.x,b.x===0&&pe.x<Pe.x-x.rowIndent&&(z=Math.max(z,Math.min(pe.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,oe?(a.m(he,z,pe.y),he++,a.m(he,z,E.bottom+ee),he++,a.m(he,z,E.bottom+ee+(b.y-re)/3),he++,a.m(he,z,E.bottom+ee+2*(b.y-re)/3),he++,a.m(he,z,E.bottom+ee+(b.y-re)),he++,a.m(he,z,Se.y)):(ue&&(a.m(he,pe.x,E.bottom+ee/2),he++),a.m(he,z,E.bottom+ee/2),he++,a.m(he,z,E.bottom+ee+b.y-(ue?re/2:re)),he++,ue&&a.m(he,Se.x,a.i(he-1).y))):z===180?(x.alignment===ed?(z=E.bottom+b.y,b.y===0&&pe.y>Pe.y+x.rowIndent&&(z=Math.min(z,Math.max(pe.y,z-y.computeNodeIndent(x))))):x.alignment===qh?(z=E.top+b.y,b.y===0&&pe.y<Pe.y-x.rowIndent&&(z=Math.max(z,Math.min(pe.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,oe?(a.m(he,pe.x,z),he++,a.m(he,E.left-ee,z),he++,a.m(he,E.left-ee+(b.x+re)/3,z),he++,a.m(he,E.left-ee+2*(b.x+re)/3,z),he++,a.m(he,E.left-ee+(b.x+re),z),he++,a.m(he,Se.x,z)):(ue&&(a.m(he,E.left-ee/2,pe.y),he++),a.m(he,E.left-ee/2,z),he++,a.m(he,E.left-ee+b.x+(ue?re/2:re),z),he++,ue&&a.m(he,a.i(he-1).x,Se.y))):z===270?(x.alignment===ed?(z=E.right+b.x,b.x===0&&pe.x>Pe.x+x.rowIndent&&(z=Math.min(z,Math.max(pe.x,z-y.computeNodeIndent(x))))):x.alignment===qh?(z=E.left+b.x,b.x===0&&pe.x<Pe.x-x.rowIndent&&(z=Math.max(z,Math.min(pe.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,oe?(a.m(he,z,pe.y),he++,a.m(he,z,E.top-ee),he++,a.m(he,z,E.top-ee+(b.y+re)/3),he++,a.m(he,z,E.top-ee+2*(b.y+re)/3),he++,a.m(he,z,E.top-ee+(b.y+re)),he++,a.m(he,z,Se.y)):(ue&&(a.m(he,pe.x,E.top-ee/2),he++),a.m(he,z,E.top-ee/2),he++,a.m(he,z,E.top-ee+b.y+(ue?re/2:re)),he++,ue&&a.m(he,Se.x,a.i(he-1).y))):at("Invalid angle "+z),a.zf()}else b=E,a=this.link,E=this.network.layout,y=nh(x),y!==nh(b)&&(ee=E.computeLayerSpacing(x),re=x.bounds,x=b.bounds,y===0&&x.left-re.right<ee+1||y===90&&x.top-re.bottom<ee+1||y===180&&re.left-x.right<ee+1||y===270&&re.top-x.bottom<ee+1||(a.vg(),x=a.curve===fu,b=a.isOrthogonal,E=tf(this.fromVertex.alignment),a.uh(),y===0?(y=re.right+ee/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=re.bottom+ee/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=re.left-ee/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=re.top-ee/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()))}}},fn.Object.defineProperties(Mp.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)}}}),Mp.className="TreeEdge",Eo.prototype.initializeStandardTools=function(){this.gb("Action",new hu,this.mouseDownTools),this.gb("Relinking",new Bs,this.mouseDownTools),this.gb("LinkReshaping",new Hr,this.mouseDownTools),this.gb("Rotating",new ms,this.mouseDownTools),this.gb("Resizing",new Ss,this.mouseDownTools),this.gb("Linking",new Fa,this.mouseMoveTools),this.gb("Dragging",new ka,this.mouseMoveTools),this.gb("DragSelecting",new Rl,this.mouseMoveTools),this.gb("Panning",new js,this.mouseMoveTools),this.gb("ContextMenu",new tl,this.mouseUpTools),this.gb("TextEditing",new Aa,this.mouseUpTools),this.gb("ClickCreating",new Sh,this.mouseUpTools),this.gb("ClickSelecting",new Ql,this.mouseUpTools)},Ah("Horizontal",new jm),Ah("Spot",new Zm),Ah("Table",new Wm),Ah("Viewbox",new Km),Ah("TableRow",new Hm),Ah("TableColumn",new Vm),Ah("Graduated",new Hp),Ah("Grid",new Wp),Ff.add("GraphLinksModel",Is),Ff.add("TreeModel",Pu);var dv=xn.go,Xy={get licenseKey(){return Vt.licenseKey},set licenseKey(a){Vt.licenseKey=a},get version(){return Vt.version},Group:no,EnumValue:Ot,List:Bn,Set:In,Map:Rt,Point:Ie,Size:Pn,Rect:Gt,Margin:$r,Spot:Xi,Geometry:ut,PathFigure:Zr,PathSegment:mr,InputEvent:vr,DiagramEvent:so,ChangedEvent:er,Model:ar,GraphLinksModel:zo,TreeModel:El,Binding:ds,Transaction:_a,UndoManager:jr,CommandHandler:Ye,Tool:vo,DraggingTool:ka,DraggingInfo:Uu,DraggingOptions:ae,LinkingBaseTool:uo,LinkingTool:Fa,RelinkingTool:Bs,LinkReshapingTool:Hr,ResizingTool:Ss,RotatingTool:ms,ClickSelectingTool:Ql,ActionTool:hu,ClickCreatingTool:Sh,HTMLInfo:Zu,ContextMenuTool:tl,DragSelectingTool:Rl,PanningTool:js,TextEditingTool:Aa,ToolManager:Eo,Animation:zs,AnimationManager:kl,AnimationTrigger:xu,Layer:ws,Diagram:Vt,Palette:fe,Overview:me,Brush:$o,GraphObject:Ft,Panel:Wn,RowColumnDefinition:vs,Shape:lo,TextBlock:ja,Picture:Dl,Part:pr,Adornment:Yo,Node:Fi,Link:$n,Placeholder:xl,Layout:Va,LayoutNetwork:za,LayoutVertex:bs,LayoutEdge:iu,GridLayout:Hs,PanelLayout:Cs,CircularLayout:Ya,CircularNetwork:Cp,CircularVertex:ym,CircularEdge:V0,ForceDirectedLayout:$s,ForceDirectedNetwork:Mg,ForceDirectedVertex:xm,ForceDirectedEdge:Sm,LayeredDigraphLayout:wa,LayeredDigraphNetwork:Fp,LayeredDigraphVertex:Cu,LayeredDigraphEdge:Em,TreeLayout:Bo,TreeNetwork:Dg,TreeVertex:Iu,TreeEdge:Mp};typeof dv=="object"&&dv.version&&li("WARNING: a `go` object on the root object is already defined. "+("Debug"in dv?"debug ":"")+"version: "+dv.version+", replaced with version: "+Xy.version),Vt.prototype.go=Xy,xn.go=Xy,typeof Zn.exports=="object"&&(Zn.exports=typeof Le.g!="undefined"?Le.g.go:self.go)}();var le=typeof Le.g!="undefined"?Le.g.go:self.go;const Ke=typeof Le.g!="undefined"?Le.g.go:self.go,it=Ke.Group,bt=Ke.EnumValue,vt=Ke.List,Oe=Ke.Set,st=Ke.Map,Et=Ke.Point,ot=Ke.Size,We=Ke.Rect,Tt=Ke.Margin,ct=Ke.Spot,At=Ke.Geometry,De=Ke.PathFigure,ne=Ke.PathSegment,te=Ke.InputEvent,de=Ke.DiagramEvent,se=Ke.ChangedEvent,ge=Ke.Model,ye=Ke.GraphLinksModel,we=Ke.TreeModel,Ce=Ke.Binding,_e=Ke.Transaction,Ze=Ke.UndoManager,lt=Ke.CommandHandler,Qe=Ke.Tool,Ue=Ke.DraggingTool,dt=Ke.DraggingInfo,$e=Ke.LinkingBaseTool,wt=Ke.LinkingTool,St=Ke.RelinkingTool,Lt=Ke.LinkReshapingTool,pn=Ke.ResizingTool,en=Ke.RotatingTool,vn=Ke.ClickSelectingTool,rn=Ke.ActionTool,nt=Ke.ClickCreatingTool,rt=Ke.HTMLInfo,dn=Ke.ContextMenuTool,ri=Ke.DragSelectingTool,Hn=Ke.PanningTool,Wt=Ke.TextEditingTool,En=Ke.ToolManager,An=Ke.Animation,ci=Ke.AnimationManager,It=Ke.AnimationTrigger,Pt=Ke.Layer,Nt=Ke.Diagram,ii=Ke.Palette,Gi=Ke.Overview,ze=Ke.Brush,Me=Ke.GraphObject,Ee=Ke.Panel,Te=Ke.RowColumnDefinition,He=Ke.Shape,Ae=Ke.TextBlock,qe=Ke.TextBlockMetrics,an=Ke.Picture,Xt=Ke.Part,yn=Ke.Adornment,kt=Ke.Node,Dt=Ke.Link,Zt=Ke.Placeholder,hn=Ke.Layout,wn=Ke.LayoutNetwork,Dn=Ke.LayoutVertex,Tn=Ke.LayoutEdge,Mi=Ke.GridLayout,tn=Ke.PanelLayout,qt=Ke.CircularLayout,un=Ke.CircularNetwork,zn=Ke.CircularVertex,on=Ke.CircularEdge,Sn=Ke.ForceDirectedLayout,di=Ke.ForceDirectedNetwork,Ui=Ke.ForceDirectedVertex,gi=Ke.ForceDirectedEdge,Hi=Ke.LayeredDigraphLayout,kr=Ke.LayeredDigraphNetwork,Gn=Ke.LayeredDigraphVertex,On=Ke.LayeredDigraphEdge,Xn=Ke.TreeLayout,wi=Ke.TreeNetwork,nr=Ke.TreeVertex,ji=Ke.TreeEdge,Cr=Ke.version},24334:function(Zn,ei,Le){var le,Ke;(function(it,bt){Zn.exports=bt(it)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Le.g!="undefined"?Le.g:this,function(it){"use strict";it=it||{};var bt=it.Base64,vt="2.6.4",Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",st=function(St){for(var Lt={},pn=0,en=St.length;pn<en;pn++)Lt[St.charAt(pn)]=pn;return Lt}(Oe),Et=String.fromCharCode,ot=function(St){if(St.length<2){var Lt=St.charCodeAt(0);return Lt<128?St:Lt<2048?Et(192|Lt>>>6)+Et(128|Lt&63):Et(224|Lt>>>12&15)+Et(128|Lt>>>6&63)+Et(128|Lt&63)}else{var Lt=65536+(St.charCodeAt(0)-55296)*1024+(St.charCodeAt(1)-56320);return Et(240|Lt>>>18&7)+Et(128|Lt>>>12&63)+Et(128|Lt>>>6&63)+Et(128|Lt&63)}},We=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Tt=function(St){return St.replace(We,ot)},ct=function(St){var Lt=[0,2,1][St.length%3],pn=St.charCodeAt(0)<<16|(St.length>1?St.charCodeAt(1):0)<<8|(St.length>2?St.charCodeAt(2):0),en=[Oe.charAt(pn>>>18),Oe.charAt(pn>>>12&63),Lt>=2?"=":Oe.charAt(pn>>>6&63),Lt>=1?"=":Oe.charAt(pn&63)];return en.join("")},At=it.btoa&&typeof it.btoa=="function"?function(St){return it.btoa(St)}:function(St){if(St.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return St.replace(/[\s\S]{1,3}/g,ct)},De=function(St){return At(Tt(String(St)))},ne=function(St){return St.replace(/[+\/]/g,function(Lt){return Lt=="+"?"-":"_"}).replace(/=/g,"")},te=function(St,Lt){return Lt?ne(De(St)):De(St)},de=function(St){return te(St,!0)},se;it.Uint8Array&&(se=function(St,Lt){for(var pn="",en=0,vn=St.length;en<vn;en+=3){var rn=St[en],nt=St[en+1],rt=St[en+2],dn=rn<<16|nt<<8|rt;pn+=Oe.charAt(dn>>>18)+Oe.charAt(dn>>>12&63)+(typeof nt!="undefined"?Oe.charAt(dn>>>6&63):"=")+(typeof rt!="undefined"?Oe.charAt(dn&63):"=")}return Lt?ne(pn):pn});var ge=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ye=function(St){switch(St.length){case 4:var Lt=(7&St.charCodeAt(0))<<18|(63&St.charCodeAt(1))<<12|(63&St.charCodeAt(2))<<6|63&St.charCodeAt(3),pn=Lt-65536;return Et((pn>>>10)+55296)+Et((pn&1023)+56320);case 3:return Et((15&St.charCodeAt(0))<<12|(63&St.charCodeAt(1))<<6|63&St.charCodeAt(2));default:return Et((31&St.charCodeAt(0))<<6|63&St.charCodeAt(1))}},we=function(St){return St.replace(ge,ye)},Ce=function(St){var Lt=St.length,pn=Lt%4,en=(Lt>0?st[St.charAt(0)]<<18:0)|(Lt>1?st[St.charAt(1)]<<12:0)|(Lt>2?st[St.charAt(2)]<<6:0)|(Lt>3?st[St.charAt(3)]:0),vn=[Et(en>>>16),Et(en>>>8&255),Et(en&255)];return vn.length-=[0,0,2,1][pn],vn.join("")},_e=it.atob&&typeof it.atob=="function"?function(St){return it.atob(St)}:function(St){return St.replace(/\S{1,4}/g,Ce)},Ze=function(St){return _e(String(St).replace(/[^A-Za-z0-9\+\/]/g,""))},lt=function(St){return we(_e(St))},Qe=function(St){return String(St).replace(/[-_]/g,function(Lt){return Lt=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},Ue=function(St){return lt(Qe(St))},dt;it.Uint8Array&&(dt=function(St){return Uint8Array.from(Ze(Qe(St)),function(Lt){return Lt.charCodeAt(0)})});var $e=function(){var St=it.Base64;return it.Base64=bt,St};if(it.Base64={VERSION:vt,atob:Ze,btoa:At,fromBase64:Ue,toBase64:te,utob:Tt,encode:te,encodeURI:de,btou:we,decode:Ue,noConflict:$e,fromUint8Array:se,toUint8Array:dt},typeof Object.defineProperty=="function"){var wt=function(St){return{value:St,enumerable:!1,writable:!0,configurable:!0}};it.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",wt(function(){return Ue(this)})),Object.defineProperty(String.prototype,"toBase64",wt(function(St){return te(this,St)})),Object.defineProperty(String.prototype,"toBase64URI",wt(function(){return te(this,!0)}))}}return it.Meteor&&(Base64=it.Base64),Zn.exports?Zn.exports.Base64=it.Base64:(le=[],Ke=function(){return it.Base64}.apply(ei,le),Ke!==void 0&&(Zn.exports=Ke)),{Base64:it.Base64}})},2859:function(Zn,ei,Le){"use strict";Le.d(ei,{hP:function(){return Gi}});var le=function(ze,Me){return(le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Ee,Te){Ee.__proto__=Te}||function(Ee,Te){for(var He in Te)Object.prototype.hasOwnProperty.call(Te,He)&&(Ee[He]=Te[He])})(ze,Me)};function Ke(ze,Me){function Ee(){this.constructor=ze}le(ze,Me),ze.prototype=Me===null?Object.create(Me):(Ee.prototype=Me.prototype,new Ee)}function it(ze,Me,Ee,Te){return new(Ee||(Ee=Promise))(function(He,Ae){function qe(yn){try{Xt(Te.next(yn))}catch(kt){Ae(kt)}}function an(yn){try{Xt(Te.throw(yn))}catch(kt){Ae(kt)}}function Xt(yn){var kt;yn.done?He(yn.value):(kt=yn.value,kt instanceof Ee?kt:new Ee(function(Dt){Dt(kt)})).then(qe,an)}Xt((Te=Te.apply(ze,Me||[])).next())})}function bt(ze,Me){var Ee,Te,He,Ae,qe={label:0,sent:function(){if(1&He[0])throw He[1];return He[1]},trys:[],ops:[]};return Ae={next:an(0),throw:an(1),return:an(2)},typeof Symbol=="function"&&(Ae[Symbol.iterator]=function(){return this}),Ae;function an(Xt){return function(yn){return function(kt){if(Ee)throw new TypeError("Generator is already executing.");for(;qe;)try{if(Ee=1,Te&&(He=2&kt[0]?Te.return:kt[0]?Te.throw||((He=Te.return)&&He.call(Te),0):Te.next)&&!(He=He.call(Te,kt[1])).done)return He;switch(Te=0,He&&(kt=[2&kt[0],He.value]),kt[0]){case 0:case 1:He=kt;break;case 4:return qe.label++,{value:kt[1],done:!1};case 5:qe.label++,Te=kt[1],kt=[0];continue;case 7:kt=qe.ops.pop(),qe.trys.pop();continue;default:if(He=qe.trys,!((He=He.length>0&&He[He.length-1])||kt[0]!==6&&kt[0]!==2)){qe=0;continue}if(kt[0]===3&&(!He||kt[1]>He[0]&&kt[1]<He[3])){qe.label=kt[1];break}if(kt[0]===6&&qe.label<He[1]){qe.label=He[1],He=kt;break}if(He&&qe.label<He[2]){qe.label=He[2],qe.ops.push(kt);break}He[2]&&qe.ops.pop(),qe.trys.pop();continue}kt=Me.call(ze,qe)}catch(Dt){kt=[6,Dt],Te=0}finally{Ee=He=0}if(5&kt[0])throw kt[1];return{value:kt[0]?kt[1]:void 0,done:!0}}([Xt,yn])}}}function vt(){for(var ze=0,Me=0,Ee=arguments.length;Me<Ee;Me++)ze+=arguments[Me].length;var Te=Array(ze),He=0;for(Me=0;Me<Ee;Me++)for(var Ae=arguments[Me],qe=0,an=Ae.length;qe<an;qe++,He++)Te[He]=Ae[qe];return Te}var Oe=function(){function ze(){}return ze.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ze.setAttributes=function(Me,Ee){for(var Te=0,He=Ee;Te<He.length;Te++){var Ae=He[Te],qe=Ae[0],an=Ae[1];Me.setAttribute(qe,an)}},ze.createRect=function(Me,Ee,Te){var He=document.createElementNS("http://www.w3.org/2000/svg","rect");return He.setAttribute("width",Me.toString()),He.setAttribute("height",Ee.toString()),Te&&ze.setAttributes(He,Te),He},ze.createLine=function(Me,Ee,Te,He,Ae){var qe=document.createElementNS("http://www.w3.org/2000/svg","line");return qe.setAttribute("x1",Me.toString()),qe.setAttribute("y1",Ee.toString()),qe.setAttribute("x2",Te.toString()),qe.setAttribute("y2",He.toString()),Ae&&ze.setAttributes(qe,Ae),qe},ze.createPolygon=function(Me,Ee){var Te=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Te.setAttribute("points",Me),Ee&&ze.setAttributes(Te,Ee),Te},ze.createCircle=function(Me,Ee){var Te=document.createElementNS("http://www.w3.org/2000/svg","circle");return Te.setAttribute("cx",(Me/2).toString()),Te.setAttribute("cy",(Me/2).toString()),Te.setAttribute("r",Me.toString()),Ee&&ze.setAttributes(Te,Ee),Te},ze.createEllipse=function(Me,Ee,Te){var He=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return He.setAttribute("cx",(Me/2).toString()),He.setAttribute("cy",(Ee/2).toString()),He.setAttribute("rx",(Me/2).toString()),He.setAttribute("ry",(Ee/2).toString()),Te&&ze.setAttributes(He,Te),He},ze.createGroup=function(Me){var Ee=document.createElementNS("http://www.w3.org/2000/svg","g");return Me&&ze.setAttributes(Ee,Me),Ee},ze.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ze.createMarker=function(Me,Ee,Te,He,Ae,qe,an){var Xt=document.createElementNS("http://www.w3.org/2000/svg","marker");return ze.setAttributes(Xt,[["id",Me],["orient",Ee],["markerWidth",Te.toString()],["markerHeight",He.toString()],["refX",Ae.toString()],["refY",qe.toString()]]),Xt.appendChild(an),Xt},ze.createText=function(Me){var Ee=document.createElementNS("http://www.w3.org/2000/svg","text");return Ee.setAttribute("x","0"),Ee.setAttribute("y","0"),Me&&ze.setAttributes(Ee,Me),Ee},ze.createTSpan=function(Me,Ee){var Te=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Te.textContent=Me,Ee&&ze.setAttributes(Te,Ee),Te},ze.createImage=function(Me){var Ee=document.createElementNS("http://www.w3.org/2000/svg","image");return Me&&ze.setAttributes(Ee,Me),Ee},ze.createPoint=function(Me,Ee){var Te=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Te.x=Me,Te.y=Ee,Te},ze.createPath=function(Me,Ee){var Te=document.createElementNS("http://www.w3.org/2000/svg","path");return Te.setAttribute("d",Me),Ee&&ze.setAttributes(Te,Ee),Te},ze}(),st=function(){function ze(){}return ze.addKey=function(Me){ze.key=Me},Object.defineProperty(ze,"isLicensed",{get:function(){return!!ze.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ze.key)},enumerable:!1,configurable:!0}),ze}(),Et=function(){function ze(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ze.prototype.rasterize=function(Me,Ee,Te){var He=this;return new Promise(function(Ae){var qe=Te!==void 0?Te:document.createElement("canvas");Me===null&&(He.markersOnly=!0,He.naturalSize=!1);var an=document.createElementNS("http://www.w3.org/2000/svg","svg");an.setAttribute("xmlns","http://www.w3.org/2000/svg"),an.setAttribute("width",Ee.width.baseVal.valueAsString),an.setAttribute("height",Ee.height.baseVal.valueAsString),an.setAttribute("viewBox","0 0 "+Ee.viewBox.baseVal.width.toString()+" "+Ee.viewBox.baseVal.height.toString()),an.innerHTML=Ee.innerHTML,He.naturalSize===!0?(an.width.baseVal.value=Me.naturalWidth,an.height.baseVal.value=Me.naturalHeight):He.width!==void 0&&He.height!==void 0&&(an.width.baseVal.value=He.width,an.height.baseVal.value=He.height),qe.width=an.width.baseVal.value,qe.height=an.height.baseVal.value;var Xt=an.outerHTML,yn=qe.getContext("2d");He.markersOnly!==!0&&yn.drawImage(Me,0,0,qe.width,qe.height);var kt=window.URL,Dt=new Image(qe.width,qe.height);Dt.setAttribute("crossOrigin","anonymous");var Zt=new Blob([Xt],{type:"image/svg+xml"}),hn=kt.createObjectURL(Zt);Dt.onload=function(){yn.drawImage(Dt,0,0),kt.revokeObjectURL(hn);var wn=qe.toDataURL(He.imageType,He.imageQuality);Ae(wn)},Dt.src=hn})},ze}(),ot=function(){},We=function(){function ze(Me){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Me+"_"}return Object.defineProperty(ze.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ze.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(ze.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ze.prototype.addClass=function(Me){return this.styleSheet===void 0&&this.addStyleSheet(),Me.name=""+this.classNamePrefix+Me.localName,this.classes.push(Me),this.styleSheet.sheet.insertRule("."+Me.name+" {"+Me.style+"}",this.styleSheet.sheet.cssRules.length),Me},ze.prototype.addRule=function(Me){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(Me),this.styleSheet.sheet.insertRule(Me.selector+" {"+Me.style+"}",this.styleSheet.sheet.cssRules.length)},ze.prototype.addStyleSheet=function(){var Me;this.styleSheet=document.createElement("style"),((Me=this.styleSheetRoot)!==null&&Me!==void 0?Me:document.head).appendChild(this.styleSheet),this.addRule(new Tt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Tt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Tt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ct("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ct("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ze.prototype.removeStyleSheet=function(){var Me;this.styleSheet&&(((Me=this.styleSheetRoot)!==null&&Me!==void 0?Me:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ze}(),Tt=function(ze,Me){this.selector=ze,this.style=Me},ct=function(ze,Me){this.localName=ze,this.style=Me},At=function(){function ze(Me,Ee,Te,He,Ae){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=Me,this.displayMode=Ee,this.markerItems=Te,this.uiStyleSettings=He,this.styles=Ae,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ze.prototype.show=function(Me){var Ee=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Me,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Te=document.createElement("div");Te.className=this.toolbarBlockStyleClass.name,Te.style.whiteSpace="nowrap",this.uiContainer.appendChild(Te),this.addActionButton(Te,'<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(Te,'<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(Te,'<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(Te,'<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(Te,'<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(Te,'<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(Te,'<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(Te,'<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(Ae){var qe=document.createElement("div");qe.className=""+Ee.toolbarButtonStyleClass.name,qe.setAttribute("data-type-name",Ae.typeName),qe.innerHTML=Ae.icon,qe.addEventListener("click",function(){Ee.markerToolbarButtonClicked(qe,Ae)}),Ee.buttons.push(qe),Ee.markerButtons.push(qe)}),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 He=document.createElement("div");He.className=this.toolbarBlockStyleClass.name,He.style.whiteSpace="nowrap",He.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(He),this.addActionButton(He,'<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(He,'<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()},ze.prototype.addButtonClickListener=function(Me){this.buttonClickListeners.push(Me)},ze.prototype.removeButtonClickListener=function(Me){this.buttonClickListeners.indexOf(Me)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(Me),1)},ze.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ze.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var Me=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var Ee=0;Ee<this.markerButtons.length;Ee++)Ee<Me||Ee===Me&&this.markerButtons.length-1===Me?this.markerButtonBlock.appendChild(this.markerButtons[Ee]):(Ee===Me&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[Ee]))}},ze.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")},ze.prototype.resetButtonStyles=function(){var Me=this;this.buttons.forEach(function(Ee){Ee.className=Ee.className.replace(Me.uiStyleSettings.toolbarButtonStyleColorsClassName?Me.uiStyleSettings.toolbarButtonStyleColorsClassName:Me.toolbarButtonStyleColorsClass.name,"").trim(),Ee.className=Ee.className.replace(Me.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?Me.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:Me.toolbarActiveButtonStyleColorsClass.name,"").trim(),Ee.className+=" "+(Me.uiStyleSettings.toolbarButtonStyleColorsClassName?Me.uiStyleSettings.toolbarButtonStyleColorsClassName:Me.toolbarButtonStyleColorsClass.name)})},ze.prototype.addActionButton=function(Me,Ee,Te){var He=this,Ae=document.createElement("div");switch(Ae.className=""+this.toolbarButtonStyleClass.name,Ae.innerHTML=Ee,Ae.setAttribute("data-action",Te),Ae.addEventListener("click",function(){He.actionToolbarButtonClicked(Ae,Te)}),Te){case"select":Ae.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Ae.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Ae.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Ae.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Ae.style.fill=this.uiStyleSettings.closeButtonColor}Me.appendChild(Ae),this.buttons.push(Ae)},ze.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ct("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 ct("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ct("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ct("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 ct("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var Me=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ct("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*Me)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*Me)+`px;
padding: `+Me+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ct("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ct("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Tt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Tt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},ze.prototype.markerToolbarButtonClicked=function(Me,Ee){this.setActiveButton(Me),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Te){return Te("marker",Ee)}),this.markerButtonOverflowBlock.style.display="none"},ze.prototype.actionToolbarButtonClicked=function(Me,Ee){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Te){return Te("action",Ee)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ze.prototype.setActiveButton=function(Me){this.resetButtonStyles(),Me.className=Me.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),Me.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ze.prototype.setActiveMarkerButton=function(Me){var Ee=this.markerButtons.find(function(Te){return Te.getAttribute("data-type-name")===Me});Ee&&this.setActiveButton(Ee)},ze.prototype.setCurrentMarker=function(Me){var Ee=this;this.currentMarker=Me,this.buttons.filter(function(Te){return/delete|notes/.test(Te.getAttribute("data-action"))}).forEach(function(Te){Ee.currentMarker===void 0?(Te.style.fillOpacity="0.4",Te.style.pointerEvents="none"):(Te.style.fillOpacity="1",Te.style.pointerEvents="all")})},ze}(),De=function(){function ze(Me,Ee,Te,He){this.panels=[],this.panelButtons=[],this.markerjsContainer=Me,this.displayMode=Ee,this.uiStyleSettings=Te,this.styles=He,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ze.prototype.addStyles=function(){var Me;this.toolboxStyleClass=this.styles.addClass(new ct("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 ct("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var Ee=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ct("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ct("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ct("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 ct("toolbox-panel-row_colors",`
background-color: `+((Me=this.uiStyleSettings.toolboxBackgroundColor)!==null&&Me!==void 0?Me:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ct("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*Ee)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*Ee)+`px;
padding: `+Ee+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ct("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ct("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Tt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Tt("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},ze.prototype.show=function(Me){var Ee;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Me,this.uiContainer.className=this.toolboxStyleClass.name+" "+((Ee=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&Ee!==void 0?Ee:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ze.prototype.setPanelButtons=function(Me){var Ee,Te,He=this;this.panels=Me,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((Ee=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&Ee!==void 0?Ee:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Te=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Te!==void 0?Te:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Ae){var qe;Ae.uiStyleSettings=He.uiStyleSettings;var an=document.createElement("div");an.className=He.toolboxButtonStyleClass.name+" "+((qe=He.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&qe!==void 0?qe:He.toolboxButtonStyleColorsClass.name),an.innerHTML=Ae.icon,an.title=Ae.title,an.addEventListener("click",function(){He.panelButtonClick(Ae)}),He.panelButtons.push(an),He.buttonRow.appendChild(an)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ze.prototype.panelButtonClick=function(Me){var Ee=this,Te=-1;if(Me!==this.activePanel){Te=this.panels.indexOf(Me),this.panelRow.innerHTML="";var He=Me.getUi();He.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(He),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=Me}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){Ee.displayMode==="inline"?Ee.panelRow.style.display="none":Ee.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Ae,qe){var an,Xt;Ae.className=Ee.toolboxButtonStyleClass.name+" "+(qe===Te?""+((an=Ee.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&an!==void 0?an:Ee.toolboxActiveButtonStyleColorsClass.name):""+((Xt=Ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Xt!==void 0?Xt:Ee.toolboxButtonStyleColorsClass.name))})},ze}(),ne=function(ze,Me){this.title=ze,this.icon=Me},te=function(ze){function Me(Ee,Te,He,Ae){var qe=ze.call(this,Ee,Ae||'<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 qe.colors=[],qe.addTransparent=!1,qe.colorBoxes=[],qe.colors=Te,qe.currentColor=He,qe.setCurrentColor=qe.setCurrentColor.bind(qe),qe.getColorBox=qe.getColorBox.bind(qe),qe}return Ke(Me,ze),Me.prototype.getUi=function(){var Ee=this,Te=document.createElement("div");return Te.style.overflow="hidden",Te.style.whiteSpace="nowrap",this.colors.forEach(function(He){var Ae=Ee.getColorBox(He);Te.appendChild(Ae),Ee.colorBoxes.push(Ae)}),Te},Me.prototype.getColorBox=function(Ee){var Te=this,He=this.uiStyleSettings.toolbarHeight/4,Ae=this.uiStyleSettings.toolbarHeight-He,qe=document.createElement("div");qe.style.display="inline-block",qe.style.boxSizing="content-box",qe.style.width=Ae-2+"px",qe.style.height=Ae-2+"px",qe.style.padding="1px",qe.style.marginRight="2px",qe.style.marginBottom="2px",qe.style.borderWidth="2px",qe.style.borderStyle="solid",qe.style.borderRadius=(Ae+2)/2+"px",qe.style.borderColor=Ee===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",qe.addEventListener("click",function(){Te.setCurrentColor(Ee,qe)});var an=document.createElement("div");return an.style.display="inline-block",an.style.width=Ae-2+"px",an.style.height=Ae-2+"px",an.style.backgroundColor=Ee,an.style.borderRadius=Ae/2+"px",Ee==="transparent"&&(an.style.fill=this.uiStyleSettings.toolboxAccentColor,an.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>`),qe.appendChild(an),qe},Me.prototype.setCurrentColor=function(Ee,Te){var He=this;this.currentColor=Ee,this.colorBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===Te?He.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(Ee)},Me}(ne),de=function(){function ze(Me,Ee,Te){this._state="new",this._isSelected=!1,this._container=Me,this._overlayContainer=Ee,this.globalSettings=Te,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ze.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ze.prototype.ownsTarget=function(Me){return!1},Object.defineProperty(ze.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ze.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ze.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ze.prototype.pointerDown=function(Me,Ee){},ze.prototype.dblClick=function(Me,Ee){},ze.prototype.manipulate=function(Me){},ze.prototype.pointerUp=function(Me){this.stateChanged()},ze.prototype.dispose=function(){},ze.prototype.addMarkerVisualToContainer=function(Me){this.container.childNodes.length>0?this.container.insertBefore(Me,this.container.childNodes[0]):this.container.appendChild(Me)},ze.prototype.getState=function(){return{typeName:ze.typeName,state:this.state,notes:this.notes}},ze.prototype.restoreState=function(Me){this._state=Me.state,this.notes=Me.notes},ze.prototype.scale=function(Me,Ee){},ze.prototype.colorChanged=function(Me){this.onColorChanged&&this.onColorChanged(Me),this.stateChanged()},ze.prototype.fillColorChanged=function(Me){this.onFillColorChanged&&this.onFillColorChanged(Me),this.stateChanged()},ze.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var Me=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),Me.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(Me)&&this.onStateChanged(this)}},ze.typeName="MarkerBase",ze}(),se=function(){function ze(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ze.prototype.findGripByVisual=function(Me){return this.topLeft.ownsTarget(Me)?this.topLeft:this.topCenter.ownsTarget(Me)?this.topCenter:this.topRight.ownsTarget(Me)?this.topRight:this.centerLeft.ownsTarget(Me)?this.centerLeft:this.centerRight.ownsTarget(Me)?this.centerRight:this.bottomLeft.ownsTarget(Me)?this.bottomLeft:this.bottomCenter.ownsTarget(Me)?this.bottomCenter:this.bottomRight.ownsTarget(Me)?this.bottomRight:void 0},ze}(),ge=function(){function ze(){this.GRIP_SIZE=10,this.visual=Oe.createGroup(),this.visual.appendChild(Oe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Oe.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ze.prototype.ownsTarget=function(Me){return Me===this.visual||Me===this.visual.childNodes[0]||Me===this.visual.childNodes[1]},ze}(),ye=function(){function ze(){}return ze.toITransformMatrix=function(Me){return{a:Me.a,b:Me.b,c:Me.c,d:Me.d,e:Me.e,f:Me.f}},ze.toSVGMatrix=function(Me,Ee){return Me.a=Ee.a,Me.b=Ee.b,Me.c=Ee.c,Me.d=Ee.d,Me.e=Ee.e,Me.f=Ee.f,Me},ze}(),we=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.left=0,Ae.top=0,Ae.width=0,Ae.height=0,Ae.defaultSize={x:50,y:20},Ae.offsetX=0,Ae.offsetY=0,Ae.rotationAngle=0,Ae.CB_DISTANCE=10,Ae._suppressMarkerCreateEvent=!1,Ae.container.transform.baseVal.appendItem(Oe.createTransform()),Ae.setupControlBox(),Ae}return Ke(Me,ze),Object.defineProperty(Me.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(Me.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(Me.prototype,"visual",{get:function(){return this._visual},set:function(Ee){this._visual=Ee;var Te=Oe.createTransform();this._visual.transform.baseVal.appendItem(Te)},enumerable:!1,configurable:!0}),Me.prototype.ownsTarget=function(Ee){return!!ze.prototype.ownsTarget.call(this,Ee)||!!(this.controlGrips.findGripByVisual(Ee)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Ee))},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.state==="new"&&(this.left=Ee.x,this.top=Ee.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var He=this.unrotatePoint(Ee);if(this.manipulationStartX=He.x,this.manipulationStartY=He.y,this.offsetX=He.x-this.left,this.offsetY=He.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Te),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Te)){this.activeGrip=this.rotatorGrip;var Ae=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Ae.x-this.width/2,this.top=Ae.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var qe=this.container.transform.baseVal.getItem(0);qe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(qe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},Me.prototype.pointerUp=function(Ee){var Te=this.state;ze.prototype.pointerUp.call(this,Ee),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(Ee),this._state="select",Te==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},Me.prototype.moveVisual=function(Ee){this.visual.style.transform="translate("+Ee.x+"px, "+Ee.y+"px)"},Me.prototype.manipulate=function(Ee){var Te=this.unrotatePoint(Ee);this.state==="creating"?this.resize(Ee):this.state==="move"?(this.left=this.manipulationStartLeft+(Te.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Te.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Te):this.state==="rotate"&&this.rotate(Ee)},Me.prototype.resize=function(Ee){var Te=this.manipulationStartLeft,He=this.manipulationStartWidth,Ae=this.manipulationStartTop,qe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Te=this.manipulationStartLeft+Ee.x-this.manipulationStartX,He=this.manipulationStartWidth+this.manipulationStartLeft-Te;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:He=this.manipulationStartWidth+Ee.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Ae=this.manipulationStartTop+Ee.y-this.manipulationStartY,qe=this.manipulationStartHeight+this.manipulationStartTop-Ae;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:qe=this.manipulationStartHeight+Ee.y-this.manipulationStartY}He>=0?(this.left=Te,this.width=He):(this.left=Te+He,this.width=-He),qe>=0?(this.top=Ae,this.height=qe):(this.top=Ae+qe,this.height=-qe),this.setSize()},Me.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},Me.prototype.rotate=function(Ee){if(Math.abs(Ee.x-this.centerX)>.1){var Te=Math.sign(Ee.x-this.centerX);this.rotationAngle=180*Math.atan((Ee.y-this.centerY)/(Ee.x-this.centerX))/Math.PI+90*Te,this.applyRotation()}},Me.prototype.applyRotation=function(){var Ee=this.container.transform.baseVal.getItem(0);Ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ee,0)},Me.prototype.rotatePoint=function(Ee){if(this.rotationAngle===0)return Ee;var Te=this.container.getCTM(),He=Oe.createPoint(Ee.x,Ee.y);return{x:(He=He.matrixTransform(Te)).x,y:He.y}},Me.prototype.unrotatePoint=function(Ee){if(this.rotationAngle===0)return Ee;var Te=this.container.getCTM();Te=Te.inverse();var He=Oe.createPoint(Ee.x,Ee.y);return{x:(He=He.matrixTransform(Te)).x,y:He.y}},Me.prototype.select=function(){ze.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Me.prototype.deselect=function(){ze.prototype.deselect.call(this),this.controlBox.style.display="none"},Me.prototype.setupControlBox=function(){this.controlBox=Oe.createGroup();var Ee=Oe.createTransform();Ee.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(Ee),this.container.appendChild(this.controlBox),this.controlRect=Oe.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=Oe.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 se,this.addControlGrips(),this.controlBox.style.display="none"},Me.prototype.adjustControlBox=function(){var Ee=this.controlBox.transform.baseVal.getItem(0);Ee.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(Ee,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()},Me.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()},Me.prototype.createGrip=function(){var Ee=new ge;return Ee.visual.transform.baseVal.appendItem(Oe.createTransform()),this.controlBox.appendChild(Ee.visual),Ee},Me.prototype.positionGrips=function(){var Ee=this.controlGrips.topLeft.GRIP_SIZE,Te=-Ee/2,He=Te,Ae=(this.width+this.CB_DISTANCE)/2-Ee/2,qe=(this.height+this.CB_DISTANCE)/2-Ee/2,an=this.height+this.CB_DISTANCE-Ee/2,Xt=this.width+this.CB_DISTANCE-Ee/2;this.positionGrip(this.controlGrips.topLeft.visual,Te,He),this.positionGrip(this.controlGrips.topCenter.visual,Ae,He),this.positionGrip(this.controlGrips.topRight.visual,Xt,He),this.positionGrip(this.controlGrips.centerLeft.visual,Te,qe),this.positionGrip(this.controlGrips.centerRight.visual,Xt,qe),this.positionGrip(this.controlGrips.bottomLeft.visual,Te,an),this.positionGrip(this.controlGrips.bottomCenter.visual,Ae,an),this.positionGrip(this.controlGrips.bottomRight.visual,Xt,an),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Ae,He-3*this.CB_DISTANCE)},Me.prototype.positionGrip=function(Ee,Te,He){var Ae=Ee.transform.baseVal.getItem(0);Ae.setTranslate(Te,He),Ee.transform.baseVal.replaceItem(Ae,0)},Me.prototype.hideControlBox=function(){this.controlBox.style.display="none"},Me.prototype.showControlBox=function(){this.controlBox.style.display=""},Me.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ye.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ye.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ze.prototype.getState.call(this))},Me.prototype.restoreState=function(Ee){ze.prototype.restoreState.call(this,Ee);var Te=Ee;this.left=Te.left,this.top=Te.top,this.width=Te.width,this.height=Te.height,this.rotationAngle=Te.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ye.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Te.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ye.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Te.containerTransformMatrix))},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te);var He=this.rotatePoint({x:this.left,y:this.top}),Ae=this.unrotatePoint({x:He.x*Ee,y:He.y*Te});this.left=Ae.x,this.top=Ae.y,this.width=this.width*Ee,this.height=this.height*Te,this.adjustControlBox()},Me}(de),Ce=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.fillColor="transparent",Ae.strokeColor="transparent",Ae.strokeWidth=0,Ae.strokeDasharray="",Ae.opacity=1,Ae.setStrokeColor=Ae.setStrokeColor.bind(Ae),Ae.setFillColor=Ae.setFillColor.bind(Ae),Ae.setStrokeWidth=Ae.setStrokeWidth.bind(Ae),Ae.setStrokeDasharray=Ae.setStrokeDasharray.bind(Ae),Ae.createVisual=Ae.createVisual.bind(Ae),Ae}return Ke(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.visual)},Me.prototype.createVisual=function(){this.visual=Oe.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)},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.state==="new"&&(this.createVisual(),this.moveVisual(Ee),this._state="creating")},Me.prototype.manipulate=function(Ee){ze.prototype.manipulate.call(this,Ee)},Me.prototype.resize=function(Ee){ze.prototype.resize.call(this,Ee),this.setSize()},Me.prototype.setSize=function(){ze.prototype.setSize.call(this),Oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},Me.prototype.pointerUp=function(Ee){ze.prototype.pointerUp.call(this,Ee),this.setSize()},Me.prototype.setStrokeColor=function(Ee){this.strokeColor=Ee,this.visual&&Oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Ee),this.stateChanged()},Me.prototype.setFillColor=function(Ee){this.fillColor=Ee,this.visual&&Oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},Me.prototype.setStrokeWidth=function(Ee){this.strokeWidth=Ee,this.visual&&Oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Me.prototype.setStrokeDasharray=function(Ee){this.strokeDasharray=Ee,this.visual&&Oe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Me.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ze.prototype.getState.call(this))},Me.prototype.restoreState=function(Ee){var Te=Ee;this.fillColor=Te.fillColor,this.strokeColor=Te.strokeColor,this.strokeWidth=Te.strokeWidth,this.strokeDasharray=Te.strokeDasharray,this.opacity=Te.opacity,this.createVisual(),ze.prototype.restoreState.call(this,Ee),this.setSize()},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.setSize()},Me.title="Rectangle marker",Me}(we),_e=function(ze){function Me(Ee,Te,He,Ae){var qe=ze.call(this,Ee,Ae||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return qe.widths=[],qe.widthBoxes=[],qe.widths=Te,qe.currentWidth=He,qe.setCurrentWidth=qe.setCurrentWidth.bind(qe),qe}return Ke(Me,ze),Me.prototype.getUi=function(){var Ee=this,Te=document.createElement("div");return Te.style.display="flex",Te.style.overflow="hidden",Te.style.flexGrow="2",this.widths.forEach(function(He){var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.flexGrow="2",Ae.style.alignItems="center",Ae.style.justifyContent="space-between",Ae.style.padding="5px",Ae.style.borderWidth="2px",Ae.style.borderStyle="solid",Ae.style.borderColor=He===Ee.currentWidth?Ee.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){Ee.setCurrentWidth(He,Ae)}),Te.appendChild(Ae);var qe=document.createElement("div");qe.innerText=He.toString(),qe.style.marginRight="5px",Ae.appendChild(qe);var an=document.createElement("div");an.style.minHeight="20px",an.style.flexGrow="2",an.style.display="flex",an.style.alignItems="center";var Xt=document.createElement("hr");Xt.style.minWidth="20px",Xt.style.border="0px",Xt.style.borderTop=He+"px solid "+Ee.uiStyleSettings.toolboxColor,Xt.style.flexGrow="2",an.appendChild(Xt),Ae.appendChild(an),Ee.widthBoxes.push(Ae)}),Te},Me.prototype.setCurrentWidth=function(Ee,Te){var He=this;this.currentWidth=Ee,this.widthBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===Te?He.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},Me}(ne),Ze=function(ze){function Me(Ee,Te,He,Ae){var qe=ze.call(this,Ee,Ae||'<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 qe.styles=[],qe.styleBoxes=[],qe.styles=Te,qe.currentStyle=He,qe.setCurrentStyle=qe.setCurrentStyle.bind(qe),qe}return Ke(Me,ze),Me.prototype.getUi=function(){var Ee=this,Te=document.createElement("div");return Te.style.display="flex",Te.style.overflow="hidden",Te.style.flexGrow="2",this.styles.forEach(function(He){var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.alignItems="center",Ae.style.justifyContent="space-between",Ae.style.padding="5px",Ae.style.borderWidth="2px",Ae.style.borderStyle="solid",Ae.style.overflow="hidden",Ae.style.maxWidth=100/Ee.styles.length-5+"%",Ae.style.borderColor=He===Ee.currentStyle?Ee.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){Ee.setCurrentStyle(He,Ae)}),Te.appendChild(Ae);var qe=document.createElement("div");qe.style.minHeight="20px",qe.style.flexGrow="2",qe.style.overflow="hidden";var an=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+Ee.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(He!==""?'stroke-dasharray="'+He+'"':"")+` />
</svg>`;qe.innerHTML=an,Ae.appendChild(qe),Ee.styleBoxes.push(Ae)}),Te},Me.prototype.setCurrentStyle=function(Ee,Te){var He=this;this.currentStyle=Ee,this.styleBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===Te?He.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},Me}(ne),lt=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.strokeColor=He.defaultColor,Ae.strokeWidth=He.defaultStrokeWidth,Ae.strokeDasharray=He.defaultStrokeDasharray,Ae.strokePanel=new te("Line color",He.defaultColorSet,He.defaultColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.strokeWidthPanel=new _e("Line width",He.defaultStrokeWidths,He.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Ze("Line style",He.defaultStrokeDasharrays,He.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae}return Ke(Me,ze),Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=ze.prototype.getState.call(this);return Ee.typeName=Me.typeName,Ee},Me.typeName="FrameMarker",Me.title="Frame marker",Me.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',Me}(Ce),Qe=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"},Ue=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.x1=0,Ae.y1=0,Ae.x2=0,Ae.y2=0,Ae.defaultLength=50,Ae.manipulationStartX=0,Ae.manipulationStartY=0,Ae.manipulationStartX1=0,Ae.manipulationStartY1=0,Ae.manipulationStartX2=0,Ae.manipulationStartY2=0,Ae.setupControlBox(),Ae}return Ke(Me,ze),Me.prototype.ownsTarget=function(Ee){return!!ze.prototype.ownsTarget.call(this,Ee)||!(!this.grip1.ownsTarget(Ee)&&!this.grip2.ownsTarget(Ee))},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.manipulationStartX=Ee.x,this.manipulationStartY=Ee.y,this.state==="new"&&(this.x1=Ee.x,this.y1=Ee.y,this.x2=Ee.x,this.y2=Ee.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(Te)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Te)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},Me.prototype.pointerUp=function(Ee){var Te=this.state;ze.prototype.pointerUp.call(this,Ee),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(Ee),this._state="select",Te==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},Me.prototype.adjustVisual=function(){},Me.prototype.manipulate=function(Ee){this.state==="creating"?this.resize(Ee):this.state==="move"?(this.x1=this.manipulationStartX1+Ee.x-this.manipulationStartX,this.y1=this.manipulationStartY1+Ee.y-this.manipulationStartY,this.x2=this.manipulationStartX2+Ee.x-this.manipulationStartX,this.y2=this.manipulationStartY2+Ee.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(Ee)},Me.prototype.resize=function(Ee){switch(this.activeGrip){case this.grip1:this.x1=Ee.x,this.y1=Ee.y;break;case this.grip2:case void 0:this.x2=Ee.x,this.y2=Ee.y}this.adjustVisual(),this.adjustControlBox()},Me.prototype.select=function(){ze.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Me.prototype.deselect=function(){ze.prototype.deselect.call(this),this.controlBox.style.display="none"},Me.prototype.setupControlBox=function(){this.controlBox=Oe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},Me.prototype.adjustControlBox=function(){this.positionGrips()},Me.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},Me.prototype.createGrip=function(){var Ee=new ge;return Ee.visual.transform.baseVal.appendItem(Oe.createTransform()),this.controlBox.appendChild(Ee.visual),Ee},Me.prototype.positionGrips=function(){var Ee=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-Ee/2,this.y1-Ee/2),this.positionGrip(this.grip2.visual,this.x2-Ee/2,this.y2-Ee/2)},Me.prototype.positionGrip=function(Ee,Te,He){var Ae=Ee.transform.baseVal.getItem(0);Ae.setTranslate(Te,He),Ee.transform.baseVal.replaceItem(Ae,0)},Me.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ze.prototype.getState.call(this))},Me.prototype.restoreState=function(Ee){ze.prototype.restoreState.call(this,Ee);var Te=Ee;this.x1=Te.x1,this.y1=Te.y1,this.x2=Te.x2,this.y2=Te.y2},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.x1=this.x1*Ee,this.y1=this.y1*Te,this.x2=this.x2*Ee,this.y2=this.y2*Te,this.adjustVisual(),this.adjustControlBox()},Me}(de),dt=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.strokeColor="transparent",Ae.strokeWidth=0,Ae.strokeDasharray="",Ae.setStrokeColor=Ae.setStrokeColor.bind(Ae),Ae.setStrokeWidth=Ae.setStrokeWidth.bind(Ae),Ae.setStrokeDasharray=Ae.setStrokeDasharray.bind(Ae),Ae.strokeColor=He.defaultColor,Ae.strokeWidth=He.defaultStrokeWidth,Ae.strokeDasharray=He.defaultStrokeDasharray,Ae.strokePanel=new te("Line color",He.defaultColorSet,He.defaultColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.strokeWidthPanel=new _e("Line width",He.defaultStrokeWidths,He.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Ze("Line style",He.defaultStrokeDasharrays,He.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae}return Ke(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.visual&&Ee!==this.selectorLine&&Ee!==this.visibleLine)},Me.prototype.createVisual=function(){this.visual=Oe.createGroup(),this.selectorLine=Oe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Oe.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)},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},Me.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()),Oe.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Oe.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Oe.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},Me.prototype.setStrokeColor=function(Ee){this.strokeColor=Ee,this.adjustVisual(),this.colorChanged(Ee)},Me.prototype.setStrokeWidth=function(Ee){this.strokeWidth=Ee,this.adjustVisual()},Me.prototype.setStrokeDasharray=function(Ee){this.strokeDasharray=Ee,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){ze.prototype.restoreState.call(this,Ee);var Te=Ee;this.strokeColor=Te.strokeColor,this.strokeWidth=Te.strokeWidth,this.strokeDasharray=Te.strokeDasharray,this.createVisual(),this.adjustVisual()},Me.typeName="LineMarker",Me.title="Line marker",Me.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',Me}(Ue),$e=function(ze){function Me(Ee,Te,He,Ae){var qe=ze.call(this,Ee,Ae||'<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 qe.fonts=[],qe.fontBoxes=[],qe.fonts=Te,qe.currentFont=He,qe.setCurrentFont=qe.setCurrentFont.bind(qe),qe}return Ke(Me,ze),Me.prototype.getUi=function(){var Ee=this,Te=document.createElement("div");return Te.style.overflow="hidden",Te.style.flexGrow="2",this.fonts.forEach(function(He){var Ae=document.createElement("div");Ae.style.display="inline-block",Ae.style.alignItems="center",Ae.style.justifyContent="space-between",Ae.style.padding="5px",Ae.style.borderWidth="2px",Ae.style.borderStyle="solid",Ae.style.overflow="hidden",Ae.style.maxWidth=100/Ee.fonts.length-5+"%",Ae.style.borderColor=He===Ee.currentFont?Ee.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){Ee.setCurrentFont(He,Ae)}),Te.appendChild(Ae);var qe=document.createElement("div");qe.style.display="flex",qe.style.minHeight="20px",qe.style.flexGrow="2",qe.style.fontFamily=He,qe.style.overflow="hidden";var an=document.createElement("div");an.style.whiteSpace="nowrap",an.style.overflow="hidden",an.style.textOverflow="ellipsis",an.innerHTML="The quick brown fox jumps over the lazy dog",qe.appendChild(an),Ae.appendChild(qe),Ee.fontBoxes.push(Ae)}),Te},Me.prototype.setCurrentFont=function(Ee,Te){var He=this;this.currentFont=Ee,this.fontBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===Te?He.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},Me}(ne),wt=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.color="transparent",Ae.padding=5,Ae.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",Ae.text=Ae.DEFAULT_TEXT,Ae.isMoved=!1,Ae.color=He.defaultColor,Ae.fontFamily=He.defaultFontFamily,Ae.defaultSize={x:100,y:30},Ae.setColor=Ae.setColor.bind(Ae),Ae.setFont=Ae.setFont.bind(Ae),Ae.renderText=Ae.renderText.bind(Ae),Ae.sizeText=Ae.sizeText.bind(Ae),Ae.textEditDivClicked=Ae.textEditDivClicked.bind(Ae),Ae.showTextEditor=Ae.showTextEditor.bind(Ae),Ae.setSize=Ae.setSize.bind(Ae),Ae.positionTextEditor=Ae.positionTextEditor.bind(Ae),Ae.colorPanel=new te("Color",He.defaultColorSet,He.defaultColor),Ae.colorPanel.onColorChanged=Ae.setColor,Ae.fontFamilyPanel=new $e("Font",He.defaultFontFamilies,He.defaultFontFamily),Ae.fontFamilyPanel.onFontChanged=Ae.setFont,Ae}return Ke(Me,ze),Me.prototype.ownsTarget=function(Ee){if(ze.prototype.ownsTarget.call(this,Ee)||Ee===this.visual||Ee===this.textElement||Ee===this.bgRectangle)return!0;var Te=!1;return this.textElement.childNodes.forEach(function(He){He===Ee&&(Te=!0)}),Te},Me.prototype.createVisual=function(){this.visual=Oe.createGroup(),this.bgRectangle=Oe.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Oe.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Oe.createTransform()),this.textElement.transform.baseVal.appendItem(Oe.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.isMoved=!1,this.pointerDownPoint=Ee,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Ee),this._state="creating")},Me.prototype.renderText=function(){var Ee=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(Te){Ee.textElement.appendChild(Oe.createTSpan(Te.trim()===""?" ":Te.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},Me.prototype.getTextScale=function(){var Ee=this.textElement.getBBox(),Te=1;if(Ee.width>0&&Ee.height>0){var He=(1*this.width-this.width*this.padding*2/100)/Ee.width,Ae=(1*this.height-this.height*this.padding*2/100)/Ee.height;Te=Math.min(He,Ae)}return Te},Me.prototype.getTextPosition=function(Ee){var Te=this.textElement.getBBox(),He=0,Ae=0;return Te.width>0&&Te.height>0&&(He=(this.width-Te.width*Ee)/2,Ae=this.height/2-Te.height*Ee/2),{x:He,y:Ae}},Me.prototype.sizeText=function(){var Ee=this.textElement.getBBox(),Te=this.getTextScale(),He=this.getTextPosition(Te);He.y-=Ee.y*Te,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+He.x+"px, "+He.y+"px) scale("+Te+", "+Te+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(He.x,He.y),this.textElement.transform.baseVal.getItem(1).setScale(Te,Te))},Me.prototype.manipulate=function(Ee){ze.prototype.manipulate.call(this,Ee),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Ee.x-this.pointerDownPoint.x)>5||Math.abs(Ee.y-this.pointerDownPoint.y)>5)},Me.prototype.resize=function(Ee){ze.prototype.resize.call(this,Ee),this.isMoved=!0,this.setSize(),this.sizeText()},Me.prototype.setSize=function(){ze.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Oe.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},Me.prototype.pointerUp=function(Ee){var Te=this.state;Te==="creating"&&(this._suppressMarkerCreateEvent=!0),ze.prototype.pointerUp.call(this,Ee),this.setSize(),(Te==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},Me.prototype.showTextEditor=function(){var Ee=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(Te){Te.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Te=Number.parseFloat(Ee.textEditor.style.fontSize);Ee.textEditor.clientWidth>=Number.parseInt(Ee.textEditor.style.maxWidth)&&Te>.9;)Te-=.1,Ee.textEditor.style.fontSize=Math.max(Te,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Te){Te.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Te){if(Te.clipboardData){var He=Te.clipboardData.getData("text"),Ae=window.getSelection();if(!Ae.rangeCount)return!1;Ae.deleteFromDocument(),Ae.getRangeAt(0).insertNode(document.createTextNode(He)),Te.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){Ee.textEditDivClicked(Ee.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},Me.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var Ee=this.getTextScale(),Te=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),He=this.textElement.getBBox(),Ae={x:He.width*Ee,y:He.height*Ee};Te.x-=Ae.x/2,Te.y-=Ae.y/2,this.textEditor.style.top=Te.y+"px",this.textEditor.style.left=Te.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Te.x+"px",this.textEditor.style.fontSize=Math.max(16*Ee,12)+"px",this.textElement.style.display="none"}},Me.prototype.textEditDivClicked=function(Ee){this.text=Ee.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},Me.prototype.select=function(){ze.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},Me.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ze.prototype.deselect.call(this)},Me.prototype.dblClick=function(Ee,Te){ze.prototype.dblClick.call(this,Ee,Te),this.showTextEditor()},Me.prototype.setColor=function(Ee){this.textElement&&Oe.setAttributes(this.textElement,[["fill",Ee]]),this.color=Ee,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(Ee)},Me.prototype.setFont=function(Ee){this.textElement&&Oe.setAttributes(this.textElement,[["font-family",Ee]]),this.fontFamily=Ee,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},Me.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},Me.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){var Te=Ee;this.color=Te.color,this.fontFamily=Te.fontFamily,this.padding=Te.padding,this.text=Te.text,this.createVisual(),ze.prototype.restoreState.call(this,Ee),this.setSize()},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.setSize(),this.sizeText(),this.positionTextEditor()},Me.typeName="TextMarker",Me.title="Text marker",Me.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>',Me}(we),St=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.color="transparent",Ae.lineWidth=3,Ae.drawing=!1,Ae.pixelRatio=1,Ae.color=He.defaultColor,Ae.lineWidth=He.defaultStrokeWidth,Ae.pixelRatio=He.freehandPixelRatio,Ae.setColor=Ae.setColor.bind(Ae),Ae.addCanvas=Ae.addCanvas.bind(Ae),Ae.finishCreation=Ae.finishCreation.bind(Ae),Ae.setLineWidth=Ae.setLineWidth.bind(Ae),Ae.colorPanel=new te("Color",He.defaultColorSet,He.defaultColor),Ae.colorPanel.onColorChanged=Ae.setColor,Ae.lineWidthPanel=new _e("Line width",He.defaultStrokeWidths,He.defaultStrokeWidth),Ae.lineWidthPanel.onWidthChanged=Ae.setLineWidth,Ae}return Ke(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.visual&&Ee!==this.drawingImage)},Me.prototype.createVisual=function(){this.visual=Oe.createGroup(),this.drawingImage=Oe.createImage(),this.visual.appendChild(this.drawingImage);var Ee=Oe.createTransform();this.visual.transform.baseVal.appendItem(Ee),this.addMarkerVisualToContainer(this.visual)},Me.prototype.pointerDown=function(Ee,Te){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(Ee.x,Ee.y),this.drawing=!0):ze.prototype.pointerDown.call(this,Ee,Te)},Me.prototype.manipulate=function(Ee){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(Ee.x,Ee.y),this.canvasContext.stroke()):ze.prototype.manipulate.call(this,Ee)},Me.prototype.resize=function(Ee){ze.prototype.resize.call(this,Ee),Oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Oe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},Me.prototype.pointerUp=function(Ee){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ze.prototype.pointerUp.call(this,Ee)},Me.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)},Me.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ze.prototype.select.call(this)},Me.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ze.prototype.deselect.call(this)},Me.prototype.finishCreation=function(){for(var Ee=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Te=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],He=Te[0],Ae=Te[1],qe=Te[2],an=Te[3],Xt=!1,yn=0;yn<this.canvasElement.height;yn++)for(var kt=0;kt<this.canvasElement.width;kt++)Ee.data[yn*this.canvasElement.width*4+4*kt+3]>0&&(Xt=!0,yn<Ae&&(Ae=yn),kt<He&&(He=kt),yn>an&&(an=yn),kt>qe&&(qe=kt));if(Xt){this.left=He/this.pixelRatio,this.top=Ae/this.pixelRatio,this.width=(qe-He)/this.pixelRatio,this.height=(an-Ae)/this.pixelRatio;var Dt=document.createElement("canvas");Dt.width=qe-He,Dt.height=an-Ae,Dt.getContext("2d").putImageData(this.canvasContext.getImageData(He,Ae,qe-He,an-Ae),0,0),this.drawingImgUrl=Dt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},Me.prototype.setDrawingImage=function(){Oe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Oe.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},Me.prototype.setColor=function(Ee){this.color=Ee,this.colorChanged(Ee)},Me.prototype.setLineWidth=function(Ee){this.lineWidth=Ee},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=Object.assign({drawingImgUrl:this.drawingImgUrl},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){this.createVisual(),ze.prototype.restoreState.call(this,Ee),this.drawingImgUrl=Ee.drawingImgUrl,this.setDrawingImage()},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.setDrawingImage()},Me.typeName="FreehandMarker",Me.title="Freehand marker",Me.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>',Me}(we),Lt=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,He||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Ae.typeBoxes=[],Ae.currentType=Te,Ae.setCurrentType=Ae.setCurrentType.bind(Ae),Ae}return Ke(Me,ze),Me.prototype.getUi=function(){var Ee=this,Te=document.createElement("div");Te.style.display="flex",Te.style.overflow="hidden",Te.style.flexGrow="2";for(var He=function(an){var Xt="both";switch(an){case 0:Xt="both";break;case 1:Xt="start";break;case 2:Xt="end";break;case 3:Xt="none"}var yn=document.createElement("div");if(yn.style.display="flex",yn.style.flexGrow="2",yn.style.alignItems="center",yn.style.justifyContent="space-between",yn.style.padding="5px",yn.style.borderWidth="2px",yn.style.borderStyle="solid",yn.style.borderColor=Xt===Ae.currentType?Ae.uiStyleSettings.toolboxAccentColor:"transparent",yn.addEventListener("click",function(){Ee.setCurrentType(Xt,yn)}),Te.appendChild(yn),Xt==="both"||Xt==="start"){var kt=document.createElement("div");kt.style.display="flex",kt.style.alignItems="center",kt.style.minHeight="20px",kt.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="`+(Ae.uiStyleSettings!==void 0?Ae.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,kt.style.marginLeft="5px",yn.appendChild(kt)}var Dt=document.createElement("div");Dt.style.display="flex",Dt.style.alignItems="center",Dt.style.minHeight="20px",Dt.style.flexGrow="2";var Zt=document.createElement("hr");if(Zt.style.minWidth="20px",Zt.style.border="0px",Zt.style.borderTop="3px solid "+(Ae.uiStyleSettings!==void 0?Ae.uiStyleSettings.toolboxColor:"#eeeeee"),Zt.style.flexGrow="2",Dt.appendChild(Zt),yn.appendChild(Dt),Xt==="both"||Xt==="end"){var hn=document.createElement("div");hn.style.display="flex",hn.style.alignItems="center",hn.style.minHeight="20px",hn.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="`+(Ae.uiStyleSettings!==void 0?Ae.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,hn.style.marginRight="5px",yn.appendChild(hn)}Ae.typeBoxes.push(yn)},Ae=this,qe=0;qe<4;qe++)He(qe);return Te},Me.prototype.setCurrentType=function(Ee,Te){var He=this;this.currentType=Ee,this.typeBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===Te?He.uiStyleSettings!==void 0?He.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},Me}(ne),pn=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.arrowType="end",Ae.arrowBaseHeight=10,Ae.arrowBaseWidth=10,Ae.getArrowPoints=Ae.getArrowPoints.bind(Ae),Ae.setArrowType=Ae.setArrowType.bind(Ae),Ae.arrowTypePanel=new Lt("Arrow type","end"),Ae.arrowTypePanel.onArrowTypeChanged=Ae.setArrowType,Ae}return Ke(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.arrow1&&Ee!==this.arrow2)},Me.prototype.getArrowPoints=function(Ee,Te){var He=this.arrowBaseWidth+2*this.strokeWidth,Ae=this.arrowBaseHeight+2*this.strokeWidth;return Ee-He/2+","+(Te+Ae/2)+" "+Ee+","+(Te-Ae/2)+" "+(Ee+He/2)+","+(Te+Ae/2)},Me.prototype.createTips=function(){this.arrow1=Oe.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Oe.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Oe.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Oe.createTransform()),this.visual.appendChild(this.arrow2)},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.state==="creating"&&this.createTips()},Me.prototype.adjustVisual=function(){if(ze.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",Oe.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Oe.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var Ee=0;Math.abs(this.x1-this.x2)>.1&&(Ee=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var Te=this.arrow1.transform.baseVal.getItem(0);Te.setRotate(Ee,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Te,0);var He=this.arrow2.transform.baseVal.getItem(0);He.setRotate(Ee+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(He,0)}},Me.prototype.setArrowType=function(Ee){this.arrowType=Ee,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=Object.assign({arrowType:this.arrowType},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){ze.prototype.restoreState.call(this,Ee);var Te=Ee;this.arrowType=Te.arrowType,this.createTips(),this.adjustVisual()},Me.typeName="ArrowMarker",Me.title="Arrow marker",Me.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',Me}(dt),en=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.fillColor=He.defaultFillColor,Ae.strokeWidth=0,Ae.fillPanel=new te("Color",He.defaultColorSet,He.defaultFillColor),Ae.fillPanel.onColorChanged=Ae.setFillColor,Ae}return Ke(Me,ze),Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=ze.prototype.getState.call(this);return Ee.typeName=Me.typeName,Ee},Me.typeName="CoverMarker",Me.title="Cover marker",Me.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',Me}(Ce),vn=function(ze){function Me(Ee,Te,He,Ae){var qe=ze.call(this,Ee,Ae||'<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 qe.opacities=[],qe.opacityBoxes=[],qe.opacities=Te,qe.currentOpacity=He,qe.setCurrentOpacity=qe.setCurrentOpacity.bind(qe),qe}return Ke(Me,ze),Me.prototype.getUi=function(){var Ee=this,Te=document.createElement("div");return Te.style.display="flex",Te.style.overflow="hidden",Te.style.flexGrow="2",Te.style.justifyContent="space-between",this.opacities.forEach(function(He){var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.alignItems="center",Ae.style.justifyContent="center",Ae.style.padding="5px",Ae.style.borderWidth="2px",Ae.style.borderStyle="solid",Ae.style.borderColor=He===Ee.currentOpacity?Ee.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){Ee.setCurrentOpacity(He,Ae)}),Te.appendChild(Ae);var qe=document.createElement("div");qe.innerText=100*He+"%",Ae.appendChild(qe),Ee.opacityBoxes.push(Ae)}),Te},Me.prototype.setCurrentOpacity=function(Ee,Te){var He=this;this.currentOpacity=Ee,this.opacityBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===Te?He.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},Me}(ne),rn=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.setOpacity=Ae.setOpacity.bind(Ae),Ae.fillColor=He.defaultHighlightColor,Ae.strokeWidth=0,Ae.opacity=He.defaultHighlightOpacity,Ae.fillPanel=new te("Color",He.defaultColorSet,Ae.fillColor),Ae.fillPanel.onColorChanged=Ae.setFillColor,Ae.opacityPanel=new vn("Opacity",He.defaultOpacitySteps,Ae.opacity),Ae.opacityPanel.onOpacityChanged=Ae.setOpacity,Ae}return Ke(Me,ze),Me.prototype.setOpacity=function(Ee){this.opacity=Ee,this.visual&&Oe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=ze.prototype.getState.call(this);return Ee.typeName=Me.typeName,Ee},Me.typeName="HighlightMarker",Me.title="Highlight marker",Me.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>',Me}(en),nt='<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>',rt='<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>',dn=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.bgColor="transparent",Ae.tipPosition={x:0,y:0},Ae.tipBase1Position={x:0,y:0},Ae.tipBase2Position={x:0,y:0},Ae.tipMoving=!1,Ae.color=He.defaultStrokeColor,Ae.bgColor=He.defaultFillColor,Ae.fontFamily=He.defaultFontFamily,Ae.defaultSize={x:100,y:30},Ae.setBgColor=Ae.setBgColor.bind(Ae),Ae.getTipPoints=Ae.getTipPoints.bind(Ae),Ae.positionTip=Ae.positionTip.bind(Ae),Ae.setTipPoints=Ae.setTipPoints.bind(Ae),Ae.colorPanel=new te("Text color",He.defaultColorSet,Ae.color,nt),Ae.colorPanel.onColorChanged=Ae.setColor,Ae.bgColorPanel=new te("Fill color",He.defaultColorSet,Ae.bgColor,rt),Ae.bgColorPanel.onColorChanged=Ae.setBgColor,Ae.fontFamilyPanel=new $e("Font",He.defaultFontFamilies,He.defaultFontFamily),Ae.fontFamilyPanel.onFontChanged=Ae.setFont,Ae.tipGrip=new ge,Ae.tipGrip.visual.transform.baseVal.appendItem(Oe.createTransform()),Ae.controlBox.appendChild(Ae.tipGrip.visual),Ae}return Ke(Me,ze),Me.prototype.ownsTarget=function(Ee){return ze.prototype.ownsTarget.call(this,Ee)||this.tipGrip.ownsTarget(Ee)||this.tip===Ee},Me.prototype.createTip=function(){Oe.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Oe.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},Me.prototype.pointerDown=function(Ee,Te){this.state==="new"&&ze.prototype.pointerDown.call(this,Ee,Te),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Te)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ze.prototype.pointerDown.call(this,Ee,Te)},Me.prototype.pointerUp=function(Ee){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ze.prototype.pointerUp.call(this,Ee);else{var Te=this.state==="creating";ze.prototype.pointerUp.call(this,Ee),this.setTipPoints(Te),this.positionTip()}},Me.prototype.manipulate=function(Ee){if(this.tipMoving){var Te=this.unrotatePoint(Ee);this.tipPosition={x:Te.x-this.manipulationStartLeft,y:Te.y-this.manipulationStartTop},this.positionTip()}else ze.prototype.manipulate.call(this,Ee)},Me.prototype.setBgColor=function(Ee){this.bgRectangle&&this.tip&&(Oe.setAttributes(this.bgRectangle,[["fill",Ee]]),Oe.setAttributes(this.tip,[["fill",Ee]])),this.bgColor=Ee,this.fillColorChanged(Ee)},Me.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},Me.prototype.setTipPoints=function(Ee){Ee===void 0&&(Ee=!1);var Te=Math.min(this.height/2,15),He=this.height/5;Ee&&(this.tipPosition={x:Te+He/2,y:this.height+20});var Ae=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Ae<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(He=this.width/5,Te=Math.min(this.width/2,15),this.tipBase1Position={x:Te,y:0},this.tipBase2Position={x:Te+He,y:0}):(this.tipBase1Position={x:0,y:Te},this.tipBase2Position={x:0,y:Te+He}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Ae<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(He=this.width/5,Te=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Te-He,y:0},this.tipBase2Position={x:this.width-Te,y:0}):(this.tipBase1Position={x:this.width,y:Te},this.tipBase2Position={x:this.width,y:Te+He}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Ae<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(He=this.width/5,Te=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Te-He,y:this.height},this.tipBase2Position={x:this.width-Te,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Te-He},this.tipBase2Position={x:this.width,y:this.height-Te}):Ae<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(He=this.width/5,Te=Math.min(this.width/2,15),this.tipBase1Position={x:Te,y:this.height},this.tipBase2Position={x:Te+He,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Te},this.tipBase2Position={x:0,y:this.height-Te-He})},Me.prototype.resize=function(Ee){ze.prototype.resize.call(this,Ee),this.positionTip()},Me.prototype.positionTip=function(){Oe.setAttributes(this.tip,[["points",this.getTipPoints()]]);var Ee=this.tipGrip.visual.transform.baseVal.getItem(0);Ee.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(Ee,0)},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Me.prototype.select=function(){this.positionTip(),ze.prototype.select.call(this)},Me.prototype.getState=function(){var Ee=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){var Te=Ee;this.bgColor=Te.bgColor,this.tipPosition=Te.tipPosition,ze.prototype.restoreState.call(this,Ee),this.createTip(),this.setTipPoints()},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.tipPosition={x:this.tipPosition.x*Ee,y:this.tipPosition.y*Te},this.positionTip()},Me.typeName="CalloutMarker",Me.title="Callout marker",Me.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>',Me}(wt),ri=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.fillColor="transparent",Ae.strokeColor="transparent",Ae.strokeWidth=0,Ae.strokeDasharray="",Ae.opacity=1,Ae.strokeColor=He.defaultColor,Ae.strokeWidth=He.defaultStrokeWidth,Ae.strokeDasharray=He.defaultStrokeDasharray,Ae.fillColor=He.defaultFillColor,Ae.setStrokeColor=Ae.setStrokeColor.bind(Ae),Ae.setFillColor=Ae.setFillColor.bind(Ae),Ae.setStrokeWidth=Ae.setStrokeWidth.bind(Ae),Ae.setStrokeDasharray=Ae.setStrokeDasharray.bind(Ae),Ae.setOpacity=Ae.setOpacity.bind(Ae),Ae.createVisual=Ae.createVisual.bind(Ae),Ae.strokePanel=new te("Line color",vt(He.defaultColorSet,["transparent"]),He.defaultColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.fillPanel=new te("Fill color",vt(He.defaultColorSet,["transparent"]),Ae.fillColor,rt),Ae.fillPanel.onColorChanged=Ae.setFillColor,Ae.strokeWidthPanel=new _e("Line width",He.defaultStrokeWidths,He.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Ze("Line style",He.defaultStrokeDasharrays,He.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae.opacityPanel=new vn("Opacity",He.defaultOpacitySteps,Ae.opacity),Ae.opacityPanel.onOpacityChanged=Ae.setOpacity,Ae}return Ke(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.visual)},Me.prototype.createVisual=function(){this.visual=Oe.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)},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.state==="new"&&(this.createVisual(),this.moveVisual(Ee),this._state="creating")},Me.prototype.manipulate=function(Ee){ze.prototype.manipulate.call(this,Ee)},Me.prototype.resize=function(Ee){ze.prototype.resize.call(this,Ee),this.setSize()},Me.prototype.setSize=function(){ze.prototype.setSize.call(this),Oe.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},Me.prototype.pointerUp=function(Ee){ze.prototype.pointerUp.call(this,Ee),this.setSize()},Me.prototype.setStrokeColor=function(Ee){this.strokeColor=Ee,this.visual&&Oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Ee),this.stateChanged()},Me.prototype.setFillColor=function(Ee){this.fillColor=Ee,this.visual&&Oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(Ee),this.stateChanged()},Me.prototype.setStrokeWidth=function(Ee){this.strokeWidth=Ee,this.visual&&Oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Me.prototype.setStrokeDasharray=function(Ee){this.strokeDasharray=Ee,this.visual&&Oe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Me.prototype.setOpacity=function(Ee){this.opacity=Ee,this.visual&&Oe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){var Te=Ee;this.fillColor=Te.fillColor,this.strokeColor=Te.strokeColor,this.strokeWidth=Te.strokeWidth,this.strokeDasharray=Te.strokeDasharray,this.opacity=Te.opacity,this.createVisual(),ze.prototype.restoreState.call(this,Ee),this.setSize()},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.setSize()},Me.typeName="EllipseMarker",Me.title="Ellipse marker",Me.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>',Me}(we),Hn=function(ze){function Me(Ee,Te,He){return ze.call(this,Ee,Te,He)||this}return Ke(Me,ze),Object.defineProperty(Me.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.tip1&&Ee!==this.tip2)},Me.prototype.createTips=function(){this.tip1=Oe.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(Oe.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Oe.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(Oe.createTransform()),this.visual.appendChild(this.tip2)},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.state==="creating"&&this.createTips()},Me.prototype.adjustVisual=function(){if(ze.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Oe.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()]]),Oe.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 Ee=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Te=this.tip1.transform.baseVal.getItem(0);Te.setRotate(Ee,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Te,0);var He=this.tip2.transform.baseVal.getItem(0);He.setRotate(Ee+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(He,0)}},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=ze.prototype.getState.call(this);return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){ze.prototype.restoreState.call(this,Ee),this.createTips(),this.adjustVisual()},Me.typeName="MeasurementMarker",Me.title="Measurement marker",Me.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>',Me}(dt),Wt=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.strokePanel.colors=He.defaultColorSet,Ae.fillColor="transparent",Ae}return Ke(Me,ze),Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=ze.prototype.getState.call(this);return Ee.typeName=Me.typeName,Ee},Me.typeName="EllipseFrameMarker",Me.title="Ellipse frame marker",Me.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>',Me}(ri),En=function(){function ze(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ze.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ze.prototype.addUndoStep=function(Me){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(Me)||(this.undoStack.push(Me),JSON.stringify(this.lastRedoStep)!==JSON.stringify(Me)&&this.redoStack.splice(0,this.redoStack.length))},ze.prototype.replaceLastUndoStep=function(Me){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=Me)},ze.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ze.prototype.undo=function(){if(this.undoStack.length>1){var Me=this.undoStack.pop();return Me!==void 0&&this.redoStack.push(Me),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ze.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ze}(),An=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.strokeColor="transparent",Ae.strokeWidth=0,Ae.strokeDasharray="",Ae.curveX=0,Ae.curveY=0,Ae.manipulationStartCurveX=0,Ae.manipulationStartCurveY=0,Ae.setStrokeColor=Ae.setStrokeColor.bind(Ae),Ae.setStrokeWidth=Ae.setStrokeWidth.bind(Ae),Ae.setStrokeDasharray=Ae.setStrokeDasharray.bind(Ae),Ae.positionGrips=Ae.positionGrips.bind(Ae),Ae.addControlGrips=Ae.addControlGrips.bind(Ae),Ae.adjustVisual=Ae.adjustVisual.bind(Ae),Ae.setupControlBox=Ae.setupControlBox.bind(Ae),Ae.resize=Ae.resize.bind(Ae),Ae.strokeColor=He.defaultColor,Ae.strokeWidth=He.defaultStrokeWidth,Ae.strokeDasharray=He.defaultStrokeDasharray,Ae.strokePanel=new te("Line color",He.defaultColorSet,He.defaultColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.strokeWidthPanel=new _e("Line width",He.defaultStrokeWidths,He.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Ze("Line style",He.defaultStrokeDasharrays,He.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae}return Ke(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.visual&&Ee!==this.selectorCurve&&Ee!==this.visibleCurve&&!this.curveGrip.ownsTarget(Ee))},Me.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},Me.prototype.createVisual=function(){this.visual=Oe.createGroup(),this.selectorCurve=Oe.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Oe.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)},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=Ee.x,this.curveY=Ee.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Te)&&(this.activeGrip=this.curveGrip,this._state="resize")},Me.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Oe.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Oe.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Oe.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},Me.prototype.setupControlBox=function(){ze.prototype.setupControlBox.call(this),this.curveControlLine1=Oe.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Oe.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)},Me.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ze.prototype.addControlGrips.call(this)},Me.prototype.positionGrips=function(){ze.prototype.positionGrips.call(this);var Ee=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-Ee/2,this.curveY-Ee/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()))},Me.prototype.manipulate=function(Ee){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+Ee.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+Ee.y-this.manipulationStartY),ze.prototype.manipulate.call(this,Ee)},Me.prototype.resize=function(Ee){this.activeGrip===this.curveGrip&&(this.curveX=Ee.x,this.curveY=Ee.y),ze.prototype.resize.call(this,Ee),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},Me.prototype.setStrokeColor=function(Ee){this.strokeColor=Ee,this.adjustVisual(),this.colorChanged(Ee)},Me.prototype.setStrokeWidth=function(Ee){this.strokeWidth=Ee,this.adjustVisual()},Me.prototype.setStrokeDasharray=function(Ee){this.strokeDasharray=Ee,this.adjustVisual()},Me.prototype.scale=function(Ee,Te){this.curveX=this.curveX*Ee,this.curveY=this.curveY*Te,ze.prototype.scale.call(this,Ee,Te)},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ze.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){ze.prototype.restoreState.call(this,Ee);var Te=Ee;this.strokeColor=Te.strokeColor,this.strokeWidth=Te.strokeWidth,this.strokeDasharray=Te.strokeDasharray,this.curveX=Te.curveX,this.curveY=Te.curveY,this.createVisual(),this.adjustVisual()},Me.typeName="CurveMarker",Me.title="Curve marker",Me.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>',Me}(Ue),ci=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,Te,He)||this;return Ae.fillColor="transparent",Ae.strokeColor="transparent",Ae.strokeWidth=0,Ae.strokeDasharray="",Ae.textColor="transparent",Ae.fontSize="1rem",Ae.isMoved=!1,Ae.captionText="Caption",Ae.PADDING=5,Ae.captionBoxWidth=0,Ae.captionBoxHeight=0,Ae.strokeColor=He.defaultColor,Ae.strokeWidth=He.defaultStrokeWidth,Ae.strokeDasharray=He.defaultStrokeDasharray,Ae.fillColor=He.defaultFillColor,Ae.textColor=He.defaultStrokeColor,Ae.fontFamily=He.defaultFontFamily,Ae.fontSize=He.defaultCaptionFontSize,Ae.captionText=He.defaultCaptionText,Ae.setStrokeColor=Ae.setStrokeColor.bind(Ae),Ae.setFillColor=Ae.setFillColor.bind(Ae),Ae.setStrokeWidth=Ae.setStrokeWidth.bind(Ae),Ae.setStrokeDasharray=Ae.setStrokeDasharray.bind(Ae),Ae.createVisual=Ae.createVisual.bind(Ae),Ae.sizeCaption=Ae.sizeCaption.bind(Ae),Ae.setCaptionText=Ae.setCaptionText.bind(Ae),Ae.showTextEditor=Ae.showTextEditor.bind(Ae),Ae.positionTextEditor=Ae.positionTextEditor.bind(Ae),Ae.finishTextEditing=Ae.finishTextEditing.bind(Ae),Ae.setFont=Ae.setFont.bind(Ae),Ae.setTextColor=Ae.setTextColor.bind(Ae),Ae.strokePanel=new te("Line color",vt(He.defaultColorSet,["transparent"]),Ae.strokeColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.fillPanel=new te("Fill color",vt(He.defaultColorSet,["transparent"]),Ae.fillColor,rt),Ae.fillPanel.onColorChanged=Ae.setFillColor,Ae.strokeWidthPanel=new _e("Line width",He.defaultStrokeWidths,He.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Ze("Line style",He.defaultStrokeDasharrays,He.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae.fontFamilyPanel=new $e("Font",He.defaultFontFamilies,He.defaultFontFamily),Ae.fontFamilyPanel.onFontChanged=Ae.setFont,Ae.textColorPanel=new te("Text color",He.defaultColorSet,Ae.textColor,nt),Ae.textColorPanel.onColorChanged=Ae.setTextColor,Ae}return Ke(Me,ze),Me.prototype.ownsTarget=function(Ee){return!(!ze.prototype.ownsTarget.call(this,Ee)&&Ee!==this.visual&&Ee!==this.frame&&Ee!==this.captionBg&&Ee!==this.captionElement)},Me.prototype.createVisual=function(){this.visual=Oe.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=Oe.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=Oe.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=Oe.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()},Me.prototype.setCaptionText=function(Ee){this.captionText=Ee,this.captionElement.textContent=this.captionText,this.sizeCaption()},Me.prototype.pointerDown=function(Ee,Te){ze.prototype.pointerDown.call(this,Ee,Te),this.isMoved=!1,this.pointerDownPoint=Ee,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Ee),this._state="creating")},Me.prototype.manipulate=function(Ee){ze.prototype.manipulate.call(this,Ee),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Ee.x-this.pointerDownPoint.x)>5||Math.abs(Ee.y-this.pointerDownPoint.y)>5)},Me.prototype.resize=function(Ee){ze.prototype.resize.call(this,Ee),this.setSize()},Me.prototype.sizeCaption=function(){var Ee=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=Ee.width+2*this.PADDING,this.captionBoxHeight=Ee.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),Oe.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')"]]),Oe.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')"]])},Me.prototype.showTextEditor=function(){var Ee=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(Te){Te.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(Te){Te.key==="Enter"&&Ee.finishTextEditing(Ee.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(Te){Te.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){Ee.finishTextEditing(Ee.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){Ee.finishTextEditing(Ee.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},Me.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"))},Me.prototype.finishTextEditing=function(Ee){this.setCaptionText(Ee.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},Me.prototype.setFont=function(Ee){this.captionElement&&Oe.setAttributes(this.captionElement,[["font-family",Ee]]),this.fontFamily=Ee,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},Me.prototype.setTextColor=function(Ee){this.captionElement&&Oe.setAttributes(this.captionElement,[["fill",Ee]]),this.textColor=Ee,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},Me.prototype.setSize=function(){ze.prototype.setSize.call(this),Oe.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},Me.prototype.pointerUp=function(Ee){ze.prototype.pointerUp.call(this,Ee),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},Me.prototype.dblClick=function(Ee,Te){ze.prototype.dblClick.call(this,Ee,Te),this.showTextEditor()},Me.prototype.setStrokeColor=function(Ee){this.strokeColor=Ee,this.frame&&Oe.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(Ee),this.stateChanged()},Me.prototype.setFillColor=function(Ee){this.fillColor=Ee,this.captionBg&&Oe.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(Ee),this.stateChanged()},Me.prototype.setStrokeWidth=function(Ee){this.strokeWidth=Ee,this.frame&&Oe.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Me.prototype.setStrokeDasharray=function(Ee){this.strokeDasharray=Ee,this.frame&&Oe.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=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},ze.prototype.getState.call(this));return Ee.typeName=this.typeName,Ee},Me.prototype.restoreState=function(Ee){var Te=Ee;this.fillColor=Te.fillColor,this.strokeColor=Te.strokeColor,this.strokeWidth=Te.strokeWidth,this.strokeDasharray=Te.strokeDasharray,this.textColor=Te.textColor,this.fontFamily=Te.fontFamily,this.captionText=Te.captionText,this.fontSize=Te.fontSize,this.createVisual(),ze.prototype.restoreState.call(this,Ee),this.setSize()},Me.prototype.scale=function(Ee,Te){ze.prototype.scale.call(this,Ee,Te),this.setSize()},Me.typeName="CaptionFrameMarker",Me.title="Caption frame marker",Me.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>',Me}(we),It=function(){function ze(Me,Ee){Ee===void 0&&(Ee=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=Me,this.cancelable=Ee}return Object.defineProperty(ze.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ze.prototype.preventDefault=function(){this._defaultPrevented=!0},ze}(),Pt=function(ze){function Me(Ee,Te,He){var Ae=ze.call(this,Ee,!1)||this;return Ae.dataUrl=Te,Ae.state=He,Ae}return Ke(Me,ze),Me}(It),Nt=function(ze){function Me(Ee,Te,He){He===void 0&&(He=!1);var Ae=ze.call(this,Ee,He)||this;return Ae.marker=Te,Ae}return Ke(Me,ze),Me}(It),ii=function(){function ze(){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 ze.prototype.addEventListener=function(Me,Ee){this[Me].push(Ee)},ze.prototype.removeEventListener=function(Me,Ee){var Te=this[Me].indexOf(Ee);Te>-1&&this[Me].splice(Te,1)},ze}(),Gi=function(){function ze(Me){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Qe,this._isOpen=!1,this.undoRedoManager=new En,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 ii,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ze.instanceCounter++,this.styles=new We(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=Me,this.targetRoot=document.body,this.width=Me.clientWidth,this.height=Me.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(ze.prototype,"ALL_MARKER_TYPES",{get:function(){return[lt,St,pn,wt,Wt,ri,rn,dn,Hn,en,dt,An,ci]},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[lt,St,pn,wt,ri,rn,dn]},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"BASIC_MARKER_TYPES",{get:function(){return[lt,St,pn,wt,rn]},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(Me){var Ee=this;this._availableMarkerTypes.splice(0),Me.forEach(function(Te){if(typeof Te=="string"){var He=Ee.ALL_MARKER_TYPES.find(function(Ae){return Ae.typeName===Te});He!==void 0&&Ee._availableMarkerTypes.push(He)}else Ee._availableMarkerTypes.push(Te)})},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ze.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(Me){this._zoomLevel=Me,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(ze.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ze.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),st.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ze.prototype.show=function(){var Me=this;this.styles.styleSheetRoot===void 0&&ot.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ot.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(Ee){return Ee(new It(Me))})},ze.prototype.render=function(){return it(this,void 0,void 0,function(){var Me;return bt(this,function(Ee){switch(Ee.label){case 0:return this.setCurrentMarker(),(Me=new Et).naturalSize=this.renderAtNaturalSize,Me.imageType=this.renderImageType,Me.imageQuality=this.renderImageQuality,Me.markersOnly=this.renderMarkersOnly,Me.width=this.renderWidth,Me.height=this.renderHeight,[4,Me.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return Ee.sent(),[4,Me.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,Ee.sent()]}})})},ze.prototype.close=function(Me){var Ee=this;if(Me===void 0&&(Me=!1),this.isOpen){var Te=!1;Me||this.eventListeners.beforeclose.forEach(function(He){var Ae=new It(Ee,!0);He(Ae),Ae.defaultPrevented&&(Te=!0)}),Te||(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(He){return He(new It(Ee))}),this.detachEvents(),this._isOpen=!1)}},ze.prototype.addMarkersToToolbar=function(){for(var Me,Ee=[],Te=0;Te<arguments.length;Te++)Ee[Te]=arguments[Te];(Me=this._availableMarkerTypes).push.apply(Me,Ee)},ze.prototype.addRenderEventListener=function(Me){this.addEventListener("render",function(Ee){Me(Ee.dataUrl,Ee.state)})},ze.prototype.removeRenderEventListener=function(Me){},ze.prototype.addCloseEventListener=function(Me){this.addEventListener("close",function(){Me()})},ze.prototype.removeCloseEventListener=function(Me){},ze.prototype.setupResizeObserver=function(){var Me=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){Me.resize(Me.target.clientWidth,Me.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return Me.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ze.prototype.onPopupTargetResize=function(){var Me=1*this.target.clientWidth/this.target.clientHeight,Ee=this.editorCanvas.clientWidth/Me>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*Me:this.editorCanvas.clientWidth,Te=Ee<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/Me;this.resize(Ee,Te)},ze.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ze.prototype.resize=function(Me,Ee){this._isResizing=!0;var Te=Me/this.imageWidth,He=Ee/this.imageHeight;this.imageWidth=Math.round(Me),this.imageHeight=Math.round(Ee),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(Te,He),this._isResizing=!1},ze.prototype.scaleMarkers=function(Me,Ee){var Te,He=this;this._currentMarker&&this._currentMarker instanceof wt?this._currentMarker.scale(Me,Ee):(Te=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Ae){Ae!==He._currentMarker&&Ae.scale(Me,Ee)}),Te!==void 0&&this.setCurrentMarker(Te)},ze.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"},ze.prototype.setTopLeft=function(){var Me=this.editingTarget.getBoundingClientRect(),Ee=this.editorCanvas.getBoundingClientRect();this.left=Me.left-Ee.left,this.top=Me.top-Ee.top},ze.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)},ze.prototype.addDefs=function(){for(var Me,Ee=[],Te=0;Te<arguments.length;Te++)Ee[Te]=arguments[Te];this.defs=Oe.createDefs(),this.addDefsToImage(),(Me=this.defs).append.apply(Me,Ee)},ze.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ze.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)},ze.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ze.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ze.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)},ze.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ze.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)},ze.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 Me=document.createElement("a");Me.href="https://markerjs.com/",Me.target="_blank",Me.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>',Me.title="Powered by marker.js",Me.style.display="grid",Me.style.alignItems="center",Me.style.justifyItems="center",Me.style.padding="3px",Me.style.width="20px",Me.style.height="20px",this.logoUI.appendChild(Me),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ze.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")},ze.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"},ze.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ze.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 Me=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=Me+"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 At(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 De(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ze.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ze.prototype.removeMarker=function(Me){this.markerImage.removeChild(Me.container),this.markers.indexOf(Me)>-1&&this.markers.splice(this.markers.indexOf(Me),1),Me.dispose()},ze.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())},ze.prototype.toolbarButtonClicked=function(Me,Ee){if(Me==="marker"&&Ee!==void 0)this.createNewMarker(Ee);else if(Me==="action")switch(Ee){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()}},ze.prototype.deleteSelectedMarker=function(){var Me=this;if(this._currentMarker!==void 0){var Ee=!1;if(this.eventListeners.markerbeforedelete.forEach(function(He){var Ae=new Nt(Me,Me._currentMarker,!0);He(Ae),Ae.defaultPrevented&&(Ee=!0)}),!Ee){var Te=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(He){return He(new Nt(Me,Te))})}}},ze.prototype.clear=function(){var Me=this,Ee=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(qe){var an=new Nt(Me,void 0,!0);qe(an),an.defaultPrevented&&(Ee=!0)}),!Ee)){this.setCurrentMarker();for(var Te=function(qe){var an=He.markers[qe];He.setCurrentMarker(He.markers[qe]),He._currentMarker.dispose(),He.markerImage.removeChild(He._currentMarker.container),He.markers.splice(He.markers.indexOf(He._currentMarker),1),He.eventListeners.markerdelete.forEach(function(Xt){return Xt(new Nt(Me,an))})},He=this,Ae=this.markers.length-1;Ae>=0;Ae--)Te(Ae);this.addUndoStep()}},Object.defineProperty(ze.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ze.prototype.showNotesEditor=function(){var Me;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=(Me=this._currentMarker.notes)!==null&&Me!==void 0?Me:"",this.overlayContainer.appendChild(this.notesArea))},ze.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)},ze.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ze.prototype.addUndoStep=function(){var Me=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var Ee=this.getState(),Te=this.undoRedoManager.getLastUndoStep();if(!Te||Te.width===Ee.width&&Te.height===Ee.height){var He=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(Ee),He<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Ae){return Ae(new It(Me))})}else this.undoRedoManager.replaceLastUndoStep(Ee),this.eventListeners.statechange.forEach(function(Ae){return Ae(new It(Me))})}},ze.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ze.prototype.undoStep=function(){var Me=this,Ee=this.undoRedoManager.undo();Ee!==void 0&&(this.restoreState(Ee),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Te){return Te(new It(Me))}))},ze.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ze.prototype.redoStep=function(){var Me=this,Ee=this.undoRedoManager.redo();Ee!==void 0&&(this.restoreState(Ee),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Te){return Te(new It(Me))}))},ze.prototype.stepZoom=function(){var Me=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=Me<this.zoomSteps.length-1?this.zoomSteps[Me+1]:this.zoomSteps[0]},ze.prototype.panTo=function(Me){this.contentDiv.scrollBy({left:this.prevPanPoint.x-Me.x,top:this.prevPanPoint.y-Me.y}),this.prevPanPoint=Me},ze.prototype.startRenderAndClose=function(){return it(this,void 0,void 0,function(){var Me,Ee,Te=this;return bt(this,function(He){switch(He.label){case 0:return[4,this.render()];case 1:return Me=He.sent(),Ee=this.getState(),this.eventListeners.render.forEach(function(Ae){return Ae(new Pt(Te,Me,Ee))}),this.close(!0),[2]}})})},ze.prototype.getState=function(Me){Me===!0&&this.setCurrentMarker();var Ee={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Te){return Ee.markers.push(Te.getState())}),Ee},ze.prototype.restoreState=function(Me){var Ee=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);Me.markers.forEach(function(Te){var He=Ee._availableMarkerTypes.find(function(qe){return qe.typeName===Te.typeName});if(He!==void 0){var Ae=Ee.addNewMarker(He);Ae.restoreState(Te),Ee.markers.push(Ae)}}),Me.width&&Me.height&&(Me.width!==this.imageWidth||Me.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/Me.width,this.imageHeight/Me.height),this.eventListeners.restorestate.forEach(function(Te){return Te(new It(Ee))})},ze.prototype.addNewMarker=function(Me){var Ee=Oe.createGroup();return this.markerImage.appendChild(Ee),new Me(Ee,this.overlayContainer,this.settings)},ze.prototype.createNewMarker=function(Me){var Ee,Te=this;(Ee=typeof Me=="string"?this._availableMarkerTypes.find(function(He){return He.typeName===Me}):Me)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(Ee),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(Ee.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(He){return He(new Nt(Te,Te._currentMarker))}))},ze.prototype.markerCreated=function(Me){var Ee=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(Me),this.setCurrentMarker(Me),Me instanceof St&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(St):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Te){return Te(new Nt(Ee,Ee._currentMarker))})},ze.prototype.colorChanged=function(Me){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=Me,this.settings.defaultStrokeColor=Me)},ze.prototype.fillColorChanged=function(Me){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=Me)},ze.prototype.markerStateChanged=function(Me){var Ee=this;this.eventListeners.markerchange.forEach(function(Te){return Te(new Nt(Ee,Me))})},ze.prototype.setCurrentMarker=function(Me){var Ee=this;this._currentMarker!==Me&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Te){return Te(new Nt(Ee,Ee._currentMarker))})),this._currentMarker=Me,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(Te){return Te(new Nt(Ee,Ee._currentMarker))}))},ze.prototype.onPointerDown=function(Me){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||Me.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var Ee=this.markers.find(function(Te){return Te.ownsTarget(Me.target)});Ee!==void 0?(this.setCurrentMarker(Ee),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Me.clientX,Me.clientY),Me.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:Me.clientX,y:Me.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Me.clientX,Me.clientY))},ze.prototype.onDblClick=function(Me){if(this._isFocused||this.focus(),this.mode==="select"){var Ee=this.markers.find(function(Te){return Te.ownsTarget(Me.target)});Ee!==void 0&&Ee!==this._currentMarker&&this.setCurrentMarker(Ee),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(Me.clientX,Me.clientY),Me.target):this.setCurrentMarker()}},ze.prototype.onPointerMove=function(Me){this.touchPoints!==1&&Me.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||Me.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(Me.clientX,Me.clientY)):this.zoomLevel>1&&this.panTo({x:Me.clientX,y:Me.clientY}))},ze.prototype.onPointerUp=function(Me){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(Me.clientX,Me.clientY)),this.isDragging=!1,this.addUndoStep()},ze.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ze.prototype.onKeyUp=function(Me){this._currentMarker===void 0||this.notesArea!==void 0||Me.key!=="Delete"&&Me.key!=="Backspace"||this.deleteSelectedMarker()},ze.prototype.clientToLocalCoordinates=function(Me,Ee){var Te=this.markerImage.getBoundingClientRect();return{x:(Me-Te.left)/this.zoomLevel,y:(Ee-Te.top)/this.zoomLevel}},ze.prototype.onWindowResize=function(){this.positionUI()},ze.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var Me=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=Me+"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()},ze.prototype.addLicenseKey=function(Me){st.addKey(Me)},ze.prototype.addEventListener=function(Me,Ee){this.eventListeners.addEventListener(Me,Ee)},ze.prototype.removeEventListener=function(Me,Ee){this.eventListeners.removeEventListener(Me,Ee)},ze.prototype.renderState=function(Me){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(Me),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ze.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ze.prototype.focus=function(){var Me=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(Ee){return Ee(new It(Me))}))},ze.prototype.blur=function(){var Me=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(Ee){return Ee(new It(Me))}))},ze.instanceCounter=0,ze}()},63727:function(Zn,ei,Le){"use strict";Le.d(ei,{s:function(){return kt},default:function(){return Mi}});var le=Le(14809),Ke=Le(20439),it=Le(95190),bt=Le(50298),vt=Le(62646),Oe=Le(37463),st=Le(6551),Et=Le(6089),ot=Le(18929),We=Le(59301),Tt=We.createContext({}),ct=Tt,At=Le(93664),De=Le(4635),ne="__rc_cascader_search_mark__",te=function(qt,un,zn){var on=zn.label,Sn=on===void 0?"":on;return un.some(function(di){return String(di[Sn]).toLowerCase().includes(qt.toLowerCase())})},de=function(qt,un,zn,on){return un.map(function(Sn){return Sn[on.label]}).join(" / ")},se=function(qt,un,zn,on,Sn,di){var Ui=Sn.filter,gi=Ui===void 0?te:Ui,Hi=Sn.render,kr=Hi===void 0?de:Hi,Gn=Sn.limit,On=Gn===void 0?50:Gn,Xn=Sn.sort;return We.useMemo(function(){var wi=[];if(!qt)return[];function nr(ji,Cr){var be=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;ji.forEach(function(mn){if(!(!Xn&&On!==!1&&On>0&&wi.length>=On)){var fi=[].concat((0,it.Z)(Cr),[mn]),Vn=mn[zn.children],si=be||mn.disabled;if((!Vn||Vn.length===0||di)&&gi(qt,fi,{label:zn.label})){var Di;wi.push((0,Ke.Z)((0,Ke.Z)({},mn),{},(Di={disabled:si},(0,De.Z)(Di,zn.label,kr(qt,fi,on,zn)),(0,De.Z)(Di,ne,fi),(0,De.Z)(Di,zn.children,void 0),Di)))}Vn&&nr(mn[zn.children],fi,si)}})}return nr(un,[]),Xn&&wi.sort(function(ji,Cr){return Xn(ji[ne],Cr[ne],qt,zn)}),On!==!1&&On>0?wi.slice(0,On):wi},[qt,un,zn,on,kr,di,gi,Xn,On])},ge=se,ye="__RC_CASCADER_SPLIT__",we="SHOW_PARENT",Ce="SHOW_CHILD";function _e(tn){return tn.join(ye)}function Ze(tn){return tn.map(_e)}function lt(tn){return tn.split(ye)}function Qe(tn){var qt=tn||{},un=qt.label,zn=qt.value,on=qt.children,Sn=zn||"value";return{label:un||"label",value:Sn,key:Sn,children:on||"children"}}function Ue(tn,qt){var un,zn;return(un=tn.isLeaf)!==null&&un!==void 0?un:!((zn=tn[qt.children])!==null&&zn!==void 0&&zn.length)}function dt(tn){var qt=tn.parentElement;if(qt){var un=tn.offsetTop-qt.offsetTop;un-qt.scrollTop<0?qt.scrollTo({top:un}):un+tn.offsetHeight-qt.scrollTop>qt.offsetHeight&&qt.scrollTo({top:un+tn.offsetHeight-qt.offsetHeight})}}function $e(tn,qt){return tn.map(function(un){var zn;return(zn=un[ne])===null||zn===void 0?void 0:zn.map(function(on){return on[qt.value]})})}function wt(tn){return Array.isArray(tn)&&Array.isArray(tn[0])}function St(tn){return tn?wt(tn)?tn:(tn.length===0?[]:[tn]).map(function(qt){return Array.isArray(qt)?qt:[qt]}):[]}function Lt(tn,qt,un){var zn=new Set(tn),on=qt();return tn.filter(function(Sn){var di=on[Sn],Ui=di?di.parent:null,gi=di?di.children:null;return di&&di.node.disabled?!0:un===Ce?!(gi&&gi.some(function(Hi){return Hi.key&&zn.has(Hi.key)})):!(Ui&&!Ui.node.disabled&&zn.has(Ui.key))})}function pn(tn,qt,un){for(var zn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,on=qt,Sn=[],di=function(){var Hi,kr,Gn,On=tn[Ui],Xn=(Hi=on)===null||Hi===void 0?void 0:Hi.findIndex(function(nr){var ji=nr[un.value];return zn?String(ji)===String(On):ji===On}),wi=Xn!==-1?(kr=on)===null||kr===void 0?void 0:kr[Xn]:null;Sn.push({value:(Gn=wi==null?void 0:wi[un.value])!==null&&Gn!==void 0?Gn:On,index:Xn,option:wi}),on=wi==null?void 0:wi[un.children]},Ui=0;Ui<tn.length;Ui+=1)di();return Sn}var en=function(tn,qt,un,zn,on){return We.useMemo(function(){var Sn=on||function(di){var Ui=zn?di.slice(-1):di,gi=" / ";return Ui.every(function(Hi){return["string","number"].includes((0,At.Z)(Hi))})?Ui.join(gi):Ui.reduce(function(Hi,kr,Gn){var On=We.isValidElement(kr)?We.cloneElement(kr,{key:Gn}):kr;return Gn===0?[On]:[].concat((0,it.Z)(Hi),[gi,On])},[])};return tn.map(function(di){var Ui,gi=pn(di,qt,un),Hi=Sn(gi.map(function(Gn){var On,Xn=Gn.option,wi=Gn.value;return(On=Xn==null?void 0:Xn[un.label])!==null&&On!==void 0?On:wi}),gi.map(function(Gn){var On=Gn.option;return On})),kr=_e(di);return{label:Hi,value:kr,key:kr,valueCells:di,disabled:(Ui=gi[gi.length-1])===null||Ui===void 0||(Ui=Ui.option)===null||Ui===void 0?void 0:Ui.disabled}})},[tn,qt,un,on,zn])};function vn(tn,qt){return We.useCallback(function(un){var zn=[],on=[];return un.forEach(function(Sn){var di=pn(Sn,tn,qt);di.every(function(Ui){return Ui.option})?on.push(Sn):zn.push(Sn)}),[on,zn]},[tn,qt])}var rn=Le(34061),nt=function(tn,qt){var un=We.useRef({options:[],info:{keyEntities:{},pathKeyEntities:{}}}),zn=We.useCallback(function(){return un.current.options!==tn&&(un.current.options=tn,un.current.info=(0,rn.I8)(tn,{fieldNames:qt,initWrapper:function(Sn){return(0,Ke.Z)((0,Ke.Z)({},Sn),{},{pathKeyEntities:{}})},processEntity:function(Sn,di){var Ui=Sn.nodes.map(function(gi){return gi[qt.value]}).join(ye);di.pathKeyEntities[Ui]=Sn,Sn.key=Ui}})),un.current.info.pathKeyEntities},[qt,tn]);return zn};function rt(tn,qt){var un=We.useMemo(function(){return qt||[]},[qt]),zn=nt(un,tn),on=We.useCallback(function(Sn){var di=zn();return Sn.map(function(Ui){var gi=di[Ui].nodes;return gi.map(function(Hi){return Hi[tn.value]})})},[zn,tn]);return[un,zn,on]}var dn=Le(48736);function ri(tn){return We.useMemo(function(){if(!tn)return[!1,{}];var qt={matchInputWidth:!0,limit:50};return tn&&(0,At.Z)(tn)==="object"&&(qt=(0,Ke.Z)((0,Ke.Z)({},qt),tn)),qt.limit<=0&&(qt.limit=!1),[!0,qt]},[tn])}var Hn=Le(34643);function Wt(tn,qt,un,zn,on,Sn,di,Ui){return function(gi){if(!tn)qt(gi);else{var Hi=_e(gi),kr=Ze(un),Gn=Ze(zn),On=kr.includes(Hi),Xn=on.some(function(si){return _e(si)===Hi}),wi=un,nr=on;if(Xn&&!On)nr=on.filter(function(si){return _e(si)!==Hi});else{var ji=On?kr.filter(function(si){return si!==Hi}):[].concat((0,it.Z)(kr),[Hi]),Cr=Sn(),be;if(On){var mn=(0,Hn.S)(ji,{checked:!1,halfCheckedKeys:Gn},Cr);be=mn.checkedKeys}else{var fi=(0,Hn.S)(ji,!0,Cr);be=fi.checkedKeys}var Vn=Lt(be,Sn,Ui);wi=di(Vn)}qt([].concat((0,it.Z)(nr),(0,it.Z)(wi)))}}}function En(tn,qt,un,zn,on){return We.useMemo(function(){var Sn=on(qt),di=(0,bt.Z)(Sn,2),Ui=di[0],gi=di[1];if(!tn||!qt.length)return[Ui,[],gi];var Hi=Ze(Ui),kr=un(),Gn=(0,Hn.S)(Hi,!0,kr),On=Gn.checkedKeys,Xn=Gn.halfCheckedKeys;return[zn(On),zn(Xn),gi]},[tn,qt,un,zn,on])}var An=Le(92310),ci=Le.n(An),It=We.memo(function(tn){var qt=tn.children;return qt},function(tn,qt){return!qt.open}),Pt=It;function Nt(tn){var qt,un=tn.prefixCls,zn=tn.checked,on=tn.halfChecked,Sn=tn.disabled,di=tn.onClick,Ui=tn.disableCheckbox,gi=We.useContext(ct),Hi=gi.checkable,kr=typeof Hi!="boolean"?Hi:null;return We.createElement("span",{className:ci()("".concat(un),(qt={},(0,De.Z)(qt,"".concat(un,"-checked"),zn),(0,De.Z)(qt,"".concat(un,"-indeterminate"),!zn&&on),(0,De.Z)(qt,"".concat(un,"-disabled"),Sn||Ui),qt)),onClick:di},kr)}var ii="__cascader_fix_label__";function Gi(tn){var qt=tn.prefixCls,un=tn.multiple,zn=tn.options,on=tn.activeValue,Sn=tn.prevValuePath,di=tn.onToggleOpen,Ui=tn.onSelect,gi=tn.onActive,Hi=tn.checkedSet,kr=tn.halfCheckedSet,Gn=tn.loadingKeys,On=tn.isSelectable,Xn=tn.disabled,wi="".concat(qt,"-menu"),nr="".concat(qt,"-menu-item"),ji=We.useContext(ct),Cr=ji.fieldNames,be=ji.changeOnSelect,mn=ji.expandTrigger,fi=ji.expandIcon,Vn=ji.loadingIcon,si=ji.dropdownMenuColumnStyle,Di=ji.optionRender,Ni=mn==="hover",yr=function(_t){return Xn||_t},zt=We.useMemo(function(){return zn.map(function(Mt){var _t,fn=Mt.disabled,Ji=Mt.disableCheckbox,mi=Mt[ne],$i=(_t=Mt[ii])!==null&&_t!==void 0?_t:Mt[Cr.label],xn=Mt[Cr.value],ni=Ue(Mt,Cr),sr=mi?mi.map(function(Kn){return Kn[Cr.value]}):[].concat((0,it.Z)(Sn),[xn]),br=_e(sr),Yn=Gn.includes(br),at=Hi.has(br),Bt=kr.has(br);return{disabled:fn,label:$i,value:xn,isLeaf:ni,isLoading:Yn,checked:at,halfChecked:Bt,option:Mt,disableCheckbox:Ji,fullPath:sr,fullPathKey:br}})},[zn,Hi,Cr,kr,Gn,Sn]);return We.createElement("ul",{className:wi,role:"menu"},zt.map(function(Mt){var _t,fn=Mt.disabled,Ji=Mt.label,mi=Mt.value,$i=Mt.isLeaf,xn=Mt.isLoading,ni=Mt.checked,sr=Mt.halfChecked,br=Mt.option,Yn=Mt.fullPath,at=Mt.fullPathKey,Bt=Mt.disableCheckbox,Kn=function(){if(!yr(fn)){var Un=(0,it.Z)(Yn);Ni&&$i&&Un.pop(),gi(Un)}},li=function(){On(br)&&!yr(fn)&&Ui(Yn,$i)},Qt;return typeof br.title=="string"?Qt=br.title:typeof Ji=="string"&&(Qt=Ji),We.createElement("li",{key:at,className:ci()(nr,(_t={},(0,De.Z)(_t,"".concat(nr,"-expand"),!$i),(0,De.Z)(_t,"".concat(nr,"-active"),on===mi||on===at),(0,De.Z)(_t,"".concat(nr,"-disabled"),yr(fn)),(0,De.Z)(_t,"".concat(nr,"-loading"),xn),_t)),style:si,role:"menuitemcheckbox",title:Qt,"aria-checked":ni,"data-path-key":at,onClick:function(){Kn(),!Bt&&(!un||$i)&&li()},onDoubleClick:function(){be&&di(!1)},onMouseEnter:function(){Ni&&Kn()},onMouseDown:function(Un){Un.preventDefault()}},un&&We.createElement(Nt,{prefixCls:"".concat(qt,"-checkbox"),checked:ni,halfChecked:sr,disabled:yr(fn)||Bt,disableCheckbox:Bt,onClick:function(Un){Bt||(Un.stopPropagation(),li())}}),We.createElement("div",{className:"".concat(nr,"-content")},Di?Di(br):Ji),!xn&&fi&&!$i&&We.createElement("div",{className:"".concat(nr,"-expand-icon")},fi),xn&&Vn&&We.createElement("div",{className:"".concat(nr,"-loading-icon")},Vn))}))}var ze=function(qt,un){var zn=We.useContext(ct),on=zn.values,Sn=on[0],di=We.useState([]),Ui=(0,bt.Z)(di,2),gi=Ui[0],Hi=Ui[1];return We.useEffect(function(){qt||Hi(Sn||[])},[un,Sn]),[gi,Hi]},Me=ze,Ee=Le(10228),Te=function(tn,qt,un,zn,on,Sn,di){var Ui=di.direction,gi=di.searchValue,Hi=di.toggleOpen,kr=di.open,Gn=Ui==="rtl",On=We.useMemo(function(){for(var si=-1,Di=qt,Ni=[],yr=[],zt=zn.length,Mt=$e(qt,un),_t=function(xn){var ni=Di.findIndex(function(sr,br){return(Mt[br]?_e(Mt[br]):sr[un.value])===zn[xn]});if(ni===-1)return 1;si=ni,Ni.push(si),yr.push(zn[xn]),Di=Di[si][un.children]},fn=0;fn<zt&&Di&&!_t(fn);fn+=1);for(var Ji=qt,mi=0;mi<Ni.length-1;mi+=1)Ji=Ji[Ni[mi]][un.children];return[yr,si,Ji,Mt]},[zn,un,qt]),Xn=(0,bt.Z)(On,4),wi=Xn[0],nr=Xn[1],ji=Xn[2],Cr=Xn[3],be=function(Di){on(Di)},mn=function(Di){var Ni=ji.length,yr=nr;yr===-1&&Di<0&&(yr=Ni);for(var zt=0;zt<Ni;zt+=1){yr=(yr+Di+Ni)%Ni;var Mt=ji[yr];if(Mt&&!Mt.disabled){var _t=wi.slice(0,-1).concat(Cr[yr]?_e(Cr[yr]):Mt[un.value]);be(_t);return}}},fi=function(){if(wi.length>1){var Di=wi.slice(0,-1);be(Di)}else Hi(!1)},Vn=function(){var Di,Ni=((Di=ji[nr])===null||Di===void 0?void 0:Di[un.children])||[],yr=Ni.find(function(Mt){return!Mt.disabled});if(yr){var zt=[].concat((0,it.Z)(wi),[yr[un.value]]);be(zt)}};We.useImperativeHandle(tn,function(){return{onKeyDown:function(Di){var Ni=Di.which;switch(Ni){case Ee.Z.UP:case Ee.Z.DOWN:{var yr=0;Ni===Ee.Z.UP?yr=-1:Ni===Ee.Z.DOWN&&(yr=1),yr!==0&&mn(yr);break}case Ee.Z.LEFT:{if(gi)break;Gn?Vn():fi();break}case Ee.Z.RIGHT:{if(gi)break;Gn?fi():Vn();break}case Ee.Z.BACKSPACE:{gi||fi();break}case Ee.Z.ENTER:{if(wi.length){var zt=ji[nr],Mt=(zt==null?void 0:zt[ne])||[];Mt.length?Sn(Mt.map(function(_t){return _t[un.value]}),Mt[Mt.length-1]):Sn(wi,ji[nr])}break}case Ee.Z.ESC:Hi(!1),kr&&Di.stopPropagation()}},onKeyUp:function(){}}})},He=We.forwardRef(function(tn,qt){var un,zn,on,Sn=tn.prefixCls,di=tn.multiple,Ui=tn.searchValue,gi=tn.toggleOpen,Hi=tn.notFoundContent,kr=tn.direction,Gn=tn.open,On=tn.disabled,Xn=We.useRef(null),wi=kr==="rtl",nr=We.useContext(ct),ji=nr.options,Cr=nr.values,be=nr.halfValues,mn=nr.fieldNames,fi=nr.changeOnSelect,Vn=nr.onSelect,si=nr.searchOptions,Di=nr.dropdownPrefixCls,Ni=nr.loadData,yr=nr.expandTrigger,zt=Di||Sn,Mt=We.useState([]),_t=(0,bt.Z)(Mt,2),fn=_t[0],Ji=_t[1],mi=function(Pr){if(!(!Ni||Ui)){var xr=pn(Pr,ji,mn),_n=xr.map(function(Vr){var xo=Vr.option;return xo}),ki=_n[_n.length-1];if(ki&&!Ue(ki,mn)){var Ar=_e(Pr);Ji(function(Vr){return[].concat((0,it.Z)(Vr),[Ar])}),Ni(_n)}}};We.useEffect(function(){fn.length&&fn.forEach(function(Ii){var Pr=lt(Ii),xr=pn(Pr,ji,mn,!0).map(function(ki){var Ar=ki.option;return Ar}),_n=xr[xr.length-1];(!_n||_n[mn.children]||Ue(_n,mn))&&Ji(function(ki){return ki.filter(function(Ar){return Ar!==Ii})})})},[ji,fn,mn]);var $i=We.useMemo(function(){return new Set(Ze(Cr))},[Cr]),xn=We.useMemo(function(){return new Set(Ze(be))},[be]),ni=Me(di,Gn),sr=(0,bt.Z)(ni,2),br=sr[0],Yn=sr[1],at=function(Pr){Yn(Pr),mi(Pr)},Bt=function(Pr){if(On)return!1;var xr=Pr.disabled,_n=Ue(Pr,mn);return!xr&&(_n||fi||di)},Kn=function(Pr,xr){var _n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Vn(Pr),!di&&(xr||fi&&(yr==="hover"||_n))&&gi(!1)},li=We.useMemo(function(){return Ui?si:ji},[Ui,si,ji]),Qt=We.useMemo(function(){for(var Ii=[{options:li}],Pr=li,xr=$e(Pr,mn),_n=function(){var Vr=br[ki],xo=Pr.find(function(Li,Sr){return(xr[Sr]?_e(xr[Sr]):Li[mn.value])===Vr}),Ot=xo==null?void 0:xo[mn.children];if(!(Ot!=null&&Ot.length))return 1;Pr=Ot,Ii.push({options:Ot})},ki=0;ki<br.length&&!_n();ki+=1);return Ii},[li,br,mn]),jt=function(Pr,xr){Bt(xr)&&Kn(Pr,Ue(xr,mn),!0)};Te(qt,li,mn,br,at,jt,{direction:kr,searchValue:Ui,toggleOpen:gi,open:Gn}),We.useEffect(function(){if(!Ui)for(var Ii=0;Ii<br.length;Ii+=1){var Pr,xr=br.slice(0,Ii+1),_n=_e(xr),ki=(Pr=Xn.current)===null||Pr===void 0?void 0:Pr.querySelector('li[data-path-key="'.concat(_n.replace(/\\{0,2}"/g,'\\"'),'"]'));ki&&dt(ki)}},[br,Ui]);var Un=!((un=Qt[0])!==null&&un!==void 0&&(un=un.options)!==null&&un!==void 0&&un.length),ai=[(zn={},(0,De.Z)(zn,mn.value,"__EMPTY__"),(0,De.Z)(zn,ii,Hi),(0,De.Z)(zn,"disabled",!0),zn)],Vi=(0,Ke.Z)((0,Ke.Z)({},tn),{},{multiple:!Un&&di,onSelect:Kn,onActive:at,onToggleOpen:gi,checkedSet:$i,halfCheckedSet:xn,loadingKeys:fn,isSelectable:Bt}),xi=Un?[{options:ai}]:Qt,Bi=xi.map(function(Ii,Pr){var xr=br.slice(0,Pr),_n=br[Pr];return We.createElement(Gi,(0,le.Z)({key:Pr},Vi,{prefixCls:zt,options:Ii.options,prevValuePath:xr,activeValue:_n}))});return We.createElement(Pt,{open:Gn},We.createElement("div",{className:ci()("".concat(zt,"-menus"),(on={},(0,De.Z)(on,"".concat(zt,"-menu-empty"),Un),(0,De.Z)(on,"".concat(zt,"-rtl"),wi),on)),ref:Xn},Bi))}),Ae=He,qe=We.forwardRef(function(tn,qt){var un=(0,Oe.lk)();return We.createElement(Ae,(0,le.Z)({},tn,un,{ref:qt}))}),an=qe,Xt=Le(70425);function yn(){}function kt(tn){var qt,un=tn,zn=un.prefixCls,on=zn===void 0?"rc-cascader":zn,Sn=un.style,di=un.className,Ui=un.options,gi=un.checkable,Hi=un.defaultValue,kr=un.value,Gn=un.fieldNames,On=un.changeOnSelect,Xn=un.onChange,wi=un.showCheckedStrategy,nr=un.loadData,ji=un.expandTrigger,Cr=un.expandIcon,be=Cr===void 0?">":Cr,mn=un.loadingIcon,fi=un.direction,Vn=un.notFoundContent,si=Vn===void 0?"Not Found":Vn,Di=un.disabled,Ni=!!gi,yr=(0,Xt.C8)(Hi,{value:kr,postState:St}),zt=(0,bt.Z)(yr,2),Mt=zt[0],_t=zt[1],fn=We.useMemo(function(){return Qe(Gn)},[JSON.stringify(Gn)]),Ji=rt(fn,Ui),mi=(0,bt.Z)(Ji,3),$i=mi[0],xn=mi[1],ni=mi[2],sr=vn($i,fn),br=En(Ni,Mt,xn,ni,sr),Yn=(0,bt.Z)(br,3),at=Yn[0],Bt=Yn[1],Kn=Yn[2],li=(0,Xt.zX)(function(xi){if(_t(xi),Xn){var Bi=St(xi),Ii=Bi.map(function(_n){return pn(_n,$i,fn).map(function(ki){return ki.option})}),Pr=Ni?Bi:Bi[0],xr=Ni?Ii:Ii[0];Xn(Pr,xr)}}),Qt=Wt(Ni,li,at,Bt,Kn,xn,ni,wi),jt=(0,Xt.zX)(function(xi){Qt(xi)}),Un=We.useMemo(function(){return{options:$i,fieldNames:fn,values:at,halfValues:Bt,changeOnSelect:On,onSelect:jt,checkable:gi,searchOptions:[],dropdownPrefixCls:void 0,loadData:nr,expandTrigger:ji,expandIcon:be,loadingIcon:mn,dropdownMenuColumnStyle:void 0}},[$i,fn,at,Bt,On,jt,gi,nr,ji,be,mn]),ai="".concat(on,"-panel"),Vi=!$i.length;return We.createElement(ct.Provider,{value:Un},We.createElement("div",{className:ci()(ai,(qt={},(0,De.Z)(qt,"".concat(ai,"-rtl"),fi==="rtl"),(0,De.Z)(qt,"".concat(ai,"-empty"),Vi),qt),di),style:Sn},Vi?si:We.createElement(Ae,{prefixCls:on,searchValue:"",multiple:Ni,toggleOpen:yn,open:!0,direction:fi,disabled:Di})))}function Dt(tn){var qt=tn.onPopupVisibleChange,un=tn.popupVisible,zn=tn.popupClassName,on=tn.popupPlacement;warning(!qt,"`onPopupVisibleChange` is deprecated. Please use `onDropdownVisibleChange` instead."),warning(un===void 0,"`popupVisible` is deprecated. Please use `open` instead."),warning(zn===void 0,"`popupClassName` is deprecated. Please use `dropdownClassName` instead."),warning(on===void 0,"`popupPlacement` is deprecated. Please use `placement` instead.")}function Zt(tn,qt){if(tn){var un=function zn(on){for(var Sn=0;Sn<on.length;Sn++){var di=on[Sn];if(di[qt==null?void 0:qt.value]===null)return warning(!1,"`value` in Cascader options should not be `null`."),!0;if(Array.isArray(di[qt==null?void 0:qt.children])&&zn(di[qt==null?void 0:qt.children]))return!0}};un(tn)}}var hn=null,wn=["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"],Dn=We.forwardRef(function(tn,qt){var un=tn.id,zn=tn.prefixCls,on=zn===void 0?"rc-cascader":zn,Sn=tn.fieldNames,di=tn.defaultValue,Ui=tn.value,gi=tn.changeOnSelect,Hi=tn.onChange,kr=tn.displayRender,Gn=tn.checkable,On=tn.autoClearSearchValue,Xn=On===void 0?!0:On,wi=tn.searchValue,nr=tn.onSearch,ji=tn.showSearch,Cr=tn.expandTrigger,be=tn.options,mn=tn.dropdownPrefixCls,fi=tn.loadData,Vn=tn.popupVisible,si=tn.open,Di=tn.popupClassName,Ni=tn.dropdownClassName,yr=tn.dropdownMenuColumnStyle,zt=tn.dropdownStyle,Mt=tn.popupPlacement,_t=tn.placement,fn=tn.onDropdownVisibleChange,Ji=tn.onPopupVisibleChange,mi=tn.expandIcon,$i=mi===void 0?">":mi,xn=tn.loadingIcon,ni=tn.children,sr=tn.dropdownMatchSelectWidth,br=sr===void 0?!1:sr,Yn=tn.showCheckedStrategy,at=Yn===void 0?we:Yn,Bt=tn.optionRender,Kn=(0,vt.Z)(tn,wn),li=(0,st.ZP)(un),Qt=!!Gn,jt=(0,ot.Z)(di,{value:Ui,postState:St}),Un=(0,bt.Z)(jt,2),ai=Un[0],Vi=Un[1],xi=We.useMemo(function(){return Qe(Sn)},[JSON.stringify(Sn)]),Bi=rt(xi,be),Ii=(0,bt.Z)(Bi,3),Pr=Ii[0],xr=Ii[1],_n=Ii[2],ki=(0,ot.Z)("",{value:wi,postState:function(Oi){return Oi||""}}),Ar=(0,bt.Z)(ki,2),Vr=Ar[0],xo=Ar[1],Ot=function(Oi,qi){xo(Oi),qi.source!=="blur"&&nr&&nr(Oi)},Li=ri(ji),Sr=(0,bt.Z)(Li,2),Ri=Sr[0],po=Sr[1],Qr=ge(Vr,Pr,xi,mn||on,po,gi||Qt),mo=vn(Pr,xi),fo=En(Qt,ai,xr,_n,mo),wo=(0,bt.Z)(fo,3),Io=wo[0],Bn=wo[1],ca=wo[2],In=We.useMemo(function(){var Ci=Ze(Io),Oi=Lt(Ci,xr,at);return[].concat((0,it.Z)(ca),(0,it.Z)(_n(Oi)))},[Io,xr,_n,ca,at]),Er=en(In,Pr,xi,Qt,kr),Do=(0,Et.Z)(function(Ci){if(Vi(Ci),Hi){var Oi=St(Ci),qi=Oi.map(function(pi){return pn(pi,Pr,xi).map(function(vi){return vi.option})}),zi=Qt?Oi:Oi[0],Nn=Qt?qi:qi[0];Hi(zi,Nn)}}),wr=Wt(Qt,Do,Io,Bn,ca,xr,_n,at),Qo=(0,Et.Z)(function(Ci){(!Qt||Xn)&&xo(""),wr(Ci)}),To=function(Oi,qi){if(qi.type==="clear"){Do([]);return}var zi=qi.values[0],Nn=zi.valueCells;Qo(Nn)},ro=si!==void 0?si:Vn,fa=Ni||Di,Yt=_t||Mt,Rn=function(Oi){fn==null||fn(Oi),Ji==null||Ji(Oi)},Rt=We.useMemo(function(){return{options:Pr,fieldNames:xi,values:Io,halfValues:Bn,changeOnSelect:gi,onSelect:Qo,checkable:Gn,searchOptions:Qr,dropdownPrefixCls:mn,loadData:fi,expandTrigger:Cr,expandIcon:$i,loadingIcon:xn,dropdownMenuColumnStyle:yr,optionRender:Bt}},[Pr,xi,Io,Bn,gi,Qo,Gn,Qr,mn,fi,Cr,$i,xn,yr,Bt]),Ie=!(Vr?Qr:Pr).length,qn=Vr&&po.matchInputWidth||Ie?{}:{minWidth:"auto"};return We.createElement(ct.Provider,{value:Rt},We.createElement(Oe.Ac,(0,le.Z)({},Kn,{ref:qt,id:li,prefixCls:on,autoClearSearchValue:Xn,dropdownMatchSelectWidth:br,dropdownStyle:(0,Ke.Z)((0,Ke.Z)({},qn),zt),displayValues:Er,onDisplayValuesChange:To,mode:Qt?"multiple":void 0,searchValue:Vr,onSearch:Ot,showSearch:Ri,OptionList:an,emptyOptions:Ie,open:ro,dropdownClassName:fa,placement:Yt,onDropdownVisibleChange:Rn,getRawInputElement:function(){return ni}})))});Dn.SHOW_PARENT=we,Dn.SHOW_CHILD=Ce,Dn.Panel=kt;var Tn=Dn,Mi=Tn},98535:function(Zn,ei,Le){"use strict";Le.r(ei),Le.d(ei,{Panel:function(){return St},default:function(){return wt}});var le=Le(14809),Ke=Le(95190),it=Le(50298),bt=Le(93664),vt=Le(92310),Oe=Le.n(vt),st=Le(18929),Et=Le(48736),ot=Le(59301),We=Le(62646),Tt=Le(11592),ct=Le(20439),At=Le(4635),De=Le(77900),ne=Le(10228),te=ot.forwardRef(function(Lt,pn){var en=Lt.prefixCls,vn=Lt.forceRender,rn=Lt.className,nt=Lt.style,rt=Lt.children,dn=Lt.isActive,ri=Lt.role,Hn=Lt.classNames,Wt=Lt.styles,En=ot.useState(dn||vn),An=(0,it.Z)(En,2),ci=An[0],It=An[1];return ot.useEffect(function(){(vn||dn)&&It(!0)},[vn,dn]),ci?ot.createElement("div",{ref:pn,className:Oe()("".concat(en,"-content"),(0,At.Z)((0,At.Z)({},"".concat(en,"-content-active"),dn),"".concat(en,"-content-inactive"),!dn),rn),style:nt,role:ri},ot.createElement("div",{className:Oe()("".concat(en,"-content-box"),Hn==null?void 0:Hn.body),style:Wt==null?void 0:Wt.body},rt)):null});te.displayName="PanelContent";var de=te,se=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],ge=ot.forwardRef(function(Lt,pn){var en=Lt.showArrow,vn=en===void 0?!0:en,rn=Lt.headerClass,nt=Lt.isActive,rt=Lt.onItemClick,dn=Lt.forceRender,ri=Lt.className,Hn=Lt.classNames,Wt=Hn===void 0?{}:Hn,En=Lt.styles,An=En===void 0?{}:En,ci=Lt.prefixCls,It=Lt.collapsible,Pt=Lt.accordion,Nt=Lt.panelKey,ii=Lt.extra,Gi=Lt.header,ze=Lt.expandIcon,Me=Lt.openMotion,Ee=Lt.destroyInactivePanel,Te=Lt.children,He=(0,We.Z)(Lt,se),Ae=It==="disabled",qe=ii!=null&&typeof ii!="boolean",an=(0,At.Z)((0,At.Z)((0,At.Z)({onClick:function(){rt==null||rt(Nt)},onKeyDown:function(wn){(wn.key==="Enter"||wn.keyCode===ne.Z.ENTER||wn.which===ne.Z.ENTER)&&(rt==null||rt(Nt))},role:Pt?"tab":"button"},"aria-expanded",nt),"aria-disabled",Ae),"tabIndex",Ae?-1:0),Xt=typeof ze=="function"?ze(Lt):ot.createElement("i",{className:"arrow"}),yn=Xt&&ot.createElement("div",(0,le.Z)({className:"".concat(ci,"-expand-icon")},["header","icon"].includes(It)?an:{}),Xt),kt=Oe()("".concat(ci,"-item"),(0,At.Z)((0,At.Z)({},"".concat(ci,"-item-active"),nt),"".concat(ci,"-item-disabled"),Ae),ri),Dt=Oe()(rn,"".concat(ci,"-header"),(0,At.Z)({},"".concat(ci,"-collapsible-").concat(It),!!It),Wt.header),Zt=(0,ct.Z)({className:Dt,style:An.header},["header","icon"].includes(It)?{}:an);return ot.createElement("div",(0,le.Z)({},He,{ref:pn,className:kt}),ot.createElement("div",Zt,vn&&yn,ot.createElement("span",(0,le.Z)({className:"".concat(ci,"-header-text")},It==="header"?an:{}),Gi),qe&&ot.createElement("div",{className:"".concat(ci,"-extra")},ii)),ot.createElement(De.default,(0,le.Z)({visible:nt,leavedClassName:"".concat(ci,"-content-hidden")},Me,{forceRender:dn,removeOnLeave:Ee}),function(hn,wn){var Dn=hn.className,Tn=hn.style;return ot.createElement(de,{ref:wn,prefixCls:ci,className:Dn,classNames:Wt,style:Tn,styles:An,isActive:nt,forceRender:dn,role:Pt?"tabpanel":void 0},Te)}))}),ye=ge,we=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],Ce=function(pn,en){var vn=en.prefixCls,rn=en.accordion,nt=en.collapsible,rt=en.destroyInactivePanel,dn=en.onItemClick,ri=en.activeKey,Hn=en.openMotion,Wt=en.expandIcon;return pn.map(function(En,An){var ci=En.children,It=En.label,Pt=En.key,Nt=En.collapsible,ii=En.onItemClick,Gi=En.destroyInactivePanel,ze=(0,We.Z)(En,we),Me=String(Pt!=null?Pt:An),Ee=Nt!=null?Nt:nt,Te=Gi!=null?Gi:rt,He=function(an){Ee!=="disabled"&&(dn(an),ii==null||ii(an))},Ae=!1;return rn?Ae=ri[0]===Me:Ae=ri.indexOf(Me)>-1,ot.createElement(ye,(0,le.Z)({},ze,{prefixCls:vn,key:Me,panelKey:Me,isActive:Ae,accordion:rn,openMotion:Hn,expandIcon:Wt,header:It,collapsible:Ee,onItemClick:He,destroyInactivePanel:Te}),ci)})},_e=function(pn,en,vn){if(!pn)return null;var rn=vn.prefixCls,nt=vn.accordion,rt=vn.collapsible,dn=vn.destroyInactivePanel,ri=vn.onItemClick,Hn=vn.activeKey,Wt=vn.openMotion,En=vn.expandIcon,An=pn.key||String(en),ci=pn.props,It=ci.header,Pt=ci.headerClass,Nt=ci.destroyInactivePanel,ii=ci.collapsible,Gi=ci.onItemClick,ze=!1;nt?ze=Hn[0]===An:ze=Hn.indexOf(An)>-1;var Me=ii!=null?ii:rt,Ee=function(Ae){Me!=="disabled"&&(ri(Ae),Gi==null||Gi(Ae))},Te={key:An,panelKey:An,header:It,headerClass:Pt,isActive:ze,prefixCls:rn,destroyInactivePanel:Nt!=null?Nt:dn,openMotion:Wt,accordion:nt,children:pn.props.children,onItemClick:Ee,expandIcon:En,collapsible:Me};return typeof pn.type=="string"?pn:(Object.keys(Te).forEach(function(He){typeof Te[He]=="undefined"&&delete Te[He]}),ot.cloneElement(pn,Te))};function Ze(Lt,pn,en){return Array.isArray(Lt)?Ce(Lt,en):(0,Tt.Z)(pn).map(function(vn,rn){return _e(vn,rn,en)})}var lt=Ze,Qe=Le(26112);function Ue(Lt){var pn=Lt;if(!Array.isArray(pn)){var en=(0,bt.Z)(pn);pn=en==="number"||en==="string"?[pn]:[]}return pn.map(function(vn){return String(vn)})}var dt=ot.forwardRef(function(Lt,pn){var en=Lt.prefixCls,vn=en===void 0?"rc-collapse":en,rn=Lt.destroyInactivePanel,nt=rn===void 0?!1:rn,rt=Lt.style,dn=Lt.accordion,ri=Lt.className,Hn=Lt.children,Wt=Lt.collapsible,En=Lt.openMotion,An=Lt.expandIcon,ci=Lt.activeKey,It=Lt.defaultActiveKey,Pt=Lt.onChange,Nt=Lt.items,ii=Oe()(vn,ri),Gi=(0,st.Z)([],{value:ci,onChange:function(qe){return Pt==null?void 0:Pt(qe)},defaultValue:It,postState:Ue}),ze=(0,it.Z)(Gi,2),Me=ze[0],Ee=ze[1],Te=function(qe){return Ee(function(){if(dn)return Me[0]===qe?[]:[qe];var an=Me.indexOf(qe),Xt=an>-1;return Xt?Me.filter(function(yn){return yn!==qe}):[].concat((0,Ke.Z)(Me),[qe])})};(0,Et.ZP)(!Hn,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var He=lt(Nt,Hn,{prefixCls:vn,accordion:dn,openMotion:En,expandIcon:An,collapsible:Wt,destroyInactivePanel:nt,onItemClick:Te,activeKey:Me});return ot.createElement("div",(0,le.Z)({ref:pn,className:ii,style:rt,role:dn?"tablist":void 0},(0,Qe.Z)(Lt,{aria:!0,data:!0})),He)}),$e=Object.assign(dt,{Panel:ye}),wt=$e,St=$e.Panel},23425:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Ze}});var le=Le(4635),Ke=Le(14809),it=Le(93664),bt=Le(20439),vt=Le(50298),Oe=Le(92310),st=Le.n(Oe),Et=Le(18929),ot=Le(10228),We=Le(26112),Tt=Le(48736),ct=Le(59301),At=Le(17119),De=[10,20,50,100],ne=function(Qe){var Ue=Qe.pageSizeOptions,dt=Ue===void 0?De:Ue,$e=Qe.locale,wt=Qe.changeSize,St=Qe.pageSize,Lt=Qe.goButton,pn=Qe.quickGo,en=Qe.rootPrefixCls,vn=Qe.disabled,rn=Qe.buildOptionText,nt=Qe.showSizeChanger,rt=Qe.sizeChangerRender,dn=ct.useState(""),ri=(0,vt.Z)(dn,2),Hn=ri[0],Wt=ri[1],En=function(){return!Hn||Number.isNaN(Hn)?void 0:Number(Hn)},An=typeof rn=="function"?rn:function(Ee){return"".concat(Ee," ").concat($e.items_per_page)},ci=function(Te){Wt(Te.target.value)},It=function(Te){Lt||Hn===""||(Wt(""),!(Te.relatedTarget&&(Te.relatedTarget.className.indexOf("".concat(en,"-item-link"))>=0||Te.relatedTarget.className.indexOf("".concat(en,"-item"))>=0))&&(pn==null||pn(En())))},Pt=function(Te){Hn!==""&&(Te.keyCode===ot.Z.ENTER||Te.type==="click")&&(Wt(""),pn==null||pn(En()))},Nt=function(){return dt.some(function(Te){return Te.toString()===St.toString()})?dt:dt.concat([St]).sort(function(Te,He){var Ae=Number.isNaN(Number(Te))?0:Number(Te),qe=Number.isNaN(Number(He))?0:Number(He);return Ae-qe})},ii="".concat(en,"-options");if(!nt&&!pn)return null;var Gi=null,ze=null,Me=null;return nt&&rt&&(Gi=rt({disabled:vn,size:St,onSizeChange:function(Te){wt==null||wt(Number(Te))},"aria-label":$e.page_size,className:"".concat(ii,"-size-changer"),options:Nt().map(function(Ee){return{label:An(Ee),value:Ee}})})),pn&&(Lt&&(Me=typeof Lt=="boolean"?ct.createElement("button",{type:"button",onClick:Pt,onKeyUp:Pt,disabled:vn,className:"".concat(ii,"-quick-jumper-button")},$e.jump_to_confirm):ct.createElement("span",{onClick:Pt,onKeyUp:Pt},Lt)),ze=ct.createElement("div",{className:"".concat(ii,"-quick-jumper")},$e.jump_to,ct.createElement("input",{disabled:vn,type:"text",value:Hn,onChange:ci,onKeyUp:Pt,onBlur:It,"aria-label":$e.page}),$e.page,Me)),ct.createElement("li",{className:ii},Gi,ze)},te=ne,de=function(Qe){var Ue=Qe.rootPrefixCls,dt=Qe.page,$e=Qe.active,wt=Qe.className,St=Qe.showTitle,Lt=Qe.onClick,pn=Qe.onKeyPress,en=Qe.itemRender,vn="".concat(Ue,"-item"),rn=st()(vn,"".concat(vn,"-").concat(dt),(0,le.Z)((0,le.Z)({},"".concat(vn,"-active"),$e),"".concat(vn,"-disabled"),!dt),wt),nt=function(){Lt(dt)},rt=function(Hn){pn(Hn,Lt,dt)},dn=en(dt,"page",ct.createElement("a",{rel:"nofollow"},dt));return dn?ct.createElement("li",{title:St?String(dt):null,className:rn,onClick:nt,onKeyDown:rt,tabIndex:0},dn):null},se=de,ge=function(Qe,Ue,dt){return dt};function ye(){}function we(lt){var Qe=Number(lt);return typeof Qe=="number"&&!Number.isNaN(Qe)&&isFinite(Qe)&&Math.floor(Qe)===Qe}function Ce(lt,Qe,Ue){var dt=typeof lt=="undefined"?Qe:lt;return Math.floor((Ue-1)/dt)+1}var _e=function(Qe){var Ue=Qe.prefixCls,dt=Ue===void 0?"rc-pagination":Ue,$e=Qe.selectPrefixCls,wt=$e===void 0?"rc-select":$e,St=Qe.className,Lt=Qe.current,pn=Qe.defaultCurrent,en=pn===void 0?1:pn,vn=Qe.total,rn=vn===void 0?0:vn,nt=Qe.pageSize,rt=Qe.defaultPageSize,dn=rt===void 0?10:rt,ri=Qe.onChange,Hn=ri===void 0?ye:ri,Wt=Qe.hideOnSinglePage,En=Qe.align,An=Qe.showPrevNextJumpers,ci=An===void 0?!0:An,It=Qe.showQuickJumper,Pt=Qe.showLessItems,Nt=Qe.showTitle,ii=Nt===void 0?!0:Nt,Gi=Qe.onShowSizeChange,ze=Gi===void 0?ye:Gi,Me=Qe.locale,Ee=Me===void 0?At.Z:Me,Te=Qe.style,He=Qe.totalBoundaryShowSizeChanger,Ae=He===void 0?50:He,qe=Qe.disabled,an=Qe.simple,Xt=Qe.showTotal,yn=Qe.showSizeChanger,kt=yn===void 0?rn>Ae:yn,Dt=Qe.sizeChangerRender,Zt=Qe.pageSizeOptions,hn=Qe.itemRender,wn=hn===void 0?ge:hn,Dn=Qe.jumpPrevIcon,Tn=Qe.jumpNextIcon,Mi=Qe.prevIcon,tn=Qe.nextIcon,qt=ct.useRef(null),un=(0,Et.Z)(10,{value:nt,defaultValue:dn}),zn=(0,vt.Z)(un,2),on=zn[0],Sn=zn[1],di=(0,Et.Z)(1,{value:Lt,defaultValue:en,postState:function(Do){return Math.max(1,Math.min(Do,Ce(void 0,on,rn)))}}),Ui=(0,vt.Z)(di,2),gi=Ui[0],Hi=Ui[1],kr=ct.useState(gi),Gn=(0,vt.Z)(kr,2),On=Gn[0],Xn=Gn[1];(0,ct.useEffect)(function(){Xn(gi)},[gi]);var wi=Hn!==ye,nr="current"in Qe,ji=Math.max(1,gi-(Pt?3:5)),Cr=Math.min(Ce(void 0,on,rn),gi+(Pt?3:5));function be(Er,Do){var wr=Er||ct.createElement("button",{type:"button","aria-label":Do,className:"".concat(dt,"-item-link")});return typeof Er=="function"&&(wr=ct.createElement(Er,(0,bt.Z)({},Qe))),wr}function mn(Er){var Do=Er.target.value,wr=Ce(void 0,on,rn),Qo;return Do===""?Qo=Do:Number.isNaN(Number(Do))?Qo=On:Do>=wr?Qo=wr:Qo=Number(Do),Qo}function fi(Er){return we(Er)&&Er!==gi&&we(rn)&&rn>0}var Vn=rn>on?It:!1;function si(Er){(Er.keyCode===ot.Z.UP||Er.keyCode===ot.Z.DOWN)&&Er.preventDefault()}function Di(Er){var Do=mn(Er);switch(Do!==On&&Xn(Do),Er.keyCode){case ot.Z.ENTER:zt(Do);break;case ot.Z.UP:zt(Do-1);break;case ot.Z.DOWN:zt(Do+1);break;default:break}}function Ni(Er){zt(mn(Er))}function yr(Er){var Do=Ce(Er,on,rn),wr=gi>Do&&Do!==0?Do:gi;Sn(Er),Xn(wr),ze==null||ze(gi,Er),Hi(wr),Hn==null||Hn(wr,Er)}function zt(Er){if(fi(Er)&&!qe){var Do=Ce(void 0,on,rn),wr=Er;return Er>Do?wr=Do:Er<1&&(wr=1),wr!==On&&Xn(wr),Hi(wr),Hn==null||Hn(wr,on),wr}return gi}var Mt=gi>1,_t=gi<Ce(void 0,on,rn);function fn(){Mt&&zt(gi-1)}function Ji(){_t&&zt(gi+1)}function mi(){zt(ji)}function $i(){zt(Cr)}function xn(Er,Do){if(Er.key==="Enter"||Er.charCode===ot.Z.ENTER||Er.keyCode===ot.Z.ENTER){for(var wr=arguments.length,Qo=new Array(wr>2?wr-2:0),To=2;To<wr;To++)Qo[To-2]=arguments[To];Do.apply(void 0,Qo)}}function ni(Er){xn(Er,fn)}function sr(Er){xn(Er,Ji)}function br(Er){xn(Er,mi)}function Yn(Er){xn(Er,$i)}function at(Er){var Do=wn(Er,"prev",be(Mi,"prev page"));return ct.isValidElement(Do)?ct.cloneElement(Do,{disabled:!Mt}):Do}function Bt(Er){var Do=wn(Er,"next",be(tn,"next page"));return ct.isValidElement(Do)?ct.cloneElement(Do,{disabled:!_t}):Do}function Kn(Er){(Er.type==="click"||Er.keyCode===ot.Z.ENTER)&&zt(On)}var li=null,Qt=(0,We.Z)(Qe,{aria:!0,data:!0}),jt=Xt&&ct.createElement("li",{className:"".concat(dt,"-total-text")},Xt(rn,[rn===0?0:(gi-1)*on+1,gi*on>rn?rn:gi*on])),Un=null,ai=Ce(void 0,on,rn);if(Wt&&rn<=on)return null;var Vi=[],xi={rootPrefixCls:dt,onClick:zt,onKeyPress:xn,showTitle:ii,itemRender:wn,page:-1},Bi=gi-1>0?gi-1:0,Ii=gi+1<ai?gi+1:ai,Pr=It&&It.goButton,xr=(0,it.Z)(an)==="object"?an.readOnly:!an,_n=Pr,ki=null;an&&(Pr&&(typeof Pr=="boolean"?_n=ct.createElement("button",{type:"button",onClick:Kn,onKeyUp:Kn},Ee.jump_to_confirm):_n=ct.createElement("span",{onClick:Kn,onKeyUp:Kn},Pr),_n=ct.createElement("li",{title:ii?"".concat(Ee.jump_to).concat(gi,"/").concat(ai):null,className:"".concat(dt,"-simple-pager")},_n)),ki=ct.createElement("li",{title:ii?"".concat(gi,"/").concat(ai):null,className:"".concat(dt,"-simple-pager")},xr?On:ct.createElement("input",{type:"text","aria-label":Ee.jump_to,value:On,disabled:qe,onKeyDown:si,onKeyUp:Di,onChange:Di,onBlur:Ni,size:3}),ct.createElement("span",{className:"".concat(dt,"-slash")},"/"),ai));var Ar=Pt?1:2;if(ai<=3+Ar*2){ai||Vi.push(ct.createElement(se,(0,Ke.Z)({},xi,{key:"noPager",page:1,className:"".concat(dt,"-item-disabled")})));for(var Vr=1;Vr<=ai;Vr+=1)Vi.push(ct.createElement(se,(0,Ke.Z)({},xi,{key:Vr,page:Vr,active:gi===Vr})))}else{var xo=Pt?Ee.prev_3:Ee.prev_5,Ot=Pt?Ee.next_3:Ee.next_5,Li=wn(ji,"jump-prev",be(Dn,"prev page")),Sr=wn(Cr,"jump-next",be(Tn,"next page"));ci&&(li=Li?ct.createElement("li",{title:ii?xo:null,key:"prev",onClick:mi,tabIndex:0,onKeyDown:br,className:st()("".concat(dt,"-jump-prev"),(0,le.Z)({},"".concat(dt,"-jump-prev-custom-icon"),!!Dn))},Li):null,Un=Sr?ct.createElement("li",{title:ii?Ot:null,key:"next",onClick:$i,tabIndex:0,onKeyDown:Yn,className:st()("".concat(dt,"-jump-next"),(0,le.Z)({},"".concat(dt,"-jump-next-custom-icon"),!!Tn))},Sr):null);var Ri=Math.max(1,gi-Ar),po=Math.min(gi+Ar,ai);gi-1<=Ar&&(po=1+Ar*2),ai-gi<=Ar&&(Ri=ai-Ar*2);for(var Qr=Ri;Qr<=po;Qr+=1)Vi.push(ct.createElement(se,(0,Ke.Z)({},xi,{key:Qr,page:Qr,active:gi===Qr})));if(gi-1>=Ar*2&&gi!==3&&(Vi[0]=ct.cloneElement(Vi[0],{className:st()("".concat(dt,"-item-after-jump-prev"),Vi[0].props.className)}),Vi.unshift(li)),ai-gi>=Ar*2&&gi!==ai-2){var mo=Vi[Vi.length-1];Vi[Vi.length-1]=ct.cloneElement(mo,{className:st()("".concat(dt,"-item-before-jump-next"),mo.props.className)}),Vi.push(Un)}Ri!==1&&Vi.unshift(ct.createElement(se,(0,Ke.Z)({},xi,{key:1,page:1}))),po!==ai&&Vi.push(ct.createElement(se,(0,Ke.Z)({},xi,{key:ai,page:ai})))}var fo=at(Bi);if(fo){var wo=!Mt||!ai;fo=ct.createElement("li",{title:ii?Ee.prev_page:null,onClick:fn,tabIndex:wo?null:0,onKeyDown:ni,className:st()("".concat(dt,"-prev"),(0,le.Z)({},"".concat(dt,"-disabled"),wo)),"aria-disabled":wo},fo)}var Io=Bt(Ii);if(Io){var Bn,ca;an?(Bn=!_t,ca=Mt?0:null):(Bn=!_t||!ai,ca=Bn?null:0),Io=ct.createElement("li",{title:ii?Ee.next_page:null,onClick:Ji,tabIndex:ca,onKeyDown:sr,className:st()("".concat(dt,"-next"),(0,le.Z)({},"".concat(dt,"-disabled"),Bn)),"aria-disabled":Bn},Io)}var In=st()(dt,St,(0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)({},"".concat(dt,"-start"),En==="start"),"".concat(dt,"-center"),En==="center"),"".concat(dt,"-end"),En==="end"),"".concat(dt,"-simple"),an),"".concat(dt,"-disabled"),qe));return ct.createElement("ul",(0,Ke.Z)({className:In,style:Te,ref:qt},Qt),jt,fo,an?ki:Vi,Io,ct.createElement(te,{locale:Ee,rootPrefixCls:dt,disabled:qe,selectPrefixCls:wt,changeSize:yr,pageSize:on,pageSizeOptions:Zt,quickGo:Vn?zt:null,goButton:_n,showSizeChanger:kt,sizeChangerRender:Dt}))},Ze=_e},738:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return ye}});var le=Le(14809),Ke=Le(4635),it=Le(50298),bt=Le(62646),vt=Le(92310),Oe=Le.n(vt),st=Le(18929),Et=Le(10228),ot=Le(26112),We=Le(59301);function Tt(we,Ce){var _e=we.disabled,Ze=we.prefixCls,lt=we.character,Qe=we.characterRender,Ue=we.index,dt=we.count,$e=we.value,wt=we.allowHalf,St=we.focused,Lt=we.onHover,pn=we.onClick,en=function(Wt){Lt(Wt,Ue)},vn=function(Wt){pn(Wt,Ue)},rn=function(Wt){Wt.keyCode===Et.Z.ENTER&&pn(Wt,Ue)},nt=Ue+1,rt=new Set([Ze]);$e===0&&Ue===0&&St?rt.add("".concat(Ze,"-focused")):wt&&$e+.5>=nt&&$e<nt?(rt.add("".concat(Ze,"-half")),rt.add("".concat(Ze,"-active")),St&&rt.add("".concat(Ze,"-focused"))):(nt<=$e?rt.add("".concat(Ze,"-full")):rt.add("".concat(Ze,"-zero")),nt===$e&&St&&rt.add("".concat(Ze,"-focused")));var dn=typeof lt=="function"?lt(we):lt,ri=We.createElement("li",{className:Oe()(Array.from(rt)),ref:Ce},We.createElement("div",{onClick:_e?null:vn,onKeyDown:_e?null:rn,onMouseMove:_e?null:en,role:"radio","aria-checked":$e>Ue?"true":"false","aria-posinset":Ue+1,"aria-setsize":dt,tabIndex:_e?-1:0},We.createElement("div",{className:"".concat(Ze,"-first")},dn),We.createElement("div",{className:"".concat(Ze,"-second")},dn)));return Qe&&(ri=Qe(ri,we)),ri}var ct=We.forwardRef(Tt);function At(){var we=We.useRef({});function Ce(Ze){return we.current[Ze]}function _e(Ze){return function(lt){we.current[Ze]=lt}}return[Ce,_e]}function De(we){var Ce=we.pageXOffset,_e="scrollLeft";if(typeof Ce!="number"){var Ze=we.document;Ce=Ze.documentElement[_e],typeof Ce!="number"&&(Ce=Ze.body[_e])}return Ce}function ne(we){var Ce,_e,Ze=we.ownerDocument,lt=Ze.body,Qe=Ze&&Ze.documentElement,Ue=we.getBoundingClientRect();return Ce=Ue.left,_e=Ue.top,Ce-=Qe.clientLeft||lt.clientLeft||0,_e-=Qe.clientTop||lt.clientTop||0,{left:Ce,top:_e}}function te(we){var Ce=ne(we),_e=we.ownerDocument,Ze=_e.defaultView||_e.parentWindow;return Ce.left+=De(Ze),Ce.left}var de=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function se(we,Ce){var _e=we.prefixCls,Ze=_e===void 0?"rc-rate":_e,lt=we.className,Qe=we.defaultValue,Ue=we.value,dt=we.count,$e=dt===void 0?5:dt,wt=we.allowHalf,St=wt===void 0?!1:wt,Lt=we.allowClear,pn=Lt===void 0?!0:Lt,en=we.keyboard,vn=en===void 0?!0:en,rn=we.character,nt=rn===void 0?"\u2605":rn,rt=we.characterRender,dn=we.disabled,ri=we.direction,Hn=ri===void 0?"ltr":ri,Wt=we.tabIndex,En=Wt===void 0?0:Wt,An=we.autoFocus,ci=we.onHoverChange,It=we.onChange,Pt=we.onFocus,Nt=we.onBlur,ii=we.onKeyDown,Gi=we.onMouseLeave,ze=(0,bt.Z)(we,de),Me=At(),Ee=(0,it.Z)(Me,2),Te=Ee[0],He=Ee[1],Ae=We.useRef(null),qe=function(){if(!dn){var ji;(ji=Ae.current)===null||ji===void 0||ji.focus()}};We.useImperativeHandle(Ce,function(){return{focus:qe,blur:function(){if(!dn){var ji;(ji=Ae.current)===null||ji===void 0||ji.blur()}}}});var an=(0,st.Z)(Qe||0,{value:Ue}),Xt=(0,it.Z)(an,2),yn=Xt[0],kt=Xt[1],Dt=(0,st.Z)(null),Zt=(0,it.Z)(Dt,2),hn=Zt[0],wn=Zt[1],Dn=function(ji,Cr){var be=Hn==="rtl",mn=ji+1;if(St){var fi=Te(ji),Vn=te(fi),si=fi.clientWidth;(be&&Cr-Vn>si/2||!be&&Cr-Vn<si/2)&&(mn-=.5)}return mn},Tn=function(ji){kt(ji),It==null||It(ji)},Mi=We.useState(!1),tn=(0,it.Z)(Mi,2),qt=tn[0],un=tn[1],zn=function(){un(!0),Pt==null||Pt()},on=function(){un(!1),Nt==null||Nt()},Sn=We.useState(null),di=(0,it.Z)(Sn,2),Ui=di[0],gi=di[1],Hi=function(ji,Cr){var be=Dn(Cr,ji.pageX);be!==hn&&(gi(be),wn(null)),ci==null||ci(be)},kr=function(ji){dn||(gi(null),wn(null),ci==null||ci(void 0)),ji&&(Gi==null||Gi(ji))},Gn=function(ji,Cr){var be=Dn(Cr,ji.pageX),mn=!1;pn&&(mn=be===yn),kr(),Tn(mn?0:be),wn(mn?be:null)},On=function(ji){var Cr=ji.keyCode,be=Hn==="rtl",mn=St?.5:1;vn&&(Cr===Et.Z.RIGHT&&yn<$e&&!be?(Tn(yn+mn),ji.preventDefault()):Cr===Et.Z.LEFT&&yn>0&&!be||Cr===Et.Z.RIGHT&&yn>0&&be?(Tn(yn-mn),ji.preventDefault()):Cr===Et.Z.LEFT&&yn<$e&&be&&(Tn(yn+mn),ji.preventDefault())),ii==null||ii(ji)};We.useEffect(function(){An&&!dn&&qe()},[]);var Xn=new Array($e).fill(0).map(function(nr,ji){return We.createElement(ct,{ref:He(ji),index:ji,count:$e,disabled:dn,prefixCls:"".concat(Ze,"-star"),allowHalf:St,value:Ui===null?yn:Ui,onClick:Gn,onHover:Hi,key:nr||ji,character:nt,characterRender:rt,focused:qt})}),wi=Oe()(Ze,lt,(0,Ke.Z)((0,Ke.Z)({},"".concat(Ze,"-disabled"),dn),"".concat(Ze,"-rtl"),Hn==="rtl"));return We.createElement("ul",(0,le.Z)({className:wi,onMouseLeave:kr,tabIndex:dn?-1:En,onFocus:dn?null:zn,onBlur:dn?null:on,onKeyDown:dn?null:On,ref:Ae},(0,ot.Z)(ze,{aria:!0,data:!0,attr:!0})),Xn)}var ge=We.forwardRef(se),ye=ge},6551:function(Zn,ei,Le){"use strict";Le.d(ei,{ZP:function(){return st}});var le=Le(50298),Ke=Le(59301),it=Le(47273),bt=0,vt=(0,it.Z)();function Oe(){var Et;return vt?(Et=bt,bt+=1):Et="TEST_OR_SSR",Et}function st(Et){var ot=Ke.useState(),We=(0,le.Z)(ot,2),Tt=We[0],ct=We[1];return Ke.useEffect(function(){ct("rc_select_".concat(Oe()))},[]),Et||Tt}},37463:function(Zn,ei,Le){"use strict";Le.d(ei,{Ac:function(){return un},Xo:function(){return on},Wx:function(){return di},ZP:function(){return Yn},lk:function(){return ye}});var le=Le(14809),Ke=Le(95190),it=Le(4635),bt=Le(20439),vt=Le(50298),Oe=Le(62646),st=Le(93664),Et=Le(18929),ot=Le(48736),We=Le(59301),Tt=Le(92310),ct=Le.n(Tt),At=Le(34280),De=Le(49658),ne=Le(8654),te=function(Bt){var Kn=Bt.className,li=Bt.customizeIcon,Qt=Bt.customizeIconProps,jt=Bt.children,Un=Bt.onMouseDown,ai=Bt.onClick,Vi=typeof li=="function"?li(Qt):li;return We.createElement("span",{className:Kn,onMouseDown:function(Bi){Bi.preventDefault(),Un==null||Un(Bi)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:ai,"aria-hidden":!0},Vi!==void 0?Vi:We.createElement("span",{className:ct()(Kn.split(/\s+/).map(function(xi){return"".concat(xi,"-icon")}))},jt))},de=te,se=function(Bt,Kn,li,Qt,jt){var Un=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,ai=arguments.length>6?arguments[6]:void 0,Vi=arguments.length>7?arguments[7]:void 0,xi=We.useMemo(function(){if((0,st.Z)(Qt)==="object")return Qt.clearIcon;if(jt)return jt},[Qt,jt]),Bi=We.useMemo(function(){return!!(!Un&&Qt&&(li.length||ai)&&!(Vi==="combobox"&&ai===""))},[Qt,Un,li.length,ai,Vi]);return{allowClear:Bi,clearIcon:We.createElement(de,{className:"".concat(Bt,"-clear"),onMouseDown:Kn,customizeIcon:xi},"\xD7")}},ge=We.createContext(null);function ye(){return We.useContext(ge)}function we(){var at=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Bt=We.useState(!1),Kn=(0,vt.Z)(Bt,2),li=Kn[0],Qt=Kn[1],jt=We.useRef(null),Un=function(){window.clearTimeout(jt.current)};We.useEffect(function(){return Un},[]);var ai=function(xi,Bi){Un(),jt.current=window.setTimeout(function(){Qt(xi),Bi&&Bi()},at)};return[li,ai,Un]}function Ce(){var at=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Bt=We.useRef(null),Kn=We.useRef(null);We.useEffect(function(){return function(){window.clearTimeout(Kn.current)}},[]);function li(Qt){(Qt||Bt.current===null)&&(Bt.current=Qt),window.clearTimeout(Kn.current),Kn.current=window.setTimeout(function(){Bt.current=null},at)}return[function(){return Bt.current},li]}function _e(at,Bt,Kn,li){var Qt=We.useRef(null);Qt.current={open:Bt,triggerOpen:Kn,customizedTrigger:li},We.useEffect(function(){function jt(Un){var ai;if(!((ai=Qt.current)!==null&&ai!==void 0&&ai.customizedTrigger)){var Vi=Un.target;Vi.shadowRoot&&Un.composed&&(Vi=Un.composedPath()[0]||Vi),Qt.current.open&&at().filter(function(xi){return xi}).every(function(xi){return!xi.contains(Vi)&&xi!==Vi})&&Qt.current.triggerOpen(!1)}}return window.addEventListener("mousedown",jt),function(){return window.removeEventListener("mousedown",jt)}},[])}var Ze=Le(10228);function lt(at){return at&&![Ze.Z.ESC,Ze.Z.SHIFT,Ze.Z.BACKSPACE,Ze.Z.TAB,Ze.Z.WIN_KEY,Ze.Z.ALT,Ze.Z.META,Ze.Z.WIN_KEY_RIGHT,Ze.Z.CTRL,Ze.Z.SEMICOLON,Ze.Z.EQUALS,Ze.Z.CAPS_LOCK,Ze.Z.CONTEXT_MENU,Ze.Z.F1,Ze.Z.F2,Ze.Z.F3,Ze.Z.F4,Ze.Z.F5,Ze.Z.F6,Ze.Z.F7,Ze.Z.F8,Ze.Z.F9,Ze.Z.F10,Ze.Z.F11,Ze.Z.F12].includes(at)}var Qe=Le(26112),Ue=Le(11780);function dt(at,Bt,Kn){var li=(0,bt.Z)((0,bt.Z)({},at),Kn?Bt:{});return Object.keys(Bt).forEach(function(Qt){var jt=Bt[Qt];typeof jt=="function"&&(li[Qt]=function(){for(var Un,ai=arguments.length,Vi=new Array(ai),xi=0;xi<ai;xi++)Vi[xi]=arguments[xi];return jt.apply(void 0,Vi),(Un=at[Qt])===null||Un===void 0?void 0:Un.call.apply(Un,[at].concat(Vi))})}),li}var $e=dt,wt=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],St=function(Bt,Kn){var li=Bt.prefixCls,Qt=Bt.id,jt=Bt.inputElement,Un=Bt.autoFocus,ai=Bt.autoComplete,Vi=Bt.editable,xi=Bt.activeDescendantId,Bi=Bt.value,Ii=Bt.open,Pr=Bt.attrs,xr=(0,Oe.Z)(Bt,wt),_n=jt||We.createElement("input",null),ki=_n,Ar=ki.ref,Vr=ki.props;return(0,ot.Kp)(!("maxLength"in _n.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),_n=We.cloneElement(_n,(0,bt.Z)((0,bt.Z)((0,bt.Z)({type:"search"},$e(xr,Vr,!0)),{},{id:Qt,ref:(0,ne.sQ)(Kn,Ar),autoComplete:ai||"off",autoFocus:Un,className:ct()("".concat(li,"-selection-search-input"),Vr==null?void 0:Vr.className),role:"combobox","aria-expanded":Ii||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Qt,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Qt,"_list"),"aria-activedescendant":Ii?xi:void 0},Pr),{},{value:Vi?Bi:"",readOnly:!Vi,unselectable:Vi?null:"on",style:(0,bt.Z)((0,bt.Z)({},Vr.style),{},{opacity:Vi?null:0})})),_n},Lt=We.forwardRef(St),pn=Lt;function en(at){return Array.isArray(at)?at:at!==void 0?[at]:[]}var vn=typeof window!="undefined"&&window.document&&window.document.documentElement,rn=vn;function nt(at){return at!=null}function rt(at){return!at&&at!==0}function dn(at){return["string","number"].includes((0,st.Z)(at))}function ri(at){var Bt=void 0;return at&&(dn(at.title)?Bt=at.title.toString():dn(at.label)&&(Bt=at.label.toString())),Bt}function Hn(at,Bt){rn?We.useLayoutEffect(at,Bt):We.useEffect(at,Bt)}function Wt(at){var Bt;return(Bt=at.key)!==null&&Bt!==void 0?Bt:at.value}var En=function(Bt){Bt.preventDefault(),Bt.stopPropagation()},An=function(Bt){var Kn=Bt.id,li=Bt.prefixCls,Qt=Bt.values,jt=Bt.open,Un=Bt.searchValue,ai=Bt.autoClearSearchValue,Vi=Bt.inputRef,xi=Bt.placeholder,Bi=Bt.disabled,Ii=Bt.mode,Pr=Bt.showSearch,xr=Bt.autoFocus,_n=Bt.autoComplete,ki=Bt.activeDescendantId,Ar=Bt.tabIndex,Vr=Bt.removeIcon,xo=Bt.maxTagCount,Ot=Bt.maxTagTextLength,Li=Bt.maxTagPlaceholder,Sr=Li===void 0?function(vi){return"+ ".concat(vi.length," ...")}:Li,Ri=Bt.tagRender,po=Bt.onToggleOpen,Qr=Bt.onRemove,mo=Bt.onInputChange,fo=Bt.onInputPaste,wo=Bt.onInputKeyDown,Io=Bt.onInputMouseDown,Bn=Bt.onInputCompositionStart,ca=Bt.onInputCompositionEnd,In=Bt.onInputBlur,Er=We.useRef(null),Do=(0,We.useState)(0),wr=(0,vt.Z)(Do,2),Qo=wr[0],To=wr[1],ro=(0,We.useState)(!1),fa=(0,vt.Z)(ro,2),Yt=fa[0],Rn=fa[1],Rt="".concat(li,"-selection"),Ie=jt||Ii==="multiple"&&ai===!1||Ii==="tags"?Un:"",qn=Ii==="tags"||Ii==="multiple"&&ai===!1||Pr&&(jt||Yt);Hn(function(){To(Er.current.scrollWidth)},[Ie]);var Ci=function(ti,ui,hi,Ti,Yi){return We.createElement("span",{title:ri(ti),className:ct()("".concat(Rt,"-item"),(0,it.Z)({},"".concat(Rt,"-item-disabled"),hi))},We.createElement("span",{className:"".concat(Rt,"-item-content")},ui),Ti&&We.createElement(de,{className:"".concat(Rt,"-item-remove"),onMouseDown:En,onClick:Yi,customizeIcon:Vr},"\xD7"))},Oi=function(ti,ui,hi,Ti,Yi,Pn){var Rr=function(Mo){En(Mo),po(!jt)};return We.createElement("span",{onMouseDown:Rr},Ri({label:ui,value:ti,disabled:hi,closable:Ti,onClose:Yi,isMaxTag:!!Pn}))},qi=function(ti){var ui=ti.disabled,hi=ti.label,Ti=ti.value,Yi=!Bi&&!ui,Pn=hi;if(typeof Ot=="number"&&(typeof hi=="string"||typeof hi=="number")){var Rr=String(Pn);Rr.length>Ot&&(Pn="".concat(Rr.slice(0,Ot),"..."))}var cr=function(Wr){Wr&&Wr.stopPropagation(),Qr(ti)};return typeof Ri=="function"?Oi(Ti,Pn,ui,Yi,cr):Ci(ti,Pn,ui,Yi,cr)},zi=function(ti){if(!Qt.length)return null;var ui=typeof Sr=="function"?Sr(ti):Sr;return typeof Ri=="function"?Oi(void 0,ui,!1,!1,void 0,!0):Ci({title:ui},ui,!1)},Nn=We.createElement("div",{className:"".concat(Rt,"-search"),style:{width:Qo},onFocus:function(){Rn(!0)},onBlur:function(){Rn(!1)}},We.createElement(pn,{ref:Vi,open:jt,prefixCls:li,id:Kn,inputElement:null,disabled:Bi,autoFocus:xr,autoComplete:_n,editable:qn,activeDescendantId:ki,value:Ie,onKeyDown:wo,onMouseDown:Io,onChange:mo,onPaste:fo,onCompositionStart:Bn,onCompositionEnd:ca,onBlur:In,tabIndex:Ar,attrs:(0,Qe.Z)(Bt,!0)}),We.createElement("span",{ref:Er,className:"".concat(Rt,"-search-mirror"),"aria-hidden":!0},Ie,"\xA0")),pi=We.createElement(Ue.Z,{prefixCls:"".concat(Rt,"-overflow"),data:Qt,renderItem:qi,renderRest:zi,suffix:Nn,itemKey:Wt,maxCount:xo});return We.createElement("span",{className:"".concat(Rt,"-wrap")},pi,!Qt.length&&!Ie&&We.createElement("span",{className:"".concat(Rt,"-placeholder")},xi))},ci=An,It=function(Bt){var Kn=Bt.inputElement,li=Bt.prefixCls,Qt=Bt.id,jt=Bt.inputRef,Un=Bt.disabled,ai=Bt.autoFocus,Vi=Bt.autoComplete,xi=Bt.activeDescendantId,Bi=Bt.mode,Ii=Bt.open,Pr=Bt.values,xr=Bt.placeholder,_n=Bt.tabIndex,ki=Bt.showSearch,Ar=Bt.searchValue,Vr=Bt.activeValue,xo=Bt.maxLength,Ot=Bt.onInputKeyDown,Li=Bt.onInputMouseDown,Sr=Bt.onInputChange,Ri=Bt.onInputPaste,po=Bt.onInputCompositionStart,Qr=Bt.onInputCompositionEnd,mo=Bt.onInputBlur,fo=Bt.title,wo=We.useState(!1),Io=(0,vt.Z)(wo,2),Bn=Io[0],ca=Io[1],In=Bi==="combobox",Er=In||ki,Do=Pr[0],wr=Ar||"";In&&Vr&&!Bn&&(wr=Vr),We.useEffect(function(){In&&ca(!1)},[In,Vr]);var Qo=Bi!=="combobox"&&!Ii&&!ki?!1:!!wr,To=fo===void 0?ri(Do):fo,ro=We.useMemo(function(){return Do?null:We.createElement("span",{className:"".concat(li,"-selection-placeholder"),style:Qo?{visibility:"hidden"}:void 0},xr)},[Do,Qo,xr,li]);return We.createElement("span",{className:"".concat(li,"-selection-wrap")},We.createElement("span",{className:"".concat(li,"-selection-search")},We.createElement(pn,{ref:jt,prefixCls:li,id:Qt,open:Ii,inputElement:Kn,disabled:Un,autoFocus:ai,autoComplete:Vi,editable:Er,activeDescendantId:xi,value:wr,onKeyDown:Ot,onMouseDown:Li,onChange:function(Yt){ca(!0),Sr(Yt)},onPaste:Ri,onCompositionStart:po,onCompositionEnd:Qr,onBlur:mo,tabIndex:_n,attrs:(0,Qe.Z)(Bt,!0),maxLength:In?xo:void 0})),!In&&Do?We.createElement("span",{className:"".concat(li,"-selection-item"),title:To,style:Qo?{visibility:"hidden"}:void 0},Do.label):null,ro)},Pt=It,Nt=function(Bt,Kn){var li=(0,We.useRef)(null),Qt=(0,We.useRef)(!1),jt=Bt.prefixCls,Un=Bt.open,ai=Bt.mode,Vi=Bt.showSearch,xi=Bt.tokenWithEnter,Bi=Bt.disabled,Ii=Bt.prefix,Pr=Bt.autoClearSearchValue,xr=Bt.onSearch,_n=Bt.onSearchSubmit,ki=Bt.onToggleOpen,Ar=Bt.onInputKeyDown,Vr=Bt.onInputBlur,xo=Bt.domRef;We.useImperativeHandle(Kn,function(){return{focus:function(To){li.current.focus(To)},blur:function(){li.current.blur()}}});var Ot=Ce(0),Li=(0,vt.Z)(Ot,2),Sr=Li[0],Ri=Li[1],po=function(To){var ro=To.which,fa=li.current instanceof HTMLTextAreaElement;!fa&&Un&&(ro===Ze.Z.UP||ro===Ze.Z.DOWN)&&To.preventDefault(),Ar&&Ar(To),ro===Ze.Z.ENTER&&ai==="tags"&&!Qt.current&&!Un&&(_n==null||_n(To.target.value)),!(fa&&!Un&&~[Ze.Z.UP,Ze.Z.DOWN,Ze.Z.LEFT,Ze.Z.RIGHT].indexOf(ro))&&lt(ro)&&ki(!0)},Qr=function(){Ri(!0)},mo=(0,We.useRef)(null),fo=function(To){xr(To,!0,Qt.current)!==!1&&ki(!0)},wo=function(){Qt.current=!0},Io=function(To){Qt.current=!1,ai!=="combobox"&&fo(To.target.value)},Bn=function(To){var ro=To.target.value;if(xi&&mo.current&&/[\r\n]/.test(mo.current)){var fa=mo.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");ro=ro.replace(fa,mo.current)}mo.current=null,fo(ro)},ca=function(To){var ro=To.clipboardData,fa=ro==null?void 0:ro.getData("text");mo.current=fa||""},In=function(To){var ro=To.target;if(ro!==li.current){var fa=document.body.style.msTouchAction!==void 0;fa?setTimeout(function(){li.current.focus()}):li.current.focus()}},Er=function(To){var ro=Sr();To.target!==li.current&&!ro&&!(ai==="combobox"&&Bi)&&To.preventDefault(),(ai!=="combobox"&&(!Vi||!ro)||!Un)&&(Un&&Pr!==!1&&xr("",!0,!1),ki())},Do={inputRef:li,onInputKeyDown:po,onInputMouseDown:Qr,onInputChange:Bn,onInputPaste:ca,onInputCompositionStart:wo,onInputCompositionEnd:Io,onInputBlur:Vr},wr=ai==="multiple"||ai==="tags"?We.createElement(ci,(0,le.Z)({},Bt,Do)):We.createElement(Pt,(0,le.Z)({},Bt,Do));return We.createElement("div",{ref:xo,className:"".concat(jt,"-selector"),onClick:In,onMouseDown:Er},Ii&&We.createElement("div",{className:"".concat(jt,"-prefix")},Ii),wr)},ii=We.forwardRef(Nt),Gi=ii,ze=Le(65966),Me=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Ee=function(Bt){var Kn=Bt===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:Kn,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:Kn,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:Kn,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:Kn,adjustY:1},htmlRegion:"scroll"}}},Te=function(Bt,Kn){var li=Bt.prefixCls,Qt=Bt.disabled,jt=Bt.visible,Un=Bt.children,ai=Bt.popupElement,Vi=Bt.animation,xi=Bt.transitionName,Bi=Bt.dropdownStyle,Ii=Bt.dropdownClassName,Pr=Bt.direction,xr=Pr===void 0?"ltr":Pr,_n=Bt.placement,ki=Bt.builtinPlacements,Ar=Bt.dropdownMatchSelectWidth,Vr=Bt.dropdownRender,xo=Bt.dropdownAlign,Ot=Bt.getPopupContainer,Li=Bt.empty,Sr=Bt.getTriggerDOMNode,Ri=Bt.onPopupVisibleChange,po=Bt.onPopupMouseEnter,Qr=(0,Oe.Z)(Bt,Me),mo="".concat(li,"-dropdown"),fo=ai;Vr&&(fo=Vr(ai));var wo=We.useMemo(function(){return ki||Ee(Ar)},[ki,Ar]),Io=Vi?"".concat(mo,"-").concat(Vi):xi,Bn=typeof Ar=="number",ca=We.useMemo(function(){return Bn?null:Ar===!1?"minWidth":"width"},[Ar,Bn]),In=Bi;Bn&&(In=(0,bt.Z)((0,bt.Z)({},In),{},{width:Ar}));var Er=We.useRef(null);return We.useImperativeHandle(Kn,function(){return{getPopupElement:function(){var wr;return(wr=Er.current)===null||wr===void 0?void 0:wr.popupElement}}}),We.createElement(ze.Z,(0,le.Z)({},Qr,{showAction:Ri?["click"]:[],hideAction:Ri?["click"]:[],popupPlacement:_n||(xr==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:wo,prefixCls:mo,popupTransitionName:Io,popup:We.createElement("div",{onMouseEnter:po},fo),ref:Er,stretch:ca,popupAlign:xo,popupVisible:jt,getPopupContainer:Ot,popupClassName:ct()(Ii,(0,it.Z)({},"".concat(mo,"-empty"),Li)),popupStyle:In,getTriggerDOMNode:Sr,onPopupVisibleChange:Ri}),Un)},He=We.forwardRef(Te),Ae=He,qe=Le(21696);function an(at,Bt){var Kn=at.key,li;return"value"in at&&(li=at.value),Kn!=null?Kn:li!==void 0?li:"rc-index-key-".concat(Bt)}function Xt(at){return typeof at!="undefined"&&!Number.isNaN(at)}function yn(at,Bt){var Kn=at||{},li=Kn.label,Qt=Kn.value,jt=Kn.options,Un=Kn.groupLabel,ai=li||(Bt?"children":"label");return{label:ai,value:Qt||"value",options:jt||"options",groupLabel:Un||ai}}function kt(at){var Bt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Kn=Bt.fieldNames,li=Bt.childrenAsData,Qt=[],jt=yn(Kn,!1),Un=jt.label,ai=jt.value,Vi=jt.options,xi=jt.groupLabel;function Bi(Ii,Pr){Array.isArray(Ii)&&Ii.forEach(function(xr){if(Pr||!(Vi in xr)){var _n=xr[ai];Qt.push({key:an(xr,Qt.length),groupOption:Pr,data:xr,label:xr[Un],value:_n})}else{var ki=xr[xi];ki===void 0&&li&&(ki=xr.label),Qt.push({key:an(xr,Qt.length),group:!0,data:xr,label:ki}),Bi(xr[Vi],!0)}})}return Bi(at,!1),Qt}function Dt(at){var Bt=(0,bt.Z)({},at);return"props"in Bt||Object.defineProperty(Bt,"props",{get:function(){return(0,ot.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Bt}}),Bt}var Zt=function(Bt,Kn,li){if(!Kn||!Kn.length)return null;var Qt=!1,jt=function ai(Vi,xi){var Bi=(0,qe.Z)(xi),Ii=Bi[0],Pr=Bi.slice(1);if(!Ii)return[Vi];var xr=Vi.split(Ii);return Qt=Qt||xr.length>1,xr.reduce(function(_n,ki){return[].concat((0,Ke.Z)(_n),(0,Ke.Z)(ai(ki,Pr)))},[]).filter(Boolean)},Un=jt(Bt,Kn);return Qt?typeof li!="undefined"?Un.slice(0,li):Un:null},hn=We.createContext(null),wn=hn;function Dn(at){var Bt=at.visible,Kn=at.values;if(!Bt)return null;var li=50;return We.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(Kn.slice(0,li).map(function(Qt){var jt=Qt.label,Un=Qt.value;return["number","string"].includes((0,st.Z)(jt))?jt:Un}).join(", ")),Kn.length>li?", ...":null)}var Tn=["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"],Mi=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],tn=function(Bt){return Bt==="tags"||Bt==="multiple"},qt=We.forwardRef(function(at,Bt){var Kn,li=at.id,Qt=at.prefixCls,jt=at.className,Un=at.showSearch,ai=at.tagRender,Vi=at.direction,xi=at.omitDomProps,Bi=at.displayValues,Ii=at.onDisplayValuesChange,Pr=at.emptyOptions,xr=at.notFoundContent,_n=xr===void 0?"Not Found":xr,ki=at.onClear,Ar=at.mode,Vr=at.disabled,xo=at.loading,Ot=at.getInputElement,Li=at.getRawInputElement,Sr=at.open,Ri=at.defaultOpen,po=at.onDropdownVisibleChange,Qr=at.activeValue,mo=at.onActiveValueChange,fo=at.activeDescendantId,wo=at.searchValue,Io=at.autoClearSearchValue,Bn=at.onSearch,ca=at.onSearchSplit,In=at.tokenSeparators,Er=at.allowClear,Do=at.prefix,wr=at.suffixIcon,Qo=at.clearIcon,To=at.OptionList,ro=at.animation,fa=at.transitionName,Yt=at.dropdownStyle,Rn=at.dropdownClassName,Rt=at.dropdownMatchSelectWidth,Ie=at.dropdownRender,qn=at.dropdownAlign,Ci=at.placement,Oi=at.builtinPlacements,qi=at.getPopupContainer,zi=at.showAction,Nn=zi===void 0?[]:zi,pi=at.onFocus,vi=at.onBlur,ti=at.onKeyUp,ui=at.onKeyDown,hi=at.onMouseDown,Ti=(0,Oe.Z)(at,Tn),Yi=tn(Ar),Pn=(Un!==void 0?Un:Yi)||Ar==="combobox",Rr=(0,bt.Z)({},Ti);Mi.forEach(function(_o){delete Rr[_o]}),xi==null||xi.forEach(function(_o){delete Rr[_o]});var cr=We.useState(!1),Mo=(0,vt.Z)(cr,2),Wr=Mo[0],Vo=Mo[1];We.useEffect(function(){Vo((0,De.Z)())},[]);var Wo=We.useRef(null),ua=We.useRef(null),Xo=We.useRef(null),aa=We.useRef(null),Pa=We.useRef(null),Gt=We.useRef(!1),qo=we(),fr=(0,vt.Z)(qo,3),ao=fr[0],zr=fr[1],Jo=fr[2];We.useImperativeHandle(Bt,function(){var _o,oa;return{focus:(_o=aa.current)===null||_o===void 0?void 0:_o.focus,blur:(oa=aa.current)===null||oa===void 0?void 0:oa.blur,scrollTo:function(pt){var Ut;return(Ut=Pa.current)===null||Ut===void 0?void 0:Ut.scrollTo(pt)},nativeElement:Wo.current||ua.current}});var va=We.useMemo(function(){var _o;if(Ar!=="combobox")return wo;var oa=(_o=Bi[0])===null||_o===void 0?void 0:_o.value;return typeof oa=="string"||typeof oa=="number"?String(oa):""},[wo,Ar,Bi]),ma=Ar==="combobox"&&typeof Ot=="function"&&Ot()||null,ko=typeof Li=="function"&&Li(),So=(0,ne.x1)(ua,ko==null||(Kn=ko.props)===null||Kn===void 0?void 0:Kn.ref),$a=We.useState(!1),gs=(0,vt.Z)($a,2),ls=gs[0],ps=gs[1];(0,At.Z)(function(){ps(!0)},[]);var $r=(0,Et.Z)(!1,{defaultValue:Ri,value:Sr}),Ka=(0,vt.Z)($r,2),Ma=Ka[0],ns=Ka[1],qa=ls?Ma:!1,ts=!_n&&Pr;(Vr||ts&&qa&&Ar==="combobox")&&(qa=!1);var Xi=ts?!1:qa,Xr=We.useCallback(function(_o){var oa=_o!==void 0?_o:!qa;Vr||(ns(oa),qa!==oa&&(po==null||po(oa)))},[Vr,qa,ns,po]),Co=We.useMemo(function(){return(In||[]).some(function(_o){return[`
`,`\r
`].includes(_o)})},[In]),Zo=We.useContext(wn)||{},Ko=Zo.maxCount,ba=Zo.rawValues,Kr=function(oa,Ua,pt){if(!(Yi&&Xt(Ko)&&(ba==null?void 0:ba.size)>=Ko)){var Ut=!0,Re=oa;mo==null||mo(null);var ut=Zt(oa,In,Xt(Ko)?Ko-ba.size:void 0),dr=pt?null:ut;return Ar!=="combobox"&&dr&&(Re="",ca==null||ca(dr),Xr(!1),Ut=!1),Bn&&va!==Re&&Bn(Re,{source:Ua?"typing":"effect"}),Ut}},Rs=function(oa){!oa||!oa.trim()||Bn(oa,{source:"submit"})};We.useEffect(function(){!qa&&!Yi&&Ar!=="combobox"&&Kr("",!1,!1)},[qa]),We.useEffect(function(){Ma&&Vr&&ns(!1),Vr&&!Gt.current&&zr(!1)},[Vr]);var Za=Ce(),nn=(0,vt.Z)(Za,2),Ht=nn[0],Fn=nn[1],Wi=We.useRef(!1),Si=function(oa){var Ua=Ht(),pt=oa.key,Ut=pt==="Enter";if(Ut&&(Ar!=="combobox"&&oa.preventDefault(),qa||Xr(!0)),Fn(!!va),pt==="Backspace"&&!Ua&&Yi&&!va&&Bi.length){for(var Re=(0,Ke.Z)(Bi),ut=null,dr=Re.length-1;dr>=0;dr-=1){var lr=Re[dr];if(!lr.disabled){Re.splice(dr,1),ut=lr;break}}ut&&Ii(Re,{type:"remove",values:[ut]})}for(var gr=arguments.length,Qi=new Array(gr>1?gr-1:0),Jn=1;Jn<gr;Jn++)Qi[Jn-1]=arguments[Jn];if(qa&&(!Ut||!Wi.current)){var Fr;Ut&&(Wi.current=!0),(Fr=Pa.current)===null||Fr===void 0||Fr.onKeyDown.apply(Fr,[oa].concat(Qi))}ui==null||ui.apply(void 0,[oa].concat(Qi))},_i=function(oa){for(var Ua=arguments.length,pt=new Array(Ua>1?Ua-1:0),Ut=1;Ut<Ua;Ut++)pt[Ut-1]=arguments[Ut];if(qa){var Re;(Re=Pa.current)===null||Re===void 0||Re.onKeyUp.apply(Re,[oa].concat(pt))}oa.key==="Enter"&&(Wi.current=!1),ti==null||ti.apply(void 0,[oa].concat(pt))},Pi=function(oa){var Ua=Bi.filter(function(pt){return pt!==oa});Ii(Ua,{type:"remove",values:[oa]})},Ln=function(){Wi.current=!1},oi=We.useRef(!1),ur=function(){zr(!0),Vr||(pi&&!oi.current&&pi.apply(void 0,arguments),Nn.includes("focus")&&Xr(!0)),oi.current=!0},Nr=function(){Gt.current=!0,zr(!1,function(){oi.current=!1,Gt.current=!1,Xr(!1)}),!Vr&&(va&&(Ar==="tags"?Bn(va,{source:"submit"}):Ar==="multiple"&&Bn("",{source:"blur"})),vi&&vi.apply(void 0,arguments))},yo=[];We.useEffect(function(){return function(){yo.forEach(function(_o){return clearTimeout(_o)}),yo.splice(0,yo.length)}},[]);var ea=function(oa){var Ua,pt=oa.target,Ut=(Ua=Xo.current)===null||Ua===void 0?void 0:Ua.getPopupElement();if(Ut&&Ut.contains(pt)){var Re=setTimeout(function(){var gr=yo.indexOf(Re);if(gr!==-1&&yo.splice(gr,1),Jo(),!Wr&&!Ut.contains(document.activeElement)){var Qi;(Qi=aa.current)===null||Qi===void 0||Qi.focus()}});yo.push(Re)}for(var ut=arguments.length,dr=new Array(ut>1?ut-1:0),lr=1;lr<ut;lr++)dr[lr-1]=arguments[lr];hi==null||hi.apply(void 0,[oa].concat(dr))},La=We.useState({}),ga=(0,vt.Z)(La,2),bo=ga[1];function Dr(){bo({})}var or;ko&&(or=function(oa){Xr(oa)}),_e(function(){var _o;return[Wo.current,(_o=Xo.current)===null||_o===void 0?void 0:_o.getPopupElement()]},Xi,Xr,!!ko);var ta=We.useMemo(function(){return(0,bt.Z)((0,bt.Z)({},at),{},{notFoundContent:_n,open:qa,triggerOpen:Xi,id:li,showSearch:Pn,multiple:Yi,toggleOpen:Xr})},[at,_n,Xi,qa,li,Pn,Yi,Xr]),sa=!!wr||xo,Ta;sa&&(Ta=We.createElement(de,{className:ct()("".concat(Qt,"-arrow"),(0,it.Z)({},"".concat(Qt,"-arrow-loading"),xo)),customizeIcon:wr,customizeIconProps:{loading:xo,searchValue:va,open:qa,focused:ao,showSearch:Pn}}));var Ga=function(){var oa;ki==null||ki(),(oa=aa.current)===null||oa===void 0||oa.focus(),Ii([],{type:"clear",values:Bi}),Kr("",!1,!1)},Oo=se(Qt,Ga,Bi,Er,Qo,Vr,va,Ar),pa=Oo.allowClear,Lo=Oo.clearIcon,Ir=We.createElement(To,{ref:Pa}),Ba=ct()(Qt,jt,(0,it.Z)((0,it.Z)((0,it.Z)((0,it.Z)((0,it.Z)((0,it.Z)((0,it.Z)((0,it.Z)((0,it.Z)((0,it.Z)({},"".concat(Qt,"-focused"),ao),"".concat(Qt,"-multiple"),Yi),"".concat(Qt,"-single"),!Yi),"".concat(Qt,"-allow-clear"),Er),"".concat(Qt,"-show-arrow"),sa),"".concat(Qt,"-disabled"),Vr),"".concat(Qt,"-loading"),xo),"".concat(Qt,"-open"),qa),"".concat(Qt,"-customize-input"),ma),"".concat(Qt,"-show-search"),Pn)),ra=We.createElement(Ae,{ref:Xo,disabled:Vr,prefixCls:Qt,visible:Xi,popupElement:Ir,animation:ro,transitionName:fa,dropdownStyle:Yt,dropdownClassName:Rn,direction:Vi,dropdownMatchSelectWidth:Rt,dropdownRender:Ie,dropdownAlign:qn,placement:Ci,builtinPlacements:Oi,getPopupContainer:qi,empty:Pr,getTriggerDOMNode:function(oa){return ua.current||oa},onPopupVisibleChange:or,onPopupMouseEnter:Dr},ko?We.cloneElement(ko,{ref:So}):We.createElement(Gi,(0,le.Z)({},at,{domRef:ua,prefixCls:Qt,inputElement:ma,ref:aa,id:li,prefix:Do,showSearch:Pn,autoClearSearchValue:Io,mode:Ar,activeDescendantId:fo,tagRender:ai,values:Bi,open:qa,onToggleOpen:Xr,activeValue:Qr,searchValue:va,onSearch:Kr,onSearchSubmit:Rs,onRemove:Pi,tokenWithEnter:Co,onInputBlur:Ln}))),Uo;return ko?Uo=ra:Uo=We.createElement("div",(0,le.Z)({className:Ba},Rr,{ref:Wo,onMouseDown:ea,onKeyDown:Si,onKeyUp:_i,onFocus:ur,onBlur:Nr}),We.createElement(Dn,{visible:ao&&!qa,values:Bi}),ra,Ta,pa&&Lo),We.createElement(ge.Provider,{value:ta},Uo)}),un=qt,zn=function(){return null};zn.isSelectOptGroup=!0;var on=zn,Sn=function(){return null};Sn.isSelectOption=!0;var di=Sn,Ui=Le(80547),gi=Le(2738),Hi=Le(6790);function kr(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Gn=["disabled","title","children","style","className"];function On(at){return typeof at=="string"||typeof at=="number"}var Xn=function(Bt,Kn){var li=ye(),Qt=li.prefixCls,jt=li.id,Un=li.open,ai=li.multiple,Vi=li.mode,xi=li.searchValue,Bi=li.toggleOpen,Ii=li.notFoundContent,Pr=li.onPopupScroll,xr=We.useContext(wn),_n=xr.maxCount,ki=xr.flattenOptions,Ar=xr.onActiveValue,Vr=xr.defaultActiveFirstOption,xo=xr.onSelect,Ot=xr.menuItemSelectedIcon,Li=xr.rawValues,Sr=xr.fieldNames,Ri=xr.virtual,po=xr.direction,Qr=xr.listHeight,mo=xr.listItemHeight,fo=xr.optionRender,wo="".concat(Qt,"-item"),Io=(0,Ui.Z)(function(){return ki},[Un,ki],function(zi,Nn){return Nn[0]&&zi[1]!==Nn[1]}),Bn=We.useRef(null),ca=We.useMemo(function(){return ai&&Xt(_n)&&(Li==null?void 0:Li.size)>=_n},[ai,_n,Li==null?void 0:Li.size]),In=function(Nn){Nn.preventDefault()},Er=function(Nn){var pi;(pi=Bn.current)===null||pi===void 0||pi.scrollTo(typeof Nn=="number"?{index:Nn}:Nn)},Do=We.useCallback(function(zi){return Vi==="combobox"?!1:Li.has(zi)},[Vi,(0,Ke.Z)(Li).toString(),Li.size]),wr=function(Nn){for(var pi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,vi=Io.length,ti=0;ti<vi;ti+=1){var ui=(Nn+ti*pi+vi)%vi,hi=Io[ui]||{},Ti=hi.group,Yi=hi.data;if(!Ti&&!(Yi!=null&&Yi.disabled)&&(Do(Yi.value)||!ca))return ui}return-1},Qo=We.useState(function(){return wr(0)}),To=(0,vt.Z)(Qo,2),ro=To[0],fa=To[1],Yt=function(Nn){var pi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;fa(Nn);var vi={source:pi?"keyboard":"mouse"},ti=Io[Nn];if(!ti){Ar(null,-1,vi);return}Ar(ti.value,Nn,vi)};(0,We.useEffect)(function(){Yt(Vr!==!1?wr(0):-1)},[Io.length,xi]);var Rn=We.useCallback(function(zi){return Vi==="combobox"?String(zi).toLowerCase()===xi.toLowerCase():Li.has(zi)},[Vi,xi,(0,Ke.Z)(Li).toString(),Li.size]);(0,We.useEffect)(function(){var zi=setTimeout(function(){if(!ai&&Un&&Li.size===1){var pi=Array.from(Li)[0],vi=Io.findIndex(function(ti){var ui=ti.data;return xi?String(ui.value).startsWith(xi):ui.value===pi});vi!==-1&&(Yt(vi),Er(vi))}});if(Un){var Nn;(Nn=Bn.current)===null||Nn===void 0||Nn.scrollTo(void 0)}return function(){return clearTimeout(zi)}},[Un,xi]);var Rt=function(Nn){Nn!==void 0&&xo(Nn,{selected:!Li.has(Nn)}),ai||Bi(!1)};if(We.useImperativeHandle(Kn,function(){return{onKeyDown:function(Nn){var pi=Nn.which,vi=Nn.ctrlKey;switch(pi){case Ze.Z.N:case Ze.Z.P:case Ze.Z.UP:case Ze.Z.DOWN:{var ti=0;if(pi===Ze.Z.UP?ti=-1:pi===Ze.Z.DOWN?ti=1:kr()&&vi&&(pi===Ze.Z.N?ti=1:pi===Ze.Z.P&&(ti=-1)),ti!==0){var ui=wr(ro+ti,ti);Er(ui),Yt(ui,!0)}break}case Ze.Z.TAB:case Ze.Z.ENTER:{var hi,Ti=Io[ro];Ti&&!(Ti!=null&&(hi=Ti.data)!==null&&hi!==void 0&&hi.disabled)&&!ca?Rt(Ti.value):Rt(void 0),Un&&Nn.preventDefault();break}case Ze.Z.ESC:Bi(!1),Un&&Nn.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Nn){Er(Nn)}}}),Io.length===0)return We.createElement("div",{role:"listbox",id:"".concat(jt,"_list"),className:"".concat(wo,"-empty"),onMouseDown:In},Ii);var Ie=Object.keys(Sr).map(function(zi){return Sr[zi]}),qn=function(Nn){return Nn.label};function Ci(zi,Nn){var pi=zi.group;return{role:pi?"presentation":"option",id:"".concat(jt,"_list_").concat(Nn)}}var Oi=function(Nn){var pi=Io[Nn];if(!pi)return null;var vi=pi.data||{},ti=vi.value,ui=pi.group,hi=(0,Qe.Z)(vi,!0),Ti=qn(pi);return pi?We.createElement("div",(0,le.Z)({"aria-label":typeof Ti=="string"&&!ui?Ti:null},hi,{key:Nn},Ci(pi,Nn),{"aria-selected":Rn(ti)}),ti):null},qi={role:"listbox",id:"".concat(jt,"_list")};return We.createElement(We.Fragment,null,Ri&&We.createElement("div",(0,le.Z)({},qi,{style:{height:0,width:0,overflow:"hidden"}}),Oi(ro-1),Oi(ro),Oi(ro+1)),We.createElement(Hi.Z,{itemKey:"key",ref:Bn,data:Io,height:Qr,itemHeight:mo,fullHeight:!1,onMouseDown:In,onScroll:Pr,virtual:Ri,direction:po,innerProps:Ri?null:qi},function(zi,Nn){var pi=zi.group,vi=zi.groupOption,ti=zi.data,ui=zi.label,hi=zi.value,Ti=ti.key;if(pi){var Yi,Pn=(Yi=ti.title)!==null&&Yi!==void 0?Yi:On(ui)?ui.toString():void 0;return We.createElement("div",{className:ct()(wo,"".concat(wo,"-group"),ti.className),title:Pn},ui!==void 0?ui:Ti)}var Rr=ti.disabled,cr=ti.title,Mo=ti.children,Wr=ti.style,Vo=ti.className,Wo=(0,Oe.Z)(ti,Gn),ua=(0,gi.Z)(Wo,Ie),Xo=Do(hi),aa=Rr||!Xo&&ca,Pa="".concat(wo,"-option"),Gt=ct()(wo,Pa,Vo,(0,it.Z)((0,it.Z)((0,it.Z)((0,it.Z)({},"".concat(Pa,"-grouped"),vi),"".concat(Pa,"-active"),ro===Nn&&!aa),"".concat(Pa,"-disabled"),aa),"".concat(Pa,"-selected"),Xo)),qo=qn(zi),fr=!Ot||typeof Ot=="function"||Xo,ao=typeof qo=="number"?qo:qo||hi,zr=On(ao)?ao.toString():void 0;return cr!==void 0&&(zr=cr),We.createElement("div",(0,le.Z)({},(0,Qe.Z)(ua),Ri?{}:Ci(zi,Nn),{"aria-selected":Rn(hi),className:Gt,title:zr,onMouseMove:function(){ro===Nn||aa||Yt(Nn)},onClick:function(){aa||Rt(hi)},style:Wr}),We.createElement("div",{className:"".concat(Pa,"-content")},typeof fo=="function"?fo(zi,{index:Nn}):ao),We.isValidElement(Ot)||Xo,fr&&We.createElement(de,{className:"".concat(wo,"-option-state"),customizeIcon:Ot,customizeIconProps:{value:hi,disabled:aa,isSelected:Xo}},Xo?"\u2713":null))}))},wi=We.forwardRef(Xn),nr=wi,ji=function(at,Bt){var Kn=We.useRef({values:new Map,options:new Map}),li=We.useMemo(function(){var jt=Kn.current,Un=jt.values,ai=jt.options,Vi=at.map(function(Ii){if(Ii.label===void 0){var Pr;return(0,bt.Z)((0,bt.Z)({},Ii),{},{label:(Pr=Un.get(Ii.value))===null||Pr===void 0?void 0:Pr.label})}return Ii}),xi=new Map,Bi=new Map;return Vi.forEach(function(Ii){xi.set(Ii.value,Ii),Bi.set(Ii.value,Bt.get(Ii.value)||ai.get(Ii.value))}),Kn.current.values=xi,Kn.current.options=Bi,Vi},[at,Bt]),Qt=We.useCallback(function(jt){return Bt.get(jt)||Kn.current.options.get(jt)},[Bt]);return[li,Qt]};function Cr(at,Bt){return en(at).join("").toUpperCase().includes(Bt)}var be=function(at,Bt,Kn,li,Qt){return We.useMemo(function(){if(!Kn||li===!1)return at;var jt=Bt.options,Un=Bt.label,ai=Bt.value,Vi=[],xi=typeof li=="function",Bi=Kn.toUpperCase(),Ii=xi?li:function(xr,_n){return Qt?Cr(_n[Qt],Bi):_n[jt]?Cr(_n[Un!=="children"?Un:"label"],Bi):Cr(_n[ai],Bi)},Pr=xi?function(xr){return Dt(xr)}:function(xr){return xr};return at.forEach(function(xr){if(xr[jt]){var _n=Ii(Kn,Pr(xr));if(_n)Vi.push(xr);else{var ki=xr[jt].filter(function(Ar){return Ii(Kn,Pr(Ar))});ki.length&&Vi.push((0,bt.Z)((0,bt.Z)({},xr),{},(0,it.Z)({},jt,ki)))}return}Ii(Kn,Pr(xr))&&Vi.push(xr)}),Vi},[at,li,Qt,Kn,Bt])},mn=Le(6551),fi=Le(11592),Vn=["children","value"],si=["children"];function Di(at){var Bt=at,Kn=Bt.key,li=Bt.props,Qt=li.children,jt=li.value,Un=(0,Oe.Z)(li,Vn);return(0,bt.Z)({key:Kn,value:jt!==void 0?jt:Kn,children:Qt},Un)}function Ni(at){var Bt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,fi.Z)(at).map(function(Kn,li){if(!We.isValidElement(Kn)||!Kn.type)return null;var Qt=Kn,jt=Qt.type.isSelectOptGroup,Un=Qt.key,ai=Qt.props,Vi=ai.children,xi=(0,Oe.Z)(ai,si);return Bt||!jt?Di(Kn):(0,bt.Z)((0,bt.Z)({key:"__RC_SELECT_GRP__".concat(Un===null?li:Un,"__"),label:Un},xi),{},{options:Ni(Vi)})}).filter(function(Kn){return Kn})}var yr=function(Bt,Kn,li,Qt,jt){return We.useMemo(function(){var Un=Bt,ai=!Bt;ai&&(Un=Ni(Kn));var Vi=new Map,xi=new Map,Bi=function(xr,_n,ki){ki&&typeof ki=="string"&&xr.set(_n[ki],_n)},Ii=function Pr(xr){for(var _n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ki=0;ki<xr.length;ki+=1){var Ar=xr[ki];!Ar[li.options]||_n?(Vi.set(Ar[li.value],Ar),Bi(xi,Ar,li.label),Bi(xi,Ar,Qt),Bi(xi,Ar,jt)):Pr(Ar[li.options],!0)}};return Ii(Un),{options:Un,valueOptions:Vi,labelOptions:xi}},[Bt,Kn,li,Qt,jt])},zt=yr;function Mt(at){var Bt=We.useRef();Bt.current=at;var Kn=We.useCallback(function(){return Bt.current.apply(Bt,arguments)},[]);return Kn}function _t(at){var Bt=at.mode,Kn=at.options,li=at.children,Qt=at.backfill,jt=at.allowClear,Un=at.placeholder,ai=at.getInputElement,Vi=at.showSearch,xi=at.onSearch,Bi=at.defaultOpen,Ii=at.autoFocus,Pr=at.labelInValue,xr=at.value,_n=at.inputValue,ki=at.optionLabelProp,Ar=isMultiple(Bt),Vr=Vi!==void 0?Vi:Ar||Bt==="combobox",xo=Kn||convertChildrenToData(li);if(warning(Bt!=="tags"||xo.every(function(Ri){return!Ri.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Bt==="tags"||Bt==="combobox"){var Ot=xo.some(function(Ri){return Ri.options?Ri.options.some(function(po){return typeof("value"in po?po.value:po.key)=="number"}):typeof("value"in Ri?Ri.value:Ri.key)=="number"});warning(!Ot,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Bt!=="combobox"||!ki,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Bt==="combobox"||!Qt,"`backfill` only works with `combobox` mode."),warning(Bt==="combobox"||!ai,"`getInputElement` only work with `combobox` mode."),noteOnce(Bt!=="combobox"||!ai||!jt||!Un,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),xi&&!Vr&&Bt!=="combobox"&&Bt!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Bi||Ii,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),xr!=null){var Li=toArray(xr);warning(!Pr||Li.every(function(Ri){return _typeof(Ri)==="object"&&("key"in Ri||"value"in Ri)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Ar||Array.isArray(xr),"`value` should be array when `mode` is `multiple` or `tags`")}if(li){var Sr=null;toNodeArray(li).some(function(Ri){if(!React.isValidElement(Ri)||!Ri.type)return!1;var po=Ri,Qr=po.type;if(Qr.isSelectOption)return!1;if(Qr.isSelectOptGroup){var mo=toNodeArray(Ri.props.children).every(function(fo){return!React.isValidElement(fo)||!Ri.type||fo.type.isSelectOption?!0:(Sr=fo.type,!1)});return!mo}return Sr=Qr,!0}),Sr&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Sr.displayName||Sr.name||Sr,"`.")),warning(_n===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function fn(at,Bt){if(at){var Kn=function li(Qt){for(var jt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Un=0;Un<Qt.length;Un++){var ai=Qt[Un];if(ai[Bt==null?void 0:Bt.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!jt&&Array.isArray(ai[Bt==null?void 0:Bt.options])&&li(ai[Bt==null?void 0:Bt.options],!0))break}};Kn(at)}}var Ji=null,mi=["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"],$i=["inputValue"];function xn(at){return!at||(0,st.Z)(at)!=="object"}var ni=We.forwardRef(function(at,Bt){var Kn=at.id,li=at.mode,Qt=at.prefixCls,jt=Qt===void 0?"rc-select":Qt,Un=at.backfill,ai=at.fieldNames,Vi=at.inputValue,xi=at.searchValue,Bi=at.onSearch,Ii=at.autoClearSearchValue,Pr=Ii===void 0?!0:Ii,xr=at.onSelect,_n=at.onDeselect,ki=at.dropdownMatchSelectWidth,Ar=ki===void 0?!0:ki,Vr=at.filterOption,xo=at.filterSort,Ot=at.optionFilterProp,Li=at.optionLabelProp,Sr=at.options,Ri=at.optionRender,po=at.children,Qr=at.defaultActiveFirstOption,mo=at.menuItemSelectedIcon,fo=at.virtual,wo=at.direction,Io=at.listHeight,Bn=Io===void 0?200:Io,ca=at.listItemHeight,In=ca===void 0?20:ca,Er=at.labelRender,Do=at.value,wr=at.defaultValue,Qo=at.labelInValue,To=at.onChange,ro=at.maxCount,fa=(0,Oe.Z)(at,mi),Yt=(0,mn.ZP)(Kn),Rn=tn(li),Rt=!!(!Sr&&po),Ie=We.useMemo(function(){return Vr===void 0&&li==="combobox"?!1:Vr},[Vr,li]),qn=We.useMemo(function(){return yn(ai,Rt)},[JSON.stringify(ai),Rt]),Ci=(0,Et.Z)("",{value:xi!==void 0?xi:Vi,postState:function(Co){return Co||""}}),Oi=(0,vt.Z)(Ci,2),qi=Oi[0],zi=Oi[1],Nn=zt(Sr,po,qn,Ot,Li),pi=Nn.valueOptions,vi=Nn.labelOptions,ti=Nn.options,ui=We.useCallback(function(Xr){var Co=en(Xr);return Co.map(function(Zo){var Ko,ba,Kr,Rs,Za;if(xn(Zo))Ko=Zo;else{var nn;Kr=Zo.key,ba=Zo.label,Ko=(nn=Zo.value)!==null&&nn!==void 0?nn:Kr}var Ht=pi.get(Ko);if(Ht){var Fn;if(ba===void 0&&(ba=Ht==null?void 0:Ht[Li||qn.label]),Kr===void 0&&(Kr=(Fn=Ht==null?void 0:Ht.key)!==null&&Fn!==void 0?Fn:Ko),Rs=Ht==null?void 0:Ht.disabled,Za=Ht==null?void 0:Ht.title,0)var Wi}return{label:ba,value:Ko,key:Kr,disabled:Rs,title:Za}})},[qn,Li,pi]),hi=(0,Et.Z)(wr,{value:Do}),Ti=(0,vt.Z)(hi,2),Yi=Ti[0],Pn=Ti[1],Rr=We.useMemo(function(){var Xr,Co=Rn&&Yi===null?[]:Yi,Zo=ui(Co);return li==="combobox"&&rt((Xr=Zo[0])===null||Xr===void 0?void 0:Xr.value)?[]:Zo},[Yi,ui,li,Rn]),cr=ji(Rr,pi),Mo=(0,vt.Z)(cr,2),Wr=Mo[0],Vo=Mo[1],Wo=We.useMemo(function(){if(!li&&Wr.length===1){var Xr=Wr[0];if(Xr.value===null&&(Xr.label===null||Xr.label===void 0))return[]}return Wr.map(function(Co){var Zo;return(0,bt.Z)((0,bt.Z)({},Co),{},{label:(Zo=typeof Er=="function"?Er(Co):Co.label)!==null&&Zo!==void 0?Zo:Co.value})})},[li,Wr,Er]),ua=We.useMemo(function(){return new Set(Wr.map(function(Xr){return Xr.value}))},[Wr]);We.useEffect(function(){if(li==="combobox"){var Xr,Co=(Xr=Wr[0])===null||Xr===void 0?void 0:Xr.value;zi(nt(Co)?String(Co):"")}},[Wr]);var Xo=Mt(function(Xr,Co){var Zo=Co!=null?Co:Xr;return(0,it.Z)((0,it.Z)({},qn.value,Xr),qn.label,Zo)}),aa=We.useMemo(function(){if(li!=="tags")return ti;var Xr=(0,Ke.Z)(ti),Co=function(Ko){return pi.has(Ko)};return(0,Ke.Z)(Wr).sort(function(Zo,Ko){return Zo.value<Ko.value?-1:1}).forEach(function(Zo){var Ko=Zo.value;Co(Ko)||Xr.push(Xo(Ko,Zo.label))}),Xr},[Xo,ti,pi,Wr,li]),Pa=be(aa,qn,qi,Ie,Ot),Gt=We.useMemo(function(){return li!=="tags"||!qi||Pa.some(function(Xr){return Xr[Ot||"value"]===qi})||Pa.some(function(Xr){return Xr[qn.value]===qi})?Pa:[Xo(qi)].concat((0,Ke.Z)(Pa))},[Xo,Ot,li,Pa,qi,qn]),qo=function Xr(Co){var Zo=(0,Ke.Z)(Co).sort(function(Ko,ba){return xo(Ko,ba,{searchValue:qi})});return Zo.map(function(Ko){return Array.isArray(Ko.options)?(0,bt.Z)((0,bt.Z)({},Ko),{},{options:Ko.options.length>0?Xr(Ko.options):Ko.options}):Ko})},fr=We.useMemo(function(){return xo?qo(Gt):Gt},[Gt,xo,qi]),ao=We.useMemo(function(){return kt(fr,{fieldNames:qn,childrenAsData:Rt})},[fr,qn,Rt]),zr=function(Co){var Zo=ui(Co);if(Pn(Zo),To&&(Zo.length!==Wr.length||Zo.some(function(Kr,Rs){var Za;return((Za=Wr[Rs])===null||Za===void 0?void 0:Za.value)!==(Kr==null?void 0:Kr.value)}))){var Ko=Qo?Zo:Zo.map(function(Kr){return Kr.value}),ba=Zo.map(function(Kr){return Dt(Vo(Kr.value))});To(Rn?Ko:Ko[0],Rn?ba:ba[0])}},Jo=We.useState(null),va=(0,vt.Z)(Jo,2),ma=va[0],ko=va[1],So=We.useState(0),$a=(0,vt.Z)(So,2),gs=$a[0],ls=$a[1],ps=Qr!==void 0?Qr:li!=="combobox",$r=We.useCallback(function(Xr,Co){var Zo=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ko=Zo.source,ba=Ko===void 0?"keyboard":Ko;ls(Co),Un&&li==="combobox"&&Xr!==null&&ba==="keyboard"&&ko(String(Xr))},[Un,li]),Ka=function(Co,Zo,Ko){var ba=function(){var Pi,Ln=Vo(Co);return[Qo?{label:Ln==null?void 0:Ln[qn.label],value:Co,key:(Pi=Ln==null?void 0:Ln.key)!==null&&Pi!==void 0?Pi:Co}:Co,Dt(Ln)]};if(Zo&&xr){var Kr=ba(),Rs=(0,vt.Z)(Kr,2),Za=Rs[0],nn=Rs[1];xr(Za,nn)}else if(!Zo&&_n&&Ko!=="clear"){var Ht=ba(),Fn=(0,vt.Z)(Ht,2),Wi=Fn[0],Si=Fn[1];_n(Wi,Si)}},Ma=Mt(function(Xr,Co){var Zo,Ko=Rn?Co.selected:!0;Ko?Zo=Rn?[].concat((0,Ke.Z)(Wr),[Xr]):[Xr]:Zo=Wr.filter(function(ba){return ba.value!==Xr}),zr(Zo),Ka(Xr,Ko),li==="combobox"?ko(""):(!tn||Pr)&&(zi(""),ko(""))}),ns=function(Co,Zo){zr(Co);var Ko=Zo.type,ba=Zo.values;(Ko==="remove"||Ko==="clear")&&ba.forEach(function(Kr){Ka(Kr.value,!1,Ko)})},qa=function(Co,Zo){if(zi(Co),ko(null),Zo.source==="submit"){var Ko=(Co||"").trim();if(Ko){var ba=Array.from(new Set([].concat((0,Ke.Z)(ua),[Ko])));zr(ba),Ka(Ko,!0),zi("")}return}Zo.source!=="blur"&&(li==="combobox"&&zr(Co),Bi==null||Bi(Co))},ts=function(Co){var Zo=Co;li!=="tags"&&(Zo=Co.map(function(ba){var Kr=vi.get(ba);return Kr==null?void 0:Kr.value}).filter(function(ba){return ba!==void 0}));var Ko=Array.from(new Set([].concat((0,Ke.Z)(ua),(0,Ke.Z)(Zo))));zr(Ko),Ko.forEach(function(ba){Ka(ba,!0)})},Xi=We.useMemo(function(){var Xr=fo!==!1&&Ar!==!1;return(0,bt.Z)((0,bt.Z)({},Nn),{},{flattenOptions:ao,onActiveValue:$r,defaultActiveFirstOption:ps,onSelect:Ma,menuItemSelectedIcon:mo,rawValues:ua,fieldNames:qn,virtual:Xr,direction:wo,listHeight:Bn,listItemHeight:In,childrenAsData:Rt,maxCount:ro,optionRender:Ri})},[ro,Nn,ao,$r,ps,Ma,mo,ua,qn,fo,Ar,wo,Bn,In,Rt,Ri]);return We.createElement(wn.Provider,{value:Xi},We.createElement(un,(0,le.Z)({},fa,{id:Yt,prefixCls:jt,ref:Bt,omitDomProps:$i,mode:li,displayValues:Wo,onDisplayValuesChange:ns,direction:wo,searchValue:qi,onSearch:qa,autoClearSearchValue:Pr,onSearchSplit:ts,dropdownMatchSelectWidth:Ar,OptionList:nr,emptyOptions:!ao.length,activeValue:ma,activeDescendantId:"".concat(Yt,"_list_").concat(gs)})))}),sr=ni;sr.Option=di,sr.OptGroup=on;var br=sr,Yn=br},63158:function(Zn,ei,Le){"use strict";var le=Le(14809),Ke=Le(4635),it=Le(50298),bt=Le(62646),vt=Le(59301),Oe=Le(92310),st=Le.n(Oe),Et=Le(18929),ot=Le(10228),We=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Tt=vt.forwardRef(function(ct,At){var De,ne=ct.prefixCls,te=ne===void 0?"rc-switch":ne,de=ct.className,se=ct.checked,ge=ct.defaultChecked,ye=ct.disabled,we=ct.loadingIcon,Ce=ct.checkedChildren,_e=ct.unCheckedChildren,Ze=ct.onClick,lt=ct.onChange,Qe=ct.onKeyDown,Ue=(0,bt.Z)(ct,We),dt=(0,Et.Z)(!1,{value:se,defaultValue:ge}),$e=(0,it.Z)(dt,2),wt=$e[0],St=$e[1];function Lt(rn,nt){var rt=wt;return ye||(rt=rn,St(rt),lt==null||lt(rt,nt)),rt}function pn(rn){rn.which===ot.Z.LEFT?Lt(!1,rn):rn.which===ot.Z.RIGHT&&Lt(!0,rn),Qe==null||Qe(rn)}function en(rn){var nt=Lt(!wt,rn);Ze==null||Ze(nt,rn)}var vn=st()(te,de,(De={},(0,Ke.Z)(De,"".concat(te,"-checked"),wt),(0,Ke.Z)(De,"".concat(te,"-disabled"),ye),De));return vt.createElement("button",(0,le.Z)({},Ue,{type:"button",role:"switch","aria-checked":wt,disabled:ye,className:vn,ref:At,onKeyDown:pn,onClick:en}),we,vt.createElement("span",{className:"".concat(te,"-inner")},vt.createElement("span",{className:"".concat(te,"-inner-checked")},Ce),vt.createElement("span",{className:"".concat(te,"-inner-unchecked")},_e)))});Tt.displayName="Switch",ei.Z=Tt},86351:function(Zn,ei,Le){"use strict";Le.d(ei,{R:function(){return Ke},w:function(){return le}});var le={},Ke="rc-table-internal-hook"},97347:function(Zn,ei,Le){"use strict";Le.d(ei,{L:function(){return te},Z:function(){return we}});var le=Le(50298),Ke=Le(4635),it=Le(95190),bt=Le(93664),vt=Le(20439),Oe=Le(62646),st=Le(11592),Et=Le(48736),ot=Le(59301),We=Le(86351),Tt=Le(54451);function ct(Ce){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return typeof _e=="number"?_e:_e.endsWith("%")?Ce*parseFloat(_e)/100:null}function At(Ce,_e,Ze){return ot.useMemo(function(){if(_e&&_e>0){var lt=0,Qe=0;Ce.forEach(function(en){var vn=ct(_e,en.width);vn?lt+=vn:Qe+=1});var Ue=Math.max(_e,Ze),dt=Math.max(Ue-lt,Qe),$e=Qe,wt=dt/Qe,St=0,Lt=Ce.map(function(en){var vn=(0,vt.Z)({},en),rn=ct(_e,vn.width);if(rn)vn.width=rn;else{var nt=Math.floor(wt);vn.width=$e===1?dt:nt,dt-=nt,$e-=1}return St+=vn.width,vn});if(St<Ue){var pn=Ue/St;dt=Ue,Lt.forEach(function(en,vn){var rn=Math.floor(en.width*pn);en.width=vn===Lt.length-1?dt:rn,dt-=rn})}return[Lt,Math.max(St,Ue)]}return[Ce,_e]},[Ce,_e,Ze])}var De=["children"],ne=["fixed"];function te(Ce){return(0,st.Z)(Ce).filter(function(_e){return ot.isValidElement(_e)}).map(function(_e){var Ze=_e.key,lt=_e.props,Qe=lt.children,Ue=(0,Oe.Z)(lt,De),dt=(0,vt.Z)({key:Ze},Ue);return Qe&&(dt.children=te(Qe)),dt})}function de(Ce){return Ce.filter(function(_e){return _e&&(0,bt.Z)(_e)==="object"&&!_e.hidden}).map(function(_e){var Ze=_e.children;return Ze&&Ze.length>0?(0,vt.Z)((0,vt.Z)({},_e),{},{children:de(Ze)}):_e})}function se(Ce){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key";return Ce.filter(function(Ze){return Ze&&(0,bt.Z)(Ze)==="object"}).reduce(function(Ze,lt,Qe){var Ue=lt.fixed,dt=Ue===!0?"left":Ue,$e="".concat(_e,"-").concat(Qe),wt=lt.children;return wt&&wt.length>0?[].concat((0,it.Z)(Ze),(0,it.Z)(se(wt,$e).map(function(St){return(0,vt.Z)({fixed:dt},St)}))):[].concat((0,it.Z)(Ze),[(0,vt.Z)((0,vt.Z)({key:$e},lt),{},{fixed:dt})])},[])}function ge(Ce){return Ce.map(function(_e){var Ze=_e.fixed,lt=(0,Oe.Z)(_e,ne),Qe=Ze;return Ze==="left"?Qe="right":Ze==="right"&&(Qe="left"),(0,vt.Z)({fixed:Qe},lt)})}function ye(Ce,_e){var Ze=Ce.prefixCls,lt=Ce.columns,Qe=Ce.children,Ue=Ce.expandable,dt=Ce.expandedKeys,$e=Ce.columnTitle,wt=Ce.getRowKey,St=Ce.onTriggerExpand,Lt=Ce.expandIcon,pn=Ce.rowExpandable,en=Ce.expandIconColumnIndex,vn=Ce.direction,rn=Ce.expandRowByClick,nt=Ce.columnWidth,rt=Ce.fixed,dn=Ce.scrollWidth,ri=Ce.clientWidth,Hn=ot.useMemo(function(){var Gi=lt||te(Qe)||[];return de(Gi.slice())},[lt,Qe]),Wt=ot.useMemo(function(){if(Ue){var Gi=Hn.slice();if(!Gi.includes(We.w)){var ze=en||0;ze>=0&&(ze||rt==="left"||!rt)&&Gi.splice(ze,0,We.w),rt==="right"&&Gi.splice(Hn.length,0,We.w)}var Me=Gi.indexOf(We.w);Gi=Gi.filter(function(Ae,qe){return Ae!==We.w||qe===Me});var Ee=Hn[Me],Te;rt?Te=rt:Te=Ee?Ee.fixed:null;var He=(0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)({},Tt.v,{className:"".concat(Ze,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",$e),"fixed",Te),"className","".concat(Ze,"-row-expand-icon-cell")),"width",nt),"render",function(qe,an,Xt){var yn=wt(an,Xt),kt=dt.has(yn),Dt=pn?pn(an):!0,Zt=Lt({prefixCls:Ze,expanded:kt,expandable:Dt,record:an,onExpand:St});return rn?ot.createElement("span",{onClick:function(wn){return wn.stopPropagation()}},Zt):Zt});return Gi.map(function(Ae){return Ae===We.w?He:Ae})}return Hn.filter(function(Ae){return Ae!==We.w})},[Ue,Hn,wt,dt,Lt,vn]),En=ot.useMemo(function(){var Gi=Wt;return _e&&(Gi=_e(Gi)),Gi.length||(Gi=[{render:function(){return null}}]),Gi},[_e,Wt,vn]),An=ot.useMemo(function(){return vn==="rtl"?ge(se(En)):se(En)},[En,vn,dn]),ci=ot.useMemo(function(){for(var Gi=-1,ze=An.length-1;ze>=0;ze-=1){var Me=An[ze].fixed;if(Me==="left"||Me===!0){Gi=ze;break}}if(Gi>=0)for(var Ee=0;Ee<=Gi;Ee+=1){var Te=An[Ee].fixed;if(Te!=="left"&&Te!==!0)return!0}var He=An.findIndex(function(an){var Xt=an.fixed;return Xt==="right"});if(He>=0)for(var Ae=He;Ae<An.length;Ae+=1){var qe=An[Ae].fixed;if(qe!=="right")return!0}return!1},[An]),It=At(An,dn,ri),Pt=(0,le.Z)(It,2),Nt=Pt[0],ii=Pt[1];return[En,Nt,ii,ci]}var we=ye},4030:function(Zn,ei,Le){"use strict";Le.d(ei,{w2:function(){return le.w},vP:function(){return On.v},RQ:function(){return le.R},ER:function(){return yn},Q$:function(){return Vr},TN:function(){return To}});var le=Le(86351),Ke=Le(50298),it=Le(6089),bt=Le(34280),vt=Le(13697),Oe=Le(59301),st=Le(4676);function Et(Yt){var Rn=Oe.createContext(void 0),Rt=function(qn){var Ci=qn.value,Oi=qn.children,qi=Oe.useRef(Ci);qi.current=Ci;var zi=Oe.useState(function(){return{getValue:function(){return qi.current},listeners:new Set}}),Nn=(0,Ke.Z)(zi,1),pi=Nn[0];return(0,bt.Z)(function(){(0,st.unstable_batchedUpdates)(function(){pi.listeners.forEach(function(vi){vi(Ci)})})},[Ci]),Oe.createElement(Rn.Provider,{value:pi},Oi)};return{Context:Rn,Provider:Rt,defaultValue:Yt}}function ot(Yt,Rn){var Rt=(0,it.Z)(typeof Rn=="function"?Rn:function(vi){if(Rn===void 0)return vi;if(!Array.isArray(Rn))return vi[Rn];var ti={};return Rn.forEach(function(ui){ti[ui]=vi[ui]}),ti}),Ie=Oe.useContext(Yt==null?void 0:Yt.Context),qn=Ie||{},Ci=qn.listeners,Oi=qn.getValue,qi=Oe.useRef();qi.current=Rt(Ie?Oi():Yt==null?void 0:Yt.defaultValue);var zi=Oe.useState({}),Nn=(0,Ke.Z)(zi,2),pi=Nn[1];return(0,bt.Z)(function(){if(!Ie)return;function vi(ti){var ui=Rt(ti);(0,vt.Z)(qi.current,ui,!0)||pi({})}return Ci.add(vi),function(){Ci.delete(vi)}},[Ie]),qi.current}var We=Le(14809),Tt=Le(8654);function ct(){var Yt=Oe.createContext(null);function Rn(){return Oe.useContext(Yt)}function Rt(qn,Ci){var Oi=(0,Tt.Yr)(qn),qi=function(Nn,pi){var vi=Oi?{ref:pi}:{},ti=Oe.useRef(0),ui=Oe.useRef(Nn),hi=Rn();return hi!==null?Oe.createElement(qn,(0,We.Z)({},Nn,vi)):((!Ci||Ci(ui.current,Nn))&&(ti.current+=1),ui.current=Nn,Oe.createElement(Yt.Provider,{value:ti.current},Oe.createElement(qn,(0,We.Z)({},Nn,vi))))};return Oi?Oe.forwardRef(qi):qi}function Ie(qn,Ci){var Oi=(0,Tt.Yr)(qn),qi=function(Nn,pi){var vi=Oi?{ref:pi}:{};return Rn(),Oe.createElement(qn,(0,We.Z)({},Nn,vi))};return Oi?Oe.memo(Oe.forwardRef(qi),Ci):Oe.memo(qi,Ci)}return{makeImmutable:Rt,responseImmutable:Ie,useImmutableMark:Rn}}var At=ct(),De=At.makeImmutable,ne=At.responseImmutable,te=At.useImmutableMark,de=ct(),se=de.makeImmutable,ge=de.responseImmutable,ye=de.useImmutableMark,we=Et(),Ce=we;function _e(Yt,Rn){var Rt=React.useRef(0);Rt.current+=1;var Ie=React.useRef(Yt),qn=[];Object.keys(Yt||{}).map(function(Oi){var qi;(Yt==null?void 0:Yt[Oi])!==((qi=Ie.current)===null||qi===void 0?void 0:qi[Oi])&&qn.push(Oi)}),Ie.current=Yt;var Ci=React.useRef([]);return qn.length&&(Ci.current=qn),React.useDebugValue(Rt.current),React.useDebugValue(Ci.current.join(", ")),Rn&&console.log("".concat(Rn,":"),Rt.current,Ci.current),Rt.current}var Ze=null,lt=null,Qe=Le(93664),Ue=Le(20439),dt=Le(4635),$e=Le(92310),wt=Le.n($e),St=Le(80547),Lt=Le(97938),pn=Le(48736),en=Oe.createContext({renderWithProps:!1}),vn=en,rn="RC_TABLE_KEY";function nt(Yt){return Yt==null?[]:Array.isArray(Yt)?Yt:[Yt]}function rt(Yt){var Rn=[],Rt={};return Yt.forEach(function(Ie){for(var qn=Ie||{},Ci=qn.key,Oi=qn.dataIndex,qi=Ci||nt(Oi).join("-")||rn;Rt[qi];)qi="".concat(qi,"_next");Rt[qi]=!0,Rn.push(qi)}),Rn}function dn(Yt){return Yt!=null}function ri(Yt){return typeof Yt=="number"&&!Number.isNaN(Yt)}function Hn(Yt){return Yt&&(0,Qe.Z)(Yt)==="object"&&!Array.isArray(Yt)&&!Oe.isValidElement(Yt)}function Wt(Yt,Rn,Rt,Ie,qn,Ci){var Oi=Oe.useContext(vn),qi=ye(),zi=(0,St.Z)(function(){if(dn(Ie))return[Ie];var Nn=Rn==null||Rn===""?[]:Array.isArray(Rn)?Rn:[Rn],pi=(0,Lt.Z)(Yt,Nn),vi=pi,ti=void 0;if(qn){var ui=qn(pi,Yt,Rt);Hn(ui)?(vi=ui.children,ti=ui.props,Oi.renderWithProps=!0):vi=ui}return[vi,ti]},[qi,Yt,Ie,Rn,qn,Rt],function(Nn,pi){if(Ci){var vi=(0,Ke.Z)(Nn,2),ti=vi[1],ui=(0,Ke.Z)(pi,2),hi=ui[1];return Ci(hi,ti)}return Oi.renderWithProps?!0:!(0,vt.Z)(Nn,pi,!0)});return zi}function En(Yt,Rn,Rt,Ie){var qn=Yt+Rn-1;return Yt<=Ie&&qn>=Rt}function An(Yt,Rn){return ot(Ce,function(Rt){var Ie=En(Yt,Rn||1,Rt.hoverStartRow,Rt.hoverEndRow);return[Ie,Rt.onHover]})}var ci=Le(70425),It=function(Rn){var Rt=Rn.ellipsis,Ie=Rn.rowType,qn=Rn.children,Ci,Oi=Rt===!0?{showTitle:!0}:Rt;return Oi&&(Oi.showTitle||Ie==="header")&&(typeof qn=="string"||typeof qn=="number"?Ci=qn.toString():Oe.isValidElement(qn)&&typeof qn.props.children=="string"&&(Ci=qn.props.children)),Ci};function Pt(Yt){var Rn,Rt,Ie,qn,Ci,Oi,qi,zi,Nn=Yt.component,pi=Yt.children,vi=Yt.ellipsis,ti=Yt.scope,ui=Yt.prefixCls,hi=Yt.className,Ti=Yt.align,Yi=Yt.record,Pn=Yt.render,Rr=Yt.dataIndex,cr=Yt.renderIndex,Mo=Yt.shouldCellUpdate,Wr=Yt.index,Vo=Yt.rowType,Wo=Yt.colSpan,ua=Yt.rowSpan,Xo=Yt.fixLeft,aa=Yt.fixRight,Pa=Yt.firstFixLeft,Gt=Yt.lastFixLeft,qo=Yt.firstFixRight,fr=Yt.lastFixRight,ao=Yt.appendNode,zr=Yt.additionalProps,Jo=zr===void 0?{}:zr,va=Yt.isSticky,ma="".concat(ui,"-cell"),ko=ot(Ce,["supportSticky","allColumnsFixedLeft","rowHoverable"]),So=ko.supportSticky,$a=ko.allColumnsFixedLeft,gs=ko.rowHoverable,ls=Wt(Yi,Rr,cr,pi,Pn,Mo),ps=(0,Ke.Z)(ls,2),$r=ps[0],Ka=ps[1],Ma={},ns=typeof Xo=="number"&&So,qa=typeof aa=="number"&&So;ns&&(Ma.position="sticky",Ma.left=Xo),qa&&(Ma.position="sticky",Ma.right=aa);var ts=(Rn=(Rt=(Ie=Ka==null?void 0:Ka.colSpan)!==null&&Ie!==void 0?Ie:Jo.colSpan)!==null&&Rt!==void 0?Rt:Wo)!==null&&Rn!==void 0?Rn:1,Xi=(qn=(Ci=(Oi=Ka==null?void 0:Ka.rowSpan)!==null&&Oi!==void 0?Oi:Jo.rowSpan)!==null&&Ci!==void 0?Ci:ua)!==null&&qn!==void 0?qn:1,Xr=An(Wr,Xi),Co=(0,Ke.Z)(Xr,2),Zo=Co[0],Ko=Co[1],ba=(0,ci.zX)(function(Wi){var Si;Yi&&Ko(Wr,Wr+Xi-1),Jo==null||(Si=Jo.onMouseEnter)===null||Si===void 0||Si.call(Jo,Wi)}),Kr=(0,ci.zX)(function(Wi){var Si;Yi&&Ko(-1,-1),Jo==null||(Si=Jo.onMouseLeave)===null||Si===void 0||Si.call(Jo,Wi)});if(ts===0||Xi===0)return null;var Rs=(qi=Jo.title)!==null&&qi!==void 0?qi:It({rowType:Vo,ellipsis:vi,children:$r}),Za=wt()(ma,hi,(zi={},(0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)(zi,"".concat(ma,"-fix-left"),ns&&So),"".concat(ma,"-fix-left-first"),Pa&&So),"".concat(ma,"-fix-left-last"),Gt&&So),"".concat(ma,"-fix-left-all"),Gt&&$a&&So),"".concat(ma,"-fix-right"),qa&&So),"".concat(ma,"-fix-right-first"),qo&&So),"".concat(ma,"-fix-right-last"),fr&&So),"".concat(ma,"-ellipsis"),vi),"".concat(ma,"-with-append"),ao),"".concat(ma,"-fix-sticky"),(ns||qa)&&va&&So),(0,dt.Z)(zi,"".concat(ma,"-row-hover"),!Ka&&Zo)),Jo.className,Ka==null?void 0:Ka.className),nn={};Ti&&(nn.textAlign=Ti);var Ht=(0,Ue.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)({},Ka==null?void 0:Ka.style),Ma),nn),Jo.style),Fn=$r;return(0,Qe.Z)(Fn)==="object"&&!Array.isArray(Fn)&&!Oe.isValidElement(Fn)&&(Fn=null),vi&&(Gt||qo)&&(Fn=Oe.createElement("span",{className:"".concat(ma,"-content")},Fn)),Oe.createElement(Nn,(0,We.Z)({},Ka,Jo,{className:Za,style:Ht,title:Rs,scope:ti,onMouseEnter:gs?ba:void 0,onMouseLeave:gs?Kr:void 0,colSpan:ts!==1?ts:null,rowSpan:Xi!==1?Xi:null}),ao,Fn)}var Nt=Oe.memo(Pt);function ii(Yt,Rn,Rt,Ie,qn){var Ci=Rt[Yt]||{},Oi=Rt[Rn]||{},qi,zi;Ci.fixed==="left"?qi=Ie.left[qn==="rtl"?Rn:Yt]:Oi.fixed==="right"&&(zi=Ie.right[qn==="rtl"?Yt:Rn]);var Nn=!1,pi=!1,vi=!1,ti=!1,ui=Rt[Rn+1],hi=Rt[Yt-1],Ti=ui&&!ui.fixed||hi&&!hi.fixed||Rt.every(function(Mo){return Mo.fixed==="left"});if(qn==="rtl"){if(qi!==void 0){var Yi=hi&&hi.fixed==="left";ti=!Yi&&Ti}else if(zi!==void 0){var Pn=ui&&ui.fixed==="right";vi=!Pn&&Ti}}else if(qi!==void 0){var Rr=ui&&ui.fixed==="left";Nn=!Rr&&Ti}else if(zi!==void 0){var cr=hi&&hi.fixed==="right";pi=!cr&&Ti}return{fixLeft:qi,fixRight:zi,lastFixLeft:Nn,firstFixRight:pi,lastFixRight:vi,firstFixLeft:ti,isSticky:Ie.isSticky}}var Gi=Oe.createContext({}),ze=Gi;function Me(Yt){var Rn=Yt.className,Rt=Yt.index,Ie=Yt.children,qn=Yt.colSpan,Ci=qn===void 0?1:qn,Oi=Yt.rowSpan,qi=Yt.align,zi=ot(Ce,["prefixCls","direction"]),Nn=zi.prefixCls,pi=zi.direction,vi=Oe.useContext(ze),ti=vi.scrollColumnIndex,ui=vi.stickyOffsets,hi=vi.flattenColumns,Ti=Rt+Ci-1,Yi=Ti+1===ti?Ci+1:Ci,Pn=ii(Rt,Rt+Yi-1,hi,ui,pi);return Oe.createElement(Nt,(0,We.Z)({className:Rn,index:Rt,component:"td",prefixCls:Nn,record:null,dataIndex:null,align:qi,colSpan:Yi,rowSpan:Oi,render:function(){return Ie}},Pn))}var Ee=Le(62646),Te=["children"];function He(Yt){var Rn=Yt.children,Rt=(0,Ee.Z)(Yt,Te);return Oe.createElement("tr",Rt,Rn)}function Ae(Yt){var Rn=Yt.children;return Rn}Ae.Row=He,Ae.Cell=Me;var qe=Ae;function an(Yt){var Rn=Yt.children,Rt=Yt.stickyOffsets,Ie=Yt.flattenColumns,qn=ot(Ce,"prefixCls"),Ci=Ie.length-1,Oi=Ie[Ci],qi=Oe.useMemo(function(){return{stickyOffsets:Rt,flattenColumns:Ie,scrollColumnIndex:Oi!=null&&Oi.scrollbar?Ci:null}},[Oi,Ie,Ci,Rt]);return Oe.createElement(ze.Provider,{value:qi},Oe.createElement("tfoot",{className:"".concat(qn,"-summary")},Rn))}var Xt=ge(an),yn=qe,kt=Le(29301),Dt=Le(24514),Zt=Le(75152),hn=Le(26112);function wn(Yt,Rn,Rt,Ie,qn,Ci,Oi){Yt.push({record:Rn,indent:Rt,index:Oi});var qi=Ci(Rn),zi=qn==null?void 0:qn.has(qi);if(Rn&&Array.isArray(Rn[Ie])&&zi)for(var Nn=0;Nn<Rn[Ie].length;Nn+=1)wn(Yt,Rn[Ie][Nn],Rt+1,Ie,qn,Ci,Nn)}function Dn(Yt,Rn,Rt,Ie){var qn=Oe.useMemo(function(){if(Rt!=null&&Rt.size){for(var Ci=[],Oi=0;Oi<(Yt==null?void 0:Yt.length);Oi+=1){var qi=Yt[Oi];wn(Ci,qi,0,Rn,Rt,Ie,Oi)}return Ci}return Yt==null?void 0:Yt.map(function(zi,Nn){return{record:zi,indent:0,index:Nn}})},[Yt,Rn,Rt,Ie]);return qn}function Tn(Yt,Rn,Rt,Ie){var qn=ot(Ce,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),Ci=qn.flattenColumns,Oi=qn.expandableType,qi=qn.expandedKeys,zi=qn.childrenColumnName,Nn=qn.onTriggerExpand,pi=qn.rowExpandable,vi=qn.onRow,ti=qn.expandRowByClick,ui=qn.rowClassName,hi=Oi==="nest",Ti=Oi==="row"&&(!pi||pi(Yt)),Yi=Ti||hi,Pn=qi&&qi.has(Rn),Rr=zi&&Yt&&Yt[zi],cr=(0,ci.zX)(Nn),Mo=vi==null?void 0:vi(Yt,Rt),Wr=Mo==null?void 0:Mo.onClick,Vo=function(aa){ti&&Yi&&Nn(Yt,aa);for(var Pa=arguments.length,Gt=new Array(Pa>1?Pa-1:0),qo=1;qo<Pa;qo++)Gt[qo-1]=arguments[qo];Wr==null||Wr.apply(void 0,[aa].concat(Gt))},Wo;typeof ui=="string"?Wo=ui:typeof ui=="function"&&(Wo=ui(Yt,Rt,Ie));var ua=rt(Ci);return(0,Ue.Z)((0,Ue.Z)({},qn),{},{columnsKey:ua,nestExpandable:hi,expanded:Pn,hasNestChildren:Rr,record:Yt,onTriggerExpand:cr,rowSupportExpand:Ti,expandable:Yi,rowProps:(0,Ue.Z)((0,Ue.Z)({},Mo),{},{className:wt()(Wo,Mo==null?void 0:Mo.className),onClick:Vo})})}function Mi(Yt){var Rn=Yt.prefixCls,Rt=Yt.children,Ie=Yt.component,qn=Yt.cellComponent,Ci=Yt.className,Oi=Yt.expanded,qi=Yt.colSpan,zi=Yt.isEmpty,Nn=ot(Ce,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]),pi=Nn.scrollbarSize,vi=Nn.fixHeader,ti=Nn.fixColumn,ui=Nn.componentWidth,hi=Nn.horizonScroll,Ti=Rt;return(zi?hi&&ui:ti)&&(Ti=Oe.createElement("div",{style:{width:ui-(vi&&!zi?pi:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Rn,"-expanded-row-fixed")},Ti)),Oe.createElement(Ie,{className:Ci,style:{display:Oi?null:"none"}},Oe.createElement(Nt,{component:qn,prefixCls:Rn,colSpan:qi},Ti))}var tn=Mi;function qt(Yt){var Rn=Yt.prefixCls,Rt=Yt.record,Ie=Yt.onExpand,qn=Yt.expanded,Ci=Yt.expandable,Oi="".concat(Rn,"-row-expand-icon");if(!Ci)return Oe.createElement("span",{className:wt()(Oi,"".concat(Rn,"-row-spaced"))});var qi=function(Nn){Ie(Rt,Nn),Nn.stopPropagation()};return Oe.createElement("span",{className:wt()(Oi,(0,dt.Z)((0,dt.Z)({},"".concat(Rn,"-row-expanded"),qn),"".concat(Rn,"-row-collapsed"),!qn)),onClick:qi})}function un(Yt,Rn,Rt){var Ie=[];function qn(Ci){(Ci||[]).forEach(function(Oi,qi){Ie.push(Rn(Oi,qi)),qn(Oi[Rt])})}return qn(Yt),Ie}function zn(Yt,Rn,Rt,Ie){return typeof Yt=="string"?Yt:typeof Yt=="function"?Yt(Rn,Rt,Ie):""}function on(Yt,Rn,Rt,Ie,qn){var Ci=Yt.record,Oi=Yt.prefixCls,qi=Yt.columnsKey,zi=Yt.fixedInfoList,Nn=Yt.expandIconColumnIndex,pi=Yt.nestExpandable,vi=Yt.indentSize,ti=Yt.expandIcon,ui=Yt.expanded,hi=Yt.hasNestChildren,Ti=Yt.onTriggerExpand,Yi=qi[Rt],Pn=zi[Rt],Rr;Rt===(Nn||0)&&pi&&(Rr=Oe.createElement(Oe.Fragment,null,Oe.createElement("span",{style:{paddingLeft:"".concat(vi*Ie,"px")},className:"".concat(Oi,"-row-indent indent-level-").concat(Ie)}),ti({prefixCls:Oi,expanded:ui,expandable:hi,record:Ci,onExpand:Ti})));var cr;return Rn.onCell&&(cr=Rn.onCell(Ci,qn)),{key:Yi,fixedInfo:Pn,appendCellNode:Rr,additionalCellProps:cr||{}}}function Sn(Yt){var Rn=Yt.className,Rt=Yt.style,Ie=Yt.record,qn=Yt.index,Ci=Yt.renderIndex,Oi=Yt.rowKey,qi=Yt.indent,zi=qi===void 0?0:qi,Nn=Yt.rowComponent,pi=Yt.cellComponent,vi=Yt.scopeCellComponent,ti=Tn(Ie,Oi,qn,zi),ui=ti.prefixCls,hi=ti.flattenColumns,Ti=ti.expandedRowClassName,Yi=ti.expandedRowRender,Pn=ti.rowProps,Rr=ti.expanded,cr=ti.rowSupportExpand,Mo=Oe.useRef(!1);Mo.current||(Mo.current=Rr);var Wr=zn(Ti,Ie,qn,zi),Vo=Oe.createElement(Nn,(0,We.Z)({},Pn,{"data-row-key":Oi,className:wt()(Rn,"".concat(ui,"-row"),"".concat(ui,"-row-level-").concat(zi),Pn==null?void 0:Pn.className,(0,dt.Z)({},Wr,zi>=1)),style:(0,Ue.Z)((0,Ue.Z)({},Rt),Pn==null?void 0:Pn.style)}),hi.map(function(Xo,aa){var Pa=Xo.render,Gt=Xo.dataIndex,qo=Xo.className,fr=on(ti,Xo,aa,zi,qn),ao=fr.key,zr=fr.fixedInfo,Jo=fr.appendCellNode,va=fr.additionalCellProps;return Oe.createElement(Nt,(0,We.Z)({className:qo,ellipsis:Xo.ellipsis,align:Xo.align,scope:Xo.rowScope,component:Xo.rowScope?vi:pi,prefixCls:ui,key:ao,record:Ie,index:qn,renderIndex:Ci,dataIndex:Gt,render:Pa,shouldCellUpdate:Xo.shouldCellUpdate},zr,{appendNode:Jo,additionalProps:va}))})),Wo;if(cr&&(Mo.current||Rr)){var ua=Yi(Ie,qn,zi+1,Rr);Wo=Oe.createElement(tn,{expanded:Rr,className:wt()("".concat(ui,"-expanded-row"),"".concat(ui,"-expanded-row-level-").concat(zi+1),Wr),prefixCls:ui,component:Nn,cellComponent:pi,colSpan:hi.length,isEmpty:!1},ua)}return Oe.createElement(Oe.Fragment,null,Vo,Wo)}var di=ge(Sn);function Ui(Yt){var Rn=Yt.columnKey,Rt=Yt.onColumnResize,Ie=Oe.useRef();return(0,bt.Z)(function(){Ie.current&&Rt(Rn,Ie.current.offsetWidth)},[]),Oe.createElement(kt.Z,{data:Rn},Oe.createElement("td",{ref:Ie,style:{padding:0,border:0,height:0}},Oe.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}var gi=Le(29194);function Hi(Yt){var Rn=Yt.prefixCls,Rt=Yt.columnsKey,Ie=Yt.onColumnResize,qn=Oe.useRef(null);return Oe.createElement("tr",{"aria-hidden":"true",className:"".concat(Rn,"-measure-row"),style:{height:0,fontSize:0},ref:qn},Oe.createElement(kt.Z.Collection,{onBatchResize:function(Oi){(0,gi.Z)(qn.current)&&Oi.forEach(function(qi){var zi=qi.data,Nn=qi.size;Ie(zi,Nn.offsetWidth)})}},Rt.map(function(Ci){return Oe.createElement(Ui,{key:Ci,columnKey:Ci,onColumnResize:Ie})})))}function kr(Yt){var Rn=Yt.data,Rt=Yt.measureColumnWidth,Ie=ot(Ce,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode"]),qn=Ie.prefixCls,Ci=Ie.getComponent,Oi=Ie.onColumnResize,qi=Ie.flattenColumns,zi=Ie.getRowKey,Nn=Ie.expandedKeys,pi=Ie.childrenColumnName,vi=Ie.emptyNode,ti=Dn(Rn,pi,Nn,zi),ui=Oe.useRef({renderWithProps:!1}),hi=Ci(["body","wrapper"],"tbody"),Ti=Ci(["body","row"],"tr"),Yi=Ci(["body","cell"],"td"),Pn=Ci(["body","cell"],"th"),Rr;Rn.length?Rr=ti.map(function(Mo,Wr){var Vo=Mo.record,Wo=Mo.indent,ua=Mo.index,Xo=zi(Vo,Wr);return Oe.createElement(di,{key:Xo,rowKey:Xo,record:Vo,index:Wr,renderIndex:ua,rowComponent:Ti,cellComponent:Yi,scopeCellComponent:Pn,indent:Wo})}):Rr=Oe.createElement(tn,{expanded:!0,className:"".concat(qn,"-placeholder"),prefixCls:qn,component:Ti,cellComponent:Yi,colSpan:qi.length,isEmpty:!0},vi);var cr=rt(qi);return Oe.createElement(vn.Provider,{value:ui.current},Oe.createElement(hi,{className:"".concat(qn,"-tbody")},Rt&&Oe.createElement(Hi,{prefixCls:qn,columnsKey:cr,onColumnResize:Oi}),Rr))}var Gn=ge(kr),On=Le(54451),Xn=["columnType"];function wi(Yt){for(var Rn=Yt.colWidths,Rt=Yt.columns,Ie=Yt.columCount,qn=ot(Ce,["tableLayout"]),Ci=qn.tableLayout,Oi=[],qi=Ie||Rt.length,zi=!1,Nn=qi-1;Nn>=0;Nn-=1){var pi=Rn[Nn],vi=Rt&&Rt[Nn],ti=void 0,ui=void 0;if(vi&&(ti=vi[On.v],Ci==="auto"&&(ui=vi.minWidth)),pi||ui||ti||zi){var hi=ti||{},Ti=hi.columnType,Yi=(0,Ee.Z)(hi,Xn);Oi.unshift(Oe.createElement("col",(0,We.Z)({key:Nn,style:{width:pi,minWidth:ui}},Yi))),zi=!0}}return Oe.createElement("colgroup",null,Oi)}var nr=wi,ji=Le(95190),Cr=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function be(Yt,Rn){return(0,Oe.useMemo)(function(){for(var Rt=[],Ie=0;Ie<Rn;Ie+=1){var qn=Yt[Ie];if(qn!==void 0)Rt[Ie]=qn;else return null}return Rt},[Yt.join("_"),Rn])}var mn=Oe.forwardRef(function(Yt,Rn){var Rt=Yt.className,Ie=Yt.noData,qn=Yt.columns,Ci=Yt.flattenColumns,Oi=Yt.colWidths,qi=Yt.columCount,zi=Yt.stickyOffsets,Nn=Yt.direction,pi=Yt.fixHeader,vi=Yt.stickyTopOffset,ti=Yt.stickyBottomOffset,ui=Yt.stickyClassName,hi=Yt.onScroll,Ti=Yt.maxContentScroll,Yi=Yt.children,Pn=(0,Ee.Z)(Yt,Cr),Rr=ot(Ce,["prefixCls","scrollbarSize","isSticky","getComponent"]),cr=Rr.prefixCls,Mo=Rr.scrollbarSize,Wr=Rr.isSticky,Vo=Rr.getComponent,Wo=Vo(["header","table"],"table"),ua=Wr&&!pi?0:Mo,Xo=Oe.useRef(null),aa=Oe.useCallback(function(va){(0,Tt.mH)(Rn,va),(0,Tt.mH)(Xo,va)},[]);Oe.useEffect(function(){var va;function ma(ko){var So=ko,$a=So.currentTarget,gs=So.deltaX;gs&&(hi({currentTarget:$a,scrollLeft:$a.scrollLeft+gs}),ko.preventDefault())}return(va=Xo.current)===null||va===void 0||va.addEventListener("wheel",ma,{passive:!1}),function(){var ko;(ko=Xo.current)===null||ko===void 0||ko.removeEventListener("wheel",ma)}},[]);var Pa=Oe.useMemo(function(){return Ci.every(function(va){return va.width})},[Ci]),Gt=Ci[Ci.length-1],qo={fixed:Gt?Gt.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(cr,"-cell-scrollbar")}}},fr=(0,Oe.useMemo)(function(){return ua?[].concat((0,ji.Z)(qn),[qo]):qn},[ua,qn]),ao=(0,Oe.useMemo)(function(){return ua?[].concat((0,ji.Z)(Ci),[qo]):Ci},[ua,Ci]),zr=(0,Oe.useMemo)(function(){var va=zi.right,ma=zi.left;return(0,Ue.Z)((0,Ue.Z)({},zi),{},{left:Nn==="rtl"?[].concat((0,ji.Z)(ma.map(function(ko){return ko+ua})),[0]):ma,right:Nn==="rtl"?va:[].concat((0,ji.Z)(va.map(function(ko){return ko+ua})),[0]),isSticky:Wr})},[ua,zi,Wr]),Jo=be(Oi,qi);return Oe.createElement("div",{style:(0,Ue.Z)({overflow:"hidden"},Wr?{top:vi,bottom:ti}:{}),ref:aa,className:wt()(Rt,(0,dt.Z)({},ui,!!ui))},Oe.createElement(Wo,{style:{tableLayout:"fixed",visibility:Ie||Jo?null:"hidden"}},(!Ie||!Ti||Pa)&&Oe.createElement(nr,{colWidths:Jo?[].concat((0,ji.Z)(Jo),[ua]):[],columCount:qi+1,columns:ao}),Yi((0,Ue.Z)((0,Ue.Z)({},Pn),{},{stickyOffsets:zr,columns:fr,flattenColumns:ao}))))}),fi=Oe.memo(mn),Vn=function(Rn){var Rt=Rn.cells,Ie=Rn.stickyOffsets,qn=Rn.flattenColumns,Ci=Rn.rowComponent,Oi=Rn.cellComponent,qi=Rn.onHeaderRow,zi=Rn.index,Nn=ot(Ce,["prefixCls","direction"]),pi=Nn.prefixCls,vi=Nn.direction,ti;qi&&(ti=qi(Rt.map(function(hi){return hi.column}),zi));var ui=rt(Rt.map(function(hi){return hi.column}));return Oe.createElement(Ci,ti,Rt.map(function(hi,Ti){var Yi=hi.column,Pn=ii(hi.colStart,hi.colEnd,qn,Ie,vi),Rr;return Yi&&Yi.onHeaderCell&&(Rr=hi.column.onHeaderCell(Yi)),Oe.createElement(Nt,(0,We.Z)({},hi,{scope:Yi.title?hi.colSpan>1?"colgroup":"col":null,ellipsis:Yi.ellipsis,align:Yi.align,component:Oi,prefixCls:pi,key:ui[Ti]},Pn,{additionalProps:Rr,rowType:"header"}))}))},si=Vn;function Di(Yt){var Rn=[];function Rt(Oi,qi){var zi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Rn[zi]=Rn[zi]||[];var Nn=qi,pi=Oi.filter(Boolean).map(function(vi){var ti={key:vi.key,className:vi.className||"",children:vi.title,column:vi,colStart:Nn},ui=1,hi=vi.children;return hi&&hi.length>0&&(ui=Rt(hi,Nn,zi+1).reduce(function(Ti,Yi){return Ti+Yi},0),ti.hasSubColumns=!0),"colSpan"in vi&&(ui=vi.colSpan),"rowSpan"in vi&&(ti.rowSpan=vi.rowSpan),ti.colSpan=ui,ti.colEnd=ti.colStart+ui-1,Rn[zi].push(ti),Nn+=ui,ui});return pi}Rt(Yt,0);for(var Ie=Rn.length,qn=function(qi){Rn[qi].forEach(function(zi){!("rowSpan"in zi)&&!zi.hasSubColumns&&(zi.rowSpan=Ie-qi)})},Ci=0;Ci<Ie;Ci+=1)qn(Ci);return Rn}var Ni=function(Rn){var Rt=Rn.stickyOffsets,Ie=Rn.columns,qn=Rn.flattenColumns,Ci=Rn.onHeaderRow,Oi=ot(Ce,["prefixCls","getComponent"]),qi=Oi.prefixCls,zi=Oi.getComponent,Nn=Oe.useMemo(function(){return Di(Ie)},[Ie]),pi=zi(["header","wrapper"],"thead"),vi=zi(["header","row"],"tr"),ti=zi(["header","cell"],"th");return Oe.createElement(pi,{className:"".concat(qi,"-thead")},Nn.map(function(ui,hi){var Ti=Oe.createElement(si,{key:hi,flattenColumns:qn,cells:ui,stickyOffsets:Rt,rowComponent:vi,cellComponent:ti,onHeaderRow:Ci,index:hi});return Ti}))},yr=ge(Ni),zt=Le(97347);function Mt(Yt,Rn,Rt){var Ie=(0,On.g)(Yt),qn=Ie.expandIcon,Ci=Ie.expandedRowKeys,Oi=Ie.defaultExpandedRowKeys,qi=Ie.defaultExpandAllRows,zi=Ie.expandedRowRender,Nn=Ie.onExpand,pi=Ie.onExpandedRowsChange,vi=Ie.childrenColumnName,ti=qn||qt,ui=vi||"children",hi=Oe.useMemo(function(){return zi?"row":Yt.expandable&&Yt.internalHooks===le.R&&Yt.expandable.__PARENT_RENDER_ICON__||Rn.some(function(Wr){return Wr&&(0,Qe.Z)(Wr)==="object"&&Wr[ui]})?"nest":!1},[!!zi,Rn]),Ti=Oe.useState(function(){return Oi||(qi?un(Rn,Rt,ui):[])}),Yi=(0,Ke.Z)(Ti,2),Pn=Yi[0],Rr=Yi[1],cr=Oe.useMemo(function(){return new Set(Ci||Pn||[])},[Ci,Pn]),Mo=Oe.useCallback(function(Wr){var Vo=Rt(Wr,Rn.indexOf(Wr)),Wo,ua=cr.has(Vo);ua?(cr.delete(Vo),Wo=(0,ji.Z)(cr)):Wo=[].concat((0,ji.Z)(cr),[Vo]),Rr(Wo),Nn&&Nn(!ua,Wr),pi&&pi(Wo)},[Rt,cr,Rn,Nn,pi]);return[Ie,hi,cr,ti,ui,Mo]}function _t(Yt,Rn,Rt){var Ie=Yt.map(function(qn,Ci){return ii(Ci,Ci,Yt,Rn,Rt)});return(0,St.Z)(function(){return Ie},[Ie],function(qn,Ci){return!(0,vt.Z)(qn,Ci)})}function fn(Yt){var Rn=(0,Oe.useRef)(Yt),Rt=(0,Oe.useState)({}),Ie=(0,Ke.Z)(Rt,2),qn=Ie[1],Ci=(0,Oe.useRef)(null),Oi=(0,Oe.useRef)([]);function qi(zi){Oi.current.push(zi);var Nn=Promise.resolve();Ci.current=Nn,Nn.then(function(){if(Ci.current===Nn){var pi=Oi.current,vi=Rn.current;Oi.current=[],pi.forEach(function(ti){Rn.current=ti(Rn.current)}),Ci.current=null,vi!==Rn.current&&qn({})}})}return(0,Oe.useEffect)(function(){return function(){Ci.current=null}},[]),[Rn.current,qi]}function Ji(Yt){var Rn=(0,Oe.useRef)(Yt||null),Rt=(0,Oe.useRef)();function Ie(){window.clearTimeout(Rt.current)}function qn(Oi){Rn.current=Oi,Ie(),Rt.current=window.setTimeout(function(){Rn.current=null,Rt.current=void 0},100)}function Ci(){return Rn.current}return(0,Oe.useEffect)(function(){return Ie},[]),[qn,Ci]}function mi(){var Yt=Oe.useState(-1),Rn=(0,Ke.Z)(Yt,2),Rt=Rn[0],Ie=Rn[1],qn=Oe.useState(-1),Ci=(0,Ke.Z)(qn,2),Oi=Ci[0],qi=Ci[1],zi=Oe.useCallback(function(Nn,pi){Ie(Nn),qi(pi)},[]);return[Rt,Oi,zi]}var $i=Le(47273),xn=(0,$i.Z)()?window:null;function ni(Yt,Rn){var Rt=(0,Qe.Z)(Yt)==="object"?Yt:{},Ie=Rt.offsetHeader,qn=Ie===void 0?0:Ie,Ci=Rt.offsetSummary,Oi=Ci===void 0?0:Ci,qi=Rt.offsetScroll,zi=qi===void 0?0:qi,Nn=Rt.getContainer,pi=Nn===void 0?function(){return xn}:Nn,vi=pi()||xn,ti=!!Yt;return Oe.useMemo(function(){return{isSticky:ti,stickyClassName:ti?"".concat(Rn,"-sticky-holder"):"",offsetHeader:qn,offsetSummary:Oi,offsetScroll:zi,container:vi}},[ti,zi,qn,Oi,Rn,vi])}function sr(Yt,Rn,Rt){var Ie=(0,Oe.useMemo)(function(){var qn=Rn.length,Ci=function(Nn,pi,vi){for(var ti=[],ui=0,hi=Nn;hi!==pi;hi+=vi)ti.push(ui),Rn[hi].fixed&&(ui+=Yt[hi]||0);return ti},Oi=Ci(0,qn,1),qi=Ci(qn-1,-1,-1).reverse();return Rt==="rtl"?{left:qi,right:Oi}:{left:Oi,right:qi}},[Yt,Rn,Rt]);return Ie}var br=sr;function Yn(Yt){var Rn=Yt.className,Rt=Yt.children;return Oe.createElement("div",{className:Rn},Rt)}var at=Yn,Bt=Le(8224),Kn=Le(16089),li=Le(76846);function Qt(Yt){var Rn=(0,li.bn)(Yt),Rt=Rn.getBoundingClientRect(),Ie=document.documentElement;return{left:Rt.left+(window.pageXOffset||Ie.scrollLeft)-(Ie.clientLeft||document.body.clientLeft||0),top:Rt.top+(window.pageYOffset||Ie.scrollTop)-(Ie.clientTop||document.body.clientTop||0)}}var jt=function(Rn,Rt){var Ie,qn,Ci=Rn.scrollBodyRef,Oi=Rn.onScroll,qi=Rn.offsetScroll,zi=Rn.container,Nn=Rn.direction,pi=ot(Ce,"prefixCls"),vi=((Ie=Ci.current)===null||Ie===void 0?void 0:Ie.scrollWidth)||0,ti=((qn=Ci.current)===null||qn===void 0?void 0:qn.clientWidth)||0,ui=vi&&ti*(ti/vi),hi=Oe.useRef(),Ti=fn({scrollLeft:0,isHiddenScrollBar:!0}),Yi=(0,Ke.Z)(Ti,2),Pn=Yi[0],Rr=Yi[1],cr=Oe.useRef({delta:0,x:0}),Mo=Oe.useState(!1),Wr=(0,Ke.Z)(Mo,2),Vo=Wr[0],Wo=Wr[1],ua=Oe.useRef(null);Oe.useEffect(function(){return function(){Kn.Z.cancel(ua.current)}},[]);var Xo=function(){Wo(!1)},aa=function(ao){ao.persist(),cr.current.delta=ao.pageX-Pn.scrollLeft,cr.current.x=0,Wo(!0),ao.preventDefault()},Pa=function(ao){var zr,Jo=ao||((zr=window)===null||zr===void 0?void 0:zr.event),va=Jo.buttons;if(!Vo||va===0){Vo&&Wo(!1);return}var ma=cr.current.x+ao.pageX-cr.current.x-cr.current.delta,ko=Nn==="rtl";ma=Math.max(ko?ui-ti:0,Math.min(ko?0:ti-ui,ma));var So=!ko||Math.abs(ma)+Math.abs(ui)<ti;So&&(Oi({scrollLeft:ma/ti*(vi+2)}),cr.current.x=ao.pageX)},Gt=function(){Kn.Z.cancel(ua.current),ua.current=(0,Kn.Z)(function(){if(Ci.current){var ao=Qt(Ci.current).top,zr=ao+Ci.current.offsetHeight,Jo=zi===window?document.documentElement.scrollTop+window.innerHeight:Qt(zi).top+zi.clientHeight;zr-(0,Zt.Z)()<=Jo||ao>=Jo-qi?Rr(function(va){return(0,Ue.Z)((0,Ue.Z)({},va),{},{isHiddenScrollBar:!0})}):Rr(function(va){return(0,Ue.Z)((0,Ue.Z)({},va),{},{isHiddenScrollBar:!1})})}})},qo=function(ao){Rr(function(zr){return(0,Ue.Z)((0,Ue.Z)({},zr),{},{scrollLeft:ao/vi*ti||0})})};return Oe.useImperativeHandle(Rt,function(){return{setScrollLeft:qo,checkScrollBarVisible:Gt}}),Oe.useEffect(function(){var fr=(0,Bt.Z)(document.body,"mouseup",Xo,!1),ao=(0,Bt.Z)(document.body,"mousemove",Pa,!1);return Gt(),function(){fr.remove(),ao.remove()}},[ui,Vo]),Oe.useEffect(function(){if(Ci.current){for(var fr=[],ao=(0,li.bn)(Ci.current);ao;)fr.push(ao),ao=ao.parentElement;return fr.forEach(function(zr){return zr.addEventListener("scroll",Gt,!1)}),window.addEventListener("resize",Gt,!1),window.addEventListener("scroll",Gt,!1),zi.addEventListener("scroll",Gt,!1),function(){fr.forEach(function(zr){return zr.removeEventListener("scroll",Gt)}),window.removeEventListener("resize",Gt),window.removeEventListener("scroll",Gt),zi.removeEventListener("scroll",Gt)}}},[zi]),Oe.useEffect(function(){Pn.isHiddenScrollBar||Rr(function(fr){var ao=Ci.current;return ao?(0,Ue.Z)((0,Ue.Z)({},fr),{},{scrollLeft:ao.scrollLeft/ao.scrollWidth*ao.clientWidth}):fr})},[Pn.isHiddenScrollBar]),vi<=ti||!ui||Pn.isHiddenScrollBar?null:Oe.createElement("div",{style:{height:(0,Zt.Z)(),width:ti,bottom:qi},className:"".concat(pi,"-sticky-scroll")},Oe.createElement("div",{onMouseDown:aa,ref:hi,className:wt()("".concat(pi,"-sticky-scroll-bar"),(0,dt.Z)({},"".concat(pi,"-sticky-scroll-bar-active"),Vo)),style:{width:"".concat(ui,"px"),transform:"translate3d(".concat(Pn.scrollLeft,"px, 0, 0)")}}))},Un=Oe.forwardRef(jt);function ai(Yt){return null}var Vi=ai;function xi(Yt){return null}var Bi=xi,Ii="rc-table",Pr=[],xr={};function _n(){return"No Data"}function ki(Yt,Rn){var Rt=(0,Ue.Z)({rowKey:"key",prefixCls:Ii,emptyText:_n},Yt),Ie=Rt.prefixCls,qn=Rt.className,Ci=Rt.rowClassName,Oi=Rt.style,qi=Rt.data,zi=Rt.rowKey,Nn=Rt.scroll,pi=Rt.tableLayout,vi=Rt.direction,ti=Rt.title,ui=Rt.footer,hi=Rt.summary,Ti=Rt.caption,Yi=Rt.id,Pn=Rt.showHeader,Rr=Rt.components,cr=Rt.emptyText,Mo=Rt.onRow,Wr=Rt.onHeaderRow,Vo=Rt.onScroll,Wo=Rt.internalHooks,ua=Rt.transformColumns,Xo=Rt.internalRefs,aa=Rt.tailor,Pa=Rt.getContainerWidth,Gt=Rt.sticky,qo=Rt.rowHoverable,fr=qo===void 0?!0:qo,ao=qi||Pr,zr=!!ao.length,Jo=Wo===le.R,va=Oe.useCallback(function(Ea,Oa){return(0,Lt.Z)(Rr,Ea)||Oa},[Rr]),ma=Oe.useMemo(function(){return typeof zi=="function"?zi:function(Ea){var Oa=Ea&&Ea[zi];return Oa}},[zi]),ko=va(["body"]),So=mi(),$a=(0,Ke.Z)(So,3),gs=$a[0],ls=$a[1],ps=$a[2],$r=Mt(Rt,ao,ma),Ka=(0,Ke.Z)($r,6),Ma=Ka[0],ns=Ka[1],qa=Ka[2],ts=Ka[3],Xi=Ka[4],Xr=Ka[5],Co=Nn==null?void 0:Nn.x,Zo=Oe.useState(0),Ko=(0,Ke.Z)(Zo,2),ba=Ko[0],Kr=Ko[1],Rs=(0,zt.Z)((0,Ue.Z)((0,Ue.Z)((0,Ue.Z)({},Rt),Ma),{},{expandable:!!Ma.expandedRowRender,columnTitle:Ma.columnTitle,expandedKeys:qa,getRowKey:ma,onTriggerExpand:Xr,expandIcon:ts,expandIconColumnIndex:Ma.expandIconColumnIndex,direction:vi,scrollWidth:Jo&&aa&&typeof Co=="number"?Co:null,clientWidth:ba}),Jo?ua:null),Za=(0,Ke.Z)(Rs,4),nn=Za[0],Ht=Za[1],Fn=Za[2],Wi=Za[3],Si=Fn!=null?Fn:Co,_i=Oe.useMemo(function(){return{columns:nn,flattenColumns:Ht}},[nn,Ht]),Pi=Oe.useRef(),Ln=Oe.useRef(),oi=Oe.useRef(),ur=Oe.useRef();Oe.useImperativeHandle(Rn,function(){return{nativeElement:Pi.current,scrollTo:function(Oa){var us;if(oi.current instanceof HTMLElement){var Zs=Oa.index,Gs=Oa.top,Il=Oa.key;if(ri(Gs)){var mu;(mu=oi.current)===null||mu===void 0||mu.scrollTo({top:Gs})}else{var Fu,Ol=Il!=null?Il:ma(ao[Zs]);(Fu=oi.current.querySelector('[data-row-key="'.concat(Ol,'"]')))===null||Fu===void 0||Fu.scrollIntoView()}}else(us=oi.current)!==null&&us!==void 0&&us.scrollTo&&oi.current.scrollTo(Oa)}}});var Nr=Oe.useRef(),yo=Oe.useState(!1),ea=(0,Ke.Z)(yo,2),La=ea[0],ga=ea[1],bo=Oe.useState(!1),Dr=(0,Ke.Z)(bo,2),or=Dr[0],ta=Dr[1],sa=Oe.useState(new Map),Ta=(0,Ke.Z)(sa,2),Ga=Ta[0],Oo=Ta[1],pa=rt(Ht),Lo=pa.map(function(Ea){return Ga.get(Ea)}),Ir=Oe.useMemo(function(){return Lo},[Lo.join("_")]),Ba=br(Ir,Ht,vi),ra=Nn&&dn(Nn.y),Uo=Nn&&dn(Si)||!!Ma.fixed,_o=Uo&&Ht.some(function(Ea){var Oa=Ea.fixed;return Oa}),oa=Oe.useRef(),Ua=ni(Gt,Ie),pt=Ua.isSticky,Ut=Ua.offsetHeader,Re=Ua.offsetSummary,ut=Ua.offsetScroll,dr=Ua.stickyClassName,lr=Ua.container,gr=Oe.useMemo(function(){return hi==null?void 0:hi(ao)},[hi,ao]),Qi=(ra||pt)&&Oe.isValidElement(gr)&&gr.type===qe&&gr.props.fixed,Jn,Fr,Br;ra&&(Fr={overflowY:zr?"scroll":"auto",maxHeight:Nn.y}),Uo&&(Jn={overflowX:"auto"},ra||(Fr={overflowY:"hidden"}),Br={width:Si===!0?"auto":Si,minWidth:"100%"});var Zr=Oe.useCallback(function(Ea,Oa){Oo(function(us){if(us.get(Ea)!==Oa){var Zs=new Map(us);return Zs.set(Ea,Oa),Zs}return us})},[]),mr=Ji(null),Po=(0,Ke.Z)(mr,2),Ki=Po[0],Ei=Po[1];function bi(Ea,Oa){Oa&&(typeof Oa=="function"?Oa(Ea):Oa.scrollLeft!==Ea&&(Oa.scrollLeft=Ea,Oa.scrollLeft!==Ea&&setTimeout(function(){Oa.scrollLeft=Ea},0)))}var Jr=(0,it.Z)(function(Ea){var Oa=Ea.currentTarget,us=Ea.scrollLeft,Zs=vi==="rtl",Gs=typeof us=="number"?us:Oa.scrollLeft,Il=Oa||xr;if(!Ei()||Ei()===Il){var mu;Ki(Il),bi(Gs,Ln.current),bi(Gs,oi.current),bi(Gs,Nr.current),bi(Gs,(mu=oa.current)===null||mu===void 0?void 0:mu.setScrollLeft)}var Fu=Oa||Ln.current;if(Fu){var Ol=Jo&&aa&&typeof Si=="number"?Si:Fu.scrollWidth,Xl=Fu.clientWidth;if(Ol===Xl){ga(!1),ta(!1);return}Zs?(ga(-Gs<Ol-Xl),ta(-Gs>0)):(ga(Gs>0),ta(Gs<Ol-Xl))}}),Ur=(0,it.Z)(function(Ea){Jr(Ea),Vo==null||Vo(Ea)}),Mr=function(){if(Uo&&oi.current){var Oa;Jr({currentTarget:(0,li.bn)(oi.current),scrollLeft:(Oa=oi.current)===null||Oa===void 0?void 0:Oa.scrollLeft})}else ga(!1),ta(!1)},Fo=function(Oa){var us,Zs=Oa.width;(us=oa.current)===null||us===void 0||us.checkScrollBarVisible();var Gs=Pi.current?Pi.current.offsetWidth:Zs;Jo&&Pa&&Pi.current&&(Gs=Pa(Pi.current,Gs)||Gs),Gs!==ba&&(Mr(),Kr(Gs))},vr=Oe.useRef(!1);Oe.useEffect(function(){vr.current&&Mr()},[Uo,qi,nn.length]),Oe.useEffect(function(){vr.current=!0},[]);var so=Oe.useState(0),er=(0,Ke.Z)(so,2),Tr=er[0],oo=er[1],Go=Oe.useState(!0),ha=(0,Ke.Z)(Go,2),_a=ha[0],jr=ha[1];(0,bt.Z)(function(){(!aa||!Jo)&&(oi.current instanceof Element?oo((0,Zt.o)(oi.current).width):oo((0,Zt.o)(ur.current).width)),jr((0,Dt.G)("position","sticky"))},[]),Oe.useEffect(function(){Jo&&Xo&&(Xo.body.current=oi.current)});var Ls=Oe.useCallback(function(Ea){return Oe.createElement(Oe.Fragment,null,Oe.createElement(yr,Ea),Qi==="top"&&Oe.createElement(Xt,Ea,gr))},[Qi,gr]),vo=Oe.useCallback(function(Ea){return Oe.createElement(Xt,Ea,gr)},[gr]),na=va(["table"],"table"),Eo=Oe.useMemo(function(){return pi||(_o?Si==="max-content"?"auto":"fixed":ra||pt||Ht.some(function(Ea){var Oa=Ea.ellipsis;return Oa})?"fixed":"auto")},[ra,_o,Ht,pi,pt]),Xa,Ia={colWidths:Ir,columCount:Ht.length,stickyOffsets:Ba,onHeaderRow:Wr,fixHeader:ra,scroll:Nn},xs=Oe.useMemo(function(){return zr?null:typeof cr=="function"?cr():cr},[zr,cr]),Yl=Oe.createElement(Gn,{data:ao,measureColumnWidth:ra||Uo||pt}),zu=Oe.createElement(nr,{colWidths:Ht.map(function(Ea){var Oa=Ea.width;return Oa}),columns:Ht}),Ll=Ti!=null?Oe.createElement("caption",{className:"".concat(Ie,"-caption")},Ti):void 0,lu=(0,hn.Z)(Rt,{data:!0}),ka=(0,hn.Z)(Rt,{aria:!0});if(ra||pt){var qs;typeof ko=="function"?(qs=ko(ao,{scrollbarSize:Tr,ref:oi,onScroll:Jr}),Ia.colWidths=Ht.map(function(Ea,Oa){var us=Ea.width,Zs=Oa===Ht.length-1?us-Tr:us;return typeof Zs=="number"&&!Number.isNaN(Zs)?Zs:0})):qs=Oe.createElement("div",{style:(0,Ue.Z)((0,Ue.Z)({},Jn),Fr),onScroll:Ur,ref:oi,className:wt()("".concat(Ie,"-body"))},Oe.createElement(na,(0,We.Z)({style:(0,Ue.Z)((0,Ue.Z)({},Br),{},{tableLayout:Eo})},ka),Ll,zu,Yl,!Qi&&gr&&Oe.createElement(Xt,{stickyOffsets:Ba,flattenColumns:Ht},gr)));var al=(0,Ue.Z)((0,Ue.Z)((0,Ue.Z)({noData:!ao.length,maxContentScroll:Uo&&Si==="max-content"},Ia),_i),{},{direction:vi,stickyClassName:dr,onScroll:Jr});Xa=Oe.createElement(Oe.Fragment,null,Pn!==!1&&Oe.createElement(fi,(0,We.Z)({},al,{stickyTopOffset:Ut,className:"".concat(Ie,"-header"),ref:Ln}),Ls),qs,Qi&&Qi!=="top"&&Oe.createElement(fi,(0,We.Z)({},al,{stickyBottomOffset:Re,className:"".concat(Ie,"-summary"),ref:Nr}),vo),pt&&oi.current&&oi.current instanceof Element&&Oe.createElement(Un,{ref:oa,offsetScroll:ut,scrollBodyRef:oi,onScroll:Jr,container:lr,direction:vi}))}else Xa=Oe.createElement("div",{style:(0,Ue.Z)((0,Ue.Z)({},Jn),Fr),className:wt()("".concat(Ie,"-content")),onScroll:Jr,ref:oi},Oe.createElement(na,(0,We.Z)({style:(0,Ue.Z)((0,Ue.Z)({},Br),{},{tableLayout:Eo})},ka),Ll,zu,Pn!==!1&&Oe.createElement(yr,(0,We.Z)({},Ia,_i)),Yl,gr&&Oe.createElement(Xt,{stickyOffsets:Ba,flattenColumns:Ht},gr)));var fl=Oe.createElement("div",(0,We.Z)({className:wt()(Ie,qn,(0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)((0,dt.Z)({},"".concat(Ie,"-rtl"),vi==="rtl"),"".concat(Ie,"-ping-left"),La),"".concat(Ie,"-ping-right"),or),"".concat(Ie,"-layout-fixed"),pi==="fixed"),"".concat(Ie,"-fixed-header"),ra),"".concat(Ie,"-fixed-column"),_o),"".concat(Ie,"-fixed-column-gapped"),_o&&Wi),"".concat(Ie,"-scroll-horizontal"),Uo),"".concat(Ie,"-has-fix-left"),Ht[0]&&Ht[0].fixed),"".concat(Ie,"-has-fix-right"),Ht[Ht.length-1]&&Ht[Ht.length-1].fixed==="right")),style:Oi,id:Yi,ref:Pi},lu),ti&&Oe.createElement(at,{className:"".concat(Ie,"-title")},ti(ao)),Oe.createElement("div",{ref:ur,className:"".concat(Ie,"-container")},Xa),ui&&Oe.createElement(at,{className:"".concat(Ie,"-footer")},ui(ao)));Uo&&(fl=Oe.createElement(kt.Z,{onResize:Fo},fl));var uu=_t(Ht,Ba,vi),Bl=Oe.useMemo(function(){return{scrollX:Si,prefixCls:Ie,getComponent:va,scrollbarSize:Tr,direction:vi,fixedInfoList:uu,isSticky:pt,supportSticky:_a,componentWidth:ba,fixHeader:ra,fixColumn:_o,horizonScroll:Uo,tableLayout:Eo,rowClassName:Ci,expandedRowClassName:Ma.expandedRowClassName,expandIcon:ts,expandableType:ns,expandRowByClick:Ma.expandRowByClick,expandedRowRender:Ma.expandedRowRender,onTriggerExpand:Xr,expandIconColumnIndex:Ma.expandIconColumnIndex,indentSize:Ma.indentSize,allColumnsFixedLeft:Ht.every(function(Ea){return Ea.fixed==="left"}),emptyNode:xs,columns:nn,flattenColumns:Ht,onColumnResize:Zr,hoverStartRow:gs,hoverEndRow:ls,onHover:ps,rowExpandable:Ma.rowExpandable,onRow:Mo,getRowKey:ma,expandedKeys:qa,childrenColumnName:Xi,rowHoverable:fr}},[Si,Ie,va,Tr,vi,uu,pt,_a,ba,ra,_o,Uo,Eo,Ci,Ma.expandedRowClassName,ts,ns,Ma.expandRowByClick,Ma.expandedRowRender,Xr,Ma.expandIconColumnIndex,Ma.indentSize,xs,nn,Ht,Zr,gs,ls,ps,Ma.rowExpandable,Mo,ma,qa,Xi,fr]);return Oe.createElement(Ce.Provider,{value:Bl},fl)}var Ar=Oe.forwardRef(ki);function Vr(Yt){return se(Ar,Yt)}var xo=Vr();xo.EXPAND_COLUMN=le.w,xo.INTERNAL_HOOKS=le.R,xo.Column=Vi,xo.ColumnGroup=Bi,xo.Summary=yn;var Ot=xo,Li=Le(6790),Sr=Et(null),Ri=Et(null);function po(Yt,Rn,Rt){var Ie=Rn||1;return Rt[Yt+Ie]-(Rt[Yt]||0)}function Qr(Yt){var Rn=Yt.rowInfo,Rt=Yt.column,Ie=Yt.colIndex,qn=Yt.indent,Ci=Yt.index,Oi=Yt.component,qi=Yt.renderIndex,zi=Yt.record,Nn=Yt.style,pi=Yt.className,vi=Yt.inverse,ti=Yt.getHeight,ui=Rt.render,hi=Rt.dataIndex,Ti=Rt.className,Yi=Rt.width,Pn=ot(Ri,["columnsOffset"]),Rr=Pn.columnsOffset,cr=on(Rn,Rt,Ie,qn,Ci),Mo=cr.key,Wr=cr.fixedInfo,Vo=cr.appendCellNode,Wo=cr.additionalCellProps,ua=Wo.style,Xo=Wo.colSpan,aa=Xo===void 0?1:Xo,Pa=Wo.rowSpan,Gt=Pa===void 0?1:Pa,qo=Ie-1,fr=po(qo,aa,Rr),ao=aa>1?Yi-fr:0,zr=(0,Ue.Z)((0,Ue.Z)((0,Ue.Z)({},ua),Nn),{},{flex:"0 0 ".concat(fr,"px"),width:"".concat(fr,"px"),marginRight:ao,pointerEvents:"auto"}),Jo=Oe.useMemo(function(){return vi?Gt<=1:aa===0||Gt===0||Gt>1},[Gt,aa,vi]);Jo?zr.visibility="hidden":vi&&(zr.height=ti==null?void 0:ti(Gt));var va=Jo?function(){return null}:ui,ma={};return(Gt===0||aa===0)&&(ma.rowSpan=1,ma.colSpan=1),Oe.createElement(Nt,(0,We.Z)({className:wt()(Ti,pi),ellipsis:Rt.ellipsis,align:Rt.align,scope:Rt.rowScope,component:Oi,prefixCls:Rn.prefixCls,key:Mo,record:zi,index:Ci,renderIndex:qi,dataIndex:hi,render:va,shouldCellUpdate:Rt.shouldCellUpdate},Wr,{appendNode:Vo,additionalProps:(0,Ue.Z)((0,Ue.Z)({},Wo),{},{style:zr},ma)}))}var mo=Qr,fo=["data","index","className","rowKey","style","extra","getHeight"],wo=Oe.forwardRef(function(Yt,Rn){var Rt=Yt.data,Ie=Yt.index,qn=Yt.className,Ci=Yt.rowKey,Oi=Yt.style,qi=Yt.extra,zi=Yt.getHeight,Nn=(0,Ee.Z)(Yt,fo),pi=Rt.record,vi=Rt.indent,ti=Rt.index,ui=ot(Ce,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),hi=ui.scrollX,Ti=ui.flattenColumns,Yi=ui.prefixCls,Pn=ui.fixColumn,Rr=ui.componentWidth,cr=ot(Sr,["getComponent"]),Mo=cr.getComponent,Wr=Tn(pi,Ci,Ie,vi),Vo=Mo(["body","row"],"div"),Wo=Mo(["body","cell"],"div"),ua=Wr.rowSupportExpand,Xo=Wr.expanded,aa=Wr.rowProps,Pa=Wr.expandedRowRender,Gt=Wr.expandedRowClassName,qo;if(ua&&Xo){var fr=Pa(pi,Ie,vi+1,Xo),ao=zn(Gt,pi,Ie,vi),zr={};Pn&&(zr={style:(0,dt.Z)({},"--virtual-width","".concat(Rr,"px"))});var Jo="".concat(Yi,"-expanded-row-cell");qo=Oe.createElement(Vo,{className:wt()("".concat(Yi,"-expanded-row"),"".concat(Yi,"-expanded-row-level-").concat(vi+1),ao)},Oe.createElement(Nt,{component:Wo,prefixCls:Yi,className:wt()(Jo,(0,dt.Z)({},"".concat(Jo,"-fixed"),Pn)),additionalProps:zr},fr))}var va=(0,Ue.Z)((0,Ue.Z)({},Oi),{},{width:hi});qi&&(va.position="absolute",va.pointerEvents="none");var ma=Oe.createElement(Vo,(0,We.Z)({},aa,Nn,{"data-row-key":Ci,ref:ua?null:Rn,className:wt()(qn,"".concat(Yi,"-row"),aa==null?void 0:aa.className,(0,dt.Z)({},"".concat(Yi,"-row-extra"),qi)),style:(0,Ue.Z)((0,Ue.Z)({},va),aa==null?void 0:aa.style)}),Ti.map(function(ko,So){return Oe.createElement(mo,{key:So,component:Wo,rowInfo:Wr,column:ko,colIndex:So,indent:vi,index:Ie,renderIndex:ti,record:pi,inverse:qi,getHeight:zi})}));return ua?Oe.createElement("div",{ref:Rn},ma,qo):ma}),Io=ge(wo),Bn=Io,ca=Oe.forwardRef(function(Yt,Rn){var Rt=Yt.data,Ie=Yt.onScroll,qn=ot(Ce,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","scrollX","direction"]),Ci=qn.flattenColumns,Oi=qn.onColumnResize,qi=qn.getRowKey,zi=qn.expandedKeys,Nn=qn.prefixCls,pi=qn.childrenColumnName,vi=qn.scrollX,ti=qn.direction,ui=ot(Sr),hi=ui.sticky,Ti=ui.scrollY,Yi=ui.listItemHeight,Pn=ui.getComponent,Rr=ui.onScroll,cr=Oe.useRef(),Mo=Dn(Rt,pi,zi,qi),Wr=Oe.useMemo(function(){var qo=0;return Ci.map(function(fr){var ao=fr.width,zr=fr.key;return qo+=ao,[zr,ao,qo]})},[Ci]),Vo=Oe.useMemo(function(){return Wr.map(function(qo){return qo[2]})},[Wr]);Oe.useEffect(function(){Wr.forEach(function(qo){var fr=(0,Ke.Z)(qo,2),ao=fr[0],zr=fr[1];Oi(ao,zr)})},[Wr]),Oe.useImperativeHandle(Rn,function(){var qo,fr={scrollTo:function(zr){var Jo;(Jo=cr.current)===null||Jo===void 0||Jo.scrollTo(zr)},nativeElement:(qo=cr.current)===null||qo===void 0?void 0:qo.nativeElement};return Object.defineProperty(fr,"scrollLeft",{get:function(){var zr;return((zr=cr.current)===null||zr===void 0?void 0:zr.getScrollInfo().x)||0},set:function(zr){var Jo;(Jo=cr.current)===null||Jo===void 0||Jo.scrollTo({left:zr})}}),fr});var Wo=function(fr,ao){var zr,Jo=(zr=Mo[ao])===null||zr===void 0?void 0:zr.record,va=fr.onCell;if(va){var ma,ko=va(Jo,ao);return(ma=ko==null?void 0:ko.rowSpan)!==null&&ma!==void 0?ma:1}return 1},ua=function(fr){var ao=fr.start,zr=fr.end,Jo=fr.getSize,va=fr.offsetY;if(zr<0)return null;for(var ma=Ci.filter(function(ts){return Wo(ts,ao)===0}),ko=ao,So=function(Xi){if(ma=ma.filter(function(Xr){return Wo(Xr,Xi)===0}),!ma.length)return ko=Xi,1},$a=ao;$a>=0&&!So($a);$a-=1);for(var gs=Ci.filter(function(ts){return Wo(ts,zr)!==1}),ls=zr,ps=function(Xi){if(gs=gs.filter(function(Xr){return Wo(Xr,Xi)!==1}),!gs.length)return ls=Math.max(Xi-1,zr),1},$r=zr;$r<Mo.length&&!ps($r);$r+=1);for(var Ka=[],Ma=function(Xi){var Xr=Mo[Xi];if(!Xr)return 1;Ci.some(function(Co){return Wo(Co,Xi)>1})&&Ka.push(Xi)},ns=ko;ns<=ls;ns+=1)Ma(ns);var qa=Ka.map(function(ts){var Xi=Mo[ts],Xr=qi(Xi.record,ts),Co=function(ba){var Kr=ts+ba-1,Rs=qi(Mo[Kr].record,Kr),Za=Jo(Xr,Rs);return Za.bottom-Za.top},Zo=Jo(Xr);return Oe.createElement(Bn,{key:ts,data:Xi,rowKey:Xr,index:ts,style:{top:-va+Zo.top},extra:!0,getHeight:Co})});return qa},Xo=Oe.useMemo(function(){return{columnsOffset:Vo}},[Vo]),aa="".concat(Nn,"-tbody"),Pa=Pn(["body","wrapper"]),Gt={};return hi&&(Gt.position="sticky",Gt.bottom=0,(0,Qe.Z)(hi)==="object"&&hi.offsetScroll&&(Gt.bottom=hi.offsetScroll)),Oe.createElement(Ri.Provider,{value:Xo},Oe.createElement(Li.Z,{fullHeight:!1,ref:cr,prefixCls:"".concat(aa,"-virtual"),styles:{horizontalScrollBar:Gt},className:aa,height:Ti,itemHeight:Yi||24,data:Mo,itemKey:function(fr){return qi(fr.record)},component:Pa,scrollWidth:vi,direction:ti,onVirtualScroll:function(fr){var ao,zr=fr.x;Ie({currentTarget:(ao=cr.current)===null||ao===void 0?void 0:ao.nativeElement,scrollLeft:zr})},onScroll:Rr,extraRender:ua},function(qo,fr,ao){var zr=qi(qo.record,fr);return Oe.createElement(Bn,{data:qo,rowKey:zr,index:fr,style:ao.style})}))}),In=ge(ca),Er=In,Do=function(Rn,Rt){var Ie=Rt.ref,qn=Rt.onScroll;return Oe.createElement(Er,{ref:Ie,data:Rn,onScroll:qn})};function wr(Yt,Rn){var Rt=Yt.data,Ie=Yt.columns,qn=Yt.scroll,Ci=Yt.sticky,Oi=Yt.prefixCls,qi=Oi===void 0?Ii:Oi,zi=Yt.className,Nn=Yt.listItemHeight,pi=Yt.components,vi=Yt.onScroll,ti=qn||{},ui=ti.x,hi=ti.y;typeof ui!="number"&&(ui=1),typeof hi!="number"&&(hi=500);var Ti=(0,ci.zX)(function(Rr,cr){return(0,Lt.Z)(pi,Rr)||cr}),Yi=(0,ci.zX)(vi),Pn=Oe.useMemo(function(){return{sticky:Ci,scrollY:hi,listItemHeight:Nn,getComponent:Ti,onScroll:Yi}},[Ci,hi,Nn,Ti,Yi]);return Oe.createElement(Sr.Provider,{value:Pn},Oe.createElement(Ot,(0,We.Z)({},Yt,{className:wt()(zi,"".concat(qi,"-virtual")),scroll:(0,Ue.Z)((0,Ue.Z)({},qn),{},{x:ui}),components:(0,Ue.Z)((0,Ue.Z)({},pi),{},{body:Rt!=null&&Rt.length?Do:void 0}),columns:Ie,internalHooks:le.R,tailor:!0,ref:Rn})))}var Qo=Oe.forwardRef(wr);function To(Yt){return se(Qo,Yt)}var ro=To(),fa=null},54451:function(Zn,ei,Le){"use strict";Le.d(ei,{g:function(){return Oe},v:function(){return vt}});var le=Le(20439),Ke=Le(62646),it=Le(48736),bt=["expandable"],vt="RC_TABLE_INTERNAL_COL_DEFINE";function Oe(st){var Et=st.expandable,ot=(0,Ke.Z)(st,bt),We;return"expandable"in st?We=(0,le.Z)((0,le.Z)({},ot),Et):We=ot,We.showExpandColumn===!1&&(We.expandIconColumnIndex=-1),We}},22711:function(Zn,ei,Le){"use strict";Le.r(ei),Le.d(ei,{ResizableTextArea:function(){return $e},default:function(){return pn}});var le=Le(14809),Ke=Le(4635),it=Le(20439),bt=Le(95190),vt=Le(50298),Oe=Le(62646),st=Le(92310),Et=Le.n(st),ot=Le(36901),We=Le(66003),Tt=Le(30292),ct=Le(18929),At=Le(59301),De=Le(93664),ne=Le(29301),te=Le(34280),de=Le(16089),se=`
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;
`,ge=["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"],ye={},we;function Ce(en){var vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,rn=en.getAttribute("id")||en.getAttribute("data-reactid")||en.getAttribute("name");if(vn&&ye[rn])return ye[rn];var nt=window.getComputedStyle(en),rt=nt.getPropertyValue("box-sizing")||nt.getPropertyValue("-moz-box-sizing")||nt.getPropertyValue("-webkit-box-sizing"),dn=parseFloat(nt.getPropertyValue("padding-bottom"))+parseFloat(nt.getPropertyValue("padding-top")),ri=parseFloat(nt.getPropertyValue("border-bottom-width"))+parseFloat(nt.getPropertyValue("border-top-width")),Hn=ge.map(function(En){return"".concat(En,":").concat(nt.getPropertyValue(En))}).join(";"),Wt={sizingStyle:Hn,paddingSize:dn,borderSize:ri,boxSizing:rt};return vn&&rn&&(ye[rn]=Wt),Wt}function _e(en){var vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,rn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,nt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;we||(we=document.createElement("textarea"),we.setAttribute("tab-index","-1"),we.setAttribute("aria-hidden","true"),we.setAttribute("name","hiddenTextarea"),document.body.appendChild(we)),en.getAttribute("wrap")?we.setAttribute("wrap",en.getAttribute("wrap")):we.removeAttribute("wrap");var rt=Ce(en,vn),dn=rt.paddingSize,ri=rt.borderSize,Hn=rt.boxSizing,Wt=rt.sizingStyle;we.setAttribute("style","".concat(Wt,";").concat(se)),we.value=en.value||en.placeholder||"";var En=void 0,An=void 0,ci,It=we.scrollHeight;if(Hn==="border-box"?It+=ri:Hn==="content-box"&&(It-=dn),rn!==null||nt!==null){we.value=" ";var Pt=we.scrollHeight-dn;rn!==null&&(En=Pt*rn,Hn==="border-box"&&(En=En+dn+ri),It=Math.max(En,It)),nt!==null&&(An=Pt*nt,Hn==="border-box"&&(An=An+dn+ri),ci=It>An?"":"hidden",It=Math.min(An,It))}var Nt={height:It,overflowY:ci,resize:"none"};return En&&(Nt.minHeight=En),An&&(Nt.maxHeight=An),Nt}var Ze=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],lt=0,Qe=1,Ue=2,dt=At.forwardRef(function(en,vn){var rn=en,nt=rn.prefixCls,rt=rn.defaultValue,dn=rn.value,ri=rn.autoSize,Hn=rn.onResize,Wt=rn.className,En=rn.style,An=rn.disabled,ci=rn.onChange,It=rn.onInternalAutoSize,Pt=(0,Oe.Z)(rn,Ze),Nt=(0,ct.Z)(rt,{value:dn,postState:function(di){return di!=null?di:""}}),ii=(0,vt.Z)(Nt,2),Gi=ii[0],ze=ii[1],Me=function(di){ze(di.target.value),ci==null||ci(di)},Ee=At.useRef();At.useImperativeHandle(vn,function(){return{textArea:Ee.current}});var Te=At.useMemo(function(){return ri&&(0,De.Z)(ri)==="object"?[ri.minRows,ri.maxRows]:[]},[ri]),He=(0,vt.Z)(Te,2),Ae=He[0],qe=He[1],an=!!ri,Xt=function(){try{if(document.activeElement===Ee.current){var di=Ee.current,Ui=di.selectionStart,gi=di.selectionEnd,Hi=di.scrollTop;Ee.current.setSelectionRange(Ui,gi),Ee.current.scrollTop=Hi}}catch(kr){}},yn=At.useState(Ue),kt=(0,vt.Z)(yn,2),Dt=kt[0],Zt=kt[1],hn=At.useState(),wn=(0,vt.Z)(hn,2),Dn=wn[0],Tn=wn[1],Mi=function(){Zt(lt)};(0,te.Z)(function(){an&&Mi()},[dn,Ae,qe,an]),(0,te.Z)(function(){if(Dt===lt)Zt(Qe);else if(Dt===Qe){var Sn=_e(Ee.current,!1,Ae,qe);Zt(Ue),Tn(Sn)}else Xt()},[Dt]);var tn=At.useRef(),qt=function(){de.Z.cancel(tn.current)},un=function(di){Dt===Ue&&(Hn==null||Hn(di),ri&&(qt(),tn.current=(0,de.Z)(function(){Mi()})))};At.useEffect(function(){return qt},[]);var zn=an?Dn:null,on=(0,it.Z)((0,it.Z)({},En),zn);return(Dt===lt||Dt===Qe)&&(on.overflowY="hidden",on.overflowX="hidden"),At.createElement(ne.Z,{onResize:un,disabled:!(ri||Hn)},At.createElement("textarea",(0,le.Z)({},Pt,{ref:Ee,style:on,className:Et()(nt,Wt,(0,Ke.Z)({},"".concat(nt,"-disabled"),An)),disabled:An,value:Gi,onChange:Me})))}),$e=dt,wt=["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"],St=At.forwardRef(function(en,vn){var rn,nt=en.defaultValue,rt=en.value,dn=en.onFocus,ri=en.onBlur,Hn=en.onChange,Wt=en.allowClear,En=en.maxLength,An=en.onCompositionStart,ci=en.onCompositionEnd,It=en.suffix,Pt=en.prefixCls,Nt=Pt===void 0?"rc-textarea":Pt,ii=en.showCount,Gi=en.count,ze=en.className,Me=en.style,Ee=en.disabled,Te=en.hidden,He=en.classNames,Ae=en.styles,qe=en.onResize,an=en.onClear,Xt=en.onPressEnter,yn=en.readOnly,kt=en.autoSize,Dt=en.onKeyDown,Zt=(0,Oe.Z)(en,wt),hn=(0,ct.Z)(nt,{value:rt,defaultValue:nt}),wn=(0,vt.Z)(hn,2),Dn=wn[0],Tn=wn[1],Mi=Dn==null?"":String(Dn),tn=At.useState(!1),qt=(0,vt.Z)(tn,2),un=qt[0],zn=qt[1],on=At.useRef(!1),Sn=At.useState(null),di=(0,vt.Z)(Sn,2),Ui=di[0],gi=di[1],Hi=(0,At.useRef)(null),kr=(0,At.useRef)(null),Gn=function(){var sr;return(sr=kr.current)===null||sr===void 0?void 0:sr.textArea},On=function(){Gn().focus()};(0,At.useImperativeHandle)(vn,function(){var ni;return{resizableTextArea:kr.current,focus:On,blur:function(){Gn().blur()},nativeElement:((ni=Hi.current)===null||ni===void 0?void 0:ni.nativeElement)||Gn()}}),(0,At.useEffect)(function(){zn(function(ni){return!Ee&&ni})},[Ee]);var Xn=At.useState(null),wi=(0,vt.Z)(Xn,2),nr=wi[0],ji=wi[1];At.useEffect(function(){if(nr){var ni;(ni=Gn()).setSelectionRange.apply(ni,(0,bt.Z)(nr))}},[nr]);var Cr=(0,We.Z)(Gi,ii),be=(rn=Cr.max)!==null&&rn!==void 0?rn:En,mn=Number(be)>0,fi=Cr.strategy(Mi),Vn=!!be&&fi>be,si=function(sr,br){var Yn=br;!on.current&&Cr.exceedFormatter&&Cr.max&&Cr.strategy(br)>Cr.max&&(Yn=Cr.exceedFormatter(br,{max:Cr.max}),br!==Yn&&ji([Gn().selectionStart||0,Gn().selectionEnd||0])),Tn(Yn),(0,Tt.rJ)(sr.currentTarget,sr,Hn,Yn)},Di=function(sr){on.current=!0,An==null||An(sr)},Ni=function(sr){on.current=!1,si(sr,sr.currentTarget.value),ci==null||ci(sr)},yr=function(sr){si(sr,sr.target.value)},zt=function(sr){sr.key==="Enter"&&Xt&&Xt(sr),Dt==null||Dt(sr)},Mt=function(sr){zn(!0),dn==null||dn(sr)},_t=function(sr){zn(!1),ri==null||ri(sr)},fn=function(sr){Tn(""),On(),(0,Tt.rJ)(Gn(),sr,Hn)},Ji=It,mi;Cr.show&&(Cr.showFormatter?mi=Cr.showFormatter({value:Mi,count:fi,maxLength:be}):mi="".concat(fi).concat(mn?" / ".concat(be):""),Ji=At.createElement(At.Fragment,null,Ji,At.createElement("span",{className:Et()("".concat(Nt,"-data-count"),He==null?void 0:He.count),style:Ae==null?void 0:Ae.count},mi)));var $i=function(sr){var br;qe==null||qe(sr),(br=Gn())!==null&&br!==void 0&&br.style.height&&gi(!0)},xn=!kt&&!ii&&!Wt;return At.createElement(ot.BaseInput,{ref:Hi,value:Mi,allowClear:Wt,handleReset:fn,suffix:Ji,prefixCls:Nt,classNames:(0,it.Z)((0,it.Z)({},He),{},{affixWrapper:Et()(He==null?void 0:He.affixWrapper,(0,Ke.Z)((0,Ke.Z)({},"".concat(Nt,"-show-count"),ii),"".concat(Nt,"-textarea-allow-clear"),Wt))}),disabled:Ee,focused:un,className:Et()(ze,Vn&&"".concat(Nt,"-out-of-range")),style:(0,it.Z)((0,it.Z)({},Me),Ui&&!xn?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof mi=="string"?mi:void 0}},hidden:Te,readOnly:yn,onClear:an},At.createElement($e,(0,le.Z)({},Zt,{autoSize:kt,maxLength:En,onKeyDown:zt,onChange:yr,onFocus:Mt,onBlur:_t,onCompositionStart:Di,onCompositionEnd:Ni,className:Et()(He==null?void 0:He.textarea),style:(0,it.Z)((0,it.Z)({},Ae==null?void 0:Ae.textarea),{},{resize:Me==null?void 0:Me.resize}),disabled:Ee,prefixCls:Nt,onResize:$i,ref:kr,readOnly:yn})))}),Lt=St,pn=Lt},639:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return ye}});var le=Le(14809),Ke=Le(4635),it=Le(20439),bt=Le(50298),vt=Le(62646),Oe=Le(59301),st=Le(92310),Et=Le.n(st),ot=Le(26112),We=Le(30699),Tt=function(Ce){for(var _e=Ce.prefixCls,Ze=Ce.level,lt=Ce.isStart,Qe=Ce.isEnd,Ue="".concat(_e,"-indent-unit"),dt=[],$e=0;$e<Ze;$e+=1)dt.push(Oe.createElement("span",{key:$e,className:Et()(Ue,(0,Ke.Z)((0,Ke.Z)({},"".concat(Ue,"-start"),lt[$e]),"".concat(Ue,"-end"),Qe[$e]))}));return Oe.createElement("span",{"aria-hidden":"true",className:"".concat(_e,"-indent")},dt)},ct=Oe.memo(Tt),At=Le(65065),De=Le(34061),ne=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],te="open",de="close",se="---",ge=function(Ce){var _e,Ze,lt,Qe=Ce.eventKey,Ue=Ce.className,dt=Ce.style,$e=Ce.dragOver,wt=Ce.dragOverGapTop,St=Ce.dragOverGapBottom,Lt=Ce.isLeaf,pn=Ce.isStart,en=Ce.isEnd,vn=Ce.expanded,rn=Ce.selected,nt=Ce.checked,rt=Ce.halfChecked,dn=Ce.loading,ri=Ce.domRef,Hn=Ce.active,Wt=Ce.data,En=Ce.onMouseMove,An=Ce.selectable,ci=(0,vt.Z)(Ce,ne),It=Oe.useContext(We.k),Pt=Oe.useContext(We.y),Nt=Oe.useRef(null),ii=Oe.useState(!1),Gi=(0,bt.Z)(ii,2),ze=Gi[0],Me=Gi[1],Ee=!!(It.disabled||Ce.disabled||(_e=Pt.nodeDisabled)!==null&&_e!==void 0&&_e.call(Pt,Wt)),Te=Oe.useMemo(function(){return!It.checkable||Ce.checkable===!1?!1:It.checkable},[It.checkable,Ce.checkable]),He=function(fi){Ee||It.onNodeSelect(fi,(0,De.F)(Ce))},Ae=function(fi){Ee||!Te||Ce.disableCheckbox||It.onNodeCheck(fi,(0,De.F)(Ce),!nt)},qe=Oe.useMemo(function(){return typeof An=="boolean"?An:It.selectable},[An,It.selectable]),an=function(fi){It.onNodeClick(fi,(0,De.F)(Ce)),qe?He(fi):Ae(fi)},Xt=function(fi){It.onNodeDoubleClick(fi,(0,De.F)(Ce))},yn=function(fi){It.onNodeMouseEnter(fi,(0,De.F)(Ce))},kt=function(fi){It.onNodeMouseLeave(fi,(0,De.F)(Ce))},Dt=function(fi){It.onNodeContextMenu(fi,(0,De.F)(Ce))},Zt=Oe.useMemo(function(){return!!(It.draggable&&(!It.draggable.nodeDraggable||It.draggable.nodeDraggable(Wt)))},[It.draggable,Wt]),hn=function(fi){fi.stopPropagation(),Me(!0),It.onNodeDragStart(fi,Ce);try{fi.dataTransfer.setData("text/plain","")}catch(Vn){}},wn=function(fi){fi.preventDefault(),fi.stopPropagation(),It.onNodeDragEnter(fi,Ce)},Dn=function(fi){fi.preventDefault(),fi.stopPropagation(),It.onNodeDragOver(fi,Ce)},Tn=function(fi){fi.stopPropagation(),It.onNodeDragLeave(fi,Ce)},Mi=function(fi){fi.stopPropagation(),Me(!1),It.onNodeDragEnd(fi,Ce)},tn=function(fi){fi.preventDefault(),fi.stopPropagation(),Me(!1),It.onNodeDrop(fi,Ce)},qt=function(fi){dn||It.onNodeExpand(fi,(0,De.F)(Ce))},un=Oe.useMemo(function(){var mn=(0,At.Z)(It.keyEntities,Qe)||{},fi=mn.children;return!!(fi||[]).length},[It.keyEntities,Qe]),zn=Oe.useMemo(function(){return Lt===!1?!1:Lt||!It.loadData&&!un||It.loadData&&Ce.loaded&&!un},[Lt,It.loadData,un,Ce.loaded]);Oe.useEffect(function(){dn||typeof It.loadData=="function"&&vn&&!zn&&!Ce.loaded&&It.onNodeLoad((0,De.F)(Ce))},[dn,It.loadData,It.onNodeLoad,vn,zn,Ce]);var on=Oe.useMemo(function(){var mn;return(mn=It.draggable)!==null&&mn!==void 0&&mn.icon?Oe.createElement("span",{className:"".concat(It.prefixCls,"-draggable-icon")},It.draggable.icon):null},[It.draggable]),Sn=function(fi){var Vn=Ce.switcherIcon||It.switcherIcon;return typeof Vn=="function"?Vn((0,it.Z)((0,it.Z)({},Ce),{},{isLeaf:fi})):Vn},di=function(){if(zn){var fi=Sn(!0);return fi!==!1?Oe.createElement("span",{className:Et()("".concat(It.prefixCls,"-switcher"),"".concat(It.prefixCls,"-switcher-noop"))},fi):null}var Vn=Sn(!1);return Vn!==!1?Oe.createElement("span",{onClick:qt,className:Et()("".concat(It.prefixCls,"-switcher"),"".concat(It.prefixCls,"-switcher_").concat(vn?te:de))},Vn):null},Ui=Oe.useMemo(function(){if(!Te)return null;var mn=typeof Te!="boolean"?Te:null;return Oe.createElement("span",{className:Et()("".concat(It.prefixCls,"-checkbox"),(0,Ke.Z)((0,Ke.Z)((0,Ke.Z)({},"".concat(It.prefixCls,"-checkbox-checked"),nt),"".concat(It.prefixCls,"-checkbox-indeterminate"),!nt&&rt),"".concat(It.prefixCls,"-checkbox-disabled"),Ee||Ce.disableCheckbox)),onClick:Ae,role:"checkbox","aria-checked":rt?"mixed":nt,"aria-disabled":Ee||Ce.disableCheckbox,"aria-label":"Select ".concat(typeof Ce.title=="string"?Ce.title:"tree node")},mn)},[Te,nt,rt,Ee,Ce.disableCheckbox,Ce.title]),gi=Oe.useMemo(function(){return zn?null:vn?te:de},[zn,vn]),Hi=Oe.useMemo(function(){return Oe.createElement("span",{className:Et()("".concat(It.prefixCls,"-iconEle"),"".concat(It.prefixCls,"-icon__").concat(gi||"docu"),(0,Ke.Z)({},"".concat(It.prefixCls,"-icon_loading"),dn))})},[It.prefixCls,gi,dn]),kr=Oe.useMemo(function(){var mn=!!It.draggable,fi=!Ce.disabled&&mn&&It.dragOverNodeKey===Qe;return fi?It.dropIndicatorRender({dropPosition:It.dropPosition,dropLevelOffset:It.dropLevelOffset,indent:It.indent,prefixCls:It.prefixCls,direction:It.direction}):null},[It.dropPosition,It.dropLevelOffset,It.indent,It.prefixCls,It.direction,It.draggable,It.dragOverNodeKey,It.dropIndicatorRender]),Gn=Oe.useMemo(function(){var mn=Ce.title,fi=mn===void 0?se:mn,Vn="".concat(It.prefixCls,"-node-content-wrapper"),si;if(It.showIcon){var Di=Ce.icon||It.icon;si=Di?Oe.createElement("span",{className:Et()("".concat(It.prefixCls,"-iconEle"),"".concat(It.prefixCls,"-icon__customize"))},typeof Di=="function"?Di(Ce):Di):Hi}else It.loadData&&dn&&(si=Hi);var Ni;return typeof fi=="function"?Ni=fi(Wt):It.titleRender?Ni=It.titleRender(Wt):Ni=fi,Oe.createElement("span",{ref:Nt,title:typeof fi=="string"?fi:"",className:Et()(Vn,"".concat(Vn,"-").concat(gi||"normal"),(0,Ke.Z)({},"".concat(It.prefixCls,"-node-selected"),!Ee&&(rn||ze))),onMouseEnter:yn,onMouseLeave:kt,onContextMenu:Dt,onClick:an,onDoubleClick:Xt},si,Oe.createElement("span",{className:"".concat(It.prefixCls,"-title")},Ni),kr)},[It.prefixCls,It.showIcon,Ce,It.icon,Hi,It.titleRender,Wt,gi,yn,kt,Dt,an,Xt]),On=(0,ot.Z)(ci,{aria:!0,data:!0}),Xn=(0,At.Z)(It.keyEntities,Qe)||{},wi=Xn.level,nr=en[en.length-1],ji=!Ee&&Zt,Cr=It.draggingNodeKey===Qe,be=An!==void 0?{"aria-selected":!!An}:void 0;return Oe.createElement("div",(0,le.Z)({ref:ri,role:"treeitem","aria-expanded":Lt?void 0:vn,className:Et()(Ue,"".concat(It.prefixCls,"-treenode"),(lt={},(0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)(lt,"".concat(It.prefixCls,"-treenode-disabled"),Ee),"".concat(It.prefixCls,"-treenode-switcher-").concat(vn?"open":"close"),!Lt),"".concat(It.prefixCls,"-treenode-checkbox-checked"),nt),"".concat(It.prefixCls,"-treenode-checkbox-indeterminate"),rt),"".concat(It.prefixCls,"-treenode-selected"),rn),"".concat(It.prefixCls,"-treenode-loading"),dn),"".concat(It.prefixCls,"-treenode-active"),Hn),"".concat(It.prefixCls,"-treenode-leaf-last"),nr),"".concat(It.prefixCls,"-treenode-draggable"),Zt),"dragging",Cr),(0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)(lt,"drop-target",It.dropTargetKey===Qe),"drop-container",It.dropContainerKey===Qe),"drag-over",!Ee&&$e),"drag-over-gap-top",!Ee&&wt),"drag-over-gap-bottom",!Ee&&St),"filter-node",(Ze=It.filterTreeNode)===null||Ze===void 0?void 0:Ze.call(It,(0,De.F)(Ce))),"".concat(It.prefixCls,"-treenode-leaf"),zn))),style:dt,draggable:ji,onDragStart:ji?hn:void 0,onDragEnter:Zt?wn:void 0,onDragOver:Zt?Dn:void 0,onDragLeave:Zt?Tn:void 0,onDrop:Zt?tn:void 0,onDragEnd:Zt?Mi:void 0,onMouseMove:En},be,On),Oe.createElement(ct,{prefixCls:It.prefixCls,level:wi,isStart:pn,isEnd:en}),on,di(),Ui,Gn)};ge.isTreeNode=1;var ye=ge},30699:function(Zn,ei,Le){"use strict";Le.d(ei,{k:function(){return Ke},y:function(){return it}});var le=Le(59301),Ke=le.createContext(null),it=le.createContext({})},29530:function(Zn,ei,Le){"use strict";Le.d(ei,{OF:function(){return Qe.Z},y6:function(){return de.y},ZP:function(){return Ee}});var le=Le(14809),Ke=Le(93664),it=Le(20439),bt=Le(95190),vt=Le(99153),Oe=Le(84851),st=Le(13028),Et=Le(19257),ot=Le(93046),We=Le(4635),Tt=Le(92310),ct=Le.n(Tt),At=Le(10228),De=Le(26112),ne=Le(48736),te=Le(59301),de=Le(30699),se=function(He){var Ae=He.dropPosition,qe=He.dropLevelOffset,an=He.indent,Xt={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(Ae){case-1:Xt.top=0,Xt.left=-qe*an;break;case 1:Xt.bottom=0,Xt.left=-qe*an;break;case 0:Xt.bottom=0,Xt.left=an;break}return te.createElement("div",{style:Xt})},ge=se;function ye(Te){if(Te==null)throw new TypeError("Cannot destructure "+Te)}var we=Le(50298),Ce=Le(62646),_e=Le(34280),Ze=Le(6790),lt=Le(77900),Qe=Le(639);function Ue(Te,He){var Ae=te.useState(!1),qe=(0,we.Z)(Ae,2),an=qe[0],Xt=qe[1];(0,_e.Z)(function(){if(an)return Te(),function(){He()}},[an]),(0,_e.Z)(function(){return Xt(!0),function(){Xt(!1)}},[])}var dt=Ue,$e=Le(34061),wt=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],St=te.forwardRef(function(Te,He){var Ae=Te.className,qe=Te.style,an=Te.motion,Xt=Te.motionNodes,yn=Te.motionType,kt=Te.onMotionStart,Dt=Te.onMotionEnd,Zt=Te.active,hn=Te.treeNodeRequiredProps,wn=(0,Ce.Z)(Te,wt),Dn=te.useState(!0),Tn=(0,we.Z)(Dn,2),Mi=Tn[0],tn=Tn[1],qt=te.useContext(de.k),un=qt.prefixCls,zn=Xt&&yn!=="hide";(0,_e.Z)(function(){Xt&&zn!==Mi&&tn(zn)},[Xt]);var on=function(){Xt&&kt()},Sn=te.useRef(!1),di=function(){Xt&&!Sn.current&&(Sn.current=!0,Dt())};dt(on,di);var Ui=function(Hi){zn===Hi&&di()};return Xt?te.createElement(lt.default,(0,le.Z)({ref:He,visible:Mi},an,{motionAppear:yn==="show",onVisibleChanged:Ui}),function(gi,Hi){var kr=gi.className,Gn=gi.style;return te.createElement("div",{ref:Hi,className:ct()("".concat(un,"-treenode-motion"),kr),style:Gn},Xt.map(function(On){var Xn=Object.assign({},(ye(On.data),On.data)),wi=On.title,nr=On.key,ji=On.isStart,Cr=On.isEnd;delete Xn.children;var be=(0,$e.H8)(nr,hn);return te.createElement(Qe.Z,(0,le.Z)({},Xn,be,{title:wi,active:Zt,data:On.data,key:nr,isStart:ji,isEnd:Cr}))}))}):te.createElement(Qe.Z,(0,le.Z)({domRef:He,className:Ae,style:qe},wn,{active:Zt}))}),Lt=St;function pn(){var Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ae=Te.length,qe=He.length;if(Math.abs(Ae-qe)!==1)return{add:!1,key:null};function an(Xt,yn){var kt=new Map;Xt.forEach(function(Zt){kt.set(Zt,!0)});var Dt=yn.filter(function(Zt){return!kt.has(Zt)});return Dt.length===1?Dt[0]:null}return Ae<qe?{add:!0,key:an(Te,He)}:{add:!1,key:an(He,Te)}}function en(Te,He,Ae){var qe=Te.findIndex(function(kt){return kt.key===Ae}),an=Te[qe+1],Xt=He.findIndex(function(kt){return kt.key===Ae});if(an){var yn=He.findIndex(function(kt){return kt.key===an.key});return He.slice(Xt+1,yn)}return He.slice(Xt+1)}var vn=["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"],rn={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},nt=function(){},rt="RC_TREE_MOTION_".concat(Math.random()),dn={key:rt},ri={key:rt,level:0,index:0,pos:"0",node:dn,nodes:[dn]},Hn={parent:null,children:[],pos:ri.pos,data:dn,title:null,key:rt,isStart:[],isEnd:[]};function Wt(Te,He,Ae,qe){return He===!1||!Ae?Te:Te.slice(0,Math.ceil(Ae/qe)+1)}function En(Te){var He=Te.key,Ae=Te.pos;return(0,$e.km)(He,Ae)}function An(Te){for(var He=String(Te.data.key),Ae=Te;Ae.parent;)Ae=Ae.parent,He="".concat(Ae.data.key," > ").concat(He);return He}var ci=te.forwardRef(function(Te,He){var Ae=Te.prefixCls,qe=Te.data,an=Te.selectable,Xt=Te.checkable,yn=Te.expandedKeys,kt=Te.selectedKeys,Dt=Te.checkedKeys,Zt=Te.loadedKeys,hn=Te.loadingKeys,wn=Te.halfCheckedKeys,Dn=Te.keyEntities,Tn=Te.disabled,Mi=Te.dragging,tn=Te.dragOverNodeKey,qt=Te.dropPosition,un=Te.motion,zn=Te.height,on=Te.itemHeight,Sn=Te.virtual,di=Te.scrollWidth,Ui=Te.focusable,gi=Te.activeItem,Hi=Te.focused,kr=Te.tabIndex,Gn=Te.onKeyDown,On=Te.onFocus,Xn=Te.onBlur,wi=Te.onActiveChange,nr=Te.onListChangeStart,ji=Te.onListChangeEnd,Cr=(0,Ce.Z)(Te,vn),be=te.useRef(null),mn=te.useRef(null);te.useImperativeHandle(He,function(){return{scrollTo:function(ai){be.current.scrollTo(ai)},getIndentWidth:function(){return mn.current.offsetWidth}}});var fi=te.useState(yn),Vn=(0,we.Z)(fi,2),si=Vn[0],Di=Vn[1],Ni=te.useState(qe),yr=(0,we.Z)(Ni,2),zt=yr[0],Mt=yr[1],_t=te.useState(qe),fn=(0,we.Z)(_t,2),Ji=fn[0],mi=fn[1],$i=te.useState([]),xn=(0,we.Z)($i,2),ni=xn[0],sr=xn[1],br=te.useState(null),Yn=(0,we.Z)(br,2),at=Yn[0],Bt=Yn[1],Kn=te.useRef(qe);Kn.current=qe;function li(){var Un=Kn.current;Mt(Un),mi(Un),sr([]),Bt(null),ji()}(0,_e.Z)(function(){Di(yn);var Un=pn(si,yn);if(Un.key!==null)if(Un.add){var ai=zt.findIndex(function(xr){var _n=xr.key;return _n===Un.key}),Vi=Wt(en(zt,qe,Un.key),Sn,zn,on),xi=zt.slice();xi.splice(ai+1,0,Hn),mi(xi),sr(Vi),Bt("show")}else{var Bi=qe.findIndex(function(xr){var _n=xr.key;return _n===Un.key}),Ii=Wt(en(qe,zt,Un.key),Sn,zn,on),Pr=qe.slice();Pr.splice(Bi+1,0,Hn),mi(Pr),sr(Ii),Bt("hide")}else zt!==qe&&(Mt(qe),mi(qe))},[yn,qe]),te.useEffect(function(){Mi||li()},[Mi]);var Qt=un?Ji:qe,jt={expandedKeys:yn,selectedKeys:kt,loadedKeys:Zt,loadingKeys:hn,checkedKeys:Dt,halfCheckedKeys:wn,dragOverNodeKey:tn,dropPosition:qt,keyEntities:Dn};return te.createElement(te.Fragment,null,Hi&&gi&&te.createElement("span",{style:rn,"aria-live":"assertive"},An(gi)),te.createElement("div",null,te.createElement("input",{style:rn,disabled:Ui===!1||Tn,tabIndex:Ui!==!1?kr:null,onKeyDown:Gn,onFocus:On,onBlur:Xn,value:"",onChange:nt,"aria-label":"for screen reader"})),te.createElement("div",{className:"".concat(Ae,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},te.createElement("div",{className:"".concat(Ae,"-indent")},te.createElement("div",{ref:mn,className:"".concat(Ae,"-indent-unit")}))),te.createElement(Ze.Z,(0,le.Z)({},Cr,{data:Qt,itemKey:En,height:zn,fullHeight:!1,virtual:Sn,itemHeight:on,scrollWidth:di,prefixCls:"".concat(Ae,"-list"),ref:be,role:"tree",onVisibleChange:function(ai){ai.every(function(Vi){return En(Vi)!==rt})&&li()}}),function(Un){var ai=Un.pos,Vi=Object.assign({},(ye(Un.data),Un.data)),xi=Un.title,Bi=Un.key,Ii=Un.isStart,Pr=Un.isEnd,xr=(0,$e.km)(Bi,ai);delete Vi.key,delete Vi.children;var _n=(0,$e.H8)(xr,jt);return te.createElement(Lt,(0,le.Z)({},Vi,_n,{title:xi,active:!!gi&&Bi===gi.key,pos:ai,data:Un.data,isStart:Ii,isEnd:Pr,motion:un,motionNodes:Bi===rt?ni:null,motionType:at,onMotionStart:nr,onMotionEnd:li,treeNodeRequiredProps:jt,onMouseMove:function(){wi(null)}}))}))}),It=ci,Pt=Le(82661),Nt=Le(34643),ii=Le(65065),Gi=10,ze=function(Te){(0,Et.Z)(Ae,Te);var He=(0,ot.Z)(Ae);function Ae(){var qe;(0,vt.Z)(this,Ae);for(var an=arguments.length,Xt=new Array(an),yn=0;yn<an;yn++)Xt[yn]=arguments[yn];return qe=He.call.apply(He,[this].concat(Xt)),(0,We.Z)((0,st.Z)(qe),"destroyed",!1),(0,We.Z)((0,st.Z)(qe),"delayedDragEnterLogic",void 0),(0,We.Z)((0,st.Z)(qe),"loadingRetryTimes",{}),(0,We.Z)((0,st.Z)(qe),"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,$e.w$)()}),(0,We.Z)((0,st.Z)(qe),"dragStartMousePosition",null),(0,We.Z)((0,st.Z)(qe),"dragNodeProps",null),(0,We.Z)((0,st.Z)(qe),"currentMouseOverDroppableNodeKey",null),(0,We.Z)((0,st.Z)(qe),"listRef",te.createRef()),(0,We.Z)((0,st.Z)(qe),"onNodeDragStart",function(kt,Dt){var Zt=qe.state,hn=Zt.expandedKeys,wn=Zt.keyEntities,Dn=qe.props.onDragStart,Tn=Dt.eventKey;qe.dragNodeProps=Dt,qe.dragStartMousePosition={x:kt.clientX,y:kt.clientY};var Mi=(0,Pt._5)(hn,Tn);qe.setState({draggingNodeKey:Tn,dragChildrenKeys:(0,Pt.wA)(Tn,wn),indent:qe.listRef.current.getIndentWidth()}),qe.setExpandedKeys(Mi),window.addEventListener("dragend",qe.onWindowDragEnd),Dn==null||Dn({event:kt,node:(0,$e.F)(Dt)})}),(0,We.Z)((0,st.Z)(qe),"onNodeDragEnter",function(kt,Dt){var Zt=qe.state,hn=Zt.expandedKeys,wn=Zt.keyEntities,Dn=Zt.dragChildrenKeys,Tn=Zt.flattenNodes,Mi=Zt.indent,tn=qe.props,qt=tn.onDragEnter,un=tn.onExpand,zn=tn.allowDrop,on=tn.direction,Sn=Dt.pos,di=Dt.eventKey;if(qe.currentMouseOverDroppableNodeKey!==di&&(qe.currentMouseOverDroppableNodeKey=di),!qe.dragNodeProps){qe.resetDragState();return}var Ui=(0,Pt.OM)(kt,qe.dragNodeProps,Dt,Mi,qe.dragStartMousePosition,zn,Tn,wn,hn,on),gi=Ui.dropPosition,Hi=Ui.dropLevelOffset,kr=Ui.dropTargetKey,Gn=Ui.dropContainerKey,On=Ui.dropTargetPos,Xn=Ui.dropAllowed,wi=Ui.dragOverNodeKey;if(Dn.includes(kr)||!Xn){qe.resetDragState();return}if(qe.delayedDragEnterLogic||(qe.delayedDragEnterLogic={}),Object.keys(qe.delayedDragEnterLogic).forEach(function(nr){clearTimeout(qe.delayedDragEnterLogic[nr])}),qe.dragNodeProps.eventKey!==Dt.eventKey&&(kt.persist(),qe.delayedDragEnterLogic[Sn]=window.setTimeout(function(){if(qe.state.draggingNodeKey!==null){var nr=(0,bt.Z)(hn),ji=(0,ii.Z)(wn,Dt.eventKey);ji&&(ji.children||[]).length&&(nr=(0,Pt.L0)(hn,Dt.eventKey)),qe.props.hasOwnProperty("expandedKeys")||qe.setExpandedKeys(nr),un==null||un(nr,{node:(0,$e.F)(Dt),expanded:!0,nativeEvent:kt.nativeEvent})}},800)),qe.dragNodeProps.eventKey===kr&&Hi===0){qe.resetDragState();return}qe.setState({dragOverNodeKey:wi,dropPosition:gi,dropLevelOffset:Hi,dropTargetKey:kr,dropContainerKey:Gn,dropTargetPos:On,dropAllowed:Xn}),qt==null||qt({event:kt,node:(0,$e.F)(Dt),expandedKeys:hn})}),(0,We.Z)((0,st.Z)(qe),"onNodeDragOver",function(kt,Dt){var Zt=qe.state,hn=Zt.dragChildrenKeys,wn=Zt.flattenNodes,Dn=Zt.keyEntities,Tn=Zt.expandedKeys,Mi=Zt.indent,tn=qe.props,qt=tn.onDragOver,un=tn.allowDrop,zn=tn.direction;if(qe.dragNodeProps){var on=(0,Pt.OM)(kt,qe.dragNodeProps,Dt,Mi,qe.dragStartMousePosition,un,wn,Dn,Tn,zn),Sn=on.dropPosition,di=on.dropLevelOffset,Ui=on.dropTargetKey,gi=on.dropContainerKey,Hi=on.dropTargetPos,kr=on.dropAllowed,Gn=on.dragOverNodeKey;hn.includes(Ui)||!kr||(qe.dragNodeProps.eventKey===Ui&&di===0?qe.state.dropPosition===null&&qe.state.dropLevelOffset===null&&qe.state.dropTargetKey===null&&qe.state.dropContainerKey===null&&qe.state.dropTargetPos===null&&qe.state.dropAllowed===!1&&qe.state.dragOverNodeKey===null||qe.resetDragState():Sn===qe.state.dropPosition&&di===qe.state.dropLevelOffset&&Ui===qe.state.dropTargetKey&&gi===qe.state.dropContainerKey&&Hi===qe.state.dropTargetPos&&kr===qe.state.dropAllowed&&Gn===qe.state.dragOverNodeKey||qe.setState({dropPosition:Sn,dropLevelOffset:di,dropTargetKey:Ui,dropContainerKey:gi,dropTargetPos:Hi,dropAllowed:kr,dragOverNodeKey:Gn}),qt==null||qt({event:kt,node:(0,$e.F)(Dt)}))}}),(0,We.Z)((0,st.Z)(qe),"onNodeDragLeave",function(kt,Dt){qe.currentMouseOverDroppableNodeKey===Dt.eventKey&&!kt.currentTarget.contains(kt.relatedTarget)&&(qe.resetDragState(),qe.currentMouseOverDroppableNodeKey=null);var Zt=qe.props.onDragLeave;Zt==null||Zt({event:kt,node:(0,$e.F)(Dt)})}),(0,We.Z)((0,st.Z)(qe),"onWindowDragEnd",function(kt){qe.onNodeDragEnd(kt,null,!0),window.removeEventListener("dragend",qe.onWindowDragEnd)}),(0,We.Z)((0,st.Z)(qe),"onNodeDragEnd",function(kt,Dt){var Zt=qe.props.onDragEnd;qe.setState({dragOverNodeKey:null}),qe.cleanDragState(),Zt==null||Zt({event:kt,node:(0,$e.F)(Dt)}),qe.dragNodeProps=null,window.removeEventListener("dragend",qe.onWindowDragEnd)}),(0,We.Z)((0,st.Z)(qe),"onNodeDrop",function(kt,Dt){var Zt,hn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,wn=qe.state,Dn=wn.dragChildrenKeys,Tn=wn.dropPosition,Mi=wn.dropTargetKey,tn=wn.dropTargetPos,qt=wn.dropAllowed;if(qt){var un=qe.props.onDrop;if(qe.setState({dragOverNodeKey:null}),qe.cleanDragState(),Mi!==null){var zn=(0,it.Z)((0,it.Z)({},(0,$e.H8)(Mi,qe.getTreeNodeRequiredProps())),{},{active:((Zt=qe.getActiveItem())===null||Zt===void 0?void 0:Zt.key)===Mi,data:(0,ii.Z)(qe.state.keyEntities,Mi).node}),on=Dn.includes(Mi);(0,ne.ZP)(!on,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var Sn=(0,Pt.yx)(tn),di={event:kt,node:(0,$e.F)(zn),dragNode:qe.dragNodeProps?(0,$e.F)(qe.dragNodeProps):null,dragNodesKeys:[qe.dragNodeProps.eventKey].concat(Dn),dropToGap:Tn!==0,dropPosition:Tn+Number(Sn[Sn.length-1])};hn||un==null||un(di),qe.dragNodeProps=null}}}),(0,We.Z)((0,st.Z)(qe),"cleanDragState",function(){var kt=qe.state.draggingNodeKey;kt!==null&&qe.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),qe.dragStartMousePosition=null,qe.currentMouseOverDroppableNodeKey=null}),(0,We.Z)((0,st.Z)(qe),"triggerExpandActionExpand",function(kt,Dt){var Zt=qe.state,hn=Zt.expandedKeys,wn=Zt.flattenNodes,Dn=Dt.expanded,Tn=Dt.key,Mi=Dt.isLeaf;if(!(Mi||kt.shiftKey||kt.metaKey||kt.ctrlKey)){var tn=wn.filter(function(un){return un.key===Tn})[0],qt=(0,$e.F)((0,it.Z)((0,it.Z)({},(0,$e.H8)(Tn,qe.getTreeNodeRequiredProps())),{},{data:tn.data}));qe.setExpandedKeys(Dn?(0,Pt._5)(hn,Tn):(0,Pt.L0)(hn,Tn)),qe.onNodeExpand(kt,qt)}}),(0,We.Z)((0,st.Z)(qe),"onNodeClick",function(kt,Dt){var Zt=qe.props,hn=Zt.onClick,wn=Zt.expandAction;wn==="click"&&qe.triggerExpandActionExpand(kt,Dt),hn==null||hn(kt,Dt)}),(0,We.Z)((0,st.Z)(qe),"onNodeDoubleClick",function(kt,Dt){var Zt=qe.props,hn=Zt.onDoubleClick,wn=Zt.expandAction;wn==="doubleClick"&&qe.triggerExpandActionExpand(kt,Dt),hn==null||hn(kt,Dt)}),(0,We.Z)((0,st.Z)(qe),"onNodeSelect",function(kt,Dt){var Zt=qe.state.selectedKeys,hn=qe.state,wn=hn.keyEntities,Dn=hn.fieldNames,Tn=qe.props,Mi=Tn.onSelect,tn=Tn.multiple,qt=Dt.selected,un=Dt[Dn.key],zn=!qt;zn?tn?Zt=(0,Pt.L0)(Zt,un):Zt=[un]:Zt=(0,Pt._5)(Zt,un);var on=Zt.map(function(Sn){var di=(0,ii.Z)(wn,Sn);return di?di.node:null}).filter(Boolean);qe.setUncontrolledState({selectedKeys:Zt}),Mi==null||Mi(Zt,{event:"select",selected:zn,node:Dt,selectedNodes:on,nativeEvent:kt.nativeEvent})}),(0,We.Z)((0,st.Z)(qe),"onNodeCheck",function(kt,Dt,Zt){var hn=qe.state,wn=hn.keyEntities,Dn=hn.checkedKeys,Tn=hn.halfCheckedKeys,Mi=qe.props,tn=Mi.checkStrictly,qt=Mi.onCheck,un=Dt.key,zn,on={event:"check",node:Dt,checked:Zt,nativeEvent:kt.nativeEvent};if(tn){var Sn=Zt?(0,Pt.L0)(Dn,un):(0,Pt._5)(Dn,un),di=(0,Pt._5)(Tn,un);zn={checked:Sn,halfChecked:di},on.checkedNodes=Sn.map(function(On){return(0,ii.Z)(wn,On)}).filter(Boolean).map(function(On){return On.node}),qe.setUncontrolledState({checkedKeys:Sn})}else{var Ui=(0,Nt.S)([].concat((0,bt.Z)(Dn),[un]),!0,wn),gi=Ui.checkedKeys,Hi=Ui.halfCheckedKeys;if(!Zt){var kr=new Set(gi);kr.delete(un);var Gn=(0,Nt.S)(Array.from(kr),{checked:!1,halfCheckedKeys:Hi},wn);gi=Gn.checkedKeys,Hi=Gn.halfCheckedKeys}zn=gi,on.checkedNodes=[],on.checkedNodesPositions=[],on.halfCheckedKeys=Hi,gi.forEach(function(On){var Xn=(0,ii.Z)(wn,On);if(Xn){var wi=Xn.node,nr=Xn.pos;on.checkedNodes.push(wi),on.checkedNodesPositions.push({node:wi,pos:nr})}}),qe.setUncontrolledState({checkedKeys:gi},!1,{halfCheckedKeys:Hi})}qt==null||qt(zn,on)}),(0,We.Z)((0,st.Z)(qe),"onNodeLoad",function(kt){var Dt,Zt=kt.key,hn=qe.state.keyEntities,wn=(0,ii.Z)(hn,Zt);if(!(wn!=null&&(Dt=wn.children)!==null&&Dt!==void 0&&Dt.length)){var Dn=new Promise(function(Tn,Mi){qe.setState(function(tn){var qt=tn.loadedKeys,un=qt===void 0?[]:qt,zn=tn.loadingKeys,on=zn===void 0?[]:zn,Sn=qe.props,di=Sn.loadData,Ui=Sn.onLoad;if(!di||un.includes(Zt)||on.includes(Zt))return null;var gi=di(kt);return gi.then(function(){var Hi=qe.state.loadedKeys,kr=(0,Pt.L0)(Hi,Zt);Ui==null||Ui(kr,{event:"load",node:kt}),qe.setUncontrolledState({loadedKeys:kr}),qe.setState(function(Gn){return{loadingKeys:(0,Pt._5)(Gn.loadingKeys,Zt)}}),Tn()}).catch(function(Hi){if(qe.setState(function(Gn){return{loadingKeys:(0,Pt._5)(Gn.loadingKeys,Zt)}}),qe.loadingRetryTimes[Zt]=(qe.loadingRetryTimes[Zt]||0)+1,qe.loadingRetryTimes[Zt]>=Gi){var kr=qe.state.loadedKeys;(0,ne.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),qe.setUncontrolledState({loadedKeys:(0,Pt.L0)(kr,Zt)}),Tn()}Mi(Hi)}),{loadingKeys:(0,Pt.L0)(on,Zt)}})});return Dn.catch(function(){}),Dn}}),(0,We.Z)((0,st.Z)(qe),"onNodeMouseEnter",function(kt,Dt){var Zt=qe.props.onMouseEnter;Zt==null||Zt({event:kt,node:Dt})}),(0,We.Z)((0,st.Z)(qe),"onNodeMouseLeave",function(kt,Dt){var Zt=qe.props.onMouseLeave;Zt==null||Zt({event:kt,node:Dt})}),(0,We.Z)((0,st.Z)(qe),"onNodeContextMenu",function(kt,Dt){var Zt=qe.props.onRightClick;Zt&&(kt.preventDefault(),Zt({event:kt,node:Dt}))}),(0,We.Z)((0,st.Z)(qe),"onFocus",function(){var kt=qe.props.onFocus;qe.setState({focused:!0});for(var Dt=arguments.length,Zt=new Array(Dt),hn=0;hn<Dt;hn++)Zt[hn]=arguments[hn];kt==null||kt.apply(void 0,Zt)}),(0,We.Z)((0,st.Z)(qe),"onBlur",function(){var kt=qe.props.onBlur;qe.setState({focused:!1}),qe.onActiveChange(null);for(var Dt=arguments.length,Zt=new Array(Dt),hn=0;hn<Dt;hn++)Zt[hn]=arguments[hn];kt==null||kt.apply(void 0,Zt)}),(0,We.Z)((0,st.Z)(qe),"getTreeNodeRequiredProps",function(){var kt=qe.state,Dt=kt.expandedKeys,Zt=kt.selectedKeys,hn=kt.loadedKeys,wn=kt.loadingKeys,Dn=kt.checkedKeys,Tn=kt.halfCheckedKeys,Mi=kt.dragOverNodeKey,tn=kt.dropPosition,qt=kt.keyEntities;return{expandedKeys:Dt||[],selectedKeys:Zt||[],loadedKeys:hn||[],loadingKeys:wn||[],checkedKeys:Dn||[],halfCheckedKeys:Tn||[],dragOverNodeKey:Mi,dropPosition:tn,keyEntities:qt}}),(0,We.Z)((0,st.Z)(qe),"setExpandedKeys",function(kt){var Dt=qe.state,Zt=Dt.treeData,hn=Dt.fieldNames,wn=(0,$e.oH)(Zt,kt,hn);qe.setUncontrolledState({expandedKeys:kt,flattenNodes:wn},!0)}),(0,We.Z)((0,st.Z)(qe),"onNodeExpand",function(kt,Dt){var Zt=qe.state.expandedKeys,hn=qe.state,wn=hn.listChanging,Dn=hn.fieldNames,Tn=qe.props,Mi=Tn.onExpand,tn=Tn.loadData,qt=Dt.expanded,un=Dt[Dn.key];if(!wn){var zn=Zt.includes(un),on=!qt;if((0,ne.ZP)(qt&&zn||!qt&&!zn,"Expand state not sync with index check"),Zt=on?(0,Pt.L0)(Zt,un):(0,Pt._5)(Zt,un),qe.setExpandedKeys(Zt),Mi==null||Mi(Zt,{node:Dt,expanded:on,nativeEvent:kt.nativeEvent}),on&&tn){var Sn=qe.onNodeLoad(Dt);Sn&&Sn.then(function(){var di=(0,$e.oH)(qe.state.treeData,Zt,Dn);qe.setUncontrolledState({flattenNodes:di})}).catch(function(){var di=qe.state.expandedKeys,Ui=(0,Pt._5)(di,un);qe.setExpandedKeys(Ui)})}}}),(0,We.Z)((0,st.Z)(qe),"onListChangeStart",function(){qe.setUncontrolledState({listChanging:!0})}),(0,We.Z)((0,st.Z)(qe),"onListChangeEnd",function(){setTimeout(function(){qe.setUncontrolledState({listChanging:!1})})}),(0,We.Z)((0,st.Z)(qe),"onActiveChange",function(kt){var Dt=qe.state.activeKey,Zt=qe.props,hn=Zt.onActiveChange,wn=Zt.itemScrollOffset,Dn=wn===void 0?0:wn;Dt!==kt&&(qe.setState({activeKey:kt}),kt!==null&&qe.scrollTo({key:kt,offset:Dn}),hn==null||hn(kt))}),(0,We.Z)((0,st.Z)(qe),"getActiveItem",function(){var kt=qe.state,Dt=kt.activeKey,Zt=kt.flattenNodes;return Dt===null?null:Zt.find(function(hn){var wn=hn.key;return wn===Dt})||null}),(0,We.Z)((0,st.Z)(qe),"offsetActiveKey",function(kt){var Dt=qe.state,Zt=Dt.flattenNodes,hn=Dt.activeKey,wn=Zt.findIndex(function(Mi){var tn=Mi.key;return tn===hn});wn===-1&&kt<0&&(wn=Zt.length),wn=(wn+kt+Zt.length)%Zt.length;var Dn=Zt[wn];if(Dn){var Tn=Dn.key;qe.onActiveChange(Tn)}else qe.onActiveChange(null)}),(0,We.Z)((0,st.Z)(qe),"onKeyDown",function(kt){var Dt=qe.state,Zt=Dt.activeKey,hn=Dt.expandedKeys,wn=Dt.checkedKeys,Dn=Dt.fieldNames,Tn=qe.props,Mi=Tn.onKeyDown,tn=Tn.checkable,qt=Tn.selectable;switch(kt.which){case At.Z.UP:{qe.offsetActiveKey(-1),kt.preventDefault();break}case At.Z.DOWN:{qe.offsetActiveKey(1),kt.preventDefault();break}}var un=qe.getActiveItem();if(un&&un.data){var zn=qe.getTreeNodeRequiredProps(),on=un.data.isLeaf===!1||!!(un.data[Dn.children]||[]).length,Sn=(0,$e.F)((0,it.Z)((0,it.Z)({},(0,$e.H8)(Zt,zn)),{},{data:un.data,active:!0}));switch(kt.which){case At.Z.LEFT:{on&&hn.includes(Zt)?qe.onNodeExpand({},Sn):un.parent&&qe.onActiveChange(un.parent.key),kt.preventDefault();break}case At.Z.RIGHT:{on&&!hn.includes(Zt)?qe.onNodeExpand({},Sn):un.children&&un.children.length&&qe.onActiveChange(un.children[0].key),kt.preventDefault();break}case At.Z.ENTER:case At.Z.SPACE:{tn&&!Sn.disabled&&Sn.checkable!==!1&&!Sn.disableCheckbox?qe.onNodeCheck({},Sn,!wn.includes(Zt)):!tn&&qt&&!Sn.disabled&&Sn.selectable!==!1&&qe.onNodeSelect({},Sn);break}}}Mi==null||Mi(kt)}),(0,We.Z)((0,st.Z)(qe),"setUncontrolledState",function(kt){var Dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Zt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!qe.destroyed){var hn=!1,wn=!0,Dn={};Object.keys(kt).forEach(function(Tn){if(qe.props.hasOwnProperty(Tn)){wn=!1;return}hn=!0,Dn[Tn]=kt[Tn]}),hn&&(!Dt||wn)&&qe.setState((0,it.Z)((0,it.Z)({},Dn),Zt))}}),(0,We.Z)((0,st.Z)(qe),"scrollTo",function(kt){qe.listRef.current.scrollTo(kt)}),qe}return(0,Oe.Z)(Ae,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var an=this.props,Xt=an.activeKey,yn=an.itemScrollOffset,kt=yn===void 0?0:yn;Xt!==void 0&&Xt!==this.state.activeKey&&(this.setState({activeKey:Xt}),Xt!==null&&this.scrollTo({key:Xt,offset:kt}))}},{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 an=this.state,Xt=an.focused,yn=an.flattenNodes,kt=an.keyEntities,Dt=an.draggingNodeKey,Zt=an.activeKey,hn=an.dropLevelOffset,wn=an.dropContainerKey,Dn=an.dropTargetKey,Tn=an.dropPosition,Mi=an.dragOverNodeKey,tn=an.indent,qt=this.props,un=qt.prefixCls,zn=qt.className,on=qt.style,Sn=qt.showLine,di=qt.focusable,Ui=qt.tabIndex,gi=Ui===void 0?0:Ui,Hi=qt.selectable,kr=qt.showIcon,Gn=qt.icon,On=qt.switcherIcon,Xn=qt.draggable,wi=qt.checkable,nr=qt.checkStrictly,ji=qt.disabled,Cr=qt.motion,be=qt.loadData,mn=qt.filterTreeNode,fi=qt.height,Vn=qt.itemHeight,si=qt.scrollWidth,Di=qt.virtual,Ni=qt.titleRender,yr=qt.dropIndicatorRender,zt=qt.onContextMenu,Mt=qt.onScroll,_t=qt.direction,fn=qt.rootClassName,Ji=qt.rootStyle,mi=(0,De.Z)(this.props,{aria:!0,data:!0}),$i;Xn&&((0,Ke.Z)(Xn)==="object"?$i=Xn:typeof Xn=="function"?$i={nodeDraggable:Xn}:$i={});var xn={prefixCls:un,selectable:Hi,showIcon:kr,icon:Gn,switcherIcon:On,draggable:$i,draggingNodeKey:Dt,checkable:wi,checkStrictly:nr,disabled:ji,keyEntities:kt,dropLevelOffset:hn,dropContainerKey:wn,dropTargetKey:Dn,dropPosition:Tn,dragOverNodeKey:Mi,indent:tn,direction:_t,dropIndicatorRender:yr,loadData:be,filterTreeNode:mn,titleRender:Ni,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 te.createElement(de.k.Provider,{value:xn},te.createElement("div",{className:ct()(un,zn,fn,(0,We.Z)((0,We.Z)((0,We.Z)({},"".concat(un,"-show-line"),Sn),"".concat(un,"-focused"),Xt),"".concat(un,"-active-focused"),Zt!==null)),style:Ji},te.createElement(It,(0,le.Z)({ref:this.listRef,prefixCls:un,style:on,data:yn,disabled:ji,selectable:Hi,checkable:!!wi,motion:Cr,dragging:Dt!==null,height:fi,itemHeight:Vn,virtual:Di,focusable:di,focused:Xt,tabIndex:gi,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:zt,onScroll:Mt,scrollWidth:si},this.getTreeNodeRequiredProps(),mi))))}}],[{key:"getDerivedStateFromProps",value:function(an,Xt){var yn=Xt.prevProps,kt={prevProps:an};function Dt(gi){return!yn&&an.hasOwnProperty(gi)||yn&&yn[gi]!==an[gi]}var Zt,hn=Xt.fieldNames;if(Dt("fieldNames")&&(hn=(0,$e.w$)(an.fieldNames),kt.fieldNames=hn),Dt("treeData")?Zt=an.treeData:Dt("children")&&((0,ne.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Zt=(0,$e.zn)(an.children)),Zt){kt.treeData=Zt;var wn=(0,$e.I8)(Zt,{fieldNames:hn});kt.keyEntities=(0,it.Z)((0,We.Z)({},rt,ri),wn.keyEntities)}var Dn=kt.keyEntities||Xt.keyEntities;if(Dt("expandedKeys")||yn&&Dt("autoExpandParent"))kt.expandedKeys=an.autoExpandParent||!yn&&an.defaultExpandParent?(0,Pt.r7)(an.expandedKeys,Dn):an.expandedKeys;else if(!yn&&an.defaultExpandAll){var Tn=(0,it.Z)({},Dn);delete Tn[rt];var Mi=[];Object.keys(Tn).forEach(function(gi){var Hi=Tn[gi];Hi.children&&Hi.children.length&&Mi.push(Hi.key)}),kt.expandedKeys=Mi}else!yn&&an.defaultExpandedKeys&&(kt.expandedKeys=an.autoExpandParent||an.defaultExpandParent?(0,Pt.r7)(an.defaultExpandedKeys,Dn):an.defaultExpandedKeys);if(kt.expandedKeys||delete kt.expandedKeys,Zt||kt.expandedKeys){var tn=(0,$e.oH)(Zt||Xt.treeData,kt.expandedKeys||Xt.expandedKeys,hn);kt.flattenNodes=tn}if(an.selectable&&(Dt("selectedKeys")?kt.selectedKeys=(0,Pt.BT)(an.selectedKeys,an):!yn&&an.defaultSelectedKeys&&(kt.selectedKeys=(0,Pt.BT)(an.defaultSelectedKeys,an))),an.checkable){var qt;if(Dt("checkedKeys")?qt=(0,Pt.E6)(an.checkedKeys)||{}:!yn&&an.defaultCheckedKeys?qt=(0,Pt.E6)(an.defaultCheckedKeys)||{}:Zt&&(qt=(0,Pt.E6)(an.checkedKeys)||{checkedKeys:Xt.checkedKeys,halfCheckedKeys:Xt.halfCheckedKeys}),qt){var un=qt,zn=un.checkedKeys,on=zn===void 0?[]:zn,Sn=un.halfCheckedKeys,di=Sn===void 0?[]:Sn;if(!an.checkStrictly){var Ui=(0,Nt.S)(on,!0,Dn);on=Ui.checkedKeys,di=Ui.halfCheckedKeys}kt.checkedKeys=on,kt.halfCheckedKeys=di}}return Dt("loadedKeys")&&(kt.loadedKeys=an.loadedKeys),kt}}]),Ae}(te.Component);(0,We.Z)(ze,"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:ge,allowDrop:function(){return!0},expandAction:!1}),(0,We.Z)(ze,"TreeNode",Qe.Z);var Me=ze,Ee=Me},82661:function(Zn,ei,Le){"use strict";Le.d(ei,{BT:function(){return te},E6:function(){return ge},L0:function(){return We},OM:function(){return ne},_5:function(){return ot},r7:function(){return ye},wA:function(){return ct},yx:function(){return Tt}});var le=Le(95190),Ke=Le(93664),it=Le(48736),bt=Le(59301),vt=Le(639),Oe=Le(65065),st=Le(34061),Et=null;function ot(we,Ce){if(!we)return[];var _e=we.slice(),Ze=_e.indexOf(Ce);return Ze>=0&&_e.splice(Ze,1),_e}function We(we,Ce){var _e=(we||[]).slice();return _e.indexOf(Ce)===-1&&_e.push(Ce),_e}function Tt(we){return we.split("-")}function ct(we,Ce){var _e=[],Ze=(0,Oe.Z)(Ce,we);function lt(){var Qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Qe.forEach(function(Ue){var dt=Ue.key,$e=Ue.children;_e.push(dt),lt($e)})}return lt(Ze.children),_e}function At(we){if(we.parent){var Ce=Tt(we.pos);return Number(Ce[Ce.length-1])===we.parent.children.length-1}return!1}function De(we){var Ce=Tt(we.pos);return Number(Ce[Ce.length-1])===0}function ne(we,Ce,_e,Ze,lt,Qe,Ue,dt,$e,wt){var St,Lt=we.clientX,pn=we.clientY,en=we.target.getBoundingClientRect(),vn=en.top,rn=en.height,nt=(wt==="rtl"?-1:1)*(((lt==null?void 0:lt.x)||0)-Lt),rt=(nt-12)/Ze,dn=$e.filter(function(Ee){var Te;return(Te=dt[Ee])===null||Te===void 0||(Te=Te.children)===null||Te===void 0?void 0:Te.length}),ri=(0,Oe.Z)(dt,_e.eventKey);if(pn<vn+rn/2){var Hn=Ue.findIndex(function(Ee){return Ee.key===ri.key}),Wt=Hn<=0?0:Hn-1,En=Ue[Wt].key;ri=(0,Oe.Z)(dt,En)}var An=ri.key,ci=ri,It=ri.key,Pt=0,Nt=0;if(!dn.includes(An))for(var ii=0;ii<rt&&At(ri);ii+=1)ri=ri.parent,Nt+=1;var Gi=Ce.data,ze=ri.node,Me=!0;return De(ri)&&ri.level===0&&pn<vn+rn/2&&Qe({dragNode:Gi,dropNode:ze,dropPosition:-1})&&ri.key===_e.eventKey?Pt=-1:(ci.children||[]).length&&dn.includes(It)?Qe({dragNode:Gi,dropNode:ze,dropPosition:0})?Pt=0:Me=!1:Nt===0?rt>-1.5?Qe({dragNode:Gi,dropNode:ze,dropPosition:1})?Pt=1:Me=!1:Qe({dragNode:Gi,dropNode:ze,dropPosition:0})?Pt=0:Qe({dragNode:Gi,dropNode:ze,dropPosition:1})?Pt=1:Me=!1:Qe({dragNode:Gi,dropNode:ze,dropPosition:1})?Pt=1:Me=!1,{dropPosition:Pt,dropLevelOffset:Nt,dropTargetKey:ri.key,dropTargetPos:ri.pos,dragOverNodeKey:It,dropContainerKey:Pt===0?null:((St=ri.parent)===null||St===void 0?void 0:St.key)||null,dropAllowed:Me}}function te(we,Ce){if(we){var _e=Ce.multiple;return _e?we.slice():we.length?[we[0]]:we}}var de=function(Ce){return Ce};function se(we,Ce){if(!we)return[];var _e=Ce||{},Ze=_e.processProps,lt=Ze===void 0?de:Ze,Qe=Array.isArray(we)?we:[we];return Qe.map(function(Ue){var dt=Ue.children,$e=_objectWithoutProperties(Ue,Et),wt=se(dt,Ce);return React.createElement(TreeNode,_extends({key:$e.key},lt($e)),wt)})}function ge(we){if(!we)return null;var Ce;if(Array.isArray(we))Ce={checkedKeys:we,halfCheckedKeys:void 0};else if((0,Ke.Z)(we)==="object")Ce={checkedKeys:we.checked||void 0,halfCheckedKeys:we.halfChecked||void 0};else return(0,it.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return Ce}function ye(we,Ce){var _e=new Set;function Ze(lt){if(!_e.has(lt)){var Qe=(0,Oe.Z)(Ce,lt);if(Qe){_e.add(lt);var Ue=Qe.parent,dt=Qe.node;dt.disabled||Ue&&Ze(Ue.key)}}}return(we||[]).forEach(function(lt){Ze(lt)}),(0,le.Z)(_e)}},34643:function(Zn,ei,Le){"use strict";Le.d(ei,{S:function(){return st}});var le=Le(48736),Ke=Le(65065);function it(Et,ot){var We=new Set;return Et.forEach(function(Tt){ot.has(Tt)||We.add(Tt)}),We}function bt(Et){var ot=Et||{},We=ot.disabled,Tt=ot.disableCheckbox,ct=ot.checkable;return!!(We||Tt)||ct===!1}function vt(Et,ot,We,Tt){for(var ct=new Set(Et),At=new Set,De=0;De<=We;De+=1){var ne=ot.get(De)||new Set;ne.forEach(function(ge){var ye=ge.key,we=ge.node,Ce=ge.children,_e=Ce===void 0?[]:Ce;ct.has(ye)&&!Tt(we)&&_e.filter(function(Ze){return!Tt(Ze.node)}).forEach(function(Ze){ct.add(Ze.key)})})}for(var te=new Set,de=We;de>=0;de-=1){var se=ot.get(de)||new Set;se.forEach(function(ge){var ye=ge.parent,we=ge.node;if(!(Tt(we)||!ge.parent||te.has(ge.parent.key))){if(Tt(ge.parent.node)){te.add(ye.key);return}var Ce=!0,_e=!1;(ye.children||[]).filter(function(Ze){return!Tt(Ze.node)}).forEach(function(Ze){var lt=Ze.key,Qe=ct.has(lt);Ce&&!Qe&&(Ce=!1),!_e&&(Qe||At.has(lt))&&(_e=!0)}),Ce&&ct.add(ye.key),_e&&At.add(ye.key),te.add(ye.key)}})}return{checkedKeys:Array.from(ct),halfCheckedKeys:Array.from(it(At,ct))}}function Oe(Et,ot,We,Tt,ct){for(var At=new Set(Et),De=new Set(ot),ne=0;ne<=Tt;ne+=1){var te=We.get(ne)||new Set;te.forEach(function(ye){var we=ye.key,Ce=ye.node,_e=ye.children,Ze=_e===void 0?[]:_e;!At.has(we)&&!De.has(we)&&!ct(Ce)&&Ze.filter(function(lt){return!ct(lt.node)}).forEach(function(lt){At.delete(lt.key)})})}De=new Set;for(var de=new Set,se=Tt;se>=0;se-=1){var ge=We.get(se)||new Set;ge.forEach(function(ye){var we=ye.parent,Ce=ye.node;if(!(ct(Ce)||!ye.parent||de.has(ye.parent.key))){if(ct(ye.parent.node)){de.add(we.key);return}var _e=!0,Ze=!1;(we.children||[]).filter(function(lt){return!ct(lt.node)}).forEach(function(lt){var Qe=lt.key,Ue=At.has(Qe);_e&&!Ue&&(_e=!1),!Ze&&(Ue||De.has(Qe))&&(Ze=!0)}),_e||At.delete(we.key),Ze&&De.add(we.key),de.add(we.key)}})}return{checkedKeys:Array.from(At),halfCheckedKeys:Array.from(it(De,At))}}function st(Et,ot,We,Tt){var ct=[],At;Tt?At=Tt:At=bt;var De=new Set(Et.filter(function(se){var ge=!!(0,Ke.Z)(We,se);return ge||ct.push(se),ge})),ne=new Map,te=0;Object.keys(We).forEach(function(se){var ge=We[se],ye=ge.level,we=ne.get(ye);we||(we=new Set,ne.set(ye,we)),we.add(ge),te=Math.max(te,ye)}),(0,le.ZP)(!ct.length,"Tree missing follow keys: ".concat(ct.slice(0,100).map(function(se){return"'".concat(se,"'")}).join(", ")));var de;return ot===!0?de=vt(De,ne,te,At):de=Oe(De,ot.halfCheckedKeys,ne,te,At),de}},65065:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return le}});function le(Ke,it){return Ke[it]}},34061:function(Zn,ei,Le){"use strict";Le.d(ei,{F:function(){return ye},H8:function(){return ge},I8:function(){return se},km:function(){return ct},oH:function(){return te},w$:function(){return At},zn:function(){return ne}});var le=Le(93664),Ke=Le(95190),it=Le(20439),bt=Le(62646),vt=Le(11592),Oe=Le(2738),st=Le(48736),Et=Le(65065),ot=["children"];function We(we,Ce){return"".concat(we,"-").concat(Ce)}function Tt(we){return we&&we.type&&we.type.isTreeNode}function ct(we,Ce){return we!=null?we:Ce}function At(we){var Ce=we||{},_e=Ce.title,Ze=Ce._title,lt=Ce.key,Qe=Ce.children,Ue=_e||"title";return{title:Ue,_title:Ze||[Ue],key:lt||"key",children:Qe||"children"}}function De(we,Ce){var _e=new Map;function Ze(lt){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(lt||[]).forEach(function(Ue){var dt=Ue[Ce.key],$e=Ue[Ce.children];warning(dt!=null,"Tree node must have a certain key: [".concat(Qe).concat(dt,"]"));var wt=String(dt);warning(!_e.has(wt)||dt===null||dt===void 0,"Same 'key' exist in the Tree: ".concat(wt)),_e.set(wt,!0),Ze($e,"".concat(Qe).concat(wt," > "))})}Ze(we)}function ne(we){function Ce(_e){var Ze=(0,vt.Z)(_e);return Ze.map(function(lt){if(!Tt(lt))return(0,st.ZP)(!lt,"Tree/TreeNode can only accept TreeNode as children."),null;var Qe=lt.key,Ue=lt.props,dt=Ue.children,$e=(0,bt.Z)(Ue,ot),wt=(0,it.Z)({key:Qe},$e),St=Ce(dt);return St.length&&(wt.children=St),wt}).filter(function(lt){return lt})}return Ce(we)}function te(we,Ce,_e){var Ze=At(_e),lt=Ze._title,Qe=Ze.key,Ue=Ze.children,dt=new Set(Ce===!0?[]:Ce),$e=[];function wt(St){var Lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return St.map(function(pn,en){for(var vn=We(Lt?Lt.pos:"0",en),rn=ct(pn[Qe],vn),nt,rt=0;rt<lt.length;rt+=1){var dn=lt[rt];if(pn[dn]!==void 0){nt=pn[dn];break}}var ri=Object.assign((0,Oe.Z)(pn,[].concat((0,Ke.Z)(lt),[Qe,Ue])),{title:nt,key:rn,parent:Lt,pos:vn,children:null,data:pn,isStart:[].concat((0,Ke.Z)(Lt?Lt.isStart:[]),[en===0]),isEnd:[].concat((0,Ke.Z)(Lt?Lt.isEnd:[]),[en===St.length-1])});return $e.push(ri),Ce===!0||dt.has(rn)?ri.children=wt(pn[Ue]||[],ri):ri.children=[],ri})}return wt(we),$e}function de(we,Ce,_e){var Ze={};(0,le.Z)(_e)==="object"?Ze=_e:Ze={externalGetKey:_e},Ze=Ze||{};var lt=Ze,Qe=lt.childrenPropName,Ue=lt.externalGetKey,dt=lt.fieldNames,$e=At(dt),wt=$e.key,St=$e.children,Lt=Qe||St,pn;Ue?typeof Ue=="string"?pn=function(rn){return rn[Ue]}:typeof Ue=="function"&&(pn=function(rn){return Ue(rn)}):pn=function(rn,nt){return ct(rn[wt],nt)};function en(vn,rn,nt,rt){var dn=vn?vn[Lt]:we,ri=vn?We(nt.pos,rn):"0",Hn=vn?[].concat((0,Ke.Z)(rt),[vn]):[];if(vn){var Wt=pn(vn,ri),En={node:vn,index:rn,pos:ri,key:Wt,parentPos:nt.node?nt.pos:null,level:nt.level+1,nodes:Hn};Ce(En)}dn&&dn.forEach(function(An,ci){en(An,ci,{node:vn,pos:ri,level:nt?nt.level+1:-1},Hn)})}en(null)}function se(we){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e=Ce.initWrapper,Ze=Ce.processEntity,lt=Ce.onProcessFinished,Qe=Ce.externalGetKey,Ue=Ce.childrenPropName,dt=Ce.fieldNames,$e=arguments.length>2?arguments[2]:void 0,wt=Qe||$e,St={},Lt={},pn={posEntities:St,keyEntities:Lt};return _e&&(pn=_e(pn)||pn),de(we,function(en){var vn=en.node,rn=en.index,nt=en.pos,rt=en.key,dn=en.parentPos,ri=en.level,Hn=en.nodes,Wt={node:vn,nodes:Hn,index:rn,key:rt,pos:nt,level:ri},En=ct(rt,nt);St[nt]=Wt,Lt[En]=Wt,Wt.parent=St[dn],Wt.parent&&(Wt.parent.children=Wt.parent.children||[],Wt.parent.children.push(Wt)),Ze&&Ze(Wt,pn)},{externalGetKey:wt,childrenPropName:Ue,fieldNames:dt}),lt&&lt(pn),pn}function ge(we,Ce){var _e=Ce.expandedKeys,Ze=Ce.selectedKeys,lt=Ce.loadedKeys,Qe=Ce.loadingKeys,Ue=Ce.checkedKeys,dt=Ce.halfCheckedKeys,$e=Ce.dragOverNodeKey,wt=Ce.dropPosition,St=Ce.keyEntities,Lt=(0,Et.Z)(St,we),pn={eventKey:we,expanded:_e.indexOf(we)!==-1,selected:Ze.indexOf(we)!==-1,loaded:lt.indexOf(we)!==-1,loading:Qe.indexOf(we)!==-1,checked:Ue.indexOf(we)!==-1,halfChecked:dt.indexOf(we)!==-1,pos:String(Lt?Lt.pos:""),dragOver:$e===we&&wt===0,dragOverGapTop:$e===we&&wt===-1,dragOverGapBottom:$e===we&&wt===1};return pn}function ye(we){var Ce=we.data,_e=we.expanded,Ze=we.selected,lt=we.checked,Qe=we.loaded,Ue=we.loading,dt=we.halfChecked,$e=we.dragOver,wt=we.dragOverGapTop,St=we.dragOverGapBottom,Lt=we.pos,pn=we.active,en=we.eventKey,vn=(0,it.Z)((0,it.Z)({},Ce),{},{expanded:_e,selected:Ze,checked:lt,loaded:Qe,loading:Ue,halfChecked:dt,dragOver:$e,dragOverGapTop:wt,dragOverGapBottom:St,pos:Lt,active:pn,key:en});return"props"in vn||Object.defineProperty(vn,"props",{get:function(){return(0,st.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),we}}),vn}},8224:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Ke}});var le=Le(4676);function Ke(it,bt,vt,Oe){var st=le.unstable_batchedUpdates?function(ot){le.unstable_batchedUpdates(vt,ot)}:vt;return it!=null&&it.addEventListener&&it.addEventListener(bt,st,Oe),{remove:function(){it!=null&&it.removeEventListener&&it.removeEventListener(bt,st,Oe)}}}},24514:function(Zn,ei,Le){"use strict";Le.d(ei,{G:function(){return bt}});var le=Le(47273),Ke=function(Oe){if((0,le.Z)()&&window.document.documentElement){var st=Array.isArray(Oe)?Oe:[Oe],Et=window.document.documentElement;return st.some(function(ot){return ot in Et.style})}return!1},it=function(Oe,st){if(!Ke(Oe))return!1;var Et=document.createElement("div"),ot=Et.style[Oe];return Et.style[Oe]=st,Et.style[Oe]!==ot};function bt(vt,Oe){return!Array.isArray(vt)&&Oe!==void 0?it(vt,Oe):Ke(vt)}},6790:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Gi}});var le=Le(14809),Ke=Le(93664),it=Le(20439),bt=Le(4635),vt=Le(50298),Oe=Le(62646),st=Le(92310),Et=Le.n(st),ot=Le(29301),We=Le(70425),Tt=Le(34280),ct=Le(59301),At=Le(4676),De=ct.forwardRef(function(ze,Me){var Ee=ze.height,Te=ze.offsetY,He=ze.offsetX,Ae=ze.children,qe=ze.prefixCls,an=ze.onInnerResize,Xt=ze.innerProps,yn=ze.rtl,kt=ze.extra,Dt={},Zt={display:"flex",flexDirection:"column"};return Te!==void 0&&(Dt={height:Ee,position:"relative",overflow:"hidden"},Zt=(0,it.Z)((0,it.Z)({},Zt),{},(0,bt.Z)((0,bt.Z)((0,bt.Z)((0,bt.Z)((0,bt.Z)({transform:"translateY(".concat(Te,"px)")},yn?"marginRight":"marginLeft",-He),"position","absolute"),"left",0),"right",0),"top",0))),ct.createElement("div",{style:Dt},ct.createElement(ot.Z,{onResize:function(wn){var Dn=wn.offsetHeight;Dn&&an&&an()}},ct.createElement("div",(0,le.Z)({style:Zt,className:Et()((0,bt.Z)({},"".concat(qe,"-holder-inner"),qe)),ref:Me},Xt),Ae,kt)))});De.displayName="Filler";var ne=De;function te(ze){var Me=ze.children,Ee=ze.setRef,Te=ct.useCallback(function(He){Ee(He)},[]);return ct.cloneElement(Me,{ref:Te})}function de(ze,Me,Ee,Te,He,Ae,qe,an){var Xt=an.getKey;return ze.slice(Me,Ee+1).map(function(yn,kt){var Dt=Me+kt,Zt=qe(yn,Dt,{style:{width:Te},offsetX:He}),hn=Xt(yn);return ct.createElement(te,{key:hn,setRef:function(Dn){return Ae(yn,Dn)}},Zt)})}function se(ze,Me,Ee,Te){var He=Ee-ze,Ae=Me-Ee,qe=Math.min(He,Ae)*2;if(Te<=qe){var an=Math.floor(Te/2);return Te%2?Ee+an+1:Ee-an}return He>Ae?Ee-(Te-Ae):Ee+(Te-He)}function ge(ze,Me,Ee){var Te=ze.length,He=Me.length,Ae,qe;if(Te===0&&He===0)return null;Te<He?(Ae=ze,qe=Me):(Ae=Me,qe=ze);var an={__EMPTY_ITEM__:!0};function Xt(wn){return wn!==void 0?Ee(wn):an}for(var yn=null,kt=Math.abs(Te-He)!==1,Dt=0;Dt<qe.length;Dt+=1){var Zt=Xt(Ae[Dt]),hn=Xt(qe[Dt]);if(Zt!==hn){yn=Dt,kt=kt||Zt!==Xt(qe[Dt+1]);break}}return yn===null?null:{index:yn,multiple:kt}}function ye(ze,Me,Ee){var Te=ct.useState(ze),He=(0,vt.Z)(Te,2),Ae=He[0],qe=He[1],an=ct.useState(null),Xt=(0,vt.Z)(an,2),yn=Xt[0],kt=Xt[1];return ct.useEffect(function(){var Dt=ge(Ae||[],ze||[],Me);(Dt==null?void 0:Dt.index)!==void 0&&(Ee==null||Ee(Dt.index),kt(ze[Dt.index])),qe(ze)},[ze]),[yn]}var we=Le(16089),Ce=(typeof navigator=="undefined"?"undefined":(0,Ke.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),_e=Ce,Ze=function(ze,Me,Ee,Te){var He=(0,ct.useRef)(!1),Ae=(0,ct.useRef)(null);function qe(){clearTimeout(Ae.current),He.current=!0,Ae.current=setTimeout(function(){He.current=!1},50)}var an=(0,ct.useRef)({top:ze,bottom:Me,left:Ee,right:Te});return an.current.top=ze,an.current.bottom=Me,an.current.left=Ee,an.current.right=Te,function(Xt,yn){var kt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Dt=Xt?yn<0&&an.current.left||yn>0&&an.current.right:yn<0&&an.current.top||yn>0&&an.current.bottom;return kt&&Dt?(clearTimeout(Ae.current),He.current=!1):(!Dt||He.current)&&qe(),!He.current&&Dt}};function lt(ze,Me,Ee,Te,He,Ae,qe){var an=(0,ct.useRef)(0),Xt=(0,ct.useRef)(null),yn=(0,ct.useRef)(null),kt=(0,ct.useRef)(!1),Dt=Ze(Me,Ee,Te,He);function Zt(tn,qt){if(we.Z.cancel(Xt.current),!Dt(!1,qt)){var un=tn;if(!un._virtualHandled)un._virtualHandled=!0;else return;an.current+=qt,yn.current=qt,_e||un.preventDefault(),Xt.current=(0,we.Z)(function(){var zn=kt.current?10:1;qe(an.current*zn,!1),an.current=0})}}function hn(tn,qt){qe(qt,!0),_e||tn.preventDefault()}var wn=(0,ct.useRef)(null),Dn=(0,ct.useRef)(null);function Tn(tn){if(ze){we.Z.cancel(Dn.current),Dn.current=(0,we.Z)(function(){wn.current=null},2);var qt=tn.deltaX,un=tn.deltaY,zn=tn.shiftKey,on=qt,Sn=un;(wn.current==="sx"||!wn.current&&zn&&un&&!qt)&&(on=un,Sn=0,wn.current="sx");var di=Math.abs(on),Ui=Math.abs(Sn);wn.current===null&&(wn.current=Ae&&di>Ui?"x":"y"),wn.current==="y"?Zt(tn,Sn):hn(tn,on)}}function Mi(tn){ze&&(kt.current=tn.detail===yn.current)}return[Tn,Mi]}function Qe(ze,Me,Ee,Te){var He=ct.useMemo(function(){return[new Map,[]]},[ze,Ee.id,Te]),Ae=(0,vt.Z)(He,2),qe=Ae[0],an=Ae[1],Xt=function(kt){var Dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kt,Zt=qe.get(kt),hn=qe.get(Dt);if(Zt===void 0||hn===void 0)for(var wn=ze.length,Dn=an.length;Dn<wn;Dn+=1){var Tn,Mi=ze[Dn],tn=Me(Mi);qe.set(tn,Dn);var qt=(Tn=Ee.get(tn))!==null&&Tn!==void 0?Tn:Te;if(an[Dn]=(an[Dn-1]||0)+qt,tn===kt&&(Zt=Dn),tn===Dt&&(hn=Dn),Zt!==void 0&&hn!==void 0)break}return{top:an[Zt-1]||0,bottom:an[hn]}};return Xt}var Ue=Le(99153),dt=Le(84851),$e=function(){function ze(){(0,Ue.Z)(this,ze),(0,bt.Z)(this,"maps",void 0),(0,bt.Z)(this,"id",0),(0,bt.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,dt.Z)(ze,[{key:"set",value:function(Ee,Te){this.diffRecords.set(Ee,this.maps[Ee]),this.maps[Ee]=Te,this.id+=1}},{key:"get",value:function(Ee){return this.maps[Ee]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),ze}(),wt=$e;function St(ze){var Me=parseFloat(ze);return isNaN(Me)?0:Me}function Lt(ze,Me,Ee){var Te=ct.useState(0),He=(0,vt.Z)(Te,2),Ae=He[0],qe=He[1],an=(0,ct.useRef)(new Map),Xt=(0,ct.useRef)(new wt),yn=(0,ct.useRef)(0);function kt(){yn.current+=1}function Dt(){var hn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;kt();var wn=function(){var Mi=!1;an.current.forEach(function(tn,qt){if(tn&&tn.offsetParent){var un=tn.offsetHeight,zn=getComputedStyle(tn),on=zn.marginTop,Sn=zn.marginBottom,di=St(on),Ui=St(Sn),gi=un+di+Ui;Xt.current.get(qt)!==gi&&(Xt.current.set(qt,gi),Mi=!0)}}),Mi&&qe(function(tn){return tn+1})};if(hn)wn();else{yn.current+=1;var Dn=yn.current;Promise.resolve().then(function(){Dn===yn.current&&wn()})}}function Zt(hn,wn){var Dn=ze(hn),Tn=an.current.get(Dn);wn?(an.current.set(Dn,wn),Dt()):an.current.delete(Dn),!Tn!=!wn&&(wn?Me==null||Me(hn):Ee==null||Ee(hn))}return(0,ct.useEffect)(function(){return kt},[]),[Zt,Dt,Xt.current,Ae]}var pn=14/15;function en(ze,Me,Ee){var Te=(0,ct.useRef)(!1),He=(0,ct.useRef)(0),Ae=(0,ct.useRef)(0),qe=(0,ct.useRef)(null),an=(0,ct.useRef)(null),Xt,yn=function(hn){if(Te.current){var wn=Math.ceil(hn.touches[0].pageX),Dn=Math.ceil(hn.touches[0].pageY),Tn=He.current-wn,Mi=Ae.current-Dn,tn=Math.abs(Tn)>Math.abs(Mi);tn?He.current=wn:Ae.current=Dn;var qt=Ee(tn,tn?Tn:Mi,!1,hn);qt&&hn.preventDefault(),clearInterval(an.current),qt&&(an.current=setInterval(function(){tn?Tn*=pn:Mi*=pn;var un=Math.floor(tn?Tn:Mi);(!Ee(tn,un,!0)||Math.abs(un)<=.1)&&clearInterval(an.current)},16))}},kt=function(){Te.current=!1,Xt()},Dt=function(hn){Xt(),hn.touches.length===1&&!Te.current&&(Te.current=!0,He.current=Math.ceil(hn.touches[0].pageX),Ae.current=Math.ceil(hn.touches[0].pageY),qe.current=hn.target,qe.current.addEventListener("touchmove",yn,{passive:!1}),qe.current.addEventListener("touchend",kt,{passive:!0}))};Xt=function(){qe.current&&(qe.current.removeEventListener("touchmove",yn),qe.current.removeEventListener("touchend",kt))},(0,Tt.Z)(function(){return ze&&Me.current.addEventListener("touchstart",Dt,{passive:!0}),function(){var Zt;(Zt=Me.current)===null||Zt===void 0||Zt.removeEventListener("touchstart",Dt),Xt(),clearInterval(an.current)}},[ze])}function vn(ze){return Math.floor(Math.pow(ze,.5))}function rn(ze,Me){var Ee="touches"in ze?ze.touches[0]:ze;return Ee[Me?"pageX":"pageY"]-window[Me?"scrollX":"scrollY"]}function nt(ze,Me,Ee){ct.useEffect(function(){var Te=Me.current;if(ze&&Te){var He=!1,Ae,qe,an=function(){we.Z.cancel(Ae)},Xt=function Zt(){an(),Ae=(0,we.Z)(function(){Ee(qe),Zt()})},yn=function(hn){if(!(hn.target.draggable||hn.button!==0)){var wn=hn;wn._virtualHandled||(wn._virtualHandled=!0,He=!0)}},kt=function(){He=!1,an()},Dt=function(hn){if(He){var wn=rn(hn,!1),Dn=Te.getBoundingClientRect(),Tn=Dn.top,Mi=Dn.bottom;if(wn<=Tn){var tn=Tn-wn;qe=-vn(tn),Xt()}else if(wn>=Mi){var qt=wn-Mi;qe=vn(qt),Xt()}else an()}};return Te.addEventListener("mousedown",yn),Te.ownerDocument.addEventListener("mouseup",kt),Te.ownerDocument.addEventListener("mousemove",Dt),function(){Te.removeEventListener("mousedown",yn),Te.ownerDocument.removeEventListener("mouseup",kt),Te.ownerDocument.removeEventListener("mousemove",Dt),an()}}},[ze])}var rt=10;function dn(ze,Me,Ee,Te,He,Ae,qe,an){var Xt=ct.useRef(),yn=ct.useState(null),kt=(0,vt.Z)(yn,2),Dt=kt[0],Zt=kt[1];return(0,Tt.Z)(function(){if(Dt&&Dt.times<rt){if(!ze.current){Zt(function(Cr){return(0,it.Z)({},Cr)});return}Ae();var hn=Dt.targetAlign,wn=Dt.originAlign,Dn=Dt.index,Tn=Dt.offset,Mi=ze.current.clientHeight,tn=!1,qt=hn,un=null;if(Mi){for(var zn=hn||wn,on=0,Sn=0,di=0,Ui=Math.min(Me.length-1,Dn),gi=0;gi<=Ui;gi+=1){var Hi=He(Me[gi]);Sn=on;var kr=Ee.get(Hi);di=Sn+(kr===void 0?Te:kr),on=di}for(var Gn=zn==="top"?Tn:Mi-Tn,On=Ui;On>=0;On-=1){var Xn=He(Me[On]),wi=Ee.get(Xn);if(wi===void 0){tn=!0;break}if(Gn-=wi,Gn<=0)break}switch(zn){case"top":un=Sn-Tn;break;case"bottom":un=di-Mi+Tn;break;default:{var nr=ze.current.scrollTop,ji=nr+Mi;Sn<nr?qt="top":di>ji&&(qt="bottom")}}un!==null&&qe(un),un!==Dt.lastTop&&(tn=!0)}tn&&Zt((0,it.Z)((0,it.Z)({},Dt),{},{times:Dt.times+1,targetAlign:qt,lastTop:un}))}},[Dt,ze.current]),function(hn){if(hn==null){an();return}if(we.Z.cancel(Xt.current),typeof hn=="number")qe(hn);else if(hn&&(0,Ke.Z)(hn)==="object"){var wn,Dn=hn.align;"index"in hn?wn=hn.index:wn=Me.findIndex(function(tn){return He(tn)===hn.key});var Tn=hn.offset,Mi=Tn===void 0?0:Tn;Zt({times:0,index:wn,offset:Mi,originAlign:Dn})}}}var ri=ct.forwardRef(function(ze,Me){var Ee=ze.prefixCls,Te=ze.rtl,He=ze.scrollOffset,Ae=ze.scrollRange,qe=ze.onStartMove,an=ze.onStopMove,Xt=ze.onScroll,yn=ze.horizontal,kt=ze.spinSize,Dt=ze.containerSize,Zt=ze.style,hn=ze.thumbStyle,wn=ze.showScrollBar,Dn=ct.useState(!1),Tn=(0,vt.Z)(Dn,2),Mi=Tn[0],tn=Tn[1],qt=ct.useState(null),un=(0,vt.Z)(qt,2),zn=un[0],on=un[1],Sn=ct.useState(null),di=(0,vt.Z)(Sn,2),Ui=di[0],gi=di[1],Hi=!Te,kr=ct.useRef(),Gn=ct.useRef(),On=ct.useState(wn),Xn=(0,vt.Z)(On,2),wi=Xn[0],nr=Xn[1],ji=ct.useRef(),Cr=function(){wn===!0||wn===!1||(clearTimeout(ji.current),nr(!0),ji.current=setTimeout(function(){nr(!1)},3e3))},be=Ae-Dt||0,mn=Dt-kt||0,fi=ct.useMemo(function(){if(He===0||be===0)return 0;var fn=He/be;return fn*mn},[He,be,mn]),Vn=function(Ji){Ji.stopPropagation(),Ji.preventDefault()},si=ct.useRef({top:fi,dragging:Mi,pageY:zn,startTop:Ui});si.current={top:fi,dragging:Mi,pageY:zn,startTop:Ui};var Di=function(Ji){tn(!0),on(rn(Ji,yn)),gi(si.current.top),qe(),Ji.stopPropagation(),Ji.preventDefault()};ct.useEffect(function(){var fn=function(xn){xn.preventDefault()},Ji=kr.current,mi=Gn.current;return Ji.addEventListener("touchstart",fn,{passive:!1}),mi.addEventListener("touchstart",Di,{passive:!1}),function(){Ji.removeEventListener("touchstart",fn),mi.removeEventListener("touchstart",Di)}},[]);var Ni=ct.useRef();Ni.current=be;var yr=ct.useRef();yr.current=mn,ct.useEffect(function(){if(Mi){var fn,Ji=function(xn){var ni=si.current,sr=ni.dragging,br=ni.pageY,Yn=ni.startTop;we.Z.cancel(fn);var at=kr.current.getBoundingClientRect(),Bt=Dt/(yn?at.width:at.height);if(sr){var Kn=(rn(xn,yn)-br)*Bt,li=Yn;!Hi&&yn?li-=Kn:li+=Kn;var Qt=Ni.current,jt=yr.current,Un=jt?li/jt:0,ai=Math.ceil(Un*Qt);ai=Math.max(ai,0),ai=Math.min(ai,Qt),fn=(0,we.Z)(function(){Xt(ai,yn)})}},mi=function(){tn(!1),an()};return window.addEventListener("mousemove",Ji,{passive:!0}),window.addEventListener("touchmove",Ji,{passive:!0}),window.addEventListener("mouseup",mi,{passive:!0}),window.addEventListener("touchend",mi,{passive:!0}),function(){window.removeEventListener("mousemove",Ji),window.removeEventListener("touchmove",Ji),window.removeEventListener("mouseup",mi),window.removeEventListener("touchend",mi),we.Z.cancel(fn)}}},[Mi]),ct.useEffect(function(){return Cr(),function(){clearTimeout(ji.current)}},[He]),ct.useImperativeHandle(Me,function(){return{delayHidden:Cr}});var zt="".concat(Ee,"-scrollbar"),Mt={position:"absolute",visibility:wi?null:"hidden"},_t={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return yn?(Object.assign(Mt,{height:8,left:0,right:0,bottom:0}),Object.assign(_t,(0,bt.Z)({height:"100%",width:kt},Hi?"left":"right",fi))):(Object.assign(Mt,(0,bt.Z)({width:8,top:0,bottom:0},Hi?"right":"left",0)),Object.assign(_t,{width:"100%",height:kt,top:fi})),ct.createElement("div",{ref:kr,className:Et()(zt,(0,bt.Z)((0,bt.Z)((0,bt.Z)({},"".concat(zt,"-horizontal"),yn),"".concat(zt,"-vertical"),!yn),"".concat(zt,"-visible"),wi)),style:(0,it.Z)((0,it.Z)({},Mt),Zt),onMouseDown:Vn,onMouseMove:Cr},ct.createElement("div",{ref:Gn,className:Et()("".concat(zt,"-thumb"),(0,bt.Z)({},"".concat(zt,"-thumb-moving"),Mi)),style:(0,it.Z)((0,it.Z)({},_t),hn),onMouseDown:Di}))}),Hn=ri,Wt=20;function En(){var ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Ee=ze/Me*ze;return isNaN(Ee)&&(Ee=0),Ee=Math.max(Ee,Wt),Math.floor(Ee)}var An=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],ci=[],It={overflowY:"auto",overflowAnchor:"none"};function Pt(ze,Me){var Ee=ze.prefixCls,Te=Ee===void 0?"rc-virtual-list":Ee,He=ze.className,Ae=ze.height,qe=ze.itemHeight,an=ze.fullHeight,Xt=an===void 0?!0:an,yn=ze.style,kt=ze.data,Dt=ze.children,Zt=ze.itemKey,hn=ze.virtual,wn=ze.direction,Dn=ze.scrollWidth,Tn=ze.component,Mi=Tn===void 0?"div":Tn,tn=ze.onScroll,qt=ze.onVirtualScroll,un=ze.onVisibleChange,zn=ze.innerProps,on=ze.extraRender,Sn=ze.styles,di=ze.showScrollBar,Ui=di===void 0?"optional":di,gi=(0,Oe.Z)(ze,An),Hi=ct.useCallback(function(Nn){return typeof Zt=="function"?Zt(Nn):Nn==null?void 0:Nn[Zt]},[Zt]),kr=Lt(Hi,null,null),Gn=(0,vt.Z)(kr,4),On=Gn[0],Xn=Gn[1],wi=Gn[2],nr=Gn[3],ji=!!(hn!==!1&&Ae&&qe),Cr=ct.useMemo(function(){return Object.values(wi.maps).reduce(function(Nn,pi){return Nn+pi},0)},[wi.id,wi.maps]),be=ji&&kt&&(Math.max(qe*kt.length,Cr)>Ae||!!Dn),mn=wn==="rtl",fi=Et()(Te,(0,bt.Z)({},"".concat(Te,"-rtl"),mn),He),Vn=kt||ci,si=(0,ct.useRef)(),Di=(0,ct.useRef)(),Ni=(0,ct.useRef)(),yr=(0,ct.useState)(0),zt=(0,vt.Z)(yr,2),Mt=zt[0],_t=zt[1],fn=(0,ct.useState)(0),Ji=(0,vt.Z)(fn,2),mi=Ji[0],$i=Ji[1],xn=(0,ct.useState)(!1),ni=(0,vt.Z)(xn,2),sr=ni[0],br=ni[1],Yn=function(){br(!0)},at=function(){br(!1)},Bt={getKey:Hi};function Kn(Nn){_t(function(pi){var vi;typeof Nn=="function"?vi=Nn(pi):vi=Nn;var ti=Qr(vi);return si.current.scrollTop=ti,ti})}var li=(0,ct.useRef)({start:0,end:Vn.length}),Qt=(0,ct.useRef)(),jt=ye(Vn,Hi),Un=(0,vt.Z)(jt,1),ai=Un[0];Qt.current=ai;var Vi=ct.useMemo(function(){if(!ji)return{scrollHeight:void 0,start:0,end:Vn.length-1,offset:void 0};if(!be){var Nn;return{scrollHeight:((Nn=Di.current)===null||Nn===void 0?void 0:Nn.offsetHeight)||0,start:0,end:Vn.length-1,offset:void 0}}for(var pi=0,vi,ti,ui,hi=Vn.length,Ti=0;Ti<hi;Ti+=1){var Yi=Vn[Ti],Pn=Hi(Yi),Rr=wi.get(Pn),cr=pi+(Rr===void 0?qe:Rr);cr>=Mt&&vi===void 0&&(vi=Ti,ti=pi),cr>Mt+Ae&&ui===void 0&&(ui=Ti),pi=cr}return vi===void 0&&(vi=0,ti=0,ui=Math.ceil(Ae/qe)),ui===void 0&&(ui=Vn.length-1),ui=Math.min(ui+1,Vn.length-1),{scrollHeight:pi,start:vi,end:ui,offset:ti}},[be,ji,Mt,Vn,nr,Ae]),xi=Vi.scrollHeight,Bi=Vi.start,Ii=Vi.end,Pr=Vi.offset;li.current.start=Bi,li.current.end=Ii,ct.useLayoutEffect(function(){var Nn=wi.getRecord();if(Nn.size===1){var pi=Array.from(Nn.keys())[0],vi=Nn.get(pi),ti=Vn[Bi];if(ti&&vi===void 0){var ui=Hi(ti);if(ui===pi){var hi=wi.get(pi),Ti=hi-qe;Kn(function(Yi){return Yi+Ti})}}}wi.resetRecord()},[xi]);var xr=ct.useState({width:0,height:Ae}),_n=(0,vt.Z)(xr,2),ki=_n[0],Ar=_n[1],Vr=function(pi){Ar({width:pi.offsetWidth,height:pi.offsetHeight})},xo=(0,ct.useRef)(),Ot=(0,ct.useRef)(),Li=ct.useMemo(function(){return En(ki.width,Dn)},[ki.width,Dn]),Sr=ct.useMemo(function(){return En(ki.height,xi)},[ki.height,xi]),Ri=xi-Ae,po=(0,ct.useRef)(Ri);po.current=Ri;function Qr(Nn){var pi=Nn;return Number.isNaN(po.current)||(pi=Math.min(pi,po.current)),pi=Math.max(pi,0),pi}var mo=Mt<=0,fo=Mt>=Ri,wo=mi<=0,Io=mi>=Dn,Bn=Ze(mo,fo,wo,Io),ca=function(){return{x:mn?-mi:mi,y:Mt}},In=(0,ct.useRef)(ca()),Er=(0,We.zX)(function(Nn){if(qt){var pi=(0,it.Z)((0,it.Z)({},ca()),Nn);(In.current.x!==pi.x||In.current.y!==pi.y)&&(qt(pi),In.current=pi)}});function Do(Nn,pi){var vi=Nn;pi?((0,At.flushSync)(function(){$i(vi)}),Er()):Kn(vi)}function wr(Nn){var pi=Nn.currentTarget.scrollTop;pi!==Mt&&Kn(pi),tn==null||tn(Nn),Er()}var Qo=function(pi){var vi=pi,ti=Dn?Dn-ki.width:0;return vi=Math.max(vi,0),vi=Math.min(vi,ti),vi},To=(0,We.zX)(function(Nn,pi){pi?((0,At.flushSync)(function(){$i(function(vi){var ti=vi+(mn?-Nn:Nn);return Qo(ti)})}),Er()):Kn(function(vi){var ti=vi+Nn;return ti})}),ro=lt(ji,mo,fo,wo,Io,!!Dn,To),fa=(0,vt.Z)(ro,2),Yt=fa[0],Rn=fa[1];en(ji,si,function(Nn,pi,vi,ti){var ui=ti;return Bn(Nn,pi,vi)?!1:!ui||!ui._virtualHandled?(ui&&(ui._virtualHandled=!0),Yt({preventDefault:function(){},deltaX:Nn?pi:0,deltaY:Nn?0:pi}),!0):!1}),nt(be,si,function(Nn){Kn(function(pi){return pi+Nn})}),(0,Tt.Z)(function(){function Nn(vi){var ti=mo&&vi.detail<0,ui=fo&&vi.detail>0;ji&&!ti&&!ui&&vi.preventDefault()}var pi=si.current;return pi.addEventListener("wheel",Yt,{passive:!1}),pi.addEventListener("DOMMouseScroll",Rn,{passive:!0}),pi.addEventListener("MozMousePixelScroll",Nn,{passive:!1}),function(){pi.removeEventListener("wheel",Yt),pi.removeEventListener("DOMMouseScroll",Rn),pi.removeEventListener("MozMousePixelScroll",Nn)}},[ji,mo,fo]),(0,Tt.Z)(function(){if(Dn){var Nn=Qo(mi);$i(Nn),Er({x:Nn})}},[ki.width,Dn]);var Rt=function(){var pi,vi;(pi=xo.current)===null||pi===void 0||pi.delayHidden(),(vi=Ot.current)===null||vi===void 0||vi.delayHidden()},Ie=dn(si,Vn,wi,qe,Hi,function(){return Xn(!0)},Kn,Rt);ct.useImperativeHandle(Me,function(){return{nativeElement:Ni.current,getScrollInfo:ca,scrollTo:function(pi){function vi(ti){return ti&&(0,Ke.Z)(ti)==="object"&&("left"in ti||"top"in ti)}vi(pi)?(pi.left!==void 0&&$i(Qo(pi.left)),Ie(pi.top)):Ie(pi)}}}),(0,Tt.Z)(function(){if(un){var Nn=Vn.slice(Bi,Ii+1);un(Nn,Vn)}},[Bi,Ii,Vn]);var qn=Qe(Vn,Hi,wi,qe),Ci=on==null?void 0:on({start:Bi,end:Ii,virtual:be,offsetX:mi,offsetY:Pr,rtl:mn,getSize:qn}),Oi=de(Vn,Bi,Ii,Dn,mi,On,Dt,Bt),qi=null;Ae&&(qi=(0,it.Z)((0,bt.Z)({},Xt?"height":"maxHeight",Ae),It),ji&&(qi.overflowY="hidden",Dn&&(qi.overflowX="hidden"),sr&&(qi.pointerEvents="none")));var zi={};return mn&&(zi.dir="rtl"),ct.createElement("div",(0,le.Z)({ref:Ni,style:(0,it.Z)((0,it.Z)({},yn),{},{position:"relative"}),className:fi},zi,gi),ct.createElement(ot.Z,{onResize:Vr},ct.createElement(Mi,{className:"".concat(Te,"-holder"),style:qi,ref:si,onScroll:wr,onMouseEnter:Rt},ct.createElement(ne,{prefixCls:Te,height:xi,offsetX:mi,offsetY:Pr,scrollWidth:Dn,onInnerResize:Xn,ref:Di,innerProps:zn,rtl:mn,extra:Ci},Oi))),be&&xi>Ae&&ct.createElement(Hn,{ref:xo,prefixCls:Te,scrollOffset:Mt,scrollRange:xi,rtl:mn,onScroll:Do,onStartMove:Yn,onStopMove:at,spinSize:Sr,containerSize:ki.height,style:Sn==null?void 0:Sn.verticalScrollBar,thumbStyle:Sn==null?void 0:Sn.verticalScrollBarThumb,showScrollBar:Ui}),be&&Dn>ki.width&&ct.createElement(Hn,{ref:Ot,prefixCls:Te,scrollOffset:mi,scrollRange:Dn,rtl:mn,onScroll:Do,onStartMove:Yn,onStopMove:at,spinSize:Li,containerSize:ki.width,horizontal:!0,style:Sn==null?void 0:Sn.horizontalScrollBar,thumbStyle:Sn==null?void 0:Sn.horizontalScrollBarThumb,showScrollBar:Ui}))}var Nt=ct.forwardRef(Pt);Nt.displayName="List";var ii=Nt,Gi=ii},22061:function(Zn,ei,Le){"use strict";Le.d(ei,{Z5:function(){return Vh},_l:function(){return eu},bK:function(){return Fs}});var le=Le(59301),Ke=Le(57629),it=Le(14809),bt=Le(59781),vt=le.createContext(null),Oe=null;function st(ve){ve()}var Et=st,ot=function(xe){return Et=xe},We=function(){return Et};function Tt(){var ve=We(),xe=null,Be=null;return{clear:function(){xe=null,Be=null},notify:function(){ve(function(){for(var et=xe;et;)et.callback(),et=et.next})},get:function(){for(var et=[],tt=xe;tt;)et.push(tt),tt=tt.next;return et},subscribe:function(et){var tt=!0,gt=Be={callback:et,next:null,prev:Be};return gt.prev?gt.prev.next=gt:xe=gt,function(){!tt||xe===null||(tt=!1,gt.next?gt.next.prev=gt.prev:Be=gt.prev,gt.prev?gt.prev.next=gt.next:xe=gt.next)}}}}var ct={notify:function(){},get:function(){return[]}};function At(ve,xe){var Be,je=ct;function et($t){return Jt(),je.subscribe($t)}function tt(){je.notify()}function gt(){cn.onStateChange&&cn.onStateChange()}function xt(){return!!Be}function Jt(){Be||(Be=xe?xe.addNestedSub(gt):ve.subscribe(gt),je=Tt())}function gn(){Be&&(Be(),Be=void 0,je.clear(),je=ct)}var cn={addNestedSub:et,notifyNestedSubs:tt,handleChangeWrapper:gt,isSubscribed:xt,trySubscribe:Jt,tryUnsubscribe:gn,getListeners:function(){return je}};return cn}var De=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?le.useLayoutEffect:le.useEffect;function ne(ve){var xe=ve.store,Be=ve.context,je=ve.children,et=(0,le.useMemo)(function(){var xt=At(xe);return{store:xe,subscription:xt}},[xe]),tt=(0,le.useMemo)(function(){return xe.getState()},[xe]);De(function(){var xt=et.subscription;return xt.onStateChange=xt.notifyNestedSubs,xt.trySubscribe(),tt!==xe.getState()&&xt.notifyNestedSubs(),function(){xt.tryUnsubscribe(),xt.onStateChange=null}},[et,tt]);var gt=Be||vt;return le.createElement(gt.Provider,{value:et},je)}var te=ne,de=Le(74126),se=Le(94266),ge=Le.n(se),ye=Le(53410),we=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],Ce=["reactReduxForwardedRef"],_e=[],Ze=[null,null],lt=function(xe){try{return JSON.stringify(xe)}catch(Be){return String(xe)}};function Qe(ve,xe){var Be=ve[1];return[xe.payload,Be+1]}function Ue(ve,xe,Be){De(function(){return ve.apply(void 0,xe)},Be)}function dt(ve,xe,Be,je,et,tt,gt){ve.current=je,xe.current=et,Be.current=!1,tt.current&&(tt.current=null,gt())}function $e(ve,xe,Be,je,et,tt,gt,xt,Jt,gn){if(ve){var cn=!1,$t=null,ln=function(){if(!cn){var Or=xe.getState(),Yr,eo;try{Yr=je(Or,et.current)}catch(No){eo=No,$t=No}eo||($t=null),Yr===tt.current?gt.current||Jt():(tt.current=Yr,xt.current=Yr,gt.current=!0,gn({type:"STORE_UPDATED",payload:{error:eo}}))}};Be.onStateChange=ln,Be.trySubscribe(),ln();var Cn=function(){if(cn=!0,Be.tryUnsubscribe(),Be.onStateChange=null,$t)throw $t};return Cn}}var wt=function(){return[null,0]};function St(ve,xe){xe===void 0&&(xe={});var Be=xe,je=Be.getDisplayName,et=je===void 0?function(da){return"ConnectAdvanced("+da+")"}:je,tt=Be.methodName,gt=tt===void 0?"connectAdvanced":tt,xt=Be.renderCountProp,Jt=xt===void 0?void 0:xt,gn=Be.shouldHandleStateChanges,cn=gn===void 0?!0:gn,$t=Be.storeKey,ln=$t===void 0?"store":$t,Cn=Be.withRef,Ai=Cn===void 0?!1:Cn,Or=Be.forwardRef,Yr=Or===void 0?!1:Or,eo=Be.context,No=eo===void 0?vt:eo,Ro=(0,de.Z)(Be,we);if(0)var Ho;var Ca=No;return function(es){var Js=es.displayName||es.name||"Component",is=et(Js),Ts=(0,it.Z)({},Ro,{getDisplayName:et,methodName:gt,renderCountProp:Jt,shouldHandleStateChanges:cn,storeKey:ln,displayName:is,wrappedComponentName:Js,WrappedComponent:es}),vl=Ro.pure;function Zl(_s){return ve(_s.dispatch,Ts)}var Bh=vl?le.useMemo:function(_s){return _s()};function Yu(_s){var Gl=(0,le.useMemo)(function(){var rl=_s.reactReduxForwardedRef,Qs=(0,de.Z)(_s,Ce);return[_s.context,rl,Qs]},[_s]),Ju=Gl[0],yl=Gl[1],Au=Gl[2],Jd=(0,le.useMemo)(function(){return Ju&&Ju.Consumer&&(0,ye.isContextConsumer)(le.createElement(Ju.Consumer,null))?Ju:Ca},[Ju,Ca]),Nu=(0,le.useContext)(Jd),$o=!!_s.store&&!!_s.store.getState&&!!_s.store.dispatch,xg=!!Nu&&!!Nu.store,Mh=$o?_s.store:Nu.store,Gc=(0,le.useMemo)(function(){return Zl(Mh)},[Mh]),Pd=(0,le.useMemo)(function(){if(!cn)return Ze;var rl=At(Mh,$o?null:Nu.subscription),Qs=rl.notifyNestedSubs.bind(rl);return[rl,Qs]},[Mh,$o,Nu]),kh=Pd[0],Du=Pd[1],Mf=(0,le.useMemo)(function(){return $o?Nu:(0,it.Z)({},Nu,{subscription:kh})},[$o,Nu,kh]),rp=(0,le.useReducer)(Qe,_e,wt),Gp=rp[0],kf=Gp[0],Om=rp[1];if(kf&&kf.error)throw kf.error;var Qd=(0,le.useRef)(),Sg=(0,le.useRef)(Au),Af=(0,le.useRef)(),wg=(0,le.useRef)(!1),$d=Bh(function(){return Af.current&&Au===Sg.current?Af.current:Gc(Mh.getState(),Au)},[Mh,kf,Au]);Ue(dt,[Sg,Qd,wg,Au,$d,Af,Du]),Ue($e,[cn,Mh,kh,Gc,Sg,Qd,wg,Af,Du,Om],[Mh,kh,Gc]);var Pg=(0,le.useMemo)(function(){return le.createElement(es,(0,it.Z)({},$d,{ref:yl}))},[yl,es,$d]),Na=(0,le.useMemo)(function(){return cn?le.createElement(Jd.Provider,{value:Mf},Pg):Pg},[Jd,Pg,Mf]);return Na}var tu=vl?le.memo(Yu):Yu;if(tu.WrappedComponent=es,tu.displayName=Yu.displayName=is,Yr){var Xu=le.forwardRef(function(Gl,Ju){return le.createElement(tu,(0,it.Z)({},Gl,{reactReduxForwardedRef:Ju}))});return Xu.displayName=is,Xu.WrappedComponent=es,ge()(Xu,es)}return ge()(tu,es)}}function Lt(ve,xe){return ve===xe?ve!==0||xe!==0||1/ve===1/xe:ve!==ve&&xe!==xe}function pn(ve,xe){if(Lt(ve,xe))return!0;if(typeof ve!="object"||ve===null||typeof xe!="object"||xe===null)return!1;var Be=Object.keys(ve),je=Object.keys(xe);if(Be.length!==je.length)return!1;for(var et=0;et<Be.length;et++)if(!Object.prototype.hasOwnProperty.call(xe,Be[et])||!Lt(ve[Be[et]],xe[Be[et]]))return!1;return!0}function en(ve,xe){var Be={},je=function(gt){var xt=ve[gt];typeof xt=="function"&&(Be[gt]=function(){return xe(xt.apply(void 0,arguments))})};for(var et in ve)je(et);return Be}function vn(ve){return function(Be,je){var et=ve(Be,je);function tt(){return et}return tt.dependsOnOwnProps=!1,tt}}function rn(ve){return ve.dependsOnOwnProps!==null&&ve.dependsOnOwnProps!==void 0?!!ve.dependsOnOwnProps:ve.length!==1}function nt(ve,xe){return function(je,et){var tt=et.displayName,gt=function(Jt,gn){return gt.dependsOnOwnProps?gt.mapToProps(Jt,gn):gt.mapToProps(Jt)};return gt.dependsOnOwnProps=!0,gt.mapToProps=function(Jt,gn){gt.mapToProps=ve,gt.dependsOnOwnProps=rn(ve);var cn=gt(Jt,gn);return typeof cn=="function"&&(gt.mapToProps=cn,gt.dependsOnOwnProps=rn(cn),cn=gt(Jt,gn)),cn},gt}}function rt(ve){return typeof ve=="function"?nt(ve,"mapDispatchToProps"):void 0}function dn(ve){return ve?void 0:vn(function(xe){return{dispatch:xe}})}function ri(ve){return ve&&typeof ve=="object"?vn(function(xe){return en(ve,xe)}):void 0}var Hn=[rt,dn,ri];function Wt(ve){return typeof ve=="function"?nt(ve,"mapStateToProps"):void 0}function En(ve){return ve?void 0:vn(function(){return{}})}var An=[Wt,En];function ci(ve,xe,Be){return(0,it.Z)({},Be,ve,xe)}function It(ve){return function(Be,je){var et=je.displayName,tt=je.pure,gt=je.areMergedPropsEqual,xt=!1,Jt;return function(cn,$t,ln){var Cn=ve(cn,$t,ln);return xt?(!tt||!gt(Cn,Jt))&&(Jt=Cn):(xt=!0,Jt=Cn),Jt}}}function Pt(ve){return typeof ve=="function"?It(ve):void 0}function Nt(ve){return ve?void 0:function(){return ci}}var ii=[Pt,Nt],Gi=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function ze(ve,xe,Be,je){return function(tt,gt){return Be(ve(tt,gt),xe(je,gt),gt)}}function Me(ve,xe,Be,je,et){var tt=et.areStatesEqual,gt=et.areOwnPropsEqual,xt=et.areStatePropsEqual,Jt=!1,gn,cn,$t,ln,Cn;function Ai(Ro,Ho){return gn=Ro,cn=Ho,$t=ve(gn,cn),ln=xe(je,cn),Cn=Be($t,ln,cn),Jt=!0,Cn}function Or(){return $t=ve(gn,cn),xe.dependsOnOwnProps&&(ln=xe(je,cn)),Cn=Be($t,ln,cn),Cn}function Yr(){return ve.dependsOnOwnProps&&($t=ve(gn,cn)),xe.dependsOnOwnProps&&(ln=xe(je,cn)),Cn=Be($t,ln,cn),Cn}function eo(){var Ro=ve(gn,cn),Ho=!xt(Ro,$t);return $t=Ro,Ho&&(Cn=Be($t,ln,cn)),Cn}function No(Ro,Ho){var Ca=!gt(Ho,cn),da=!tt(Ro,gn,Ho,cn);return gn=Ro,cn=Ho,Ca&&da?Or():Ca?Yr():da?eo():Cn}return function(Ho,Ca){return Jt?No(Ho,Ca):Ai(Ho,Ca)}}function Ee(ve,xe){var Be=xe.initMapStateToProps,je=xe.initMapDispatchToProps,et=xe.initMergeProps,tt=(0,de.Z)(xe,Gi),gt=Be(ve,tt),xt=je(ve,tt),Jt=et(ve,tt),gn=tt.pure?Me:ze;return gn(gt,xt,Jt,ve,tt)}var Te=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function He(ve,xe,Be){for(var je=xe.length-1;je>=0;je--){var et=xe[je](ve);if(et)return et}return function(tt,gt){throw new Error("Invalid value of type "+typeof ve+" for "+Be+" argument when connecting component "+gt.wrappedComponentName+".")}}function Ae(ve,xe){return ve===xe}function qe(ve){var xe=ve===void 0?{}:ve,Be=xe.connectHOC,je=Be===void 0?St:Be,et=xe.mapStateToPropsFactories,tt=et===void 0?An:et,gt=xe.mapDispatchToPropsFactories,xt=gt===void 0?Hn:gt,Jt=xe.mergePropsFactories,gn=Jt===void 0?ii:Jt,cn=xe.selectorFactory,$t=cn===void 0?Ee:cn;return function(Cn,Ai,Or,Yr){Yr===void 0&&(Yr={});var eo=Yr,No=eo.pure,Ro=No===void 0?!0:No,Ho=eo.areStatesEqual,Ca=Ho===void 0?Ae:Ho,da=eo.areOwnPropsEqual,es=da===void 0?pn:da,Js=eo.areStatePropsEqual,is=Js===void 0?pn:Js,Ts=eo.areMergedPropsEqual,vl=Ts===void 0?pn:Ts,Zl=(0,de.Z)(eo,Te),Bh=He(Cn,tt,"mapStateToProps"),Yu=He(Ai,xt,"mapDispatchToProps"),tu=He(Or,gn,"mergeProps");return je($t,(0,it.Z)({methodName:"connect",getDisplayName:function(_s){return"Connect("+_s+")"},shouldHandleStateChanges:!!Cn,initMapStateToProps:Bh,initMapDispatchToProps:Yu,initMergeProps:tu,pure:Ro,areStatesEqual:Ca,areOwnPropsEqual:es,areStatePropsEqual:is,areMergedPropsEqual:vl},Zl))}}var an=qe();function Xt(){var ve=useContext(ReactReduxContext);return ve}function yn(ve){ve===void 0&&(ve=ReactReduxContext);var xe=ve===ReactReduxContext?useDefaultReduxContext:function(){return useContext(ve)};return function(){var je=xe(),et=je.store;return et}}var kt=null;function Dt(ve){ve===void 0&&(ve=ReactReduxContext);var xe=ve===ReactReduxContext?useDefaultStore:createStoreHook(ve);return function(){var je=xe();return je.dispatch}}var Zt=null,hn=function(xe,Be){return xe===Be};function wn(ve,xe,Be,je){var et=useReducer(function(Ai){return Ai+1},0),tt=et[1],gt=useMemo(function(){return createSubscription(Be,je)},[Be,je]),xt=useRef(),Jt=useRef(),gn=useRef(),cn=useRef(),$t=Be.getState(),ln;try{if(ve!==Jt.current||$t!==gn.current||xt.current){var Cn=ve($t);cn.current===void 0||!xe(Cn,cn.current)?ln=Cn:ln=cn.current}else ln=cn.current}catch(Ai){throw xt.current&&(Ai.message+=`
The error may be correlated with this previous error:
`+xt.current.stack+`
`),Ai}return useIsomorphicLayoutEffect(function(){Jt.current=ve,gn.current=$t,cn.current=ln,xt.current=void 0}),useIsomorphicLayoutEffect(function(){function Ai(){try{var Or=Be.getState();if(Or===gn.current)return;var Yr=Jt.current(Or);if(xe(Yr,cn.current))return;cn.current=Yr,gn.current=Or}catch(eo){xt.current=eo}tt()}return gt.onStateChange=Ai,gt.trySubscribe(),Ai(),function(){return gt.tryUnsubscribe()}},[Be,gt]),ln}function Dn(ve){ve===void 0&&(ve=ReactReduxContext);var xe=ve===ReactReduxContext?useDefaultReduxContext:function(){return useContext(ve)};return function(je,et){et===void 0&&(et=hn);var tt=xe(),gt=tt.store,xt=tt.subscription,Jt=wn(je,et,gt,xt);return useDebugValue(Jt),Jt}}var Tn=null,Mi=Le(4676);ot(Mi.unstable_batchedUpdates);function tn(ve,xe){if(ve.length!==xe.length)return!1;for(var Be=0;Be<ve.length;Be++)if(ve[Be]!==xe[Be])return!1;return!0}function qt(ve,xe){var Be=(0,le.useState)(function(){return{inputs:xe,result:ve()}})[0],je=(0,le.useRef)(!0),et=(0,le.useRef)(Be),tt=je.current||!!(xe&&et.current.inputs&&tn(xe,et.current.inputs)),gt=tt?et.current:{inputs:xe,result:ve()};return(0,le.useEffect)(function(){je.current=!1,et.current=gt},[gt]),gt.result}function un(ve,xe){return qt(function(){return ve},xe)}var zn=qt,on=un,Sn=!0,di="Invariant failed";function Ui(ve,xe){if(!ve){if(Sn)throw new Error(di);var Be=typeof xe=="function"?xe():xe,je=Be?"".concat(di,": ").concat(Be):di;throw new Error(je)}}var gi=function(xe){var Be=xe.top,je=xe.right,et=xe.bottom,tt=xe.left,gt=je-tt,xt=et-Be,Jt={top:Be,right:je,bottom:et,left:tt,width:gt,height:xt,x:tt,y:Be,center:{x:(je+tt)/2,y:(et+Be)/2}};return Jt},Hi=function(xe,Be){return{top:xe.top-Be.top,left:xe.left-Be.left,bottom:xe.bottom+Be.bottom,right:xe.right+Be.right}},kr=function(xe,Be){return{top:xe.top+Be.top,left:xe.left+Be.left,bottom:xe.bottom-Be.bottom,right:xe.right-Be.right}},Gn=function(xe,Be){return{top:xe.top+Be.y,left:xe.left+Be.x,bottom:xe.bottom+Be.y,right:xe.right+Be.x}},On={top:0,right:0,bottom:0,left:0},Xn=function(xe){var Be=xe.borderBox,je=xe.margin,et=je===void 0?On:je,tt=xe.border,gt=tt===void 0?On:tt,xt=xe.padding,Jt=xt===void 0?On:xt,gn=gi(Hi(Be,et)),cn=gi(kr(Be,gt)),$t=gi(kr(cn,Jt));return{marginBox:gn,borderBox:gi(Be),paddingBox:cn,contentBox:$t,margin:et,border:gt,padding:Jt}},wi=function(xe){var Be=xe.slice(0,-2),je=xe.slice(-2);if(je!=="px")return 0;var et=Number(Be);return isNaN(et)&&Ui(!1),et},nr=function(){return{x:window.pageXOffset,y:window.pageYOffset}},ji=function(xe,Be){var je=xe.borderBox,et=xe.border,tt=xe.margin,gt=xe.padding,xt=Gn(je,Be);return Xn({borderBox:xt,border:et,margin:tt,padding:gt})},Cr=function(xe,Be){return Be===void 0&&(Be=nr()),ji(xe,Be)},be=function(xe,Be){var je={top:wi(Be.marginTop),right:wi(Be.marginRight),bottom:wi(Be.marginBottom),left:wi(Be.marginLeft)},et={top:wi(Be.paddingTop),right:wi(Be.paddingRight),bottom:wi(Be.paddingBottom),left:wi(Be.paddingLeft)},tt={top:wi(Be.borderTopWidth),right:wi(Be.borderRightWidth),bottom:wi(Be.borderBottomWidth),left:wi(Be.borderLeftWidth)};return Xn({borderBox:xe,margin:je,padding:et,border:tt})},mn=function(xe){var Be=xe.getBoundingClientRect(),je=window.getComputedStyle(xe);return be(Be,je)},fi=Number.isNaN||function(xe){return typeof xe=="number"&&xe!==xe};function Vn(ve,xe){return!!(ve===xe||fi(ve)&&fi(xe))}function si(ve,xe){if(ve.length!==xe.length)return!1;for(var Be=0;Be<ve.length;Be++)if(!Vn(ve[Be],xe[Be]))return!1;return!0}function Di(ve,xe){xe===void 0&&(xe=si);var Be,je=[],et,tt=!1;function gt(){for(var xt=[],Jt=0;Jt<arguments.length;Jt++)xt[Jt]=arguments[Jt];return tt&&Be===this&&xe(xt,je)||(et=ve.apply(this,xt),tt=!0,Be=this,je=xt),et}return gt}var Ni=Di,yr=function(xe){var Be=[],je=null,et=function(){for(var gt=arguments.length,xt=new Array(gt),Jt=0;Jt<gt;Jt++)xt[Jt]=arguments[Jt];Be=xt,!je&&(je=requestAnimationFrame(function(){je=null,xe.apply(void 0,Be)}))};return et.cancel=function(){je&&(cancelAnimationFrame(je),je=null)},et},zt=yr,Mt=!0,_t=/[ \t]{2,}/g,fn=/^[ \t]*/gm,Ji=function(xe){return xe.replace(_t," ").replace(fn,"").trim()},mi=function(xe){return Ji(`
%creact-beautiful-dnd
%c`+Ji(xe)+`
%c\u{1F477}\u200D This is a development only message. It will be removed in production builds.
`)},$i=function(xe){return[mi(xe),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"]},xn="__react-beautiful-dnd-disable-dev-warnings";function ni(ve,xe){var Be;Mt||typeof window!="undefined"&&window[xn]||(Be=console)[ve].apply(Be,$i(xe))}var sr=ni.bind(null,"warn"),br=ni.bind(null,"error");function Yn(){}function at(ve,xe){return(0,it.Z)({},ve,{},xe)}function Bt(ve,xe,Be){var je=xe.map(function(et){var tt=at(Be,et.options);return ve.addEventListener(et.eventName,et.fn,tt),function(){ve.removeEventListener(et.eventName,et.fn,tt)}});return function(){je.forEach(function(tt){tt()})}}var Kn=!0,li="Invariant failed";function Qt(ve){this.message=ve}Qt.prototype.toString=function(){return this.message};function jt(ve,xe){if(!ve)throw Kn?new Qt(li):new Qt(li+": "+(xe||""))}var Un=function(ve){(0,Ke.Z)(xe,ve);function xe(){for(var je,et=arguments.length,tt=new Array(et),gt=0;gt<et;gt++)tt[gt]=arguments[gt];return je=ve.call.apply(ve,[this].concat(tt))||this,je.callbacks=null,je.unbind=Yn,je.onWindowError=function(xt){var Jt=je.getCallbacks();Jt.isDragging()&&Jt.tryAbort();var gn=xt.error;gn instanceof Qt&&xt.preventDefault()},je.getCallbacks=function(){if(!je.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return je.callbacks},je.setCallbacks=function(xt){je.callbacks=xt},je}var Be=xe.prototype;return Be.componentDidMount=function(){this.unbind=Bt(window,[{eventName:"error",fn:this.onWindowError}])},Be.componentWillUnmount=function(){this.unbind()},Be.componentDidCatch=function(et){if(et instanceof Qt){this.setState({});return}throw et},Be.render=function(){return this.props.children(this.setCallbacks)},xe}(le.Component),ai=`
Press space bar to start a drag.
When dragging you can use the arrow keys to move the item around and escape to cancel.
Some screen readers may require you to be in focus mode or to use your pass through key
`,Vi=function(xe){return xe+1},xi=function(xe){return`
You have lifted an item in position `+Vi(xe.source.index)+`
`},Bi=function(xe,Be){var je=xe.droppableId===Be.droppableId,et=Vi(xe.index),tt=Vi(Be.index);return je?`
You have moved the item from position `+et+`
to position `+tt+`
`:`
You have moved the item from position `+et+`
in list `+xe.droppableId+`
to list `+Be.droppableId+`
in position `+tt+`
`},Ii=function(xe,Be,je){var et=Be.droppableId===je.droppableId;return et?`
The item `+xe+`
has been combined with `+je.draggableId:`
The item `+xe+`
in list `+Be.droppableId+`
has been combined with `+je.draggableId+`
in list `+je.droppableId+`
`},Pr=function(xe){var Be=xe.destination;if(Be)return Bi(xe.source,Be);var je=xe.combine;return je?Ii(xe.draggableId,xe.source,je):"You are over an area that cannot be dropped on"},xr=function(xe){return`
The item has returned to its starting position
of `+Vi(xe.index)+`
`},_n=function(xe){if(xe.reason==="CANCEL")return`
Movement cancelled.
`+xr(xe.source)+`
`;var Be=xe.destination,je=xe.combine;return Be?`
You have dropped the item.
`+Bi(xe.source,Be)+`
`:je?`
You have dropped the item.
`+Ii(xe.draggableId,xe.source,je)+`
`:`
The item has been dropped while not over a drop area.
`+xr(xe.source)+`
`},ki={dragHandleUsageInstructions:ai,onDragStart:xi,onDragUpdate:Pr,onDragEnd:_n},Ar={x:0,y:0},Vr=function(xe,Be){return{x:xe.x+Be.x,y:xe.y+Be.y}},xo=function(xe,Be){return{x:xe.x-Be.x,y:xe.y-Be.y}},Ot=function(xe,Be){return xe.x===Be.x&&xe.y===Be.y},Li=function(xe){return{x:xe.x!==0?-xe.x:0,y:xe.y!==0?-xe.y:0}},Sr=function(xe,Be,je){var et;return je===void 0&&(je=0),et={},et[xe]=Be,et[xe==="x"?"y":"x"]=je,et},Ri=function(xe,Be){return Math.sqrt(Math.pow(Be.x-xe.x,2)+Math.pow(Be.y-xe.y,2))},po=function(xe,Be){return Math.min.apply(Math,Be.map(function(je){return Ri(xe,je)}))},Qr=function(xe){return function(Be){return{x:xe(Be.x),y:xe(Be.y)}}},mo=function(ve,xe){var Be=gi({top:Math.max(xe.top,ve.top),right:Math.min(xe.right,ve.right),bottom:Math.min(xe.bottom,ve.bottom),left:Math.max(xe.left,ve.left)});return Be.width<=0||Be.height<=0?null:Be},fo=function(xe,Be){return{top:xe.top+Be.y,left:xe.left+Be.x,bottom:xe.bottom+Be.y,right:xe.right+Be.x}},wo=function(xe){return[{x:xe.left,y:xe.top},{x:xe.right,y:xe.top},{x:xe.left,y:xe.bottom},{x:xe.right,y:xe.bottom}]},Io={top:0,right:0,bottom:0,left:0},Bn=function(xe,Be){return Be?fo(xe,Be.scroll.diff.displacement):xe},ca=function(xe,Be,je){if(je&&je.increasedBy){var et;return(0,it.Z)({},xe,(et={},et[Be.end]=xe[Be.end]+je.increasedBy[Be.line],et))}return xe},In=function(xe,Be){return Be&&Be.shouldClipSubject?mo(Be.pageMarginBox,xe):gi(xe)},Er=function(ve){var xe=ve.page,Be=ve.withPlaceholder,je=ve.axis,et=ve.frame,tt=Bn(xe.marginBox,et),gt=ca(tt,je,Be),xt=In(gt,et);return{page:xe,withPlaceholder:Be,active:xt}},Do=function(ve,xe){ve.frame||jt(!1);var Be=ve.frame,je=xo(xe,Be.scroll.initial),et=Li(je),tt=(0,it.Z)({},Be,{scroll:{initial:Be.scroll.initial,current:xe,diff:{value:je,displacement:et},max:Be.scroll.max}}),gt=Er({page:ve.subject.page,withPlaceholder:ve.subject.withPlaceholder,axis:ve.axis,frame:tt}),xt=(0,it.Z)({},ve,{frame:tt,subject:gt});return xt};function wr(ve){return Number.isInteger?Number.isInteger(ve):typeof ve=="number"&&isFinite(ve)&&Math.floor(ve)===ve}function Qo(ve){return Object.values?Object.values(ve):Object.keys(ve).map(function(xe){return ve[xe]})}function To(ve,xe){if(ve.findIndex)return ve.findIndex(xe);for(var Be=0;Be<ve.length;Be++)if(xe(ve[Be]))return Be;return-1}function ro(ve,xe){if(ve.find)return ve.find(xe);var Be=To(ve,xe);if(Be!==-1)return ve[Be]}function fa(ve){return Array.prototype.slice.call(ve)}var Yt=Ni(function(ve){return ve.reduce(function(xe,Be){return xe[Be.descriptor.id]=Be,xe},{})}),Rn=Ni(function(ve){return ve.reduce(function(xe,Be){return xe[Be.descriptor.id]=Be,xe},{})}),Rt=Ni(function(ve){return Qo(ve)}),Ie=Ni(function(ve){return Qo(ve)}),qn=Ni(function(ve,xe){var Be=Ie(xe).filter(function(je){return ve===je.descriptor.droppableId}).sort(function(je,et){return je.descriptor.index-et.descriptor.index});return Be});function Ci(ve){return ve.at&&ve.at.type==="REORDER"?ve.at.destination:null}function Oi(ve){return ve.at&&ve.at.type==="COMBINE"?ve.at.combine:null}var qi=Ni(function(ve,xe){return xe.filter(function(Be){return Be.descriptor.id!==ve.descriptor.id})}),zi=function(ve){var xe=ve.isMovingForward,Be=ve.draggable,je=ve.destination,et=ve.insideDestination,tt=ve.previousImpact;if(!je.isCombineEnabled)return null;var gt=Ci(tt);if(!gt)return null;function xt(Or){var Yr={type:"COMBINE",combine:{draggableId:Or,droppableId:je.descriptor.id}};return(0,it.Z)({},tt,{at:Yr})}var Jt=tt.displaced.all,gn=Jt.length?Jt[0]:null;if(xe)return gn?xt(gn):null;var cn=qi(Be,et);if(!gn){if(!cn.length)return null;var $t=cn[cn.length-1];return xt($t.descriptor.id)}var ln=To(cn,function(Or){return Or.descriptor.id===gn});ln===-1&&jt(!1);var Cn=ln-1;if(Cn<0)return null;var Ai=cn[Cn];return xt(Ai.descriptor.id)},Nn=function(ve,xe){return ve.descriptor.droppableId===xe.descriptor.id},pi={point:Ar,value:0},vi={invisible:{},visible:{},all:[]},ti={displaced:vi,displacedBy:pi,at:null},ui=function(ve,xe){return function(Be){return ve<=Be&&Be<=xe}},hi=function(ve){var xe=ui(ve.top,ve.bottom),Be=ui(ve.left,ve.right);return function(je){var et=xe(je.top)&&xe(je.bottom)&&Be(je.left)&&Be(je.right);if(et)return!0;var tt=xe(je.top)||xe(je.bottom),gt=Be(je.left)||Be(je.right),xt=tt&&gt;if(xt)return!0;var Jt=je.top<ve.top&&je.bottom>ve.bottom,gn=je.left<ve.left&&je.right>ve.right,cn=Jt&&gn;if(cn)return!0;var $t=Jt&&gt||gn&&tt;return $t}},Ti=function(ve){var xe=ui(ve.top,ve.bottom),Be=ui(ve.left,ve.right);return function(je){var et=xe(je.top)&&xe(je.bottom)&&Be(je.left)&&Be(je.right);return et}},Yi={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Pn={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},Rr=function(ve){return function(xe){var Be=ui(xe.top,xe.bottom),je=ui(xe.left,xe.right);return function(et){return ve===Yi?Be(et.top)&&Be(et.bottom):je(et.left)&&je(et.right)}}},cr=function(xe,Be){var je=Be.frame?Be.frame.scroll.diff.displacement:Ar;return fo(xe,je)},Mo=function(xe,Be,je){return Be.subject.active?je(Be.subject.active)(xe):!1},Wr=function(xe,Be,je){return je(Be)(xe)},Vo=function(xe){var Be=xe.target,je=xe.destination,et=xe.viewport,tt=xe.withDroppableDisplacement,gt=xe.isVisibleThroughFrameFn,xt=tt?cr(Be,je):Be;return Mo(xt,je,gt)&&Wr(xt,et,gt)},Wo=function(xe){return Vo((0,it.Z)({},xe,{isVisibleThroughFrameFn:hi}))},ua=function(xe){return Vo((0,it.Z)({},xe,{isVisibleThroughFrameFn:Ti}))},Xo=function(xe){return Vo((0,it.Z)({},xe,{isVisibleThroughFrameFn:Rr(xe.destination.axis)}))},aa=function(xe,Be,je){if(typeof je=="boolean")return je;if(!Be)return!0;var et=Be.invisible,tt=Be.visible;if(et[xe])return!1;var gt=tt[xe];return gt?gt.shouldAnimate:!0};function Pa(ve,xe){var Be=ve.page.marginBox,je={top:xe.point.y,right:0,bottom:0,left:xe.point.x};return gi(Hi(Be,je))}function Gt(ve){var xe=ve.afterDragging,Be=ve.destination,je=ve.displacedBy,et=ve.viewport,tt=ve.forceShouldAnimate,gt=ve.last;return xe.reduce(function(Jt,gn){var cn=Pa(gn,je),$t=gn.descriptor.id;Jt.all.push($t);var ln=Wo({target:cn,destination:Be,viewport:et,withDroppableDisplacement:!0});if(!ln)return Jt.invisible[gn.descriptor.id]=!0,Jt;var Cn=aa($t,gt,tt),Ai={draggableId:$t,shouldAnimate:Cn};return Jt.visible[$t]=Ai,Jt},{all:[],visible:{},invisible:{}})}function qo(ve,xe){if(!ve.length)return 0;var Be=ve[ve.length-1].descriptor.index;return xe.inHomeList?Be:Be+1}function fr(ve){var xe=ve.insideDestination,Be=ve.inHomeList,je=ve.displacedBy,et=ve.destination,tt=qo(xe,{inHomeList:Be});return{displaced:vi,displacedBy:je,at:{type:"REORDER",destination:{droppableId:et.descriptor.id,index:tt}}}}function ao(ve){var xe=ve.draggable,Be=ve.insideDestination,je=ve.destination,et=ve.viewport,tt=ve.displacedBy,gt=ve.last,xt=ve.index,Jt=ve.forceShouldAnimate,gn=Nn(xe,je);if(xt==null)return fr({insideDestination:Be,inHomeList:gn,displacedBy:tt,destination:je});var cn=ro(Be,function(Or){return Or.descriptor.index===xt});if(!cn)return fr({insideDestination:Be,inHomeList:gn,displacedBy:tt,destination:je});var $t=qi(xe,Be),ln=Be.indexOf(cn),Cn=$t.slice(ln),Ai=Gt({afterDragging:Cn,destination:je,displacedBy:tt,last:gt,viewport:et.frame,forceShouldAnimate:Jt});return{displaced:Ai,displacedBy:tt,at:{type:"REORDER",destination:{droppableId:je.descriptor.id,index:xt}}}}function zr(ve,xe){return!!xe.effected[ve]}var Jo=function(ve){var xe=ve.isMovingForward,Be=ve.destination,je=ve.draggables,et=ve.combine,tt=ve.afterCritical;if(!Be.isCombineEnabled)return null;var gt=et.draggableId,xt=je[gt],Jt=xt.descriptor.index,gn=zr(gt,tt);return gn?xe?Jt:Jt-1:xe?Jt+1:Jt},va=function(ve){var xe=ve.isMovingForward,Be=ve.isInHomeList,je=ve.insideDestination,et=ve.location;if(!je.length)return null;var tt=et.index,gt=xe?tt+1:tt-1,xt=je[0].descriptor.index,Jt=je[je.length-1].descriptor.index,gn=Be?Jt:Jt+1;return gt<xt||gt>gn?null:gt},ma=function(ve){var xe=ve.isMovingForward,Be=ve.isInHomeList,je=ve.draggable,et=ve.draggables,tt=ve.destination,gt=ve.insideDestination,xt=ve.previousImpact,Jt=ve.viewport,gn=ve.afterCritical,cn=xt.at;if(cn||jt(!1),cn.type==="REORDER"){var $t=va({isMovingForward:xe,isInHomeList:Be,location:cn.destination,insideDestination:gt});return $t==null?null:ao({draggable:je,insideDestination:gt,destination:tt,viewport:Jt,last:xt.displaced,displacedBy:xt.displacedBy,index:$t})}var ln=Jo({isMovingForward:xe,destination:tt,displaced:xt.displaced,draggables:et,combine:cn.combine,afterCritical:gn});return ln==null?null:ao({draggable:je,insideDestination:gt,destination:tt,viewport:Jt,last:xt.displaced,displacedBy:xt.displacedBy,index:ln})},ko=function(ve){var xe=ve.displaced,Be=ve.afterCritical,je=ve.combineWith,et=ve.displacedBy,tt=!!(xe.visible[je]||xe.invisible[je]);return zr(je,Be)?tt?Ar:Li(et.point):tt?et.point:Ar},So=function(ve){var xe=ve.afterCritical,Be=ve.impact,je=ve.draggables,et=Oi(Be);et||jt(!1);var tt=et.draggableId,gt=je[tt].page.borderBox.center,xt=ko({displaced:Be.displaced,afterCritical:xe,combineWith:tt,displacedBy:Be.displacedBy});return Vr(gt,xt)},$a=function(xe,Be){return Be.margin[xe.start]+Be.borderBox[xe.size]/2},gs=function(xe,Be){return Be.margin[xe.end]+Be.borderBox[xe.size]/2},ls=function(xe,Be,je){return Be[xe.crossAxisStart]+je.margin[xe.crossAxisStart]+je.borderBox[xe.crossAxisSize]/2},ps=function(xe){var Be=xe.axis,je=xe.moveRelativeTo,et=xe.isMoving;return Sr(Be.line,je.marginBox[Be.end]+$a(Be,et),ls(Be,je.marginBox,et))},$r=function(xe){var Be=xe.axis,je=xe.moveRelativeTo,et=xe.isMoving;return Sr(Be.line,je.marginBox[Be.start]-gs(Be,et),ls(Be,je.marginBox,et))},Ka=function(xe){var Be=xe.axis,je=xe.moveInto,et=xe.isMoving;return Sr(Be.line,je.contentBox[Be.start]+$a(Be,et),ls(Be,je.contentBox,et))},Ma=function(ve){var xe=ve.impact,Be=ve.draggable,je=ve.draggables,et=ve.droppable,tt=ve.afterCritical,gt=qn(et.descriptor.id,je),xt=Be.page,Jt=et.axis;if(!gt.length)return Ka({axis:Jt,moveInto:et.page,isMoving:xt});var gn=xe.displaced,cn=xe.displacedBy,$t=gn.all[0];if($t){var ln=je[$t];if(zr($t,tt))return $r({axis:Jt,moveRelativeTo:ln.page,isMoving:xt});var Cn=ji(ln.page,cn.point);return $r({axis:Jt,moveRelativeTo:Cn,isMoving:xt})}var Ai=gt[gt.length-1];if(Ai.descriptor.id===Be.descriptor.id)return xt.borderBox.center;if(zr(Ai.descriptor.id,tt)){var Or=ji(Ai.page,Li(tt.displacedBy.point));return ps({axis:Jt,moveRelativeTo:Or,isMoving:xt})}return ps({axis:Jt,moveRelativeTo:Ai.page,isMoving:xt})},ns=function(ve,xe){var Be=ve.frame;return Be?Vr(xe,Be.scroll.diff.displacement):xe},qa=function(xe){var Be=xe.impact,je=xe.draggable,et=xe.droppable,tt=xe.draggables,gt=xe.afterCritical,xt=je.page.borderBox.center,Jt=Be.at;return!et||!Jt?xt:Jt.type==="REORDER"?Ma({impact:Be,draggable:je,draggables:tt,droppable:et,afterCritical:gt}):So({impact:Be,draggables:tt,afterCritical:gt})},ts=function(ve){var xe=qa(ve),Be=ve.droppable,je=Be?ns(Be,xe):xe;return je},Xi=function(ve,xe){var Be=xo(xe,ve.scroll.initial),je=Li(Be),et=gi({top:xe.y,bottom:xe.y+ve.frame.height,left:xe.x,right:xe.x+ve.frame.width}),tt={frame:et,scroll:{initial:ve.scroll.initial,max:ve.scroll.max,current:xe,diff:{value:Be,displacement:je}}};return tt};function Xr(ve,xe){return ve.map(function(Be){return xe[Be]})}function Co(ve,xe){for(var Be=0;Be<xe.length;Be++){var je=xe[Be].visible[ve];if(je)return je}return null}var Zo=function(ve){var xe=ve.impact,Be=ve.viewport,je=ve.destination,et=ve.draggables,tt=ve.maxScrollChange,gt=Xi(Be,Vr(Be.scroll.current,tt)),xt=je.frame?Do(je,Vr(je.frame.scroll.current,tt)):je,Jt=xe.displaced,gn=Gt({afterDragging:Xr(Jt.all,et),destination:je,displacedBy:xe.displacedBy,viewport:gt.frame,last:Jt,forceShouldAnimate:!1}),cn=Gt({afterDragging:Xr(Jt.all,et),destination:xt,displacedBy:xe.displacedBy,viewport:Be.frame,last:Jt,forceShouldAnimate:!1}),$t={},ln={},Cn=[Jt,gn,cn];Jt.all.forEach(function(Or){var Yr=Co(Or,Cn);if(Yr){ln[Or]=Yr;return}$t[Or]=!0});var Ai=(0,it.Z)({},xe,{displaced:{all:Jt.all,invisible:$t,visible:ln}});return Ai},Ko=function(ve,xe){return Vr(ve.scroll.diff.displacement,xe)},ba=function(ve){var xe=ve.pageBorderBoxCenter,Be=ve.draggable,je=ve.viewport,et=Ko(je,xe),tt=xo(et,Be.page.borderBox.center);return Vr(Be.client.borderBox.center,tt)},Kr=function(ve){var xe=ve.draggable,Be=ve.destination,je=ve.newPageBorderBoxCenter,et=ve.viewport,tt=ve.withDroppableDisplacement,gt=ve.onlyOnMainAxis,xt=gt===void 0?!1:gt,Jt=xo(je,xe.page.borderBox.center),gn=fo(xe.page.borderBox,Jt),cn={target:gn,destination:Be,withDroppableDisplacement:tt,viewport:et};return xt?Xo(cn):ua(cn)},Rs=function(ve){var xe=ve.isMovingForward,Be=ve.draggable,je=ve.destination,et=ve.draggables,tt=ve.previousImpact,gt=ve.viewport,xt=ve.previousPageBorderBoxCenter,Jt=ve.previousClientSelection,gn=ve.afterCritical;if(!je.isEnabled)return null;var cn=qn(je.descriptor.id,et),$t=Nn(Be,je),ln=zi({isMovingForward:xe,draggable:Be,destination:je,insideDestination:cn,previousImpact:tt})||ma({isMovingForward:xe,isInHomeList:$t,draggable:Be,draggables:et,destination:je,insideDestination:cn,previousImpact:tt,viewport:gt,afterCritical:gn});if(!ln)return null;var Cn=ts({impact:ln,draggable:Be,droppable:je,draggables:et,afterCritical:gn}),Ai=Kr({draggable:Be,destination:je,newPageBorderBoxCenter:Cn,viewport:gt.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(Ai){var Or=ba({pageBorderBoxCenter:Cn,draggable:Be,viewport:gt});return{clientSelection:Or,impact:ln,scrollJumpRequest:null}}var Yr=xo(Cn,xt),eo=Zo({impact:ln,viewport:gt,destination:je,draggables:et,maxScrollChange:Yr});return{clientSelection:Jt,impact:eo,scrollJumpRequest:Yr}},Za=function(xe){var Be=xe.subject.active;return Be||jt(!1),Be},nn=function(ve){var xe=ve.isMovingForward,Be=ve.pageBorderBoxCenter,je=ve.source,et=ve.droppables,tt=ve.viewport,gt=je.subject.active;if(!gt)return null;var xt=je.axis,Jt=ui(gt[xt.start],gt[xt.end]),gn=Rt(et).filter(function($t){return $t!==je}).filter(function($t){return $t.isEnabled}).filter(function($t){return!!$t.subject.active}).filter(function($t){return hi(tt.frame)(Za($t))}).filter(function($t){var ln=Za($t);return xe?gt[xt.crossAxisEnd]<ln[xt.crossAxisEnd]:ln[xt.crossAxisStart]<gt[xt.crossAxisStart]}).filter(function($t){var ln=Za($t),Cn=ui(ln[xt.start],ln[xt.end]);return Jt(ln[xt.start])||Jt(ln[xt.end])||Cn(gt[xt.start])||Cn(gt[xt.end])}).sort(function($t,ln){var Cn=Za($t)[xt.crossAxisStart],Ai=Za(ln)[xt.crossAxisStart];return xe?Cn-Ai:Ai-Cn}).filter(function($t,ln,Cn){return Za($t)[xt.crossAxisStart]===Za(Cn[0])[xt.crossAxisStart]});if(!gn.length)return null;if(gn.length===1)return gn[0];var cn=gn.filter(function($t){var ln=ui(Za($t)[xt.start],Za($t)[xt.end]);return ln(Be[xt.line])});return cn.length===1?cn[0]:cn.length>1?cn.sort(function($t,ln){return Za($t)[xt.start]-Za(ln)[xt.start]})[0]:gn.sort(function($t,ln){var Cn=po(Be,wo(Za($t))),Ai=po(Be,wo(Za(ln)));return Cn!==Ai?Cn-Ai:Za($t)[xt.start]-Za(ln)[xt.start]})[0]},Ht=function(xe,Be){var je=xe.page.borderBox.center;return zr(xe.descriptor.id,Be)?xo(je,Be.displacedBy.point):je},Fn=function(xe,Be){var je=xe.page.borderBox;return zr(xe.descriptor.id,Be)?fo(je,Li(Be.displacedBy.point)):je},Wi=function(ve){var xe=ve.pageBorderBoxCenter,Be=ve.viewport,je=ve.destination,et=ve.insideDestination,tt=ve.afterCritical,gt=et.filter(function(xt){return ua({target:Fn(xt,tt),destination:je,viewport:Be.frame,withDroppableDisplacement:!0})}).sort(function(xt,Jt){var gn=Ri(xe,ns(je,Ht(xt,tt))),cn=Ri(xe,ns(je,Ht(Jt,tt)));return gn<cn?-1:cn<gn?1:xt.descriptor.index-Jt.descriptor.index});return gt[0]||null},Si=Ni(function(xe,Be){var je=Be[xe.line];return{value:je,point:Sr(xe.line,je)}}),_i=function(xe,Be,je){var et=xe.axis;if(xe.descriptor.mode==="virtual")return Sr(et.line,Be[et.line]);var tt=xe.subject.page.contentBox[et.size],gt=qn(xe.descriptor.id,je),xt=gt.reduce(function(cn,$t){return cn+$t.client.marginBox[et.size]},0),Jt=xt+Be[et.line],gn=Jt-tt;return gn<=0?null:Sr(et.line,gn)},Pi=function(xe,Be){return(0,it.Z)({},xe,{scroll:(0,it.Z)({},xe.scroll,{max:Be})})},Ln=function(xe,Be,je){var et=xe.frame;Nn(Be,xe)&&jt(!1),xe.subject.withPlaceholder&&jt(!1);var tt=Si(xe.axis,Be.displaceBy).point,gt=_i(xe,tt,je),xt={placeholderSize:tt,increasedBy:gt,oldFrameMaxScroll:xe.frame?xe.frame.scroll.max:null};if(!et){var Jt=Er({page:xe.subject.page,withPlaceholder:xt,axis:xe.axis,frame:xe.frame});return(0,it.Z)({},xe,{subject:Jt})}var gn=gt?Vr(et.scroll.max,gt):et.scroll.max,cn=Pi(et,gn),$t=Er({page:xe.subject.page,withPlaceholder:xt,axis:xe.axis,frame:cn});return(0,it.Z)({},xe,{subject:$t,frame:cn})},oi=function(xe){var Be=xe.subject.withPlaceholder;Be||jt(!1);var je=xe.frame;if(!je){var et=Er({page:xe.subject.page,axis:xe.axis,frame:null,withPlaceholder:null});return(0,it.Z)({},xe,{subject:et})}var tt=Be.oldFrameMaxScroll;tt||jt(!1);var gt=Pi(je,tt),xt=Er({page:xe.subject.page,axis:xe.axis,frame:gt,withPlaceholder:null});return(0,it.Z)({},xe,{subject:xt,frame:gt})},ur=function(ve){var xe=ve.previousPageBorderBoxCenter,Be=ve.moveRelativeTo,je=ve.insideDestination,et=ve.draggable,tt=ve.draggables,gt=ve.destination,xt=ve.viewport,Jt=ve.afterCritical;if(!Be){if(je.length)return null;var gn={displaced:vi,displacedBy:pi,at:{type:"REORDER",destination:{droppableId:gt.descriptor.id,index:0}}},cn=ts({impact:gn,draggable:et,droppable:gt,draggables:tt,afterCritical:Jt}),$t=Nn(et,gt)?gt:Ln(gt,et,tt),ln=Kr({draggable:et,destination:$t,newPageBorderBoxCenter:cn,viewport:xt.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return ln?gn:null}var Cn=xe[gt.axis.line]<=Be.page.borderBox.center[gt.axis.line],Ai=function(){var Yr=Be.descriptor.index;return Be.descriptor.id===et.descriptor.id||Cn?Yr:Yr+1}(),Or=Si(gt.axis,et.displaceBy);return ao({draggable:et,insideDestination:je,destination:gt,viewport:xt,displacedBy:Or,last:vi,index:Ai})},Nr=function(ve){var xe=ve.isMovingForward,Be=ve.previousPageBorderBoxCenter,je=ve.draggable,et=ve.isOver,tt=ve.draggables,gt=ve.droppables,xt=ve.viewport,Jt=ve.afterCritical,gn=nn({isMovingForward:xe,pageBorderBoxCenter:Be,source:et,droppables:gt,viewport:xt});if(!gn)return null;var cn=qn(gn.descriptor.id,tt),$t=Wi({pageBorderBoxCenter:Be,viewport:xt,destination:gn,insideDestination:cn,afterCritical:Jt}),ln=ur({previousPageBorderBoxCenter:Be,destination:gn,draggable:je,draggables:tt,moveRelativeTo:$t,insideDestination:cn,viewport:xt,afterCritical:Jt});if(!ln)return null;var Cn=ts({impact:ln,draggable:je,droppable:gn,draggables:tt,afterCritical:Jt}),Ai=ba({pageBorderBoxCenter:Cn,draggable:je,viewport:xt});return{clientSelection:Ai,impact:ln,scrollJumpRequest:null}},yo=function(ve){var xe=ve.at;return xe?xe.type==="REORDER"?xe.destination.droppableId:xe.combine.droppableId:null},ea=function(xe,Be){var je=yo(xe);return je?Be[je]:null},La=function(ve){var xe=ve.state,Be=ve.type,je=ea(xe.impact,xe.dimensions.droppables),et=!!je,tt=xe.dimensions.droppables[xe.critical.droppable.id],gt=je||tt,xt=gt.axis.direction,Jt=xt==="vertical"&&(Be==="MOVE_UP"||Be==="MOVE_DOWN")||xt==="horizontal"&&(Be==="MOVE_LEFT"||Be==="MOVE_RIGHT");if(Jt&&!et)return null;var gn=Be==="MOVE_DOWN"||Be==="MOVE_RIGHT",cn=xe.dimensions.draggables[xe.critical.draggable.id],$t=xe.current.page.borderBoxCenter,ln=xe.dimensions,Cn=ln.draggables,Ai=ln.droppables;return Jt?Rs({isMovingForward:gn,previousPageBorderBoxCenter:$t,draggable:cn,destination:gt,draggables:Cn,viewport:xe.viewport,previousClientSelection:xe.current.client.selection,previousImpact:xe.impact,afterCritical:xe.afterCritical}):Nr({isMovingForward:gn,previousPageBorderBoxCenter:$t,draggable:cn,isOver:gt,draggables:Cn,droppables:Ai,viewport:xe.viewport,afterCritical:xe.afterCritical})};function ga(ve){return ve.phase==="DRAGGING"||ve.phase==="COLLECTING"}function bo(ve){var xe=ui(ve.top,ve.bottom),Be=ui(ve.left,ve.right);return function(et){return xe(et.y)&&Be(et.x)}}function Dr(ve,xe){return ve.left<xe.right&&ve.right>xe.left&&ve.top<xe.bottom&&ve.bottom>xe.top}function or(ve){var xe=ve.pageBorderBox,Be=ve.draggable,je=ve.candidates,et=Be.page.borderBox.center,tt=je.map(function(gt){var xt=gt.axis,Jt=Sr(gt.axis.line,xe.center[xt.line],gt.page.borderBox.center[xt.crossAxisLine]);return{id:gt.descriptor.id,distance:Ri(et,Jt)}}).sort(function(gt,xt){return xt.distance-gt.distance});return tt[0]?tt[0].id:null}function ta(ve){var xe=ve.pageBorderBox,Be=ve.draggable,je=ve.droppables,et=Rt(je).filter(function(tt){if(!tt.isEnabled)return!1;var gt=tt.subject.active;if(!gt||!Dr(xe,gt))return!1;if(bo(gt)(xe.center))return!0;var xt=tt.axis,Jt=gt.center[xt.crossAxisLine],gn=xe[xt.crossAxisStart],cn=xe[xt.crossAxisEnd],$t=ui(gt[xt.crossAxisStart],gt[xt.crossAxisEnd]),ln=$t(gn),Cn=$t(cn);return!ln&&!Cn?!0:ln?gn<Jt:cn>Jt});return et.length?et.length===1?et[0].descriptor.id:or({pageBorderBox:xe,draggable:Be,candidates:et}):null}var sa=function(xe,Be){return gi(fo(xe,Be))},Ta=function(ve,xe){var Be=ve.frame;return Be?sa(xe,Be.scroll.diff.value):xe};function Ga(ve){var xe=ve.displaced,Be=ve.id;return!!(xe.visible[Be]||xe.invisible[Be])}function Oo(ve){var xe=ve.draggable,Be=ve.closest,je=ve.inHomeList;return Be?je&&Be.descriptor.index>xe.descriptor.index?Be.descriptor.index-1:Be.descriptor.index:null}var pa=function(ve){var xe=ve.pageBorderBoxWithDroppableScroll,Be=ve.draggable,je=ve.destination,et=ve.insideDestination,tt=ve.last,gt=ve.viewport,xt=ve.afterCritical,Jt=je.axis,gn=Si(je.axis,Be.displaceBy),cn=gn.value,$t=xe[Jt.start],ln=xe[Jt.end],Cn=qi(Be,et),Ai=ro(Cn,function(Yr){var eo=Yr.descriptor.id,No=Yr.page.borderBox.center[Jt.line],Ro=zr(eo,xt),Ho=Ga({displaced:tt,id:eo});return Ro?Ho?ln<=No:$t<No-cn:Ho?ln<=No+cn:$t<No}),Or=Oo({draggable:Be,closest:Ai,inHomeList:Nn(Be,je)});return ao({draggable:Be,insideDestination:et,destination:je,viewport:gt,last:tt,displacedBy:gn,index:Or})},Lo=4,Ir=function(ve){var xe=ve.draggable,Be=ve.pageBorderBoxWithDroppableScroll,je=ve.previousImpact,et=ve.destination,tt=ve.insideDestination,gt=ve.afterCritical;if(!et.isCombineEnabled)return null;var xt=et.axis,Jt=Si(et.axis,xe.displaceBy),gn=Jt.value,cn=Be[xt.start],$t=Be[xt.end],ln=qi(xe,tt),Cn=ro(ln,function(Or){var Yr=Or.descriptor.id,eo=Or.page.borderBox,No=eo[xt.size],Ro=No/Lo,Ho=zr(Yr,gt),Ca=Ga({displaced:je.displaced,id:Yr});return Ho?Ca?$t>eo[xt.start]+Ro&&$t<eo[xt.end]-Ro:cn>eo[xt.start]-gn+Ro&&cn<eo[xt.end]-gn-Ro:Ca?$t>eo[xt.start]+gn+Ro&&$t<eo[xt.end]+gn-Ro:cn>eo[xt.start]+Ro&&cn<eo[xt.end]-Ro});if(!Cn)return null;var Ai={displacedBy:Jt,displaced:je.displaced,at:{type:"COMBINE",combine:{draggableId:Cn.descriptor.id,droppableId:et.descriptor.id}}};return Ai},Ba=function(ve){var xe=ve.pageOffset,Be=ve.draggable,je=ve.draggables,et=ve.droppables,tt=ve.previousImpact,gt=ve.viewport,xt=ve.afterCritical,Jt=sa(Be.page.borderBox,xe),gn=ta({pageBorderBox:Jt,draggable:Be,droppables:et});if(!gn)return ti;var cn=et[gn],$t=qn(cn.descriptor.id,je),ln=Ta(cn,Jt);return Ir({pageBorderBoxWithDroppableScroll:ln,draggable:Be,previousImpact:tt,destination:cn,insideDestination:$t,afterCritical:xt})||pa({pageBorderBoxWithDroppableScroll:ln,draggable:Be,destination:cn,insideDestination:$t,last:tt.displaced,viewport:gt,afterCritical:xt})},ra=function(ve,xe){var Be;return(0,it.Z)({},ve,(Be={},Be[xe.descriptor.id]=xe,Be))},Uo=function(xe){var Be=xe.previousImpact,je=xe.impact,et=xe.droppables,tt=yo(Be),gt=yo(je);if(!tt||tt===gt)return et;var xt=et[tt];if(!xt.subject.withPlaceholder)return et;var Jt=oi(xt);return ra(et,Jt)},_o=function(ve){var xe=ve.draggable,Be=ve.draggables,je=ve.droppables,et=ve.previousImpact,tt=ve.impact,gt=Uo({previousImpact:et,impact:tt,droppables:je}),xt=yo(tt);if(!xt)return gt;var Jt=je[xt];if(Nn(xe,Jt)||Jt.subject.withPlaceholder)return gt;var gn=Ln(Jt,xe,Be);return ra(gt,gn)},oa=function(ve){var xe=ve.state,Be=ve.clientSelection,je=ve.dimensions,et=ve.viewport,tt=ve.impact,gt=ve.scrollJumpRequest,xt=et||xe.viewport,Jt=je||xe.dimensions,gn=Be||xe.current.client.selection,cn=xo(gn,xe.initial.client.selection),$t={offset:cn,selection:gn,borderBoxCenter:Vr(xe.initial.client.borderBoxCenter,cn)},ln={selection:Vr($t.selection,xt.scroll.current),borderBoxCenter:Vr($t.borderBoxCenter,xt.scroll.current),offset:Vr($t.offset,xt.scroll.diff.value)},Cn={client:$t,page:ln};if(xe.phase==="COLLECTING")return(0,it.Z)({phase:"COLLECTING"},xe,{dimensions:Jt,viewport:xt,current:Cn});var Ai=Jt.draggables[xe.critical.draggable.id],Or=tt||Ba({pageOffset:ln.offset,draggable:Ai,draggables:Jt.draggables,droppables:Jt.droppables,previousImpact:xe.impact,viewport:xt,afterCritical:xe.afterCritical}),Yr=_o({draggable:Ai,impact:Or,previousImpact:xe.impact,draggables:Jt.draggables,droppables:Jt.droppables}),eo=(0,it.Z)({},xe,{current:Cn,dimensions:{draggables:Jt.draggables,droppables:Yr},impact:Or,viewport:xt,scrollJumpRequest:gt||null,forceShouldAnimate:gt?!1:null});return eo};function Ua(ve,xe){return ve.map(function(Be){return xe[Be]})}var pt=function(ve){var xe=ve.impact,Be=ve.viewport,je=ve.draggables,et=ve.destination,tt=ve.forceShouldAnimate,gt=xe.displaced,xt=Ua(gt.all,je),Jt=Gt({afterDragging:xt,destination:et,displacedBy:xe.displacedBy,viewport:Be.frame,forceShouldAnimate:tt,last:gt});return(0,it.Z)({},xe,{displaced:Jt})},Ut=function(ve){var xe=ve.impact,Be=ve.draggable,je=ve.droppable,et=ve.draggables,tt=ve.viewport,gt=ve.afterCritical,xt=ts({impact:xe,draggable:Be,draggables:et,droppable:je,afterCritical:gt});return ba({pageBorderBoxCenter:xt,draggable:Be,viewport:tt})},Re=function(ve){var xe=ve.state,Be=ve.dimensions,je=ve.viewport;xe.movementMode!=="SNAP"&&jt(!1);var et=xe.impact,tt=je||xe.viewport,gt=Be||xe.dimensions,xt=gt.draggables,Jt=gt.droppables,gn=xt[xe.critical.draggable.id],cn=yo(et);cn||jt(!1);var $t=Jt[cn],ln=pt({impact:et,viewport:tt,destination:$t,draggables:xt}),Cn=Ut({impact:ln,draggable:gn,droppable:$t,draggables:xt,viewport:tt,afterCritical:xe.afterCritical});return oa({impact:ln,clientSelection:Cn,state:xe,dimensions:gt,viewport:tt})},ut=function(ve){return{index:ve.index,droppableId:ve.droppableId}},dr=function(ve){var xe=ve.draggable,Be=ve.home,je=ve.draggables,et=ve.viewport,tt=Si(Be.axis,xe.displaceBy),gt=qn(Be.descriptor.id,je),xt=gt.indexOf(xe);xt===-1&&jt(!1);var Jt=gt.slice(xt+1),gn=Jt.reduce(function(Cn,Ai){return Cn[Ai.descriptor.id]=!0,Cn},{}),cn={inVirtualList:Be.descriptor.mode==="virtual",displacedBy:tt,effected:gn},$t=Gt({afterDragging:Jt,destination:Be,displacedBy:tt,last:null,viewport:et.frame,forceShouldAnimate:!1}),ln={displaced:$t,displacedBy:tt,at:{type:"REORDER",destination:ut(xe.descriptor)}};return{impact:ln,afterCritical:cn}},lr=function(ve,xe){return{draggables:ve.draggables,droppables:ra(ve.droppables,xe)}},gr=function(xe){},Qi=function(xe){},Jn=function(ve){var xe=ve.draggable,Be=ve.offset,je=ve.initialWindowScroll,et=ji(xe.client,Be),tt=Cr(et,je),gt=(0,it.Z)({},xe,{placeholder:(0,it.Z)({},xe.placeholder,{client:et}),client:et,page:tt});return gt},Fr=function(ve){var xe=ve.frame;return xe||jt(!1),xe},Br=function(ve){var xe=ve.additions,Be=ve.updatedDroppables,je=ve.viewport,et=je.scroll.diff.value;return xe.map(function(tt){var gt=tt.descriptor.droppableId,xt=Be[gt],Jt=Fr(xt),gn=Jt.scroll.diff.value,cn=Vr(et,gn),$t=Jn({draggable:tt,offset:cn,initialWindowScroll:je.scroll.initial});return $t})},Zr=function(ve){var xe=ve.state,Be=ve.published;gr();var je=Be.modified.map(function(Ro){var Ho=xe.dimensions.droppables[Ro.droppableId],Ca=Do(Ho,Ro.scroll);return Ca}),et=(0,it.Z)({},xe.dimensions.droppables,{},Yt(je)),tt=Rn(Br({additions:Be.additions,updatedDroppables:et,viewport:xe.viewport})),gt=(0,it.Z)({},xe.dimensions.draggables,{},tt);Be.removals.forEach(function(Ro){delete gt[Ro]});var xt={droppables:et,draggables:gt},Jt=yo(xe.impact),gn=Jt?xt.droppables[Jt]:null,cn=xt.draggables[xe.critical.draggable.id],$t=xt.droppables[xe.critical.droppable.id],ln=dr({draggable:cn,home:$t,draggables:gt,viewport:xe.viewport}),Cn=ln.impact,Ai=ln.afterCritical,Or=gn&&gn.isCombineEnabled?xe.impact:Cn,Yr=Ba({pageOffset:xe.current.page.offset,draggable:xt.draggables[xe.critical.draggable.id],draggables:xt.draggables,droppables:xt.droppables,previousImpact:Or,viewport:xe.viewport,afterCritical:Ai});Qi();var eo=(0,it.Z)({phase:"DRAGGING"},xe,{phase:"DRAGGING",impact:Yr,onLiftImpact:Cn,dimensions:xt,afterCritical:Ai,forceShouldAnimate:!1});if(xe.phase==="COLLECTING")return eo;var No=(0,it.Z)({phase:"DROP_PENDING"},eo,{phase:"DROP_PENDING",reason:xe.reason,isWaiting:!1});return No},mr=function(xe){return xe.movementMode==="SNAP"},Po=function(xe,Be,je){var et=lr(xe.dimensions,Be);return!mr(xe)||je?oa({state:xe,dimensions:et}):Re({state:xe,dimensions:et})};function Ki(ve){return ve.isDragging&&ve.movementMode==="SNAP"?(0,it.Z)({phase:"DRAGGING"},ve,{scrollJumpRequest:null}):ve}var Ei={phase:"IDLE",completed:null,shouldFlush:!1},bi=function(ve,xe){if(ve===void 0&&(ve=Ei),xe.type==="FLUSH")return(0,it.Z)({},Ei,{shouldFlush:!0});if(xe.type==="INITIAL_PUBLISH"){ve.phase!=="IDLE"&&jt(!1);var Be=xe.payload,je=Be.critical,et=Be.clientSelection,tt=Be.viewport,gt=Be.dimensions,xt=Be.movementMode,Jt=gt.draggables[je.draggable.id],gn=gt.droppables[je.droppable.id],cn={selection:et,borderBoxCenter:Jt.client.borderBox.center,offset:Ar},$t={client:cn,page:{selection:Vr(cn.selection,tt.scroll.initial),borderBoxCenter:Vr(cn.selection,tt.scroll.initial),offset:Vr(cn.selection,tt.scroll.diff.value)}},ln=Rt(gt.droppables).every(function(Mf){return!Mf.isFixedOnPage}),Cn=dr({draggable:Jt,home:gn,draggables:gt.draggables,viewport:tt}),Ai=Cn.impact,Or=Cn.afterCritical,Yr={phase:"DRAGGING",isDragging:!0,critical:je,movementMode:xt,dimensions:gt,initial:$t,current:$t,isWindowScrollAllowed:ln,impact:Ai,afterCritical:Or,onLiftImpact:Ai,viewport:tt,scrollJumpRequest:null,forceShouldAnimate:null};return Yr}if(xe.type==="COLLECTION_STARTING"){if(ve.phase==="COLLECTING"||ve.phase==="DROP_PENDING")return ve;ve.phase!=="DRAGGING"&&jt(!1);var eo=(0,it.Z)({phase:"COLLECTING"},ve,{phase:"COLLECTING"});return eo}if(xe.type==="PUBLISH_WHILE_DRAGGING")return ve.phase==="COLLECTING"||ve.phase==="DROP_PENDING"||jt(!1),Zr({state:ve,published:xe.payload});if(xe.type==="MOVE"){if(ve.phase==="DROP_PENDING")return ve;ga(ve)||jt(!1);var No=xe.payload.client;return Ot(No,ve.current.client.selection)?ve:oa({state:ve,clientSelection:No,impact:mr(ve)?ve.impact:null})}if(xe.type==="UPDATE_DROPPABLE_SCROLL"){if(ve.phase==="DROP_PENDING"||ve.phase==="COLLECTING")return Ki(ve);ga(ve)||jt(!1);var Ro=xe.payload,Ho=Ro.id,Ca=Ro.newScroll,da=ve.dimensions.droppables[Ho];if(!da)return ve;var es=Do(da,Ca);return Po(ve,es,!1)}if(xe.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(ve.phase==="DROP_PENDING")return ve;ga(ve)||jt(!1);var Js=xe.payload,is=Js.id,Ts=Js.isEnabled,vl=ve.dimensions.droppables[is];vl||jt(!1),vl.isEnabled===Ts&&jt(!1);var Zl=(0,it.Z)({},vl,{isEnabled:Ts});return Po(ve,Zl,!0)}if(xe.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(ve.phase==="DROP_PENDING")return ve;ga(ve)||jt(!1);var Bh=xe.payload,Yu=Bh.id,tu=Bh.isCombineEnabled,Xu=ve.dimensions.droppables[Yu];Xu||jt(!1),Xu.isCombineEnabled===tu&&jt(!1);var _s=(0,it.Z)({},Xu,{isCombineEnabled:tu});return Po(ve,_s,!0)}if(xe.type==="MOVE_BY_WINDOW_SCROLL"){if(ve.phase==="DROP_PENDING"||ve.phase==="DROP_ANIMATING")return ve;ga(ve)||jt(!1),ve.isWindowScrollAllowed||jt(!1);var Gl=xe.payload.newScroll;if(Ot(ve.viewport.scroll.current,Gl))return Ki(ve);var Ju=Xi(ve.viewport,Gl);return mr(ve)?Re({state:ve,viewport:Ju}):oa({state:ve,viewport:Ju})}if(xe.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!ga(ve))return ve;var yl=xe.payload.maxScroll;if(Ot(yl,ve.viewport.scroll.max))return ve;var Au=(0,it.Z)({},ve.viewport,{scroll:(0,it.Z)({},ve.viewport.scroll,{max:yl})});return(0,it.Z)({phase:"DRAGGING"},ve,{viewport:Au})}if(xe.type==="MOVE_UP"||xe.type==="MOVE_DOWN"||xe.type==="MOVE_LEFT"||xe.type==="MOVE_RIGHT"){if(ve.phase==="COLLECTING"||ve.phase==="DROP_PENDING")return ve;ve.phase!=="DRAGGING"&&jt(!1);var Jd=La({state:ve,type:xe.type});return Jd?oa({state:ve,impact:Jd.impact,clientSelection:Jd.clientSelection,scrollJumpRequest:Jd.scrollJumpRequest}):ve}if(xe.type==="DROP_PENDING"){var Nu=xe.payload.reason;ve.phase!=="COLLECTING"&&jt(!1);var $o=(0,it.Z)({phase:"DROP_PENDING"},ve,{phase:"DROP_PENDING",isWaiting:!0,reason:Nu});return $o}if(xe.type==="DROP_ANIMATE"){var xg=xe.payload,Mh=xg.completed,Gc=xg.dropDuration,Pd=xg.newHomeClientOffset;ve.phase==="DRAGGING"||ve.phase==="DROP_PENDING"||jt(!1);var kh={phase:"DROP_ANIMATING",completed:Mh,dropDuration:Gc,newHomeClientOffset:Pd,dimensions:ve.dimensions};return kh}if(xe.type==="DROP_COMPLETE"){var Du=xe.payload.completed;return{phase:"IDLE",completed:Du,shouldFlush:!1}}return ve},Jr=function(xe){return{type:"BEFORE_INITIAL_CAPTURE",payload:xe}},Ur=function(xe){return{type:"LIFT",payload:xe}},Mr=function(xe){return{type:"INITIAL_PUBLISH",payload:xe}},Fo=function(xe){return{type:"PUBLISH_WHILE_DRAGGING",payload:xe}},vr=function(){return{type:"COLLECTION_STARTING",payload:null}},so=function(xe){return{type:"UPDATE_DROPPABLE_SCROLL",payload:xe}},er=function(xe){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:xe}},Tr=function(xe){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:xe}},oo=function(xe){return{type:"MOVE",payload:xe}},Go=function(xe){return{type:"MOVE_BY_WINDOW_SCROLL",payload:xe}},ha=function(xe){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:xe}},_a=function(){return{type:"MOVE_UP",payload:null}},jr=function(){return{type:"MOVE_DOWN",payload:null}},Ls=function(){return{type:"MOVE_RIGHT",payload:null}},vo=function(){return{type:"MOVE_LEFT",payload:null}},na=function(){return{type:"FLUSH",payload:null}},Eo=function(xe){return{type:"DROP_ANIMATE",payload:xe}},Xa=function(xe){return{type:"DROP_COMPLETE",payload:xe}},Ia=function(xe){return{type:"DROP",payload:xe}},xs=function(xe){return{type:"DROP_PENDING",payload:xe}},Yl=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}};function zu(ve){if(!(ve.length<=1)){for(var xe=ve.map(function(xt){return xt.descriptor.index}),Be={},je=1;je<xe.length;je++){var et=xe[je],tt=xe[je-1];et!==tt+1&&(Be[et]=!0)}if(Object.keys(Be).length)var gt=xe.map(function(xt){var Jt=!!Be[xt];return Jt?"[\u{1F525}"+xt+"]":""+xt}).join(", ")}}function Ll(ve,xe){if(0)var Be}var lu=function(ve){return function(xe){var Be=xe.getState,je=xe.dispatch;return function(et){return function(tt){if(tt.type!=="LIFT"){et(tt);return}var gt=tt.payload,xt=gt.id,Jt=gt.clientSelection,gn=gt.movementMode,cn=Be();cn.phase==="DROP_ANIMATING"&&je(Xa({completed:cn.completed})),Be().phase!=="IDLE"&&jt(!1),je(na()),je(Jr({draggableId:xt,movementMode:gn}));var $t={shouldPublishImmediately:gn==="SNAP"},ln={draggableId:xt,scrollOptions:$t},Cn=ve.startPublishing(ln),Ai=Cn.critical,Or=Cn.dimensions,Yr=Cn.viewport;Ll(Ai,Or),je(Mr({critical:Ai,dimensions:Or,clientSelection:Jt,movementMode:gn,viewport:Yr}))}}}},ka=function(ve){return function(){return function(xe){return function(Be){Be.type==="INITIAL_PUBLISH"&&ve.dragging(),Be.type==="DROP_ANIMATE"&&ve.dropping(Be.payload.completed.result.reason),(Be.type==="FLUSH"||Be.type==="DROP_COMPLETE")&&ve.resting(),xe(Be)}}}},qs={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},al={opacity:{drop:0,combining:.7},scale:{drop:.75}},fl={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},uu=fl.outOfTheWay+"s "+qs.outOfTheWay,Bl={fluid:"opacity "+uu,snap:"transform "+uu+", opacity "+uu,drop:function(xe){var Be=xe+"s "+qs.drop;return"transform "+Be+", opacity "+Be},outOfTheWay:"transform "+uu,placeholder:"height "+uu+", width "+uu+", margin "+uu},Ea=function(xe){return Ot(xe,Ar)?null:"translate("+xe.x+"px, "+xe.y+"px)"},Oa={moveTo:Ea,drop:function(xe,Be){var je=Ea(xe);return je?Be?je+" scale("+al.scale.drop+")":je:null}},us=fl.minDropTime,Zs=fl.maxDropTime,Gs=Zs-us,Il=1500,mu=.6,Fu=function(ve){var xe=ve.current,Be=ve.destination,je=ve.reason,et=Ri(xe,Be);if(et<=0)return us;if(et>=Il)return Zs;var tt=et/Il,gt=us+Gs*tt,xt=je==="CANCEL"?gt*mu:gt;return Number(xt.toFixed(2))},Ol=function(ve){var xe=ve.impact,Be=ve.draggable,je=ve.dimensions,et=ve.viewport,tt=ve.afterCritical,gt=je.draggables,xt=je.droppables,Jt=yo(xe),gn=Jt?xt[Jt]:null,cn=xt[Be.descriptor.droppableId],$t=Ut({impact:xe,draggable:Be,draggables:gt,afterCritical:tt,droppable:gn||cn,viewport:et}),ln=xo($t,Be.client.borderBox.center);return ln},Xl=function(ve){var xe=ve.draggables,Be=ve.reason,je=ve.lastImpact,et=ve.home,tt=ve.viewport,gt=ve.onLiftImpact;if(!je.at||Be!=="DROP"){var xt=pt({draggables:xe,impact:gt,destination:et,viewport:tt,forceShouldAnimate:!0});return{impact:xt,didDropInsideDroppable:!1}}if(je.at.type==="REORDER")return{impact:je,didDropInsideDroppable:!0};var Jt=(0,it.Z)({},je,{displaced:vi});return{impact:Jt,didDropInsideDroppable:!0}},df=function(ve){var xe=ve.getState,Be=ve.dispatch;return function(je){return function(et){if(et.type!=="DROP"){je(et);return}var tt=xe(),gt=et.payload.reason;if(tt.phase==="COLLECTING"){Be(xs({reason:gt}));return}if(tt.phase!=="IDLE"){var xt=tt.phase==="DROP_PENDING"&&tt.isWaiting;xt&&jt(!1),tt.phase==="DRAGGING"||tt.phase==="DROP_PENDING"||jt(!1);var Jt=tt.critical,gn=tt.dimensions,cn=gn.draggables[tt.critical.draggable.id],$t=Xl({reason:gt,lastImpact:tt.impact,afterCritical:tt.afterCritical,onLiftImpact:tt.onLiftImpact,home:tt.dimensions.droppables[tt.critical.droppable.id],viewport:tt.viewport,draggables:tt.dimensions.draggables}),ln=$t.impact,Cn=$t.didDropInsideDroppable,Ai=Cn?Ci(ln):null,Or=Cn?Oi(ln):null,Yr={index:Jt.draggable.index,droppableId:Jt.droppable.id},eo={draggableId:cn.descriptor.id,type:cn.descriptor.type,source:Yr,reason:gt,mode:tt.movementMode,destination:Ai,combine:Or},No=Ol({impact:ln,draggable:cn,dimensions:gn,viewport:tt.viewport,afterCritical:tt.afterCritical}),Ro={critical:tt.critical,afterCritical:tt.afterCritical,result:eo,impact:ln},Ho=!Ot(tt.current.client.offset,No)||!!eo.combine;if(!Ho){Be(Xa({completed:Ro}));return}var Ca=Fu({current:tt.current.client.offset,destination:No,reason:gt}),da={newHomeClientOffset:No,dropDuration:Ca,completed:Ro};Be(Eo(da))}}}},xc=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function Uf(ve){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(Be){Be.target!==window&&Be.target!==window.document||ve()}}}function cf(ve){var xe=ve.onWindowScroll;function Be(){xe(xc())}var je=zt(Be),et=Uf(je),tt=Yn;function gt(){return tt!==Yn}function xt(){gt()&&jt(!1),tt=Bt(window,[et])}function Jt(){gt()||jt(!1),je.cancel(),tt(),tt=Yn}return{start:xt,stop:Jt,isActive:gt}}var Mn=function(xe){return xe.type==="DROP_COMPLETE"||xe.type==="DROP_ANIMATE"||xe.type==="FLUSH"},Gr=function(ve){var xe=cf({onWindowScroll:function(je){ve.dispatch(Go({newScroll:je}))}});return function(Be){return function(je){!xe.isActive()&&je.type==="INITIAL_PUBLISH"&&xe.start(),xe.isActive()&&Mn(je)&&xe.stop(),Be(je)}}},uo=function(ve){var xe=!1,Be=!1,je=setTimeout(function(){Be=!0}),et=function(gt){xe||Be||(xe=!0,ve(gt),clearTimeout(je))};return et.wasCalled=function(){return xe},et},io=function(){var ve=[],xe=function(tt){var gt=To(ve,function(gn){return gn.timerId===tt});gt===-1&&jt(!1);var xt=ve.splice(gt,1),Jt=xt[0];Jt.callback()},Be=function(tt){var gt=setTimeout(function(){return xe(gt)}),xt={timerId:gt,callback:tt};ve.push(xt)},je=function(){if(ve.length){var tt=[].concat(ve);ve.length=0,tt.forEach(function(gt){clearTimeout(gt.timerId),gt.callback()})}};return{add:Be,flush:je}},rr=function(xe,Be){return xe==null&&Be==null?!0:xe==null||Be==null?!1:xe.droppableId===Be.droppableId&&xe.index===Be.index},la=function(xe,Be){return xe==null&&Be==null?!0:xe==null||Be==null?!1:xe.draggableId===Be.draggableId&&xe.droppableId===Be.droppableId},Wa=function(xe,Be){if(xe===Be)return!0;var je=xe.draggable.id===Be.draggable.id&&xe.draggable.droppableId===Be.draggable.droppableId&&xe.draggable.type===Be.draggable.type&&xe.draggable.index===Be.draggable.index,et=xe.droppable.id===Be.droppable.id&&xe.droppable.type===Be.droppable.type;return je&&et},Fa=function(xe,Be){gr(),Be(),Qi()},ya=function(xe,Be){return{draggableId:xe.draggable.id,type:xe.droppable.type,source:{droppableId:xe.droppable.id,index:xe.draggable.index},mode:Be}},Ks=function(xe,Be,je,et){if(!xe){je(et(Be));return}var tt=uo(je),gt={announce:tt};xe(Be,gt),tt.wasCalled()||je(et(Be))},rs=function(ve,xe){var Be=io(),je=null,et=function(ln,Cn){je&&jt(!1),Fa("onBeforeCapture",function(){var Ai=ve().onBeforeCapture;if(Ai){var Or={draggableId:ln,mode:Cn};Ai(Or)}})},tt=function(ln,Cn){je&&jt(!1),Fa("onBeforeDragStart",function(){var Ai=ve().onBeforeDragStart;Ai&&Ai(ya(ln,Cn))})},gt=function(ln,Cn){je&&jt(!1);var Ai=ya(ln,Cn);je={mode:Cn,lastCritical:ln,lastLocation:Ai.source,lastCombine:null},Be.add(function(){Fa("onDragStart",function(){return Ks(ve().onDragStart,Ai,xe,ki.onDragStart)})})},xt=function(ln,Cn){var Ai=Ci(Cn),Or=Oi(Cn);je||jt(!1);var Yr=!Wa(ln,je.lastCritical);Yr&&(je.lastCritical=ln);var eo=!rr(je.lastLocation,Ai);eo&&(je.lastLocation=Ai);var No=!la(je.lastCombine,Or);if(No&&(je.lastCombine=Or),!(!Yr&&!eo&&!No)){var Ro=(0,it.Z)({},ya(ln,je.mode),{combine:Or,destination:Ai});Be.add(function(){Fa("onDragUpdate",function(){return Ks(ve().onDragUpdate,Ro,xe,ki.onDragUpdate)})})}},Jt=function(){je||jt(!1),Be.flush()},gn=function(ln){je||jt(!1),je=null,Fa("onDragEnd",function(){return Ks(ve().onDragEnd,ln,xe,ki.onDragEnd)})},cn=function(){if(je){var ln=(0,it.Z)({},ya(je.lastCritical,je.mode),{combine:null,destination:null,reason:"CANCEL"});gn(ln)}};return{beforeCapture:et,beforeStart:tt,start:gt,update:xt,flush:Jt,drop:gn,abort:cn}},Bs=function(ve,xe){var Be=rs(ve,xe);return function(je){return function(et){return function(tt){if(tt.type==="BEFORE_INITIAL_CAPTURE"){Be.beforeCapture(tt.payload.draggableId,tt.payload.movementMode);return}if(tt.type==="INITIAL_PUBLISH"){var gt=tt.payload.critical;Be.beforeStart(gt,tt.payload.movementMode),et(tt),Be.start(gt,tt.payload.movementMode);return}if(tt.type==="DROP_COMPLETE"){var xt=tt.payload.completed.result;Be.flush(),et(tt),Be.drop(xt);return}if(et(tt),tt.type==="FLUSH"){Be.abort();return}var Jt=je.getState();Jt.phase==="DRAGGING"&&Be.update(Jt.critical,Jt.impact)}}}},oh=function(ve){return function(xe){return function(Be){if(Be.type!=="DROP_ANIMATION_FINISHED"){xe(Be);return}var je=ve.getState();je.phase!=="DROP_ANIMATING"&&jt(!1),ve.dispatch(Xa({completed:je.completed}))}}},Hr=function(ve){var xe=null,Be=null;function je(){Be&&(cancelAnimationFrame(Be),Be=null),xe&&(xe(),xe=null)}return function(et){return function(tt){if((tt.type==="FLUSH"||tt.type==="DROP_COMPLETE"||tt.type==="DROP_ANIMATION_FINISHED")&&je(),et(tt),tt.type==="DROP_ANIMATE"){var gt={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var Jt=ve.getState();Jt.phase==="DROP_ANIMATING"&&ve.dispatch(Yl())}};Be=requestAnimationFrame(function(){Be=null,xe=Bt(window,[gt])})}}}},el=function(ve){return function(){return function(xe){return function(Be){(Be.type==="DROP_COMPLETE"||Be.type==="FLUSH"||Be.type==="DROP_ANIMATE")&&ve.stopPublishing(),xe(Be)}}}},Jl=function(ve){var xe=!1;return function(){return function(Be){return function(je){if(je.type==="INITIAL_PUBLISH"){xe=!0,ve.tryRecordFocus(je.payload.critical.draggable.id),Be(je),ve.tryRestoreFocusRecorded();return}if(Be(je),!!xe){if(je.type==="FLUSH"){xe=!1,ve.tryRestoreFocusRecorded();return}if(je.type==="DROP_COMPLETE"){xe=!1;var et=je.payload.completed.result;et.combine&&ve.tryShiftRecord(et.draggableId,et.combine.draggableId),ve.tryRestoreFocusRecorded()}}}}}},Ns=function(xe){return xe.type==="DROP_COMPLETE"||xe.type==="DROP_ANIMATE"||xe.type==="FLUSH"},Ml=function(ve){return function(xe){return function(Be){return function(je){if(Ns(je)){ve.stop(),Be(je);return}if(je.type==="INITIAL_PUBLISH"){Be(je);var et=xe.getState();et.phase!=="DRAGGING"&&jt(!1),ve.start(et);return}Be(je),ve.scroll(xe.getState())}}}},xh=function(ve){return function(xe){return function(Be){if(xe(Be),Be.type==="PUBLISH_WHILE_DRAGGING"){var je=ve.getState();je.phase==="DROP_PENDING"&&(je.isWaiting||ve.dispatch(Ia({reason:je.reason})))}}}},Ss=bt.qC,ms=function(ve){var xe=ve.dimensionMarshal,Be=ve.focusMarshal,je=ve.styleMarshal,et=ve.getResponders,tt=ve.announce,gt=ve.autoScroller;return(0,bt.MT)(bi,Ss((0,bt.md)(ka(je),el(xe),lu(xe),df,oh,Hr,xh,Ml(gt),Gr,Jl(Be),Bs(et,tt))))},Ql=function(){return{additions:{},removals:{},modified:{}}};function hu(ve){var xe=ve.registry,Be=ve.callbacks,je=Ql(),et=null,tt=function(){et||(Be.collectionStarting(),et=requestAnimationFrame(function(){et=null,gr();var cn=je,$t=cn.additions,ln=cn.removals,Cn=cn.modified,Ai=Object.keys($t).map(function(eo){return xe.draggable.getById(eo).getDimension(Ar)}).sort(function(eo,No){return eo.descriptor.index-No.descriptor.index}),Or=Object.keys(Cn).map(function(eo){var No=xe.droppable.getById(eo),Ro=No.callbacks.getScrollWhileDragging();return{droppableId:eo,scroll:Ro}}),Yr={additions:Ai,removals:Object.keys(ln),modified:Or};je=Ql(),Qi(),Be.publish(Yr)}))},gt=function(cn){var $t=cn.descriptor.id;je.additions[$t]=cn,je.modified[cn.descriptor.droppableId]=!0,je.removals[$t]&&delete je.removals[$t],tt()},xt=function(cn){var $t=cn.descriptor;je.removals[$t.id]=!0,je.modified[$t.droppableId]=!0,je.additions[$t.id]&&delete je.additions[$t.id],tt()},Jt=function(){et&&(cancelAnimationFrame(et),et=null,je=Ql())};return{add:gt,remove:xt,stop:Jt}}var Sh=function(ve){var xe=ve.scrollHeight,Be=ve.scrollWidth,je=ve.height,et=ve.width,tt=xo({x:Be,y:xe},{x:et,y:je}),gt={x:Math.max(0,tt.x),y:Math.max(0,tt.y)};return gt},Rl=function(){var ve=document.documentElement;return ve||jt(!1),ve},js=function(){var ve=Rl(),xe=Sh({scrollHeight:ve.scrollHeight,scrollWidth:ve.scrollWidth,width:ve.clientWidth,height:ve.clientHeight});return xe},Zu=function(){var ve=xc(),xe=js(),Be=ve.y,je=ve.x,et=Rl(),tt=et.clientWidth,gt=et.clientHeight,xt=je+tt,Jt=Be+gt,gn=gi({top:Be,left:je,right:xt,bottom:Jt}),cn={frame:gn,scroll:{initial:ve,current:ve,max:xe,diff:{value:Ar,displacement:Ar}}};return cn},du=function(ve){var xe=ve.critical,Be=ve.scrollOptions,je=ve.registry;gr();var et=Zu(),tt=et.scroll.current,gt=xe.droppable,xt=je.droppable.getAllByType(gt.type).map(function($t){return $t.callbacks.getDimensionAndWatchScroll(tt,Be)}),Jt=je.draggable.getAllByType(xe.draggable.type).map(function($t){return $t.getDimension(tt)}),gn={draggables:Rn(Jt),droppables:Yt(xt)};Qi();var cn={dimensions:gn,critical:xe,viewport:et};return cn};function tl(ve,xe,Be){if(Be.descriptor.id===xe.id||Be.descriptor.type!==xe.type)return!1;var je=ve.droppable.getById(Be.descriptor.droppableId);return je.descriptor.mode==="virtual"}var vu=function(ve,xe){var Be=null,je=hu({callbacks:{publish:xe.publishWhileDragging,collectionStarting:xe.collectionStarting},registry:ve}),et=function(Cn,Ai){ve.droppable.exists(Cn)||jt(!1),Be&&xe.updateDroppableIsEnabled({id:Cn,isEnabled:Ai})},tt=function(Cn,Ai){Be&&(ve.droppable.exists(Cn)||jt(!1),xe.updateDroppableIsCombineEnabled({id:Cn,isCombineEnabled:Ai}))},gt=function(Cn,Ai){Be&&(ve.droppable.exists(Cn)||jt(!1),xe.updateDroppableScroll({id:Cn,newScroll:Ai}))},xt=function(Cn,Ai){Be&&ve.droppable.getById(Cn).callbacks.scroll(Ai)},Jt=function(){if(Be){je.stop();var Cn=Be.critical.droppable;ve.droppable.getAllByType(Cn.type).forEach(function(Ai){return Ai.callbacks.dragStopped()}),Be.unsubscribe(),Be=null}},gn=function(Cn){Be||jt(!1);var Ai=Be.critical.draggable;Cn.type==="ADDITION"&&tl(ve,Ai,Cn.value)&&je.add(Cn.value),Cn.type==="REMOVAL"&&tl(ve,Ai,Cn.value)&&je.remove(Cn.value)},cn=function(Cn){Be&&jt(!1);var Ai=ve.draggable.getById(Cn.draggableId),Or=ve.droppable.getById(Ai.descriptor.droppableId),Yr={draggable:Ai.descriptor,droppable:Or.descriptor},eo=ve.subscribe(gn);return Be={critical:Yr,unsubscribe:eo},du({critical:Yr,registry:ve,scrollOptions:Cn.scrollOptions})},$t={updateDroppableIsEnabled:et,updateDroppableIsCombineEnabled:tt,scrollDroppable:xt,updateDroppableScroll:gt,startPublishing:cn,stopPublishing:Jt};return $t},os=function(ve,xe){return ve.phase==="IDLE"?!0:ve.phase!=="DROP_ANIMATING"||ve.completed.result.draggableId===xe?!1:ve.completed.result.reason==="DROP"},Lu=function(ve){window.scrollBy(ve.x,ve.y)},wh=Ni(function(ve){return Rt(ve).filter(function(xe){return!(!xe.isEnabled||!xe.frame)})}),Oh=function(xe,Be){var je=ro(wh(Be),function(et){return et.frame||jt(!1),bo(et.frame.pageMarginBox)(xe)});return je},od=function(ve){var xe=ve.center,Be=ve.destination,je=ve.droppables;if(Be){var et=je[Be];return et.frame?et:null}var tt=Oh(xe,je);return tt},Bu={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(xe){return Math.pow(xe,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},Dd=function(ve,xe){var Be=ve[xe.size]*Bu.startFromPercentage,je=ve[xe.size]*Bu.maxScrollAtPercentage,et={startScrollingFrom:Be,maxScrollValueAt:je};return et},Td=function(ve){var xe=ve.startOfRange,Be=ve.endOfRange,je=ve.current,et=Be-xe;if(et===0)return 0;var tt=je-xe,gt=tt/et;return gt},Aa=1,Sc=function(ve,xe){if(ve>xe.startScrollingFrom)return 0;if(ve<=xe.maxScrollValueAt)return Bu.maxPixelScroll;if(ve===xe.startScrollingFrom)return Aa;var Be=Td({startOfRange:xe.maxScrollValueAt,endOfRange:xe.startScrollingFrom,current:ve}),je=1-Be,et=Bu.maxPixelScroll*Bu.ease(je);return Math.ceil(et)},ff=Bu.durationDampening.accelerateAt,wc=Bu.durationDampening.stopDampeningAt,Gu=function(ve,xe){var Be=xe,je=wc,et=Date.now(),tt=et-Be;if(tt>=wc)return ve;if(tt<ff)return Aa;var gt=Td({startOfRange:ff,endOfRange:je,current:tt}),xt=ve*Bu.ease(gt);return Math.ceil(xt)},Pc=function(ve){var xe=ve.distanceToEdge,Be=ve.thresholds,je=ve.dragStartTime,et=ve.shouldUseTimeDampening,tt=Sc(xe,Be);return tt===0?0:et?Math.max(Gu(tt,je),Aa):tt},_d=function(ve){var xe=ve.container,Be=ve.distanceToEdges,je=ve.dragStartTime,et=ve.axis,tt=ve.shouldUseTimeDampening,gt=Dd(xe,et),xt=Be[et.end]<Be[et.start];return xt?Pc({distanceToEdge:Be[et.end],thresholds:gt,dragStartTime:je,shouldUseTimeDampening:tt}):-1*Pc({distanceToEdge:Be[et.start],thresholds:gt,dragStartTime:je,shouldUseTimeDampening:tt})},zp=function(ve){var xe=ve.container,Be=ve.subject,je=ve.proposedScroll,et=Be.height>xe.height,tt=Be.width>xe.width;return!tt&&!et?je:tt&&et?null:{x:tt?0:je.x,y:et?0:je.y}},Id=Qr(function(ve){return ve===0?0:ve}),Ec=function(ve){var xe=ve.dragStartTime,Be=ve.container,je=ve.subject,et=ve.center,tt=ve.shouldUseTimeDampening,gt={top:et.y-Be.top,right:Be.right-et.x,bottom:Be.bottom-et.y,left:et.x-Be.left},xt=_d({container:Be,distanceToEdges:gt,dragStartTime:xe,axis:Yi,shouldUseTimeDampening:tt}),Jt=_d({container:Be,distanceToEdges:gt,dragStartTime:xe,axis:Pn,shouldUseTimeDampening:tt}),gn=Id({x:Jt,y:xt});if(Ot(gn,Ar))return null;var cn=zp({container:Be,subject:je,proposedScroll:gn});return cn?Ot(cn,Ar)?null:cn:null},Od=Qr(function(ve){return ve===0?0:ve>0?1:-1}),ad=function(){var ve=function(Be,je){return Be<0?Be:Be>je?Be-je:0};return function(xe){var Be=xe.current,je=xe.max,et=xe.change,tt=Vr(Be,et),gt={x:ve(tt.x,je.x),y:ve(tt.y,je.y)};return Ot(gt,Ar)?null:gt}}(),Rd=function(xe){var Be=xe.max,je=xe.current,et=xe.change,tt={x:Math.max(je.x,Be.x),y:Math.max(je.y,Be.y)},gt=Od(et),xt=ad({max:tt,current:je,change:gt});return!xt||gt.x!==0&&xt.x===0||gt.y!==0&&xt.y===0},Cc=function(xe,Be){return Rd({current:xe.scroll.current,max:xe.scroll.max,change:Be})},bc=function(xe,Be){if(!Cc(xe,Be))return null;var je=xe.scroll.max,et=xe.scroll.current;return ad({current:et,max:je,change:Be})},Rh=function(xe,Be){var je=xe.frame;return je?Rd({current:je.scroll.current,max:je.scroll.max,change:Be}):!1},jh=function(xe,Be){var je=xe.frame;return!je||!Rh(xe,Be)?null:ad({current:je.scroll.current,max:je.scroll.max,change:Be})},kl=function(ve){var xe=ve.viewport,Be=ve.subject,je=ve.center,et=ve.dragStartTime,tt=ve.shouldUseTimeDampening,gt=Ec({dragStartTime:et,container:xe.frame,subject:Be,center:je,shouldUseTimeDampening:tt});return gt&&Cc(xe,gt)?gt:null},ah=function(ve){var xe=ve.droppable,Be=ve.subject,je=ve.center,et=ve.dragStartTime,tt=ve.shouldUseTimeDampening,gt=xe.frame;if(!gt)return null;var xt=Ec({dragStartTime:et,container:gt.pageMarginBox,subject:Be,center:je,shouldUseTimeDampening:tt});return xt&&Rh(xe,xt)?xt:null},Fc=function(ve){var xe=ve.state,Be=ve.dragStartTime,je=ve.shouldUseTimeDampening,et=ve.scrollWindow,tt=ve.scrollDroppable,gt=xe.current.page.borderBoxCenter,xt=xe.dimensions.draggables[xe.critical.draggable.id],Jt=xt.page.marginBox;if(xe.isWindowScrollAllowed){var gn=xe.viewport,cn=kl({dragStartTime:Be,viewport:gn,subject:Jt,center:gt,shouldUseTimeDampening:je});if(cn){et(cn);return}}var $t=od({center:gt,destination:yo(xe.impact),droppables:xe.dimensions.droppables});if($t){var ln=ah({dragStartTime:Be,droppable:$t,subject:Jt,center:gt,shouldUseTimeDampening:je});ln&&tt($t.descriptor.id,ln)}},Ph=function(ve){var xe=ve.scrollWindow,Be=ve.scrollDroppable,je=zt(xe),et=zt(Be),tt=null,gt=function(cn){tt||jt(!1);var $t=tt,ln=$t.shouldUseTimeDampening,Cn=$t.dragStartTime;Fc({state:cn,scrollWindow:je,scrollDroppable:et,dragStartTime:Cn,shouldUseTimeDampening:ln})},xt=function(cn){gr(),tt&&jt(!1);var $t=Date.now(),ln=!1,Cn=function(){ln=!0};Fc({state:cn,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:Cn,scrollDroppable:Cn}),tt={dragStartTime:$t,shouldUseTimeDampening:ln},Qi(),ln&&gt(cn)},Jt=function(){tt&&(je.cancel(),et.cancel(),tt=null)};return{start:xt,stop:Jt,scroll:gt}},gf=function(ve){var xe=ve.move,Be=ve.scrollDroppable,je=ve.scrollWindow,et=function(gn,cn){var $t=Vr(gn.current.client.selection,cn);xe({client:$t})},tt=function(gn,cn){if(!Rh(gn,cn))return cn;var $t=jh(gn,cn);if(!$t)return Be(gn.descriptor.id,cn),null;var ln=xo(cn,$t);Be(gn.descriptor.id,ln);var Cn=xo(cn,ln);return Cn},gt=function(gn,cn,$t){if(!gn||!Cc(cn,$t))return $t;var ln=bc(cn,$t);if(!ln)return je($t),null;var Cn=xo($t,ln);je(Cn);var Ai=xo($t,Cn);return Ai},xt=function(gn){var cn=gn.scrollJumpRequest;if(cn){var $t=yo(gn.impact);$t||jt(!1);var ln=tt(gn.dimensions.droppables[$t],cn);if(ln){var Cn=gn.viewport,Ai=gt(gn.isWindowScrollAllowed,Cn,ln);Ai&&et(gn,Ai)}}};return xt},pf=function(ve){var xe=ve.scrollDroppable,Be=ve.scrollWindow,je=ve.move,et=Ph({scrollWindow:Be,scrollDroppable:xe}),tt=gf({move:je,scrollWindow:Be,scrollDroppable:xe}),gt=function(gn){if(gn.phase==="DRAGGING"){if(gn.movementMode==="FLUID"){et.scroll(gn);return}gn.scrollJumpRequest&&tt(gn)}},xt={scroll:gt,start:et.start,stop:et.stop};return xt},sd="data-rbd",yu=function(){var ve=sd+"-drag-handle";return{base:ve,draggableId:ve+"-draggable-id",contextId:ve+"-context-id"}}(),Eh=function(){var ve=sd+"-draggable";return{base:ve,contextId:ve+"-context-id",id:ve+"-id"}}(),Gg=function(){var ve=sd+"-droppable";return{base:ve,contextId:ve+"-context-id",id:ve+"-id"}}(),Lc={contextId:sd+"-scroll-container-context-id"},gl=function(xe){return function(Be){return"["+Be+'="'+xe+'"]'}},Wu=function(xe,Be){return xe.map(function(je){var et=je.styles[Be];return et?je.selector+" { "+et+" }":""}).join(" ")},Yf="pointer-events: none;",Bc=function(ve){var xe=gl(ve),Be=function(){var xt=`
cursor: -webkit-grab;
cursor: grab;
`;return{selector:xe(yu.contextId),styles:{always:`
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
touch-action: manipulation;
`,resting:xt,dragging:Yf,dropAnimating:xt}}}(),je=function(){var xt=`
transition: `+Bl.outOfTheWay+`;
`;return{selector:xe(Eh.contextId),styles:{dragging:xt,dropAnimating:xt,userCancel:xt}}}(),et={selector:xe(Gg.contextId),styles:{always:"overflow-anchor: none;"}},tt={selector:"body",styles:{dragging:`
cursor: grabbing;
cursor: -webkit-grabbing;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
overflow-anchor: none;
`}},gt=[je,Be,et,tt];return{always:Wu(gt,"always"),resting:Wu(gt,"resting"),dragging:Wu(gt,"dragging"),dropAnimating:Wu(gt,"dropAnimating"),userCancel:Wu(gt,"userCancel")}},Al=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?le.useLayoutEffect:le.useEffect,Hu=function(){var xe=document.querySelector("head");return xe||jt(!1),xe},jd=function(xe){var Be=document.createElement("style");return xe&&Be.setAttribute("nonce",xe),Be.type="text/css",Be};function Xf(ve,xe){var Be=zn(function(){return Bc(ve)},[ve]),je=(0,le.useRef)(null),et=(0,le.useRef)(null),tt=on(Ni(function($t){var ln=et.current;ln||jt(!1),ln.textContent=$t}),[]),gt=on(function($t){var ln=je.current;ln||jt(!1),ln.textContent=$t},[]);Al(function(){!je.current&&!et.current||jt(!1);var $t=jd(xe),ln=jd(xe);return je.current=$t,et.current=ln,$t.setAttribute(sd+"-always",ve),ln.setAttribute(sd+"-dynamic",ve),Hu().appendChild($t),Hu().appendChild(ln),gt(Be.always),tt(Be.resting),function(){var Cn=function(Or){var Yr=Or.current;Yr||jt(!1),Hu().removeChild(Yr),Or.current=null};Cn(je),Cn(et)}},[xe,gt,tt,Be.always,Be.resting,ve]);var xt=on(function(){return tt(Be.dragging)},[tt,Be.dragging]),Jt=on(function($t){if($t==="DROP"){tt(Be.dropAnimating);return}tt(Be.userCancel)},[tt,Be.dropAnimating,Be.userCancel]),gn=on(function(){et.current&&tt(Be.resting)},[tt,Be.resting]),cn=zn(function(){return{dragging:xt,dropping:Jt,resting:gn}},[xt,Jt,gn]);return cn}var zs=function(ve){return ve&&ve.ownerDocument?ve.ownerDocument.defaultView:window};function Ch(ve){return ve instanceof zs(ve).HTMLElement}function bh(ve,xe){var Be="["+yu.contextId+'="'+ve+'"]',je=fa(document.querySelectorAll(Be));if(!je.length)return null;var et=ro(je,function(tt){return tt.getAttribute(yu.draggableId)===xe});return!et||!Ch(et)?null:et}function ld(ve){var xe=(0,le.useRef)({}),Be=(0,le.useRef)(null),je=(0,le.useRef)(null),et=(0,le.useRef)(!1),tt=on(function(ln,Cn){var Ai={id:ln,focus:Cn};return xe.current[ln]=Ai,function(){var Yr=xe.current,eo=Yr[ln];eo!==Ai&&delete Yr[ln]}},[]),gt=on(function(ln){var Cn=bh(ve,ln);Cn&&Cn!==document.activeElement&&Cn.focus()},[ve]),xt=on(function(ln,Cn){Be.current===ln&&(Be.current=Cn)},[]),Jt=on(function(){je.current||et.current&&(je.current=requestAnimationFrame(function(){je.current=null;var ln=Be.current;ln&&gt(ln)}))},[gt]),gn=on(function(ln){Be.current=null;var Cn=document.activeElement;Cn&&Cn.getAttribute(yu.draggableId)===ln&&(Be.current=ln)},[]);Al(function(){return et.current=!0,function(){et.current=!1;var ln=je.current;ln&&cancelAnimationFrame(ln)}},[]);var cn=zn(function(){return{register:tt,tryRecordFocus:gn,tryRestoreFocusRecorded:Jt,tryShiftRecord:xt}},[tt,gn,Jt,xt]);return cn}function Mc(){var ve={draggables:{},droppables:{}},xe=[];function Be($t){return xe.push($t),function(){var Cn=xe.indexOf($t);Cn!==-1&&xe.splice(Cn,1)}}function je($t){xe.length&&xe.forEach(function(ln){return ln($t)})}function et($t){return ve.draggables[$t]||null}function tt($t){var ln=et($t);return ln||jt(!1),ln}var gt={register:function(ln){ve.draggables[ln.descriptor.id]=ln,je({type:"ADDITION",value:ln})},update:function(ln,Cn){var Ai=ve.draggables[Cn.descriptor.id];Ai&&Ai.uniqueId===ln.uniqueId&&(delete ve.draggables[Cn.descriptor.id],ve.draggables[ln.descriptor.id]=ln)},unregister:function(ln){var Cn=ln.descriptor.id,Ai=et(Cn);Ai&&ln.uniqueId===Ai.uniqueId&&(delete ve.draggables[Cn],je({type:"REMOVAL",value:ln}))},getById:tt,findById:et,exists:function(ln){return!!et(ln)},getAllByType:function(ln){return Qo(ve.draggables).filter(function(Cn){return Cn.descriptor.type===ln})}};function xt($t){return ve.droppables[$t]||null}function Jt($t){var ln=xt($t);return ln||jt(!1),ln}var gn={register:function(ln){ve.droppables[ln.descriptor.id]=ln},unregister:function(ln){var Cn=xt(ln.descriptor.id);Cn&&ln.uniqueId===Cn.uniqueId&&delete ve.droppables[ln.descriptor.id]},getById:Jt,findById:xt,exists:function(ln){return!!xt(ln)},getAllByType:function(ln){return Qo(ve.droppables).filter(function(Cn){return Cn.descriptor.type===ln})}};function cn(){ve.draggables={},ve.droppables={},xe.length=0}return{draggable:gt,droppable:gn,subscribe:Be,clean:cn}}function Jf(){var ve=zn(Mc,[]);return(0,le.useEffect)(function(){return function(){requestAnimationFrame(ve.clean)}},[ve]),ve}var zh=le.createContext(null),zd=function(){var ve=document.body;return ve||jt(!1),ve},ud={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},xu=function(xe){return"rbd-announcement-"+xe};function Wg(ve){var xe=zn(function(){return xu(ve)},[ve]),Be=(0,le.useRef)(null);(0,le.useEffect)(function(){var tt=document.createElement("div");return Be.current=tt,tt.id=xe,tt.setAttribute("aria-live","assertive"),tt.setAttribute("aria-atomic","true"),(0,it.Z)(tt.style,ud),zd().appendChild(tt),function(){setTimeout(function(){var Jt=zd();Jt.contains(tt)&&Jt.removeChild(tt),tt===Be.current&&(Be.current=null)})}},[xe]);var je=on(function(et){var tt=Be.current;if(tt){tt.textContent=et;return}},[]);return je}var mf=0,hd={separator:"::"};function Zd(){mf=0}function ws(ve,xe){return xe===void 0&&(xe=hd),zn(function(){return""+ve+xe.separator+mf++},[xe.separator,ve])}function Fh(ve){var xe=ve.contextId,Be=ve.uniqueId;return"rbd-hidden-text-"+xe+"-"+Be}function Hg(ve){var xe=ve.contextId,Be=ve.text,je=ws("hidden-text",{separator:"-"}),et=zn(function(){return Fh({contextId:xe,uniqueId:je})},[je,xe]);return(0,le.useEffect)(function(){var gt=document.createElement("div");return gt.id=et,gt.textContent=Be,gt.style.display="none",zd().appendChild(gt),function(){var Jt=zd();Jt.contains(gt)&&Jt.removeChild(gt)}},[et,Be]),et}var dd=le.createContext(null),Vg={react:"^16.8.5","react-dom":"^16.8.5"},Vt=/(\d+)\.(\d+)\.(\d+)/,Zh=function(xe){var Be=Vt.exec(xe);Be==null&&jt(!1);var je=Number(Be[1]),et=Number(Be[2]),tt=Number(Be[3]);return{major:je,minor:et,patch:tt,raw:xe}},sh=function(xe,Be){return Be.major>xe.major?!0:Be.major<xe.major?!1:Be.minor>xe.minor?!0:Be.minor<xe.minor?!1:Be.patch>=xe.patch},Kg=function(ve,xe){var Be=Zh(ve),je=Zh(xe);sh(Be,je)},Ug=`
We expect a html5 doctype: <!doctype html>
This is to ensure consistent browser layout and measurement
More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/doctype.md
`,Yg=function(ve){var xe=ve.doctype;xe&&(xe.name.toLowerCase(),xe.publicId)};function Xg(ve){}function kc(ve,xe){}function sl(){kc(function(){Kg(Vg.react,le.version),Yg(document)},[])}function cd(ve){var xe=(0,le.useRef)(ve);return(0,le.useEffect)(function(){xe.current=ve}),xe}function Qf(){var ve=null;function xe(){return!!ve}function Be(gt){return gt===ve}function je(gt){ve&&jt(!1);var xt={abandon:gt};return ve=xt,xt}function et(){ve||jt(!1),ve=null}function tt(){ve&&(ve.abandon(),et())}return{isClaimed:xe,isActive:Be,claim:je,release:et,tryAbandon:tt}}var Jg=9,Qg=13,vf=27,$f=32,qf=33,cu=34,Gd=35,eg=36,lh=37,Ac=38,yf=39,Nc=40,pl,tg=(pl={},pl[Qg]=!0,pl[Jg]=!0,pl),xf=function(ve){tg[ve.keyCode]&&ve.preventDefault()},jl=function(){var ve="visibilitychange";if(typeof document=="undefined")return ve;var xe=[ve,"ms"+ve,"webkit"+ve,"moz"+ve,"o"+ve],Be=ro(xe,function(je){return"on"+je in document});return Be||ve}(),fd=0,Sf=5;function $g(ve,xe){return Math.abs(xe.x-ve.x)>=Sf||Math.abs(xe.y-ve.y)>=Sf}var Gh={type:"IDLE"};function $l(ve){var xe=ve.cancel,Be=ve.completed,je=ve.getPhase,et=ve.setPhase;return[{eventName:"mousemove",fn:function(gt){var xt=gt.button,Jt=gt.clientX,gn=gt.clientY;if(xt===fd){var cn={x:Jt,y:gn},$t=je();if($t.type==="DRAGGING"){gt.preventDefault(),$t.actions.move(cn);return}$t.type!=="PENDING"&&jt(!1);var ln=$t.point;if($g(ln,cn)){gt.preventDefault();var Cn=$t.actions.fluidLift(cn);et({type:"DRAGGING",actions:Cn})}}}},{eventName:"mouseup",fn:function(gt){var xt=je();if(xt.type!=="DRAGGING"){xe();return}gt.preventDefault(),xt.actions.drop({shouldBlockNextClick:!0}),Be()}},{eventName:"mousedown",fn:function(gt){je().type==="DRAGGING"&&gt.preventDefault(),xe()}},{eventName:"keydown",fn:function(gt){var xt=je();if(xt.type==="PENDING"){xe();return}if(gt.keyCode===vf){gt.preventDefault(),xe();return}xf(gt)}},{eventName:"resize",fn:xe},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){je().type==="PENDING"&&xe()}},{eventName:"webkitmouseforcedown",fn:function(gt){var xt=je();if(xt.type==="IDLE"&&jt(!1),xt.actions.shouldRespectForcePress()){xe();return}gt.preventDefault()}},{eventName:jl,fn:xe}]}function ng(ve){var xe=(0,le.useRef)(Gh),Be=(0,le.useRef)(Yn),je=zn(function(){return{eventName:"mousedown",fn:function($t){if(!$t.defaultPrevented&&$t.button===fd&&!($t.ctrlKey||$t.metaKey||$t.shiftKey||$t.altKey)){var ln=ve.findClosestDraggableId($t);if(ln){var Cn=ve.tryGetLock(ln,gt,{sourceEvent:$t});if(Cn){$t.preventDefault();var Ai={x:$t.clientX,y:$t.clientY};Be.current(),gn(Cn,Ai)}}}}}},[ve]),et=zn(function(){return{eventName:"webkitmouseforcewillbegin",fn:function($t){if(!$t.defaultPrevented){var ln=ve.findClosestDraggableId($t);if(ln){var Cn=ve.findOptionsForDraggable(ln);Cn&&(Cn.shouldRespectForcePress||ve.canGetLock(ln)&&$t.preventDefault())}}}}},[ve]),tt=on(function(){var $t={passive:!1,capture:!0};Be.current=Bt(window,[et,je],$t)},[et,je]),gt=on(function(){var cn=xe.current;cn.type!=="IDLE"&&(xe.current=Gh,Be.current(),tt())},[tt]),xt=on(function(){var cn=xe.current;gt(),cn.type==="DRAGGING"&&cn.actions.cancel({shouldBlockNextClick:!0}),cn.type==="PENDING"&&cn.actions.abort()},[gt]),Jt=on(function(){var $t={capture:!0,passive:!1},ln=$l({cancel:xt,completed:gt,getPhase:function(){return xe.current},setPhase:function(Ai){xe.current=Ai}});Be.current=Bt(window,ln,$t)},[xt,gt]),gn=on(function($t,ln){xe.current.type!=="IDLE"&&jt(!1),xe.current={type:"PENDING",point:ln,actions:$t},Jt()},[Jt]);Al(function(){return tt(),function(){Be.current()}},[tt])}var Ps;function Dc(){}var wf=(Ps={},Ps[cu]=!0,Ps[qf]=!0,Ps[eg]=!0,Ps[Gd]=!0,Ps);function Wh(ve,xe){function Be(){xe(),ve.cancel()}function je(){xe(),ve.drop()}return[{eventName:"keydown",fn:function(tt){if(tt.keyCode===vf){tt.preventDefault(),Be();return}if(tt.keyCode===$f){tt.preventDefault(),je();return}if(tt.keyCode===Nc){tt.preventDefault(),ve.moveDown();return}if(tt.keyCode===Ac){tt.preventDefault(),ve.moveUp();return}if(tt.keyCode===yf){tt.preventDefault(),ve.moveRight();return}if(tt.keyCode===lh){tt.preventDefault(),ve.moveLeft();return}if(wf[tt.keyCode]){tt.preventDefault();return}xf(tt)}},{eventName:"mousedown",fn:Be},{eventName:"mouseup",fn:Be},{eventName:"click",fn:Be},{eventName:"touchstart",fn:Be},{eventName:"resize",fn:Be},{eventName:"wheel",fn:Be,options:{passive:!0}},{eventName:jl,fn:Be}]}function Wd(ve){var xe=(0,le.useRef)(Dc),Be=zn(function(){return{eventName:"keydown",fn:function(tt){if(tt.defaultPrevented||tt.keyCode!==$f)return;var gt=ve.findClosestDraggableId(tt);if(!gt)return;var xt=ve.tryGetLock(gt,cn,{sourceEvent:tt});if(!xt)return;tt.preventDefault();var Jt=!0,gn=xt.snapLift();xe.current();function cn(){Jt||jt(!1),Jt=!1,xe.current(),je()}xe.current=Bt(window,Wh(gn,cn),{capture:!0,passive:!1})}}},[ve]),je=on(function(){var tt={passive:!1,capture:!0};xe.current=Bt(window,[Be],tt)},[Be]);Al(function(){return je(),function(){xe.current()}},[je])}var Hh={type:"IDLE"},ig=120,Hd=.15;function rg(ve){var xe=ve.cancel,Be=ve.getPhase;return[{eventName:"orientationchange",fn:xe},{eventName:"resize",fn:xe},{eventName:"contextmenu",fn:function(et){et.preventDefault()}},{eventName:"keydown",fn:function(et){if(Be().type!=="DRAGGING"){xe();return}et.keyCode===vf&&et.preventDefault(),xe()}},{eventName:jl,fn:xe}]}function uh(ve){var xe=ve.cancel,Be=ve.completed,je=ve.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(tt){var gt=je();if(gt.type!=="DRAGGING"){xe();return}gt.hasMoved=!0;var xt=tt.touches[0],Jt=xt.clientX,gn=xt.clientY,cn={x:Jt,y:gn};tt.preventDefault(),gt.actions.move(cn)}},{eventName:"touchend",fn:function(tt){var gt=je();if(gt.type!=="DRAGGING"){xe();return}tt.preventDefault(),gt.actions.drop({shouldBlockNextClick:!0}),Be()}},{eventName:"touchcancel",fn:function(tt){if(je().type!=="DRAGGING"){xe();return}tt.preventDefault(),xe()}},{eventName:"touchforcechange",fn:function(tt){var gt=je();gt.type==="IDLE"&&jt(!1);var xt=tt.touches[0];if(xt){var Jt=xt.force>=Hd;if(Jt){var gn=gt.actions.shouldRespectForcePress();if(gt.type==="PENDING"){gn&&xe();return}if(gn){if(gt.hasMoved){tt.preventDefault();return}xe();return}tt.preventDefault()}}}},{eventName:jl,fn:xe}]}function gd(ve){var xe=(0,le.useRef)(Hh),Be=(0,le.useRef)(Yn),je=on(function(){return xe.current},[]),et=on(function(Cn){xe.current=Cn},[]),tt=zn(function(){return{eventName:"touchstart",fn:function(Cn){if(!Cn.defaultPrevented){var Ai=ve.findClosestDraggableId(Cn);if(Ai){var Or=ve.tryGetLock(Ai,xt,{sourceEvent:Cn});if(Or){var Yr=Cn.touches[0],eo=Yr.clientX,No=Yr.clientY,Ro={x:eo,y:No};Be.current(),$t(Or,Ro)}}}}}},[ve]),gt=on(function(){var Cn={capture:!0,passive:!1};Be.current=Bt(window,[tt],Cn)},[tt]),xt=on(function(){var ln=xe.current;ln.type!=="IDLE"&&(ln.type==="PENDING"&&clearTimeout(ln.longPressTimerId),et(Hh),Be.current(),gt())},[gt,et]),Jt=on(function(){var ln=xe.current;xt(),ln.type==="DRAGGING"&&ln.actions.cancel({shouldBlockNextClick:!0}),ln.type==="PENDING"&&ln.actions.abort()},[xt]),gn=on(function(){var Cn={capture:!0,passive:!1},Ai={cancel:Jt,completed:xt,getPhase:je},Or=Bt(window,uh(Ai),Cn),Yr=Bt(window,rg(Ai),Cn);Be.current=function(){Or(),Yr()}},[Jt,je,xt]),cn=on(function(){var Cn=je();Cn.type!=="PENDING"&&jt(!1);var Ai=Cn.actions.fluidLift(Cn.point);et({type:"DRAGGING",actions:Ai,hasMoved:!1})},[je,et]),$t=on(function(Cn,Ai){je().type!=="IDLE"&&jt(!1);var Or=setTimeout(cn,ig);et({type:"PENDING",point:Ai,actions:Cn,longPressTimerId:Or}),gn()},[gn,je,et,cn]);Al(function(){return gt(),function(){Be.current();var Ai=je();Ai.type==="PENDING"&&(clearTimeout(Ai.longPressTimerId),et(Hh))}},[je,gt,et]),Al(function(){var Cn=Bt(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return Cn},[])}function Pf(ve){}var Ef={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function Tc(ve,xe){if(xe==null)return!1;var Be=!!Ef[xe.tagName.toLowerCase()];if(Be)return!0;var je=xe.getAttribute("contenteditable");return je==="true"||je===""?!0:xe===ve?!1:Tc(ve,xe.parentElement)}function pd(ve,xe){var Be=xe.target;return Ch(Be)?Tc(ve,Be):!1}var og=function(ve){return gi(ve.getBoundingClientRect()).center};function ag(ve){return ve instanceof zs(ve).Element}var sg=function(){var ve="matches";if(typeof document=="undefined")return ve;var xe=[ve,"msMatchesSelector","webkitMatchesSelector"],Be=ro(xe,function(je){return je in Element.prototype});return Be||ve}();function Mu(ve,xe){return ve==null?null:ve[sg](xe)?ve:Mu(ve.parentElement,xe)}function qg(ve,xe){return ve.closest?ve.closest(xe):Mu(ve,xe)}function lg(ve){return"["+yu.contextId+'="'+ve+'"]'}function Vd(ve,xe){var Be=xe.target;if(!ag(Be))return null;var je=lg(ve),et=qg(Be,je);return!et||!Ch(et)?null:et}function md(ve,xe){var Be=Vd(ve,xe);return Be?Be.getAttribute(yu.draggableId):null}function ug(ve,xe){var Be="["+Eh.contextId+'="'+ve+'"]',je=fa(document.querySelectorAll(Be)),et=ro(je,function(tt){return tt.getAttribute(Eh.id)===xe});return!et||!Ch(et)?null:et}function Vu(ve){ve.preventDefault()}function Kd(ve){var xe=ve.expected,Be=ve.phase,je=ve.isLockActive,et=ve.shouldWarn;return!(!je()||xe!==Be)}function _c(ve){var xe=ve.lockAPI,Be=ve.store,je=ve.registry,et=ve.draggableId;if(xe.isClaimed())return!1;var tt=je.draggable.findById(et);return!(!tt||!tt.options.isEnabled||!os(Be.getState(),et))}function ep(ve){var xe=ve.lockAPI,Be=ve.contextId,je=ve.store,et=ve.registry,tt=ve.draggableId,gt=ve.forceSensorStop,xt=ve.sourceEvent,Jt=_c({lockAPI:xe,store:je,registry:et,draggableId:tt});if(!Jt)return null;var gn=et.draggable.getById(tt),cn=ug(Be,gn.descriptor.id);if(!cn||xt&&!gn.options.canDragInteractiveElements&&pd(cn,xt))return null;var $t=xe.claim(gt||Yn),ln="PRE_DRAG";function Cn(){return gn.options.shouldRespectForcePress}function Ai(){return xe.isActive($t)}function Or(da,es){Kd({expected:da,phase:ln,isLockActive:Ai,shouldWarn:!0})&&je.dispatch(es())}var Yr=Or.bind(null,"DRAGGING");function eo(da){function es(){xe.release(),ln="COMPLETED"}ln!=="PRE_DRAG"&&(es(),ln!=="PRE_DRAG"&&jt(!1)),je.dispatch(Ur(da.liftActionArgs)),ln="DRAGGING";function Js(is,Ts){if(Ts===void 0&&(Ts={shouldBlockNextClick:!1}),da.cleanup(),Ts.shouldBlockNextClick){var vl=Bt(window,[{eventName:"click",fn:Vu,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(vl)}es(),je.dispatch(Ia({reason:is}))}return(0,it.Z)({isActive:function(){return Kd({expected:"DRAGGING",phase:ln,isLockActive:Ai,shouldWarn:!1})},shouldRespectForcePress:Cn,drop:function(Ts){return Js("DROP",Ts)},cancel:function(Ts){return Js("CANCEL",Ts)}},da.actions)}function No(da){var es=zt(function(is){Yr(function(){return oo({client:is})})}),Js=eo({liftActionArgs:{id:tt,clientSelection:da,movementMode:"FLUID"},cleanup:function(){return es.cancel()},actions:{move:es}});return(0,it.Z)({},Js,{move:es})}function Ro(){var da={moveUp:function(){return Yr(_a)},moveRight:function(){return Yr(Ls)},moveDown:function(){return Yr(jr)},moveLeft:function(){return Yr(vo)}};return eo({liftActionArgs:{id:tt,clientSelection:og(cn),movementMode:"SNAP"},cleanup:Yn,actions:da})}function Ho(){var da=Kd({expected:"PRE_DRAG",phase:ln,isLockActive:Ai,shouldWarn:!0});da&&xe.release()}var Ca={isActive:function(){return Kd({expected:"PRE_DRAG",phase:ln,isLockActive:Ai,shouldWarn:!1})},shouldRespectForcePress:Cn,fluidLift:No,snapLift:Ro,abort:Ho};return Ca}var hg=[ng,Wd,gd];function dg(ve){var xe=ve.contextId,Be=ve.store,je=ve.registry,et=ve.customSensors,tt=ve.enableDefaultSensors,gt=[].concat(tt?hg:[],et||[]),xt=(0,le.useState)(function(){return Qf()})[0],Jt=on(function(No,Ro){No.isDragging&&!Ro.isDragging&&xt.tryAbandon()},[xt]);Al(function(){var No=Be.getState(),Ro=Be.subscribe(function(){var Ho=Be.getState();Jt(No,Ho),No=Ho});return Ro},[xt,Be,Jt]),Al(function(){return xt.tryAbandon},[xt.tryAbandon]);var gn=on(function(eo){return _c({lockAPI:xt,registry:je,store:Be,draggableId:eo})},[xt,je,Be]),cn=on(function(eo,No,Ro){return ep({lockAPI:xt,registry:je,contextId:xe,store:Be,draggableId:eo,forceSensorStop:No,sourceEvent:Ro&&Ro.sourceEvent?Ro.sourceEvent:null})},[xe,xt,je,Be]),$t=on(function(eo){return md(xe,eo)},[xe]),ln=on(function(eo){var No=je.draggable.findById(eo);return No?No.options:null},[je.draggable]),Cn=on(function(){xt.isClaimed()&&(xt.tryAbandon(),Be.getState().phase!=="IDLE"&&Be.dispatch(na()))},[xt,Be]),Ai=on(xt.isClaimed,[xt]),Or=zn(function(){return{canGetLock:gn,tryGetLock:cn,findClosestDraggableId:$t,findOptionsForDraggable:ln,tryReleaseLock:Cn,isLockClaimed:Ai}},[gn,cn,$t,ln,Cn,Ai]);Pf(gt);for(var Yr=0;Yr<gt.length;Yr++)gt[Yr](Or)}var Zp=function(xe){return{onBeforeCapture:xe.onBeforeCapture,onBeforeDragStart:xe.onBeforeDragStart,onDragStart:xe.onDragStart,onDragEnd:xe.onDragEnd,onDragUpdate:xe.onDragUpdate}};function Ud(ve){return ve.current||jt(!1),ve.current}function Cf(ve){var xe=ve.contextId,Be=ve.setCallbacks,je=ve.sensors,et=ve.nonce,tt=ve.dragHandleUsageInstructions,gt=(0,le.useRef)(null);sl();var xt=cd(ve),Jt=on(function(){return Zp(xt.current)},[xt]),gn=Wg(xe),cn=Hg({contextId:xe,text:tt}),$t=Xf(xe,et),ln=on(function(is){Ud(gt).dispatch(is)},[]),Cn=zn(function(){return(0,bt.DE)({publishWhileDragging:Fo,updateDroppableScroll:so,updateDroppableIsEnabled:er,updateDroppableIsCombineEnabled:Tr,collectionStarting:vr},ln)},[ln]),Ai=Jf(),Or=zn(function(){return vu(Ai,Cn)},[Ai,Cn]),Yr=zn(function(){return pf((0,it.Z)({scrollWindow:Lu,scrollDroppable:Or.scrollDroppable},(0,bt.DE)({move:oo},ln)))},[Or.scrollDroppable,ln]),eo=ld(xe),No=zn(function(){return ms({announce:gn,autoScroller:Yr,dimensionMarshal:Or,focusMarshal:eo,getResponders:Jt,styleMarshal:$t})},[gn,Yr,Or,eo,Jt,$t]);gt.current=No;var Ro=on(function(){var is=Ud(gt),Ts=is.getState();Ts.phase!=="IDLE"&&is.dispatch(na())},[]),Ho=on(function(){var is=Ud(gt).getState();return is.isDragging||is.phase==="DROP_ANIMATING"},[]),Ca=zn(function(){return{isDragging:Ho,tryAbort:Ro}},[Ho,Ro]);Be(Ca);var da=on(function(is){return os(Ud(gt).getState(),is)},[]),es=on(function(){return ga(Ud(gt).getState())},[]),Js=zn(function(){return{marshal:Or,focus:eo,contextId:xe,canLift:da,isMovementAllowed:es,dragHandleUsageInstructionsId:cn,registry:Ai}},[xe,Or,cn,eo,da,es,Ai]);return dg({contextId:xe,store:No,registry:Ai,customSensors:je,enableDefaultSensors:ve.enableDefaultSensors!==!1}),(0,le.useEffect)(function(){return Ro},[Ro]),le.createElement(dd.Provider,{value:Js},le.createElement(te,{context:zh,store:No},ve.children))}var Ic=0;function bf(){Ic=0}function tp(){return zn(function(){return""+Ic++},[])}function cg(){bf(),Zd()}function Vh(ve){var xe=tp(),Be=ve.dragHandleUsageInstructions||ki.dragHandleUsageInstructions;return le.createElement(Un,null,function(je){return le.createElement(Cf,{nonce:ve.nonce,contextId:xe,setCallbacks:je,dragHandleUsageInstructions:Be,enableDefaultSensors:ve.enableDefaultSensors,sensors:ve.sensors,onBeforeCapture:ve.onBeforeCapture,onBeforeDragStart:ve.onBeforeDragStart,onDragStart:ve.onDragStart,onDragUpdate:ve.onDragUpdate,onDragEnd:ve.onDragEnd},ve.children)})}var Oc=function(xe){return function(Be){return xe===Be}},Rc=Oc("scroll"),np=Oc("auto"),Ff=Oc("visible"),fg=function(xe,Be){return Be(xe.overflowX)||Be(xe.overflowY)},Ja=function(xe,Be){return Be(xe.overflowX)&&Be(xe.overflowY)},vd=function(xe){var Be=window.getComputedStyle(xe),je={overflowX:Be.overflowX,overflowY:Be.overflowY};return fg(je,Rc)||fg(je,np)},yd=function(){return!1;var xe,Be,je,et},Ys=function ve(xe){return xe==null?null:xe===document.body?yd()?xe:null:xe===document.documentElement?null:vd(xe)?xe:ve(xe.parentElement)},ql=function(ve){if(ve)var xe=Ys(ve.parentElement)},Lh=function(ve){return{x:ve.scrollLeft,y:ve.scrollTop}},jc=function ve(xe){if(!xe)return!1;var Be=window.getComputedStyle(xe);return Be.position==="fixed"?!0:ve(xe.parentElement)},gg=function(ve){var xe=Ys(ve),Be=jc(ve);return{closestScrollable:xe,isFixedOnPage:Be}},pg=function(ve){var xe=ve.descriptor,Be=ve.isEnabled,je=ve.isCombineEnabled,et=ve.isFixedOnPage,tt=ve.direction,gt=ve.client,xt=ve.page,Jt=ve.closest,gn=function(){if(!Jt)return null;var Cn=Jt.scrollSize,Ai=Jt.client,Or=Sh({scrollHeight:Cn.scrollHeight,scrollWidth:Cn.scrollWidth,height:Ai.paddingBox.height,width:Ai.paddingBox.width});return{pageMarginBox:Jt.page.marginBox,frameClient:Ai,scrollSize:Cn,shouldClipSubject:Jt.shouldClipSubject,scroll:{initial:Jt.scroll,current:Jt.scroll,max:Or,diff:{value:Ar,displacement:Ar}}}}(),cn=tt==="vertical"?Yi:Pn,$t=Er({page:xt,withPlaceholder:null,axis:cn,frame:gn}),ln={descriptor:xe,isCombineEnabled:je,isFixedOnPage:et,axis:cn,isEnabled:Be,client:gt,page:xt,frame:gn,subject:$t};return ln},mg=function(xe,Be){var je=mn(xe);if(!Be||xe!==Be)return je;var et=je.paddingBox.top-Be.scrollTop,tt=je.paddingBox.left-Be.scrollLeft,gt=et+Be.scrollHeight,xt=tt+Be.scrollWidth,Jt={top:et,right:xt,bottom:gt,left:tt},gn=Hi(Jt,je.border),cn=Xn({borderBox:gn,margin:je.margin,border:je.border,padding:je.padding});return cn},vg=function(ve){var xe=ve.ref,Be=ve.descriptor,je=ve.env,et=ve.windowScroll,tt=ve.direction,gt=ve.isDropDisabled,xt=ve.isCombineEnabled,Jt=ve.shouldClipSubject,gn=je.closestScrollable,cn=mg(xe,gn),$t=Cr(cn,et),ln=function(){if(!gn)return null;var Ai=mn(gn),Or={scrollHeight:gn.scrollHeight,scrollWidth:gn.scrollWidth};return{client:Ai,page:Cr(Ai,et),scroll:Lh(gn),scrollSize:Or,shouldClipSubject:Jt}}(),Cn=pg({descriptor:Be,isEnabled:!gt,isCombineEnabled:xt,isFixedOnPage:je.isFixedOnPage,direction:tt,client:cn,page:$t,closest:ln});return Cn},yg={passive:!1},Kh={passive:!0},Yd=function(ve){return ve.shouldPublishImmediately?yg:Kh};function Ku(ve){var xe=(0,le.useContext)(ve);return xe||jt(!1),xe}var as=function(xe){return xe&&xe.env.closestScrollable||null};function Lf(ve){var xe=(0,le.useRef)(null),Be=Ku(dd),je=ws("droppable"),et=Be.registry,tt=Be.marshal,gt=cd(ve),xt=zn(function(){return{id:ve.droppableId,type:ve.type,mode:ve.mode}},[ve.droppableId,ve.mode,ve.type]),Jt=(0,le.useRef)(xt),gn=zn(function(){return Ni(function(Ho,Ca){xe.current||jt(!1);var da={x:Ho,y:Ca};tt.updateDroppableScroll(xt.id,da)})},[xt.id,tt]),cn=on(function(){var Ho=xe.current;return!Ho||!Ho.env.closestScrollable?Ar:Lh(Ho.env.closestScrollable)},[]),$t=on(function(){var Ho=cn();gn(Ho.x,Ho.y)},[cn,gn]),ln=zn(function(){return zt($t)},[$t]),Cn=on(function(){var Ho=xe.current,Ca=as(Ho);Ho&&Ca||jt(!1);var da=Ho.scrollOptions;if(da.shouldPublishImmediately){$t();return}ln()},[ln,$t]),Ai=on(function(Ho,Ca){xe.current&&jt(!1);var da=gt.current,es=da.getDroppableRef();es||jt(!1);var Js=gg(es),is={ref:es,descriptor:xt,env:Js,scrollOptions:Ca};xe.current=is;var Ts=vg({ref:es,descriptor:xt,env:Js,windowScroll:Ho,direction:da.direction,isDropDisabled:da.isDropDisabled,isCombineEnabled:da.isCombineEnabled,shouldClipSubject:!da.ignoreContainerClipping}),vl=Js.closestScrollable;return vl&&(vl.setAttribute(Lc.contextId,Be.contextId),vl.addEventListener("scroll",Cn,Yd(is.scrollOptions))),Ts},[Be.contextId,xt,Cn,gt]),Or=on(function(){var Ho=xe.current,Ca=as(Ho);return Ho&&Ca||jt(!1),Lh(Ca)},[]),Yr=on(function(){var Ho=xe.current;Ho||jt(!1);var Ca=as(Ho);xe.current=null,Ca&&(ln.cancel(),Ca.removeAttribute(Lc.contextId),Ca.removeEventListener("scroll",Cn,Yd(Ho.scrollOptions)))},[Cn,ln]),eo=on(function(Ho){var Ca=xe.current;Ca||jt(!1);var da=as(Ca);da||jt(!1),da.scrollTop+=Ho.y,da.scrollLeft+=Ho.x},[]),No=zn(function(){return{getDimensionAndWatchScroll:Ai,getScrollWhileDragging:Or,dragStopped:Yr,scroll:eo}},[Yr,Ai,Or,eo]),Ro=zn(function(){return{uniqueId:je,descriptor:xt,callbacks:No}},[No,xt,je]);Al(function(){return Jt.current=Ro.descriptor,et.droppable.register(Ro),function(){xe.current&&Yr(),et.droppable.unregister(Ro)}},[No,xt,Yr,Ro,tt,et.droppable]),Al(function(){xe.current&&tt.updateDroppableIsEnabled(Jt.current.id,!ve.isDropDisabled)},[ve.isDropDisabled,tt]),Al(function(){xe.current&&tt.updateDroppableIsCombineEnabled(Jt.current.id,ve.isCombineEnabled)},[ve.isCombineEnabled,tt])}function zc(){}var xd={width:0,height:0,margin:Io},Xd=function(xe){var Be=xe.isAnimatingOpenOnMount,je=xe.placeholder,et=xe.animate;return Be||et==="close"?xd:{height:je.client.borderBox.height,width:je.client.borderBox.width,margin:je.client.margin}},Zc=function(xe){var Be=xe.isAnimatingOpenOnMount,je=xe.placeholder,et=xe.animate,tt=Xd({isAnimatingOpenOnMount:Be,placeholder:je,animate:et});return{display:je.display,boxSizing:"border-box",width:tt.width,height:tt.height,marginTop:tt.margin.top,marginRight:tt.margin.right,marginBottom:tt.margin.bottom,marginLeft:tt.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:et!=="none"?Bl.placeholder:null}};function ip(ve){var xe=(0,le.useRef)(null),Be=on(function(){xe.current&&(clearTimeout(xe.current),xe.current=null)},[]),je=ve.animate,et=ve.onTransitionEnd,tt=ve.onClose,gt=ve.contextId,xt=(0,le.useState)(ve.animate==="open"),Jt=xt[0],gn=xt[1];(0,le.useEffect)(function(){return Jt?je!=="open"?(Be(),gn(!1),zc):xe.current?zc:(xe.current=setTimeout(function(){xe.current=null,gn(!1)}),Be):zc},[je,Jt,Be]);var cn=on(function(ln){ln.propertyName==="height"&&(et(),je==="close"&&tt())},[je,tt,et]),$t=Zc({isAnimatingOpenOnMount:Jt,animate:ve.animate,placeholder:ve.placeholder});return le.createElement(ve.placeholder.tagName,{style:$t,"data-rbd-placeholder-context-id":gt,onTransitionEnd:cn,ref:ve.innerRef})}var Xs=le.memo(ip),Bf=le.createContext(null);function Sd(ve){ve&&Ch(ve)||jt(!1)}function Uu(ve){return typeof ve=="boolean"}function wd(ve,xe){xe.forEach(function(Be){return Be(ve)})}var ie=[function(xe){var Be=xe.props;Be.droppableId||jt(!1),typeof Be.droppableId!="string"&&jt(!1)},function(xe){var Be=xe.props;Uu(Be.isDropDisabled)||jt(!1),Uu(Be.isCombineEnabled)||jt(!1),Uu(Be.ignoreContainerClipping)||jt(!1)},function(xe){var Be=xe.getDroppableRef;Sd(Be())}],ae=[function(xe){var Be=xe.props,je=xe.getPlaceholderRef;if(Be.placeholder)var et=je()}],fe=[function(xe){var Be=xe.props;Be.renderClone||jt(!1)},function(xe){var Be=xe.getPlaceholderRef;Be()&&jt(!1)}];function ce(ve){kc(function(){wd(ve,ie),ve.props.mode==="standard"&&wd(ve,ae),ve.props.mode==="virtual"&&wd(ve,fe)})}var me=function(ve){(0,Ke.Z)(xe,ve);function xe(){for(var je,et=arguments.length,tt=new Array(et),gt=0;gt<et;gt++)tt[gt]=arguments[gt];return je=ve.call.apply(ve,[this].concat(tt))||this,je.state={isVisible:!!je.props.on,data:je.props.on,animate:je.props.shouldAnimate&&je.props.on?"open":"none"},je.onClose=function(){je.state.animate==="close"&&je.setState({isVisible:!1})},je}xe.getDerivedStateFromProps=function(et,tt){return et.shouldAnimate?et.on?{isVisible:!0,data:et.on,animate:"open"}:tt.isVisible?{isVisible:!0,data:tt.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!et.on,data:et.on,animate:"none"}};var Be=xe.prototype;return Be.render=function(){if(!this.state.isVisible)return null;var et={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(et)},xe}(le.PureComponent),ke={dragging:5e3,dropAnimating:4500},Ge=function(xe,Be){return Be?Bl.drop(Be.duration):xe?Bl.snap:Bl.fluid},Je=function(xe,Be){return xe?Be?al.opacity.drop:al.opacity.combining:null},Ye=function(xe){return xe.forceShouldAnimate!=null?xe.forceShouldAnimate:xe.mode==="SNAP"};function yt(ve){var xe=ve.dimension,Be=xe.client,je=ve.offset,et=ve.combineWith,tt=ve.dropping,gt=!!et,xt=Ye(ve),Jt=!!tt,gn=Jt?Oa.drop(je,gt):Oa.moveTo(je),cn={position:"fixed",top:Be.marginBox.top,left:Be.marginBox.left,boxSizing:"border-box",width:Be.borderBox.width,height:Be.borderBox.height,transition:Ge(xt,tt),transform:gn,opacity:Je(gt,Jt),zIndex:Jt?ke.dropAnimating:ke.dragging,pointerEvents:"none"};return cn}function sn(ve){return{transform:Oa.moveTo(ve.offset),transition:ve.shouldAnimateDisplacement?null:"none"}}function Ft(ve){return ve.type==="DRAGGING"?yt(ve):sn(ve)}function jn(ve,xe,Be){Be===void 0&&(Be=Ar);var je=window.getComputedStyle(xe),et=xe.getBoundingClientRect(),tt=be(et,je),gt=Cr(tt,Be),xt={client:tt,tagName:xe.tagName.toLowerCase(),display:je.display},Jt={x:tt.marginBox.width,y:tt.marginBox.height},gn={descriptor:ve,placeholder:xt,displaceBy:Jt,client:tt,page:gt};return gn}function kn(ve){var xe=ws("draggable"),Be=ve.descriptor,je=ve.registry,et=ve.getDraggableRef,tt=ve.canDragInteractiveElements,gt=ve.shouldRespectForcePress,xt=ve.isEnabled,Jt=zn(function(){return{canDragInteractiveElements:tt,shouldRespectForcePress:gt,isEnabled:xt}},[tt,xt,gt]),gn=on(function(Cn){var Ai=et();return Ai||jt(!1),jn(Be,Ai,Cn)},[Be,et]),cn=zn(function(){return{uniqueId:xe,descriptor:Be,options:Jt,getDimension:gn}},[Be,gn,Jt,xe]),$t=(0,le.useRef)(cn),ln=(0,le.useRef)(!0);Al(function(){return je.draggable.register($t.current),function(){return je.draggable.unregister($t.current)}},[je.draggable]),Al(function(){if(ln.current){ln.current=!1;return}var Cn=$t.current;$t.current=cn,je.draggable.update(cn,Cn)},[cn,je.draggable])}function ir(ve,xe,Be){kc(function(){function je(tt){return"Draggable[id: "+tt+"]: "}var et=ve.draggableId;et||jt(!1),typeof et!="string"&&jt(!1),wr(ve.index)||jt(!1),ve.mapped.type!=="DRAGGING"&&(Sd(Be()),ve.isEnabled&&(bh(xe,et)||jt(!1)))})}function hr(ve){}function Lr(ve){ve.preventDefault()}function qr(ve){var xe=(0,le.useRef)(null),Be=on(function(is){xe.current=is},[]),je=on(function(){return xe.current},[]),et=Ku(dd),tt=et.contextId,gt=et.dragHandleUsageInstructionsId,xt=et.registry,Jt=Ku(Bf),gn=Jt.type,cn=Jt.droppableId,$t=zn(function(){return{id:ve.draggableId,index:ve.index,type:gn,droppableId:cn}},[ve.draggableId,ve.index,gn,cn]),ln=ve.children,Cn=ve.draggableId,Ai=ve.isEnabled,Or=ve.shouldRespectForcePress,Yr=ve.canDragInteractiveElements,eo=ve.isClone,No=ve.mapped,Ro=ve.dropAnimationFinished;if(ir(ve,tt,je),hr(eo),!eo){var Ho=zn(function(){return{descriptor:$t,registry:xt,getDraggableRef:je,canDragInteractiveElements:Yr,shouldRespectForcePress:Or,isEnabled:Ai}},[$t,xt,je,Yr,Or,Ai]);kn(Ho)}var Ca=zn(function(){return Ai?{tabIndex:0,role:"button","aria-describedby":gt,"data-rbd-drag-handle-draggable-id":Cn,"data-rbd-drag-handle-context-id":tt,draggable:!1,onDragStart:Lr}:null},[tt,gt,Cn,Ai]),da=on(function(is){No.type==="DRAGGING"&&No.dropping&&is.propertyName==="transform"&&Ro()},[Ro,No]),es=zn(function(){var is=Ft(No),Ts=No.type==="DRAGGING"&&No.dropping?da:null,vl={innerRef:Be,draggableProps:{"data-rbd-draggable-context-id":tt,"data-rbd-draggable-id":Cn,style:is,onTransitionEnd:Ts},dragHandleProps:Ca};return vl},[tt,Ca,Cn,No,da,Be]),Js=zn(function(){return{draggableId:$t.id,type:$t.type,source:{index:$t.index,droppableId:$t.droppableId}}},[$t.droppableId,$t.id,$t.index,$t.type]);return ln(es,No.snapshot,Js)}var Ao=function(ve,xe){return ve===xe},ho=function(ve){var xe=ve.combine,Be=ve.destination;return Be?Be.droppableId:xe?xe.droppableId:null},jo=function(xe){return xe.combine?xe.combine.draggableId:null},xa=function(xe){return xe.at&&xe.at.type==="COMBINE"?xe.at.combine.draggableId:null};function co(){var ve=Ni(function(et,tt){return{x:et,y:tt}}),xe=Ni(function(et,tt,gt,xt,Jt){return{isDragging:!0,isClone:tt,isDropAnimating:!!Jt,dropAnimation:Jt,mode:et,draggingOver:gt,combineWith:xt,combineTargetFor:null}}),Be=Ni(function(et,tt,gt,xt,Jt,gn,cn){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:Jt,combineWith:gn,mode:tt,offset:et,dimension:gt,forceShouldAnimate:cn,snapshot:xe(tt,xt,Jt,gn,null)}}}),je=function(tt,gt){if(tt.isDragging){if(tt.critical.draggable.id!==gt.draggableId)return null;var xt=tt.current.client.offset,Jt=tt.dimensions.draggables[gt.draggableId],gn=yo(tt.impact),cn=xa(tt.impact),$t=tt.forceShouldAnimate;return Be(ve(xt.x,xt.y),tt.movementMode,Jt,gt.isClone,gn,cn,$t)}if(tt.phase==="DROP_ANIMATING"){var ln=tt.completed;if(ln.result.draggableId!==gt.draggableId)return null;var Cn=gt.isClone,Ai=tt.dimensions.draggables[gt.draggableId],Or=ln.result,Yr=Or.mode,eo=ho(Or),No=jo(Or),Ro=tt.dropDuration,Ho={duration:Ro,curve:qs.drop,moveTo:tt.newHomeClientOffset,opacity:No?al.opacity.drop:null,scale:No?al.scale.drop:null};return{mapped:{type:"DRAGGING",offset:tt.newHomeClientOffset,dimension:Ai,dropping:Ho,draggingOver:eo,combineWith:No,mode:Yr,forceShouldAnimate:null,snapshot:xe(Yr,Cn,eo,No,Ho)}}}return null};return je}function Ra(ve){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:ve,combineWith:null}}var Es={mapped:{type:"SECONDARY",offset:Ar,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:Ra(null)}};function nl(){var ve=Ni(function(gt,xt){return{x:gt,y:xt}}),xe=Ni(Ra),Be=Ni(function(gt,xt,Jt){return xt===void 0&&(xt=null),{mapped:{type:"SECONDARY",offset:gt,combineTargetFor:xt,shouldAnimateDisplacement:Jt,snapshot:xe(xt)}}}),je=function(xt){return xt?Be(Ar,xt,!0):null},et=function(xt,Jt,gn,cn){var $t=gn.displaced.visible[xt],ln=!!(cn.inVirtualList&&cn.effected[xt]),Cn=Oi(gn),Ai=Cn&&Cn.draggableId===xt?Jt:null;if(!$t){if(!ln)return je(Ai);if(gn.displaced.invisible[xt])return null;var Or=Li(cn.displacedBy.point),Yr=ve(Or.x,Or.y);return Be(Yr,Ai,!0)}if(ln)return je(Ai);var eo=gn.displacedBy.point,No=ve(eo.x,eo.y);return Be(No,Ai,$t.shouldAnimate)},tt=function(xt,Jt){if(xt.isDragging)return xt.critical.draggable.id===Jt.draggableId?null:et(Jt.draggableId,xt.critical.draggable.id,xt.impact,xt.afterCritical);if(xt.phase==="DROP_ANIMATING"){var gn=xt.completed;return gn.result.draggableId===Jt.draggableId?null:et(Jt.draggableId,gn.result.draggableId,gn.impact,gn.afterCritical)}return null};return tt}var Ms=function(){var xe=co(),Be=nl(),je=function(tt,gt){return xe(tt,gt)||Be(tt,gt)||Es};return je},zl={dropAnimationFinished:Yl},ml=an(Ms,zl,null,{context:zh,pure:!0,areStatePropsEqual:Ao})(qr);function Us(ve){var xe=Ku(Bf),Be=xe.isUsingCloneFor;return Be===ve.draggableId&&!ve.isClone?null:le.createElement(ml,ve)}function eu(ve){var xe=typeof ve.isDragDisabled=="boolean"?!ve.isDragDisabled:!0,Be=!!ve.disableInteractiveElementBlocking,je=!!ve.shouldRespectForcePress;return le.createElement(Us,(0,it.Z)({},ve,{isClone:!1,isEnabled:xe,canDragInteractiveElements:Be,shouldRespectForcePress:je}))}function ll(ve){var xe=(0,le.useContext)(dd);xe||jt(!1);var Be=xe.contextId,je=xe.isMovementAllowed,et=(0,le.useRef)(null),tt=(0,le.useRef)(null),gt=ve.children,xt=ve.droppableId,Jt=ve.type,gn=ve.mode,cn=ve.direction,$t=ve.ignoreContainerClipping,ln=ve.isDropDisabled,Cn=ve.isCombineEnabled,Ai=ve.snapshot,Or=ve.useClone,Yr=ve.updateViewportMaxScroll,eo=ve.getContainerForClone,No=on(function(){return et.current},[]),Ro=on(function(Zl){et.current=Zl},[]),Ho=on(function(){return tt.current},[]),Ca=on(function(Zl){tt.current=Zl},[]);ce({props:ve,getDroppableRef:No,getPlaceholderRef:Ho});var da=on(function(){je()&&Yr({maxScroll:js()})},[je,Yr]);Lf({droppableId:xt,type:Jt,mode:gn,direction:cn,isDropDisabled:ln,isCombineEnabled:Cn,ignoreContainerClipping:$t,getDroppableRef:No});var es=le.createElement(me,{on:ve.placeholder,shouldAnimate:ve.shouldAnimatePlaceholder},function(Zl){var Bh=Zl.onClose,Yu=Zl.data,tu=Zl.animate;return le.createElement(Xs,{placeholder:Yu,onClose:Bh,innerRef:Ca,animate:tu,contextId:Be,onTransitionEnd:da})}),Js=zn(function(){return{innerRef:Ro,placeholder:es,droppableProps:{"data-rbd-droppable-id":xt,"data-rbd-droppable-context-id":Be}}},[Be,xt,es,Ro]),is=Or?Or.dragging.draggableId:null,Ts=zn(function(){return{droppableId:xt,type:Jt,isUsingCloneFor:is}},[xt,is,Jt]);function vl(){if(!Or)return null;var Zl=Or.dragging,Bh=Or.render,Yu=le.createElement(Us,{draggableId:Zl.draggableId,index:Zl.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(tu,Xu){return Bh(tu,Xu,Zl)});return Mi.createPortal(Yu,eo())}return le.createElement(Bf.Provider,{value:Ts},gt(Js,Ai),vl())}var Ws=function(xe,Be){return xe===Be.droppable.type},Qa=function(xe,Be){return Be.draggables[xe.draggable.id]},Ds=function(){var xe={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},Be=(0,it.Z)({},xe,{shouldAnimatePlaceholder:!1}),je=Ni(function(gt){return{draggableId:gt.id,type:gt.type,source:{index:gt.index,droppableId:gt.droppableId}}}),et=Ni(function(gt,xt,Jt,gn,cn,$t){var ln=cn.descriptor.id,Cn=cn.descriptor.droppableId===gt;if(Cn){var Ai=$t?{render:$t,dragging:je(cn.descriptor)}:null,Or={isDraggingOver:Jt,draggingOverWith:Jt?ln:null,draggingFromThisWith:ln,isUsingPlaceholder:!0};return{placeholder:cn.placeholder,shouldAnimatePlaceholder:!1,snapshot:Or,useClone:Ai}}if(!xt)return Be;if(!gn)return xe;var Yr={isDraggingOver:Jt,draggingOverWith:ln,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:cn.placeholder,shouldAnimatePlaceholder:!0,snapshot:Yr,useClone:null}}),tt=function(xt,Jt){var gn=Jt.droppableId,cn=Jt.type,$t=!Jt.isDropDisabled,ln=Jt.renderClone;if(xt.isDragging){var Cn=xt.critical;if(!Ws(cn,Cn))return Be;var Ai=Qa(Cn,xt.dimensions),Or=yo(xt.impact)===gn;return et(gn,$t,Or,Or,Ai,ln)}if(xt.phase==="DROP_ANIMATING"){var Yr=xt.completed;if(!Ws(cn,Yr.critical))return Be;var eo=Qa(Yr.critical,xt.dimensions);return et(gn,$t,ho(Yr.result)===gn,yo(Yr.impact)===gn,eo,ln)}if(xt.phase==="IDLE"&&xt.completed&&!xt.shouldFlush){var No=xt.completed;if(!Ws(cn,No.critical))return Be;var Ro=yo(No.impact)===gn,Ho=!!(No.impact.at&&No.impact.at.type==="COMBINE"),Ca=No.critical.droppable.id===gn;return Ro?Ho?xe:Be:Ca?xe:Be}return Be};return tt},il={updateViewportMaxScroll:ha};function ul(){return document.body||jt(!1),document.body}var ku={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:ul},Fs=an(Ds,il,null,{context:zh,pure:!0,areStatePropsEqual:Ao})(ll);Fs.defaultProps=ku},38486:function(Zn,ei){"use strict";var Le;var le=60103,Ke=60106,it=60107,bt=60108,vt=60114,Oe=60109,st=60110,Et=60112,ot=60113,We=60120,Tt=60115,ct=60116,At=60121,De=60122,ne=60117,te=60129,de=60131;if(typeof Symbol=="function"&&Symbol.for){var se=Symbol.for;le=se("react.element"),Ke=se("react.portal"),it=se("react.fragment"),bt=se("react.strict_mode"),vt=se("react.profiler"),Oe=se("react.provider"),st=se("react.context"),Et=se("react.forward_ref"),ot=se("react.suspense"),We=se("react.suspense_list"),Tt=se("react.memo"),ct=se("react.lazy"),At=se("react.block"),De=se("react.server.block"),ne=se("react.fundamental"),te=se("react.debug_trace_mode"),de=se("react.legacy_hidden")}function ge(wt){if(typeof wt=="object"&&wt!==null){var St=wt.$$typeof;switch(St){case le:switch(wt=wt.type,wt){case it:case vt:case bt:case ot:case We:return wt;default:switch(wt=wt&&wt.$$typeof,wt){case st:case Et:case ct:case Tt:case Oe:return wt;default:return St}}case Ke:return St}}}var ye=Oe,we=le,Ce=Et,_e=it,Ze=ct,lt=Tt,Qe=Ke,Ue=vt,dt=bt,$e=ot;Le=st,Le=ye,Le=we,Le=Ce,Le=_e,Le=Ze,Le=lt,Le=Qe,Le=Ue,Le=dt,Le=$e,Le=function(){return!1},Le=function(){return!1},ei.isContextConsumer=function(wt){return ge(wt)===st},Le=function(wt){return ge(wt)===Oe},Le=function(wt){return typeof wt=="object"&&wt!==null&&wt.$$typeof===le},Le=function(wt){return ge(wt)===Et},Le=function(wt){return ge(wt)===it},Le=function(wt){return ge(wt)===ct},Le=function(wt){return ge(wt)===Tt},Le=function(wt){return ge(wt)===Ke},Le=function(wt){return ge(wt)===vt},Le=function(wt){return ge(wt)===bt},Le=function(wt){return ge(wt)===ot},Le=function(wt){return typeof wt=="string"||typeof wt=="function"||wt===it||wt===vt||wt===te||wt===bt||wt===ot||wt===We||wt===de||typeof wt=="object"&&wt!==null&&(wt.$$typeof===ct||wt.$$typeof===Tt||wt.$$typeof===Oe||wt.$$typeof===st||wt.$$typeof===Et||wt.$$typeof===ne||wt.$$typeof===At||wt[0]===De)},Le=ge},53410:function(Zn,ei,Le){"use strict";Zn.exports=Le(38486)},32637:function(Zn,ei,Le){"use strict";Zn.exports=Le.p+"static/AssistantCode3.a8740efb.jpeg"},93314:function(Zn){"use strict";Zn.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=="},73631:function(Zn){"use strict";Zn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAZxJREFUOBGtlL1Ow0AMgH2XUIkOLFXVASgTsDHxBIAEzAwMPBQjT8AATGVBgEBCYmHmFcICYmBogCbNYSe52HUTVZWwFJ3PP599Z+WMcy6Af5SwYkWnLYifTyBzq5XNK8YNwbbvYP381ZuaVlN1+HJwAc4d1QYaA+gDsHYANrhGHTdCMtSDMILtwSMDn7ZiANPKwyjeQ0Reo4r1gEoEwRkDb7spdPcBeocMk1Cv00oii5L+fgPwcR/zHfb3AJY2sEpUVLOUhB/l+w7I1iS9TYDFrM3AzhqGDstPZ3li2Z12U2WLvk4fGJh+F0elYN8ZrbWiA7igAP4WR6sFzDAKPgPHP0VnlMsFS5IyyIGoeAamCKybYI5UQLWVE2fgGI/s72wqQXRd9jyxiHgGJtihFxGQm8Qd5XvtF3fEQOrQH9mDm1Z9hyJuEphXIq9uSWSQqv8a4RbAUTFdcs7gifwplYGjT3wzbPFz6Q70EZv8WZoxMP66ApMc86inirNBA8njcFIuvOTXhowPyzuQJiukzi3hQgS7b+I9nJtQn/AHsLGsvlcPPWsAAAAASUVORK5CYII="},31328:function(Zn){"use strict";Zn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAodJREFUOBGtU0trFEEQ/qZnM5NsWBCfSEjwQdSggmAieAv4uOnFg5eIXgTvEY+ePJqToDf9AcZDFAUF8SgEQUxAjC6+QlhX4xo0G93ZnRnr697umSyKBCyY/aqqq76q6uoF/rN4lu/BmzSsLGFM7P4kAZQCiBTR64nCw/MHvRnj+fuvI7zxtDWJJD1lQulO5TPHnkAqpuAUFKZUqg8da8xI35+/cMh77AjHJ5cakh/oqHa2ZhGHpSb+STxJZA3lqesFG1CuLAdsqLfbb/dlTwQ7GdmG9VGVBuoNfT/nHGHUSnByeAN2binmmDK1gyM7aGvl6gruPvtadCOfvVlxN0PFjsF4qxMptjl7BflirsPAVxJoQjy5eUMqq6bkMgbWF7C4HGMlsnRmZE82xtEdYSwGnRTuhCvVqG3T8bGhHpweKaFWj3HpzqI7Z16SmHxHmKbcVE7yBs+k1uBm8wh6Q4VQJvrZMkEp98EGBB2h3pFUMWJmPLKniKGtXZhZiLC/L8CLhQbmqhHefmmi3pRYOwInY65gRiiM+ZEP9Ic4c7ik+Ye3dePK/W94/bmpbVNO4u2S2rmrOmRvtkEmlHraC9EUgEzo/optVwZM4IiCLivR1WhywwrT75p4WYlkqhTT7xs4vreIke2h3KWHTaUClC/ZnsR3fOTWMnarZi/QulYhr2l0MMDorhA7NhbwodbC5Xs/9FT5d+s6lJJSzHxWJ9ov9Xw8KceYX9LrQ9+6LF6pgs4luqVIIl+G69gp0id1tk+8/byJ77+AV9UEiRTJMnQMOYycuPZpNuhS+7TF+fgkiBSr55+J9eXOm1E86wjpPzrx8aI8hd3U1yryrOcejQ9cXWveP+N/A79g8eaXNDk4AAAAAElFTkSuQmCC"},96908:function(Zn){"use strict";Zn.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(Zn){"use strict";Zn.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(Zn){"use strict";Zn.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="},57629:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Ke}});var le=Le(2386);function Ke(it,bt){it.prototype=Object.create(bt.prototype),it.prototype.constructor=it,(0,le.Z)(it,bt)}},16722:function(Zn,ei,Le){"use strict";Le.d(ei,{Z:function(){return Et}});const le=ot=>typeof ot=="object"&&ot!=null&&ot.nodeType===1,Ke=(ot,We)=>(!We||ot!=="hidden")&&ot!=="visible"&&ot!=="clip",it=(ot,We)=>{if(ot.clientHeight<ot.scrollHeight||ot.clientWidth<ot.scrollWidth){const Tt=getComputedStyle(ot,null);return Ke(Tt.overflowY,We)||Ke(Tt.overflowX,We)||(ct=>{const At=(De=>{if(!De.ownerDocument||!De.ownerDocument.defaultView)return null;try{return De.ownerDocument.defaultView.frameElement}catch(ne){return null}})(ct);return!!At&&(At.clientHeight<ct.scrollHeight||At.clientWidth<ct.scrollWidth)})(ot)}return!1},bt=(ot,We,Tt,ct,At,De,ne,te)=>De<ot&&ne>We||De>ot&&ne<We?0:De<=ot&&te<=Tt||ne>=We&&te>=Tt?De-ot-ct:ne>We&&te<Tt||De<ot&&te>Tt?ne-We+At:0,vt=ot=>{const We=ot.parentElement;return We==null?ot.getRootNode().host||null:We},Oe=(ot,We)=>{var Tt,ct,At,De;if(typeof document=="undefined")return[];const{scrollMode:ne,block:te,inline:de,boundary:se,skipOverflowHiddenElements:ge}=We,ye=typeof se=="function"?se:Hn=>Hn!==se;if(!le(ot))throw new TypeError("Invalid target");const we=document.scrollingElement||document.documentElement,Ce=[];let _e=ot;for(;le(_e)&&ye(_e);){if(_e=vt(_e),_e===we){Ce.push(_e);break}_e!=null&&_e===document.body&&it(_e)&&!it(document.documentElement)||_e!=null&&it(_e,ge)&&Ce.push(_e)}const Ze=(ct=(Tt=window.visualViewport)==null?void 0:Tt.width)!=null?ct:innerWidth,lt=(De=(At=window.visualViewport)==null?void 0:At.height)!=null?De:innerHeight,{scrollX:Qe,scrollY:Ue}=window,{height:dt,width:$e,top:wt,right:St,bottom:Lt,left:pn}=ot.getBoundingClientRect(),{top:en,right:vn,bottom:rn,left:nt}=(Hn=>{const Wt=window.getComputedStyle(Hn);return{top:parseFloat(Wt.scrollMarginTop)||0,right:parseFloat(Wt.scrollMarginRight)||0,bottom:parseFloat(Wt.scrollMarginBottom)||0,left:parseFloat(Wt.scrollMarginLeft)||0}})(ot);let rt=te==="start"||te==="nearest"?wt-en:te==="end"?Lt+rn:wt+dt/2-en+rn,dn=de==="center"?pn+$e/2-nt+vn:de==="end"?St+vn:pn-nt;const ri=[];for(let Hn=0;Hn<Ce.length;Hn++){const Wt=Ce[Hn],{height:En,width:An,top:ci,right:It,bottom:Pt,left:Nt}=Wt.getBoundingClientRect();if(ne==="if-needed"&&wt>=0&&pn>=0&&Lt<=lt&&St<=Ze&&(Wt===we&&!it(Wt)||wt>=ci&&Lt<=Pt&&pn>=Nt&&St<=It))return ri;const ii=getComputedStyle(Wt),Gi=parseInt(ii.borderLeftWidth,10),ze=parseInt(ii.borderTopWidth,10),Me=parseInt(ii.borderRightWidth,10),Ee=parseInt(ii.borderBottomWidth,10);let Te=0,He=0;const Ae="offsetWidth"in Wt?Wt.offsetWidth-Wt.clientWidth-Gi-Me:0,qe="offsetHeight"in Wt?Wt.offsetHeight-Wt.clientHeight-ze-Ee:0,an="offsetWidth"in Wt?Wt.offsetWidth===0?0:An/Wt.offsetWidth:0,Xt="offsetHeight"in Wt?Wt.offsetHeight===0?0:En/Wt.offsetHeight:0;if(we===Wt)Te=te==="start"?rt:te==="end"?rt-lt:te==="nearest"?bt(Ue,Ue+lt,lt,ze,Ee,Ue+rt,Ue+rt+dt,dt):rt-lt/2,He=de==="start"?dn:de==="center"?dn-Ze/2:de==="end"?dn-Ze:bt(Qe,Qe+Ze,Ze,Gi,Me,Qe+dn,Qe+dn+$e,$e),Te=Math.max(0,Te+Ue),He=Math.max(0,He+Qe);else{Te=te==="start"?rt-ci-ze:te==="end"?rt-Pt+Ee+qe:te==="nearest"?bt(ci,Pt,En,ze,Ee+qe,rt,rt+dt,dt):rt-(ci+En/2)+qe/2,He=de==="start"?dn-Nt-Gi:de==="center"?dn-(Nt+An/2)+Ae/2:de==="end"?dn-It+Me+Ae:bt(Nt,It,An,Gi,Me+Ae,dn,dn+$e,$e);const{scrollLeft:yn,scrollTop:kt}=Wt;Te=Xt===0?0:Math.max(0,Math.min(kt+Te/Xt,Wt.scrollHeight-En/Xt+qe)),He=an===0?0:Math.max(0,Math.min(yn+He/an,Wt.scrollWidth-An/an+Ae)),rt+=kt-Te,dn+=yn-He}ri.push({el:Wt,top:Te,left:He})}return ri},st=ot=>ot===!1?{block:"end",inline:"nearest"}:(We=>We===Object(We)&&Object.keys(We).length!==0)(ot)?ot:{block:"start",inline:"nearest"};function Et(ot,We){if(!ot.isConnected||!(At=>{let De=At;for(;De&&De.parentNode;){if(De.parentNode===document)return!0;De=De.parentNode instanceof ShadowRoot?De.parentNode.host:De.parentNode}return!1})(ot))return;const Tt=(At=>{const De=window.getComputedStyle(At);return{top:parseFloat(De.scrollMarginTop)||0,right:parseFloat(De.scrollMarginRight)||0,bottom:parseFloat(De.scrollMarginBottom)||0,left:parseFloat(De.scrollMarginLeft)||0}})(ot);if((At=>typeof At=="object"&&typeof At.behavior=="function")(We))return We.behavior(Oe(ot,We));const ct=typeof We=="boolean"||We==null?void 0:We.behavior;for(const{el:At,top:De,left:ne}of Oe(ot,st(We))){const te=De-Tt.top+Tt.bottom,de=ne-Tt.left+Tt.right;At.scroll({top:te,left:de,behavior:ct})}}}}]);