@arcgis/core 4.28.7 → 4.28.9

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.
Files changed (43) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/3b44696ed6608cfdef34.js +1 -0
  3. package/assets/esri/core/workers/chunks/53b8712979f551ac0101.js +1 -0
  4. package/assets/esri/core/workers/chunks/5b416d7ef5f3f57b052c.js +1 -0
  5. package/assets/esri/core/workers/chunks/5d50d061b080d93539ea.js +1 -0
  6. package/assets/esri/core/workers/chunks/{df7267892b6e0493e1d7.js → 95ce288362649909ffe6.js} +1 -1
  7. package/assets/esri/core/workers/chunks/a48cb80b8f10522ccba4.js +1 -0
  8. package/assets/esri/core/workers/chunks/aa3bb965d4495ee3dfe0.js +1 -0
  9. package/assets/esri/core/workers/chunks/afc396fd3afbebd39a93.js +1 -0
  10. package/assets/esri/core/workers/chunks/b4bbace5b409b804a52f.js +1 -0
  11. package/assets/esri/core/workers/chunks/{9979ff59a144fe1df80b.js → b91af6a65d382b92b162.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{c3b8b40115be5a2b960e.js → c6d1a6db8cfa0a7e3bd2.js} +1 -1
  13. package/assets/esri/core/workers/chunks/d5e6676cd2de77527c92.js +1 -0
  14. package/assets/esri/core/workers/chunks/d7637c89848ee4f5f4db.js +1 -0
  15. package/assets/esri/core/workers/chunks/d8482a5aa176426352bf.js +1 -0
  16. package/assets/esri/core/workers/chunks/ead02c933d1af20cbaa0.js +1 -0
  17. package/assets/esri/core/workers/chunks/f1152b991c33d8c94219.js +1 -0
  18. package/assets/esri/core/workers/chunks/{5e8f02da4eae41f57383.js → f4e962ccbec7e3b06067.js} +1 -1
  19. package/assets/esri/core/workers/chunks/faa2da66e9934f7fee04.js +1 -0
  20. package/core/uuid.js +1 -1
  21. package/interfaces.d.ts +10 -4
  22. package/kernel.js +1 -1
  23. package/layers/graphics/editingSupport.js +1 -1
  24. package/package.json +1 -1
  25. package/support/revision.js +1 -1
  26. package/versionManagement/support/versionManagementUtils.js +1 -1
  27. package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
  28. package/views/3d/layers/VoxelWasm.js +1 -1
  29. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  30. package/assets/esri/core/workers/chunks/175bbe8a048f17dd482b.js +0 -1
  31. package/assets/esri/core/workers/chunks/19c9966f74d287750aaa.js +0 -1
  32. package/assets/esri/core/workers/chunks/30776102fbab294bfe7b.js +0 -1
  33. package/assets/esri/core/workers/chunks/30d3b31df52d40e5b2e6.js +0 -1
  34. package/assets/esri/core/workers/chunks/4564a7885d045a850887.js +0 -1
  35. package/assets/esri/core/workers/chunks/4bd342f13002888b6467.js +0 -1
  36. package/assets/esri/core/workers/chunks/633b34a5817f1f719e22.js +0 -1
  37. package/assets/esri/core/workers/chunks/70eba80261d7fdc624ad.js +0 -1
  38. package/assets/esri/core/workers/chunks/9ef3746c545296565ef6.js +0 -1
  39. package/assets/esri/core/workers/chunks/a3bbf5da4f7830d2a2a1.js +0 -1
  40. package/assets/esri/core/workers/chunks/a47f74fc959b11f029a5.js +0 -1
  41. package/assets/esri/core/workers/chunks/bdc751a752a7ff1387de.js +0 -1
  42. package/assets/esri/core/workers/chunks/c3ddf5dbc34f118002df.js +0 -1
  43. package/assets/esri/core/workers/chunks/f85107720159b855a469.js +0 -1
@@ -0,0 +1 @@
1
+ (self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8853],{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},35454:(e,t,r)=>{"use strict";r.d(t,{X:()=>i,w:()=>o});var s=r(78286);class i{constructor(e,t={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=e,this._options=t,this.apiValues=[],this.jsonValues=[],this._apiToJSON=this._invertMap(e),this.apiValues=this._getKeysSorted(this._apiToJSON),this.jsonValues=this._getKeysSorted(this._jsonToAPI),this.read=e=>this.fromJSON(e),this.write=(e,t,r)=>{const i=this.toJSON(e);void 0!==i&&(0,s.RB)(r,i,t)},this.write.isJSONMapWriter=!0}toJSON(e){if(null==e)return null;if(this._apiToJSON.hasOwnProperty(e)){const t=this._apiToJSON[e];return this._options.useNumericKeys?+t:t}return this._options.ignoreUnknown?void 0:e}fromJSON(e){return null!=e&&this._jsonToAPI.hasOwnProperty(e)?this._jsonToAPI[e]:this._options.ignoreUnknown?void 0:e}_invertMap(e){const t={};for(const r in e)t[e[r]]=r;return t}_getKeysSorted(e){const t=[];for(const r in e)t.push(r);return t.sort(),t}}function o(){return function(e,t){return new i(e,{ignoreUnknown:!0,...t})}}},17445:(e,t,r)=>{"use strict";r.d(t,{N1:()=>p,YP:()=>l,Z_:()=>_,gx:()=>h,nn:()=>g,on:()=>c,tX:()=>v}),r(66643),r(46791);var s=r(91460),i=r(50758),o=r(70586),n=r(95330),a=r(26258);function l(e,t,r={}){return d(e,t,r,u)}function h(e,t,r={}){return d(e,t,r,f)}function d(e,t,r={},s){let i=null;const n=r.once?(e,r)=>{s(e)&&((0,o.hw)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,a.aQ)(e,n,r.sync,r.equals),r.initial){const t=e();n(t,t)}return i}function c(e,t,r,n={}){let a=null,h=null,d=null;function c(){a&&h&&(h.remove(),n.onListenerRemove?.(a),a=null,h=null)}function p(e){n.once&&n.once&&(0,o.hw)(d),r(e)}const u=l(e,((e,r)=>{c(),(0,s.vT)(e)&&(a=e,h=(0,s.on)(e,t,p),n.onListenerAdd?.(e))}),{sync:n.sync,initial:!0});return d=(0,i.kB)((()=>{u.remove(),c()})),d}function p(e,t){return function(e,t,r){if((0,n.Hc)(r))return Promise.reject((0,n.zE)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,o.hw)(a)}return new Promise(((s,o)=>{a=(0,i.AL)([(0,n.fu)(r,(()=>{l(),o((0,n.zE)())})),d(e,(e=>{l(),s(e)}),{sync:!1,once:!0},t??u)])}))}(e,f,t)}function u(e){return!0}function f(e){return!!e}r(87538);const _={sync:!0},g={initial:!0},v={sync:!0,initial:!0}},41123:(e,t,r)=>{"use strict";r.d(t,{DO:()=>i,dG:()=>n,zS:()=>o});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).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function o(){return`{${i().toUpperCase()}}`}function n(){return`{${i()}}`}},53865:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>vt});var s=r(40330),i=r(43697),o=r(68773),n=r(3172),a=r(20102),l=r(32448),h=r(91460),d=r(22974),c=r(78286),p=r(95330),u=r(17445),f=r(17452),_=r(5600),g=(r(75215),r(52011)),v=(r(67676),r(80442),r(940)),m=(r(2587),r(60235));Element.prototype.closest;var y=r(92604),w=r(70586),S=r(609),I=r(41123),k=r(90578),A=r(58971),b=r(38805),U=r(8728),C=r(3894),T=r(50758);const x=new Map;function P(){x.clear()}function O(e){x.delete(e)}y.Z.getLogger("esri.widgets.support.widgetUtils");function R(e){const t=C.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 C.Z.release(t),r}function N(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 D=["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)),{}),j=["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"],E=new U.Z({whiteList:D,onTagAttr:(e,t,r)=>{const s=`${t}="${r}"`;if(j.includes(t))return s},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),L="http://www.w3.org/",q=`${L}2000/svg`,F=`${L}1999/xlink`;let B=[],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},$=(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),H=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},M=(e,t,r)=>{if(""!==t.vnodeSelector)for(let s=r;s<e.length;s++)if($(e[s],t))return s;return-1},z=(e,t,r,s)=>{let i=e[t];if(""===i.vnodeSelector)return;let o=i.properties;if(!(o?void 0===o.key?o.bind:o.key:void 0))for(let o=0;o<e.length;o++)if(o!==t){let t=e[o];if($(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.`)}},Z=e=>{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},J=[],W=!1,G=e=>{(e.children||[]).forEach(G),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},Y=()=>{W=!1,J.forEach(G),J.length=0},K=e=>{J.push(e),W||(W=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(Y,{timeout:16}):setTimeout(Y,16))},X=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),K(e))};return void r(t,s,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),K(e))},Q=(e,t,r)=>{if(!t)return;let s=r.eventHandlerInterceptor,i=Object.keys(t),o=i.length;for(let n=0;n<o;n++){let o=i[n],a=t[o];if("className"===o)throw new Error('Property "className" is not supported, use "class".');if("class"===o)ie(e,a,!0);else if("classes"===o){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"===o){let t=Object.keys(a),s=t.length;for(let i=0;i<s;i++){let s=t[i],o=a[s];o&&(H(o),r.styleApplyer(e,s,o))}}else if("key"!==o&&null!=a){let i=typeof a;"function"===i?(0===o.lastIndexOf("on",0)&&(s&&(a=s(o,a,e,t)),"oninput"===o&&function(){let e=a;a=function(t){e.apply(this,[t]),t.target["oninput-value"]=t.target.value}}()),e[o]=a):r.namespace===q?"href"===o?e.setAttributeNS(F,o,a):e.setAttribute(o,a):"string"===i&&"value"!==o?"innerHTML"===o?e[o]=E.sanitize(a):ee(e)&&o in e?e[o]=a:e.setAttribute(o,a):e[o]=a}}};function ee(e){if(!(e instanceof Element&&e.tagName.includes("-")))return!1;const t=window.customElements.get(e.tagName.toLowerCase());return!!t&&e instanceof t}let te,re=(e,t,r)=>{((e,t,r)=>{if(t)for(let s of t)se(s,e,void 0,r)})(e,t.children,r),t.text&&(e.textContent=t.text),Q(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])},se=(e,t,r,s)=>{let i,o=0,n=e.vnodeSelector,a=t.ownerDocument;if(""===n)i=e.domNode=a.createTextNode(e.text),void 0!==r?t.insertBefore(i,r):t.appendChild(i);else{for(let l=0;l<=n.length;++l){let h=n.charAt(l);if(l===n.length||"."===h||"#"===h){let h=n.charAt(o-1),d=n.slice(o,l);"."===h?i.classList.add(d):"#"===h?i.id=d:("svg"===d&&(s=V(s,{namespace:q})),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)),o=l+1}}re(i,e,s)}},ie=(e,t,r)=>{t&&t.split(" ").forEach((t=>{t&&e.classList.toggle(t,r)}))},oe=(e,t,r,s,i)=>{if(r===s)return!1;s=s||B;let o,n=(r=r||B).length,a=s.length,l=0,h=0,d=!1;for(;h<a;){let a=l<n?r[l]:void 0,c=s[h];if(void 0!==a&&$(a,c))d=te(a,c,i)||d,l++;else{let a=M(r,c,l+1);if(a>=0){for(o=l;o<a;o++)X(r[o]),z(r,o,e,"removed");d=te(r[a],c,i)||d,l=a+1}else se(c,t,l<n?r[l].domNode:void 0,i),Z(c),z(s,h,e,"added")}h++}if(n>l)for(o=l;o<n;o++)X(r[o]),z(r,o,e,"removed");return d};te=(e,t,r)=>{let s=e.domNode,i=!1;if(e===t)return!1;let o=!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=V(r,{namespace:q})),e.text!==t.text&&(o=!0,void 0===t.text?s.removeChild(s.firstChild):s.textContent=t.text),t.domNode=s,o=oe(t,s,e.children,t.children,r)||o,o=((e,t,r,s)=>{if(!r)return;let i=!1,o=Object.keys(r),n=o.length;for(let a=0;a<n;a++){let n=o[a],l=r[n],h=t[n];if("class"===n)h!==l&&(ie(e,h,!1),ie(e,l,!0));else if("classes"===n){let t=e.classList,r=Object.keys(l),s=r.length;for(let e=0;e<s;e++){let s=r[e],o=!!l[s];o!==!!h[s]&&(i=!0,o?t.add(s):t.remove(s))}}else if("styles"===n){let t=Object.keys(l),r=t.length;for(let o=0;o<r;o++){let r=t[o],n=l[r];n!==h[r]&&(i=!0,n?(H(n),s.styleApplyer(e,r,n)):s.styleApplyer(e,r,""))}}else if(l||"string"!=typeof h||(l=""),"value"!==n||ee(e)){if(l!==h){let t=typeof l;"function"===t&&s.eventHandlerInterceptor||(s.namespace===q?"href"===n?e.setAttributeNS(F,n,l):e.setAttribute(n,l):"string"===t?"innerHTML"===n?e[n]=E.sanitize(l):"role"===n&&""===l?e.removeAttribute(n):ee(e)&&n in e?e[n]=l:e.setAttribute(n,l):e[n]!==l&&(e[n]=l),i=!0)}}else{let t=e[n];t!==l&&(e["oninput-value"]?t===e["oninput-value"]:l!==h)&&(e[n]=l,e["oninput-value"]=void 0),l!==h&&(i=!0)}}return i})(s,e.properties,t.properties,r)||o,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[s,r,t.vnodeSelector,t.properties,t.children]);return o&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(s,t.properties,e.properties),i};let ne=(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,te(s,r,t)},domNode:e.domNode});const ae={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}};let le,he=e=>V(ae,e),de=(e,t,r)=>(r=he(r),se(t,e,void 0,r),ne(t,r)),ce=(e,t,r)=>(r=he(r),se(t,e.parentNode,e,r),ne(t,r)),pe=(e,t,r)=>(r=he(r),t.domNode=e,re(e,t,r),ne(t,r)),ue=(e,t,r)=>(r=he(r),se(t,e.parentNode,e,r),e.parentNode.removeChild(e),ne(t,r));le=Array.prototype.find?(e,t)=>e.find(t):(e,t)=>e.filter(t)[0];const fe={handleInterceptedEvent:(e,t,r,s)=>(e.scheduleRender(),t.properties[`on${s.type}`].apply(t.properties.bind||r,[s]))},_e={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}},ge=(e,t,r=!1)=>{let s=e;return t.forEach(((e,i)=>{const o=s?.children?((e,t)=>e.find(t))(s.children,(t=>t.domNode===e)):void 0;r&&!o&&i!==t.length-1||(s=o)})),s};var ve=r(65161),me=r(99880);let ye;ye="components/assets";const we=Symbol("widget"),Se=Symbol("widget-test-data"),Ie=[],ke={},Ae=new WeakMap;function be(e,t){let r=t.children;if(r?.length)for(let t=0;t<r.length;++t)r[t]=be(e,r[t]);else r=Ie;const s=t.vnodeSelector;if(xe(s)){const i=t.properties||ke,o=i.key||s;return{vnodeSelector:"div",properties:{key:o,afterCreate:Ue,afterUpdate:Ce,afterRemoved:Te,parentWidget:e,widgetConstructor:s,widgetProperties:{...i,key:o,children:r}},children:void 0,text:void 0,domNode:null}}return t}function Ue(e,t,r,{parentWidget:s,widgetConstructor:i,widgetProperties:o}){const n=new i(o);n.container=e,Ae.set(e,n),n.afterCreate?.(n,e),s.addHandles((0,T.kB)((()=>Te(e)))),queueMicrotask((()=>{n[Se].projector.renderNow()}))}function Ce(e,t,r,{widgetProperties:s}){const i=Ae.get(e);i&&(i.set(s),i.afterUpdate?.(i,e))}function Te(e){const t=Ae.get(e);t&&(t.afterRemoved?.(t,e),t.destroy(),Ae.delete(e))}function xe(e){return"function"==typeof e&&e[we]}const Pe=new Set;var Oe,Re=r(70171),Ne=r(94443);let De=0;const je="esri-icon-checkbox-unchecked";function Ee(e,t){for(const r in t)null!=e[r]&&("object"==typeof e[r]&&"object"==typeof t[r]?Ee(e[r],t?.[r]):e[r]=t[r]);return e}const Le=(e=>{let t;const r={...fe,...e},s=(o=r,{..._e,...o}),i=s.performanceLogger;var o;let n,a=!0,l=!1;const h=[],d=[],c=(e,o,n)=>{let a;s.eventHandlerInterceptor=(e,s,o,n)=>function(e){let s;i("domEvent",e);const o=((e,t)=>{const r=[];for(;e&&e!==t;)r.push(e),e=e.parentNode;return r})(e.currentTarget,a.domNode),n=o.some((e=>customElements.get(e?.tagName?.toLowerCase())));if(e.eventPhase!==Event.CAPTURING_PHASE&&n){const t=e.composedPath(),r=t.slice(t.indexOf(e.currentTarget),t.indexOf(a.domNode)).reverse();s=ge(a.getLastRender(),r,!0)}else o.reverse(),s=ge(a.getLastRender(),o);let l;return s&&(l=r.handleInterceptedEvent(t,s,this,e)),i("domEventProcessed",e),l},r.postProcessProjectionOptions?.(s);const l=n();a=e(o,l,s),s.eventHandlerInterceptor=void 0,h.push(a),d.push(n),r.afterFirstVNodeRendered&&r.afterFirstVNodeRendered(a,l)};let p=()=>{if(n=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&&(p=r.modifyDoRenderImplementation(p,h,d)),t={renderNow:p,scheduleRender:()=>{n||l||(n=requestAnimationFrame(p))},stop:()=>{n&&(cancelAnimationFrame(n),n=void 0),l=!0},resume:()=>{l=!1,a=!0,t.scheduleRender()},append:(e,t)=>{c(de,e,t)},insertBefore:(e,t)=>{c(ce,e,t)},merge:(e,t)=>{c(pe,e,t)},replace:(e,t)=>{c(ue,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,o)=>{const n=t?.(e,s,i,o),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in i)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>n?.call(i,e);i.addEventListener(t,r,a);const s=()=>i.removeEventListener(t,r,a),l=o.afterRemoved;o.afterRemoved=e=>{l?.(e),s()}}return n}},handleInterceptedEvent(e,t,r,s){const{eventPhase:i,type:o}=s,n=i===Event.CAPTURING_PHASE;let a=`on${o}${n?"capture":""}`;const l=t.properties;(l&&a in l||(a=`on${o[0].toUpperCase()}${o.slice(1)}${n?"Capture":""}`,l&&a in l))&&(P(),e.scheduleRender(),l[a].call(l.bind||r,s))}});let qe=!1,Fe=class extends((0,S.v)(l.Z.EventedAccessor)){constructor(e,t){super(e,t),this._attached=!1,this._projector=Le,this._readyForTrueRender=!1,this.iconClass=je,this.icon=null,this.key=this,this._loadLocale=(0,p.Ds)((async()=>{if(this._messageBundleProps?.length){const e=await Promise.allSettled(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{if(this.destroyed)return;let r=await(0,Ne.ME)(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=Ee((0,d.d9)(r),this.uiStrings)),this[t]=r})));if(this.destroyed)return;for(const t of e)"rejected"===t.status&&y.Z.getLogger(this).error("widget-intl:locale-error",this.declaredClass,t.reason)}await this.loadLocale()})),function(){try{(0,ve.K3)(".")}catch{(0,ve.YY)((0,f.hF)((0,me.V)("components/assets")))}}();const r="esri-widget-uid-"+(0,I.DO)(),s=this.render.bind(this);this._trackingTarget=new b.M((()=>this.scheduleRender()));const i=()=>{if(!this._readyForTrueRender||this.destroyed)return null;const e=s();let{properties:t}=e;t||(e.properties=t={});const{key:i}=t;if(i||(t.key=r),xe(e.vnodeSelector)){if(!this.visible)return{vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}}else this.visible?t.styles||(t.styles={}):(t.class="",t.styles={display:"none"}),t.styles.display||(t.styles.display="");let o=0;return e.children?.forEach((e=>{if(xe(e.vnodeSelector))return;let{properties:t}=e;t||(e.properties=t={}),t.key||(t.key=`${this.id}--${o++}`)})),be(this,e)};this.render=()=>{if(qe)return i();let e=function(e){return x.get(e)}(this)??null;if(e)return e;this._trackingTarget.clear(),qe=!0;try{e=(0,A.LJ)(this._trackingTarget,i)}catch(e){throw console.error(e),e}finally{qe=!1}return e&&function(e,t){x.set(e,t)}(this,e),e};const o=this.beforeFirstRender();var n;o?this._resourcesFetch=o.then((()=>{this._readyForTrueRender=!0,this._postInitialize()})):(this._resourcesFetch=Promise.resolve().then((()=>{this._postInitialize()})),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),n=this._resourcesFetch,Pe.add(n),n.finally((()=>Pe.delete(n)))}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){const e=this.loadDependencies();return this._messageBundleProps?.length||e?Promise.all([e,this._loadLocale()]).then((()=>{})).catch(p.H9):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||((0,w.SC)(this._trackingTarget),(0,w.SC)(this.viewModel),this._detach(this.container),this._set("container",null),this._emitter.clear(),this.render=()=>null,this._projector=null,O(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return function(e){return"string"==typeof e?document.getElementById(e):e??null}(e)}get domNode(){return this.container}set domNode(e){this.container=e}get id(){return this._get("id")||this.container?.id||Date.now().toString(16)+"-widget-"+De++}set id(e){e&&this._set("id",e)}get label(){return this.declaredClass.split(".").pop()}set label(e){this._overrideIfSome("label",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get[(Oe=we,Se)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(O(this),this._projector.scheduleRender())}own(e){(0,m.XV)(y.Z.getLogger(this.declaredClass),"`Widget.own()` is deprecated in favor of Widget.addHandles()'",{replacement:"Widget.addHandles()",version:"4.28"}),this.addHandles(e)}classes(...e){return R.apply(this,e)}renderNow(){O(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this.addHandles((0,u.YP)((()=>this.viewModel),((e,t)=>{t&&this.removeHandles("delegated-events"),e&&(0,h.vT)(e)&&this.addHandles(this._delegatedEventNames.map((t=>(0,h.on)(e,t,(e=>{this.emit(t,e)})))),"delegated-events")}),u.tX)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(p.H9),this.scheduleRender()};this.addHandles([(0,Re.qe)(e),(0,u.YP)((()=>this.uiStrings),e),(0,u.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){this._attached&&(this._projector.detach(this.render),this._attached=!1),e?.parentNode?.removeChild(e)}};Fe[Oe]=!0,(0,i._)([(0,_.Cb)()],Fe.prototype,"_readyForTrueRender",void 0),(0,i._)([(0,_.Cb)({value:null})],Fe.prototype,"container",null),(0,i._)([(0,k.p)("container")],Fe.prototype,"castContainer",null),(0,i._)([(0,_.Cb)()],Fe.prototype,"iconClass",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"icon",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"id",null),(0,i._)([(0,_.Cb)()],Fe.prototype,"label",null),(0,i._)([(0,_.Cb)()],Fe.prototype,"renderable",null),(0,i._)([(0,_.Cb)()],Fe.prototype,"uiStrings",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"viewModel",void 0),(0,i._)([(0,_.Cb)({value:!0})],Fe.prototype,"visible",null),(0,i._)([(0,_.Cb)()],Fe.prototype,"key",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"children",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"afterCreate",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"afterUpdate",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"afterRemoved",void 0),Fe=(0,i._)([(0,g.j)("esri.widgets.Widget")],Fe);const Be=Fe;function Ve(e){return(t,r)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:r})}}var $e=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},He=function(e,t){for(var r=0,s=e.length;r<s;r++){var i=e[r];Array.isArray(i)?He(i,t):null!=i&&!1!==i&&(i.hasOwnProperty("vnodeSelector")||(i=$e(i)),t.push(i))}};function Me(e,t,...r){return"function"!=typeof e||xe(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 He(r,i),{vnodeSelector:e,properties:t||void 0,children:i,text:void 0,domNode:null}}(e,t,...r):e(t,...r)}const ze="esri-identity-form",Ze={base:ze,group:`${ze}__group`,label:`${ze}__label`,footer:`${ze}__footer`,esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"};let Je=class extends Be{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:o}=this,n=Me("div",{class:Ze.group},(0,v.n)(i?o.oAuthInfo:o.info,{server:t&&/\.arcgis\.com/i.test(t)?"ArcGIS Online":t,resource:`(${r||o.lblItem})`})),a=i?null:Me("div",{class:Ze.group,key:"username"},Me("label",{class:Ze.label},o.lblUser,Me("input",{afterCreate:N,autocomplete:"off",bind:this,class:Ze.esriInput,"data-node-ref":"_usernameInputNode",required:!0,spellcheck:!1,type:"text",value:""}))),l=i?null:Me("div",{class:Ze.group,key:"password"},Me("label",{class:Ze.label},o.lblPwd,Me("input",{afterCreate:N,bind:this,class:Ze.esriInput,"data-node-ref":"_passwordInputNode",required:!0,type:"password",value:""}))),h=Me("div",{class:this.classes(Ze.group,Ze.footer)},Me("input",{class:Ze.esriButton,disabled:!!s,type:"submit",value:s?o.lblSigning:o.lblOk}),Me("input",{bind:this,class:this.classes(Ze.esriButton,Ze.esriButtonSecondary),onclick:this._cancel,type:"button",value:o.lblCancel})),d=e?Me("div",null,e.details?.httpStatus?o.invalidUser:o.noAuthService):null;return Me("form",{bind:this,class:Ze.base,onsubmit:this._submit},n,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,_.Cb)(),Ve("esri/identity/t9n/identity")],Je.prototype,"messages",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"signingIn",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"server",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"resource",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"error",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"oAuthPrompt",void 0),Je=(0,i._)([(0,g.j)("esri.identity.IdentityForm")],Je);const We=Je;var Ge=r(44291);const Ye="esri-identity-modal",Ke={base:Ye,open:`${Ye}--open`,closed:`${Ye}--closed`,title:`${Ye}__title`,dialog:`${Ye}__dialog`,content:`${Ye}__content`,closeButton:`${Ye}__close-button`,iconClose:"esri-icon-close"};let Xe=class extends Be{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,u.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,o=t&&!!r,n={[Ke.open]:o,[Ke.closed]:!o},a=Me("button",{"aria-label":i.close,bind:this,class:Ke.closeButton,onclick:this._close,title:i.close,type:"button"},Me("span",{"aria-hidden":"true",class:Ke.iconClose})),l=`${e}_title`,h=`${e}_content`,d=s?Me("h1",{class:Ke.title,id:l},s):null,c=o?Me("div",{afterCreate:this._createFocusTrap,"aria-describedby":h,"aria-labelledby":l,bind:this,class:Ke.dialog,role:"dialog"},a,d,this._renderContent(h)):null;return Me("div",{class:this.classes(Ke.base,n),tabIndex:-1},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,Ge.v)(e,{initialFocus:"input",onDeactivate:this._close}),this._toggleFocusTrap()}));this.addHandles((0,T.kB)((()=>cancelAnimationFrame(t))))}_renderContent(e){const t=this.content;return"string"==typeof t?Me("div",{class:Ke.content,id:e,innerHTML:t}):function(e){return e&&"function"==typeof e.render}(t)?Me("div",{class:Ke.content,id:e},t.render()):t instanceof HTMLElement?Me("div",{afterCreate:this._attachToNode,bind:t,class:Ke.content,id:e}):null}_attachToNode(e){e.appendChild(this)}};(0,i._)([(0,_.Cb)({readOnly:!0})],Xe.prototype,"container",void 0),(0,i._)([(0,_.Cb)()],Xe.prototype,"content",void 0),(0,i._)([(0,_.Cb)()],Xe.prototype,"open",void 0),(0,i._)([(0,_.Cb)(),Ve("esri/t9n/common")],Xe.prototype,"messages",void 0),(0,i._)([(0,_.Cb)()],Xe.prototype,"title",null),Xe=(0,i._)([(0,g.j)("esri.identity.IdentityModal")],Xe);const Qe=Xe,et="esriJSAPIOAuth";class tt{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(et,JSON.stringify(e))}catch(e){return console.warn(e),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(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(et,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(et);if(t)try{e=JSON.parse(t)}catch(e){console.warn(e)}}return e}}tt.prototype.declaredClass="esri.identity.OAuthCredential";var rt,st=r(96674);let it=rt=class extends st.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 rt.fromJSON(this.toJSON())}};(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"appId",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"authNamespace",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"expiration",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"flowType",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"forceLogin",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"forceUserId",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"locale",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"minTimeUntilExpiration",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"popup",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"popupCallbackUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"popupWindowFeatures",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"portalUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"preserveUrlHash",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"userId",void 0),it=rt=(0,i._)([(0,g.j)("esri.identity.OAuthInfo")],it);const ot=it;let nt=class extends st.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,_.Cb)({json:{write:!0}})],nt.prototype,"adminTokenServiceUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"currentVersion",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"hasPortal",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"hasServer",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"owningSystemUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"owningTenant",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"server",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"shortLivedTokenValidity",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"tokenServiceUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"webTierAuth",void 0),nt=(0,i._)([(0,g.j)("esri.identity.ServerInfo")],nt);const at=nt;var lt=r(19745);const ht={},dt=e=>{const t=new f.R9(e.owningSystemUrl).host,r=new f.R9(e.server).host,s=/.+\.arcgis\.com$/i;return s.test(t)&&s.test(r)},ct=(e,t)=>!!(dt(e)&&t&&t.some((t=>t.test(e.server))));let pt=null,ut=null;try{pt=window.localStorage,ut=window.sessionStorage}catch{}class ft 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=We,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin="null"!==window.origin?window.origin:window.location.origin,this._appUrlObj=(0,f.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|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/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),o=!0;i||(i=new at,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),o=!1):(s=new _t({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),o||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 at(t))})),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach((t=>{t.appId&&e.push(t.declaredClass?t:new ot(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 _t(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){if(!e)return;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 o=new AbortController,n=(0,p.hh)();if(t.signal&&(0,p.fu)(t.signal,(()=>{o.abort()})),(0,p.fu)(o,(()=>{n.reject(new a.Z("identity-manager:user-aborted","ABORTED"))})),(0,p.Hc)(o))return n.promise;t.signal=o.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}),n.reject(d),n.promise;const c=this._findCredential(e,t);if(c)return n.resolve(c),n.promise;let u=this.findServerInfo(e);if(u)!u.hasPortal&&u.server&&u.owningSystemUrl&&this._hasSameServerInstance(u.server,u.owningSystemUrl)&&(u.hasPortal=!0),!u.hasServer&&this._isServerRsrc(e)&&(u._restInfoPms=this._getTokenSvcUrl(e),u.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."),n.reject(d),n.promise;u=new at,u.server=this._getServerInstanceRoot(e),"string"==typeof t?(u.tokenServiceUrl=t,u.hasPortal=!0):(u._restInfoPms=t,u.hasServer=!0),this.registerServers([u])}return u.hasPortal&&void 0===u._selfReq&&(i||(0,f.D6)(u.tokenServiceUrl,this._appOrigin)||this._gwDomains.some((e=>e.tokenServiceUrl===u.tokenServiceUrl)))&&(u._selfReq={owningTenant:t?.owningTenant,selfDfd:this._getPortalSelf(u.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,u,t,n,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 f.R9(this._appOrigin),o=e.shortLivedTokenValidity;let l,h,d,c,p,u,_,g;t&&(g=this.tokenValidity||o||this._defaultTokenValidity,g>o&&o>0&&(g=o)),r&&(l=r.isAdmin,h=r.serverUrl,d=r.token,u=r.signal,_=r.ssl,e.customParameters=r.customParameters),l?c=e.adminTokenServiceUrl:(c=e.tokenServiceUrl,p=new f.R9(c.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!_&&"http"===i.scheme&&((0,f.D6)(i.uri,c,!0)||"https"===p.scheme&&i.host===p.host&&"7080"===i.port&&"7443"===p.port)&&(c=c.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const v={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:u,...r?.ioArgs};return s||(v.withCredentials=!1),(0,n.Z)(c,v).then((r=>{const s=r.data;if(!s?.token)return new a.Z("identity-manager:authentication-failed","Unable to generate token");const i=e.server;return ht[i]||(ht[i]={}),t&&(ht[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 o;const l={f:"json"};if("portal"===i.scope)if(t&&(this._doPortalSignIn(e)||r?.force))o=i.server+"/sharing/rest/oauth2/validateAppAccess",l.client_id=t;else{if(!i.token)return{credential:i};o=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};o=i.server+"/rest/services"}return i.token&&(l.token=i.token),(0,n.Z)(o,{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?.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,f.u0)(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const s=(0,p.hh)(),i=()=>{l?.remove(),h?.remove(),d?.remove(),n?.destroy(),this.dialog?.destroy(),this.dialog=n=l=h=d=null},o=()=>{i(),this._oAuthDfd=null,s.reject(new a.Z("identity-manager:user-aborted","ABORTED"))};r.signal&&(0,p.fu)(r.signal,(()=>{o()}));let n=new this.formConstructor;n.resource=this.getResourceName(e),n.server=t.server,this.dialog=new Qe,this.dialog.content=n,this.dialog.open=!0,this.emit("dialog-create");let l=n.on("cancel",o),h=(0,u.YP)((()=>this.dialog.open),o),d=n.on("submit",(e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then((o=>{i();const n=new _t({userId:e.username,server:t.server,token:o.token,expires:null!=o.expires?Number(o.expires):null,ssl:!!o.ssl,isAdmin:r.isAdmin,validity:o.validity});s.resolve(n)})).catch((e=>{n.error=e,n.signingIn=!1}))}));return s.promise}oAuthSignIn(e,t,r,s){this._oAuthDfd=(0,p.hh)();const i=this._oAuthDfd;let o;s?.signal&&(0,p.fu)(s.signal,(()=>{const e=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;e&&!e.closed?e.close():this.dialog&&_()})),i.resUrl_=e,i.sinfo_=t,i.oinfo_=r;const n=r._oAuthCred;if(n.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&t.currentVersion>=8.4)){let e=crypto.getRandomValues(new Uint8Array(32));o=(0,f.rS)(e),n.codeVerifier=o,e=crypto.getRandomValues(new Uint8Array(32)),n.stateUID=(0,f.rS)(e),n.save()||(n.codeVerifier=o=null)}else n.codeVerifier=null;let l,h,d,c;this._getCodeChallenge(o).then((i=>{const o=!s||!1!==s.oAuthPopupConfirmation;r.popup&&o?(l=new this.formConstructor,l.oAuthPrompt=!0,l.server=t.server,this.dialog=new Qe,this.dialog.content=l,this.dialog.open=!0,this.emit("dialog-create"),h=l.on("cancel",_),d=(0,u.YP)((()=>this.dialog.open),_),c=l.on("submit",(()=>{g(),this._doOAuthSignIn(e,t,r,i)}))):this._doOAuthSignIn(e,t,r,i)}));const _=()=>{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,f.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,f.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,f.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,n.Z)(`${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,f.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,o,n=-1;const a=t?.token,l=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],i=this.findServerInfo(r.server),s=i?.owningSystemUrl,o=s?this.findCredential(s,r.userId):void 0,n=this._getIdenticalSvcIdx(e,r),!a)return-1===n&&r.resources.push(e),this._addResource(e,o),r;-1!==n&&(r.resources.splice(n,1),this._removeResource(e,o))}else{let t,r;if(d.some((a=>(r=this._getIdenticalSvcIdx(e,a),-1!==r&&(t=a,i=this.findServerInfo(t.server),s=i?.owningSystemUrl,o=s?this.findCredential(s,t.userId):void 0,n=r,!0)))),a)t&&(t.resources.splice(n,1),this._removeResource(e,o));else if(t)return this._addResource(e,o),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?.isAdmin&&!(0,f.D6)(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&"10.1"===String(e.currentVersion)&&!(0,f.D6)(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new f.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||(0,lt.P)(t)||(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=(o.default.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return-1!==r&&(e=e.substring(r+t.length+1)),e=(0,f.Fv)(e),(0,f.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=!1;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.replaceAll(e,"$1")===i.replaceAll(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 f.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||o.default.portalUrl&&(s=(0,f.D6)(t,o.default.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,o)=>{-1===r&&i.regex.test(e)&&(r=o),-1===s&&i.regex.test(t)&&(s=o)}));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?.owningSystemUrl;s&&dt(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,n.Z)(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 f.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 o=new _t({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=o.userId,s.storage=i.persist?pt:ut,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=o.userId,s.ssl=o.ssl,s.save(),o}))}const i=new _t({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?pt:ut,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,f.u0)(e)))}_exchangeToken(e,t,r){return(0,n.Z)(`${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,n.Z)(`${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,n.Z)(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,f.D6)(r,e,!0)))}_checkProtocol(e,t,r,s){let i=!0;const o=s?t.adminTokenServiceUrl:t.tokenServiceUrl;return o.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&(0,f.ed)(o)&&(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,o){return s||(s=(0,p.hh)()),s.resUrl_=e,s.sinfo_=t,s.options_=r,s.admin_=i,s.refresh_=o,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_?.resource,s=e.resUrl_,i=e.refresh_;let o=!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,o=!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 n=this._soReqs,a={};this._soReqs=[],n.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),n.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,o||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,o,n,l)=>{const d=e.sinfo_,c=!e.options_||!1!==e.options_.prompt,u=d.hasPortal&&this._findOAuthInfo(e.resUrl_);let _,g;if(i)t(new _t({userId:i,server:d.server,token:n||null,expires:null!=l?Number(l):null,ssl:!!o}));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 _t(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,p.fu)(e.options_?.signal,(()=>{s.remove()}))}else if(u){let i=u._oAuthCred;if(!i){const e=new tt(u,pt),t=new tt(u,ut);e.isValid()&&t.isValid()?e.expires>t.expires?(i=e,t.destroy()):(i=t,e.destroy()):i=e.isValid()?e:t,u._oAuthCred=i}if(i.isValid()){_=new _t({userId:i.userId,server:d.server,token:i.token,expires:i.expires,ssl:i.ssl,_oAuthCred:i});const r=u.appId!==i.appId&&this._doPortalSignIn(e.resUrl_);r||i.refreshToken?(e._pendingDfd=i.refreshToken?this._getOAuthToken(d.server,i.refreshToken,i.appId).then((e=>(_.expires=Date.now()+1e3*e.expires_in,_.token=e.access_token,_))):Promise.resolve(_),e._pendingDfd.then((e=>r?this._exchangeToken(e.server,u.appId,e.token).then((t=>(e.token=t,e))).catch((()=>e)):e)).then((e=>{t(e)})).catch((()=>{i?.destroy(),s()}))):t(_)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(u.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,u,d).then((e=>{t(e)})).catch(r)}else{const s=()=>{c?e._pendingDfd=this.oAuthSignIn(e.resUrl_,d,u,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,u.appId).then((e=>{(0,f.D6)(e.portalUrl,this._appOrigin,!0)?(_=new _t({userId:e.username,server:d.server,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(_)):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,o=e.options_;let n,a,l,h;if(o&&(n=o.token,a=o.error,l=o.prompt),h=this._findCredential(i,{token:n,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(ct(s,this._legacyFed)){const e=h.toJSON();e.server=s.server,e.resources=null,t(new _t(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 _t({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,n&&(e.options_.token=null),(e._pendingDfd=this.getCredential(i.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:s.owningTenant,signal:e.options_.signal,token:n,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 o=e.sinfo_.owningSystemUrl,n=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))??null,r.shortLivedTokenValidity=(0,c.hS)("authInfo.shortLivedTokenValidity",t)??null,r.currentVersion=t.currentVersion,r.owningTenant=t.owningTenant;const e=r.owningSystemUrl=t.owningSystemUrl;e&&this._portals.push(e)}n&&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)})):n&&o?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then((t=>{const r={};let s,i,o,n;return t&&(s=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=null,s=e.portalUrl;const i=e.customBaseUrl,o=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,n.Z)(r+"/sharing/rest",{query:{f:"json"}}).then((()=>{this._defaultOAuthInfo=new ot({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})}))):t=Promise.resolve(),t.then((()=>{if(this._defaultOAuthInfo)return s=s.replace(/^http:/i,"https:"),(0,n.Z)(s+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:o,client_id:this._defaultOAuthInfo.appId,redirect_uri:(0,f.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,f.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,o={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(o.hash=window.location.hash),i.stateUID&&(o.uid=i.stateUID);const n={client_id:r.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(o),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!i.codeVerifier)};r.forceLogin&&(n.force_login=!0),r.forceUserId&&r.userId&&(n.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(n.redirectToUserOrgUrl=!0),i.codeVerifier&&(n.code_challenge=s||i.codeVerifier,n.code_challenge_method=s?"S256":"plain");const l=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",d=l+"?"+(0,f.B7)(n);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:n,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,f.hF)(e.popupCallbackUrl);if(t){const e=(0,f.mN)(r);return e.query&&["code","error","error_description","message_code","persist","state"].forEach((t=>{delete e.query[t]})),(0,f.fl)(e.path,e.query)}return r}}ft.prototype.declaredClass="esri.identity.IdentityManagerBase";let _t=class extends l.Z.EventedAccessor{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,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?.owningSystemUrl,r=!!t&&"server"===this.scope,i=r&&ct(e,s.id._legacyFed),o=e.webTierAuth,n=o&&s.id.normalizeWebTierAuth,a=ht[this.server],l=a?.[this.userId];let h,d=this.resources&&this.resources[0],c=r?s.id.findServerInfo(t):null,p={username:this.userId,password:l};if(o&&!n)return;r&&!c&&s.id.serverInfos.some((e=>(s.id._isIdProvider(t,e.server)&&(c=e),!!c)));const u=c?s.id.findCredential(c.server,this.userId):null;if(!r||u){if(!i){if(r)h={serverUrl:d,token:u?.token,ssl:u&&u.ssl};else if(n)p=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:p,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((()=>{}))}u?.refreshToken()}}refreshServerTokens(){"portal"===this.scope&&s.id.credentials.forEach((e=>{const t=s.id.findServerInfo(e.server),r=t?.owningSystemUrl;e!==this&&e.userId===this.userId&&r&&"server"===e.scope&&(s.id._hasSameServerInstance(this.server,r)||s.id._isIdProvider(r,this.server))&&(ct(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):null,r=t?.owningSystemUrl,i=r?s.id.findServerInfo(r):null;!1===e||r&&"portal"!==this.scope&&(!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,_.Cb)()],_t.prototype,"creationTime",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"expires",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"isAdmin",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"oAuthState",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"resources",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"scope",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"server",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"ssl",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"token",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"tokenRefreshBuffer",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"userId",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"validity",void 0),_t=(0,i._)([(0,g.j)("esri.identity.Credential")],_t);class gt extends ft{}gt.prototype.declaredClass="esri.identity.IdentityManager";const vt=new gt;(0,s.qh)(vt)}}]);
package/core/uuid.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- const t="randomUUID"in crypto;function n(){if(t)return crypto.randomUUID();const n=crypto.getRandomValues(new Uint16Array(8));n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;const r=t=>n[t].toString(16).padStart(4,"0");return r(0)+r(1)+"-"+r(2)+"-"+r(3)+"-"+r(4)+"-"+r(5)+r(6)+r(7)}function r(){return`{${n()}}`}export{r as generateBracedUUID,n as generateUUID};
5
+ const t="randomUUID"in crypto;function n(){if(t)return crypto.randomUUID();const n=crypto.getRandomValues(new Uint16Array(8));n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;const r=t=>n[t].toString(16).padStart(4,"0");return r(0)+r(1)+"-"+r(2)+"-"+r(3)+"-"+r(4)+"-"+r(5)+r(6)+r(7)}function r(){return`{${n().toUpperCase()}}`}function o(){return`{${n()}}`}export{r as generateBracedUUID,o as generateLowercaseBracedUUID,n as generateUUID};
package/interfaces.d.ts CHANGED
@@ -93781,13 +93781,13 @@ declare namespace __esri {
93781
93781
  */
93782
93782
  export interface EditorVisibleElements {
93783
93783
  /**
93784
- * Indicates whether to display the "create features" section of the widget in the default view.
93784
+ * _Since 4.28_.
93785
93785
  *
93786
93786
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#VisibleElements)
93787
93787
  */
93788
93788
  createFeaturesSection?: boolean;
93789
93789
  /**
93790
- * Indicates whether to display the "edit features" section of the widget in the default view.
93790
+ * _Since 4.28_.
93791
93791
  *
93792
93792
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#VisibleElements)
93793
93793
  */
@@ -96004,7 +96004,14 @@ declare namespace __esri {
96004
96004
  }
96005
96005
 
96006
96006
  export class GroupInput {
96007
- initialState: "expanded" | "collapsed";
96007
+ /**
96008
+ * Defines if the group should be expanded or collapsed when the form is initially displayed.
96009
+ *
96010
+ * @default expanded
96011
+ *
96012
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-GroupInput.html#initialState)
96013
+ */
96014
+ readonly initialState: "expanded" | "collapsed";
96008
96015
  /**
96009
96016
  * The field inputs contained within the group.
96010
96017
  *
@@ -96040,7 +96047,6 @@ declare namespace __esri {
96040
96047
  }
96041
96048
 
96042
96049
  interface GroupInputProperties extends InputBaseProperties {
96043
- initialState?: "expanded" | "collapsed";
96044
96050
  /**
96045
96051
  * Determines whether or not the group is open/expanded.
96046
96052
  *
package/kernel.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";import{buildDate as s,commitHash as e}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const r="4.28";let t,i=r;i="4.28.7";function n(o){t=o}function m(s){const e=t?.findCredential(s);return e?.token?o(s,"token",e.token):s}has("host-webworker");export{m as addTokenParameter,s as buildDate,i as fullVersion,t as id,e as revision,n as setId,r as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";import{buildDate as s,commitHash as e}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const r="4.28";let t,i=r;i="4.28.9";function n(o){t=o}function m(s){const e=t?.findCredential(s);return e?.token?o(s,"token",e.token):s}has("host-webworker");export{m as addTokenParameter,s as buildDate,i as fullVersion,t as id,e as revision,n as setId,r as version};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Graphic.js";import t from"../../core/Collection.js";import a from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import s from"../../core/Logger.js";import{createResolver as o}from"../../core/promiseUtils.js";import{dataComponents as i}from"../../core/urlUtils.js";import{generateBracedUUID as n}from"../../core/uuid.js";import{normalizeCentralMeridian as d}from"../../geometry/support/normalizeUtils.js";import{isEditBusLayer as l,emitApplyEditsEvent as u}from"../mixins/EditBusLayer.js";import{isValidFieldValue as p}from"../support/fieldUtils.js";import{getMimeTypeFormatId as c,getFilenameFormatId as h}from"../support/infoFor3D.js";import{getEffectiveEditingEnabled as m,getEffectiveLayerCapabilities as f}from"../support/layerUtils.js";function y(e){return null!=e?.applyEdits}function g(e){return"object"==typeof e&&null!=e&&"objectId"in e&&!!e.objectId}function b(e){return e.every(g)}function w(e){return"object"==typeof e&&null!=e&&"globalId"in e&&!!e.globalId}function F(e){return e.every(w)}async function A(e,t,a,s={}){let i;const n="gdbVersion"in e?e.gdbVersion:null,d=s.gdbVersion??n;if(l(e)&&e.url)i=u(e.url,e.layerId,d,"original-and-current-features"===s.returnServiceEditsOption);else{i=o(),i.promise.then((t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)}));const t={result:i.promise};e.emit("apply-edits",t)}try{const{results:o,edits:n}=await v(e,t,a,s),d=e=>e.filter((e=>!e.error)).map(r),l={edits:n,addedFeatures:d(o.addFeatureResults),updatedFeatures:d(o.updateFeatureResults),deletedFeatures:d(o.deleteFeatureResults),addedAttachments:d(o.addAttachmentResults),updatedAttachments:d(o.updateAttachmentResults),deletedAttachments:d(o.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:o.editMoment?new Date(o.editMoment):null,globalIdToObjectId:s.globalIdToObjectId};return o.editedFeatureResults?.length&&(l.editedFeatures=o.editedFeatureResults),i.resolve(l),o}catch(p){throw i.reject(p),p}}async function v(e,t,r,s){if(await e.load(),!y(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!m(e))throw new a(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:o,options:i}=await I(e,r,s);return o.addFeatures?.length||o.updateFeatures?.length||o.deleteFeatures?.length||o.addAttachments?.length||o.updateAttachments?.length||o.deleteAttachments?.length?{edits:o,results:await t.applyEdits(o,i)}:{edits:o,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function I(e,t,r){const o=f(e),i=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),n=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),d=null!=e.infoFor3D;if(T(t,o,r,!!i,!!n,`${e.type}-layer`),!o.data.isVersioned&&r?.gdbVersion)throw new a(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!o.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const l={...r};if(null!=l.rollbackOnFailureEnabled||o.editing.supportsRollbackOnFailure||(l.rollbackOnFailureEnabled=!0),l.rollbackOnFailureEnabled||"original-and-current-features"!==l.returnServiceEditsOption||(!1===l.rollbackOnFailureEnabled&&s.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwrritten and set to true."),l.rollbackOnFailureEnabled=!0),!o.editing.supportsReturnServiceEditsInSourceSpatialReference&&l.returnServiceEditsInSourceSR)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(l.returnServiceEditsInSourceSR&&"original-and-current-features"!==l.returnServiceEditsOption)throw new a(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const u=B(t,o,`${e.type}-layer`),p=r?.globalIdUsed||d,c=e.fields.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(p){const{globalIdField:t}=e;if(null==t)throw new a(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");u.addFeatures.forEach((e=>U(e,t)))}u.addFeatures.forEach((t=>S(t,e,p,c))),u.updateFeatures.forEach((t=>j(t,e,p,c))),u.deleteFeatures.forEach((t=>R(t,e,p,c))),u.addAttachments.forEach((t=>O(t,e))),u.updateAttachments.forEach((t=>O(t,e))),d&&await G(u,e);return{edits:await L(u),options:l}}function $(e,t,r,s){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(s.length&&"attributes"in e)for(const o of s){const r=e.attributes[o.name];if(void 0!==r&&!p(o,r))throw new a(`${t.type}-layer:invalid-parameter`,`Big-integer field '${o.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new a(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new a(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function E(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D){const{geometry:r}=e;if(r.vertexSpace.isGeoreferenced)throw new a(`${t.type}-layer:georeferenced-mesh-unsupported`,"Uploading georeferenced meshes to a layer is not supported.")}}function S(e,t,a,r){$(e,t,a,r),E(e,t)}function R(e,t,a,r){$(e,t,a,r)}function j(e,t,r,s){$(e,t,r,s),E(e,t);const o=f(t);if("geometry"in e&&null!=e.geometry&&!o?.editing.supportsGeometryUpdate)throw new a(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function O(e,t){const{feature:r,attachment:s}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!s.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&!!s.data.name)&&!s.name)throw new a(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof s.data){const e=i(s.data);if(e&&!e.isBase64)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function U(e,t){const{attributes:a}=e;null==a[t]&&(a[t]=n())}async function L(e){const t=e.addFeatures??[],a=e.updateFeatures??[],r=t.concat(a).map((e=>e.geometry)),s=await d(r),o=t.length,i=a.length;return s.slice(0,o).forEach(((e,a)=>t[a].geometry=e)),s.slice(o,o+i).forEach(((e,t)=>a[t].geometry=e)),e}function k(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&t.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function B(e,t,r){const s=k(e);if(s.addFeatures?.length&&!t.operations.supportsAdd)throw new a(`${r}:unsupported-operation`,"Layer does not support adding features.");if(s.updateFeatures?.length&&!t.operations.supportsUpdate)throw new a(`${r}:unsupported-operation`,"Layer does not support updating features.");if(s.deleteFeatures?.length&&!t.operations.supportsDelete)throw new a(`${r}:unsupported-operation`,"Layer does not support deleting features.");return s.addFeatures=s.addFeatures.map(D),s.updateFeatures=s.updateFeatures.map(D),s.addAssetFeatures=[],s}function T(e,t,r,s,o,i){if(!e||!s&&!o)throw new a(`${i}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed)throw new a(`${i}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&o)throw new a(`${i}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&o)throw new a(`${i}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function D(t){const a=new e;return t.attributes||(t.attributes={}),a.geometry=t.geometry,a.attributes=t.attributes,a}async function G(e,t){if(null==t.infoFor3D)return;const{infoFor3D:r}=t,s=c("model/gltf-binary",r.supportedFormats)??h("glb",r.supportedFormats);if(!(!!s&&r.editFormats.includes(s)))throw new a(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:o}=e;for(const a of e.addFeatures??[])V(a)&&o.push(a);for(const a of e.updateFeatures??[])V(a)&&o.push(a)}function V(e){return"mesh"===e?.geometry?.type}function M(e,t,r,s){if(!y(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new a(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,s)}export{A as applyEdits,T as checkEditingCapabilities,F as isFeatureIdentifierArrayWithGlobalId,b as isFeatureIdentifierArrayWithObjectId,w as isFeatureIdentifierWithGlobalId,g as isFeatureIdentifierWithObjectId,k as normalizeCollections,B as normalizeEdits,L as normalizeGeometries,D as shallowCloneFeature,M as uploadAssets};
5
+ import e from"../../Graphic.js";import t from"../../core/Collection.js";import a from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import s from"../../core/Logger.js";import{createResolver as i}from"../../core/promiseUtils.js";import{dataComponents as o}from"../../core/urlUtils.js";import{generateBracedUUID as n}from"../../core/uuid.js";import{normalizeCentralMeridian as d}from"../../geometry/support/normalizeUtils.js";import{isEditBusLayer as l,emitApplyEditsEvent as u}from"../mixins/EditBusLayer.js";import{isValidFieldValue as p}from"../support/fieldUtils.js";import{getMimeTypeFormatId as c,getFilenameFormatId as h}from"../support/infoFor3D.js";import{getEffectiveEditingEnabled as m,getEffectiveLayerCapabilities as f}from"../support/layerUtils.js";function y(e){return null!=e?.applyEdits}function g(e){return"object"==typeof e&&null!=e&&"objectId"in e&&!!e.objectId}function b(e){return e.every(g)}function w(e){return"object"==typeof e&&null!=e&&"globalId"in e&&!!e.globalId}function F(e){return e.every(w)}async function v(e,t,a,s={}){let o;const n="gdbVersion"in e?e.gdbVersion:null,d=s.gdbVersion??n;if(l(e)&&e.url)o=u(e.url,e.layerId,d,"original-and-current-features"===s.returnServiceEditsOption);else{o=i(),o.promise.then((t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)}));const t={result:o.promise};e.emit("apply-edits",t)}try{const{results:i,edits:n}=await A(e,t,a,s),d=e=>e.filter((e=>!e.error)).map(r),l={edits:n,addedFeatures:d(i.addFeatureResults),updatedFeatures:d(i.updateFeatureResults),deletedFeatures:d(i.deleteFeatureResults),addedAttachments:d(i.addAttachmentResults),updatedAttachments:d(i.updateAttachmentResults),deletedAttachments:d(i.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:i.editMoment?new Date(i.editMoment):null,globalIdToObjectId:s.globalIdToObjectId};return i.editedFeatureResults?.length&&(l.editedFeatures=i.editedFeatureResults),o.resolve(l),i}catch(p){throw o.reject(p),p}}async function A(e,t,r,s){if(await e.load(),!y(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!m(e))throw new a(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:o}=await I(e,r,s);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,o)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function I(e,t,r){const i=f(e),o=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),n=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),d=null!=e.infoFor3D;if(T(t,i,r,!!o,!!n,`${e.type}-layer`),!i.data.isVersioned&&r?.gdbVersion)throw new a(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!i.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const l={...r};if(null!=l.rollbackOnFailureEnabled||i.editing.supportsRollbackOnFailure||(l.rollbackOnFailureEnabled=!0),l.rollbackOnFailureEnabled||"original-and-current-features"!==l.returnServiceEditsOption||(!1===l.rollbackOnFailureEnabled&&s.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwrritten and set to true."),l.rollbackOnFailureEnabled=!0),!i.editing.supportsReturnServiceEditsInSourceSpatialReference&&l.returnServiceEditsInSourceSR)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(l.returnServiceEditsInSourceSR&&"original-and-current-features"!==l.returnServiceEditsOption)throw new a(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const u=B(t,i,`${e.type}-layer`),p=r?.globalIdUsed||d,c=e.fields.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(p){const{globalIdField:t}=e;if(null==t)throw new a(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");u.addFeatures.forEach((e=>U(e,t)))}u.addFeatures.forEach((t=>S(t,e,p,c))),u.updateFeatures.forEach((t=>j(t,e,p,c))),u.deleteFeatures.forEach((t=>R(t,e,p,c))),u.addAttachments.forEach((t=>O(t,e))),u.updateAttachments.forEach((t=>O(t,e))),d&&await G(u,e);return{edits:await L(u),options:l}}function $(e,t,r,s){function i(e){return/[a-z]/.test(e)}if(r){if("attributes"in e){if(!e.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(i(e.attributes[t.globalIdField]))throw new a(`${t.type}-layer:invalid-parameter`,"provided globalId is required to only have uppercase characters")}if(!("attributes"in e)){if(!e.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true");if(i(e.globalId))throw new a(`${t.type}-layer:invalid-parameter`,"provided globalId is required to only have uppercase characters")}}if(s.length&&"attributes"in e)for(const o of s){const r=e.attributes[o.name];if(void 0!==r&&!p(o,r))throw new a(`${t.type}-layer:invalid-parameter`,`Big-integer field '${o.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new a(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new a(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function E(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D){const{geometry:r}=e;if(r.vertexSpace.isGeoreferenced)throw new a(`${t.type}-layer:georeferenced-mesh-unsupported`,"Uploading georeferenced meshes to a layer is not supported.")}}function S(e,t,a,r){$(e,t,a,r),E(e,t)}function R(e,t,a,r){$(e,t,a,r)}function j(e,t,r,s){$(e,t,r,s),E(e,t);const i=f(t);if("geometry"in e&&null!=e.geometry&&!i?.editing.supportsGeometryUpdate)throw new a(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function O(e,t){const{feature:r,attachment:s}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!s.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&!!s.data.name)&&!s.name)throw new a(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof s.data){const e=o(s.data);if(e&&!e.isBase64)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function U(e,t){const{attributes:a}=e;null==a[t]&&(a[t]=n())}async function L(e){const t=e.addFeatures??[],a=e.updateFeatures??[],r=t.concat(a).map((e=>e.geometry)),s=await d(r),i=t.length,o=a.length;return s.slice(0,i).forEach(((e,a)=>t[a].geometry=e)),s.slice(i,i+o).forEach(((e,t)=>a[t].geometry=e)),e}function k(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&t.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function B(e,t,r){const s=k(e);if(s.addFeatures?.length&&!t.operations.supportsAdd)throw new a(`${r}:unsupported-operation`,"Layer does not support adding features.");if(s.updateFeatures?.length&&!t.operations.supportsUpdate)throw new a(`${r}:unsupported-operation`,"Layer does not support updating features.");if(s.deleteFeatures?.length&&!t.operations.supportsDelete)throw new a(`${r}:unsupported-operation`,"Layer does not support deleting features.");return s.addFeatures=s.addFeatures.map(D),s.updateFeatures=s.updateFeatures.map(D),s.addAssetFeatures=[],s}function T(e,t,r,s,i,o){if(!e||!s&&!i)throw new a(`${o}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed)throw new a(`${o}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&i)throw new a(`${o}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&i)throw new a(`${o}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function D(t){const a=new e;return t.attributes||(t.attributes={}),a.geometry=t.geometry,a.attributes=t.attributes,a}async function G(e,t){if(null==t.infoFor3D)return;const{infoFor3D:r}=t,s=c("model/gltf-binary",r.supportedFormats)??h("glb",r.supportedFormats);if(!(!!s&&r.editFormats.includes(s)))throw new a(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:i}=e;for(const a of e.addFeatures??[])V(a)&&i.push(a);for(const a of e.updateFeatures??[])V(a)&&i.push(a)}function V(e){return"mesh"===e?.geometry?.type}function M(e,t,r,s){if(!y(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new a(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,s)}export{v as applyEdits,T as checkEditingCapabilities,F as isFeatureIdentifierArrayWithGlobalId,b as isFeatureIdentifierArrayWithObjectId,w as isFeatureIdentifierWithGlobalId,g as isFeatureIdentifierWithObjectId,k as normalizeCollections,B as normalizeEdits,L as normalizeGeometries,D as shallowCloneFeature,M as uploadAssets};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.28.7",
3
+ "version": "4.28.9",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- const b="20231103",c="20d65e53b5fc8739cf2fd1a2abb2fa9c964db5d3";export{b as buildDate,c as commitHash};
5
+ const f="20231109",a="bd3f0f31f667aa883ebe3002833f813cc4a75869";export{f as buildDate,a as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{generateBracedUUID as e}from"../../core/uuid.js";const r=e(),t=new Map,n=new Map,o=new Map;async function s(e,t,o=!1){if(!e||!t)return!0;const s=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),a=n.get(s)?.entries();if(a)for(const[n,i]of a)if(i.name===t){const e=!i.stack?.hasForwardEdits();if(!e&&o){const[{deleteForwardEdits:e},{default:t}]=await Promise.all([import("../../rest/versionManagement/gdbVersion/deleteForwardEdits.js"),import("../../rest/versionManagement/gdbVersion/support/DeleteForwardEditsParameters.js")]);return e(s,n,new t({sessionId:r,moment:i.moment}))}return e}return!0}function a(e,r){if(!e)return!1;const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),o=n.get(t)?.entries();if(o)for(const[n,s]of o)if(s.name===r){return"edit"===s.lockType}return!1}export{r as currentSessionId,t as defaultVersionNameLookup,s as isSafeToEditVersion,a as isVersionInEditSession,n as versionCollection,o as versionCollectionCount};
5
+ import{generateLowercaseBracedUUID as e}from"../../core/uuid.js";const r=e(),t=new Map,n=new Map,o=new Map;async function s(e,t,o=!1){if(!e||!t)return!0;const s=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),a=n.get(s)?.entries();if(a)for(const[n,i]of a)if(i.name===t){const e=!i.stack?.hasForwardEdits();if(!e&&o){const[{deleteForwardEdits:e},{default:t}]=await Promise.all([import("../../rest/versionManagement/gdbVersion/deleteForwardEdits.js"),import("../../rest/versionManagement/gdbVersion/support/DeleteForwardEditsParameters.js")]);return e(s,n,new t({sessionId:r,moment:i.moment}))}return e}return!0}function a(e,r){if(!e)return!1;const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),o=n.get(t)?.entries();if(o)for(const[n,s]of o)if(s.name===r){return"edit"===s.lockType}return!1}export{r as currentSessionId,t as defaultVersionNameLookup,s as isSafeToEditVersion,a as isVersionInEditSession,n as versionCollection,o as versionCollectionCount};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{bidiText as t}from"../../../../../core/BidiText.js";import"../../../../../core/Error.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{throwIfAborted as r,isAbortError as i}from"../../../../../core/promiseUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{diff as o,hasDiff as n}from"../../../../../core/accessorSupport/diffUtils.js";import l from"../../../../../geometry/SpatialReference.js";import{isAggregateId as c}from"../../../engine/webgl/DisplayId.js";import{WGLSymbologyType as d}from"../../../engine/webgl/enums.js";import{MeshData as h}from"../../../engine/webgl/mesh/MeshData.js";import{WGLMeshFactory as f}from"../../../engine/webgl/mesh/factories/WGLMeshFactory.js";import{WGLTemplateStore as u}from"../../../engine/webgl/mesh/templates/WGLTemplateStore.js";import{createMatcher as m}from"../../../engine/webgl/util/Matcher.js";import{codepoints as g}from"../textUtils.js";import p from"./BaseProcessor.js";import y from"../support/ResourceManagerProxy.js";function _(e,t){const s=t-t/2,r=t+t/4;return(!e.minScale||e.minScale>=s)&&(!e.maxScale||e.maxScale<=r)}function b(e){const t=e.message,s={message:{data:{},tileKey:t.tileKey,tileKeyOrigin:t.tileKeyOrigin,version:t.version},transferList:new Array};for(const r in t.data){const e=r,i=t.data[e];if(s.message.data[e]=null,null!=i){const t=i.stride,r=i.indices.slice(0),a=i.vertices.slice(0),o=i.records.slice(0),n=i.metrics?.slice(0),l={stride:t,indices:r,vertices:a,records:o,metrics:n};s.transferList.push(r,a,o),s.message.data[e]=l}}return s}let S=class extends p{constructor(){super(...arguments),this.type="symbol",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.addHandles([this.tileStore.on("update",this.onTileUpdate.bind(this))]),this._resourceManagerProxy=new y(this.remoteClient)}destroy(){this._resourceManagerProxy.destroy()}get supportsTileUpdates(){return!0}forEachBufferId(e){this._bufferIds.forEach((t=>{t.forEach(e)}))}async update(e,t){const s=t.schema.processors[0];if("symbol"!==s.type)return;const r=o(this._schema,s);(n(r,"mesh")||n(r,"target"))&&(e.mesh=!0,e.why?.mesh.push("Symbology changed"),this._schema=s,this._factory=this._createFactory(s),this._factory.update(s,this.tileStore.tileScheme.tileInfo))}onTileMessage(e,t,s,i){return r(i),this._onTileData(e,t,s,i)}onTileClear(e,t){const s={clear:!0,end:t};return this._bufferData.delete(e.key.id),this._bufferIds.delete(e.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:s})}onTileError(e,t,s){const r=s.signal,i={tileKey:e.id,error:t};return this.remoteClient.invoke("tileRenderer.onTileError",i,{signal:r})}onTileUpdate(e){for(const t of e.removed)this._bufferData.has(t.key.id)&&this._bufferData.delete(t.key.id),this._bufferIds.has(t.key.id)&&this._bufferIds.delete(t.key.id);for(const t of e.added)this._bufferData.forEach((e=>{for(const s of e)s.message.tileKey===t.id&&this._updateTileMesh("append",t,b(s),[],!1,!1,null)}))}_addBufferData(e,t){this._bufferData.has(e)||this._bufferData.set(e,[]),this._bufferData.get(e)?.push(b(t))}_createFactory(e){const{geometryType:t,objectIdField:s,fields:r}=this.service,i=(e,t)=>this.remoteClient.invoke("tileRenderer.getMaterialItems",e,t),a={geometryType:t,fields:r,spatialReference:l.fromJSON(this.spatialReference)},o=new u(i,this.tileStore.tileScheme.tileInfo),{matcher:n,aggregateMatcher:c}=e.mesh;return this._store=o,this._matchers.feature=m(n,o,a,this._resourceManagerProxy),this._matchers.aggregate=c?m(c,o,a,this._resourceManagerProxy):null,new f(t,s,o)}async _onTileData(e,t,s,i){r(i);const{type:a,addOrUpdate:o,remove:n,clear:l,end:c}=t,d=!!this._schema.mesh.sortKey;if(!o){const t={type:a,addOrUpdate:null,remove:n,clear:l,end:c,sort:d};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t},i)}const h=this._processFeatures(e,o,s,i,t.status?.version);try{const s=await h;if(null==s){const t={type:a,addOrUpdate:null,remove:n,clear:l,end:c,sort:d};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t},i)}const r=[];for(const t of s){let s=!1;const i=t.message.bufferIds,a=e.key.id,o=t.message.tileKey;if(a!==o&&null!=i){if(!this.tileStore.get(o)){this._addBufferData(a,t),r.push(t);continue}let e=this._bufferIds.get(o);e||(e=new Set,this._bufferIds.set(o,e));const n=Array.from(i);for(const t of n){if(e.has(t)){s=!0;break}e.add(t)}}s||(this._addBufferData(a,t),r.push(t))}await Promise.all(r.map((s=>{const r=e.key.id===s.message.tileKey,o=r?t.remove:[],n=r&&t.end;return this._updateTileMesh(a,e,s,o,n,!!t.clear,i.signal)})))}catch(f){this._handleError(e,f,i)}}async _updateTileMesh(e,t,s,i,a,o,n){const l=e,c=s.message.tileKey,d=!!this._schema.mesh.sortKey;c!==t.key.id&&(a=!1);const h=s?.message,f={type:l,addOrUpdate:h,remove:i,clear:o,end:a,sort:d},u={transferList:s?.transferList??[],signal:n};return r(u),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:c,data:f},u)}async _processFeatures(e,t,s,i,a){if(null==t||!t.hasFeatures)return null;const o={transform:e.transform,hasZ:!1,hasM:!1},n=this._factory,l={viewingMode:"",scale:e.scale},c=await this._matchers.feature,d=await this._matchers.aggregate;r(i);const h=this._getLabelInfos(e,t);return await n.analyze(t.getCursor(),this._resourceManagerProxy,c,d,o,l),r(i),this._writeFeatureSet(e,t,o,h,n,s,a)}_writeFeatureSet(e,t,s,r,i,a,o){const n=t.getSize(),l=this._schema.mesh.matcher.symbologyType,c=new h(e.key.id,{features:n,records:n,metrics:0},l,a,l!==d.HEATMAP,o),f={viewingMode:"",scale:e.scale},u=t.getCursor();for(;u.next();)try{const t=u.getDisplayId(),a=null!=r?r.get(t):null;i.writeCursor(c,u,s,f,e.level,a,this._resourceManagerProxy)}catch(g){}const m=e.tileInfoView.tileInfo.isWrappable;return c.serialize(m)}_handleError(e,t,s){if(!i(t)){const r={tileKey:e.id,error:t.message};return this.remoteClient.invoke("tileRenderer.onTileError",r,{signal:s.signal})}return Promise.resolve()}_getLabelingSchemaForScale(e){const t=this._schema.mesh.labels;if(null==t)return null;if("subtype"===t.type){const s={type:"subtype",classes:{}};let r=!1;for(const i in t.classes){const a=t.classes[i].filter((t=>_(t,e.scale)));r=r||!!a.length,s.classes[i]=a}return r?s:null}const s=t.classes.filter((t=>_(t,e.scale)));return s.length?{type:"simple",classes:s}:null}_getLabels(e,t){if("subtype"===t.type){const r=this.service.subtypeField;s(r,"Expected to find subtype Field");const i=e.readAttribute(r);return null==i?[]:t.classes[i]??[]}return t.classes}_getLabelInfos(e,s){const r=this._getLabelingSchemaForScale(e);if(null==r)return null;const i=new Map,a=s.getCursor();for(;a.next();){const e=a.getDisplayId(),s=[],o=c(e),n=o&&1!==a.readAttribute("cluster_count")?"aggregate":"feature",l=this._getLabels(a,r);for(const r of l){if(r.target!==n)continue;const i=a.getStorage(),l=o&&"feature"===n?i.getComputedStringAtIndex(a.readAttribute("referenceId"),r.fieldIndex):i.getComputedStringAtIndex(e,r.fieldIndex);if(!l)continue;const c=t(l.toString()),d=c[0],h=c[1];this._store.getMosaicItem(r.symbol,g(d)).then((e=>{s[r.index]={glyphs:e.glyphMosaicItems??[],rtl:h,index:r.index}}))}i.set(e,s)}return i}};S=e([a("esri.views.2d.layers.features.processors.SymbolProcessor")],S);const w=S;export{w as default};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{bidiText as t}from"../../../../../core/BidiText.js";import"../../../../../core/Error.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{throwIfAborted as r,isAbortError as i}from"../../../../../core/promiseUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{diff as o,hasDiff as n}from"../../../../../core/accessorSupport/diffUtils.js";import l from"../../../../../geometry/SpatialReference.js";import{isAggregateId as c}from"../../../engine/webgl/DisplayId.js";import{WGLSymbologyType as d}from"../../../engine/webgl/enums.js";import{MeshData as h}from"../../../engine/webgl/mesh/MeshData.js";import{WGLMeshFactory as f}from"../../../engine/webgl/mesh/factories/WGLMeshFactory.js";import{WGLTemplateStore as u}from"../../../engine/webgl/mesh/templates/WGLTemplateStore.js";import{createMatcher as m}from"../../../engine/webgl/util/Matcher.js";import{codepoints as g}from"../textUtils.js";import p from"./BaseProcessor.js";import y from"../support/ResourceManagerProxy.js";function _(e,t){const s=t-t/4,r=t+t/2;return(!e.minScale||e.minScale>=s)&&(!e.maxScale||e.maxScale<=r)}function b(e){const t=e.message,s={message:{data:{},tileKey:t.tileKey,tileKeyOrigin:t.tileKeyOrigin,version:t.version},transferList:new Array};for(const r in t.data){const e=r,i=t.data[e];if(s.message.data[e]=null,null!=i){const t=i.stride,r=i.indices.slice(0),a=i.vertices.slice(0),o=i.records.slice(0),n=i.metrics?.slice(0),l={stride:t,indices:r,vertices:a,records:o,metrics:n};s.transferList.push(r,a,o),s.message.data[e]=l}}return s}let S=class extends p{constructor(){super(...arguments),this.type="symbol",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.addHandles([this.tileStore.on("update",this.onTileUpdate.bind(this))]),this._resourceManagerProxy=new y(this.remoteClient)}destroy(){this._resourceManagerProxy.destroy()}get supportsTileUpdates(){return!0}forEachBufferId(e){this._bufferIds.forEach((t=>{t.forEach(e)}))}async update(e,t){const s=t.schema.processors[0];if("symbol"!==s.type)return;const r=o(this._schema,s);(n(r,"mesh")||n(r,"target"))&&(e.mesh=!0,e.why?.mesh.push("Symbology changed"),this._schema=s,this._factory=this._createFactory(s),this._factory.update(s,this.tileStore.tileScheme.tileInfo))}onTileMessage(e,t,s,i){return r(i),this._onTileData(e,t,s,i)}onTileClear(e,t){const s={clear:!0,end:t};return this._bufferData.delete(e.key.id),this._bufferIds.delete(e.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:s})}onTileError(e,t,s){const r=s.signal,i={tileKey:e.id,error:t};return this.remoteClient.invoke("tileRenderer.onTileError",i,{signal:r})}onTileUpdate(e){for(const t of e.removed)this._bufferData.has(t.key.id)&&this._bufferData.delete(t.key.id),this._bufferIds.has(t.key.id)&&this._bufferIds.delete(t.key.id);for(const t of e.added)this._bufferData.forEach((e=>{for(const s of e)s.message.tileKey===t.id&&this._updateTileMesh("append",t,b(s),[],!1,!1,null)}))}_addBufferData(e,t){this._bufferData.has(e)||this._bufferData.set(e,[]),this._bufferData.get(e)?.push(b(t))}_createFactory(e){const{geometryType:t,objectIdField:s,fields:r}=this.service,i=(e,t)=>this.remoteClient.invoke("tileRenderer.getMaterialItems",e,t),a={geometryType:t,fields:r,spatialReference:l.fromJSON(this.spatialReference)},o=new u(i,this.tileStore.tileScheme.tileInfo),{matcher:n,aggregateMatcher:c}=e.mesh;return this._store=o,this._matchers.feature=m(n,o,a,this._resourceManagerProxy),this._matchers.aggregate=c?m(c,o,a,this._resourceManagerProxy):null,new f(t,s,o)}async _onTileData(e,t,s,i){r(i);const{type:a,addOrUpdate:o,remove:n,clear:l,end:c}=t,d=!!this._schema.mesh.sortKey;if(!o){const t={type:a,addOrUpdate:null,remove:n,clear:l,end:c,sort:d};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t},i)}const h=this._processFeatures(e,o,s,i,t.status?.version);try{const s=await h;if(null==s){const t={type:a,addOrUpdate:null,remove:n,clear:l,end:c,sort:d};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:e.id,data:t},i)}const r=[];for(const t of s){let s=!1;const i=t.message.bufferIds,a=e.key.id,o=t.message.tileKey;if(a!==o&&null!=i){if(!this.tileStore.get(o)){this._addBufferData(a,t),r.push(t);continue}let e=this._bufferIds.get(o);e||(e=new Set,this._bufferIds.set(o,e));const n=Array.from(i);for(const t of n){if(e.has(t)){s=!0;break}e.add(t)}}s||(this._addBufferData(a,t),r.push(t))}await Promise.all(r.map((s=>{const r=e.key.id===s.message.tileKey,o=r?t.remove:[],n=r&&t.end;return this._updateTileMesh(a,e,s,o,n,!!t.clear,i.signal)})))}catch(f){this._handleError(e,f,i)}}async _updateTileMesh(e,t,s,i,a,o,n){const l=e,c=s.message.tileKey,d=!!this._schema.mesh.sortKey;c!==t.key.id&&(a=!1);const h=s?.message,f={type:l,addOrUpdate:h,remove:i,clear:o,end:a,sort:d},u={transferList:s?.transferList??[],signal:n};return r(u),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:c,data:f},u)}async _processFeatures(e,t,s,i,a){if(null==t||!t.hasFeatures)return null;const o={transform:e.transform,hasZ:!1,hasM:!1},n=this._factory,l={viewingMode:"",scale:e.scale},c=await this._matchers.feature,d=await this._matchers.aggregate;r(i);const h=this._getLabelInfos(e,t);return await n.analyze(t.getCursor(),this._resourceManagerProxy,c,d,o,l),r(i),this._writeFeatureSet(e,t,o,h,n,s,a)}_writeFeatureSet(e,t,s,r,i,a,o){const n=t.getSize(),l=this._schema.mesh.matcher.symbologyType,c=new h(e.key.id,{features:n,records:n,metrics:0},l,a,l!==d.HEATMAP,o),f={viewingMode:"",scale:e.scale},u=t.getCursor();for(;u.next();)try{const t=u.getDisplayId(),a=null!=r?r.get(t):null;i.writeCursor(c,u,s,f,e.level,a,this._resourceManagerProxy)}catch(g){}const m=e.tileInfoView.tileInfo.isWrappable;return c.serialize(m)}_handleError(e,t,s){if(!i(t)){const r={tileKey:e.id,error:t.message};return this.remoteClient.invoke("tileRenderer.onTileError",r,{signal:s.signal})}return Promise.resolve()}_getLabelingSchemaForScale(e){const t=this._schema.mesh.labels;if(null==t)return null;if("subtype"===t.type){const s={type:"subtype",classes:{}};let r=!1;for(const i in t.classes){const a=t.classes[i].filter((t=>_(t,e.scale)));r=r||!!a.length,s.classes[i]=a}return r?s:null}const s=t.classes.filter((t=>_(t,e.scale)));return s.length?{type:"simple",classes:s}:null}_getLabels(e,t){if("subtype"===t.type){const r=this.service.subtypeField;s(r,"Expected to find subtype Field");const i=e.readAttribute(r);return null==i?[]:t.classes[i]??[]}return t.classes}_getLabelInfos(e,s){const r=this._getLabelingSchemaForScale(e);if(null==r)return null;const i=new Map,a=s.getCursor();for(;a.next();){const e=a.getDisplayId(),s=[],o=c(e),n=o&&1!==a.readAttribute("cluster_count")?"aggregate":"feature",l=this._getLabels(a,r);for(const r of l){if(r.target!==n)continue;const i=a.getStorage(),l=o&&"feature"===n?i.getComputedStringAtIndex(a.readAttribute("referenceId"),r.fieldIndex):i.getComputedStringAtIndex(e,r.fieldIndex);if(!l)continue;const c=t(l.toString()),d=c[0],h=c[1];this._store.getMosaicItem(r.symbol,g(d)).then((e=>{s[r.index]={glyphs:e.glyphMosaicItems??[],rtl:h,index:r.index}}))}i.set(e,s)}return i}};S=e([a("esri.views.2d.layers.features.processors.SymbolProcessor")],S);const w=S;export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- let e;const t=new Map;async function n(n){null==e&&(e=import("../../../layers/VoxelWasmPerSceneView.js"));const r=n.view,o=t.get(r);if(o)return o.addVoxelLayer(n);return(await e.then((e=>{const n=new e.default({view:r});return t.set(r,n),n}))).addVoxelLayer(n)}function r(e){return t.get(e)}function o(n){const r=n.view,o=t.get(r);if(o){o.removeVoxelLayer(n)<1&&(t.delete(r),0===t.size&&(e=null))}}export{n as addLayerViewToWasm,r as getVoxelWasm,o as removeLayerViewFromWasm};
5
+ let e,n=null;const t=new Map;async function l(l){null==n&&(null==e&&(e=import("../../../layers/VoxelWasmPerSceneView.js")),n=await e);const o=l.view;let i=t.get(o);return i||(i=new n.default({view:o}),t.set(o,i)),i.addVoxelLayer(l)}function o(e){return t.get(e)}function i(l){const o=l.view,i=t.get(o);if(i){i.removeVoxelLayer(l)<1&&(t.delete(o),0===t.size&&(e=null,n=null))}}export{l as addLayerViewToWasm,o as getVoxelWasm,i as removeLayerViewFromWasm};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import"../../intl.js";import{isSome as e}from"../../core/arrayUtils.js";import{neverReached as t}from"../../core/compilerUtils.js";import{templateHasKey as n,replace as r}from"../../core/string.js";import{DomainValidationError as o}from"../../layers/support/domainUtils.js";import{isTimeOnlyField as i,NumericRangeValidationError as l,TypeValidationError as a}from"../../layers/support/fieldUtils.js";import{isAnyDateField as s}from"../../smartMapping/support/utils.js";import{getLabelForDateFieldValue as u,getIntlOptionsForField as p}from"../support/dateUtils.js";import{substitute as m}from"../../intl/substitute.js";const d=e=>"field"===e?.type,c=e=>"group"===e?.type,f=e=>"relationship"===e?.type,y=e=>!c(e)&&null!=e.group,b=e=>"field"===e.type,T=e=>"group"===e.type,E=e=>"relationship"===e.type,g=e=>e.reduce(((e,t)=>c(t)?[...e,...t.inputs]:[...e,t]),[]),v=e=>g(e).filter(d),O=e=>g(e).filter(f),j=e=>null!=e&&(x(e,"combo-box")||x(e,"radio-buttons")),x=(e,t)=>null!=e&&e.input?.type===t,V=e=>null!=e&&(x(e,"text-box")||x(e,"text-area")),h=({domain:e,inputType:t="text-box",dataType:n})=>"number"===n&&"text-box"===t&&(!e||"coded-value"!==e.type),U=e=>"items"in e,N={typeFieldName:null,types:[]};function _(t){const{attributes:r,fieldsIndex:o,label:i,timeZone:l}=t;if(!r||"object"!=typeof r)return i;const a=Object.keys(r).filter((e=>n(i,e))),s=a.map((e=>r[e])),u=a.map((e=>o.get(e))).filter(e);return I(i,A({values:s,fields:u,timeZone:l}))}function A(e){const{fields:t,values:n}=e,r=e.timeZone??void 0,o=t.map(((e,t)=>{let o=n[t];if(e.domain&&"coded-value"===e.domain.type){const t=e.domain.codedValues.find((e=>e.code===o));t?.name&&(o=t.name)}return(s(e)||i(e))&&(o=u(e,o,{timeZone:r,...p(e)})),[e.name,o]}));return Object.fromEntries(o)}function I(e,t){return r(r(e,(e=>`{${e.toLowerCase()}}`)),Object.fromEntries(Object.entries(t).map((([e,t])=>[e.toLowerCase(),t]))))}const L=e=>e?"subtype-sublayer"===e.type?{typeFieldName:e.parent?.subtypeField,types:e.parent?.subtypes??[]}:"types"in e&&e.types?{typeFieldName:e.typeIdField,types:e.types.map((({id:e,name:t,domains:n})=>({code:e,name:t,domains:n})))}:N:N,F=(e,t)=>{if(!e)return!0;const{operations:n}=e;switch(t){case"INSERT":return n.supportsAdd;case"UPDATE":case"DELETE":return n.supportsUpdate;default:return!0}};var D;!function(e){e.TOO_SHORT="length-validation-error::too-short"}(D||(D={}));const R={type:"number"},Z={type:"number",intlOptions:{notation:"scientific"}},w={day:"2-digit",month:"2-digit",year:"numeric"},C={hour:"numeric",minute:"numeric",second:"numeric"},S={...w,...C};function G(e){return e>=1e7||e<=-1e7}const H=(e,t,n)=>{const{dataType:r,error:i,minLength:s,value:u,required:p}=e;if(!t||!i)return null;if(p&&null===u)return t.validationErrors.cannotBeNull;if(i===o.VALUE_OUT_OF_RANGE||i===l.OUT_OF_RANGE){const{field:o,range:i}=e,l={type:"date",intlOptions:{..."time-only"===o.type?C:"date-only"===o.type?w:S,timeZone:n??void 0}};return m(t.validationErrors.outsideRange,i,{format:{max:"date"===r?l:null!=i.max&&G(i.max)?Z:R,min:"date"===r?l:null!=i.min&&G(i.min)?Z:R}})}return i===o.INVALID_CODED_VALUE?t.validationErrors.invalidCodedValue:i===a.INVALID_TYPE?t.validationErrors.invalidType:i===D.TOO_SHORT?m(t.validationErrors.tooShort,{min:s}):null},P=e=>{if(!e)return;const t=e.layer,n=t&&"geometryType"in t?t.geometryType:void 0,r=e.geometry?.type;return"polyline"===r||"polyline"===n?"line":r||n||"table"},k=e=>{const t=[];if(e.formTemplate){const{description:r,title:o}=e.formTemplate;e.fields?.forEach((e=>{const i=o&&n(o,e.name),l=r&&n(r,e.name);(i||l)&&t.push(e.name)}))}return t};function q(e){if("formTemplate"in e&&e.formTemplate){return(e.formTemplate.elements?.filter(b)??[]).some((({fieldName:t})=>!e.fieldsIndex.get(t)))}return!1}function B(e,t){return null==e||t.onValue!==e&&t.offValue!==e}function M(e,n){switch(n.objectType){case"any":return!0;case"null":return null==e;case"code":return e===n.codedValue?.code;case"range":return null!=e&&null!=n.minValue&&null!=n.maxValue&&+e>=n.minValue&&+e<=n.maxValue;default:return t(n.objectType),!1}}export{D as LengthValidationError,F as capabilitiesAllowEditType,v as flattenFieldInputs,g as flattenInputs,O as flattenRelationshipInputs,q as formTemplateHasInvalidFields,A as getComputedAttributes,H as getErrorMessageForFieldInput,k as getFieldsInTitleAndDesc,P as getIconForFeature,L as getNormalizedFeatureTypeInfo,b as isFieldElement,x as isFieldElementWithInputType,j as isFieldElementWithShowNoValueOptionInput,V as isFieldElementWithTextInput,d as isFieldInput,T as isGroupElement,c as isGroupInput,y as isInputInGroupInput,h as isNumberFieldInput,E as isRelationshipElement,f as isRelationshipInput,U as isTemplateItemGroup,_ as parseFormTemplateString,I as substituteFieldTemplatesInString,B as valueIsInvalidSwitchValue,M as valueIsValidContingentValue};
5
+ import"../../intl.js";import{isSome as e}from"../../core/arrayUtils.js";import{neverReached as t}from"../../core/compilerUtils.js";import{templateHasKey as n,replace as r}from"../../core/string.js";import{DomainValidationError as o}from"../../layers/support/domainUtils.js";import{isTimeOnlyField as i,NumericRangeValidationError as l,TypeValidationError as a}from"../../layers/support/fieldUtils.js";import{isAnyDateField as s}from"../../smartMapping/support/utils.js";import{getLabelForDateFieldValue as u,getIntlOptionsForField as p}from"../support/dateUtils.js";import{substitute as m}from"../../intl/substitute.js";const d=e=>"field"===e?.type,c=e=>"group"===e?.type,f=e=>"relationship"===e?.type,y=e=>!c(e)&&null!=e.group,b=e=>"field"===e.type,T=e=>"group"===e.type,E=e=>"relationship"===e.type,v=e=>e.reduce(((e,t)=>c(t)?[...e,...t.inputs]:[...e,t]),[]),O=e=>v(e).filter(d),j=e=>v(e).filter(f),x=e=>null!=e&&(g(e,"combo-box")||g(e,"radio-buttons")),g=(e,t)=>null!=e&&e.input?.type===t,V=e=>null!=e&&(g(e,"text-box")||g(e,"text-area")),U=({domain:e,inputType:t="text-box",dataType:n})=>"number"===n&&"text-box"===t&&(!e||"coded-value"!==e.type),h=e=>"items"in e,N={typeFieldName:null,types:[]};function _(t){const{attributes:r,fieldsIndex:o,label:i,timeZone:l}=t;if(!r||"object"!=typeof r)return i;const a=Object.keys(r).filter((e=>n(i,e))),s=a.map((e=>r[e])),u=a.map((e=>o.get(e))).filter(e);return I(i,A({values:s,fields:u,timeZone:l}))}function A(e){const{fields:t,values:n}=e,r=e.timeZone??void 0,o=t.map(((e,t)=>{let o=n[t];if(e.domain&&"coded-value"===e.domain.type){const t=e.domain.codedValues.find((e=>e.code===o));t?.name&&(o=t.name)}return(s(e)||i(e))&&(o=u(e,o,{timeZone:r,...p(e)})),[e.name,o]}));return Object.fromEntries(o)}function I(e,t){return r(r(e,(e=>`{${e.toLowerCase()}}`)),Object.fromEntries(Object.entries(t).map((([e,t])=>[e.toLowerCase(),t]))))}const L=e=>e?"subtype-sublayer"===e.type?{typeFieldName:e.parent?.subtypeField,types:e.parent?.subtypes??[]}:"types"in e&&e.types?{typeFieldName:e.typeIdField,types:e.types.map((({id:e,name:t,domains:n})=>({code:e,name:t,domains:n})))}:N:N,F=(e,t)=>{if(!e)return!0;const{operations:n}=e;switch(t){case"INSERT":return n.supportsAdd;case"UPDATE":case"DELETE":return n.supportsUpdate;default:return!0}};var D;!function(e){e.TOO_SHORT="length-validation-error::too-short"}(D||(D={}));const R={type:"number"},Z={type:"number",intlOptions:{notation:"scientific"}};function w(e){return e>=1e7||e<=-1e7}const C=(e,t,n)=>{const{dataType:r,error:i,minLength:s,value:u,required:d}=e;if(!t||!i)return null;if(d&&null===u)return t.validationErrors.cannotBeNull;if(i===o.VALUE_OUT_OF_RANGE||i===l.OUT_OF_RANGE){const{field:o,range:i}=e,l={type:"date",intlOptions:{timeZone:n??void 0,...p(o)}};return m(t.validationErrors.outsideRange,i,{format:{max:"date"===r?l:null!=i.max&&w(i.max)?Z:R,min:"date"===r?l:null!=i.min&&w(i.min)?Z:R}})}return i===o.INVALID_CODED_VALUE?t.validationErrors.invalidCodedValue:i===a.INVALID_TYPE?t.validationErrors.invalidType:i===D.TOO_SHORT?m(t.validationErrors.tooShort,{min:s}):null},S=e=>{if(!e)return;const t=e.layer,n=t&&"geometryType"in t?t.geometryType:void 0,r=e.geometry?.type;return"polyline"===r||"polyline"===n?"line":r||n||"table"},G=e=>{const t=[];if(e.formTemplate){const{description:r,title:o}=e.formTemplate;e.fields?.forEach((e=>{const i=o&&n(o,e.name),l=r&&n(r,e.name);(i||l)&&t.push(e.name)}))}return t};function H(e){if("formTemplate"in e&&e.formTemplate){return(e.formTemplate.elements?.filter(b)??[]).some((({fieldName:t})=>!e.fieldsIndex.get(t)))}return!1}function P(e,t){return null==e||t.onValue!==e&&t.offValue!==e}function k(e,n){switch(n.objectType){case"any":return!0;case"null":return null==e;case"code":return e===n.codedValue?.code;case"range":return null!=e&&null!=n.minValue&&null!=n.maxValue&&+e>=n.minValue&&+e<=n.maxValue;default:return t(n.objectType),!1}}export{D as LengthValidationError,F as capabilitiesAllowEditType,O as flattenFieldInputs,v as flattenInputs,j as flattenRelationshipInputs,H as formTemplateHasInvalidFields,A as getComputedAttributes,C as getErrorMessageForFieldInput,G as getFieldsInTitleAndDesc,S as getIconForFeature,L as getNormalizedFeatureTypeInfo,b as isFieldElement,g as isFieldElementWithInputType,x as isFieldElementWithShowNoValueOptionInput,V as isFieldElementWithTextInput,d as isFieldInput,T as isGroupElement,c as isGroupInput,y as isInputInGroupInput,U as isNumberFieldInput,E as isRelationshipElement,f as isRelationshipInput,h as isTemplateItemGroup,_ as parseFormTemplateString,I as substituteFieldTemplatesInString,P as valueIsInvalidSwitchValue,k as valueIsValidContingentValue};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[299,5935],{44543:(e,t,r)=>{r.d(t,{F:()=>f,M:()=>i});const i={Base64:0,Hex:1,String:2,Raw:3},s=8,n=(1<<s)-1;function o(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function a(e){const t=[];for(let r=0,i=e.length*s;r<i;r+=s)t[r>>5]|=(e.charCodeAt(r/s)&n)<<r%32;return t}function l(e){const t=[];for(let r=0,i=32*e.length;r<i;r+=s)t.push(String.fromCharCode(e[r>>5]>>>r%32&n));return t.join("")}function d(e,t,r,i,s,n){return o(function(e,t){return e<<t|e>>>32-t}(o(o(t,e),o(i,n)),s),r)}function u(e,t,r,i,s,n,o){return d(t&r|~t&i,e,t,s,n,o)}function c(e,t,r,i,s,n,o){return d(t&i|r&~i,e,t,s,n,o)}function p(e,t,r,i,s,n,o){return d(t^r^i,e,t,s,n,o)}function y(e,t,r,i,s,n,o){return d(r^(t|~i),e,t,s,n,o)}function h(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;let r=1732584193,i=-271733879,s=-1732584194,n=271733878;for(let t=0;t<e.length;t+=16){const a=r,l=i,d=s,h=n;r=u(r,i,s,n,e[t],7,-680876936),n=u(n,r,i,s,e[t+1],12,-389564586),s=u(s,n,r,i,e[t+2],17,606105819),i=u(i,s,n,r,e[t+3],22,-1044525330),r=u(r,i,s,n,e[t+4],7,-176418897),n=u(n,r,i,s,e[t+5],12,1200080426),s=u(s,n,r,i,e[t+6],17,-1473231341),i=u(i,s,n,r,e[t+7],22,-45705983),r=u(r,i,s,n,e[t+8],7,1770035416),n=u(n,r,i,s,e[t+9],12,-1958414417),s=u(s,n,r,i,e[t+10],17,-42063),i=u(i,s,n,r,e[t+11],22,-1990404162),r=u(r,i,s,n,e[t+12],7,1804603682),n=u(n,r,i,s,e[t+13],12,-40341101),s=u(s,n,r,i,e[t+14],17,-1502002290),i=u(i,s,n,r,e[t+15],22,1236535329),r=c(r,i,s,n,e[t+1],5,-165796510),n=c(n,r,i,s,e[t+6],9,-1069501632),s=c(s,n,r,i,e[t+11],14,643717713),i=c(i,s,n,r,e[t],20,-373897302),r=c(r,i,s,n,e[t+5],5,-701558691),n=c(n,r,i,s,e[t+10],9,38016083),s=c(s,n,r,i,e[t+15],14,-660478335),i=c(i,s,n,r,e[t+4],20,-405537848),r=c(r,i,s,n,e[t+9],5,568446438),n=c(n,r,i,s,e[t+14],9,-1019803690),s=c(s,n,r,i,e[t+3],14,-187363961),i=c(i,s,n,r,e[t+8],20,1163531501),r=c(r,i,s,n,e[t+13],5,-1444681467),n=c(n,r,i,s,e[t+2],9,-51403784),s=c(s,n,r,i,e[t+7],14,1735328473),i=c(i,s,n,r,e[t+12],20,-1926607734),r=p(r,i,s,n,e[t+5],4,-378558),n=p(n,r,i,s,e[t+8],11,-2022574463),s=p(s,n,r,i,e[t+11],16,1839030562),i=p(i,s,n,r,e[t+14],23,-35309556),r=p(r,i,s,n,e[t+1],4,-1530992060),n=p(n,r,i,s,e[t+4],11,1272893353),s=p(s,n,r,i,e[t+7],16,-155497632),i=p(i,s,n,r,e[t+10],23,-1094730640),r=p(r,i,s,n,e[t+13],4,681279174),n=p(n,r,i,s,e[t],11,-358537222),s=p(s,n,r,i,e[t+3],16,-722521979),i=p(i,s,n,r,e[t+6],23,76029189),r=p(r,i,s,n,e[t+9],4,-640364487),n=p(n,r,i,s,e[t+12],11,-421815835),s=p(s,n,r,i,e[t+15],16,530742520),i=p(i,s,n,r,e[t+2],23,-995338651),r=y(r,i,s,n,e[t],6,-198630844),n=y(n,r,i,s,e[t+7],10,1126891415),s=y(s,n,r,i,e[t+14],15,-1416354905),i=y(i,s,n,r,e[t+5],21,-57434055),r=y(r,i,s,n,e[t+12],6,1700485571),n=y(n,r,i,s,e[t+3],10,-1894986606),s=y(s,n,r,i,e[t+10],15,-1051523),i=y(i,s,n,r,e[t+1],21,-2054922799),r=y(r,i,s,n,e[t+8],6,1873313359),n=y(n,r,i,s,e[t+15],10,-30611744),s=y(s,n,r,i,e[t+6],15,-1560198380),i=y(i,s,n,r,e[t+13],21,1309151649),r=y(r,i,s,n,e[t+4],6,-145523070),n=y(n,r,i,s,e[t+11],10,-1120210379),s=y(s,n,r,i,e[t+2],15,718787259),i=y(i,s,n,r,e[t+9],21,-343485551),r=o(r,a),i=o(i,l),s=o(s,d),n=o(n,h)}return[r,i,s,n]}function f(e,t=i.Hex){const r=t||i.Base64,n=h(a(e),e.length*s);switch(r){case i.Raw:return n;case i.Hex:return function(e){const t="0123456789abcdef",r=[];for(let i=0,s=4*e.length;i<s;i++)r.push(t.charAt(e[i>>2]>>i%4*8+4&15)+t.charAt(e[i>>2]>>i%4*8&15));return r.join("")}(n);case i.String:return l(n);case i.Base64:return function(e){const t=[];for(let r=0,i=4*e.length;r<i;r+=3){const i=(e[r>>2]>>r%4*8&255)<<16|(e[r+1>>2]>>(r+1)%4*8&255)<<8|e[r+2>>2]>>(r+2)%4*8&255;for(let s=0;s<4;s++)8*r+6*s>32*e.length?t.push("="):t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>6*(3-s)&63))}return t.join("")}(n)}}},28576:(e,t,r)=>{r.d(t,{B:()=>y});var i=r(20102),s=r(44543),n=r(81153),o=r(17452),a=r(41123),l=r(7628),d=r(31263),u=r(5600),c=r(66094),p=r(25929);function y(e){const t=e?.origins??[void 0];return(r,i)=>{const s=function(e,t,r){if("resource"===e?.type)return function(e,t,r){const i=(0,l.Oe)(t,r);return{type:String,read:(e,t,r)=>{const s=(0,p.r)(e,t,r);return i.type===String?s:"function"==typeof i.type?new i.type({url:s}):void 0},write:{writer(t,s,a,l){if(!l?.resources)return"string"==typeof t?void(s[a]=(0,p.t)(t,l)):void(s[a]=t.write({},l));const u=function(e){return null==e?null:"string"==typeof e?e:e.url}(t),y=(0,p.t)(u,{...l,verifyItemRelativeUrls:l?.verifyItemRelativeUrls?{writtenUrls:l.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},p.M.NO),g=i.type!==String&&(!(0,n.l)(this)||l?.origin&&this.originIdOf(r)>(0,d.M9)(l.origin)),b={object:this,propertyName:r,value:t,targetUrl:y,dest:s,targetPropertyName:a,context:l,params:e};l?.portalItem&&y&&!(0,o.YP)(y)?g&&e?.contentAddressed?h(b):g?function(e){const{context:t,targetUrl:r,params:i,value:s,dest:n,targetPropertyName:a}=e;if(!t.portalItem)return;const l=t.portalItem.resourceFromPath(r),d=m(s,r,t),u=(0,c.B)(d),p=(0,o.Ml)(l.path),y=i?.compress??!1;u===p?(t.resources&&f({...e,resource:l,content:d,compress:y,updates:t.resources.toUpdate}),n[a]=r):h(e)}(b):function({context:e,targetUrl:t,dest:r,targetPropertyName:i}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),r[i]=t)}(b):l?.portalItem&&(null==y||null!=(0,p.i)(y)||(0,o.jc)(y)||g)?h(b):s[a]=y}}}}(e,t,r);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:e,write:t}=p.a;return{read:e,write:t}}}}(e,r,i);for(const e of t){const t=(0,u.CJ)(r,e,i);for(const e in s)t[e]=s[e]}}}function h(e){const{targetUrl:t,params:r,value:n,context:l,dest:d,targetPropertyName:u}=e;if(!l.portalItem)return;const y=(0,p.p)(t),h=m(n,t,l);if(r?.contentAddressed&&"json"!==h.type)return void l.messages?.push(new i.Z("persistable:contentAddressingUnsupported",`Property "${u}" is trying to serializing a resource with content of type ${h.type} with content addressing. Content addressing is only supported for json resources.`,{content:h}));const g=r?.contentAddressed&&"json"===h.type?(0,s.F)(h.jsonString):y?.filename??(0,a.D)(),b=(0,o.v_)(r?.prefix??y?.prefix,g),w=`${b}.${(0,c.B)(h)}`;if(r?.contentAddressed&&l.resources&&"json"===h.type){const e=l.resources.toKeep.find((e=>e.resource.path===w))??l.resources.toAdd.find((e=>e.resource.path===w));if(e)return void(d[u]=e.resource.itemRelativeUrl)}const v=l.portalItem.resourceFromPath(w);(0,o.jc)(t)&&l.resources&&l.resources.pendingOperations.push((0,o.gi)(t).then((e=>{v.path=`${b}.${(0,c.B)({type:"blob",blob:e})}`,d[u]=v.itemRelativeUrl})).catch((()=>{})));const I=r?.compress??!1;l.resources&&f({...e,resource:v,content:h,compress:I,updates:l.resources.toAdd}),d[u]=v.itemRelativeUrl}function f({object:e,propertyName:t,updates:r,resource:i,content:s,compress:n}){r.push({resource:i,content:s,compress:n,finish:r=>{!function(e,t,r){"string"==typeof e[t]?e[t]=r.url:e[t].url=r.url}(e,t,r)}})}function m(e,t,r){return"string"==typeof e?{type:"url",url:t}:{type:"json",jsonString:JSON.stringify(e.toJSON(r))}}},41123:(e,t,r)=>{r.d(t,{D:()=>s,z:()=>n});const i="randomUUID"in crypto;function s(){if(i)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).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function n(){return`{${s()}}`}},79235:(e,t,r)=>{r.d(t,{Z:()=>w});var i,s=r(43697),n=r(67676),o=r(35454),a=r(96674),l=r(67900),d=r(20941),u=r(5600),c=(r(75215),r(80442),r(71715)),p=r(52011),y=r(30556);const h=(0,o.w)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),f=h.jsonValues.slice();(0,n.e$)(f,"orthometric");const m=(0,o.w)()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let g=i=class extends a.wq{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,r){return h.write(e,t,r)}readHeightModel(e,t,r){return h.read(e)||(r?.messages&&r.messages.push(function(e,t){return new d.Z("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:r})),null)}readHeightUnit(e,t,r){return m.read(e)||(r?.messages&&r.messages.push(b(e,{context:r})),null)}readHeightUnitService(e,t,r){return(0,l.$C)(e)||m.read(e)||(r?.messages&&r.messages.push(b(e,{context:r})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new i({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const r=(0,l.cM)(t);return new i({heightModel:e.heightModel,heightUnit:r,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new i;return t.read(e,{origin:"web-scene"}),t}};function b(e,t){return new d.Z("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,s._)([(0,u.Cb)({type:h.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:f,default:"ellipsoidal"}}}})],g.prototype,"heightModel",void 0),(0,s._)([(0,y.c)("web-scene","heightModel")],g.prototype,"writeHeightModel",null),(0,s._)([(0,c.r)(["web-scene","service"],"heightModel")],g.prototype,"readHeightModel",null),(0,s._)([(0,u.Cb)({type:m.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:m.jsonValues,write:m.write}}}})],g.prototype,"heightUnit",void 0),(0,s._)([(0,c.r)("web-scene","heightUnit")],g.prototype,"readHeightUnit",null),(0,s._)([(0,c.r)("service","heightUnit")],g.prototype,"readHeightUnitService",null),(0,s._)([(0,u.Cb)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],g.prototype,"vertCRS",void 0),(0,s._)([(0,c.r)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],g.prototype,"readVertCRS",null),g=i=(0,s._)([(0,p.j)("esri.geometry.HeightModelInfo")],g);const w=g},57476:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ge});var i=r(43697),s=r(38171),n=r(51773),o=(r(16050),r(12501),r(28756),r(92271),r(72529),r(5499),r(84382),r(81571),r(91423),r(32400)),a=r(3172),l=r(2368),d=r(46791),u=r(20102),c=r(92604),p=r(16453),y=r(95330),h=r(17445),f=r(17452),m=r(5600),g=(r(75215),r(67676),r(80442),r(1153)),b=r(71715),w=r(52011),v=r(31263),I=r(87085),_=r(54295),S=r(17287),F=r(66361),j=r(38009),C=r(16859),L=r(72965),x=r(37253),R=r(66677),O=r(71592),A=r(15506),E=r(21506),Z=r(45574),P=r(61960),M=r(85857),U=r(53518),q=r(99514),T=r(69165),N=r(51161),D=r(54306),V=r(30707),k=r(56765),G=r(87344),H=r(96674);let $=class extends H.wq{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};(0,i._)([(0,m.Cb)({type:String,json:{read:!0,write:!0}})],$.prototype,"name",void 0),(0,i._)([(0,m.Cb)({type:String,json:{read:!0,write:!0}})],$.prototype,"field",void 0),(0,i._)([(0,m.Cb)({type:[Number],json:{read:!0,write:!0}})],$.prototype,"currentRangeExtent",void 0),(0,i._)([(0,m.Cb)({type:[Number],json:{read:!0,write:!0}})],$.prototype,"fullRangeExtent",void 0),(0,i._)([(0,m.Cb)({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],$.prototype,"type",void 0),$=(0,i._)([(0,w.j)("esri.layers.support.RangeInfo")],$);var Q,J=r(22974),B=r(28576),z=r(20941),K=r(38913),W=r(73615);let Y=Q=class extends((0,H.eC)(d.Z.ofType(K.Z))){constructor(e){super(e)}clone(){return new Q(this.items.map((e=>e.clone())))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map((r=>{if(!t.equals(r.spatialReference)){if(!(0,W.canProjectWithoutEngine)(r.spatialReference,t))return e?.messages&&e.messages.push(new z.Z("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const i=new K.Z;(0,W.projectPolygon)(r,i,t),r=i}const i=r.toJSON(e);return delete i.spatialReference,i})).filter((e=>null!=e)):(e?.messages&&e.messages.push(new z.Z("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map((t=>t.toJSON(e))))}static fromJSON(e,t){const r=new Q;return e.forEach((e=>r.add(K.Z.fromJSON(e,t)))),r}};Y=Q=(0,i._)([(0,w.j)("esri.layers.support.PolygonCollection")],Y);const X=Y;var ee,te=r(25929);let re=ee=class extends H.wq{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new X,this._geometriesSource=null}initialize(){this.addHandles((0,h.on)((()=>this.geometries),"after-changes",(()=>this.geometries=this.geometries),h.Z_))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=X.fromJSON(e,r):this._geometriesSource={url:(0,te.f)(e,r),context:r}}async loadGeometries(e,t){if(null==this._geometriesSource)return;const{url:r,context:i}=this._geometriesSource,s=await(0,a.Z)(r,{responseType:"json",signal:t?.signal}),n=e.toJSON(),o=s.data.map((e=>({...e,spatialReference:n})));this.geometries=X.fromJSON(o,i),this._geometriesSource=null}clone(){const e=new ee({geometries:(0,J.d9)(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};(0,i._)([(0,m.Cb)({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],re.prototype,"spatialRelationship",void 0),(0,i._)([(0,m.Cb)({type:X,nonNullable:!0,json:{write:!0}}),(0,B.B)({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],re.prototype,"geometries",void 0),(0,i._)([(0,b.r)(["web-scene","portal-item"],"geometries")],re.prototype,"readGeometries",null),re=ee=(0,i._)([(0,w.j)("esri.layers.support.SceneFilter")],re);const ie=re;var se=r(40555),ne=r(14165),oe=r(36405),ae=r(72245),le=r(32163),de=r(2358),ue=r(19833),ce=r(65242);const pe=new Set(["3DObject","Point"]),ye=(0,U.v)();let he=class extends((0,F.o1)((0,x.Vt)((0,S.Y)((0,j.q)((0,C.I)((0,L.M)((0,p.R)((0,_.V)((0,l.J)(I.Z)))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new d.Z,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new q.Z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:N.U4.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&(0,Z.sX)(this.associatedLayer)}get geometryType(){return me[this.profile]||"mesh"}set renderer(e){(0,T.YN)(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:A.C;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:n,supportsGeometryUpdate:o,supportsReturnServiceEditsInSourceSpatialReference:a},data:{supportsZ:l,supportsM:d,isVersioned:u,supportsAttachment:c},operations:{supportsEditing:p,supportsAdd:y,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:b}}=e,w=e.operations.supportsChangeTracking,v=!!this.associatedLayer?.infoFor3D&&(0,ae.Rx)();return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:a,supportsRollbackOnFailure:s,supportsGeometryUpdate:v&&o,supportsUploadWithItemId:n},data:{supportsAttachment:c,supportsZ:l,supportsM:d,isVersioned:u},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:p&&w,supportsAdd:v&&y&&w,supportsDelete:v&&f&&w,supportsUpdate:h&&w,supportsAsyncConvert3D:b}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&fe[r]?fe[r]:(c.Z.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(y.r9),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await(0,se.y)(this,{origin:"service"},t),(0,T.YN)(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){c.Z.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ne.Z;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new u.Z("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new u.Z("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=(0,T.Lk)(this.fieldsIndex,await(0,ue.e7)(this,(0,ue.V5)(this)));return(0,de.xe)(this.parsedUrl.path,this.attributeStorageInfo??[],e,t,r)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||0===r.length)throw new u.Z("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const i=new s.Z;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(c.Z.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return(0,le.eZ)(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new u.Z("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new u.Z("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new u.Z("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new u.Z("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const e of this.statisticsInfo)if(e.name===r.name){const r=(0,f.v_)(this.parsedUrl.path,e.href);return(0,a.Z)(r,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then((e=>e.data))}throw new u.Z("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(x.xp.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(x.xp.SAVE,e)}async applyEdits(e,t){const{applyEdits:i}=await r.e(1444).then(r.bind(r,14720));let s=t;await this.load();const n=this.associatedLayer;if(!n)throw new u.Z(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:o}=n,a=!!n.infoFor3D,l=s?.globalIdUsed??!0;if(a&&null==o)throw new u.Z(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(a&&!l)throw new u.Z(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return(0,R.M8)(n.url)&&a&&null!=e.deleteFeatures&&null!=o&&(s={...s,globalIdToObjectId:await(0,Z.HW)(n,e.deleteFeatures,o)}),i(this,n.source,e,s)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new u.Z(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&!pe.has(e.layerType))throw new u.Z("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new u.Z("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new u.Z("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});!function(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new u.Z("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new u.Z("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new u.Z("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some((t=>t.name===e.name))),r=!!this.associatedLayer?.fields?.some((t=>t&&e.name===t.name)),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=(0,g.vw)(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),n=this.associatedLayer.originIdOf(i);s<n&&(n===v.s3.SERVICE||n===v.s3.PORTAL_ITEM)&&t.setAtOrigin(i,this.associatedLayer[i],n)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.editingInfo?.lastEditDate,t=this.associatedLayer?.serverGens,r=this.associatedLayer?.getAtOrigin("fullExtent","service");(0,ae.Rx)()&&null!=this.associatedLayer?.infoFor3D&&r&&(0,R.M8)(this.associatedLayer?.url)&&e&&this.serviceUpdateTimeStamp?.lastUpdate!==e.getTime()&&(this.serviceUpdateTimeStamp||t?.minServerGen!==t?.serverGen)&&(0,g.vw)(this).setAtOrigin("fullExtent",r.clone(),v.s3.SERVICE)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await(0,O.w)(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,apiKey:this.apiKey,signal:e}),s=await G.T.FeatureLayer();this.associatedLayer=new s({url:t,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(e){(0,y.D_)(e)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await(0,h.N1)((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?c.Z.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):c.Z.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&(0,oe.LR)(c.Z.getLogger(this),(0,oe.Wb)("Mesh scene layers","relative-to-scene",e)),(0,oe.LR)(c.Z.getLogger(this),(0,oe.kf)("Scene layers",e))}};(0,i._)([(0,m.Cb)({types:{key:"type",base:P.B,typeMap:{selection:M.Z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],he.prototype,"featureReduction",void 0),(0,i._)([(0,m.Cb)({type:[$],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],he.prototype,"rangeInfos",void 0),(0,i._)([(0,m.Cb)({json:{read:!1}})],he.prototype,"associatedLayer",void 0),(0,i._)([(0,m.Cb)({type:["show","hide"]})],he.prototype,"listMode",void 0),(0,i._)([(0,m.Cb)({type:["ArcGISSceneServiceLayer"]})],he.prototype,"operationalLayerType",void 0),(0,i._)([(0,m.Cb)({json:{read:!1},readOnly:!0})],he.prototype,"type",void 0),(0,i._)([(0,m.Cb)({...ye.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],he.prototype,"fields",void 0),(0,i._)([(0,m.Cb)()],he.prototype,"types",null),(0,i._)([(0,m.Cb)()],he.prototype,"typeIdField",null),(0,i._)([(0,m.Cb)()],he.prototype,"templates",null),(0,i._)([(0,m.Cb)()],he.prototype,"formTemplate",null),(0,i._)([(0,m.Cb)({readOnly:!0,clonable:!1})],he.prototype,"fieldsIndex",null),(0,i._)([(0,m.Cb)({type:k.Z,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],he.prototype,"floorInfo",void 0),(0,i._)([(0,m.Cb)(ye.outFields)],he.prototype,"outFields",void 0),(0,i._)([(0,m.Cb)({type:N.U4,readOnly:!0,json:{read:!1}})],he.prototype,"nodePages",void 0),(0,i._)([(0,b.r)("service","nodePages",["nodePages","pointNodePages"])],he.prototype,"readNodePages",null),(0,i._)([(0,m.Cb)({type:[N.QI],readOnly:!0})],he.prototype,"materialDefinitions",void 0),(0,i._)([(0,m.Cb)({type:[N.Yh],readOnly:!0})],he.prototype,"textureSetDefinitions",void 0),(0,i._)([(0,m.Cb)({type:[N.H3],readOnly:!0})],he.prototype,"geometryDefinitions",void 0),(0,i._)([(0,m.Cb)({readOnly:!0})],he.prototype,"serviceUpdateTimeStamp",void 0),(0,i._)([(0,m.Cb)({readOnly:!0})],he.prototype,"attributeStorageInfo",void 0),(0,i._)([(0,m.Cb)({readOnly:!0})],he.prototype,"statisticsInfo",void 0),(0,i._)([(0,m.Cb)({type:d.Z.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],he.prototype,"excludeObjectIds",void 0),(0,i._)([(0,m.Cb)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],he.prototype,"definitionExpression",void 0),(0,i._)([(0,m.Cb)({type:ie,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],he.prototype,"filter",void 0),(0,i._)([(0,m.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],he.prototype,"path",void 0),(0,i._)([(0,m.Cb)(E.PV)],he.prototype,"elevationInfo",null),(0,i._)([(0,m.Cb)({readOnly:!0,json:{read:!1}})],he.prototype,"effectiveCapabilities",null),(0,i._)([(0,m.Cb)({readOnly:!0})],he.prototype,"effectiveEditingEnabled",null),(0,i._)([(0,m.Cb)({type:String})],he.prototype,"geometryType",null),(0,i._)([(0,m.Cb)(E.iR)],he.prototype,"labelsVisible",void 0),(0,i._)([(0,m.Cb)({type:[D.Z],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:V.r},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:V.r},write:!0}})],he.prototype,"labelingInfo",void 0),(0,i._)([(0,m.Cb)(E.rn)],he.prototype,"legendEnabled",void 0),(0,i._)([(0,m.Cb)({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?(0,ce.b)(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],he.prototype,"opacity",void 0),(0,i._)([(0,m.Cb)({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],he.prototype,"priority",void 0),(0,i._)([(0,m.Cb)({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],he.prototype,"semantic",void 0),(0,i._)([(0,m.Cb)({types:o.o,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],he.prototype,"renderer",null),(0,i._)([(0,m.Cb)({json:{read:!1}})],he.prototype,"cachedDrawingInfo",void 0),(0,i._)([(0,b.r)("service","cachedDrawingInfo")],he.prototype,"readCachedDrawingInfo",null),(0,i._)([(0,m.Cb)({readOnly:!0,json:{read:!1}})],he.prototype,"capabilities",null),(0,i._)([(0,m.Cb)({type:Boolean,json:{read:!1}})],he.prototype,"editingEnabled",null),(0,i._)([(0,m.Cb)({readOnly:!0,json:{write:!1,read:!1}})],he.prototype,"infoFor3D",null),(0,i._)([(0,m.Cb)({readOnly:!0,json:{write:!1,read:!1}})],he.prototype,"relationships",null),(0,i._)([(0,m.Cb)(E.C_)],he.prototype,"popupEnabled",void 0),(0,i._)([(0,m.Cb)({type:n.Z,json:{name:"popupInfo",write:!0}})],he.prototype,"popupTemplate",void 0),(0,i._)([(0,m.Cb)({readOnly:!0,json:{read:!1}})],he.prototype,"defaultPopupTemplate",null),(0,i._)([(0,m.Cb)({type:String,json:{read:!1}})],he.prototype,"objectIdField",void 0),(0,i._)([(0,b.r)("service","objectIdField",["objectIdField","fields"])],he.prototype,"readObjectIdField",null),(0,i._)([(0,m.Cb)({type:String,json:{read:!1}})],he.prototype,"globalIdField",void 0),(0,i._)([(0,b.r)("service","globalIdField",["globalIdField","fields"])],he.prototype,"readGlobalIdField",null),(0,i._)([(0,m.Cb)({readOnly:!0,type:String,json:{read:!1}})],he.prototype,"displayField",null),(0,i._)([(0,m.Cb)({type:String,json:{read:!1}})],he.prototype,"profile",void 0),(0,i._)([(0,b.r)("service","profile",["store.profile"])],he.prototype,"readProfile",null),(0,i._)([(0,m.Cb)({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],he.prototype,"normalReferenceFrame",void 0),(0,i._)([(0,m.Cb)(E.YI)],he.prototype,"screenSizePerspectiveEnabled",void 0),(0,i._)([(0,m.Cb)({json:{read:!1,origins:{service:{read:!0}}}})],he.prototype,"serviceItemId",void 0),he=(0,i._)([(0,w.j)("esri.layers.SceneLayer")],he);const fe={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},me={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},ge=he},66361:(e,t,r)=>{r.d(t,{jF:()=>u,lQ:()=>y,o1:()=>m});var i=r(43697),s=r(32448),n=r(22974),o=r(95330),a=(r(92604),r(75215),r(20102),r(80442),r(52011)),l=r(18596);const d=new s.Z.EventEmitter;function u(e,t,r=null,i=!1){const s=(0,o.hh)();return i=null==t||i,d.emit("apply-edits",{serviceUrl:e,layerId:t,gdbVersion:r,mayReceiveServiceEdits:i,result:s.promise}),s}const c="esri.layers.mixins.EditBusLayer",p=Symbol(c);function y(e){return null!=e&&"object"==typeof e&&p in e}function h(e){return null!=e&&"object"==typeof e&&"gdbVersion"in e}function f(e,t,r){const i=new URL(e).host,s=l.Jp.get(i),n=e=>!e||e===s;return n(t)&&n(r)||t===r}const m=e=>{var t;let r=class extends e{constructor(...e){super(...e),this[t]=!0,this._applyEditsHandler=e=>{const{serviceUrl:t,layerId:r,gdbVersion:i,mayReceiveServiceEdits:s,result:o}=e,a=t===this.url,d=null!=r&&null!=this.layerId&&r===this.layerId,u=h(this),c=h(this)&&f(t,i,this.gdbVersion);if(!a||u&&!c||!d&&!s)return;const p=o.then((e=>{if(d&&(e.addedFeatures.length||e.updatedFeatures.length||e.deletedFeatures.length||e.addedAttachments.length||e.updatedAttachments.length||e.deletedAttachments.length))return this.emit("edits",(0,n.d9)(e)),e;const t=e.editedFeatures?.find((({layerId:e})=>e===this.layerId));if(t){const{adds:r,updates:i,deletes:s}=t.editedFeatures,o={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:r?r.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],deletedFeatures:s?s.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],updatedFeatures:i?i.map((({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],editedFeatures:(0,n.d9)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,n.d9)(e.historicMoment)};return this.emit("edits",o),o}return{edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:(0,n.d9)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,n.d9)(e.historicMoment)}})).then((e=>("historicMoment"in this&&this.historicMoment!==e.historicMoment&&(0,l.JV)(t,i)&&(this.historicMoment=e.historicMoment),e)));this.emit("apply-edits",{result:p})},this._updateMomentHandler=e=>{const{serviceUrl:t,gdbVersion:r,moment:i}=e,s=t===this.url,n=h(this),o=h(this)&&f(t,r,this.gdbVersion),a=h(this)&&!f(t,this.gdbVersion,null);s&&n&&o&&a&&"historicMoment"in this&&this.historicMoment!==i&&(this.historicMoment=i)},this.when().then((()=>{this.addHandles(function(e){return d.on("apply-edits",new WeakRef(e))}(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(function(e){return d.on("update-moment",new WeakRef(e))}(this._updateMomentHandler))}),(()=>{}))}};return t=p,r=(0,i._)([(0,a.j)(c)],r),r}},72965:(e,t,r)=>{r.d(t,{M:()=>o});var i=r(43697),s=r(5600),n=(r(75215),r(67676),r(80442),r(52011));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const e={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&function(e,t){e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale}(e,t.effectiveScaleRange);const r=this._get("effectiveScaleRange");return r&&r.minScale===e.minScale&&r.maxScale===e.maxScale?r:e}};return(0,i._)([(0,s.Cb)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"minScale",void 0),(0,i._)([(0,s.Cb)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"maxScale",void 0),(0,i._)([(0,s.Cb)({readOnly:!0})],t.prototype,"effectiveScaleRange",null),t=(0,i._)([(0,n.j)("esri.layers.mixins.ScaleRangeLayer")],t),t}},61960:(e,t,r)=>{r.d(t,{B:()=>a});var i=r(43697),s=r(96674),n=r(5600),o=(r(75215),r(67676),r(80442),r(52011));let a=class extends s.wq{constructor(){super(...arguments),this.type=null}};(0,i._)([(0,n.Cb)({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],a.prototype,"type",void 0),a=(0,i._)([(0,o.j)("esri.layers.support.FeatureReduction")],a)},85857:(e,t,r)=>{r.d(t,{Z:()=>d});var i,s=r(43697),n=r(5600),o=(r(75215),r(67676),r(80442),r(52011)),a=r(61960);let l=i=class extends a.B{constructor(e){super(e),this.type="selection"}clone(){return new i}};(0,s._)([(0,n.Cb)({type:["selection"]})],l.prototype,"type",void 0),l=i=(0,s._)([(0,o.j)("esri.layers.support.FeatureReductionSelection")],l);const d=l},45574:(e,t,r)=>{r.d(t,{JD:()=>w,Jj:()=>_,sX:()=>N,Ob:()=>V,rP:()=>Z,FV:()=>F,nU:()=>T,Ci:()=>j,Fr:()=>b,HW:()=>G,gG:()=>E,uA:()=>k,SU:()=>C,KE:()=>R,VG:()=>x,tD:()=>L,kp:()=>O,C9:()=>A,rk:()=>P,kZ:()=>M,JY:()=>U,Y5:()=>I,uj:()=>S});var i=r(40330),s=r(9790),n=r(66643),o=r(20102),a=r(35454),l=r(42033),d=r(63213),u=r(14165);async function c(e,t,r){t=t.clone(),e.capabilities.query.supportsMaxRecordCountFactor&&(t.maxRecordCountFactor=p(e));const i=function(e){return p(e)*function(e){return e.capabilities.query.maxRecordCount||2e3}(e)}(e),s=e.capabilities.query.supportsPagination;t.start=0,t.num=i;let n=null;for(;;){const o=await e.source.queryFeaturesJSON(t,r);if(null==n?n=o:n.features=n.features.concat(o.features),n.exceededTransferLimit=o.exceededTransferLimit,!s||!o.exceededTransferLimit)break;t.start+=i}return n}function p(e){return e.capabilities.query.supportsMaxRecordCountFactor?u.Z.MAX_MAX_RECORD_COUNT_FACTOR:1}var y=r(84230),h=r(84382),f=r(81571),m=r(56545),g=r(75935);const b=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function w(e,t,r,i){const s=await q(e);if(await v(e,t,i),!s.addAttachment)throw new o.Z(i,"Layer source does not support addAttachment capability");return s.addAttachment(t,r)}function v(e,t,r){const{attributes:i}=t,{objectIdField:s}=e;return e.capabilities?.data?.supportsAttachment?t?i?s&&i[s]?Promise.resolve():Promise.reject(new o.Z(r,`feature is missing the identifying attribute ${s}`)):Promise.reject(new o.Z(r,"'attributes' are required on a feature to query attachments")):Promise.reject(new o.Z(r,"A feature is required to add/delete/update attachments")):Promise.reject(new o.Z(r,"this layer doesn't support attachments"))}async function I(e,t,r,i,s){const n=await q(e);if(await v(e,t,s),!n.updateAttachment)throw new o.Z(s,"Layer source does not support updateAttachment capability");return n.updateAttachment(t,r,i)}async function _(e,t,i){const{applyEdits:s}=await r.e(4720).then(r.bind(r,14720)),n=await e.load(),{source:o,globalIdField:a}=n;let l=i;return("feature"===n.type?n.infoFor3D:null)&&null!=t.deleteFeatures&&null!=a&&(l={...l,globalIdToObjectId:await G(e,t.deleteFeatures,a)}),s(n,o,t,i)}async function S(e,t,i){const{uploadAssets:s}=await r.e(4720).then(r.bind(r,14720)),n=await e.load();return s(n,n.source,t,i)}async function F(e,t,r,i){const s=await q(e);if(await v(e,t,i),!s.deleteAttachments)throw new o.Z(i,"Layer source does not support deleteAttachments capability");return s.deleteAttachments(t,r)}async function j(e,t,r){const i=(await e.load({signal:t?.signal})).source;if(!i.fetchRecomputedExtents)throw new o.Z(r,"Layer source does not support fetchUpdates capability");return i.fetchRecomputedExtents(t)}async function C(e,t,r,i){t=m.Z.from(t),await e.load();const s=e.source,n=e.capabilities;if(!n?.data?.supportsAttachment)throw new o.Z(i,"this layer doesn't support attachments");const{attachmentTypes:a,objectIds:l,globalIds:d,num:u,size:c,start:p,where:y}=t;if(!n?.operations?.supportsQueryAttachments&&(a?.length>0||d?.length>0||c?.length>0||u||p||y))throw new o.Z(i,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t);if(!(l?.length||d?.length||y))throw new o.Z(i,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);if(!s.queryAttachments)throw new o.Z(i,"Layer source does not support queryAttachments capability",t);return s.queryAttachments(t)}async function L(e,t,r,i){const s=await q(e);if(!s.queryObjectIds)throw new o.Z(i,"Layer source does not support queryObjectIds capability");return s.queryObjectIds(u.Z.from(t)??e.createQuery(),r)}async function x(e,t,r,i){const s=await q(e);if(!s.queryFeatureCount)throw new o.Z(i,"Layer source does not support queryFeatureCount capability");return s.queryFeatureCount(u.Z.from(t)??e.createQuery(),r)}async function R(e,t,r,i){const s=await q(e);if(!s.queryExtent)throw new o.Z(i,"Layer source does not support queryExtent capability");return s.queryExtent(u.Z.from(t)??e.createQuery(),r)}async function O(e,t,r,i){const s=await q(e);if(!s.queryRelatedFeatures)throw new o.Z(i,"Layer source does not support queryRelatedFeatures capability");return s.queryRelatedFeatures(g.default.from(t),r)}async function A(e,t,r,i){const s=await q(e);if(!s.queryRelatedFeaturesCount)throw new o.Z(i,"Layer source does not support queryRelatedFeaturesCount capability");return s.queryRelatedFeaturesCount(g.default.from(t),r)}async function E(e){const t=e.source;if(t?.refresh)try{const{dataChanged:r,updates:i}=await t.refresh();if(null!=i&&(e.sourceJSON={...e.sourceJSON,...i},e.read(i,{origin:"service",url:e.parsedUrl})),r)return!0}catch{}if(e.definitionExpression)try{return(await(0,l.E)(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function Z(e){const t=new u.Z,r=e.capabilities?.data,i=e.capabilities?.query;t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,i&&(t.compactGeometryEnabled=i.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=i.supportsDefaultSpatialReference),r&&(r.supportsZ&&null!=e.returnZ&&(t.returnZ=e.returnZ),r.supportsM&&null!=e.returnM&&(t.returnM=e.returnM)),t.outFields=["*"];const{timeOffset:s,timeExtent:n}=e;return t.timeExtent=null!=s&&null!=n?n.offset(-s.value,s.unit):n||null,t.multipatchOption="multipatch"===e.geometryType?"xyFootprint":null,t}function P(e){const{globalIdField:t,fields:r}=e;if(t)return t;if(r)for(const e of r)if("esriFieldTypeGlobalID"===e.type)return e.name}function M(e){const{objectIdField:t,fields:r}=e;if(t)return t;if(r)for(const e of r)if("esriFieldTypeOID"===e.type)return e.name}function U(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}async function q(e){return(await e.load()).source}async function T(e,t,r){const s=e.parsedUrl?.path;s&&e.authenticationTriggerEvent===t&&await async function(e,t){if(!i.id)return;if(i.id.findCredential(e))return;let r;try{const s=await(0,y.oP)(e,t);s&&(r=await i.id.checkSignInStatus(`${s}/sharing`))}catch(e){}if(r)try{const r=null!=t?t.signal:null;await i.id.getCredential(e,{signal:r})}catch(e){}}(s,r)}function N(e){return!e.sourceJSON?.isMultiServicesView&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const D=(0,d.d)({types:s.QT});function V(e,t){if(e.defaultSymbol)return e.types?.length?new f.Z({defaultSymbol:D(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map((e=>({id:e.id,symbol:D(e.symbol,e,t)})))}):new h.Z({symbol:D(e.defaultSymbol,e,t)})}function k(e){let t=e.sourceJSON?.cacheMaxAge;if(!t)return!1;const r=e.editingInfo?.lastEditDate?.getTime();return null==r||(t*=1e3,Date.now()-r<t)}async function G(e,t,r){if(null==t)return null;const i=[],{objectIdField:s}=e;if(t.forEach((e=>{let t=null;if("attributes"in e){const{attributes:i}=e;t={globalId:i[r],objectId:null!=i[s]&&-1!==i[s]?i[s]:null}}else t={globalId:e.globalId,objectId:null!=e.objectId&&-1!==e.objectId?e.objectId:null};null!=t.globalId&&(null!=t.objectId&&-1!==t.objectId||i.push(t.globalId))})),0===i.length)return null;const o=e.createQuery();o.where=i.map((e=>`${r}='${e}'`)).join(" OR "),o.returnGeometry=!1,o.outFields=[s,r],o.cacheHint=!1;const a=await(0,n.mt)(c(e,o));if(!a.ok)return null;const l=new Map,d=a.value.features;for(const e of d){const t=e.attributes[r],i=e.attributes[s];null!=t&&null!=i&&-1!==i&&l.set(t,i)}return l}},53518:(e,t,r)=>{r.d(t,{v:()=>l});var i=r(80442),s=r(92604),n=r(1231),o=r(99514),a=r(69165);function l(){return{fields:{type:[n.Z],value:null,set:function(e){if(e&&(0,i.Z)("big-integer-warning-enabled")){const t=e.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(t.length){const e=t.map((e=>`'${e.name}'`)).join(", ");s.Z.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return o.Z.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const r=this.fieldsIndex?.has(t);r||s.Z.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,a.Q0)(this.fieldsIndex,e)}}}}},66094:(e,t,r)=>{r.d(t,{B:()=>s});var i=r(17452);function s(e){return n[function(e){return"json"===e.type?"application/json":"blob"===e.type?e.blob.type:function(e){const t=(0,i.Ml)(e);return l[t]||o}(e.url)}(e)]||a}const n={},o="text/plain",a=n[o],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in l)n[l[e]]=e},40555:(e,t,r)=>{r.d(t,{y:()=>o});var i=r(66643),s=r(95330),n=r(20941);async function o(e,t,r){const o=e&&e.getAtOrigin&&e.getAtOrigin("renderer",t.origin);if(o&&"unique-value"===o.type&&o.styleOrigin){const a=await(0,i.q6)(o.populateFromStyle());if((0,s.k_)(r),!1===a.ok){const r=a.error;t?.messages&&t.messages.push(new n.Z("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:t})),e.clear("renderer",t?.origin)}}}},75935:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var i,s=r(43697),n=(r(66577),r(96674)),o=r(22974),a=r(5600),l=r(75215),d=r(52011),u=r(30556),c=r(10158),p=r(82971);let y=i=class extends n.wq{constructor(e){super(e),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(e,t){t.historicMoment=e&&e.getTime()}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10,this.start>0&&null==this.where&&(t.definitionExpression="1=1")}clone(){return new i((0,o.d9)({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};(0,s._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],y.prototype,"cacheHint",void 0),(0,s._)([(0,a.Cb)({type:c.n,json:{write:!0}})],y.prototype,"dynamicDataSource",void 0),(0,s._)([(0,a.Cb)({type:String,json:{write:!0}})],y.prototype,"gdbVersion",void 0),(0,s._)([(0,a.Cb)({type:Number,json:{write:!0}})],y.prototype,"geometryPrecision",void 0),(0,s._)([(0,a.Cb)({type:Date})],y.prototype,"historicMoment",void 0),(0,s._)([(0,u.c)("historicMoment")],y.prototype,"_writeHistoricMoment",null),(0,s._)([(0,a.Cb)({type:Number,json:{write:!0}})],y.prototype,"maxAllowableOffset",void 0),(0,s._)([(0,a.Cb)({type:[Number],json:{write:!0}})],y.prototype,"objectIds",void 0),(0,s._)([(0,a.Cb)({type:[String],json:{write:!0}})],y.prototype,"orderByFields",void 0),(0,s._)([(0,a.Cb)({type:[String],json:{write:!0}})],y.prototype,"outFields",void 0),(0,s._)([(0,a.Cb)({type:p.Z,json:{read:{source:"outSR"},write:{target:"outSR"}}})],y.prototype,"outSpatialReference",void 0),(0,s._)([(0,a.Cb)({json:{write:!0}})],y.prototype,"relationshipId",void 0),(0,s._)([(0,a.Cb)({type:Number,json:{read:{source:"resultOffset"}}})],y.prototype,"start",void 0),(0,s._)([(0,u.c)("start"),(0,u.c)("num")],y.prototype,"writeStart",null),(0,s._)([(0,a.Cb)({type:Number,json:{read:{source:"resultRecordCount"}}})],y.prototype,"num",void 0),(0,s._)([(0,a.Cb)({json:{write:!0}})],y.prototype,"returnGeometry",void 0),(0,s._)([(0,a.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],y.prototype,"returnM",void 0),(0,s._)([(0,a.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],y.prototype,"returnZ",void 0),(0,s._)([(0,a.Cb)({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],y.prototype,"where",void 0),y=i=(0,s._)([(0,d.j)("esri.rest.support.RelationshipQuery")],y),y.from=(0,l.se)(y);const h=y},18596:(e,t,r)=>{r.d(t,{JV:()=>a,Jp:()=>s,Px:()=>o,U8:()=>i});const i=(0,r(41123).z)(),s=new Map,n=new Map;async function o(e,t,s=!1){if(!e||!t)return!0;const o=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),a=n.get(o)?.entries();if(a)for(const[e,n]of a)if(n.name===t){const t=!n.stack?.hasForwardEdits();if(!t&&s){const[{deleteForwardEdits:t},{default:s}]=await Promise.all([r.e(1316).then(r.bind(r,51316)),r.e(4573).then(r.bind(r,84573))]);return t(o,e,new s({sessionId:i,moment:n.moment}))}return t}return!0}function a(e,t){if(!e)return!1;const r=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=n.get(r)?.entries();if(i)for(const[e,r]of i)if(r.name===t)return"edit"===r.lockType;return!1}new Map}}]);