@arcgis/core 4.29.4 → 4.29.6

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 (55) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{863d14c98737482f6788.js → 0700231efdaf7ce06d19.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{9f0c5822e9f2761054ea.js → 07ef6a6c4f3fce7508eb.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{2146f7e55911da806aec.js → 2ca0fc695c66640a57dd.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{90b36361651839b1e3f0.js → 326aa2951f7e4da6d6b0.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{1251638c842dcf895ffe.js → 37133cf60bc9039a7407.js} +1 -1
  7. package/assets/esri/core/workers/chunks/47504e296bf82357f6bb.js +1 -0
  8. package/assets/esri/core/workers/chunks/{de6d54df7ae32694fd70.js → 534abb4408b15ac778dd.js} +1 -1
  9. package/assets/esri/core/workers/chunks/a068f0c8c1c632e8b2cb.js +1 -0
  10. package/assets/esri/core/workers/chunks/{2621b755fa5403bd8a4c.js → e232f6fca5629ae66dcc.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{0e56ff6978ba8d9cf0c0.js → f74eec62bcf3264e2d90.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{8a9387483b19a5ec5b86.js → fc5ac713872766571e07.js} +1 -1
  13. package/assets/esri/themes/base/widgets/_LayerList.scss +2 -0
  14. package/assets/esri/themes/dark/main.css +1 -1
  15. package/assets/esri/themes/light/main.css +1 -1
  16. package/assets/esri/themes/light/view.css +1 -1
  17. package/core/workers/InvokeHandler.js +1 -1
  18. package/core/workers/RemoteClient.js +1 -1
  19. package/core/workers/utils.js +1 -1
  20. package/interfaces.d.ts +47 -35
  21. package/kernel.js +1 -1
  22. package/layers/support/Sublayer.js +1 -1
  23. package/package.json +1 -1
  24. package/support/revision.js +1 -1
  25. package/symbols/support/urlUtils.js +1 -1
  26. package/views/2d/engine/Stage.js +1 -1
  27. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  28. package/views/2d/engine/webgl/shaderGraph/techniques/Technique.js +1 -1
  29. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js +1 -1
  30. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  31. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
  32. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +5 -0
  33. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  34. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  35. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/utils.js +1 -1
  36. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  37. package/views/2d/layers/StreamLayerView2D.js +1 -1
  38. package/views/2d/layers/features/FeatureContainer.js +1 -1
  39. package/views/2d/layers/features/PipelineConnectionHandlers.js +1 -1
  40. package/views/2d/layers/features/Processor.js +1 -1
  41. package/views/2d/layers/features/RenderState.js +1 -1
  42. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  43. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  44. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  45. package/views/2d/layers/features/sources/strategies/AFetchLoadStrategy.js +1 -1
  46. package/views/2d/layers/support/handleNoEngineError.js +5 -0
  47. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  48. package/views/MapView.js +1 -1
  49. package/widgets/BasemapLayerList.js +1 -1
  50. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  51. package/widgets/LayerList/support/layerListUtils.js +1 -1
  52. package/widgets/LayerList.js +1 -1
  53. package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
  54. package/assets/esri/core/workers/chunks/686a76adc741eef369ee.js +0 -1
  55. package/assets/esri/core/workers/chunks/a48201b109e9e9aab2d6.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- function t(t,r){return new Proxy({},{get:(e,i,s)=>(...e)=>{let s,o;const a=e[e.length-1];return n(a)&&(s=a.signal,o=a.transferList,e.pop()),t.apply(r?`${r}.${i.toString()}`:i.toString(),e,{transferList:o,signal:s})}})}function n(t){return"object"==typeof t&&!Array.isArray(t)&&null!=t&&("signal"in t||"transferList"in t||0===Object.keys(t).length)}export{t as createInvokeProxy};
5
+ import{ignoreConnectionErrors as t}from"./utils.js";function n(n,e,i){return new Proxy({},{get:(o,s,l)=>(...o)=>{let l,a;const g=o[o.length-1];r(g)&&(l=g.signal,a=g.transferList,o.pop());const c=n.apply(e?`${e}.${s.toString()}`:s.toString(),o,{transferList:a,signal:l});return i?.ignoreConnectionErrors?t(c):c}})}function r(t){return"object"==typeof t&&!Array.isArray(t)&&null!=t&&("signal"in t||"transferList"in t||0===Object.keys(t).length)}export{n as createInvokeProxy};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{fullVersion as e}from"../../kernel.js";import s from"../Error.js";import{on as t}from"../events.js";import{makeHandle as o}from"../handleUtils.js";import{removeMaybe as n}from"../maybe.js";import{isAborted as r,createAbortError as i,onAbort as l,isPromiseLike as a,isAbortError as h}from"../promiseUtils.js";import{createInvokeProxy as c}from"./InvokeHandler.js";import{registry as p}from"./registry.js";import{newJobId as _,MessageType as u,receiveMessage as d,toInvokeError as b,postMessage as m}from"./utils.js";import{buildDate as g,commitHash as f}from"../../support/revision.js";const{CLOSE:v,ABORT:M,INVOKE:k,RESPONSE:j,OPEN_PORT:y,ON:I}=u,J=2;class w{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===u.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class O{static connect(e){const s=new MessageChannel;let t;t="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const o=new O(s.port1,{channel:s,client:t});return"object"==typeof t&&"remoteClient"in t&&(t.remoteClient=o),O.clients.set(o,t),s.port2}static loadWorker(e){const s=p[e];return s?s():Promise.resolve(null)}constructor(e,s,t){this._port=e,this._jobQueue=t,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new w((e=>this._onInvokeMessage(e))),this._client=s.client,this._onMessage=this._onMessage.bind(this),this._channel=s.channel,this._schedule=s.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:v}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,s,t){return this.apply(e,[s],t)}apply(e,t,o){const a=o?.signal,h=o?.transferList;if(!this._port)return Promise.reject(new s("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const c=_();return new Promise(((s,o)=>{if(r(a))return this._processWork(),void o(i());const p=l(a,(()=>{const e=this._outJobs.get(c);e&&(this._outJobs.delete(c),this._processWork(),n(e.abortHandle),this._post({type:M,jobId:c}),o(i()))})),_={resolve:s,reject:o,abortHandle:p,debugInfo:e};this._outJobs.set(c,_),this._post({type:k,jobId:c,methodName:e,abortable:null!=a},t,h)}))}createInvokeProxy(e){return c(this,e)}on(e,s){const t=new MessageChannel;function n(e){s(e.data)}return this._port.postMessage({type:u.ON,eventType:e,port:t.port2},[t.port2]),t.port1.addEventListener("message",n),t.port1.start(),o((()=>{t.port1.postMessage({type:u.CLOSE}),t.port1.close(),t.port1.removeEventListener("message",n)}))}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:y,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=J)return;const e=this._jobQueue?.pop();if(!e)return;const{methodName:s,data:t,invokeOptions:o,resolver:n}=e;this.apply(s,t,o).then((e=>n.resolve(e))).catch((e=>n.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{n(e.abortHandle),e.reject(i(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(e){null!=this._schedule?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const s=d(e);if(s)switch(s.type){case j:this._onResponseMessage(s);break;case k:this._invokeQueue.push(s);break;case M:this._onAbortMessage(s);break;case v:this._onCloseMessage();break;case y:this._onOpenPortMessage(s);break;case I:this._onOnMessage(s)}}_onAbortMessage(e){const s=this._inJobs,t=e.jobId,o=s.get(t);this._invokeQueue.push(e),o&&(o.controller&&o.controller.abort(),s.delete(t))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&O.clients.get(this)===e&&e.destroy(),O.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:s,jobId:t,data:o=[],abortable:n}=e,r=n?new AbortController:null,i=this._inJobs;let l,c=this._client,p=c[s];try{if(!p&&s&&s.includes(".")){const e=s.split(".");for(let s=0;s<e.length-1;s++)c=c[e[s]],p=c[e[s+1]]}if("function"!=typeof p)throw new TypeError(`${s} is not a function`);o.push({client:this,signal:r?r.signal:null}),l=p.apply(c,o)}catch(_){return void this._post({type:j,jobId:t,error:b(_)})}a(l)?(i.set(t,{controller:r,promise:l}),l.then((e=>{i.has(t)&&(i.delete(t),this._post({type:j,jobId:t},e))}),(e=>{i.has(t)&&(i.delete(t),h(e)||this._post({type:j,jobId:t,error:b(e||{message:`Error encountered at method ${s}`})}))}))):this._post({type:j,jobId:t},l)}_onOpenPortMessage(e){new O(e.port,{client:this._client})}_onOnMessage(e){const{port:s}=e,o=this._client.on(e.eventType,(e=>{s.postMessage(e)})),n=t(e.port,"message",(e=>{const t=d(e);t?.type===u.CLOSE&&(n.remove(),o.remove(),s.close())}))}_onResponseMessage(e){const{jobId:t,error:o,data:r}=e,i=this._outJobs;if(!i.has(t))return;const l=i.get(t);i.delete(t),this._processWork(),n(l.abortHandle),o?l.reject(s.fromJSON(JSON.parse(o))):l.resolve(r)}_post(e,s,t){return m(this._port,e,s,t)}}O.kernelInfo={buildDate:g,fullVersion:e,revision:f},O.clients=new Map;export{O as default};
5
+ import{fullVersion as e}from"../../kernel.js";import s from"../Error.js";import{on as t}from"../events.js";import{makeHandle as o}from"../handleUtils.js";import{removeMaybe as n}from"../maybe.js";import{isAborted as r,createAbortError as i,onAbort as l,isPromiseLike as a,isAbortError as h}from"../promiseUtils.js";import{createInvokeProxy as c}from"./InvokeHandler.js";import{registry as p}from"./registry.js";import{portClosedErrorName as _,newJobId as u,MessageType as d,receiveMessage as b,toInvokeError as m,postMessage as g}from"./utils.js";import{buildDate as f,commitHash as v}from"../../support/revision.js";const{CLOSE:M,ABORT:k,INVOKE:j,RESPONSE:y,OPEN_PORT:I,ON:J}=d,w=2;class O{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===d.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class E{static connect(e){const s=new MessageChannel;let t;t="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const o=new E(s.port1,{channel:s,client:t});return"object"==typeof t&&"remoteClient"in t&&(t.remoteClient=o),E.clients.set(o,t),s.port2}static loadWorker(e){const s=p[e];return s?s():Promise.resolve(null)}constructor(e,s,t){this._port=e,this._jobQueue=t,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new O((e=>this._onInvokeMessage(e))),this._client=s.client,this._onMessage=this._onMessage.bind(this),this._channel=s.channel,this._schedule=s.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:M}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,s,t){return this.apply(e,[s],t)}apply(e,t,o){const a=o?.signal,h=o?.transferList;if(!this._port)return Promise.reject(new s(_,`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const c=u();return new Promise(((s,o)=>{if(r(a))return this._processWork(),void o(i());const p=l(a,(()=>{const e=this._outJobs.get(c);e&&(this._outJobs.delete(c),this._processWork(),n(e.abortHandle),this._post({type:k,jobId:c}),o(i()))})),_={resolve:s,reject:o,abortHandle:p,debugInfo:e};this._outJobs.set(c,_),this._post({type:j,jobId:c,methodName:e,abortable:null!=a},t,h)}))}createInvokeProxy(e,s){return c(this,e,s)}on(e,s){const t=new MessageChannel;function n(e){s(e.data)}return this._port.postMessage({type:d.ON,eventType:e,port:t.port2},[t.port2]),t.port1.addEventListener("message",n),t.port1.start(),o((()=>{t.port1.postMessage({type:d.CLOSE}),t.port1.close(),t.port1.removeEventListener("message",n)}))}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:I,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=w)return;const e=this._jobQueue?.pop();if(!e)return;const{methodName:s,data:t,invokeOptions:o,resolver:n}=e;this.apply(s,t,o).then((e=>n.resolve(e))).catch((e=>n.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{n(e.abortHandle),e.reject(i(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(e){null!=this._schedule?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const s=b(e);if(s)switch(s.type){case y:this._onResponseMessage(s);break;case j:this._invokeQueue.push(s);break;case k:this._onAbortMessage(s);break;case M:this._onCloseMessage();break;case I:this._onOpenPortMessage(s);break;case J:this._onOnMessage(s)}}_onAbortMessage(e){const s=this._inJobs,t=e.jobId,o=s.get(t);this._invokeQueue.push(e),o&&(o.controller&&o.controller.abort(),s.delete(t))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&E.clients.get(this)===e&&e.destroy(),E.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:s,jobId:t,data:o=[],abortable:n}=e,r=n?new AbortController:null,i=this._inJobs;let l,c=this._client,p=c[s];try{if(!p&&s&&s.includes(".")){const e=s.split(".");for(let s=0;s<e.length-1;s++)c=c[e[s]],p=c[e[s+1]]}if("function"!=typeof p)throw new TypeError(`${s} is not a function`);o.push({client:this,signal:r?r.signal:null}),l=p.apply(c,o)}catch(_){return void this._post({type:y,jobId:t,error:m(_)})}a(l)?(i.set(t,{controller:r,promise:l}),l.then((e=>{i.has(t)&&(i.delete(t),this._post({type:y,jobId:t},e))}),(e=>{i.has(t)&&(i.delete(t),h(e)||this._post({type:y,jobId:t,error:m(e||{message:`Error encountered at method ${s}`})}))}))):this._post({type:y,jobId:t},l)}_onOpenPortMessage(e){new E(e.port,{client:this._client})}_onOnMessage(e){const{port:s}=e,o=this._client.on(e.eventType,(e=>{s.postMessage(e)})),n=t(e.port,"message",(e=>{const t=b(e);t?.type===d.CLOSE&&(n.remove(),o.remove(),s.close())}))}_onResponseMessage(e){const{jobId:t,error:o,data:r}=e,i=this._outJobs;if(!i.has(t))return;const l=i.get(t);i.delete(t),this._processWork(),n(l.abortHandle),o?l.reject(s.fromJSON(JSON.parse(o))):l.resolve(r)}_post(e,s,t){return g(this._port,e,s,t)}}E.kernelInfo={buildDate:f,fullVersion:e,revision:v},E.clients=new Map;export{E 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.29/esri/copyright.txt for details.
4
4
  */
5
- import has from"../has.js";var t;!function(t){t[t.HANDSHAKE=0]="HANDSHAKE",t[t.OPEN=1]="OPEN",t[t.OPENED=2]="OPENED",t[t.RESPONSE=3]="RESPONSE",t[t.INVOKE=4]="INVOKE",t[t.ABORT=5]="ABORT",t[t.CLOSE=6]="CLOSE",t[t.OPEN_PORT=7]="OPEN_PORT",t[t.ON=8]="ON"}(t||(t={}));let e=0;function r(){return e++}function n(t){return t&&"object"==typeof t&&("result"in t||"transferList"in t)}function s(t){return t?"string"==typeof t?JSON.stringify({name:"message",message:t}):t.toJSON?JSON.stringify(t):JSON.stringify({name:t.name,message:t.message,details:t.details||{stack:t.stack}}):null}function f(e,r,i,a){if(r.type===t.OPEN_PORT)return void e.postMessage(r,[r.port]);if(r.type!==t.INVOKE&&r.type!==t.RESPONSE)return void e.postMessage(r);let u;if(n(i)?(u=o(i.transferList),r.data=i.result):(u=o(a),r.data=i),u){if(has("ff"))for(const n of u)if("byteLength"in n&&n.byteLength>267386880){const n="Worker call with large ArrayBuffer would crash Firefox";switch(r.type){case t.INVOKE:throw n;case t.RESPONSE:return void f(e,{type:t.RESPONSE,jobId:r.jobId,error:s(n)})}}e.postMessage(r,u)}else e.postMessage(r)}function i(t){if(!t)return null;const e=t.data;return e?"string"==typeof e?JSON.parse(e):e:null}function o(t){if(!t?.length)return null;if(has("esri-workers-arraybuffer-transfer"))return t;const e=t.filter((t=>!a(t)));return e.length?e:null}function a(t){return t instanceof ArrayBuffer||"ArrayBuffer"===t?.constructor?.name}export{t as MessageType,n as isTransferrableResult,r as newJobId,f as postMessage,i as receiveMessage,s as toInvokeError};
5
+ import has from"../has.js";import{isAbortError as t}from"../promiseUtils.js";const r="worker:port-closed";var e;!function(t){t[t.HANDSHAKE=0]="HANDSHAKE",t[t.OPEN=1]="OPEN",t[t.OPENED=2]="OPENED",t[t.RESPONSE=3]="RESPONSE",t[t.INVOKE=4]="INVOKE",t[t.ABORT=5]="ABORT",t[t.CLOSE=6]="CLOSE",t[t.OPEN_PORT=7]="OPEN_PORT",t[t.ON=8]="ON"}(e||(e={}));let n=0;function s(){return n++}function o(t){return t&&"object"==typeof t&&("result"in t||"transferList"in t)}function i(t){return t?"string"==typeof t?JSON.stringify({name:"message",message:t}):t.toJSON?JSON.stringify(t):JSON.stringify({name:t.name,message:t.message,details:t.details||{stack:t.stack}}):null}function a(t,r,n,s){if(r.type===e.OPEN_PORT)return void t.postMessage(r,[r.port]);if(r.type!==e.INVOKE&&r.type!==e.RESPONSE)return void t.postMessage(r);let f;if(o(n)?(f=u(n.transferList),r.data=n.result):(f=u(s),r.data=n),f){if(has("ff"))for(const n of f)if("byteLength"in n&&n.byteLength>267386880){const n="Worker call with large ArrayBuffer would crash Firefox";switch(r.type){case e.INVOKE:throw n;case e.RESPONSE:return void a(t,{type:e.RESPONSE,jobId:r.jobId,error:i(n)})}}t.postMessage(r,f)}else t.postMessage(r)}function f(t){if(!t)return null;const r=t.data;return r?"string"==typeof r?JSON.parse(r):r:null}function u(t){if(!t?.length)return null;if(has("esri-workers-arraybuffer-transfer"))return t;const r=t.filter((t=>!c(t)));return r.length?r:null}function c(t){return t instanceof ArrayBuffer||"ArrayBuffer"===t?.constructor?.name}async function O(e){try{return await e}catch(n){const e=n?.name===r;if(!(t(n)||e))throw n;return}}export{e as MessageType,O as ignoreConnectionErrors,o as isTransferrableResult,s as newJobId,r as portClosedErrorName,a as postMessage,f as receiveMessage,i as toInvokeError};
package/interfaces.d.ts CHANGED
@@ -11350,6 +11350,12 @@ declare namespace __esri {
11350
11350
  }
11351
11351
 
11352
11352
  export class FeatureLayer {
11353
+ /**
11354
+ * Array of Chart Items of type WebMapWebChart available on the feature layer.
11355
+ *
11356
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#charts)
11357
+ */
11358
+ charts: any[];
11353
11359
  /**
11354
11360
  * An object that allows you to create a dynamic layer with data either from map service sublayers or data from a registered workspace.
11355
11361
  *
@@ -11554,6 +11560,12 @@ declare namespace __esri {
11554
11560
  }
11555
11561
 
11556
11562
  interface FeatureLayerProperties extends LayerProperties, OrderedLayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, TemporalLayerProperties, BlendLayerProperties, CustomParametersMixinProperties, APIKeyMixinProperties, FeatureEffectLayerProperties, FeatureReductionLayerProperties, PublishableLayerProperties, OperationalLayerProperties, FeatureLayerBaseProperties {
11563
+ /**
11564
+ * Array of Chart Items of type WebMapWebChart available on the feature layer.
11565
+ *
11566
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#charts)
11567
+ */
11568
+ charts?: any[];
11557
11569
  /**
11558
11570
  * An object that allows you to create a dynamic layer with data either from map service sublayers or data from a registered workspace.
11559
11571
  *
@@ -112094,12 +112106,12 @@ declare namespace __esri {
112094
112106
  }
112095
112107
 
112096
112108
  export interface SketchUpdateEvent {
112097
- __4: "update";
112098
112109
  aborted: boolean;
112099
112110
  graphics: Graphic[];
112100
112111
  state: "start" | "active" | "complete";
112101
112112
  tool: "move" | "transform" | "reshape";
112102
112113
  toolEventInfo: UpdateToolEventInfo;
112114
+ type: "update";
112103
112115
  }
112104
112116
 
112105
112117
  /**
@@ -119200,9 +119212,9 @@ declare namespace __esri {
119200
119212
  /**
119201
119213
  * Map of Service URLs and user type extensions.
119202
119214
  *
119203
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#advancedEditingUserTypeExtensionForUrl)
119215
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#advancedEditingUserTypeExtensionLookup)
119204
119216
  */
119205
- readonly advancedEditingUserTypeExtensionForUrl: globalThis.Map<string, boolean>;
119217
+ readonly advancedEditingUserTypeExtensionLookup: globalThis.Map<string, boolean>;
119206
119218
  /**
119207
119219
  * Displays execution errors.
119208
119220
  *
@@ -119212,15 +119224,9 @@ declare namespace __esri {
119212
119224
  /**
119213
119225
  * A key-value pair of [FeatureServiceResourcesBundle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#FeatureServiceResourcesBundle).
119214
119226
  *
119215
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#featureServices)
119216
- */
119217
- featureServices: globalThis.Map<string, VersionManagementViewModelFeatureServiceResourcesBundle>;
119218
- /**
119219
- * Collection of [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) with versioning enabled that belong to the [feature services](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-FeatureService.html).
119220
- *
119221
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#layers)
119227
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#featureServiceLookup)
119222
119228
  */
119223
- layers: Collection<Layer>;
119229
+ featureServiceLookup: globalThis.Map<string, VersionManagementViewModelFeatureServiceResourcesBundle>;
119224
119230
  /**
119225
119231
  * Displays an error if loading fails.
119226
119232
  *
@@ -119230,15 +119236,15 @@ declare namespace __esri {
119230
119236
  /**
119231
119237
  * Map of Service URLs and enterprise versions.
119232
119238
  *
119233
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serverVersionForUrl)
119239
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serverVersionLookup)
119234
119240
  */
119235
- readonly serverVersionForUrl: globalThis.Map<string, number>;
119241
+ readonly serverVersionLookup: globalThis.Map<string, number>;
119236
119242
  /**
119237
119243
  * Map of Service URLs and service names.
119238
119244
  *
119239
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serviceNames)
119245
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serviceNameLookup)
119240
119246
  */
119241
- serviceNames: globalThis.Map<string, string>;
119247
+ serviceNameLookup: globalThis.Map<string, string>;
119242
119248
  /**
119243
119249
  * The viewModel's state.
119244
119250
  *
@@ -119248,21 +119254,27 @@ declare namespace __esri {
119248
119254
  /**
119249
119255
  * Map of Service URLs and logged in users.
119250
119256
  *
119251
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#userForUrl)
119257
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#userLookup)
119252
119258
  */
119253
- readonly userForUrl: globalThis.Map<string, string>;
119259
+ readonly userLookup: globalThis.Map<string, string>;
119254
119260
  /**
119255
119261
  * Contains information about the versions in the versionmanagementservice such as name, guid, etc
119256
119262
  *
119257
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionInfos)
119263
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionInfoLookup)
119258
119264
  */
119259
- versionInfos: globalThis.Map<string, VersionInfo[]>;
119265
+ versionInfoLookup: globalThis.Map<string, VersionInfo[]>;
119260
119266
  /**
119261
119267
  * This class contains metadata about the version management service.
119262
119268
  *
119263
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionManagementServices)
119269
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionManagementServiceLookup)
119270
+ */
119271
+ versionManagementServiceLookup: globalThis.Map<string, VersionManagementService>;
119272
+ /**
119273
+ * The view from which the widget will operate.
119274
+ *
119275
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#view)
119264
119276
  */
119265
- versionManagementServices: globalThis.Map<string, VersionManagementService>;
119277
+ view: MapView;
119266
119278
  /**
119267
119279
  * This class allows you to manage versions from a variety of [feature services](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-FeatureService.html).
119268
119280
  *
@@ -119305,33 +119317,33 @@ declare namespace __esri {
119305
119317
  /**
119306
119318
  * A key-value pair of [FeatureServiceResourcesBundle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#FeatureServiceResourcesBundle).
119307
119319
  *
119308
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#featureServices)
119309
- */
119310
- featureServices?: globalThis.Map<string, VersionManagementViewModelFeatureServiceResourcesBundle>;
119311
- /**
119312
- * Collection of [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) with versioning enabled that belong to the [feature services](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-FeatureService.html).
119313
- *
119314
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#layers)
119320
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#featureServiceLookup)
119315
119321
  */
119316
- layers?: CollectionProperties<LayerProperties>;
119322
+ featureServiceLookup?: globalThis.Map<string, VersionManagementViewModelFeatureServiceResourcesBundle>;
119317
119323
  /**
119318
119324
  * Map of Service URLs and service names.
119319
119325
  *
119320
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serviceNames)
119326
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serviceNameLookup)
119321
119327
  */
119322
- serviceNames?: globalThis.Map<string, string>;
119328
+ serviceNameLookup?: globalThis.Map<string, string>;
119323
119329
  /**
119324
119330
  * Contains information about the versions in the versionmanagementservice such as name, guid, etc
119325
119331
  *
119326
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionInfos)
119332
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionInfoLookup)
119327
119333
  */
119328
- versionInfos?: globalThis.Map<string, VersionInfo[]>;
119334
+ versionInfoLookup?: globalThis.Map<string, VersionInfo[]>;
119329
119335
  /**
119330
119336
  * This class contains metadata about the version management service.
119331
119337
  *
119332
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionManagementServices)
119338
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionManagementServiceLookup)
119339
+ */
119340
+ versionManagementServiceLookup?: globalThis.Map<string, VersionManagementService>;
119341
+ /**
119342
+ * The view from which the widget will operate.
119343
+ *
119344
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#view)
119333
119345
  */
119334
- versionManagementServices?: globalThis.Map<string, VersionManagementService>;
119346
+ view?: MapViewProperties;
119335
119347
  }
119336
119348
 
119337
119349
  /**
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.29/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.29";let t,i=r;i="4.29.4";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.29";let t,i=r;i="4.29.6";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.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import r from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import{rendererTypes as t,webSceneRendererTypes as i}from"../../renderers/support/types.js";import o from"../../request.js";import{isSymbol3D as a}from"../../symbols.js";import s from"../../core/Collection.js";import l from"../../core/Error.js";import has from"../../core/has.js";import{IdentifiableMixin as n}from"../../core/Identifiable.js";import{clone as p}from"../../core/lang.js";import y from"../../core/Loadable.js";import d from"../../core/Logger.js";import{MultiOriginJSONMixin as u}from"../../core/MultiOriginJSONSupport.js";import{sqlAnd as c}from"../../core/sql.js";import{objectToQuery as f}from"../../core/urlUtils.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import{cast as h}from"../../core/accessorSupport/decorators/cast.js";import{reader as b}from"../../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{writer as S}from"../../core/accessorSupport/decorators/writer.js";import{ensureInteger as I,ensureType as w,Integer as v,ensureClass as j}from"../../core/accessorSupport/ensureType.js";import{OriginId as L,nameToId as D}from"../../core/accessorSupport/PropertyOrigin.js";import{getProperties as E}from"../../core/accessorSupport/utils.js";import F from"../graphics/sources/support/QueryTask.js";import x from"./FeatureType.js";import P from"./Field.js";import O from"./FieldsIndex.js";import T from"./LabelClass.js";import{validateLabelingInfo as _}from"./labelingInfo.js";import A from"./LayerFloorInfo.js";import{getFeatureLayerCapabilities as V}from"./serviceCapabilitiesUtils.js";import{DataLayerSource as M}from"./source/DataLayerSource.js";import{MapLayerSource as N}from"./source/MapLayerSource.js";import q from"../../rest/support/AttachmentQuery.js";import R from"../../rest/support/Query.js";import{createPopupTemplate as C}from"../../support/popupUtils.js";import U from"../../geometry/Extent.js";import{featureGeometryTypeKebabDictionary as k}from"../../geometry/support/typeUtils.js";var Q;function B(e){return null!=e&&"esriSMS"===e.type}function J(e,r,t){const i=this.originIdOf(r)>=D(t.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!t&&("map-image"===t.layer?.type&&(t.writeSublayerStructure||i))}}function $(e,r,t){return{enabled:!!t&&("tile"===t.layer?.type&&(t.origin&&this.originIdOf(r)>=D(t.origin)||this._isOverridden(r)))}}function G(e,r,t){return{ignoreOrigin:!0,enabled:t&&t.writeSublayerStructure||!1}}function H(e,r,t){return{ignoreOrigin:!0,enabled:!!t&&(t.writeSublayerStructure||this.originIdOf(r)>=D(t.origin))}}let z=0;const K=new Set;K.add("layer"),K.add("parent"),K.add("loaded"),K.add("loadStatus"),K.add("loadError"),K.add("loadWarnings");let W=Q=class extends(u(n(y))){constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:r,url:t}=this;if(!r&&!t)throw new l("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=r?await r.fetchSublayerInfo(this,e):(await o(t,{responseType:"json",query:{f:"json"},...e})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service"}))})()),this}readCapabilities(e,r){r=r.layerDefinition||r;const{operations:{supportsQuery:t,supportsQueryAttachments:i},query:{supportsFormatPBF:o},data:{supportsAttachment:a},queryRelated:s}=V(r,this.url);return{exportMap:{supportsModification:!!r.canModifyLayer},operations:{supportsQuery:t,supportsQueryAttachments:i},data:{supportsAttachment:a},query:{supportsFormatPBF:o},queryRelated:s}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:r}=this;return{minScale:e,maxScale:r}}readMaxScaleRange(e,r){return{minScale:(r=r.layerDefinition||r).minScale??0,maxScale:r.maxScale??0}}get fieldsIndex(){return new O(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,r){if((r=r.layerDefinition||r).globalIdField)return r.globalIdField;if(r.fields)for(const t of r.fields)if("esriFieldTypeGlobalID"===t.type)return t.name}get id(){const e=this._get("id");return e??z++}set id(e){this._get("id")!==e&&(!1!==this.layer?.capabilities?.exportMap?.supportsDynamicLayers?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,r,t,i){e&&e.length&&(r.layerDefinition={drawingInfo:{labelingInfo:e.map((e=>e.write({},i)))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach((r=>r.layer=e))}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,r){return r.minScale||r.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,r){return r.maxScale||r.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,r){if((r=r.layerDefinition||r).objectIdField)return r.objectIdField;if(r.fields)for(const t of r.fields)if("esriFieldTypeOID"===t.type)return t.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,r){const t=r.layerDefinition;return 1-.01*((null!=t?.transparency?t.transparency:t?.drawingInfo?.transparency)??0)}writeOpacity(e,r,t,i){r.layerDefinition={drawingInfo:{transparency:100-100*e}}}writeParent(e,r){this.parent&&this.parent!==this.layer?r.parentLayerId=I(this.parent.id):r.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{spatialReference:e}=this.layer,r="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:t,fieldsIndex:i}=this,o=has("featurelayer-pbf")&&t?.query.supportsFormatPBF,a=t?.operations?.supportsQueryAttachments??!1;return new F({url:this.url,pbfSupported:o,fieldsIndex:i,gdbVersion:r,sourceSpatialReference:e,queryAttachmentsSupported:a})}set renderer(e){if(e)for(const r of e.getSymbols())if(a(r)){d.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new N({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return w(s.ofType(Q),e)}writeSublayers(e,r,t){this.sublayers?.length&&(r[t]=this.sublayers.map((e=>e.id)).toArray().reverse())}readTitle(e,r){return r.layerDefinition?.name??r.name}readTypeIdField(e,r){let t=(r=r.layerDefinition||r).typeIdField;if(t&&r.fields){t=t.toLowerCase();const e=r.fields.find((e=>e.name.toLowerCase()===t));e&&(t=e.name)}return t}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,r=this.source;if(!e)return null;if(this._lastParsedUrl=e,"map-layer"===r?.type)return`${e.path}/${r.mapLayerId}`;const t={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${f(t)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,r,t,i){r[t]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=E(this),r=new Q;return E(r).store=e.clone(K),this.commitProperty("url"),r._lastParsedUrl=this._lastParsedUrl,r}createPopupTemplate(e){return C(this,e)}createQuery(){return new R({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await import("../FeatureLayer.js")).default,{layer:r,url:t}=this;let i;if(t&&this.originIdOf("url")>L.SERVICE)i=new e({url:t});else{if(!r?.parsedUrl)throw new l("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const t=r.parsedUrl;i=new e({url:t.path}),t&&this.source&&("map-layer"===this.source.type?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return null!=r?.refreshInterval&&(i.refreshInterval=r.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=p(this.floorInfo)),this.originIdOf("labelingInfo")>L.SERVICE&&(i.labelingInfo=p(this.labelingInfo)),this.originIdOf("labelsVisible")>L.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>L.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>L.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>L.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>L.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>L.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>L.DEFAULTS&&(i.popupTemplate=p(this.popupTemplate)),this.originIdOf("renderer")>L.SERVICE&&(i.renderer=p(this.renderer)),"data-layer"===this.source?.type&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>L.DEFAULTS&&(i.title=this.title),"map-image"===r?.type&&r.originIdOf("customParameters")>L.DEFAULTS&&(i.customParameters=r.customParameters),"tile"===r?.type&&r.originIdOf("customParameters")>L.DEFAULTS&&(i.customParameters=r.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){const{typeIdField:r,types:t}=this;if(!r||!e)return null;const i=e.attributes?e.attributes[r]:void 0;if(null==i)return null;let o=null;return t?.some((e=>{const{id:r}=e;return null!=r&&(r.toString()===i.toString()&&(o=e),!!o)})),o}getFieldDomain(e,r){const t=r?.feature,i=this.getFeatureType(t);if(i){const r=i.domains&&i.domains[e];if(r&&"inherited"!==r.type)return r}return this._getLayerDomain(e)}async queryAttachments(e,r){await this.load(),e=q.from(e);const t=this.capabilities;if(!t?.data?.supportsAttachment)throw new l("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:o,globalIds:a,num:s,size:n,start:p,where:y}=e;if(!t?.operations?.supportsQueryAttachments){if(i?.length>0||a?.length>0||n?.length>0||s||p||y)throw new l("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e)}if(!(o?.length||a?.length||y))throw new l("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new l("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new l("queryFeatures:not-supported","this layer has no url.");const t=await this.queryTask.execute(e,{...r,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(t?.features)for(const i of t.features)i.sourceLayer=this;return t}toExportImageJSON(e){const r={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},t=c(e,this.definitionExpression);null!=t&&(r.definitionExpression=t);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce(((e,r)=>(e[r]=this.originIdOf(r),e)),{}),o=Object.keys(i).some((e=>i[e]>L.SERVICE));if(o){const e=r.drawingInfo={};if(i.renderer>L.SERVICE&&(e.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>L.SERVICE&&(e.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>L.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some((e=>!e.labelPlacement))&&d.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let r=this.labelingInfo;null!=this.geometryType&&(r=_(this.labelingInfo,k.toJSON(this.geometryType))),e.showLabels=!0,e.labelingInfo=r.filter((e=>e.labelPlacement)).map((e=>e.toJSON({origin:"service",layer:this.layer})))}else e.showLabels=!1;i.opacity>L.SERVICE&&(e.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(e.renderer)}return r}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,(e=>{e.color||"esriSMSX"!==e.style&&"esriSMSCross"!==e.style||(e.outline?.color?e.color=e.outline.color:e.color=[0,0,0,0])}))}_forEachSimpleMarkerSymbols(e,r){if(e){const t=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const e of t)B(e.symbol)&&r(e.symbol);"symbol"in e&&B(e.symbol)&&r(e.symbol),"defaultSymbol"in e&&B(e.defaultSymbol)&&r(e.defaultSymbol)}}_setAndNotifyLayer(e,r){const t=this.layer,i=this._get(e);let o,a;switch(e){case"definitionExpression":case"floorInfo":o="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":o="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":o="supportsDynamicLayers",a="supportsModification"}const s=E(this).getDefaultOrigin();if("service"!==s){if(o&&!1===this.layer?.capabilities?.exportMap?.[o])return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${o}'`);if(a&&!1===this.capabilities?.exportMap[a])return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${a}'`)}"source"!==e||"not-loaded"===this.loadStatus?(this._set(e,r),"service"!==s&&i!==r&&t&&t.emit&&t.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,r){r&&(r.forEach((e=>{e.parent=null,e.layer=null})),this.removeAllHandles()),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null})),e.on("before-changes",(e=>{const r=this.layer?.capabilities?.exportMap?.supportsSublayersChanges;null==r||r||(d.getLogger(this).error(new l("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),e.preventDefault())}))]))}_logLockedError(e,r){const{layer:t,declaredClass:i}=this;d.getLogger(i).error(new l("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${t?.id}'`,{reason:r,sublayer:this,layer:t}))}_getLayerDomain(e){const r=this.fieldsIndex.get(e);return r?r.domain:null}};W.test={isMapImageLayerOverridePolicy:e=>e===G||e===J,isTileImageLayerOverridePolicy:e=>e===$},e([m({readOnly:!0})],W.prototype,"capabilities",void 0),e([b("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],W.prototype,"readCapabilities",null),e([m()],W.prototype,"defaultPopupTemplate",null),e([m({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:J}}})],W.prototype,"definitionExpression",null),e([m({readOnly:!0})],W.prototype,"effectiveScaleRange",null),e([b("service","maxScaleRange",["minScale","maxScale"])],W.prototype,"readMaxScaleRange",null),e([m({type:[P],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],W.prototype,"fields",void 0),e([m({readOnly:!0})],W.prototype,"fieldsIndex",null),e([m({type:A,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:J},origins:{"web-scene":{read:!1,write:!1}}}})],W.prototype,"floorInfo",null),e([m({type:U,json:{read:{source:"layerDefinition.extent"}}})],W.prototype,"fullExtent",void 0),e([m({type:k.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:k.read}}}}})],W.prototype,"geometryType",void 0),e([m({type:String})],W.prototype,"globalIdField",void 0),e([b("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],W.prototype,"readGlobalIdFieldFromService",null),e([m({type:v,json:{write:{ignoreOrigin:!0}}})],W.prototype,"id",null),e([m({value:null,type:[T],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:G}}})],W.prototype,"labelingInfo",null),e([S("labelingInfo")],W.prototype,"writeLabelingInfo",null),e([m({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:G}}})],W.prototype,"labelsVisible",null),e([m({value:null})],W.prototype,"layer",null),e([m({type:String,json:{write:{overridePolicy:$}}})],W.prototype,"layerItemId",void 0),e([m({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:H}}})],W.prototype,"legendEnabled",void 0),e([m({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],W.prototype,"listMode",null),e([m({type:Number,value:0,json:{write:{overridePolicy:G}}})],W.prototype,"minScale",null),e([b("minScale",["minScale","layerDefinition.minScale"])],W.prototype,"readMinScale",null),e([m({type:Number,value:0,json:{write:{overridePolicy:G}}})],W.prototype,"maxScale",null),e([b("maxScale",["maxScale","layerDefinition.maxScale"])],W.prototype,"readMaxScale",null),e([m({type:String})],W.prototype,"objectIdField",void 0),e([b("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],W.prototype,"readObjectIdFieldFromService",null),e([m({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:G}}})],W.prototype,"opacity",null),e([b("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],W.prototype,"readOpacity",null),e([S("opacity")],W.prototype,"writeOpacity",null),e([m({json:{type:v,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:G}}})],W.prototype,"parent",void 0),e([S("parent")],W.prototype,"writeParent",null),e([m({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,r)=>!r.disablePopup},write:{target:"disablePopup",overridePolicy:H,writer(e,r,t){r[t]=!e}}}})],W.prototype,"popupEnabled",void 0),e([m({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:H}}})],W.prototype,"popupTemplate",void 0),e([m({readOnly:!0})],W.prototype,"queryTask",null),e([m({types:t,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:G},origins:{"web-scene":{types:i,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:G}}}}})],W.prototype,"renderer",null),e([m({types:{key:"type",base:null,typeMap:{"data-layer":M,"map-layer":N}},cast(e){if(e){if("mapLayerId"in e)return j(N,e);if("dataSource"in e)return j(M,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:G}}})],W.prototype,"source",null),e([m()],W.prototype,"sourceJSON",void 0),e([m({value:null,json:{type:[v],write:{target:"subLayerIds",allowNull:!0,overridePolicy:G}}})],W.prototype,"sublayers",null),e([h("sublayers")],W.prototype,"castSublayers",null),e([S("sublayers")],W.prototype,"writeSublayers",null),e([m({type:String,json:{name:"name",write:{overridePolicy:H}}})],W.prototype,"title",void 0),e([b("service","title",["name","layerDefinition.name"])],W.prototype,"readTitle",null),e([m({type:String})],W.prototype,"typeIdField",void 0),e([m({json:{read:!1},readOnly:!0,value:"sublayer"})],W.prototype,"type",void 0),e([b("typeIdField",["layerDefinition.typeIdField"])],W.prototype,"readTypeIdField",null),e([m({type:[x],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],W.prototype,"types",void 0),e([m({type:String,json:{name:"layerUrl",write:{overridePolicy:$}}})],W.prototype,"url",null),e([m({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:G}}})],W.prototype,"visible",null),e([S("visible")],W.prototype,"writeVisible",null),W=Q=e([g("esri.layers.support.Sublayer")],W);const X=W;export{X as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import r from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import{rendererTypes as t,webSceneRendererTypes as i}from"../../renderers/support/types.js";import o from"../../request.js";import{isSymbol3D as a}from"../../symbols.js";import s from"../../core/Collection.js";import l from"../../core/Error.js";import has from"../../core/has.js";import{IdentifiableMixin as n}from"../../core/Identifiable.js";import{clone as p}from"../../core/lang.js";import y from"../../core/Loadable.js";import d from"../../core/Logger.js";import{MultiOriginJSONMixin as u}from"../../core/MultiOriginJSONSupport.js";import{sqlAnd as c}from"../../core/sql.js";import{objectToQuery as f}from"../../core/urlUtils.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import{cast as h}from"../../core/accessorSupport/decorators/cast.js";import{reader as b}from"../../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{writer as S}from"../../core/accessorSupport/decorators/writer.js";import{ensureInteger as I,ensureType as w,Integer as v,ensureClass as j}from"../../core/accessorSupport/ensureType.js";import{OriginId as L,nameToId as D}from"../../core/accessorSupport/PropertyOrigin.js";import{getProperties as E}from"../../core/accessorSupport/utils.js";import F from"../graphics/sources/support/QueryTask.js";import x from"./FeatureType.js";import P from"./Field.js";import O from"./FieldsIndex.js";import T from"./LabelClass.js";import{validateLabelingInfo as _}from"./labelingInfo.js";import A from"./LayerFloorInfo.js";import{getFeatureLayerCapabilities as V}from"./serviceCapabilitiesUtils.js";import{DataLayerSource as M}from"./source/DataLayerSource.js";import{MapLayerSource as N}from"./source/MapLayerSource.js";import{parseUrl as q}from"../../rest/utils.js";import R from"../../rest/support/AttachmentQuery.js";import C from"../../rest/support/Query.js";import{createPopupTemplate as U}from"../../support/popupUtils.js";import k from"../../geometry/Extent.js";import{featureGeometryTypeKebabDictionary as Q}from"../../geometry/support/typeUtils.js";var B;function J(e){return null!=e&&"esriSMS"===e.type}function $(e,r,t){const i=this.originIdOf(r)>=D(t.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!t&&("map-image"===t.layer?.type&&(t.writeSublayerStructure||i))}}function G(e,r,t){return{enabled:!!t&&("tile"===t.layer?.type&&(t.origin&&this.originIdOf(r)>=D(t.origin)||this._isOverridden(r)))}}function H(e,r,t){return{ignoreOrigin:!0,enabled:t&&t.writeSublayerStructure||!1}}function z(e,r,t){return{ignoreOrigin:!0,enabled:!!t&&(t.writeSublayerStructure||this.originIdOf(r)>=D(t.origin))}}let K=0;const W=new Set;W.add("layer"),W.add("parent"),W.add("loaded"),W.add("loadStatus"),W.add("loadError"),W.add("loadWarnings");let X=B=class extends(u(n(y))){constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:r,url:t}=this;if(!r&&!t)throw new l("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=r?await r.fetchSublayerInfo(this,e):(await o(t,{responseType:"json",query:{f:"json"},...e})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service",layer:r,url:q(t)}))})()),this}readCapabilities(e,r){r=r.layerDefinition||r;const{operations:{supportsQuery:t,supportsQueryAttachments:i},query:{supportsFormatPBF:o},data:{supportsAttachment:a},queryRelated:s}=V(r,this.url);return{exportMap:{supportsModification:!!r.canModifyLayer},operations:{supportsQuery:t,supportsQueryAttachments:i},data:{supportsAttachment:a},query:{supportsFormatPBF:o},queryRelated:s}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:r}=this;return{minScale:e,maxScale:r}}readMaxScaleRange(e,r){return{minScale:(r=r.layerDefinition||r).minScale??0,maxScale:r.maxScale??0}}get fieldsIndex(){return new O(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,r){if((r=r.layerDefinition||r).globalIdField)return r.globalIdField;if(r.fields)for(const t of r.fields)if("esriFieldTypeGlobalID"===t.type)return t.name}get id(){const e=this._get("id");return e??K++}set id(e){this._get("id")!==e&&(!1!==this.layer?.capabilities?.exportMap?.supportsDynamicLayers?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,r,t,i){e&&e.length&&(r.layerDefinition={drawingInfo:{labelingInfo:e.map((e=>e.write({},i)))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach((r=>r.layer=e))}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,r){return r.minScale||r.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,r){return r.maxScale||r.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,r){if((r=r.layerDefinition||r).objectIdField)return r.objectIdField;if(r.fields)for(const t of r.fields)if("esriFieldTypeOID"===t.type)return t.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,r){const t=r.layerDefinition;return 1-.01*((null!=t?.transparency?t.transparency:t?.drawingInfo?.transparency)??0)}writeOpacity(e,r,t,i){r.layerDefinition={drawingInfo:{transparency:100-100*e}}}writeParent(e,r){this.parent&&this.parent!==this.layer?r.parentLayerId=I(this.parent.id):r.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{spatialReference:e}=this.layer,r="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:t,fieldsIndex:i}=this,o=has("featurelayer-pbf")&&t?.query.supportsFormatPBF,a=t?.operations?.supportsQueryAttachments??!1;return new F({url:this.url,pbfSupported:o,fieldsIndex:i,gdbVersion:r,sourceSpatialReference:e,queryAttachmentsSupported:a})}set renderer(e){if(e)for(const r of e.getSymbols())if(a(r)){d.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new N({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return w(s.ofType(B),e)}writeSublayers(e,r,t){this.sublayers?.length&&(r[t]=this.sublayers.map((e=>e.id)).toArray().reverse())}readTitle(e,r){return r.layerDefinition?.name??r.name}readTypeIdField(e,r){let t=(r=r.layerDefinition||r).typeIdField;if(t&&r.fields){t=t.toLowerCase();const e=r.fields.find((e=>e.name.toLowerCase()===t));e&&(t=e.name)}return t}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,r=this.source;if(!e)return null;if(this._lastParsedUrl=e,"map-layer"===r?.type)return`${e.path}/${r.mapLayerId}`;const t={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${f(t)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,r,t,i){r[t]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=E(this),r=new B;return E(r).store=e.clone(W),this.commitProperty("url"),r._lastParsedUrl=this._lastParsedUrl,r}createPopupTemplate(e){return U(this,e)}createQuery(){return new C({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await import("../FeatureLayer.js")).default,{layer:r,url:t}=this;let i;if(t&&this.originIdOf("url")>L.SERVICE)i=new e({url:t});else{if(!r?.parsedUrl)throw new l("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const t=r.parsedUrl;i=new e({url:t.path}),t&&this.source&&("map-layer"===this.source.type?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return null!=r?.refreshInterval&&(i.refreshInterval=r.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=p(this.floorInfo)),this.originIdOf("labelingInfo")>L.SERVICE&&(i.labelingInfo=p(this.labelingInfo)),this.originIdOf("labelsVisible")>L.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>L.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>L.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>L.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>L.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>L.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>L.DEFAULTS&&(i.popupTemplate=p(this.popupTemplate)),this.originIdOf("renderer")>L.SERVICE&&(i.renderer=p(this.renderer)),"data-layer"===this.source?.type&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>L.DEFAULTS&&(i.title=this.title),"map-image"===r?.type&&r.originIdOf("customParameters")>L.DEFAULTS&&(i.customParameters=r.customParameters),"tile"===r?.type&&r.originIdOf("customParameters")>L.DEFAULTS&&(i.customParameters=r.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){const{typeIdField:r,types:t}=this;if(!r||!e)return null;const i=e.attributes?e.attributes[r]:void 0;if(null==i)return null;let o=null;return t?.some((e=>{const{id:r}=e;return null!=r&&(r.toString()===i.toString()&&(o=e),!!o)})),o}getFieldDomain(e,r){const t=r?.feature,i=this.getFeatureType(t);if(i){const r=i.domains&&i.domains[e];if(r&&"inherited"!==r.type)return r}return this._getLayerDomain(e)}async queryAttachments(e,r){await this.load(),e=R.from(e);const t=this.capabilities;if(!t?.data?.supportsAttachment)throw new l("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:o,globalIds:a,num:s,size:n,start:p,where:y}=e;if(!t?.operations?.supportsQueryAttachments){if(i?.length>0||a?.length>0||n?.length>0||s||p||y)throw new l("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e)}if(!(o?.length||a?.length||y))throw new l("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new l("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new l("queryFeatures:not-supported","this layer has no url.");const t=await this.queryTask.execute(e,{...r,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(t?.features)for(const i of t.features)i.sourceLayer=this;return t}toExportImageJSON(e){const r={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},t=c(e,this.definitionExpression);null!=t&&(r.definitionExpression=t);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce(((e,r)=>(e[r]=this.originIdOf(r),e)),{}),o=Object.keys(i).some((e=>i[e]>L.SERVICE));if(o){const e=r.drawingInfo={};if(i.renderer>L.SERVICE&&(e.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>L.SERVICE&&(e.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>L.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some((e=>!e.labelPlacement))&&d.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let r=this.labelingInfo;null!=this.geometryType&&(r=_(this.labelingInfo,Q.toJSON(this.geometryType))),e.showLabels=!0,e.labelingInfo=r.filter((e=>e.labelPlacement)).map((e=>e.toJSON({origin:"service",layer:this.layer})))}else e.showLabels=!1;i.opacity>L.SERVICE&&(e.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(e.renderer)}return r}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,(e=>{e.color||"esriSMSX"!==e.style&&"esriSMSCross"!==e.style||(e.outline?.color?e.color=e.outline.color:e.color=[0,0,0,0])}))}_forEachSimpleMarkerSymbols(e,r){if(e){const t=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const e of t)J(e.symbol)&&r(e.symbol);"symbol"in e&&J(e.symbol)&&r(e.symbol),"defaultSymbol"in e&&J(e.defaultSymbol)&&r(e.defaultSymbol)}}_setAndNotifyLayer(e,r){const t=this.layer,i=this._get(e);let o,a;switch(e){case"definitionExpression":case"floorInfo":o="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":o="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":o="supportsDynamicLayers",a="supportsModification"}const s=E(this).getDefaultOrigin();if("service"!==s){if(o&&!1===this.layer?.capabilities?.exportMap?.[o])return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${o}'`);if(a&&!1===this.capabilities?.exportMap[a])return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${a}'`)}"source"!==e||"not-loaded"===this.loadStatus?(this._set(e,r),"service"!==s&&i!==r&&t&&t.emit&&t.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,r){r&&(r.forEach((e=>{e.parent=null,e.layer=null})),this.removeAllHandles()),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null})),e.on("before-changes",(e=>{const r=this.layer?.capabilities?.exportMap?.supportsSublayersChanges;null==r||r||(d.getLogger(this).error(new l("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),e.preventDefault())}))]))}_logLockedError(e,r){const{layer:t,declaredClass:i}=this;d.getLogger(i).error(new l("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${t?.id}'`,{reason:r,sublayer:this,layer:t}))}_getLayerDomain(e){const r=this.fieldsIndex.get(e);return r?r.domain:null}};X.test={isMapImageLayerOverridePolicy:e=>e===H||e===$,isTileImageLayerOverridePolicy:e=>e===G},e([m({readOnly:!0})],X.prototype,"capabilities",void 0),e([b("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],X.prototype,"readCapabilities",null),e([m()],X.prototype,"defaultPopupTemplate",null),e([m({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:$}}})],X.prototype,"definitionExpression",null),e([m({readOnly:!0})],X.prototype,"effectiveScaleRange",null),e([b("service","maxScaleRange",["minScale","maxScale"])],X.prototype,"readMaxScaleRange",null),e([m({type:[P],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],X.prototype,"fields",void 0),e([m({readOnly:!0})],X.prototype,"fieldsIndex",null),e([m({type:A,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:$},origins:{"web-scene":{read:!1,write:!1}}}})],X.prototype,"floorInfo",null),e([m({type:k,json:{read:{source:"layerDefinition.extent"}}})],X.prototype,"fullExtent",void 0),e([m({type:Q.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:Q.read}}}}})],X.prototype,"geometryType",void 0),e([m({type:String})],X.prototype,"globalIdField",void 0),e([b("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],X.prototype,"readGlobalIdFieldFromService",null),e([m({type:v,json:{write:{ignoreOrigin:!0}}})],X.prototype,"id",null),e([m({value:null,type:[T],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:H}}})],X.prototype,"labelingInfo",null),e([S("labelingInfo")],X.prototype,"writeLabelingInfo",null),e([m({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:H}}})],X.prototype,"labelsVisible",null),e([m({value:null})],X.prototype,"layer",null),e([m({type:String,json:{write:{overridePolicy:G}}})],X.prototype,"layerItemId",void 0),e([m({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:z}}})],X.prototype,"legendEnabled",void 0),e([m({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],X.prototype,"listMode",null),e([m({type:Number,value:0,json:{write:{overridePolicy:H}}})],X.prototype,"minScale",null),e([b("minScale",["minScale","layerDefinition.minScale"])],X.prototype,"readMinScale",null),e([m({type:Number,value:0,json:{write:{overridePolicy:H}}})],X.prototype,"maxScale",null),e([b("maxScale",["maxScale","layerDefinition.maxScale"])],X.prototype,"readMaxScale",null),e([m({type:String})],X.prototype,"objectIdField",void 0),e([b("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],X.prototype,"readObjectIdFieldFromService",null),e([m({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:H}}})],X.prototype,"opacity",null),e([b("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],X.prototype,"readOpacity",null),e([S("opacity")],X.prototype,"writeOpacity",null),e([m({json:{type:v,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:H}}})],X.prototype,"parent",void 0),e([S("parent")],X.prototype,"writeParent",null),e([m({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,r)=>!r.disablePopup},write:{target:"disablePopup",overridePolicy:z,writer(e,r,t){r[t]=!e}}}})],X.prototype,"popupEnabled",void 0),e([m({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:z}}})],X.prototype,"popupTemplate",void 0),e([m({readOnly:!0})],X.prototype,"queryTask",null),e([m({types:t,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:H},origins:{"web-scene":{types:i,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:H}}}}})],X.prototype,"renderer",null),e([m({types:{key:"type",base:null,typeMap:{"data-layer":M,"map-layer":N}},cast(e){if(e){if("mapLayerId"in e)return j(N,e);if("dataSource"in e)return j(M,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:H}}})],X.prototype,"source",null),e([m()],X.prototype,"sourceJSON",void 0),e([m({value:null,json:{type:[v],write:{target:"subLayerIds",allowNull:!0,overridePolicy:H}}})],X.prototype,"sublayers",null),e([h("sublayers")],X.prototype,"castSublayers",null),e([S("sublayers")],X.prototype,"writeSublayers",null),e([m({type:String,json:{name:"name",write:{overridePolicy:z}}})],X.prototype,"title",void 0),e([b("service","title",["name","layerDefinition.name"])],X.prototype,"readTitle",null),e([m({type:String})],X.prototype,"typeIdField",void 0),e([m({json:{read:!1},readOnly:!0,value:"sublayer"})],X.prototype,"type",void 0),e([b("typeIdField",["layerDefinition.typeIdField"])],X.prototype,"readTypeIdField",null),e([m({type:[x],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],X.prototype,"types",void 0),e([m({type:String,json:{name:"layerUrl",write:{overridePolicy:G}}})],X.prototype,"url",null),e([m({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:H}}})],X.prototype,"visible",null),e([S("visible")],X.prototype,"writeVisible",null),X=B=e([g("esri.layers.support.Sublayer")],X);const Y=X;export{Y as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.29.4",
3
+ "version": "4.29.6",
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.29/esri/copyright.txt for details.
4
4
  */
5
- const c="20240304",a="38b01779c6876d655f0c16d5aad92a1c2f6c7077";export{c as buildDate,a as commitHash};
5
+ const c="20240306",f="856686c0c7ca2d7c3b79a28ff4a12ff8c06d2451";export{c as buildDate,f 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.29/esri/copyright.txt for details.
4
4
  */
5
- import{makeData as e,isAbsolute as a,join as r,isDataProtocol as t,dataComponents as i}from"../../core/urlUtils.js";import{f as n,w as l}from"../../chunks/persistableUrlUtils.js";function o(a,r,t){return r.imageData?e({mediaType:r.contentType||"image/png",isBase64:!0,data:r.imageData}):s(r.url,t)}function s(e,t){return p(t)&&!a(e)&&t?.layer?.parsedUrl?r(t.layer.parsedUrl.path,"images",e):n(e,t)}function u(e,a,r,n){if(t(e)){const t=i(e);if(!t)return;a.contentType=t.mediaType,a.imageData=t.data,r&&r.imageData===a.imageData&&r.url&&l(r.url,a,"url",n)}else l(e,a,"url",n)}const m={json:{read:{source:["imageData","url"],reader:o},write:{writer(e,a,r,t){u(e,a,this.source,t)}}}},c={readOnly:!0,json:{read:{source:["imageData","url"],reader(e,a,r){const t={};return a.imageData&&(t.imageData=a.imageData),a.contentType&&(t.contentType=a.contentType),a.url&&(t.url=s(a.url,r)),t}}}};function p(e){return!(null==e||"service"!==e.origin&&"portal-item"!==e.origin||"feature"!==e.layer?.type&&"stream"!==e.layer?.type)}export{s as read,o as readImageDataOrUrl,c as sourcePropertyDefinition,m as urlPropertyDefinition,u as writeImageDataAndUrl};
5
+ import{makeData as e,isAbsolute as r,join as t,isDataProtocol as a,dataComponents as n}from"../../core/urlUtils.js";import{f as i,w as u}from"../../chunks/persistableUrlUtils.js";function l(r,t,a){return t.imageData?e({mediaType:t.contentType||"image/png",isBase64:!0,data:t.imageData}):o(t.url,a)}function o(e,a){if(!r(e)){const r=p(a);if(r)return t(r,"images",e)}return i(e,a)}function s(e,r,t,i){if(a(e)){const a=n(e);if(!a)return;r.contentType=a.mediaType,r.imageData=a.data,t&&t.imageData===r.imageData&&t.url&&u(t.url,r,"url",i)}else u(e,r,"url",i)}const m={json:{read:{source:["imageData","url"],reader:l},write:{writer(e,r,t,a){s(e,r,this.source,a)}}}},c={readOnly:!0,json:{read:{source:["imageData","url"],reader(e,r,t){const a={};return r.imageData&&(a.imageData=r.imageData),r.contentType&&(a.contentType=r.contentType),r.url&&(a.url=o(r.url,t)),a}}}};function p(e){if(!e)return null;const{origin:r,layer:t}=e;if("service"!==r&&"portal-item"!==r)return null;const a=t?.type;return"feature"===a||"stream"===a?t.parsedUrl?.path:"map-image"===a||"tile"===a?e.url?.path:null}export{o as read,l as readImageDataOrUrl,c as sourcePropertyDefinition,m as urlPropertyDefinition,s as writeImageDataAndUrl};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import has from"../../../core/has.js";import{removeMaybe as t}from"../../../core/maybe.js";import{addFrameTask as r}from"../../../core/scheduling.js";import{signal as s}from"../../../core/signal.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{CIMAnalyzer as n}from"../../../symbols/cim/cimAnalyzer.js";import{Container as a}from"./Container.js";import{ManagedCanvas as o}from"./ManagedCanvas.js";import{MAX_TILE_RESHUFFLES_PER_FRAME as h}from"./webgl/definitions.js";import{WGLDrawPhase as d}from"./webgl/enums.js";import l from"./webgl/Painter.js";import{ArrayBufferPool as m}from"./webgl/PooledUint32Array.js";import{Profiler as c}from"./webgl/Profiler.js";import{TileReshuffleManager as u}from"./webgl/TileReshuffleManager.js";import{startup as p,shutdown as f}from"./webgl/shaderGraph/techniques/TechniqueRegistry.js";import{Timeline as g}from"../support/Timeline.js";import{resampleHermite as _}from"../../support/screenshotUtils.js";import{TextureWrapMode as b,SizedPixelFormat as w,RenderbufferFormat as R,PixelFormat as y,PixelType as x}from"../../webgl/enums.js";import{FramebufferObject as P}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as j}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as C}from"../../webgl/RenderingContext.js";import{TextureDescriptor as T}from"../../webgl/TextureDescriptor.js";import{createEmptyImageData as M}from"../../../core/imageUtils.js";const O=2e3;class v extends a{constructor(t,i){super(),this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=s(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new u,this._canvas=new o(t),this.context=new C(this._canvas.gl,i.contextOptions??{}),this.painter=new l(this.context,this),this._cimAnalyzer=new n(this.painter.textureManager.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),t.appendChild(this._debugOutput));const a=()=>this._highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new g,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new c(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return a()},reshuffleManager:this._reshuffleManager,backgroundColor:i.backgroundColor},this._taskHandle=r({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",(t=>this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)}))),this._bufferPool=new m,p()}destroy(){f(),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=t(this._taskHandle),this._lostWebGLContextHandle=t(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=O,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(h),this._canvas.render(e,(()=>this._renderChildren(this.children,e)));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=d.MAP;for(const s of e)s.processRender(t);if(this.children.some((e=>e.hasHighlight))){t.drawPhase=d.HIGHLIGHT;for(const r of e)r.processRender(t)}if(this.children.some((e=>e.hasLabels))){t.drawPhase=d.LABEL;for(const r of e)r.processRender(t)}if(has("esri-tiles-debug")){t.drawPhase=d.DEBUG;for(const r of e)r.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._canvas.resize(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,s){const i=Math.round(this.state.size[0]*e.resolutionScale),n=Math.round(this.state.size[1]*e.resolutionScale),a=e.resolutionScale,o=this.context,h=this._state.clone();if(null!=s){const e=h.viewpoint;h.viewpoint.rotation=s,h.viewpoint=e}const d={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:a,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},l=new T(i,n);l.wrapMode=b.CLAMP_TO_EDGE,l.internalFormat=w.RGBA8,l.isImmutable=!0;const m=new P(o,l,new j(R.DEPTH_STENCIL,i,n)),c=o.getBoundFramebufferObject(),u=o.getViewport();o.bindFramebuffer(m),o.setViewport(0,0,i,n),this._renderChildren(t??this.children,d);const p=this._readbackScreenshot(m,{...e.cropArea,y:n-(e.cropArea.y+e.cropArea.height)});o.bindFramebuffer(c),o.setViewport(u.x,u.y,u.width,u.height),this.requestRender();const f=await p;let g;return 1===e.outputScale?g=f:(g=new ImageData(Math.round(f.width*e.outputScale),Math.round(f.height*e.outputScale)),_(f,g,!0)),m.dispose(),g}async _readbackScreenshot(e,t){const r=M(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,y.RGBA,x.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}export{v as Stage,O as extraRenderTime};
5
+ import e from"../../../core/Error.js";import has from"../../../core/has.js";import{removeMaybe as t}from"../../../core/maybe.js";import{addFrameTask as r}from"../../../core/scheduling.js";import{signal as s}from"../../../core/signal.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{CIMAnalyzer as n}from"../../../symbols/cim/cimAnalyzer.js";import{Container as a}from"./Container.js";import{ManagedCanvas as o}from"./ManagedCanvas.js";import{MAX_TILE_RESHUFFLES_PER_FRAME as h}from"./webgl/definitions.js";import{WGLDrawPhase as d}from"./webgl/enums.js";import l from"./webgl/Painter.js";import{ArrayBufferPool as m}from"./webgl/PooledUint32Array.js";import{Profiler as c}from"./webgl/Profiler.js";import{TileReshuffleManager as u}from"./webgl/TileReshuffleManager.js";import{startup as p,shutdown as f}from"./webgl/shaderGraph/techniques/TechniqueRegistry.js";import{Timeline as g}from"../support/Timeline.js";import{resampleHermite as _}from"../../support/screenshotUtils.js";import{TextureWrapMode as b,SizedPixelFormat as w,RenderbufferFormat as R,PixelFormat as y,PixelType as x}from"../../webgl/enums.js";import{FramebufferObject as P}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as j}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as C}from"../../webgl/RenderingContext.js";import{TextureDescriptor as T}from"../../webgl/TextureDescriptor.js";import{createEmptyImageData as M}from"../../../core/imageUtils.js";const O=2e3;class v extends a{constructor(t,i){super(),this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=s(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new u,this._canvas=new o(t),this.context=new C(this._canvas.gl,i.contextOptions??{}),this.painter=new l(this.context,this),this._cimAnalyzer=new n(this.painter.textureManager.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),t.appendChild(this._debugOutput));const a=()=>this._highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new g,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new c(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return a()},reshuffleManager:this._reshuffleManager,backgroundColor:i.backgroundColor},this._taskHandle=r({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",(t=>this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)}))),this._bufferPool=new m,p()}destroy(){f(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=t(this._taskHandle),this._lostWebGLContextHandle=t(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=O,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(h),this._canvas.render(e,(()=>this._renderChildren(this.children,e)));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=d.MAP;for(const s of e)s.processRender(t);if(this.children.some((e=>e.hasHighlight))){t.drawPhase=d.HIGHLIGHT;for(const r of e)r.processRender(t)}if(this.children.some((e=>e.hasLabels))){t.drawPhase=d.LABEL;for(const r of e)r.processRender(t)}if(has("esri-tiles-debug")){t.drawPhase=d.DEBUG;for(const r of e)r.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._canvas.resize(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,s){const i=Math.round(this.state.size[0]*e.resolutionScale),n=Math.round(this.state.size[1]*e.resolutionScale),a=e.resolutionScale,o=this.context,h=this._state.clone();if(null!=s){const e=h.viewpoint;h.viewpoint.rotation=s,h.viewpoint=e}const d={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:a,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},l=new T(i,n);l.wrapMode=b.CLAMP_TO_EDGE,l.internalFormat=w.RGBA8,l.isImmutable=!0;const m=new P(o,l,new j(R.DEPTH_STENCIL,i,n)),c=o.getBoundFramebufferObject(),u=o.getViewport();o.bindFramebuffer(m),o.setViewport(0,0,i,n),this._renderChildren(t??this.children,d);const p=this._readbackScreenshot(m,{...e.cropArea,y:n-(e.cropArea.y+e.cropArea.height)});o.bindFramebuffer(c),o.setViewport(u.x,u.y,u.width,u.height),this.requestRender();const f=await p;let g;return 1===e.outputScale?g=f:(g=new ImageData(Math.round(f.width*e.outputScale),Math.round(f.height*e.outputScale)),_(f,g,!0)),m.dispose(),g}async _readbackScreenshot(e,t){const r=M(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,y.RGBA,x.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}export{v as Stage,O as extraRenderTime};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{createResolver as i}from"../../../../core/promiseUtils.js";import{AttributeDataType as s,filterFlagsUnit as r,animationUnit as n,gpgpuUnit as a,visualVariableUnit as o,dataDrivenUnit0 as u,dataDrivenUnit1 as h,dataDrivenUnit2 as d}from"./definitions.js";import{getDisplayIdTexel as l}from"./DisplayId.js";import{getPixelArrayCtor as p,getPixelBytes as _}from"./Utils.js";import{TextureWrapMode as c,TextureSamplingMode as g}from"../../../webgl/enums.js";import{FramebufferObject as x}from"../../../webgl/FramebufferObject.js";import{Texture as f}from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const T=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:n}=t,a=p(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=n,n||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b;return t.wrapMode=c.CLAMP_TO_EDGE,t.samplingMode=g.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=l(t),r=this.data,n=s*this.texelSize+e;!r||n>=r.length||(r[n]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=l(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,a=this.getTexture(e),o=4,u=(s-s%this.size)/this.size,h=(r-r%this.size)/this.size,d=u,l=this.size,_=h,c=u*this.size*o,g=(l+_*this.size)*o-c,x=p(this.pixelType),f=new x(n,c*x.BYTES_PER_ELEMENT,g),b=this.size,m=_-d+1;if(m>this.size)return void T().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,d,b,m,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const n=1<<i%this.texelSize;t.layout&n&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=p(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,n=this._lastTexture.descriptor.pixelFormat,a=this.getFBO(t),o=_(r),u=new(p(r))(new ArrayBuffer(i*s*o*this.texelSize)),h=t.getBoundFramebufferObject(),{x:d,y:l,width:c,height:g}=t.getViewport();t.bindFramebuffer(a),a.readPixels(0,0,i,s,n,r,u),e.updateData(0,0,0,2*i,s/2,u),t.setViewport(d,l,c,g),t.bindFramebuffer(h)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._locked=!1}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map(((t,e)=>null!=t?new m(t,this.size,e):null));else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new m(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose();for(const{resolver:t}of this._pendingAttributeUpdates)t.reject("AttributeStore destroyed");this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVVSize(t){return this.getData(t,s.VV,0,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const n=r.getData(t,i);return null!=n?n:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){this._locked=!1,this.update()}async requestUpdate(t){const e=i();this._version=t.version,this._pendingAttributeUpdates.push({inner:t,resolver:e}),has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}update(){if(this._locked)return;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];for(const{inner:e,resolver:i}of t){const{blockData:t,initArgs:s,sendUpdateEpoch:r,version:n}=e;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${r}] AttributeStoreView.applyUpdate`),this._version=n,this._epoch=r,null!=s&&this._initialize(s);const a=this._data;for(let e=0;e<t.length;e++){const i=t[e],s=a[e];null!=s&&null!=i&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${e}] AttributeStoreView.update`,{block:i}),s.update(i))}i.resolve()}}getUniforms(t){return{filterFlags:{texture:this._getTexture(t,s.FilterFlags),unit:r},animation:{texture:this._getTexture(t,s.Animation),unit:n},gpgpu:{texture:this._getTexture(t,s.GPGPU),unit:a},visualVariableData:{texture:this._getTexture(t,s.VV),unit:o},dataDriven0:{texture:this._getTexture(t,s.DD0),unit:u},dataDriven1:{texture:this._getTexture(t,s.DD1),unit:h},dataDriven2:{texture:this._getTexture(t,s.DD2),unit:d},size:this.size}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b;e.wrapMode=c.CLAMP_TO_EDGE,e.samplingMode=g.NEAREST,e.width=1,e.height=1,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
5
+ import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{createResolver as i}from"../../../../core/promiseUtils.js";import{AttributeDataType as s,filterFlagsUnit as r,animationUnit as n,gpgpuUnit as a,visualVariableUnit as o,dataDrivenUnit0 as u,dataDrivenUnit1 as h,dataDrivenUnit2 as d}from"./definitions.js";import{getDisplayIdTexel as l}from"./DisplayId.js";import{getPixelArrayCtor as p,getPixelBytes as c}from"./Utils.js";import{TextureWrapMode as _,TextureSamplingMode as g}from"../../../webgl/enums.js";import{FramebufferObject as x}from"../../../webgl/FramebufferObject.js";import{Texture as f}from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const T=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:n}=t,a=p(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=n,n||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b;return t.wrapMode=_.CLAMP_TO_EDGE,t.samplingMode=g.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=l(t),r=this.data,n=s*this.texelSize+e;!r||n>=r.length||(r[n]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=l(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,a=this.getTexture(e),o=4,u=(s-s%this.size)/this.size,h=(r-r%this.size)/this.size,d=u,l=this.size,c=h,_=u*this.size*o,g=(l+c*this.size)*o-_,x=p(this.pixelType),f=new x(n,_*x.BYTES_PER_ELEMENT,g),b=this.size,m=c-d+1;if(m>this.size)return void T().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,d,b,m,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const n=1<<i%this.texelSize;t.layout&n&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=p(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,n=this._lastTexture.descriptor.pixelFormat,a=this.getFBO(t),o=c(r),u=new(p(r))(new ArrayBuffer(i*s*o*this.texelSize)),h=t.getBoundFramebufferObject(),{x:d,y:l,width:_,height:g}=t.getViewport();t.bindFramebuffer(a),a.readPixels(0,0,i,s,n,r,u),e.updateData(0,0,0,2*i,s/2,u),t.setViewport(d,l,_,g),t.bindFramebuffer(h)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._locked=!1}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map(((t,e)=>null!=t?new m(t,this.size,e):null));else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new m(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose();for(const{resolver:t}of this._pendingAttributeUpdates)t.reject("AttributeStore destroyed");this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVVSize(t){return this.getData(t,s.VV,0,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const n=r.getData(t,i);return null!=n?n:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){this._locked=!1,this.update()}async requestUpdate(t){const e=i();e.promise=e.promise.catch((t=>{has("esri-2d-update-debug")&&console.error("AttributeStoreView.requestUpdate rejected",t)})),this._version=t.version,this._pendingAttributeUpdates.push({inner:t,resolver:e}),has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}update(){if(this._locked)return;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];for(const{inner:e,resolver:i}of t){const{blockData:t,initArgs:s,sendUpdateEpoch:r,version:n}=e;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${r}] AttributeStoreView.applyUpdate`),this._version=n,this._epoch=r,null!=s&&this._initialize(s);const a=this._data;for(let e=0;e<t.length;e++){const i=t[e],s=a[e];null!=s&&null!=i&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${e}] AttributeStoreView.update`,{block:i}),s.update(i))}i.resolve()}}getUniforms(t){return{filterFlags:{texture:this._getTexture(t,s.FilterFlags),unit:r},animation:{texture:this._getTexture(t,s.Animation),unit:n},gpgpu:{texture:this._getTexture(t,s.GPGPU),unit:a},visualVariableData:{texture:this._getTexture(t,s.VV),unit:o},dataDriven0:{texture:this._getTexture(t,s.DD0),unit:u},dataDriven1:{texture:this._getTexture(t,s.DD1),unit:h},dataDriven2:{texture:this._getTexture(t,s.DD2),unit:d},size:this.size}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b;e.wrapMode=_.CLAMP_TO_EDGE,e.samplingMode=g.NEAREST,e.width=1,e.height=1,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{WGLDrawPhase as s,FeatureSymbologyDrawOrder as t}from"../../enums.js";class e{constructor(e){this.registryName=e,this.postProcessingEnabled=!1,this.overrideStencilRef=null,this.drawPhase=s.MAP|s.HITTEST|s.HIGHLIGHT|s.DEBUG,this.symbologyPlane=t.FILL}startup(){}shutdown(){}postProcess(s,t){}}export{e as Technique};
5
+ import{WGLDrawPhase as s,FeatureSymbologyDrawOrder as t}from"../../enums.js";class e{constructor(e){this.registryName=e,this.postProcessingEnabled=!1,this.overrideStencilRef=null,this.drawPhase=s.MAP|s.HITTEST|s.HIGHLIGHT|s.DEBUG,this.symbologyPlane=t.FILL}startup(){}shutdown(s){}postProcess(s,t){}}export{e as Technique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{DotDensityTechnique as e}from"./dotDensity/DotDensityTechnique.js";import{ComplexFillTechnique as i}from"./fill/ComplexFillTechnique.js";import{ComplexOutlineFillTechnique as l}from"./fill/ComplexOutlineFillTechnique.js";import{FillTechnique as t}from"./fill/FillTechnique.js";import{OutlineFillTechnique as n}from"./fill/OutlineFillTechnique.js";import{PatternFillTechnique as r}from"./fill/PatternFillTechnique.js";import{PatternOutlineFillTechnique as o}from"./fill/PatternOutlineFillTechnique.js";import{HeatmapTechnique as m}from"./heatmap/HeatmapTechnique.js";import{LabelTechnique as p}from"./labels/LabelTechnique.js";import{LineTechnique as u}from"./line/LineTechnique.js";import{TexturedLineTechnique as a}from"./line/TexturedLineTechnique.js";import{MarkerTechnique as f}from"./markers/MarkerTechnique.js";import{PieChartTechnique as s}from"./pieChart/PieChartTechnique.js";import{TextTechnique as c}from"./text/TextTechnique.js";const h={fill:new t("fill"),patternFill:new r("patternFill"),complexFill:new i("complexFill"),outlineFill:new n("outlineFill"),patternOutlineFill:new o("patternOutlineFill"),complexOutlineFill:new l("complexOutlineFill"),marker:new f("marker"),pieChart:new s("pieChart"),line:new u("line"),texturedLine:new a("texturedLine"),text:new c("text"),label:new p("label"),heatmap:new m("heatmap"),dotDensity:new e("dotDensity")};function F(){for(const e in h){h[e].startup()}}function T(){for(const e in h){h[e].shutdown()}}export{h as Techniques,T as shutdown,F as startup};
5
+ import{DotDensityTechnique as e}from"./dotDensity/DotDensityTechnique.js";import{ComplexFillTechnique as i}from"./fill/ComplexFillTechnique.js";import{ComplexOutlineFillTechnique as l}from"./fill/ComplexOutlineFillTechnique.js";import{FillTechnique as t}from"./fill/FillTechnique.js";import{OutlineFillTechnique as n}from"./fill/OutlineFillTechnique.js";import{PatternFillTechnique as r}from"./fill/PatternFillTechnique.js";import{PatternOutlineFillTechnique as o}from"./fill/PatternOutlineFillTechnique.js";import{HeatmapTechnique as m}from"./heatmap/HeatmapTechnique.js";import{LabelTechnique as p}from"./labels/LabelTechnique.js";import{LineTechnique as u}from"./line/LineTechnique.js";import{TexturedLineTechnique as a}from"./line/TexturedLineTechnique.js";import{MarkerTechnique as f}from"./markers/MarkerTechnique.js";import{PieChartTechnique as s}from"./pieChart/PieChartTechnique.js";import{TextTechnique as c}from"./text/TextTechnique.js";const h={fill:new t("fill"),patternFill:new r("patternFill"),complexFill:new i("complexFill"),outlineFill:new n("outlineFill"),patternOutlineFill:new o("patternOutlineFill"),complexOutlineFill:new l("complexOutlineFill"),marker:new f("marker"),pieChart:new s("pieChart"),line:new u("line"),texturedLine:new a("texturedLine"),text:new c("text"),label:new p("label"),heatmap:new m("heatmap"),dotDensity:new e("dotDensity")};function F(){for(const e in h){h[e].startup()}}function T(e){for(const i in h){h[i].shutdown(e)}}export{h as Techniques,T as shutdown,F as startup};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{tileSize as e,textureBindingRenderer0 as t,textureBindingRenderer1 as i}from"../../../definitions.js";import{isHighlight as s,isHittest as o,getFeatureUniforms as r,getSelectionDefines as n,getFeaturePipelineState as a,getViewUniforms as l}from"../featureTechniqueUtils.js";import{Technique as d}from"../Technique.js";import{DotDensityPointShader as u}from"./DotDensityPointShader.js";import{DotDensityPolygonShader as c}from"./DotDensityPolygonShader.js";import{DotDensityResources as h}from"./DotDensityResources.js";import{meshWriterRegistry as p}from"../mesh/MeshWriterRegistry.js";import{FillShader as m}from"../shaders/FillShader.js";import{ClearBufferBit as f}from"../../../../../../webgl/enums.js";class w extends d{constructor(){super(...arguments),this.shaders={polygon:new c,point:new u,fill:new m},this.meshWriter=p.DotDensityMeshWriter}render(e,t){s(e)||o(e)?this._renderPolygons(e,t):this._renderDotDensity(e,t)}_renderPolygons(e,t){const{context:i,painter:s}=e;s.setShader({shader:this.shaders.fill,uniforms:{...r(e,t.target),visualVariableColor:null,visualVariableOpacity:null},defines:{...n(e)},optionalAttributes:{zoomRange:!1},useComputeBuffer:o(e)}),s.setPipelineState(a(e)),s.submitDraw(i,t)}_renderDotDensity(s,o){const{context:d,painter:u,requiredLevel:c}=s,p=o.instance.getInput();this._resources||(this._resources=new h);const m=this._resources.getDotDensityTextures(d,e,p.seed),w=1/2**(c-o.target.key.level),g=e,x=g*window.devicePixelRatio*g*window.devicePixelRatio,D=1/w*(1/w),b=p.dotScale?s.state.scale/p.dotScale:1,y=p.dotValue*b*D;u.setShader({shader:this.shaders.polygon,uniforms:{...r(s,o.target),instance:{isActive:p.isActive,colors:p.colors,dotValue:Math.max(1,y)},draw:{dotTexture0:{unit:t,texture:m[0]},dotTexture1:{unit:i,texture:m[1]},tileZoomFactor:w,pixelRatio:window.devicePixelRatio,tileDotsOverArea:x/(e*window.devicePixelRatio*e*window.devicePixelRatio)}},defines:{...n(s),blending:p.blending},optionalAttributes:{},useComputeBuffer:!1}),u.setPipelineState(a(s));const P=d.getViewport();d.setViewport(0,0,e,e);const S=d.getBoundFramebufferObject(),_=this._resources.getFBO(d);d.bindFramebuffer(_),d.setClearColor(0,0,0,0),u.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1}),u.updatePipelineState(d),d.clear(f.COLOR_BUFFER_BIT),u.submitDraw(d,o),d.bindFramebuffer(S),d.setViewport(P.x,P.y,P.width,P.height);const v=this._resources.getFBO(d).colorTexture;u.setShader({shader:this.shaders.point,uniforms:{view:l(s,o.target),instance:{dotSize:p.dotSize},draw:{locations:{unit:t,texture:v},tileZoomFactor:1,pixelRatio:window.devicePixelRatio}},defines:{...n(s)},optionalAttributes:{},useComputeBuffer:!1}),u.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1}),u.submitDrawMesh(d,this._resources.getDotDensityMesh(d))}shutdown(){super.shutdown(),this._resources&&this._resources.destroy(),this._resources=null}}export{w as DotDensityTechnique};
5
+ import{tileSize as e,textureBindingRenderer0 as t,textureBindingRenderer1 as i}from"../../../definitions.js";import{isHighlight as o,isHittest as r,getFeatureUniforms as s,getSelectionDefines as n,getFeaturePipelineState as a,getViewUniforms as l}from"../featureTechniqueUtils.js";import{Technique as d}from"../Technique.js";import{DotDensityPointShader as u}from"./DotDensityPointShader.js";import{DotDensityPolygonShader as c}from"./DotDensityPolygonShader.js";import{DotDensityResources as h}from"./DotDensityResources.js";import{meshWriterRegistry as p}from"../mesh/MeshWriterRegistry.js";import{FillShader as m}from"../shaders/FillShader.js";import{ClearBufferBit as w}from"../../../../../../webgl/enums.js";class f extends d{constructor(){super(...arguments),this.shaders={polygon:new c,point:new u,fill:new m},this.meshWriter=p.DotDensityMeshWriter,this._resources=new Map}render(e,t){o(e)||r(e)?this._renderPolygons(e,t):this._renderDotDensity(e,t)}_renderPolygons(e,t){const{context:i,painter:o}=e;o.setShader({shader:this.shaders.fill,uniforms:{...s(e,t.target),visualVariableColor:null,visualVariableOpacity:null},defines:{...n(e)},optionalAttributes:{zoomRange:!1},useComputeBuffer:r(e)}),o.setPipelineState(a(e)),o.submitDraw(i,t)}_renderDotDensity(o,r){const{context:d,painter:u,requiredLevel:c}=o,h=r.instance.getInput(),p=this._getOrCreateResourcesRecord(d),m=p.getDotDensityTextures(d,e,h.seed),f=1/2**(c-r.target.key.level),g=e,x=g*window.devicePixelRatio*g*window.devicePixelRatio,D=1/f*(1/f),b=h.dotScale?o.state.scale/h.dotScale:1,y=h.dotValue*b*D;u.setShader({shader:this.shaders.polygon,uniforms:{...s(o,r.target),instance:{isActive:h.isActive,colors:h.colors,dotValue:Math.max(1,y)},draw:{dotTexture0:{unit:t,texture:m[0]},dotTexture1:{unit:i,texture:m[1]},tileZoomFactor:f,pixelRatio:window.devicePixelRatio,tileDotsOverArea:x/(e*window.devicePixelRatio*e*window.devicePixelRatio)}},defines:{...n(o),blending:h.blending},optionalAttributes:{},useComputeBuffer:!1}),u.setPipelineState(a(o));const R=d.getViewport();d.setViewport(0,0,e,e);const P=d.getBoundFramebufferObject(),S=p.getFBO(d);d.bindFramebuffer(S),d.setClearColor(0,0,0,0),u.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1}),u.updatePipelineState(d),d.clear(w.COLOR_BUFFER_BIT),u.submitDraw(d,r),d.bindFramebuffer(P),d.setViewport(R.x,R.y,R.width,R.height);const v=p.getFBO(d).colorTexture;u.setShader({shader:this.shaders.point,uniforms:{view:l(o,r.target),instance:{dotSize:h.dotSize},draw:{locations:{unit:t,texture:v},tileZoomFactor:1,pixelRatio:window.devicePixelRatio}},defines:{...n(o)},optionalAttributes:{},useComputeBuffer:!1}),u.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1}),u.submitDrawMesh(d,p.getDotDensityMesh(d))}shutdown(e){super.shutdown(e),this._resources.get(e)?.destroy(),this._resources.delete(e)}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return null==t&&(t=new h,this._resources.set(e,t)),t}}export{f as DotDensityTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{FillMeshWriter as t}from"./FillMeshWriter.js";import{processColorInput as r,packBitset as s}from"./meshWriterUtils.js";import{LineVertexSpec as i,LineMeshWriter as o}from"../line/LineMeshWriter.js";import{bitsetTypeFillOutline as n}from"../shaders/constants.js";import{DataType as a}from"../../../../../../webgl/enums.js";const c={createComputedParams:e=>e,attributes:{...i.attributes,bitset:{type:a.UNSIGNED_BYTE,count:1,pack:e=>0},color:{type:a.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>r(e)}}},u={createComputedParams:e=>e,attributes:{...i.attributes,bitset:{type:a.UNSIGNED_BYTE,count:1,pack:e=>s([[n,!0]])},color:{type:a.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>r(e)}}};class p extends o{constructor(){super(...arguments),this.vertexSpec=u}}class l extends t{constructor(e,t,r,s){super(e,t,r,s),this.vertexSpec=c,this._lineMeshWriter=this._createOutlineWriter(e,t,r,s)}_createOutlineWriter(e,t,r,s){return new p(e,t,r,s)}_write(t,r,s){const i=s?.asOptimized()??r.readGeometryForDisplay(),o=this._clip(i);o&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,r,o),this._lineMeshWriter.writeLineVertices(t,e.fromOptimizedCIM(o,"esriGeometryPolyline"),r),t.recordEnd())}ensurePacked(e,t,r){super.ensurePacked(e,t,r),this._lineMeshWriter.ensurePacked(e,t,r)}enqueueRequest(e,t,r){super.enqueueRequest(e,t,r),this._lineMeshWriter.enqueueRequest(e,t,r)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}export{l as OutlineFillMeshWriter,p as OutlineFillOutlineMeshWriter,c as outlineFillVertexSpec_Fill,u as outlineFillVertexSpec_Outline};
5
+ import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{clipMarshall as t}from"../../../mesh/templates/templateUtils.js";import{FillMeshWriter as r}from"./FillMeshWriter.js";import{processColorInput as s,packBitset as i}from"./meshWriterUtils.js";import{LineVertexSpec as o,LineMeshWriter as n}from"../line/LineMeshWriter.js";import{getLineClippingMargin as a}from"../mesh/utils.js";import{bitsetTypeFillOutline as u}from"../shaders/constants.js";import{DataType as c}from"../../../../../../webgl/enums.js";const l={createComputedParams:e=>e,attributes:{...o.attributes,bitset:{type:c.UNSIGNED_BYTE,count:1,pack:e=>0},color:{type:c.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>s(e)}}},m={createComputedParams:e=>e,attributes:{...o.attributes,bitset:{type:c.UNSIGNED_BYTE,count:1,pack:e=>i([[u,!0]])},color:{type:c.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>s(e)}}};class p extends n{constructor(){super(...arguments),this.vertexSpec=m}}class h extends r{constructor(e,t,r,s){super(e,t,r,s),this.vertexSpec=l,this._lineMeshWriter=this._createOutlineWriter(e,t,r,s)}_createOutlineWriter(e,t,r,s){return new p(e,t,r,s)}_write(t,r,s){const i=s?.asOptimized()??r.readGeometryForDisplay(),o=this._clip(i);o&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,r,o),this._lineMeshWriter.writeLineVertices(t,e.fromOptimizedCIM(o,"esriGeometryPolyline"),r),t.recordEnd())}_clip(e){return e?t(e,a(this.evaluatedMeshParams)):null}ensurePacked(e,t,r){super.ensurePacked(e,t,r),this._lineMeshWriter.ensurePacked(e,t,r)}enqueueRequest(e,t,r){super.enqueueRequest(e,t,r),this._lineMeshWriter.enqueueRequest(e,t,r)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}export{h as OutlineFillMeshWriter,p as OutlineFillOutlineMeshWriter,l as outlineFillVertexSpec_Fill,m as outlineFillVertexSpec_Outline};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
+ */
5
+ import e from"../../../../../../../core/Logger.js";import{disposeMaybe as r}from"../../../../../../../core/maybe.js";import{PixelType as t,TextureWrapMode as a,RenderbufferFormat as i}from"../../../../../../webgl/enums.js";import{FramebufferObject as s}from"../../../../../../webgl/FramebufferObject.js";import{loadHeatmapTextureConfiguration as u}from"../../../../../../webgl/heatmapTextureUtils.js";import{RenderbufferDescriptor as l}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as o}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as n}from"../../../../../../webgl/TextureDescriptor.js";const m=()=>e.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");class f{destroy(){this._accumulateFramebuffer=r(this._accumulateFramebuffer),this._resolveGradientTexture=r(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return null!=this._accumulateFramebuffer&&null!=this._resolveGradientTexture}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(null==this._qualityProfile){const r=u(e,m());this._qualityProfile={...r,defines:{usesHalfFloatPrecision:r.dataType!==t.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,r,t){if(null==this._accumulateFramebuffer){const{dataType:u,samplingMode:o,pixelFormat:m,internalFormat:f}=this.loadQualityProfile(e),h=new n(r,t);h.pixelFormat=m,h.internalFormat=f,h.dataType=u,h.samplingMode=o,h.wrapMode=a.CLAMP_TO_EDGE;const c=new l(i.DEPTH_STENCIL,r,t);this._accumulateFramebuffer=new s(e,h,c)}else{const{width:e,height:a}=this._accumulateFramebuffer;e===r&&a===t||this._accumulateFramebuffer.resize(r,t)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,r,t){if(null==this._resolveGradientTexture){const r=new n;r.wrapMode=a.CLAMP_TO_EDGE,this._resolveGradientTexture=new o(e,r)}else this._prevGradientHash!==r&&(this._resolveGradientTexture.resize(t.length/4,1),this._resolveGradientTexture.setData(t),this._prevGradientHash=r);return this._resolveGradientTexture}}export{f as HeatmapResources};