var gdjs;(function(q){let D;(function(f){f.simplifyPath=(o,h,t=[],S=[])=>{if(o.length<=2)return t.length=0,t.push.apply(t,o),t;const r=h*h;let n=S;n.length=0,n.push(o[0]),n.push(o[o.length-1]);do{t.length=0,t.push(n[0]);let l=0;for(let a=0;a+1<n.length;a++){const e=n[a],u=n[a+1],g=e[0],s=e[1],c=u[0],B=u[1];let v=r,x=null;for(l++;o[l]!==u;l++){const F=o[l],A=q.pathfinding.getPointSegmentDistanceSq(F[0],F[1],g,s,c,B);A>v&&(v=A,x=F)}x&&t.push(x),t.push(u)}const P=n;n=t,t=P}while(t.length!==n.length);return t},f.getPointSegmentDistanceSq=(o,h,t,S,r,n)=>{const l=r-t,P=n-S,a=o-t,e=h-S,u=l*l+P*P;if(u===0)return a*a+e*e;const g=(a*l+e*P)/u;if(g<0)return a*a+e*e;if(g>1)return(o-r)*(o-r)+(h-n)*(h-n);const s=t+g*l-o,c=S+g*P-h;return s*s+c*c}})(D=q.pathfinding||(q.pathfinding={}))})(gdjs||(gdjs={}));
//# sourceMappingURL=PathTools.js.map
