File: //proc/self/root/opt/netdata/netdata-web-files/v3/4795.ae56eb51dbedefe53e9e.chunk.js
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"8b1701d6db299c2b7259bc89c3ef365137725d5e"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f39119ce-d412-4049-9808-0a2d8828a052",e._sentryDebugIdIdentifier="sentry-dbid-f39119ce-d412-4049-9808-0a2d8828a052")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[4795],{4795(e,t,o){o.d(t,{z0:()=>k,Wd:()=>j,T5:()=>C,pH:()=>P,ov:()=>z,kL:()=>O});var n=o(96540);const r=n.createContext(null);function s(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!s(e[o],t[o]))return!1;return!0}if(Array.isArray(t))return!1;if("object"===typeof e&&"object"===typeof t){const o=Object.keys(e),n=Object.keys(t);if(o.length!==n.length)return!1;for(const r of o){if(!t.hasOwnProperty(r))return!1;if(!s(e[r],t[r]))return!1}return!0}return!1}function i(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function a(e,t){const o=t.viewState||t,n={};if("longitude"in o&&"latitude"in o&&(o.longitude!==e.center.lng||o.latitude!==e.center.lat)){const t=e.center.constructor;n.center=new t(o.longitude,o.latitude)}return"zoom"in o&&o.zoom!==e.zoom&&(n.zoom=o.zoom),"bearing"in o&&o.bearing!==e.bearing&&(n.bearing=o.bearing),"pitch"in o&&o.pitch!==e.pitch&&(n.pitch=o.pitch),o.padding&&e.padding&&!s(o.padding,e.padding)&&(n.padding=o.padding),n}const c=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function l(e){if(!e)return null;if("string"===typeof e)return e;if("toJS"in e&&(e=e.toJS()),!e.layers)return e;const t={};for(const n of e.layers)t[n.id]=n;const o=e.layers.map(e=>{let o=null;"interactive"in e&&(o=Object.assign({},e),delete o.interactive);const n=t[e.ref];if(n){o=o||Object.assign({},e),delete o.ref;for(const e of c)e in n&&(o[e]=n[e])}return o||e});return{...e,layers:o}}const u={version:8,sources:{},layers:[]},d={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},p={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},f={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},m=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],h=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class g{constructor(e,t,o){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=e=>{const t=this.props[f[e.type]];t?t(e):"error"===e.type&&console.error(e.error)},this._onCameraEvent=e=>{if(this._internalUpdate)return;e.viewState=this._propsedCameraUpdate||i(this._map.transform);const t=this.props[p[e.type]];t&&t(e)},this._onCameraUpdate=e=>this._internalUpdate?e:(this._propsedCameraUpdate=i(e),a(e,this.props)),this._onPointerEvent=e=>{"mousemove"!==e.type&&"mouseout"!==e.type||this._updateHover(e);const t=this.props[d[e.type]];t&&(this.props.interactiveLayerIds&&"mouseover"!==e.type&&"mouseout"!==e.type&&(e.features=this._hoveredFeatures||this._queryRenderedFeatures(e.point)),t(e),delete e.features)},this._MapClass=e,this.props=t,this._initialize(o)}get map(){return this._map}setProps(e){const t=this.props;this.props=e;const o=this._updateSettings(e,t),n=this._updateSize(e),r=this._updateViewState(e);this._updateStyle(e,t),this._updateStyleComponents(e),this._updateHandlers(e,t),(o||n||r&&!this._map.isMoving())&&this.redraw()}static reuse(e,t){const o=g.savedMaps.pop();if(!o)return null;const n=o.map,r=n.getContainer();for(t.className=r.className;r.childNodes.length>0;)t.appendChild(r.childNodes[0]);n._container=t;const s=n._resizeObserver;s&&(s.disconnect(),s.observe(t)),o.setProps({...e,styleDiffing:!1}),n.resize();const{initialViewState:i}=e;return i&&(i.bounds?n.fitBounds(i.bounds,{...i.fitBoundsOptions,duration:0}):o._updateViewState(i)),n.isStyleLoaded()?n.fire("load"):n.once("style.load",()=>n.fire("load")),n._update(),o}_initialize(e){const{props:t}=this,{mapStyle:o=u}=t,n={...t,...t.initialViewState,container:e,style:l(o)},r=n.initialViewState||n.viewState||n;if(Object.assign(n,{center:[r.longitude||0,r.latitude||0],zoom:r.zoom||0,pitch:r.pitch||0,bearing:r.bearing||0}),t.gl){const e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=e,t.gl)}const s=new this._MapClass(n);r.padding&&s.setPadding(r.padding),t.cursor&&(s.getCanvas().style.cursor=t.cursor),s.transformCameraUpdate=this._onCameraUpdate,s.on("style.load",()=>{this._styleComponents={light:s.getLight(),sky:s.getSky(),projection:s.getProjection?.(),terrain:s.getTerrain()},this._updateStyleComponents(this.props)}),s.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const i in d)s.on(i,this._onPointerEvent);for(const i in p)s.on(i,this._onCameraEvent);for(const i in f)s.on(i,this._onEvent);this._map=s}recycle(){const e=this.map.getContainer().querySelector("[mapboxgl-children]");e?.remove(),g.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}_updateSize(e){const{viewState:t}=e;if(t){const e=this._map;if(t.width!==e.transform.width||t.height!==e.transform.height)return e.resize(),!0}return!1}_updateViewState(e){const t=this._map,o=t.transform;if(!t.isMoving()){const n=a(o,e);if(Object.keys(n).length>0)return this._internalUpdate=!0,t.jumpTo(n),this._internalUpdate=!1,!0}return!1}_updateSettings(e,t){const o=this._map;let n=!1;for(const r of m)if(r in e&&!s(e[r],t[r])){n=!0;const t=o[`set${r[0].toUpperCase()}${r.slice(1)}`];t?.call(o,e[r])}return n}_updateStyle(e,t){if(e.cursor!==t.cursor&&(this._map.getCanvas().style.cursor=e.cursor||""),e.mapStyle!==t.mapStyle){const{mapStyle:t=u,styleDiffing:o=!0}=e,n={diff:o};"localIdeographFontFamily"in e&&(n.localIdeographFontFamily=e.localIdeographFontFamily),this._map.setStyle(l(t),n)}}_updateStyleComponents({light:e,projection:t,sky:o,terrain:n}){const r=this._map,i=this._styleComponents;r.style._loaded&&(e&&!s(e,i.light)&&(i.light=e,r.setLight(e)),t&&!s(t,i.projection)&&t!==i.projection?.type&&(i.projection="string"===typeof t?{type:t}:t,r.setProjection?.(i.projection)),o&&!s(o,i.sky)&&(i.sky=o,r.setSky(o)),void 0===n||s(n,i.terrain)||n&&!r.getSource(n.source)||(i.terrain=n,r.setTerrain(n)))}_updateHandlers(e,t){const o=this._map;for(const n of h){const r=e[n]??!0;s(r,t[n]??!0)||(r?o[n].enable(r):o[n].disable())}}_queryRenderedFeatures(e){const t=this._map,{interactiveLayerIds:o=[]}=this.props;try{return t.queryRenderedFeatures(e,{layers:o.filter(t.getLayer.bind(t))})}catch{return[]}}_updateHover(e){const{props:t}=this;if(t.interactiveLayerIds&&(t.onMouseMove||t.onMouseEnter||t.onMouseLeave)){const t=e.type,o=this._hoveredFeatures?.length>0,n=this._queryRenderedFeatures(e.point),r=n.length>0;!r&&o&&(e.type="mouseleave",this._onPointerEvent(e)),this._hoveredFeatures=n,r&&!o&&(e.type="mouseenter",this._onPointerEvent(e)),e.type=t}else this._hoveredFeatures=null}}g.savedMaps=[];const y=g,v=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function _(e){if(!e)return null;const t=e.map,o={getMap:()=>t};for(const n of function(e){const t=new Set;let o=e;for(;o;){for(const n of Object.getOwnPropertyNames(o))"_"!==n[0]&&"function"===typeof e[n]&&"fire"!==n&&"setEventedParent"!==n&&t.add(n);o=Object.getPrototypeOf(o)}return Array.from(t)}(t))n in o||v.includes(n)||(o[n]=t[n].bind(t));return o}const b="undefined"!==typeof document?n.useLayoutEffect:n.useEffect;const L=n.createContext(null);const C=n.forwardRef(function(e,t){const s=(0,n.useContext)(r),[i,a]=(0,n.useState)(null),c=(0,n.useRef)(),{current:l}=(0,n.useRef)({mapLib:null,map:null});(0,n.useEffect)(()=>{const t=e.mapLib;let n,r=!0;return Promise.resolve(t||o.e(2492).then(o.t.bind(o,16443,19))).then(t=>{if(!r)return;if(!t)throw new Error("Invalid mapLib");const o="Map"in t?t:t.default;if(!o.Map)throw new Error("Invalid mapLib");!function(e,t){const{RTLTextPlugin:o,maxParallelImageRequests:n,workerCount:r,workerUrl:s}=t;if(o&&e.getRTLTextPluginStatus&&"unavailable"===e.getRTLTextPluginStatus()){const{pluginUrl:t,lazy:n=!0}="string"===typeof o?{pluginUrl:o}:o;e.setRTLTextPlugin(t,e=>{e&&console.error(e)},n)}void 0!==n&&e.setMaxParallelImageRequests(n),void 0!==r&&e.setWorkerCount(r),void 0!==s&&e.setWorkerUrl(s)}(o,e),e.reuseMaps&&(n=y.reuse(e,c.current)),n||(n=new y(o.Map,e,c.current)),l.map=_(n),l.mapLib=o,a(n),s?.onMapMount(l.map,e.id)}).catch(t=>{const{onError:o}=e;o?o({type:"error",target:null,originalEvent:null,error:t}):console.error(t)}),()=>{r=!1,n&&(s?.onMapUnmount(e.id),e.reuseMaps?n.recycle():n.destroy())}},[]),b(()=>{i&&i.setProps(e)}),(0,n.useImperativeHandle)(t,()=>l.map,[i]);const u=(0,n.useMemo)(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]);return n.createElement("div",{id:e.id,ref:c,style:u},i&&n.createElement(L.Provider,{value:l},n.createElement("div",{"mapboxgl-children":"",style:{height:"100%"}},e.children)))});var E=o(40961);const S=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function w(e,t){if(!e||!t)return;const o=e.style;for(const n in t){const e=t[n];Number.isFinite(e)&&!S.test(n)?o[n]=`${e}px`:o[n]=e}}function M(e,t){if(e===t)return null;const o=x(e),n=x(t),r=[];for(const s of n)o.has(s)||r.push(s);for(const s of o)n.has(s)||r.push(s);return 0===r.length?null:r}function x(e){return new Set(e?e.trim().split(/\s+/):[])}const P=(0,n.memo)((0,n.forwardRef)((e,t)=>{const{map:o,mapLib:r}=(0,n.useContext)(L),s=(0,n.useRef)({props:e}),i=(0,n.useMemo)(()=>{let t=!1;n.Children.forEach(e.children,e=>{e&&(t=!0)});const o={...e,element:t?document.createElement("div"):void 0},a=new r.Marker(o);return a.setLngLat([e.longitude,e.latitude]),a.getElement().addEventListener("click",e=>{s.current.props.onClick?.({type:"click",target:a,originalEvent:e})}),a.on("dragstart",e=>{const t=e;t.lngLat=i.getLngLat(),s.current.props.onDragStart?.(t)}),a.on("drag",e=>{const t=e;t.lngLat=i.getLngLat(),s.current.props.onDrag?.(t)}),a.on("dragend",e=>{const t=e;t.lngLat=i.getLngLat(),s.current.props.onDragEnd?.(t)}),a},[]);(0,n.useEffect)(()=>(i.addTo(o.getMap()),()=>{i.remove()}),[]);const{longitude:a,latitude:c,offset:l,style:u,draggable:d=!1,popup:p=null,rotation:f=0,rotationAlignment:m="auto",pitchAlignment:h="auto"}=e;(0,n.useEffect)(()=>{w(i.getElement(),u)},[u]),(0,n.useImperativeHandle)(t,()=>i,[]);const g=s.current.props;i.getLngLat().lng===a&&i.getLngLat().lat===c||i.setLngLat([a,c]),l&&!function(e,t){const o=Array.isArray(e)?e[0]:e?e.x:0,n=Array.isArray(e)?e[1]:e?e.y:0,r=Array.isArray(t)?t[0]:t?t.x:0,s=Array.isArray(t)?t[1]:t?t.y:0;return o===r&&n===s}(i.getOffset(),l)&&i.setOffset(l),i.isDraggable()!==d&&i.setDraggable(d),i.getRotation()!==f&&i.setRotation(f),i.getRotationAlignment()!==m&&i.setRotationAlignment(m),i.getPitchAlignment()!==h&&i.setPitchAlignment(h),i.getPopup()!==p&&i.setPopup(p);const y=M(g.className,e.className);if(y)for(const n of y)i.toggleClassName(n);return s.current.props=e,(0,E.createPortal)(e.children,i.getElement())}));(0,n.memo)((0,n.forwardRef)((e,t)=>{const{map:o,mapLib:r}=(0,n.useContext)(L),i=(0,n.useMemo)(()=>document.createElement("div"),[]),a=(0,n.useRef)({props:e}),c=(0,n.useMemo)(()=>{const t={...e},o=new r.Popup(t);return o.setLngLat([e.longitude,e.latitude]),o.once("open",e=>{a.current.props.onOpen?.(e)}),o},[]);if((0,n.useEffect)(()=>{const e=e=>{a.current.props.onClose?.(e)};return c.on("close",e),c.setDOMContent(i).addTo(o.getMap()),()=>{c.off("close",e),c.isOpen()&&c.remove()}},[]),(0,n.useEffect)(()=>{w(c.getElement(),e.style)},[e.style]),(0,n.useImperativeHandle)(t,()=>c,[]),c.isOpen()){const t=a.current.props;c.getLngLat().lng===e.longitude&&c.getLngLat().lat===e.latitude||c.setLngLat([e.longitude,e.latitude]),e.offset&&!s(t.offset,e.offset)&&c.setOffset(e.offset),t.anchor===e.anchor&&t.maxWidth===e.maxWidth||(c.options.anchor=e.anchor,c.setMaxWidth(e.maxWidth));const o=M(t.className,e.className);if(o)for(const e of o)c.toggleClassName(e);a.current.props=e}return(0,E.createPortal)(e.children,i)}));function R(e,t,o,r){const s=(0,n.useContext)(L),i=(0,n.useMemo)(()=>e(s),[]);return(0,n.useEffect)(()=>{const e=r||o||t,n="function"===typeof t&&"function"===typeof o?t:null,a="function"===typeof o?o:"function"===typeof t?t:null,{map:c}=s;return c.hasControl(i)||(c.addControl(i,e?.position),n&&n(s)),()=>{a&&a(s),c.hasControl(i)&&c.removeControl(i)}},[]),i}const k=(0,n.memo)(function(e){const t=R(({mapLib:t})=>new t.AttributionControl(e),{position:e.position});return(0,n.useEffect)(()=>{w(t._container,e.style)},[e.style]),null});(0,n.memo)(function(e){const t=R(({mapLib:t})=>new t.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return(0,n.useEffect)(()=>{w(t._controlContainer,e.style)},[e.style]),null});(0,n.memo)((0,n.forwardRef)(function(e,t){const o=(0,n.useRef)({props:e}),r=R(({mapLib:t})=>{const n=new t.GeolocateControl(e),r=n._setupUI;return n._setupUI=()=>{n._container.hasChildNodes()||r()},n.on("geolocate",e=>{o.current.props.onGeolocate?.(e)}),n.on("error",e=>{o.current.props.onError?.(e)}),n.on("outofmaxbounds",e=>{o.current.props.onOutOfMaxBounds?.(e)}),n.on("trackuserlocationstart",e=>{o.current.props.onTrackUserLocationStart?.(e)}),n.on("trackuserlocationend",e=>{o.current.props.onTrackUserLocationEnd?.(e)}),n},{position:e.position});return o.current.props=e,(0,n.useImperativeHandle)(t,()=>r,[]),(0,n.useEffect)(()=>{w(r._container,e.style)},[e.style]),null}));const z=(0,n.memo)(function(e){const t=R(({mapLib:t})=>new t.NavigationControl(e),{position:e.position});return(0,n.useEffect)(()=>{w(t._container,e.style)},[e.style]),null});(0,n.memo)(function(e){const t=R(({mapLib:t})=>new t.ScaleControl(e),{position:e.position}),o=(0,n.useRef)(e),r=o.current;o.current=e;const{style:s}=e;return void 0!==e.maxWidth&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),void 0!==e.unit&&e.unit!==r.unit&&t.setUnit(e.unit),(0,n.useEffect)(()=>{w(t._container,s)},[s]),null});(0,n.memo)(function(e){const t=R(({mapLib:t})=>new t.TerrainControl(e),{position:e.position});return(0,n.useEffect)(()=>{w(t._container,e.style)},[e.style]),null});(0,n.memo)(function(e){const t=R(({mapLib:t})=>new t.LogoControl(e),{position:e.position});return(0,n.useEffect)(()=>{w(t._container,e.style)},[e.style]),null});function T(e,t){if(!e)throw new Error(t)}let I=0;function O(e){const t=(0,n.useContext)(L).map.getMap(),o=(0,n.useRef)(e),[,r]=(0,n.useState)(0),i=(0,n.useMemo)(()=>e.id||"jsx-source-"+I++,[]);(0,n.useEffect)(()=>{if(t){const e=()=>setTimeout(()=>r(e=>e+1),0);return t.on("styledata",e),e(),()=>{if(t.off("styledata",e),t.style&&t.style._loaded&&t.getSource(i)){const e=t.getStyle()?.layers;if(e)for(const o of e)o.source===i&&t.removeLayer(o.id);t.removeSource(i)}}}},[t]);let a=t&&t.style&&t.getSource(i);return a?function(e,t,o){T(t.id===o.id,"source id changed"),T(t.type===o.type,"source type changed");let n="",r=0;for(const a in t)"children"===a||"id"===a||s(o[a],t[a])||(n=a,r++);if(!r)return;const i=t.type;if("geojson"===i)e.setData(t.data);else if("image"===i)e.updateImage({url:t.url,coordinates:t.coordinates});else switch(n){case"coordinates":e.setCoordinates?.(t.coordinates);break;case"url":e.setUrl?.(t.url);break;case"tiles":e.setTiles?.(t.tiles);break;default:console.warn(`Unable to update <Source> prop: ${n}`)}}(a,e,o.current):a=function(e,t,o){if(e.style&&e.style._loaded){const n={...o};return delete n.id,delete n.children,e.addSource(t,n),e.getSource(t)}return null}(t,i,e),o.current=e,a&&n.Children.map(e.children,e=>e&&(0,n.cloneElement)(e,{source:i}))||null}let U=0;function j(e){const t=(0,n.useContext)(L).map.getMap(),o=(0,n.useRef)(e),[,r]=(0,n.useState)(0),i=(0,n.useMemo)(()=>e.id||"jsx-layer-"+U++,[]);(0,n.useEffect)(()=>{if(t){const e=()=>r(e=>e+1);return t.on("styledata",e),e(),()=>{t.off("styledata",e),t.style&&t.style._loaded&&t.getLayer(i)&&t.removeLayer(i)}}},[t]);if(t&&t.style&&t.getLayer(i))try{!function(e,t,o,n){if(T(o.id===n.id,"layer id changed"),T(o.type===n.type,"layer type changed"),"custom"===o.type||"custom"===n.type)return;const{layout:r={},paint:i={},filter:a,minzoom:c,maxzoom:l,beforeId:u}=o;if(u!==n.beforeId&&e.moveLayer(t,u),r!==n.layout){const o=n.layout||{};for(const n in r)s(r[n],o[n])||e.setLayoutProperty(t,n,r[n]);for(const n in o)r.hasOwnProperty(n)||e.setLayoutProperty(t,n,void 0)}if(i!==n.paint){const o=n.paint||{};for(const n in i)s(i[n],o[n])||e.setPaintProperty(t,n,i[n]);for(const n in o)i.hasOwnProperty(n)||e.setPaintProperty(t,n,void 0)}s(a,n.filter)||e.setFilter(t,a),c===n.minzoom&&l===n.maxzoom||e.setLayerZoomRange(t,c,l)}(t,i,e,o.current)}catch(a){console.warn(a)}else!function(e,t,o){if(e.style&&e.style._loaded&&(!("source"in o)||e.getSource(o.source))){const n={...o,id:t};delete n.beforeId,e.addLayer(n,o.beforeId)}}(t,i,e);return o.current=e,null}}}]);