@feltmaps/js-sdk 1.5.0-next.12 → 1.5.0-next.14
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/client.cjs +1 -1
- package/dist/client.d.cts +41 -3
- package/dist/client.d.ts +41 -3
- package/dist/client.js +1 -1
- package/dist/handler.cjs +1 -1
- package/dist/handler.d.cts +251 -3
- package/dist/handler.d.ts +251 -3
- package/dist/handler.js +1 -1
- package/dist/{types-C_wMpqIu.d.cts → types-PSY3LPGC.d.cts} +153 -1
- package/dist/{types-C_wMpqIu.d.ts → types-PSY3LPGC.d.ts} +153 -1
- package/handler.d.ts +251 -3
- package/handler.js +1 -1
- package/package.json +1 -1
- package/{types-C_wMpqIu.d.ts → types-PSY3LPGC.d.ts} +153 -1
|
@@ -2241,6 +2241,158 @@ interface LayerSchemaDateTimeAttribute extends LayerSchemaCommonAttribute {
|
|
|
2241
2241
|
count: number;
|
|
2242
2242
|
}>;
|
|
2243
2243
|
}
|
|
2244
|
+
declare const EphemeralLayerSourceSchema: z.ZodObject<{
|
|
2245
|
+
type: z.ZodLiteral<"application/geo+json">;
|
|
2246
|
+
name: z.ZodString;
|
|
2247
|
+
geometryStyles: z.ZodOptional<z.ZodObject<{
|
|
2248
|
+
Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
2249
|
+
Line: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
2250
|
+
Polygon: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
2251
|
+
}, "strip", z.ZodTypeAny, {
|
|
2252
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2253
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2254
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2255
|
+
}, {
|
|
2256
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2257
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2258
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2259
|
+
}>>;
|
|
2260
|
+
}, "strip", z.ZodTypeAny, {
|
|
2261
|
+
type: "application/geo+json";
|
|
2262
|
+
name: string;
|
|
2263
|
+
geometryStyles?: {
|
|
2264
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2265
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2266
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2267
|
+
} | undefined;
|
|
2268
|
+
}, {
|
|
2269
|
+
type: "application/geo+json";
|
|
2270
|
+
name: string;
|
|
2271
|
+
geometryStyles?: {
|
|
2272
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2273
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2274
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2275
|
+
} | undefined;
|
|
2276
|
+
}>;
|
|
2277
|
+
interface EphemeralLayerSource extends zInfer<typeof EphemeralLayerSourceSchema> {
|
|
2278
|
+
}
|
|
2279
|
+
declare const GeoJsonFileSourceSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
2280
|
+
type: z.ZodLiteral<"application/geo+json">;
|
|
2281
|
+
name: z.ZodString;
|
|
2282
|
+
geometryStyles: z.ZodOptional<z.ZodObject<{
|
|
2283
|
+
Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
2284
|
+
Line: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
2285
|
+
Polygon: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
2286
|
+
}, "strip", z.ZodTypeAny, {
|
|
2287
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2288
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2289
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2290
|
+
}, {
|
|
2291
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2292
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2293
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2294
|
+
}>>;
|
|
2295
|
+
}, {
|
|
2296
|
+
file: z.ZodType<File, z.ZodTypeDef, File>;
|
|
2297
|
+
}>, "strip", z.ZodTypeAny, {
|
|
2298
|
+
type: "application/geo+json";
|
|
2299
|
+
name: string;
|
|
2300
|
+
file: File;
|
|
2301
|
+
geometryStyles?: {
|
|
2302
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2303
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2304
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2305
|
+
} | undefined;
|
|
2306
|
+
}, {
|
|
2307
|
+
type: "application/geo+json";
|
|
2308
|
+
name: string;
|
|
2309
|
+
file: File;
|
|
2310
|
+
geometryStyles?: {
|
|
2311
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2312
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2313
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2314
|
+
} | undefined;
|
|
2315
|
+
}>;
|
|
2316
|
+
interface GeoJsonFileSource extends zInfer<typeof GeoJsonFileSourceSchema>, EphemeralLayerSource {
|
|
2317
|
+
}
|
|
2318
|
+
declare const GeoJsonUrlSourceSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
2319
|
+
type: z.ZodLiteral<"application/geo+json">;
|
|
2320
|
+
name: z.ZodString;
|
|
2321
|
+
geometryStyles: z.ZodOptional<z.ZodObject<{
|
|
2322
|
+
Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
2323
|
+
Line: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
2324
|
+
Polygon: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
2325
|
+
}, "strip", z.ZodTypeAny, {
|
|
2326
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2327
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2328
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2329
|
+
}, {
|
|
2330
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2331
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2332
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2333
|
+
}>>;
|
|
2334
|
+
}, {
|
|
2335
|
+
url: z.ZodString;
|
|
2336
|
+
}>, "strip", z.ZodTypeAny, {
|
|
2337
|
+
type: "application/geo+json";
|
|
2338
|
+
name: string;
|
|
2339
|
+
url: string;
|
|
2340
|
+
geometryStyles?: {
|
|
2341
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2342
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2343
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2344
|
+
} | undefined;
|
|
2345
|
+
}, {
|
|
2346
|
+
type: "application/geo+json";
|
|
2347
|
+
name: string;
|
|
2348
|
+
url: string;
|
|
2349
|
+
geometryStyles?: {
|
|
2350
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2351
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2352
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2353
|
+
} | undefined;
|
|
2354
|
+
}>;
|
|
2355
|
+
interface GeoJsonUrlSource extends z.infer<typeof GeoJsonUrlSourceSchema>, EphemeralLayerSource {
|
|
2356
|
+
}
|
|
2357
|
+
declare const GeoJsonArrayBufferSourceSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
2358
|
+
type: z.ZodLiteral<"application/geo+json">;
|
|
2359
|
+
name: z.ZodString;
|
|
2360
|
+
geometryStyles: z.ZodOptional<z.ZodObject<{
|
|
2361
|
+
Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
2362
|
+
Line: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
2363
|
+
Polygon: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
2364
|
+
}, "strip", z.ZodTypeAny, {
|
|
2365
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2366
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2367
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2368
|
+
}, {
|
|
2369
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2370
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2371
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2372
|
+
}>>;
|
|
2373
|
+
}, {
|
|
2374
|
+
arrayBuffer: z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>;
|
|
2375
|
+
}>, "strip", z.ZodTypeAny, {
|
|
2376
|
+
type: "application/geo+json";
|
|
2377
|
+
name: string;
|
|
2378
|
+
arrayBuffer: ArrayBuffer;
|
|
2379
|
+
geometryStyles?: {
|
|
2380
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2381
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2382
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2383
|
+
} | undefined;
|
|
2384
|
+
}, {
|
|
2385
|
+
type: "application/geo+json";
|
|
2386
|
+
name: string;
|
|
2387
|
+
arrayBuffer: ArrayBuffer;
|
|
2388
|
+
geometryStyles?: {
|
|
2389
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2390
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2391
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2392
|
+
} | undefined;
|
|
2393
|
+
}>;
|
|
2394
|
+
interface GeoJsonArrayBufferSource extends zInfer<typeof GeoJsonArrayBufferSourceSchema>, EphemeralLayerSource {
|
|
2395
|
+
}
|
|
2244
2396
|
|
|
2245
2397
|
/**
|
|
2246
2398
|
* @group Filters
|
|
@@ -3552,4 +3704,4 @@ declare const ViewportFitBoundsParamsSchema: z.ZodObject<{
|
|
|
3552
3704
|
bounds: [number, number, number, number];
|
|
3553
3705
|
}>;
|
|
3554
3706
|
|
|
3555
|
-
export type {
|
|
3707
|
+
export type { CircleElementUpdate as $, GetLayerHistogramBin as A, AggregationMethod as B, GetLayerCalculationParams as C, LayerSchema as D, Element as E, Filters as F, GeoJsonGeometry as G, MapDetails as H, EntityNode as I, FeatureSelection as J, InputToolSettings as K, Layer as L, MapInteractionEvent as M, ConfigurableToolType as N, ToolSettingsMap as O, ToolSettingsChangeEvent as P, zInfer as Q, SortConfig as R, SetVisibilityRequest as S, ToolType as T, SetViewportCenterZoomParams as U, ViewportState as V, ViewportConstraints as W, ViewportFitBoundsParams as X, ViewportCenterZoom as Y, CircleElementCreate as Z, CircleElementRead as _, GetElementsConstraint as a, PinToolSettings as a$, HighlighterElementCreate as a0, HighlighterElementRead as a1, HighlighterElementUpdate as a2, ImageElementCreate as a3, ImageElementRead as a4, ImageElementUpdate as a5, LinkElementRead as a6, MarkerElementCreate as a7, MarkerElementRead as a8, MarkerElementUpdate as a9, FilterLogicGate as aA, FilterTernary as aB, AggregationConfig as aC, MultiAggregationConfig as aD, ValueConfiguration as aE, ElementGroupNode as aF, ElementNode as aG, FeatureNode as aH, LayerGroupNode as aI, LayerNode as aJ, FeltBoundary as aK, FeltZoom as aL, GeoJsonProperties as aM, LatLng as aN, LineStringGeometry as aO, LngLatTuple as aP, MultiLineStringGeometry as aQ, MultiPointGeometry as aR, MultiPolygonGeometry as aS, PointGeometry as aT, PolygonGeometry as aU, SortDirection as aV, CircleToolSettings as aW, HighlighterToolSettings as aX, LineToolSettings as aY, MarkerToolSettings as aZ, NoteToolSettings as a_, NoteElementCreate as aa, NoteElementRead as ab, NoteElementUpdate as ac, PathElementCreate as ad, PathElementRead as ae, PathElementUpdate as af, PlaceElementCreate as ag, PlaceElementRead as ah, PlaceElementUpdate as ai, PolygonElementCreate as aj, PolygonElementRead as ak, PolygonElementUpdate as al, TextElementCreate as am, TextElementRead as an, TextElementUpdate as ao, EphemeralLayerSource as ap, LayerProcessingStatus as aq, RasterValue as ar, LayerSchemaAttribute as as, LayerSchemaBooleanAttribute as at, LayerSchemaCommonAttribute as au, LayerSchemaDateAttribute as av, LayerSchemaDateTimeAttribute as aw, LayerSchemaNumericAttribute as ax, LayerSchemaTextAttribute as ay, FilterExpression as az, ElementGroup as b, PlaceFrame as b0, PlaceSymbol as b1, PolygonToolSettings as b2, RouteToolSettings as b3, TextToolSettings as b4, UnionToIntersection as b5, PromiseOrNot as b6, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, ElementCreate as f, ElementUpdate as g, GetLayersConstraint as h, LayerChangeCallbackParams as i, GeoJsonArrayBufferSource as j, GeoJsonFileSource as k, GeoJsonUrlSource as l, LayerGroup as m, GetLayerGroupsConstraint as n, LayerGroupChangeCallbackParams as o, LegendItemIdentifier as p, LegendItem as q, LegendItemsConstraint as r, LegendItemChangeCallbackParams as s, LayerFilters as t, GetRenderedFeaturesConstraint as u, LayerFeature as v, GeoJsonFeature as w, GetLayerCategoriesParams as x, GetLayerCategoriesGroup as y, GetLayerHistogramParams as z };
|
package/handler.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
1
|
+
import { z, ZodError } from 'zod';
|
|
2
|
+
import { Q as zInfer, E as Element, G as GeoJsonGeometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, m as LayerGroup, q as LegendItem, t as LayerFilters, v as LayerFeature, w as GeoJsonFeature, y as GetLayerCategoriesGroup, A as GetLayerHistogramBin, B as AggregationMethod, D as LayerSchema, i as LayerChangeCallbackParams, o as LayerGroupChangeCallbackParams, s as LegendItemChangeCallbackParams, aB as FilterTernary, H as MapDetails, I as EntityNode, T as ToolType, O as ToolSettingsMap, P as ToolSettingsChangeEvent, V as ViewportState, W as ViewportConstraints, b5 as UnionToIntersection, b6 as PromiseOrNot } from './types-PSY3LPGC.js';
|
|
3
3
|
|
|
4
4
|
type Method<TRequest extends {
|
|
5
5
|
type: string;
|
|
@@ -1669,6 +1669,252 @@ declare const SetLayerLegendVisibilityMessage: z.ZodObject<{
|
|
|
1669
1669
|
};
|
|
1670
1670
|
type: "setLayerLegendVisibility";
|
|
1671
1671
|
}>;
|
|
1672
|
+
declare const createLayerMessage: z.ZodObject<{
|
|
1673
|
+
type: z.ZodLiteral<"createLayer">;
|
|
1674
|
+
params: z.ZodObject<{
|
|
1675
|
+
source: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
|
|
1676
|
+
type: z.ZodLiteral<"application/geo+json">;
|
|
1677
|
+
name: z.ZodString;
|
|
1678
|
+
geometryStyles: z.ZodOptional<z.ZodObject<{
|
|
1679
|
+
Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
1680
|
+
Line: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
1681
|
+
Polygon: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
1682
|
+
}, "strip", z.ZodTypeAny, {
|
|
1683
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1684
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1685
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1686
|
+
}, {
|
|
1687
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1688
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1689
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1690
|
+
}>>;
|
|
1691
|
+
}, {
|
|
1692
|
+
arrayBuffer: z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>;
|
|
1693
|
+
}>, "strip", z.ZodTypeAny, {
|
|
1694
|
+
type: "application/geo+json";
|
|
1695
|
+
name: string;
|
|
1696
|
+
arrayBuffer: ArrayBuffer;
|
|
1697
|
+
geometryStyles?: {
|
|
1698
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1699
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1700
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1701
|
+
} | undefined;
|
|
1702
|
+
}, {
|
|
1703
|
+
type: "application/geo+json";
|
|
1704
|
+
name: string;
|
|
1705
|
+
arrayBuffer: ArrayBuffer;
|
|
1706
|
+
geometryStyles?: {
|
|
1707
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1708
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1709
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1710
|
+
} | undefined;
|
|
1711
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
1712
|
+
type: z.ZodLiteral<"application/geo+json">;
|
|
1713
|
+
name: z.ZodString;
|
|
1714
|
+
geometryStyles: z.ZodOptional<z.ZodObject<{
|
|
1715
|
+
Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
1716
|
+
Line: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
1717
|
+
Polygon: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
1718
|
+
}, "strip", z.ZodTypeAny, {
|
|
1719
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1720
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1721
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1722
|
+
}, {
|
|
1723
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1724
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1725
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1726
|
+
}>>;
|
|
1727
|
+
}, {
|
|
1728
|
+
file: z.ZodType<File, z.ZodTypeDef, File>;
|
|
1729
|
+
}>, "strip", z.ZodTypeAny, {
|
|
1730
|
+
type: "application/geo+json";
|
|
1731
|
+
name: string;
|
|
1732
|
+
file: File;
|
|
1733
|
+
geometryStyles?: {
|
|
1734
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1735
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1736
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1737
|
+
} | undefined;
|
|
1738
|
+
}, {
|
|
1739
|
+
type: "application/geo+json";
|
|
1740
|
+
name: string;
|
|
1741
|
+
file: File;
|
|
1742
|
+
geometryStyles?: {
|
|
1743
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1744
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1745
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1746
|
+
} | undefined;
|
|
1747
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
1748
|
+
type: z.ZodLiteral<"application/geo+json">;
|
|
1749
|
+
name: z.ZodString;
|
|
1750
|
+
geometryStyles: z.ZodOptional<z.ZodObject<{
|
|
1751
|
+
Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
1752
|
+
Line: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
1753
|
+
Polygon: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
1754
|
+
}, "strip", z.ZodTypeAny, {
|
|
1755
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1756
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1757
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1758
|
+
}, {
|
|
1759
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1760
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1761
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1762
|
+
}>>;
|
|
1763
|
+
}, {
|
|
1764
|
+
url: z.ZodString;
|
|
1765
|
+
}>, "strip", z.ZodTypeAny, {
|
|
1766
|
+
type: "application/geo+json";
|
|
1767
|
+
name: string;
|
|
1768
|
+
url: string;
|
|
1769
|
+
geometryStyles?: {
|
|
1770
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1771
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1772
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1773
|
+
} | undefined;
|
|
1774
|
+
}, {
|
|
1775
|
+
type: "application/geo+json";
|
|
1776
|
+
name: string;
|
|
1777
|
+
url: string;
|
|
1778
|
+
geometryStyles?: {
|
|
1779
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1780
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1781
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1782
|
+
} | undefined;
|
|
1783
|
+
}>]>;
|
|
1784
|
+
}, "strip", z.ZodTypeAny, {
|
|
1785
|
+
source: {
|
|
1786
|
+
type: "application/geo+json";
|
|
1787
|
+
name: string;
|
|
1788
|
+
arrayBuffer: ArrayBuffer;
|
|
1789
|
+
geometryStyles?: {
|
|
1790
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1791
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1792
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1793
|
+
} | undefined;
|
|
1794
|
+
} | {
|
|
1795
|
+
type: "application/geo+json";
|
|
1796
|
+
name: string;
|
|
1797
|
+
file: File;
|
|
1798
|
+
geometryStyles?: {
|
|
1799
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1800
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1801
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1802
|
+
} | undefined;
|
|
1803
|
+
} | {
|
|
1804
|
+
type: "application/geo+json";
|
|
1805
|
+
name: string;
|
|
1806
|
+
url: string;
|
|
1807
|
+
geometryStyles?: {
|
|
1808
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1809
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1810
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1811
|
+
} | undefined;
|
|
1812
|
+
};
|
|
1813
|
+
}, {
|
|
1814
|
+
source: {
|
|
1815
|
+
type: "application/geo+json";
|
|
1816
|
+
name: string;
|
|
1817
|
+
arrayBuffer: ArrayBuffer;
|
|
1818
|
+
geometryStyles?: {
|
|
1819
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1820
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1821
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1822
|
+
} | undefined;
|
|
1823
|
+
} | {
|
|
1824
|
+
type: "application/geo+json";
|
|
1825
|
+
name: string;
|
|
1826
|
+
file: File;
|
|
1827
|
+
geometryStyles?: {
|
|
1828
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1829
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1830
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1831
|
+
} | undefined;
|
|
1832
|
+
} | {
|
|
1833
|
+
type: "application/geo+json";
|
|
1834
|
+
name: string;
|
|
1835
|
+
url: string;
|
|
1836
|
+
geometryStyles?: {
|
|
1837
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1838
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1839
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1840
|
+
} | undefined;
|
|
1841
|
+
};
|
|
1842
|
+
}>;
|
|
1843
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
1844
|
+
params: {
|
|
1845
|
+
source: {
|
|
1846
|
+
type: "application/geo+json";
|
|
1847
|
+
name: string;
|
|
1848
|
+
arrayBuffer: ArrayBuffer;
|
|
1849
|
+
geometryStyles?: {
|
|
1850
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1851
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1852
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1853
|
+
} | undefined;
|
|
1854
|
+
} | {
|
|
1855
|
+
type: "application/geo+json";
|
|
1856
|
+
name: string;
|
|
1857
|
+
file: File;
|
|
1858
|
+
geometryStyles?: {
|
|
1859
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1860
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1861
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1862
|
+
} | undefined;
|
|
1863
|
+
} | {
|
|
1864
|
+
type: "application/geo+json";
|
|
1865
|
+
name: string;
|
|
1866
|
+
url: string;
|
|
1867
|
+
geometryStyles?: {
|
|
1868
|
+
Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1869
|
+
Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1870
|
+
Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1871
|
+
} | undefined;
|
|
1872
|
+
};
|
|
1873
|
+
};
|
|
1874
|
+
type: "createLayer";
|
|
1875
|
+
}, {
|
|
1876
|
+
params: {
|
|
1877
|
+
source: {
|
|
1878
|
+
type: "application/geo+json";
|
|
1879
|
+
name: string;
|
|
1880
|
+
arrayBuffer: ArrayBuffer;
|
|
1881
|
+
geometryStyles?: {
|
|
1882
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1883
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1884
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1885
|
+
} | undefined;
|
|
1886
|
+
} | {
|
|
1887
|
+
type: "application/geo+json";
|
|
1888
|
+
name: string;
|
|
1889
|
+
file: File;
|
|
1890
|
+
geometryStyles?: {
|
|
1891
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1892
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1893
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1894
|
+
} | undefined;
|
|
1895
|
+
} | {
|
|
1896
|
+
type: "application/geo+json";
|
|
1897
|
+
name: string;
|
|
1898
|
+
url: string;
|
|
1899
|
+
geometryStyles?: {
|
|
1900
|
+
Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1901
|
+
Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1902
|
+
Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1903
|
+
} | undefined;
|
|
1904
|
+
};
|
|
1905
|
+
};
|
|
1906
|
+
type: "createLayer";
|
|
1907
|
+
}>;
|
|
1908
|
+
declare const DeleteLayerMessage: z.ZodObject<{
|
|
1909
|
+
type: z.ZodLiteral<"deleteLayer">;
|
|
1910
|
+
params: z.ZodString;
|
|
1911
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
1912
|
+
params: string;
|
|
1913
|
+
type: "deleteLayer";
|
|
1914
|
+
}, {
|
|
1915
|
+
params: string;
|
|
1916
|
+
type: "deleteLayer";
|
|
1917
|
+
}>;
|
|
1672
1918
|
declare const GetGroupMessage: z.ZodObject<{
|
|
1673
1919
|
type: z.ZodLiteral<"getLayerGroup">;
|
|
1674
1920
|
params: z.ZodString;
|
|
@@ -2563,6 +2809,8 @@ type LayersSchema = {
|
|
|
2563
2809
|
setLayerVisibility: Method<zInfer<typeof SetLayerVisibilityMessage>, void>;
|
|
2564
2810
|
setLayerStyle: Method<zInfer<typeof SetLayerStyleMessage>, void>;
|
|
2565
2811
|
setLayerLegendVisibility: Method<zInfer<typeof SetLayerLegendVisibilityMessage>, void>;
|
|
2812
|
+
createLayer: Method<zInfer<typeof createLayerMessage>, LayerGroup | null>;
|
|
2813
|
+
deleteLayer: Method<zInfer<typeof DeleteLayerMessage>, void>;
|
|
2566
2814
|
getLayerGroup: Method<zInfer<typeof GetGroupMessage>, LayerGroup | null>;
|
|
2567
2815
|
getLayerGroups: Method<zInfer<typeof GetGroupsMessage>, Array<LayerGroup | null>>;
|
|
2568
2816
|
setLayerGroupVisibility: Method<zInfer<typeof SetLayerGroupVisibilityMessage>, void>;
|
|
@@ -3423,7 +3671,7 @@ declare function createMessageHandler(feltWindow: Window, handlers: FeltHandlers
|
|
|
3423
3671
|
*
|
|
3424
3672
|
* @param message
|
|
3425
3673
|
*/
|
|
3426
|
-
onInvalidMessage?: (message: unknown) => void;
|
|
3674
|
+
onInvalidMessage?: (message: unknown, error: ZodError) => void;
|
|
3427
3675
|
}): VoidFunction;
|
|
3428
3676
|
|
|
3429
3677
|
export { createMessageHandler };
|
package/handler.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Z=Object.defineProperty;var rt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var at=Object.prototype.hasOwnProperty;var it=(r,l)=>{for(var E in l)Z(r,E,{get:l[E],enumerable:!0})},st=(r,l,E,F)=>{if(l&&typeof l=="object"||typeof l=="function")for(let C of nt(l))!at.call(r,C)&&C!==E&&Z(r,C,{get:()=>l[C],enumerable:!(F=rt(l,C))||F.enumerable});return r};var lt=r=>st(Z({},"__esModule",{value:!0}),r);var nr={};it(nr,{createMessageHandler:()=>Ko});module.exports=lt(nr);var g=require("zod");var d=require("zod");var f=require("zod");function t(r,l){return f.z.strictObject({type:f.z.literal(r),params:l})}function S(r,l){return f.z.strictObject({eventName:f.z.literal(r),id:f.z.string(),options:l})}function m(r){return f.z.strictObject({eventName:f.z.literal(r),id:f.z.string()})}var a=require("zod"),O=a.z.number(),U=a.z.number(),N=a.z.object({latitude:U,longitude:O}),G=a.z.tuple([O,U]),ge=a.z.object({type:a.z.literal("Point"),coordinates:G}),ye=a.z.object({type:a.z.literal("Polygon"),coordinates:a.z.array(a.z.array(G))}),mt=a.z.object({type:a.z.literal("LineString"),coordinates:a.z.array(G)}),I=a.z.object({type:a.z.literal("MultiLineString"),coordinates:a.z.array(mt.shape.coordinates)}),de=a.z.number().min(1).max(23),T=a.z.tuple([O,U,O,U]),z=a.z.object({show:a.z.array(a.z.string()).optional(),hide:a.z.array(a.z.string()).optional()}),pt=a.z.enum(["asc","desc"]),ue=a.z.object({attribute:a.z.string(),direction:pt});var e=require("zod");var u=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.union([e.z.string(),e.z.null()]),description:e.z.union([e.z.string(),e.z.null()]),attributes:e.z.record(e.z.string(),e.z.unknown()),interaction:e.z.enum(["default","locked"]).optional()}),R=e.z.object({imageUrl:e.z.string().nullable()}),J=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),ct=e.z.enum(["meter","kilometer","foot","mile"]),he=u.extend(R.shape).extend({type:e.z.literal("Place"),coordinates:ge.shape.coordinates,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),W=u.extend(R.shape).extend(J.shape).extend({type:e.z.literal("Path"),coordinates:I.shape.coordinates,distanceMarker:e.z.boolean(),endCaps:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable()}),_=u.extend(R.shape).extend(J.shape).extend({type:e.z.literal("Polygon"),coordinates:I.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),fe=u.extend(R.shape).extend(J.shape).extend({type:e.z.literal("Circle"),coordinates:G,radius:e.z.number(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:ct.nullable(),fillOpacity:e.z.number().min(0).max(1),radiusMarker:e.z.boolean()}),Q=u.extend({type:e.z.literal("Marker"),coordinates:I.shape.coordinates,opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(100),zoom:e.z.number().min(0).max(23)}),$=u.extend({type:e.z.literal("Highlighter"),coordinates:I.shape.coordinates,opacity:e.z.number().min(0).max(1)}),Se=e.z.object({position:G,rotation:e.z.number(),scale:e.z.number(),zoom:e.z.number().min(0).max(23),coordinates:I.shape.coordinates}),xe=e.z.object({text:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"]),name:e.z.string()}),K=u.extend(Se.shape).extend(xe.shape).extend({type:e.z.literal("Text")}),X=u.extend(Se.shape).extend(xe.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),Y=u.extend({type:e.z.literal("Image"),coordinates:I.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),gt=u.extend({type:e.z.literal("Link"),coordinates:I.shape.coordinates,url:e.z.string()}),x={type:!0,coordinates:!0},b={id:!0},ee=he.partial().required(x).omit(b),j=W.partial().required(x).omit(b),te=_.partial().required(x).omit(b),oe=fe.partial().required(x).required({radius:!0}).omit(b),re=Q.partial().required(x).omit(b),ne=$.partial().required(x).omit(b),ae=K.partial().required(x).required({text:!0}).omit(b).omit({coordinates:!0,name:!0}),ie=X.partial().required(x).required({text:!0}).omit(b).omit({coordinates:!0,name:!0}),yt=Y.partial().required(x).required({imageUrl:!0}).omit(b),be=e.z.discriminatedUnion("type",[ee,j,te,oe,re,ne,yt,ae,ie]);var pr=W.omit({coordinates:!0}),cr=_.omit({coordinates:!0});var gr=Q.omit({coordinates:!0}),yr=$.omit({coordinates:!0}),dr=K.omit({coordinates:!0}),ur=X.omit({coordinates:!0}),hr=Y.omit({coordinates:!0}),fr=gt.omit({coordinates:!0}),M={type:!0,id:!0},dt=he.partial().required(M),ut=W.partial().required(M),ht=_.partial().required(M),ft=fe.partial().required(M),St=Q.partial().required(M),xt=$.partial().required(M),bt=K.partial().required(M).omit({coordinates:!0,name:!0}),Mt=X.partial().required(M).omit({coordinates:!0,name:!0}),Lt=Y.partial().required(M),Me=e.z.discriminatedUnion("type",[dt,ut,ht,ft,St,xt,bt,Mt,Lt]),Le=e.z.object({ids:e.z.array(e.z.string()).optional()}),Ce=e.z.object({ids:e.z.array(e.z.string()).optional()});var Ct=t("getElement",d.z.string()),Gt=t("getElementGeometry",d.z.string()),It=t("getElements",Le.optional()),Et=t("getElementGroup",d.z.string()),Tt=t("getElementGroups",Ce.optional()),zt=t("setElementGroupVisibility",z),Pt=S("onElementChange",d.z.object({id:d.z.string()})),Ft=m("onElementCreate"),kt=m("onElementCreateEnd"),vt=S("onElementDelete",d.z.object({id:d.z.string()})),wt=S("onElementGroupChange",d.z.object({id:d.z.string()})),Vt=t("createElement",be),Ot=t("updateElement",Me),Ut=t("deleteElement",d.z.string()),Ge={methods:[Ct,Gt,It,Et,Tt,zt,Vt,Ot,Ut],listeners:[Pt,Ft,kt,vt,wt]};var Nt=m("onPointerClick"),Rt=m("onPointerMove"),Ie={methods:null,listeners:[Nt,Rt]};var i=require("zod");var n=require("zod"),jt=n.z.enum(["in","ni"]),At=n.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),Ir=n.z.enum(["and","or"]),Ee=n.z.union([n.z.number(),n.z.string(),n.z.boolean(),n.z.null()]),Te=n.z.string().or(n.z.null()),qt=n.z.tuple([Te,jt,n.z.array(Ee).or(n.z.null())]),Ht=n.z.tuple([Te,At,Ee]),se=n.z.union([qt,Ht]),le=n.z.tuple([n.z.lazy(()=>n.z.union([le,se,n.z.null(),n.z.boolean()])),n.z.enum(["and","or"]),n.z.lazy(()=>n.z.union([le,se,n.z.null(),n.z.boolean()]))]),P=n.z.union([le,se,n.z.null(),n.z.boolean()]);var o=require("zod");var ze=o.z.enum(["avg","max","min","sum","median"]),Bt=o.z.object({method:ze,attribute:o.z.string()}),Dt=o.z.object({methods:o.z.array(o.z.union([ze,o.z.literal("count")])),attribute:o.z.string().optional()}),A=o.z.union([T,ye,o.z.array(G)]),Pe=o.z.object({boundary:A.optional(),filters:P.optional(),aggregation:Bt.optional()}),Fe=o.z.object({layerId:o.z.string(),attribute:o.z.string(),limit:o.z.number().optional(),boundary:A.optional(),filters:P.optional(),values:Pe.optional()}),Pr=o.z.object({key:o.z.union([o.z.number(),o.z.string(),o.z.boolean()]),value:o.z.number().nullable()}),Zt=o.z.object({type:o.z.literal("equal-intervals"),count:o.z.number()}),Jt=o.z.object({type:o.z.literal("time-interval"),interval:o.z.enum(["hour","day","week","month","year"])}),ke=o.z.object({layerId:o.z.string(),attribute:o.z.string(),steps:o.z.union([Zt,Jt,o.z.array(o.z.number())]),boundary:A.optional(),filters:P.optional(),values:Pe.optional()}),Fr=o.z.object({min:o.z.number(),max:o.z.number(),value:o.z.number()}),ve=o.z.object({layerId:o.z.string(),boundary:A.optional(),filters:P.optional(),aggregation:Dt});var s=require("zod");var wr=s.z.enum(["processing","completed","failed","incomplete"]),we=s.z.object({ids:s.z.array(s.z.string()).optional()}),Ve=s.z.object({ids:s.z.array(s.z.string()).optional()}),k=s.z.object({id:s.z.string(),layerId:s.z.string()}),Oe=s.z.object({ids:k.array().optional(),layerIds:s.z.string().array().optional()}),Ue=s.z.object({layerIds:s.z.array(s.z.string()).optional(),areaQuery:s.z.union([s.z.object({coordinates:N}),s.z.object({boundary:T})]).optional()});var Wt=t("getLayer",i.z.string()),_t=t("getLayers",we.optional()),Qt=t("setLayerVisibility",z),$t=S("onLayerChange",i.z.object({id:i.z.string()})),Kt=t("setLayerStyle",i.z.object({id:i.z.string(),style:i.z.object({}).passthrough()})),Xt=t("setLayerLegendVisibility",z),Yt=t("getLayerGroup",i.z.string()),eo=t("getLayerGroups",Ve.optional()),to=t("setLayerGroupVisibility",z),oo=t("setLayerGroupLegendVisibility",z),ro=S("onLayerGroupChange",i.z.object({id:i.z.string()})),no=t("getLegendItem",k),ao=t("getLegendItems",Oe.optional()),io=S("onLegendItemChange",k),so=t("setLegendItemVisibility",i.z.object({show:k.array().optional(),hide:k.array().optional()})),lo=t("getLayerFilters",i.z.string()),mo=t("setLayerFilters",i.z.object({layerId:i.z.string(),filters:P,note:i.z.string().optional()})),po=S("onLayerFiltersChange",i.z.object({layerId:i.z.string()})),co=t("getRenderedFeatures",Ue.optional()),go=t("getFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),yo=t("getGeoJsonFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),uo=t("getCategoryData",Fe),ho=t("getHistogramData",ke),fo=t("getAggregates",ve),So=t("getLayerSchema",i.z.string()),Ne={methods:[Wt,_t,Qt,Kt,Xt,Yt,eo,to,oo,no,ao,so,lo,mo,co,go,yo,uo,ho,fo,So],listeners:[$t,ro,io,po]};var Re=require("zod");var xo=t("getMapDetails",Re.z.undefined()),je={methods:[xo],listeners:[]};var w=require("zod");var L=require("zod"),Ae=L.z.object({id:L.z.string().or(L.z.number()),layerId:L.z.string(),showPopup:L.z.boolean().optional(),fitViewport:L.z.boolean().or(L.z.object({maxZoom:L.z.number()})).optional()});var bo=t("getSelection",w.z.undefined()),Mo=m("onSelectionChange"),Lo=t("selectFeature",Ae),Co=t("clearSelection",w.z.object({features:w.z.boolean().optional(),elements:w.z.boolean().optional()}).optional()),qe={methods:[bo,Lo,Co],listeners:[Mo]};var Je=require("zod");var p=require("zod");var He=["pin","line","route","polygon","circle","marker","highlighter","text","note"],Be=p.z.enum([...He,"link"]),De=p.z.enum(He),Go=ee.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:p.z.enum(["enter name","add another","select"])}).required(),Io=j.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),Eo=j.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),To=te.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),zo=oe.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),Po=re.pick({color:!0,opacity:!0,size:!0}).required(),Fo=ne.pick({color:!0,opacity:!0}).extend({size:p.z.number().min(0).max(200)}).required(),ko=ae.pick({color:!0,align:!0,style:!0}).required(),vo=ie.pick({color:!0,align:!0,style:!0}).required(),Ze=p.z.discriminatedUnion("tool",[Go.partial().extend({tool:p.z.literal("pin")}),Io.partial().extend({tool:p.z.literal("line")}),Eo.partial().extend({tool:p.z.literal("route")}),To.partial().extend({tool:p.z.literal("polygon")}),zo.partial().extend({tool:p.z.literal("circle")}),Po.partial().extend({tool:p.z.literal("marker")}),Fo.partial().extend({tool:p.z.literal("highlighter")}),ko.partial().extend({tool:p.z.literal("text")}),vo.partial().extend({tool:p.z.literal("note")})]);var wo=t("setTool",Be.nullable()),Vo=t("getTool",Je.z.undefined()),Oo=m("onToolChange"),Uo=t("setToolSettings",Ze),No=t("getToolSettings",De),Ro=m("onToolSettingsChange"),We={methods:[wo,Vo,Uo,No],listeners:[Oo,Ro]};var q=require("zod");var c=require("zod"),_e=c.z.object({showLegend:c.z.boolean().optional(),cooperativeGestures:c.z.boolean().optional(),fullScreenButton:c.z.boolean().optional(),geolocation:c.z.boolean().optional(),zoomControls:c.z.boolean().optional(),scaleBar:c.z.boolean().optional()}),Qe=c.z.object({featureSelectPanel:c.z.boolean().optional(),featureHoverPanel:c.z.boolean().optional(),elementSelectPanel:c.z.boolean().optional(),linkClickOpen:c.z.boolean().optional(),imageLightboxOpen:c.z.boolean().optional()});var jo=t("updateUiControls",_e),Ao=t("setOnMapInteractionsUi",Qe),qo=t("showLayerDataTable",q.z.object({layerId:q.z.string(),sorting:ue.optional()}).optional()),Ho=t("hideLayerDataTable",q.z.undefined()),$e={methods:[jo,Ao,qo,Ho],listeners:null};var me=require("zod");var V=require("zod");var H=V.z.object({center:N,zoom:de}),Ke=V.z.object({center:H.shape.center.optional(),zoom:H.shape.zoom.optional()}),Xe=V.z.object({minZoom:H.shape.zoom.nullish(),maxZoom:H.shape.zoom.nullish(),bounds:T.nullish()}).nullable(),Ye=V.z.object({bounds:T});var Bo=t("getViewport",me.z.undefined()),Do=t("setViewport",Ke),Zo=t("getViewportConstraints",me.z.undefined()),Jo=t("setViewportConstraints",Xe),Wo=t("fitViewportToBounds",Ye),_o=m("onViewportMove"),Qo=m("onViewportMoveEnd"),$o=m("onMapIdle"),et={methods:[Do,Bo,Zo,Jo,Wo],listeners:[_o,Qo,$o]};var pe=[$e,et,Ne,Ge,qe,Ie,We,je];function Ko(r,l,E){let F=new Map;async function C(h){if(!rr.safeParse(h.data).success){E?.onUnknownMessage?.(h.data);return}let ce=ot.safeParse(h.data);if(!ce.success){E?.onInvalidMessage?.(h.data);return}let{data:y}=ce;if(y.type==="felt.ready")h.ports[0]?.postMessage(!0);else if(y.type==="felt.addListener"){if(y.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let v="options"in y.event?{options:"options"in y.event?y.event.options:void 0,handler:D=>{h.ports[0]?.postMessage(D)}}:{handler:D=>{h.ports[0]?.postMessage(D)}},B=l.listeners[y.event.eventName](v);F.set(y.event.id,B)}else if(y.type==="felt.removeListener")F.get(y.id)?.(),F.delete(y.id);else try{let v=l.methods[y.type],B=await v(y.params);h.ports[0]?.postMessage(B)}catch(v){h.ports[0]?.postMessage({__error__:Xo(v)})}}return r.addEventListener("message",C),()=>{r.removeEventListener("message",C)}}function Xo(r){return r instanceof Error?r.message:typeof r=="object"&&r!==null&&"message"in r?String(r.message):typeof r=="string"?r:"Unknown error"}var tt={methods:pe.map(r=>r.methods??[]).flat(),listeners:pe.map(r=>r.listeners??[]).flat()},Yo=g.z.discriminatedUnion("eventName",[g.z.strictObject({eventName:g.z.literal("")}),...tt.listeners]),er=g.z.strictObject({type:g.z.literal("felt.addListener"),event:Yo}),tr=g.z.strictObject({type:g.z.literal("felt.removeListener"),id:g.z.string()}),or=g.z.strictObject({type:g.z.literal("felt.ready")}),ot=g.z.discriminatedUnion("type",[or,er,tr,...tt.methods]),rr=g.z.object({type:g.z.enum(ot.options.map(r=>r.shape.type.value))});0&&(module.exports={createMessageHandler});
|
|
1
|
+
"use strict";var J=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var it=Object.getOwnPropertyNames;var st=Object.prototype.hasOwnProperty;var lt=(r,l)=>{for(var E in l)J(r,E,{get:l[E],enumerable:!0})},mt=(r,l,E,F)=>{if(l&&typeof l=="object"||typeof l=="function")for(let C of it(l))!st.call(r,C)&&C!==E&&J(r,C,{get:()=>l[C],enumerable:!(F=at(l,C))||F.enumerable});return r};var pt=r=>mt(J({},"__esModule",{value:!0}),r);var yr={};lt(yr,{createMessageHandler:()=>ar});module.exports=pt(yr);var y=require("zod");var d=require("zod");var f=require("zod");function t(r,l){return f.z.strictObject({type:f.z.literal(r),params:l})}function S(r,l){return f.z.strictObject({eventName:f.z.literal(r),id:f.z.string(),options:l})}function m(r){return f.z.strictObject({eventName:f.z.literal(r),id:f.z.string()})}var s=require("zod"),O=s.z.number(),U=s.z.number(),j=s.z.object({latitude:U,longitude:O}),G=s.z.tuple([O,U]),ge=s.z.object({type:s.z.literal("Point"),coordinates:G}),de=s.z.object({type:s.z.literal("Polygon"),coordinates:s.z.array(s.z.array(G))}),ct=s.z.object({type:s.z.literal("LineString"),coordinates:s.z.array(G)}),I=s.z.object({type:s.z.literal("MultiLineString"),coordinates:s.z.array(ct.shape.coordinates)}),ue=s.z.number().min(1).max(23),T=s.z.tuple([O,U,O,U]),z=s.z.object({show:s.z.array(s.z.string()).optional(),hide:s.z.array(s.z.string()).optional()}),yt=s.z.enum(["asc","desc"]),he=s.z.object({attribute:s.z.string(),direction:yt});var e=require("zod");var u=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.union([e.z.string(),e.z.null()]),description:e.z.union([e.z.string(),e.z.null()]),attributes:e.z.record(e.z.string(),e.z.unknown()),interaction:e.z.enum(["default","locked"]).optional()}),N=e.z.object({imageUrl:e.z.string().nullable()}),W=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),gt=e.z.enum(["meter","kilometer","foot","mile"]),fe=u.extend(N.shape).extend({type:e.z.literal("Place"),coordinates:ge.shape.coordinates,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),_=u.extend(N.shape).extend(W.shape).extend({type:e.z.literal("Path"),coordinates:I.shape.coordinates,distanceMarker:e.z.boolean(),endCaps:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable()}),Q=u.extend(N.shape).extend(W.shape).extend({type:e.z.literal("Polygon"),coordinates:I.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),Se=u.extend(N.shape).extend(W.shape).extend({type:e.z.literal("Circle"),coordinates:G,radius:e.z.number(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:gt.nullable(),fillOpacity:e.z.number().min(0).max(1),radiusMarker:e.z.boolean()}),$=u.extend({type:e.z.literal("Marker"),coordinates:I.shape.coordinates,opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(100),zoom:e.z.number().min(0).max(23)}),K=u.extend({type:e.z.literal("Highlighter"),coordinates:I.shape.coordinates,opacity:e.z.number().min(0).max(1)}),xe=e.z.object({position:G,rotation:e.z.number(),scale:e.z.number(),zoom:e.z.number().min(0).max(23),coordinates:I.shape.coordinates}),be=e.z.object({text:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"]),name:e.z.string()}),X=u.extend(xe.shape).extend(be.shape).extend({type:e.z.literal("Text")}),Y=u.extend(xe.shape).extend(be.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),ee=u.extend({type:e.z.literal("Image"),coordinates:I.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),dt=u.extend({type:e.z.literal("Link"),coordinates:I.shape.coordinates,url:e.z.string()}),x={type:!0,coordinates:!0},b={id:!0},te=fe.partial().required(x).omit(b),R=_.partial().required(x).omit(b),oe=Q.partial().required(x).omit(b),re=Se.partial().required(x).required({radius:!0}).omit(b),ne=$.partial().required(x).omit(b),ae=K.partial().required(x).omit(b),ie=X.partial().required(x).required({text:!0}).omit(b).omit({coordinates:!0,name:!0}),se=Y.partial().required(x).required({text:!0}).omit(b).omit({coordinates:!0,name:!0}),ut=ee.partial().required(x).required({imageUrl:!0}).omit(b),Me=e.z.discriminatedUnion("type",[te,R,oe,re,ne,ae,ut,ie,se]);var Sr=_.omit({coordinates:!0}),xr=Q.omit({coordinates:!0});var br=$.omit({coordinates:!0}),Mr=K.omit({coordinates:!0}),Lr=X.omit({coordinates:!0}),Cr=Y.omit({coordinates:!0}),Gr=ee.omit({coordinates:!0}),Ir=dt.omit({coordinates:!0}),M={type:!0,id:!0},ht=fe.partial().required(M),ft=_.partial().required(M),St=Q.partial().required(M),xt=Se.partial().required(M),bt=$.partial().required(M),Mt=K.partial().required(M),Lt=X.partial().required(M).omit({coordinates:!0,name:!0}),Ct=Y.partial().required(M).omit({coordinates:!0,name:!0}),Gt=ee.partial().required(M),Le=e.z.discriminatedUnion("type",[ht,ft,St,xt,bt,Mt,Lt,Ct,Gt]),Ce=e.z.object({ids:e.z.array(e.z.string()).optional()}),Ge=e.z.object({ids:e.z.array(e.z.string()).optional()});var It=t("getElement",d.z.string()),Et=t("getElementGeometry",d.z.string()),Tt=t("getElements",Ce.optional()),zt=t("getElementGroup",d.z.string()),Pt=t("getElementGroups",Ge.optional()),Ft=t("setElementGroupVisibility",z),kt=S("onElementChange",d.z.object({id:d.z.string()})),vt=m("onElementCreate"),wt=m("onElementCreateEnd"),Vt=S("onElementDelete",d.z.object({id:d.z.string()})),Ot=S("onElementGroupChange",d.z.object({id:d.z.string()})),Ut=t("createElement",Me),jt=t("updateElement",Le),Nt=t("deleteElement",d.z.string()),Ie={methods:[It,Et,Tt,zt,Pt,Ft,Ut,jt,Nt],listeners:[kt,vt,wt,Vt,Ot]};var Rt=m("onPointerClick"),At=m("onPointerMove"),Ee={methods:null,listeners:[Rt,At]};var i=require("zod");var a=require("zod"),qt=a.z.enum(["in","ni"]),Bt=a.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),wr=a.z.enum(["and","or"]),Te=a.z.union([a.z.number(),a.z.string(),a.z.boolean(),a.z.null()]),ze=a.z.string().or(a.z.null()),Ht=a.z.tuple([ze,qt,a.z.array(Te).or(a.z.null())]),Dt=a.z.tuple([ze,Bt,Te]),le=a.z.union([Ht,Dt]),me=a.z.tuple([a.z.lazy(()=>a.z.union([me,le,a.z.null(),a.z.boolean()])),a.z.enum(["and","or"]),a.z.lazy(()=>a.z.union([me,le,a.z.null(),a.z.boolean()]))]),P=a.z.union([me,le,a.z.null(),a.z.boolean()]);var o=require("zod");var Pe=o.z.enum(["avg","max","min","sum","median"]),Zt=o.z.object({method:Pe,attribute:o.z.string()}),Jt=o.z.object({methods:o.z.array(o.z.union([Pe,o.z.literal("count")])),attribute:o.z.string().optional()}),A=o.z.union([T,de,o.z.array(G)]),Fe=o.z.object({boundary:A.optional(),filters:P.optional(),aggregation:Zt.optional()}),ke=o.z.object({layerId:o.z.string(),attribute:o.z.string(),limit:o.z.number().optional(),boundary:A.optional(),filters:P.optional(),values:Fe.optional()}),jr=o.z.object({key:o.z.union([o.z.number(),o.z.string(),o.z.boolean()]),value:o.z.number().nullable()}),Wt=o.z.object({type:o.z.literal("equal-intervals"),count:o.z.number()}),_t=o.z.object({type:o.z.literal("time-interval"),interval:o.z.enum(["hour","day","week","month","year"])}),ve=o.z.object({layerId:o.z.string(),attribute:o.z.string(),steps:o.z.union([Wt,_t,o.z.array(o.z.number())]),boundary:A.optional(),filters:P.optional(),values:Fe.optional()}),Nr=o.z.object({min:o.z.number(),max:o.z.number(),value:o.z.number()}),we=o.z.object({layerId:o.z.string(),boundary:A.optional(),filters:P.optional(),aggregation:Jt});var n=require("zod");var qr=n.z.enum(["processing","completed","failed","incomplete"]),Ve=n.z.object({ids:n.z.array(n.z.string()).optional()}),Oe=n.z.object({ids:n.z.array(n.z.string()).optional()}),k=n.z.object({id:n.z.string(),layerId:n.z.string()}),Ue=n.z.object({ids:k.array().optional(),layerIds:n.z.string().array().optional()}),je=n.z.object({layerIds:n.z.array(n.z.string()).optional(),areaQuery:n.z.union([n.z.object({coordinates:j}),n.z.object({boundary:T})]).optional()}),Qt=n.z.object({Point:n.z.object({}).passthrough().optional(),Line:n.z.object({}).passthrough().optional(),Polygon:n.z.object({}).passthrough().optional()}),pe=n.z.object({type:n.z.literal("application/geo+json"),name:n.z.string(),geometryStyles:Qt.optional()}),$t=pe.extend({file:n.z.instanceof(File)}),Kt=pe.extend({url:n.z.string().url()}),Xt=pe.extend({arrayBuffer:n.z.instanceof(ArrayBuffer)}),Ne=n.z.union([Xt,$t,Kt]);var Yt=t("getLayer",i.z.string()),eo=t("getLayers",Ve.optional()),to=t("setLayerVisibility",z),oo=S("onLayerChange",i.z.object({id:i.z.string()})),ro=t("setLayerStyle",i.z.object({id:i.z.string(),style:i.z.object({}).passthrough()})),no=t("setLayerLegendVisibility",z),ao=t("createLayer",i.z.object({source:Ne})),io=t("deleteLayer",i.z.string()),so=t("getLayerGroup",i.z.string()),lo=t("getLayerGroups",Oe.optional()),mo=t("setLayerGroupVisibility",z),po=t("setLayerGroupLegendVisibility",z),co=S("onLayerGroupChange",i.z.object({id:i.z.string()})),yo=t("getLegendItem",k),go=t("getLegendItems",Ue.optional()),uo=S("onLegendItemChange",k),ho=t("setLegendItemVisibility",i.z.object({show:k.array().optional(),hide:k.array().optional()})),fo=t("getLayerFilters",i.z.string()),So=t("setLayerFilters",i.z.object({layerId:i.z.string(),filters:P,note:i.z.string().optional()})),xo=S("onLayerFiltersChange",i.z.object({layerId:i.z.string()})),bo=t("getRenderedFeatures",je.optional()),Mo=t("getFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),Lo=t("getGeoJsonFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),Co=t("getCategoryData",ke),Go=t("getHistogramData",ve),Io=t("getAggregates",we),Eo=t("getLayerSchema",i.z.string()),Re={methods:[Yt,eo,to,ro,no,ao,io,so,lo,mo,po,yo,go,ho,fo,So,bo,Mo,Lo,Co,Go,Io,Eo],listeners:[oo,co,uo,xo]};var Ae=require("zod");var To=t("getMapDetails",Ae.z.undefined()),qe={methods:[To],listeners:[]};var w=require("zod");var L=require("zod"),Be=L.z.object({id:L.z.string().or(L.z.number()),layerId:L.z.string(),showPopup:L.z.boolean().optional(),fitViewport:L.z.boolean().or(L.z.object({maxZoom:L.z.number()})).optional()});var zo=t("getSelection",w.z.undefined()),Po=m("onSelectionChange"),Fo=t("selectFeature",Be),ko=t("clearSelection",w.z.object({features:w.z.boolean().optional(),elements:w.z.boolean().optional()}).optional()),He={methods:[zo,Fo,ko],listeners:[Po]};var _e=require("zod");var p=require("zod");var De=["pin","line","route","polygon","circle","marker","highlighter","text","note"],Ze=p.z.enum([...De,"link"]),Je=p.z.enum(De),vo=te.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:p.z.enum(["enter name","add another","select"])}).required(),wo=R.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),Vo=R.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),Oo=oe.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),Uo=re.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),jo=ne.pick({color:!0,opacity:!0,size:!0}).required(),No=ae.pick({color:!0,opacity:!0}).extend({size:p.z.number().min(0).max(200)}).required(),Ro=ie.pick({color:!0,align:!0,style:!0}).required(),Ao=se.pick({color:!0,align:!0,style:!0}).required(),We=p.z.discriminatedUnion("tool",[vo.partial().extend({tool:p.z.literal("pin")}),wo.partial().extend({tool:p.z.literal("line")}),Vo.partial().extend({tool:p.z.literal("route")}),Oo.partial().extend({tool:p.z.literal("polygon")}),Uo.partial().extend({tool:p.z.literal("circle")}),jo.partial().extend({tool:p.z.literal("marker")}),No.partial().extend({tool:p.z.literal("highlighter")}),Ro.partial().extend({tool:p.z.literal("text")}),Ao.partial().extend({tool:p.z.literal("note")})]);var qo=t("setTool",Ze.nullable()),Bo=t("getTool",_e.z.undefined()),Ho=m("onToolChange"),Do=t("setToolSettings",We),Zo=t("getToolSettings",Je),Jo=m("onToolSettingsChange"),Qe={methods:[qo,Bo,Do,Zo],listeners:[Ho,Jo]};var q=require("zod");var c=require("zod"),$e=c.z.object({showLegend:c.z.boolean().optional(),cooperativeGestures:c.z.boolean().optional(),fullScreenButton:c.z.boolean().optional(),geolocation:c.z.boolean().optional(),zoomControls:c.z.boolean().optional(),scaleBar:c.z.boolean().optional()}),Ke=c.z.object({featureSelectPanel:c.z.boolean().optional(),featureHoverPanel:c.z.boolean().optional(),elementSelectPanel:c.z.boolean().optional(),linkClickOpen:c.z.boolean().optional(),imageLightboxOpen:c.z.boolean().optional()});var Wo=t("updateUiControls",$e),_o=t("setOnMapInteractionsUi",Ke),Qo=t("showLayerDataTable",q.z.object({layerId:q.z.string(),sorting:he.optional()}).optional()),$o=t("hideLayerDataTable",q.z.undefined()),Xe={methods:[Wo,_o,Qo,$o],listeners:null};var ce=require("zod");var V=require("zod");var B=V.z.object({center:j,zoom:ue}),Ye=V.z.object({center:B.shape.center.optional(),zoom:B.shape.zoom.optional()}),et=V.z.object({minZoom:B.shape.zoom.nullish(),maxZoom:B.shape.zoom.nullish(),bounds:T.nullish()}).nullable(),tt=V.z.object({bounds:T});var Ko=t("getViewport",ce.z.undefined()),Xo=t("setViewport",Ye),Yo=t("getViewportConstraints",ce.z.undefined()),er=t("setViewportConstraints",et),tr=t("fitViewportToBounds",tt),or=m("onViewportMove"),rr=m("onViewportMoveEnd"),nr=m("onMapIdle"),ot={methods:[Xo,Ko,Yo,er,tr],listeners:[or,rr,nr]};var ye=[Xe,ot,Re,Ie,He,Ee,Qe,qe];function ar(r,l,E){let F=new Map;async function C(h){if(!cr.safeParse(h.data).success){E?.onUnknownMessage?.(h.data);return}let H=nt.safeParse(h.data);if(!H.success){E?.onInvalidMessage?.(h.data,H.error);return}let{data:g}=H;if(g.type==="felt.ready")h.ports[0]?.postMessage(!0);else if(g.type==="felt.addListener"){if(g.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let v="options"in g.event?{options:"options"in g.event?g.event.options:void 0,handler:Z=>{h.ports[0]?.postMessage(Z)}}:{handler:Z=>{h.ports[0]?.postMessage(Z)}},D=l.listeners[g.event.eventName](v);F.set(g.event.id,D)}else if(g.type==="felt.removeListener")F.get(g.id)?.(),F.delete(g.id);else try{let v=l.methods[g.type],D=await v(g.params);h.ports[0]?.postMessage(D)}catch(v){h.ports[0]?.postMessage({__error__:ir(v)})}}return r.addEventListener("message",C),()=>{r.removeEventListener("message",C)}}function ir(r){return r instanceof Error?r.message:typeof r=="object"&&r!==null&&"message"in r?String(r.message):typeof r=="string"?r:"Unknown error"}var rt={methods:ye.map(r=>r.methods??[]).flat(),listeners:ye.map(r=>r.listeners??[]).flat()},sr=y.z.discriminatedUnion("eventName",[y.z.strictObject({eventName:y.z.literal("")}),...rt.listeners]),lr=y.z.strictObject({type:y.z.literal("felt.addListener"),event:sr}),mr=y.z.strictObject({type:y.z.literal("felt.removeListener"),id:y.z.string()}),pr=y.z.strictObject({type:y.z.literal("felt.ready")}),nt=y.z.discriminatedUnion("type",[pr,lr,mr,...rt.methods]),cr=y.z.object({type:y.z.enum(nt.options.map(r=>r.shape.type.value))});0&&(module.exports={createMessageHandler});
|