"use strict";(self.webpackChunkfirebird=self.webpackChunkfirebird||[]).push([[2412],{2412:(M,o,r)=>{r.r(o),r.d(o,{TBoxPainter:()=>n});var f=r(467),_=r(5680),c=r(9041),x=r(675),l=r(9025),d=r(6714),y=r(6370);class n extends x.JW{moveStart(t,s){const i=Math.abs(this.x2-this.x1),h=Math.abs(this.y1-this.y2);this.c_x1=Math.abs(t-this.x2)>.1*i,this.c_x2=Math.abs(t-this.x1)>.1*i,this.c_y1=Math.abs(s-this.y2)>.1*h,this.c_y2=Math.abs(s-this.y1)>.1*h,this.c_x1!==this.c_x2&&this.c_y1&&this.c_y2&&(this.c_y1=this.c_y2=!1),this.c_y1!==this.c_y2&&this.c_x1&&this.c_x2&&(this.c_x1=this.c_x2=!1)}moveDrag(t,s){this.c_x1&&(this.x1+=t),this.c_x2&&(this.x2+=t),this.c_y1&&(this.y1+=s),this.c_y2&&(this.y2+=s);const i=this.draw_g.selectAll("path").nodes();this.getPathes().forEach((a,e)=>(0,_.Lt)(i[e]).attr("d",a))}moveEnd(t){if(t)return;const s=this.getObject(),i=this.swap_xy?"Y":"X",h=this.swap_xy?"X":"Y";let a="";if(this.c_x1){const e=this.svgToAxis("x",this.x1);s[`f${i}1`]=e,a+=`Set${i}1(${e});;`}if(this.c_x2){const e=this.svgToAxis("x",this.x2);s[`f${i}2`]=e,a+=`Set${i}2(${e});;`}if(this.c_y1){const e=this.svgToAxis("y",this.y1);s[`f${h}1`]=e,a+=`Set${h}1(${e});;`}if(this.c_y2){const e=this.svgToAxis("y",this.y2);s[`f${h}2`]=e,a+=`Set${h}2(${e});;`}this.submitCanvExec(a+"Notify();;")}getUserRanges(){const t=this.getObject(),s=Math.min(t.fX1,t.fX2),i=Math.max(t.fX1,t.fX2);return{minx:s,miny:Math.min(t.fY1,t.fY2),maxx:i,maxy:Math.max(t.fY1,t.fY2)}}getPathes(){const t=Math.round(Math.min(this.x1,this.x2)),s=Math.round(Math.min(this.y1,this.y2)),i=Math.round(Math.abs(this.x2-this.x1)),h=Math.round(Math.abs(this.y1-this.y2)),a=`M${t},${s}h${i}v${h}h${-i}z`;return this.borderMode?[a].concat((0,c.pf)(t,s,i,h,this.borderMode,this.borderSize,this.borderSize)):[a]}redraw(){const t=this.getObject(),s=new c.nC(this.getDrawOpt()),i=s.check("FRAME")?this.getFramePainter():null,h=s.check("L");this.createAttLine({attr:t}),this.createAttFill({attr:t}),this.swap_xy=i?.swap_xy,!this.fillatt.empty()&&!h&&(this.lineatt.color="none"),this.createG(i),this.x1=this.axisToSvg("x",t.fX1),this.x2=this.axisToSvg("x",t.fX2),this.y1=this.axisToSvg("y",t.fY1),this.y2=this.axisToSvg("y",t.fY2),this.swap_xy&&([this.x1,this.x2,this.y1,this.y2]=[this.y1,this.y2,this.x1,this.x2]),this.borderMode=t.fBorderMode&&this.fillatt.hasColor()?t.fBorderMode:0,this.borderSize=t.fBorderSize||2;const a=this.getPathes();return this.draw_g.append("svg:path").attr("d",a[0]).call(this.lineatt.func).call(this.fillatt.func),this.borderMode&&(this.draw_g.append("svg:path").attr("d",a[1]).call(this.fillatt.func).style("fill",(0,_.Qh)(this.fillatt.color).brighter(.5).formatRgb()),this.draw_g.append("svg:path").attr("d",a[2]).call(this.fillatt.func).style("fill",(0,_.Qh)(this.fillatt.color).darker(.5).formatRgb())),(0,y.wh)(this),(0,d.X2)(this),this}static draw(t,s,i){return(0,f.A)(function*(){const h=new n(t,s,i);return(0,l.ensureTCanvas)(h,!1).then(()=>h.redraw())})()}}}}]);