@arcgis/core 5.1.0-next.98 → 5.1.0-next.99

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 (68) hide show
  1. package/WebLinkChart.d.ts +5 -1
  2. package/WebLinkChart.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{a68b5cb66c2c5e6b46e0.js → 0253292939b981134663.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{c514135bf7703ba69a47.js → 1d451ef24230d96c8341.js} +1 -1
  6. package/assets/esri/core/workers/chunks/24247ee93f43fff5e596.js +2 -0
  7. package/assets/esri/core/workers/chunks/{0e6b24e8864940ed9877.js → 2b2e5628d08d0e3108d2.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{7c2d2f22df057ba8cb50.js → 3ff0041bed0fa3d365f7.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{d93a4ccf8f0208dc6ad7.js → 6881ae969b48bd04f064.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{f31deeedb2508e81293b.js → 7a20941913d0115cfe26.js} +2 -2
  11. package/assets/esri/core/workers/chunks/7e57029ec958f6423d5d.js +2 -0
  12. package/assets/esri/core/workers/chunks/{4456bbb4b7dfe80c7477.js → 889a0405e3cdfa59b8e7.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{3241e0ed26aff61ec213.js → 8fedb32055ac7f771419.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{f68c12e0c1eda7f73a17.js → 90ea570f6b6ce8ca693b.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{40e887e87ae24ace27a5.js → 9478a0478fb49a88685e.js} +1 -1
  16. package/assets/esri/core/workers/chunks/9940b318f38ea9d7a533.js +1 -0
  17. package/assets/esri/core/workers/chunks/aca9591d3467a24f8329.js +1 -0
  18. package/assets/esri/core/workers/chunks/{ce4e09b623ebb640c46c.js → adf72d87f0114aeade0e.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{40afdb74517a7df59e0d.js → b8d10d8db44c7c6acebe.js} +1 -1
  20. package/assets/esri/core/workers/chunks/c0e4fd6fa1d765275248.js +2 -0
  21. package/assets/esri/core/workers/chunks/{308e1b0aea941958de44.js → d345030a89914348d3c5.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{a50fd0e66b01fe205033.js → da644117bdf601f528b9.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{509beae195c900a85e0b.js → df232b8aa77f7e3285e3.js} +1 -1
  24. package/assets/esri/core/workers/chunks/e7637d6a8ce0af46843c.js +2 -0
  25. package/assets/esri/core/workers/chunks/fff4b9e43464ebb3fb4e.js +1 -0
  26. package/config.js +1 -1
  27. package/kernel.js +1 -1
  28. package/layers/LinkChartLayer.js +1 -1
  29. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  30. package/linkChart/LayoutSettings.d.ts +7 -0
  31. package/linkChart/LayoutSettings.js +1 -1
  32. package/linkChart/RootedLayoutSettings.d.ts +18 -0
  33. package/linkChart/RootedLayoutSettings.js +2 -0
  34. package/package.json +3 -3
  35. package/renderers/support/ClassBreakInfo.d.ts +76 -2
  36. package/renderers/support/UniqueValueClass.d.ts +12 -0
  37. package/renderers/support/UniqueValueInfo.d.ts +68 -4
  38. package/support/revision.js +1 -1
  39. package/symbols/cim/CIMResourceManager.js +1 -1
  40. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  41. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  42. package/views/2d/engine/webgl/TextureManager.js +1 -1
  43. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  44. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  45. package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
  46. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  47. package/views/3d/layers/GaussianSplatLayerViewPerformanceInfo.js +1 -1
  48. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  49. package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
  50. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  51. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  52. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  53. package/widgets/Histogram/HistogramViewModel.d.ts +1 -0
  54. package/widgets/Histogram/HistogramViewModel.js +1 -1
  55. package/widgets/Histogram.js +1 -1
  56. package/widgets/Print/PrintViewModel.js +1 -1
  57. package/assets/esri/core/workers/chunks/246253fbbb2ecea48f91.js +0 -1
  58. package/assets/esri/core/workers/chunks/4df19e670b6ed76c1dea.js +0 -2
  59. package/assets/esri/core/workers/chunks/bf6c6bc15b0d2d82d1a4.js +0 -2
  60. package/assets/esri/core/workers/chunks/ce2ed9405ff1b704d35c.js +0 -1
  61. package/assets/esri/core/workers/chunks/d1ba118ddd0390c07f35.js +0 -2
  62. package/assets/esri/core/workers/chunks/d87e504082e293640ece.js +0 -2
  63. package/assets/esri/core/workers/chunks/d897412b99b9fba44bb4.js +0 -1
  64. /package/assets/esri/core/workers/chunks/{d87e504082e293640ece.js.LICENSE.txt → 24247ee93f43fff5e596.js.LICENSE.txt} +0 -0
  65. /package/assets/esri/core/workers/chunks/{f31deeedb2508e81293b.js.LICENSE.txt → 7a20941913d0115cfe26.js.LICENSE.txt} +0 -0
  66. /package/assets/esri/core/workers/chunks/{4df19e670b6ed76c1dea.js.LICENSE.txt → 7e57029ec958f6423d5d.js.LICENSE.txt} +0 -0
  67. /package/assets/esri/core/workers/chunks/{bf6c6bc15b0d2d82d1a4.js.LICENSE.txt → c0e4fd6fa1d765275248.js.LICENSE.txt} +0 -0
  68. /package/assets/esri/core/workers/chunks/{d1ba118ddd0390c07f35.js.LICENSE.txt → e7637d6a8ce0af46843c.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1728],{71728(e,t,i){i.r(t),i.d(t,{default:()=>P});var a=i(5482),n=i(79842),s=i(7762),o=i(51447),r=i(49186),l=i(53966),h=i(91869),d=i(25728),c=i(17676),p=i(36708),u=i(91429),y=i(35666),g=i(5443),m=i(86738),f=i(82799),M=i(12359),L=i(4146),w=i(90708),C=i(15375);const b={MULTIPLIER:"multiplier",ABSOLUTE:"absolute-value"};var k=i(24137),T=i(62796),v=i(40736),N=i(69860),E=i(30504),D=i(63074),x=i(34287),A=i(25036),I=i(10873),_=i(8460),S=i(53902),R=i(56400);let z=class extends((0,x.q)((0,D.dM)((0,A.j)((0,d.M)(L.A))))){constructor(e){if(super(e),this.url=null,this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(s.A.ofType(T.A)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new g.A({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(s.A.ofType(T.A)),this.type="link-chart",this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new r.A("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles((0,p.wB)(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),p.OH))}normalizeCtorArgs(e){if(!e)return{};const{url:t,dataPreloadedInLocalCache:i,initializationLinkChartConfig:a}=e;let{title:n}=e;return!n&&e?.url&&(n=(0,v.$L)(e.url)),{url:t,title:n,dataPreloadedInLocalCache:i,initializationLinkChartConfig:a}}_initializeLayerProperties(e){const t=new Set;let i=[],a=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new r.A("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,s)=>{const o=this._graphTypeLookup.get(s);if(!o)return l.A.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);"relationship"===o.type?t.has(s)||(t.add(s),a.push(o)):"entity"===o.type?t.has(s)||(t.add(s),i.push(o)):(l.A.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(s))}):(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]);const n=new k.P({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=i,this.memberRelationshipTypes=a,this.dataManager=n}load(e){const t=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await(0,v.qN)(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(e=>{e.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(i=>{t.push(i.refreshCachedQueryEngine()),e.push(new Promise(e=>{i.on("layerview-create",()=>{e(null)})}))}),this.tables.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t)};return this.addResolvingPromise(new Promise(i=>{(0,S.fetchKnowledgeGraph)(this.url).then(async a=>{a.dataModel.entityTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)}),a.dataModel.relationshipTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)});const s=this.linkChart?.linkChartProperties;6===s?.originIdOf("entitiesUrl")&&(this.membershipModified=!1,this._originalInclusionList=await n.XW.fetchAndConvertSerializedLinkChart({entitiesUrl:s?.entitiesUrl,relationshipsUrl:s?.relationshipsUrl},{signal:e?.signal}),this._alignLayersDataModelAndInclusionDefinition(a.dataModel),this.initializationLinkChartConfig={layoutSettings:s?.layoutSettings??void 0,layoutMode:(0,E.k5)(s.layoutType)}),this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}));const{edit:o,fullEdit:r,updateItem:l}=await(0,v.N1)(a.serviceDefinition.serviceItemId,this.url,e);if(this._set("userHasEditingPrivileges",o),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",l),this.read({dateFieldsTimeReference:a.serviceDefinition.dateFieldsTimeReference},{origin:"service"}),this.dataPreloadedInLocalCache){const e=N.A.getInstance();for(const[t,i]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const a of i.members?.values()??[]){const i=e.readFromStoreById(`${t}__${a.id}`);i&&(0,h.tE)(this.dataManager.sublayerCaches,t,()=>new Map).set(a.id,i)}await t()}else{const i="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,i,!0).then(async()=>{(0,c.Te)(e),await t()}))}i(null)})})),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):l.A.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}get sublayerCapabilities(){return(0,v.hZ)(this.knowledgeGraph)}async addRecords(e,t){let i=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(i=await(0,E.aq)(e,this.dataManager.knowledgeGraph));const a=e.concat(i).filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id));a.length>0&&(this.membershipModified=!0),await this._handleNewRecords(a,t)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new r.A("knowledge-graph:missing-type","The specified type does not exist in the knowledge graph.");if(this.dataManager.sublayerCaches.has(e))throw new r.A("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),(0,h.tE)(this.sublayerIdsCache,e,()=>new Set);const i=this._createSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.set(e,{useAllData:!1,members:new Map}),i.geometryType?this.layers.push(i):this.tables.push(i),await(0,v.qN)(this,[e]),this._refreshNamedTypes(),i}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:i=!1,overrideMembershipCheck:a=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const t of e)(a||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id))&&n.push(t);if(t){const e=new Set,t=[];for(const t of n)if(this.dataManager.nodeConnectionsLookup.has(t.id))for(const i of this.dataManager.nodeConnectionsLookup.get(t.id))e.add(i);for(const i of e)if(this.dataManager.memberIdTypeLookup.has(i))for(const e of this.dataManager.memberIdTypeLookup.get(i))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:i,typeName:e});n=n.concat(t)}this.dataManager.removeFromLayer(n);for(const e of n)this.sublayerIdsCache.get(e.typeName)?.delete(e.id),this.dataManager.relationshipTypeNames.has(e.typeName)?this.relationshipLinkChartDiagramLookup.delete(e.id):this.entityLinkChartDiagramLookup.delete(e.id);const s=i?void 0:this.getCurrentNodeLocations();await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedEntityLocations:s}),n.length>0&&(this.membershipModified=!0);const o=[];return this.layers.forEach(e=>{o.push(e.refreshCachedQueryEngine())}),await Promise.all(o),this._refreshNamedTypes(),n}async expand(e,t){let i=[];try{const a=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);i=a.filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)),await this._handleNewRecords(i,t),a.length>0&&(this.membershipModified=!0),(0,c.Te)(t?.signal)}catch(e){throw(0,c.zf)(e)&&i.length>0&&await this.removeRecords(i,{overrideMembershipCheck:!0}),e}return{records:i}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new s.A,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new s.A,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const i=(0,h.tE)(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(({id:e,linkChartLocation:a})=>{if(i.add(e),a){const i="coords"in a&&"lengths"in a?a:(0,w.Ux)(a);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,i):this.entityLinkChartDiagramLookup.set(e,i)}})})}async calculateLinkChartLayout(e="organic-standard",t){const i=[],a=[],n=[];this.dataManager.sublayerCaches.forEach((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach(e=>{i.push({typeName:t,feature:e})}):this.dataManager.relationshipTypeNames.has(t)&&e.forEach(e=>{a.push({typeName:t,feature:e})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const s=new Map,o=new Map,d=new Map,p=new Map,u=new Uint8Array(i.length),y=new Float64Array(i.length),L=new Float64Array(i.length),b=new Float64Array(i.length),k=new Float64Array(i.length),T=new Uint32Array(a.length),v=new Uint32Array(a.length),N=new Float64Array(a.length),E=new Float64Array(a.length),D=[];let x=!1;const A=new g.A({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let I,S="organic-standard",R=0,z=0;const P=_.i6.apply;switch(S="geographic-organic-standard"===e?"organic-standard":e,S){case"organic-standard":I=_.pM.apply;break;case"organic-community":I=_.Tu.apply;break;case"hierarchical-bottom-to-top":I=_.$C.apply;break;case"radial-root-centric":I=_.vJ.apply;break;case"tree-left-to-right":I=_.Xq.apply;break;default:I=_.Wg.apply}let F=!1;i.forEach(({typeName:i,feature:a})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedEntityLocations?.has(a.attributes[C.dr])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(i)?u[R]=2:u[R]=0;const n=t.lockedEntityLocations.get(a.attributes[C.dr]);y[R]=n.x,L[R]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(i)){u[R]=2;let e=null;const t=a.attributes[this.dataManager.geographicLookup.get(i).name],n=this.dataManager.geographicLookup.get(i)?.geometryType;switch(n){case"esriGeometryPoint":y[R]=t?.x,L[R]=t?.y;break;case"esriGeometryPolygon":{const i=t?(0,M.Ve)(t):null;e=i?m.A.fromJSON(i):null,null!=e?.x&&null!=e?.y?(y[R]=e.x,L[R]=e.y):u[R]=1;break}case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(y[R]=e.x,L[R]=e.y):u[R]=1;break;default:u[R]=1}(null==y[R]||null==L[R]||Number.isNaN(y[R])||Number.isNaN(L[R]))&&(u[R]=1,y[R]=0,L[R]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!F&&t?.lockedEntityLocations?.has(a.attributes[C.dr])&&(F=!0);const e=t?.timeInfoByTypeName?.get(i),n=e?.startField,s=n&&e?.startField?a.attributes[n]:null;b[R]=s?new Date(s).getTime():NaN;const o=e?.endField,r=o&&e?.endField?a.attributes[o]:null;k[R]=r?new Date(r).getTime():NaN,y[R]=0,L[R]=0,u[R]=1}else u[R]=1,y[R]=0,L[R]=0;t?.rootEntityIds?.has(a.attributes[C.dr])&&(u[R]|=4),p.set(a.attributes[C.dr],R),D[R]={feature:a,typeName:i},R++}),F&&l.A.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let O=!1;const Z=new Map;a.forEach(i=>{const a=i.feature.attributes[C.Cz],s=i.feature.attributes[C.KQ],o=p.get(a),r=p.get(s),l=t?.timeInfoByTypeName?.get(i.typeName),h=t?.timeInfoByTypeName?l?.startField:null,d=h?i.feature.attributes[h]:null,c=l?.endField,u=c?i.feature.attributes[c]:null;if(void 0!==o&&void 0!==r){let t=a+"-"+s;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+u);const l=Z.get(t),h=l?.has(i.typeName);h||(T[z]=o,v[z]=r,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(N[z]=d?new Date(d).getTime():NaN,E[z]=u?new Date(u).getTime():NaN),void 0===l?Z.set(t,new Map([[i.typeName,z]])):l.set(i.typeName,z),z++),n.push(i)}else O=!0,this.relationshipLinkChartDiagramLookup.set(a,null)}),O&&l.A.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const G=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),U=this._convertValidatedOrganicSettingsToCalculationSettings(G);await(0,_.Hh)();let B=1,H=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let i;({status:B,links:H,graphics:i}=P(()=>t?.signal?.aborted??!1,u,y,L,b,k,T.subarray(0,z),v.subarray(0,z),N.subarray(0,z),E.subarray(0,z),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),0===B&&(this.chronologicalAuxiliaryGraphics=i)}else({status:B,links:H}=I(()=>t?.signal?.aborted??!1,u,y,L,T.subarray(0,z),v.subarray(0,z),U.computationBudgetTime,U.idealEdgeLengthMultiplier,U.repulsionRadiusMultiplier));if((0,c.Te)(t?.signal),1===B)throw new r.A("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(2===B)throw(0,c.NK)();for(let e=0;e<D.length;e++){if(L[e]>84.9999?L[e]=84.9999:L[e]<-84.9999&&(L[e]=-84.9999),y[e]>179.9999?y[e]=179.9999:y[e]<-179.9999&&(y[e]=-179.9999),D[e].feature.attributes[C.T1]=new m.A(y[e],L[e]),s.has(D[e].typeName)){const t=s.get(D[e].typeName);t?.set(D[e].feature.attributes[C.dr],D[e].feature)}else{const t=new Map;t.set(D[e].feature.attributes[C.dr],D[e].feature),s.set(D[e].typeName,t)}d.set(D[e].feature.attributes[C.dr],D[e].feature);const t=(0,w.Ux)(D[e].feature.attributes[C.T1]);this.entityLinkChartDiagramLookup.set(D[e].feature.attributes[C.dr],D[e].feature.attributes[C.T1]?t:null);const i=(0,h.tE)(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,D[e].typeName,()=>({useAllData:!1,members:new Map}));(0,h.tE)(i.members,D[e].feature.attributes[C.dr],()=>({id:D[e].feature.attributes[C.dr],linkChartLocation:void 0})).linkChartLocation=D[e].feature.attributes[C.T1];const{x:a,y:n}=D[e].feature.attributes[C.T1];if(x)A.xmin=Math.min(A.xmin,a),A.xmax=Math.max(A.xmax,a),A.ymin=Math.min(A.ymin,n),A.ymax=Math.max(A.ymax,n);else{const e=1e-7;A.xmin=a-e,A.xmax=a+e,A.ymin=n-e,A.ymax=n+e,x=!0}}if(this.linkChartExtent.xmin=A.xmin,this.linkChartExtent.xmax=A.xmax,this.linkChartExtent.ymin=A.ymin,this.linkChartExtent.ymax=A.ymax,!H)throw new r.A("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const j=new Map,Q=new Map,$=new Map,q=new Set;for(let i=0;i<n.length;i++){const a=[],s=n[i],r=s.feature.attributes[C.Cz],c=s.feature.attributes[C.KQ];let u=r+"-"+c;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(s.typeName),i=t?.timeInfoByTypeName?e?.startField:null,a=i?s.feature.attributes[i]:null,n=e?.endField;u+="-"+a+"-"+(n?s.feature.attributes[n]:null)}const y=Z.get(u).get(s.typeName),g=0===y?0:H?.vertexEndIndex[y-1];if(!q.has(y)){if(q.add(y),2===H.types[y]){const e=[H.vertices[2*g],H.vertices[2*g+1]],t=[H.vertices[2*(g+1)],H.vertices[2*(g+1)+1]],i=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[i[0]-e[0],i[1]-e[1]],s=[i[0]+n[1],i[1]-n[0]],o=[i[0]-n[1],i[1]+n[0]];a.push(e),a.push(s),a.push(t),a.push(o),a.push(e)}else{if(0!==H.types[y]){l.A.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=g;e<H.vertexEndIndex[y];e++)a.push([H.vertices[2*e],H.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=D[p.get(r)]?.feature.attributes[C.T1],t=D[p.get(c)]?.feature.attributes[C.T1];a[0][0]===e.x&&a[0][1]===e.y||(a[0]=[e.x,e.y]),a[a.length-1][0]===t.x&&a[a.length-1][1]===t.y||(a[a.length-1]=[t.x,t.y])}for(let e=1;e<a.length-1;e++)a[e][1]>85.5?a[e][1]=85.5:a[e][1]<-85.5&&(a[e][1]=-85.5),a[e][0]>179.9999?a[e][0]=179.9999:a[e][0]<-179.9999&&(a[e][0]=-179.9999);j.has(u)?j.get(u).push(a):j.set(u,[a])}const m=j.get(u);Q.has(u)||(Q.set(u,new Map),$.set(u,new Map));const M=Q.get(u),L=$.get(u);M.has(s.typeName)||(M.set(s.typeName,m.shift()),L.set(s.typeName,0));const b=M.get(s.typeName);L.set(s.typeName,L.get(s.typeName)+1);const k=new f.A({paths:[b]});if(s.feature.attributes[C.T1]=k,o.has(s.typeName)){const e=o.get(s.typeName);e?.set(s.feature.attributes[C.dr],s.feature)}else{const e=new Map;e.set(s.feature.attributes[C.dr],s.feature),o.set(s.typeName,e)}d.set(s.feature.attributes[C.dr],s.feature);const T=(0,w.Ux)(s.feature.attributes[C.T1]);this.relationshipLinkChartDiagramLookup.set(s.feature.attributes[C.dr],s.feature.attributes[C.T1]?T:null);const v=(0,h.tE)(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,s.typeName,()=>({useAllData:!1,members:new Map}));(0,h.tE)(v.members,s.feature.attributes[C.dr],()=>({id:s.feature.attributes[C.dr],linkChartLocation:void 0})).linkChartLocation=T}for(const e of n)e.feature.attributes[C.M1]=$.get(e.feature.attributes[C.Cz]+"-"+e.feature.attributes[C.KQ])?.get(e.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:s,links:o,idMap:d}}async applyNewLinkChartLayout(e="organic-standard",t){let{lockedNodeLocations:i,lockedEntityLocations:a,...n}=t??{};!a&&i?((0,o.io)(l.A.getLogger(this),"lockedNodeLocations is deprecated in 5.0. Use lockedEntityLocations instead.",{replacement:"Use lockedEntityLocations instead.",version:"5.0"}),a=i):a&&i&&(0,o.io)(l.A.getLogger(this),"Both lockedNodeLocations (deprecated in 5.0) and lockedEntityLocations are defined. Use lockedEntityLocations only instead.",{replacement:"Use lockedEntityLocations instead.",version:"5.0"});const s=[];await this._calculateLayoutWithSublayerTimeInfo(e,{...n,lockedEntityLocations:a}),this.layers.forEach(e=>{s.push(e.refreshCachedQueryEngine())}),this.membershipModified=!0,await Promise.all(s),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,i]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||i?.members?.forEach(t=>{const i=t.linkChartLocation;let a;const n=t.id;i&&(a="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]},e.set(n,new m.A({x:a.x,y:a.y})))});return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let i=[];try{let a=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(a=a.concat(Array.from(t.keys())))}i=await this.dataManager.getRelationshipsBetweenNodes(e,a,t),await this._handleNewRecords(i,t),(0,c.Te)(t)}catch(e){throw(0,c.zf)(e)&&this.removeRecords(i),e}return{records:i}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let i=[];try{let a=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(a=a.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}i=await this.dataManager.getRelationshipsFromNodes(e,n,a,t),await this._handleNewRecords(i,t),i.length>0&&(this.membershipModified=!0),(0,c.Te)(t)}catch(e){throw(0,c.zf)(e)&&this.removeRecords(i),e}return{records:i}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const i=new Map;this.layers.forEach(e=>{i.set(e.objectType.name,e.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:i,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const i=new Set,a=[],n=this.layers.concat(this.tables);for(const t of e)this._graphTypeLookup.has(t.typeName)&&(!1===n.some(e=>e.objectType.name===t.typeName)&&(this.dataManager.sublayerCaches.set(t.typeName,new Map),i.add(t.typeName)),(0,h.tE)(this.sublayerIdsCache,t.typeName,()=>new Set).add(t.id),a.push(t));this.dataManager.addToLayer(a);for(const e of i){const t=this._graphTypeLookup.get(e);if(t){const i=this._createSublayer(t);"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),i.geometryType?this.layers.push(i):this.tables.push(i)}}await(0,v.qN)(this,Array.from(i),t),await this.dataManager.refreshCacheContent(e.map(e=>e.id),void 0,void 0,void 0,t);const s={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedEntityLocations:new Map};for(const[e,t]of this.entityLinkChartDiagramLookup.entries())t&&s.lockedEntityLocations.set(e,new m.A(t.coords[0],t.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,s)}_createSublayers(e,t,i){e.forEach(e=>{const a=this._createSublayer(e);i(a)&&t.push(a),this._updateSublayerCaches(e)})}_updateSublayers(e,t){t.forEach(t=>{t.parentCompositeLayer=this;const i=e.find(e=>e.type===t.graphType&&e.name===t.graphTypeName);i&&(t.objectType=i,t.read({title:i.name},{origin:"service"}),this._updateSublayerCaches(i))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(e=>{const i=e.linkChartLocation;let a;const n=e.id;if(!i)return;a="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]};const s=(0,w.Ux)(a);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,s):this.entityLinkChartDiagramLookup.set(n,s),this.linkChartExtent.xmin>a.x&&(this.linkChartExtent.xmin=a.x),this.linkChartExtent.xmax<a.x&&(this.linkChartExtent.xmax=a.x),this.linkChartExtent.ymin>a.y&&(this.linkChartExtent.ymin=a.y),this.linkChartExtent.ymax<a.y&&(this.linkChartExtent.ymax=a.y)})}),this.memberRelationshipTypes.forEach(e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[C.Cz]),i=this.relationshipLinkChartDiagramLookup.get(e.attributes[C.KQ]);if(t&&i){const a=(0,w.Ux)(new f.A({paths:[[[t.coords[0],t.coords[1]],[i.coords[0],i.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[C.dr],a)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[C.dr],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedEntityLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedEntityLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const i=e=>"number"==typeof e&&!isNaN(e),a=e=>i(e)&&e>=0,n={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return n;const{computationBudgetTime:s,autoRepulsionRadius:o,repulsionRadiusMultiplier:r,absoluteIdealEdgeLength:h,multiplicativeIdealEdgeLength:d,idealEdgeLengthType:c}=t;return(e=>i(e)&&e>=1)(s)?n.computationBudgetTime=s:s&&l.A.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),n.autoRepulsionRadius=o,!o&&(e=>i(e)&&e>=1)(r)?n.repulsionRadiusMultiplier=r:o||(n.autoRepulsionRadius=!0,l.A.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&((e=>Object.values(b).includes(e))(c)?n.idealEdgeLengthType=c:void 0!==c&&l.A.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===c&&a(h)?n.absoluteIdealEdgeLength=h:"absolute-value"===c&&void 0!==h?l.A.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===c&&a(d)?n.multiplicativeIdealEdgeLength=d:"multiplier"===c&&void 0!==d&&l.A.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),n}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===b.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===b.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new T.A({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map(e=>e.name).concat((e.relationshipTypes??[]).map(e=>e.name))),i=new Set((e.entityTypes??[]).map(e=>e.name)),a=new Set((e.relationshipTypes??[]).map(e=>e.name));if(this.layers){for(const e of this.layers)!e.graphType&&t.has(e.graphTypeName)&&(e.graphType=i.has(e.graphTypeName)?"entity":"relationship");const e=this.layers.filter(e=>t.has(e.graphTypeName)&&("entity"===e.graphType?i.has(e.graphTypeName):a.has(e.graphTypeName)));this.setAtOrigin("layers",e,(0,y.OL)(this.originIdOf("layers")))}else this.layers=new s.A;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map(e=>e.graphTypeName)??[],i=this.layers.map(e=>e.graphTypeName).concat(t);for(const t of i)e.has(t)||this._originalInclusionList.namedTypeDefinitions.set(t,{useAllData:!1,members:new Map});const a=[];for(const e of this._originalInclusionList.namedTypeDefinitions.keys())i.includes(e)||(l.A.getLogger(this).warn(`A named type, ${e}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),a.push(e));for(const e of a)this._originalInclusionList.namedTypeDefinitions.delete(e)}}};(0,a.Cg)([(0,u.MZ)(I.OZ)],z.prototype,"url",void 0),(0,a.Cg)([(0,u.MZ)()],z.prototype,"dataPreloadedInLocalCache",void 0),(0,a.Cg)([(0,u.MZ)()],z.prototype,"initializationLinkChartConfig",void 0),(0,a.Cg)([(0,u.MZ)()],z.prototype,"membershipModified",void 0),(0,a.Cg)([(0,u.MZ)()],z.prototype,"dataManager",void 0),(0,a.Cg)([(0,u.MZ)()],z.prototype,"initializationInclusionModeDefinition",null),(0,a.Cg)([(0,u.MZ)()],z.prototype,"knowledgeGraph",void 0),(0,a.Cg)([(0,u.MZ)({type:s.A.ofType(T.A),json:{write:{ignoreOrigin:!0}}})],z.prototype,"layers",void 0),(0,a.Cg)([(0,u.MZ)({readOnly:!0})],z.prototype,"linkChart",null),(0,a.Cg)([(0,u.MZ)()],z.prototype,"entityLinkChartDiagramLookup",void 0),(0,a.Cg)([(0,u.MZ)()],z.prototype,"relationshipLinkChartDiagramLookup",void 0),(0,a.Cg)([(0,u.MZ)()],z.prototype,"linkChartExtent",void 0),(0,a.Cg)([(0,u.MZ)()],z.prototype,"memberEntityTypes",void 0),(0,a.Cg)([(0,u.MZ)()],z.prototype,"memberRelationshipTypes",void 0),(0,a.Cg)([(0,u.MZ)({type:["LinkChartLayer"]})],z.prototype,"operationalLayerType",void 0),(0,a.Cg)([(0,u.MZ)()],z.prototype,"sublayerCapabilities",null),(0,a.Cg)([(0,u.MZ)()],z.prototype,"sublayerIdsCache",void 0),(0,a.Cg)([(0,u.MZ)({type:s.A.ofType(T.A),json:{write:{ignoreOrigin:!0}}})],z.prototype,"tables",void 0),(0,a.Cg)([(0,u.MZ)({json:{read:!1}})],z.prototype,"type",void 0),(0,a.Cg)([(0,u.MZ)({readOnly:!0})],z.prototype,"userHasEditingPrivileges",void 0),(0,a.Cg)([(0,u.MZ)({readOnly:!0})],z.prototype,"userHasFullEditingPrivileges",void 0),(0,a.Cg)([(0,u.MZ)({readOnly:!0})],z.prototype,"userHasUpdateItemPrivileges",void 0),(0,a.Cg)([(0,u.MZ)({json:{read:!1}})],z.prototype,"chronologicalAuxiliaryGraphics",void 0),(0,a.Cg)([(0,u.MZ)((0,R.P6)("dateFieldsTimeReference"))],z.prototype,"dateFieldsTimeZone",void 0),z=(0,a.Cg)([(0,u.$K)("esri.layers.LinkChartLayer")],z);const P=z}}]);