@evergis/react 3.1.2 → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/{Map/components/Layer → Layer}/index.d.ts +1 -0
- package/dist/components/{Map/components/Layer → Layer}/types.d.ts +1 -1
- package/dist/components/{Map/components/Layer → Layer}/utils/getClientStyleItemPrefixSuffix.d.ts +1 -1
- package/dist/components/Map/index.d.ts +0 -1
- package/dist/components/index.d.ts +1 -3
- package/dist/contexts/MapContext/types.d.ts +31 -0
- package/dist/contexts/index.d.ts +2 -0
- package/dist/core/classification/parseClientStyle.d.ts +1 -1
- package/dist/core/feature/convertSpToTurfFeature.d.ts +2 -2
- package/dist/core/index.d.ts +0 -3
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/map/index.d.ts +1 -18
- package/dist/hooks/map/useMapContext.d.ts +1 -1
- package/dist/hooks/map/useMapDraw/customModes.d.ts +6 -1
- package/dist/hooks/map/useZoomToFeatures.d.ts +2 -2
- package/dist/hooks/serverNotifications/index.d.ts +0 -1
- package/dist/hooks/serverNotifications/useServerNotificationsContext.d.ts +1 -1
- package/dist/hooks/useDebouncedCallback.d.ts +1 -0
- package/dist/hooks/useWindowResize.d.ts +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/react.cjs.development.js +630 -524
- package/dist/react.cjs.development.js.map +1 -1
- package/dist/react.cjs.production.min.js +1 -1
- package/dist/react.cjs.production.min.js.map +1 -1
- package/dist/react.esm.js +617 -506
- package/dist/react.esm.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/utils/debounce.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -1
- package/package.json +3 -3
- package/dist/components/Map/components/BuildingsLayer/BuildingsLayer.d.ts +0 -3
- package/dist/components/Map/components/BuildingsLayer/index.d.ts +0 -2
- package/dist/components/Map/components/BuildingsLayer/types.d.ts +0 -4
- package/dist/components/Map/components/index.d.ts +0 -2
- package/dist/components/MapContext/types.d.ts +0 -138
- package/dist/components/ResizablePanel/ResizablePanel.d.ts +0 -3
- package/dist/components/ResizablePanel/index.d.ts +0 -2
- package/dist/components/ResizablePanel/styled.d.ts +0 -11
- package/dist/components/ResizablePanel/types.d.ts +0 -14
- package/dist/core/attributes/index.d.ts +0 -1
- package/dist/core/geometrySelection/drawModeToGeometrySelectionType.d.ts +0 -3
- package/dist/core/geometrySelection/getGeometrySelectionTurfFeature.d.ts +0 -3
- package/dist/core/geometrySelection/index.d.ts +0 -2
- package/dist/core/types/index.d.ts +0 -2
- package/dist/core/types/map.d.ts +0 -5
- package/dist/hooks/map/useCurrentSelectedFeature.d.ts +0 -2
- package/dist/hooks/map/useEditingFeature.d.ts +0 -1
- package/dist/hooks/map/useEwktGeometry.d.ts +0 -1
- package/dist/hooks/map/useGeometryEditor.d.ts +0 -2
- package/dist/hooks/map/useGeometrySelection.d.ts +0 -2
- package/dist/hooks/map/useGeometrySelectionBuffer.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesCount.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesCurrentIndex.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesGeometryMasking.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesInitialized.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesLayerName.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesPagination.d.ts +0 -4
- package/dist/hooks/map/useSelectFeaturesStatisticsActive.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesTotalCounts.d.ts +0 -1
- package/dist/hooks/map/useSelectedFeatures.d.ts +0 -2
- package/dist/hooks/map/useUpdateCurrentFeature.d.ts +0 -2
- package/dist/hooks/map/useZoomToLayer.d.ts +0 -7
- package/dist/hooks/useResizer.d.ts +0 -28
- package/dist/utils/geometryToWkt.d.ts +0 -2
- /package/dist/components/{Map/components/Layer → Layer}/Layer.d.ts +0 -0
- /package/dist/components/{Map/components/Layer → Layer}/RasterLayer.d.ts +0 -0
- /package/dist/components/{Map/components/Layer → Layer}/VectorLayer.d.ts +0 -0
- /package/dist/components/{Map/components/Layer → Layer}/constants.d.ts +0 -0
- /package/dist/{components → contexts}/MapContext/MapContext.d.ts +0 -0
- /package/dist/{components → contexts}/MapContext/MapProvider.d.ts +0 -0
- /package/dist/{components → contexts}/MapContext/index.d.ts +0 -0
- /package/dist/{components → contexts}/ServerNotificationsContext/ServerNotificationsContext.d.ts +0 -0
- /package/dist/{components → contexts}/ServerNotificationsContext/ServerNotificationsProvider.d.ts +0 -0
- /package/dist/{hooks/serverNotifications → contexts/ServerNotificationsContext/hooks}/useServerNotifications.d.ts +0 -0
- /package/dist/{components → contexts}/ServerNotificationsContext/index.d.ts +0 -0
- /package/dist/{components → contexts}/ServerNotificationsContext/types.d.ts +0 -0
- /package/dist/{core/attributes/types.d.ts → types/attribute.d.ts} +0 -0
- /package/dist/{core/types → types}/styling.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.cjs.development.js","sources":["../src/core/classification/findAttributeInExpression.ts","../src/core/classification/getActualExtrusionHeight.ts","../src/core/classification/parseClientStyle.ts","../src/core/feature/convertSpToTurfFeature.ts","../src/hooks/map/useMapContext.ts","../src/hooks/map/useCurrentSelectedFeature.ts","../src/components/MapContext/MapContext.ts","../src/components/MapContext/types.ts","../src/hooks/map/useGeometryEditor.ts","../src/hooks/map/useEditingFeature.ts","../src/hooks/map/useGeometrySelection.ts","../src/utils/date.ts","../src/utils/geometryToWkt.ts","../src/utils/isNumeric.ts","../src/utils/isObject.ts","../src/hooks/map/useEwktGeometry.ts","../src/hooks/map/useGeometrySelectionBuffer.ts","../src/hooks/map/useMapDraw/customModes.ts","../src/hooks/map/useMapDraw/customStyles.ts","../src/hooks/map/useMapDraw/index.ts","../src/hooks/map/useRedrawLayer.ts","../src/hooks/map/useSelectedFeatures.ts","../src/hooks/map/useSelectFeaturesCount.ts","../src/hooks/map/useSelectFeaturesCurrentIndex.ts","../src/hooks/map/useSelectFeaturesGeometryMasking.ts","../src/hooks/map/useSelectFeaturesInitialized.ts","../src/hooks/map/useSelectFeaturesLayerName.ts","../src/hooks/map/useSelectFeaturesPagination.ts","../src/hooks/map/useSelectFeaturesStatisticsActive.ts","../src/hooks/map/useSelectFeaturesTotalCounts.ts","../src/hooks/map/useUpdateCurrentFeature.ts","../src/hooks/map/useZoomToFeatures.ts","../src/hooks/map/useZoomToLayer.ts","../src/hooks/map/useZoomToPoint.ts","../src/hooks/serverNotifications/useServerNotifications.ts","../src/components/ServerNotificationsContext/ServerNotificationsContext.ts","../src/hooks/serverNotifications/useServerNotificationsContext.ts","../src/hooks/useResizer.ts","../src/hooks/useToggle.ts","../src/core/geometrySelection/drawModeToGeometrySelectionType.ts","../src/core/geometrySelection/getGeometrySelectionTurfFeature.ts"],"sourcesContent":["import { ExpressionSpecification } from \"mapbox-gl\";\n\nexport const findAttributeInExpression = (expression: ExpressionSpecification): string[] => {\n if (Array.isArray(expression) && expression.length === 2 && expression[0] === \"get\") {\n return [expression[1]];\n }\n\n return expression.reduce((acc: string[], curr) => {\n if (!Array.isArray(curr)) {\n return acc;\n }\n\n if (curr[0] === \"get\") {\n return [...new Set([...acc, curr[1]])];\n }\n\n return [...new Set([...acc, ...findAttributeInExpression(curr as ExpressionSpecification)])];\n }, []);\n};\n","import { AnyPaint } from \"mapbox-gl\";\n\nexport const getActualExtrusionHeight = (paint: AnyPaint) => {\n return Array.isArray(paint?.[\"fill-extrusion-height\"]) && paint?.[\"fill-extrusion-height\"][0] === \"+\"\n ? paint?.[\"fill-extrusion-height\"][1]\n : paint?.[\"fill-extrusion-height\"];\n};\n","import { isEmpty } from \"lodash\";\nimport { ExpressionSpecification } from \"mapbox-gl\";\n\nimport { findAttributeInExpression } from \"./findAttributeInExpression\";\n\nimport { ClientStyle } from \"../types\";\n\nexport const parseClientStyle = (style?: ClientStyle): string[] => {\n if (!style) {\n return [];\n }\n\n return style?.items?.reduce((acc: string[], curr) => {\n if (!curr.paint || isEmpty(curr.paint)) {\n return acc;\n }\n\n return Object.entries(curr.paint)?.reduce((paintAcc: string[], [, value]) => {\n if (!Array.isArray(value)) {\n return paintAcc;\n }\n\n return [...new Set([...paintAcc, ...findAttributeInExpression(value as ExpressionSpecification)])];\n }, []);\n }, []);\n};\n","import { GeometryType } from \"@evergis/api\";\nimport { multiLineString, multiPoint, point, polygon } from \"@turf/turf\";\nimport { Feature } from \"geojson\";\n\nimport { FeaturedDcExtendedGeometry } from \"../../components\";\n\nexport const convertSpToTurfFeature = (geometry?: FeaturedDcExtendedGeometry): Feature<any> | undefined => {\n if (!geometry) {\n return;\n }\n\n switch (geometry.type) {\n case GeometryType.Point:\n return point(geometry.coordinates);\n case GeometryType.Multipoint:\n return multiPoint(geometry.coordinates);\n case GeometryType.Polyline:\n return multiLineString(geometry.coordinates);\n case GeometryType.Polygon:\n case GeometryType.Envelope:\n return polygon(geometry.coordinates);\n default:\n }\n};\n","import { useContext } from \"react\";\n\nimport { MapContext } from \"../../components\";\n\nexport const useMapContext = () => {\n return useContext(MapContext);\n};\n","import { useMemo } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { SelectedFeature } from \"../../components/MapContext\";\n\nexport const useCurrentSelectedFeature = (): SelectedFeature => {\n const { selectFeatures } = useMapContext();\n\n return useMemo(() => {\n return selectFeatures.features?.[selectFeatures.layerName]?.find(item => item.id === selectFeatures.currentId);\n }, [selectFeatures]);\n};\n","import { createContext } from \"react\";\n\nimport { MapContextProps } from \"./types\";\n\nexport const MapContext = createContext<MapContextProps>({});\n","import { Dispatch, MutableRefObject, PropsWithChildren, SetStateAction } from \"react\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\nimport { FeatureDc, LayerDefinitionDc, GeometryType } from \"@evergis/api\";\nimport { Feature } from \"geojson\";\n\nexport enum BaseMapTheme {\n Light = \"light\",\n Dark = \"dark\",\n}\n\nexport interface BaseMapItem {\n name: string;\n source: string;\n preview?: string;\n imgSrc?: string;\n title: string;\n theme?: BaseMapTheme;\n opacity?: number;\n color?: string;\n}\n\nexport enum GeometrySelectionTypes {\n Point = \"select_point\",\n Line = \"select_line\",\n Circle = \"select_circle\",\n Rect = \"select_rect\",\n Polygon = \"select_polygon\",\n Zones = \"zones_selection\",\n Coordinates = \"xy\",\n Route = \"selection_route\",\n}\n\nexport enum GeometrySelectionToolTypes {\n Replace = \"Replace\",\n Unite = \"Unite\",\n Crop = \"Crop\",\n Edit = \"Edit\",\n}\n\nexport type SelectionHistoryFeature = Feature;\n\nexport interface SelectionHistory {\n features: Array<SelectionHistoryFeature[]>;\n zones?: Array<Array<Feature[]>>;\n step: number;\n}\n\nexport enum GeometrySelectionZoneTypes {\n Walking = \"Walking\",\n Car = \"Car\",\n}\n\nexport enum GeometrySelectionRouteTypes {\n Walking = \"Walking\",\n Car = \"Car\",\n}\n\nexport interface GeometrySelectionSettings {\n zoneDuration?: number;\n zoneType?: GeometrySelectionZoneTypes;\n routeType?: GeometrySelectionRouteTypes;\n bufferRadius?: string;\n bufferMultiplier?: string;\n bufferInclude?: boolean;\n selectOutside?: boolean;\n}\n\nexport interface GeometrySelection {\n active?: boolean;\n loading?: boolean;\n type?: GeometrySelectionTypes;\n currentTool?: GeometrySelectionToolTypes;\n history?: SelectionHistory;\n editHistory?: SelectionHistory;\n isBuffer?: boolean;\n settings?: GeometrySelectionSettings;\n}\n\nexport enum GeometryEditorMode {\n Create,\n Edit,\n Transform,\n Expand,\n Unite,\n Subtract,\n}\n\nexport type Coordinates = [number, number];\n\nexport type Positions = Coordinates | Coordinates[] | Coordinates[][];\n\nexport interface GeometryEditor {\n active: boolean;\n geometryType?: GeometryType;\n layerName?: string;\n geometry?: Positions;\n mode?: GeometryEditorMode;\n}\n\nexport interface FeaturedDcExtendedGeometry extends Omit<FeatureDc[\"geometry\"], \"coordinates\"> {\n coordinates?: any;\n}\n\nexport interface FeatureDcExtended extends Omit<FeatureDc, \"geometry\"> {\n geometry: FeaturedDcExtendedGeometry;\n layer: string;\n}\n\nexport interface SelectedFeature extends FeatureDcExtended {\n layerDefinition: LayerDefinitionDc;\n}\n\nexport interface SelectFeatures {\n initialized?: boolean;\n layerName?: string;\n currentId: string | null;\n selectionOffset?: number;\n features: Record<string, SelectedFeature[]>;\n totalCounts: Record<string, number>;\n statisticsActive?: boolean;\n geometryMasking?: boolean;\n}\n\nexport interface MapContextProps {\n map?: MutableRefObject<MapboxGLMap>;\n draw?: MutableRefObject<Omit<MapboxDraw, \"getDefaultPosition\">>;\n loaded?: boolean;\n setLoaded?: Dispatch<SetStateAction<boolean>>;\n basemapItems?: BaseMapItem[];\n basemapName?: string;\n setBasemapName?: Dispatch<SetStateAction<string>>;\n defaultBasemap?: string;\n globeProjection?: boolean;\n setGlobeProjection?: Dispatch<SetStateAction<boolean>>;\n geometrySelection?: GeometrySelection;\n setGeometrySelection?: Dispatch<SetStateAction<GeometrySelection>>;\n resetGeometrySelection?: VoidFunction;\n geometryEditor?: GeometryEditor;\n setGeometryEditor?: Dispatch<SetStateAction<GeometryEditor>>;\n resetGeometryEditor?: VoidFunction;\n selectFeatures?: SelectFeatures;\n setNextFeature?: VoidFunction;\n setPrevFeature?: VoidFunction;\n setSelectedFeatures?: (payload?: SelectFeatures[\"features\"], currentId?: any, offset?: number) => void;\n setSelectedFeaturesTotalCounts?: Dispatch<SetStateAction<SelectFeatures[\"totalCounts\"]>>;\n setSelectFeaturesInitialized?: Dispatch<SetStateAction<boolean>>;\n setSelectFeaturesLayerName?: Dispatch<SetStateAction<string>>;\n setSelectFeaturesStatisticsActive?: Dispatch<SetStateAction<boolean>>;\n setSelectFeaturesGeometryMasking?: Dispatch<SetStateAction<boolean>>;\n updateCurrentFeature?: Dispatch<SetStateAction<Partial<SelectedFeature>>>;\n resetSelectedFeatures?: VoidFunction;\n}\n\nexport interface MapProviderProps extends PropsWithChildren {\n basemapItems: BaseMapItem[];\n defaultBasemap: string;\n}\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { GeometryEditor } from \"../../components\";\n\nexport const useGeometryEditor = (): [GeometryEditor, (state: Partial<GeometryEditor>) => void] => {\n const { geometryEditor, setGeometryEditor } = useMapContext();\n\n const update = useCallback(\n (newState: Partial<GeometryEditor>) => {\n setGeometryEditor(prevState => ({\n ...prevState,\n ...newState,\n }));\n },\n [setGeometryEditor],\n );\n\n return [geometryEditor, update];\n};\n","import { useMemo } from \"react\";\n\nimport { GeometryEditorMode } from \"../../components/MapContext\";\n\nimport { useGeometryEditor } from \"./useGeometryEditor\";\nimport { useCurrentSelectedFeature } from \"./useCurrentSelectedFeature\";\n\nexport const useEditingFeature = (): boolean => {\n const [{ layerName, active, mode }] = useGeometryEditor();\n const currentSelectedFeature = useCurrentSelectedFeature();\n\n return useMemo(() => {\n return (\n active &&\n ((mode === GeometryEditorMode.Edit && layerName === currentSelectedFeature?.layer) ||\n mode === GeometryEditorMode.Create)\n );\n }, [active, currentSelectedFeature, layerName, mode]);\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { GeometrySelection } from \"../../components\";\n\nexport const useGeometrySelection = (): [GeometrySelection, (state: Partial<GeometrySelection>) => void] => {\n const { geometrySelection, setGeometrySelection } = useMapContext();\n\n const updateGeometrySelection = useCallback(\n (newState: Partial<GeometrySelection>) => {\n setGeometrySelection(prevState => ({\n ...prevState,\n ...newState,\n }));\n },\n [setGeometrySelection],\n );\n\n return [geometrySelection, updateGeometrySelection];\n};\n","import { parseJSON, parseISO, isValid, format, toDate } from \"date-fns\";\n\nexport const NO_CONTENT_VALUE = \"—\";\n\nexport type DateType = number | Date;\nexport type RawDateType = string | DateType;\n\nexport enum DateFormat {\n ClientDefaultFormat = \"dd.MM.yyyy HH:mm\",\n DateTime = \"dd.MM.yyyy HH:mm:ss\",\n UTC = \"yyyy-MM-dd'T'HH:mm:ss.sssxxx\",\n AxisTooltip = \"d MMMM yyyy\",\n}\n\ninterface FormatDateOptions {\n dateFormat?: DateFormat;\n defaultValue?: RawDateType;\n}\n\nconst stringDateParsers: ((date: string) => DateType)[] = [parseJSON, parseISO, rawDate => new Date(rawDate)];\n\nexport const getDate = (rawDate?: RawDateType | null): Date | null => {\n if (!rawDate) return null;\n\n if (typeof rawDate === \"string\") {\n for (const parser of stringDateParsers) {\n const date = parser(rawDate);\n\n if (isValid(date)) {\n return toDate(date);\n }\n }\n\n return null;\n }\n\n const parsedDate = toDate(rawDate);\n\n return isValid(parsedDate) ? parsedDate : null;\n};\n\nexport const formatDate = (\n date?: RawDateType,\n { dateFormat = DateFormat.ClientDefaultFormat, defaultValue = NO_CONTENT_VALUE }: FormatDateOptions = {},\n): string => {\n const dateValue = date ? getDate(date) : null;\n\n if (isValid(dateValue)) {\n return format(dateValue as Date, dateFormat);\n }\n\n return defaultValue.toString();\n};\n","import { stringify } from \"wkt\";\n\nimport { SelectionHistoryFeature } from \"../components\";\n\nexport const geometryToWkt = (features: SelectionHistoryFeature[] = []): string => {\n if (features.length === 0) {\n return \"\";\n }\n\n return stringify(features[0]);\n};\n","export const isNumeric = (number: string | number): boolean =>\n !isNaN(parseFloat(number as string)) && isFinite(number as number);\n","export function isObject<T>(value: T | object): value is object {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { useMemo } from \"react\";\nimport { isEmpty } from \"lodash\";\n\nimport { useGeometrySelection } from \"./useGeometrySelection\";\nimport { geometryToWkt } from \"../../utils\";\n\nimport { GeometrySelectionTypes } from \"../../components\";\n\nexport const useEwktGeometry = () => {\n const [{ history, type }] = useGeometrySelection();\n\n return useMemo(() => {\n if (history.step === -1) {\n return \"\";\n }\n\n return type === GeometrySelectionTypes.Zones\n ? !isEmpty(history.zones[history.step]?.[0])\n ? `SRID=3857;${geometryToWkt(history.zones[history.step]?.[0])}`\n : `SRID=3857;${geometryToWkt(history.features[history.step])}`\n : `SRID=3857;${geometryToWkt(history.features[history.step])}`;\n }, [history.features, history.step, history.zones, type]);\n};\n","import { useMemo } from \"react\";\n\nimport { useGeometrySelection } from \"./useGeometrySelection\";\n\nexport const useGeometrySelectionBuffer = (): string | undefined => {\n const [\n {\n settings: { bufferRadius, bufferMultiplier },\n isBuffer,\n },\n ] = useGeometrySelection();\n\n return useMemo((): string | undefined => {\n if (!isBuffer || !bufferRadius) {\n return undefined;\n }\n\n return Number((+bufferRadius || 0) * +bufferMultiplier).toFixed(2);\n }, [isBuffer, bufferRadius, bufferMultiplier]);\n};\n","import MapboxDraw, { DrawCustomMode } from \"@mapbox/mapbox-gl-draw\";\n\nimport { ExtendedMapboxDrawModes } from \"../../../core\";\n\nexport const customModes = MapboxDraw.modes as ExtendedMapboxDrawModes;\n\nconst StaticMode = {} as DrawCustomMode;\n\nStaticMode.onSetup = function () {\n this.setActionableState(undefined);\n\n return {};\n};\n\nStaticMode.toDisplayFeatures = function (state, geojson, display) {\n display(geojson);\n};\n\ncustomModes.static = StaticMode;\n","export const customStyles = [\n {\n id: \"gl-draw-point\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"]],\n paint: {\n \"circle-radius\": 5,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"highlight-inactive-points\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"feature\"], [\"==\", \"active\", \"false\"]],\n paint: {\n \"circle-radius\": 5,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"highlight-active-points\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"feature\"], [\"==\", \"active\", \"true\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#fbb03b\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 1,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"gl-draw-polygon-fill-static\",\n type: \"fill\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n paint: {\n \"fill-color\": \"#D20C0C\",\n \"fill-outline-color\": \"#D20C0C\",\n \"fill-opacity\": 0.1,\n },\n },\n {\n id: \"gl-draw-line\",\n type: \"line\",\n filter: [\"all\", [\"==\", \"$type\", \"LineString\"]],\n layout: {\n \"line-cap\": \"round\",\n \"line-join\": \"round\",\n },\n paint: {\n \"line-color\": \"#D20C0C\",\n \"line-dasharray\": [0.2, 2],\n \"line-width\": 2,\n },\n },\n {\n id: \"gl-draw-polygon-fill\",\n type: \"fill\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n paint: {\n \"fill-color\": \"#D20C0C\",\n \"fill-outline-color\": \"#D20C0C\",\n \"fill-opacity\": 0.1,\n },\n },\n {\n id: \"gl-draw-polygon-midpoint\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"midpoint\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#fbb03b\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 1,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"gl-draw-polygon-stroke-active\",\n type: \"line\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n layout: {\n \"line-cap\": \"round\",\n \"line-join\": \"round\",\n },\n paint: {\n \"line-color\": \"#D20C0C\",\n \"line-dasharray\": [0.2, 2],\n \"line-width\": 2,\n },\n },\n {\n id: \"gl-draw-polygon-and-line-vertex-active\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"meta\", \"vertex\"], [\"==\", \"$type\", \"Point\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n];\n","import { useEffect } from \"react\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\n\nimport { customModes } from \"./customModes\";\nimport { customStyles } from \"./customStyles\";\n\nimport { useMapContext } from \"../useMapContext\";\n\nconst draw = new MapboxDraw({\n displayControlsDefault: false,\n styles: customStyles,\n modes: customModes,\n defaultMode: \"draw_point\",\n controls: {\n trash: true,\n },\n});\n\nexport const useMapDraw = (triggerDeps: Array<unknown> = []) => {\n const { map, draw: drawContext, loaded, basemapName } = useMapContext();\n\n useEffect(() => {\n if (!loaded || !map.current) {\n return;\n }\n\n drawContext.current = draw;\n map.current.addControl(drawContext.current);\n }, [loaded]); // eslint-disable-line\n\n useEffect(() => {\n if (map.current && map.current.hasControl(drawContext.current)) {\n map.current.removeControl(drawContext.current);\n map.current.addControl(drawContext.current);\n }\n }, [basemapName, ...triggerDeps]); // eslint-disable-line\n};\n","import { useCallback } from \"react\";\nimport { VectorSourceImpl } from \"mapbox-gl\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useRedrawLayer = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (layerName: string) => {\n const layerTileSource: VectorSourceImpl = map.current.getSource(layerName);\n\n layerTileSource.setTiles(layerTileSource.tiles);\n },\n [map],\n );\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { SelectedFeature } from \"../../components\";\n\nexport const useSelectedFeatures = (): [\n Record<string, SelectedFeature[]>,\n (features: Record<string, SelectedFeature[]>) => void,\n] => {\n const { selectFeatures, setSelectedFeatures } = useMapContext();\n\n const updatSelectedFeatures = useCallback(\n (features: Record<string, SelectedFeature[]>) => {\n setSelectedFeatures(features);\n },\n [setSelectedFeatures],\n );\n\n return [selectFeatures.features ?? ({} as Record<string, SelectedFeature[]>), updatSelectedFeatures];\n};\n","import { useMemo } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesCount = (): number => {\n const { selectFeatures } = useMapContext();\n\n return useMemo(() => {\n return selectFeatures.features?.[selectFeatures.layerName]?.length ?? 0;\n }, [selectFeatures]);\n};\n","import { useMemo } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesCurrentIndex = (): number => {\n const { selectFeatures } = useMapContext();\n\n return useMemo(() => {\n return selectFeatures.features?.[selectFeatures.layerName]?.length\n ? selectFeatures.features?.[selectFeatures.layerName]?.findIndex(\n feature => feature.id === selectFeatures.currentId,\n )\n : -1;\n }, [selectFeatures]);\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesGeometryMasking = (): [boolean, (state: boolean) => void] => {\n const { selectFeatures, setSelectFeaturesGeometryMasking } = useMapContext();\n\n const update = useCallback(\n (state: boolean) => {\n setSelectFeaturesGeometryMasking(state);\n },\n [setSelectFeaturesGeometryMasking],\n );\n\n return [selectFeatures.geometryMasking, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesInitialized = (): [boolean, (value: boolean) => void] => {\n const { selectFeatures, setSelectFeaturesInitialized } = useMapContext();\n\n const update = useCallback(\n (state: boolean) => {\n setSelectFeaturesInitialized(state);\n },\n [setSelectFeaturesInitialized],\n );\n\n return [selectFeatures.initialized, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesLayerName = (): [string, (name?: string) => void] => {\n const { selectFeatures, setSelectFeaturesLayerName } = useMapContext();\n\n const update = useCallback(\n (name: string) => {\n setSelectFeaturesLayerName(name);\n },\n [setSelectFeaturesLayerName],\n );\n\n return [selectFeatures.layerName, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesPagination = () => {\n const { setNextFeature, setPrevFeature } = useMapContext();\n\n const onNext = useCallback(() => {\n setNextFeature();\n }, [setNextFeature]);\n\n const onPrev = useCallback(() => {\n setPrevFeature();\n }, [setPrevFeature]);\n\n return { onNext, onPrev } as const;\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesStatisticsActive = (): [boolean, (state: boolean) => void] => {\n const { selectFeatures, setSelectFeaturesStatisticsActive } = useMapContext();\n\n const update = useCallback(\n (state: boolean) => {\n setSelectFeaturesStatisticsActive(state);\n },\n [setSelectFeaturesStatisticsActive],\n );\n\n return [selectFeatures.statisticsActive, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesTotalCounts = (): [\n Record<string, number>,\n (totalCounts: Record<string, number>) => void,\n] => {\n const { selectFeatures, setSelectedFeaturesTotalCounts } = useMapContext();\n\n const update = useCallback(\n (totalCounts: Record<string, number>) => {\n setSelectedFeaturesTotalCounts(totalCounts);\n },\n [setSelectedFeaturesTotalCounts],\n );\n\n return [selectFeatures.totalCounts ?? {}, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { SelectedFeature } from \"../../components\";\n\nexport const useUpdateCurrentFeature = () => {\n const { updateCurrentFeature } = useMapContext();\n\n return useCallback(\n (values: Partial<SelectedFeature>) => {\n updateCurrentFeature(values);\n },\n [updateCurrentFeature],\n );\n};\n","import { useCallback } from \"react\";\nimport { bbox } from \"@turf/turf\";\n\nimport { useMapContext } from \"./useMapContext\";\nimport { convertSpToTurfFeature } from \"../../core\";\n\nimport { FeatureDcExtended } from \"../../components\";\n\nexport const useZoomToFeatures = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (features?: FeatureDcExtended[], padding?: number) => {\n if (!features) {\n return;\n }\n\n const currentFeatureCenter = bbox({\n type: \"FeatureCollection\",\n features: features.map(feature => convertSpToTurfFeature(feature.geometry)),\n });\n\n map.current.fitBounds(currentFeatureCenter as [number, number, number, number], { padding: padding ?? 150 });\n },\n [map],\n );\n};\n","import { useCallback } from \"react\";\nimport { BulkExtentsDc } from \"@evergis/api\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nconst DEFAULT_PADDING = 50;\n\ninterface ZoomToLayerOptions {\n discardFilters?: boolean;\n padding?: number;\n}\n\nexport const useZoomToLayer = () => {\n const { map } = useMapContext();\n\n return useCallback(\n async (bulkExtent: BulkExtentsDc, options?: ZoomToLayerOptions) => {\n if (!bulkExtent || !bulkExtent.overall) {\n return;\n }\n\n map.current.fitBounds(\n [...bulkExtent.overall.coordinates[0], ...bulkExtent.overall.coordinates[1]] as [\n number,\n number,\n number,\n number,\n ],\n { padding: options?.padding ?? DEFAULT_PADDING },\n );\n },\n [map],\n );\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useZoomToPoint = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (options, callback?: VoidFunction) => {\n if (map.current) {\n if (callback) {\n map.current.once(\"moveend\", () => {\n callback();\n });\n }\n\n map.current.flyTo(options);\n } else {\n callback?.();\n }\n },\n [map],\n );\n};\n","import { useEffect, useRef, useState } from \"react\";\nimport { HubConnection, HubConnectionBuilder, LogLevel } from \"@microsoft/signalr\";\n\nexport const useServerNotifications = (url: string, initialized: boolean): HubConnection | null => {\n const hubConnection = useRef<HubConnection | null>(null);\n const [connection, setConnection] = useState<HubConnection | null>(null);\n\n useEffect(() => {\n if (!initialized) {\n return;\n }\n\n hubConnection.current = new HubConnectionBuilder()\n .withUrl(url, {\n withCredentials: true,\n })\n .configureLogging(LogLevel.Information)\n .build();\n\n hubConnection.current\n .start()\n .then(() => console.info(\"Серверные нотификации подключены\"))\n .catch(err => console.info(\"Ошибка:\", err))\n .finally(() => setConnection(hubConnection.current));\n }, [initialized]); // eslint-disable-line\n\n useEffect(() => {\n if (!connection || connection.state !== \"Connected\") {\n return;\n }\n\n connection\n .invoke(\"SubscribeNotifications\", [])\n .then(() => console.info(\"Подписка `SubscribeNotifications` оформлена\"))\n .catch(err => console.info(\"Ошибка подписки `SubscribeNotifications`:\", err));\n }, [connection]);\n\n return connection;\n};\n","import { createContext } from \"react\";\n\nimport { ServerNotificationsContextProps } from \"./types\";\n\nexport const ServerNotificationsContext = createContext<ServerNotificationsContextProps>({});\n","import { useContext } from \"react\";\n\nimport { ServerNotificationsContext } from \"../../components/ServerNotificationsContext/ServerNotificationsContext\";\n\nexport const useServerNotificationsContext = () => {\n return useContext(ServerNotificationsContext);\n};\n","import { useCallback, useLayoutEffect, useRef } from \"react\";\nimport { isNil } from \"lodash\";\n\nexport enum VerticalPosition {\n Top = \"top\",\n Bottom = \"bottom\",\n}\n\nexport enum HorizontalPosition {\n Left = \"left\",\n Right = \"right\",\n}\n\nexport interface ResizerOptions {\n handleVerticalPosition?: VerticalPosition;\n handleHorizontalPosition?: HorizontalPosition;\n minWidth?: number;\n maxWidth?: number;\n minHeight?: number;\n maxHeight?: number;\n horizontal?: boolean;\n vertical?: boolean;\n useResize?: boolean;\n onResize?: (width: number, height: number) => void;\n onResizeEnd?: (width: number, height: number) => void;\n onResizeStart?: (width: number, height: number) => void;\n}\n\nexport const useResizer = ({\n handleVerticalPosition,\n handleHorizontalPosition,\n minWidth = Number.MIN_SAFE_INTEGER,\n maxWidth = Number.MAX_SAFE_INTEGER,\n horizontal = true,\n minHeight = Number.MIN_SAFE_INTEGER,\n maxHeight = Number.MAX_SAFE_INTEGER,\n vertical = true,\n useResize = false,\n onResize,\n onResizeEnd,\n onResizeStart,\n}: ResizerOptions) => {\n const containerRef = useRef<HTMLDivElement>();\n const verticalHandleRef = useRef<HTMLDivElement>();\n const horizontalHandleRef = useRef<HTMLDivElement>();\n\n const updateSizes = useCallback(\n (width: number, height: number) => {\n let newWidth = width;\n let newHeight = height;\n\n if (horizontal && newWidth < minWidth) {\n newWidth = minWidth;\n }\n\n if (horizontal && newWidth > Math.min(window.innerWidth - horizontalHandleRef.current?.clientWidth, maxWidth)) {\n newWidth = maxWidth;\n }\n\n if (vertical && newHeight < minHeight) {\n newHeight = minHeight;\n }\n\n if (vertical && newHeight > Math.min(window.innerHeight - verticalHandleRef.current?.clientHeight, maxHeight)) {\n newHeight = maxHeight;\n }\n\n if (horizontal) {\n requestAnimationFrame(() => {\n if (!isNil(containerRef.current)) {\n containerRef.current.style.width = `${newWidth}px`;\n }\n });\n }\n\n if (vertical) {\n requestAnimationFrame(() => {\n if (!isNil(containerRef.current)) {\n containerRef.current.style.height = `${newHeight}px`;\n }\n });\n }\n\n onResize?.(newWidth, newHeight);\n },\n [minWidth, maxWidth, minHeight, maxHeight, horizontal, vertical], // eslint-disable-line\n );\n\n const onPointerMove = useCallback(\n (pointerMoveEvent: PointerEvent) => {\n const { x, y } = containerRef.current?.getBoundingClientRect();\n const reverseHorizontal = handleHorizontalPosition === HorizontalPosition.Right;\n const reverseVertical = handleVerticalPosition === VerticalPosition.Bottom;\n\n const newWidth = reverseHorizontal\n ? pointerMoveEvent.pageX - x\n : containerRef.current?.offsetWidth + x - pointerMoveEvent.pageX;\n const newHeight = reverseVertical\n ? pointerMoveEvent.pageY - y\n : containerRef.current?.offsetHeight + y - pointerMoveEvent.pageY;\n\n document.body.style.userSelect = \"none\";\n\n updateSizes(newWidth, newHeight);\n },\n [updateSizes],\n );\n\n const onPointerDown = useCallback(() => {\n const onPointerUp = () => {\n document.body.style.userSelect = \"initial\";\n document.body.removeEventListener(\"pointermove\", onPointerMove);\n\n if (!isNil(containerRef.current)) {\n onResizeEnd?.(containerRef.current.offsetWidth, containerRef.current.offsetHeight);\n }\n };\n\n if (!isNil(containerRef.current)) {\n onResizeStart?.(containerRef.current.offsetWidth, containerRef.current.offsetHeight);\n }\n\n document.body.addEventListener(\"pointermove\", onPointerMove);\n document.body.addEventListener(\"pointerup\", onPointerUp, { once: true });\n }, [onPointerMove]); // eslint-disable-line\n\n useLayoutEffect(() => {\n if (useResize && !isNil(containerRef.current)) {\n updateSizes(containerRef.current.offsetWidth, containerRef.current.offsetHeight);\n }\n }, [updateSizes, useResize]);\n\n return {\n containerRef,\n verticalHandleRef,\n horizontalHandleRef,\n onPointerDown,\n };\n};\n","import { useCallback, useState } from \"react\";\n\nexport const useToggle = (initial?: boolean): [boolean, VoidFunction, (value: boolean) => void] => {\n const [state, setState] = useState(initial !== undefined ? initial : false);\n\n const toggle = useCallback(() => setState(!state), [state]);\n\n return [state, toggle, setState];\n};\n","import { DrawMode } from \"@mapbox/mapbox-gl-draw\";\n\nimport { GeometrySelectionTypes } from \"../../components\";\n\nexport const drawModeToGeometrySelectionType = (mode: DrawMode | string): GeometrySelectionTypes => {\n switch (mode) {\n case \"draw_point\":\n return GeometrySelectionTypes.Point;\n case \"draw_polygon\":\n return GeometrySelectionTypes.Polygon;\n case \"draw_line_string\":\n return GeometrySelectionTypes.Line;\n default:\n return GeometrySelectionTypes.Point;\n }\n};\n","import { toMercator, toWgs84, point, polygon, lineString } from \"@turf/turf\";\nimport { Feature, LineString, Point, Polygon, Position } from \"geojson\";\n\nimport { GeometrySelectionTypes } from \"../../components\";\n\nexport const getGeometrySelectionTurfFeature = (\n coordinates: Position | Position[] | Position[][] | Position[][][],\n selectionType: GeometrySelectionTypes,\n toWgs?: boolean,\n): Feature<Point | LineString | Polygon> => {\n if (toWgs) {\n switch (selectionType) {\n case GeometrySelectionTypes.Point:\n return toWgs84(point(coordinates as Position));\n case GeometrySelectionTypes.Polygon:\n return toWgs84(polygon(coordinates as Position[][]));\n case GeometrySelectionTypes.Line:\n return toWgs84(lineString(coordinates as Position[]));\n default:\n }\n }\n\n switch (selectionType) {\n case GeometrySelectionTypes.Point:\n return toMercator(point(coordinates as Position));\n case GeometrySelectionTypes.Polygon:\n return toMercator(polygon(coordinates as Position[][]));\n case GeometrySelectionTypes.Line:\n return toMercator(lineString(coordinates as Position[]));\n default:\n }\n};\n"],"names":["findAttributeInExpression","expression","Array","isArray","length","reduce","acc","curr","Set","getActualExtrusionHeight","paint","parseClientStyle","style","items","isEmpty","Object","entries","paintAcc","value","convertSpToTurfFeature","geometry","type","GeometryType","Point","point","coordinates","Multipoint","multiPoint","Polyline","multiLineString","Polygon","Envelope","polygon","useMapContext","useContext","MapContext","useCurrentSelectedFeature","selectFeatures","useMemo","features","layerName","find","item","id","currentId","createContext","BaseMapTheme","GeometrySelectionTypes","GeometrySelectionToolTypes","GeometrySelectionZoneTypes","GeometrySelectionRouteTypes","GeometryEditorMode","useGeometryEditor","geometryEditor","setGeometryEditor","update","useCallback","newState","prevState","useEditingFeature","active","mode","currentSelectedFeature","Edit","layer","Create","useGeometrySelection","geometrySelection","setGeometrySelection","updateGeometrySelection","NO_CONTENT_VALUE","DateFormat","stringDateParsers","parseJSON","parseISO","rawDate","Date","getDate","parser","date","isValid","toDate","parsedDate","formatDate","dateFormat","ClientDefaultFormat","defaultValue","dateValue","format","toString","geometryToWkt","stringify","isNumeric","number","isNaN","parseFloat","isFinite","isObject","useEwktGeometry","history","step","Zones","zones","useGeometrySelectionBuffer","settings","bufferRadius","bufferMultiplier","isBuffer","undefined","Number","toFixed","customModes","MapboxDraw","modes","StaticMode","onSetup","setActionableState","toDisplayFeatures","state","geojson","display","static","customStyles","filter","layout","draw","displayControlsDefault","styles","defaultMode","controls","trash","useMapDraw","triggerDeps","map","drawContext","loaded","basemapName","useEffect","current","addControl","hasControl","removeControl","useRedrawLayer","layerTileSource","getSource","setTiles","tiles","useSelectedFeatures","setSelectedFeatures","updatSelectedFeatures","useSelectFeaturesCount","useSelectFeaturesCurrentIndex","findIndex","feature","useSelectFeaturesGeometryMasking","setSelectFeaturesGeometryMasking","geometryMasking","useSelectFeaturesInitialized","setSelectFeaturesInitialized","initialized","useSelectFeaturesLayerName","setSelectFeaturesLayerName","name","useSelectFeaturesPagination","setNextFeature","setPrevFeature","onNext","onPrev","useSelectFeaturesStatisticsActive","setSelectFeaturesStatisticsActive","statisticsActive","useSelectFeaturesTotalCounts","setSelectedFeaturesTotalCounts","totalCounts","useUpdateCurrentFeature","updateCurrentFeature","values","useZoomToFeatures","padding","currentFeatureCenter","bbox","fitBounds","DEFAULT_PADDING","useZoomToLayer","bulkExtent","options","overall","useZoomToPoint","callback","once","flyTo","useServerNotifications","url","hubConnection","useRef","connection","setConnection","useState","HubConnectionBuilder","withUrl","withCredentials","configureLogging","LogLevel","Information","build","start","then","console","info","catch","err","finally","invoke","ServerNotificationsContext","useServerNotificationsContext","VerticalPosition","HorizontalPosition","useResizer","handleVerticalPosition","handleHorizontalPosition","minWidth","MIN_SAFE_INTEGER","maxWidth","MAX_SAFE_INTEGER","horizontal","minHeight","maxHeight","vertical","useResize","onResize","onResizeEnd","onResizeStart","containerRef","verticalHandleRef","horizontalHandleRef","updateSizes","width","height","newWidth","newHeight","Math","min","window","innerWidth","clientWidth","innerHeight","clientHeight","requestAnimationFrame","isNil","onPointerMove","pointerMoveEvent","x","y","getBoundingClientRect","reverseHorizontal","Right","reverseVertical","Bottom","pageX","offsetWidth","pageY","offsetHeight","document","body","userSelect","onPointerDown","onPointerUp","removeEventListener","addEventListener","useLayoutEffect","useToggle","initial","setState","toggle","drawModeToGeometrySelectionType","Line","getGeometrySelectionTurfFeature","selectionType","toWgs","toWgs84","lineString","toMercator"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAEaA,yBAAyB,GAAIC,UAAD;AACvC,MAAIC,KAAK,CAACC,OAAN,CAAcF,UAAd,KAA6BA,UAAU,CAACG,MAAX,KAAsB,CAAnD,IAAwDH,UAAU,CAAC,CAAD,CAAV,KAAkB,KAA9E,EAAqF;AACnF,WAAO,CAACA,UAAU,CAAC,CAAD,CAAX,CAAP;AACD;;AAED,SAAOA,UAAU,CAACI,MAAX,CAAkB,CAACC,GAAD,EAAgBC,IAAhB;AACvB,QAAI,CAACL,KAAK,CAACC,OAAN,CAAcI,IAAd,CAAL,EAA0B;AACxB,aAAOD,GAAP;AACD;;AAED,QAAIC,IAAI,CAAC,CAAD,CAAJ,KAAY,KAAhB,EAAuB;AACrB,aAAO,CAAC,GAAG,IAAIC,GAAJ,CAAQ,CAAC,GAAGF,GAAJ,EAASC,IAAI,CA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styled.ts","../src/components/ErrorBoundary/index.tsx","../src/components/Layer/constants.ts","../src/components/Layer/RasterLayer.tsx","../src/components/Layer/utils/getClientStyleItemPrefixSuffix.ts","../src/core/classification/findAttributeInExpression.ts","../src/core/classification/getActualExtrusionHeight.ts","../src/core/classification/parseClientStyle.ts","../src/core/feature/convertSpToTurfFeature.ts","../src/components/Layer/VectorLayer.tsx","../src/components/Layer/Layer.tsx","../src/components/Map/styled.ts","../src/hooks/map/useMapDraw/customModes.ts","../src/hooks/map/useMapDraw/customStyles.ts","../src/contexts/MapContext/MapContext.ts","../src/contexts/MapContext/MapProvider.tsx","../src/contexts/MapContext/types.ts","../src/contexts/ServerNotificationsContext/ServerNotificationsContext.ts","../src/contexts/ServerNotificationsContext/hooks/useServerNotifications.ts","../src/contexts/ServerNotificationsContext/ServerNotificationsProvider.tsx","../src/hooks/map/useMapContext.ts","../src/hooks/map/useMapDraw/index.ts","../src/hooks/map/useRedrawLayer.ts","../src/hooks/map/useZoomToFeatures.ts","../src/hooks/map/useZoomToPoint.ts","../src/hooks/serverNotifications/useServerNotificationsContext.ts","../src/utils/date.ts","../src/utils/debounce.ts","../src/utils/isNumeric.ts","../src/utils/isObject.ts","../src/hooks/useDebouncedCallback.ts","../src/hooks/useToggle.ts","../src/hooks/useWindowResize.ts","../src/components/Map/Map.tsx"],"sourcesContent":["import styled from \"styled-components\";\n\nexport const ErrorBoundaryContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n`;\n","import React, { Component } from \"react\";\n\nimport { ErrorBoundaryContainer } from \"./styled\";\n\nimport { ErrorBoundaryProps, ErrorBoundaryState } from \"./types\";\n\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n public state = { hasError: false };\n\n public static getDerivedStateFromError() {\n return { hasError: true };\n }\n\n public componentDidCatch(error: Error) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n\n public render() {\n const { children, errorContents } = this.props;\n const { hasError } = this.state;\n\n return !hasError ? (\n <>{children}</>\n ) : (\n <ErrorBoundaryContainer>\n {errorContents}\n </ErrorBoundaryContainer>\n );\n }\n}\n","import { CirclePaint, FillPaint, FillExtrusionPaint, LinePaint } from \"mapbox-gl\";\n\nconst DEFAULT_COLOR = \"#00ffff\";\nconst DEFAULT_OPACITY = 0.5;\nconst DEFAULT_SIZE = 4;\nconst DEFAULT_LINE_WIDTH = 1;\n\nexport const DEFAULT_CIRCLE_PAINT = {\n \"circle-radius\": DEFAULT_SIZE,\n \"circle-color\": DEFAULT_COLOR,\n \"circle-opacity\": DEFAULT_OPACITY,\n \"circle-stroke-width\": 0,\n \"circle-stroke-color\": DEFAULT_COLOR,\n \"circle-stroke-opacity\": DEFAULT_OPACITY,\n} as CirclePaint;\n\nexport const DEFAULT_FILL_PAINT = {\n \"fill-color\": DEFAULT_COLOR,\n \"fill-opacity\": DEFAULT_OPACITY,\n} as FillPaint;\n\nexport const DEFAULT_FILL_EXTRUSION_PAINT = {\n \"fill-extrusion-base\": 0,\n \"fill-extrusion-vertical-gradient\": true,\n \"fill-extrusion-color\": DEFAULT_COLOR,\n \"fill-extrusion-opacity\": DEFAULT_OPACITY,\n \"fill-extrusion-height\": 0,\n} as FillExtrusionPaint;\n\nexport const DEFAULT_LINE_PAINT = {\n \"line-color\": DEFAULT_COLOR,\n \"line-width\": DEFAULT_LINE_WIDTH,\n \"line-opacity\": DEFAULT_OPACITY,\n} as LinePaint;\n","import React, { FC } from \"react\";\nimport { Source, Layer as MapboxLayer } from \"react-map-gl/mapbox\";\n\nimport { LayerProps } from \"./types\";\n\nexport const RasterLayer: FC<Omit<LayerProps, \"layerType\">> = ({\n layer,\n tileUrl,\n visible,\n beforeId,\n}) => {\n if (!layer) {\n return null;\n }\n\n return (\n <Source id={layer.name} type=\"raster\" tiles={[tileUrl]}>\n <MapboxLayer\n id={layer.name}\n type=\"raster\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{ visibility: visible ? \"visible\" : \"none\" }}\n />\n </Source>\n );\n};\n","import { GeometryType } from \"@evergis/api\";\n\nimport { ClientStyleItem } from \"../../../types\";\n\nexport const getClientStyleItemPrefixSuffix = (\n geometryType: GeometryType,\n type: ClientStyleItem[\"type\"],\n): [string, string] => {\n switch (geometryType) {\n case GeometryType.Point:\n return [\"point-layer-\", \"\"];\n case GeometryType.Polyline:\n return [\"polyline-layer-\", \"\"];\n case GeometryType.Polygon:\n switch (type) {\n case \"line\":\n return [\"polygon-stroke-layer-\", \"-stroke\"];\n case \"fill-extrusion\":\n return [\"polygon-extrusion-layer-\", \"-extrusion\"];\n default:\n return [\"polygon-layer-\", \"\"];\n }\n default:\n return [\"\", \"\"];\n }\n};\n","import { ExpressionSpecification } from \"mapbox-gl\";\n\nexport const findAttributeInExpression = (expression: ExpressionSpecification): string[] => {\n if (Array.isArray(expression) && expression.length === 2 && expression[0] === \"get\") {\n return [expression[1]];\n }\n\n return expression.reduce((acc: string[], curr) => {\n if (!Array.isArray(curr)) {\n return acc;\n }\n\n if (curr[0] === \"get\") {\n return [...new Set([...acc, curr[1]])];\n }\n\n return [...new Set([...acc, ...findAttributeInExpression(curr as ExpressionSpecification)])];\n }, []);\n};\n","import { AnyPaint } from \"mapbox-gl\";\n\nexport const getActualExtrusionHeight = (paint: AnyPaint) => {\n return Array.isArray(paint?.[\"fill-extrusion-height\"]) && paint?.[\"fill-extrusion-height\"][0] === \"+\"\n ? paint?.[\"fill-extrusion-height\"][1]\n : paint?.[\"fill-extrusion-height\"];\n};\n","import { isEmpty } from \"lodash\";\nimport { ExpressionSpecification } from \"mapbox-gl\";\n\nimport { findAttributeInExpression } from \"./findAttributeInExpression\";\n\nimport { ClientStyle } from \"../../types\";\n\nexport const parseClientStyle = (style?: ClientStyle): string[] => {\n if (!style) {\n return [];\n }\n\n return style?.items?.reduce((acc: string[], curr) => {\n if (!curr.paint || isEmpty(curr.paint)) {\n return acc;\n }\n\n return Object.entries(curr.paint)?.reduce((paintAcc: string[], [, value]) => {\n if (!Array.isArray(value)) {\n return paintAcc;\n }\n\n return [...new Set([...paintAcc, ...findAttributeInExpression(value as ExpressionSpecification)])];\n }, []);\n }, []);\n};\n","import { FeatureDc, GeometryType, PositionDc } from \"@evergis/api\";\nimport { multiLineString, multiPoint, point, polygon } from \"@turf/turf\";\nimport { Feature } from \"geojson\";\n\nexport const convertSpToTurfFeature = (geometry?: FeatureDc[\"geometry\"]): Feature<any> | undefined => {\n if (!geometry) {\n return;\n }\n\n switch (geometry.type) {\n case GeometryType.Point:\n return point(geometry.coordinates as PositionDc);\n case GeometryType.Multipoint:\n return multiPoint(geometry.coordinates as PositionDc[]);\n case GeometryType.Polyline:\n return multiLineString(geometry.coordinates as PositionDc[][]);\n case GeometryType.Polygon:\n case GeometryType.Envelope:\n return polygon(geometry.coordinates as PositionDc[][]);\n default:\n }\n};\n","import React, { FC, useCallback, useEffect } from \"react\";\nimport { Layer as MapboxLayer, Source } from \"react-map-gl/mapbox\";\nimport { FeatureLayerServiceInfoDc, GeometryType, QueryLayerServiceConfigurationDc } from \"@evergis/api\";\nimport { AnyPaint, CirclePaint, FillExtrusionPaint, FillPaint, LinePaint } from \"mapbox-gl\";\n\nimport {\n DEFAULT_CIRCLE_PAINT,\n DEFAULT_FILL_EXTRUSION_PAINT,\n DEFAULT_FILL_PAINT,\n DEFAULT_LINE_PAINT,\n} from \"./constants\";\n\nimport { getClientStyleItemPrefixSuffix } from \"./utils/getClientStyleItemPrefixSuffix\";\nimport { getActualExtrusionHeight } from \"../../core\";\n\nimport { LayerProps } from \"./types\";\nimport { ClientStyle } from \"../../types\";\n\nexport const VectorLayer: FC<Omit<LayerProps, \"layerType\">> = ({\n layer,\n tileUrl,\n visible,\n beforeId,\n getLayerTempStyle,\n onMount = () => null,\n}) => {\n const clientStyle = (layer?.configuration as QueryLayerServiceConfigurationDc)?.clientStyle as ClientStyle;\n const { idAttribute, geometryType } = (layer as FeatureLayerServiceInfoDc).layerDefinition || {};\n\n const renderLayerByGeometryType = useCallback(() => {\n const visibility = visible ? \"visible\" : \"none\";\n\n switch (geometryType) {\n case GeometryType.Point:\n return (\n <MapboxLayer\n id={layer.name}\n type=\"circle\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"circle\")?.layout,\n visibility,\n }}\n paint={{\n ...DEFAULT_CIRCLE_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"circle\")?.paint as CirclePaint),\n }}\n />\n );\n case GeometryType.Polygon:\n return [\n <MapboxLayer\n key={`polygon-layer-${layer.name}`}\n id={layer.name}\n type=\"fill\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"fill\")?.layout,\n visibility:\n visible &&\n getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.settings?.fill?.showBottomSurface !== false &&\n Boolean(\n getActualExtrusionHeight({\n ...DEFAULT_FILL_EXTRUSION_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint as FillExtrusionPaint),\n }),\n )\n ? \"visible\"\n : \"none\",\n }}\n paint={{\n ...DEFAULT_FILL_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill\")?.paint as FillPaint),\n }}\n />,\n <MapboxLayer\n key={`polygon-stroke-layer-${layer.name}`}\n id={`${layer.name}-stroke`}\n type=\"line\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"line\")?.layout,\n visibility:\n visible &&\n getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.settings?.fill?.showBottomSurface !== false &&\n Boolean(\n getActualExtrusionHeight({\n ...DEFAULT_FILL_EXTRUSION_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint as FillExtrusionPaint),\n }),\n )\n ? \"visible\"\n : \"none\",\n }}\n paint={{\n ...DEFAULT_LINE_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"line\")?.paint as LinePaint),\n }}\n />,\n <MapboxLayer\n key={`polygon-extrusion-layer-${layer.name}`}\n id={`${layer.name}-extrusion`}\n type=\"fill-extrusion\"\n source-layer=\"default\"\n beforeId={beforeId}\n minzoom={0}\n maxzoom={23}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.layout,\n visibility,\n }}\n paint={{\n ...DEFAULT_FILL_EXTRUSION_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint as FillExtrusionPaint),\n }}\n />,\n ];\n case GeometryType.Polyline:\n return (\n <MapboxLayer\n id={layer.name}\n type=\"line\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"line\")?.layout,\n visibility,\n }}\n paint={{\n ...DEFAULT_LINE_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"line\")?.paint as LinePaint),\n }}\n />\n );\n default:\n return null;\n }\n }, [geometryType, layer, beforeId, getLayerTempStyle, visible]);\n\n const renderClientStyle = useCallback(() => {\n return clientStyle.items.map(mockItem => {\n const prefixSuffix = getClientStyleItemPrefixSuffix(geometryType, mockItem.type);\n const isExtrusionItem = mockItem.type === \"fill-extrusion\";\n const isPolygonPart =\n clientStyle.items.some(item => item.type === \"fill-extrusion\") &&\n (mockItem.type === \"fill\" || mockItem.type === \"line\");\n const fillExtrusionPaint =\n isPolygonPart || isExtrusionItem\n ? {\n ...clientStyle.items?.find(item => item.type === \"fill-extrusion\")?.paint,\n ...getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint,\n }\n : undefined;\n const currentSettings = {\n ...clientStyle?.settings,\n ...getLayerTempStyle?.(layer.name, mockItem.type)?.settings,\n };\n const processedExtrusionHeight = getActualExtrusionHeight(fillExtrusionPaint);\n const hasExtrusion = Boolean(processedExtrusionHeight);\n const visibility =\n visible &&\n ((isExtrusionItem && hasExtrusion) ||\n (!isPolygonPart && !isExtrusionItem) ||\n (isPolygonPart && (!hasExtrusion || (currentSettings?.fill?.showBottomSurface ?? true))))\n ? \"visible\"\n : \"none\";\n\n return (\n <MapboxLayer\n key={`${prefixSuffix[0]}${layer.name}`}\n id={`${layer.name}${prefixSuffix[1]}`}\n type={mockItem.type}\n source-layer=\"default\"\n beforeId={beforeId}\n minzoom={clientStyle?.minzoom ?? 0}\n maxzoom={clientStyle?.maxzoom ?? 23}\n layout={{\n ...mockItem.layout,\n ...getLayerTempStyle?.(layer.name, mockItem.type)?.layout,\n visibility,\n }}\n paint={\n {\n ...mockItem.paint,\n ...getLayerTempStyle?.(layer.name, mockItem.type)?.paint,\n } as AnyPaint\n }\n />\n );\n });\n }, [beforeId, clientStyle, geometryType, layer.name, visible, getLayerTempStyle]);\n\n useEffect(onMount, [layer.name]); // eslint-disable-line\n\n if (!layer) {\n return null;\n }\n\n return (\n <Source\n promoteId={idAttribute}\n id={layer.name}\n type=\"vector\"\n tiles={[tileUrl]}\n >\n {clientStyle?.items ? renderClientStyle() : renderLayerByGeometryType()}\n </Source>\n );\n};\n","import React, { FC, useEffect } from \"react\";\n\nimport { RasterLayer } from \"./RasterLayer\";\nimport { VectorLayer } from \"./VectorLayer\";\n\nimport { LayerProps } from \"./types\";\n\nexport const Layer: FC<LayerProps> = ({\n layer,\n layerType,\n visible,\n beforeId,\n tileUrl,\n onMount = () => null,\n}) => {\n useEffect(onMount, [layer.name]); // eslint-disable-line\n\n if (!layer) {\n return null;\n }\n\n if (layerType === \"RasterTileLayer\") {\n return (\n <RasterLayer\n layer={layer}\n tileUrl={tileUrl}\n visible={visible}\n beforeId={beforeId}\n onMount={onMount}\n />\n );\n }\n\n return (\n <VectorLayer\n layer={layer}\n tileUrl={tileUrl}\n visible={visible}\n beforeId={beforeId}\n onMount={onMount}\n />\n );\n};\n","import { CSSProperties } from \"react\";\nimport styled from \"styled-components\";\n\nexport const MapWrapper = styled.div<{ $zIndex?: CSSProperties[\"zIndex\"] }>`\n position: relative;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n z-index: ${({ $zIndex }) => $zIndex ?? 1};\n\n .mapbox-gl-draw_trash {\n display: none;\n }\n\n .mapboxgl-ctrl-logo {\n display: none;\n }\n\n .mapboxgl-ctrl.mapboxgl-ctrl-attrib {\n display: none;\n }\n\n .mapboxgl-ctrl-geocoder.mapboxgl-ctrl {\n width: 350px;\n }\n`;\n","import MapboxDraw, { DrawCustomMode } from \"@mapbox/mapbox-gl-draw\";\n\ninterface ExtendedMapboxDrawModes extends MapboxDraw.Modes {\n [key: string]: DrawCustomMode;\n static: DrawCustomMode;\n}\n\nexport const customModes = MapboxDraw.modes as ExtendedMapboxDrawModes;\n\nconst StaticMode = {} as DrawCustomMode;\n\nStaticMode.onSetup = function () {\n this.setActionableState(undefined);\n\n return {};\n};\n\nStaticMode.toDisplayFeatures = function (state, geojson, display) {\n display(geojson);\n};\n\ncustomModes.static = StaticMode;\n","export const customStyles = [\n {\n id: \"gl-draw-point\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"]],\n paint: {\n \"circle-radius\": 5,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"highlight-inactive-points\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"feature\"], [\"==\", \"active\", \"false\"]],\n paint: {\n \"circle-radius\": 5,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"highlight-active-points\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"feature\"], [\"==\", \"active\", \"true\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#fbb03b\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 1,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"gl-draw-polygon-fill-static\",\n type: \"fill\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n paint: {\n \"fill-color\": \"#D20C0C\",\n \"fill-outline-color\": \"#D20C0C\",\n \"fill-opacity\": 0.1,\n },\n },\n {\n id: \"gl-draw-line\",\n type: \"line\",\n filter: [\"all\", [\"==\", \"$type\", \"LineString\"]],\n layout: {\n \"line-cap\": \"round\",\n \"line-join\": \"round\",\n },\n paint: {\n \"line-color\": \"#D20C0C\",\n \"line-dasharray\": [0.2, 2],\n \"line-width\": 2,\n },\n },\n {\n id: \"gl-draw-polygon-fill\",\n type: \"fill\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n paint: {\n \"fill-color\": \"#D20C0C\",\n \"fill-outline-color\": \"#D20C0C\",\n \"fill-opacity\": 0.1,\n },\n },\n {\n id: \"gl-draw-polygon-midpoint\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"midpoint\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#fbb03b\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 1,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"gl-draw-polygon-stroke-active\",\n type: \"line\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n layout: {\n \"line-cap\": \"round\",\n \"line-join\": \"round\",\n },\n paint: {\n \"line-color\": \"#D20C0C\",\n \"line-dasharray\": [0.2, 2],\n \"line-width\": 2,\n },\n },\n {\n id: \"gl-draw-polygon-and-line-vertex-active\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"meta\", \"vertex\"], [\"==\", \"$type\", \"Point\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n];\n","import { createContext } from \"react\";\n\nimport { MapContextProps } from \"./types\";\n\nexport const MapContext = createContext<MapContextProps>({});\n","import React, { FC, useRef, useState } from \"react\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\n\nimport { MapContext } from \"./MapContext\";\n\nimport { MapProviderProps } from \"./types\";\n\nexport const MapProvider: FC<MapProviderProps> = ({ basemapItems, defaultBasemap, children }) => {\n const map = useRef<MapboxGLMap | undefined>();\n const draw = useRef<MapboxDraw | undefined>();\n const [loaded, setLoaded] = useState<boolean>(false);\n const [basemapName, setBasemapName] = useState(defaultBasemap);\n\n return (\n <MapContext.Provider\n value={{\n map,\n draw,\n loaded,\n setLoaded,\n basemapItems,\n basemapName,\n setBasemapName,\n defaultBasemap,\n }}\n >\n {children}\n </MapContext.Provider>\n );\n};\n","import { Dispatch, MutableRefObject, PropsWithChildren, SetStateAction } from \"react\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\n\nexport enum BaseMapTheme {\n Light = \"light\",\n Dark = \"dark\",\n}\n\nexport interface BaseMapItem {\n name: string;\n source: string;\n preview?: string;\n imgSrc?: string;\n title: string;\n theme?: BaseMapTheme;\n opacity?: number;\n color?: string;\n}\n\nexport interface MapContextProps {\n map?: MutableRefObject<MapboxGLMap>;\n draw?: MutableRefObject<Omit<MapboxDraw, \"getDefaultPosition\">>;\n loaded?: boolean;\n setLoaded?: Dispatch<SetStateAction<boolean>>;\n basemapItems?: BaseMapItem[];\n basemapName?: string;\n setBasemapName?: Dispatch<SetStateAction<string>>;\n defaultBasemap?: string;\n}\n\nexport interface MapProviderProps extends PropsWithChildren {\n basemapItems: BaseMapItem[];\n defaultBasemap: string;\n}\n","import { createContext } from \"react\";\n\nimport { ServerNotificationsContextProps } from \"./types\";\n\nexport const ServerNotificationsContext = createContext<ServerNotificationsContextProps>({});\n","import { useEffect, useRef, useState } from \"react\";\nimport { HubConnection, HubConnectionBuilder, LogLevel } from \"@microsoft/signalr\";\n\nexport const useServerNotifications = (url: string, initialized: boolean): HubConnection | null => {\n const hubConnection = useRef<HubConnection | null>(null);\n const [connection, setConnection] = useState<HubConnection | null>(null);\n\n useEffect(() => {\n if (!initialized) {\n return;\n }\n\n hubConnection.current = new HubConnectionBuilder()\n .withUrl(url, {\n withCredentials: true,\n })\n .configureLogging(LogLevel.Information)\n .build();\n\n hubConnection.current\n .start()\n .then(() => console.info(\"Серверные нотификации подключены\"))\n .catch(err => console.info(\"Ошибка:\", err))\n .finally(() => setConnection(hubConnection.current));\n }, [initialized]); // eslint-disable-line\n\n useEffect(() => {\n if (!connection || connection.state !== \"Connected\") {\n return;\n }\n\n connection\n .invoke(\"SubscribeNotifications\", [])\n .then(() => console.info(\"Подписка `SubscribeNotifications` оформлена\"))\n .catch(err => console.info(\"Ошибка подписки `SubscribeNotifications`:\", err));\n }, [connection]);\n\n return connection;\n};\n","import React, { FC, useCallback } from \"react\";\n\nimport { ServerNotificationsContext } from \"./ServerNotificationsContext\";\n\nimport { useServerNotifications } from \"./hooks/useServerNotifications\";\n\nimport { ServerNotificationsProviderProps } from \"./types\";\n\nexport const ServerNotificationsProvider: FC<ServerNotificationsProviderProps> = ({ url, initialized, children }) => {\n const connection = useServerNotifications(url, initialized);\n\n const addSubscription = useCallback(\n async (payload?: any): Promise<string | null> => {\n if (!connection || connection.state !== \"Connected\" || !payload) {\n return;\n }\n\n try {\n const id = await connection.invoke(\"AddSubscription\", payload);\n\n console.info(\"Подписка добавлена, id:\", id);\n\n return id;\n } catch (err) {\n console.info(\"Ошибка добавления подписки:\", err);\n\n return Promise.resolve(null);\n }\n },\n [connection],\n );\n\n const updateSubscription = useCallback(\n async (id: string | null, payload?: any): Promise<void> => {\n if (!connection || connection.state !== \"Connected\" || !id || !payload) {\n return;\n }\n\n try {\n await connection.invoke(\"UpdateSubscription\", id, payload);\n } catch (err) {\n console.info(`Ошибка обновления подписки ${id}:`, err);\n }\n },\n [connection],\n );\n\n const unsubscribeById = useCallback(\n async (id: string | null): Promise<void> => {\n if (!connection || connection.state !== \"Connected\" || !id) {\n return;\n }\n\n try {\n await connection.invoke(\"Unsubscribe\", [id]);\n } catch (err) {\n console.info(`Ошибка отписки по ${id}:`, err);\n }\n },\n [connection],\n );\n\n return (\n <ServerNotificationsContext.Provider value={{ connection, addSubscription, updateSubscription, unsubscribeById }}>\n {children}\n </ServerNotificationsContext.Provider>\n );\n};\n","import { useContext } from \"react\";\n\nimport { MapContext } from \"../../contexts\";\n\nexport const useMapContext = () => {\n return useContext(MapContext);\n};\n","import { useEffect } from \"react\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\n\nimport { customModes } from \"./customModes\";\nimport { customStyles } from \"./customStyles\";\n\nimport { useMapContext } from \"../useMapContext\";\n\nconst draw = new MapboxDraw({\n displayControlsDefault: false,\n styles: customStyles,\n modes: customModes,\n defaultMode: \"draw_point\",\n controls: {\n trash: true,\n },\n});\n\nexport const useMapDraw = (triggerDeps: Array<unknown> = []) => {\n const { map, draw: drawContext, loaded, basemapName } = useMapContext();\n\n useEffect(() => {\n if (!loaded || !map.current) {\n return;\n }\n\n drawContext.current = draw;\n map.current.addControl(drawContext.current);\n }, [loaded]); // eslint-disable-line\n\n useEffect(() => {\n if (map.current && map.current.hasControl(drawContext.current)) {\n map.current.removeControl(drawContext.current);\n map.current.addControl(drawContext.current);\n }\n }, [basemapName, ...triggerDeps]); // eslint-disable-line\n};\n","import { useCallback } from \"react\";\nimport { VectorSourceImpl } from \"mapbox-gl\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useRedrawLayer = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (layerName: string) => {\n const layerTileSource: VectorSourceImpl = map.current.getSource(layerName);\n\n layerTileSource.setTiles(layerTileSource.tiles);\n },\n [map],\n );\n};\n","import { useCallback } from \"react\";\nimport { bbox } from \"@turf/turf\";\nimport { FeatureDc } from \"@evergis/api\";\n\nimport { useMapContext } from \"./useMapContext\";\nimport { convertSpToTurfFeature } from \"../../core\";\n\nexport const useZoomToFeatures = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (features?: FeatureDc[], padding?: number) => {\n if (!features) {\n return;\n }\n\n const currentFeatureCenter = bbox({\n type: \"FeatureCollection\",\n features: features.map(feature => convertSpToTurfFeature(feature.geometry)),\n });\n\n map.current.fitBounds(currentFeatureCenter as [number, number, number, number], { padding: padding ?? 150 });\n },\n [map],\n );\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useZoomToPoint = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (options, callback?: VoidFunction) => {\n if (map.current) {\n if (callback) {\n map.current.once(\"moveend\", () => {\n callback();\n });\n }\n\n map.current.flyTo(options);\n } else {\n callback?.();\n }\n },\n [map],\n );\n};\n","import { useContext } from \"react\";\n\nimport { ServerNotificationsContext } from \"../../contexts\";\n\nexport const useServerNotificationsContext = () => {\n return useContext(ServerNotificationsContext);\n};\n","import { parseJSON, parseISO, isValid, format, toDate } from \"date-fns\";\n\nexport const NO_CONTENT_VALUE = \"—\";\n\nexport type DateType = number | Date;\nexport type RawDateType = string | DateType;\n\nexport enum DateFormat {\n ClientDefaultFormat = \"dd.MM.yyyy HH:mm\",\n DateTime = \"dd.MM.yyyy HH:mm:ss\",\n UTC = \"yyyy-MM-dd'T'HH:mm:ss.sssxxx\",\n AxisTooltip = \"d MMMM yyyy\",\n}\n\ninterface FormatDateOptions {\n dateFormat?: DateFormat;\n defaultValue?: RawDateType;\n}\n\nconst stringDateParsers: ((date: string) => DateType)[] = [parseJSON, parseISO, rawDate => new Date(rawDate)];\n\nexport const getDate = (rawDate?: RawDateType | null): Date | null => {\n if (!rawDate) return null;\n\n if (typeof rawDate === \"string\") {\n for (const parser of stringDateParsers) {\n const date = parser(rawDate);\n\n if (isValid(date)) {\n return toDate(date);\n }\n }\n\n return null;\n }\n\n const parsedDate = toDate(rawDate);\n\n return isValid(parsedDate) ? parsedDate : null;\n};\n\nexport const formatDate = (\n date?: RawDateType,\n { dateFormat = DateFormat.ClientDefaultFormat, defaultValue = NO_CONTENT_VALUE }: FormatDateOptions = {},\n): string => {\n const dateValue = date ? getDate(date) : null;\n\n if (isValid(dateValue)) {\n return format(dateValue as Date, dateFormat);\n }\n\n return defaultValue.toString();\n};\n","export const debounce = (callback: any, delay: number): ((...args) => void) => {\n let timeId: number;\n\n return (...args) => {\n if (timeId) {\n window.clearTimeout(timeId);\n }\n\n timeId = window.setTimeout(() => {\n callback(...args);\n }, delay);\n };\n};\n","export const isNumeric = (number: string | number): boolean =>\n !isNaN(parseFloat(number as string)) && isFinite(number as number);\n","export function isObject<T>(value: T | object): value is object {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { useMemo } from \"react\";\n\nimport { debounce } from \"../utils\";\n\nexport const useDebouncedCallback = <CallbackFn extends () => void>(interval: number): ((cb: CallbackFn) => void) => {\n return useMemo(\n () =>\n debounce((cb: CallbackFn) => {\n cb();\n }, interval),\n [interval],\n );\n};\n","import { useCallback, useState } from \"react\";\n\nexport const useToggle = (initial?: boolean): [boolean, VoidFunction, (value: boolean) => void] => {\n const [state, setState] = useState(initial !== undefined ? initial : false);\n\n const toggle = useCallback(() => setState(!state), [state]);\n\n return [state, toggle, setState];\n};\n","import { useEffect, useMemo } from \"react\";\n\nimport { debounce } from \"../utils\";\n\nconst DEBOUNCE_DELAY = 144;\n\nexport const useWindowResize = (callback?: (...args: any) => any, delay?: number) => {\n const debounceCallback = useMemo(() => {\n return callback ? debounce(callback, delay || DEBOUNCE_DELAY) : undefined;\n }, [callback, delay]);\n\n useEffect(() => {\n debounceCallback && window.addEventListener(\"resize\", debounceCallback);\n\n return () => debounceCallback && window.removeEventListener(\"resize\", debounceCallback);\n }, [debounceCallback]);\n};\n","import React, { FC } from \"react\";\nimport { default as MapGL } from \"react-map-gl/mapbox\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport \"@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css\";\n\nimport { MapWrapper } from \"./styled\";\n\nimport { useMapContext } from \"../../hooks\";\n\nimport { MapProps } from \"./types\";\n\nimport \"mapbox-gl/dist/mapbox-gl.css\";\n\nexport const Map: FC<MapProps> = ({\n zIndex,\n lowerSiblings,\n upperSiblings,\n drawTriggerDeps,\n onError,\n children,\n ...rest\n}) => {\n const { map, setLoaded } = useMapContext();\n\n return (\n <MapWrapper $zIndex={zIndex}>\n {lowerSiblings}\n <MapGL\n {...rest}\n renderWorldCopies\n antialias\n doubleClickZoom={false}\n cursor=\"default\"\n onLoad={e => {\n map.current = e.target as MapboxGLMap;\n\n map.current.on(\"error\", onError);\n\n setLoaded(true);\n }}\n >\n {children}\n </MapGL>\n {upperSiblings}\n </MapWrapper>\n );\n};\n"],"names":["ErrorBoundaryContainer","styled","div","ErrorBoundary","hasError","componentDidCatch","error","console","render","children","errorContents","props","state","React","getDerivedStateFromError","Component","DEFAULT_COLOR","DEFAULT_OPACITY","DEFAULT_SIZE","DEFAULT_LINE_WIDTH","DEFAULT_CIRCLE_PAINT","DEFAULT_FILL_PAINT","DEFAULT_FILL_EXTRUSION_PAINT","DEFAULT_LINE_PAINT","RasterLayer","layer","tileUrl","visible","beforeId","Source","id","name","type","tiles","MapboxLayer","layout","visibility","getClientStyleItemPrefixSuffix","geometryType","GeometryType","Point","Polyline","Polygon","findAttributeInExpression","expression","Array","isArray","length","reduce","acc","curr","Set","getActualExtrusionHeight","paint","parseClientStyle","style","items","isEmpty","Object","entries","paintAcc","value","convertSpToTurfFeature","geometry","point","coordinates","Multipoint","multiPoint","multiLineString","Envelope","polygon","VectorLayer","getLayerTempStyle","onMount","clientStyle","configuration","idAttribute","layerDefinition","renderLayerByGeometryType","useCallback","key","settings","fill","showBottomSurface","Boolean","minzoom","maxzoom","renderClientStyle","map","mockItem","prefixSuffix","isExtrusionItem","isPolygonPart","some","item","fillExtrusionPaint","find","undefined","currentSettings","processedExtrusionHeight","hasExtrusion","useEffect","promoteId","Layer","layerType","MapWrapper","$zIndex","customModes","MapboxDraw","modes","StaticMode","onSetup","setActionableState","toDisplayFeatures","geojson","display","static","customStyles","filter","MapContext","createContext","MapProvider","basemapItems","defaultBasemap","useRef","draw","loaded","setLoaded","useState","basemapName","setBasemapName","Provider","BaseMapTheme","ServerNotificationsContext","useServerNotifications","url","initialized","hubConnection","connection","setConnection","current","HubConnectionBuilder","withUrl","withCredentials","configureLogging","LogLevel","Information","build","start","then","info","catch","err","finally","invoke","ServerNotificationsProvider","addSubscription","payload","Promise","resolve","updateSubscription","unsubscribeById","useMapContext","useContext","displayControlsDefault","styles","defaultMode","controls","trash","useMapDraw","triggerDeps","drawContext","addControl","hasControl","removeControl","useRedrawLayer","layerName","layerTileSource","getSource","setTiles","useZoomToFeatures","features","padding","currentFeatureCenter","bbox","feature","fitBounds","useZoomToPoint","options","callback","once","flyTo","useServerNotificationsContext","NO_CONTENT_VALUE","DateFormat","stringDateParsers","parseJSON","parseISO","rawDate","Date","getDate","parser","date","isValid","toDate","parsedDate","formatDate","dateFormat","ClientDefaultFormat","defaultValue","dateValue","format","toString","debounce","delay","timeId","args","window","clearTimeout","setTimeout","isNumeric","number","isNaN","parseFloat","isFinite","isObject","useDebouncedCallback","interval","useMemo","cb","useToggle","initial","setState","toggle","DEBOUNCE_DELAY","useWindowResize","debounceCallback","addEventListener","removeEventListener","Map","zIndex","lowerSiblings","upperSiblings","onError","rest","MapGL","renderWorldCopies","antialias","doubleClickZoom","cursor","onLoad","e","target","on"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAMA,sBAAsB,gBAAGC,MAAM,CAACC,GAAV,iLAA5B;;;;;;;;;;;;;;;;;;ICIMC,aAAb;AAAA;;;;;;AACS,gBAAA,GAAQ;AAAEC,MAAAA,QAAQ,EAAE;AAAZ,KAAR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lC,CAApB;AAEA,WAAO,MAAMA,gBAAgB,IAAInB,MAAM,CAACqB,mBAAP,CAA2B,QAA3B,EAAqCF,gBAArC,CAAjC;AACD,GAJQ,EAIN,CAACA,gBAAD,CAJM,CAAT;AAKD,CAVM;;;ACNP,MAaaG,GAAG,GAAiB;MAAC;AAChCC,IAAAA,MADgC;AAEhCC,IAAAA,aAFgC;AAGhCC,IAAAA,aAHgC;AAKhCC,IAAAA,OALgC;AAMhC1O,IAAAA;AANgC;MAO7B2O;;AAEH,QAAM;AAAE5J,IAAAA,GAAF;AAAOuC,IAAAA;AAAP,MAAqBmC,aAAa,EAAxC;AAEA,SACErJ,4BAAA,CAAC4F,UAAD;eAAqBuI;GAArB,EACGC,aADH,EAEEpO,4BAAA,CAACwO,cAAD,oBACMD;AACJE,IAAAA,iBAAiB;AACjBC,IAAAA,SAAS;AACTC,IAAAA,eAAe,EAAE;AACjBC,IAAAA,MAAM,EAAC;AACPC,IAAAA,MAAM,EAAEC,CAAC;AACPnK,MAAAA,GAAG,CAACoD,OAAJ,GAAc+G,CAAC,CAACC,MAAhB;AAEApK,MAAAA,GAAG,CAACoD,OAAJ,CAAYiH,EAAZ,CAAe,OAAf,EAAwBV,OAAxB;AAEApH,MAAAA,SAAS,CAAC,IAAD,CAAT;AACD;IAZH,EAcGtH,QAdH,CAFF,EAkBGyO,aAlBH,CADF;AAsBD,CAjCM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("lodash"),r=require("@evergis/api"),o=require("@turf/turf"),n=require("react");e(n),require("styled-components"),require("react-map-gl/mapbox"),require("@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css"),require("find-and");var i=require("date-fns"),l=require("wkt"),s=e(require("@mapbox/mapbox-gl-draw")),a=require("@microsoft/signalr");require("mapbox-gl/dist/mapbox-gl.css");const u=e=>Array.isArray(e)&&2===e.length&&"get"===e[0]?[e[1]]:e.reduce((e,t)=>Array.isArray(t)?"get"===t[0]?[...new Set([...e,t[1]])]:[...new Set([...e,...u(t)])]:e,[]),c=e=>{if(e)switch(e.type){case r.GeometryType.Point:return o.point(e.coordinates);case r.GeometryType.Multipoint:return o.multiPoint(e.coordinates);case r.GeometryType.Polyline:return o.multiLineString(e.coordinates);case r.GeometryType.Polygon:case r.GeometryType.Envelope:return o.polygon(e.coordinates)}};function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}const p=()=>n.useContext(y),f=()=>{const{selectFeatures:e}=p();return n.useMemo(()=>{var t;return null==(t=e.features)||null==(t=t[e.layerName])?void 0:t.find(t=>t.id===e.currentId)},[e])},y=n.createContext({});var m,g,x,F,v,C;!function(e){e.Light="light",e.Dark="dark"}(m||(m={})),function(e){e.Point="select_point",e.Line="select_line",e.Circle="select_circle",e.Rect="select_rect",e.Polygon="select_polygon",e.Zones="zones_selection",e.Coordinates="xy",e.Route="selection_route"}(g||(g={})),function(e){e.Replace="Replace",e.Unite="Unite",e.Crop="Crop",e.Edit="Edit"}(x||(x={})),function(e){e.Walking="Walking",e.Car="Car"}(F||(F={})),function(e){e.Walking="Walking",e.Car="Car"}(v||(v={})),function(e){e[e.Create=0]="Create",e[e.Edit=1]="Edit",e[e.Transform=2]="Transform",e[e.Expand=3]="Expand",e[e.Unite=4]="Unite",e[e.Subtract=5]="Subtract"}(C||(C={}));const h=()=>{const{geometryEditor:e,setGeometryEditor:t}=p();return[e,n.useCallback(e=>{t(t=>d({},t,e))},[t])]},b=()=>{const{geometrySelection:e,setGeometrySelection:t}=p();return[e,n.useCallback(e=>{t(t=>d({},t,e))},[t])]},S="—";var k;(k=exports.DateFormat||(exports.DateFormat={})).ClientDefaultFormat="dd.MM.yyyy HH:mm",k.DateTime="dd.MM.yyyy HH:mm:ss",k.UTC="yyyy-MM-dd'T'HH:mm:ss.sssxxx",k.AxisTooltip="d MMMM yyyy";const w=[i.parseJSON,i.parseISO,e=>new Date(e)],E=e=>{if(!e)return null;if("string"==typeof e){for(const t of w){const r=t(e);if(i.isValid(r))return i.toDate(r)}return null}const t=i.toDate(e);return i.isValid(t)?t:null},N=function(e){return void 0===e&&(e=[]),0===e.length?"":l.stringify(e[0])},P=s.modes;P.static={onSetup:function(){return this.setActionableState(void 0),{}},toDisplayFeatures:function(e,t,r){r(t)}};const M=new s({displayControlsDefault:!1,styles:[{id:"gl-draw-point",type:"circle",filter:["all",["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#D20C0C","circle-stroke-color":"#FFFFFF","circle-stroke-width":3,"circle-stroke-opacity":.3}},{id:"highlight-inactive-points",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"],["==","active","false"]],paint:{"circle-radius":5,"circle-color":"#D20C0C","circle-stroke-color":"#FFFFFF","circle-stroke-width":3,"circle-stroke-opacity":.3}},{id:"highlight-active-points",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"],["==","active","true"]],paint:{"circle-radius":3,"circle-color":"#fbb03b","circle-stroke-color":"#FFFFFF","circle-stroke-width":1,"circle-stroke-opacity":.3}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":"#D20C0C","fill-outline-color":"#D20C0C","fill-opacity":.1}},{id:"gl-draw-line",type:"line",filter:["all",["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#D20C0C","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":"#D20C0C","fill-outline-color":"#D20C0C","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b","circle-stroke-color":"#FFFFFF","circle-stroke-width":1,"circle-stroke-opacity":.3}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#D20C0C","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-active",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"]],paint:{"circle-radius":3,"circle-color":"#D20C0C","circle-stroke-color":"#FFFFFF","circle-stroke-width":3,"circle-stroke-opacity":.3}}],modes:P,defaultMode:"draw_point",controls:{trash:!0}}),T=n.createContext({});var D,R;(D=exports.VerticalPosition||(exports.VerticalPosition={})).Top="top",D.Bottom="bottom",(R=exports.HorizontalPosition||(exports.HorizontalPosition={})).Left="left",R.Right="right",exports.NO_CONTENT_VALUE=S,exports.convertSpToTurfFeature=c,exports.drawModeToGeometrySelectionType=e=>{switch(e){case"draw_point":return g.Point;case"draw_polygon":return g.Polygon;case"draw_line_string":return g.Line;default:return g.Point}},exports.findAttributeInExpression=u,exports.formatDate=function(e,t){let{dateFormat:r=exports.DateFormat.ClientDefaultFormat,defaultValue:o=S}=void 0===t?{}:t;const n=e?E(e):null;return i.isValid(n)?i.format(n,r):o.toString()},exports.geometryToWkt=N,exports.getActualExtrusionHeight=e=>Array.isArray(null==e?void 0:e["fill-extrusion-height"])&&"+"===(null==e?void 0:e["fill-extrusion-height"][0])?null==e?void 0:e["fill-extrusion-height"][1]:null==e?void 0:e["fill-extrusion-height"],exports.getDate=E,exports.getGeometrySelectionTurfFeature=(e,t,r)=>{if(r)switch(t){case g.Point:return o.toWgs84(o.point(e));case g.Polygon:return o.toWgs84(o.polygon(e));case g.Line:return o.toWgs84(o.lineString(e))}switch(t){case g.Point:return o.toMercator(o.point(e));case g.Polygon:return o.toMercator(o.polygon(e));case g.Line:return o.toMercator(o.lineString(e))}},exports.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),exports.isObject=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},exports.parseClientStyle=e=>{var r;return e?null==e||null==(r=e.items)?void 0:r.reduce((e,r)=>{var o;return!r.paint||t.isEmpty(r.paint)?e:null==(o=Object.entries(r.paint))?void 0:o.reduce((e,t)=>{let[,r]=t;return Array.isArray(r)?[...new Set([...e,...u(r)])]:e},[])},[]):[]},exports.useCurrentSelectedFeature=f,exports.useEditingFeature=()=>{const[{layerName:e,active:t,mode:r}]=h(),o=f();return n.useMemo(()=>t&&(r===C.Edit&&e===(null==o?void 0:o.layer)||r===C.Create),[t,o,e,r])},exports.useEwktGeometry=()=>{const[{history:e,type:r}]=b();return n.useMemo(()=>{var o,n;return-1===e.step?"":r===g.Zones?t.isEmpty(null==(o=e.zones[e.step])?void 0:o[0])?"SRID=3857;"+N(e.features[e.step]):"SRID=3857;"+N(null==(n=e.zones[e.step])?void 0:n[0]):"SRID=3857;"+N(e.features[e.step])},[e.features,e.step,e.zones,r])},exports.useGeometryEditor=h,exports.useGeometrySelection=b,exports.useGeometrySelectionBuffer=()=>{const[{settings:{bufferRadius:e,bufferMultiplier:t},isBuffer:r}]=b();return n.useMemo(()=>{if(r&&e)return Number((+e||0)*+t).toFixed(2)},[r,e,t])},exports.useMapContext=p,exports.useMapDraw=function(e){void 0===e&&(e=[]);const{map:t,draw:r,loaded:o,basemapName:i}=p();n.useEffect(()=>{o&&t.current&&(r.current=M,t.current.addControl(r.current))},[o]),n.useEffect(()=>{t.current&&t.current.hasControl(r.current)&&(t.current.removeControl(r.current),t.current.addControl(r.current))},[i,...e])},exports.useRedrawLayer=()=>{const{map:e}=p();return n.useCallback(t=>{const r=e.current.getSource(t);r.setTiles(r.tiles)},[e])},exports.useResizer=e=>{let{handleVerticalPosition:r,handleHorizontalPosition:o,minWidth:i=Number.MIN_SAFE_INTEGER,maxWidth:l=Number.MAX_SAFE_INTEGER,horizontal:s=!0,minHeight:a=Number.MIN_SAFE_INTEGER,maxHeight:u=Number.MAX_SAFE_INTEGER,vertical:c=!0,useResize:d=!1,onResize:p,onResizeEnd:f,onResizeStart:y}=e;const m=n.useRef(),g=n.useRef(),x=n.useRef(),F=n.useCallback((e,r)=>{var o,n;let d=e,f=r;s&&d<i&&(d=i),s&&d>Math.min(window.innerWidth-(null==(o=x.current)?void 0:o.clientWidth),l)&&(d=l),c&&f<a&&(f=a),c&&f>Math.min(window.innerHeight-(null==(n=g.current)?void 0:n.clientHeight),u)&&(f=u),s&&requestAnimationFrame(()=>{t.isNil(m.current)||(m.current.style.width=d+"px")}),c&&requestAnimationFrame(()=>{t.isNil(m.current)||(m.current.style.height=f+"px")}),null==p||p(d,f)},[i,l,a,u,s,c]),v=n.useCallback(e=>{var t,n,i;const{x:l,y:s}=null==(t=m.current)?void 0:t.getBoundingClientRect(),a=o===exports.HorizontalPosition.Right,u=r===exports.VerticalPosition.Bottom,c=a?e.pageX-l:(null==(n=m.current)?void 0:n.offsetWidth)+l-e.pageX,d=u?e.pageY-s:(null==(i=m.current)?void 0:i.offsetHeight)+s-e.pageY;document.body.style.userSelect="none",F(c,d)},[F]),C=n.useCallback(()=>{t.isNil(m.current)||null==y||y(m.current.offsetWidth,m.current.offsetHeight),document.body.addEventListener("pointermove",v),document.body.addEventListener("pointerup",()=>{document.body.style.userSelect="initial",document.body.removeEventListener("pointermove",v),t.isNil(m.current)||null==f||f(m.current.offsetWidth,m.current.offsetHeight)},{once:!0})},[v]);return n.useLayoutEffect(()=>{d&&!t.isNil(m.current)&&F(m.current.offsetWidth,m.current.offsetHeight)},[F,d]),{containerRef:m,verticalHandleRef:g,horizontalHandleRef:x,onPointerDown:C}},exports.useSelectFeaturesCount=()=>{const{selectFeatures:e}=p();return n.useMemo(()=>{var t,r;return null!=(t=null==(r=e.features)||null==(r=r[e.layerName])?void 0:r.length)?t:0},[e])},exports.useSelectFeaturesCurrentIndex=()=>{const{selectFeatures:e}=p();return n.useMemo(()=>{var t,r;return null!=(t=e.features)&&null!=(t=t[e.layerName])&&t.length?null==(r=e.features)||null==(r=r[e.layerName])?void 0:r.findIndex(t=>t.id===e.currentId):-1},[e])},exports.useSelectFeaturesGeometryMasking=()=>{const{selectFeatures:e,setSelectFeaturesGeometryMasking:t}=p(),r=n.useCallback(e=>{t(e)},[t]);return[e.geometryMasking,r]},exports.useSelectFeaturesInitialized=()=>{const{selectFeatures:e,setSelectFeaturesInitialized:t}=p(),r=n.useCallback(e=>{t(e)},[t]);return[e.initialized,r]},exports.useSelectFeaturesLayerName=()=>{const{selectFeatures:e,setSelectFeaturesLayerName:t}=p(),r=n.useCallback(e=>{t(e)},[t]);return[e.layerName,r]},exports.useSelectFeaturesPagination=()=>{const{setNextFeature:e,setPrevFeature:t}=p();return{onNext:n.useCallback(()=>{e()},[e]),onPrev:n.useCallback(()=>{t()},[t])}},exports.useSelectFeaturesStatisticsActive=()=>{const{selectFeatures:e,setSelectFeaturesStatisticsActive:t}=p(),r=n.useCallback(e=>{t(e)},[t]);return[e.statisticsActive,r]},exports.useSelectFeaturesTotalCounts=()=>{var e;const{selectFeatures:t,setSelectedFeaturesTotalCounts:r}=p(),o=n.useCallback(e=>{r(e)},[r]);return[null!=(e=t.totalCounts)?e:{},o]},exports.useSelectedFeatures=()=>{var e;const{selectFeatures:t,setSelectedFeatures:r}=p(),o=n.useCallback(e=>{r(e)},[r]);return[null!=(e=t.features)?e:{},o]},exports.useServerNotifications=(e,t)=>{const r=n.useRef(null),[o,i]=n.useState(null);return n.useEffect(()=>{t&&(r.current=(new a.HubConnectionBuilder).withUrl(e,{withCredentials:!0}).configureLogging(a.LogLevel.Information).build(),r.current.start().then(()=>console.info("Серверные нотификации подключены")).catch(e=>console.info("Ошибка:",e)).finally(()=>i(r.current)))},[t]),n.useEffect(()=>{o&&"Connected"===o.state&&o.invoke("SubscribeNotifications",[]).then(()=>console.info("Подписка `SubscribeNotifications` оформлена")).catch(e=>console.info("Ошибка подписки `SubscribeNotifications`:",e))},[o]),o},exports.useServerNotificationsContext=()=>n.useContext(T),exports.useToggle=e=>{const[t,r]=n.useState(void 0!==e&&e),o=n.useCallback(()=>r(!t),[t]);return[t,o,r]},exports.useUpdateCurrentFeature=()=>{const{updateCurrentFeature:e}=p();return n.useCallback(t=>{e(t)},[e])},exports.useZoomToFeatures=()=>{const{map:e}=p();return n.useCallback((t,r)=>{if(!t)return;const n=o.bbox({type:"FeatureCollection",features:t.map(e=>c(e.geometry))});e.current.fitBounds(n,{padding:null!=r?r:150})},[e])},exports.useZoomToLayer=()=>{const{map:e}=p();return n.useCallback(async(t,r)=>{var o;t&&t.overall&&e.current.fitBounds([...t.overall.coordinates[0],...t.overall.coordinates[1]],{padding:null!=(o=null==r?void 0:r.padding)?o:50})},[e])},exports.useZoomToPoint=()=>{const{map:e}=p();return n.useCallback((t,r)=>{e.current?(r&&e.current.once("moveend",()=>{r()}),e.current.flyTo(t)):null==r||r()},[e])};
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),r=e(t),n=e(require("styled-components")),o=require("react-map-gl/mapbox"),l=e(o),i=require("@evergis/api"),a=require("lodash"),u=require("@turf/turf");require("@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css");var s,c=e(require("@mapbox/mapbox-gl-draw")),p=require("@microsoft/signalr"),y=require("date-fns");function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e,t){return t||(t=e.slice(0)),e.raw=t,e}require("mapbox-gl/dist/mapbox-gl.css");const g=n.div(s||(s=x(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n"])));function h(e,t,r){return t=b(t),n=e,!(o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){return!1}}()?Reflect.construct(t,r||[],b(e).constructor):t.apply(e,r))||"object"!=typeof o&&"function"!=typeof o?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n):o;var n,o}let w=function(e){function n(){var e;return f(this,n),(e=h(this,n,arguments)).state={hasError:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(n,t.Component),o=n,i=[{key:"getDerivedStateFromError",value:function(){return{hasError:!0}}}],(l=[{key:"componentDidCatch",value:function(e){console.error(e)}},{key:"render",value:function(){const{children:e,errorContents:t}=this.props,{hasError:n}=this.state;return n?r.createElement(g,null,t):r.createElement(r.Fragment,null,e)}}])&&d(o.prototype,l),i&&d(o,i),o;var o,l,i}();const C={"circle-radius":4,"circle-color":"#00ffff","circle-opacity":.5,"circle-stroke-width":0,"circle-stroke-color":"#00ffff","circle-stroke-opacity":.5},F={"fill-color":"#00ffff","fill-opacity":.5},k={"fill-extrusion-base":0,"fill-extrusion-vertical-gradient":!0,"fill-extrusion-color":"#00ffff","fill-extrusion-opacity":.5,"fill-extrusion-height":0},E={"line-color":"#00ffff","line-width":1,"line-opacity":.5},T=e=>{let{layer:t,tileUrl:n,visible:l,beforeId:i}=e;return t?r.createElement(o.Source,{id:t.name,type:"raster",tiles:[n]},r.createElement(o.Layer,{id:t.name,type:"raster","source-layer":"default",beforeId:i,layout:{visibility:l?"visible":"none"}})):null},S=e=>Array.isArray(e)&&2===e.length&&"get"===e[0]?[e[1]]:e.reduce((e,t)=>Array.isArray(t)?"get"===t[0]?[...new Set([...e,t[1]])]:[...new Set([...e,...S(t)])]:e,[]),P=e=>Array.isArray(null==e?void 0:e["fill-extrusion-height"])&&"+"===(null==e?void 0:e["fill-extrusion-height"][0])?null==e?void 0:e["fill-extrusion-height"][1]:null==e?void 0:e["fill-extrusion-height"],D=e=>{if(e)switch(e.type){case i.GeometryType.Point:return u.point(e.coordinates);case i.GeometryType.Multipoint:return u.multiPoint(e.coordinates);case i.GeometryType.Polyline:return u.multiLineString(e.coordinates);case i.GeometryType.Polygon:case i.GeometryType.Envelope:return u.polygon(e.coordinates)}},L=e=>{var n;let{layer:l,tileUrl:a,visible:u,beforeId:s,getLayerTempStyle:c,onMount:p=(()=>null)}=e;const y=null==l||null==(n=l.configuration)?void 0:n.clientStyle,{idAttribute:f,geometryType:d}=l.layerDefinition||{},b=t.useCallback(()=>{var e,t,n,a,p,y,f,b,v,x,g,h,w,T;const S=u?"visible":"none";switch(d){case i.GeometryType.Point:return r.createElement(o.Layer,{id:l.name,type:"circle","source-layer":"default",beforeId:s,layout:m({},null==c||null==(e=c(l.name,"circle"))?void 0:e.layout,{visibility:S}),paint:m({},C,null==c||null==(t=c(l.name,"circle"))?void 0:t.paint)});case i.GeometryType.Polygon:return[r.createElement(o.Layer,{key:"polygon-layer-"+l.name,id:l.name,type:"fill","source-layer":"default",beforeId:s,layout:m({},null==c||null==(n=c(l.name,"fill"))?void 0:n.layout,{visibility:u&&!1!==(null==c||null==(a=c(l.name,"fill-extrusion"))||null==(a=a.settings)||null==(a=a.fill)?void 0:a.showBottomSurface)&&Boolean(P(m({},k,null==c||null==(p=c(l.name,"fill-extrusion"))?void 0:p.paint)))?"visible":"none"}),paint:m({},F,null==c||null==(y=c(l.name,"fill"))?void 0:y.paint)}),r.createElement(o.Layer,{key:"polygon-stroke-layer-"+l.name,id:l.name+"-stroke",type:"line","source-layer":"default",beforeId:s,layout:m({},null==c||null==(f=c(l.name,"line"))?void 0:f.layout,{visibility:u&&!1!==(null==c||null==(b=c(l.name,"fill-extrusion"))||null==(b=b.settings)||null==(b=b.fill)?void 0:b.showBottomSurface)&&Boolean(P(m({},k,null==c||null==(v=c(l.name,"fill-extrusion"))?void 0:v.paint)))?"visible":"none"}),paint:m({},E,null==c||null==(x=c(l.name,"line"))?void 0:x.paint)}),r.createElement(o.Layer,{key:"polygon-extrusion-layer-"+l.name,id:l.name+"-extrusion",type:"fill-extrusion","source-layer":"default",beforeId:s,minzoom:0,maxzoom:23,layout:m({},null==c||null==(g=c(l.name,"fill-extrusion"))?void 0:g.layout,{visibility:S}),paint:m({},k,null==c||null==(h=c(l.name,"fill-extrusion"))?void 0:h.paint)})];case i.GeometryType.Polyline:return r.createElement(o.Layer,{id:l.name,type:"line","source-layer":"default",beforeId:s,layout:m({},null==c||null==(w=c(l.name,"line"))?void 0:w.layout,{visibility:S}),paint:m({},E,null==c||null==(T=c(l.name,"line"))?void 0:T.paint)});default:return null}},[d,l,s,c,u]),v=t.useCallback(()=>y.items.map(e=>{var t,n,a,p,f,b,v,x,g;const h=((e,t)=>{switch(e){case i.GeometryType.Point:return["point-layer-",""];case i.GeometryType.Polyline:return["polyline-layer-",""];case i.GeometryType.Polygon:switch(t){case"line":return["polygon-stroke-layer-","-stroke"];case"fill-extrusion":return["polygon-extrusion-layer-","-extrusion"];default:return["polygon-layer-",""]}default:return["",""]}})(d,e.type),w="fill-extrusion"===e.type,C=y.items.some(e=>"fill-extrusion"===e.type)&&("fill"===e.type||"line"===e.type),F=C||w?m({},null==(t=y.items)||null==(t=t.find(e=>"fill-extrusion"===e.type))?void 0:t.paint,null==c||null==(n=c(l.name,"fill-extrusion"))?void 0:n.paint):void 0,k=m({},null==y?void 0:y.settings,null==c||null==(a=c(l.name,e.type))?void 0:a.settings),E=P(F),T=Boolean(E),S=u&&(w&&T||!C&&!w||C&&(!T||null==(p=null==k||null==(f=k.fill)?void 0:f.showBottomSurface)||p))?"visible":"none";return r.createElement(o.Layer,{key:""+h[0]+l.name,id:""+l.name+h[1],type:e.type,"source-layer":"default",beforeId:s,minzoom:null!=(b=null==y?void 0:y.minzoom)?b:0,maxzoom:null!=(v=null==y?void 0:y.maxzoom)?v:23,layout:m({},e.layout,null==c||null==(x=c(l.name,e.type))?void 0:x.layout,{visibility:S}),paint:m({},e.paint,null==c||null==(g=c(l.name,e.type))?void 0:g.paint)})}),[s,y,d,l.name,u,c]);return t.useEffect(p,[l.name]),l?r.createElement(o.Source,{promoteId:f,id:l.name,type:"vector",tiles:[a]},null!=y&&y.items?v():b()):null};var I;const A=n.div(I||(I=x(["\n position: relative;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n z-index: ",";\n\n .mapbox-gl-draw_trash {\n display: none;\n }\n\n .mapboxgl-ctrl-logo {\n display: none;\n }\n\n .mapboxgl-ctrl.mapboxgl-ctrl-attrib {\n display: none;\n }\n\n .mapboxgl-ctrl-geocoder.mapboxgl-ctrl {\n width: 350px;\n }\n"])),e=>{let{$zIndex:t}=e;return null!=t?t:1}),M=c.modes;M.static={onSetup:function(){return this.setActionableState(void 0),{}},toDisplayFeatures:function(e,t,r){r(t)}};const O=t.createContext({});var _;(_=exports.BaseMapTheme||(exports.BaseMapTheme={})).Light="light",_.Dark="dark";const N=t.createContext({}),j=()=>t.useContext(O),B=new c({displayControlsDefault:!1,styles:[{id:"gl-draw-point",type:"circle",filter:["all",["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#D20C0C","circle-stroke-color":"#FFFFFF","circle-stroke-width":3,"circle-stroke-opacity":.3}},{id:"highlight-inactive-points",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"],["==","active","false"]],paint:{"circle-radius":5,"circle-color":"#D20C0C","circle-stroke-color":"#FFFFFF","circle-stroke-width":3,"circle-stroke-opacity":.3}},{id:"highlight-active-points",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"],["==","active","true"]],paint:{"circle-radius":3,"circle-color":"#fbb03b","circle-stroke-color":"#FFFFFF","circle-stroke-width":1,"circle-stroke-opacity":.3}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":"#D20C0C","fill-outline-color":"#D20C0C","fill-opacity":.1}},{id:"gl-draw-line",type:"line",filter:["all",["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#D20C0C","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":"#D20C0C","fill-outline-color":"#D20C0C","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b","circle-stroke-color":"#FFFFFF","circle-stroke-width":1,"circle-stroke-opacity":.3}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#D20C0C","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-active",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"]],paint:{"circle-radius":3,"circle-color":"#D20C0C","circle-stroke-color":"#FFFFFF","circle-stroke-width":3,"circle-stroke-opacity":.3}}],modes:M,defaultMode:"draw_point",controls:{trash:!0}}),z="—";var R;(R=exports.DateFormat||(exports.DateFormat={})).ClientDefaultFormat="dd.MM.yyyy HH:mm",R.DateTime="dd.MM.yyyy HH:mm:ss",R.UTC="yyyy-MM-dd'T'HH:mm:ss.sssxxx",R.AxisTooltip="d MMMM yyyy";const U=[y.parseJSON,y.parseISO,e=>new Date(e)],q=e=>{if(!e)return null;if("string"==typeof e){for(const t of U){const r=t(e);if(y.isValid(r))return y.toDate(r)}return null}const t=y.toDate(e);return y.isValid(t)?t:null},G=(e,t)=>{let r;return function(){for(var n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];r&&window.clearTimeout(r),r=window.setTimeout(()=>{e(...o)},t)}},$=["zIndex","lowerSiblings","upperSiblings","drawTriggerDeps","onError","children"];exports.DEFAULT_CIRCLE_PAINT=C,exports.DEFAULT_FILL_EXTRUSION_PAINT=k,exports.DEFAULT_FILL_PAINT=F,exports.DEFAULT_LINE_PAINT=E,exports.ErrorBoundary=w,exports.Layer=e=>{let{layer:n,layerType:o,visible:l,beforeId:i,tileUrl:a,onMount:u=(()=>null)}=e;return t.useEffect(u,[n.name]),n?r.createElement("RasterTileLayer"===o?T:L,{layer:n,tileUrl:a,visible:l,beforeId:i,onMount:u}):null},exports.Map=e=>{let{zIndex:t,lowerSiblings:n,upperSiblings:o,onError:i,children:a}=e,u=function(e,t){if(null==e)return{};var r,n,o={},l=Object.keys(e);for(n=0;n<l.length;n++)t.indexOf(r=l[n])>=0||(o[r]=e[r]);return o}(e,$);const{map:s,setLoaded:c}=j();return r.createElement(A,{$zIndex:t},n,r.createElement(l,Object.assign({},u,{renderWorldCopies:!0,antialias:!0,doubleClickZoom:!1,cursor:"default",onLoad:e=>{s.current=e.target,s.current.on("error",i),c(!0)}}),a),o)},exports.MapContext=O,exports.MapProvider=e=>{let{basemapItems:n,defaultBasemap:o,children:l}=e;const i=t.useRef(),a=t.useRef(),[u,s]=t.useState(!1),[c,p]=t.useState(o);return r.createElement(O.Provider,{value:{map:i,draw:a,loaded:u,setLoaded:s,basemapItems:n,basemapName:c,setBasemapName:p,defaultBasemap:o}},l)},exports.NO_CONTENT_VALUE=z,exports.ServerNotificationsContext=N,exports.ServerNotificationsProvider=e=>{let{url:n,initialized:o,children:l}=e;const i=((e,r)=>{const n=t.useRef(null),[o,l]=t.useState(null);return t.useEffect(()=>{r&&(n.current=(new p.HubConnectionBuilder).withUrl(e,{withCredentials:!0}).configureLogging(p.LogLevel.Information).build(),n.current.start().then(()=>console.info("Серверные нотификации подключены")).catch(e=>console.info("Ошибка:",e)).finally(()=>l(n.current)))},[r]),t.useEffect(()=>{o&&"Connected"===o.state&&o.invoke("SubscribeNotifications",[]).then(()=>console.info("Подписка `SubscribeNotifications` оформлена")).catch(e=>console.info("Ошибка подписки `SubscribeNotifications`:",e))},[o]),o})(n,o),a=t.useCallback(async e=>{if(i&&"Connected"===i.state&&e)try{const t=await i.invoke("AddSubscription",e);return console.info("Подписка добавлена, id:",t),t}catch(e){return console.info("Ошибка добавления подписки:",e),Promise.resolve(null)}},[i]),u=t.useCallback(async(e,t)=>{if(i&&"Connected"===i.state&&e&&t)try{await i.invoke("UpdateSubscription",e,t)}catch(t){console.info("Ошибка обновления подписки "+e+":",t)}},[i]),s=t.useCallback(async e=>{if(i&&"Connected"===i.state&&e)try{await i.invoke("Unsubscribe",[e])}catch(t){console.info("Ошибка отписки по "+e+":",t)}},[i]);return r.createElement(N.Provider,{value:{connection:i,addSubscription:a,updateSubscription:u,unsubscribeById:s}},l)},exports.convertSpToTurfFeature=D,exports.debounce=G,exports.findAttributeInExpression=S,exports.formatDate=function(e,t){let{dateFormat:r=exports.DateFormat.ClientDefaultFormat,defaultValue:n=z}=void 0===t?{}:t;const o=e?q(e):null;return y.isValid(o)?y.format(o,r):n.toString()},exports.getActualExtrusionHeight=P,exports.getDate=q,exports.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),exports.isObject=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},exports.parseClientStyle=e=>{var t;return e?null==e||null==(t=e.items)?void 0:t.reduce((e,t)=>{var r;return!t.paint||a.isEmpty(t.paint)?e:null==(r=Object.entries(t.paint))?void 0:r.reduce((e,t)=>{let[,r]=t;return Array.isArray(r)?[...new Set([...e,...S(r)])]:e},[])},[]):[]},exports.useDebouncedCallback=e=>t.useMemo(()=>G(e=>{e()},e),[e]),exports.useMapContext=j,exports.useMapDraw=function(e){void 0===e&&(e=[]);const{map:r,draw:n,loaded:o,basemapName:l}=j();t.useEffect(()=>{o&&r.current&&(n.current=B,r.current.addControl(n.current))},[o]),t.useEffect(()=>{r.current&&r.current.hasControl(n.current)&&(r.current.removeControl(n.current),r.current.addControl(n.current))},[l,...e])},exports.useRedrawLayer=()=>{const{map:e}=j();return t.useCallback(t=>{const r=e.current.getSource(t);r.setTiles(r.tiles)},[e])},exports.useServerNotificationsContext=()=>t.useContext(N),exports.useToggle=e=>{const[r,n]=t.useState(void 0!==e&&e),o=t.useCallback(()=>n(!r),[r]);return[r,o,n]},exports.useWindowResize=(e,r)=>{const n=t.useMemo(()=>e?G(e,r||144):void 0,[e,r]);t.useEffect(()=>(n&&window.addEventListener("resize",n),()=>n&&window.removeEventListener("resize",n)),[n])},exports.useZoomToFeatures=()=>{const{map:e}=j();return t.useCallback((t,r)=>{if(!t)return;const n=u.bbox({type:"FeatureCollection",features:t.map(e=>D(e.geometry))});e.current.fitBounds(n,{padding:null!=r?r:150})},[e])},exports.useZoomToPoint=()=>{const{map:e}=j();return t.useCallback((t,r)=>{e.current?(r&&e.current.once("moveend",()=>{r()}),e.current.flyTo(t)):null==r||r()},[e])};
|
|
2
2
|
//# sourceMappingURL=react.cjs.production.min.js.map
|