BankliPlus/temparea/solarbank/frontend/node_modules/.cache/babel-loader/1fb267536f19999c846f649e3448bba1daa489cff3326d17f81e4f12305081d3.json
2025-08-13 18:05:26 +02:00

1 line
9.8 KiB
JSON

{"ast":null,"code":"import { LeafletProvider, createContainerComponent, createControlHook, createElementHook, createElementObject, extendContext, useLeafletContext } from '@react-leaflet/core';\nimport { Control } from 'leaflet';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nexport const useLayersControlElement = createElementHook(function createLayersControl(_ref, ctx) {\n let {\n children: _c,\n ...options\n } = _ref;\n const control = new Control.Layers(undefined, undefined, options);\n return createElementObject(control, extendContext(ctx, {\n layersControl: control\n }));\n}, function updateLayersControl(control, props, prevProps) {\n if (props.collapsed !== prevProps.collapsed) {\n if (props.collapsed === true) {\n control.collapse();\n } else {\n control.expand();\n }\n }\n});\nexport const useLayersControl = createControlHook(useLayersControlElement);\n// @ts-ignore\nexport const LayersControl = createContainerComponent(useLayersControl);\nexport function createControlledLayer(addLayerToControl) {\n return function ControlledLayer(props) {\n const parentContext = useLeafletContext();\n const propsRef = useRef(props);\n const [layer, setLayer] = useState(null);\n const {\n layersControl,\n map\n } = parentContext;\n const addLayer = useCallback(layerToAdd => {\n if (layersControl != null) {\n if (propsRef.current.checked) {\n map.addLayer(layerToAdd);\n }\n addLayerToControl(layersControl, layerToAdd, propsRef.current.name);\n setLayer(layerToAdd);\n }\n }, [layersControl, map]);\n const removeLayer = useCallback(layerToRemove => {\n layersControl?.removeLayer(layerToRemove);\n setLayer(null);\n }, [layersControl]);\n const context = useMemo(() => {\n return extendContext(parentContext, {\n layerContainer: {\n addLayer,\n removeLayer\n }\n });\n }, [parentContext, addLayer, removeLayer]);\n useEffect(() => {\n if (layer !== null && propsRef.current !== props) {\n if (props.checked === true && (propsRef.current.checked == null || propsRef.current.checked === false)) {\n map.addLayer(layer);\n } else if (propsRef.current.checked === true && (props.checked == null || props.checked === false)) {\n map.removeLayer(layer);\n }\n propsRef.current = props;\n }\n });\n return props.children ? /*#__PURE__*/React.createElement(LeafletProvider, {\n value: context\n }, props.children) : null;\n };\n}\nLayersControl.BaseLayer = createControlledLayer(function addBaseLayer(layersControl, layer, name) {\n layersControl.addBaseLayer(layer, name);\n});\nLayersControl.Overlay = createControlledLayer(function addOverlay(layersControl, layer, name) {\n layersControl.addOverlay(layer, name);\n});","map":{"version":3,"names":["LeafletProvider","createContainerComponent","createControlHook","createElementHook","createElementObject","extendContext","useLeafletContext","Control","React","useCallback","useEffect","useMemo","useRef","useState","useLayersControlElement","createLayersControl","_ref","ctx","children","_c","options","control","Layers","undefined","layersControl","updateLayersControl","props","prevProps","collapsed","collapse","expand","useLayersControl","LayersControl","createControlledLayer","addLayerToControl","ControlledLayer","parentContext","propsRef","layer","setLayer","map","addLayer","layerToAdd","current","checked","name","removeLayer","layerToRemove","context","layerContainer","createElement","value","BaseLayer","addBaseLayer","Overlay","addOverlay"],"sources":["/home/m3mo/Desktop/temparea/solarbank/frontend/node_modules/react-leaflet/lib/LayersControl.js"],"sourcesContent":["import { LeafletProvider, createContainerComponent, createControlHook, createElementHook, createElementObject, extendContext, useLeafletContext } from '@react-leaflet/core';\nimport { Control } from 'leaflet';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nexport const useLayersControlElement = createElementHook(function createLayersControl({ children: _c , ...options }, ctx) {\n const control = new Control.Layers(undefined, undefined, options);\n return createElementObject(control, extendContext(ctx, {\n layersControl: control\n }));\n}, function updateLayersControl(control, props, prevProps) {\n if (props.collapsed !== prevProps.collapsed) {\n if (props.collapsed === true) {\n control.collapse();\n } else {\n control.expand();\n }\n }\n});\nexport const useLayersControl = createControlHook(useLayersControlElement);\n// @ts-ignore\nexport const LayersControl = createContainerComponent(useLayersControl);\nexport function createControlledLayer(addLayerToControl) {\n return function ControlledLayer(props) {\n const parentContext = useLeafletContext();\n const propsRef = useRef(props);\n const [layer, setLayer] = useState(null);\n const { layersControl , map } = parentContext;\n const addLayer = useCallback((layerToAdd)=>{\n if (layersControl != null) {\n if (propsRef.current.checked) {\n map.addLayer(layerToAdd);\n }\n addLayerToControl(layersControl, layerToAdd, propsRef.current.name);\n setLayer(layerToAdd);\n }\n }, [\n layersControl,\n map\n ]);\n const removeLayer = useCallback((layerToRemove)=>{\n layersControl?.removeLayer(layerToRemove);\n setLayer(null);\n }, [\n layersControl\n ]);\n const context = useMemo(()=>{\n return extendContext(parentContext, {\n layerContainer: {\n addLayer,\n removeLayer\n }\n });\n }, [\n parentContext,\n addLayer,\n removeLayer\n ]);\n useEffect(()=>{\n if (layer !== null && propsRef.current !== props) {\n if (props.checked === true && (propsRef.current.checked == null || propsRef.current.checked === false)) {\n map.addLayer(layer);\n } else if (propsRef.current.checked === true && (props.checked == null || props.checked === false)) {\n map.removeLayer(layer);\n }\n propsRef.current = props;\n }\n });\n return props.children ? /*#__PURE__*/ React.createElement(LeafletProvider, {\n value: context\n }, props.children) : null;\n };\n}\nLayersControl.BaseLayer = createControlledLayer(function addBaseLayer(layersControl, layer, name) {\n layersControl.addBaseLayer(layer, name);\n});\nLayersControl.Overlay = createControlledLayer(function addOverlay(layersControl, layer, name) {\n layersControl.addOverlay(layer, name);\n});\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,wBAAwB,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAEC,aAAa,EAAEC,iBAAiB,QAAQ,qBAAqB;AAC5K,SAASC,OAAO,QAAQ,SAAS;AACjC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAChF,OAAO,MAAMC,uBAAuB,GAAGX,iBAAiB,CAAC,SAASY,mBAAmBA,CAAAC,IAAA,EAAgCC,GAAG,EAAE;EAAA,IAApC;IAAEC,QAAQ,EAAEC,EAAE;IAAG,GAAGC;EAAQ,CAAC,GAAAJ,IAAA;EAC/G,MAAMK,OAAO,GAAG,IAAId,OAAO,CAACe,MAAM,CAACC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