@arcgis/core 4.25.0-next.20220708 → 4.25.0-next.20220711
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/40d9c753be00b81d9e79.js +1 -0
- package/assets/esri/core/workers/chunks/{8cdeccb6b67098d6a8d7.js → 54b01d2a4aba08d7e16b.js} +1 -1
- package/assets/esri/core/workers/chunks/5db5afec37f69c4acaaf.js +1 -0
- package/assets/esri/core/workers/chunks/63922dadaa642a959164.js +1 -0
- package/assets/esri/core/workers/chunks/{35d46e4eeb43c256a63b.js → 8d6fb50fff035f21878b.js} +1 -1
- package/assets/esri/core/workers/chunks/937eed1e51055f730270.js +1 -0
- package/assets/esri/core/workers/chunks/9b802fcf571c91347da4.js +1 -0
- package/assets/esri/core/workers/chunks/b02a43cf767d8ee13313.js +1 -0
- package/assets/esri/core/workers/chunks/ba6c6957830b3f0c4ec8.js +1 -0
- package/assets/esri/core/workers/chunks/fc6423ca92289c739e19.js +1 -0
- package/interfaces.d.ts +8395 -6016
- package/layers/BaseElevationLayer.js +1 -1
- package/layers/BaseTileLayer.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/ExportImageServiceParameters.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/TileKey.js +5 -0
- package/layers/support/TilemapCache.js +1 -1
- package/package.json +1 -1
- package/renderers/DotDensityRenderer.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
- package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Spinner.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/Widget.js +1 -1
- package/assets/esri/core/workers/chunks/009386ed70740f87a014.js +0 -1
- package/assets/esri/core/workers/chunks/1970d7a65832b70f7f5c.js +0 -1
- package/assets/esri/core/workers/chunks/4a364bc073fdc7c1b563.js +0 -1
- package/assets/esri/core/workers/chunks/4ca6ada7a4ccde5b5a24.js +0 -1
- package/assets/esri/core/workers/chunks/95451d6405729a9f50c7.js +0 -1
- package/assets/esri/core/workers/chunks/a9a459639c82c35ada1f.js +0 -1
- package/assets/esri/core/workers/chunks/beead2b06c994b4e61af.js +0 -1
- package/assets/esri/core/workers/chunks/ecaf8f030026e41e1d1a.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1761],{41993:e=>{function t(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=()=>[],t.resolve=t,t.id=41993,e.exports=t},99880:(e,t,r)=>{"use strict";r.d(t,{V:()=>l});var s=r(68773),i=(r(3172),r(20102)),n=r(92604),o=r(17452);const a=n.Z.getLogger("esri.assets");function l(e){if(!s.Z.assetsPath)throw a.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new i.Z("assets:path-not-set","config.assetsPath is not set");return(0,o.v_)(s.Z.assetsPath,e)}},32448:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var s=r(43697),i=r(15923),n=r(50758),o=r(52011);class a{constructor(){this._emitter=new a.EventEmitter(this)}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}}!function(e){class t{constructor(e=null){this._target=e,this._listenersMap=null}clear(){this._listenersMap&&this._listenersMap.clear(),this._listenersMap=null}emit(e,t){const r=this._listenersMap&&this._listenersMap.get(e);if(!r)return!1;const s=this._target||this;return[...r].forEach((e=>{e.call(s,t)})),r.length>0}on(e,t){if(Array.isArray(e)){const r=e.map((e=>this.on(e,t)));return(0,n.AL)(r)}if(e.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap||(this._listenersMap=new Map);const r=this._listenersMap.get(e)||[];return r.push(t),this._listenersMap.set(e,r),{remove:()=>{const r=this._listenersMap&&this._listenersMap.get(e)||[],s=r.indexOf(t);s>=0&&r.splice(s,1)}}}once(e,t){const r=this.on(e,(e=>{r.remove(),t.call(null,e)}));return r}hasEventListener(e){const t=this._listenersMap&&this._listenersMap.get(e);return null!=t&&t.length>0}}e.EventEmitter=t,e.EventedMixin=e=>{let r=class extends e{constructor(){super(...arguments),this._emitter=new t}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};return r=(0,s._)([(0,o.j)("esri.core.Evented")],r),r};let r=class extends i.Z{constructor(){super(...arguments),this._emitter=new a.EventEmitter(this)}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};r=(0,s._)([(0,o.j)("esri.core.Evented")],r),e.EventedAccessor=r}(a||(a={}));const l=a},609:(e,t,r)=>{"use strict";r.d(t,{D:()=>u,v:()=>c});var s,i,n=r(43697),o=r(15923),a=r(70586),l=r(95330),h=r(52011);(i=s||(s={}))[i.PENDING=0]="PENDING",i[i.RESOLVED=1]="RESOLVED",i[i.REJECTED=2]="REJECTED";class d{constructor(e){this.instance=e,this._resolver=(0,l.dD)(),this._status=s.PENDING,this._resolvingPromises=[],this._resolver.promise.then((()=>{this._status=s.RESOLVED,this._cleanUp()}),(()=>{this._status=s.REJECTED,this._cleanUp()}))}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return this._status===s.RESOLVED}isRejected(){return this._status===s.REJECTED}isFulfilled(){return this._status!==s.PENDING}abort(){this._resolver.reject((0,l.zE)())}when(e,t){return this._resolver.promise.then(e,t)}_cleanUp(){this._allPromise=this._resolvingPromises=this._allPromise=null}_tryResolve(){if(this.isFulfilled())return;const e=(0,l.dD)(),t=[...this._resolvingPromises,(0,a.j0)(e.promise)],r=this._allPromise=Promise.all(t);r.then((()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve(this.instance)}),(e=>{this.isFulfilled()||this._allPromise!==r||(0,l.D_)(e)||this._resolver.reject(e)})),e.resolve()}}const c=e=>{let t=class extends e{constructor(...e){super(...e),this._promiseProps=new d(this),this.addResolvingPromise(Promise.resolve())}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(e,t){return new Promise(((e,t)=>{this._promiseProps.when(e,t)})).then(e,t)}catch(e){return this.when(null,e)}addResolvingPromise(e){e&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in e?e.when():e)}};return t=(0,n._)([(0,h.j)("esri.core.Promise")],t),t};let u=class extends(c(o.Z)){};u=(0,n._)([(0,h.j)("esri.core.Promise")],u)},17445:(e,t,r)=>{"use strict";r.d(t,{N1:()=>u,YP:()=>l,Z_:()=>f,gx:()=>h,nn:()=>g,on:()=>c,tX:()=>_});var s=r(91460),i=r(50758),n=r(70586),o=r(95330),a=r(26258);function l(e,t,r={}){return d(e,t,r,p)}function h(e,t,r={}){return d(e,t,r,m)}function d(e,t,r={},s){let i=null;const o=r.once?(e,r)=>{s(e)&&((0,n.hw)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,a.aQ)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return i}function c(e,t,r,o={}){let a=null,h=null,d=null;function c(){a&&h&&(h.remove(),o.onListenerRemove?.(a),a=null,h=null)}function u(e){o.once&&o.once&&(0,n.hw)(d),r(e)}const p=l(e,((e,r)=>{c(),(0,s.vT)(e)&&(a=e,h=(0,s.on)(e,t,u),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return d=(0,i.kB)((()=>{p.remove(),c()})),d}function u(e,t){return function(e,t,r){if((0,o.Hc)(r))return Promise.reject((0,o.zE)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,n.hw)(a)}return new Promise(((s,n)=>{a=(0,i.AL)([(0,o.fu)(r,(()=>{l(),n((0,o.zE)())})),d(e,(e=>{l(),s(e)}),{sync:!1,once:!0},t??p)])}))}(e,m,t)}function p(e){return!0}function m(e){return!!e}r(87538);const f={sync:!0},g={initial:!0},_={sync:!0,initial:!0}},41123:(e,t,r)=>{"use strict";r.d(t,{D:()=>i});const s="randomUUID"in crypto;function i(){if(s)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16);return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}},55142:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ut});var s=r(40330),i=r(43697),n=r(68773),o=r(3172),a=r(20102),l=r(32448),h=r(91460),d=r(22974),c=r(78286),u=r(95330),p=r(17445),m=r(17452),f=r(5600),g=(r(75215),r(52011)),_=(r(67676),r(80442),r(940));r(2587),(()=>{if("function"==typeof Element.prototype.closest)return(e,t)=>e.closest(t);Element.prototype.matches||Element.prototype.msMatchesSelector})();var v=r(61247),y=r(92604),w=r(70586),S=r(609),I=r(41123),k=r(90578),b=r(58971),A=r(38805),T=r(8728),U=r(3894),C=r(50758);const x=new Map;function P(){x.clear()}function R(e){x.delete(e)}y.Z.getLogger("esri.widgets.support.widgetUtils");function O(e){const t=U.Z.acquire();for(let e=0;e<arguments.length;e++){const r=arguments[e],s=typeof r;if("string"===s)t.push(r);else if(Array.isArray(r))t.push.apply(t,r);else if("object"===s)for(const e in r)r[e]&&t.push(e)}const r=t.join(" ");return U.Z.release(t),r}function D(e){this[e.getAttribute("data-node-ref")]=e}(()=>{const e=new Map;new ResizeObserver((t=>{P();for(const r of t)e.get(r.target)?.(r)}))})();const E=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce(((e,t)=>(e[t]=[],e)),{}),N=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],L=new T.Z({whiteList:E,onTagAttr:(e,t,r)=>{const s=`${t}="${r}"`;if(N.includes(t))return s},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),j="http://www.w3.org/",M=`${j}2000/svg`,q=`${j}1999/xlink`;let F,V=[],$=(e,t)=>{let r={};return Object.keys(e).forEach((t=>{r[t]=e[t]})),t&&Object.keys(t).forEach((e=>{r[e]=t[e]})),r},B=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),z=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},Z=(e,t,r)=>{if(""!==t.vnodeSelector)for(let s=r;s<e.length;s++)if(B(e[s],t))return s;return-1},H=(e,t,r,s)=>{let i=e[t];if(""===i.vnodeSelector)return;let n=i.properties;if(!(n?void 0===n.key?n.bind:n.key:void 0))for(let n=0;n<e.length;n++)if(n!==t){let t=e[n];if(B(t,i))throw new Error(`${r.vnodeSelector} had a ${i.vnodeSelector} child ${"added"===s?s:"removed"}, but there is now more than one. You must add unique key properties to make them distinguishable.`)}},J=e=>{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},W=[],Y=!1,G=e=>{(e.children||[]).forEach(G),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},K=()=>{Y=!1,W.forEach(G),W.length=0},X=e=>{W.push(e),Y||(Y=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(K,{timeout:16}):setTimeout(K,16))},Q=e=>{let t=e.domNode;if(e.properties){let r=e.properties.exitAnimation;if(r){t.style.pointerEvents="none";let s=()=>{t.parentNode&&(t.parentNode.removeChild(t),X(e))};return void r(t,s,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),X(e))},ee=(e,t,r)=>{if(!t)return;let s=r.eventHandlerInterceptor,i=Object.keys(t),n=i.length;for(let o=0;o<n;o++){let n=i[o],a=t[n];if("className"===n)throw new Error('Property "className" is not supported, use "class".');if("class"===n)se(e,a,!0);else if("classes"===n){let t=Object.keys(a),r=t.length;for(let s=0;s<r;s++){let r=t[s];a[r]&&e.classList.add(r)}}else if("styles"===n){let t=Object.keys(a),s=t.length;for(let i=0;i<s;i++){let s=t[i],n=a[s];n&&(z(n),r.styleApplyer(e,s,n))}}else if("key"!==n&&null!=a){let i=typeof a;"function"===i?(0===n.lastIndexOf("on",0)&&(s&&(a=s(n,a,e,t)),"oninput"===n&&function(){let e=a;a=function(t){e.apply(this,[t]),t.target["oninput-value"]=t.target.value}}()),e[n]=a):r.namespace===M?"href"===n?e.setAttributeNS(q,n,a):e.setAttribute(n,a):"string"===i&&"value"!==n?"innerHTML"===n?e[n]=L.sanitize(a):e.setAttribute(n,a):e[n]=a}}},te=(e,t,r)=>{((e,t,r)=>{if(t)for(let s of t)re(s,e,void 0,r)})(e,t.children,r),t.text&&(e.textContent=t.text),ee(e,t.properties,r),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,r,t.vnodeSelector,t.properties,t.children])},re=(e,t,r,s)=>{let i,n=0,o=e.vnodeSelector,a=t.ownerDocument;if(""===o)i=e.domNode=a.createTextNode(e.text),void 0!==r?t.insertBefore(i,r):t.appendChild(i);else{for(let l=0;l<=o.length;++l){let h=o.charAt(l);if(l===o.length||"."===h||"#"===h){let h=o.charAt(n-1),d=o.slice(n,l);"."===h?i.classList.add(d):"#"===h?i.id=d:("svg"===d&&(s=$(s,{namespace:M})),void 0!==s.namespace?i=e.domNode=a.createElementNS(s.namespace,d):(i=e.domNode=e.domNode||a.createElement(d),"input"===d&&e.properties&&void 0!==e.properties.type&&i.setAttribute("type",e.properties.type)),void 0!==r?t.insertBefore(i,r):i.parentNode!==t&&t.appendChild(i)),n=l+1}}te(i,e,s)}},se=(e,t,r)=>{t&&t.split(" ").forEach((t=>{t&&e.classList.toggle(t,r)}))};F=(e,t,r)=>{let s=e.domNode,i=!1;if(e===t)return!1;let n=!1;if(""===t.vnodeSelector){if(t.text!==e.text){let e=s.ownerDocument.createTextNode(t.text);return s.parentNode.replaceChild(e,s),t.domNode=e,i=!0,i}t.domNode=s}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(r=$(r,{namespace:M})),e.text!==t.text&&(n=!0,void 0===t.text?s.removeChild(s.firstChild):s.textContent=t.text),t.domNode=s,n=((e,t,r,s,i)=>{if(r===s)return!1;s=s||V;let n,o=(r=r||V).length,a=s.length,l=0,h=0,d=!1;for(;h<a;){let a=l<o?r[l]:void 0,c=s[h];if(void 0!==a&&B(a,c))d=F(a,c,i)||d,l++;else{let a=Z(r,c,l+1);if(a>=0){for(n=l;n<a;n++)Q(r[n]),H(r,n,e,"removed");d=F(r[a],c,i)||d,l=a+1}else re(c,t,l<o?r[l].domNode:void 0,i),J(c),H(s,h,e,"added")}h++}if(o>l)for(n=l;n<o;n++)Q(r[n]),H(r,n,e,"removed");return d})(t,s,e.children,t.children,r)||n,n=((e,t,r,s)=>{if(!r)return;let i=!1,n=Object.keys(r),o=n.length;for(let a=0;a<o;a++){let o=n[a],l=r[o],h=t[o];if("class"===o)h!==l&&(se(e,h,!1),se(e,l,!0));else if("classes"===o){let t=e.classList,r=Object.keys(l),s=r.length;for(let e=0;e<s;e++){let s=r[e],n=!!l[s];n!==!!h[s]&&(i=!0,n?t.add(s):t.remove(s))}}else if("styles"===o){let t=Object.keys(l),r=t.length;for(let n=0;n<r;n++){let r=t[n],o=l[r];o!==h[r]&&(i=!0,o?(z(o),s.styleApplyer(e,r,o)):s.styleApplyer(e,r,""))}}else if(l||"string"!=typeof h||(l=""),"value"===o){let t=e[o];t!==l&&(e["oninput-value"]?t===e["oninput-value"]:l!==h)&&(e[o]=l,e["oninput-value"]=void 0),l!==h&&(i=!0)}else if(l!==h){let t=typeof l;"function"===t&&s.eventHandlerInterceptor||(s.namespace===M?"href"===o?e.setAttributeNS(q,o,l):e.setAttribute(o,l):"string"===t?"innerHTML"===o?e[o]=L.sanitize(l):"role"===o&&""===l?e.removeAttribute(o):e.setAttribute(o,l):e[o]!==l&&(e[o]=l),i=!0)}}return i})(s,e.properties,t.properties,r)||n,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[s,r,t.vnodeSelector,t.properties,t.children]);return n&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(s,t.properties,e.properties),i};let ie=(e,t)=>({getLastRender:()=>e,update:r=>{if(e.vnodeSelector!==r.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let s=e;e=r,F(s,r,t)},domNode:e.domNode});const ne={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}};let oe,ae=e=>$(ne,e),le=(e,t,r)=>(r=ae(r),re(t,e,void 0,r),ie(t,r)),he=(e,t,r)=>(r=ae(r),re(t,e.parentNode,e,r),ie(t,r)),de=(e,t,r)=>(r=ae(r),t.domNode=e,te(e,t,r),ie(t,r)),ce=(e,t,r)=>(r=ae(r),re(t,e.parentNode,e,r),e.parentNode.removeChild(e),ie(t,r));oe=Array.prototype.find?(e,t)=>e.find(t):(e,t)=>e.filter(t)[0];const ue={handleInterceptedEvent:(e,t,r,s)=>(e.scheduleRender(),t.properties[`on${s.type}`].apply(t.properties.bind||r,[s]))},pe={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{e.style[t]=r}},me=(e,t,r=!1)=>{let s=e;return t.forEach(((e,i)=>{const n=s?.children?((e,t)=>e.find(t))(s.children,(t=>t.domNode===e)):void 0;r&&!n&&i!==t.length-1||(s=n)})),s};var fe=r(77210),ge=r(99880);let _e;_e="components/assets";const ve=Symbol("widget"),ye=[],we={},Se=new WeakMap;function Ie(e,t){let r=t.children;if(r&&r.length)for(let t=0;t<r.length;++t)r[t]=Ie(e,r[t]);else r=ye;const s=t.vnodeSelector;if(Te(s)){const i=t.properties||we,n=i.key||s;return{vnodeSelector:"div",properties:{key:n,afterCreate:ke,afterUpdate:be,afterRemoved:Ae,parentWidget:e,widgetConstructor:s,widgetProperties:{...i,key:n,children:r}},children:void 0,text:void 0,domNode:null}}return t}function ke(e,t,r,{parentWidget:s,widgetConstructor:i,widgetProperties:n}){const o=new i(n);o.container=e,Se.set(e,o),o.afterCreate?.(o,e),s._internalHandles.add((0,C.kB)((()=>Ae(e))))}function be(e,t,r,{widgetProperties:s}){const i=Se.get(e);i&&(i.set(s),i.afterUpdate?.(i,e))}function Ae(e){const t=Se.get(e);t&&(t.destroy(),Se.delete(e))}function Te(e){return"function"==typeof e&&e[ve]}const Ue=new Set;var Ce=r(70171),xe=r(94443);let Pe=0;function Re(e,t){for(const r in t)null!=e[r]&&("object"==typeof e[r]&&"object"==typeof t[r]?Re(e[r],t?.[r]):e[r]=t[r]);return e}const Oe=(e=>{let t;const r={...ue,...e},s=(n=r,{...pe,...n}),i=s.performanceLogger;var n;let o,a=!0,l=!1;const h=[],d=[],c=(e,n,o)=>{let a;s.eventHandlerInterceptor=(e,s,n,o)=>function(e){let s;i("domEvent",e);const n=((e,t)=>{const r=[];for(;e&&e!==t;)r.push(e),e=e.parentNode;return r})(e.currentTarget,a.domNode),o=n.some((e=>customElements.get(e?.tagName?.toLowerCase())));if(e.eventPhase!==Event.CAPTURING_PHASE&&o){const t=e.composedPath(),r=t.slice(t.indexOf(e.currentTarget),t.indexOf(a.domNode)).filter((e=>e.getRootNode()===e.ownerDocument)).reverse();s=me(a.getLastRender(),r,!0)}else n.reverse(),s=me(a.getLastRender(),n);let l;return s&&(l=r.handleInterceptedEvent(t,s,this,e)),i("domEventProcessed",e),l},r.postProcessProjectionOptions?.(s);const l=o();a=e(n,l,s),h.push(a),d.push(o),r.afterFirstVNodeRendered&&r.afterFirstVNodeRendered(a,l)};let u=()=>{if(o=void 0,a){a=!1,i("renderStart",void 0);for(let e=0;e<h.length;e++){const t=d[e]();i("rendered",void 0),h[e].update(t),i("patched",void 0)}i("renderDone",void 0),a=!0}};return r.modifyDoRenderImplementation&&(u=r.modifyDoRenderImplementation(u,h,d)),t={renderNow:u,scheduleRender:()=>{o||l||(o=requestAnimationFrame(u))},stop:()=>{o&&(cancelAnimationFrame(o),o=void 0),l=!0},resume:()=>{l=!1,a=!0,t.scheduleRender()},append:(e,t)=>{c(le,e,t)},insertBefore:(e,t)=>{c(he,e,t)},merge:(e,t)=>{c(de,e,t)},replace:(e,t)=>{c(ce,e,t)},detach:e=>{for(let t=0;t<d.length;t++)if(d[t]===e)return d.splice(t,1),h.splice(t,1)[0];throw new Error("renderFunction was not found")}},t})({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,s,i,n)=>{const o=t?.(e,s,i,n),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in i)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>o?.call(i,e);i.addEventListener(t,r,a);const s=()=>i.removeEventListener(t,r,a),l=n.afterRemoved;n.afterRemoved=e=>{l?.(e),s()}}return o}},handleInterceptedEvent(e,t,r,s){const{eventPhase:i,type:n}=s,o=i===Event.CAPTURING_PHASE;let a=`on${n}${o?"capture":""}`;const l=t.properties;(l&&a in l||(a=`on${n[0].toUpperCase()}${n.slice(1)}${o?"Capture":""}`,l&&a in l))&&(P(),e.scheduleRender(),l[a].call(l.bind||r,s))}});let De=!1,Ee=class extends((0,S.v)(l.Z.EventedAccessor)){constructor(e,t){super(e,t),this._attached=!1,this._internalHandles=new v.Z,this._projector=Oe,this._readyForTrueRender=!1,this.domNode=null,this.iconClass="esri-icon-checkbox-unchecked",this.label=this.declaredClass.split(".").pop(),this.key=this,this._loadLocale=(0,u.Ds)((async()=>{if(this._messageBundleProps&&this._messageBundleProps.length){const e=await(0,u.as)(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{let r=await(0,xe.ME)(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=Re((0,d.d9)(r),this.uiStrings)),this[t]=r})));for(const t of e)t.error&&y.Z.getLogger(this.declaredClass).error("widget-intl:locale-error",this.declaredClass,t.error)}await this.loadLocale()})),(0,fe.YY)((0,m.hF)((0,ge.V)("components/assets")));const r="esri-widget-uid-"+(0,I.D)(),s=this.render.bind(this);this._trackingTarget=new A.M((()=>this.scheduleRender()));const i=()=>{if(!this._readyForTrueRender||this.destroyed)return null;if(!this.visible)return{vnodeSelector:"div",properties:{key:r,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0};const e=s();let{properties:t}=e;t||(e.properties=t={});let{key:i,styles:n}=t;i||(t.key=r),n||(t.styles=n={}),n.display||(n.display="");let o=0;return e.children?.forEach((e=>{if(Te(e.vnodeSelector))return;let{properties:t}=e;t||(e.properties=t={}),t.key||(t.key=`${this.id}--${o++}`)})),Ie(this,e)};var n;this.render=()=>{if(De)return i();let e=function(e){return x.get(e)}(this)??null;if(e)return e;this._trackingTarget.clear(),De=!0;try{e=(0,b.LJ)(this._trackingTarget,i)}catch(e){throw console.error(e),e}finally{De=!1}return e&&function(e,t){x.set(e,t)}(this,e),e},this.addResolvingPromise(this._resourcesFetch=this.beforeFirstRender().then((()=>{this._readyForTrueRender=!0,this._postInitialize()}))),n=this._resourcesFetch,Ue.add(n),n.finally((()=>Ue.delete(n)))}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){return Promise.all([this.loadDependencies(),this._loadLocale()]).then((()=>{})).catch(u.H9)}async loadDependencies(){}async loadLocale(){}destroy(){this.destroyed||((0,w.SC)(this._trackingTarget),(0,w.SC)(this.viewModel),this._detach(this.container),this._set("container",null),this._internalHandles.destroy(),this._emitter.clear(),this.render=()=>null,this._projector=null,R(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return function(e){return"string"==typeof e?document.getElementById(e):e}(e)}get id(){return this._get("id")||this.get("container.id")||Date.now().toString(16)+"-widget-"+Pe++}set id(e){e&&this._set("id",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get test(){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(R(this),this._projector.scheduleRender())}classes(...e){return O.apply(this,e)}renderNow(){R(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this._internalHandles.add((0,p.YP)((()=>this.viewModel),((e,t)=>{t&&this._internalHandles.remove("delegated-events"),e&&(0,h.vT)(e)&&this._internalHandles.add(this._delegatedEventNames.map((t=>(0,h.on)(e,t,(e=>{this.emit(t,e)})))),"delegated-events")}),p.nn)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(u.H9),this.scheduleRender()};this._internalHandles.add([(0,Ce.qe)(e),(0,p.YP)((()=>this.uiStrings),e),(0,p.gx)((()=>this.container),(e=>{this.destroyed||this._attach(e)}),{initial:!0,once:!0})])}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){e&&this._attached&&(this._projector.detach(this.render),e.parentNode&&e.parentNode.removeChild(e),this._attached=!1)}};Ee[ve]=!0,(0,i._)([(0,f.Cb)()],Ee.prototype,"_readyForTrueRender",void 0),(0,i._)([(0,f.Cb)({value:null})],Ee.prototype,"container",null),(0,i._)([(0,k.p)("container")],Ee.prototype,"castContainer",null),(0,i._)([(0,f.Cb)({aliasOf:"container"})],Ee.prototype,"domNode",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"iconClass",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"id",null),(0,i._)([(0,f.Cb)()],Ee.prototype,"label",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"renderable",null),(0,i._)([(0,f.Cb)()],Ee.prototype,"uiStrings",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"viewModel",void 0),(0,i._)([(0,f.Cb)({value:!0})],Ee.prototype,"visible",null),(0,i._)([(0,f.Cb)()],Ee.prototype,"key",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"children",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"afterCreate",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"afterUpdate",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"afterRemoved",void 0),Ee=(0,i._)([(0,g.j)("esri.widgets.Widget")],Ee);const Ne=Ee;function Le(e){return(t,r)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:r})}}var je=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},Me=function(e,t){for(var r=0,s=e.length;r<s;r++){var i=e[r];Array.isArray(i)?Me(i,t):null!=i&&!1!==i&&(i.hasOwnProperty("vnodeSelector")||(i=je(i)),t.push(i))}};function qe(e,t,...r){return"function"!=typeof e||Te(e)?function(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(1===r.length&&"string"==typeof r[0])return{vnodeSelector:e,properties:t||void 0,children:void 0,text:r[0],domNode:null};var i=[];return Me(r,i),{vnodeSelector:e,properties:t||void 0,children:i,text:void 0,domNode:null}}(e,t,...r):e(t,...r)}const Fe="esri-identity-form__group",Ve="esri-identity-form__label",$e="esri-input",Be="esri-button";let ze=class extends Ne{constructor(e,t){super(e,t),this._usernameInputNode=null,this._passwordInputNode=null,this.signingIn=!1,this.server=null,this.resource=null,this.error=null,this.oAuthPrompt=!1}render(){const{error:e,server:t,resource:r,signingIn:s,oAuthPrompt:i,messages:n}=this,o=qe("div",{class:Fe},(0,_.n)(i?n.oAuthInfo:n.info,{server:t&&/\.arcgis\.com/i.test(t)?"ArcGIS Online":t,resource:`(${r||n.lblItem})`})),a=i?null:qe("div",{class:Fe,key:"username"},qe("label",{class:Ve},n.lblUser,qe("input",{value:"",required:!0,autocomplete:"off",spellcheck:!1,type:"text",bind:this,afterCreate:D,"data-node-ref":"_usernameInputNode",class:$e}))),l=i?null:qe("div",{class:Fe,key:"password"},qe("label",{class:Ve},n.lblPwd,qe("input",{value:"",required:!0,type:"password",bind:this,afterCreate:D,"data-node-ref":"_passwordInputNode",class:$e}))),h=qe("div",{class:this.classes(Fe,"esri-identity-form__footer")},qe("input",{type:"submit",disabled:!!s,value:s?n.lblSigning:n.lblOk,class:Be}),qe("input",{type:"button",value:n.lblCancel,bind:this,onclick:this._cancel,class:this.classes(Be,"esri-button--secondary")})),d=e?qe("div",null,e.details&&e.details.httpStatus?n.invalidUser:n.noAuthService):null;return qe("form",{class:"esri-identity-form",bind:this,onsubmit:this._submit},o,d,a,l,h)}_cancel(){this._set("signingIn",!1),this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const t=this.oAuthPrompt?{}:{username:this._usernameInputNode&&this._usernameInputNode.value,password:this._passwordInputNode&&this._passwordInputNode.value};this.emit("submit",t)}};(0,i._)([(0,f.Cb)(),Le("esri/identity/t9n/identity")],ze.prototype,"messages",void 0),(0,i._)([(0,f.Cb)()],ze.prototype,"signingIn",void 0),(0,i._)([(0,f.Cb)()],ze.prototype,"server",void 0),(0,i._)([(0,f.Cb)()],ze.prototype,"resource",void 0),(0,i._)([(0,f.Cb)()],ze.prototype,"error",void 0),(0,i._)([(0,f.Cb)()],ze.prototype,"oAuthPrompt",void 0),ze=(0,i._)([(0,g.j)("esri.identity.IdentityForm")],ze);const Ze=ze;var He=r(44291);const Je="esri-identity-modal__content";let We=class extends Ne{constructor(e,t){super(e,t),this.container=document.createElement("div"),this.content=null,this.open=!1,this._focusTrap=null,this._close=()=>{this.open=!1},document.body.appendChild(this.container),this.addHandles((0,p.YP)((()=>this.open),(()=>this._toggleFocusTrap())))}destroy(){this._destroyFocusTrap()}get title(){return this.messages?.auth.signIn}render(){const e=this.id,{open:t,content:r,title:s,messages:i}=this,n=t&&!!r,o={"esri-identity-modal--open":n,"esri-identity-modal--closed":!n},a=qe("button",{class:"esri-identity-modal__close-button","aria-label":i.close,title:i.close,bind:this,onclick:this._close,type:"button"},qe("span",{"aria-hidden":"true",class:"esri-icon-close"})),l=`${e}_title`,h=`${e}_content`,d=s?qe("h1",{id:l,class:"esri-identity-modal__title"},s):null,c=n?qe("div",{bind:this,class:"esri-identity-modal__dialog",role:"dialog","aria-labelledby":l,"aria-describedby":h,afterCreate:this._createFocusTrap},a,d,this._renderContent(h)):null;return qe("div",{tabIndex:-1,class:this.classes("esri-identity-modal",o)},c)}_destroyFocusTrap(){this._focusTrap?.deactivate({onDeactivate:()=>{}}),this._focusTrap=null}_toggleFocusTrap(){const{_focusTrap:e,open:t}=this;e&&(t?e.activate():e.deactivate())}_createFocusTrap(e){this._destroyFocusTrap();const t=requestAnimationFrame((()=>{this._focusTrap=(0,He.v)(e,{initialFocus:"input",onDeactivate:this._close}),this._toggleFocusTrap()}));this.addHandles((0,C.kB)((()=>cancelAnimationFrame(t))))}_renderContent(e){const t=this.content;return"string"==typeof t?qe("div",{class:Je,id:e,innerHTML:t}):function(e){return e&&"function"==typeof e.render}(t)?qe("div",{class:Je,id:e},t.render()):t instanceof HTMLElement?qe("div",{class:Je,id:e,bind:t,afterCreate:this._attachToNode}):null}_attachToNode(e){e.appendChild(this)}};(0,i._)([(0,f.Cb)({readOnly:!0})],We.prototype,"container",void 0),(0,i._)([(0,f.Cb)()],We.prototype,"content",void 0),(0,i._)([(0,f.Cb)()],We.prototype,"open",void 0),(0,i._)([(0,f.Cb)(),Le("esri/t9n/common")],We.prototype,"messages",void 0),(0,i._)([(0,f.Cb)()],We.prototype,"title",null),We=(0,i._)([(0,g.j)("esri.identity.IdentityModal")],We);const Ye=We,Ge="esriJSAPIOAuth";class Ke{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token))if(null==this.expires&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r||(r=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),r[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(Ge,JSON.stringify(e))}catch(e){return console.warn(e),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t&&t.appId&&t.portalUrl&&(null==this.expires||this.expires>Date.now())&&(this.refreshToken||this.token)){const e=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",r=new FormData;if(r.append("f","json"),r.append("auth_token",this.refreshToken||this.token),r.append("client_id",t.appId),r.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),"function"==typeof navigator.sendBeacon)navigator.sendBeacon(e,r);else{const t=new XMLHttpRequest;t.open("POST",e),t.send(r)}}if(t&&t.authNamespace&&t.portalUrl&&this.storage){const r=e[t.authNamespace];if(r){delete r[t.portalUrl];try{this.storage.setItem(Ge,JSON.stringify(e))}catch(e){console.log(e)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r&&(r=r[t.portalUrl],r&&(this.appId=r.appId,this.codeVerifier=r.codeVerifier,this.expires=r.expires,this.refreshToken=r.refreshToken,this.ssl=r.ssl,this.stateUID=r.stateUID,this.token=r.token,this.userId=r.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(Ge);if(t)try{e=JSON.parse(t)}catch(e){console.warn(e)}}return e}}Ke.prototype.declaredClass="esri.identity.OAuthCredential";var Xe,Qe=r(96674);let et=Xe=class extends Qe.wq{constructor(e){super(e),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return Xe.fromJSON(this.toJSON())}};(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"appId",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"authNamespace",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"expiration",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"flowType",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"forceLogin",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"forceUserId",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"locale",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"minTimeUntilExpiration",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"popup",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"popupCallbackUrl",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"popupWindowFeatures",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"portalUrl",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"preserveUrlHash",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"userId",void 0),et=Xe=(0,i._)([(0,g.j)("esri.identity.OAuthInfo")],et);const tt=et;let rt=class extends Qe.wq{constructor(e){super(e),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"adminTokenServiceUrl",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"currentVersion",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"hasPortal",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"hasServer",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"owningSystemUrl",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"owningTenant",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"server",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"shortLivedTokenValidity",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"tokenServiceUrl",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"webTierAuth",void 0),rt=(0,i._)([(0,g.j)("esri.identity.ServerInfo")],rt);const st=rt,it={},nt=e=>{const t=new m.R9(e.owningSystemUrl).host,r=new m.R9(e.server).host,s=/.+\.arcgis\.com$/i;return s.test(t)&&s.test(r)},ot=(e,t)=>!!(nt(e)&&t&&t.some((t=>t.test(e.server))));let at=null,lt=null;try{at=window.localStorage,lt=window.sessionStorage}catch{}class ht extends l.Z{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this.defaultOAuthInfo=null,this.defaultTokenValidity=60,this.dialog=null,this.formConstructor=Ze,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin="null"!==window.origin?window.origin:window.location.origin,this._appUrlObj=(0,m.mN)(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^\/]+\/[^\/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer)).*/gi,this._gwUser=/http.+\/users\/([^\/]+)\/?.*/i,this._gwItem=/http.+\/items\/([^\/]+)\/?.*/i,this._gwGroup=/http.+\/groups\/([^\/]+)\/?.*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getOAuthLocationParams(),window.addEventListener("pageshow",(e=>{this._pageShowHandler(e)}))}registerServers(e){const t=this.serverInfos;t?(e=e.filter((e=>!this.findServerInfo(e.server))),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach((e=>{e.owningSystemUrl&&this._portals.push(e.owningSystemUrl),e.hasPortal&&this._portals.push(e.server)}))}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const e=this.findOAuthInfo(r.portalUrl);e&&t.splice(t.indexOf(e),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let s,i=this.findServerInfo(t),n=!0;i||(i=new st,i.server=this._getServerInstanceRoot(t),r?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(t),i.hasPortal=!0),this.registerServers([i])),s=this._findCredential(t),s?(delete e.server,Object.assign(s,e),n=!1):(s=new dt({userId:e.userId,server:i.server,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),s.resources=[t],this.credentials.push(s)),s.emitTokenChange(!1),n||s.refreshServerTokens()}toJSON(){return(0,d.yd)({serverInfos:this.serverInfos.map((e=>e.toJSON())),oAuthInfos:this.oAuthInfos.map((e=>e.toJSON())),credentials:this.credentials.map((e=>e.toJSON()))})}initialize(e){if(!e)return;"string"==typeof e&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,s=e.credentials;if(t){const e=[];t.forEach((t=>{t.server&&t.tokenServiceUrl&&e.push(t.declaredClass?t:new st(t))})),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach((t=>{t.appId&&e.push(t.declaredClass?t:new tt(t))})),e.length&&this.registerOAuthInfos(e)}s&&s.forEach((e=>{e.server&&e.token&&e.expires&&e.expires>Date.now()&&((e=e.declaredClass?e:new dt(e)).emitTokenChange(),this.credentials.push(e))}))}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){let r;e=this._sanitizeUrl(e);const s=this._isServerRsrc(e)?"server":"portal";if(t){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&t===i.userId&&i.scope===s){r=i;break}}else for(const t of this.credentials)if(this._hasSameServerInstance(t.server,e)&&-1!==this._getIdenticalSvcIdx(e,t)&&t.scope===s){r=t;break}return r}getCredential(e,t){let r,s,i=!0;t&&(r=!!t.token,s=t.error,i=!1!==t.prompt),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,o=(0,u.hh)();if(t.signal&&(0,u.fu)(t.signal,(()=>{n.abort()})),(0,u.fu)(n,(()=>{o.reject(new a.Z("identity-manager:user-aborted","ABORTED"))})),(0,u.Hc)(n))return o.promise;t.signal=n.signal;const l=this._isAdminResource(e),h=r?this.findCredential(e):null;let d;if(h&&s&&s.details&&498===s.details.httpStatus)h.destroy();else if(h)return d=new a.Z("identity-manager:not-authorized","You are currently signed in as: '"+h.userId+"'. You do not have access to this resource: "+e,{error:s}),o.reject(d),o.promise;const c=this._findCredential(e,t);if(c)return o.resolve(c),o.promise;let p=this.findServerInfo(e);if(p)!p.hasServer&&this._isServerRsrc(e)&&(p._restInfoPms=this._getTokenSvcUrl(e),p.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return d=new a.Z("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),o.reject(d),o.promise;p=new st,p.server=this._getServerInstanceRoot(e),"string"==typeof t?(p.tokenServiceUrl=t,p.hasPortal=!0):(p._restInfoPms=t,p.hasServer=!0),this.registerServers([p])}return p.hasPortal&&void 0===p._selfReq&&(i||(0,m.D6)(p.tokenServiceUrl,this._appOrigin)||this._gwDomains.some((e=>e.tokenServiceUrl===p.tokenServiceUrl)))&&(p._selfReq={owningTenant:t&&t.owningTenant,selfDfd:this._getPortalSelf(p.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,p,t,o,l)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const s=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new m.R9(this._appOrigin),n=e.shortLivedTokenValidity;let l,h,d,c,u,p,f,g;t&&(g=this.tokenValidity||n||this.defaultTokenValidity,g>n&&n>0&&(g=n)),r&&(l=r.isAdmin,h=r.serverUrl,d=r.token,p=r.signal,f=r.ssl,e.customParameters=r.customParameters),l?c=e.adminTokenServiceUrl:(c=e.tokenServiceUrl,u=new m.R9(c.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!f&&"http"===i.scheme&&((0,m.D6)(i.uri,c,!0)||"https"===u.scheme&&i.host===u.host&&"7080"===i.port&&"7443"===u.port)&&(c=c.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const _={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:h,token:d,expiration:g,referer:l||s?this._appOrigin:null,client:l?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:p,...r?.ioArgs};return s||(_.withCredentials=!1),(0,o.default)(c,_).then((r=>{const s=r.data;if(!s||!s.token)return new a.Z("identity-manager:authentication-failed","Unable to generate token");const i=e.server;return it[i]||(it[i]={}),t&&(it[i][t.username]=t.password),s.validity=g,s}))}isBusy(){return!!this._busy}checkSignInStatus(e){return this.checkAppAccess(e,"").then((e=>e.credential))}checkAppAccess(e,t,r){let s=!1;return this.getCredential(e,{prompt:!1}).then((i=>{let n;const l={f:"json"};if("portal"===i.scope)if(t&&(this._doPortalSignIn(e)||r&&r.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",l.client_id=t;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(l.token=i.token),(0,o.default)(n,{query:l,authMode:"anonymous"}).then((e=>{if(!1===e.data.valid)throw new a.Z("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,e.data);return s=!!e.data.viewOnlyUserTypeApp,{credential:i}})).catch((e=>{if("identity-manager:not-authorized"===e.name)throw e;const t=e.details&&e.details.httpStatus;if(498===t)throw i.destroy(),new a.Z("identity-manager:not-authenticated","User is not signed in.");if(400===t)throw new a.Z("identity-manager:invalid-request");return{credential:i}}))})).then((e=>({credential:e.credential,viewOnly:s})))}setOAuthResponseHash(e){e&&("#"===e.charAt(0)&&(e=e.substring(1)),this._processOAuthPopupParams((0,m.u0)(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const s=(0,u.hh)(),i=()=>{l?.remove(),h?.remove(),d?.remove(),o?.destroy(),this.dialog?.destroy(),this.dialog=o=l=h=d=null},n=()=>{i(),this._oAuthDfd=null,s.reject(new a.Z("identity-manager:user-aborted","ABORTED"))};r.signal&&(0,u.fu)(r.signal,(()=>{n()}));let o=new this.formConstructor;o.resource=this.getResourceName(e),o.server=t.server,this.dialog=new Ye,this.dialog.content=o,this.dialog.open=!0,this.emit("dialog-create");let l=o.on("cancel",n),h=(0,p.YP)((()=>this.dialog.open),n),d=o.on("submit",(e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then((n=>{i();const o=new dt({userId:e.username,server:t.server,token:n.token,expires:null!=n.expires?Number(n.expires):null,ssl:!!n.ssl,isAdmin:r.isAdmin,validity:n.validity});s.resolve(o)})).catch((e=>{o.error=e,o.signingIn=!1}))}));return s.promise}oAuthSignIn(e,t,r,s){this._oAuthDfd=(0,u.hh)();const i=this._oAuthDfd;let n;s?.signal&&(0,u.fu)(s.signal,(()=>{const e=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;e&&!e.closed?e.close():this.dialog&&f()})),i.resUrl_=e,i.sinfo_=t,i.oinfo_=r;const o=r._oAuthCred;if(o.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&!r.popup&&t.currentVersion>=8.4)){let e=crypto.getRandomValues(new Uint8Array(32));n=(0,m.rS)(e),o.codeVerifier=n,e=crypto.getRandomValues(new Uint8Array(32)),o.stateUID=(0,m.rS)(e),o.save()||(o.codeVerifier=n=null)}else o.codeVerifier=null;let l,h,d,c;this._getCodeChallenge(n).then((i=>{const n=!s||!1!==s.oAuthPopupConfirmation;r.popup&&n?(l=new this.formConstructor,l.oAuthPrompt=!0,l.server=t.server,this.dialog=new Ye,this.dialog.content=l,this.dialog.open=!0,this.emit("dialog-create"),h=l.on("cancel",f),d=(0,p.YP)((()=>this.dialog.open),f),c=l.on("submit",(()=>{g(),this._doOAuthSignIn(e,t,r,i)}))):this._doOAuthSignIn(e,t,r,i)}));const f=()=>{g(),this._oAuthDfd=null,i.reject(new a.Z("identity-manager:user-aborted","ABORTED"))},g=()=>{h?.remove(),d?.remove(),c?.remove(),l?.destroy(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach((e=>{e.destroy()})),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=(0,h.on)(window,"message",(t=>{if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&"arcgis:auth:requestCredential"===t.data?.type){const r=t.source;this.getCredential(e).then((e=>{r.postMessage({type:"arcgis:auth:credential",credential:{expires:e.expires,server:e.server,ssl:e.ssl,token:e.token,userId:e.userId}},t.origin)})).catch((e=>{r.postMessage({type:"arcgis:auth:error",error:{name:e.name,message:e.message}},t.origin)}))}}))}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){"#"===e.charAt(0)&&(e=e.substring(1));const t=(0,m.u0)(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),"access_denied"===t.error&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let t=window.location.search;if(t){"?"===t.charAt(0)&&(t=t.substring(1));const e=(0,m.u0)(t);let r=!1;if(e.code&&e.state)try{e.state=JSON.parse(e.state),e.state.portalUrl&&e.state.uid&&(this._oAuthLocationParams=e,r=!0)}catch{}else if(e.error&&e.error_description&&(console.log("IdentityManager OAuth Error: ",e.error," - ",e.error_description),"access_denied"===e.error&&(r=!0,e.state)))try{e.state=JSON.parse(e.state)}catch{}if(r){const t={...e};["code","error","error_description","message_code","persist","state"].forEach((e=>{delete t[e]}));const r=(0,m.B7)(t),s=window.location.pathname+(r?`?${r}`:"")+(e.state?.hash||"");window.history.replaceState(window.history.state,"",s)}}}_getOAuthToken(e,t,r,s,i){return e=e.replace(/^http:/i,"https:"),(0,o.default)(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:s&&i?{grant_type:"authorization_code",code:t,redirect_uri:s,client_id:r,code_verifier:i}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then((e=>e.data))}_getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=(new TextEncoder).encode(e);return crypto.subtle.digest("SHA-256",t).then((e=>(0,m.rS)(new Uint8Array(e))))}return Promise.resolve(null)}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const e=new a.Z("identity-manager:user-aborted","ABORTED");this._errbackFunc(e)}}_findCredential(e,t){let r,s,i,n,o=-1;const a=t&&t.token,l=t&&t.resource,h=this._isServerRsrc(e)?"server":"portal",d=this.credentials.filter((t=>this._hasSameServerInstance(t.server,e)&&t.scope===h));if(e=l||e,d.length)if(1===d.length){if(r=d[0],n=this.findServerInfo(r.server),s=n&&n.owningSystemUrl,i=s&&this.findCredential(s,r.userId),o=this._getIdenticalSvcIdx(e,r),!a)return-1===o&&r.resources.push(e),this._addResource(e,i),r;-1!==o&&(r.resources.splice(o,1),this._removeResource(e,i))}else{let t,r;if(d.some((a=>(r=this._getIdenticalSvcIdx(e,a),-1!==r&&(t=a,n=this.findServerInfo(t.server),s=n&&n.owningSystemUrl,i=s&&this.findCredential(s,t.userId),o=r,!0)))),a)t&&(t.resources.splice(o,1),this._removeResource(e,i));else if(t)return this._addResource(e,i),t}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t)for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}return t}_addResource(e,t){t&&-1===this._getIdenticalSvcIdx(e,t)&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return t&&t.isAdmin&&!(0,m.D6)(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&"10.1"===String(e.currentVersion)&&!(0,m.D6)(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new m.R9(e);return t.scheme+"://"+t.host+(null!=t.port?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return-1===r&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),-1===r&&(r=t.indexOf("/sharing")),-1===r&&"/"===t.substr(-1)&&(r=t.length-1),r>-1?e.substring(0,r):e}_hasSameServerInstance(e,t){return"/"===e.substr(-1)&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=this._normalizeAGOLorgDomain(e),t=this._normalizeAGOLorgDomain(t),(e=e.substr(e.indexOf(":")))===t.substr(t.indexOf(":"))}_normalizeAGOLorgDomain(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,r=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,s=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):r.test(e)?e=e.replace(r,"https://devext.arcgis.com"):s.test(e)&&(e=e.replace(s,"https://qaext.arcgis.com")),e}_sanitizeUrl(e){const t=(n.Z.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return-1!==r&&(e=e.substring(r+t.length+1)),e=(0,m.Fv)(e),(0,m.mN)(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r;if(this._isRESTService(e)&&this._isRESTService(t)){const s=this._getSuffix(e).toLowerCase(),i=this._getSuffix(t).toLowerCase();if(r=s===i,!r){const e=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=s.replace(e,"$1")===i.replace(e,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const t=new m.R9(e.toLowerCase()),r=this._portalConfig;let s=this._gwDomains.some((e=>e.regex.test(t.uri)));return!s&&r&&(s=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),t.uri)),s||n.Z.portalUrl&&(s=(0,m.D6)(t,n.Z.portalUrl,!0)),s||(s=this._portals.some((e=>this._hasSameServerInstance(e,t.uri)))),s=s||this._agsPortal.test(t.path),s}_isIdProvider(e,t){let r=-1,s=-1;this._gwDomains.forEach(((i,n)=>{-1===r&&i.regex.test(e)&&(r=n),-1===s&&i.regex.test(t)&&(s=n)}));let i=!1;if(r>-1&&s>-1&&(0===r||4===r?0!==s&&4!==s||(i=!0):1===r?1!==s&&2!==s||(i=!0):2===r?2===s&&(i=!0):3===r&&3===s&&(i=!0)),!i){const r=this.findServerInfo(t),s=r&&r.owningSystemUrl;s&&nt(r)&&this._isPortalDomain(s)&&this._isIdProvider(e,s)&&(i=!0)}return i}_getIdenticalSvcIdx(e,t){let r=-1;for(let s=0;s<t.resources.length;s++){const i=t.resources[s];if(this._isIdenticalService(e,i)){r=s;break}}return r}_getSuffix(e){return e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"$1")}_getTokenSvcUrl(e){let t,r,s;if(this._isRESTService(e)||this._isAdminResource(e)){const s=this._getServerInstanceRoot(e);return t=s+"/admin/generateToken",r=(0,o.default)(e=s+"/rest/info",{query:{f:"json"}}).then((e=>e.data)),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let t="";if(this._gwDomains.some((r=>(r.regex.test(e)&&(t=r.tokenServiceUrl),!!t))),t||this._portals.some((r=>(this._hasSameServerInstance(r,e)&&(t=r+this._gwTokenUrl),!!t))),t||(s=e.toLowerCase().indexOf("/sharing"),-1!==s&&(t=e.substring(0,s)+this._gwTokenUrl)),t||(t=this._getOrigin(e)+this._gwTokenUrl),t){const r=new m.R9(e).port;/^http:\/\//i.test(e)&&"7080"===r&&(t=t.replace(/:7080/i,":7443")),t=t.replace(/http:/i,"https:")}return t}if(e.toLowerCase().includes("premium.arcgisonline.com"))return"https://premium.arcgisonline.com/server/tokens"}_processOAuthResponseParams(e,t,r){const s=t._oAuthCred;if(e.code){const i=s.codeVerifier;return s.codeVerifier=null,s.stateUID=null,s.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),i).then((i=>{const n=new dt({userId:i.username,server:r.server,token:i.access_token,expires:Date.now()+1e3*i.expires_in,ssl:i.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=n.userId,s.storage=i.persist?at:lt,s.refreshToken=i.refresh_token,s.token=null,s.expires=i.refresh_token_expires_in?Date.now()+1e3*i.refresh_token_expires_in:null,s.userId=n.userId,s.ssl=n.ssl,s.save(),n}))}const i=new dt({userId:e.username,server:r.server,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:"true"===e.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=i.userId,s.storage=e.persist?at:lt,s.refreshToken=null,s.token=i.token,s.expires=i.expires,s.userId=i.userId,s.ssl=i.ssl,s.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r="access_denied"===e.error,s=new a.Z(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(s)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then((e=>{t.resolve(e)})).catch((e=>{t.reject(e)}))}_setOAuthResponseQueryString(e){e&&("?"===e.charAt(0)&&(e=e.substring(1)),this._processOAuthPopupParams((0,m.u0)(e)))}_exchangeToken(e,t,r){return(0,o.default)(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}}).then((e=>e.data.token))}_getPlatformSelf(e,t){return e=e.replace(/^http:/i,"https:"),(0,o.default)(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0}).then((e=>e.data))}_getPortalSelf(e,t){let r;return this._gwDomains.some((t=>(t.regex.test(e)&&(r=t.customBaseUrl),!!r))),r?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),(0,o.default)(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then((e=>e.data)))}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,s=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(s?s.hasPortal||s.owningSystemUrl&&this._isPortalDomain(s.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||(0,m.D6)(r,e,!0)))}_checkProtocol(e,t,r,s){let i=!0;const n=s?t.adminTokenServiceUrl:t.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&(0,m.ed)(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!i)&&r(new a.Z("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,t,r,s,i,n){return s||(s=(0,u.hh)()),s.resUrl_=e,s.sinfo_=t,s.options_=r,s.admin_=i,s.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(s)):this._xoReqs.push(s):this._doSignIn(s),s.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=t=>{const r=e.options_&&e.options_.resource,s=e.resUrl_,i=e.refresh_;let n=!1;this.credentials.includes(t)||(i&&this.credentials.includes(i)?(i.userId=t.userId,i.token=t.token,i.expires=t.expires,i.validity=t.validity,i.ssl=t.ssl,i.creationTime=t.creationTime,n=!0,t=i):this.credentials.push(t)),t.resources||(t.resources=[]),t.resources.includes(r||s)||t.resources.push(r||s),t.scope=this._isServerRsrc(s)?"server":"portal",t.emitTokenChange();const o=this._soReqs,a={};this._soReqs=[],o.forEach((e=>{if(!this._isIdenticalService(s,e.resUrl_)){const r=this._getSuffix(e.resUrl_);a[r]||(a[r]=!0,t.resources.push(e.resUrl_))}})),e.resolve(t),o.forEach((e=>{this._hasSameServerInstance(this._getServerInstanceRoot(s),e.resUrl_)?e.resolve(t):this._soReqs.push(e)})),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,n||this.emit("credential-create",{credential:t}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=t=>{e.reject(t),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},s=(i,n,o,l)=>{const d=e.sinfo_,c=!e.options_||!1!==e.options_.prompt,p=d.hasPortal&&this._findOAuthInfo(e.resUrl_);let f,g;if(i)t(new dt({userId:i,server:d.server,token:o||null,expires:null!=l?Number(l):null,ssl:!!n}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const s=(0,h.on)(window,"message",(e=>{e.source===window.parent&&e.data&&("arcgis:auth:credential"===e.data.type?(s.remove(),e.data.credential.expires<Date.now()?r(new a.Z("identity-manager:credential-request-failed","Parent application's token has expired.")):t(new dt(e.data.credential))):"arcgis:auth:error"===e.data.type&&(s.remove(),"tokenExpiredError"===e.data.error.name?r(new a.Z("identity-manager:credential-request-failed","Parent application's token has expired.")):r(a.Z.fromJSON(e.data.error))))}));(0,u.fu)(e.options_?.signal,(()=>{s.remove()}))}else if(p){let i=p._oAuthCred;if(!i){const e=new Ke(p,at),t=new Ke(p,lt);e.isValid()&&t.isValid()?e.expires>t.expires?(i=e,t.destroy()):(i=t,e.destroy()):i=e.isValid()?e:t,p._oAuthCred=i}if(i.isValid()){f=new dt({userId:i.userId,server:d.server,token:i.token,expires:i.expires,ssl:i.ssl,_oAuthCred:i});const r=p.appId!==i.appId&&this._doPortalSignIn(e.resUrl_);r||i.refreshToken?(e._pendingDfd=i.refreshToken?this._getOAuthToken(d.server,i.refreshToken,i.appId).then((e=>(f.expires=Date.now()+1e3*e.expires_in,f.token=e.access_token,f))):Promise.resolve(f),e._pendingDfd.then((e=>r?this._exchangeToken(e.server,p.appId,e.token).then((t=>(e.token=t,e))).catch((()=>e)):e)).then((e=>{t(e)})).catch((()=>{i.destroy(),s()}))):t(f)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(p.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===i.stateUID&&i.codeVerifier)){const s=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(s,p,d).then((e=>{t(e)})).catch(r)}else{const s=()=>{c?e._pendingDfd=this.oAuthSignIn(e.resUrl_,d,p,e.options_).then(t,r):(g=new a.Z("identity-manager:not-authenticated","User is not signed in."),r(g))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(d.server,p.appId).then((e=>{(0,m.D6)(e.portalUrl,this._appOrigin,!0)?(f=new dt({userId:e.username,server:d.server,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(f)):s()})).catch(s):s()}}else if(c){if(this._checkProtocol(e.resUrl_,d,r,e.admin_)){let s=e.options_;e.admin_&&(s=s||{},s.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,d,s).then(t,r)}}else g=new a.Z("identity-manager:not-authenticated","User is not signed in."),r(g)},i=()=>{const s=e.sinfo_,i=s.owningSystemUrl,n=e.options_;let o,a,l,h;if(n&&(o=n.token,a=n.error,l=n.prompt),h=this._findCredential(i,{token:o,resource:e.resUrl_}),!h)for(const e of this.credentials)if(this._isIdProvider(i,e.server)){h=e;break}if(h){const i=this.findCredential(e.resUrl_,h.userId);if(i)t(i);else if(ot(s,this._legacyFed)){const e=h.toJSON();e.server=s.server,e.resources=null,t(new dt(e))}else(e._pendingDfd=this.generateToken(this.findServerInfo(h.server),null,{serverUrl:e.resUrl_,token:h.token,signal:e.options_.signal,ssl:h.ssl})).then((r=>{t(new dt({userId:h.userId,server:s.server,token:r.token,expires:null!=r.expires?Number(r.expires):null,ssl:!!r.ssl,isAdmin:e.admin_,validity:r.validity}))}),r)}else this._busy=null,o&&(e.options_.token=null),(e._pendingDfd=this.getCredential(i.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:s.owningTenant,signal:e.options_.signal,token:o,error:a,prompt:l})).then((()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)}),(t=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(t)}))};this._errbackFunc=r;const n=e.sinfo_.owningSystemUrl,o=this._isServerRsrc(e.resUrl_),l=e.sinfo_._restInfoPms;l?l.promise.then((t=>{const r=e.sinfo_;if(r._restInfoPms){r.adminTokenServiceUrl=r._restInfoPms.adminUrl,r._restInfoPms=null,r.tokenServiceUrl=(0,c.hS)("authInfo.tokenServicesUrl",t)||(0,c.hS)("authInfo.tokenServiceUrl",t)||(0,c.hS)("tokenServiceUrl",t),r.shortLivedTokenValidity=(0,c.hS)("authInfo.shortLivedTokenValidity",t),r.currentVersion=t.currentVersion,r.owningTenant=t.owningTenant;const e=r.owningSystemUrl=t.owningSystemUrl;e&&this._portals.push(e)}o&&r.owningSystemUrl?i():s()}),(()=>{e.sinfo_._restInfoPms=null;const t=new a.Z("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(t)})):o&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then((t=>{const r={};let s,i,n,o;return t&&(s=t.user&&t.user.username,r.username=s,r.allSSL=t.allSSL,i=t.supportsOAuth,n=parseFloat(t.currentVersion),"multitenant"===t.portalMode&&(o=t.customBaseUrl),e.sinfo_.currentVersion=n),e.sinfo_.webTierAuth=!!s,s&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:r.allSSL}).catch((()=>null)).then((e=>(r.portalToken=e&&e.token,r.tokenExpiration=e&&e.expires,r))):!s&&i&&n>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:o,owningTenant:e.sinfo_._selfReq.owningTenant}).catch((()=>null)).then((()=>r)):r})).catch((()=>null)).then((t=>{e.sinfo_._selfReq=null,t?s(t.username,t.allSSL,t.portalToken,t.tokenExpiration):s()})):s()}_generateOAuthInfo(e){let t,r,s=e.portalUrl;const i=e.customBaseUrl,n=e.owningTenant,a=!this.defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){r=window.location.href;let e=r.indexOf("?");e>-1&&(r=r.slice(0,e)),e=r.search(/\/(apps|home)\//),r=e>-1?r.slice(0,e):null}return a&&r?(this._hasTestedIfAppIsOnPortal=!0,t=(0,o.default)(r+"/sharing/rest",{query:{f:"json"}}).then((()=>{this.defaultOAuthInfo=new tt({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})}))):t=Promise.resolve(),t.then((()=>{if(this.defaultOAuthInfo)return s=s.replace(/^http:/i,"https:"),(0,o.default)(s+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this.defaultOAuthInfo.appId,redirect_uri:(0,m.hF)(this.defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then((e=>{if(e.data.valid){const t=this.defaultOAuthInfo.clone();e.data.urlKey&&i?t.portalUrl="https://"+e.data.urlKey.toLowerCase()+"."+i:t.portalUrl=s,t.popup=window!==window.top||!((0,m.D6)(s,this._appOrigin)||this._gwDomains.some((e=>e.regex.test(s)&&e.regex.test(this._appOrigin)))),this.oAuthInfos.push(t)}}))}))}_doOAuthSignIn(e,t,r,s){const i=r._oAuthCred,n={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const o={client_id:r.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!i.codeVerifier)};r.forceLogin&&(o.force_login=!0),r.forceUserId&&r.userId&&(o.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(o.redirectToUserOrgUrl=!0),i.codeVerifier&&(o.code_challenge=s||i.codeVerifier,o.code_challenge_method=s?"S256":"plain");const l=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",d=l+"?"+(0,m.B7)(o);if(r.popup){const e=window.open(d,"esriJSAPIOAuth",r.popupWindowFeatures);if(e)e.focus(),this._oAuthDfd.oAuthWin_=e,this._oAuthIntervalId=setInterval((()=>{if(e.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const e=this._oAuthDfd;if(e){const t=new a.Z("identity-manager:user-aborted","ABORTED");e.reject(t)}}}),500),this._oAuthOnPopupHandle=(0,h.on)(window,["arcgis:auth:hash","arcgis:auth:location:search"],(e=>{"arcgis:auth:hash"===e.type?this.setOAuthResponseHash(e.detail):this._setOAuthResponseQueryString(e.detail)}));else{const e=new a.Z("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(e)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:o,authorizeUrl:l,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=d}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return(0,m.hF)(e.popupCallbackUrl);if(t){const e=(0,m.mN)(r);return e.query&&["code","error","error_description","message_code","persist","state"].forEach((t=>{delete e.query[t]})),(0,m.fl)(e.path,e.query)}return r}}ht.prototype.declaredClass="esri.identity.IdentityManagerBase";let dt=class extends l.Z.EventedAccessor{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e&&e._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],null==this.creationTime&&(this.creationTime=Date.now())}refreshToken(){const e=s.id.findServerInfo(this.server),t=e&&e.owningSystemUrl,r=!!t&&"server"===this.scope,i=r&&ot(e,s.id._legacyFed),n=e.webTierAuth,o=n&&s.id.normalizeWebTierAuth,a=it[this.server],l=a&&a[this.userId];let h,d=this.resources&&this.resources[0],c=r&&s.id.findServerInfo(t),u={username:this.userId,password:l};if(n&&!o)return;r&&!c&&s.id.serverInfos.some((e=>(s.id._isIdProvider(t,e.server)&&(c=e),!!c)));const p=c&&s.id.findCredential(c.server,this.userId);if(!r||p){if(!i){if(r)h={serverUrl:d,token:p&&p.token,ssl:p&&p.ssl};else if(o)u=null,h={ssl:this.ssl};else{if(!l){let t;return d&&(d=s.id._sanitizeUrl(d),this._enqueued=1,t=s.id._enqueue(d,e,null,null,this.isAdmin,this),t.then((()=>{this._enqueued=0,this.refreshServerTokens()})).catch((()=>{this._enqueued=0}))),t}this.isAdmin&&(h={isAdmin:!0})}return s.id.generateToken(r?c:e,r?null:u,h).then((e=>{this.token=e.token,this.expires=null!=e.expires?Number(e.expires):null,this.creationTime=Date.now(),this.validity=e.validity,this.emitTokenChange(),this.refreshServerTokens()})).catch((()=>{}))}p.refreshToken()}}refreshServerTokens(){"portal"===this.scope&&s.id.credentials.forEach((e=>{const t=s.id.findServerInfo(e.server),r=t&&t.owningSystemUrl;e!==this&&e.userId===this.userId&&r&&"server"===e.scope&&(s.id._hasSameServerInstance(this.server,r)||s.id._isIdProvider(r,this.server))&&(ot(t,s.id._legacyFed)?(e.token=this.token,e.expires=this.expires,e.creationTime=this.creationTime,e.validity=this.validity,e.emitTokenChange()):e.refreshToken())}))}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=this.server&&s.id.findServerInfo(this.server),r=t&&t.owningSystemUrl,i=r&&s.id.findServerInfo(r);!1===e||r&&"portal"!==this.scope&&(!i||!i.webTierAuth||s.id.normalizeWebTierAuth)||null==this.expires&&null==this.validity||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const e=s.id.credentials.indexOf(this);e>-1&&s.id.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=(0,d.yd)({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),t=this.resources;return t&&t.length>0&&(e.resources=t.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,t=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>t&&(r=t),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};(0,i._)([(0,f.Cb)()],dt.prototype,"creationTime",void 0),(0,i._)([(0,f.Cb)()],dt.prototype,"expires",void 0),(0,i._)([(0,f.Cb)()],dt.prototype,"isAdmin",void 0),(0,i._)([(0,f.Cb)()],dt.prototype,"oAuthState",void 0),(0,i._)([(0,f.Cb)()],dt.prototype,"resources",void 0),(0,i._)([(0,f.Cb)()],dt.prototype,"scope",void 0),(0,i._)([(0,f.Cb)()],dt.prototype,"server",void 0),(0,i._)([(0,f.Cb)()],dt.prototype,"ssl",void 0),(0,i._)([(0,f.Cb)()],dt.prototype,"token",void 0),(0,i._)([(0,f.Cb)()],dt.prototype,"tokenRefreshBuffer",void 0),(0,i._)([(0,f.Cb)()],dt.prototype,"userId",void 0),(0,i._)([(0,f.Cb)()],dt.prototype,"validity",void 0),dt=(0,i._)([(0,g.j)("esri.identity.Credential")],dt);class ct extends ht{}ct.prototype.declaredClass="esri.identity.IdentityManager";const ut=new ct;(0,s.qh)(ut)},2587:(e,t,r)=>{"use strict";r(90344),r(18848),r(940),r(70171);var s=r(94443),i=r(3172),n=r(20102),o=r(70586);async function a(e){if((0,o.pC)(h.fetchBundleAsset))return h.fetchBundleAsset(e);const t=await(0,i.default)(e,{responseType:"text"});return JSON.parse(t.data)}class l{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let s;s="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=s,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,i){const o=t.exec(r);if(!o)throw new n.Z("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=o[1]?`${o[1]}/`:"",h=o[2],d=(0,s.Su)(i),c=`${l}${h}.json`,u=d?`${l}${h}_${d}.json`:c;let p;try{p=await a(e(u))}catch(t){if(u===c)throw new n.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{p=await a(e(c))}catch(e){throw new n.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return p}(this.getAssetUrl,this.matcher,e,t)}}const h={};var d,c=r(99880);(0,s.tz)((d={pattern:"esri/",location:c.V},new l(d)))},90344:(e,t,r)=>{"use strict";r.d(t,{Ze:()=>g,p6:()=>_});var s=r(35454),i=r(70171);const n={year:"numeric",month:"numeric",day:"numeric"},o={year:"numeric",month:"long",day:"numeric"},a={year:"numeric",month:"short",day:"numeric"},l={year:"numeric",month:"long",weekday:"long",day:"numeric"},h={hour:"numeric",minute:"numeric"},d={...h,second:"numeric"},c={"short-date":n,"short-date-short-time":{...n,...h},"short-date-short-time-24":{...n,...h,hour12:!1},"short-date-long-time":{...n,...d},"short-date-long-time-24":{...n,...d,hour12:!1},"short-date-le":n,"short-date-le-short-time":{...n,...h},"short-date-le-short-time-24":{...n,...h,hour12:!1},"short-date-le-long-time":{...n,...d},"short-date-le-long-time-24":{...n,...d,hour12:!1},"long-month-day-year":o,"long-month-day-year-short-time":{...o,...h},"long-month-day-year-short-time-24":{...o,...h,hour12:!1},"long-month-day-year-long-time":{...o,...d},"long-month-day-year-long-time-24":{...o,...d,hour12:!1},"day-short-month-year":a,"day-short-month-year-short-time":{...a,...h},"day-short-month-year-short-time-24":{...a,...h,hour12:!1},"day-short-month-year-long-time":{...a,...d},"day-short-month-year-long-time-24":{...a,...d,hour12:!1},"long-date":l,"long-date-short-time":{...l,...h},"long-date-short-time-24":{...l,...h,hour12:!1},"long-date-long-time":{...l,...d},"long-date-long-time-24":{...l,...d,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":h,"long-time":d},u=(0,s.w)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),p=(u.apiValues,u.toJSON.bind(u),u.fromJSON.bind(u),{ar:"ar-u-nu-latn-ca-gregory"});let m=new WeakMap,f=c["short-date-short-time"];function g(e){return e?c[e]:null}function _(e,t){return function(e){const t=e||f;let r=m.get(t);if(!r){const e=(0,i.Kd)(),s=p[(0,i.Kd)()]||e;r=new Intl.DateTimeFormat(s,t),m.set(t,r)}return r}(t).format(e)}(0,i.Ze)((()=>{m=new WeakMap,f=c["short-date-short-time"]}))},70171:(e,t,r)=>{"use strict";let s;r.d(t,{Kd:()=>o,Ze:()=>d,qe:()=>l});const i=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function n(){return i??globalThis.navigator?.language??"en"}function o(){return void 0===s&&(s=n()),s}const a=[];function l(e){return a.push(e),{remove(){a.splice(a.indexOf(e),1)}}}const h=[];function d(e){return h.push(e),{remove(){a.splice(h.indexOf(e),1)}}}globalThis.addEventListener?.("languagechange",(function(){const e=n();s!==e&&(s=e,[...h].forEach((t=>{t.call(null,e)})),[...a].forEach((t=>{t.call(null,e)})))}))},94443:(e,t,r)=>{"use strict";r.d(t,{ME:()=>p,Su:()=>m,tz:()=>u});var s=r(20102),i=r(95330),n=r(70171);const o=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,a={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function l(e){return a[e]??!1}const h=[],d=new Map;function c(e){for(const t of d.keys())f(e.pattern,t)&&d.delete(t)}function u(e){return h.includes(e)||(c(e),h.unshift(e)),{remove(){const t=h.indexOf(e);t>-1&&(h.splice(t,1),c(e))}}}async function p(e){const t=(0,n.Kd)();d.has(e)||d.set(e,async function(e,t){const r=[];for(const s of h)if(f(s.pattern,e))try{return await s.fetchMessageBundle(e,t)}catch(e){r.push(e)}if(r.length)throw new s.Z("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:r});throw new s.Z("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}(e,t));const r=d.get(e);return r&&await g.add(r),r}function m(e){if(!o.test(e))return null;const t=o.exec(e);if(null===t)return null;const[,r,s]=t,i=r+(s?"-"+s.toUpperCase():"");return l(i)?i:l(r)?r:null}function f(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,n.Ze)((()=>{d.clear()}));const g=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=(0,i.dD)())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}}},18848:(e,t,r)=>{"use strict";r.d(t,{sh:()=>l,uf:()=>h});var s=r(70586),i=r(70171);const n={ar:"ar-u-nu-latn"};let o=new WeakMap,a={};function l(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function h(e,t){return-0===e&&(e=0),function(e){const t=e||a;if(!o.has(t)){const r=(0,i.Kd)(),s=n[(0,i.Kd)()]||r;o.set(t,new Intl.NumberFormat(s,e))}return(0,s.j0)(o.get(t))}(t).format(e)}(0,i.Ze)((()=>{o=new WeakMap,a={}}))},940:(e,t,r)=>{"use strict";r.d(t,{n:()=>h});var s=r(92604),i=r(78286),n=r(19153),o=r(90344),a=r(18848);const l=s.Z.getLogger("esri.intl.substitute");function h(e,t,r={}){const{format:s={}}=r;return(0,n.gx)(e,(e=>function(e,t,r){let s,n;const o=e.indexOf(":");if(-1===o?s=e.trim():(s=e.slice(0,o).trim(),n=e.slice(o+1).trim()),!s)return"";const a=(0,i.hS)(s,t);if(null==a)return"";const l=(n?r?.[n]:null)??r?.[s];return l?d(a,l):n?c(a,n):u(a)}(e,t,s)))}function d(e,t){switch(t.type){case"date":return(0,o.p6)(e,t.intlOptions);case"number":return(0,a.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),u(e)}}function c(e,t){switch(t.toLowerCase()){case"dateformat":return(0,o.p6)(e);case"numberformat":return(0,a.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,o.p6)(e):/^numberformat/i.test(t)?(0,a.uf)(e):u(e)}}function u(e){switch(typeof e){case"string":return e;case"number":return(0,a.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,o.p6)(e):""}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7175],{47175:(e,t,i)=>{i.r(t),i.d(t,{default:()=>xt});var r,s=i(43697),n=i(51773),a=i(70586),o=i(16453),l=i(95330),u=i(5600),p=(i(67676),i(80442),i(75215)),c=i(52011),m=i(30556),d=i(87085),h=i(66577),y=i(38171),f=i(30030),g=i(3172),b=i(20102),R=i(35454),v=i(22974),w=i(92604),_=i(17445),C=i(17452),S=i(71715),I=i(21506),x=i(35956),F=i(96674),T=i(36030);const N=new Set(["raster","raster2","dem","fillraster"]),D=new Set(["rasters"]),P=e=>e&&e.rasterFunction?M.fromJSON(e):e,j=e=>e&&e instanceof M?e.toJSON():e,O=e=>e?.functionName&&!e.declaredClass,V=e=>O(e)?new M(e):e;let M=r=class extends F.wq{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.rasterFunctionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some((t=>N.has(t.toLowerCase())&&O(e[t])))||t.some((t=>D.has(t.toLowerCase())&&Array.isArray(e[t])&&e[t].some((e=>O(e)))))){e=(0,v.d9)(e);for(const i of t)N.has(i.toLowerCase())?e[i]=V(e[i]):D.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map((e=>V(e))))}}this._set("functionArguments",e)}readFunctionArguments(e){return(e=>{if(null==e)return null;e=(0,v.d9)(e);const t={};for(const i of Object.keys(e))N.has(i.toLowerCase())?t[i]=P(e[i]):D.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(P):t[i]=e[i];return t})(e)}writeFunctionArguments(e,t,i){const r={};for(const t of Object.keys(e))N.has(t.toLowerCase())?r[t]=j(e[t]):D.has(t.toLowerCase())&&Array.isArray(e[t])?r[t]=e[t].map(j):r[t]=j(e[t]);t[i]=r}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i&&i.length&&"None"!==i[0].name?i[0].name:t.rasterFunctionDefinition?t.rasterFunctionDefinition.name:t.rasterFunction)}clone(){return new r({functionName:this.functionName,functionArguments:(0,v.d9)(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:(0,v.d9)(this.rasterFunctionDefinition)})}};(0,s._)([(0,u.Cb)({json:{type:Object,name:"rasterFunctionArguments"}})],M.prototype,"functionArguments",null),(0,s._)([(0,S.r)("functionArguments")],M.prototype,"readFunctionArguments",null),(0,s._)([(0,m.c)("functionArguments")],M.prototype,"writeFunctionArguments",null),(0,s._)([(0,u.Cb)({json:{type:String,write:{target:"rasterFunction"}}})],M.prototype,"functionName",void 0),(0,s._)([(0,S.r)("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],M.prototype,"readFunctionName",null),(0,s._)([(0,T.J)({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),(0,u.Cb)({json:{default:"unknown"}})],M.prototype,"outputPixelType",void 0),(0,s._)([(0,u.Cb)({type:String,json:{read:!0,write:!0}})],M.prototype,"variableName",void 0),(0,s._)([(0,u.Cb)({type:Object,json:{name:"rasterFunctionDefinition"}})],M.prototype,"rasterFunctionDefinition",void 0),M=r=(0,s._)([(0,c.j)("esri.layers.support.RasterFunction")],M);const A=M,J={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}};var E=i(93010),q=i(75509),z=i(27922);const L={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767]},Z={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},k=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function U(e){return k.has(e.type)}function H(e,t){if(!e||!t)return(0,v.d9)(e||t);const i=(0,v.d9)(e);if(t.rasterFunctionDefinition){const e=t.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=null),Q(i.rasterFunctionDefinition.arguments,t)}else"none"!==t.functionName.toLowerCase()&&(W(i.functionArguments).Raster=t);return i}function Q(e,t){for(const i in e)"raster"===i.toLowerCase()&&("RasterFunctionVariable"===e[i].type?(e[i]=t.rasterFunctionDefinition,e[i].type="RasterFunctionTemplate"):"RasterFunctionTemplate"===e[i].type&&Q(e[i].arguments,t))}function G(e){const t=(0,v.d9)(J[e.functionName+"Function"]),i=e.functionArguments;for(const e in i)"raster"===e.toLowerCase()?(t.arguments[e]=G(i[e]),t.arguments[e].type="RasterFunctionTemplate"):"colormap"===e.toLowerCase()?(t.arguments[e].value=Y(i[e]),t.arguments.ColorSchemeType.value=0):t.arguments[e].value=i[e];return t}function W(e){const t=e.Raster;return t&&"esri.layers.support.RasterFunction"===t.declaredClass?W(t.functionArguments):e}const B={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function $(e,t){const i=L[String(t).toLowerCase()];return i&&e.push([Math.floor(i[0]-1),0,0,0],[Math.ceil(i[1]+1),0,0,0]),e}function K(e){if((0,a.Wi)(e))return;const{fields:t}=e,i=t&&t.find((e=>e&&e.name&&"value"===e.name.toLowerCase()));return i&&i.name}function X(e){const t=[];return e.forEach((e=>{const i=e;if(Array.isArray(i))t.push(i);else{if(null==i.min||null==i.max)return;const e=[i.min,i.max,i.avg||0,i.stddev||0];t.push(e)}})),t}function Y(e){const t=[],i=[];return e.forEach((e=>{t.push(e[0]),i.push((0,E.io)([...e.slice(1),255]))})),{type:"RasterColormap",values:t,colors:i}}var ee,te=i(90578),ie=i(13473);const re=(0,R.w)()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),se=(0,R.w)()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});let ne=ee=class extends F.wq{constructor(e){super(e),this.ascending=!0,this.itemRenderingRule=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return null!=t.ascending?t.ascending:null==t.sortAscending||t.sortAscending}readMethod(e,t){return function(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return se.fromJSON(t)}(t.mosaicMethod||t.defaultMosaicMethod)}readOperation(e,t){const i=t.mosaicOperation,r=t.mosaicOperator&&t.mosaicOperator.toLowerCase(),s=i||(r?re.toJSON(r):null);return re.fromJSON(s)||"first"}castSortValue(e){return null==e||"string"==typeof e||"number"==typeof e?e:`${e}`}clone(){return new ee({ascending:this.ascending,itemRenderingRule:(0,v.d9)(this.itemRenderingRule),lockRasterIds:(0,v.d9)(this.lockRasterIds),method:this.method,multidimensionalDefinition:(0,v.d9)(this.multidimensionalDefinition),objectIds:(0,v.d9)(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:(0,v.d9)(this.viewpoint),where:this.where})}};(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],ne.prototype,"ascending",void 0),(0,s._)([(0,S.r)("ascending",["ascending","sortAscending"])],ne.prototype,"readAscending",null),(0,s._)([(0,u.Cb)({type:A,json:{write:!0}})],ne.prototype,"itemRenderingRule",void 0),(0,s._)([(0,u.Cb)({type:[p.z8],json:{write:{overridePolicy(){return{enabled:"lock-raster"===this.method}}}}})],ne.prototype,"lockRasterIds",void 0),(0,s._)([(0,u.Cb)({type:String,json:{type:se.jsonValues,write:{target:"mosaicMethod",writer:se.write}}})],ne.prototype,"method",void 0),(0,s._)([(0,S.r)("method",["mosaicMethod","defaultMosaicMethod"])],ne.prototype,"readMethod",null),(0,s._)([(0,u.Cb)({type:[x.Z],json:{write:!0}})],ne.prototype,"multidimensionalDefinition",void 0),(0,s._)([(0,u.Cb)({type:[p.z8],json:{name:"fids",write:!0}})],ne.prototype,"objectIds",void 0),(0,s._)([(0,u.Cb)({json:{type:re.jsonValues,read:{reader:re.read},write:{target:"mosaicOperation",writer:re.write}}})],ne.prototype,"operation",void 0),(0,s._)([(0,S.r)("operation",["mosaicOperation","mosaicOperator"])],ne.prototype,"readOperation",null),(0,s._)([(0,u.Cb)({type:String,json:{write:{overridePolicy(){return{enabled:"attribute"===this.method}}}}})],ne.prototype,"sortField",void 0),(0,s._)([(0,u.Cb)({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:"attribute"===this.method,allowNull:!0}}}}})],ne.prototype,"sortValue",void 0),(0,s._)([(0,te.p)("sortValue")],ne.prototype,"castSortValue",null),(0,s._)([(0,u.Cb)({type:ie.Z,json:{write:!0}})],ne.prototype,"viewpoint",void 0),(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],ne.prototype,"where",void 0),ne=ee=(0,s._)([(0,c.j)("esri.layers.support.MosaicRule")],ne);const ae=ne;var oe=i(69608);let le=class extends F.wq{constructor(){super(...arguments),this.layer=null,this.adjustAspectRatio=void 0,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}writeAdjustAspectRatio(e,t,i){this.layer.version<10.3||(t[i]=e)}get bandIds(){return this.layer.bandIds}set bandIds(e){this.layer&&(this.layer.bandIds=e)}get compressionQuality(){return this.layer?.compressionQuality}set compressionQuality(e){this.layer&&(this.layer.compressionQuality=e)}writeCompressionQuality(e,t,i){this.format&&this.format.toLowerCase().includes("jpg")&&null!=e&&(t[i]=e)}get compressionTolerance(){return this.layer?.compressionTolerance}set compressionTolerance(e){this.layer&&(this.layer.compressionTolerance=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}get format(){return"vector-field"===this.layer.renderer?.type?"lerc":this.layer.format}get interpolation(){return this.layer?.interpolation}set interpolation(e){this.layer&&(this.layer.interpolation=e)}get noData(){return this.layer?.noData}set noData(e){this.layer&&(this.layer.noData=e)}get noDataInterpretation(){return this.layer?.noDataInterpretation}set noDataInterpretation(e){this.layer&&(this.layer.noDataInterpretation=e)}writeLercVersion(e,t,i){"lerc"===this.format&&this.layer.version>=10.5&&(t[i]=e)}get version(){const e=this.layer;return e.commitProperty("bandIds"),e.commitProperty("format"),e.commitProperty("compressionQuality"),e.commitProperty("compressionTolerance"),e.commitProperty("interpolation"),e.commitProperty("noData"),e.commitProperty("noDataInterpretation"),e.commitProperty("mosaicRule"),e.commitProperty("renderingRule"),e.commitProperty("adjustAspectRatio"),e.commitProperty("pixelFilter"),e.commitProperty("renderer"),e.commitProperty("definitionExpression"),(this._get("version")||0)+1}set version(e){this._set("version",e)}get mosaicRule(){const e=this.layer;let t=e.mosaicRule;const i=e.definitionExpression;return t?i&&i!==t.where&&(t=t.clone(),t.where=i):i&&(t=new ae({where:i})),t}get renderingRule(){const e=this.layer;let t=e.renderingRule;const i=e.pixelFilter,r=!e.format||e.format.includes("jpg")||e.format.includes("png");return t=this._addResampleRasterFunction(t),r&&!i&&"vector-field"!==e.renderer?.type&&(t=this.combineRendererWithRenderingRule()),t}combineRendererWithRenderingRule(){const e=this.layer,{rasterInfo:t,renderingRule:i,renderer:r}=e;return r&&U(r)?H(function(e,t){switch(t=t||{},e.type){case"raster-stretch":return function(e,t){const i=t.convertToRFT,r=new A;r.functionName="Stretch";const s=B[q.v.toJSON(e.stretchType)],n="u8",a={StretchType:s,Statistics:X(e.statistics),DRA:e.dynamicRangeAdjustment,UseGamma:e.useGamma,Gamma:e.gamma,ComputeGamma:e.computeGamma};if(null!=e.outputMin&&(a.Min=e.outputMin),null!=e.outputMax&&(a.Max=e.outputMax),s===B.standardDeviation?(a.NumberOfStandardDeviations=e.numberOfStandardDeviations,r.outputPixelType=n):s===B.percentClip?(a.MinPercent=e.minPercent,a.MaxPercent=e.maxPercent,r.outputPixelType=n):s===B.minMax?r.outputPixelType=n:s===B.sigmoid&&(a.SigmoidStrengthLevel=e.sigmoidStrengthLevel),r.functionArguments=a,r.variableName="Raster",e.colorRamp){const s=e.colorRamp,n=new A;if(i)n.functionArguments={ColorRamp:(0,E.pM)(s)};else{const i=(0,E.Uh)(s);if(i)n.functionArguments={colorRamp:i};else if(!t.convertColorRampToColormap||"algorithmic"!==s.type&&"multipart"!==s.type){const t=e.colorRamp.toJSON();"algorithmic"===t.type?t.algorithm=t.algorithm||"esriCIELabAlgorithm":"multipart"===t.type&&t.colorRamps?.length&&t.colorRamps.forEach((e=>e.algorithm=e.algorithm||"esriCIELabAlgorithm")),n.functionArguments={colorRamp:t}}else n.functionArguments={Colormap:(0,E.Jw)(s,256)}}return n.variableName="Raster",n.functionName="Colormap",n.functionArguments.Raster=r,i?new A({rasterFunctionDefinition:G(n)}):n}return i?new A({rasterFunctionDefinition:G(r)}):r}(e,t);case"class-breaks":return function(e,t){const i=[],r=[],s=[],n=[],o=1e-6,{pixelType:l,rasterAttributeTable:u}=t,p=(0,a.Wi)(u)?null:u.features,c=K(u);if(p&&Array.isArray(p)&&e.classBreakInfos){e.classBreakInfos.forEach(((t,i)=>{const r=t.symbol.color;let s;r.a&&p.forEach((a=>{s=a.attributes[e.field],(s>=t.minValue&&s<t.maxValue||i===e.classBreakInfos.length-1&&s>=t.minValue)&&n.push([a.attributes[c],r.r,r.g,r.b])}))}));const i=l?$(n,l):n,r=new A;return r.functionName="Colormap",r.functionArguments={},r.functionArguments.Colormap=i,r.variableName="Raster",t.convertToRFT?new A({rasterFunctionDefinition:G(r)}):r}e.classBreakInfos.forEach(((e,t)=>{const a=e.symbol&&e.symbol.color;a.a?(0===t?i.push(e.minValue,e.maxValue+o):i.push(e.minValue+o,e.maxValue+o),r.push(t),n.push([t,a.r,a.g,a.b])):s.push(e.minValue,e.maxValue)}));const m=l?$(n,l):n,d=new A;d.functionName="Remap",d.functionArguments={InputRanges:i,OutputValues:r,NoDataRanges:s},d.variableName="Raster";const h=new A;return h.functionName="Colormap",h.functionArguments={Colormap:m,Raster:d},t.convertToRFT?new A({rasterFunctionDefinition:G(h)}):h}(e,t);case"unique-value":return function(e,t){const i=[],{pixelType:r,rasterAttributeTable:s}=t,n=(0,a.Wi)(s)?null:s.features,o=K(s),l=e.defaultSymbol?.color?.toRgb(),u=e.uniqueValueInfos;if(u)if(n){const t=new Map;u.forEach((e=>{const i=e.value,r=e.symbol.color?.toRgb();null!=i&&r&&t.set(String(i),r)}));const r=e.field;n.forEach((({attributes:e})=>{const s=String(e[r]),n=e[o];if(t.has(s)){const e=t.get(s);i.push([n,...e])}else l&&i.push([n,...l])}))}else for(let e=0;e<u.length;e++){const t=u[e],r=t.symbol.color,s=+t.value;if(r?.a){if(isNaN(s))return null;i.push([s,r.r,r.g,r.b])}}const p=r&&i.length>0?$(i,r):i,c=new A;return c.functionName="Colormap",c.functionArguments={},c.functionArguments.Colormap=p,c.variableName="Raster",t.convertToRFT?new A({rasterFunctionDefinition:G(c)}):c}(e,t);case"raster-colormap":return function(e,t){const i=e.extractColormap();if(!i||0===i.length)return;const{pixelType:r}=t,s=r?$(i,r):i,n=new A;return n.functionName="Colormap",n.functionArguments={},n.functionArguments.Colormap=s,t.convertToRFT?new A({rasterFunctionDefinition:G(n)}):n}(e,t);case"vector-field":return function(e,t){const i=new A;i.functionName="VectorFieldRenderer";const{dataType:r,bandProperties:s}=t,n="vector-uv"===r;let a,o;s&&2===s.length&&(a=s.map((e=>e.BandName.toLowerCase())).indexOf("magnitude"),o=s.map((e=>e.BandName.toLowerCase())).indexOf("direction")),-1!==a&&null!==a||(a=0,o=1);const l="arithmetic"===e.rotationType?1:2,u="flow-from"===e.flowRepresentation?0:1,p=e.visualVariables?e.visualVariables.find((e=>"Magnitude"===e.field)):new z.Z,c={magnitudeBandID:a,directionBandID:o,isUVComponents:n,referenceSystem:l,massFlowAngleRepresentation:u,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:Z[e.style.toLowerCase().replace("-","_")],minimumMagnitude:p.minDataValue,maximumMagnitude:p.maxDataValue,minimumSymbolSize:p.minSize,maximumSymbolSize:p.maxSize};return i.functionArguments=c,t.convertToRFT?new A({rasterFunctionDefinition:G(i)}):i}(e,t);case"raster-shaded-relief":return function(e,t){const i=t.convertToRFT;if("elevation"!==t.dataType)return new A;const r=new A;r.functionName="Hillshade";const s="traditional"===e.hillshadeType?0:1,n="none"===e.scalingType?1:3,a={HillshadeType:s,SlopeType:n,ZFactor:e.zFactor};return 0===s&&(a.Azimuth=e.azimuth,a.Altitude=e.altitude),3===n&&(a.PSPower=e.pixelSizePower,a.PSZFactor=e.pixelSizeFactor),r.functionArguments=a,r.variableName="Raster",e.colorRamp&&(r.functionName="ShadedRelief",i?a.ColorRamp=(0,E.pM)(e.colorRamp):a.Colormap=(0,E.Jw)(e.colorRamp,256)),i?new A({rasterFunctionDefinition:G(r)}):r}(e,t);case"flow":throw new Error("Unsupported rendering rule.")}}(r,{rasterAttributeTable:t.attributeTable,pixelType:t.pixelType,dataType:t.dataType,bandProperties:t.keyProperties?.BandProperties,convertColorRampToColormap:e.version<10.6,convertToRFT:!!i?.rasterFunctionDefinition}),i):i}_addResampleRasterFunction(e){if("vector-field"!==this.layer.renderer?.type||"Resample"===e?.functionName||(0,a.Wi)(this.layer.serviceRasterInfo))return e;const t="esriImageServiceDataTypeVector-UV"===this.layer.serviceDataType?7:10,i=this.layer.serviceRasterInfo.pixelSize;let r=new A({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:i}});return r=e?.rasterFunctionDefinition?new A({rasterFunctionDefinition:G(r)}):r,H(r,e)}};(0,s._)([(0,u.Cb)()],le.prototype,"layer",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],le.prototype,"adjustAspectRatio",void 0),(0,s._)([(0,m.c)("adjustAspectRatio")],le.prototype,"writeAdjustAspectRatio",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],le.prototype,"bandIds",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],le.prototype,"compression",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],le.prototype,"compressionQuality",null),(0,s._)([(0,m.c)("compressionQuality")],le.prototype,"writeCompressionQuality",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],le.prototype,"compressionTolerance",null),(0,s._)([(0,m.c)("compressionTolerance")],le.prototype,"writeCompressionTolerance",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],le.prototype,"format",null),(0,s._)([(0,u.Cb)({type:String,json:{read:{reader:oe.c.read},write:{writer:oe.c.write}}})],le.prototype,"interpolation",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],le.prototype,"noData",null),(0,s._)([(0,u.Cb)({type:String,json:{read:{reader:oe.k.read},write:{writer:oe.k.write}}})],le.prototype,"noDataInterpretation",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],le.prototype,"pixelType",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],le.prototype,"lercVersion",void 0),(0,s._)([(0,m.c)("lercVersion")],le.prototype,"writeLercVersion",null),(0,s._)([(0,u.Cb)({type:Number})],le.prototype,"version",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],le.prototype,"mosaicRule",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],le.prototype,"renderingRule",null),le=(0,s._)([(0,c.j)("esri.layers.mixins.ExportImageServiceParameters")],le);var ue=i(1231),pe=i(99514),ce=i(54163),me=i(48526),de=i(88281),he=i(99815),ye=i(75993),fe=i(80676),ge=i(67058),be=i(91219),Re=i(82526),ve=i(11282),we=i(82971);let _e=class extends F.wq{constructor(){super(...arguments),this.north=null,this.up=null,this.spatialReference=null}};(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],_e.prototype,"north",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],_e.prototype,"up",void 0),(0,s._)([(0,u.Cb)({type:we.Z,json:{write:!0}})],_e.prototype,"spatialReference",void 0),_e=(0,s._)([(0,c.j)("esri.rest.support.ImageAngleResult")],_e);const Ce=_e;var Se=i(74889);let Ie=class extends F.wq{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};(0,s._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"catalogItemVisibilities",void 0),(0,s._)([(0,u.Cb)({type:Se.default,json:{write:!0}})],Ie.prototype,"catalogItems",void 0),(0,s._)([(0,u.Cb)({type:ie.Z,json:{write:!0}})],Ie.prototype,"location",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"name",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"objectId",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"processedValues",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"properties",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"value",void 0),Ie=(0,s._)([(0,c.j)("esri.rest.support.ImageIdentifyResult")],Ie);const xe=Ie;let Fe=class extends F.wq{constructor(){super(...arguments),this.geometries=null}};(0,s._)([(0,u.Cb)({json:{write:!0}})],Fe.prototype,"geometries",void 0),Fe=(0,s._)([(0,c.j)("esri.rest.support.ImagePixelLocationResult")],Fe);const Te=Fe;let Ne=class extends F.wq{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};(0,s._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"attributes",void 0),(0,s._)([(0,u.Cb)({type:ie.Z,json:{write:!0}})],Ne.prototype,"location",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"locationId",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"rasterId",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"resolution",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"pixelValue",void 0),Ne=(0,s._)([(0,c.j)("esri.rest.support.ImageSample")],Ne);const De=Ne;let Pe=class extends F.wq{constructor(){super(...arguments),this.samples=null}};(0,s._)([(0,u.Cb)({type:[De],json:{write:!0}})],Pe.prototype,"samples",void 0),Pe=(0,s._)([(0,c.j)("esri.rest.support.ImageSampleResult")],Pe);const je=Pe;function Oe(e){const t=e?.time;if(t&&(null!=t.start||null!=t.end)){const i=[];null!=t.start&&i.push(t.start),null==t.end||i.includes(t.end)||i.push(t.end),e.time=i.join(",")}}async function Ve(e,t,i){const r=(0,ve.en)(e),s=t.geometry?[t.geometry]:[],n=await(0,Re.aX)(s),o=t.toJSON();Oe(o);const l=n&&n[0];(0,a.pC)(l)&&(o.geometry=l.toJSON());const u=(0,ve.cv)({...r.query,f:"json",...o});return(0,ve.lA)(u,i)}async function Me(e,t,i){const r=(0,ve.en)(e),s=t.geometry?[t.geometry]:[];return(0,Re.aX)(s).then((e=>{const s=t.toJSON(),n=e&&e[0];(0,a.pC)(n)&&(s.geometry=JSON.stringify(n.toJSON()));const o=(0,ve.cv)({...r.query,f:"json",...s}),l=(0,ve.lA)(o,i);return(0,g.default)(r.path+"/identify",l)})).then((e=>xe.fromJSON(e.data)))}function Ae(e){const{imageCoordinateSystem:t}=e;if(t){const{id:e,referenceServiceName:i}=t;return null!=e?i?{icsid:e,icsns:i}:{icsid:e}:{ics:t}}return e.toJSON()}function Je(e,t){const i=Ae(e),{icsid:r,icsns:s,wkid:n}=i;return null!=r?null==s||t?.toLowerCase().includes("/"+s.toLowerCase()+"/")?`0:${r}`:JSON.stringify(i):n?n.toString():JSON.stringify(i)}i(10158);var Ee,qe=i(4967),ze=(i(67900),i(8744),i(98732),i(6570)),Le=(i(9361),i(65091)),Ze=i(38913),ke=(i(58901),i(45091),i(57444)),Ue=(i(40330),i(98326),i(56545),i(41818)),He=i(5396),Qe=(i(75935),i(28141),i(26059)),Ge=i(36679);let We=Ee=class extends F.wq{constructor(){super(...arguments),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new Ee((0,v.d9)({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};(0,s._)([(0,u.Cb)({type:[String],json:{name:"angleName",write:!0}})],We.prototype,"angleNames",void 0),(0,s._)([(0,u.Cb)({type:ie.Z,json:{write:!0}})],We.prototype,"point",void 0),(0,s._)([(0,u.Cb)({type:we.Z,json:{write:!0}})],We.prototype,"spatialReference",void 0),(0,s._)([(0,u.Cb)({type:p.z8,json:{write:!0}})],We.prototype,"rasterId",void 0),We=Ee=(0,s._)([(0,c.j)("esri.rest.support.ImageAngleParameters")],We);const Be=We;var $e,Ke=i(92835),Xe=i(33955);let Ye=$e=class extends F.wq{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.renderingRule=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Xe.Ji)(e),t[i]=e.toJSON())}clone(){return new $e((0,v.d9)({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};(0,s._)([(0,u.Cb)({types:h.qM,json:{read:Xe.im}})],Ye.prototype,"geometry",void 0),(0,s._)([(0,m.c)("geometry")],Ye.prototype,"writeGeometry",null),(0,s._)([(0,u.Cb)({type:ae,json:{write:!0}})],Ye.prototype,"mosaicRule",void 0),(0,s._)([(0,u.Cb)({type:A,json:{write:!0}})],Ye.prototype,"renderingRule",void 0),(0,s._)([(0,u.Cb)({type:ie.Z,json:{write:!0}})],Ye.prototype,"pixelSize",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ye.prototype,"raster",void 0),(0,s._)([(0,u.Cb)({type:Ke.Z,json:{read:{source:"time"},write:{target:"time"}}})],Ye.prototype,"timeExtent",void 0),Ye=$e=(0,s._)([(0,c.j)("esri.rest.support.ImageHistogramParameters")],Ye);const et=Ye;var tt;let it=tt=class extends F.wq{constructor(){super(...arguments),this.geometry=null,this.renderingRules=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Xe.Ji)(e),t[i]=JSON.stringify(e.toJSON()))}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=ae.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}writeMosaicRule(e,t,i){null!=e&&(t[i]=JSON.stringify(e.toJSON()))}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=A.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}writeRenderingRule(e,t,i){null!=e&&(t[i]=JSON.stringify(e.toJSON())),e.rasterFunctionDefinition&&(t[i]=JSON.stringify(e.rasterFunctionDefinition))}writeRenderingRules(e,t,i){null!=e&&(t[i]=JSON.stringify(e.map((e=>e.rasterFunctionDefinition||e.toJSON()))))}writePixelSize(e,t,i){null!=e&&(t[i]=JSON.stringify(e))}writeTimeExtent(e,t,i){if(null!=e){const r=(0,a.pC)(e.start)?e.start.getTime():null,s=(0,a.pC)(e.end)?e.end.getTime():null;t[i]=null!=r?null!=s?`${r},${s}`:`${r}`:null}}clone(){return new tt((0,v.d9)({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};(0,s._)([(0,u.Cb)({json:{write:!0}})],it.prototype,"geometry",void 0),(0,s._)([(0,m.c)("geometry")],it.prototype,"writeGeometry",null),(0,s._)([(0,u.Cb)({type:ae,json:{write:!0}})],it.prototype,"mosaicRule",null),(0,s._)([(0,m.c)("mosaicRule")],it.prototype,"writeMosaicRule",null),(0,s._)([(0,u.Cb)({type:A,json:{write:!0}})],it.prototype,"renderingRule",null),(0,s._)([(0,m.c)("renderingRule")],it.prototype,"writeRenderingRule",null),(0,s._)([(0,u.Cb)({type:[A],json:{write:!0}})],it.prototype,"renderingRules",void 0),(0,s._)([(0,m.c)("renderingRules")],it.prototype,"writeRenderingRules",null),(0,s._)([(0,u.Cb)({type:ie.Z,json:{write:!0}})],it.prototype,"pixelSize",void 0),(0,s._)([(0,m.c)("pixelSize")],it.prototype,"writePixelSize",null),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"returnGeometry",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"returnCatalogItems",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"returnPixelValues",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],it.prototype,"maxItemCount",void 0),(0,s._)([(0,u.Cb)({type:Ke.Z,json:{write:{target:"time"}}})],it.prototype,"timeExtent",void 0),(0,s._)([(0,m.c)("timeExtent")],it.prototype,"writeTimeExtent",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],it.prototype,"raster",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],it.prototype,"viewId",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"processAsMultidimensional",void 0),it=tt=(0,s._)([(0,c.j)("esri.rest.support.ImageIdentifyParameters")],it);const rt=it;var st;let nt=st=class extends F.wq{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(e,t,i){t.geometries={geometryType:"esriGeometryPoint",geometries:e.map((e=>e.toJSON()))}}clone(){return new st({geometries:this.geometries.map((e=>e.clone())),rasterId:this.rasterId})}};(0,s._)([(0,u.Cb)({type:[ie.Z],json:{write:!0}})],nt.prototype,"geometries",void 0),(0,s._)([(0,m.c)("geometries")],nt.prototype,"writeGeometry",null),(0,s._)([(0,u.Cb)({type:p.z8,json:{write:!0}})],nt.prototype,"rasterId",void 0),nt=st=(0,s._)([(0,c.j)("esri.rest.support.ImagePixelLocationParameters")],nt);const at=nt;var ot;let lt=ot=class extends F.wq{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Xe.Ji)(e),t[i]=e.toJSON())}set locations(e){if(e?.length){const t=new Le.Z({spatialReference:e[0].spatialReference});t.points=e.map((e=>[e.x,e.y])),this._set("locations",e),this.geometry=t}}clone(){return new ot((0,v.d9)({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};(0,s._)([(0,u.Cb)({types:h.qM,json:{read:Xe.im}})],lt.prototype,"geometry",void 0),(0,s._)([(0,m.c)("geometry")],lt.prototype,"writeGeometry",null),(0,s._)([(0,u.Cb)()],lt.prototype,"locations",null),(0,s._)([(0,u.Cb)({type:String,json:{type:oe.c.jsonValues,read:oe.c.read,write:oe.c.write}})],lt.prototype,"interpolation",void 0),(0,s._)([(0,u.Cb)({type:ae,json:{write:!0}})],lt.prototype,"mosaicRule",void 0),(0,s._)([(0,u.Cb)({type:[String],json:{write:!0}})],lt.prototype,"outFields",void 0),(0,s._)([(0,u.Cb)({type:ie.Z,json:{write:!0}})],lt.prototype,"pixelSize",void 0),(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],lt.prototype,"raster",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],lt.prototype,"returnFirstValueOnly",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],lt.prototype,"sampleDistance",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],lt.prototype,"sampleCount",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],lt.prototype,"sliceId",void 0),(0,s._)([(0,u.Cb)({type:Ke.Z,json:{read:{source:"time"},write:{target:"time"}}})],lt.prototype,"timeExtent",void 0),lt=ot=(0,s._)([(0,c.j)("esri.rest.support.ImageSampleParameters")],lt);const ut=lt;var pt=i(23808);const ct=(0,R.w)()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"}),mt=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),dt=(0,u.Eg)(p.q9,{min:0,max:255}),ht=e=>{let t=class extends e{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._defaultServiceMosaicRule=null,this._serviceSourceType=null,this._serviceSupportsMosaicRule=null,this.rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new le({layer:this}))}readDefaultServiceMosaicRule(e,t){return this._serviceSupportsMosaicRule?ae.fromJSON(t):null}readServiceSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.length<1||(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.forEach((t=>{e.set(t.name.toLowerCase().replace(/ /gi,"_"),t.name)})),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every((e=>"number"==typeof e)))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,i){null!=e&&"lerc"!==this.format&&(t[i]=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}get fieldsIndex(){return this.fields?new pe.Z(this.fields):null}set format(e){e&&mt.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return"esriImageServiceDataTypeVector-UV"===t.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===t.serviceDataType||null!=this.pixelFilter?"lerc":"jpgpng"}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=ae.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const i=e||t.mosaicRule;return i?ae.fromJSON(i):this._isMosaicRuleSupported(t)?ae.fromJSON(t):null}writeMosaicRule(e,t,i){let r=this.mosaicRule;const s=this.definitionExpression;r?s&&s!==r.where&&(r=r.clone(),r.where=s):s&&(r=new ae({where:s})),this._isValidCustomizedMosaicRule(r)&&(t[i]=r.toJSON())}get multidimensionalInfo(){return(0,a.pC)(this.serviceRasterInfo)?this.serviceRasterInfo.multidimensionalInfo:null}writeNoData(e,t,i){null!=e&&"number"==typeof e&&(t[i]=dt(e))}readObjectIdField(e,t){if(!e){const i=t.fields.filter((e=>"esriFieldTypeOID"===e.type||"oid"===e.type));e=i&&i[0]&&i[0].name}return e}get parsedUrl(){return this.url?(0,C.mN)(this.url):null}set renderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("renderer",e)}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer,s=(0,f.ij)(r,i);return null==s?null:("vector-field"===s.type&&t.symbolTileSize&&!r.symbolTileSize&&(s.symbolTileSize=t.symbolTileSize),U(s)||w.Z.getLogger(this.declaredClass).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),s)}writeRenderer(e,t,i){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),"vector-field"===e.type&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this.rasterAttributeTableFieldPrefix||"Raster.",t=new ue.Z({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),i=new ue.Z({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),r=new ue.Z({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let s=this.fields?(0,v.d9)(this.fields):[];s.push(i),this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0&&s.push(t),this.version>=10.4&&(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.some((e=>"none"===e.name.toLowerCase()))&&s.push(r),(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.filter((e=>"none"!==e.name.toLowerCase())).forEach((e=>{s.push(new ue.Z({name:"Raster.ServicePixelValue."+e.name,alias:e.name,domain:null,editable:!1,length:50,type:"string"}))})),this._isVectorDataSet()&&(s.push(new ue.Z({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),s.push(new ue.Z({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:n}=this.rasterInfo,o=(0,a.pC)(n)?n.fields:null;if(o.length){const t=o.filter((e=>"esriFieldTypeOID"!==e.type&&"value"!==e.name.toLowerCase())).map((t=>{const i=(0,v.d9)(t);return i.name=e+t.name,i}));s=s.concat(t)}return s}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=A.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}readRenderingRule(e,t){const i=t.rasterFunctionInfos;return t.renderingRule||i&&i.length&&"None"!==i[0].name?this._isRFTJson(t.renderingRule)?A.fromJSON({rasterFunctionDefinition:t.renderingRule}):A.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}writeRenderingRule(e,t,i){const r=e.toJSON();r.rasterFunctionDefinition?t[i]=r.rasterFunctionDefinition:t[i]=r}readSpatialReference(e,t){const i=e||t.extent.spatialReference;return i?we.Z.fromJSON(i):null}readPixelType(e){return ct.fromJSON(e)||e}writePixelType(e,t,i){((0,a.Wi)(this.serviceRasterInfo)||this.pixelType!==this.serviceRasterInfo.pixelType)&&(t[i]=ct.toJSON(e))}readVersion(e,t){let i=t.currentVersion;return i||(i=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),i}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let i=e;if(!this._isPicture()&&this.renderer&&this.symbolizer&&!this.pixelFilter){const r=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(this.renderer.toJSON()),s=this._rasterJobHandler.instance,{bandIds:n}=this;if(s){r&&(this.symbolizer.bind(),await s.updateSymbolizer(this.symbolizer,t),this._cachedRendererJson=this.renderer.toJSON());const a=await s.symbolize({bandIds:n,...e},t);i={extent:e.extent,pixelBlock:a}}else i={extent:e.extent,pixelBlock:this.symbolizer.symbolize({bandIds:n,...e})}}return i}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeAngles)throw new b.Z("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=(0,p.TJ)(Be,e).clone(),async function(e,t,i){const r=t.toJSON();(0,a.pC)(r.angleName)&&(r.angleName=r.angleName.join(",")),(0,a.pC)(t.point)&&t.point.spatialReference?.imageCoordinateSystem&&(r.point.spatialReference=Ae(t.point.spatialReference)),(0,a.pC)(t.spatialReference)&&t.spatialReference.imageCoordinateSystem&&(r.spatialReference=Je(t.spatialReference));const s=(0,ve.en)(e),n=(0,ve.cv)({...s.query,f:"json",...r}),o=(0,ve.lA)(n,i),{data:l}=await(0,g.default)(`${s.path}/computeAngles`,o);return l.spatialReference=l.spatialReference?null!=l.spatialReference.geodataXform?new we.Z({wkid:0,imageCoordinateSystem:l.spatialReference}):we.Z.fromJSON(l.spatialReference):null,"NaN"===l.north&&(l.north=null),"NaN"===l.up&&(l.up=null),new Ce(l)}(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputePixelLocation)throw new b.Z("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=(0,p.TJ)(at,e).clone(),async function(e,t,i){const r=t.toJSON(),{geometries:s}=t;for(let e=0;e<s.length;e++)s[e].spatialReference?.imageCoordinateSystem&&(r.geometries.geometries[e].spatialReference=Ae(s[e].spatialReference));const n=(0,ve.en)(e),a=(0,ve.cv)({...n.query,f:"json",...r}),o=(0,ve.lA)(a,i),{data:l}=await(0,g.default)(`${n.path}/computePixelLocation`,o);return Te.fromJSON(l)}(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeHistograms)throw new b.Z("imagery-layer:compute-histograms","this operation is not supported on the input image service");e=(0,p.TJ)(et,e).clone();const{raster:i,mosaicRule:r,renderingRule:s}=this;return s&&null==e.renderingRule&&(e.renderingRule=s),r&&null==e.mosaicRule&&(e.mosaicRule=r),i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=await Ve(e,t,i),s=(0,ve.en)(e),{data:n}=await(0,g.default)(`${s.path}/computeHistograms`,r);return{histograms:n.histograms}}(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeStatisticsHistograms)throw new b.Z("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");e=(0,p.TJ)(et,e).clone();const{raster:i,mosaicRule:r,renderingRule:s}=this;return s&&null==e.renderingRule&&(e.renderingRule=s),r&&null==e.mosaicRule&&(e.mosaicRule=r),i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=await Ve(e,t,i),s=(0,ve.en)(e),{data:n}=await(0,g.default)(`${s.path}/computeStatisticsHistograms`,r),{statistics:a}=n;return a?.length&&a.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:a,histograms:n.histograms}}(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return(0,a.pC)(t)?t.get(e):void 0}getFieldDomain(e,t){const i=this.getField(e);return i?i.domain:null}fetchImage(e,t,i,r={}){if(null==e||null==t||null==i)return Promise.reject(new b.Z("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required."));const s=this.renderer||this.symbolizer?this.generateRasterInfo(this.renderingRule,{signal:r.signal}):null;return(0,l.gx)(s).then((s=>{s&&(this.rasterInfo=s);const n={imageServiceParameters:this.getExportImageServiceParameters(e,t,i,r.timeExtent),imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:r.requestAsImageElement&&!this.pixelFilter||!1,signal:r.signal};return this._requestArrayBuffer(n)}))}fetchKeyProperties(e){return(0,g.default)(this.parsedUrl.path+"/keyProperties",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.renderingRule:null})}).then((e=>e.data))}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new b.Z("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):(0,g.default)(this.parsedUrl.path+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.renderingRule:null})}).then((e=>Se.default.fromJSON(e.data)))}getCatalogItemRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return async function(e,t,i){const r=(0,ve.en)(e),s=(0,ve.cv)({...r.query,f:"json"}),n=(0,ve.lA)(s,i),a=`${r.path}/${t}/info`,o=(0,g.default)(`${a}`,n),l=(0,g.default)(`${a}/keyProperties`,n),u=await Promise.allSettled([o,l]),p="fulfilled"===u[0].status?u[0].value.data:null,c="fulfilled"===u[1].status?u[1].value.data:null;let m=null;p.statistics?.length&&(m=p.statistics.map((e=>({min:e[0],max:e[1],avg:e[2],stddev:e[3]}))));const d=ze.Z.fromJSON(p.extent),h=Math.ceil(d.width/p.pixelSizeX-.1),y=Math.ceil(d.height/p.pixelSizeY-.1),f=d.spatialReference,b=new ie.Z({x:p.pixelSizeX,y:p.pixelSizeY,spatialReference:f}),R=p.histograms?.length?p.histograms:null,v=new Ge.Z({origin:p.origin,blockWidth:p.blockWidth,blockHeight:p.blockHeight,firstPyramidLevel:p.firstPyramidLevel,maximumPyramidLevel:p.maxPyramidLevel});return new me.Z({width:h,height:y,bandCount:p.bandCount,extent:d,spatialReference:f,pixelSize:b,pixelType:p.pixelType.toLowerCase(),statistics:m,histograms:R,keyProperties:c,storageInfo:v})}(this.parsedUrl.path,e,i)}async getCatalogItemICSInfo(e,t){const{data:i}=await(0,g.default)(this.parsedUrl.path+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),r=i&&i.ics;if(!r)return;let s=null;try{s=(await(0,g.default)(this.parsedUrl.path+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!s||!s.spatialReference)return{ics:r,icsToPixelTransform:null,icsExtent:null,northDirection:null};const n=this.version>=10.7?(0,g.default)(this.parsedUrl.path+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then((e=>e.data)).catch((()=>({}))):{},a=s.spatialReference,o={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[s]}),inSR:a.wkid||JSON.stringify(a),outSR:"0:"+e},l=(0,g.default)(this.parsedUrl.path+"/project",{query:this._getQueryParams(o),...t}).then((e=>e.data)).catch((()=>({}))),u=(s.xmin+s.xmax)/2,p=(s.ymax-s.ymin)/6,c=s.ymin+p,m=[];for(let e=0;e<5;e++)m.push({x:u,y:c+p*e});const d={geometries:JSON.stringify({geometryType:"esriGeometryPoint",geometries:m}),inSR:a.wkid||JSON.stringify(a),outSR:"0:"+e},h=(0,g.default)(this.parsedUrl.path+"/project",{query:this._getQueryParams(d),...t}).then((e=>e.data)).catch((()=>({}))),y=await Promise.all([n,l,h]);let f=y[0].ipxf;if(null==f){const e=r.geodataXform?.xf_0;"topup"===e?.name?.toLowerCase()&&6===e?.coefficients?.length&&(f={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:e.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const b=ze.Z.fromJSON(y[1]&&y[1].geometries&&y[1].geometries[0]);b&&(b.spatialReference=new we.Z({wkid:0,imageCoordinateSystem:r}));const R=y[2].geometries?y[2].geometries.filter((e=>null!=e&&null!=e.x&&null!=e.y&&"NaN"!==e.x&&"NaN"!==e.y)):[],v=R.length;if(v<3)return{ics:r,icsToPixelTransform:f,icsExtent:b,northDirection:null};let w=0,_=0,C=0,S=0;for(let e=0;e<v;e++)w+=R[e].x,_+=R[e].y,C+=R[e].x*R[e].x,S+=R[e].x*R[e].y;const I=(v*S-w*_)/(v*C-w*w);let x=0;const F=R[4].x>R[0].x,T=R[4].y>R[0].y;return I===1/0?x=T?90:270:0===I?x=F?0:180:I>0?x=F?180*Math.atan(I)/Math.PI:180*Math.atan(I)/Math.PI+180:I<0&&(x=T?180+180*Math.atan(I)/Math.PI:360+180*Math.atan(I)/Math.PI),{ics:r,icsToPixelTransform:f,icsExtent:b,northDirection:x}}async generateRasterInfo(e,t){if((!e||"none"===e?.functionName?.toLowerCase()||this._isVectorFieldResampleFunction(e))&&(0,a.pC)(this.serviceRasterInfo))return this.serviceRasterInfo;const i=function(e){if(!e)return null;const t=JSON.stringify(e).match(/"rasterFunction":"(.*?")/gi)?.map((e=>e.replace('"rasterFunction":"',"").replace('"',"")));return t?t.join("/"):null}(e);if(this._functionRasterInfos[i])return this._functionRasterInfos[i];const r=this._generateRasterInfo(e,t);this._functionRasterInfos[i]=r;try{return await r}catch{return this._functionRasterInfos[i]=null,null}}getExportImageServiceParameters(e,t,i,r){const s=Je((e=e.clone().shiftCentralMeridian()).spatialReference,this.parsedUrl.path);(0,a.pC)(this.serviceRasterInfo)&&this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const n=this.exportImageServiceParameters.toJSON(),{bandIds:o,noData:l}=n;let{renderingRule:u}=n;const p=this.renderingRule?.rasterFunctionDefinition,c=!this.renderer||"raster-stretch"===this.renderer.type;if(o?.length&&this._hasRenderingRule(this.renderingRule)&&!p&&c){const e={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:o}};if("Stretch"===u.rasterFunction)e.rasterFunctionArguments.Raster=u.rasterFunctionArguments.Raster,u.rasterFunctionArguments.Raster=e;else if("Colormap"===u.rasterFunction){const t=u.rasterFunctionArguments.Raster;"Stretch"===t?.rasterFunction?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,u.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=u,u=e;n.bandIds=void 0}else n.bandIds=o?.join(",");l instanceof Array&&l.length>0&&(n.noData=l.join(","));const m=this._serviceSupportsMosaicRule?this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,r):null;n.mosaicRule=m&&JSON.stringify(m),n.renderingRule=this._getRenderingRuleString(A.fromJSON(u));const d={};if(r){const{start:e,end:t}=r.toJSON();e&&t&&e===t?d.time=""+e:null==e&&null==t||(d.time=`${e??"null"},${t??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:s,imageSR:s,size:t+","+i,...n,...d}}async getSamples(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsGetSamples)throw new b.Z("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=(0,p.TJ)(ut,e).clone();const{raster:i}=this;return i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=t.toJSON();Oe(r),r.outFields?.length&&(r.outFields=r.outFields.join(","));const s=(await(0,Re.aX)(t.geometry))?.[0];(0,a.pC)(s)&&(r.geometry=s.toJSON());const n=(0,ve.en)(e),o=(0,ve.cv)({...n.query,f:"json",...r}),l=(0,ve.lA)(o,i),{data:u}=await(0,g.default)(`${n.path}/getSamples`,l),p=u?.samples?.map((e=>{const t="NaN"===e.value||""===e.value?null:e.value.split(" ").map((e=>Number(e)));return{...e,pixelValue:t}}));return je.fromJSON({samples:p})}(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsIdentify)throw new b.Z("imagery-layer:query-rasters","query operation is not supported on the input image service");e=(0,p.TJ)(rt,e).clone();const{raster:i,mosaicRule:r,renderingRule:s}=this;if(s&&null==e.renderingRule&&(e.renderingRule=s),r&&null==e.mosaicRule){const t=this._combineMosaicRuleWithTimeExtent(r,e.timeExtent);e.mosaicRule=(0,a.Wg)(t)}return i&&null==e.raster&&(e.raster=i),Me(this.url,e,this._getRequestOptions(t))}createQuery(){const e=new ke.Z;return e.outFields=["*"],e.returnGeometry=!0,e.where=this.definitionExpression||"1=1",e}async queryRasters(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,qe.e)(this.url,e,t)}async queryObjectIds(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,He.G)(this.url,e,t)}async queryRasterCount(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,Ue.P)(this.url,e,t)}async queryVisibleRasters(e,t){if(!e)throw new b.Z("imagery-layer: query-visible-rasters","missing query parameter");const{pixelSize:i,returnDomainValues:r,returnTopmostRaster:s,showNoDataRecords:n}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let o=!1,l=null,u=null;const p="raster.servicepixelvalue",c=this._rasterFunctionNamesIndex;if((0,a.pC)(e.outFields)&&(o=e.outFields.some((e=>!e.toLowerCase().includes(p))),this.version>=10.4)){const t=e.outFields.filter((e=>e.toLowerCase().includes(p)&&e.length>p.length)).map((e=>{const t=e.slice(p.length+1);return[this._updateRenderingRulesFunctionName(t,c),t]}));l=t.map((e=>new A({functionName:e[0]}))),u=t.map((e=>e[1])),0===l.length?this.renderingRule?(l.push(this.renderingRule),u.push(this.renderingRule.functionName)):l=null:this.renderingRule&&!l.some((e=>e.functionName===this.renderingRule.functionName))&&(l.push(this.renderingRule),u.push(this.renderingRule.functionName))}const m=(0,a.Wi)(e.outSpatialReference)||e.outSpatialReference.equals(this.spatialReference),d=e.timeExtent||this.timeExtent,h=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,d),y=this._getQueryParams({geometry:e.geometry,timeExtent:d,mosaicRule:h,renderingRule:this.version<10.4?this.renderingRule:null,renderingRules:l,pixelSize:i,returnCatalogItems:o,returnGeometry:m,raster:this.raster,maxItemCount:s?1:null});delete y.f;const f=new rt(y);try{await this.generateRasterInfo(this.renderingRule);const i=await Me(this.url,f,{signal:t?.signal,query:{...this.customParameters}}),s=e.outFields,l=i.value.toLowerCase().includes("nodata");if(!o||m||!i?.catalogItems?.features.length||!n&&l)return this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:n,templateFields:s});const p=this.objectIdField||"ObjectId",c=i.catalogItems.features,d=c.map((e=>e.attributes?.[p])),h=new ke.Z({objectIds:d,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[p]}),y=await this.queryRasters(h);return y?.features?.length&&y.features.forEach((t=>{c.forEach((i=>{i.attributes[p]===t.attributes[p]&&(i.geometry=new Ze.Z(t.geometry),(0,a.pC)(e.outSpatialReference)&&(i.geometry.spatialReference=e.outSpatialReference))}))})),this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:n,templateFields:s})}catch{throw new b.Z("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const i=(0,g.default)(this.parsedUrl.path+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.statistics)),r=(0,g.default)(this.parsedUrl.path+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.histograms)),s=await Promise.all([i,r]);return s[0]&&s[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:s[0]||null,histograms:s[1]||null}}async createFlowMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createFlowMesh(e,t):(0,pt.GE)(e.meshType,e.simulationSettings,e.flowData,(0,a.pC)(t.signal)?t.signal:(new AbortController).signal)}async _fetchService(e){await this._fetchServiceInfo(e),(0,a.pC)(this.serviceRasterInfo)&&!this.rasterInfo&&(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,i=(0,a.pC)(this.serviceRasterInfo)?Promise.resolve(this.serviceRasterInfo):(0,Qe.g)(this.parsedUrl.path,t,{signal:e,query:this._getQueryParams()}).then((e=>(this._set("serviceRasterInfo",e),e))),r=this._hasRenderingRule(this.renderingRule)?this.generateRasterInfo(this.renderingRule,{signal:e}):null,s=this._getRasterFunctionInfos();return Promise.all([i,r,s]).then((e=>{e[1]?this._set("rasterInfo",e[1]):this._set("rasterInfo",e[0]),e[2]&&this._set("rasterFunctionInfos",e[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),w.Z.getLogger(this.declaredClass).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.addHandles((0,_.YP)((()=>this.renderingRule),(e=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this.generateRasterInfo(e).then((e=>{e&&(this.rasterInfo=e)}))})));const{serviceRasterInfo:t}=this;(0,a.pC)(t)&&t.multidimensionalInfo&&this._updateMultidimensionalDefinition(t)}))}_combineMosaicRuleWithTimeExtent(e,t){const i=this.timeInfo;if((0,a.Wi)(e)||(0,a.Wi)(this.multidimensionalInfo)||(0,a.Wi)(t)||(0,a.Wi)(i?.startField))return e;const{startField:r}=i,s=this.multidimensionalInfo.variables.some((e=>e.dimensions.some((e=>e.name===r))))?r:"StdTime";if(e=e.clone(),"mosaic-dataset"===this._serviceSourceType)return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter((e=>e.dimensionName!==s)),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const n=e.multidimensionalDefinition.filter((e=>e.dimensionName===s)),o=(0,a.pC)(t.start)?t.start.getTime():null,l=(0,a.pC)(t.end)?t.end.getTime():null,u=null==o||null==l||o===l,p=u?[o||l]:[[o,l]],c=this.version>=10.8;if(n.length)n.forEach((e=>{e.dimensionName===s&&(c?(e.dimensionName=null,e.isSlice=null,e.values=null):(e.isSlice=u,e.values=p))}));else if(!c){const t=e.multidimensionalDefinition.filter((e=>null!=e.variableName&&null==e.dimensionName));t.length?t.forEach((e=>{e.dimensionName=s,e.isSlice=u,e.values=p})):e.multidimensionalDefinition.push(new x.Z({variableName:"",dimensionName:s,isSlice:u,values:p}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return(0,a.Wi)(e)?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter((e=>!(!e.variableName&&!e.dimensionName))),0===e.multidimensionalDefinition.length&&(e.multidimensionalDefinition=null)),"mosaic-dataset"!==this._serviceSourceType&&null==e.multidimensionalDefinition?null:e)}async _prepareForQuery(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsQuery)throw new b.Z("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=(0,a.pC)(e)?(0,p.TJ)(ke.Z,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new de.Z;this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e}),(()=>null)),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:t,renderingRule:i}=this;return"unique-value"===e.type&&this._hasRenderingRule(i)&&1===t.bandCount&&["u8","s8"].includes(t.pixelType)||(0,ge.U0)(this.rasterInfo).includes(this.renderer.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let t=this.sourceJSON;if(!t){const{data:i,ssl:r}=await(0,g.default)(this.parsedUrl.path,{query:this._getQueryParams(),signal:e});t=i,this.sourceJSON=t,r&&(this.url=this.url.replace(/^http:/i,"https:"))}if(t.capabilities?.toLowerCase().split(",").map((e=>e.trim())).indexOf("tilesonly")>-1)throw new b.Z("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?"esriImageServiceSourceTypeMosaicDataset"===e.serviceSourceType:e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const t=this._isMosaicDataset(e),i=e.currentVersion>=10.71&&e.hasMultidimensions&&e.timeInfo&&!(e.objectIdField&&e.fields?.length>1);return t||i}_isVectorFieldResampleFunction(e){if((0,a.Wi)(e))return!1;const{functionName:t,functionArguments:i}=e,r="resample"===t?.toLowerCase(),s=i?.ResampleType||i?.resampleType;return r&&(7===s||10===s)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){if(!this._isPicture()&&!this.pixelFilter||this._isVectorDataSet()){if(!this.bandIds&&this.rasterInfo.bandCount>=3){const e=(0,ge.YD)(this.rasterInfo);!e||3===this.rasterInfo.bandCount&&0===e[0]&&1===e[1]&&2===e[2]||(this.bandIds=e)}e||(e=(0,ge.Ob)(this.rasterInfo,{bandIds:this.bandIds,variableName:this.renderingRule?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}));const t=(0,ge.ol)(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=t,this.symbolizer.rasterInfo=this.rasterInfo):this.symbolizer=new be.Z({rendererJSON:t,rasterInfo:this.rasterInfo}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return null==e?e:{extent:e.extent&&e.extent.clone(),pixelBlock:(0,a.pC)(e.pixelBlock)&&e.pixelBlock.clone()}}_getQueryParams(e){(0,a.pC)(e?.renderingRule)&&"string"!=typeof e.renderingRule&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:i}=this;return{raster:t,viewId:i,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,t,i){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):(0,ye.J)(e,t,i)}async _getRasterFunctionInfos(e){const t=this.sourceJSON.rasterFunctionInfos;return this.serviceRasterInfo?t:t&&this.version>=10.3?1===t.length&&"none"===t[0].name.toLowerCase()?t:(await(0,g.default)(this.parsedUrl.path+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data?.rasterFunctionInfos:null}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:i,signal:r}=e;if(i&&!this.pixelFilter&&t.format?.indexOf("png")>-1)return{imageElement:(await(0,g.default)(this.parsedUrl.path+"/exportImage",{responseType:"image",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:r})).data,params:t};const s=this._initJobHandler(),n=(0,g.default)(this.parsedUrl.path+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:r}),a=(await Promise.all([n,s]))[0].data,o=t.format||"jpgpng";let l=o;if("bsq"!==l&&"bip"!==l&&(l=(0,ye.y)(a)),!l)throw new b.Z("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(a)));const u={signal:r},p="gif"===o||"bmp"===o||o.includes("png")&&("png"===l||"jpg"===l)?(0,ye.J)(a,{useCanvas:!0,...t},u):this._decodePixelBlock(a,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:o},u);return{pixelData:{pixelBlock:await p,extent:t.extent},params:t}}_generateRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return(0,Qe.N)(this.parsedUrl.path,e,i)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this._defaultServiceMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;const t=(0,he.Tj)(e);if((0,a.pC)(t)&&t.length>0){this.mosaicRule=this.mosaicRule||new ae;const e=this.mosaicRule.multidimensionalDefinition;(!e||e&&e.length<=0)&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,t){t=t||{};const i=e.value,{templateRRFunctionNames:r,showNoDataRecords:s,returnDomainValues:n,templateFields:o}=t,l=e.processedValues;let u=e.catalogItems&&e.catalogItems.features,p=e.properties&&e.properties.Values&&e.properties.Values.map((e=>e.replace(/ /gi,", ")))||[];const c=this.objectIdField||"ObjectId",m="string"==typeof i&&i.toLowerCase().includes("nodata"),d=[];if(i&&!u&&!m){const e={};e[c]=0,p=[i],u=[new y.Z(this.fullExtent,null,e)]}if(!u)return[];let h,f,g;this._updateResponseFieldNames(u,o),m&&!s&&(u=[]);for(let e=0;e<u.length;e++){if(h=u[e],null!=i){if(f=p[e],g=this.renderingRule&&l&&l.length>0&&r&&r.length>0&&r.includes(this.renderingRule.functionName)?l[r.indexOf(this.renderingRule.functionName)]:i,"nodata"===f.toLowerCase()&&!s)continue;const t="Raster.ItemPixelValue",n="Raster.ServicePixelValue";h.attributes[t]=f,h.attributes[n]=g,this._updateFeatureWithMagDirValues(h,f);const o=this.fields&&this.fields.length>0;let u=this.renderingRule&&(0,a.pC)(this.serviceRasterInfo)&&this.serviceRasterInfo.attributeTable?o?f:i:g;this.renderingRule||(u=o?f:i),this._updateFeatureWithRasterAttributeTableValues(h,u)}if(h.sourceLayer=h.layer=this,n&&this._updateFeatureWithDomainValues(h),r&&l&&r.length===l.length)for(let e=0;e<r.length;e++){const t="Raster.ServicePixelValue."+r[e];h.attributes[t]=l[e]}d.push(u[e])}return d}_updateFeatureWithRasterAttributeTableValues(e,t){const i=this.rasterInfo&&this.rasterInfo.attributeTable||((0,a.pC)(this.serviceRasterInfo)?this.serviceRasterInfo.attributeTable:null);if((0,a.Wi)(i))return;const{features:r,fields:s}=i,n=s.map((e=>e.name)).filter((e=>"value"===e.toLowerCase())),o=n&&n[0];if(!o)return;const l=r.filter((e=>e.attributes[o]===(null!=t?parseInt(t,10):null)));l&&l[0]&&s.forEach((t=>{const i=this.rasterAttributeTableFieldPrefix+t.name;e.attributes[i]=l[0].attributes[t.name]}))}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const i=t.split(/,\s*/).map((e=>parseFloat(e))),r=i.map((e=>[e])),s=i.map((e=>({minValue:e,maxValue:e,noDataValue:null}))),n=new ce.Z({height:1,width:1,pixelType:"f32",pixels:r,statistics:s});null!=this.pixelFilter&&this.pixelFilter({pixelBlock:n,extent:new ze.Z(0,0,0,0,this.spatialReference)});const a="esriImageServiceDataTypeVector-MagDir"===this.serviceDataType?[n.pixels[0][0],n.pixels[1][0]]:(0,fe.Tg)([n.pixels[0][0],n.pixels[1][0]]);e.attributes["Raster.Magnitude"]=a[0],e.attributes["Raster.Direction"]=a[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter((e=>e.domain&&"coded-value"===e.domain.type));null!=t&&t.forEach((t=>{const i=e.attributes[t.name];if(null!=i){const r=t.domain.codedValues.find((e=>e.code===i));r&&(e.attributes[t.name]=r.name)}}))}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const i=this.fieldsIndex;(0,a.Wi)(i)||e.forEach((e=>{if(e&&e.attributes)for(const r of t)if(i.has(r)){const t=i.get(r).name;t!==r&&(e.attributes[r]=e.attributes[t],delete e.attributes[t])}}))}_getRenderingRuleString(e){if(this._hasRenderingRule(e)){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRenderingRule(e){return e&&e.functionName&&"none"!==e.functionName.toLowerCase()}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if("Raw"===e)return e.replace("Raw","None");const i=e.toLowerCase().replace(/ /gi,"_");return t.has(i)?t.get(i):e}_isRFTJson(e){return e&&e.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return"esriImageServiceDataTypeVector-UV"===this.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===this.serviceDataType}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map((e=>e.trim())):["image","catalog"],{currentVersion:i,advancedQueryCapabilities:r,maxRecordCount:s}=e,n=t.includes("image"),a="esriImageServiceDataTypeElevation"===e.serviceDataType,o=!!(e.spatialReference||e.extent&&e.extent.spatialReference),l=t.includes("edit");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:n,supportsExportImage:n,supportsIdentify:n,supportsMeasure:t.includes("mensuration")&&o,supportsDownload:t.includes("download"),supportsQuery:t.includes("catalog")&&e.fields&&e.fields.length>0,supportsGetSamples:i>=10.2&&n,supportsProject:i>=10.3&&n,supportsComputeStatisticsHistograms:i>=10.4&&n,supportsQueryBoundary:i>=10.6&&n,supportsCalculateVolume:i>=10.7&&a,supportsComputePixelLocation:i>=10.7&&t.includes("catalog"),supportsComputeAngles:i>=10.91,supportsAdd:l,supportsDelete:l,supportsEditing:l,supportsUpdate:l,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!1},query:{maxRecordCount:s,maxRecordCountFactor:void 0,supportsStatistics:!!r?.supportsStatistics,supportsOrderBy:!!r?.supportsOrderBy,supportsDistinct:!!r?.supportsDistinct,supportsPagination:!!r?.supportsPagination,supportsStandardizedQueriesOnly:!!r?.useStandardizedQueries,supportsPercentileStatistics:!!r?.supportsPercentileStatistics,supportsCentroid:!!r?.supportsReturningGeometryCentroid,supportsDistance:!!r?.supportsQueryWithDistance,supportsExtent:!!r?.supportsReturningQueryExtent,supportsGeometryProperties:!!r?.supportsReturningGeometryProperties,supportsHavingClause:!!r?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!r?.supportsDefaultSR,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}}}};return(0,s._)([(0,u.Cb)()],t.prototype,"_functionRasterInfos",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,s._)([(0,u.Cb)({dependsOn:["_serviceSupportsMosaicRule"]})],t.prototype,"_defaultServiceMosaicRule",void 0),(0,s._)([(0,S.r)("_defaultServiceMosaicRule",["defaultMosaicMethod"])],t.prototype,"readDefaultServiceMosaicRule",null),(0,s._)([(0,u.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_serviceSourceType",void 0),(0,s._)([(0,S.r)("_serviceSourceType",["serviceSourceType","fields"])],t.prototype,"readServiceSourceType",null),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_serviceSupportsMosaicRule",void 0),(0,s._)([(0,S.r)("_serviceSupportsMosaicRule",["currentVersion","fields"])],t.prototype,"readServiceSupportsMosaicRule",null),(0,s._)([(0,u.Cb)()],t.prototype,"rasterAttributeTableFieldPrefix",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_rasterFunctionNamesIndex",null),(0,s._)([(0,u.Cb)()],t.prototype,"adjustAspectRatio",void 0),(0,s._)([(0,u.Cb)({type:[p.z8],json:{write:!0}})],t.prototype,"bandIds",void 0),(0,s._)([(0,S.r)("bandIds")],t.prototype,"readBandIds",null),(0,s._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],t.prototype,"capabilities",void 0),(0,s._)([(0,S.r)("service","capabilities",["capabilities","currentVersion","serviceDataType"])],t.prototype,"readCapabilities",null),(0,s._)([(0,u.Cb)({type:Number})],t.prototype,"compressionQuality",void 0),(0,s._)([(0,m.c)("compressionQuality")],t.prototype,"writeCompressionQuality",null),(0,s._)([(0,u.Cb)({type:Number})],t.prototype,"compressionTolerance",void 0),(0,s._)([(0,m.c)("compressionTolerance")],t.prototype,"writeCompressionTolerance",null),(0,s._)([(0,u.Cb)({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,s._)([(0,u.Cb)({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),(0,s._)([(0,u.Cb)({readOnly:!0,constructOnly:!0})],t.prototype,"exportImageServiceParameters",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"rasterInfo",void 0),(0,s._)([(0,u.Cb)({readOnly:!0,type:[ue.Z]})],t.prototype,"fields",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"fieldsIndex",null),(0,s._)([(0,u.Cb)({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],t.prototype,"format",null),(0,s._)([(0,S.r)("service","format",["serviceDataType"])],t.prototype,"readFormat",null),(0,s._)([(0,u.Cb)({type:ze.Z})],t.prototype,"fullExtent",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"hasMultidimensions",void 0),(0,s._)([(0,u.Cb)({json:{read:{source:"maxImageHeight"}}})],t.prototype,"imageMaxHeight",void 0),(0,s._)([(0,u.Cb)({json:{read:{source:"maxImageWidth"}}})],t.prototype,"imageMaxWidth",void 0),(0,s._)([(0,u.Cb)({type:String,json:{type:oe.c.jsonValues,read:oe.c.read,write:oe.c.write}})],t.prototype,"interpolation",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"minScale",void 0),(0,s._)([(0,S.r)("service","minScale")],t.prototype,"readMinScale",null),(0,s._)([(0,u.Cb)()],t.prototype,"maxScale",void 0),(0,s._)([(0,S.r)("service","maxScale")],t.prototype,"readMaxScale",null),(0,s._)([(0,u.Cb)({type:ae})],t.prototype,"mosaicRule",null),(0,s._)([(0,S.r)("mosaicRule",["mosaicRule","defaultMosaicMethod"])],t.prototype,"readMosaicRule",null),(0,s._)([(0,m.c)("mosaicRule")],t.prototype,"writeMosaicRule",null),(0,s._)([(0,u.Cb)()],t.prototype,"multidimensionalInfo",null),(0,s._)([(0,u.Cb)({json:{type:p.z8}})],t.prototype,"noData",void 0),(0,s._)([(0,m.c)("noData")],t.prototype,"writeNoData",null),(0,s._)([(0,u.Cb)({type:String,json:{type:oe.k.jsonValues,read:oe.k.read,write:oe.k.write}})],t.prototype,"noDataInterpretation",void 0),(0,s._)([(0,u.Cb)({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],t.prototype,"objectIdField",void 0),(0,s._)([(0,S.r)("objectIdField")],t.prototype,"readObjectIdField",null),(0,s._)([(0,u.Cb)({})],t.prototype,"geometryType",void 0),(0,s._)([(0,u.Cb)({})],t.prototype,"typeIdField",void 0),(0,s._)([(0,u.Cb)({})],t.prototype,"types",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"parsedUrl",null),(0,s._)([(0,u.Cb)({type:Function})],t.prototype,"pixelFilter",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"raster",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"viewId",void 0),(0,s._)([(0,u.Cb)({types:f.dr,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:f.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"renderer",null),(0,s._)([(0,S.r)("renderer")],t.prototype,"readRenderer",null),(0,s._)([(0,m.c)("renderer")],t.prototype,"writeRenderer",null),(0,s._)([(0,u.Cb)()],t.prototype,"symbolizer",void 0),(0,s._)([(0,u.Cb)(I.Oh)],t.prototype,"opacity",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"rasterFields",null),(0,s._)([(0,u.Cb)({constructOnly:!0})],t.prototype,"rasterFunctionInfos",void 0),(0,s._)([(0,u.Cb)({type:A})],t.prototype,"renderingRule",null),(0,s._)([(0,S.r)("renderingRule",["renderingRule","rasterFunctionInfos"])],t.prototype,"readRenderingRule",null),(0,s._)([(0,m.c)("renderingRule")],t.prototype,"writeRenderingRule",null),(0,s._)([(0,u.Cb)()],t.prototype,"serviceDataType",void 0),(0,s._)([(0,u.Cb)({readOnly:!0,type:we.Z})],t.prototype,"spatialReference",void 0),(0,s._)([(0,S.r)("spatialReference",["spatialReference","extent"])],t.prototype,"readSpatialReference",null),(0,s._)([(0,u.Cb)({json:{type:ct.jsonValues}})],t.prototype,"pixelType",void 0),(0,s._)([(0,S.r)("pixelType")],t.prototype,"readPixelType",null),(0,s._)([(0,m.c)("pixelType")],t.prototype,"writePixelType",null),(0,s._)([(0,u.Cb)({constructOnly:!0,type:me.Z})],t.prototype,"serviceRasterInfo",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"sourceJSON",void 0),(0,s._)([(0,u.Cb)(I.HQ)],t.prototype,"url",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,s._)([(0,S.r)("version",["currentVersion","fields","timeInfo"])],t.prototype,"readVersion",null),t=(0,s._)([(0,c.j)("esri.layers.mixins.ArcGISImageService")],t),t};var yt=i(17287),ft=i(71612),gt=i(17017),bt=i(38009),Rt=i(16859),vt=i(34760),wt=i(72965),_t=i(28294),Ct=i(60199),St=i(32163);let It=class extends((0,ft.h)((0,_t.n)((0,vt.Q)((0,wt.M)((0,bt.q)((0,Rt.I)(ht((0,gt.N)((0,yt.Y)((0,o.R)(d.Z))))))))))){constructor(...e){super(...e),this.legendEnabled=!0,this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery"}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=(0,a.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(l.r9).then((()=>this._fetchService(t)))),Promise.resolve(this)}writeOperationalLayerType(e,t,i){const r="vector-field"===this.renderer?.type;t[i]=r?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.rasterFields,i=this.title,r=new Set;let s=!1,n=!1;this.capabilities&&(s=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,n="esriImageServiceDataTypeVector-UV"===this.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===this.serviceDataType);const a=new Set;s&&a.add("raster.itempixelvalue");for(const e of t){const t=e.name.toLowerCase();a.has(t)||t.includes("raster.servicepixelvalue.")||r.add(e.name)}return n&&r.add("raster.magnitude").add("raster.direction"),(0,St.eZ)({fields:t,title:i},{...e,visibleFieldNames:r})}queryFeatures(e,t){return this.queryRasters(e,t).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryFeatureCount(e,t){return this.queryRasterCount(e,t)}redraw(){this.emit("redraw")}serviceSupportsSpatialReference(e){return(0,Ct.D)(this,e)}};(0,s._)([(0,u.Cb)(I.rn)],It.prototype,"legendEnabled",void 0),(0,s._)([(0,u.Cb)({type:["show","hide"]})],It.prototype,"listMode",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],It.prototype,"isReference",void 0),(0,s._)([(0,u.Cb)({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],It.prototype,"operationalLayerType",void 0),(0,s._)([(0,m.c)("web-map","operationalLayerType")],It.prototype,"writeOperationalLayerType",null),(0,s._)([(0,u.Cb)(I.C_)],It.prototype,"popupEnabled",void 0),(0,s._)([(0,u.Cb)({type:n.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],It.prototype,"popupTemplate",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],It.prototype,"defaultPopupTemplate",null),(0,s._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],It.prototype,"type",void 0),It=(0,s._)([(0,c.j)("esri.layers.ImageryLayer")],It);const xt=It},17287:(e,t,i)=>{i.d(t,{Y:()=>u});var r=i(43697),s=i(92604),n=i(70586),a=i(5600),o=(i(67676),i(80442),i(75215),i(52011)),l=i(66677);const u=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.Qc)(this.url);if((0,n.pC)(e)&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Nm)(e,s.Z.getLogger(this.declaredClass)))}};return(0,r._)([(0,a.Cb)()],t.prototype,"title",null),(0,r._)([(0,a.Cb)({type:String})],t.prototype,"url",null),t=(0,r._)([(0,o.j)("esri.layers.mixins.ArcGISService")],t),t}},16859:(e,t,i)=>{i.d(t,{I:()=>R});var r=i(43697),s=i(40330),n=i(3172),a=i(66643),o=i(20102),l=i(92604),u=i(70586),p=i(95330),c=i(17452),m=i(5600),d=(i(67676),i(80442),i(75215),i(71715)),h=i(52011),y=i(30556),f=i(65587),g=i(15235),b=i(86082);const R=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){this.portalItem?.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new g.default({id:t.itemId,portal:i&&i.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const r=await i.e(8062).then(i.bind(i,18062));return(0,p.k_)(t),await r.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,p.D_)(e)||l.Z.getLogger(this.declaredClass).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const i=v.credential===t?v.user:await this._fetchEditingUser(e);return v.credential=t,v.user=i,(0,u.Wi)(i)||null==i.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=s.id.findServerInfo(this.url);if(!i?.owningSystemUrl)return null;const r=`${i.owningSystemUrl}/sharing/rest`,o=f.Z.getDefault();if(o&&o.loaded&&(0,c.Fv)(o.restUrl)===(0,c.Fv)(r))return o.user;const l=`${r}/community/self`,p=(0,u.pC)(e)?e.signal:null,m=await(0,a.q6)((0,n.default)(l,{authMode:"no-prompt",query:{f:"json"},signal:p}));return m.ok?b.default.fromJSON(m.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t&&t.portal,r=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||f.Z.getDefault());return i&&r&&!(0,c.tm)(r.restUrl,i.restUrl)?(t.messages&&t.messages.push(new o.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r._)([(0,m.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,r._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,y.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,m.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,m.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,r._)([(0,h.j)("esri.layers.mixins.PortalLayer")],t),t},v={credential:null,user:null}},41818:(e,t,i)=>{i.d(t,{P:()=>a});var r=i(11282),s=i(34599),n=i(57444);async function a(e,t,i){const a=(0,r.en)(e);return(0,s.executeQueryForCount)(a,n.Z.from(t),{...i}).then((e=>e.data.count))}},5396:(e,t,i)=>{i.d(t,{G:()=>a});var r=i(11282),s=i(34599),n=i(57444);async function a(e,t,i){const a=(0,r.en)(e);return(0,s.executeQueryForIds)(a,n.Z.from(t),{...i}).then((e=>e.data.objectIds))}},4967:(e,t,i)=>{i.d(t,{F:()=>l,e:()=>o});var r=i(11282),s=i(34599),n=i(74889),a=i(57444);async function o(e,t,i){const r=await l(e,t,i);return n.default.fromJSON(r)}async function l(e,t,i){const n=(0,r.en)(e),o={...i},l=a.Z.from(t),{data:u}=await(0,s.executeQuery)(n,l,l.sourceSpatialReference,o);return u}},98326:(e,t,i)=>{i.d(t,{Z:()=>c});var r,s=i(43697),n=i(96674),a=i(5600),o=(i(67676),i(80442),i(75215)),l=i(52011);const u={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let p=r=class extends n.wq{constructor(e){super(e),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:e}=this,t=function(e){const{exifInfo:t,exifName:i,tagName:r}=e;if(!t||!i||!r)return null;const s=t.find((e=>e.name===i));return s?function(e){const{tagName:t,tags:i}=e;if(!i||!t)return null;const r=i.find((e=>e.name===t));return r&&r.value||null}({tagName:r,tags:s.tags}):null}({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:e});return u[t]||null}clone(){return new r({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};(0,s._)([(0,a.Cb)({type:String})],p.prototype,"contentType",void 0),(0,s._)([(0,a.Cb)()],p.prototype,"exifInfo",void 0),(0,s._)([(0,a.Cb)({readOnly:!0})],p.prototype,"orientationInfo",null),(0,s._)([(0,a.Cb)({type:o.z8})],p.prototype,"id",void 0),(0,s._)([(0,a.Cb)({type:String})],p.prototype,"globalId",void 0),(0,s._)([(0,a.Cb)({type:String})],p.prototype,"keywords",void 0),(0,s._)([(0,a.Cb)({type:String})],p.prototype,"name",void 0),(0,s._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"parentGlobalId",void 0),(0,s._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"parentObjectId",void 0),(0,s._)([(0,a.Cb)({type:o.z8})],p.prototype,"size",void 0),(0,s._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"url",void 0),p=r=(0,s._)([(0,l.j)("esri.layers.support.AttachmentInfo")],p);const c=p}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6199],{10699:(e,t,r)=>{r.d(t,{IG:()=>o});var s=r(43697),i=r(52011);let l=0;const o=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+l++})}};return t=(0,s._)([(0,i.j)("esri.core.Identifiable")],t),t};let n=class extends(o(class{})){};n=(0,s._)([(0,i.j)("esri.core.Identifiable")],n)},16453:(e,t,r)=>{r.d(t,{R:()=>b,w:()=>w});var s=r(43697),i=r(15923),l=r(70586),o=r(41103),n=r(22974),a=r(31263);class p{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(a.kk),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new p,r=this._originStores[a.s3.DEFAULTS];r&&r.forEach(((e,r)=>{t.set(r,(0,n.d9)(e),a.s3.DEFAULTS)}));for(let r=a.s3.SERVICE;r<a.kk;r++){const s=this._originStores[r];s&&s.forEach(((s,i)=>{e&&e.has(i)||t.set(i,(0,n.d9)(s),r)}))}return t}get(e,t){const r=void 0===t?this._values:this._originStores[t];return r?r.get(e):void 0}keys(e){const t=null==e?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,r=a.s3.USER){let s=this._originStores[r];if(s||(s=new Map,this._originStores[r]=s),s.set(e,t),!this._values.has(e)||(0,l.j0)(this._propertyOriginMap.get(e))<=r){const s=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,r),s!==t}return!1}delete(e,t=a.s3.USER){const r=this._originStores[t];if(!r)return;const s=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const t=this._originStores[r];if(t&&t.has(e)){this._values.set(e,t.get(e)),this._propertyOriginMap.set(e,r);break}}}return s}has(e,t){const r=void 0===t?this._values:this._originStores[t];return!!r&&r.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const r=this._originStores[t],s=r&&r.get(e),i=this._values.get(e);return this._values.set(e,s),this._propertyOriginMap.set(e,t),i!==s}originOf(e){return this._propertyOriginMap.get(e)||a.s3.DEFAULTS}forEach(e){this._values.forEach(e)}}var u=r(50549),c=r(1153),h=r(52011);const d=e=>{let t=class extends e{constructor(...e){super(...e);const t=(0,l.j0)((0,c.vw)(this)),r=t.store,s=new p;t.store=s,(0,o.M)(t,r,s)}read(e,t){(0,u.i)(this,e,t)}getAtOrigin(e,t){const r=y(this),s=(0,a.M9)(t);if("string"==typeof e)return r.get(e,s);const i={};return e.forEach((e=>{i[e]=r.get(e,s)})),i}originOf(e){return(0,a.x3)(this.originIdOf(e))}originIdOf(e){return y(this).originOf(e)}revert(e,t){const r=y(this),s=(0,a.M9)(t),i=(0,c.vw)(this);let l;l="string"==typeof e?"*"===e?r.keys(s):[e]:e,l.forEach((e=>{i.invalidate(e),r.revert(e,s),i.commit(e)}))}};return t=(0,s._)([(0,h.j)("esri.core.ReadOnlyMultiOriginJSONSupport")],t),t};function y(e){return(0,c.vw)(e).store}let f=class extends(d(i.Z)){};f=(0,s._)([(0,h.j)("esri.core.ReadOnlyMultiOriginJSONSupport")],f);var v=r(76169);const g=e=>{let t=class extends e{constructor(...e){super(...e)}clear(e,t="user"){return m(this).delete(e,(0,a.M9)(t))}write(e={},t){return(0,v.c)(this,e=e||{},t),e}setAtOrigin(e,t,r){(0,c.vw)(this).setAtOrigin(e,t,(0,a.M9)(r))}removeOrigin(e){const t=m(this),r=(0,a.M9)(e),s=t.keys(r);for(const e of s)t.originOf(e)===r&&t.set(e,t.get(e,r),a.s3.USER)}updateOrigin(e,t){const r=m(this),s=(0,a.M9)(t),i=this.get(e);for(let t=s+1;t<a.kk;++t)r.delete(e,t);r.set(e,i,s)}toJSON(e){return this.write({},e)}};return t=(0,s._)([(0,h.j)("esri.core.WriteableMultiOriginJSONSupport")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function m(e){return(0,c.vw)(e).store}const b=e=>{let t=class extends(g(d(e))){constructor(...e){super(...e)}};return t=(0,s._)([(0,h.j)("esri.core.MultiOriginJSONSupport")],t),t};let w=class extends(b(i.Z)){};w=(0,s._)([(0,h.j)("esri.core.MultiOriginJSONSupport")],w)},87085:(e,t,r)=>{r.d(t,{Z:()=>b});var s=r(43697),i=(r(66577),r(3172)),l=r(20102),o=r(32448),n=r(10699),a=r(83379),p=r(92604),u=r(95330),c=r(17452),h=r(5600),d=(r(67676),r(80442),r(75215),r(52011)),y=r(68773),f=r(6570),v=r(82971);let g=0,m=class extends(o.Z.EventedMixin((0,n.IG)(a.Z))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new f.Z(-180,-90,180,90,v.Z.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=v.Z.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await r.e(3529).then(r.bind(r,63529))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},s=await Promise.all([r.e(4547),r.e(8008)]).then(r.bind(r,28008));try{return await s.fromItem(t)}catch(e){const r=t&&t.portalItem,s=r&&r.id||"unset",i=r&&r.portal&&r.portal.url||y.Z.portalUrl;throw p.Z.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+i+"', id: '"+s+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,u.D_)(e)||p.Z.getLogger(this.declaredClass).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){if(this.parent){const e=this,t=this.parent;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"baseLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){const e=this.url;return e?(0,c.mN)(e):null}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,i.default)(e,{query:{f:"json"},responseType:"json"})).data;throw new l.Z("layer:no-attribution-data","Layer does not have attribution data")}};(0,s._)([(0,h.Cb)({type:String})],m.prototype,"attributionDataUrl",void 0),(0,s._)([(0,h.Cb)({type:f.Z})],m.prototype,"fullExtent",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],m.prototype,"hasAttributionData",null),(0,s._)([(0,h.Cb)({type:String,clonable:!1})],m.prototype,"id",void 0),(0,s._)([(0,h.Cb)({type:Boolean,nonNullable:!0})],m.prototype,"legendEnabled",void 0),(0,s._)([(0,h.Cb)({type:["show","hide","hide-children"]})],m.prototype,"listMode",void 0),(0,s._)([(0,h.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0})],m.prototype,"opacity",void 0),(0,s._)([(0,h.Cb)({clonable:!1})],m.prototype,"parent",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],m.prototype,"parsedUrl",null),(0,s._)([(0,h.Cb)({type:Boolean})],m.prototype,"popupEnabled",void 0),(0,s._)([(0,h.Cb)({type:Boolean})],m.prototype,"attributionVisible",void 0),(0,s._)([(0,h.Cb)({type:v.Z})],m.prototype,"spatialReference",void 0),(0,s._)([(0,h.Cb)({type:String})],m.prototype,"title",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],m.prototype,"type",void 0),(0,s._)([(0,h.Cb)()],m.prototype,"url",void 0),(0,s._)([(0,h.Cb)({type:Boolean,nonNullable:!0})],m.prototype,"visible",void 0),m=(0,s._)([(0,d.j)("esri.layers.Layer")],m);const b=m},16199:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Z});var s=r(43697),i=(r(66577),r(3172)),l=r(20102),o=r(16453),n=r(19153),a=r(17452),p=r(5600),u=(r(67676),r(80442),r(75215),r(71715)),c=r(52011),h=r(30556),d=r(87085),y=r(71612),f=r(38009),v=r(16859),g=r(34760),m=r(72965),b=r(39450),w=r(11145),_=r(5833),S=r(6570),C=r(82971),O=r(13473);let I=class extends((0,y.h)((0,g.Q)((0,m.M)((0,f.q)((0,v.I)((0,o.R)(d.Z))))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new S.Z(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,C.Z.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=C.Z.WebMercator,this.subDomains=null,this.tileInfo=new w.Z({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new O.Z({x:-20037508.342787,y:20037508.342787,spatialReference:C.Z.WebMercator}),spatialReference:C.Z.WebMercator,lods:[new b.Z({level:0,scale:591657527.591555,resolution:156543.033928}),new b.Z({level:1,scale:295828763.795777,resolution:78271.5169639999}),new b.Z({level:2,scale:147914381.897889,resolution:39135.7584820001}),new b.Z({level:3,scale:73957190.948944,resolution:19567.8792409999}),new b.Z({level:4,scale:36978595.474472,resolution:9783.93962049996}),new b.Z({level:5,scale:18489297.737236,resolution:4891.96981024998}),new b.Z({level:6,scale:9244648.868618,resolution:2445.98490512499}),new b.Z({level:7,scale:4622324.434309,resolution:1222.99245256249}),new b.Z({level:8,scale:2311162.217155,resolution:611.49622628138}),new b.Z({level:9,scale:1155581.108577,resolution:305.748113140558}),new b.Z({level:10,scale:577790.554289,resolution:152.874056570411}),new b.Z({level:11,scale:288895.277144,resolution:76.4370282850732}),new b.Z({level:12,scale:144447.638572,resolution:38.2185141425366}),new b.Z({level:13,scale:72223.819286,resolution:19.1092570712683}),new b.Z({level:14,scale:36111.909643,resolution:9.55462853563415}),new b.Z({level:15,scale:18055.954822,resolution:4.77731426794937}),new b.Z({level:16,scale:9027.977411,resolution:2.38865713397468}),new b.Z({level:17,scale:4513.988705,resolution:1.19432856685505}),new b.Z({level:18,scale:2256.994353,resolution:.597164283559817}),new b.Z({level:19,scale:1128.497176,resolution:.298582141647617}),new b.Z({level:20,scale:564.248588,resolution:.14929107082380833}),new b.Z({level:21,scale:282.124294,resolution:.07464553541190416}),new b.Z({level:22,scale:141.062147,resolution:.03732276770595208}),new b.Z({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return"string"==typeof e?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then((()=>{let e="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const t=new a.R9(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&t.authority.includes("{subDomain}")&&(e="is missing 'subDomains' property")}else e="spatialReference must match tileInfo.spatialReference";else e="is missing the required 'urlTemplate' property value";if(e)throw new l.Z("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${e}`)}));return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){return e||t.fullExtent&&t.fullExtent.spatialReference&&C.Z.fromJSON(t.fullExtent.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:r}=this,s=new a.R9(t),i=s.scheme?s.scheme+"://":"//",l=i+s.authority+"/";if(s.authority.includes("{subDomain}")){if(r&&r.length>0&&s.authority.split(".").length>1)for(const t of r)e.push(i+s.authority.replace(/\{subDomain\}/gi,t)+"/")}else e.push(l);return e.map((e=>("/"!==e.charAt(e.length-1)&&(e+="/"),e)))}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new a.R9(e),r=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.substring(r.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){e&&(0,a.oC)(e)&&(e="https:"+e),e&&(e=e.replace(/\{z\}/gi,"{level}").replace(/\{x\}/gi,"{col}").replace(/\{y\}/gi,"{row}"),e=(0,a.Fv)(e)),t.templateUrl=e}fetchTile(e,t,r,s={}){const{signal:l}=s,o=this.getTileUrl(e,t,r),n={responseType:"image",signal:l,query:{...this.refreshParameters}};return(0,i.default)(o,n).then((e=>e.data))}getTileUrl(e,t,r){const s=this.levelValues[e];return this.tileServers[t%this.tileServers.length]+(0,n.gx)(this.urlPath,{level:s,z:s,col:r,x:r,row:t,y:t})}};(0,s._)([(0,p.Cb)({type:String,value:"",json:{write:!0}})],I.prototype,"copyright",void 0),(0,s._)([(0,p.Cb)({type:S.Z,json:{write:!0},nonNullable:!0})],I.prototype,"fullExtent",void 0),(0,s._)([(0,p.Cb)({readOnly:!0,json:{read:!1,write:!1}})],I.prototype,"legendEnabled",void 0),(0,s._)([(0,p.Cb)({type:["show","hide"]})],I.prototype,"listMode",void 0),(0,s._)([(0,p.Cb)({json:{read:!0,write:!0}})],I.prototype,"blendMode",void 0),(0,s._)([(0,p.Cb)()],I.prototype,"levelValues",null),(0,s._)([(0,p.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],I.prototype,"isReference",void 0),(0,s._)([(0,p.Cb)({type:["WebTiledLayer"],value:"WebTiledLayer"})],I.prototype,"operationalLayerType",void 0),(0,s._)([(0,p.Cb)({readOnly:!0,json:{read:!1,write:!1}})],I.prototype,"popupEnabled",void 0),(0,s._)([(0,p.Cb)({type:C.Z})],I.prototype,"spatialReference",void 0),(0,s._)([(0,u.r)("spatialReference",["spatialReference","fullExtent.spatialReference"])],I.prototype,"readSpatialReference",null),(0,s._)([(0,p.Cb)({type:[String],json:{write:!0}})],I.prototype,"subDomains",void 0),(0,s._)([(0,p.Cb)({type:w.Z,json:{write:!0}})],I.prototype,"tileInfo",void 0),(0,s._)([(0,p.Cb)({readOnly:!0})],I.prototype,"tileServers",null),(0,s._)([(0,p.Cb)({json:{read:!1}})],I.prototype,"type",void 0),(0,s._)([(0,p.Cb)()],I.prototype,"urlPath",null),(0,s._)([(0,p.Cb)({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],I.prototype,"urlTemplate",void 0),(0,s._)([(0,u.r)("urlTemplate",["urlTemplate","templateUrl"])],I.prototype,"readUrlTemplate",null),(0,s._)([(0,h.c)("urlTemplate",{templateUrl:{type:String}})],I.prototype,"writeUrlTemplate",null),(0,s._)([(0,p.Cb)({type:_.B,json:{write:!0}})],I.prototype,"wmtsInfo",void 0),I=(0,s._)([(0,c.j)("esri.layers.WebTileLayer")],I);const Z=I},16859:(e,t,r)=>{r.d(t,{I:()=>b});var s=r(43697),i=r(40330),l=r(3172),o=r(66643),n=r(20102),a=r(92604),p=r(70586),u=r(95330),c=r(17452),h=r(5600),d=(r(67676),r(80442),r(75215),r(71715)),y=r(52011),f=r(30556),v=r(65587),g=r(15235),m=r(86082);const b=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){this.portalItem?.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new g.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const s=await r.e(8062).then(r.bind(r,18062));return(0,u.k_)(t),await s.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,u.D_)(e)||a.Z.getLogger(this.declaredClass).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,u.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?i.id?.findCredential(this.url):null;if(!t)return!0;const r=w.credential===t?w.user:await this._fetchEditingUser(e);return w.credential=t,w.user=r,(0,p.Wi)(r)||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=i.id.findServerInfo(this.url);if(!r?.owningSystemUrl)return null;const s=`${r.owningSystemUrl}/sharing/rest`,n=v.Z.getDefault();if(n&&n.loaded&&(0,c.Fv)(n.restUrl)===(0,c.Fv)(s))return n.user;const a=`${s}/community/self`,u=(0,p.pC)(e)?e.signal:null,h=await(0,o.q6)((0,l.default)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return h.ok?m.default.fromJSON(h.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||v.Z.getDefault());return r&&s&&!(0,c.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new n.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,s._)([(0,h.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,s._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,f.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,h.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,s._)([(0,y.j)("esri.layers.mixins.PortalLayer")],t),t},w={credential:null,user:null}},34760:(e,t,r)=>{r.d(t,{Q:()=>g});var s=r(43697),i=r(92604),l=r(95330),o=r(5600),n=(r(67676),r(80442),r(75215),r(52011)),a=r(46791),p=(r(20102),r(26258),r(87538));const u=new a.Z,c=new WeakMap;function h(e){return e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function d(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:d(t,e%t):0}let y=0,f=0;function v(){const e=Date.now();for(const t of u)t.refreshInterval&&e-(c.get(t)??0)+5>=6e4*t.refreshInterval&&(c.set(t,e),t.refresh(e))}(0,p.EH)((()=>{const e=Date.now();let t=0;for(const r of u)t=d(Math.round(6e4*r.refreshInterval),t),r.refreshInterval?c.get(r)||c.set(r,e):c.delete(r);if(t!==f){if(f=t,clearInterval(y),0===f)return void(y=0);y=setInterval(v,f)}}));const g=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,l.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{!function(e){h(e)&&u.push(e)}(this)}),(()=>{}))}destroy(){var e;h(e=this)&&u.includes(e)&&u.remove(e)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,l.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{i.Z.getLogger(this.declaredClass).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,s._)([(0,o.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,s._)([(0,o.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,s._)([(0,o.Cb)()],t.prototype,"refreshParameters",null),t=(0,s._)([(0,n.j)("esri.layers.mixins.RefreshableLayer")],t),t}},39450:(e,t,r)=>{r.d(t,{Z:()=>u});var s,i=r(43697),l=r(96674),o=r(5600),n=(r(67676),r(80442),r(75215)),a=r(52011);let p=s=class extends l.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,i._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],p.prototype,"cols",void 0),(0,i._)([(0,o.Cb)({type:n.z8,json:{write:!0}})],p.prototype,"level",void 0),(0,i._)([(0,o.Cb)({type:String,json:{write:!0}})],p.prototype,"levelValue",void 0),(0,i._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],p.prototype,"origin",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],p.prototype,"resolution",void 0),(0,i._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],p.prototype,"rows",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],p.prototype,"scale",void 0),p=s=(0,i._)([(0,a.j)("esri.layers.support.LOD")],p);const u=p},11145:(e,t,r)=>{r.d(t,{Z:()=>O});var s,i=r(43697),l=r(35454),o=r(96674),n=r(70586),a=r(67900),p=r(5600),u=(r(67676),r(80442),r(75215)),c=r(71715),h=r(52011),d=r(30556),y=r(13473),f=r(82971),v=r(24470),g=r(8744),m=r(40488),b=r(39450);const w=new l.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let _=s=class extends o.wq{constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.minScale=0,this.maxScale=0,this.size=null,this.spatialReference=null}static create(e={}){const{resolutionFactor:t=1,scales:r,size:i=256,spatialReference:l=f.Z.WebMercator,numLODs:o=24}=e;if(!(0,g.JY)(l)){const e=[];if(r)for(let t=0;t<r.length;t++){const s=r[t];e.push({level:t,scale:s,resolution:s})}else{let t=5e-4;for(let r=o-1;r>=0;r--)e.unshift({level:r,scale:t,resolution:t}),t*=2}return new s({dpi:96,lods:e,origin:new y.Z(0,0,l),size:[i,i],spatialReference:l})}const n=(0,g.C5)(l),p=e.origin?new y.Z({x:e.origin.x,y:e.origin.y,spatialReference:l}):new y.Z(n?{x:n.origin[0],y:n.origin[1],spatialReference:l}:{x:0,y:0,spatialReference:l}),u=1/(39.37*(0,a.c9)(l)*96),c=[];if(r)for(let e=0;e<r.length;e++){const t=r[e],s=t*u;c.push({level:e,scale:t,resolution:s})}else{let e=(0,g.sT)(l)?512/i*591657527.5917094:256/i*591657527.591555;const r=Math.ceil(o/t);c.push({level:0,scale:e,resolution:e*u});for(let s=1;s<r;s++){const r=e/2**t,i=r*u;c.push({level:s,scale:r,resolution:i}),e=r}}return new s({dpi:96,lods:c,origin:p,size:[i,i],spatialReference:l})}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const r=(0,g.C5)(e);return e.isWrappable&&Math.abs(r.origin[0]-t.x)<=r.dx}return!1}readOrigin(e,t){return y.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,r=0;const s=[];this._levelToLOD={},e&&(t=-1/0,r=1/0,e.forEach((e=>{s.push(e.scale),t=e.scale>t?e.scale:t,r=e.scale<r?e.scale:r,this._levelToLOD[e.level]=e}))),this._set("scales",s),this._set("minScale",t),this._set("maxScale",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const r=Math.floor(e),s=r+1;return t[r]/(t[r]/t[s])**(e-r)}scaleToZoom(e){const t=this.scales,r=t.length-1;let s=0;for(;s<r;s++){const r=t[s],i=t[s+1];if(r<=e)return s;if(i===e)return s+1;if(r>e&&i<e)return s+Math.log(r/e)/Math.log(r/i)}return s}snapScale(e,t=.95){const r=this.scaleToZoom(e);return r%Math.floor(r)>=t?this.zoomToScale(Math.ceil(r)):this.zoomToScale(Math.floor(r))}tileAt(e,t,r,s){const i=this.lodAt(e);if(!i)return null;let l,o;if("number"==typeof t)l=t,o=r;else if((0,g.fS)(t.spatialReference,this.spatialReference))l=t.x,o=t.y,s=r;else{const e=(0,m.iV)(t,this.spatialReference);if((0,n.Wi)(e))return null;l=e.x,o=e.y,s=r}const a=i.resolution*this.size[0],p=i.resolution*this.size[1];return s||(s={id:null,level:0,row:0,col:0,extent:(0,v.Ue)()}),s.level=e,s.row=Math.floor((this.origin.y-o)/p+.001),s.col=Math.floor((l-this.origin.x)/a+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=s.ExtrapolateOptions.NONE){let r=this.lodAt(e.level);if(!r&&t===s.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(r=t)}if(!r)return;const i=e.level-r.level,l=r.resolution*this.size[0]/2**i,o=r.resolution*this.size[1]/2**i;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,v.Ue)()),e.extent[0]=this.origin.x+e.col*l,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+l,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const{resolution:r}=this.lodAt(t.level),s=r*this.size[0],i=r*this.size[1];return e[0]=this.origin.x+t.col*s,e[1]=this.origin.y-(t.row+1)*i,e[2]=e[0]+s,e[3]=e[1]+i,e}lodAt(e){return this._levelToLOD&&this._levelToLOD[e]||null}clone(){return s.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const r=[],i=this.lods.length;for(let e=0;e<i;e++){const s=this.lods[e],i=s.resolution*t;r.push(new b.Z({level:s.level,scale:s.scale,resolution:i}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:r})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let r=0;r<e.length;r++){const s=e[r];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};var S,C;(0,i._)([(0,p.Cb)({type:Number,json:{write:!0}})],_.prototype,"compressionQuality",void 0),(0,i._)([(0,p.Cb)({type:Number,json:{write:!0}})],_.prototype,"dpi",void 0),(0,i._)([(0,p.Cb)({type:String,json:{read:w.read,write:w.write,origins:{"web-scene":{read:!1,write:!1}}}})],_.prototype,"format",void 0),(0,i._)([(0,p.Cb)({readOnly:!0})],_.prototype,"isWrappable",null),(0,i._)([(0,p.Cb)({type:y.Z,json:{write:!0}})],_.prototype,"origin",void 0),(0,i._)([(0,c.r)("origin")],_.prototype,"readOrigin",null),(0,i._)([(0,p.Cb)({type:[b.Z],value:null,json:{write:!0}})],_.prototype,"lods",null),(0,i._)([(0,p.Cb)({readOnly:!0})],_.prototype,"minScale",void 0),(0,i._)([(0,p.Cb)({readOnly:!0})],_.prototype,"maxScale",void 0),(0,i._)([(0,p.Cb)({readOnly:!0})],_.prototype,"scales",void 0),(0,i._)([(0,p.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],_.prototype,"size",void 0),(0,i._)([(0,c.r)("size",["rows","cols"])],_.prototype,"readSize",null),(0,i._)([(0,d.c)("size",{cols:{type:u.z8},rows:{type:u.z8}})],_.prototype,"writeSize",null),(0,i._)([(0,p.Cb)({type:f.Z,json:{write:!0}})],_.prototype,"spatialReference",void 0),_=s=(0,i._)([(0,h.j)("esri.layers.support.TileInfo")],_),S=_||(_={}),(C=S.ExtrapolateOptions||(S.ExtrapolateOptions={}))[C.NONE=0]="NONE",C[C.POWER_OF_TWO=1]="POWER_OF_TWO";const O=_},5833:(e,t,r)=>{r.d(t,{B:()=>p});var s,i=r(43697),l=r(96674),o=r(22974),n=r(5600),a=(r(75215),r(52011));let p=s=class extends l.wq{constructor(e){super(e)}clone(){return new s({customLayerParameters:(0,o.d9)(this.customLayerParameters),customParameters:(0,o.d9)(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};(0,i._)([(0,n.Cb)({json:{type:Object,write:!0}})],p.prototype,"customLayerParameters",void 0),(0,i._)([(0,n.Cb)({json:{type:Object,write:!0}})],p.prototype,"customParameters",void 0),(0,i._)([(0,n.Cb)({type:String,json:{write:!0}})],p.prototype,"layerIdentifier",void 0),(0,i._)([(0,n.Cb)({type:String,json:{write:!0}})],p.prototype,"tileMatrixSet",void 0),(0,i._)([(0,n.Cb)({type:String,json:{write:!0}})],p.prototype,"url",void 0),p=s=(0,i._)([(0,a.j)("esri.layer.support.WMTSLayerInfo")],p)}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6199],{10699:(e,t,r)=>{r.d(t,{IG:()=>o});var s=r(43697),i=r(52011);let l=0;const o=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+l++})}};return t=(0,s._)([(0,i.j)("esri.core.Identifiable")],t),t};let n=class extends(o(class{})){};n=(0,s._)([(0,i.j)("esri.core.Identifiable")],n)},16453:(e,t,r)=>{r.d(t,{R:()=>b,w:()=>w});var s=r(43697),i=r(15923),l=r(70586),o=r(41103),n=r(22974),a=r(31263);class p{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(a.kk),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new p,r=this._originStores[a.s3.DEFAULTS];r&&r.forEach(((e,r)=>{t.set(r,(0,n.d9)(e),a.s3.DEFAULTS)}));for(let r=a.s3.SERVICE;r<a.kk;r++){const s=this._originStores[r];s&&s.forEach(((s,i)=>{e&&e.has(i)||t.set(i,(0,n.d9)(s),r)}))}return t}get(e,t){const r=void 0===t?this._values:this._originStores[t];return r?r.get(e):void 0}keys(e){const t=null==e?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,r=a.s3.USER){let s=this._originStores[r];if(s||(s=new Map,this._originStores[r]=s),s.set(e,t),!this._values.has(e)||(0,l.j0)(this._propertyOriginMap.get(e))<=r){const s=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,r),s!==t}return!1}delete(e,t=a.s3.USER){const r=this._originStores[t];if(!r)return;const s=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const t=this._originStores[r];if(t&&t.has(e)){this._values.set(e,t.get(e)),this._propertyOriginMap.set(e,r);break}}}return s}has(e,t){const r=void 0===t?this._values:this._originStores[t];return!!r&&r.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const r=this._originStores[t],s=r&&r.get(e),i=this._values.get(e);return this._values.set(e,s),this._propertyOriginMap.set(e,t),i!==s}originOf(e){return this._propertyOriginMap.get(e)||a.s3.DEFAULTS}forEach(e){this._values.forEach(e)}}var u=r(50549),c=r(1153),h=r(52011);const d=e=>{let t=class extends e{constructor(...e){super(...e);const t=(0,l.j0)((0,c.vw)(this)),r=t.store,s=new p;t.store=s,(0,o.M)(t,r,s)}read(e,t){(0,u.i)(this,e,t)}getAtOrigin(e,t){const r=y(this),s=(0,a.M9)(t);if("string"==typeof e)return r.get(e,s);const i={};return e.forEach((e=>{i[e]=r.get(e,s)})),i}originOf(e){return(0,a.x3)(this.originIdOf(e))}originIdOf(e){return y(this).originOf(e)}revert(e,t){const r=y(this),s=(0,a.M9)(t),i=(0,c.vw)(this);let l;l="string"==typeof e?"*"===e?r.keys(s):[e]:e,l.forEach((e=>{i.invalidate(e),r.revert(e,s),i.commit(e)}))}};return t=(0,s._)([(0,h.j)("esri.core.ReadOnlyMultiOriginJSONSupport")],t),t};function y(e){return(0,c.vw)(e).store}let f=class extends(d(i.Z)){};f=(0,s._)([(0,h.j)("esri.core.ReadOnlyMultiOriginJSONSupport")],f);var v=r(76169);const g=e=>{let t=class extends e{constructor(...e){super(...e)}clear(e,t="user"){return m(this).delete(e,(0,a.M9)(t))}write(e={},t){return(0,v.c)(this,e=e||{},t),e}setAtOrigin(e,t,r){(0,c.vw)(this).setAtOrigin(e,t,(0,a.M9)(r))}removeOrigin(e){const t=m(this),r=(0,a.M9)(e),s=t.keys(r);for(const e of s)t.originOf(e)===r&&t.set(e,t.get(e,r),a.s3.USER)}updateOrigin(e,t){const r=m(this),s=(0,a.M9)(t),i=this.get(e);for(let t=s+1;t<a.kk;++t)r.delete(e,t);r.set(e,i,s)}toJSON(e){return this.write({},e)}};return t=(0,s._)([(0,h.j)("esri.core.WriteableMultiOriginJSONSupport")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function m(e){return(0,c.vw)(e).store}const b=e=>{let t=class extends(g(d(e))){constructor(...e){super(...e)}};return t=(0,s._)([(0,h.j)("esri.core.MultiOriginJSONSupport")],t),t};let w=class extends(b(i.Z)){};w=(0,s._)([(0,h.j)("esri.core.MultiOriginJSONSupport")],w)},87085:(e,t,r)=>{r.d(t,{Z:()=>b});var s=r(43697),i=(r(66577),r(3172)),l=r(20102),o=r(32448),n=r(10699),a=r(83379),p=r(92604),u=r(95330),c=r(17452),h=r(5600),d=(r(67676),r(80442),r(75215),r(52011)),y=r(68773),f=r(6570),v=r(82971);let g=0,m=class extends(o.Z.EventedMixin((0,n.IG)(a.Z))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new f.Z(-180,-90,180,90,v.Z.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=v.Z.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await r.e(3529).then(r.bind(r,63529))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},s=await Promise.all([r.e(4547),r.e(8008)]).then(r.bind(r,28008));try{return await s.fromItem(t)}catch(e){const r=t&&t.portalItem,s=r&&r.id||"unset",i=r&&r.portal&&r.portal.url||y.Z.portalUrl;throw p.Z.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+i+"', id: '"+s+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,u.D_)(e)||p.Z.getLogger(this.declaredClass).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){if(this.parent){const e=this,t=this.parent;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"baseLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){const e=this.url;return e?(0,c.mN)(e):null}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,i.default)(e,{query:{f:"json"},responseType:"json"})).data;throw new l.Z("layer:no-attribution-data","Layer does not have attribution data")}};(0,s._)([(0,h.Cb)({type:String})],m.prototype,"attributionDataUrl",void 0),(0,s._)([(0,h.Cb)({type:f.Z})],m.prototype,"fullExtent",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],m.prototype,"hasAttributionData",null),(0,s._)([(0,h.Cb)({type:String,clonable:!1})],m.prototype,"id",void 0),(0,s._)([(0,h.Cb)({type:Boolean,nonNullable:!0})],m.prototype,"legendEnabled",void 0),(0,s._)([(0,h.Cb)({type:["show","hide","hide-children"]})],m.prototype,"listMode",void 0),(0,s._)([(0,h.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0})],m.prototype,"opacity",void 0),(0,s._)([(0,h.Cb)({clonable:!1})],m.prototype,"parent",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],m.prototype,"parsedUrl",null),(0,s._)([(0,h.Cb)({type:Boolean})],m.prototype,"popupEnabled",void 0),(0,s._)([(0,h.Cb)({type:Boolean})],m.prototype,"attributionVisible",void 0),(0,s._)([(0,h.Cb)({type:v.Z})],m.prototype,"spatialReference",void 0),(0,s._)([(0,h.Cb)({type:String})],m.prototype,"title",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],m.prototype,"type",void 0),(0,s._)([(0,h.Cb)()],m.prototype,"url",void 0),(0,s._)([(0,h.Cb)({type:Boolean,nonNullable:!0})],m.prototype,"visible",void 0),m=(0,s._)([(0,d.j)("esri.layers.Layer")],m);const b=m},16199:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Z});var s=r(43697),i=(r(66577),r(3172)),l=r(20102),o=r(16453),n=r(19153),a=r(17452),p=r(5600),u=(r(67676),r(80442),r(75215),r(71715)),c=r(52011),h=r(30556),d=r(87085),y=r(71612),f=r(38009),v=r(16859),g=r(34760),m=r(72965),b=r(39450),w=r(11145),_=r(5833),S=r(6570),C=r(82971),O=r(13473);let I=class extends((0,y.h)((0,g.Q)((0,m.M)((0,f.q)((0,v.I)((0,o.R)(d.Z))))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new S.Z(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,C.Z.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=C.Z.WebMercator,this.subDomains=null,this.tileInfo=new w.Z({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new O.Z({x:-20037508.342787,y:20037508.342787,spatialReference:C.Z.WebMercator}),spatialReference:C.Z.WebMercator,lods:[new b.Z({level:0,scale:591657527.591555,resolution:156543.033928}),new b.Z({level:1,scale:295828763.795777,resolution:78271.5169639999}),new b.Z({level:2,scale:147914381.897889,resolution:39135.7584820001}),new b.Z({level:3,scale:73957190.948944,resolution:19567.8792409999}),new b.Z({level:4,scale:36978595.474472,resolution:9783.93962049996}),new b.Z({level:5,scale:18489297.737236,resolution:4891.96981024998}),new b.Z({level:6,scale:9244648.868618,resolution:2445.98490512499}),new b.Z({level:7,scale:4622324.434309,resolution:1222.99245256249}),new b.Z({level:8,scale:2311162.217155,resolution:611.49622628138}),new b.Z({level:9,scale:1155581.108577,resolution:305.748113140558}),new b.Z({level:10,scale:577790.554289,resolution:152.874056570411}),new b.Z({level:11,scale:288895.277144,resolution:76.4370282850732}),new b.Z({level:12,scale:144447.638572,resolution:38.2185141425366}),new b.Z({level:13,scale:72223.819286,resolution:19.1092570712683}),new b.Z({level:14,scale:36111.909643,resolution:9.55462853563415}),new b.Z({level:15,scale:18055.954822,resolution:4.77731426794937}),new b.Z({level:16,scale:9027.977411,resolution:2.38865713397468}),new b.Z({level:17,scale:4513.988705,resolution:1.19432856685505}),new b.Z({level:18,scale:2256.994353,resolution:.597164283559817}),new b.Z({level:19,scale:1128.497176,resolution:.298582141647617}),new b.Z({level:20,scale:564.248588,resolution:.14929107082380833}),new b.Z({level:21,scale:282.124294,resolution:.07464553541190416}),new b.Z({level:22,scale:141.062147,resolution:.03732276770595208}),new b.Z({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return"string"==typeof e?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then((()=>{let e="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const t=new a.R9(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&t.authority.includes("{subDomain}")&&(e="is missing 'subDomains' property")}else e="spatialReference must match tileInfo.spatialReference";else e="is missing the required 'urlTemplate' property value";if(e)throw new l.Z("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${e}`)}));return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){return e||t.fullExtent&&t.fullExtent.spatialReference&&C.Z.fromJSON(t.fullExtent.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:r}=this,s=new a.R9(t),i=s.scheme?s.scheme+"://":"//",l=i+s.authority+"/";if(s.authority.includes("{subDomain}")){if(r&&r.length>0&&s.authority.split(".").length>1)for(const t of r)e.push(i+s.authority.replace(/\{subDomain\}/gi,t)+"/")}else e.push(l);return e.map((e=>("/"!==e.charAt(e.length-1)&&(e+="/"),e)))}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new a.R9(e),r=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.substring(r.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){e&&(0,a.oC)(e)&&(e="https:"+e),e&&(e=e.replace(/\{z\}/gi,"{level}").replace(/\{x\}/gi,"{col}").replace(/\{y\}/gi,"{row}"),e=(0,a.Fv)(e)),t.templateUrl=e}fetchTile(e,t,r,s={}){const{signal:l}=s,o=this.getTileUrl(e,t,r),n={responseType:"image",signal:l,query:{...this.refreshParameters}};return(0,i.default)(o,n).then((e=>e.data))}getTileUrl(e,t,r){const s=this.levelValues[e];return this.tileServers[t%this.tileServers.length]+(0,n.gx)(this.urlPath,{level:s,z:s,col:r,x:r,row:t,y:t})}};(0,s._)([(0,p.Cb)({type:String,value:"",json:{write:!0}})],I.prototype,"copyright",void 0),(0,s._)([(0,p.Cb)({type:S.Z,json:{write:!0},nonNullable:!0})],I.prototype,"fullExtent",void 0),(0,s._)([(0,p.Cb)({readOnly:!0,json:{read:!1,write:!1}})],I.prototype,"legendEnabled",void 0),(0,s._)([(0,p.Cb)({type:["show","hide"]})],I.prototype,"listMode",void 0),(0,s._)([(0,p.Cb)({json:{read:!0,write:!0}})],I.prototype,"blendMode",void 0),(0,s._)([(0,p.Cb)()],I.prototype,"levelValues",null),(0,s._)([(0,p.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],I.prototype,"isReference",void 0),(0,s._)([(0,p.Cb)({type:["WebTiledLayer"],value:"WebTiledLayer"})],I.prototype,"operationalLayerType",void 0),(0,s._)([(0,p.Cb)({readOnly:!0,json:{read:!1,write:!1}})],I.prototype,"popupEnabled",void 0),(0,s._)([(0,p.Cb)({type:C.Z})],I.prototype,"spatialReference",void 0),(0,s._)([(0,u.r)("spatialReference",["spatialReference","fullExtent.spatialReference"])],I.prototype,"readSpatialReference",null),(0,s._)([(0,p.Cb)({type:[String],json:{write:!0}})],I.prototype,"subDomains",void 0),(0,s._)([(0,p.Cb)({type:w.Z,json:{write:!0}})],I.prototype,"tileInfo",void 0),(0,s._)([(0,p.Cb)({readOnly:!0})],I.prototype,"tileServers",null),(0,s._)([(0,p.Cb)({json:{read:!1}})],I.prototype,"type",void 0),(0,s._)([(0,p.Cb)()],I.prototype,"urlPath",null),(0,s._)([(0,p.Cb)({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],I.prototype,"urlTemplate",void 0),(0,s._)([(0,u.r)("urlTemplate",["urlTemplate","templateUrl"])],I.prototype,"readUrlTemplate",null),(0,s._)([(0,h.c)("urlTemplate",{templateUrl:{type:String}})],I.prototype,"writeUrlTemplate",null),(0,s._)([(0,p.Cb)({type:_.B,json:{write:!0}})],I.prototype,"wmtsInfo",void 0),I=(0,s._)([(0,c.j)("esri.layers.WebTileLayer")],I);const Z=I},16859:(e,t,r)=>{r.d(t,{I:()=>b});var s=r(43697),i=r(40330),l=r(3172),o=r(66643),n=r(20102),a=r(92604),p=r(70586),u=r(95330),c=r(17452),h=r(5600),d=(r(67676),r(80442),r(75215),r(71715)),y=r(52011),f=r(30556),v=r(65587),g=r(15235),m=r(86082);const b=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){this.portalItem?.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new g.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const s=await r.e(8062).then(r.bind(r,18062));return(0,u.k_)(t),await s.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,u.D_)(e)||a.Z.getLogger(this.declaredClass).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,u.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?i.id?.findCredential(this.url):null;if(!t)return!0;const r=w.credential===t?w.user:await this._fetchEditingUser(e);return w.credential=t,w.user=r,(0,p.Wi)(r)||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=i.id.findServerInfo(this.url);if(!r?.owningSystemUrl)return null;const s=`${r.owningSystemUrl}/sharing/rest`,n=v.Z.getDefault();if(n&&n.loaded&&(0,c.Fv)(n.restUrl)===(0,c.Fv)(s))return n.user;const a=`${s}/community/self`,u=(0,p.pC)(e)?e.signal:null,h=await(0,o.q6)((0,l.default)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return h.ok?m.default.fromJSON(h.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||v.Z.getDefault());return r&&s&&!(0,c.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new n.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,s._)([(0,h.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,s._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,f.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,h.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,s._)([(0,y.j)("esri.layers.mixins.PortalLayer")],t),t},w={credential:null,user:null}},34760:(e,t,r)=>{r.d(t,{Q:()=>g});var s=r(43697),i=r(92604),l=r(95330),o=r(5600),n=(r(67676),r(80442),r(75215),r(52011)),a=r(46791),p=(r(20102),r(26258),r(87538));const u=new a.Z,c=new WeakMap;function h(e){return e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function d(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:d(t,e%t):0}let y=0,f=0;function v(){const e=Date.now();for(const t of u)t.refreshInterval&&e-(c.get(t)??0)+5>=6e4*t.refreshInterval&&(c.set(t,e),t.refresh(e))}(0,p.EH)((()=>{const e=Date.now();let t=0;for(const r of u)t=d(Math.round(6e4*r.refreshInterval),t),r.refreshInterval?c.get(r)||c.set(r,e):c.delete(r);if(t!==f){if(f=t,clearInterval(y),0===f)return void(y=0);y=setInterval(v,f)}}));const g=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,l.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{!function(e){h(e)&&u.push(e)}(this)}),(()=>{}))}destroy(){var e;h(e=this)&&u.includes(e)&&u.remove(e)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,l.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{i.Z.getLogger(this.declaredClass).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,s._)([(0,o.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,s._)([(0,o.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,s._)([(0,o.Cb)()],t.prototype,"refreshParameters",null),t=(0,s._)([(0,n.j)("esri.layers.mixins.RefreshableLayer")],t),t}},39450:(e,t,r)=>{r.d(t,{Z:()=>u});var s,i=r(43697),l=r(96674),o=r(5600),n=(r(67676),r(80442),r(75215)),a=r(52011);let p=s=class extends l.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,i._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],p.prototype,"cols",void 0),(0,i._)([(0,o.Cb)({type:n.z8,json:{write:!0}})],p.prototype,"level",void 0),(0,i._)([(0,o.Cb)({type:String,json:{write:!0}})],p.prototype,"levelValue",void 0),(0,i._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],p.prototype,"origin",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],p.prototype,"resolution",void 0),(0,i._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],p.prototype,"rows",void 0),(0,i._)([(0,o.Cb)({type:Number,json:{write:!0}})],p.prototype,"scale",void 0),p=s=(0,i._)([(0,a.j)("esri.layers.support.LOD")],p);const u=p},11145:(e,t,r)=>{r.d(t,{Z:()=>I});var s,i=r(43697),l=r(35454),o=r(96674),n=r(70586),a=r(67900),p=r(5600),u=(r(67676),r(80442),r(75215)),c=r(71715),h=r(52011),d=r(30556),y=r(13473),f=r(82971),v=r(24470),g=r(8744),m=r(40488),b=r(39450),w=r(43077);const _=new l.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let S=s=class extends o.wq{constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.minScale=0,this.maxScale=0,this.size=null,this.spatialReference=null}static create(e={}){const{resolutionFactor:t=1,scales:r,size:i=256,spatialReference:l=f.Z.WebMercator,numLODs:o=24}=e;if(!(0,g.JY)(l)){const e=[];if(r)for(let t=0;t<r.length;t++){const s=r[t];e.push({level:t,scale:s,resolution:s})}else{let t=5e-4;for(let r=o-1;r>=0;r--)e.unshift({level:r,scale:t,resolution:t}),t*=2}return new s({dpi:96,lods:e,origin:new y.Z(0,0,l),size:[i,i],spatialReference:l})}const n=(0,g.C5)(l),p=e.origin?new y.Z({x:e.origin.x,y:e.origin.y,spatialReference:l}):new y.Z(n?{x:n.origin[0],y:n.origin[1],spatialReference:l}:{x:0,y:0,spatialReference:l}),u=1/(39.37*(0,a.c9)(l)*96),c=[];if(r)for(let e=0;e<r.length;e++){const t=r[e],s=t*u;c.push({level:e,scale:t,resolution:s})}else{let e=(0,g.sT)(l)?512/i*591657527.5917094:256/i*591657527.591555;const r=Math.ceil(o/t);c.push({level:0,scale:e,resolution:e*u});for(let s=1;s<r;s++){const r=e/2**t,i=r*u;c.push({level:s,scale:r,resolution:i}),e=r}}return new s({dpi:96,lods:c,origin:p,size:[i,i],spatialReference:l})}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const r=(0,g.C5)(e);return e.isWrappable&&Math.abs(r.origin[0]-t.x)<=r.dx}return!1}readOrigin(e,t){return y.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,r=0;const s=[];this._levelToLOD={},e&&(t=-1/0,r=1/0,e.forEach((e=>{s.push(e.scale),t=e.scale>t?e.scale:t,r=e.scale<r?e.scale:r,this._levelToLOD[e.level]=e}))),this._set("scales",s),this._set("minScale",t),this._set("maxScale",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const r=Math.floor(e),s=r+1;return t[r]/(t[r]/t[s])**(e-r)}scaleToZoom(e){const t=this.scales,r=t.length-1;let s=0;for(;s<r;s++){const r=t[s],i=t[s+1];if(r<=e)return s;if(i===e)return s+1;if(r>e&&i<e)return s+Math.log(r/e)/Math.log(r/i)}return s}snapScale(e,t=.95){const r=this.scaleToZoom(e);return r%Math.floor(r)>=t?this.zoomToScale(Math.ceil(r)):this.zoomToScale(Math.floor(r))}tileAt(e,t,r,s){const i=this.lodAt(e);if(!i)return null;let l,o;if("number"==typeof t)l=t,o=r;else if((0,g.fS)(t.spatialReference,this.spatialReference))l=t.x,o=t.y,s=r;else{const e=(0,m.iV)(t,this.spatialReference);if((0,n.Wi)(e))return null;l=e.x,o=e.y,s=r}const a=i.resolution*this.size[0],p=i.resolution*this.size[1];return s||(s=new w.f(null,0,0,0,(0,v.Ue)())),s.level=e,s.row=Math.floor((this.origin.y-o)/p+.001),s.col=Math.floor((l-this.origin.x)/a+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=s.ExtrapolateOptions.NONE){let r=this.lodAt(e.level);if(!r&&t===s.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(r=t)}if(!r)return;const i=e.level-r.level,l=r.resolution*this.size[0]/2**i,o=r.resolution*this.size[1]/2**i;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,v.Ue)()),e.extent[0]=this.origin.x+e.col*l,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+l,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const{resolution:r}=this.lodAt(t.level),s=r*this.size[0],i=r*this.size[1];return e[0]=this.origin.x+t.col*s,e[1]=this.origin.y-(t.row+1)*i,e[2]=e[0]+s,e[3]=e[1]+i,e}lodAt(e){return this._levelToLOD&&this._levelToLOD[e]||null}clone(){return s.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const r=[],i=this.lods.length;for(let e=0;e<i;e++){const s=this.lods[e],i=s.resolution*t;r.push(new b.Z({level:s.level,scale:s.scale,resolution:i}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:r})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let r=0;r<e.length;r++){const s=e[r];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};var C,O;(0,i._)([(0,p.Cb)({type:Number,json:{write:!0}})],S.prototype,"compressionQuality",void 0),(0,i._)([(0,p.Cb)({type:Number,json:{write:!0}})],S.prototype,"dpi",void 0),(0,i._)([(0,p.Cb)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],S.prototype,"format",void 0),(0,i._)([(0,p.Cb)({readOnly:!0})],S.prototype,"isWrappable",null),(0,i._)([(0,p.Cb)({type:y.Z,json:{write:!0}})],S.prototype,"origin",void 0),(0,i._)([(0,c.r)("origin")],S.prototype,"readOrigin",null),(0,i._)([(0,p.Cb)({type:[b.Z],value:null,json:{write:!0}})],S.prototype,"lods",null),(0,i._)([(0,p.Cb)({readOnly:!0})],S.prototype,"minScale",void 0),(0,i._)([(0,p.Cb)({readOnly:!0})],S.prototype,"maxScale",void 0),(0,i._)([(0,p.Cb)({readOnly:!0})],S.prototype,"scales",void 0),(0,i._)([(0,p.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],S.prototype,"size",void 0),(0,i._)([(0,c.r)("size",["rows","cols"])],S.prototype,"readSize",null),(0,i._)([(0,d.c)("size",{cols:{type:u.z8},rows:{type:u.z8}})],S.prototype,"writeSize",null),(0,i._)([(0,p.Cb)({type:f.Z,json:{write:!0}})],S.prototype,"spatialReference",void 0),S=s=(0,i._)([(0,h.j)("esri.layers.support.TileInfo")],S),C=S||(S={}),(O=C.ExtrapolateOptions||(C.ExtrapolateOptions={}))[O.NONE=0]="NONE",O[O.POWER_OF_TWO=1]="POWER_OF_TWO";const I=S},43077:(e,t,r)=>{r.d(t,{f:()=>s});class s{constructor(e,t,r,s,i){this.id=e,this.level=t,this.row=r,this.col=s,this.extent=i}}},5833:(e,t,r)=>{r.d(t,{B:()=>p});var s,i=r(43697),l=r(96674),o=r(22974),n=r(5600),a=(r(75215),r(52011));let p=s=class extends l.wq{constructor(e){super(e)}clone(){return new s({customLayerParameters:(0,o.d9)(this.customLayerParameters),customParameters:(0,o.d9)(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};(0,i._)([(0,n.Cb)({json:{type:Object,write:!0}})],p.prototype,"customLayerParameters",void 0),(0,i._)([(0,n.Cb)({json:{type:Object,write:!0}})],p.prototype,"customParameters",void 0),(0,i._)([(0,n.Cb)({type:String,json:{write:!0}})],p.prototype,"layerIdentifier",void 0),(0,i._)([(0,n.Cb)({type:String,json:{write:!0}})],p.prototype,"tileMatrixSet",void 0),(0,i._)([(0,n.Cb)({type:String,json:{write:!0}})],p.prototype,"url",void 0),p=s=(0,i._)([(0,a.j)("esri.layer.support.WMTSLayerInfo")],p)}}]);
|