@agentic-ui-experience/ui-arcgis 0.0.1-beta.3 → 0.0.1-beta.5
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/README.md +148 -4
- package/dist/ArcGISMapGraphicsController.d.ts +44 -0
- package/dist/ArcGISMapGraphicsController.js +1 -0
- package/dist/ArcGISMapView.d.ts +17 -2
- package/dist/ArcGISMapView.js +1 -1
- package/dist/api.d.ts +549 -0
- package/dist/api.js +1 -1
- package/dist/catalog.d.ts +324 -0
- package/dist/catalog.js +1 -1
- package/dist/controller/api.d.ts +320 -42
- package/dist/controller/api.js +1 -1
- package/dist/controller/createArcGISMapController.js +1 -1
- package/dist/controller/featureFilter.d.ts +425 -0
- package/dist/controller/featureFilter.js +1 -0
- package/dist/controller/featureFilterExpression.d.ts +16 -0
- package/dist/controller/featureFilterExpression.js +1 -0
- package/dist/controller/featureFilterRuntime.d.ts +19 -0
- package/dist/controller/featureFilterRuntime.js +1 -0
- package/dist/controller/featureQuery.d.ts +275 -0
- package/dist/controller/featureQuery.js +1 -0
- package/dist/controller/featureQueryExpression.d.ts +16 -0
- package/dist/controller/featureQueryExpression.js +1 -0
- package/dist/controller/featureQueryRuntime.d.ts +12 -0
- package/dist/controller/featureQueryRuntime.js +1 -0
- package/dist/controller/useArcGISMapController.js +1 -1
- package/dist/graphics.d.ts +38 -0
- package/dist/graphics.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/prompt.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@ The package provides the `ArcGISMapView` component, its schema and Agent
|
|
|
8
8
|
metadata, and ready-made catalog projections. It does not proxy or re-export
|
|
9
9
|
the generic APIs from the foundational UI packages.
|
|
10
10
|
|
|
11
|
+
In this document, **Catalog**, **Runtime**, **Renderer**, and **Host app** follow the definitions in the [project glossary](../../docs/glossary.md). `ui-arcgis` extends the UI stack; A2UI remains the upstream basis of the UI Spec.
|
|
12
|
+
|
|
11
13
|
## Package role
|
|
12
14
|
|
|
13
15
|
```text
|
|
@@ -93,10 +95,10 @@ import {
|
|
|
93
95
|
} from "@agentic-ui-experience/ui-arcgis";
|
|
94
96
|
```
|
|
95
97
|
|
|
96
|
-
-
|
|
98
|
+
- Pass `arcgisPromptDescriptor` to the agent-side `createUIToolCatalog`.
|
|
97
99
|
- Register `arcgisRuntimeCatalog` with a non-React runtime.
|
|
98
|
-
- Pass `arcgisReactCatalog` to `useUIRuntime({
|
|
99
|
-
application.
|
|
100
|
+
- Pass `arcgisReactCatalog` to `useUIRuntime({ catalog: arcgisReactCatalog })`
|
|
101
|
+
in a React application.
|
|
100
102
|
|
|
101
103
|
All three projections include the A2UI basic catalog capabilities.
|
|
102
104
|
|
|
@@ -123,6 +125,85 @@ The hook waits for the component view, exposes serializable snapshots plus
|
|
|
123
125
|
`goTo` and `setLayerVisibility`, and removes its watches on unmount. It does
|
|
124
126
|
not render or destroy the host element. This controller API is separate from
|
|
125
127
|
the A2UI `ArcGISMapView`, which remains a display-only catalog component.
|
|
128
|
+
`execute(command, { signal, origin }?)` forwards cancellation to navigation and
|
|
129
|
+
checks the signal immediately around every map mutation. Cancelled operations
|
|
130
|
+
return the controller's typed `cancelled` failure instead of reporting success.
|
|
131
|
+
`origin` is an optional generic `{ transactionId, operationId }` identity; each
|
|
132
|
+
trimmed identifier is limited to 128 characters. It lets a host correlate
|
|
133
|
+
controller feedback with one exact transaction without coupling the package to
|
|
134
|
+
an application runtime.
|
|
135
|
+
|
|
136
|
+
`subscribe(listener)` publishes strict snapshot notifications with:
|
|
137
|
+
|
|
138
|
+
- `snapshot`: the complete serializable live map snapshot read at frame time;
|
|
139
|
+
- `operationOrigins`: at most 16 unique valid origins that explain mutations in
|
|
140
|
+
that frame; and
|
|
141
|
+
- `hasExternalChanges`: `true` whenever any observable change is not explained
|
|
142
|
+
by the controller's bounded mutation evidence.
|
|
143
|
+
|
|
144
|
+
The controller coalesces ordered visibility writes in one animation frame and
|
|
145
|
+
deduplicates repeated origins. It does not claim navigation interpolation from
|
|
146
|
+
viewpoint values alone. A navigation carrying a valid origin calls ArcGIS
|
|
147
|
+
`goTo` with `animate: false`; only its unchanged baseline or requested target
|
|
148
|
+
can remain a candidate for ownership until the matching promise and terminal
|
|
149
|
+
snapshot authenticate the origin. The viewpoint watcher latches any non-target
|
|
150
|
+
value as external even if another write restores the target before publication.
|
|
151
|
+
Navigation without an origin omits the animation option and keeps the ArcGIS
|
|
152
|
+
SDK's default behavior; its viewpoint feedback remains external.
|
|
153
|
+
Replacing the actual host map object retires queued evidence even when the old
|
|
154
|
+
and new maps share an item ID or omit item IDs.
|
|
155
|
+
|
|
156
|
+
Consumers must treat origins as hints scoped to the exact transaction that
|
|
157
|
+
created them, never as general snapshot ownership. A notification with
|
|
158
|
+
`hasExternalChanges: true` must always take the fail-closed reconciliation path,
|
|
159
|
+
even when it also contains one or more recognized origins.
|
|
160
|
+
|
|
161
|
+
### Structured feature filtering
|
|
162
|
+
|
|
163
|
+
The controller also exposes three serializable feature methods for host-owned
|
|
164
|
+
feature layers:
|
|
165
|
+
|
|
166
|
+
- `describeFeatureLayer(layerId, options?)` verifies that a layer view is
|
|
167
|
+
available without changing its filter, then returns the layer id, title,
|
|
168
|
+
and live field names, aliases, and ArcGIS field types.
|
|
169
|
+
- `setFeatureFilter(request, options?)` validates structured predicates,
|
|
170
|
+
counts the matching features, and applies one controller-owned filter for
|
|
171
|
+
the layer. A success includes the normalized request and
|
|
172
|
+
`matchedFeatureCount`, including when that count is zero.
|
|
173
|
+
- `clearFeatureFilter({ layerId }, options?)` clears one controller-owned filter, or all
|
|
174
|
+
controller-owned filters when `layerId` is `null`, and reports the layer ids
|
|
175
|
+
actually cleared. A pre-aborted clear performs no mutation.
|
|
176
|
+
|
|
177
|
+
A set request has one `layerId`, `logic: "and" | "or"`, and one to eight
|
|
178
|
+
predicates. Each predicate has an exact live `fieldName`, an `operator`, and
|
|
179
|
+
zero to 50 string or finite-number `values`; strings are limited to 256
|
|
180
|
+
characters. Supported field categories are numeric, string, GUID/global ID,
|
|
181
|
+
and date/time. The operators are:
|
|
182
|
+
|
|
183
|
+
- `eq` and `ne`: numeric, string, identifier, or date/time fields; exactly one
|
|
184
|
+
value.
|
|
185
|
+
- `gt`, `gte`, `lt`, and `lte`: numeric or date/time fields; exactly one value.
|
|
186
|
+
- `between`: numeric or date/time fields; exactly two values.
|
|
187
|
+
- `in`: numeric, string, or GUID/global ID fields; one to 50 values.
|
|
188
|
+
- `contains` and `starts_with`: string fields; exactly one string value.
|
|
189
|
+
- `is_null` and `is_not_null`: every supported field category; no values.
|
|
190
|
+
|
|
191
|
+
`date` field values must be ISO instants with `Z` or an explicit offset and
|
|
192
|
+
second precision; fractional seconds are rejected rather than truncated.
|
|
193
|
+
|
|
194
|
+
The controller compiles these predicates internally. Raw expressions and
|
|
195
|
+
ArcGIS SDK objects are never public inputs or results.
|
|
196
|
+
|
|
197
|
+
Feature filters are transient and view-local. On the first set for a layer,
|
|
198
|
+
the controller clones the host's existing layer-view filter as its baseline.
|
|
199
|
+
It composes the structured predicate with the baseline `where` using `AND` and
|
|
200
|
+
preserves the baseline object ids, geometry, spatial relationship, distance,
|
|
201
|
+
units, and time extent. It queries the combined candidate count before
|
|
202
|
+
swapping the view filter; validation, count, cancellation, or apply failures
|
|
203
|
+
leave the old filter unchanged. A later set replaces only the
|
|
204
|
+
controller-owned predicate. Clear and controller disposal restore a clone of
|
|
205
|
+
the original host baseline. Nothing is written to the WebMap, and no filter
|
|
206
|
+
survives controller disposal or a newly mounted view.
|
|
126
207
|
|
|
127
208
|
### Reference application
|
|
128
209
|
|
|
@@ -186,6 +267,7 @@ application needs.
|
|
|
186
267
|
|
|
187
268
|
- `title?`, `description?`
|
|
188
269
|
- `source`: required `webmap` or `basemap` source
|
|
270
|
+
- `graphics?`: declarative point, polyline, or polygon Graphics
|
|
189
271
|
- `controls?`: `zoom`, `legend`, `layerList`, and `search`
|
|
190
272
|
- `height?`: 180–640 pixels; defaults to 280
|
|
191
273
|
- `openInArcGIS?`: show the open-in-ArcGIS action
|
|
@@ -217,7 +299,69 @@ Basemap source:
|
|
|
217
299
|
Other basemap values are `arcgis/topographic`, `arcgis/streets`,
|
|
218
300
|
`arcgis/navigation`, `arcgis/light-gray`, `arcgis/dark-gray`,
|
|
219
301
|
`arcgis/imagery`, and `arcgis/outdoor`. Omitting `basemap` defaults to
|
|
220
|
-
`
|
|
302
|
+
`portal/default`.
|
|
303
|
+
|
|
304
|
+
The `arcgis/*` values use the production ArcGIS Basemap Styles service. The
|
|
305
|
+
Host app must configure a compatible ArcGIS Online credential or a Basemap
|
|
306
|
+
Styles API key before using them. Prefer `portal/default` for applications
|
|
307
|
+
configured against another portal environment.
|
|
308
|
+
|
|
309
|
+
### Declarative Graphics
|
|
310
|
+
|
|
311
|
+
`graphics` displays a small set of temporary points, polylines, and polygons:
|
|
312
|
+
|
|
313
|
+
```json
|
|
314
|
+
{
|
|
315
|
+
"source": {
|
|
316
|
+
"type": "basemap",
|
|
317
|
+
"center": { "latitude": 39.9042, "longitude": 116.4074 },
|
|
318
|
+
"zoom": 8
|
|
319
|
+
},
|
|
320
|
+
"graphics": [
|
|
321
|
+
{
|
|
322
|
+
"geometry": {
|
|
323
|
+
"type": "point",
|
|
324
|
+
"coordinates": { "longitude": 116.4074, "latitude": 39.9042 }
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"geometry": {
|
|
329
|
+
"type": "polyline",
|
|
330
|
+
"coordinates": [
|
|
331
|
+
{ "longitude": 116.3, "latitude": 39.9 },
|
|
332
|
+
{ "longitude": 116.5, "latitude": 39.95 }
|
|
333
|
+
]
|
|
334
|
+
},
|
|
335
|
+
"style": "warning"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"geometry": {
|
|
339
|
+
"type": "polygon",
|
|
340
|
+
"coordinates": [
|
|
341
|
+
{ "longitude": 116.3, "latitude": 39.8 },
|
|
342
|
+
{ "longitude": 116.5, "latitude": 39.8 },
|
|
343
|
+
{ "longitude": 116.5, "latitude": 40.0 }
|
|
344
|
+
]
|
|
345
|
+
},
|
|
346
|
+
"style": "danger"
|
|
347
|
+
}
|
|
348
|
+
]
|
|
349
|
+
}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
Every position is a WGS84 `{ longitude, latitude }` object. A polyline has one
|
|
353
|
+
path with at least two positions. A polygon has one outer ring with at least
|
|
354
|
+
three positions; the Renderer closes an open ring. `graphics` accepts at most
|
|
355
|
+
50 items.
|
|
356
|
+
|
|
357
|
+
`style` is `primary`, `success`, `warning`, `danger`, or `neutral` and defaults
|
|
358
|
+
to `primary`. Non-empty Graphics fit automatically, with zoom capped at 14.
|
|
359
|
+
Empty or absent Graphics keep the source viewpoint.
|
|
360
|
+
|
|
361
|
+
The contract does not accept ArcGIS SDK objects, custom symbols, attributes,
|
|
362
|
+
popups, labels, layers, queries, filters, selections, editing, or Actions.
|
|
363
|
+
The ready-made ArcGIS Catalog uses the v2 ID; a Surface created against v1 is
|
|
364
|
+
not compatible with the v2 schema.
|
|
221
365
|
|
|
222
366
|
## Verify
|
|
223
367
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ArcgisMap } from "@arcgis/map-components/components/arcgis-map/customElement";
|
|
2
|
+
import type { NormalizedArcGISMapGraphic } from "./api.js";
|
|
3
|
+
type GraphicLike = object;
|
|
4
|
+
type GraphicConstructorProperties = {
|
|
5
|
+
geometry: Record<string, unknown>;
|
|
6
|
+
symbol?: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
type GraphicConstructor = new (properties: GraphicConstructorProperties) => GraphicLike;
|
|
9
|
+
export interface ArcGISGraphicsCollectionLike {
|
|
10
|
+
addMany(values: GraphicLike[]): unknown;
|
|
11
|
+
removeMany(values: GraphicLike[]): unknown;
|
|
12
|
+
includes(value: GraphicLike): boolean;
|
|
13
|
+
}
|
|
14
|
+
interface ArcGISViewAnimationForGraphics {
|
|
15
|
+
stop(): void;
|
|
16
|
+
}
|
|
17
|
+
export interface ArcGISMapViewForGraphics {
|
|
18
|
+
graphics: ArcGISGraphicsCollectionLike;
|
|
19
|
+
animation?: ArcGISViewAnimationForGraphics | null;
|
|
20
|
+
zoom?: number;
|
|
21
|
+
goTo(target: unknown, options: {
|
|
22
|
+
animate: false;
|
|
23
|
+
}): Promise<unknown>;
|
|
24
|
+
}
|
|
25
|
+
export interface ArcGISMapElementForGraphics extends Pick<ArcgisMap, "viewOnReady"> {
|
|
26
|
+
view: ArcGISMapViewForGraphics;
|
|
27
|
+
}
|
|
28
|
+
export type ArcGISMapGraphicsUpdateResult = {
|
|
29
|
+
status: "committed";
|
|
30
|
+
} | {
|
|
31
|
+
status: "cancelled";
|
|
32
|
+
} | {
|
|
33
|
+
status: "failed";
|
|
34
|
+
failure: "view" | "graphics" | "fit";
|
|
35
|
+
};
|
|
36
|
+
export interface ArcGISMapGraphicsController {
|
|
37
|
+
update(graphics: readonly NormalizedArcGISMapGraphic[]): Promise<ArcGISMapGraphicsUpdateResult>;
|
|
38
|
+
dispose(): void;
|
|
39
|
+
}
|
|
40
|
+
interface ArcGISMapGraphicsControllerOptions {
|
|
41
|
+
loadGraphic?: () => Promise<GraphicConstructor>;
|
|
42
|
+
}
|
|
43
|
+
export declare function createArcGISMapGraphicsController(mapElement: ArcGISMapElementForGraphics, options?: ArcGISMapGraphicsControllerOptions): ArcGISMapGraphicsController;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x3856ad,_0x5c13ca){const _0x5d7c65=_0x56b3,_0x49b848=_0x3856ad();while(!![]){try{const _0x473ba9=-parseInt(_0x5d7c65(0x1b1))/0x1+-parseInt(_0x5d7c65(0x1b7))/0x2*(-parseInt(_0x5d7c65(0x1ae))/0x3)+parseInt(_0x5d7c65(0x19a))/0x4+-parseInt(_0x5d7c65(0x1b4))/0x5*(-parseInt(_0x5d7c65(0x1a8))/0x6)+-parseInt(_0x5d7c65(0x1ab))/0x7*(parseInt(_0x5d7c65(0x1b2))/0x8)+-parseInt(_0x5d7c65(0x1af))/0x9*(parseInt(_0x5d7c65(0x199))/0xa)+parseInt(_0x5d7c65(0x1ac))/0xb*(parseInt(_0x5d7c65(0x1b6))/0xc);if(_0x473ba9===_0x5c13ca)break;else _0x49b848['push'](_0x49b848['shift']());}catch(_0xf47040){_0x49b848['push'](_0x49b848['shift']());}}}(_0x2b6e,0xd8f0e));import{createArcGISGraphicProperties,getArcGISGraphicsFitTarget,ARCGIS_GRAPHICS_FIT_MAX_ZOOM}from'./graphics.js';function _0x56b3(_0x3afd24,_0x4295b3){_0x3afd24=_0x3afd24-0x198;const _0x2b6e4c=_0x2b6e();let _0x56b376=_0x2b6e4c[_0x3afd24];return _0x56b376;}async function loadArcGISGraphic(){const {default:_0x1f1fca}=await import('@arcgis/core/Graphic.js');return _0x1f1fca;}function isAbortError(_0x163baa){const _0x263019=_0x56b3;return typeof _0x163baa===_0x263019(0x1a2)&&_0x163baa!==null&&'name'in _0x163baa&&_0x163baa['name']==='AbortError';}function getPresent(_0x4b98d3,_0x19632b){const _0x34291a=_0x56b3;return _0x19632b['filter'](_0x45912e=>_0x4b98d3[_0x34291a(0x19f)](_0x45912e));}function removePresent(_0x228654,_0x9b5c2){const _0x4d5703=_0x56b3,_0x3881d6=getPresent(_0x228654,_0x9b5c2);if(_0x3881d6[_0x4d5703(0x1aa)]>0x0)_0x228654['removeMany'](_0x3881d6);}function restoreMissing(_0x5016a8,_0x46e7a2){const _0x29a5dc=_0x56b3,_0x3e0864=_0x46e7a2['filter'](_0x6c8cf9=>!_0x5016a8['includes'](_0x6c8cf9));if(_0x3e0864['length']>0x0)_0x5016a8[_0x29a5dc(0x1a0)](_0x3e0864);}function rollbackReplacement(_0x265187,_0x7a56fe,_0x4082d0){try{removePresent(_0x265187,_0x7a56fe);}catch{}try{restoreMissing(_0x265187,_0x4082d0);}catch{}}function mergeOwned(_0x3de648,_0x1d8bf9){return[...new Set([..._0x3de648,..._0x1d8bf9])];}function _0x2b6e(){const _0x84cd49=['length','7FJPtzW','3412519XcgKUx','number','2500947PCkbhc','63SVNdjO','longitude','181777fjlZCU','9413176YXFAby','fit','10cTkWhg','cancelled','12pIzjry','4aijKOw','view','failed','2504930FRAfgO','6321496uMHauj','animation','viewOnReady','map','committed','includes','addMany','complete','object','graphics','kind','zoom','latitude','point','1327692SvfLdv','center'];_0x2b6e=function(){return _0x84cd49;};return _0x2b6e();}async function fitGraphics(_0x30acc9,_0x20e9a0,_0x43f061,_0x3586bd,_0x320eb6){const _0x3f1747=_0x56b3,_0x232178=getArcGISGraphicsFitTarget(_0x20e9a0);if(!_0x232178)return _0x3f1747(0x1a1);if(_0x232178[_0x3f1747(0x1a4)]===_0x3f1747(0x1a7))return await _0x3586bd({'target':_0x320eb6(_0x232178['target']),'zoom':_0x232178['zoom']}),_0x43f061()?_0x3f1747(0x1a1):_0x3f1747(0x1b5);await _0x3586bd(_0x320eb6(_0x232178['target']));if(!_0x43f061())return _0x3f1747(0x1b5);if(typeof _0x30acc9['zoom']===_0x3f1747(0x1ad)&&_0x30acc9[_0x3f1747(0x1a5)]>ARCGIS_GRAPHICS_FIT_MAX_ZOOM){await _0x3586bd({'target':_0x320eb6({'type':'point','longitude':_0x232178['center'][_0x3f1747(0x1b0)],'latitude':_0x232178[_0x3f1747(0x1a9)][_0x3f1747(0x1a6)],'spatialReference':{'wkid':0x10e6}}),'zoom':ARCGIS_GRAPHICS_FIT_MAX_ZOOM});if(!_0x43f061())return _0x3f1747(0x1b5);}return _0x3f1747(0x1a1);}function createArcGISMapGraphicsController(_0x54137f,_0x51b0a7={}){const _0x2e39da=_0x51b0a7['loadGraphic']??loadArcGISGraphic;let _0x399d16=0x0,_0x241ba4=![],_0x5e7804,_0x56e24a,_0x19389c=[],_0xad2f93;const _0x50f5bc=_0x5d00d1=>!_0x241ba4&&_0x5d00d1===_0x399d16,_0x8c8800=_0x576db8=>{const _0x8ce702=_0x56b3;try{return _0x576db8[_0x8ce702(0x19b)];}catch{return void 0x0;}},_0xb578d1=()=>{const _0x433b52=_0x56b3,_0x2db2c4=_0xad2f93;_0xad2f93=void 0x0;if(!_0x2db2c4||_0x8c8800(_0x2db2c4[_0x433b52(0x1b8)])!==_0x2db2c4[_0x433b52(0x19b)])return;try{_0x2db2c4[_0x433b52(0x19b)]['stop']();}catch{}},_0x406084=async(_0x43913c,_0x348cf8)=>{const _0xca6a05=_0x8c8800(_0x43913c),_0x47baea=_0x43913c['goTo'](_0x348cf8,{'animate':![]}),_0x260a9e=_0x8c8800(_0x43913c),_0x1c48c7=_0x260a9e&&_0x260a9e!==_0xca6a05?{'view':_0x43913c,'animation':_0x260a9e}:void 0x0;if(_0x1c48c7)_0xad2f93=_0x1c48c7;try{return await _0x47baea;}finally{if(_0xad2f93===_0x1c48c7)_0xad2f93=void 0x0;}},_0x5f285e=()=>{const _0x11afc8=_0x56b3;return _0x5e7804??(_0x5e7804=_0x54137f[_0x11afc8(0x19c)]()['then'](()=>{const _0x3b3e92=_0x54137f['view'];return _0x56e24a=_0x3b3e92,_0x3b3e92;})),_0x5e7804;};return{async 'update'(_0x51c1f2){const _0x717b68=_0x56b3;_0xb578d1();const _0x3f0abd=++_0x399d16;if(!_0x50f5bc(_0x3f0abd))return{'status':_0x717b68(0x1b5)};if(_0x51c1f2['length']===0x0&&_0x19389c['length']===0x0)return{'status':'committed'};let _0x36b916;try{_0x36b916=await _0x5f285e();}catch{return _0x5e7804=void 0x0,_0x50f5bc(_0x3f0abd)?{'status':'failed','failure':'view'}:{'status':'cancelled'};}if(!_0x50f5bc(_0x3f0abd))return{'status':'cancelled'};const _0x5d0b34=_0x19389c;if(_0x51c1f2['length']===0x0)try{return removePresent(_0x36b916[_0x717b68(0x1a3)],_0x5d0b34),_0x19389c=[],{'status':'committed'};}catch{try{restoreMissing(_0x36b916[_0x717b68(0x1a3)],_0x5d0b34);}catch{}return{'status':'failed','failure':'graphics'};}let _0x2a6493,_0x4c1707;try{const _0x51ce4f=await _0x2e39da();if(!_0x50f5bc(_0x3f0abd))return{'status':_0x717b68(0x1b5)};_0x4c1707=_0x4f9aed=>new _0x51ce4f({'geometry':_0x4f9aed}),_0x2a6493=_0x51c1f2[_0x717b68(0x19d)](_0x2f1064=>new _0x51ce4f(createArcGISGraphicProperties(_0x2f1064)));}catch{return _0x50f5bc(_0x3f0abd)?{'status':_0x717b68(0x198),'failure':_0x717b68(0x1a3)}:{'status':'cancelled'};}try{_0x36b916[_0x717b68(0x1a3)]['addMany'](_0x2a6493);}catch{return rollbackReplacement(_0x36b916[_0x717b68(0x1a3)],_0x2a6493,_0x5d0b34),_0x19389c=mergeOwned(_0x5d0b34,_0x2a6493),_0x50f5bc(_0x3f0abd)?{'status':_0x717b68(0x198),'failure':'graphics'}:{'status':_0x717b68(0x1b5)};}if(!_0x50f5bc(_0x3f0abd)){try{removePresent(_0x36b916['graphics'],_0x2a6493);}catch{}return _0x19389c=mergeOwned(_0x19389c,_0x2a6493),{'status':'cancelled'};}try{removePresent(_0x36b916[_0x717b68(0x1a3)],_0x5d0b34);}catch{return rollbackReplacement(_0x36b916[_0x717b68(0x1a3)],_0x2a6493,_0x5d0b34),_0x19389c=mergeOwned(_0x5d0b34,_0x2a6493),{'status':'failed','failure':_0x717b68(0x1a3)};}_0x19389c=_0x2a6493;try{const _0x167396=await fitGraphics(_0x36b916,_0x51c1f2,()=>_0x50f5bc(_0x3f0abd),_0x2a40d5=>_0x406084(_0x36b916,_0x2a40d5),_0x4c1707);return _0x167396===_0x717b68(0x1a1)?{'status':_0x717b68(0x19e)}:{'status':_0x717b68(0x1b5)};}catch(_0x1d9d9a){if(!_0x50f5bc(_0x3f0abd))return{'status':'cancelled'};return isAbortError(_0x1d9d9a)?{'status':'committed'}:{'status':'failed','failure':_0x717b68(0x1b3)};}},'dispose'(){if(_0x241ba4)return;_0x241ba4=!![],_0x399d16+=0x1,_0xb578d1();if(_0x56e24a)try{removePresent(_0x56e24a['graphics'],_0x19389c);}catch{}_0x19389c=[];}};}export{createArcGISMapGraphicsController};
|
package/dist/ArcGISMapView.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { type ReactComponentImplementation } from "@agentic-ui-experience/ui-react";
|
|
2
2
|
import { type ArcGISMapViewProps, normalizeArcGISMapViewProps } from "./api.js";
|
|
3
|
+
import { createArcGISMapGraphicsController, type ArcGISMapElementForGraphics } from "./ArcGISMapGraphicsController.js";
|
|
3
4
|
type ArcGISMapFailure = "registration" | "load";
|
|
4
5
|
type NormalizedArcGISMapViewProps = ReturnType<typeof normalizeArcGISMapViewProps>;
|
|
5
6
|
type ArcGISMapSource = NormalizedArcGISMapViewProps["source"];
|
|
7
|
+
type ArcGISMapElement = HTMLElement & ArcGISMapElementForGraphics & {
|
|
8
|
+
basemap?: unknown;
|
|
9
|
+
};
|
|
10
|
+
type CreateArcGISMapGraphicsController = typeof createArcGISMapGraphicsController;
|
|
6
11
|
type ArcGISPortalWithDefaultBasemap = {
|
|
7
12
|
defaultBasemap: unknown | null;
|
|
8
13
|
load(): Promise<unknown>;
|
|
@@ -12,12 +17,16 @@ type ArcGISMapFailureState = {
|
|
|
12
17
|
sourceKey: string;
|
|
13
18
|
failure: ArcGISMapFailure | null;
|
|
14
19
|
};
|
|
20
|
+
type RegisterArcGISMapComponents = () => Promise<void>;
|
|
21
|
+
type PreparePortalDefaultBasemap = (mapElement: ArcGISMapElement, isCurrent: () => boolean) => Promise<void>;
|
|
15
22
|
export declare function applyPortalDefaultBasemap(mapElement: {
|
|
16
23
|
basemap?: unknown;
|
|
17
24
|
}, getPortal?: GetDefaultArcGISPortal, isCurrent?: () => boolean): Promise<void>;
|
|
18
25
|
export declare function observeArcGISComponentRegistration(registration: Promise<unknown>, onFailure: (failure: ArcGISMapFailure) => void): Promise<void>;
|
|
19
|
-
export declare function createArcGISMapLoadErrorHandler(
|
|
20
|
-
export declare function observeArcGISMapLoadError(mapElement: EventTarget,
|
|
26
|
+
export declare function createArcGISMapLoadErrorHandler(onLoadError: () => void): () => void;
|
|
27
|
+
export declare function observeArcGISMapLoadError(mapElement: EventTarget, onLoadError: () => void): () => void;
|
|
28
|
+
export declare function createArcGISMapViewReadyErrorHandler(onFailure: (failure: ArcGISMapFailure) => void): () => void;
|
|
29
|
+
export declare function observeArcGISMapViewReadyError(mapElement: EventTarget, onFailure: (failure: ArcGISMapFailure) => void): () => void;
|
|
21
30
|
export declare function getArcGISMapSourceKey(source: ArcGISMapSource): string;
|
|
22
31
|
export declare function createArcGISMapElementProps(props: NormalizedArcGISMapViewProps, sourceKey: string): {
|
|
23
32
|
style: {
|
|
@@ -45,6 +54,12 @@ export declare const ArcGISMapView: ReactComponentImplementation;
|
|
|
45
54
|
export declare function ArcGISMapViewContent({ props }: {
|
|
46
55
|
props: ArcGISMapViewProps;
|
|
47
56
|
}): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export declare function ArcGISMapBody({ props, createGraphicsController, registerComponents, preparePortalDefaultBasemap }: {
|
|
58
|
+
props: NormalizedArcGISMapViewProps;
|
|
59
|
+
createGraphicsController?: CreateArcGISMapGraphicsController;
|
|
60
|
+
registerComponents?: RegisterArcGISMapComponents;
|
|
61
|
+
preparePortalDefaultBasemap?: PreparePortalDefaultBasemap;
|
|
62
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
48
63
|
export declare function ArcGISMapFailureFallback({ failure }: {
|
|
49
64
|
failure: ArcGISMapFailure;
|
|
50
65
|
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/ArcGISMapView.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x6672cb=_0x394d;(function(_0x44007b,_0x3c2566){const _0x2c869e=_0x394d,_0x2cd1ad=_0x44007b();while(!![]){try{const _0x22cad3=parseInt(_0x2c869e(0x1e8))/0x1+parseInt(_0x2c869e(0x1db))/0x2*(-parseInt(_0x2c869e(0x1dd))/0x3)+-parseInt(_0x2c869e(0x1f0))/0x4*(parseInt(_0x2c869e(0x20e))/0x5)+-parseInt(_0x2c869e(0x1eb))/0x6+parseInt(_0x2c869e(0x1e3))/0x7*(-parseInt(_0x2c869e(0x1fb))/0x8)+-parseInt(_0x2c869e(0x1ee))/0x9*(-parseInt(_0x2c869e(0x207))/0xa)+parseInt(_0x2c869e(0x20a))/0xb;if(_0x22cad3===_0x3c2566)break;else _0x2cd1ad['push'](_0x2cd1ad['shift']());}catch(_0xba4cb2){_0x2cd1ad['push'](_0x2cd1ad['shift']());}}}(_0x2e3a,0xea040));import{jsx,jsxs,Fragment}from'react/jsx-runtime';import _0x1f044e from'react';function _0x2e3a(){const _0x5f801=['12px\x2014px','6965MXPMHK','arcgis-legend','then','resolve','isFinite','defaultBasemap','current','addEventListener','source','webmap','space-between','type','986EGmoLj','zoom','2559CgoVVC','noopener\x20noreferrer','none','search','failure','100%','157087JDToeo','stringify','_blank','portal/default','registration','46747NvTPkI','arcgis-search','title','9918486oLbyDy','&level=','flex','13809033UmfuUO','hidden','4852HBqghf','ArcGISMapView\x20needs\x20valid\x20finite\x20latitude\x20and\x20longitude.','portalUrl','10px\x2012px','arcgisLoadError','useEffect','description','/home/webmap/viewer.html?center=','layerList','load','div','280pUAytD','createElement','arcgis-layer-list','top-right','toFixed','itemId','ellipsis','removeEventListener','center','basemap','ArcGIS\x20map','#64748b','10liheSU','ArcGIS\x20map\x20components\x20could\x20not\x20be\x20loaded.','controls','43188178jlBNFg','all','latitude'];_0x2e3a=function(){return _0x5f801;};return _0x2e3a();}import _0x136f1c from'@arcgis/core/config.js';import{createComponentImplementation}from'@agentic-ui-experience/ui-react';import{ArcGISMapViewApi,normalizeArcGISMapViewProps}from'./api.js';let arcgisComponentsRegistration;function _0x394d(_0x555e53,_0x34546e){_0x555e53=_0x555e53-0x1d1;const _0x2e3af6=_0x2e3a();let _0x394ddd=_0x2e3af6[_0x555e53];return _0x394ddd;}async function getDefaultArcGISPortal(){const {default:_0x43ec0a}=await import('@arcgis/core/portal/Portal.js');return _0x43ec0a['getDefault']();}async function applyPortalDefaultBasemap(_0x1f90c4,_0x3b52c1=getDefaultArcGISPortal,_0x1ca061=()=>!![]){const _0x12fd32=_0x394d,_0x378705=await _0x3b52c1();await _0x378705['load']();if(!_0x378705['defaultBasemap'])throw new Error('The\x20configured\x20ArcGIS\x20portal\x20has\x20no\x20default\x20basemap.');_0x1ca061()&&(_0x1f90c4[_0x12fd32(0x204)]=_0x378705[_0x12fd32(0x1d4)]);}function ensureArcGISMapComponents(){const _0x296028=_0x394d;if(typeof window==='undefined')return Promise[_0x296028(0x1d2)]();return!arcgisComponentsRegistration&&(arcgisComponentsRegistration=Promise[_0x296028(0x20b)]([import('@arcgis/map-components/components/arcgis-map'),import('@arcgis/map-components/components/arcgis-zoom'),import('@arcgis/map-components/components/arcgis-legend'),import('@arcgis/map-components/components/arcgis-layer-list'),import('@arcgis/map-components/components/arcgis-search')])[_0x296028(0x1d1)](()=>void 0x0)['catch'](_0x4bc5a7=>{arcgisComponentsRegistration=void 0x0;throw _0x4bc5a7;})),arcgisComponentsRegistration;}function observeArcGISComponentRegistration(_0x2d93f3,_0x2e7a34){return _0x2d93f3['then'](()=>void 0x0,()=>{_0x2e7a34('registration');});}function createArcGISMapLoadErrorHandler(_0xf0f2e){return()=>{const _0x3bf5c2=_0x394d;_0xf0f2e(_0x3bf5c2(0x1f9));};}function observeArcGISMapLoadError(_0x3c779d,_0x35df2f){const _0x1367d6=_0x394d,_0x1e33d8=createArcGISMapLoadErrorHandler(_0x35df2f);return _0x3c779d[_0x1367d6(0x1d6)]('arcgisLoadError',_0x1e33d8),()=>{const _0x37f021=_0x1367d6;_0x3c779d[_0x37f021(0x202)](_0x37f021(0x1f4),_0x1e33d8);};}function getArcGISMapSourceKey(_0x3422be){const _0x142c83=_0x394d;if(_0x3422be['type']===_0x142c83(0x1d8))return JSON[_0x142c83(0x1e4)]([_0x3422be[_0x142c83(0x1da)],_0x3422be[_0x142c83(0x200)]]);return JSON[_0x142c83(0x1e4)]([_0x3422be['type'],_0x3422be['basemap'],_0x3422be[_0x142c83(0x203)]['longitude'],_0x3422be[_0x142c83(0x203)]['latitude'],_0x3422be['zoom']??null]);}function createArcGISMapElementProps(_0x575590,_0x317567){const _0xe31079=_0x394d,_0x15be95=_0x575590['source'][_0xe31079(0x1da)]==='webmap'?{'item-id':_0x575590['source']['itemId']}:{..._0x575590[_0xe31079(0x1d7)][_0xe31079(0x204)]==='portal/default'?{}:{'basemap':_0x575590['source']['basemap']},'center':_0x575590[_0xe31079(0x1d7)]['center']['longitude']+','+_0x575590[_0xe31079(0x1d7)]['center']['latitude'],..._0x575590['source']['zoom']===void 0x0?{}:{'zoom':String(_0x575590['source']['zoom'])}};return{'key':_0x317567,..._0x15be95,'style':{'display':'block','height':_0x575590['height']+'px','width':'100%'}};}function getArcGISMapFailureForSource(_0x1c09df,_0x1b3106){const _0x34c9bd=_0x394d;return _0x1c09df['sourceKey']===_0x1b3106?_0x1c09df[_0x34c9bd(0x1e1)]:null;}function resetArcGISMapFailureForSource(_0x40998b,_0xc4f6b4){const _0x478054=_0x394d;if(_0x40998b['sourceKey']===_0xc4f6b4&&_0x40998b[_0x478054(0x1e1)]===null)return _0x40998b;return{'sourceKey':_0xc4f6b4,'failure':null};}function createOpenUrl(_0x34ba93){const _0x17b592=_0x394d,_0x1f3619=_0x136f1c[_0x17b592(0x1f2)]['replace'](/\/+$/,'');if(_0x34ba93[_0x17b592(0x1d7)][_0x17b592(0x1da)]===_0x17b592(0x1d8))return _0x1f3619+'/home/webmap/viewer.html?webmap='+encodeURIComponent(_0x34ba93['source'][_0x17b592(0x200)]);const {latitude:_0x45bf29,longitude:_0x10b051}=_0x34ba93[_0x17b592(0x1d7)][_0x17b592(0x203)],_0x167ddc=_0x34ba93[_0x17b592(0x1d7)][_0x17b592(0x1dc)]??0xb,_0x10b959=_0x10b051[_0x17b592(0x1ff)](0x5)+','+_0x45bf29['toFixed'](0x5);return _0x1f3619+_0x17b592(0x1f7)+encodeURIComponent(_0x10b959)+_0x17b592(0x1ec)+_0x167ddc;}const ArcGISMapView=createComponentImplementation(ArcGISMapViewApi,({props:_0x4246dc})=>jsx(ArcGISMapViewContent,{'props':_0x4246dc}));function ArcGISMapViewContent({props:_0x540332}){const _0x3b27d6=_0x394d,_0x35622c=normalizeArcGISMapViewProps(_0x540332),_0x54ac41=_0x35622c[_0x3b27d6(0x1ea)]??_0x3b27d6(0x205),_0x1cf8ac=createOpenUrl(_0x35622c);if(_0x35622c[_0x3b27d6(0x1d7)]['type']==='basemap'&&(!Number['isFinite'](_0x35622c['source'][_0x3b27d6(0x203)][_0x3b27d6(0x20c)])||!Number[_0x3b27d6(0x1d3)](_0x35622c[_0x3b27d6(0x1d7)]['center']['longitude'])))return jsx('div',{'style':fallbackStyle,'children':_0x3b27d6(0x1f1)});return jsxs('section',{'style':shellStyle,'aria-label':_0x54ac41,'children':[jsxs('header',{'style':headerStyle,'children':[jsxs(_0x3b27d6(0x1fa),{'style':{'minWidth':0x0},'children':[jsx('div',{'style':titleStyle,'children':_0x54ac41}),_0x35622c['description']?jsx('div',{'style':descriptionStyle,'children':_0x35622c[_0x3b27d6(0x1f6)]}):null]}),_0x35622c['openInArcGIS']&&_0x1cf8ac?jsx('a',{'href':_0x1cf8ac,'target':_0x3b27d6(0x1e5),'rel':_0x3b27d6(0x1de),'style':linkStyle,'children':'Open\x20in\x20ArcGIS'}):null]}),jsx(ArcGISMapBody,{'props':_0x35622c})]});}function ArcGISMapBody({props:_0x573de0}){const _0x21e42f=_0x394d,_0x559901=getArcGISMapSourceKey(_0x573de0[_0x21e42f(0x1d7)]),_0x32fca0=_0x1f044e['useRef'](null),[_0x32e116,_0x3be451]=_0x1f044e['useState']({'sourceKey':_0x559901,'failure':null}),_0x11d242=getArcGISMapFailureForSource(_0x32e116,_0x559901);_0x1f044e[_0x21e42f(0x1f5)](()=>{let _0x13acc6=!![];_0x3be451(_0x90b08f=>resetArcGISMapFailureForSource(_0x90b08f,_0x559901));const _0x6d58cd=_0x3e5a3a=>{_0x13acc6&&_0x3be451({'sourceKey':_0x559901,'failure':_0x3e5a3a});};return void ensureArcGISMapComponents()['then'](()=>{const _0x3105f8=_0x394d;if(!_0x13acc6||_0x573de0[_0x3105f8(0x1d7)][_0x3105f8(0x1da)]!=='basemap'||_0x573de0[_0x3105f8(0x1d7)][_0x3105f8(0x204)]!==_0x3105f8(0x1e6))return;const _0xb67380=_0x32fca0['current'];if(!_0xb67380){_0x6d58cd('load');return;}void applyPortalDefaultBasemap(_0xb67380,getDefaultArcGISPortal,()=>_0x13acc6&&_0x32fca0[_0x3105f8(0x1d5)]===_0xb67380)['catch'](()=>{const _0x369861=_0x3105f8;_0x6d58cd(_0x369861(0x1f9));});},()=>{_0x6d58cd('registration');}),()=>{_0x13acc6=![];};},[_0x559901]),_0x1f044e[_0x21e42f(0x1f5)](()=>{const _0x38dbf7=_0x32fca0['current'];if(!_0x38dbf7)return;return observeArcGISMapLoadError(_0x38dbf7,_0x9eb4f0=>{_0x3be451({'sourceKey':_0x559901,'failure':_0x9eb4f0});});},[_0x559901]);if(_0x11d242)return jsx(ArcGISMapFailureFallback,{'failure':_0x11d242});return _0x1f044e[_0x21e42f(0x1fc)]('arcgis-map',{...createArcGISMapElementProps(_0x573de0,_0x559901),'ref':_0x32fca0},jsxs(Fragment,{'children':[_0x573de0['controls'][_0x21e42f(0x1dc)]?_0x1f044e[_0x21e42f(0x1fc)]('arcgis-zoom',{'slot':'top-left'}):null,_0x573de0[_0x21e42f(0x209)][_0x21e42f(0x1e0)]?_0x1f044e[_0x21e42f(0x1fc)](_0x21e42f(0x1e9),{'slot':_0x21e42f(0x1fe)}):null,_0x573de0[_0x21e42f(0x209)]['legend']?_0x1f044e['createElement'](_0x21e42f(0x20f),{'slot':'bottom-left'}):null,_0x573de0['controls'][_0x21e42f(0x1f8)]?_0x1f044e[_0x21e42f(0x1fc)](_0x21e42f(0x1fd),{'slot':_0x21e42f(0x1fe)}):null]}));}function ArcGISMapFailureFallback({failure:_0x56eeae}){const _0x321b78=_0x394d;return jsx(_0x321b78(0x1fa),{'role':'alert','style':mapFailureStyle,'children':_0x56eeae===_0x321b78(0x1e7)?_0x321b78(0x208):'ArcGIS\x20map\x20could\x20not\x20be\x20loaded.'});}const shellStyle={'width':_0x6672cb(0x1e2),'borderRadius':0x8,'border':'1px\x20solid\x20rgba(148,\x20163,\x20184,\x200.45)','background':'#ffffff','overflow':_0x6672cb(0x1ef)},headerStyle={'display':_0x6672cb(0x1ed),'alignItems':'center','justifyContent':_0x6672cb(0x1d9),'gap':0xa,'padding':_0x6672cb(0x1f3),'borderBottom':'1px\x20solid\x20rgba(226,\x20232,\x20240,\x200.9)'},titleStyle={'color':'#111827','fontSize':0xd,'fontWeight':0x2bc,'lineHeight':1.2,'overflow':_0x6672cb(0x1ef),'textOverflow':_0x6672cb(0x201),'whiteSpace':'nowrap'},descriptionStyle={'color':_0x6672cb(0x206),'fontSize':0xc,'lineHeight':1.3,'marginTop':0x4},linkStyle={'color':'#2563eb','flexShrink':0x0,'fontSize':0xc,'fontWeight':0x2bc,'textDecoration':_0x6672cb(0x1df)},fallbackStyle={'width':'100%','borderRadius':0x8,'border':'1px\x20solid\x20rgba(220,\x2038,\x2038,\x200.25)','background':'#fff5f5','color':'#991b1b','fontSize':0xd,'padding':_0x6672cb(0x20d)},mapFailureStyle={...fallbackStyle,'border':0x0,'borderRadius':0x0};export{ArcGISMapFailureFallback,ArcGISMapView,ArcGISMapViewContent,applyPortalDefaultBasemap,createArcGISMapElementProps,createArcGISMapLoadErrorHandler,getArcGISMapFailureForSource,getArcGISMapSourceKey,observeArcGISComponentRegistration,observeArcGISMapLoadError,resetArcGISMapFailureForSource};
|
|
1
|
+
const _0x4c481f=_0x556b;(function(_0x3c42b8,_0xc6af85){const _0x12746a=_0x556b,_0x16831a=_0x3c42b8();while(!![]){try{const _0x1c8187=parseInt(_0x12746a(0x1fc))/0x1+parseInt(_0x12746a(0x1cf))/0x2+-parseInt(_0x12746a(0x1d5))/0x3+parseInt(_0x12746a(0x20f))/0x4*(-parseInt(_0x12746a(0x1e0))/0x5)+-parseInt(_0x12746a(0x210))/0x6*(-parseInt(_0x12746a(0x211))/0x7)+-parseInt(_0x12746a(0x1f4))/0x8*(-parseInt(_0x12746a(0x20d))/0x9)+-parseInt(_0x12746a(0x1f6))/0xa;if(_0x1c8187===_0xc6af85)break;else _0x16831a['push'](_0x16831a['shift']());}catch(_0x3fce57){_0x16831a['push'](_0x16831a['shift']());}}}(_0x4c59,0xd02eb));import{jsx,jsxs,Fragment}from'react/jsx-runtime';import _0x1bfbfe from'react';import _0x451595 from'@arcgis/core/config.js';import{createComponentImplementation}from'@agentic-ui-experience/ui-react';function _0x556b(_0x4b4a35,_0x3354d9){_0x4b4a35=_0x4b4a35-0x1ca;const _0x4c5909=_0x4c59();let _0x556b08=_0x4c5909[_0x4b4a35];return _0x556b08;}import{ArcGISMapViewApi,normalizeArcGISMapViewProps}from'./api.js';import{createArcGISMapGraphicsController}from'./ArcGISMapGraphicsController.js';import{getArcGISMapGraphicsKey}from'./graphics.js';let arcgisComponentsRegistration;async function getDefaultArcGISPortal(){const {default:_0x3234df}=await import('@arcgis/core/portal/Portal.js');return _0x3234df['getDefault']();}async function applyPortalDefaultBasemap(_0x311781,_0xd7dde0=getDefaultArcGISPortal,_0x20c43c=()=>!![]){const _0x4a7fbf=_0x556b,_0x50da03=await _0xd7dde0();await _0x50da03['load']();if(!_0x50da03[_0x4a7fbf(0x1ec)])throw new Error(_0x4a7fbf(0x208));_0x20c43c()&&(_0x311781[_0x4a7fbf(0x1ef)]=_0x50da03['defaultBasemap']);}function ensureArcGISMapComponents(){const _0x5cb55c=_0x556b;if(typeof window==='undefined')return Promise[_0x5cb55c(0x1d4)]();return!arcgisComponentsRegistration&&(arcgisComponentsRegistration=Promise['all']([import('@arcgis/map-components/components/arcgis-map'),import('@arcgis/map-components/components/arcgis-zoom'),import('@arcgis/map-components/components/arcgis-legend'),import('@arcgis/map-components/components/arcgis-layer-list'),import('@arcgis/map-components/components/arcgis-search')])['then'](async()=>{const _0x5985fd=_0x5cb55c;typeof customElements!==_0x5985fd(0x20b)&&await customElements['whenDefined']('arcgis-map');})['catch'](_0x40e262=>{arcgisComponentsRegistration=void 0x0;throw _0x40e262;})),arcgisComponentsRegistration;}function observeArcGISComponentRegistration(_0x1ea14d,_0x228a8e){return _0x1ea14d['then'](()=>void 0x0,()=>{_0x228a8e('registration');});}function createArcGISMapLoadErrorHandler(_0x43865d){return()=>{_0x43865d();};}function observeArcGISMapLoadError(_0x3521c2,_0x232722){const _0x139fb9=_0x556b,_0x44acf3=createArcGISMapLoadErrorHandler(_0x232722);return _0x3521c2['addEventListener'](_0x139fb9(0x1d9),_0x44acf3),()=>{const _0x35d980=_0x139fb9;_0x3521c2['removeEventListener'](_0x35d980(0x1d9),_0x44acf3);};}function createArcGISMapViewReadyErrorHandler(_0x45d44b){return()=>{_0x45d44b('load');};}function observeArcGISMapViewReadyError(_0x142d7a,_0x1c25e4){const _0x59ea75=createArcGISMapViewReadyErrorHandler(_0x1c25e4);return _0x142d7a['addEventListener']('arcgisViewReadyError',_0x59ea75),()=>{const _0x5f209d=_0x556b;_0x142d7a[_0x5f209d(0x1cb)]('arcgisViewReadyError',_0x59ea75);};}function getArcGISMapSourceKey(_0x598ee7){const _0x16a7f8=_0x556b;if(_0x598ee7[_0x16a7f8(0x1dd)]==='webmap')return JSON[_0x16a7f8(0x206)]([_0x598ee7[_0x16a7f8(0x1dd)],_0x598ee7[_0x16a7f8(0x1e1)]]);return JSON[_0x16a7f8(0x206)]([_0x598ee7[_0x16a7f8(0x1dd)],_0x598ee7['basemap'],_0x598ee7['center'][_0x16a7f8(0x1fb)],_0x598ee7[_0x16a7f8(0x201)]['latitude'],_0x598ee7['zoom']??null]);}function _0x4c59(){const _0x55161d=['latitude','alert','useState','toFixed','Map\x20graphics\x20are\x20shown,\x20but\x20the\x20view\x20could\x20not\x20be\x20adjusted.','1px\x20solid\x20rgba(148,\x20163,\x20184,\x200.45)','defaultBasemap','flex','legend','basemap','layerList','none','openInArcGIS','isFinite','4841264RLHtSq','section','22335890raphaq','zoom','graphics','description','&level=','longitude','1528560FSVuHT','1px\x20solid\x20rgba(217,\x20119,\x206,\x200.25)','1px\x20solid\x20rgba(226,\x20232,\x20240,\x200.9)','#fff7ed','top-left','center','/home/webmap/viewer.html?webmap=','bottom-left','controls','useRef','stringify','ready','The\x20configured\x20ArcGIS\x20portal\x20has\x20no\x20default\x20basemap.','arcgis-legend','createElement','undefined','8px\x2012px','18XSzZnw','status','4744YexcLc','1338108AgrHGr','21mDmeQX','webmap','then','removeEventListener','registration','source','sourceKey','2656056wDAUIi','current','ArcGIS\x20map\x20could\x20not\x20be\x20loaded.','failure','height','resolve','255960NbMzVc','hidden','div','replace','arcgisLoadError','ellipsis','notice','arcgis-zoom','type','100%','view','6595hKCjUN','itemId','load','space-between','Open\x20in\x20ArcGIS','#64748b'];_0x4c59=function(){return _0x55161d;};return _0x4c59();}function createArcGISMapElementProps(_0xf8942f,_0x1747f0){const _0x5cb687=_0x556b,_0x599453=_0xf8942f[_0x5cb687(0x1cd)][_0x5cb687(0x1dd)]==='webmap'?{'item-id':_0xf8942f['source'][_0x5cb687(0x1e1)]}:{..._0xf8942f[_0x5cb687(0x1cd)][_0x5cb687(0x1ef)]==='portal/default'?{}:{'basemap':_0xf8942f[_0x5cb687(0x1cd)][_0x5cb687(0x1ef)]},'center':_0xf8942f[_0x5cb687(0x1cd)][_0x5cb687(0x201)]['longitude']+','+_0xf8942f['source']['center'][_0x5cb687(0x1e6)],..._0xf8942f['source'][_0x5cb687(0x1f7)]===void 0x0?{}:{'zoom':String(_0xf8942f['source'][_0x5cb687(0x1f7)])}};return{'key':_0x1747f0,..._0x599453,'style':{'display':'block','height':_0xf8942f[_0x5cb687(0x1d3)]+'px','width':_0x5cb687(0x1de)}};}function getArcGISMapFailureForSource(_0xdc4c3,_0x25bb29){return _0xdc4c3['sourceKey']===_0x25bb29?_0xdc4c3['failure']:null;}function resetArcGISMapFailureForSource(_0x574348,_0x33f5b0){const _0x73678b=_0x556b;if(_0x574348[_0x73678b(0x1ce)]===_0x33f5b0&&_0x574348[_0x73678b(0x1d2)]===null)return _0x574348;return{'sourceKey':_0x33f5b0,'failure':null};}function createOpenUrl(_0x14b3ad){const _0x3721c8=_0x556b,_0xca29a8=_0x451595['portalUrl'][_0x3721c8(0x1d8)](/\/+$/,'');if(_0x14b3ad[_0x3721c8(0x1cd)]['type']===_0x3721c8(0x212))return _0xca29a8+_0x3721c8(0x202)+encodeURIComponent(_0x14b3ad['source'][_0x3721c8(0x1e1)]);const {latitude:_0x48a1b9,longitude:_0x2270f2}=_0x14b3ad[_0x3721c8(0x1cd)][_0x3721c8(0x201)],_0x1c001b=_0x14b3ad['source'][_0x3721c8(0x1f7)]??0xb,_0x5e02ed=_0x2270f2['toFixed'](0x5)+','+_0x48a1b9[_0x3721c8(0x1e9)](0x5);return _0xca29a8+'/home/webmap/viewer.html?center='+encodeURIComponent(_0x5e02ed)+_0x3721c8(0x1fa)+_0x1c001b;}const ArcGISMapView=createComponentImplementation(ArcGISMapViewApi,({props:_0x1ec23f})=>jsx(ArcGISMapViewContent,{'props':_0x1ec23f}));function ArcGISMapViewContent({props:_0x34f86e}){const _0x4765cb=_0x556b,_0x1550bd=normalizeArcGISMapViewProps(_0x34f86e),_0x28b016=_0x1550bd['title']??'ArcGIS\x20map',_0xb4aa13=createOpenUrl(_0x1550bd);if(_0x1550bd['source']['type']==='basemap'&&(!Number[_0x4765cb(0x1f3)](_0x1550bd['source']['center']['latitude'])||!Number[_0x4765cb(0x1f3)](_0x1550bd[_0x4765cb(0x1cd)]['center'][_0x4765cb(0x1fb)])))return jsx(_0x4765cb(0x1d7),{'style':fallbackStyle,'children':'ArcGISMapView\x20needs\x20valid\x20finite\x20latitude\x20and\x20longitude.'});return jsxs(_0x4765cb(0x1f5),{'style':shellStyle,'aria-label':_0x28b016,'children':[jsxs('header',{'style':headerStyle,'children':[jsxs('div',{'style':{'minWidth':0x0},'children':[jsx(_0x4765cb(0x1d7),{'style':titleStyle,'children':_0x28b016}),_0x1550bd['description']?jsx('div',{'style':descriptionStyle,'children':_0x1550bd[_0x4765cb(0x1f9)]}):null]}),_0x1550bd[_0x4765cb(0x1f2)]&&_0xb4aa13?jsx('a',{'href':_0xb4aa13,'target':'_blank','rel':'noopener\x20noreferrer','style':linkStyle,'children':_0x4765cb(0x1e4)}):null]}),jsx(ArcGISMapBody,{'props':_0x1550bd})]});}function ArcGISMapBody({props:_0x8118cd,createGraphicsController:createGraphicsController=createArcGISMapGraphicsController,registerComponents:registerComponents=ensureArcGISMapComponents,preparePortalDefaultBasemap:preparePortalDefaultBasemap=(_0xb5454e,_0x5c660f)=>applyPortalDefaultBasemap(_0xb5454e,getDefaultArcGISPortal,_0x5c660f)}){const _0x35f547=_0x556b,_0x4f2dab=getArcGISMapSourceKey(_0x8118cd[_0x35f547(0x1cd)]),_0x236ddf=getArcGISMapGraphicsKey(_0x8118cd['graphics']),_0x5b28ac=_0x1bfbfe['useRef'](null),_0x183a7e=_0x1bfbfe['useRef'](createGraphicsController);_0x183a7e['current']=createGraphicsController;const _0x443fcc=_0x1bfbfe[_0x35f547(0x205)](registerComponents);_0x443fcc[_0x35f547(0x1d0)]=registerComponents;const _0x808233=_0x1bfbfe[_0x35f547(0x205)](preparePortalDefaultBasemap);_0x808233[_0x35f547(0x1d0)]=preparePortalDefaultBasemap;const _0x3b2dce=_0x1bfbfe['useRef'](null),[_0x1ef5a3,_0x94efbd]=_0x1bfbfe['useState']({'sourceKey':_0x4f2dab,'failure':null}),[_0x363dbf,_0x411b1d]=_0x1bfbfe['useState']({'sourceKey':_0x4f2dab,'ready':![]}),[_0x5dbc9b,_0x2b5cbe]=_0x1bfbfe['useState']({'sourceKey':_0x4f2dab,'graphicsKey':_0x236ddf,'notice':null}),[_0xd4a506,_0xe9ce61]=_0x1bfbfe[_0x35f547(0x1e8)]({'sourceKey':_0x4f2dab,'visible':![]}),_0x5eb67f=getArcGISMapFailureForSource(_0x1ef5a3,_0x4f2dab),_0x65fdb0=_0x363dbf['sourceKey']===_0x4f2dab&&_0x363dbf[_0x35f547(0x207)],_0x2dc497=_0x5dbc9b['sourceKey']===_0x4f2dab&&_0x5dbc9b['graphicsKey']===_0x236ddf?_0x5dbc9b[_0x35f547(0x1db)]:null,_0x22a169=_0xd4a506['sourceKey']===_0x4f2dab&&_0xd4a506['visible'];_0x1bfbfe['useEffect'](()=>{const _0x5ea8b6=_0x35f547;let _0x3bce3c=!![];_0x411b1d({'sourceKey':_0x4f2dab,'ready':![]}),_0x94efbd(_0x399baf=>resetArcGISMapFailureForSource(_0x399baf,_0x4f2dab));const _0x37da56=_0x394d6d=>{_0x3bce3c&&_0x94efbd({'sourceKey':_0x4f2dab,'failure':_0x394d6d});};return void _0x443fcc[_0x5ea8b6(0x1d0)]()[_0x5ea8b6(0x1ca)](()=>{const _0x276585=_0x5ea8b6;if(!_0x3bce3c)return;if(_0x8118cd['source']['type']!=='basemap'||_0x8118cd['source']['basemap']!=='portal/default'){_0x411b1d({'sourceKey':_0x4f2dab,'ready':!![]});return;}const _0x129933=_0x5b28ac[_0x276585(0x1d0)];if(!_0x129933){_0x37da56(_0x276585(0x1e2));return;}const _0x508922=()=>_0x3bce3c&&_0x5b28ac[_0x276585(0x1d0)]===_0x129933;void _0x808233['current'](_0x129933,_0x508922)[_0x276585(0x1ca)](()=>{_0x508922()&&_0x411b1d({'sourceKey':_0x4f2dab,'ready':!![]});},()=>{const _0x5afa70=_0x276585;_0x37da56(_0x5afa70(0x1e2));});},()=>{const _0x4c56f5=_0x5ea8b6;_0x37da56(_0x4c56f5(0x1cc));}),()=>{_0x3bce3c=![];};},[_0x4f2dab]),_0x1bfbfe['useEffect'](()=>{const _0x58944e=_0x35f547,_0x1fccbd=_0x5b28ac[_0x58944e(0x1d0)];if(!_0x1fccbd)return;const _0x4d123d=observeArcGISMapLoadError(_0x1fccbd,()=>{_0xe9ce61({'sourceKey':_0x4f2dab,'visible':!![]});}),_0x22a096=observeArcGISMapViewReadyError(_0x1fccbd,_0x3d8e73=>{_0x94efbd({'sourceKey':_0x4f2dab,'failure':_0x3d8e73});});return()=>{_0x4d123d(),_0x22a096();};},[_0x4f2dab]),_0x1bfbfe['useEffect'](()=>{const _0x57d6be=_0x35f547;if(!_0x65fdb0)return;const _0x143469=_0x5b28ac['current'];if(!_0x143469)return;const _0x2a0c3b=_0x183a7e[_0x57d6be(0x1d0)](_0x143469);return _0x3b2dce['current']=_0x2a0c3b,()=>{const _0x1656ef=_0x57d6be;_0x3b2dce['current']===_0x2a0c3b&&(_0x3b2dce[_0x1656ef(0x1d0)]=null),_0x2a0c3b['dispose']();};},[_0x4f2dab,_0x65fdb0]),_0x1bfbfe['useEffect'](()=>{const _0x3ccc36=_0x35f547;let _0x44d816=!![];_0x2b5cbe({'sourceKey':_0x4f2dab,'graphicsKey':_0x236ddf,'notice':null});if(!_0x65fdb0)return()=>{_0x44d816=![];};const _0xdd6f83=_0x3b2dce[_0x3ccc36(0x1d0)];if(!_0xdd6f83)return()=>{_0x44d816=![];};return void _0xdd6f83['update'](_0x8118cd[_0x3ccc36(0x1f8)])[_0x3ccc36(0x1ca)](_0x5d17c9=>{const _0xa797a7=_0x3ccc36;if(!_0x44d816||_0x5d17c9[_0xa797a7(0x20e)]!=='failed')return;if(_0x5d17c9['failure']===_0xa797a7(0x1df)){_0x94efbd({'sourceKey':_0x4f2dab,'failure':_0xa797a7(0x1e2)});return;}_0x2b5cbe({'sourceKey':_0x4f2dab,'graphicsKey':_0x236ddf,'notice':_0x5d17c9['failure']});}),()=>{_0x44d816=![];};},[_0x4f2dab,_0x236ddf,_0x65fdb0]);if(_0x5eb67f)return jsx(ArcGISMapFailureFallback,{'failure':_0x5eb67f});return jsxs(Fragment,{'children':[_0x1bfbfe[_0x35f547(0x20a)]('arcgis-map',{...createArcGISMapElementProps(_0x8118cd,_0x4f2dab),'ref':_0x5b28ac},jsxs(Fragment,{'children':[_0x8118cd['controls']['zoom']?_0x1bfbfe[_0x35f547(0x20a)](_0x35f547(0x1dc),{'slot':_0x35f547(0x200)}):null,_0x8118cd['controls']['search']?_0x1bfbfe['createElement']('arcgis-search',{'slot':'top-right'}):null,_0x8118cd['controls'][_0x35f547(0x1ee)]?_0x1bfbfe[_0x35f547(0x20a)](_0x35f547(0x209),{'slot':_0x35f547(0x203)}):null,_0x8118cd[_0x35f547(0x204)][_0x35f547(0x1f0)]?_0x1bfbfe['createElement']('arcgis-layer-list',{'slot':'top-right'}):null]})),_0x2dc497?jsx(_0x35f547(0x1d7),{'role':_0x35f547(0x1e7),'style':graphicsNoticeStyle,'children':_0x2dc497===_0x35f547(0x1f8)?'Map\x20graphics\x20could\x20not\x20be\x20rendered.\x20The\x20previous\x20map\x20content\x20is\x20still\x20shown.':_0x35f547(0x1ea)}):null,_0x22a169?jsx(_0x35f547(0x1d7),{'role':'alert','style':graphicsNoticeStyle,'children':'Some\x20map\x20content\x20could\x20not\x20be\x20loaded.'}):null]});}function ArcGISMapFailureFallback({failure:_0x1a5410}){const _0x5385a9=_0x556b;return jsx('div',{'role':'alert','style':mapFailureStyle,'children':_0x1a5410===_0x5385a9(0x1cc)?'ArcGIS\x20map\x20components\x20could\x20not\x20be\x20loaded.':_0x5385a9(0x1d1)});}const shellStyle={'width':'100%','borderRadius':0x8,'border':_0x4c481f(0x1eb),'background':'#ffffff','overflow':_0x4c481f(0x1d6)},headerStyle={'display':_0x4c481f(0x1ed),'alignItems':'center','justifyContent':_0x4c481f(0x1e3),'gap':0xa,'padding':'10px\x2012px','borderBottom':_0x4c481f(0x1fe)},titleStyle={'color':'#111827','fontSize':0xd,'fontWeight':0x2bc,'lineHeight':1.2,'overflow':'hidden','textOverflow':_0x4c481f(0x1da),'whiteSpace':'nowrap'},descriptionStyle={'color':_0x4c481f(0x1e5),'fontSize':0xc,'lineHeight':1.3,'marginTop':0x4},linkStyle={'color':'#2563eb','flexShrink':0x0,'fontSize':0xc,'fontWeight':0x2bc,'textDecoration':_0x4c481f(0x1f1)},fallbackStyle={'width':_0x4c481f(0x1de),'borderRadius':0x8,'border':'1px\x20solid\x20rgba(220,\x2038,\x2038,\x200.25)','background':'#fff5f5','color':'#991b1b','fontSize':0xd,'padding':'12px\x2014px'},mapFailureStyle={...fallbackStyle,'border':0x0,'borderRadius':0x0},graphicsNoticeStyle={'background':_0x4c481f(0x1ff),'borderTop':_0x4c481f(0x1fd),'color':'#9a3412','fontSize':0xc,'lineHeight':1.4,'padding':_0x4c481f(0x20c)};export{ArcGISMapBody,ArcGISMapFailureFallback,ArcGISMapView,ArcGISMapViewContent,applyPortalDefaultBasemap,createArcGISMapElementProps,createArcGISMapLoadErrorHandler,createArcGISMapViewReadyErrorHandler,getArcGISMapFailureForSource,getArcGISMapSourceKey,observeArcGISComponentRegistration,observeArcGISMapLoadError,observeArcGISMapViewReadyError,resetArcGISMapFailureForSource};
|