PageSourceSearch

https://www.winnetwork.ca/wp-content/plugins/wfwe-core/lib/js/pole…accessibility.standalone.min.js?ver=5.0.7.0

js winnetwork.ca collected 2026-10-05 18:03:01 UTC 2,196 bytes, 1 lines download raw bytes

1function wdtGetPoleOfInaccessibility(t,n=1e-6){let e=1/0,s=1/0,o=-1/0,i=-1/0;for(const[n,h]of t[0])n<e&&(e=n),h<s&&(s=h),n>o&&(o=n),h>i&&(i=h);const h=o-e,l=i-s,a=Math.max(n,Math.min(h,l));if(a===n){const t=[e,s];return t.distance=0,t}const r=new class{constructor(t=[],n=(t,n)=>t<n?-1:t>n?1:0){if(this.data=t,this.length=this.data.length,this.compare=n,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],n=this.data.pop();return--this.length>0&&(this.data[0]=n,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:n,compare:e}=this,s=n[t];for(;t>0;){const o=t-1>>1,i=n[o];if(e(s,i)>=0)break;n[t]=i,t=o}n[t]=s}_down(t){const{data:n,compare:e}=this,s=this.length>>1,o=n[t];for(;t<s;){let s=1+(t<<1);const i=s+1;if(i<this.length&&e(n[i],n[s])<0&&(s=i),e(n[s],o)>=0)break;n[t]=n[s],t=s}n[t]=o}}([],((t,n)=>n.max-t.max));let c=wdtGetCentroidCell(t);const d=new WDTCell(e+h/2,s+l/2,0,t);d.d>c.d&&(c=d);function f(e,s,o){const i=new WDTCell(e,s,o,t);i.max>c.d+n&&r.push(i),i.d>c.d&&(c=i)}let u=a/2;for(let t=e;t<o;t+=a)for(let n=s;n<i;n+=a)f(t+u,n+u,u);for(;r.length;){const{max:t,x:e,y:s,h:o}=r.pop();if(t-c.d<=n)break;u=o/2,f(e-u,s-u,u),f(e+u,s-u,u),f(e-u,s+u,u),f(e+u,s+u,u)}const g=[c.x,c.y];return g.distance=c.d,g}function WDTCell(t,n,e,s){this.x=t,this.y=n,this.h=e,this.d=wdtPointToPolygonDist(t,n,s),this.max=this.d+this.h*Math.SQRT2}function wdtPointToPolygonDist(t,n,e){let s=!1,o=1/0;for(const i of e)for(let e=0,h=i.length,l=h-1;e<h;l=e++){const h=i[e],a=i[l];h[1]>n!=a[1]>n&&t<(a[0]-h[0])*(n-h[1])/(a[1]-h[1])+h[0]&&(s=!s),o=Math.min(o,wdtGetSegDistSq(t,n,h,a))}return 0===o?0:(s?1:-1)*Math.sqrt(o)}function wdtGetCentroidCell(t){let n=0,e=0,s=0;const o=t[0];for(let t=0,i=o.length,h=i-1;t<i;h=t++){const i=o[t],l=o[h],a=i[0]*l[1]-l[0]*i[1];e+=(i[0]+l[0])*a,s+=(i[1]+l[1])*a,n+=3*a}const i=new WDTCell(e/n,s/n,0,t);return 0===n||i.d<0?new WDTCell(o[0][0],o[0][1],0,t):i}function wdtGetSegDistSq(t,n,e,s){let o=e[0],i=e[1],h=s[0]-o,l=s[1]-i;if(0!==h||0!==l){const e=((t-o)*h+(n-i)*l)/(h*h+l*l);e>1?(o=s[0],i=s[1]):e>0&&(o+=h*e,i+=l*e)}return h=t-o,l=n-i,h*h+l*l}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.