PageSourceSearch

https://www.pirati.cz/static/maps_utils/vendor/polylabel%401.0.2/polylabel.min.js

js pirati.cz collected 2026-09-24 09:12:23 UTC 3,246 bytes, 1 lines download raw bytes

1!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).polylabel=t()}}(function(){return function(){return function t(n,e,r){function i(a,u){if(!e[a]){if(!n[a]){var f="function"==typeof require&&require;if(!u&&f)return f(a,!0);if(o)return o(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var s=e[a]={exports:{}};n[a][0].call(s.exports,function(t){return i(n[a][1][t]||t)},s,s.exports,t,n,e,r)}return e[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}}()({1:[function(t,n,e){"use strict";function r(t,n){if(!(this instanceof r))return new r(t,n);if(this.data=t||[],this.length=this.data.length,this.compare=n||i,this.length>0)for(var e=(this.length>>1)-1;e>=0;e--)this._down(e)}function i(t,n){return t<n?-1:t>n?1:0}n.exports=r,n.exports.default=r,r.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var n=this.data,e=this.compare,r=n[t];t>0;){var i=t-1>>1,o=n[i];if(e(r,o)>=0)break;n[t]=o,t=i}n[t]=r},_down:function(t){for(var n=this.data,e=this.compare,r=this.length>>1,i=n[t];t<r;){var o=1+(t<<1),a=o+1,u=n[o];if(a<this.length&&e(n[a],u)<0&&(o=a,u=n[a]),e(u,i)>=0)break;n[t]=u,t=o}n[t]=i}}},{}],2:[function(t,n,e){"use strict";var r=t("tinyqueue");function i(t,n,e){var i,u,f,h;n=n||1;for(var s=0;s<t[0].length;s++){var d=t[0][s];(!s||d[0]<i)&&(i=d[0]),(!s||d[1]<u)&&(u=d[1]),(!s||d[0]>f)&&(f=d[0]),(!s||d[1]>h)&&(h=d[1])}var l=f-i,p=h-u,c=Math.min(l,p),v=c/2,g=new r(null,o);if(0===c)return[i,u];for(var x=i;x<f;x+=c)for(var w=u;w<h;w+=c)g.push(new a(x+v,w+v,v,t));var y=function(t){for(var n=0,e=0,r=0,i=t[0],o=0,u=i.length,f=u-1;o<u;f=o++){var h=i[o],s=i[f],d=h[0]*s[1]-s[0]*h[1];e+=(h[0]+s[0])*d,r+=(h[1]+s[1])*d,n+=3*d}return 0===n?new a(i[0][0],i[0][1],0,t):new a(e/n,r/n,0,t)}(t),m=new a(i+l/2,u+p/2,0,t);m.d>y.d&&(y=m);for(var b=g.length;g.length;){var _=g.pop();_.d>y.d&&(y=_,e&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,b)),_.max-y.d<=n||(v=_.h/2,g.push(new a(_.x-v,_.y-v,v,t)),g.push(new a(_.x+v,_.y-v,v,t)),g.push(new a(_.x-v,_.y+v,v,t)),g.push(new a(_.x+v,_.y+v,v,t)),b+=4)}return e&&(console.log("num probes: "+b),console.log("best distance: "+y.d)),[y.x,y.y]}function o(t,n){return n.max-t.max}function a(t,n,e,r){this.x=t,this.y=n,this.h=e,this.d=function(t,n,e){for(var r=!1,i=1/0,o=0;o<e.length;o++)for(var a=e[o],f=0,h=a.length,s=h-1;f<h;s=f++){var d=a[f],l=a[s];d[1]>n!=l[1]>n&&t<(l[0]-d[0])*(n-d[1])/(l[1]-d[1])+d[0]&&(r=!r),i=Math.min(i,u(t,n,d,l))}return(r?1:-1)*Math.sqrt(i)}(t,n,r),this.max=this.d+this.h*Math.SQRT2}function u(t,n,e,r){var i=e[0],o=e[1],a=r[0]-i,u=r[1]-o;if(0!==a||0!==u){var f=((t-i)*a+(n-o)*u)/(a*a+u*u);f>1?(i=r[0],o=r[1]):f>0&&(i+=a*f,o+=u*f)}return(a=t-i)*a+(u=n-o)*u}n.exports=i,n.exports.default=i},{tinyqueue:1}]},{},[2])(2)});

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.