@maplibre/maplibre-react-native 11.0.0-beta.25 → 11.0.0-beta.26
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/ios/modules/offline/MLRNOfflineModule.h +1 -2
- package/ios/modules/offline/MLRNOfflineModule.mm +9 -9
- package/lib/commonjs/components/annotations/callout/Callout.js +2 -1
- package/lib/commonjs/components/annotations/callout/Callout.js.map +1 -1
- package/lib/commonjs/components/annotations/marker/Marker.js +4 -2
- package/lib/commonjs/components/annotations/marker/Marker.js.map +1 -1
- package/lib/commonjs/components/annotations/view-annotation/ViewAnnotation.js +6 -5
- package/lib/commonjs/components/annotations/view-annotation/ViewAnnotation.js.map +1 -1
- package/lib/commonjs/components/camera/Camera.js.map +1 -1
- package/lib/commonjs/components/images/Images.js +2 -2
- package/lib/commonjs/components/layer/Layer.js +0 -1
- package/lib/commonjs/components/layer/Layer.js.map +1 -1
- package/lib/commonjs/components/map/Map.js.map +1 -1
- package/lib/commonjs/components/sources/geojson-source/GeoJSONSource.js +2 -2
- package/lib/commonjs/components/sources/geojson-source/GeoJSONSource.js.map +1 -1
- package/lib/commonjs/components/sources/image-source/ImageSource.js +3 -2
- package/lib/commonjs/components/sources/image-source/ImageSource.js.map +1 -1
- package/lib/commonjs/components/sources/raster-source/RasterSource.js +4 -3
- package/lib/commonjs/components/sources/raster-source/RasterSource.js.map +1 -1
- package/lib/commonjs/components/sources/vector-source/VectorSource.js +4 -2
- package/lib/commonjs/components/sources/vector-source/VectorSource.js.map +1 -1
- package/lib/commonjs/components/user-location/NativeUserLocation.js.map +1 -1
- package/lib/commonjs/components/user-location/UserLocation.js.map +1 -1
- package/lib/commonjs/modules/log/LogManager.js +5 -4
- package/lib/commonjs/modules/log/LogManager.js.map +1 -1
- package/lib/commonjs/modules/network/NetworkManager.js +7 -7
- package/lib/commonjs/modules/network/NetworkManager.js.map +1 -1
- package/lib/commonjs/modules/offline/OfflineManager.js +63 -47
- package/lib/commonjs/modules/offline/OfflineManager.js.map +1 -1
- package/lib/commonjs/modules/transform-request/TransformRequestManager.js +50 -45
- package/lib/commonjs/modules/transform-request/TransformRequestManager.js.map +1 -1
- package/lib/commonjs/plugin/ios.js +9 -8
- package/lib/commonjs/plugin/ios.js.map +1 -1
- package/lib/commonjs/types/Anchor.js +5 -6
- package/lib/commonjs/types/Anchor.js.map +1 -1
- package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js +2 -2
- package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js +6 -6
- package/lib/commonjs/utils/animated/AnimatedGeoJSON.js +2 -1
- package/lib/commonjs/utils/animated/AnimatedGeoJSON.js.map +1 -1
- package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js +6 -6
- package/lib/commonjs/utils/convertStyleSpec.js +4 -4
- package/lib/module/components/annotations/callout/Callout.js +2 -1
- package/lib/module/components/annotations/callout/Callout.js.map +1 -1
- package/lib/module/components/annotations/marker/Marker.js +4 -2
- package/lib/module/components/annotations/marker/Marker.js.map +1 -1
- package/lib/module/components/annotations/view-annotation/ViewAnnotation.js +6 -5
- package/lib/module/components/annotations/view-annotation/ViewAnnotation.js.map +1 -1
- package/lib/module/components/camera/Camera.js.map +1 -1
- package/lib/module/components/images/Images.js +2 -2
- package/lib/module/components/layer/Layer.js +0 -1
- package/lib/module/components/layer/Layer.js.map +1 -1
- package/lib/module/components/map/Map.js.map +1 -1
- package/lib/module/components/sources/geojson-source/GeoJSONSource.js +2 -2
- package/lib/module/components/sources/geojson-source/GeoJSONSource.js.map +1 -1
- package/lib/module/components/sources/image-source/ImageSource.js +3 -2
- package/lib/module/components/sources/image-source/ImageSource.js.map +1 -1
- package/lib/module/components/sources/raster-source/RasterSource.js +4 -3
- package/lib/module/components/sources/raster-source/RasterSource.js.map +1 -1
- package/lib/module/components/sources/vector-source/VectorSource.js +4 -2
- package/lib/module/components/sources/vector-source/VectorSource.js.map +1 -1
- package/lib/module/components/user-location/NativeUserLocation.js.map +1 -1
- package/lib/module/components/user-location/UserLocation.js.map +1 -1
- package/lib/module/modules/log/LogManager.js +5 -4
- package/lib/module/modules/log/LogManager.js.map +1 -1
- package/lib/module/modules/network/NetworkManager.js +7 -7
- package/lib/module/modules/network/NetworkManager.js.map +1 -1
- package/lib/module/modules/offline/OfflineManager.js +63 -47
- package/lib/module/modules/offline/OfflineManager.js.map +1 -1
- package/lib/module/modules/transform-request/TransformRequestManager.js +50 -45
- package/lib/module/modules/transform-request/TransformRequestManager.js.map +1 -1
- package/lib/module/plugin/ios.js +9 -8
- package/lib/module/plugin/ios.js.map +1 -1
- package/lib/module/types/Anchor.js +5 -6
- package/lib/module/types/Anchor.js.map +1 -1
- package/lib/module/utils/animated/AbstractAnimatedCoordinates.js +2 -2
- package/lib/module/utils/animated/AnimatedCoordinatesArray.js +6 -6
- package/lib/module/utils/animated/AnimatedGeoJSON.js +2 -1
- package/lib/module/utils/animated/AnimatedGeoJSON.js.map +1 -1
- package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js +6 -6
- package/lib/module/utils/convertStyleSpec.js +4 -4
- package/lib/typescript/commonjs/components/annotations/callout/Callout.d.ts +3 -2
- package/lib/typescript/commonjs/components/annotations/callout/Callout.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/annotations/marker/Marker.d.ts +15 -14
- package/lib/typescript/commonjs/components/annotations/marker/Marker.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/annotations/view-annotation/ViewAnnotation.d.ts +26 -24
- package/lib/typescript/commonjs/components/annotations/view-annotation/ViewAnnotation.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/camera/Camera.d.ts +10 -24
- package/lib/typescript/commonjs/components/camera/Camera.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/images/Images.d.ts +12 -12
- package/lib/typescript/commonjs/components/layer/Layer.d.ts +0 -1
- package/lib/typescript/commonjs/components/layer/Layer.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/map/Map.d.ts +54 -51
- package/lib/typescript/commonjs/components/map/Map.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/sources/geojson-source/GeoJSONSource.d.ts +40 -41
- package/lib/typescript/commonjs/components/sources/geojson-source/GeoJSONSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/sources/image-source/ImageSource.d.ts +5 -3
- package/lib/typescript/commonjs/components/sources/image-source/ImageSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/sources/raster-source/RasterSource.d.ts +20 -15
- package/lib/typescript/commonjs/components/sources/raster-source/RasterSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/sources/vector-source/VectorSource.d.ts +23 -20
- package/lib/typescript/commonjs/components/sources/vector-source/VectorSource.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/user-location/NativeUserLocation.d.ts +9 -6
- package/lib/typescript/commonjs/components/user-location/NativeUserLocation.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/user-location/UserLocation.d.ts +4 -2
- package/lib/typescript/commonjs/components/user-location/UserLocation.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/useCurrentPosition.d.ts +2 -2
- package/lib/typescript/commonjs/modules/log/LogManager.d.ts +5 -4
- package/lib/typescript/commonjs/modules/log/LogManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/modules/network/NetworkManager.d.ts +7 -7
- package/lib/typescript/commonjs/modules/network/NetworkManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/modules/offline/OfflineManager.d.ts +63 -47
- package/lib/typescript/commonjs/modules/offline/OfflineManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/modules/static-map/StaticMapManager.d.ts +2 -2
- package/lib/typescript/commonjs/modules/transform-request/TransformRequestManager.d.ts +56 -49
- package/lib/typescript/commonjs/modules/transform-request/TransformRequestManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/plugin/MapLibrePluginProps.d.ts +10 -15
- package/lib/typescript/commonjs/plugin/MapLibrePluginProps.d.ts.map +1 -1
- package/lib/typescript/commonjs/plugin/ios.d.ts +2 -2
- package/lib/typescript/commonjs/plugin/ios.d.ts.map +1 -1
- package/lib/typescript/commonjs/types/Anchor.d.ts +5 -6
- package/lib/typescript/commonjs/types/Anchor.d.ts.map +1 -1
- package/lib/typescript/commonjs/types/LngLatBounds.d.ts +2 -1
- package/lib/typescript/commonjs/types/LngLatBounds.d.ts.map +1 -1
- package/lib/typescript/commonjs/types/MapLibreRNStyles.d.ts +243 -93
- package/lib/typescript/commonjs/types/MapLibreRNStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/types/sources/PressableSourceProps.d.ts +1 -2
- package/lib/typescript/commonjs/types/sources/PressableSourceProps.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
- package/lib/typescript/commonjs/utils/animated/AnimatedCoordinatesArray.d.ts +6 -6
- package/lib/typescript/commonjs/utils/animated/AnimatedGeoJSON.d.ts +2 -1
- package/lib/typescript/commonjs/utils/animated/AnimatedGeoJSON.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/animated/AnimatedRouteCoordinatesArray.d.ts +6 -6
- package/lib/typescript/commonjs/utils/convertStyleSpec.d.ts +4 -4
- package/lib/typescript/module/components/annotations/callout/Callout.d.ts +3 -2
- package/lib/typescript/module/components/annotations/callout/Callout.d.ts.map +1 -1
- package/lib/typescript/module/components/annotations/marker/Marker.d.ts +15 -14
- package/lib/typescript/module/components/annotations/marker/Marker.d.ts.map +1 -1
- package/lib/typescript/module/components/annotations/view-annotation/ViewAnnotation.d.ts +26 -24
- package/lib/typescript/module/components/annotations/view-annotation/ViewAnnotation.d.ts.map +1 -1
- package/lib/typescript/module/components/camera/Camera.d.ts +10 -24
- package/lib/typescript/module/components/camera/Camera.d.ts.map +1 -1
- package/lib/typescript/module/components/images/Images.d.ts +12 -12
- package/lib/typescript/module/components/layer/Layer.d.ts +0 -1
- package/lib/typescript/module/components/layer/Layer.d.ts.map +1 -1
- package/lib/typescript/module/components/map/Map.d.ts +54 -51
- package/lib/typescript/module/components/map/Map.d.ts.map +1 -1
- package/lib/typescript/module/components/sources/geojson-source/GeoJSONSource.d.ts +40 -41
- package/lib/typescript/module/components/sources/geojson-source/GeoJSONSource.d.ts.map +1 -1
- package/lib/typescript/module/components/sources/image-source/ImageSource.d.ts +5 -3
- package/lib/typescript/module/components/sources/image-source/ImageSource.d.ts.map +1 -1
- package/lib/typescript/module/components/sources/raster-source/RasterSource.d.ts +20 -15
- package/lib/typescript/module/components/sources/raster-source/RasterSource.d.ts.map +1 -1
- package/lib/typescript/module/components/sources/vector-source/VectorSource.d.ts +23 -20
- package/lib/typescript/module/components/sources/vector-source/VectorSource.d.ts.map +1 -1
- package/lib/typescript/module/components/user-location/NativeUserLocation.d.ts +9 -6
- package/lib/typescript/module/components/user-location/NativeUserLocation.d.ts.map +1 -1
- package/lib/typescript/module/components/user-location/UserLocation.d.ts +4 -2
- package/lib/typescript/module/components/user-location/UserLocation.d.ts.map +1 -1
- package/lib/typescript/module/hooks/useCurrentPosition.d.ts +2 -2
- package/lib/typescript/module/modules/log/LogManager.d.ts +5 -4
- package/lib/typescript/module/modules/log/LogManager.d.ts.map +1 -1
- package/lib/typescript/module/modules/network/NetworkManager.d.ts +7 -7
- package/lib/typescript/module/modules/network/NetworkManager.d.ts.map +1 -1
- package/lib/typescript/module/modules/offline/OfflineManager.d.ts +63 -47
- package/lib/typescript/module/modules/offline/OfflineManager.d.ts.map +1 -1
- package/lib/typescript/module/modules/static-map/StaticMapManager.d.ts +2 -2
- package/lib/typescript/module/modules/transform-request/TransformRequestManager.d.ts +56 -49
- package/lib/typescript/module/modules/transform-request/TransformRequestManager.d.ts.map +1 -1
- package/lib/typescript/module/plugin/MapLibrePluginProps.d.ts +10 -15
- package/lib/typescript/module/plugin/MapLibrePluginProps.d.ts.map +1 -1
- package/lib/typescript/module/plugin/ios.d.ts +2 -2
- package/lib/typescript/module/plugin/ios.d.ts.map +1 -1
- package/lib/typescript/module/types/Anchor.d.ts +5 -6
- package/lib/typescript/module/types/Anchor.d.ts.map +1 -1
- package/lib/typescript/module/types/LngLatBounds.d.ts +2 -1
- package/lib/typescript/module/types/LngLatBounds.d.ts.map +1 -1
- package/lib/typescript/module/types/MapLibreRNStyles.d.ts +243 -93
- package/lib/typescript/module/types/MapLibreRNStyles.d.ts.map +1 -1
- package/lib/typescript/module/types/sources/PressableSourceProps.d.ts +1 -2
- package/lib/typescript/module/types/sources/PressableSourceProps.d.ts.map +1 -1
- package/lib/typescript/module/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
- package/lib/typescript/module/utils/animated/AnimatedCoordinatesArray.d.ts +6 -6
- package/lib/typescript/module/utils/animated/AnimatedGeoJSON.d.ts +2 -1
- package/lib/typescript/module/utils/animated/AnimatedGeoJSON.d.ts.map +1 -1
- package/lib/typescript/module/utils/animated/AnimatedRouteCoordinatesArray.d.ts +6 -6
- package/lib/typescript/module/utils/convertStyleSpec.d.ts +4 -4
- package/package.json +1 -2
- package/src/components/annotations/callout/Callout.tsx +3 -2
- package/src/components/annotations/marker/Marker.tsx +15 -14
- package/src/components/annotations/view-annotation/ViewAnnotation.tsx +26 -24
- package/src/components/camera/Camera.tsx +10 -24
- package/src/components/images/Images.tsx +12 -12
- package/src/components/layer/Layer.tsx +0 -1
- package/src/components/map/Map.tsx +54 -51
- package/src/components/sources/geojson-source/GeoJSONSource.tsx +40 -41
- package/src/components/sources/image-source/ImageSource.tsx +5 -3
- package/src/components/sources/raster-source/RasterSource.tsx +20 -15
- package/src/components/sources/vector-source/VectorSource.tsx +23 -20
- package/src/components/user-location/NativeUserLocation.tsx +9 -6
- package/src/components/user-location/UserLocation.tsx +4 -2
- package/src/hooks/useCurrentPosition.ts +2 -2
- package/src/modules/log/LogManager.ts +5 -4
- package/src/modules/network/NetworkManager.ts +7 -7
- package/src/modules/offline/OfflineManager.ts +63 -47
- package/src/modules/static-map/StaticMapManager.ts +2 -2
- package/src/modules/transform-request/TransformRequestManager.ts +56 -49
- package/src/plugin/MapLibrePluginProps.ts +10 -15
- package/src/plugin/ios.ts +9 -8
- package/src/types/Anchor.ts +5 -6
- package/src/types/LngLatBounds.ts +2 -1
- package/src/types/MapLibreRNStyles.ts +243 -93
- package/src/types/sources/PressableSourceProps.ts +1 -2
- package/src/utils/animated/AbstractAnimatedCoordinates.ts +2 -2
- package/src/utils/animated/AnimatedCoordinatesArray.ts +6 -6
- package/src/utils/animated/AnimatedGeoJSON.ts +2 -1
- package/src/utils/animated/AnimatedRouteCoordinatesArray.ts +6 -6
- package/src/utils/convertStyleSpec.ts +4 -4
|
@@ -12,9 +12,10 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* OfflineManager implements a singleton (shared object) that manages offline
|
|
16
|
-
* All of this class's instance methods are asynchronous, reflecting the
|
|
17
|
-
*
|
|
15
|
+
* OfflineManager implements a singleton (shared object) that manages offline
|
|
16
|
+
* packs. All of this class's instance methods are asynchronous, reflecting the
|
|
17
|
+
* fact that offline resources are stored in a database. The shared object
|
|
18
|
+
* maintains a canonical collection of offline packs.
|
|
18
19
|
*/
|
|
19
20
|
class OfflineManager {
|
|
20
21
|
constructor() {
|
|
@@ -29,10 +30,18 @@ class OfflineManager {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
|
-
* Creates and registers an offline pack that downloads the resources needed to
|
|
33
|
+
* Creates and registers an offline pack that downloads the resources needed to
|
|
34
|
+
* use the given region offline.
|
|
33
35
|
*
|
|
34
|
-
* @
|
|
36
|
+
* @param options - Create options for offline pack that specifies zoom levels, style url, and
|
|
37
|
+
* the region to download.
|
|
38
|
+
* @param progressListener - Callback that listens for status events while downloading the offline
|
|
39
|
+
* resource.
|
|
40
|
+
* @param errorListener - Callback that listens for status events while downloading the offline
|
|
41
|
+
* resource.
|
|
42
|
+
* @returns The created offline pack with its generated ID.
|
|
35
43
|
*
|
|
44
|
+
* @example
|
|
36
45
|
* const progressListener = (offlineRegion, status) => console.log(offlineRegion, status);
|
|
37
46
|
* const errorListener = (offlineRegion, error) => console.log(offlineRegion, error);
|
|
38
47
|
*
|
|
@@ -43,12 +52,6 @@ class OfflineManager {
|
|
|
43
52
|
* bounds: [west, south, east, north],
|
|
44
53
|
* metadata: { customValue: 'myValue' }
|
|
45
54
|
* }, progressListener, errorListener)
|
|
46
|
-
*
|
|
47
|
-
* @param options Create options for offline pack that specifies zoom levels, style url, and the region to download.
|
|
48
|
-
* @param progressListener Callback that listens for status events while downloading the offline resource.
|
|
49
|
-
* @param errorListener Callback that listens for status events while downloading the offline resource.
|
|
50
|
-
*
|
|
51
|
-
* @return The created offline pack with its generated ID.
|
|
52
55
|
*/
|
|
53
56
|
async createPack(options, progressListener, errorListener) {
|
|
54
57
|
await this.initialize();
|
|
@@ -67,14 +70,18 @@ class OfflineManager {
|
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
/**
|
|
70
|
-
* Invalidates the specified offline pack. This method checks that the tiles in
|
|
73
|
+
* Invalidates the specified offline pack. This method checks that the tiles in
|
|
74
|
+
* the specified offline pack match those from the server. Local tiles that do
|
|
75
|
+
* not match the latest version on the server are updated.
|
|
76
|
+
*
|
|
77
|
+
* This is more efficient than deleting the offline pack and downloading it
|
|
78
|
+
* again. If the data stored locally matches that on the server, new data will
|
|
79
|
+
* not be downloaded.
|
|
71
80
|
*
|
|
72
|
-
*
|
|
81
|
+
* @param id - ID of the OfflinePack.
|
|
73
82
|
*
|
|
74
83
|
* @example
|
|
75
84
|
* await OfflineManager.invalidatePack(pack.id)
|
|
76
|
-
*
|
|
77
|
-
* @param id ID of the OfflinePack.
|
|
78
85
|
*/
|
|
79
86
|
async invalidatePack(id) {
|
|
80
87
|
await this.initialize();
|
|
@@ -83,12 +90,13 @@ class OfflineManager {
|
|
|
83
90
|
}
|
|
84
91
|
|
|
85
92
|
/**
|
|
86
|
-
* Unregisters the given OfflinePack and allows resources that are no longer
|
|
93
|
+
* Unregisters the given OfflinePack and allows resources that are no longer
|
|
94
|
+
* required by any remaining packs to be potentially freed.
|
|
95
|
+
*
|
|
96
|
+
* @param id - ID of the OfflinePack.
|
|
87
97
|
*
|
|
88
98
|
* @example
|
|
89
99
|
* await OfflineManager.deletePack(pack.id)
|
|
90
|
-
*
|
|
91
|
-
* @param id ID of the OfflinePack.
|
|
92
100
|
*/
|
|
93
101
|
async deletePack(id) {
|
|
94
102
|
await this.initialize();
|
|
@@ -98,10 +106,13 @@ class OfflineManager {
|
|
|
98
106
|
}
|
|
99
107
|
|
|
100
108
|
/**
|
|
101
|
-
* Forces a revalidation of the tiles in the ambient cache and downloads a fresh
|
|
102
|
-
* This is the recommend method for
|
|
103
|
-
* This is the most efficient method because tiles in the
|
|
104
|
-
*
|
|
109
|
+
* Forces a revalidation of the tiles in the ambient cache and downloads a fresh
|
|
110
|
+
* version of the tiles from the tile server. This is the recommend method for
|
|
111
|
+
* clearing the cache. This is the most efficient method because tiles in the
|
|
112
|
+
* ambient cache are re-downloaded to remove outdated data from a device. It
|
|
113
|
+
* does not erase resources from the ambient cache or delete the database, which
|
|
114
|
+
* can be computationally expensive operations that may carry unintended side
|
|
115
|
+
* effects.
|
|
105
116
|
*
|
|
106
117
|
* @example
|
|
107
118
|
* await OfflineManager.invalidateAmbientCache();
|
|
@@ -112,8 +123,8 @@ class OfflineManager {
|
|
|
112
123
|
}
|
|
113
124
|
|
|
114
125
|
/**
|
|
115
|
-
* Erases resources from the ambient cache.
|
|
116
|
-
*
|
|
126
|
+
* Erases resources from the ambient cache. This method clears the cache and
|
|
127
|
+
* decreases the amount of space that map resources take up on the device.
|
|
117
128
|
*
|
|
118
129
|
* @example
|
|
119
130
|
* await OfflineManager.clearAmbientCache();
|
|
@@ -124,13 +135,14 @@ class OfflineManager {
|
|
|
124
135
|
}
|
|
125
136
|
|
|
126
137
|
/**
|
|
127
|
-
* Sets the maximum size of the ambient cache in bytes. Disables the ambient
|
|
128
|
-
* This method may be computationally expensive because it
|
|
138
|
+
* Sets the maximum size of the ambient cache in bytes. Disables the ambient
|
|
139
|
+
* cache if set to 0. This method may be computationally expensive because it
|
|
140
|
+
* will erase resources from the ambient cache if its size is decreased.
|
|
141
|
+
*
|
|
142
|
+
* @param size - Size of ambient cache.
|
|
129
143
|
*
|
|
130
144
|
* @example
|
|
131
145
|
* await OfflineManager.setMaximumAmbientCacheSize(5000000);
|
|
132
|
-
*
|
|
133
|
-
* @param size Size of ambient cache.
|
|
134
146
|
*/
|
|
135
147
|
async setMaximumAmbientCacheSize(size) {
|
|
136
148
|
await this.initialize();
|
|
@@ -138,7 +150,8 @@ class OfflineManager {
|
|
|
138
150
|
}
|
|
139
151
|
|
|
140
152
|
/**
|
|
141
|
-
* Deletes the existing database, which includes both the ambient cache and
|
|
153
|
+
* Deletes the existing database, which includes both the ambient cache and
|
|
154
|
+
* offline packs, then reinitializes it.
|
|
142
155
|
*
|
|
143
156
|
* @example
|
|
144
157
|
* await OfflineManager.resetDatabase();
|
|
@@ -177,10 +190,10 @@ class OfflineManager {
|
|
|
177
190
|
/**
|
|
178
191
|
* Sideloads offline db
|
|
179
192
|
*
|
|
193
|
+
* @param path - Path to offline tile db on file system.
|
|
194
|
+
*
|
|
180
195
|
* @example
|
|
181
196
|
* await OfflineManager.mergeOfflineRegions(path);
|
|
182
|
-
*
|
|
183
|
-
* @param path Path to offline tile db on file system.
|
|
184
197
|
*/
|
|
185
198
|
async mergeOfflineRegions(path) {
|
|
186
199
|
await this.initialize();
|
|
@@ -188,26 +201,27 @@ class OfflineManager {
|
|
|
188
201
|
}
|
|
189
202
|
|
|
190
203
|
/**
|
|
191
|
-
* Sets the maximum number of tiles that may be downloaded and stored on the
|
|
192
|
-
* Consult the Terms of Service for your map tile host before
|
|
204
|
+
* Sets the maximum number of tiles that may be downloaded and stored on the
|
|
205
|
+
* current device. Consult the Terms of Service for your map tile host before
|
|
206
|
+
* changing this value.
|
|
207
|
+
*
|
|
208
|
+
* @param limit - Map tile limit count.
|
|
193
209
|
*
|
|
194
210
|
* @example
|
|
195
211
|
* OfflineManager.setTileCountLimit(1000);
|
|
196
|
-
*
|
|
197
|
-
* @param limit Map tile limit count.
|
|
198
212
|
*/
|
|
199
213
|
setTileCountLimit(limit) {
|
|
200
214
|
_NativeOfflineModule.default.setTileCountLimit(limit);
|
|
201
215
|
}
|
|
202
216
|
|
|
203
217
|
/**
|
|
204
|
-
* Sets the period at which download status events will be sent over the React
|
|
205
|
-
* The default is 500ms.
|
|
218
|
+
* Sets the period at which download status events will be sent over the React
|
|
219
|
+
* Native bridge. The default is 500ms.
|
|
220
|
+
*
|
|
221
|
+
* @param throttleValue - Event throttle value in ms.
|
|
206
222
|
*
|
|
207
223
|
* @example
|
|
208
224
|
* OfflineManager.setProgressEventThrottle(500);
|
|
209
|
-
*
|
|
210
|
-
* @param throttleValue Event throttle value in ms.
|
|
211
225
|
*/
|
|
212
226
|
setProgressEventThrottle(throttleValue) {
|
|
213
227
|
_NativeOfflineModule.default.setProgressEventThrottle(throttleValue);
|
|
@@ -217,14 +231,16 @@ class OfflineManager {
|
|
|
217
231
|
* Subscribe to download status/error events for the requested offline pack.
|
|
218
232
|
* Note that createPack calls this internally if listeners are provided.
|
|
219
233
|
*
|
|
234
|
+
* @param id - ID of the offline pack.
|
|
235
|
+
* @param progressListener - Callback that listens for status events while downloading the offline
|
|
236
|
+
* resource.
|
|
237
|
+
* @param errorListener - Callback that listens for status events while downloading the offline
|
|
238
|
+
* resource.
|
|
239
|
+
*
|
|
220
240
|
* @example
|
|
221
241
|
* const progressListener = (offlinePack, status) => console.log(offlinePack, status)
|
|
222
242
|
* const errorListener = (offlinePack, error) => console.log(offlinePack, error)
|
|
223
243
|
* OfflineManager.addListener(pack.id, progressListener, errorListener)
|
|
224
|
-
*
|
|
225
|
-
* @param id ID of the offline pack.
|
|
226
|
-
* @param progressListener Callback that listens for status events while downloading the offline resource.
|
|
227
|
-
* @param errorListener Callback that listens for status events while downloading the offline resource.
|
|
228
244
|
*/
|
|
229
245
|
async addListener(id, progressListener, errorListener) {
|
|
230
246
|
const totalProgressListeners = Object.keys(this.progressListeners).length;
|
|
@@ -243,8 +259,10 @@ class OfflineManager {
|
|
|
243
259
|
}
|
|
244
260
|
|
|
245
261
|
/**
|
|
246
|
-
* Unsubscribes any listeners associated with the offline pack.
|
|
247
|
-
*
|
|
262
|
+
* Unsubscribes any listeners associated with the offline pack. Should be called
|
|
263
|
+
* when the component unmounts.
|
|
264
|
+
*
|
|
265
|
+
* @param packId - ID of the offline pack.
|
|
248
266
|
*
|
|
249
267
|
* @example
|
|
250
268
|
* useEffect(() => {
|
|
@@ -252,8 +270,6 @@ class OfflineManager {
|
|
|
252
270
|
* OfflineManager.removeListener(pack.id);
|
|
253
271
|
* }
|
|
254
272
|
* }, []);
|
|
255
|
-
*
|
|
256
|
-
* @param packId ID of the offline pack.
|
|
257
273
|
*/
|
|
258
274
|
removeListener(packId) {
|
|
259
275
|
delete this.progressListeners[packId];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_NativeOfflineModule","_interopRequireDefault","require","_OfflinePack","e","__esModule","default","OfflineManager","constructor","initialized","offlinePacks","progressListeners","errorListeners","handleProgress","bind","onError","subscriptionProgress","subscriptionError","createPack","options","progressListener","errorListener","initialize","offlinePackOptions","mapStyle","bounds","minZoom","maxZoom","metadata","JSON","stringify","nativeOfflinePack","NativeOfflineModule","offlinePack","OfflinePack","id","addListener","invalidatePack","getPack","deletePack","invalidateAmbientCache","clearAmbientCache","setMaximumAmbientCacheSize","size","resetDatabase","getPacks","Object","values","Error","mergeOfflineRegions","path","setTileCountLimit","limit","setProgressEventThrottle","throttleValue","totalProgressListeners","keys","length","onProgress","totalErrorListeners","setPackObserver","removeListener","packId","remove","nativeOfflinePacks","event","state","offlineManager","exports"],"sourceRoot":"../../../../src","sources":["modules/offline/OfflineManager.ts"],"mappings":";;;;;;AAEA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,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AGF,WAAW,EAAEgC,KAAK,CAAC;IAC3D;EACF;AACF;AAEA,MAAME,cAAc,GAAAC,OAAA,CAAA7D,cAAA,GAAG,IAAIA,cAAc,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_NativeOfflineModule","_interopRequireDefault","require","_OfflinePack","e","__esModule","default","OfflineManager","constructor","initialized","offlinePacks","progressListeners","errorListeners","handleProgress","bind","onError","subscriptionProgress","subscriptionError","createPack","options","progressListener","errorListener","initialize","offlinePackOptions","mapStyle","bounds","minZoom","maxZoom","metadata","JSON","stringify","nativeOfflinePack","NativeOfflineModule","offlinePack","OfflinePack","id","addListener","invalidatePack","getPack","deletePack","invalidateAmbientCache","clearAmbientCache","setMaximumAmbientCacheSize","size","resetDatabase","getPacks","Object","values","Error","mergeOfflineRegions","path","setTileCountLimit","limit","setProgressEventThrottle","throttleValue","totalProgressListeners","keys","length","onProgress","totalErrorListeners","setPackObserver","removeListener","packId","remove","nativeOfflinePacks","event","state","offlineManager","exports"],"sourceRoot":"../../../../src","sources":["modules/offline/OfflineManager.ts"],"mappings":";;;;;;AAEA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAoE,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAepE;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,cAAc,CAAC;EAcnBC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,WAAW,GAAG,KAAK;IAExB,IAAI,CAACC,YAAY,GAAG,CAAC,CAAC;IAEtB,IAAI,CAACC,iBAAiB,GAAG,CAAC,CAAC;IAC3B,IAAI,CAACC,cAAc,GAAG,CAAC,CAAC;IAExB,IAAI,CAACC,cAAc,GAAG,IAAI,CAACA,cAAc,CAACC,IAAI,CAAC,IAAI,CAAC;IACpD,IAAI,C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iC,kBAAkB,EAAE;MAClD,MAAM/B,WAAW,GAAG,IAAIC,wBAAW,CAACH,iBAAiB,CAAC;MAEtD,IAAI,CAACrB,YAAY,CAACuB,WAAW,CAACE,EAAE,CAAC,GAAGF,WAAW;IACjD;IAEA,IAAI,CAACxB,WAAW,GAAG,IAAI;IACvB,OAAO,IAAI;EACb;EAEQI,cAAcA,CAACoD,KAAwB,EAAE;IAC/C,MAAM;MAAE9B,EAAE;MAAE+B;IAAM,CAAC,GAAGD,KAAK;IAC3B,MAAMhC,WAAW,GAAG,IAAI,CAACvB,YAAY,CAACyB,EAAE,CAAC;IAEzC,IAAIF,WAAW,EAAE;MACf,IAAI,CAACtB,iBAAiB,CAACsB,WAAW,CAACE,EAAE,CAAC,GAAGF,WAAW,EAAEgC,KAAK,CAAC;IAC9D;IAEA,IAAIC,KAAK,KAAK,UAAU,EAAE;MACxB,IAAI,CAACL,cAAc,CAAC1B,EAAE,CAAC;IACzB;EACF;EAEQpB,OAAOA,CAACkD,KAAuB,EAAE;IACvC,MAAM;MAAE9B;IAAG,CAAC,GAAG8B,KAAK;IAEpB,MAAMhC,WAAW,GAAG,IAAI,CAACvB,YAAY,CAACyB,EAAE,CAAC;IACzC,IAAIF,WAAW,EAAE;MACf,IAAI,CAACrB,cAAc,CAACqB,WAAW,CAACE,EAAE,CAAC,GAAGF,WAAW,EAAEgC,KAAK,CAAC;IAC3D;EACF;AACF;AAEA,MAAME,cAAc,GAAAC,OAAA,CAAA7D,cAAA,GAAG,IAAIA,cAAc,CAAC,CAAC","ignoreList":[]}
|
|
@@ -9,8 +9,8 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
9
9
|
/**
|
|
10
10
|
* A serializable transform for rewriting MapLibre request URLs.
|
|
11
11
|
*
|
|
12
|
-
* Transforms are applied as a pipeline in the order they were added: transform
|
|
13
|
-
* the URL *after* transform N has possibly changed it.
|
|
12
|
+
* Transforms are applied as a pipeline in the order they were added: transform
|
|
13
|
+
* N+1 sees the URL *after* transform N has possibly changed it.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -22,18 +22,18 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* TransformRequestManager provides methods for managing HTTP requests made by
|
|
25
|
+
* TransformRequestManager provides methods for managing HTTP requests made by
|
|
26
|
+
* MapLibre.
|
|
26
27
|
*
|
|
27
28
|
* Transformations are possible in three ways:
|
|
28
29
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
30
|
+
* - Transforming the URL with search and replace
|
|
31
|
+
* - Adding URL search params
|
|
32
|
+
* - Adding HTTP headers
|
|
32
33
|
*
|
|
33
34
|
* Transforms are applied in this order. The `match` conditions are applied to
|
|
34
35
|
* possibly already transformed URLs.
|
|
35
36
|
*
|
|
36
|
-
* @remarks
|
|
37
37
|
* To gain insight into which transforms are applied set the log level to
|
|
38
38
|
* `"debug"` via {@link LogManager}:
|
|
39
39
|
*
|
|
@@ -48,43 +48,44 @@ class TransformRequestManager {
|
|
|
48
48
|
* Transforms execute in insertion order. Therefore `match` and `find` regexes
|
|
49
49
|
* are matched against possibly already modified URL by previous transforms.
|
|
50
50
|
*
|
|
51
|
-
* Re-adding an existing `id` updates the transform
|
|
52
|
-
*
|
|
53
|
-
*
|
|
51
|
+
* Re-adding an existing `id` updates the transform **in-place**, preserving its
|
|
52
|
+
* position in the pipeline. This makes it safe to refresh tokens or swap
|
|
53
|
+
* domains without disrupting the order of other transforms.
|
|
54
54
|
*
|
|
55
55
|
* URL transforms are applied before `addUrlSearchParam` and `addHeader`.
|
|
56
56
|
*
|
|
57
|
-
* @
|
|
58
|
-
*
|
|
57
|
+
* @param options - The transform. Set {@link TransformOptions.id} to a stable string to enable
|
|
58
|
+
* in-place updates; if omitted an id is auto-generated and returned.
|
|
59
|
+
* @returns The id of the transform (the value of `transform.id` when provided, otherwise the auto-generated one). Pass it to {@link removeUrlTransform} to remove it later.
|
|
60
|
+
*
|
|
61
|
+
* @example Upgrade all requests to HTTPS
|
|
62
|
+
* ```ts
|
|
59
63
|
* TransformRequestManager.addUrlTransform({
|
|
60
64
|
* id: "force-https",
|
|
61
65
|
* find: "^http://",
|
|
62
66
|
* replace: "https://",
|
|
63
67
|
* });
|
|
68
|
+
* ```
|
|
64
69
|
*
|
|
65
|
-
* @example
|
|
66
|
-
*
|
|
70
|
+
* @example Redirect a specific domain through a proxy
|
|
71
|
+
* ```ts
|
|
67
72
|
* TransformRequestManager.addUrlTransform({
|
|
68
73
|
* id: "proxy",
|
|
69
74
|
* match: "tiles\\.example\\.com",
|
|
70
75
|
* find: "tiles\\.example\\.com",
|
|
71
76
|
* replace: "proxy.example.com",
|
|
72
77
|
* });
|
|
78
|
+
* ```
|
|
73
79
|
*
|
|
74
|
-
* @example
|
|
75
|
-
*
|
|
80
|
+
* @example Inject an API key into the path using a capture group
|
|
81
|
+
* ```ts
|
|
76
82
|
* TransformRequestManager.addUrlTransform({
|
|
77
83
|
* id: "api-key",
|
|
78
84
|
* match: "api\\.example\\.com",
|
|
79
85
|
* find: "(https://api\\.example\\.com/)(.*)",
|
|
80
86
|
* replace: "$1mySecretKey/$2",
|
|
81
87
|
* });
|
|
82
|
-
*
|
|
83
|
-
* @param options The transform. Set {@link TransformOptions.id} to a stable string to
|
|
84
|
-
* enable in-place updates; if omitted an id is auto-generated and returned.
|
|
85
|
-
*
|
|
86
|
-
* @returns The id of the transform (the value of `transform.id` when provided, otherwise
|
|
87
|
-
* the auto-generated one). Pass it to {@link removeUrlTransform} to remove it later.
|
|
88
|
+
* ```
|
|
88
89
|
*/
|
|
89
90
|
addUrlTransform(options) {
|
|
90
91
|
const id = options.id ?? this.getId();
|
|
@@ -93,10 +94,10 @@ class TransformRequestManager {
|
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
/**
|
|
96
|
-
* Removes the URL transform with the given `id
|
|
97
|
-
*
|
|
97
|
+
* Removes the URL transform with the given `id` . No-op if the id is not
|
|
98
|
+
* registered.
|
|
98
99
|
*
|
|
99
|
-
* @param id The identifier passed to/returned from {@link addUrlTransform}.
|
|
100
|
+
* @param id - The identifier passed to/returned from {@link addUrlTransform}.
|
|
100
101
|
*/
|
|
101
102
|
removeUrlTransform(id) {
|
|
102
103
|
_NativeTransformRequestModule.default.removeUrlTransform(id);
|
|
@@ -110,24 +111,25 @@ class TransformRequestManager {
|
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
/**
|
|
113
|
-
* Adds or updates a URL query parameter identified by `id` that will be
|
|
114
|
-
* matching map resource requests. Re-adding an existing `id`
|
|
114
|
+
* Adds or updates a URL query parameter identified by `id` that will be
|
|
115
|
+
* appended to all matching map resource requests. Re-adding an existing `id`
|
|
116
|
+
* updates the param in-place.
|
|
115
117
|
*
|
|
116
|
-
* @
|
|
117
|
-
*
|
|
118
|
+
* @param options - The options. Set {@link TransformOptions.id} to a stable string to enable
|
|
119
|
+
* in-place updates; if omitted an id is auto-generated and returned.
|
|
120
|
+
* @returns The id of the options. Pass it to {@link removeUrlSearchParam} to remove it later.
|
|
121
|
+
*
|
|
122
|
+
* @example Add apiKey to for a specific domain
|
|
123
|
+
* ```ts
|
|
118
124
|
* TransformRequestManager.addUrlSearchParam({
|
|
119
125
|
* match: /tiles\.example\.com/,
|
|
120
126
|
* name: "apiKey",
|
|
121
127
|
* value: "your-api-key",
|
|
122
128
|
* });
|
|
129
|
+
* ```
|
|
123
130
|
*
|
|
124
131
|
* // Add apiKey to all requests (no match = applies to all)
|
|
125
132
|
* TransformRequestManager.addUrlSearchParam({ name: "apiKey", value: "your-api-key" });
|
|
126
|
-
*
|
|
127
|
-
* @param options The options. Set {@link TransformOptions.id} to a stable string to
|
|
128
|
-
* enable in-place updates; if omitted an id is auto-generated and returned.
|
|
129
|
-
*
|
|
130
|
-
* @returns The id of the options. Pass it to {@link removeUrlSearchParam} to remove it later.
|
|
131
133
|
*/
|
|
132
134
|
addUrlSearchParam(options) {
|
|
133
135
|
const id = options.id ?? this.getId();
|
|
@@ -138,7 +140,7 @@ class TransformRequestManager {
|
|
|
138
140
|
/**
|
|
139
141
|
* Removes a previously added URL query parameter by its `id`.
|
|
140
142
|
*
|
|
141
|
-
* @param id The identifier passed to/returned from {@link addUrlSearchParam}.
|
|
143
|
+
* @param id - The identifier passed to/returned from {@link addUrlSearchParam}.
|
|
142
144
|
*/
|
|
143
145
|
removeUrlSearchParam(id) {
|
|
144
146
|
_NativeTransformRequestModule.default.removeUrlSearchParam(id);
|
|
@@ -146,23 +148,26 @@ class TransformRequestManager {
|
|
|
146
148
|
|
|
147
149
|
/**
|
|
148
150
|
* Adds or updates an HTTP header identified by `id` that will be sent with all
|
|
149
|
-
* matching map resource requests. Re-adding an existing `id` updates the header
|
|
151
|
+
* matching map resource requests. Re-adding an existing `id` updates the header
|
|
152
|
+
* in-place.
|
|
153
|
+
*
|
|
154
|
+
* @param options - The options. Set {@link TransformOptions.id} to a stable string to enable
|
|
155
|
+
* in-place updates; if omitted an id is auto-generated and returned.
|
|
156
|
+
* @returns The id of the options. Pass it to {@link removeHeader} to remove it later.
|
|
150
157
|
*
|
|
151
|
-
* @example
|
|
152
|
-
*
|
|
158
|
+
* @example Add header to all requests
|
|
159
|
+
* ```
|
|
153
160
|
* TransformRequestManager.addHeader({ name: "Authorization", value: "Bearer token123" });
|
|
161
|
+
* ```
|
|
154
162
|
*
|
|
155
|
-
*
|
|
163
|
+
* @example Add header only to requests matching a pattern
|
|
164
|
+
* ```ts
|
|
156
165
|
* TransformRequestManager.addHeader({
|
|
157
166
|
* name: "X-API-Key",
|
|
158
167
|
* value: "key123",
|
|
159
168
|
* match: /https:\/\/api\.example\.com\/tiles\//,
|
|
160
169
|
* });
|
|
161
|
-
*
|
|
162
|
-
* @param options The options. Set {@link TransformOptions.id} to a stable string to
|
|
163
|
-
* enable in-place updates; if omitted an id is auto-generated and returned.
|
|
164
|
-
*
|
|
165
|
-
* @returns The id of the options. Pass it to {@link removeHeader} to remove it later.
|
|
170
|
+
* ```
|
|
166
171
|
*/
|
|
167
172
|
addHeader(options) {
|
|
168
173
|
const id = options.id ?? this.getId();
|
|
@@ -180,7 +185,7 @@ class TransformRequestManager {
|
|
|
180
185
|
/**
|
|
181
186
|
* Removes a previously added HTTP header by its `id`.
|
|
182
187
|
*
|
|
183
|
-
* @param id The identifier passed to/returned from {@link addHeader}.
|
|
188
|
+
* @param id - The identifier passed to/returned from {@link addHeader}.
|
|
184
189
|
*/
|
|
185
190
|
removeHeader(id) {
|
|
186
191
|
_NativeTransformRequestModule.default.removeHeader(id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_NativeTransformRequestModule","_interopRequireDefault","require","e","__esModule","default","TransformRequestManager","addUrlTransform","options","id","getId","NativeTransformRequestModule","toRegexString","match","find","replace","removeUrlTransform","clearUrlTransforms","addUrlSearchParam","name","value","removeUrlSearchParam","addHeader","clearUrlSearchParams","removeHeader","clearHeaders","clear","lastId","result","undefined","RegExp","flags","Error","source","transformRequestManager","exports"],"sourceRoot":"../../../../src","sources":["modules/transform-request/TransformRequestManager.ts"],"mappings":";;;;;;AAAA,IAAAA,6BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0E,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;
|
|
1
|
+
{"version":3,"names":["_NativeTransformRequestModule","_interopRequireDefault","require","e","__esModule","default","TransformRequestManager","addUrlTransform","options","id","getId","NativeTransformRequestModule","toRegexString","match","find","replace","removeUrlTransform","clearUrlTransforms","addUrlSearchParam","name","value","removeUrlSearchParam","addHeader","clearUrlSearchParams","removeHeader","clearHeaders","clear","lastId","result","undefined","RegExp","flags","Error","source","transformRequestManager","exports"],"sourceRoot":"../../../../src","sources":["modules/transform-request/TransformRequestManager.ts"],"mappings":";;;;;;AAAA,IAAAA,6BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0E,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAmB1E;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA;;AASA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,uBAAuB,CAAC;EAC5B;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,eAAeA,CAACC,OAA4B,EAAU;IACpD,MAAMC,EAAE,GAAGD,OAAO,CAACC,EAAE,IAAI,IAAI,CAACC,KAAK,CAAC,CAAC;IAErCC,qCAA4B,CAACJ,eAAe,CAC1CE,EAAE,EACFH,uBAAuB,CAACM,aAAa,CAACJ,OAAO,CAACK,KAAK,CAAC,EACpDP,uBAAuB,CAACM,aAAa,CAACJ,OAAO,CAACM,IAAI,CAAC,IAAI,EAAE,EACzDN,OAAO,CAACO,OACV,CAAC;IAED,OAAON,EAAE;EACX;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEO,kBAAkBA,CAACP,EAAU,EAAQ;IACnCE,qCAA4B,CAACK,kBAAkB,CAACP,EAAE,CAAC;EACrD;;EAEA;AACF;AACA;EACEQ,kBAAkBA,CAAA,EAAS;IACzBN,qCAA4B,CAACM,kBAAkB,CAAC,CAAC;EACnD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,iBAAiBA,CAACV,OAA8B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C,CAAC;EACrB;EAEQE,MAAM,GAAW,CAAC,CAAC;EAEnBjB,KAAKA,CAAA,EAAG;IACd,IAAI,CAACiB,MAAM,EAAE;IAEb,OAAO,oBAAoB,GAAG,IAAI,CAACA,MAAM;EAC3C;EAEA,OAAef,aAAaA,CAC1BQ,KAAkC,EACnB;IACf,IAAIQ,MAA0B,GAAGC,SAAS;IAC1C,IAAIT,KAAK,YAAYU,MAAM,EAAE;MAC3B,IAAIV,KAAK,CAACW,KAAK,EAAE;QACf,MAAM,IAAIC,KAAK,CAAC,+BAA+B,CAAC;MAClD;MAEAJ,MAAM,GAAGR,KAAK,CAACa,MAAM;IACvB,CAAC,MAAM;MACLL,MAAM,GAAGR,KAAK;IAChB;IAEA,OAAOQ,MAAM,IAAI,IAAI;EACvB;AACF;AAEA,MAAMM,uBAAuB,GAAAC,OAAA,CAAA7B,uBAAA,GAAG,IAAIA,uBAAuB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -11,8 +11,8 @@ var _generateCode = require("@expo/config-plugins/build/utils/generateCode");
|
|
|
11
11
|
const TAG_PREFIX = `@maplibre/maplibre-react-native`;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Only the post-install block is required, the post installer block is used for
|
|
15
|
-
* doesn't currently support.
|
|
14
|
+
* Only the post-install block is required, the post installer block is used for
|
|
15
|
+
* SPM (Swift Package Manager) which Expo doesn't currently support.
|
|
16
16
|
*/
|
|
17
17
|
function applyPodfilePostInstall(contents) {
|
|
18
18
|
const result = (0, _generateCode.mergeContents)({
|
|
@@ -90,15 +90,16 @@ const withoutSignatures = config => {
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
93
|
+
* Set the Debug Information Format to DWARF with dSYM File during EAS Build for
|
|
94
|
+
* Managed App https://github.com/expo/eas-cli/issues/968
|
|
95
95
|
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
96
|
+
* Set `artifactPath` in `eas.json`:
|
|
97
|
+
*
|
|
98
|
+
* ```json
|
|
99
|
+
* "ios": {
|
|
99
100
|
* "artifactPath": "ios/build/*"
|
|
100
101
|
* }
|
|
101
|
-
*
|
|
102
|
+
* ```
|
|
102
103
|
*/
|
|
103
104
|
const withDwarfDsym = config => {
|
|
104
105
|
return (0, _configPlugins.withXcodeProject)(config, c => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_configPlugins","require","_generateCode","TAG_PREFIX","applyPodfilePostInstall","contents","result","mergeContents","tag","src","newSrc","anchor","offset","comment","didMerge","didClear","withPodfilePostInstall","config","withPodfile","c","modResults","applyPodfileGlobalVariables","props","globalVariables","ios","nativeVersion","push","spmSpec","length","join","modified","removeGeneratedContents","exports","withPodfileGlobalVariables","withoutSignatures","withXcodeProject","project","targetName","modRequest","projectName","phaseName","nativeTargetId","findTargetKey","console","warn","buildPhases","pbxNativeTargetSection","alreadyExists","some","phase","addBuildPhase","shellPath","shellScript","withDwarfDsym","debugInformationFormat"],"sourceRoot":"../../../src","sources":["plugin/ios.ts"],"mappings":";;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAKA,IAAAC,aAAA,GAAAD,OAAA;AAOA,MAAME,UAAU,GAAG,iCAAiC;;AAEpD;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAACC,QAAgB,EAAU;EAChE,MAAMC,MAAM,GAAG,IAAAC,2BAAa,EAAC;IAC3BC,GAAG,EAAE,GAAGL,UAAU,eAAe;IACjCM,GAAG,EAAEJ,QAAQ;IACbK,MAAM,EAAE,mCAAmC;IAC3CC,MAAM,EAAE,+BAA+B;IACvCC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACX,CAAC,CAAC;EAEF,IAAIP,MAAM,CAACQ,QAAQ,IAAIR,MAAM,CAACS,QAAQ,EAAE;IACtC,OAAOT,MAAM,CAACD,QAAQ;EACxB;EAEA,OAAOA,QAAQ;AACjB;AAEA,MAAMW,sBAAo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AAC,IAAK;IACrCA,CAAC,CAACC,UAAU,CAACkC,sBAAsB,GAAG,iBAAiB;IAEvD,OAAOnC,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAEM,MAAMK,GAAG,GAAAQ,OAAA,CAAAR,GAAA,GAAG;EACjBR,sBAAsB;EACtBiB,0BAA0B;EAC1BC,iBAAiB;EACjBmB;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_configPlugins","require","_generateCode","TAG_PREFIX","applyPodfilePostInstall","contents","result","mergeContents","tag","src","newSrc","anchor","offset","comment","didMerge","didClear","withPodfilePostInstall","config","withPodfile","c","modResults","applyPodfileGlobalVariables","props","globalVariables","ios","nativeVersion","push","spmSpec","length","join","modified","removeGeneratedContents","exports","withPodfileGlobalVariables","withoutSignatures","withXcodeProject","project","targetName","modRequest","projectName","phaseName","nativeTargetId","findTargetKey","console","warn","buildPhases","pbxNativeTargetSection","alreadyExists","some","phase","addBuildPhase","shellPath","shellScript","withDwarfDsym","debugInformationFormat"],"sourceRoot":"../../../src","sources":["plugin/ios.ts"],"mappings":";;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAKA,IAAAC,aAAA,GAAAD,OAAA;AAOA,MAAME,UAAU,GAAG,iCAAiC;;AAEpD;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAACC,QAAgB,EAAU;EAChE,MAAMC,MAAM,GAAG,IAAAC,2BAAa,EAAC;IAC3BC,GAAG,EAAE,GAAGL,UAAU,eAAe;IACjCM,GAAG,EAAEJ,QAAQ;IACbK,MAAM,EAAE,mCAAmC;IAC3CC,MAAM,EAAE,+BAA+B;IACvCC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACX,CAAC,CAAC;EAEF,IAAIP,MAAM,CAACQ,QAAQ,IAAIR,MAAM,CAACS,QAAQ,EAAE;IACtC,OAAOT,MAAM,CAACD,QAAQ;EACxB;EAEA,OAAOA,QAAQ;AACjB;AAEA,MAAMW,sBAAoC,GAAIC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,IAAK;IACrCA,CAAC,CAACC,UAAU,CAACkC,sBAAsB,GAAG,iBAAiB;IAEvD,OAAOnC,CAAC;EACV,CAAC,CAAC;AACJ,CAAC;AAEM,MAAMK,GAAG,GAAAQ,OAAA,CAAAR,GAAA,GAAG;EACjBR,sBAAsB;EACtBiB,0BAA0B;EAC1BC,iBAAiB;EACjBmB;AACF,CAAC","ignoreList":[]}
|
|
@@ -5,16 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.anchorToNative = anchorToNative;
|
|
7
7
|
/**
|
|
8
|
-
* Position anchor for markers and annotations.
|
|
9
|
-
*
|
|
8
|
+
* Position anchor for markers and annotations. Follows MapLibre GL JS
|
|
9
|
+
* PositionAnchor format.
|
|
10
10
|
*
|
|
11
|
-
* @see https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/PositionAnchor/
|
|
11
|
+
* @see {@link https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/PositionAnchor/}
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Converts an Anchor string to native {x, y} format.
|
|
16
|
-
*
|
|
17
|
-
* y: 0 = top, 0.5 = center, 1 = bottom
|
|
15
|
+
* Converts an Anchor string to native {x, y} format. x: 0 = left, 0.5 = center,
|
|
16
|
+
* 1 = right y: 0 = top, 0.5 = center, 1 = bottom
|
|
18
17
|
*/
|
|
19
18
|
function anchorToNative(anchor) {
|
|
20
19
|
switch (anchor) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["anchorToNative","anchor","x","y"],"sourceRoot":"../../../src","sources":["types/Anchor.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"names":["anchorToNative","anchor","x","y"],"sourceRoot":"../../../src","sources":["types/Anchor.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACO,SAASA,cAAcA,CAACC,MAAc,EAA4B;EACvE,QAAQA,MAAM;IACZ,KAAK,QAAQ;MACX,OAAO;QAAEC,CAAC,EAAE,GAAG;QAAEC,CAAC,EAAE;MAAI,CAAC;IAC3B,KAAK,KAAK;MACR,OAAO;QAAED,CAAC,EAAE,GAAG;QAAEC,CAAC,EAAE;MAAE,CAAC;IACzB,KAAK,QAAQ;MACX,OAAO;QAAED,CAAC,EAAE,GAAG;QAAEC,CAAC,EAAE;MAAE,CAAC;IACzB,KAAK,MAAM;MACT,OAAO;QAAED,CAAC,EAAE,CAAC;QAAEC,CAAC,EAAE;MAAI,CAAC;IACzB,KAAK,OAAO;MACV,OAAO;QAAED,CAAC,EAAE,CAAC;QAAEC,CAAC,EAAE;MAAI,CAAC;IACzB,KAAK,UAAU;MACb,OAAO;QAAED,CAAC,EAAE,CAAC;QAAEC,CAAC,EAAE;MAAE,CAAC;IACvB,KAAK,WAAW;MACd,OAAO;QAAED,CAAC,EAAE,CAAC;QAAEC,CAAC,EAAE;MAAE,CAAC;IACvB,KAAK,aAAa;MAChB,OAAO;QAAED,CAAC,EAAE,CAAC;QAAEC,CAAC,EAAE;MAAE,CAAC;IACvB,KAAK,cAAc;MACjB,OAAO;QAAED,CAAC,EAAE,CAAC;QAAEC,CAAC,EAAE;MAAE,CAAC;EACzB;AACF","ignoreList":[]}
|
|
@@ -30,8 +30,8 @@ class AbstractAnimatedCoordinates extends AnimatedWithChildren {
|
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* Subclasses can override getValue to calculate value from state.
|
|
34
|
-
*
|
|
33
|
+
* Subclasses can override getValue to calculate value from state. Value is
|
|
34
|
+
* typically coordinates array, but can be anything
|
|
35
35
|
*
|
|
36
36
|
* @param state - either state from initialState and/or from calculate
|
|
37
37
|
*/
|
|
@@ -9,7 +9,7 @@ class AnimatedCoordinatesArray extends _AbstractAnimatedCoordinates.AbstractAnim
|
|
|
9
9
|
/**
|
|
10
10
|
* Subclasses can override to calculate initial state
|
|
11
11
|
*
|
|
12
|
-
* @param
|
|
12
|
+
* @param coordinatesArray - to value from animate
|
|
13
13
|
* @returns {object} - the state object
|
|
14
14
|
*/
|
|
15
15
|
onInitialState(coordinatesArray) {
|
|
@@ -20,10 +20,10 @@ class AnimatedCoordinatesArray extends _AbstractAnimatedCoordinates.AbstractAnim
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Subclasses can override getValue to calculate value from state.
|
|
24
|
-
*
|
|
23
|
+
* Subclasses can override getValue to calculate value from state. Value is
|
|
24
|
+
* typically coordinates array, but can be anything
|
|
25
25
|
*
|
|
26
|
-
* @param
|
|
26
|
+
* @param state - either state from initialState and/or from calculate
|
|
27
27
|
* @returns {object}
|
|
28
28
|
*/
|
|
29
29
|
onGetValue(state) {
|
|
@@ -33,8 +33,8 @@ class AnimatedCoordinatesArray extends _AbstractAnimatedCoordinates.AbstractAnim
|
|
|
33
33
|
/**
|
|
34
34
|
* Calculates state based on startingState and progress, returns a new state
|
|
35
35
|
*
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
36
|
+
* @param state - state object from initialState and/or from calculate
|
|
37
|
+
* @param progress - value between 0 and 1
|
|
38
38
|
* @returns {object} next state
|
|
39
39
|
*/
|
|
40
40
|
onCalculate(state, progress) {
|
|
@@ -7,7 +7,8 @@ exports.AnimatedGeoJSON = void 0;
|
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
const AnimatedWithChildren = Object.getPrototypeOf(_reactNative.Animated.ValueXY);
|
|
9
9
|
/**
|
|
10
|
-
* AnimatedGeoJSON can be used to have animated properties inside the data
|
|
10
|
+
* AnimatedGeoJSON can be used to have animated properties inside the data
|
|
11
|
+
* property
|
|
11
12
|
*
|
|
12
13
|
* Equivalent of AnimatedStyle for GeoJSON
|
|
13
14
|
* https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Animated/nodes/AnimatedStyle.js
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","AnimatedWithChildren","Object","getPrototypeOf","Animated","ValueXY","AnimatedGeoJSON","constructor","valueIn","geojson","walkGeoJSONAndGetValues","value","Array","isArray","map","i","__getValue","result","key","walkAndProcess","cb","forEach","type","coordinates","length","__attach","v","__addChild","__detach","__removeChild","exports"],"sourceRoot":"../../../../src","sources":["utils/animated/AnimatedGeoJSON.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,cAAc,CAACC,qBAAQ,CAACC,OAAO,CAAC;AAYpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,SAASL,oBAAoB,CAAC;EACxDM,WAAWA,CAACC,OAA+B,EAAE;IAC3C,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,OAAO,GAAGD,OAAO;EACxB;EAEQE,uBAAuBA,CAACC,KAAU,EAAO;IAC/C,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACxB,OAAOA,KAAK,CAACG,GAAG,CAAEC,CAAC,IAAK,IAAI,CAACL,uBAAuB,CAACK,CAAC,CAAC,CAAC;IAC1D;IAEA,IAAIJ,KAAK,YAAYV,oBAAoB,EAAE;MACzC,OAAQU,KAAK,CAASK,UAAU,CAAC,CAAC;IACpC;IAEA,IAAI,OAAOL,KAAK,KAAK,QAAQ,EAAE;MAC7B,MAAMM,MAA8B,GAAG,CAAC,CAAC;MAEzC,KAAK,MAAMC,GAAG,IAAIP,KAAK,EAAE;QACvBM,MAAM,CAACC,GAAG,CAAC,GAAG,IAAI,CAACR,uBAAuB,CAACC,KAAK,CAACO,GAAG,CAAC,CAAC;MACxD;MAEA,OAAOD,MAAM;IACf;IAEA,OAAON,KAAK;EACd;EAEQQ,cAAcA,CACpBR,KAAU,EACVS,EAA0C,EACpC;IACN,IAAIR,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACxBA,KAAK,CAACU,OAAO,CAAEN,CAAC,IAAK,IAAI,CAACI,cAAc,CAACJ,CAAC,EAAEK,EAAE,CAAC,CAAC;IAClD,CAAC,MAAM,IAAIT,KAAK,YAAYV,oBAAoB,EAAE;MAChDmB,EAAE,CAACT,KAAK,CAAC;IACX,CAAC,MAAM,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;MACpC,KAAK,MAAMO,GAAG,IAAIP,KAAK,EAAE;QACvB,IAAI,CAACQ,cAAc,CAACR,KAAK,CAACO,GAAG,CAAC,EAAEE,EAAE,CAAC;MACrC;IACF;EACF;EAEAJ,UAAUA,CAAA,EAAuC;IAC/C,MAAMP,OAAO,GAAG,IAAI,CAACC,uBAAuB,CAAC,IAAI,CAACD,OAAO,CAAC;IAE1D,IAAIA,OAAO,CAACa,IAAI,KAAK,YAAY,IAAIb,OAAO,CAACc,WAAW,CAACC,MAAM,KAAK,CAAC,EAAE;MACrEf,OAAO,CAACc,WAAW,GAAG,CAAC,GAAGd,OAAO,CAACc,WAAW,EAAE,GAAGd,OAAO,CAACc,WAAW,CAAC;IACxE;IAEA,OAAOd,OAAO;EAChB;EAEAgB,QAAQA,CAAA,EAAS;IACf,IAAI,CAACN,cAAc,CAAC,IAAI,CAACV,OAAO,EAAGiB,CAAC,IAAMA,CAAC,CAASC,UAAU,CAAC,IAAI,CAAC,CAAC;EACvE;EAEAC,QAAQA,CAAA,EAAS;IACf,IAAI,CAACT,cAAc,CAAC,IAAI,CAACV,OAAO,EAAGiB,CAAC,IAAMA,CAAC,CAASG,aAAa,CAAC,IAAI,CAAC,CAAC;IACxE,KAAK,CAACD,QAAQ,CAAC,CAAC;EAClB;AACF;AAACE,OAAA,CAAAxB,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","AnimatedWithChildren","Object","getPrototypeOf","Animated","ValueXY","AnimatedGeoJSON","constructor","valueIn","geojson","walkGeoJSONAndGetValues","value","Array","isArray","map","i","__getValue","result","key","walkAndProcess","cb","forEach","type","coordinates","length","__attach","v","__addChild","__detach","__removeChild","exports"],"sourceRoot":"../../../../src","sources":["utils/animated/AnimatedGeoJSON.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,cAAc,CAACC,qBAAQ,CAACC,OAAO,CAAC;AAYpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,SAASL,oBAAoB,CAAC;EACxDM,WAAWA,CAACC,OAA+B,EAAE;IAC3C,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,OAAO,GAAGD,OAAO;EACxB;EAEQE,uBAAuBA,CAACC,KAAU,EAAO;IAC/C,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACxB,OAAOA,KAAK,CAACG,GAAG,CAAEC,CAAC,IAAK,IAAI,CAACL,uBAAuB,CAACK,CAAC,CAAC,CAAC;IAC1D;IAEA,IAAIJ,KAAK,YAAYV,oBAAoB,EAAE;MACzC,OAAQU,KAAK,CAASK,UAAU,CAAC,CAAC;IACpC;IAEA,IAAI,OAAOL,KAAK,KAAK,QAAQ,EAAE;MAC7B,MAAMM,MAA8B,GAAG,CAAC,CAAC;MAEzC,KAAK,MAAMC,GAAG,IAAIP,KAAK,EAAE;QACvBM,MAAM,CAACC,GAAG,CAAC,GAAG,IAAI,CAACR,uBAAuB,CAACC,KAAK,CAACO,GAAG,CAAC,CAAC;MACxD;MAEA,OAAOD,MAAM;IACf;IAEA,OAAON,KAAK;EACd;EAEQQ,cAAcA,CACpBR,KAAU,EACVS,EAA0C,EACpC;IACN,IAAIR,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACxBA,KAAK,CAACU,OAAO,CAAEN,CAAC,IAAK,IAAI,CAACI,cAAc,CAACJ,CAAC,EAAEK,EAAE,CAAC,CAAC;IAClD,CAAC,MAAM,IA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