File: //opt/netdata/usr/local/local/share/netdata/web/v3/2882.27bd1dcc50a6e23f680d.chunk.js
!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};t.SENTRY_RELEASE={id:"9f9973293dea885c0484e86d9a5d6e44ba9e045b"};var e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="8ee05d4d-3815-46f3-b2d5-0295fefdf6aa",t._sentryDebugIdIdentifier="sentry-dbid-8ee05d4d-3815-46f3-b2d5-0295fefdf6aa")}catch(t){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[2882],{22882(t,e,s){s.d(e,{A:()=>f});const n=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class i{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,s]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const o=s>>4;if(1!==o)throw new Error(`Got v${o} data when expected v1.`);const r=n[15&s];if(!r)throw new Error("Unrecognized array type.");const[h]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new i(a,h,r,t)}constructor(t,e=64,s=Float64Array,i){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=s,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const o=n.indexOf(this.ArrayType),r=2*t*this.ArrayType.BYTES_PER_ELEMENT,h=t*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-h%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${s}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+h+a,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+r+h+a),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+h+a,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+o]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=t,this.coords[this._pos++]=e,s}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return o(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,s,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:r}=this,h=[0,i.length-1,0],a=[];for(;h.length;){const d=h.pop()||0,c=h.pop()||0,u=h.pop()||0;if(c-u<=r){for(let r=u;r<=c;r++){const h=o[2*r],d=o[2*r+1];h>=t&&h<=s&&d>=e&&d<=n&&a.push(i[r])}continue}const p=u+c>>1,f=o[2*p],l=o[2*p+1];f>=t&&f<=s&&l>=e&&l<=n&&a.push(i[p]),(0===d?t<=f:e<=l)&&(h.push(u),h.push(p-1),h.push(1-d)),(0===d?s>=f:n>=l)&&(h.push(p+1),h.push(c),h.push(1-d))}return a}within(t,e,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:i,nodeSize:o}=this,r=[0,n.length-1,0],h=[],a=s*s;for(;r.length;){const c=r.pop()||0,u=r.pop()||0,p=r.pop()||0;if(u-p<=o){for(let s=p;s<=u;s++)d(i[2*s],i[2*s+1],t,e)<=a&&h.push(n[s]);continue}const f=p+u>>1,l=i[2*f],m=i[2*f+1];d(l,m,t,e)<=a&&h.push(n[f]),(0===c?t-s<=l:e-s<=m)&&(r.push(p),r.push(f-1),r.push(1-c)),(0===c?t+s>=l:e+s>=m)&&(r.push(f+1),r.push(u),r.push(1-c))}return h}}function o(t,e,s,n,i,h){if(i-n<=s)return;const a=n+i>>1;r(t,e,a,n,i,h),o(t,e,s,n,a-1,1-h),o(t,e,s,a+1,i,1-h)}function r(t,e,s,n,i,o){for(;i>n;){if(i-n>600){const h=i-n+1,a=s-n+1,d=Math.log(h),c=.5*Math.exp(2*d/3),u=.5*Math.sqrt(d*c*(h-c)/h)*(a-h/2<0?-1:1);r(t,e,s,Math.max(n,Math.floor(s-a*c/h+u)),Math.min(i,Math.floor(s+(h-a)*c/h+u)),o)}const a=e[2*s+o];let d=n,c=i;for(h(t,e,n,s),e[2*i+o]>a&&h(t,e,n,i);d<c;){for(h(t,e,d,c),d++,c--;e[2*d+o]<a;)d++;for(;e[2*c+o]>a;)c--}e[2*n+o]===a?h(t,e,n,c):(c++,h(t,e,c,i)),c<=s&&(n=c+1),s<=c&&(i=c-1)}}function h(t,e,s,n){a(t,s,n),a(e,2*s,2*n),a(e,2*s+1,2*n+1)}function a(t,e,s){const n=t[e];t[e]=t[s],t[s]=n}function d(t,e,s,n){const i=t-s,o=e-n;return i*i+o*o}const c={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},u=Math.fround||(p=new Float32Array(1),t=>(p[0]=+t,p[0]));var p;class f{constructor(t){this.options=Object.assign(Object.create(c),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:s,maxZoom:n}=this.options;e&&console.time("total time");const i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;const o=[];for(let h=0;h<t.length;h++){const e=t[h];if(!e.geometry)continue;const[s,n]=e.geometry.coordinates,i=u(g(s)),r=u(y(n));o.push(i,r,1/0,h,-1,1),this.options.reduce&&o.push(0)}let r=this.trees[n+1]=this._createTree(o);e&&console.timeEnd(i);for(let h=n;h>=s;h--){const t=+Date.now();r=this.trees[h]=this._createTree(this._cluster(r,h)),e&&console.log("z%d: %d clusters in %dms",h,r.numItems,+Date.now()-t)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let s=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let i=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)s=-180,i=180;else if(s>i){const t=this.getClusters([s,n,180,o],e),r=this.getClusters([-180,n,i,o],e);return t.concat(r)}const r=this.trees[this._limitZoom(e)],h=r.range(g(s),y(o),g(i),y(n)),a=r.data,d=[];for(const c of h){const t=this.stride*c;d.push(a[t+5]>1?l(a,t,this.clusterProps):this.points[a[t+3]])}return d}getChildren(t){const e=this._getOriginId(t),s=this._getOriginZoom(t),n="No cluster with the specified id.",i=this.trees[s];if(!i)throw new Error(n);const o=i.data;if(e*this.stride>=o.length)throw new Error(n);const r=this.options.radius/(this.options.extent*Math.pow(2,s-1)),h=o[e*this.stride],a=o[e*this.stride+1],d=i.within(h,a,r),c=[];for(const u of d){const e=u*this.stride;o[e+4]===t&&c.push(o[e+5]>1?l(o,e,this.clusterProps):this.points[o[e+3]])}if(0===c.length)throw new Error(n);return c}getLeaves(t,e,s){e=e||10,s=s||0;const n=[];return this._appendLeaves(n,t,e,s,0),n}getTile(t,e,s){const n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),{extent:o,radius:r}=this.options,h=r/o,a=(s-h)/i,d=(s+1+h)/i,c={features:[]};return this._addTileFeatures(n.range((e-h)/i,a,(e+1+h)/i,d),n.data,e,s,i,c),0===e&&this._addTileFeatures(n.range(1-h/i,a,1,d),n.data,i,s,i,c),e===i-1&&this._addTileFeatures(n.range(0,a,h/i,d),n.data,-1,s,i,c),c.features.length?c:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const s=this.getChildren(t);if(e++,1!==s.length)break;t=s[0].properties.cluster_id}return e}_appendLeaves(t,e,s,n,i){const o=this.getChildren(e);for(const r of o){const e=r.properties;if(e&&e.cluster?i+e.point_count<=n?i+=e.point_count:i=this._appendLeaves(t,e.cluster_id,s,n,i):i<n?i++:t.push(r),t.length===s)break}return i}_createTree(t){const e=new i(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let s=0;s<t.length;s+=this.stride)e.add(t[s],t[s+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,s,n,i,o){for(const r of t){const t=r*this.stride,h=e[t+5]>1;let a,d,c;if(h)a=m(e,t,this.clusterProps),d=e[t],c=e[t+1];else{const s=this.points[e[t+3]];a=s.properties;const[n,i]=s.geometry.coordinates;d=g(n),c=y(i)}const u={type:1,geometry:[[Math.round(this.options.extent*(d*i-s)),Math.round(this.options.extent*(c*i-n))]],tags:a};let p;p=h||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==p&&(u.id=p),o.features.push(u)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:s,extent:n,reduce:i,minPoints:o}=this.options,r=s/(n*Math.pow(2,e)),h=t.data,a=[],d=this.stride;for(let c=0;c<h.length;c+=d){if(h[c+2]<=e)continue;h[c+2]=e;const s=h[c],n=h[c+1],u=t.within(h[c],h[c+1],r),p=h[c+5];let f=p;for(const t of u){const s=t*d;h[s+2]>e&&(f+=h[s+5])}if(f>p&&f>=o){let t,o=s*p,r=n*p,l=-1;const m=(c/d<<5)+(e+1)+this.points.length;for(const s of u){const n=s*d;if(h[n+2]<=e)continue;h[n+2]=e;const a=h[n+5];o+=h[n]*a,r+=h[n+1]*a,h[n+4]=m,i&&(t||(t=this._map(h,c,!0),l=this.clusterProps.length,this.clusterProps.push(t)),i(t,this._map(h,n)))}h[c+4]=m,a.push(o/f,r/f,1/0,m,-1,f),i&&a.push(l)}else{for(let t=0;t<d;t++)a.push(h[c+t]);if(f>1)for(const t of u){const s=t*d;if(!(h[s+2]<=e)){h[s+2]=e;for(let t=0;t<d;t++)a.push(h[s+t])}}}}return a}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,s){if(t[e+5]>1){const n=this.clusterProps[t[e+6]];return s?Object.assign({},n):n}const n=this.points[t[e+3]].properties,i=this.options.map(n);return s&&i===n?Object.assign({},i):i}}function l(t,e,s){return{type:"Feature",id:t[e+3],properties:m(t,e,s),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),w(t[e+1])]}};var n}function m(t,e,s){const n=t[e+5],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,o=t[e+6],r=-1===o?{}:Object.assign({},s[o]);return Object.assign(r,{cluster:!0,cluster_id:t[e+3],point_count:n,point_count_abbreviated:i})}function g(t){return t/360+.5}function y(t){const e=Math.sin(t*Math.PI/180),s=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return s<0?0:s>1?1:s}function w(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}}}]);