/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
class t{constructor(t){this.capacity=t,this._head=0,this._tail=0,this._data=new Array(t)}push(t){const i=this._tail;if(!(i<this.capacity))throw new Error("Queue full");this._data[i]=t,this._tail=i+1}pushAll(t){const i=t.length;if(0===i)return;const a=this._tail;if(!(a+i<=this.capacity))throw new Error("Queue full");for(let h=0;h<i;++h)this._data[a+h]=t[h];this._tail=a+i}pop(){const t=this._head;if(t<this._tail){const i=this._data[t];return this._head=t+1,i}}get empty(){return this._head>=this._tail}get full(){return this._tail>=this._data.length}}export{t as Queue};
