@arcgis/core 6.0.0-next.19 → 6.0.0-next.20
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{e4af2a1ea01df7226ace.js → 3c277a0f099d67090d07.js} +1 -1
- package/assets/esri/core/workers/chunks/{eebbde81e56d69dc602f.js → 44f90e75c1dc3d726a95.js} +1 -1
- package/assets/esri/core/workers/chunks/{94baa354e50c03b82b25.js → 597db9c90f19092d8d66.js} +1 -1
- package/assets/esri/core/workers/chunks/768389f7f8dba6080df7.js +2 -0
- package/assets/esri/core/workers/chunks/{ae0563d573baf91e01f7.js → 8e4206068c6953bb7df2.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc0f54a2c15502b630ec.js → 949bee7b304e625a7891.js} +1 -1
- package/assets/esri/core/workers/chunks/{d62afb71f4ece4283994.js → 9bc3afe7013ef4ae737b.js} +1 -1
- package/assets/esri/core/workers/chunks/{f1df76f098a3cc924832.js → b5df193c93e9c19f9700.js} +1 -1
- package/assets/esri/core/workers/chunks/d678828726371243d5eb.js +1 -0
- package/assets/esri/core/workers/chunks/{02f8654852d389583891.js → e04fb83ab2634bc15cc7.js} +1 -1
- package/assets/esri/core/workers/chunks/e35641a3a4da8cfbcf54.js +1 -0
- package/assets/esri/core/workers/chunks/{f3cd610084e3f4d8656b.js → fc76aff0f7d95e517d8f.js} +1 -1
- package/config.js +1 -1
- package/core/mapCollectionUtils.js +1 -1
- package/form/elements.d.ts +46 -8
- package/form/elements.js +1 -1
- package/geometry/support/Indices.js +1 -1
- package/geometry/support/aaBoundingRect.js +1 -1
- package/geometry/support/ray.js +1 -1
- package/kernel.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/package.json +3 -3
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/DragZoom.js +1 -1
- package/views/3d/input/handlers/MouseWheelFov.js +1 -1
- package/views/3d/layers/graphics/extrudePolygon.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/layers/support/FeatureTile.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/GroundNavigationController.js +1 -1
- package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TextureReference.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/DOMContainer.d.ts +8 -6
- package/views/VideoView.d.ts +8 -6
- package/views/View.d.ts +4 -3
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/operations/RotateVertex.js +1 -1
- package/views/interactive/editGeometry/operations/ScaleVertex.js +1 -1
- package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRanges.d.ts +3 -0
- package/widgets/ScaleRangeSlider/types.d.ts +3 -3
- package/widgets/Search/LocatorSearchSource.d.ts +22 -1
- package/widgets/support/SelectionList/GroupLayerItem.d.ts +2 -0
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/ItemBase.d.ts +2 -0
- package/widgets/support/SelectionList/ItemBase.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/assets/esri/core/workers/chunks/792c90a67e63b98394c8.js +0 -1
- package/assets/esri/core/workers/chunks/b686cd74975da09b9c91.js +0 -2
- package/assets/esri/core/workers/chunks/f91bc1cb1014e05be763.js +0 -1
- /package/assets/esri/core/workers/chunks/{b686cd74975da09b9c91.js.LICENSE.txt → 768389f7f8dba6080df7.js.LICENSE.txt} +0 -0
|
@@ -147,9 +147,30 @@ export default class LocatorSearchSource extends SearchSource {
|
|
|
147
147
|
/**
|
|
148
148
|
* Constricts search results to a specified country code or to multiple country codes.
|
|
149
149
|
* For example, `"US"` for United States, or `"SE"` for Sweden. For both, use `"US, SE"`.
|
|
150
|
-
* This only applies to the World Geocode Service.
|
|
150
|
+
* This only applies to the World Geocode Service. The names can be obtained from the [service description page](https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer?f=pjson).
|
|
151
151
|
*
|
|
152
152
|
* @see [World Geocode Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm)
|
|
153
|
+
* @example
|
|
154
|
+
* // arcgis-search component
|
|
155
|
+
* <arcgis-search slot="top-right" include-default-sources-disabled></arcgis-search>
|
|
156
|
+
*
|
|
157
|
+
* <script type="module">
|
|
158
|
+
* // set-up a new LocatorSearchSource to work with the arcgis-search component
|
|
159
|
+
* const search = document.querySelector("arcgis-search");
|
|
160
|
+
* await search.componentOnReady();
|
|
161
|
+
* // set the search sources once the component is ready
|
|
162
|
+
* search.sources = [
|
|
163
|
+
* {
|
|
164
|
+
* url: "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer",
|
|
165
|
+
* singleLineFieldName: "SingleLine",
|
|
166
|
+
* apiKey: "YOUR_ACCESS_TOKEN",
|
|
167
|
+
* outFields: ["Addr_type"],
|
|
168
|
+
* name: "USA and Sweden Service",
|
|
169
|
+
* countryCode: "US, SE",
|
|
170
|
+
* placeholder: "USA and Sweden Only",
|
|
171
|
+
* }
|
|
172
|
+
* ];
|
|
173
|
+
* </script>
|
|
153
174
|
*/
|
|
154
175
|
accessor countryCode: string | null | undefined;
|
|
155
176
|
/**
|
|
@@ -26,6 +26,8 @@ export default class GroupLayerItem extends ItemBase {
|
|
|
26
26
|
* @default true
|
|
27
27
|
*/
|
|
28
28
|
accessor expanded: boolean;
|
|
29
|
+
/** Indicates this item contains at least one child item representing a table layer. */
|
|
30
|
+
get isTable(): boolean;
|
|
29
31
|
/** Set of child layer items. Can also be another GroupLayerItem in the case of [SubtypeGroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SubtypeGroupLayer/) or [KnowledgeGraphLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/KnowledgeGraphLayer/). */
|
|
30
32
|
get items(): ParentItem[];
|
|
31
33
|
/** Layer containing the sublayer that contains the selected features. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"./ItemBase.js";let i=class extends r{constructor(e){super(e),this._items=[],this.expanded=!0,this.layer=null}get items(){return this._items}get layers(){let{layer:e}=this;return e.type===`group`||e.type===`knowledge-graph`?e.layers.toArray().reverse():e.type===`subtype-group`?e.sublayers.toArray().reverse():[]}get maxVisibleFeatureCountExceeded(){return this.items.some(e=>e.maxVisibleFeatureCountExceeded)}get total(){return this.items.reduce((e,t)=>e+t.total,0)}get visible(){return this.items.some(e=>e.visible)}get visibleTotal(){return this.items.reduce((e,t)=>e+t.visibleTotal,0)}reset(){this.items.forEach(e=>e.reset())}async sync({controller:e,promises:t}){let{layers:n,viewModel:r}=this;this._items=r.layersToItems({controller:e,groupLayerItem:this,layers:n,promises:t})}};e([t()],i.prototype,`_items`,void 0),e([t()],i.prototype,`expanded`,void 0),e([t()],i.prototype,`items`,null),e([t({constructOnly:!0})],i.prototype,`layer`,void 0),e([t()],i.prototype,`layers`,null),e([t()],i.prototype,`maxVisibleFeatureCountExceeded`,null),e([t()],i.prototype,`total`,null),e([t()],i.prototype,`visible`,null),e([t()],i.prototype,`visibleTotal`,null),i=e([n(`esri.widgets.support.SelectionList.GroupLayerItem`)],i);const a=i;export{a as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"./ItemBase.js";let i=class extends r{constructor(e){super(e),this._items=[],this.expanded=!0,this.layer=null}get isTable(){return this.items.some(e=>e.isTable)}get items(){return this._items}get layers(){let{layer:e}=this;return e.type===`group`||e.type===`knowledge-graph`?e.layers.toArray().reverse():e.type===`subtype-group`?e.sublayers.toArray().reverse():[]}get maxVisibleFeatureCountExceeded(){return this.items.some(e=>e.maxVisibleFeatureCountExceeded)}get total(){return this.items.reduce((e,t)=>e+t.total,0)}get visible(){return this.items.some(e=>e.visible)}get visibleTotal(){return this.items.reduce((e,t)=>e+t.visibleTotal,0)}reset(){this.items.forEach(e=>e.reset())}async sync({controller:e,promises:t}){let{layers:n,viewModel:r}=this;this._items=r.layersToItems({controller:e,groupLayerItem:this,layers:n,promises:t})}};e([t()],i.prototype,`_items`,void 0),e([t()],i.prototype,`expanded`,void 0),e([t()],i.prototype,`isTable`,null),e([t()],i.prototype,`items`,null),e([t({constructOnly:!0})],i.prototype,`layer`,void 0),e([t()],i.prototype,`layers`,null),e([t()],i.prototype,`maxVisibleFeatureCountExceeded`,null),e([t()],i.prototype,`total`,null),e([t()],i.prototype,`visible`,null),e([t()],i.prototype,`visibleTotal`,null),i=e([n(`esri.widgets.support.SelectionList.GroupLayerItem`)],i);const a=i;export{a as default};
|
|
@@ -19,6 +19,8 @@ export default class ItemBase extends Accessor {
|
|
|
19
19
|
constructor(properties: ItemBaseProperties);
|
|
20
20
|
/** Icon used to represent the item. */
|
|
21
21
|
get iconName(): Icon["icon"];
|
|
22
|
+
/** Indicates this item represents a table layer. */
|
|
23
|
+
get isTable(): boolean;
|
|
22
24
|
/** Unique identifier used for the item. */
|
|
23
25
|
get key(): string;
|
|
24
26
|
/** Layer associated with the item. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{isTableLayer as i}from"../../../views/support/selectionUtils.js";import{getIconForLayer as a}from"../iconUtils.js";let o=class extends t{constructor(e){super(e),this.layer=null,this.viewModel=null}get _layerViewSuspended(){return this.layerView?.suspended===!0}get iconName(){return this.layerIsVisible?a(this.layer):`layer-hide`}get isTable(){return i(this.layer,this.view)}get layerIsVisible(){let{layer:e}=this,t=e.parent;return!(this._layerViewSuspended||!e.visible||t&&`visible`in t&&!t.visible)}get key(){return this.layer.id}get layerView(){return this.viewModel.layerViewMap.get(this.layer.id)}get title(){return this.layer.title}get view(){return this.viewModel.view}};e([n()],o.prototype,`_layerViewSuspended`,null),e([n()],o.prototype,`iconName`,null),e([n()],o.prototype,`isTable`,null),e([n()],o.prototype,`layerIsVisible`,null),e([n()],o.prototype,`key`,null),e([n({constructOnly:!0})],o.prototype,`layer`,void 0),e([n()],o.prototype,`layerView`,null),e([n()],o.prototype,`title`,null),e([n()],o.prototype,`view`,null),e([n()],o.prototype,`viewModel`,void 0),o=e([r(`esri.widgets.support.SelectionList.ItemBase`)],o);const s=o;export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import n from"../../../core/Collection.js";import r from"../../../core/Logger.js";import{removeMaybe as i,abortMaybe as a}from"../../../core/maybe.js";import{ignoreAbortErrors as o,debounce as s,whenOrTimeout as c}from"../../../core/promiseUtils.js";import{watch as l,on as u,sync as d,whenOnce as f}from"../../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as h}from"../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as g,isGroupLayer as _,isSubtypeSublayer as v}from"../../../layers/support/layerUtils.js";import{isSelectableLayerViewWithHighlights as y,isSelectableLayerWithObjectIds as b,isSelectableLayerWithGraphics as x,isSelectableLayer as S,isSelectableLayerBaseWithEditing as C}from"../../../views/support/selectionUtils.js";import{goTo as w}from"../goToUtils.js";import T from"./GroupLayerItem.js";import E from"./LayerItem.js";import{computeEffectiveCount as D,getNestedLayerItems as O,isLayerItem as k,isGroupLayerItem as A,getNestedFeatureItems as j}from"./selectionListUtils.js";let M=class extends t{constructor(e){super(e),this._allLayerItems=null,this._groupItemCache=new Map,this._hoverHighlightHandle=null,this._layerEditAbortControllers=new Map,this._layerEditHandles=new n,this._layerItemCache=new Map,this._onChangeAbortController=null,this._updatingHandles=new h,this.filterText=void 0,this.layer=null,this.maxVisibleFeatureCountPerLayer=500,this.selectionManager=null,this._onSelectionChangeController=async()=>{this._cancelOnSelectionChange();let e=new AbortController;this._onChangeAbortController=e,await this._updatingHandles.addPromise(o(this._generateListItems(e))),this._onChangeAbortController===e&&(this._onChangeAbortController=null),(this.layer&&this.effectiveSelectionManager?.getSelection(this.layer))?.length||(this.layer=null)},this._cancelOnSelectionChange=()=>this._onChangeAbortController?.abort(),this._onSelectionChangeDebounced=s(this._onSelectionChangeController,100),this._cancelOnLayerEdit=e=>this._layerEditAbortControllers.get(e)?.abort()}initialize(){this.addHandles([l(()=>[this.view,this.effectiveSelectionManager,...this._sources],()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),u(()=>this.effectiveSelectionManager?.sources,`change`,()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),u(()=>this.effectiveSelectionManager,`selection-change`,e=>{this._onSelectionManagerSelectionChange(e),this._onSelectionChange()},d)])}destroy(){this._cancelOnSelectionChange(),this.removeTemporaryHighlight(),this._updatingHandles.destroy(),this._layerEditHandles.drain(i),this._layerEditAbortControllers.forEach(a)}get _sources(){return this.effectiveSelectionManager?.sources.toArray()??[]}get activeLayerItem(){let{layer:e}=this;return e&&this.findLayerItem(e)}get allLayerItems(){return this._allLayerItems??[]}get effectiveCount(){return D(this.allLayerItems)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get isUpdating(){return!!(this._onChangeAbortController||this._updatingHandles.updating)}get layerItems(){return O(this.allLayerItems)}get layerViewMap(){let e=new Map,{view:t}=this;if(!t)return e;for(let n of t.allLayerViews)if(e.set(n.layer.id,n),g(n.layer))for(let t of n.layer.sublayers)e.set(t.id,n);return e}get maxVisibleFeatureCountExceeded(){return this.allLayerItems.some(e=>e.maxVisibleFeatureCountExceeded)}get state(){let{view:e}=this;return e?e.ready?this.effectiveSelectionManager?`ready`:`error`:`loading`:`disabled`}get viewLayersAndTables(){let{view:e}=this;return e?.map?[...e.map.layers.toArray().reverse(),...e.map.tables.toArray().reverse()]:[]}get visibleFeatureCount(){return this.activeLayerItem?.visibleTotal??this.visibleFeatureItems.length}get visibleFeatureItems(){return this.layerItems.flatMap(e=>e.featureItems.filter(e=>e.visible))}get visibleLayerCount(){let{effectiveSelectionManager:e}=this;return!e||e.count===0?0:e.count===1||this.activeLayerItem?1:this.layerItems.filter(e=>e.visible).length}addTemporaryHighlight(e){let{graphic:t,layerView:n}=e;this.removeTemporaryHighlight(),n&&t&&y(n)&&(this._hoverHighlightHandle=n.highlight(t,{name:`temporary`}))}collapseAll(){this._allLayerItems?.forEach(e=>e.expanded=!1)}clear(){this.effectiveSelectionManager?.clear()}deselectFeatureItem(e){let{layer:t,graphic:n,objectId:r}=e;b(t)&&r!=null?this.effectiveSelectionManager?.remove(t,[r]):x(t)&&this.effectiveSelectionManager?.remove(t,[n])}deselectGroupItem(e){e.items.forEach(e=>{k(e)?this.deselectLayerItem(e):this.deselectGroupItem(e)})}deselectLayerItem(e){let{layer:t}=e;this.replace({layer:t,selection:[]})}deselectItem(e){A(e)?this.deselectGroupItem(e):k(e)?this.deselectLayerItem(e):this.deselectFeatureItem(e)}expandAll(){this._allLayerItems?.forEach(e=>e.expanded=!0)}findLayerItem(e){return this.layerItems.find(t=>t.layer===e)}findParentItem(e){return this.allLayerItems.find(t=>t.layer===e)}goToItem(e){k(e)||A(e)?this._goTo(j([e]).map(e=>e.graphic)):this._goTo(e.graphic)}layersToItems(e){let{controller:t,groupLayerItem:n,layers:r,promises:i}=e,{_groupItemCache:a,_layerItemCache:o,effectiveSelectionManager:s,viewLayersAndTables:c}=this,l=r??c;if(!s||s.count===0)return[];let u=[];for(let e of l)switch(e.type){case`subtype-group`:case`knowledge-graph`:case`group`:{let n=a.get(e),r=n??new T({layer:e,viewModel:this});n||a.set(e,r),i.push(r.sync({controller:t,promises:i})),u.push(r)}break;default:if(S(e)){if(!s.getSelection(e)?.length)continue;let r=o.get(e),a=r??new E({groupLayerItem:n,layer:e,viewModel:this});r||o.set(e,a),i.push(a.sync({controller:t,promises:i})),u.push(a)}}return u}removeFromSelection(e){let{layer:t,selection:n}=e;(b(t)||x(t))&&this.effectiveSelectionManager?.remove(t,n)}removeTemporaryHighlight(){this._hoverHighlightHandle=i(this._hoverHighlightHandle)}selectSingleFeatureItem(e){let t=e.identifier;if(this.effectiveSelectionManager)for(let{layer:n}of this.effectiveSelectionManager.selections)this.replace({layer:n,selection:n===e.layer?[t]:[]})}selectSingleGroupItem(e){if(this.effectiveSelectionManager)for(let{layer:t,selection:n}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t.parent===e.layer?n:[]})}selectSingleItem(e){A(e)?this.selectSingleGroupItem(e):k(e)?this.selectSingleLayerItem(e):this.selectSingleFeatureItem(e)}selectSingleLayerItem(e){if(this.effectiveSelectionManager)for(let{layer:t,selection:n}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t===e.layer?n:[]})}replace(e){let{layer:t,selection:n}=e;(b(t)||x(t))&&this.effectiveSelectionManager?.replace(t,n)}async _goTo(e){let{view:t}=this;if(t)try{await w(t,e)}catch(e){e.name!==`AbortError`&&r.getLogger(this).warn(`Failed to go to feature(s)`,e)}}_onSelectionManagerSelectionChange(e){let{changes:t}=e,n=this.effectiveSelectionManager;n&&t.forEach(({layer:e})=>{let t=n.getSelection(e);t&&t.length!==0||this._expandParentItems(e)})}_expandParentItems(e){let t=this._layerItemCache.get(e);if(t&&(t.expanded=!0),_(e.parent)){let t=this._groupItemCache.get(e.parent);t&&(t.expanded=!0)}}async _generateListItems(e){try{this.removeTemporaryHighlight();let t=[],n=this.layersToItems({controller:e,promises:t});t.length>0&&await Promise.all(t),this._onChangeAbortController===e&&(this._allLayerItems=n)}catch(e){r.getLogger(this).warn(`Failed updating selection`,e)}}_onSelectionChange(){o(this._onSelectionChangeDebounced())}_refreshLayerEditHandles(){let{effectiveSelectionManager:e}=this;if(this._layerEditHandles.drain(i),!e?.sources.length)return;let t=new Set(e.sources.map(e=>v(e)?e.parent:e));for(let e of t)S(e)&&(x(e)?this._layerEditHandles.push(e.graphics.on(`change`,()=>void this._onLayerEdit(e))):C(e)&&this._layerEditHandles.push(e.on(`edits`,t=>void this._onLayerEdit(e,t))))}async _onLayerEdit(e,t){try{if(this.removeTemporaryHighlight(),this._cancelOnLayerEdit(e),t&&!t.updatedFeatures.some(e=>e.objectId!=null&&!e.error))return;let n=new AbortController;this._layerEditAbortControllers.set(e,n);let r=e.type===`subtype-group`||e.type===`knowledge-graph`?this.findParentItem(e):this.findLayerItem(e);if(r?.layerView){let e=r.layerView;if(await this._onLayerViewUpdate(e),n.signal.aborted)return;r.reset(),this._onSelectionChange()}this._layerEditAbortControllers.get(e)===n&&this._layerEditAbortControllers.delete(e)}catch(e){r.getLogger(this).warn(`Failed updating selected features`,e)}}async _onLayerViewUpdate(e){await c(f(()=>e.updating),2e3),await f(()=>!e.updating)}};e([p()],M.prototype,`_allLayerItems`,void 0),e([p()],M.prototype,`_groupItemCache`,void 0),e([p()],M.prototype,`_hoverHighlightHandle`,void 0),e([p()],M.prototype,`_layerEditAbortControllers`,void 0),e([p()],M.prototype,`_layerEditHandles`,void 0),e([p()],M.prototype,`_layerItemCache`,void 0),e([p()],M.prototype,`_onChangeAbortController`,void 0),e([p()],M.prototype,`_sources`,null),e([p()],M.prototype,`_updatingHandles`,void 0),e([p()],M.prototype,`activeLayerItem`,null),e([p()],M.prototype,`allLayerItems`,null),e([p()],M.prototype,`effectiveCount`,null),e([p()],M.prototype,`effectiveSelectionManager`,null),e([p()],M.prototype,`filterText`,void 0),e([p()],M.prototype,`isUpdating`,null),e([p()],M.prototype,`layer`,void 0),e([p()],M.prototype,`layerItems`,null),e([p()],M.prototype,`layerViewMap`,null),e([p()],M.prototype,`maxVisibleFeatureCountExceeded`,null),e([p()],M.prototype,`maxVisibleFeatureCountPerLayer`,void 0),e([p()],M.prototype,`selectionManager`,void 0),e([p()],M.prototype,`state`,null),e([p()],M.prototype,`view`,void 0),e([p()],M.prototype,`viewLayersAndTables`,null),e([p()],M.prototype,`visibleFeatureCount`,null),e([p()],M.prototype,`visibleFeatureItems`,null),e([p()],M.prototype,`visibleLayerCount`,null),M=e([m(`esri.widgets.support.SelectionList.SelectionListViewModel`)],M);const N=M;export{N as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import n from"../../../core/Collection.js";import r from"../../../core/Logger.js";import{removeMaybe as i,abortMaybe as a}from"../../../core/maybe.js";import{ignoreAbortErrors as o,debounce as s,whenOrTimeout as c}from"../../../core/promiseUtils.js";import{watch as l,on as u,sync as d,whenOnce as f}from"../../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as h}from"../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as g,isGroupLayer as _,isSubtypeSublayer as v}from"../../../layers/support/layerUtils.js";import{isSelectableLayerViewWithHighlights as y,isSelectableLayerWithObjectIds as b,isSelectableLayerWithGraphics as x,isSelectableLayer as S,isSelectableLayerBaseWithEditing as C}from"../../../views/support/selectionUtils.js";import{goTo as w}from"../goToUtils.js";import T from"./GroupLayerItem.js";import E from"./LayerItem.js";import{computeEffectiveCount as D,getNestedLayerItems as O,isLayerItem as k,isGroupLayerItem as A,getNestedFeatureItems as j}from"./selectionListUtils.js";let M=class extends t{constructor(e){super(e),this._allLayerItems=null,this._groupItemCache=new Map,this._hoverHighlightHandle=null,this._layerEditAbortControllers=new Map,this._layerEditHandles=new n,this._layerItemCache=new Map,this._onChangeAbortController=null,this._updatingHandles=new h,this.filterText=void 0,this.layer=null,this.maxVisibleFeatureCountPerLayer=500,this.selectionManager=null,this._onSelectionChangeController=async()=>{this._cancelOnSelectionChange();let e=new AbortController;this._onChangeAbortController=e,await this._updatingHandles.addPromise(o(this._generateListItems(e))),this._onChangeAbortController===e&&(this._onChangeAbortController=null),(this.layer&&this.effectiveSelectionManager?.getSelection(this.layer))?.length||(this.layer=null)},this._cancelOnSelectionChange=()=>this._onChangeAbortController?.abort(),this._onSelectionChangeDebounced=s(this._onSelectionChangeController,100),this._cancelOnLayerEdit=e=>this._layerEditAbortControllers.get(e)?.abort()}initialize(){this.addHandles([l(()=>[this.view,this.effectiveSelectionManager,...this._sources],()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),u(()=>this.effectiveSelectionManager?.sources,`change`,()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),u(()=>this.effectiveSelectionManager,`selection-change`,e=>{this._onSelectionManagerSelectionChange(e),this._onSelectionChange()},d)])}destroy(){this._cancelOnSelectionChange(),this.removeTemporaryHighlight(),this._updatingHandles.destroy(),this._layerEditHandles.drain(i),this._layerEditAbortControllers.forEach(a)}get _sources(){return this.effectiveSelectionManager?.sources.toArray()??[]}get activeLayerItem(){let{layer:e}=this;return e&&this.findLayerItem(e)}get allLayerItems(){return this._allLayerItems??[]}get effectiveCount(){return D(this.allLayerItems)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get isUpdating(){return!!(this._onChangeAbortController||this._updatingHandles.updating)}get layerItems(){return O(this.allLayerItems)}get layerViewMap(){let e=new Map,{view:t}=this;if(!t)return e;for(let n of t.allLayerViews)if(e.set(n.layer.id,n),g(n.layer))for(let t of n.layer.sublayers)e.set(t.id,n);return e}get maxVisibleFeatureCountExceeded(){return this.allLayerItems.some(e=>e.maxVisibleFeatureCountExceeded)}get state(){let{view:e}=this;return e?e.ready?this.effectiveSelectionManager?`ready`:`error`:`loading`:`disabled`}get viewLayersAndTables(){let{view:e}=this;return e?.map?[...e.map.layers.toArray().reverse(),...e.map.tables.toArray().reverse()]:[]}get visibleFeatureCount(){return this.activeLayerItem?.visibleTotal??this.visibleFeatureItems.length}get visibleFeatureItems(){return this.layerItems.flatMap(e=>e.featureItems.filter(e=>e.visible))}get visibleLayerCount(){let{effectiveSelectionManager:e}=this;return!e||e.count===0?0:e.count===1||this.activeLayerItem?1:this.layerItems.filter(e=>e.visible).length}addTemporaryHighlight(e){let{graphic:t,layerView:n}=e;this.removeTemporaryHighlight(),n&&t&&y(n)&&(this._hoverHighlightHandle=n.highlight(t,{name:`temporary`}))}collapseAll(){this._allLayerItems?.forEach(e=>e.expanded=!1)}clear(){this.effectiveSelectionManager?.clear()}deselectFeatureItem(e){let{layer:t,graphic:n,objectId:r}=e;b(t)&&r!=null?this.effectiveSelectionManager?.remove(t,[r]):x(t)&&this.effectiveSelectionManager?.remove(t,[n])}deselectGroupItem(e){e.items.forEach(e=>{k(e)?this.deselectLayerItem(e):this.deselectGroupItem(e)})}deselectLayerItem(e){let{layer:t}=e;this.replace({layer:t,selection:[]})}deselectItem(e){A(e)?this.deselectGroupItem(e):k(e)?this.deselectLayerItem(e):this.deselectFeatureItem(e)}expandAll(){this._allLayerItems?.forEach(e=>e.expanded=!0)}findLayerItem(e){return this.layerItems.find(t=>t.layer===e)}findParentItem(e){return this.allLayerItems.find(t=>t.layer===e)}goToItem(e){e.isTable||(k(e)||A(e)?this._goTo(j([e]).map(e=>e.graphic)):this._goTo(e.graphic))}layersToItems(e){let{controller:t,groupLayerItem:n,layers:r,promises:i}=e,{_groupItemCache:a,_layerItemCache:o,effectiveSelectionManager:s,viewLayersAndTables:c}=this,l=r??c;if(!s||s.count===0)return[];let u=[];for(let e of l)switch(e.type){case`subtype-group`:case`knowledge-graph`:case`group`:{let n=a.get(e),r=n??new T({layer:e,viewModel:this});n||a.set(e,r),i.push(r.sync({controller:t,promises:i})),u.push(r)}break;default:if(S(e)){if(!s.getSelection(e)?.length)continue;let r=o.get(e),a=r??new E({groupLayerItem:n,layer:e,viewModel:this});r||o.set(e,a),i.push(a.sync({controller:t,promises:i})),u.push(a)}}return u}removeFromSelection(e){let{layer:t,selection:n}=e;(b(t)||x(t))&&this.effectiveSelectionManager?.remove(t,n)}removeTemporaryHighlight(){this._hoverHighlightHandle=i(this._hoverHighlightHandle)}selectSingleFeatureItem(e){let t=e.identifier;if(this.effectiveSelectionManager)for(let{layer:n}of this.effectiveSelectionManager.selections)this.replace({layer:n,selection:n===e.layer?[t]:[]})}selectSingleGroupItem(e){if(this.effectiveSelectionManager)for(let{layer:t,selection:n}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t.parent===e.layer?n:[]})}selectSingleItem(e){A(e)?this.selectSingleGroupItem(e):k(e)?this.selectSingleLayerItem(e):this.selectSingleFeatureItem(e)}selectSingleLayerItem(e){if(this.effectiveSelectionManager)for(let{layer:t,selection:n}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t===e.layer?n:[]})}replace(e){let{layer:t,selection:n}=e;(b(t)||x(t))&&this.effectiveSelectionManager?.replace(t,n)}async _goTo(e){let{view:t}=this;if(t)try{await w(t,e)}catch(e){e.name!==`AbortError`&&r.getLogger(this).warn(`Failed to go to feature(s)`,e)}}_onSelectionManagerSelectionChange(e){let{changes:t}=e,n=this.effectiveSelectionManager;n&&t.forEach(({layer:e})=>{let t=n.getSelection(e);t&&t.length!==0||this._expandParentItems(e)})}_expandParentItems(e){let t=this._layerItemCache.get(e);if(t&&(t.expanded=!0),_(e.parent)){let t=this._groupItemCache.get(e.parent);t&&(t.expanded=!0)}}async _generateListItems(e){try{this.removeTemporaryHighlight();let t=[],n=this.layersToItems({controller:e,promises:t});t.length>0&&await Promise.all(t),this._onChangeAbortController===e&&(this._allLayerItems=n)}catch(e){r.getLogger(this).warn(`Failed updating selection`,e)}}_onSelectionChange(){o(this._onSelectionChangeDebounced())}_refreshLayerEditHandles(){let{effectiveSelectionManager:e}=this;if(this._layerEditHandles.drain(i),!e?.sources.length)return;let t=new Set(e.sources.map(e=>v(e)?e.parent:e));for(let e of t)S(e)&&(x(e)?this._layerEditHandles.push(e.graphics.on(`change`,()=>void this._onLayerEdit(e))):C(e)&&this._layerEditHandles.push(e.on(`edits`,t=>void this._onLayerEdit(e,t))))}async _onLayerEdit(e,t){try{if(this.removeTemporaryHighlight(),this._cancelOnLayerEdit(e),t&&!t.updatedFeatures.some(e=>e.objectId!=null&&!e.error))return;let n=new AbortController;this._layerEditAbortControllers.set(e,n);let r=e.type===`subtype-group`||e.type===`knowledge-graph`?this.findParentItem(e):this.findLayerItem(e);if(r?.layerView){let e=r.layerView;if(await this._onLayerViewUpdate(e),n.signal.aborted)return;r.reset(),this._onSelectionChange()}this._layerEditAbortControllers.get(e)===n&&this._layerEditAbortControllers.delete(e)}catch(e){r.getLogger(this).warn(`Failed updating selected features`,e)}}async _onLayerViewUpdate(e){await c(f(()=>e.updating),2e3),await f(()=>!e.updating)}};e([p()],M.prototype,`_allLayerItems`,void 0),e([p()],M.prototype,`_groupItemCache`,void 0),e([p()],M.prototype,`_hoverHighlightHandle`,void 0),e([p()],M.prototype,`_layerEditAbortControllers`,void 0),e([p()],M.prototype,`_layerEditHandles`,void 0),e([p()],M.prototype,`_layerItemCache`,void 0),e([p()],M.prototype,`_onChangeAbortController`,void 0),e([p()],M.prototype,`_sources`,null),e([p()],M.prototype,`_updatingHandles`,void 0),e([p()],M.prototype,`activeLayerItem`,null),e([p()],M.prototype,`allLayerItems`,null),e([p()],M.prototype,`effectiveCount`,null),e([p()],M.prototype,`effectiveSelectionManager`,null),e([p()],M.prototype,`filterText`,void 0),e([p()],M.prototype,`isUpdating`,null),e([p()],M.prototype,`layer`,void 0),e([p()],M.prototype,`layerItems`,null),e([p()],M.prototype,`layerViewMap`,null),e([p()],M.prototype,`maxVisibleFeatureCountExceeded`,null),e([p()],M.prototype,`maxVisibleFeatureCountPerLayer`,void 0),e([p()],M.prototype,`selectionManager`,void 0),e([p()],M.prototype,`state`,null),e([p()],M.prototype,`view`,void 0),e([p()],M.prototype,`viewLayersAndTables`,null),e([p()],M.prototype,`visibleFeatureCount`,null),e([p()],M.prototype,`visibleFeatureItems`,null),e([p()],M.prototype,`visibleLayerCount`,null),M=e([m(`esri.widgets.support.SelectionList.SelectionListViewModel`)],M);const N=M;export{N as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as n}from"../../intl.js";import{isSome as r}from"../../core/arrayUtils.js";import{on as i,watch as a}from"../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import c from"../Widget.js";import{loadCalciteComponents as l}from"./componentsUtils.js";import{globalCss as u}from"./globalCss.js";import{messageBundle as d,tsx as f}from"./widget.js";import{isGroupLayerItem as p,isLayerItem as m,isFeatureItem as h}from"./SelectionList/selectionListUtils.js";import g from"./SelectionList/SelectionListViewModel.js";import _ from"./SelectionList/VisibleElements.js";const v=`esri-selection-list`,y=`${v}__list-item`,b={base:v,container:`${v}__container`,flowItem:`${v}__flow-item`,layerDropdown:`${v}__layer-dropdown`,listItemFeature:`${y}__feature`,listItemFeatureIcon:`${y}__feature-icon`,listItemIcon:`${y}__icon`,itemCount:`${v}__item-count`,notice:`${v}__notice`,panel:`${v}__panel`,totalCount:`${v}__total-count`};let x=class extends c{constructor(e,n){super(e,n),this._iconIntersectionObserver=new IntersectionObserver((e,n)=>{e.forEach(async e=>{if(e.isIntersecting){let r=e.target;if(this._hasIcon(r)){n.unobserve(r);return}let i=this._getListItem(r);if(!i)return;this._setHasIcon(r,!0);let a=i.title?t(this.messagesLegend.previewTemplateAriaLabel,{label:i.title}):this.messagesCommon.preview,o=i.thumbnail??await i.fetchThumbnail({ariaLabel:a}).catch(()=>(this._setHasIcon(r,!1),null));if(o==null)return;r.appendChild(o)}})}),this._itemWithOpenMenu=null,this.displayMode=`group`,this.highlightOnHoverEnabled=!0,this.itemActionConfigs=null,this.itemUnavailableFunction=null,this.menuScale=`m`,this.messages=null,this.messagesCommon=null,this.messagesLegend=null,this.onListItemSelect=null,this.scale=`s`,this.title=null,this.viewModel=new g,this.visibleElements=new _,this._afterItemCreate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this.clear=this.clear.bind(this),this.collapseAll=this.collapseAll.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this)}initialize(){this.addHandles([i(()=>this.effectiveSelectionManager,`selection-change`,()=>this._closeItemMenu()),a(()=>this.highlightOnHoverEnabled,e=>{e||this.removeTemporaryHighlight()})])}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return l({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),chip:()=>import(`@esri/calcite-components/dist/components/calcite-chip`),combobox:()=>import(`@esri/calcite-components/dist/components/calcite-combobox`),"combobox-item":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item`),dropdown:()=>import(`@esri/calcite-components/dist/components/calcite-dropdown`),"dropdown-group":()=>import(`@esri/calcite-components/dist/components/calcite-dropdown-group`),"dropdown-item":()=>import(`@esri/calcite-components/dist/components/calcite-dropdown-item`),flow:()=>import(`@esri/calcite-components/dist/components/calcite-flow`),"flow-item":()=>import(`@esri/calcite-components/dist/components/calcite-flow-item`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),input:()=>import(`@esri/calcite-components/dist/components/calcite-input`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),panel:()=>import(`@esri/calcite-components/dist/components/calcite-panel`)})}get _effectiveTitle(){if(this.visibleElements.header)return this.title||this.messages?.selection}get _hasFilterText(){let{filterText:e}=this;return e!=null&&e!==``}get activeLayerItem(){return this.viewModel.activeLayerItem}get allLayerItems(){return this.viewModel.allLayerItems}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get filterText(){return this.viewModel.filterText}set filterText(e){this.viewModel.filterText=e}get icon(){return`selection`}set icon(e){this._overrideIfSome(`icon`,e)}get isUpdating(){return this.viewModel.isUpdating}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get state(){return this.viewModel.state}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}get visibleFeatureCount(){return this.viewModel.visibleFeatureCount}get visibleFeatureItems(){return this.viewModel.visibleFeatureItems}get visibleLayerCount(){return this.viewModel.visibleLayerCount}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseAll(){this.viewModel.collapseAll()}expandAll(){this.viewModel.expandAll()}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}replace(e){this.viewModel.replace(e)}render(){return f(`div`,{class:this.classes(b.base,u.widget,u.panel)},f(`calcite-flow`,null,f(`calcite-flow-item`,{class:b.flowItem,heading:this._effectiveTitle,loading:this.state===`loading`,overlayPositioning:`fixed`,scale:this.scale,selected:!0},f(`calcite-panel`,{class:b.panel,overlayPositioning:`fixed`,scale:this.scale},f(`div`,{class:b.container},this._renderActiveLayerDropdown(),this._renderFilterInput(),this._renderList(),this._renderFilterNotice())),this._renderTotalChip(),this._renderMenuActions())))}_renderTotalChip(){let{visibleElements:e}=this;if(!e.totalCount||!e.header)return;let{effectiveCount:r}=this,i=n(r),a=t(this.messages.selectionCount,{count:i});return f(`calcite-chip`,{appearance:`outline`,class:b.totalCount,closable:r>0,closed:r===0,icon:this.maxVisibleFeatureCountExceeded?`exclamation-mark-triangle`:void 0,label:i,scale:this.scale,slot:`header-actions-end`,title:a,onCalciteChipClose:this.clear},i)}_renderMenuActions(){let{visibleElements:e}=this;if(!e.header||!e.menu)return;let{menuScale:t}=this,n=this.effectiveCount===0;return[f(`calcite-action`,{disabled:n,icon:`reset`,key:`clear-action`,scale:t,slot:`header-menu-actions`,text:this.messagesCommon.clear,textEnabled:!0,onclick:this.clear}),f(`calcite-action`,{disabled:n,icon:`folders`,key:`collapse-action`,scale:t,slot:`header-menu-actions`,text:this.messages.collapseAll,textEnabled:!0,onclick:this.collapseAll})]}_renderActiveLayerDropdown(){let{layerItems:e,messages:n}=this;if(!(this.effectiveCount===0||e.length<2||!this.visibleElements.layerFilter))return f(`calcite-combobox`,{class:b.layerDropdown,label:n.filterByLayer,overlayPositioning:`fixed`,placeholder:n.filterByLayer,scale:this.scale,selectionMode:`single-persist`,topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:({currentTarget:e})=>{this.filterText=void 0;let t=e.selectedItems[0]?.value??void 0;this.layer=t===`all-layers`?void 0:t}},f(`calcite-combobox-item`,{heading:t(n.allLayersCount,{count:e.length}),icon:`layers`,key:`all-layers`,selected:this.layer==null,value:`all-layers`}),this.layerItems.map(e=>this._renderActiveLayerDropdownItem(e)))}_renderFilterInput(){if(this.visibleElements.filter&&this.effectiveCount!==0)return f(`calcite-input`,{clearable:!0,icon:`search`,placeholder:this.messages.filter,scale:this.scale,value:this.filterText,onCalciteInputInput:({target:{value:e}})=>{this.filterText=e}})}_renderActiveLayerDropdownItem(e){let t=e.title||this.messages.untitledLayer;return f(`calcite-combobox-item`,{heading:t,icon:e.iconName,key:e.key,selected:e.layer===this.layer,value:e.layer})}_renderList(){let{messages:e}=this;if(this.visibleFeatureCount!==0)return f(`calcite-list`,{bind:this,displayMode:`nested`,interactionMode:`interactive`,label:e.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:`none`},this._renderListContent(this.allLayerItems))}_renderListContent(e){return this.activeLayerItem?this._renderLayerItem(this.activeLayerItem):e.map(e=>p(e)?this._renderGroupItem(e):m(e)?this._renderLayerItem(e):null).filter(r)}_renderFilterNotice(){let{visibleElements:e}=this;if(!(this.state===`disabled`||this.visibleFeatureCount>0||!e.filter||!e.filterNotice))return f(`calcite-notice`,{class:b.notice,icon:`exclamation-mark-triangle`,kind:`info`,open:!0,scale:this.scale,width:`full`},f(`div`,{slot:`message`},this.messages.noMatchingFeatures))}_renderItemCount(e){if(!this.visibleElements.itemCount)return;let{messages:r}=this,i=n(e.total),a=n(e.visibleTotal),o=t(r.selectionCount,{count:i});return!this._hasFilterText&&e.maxVisibleFeatureCountExceeded?f(`span`,{class:b.itemCount,slot:`content-end`,title:o},f(`calcite-icon`,{icon:`exclamation-mark-triangle`,scale:`s`,title:r.tooManyFeatures}),`${n(this.maxVisibleFeatureCountPerLayer)}+`):f(`span`,{class:b.itemCount,slot:`content-end`,title:o},a)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;let{messages:t,messagesCommon:n}=this,r=this._itemWithOpenMenu===e,i=h(e),a=m(e),o=p(e),s=i?t.deselectFeature:a?t.deselectLayer:t.deselectGroup;return[f(`calcite-dropdown`,{"data-testid":`selection-list-dropdown`,open:r,overlayPositioning:`fixed`,placement:`bottom-end`,scale:this.menuScale,slot:`actions-end`,topLayerDisabled:this.topLayerDisabled,width:`m`,onCalciteDropdownClose:()=>this._closeItemMenu(e),onCalciteDropdownOpen:()=>{this._itemWithOpenMenu=e}},f(`calcite-action`,{"data-testid":`selection-list-dropdown-trigger`,icon:`ellipsis`,scale:this.scale,slot:`trigger`,text:n.menu,textEnabled:!1}),r?f(`calcite-dropdown-group`,{selectionMode:`none`},this.visibleElements.zoomToButton?f(`calcite-dropdown-item`,{iconStart:`layer-zoom-to`,key:`zoom-to`,onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo):void 0,f(`calcite-dropdown-item`,{iconStart:`selection-filter`,key:`select-single`,onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},i?t.onlySelectFeature:t.onlySelectThis),f(`calcite-dropdown-item`,{iconStart:`selection-x`,key:`clear-selection`,onCalciteDropdownItemSelect:()=>this.deselectItem(e)},s),this.itemActionConfigs?.map(t=>{let{disabled:n,hidden:r,label:s,type:c}=t;if(!(typeof r==`function`?r({item:e}):r)&&(!c||c===`feature`&&i||c===`layer`&&a||c===`group`&&o))return f(`calcite-dropdown-item`,{disabled:typeof n==`function`?n({item:e}):!!n,iconStart:t.icon??void 0,key:`custom-action-${s}`,onCalciteDropdownItemSelect:()=>t.callback({item:e})},s)})):void 0)]}_renderGroupItem(e){let t=e.title||this.messages.untitledLayer;if(e.visibleTotal===0)return;let{displayMode:n}=this;if(n===`layer`||n===`feature`)return this._renderListContent(e.items);let{visibleElements:r}=this;return f(`calcite-list-item`,{bind:this,closable:!!r.itemCloseActions,"data-type":`group`,expanded:e.expanded,iconStart:r.itemIcons?e.iconName:void 0,key:e.key,label:t,unavailable:this._itemIsUnavailable(e),value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemCollapse:()=>e.expanded=!1,onCalciteListItemExpand:()=>e.expanded=!0,onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemActions(e),this._renderListContent(e.items))}_renderLayerItem(e){if(e.visibleTotal===0||!e.visible)return;if(this.displayMode===`feature`)return this._renderItems(e.featureItems);let{messages:t,visibleElements:n}=this,r=e.title||t.untitledLayer;return f(`calcite-list-item`,{bind:this,closable:!!n.itemCloseActions,"data-type":`layer`,expanded:e.expanded,iconStart:n.itemIcons?e.iconName:void 0,key:e.key,label:r,scale:this.scale,title:e.layerIsVisible?void 0:t.layerIsNotVisible,unavailable:this._itemIsUnavailable(e),value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemCollapse:()=>e.expanded=!1,onCalciteListItemExpand:()=>e.expanded=!0,onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemCount(e),this._renderItemActions(e),this._renderItems(e.featureItems),e.maxVisibleFeatureCountExceeded?f(`calcite-notice`,{class:b.notice,icon:`exclamation-mark-triangle`,kind:`info`,open:!0,scale:this.scale},f(`div`,{slot:`message`},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map(e=>this._renderItem(e))}_renderItem(e){if(!e.visible)return;let{highlightOnHoverEnabled:t,messages:n,visibleElements:r}=this,i=e.title||n.untitledFeature,a=r.itemIcons&&this.displayMode!==`feature`,o=r.itemIcons&&e.supportsThumbnail;return f(`calcite-list-item`,{bind:this,class:a?b.listItemFeatureIcon:b.listItemFeature,closable:!!r.itemCloseActions,"data-item":e,"data-type":`feature`,iconStart:o?void 0:e.iconName,key:e.key,label:i,name:i,scale:this.scale,unavailable:this._itemIsUnavailable(e),value:i,onblur:t?()=>this.removeTemporaryHighlight():void 0,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t),onfocus:t?()=>this.addTemporaryHighlight(e):void 0,onpointerenter:t?()=>this.addTemporaryHighlight(e):void 0,onpointerleave:t?()=>this.removeTemporaryHighlight():void 0},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons&&e.supportsThumbnail)return f(`div`,{class:b.listItemIcon,key:`content-start`,slot:`content-start`},f(`span`,{afterCreate:this._afterItemCreate,afterRemoved:this._afterItemRemoved,"data-has-icon":!1,"data-item":e,key:e.thumbnailKey}))}_itemIsUnavailable(e){return this.itemUnavailableFunction?.({item:e})||!e.layerIsVisible}_getListItem(e){return e?.[`data-item`]}_hasIcon(e){return!!e?.[`data-has-icon`]}_setHasIcon(e,t){e&&(e[`data-has-icon`]=t)}_onListItemSelect(e,t){t.stopPropagation(),this._closeItemMenu(),this.onListItemSelect?.({item:e})}_closeItemMenu(e){e&&e!==this._itemWithOpenMenu||(this._itemWithOpenMenu=null)}};e([o()],x.prototype,`_effectiveTitle`,null),e([o()],x.prototype,`_hasFilterText`,null),e([o()],x.prototype,`_itemWithOpenMenu`,void 0),e([o()],x.prototype,`activeLayerItem`,null),e([o()],x.prototype,`allLayerItems`,null),e([o()],x.prototype,`displayMode`,void 0),e([o()],x.prototype,`effectiveCount`,null),e([o()],x.prototype,`effectiveSelectionManager`,null),e([o()],x.prototype,`filterText`,null),e([o()],x.prototype,`highlightOnHoverEnabled`,void 0),e([o()],x.prototype,`icon`,null),e([o()],x.prototype,`itemActionConfigs`,void 0),e([o()],x.prototype,`itemUnavailableFunction`,void 0),e([o()],x.prototype,`isUpdating`,null),e([o()],x.prototype,`label`,null),e([o()],x.prototype,`layer`,null),e([o()],x.prototype,`layerItems`,null),e([o()],x.prototype,`layerViewMap`,null),e([o()],x.prototype,`maxVisibleFeatureCountExceeded`,null),e([o()],x.prototype,`maxVisibleFeatureCountPerLayer`,null),e([o()],x.prototype,`menuScale`,void 0),e([o(),d(`esri/widgets/support/SelectionList/t9n/SelectionList`)],x.prototype,`messages`,void 0),e([o(),d(`esri/t9n/common`)],x.prototype,`messagesCommon`,void 0),e([o(),d(`esri/widgets/Legend/t9n/Legend`)],x.prototype,`messagesLegend`,void 0),e([o()],x.prototype,`onListItemSelect`,void 0),e([o()],x.prototype,`scale`,void 0),e([o()],x.prototype,`selectionManager`,null),e([o()],x.prototype,`state`,null),e([o()],x.prototype,`title`,void 0),e([o()],x.prototype,`view`,null),e([o()],x.prototype,`viewLayersAndTables`,null),e([o()],x.prototype,`viewModel`,void 0),e([o({type:_,nonNullable:!0})],x.prototype,`visibleElements`,void 0),e([o()],x.prototype,`visibleFeatureCount`,null),e([o()],x.prototype,`visibleFeatureItems`,null),e([o()],x.prototype,`visibleLayerCount`,null),x=e([s(`esri.widgets.support.SelectionList`)],x);const S=x;export{S as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as n}from"../../intl.js";import{isSome as r}from"../../core/arrayUtils.js";import{on as i,watch as a}from"../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import c from"../Widget.js";import{loadCalciteComponents as l}from"./componentsUtils.js";import{globalCss as u}from"./globalCss.js";import{messageBundle as d,tsx as f}from"./widget.js";import{isGroupLayerItem as p,isLayerItem as m,isFeatureItem as h}from"./SelectionList/selectionListUtils.js";import g from"./SelectionList/SelectionListViewModel.js";import _ from"./SelectionList/VisibleElements.js";const v=`esri-selection-list`,y=`${v}__list-item`,b={base:v,container:`${v}__container`,flowItem:`${v}__flow-item`,layerDropdown:`${v}__layer-dropdown`,listItemFeature:`${y}__feature`,listItemFeatureIcon:`${y}__feature-icon`,listItemIcon:`${y}__icon`,itemCount:`${v}__item-count`,notice:`${v}__notice`,panel:`${v}__panel`,totalCount:`${v}__total-count`};let x=class extends c{constructor(e,n){super(e,n),this._iconIntersectionObserver=new IntersectionObserver((e,n)=>{e.forEach(async e=>{if(e.isIntersecting){let r=e.target;if(this._hasIcon(r)){n.unobserve(r);return}let i=this._getListItem(r);if(!i)return;this._setHasIcon(r,!0);let a=i.title?t(this.messagesLegend.previewTemplateAriaLabel,{label:i.title}):this.messagesCommon.preview,o=i.thumbnail??await i.fetchThumbnail({ariaLabel:a}).catch(()=>(this._setHasIcon(r,!1),null));if(o==null)return;r.appendChild(o)}})}),this._itemWithOpenMenu=null,this.displayMode=`group`,this.highlightOnHoverEnabled=!0,this.itemActionConfigs=null,this.itemUnavailableFunction=null,this.menuScale=`m`,this.messages=null,this.messagesCommon=null,this.messagesLegend=null,this.onListItemSelect=null,this.scale=`s`,this.title=null,this.viewModel=new g,this.visibleElements=new _,this._afterItemCreate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this.clear=this.clear.bind(this),this.collapseAll=this.collapseAll.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this)}initialize(){this.addHandles([i(()=>this.effectiveSelectionManager,`selection-change`,()=>this._closeItemMenu()),a(()=>this.highlightOnHoverEnabled,e=>{e||this.removeTemporaryHighlight()})])}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return l({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),chip:()=>import(`@esri/calcite-components/dist/components/calcite-chip`),combobox:()=>import(`@esri/calcite-components/dist/components/calcite-combobox`),"combobox-item":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item`),dropdown:()=>import(`@esri/calcite-components/dist/components/calcite-dropdown`),"dropdown-group":()=>import(`@esri/calcite-components/dist/components/calcite-dropdown-group`),"dropdown-item":()=>import(`@esri/calcite-components/dist/components/calcite-dropdown-item`),flow:()=>import(`@esri/calcite-components/dist/components/calcite-flow`),"flow-item":()=>import(`@esri/calcite-components/dist/components/calcite-flow-item`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),input:()=>import(`@esri/calcite-components/dist/components/calcite-input`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),panel:()=>import(`@esri/calcite-components/dist/components/calcite-panel`)})}get _effectiveTitle(){if(this.visibleElements.header)return this.title||this.messages?.selection}get _hasFilterText(){let{filterText:e}=this;return e!=null&&e!==``}get activeLayerItem(){return this.viewModel.activeLayerItem}get allLayerItems(){return this.viewModel.allLayerItems}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get filterText(){return this.viewModel.filterText}set filterText(e){this.viewModel.filterText=e}get icon(){return`selection`}set icon(e){this._overrideIfSome(`icon`,e)}get isUpdating(){return this.viewModel.isUpdating}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get state(){return this.viewModel.state}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}get visibleFeatureCount(){return this.viewModel.visibleFeatureCount}get visibleFeatureItems(){return this.viewModel.visibleFeatureItems}get visibleLayerCount(){return this.viewModel.visibleLayerCount}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseAll(){this.viewModel.collapseAll()}expandAll(){this.viewModel.expandAll()}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}replace(e){this.viewModel.replace(e)}render(){return f(`div`,{class:this.classes(b.base,u.widget,u.panel)},f(`calcite-flow`,null,f(`calcite-flow-item`,{class:b.flowItem,heading:this._effectiveTitle,loading:this.state===`loading`,overlayPositioning:`fixed`,scale:this.scale,selected:!0},f(`calcite-panel`,{class:b.panel,overlayPositioning:`fixed`,scale:this.scale},f(`div`,{class:b.container},this._renderActiveLayerDropdown(),this._renderFilterInput(),this._renderList(),this._renderFilterNotice())),this._renderTotalChip(),this._renderMenuActions())))}_renderTotalChip(){let{visibleElements:e}=this;if(!e.totalCount||!e.header)return;let{effectiveCount:r}=this,i=n(r),a=t(this.messages.selectionCount,{count:i});return f(`calcite-chip`,{appearance:`outline`,class:b.totalCount,closable:r>0,closed:r===0,icon:this.maxVisibleFeatureCountExceeded?`exclamation-mark-triangle`:void 0,label:i,scale:this.scale,slot:`header-actions-end`,title:a,onCalciteChipClose:this.clear},i)}_renderMenuActions(){let{visibleElements:e}=this;if(!e.header||!e.menu)return;let{menuScale:t}=this,n=this.effectiveCount===0;return[f(`calcite-action`,{disabled:n,icon:`reset`,key:`clear-action`,scale:t,slot:`header-menu-actions`,text:this.messagesCommon.clear,textEnabled:!0,onclick:this.clear}),f(`calcite-action`,{disabled:n,icon:`folders`,key:`collapse-action`,scale:t,slot:`header-menu-actions`,text:this.messages.collapseAll,textEnabled:!0,onclick:this.collapseAll})]}_renderActiveLayerDropdown(){let{layerItems:e,messages:n}=this;if(!(this.effectiveCount===0||e.length<2||!this.visibleElements.layerFilter))return f(`calcite-combobox`,{class:b.layerDropdown,label:n.filterByLayer,overlayPositioning:`fixed`,placeholder:n.filterByLayer,scale:this.scale,selectionMode:`single-persist`,topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:({currentTarget:e})=>{this.filterText=void 0;let t=e.selectedItems[0]?.value??void 0;this.layer=t===`all-layers`?void 0:t}},f(`calcite-combobox-item`,{heading:t(n.allLayersCount,{count:e.length}),icon:`layers`,key:`all-layers`,selected:this.layer==null,value:`all-layers`}),this.layerItems.map(e=>this._renderActiveLayerDropdownItem(e)))}_renderFilterInput(){if(this.visibleElements.filter&&this.effectiveCount!==0)return f(`calcite-input`,{clearable:!0,icon:`search`,placeholder:this.messages.filter,scale:this.scale,value:this.filterText,onCalciteInputInput:({target:{value:e}})=>{this.filterText=e}})}_renderActiveLayerDropdownItem(e){let t=e.title||this.messages.untitledLayer;return f(`calcite-combobox-item`,{heading:t,icon:e.iconName,key:e.key,selected:e.layer===this.layer,value:e.layer})}_renderList(){let{messages:e}=this;if(this.visibleFeatureCount!==0)return f(`calcite-list`,{bind:this,displayMode:`nested`,interactionMode:`interactive`,label:e.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:`none`},this._renderListContent(this.allLayerItems))}_renderListContent(e){return this.activeLayerItem?this._renderLayerItem(this.activeLayerItem):e.map(e=>p(e)?this._renderGroupItem(e):m(e)?this._renderLayerItem(e):null).filter(r)}_renderFilterNotice(){let{visibleElements:e}=this;if(!(this.state===`disabled`||this.visibleFeatureCount>0||!e.filter||!e.filterNotice))return f(`calcite-notice`,{class:b.notice,icon:`exclamation-mark-triangle`,kind:`info`,open:!0,scale:this.scale,width:`full`},f(`div`,{slot:`message`},this.messages.noMatchingFeatures))}_renderItemCount(e){if(!this.visibleElements.itemCount)return;let{messages:r}=this,i=n(e.total),a=n(e.visibleTotal),o=t(r.selectionCount,{count:i});return!this._hasFilterText&&e.maxVisibleFeatureCountExceeded?f(`span`,{class:b.itemCount,slot:`content-end`,title:o},f(`calcite-icon`,{icon:`exclamation-mark-triangle`,scale:`s`,title:r.tooManyFeatures}),`${n(this.maxVisibleFeatureCountPerLayer)}+`):f(`span`,{class:b.itemCount,slot:`content-end`,title:o},a)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;let{messages:t,messagesCommon:n}=this,r=this._itemWithOpenMenu===e,i=h(e),a=m(e),o=p(e),s=i?t.deselectFeature:a?t.deselectLayer:t.deselectGroup;return[f(`calcite-dropdown`,{"data-testid":`selection-list-dropdown`,open:r,overlayPositioning:`fixed`,placement:`bottom-end`,scale:this.menuScale,slot:`actions-end`,topLayerDisabled:this.topLayerDisabled,width:`m`,onCalciteDropdownClose:()=>this._closeItemMenu(e),onCalciteDropdownOpen:()=>{this._itemWithOpenMenu=e}},f(`calcite-action`,{"data-testid":`selection-list-dropdown-trigger`,icon:`ellipsis`,scale:this.scale,slot:`trigger`,text:n.menu,textEnabled:!1}),r?f(`calcite-dropdown-group`,{selectionMode:`none`},this.visibleElements.zoomToButton&&!e.isTable?f(`calcite-dropdown-item`,{iconStart:`layer-zoom-to`,key:`zoom-to`,onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo):void 0,f(`calcite-dropdown-item`,{iconStart:`selection-filter`,key:`select-single`,onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},i?t.onlySelectFeature:t.onlySelectThis),f(`calcite-dropdown-item`,{iconStart:`selection-x`,key:`clear-selection`,onCalciteDropdownItemSelect:()=>this.deselectItem(e)},s),this.itemActionConfigs?.map(t=>{let{disabled:n,hidden:r,label:s,type:c}=t;if(!(typeof r==`function`?r({item:e}):r)&&(!c||c===`feature`&&i||c===`layer`&&a||c===`group`&&o))return f(`calcite-dropdown-item`,{disabled:typeof n==`function`?n({item:e}):!!n,iconStart:t.icon??void 0,key:`custom-action-${s}`,onCalciteDropdownItemSelect:()=>t.callback({item:e})},s)})):void 0)]}_renderGroupItem(e){let t=e.title||this.messages.untitledLayer;if(e.visibleTotal===0)return;let{displayMode:n}=this;if(n===`layer`||n===`feature`)return this._renderListContent(e.items);let{visibleElements:r}=this;return f(`calcite-list-item`,{bind:this,closable:!!r.itemCloseActions,"data-type":`group`,expanded:e.expanded,iconStart:r.itemIcons?e.iconName:void 0,key:e.key,label:t,unavailable:this._itemIsUnavailable(e),value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemCollapse:()=>e.expanded=!1,onCalciteListItemExpand:()=>e.expanded=!0,onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemActions(e),this._renderListContent(e.items))}_renderLayerItem(e){if(e.visibleTotal===0||!e.visible)return;if(this.displayMode===`feature`)return this._renderItems(e.featureItems);let{messages:t,visibleElements:n}=this,r=e.title||t.untitledLayer;return f(`calcite-list-item`,{bind:this,closable:!!n.itemCloseActions,"data-type":`layer`,expanded:e.expanded,iconStart:n.itemIcons?e.iconName:void 0,key:e.key,label:r,scale:this.scale,title:e.layerIsVisible?void 0:t.layerIsNotVisible,unavailable:this._itemIsUnavailable(e),value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemCollapse:()=>e.expanded=!1,onCalciteListItemExpand:()=>e.expanded=!0,onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemCount(e),this._renderItemActions(e),this._renderItems(e.featureItems),e.maxVisibleFeatureCountExceeded?f(`calcite-notice`,{class:b.notice,icon:`exclamation-mark-triangle`,kind:`info`,open:!0,scale:this.scale},f(`div`,{slot:`message`},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map(e=>this._renderItem(e))}_renderItem(e){if(!e.visible)return;let{highlightOnHoverEnabled:t,messages:n,visibleElements:r}=this,i=e.title||n.untitledFeature,a=r.itemIcons&&this.displayMode!==`feature`,o=r.itemIcons&&e.supportsThumbnail;return f(`calcite-list-item`,{bind:this,class:a?b.listItemFeatureIcon:b.listItemFeature,closable:!!r.itemCloseActions,"data-item":e,"data-type":`feature`,iconStart:o?void 0:e.iconName,key:e.key,label:i,name:i,scale:this.scale,unavailable:this._itemIsUnavailable(e),value:i,onblur:t?()=>this.removeTemporaryHighlight():void 0,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t),onfocus:t?()=>this.addTemporaryHighlight(e):void 0,onpointerenter:t?()=>this.addTemporaryHighlight(e):void 0,onpointerleave:t?()=>this.removeTemporaryHighlight():void 0},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons&&e.supportsThumbnail)return f(`div`,{class:b.listItemIcon,key:`content-start`,slot:`content-start`},f(`span`,{afterCreate:this._afterItemCreate,afterRemoved:this._afterItemRemoved,"data-has-icon":!1,"data-item":e,key:e.thumbnailKey}))}_itemIsUnavailable(e){return this.itemUnavailableFunction?.({item:e})||!e.layerIsVisible}_getListItem(e){return e?.[`data-item`]}_hasIcon(e){return!!e?.[`data-has-icon`]}_setHasIcon(e,t){e&&(e[`data-has-icon`]=t)}_onListItemSelect(e,t){t.stopPropagation(),this._closeItemMenu(),this.onListItemSelect?.({item:e})}_closeItemMenu(e){e&&e!==this._itemWithOpenMenu||(this._itemWithOpenMenu=null)}};e([o()],x.prototype,`_effectiveTitle`,null),e([o()],x.prototype,`_hasFilterText`,null),e([o()],x.prototype,`_itemWithOpenMenu`,void 0),e([o()],x.prototype,`activeLayerItem`,null),e([o()],x.prototype,`allLayerItems`,null),e([o()],x.prototype,`displayMode`,void 0),e([o()],x.prototype,`effectiveCount`,null),e([o()],x.prototype,`effectiveSelectionManager`,null),e([o()],x.prototype,`filterText`,null),e([o()],x.prototype,`highlightOnHoverEnabled`,void 0),e([o()],x.prototype,`icon`,null),e([o()],x.prototype,`itemActionConfigs`,void 0),e([o()],x.prototype,`itemUnavailableFunction`,void 0),e([o()],x.prototype,`isUpdating`,null),e([o()],x.prototype,`label`,null),e([o()],x.prototype,`layer`,null),e([o()],x.prototype,`layerItems`,null),e([o()],x.prototype,`layerViewMap`,null),e([o()],x.prototype,`maxVisibleFeatureCountExceeded`,null),e([o()],x.prototype,`maxVisibleFeatureCountPerLayer`,null),e([o()],x.prototype,`menuScale`,void 0),e([o(),d(`esri/widgets/support/SelectionList/t9n/SelectionList`)],x.prototype,`messages`,void 0),e([o(),d(`esri/t9n/common`)],x.prototype,`messagesCommon`,void 0),e([o(),d(`esri/widgets/Legend/t9n/Legend`)],x.prototype,`messagesLegend`,void 0),e([o()],x.prototype,`onListItemSelect`,void 0),e([o()],x.prototype,`scale`,void 0),e([o()],x.prototype,`selectionManager`,null),e([o()],x.prototype,`state`,null),e([o()],x.prototype,`title`,void 0),e([o()],x.prototype,`view`,null),e([o()],x.prototype,`viewLayersAndTables`,null),e([o()],x.prototype,`viewModel`,void 0),e([o({type:_,nonNullable:!0})],x.prototype,`visibleElements`,void 0),e([o()],x.prototype,`visibleFeatureCount`,null),e([o()],x.prototype,`visibleFeatureItems`,null),e([o()],x.prototype,`visibleLayerCount`,null),x=e([s(`esri.widgets.support.SelectionList`)],x);const S=x;export{S as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9616],{32198(t,e,n){function r(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(i=t[u])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function i(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],n&&(i=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}n.d(e,{Cg:()=>r,hk:()=>a,mS:()=>i}),Object.create,Object.create;var o="function"==typeof SuppressedError?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function a(t){function e(e){t.error=t.hasError?new o(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}var n,r=0;return function i(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(i);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(o).then(i,function(t){return e(t),i()})}else r|=1}catch(t){e(t)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}},69052(t,e,n){n.d(e,{hr:()=>i});var r=n(34727);class i{constructor(t,e){this.min=t,this.max=e,this.range=e-t}normalize(t,e=0,n=!1){return o(this.range,this.min,this.max,t,e,n)}clamp(t,e=0){return(0,r.qE)(t-e,this.min,this.max)+e}monotonic(t,e,n){return t<e?e:e+a(this.range,t-e,n)}minimalMonotonic(t,e,n){return o(this.range,t,t+this.range,e,n)}center(t,e,n){return e=this.monotonic(t,e,n),this.normalize((t+e)/2,n)}diff(t,e,n){return this.monotonic(t,e,n)-t}shortestSignedDiff(t,e){t=this.normalize(t);let n=(e=this.normalize(e))-t,r=e<t?this.minimalMonotonic(t,e)-t:e-this.minimalMonotonic(e,t);return Math.abs(n)<Math.abs(r)?n:r}contains(t,e,n){return e=this.minimalMonotonic(t,e),(n=this.minimalMonotonic(t,n))>t&&n<e}}function o(t,e,n,r,i=0,o=!1){return(r-=i)<e?r+=a(t,e-r):r>n&&(r-=a(t,r-n)),o&&r===n&&(r=e),r+i}function a(t,e,n=0){return Math.ceil((e-n)/t)*t+n}const u=new i(0,2*Math.PI),s=(new i(-Math.PI,Math.PI),new i(0,360));n.d(e,["ie",0,s,"uC",0,u])},34727(t,e,n){n.d(e,{$8:()=>E,Cc:()=>u,Hx:()=>M,Io:()=>v,KJ:()=>h,OS:()=>D,Sp:()=>m,XM:()=>f,YN:()=>c,ZH:()=>p,b6:()=>S,cU:()=>i,gg:()=>d,hs:()=>s,kU:()=>l,mP:()=>a,or:()=>P,pF:()=>A,qE:()=>o});const r=new Float32Array(1);function i(t){--t;for(let e=1;e<32;e<<=1)t|=t>>e;return t+1}function o(t,e,n){return Math.min(Math.max(t,e),n)}function a(t,e){return 0===e?0:Math.ceil(t/e)*e}function u(t,e,n){return t+(e-t)*n}function s(t,e,n,r,i){return u(r,i,(t-e)/(n-e))}function l(t){return t*Math.PI/180}function h(t){return 180*t/Math.PI}function f(t){return Math.acos(o(t,-1,1))}function c(t){return Math.asin(o(t,-1,1))}function m(t,e,n=1e-6){return t===e||!(!Number.isFinite(t)||!Number.isFinite(e))&&(t>e?t-e:e-t)<=n}function d(t,e,n=1e-6){return!m(t,e,n)&&t>e}function p(t,e,n=1e-6){return!m(t,e,n)&&t<e}function M(t,e,n=1e-6){return m(t,e,n)||t>e}const g=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function y(t){return g.setFloat64(0,t),g.getBigInt64(0)}const w=1000000n,x=b(1);function b(t){let e=y(t=Math.abs(t)),n=function(t){return g.setBigInt64(0,t),g.getFloat64(0)}(e<=w?w:e-w);return Math.abs(t-n)}function v(t,e,n=x){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;if(null!=n&&b(Math.min(Math.abs(t),Math.abs(e)))<n)return Math.abs(t-e)<=n;let r=y(t),i=y(e);return!(r<0!=i<0||(r<i?i-r:r-i)>w)}function S(t,e,n=1e-6){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;let r=Math.abs(t-e),i=Math.abs(t),o=Math.abs(e);if(0===t||0===e||i<1e-12&&o<1e-12){if(r>.01*n)return!1}else if(r/(i+o)>n)return!1;return!0}function E(t){return F(Math.max(-k,Math.min(t,k)))}function F(t){return r[0]=t,r[0]}function P(t){let e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],r=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(m(e,1)&&m(n,1)&&m(r,1))}function D(t,e){return(t%e+e)%e}const k=F(34028234663852886e22);function A(t,e,n){if(void 0===n||0==+n)return Math[t](e);if(e=+e,n=+n,isNaN(e)||"number"!=typeof n||n%1!=0)return NaN;let r=e.toString().split("e");return r=(e=Math[t](+(r[0]+"e"+(r[1]?+r[1]-n:-n)))).toString().split("e"),+(r[0]+"e"+(r[1]?+r[1]+n:n))}n.d(e,["pq",0,k])},19419(t,e,n){n.d(e,{$9:()=>S,C:()=>o,DC:()=>d,HY:()=>v,IO:()=>f,Ie:()=>F,Rj:()=>b,Uc:()=>x,VL:()=>p,VY:()=>u,Wc:()=>g,aI:()=>D,bx:()=>c,fA:()=>a,fT:()=>m,gR:()=>E,gX:()=>y,ib:()=>w,nw:()=>h,pJ:()=>k,tK:()=>l,uJ:()=>M,vt:()=>i,w1:()=>s}),n(34727);var r=n(5443);function i(t=j){return[t[0],t[1],t[2],t[3]]}function o(t,e){return t!==e&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]),t}function a(t,e,n,r,o=i()){return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o}function u(t,e=i()){return e[0]=t.xmin,e[1]=t.ymin,e[2]=t.xmax,e[3]=t.ymax,e}function s(t,e,n=new r.A){return n.xmin=t[0],n.ymin=t[1],n.xmax=t[2],n.ymax=t[3],n.spatialReference=e,n}function l(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function h(t,e){e<t[0]&&(t[0]=e),e>t[2]&&(t[2]=e)}function f(t,e){e<t[1]&&(t[1]=e),e>t[3]&&(t[3]=e)}function c(t,{xmin:e,ymin:n,xmax:r,ymax:i}){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],r),t[3]=Math.max(t[3],i)}function m(t,e,n){if(null==e)o(n,t);else if("length"in e)P(e)?(n[0]=Math.min(t[0],e[0]),n[1]=Math.min(t[1],e[1]),n[2]=Math.max(t[2],e[2]),n[3]=Math.max(t[3],e[3])):(2===e.length||3===e.length)&&(n[0]=Math.min(t[0],e[0]),n[1]=Math.min(t[1],e[1]),n[2]=Math.max(t[2],e[0]),n[3]=Math.max(t[3],e[1]));else switch(e.type){case"extent":n[0]=Math.min(t[0],e.xmin),n[1]=Math.min(t[1],e.ymin),n[2]=Math.max(t[2],e.xmax),n[3]=Math.max(t[3],e.ymax);break;case"point":n[0]=Math.min(t[0],e.x),n[1]=Math.min(t[1],e.y),n[2]=Math.max(t[2],e.x),n[3]=Math.max(t[3],e.y)}}function d(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[2]),t[3]=Math.max(t[3],e[3])}function p(t){return null==t||t[0]>=t[2]?0:t[2]-t[0]}function M(t){return null==t||t[1]>=t[3]?0:t[3]-t[1]}function g(t){return p(t)*M(t)}function y(t,e=[0,0]){return e[0]=(t[0]+t[2])/2,e[1]=(t[1]+t[3])/2,e}function w(t){let e=p(t),n=M(t);return Math.sqrt(e*e+n*n)}function x(t,e){return b(t,e[0],e[1])}function b(t,e,n){return e>=t[0]&&n>=t[1]&&e<=t[2]&&n<=t[3]}function v(t,e){return Math.max(e[0],t[0])<=Math.min(e[2],t[2])&&Math.max(e[1],t[1])<=Math.min(e[3],t[3])}function S(t,e,n){return Math.max(e[0],t[0])-n<=Math.min(e[2],t[2])&&Math.max(e[1],t[1])-n<=Math.min(e[3],t[3])}function E(t,e){return e[0]>=t[0]&&e[2]<=t[2]&&e[1]>=t[1]&&e[3]<=t[3]}function F(t){return t?o(t,A):i(A)}function P(t){return null!=t&&4===t.length}function D(t,e){return P(t)&&P(e)?t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]:t===e}function k(t,e){if(4!==e.length||t[0]===t[2]||t[1]===t[3])return!1;for(let n=0;n<e.length;n++){let r=e[n],i=e[(n+1)%e.length];if(r[0]!==t[0]&&r[0]!==t[2]||r[1]!==t[1]&&r[1]!==t[3])return!1;let o=r[1]===i[1]&&r[0]!==i[0],a=r[0]===i[0]&&r[1]!==i[1];if(!o&&!a)return!1}return!0}const A=[1/0,1/0,-1/0,-1/0],j=[0,0,0,0];n.d(e,["qv",0,A])},49616(t,e,n){n.r(e),n.d(e,{default:()=>h});var r=n(32198),i=n(91429),o=n(19419),a=n(69052);n(21325);var u=n(97441);function s(t,e,n){let[r,i]=n.modelSize,s=null,l=new Map;e.forEach(e=>{l.set(e.lij,(0,u.DE)(t,e))});let h=(t,e,n)=>(0,o.Rj)(t.extent,e,n);return(u,f)=>{let c=Math.round(u),m=Math.round(f);if(!t.wrapAround&&(c<0||c>=r||m<0||m>=i))return[0,0];let[d,p]=function(t,e,n,r){let{extent:i,modelSize:u,valid:s}=t,[l,h,f]=i,c=function(t,e,n){if(null!=n&&t>e){let[r,i]=n;return i-t+(e-r)}return e-t}(l,f,s),m=e/u[0]*c+l;return null!=s&&r&&(m=new a.hr(s[0],s[1]).normalize(m)),[m,(u[1]-n)/u[1]*(0,o.uJ)(i)+h]}(n,u,f,!0);if(!function(t,e,n){let{extent:r,valid:i}=t,[o,a,u,s]=r;return!(n<a||n>s)&&(null!=i&&o>u?e>=u||e<=o:e>=o&&e<=u)}(n,d,p))return[0,0];if(null==s||!h(s,d,p)){s=null;for(let[t,n]of e)if(h(n,d,p)){s=n;break}}if(null==s?.data)return[0,0];let M=l.get(s.lij);if(null==M)return[0,0];let{width:g,height:y,extent:w}=s;return M((d-w[0])/(0,o.VL)(w)*g,y-(p-w[1])/(0,o.uJ)(w)*y)}}let l=class{constructor(){this._tileData=new Map}async generateStreamlines(t){let{flowData:e,flowExtentInfo:n,needsMagnitude:r,simulationSettings:i,startPositions:o}=t,a=f((0,u.DE)(i,e),i,n.modelSize,r,o);return{result:{streamlines:a},transferList:a?.map(t=>t.vertices.buffer)}}async generateTiledStreamlines(t){let{flowDataTiles:e,flowExtentInfo:n,needsMagnitude:r,reset:i,simulationSettings:o,startPositions:a}=t;this._updateTileData(e,i);let u=f(s(o,this._tileData,n),o,n.modelSize,r,a);return{result:{streamlines:u},transferList:u?.map(t=>t.vertices.buffer)??[]}}_updateTileData(t,e){if(e)for(let e of this._tileData.keys())t.has(e)||this._tileData.delete(e);t.forEach((t,e)=>{"delete"===t.type?this._tileData.delete(e):"on-worker"!==t.type&&"invalid"!==t.type&&this._tileData.set(e,t.data)})}};l=(0,r.Cg)([(0,i.$K)("esri.views.3d.support.flow.FlowWorker")],l);const h=l;function f(t,e,n,r,i){if(null==t)return;let o=(0,u.S1)(e,t,n[0],n[1],{positions:i}),a=[],s=function(t){return t?4:3}(r);for(let{vertices:t,stage:e}of o){let n=new Float32Array(t.length*s);for(let e=0;e<t.length;e++)n[e*s]=t[e].x,n[e*s+1]=t[e].y,n[e*s+2]=t[e].time,r&&(n[e*s+3]=t[e].speed);a.push({vertices:n,stage:e,hasMagnitude:r})}return a}},97441(t,e,n){n.d(e,{DE:()=>s,S1:()=>a,dF:()=>u}),n(44208),n(53966);var r=n(34727),i=n(87811),o=n(78659);function a(t,e,n,r,o){if(t.density<=0)return[];let{positions:a}=o,u=[],s=new i.A,f=1/Math.max(t.lineCollisionWidth,1),c=Math.round(n*f),m=Math.round(r*f),d=new Int32Array(c*m);for(let t=0;t<d.length;t++)d[t]=-1;let p={raster:d,width:c,height:m,resolutionFactor:f},M={},g=t.lineSpacing/Math.sqrt(t.density),y=Math.floor(r/g),w=Math.floor(n/g);for(let t=0;t<y;t++){let e=t*g;for(let n=0;n<w;n++){let r=n*g;M[`${n}-${t}`]={x:r,y:e,positions:[]}}}for(let{x:t,y:e}of a){let n=M[`${Math.floor(t/g)}-${Math.floor(e/g)}`];n&&n.positions.push([t,e])}let x=[];for(let t in M){let e=M[t];if(0===e.positions.length)x.push({x:e.x+g/2,y:e.y+g/2,sort:.66+.33*s.getFloat(),stage:0});else{let[t]=e.positions.splice(0,1);x.push({x:t[0],y:t[1],sort:.33*s.getFloat(),stage:1});for(let[t,n]of e.positions)x.push({x:t,y:n,sort:.33+.33*s.getFloat(),stage:2})}}x.sort((t,e)=>t.sort-e.sort);for(let{x:i,y:o,stage:a}of x){if(u.length>=t.maxNumberOfStreamlines)break;let f=t.onlyForwardTracing?l(1,t,e,i,o,[n,r],u.length,p):h(t,e,i,o,[n,r],u.length,s,p);f.length<2||u.push({stage:a,vertices:f})}return u}function u(t){for(let e=0;e<t.mask.length;e++)0===t.mask[e]&&(t.data[2*e]=0,t.data[2*e+1]=0)}function s(t,e){let n=function(t,e,n,r){if(0===r)return t;let i=Math.round(3*r),o=Array(2*i+1),a=0;for(let t=-i;t<=i;t++){let e=Math.exp(-t*t/(r*r));o[t+i]=e,a+=e}for(let t=-i;t<=i;t++)o[t+i]/=a;let u=new Float32Array(t.length);for(let r=0;r<n;r++)for(let n=0;n<e;n++){let a=0,s=0;for(let u=-i;u<=i;u++){if(n+u<0||n+u>=e)continue;let l=o[u+i];a+=l*t[2*(r*e+(n+u))],s+=l*t[2*(r*e+(n+u))+1]}u[2*(r*e+n)]=a,u[2*(r*e+n)+1]=s}let s=new Float32Array(t.length);for(let t=0;t<e;t++)for(let r=0;r<n;r++){let a=0,l=0;for(let s=-i;s<=i;s++){if(r+s<0||r+s>=n)continue;let h=o[s+i];a+=h*u[2*((r+s)*e+t)],l+=h*u[2*((r+s)*e+t)+1]}s[2*(r*e+t)]=a,s[2*(r*e+t)+1]=l}return s}(e.data,e.width,e.height,t.smoothing);return t.interpolate?(t,r)=>{let i=Math.floor(t),o=Math.floor(r);if(i<0||i>=e.width||o<0||o>=e.height)return[0,0];let a=t-i,u=r-o,s=i,l=o,h=i<e.width-1?i+1:i,f=o<e.height-1?o+1:o,c=n[2*(l*e.width+s)],m=n[2*(l*e.width+h)],d=n[2*(f*e.width+s)],p=n[2*(f*e.width+h)],M=n[2*(l*e.width+s)+1],g=n[2*(l*e.width+h)+1];return[(c*(1-u)+d*u)*(1-a)+(m*(1-u)+p*u)*a,(M*(1-u)+n[2*(f*e.width+s)+1]*u)*(1-a)+(g*(1-u)+n[2*(f*e.width+h)+1]*u)*a]}:(t,r)=>{let i=Math.round(t),o=Math.round(r);return i<0||i>=e.width||o<0||o>=e.height?[0,0]:[n[2*(o*e.width+i)],n[2*(o*e.width+i)+1]]}}function l(t,e,n,i,a,u,s,l){let h=[],{raster:f,width:c,height:m,resolutionFactor:d}=l,p=i,M=a,g=(0,o.Kp)(0),[y,w]=n(p,M);y*=e.velocityScale,w*=e.velocityScale;let x,b,v=Math.sqrt(y*y+w*w);h.push({x:p,y:M,time:g,speed:v});for(let i=0;i<e.verticesPerLine;i++){let[i,a]=n(p,M);i*=e.velocityScale,a*=e.velocityScale;let l=Math.sqrt(i*i+a*a);if(l<e.minSpeedThreshold)return h;let y=t*i/l,w=t*a/l;p+=y*e.segmentLength,M+=w*e.segmentLength,e.wrapAround&&(p=(0,r.OS)(p,u[0]));let v=t*e.segmentLength/l;if(g=(0,o.Kp)(g+v),Math.acos(y*x+w*b)>e.maxTurnAngle)return h;if(e.collisions){let t=Math.round(p*d),n=Math.round(M*d);if(e.wrapAround&&(t=(0,r.OS)(t,c)),t<0||t>c-1||n<0||n>m-1)return h;let i=f[n*c+t];if(-1!==i&&i!==s)return h;f[n*c+t]=s}h.push({x:p,y:M,time:g,speed:l}),x=y,b=w}return h}function h(t,e,n,r,i,o,a,u){let s=Math.round((.2+.6*a.getFloat())*t.verticesPerLine),h=t.verticesPerLine-s,f=l(-1,{...t,verticesPerLine:h},e,n,r,i,o,u),c=l(1,{...t,verticesPerLine:s},e,n,r,i,o,u),m=f.reverse();return m.splice(-1,1),m.concat(c)}n(5443),n(21325)}}]);
|