"use strict";(self.webpackChunkfirebird=self.webpackChunkfirebird||[]).push([[4316],{4316:(M,r,n)=>{n.r(r),n.d(r,{TArrowPainter:()=>d});var l=n(467),f=n(2695),o=n(9025);class d extends f.TLinePainter{rotate(t,i,s){let e=this.wsize*Math.cos(t),h=this.wsize*Math.sin(t),a="";return void 0!==i&&void 0!==s?a=`M${Math.round(i-e)},${Math.round(s-h)}`:(e=-e,h=-h),a+=`l${Math.round(e)},${Math.round(h)}`,i&&void 0===s&&(a+="z"),a}createPath(){const t=Math.atan2(this.y2-this.y1,this.x2-this.x1),i=this.wsize*Math.cos(this.angle2),s=i*Math.cos(t),e=i*Math.sin(t);let h="";return this.beg&&(h+=this.rotate(t-Math.PI-this.angle2,this.x1,this.y1)+this.rotate(t-Math.PI+this.angle2,this.beg>10)),this.mid%10==2&&(h+=this.rotate(t-Math.PI-this.angle2,(this.x1+this.x2-s)/2,(this.y1+this.y2-e)/2)+this.rotate(t-Math.PI+this.angle2,this.mid>10)),this.mid%10==1&&(h+=this.rotate(t-this.angle2,(this.x1+this.x2+s)/2,(this.y1+this.y2+e)/2)+this.rotate(t+this.angle2,this.mid>10)),this.end&&(h+=this.rotate(t-this.angle2,this.x2,this.y2)+this.rotate(t+this.angle2,this.end>10)),`M${Math.round(this.x1+(this.beg>10?s:0))},${Math.round(this.y1+(this.beg>10?e:0))}L${Math.round(this.x2-(this.end>10?s:0))},${Math.round(this.y2-(this.end>10?e:0))}`+h}prepareDraw(){super.prepareDraw();const t=this.getObject(),i=t.fOption,s=this.getPadPainter().getPadRect();this.wsize=Math.max(3,Math.round(Math.max(s.width,s.height)*t.fArrowSize*.8)),this.angle2=t.fAngle/2/180*Math.PI,this.beg=this.mid=this.end=0,0===i.indexOf("<")&&(this.beg=0===i.indexOf("<|")?12:2),i.indexOf("->-")>=0?this.mid=1:i.indexOf("-|>-")>=0?this.mid=11:i.indexOf("-<-")>=0?this.mid=2:i.indexOf("-<|-")>=0&&(this.mid=12);const e=i.lastIndexOf(">"),h=i.lastIndexOf("|>"),a=i.length;e>=0&&e===a-1&&(this.end=h>=0&&h===a-2?11:1),this.createAttFill({attr:t,enable:this.beg>10||this.end>10})}addExtras(t){t.call(this.fillatt.func)}static draw(t,i,s){return(0,l.A)(function*(){const e=new d(t,i,s);return(0,o.ensureTCanvas)(e,!1).then(()=>e.redraw())})()}}}}]);