/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../core/handleUtils","../../../../core/maybe","../../webgl-engine/lib/basicInterfaces","../../webgl-engine/lib/Object3DStateID"],(function(e,t,i,n,o,h){"use strict";let s=function(){function e(e){this._context=e,this._highlights=new Set}var n=e.prototype;return n.destroy=function(){this._highlights=null},n.add=function(e){const t=new d(e);return this._highlights.add(t),this._enableSet(t),i.makeHandle((()=>this._removeSet(t)))},n._removeSet=function(e){this._disableSet(e),this._highlights.delete(e)},n._enableSet=function(e){e.enabled||(e.enabled=!0,this._context.forEachNode((t=>this._enableSetForNode(e,t))))},n._enableSetForNode=function(e,t){if(!e.enabled)return;const i=e.ids.get(t.id);i&&i.forEach((i=>this._context.addHighlight(t,i,e.id)))},n._disableSet=function(e){e.enabled&&(e.enabled=!1,this._context.forEachNode((t=>this._disableSetForNode(e,t))))},n._disableSetForNode=function(e,t){e.enabled||this._context.removeHighlight(t,e.id)},n.nodeAdded=function(e){this._highlights.forEach((t=>this._enableSetForNode(t,e)))},n.nodeRemoved=function(e){this._highlights.forEach((t=>this._disableSetForNode(t,e)))},n.removeAll=function(){this._highlights.forEach((e=>this._disableSet(e)))},t._createClass(e,[{key:"hasHighlights",get:function(){return this._highlights.size>0}}]),e}(),d=function(){function e(e){this.id=new h.Object3DStateID(o.Object3DState.Highlight),this.ids=new Map,this.enabled=!1;for(const t of e)n.isSome(t)&&this._add(t.nodeId,t.pointId)}return e.prototype._add=function(e,t){const i=this.ids.get(e);i?i.add(t):this.ids.set(e,new Set([t]))},e}();e.PointHighlights=s,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
