/*
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","./byteSizeEstimations","./nextTick","../chunks/mat3f64","../chunks/mat4f64","../chunks/quatf64","../chunks/vec2f64","../chunks/vec3f64","../chunks/vec4f64"],(function(e,t,i,r,s,n,f,u,c,h){"use strict";let a=function(){function e(e,t,i){this.itemByteSize=e,this.itemCreate=t,this._buffers=new Array,this._items=new Array,this._itemsPtr=0,this._itemsPerBuffer=Math.ceil(i/this.itemByteSize)}var i=e.prototype;return i.get=function(){0===this._itemsPtr&&r.nextTick((()=>this._reset()));const e=Math.floor(this._itemsPtr/this._itemsPerBuffer);for(;this._buffers.length<=e;){const e=new ArrayBuffer(this._itemsPerBuffer*this.itemByteSize);for(let t=0;t<this._itemsPerBuffer;++t)this._items.push(this.itemCreate(e,t*this.itemByteSize));this._buffers.push(e)}return this._items[this._itemsPtr++]},i._reset=function(){const e=2*(Math.floor(this._itemsPtr/this._itemsPerBuffer)+1);for(;this._buffers.length>e;)this._buffers.pop(),this._items.length=this._buffers.length*this._itemsPerBuffer;this._itemsPtr=0},e.createVec2f64=function(t=o){return new e(16,u.createView,t)},e.createVec3f64=function(t=o){return new e(24,c.createView,t)},e.createVec4f64=function(t=o){return new e(32,h.createView,t)},e.createMat3f64=function(t=o){return new e(72,s.createView,t)},e.createMat4f64=function(t=o){return new e(128,n.createView,t)},e.createQuatf64=function(t=o){return new e(32,f.createView,t)},t._createClass(e,[{key:"test",get:function(){return{size:this._buffers.length*this._itemsPerBuffer*this.itemByteSize}}}]),e}();const o=4*i.ByteSizeUnit.KILOBYTES;e.VectorStack=a,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
