@vertigis/arcgis-extensions 51.9.0 → 51.10.1

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/data/Feature.js CHANGED
@@ -1 +1 @@
1
- import{__decorate as e}from"tslib";import t from"@arcgis/core/Graphic";import s from"@arcgis/core/core/Collection";import{fromJSON as i}from"@arcgis/core/geometry/support/jsonUtils";import{EntityBase as r}from"../Entity.js";import{Hyperlink as a}from"../Hyperlink.js";import{InvalidOperationError as o}from"../InvalidOperationError.js";import{isLayerExtension as n,isTableExtension as l,ItemType as h}from"../ItemType.js";import{serializable as u}from"../support/Serializable.js";import{createIHandle as p,notifyChange as c,onWatch as m,watch as f,watchEvent as d}from"../support/observableUtils.js";import{CaseInsensitiveObservableMap as g}from"../utilities/CaseInsensitiveObservableMap.js";import{MapTransformCollection as y}from"../utilities/MapTransformCollection.js";import{ObservableMap as _}from"../utilities/ObservableMap.js";import{ReadOnlyMap as b}from"../utilities/ReadOnlyMap.js";import{Time as F}from"../utilities/Time.js";import{flatten as x,groupBy as w}from"../utilities/array.js";import{checkArg as v}from"../utilities/checkArg.js";import{compare as I}from"../utilities/collection.js";import{isCodedValueDomain as S,isGeometry as z}from"../utilities/esri.js";import{getArcadeExpressionFromField as E,getRelationshipFromField as A,isArcadeExpressionField as j}from"../utilities/field.js";import{parse as T,esriFormatToGeocortexFormat as k}from"../utilities/format/date.js";import{NumberFormat as R}from"../utilities/format/formats.js";import{parse as O}from"../utilities/format/number.js";import{format as M}from"../utilities/format/string.js";import{parse as N,esriFormatToGeocortexFormat as D}from"../utilities/format/time.js";import{map as V,find as U}from"../utilities/iterable.js";import{getLogger as P}from"../utilities/log.js";import{map as C}from"../utilities/promise.js";import{caseInsensitiveEquals as G}from"../utilities/string.js";import{FeatureSettings as L}from"./FeatureSettings.js";import{Schema as Z}from"./Schema.js";const $=P("geocortex.api.data.Feature");export const SCORE_FIELD="_score";export const SCORE_FIELD_ORIGINAL="_score_original";let H=class extends r{attributes;get geometry(){return this._geometry}set geometry(e){this._geometry=z(e)||!e?e:i(e),this.schema.spatialReference=this._geometry?.spatialReference,c(this,"geometryType")}settings;schema;attachments;expressionFieldValues;_itemType=h.FEATURE;get geometryType(){return this.geometry?this.geometry.type:void 0}get source(){return this._source}set source(e){this._source===e||null==this._source&&null==e||(this._source&&this.settings.parent===this._source.featureSettings&&(this.settings.parent=void 0),this._source&&this.schema.parent===this._source.schema&&(this.schema.parent=void 0),this._source=e,this.settings.parent||(this.settings.parent=e?e.featureSettings:void 0),this.schema.parent||(this.schema.parent=e?e.schema:void 0),c(this,"attachmentsInitialized"),c(this,"relatedFeaturesInitialized"))}get primaryKey(){const e=this.attributes.get(this.schema.primaryKeyField);return null!=e?`${e}`:void 0}get hasGlobalId(){return!!this.schema.fields.find((e=>"global-id"===e.type))}get globalId(){const e=this.schema.fields.find((e=>"global-id"===e.type));return e?this.attributes.get(e.name):void 0}set globalId(e){const t=this.schema.fields.find((e=>"global-id"===e.type));if(!t)throw new o("Cannot set global ID on feature -- no global ID field.");this.attributes.set(t.name,e)}get presentableAttributes(){return null==this._presentableAttributes&&(this._presentableAttributes=new B(this)),this._presentableAttributes}get title(){return this.format(this._title||"")}get description(){return this.format(this._description)}get hyperlinks(){return this._hyperlinks||(this._hyperlinks=new se(this))}get relatedFeatures(){return this._relatedFeatures}get type(){if(this.schema.typeIdField&&this.attributes.has(this.schema.typeIdField)){const e=this.attributes.get(this.schema.typeIdField);return this.schema.types.find((t=>t.id===e))}}get attachmentsInitialized(){return!this.source||this._attachmentsInitialized}get relatedFeaturesInitialized(){return!this.source||this.source.relationships.every((e=>this._initializedRelationships.has(e)))}get expressionsInitialized(){return!this.settings.popupTemplate?.expressionInfos?.length||this._expressionsInitialized}get _hydrationStatus(){return this._featureHydrationStatus?this._featureHydrationStatus:this.source?.capabilities?.supportsQuery&&1===this.attributes.size&&void 0!==this.primaryKey?"dehydrated":"hydrated"}set _hydrationStatus(e){this._featureHydrationStatus=e}get _key(){return`${this.source?.id}//${this.primaryKey??this.globalId??this.id}`}get _title(){let e;return this.settings.popupTemplate&&(e="function"==typeof this.settings.popupTemplate.title?this.settings.popupTemplate.title():this.settings.popupTemplate.title),e||this.schema.displayField&&this.presentableAttributes.get(this.schema.displayField)||""}get _description(){if(this.settings.popupTemplate?.content){if("string"==typeof this.settings.popupTemplate.content)return this.settings.popupTemplate.content;if(Array.isArray(this.settings.popupTemplate.content)){const e=this.settings.popupTemplate.content.find((e=>"text"===e.type));if(e)return e.text}}return""}_geometry;_source;_presentableAttributes;_hyperlinks;_featureHydrationStatus;_relatedFeatures;_expressionFieldValues=new _;_expressionValuesUpdatePending=!1;_attachmentsInitialized=!1;_expressionsInitialized=!1;_initializedRelationships=new WeakSet;constructor(e){super(e),this.settings=new L,this.settings._setFeature(this),this.schema=new Z,this.schema._featureSettings=this.settings,this.attachments=new s,this.attributes=new g,this._relatedFeatures=new _,this.expressionFieldValues=new Q(this._expressionFieldValues,this),f(this.settings,"popupTemplate",(()=>{this._expressionsInitialized=!1,c(this,"expressionsInitialized")}),{sync:!0}),m(this,"title",(()=>{const e=f(this.settings,"popupTemplate.title",(()=>c(this,"title")),{sync:!0}),t=this.presentableAttributes.on("change",(()=>c(this,"title")));return p([e,t])})),m(this,"description",(()=>{const e=f(this.settings,"popupTemplate.content",(()=>c(this,"description")),{sync:!0}),t=this.presentableAttributes.on("change",(()=>c(this,"description")));return p([e,t])})),m(this,"relatedFeaturesInitialized",(()=>d(this,"source.relationships",["after-changes",()=>{c(this,"relatedFeaturesInitialized")}])))}format(e,...t){let s="string"==typeof e?{format:e}:e;v("options",s).isNotMissing();const{format:i}=s;v("format",i).isNotMissing();let r=s.format.replace(X,Y);return r=r.replace(W,((e,t,i,r,a)=>re(this,t||i,r,{...s,format:a?`{0:${a}}`:"{0}"}))),r=r.replace(ee,"{{"),s={...s},s.format=r,M(s,...t)}clearExpressionInfos(){this._expressionFieldValues.clear()}toGraphic(){return toGraphic(this)}async fetchExpressionInfos(e=!1){const{expressionInfos:t}=this.settings.popupTemplate??{};if(!t)return;const{runAsyncArcadeExpression:s}=await import("../utilities/arcade.js");if(await Promise.all(t.map((async e=>{try{const t=this.source?.layer??this.source?.sublayer;let i=this.source?.mapExtension;if(!i){const e=this.source?.layerExtension;i=e?.mapExtension}this._expressionFieldValues.set(e.name,await s(e.expression,{layer:t,map:i?.map,feature:this,spatialReference:this.schema.spatialReference}))}catch(t){t instanceof Error&&$.error({message:"Error evaluating expression '{0}': {1}.",error:t},e.name,t.message),this._expressionFieldValues.set(e.name,te)}}))),e)return this.attributes.on("change",(async e=>{this._expressionValuesUpdatePending||(this._expressionValuesUpdatePending=!0,setTimeout((async()=>{this._expressionValuesUpdatePending=!1,await this.fetchExpressionInfos()}),0))}));this._expressionsInitialized=!0,c(this,"expressionsInitialized")}async fetchRelatedFeatures(e,t){if(!this.source)return;let s=[];if(e){const t=new Set(Array.isArray(e)?e:[e]);for(const e of t){const t="string"==typeof e?this.source.relationships.find((t=>t.id===e)):e;if(!t||!this.source.relationships.includes(t))throw new o("Relationship not found in feature source.");s.push(t)}}else s=this.source.relationships.toArray();const i=await C(s,(async e=>[e,await(async()=>{const s=await e.getRelatedFeatures(this,t);return this._initializedRelationships.add(e),s})()]));for(const e of i)this._relatedFeatures.set(e[0],e[1]);c(this,"relatedFeaturesInitialized")}async fetchAttachments(){if(this.source){const e=await this.source.getAttachments(this);I(this.attachments,e,{equals:(e,t)=>e.id===t.id,onMissing:(e,t)=>{this.attachments.remove(e)},onNew:(e,t)=>{this.attachments.add(e)},onMatch:(e,t,s,i)=>{this.attachments.splice(s,1,t)}}),this._attachmentsInitialized=!0,c(this,"attachmentsInitialized")}}async addAttachment(e){return this.source?.addAttachment(this,e)}async deleteAttachments(e){return this.source?.deleteAttachments(this,e)}_getSerializableProperties(){return{...super._getSerializableProperties(),attributes:{serializeModes:["project"],serialize:e=>{const t={};if("project"===e&&this.primaryKey&&(this.source?.capabilities).supportsQuery)t[this.schema.primaryKeyField]=this.primaryKey;else for(const[e,s]of this.attributes.entries())t[e]=s;return t},deserialize:e=>{if(this.attributes.clear(),e instanceof Map||e instanceof _)e.forEach(((e,t)=>{this.attributes.set(t,e)}));else for(const[t,s]of Object.entries(e))this.attributes.set(t,s)}},geometry:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("geometry"):this.geometry?.toJSON(),deserialize:e=>{z(e)?this.geometry=e:this.geometry=e?i(e):void 0}},settings:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("settings"):this.settings.toJSON(e)},schema:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("schema"):this.schema.toJSON(e)},source:["project"]}}async _onInitialize(){const e=this._findRelationshipIds(this._title,this._description),t=this.source?this.source.relationships.map((e=>e.id)).toArray():[],s=[];for(const i of e)t.includes(i)?s.push(this.fetchRelatedFeatures(i)):$.error("Could not find relationship '{0}' referenced in feature title or description.",i);await Promise.all(s)}_findRelationshipIds(...e){const t=[];for(const s of e){let e;const i=s.replace(X,Y);for(;e=q.exec(i),null!==e;){const s=e[0];t.includes(s)||t.push(e[1])}}return t}};H=e([u],H);export{H as Feature};export function toFeature(e,t){const s=new H(t);if(e.attributes){const t=e.attributes;for(const[e,i]of Object.entries(t))s.attributes.set(e,i)}return s.geometry=e.geometry,e.popupTemplate&&(s.settings.popupTemplate=e.popupTemplate),s}export function toGraphic(e){const s=new t;s.attributes={};for(const t of e.attributes.keys())s.attributes[t]=e.attributes.get(t);return n(e.source)&&e.source.layer&&(s.layer=e.source.layer),l(e.source)&&e.source.table&&(s.layer=e.source.table),s.geometry=e.geometry,e.settings.popupTemplate&&(s.popupTemplate=e.settings.popupTemplate),s}const K="Presentable attributes are read-only.",J="Feature hyperlinks are read-only. Modify the feature's hyperlink templates instead.";class Q extends b{_feature;_pending=new Set;constructor(e,t){super(e),this._feature=t}get(e){return super.has(e)||this._calcExpressionValue(e),super.get(e)}async _calcExpressionValue(e){if(!this._pending.has(e)){this._pending.add(e);try{const{spatialReference:t}=this._feature.schema,s=this._feature.settings.popupTemplate?.expressionInfos?.find((t=>t.name===e));if(!s)return;const{isArcadeScriptAsync:i,runAsyncArcadeExpression:r,arcadeScriptUsesGeometry:a,runArcadeExpression:o}=await import("../utilities/arcade.js");try{if(i(s.expression,t)){const i=this._feature.source?.layer??this._feature.source?.sublayer;let a=this._feature.source?.mapExtension;if(!a){const e=this._feature.source?.layerExtension;a=e?.mapExtension}this._originalMap.set(e,await r(s.expression,{feature:this._feature,layer:i,map:a?.map,spatialReference:t}))}else{if(a(s.expression,t)){const{enableGeometrySupport:e}=await import("@arcgis/core/arcade/arcade");await e()}this._originalMap.set(e,o(s.expression,{feature:this._feature,spatialReference:t}))}}catch(t){t instanceof Error&&$.error({message:"Error evaluating expression '{0}': {1}.",error:t},e,t.message),this._originalMap.set(e,te)}}finally{this._pending.delete(e)}}}}class B extends b{get size(){return this._feature.attributes.size+this._feature.schema.fields._expressionFieldsLength}_feature;_numObservers;_onAllObserversRemoved;constructor(e){super(new g),this._feature=e,m(this,"size",(()=>f(this._feature.attributes,"size",(()=>c(this,"size")),{sync:!0}))),m(this,"size",(()=>f(this._feature.schema.fields,"_expressionFieldsLength",(()=>c(this,"size")),{sync:!0})))}clear(){throw new o(K)}delete(e){throw new o(K)}forEach(e,t){v("callback",e).isNotMissing();for(const s of this.keys())e.call(t,this.get(s),s,this)}get(e){const t=this._getFieldExtensionFormat(e);return this._formatAttribute(e,t)}has(e){for(const t of this.keys())if(G(t,e))return!0;return!1}set(...e){throw new o(K)}*entries(){yield*V(this.keys(),(e=>[e,this.get(e)]))}*keys(){yield*this._feature.attributes.keys();for(const e of this._feature.schema.fields.expressionFields)yield e.name;if(null!=this._feature.source?.relationships)for(const e of this._feature.source.relationships)if("one-to-one"===e.cardinality||"many-to-one"===e.cardinality)for(const t of e.relatedSource.schema.fields)yield`relationships/${e.id}/${t.name}`}*values(){yield*V(this.keys(),(e=>this.get(e)))}[Symbol.iterator](){return this.entries()}toJSON(){return Array.from(this.entries())}on(e,t){if(v("callback",t).isNotMissing(),!this._numObservers){const e=new Map,t=new Set,s=()=>{for(const e of t)e.remove();t.clear()};let i;const r=()=>{const t=()=>{i&&(window.clearTimeout(i),i=void 0)};t(),i=window.setTimeout((()=>{const s=[],i=[];for(const[t,i]of this.entries())i!==e.get(t)&&s.push([t,i]);for(const[t,s]of e.entries())this.has(t)&&s===this.get(t)||i.push([t,s]);if(s.length||i.length){const e={added:s,removed:i,target:this};if(this.hasEventListener("after-add"))for(const e of s)this.emit("after-add",{target:this,item:e});if(this.hasEventListener("after-remove"))for(const e of i)this.emit("after-remove",{target:this,item:e});this.emit("change",e),a()}t()}))},a=()=>{e.clear(),s();for(const s of this.keys()){const i=this._getFieldExtension(s);let a="{0}";if(i){const e=f(i,"format",r);t.add(e),i.format&&(a=i.format)}e.set(s,this._formatAttribute(s,a))}};a();const o=this._feature.attributes.on("change",r),n=this._feature.schema.fieldExtensions.on("change",r),l=[f(this._feature.settings.formatSettings,"numberFormat",r),f(this._feature.settings.formatSettings,"dateFormat",r),f(this._feature.settings.formatSettings,"timeFormat",r),f(this._feature.settings.formatSettings,"locale",r)],h=this._feature.expressionFieldValues.on("change",r),u=this._feature.schema.fields.on("change",(e=>{(e.added?.some((e=>j(e.name)))||e.removed?.some((e=>j(e.name))))&&r()})),p=f(this._feature.settings,"popupTemplate",r);this._onAllObserversRemoved=()=>{h.remove(),o.remove(),n.remove(),u.remove();for(const e of l)e.remove();p.remove(),e.clear(),s()}}const s=super.on(e,t);return this._numObservers++,{remove:()=>{s.remove(),this._numObservers--,this._numObservers||this._onAllObserversRemoved()}}}_getFieldExtension(e){const t=this._feature.schema.findFieldByName(e);if(t)return this._feature.schema.fieldExtensions.forField(t)}_getFieldExtensionFormat(e){const t=this._getFieldExtension(e);return t?t.format:"{0}"}_formatAttribute(e,t){const s=E(e);if(null!=s)return re(this._feature,"expression",s,{format:t});const[i,r]=A(e);return null!=i?re(this._feature,i,r,{format:t}):re(this._feature,void 0,e,{format:t})}}const W=/\{(?:relationships[\\/]([\w-]*)[\\/])?(?:(expression)[\\/])?([_a-zA-ZÀ-ÖØ-öø-ÿ][._a-zA-ZÀ-ÖØ-öø-ÿ0-9]*)(?::([^}]*))?\}/gi,q=/\{relationships\/([\w-]*)[\\/]([^}]*)\}/gi,X=/{{/g,Y="\0MAGIC\0",ee=new RegExp(Y,"g"),te="#INVALID";class se extends y{_feature;_hyperlinks;constructor(e){super(e.settings.hyperlinkTemplates,(e=>this._getHyperlink(e))),this._feature=e}_getHyperlink(e){return null==this._hyperlinks&&(this._hyperlinks=new WeakMap),this._hyperlinks.has(e)||this._hyperlinks.set(e,new ie(this._feature,e)),this._hyperlinks.get(e)}}let ie=class extends a{get url(){return this._template.url?this._feature.format(this._template.url):this._template.url}set url(e){throw new o(J)}get text(){return this._template.text?this._feature.format(this._template.text):this._template.text}set text(e){throw new o(J)}get iconUrl(){return this._template.iconUrl?this._feature.format(this._template.iconUrl):this._template.iconUrl}set iconUrl(e){throw new o(J)}get target(){return this._template.target?this._feature.format(this._template.target):this._template.target}set target(e){throw new o(J)}get tooltip(){return this._template.tooltip?this._feature.format(this._template.tooltip):this._template.tooltip}set tooltip(e){throw new o(J)}_feature;_template;constructor(e,t){super(t.toJSON()),this._feature=e,this._template=t,m(this,(e=>{const t=f(this._template,e,(()=>c(this,e)),{sync:!0}),s=this._feature.presentableAttributes.on("change",(()=>{c(this,e)})),i=this._feature.relatedFeatures.on("change",(()=>{c(this,e)}));return p([t,s,i])}))}_getSerializableProperties(){return{}}};function re(e,t,s,i={format:"{0}"}){if(!G(t,"expression")){if(t){const r=U(e.relatedFeatures.keys(),(e=>G(e.id,t)));if(!r)return $.debug("Could not resolve related field '{0}/{1}",t,s),te;const a=Array.from(e.relatedFeatures.get(r));return"many-to-one"===r.cardinality||"one-to-one"===r.cardinality?a.length<1?($.debug("Could not resolve related field '{0}/{1}",t,s),te):ae(a[0],s,i):a.map((e=>ae(e,s,i))).filter((e=>""!==e)).join(",")}return ae(e,s,i)}if(!e.settings.popupTemplate?.expressionInfos?.find((e=>G(e.name,s))))return $.debug("Could not find expression '{0}'.",s),te;try{const t=e.expressionFieldValues.get(s)??i.defaultExpressionValue??"",r=e.schema.findFieldByName(`expression/${s}`),a=null==r?void 0:e.schema.fieldExtensions.forField(r);return oe(e,t,s,a?.formatSettings,i)}catch(e){if(e instanceof Error)return $.error({message:"Error evaluating expression '{0}': {1}.",error:e},s,e.message),te;throw e}}function ae(e,t,s){let i;if(i=e.attributes.get(t),null==i)return"";const r=e.schema.findFieldByName(t),a=e.type?.domains?.[r?.name??t],o=e=>e.codedValues?.find((e=>e.code.toString()===i.toString()))?.name??i;let n;if(G(t,e.schema.typeIdField)){const t=a&&"inherited"!==a.type?a:r?.domain;i="coded-value"===t?.type?o(t):e.type?.name??i}else if(a&&S(a))i=o(a);else if(r?.domain&&S(r.domain))i=o(r.domain);else if(r){switch(r.type){case"integer":case"small-integer":case"big-integer":case"single":case"double":i=O(i);break;case"date":i=T({timeZone:e.schema.timeZone},i);break;case"timestamp-offset":case"date-only":i=T({},i),"date-only"===r.type&&(s.isDateOnly=!0);break;case"time-only":i=N(i);break;default:i=`${i.toString()}`}const t=e.schema.fieldExtensions.forField(r);t&&(n=t.formatSettings)}return oe(e,i,t,n,s)}function oe(e,t,s,i,r){if("string"==typeof t&&(null==r.format||"{0}"===r.format))return t;const a={...r};if("number"==typeof t||t instanceof Date||t instanceof F){null==a.locale&&(a.locale=i?.locale??e.settings.formatSettings.locale);const r=e.settings.popupTemplate?.fieldInfos?.find((e=>G(e.fieldName,s)))?.format;"number"==typeof t?function(e,t,s,i){null==e.currency&&(e.currency=t?.currency??i.settings.formatSettings.currency);null==e.numberFormat&&(e.numberFormat=t?.numberFormat,null==e.numberFormat&&(e.numberFormat=null==s?i.settings.formatSettings.numberFormat:s.digitSeparator?R.NUMBER:R.FIXED_POINT));null==e.fractionalDigits&&(e.fractionalDigits=t?.fractionalDigits,null==e.fractionalDigits&&(e.fractionalDigits=null==s?i.settings.formatSettings.fractionalDigits:s.places))}(a,i,r,e):t instanceof Date?function(e,t,s,i){null==e.dateFormat&&(e.dateFormat=t?.dateFormat,null==e.dateFormat&&(e.dateFormat=null==s?i.settings.formatSettings.dateFormat:k(s.dateFormat)));null==e.timeZone&&(e.timeZone=t?.timeZone??i.settings.formatSettings.timeZone)}(a,i,r,e):function(e,t,s,i){null==e.timeFormat&&(e.timeFormat=t?.timeFormat,null==e.timeFormat&&(e.timeFormat=null==s?i.settings.formatSettings.timeFormat:D(s.dateFormat)))}(a,i,r,e)}return M(a,t)}ie=e([u],ie);export async function resolveRelatedFeatures(e){const t=w(e,(e=>e.source));await Promise.all(x([...t.keys()].map((e=>e.relationships.toArray()))).map((e=>(async e=>{[...(await e.getAllRelatedFeatures(t.get(e.source))).entries()].forEach((([t,s])=>{t.relatedFeatures.set(e,s)}))})(e))))}
1
+ import{__decorate as e}from"tslib";import t from"@arcgis/core/Graphic";import s from"@arcgis/core/core/Collection";import{fromJSON as i}from"@arcgis/core/geometry/support/jsonUtils";import{EntityBase as r}from"../Entity.js";import{Hyperlink as a}from"../Hyperlink.js";import{InvalidOperationError as o}from"../InvalidOperationError.js";import{isLayerExtension as n,isTableExtension as l,ItemType as h}from"../ItemType.js";import{serializable as u}from"../support/Serializable.js";import{createIHandle as p,notifyChange as c,onWatch as m,watch as f,watchEvent as d}from"../support/observableUtils.js";import{CaseInsensitiveObservableMap as g}from"../utilities/CaseInsensitiveObservableMap.js";import{MapTransformCollection as y}from"../utilities/MapTransformCollection.js";import{ObservableMap as _}from"../utilities/ObservableMap.js";import{ReadOnlyMap as b}from"../utilities/ReadOnlyMap.js";import{Time as F}from"../utilities/Time.js";import{flatten as x,groupBy as w}from"../utilities/array.js";import{checkArg as v}from"../utilities/checkArg.js";import{compare as I}from"../utilities/collection.js";import{isCodedValueDomain as S,isGeometry as z}from"../utilities/esri.js";import{getArcadeExpressionFromField as E,getRelationshipFromField as A,isArcadeExpressionField as j}from"../utilities/field.js";import{parse as T,esriFormatToGeocortexFormat as k}from"../utilities/format/date.js";import{NumberFormat as R}from"../utilities/format/formats.js";import{parse as O}from"../utilities/format/number.js";import{format as M}from"../utilities/format/string.js";import{parse as N,esriFormatToGeocortexFormat as D}from"../utilities/format/time.js";import{map as V,find as U}from"../utilities/iterable.js";import{getLogger as P}from"../utilities/log.js";import{map as C}from"../utilities/promise.js";import{caseInsensitiveEquals as G}from"../utilities/string.js";import{FeatureSettings as L}from"./FeatureSettings.js";import{Schema as Z}from"./Schema.js";const $=P("geocortex.api.data.Feature");export const SCORE_FIELD="_score";export const SCORE_FIELD_ORIGINAL="_score_original";let H=class extends r{attributes;get geometry(){return this._geometry}set geometry(e){this._geometry=z(e)||!e?e:i(e),this.schema.spatialReference=this._geometry?.spatialReference,c(this,"geometryType")}settings;schema;attachments;expressionFieldValues;_itemType=h.FEATURE;get geometryType(){return this.geometry?this.geometry.type:void 0}get source(){return this._source}set source(e){this._source===e||null==this._source&&null==e||(this._source&&this.settings.parent===this._source.featureSettings&&(this.settings.parent=void 0),this._source&&this.schema.parent===this._source.schema&&(this.schema.parent=void 0),this._source=e,this.settings.parent||(this.settings.parent=e?e.featureSettings:void 0),this.schema.parent||(this.schema.parent=e?e.schema:void 0),c(this,"attachmentsInitialized"),c(this,"relatedFeaturesInitialized"))}get primaryKey(){const e=this.attributes.get(this.schema.primaryKeyField);return null!=e?`${e}`:void 0}get hasGlobalId(){return!!this.schema.fields.find((e=>"global-id"===e.type))}get globalId(){const e=this.schema.fields.find((e=>"global-id"===e.type));return e?this.attributes.get(e.name):void 0}set globalId(e){const t=this.schema.fields.find((e=>"global-id"===e.type));if(!t)throw new o("Cannot set global ID on feature -- no global ID field.");this.attributes.set(t.name,e)}get presentableAttributes(){return null==this._presentableAttributes&&(this._presentableAttributes=new B(this)),this._presentableAttributes}get title(){return this.format(this._title||"")}get description(){return this.format(this._description)}get hyperlinks(){return this._hyperlinks||(this._hyperlinks=new se(this))}get relatedFeatures(){return this._relatedFeatures}get type(){if(this.schema.typeIdField&&this.attributes.has(this.schema.typeIdField)){const e=this.attributes.get(this.schema.typeIdField);return this.schema.types.find((t=>t.id===e))}}get attachmentsInitialized(){return!this.source||this._attachmentsInitialized}get relatedFeaturesInitialized(){return!this.source||this.source.relationships.every((e=>this._initializedRelationships.has(e)))}get expressionsInitialized(){return!this.settings.popupTemplate?.expressionInfos?.length||this._expressionsInitialized}get _hydrationStatus(){return this._featureHydrationStatus?this._featureHydrationStatus:this.source?.capabilities?.supportsQuery&&1===this.attributes.size&&void 0!==this.primaryKey?"dehydrated":"hydrated"}set _hydrationStatus(e){this._featureHydrationStatus=e}get _key(){return`${this.source?.id}//${this.primaryKey??this.globalId??this.id}`}get _title(){let e;return this.settings.popupTemplate&&(e="function"==typeof this.settings.popupTemplate.title?this.settings.popupTemplate.title():this.settings.popupTemplate.title),e||this.schema.displayField&&this.presentableAttributes.get(this.schema.displayField)||""}get _description(){if(this.settings.popupTemplate?.content){if("string"==typeof this.settings.popupTemplate.content)return this.settings.popupTemplate.content;if(Array.isArray(this.settings.popupTemplate.content)){const e=this.settings.popupTemplate.content.find((e=>"text"===e.type));if(e)return e.text}}return""}_geometry;_source;_presentableAttributes;_hyperlinks;_featureHydrationStatus;_relatedFeatures;_expressionFieldValues=new _;_expressionValuesUpdatePending=!1;_attachmentsInitialized=!1;_expressionsInitialized=!1;_initializedRelationships=new WeakSet;constructor(e){super(e),this.settings=new L,this.settings._setFeature(this),this.schema=new Z,this.schema._featureSettings=this.settings,this.attachments=new s,this.attributes=new g,this._relatedFeatures=new _,this.expressionFieldValues=new Q(this._expressionFieldValues,this),f(this.settings,"popupTemplate",(()=>{this._expressionsInitialized=!1,c(this,"expressionsInitialized")}),{sync:!0}),m(this,"title",(()=>{const e=f(this.settings,"popupTemplate.title",(()=>c(this,"title")),{sync:!0}),t=this.presentableAttributes.on("change",(()=>c(this,"title")));return p([e,t])})),m(this,"description",(()=>{const e=f(this.settings,"popupTemplate.content",(()=>c(this,"description")),{sync:!0}),t=this.presentableAttributes.on("change",(()=>c(this,"description")));return p([e,t])})),m(this,"relatedFeaturesInitialized",(()=>d(this,"source.relationships",["after-changes",()=>{c(this,"relatedFeaturesInitialized")}])))}format(e,...t){let s="string"==typeof e?{format:e}:e;v("options",s).isNotMissing();const{format:i}=s;v("format",i).isNotMissing();let r=s.format.replace(X,Y);return r=r.replace(W,((e,t,i,r,a)=>re(this,t||i,r,{...s,format:a?`{0:${a}}`:"{0}"}))),r=r.replace(ee,"{{"),s={...s},s.format=r,M(s,...t)}clearExpressionInfos(){this._expressionFieldValues.clear()}toGraphic(){return toGraphic(this)}async fetchExpressionInfos(e=!1){const{expressionInfos:t}=this.settings.popupTemplate??{};if(!t)return;const{runAsyncArcadeExpression:s}=await import("../utilities/arcade.js");if(await Promise.all(t.map((async e=>{try{const t=this.source?.layer??this.source?.sublayer;let i=this.source?.mapExtension;if(!i){const e=this.source?.layerExtension;i=e?.mapExtension}this._expressionFieldValues.set(e.name,await s(e.expression,{layer:t,map:i?.map,feature:this,spatialReference:this.schema.spatialReference}))}catch(t){t instanceof Error&&$.error({message:"Error evaluating expression '{0}': {1}.",error:t},e.name,t.message),this._expressionFieldValues.set(e.name,te)}}))),e)return this.attributes.on("change",(async e=>{this._expressionValuesUpdatePending||(this._expressionValuesUpdatePending=!0,setTimeout((async()=>{this._expressionValuesUpdatePending=!1,await this.fetchExpressionInfos()}),0))}));this._expressionsInitialized=!0,c(this,"expressionsInitialized")}async fetchRelatedFeatures(e,t){if(!this.source)return;let s=[];if(e){const t=new Set(Array.isArray(e)?e:[e]);for(const e of t){const t="string"==typeof e?this.source.relationships.find((t=>t.id===e)):e;if(!t||!this.source.relationships.includes(t))throw new o("Relationship not found in feature source.");s.push(t)}}else s=this.source.relationships.toArray();const i=await C(s,(async e=>[e,await(async()=>{const s=await e.getRelatedFeatures(this,t);return this._initializedRelationships.add(e),s})()]));for(const e of i)this._relatedFeatures.set(e[0],e[1]);c(this,"relatedFeaturesInitialized")}async fetchAttachments(){if(this.source){const e=await this.source.getAttachments(this);I(this.attachments,e,{equals:(e,t)=>e.id===t.id,onMissing:(e,t)=>{this.attachments.remove(e)},onNew:(e,t)=>{this.attachments.add(e)},onMatch:(e,t,s,i)=>{this.attachments.splice(s,1,t)}}),this._attachmentsInitialized=!0,c(this,"attachmentsInitialized")}}async addAttachment(e){return this.source?.addAttachment(this,e)}async deleteAttachments(e){return this.source?.deleteAttachments(this,e)}_getSerializableProperties(){return{...super._getSerializableProperties(),attributes:{serializeModes:["project"],serialize:e=>{const t={};if("project"===e&&this.primaryKey&&(this.source?.capabilities).supportsQuery)t[this.schema.primaryKeyField]=this.primaryKey;else for(const[e,s]of this.attributes.entries())t[e]=s;return t},deserialize:e=>{if(this.attributes.clear(),e instanceof Map||e instanceof _)e.forEach(((e,t)=>{this.attributes.set(t,e)}));else for(const[t,s]of Object.entries(e))this.attributes.set(t,s)}},geometry:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("geometry"):this.geometry?.toJSON(),deserialize:e=>{z(e)?this.geometry=e:this.geometry=e?i(e):void 0}},settings:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("settings"):this.settings.toJSON(e)},schema:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("schema"):this.schema.toJSON(e)},source:["project"]}}async _onInitialize(){const e=this._findRelationshipIds(this._title,this._description),t=this.source?this.source.relationships.map((e=>e.id)).toArray():[],s=[];for(const i of e)t.includes(i)?s.push(this.fetchRelatedFeatures(i)):$.error("Could not find relationship '{0}' referenced in feature title or description.",i);await Promise.all(s)}_findRelationshipIds(...e){const t=[];for(const s of e){let e;const i=s.replace(X,Y);for(;e=q.exec(i),null!==e;){const s=e[0];t.includes(s)||t.push(e[1])}}return t}};H=e([u],H);export{H as Feature};export function toFeature(e,t){const s=new H(t);if(e.attributes){const t=e.attributes;for(const[e,i]of Object.entries(t))s.attributes.set(e,i)}return s.geometry=e.geometry,e.popupTemplate&&(s.settings.popupTemplate=e.popupTemplate),s}export function toGraphic(e){const s=new t;s.attributes={};for(const t of e.attributes.keys())s.attributes[t]=e.attributes.get(t);return n(e.source)&&e.source.layer&&(s.layer=e.source.layer),l(e.source)&&e.source.table&&(s.layer=e.source.table),s.geometry=e.geometry,e.settings.popupTemplate&&(s.popupTemplate=e.settings.popupTemplate),s}const K="Presentable attributes are read-only.",J="Feature hyperlinks are read-only. Modify the feature's hyperlink templates instead.";class Q extends b{_feature;_pending=new Set;constructor(e,t){super(e),this._feature=t}get(e){return super.has(e)||this._calcExpressionValue(e),super.get(e)}async _calcExpressionValue(e){if(!this._pending.has(e)){this._pending.add(e);try{const{spatialReference:t}=this._feature.schema,s=this._feature.settings.popupTemplate?.expressionInfos?.find((t=>t.name===e));if(!s)return;const{isArcadeScriptAsync:i,runAsyncArcadeExpression:r,arcadeScriptUsesGeometry:a,runArcadeExpression:o}=await import("../utilities/arcade.js");try{if(i(s.expression,t)){const i=this._feature.source?.layer??this._feature.source?.sublayer;let a=this._feature.source?.mapExtension;if(!a){const e=this._feature.source?.layerExtension;a=e?.mapExtension}this._originalMap.set(e,await r(s.expression,{feature:this._feature,layer:i,map:a?.map,spatialReference:t}))}else{if(a(s.expression,t)){const{enableGeometrySupport:e}=await import("@arcgis/core/arcade/arcade");await e()}this._originalMap.set(e,o(s.expression,{feature:this._feature,spatialReference:t}))}}catch(t){t instanceof Error&&$.error({message:"Error evaluating expression '{0}': {1}.",error:t},e,t.message),this._originalMap.set(e,te)}}finally{this._pending.delete(e)}}}}class B extends b{get size(){return this._feature.attributes.size+this._feature.schema.fields._expressionFieldsLength}_feature;_numObservers;_onAllObserversRemoved;constructor(e){super(new g),this._feature=e,m(this,"size",(()=>f(this._feature.attributes,"size",(()=>c(this,"size")),{sync:!0}))),m(this,"size",(()=>f(this._feature.schema.fields,"_expressionFieldsLength",(()=>c(this,"size")),{sync:!0})))}clear(){throw new o(K)}delete(e){throw new o(K)}forEach(e,t){v("callback",e).isNotMissing();for(const s of this.keys())e.call(t,this.get(s),s,this)}get(e){const t=this._getFieldExtensionFormat(e);return this._formatAttribute(e,t)}has(e){for(const t of this.keys())if(G(t,e))return!0;return!1}set(...e){throw new o(K)}*entries(){yield*V(this.keys(),(e=>[e,this.get(e)]))}*keys(){yield*this._feature.attributes.keys();for(const e of this._feature.schema.fields.expressionFields)yield e.name;if(null!=this._feature.source?.relationships)for(const e of this._feature.source.relationships)if("one-to-one"===e.cardinality||"many-to-one"===e.cardinality)for(const t of e.relatedSource.schema.fields)yield`relationships/${e.id}/${t.name}`}*values(){yield*V(this.keys(),(e=>this.get(e)))}[Symbol.iterator](){return this.entries()}toJSON(){return Array.from(this.entries())}on(e,t){if(v("callback",t).isNotMissing(),!this._numObservers){const e=new Map,t=new Set,s=()=>{for(const e of t)e.remove();t.clear()};let i;const r=()=>{const t=()=>{i&&(window.clearTimeout(i),i=void 0)};t(),i=window.setTimeout((()=>{const s=[],i=[];for(const[t,i]of this.entries())i!==e.get(t)&&s.push([t,i]);for(const[t,s]of e.entries())this.has(t)&&s===this.get(t)||i.push([t,s]);if(s.length||i.length){const e={added:s,removed:i,target:this};if(this.hasEventListener("after-add"))for(const e of s)this.emit("after-add",{target:this,item:e});if(this.hasEventListener("after-remove"))for(const e of i)this.emit("after-remove",{target:this,item:e});this.emit("change",e),a()}t()}))},a=()=>{e.clear(),s();for(const s of this.keys()){const i=this._getFieldExtension(s);let a="{0}";if(i){const e=f(i,"format",r);t.add(e),i.format&&(a=i.format)}e.set(s,this._formatAttribute(s,a))}};a();const o=this._feature.attributes.on("change",r),n=this._feature.schema.fieldExtensions.on("change",r),l=[f(this._feature.settings.formatSettings,"numberFormat",r),f(this._feature.settings.formatSettings,"dateFormat",r),f(this._feature.settings.formatSettings,"timeFormat",r),f(this._feature.settings.formatSettings,"locale",r)],h=this._feature.expressionFieldValues.on("change",r),u=this._feature.schema.fields.on("change",(e=>{(e.added?.some((e=>j(e.name)))||e.removed?.some((e=>j(e.name))))&&r()})),p=f(this._feature.settings,"popupTemplate",r);this._onAllObserversRemoved=()=>{h.remove(),o.remove(),n.remove(),u.remove();for(const e of l)e.remove();p.remove(),e.clear(),s()}}const s=super.on(e,t);return this._numObservers++,{remove:()=>{s.remove(),this._numObservers--,this._numObservers||this._onAllObserversRemoved()}}}_getFieldExtension(e){const t=this._feature.schema.findFieldByName(e);if(t)return this._feature.schema.fieldExtensions.forField(t)}_getFieldExtensionFormat(e){const t=this._getFieldExtension(e);return t?t.format:"{0}"}_formatAttribute(e,t){const s=E(e);if(null!=s)return re(this._feature,"expression",s,{format:t});const[i,r]=A(e);return null!=i?re(this._feature,i,r,{format:t}):re(this._feature,void 0,e,{format:t})}}const W=/\{(?:relationships[\\/]([\w-]*)[\\/])?(?:(expression)[\\/])?([_a-zA-ZÀ-ÖØ-öø-ÿ][._a-zA-ZÀ-ÖØ-öø-ÿ0-9()]*)(?::([^}]*))?\}/gi,q=/\{relationships\/([\w-]*)[\\/]([^}]*)\}/gi,X=/{{/g,Y="\0MAGIC\0",ee=new RegExp(Y,"g"),te="#INVALID";class se extends y{_feature;_hyperlinks;constructor(e){super(e.settings.hyperlinkTemplates,(e=>this._getHyperlink(e))),this._feature=e}_getHyperlink(e){return null==this._hyperlinks&&(this._hyperlinks=new WeakMap),this._hyperlinks.has(e)||this._hyperlinks.set(e,new ie(this._feature,e)),this._hyperlinks.get(e)}}let ie=class extends a{get url(){return this._template.url?this._feature.format(this._template.url):this._template.url}set url(e){throw new o(J)}get text(){return this._template.text?this._feature.format(this._template.text):this._template.text}set text(e){throw new o(J)}get iconUrl(){return this._template.iconUrl?this._feature.format(this._template.iconUrl):this._template.iconUrl}set iconUrl(e){throw new o(J)}get target(){return this._template.target?this._feature.format(this._template.target):this._template.target}set target(e){throw new o(J)}get tooltip(){return this._template.tooltip?this._feature.format(this._template.tooltip):this._template.tooltip}set tooltip(e){throw new o(J)}_feature;_template;constructor(e,t){super(t.toJSON()),this._feature=e,this._template=t,m(this,(e=>{const t=f(this._template,e,(()=>c(this,e)),{sync:!0}),s=this._feature.presentableAttributes.on("change",(()=>{c(this,e)})),i=this._feature.relatedFeatures.on("change",(()=>{c(this,e)}));return p([t,s,i])}))}_getSerializableProperties(){return{}}};function re(e,t,s,i={format:"{0}"}){if(!G(t,"expression")){if(t){const r=U(e.relatedFeatures.keys(),(e=>G(e.id,t)));if(!r)return $.debug("Could not resolve related field '{0}/{1}",t,s),te;const a=Array.from(e.relatedFeatures.get(r));return"many-to-one"===r.cardinality||"one-to-one"===r.cardinality?a.length<1?($.debug("Could not resolve related field '{0}/{1}",t,s),te):ae(a[0],s,i):a.map((e=>ae(e,s,i))).filter((e=>""!==e)).join(",")}return ae(e,s,i)}if(!e.settings.popupTemplate?.expressionInfos?.find((e=>G(e.name,s))))return $.debug("Could not find expression '{0}'.",s),te;try{const t=e.expressionFieldValues.get(s)??i.defaultExpressionValue??"",r=e.schema.findFieldByName(`expression/${s}`),a=null==r?void 0:e.schema.fieldExtensions.forField(r);return oe(e,t,s,a?.formatSettings,i)}catch(e){if(e instanceof Error)return $.error({message:"Error evaluating expression '{0}': {1}.",error:e},s,e.message),te;throw e}}function ae(e,t,s){let i;if(i=e.attributes.get(t),null==i)return"";const r=e.schema.findFieldByName(t),a=e.type?.domains?.[r?.name??t],o=e=>e.codedValues?.find((e=>e.code.toString()===i.toString()))?.name??i;let n;if(G(t,e.schema.typeIdField)){const t=a&&"inherited"!==a.type?a:r?.domain;i="coded-value"===t?.type?o(t):e.type?.name??i}else if(a&&S(a))i=o(a);else if(r?.domain&&S(r.domain))i=o(r.domain);else if(r){switch(r.type){case"integer":case"small-integer":case"big-integer":case"single":case"double":i=O(i);break;case"date":i=T({timeZone:e.schema.timeZone},i);break;case"timestamp-offset":case"date-only":i=T({},i),"date-only"===r.type&&(s.isDateOnly=!0);break;case"time-only":i=N(i);break;default:i=`${i.toString()}`}const t=e.schema.fieldExtensions.forField(r);t&&(n=t.formatSettings)}return oe(e,i,t,n,s)}function oe(e,t,s,i,r){if("string"==typeof t&&(null==r.format||"{0}"===r.format))return t;const a={...r};if("number"==typeof t||t instanceof Date||t instanceof F){null==a.locale&&(a.locale=i?.locale??e.settings.formatSettings.locale);const r=e.settings.popupTemplate?.fieldInfos?.find((e=>G(e.fieldName,s)))?.format;"number"==typeof t?function(e,t,s,i){null==e.currency&&(e.currency=t?.currency??i.settings.formatSettings.currency);null==e.numberFormat&&(e.numberFormat=t?.numberFormat,null==e.numberFormat&&(e.numberFormat=null==s?i.settings.formatSettings.numberFormat:s.digitSeparator?R.NUMBER:R.FIXED_POINT));null==e.fractionalDigits&&(e.fractionalDigits=t?.fractionalDigits,null==e.fractionalDigits&&(e.fractionalDigits=null==s?i.settings.formatSettings.fractionalDigits:s.places))}(a,i,r,e):t instanceof Date?function(e,t,s,i){null==e.dateFormat&&(e.dateFormat=t?.dateFormat,null==e.dateFormat&&(e.dateFormat=null==s?i.settings.formatSettings.dateFormat:k(s.dateFormat)));null==e.timeZone&&(e.timeZone=t?.timeZone??i.settings.formatSettings.timeZone)}(a,i,r,e):function(e,t,s,i){null==e.timeFormat&&(e.timeFormat=t?.timeFormat,null==e.timeFormat&&(e.timeFormat=null==s?i.settings.formatSettings.timeFormat:D(s.dateFormat)))}(a,i,r,e)}return M(a,t)}ie=e([u],ie);export async function resolveRelatedFeatures(e){const t=w(e,(e=>e.source));await Promise.all(x([...t.keys()].map((e=>e.relationships.toArray()))).map((e=>(async e=>{[...(await e.getAllRelatedFeatures(t.get(e.source))).entries()].forEach((([t,s])=>{t.relatedFeatures.set(e,s)}))})(e))))}
@@ -1,2 +1,2 @@
1
- <!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>version | @vertigis/arcgis-extensions</title><meta name="description" content="Documentation for @vertigis/arcgis-extensions"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@vertigis/arcgis-extensions</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@vertigis/arcgis-extensions</a></li><li><a href="../modules/version.html">version</a></li><li><a href="version.version.html">version</a></li></ul><h1>Variable version<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">version</span><span class="tsd-signature-symbol"> = &quot;51.9.0&quot;</span></div><div class="tsd-comment tsd-typography"><p>The current version of the Geocortex ArcGIS Extensions API.</p>
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>version | @vertigis/arcgis-extensions</title><meta name="description" content="Documentation for @vertigis/arcgis-extensions"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@vertigis/arcgis-extensions</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@vertigis/arcgis-extensions</a></li><li><a href="../modules/version.html">version</a></li><li><a href="version.version.html">version</a></li></ul><h1>Variable version<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">version</span><span class="tsd-signature-symbol"> = &quot;51.10.1&quot;</span></div><div class="tsd-comment tsd-typography"><p>The current version of the Geocortex ArcGIS Extensions API.</p>
2
2
  </div><div class="tsd-comment tsd-typography"></div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@vertigis/arcgis-extensions</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vertigis/arcgis-extensions",
3
3
  "license": "SEE LICENSE IN LICENSE",
4
- "version": "51.9.0",
4
+ "version": "51.10.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://dev.azure.com/vertigis/Studio/_git/arcgis-extensions-ts"
@@ -1 +1 @@
1
- import{getLayerJsonType as e}from"../json/LayerJson.js";import{WellKnownBasemap as r}from"../support/esri.js";import{isBasemap as s}from"./mapping.js";function t(e){if(e?.$ref){const r=e;return"string"==typeof r.$ref?{title:r.$ref,id:r.$ref,...e}:{...e,...r.$ref}}return e}export function getLayerUrl(r){if(!r)return;if(r.$ref?.url)return r.$ref?.url;let s;switch(isLayer(r)?e(r):r.layerType){case"ArcGISFeatureLayer":case"SubtypeGroupLayer":isRouteLayer(r)||(s=isLayer(r)&&r.url?`${r.url}/${r.layerId}`:r.url);break;case"ArcGISSceneServiceLayer":case"BuildingSceneLayer":case"PointCloudLayer":s=isLayer(r)&&r.url?`${r.url}/layers/${r.layerId}`:r.url;break;case"VectorTileLayer":s=r.styleUrl??r.url;break;case"WebTiledLayer":s=r.wmtsInfo||isWMTSLayer(r)?r.wmtsInfo?.url??r.url:r.templateUrl??r.urlTemplate;break;default:s=r.url}return s??void 0}export function layersAreEquivalent(e,r){return"none"!==getEquivalencyTypeForLayers(e,r)}export function getEquivalencyTypeForLayers(r,s){if(!r||!s)return"none";if(r===s)return"solid";const a=isLayer(r)?r:t(r),i=isLayer(s)?s:t(s),n=isLayer(a)?e(a):a.layerType;if(n!==(isLayer(i)?e(i):i.layerType))return"none";if(null!=n&&("OpenStreetMap"===(o=n)||"BingMapsAerial"===o||"BingMapsRoad"===o||"BingMapsHybrid"===o))return"solid";var o;if(a.id===i.id)return"solid";const l=a.title&&a.title===i.title;if("GroupLayer"===n&&l)return"solid";const c=getLayerUrl(r),y=getLayerUrl(s);return c&&y&&function(e,r){if(!e||!r)return e==r;return e.toLowerCase().replace("www.arcgis.com","cdn.arcgis.com")===r.toLowerCase().replace("www.arcgis.com","cdn.arcgis.com")}(c,y)?l?"solid":"loose":l?"loose":"none"}export function basemapsAreEquivalent(e,r){if(e===r)return!0;if(!e||!r)return!1;const t=s(e)?e.toJSON():e,a=t.baseMapLayers?.filter((e=>!e.isReference))??[],i=t.baseMapLayers?.filter((e=>e.isReference))??[],n=s(r)?r.toJSON():r,o=n.baseMapLayers?.filter((e=>!e.isReference))??[],l=n.baseMapLayers?.filter((e=>e.isReference))??[];return a.length===o.length&&a.every(((e,r)=>layersAreEquivalent(e,o[r])))&&i.length===l.length&&i.every(((e,r)=>layersAreEquivalent(e,l[r])))}export const standardBasemaps={[r.DARK_GRAY]:{baseMapLayers:[{id:"dark-gray-base-layer",title:"World Dark Gray Base",url:"https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1},{isReference:!0,id:"dark-gray-reference-layer",title:"World Dark Gray Reference",url:"https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1}]},[r.DARK_GRAY_VECTOR]:{baseMapLayers:[{id:"dark-gray-base-layer",layerType:"VectorTileLayer",showLegend:!1,title:"Dark Gray Base",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json"},{id:"dark-gray-reference-layer",layerType:"VectorTileLayer",showLegend:!1,title:"Dark Gray Reference",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",isReference:!0}]},[r.GRAY]:{baseMapLayers:[{id:"gray-base-layer",title:"World Light Gray Base",url:"https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1},{isReference:!0,id:"gray-reference-layer",title:"World Light Gray Reference",url:"https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1}]},[r.GRAY_VECTOR]:{baseMapLayers:[{id:"gray-base-layer",layerType:"VectorTileLayer",showLegend:!1,title:"Light Gray Base",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json"},{id:"gray-reference-layer",layerType:"VectorTileLayer",showLegend:!1,title:"Light Gray Reference",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",isReference:!0}]},[r.HYBRID]:{baseMapLayers:[{id:"hybrid-base-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",title:"World Imagery"},{id:"hybrid-reference-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer",title:"World Boundaries and Places",isReference:!0}]},[r.HYBRID_VECTOR]:{baseMapLayers:[{id:"hybrid-base-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",title:"World Imagery"},{id:"hybrid-reference-layer",layerType:"VectorTileLayer",showLegend:!1,title:"Hybrid Reference Layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",isReference:!0}]},[r.OCEANS]:{baseMapLayers:[{id:"oceans-base-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",title:"World Ocean Base"},{id:"oceans-reference-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Reference",url:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",isReference:!0}]},[r.OCEANS_VECTOR]:{baseMapLayers:[{id:"oceans-base-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",title:"World Ocean Base"},{id:"oceans-reference-layer",layerType:"VectorTileLayer",showLegend:!1,title:"World Ocean Reference",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/89860a5baf424f3ea0c655115faababe/resources/styles/root.json",isReference:!0}]},[r.OPEN_STREET_MAP]:{baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",showLegend:!1,title:"OpenStreetMap"}]},[r.OPEN_STREET_MAP_VECTOR]:{baseMapLayers:[{id:"osm-base-layer",layerType:"VectorTileLayer",showLegend:!1,title:"OpenStreetMap",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/3e1a00aeae81496587988075fe529f71/resources/styles/root.json"}]},[r.SATELLITE]:{baseMapLayers:[{id:"satellite-base-layer",title:"World Imagery",url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1}]},[r.STREETS]:{baseMapLayers:[{id:"streets-base-layer",title:"World Street Map",url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1}]},[r.STREETS_NAVIGATION_VECTOR]:{baseMapLayers:[{id:"streets-navigation-vector-base-layer",title:"World Navigation Map",layerType:"VectorTileLayer",showLegend:!1,styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json"}]},[r.STREETS_NIGHT_VECTOR]:{baseMapLayers:[{id:"streets-night-vector-base-layer",title:"World Street Map (Night)",layerType:"VectorTileLayer",showLegend:!1,styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json"}]},[r.STREETS_RELIEF_VECTOR]:{baseMapLayers:[{id:"world-hillshade-layer",title:"World Hillshade",url:"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1},{id:"streets-relief-vector-base-layer",title:"World Streets Relief",layerType:"VectorTileLayer",showLegend:!1,styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json"}]},[r.STREETS_VECTOR]:{baseMapLayers:[{id:"streets-vector-base-layer",title:"World Street Map",layerType:"VectorTileLayer",showLegend:!1,styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json"}]},[r.TERRAIN]:{baseMapLayers:[{id:"terrain-base-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",title:"World Terrain Base"},{id:"terrain-reference-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",title:"World Terrain Reference",isReference:!0}]},[r.TERRAIN_VECTOR]:{baseMapLayers:[{id:"world-hillshade",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",title:"World Hillshade"},{id:"terrain-base-layer",layerType:"VectorTileLayer",showLegend:!1,title:"World Terrain Base",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/33064a20de0c48d2bb61efa8faca93a8/resources/styles/root.json"},{id:"terrain-reference-layer",layerType:"VectorTileLayer",showLegend:!1,title:"World Terrain Reference",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/14fbc125ccc9488888b014db09f35f67/resources/styles/root.json",isReference:!0}]},[r.TOPO]:{baseMapLayers:[{id:"topo-base-layer",title:"World Topo Map",url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1}]},[r.TOPO_VECTOR]:{baseMapLayers:[{id:"world-hillshade-layer",title:"World Hillshade",url:"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1},{id:"topo-vector-base-layer",title:"World Topographic Map",layerType:"VectorTileLayer",showLegend:!1,styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json"}]}};const a=/^esri[./]layers[./](tools[./])?\w+Layer$/,i=/^esri[./]layers[./](support[./])?(buildingSublayers[./])?\w*Sublayer$/;export function isLayer(e){const r=e?.declaredClass;return"string"==typeof r&&a.test(r)}export function isSublayer(e){const r=e?.declaredClass;return"string"==typeof r&&i.test(r)}export function isBingMapsLayer(e){return"bing-maps"===e?.type}export function isCSVLayer(e){return"csv"===e?.type}export function isGeoJSONLayer(e){return"geojson"===e?.type}export function isSubtypeGroupLayer(e){return"subtype-group"===e?.type}export function isStreamLayer(e){return"stream"===e?.type}export function isFeatureLayerBase(e){return isCSVLayer(e)||isFeatureLayer(e)||isStreamLayer(e)||isGeoJSONLayer(e)}export function isFeatureLayer(e){return"feature"===e?.type}export function isGeoRssLayer(e){return"geo-rss"===e?.type}export function isGraphicsLayer(e){return"graphics"===e?.type}export function isMapNotesLayer(e){return"map-notes"===e?.type}export function isImageryLayer(e){return"imagery"===e?.type}export function isKMLLayer(e){return"kml"===e?.type}export function isMediaLayer(e){return"media"===e?.type}export function isMapImageLayer(e){return"map-image"===e?.type}export function isOpenStreetMapLayer(e){return"open-street-map"===e?.type}export function isWebTileLayer(e){return"web-tile"===e?.type||"open-street-map"===e?.type}export function isVectorTileLayer(e){return"vector-tile"===e?.type}export function isElevationLayer(e){return"elevation"===e?.type}export function isSceneLayer(e){return"scene"===e?.type}export function isPointCloudLayer(e){return"point-cloud"===e?.type}export function isIntegratedMeshLayer(e){return"integrated-mesh"===e?.type}export function isGroupLayer(e){return"group"===e?.type}export function isWFSLayer(e){return"wfs"===e?.type}export function isWMSLayer(e){return"wms"===e?.type}export function isWMTSLayer(e){return"wmts"===e?.type}export function isBuildingSceneLayer(e){return"building-scene"===e?.type}export function isTileLayer(e){return"tile"===e?.type}export function isImageryTileLayer(e){return"imagery-tile"===e?.type}export function isTiledImageServiceLayer(e){return isTileLayer(e)&&n(e)}export function isTiledMapServiceLayer(e){return isTileLayer(e)&&!n(e)}function n(e){const r=e.url??e.portalItem?.url;return null!=r&&/\/ImageServer(\/|\/?$)/i.test(r)}export function isMapImageSublayer(e){return"esri.layers.support.Sublayer"===e?.declaredClass}export function isKMLSublayer(e){return"esri.layers.support.KMLSublayer"===e?.declaredClass}export function isWMTSSublayer(e){return"esri.layers.support.WMTSSublayer"===e?.declaredClass}export function isWMSSublayer(e){return"esri.layers.support.WMSSublayer"===e?.declaredClass}export function isMapNotesSublayer(e){return"esri.layers.MapNotesLayer.MapNotesSublayer"===e?.declaredClass}export function isRouteLayer(e){return"route"===e?.type}export function isBuildingComponentSublayer(e){const r=e;return"building-component"===r?.type}export function isBuildingGroupSublayer(e){const r=e;return"building-group"===r?.type}export function isLayerWithLegendEnabledProperty(e){return!(isBuildingSceneLayer(e)||isCSVLayer(e)||isElevationLayer(e)||isGraphicsLayer(e)||isGroupLayer(e)||isIntegratedMeshLayer(e)||isKMLLayer(e)||isOpenStreetMapLayer(e)||isPointCloudLayer(e)||isWebTileLayer(e)||isWMTSLayer(e)||isVectorTileLayer(e))}export function hasMmapLayer(e){return e.some((e=>{const r=e._deferredLayerProperties;return!("string"==typeof r?.$ref||!r?.$ref?.path)||!!e.layerExtensions&&hasMmapLayer(e.layerExtensions.toArray())}))}export function isTimeAwareLayer(e){return isLayer(e)&&e.hasOwnProperty("timeExtent")}export function isSubtypeSublayer(e){return"esri.layers.support.SubtypeSublayer"===e?.declaredClass}
1
+ import{getLayerJsonType as e}from"../json/LayerJson.js";import{WellKnownBasemap as r}from"../support/esri.js";import{isBasemap as s}from"./mapping.js";function a(e){if(e?.$ref){const r=e;return"string"==typeof r.$ref?{title:r.$ref,id:r.$ref,...e}:{...e,...r.$ref}}return e}export function getLayerUrl(r){if(!r)return;if(r.$ref?.url)return r.$ref?.url;let s;switch(isLayer(r)?e(r):r.layerType){case"ArcGISFeatureLayer":case"SubtypeGroupLayer":isRouteLayer(r)||(s=isLayer(r)&&r.url?`${r.url}/${r.layerId}`:r.url);break;case"ArcGISSceneServiceLayer":case"BuildingSceneLayer":case"PointCloudLayer":s=isLayer(r)&&r.url?`${r.url}/layers/${r.layerId}`:r.url;break;case"VectorTileLayer":s=r.styleUrl??r.url;break;case"WebTiledLayer":s=r.wmtsInfo||isWMTSLayer(r)?r.wmtsInfo?.url??r.url:r.templateUrl??r.urlTemplate;break;default:s=r.url}return s??void 0}export function layersAreEquivalent(e,r){return"none"!==getEquivalencyTypeForLayers(e,r)}export function getEquivalencyTypeForLayers(r,s){if(!r||!s)return"none";if(r===s)return"solid";const t=isLayer(r)?r:a(r),i=isLayer(s)?s:a(s),n=isLayer(t)?e(t):t.layerType;if(n!==(isLayer(i)?e(i):i.layerType))return"none";if(null!=n&&("OpenStreetMap"===(o=n)||"BingMapsAerial"===o||"BingMapsRoad"===o||"BingMapsHybrid"===o))return"solid";var o;if(t.id===i.id)return"solid";const l=t.title&&t.title===i.title;if("GroupLayer"===n&&l)return"solid";const c=getLayerUrl(r),y=getLayerUrl(s);return c&&y&&function(e,r){if(!e||!r)return e==r;return e.toLowerCase().replace("www.arcgis.com","cdn.arcgis.com")===r.toLowerCase().replace("www.arcgis.com","cdn.arcgis.com")}(c,y)?l?"solid":"loose":l?"loose":"none"}export function basemapsAreEquivalent(e,r){if(e===r)return!0;if(!e||!r)return!1;const a=s(e)?e.toJSON():e,t=a.baseMapLayers?.filter((e=>!e.isReference))??[],i=a.baseMapLayers?.filter((e=>e.isReference))??[],n=s(r)?r.toJSON():r,o=n.baseMapLayers?.filter((e=>!e.isReference))??[],l=n.baseMapLayers?.filter((e=>e.isReference))??[];return t.length===o.length&&t.every(((e,r)=>layersAreEquivalent(e,o[r])))&&i.length===l.length&&i.every(((e,r)=>layersAreEquivalent(e,l[r])))}export const standardBasemaps={[r.DARK_GRAY]:{baseMapLayers:[{id:"dark-gray-base-layer",title:"World Dark Gray Base",url:"https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1},{isReference:!0,id:"dark-gray-reference-layer",title:"World Dark Gray Reference",url:"https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1}]},[r.DARK_GRAY_VECTOR]:{baseMapLayers:[{id:"dark-gray-base-layer",layerType:"VectorTileLayer",showLegend:!1,title:"Dark Gray Base",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json"},{id:"dark-gray-reference-layer",layerType:"VectorTileLayer",showLegend:!1,title:"Dark Gray Reference",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",isReference:!0}]},[r.GRAY]:{baseMapLayers:[{id:"gray-base-layer",title:"World Light Gray Base",url:"https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1},{isReference:!0,id:"gray-reference-layer",title:"World Light Gray Reference",url:"https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1}]},[r.GRAY_VECTOR]:{baseMapLayers:[{id:"gray-base-layer",layerType:"VectorTileLayer",showLegend:!1,title:"Light Gray Base",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json"},{id:"gray-reference-layer",layerType:"VectorTileLayer",showLegend:!1,title:"Light Gray Reference",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",isReference:!0}]},[r.HYBRID]:{baseMapLayers:[{id:"hybrid-base-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",title:"World Imagery"},{id:"hybrid-reference-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer",title:"World Boundaries and Places",isReference:!0}]},[r.HYBRID_VECTOR]:{baseMapLayers:[{id:"hybrid-base-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",title:"World Imagery"},{id:"hybrid-reference-layer",layerType:"VectorTileLayer",showLegend:!1,title:"Hybrid Reference Layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",isReference:!0}]},[r.OCEANS]:{baseMapLayers:[{id:"oceans-base-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",title:"World Ocean Base"},{id:"oceans-reference-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Reference",url:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",isReference:!0}]},[r.OCEANS_VECTOR]:{baseMapLayers:[{id:"oceans-base-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",title:"World Ocean Base"},{id:"oceans-reference-layer",layerType:"VectorTileLayer",showLegend:!1,title:"World Ocean Reference",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/89860a5baf424f3ea0c655115faababe/resources/styles/root.json",isReference:!0}]},[r.OPEN_STREET_MAP]:{baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",showLegend:!1,title:"OpenStreetMap"}]},[r.OPEN_STREET_MAP_VECTOR]:{baseMapLayers:[{id:"osm-base-layer",layerType:"VectorTileLayer",showLegend:!1,title:"OpenStreetMap",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/aa809b0ba7a14c61a3a25a6d1df3e6af/resources/styles/root.json"}]},[r.SATELLITE]:{baseMapLayers:[{id:"satellite-base-layer",title:"World Imagery",url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1}]},[r.STREETS]:{baseMapLayers:[{id:"streets-base-layer",title:"World Street Map",url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1}]},[r.STREETS_NAVIGATION_VECTOR]:{baseMapLayers:[{id:"streets-navigation-vector-base-layer",title:"World Navigation Map",layerType:"VectorTileLayer",showLegend:!1,styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json"}]},[r.STREETS_NIGHT_VECTOR]:{baseMapLayers:[{id:"streets-night-vector-base-layer",title:"World Street Map (Night)",layerType:"VectorTileLayer",showLegend:!1,styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json"}]},[r.STREETS_RELIEF_VECTOR]:{baseMapLayers:[{id:"world-hillshade-layer",title:"World Hillshade",url:"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1},{id:"streets-relief-vector-base-layer",title:"World Streets Relief",layerType:"VectorTileLayer",showLegend:!1,styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json"}]},[r.STREETS_VECTOR]:{baseMapLayers:[{id:"streets-vector-base-layer",title:"World Street Map",layerType:"VectorTileLayer",showLegend:!1,styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json"}]},[r.TERRAIN]:{baseMapLayers:[{id:"terrain-base-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",title:"World Terrain Base"},{id:"terrain-reference-layer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",title:"World Terrain Reference",isReference:!0}]},[r.TERRAIN_VECTOR]:{baseMapLayers:[{id:"world-hillshade",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,url:"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",title:"World Hillshade"},{id:"terrain-base-layer",layerType:"VectorTileLayer",showLegend:!1,title:"World Terrain Base",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/33064a20de0c48d2bb61efa8faca93a8/resources/styles/root.json"},{id:"terrain-reference-layer",layerType:"VectorTileLayer",showLegend:!1,title:"World Terrain Reference",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/14fbc125ccc9488888b014db09f35f67/resources/styles/root.json",isReference:!0}]},[r.TOPO]:{baseMapLayers:[{id:"topo-base-layer",title:"World Topo Map",url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1}]},[r.TOPO_VECTOR]:{baseMapLayers:[{id:"world-hillshade-layer",title:"World Hillshade",url:"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",showLegend:!1},{id:"topo-vector-base-layer",title:"World Topographic Map",layerType:"VectorTileLayer",showLegend:!1,styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json"}]}};const t=/^esri[./]layers[./](tools[./])?\w+Layer$/,i=/^esri[./]layers[./](support[./])?(buildingSublayers[./])?\w*Sublayer$/;export function isLayer(e){const r=e?.declaredClass;return"string"==typeof r&&t.test(r)}export function isSublayer(e){const r=e?.declaredClass;return"string"==typeof r&&i.test(r)}export function isBingMapsLayer(e){return"bing-maps"===e?.type}export function isCSVLayer(e){return"csv"===e?.type}export function isGeoJSONLayer(e){return"geojson"===e?.type}export function isSubtypeGroupLayer(e){return"subtype-group"===e?.type}export function isStreamLayer(e){return"stream"===e?.type}export function isFeatureLayerBase(e){return isCSVLayer(e)||isFeatureLayer(e)||isStreamLayer(e)||isGeoJSONLayer(e)}export function isFeatureLayer(e){return"feature"===e?.type}export function isGeoRssLayer(e){return"geo-rss"===e?.type}export function isGraphicsLayer(e){return"graphics"===e?.type}export function isMapNotesLayer(e){return"map-notes"===e?.type}export function isImageryLayer(e){return"imagery"===e?.type}export function isKMLLayer(e){return"kml"===e?.type}export function isMediaLayer(e){return"media"===e?.type}export function isMapImageLayer(e){return"map-image"===e?.type}export function isOpenStreetMapLayer(e){return"open-street-map"===e?.type}export function isWebTileLayer(e){return"web-tile"===e?.type||"open-street-map"===e?.type}export function isVectorTileLayer(e){return"vector-tile"===e?.type}export function isElevationLayer(e){return"elevation"===e?.type}export function isSceneLayer(e){return"scene"===e?.type}export function isPointCloudLayer(e){return"point-cloud"===e?.type}export function isIntegratedMeshLayer(e){return"integrated-mesh"===e?.type}export function isGroupLayer(e){return"group"===e?.type}export function isWFSLayer(e){return"wfs"===e?.type}export function isWMSLayer(e){return"wms"===e?.type}export function isWMTSLayer(e){return"wmts"===e?.type}export function isBuildingSceneLayer(e){return"building-scene"===e?.type}export function isTileLayer(e){return"tile"===e?.type}export function isImageryTileLayer(e){return"imagery-tile"===e?.type}export function isTiledImageServiceLayer(e){return isTileLayer(e)&&n(e)}export function isTiledMapServiceLayer(e){return isTileLayer(e)&&!n(e)}function n(e){const r=e.url??e.portalItem?.url;return null!=r&&/\/ImageServer(\/|\/?$)/i.test(r)}export function isMapImageSublayer(e){return"esri.layers.support.Sublayer"===e?.declaredClass}export function isKMLSublayer(e){return"esri.layers.support.KMLSublayer"===e?.declaredClass}export function isWMTSSublayer(e){return"esri.layers.support.WMTSSublayer"===e?.declaredClass}export function isWMSSublayer(e){return"esri.layers.support.WMSSublayer"===e?.declaredClass}export function isMapNotesSublayer(e){return"esri.layers.MapNotesLayer.MapNotesSublayer"===e?.declaredClass}export function isRouteLayer(e){return"route"===e?.type}export function isBuildingComponentSublayer(e){const r=e;return"building-component"===r?.type}export function isBuildingGroupSublayer(e){const r=e;return"building-group"===r?.type}export function isLayerWithLegendEnabledProperty(e){return!(isBuildingSceneLayer(e)||isCSVLayer(e)||isElevationLayer(e)||isGraphicsLayer(e)||isGroupLayer(e)||isIntegratedMeshLayer(e)||isKMLLayer(e)||isOpenStreetMapLayer(e)||isPointCloudLayer(e)||isWebTileLayer(e)||isWMTSLayer(e)||isVectorTileLayer(e))}export function hasMmapLayer(e){return e.some((e=>{const r=e._deferredLayerProperties;return!("string"==typeof r?.$ref||!r?.$ref?.path)||!!e.layerExtensions&&hasMmapLayer(e.layerExtensions.toArray())}))}export function isTimeAwareLayer(e){return isLayer(e)&&e.hasOwnProperty("timeExtent")}export function isSubtypeSublayer(e){return"esri.layers.support.SubtypeSublayer"===e?.declaredClass}
package/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The current version of the Geocortex ArcGIS Extensions API.
3
3
  */
4
- export declare const version = "51.9.0";
4
+ export declare const version = "51.10.1";
package/version.js CHANGED
@@ -1 +1 @@
1
- export const version="51.9.0";
1
+ export const version="51.10.1";