/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
const n={remove:()=>{}};function e(e){return e?{remove(){e&&(e(),e=void 0)}}:n}function o(n){n.forEach(n=>n?.remove())}function r(n){o(n),n.length=0}function t(n){return e(()=>o(n))}function u(n){return e(()=>n()?.remove())}function i(n){return e(()=>n?.abort())}function c(n){return e(null!=n?()=>n.destroy():void 0)}function f(n){return"object"==typeof n&&!!n&&"remove"in n&&"function"==typeof n.remove}function l(n){f(n)&&n.remove()}function v(n,o){let r=!1,t=null;return n.then(n=>{r?n.remove():t=n}),e(()=>{r=!0,null!=t?t.remove():null!=o&&(o.abort(),o=null)})}function m(n){return{[Symbol.dispose](){n.remove()}}}export{i as abortHandle,v as asyncHandle,c as destroyHandle,m as disposable,r as drainHandles,t as handlesGroup,f as isHandle,e as makeHandle,u as refHandle,o as removeHandles,l as removeIfHandle};
