@vertigis/arcgis-extensions 50.0.1 → 50.0.2

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.
@@ -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;50.0.1&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;50.0.2&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": "50.0.1",
4
+ "version": "50.0.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://dev.azure.com/vertigis/Studio/_git/arcgis-extensions-ts"
@@ -1 +1 @@
1
- import t from"@arcgis/core/core/Accessor";import e from"@arcgis/core/core/Collection.js";import{Property as r}from"@arcgis/core/core/accessorSupport/Property";import{trackAccess as n}from"@arcgis/core/core/accessorSupport/tracking";import{watch as o}from"@arcgis/core/core/reactiveUtils";import{}from"../utilities/ObservableMap.js";function s(t){return null!=t&&"object"==typeof t&&"__isObservable"in t&&t.__isObservable}function i(t){if(s(t))return t}function c(e){return e instanceof t}function a(t){return t instanceof e||null!=t&&"esri.core.Collection"===t.declaredClass}function l(t){return s(t)&&"ObservableMap"===t[Symbol.toStringTag]}function u(t){return a(t)||l(t)||function(t){return s(t)&&"ObservableSet"===t[Symbol.toStringTag]}(t)}class h{}export function observable(t){return class extends(t??h){__isObservable=!0;_subscribedPaths=new Map;_onWatchPaths=new Map;_esriProps=new Map;constructor(...t){return super(...t),function(t){return new Proxy(t,{get:(t,e,r)=>{if("_esriProps"===e)return Reflect.get(t,e,r);const o=Reflect.get(t,e,r);let s=t._esriProps.get(e);return null==s&&(s=new w(e.toString(),o),t._esriProps.set(e,s)),n(s),o},set:(t,e,r,n)=>{if(Reflect.set(t,e,r,n),"_esriProps"===e)return!0;const o=t._esriProps.get(e);if(o){if(!o.invalidated&&r===o.currentValue)return!0;o.invalidate(),o.currentValue=r,o.commit()}return!0}})}(this)}_onWatch(t,e){let r,n;"string"==typeof t?(r=t,n=e):n=t;let o=this._onWatchPaths.get(r);if(null==o&&(o=[],this._onWatchPaths.set(r,o)),o.push(n),null!=r&&this._subscribedPaths.has(r)){this._subscribedPaths.get(r).onWatchHandles.set(n,n())}else if(null==r&&this._subscribedPaths.size>0)for(const[t,e]of this._subscribedPaths){const r=n(t);e.onWatchHandles.set(n,r)}const s=new WeakRef(this);return{remove:()=>{const t=s.deref();if(null==t)return;if(!t._onWatchPaths.has(r))return;const e=t._onWatchPaths.get(r),o=e.indexOf(n);if(-1!==o&&e.splice(o,1),null!=r&&t._subscribedPaths.has(r)){const e=t._subscribedPaths.get(r),o=e.onWatchHandles.get(n);null!=o&&(o.remove(),e.onWatchHandles.delete(n))}else if(null==r&&t._subscribedPaths.size>0)for(const[,e]of t._subscribedPaths){const t=e.onWatchHandles.get(n);null!=t&&(t.remove(),e.onWatchHandles.delete(n))}0===e.length&&t._onWatchPaths.delete(r)}}}_notifyChange(t){let e;e=null==t?this._subscribedPaths.keys():[t];for(const t of e){if(this._esriProps.has(t)){const e=this._esriProps.get(t),r=this[t];r!==e.currentValue&&(e.invalidate(),e.currentValue=r,e.commit())}const e=this._subscribedPaths.get(t);if(null==e)continue;const r=e.currentValue,n=this[t];if(Object.is(n,r))continue;e.currentValue=n;const o=[...e.callbacks];for(const t of o)t(n,r,this)}}_watch(t,e,r){const n=[];if(t.includes(".")){if(t.includes("[]"))return this._recurseCollectionWatch(t,e,r);const o=t.split("."),s=o.shift(),i=new AbortController,{signal:c}=i,a=new WeakRef(this);let l;const u=v(e,t),h=()=>{if(c.aborted)return void(l=void 0);const t=a.deref();if(null==t){for(const t of n)t.remove();return n.length=0,void(l=void 0)}let e=t[s],r=t;for(let t=0;t<o.length;t++)if(r=e,e=e?.[o[t]],null==e){t<o.length-1&&(r=void 0);break}if(e!==l){const t=l;l=e,u(e,t,r)}},f=r?.sync?v(h,t):_(h,t,c);let b,p,w;if([l,w,b,p]=this._recurseWatch(t,f),n.push(g(b,p)),r?.initial){(r?.sync?v(e,t):_(e,t,c))(l,l,w)}return d(n,i)}return this._watchSingle(t,e,r)}_recurseWatch(t,e){const r=t.split("."),n=r.shift(),o=[];let a,l;if(r.length>0){const t=this[n];if(s(t)){const[n,s,c,u]=i(t)._recurseWatch(r.join("."),e);o.push(g(c,u)),a=n,l=s}else if(c(t)){const[n,s,i]=f(t,r,e,{sync:!0});o.push(i),a=n,l=s}}const u=this._watchSingle(n,((t,n)=>{if(t!==n){if(r.length>0){if(s(n)||c(n)){for(const t of o)t.remove();o.length=0}if(s(t)){const[,,n,s]=i(t)._recurseWatch(r.join("."),e);o.push(g(n,s))}else if(c(t)){const[,,n]=f(t,r,e,{sync:!0});o.push(n)}}e()}}),{sync:!0});return[r.length>0?a:this._subscribedPaths.get(n).currentValue,r.length>0?l:this,o,u]}_recurseCollectionWatch(t,e,r){const n=t.split("."),o=n.shift();if("[]"===n[0])return this._collectionWatch(o,n,e,r);{const t=[],a=this._watchSingle(o,(o=>{for(const e of t)e.remove();t.length=0,s(o)?t.push(i(o)._recurseCollectionWatch(n.join("."),e,r)):c(o)&&t.push(f(o,n,e,r)[2])})),l=this[o];return s(l)?t.push(i(l)._recurseCollectionWatch(n.join("."),e,r)):c(l)&&t.push(f(l,n,e,r)[2]),g(t,a)}}_collectionWatch(t,e,r,n){const o=[];u(this[t])&&o.push(b(this[t],e.join("."),r,n));const s=this._watchSingle(t,((t,s)=>{if(u(s)){for(const t of o)t.remove();o.length=0}u(t)&&o.push(b(t,e.join("."),r,n))}),{sync:!0});return g(o,s)}_watchSingle(t,e,r){let n=this._subscribedPaths.get(t)?.callbacks;if(null==n){let e=Object.getOwnPropertyDescriptor(this,t),r=this;for(;null==e&&(r=Object.getPrototypeOf(r),null!=r);)e=Object.getOwnPropertyDescriptor(r,t);if(null==e)return console.warn(`[observableUtils]: The property ${t.toString()} you are trying to watch does not exist on the object and will not be watched. This is likely a coding error. Please check the property name and ensure it exists on the object. In the future this will throw an exception.`),{remove:()=>{}};if(!1===e.configurable)return console.warn(`[observableUtils]: Property "${t.toString()}" is not configurable so it cannot be watched. In the future this will throw an exception.`),{remove:()=>{}};n=[];const o=new Map;if(this._subscribedPaths.set(t,{callbacks:n,currentValue:this[t],onWatchHandles:o}),!0!==e.writable&&null==e.set||(this._subscribedPaths.get(t).originalDescriptor=e,null!=e.value&&(e.value=void 0),this._createWatchDescriptor(t,e)),this._onWatchPaths.has(t))for(const e of this._onWatchPaths.get(t))o.set(e,e());if(this._onWatchPaths.has(void 0))for(const e of this._onWatchPaths.get(void 0))o.set(e,e(t))}const o=new AbortController,s=v(e,t.toString()),{currentValue:i}=this._subscribedPaths.get(t);let c=i;const a=(t,e,r)=>{const n=c;c=t,s(t,n,r)},l=r?.sync?v(a,t.toString()):_(a,t.toString(),o.signal);return n.push(l),r?.initial&&l(i,i,this),this._createSingleWatchRemoveHandle(t,l,o)}_createWatchDescriptor(t,e){const r={configurable:!0,enumerable:e.enumerable};null==e.get?(r.get=()=>this._subscribedPaths.get(t).currentValue,r.set=e=>{const r=this._subscribedPaths.get(t),n=r.currentValue;if(Object.is(n,e))return;r.currentValue=e;const o=[...r.callbacks];for(const t of o)t(e,n,this)}):(r.get=e.get,r.set=r=>{const n=this._subscribedPaths.get(t),o=n.currentValue;if(Object.is(o,r))return void e.set.call(this,r);n.currentValue=r,e.set.call(this,r);const s=[...n.callbacks];for(const t of s)t(r,o,this)}),Object.defineProperty(this,t,r)}_createSingleWatchRemoveHandle(t,e,r){const n=new WeakRef(this);return{remove:()=>{r.abort();const o=n.deref();if(null==o)return;if(!o._subscribedPaths.has(t))return;const{callbacks:s}=o._subscribedPaths.get(t),i=s.indexOf(e);if(i>=0&&s.splice(i,1),0===s.length){const e=o._subscribedPaths.get(t);o._subscribedPaths.delete(t);for(const t of e.onWatchHandles.values())t.remove();null!=e.originalDescriptor&&(null==e.originalDescriptor.get&&(e.originalDescriptor.value=e.currentValue),Object.defineProperty(o,t,e.originalDescriptor))}}}}}}export function watch(t,e,r,n){if(!s(t)&&c(t))return f(t,e.split("."),r,n)[2];const o=i(t);if(null==o)throw new Error("Object is not observable");if(n?.once){let t;const s=new AbortController,{signal:i}=s,c=n?.sync?v(r,e):_(r,e,i);let a=!1;const l=(e,r,n)=>{i.aborted||(a=!0,t?.remove(),t=void 0,c(e,r,n))};t=o._watch(e,l,{...n,sync:!0});const u=d([t],s);return a&&u.remove(),u}return o._watch(e,r,n)}export function watchEach(t,e,r,n){if(u(t)&&e.startsWith("[]."))return b(t,e,r,n);if(!s(t)&&c(t))return f(t,e.split("."),r,n)[2];const o=i(t);if(null==o)throw new Error("Object is not observable");return o._watch(e,r,n)}export async function once(t,e,r){const{signal:n}=r??{};return new Promise(((r,o)=>{if(n?.aborted)return void o();const s=()=>{i.remove(),o()},i=watch(t,e,(()=>{n?.removeEventListener("abort",s),r()}),{once:!0});n?.addEventListener("abort",s)}))}export function notifyChange(t,e){const r=i(t);if(null==r)throw new Error("Object is not observable");if(null!=e&&"string"!=typeof e)throw new Error("Path must be a string");r._notifyChange(e)}export function onWatch(t,e,r){const n=i(t);if(null==n)throw new Error("Object is not observable");if("string"==typeof e)return n._onWatch(e,r);if("function"!=typeof e)throw new Error("Path must be a string or a function");return n._onWatch(e)}export function watchEvent(t,e,r,n){const o=r[0],s=r[1],i=new WeakMap,c=new Set;let a;return a=watch(t,e,((t,e)=>{if(null!=e&&i.has(e)){const t=i.get(e);t.remove(),i.delete(e),c.delete(t)}if(null!=t&&!i.has(t)){const e=t.on(o,s);i.set(t,e),c.add(e)}t!==e&&n?.(t,e)}),{sync:!0,initial:!0}),g(c,a)}export function when(t,e,r,n){const{invert:o=!1,once:s,...i}=n??{};let c;const a=v(r,e);let l=!1;return c=watch(t,e,(t=>{!t===o&&(a(),s&&(l=!0,c?.remove(),c=void 0))}),{...i,initial:!0}),s&&l&&c?.remove(),c}export function whenOnce(t,e,r){const{signal:n,invert:o=!1}=r??{};return new Promise(((r,s)=>{if(n?.aborted)return void s();const i=()=>{n?.removeEventListener("abort",i),c.remove(),s()},c=when(t,e,(()=>{n?.aborted||(n?.removeEventListener("abort",i),r())}),{invert:o,once:!0});n?.addEventListener("abort",i)}))}export function createIHandle(t){return{remove:()=>{for(const e of t)e.remove()}}}function f(t,e,r,n){const s=e.indexOf("[]");if(-1!==s){const o=e.slice(0,s),i=e.slice(s),c=[],[a,l,h]=f(t,o,((t,e)=>{if(u(e)){for(const t of c)t.remove();c.length=0}u(t)&&c.push(b(t,i.join("."),r,n))}),{sync:!0});return u(a)&&c.push(b(a,i.join("."),r,n)),[a,l,g(c,h)]}return function(t,e,r,n){const s=new WeakRef(t);let i;const c=()=>{let t=s.deref();if(null==t)return i?.remove(),[void 0,void 0];let r=t;for(let n=0;n<e.length;n++)if(t=r,r=t[e[n]],null==r){n<e.length-1&&(t=void 0);break}return[r,t]},a=new AbortController,{signal:l}=a,u=n?.initial&&!1===n?.sync?_(r,e.join("."),l):v(r,e.join(".")),h=function(t){const e=(e,r)=>{Object.is(e[0],r?.[0])||t(e[0],r?.[0],e[1])};return e}(u),[f,b]=c();return n?.initial&&n?.once?(u(f,f,b),[f,b,d([],a)]):(i=o(c,h,{...n,initial:!1}),n?.initial&&u(f,f,b),[f,b,d([i],a)])}(t,e,r,n)}function b(t,e,r,n){const o=new WeakMap,i=new Set,u=e.slice(3),h=t=>{if(!s(t)&&!c(t)||o.has(t))return;if(!(u.split(".")[0]in t))return;const e=watch(t,u,r,n);o.set(t,e),i.add(e)};i.add(t.on("after-add",(t=>{let e=t.item;"target"in t&&l(t.target)&&(e=t.item[1]),h(e)}))),i.add(t.on("after-remove",(t=>{let e=t.item;if("target"in t&&l(t.target)&&(e=t.item[1]),!s(e)&&!c(e))return;const r=o.get(e);null!=r&&(r.remove(),o.delete(e),i.delete(r))})));for(const e of a(t)?t:t.values())h(e);return g(i)}function d(t,e){return{remove:()=>{e?.abort();for(const e of t)e.remove()}}}function g(t,...e){return{remove:()=>{for(const e of t)e.remove();for(const t of e)t.remove()}}}const p="[observableUtils]: Error thrown by watch callback. Thrown errors from watch callbacks should be avoided where possible, they affect the performance of the entire watch system. Watch property:";function v(t,e){return(...r)=>{try{const n=t(...r);"object"==typeof n&&n instanceof Promise&&n.catch((t=>{console.error(`${p} ${e}`,t)}))}catch(t){console.error(`${p} ${e}`,t)}}}function _(t,e,r){const n=v(t,e);let o=new AbortController;return(...t)=>{o.abort(),o=new AbortController;const{signal:e}=o;queueMicrotask((()=>{r.aborted||e.aborted||n(...t)}))}}class w extends r{invalidated=!0;_currentValue;get currentValue(){return this._currentValue}set currentValue(t){this._currentValue=t,this.invalidated=!1}constructor(t,e){super(t,{}),this._currentValue=e}onInvalidated(){this.invalidated=!0,super.onInvalidated()}}
1
+ import t from"@arcgis/core/core/Accessor";import e from"@arcgis/core/core/Collection.js";import{Property as r}from"@arcgis/core/core/accessorSupport/Property";import{trackAccess as n}from"@arcgis/core/core/accessorSupport/tracking";import{watch as o}from"@arcgis/core/core/reactiveUtils";import{}from"../utilities/ObservableMap.js";function s(t){return null!=t&&"object"==typeof t&&"__isObservable"in t&&t.__isObservable}function i(t){if(s(t))return t}function c(e){return e instanceof t}function a(t){return t instanceof e||null!=t&&"esri.core.Collection"===t.declaredClass}function l(t){return s(t)&&"ObservableMap"===t[Symbol.toStringTag]}function u(t){return a(t)||l(t)||function(t){return s(t)&&"ObservableSet"===t[Symbol.toStringTag]}(t)}class h{}export function observable(t){return class extends(t??h){__isObservable=!0;_subscribedPaths=new Map;_onWatchPaths=new Map;_esriProps=new Map;constructor(...t){return super(...t),function(t){return new Proxy(t,{get:(t,e,r)=>{if("_esriProps"===e)return Reflect.get(t,e,r);const o=Reflect.get(t,e,r);let s=t._esriProps.get(e);return null==s&&(s=new w(e.toString(),o),t._esriProps.set(e,s)),n(s),o},set:(t,e,r,n)=>{if(Reflect.set(t,e,r,n),"_esriProps"===e)return!0;const o=t._esriProps.get(e);if(o){if(!o.invalidated&&r===o.currentValue)return!0;o.invalidate(),o.currentValue=r,o.commit()}return!0}})}(this)}_onWatch(t,e){let r,n;"string"==typeof t?(r=t,n=e):n=t;let o=this._onWatchPaths.get(r);if(null==o&&(o=[],this._onWatchPaths.set(r,o)),o.push(n),null!=r&&this._subscribedPaths.has(r)){this._subscribedPaths.get(r).onWatchHandles.set(n,n())}else if(null==r&&this._subscribedPaths.size>0)for(const[t,e]of this._subscribedPaths){const r=n(t);e.onWatchHandles.set(n,r)}const s=new WeakRef(this);return{remove:()=>{const t=s.deref();if(null==t)return;if(!t._onWatchPaths.has(r))return;const e=t._onWatchPaths.get(r),o=e.indexOf(n);if(-1!==o&&e.splice(o,1),null!=r&&t._subscribedPaths.has(r)){const e=t._subscribedPaths.get(r),o=e.onWatchHandles.get(n);null!=o&&(o.remove(),e.onWatchHandles.delete(n))}else if(null==r&&t._subscribedPaths.size>0)for(const[,e]of t._subscribedPaths){const t=e.onWatchHandles.get(n);null!=t&&(t.remove(),e.onWatchHandles.delete(n))}0===e.length&&t._onWatchPaths.delete(r)}}}_notifyChange(t){let e;e=null==t?this._subscribedPaths.keys():[t];for(const t of e){if(this._esriProps.has(t)){const e=this._esriProps.get(t),r=this[t];r!==e.currentValue&&(e.invalidate(),e.currentValue=r,e.commit())}const e=this._subscribedPaths.get(t);if(null==e)continue;const r=e.currentValue,n=this[t];if(Object.is(n,r))continue;e.currentValue=n;const o=[...e.callbacks];for(const t of o)t(n,r,this)}}_watch(t,e,r){const n=[];if(t.includes(".")){if(t.includes("[]"))return this._recurseCollectionWatch(t,e,r);const o=t.split("."),s=o.shift(),i=new AbortController,{signal:c}=i,a=new WeakRef(this);let l;const u=v(e,t),h=()=>{if(c.aborted)return void(l=void 0);const t=a.deref();if(null==t){for(const t of n)t.remove();return n.length=0,void(l=void 0)}let e=t[s],r=t;for(let t=0;t<o.length;t++)if(r=e,e=e?.[o[t]],null==e){t<o.length-1&&(r=void 0);break}if(e!==l){const t=l;l=e,u(e,t,r)}},f=r?.sync?v(h,t):_(h,t,c);let b,p,w;if([l,w,b,p]=this._recurseWatch(t,f),n.push(g(b,p)),r?.initial){(r?.sync?v(e,t):_(e,t,c))(l,l,w)}return d(n,i)}return this._watchSingle(t,e,r)}_recurseWatch(t,e){const r=t.split("."),n=r.shift(),o=[];let a,l;if(r.length>0){const t=this[n];if(s(t)){const[n,s,c,u]=i(t)._recurseWatch(r.join("."),e);o.push(g(c,u)),a=n,l=s}else if(c(t)){const[n,s,i]=f(t,r,e,{sync:!0});o.push(i),a=n,l=s}}const u=this._watchSingle(n,((t,n)=>{if(t!==n){if(r.length>0){if(s(n)||c(n)){for(const t of o)t.remove();o.length=0}if(s(t)){const[,,n,s]=i(t)._recurseWatch(r.join("."),e);o.push(g(n,s))}else if(c(t)){const[,,n]=f(t,r,e,{sync:!0});o.push(n)}}e()}}),{sync:!0});return[r.length>0?a:this._subscribedPaths.get(n)?.currentValue,r.length>0?l:this,o,u]}_recurseCollectionWatch(t,e,r){const n=t.split("."),o=n.shift();if("[]"===n[0])return this._collectionWatch(o,n,e,r);{const t=[],a=this._watchSingle(o,(o=>{for(const e of t)e.remove();t.length=0,s(o)?t.push(i(o)._recurseCollectionWatch(n.join("."),e,r)):c(o)&&t.push(f(o,n,e,r)[2])})),l=this[o];return s(l)?t.push(i(l)._recurseCollectionWatch(n.join("."),e,r)):c(l)&&t.push(f(l,n,e,r)[2]),g(t,a)}}_collectionWatch(t,e,r,n){const o=[];u(this[t])&&o.push(b(this[t],e.join("."),r,n));const s=this._watchSingle(t,((t,s)=>{if(u(s)){for(const t of o)t.remove();o.length=0}u(t)&&o.push(b(t,e.join("."),r,n))}),{sync:!0});return g(o,s)}_watchSingle(t,e,r){let n=this._subscribedPaths.get(t)?.callbacks;if(null==n){let e=Object.getOwnPropertyDescriptor(this,t),r=this;for(;null==e&&(r=Object.getPrototypeOf(r),null!=r);)e=Object.getOwnPropertyDescriptor(r,t);if(null==e)return console.warn(`[observableUtils]: The property ${t.toString()} you are trying to watch does not exist on the object and will not be watched. This is likely a coding error. Please check the property name and ensure it exists on the object. In the future this will throw an exception.`),{remove:()=>{}};if(!1===e.configurable)return console.warn(`[observableUtils]: Property "${t.toString()}" is not configurable so it cannot be watched. In the future this will throw an exception.`),{remove:()=>{}};n=[];const o=new Map;if(this._subscribedPaths.set(t,{callbacks:n,currentValue:this[t],onWatchHandles:o}),!0!==e.writable&&null==e.set||(this._subscribedPaths.get(t).originalDescriptor=e,null!=e.value&&(e.value=void 0),this._createWatchDescriptor(t,e)),this._onWatchPaths.has(t))for(const e of this._onWatchPaths.get(t))o.set(e,e());if(this._onWatchPaths.has(void 0))for(const e of this._onWatchPaths.get(void 0))o.set(e,e(t))}const o=new AbortController,s=v(e,t.toString()),{currentValue:i}=this._subscribedPaths.get(t);let c=i;const a=(t,e,r)=>{const n=c;c=t,s(t,n,r)},l=r?.sync?v(a,t.toString()):_(a,t.toString(),o.signal);return n.push(l),r?.initial&&l(i,i,this),this._createSingleWatchRemoveHandle(t,l,o)}_createWatchDescriptor(t,e){const r={configurable:!0,enumerable:e.enumerable};null==e.get?(r.get=()=>this._subscribedPaths.get(t).currentValue,r.set=e=>{const r=this._subscribedPaths.get(t),n=r.currentValue;if(Object.is(n,e))return;r.currentValue=e;const o=[...r.callbacks];for(const t of o)t(e,n,this)}):(r.get=e.get,r.set=r=>{const n=this._subscribedPaths.get(t),o=n.currentValue;if(Object.is(o,r))return void e.set.call(this,r);n.currentValue=r,e.set.call(this,r);const s=[...n.callbacks];for(const t of s)t(r,o,this)}),Object.defineProperty(this,t,r)}_createSingleWatchRemoveHandle(t,e,r){const n=new WeakRef(this);return{remove:()=>{r.abort();const o=n.deref();if(null==o)return;if(!o._subscribedPaths.has(t))return;const{callbacks:s}=o._subscribedPaths.get(t),i=s.indexOf(e);if(i>=0&&s.splice(i,1),0===s.length){const e=o._subscribedPaths.get(t);o._subscribedPaths.delete(t);for(const t of e.onWatchHandles.values())t.remove();null!=e.originalDescriptor&&(null==e.originalDescriptor.get&&(e.originalDescriptor.value=e.currentValue),Object.defineProperty(o,t,e.originalDescriptor))}}}}}}export function watch(t,e,r,n){if(!s(t)&&c(t))return f(t,e.split("."),r,n)[2];const o=i(t);if(null==o)throw new Error("Object is not observable");if(n?.once){let t;const s=new AbortController,{signal:i}=s,c=n?.sync?v(r,e):_(r,e,i);let a=!1;const l=(e,r,n)=>{i.aborted||(a=!0,t?.remove(),t=void 0,c(e,r,n))};t=o._watch(e,l,{...n,sync:!0});const u=d([t],s);return a&&u.remove(),u}return o._watch(e,r,n)}export function watchEach(t,e,r,n){if(u(t)&&e.startsWith("[]."))return b(t,e,r,n);if(!s(t)&&c(t))return f(t,e.split("."),r,n)[2];const o=i(t);if(null==o)throw new Error("Object is not observable");return o._watch(e,r,n)}export async function once(t,e,r){const{signal:n}=r??{};return new Promise(((r,o)=>{if(n?.aborted)return void o();const s=()=>{i.remove(),o()},i=watch(t,e,(()=>{n?.removeEventListener("abort",s),r()}),{once:!0});n?.addEventListener("abort",s)}))}export function notifyChange(t,e){const r=i(t);if(null==r)throw new Error("Object is not observable");if(null!=e&&"string"!=typeof e)throw new Error("Path must be a string");r._notifyChange(e)}export function onWatch(t,e,r){const n=i(t);if(null==n)throw new Error("Object is not observable");if("string"==typeof e)return n._onWatch(e,r);if("function"!=typeof e)throw new Error("Path must be a string or a function");return n._onWatch(e)}export function watchEvent(t,e,r,n){const o=r[0],s=r[1],i=new WeakMap,c=new Set;let a;return a=watch(t,e,((t,e)=>{if(null!=e&&i.has(e)){const t=i.get(e);t.remove(),i.delete(e),c.delete(t)}if(null!=t&&!i.has(t)){const e=t.on(o,s);i.set(t,e),c.add(e)}t!==e&&n?.(t,e)}),{sync:!0,initial:!0}),g(c,a)}export function when(t,e,r,n){const{invert:o=!1,once:s,...i}=n??{};let c;const a=v(r,e);let l=!1;return c=watch(t,e,(t=>{!t===o&&(a(),s&&(l=!0,c?.remove(),c=void 0))}),{...i,initial:!0}),s&&l&&c?.remove(),c}export function whenOnce(t,e,r){const{signal:n,invert:o=!1}=r??{};return new Promise(((r,s)=>{if(n?.aborted)return void s();const i=()=>{n?.removeEventListener("abort",i),c.remove(),s()},c=when(t,e,(()=>{n?.aborted||(n?.removeEventListener("abort",i),r())}),{invert:o,once:!0});n?.addEventListener("abort",i)}))}export function createIHandle(t){return{remove:()=>{for(const e of t)e.remove()}}}function f(t,e,r,n){const s=e.indexOf("[]");if(-1!==s){const o=e.slice(0,s),i=e.slice(s),c=[],[a,l,h]=f(t,o,((t,e)=>{if(u(e)){for(const t of c)t.remove();c.length=0}u(t)&&c.push(b(t,i.join("."),r,n))}),{sync:!0});return u(a)&&c.push(b(a,i.join("."),r,n)),[a,l,g(c,h)]}return function(t,e,r,n){const s=new WeakRef(t);let i;const c=()=>{let t=s.deref();if(null==t)return i?.remove(),[void 0,void 0];let r=t;for(let n=0;n<e.length;n++)if(t=r,r=t[e[n]],null==r){n<e.length-1&&(t=void 0);break}return[r,t]},a=new AbortController,{signal:l}=a,u=n?.initial&&!1===n?.sync?_(r,e.join("."),l):v(r,e.join(".")),h=function(t){const e=(e,r)=>{Object.is(e[0],r?.[0])||t(e[0],r?.[0],e[1])};return e}(u),[f,b]=c();return n?.initial&&n?.once?(u(f,f,b),[f,b,d([],a)]):(i=o(c,h,{...n,initial:!1}),n?.initial&&u(f,f,b),[f,b,d([i],a)])}(t,e,r,n)}function b(t,e,r,n){const o=new WeakMap,i=new Set,u=e.slice(3),h=t=>{if(!s(t)&&!c(t)||o.has(t))return;if(!(u.split(".")[0]in t))return;const e=watch(t,u,r,n);o.set(t,e),i.add(e)};i.add(t.on("after-add",(t=>{let e=t.item;"target"in t&&l(t.target)&&(e=t.item[1]),h(e)}))),i.add(t.on("after-remove",(t=>{let e=t.item;if("target"in t&&l(t.target)&&(e=t.item[1]),!s(e)&&!c(e))return;const r=o.get(e);null!=r&&(r.remove(),o.delete(e),i.delete(r))})));for(const e of a(t)?t:t.values())h(e);return g(i)}function d(t,e){return{remove:()=>{e?.abort();for(const e of t)e.remove()}}}function g(t,...e){return{remove:()=>{for(const e of t)e.remove();for(const t of e)t.remove()}}}const p="[observableUtils]: Error thrown by watch callback. Thrown errors from watch callbacks should be avoided where possible, they affect the performance of the entire watch system. Watch property:";function v(t,e){return(...r)=>{try{const n=t(...r);"object"==typeof n&&n instanceof Promise&&n.catch((t=>{console.error(`${p} ${e}`,t)}))}catch(t){console.error(`${p} ${e}`,t)}}}function _(t,e,r){const n=v(t,e);let o=new AbortController;return(...t)=>{o.abort(),o=new AbortController;const{signal:e}=o;queueMicrotask((()=>{r.aborted||e.aborted||n(...t)}))}}class w extends r{invalidated=!0;_currentValue;get currentValue(){return this._currentValue}set currentValue(t){this._currentValue=t,this.invalidated=!1}constructor(t,e){super(t,{}),this._currentValue=e}onInvalidated(){this.invalidated=!0,super.onInvalidated()}}
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 = "50.0.1";
4
+ export declare const version = "50.0.2";
package/version.js CHANGED
@@ -1 +1 @@
1
- export const version="50.0.1";
1
+ export const version="50.0.2";