/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
var t;const s=Symbol();class o{static{t=s}constructor(s){this._operations=[],this._closed=!1,this[t]=!0,s&&(this._operations=s,this._closed=!0)}close(){this._closed=!0}apply(){for(const t of this._operations)t.apply()}undo(){for(let t=this._operations.length-1;t>=0;t--)this._operations[t].undo()}accumulate(t){if(this._closed)return!1;const s=this._operations.length?this._operations[this._operations.length-1]:null;return s&&s.accumulate(t)||(this._operations.push(t),t.apply()),!0}}export{o as UndoGroup};
