@loaders.gl/obj 3.0.9 → 3.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.es5.min.js +1 -1
- package/dist/dist.es5.min.js.map +1 -1
- package/dist/dist.min.js +1 -1
- package/dist/dist.min.js.map +1 -1
- package/dist/es5/bundle.js +2 -2
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/index.js +5 -37
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/load-obj.js +42 -59
- package/dist/es5/lib/load-obj.js.map +1 -1
- package/dist/es5/lib/parse-obj.js +293 -388
- package/dist/es5/lib/parse-obj.js.map +1 -1
- package/dist/es5/lib/schema-attribute-utils.js +11 -12
- package/dist/es5/lib/schema-attribute-utils.js.map +1 -1
- package/dist/es5/obj-loader.js +3 -3
- package/dist/es5/obj-loader.js.map +1 -1
- package/dist/esm/lib/parse-obj.js +1 -1
- package/dist/esm/lib/parse-obj.js.map +1 -1
- package/dist/esm/obj-loader.js +1 -1
- package/dist/esm/obj-loader.js.map +1 -1
- package/dist/obj-worker.js +1 -1
- package/dist/obj-worker.js.map +1 -1
- package/package.json +4 -4
package/dist/dist.es5.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Schema",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"Field",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"Type",{enumerable:!0,get:function(){return o.Type}}),Object.defineProperty(t,"DataType",{enumerable:!0,get:function(){return o.DataType}}),Object.defineProperty(t,"Null",{enumerable:!0,get:function(){return o.Null}}),Object.defineProperty(t,"Bool",{enumerable:!0,get:function(){return o.Bool}}),Object.defineProperty(t,"Int",{enumerable:!0,get:function(){return o.Int}}),Object.defineProperty(t,"Int8",{enumerable:!0,get:function(){return o.Int8}}),Object.defineProperty(t,"Int16",{enumerable:!0,get:function(){return o.Int16}}),Object.defineProperty(t,"Int32",{enumerable:!0,get:function(){return o.Int32}}),Object.defineProperty(t,"Int64",{enumerable:!0,get:function(){return o.Int64}}),Object.defineProperty(t,"Uint8",{enumerable:!0,get:function(){return o.Uint8}}),Object.defineProperty(t,"Uint16",{enumerable:!0,get:function(){return o.Uint16}}),Object.defineProperty(t,"Uint32",{enumerable:!0,get:function(){return o.Uint32}}),Object.defineProperty(t,"Uint64",{enumerable:!0,get:function(){return o.Uint64}}),Object.defineProperty(t,"Float",{enumerable:!0,get:function(){return o.Float}}),Object.defineProperty(t,"Float16",{enumerable:!0,get:function(){return o.Float16}}),Object.defineProperty(t,"Float32",{enumerable:!0,get:function(){return o.Float32}}),Object.defineProperty(t,"Float64",{enumerable:!0,get:function(){return o.Float64}}),Object.defineProperty(t,"Binary",{enumerable:!0,get:function(){return o.Binary}}),Object.defineProperty(t,"Utf8",{enumerable:!0,get:function(){return o.Utf8}}),Object.defineProperty(t,"Date",{enumerable:!0,get:function(){return o.Date}}),Object.defineProperty(t,"DateDay",{enumerable:!0,get:function(){return o.DateDay}}),Object.defineProperty(t,"DateMillisecond",{enumerable:!0,get:function(){return o.DateMillisecond}}),Object.defineProperty(t,"Time",{enumerable:!0,get:function(){return o.Time}}),Object.defineProperty(t,"TimeSecond",{enumerable:!0,get:function(){return o.TimeSecond}}),Object.defineProperty(t,"TimeMillisecond",{enumerable:!0,get:function(){return o.TimeMillisecond}}),Object.defineProperty(t,"Timestamp",{enumerable:!0,get:function(){return o.Timestamp}}),Object.defineProperty(t,"TimestampSecond",{enumerable:!0,get:function(){return o.TimestampSecond}}),Object.defineProperty(t,"TimestampMillisecond",{enumerable:!0,get:function(){return o.TimestampMillisecond}}),Object.defineProperty(t,"TimestampMicrosecond",{enumerable:!0,get:function(){return o.TimestampMicrosecond}}),Object.defineProperty(t,"TimestampNanosecond",{enumerable:!0,get:function(){return o.TimestampNanosecond}}),Object.defineProperty(t,"Interval",{enumerable:!0,get:function(){return o.Interval}}),Object.defineProperty(t,"IntervalDayTime",{enumerable:!0,get:function(){return o.IntervalDayTime}}),Object.defineProperty(t,"IntervalYearMonth",{enumerable:!0,get:function(){return o.IntervalYearMonth}}),Object.defineProperty(t,"FixedSizeList",{enumerable:!0,get:function(){return o.FixedSizeList}});var r=a(n(12)),i=a(n(14)),o=n(15);function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"TableBatchBuilder",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"RowTableBatchAggregator",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"ColumnarTableBatchAggregator",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"convertToObjectRow",{enumerable:!0,get:function(){return a.convertToObjectRow}}),Object.defineProperty(t,"convertToArrayRow",{enumerable:!0,get:function(){return a.convertToArrayRow}}),Object.defineProperty(t,"getMeshSize",{enumerable:!0,get:function(){return u.getMeshSize}}),Object.defineProperty(t,"getMeshBoundingBox",{enumerable:!0,get:function(){return u.getMeshBoundingBox}}),Object.defineProperty(t,"Schema",{enumerable:!0,get:function(){return s.Schema}}),Object.defineProperty(t,"Field",{enumerable:!0,get:function(){return s.Field}}),Object.defineProperty(t,"DataType",{enumerable:!0,get:function(){return s.DataType}}),Object.defineProperty(t,"Null",{enumerable:!0,get:function(){return s.Null}}),Object.defineProperty(t,"Binary",{enumerable:!0,get:function(){return s.Binary}}),Object.defineProperty(t,"Bool",{enumerable:!0,get:function(){return s.Bool}}),Object.defineProperty(t,"Int",{enumerable:!0,get:function(){return s.Int}}),Object.defineProperty(t,"Int8",{enumerable:!0,get:function(){return s.Int8}}),Object.defineProperty(t,"Int16",{enumerable:!0,get:function(){return s.Int16}}),Object.defineProperty(t,"Int32",{enumerable:!0,get:function(){return s.Int32}}),Object.defineProperty(t,"Int64",{enumerable:!0,get:function(){return s.Int64}}),Object.defineProperty(t,"Uint8",{enumerable:!0,get:function(){return s.Uint8}}),Object.defineProperty(t,"Uint16",{enumerable:!0,get:function(){return s.Uint16}}),Object.defineProperty(t,"Uint32",{enumerable:!0,get:function(){return s.Uint32}}),Object.defineProperty(t,"Uint64",{enumerable:!0,get:function(){return s.Uint64}}),Object.defineProperty(t,"Float",{enumerable:!0,get:function(){return s.Float}}),Object.defineProperty(t,"Float16",{enumerable:!0,get:function(){return s.Float16}}),Object.defineProperty(t,"Float32",{enumerable:!0,get:function(){return s.Float32}}),Object.defineProperty(t,"Float64",{enumerable:!0,get:function(){return s.Float64}}),Object.defineProperty(t,"Utf8",{enumerable:!0,get:function(){return s.Utf8}}),Object.defineProperty(t,"Date",{enumerable:!0,get:function(){return s.Date}}),Object.defineProperty(t,"DateDay",{enumerable:!0,get:function(){return s.DateDay}}),Object.defineProperty(t,"DateMillisecond",{enumerable:!0,get:function(){return s.DateMillisecond}}),Object.defineProperty(t,"Time",{enumerable:!0,get:function(){return s.Time}}),Object.defineProperty(t,"TimeMillisecond",{enumerable:!0,get:function(){return s.TimeMillisecond}}),Object.defineProperty(t,"TimeSecond",{enumerable:!0,get:function(){return s.TimeSecond}}),Object.defineProperty(t,"Timestamp",{enumerable:!0,get:function(){return s.Timestamp}}),Object.defineProperty(t,"TimestampSecond",{enumerable:!0,get:function(){return s.TimestampSecond}}),Object.defineProperty(t,"TimestampMillisecond",{enumerable:!0,get:function(){return s.TimestampMillisecond}}),Object.defineProperty(t,"TimestampMicrosecond",{enumerable:!0,get:function(){return s.TimestampMicrosecond}}),Object.defineProperty(t,"TimestampNanosecond",{enumerable:!0,get:function(){return s.TimestampNanosecond}}),Object.defineProperty(t,"Interval",{enumerable:!0,get:function(){return s.Interval}}),Object.defineProperty(t,"IntervalDayTime",{enumerable:!0,get:function(){return s.IntervalDayTime}}),Object.defineProperty(t,"IntervalYearMonth",{enumerable:!0,get:function(){return s.IntervalYearMonth}}),Object.defineProperty(t,"FixedSizeList",{enumerable:!0,get:function(){return s.FixedSizeList}}),Object.defineProperty(t,"deduceTableSchema",{enumerable:!0,get:function(){return l.deduceTableSchema}}),Object.defineProperty(t,"getTypeInfo",{enumerable:!0,get:function(){return c.getTypeInfo}}),Object.defineProperty(t,"getArrowTypeFromTypedArray",{enumerable:!0,get:function(){return f.getArrowTypeFromTypedArray}}),Object.defineProperty(t,"AsyncQueue",{enumerable:!0,get:function(){return h.default}});var r=y(n(9)),i=y(n(2)),o=y(n(4)),a=n(3),u=n(11),s=n(0),l=n(17),c=n(18),f=n(19),h=y(n(20));function y(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(3);function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,"schema",void 0),o(this,"options",void 0),o(this,"length",0),o(this,"objectRows",null),o(this,"arrayRows",null),o(this,"cursor",0),o(this,"_headers",[]),this.options=n,this.schema=t,!Array.isArray(t))for(var r in this._headers=[],t)this._headers[t[r].index]=t[r].name}var t,n,a;return t=e,(n=[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(e,t){switch(Number.isFinite(t)&&(this.cursor=t),this.options.shape){case"object-row-table":var n=(0,r.convertToObjectRow)(e,this._headers);this.addObjectRow(n,t);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(100),this.arrayRows[this.length]=e,this.length++}}},{key:"addObjectRow",value:function(e,t){switch(Number.isFinite(t)&&(this.cursor=t),this.options.shape){case"array-row-table":var n=(0,r.convertToArrayRow)(e,this._headers);this.addArrayRow(n,t);break;case"object-row-table":this.objectRows=this.objectRows||new Array(100),this.objectRows[this.length]=e,this.length++}}},{key:"getBatch",value:function(){var e=this.arrayRows||this.objectRows;return e?(e=e.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}])&&i(t.prototype,n),a&&i(t,a),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertToObjectRow=function(e,t){if(!e)throw new Error("null row");if(!t)throw new Error("no headers");for(var n={},r=0;r<t.length;r++)n[t[r]]=e[r];return n},t.convertToArrayRow=function(e,t){if(!e)throw new Error("null row");if(!t)throw new Error("no headers");for(var n=new Array(t.length),r=0;r<t.length;r++)n[r]=e[t[r]];return n}},function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){u=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,"schema",void 0),a(this,"length",0),a(this,"allocated",0),a(this,"columns",{}),this.schema=t,this._reallocateColumns()}var t,n,i;return t=e,(n=[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(e){this._reallocateColumns();var t=0;for(var n in this.columns)this.columns[n][this.length]=e[t++];this.length++}},{key:"addObjectRow",value:function(e){for(var t in this._reallocateColumns(),e)this.columns[t][this.length]=e[t];this.length++}},{key:"getBatch",value:function(){this._pruneColumns();var e=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(var t in this.schema){var n=this.schema[t];e[n.name]=this.columns[n.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:e,schema:this.schema,length:this.length}}},{key:"_reallocateColumns",value:function(){if(!(this.length<this.allocated))for(var e in this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={},this.schema){var t=this.schema[e],n=t.type||Float32Array,r=this.columns[t.index];if(r&&ArrayBuffer.isView(r)){var i=new n(this.allocated);i.set(r),this.columns[t.index]=i}else r?(r.length=this.allocated,this.columns[t.index]=r):this.columns[t.index]=new n(this.allocated)}}},{key:"_pruneColumns",value:function(){for(var e=0,t=Object.entries(this.columns);e<t.length;e++){var n=r(t[e],2),i=n[0],o=n[1];this.columns[i]=o.slice(0,this.length)}}}])&&o(t.prototype,n),i&&o(t,i),e}();t.default=u},function(e,t,n){"use strict";(function(t){var r=n(7),i="undefined"==typeof window?t:window;i.loaders=i.loaders||{},e.exports=Object.assign(i.loaders,r)}).call(this,n(6))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"OBJWorkerLoader",{enumerable:!0,get:function(){return o.OBJLoader}}),t._typecheckOBJLoader=t.OBJLoader=void 0;var r,i=(r=n(8))&&r.__esModule?r:{default:r},o=n(23);function a(e,t,n,r,i,o,a){try{var u=e[o](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,i)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c,f,h=s(s({},o.OBJLoader),{},{parse:(c=regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,i.default)((new TextDecoder).decode(t),n));case 1:case"end":return e.stop()}}),e)})),f=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=c.apply(e,t);function o(e){a(i,n,r,o,u,"next",e)}function u(e){a(i,n,r,o,u,"throw",e)}o(void 0)}))},function(e,t){return f.apply(this,arguments)}),parseTextSync:i.default});t.OBJLoader=h;var y=h;t._typecheckOBJLoader=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,o.default)(e).meshes,r=n.reduce((function(e,t){return e+t.header.vertexCount}),0),s=function(e,t){var n,r,i,o,a=new Float32Array(3*t),s=0,l=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{for(l.s();!(o=l.n()).done;){var c=o.value.attributes,f=c.POSITION,h=c.NORMAL,y=c.COLOR_0,d=c.TEXCOORD_0;a.set(f.value,3*s),h&&(n=n||new Float32Array(3*t)).set(h.value,3*s),y&&(r=r||new Float32Array(3*t)).set(y.value,3*s),d&&(i=i||new Float32Array(2*t)).set(d.value,2*s),s+=f.value.length/3}}catch(e){l.e(e)}finally{l.f()}var p={};p.POSITION={value:a,size:3},n&&(p.NORMAL={value:n,size:3});r&&(p.COLOR_0={value:r,size:3});i&&(p.TEXCOORD_0={value:i,size:2});return p}(n,r),l={vertexCount:r,boundingBox:(0,i.getMeshBoundingBox)(s)};return{loaderData:{header:{}},schema:(0,a.makeSchemaFromAttributes)(s,{mode:4,boundingBox:l.boundingBox}),header:l,mode:4,attributes:s}};var r,i=n(1),o=(r=n(21))&&r.__esModule?r:{default:r},a=n(22);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(10)),i=a(n(2)),o=a(n(4));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f={shape:"array-row-table",batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},h=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"schema",void 0),c(this,"options",void 0),c(this,"aggregator",null),c(this,"batchCount",0),c(this,"bytesUsed",0),c(this,"isChunkComplete",!1),c(this,"lastBatchEmittedMs",Date.now()),c(this,"totalLength",0),c(this,"totalBytes",0),c(this,"rowBytes",0),this.schema=t,this.options=s(s({},f),n)}var t,n,a;return t=e,(n=[{key:"limitReached",value:function(){var e,t;return!!(Boolean(null===(e=this.options)||void 0===e?void 0:e.limit)&&this.totalLength>=this.options.limit)||!!(Boolean(null===(t=this.options)||void 0===t?void 0:t._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}},{key:"addRow",value:function(e){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(e),this.totalBytes+=this.rowBytes,Array.isArray(e)?this.addArrayRow(e):this.addObjectRow(e))}},{key:"addArrayRow",value:function(e){if(!this.aggregator){var t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addArrayRow(e)}},{key:"addObjectRow",value:function(e){if(!this.aggregator){var t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addObjectRow(e)}},{key:"chunkComplete",value:function(e){e instanceof ArrayBuffer&&(this.bytesUsed+=e.byteLength),"string"==typeof e&&(this.bytesUsed+=e.length),this.isChunkComplete=!0}},{key:"getFullBatch",value:function(e){return this._isFull()?this._getBatch(e):null}},{key:"getFinalBatch",value:function(e){return this._getBatch(e)}},{key:"_estimateRowMB",value:function(e){return Array.isArray(e)?8*e.length:8*Object.keys(e).length}},{key:"_isFull",value:function(){if(!this.aggregator||0===this.aggregator.rowCount())return!1;if("auto"===this.options.batchSize){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return!(this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs||(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),0))}},{key:"_getBatch",value:function(e){if(!this.aggregator)return null;null!=e&&e.bytesUsed&&(this.bytesUsed=e.bytesUsed);var t=this.aggregator.getBatch();return t.count=this.batchCount,t.bytesUsed=this.bytesUsed,Object.assign(t,e),this.batchCount++,this.aggregator=null,t}},{key:"_getTableBatchType",value:function(){switch(this.options.shape){case"row-table":return r.default;case"array-row-table":case"object-row-table":return i.default;case"columnar-table":return o.default;case"arrow-table":if(!e.ArrowBatch)throw new Error("TableBatchBuilder");return e.ArrowBatch;default:throw new Error("TableBatchBuilder")}}}])&&l(t.prototype,n),a&&l(t,a),e}();t.default=h,c(h,"ArrowBatch",void 0)},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"schema",void 0),i(this,"options",void 0),i(this,"length",0),i(this,"rows",null),i(this,"cursor",0),i(this,"_headers",[]),this.options=n,this.schema=t,!Array.isArray(t))for(var r in this._headers=[],t)this._headers[t[r].index]=t[r].name}var t,n,o;return t=e,(n=[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(e,t){Number.isFinite(t)&&(this.cursor=t),this.rows=this.rows||new Array(100),this.rows[this.length]=e,this.length++}},{key:"addObjectRow",value:function(e,t){Number.isFinite(t)&&(this.cursor=t),this.rows=this.rows||new Array(100),this.rows[this.length]=e,this.length++}},{key:"getBatch",value:function(){var e=this.rows;return e?(e=e.slice(0,this.length),this.rows=null,{shape:this.options.shape,batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}])&&r(t.prototype,n),o&&r(t,o),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMeshSize=function(e){var t=0;for(var n in e){var r=e[n];ArrayBuffer.isView(r)&&(t+=r.byteLength*r.BYTES_PER_ELEMENT)}return t},t.getMeshBoundingBox=function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,u=e.POSITION?e.POSITION.value:[],s=u&&u.length,l=0;l<s;l+=3){var c=u[l],f=u[l+1],h=u[l+2];t=c<t?c:t,n=f<n?f:n,r=h<r?h:r,i=c>i?c:i,o=f>o?f:o,a=h>a?h:a}return[[t,n,r],[i,o,a]]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(13);function i(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){s=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw o}}}}function a(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,"fields",void 0),l(this,"metadata",void 0),(0,r.assert)(Array.isArray(t)),function(e){var t,n={},r=o(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;n[i.name]&&console.warn("Schema: duplicated field name",i.name,i),n[i.name]=!0}}catch(e){r.e(e)}finally{r.f()}}(t),this.fields=t,this.metadata=n||new Map}var t,n,i;return t=e,(n=[{key:"compareTo",value:function(e){if(this.metadata!==e.metadata)return!1;if(this.fields.length!==e.fields.length)return!1;for(var t=0;t<this.fields.length;++t)if(!this.fields[t].compareTo(e.fields[t]))return!1;return!0}},{key:"select",value:function(){for(var t=Object.create(null),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var u=a[o];t[u]=!0}var s=this.fields.filter((function(e){return t[e.name]}));return new e(s,this.metadata)}},{key:"selectAt",value:function(){for(var t=this,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var o=r.map((function(e){return t.fields[e]})).filter(Boolean);return new e(o,this.metadata)}},{key:"assign",value:function(t){var n,r=this.metadata;if(t instanceof e){var i=t;n=i.fields,r=f(f(new Map,this.metadata),i.metadata)}else n=t;var a,u=Object.create(null),s=o(this.fields);try{for(s.s();!(a=s.n()).done;){var l=a.value;u[l.name]=l}}catch(e){s.e(e)}finally{s.f()}var c,h=o(n);try{for(h.s();!(c=h.n()).done;){var y=c.value;u[y.name]=y}}catch(e){h.e(e)}finally{h.f()}return new e(Object.values(u),r)}}])&&s(t.prototype,n),i&&s(t,i),e}();function f(e,t){return new Map([].concat(i(e||new Map),i(t||new Map)))}t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;r(this,e),o(this,"name",void 0),o(this,"type",void 0),o(this,"nullable",void 0),o(this,"metadata",void 0),this.name=t,this.type=n,this.nullable=i,this.metadata=a}var t,n,a;return t=e,(n=[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new e(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}])&&i(t.prototype,n),a&&i(t,a),e}();t.default=a},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Type",{enumerable:!0,get:function(){return f.Type}}),t.FixedSizeList=t.IntervalYearMonth=t.IntervalDayTime=t.Interval=t.TimestampNanosecond=t.TimestampMicrosecond=t.TimestampMillisecond=t.TimestampSecond=t.Timestamp=t.TimeMillisecond=t.TimeSecond=t.Time=t.DateMillisecond=t.DateDay=t.Date=t.Utf8=t.Binary=t.Float64=t.Float32=t.Float16=t.Float=t.Uint64=t.Uint32=t.Uint16=t.Uint8=t.Int64=t.Int32=t.Int16=t.Int8=t.Int=t.Bool=t.Null=t.DataType=void 0;var i,o,a,u,s,l,c,f=n(16);function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var i=b(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return v(this,n)}}function v(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?m(e):t}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function w(e,t,n){return t&&O(e.prototype,t),n&&O(e,n),e}var j=function(){function e(){g(this,e)}return w(e,[{key:"typeId",get:function(){return f.Type.NONE}},{key:"compareTo",value:function(e){return this===e}}],[{key:"isNull",value:function(e){return e&&e.typeId===f.Type.Null}},{key:"isInt",value:function(e){return e&&e.typeId===f.Type.Int}},{key:"isFloat",value:function(e){return e&&e.typeId===f.Type.Float}},{key:"isBinary",value:function(e){return e&&e.typeId===f.Type.Binary}},{key:"isUtf8",value:function(e){return e&&e.typeId===f.Type.Utf8}},{key:"isBool",value:function(e){return e&&e.typeId===f.Type.Bool}},{key:"isDecimal",value:function(e){return e&&e.typeId===f.Type.Decimal}},{key:"isDate",value:function(e){return e&&e.typeId===f.Type.Date}},{key:"isTime",value:function(e){return e&&e.typeId===f.Type.Time}},{key:"isTimestamp",value:function(e){return e&&e.typeId===f.Type.Timestamp}},{key:"isInterval",value:function(e){return e&&e.typeId===f.Type.Interval}},{key:"isList",value:function(e){return e&&e.typeId===f.Type.List}},{key:"isStruct",value:function(e){return e&&e.typeId===f.Type.Struct}},{key:"isUnion",value:function(e){return e&&e.typeId===f.Type.Union}},{key:"isFixedSizeBinary",value:function(e){return e&&e.typeId===f.Type.FixedSizeBinary}},{key:"isFixedSizeList",value:function(e){return e&&e.typeId===f.Type.FixedSizeList}},{key:"isMap",value:function(e){return e&&e.typeId===f.Type.Map}},{key:"isDictionary",value:function(e){return e&&e.typeId===f.Type.Dictionary}}]),e}();t.DataType=j;var T=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.apply(this,arguments)}return w(n,[{key:"typeId",get:function(){return f.Type.Null}},{key:Symbol.toStringTag,get:function(){return"Null"}},{key:"toString",value:function(){return"Null"}}]),n}(j);t.Null=T;var I=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.apply(this,arguments)}return w(n,[{key:"typeId",get:function(){return f.Type.Bool}},{key:Symbol.toStringTag,get:function(){return"Bool"}},{key:"toString",value:function(){return"Bool"}}]),n}(j);t.Bool=I,i=Symbol.toStringTag;var P=function(e){y(n,e);var t=p(n);function n(e,r){var i;return g(this,n),h(m(i=t.call(this)),"isSigned",void 0),h(m(i),"bitWidth",void 0),i.isSigned=e,i.bitWidth=r,i}return w(n,[{key:"typeId",get:function(){return f.Type.Int}},{key:i,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),n}(j);t.Int=P;var S=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!0,8)}return n}(P);t.Int8=S;var k=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!0,16)}return n}(P);t.Int16=k;var _=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!0,32)}return n}(P);t.Int32=_;var M=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!0,64)}return n}(P);t.Int64=M;var A=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!1,8)}return n}(P);t.Uint8=A;var F=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!1,16)}return n}(P);t.Uint16=F;var x=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!1,32)}return n}(P);t.Uint32=x;var B=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!1,64)}return n}(P);t.Uint64=B;var D=16,U=32,E=64;o=Symbol.toStringTag;var N=function(e){y(n,e);var t=p(n);function n(e){var r;return g(this,n),h(m(r=t.call(this)),"precision",void 0),r.precision=e,r}return w(n,[{key:"typeId",get:function(){return f.Type.Float}},{key:o,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),n}(j);t.Float=N;var R=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,D)}return n}(N);t.Float16=R;var C=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,U)}return n}(N);t.Float32=C;var L=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,E)}return n}(N);t.Float64=L;var z=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this)}return w(n,[{key:"typeId",get:function(){return f.Type.Binary}},{key:"toString",value:function(){return"Binary"}},{key:Symbol.toStringTag,get:function(){return"Binary"}}]),n}(j);t.Binary=z;var V=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.apply(this,arguments)}return w(n,[{key:"typeId",get:function(){return f.Type.Utf8}},{key:Symbol.toStringTag,get:function(){return"Utf8"}},{key:"toString",value:function(){return"Utf8"}}]),n}(j);t.Utf8=V;var Y={DAY:0,MILLISECOND:1};a=Symbol.toStringTag;var J=function(e){y(n,e);var t=p(n);function n(e){var r;return g(this,n),h(m(r=t.call(this)),"unit",void 0),r.unit=e,r}return w(n,[{key:"typeId",get:function(){return f.Type.Date}},{key:a,get:function(){return"Date"}},{key:"toString",value:function(){return"Date".concat(32*(this.unit+1),"<").concat(Y[this.unit],">")}}]),n}(j);t.Date=J;var q=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,Y.DAY)}return n}(J);t.DateDay=q;var W=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,Y.MILLISECOND)}return n}(J);t.DateMillisecond=W;var G={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9};u=Symbol.toStringTag;var $=function(e){y(n,e);var t=p(n);function n(e,r){var i;return g(this,n),h(m(i=t.call(this)),"unit",void 0),h(m(i),"bitWidth",void 0),i.unit=e,i.bitWidth=r,i}return w(n,[{key:"typeId",get:function(){return f.Type.Time}},{key:"toString",value:function(){return"Time".concat(this.bitWidth,"<").concat(G[this.unit],">")}},{key:u,get:function(){return"Time"}}]),n}(j);t.Time=$;var X=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,G.SECOND,32)}return n}($);t.TimeSecond=X;var H=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,G.MILLISECOND,32)}return n}($);t.TimeMillisecond=H,s=Symbol.toStringTag;var Q=function(e){y(n,e);var t=p(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return g(this,n),h(m(r=t.call(this)),"unit",void 0),h(m(r),"timezone",void 0),r.unit=e,r.timezone=i,r}return w(n,[{key:"typeId",get:function(){return f.Type.Timestamp}},{key:s,get:function(){return"Timestamp"}},{key:"toString",value:function(){return"Timestamp<".concat(G[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}}]),n}(j);t.Timestamp=Q;var K=function(e){y(n,e);var t=p(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return g(this,n),t.call(this,G.SECOND,e)}return n}(Q);t.TimestampSecond=K;var Z=function(e){y(n,e);var t=p(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return g(this,n),t.call(this,G.MILLISECOND,e)}return n}(Q);t.TimestampMillisecond=Z;var ee=function(e){y(n,e);var t=p(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return g(this,n),t.call(this,G.MICROSECOND,e)}return n}(Q);t.TimestampMicrosecond=ee;var te=function(e){y(n,e);var t=p(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return g(this,n),t.call(this,G.NANOSECOND,e)}return n}(Q);t.TimestampNanosecond=te;var ne={DAY_TIME:0,YEAR_MONTH:1};l=Symbol.toStringTag;var re=function(e){y(n,e);var t=p(n);function n(e){var r;return g(this,n),h(m(r=t.call(this)),"unit",void 0),r.unit=e,r}return w(n,[{key:"typeId",get:function(){return f.Type.Interval}},{key:l,get:function(){return"Interval"}},{key:"toString",value:function(){return"Interval<".concat(ne[this.unit],">")}}]),n}(j);t.Interval=re;var ie=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,ne.DAY_TIME)}return n}(re);t.IntervalDayTime=ie;var oe=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,ne.YEAR_MONTH)}return n}(re);t.IntervalYearMonth=oe,c=Symbol.toStringTag;var ae=function(e){y(n,e);var t=p(n);function n(e,r){var i;return g(this,n),h(m(i=t.call(this)),"listSize",void 0),h(m(i),"children",void 0),i.listSize=e,i.children=[r],i}return w(n,[{key:"typeId",get:function(){return f.Type.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:c,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}]),n}(j);t.FixedSizeList=ae},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.Type=void 0,t.Type=r,function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"}(r||(t.Type=r={}))},function(e,t,n){"use strict";function r(e){return e instanceof Date?Date:e instanceof Number?Float32Array:"string"==typeof e?String:null}Object.defineProperty(t,"__esModule",{value:!0}),t.deduceTableSchema=function(e,t){var n=Array.isArray(e)?function(e){var t={};if(e.length){var n=e[0];for(var i in n){var o=n[i];t[i]=r(o)}}return t}(e):function(e){var t={};for(var n in e){var i=e[n];if(ArrayBuffer.isView(i))t[n]=i.constructor;else if(i.length){var o=i[0];t[n]=r(o)}t[n]=t[n]||null}return t}(e);return Object.assign(n,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTypeInfo=function(e){return{typeId:e.typeId,ArrayType:e.ArrayType,typeName:e.toString(),typeEnumName:o(e.typeId),precision:e.precision}};var r=n(0);var i=null;function o(e){if(!i)for(var t in i={},r.Type)i[r.Type[t]]=t;return i[e]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getArrowTypeFromTypedArray=function(e){switch(e.constructor){case Int8Array:return new r.Int8;case Uint8Array:return new r.Uint8;case Int16Array:return new r.Int16;case Uint16Array:return new r.Uint16;case Int32Array:return new r.Int32;case Uint32Array:return new r.Uint32;case Float32Array:return new r.Float32;case Float64Array:return new r.Float64;default:throw new Error("array type not supported")}};var r=n(0)},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i;function o(e,t,n,r,i,o,a){try{var u=e[o](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function u(e){o(a,r,i,u,s,"next",e)}function s(e){o(a,r,i,u,s,"throw",e)}u(void 0)}))}}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function f(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){var t="function"==typeof Map?new Map:void 0;return(h=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return y(e,arguments,v(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,e)})(e)}function y(e,t,n){return(y=d()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&p(i,n.prototype),i}).apply(null,arguments)}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.takeAsync=function(e){return g.apply(this,arguments)},t.default=void 0;var m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(i,e);var t,n,r=(t=i,n=d(),function(){var e,r=v(t);if(n){var i=v(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return f(this,e)});function i(){return s(this,i),r.apply(this,arguments)}return c(i,[{key:"enqueue",value:function(e){return this.push(e)}},{key:"dequeue",value:function(){return this.shift()}}]),i}(h(Array));i=Symbol.asyncIterator;var b=function(){function e(){s(this,e),u(this,"_values",void 0),u(this,"_settlers",void 0),u(this,"_closed",void 0),this._values=new m,this._settlers=new m,this._closed=!1}return c(e,[{key:"close",value:function(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}},{key:i,value:function(){return this}},{key:"enqueue",value:function(e){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");var t=this._settlers.dequeue();e instanceof Error?t.reject(e):t.resolve({value:e})}else this._values.enqueue(e)}},{key:"next",value:function(){var e=this;if(this._values.length>0){var t=this._values.dequeue();return t instanceof Error?Promise.reject(t):Promise.resolve({value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise((function(t,n){e._settlers.enqueue({resolve:t,reject:n})}))}}]),e}();function g(){return(g=a(regeneratorRuntime.mark((function e(t){var n,r,i,o,a,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=u.length>1&&void 0!==u[1]?u[1]:1/0,r=[],i=t[Symbol.asyncIterator]();case 3:if(!(r.length<n)){e.next=14;break}return e.next=6,i.next();case 6:if(o=e.sent,a=o.value,!o.done){e.next=11;break}return e.abrupt("break",14);case 11:r.push(a),e.next=3;break;case 14:return e.abrupt("return",r);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.default=b},function(e,t,n){"use strict";function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){s=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=/^[og]\s*(.+)?/,l=/^mtllib /,c=/^usemtl /,f=function(){function e(t){var n=t.index,r=t.name,i=void 0===r?"":r,a=t.mtllib,u=t.smooth,s=t.groupStart;o(this,e),this.index=n,this.name=i,this.mtllib=a,this.smooth=u,this.groupStart=s,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return u(e,[{key:"clone",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new e({index:t,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),e}(),h=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o(this,e),this.name=t,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0,this.fromDeclaration=null}return u(e,[{key:"startMaterial",value:function(e,t){var n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);var r=new f({index:this.materials.length,name:e,mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==n?n.smooth:this.smooth,groupStart:void 0!==n?n.groupEnd:0});return this.materials.push(r),r}},{key:"currentMaterial",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:"_finalize",value:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var n=this.materials.length-1;n>=0;n--)this.materials[n].groupCount<=0&&this.materials.splice(n,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}}]),e}(),y=function(){function e(){o(this,e),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}return u(e,[{key:"startObject",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=t);var n=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new h(e),this.object.fromDeclaration=t,n&&n.name&&"function"==typeof n.clone){var r=n.clone(0);r.inherited=!0,this.object.materials.push(r)}this.objects.push(this.object)}},{key:"finalize",value:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:"parseVertexIndex",value:function(e,t){var n=parseInt(e);return 3*(n>=0?n-1:n+t/3)}},{key:"parseNormalIndex",value:function(e,t){var n=parseInt(e);return 3*(n>=0?n-1:n+t/3)}},{key:"parseUVIndex",value:function(e,t){var n=parseInt(e);return 2*(n>=0?n-1:n+t/2)}},{key:"addVertex",value:function(e,t,n){var r=this.vertices,i=this.object.geometry.vertices;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])}},{key:"addVertexPoint",value:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])}},{key:"addVertexLine",value:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])}},{key:"addNormal",value:function(e,t,n){var r=this.normals,i=this.object.geometry.normals;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])}},{key:"addColor",value:function(e,t,n){var r=this.colors,i=this.object.geometry.colors;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])}},{key:"addUV",value:function(e,t,n){var r=this.uvs,i=this.object.geometry.uvs;i.push(r[e+0],r[e+1]),i.push(r[t+0],r[t+1]),i.push(r[n+0],r[n+1])}},{key:"addUVLine",value:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])}},{key:"addFace",value:function(e,t,n,r,i,o,a,u,s){var l=this.vertices.length,c=this.parseVertexIndex(e,l),f=this.parseVertexIndex(t,l),h=this.parseVertexIndex(n,l);if(this.addVertex(c,f,h),void 0!==r&&""!==r){var y=this.uvs.length;c=this.parseUVIndex(r,y),f=this.parseUVIndex(i,y),h=this.parseUVIndex(o,y),this.addUV(c,f,h)}if(void 0!==a&&""!==a){var d=this.normals.length;c=this.parseNormalIndex(a,d),f=a===u?c:this.parseNormalIndex(u,d),h=a===s?c:this.parseNormalIndex(s,d),this.addNormal(c,f,h)}this.colors.length>0&&this.addColor(c,f,h)}},{key:"addPointGeometry",value:function(e){this.object.geometry.type="Points";var t,n=this.vertices.length,i=r(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;this.addVertexPoint(this.parseVertexIndex(o,n))}}catch(e){i.e(e)}finally{i.f()}}},{key:"addLineGeometry",value:function(e,t){this.object.geometry.type="Line";var n,i=this.vertices.length,o=this.uvs.length,a=r(e);try{for(a.s();!(n=a.n()).done;){var u=n.value;this.addVertexLine(this.parseVertexIndex(u,i))}}catch(e){a.e(e)}finally{a.f()}var s,l=r(t);try{for(l.s();!(s=l.n()).done;){var c=s.value;this.addUVLine(this.parseUVIndex(c,o))}}catch(e){l.e(e)}finally{l.f()}}}]),e}();t.default=function(e){var t=new y;-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n")),-1!==e.indexOf("\\\n")&&(e=e.replace(/\\\n/g,""));for(var n=e.split("\n"),i="",o="",a=[],u="function"==typeof"".trimLeft,f=0,h=n.length;f<h;f++)if(i=n[f],0!==(i=u?i.trimLeft():i.trim()).length&&"#"!==(o=i.charAt(0)))if("v"===o){var d=i.split(/\s+/);switch(d[0]){case"v":t.vertices.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])),8===d.length&&t.colors.push(parseFloat(d[4]),parseFloat(d[5]),parseFloat(d[6]));break;case"vn":t.normals.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));break;case"vt":t.uvs.push(parseFloat(d[1]),parseFloat(d[2]))}}else if("f"===o){for(var p=i.substr(1).trim().split(/\s+/),v=[],m=0,b=p.length;m<b;m++){var g=p[m];if(g.length>0){var O=g.split("/");v.push(O)}}for(var w=v[0],j=1,T=v.length-1;j<T;j++){var I=v[j],P=v[j+1];t.addFace(w[0],I[0],P[0],w[1],I[1],P[1],w[2],I[2],P[2])}}else if("l"===o){var S=i.substring(1).trim().split(" "),k=void 0,_=[];if(-1===i.indexOf("/"))k=S;else{k=[];for(var M=0,A=S.length;M<A;M++){var F=S[M].split("/");""!==F[0]&&k.push(F[0]),""!==F[1]&&_.push(F[1])}}t.addLineGeometry(k,_)}else if("p"===o){var x=i.substr(1).trim().split(" ");t.addPointGeometry(x)}else if(null!==(a=s.exec(i))){var B=(" "+a[0].substr(1).trim()).substr(1);t.startObject(B)}else if(c.test(i))t.object.startMaterial(i.substring(7).trim(),t.materialLibraries);else if(l.test(i))t.materialLibraries.push(i.substring(7).trim());else{if("s"!==o){if("\0"===i)continue;throw new Error('Unexpected line: "'.concat(i,'"'))}if((a=i.split(" ")).length>1){var D=a[1].trim().toLowerCase();t.object.smooth="0"!==D&&"off"!==D}else t.object.smooth=!0;var U=t.object.currentMaterial();U&&(U.smooth=t.object.smooth)}t.finalize();var E,N=[],R=[],C=r(t.objects);try{for(C.s();!(E=C.n()).done;){var L=E.value,z=L.geometry;if(0!==z.vertices.length){var V={header:{vertexCount:z.vertices.length/3},attributes:{}};switch(z.type){case"Points":V.mode=0;break;case"Line":V.mode=1;break;default:V.mode=4}V.attributes.POSITION={value:new Float32Array(z.vertices),size:3},z.normals.length>0&&(V.attributes.NORMAL={value:new Float32Array(z.normals),size:3}),z.colors.length>0&&(V.attributes.COLOR_0={value:new Float32Array(z.colors),size:3}),z.uvs.length>0&&(V.attributes.TEXCOORD_0={value:new Float32Array(z.uvs),size:2}),V.materials=[];var Y,J=r(L.materials);try{for(J.s();!(Y=J.n()).done;){var q=Y.value,W={name:q.name,flatShading:!q.smooth};V.materials.push(W),R.push(W)}}catch(e){J.e(e)}finally{J.f()}V.name=L.name,N.push(V)}}}catch(e){C.e(e)}finally{C.f()}return{meshes:N,materials:R}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeSchemaFromAttributes=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var o in n)t=t||new Map,"value"!==o&&t.set(o,JSON.stringify(n[o]));var a=[];for(var u in e){var s=e[u],l=i(u,s);a.push(l)}return new r.Schema(a,t)};var r=n(1);function i(e,t){var n=new Map;for(var i in t)"value"!==i&&n.set(i,JSON.stringify(t[i]));var o=(0,r.getArrowTypeFromTypedArray)(t.value);return!("size"in t)||1===t.size?new r.Field(e,o,!1,n):new r.Field(e,new r.FixedSizeList(t.size,new r.Field("value",o)),!1,n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._typecheckOBJLoader=t.OBJLoader=void 0;var r={name:"OBJ",id:"obj",module:"obj",version:"3.0.9",worker:!0,extensions:["obj"],mimeTypes:["text/plain"],testText:function(e){return"v"===e[0]},options:{obj:{}}};t.OBJLoader=r;var i=r;t._typecheckOBJLoader=i}]);
|
|
1
|
+
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Schema",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"Field",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"Type",{enumerable:!0,get:function(){return o.Type}}),Object.defineProperty(t,"DataType",{enumerable:!0,get:function(){return o.DataType}}),Object.defineProperty(t,"Null",{enumerable:!0,get:function(){return o.Null}}),Object.defineProperty(t,"Bool",{enumerable:!0,get:function(){return o.Bool}}),Object.defineProperty(t,"Int",{enumerable:!0,get:function(){return o.Int}}),Object.defineProperty(t,"Int8",{enumerable:!0,get:function(){return o.Int8}}),Object.defineProperty(t,"Int16",{enumerable:!0,get:function(){return o.Int16}}),Object.defineProperty(t,"Int32",{enumerable:!0,get:function(){return o.Int32}}),Object.defineProperty(t,"Int64",{enumerable:!0,get:function(){return o.Int64}}),Object.defineProperty(t,"Uint8",{enumerable:!0,get:function(){return o.Uint8}}),Object.defineProperty(t,"Uint16",{enumerable:!0,get:function(){return o.Uint16}}),Object.defineProperty(t,"Uint32",{enumerable:!0,get:function(){return o.Uint32}}),Object.defineProperty(t,"Uint64",{enumerable:!0,get:function(){return o.Uint64}}),Object.defineProperty(t,"Float",{enumerable:!0,get:function(){return o.Float}}),Object.defineProperty(t,"Float16",{enumerable:!0,get:function(){return o.Float16}}),Object.defineProperty(t,"Float32",{enumerable:!0,get:function(){return o.Float32}}),Object.defineProperty(t,"Float64",{enumerable:!0,get:function(){return o.Float64}}),Object.defineProperty(t,"Binary",{enumerable:!0,get:function(){return o.Binary}}),Object.defineProperty(t,"Utf8",{enumerable:!0,get:function(){return o.Utf8}}),Object.defineProperty(t,"Date",{enumerable:!0,get:function(){return o.Date}}),Object.defineProperty(t,"DateDay",{enumerable:!0,get:function(){return o.DateDay}}),Object.defineProperty(t,"DateMillisecond",{enumerable:!0,get:function(){return o.DateMillisecond}}),Object.defineProperty(t,"Time",{enumerable:!0,get:function(){return o.Time}}),Object.defineProperty(t,"TimeSecond",{enumerable:!0,get:function(){return o.TimeSecond}}),Object.defineProperty(t,"TimeMillisecond",{enumerable:!0,get:function(){return o.TimeMillisecond}}),Object.defineProperty(t,"Timestamp",{enumerable:!0,get:function(){return o.Timestamp}}),Object.defineProperty(t,"TimestampSecond",{enumerable:!0,get:function(){return o.TimestampSecond}}),Object.defineProperty(t,"TimestampMillisecond",{enumerable:!0,get:function(){return o.TimestampMillisecond}}),Object.defineProperty(t,"TimestampMicrosecond",{enumerable:!0,get:function(){return o.TimestampMicrosecond}}),Object.defineProperty(t,"TimestampNanosecond",{enumerable:!0,get:function(){return o.TimestampNanosecond}}),Object.defineProperty(t,"Interval",{enumerable:!0,get:function(){return o.Interval}}),Object.defineProperty(t,"IntervalDayTime",{enumerable:!0,get:function(){return o.IntervalDayTime}}),Object.defineProperty(t,"IntervalYearMonth",{enumerable:!0,get:function(){return o.IntervalYearMonth}}),Object.defineProperty(t,"FixedSizeList",{enumerable:!0,get:function(){return o.FixedSizeList}});var r=a(n(12)),i=a(n(14)),o=n(15);function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"TableBatchBuilder",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"RowTableBatchAggregator",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"ColumnarTableBatchAggregator",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"convertToObjectRow",{enumerable:!0,get:function(){return a.convertToObjectRow}}),Object.defineProperty(t,"convertToArrayRow",{enumerable:!0,get:function(){return a.convertToArrayRow}}),Object.defineProperty(t,"getMeshSize",{enumerable:!0,get:function(){return u.getMeshSize}}),Object.defineProperty(t,"getMeshBoundingBox",{enumerable:!0,get:function(){return u.getMeshBoundingBox}}),Object.defineProperty(t,"Schema",{enumerable:!0,get:function(){return s.Schema}}),Object.defineProperty(t,"Field",{enumerable:!0,get:function(){return s.Field}}),Object.defineProperty(t,"DataType",{enumerable:!0,get:function(){return s.DataType}}),Object.defineProperty(t,"Null",{enumerable:!0,get:function(){return s.Null}}),Object.defineProperty(t,"Binary",{enumerable:!0,get:function(){return s.Binary}}),Object.defineProperty(t,"Bool",{enumerable:!0,get:function(){return s.Bool}}),Object.defineProperty(t,"Int",{enumerable:!0,get:function(){return s.Int}}),Object.defineProperty(t,"Int8",{enumerable:!0,get:function(){return s.Int8}}),Object.defineProperty(t,"Int16",{enumerable:!0,get:function(){return s.Int16}}),Object.defineProperty(t,"Int32",{enumerable:!0,get:function(){return s.Int32}}),Object.defineProperty(t,"Int64",{enumerable:!0,get:function(){return s.Int64}}),Object.defineProperty(t,"Uint8",{enumerable:!0,get:function(){return s.Uint8}}),Object.defineProperty(t,"Uint16",{enumerable:!0,get:function(){return s.Uint16}}),Object.defineProperty(t,"Uint32",{enumerable:!0,get:function(){return s.Uint32}}),Object.defineProperty(t,"Uint64",{enumerable:!0,get:function(){return s.Uint64}}),Object.defineProperty(t,"Float",{enumerable:!0,get:function(){return s.Float}}),Object.defineProperty(t,"Float16",{enumerable:!0,get:function(){return s.Float16}}),Object.defineProperty(t,"Float32",{enumerable:!0,get:function(){return s.Float32}}),Object.defineProperty(t,"Float64",{enumerable:!0,get:function(){return s.Float64}}),Object.defineProperty(t,"Utf8",{enumerable:!0,get:function(){return s.Utf8}}),Object.defineProperty(t,"Date",{enumerable:!0,get:function(){return s.Date}}),Object.defineProperty(t,"DateDay",{enumerable:!0,get:function(){return s.DateDay}}),Object.defineProperty(t,"DateMillisecond",{enumerable:!0,get:function(){return s.DateMillisecond}}),Object.defineProperty(t,"Time",{enumerable:!0,get:function(){return s.Time}}),Object.defineProperty(t,"TimeMillisecond",{enumerable:!0,get:function(){return s.TimeMillisecond}}),Object.defineProperty(t,"TimeSecond",{enumerable:!0,get:function(){return s.TimeSecond}}),Object.defineProperty(t,"Timestamp",{enumerable:!0,get:function(){return s.Timestamp}}),Object.defineProperty(t,"TimestampSecond",{enumerable:!0,get:function(){return s.TimestampSecond}}),Object.defineProperty(t,"TimestampMillisecond",{enumerable:!0,get:function(){return s.TimestampMillisecond}}),Object.defineProperty(t,"TimestampMicrosecond",{enumerable:!0,get:function(){return s.TimestampMicrosecond}}),Object.defineProperty(t,"TimestampNanosecond",{enumerable:!0,get:function(){return s.TimestampNanosecond}}),Object.defineProperty(t,"Interval",{enumerable:!0,get:function(){return s.Interval}}),Object.defineProperty(t,"IntervalDayTime",{enumerable:!0,get:function(){return s.IntervalDayTime}}),Object.defineProperty(t,"IntervalYearMonth",{enumerable:!0,get:function(){return s.IntervalYearMonth}}),Object.defineProperty(t,"FixedSizeList",{enumerable:!0,get:function(){return s.FixedSizeList}}),Object.defineProperty(t,"deduceTableSchema",{enumerable:!0,get:function(){return l.deduceTableSchema}}),Object.defineProperty(t,"getTypeInfo",{enumerable:!0,get:function(){return c.getTypeInfo}}),Object.defineProperty(t,"getArrowTypeFromTypedArray",{enumerable:!0,get:function(){return f.getArrowTypeFromTypedArray}}),Object.defineProperty(t,"AsyncQueue",{enumerable:!0,get:function(){return h.default}});var r=y(n(9)),i=y(n(2)),o=y(n(4)),a=n(3),u=n(11),s=n(0),l=n(17),c=n(18),f=n(19),h=y(n(20));function y(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(3);function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,"schema",void 0),o(this,"options",void 0),o(this,"length",0),o(this,"objectRows",null),o(this,"arrayRows",null),o(this,"cursor",0),o(this,"_headers",[]),this.options=n,this.schema=t,!Array.isArray(t))for(var r in this._headers=[],t)this._headers[t[r].index]=t[r].name}var t,n,a;return t=e,(n=[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(e,t){switch(Number.isFinite(t)&&(this.cursor=t),this.options.shape){case"object-row-table":var n=(0,r.convertToObjectRow)(e,this._headers);this.addObjectRow(n,t);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(100),this.arrayRows[this.length]=e,this.length++}}},{key:"addObjectRow",value:function(e,t){switch(Number.isFinite(t)&&(this.cursor=t),this.options.shape){case"array-row-table":var n=(0,r.convertToArrayRow)(e,this._headers);this.addArrayRow(n,t);break;case"object-row-table":this.objectRows=this.objectRows||new Array(100),this.objectRows[this.length]=e,this.length++}}},{key:"getBatch",value:function(){var e=this.arrayRows||this.objectRows;return e?(e=e.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}])&&i(t.prototype,n),a&&i(t,a),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertToObjectRow=function(e,t){if(!e)throw new Error("null row");if(!t)throw new Error("no headers");for(var n={},r=0;r<t.length;r++)n[t[r]]=e[r];return n},t.convertToArrayRow=function(e,t){if(!e)throw new Error("null row");if(!t)throw new Error("no headers");for(var n=new Array(t.length),r=0;r<t.length;r++)n[r]=e[t[r]];return n}},function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){u=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,"schema",void 0),a(this,"length",0),a(this,"allocated",0),a(this,"columns",{}),this.schema=t,this._reallocateColumns()}var t,n,i;return t=e,(n=[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(e){this._reallocateColumns();var t=0;for(var n in this.columns)this.columns[n][this.length]=e[t++];this.length++}},{key:"addObjectRow",value:function(e){for(var t in this._reallocateColumns(),e)this.columns[t][this.length]=e[t];this.length++}},{key:"getBatch",value:function(){this._pruneColumns();var e=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(var t in this.schema){var n=this.schema[t];e[n.name]=this.columns[n.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:e,schema:this.schema,length:this.length}}},{key:"_reallocateColumns",value:function(){if(!(this.length<this.allocated))for(var e in this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={},this.schema){var t=this.schema[e],n=t.type||Float32Array,r=this.columns[t.index];if(r&&ArrayBuffer.isView(r)){var i=new n(this.allocated);i.set(r),this.columns[t.index]=i}else r?(r.length=this.allocated,this.columns[t.index]=r):this.columns[t.index]=new n(this.allocated)}}},{key:"_pruneColumns",value:function(){for(var e=0,t=Object.entries(this.columns);e<t.length;e++){var n=r(t[e],2),i=n[0],o=n[1];this.columns[i]=o.slice(0,this.length)}}}])&&o(t.prototype,n),i&&o(t,i),e}();t.default=u},function(e,t,n){"use strict";(function(t){var r=n(7),i="undefined"==typeof window?t:window;i.loaders=i.loaders||{},e.exports=Object.assign(i.loaders,r)}).call(this,n(6))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"OBJWorkerLoader",{enumerable:!0,get:function(){return o.OBJLoader}}),t._typecheckOBJLoader=t.OBJLoader=void 0;var r,i=(r=n(8))&&r.__esModule?r:{default:r},o=n(23);function a(e,t,n,r,i,o,a){try{var u=e[o](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,i)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c,f,h=s(s({},o.OBJLoader),{},{parse:(c=regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,i.default)((new TextDecoder).decode(t),n));case 1:case"end":return e.stop()}}),e)})),f=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=c.apply(e,t);function o(e){a(i,n,r,o,u,"next",e)}function u(e){a(i,n,r,o,u,"throw",e)}o(void 0)}))},function(e,t){return f.apply(this,arguments)}),parseTextSync:i.default});t.OBJLoader=h;var y=h;t._typecheckOBJLoader=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,o.default)(e).meshes,r=n.reduce((function(e,t){return e+t.header.vertexCount}),0),s=function(e,t){var n,r,i,o,a=new Float32Array(3*t),s=0,l=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(e);try{for(l.s();!(o=l.n()).done;){var c=o.value.attributes,f=c.POSITION,h=c.NORMAL,y=c.COLOR_0,d=c.TEXCOORD_0;a.set(f.value,3*s),h&&(n=n||new Float32Array(3*t)).set(h.value,3*s),y&&(r=r||new Float32Array(3*t)).set(y.value,3*s),d&&(i=i||new Float32Array(2*t)).set(d.value,2*s),s+=f.value.length/3}}catch(e){l.e(e)}finally{l.f()}var p={};p.POSITION={value:a,size:3},n&&(p.NORMAL={value:n,size:3});r&&(p.COLOR_0={value:r,size:3});i&&(p.TEXCOORD_0={value:i,size:2});return p}(n,r),l={vertexCount:r,boundingBox:(0,i.getMeshBoundingBox)(s)};return{loaderData:{header:{}},schema:(0,a.makeSchemaFromAttributes)(s,{mode:4,boundingBox:l.boundingBox}),header:l,mode:4,attributes:s}};var r,i=n(1),o=(r=n(21))&&r.__esModule?r:{default:r},a=n(22);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(10)),i=a(n(2)),o=a(n(4));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f={shape:"array-row-table",batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},h=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"schema",void 0),c(this,"options",void 0),c(this,"aggregator",null),c(this,"batchCount",0),c(this,"bytesUsed",0),c(this,"isChunkComplete",!1),c(this,"lastBatchEmittedMs",Date.now()),c(this,"totalLength",0),c(this,"totalBytes",0),c(this,"rowBytes",0),this.schema=t,this.options=s(s({},f),n)}var t,n,a;return t=e,(n=[{key:"limitReached",value:function(){var e,t;return!!(Boolean(null===(e=this.options)||void 0===e?void 0:e.limit)&&this.totalLength>=this.options.limit)||!!(Boolean(null===(t=this.options)||void 0===t?void 0:t._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}},{key:"addRow",value:function(e){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(e),this.totalBytes+=this.rowBytes,Array.isArray(e)?this.addArrayRow(e):this.addObjectRow(e))}},{key:"addArrayRow",value:function(e){if(!this.aggregator){var t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addArrayRow(e)}},{key:"addObjectRow",value:function(e){if(!this.aggregator){var t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addObjectRow(e)}},{key:"chunkComplete",value:function(e){e instanceof ArrayBuffer&&(this.bytesUsed+=e.byteLength),"string"==typeof e&&(this.bytesUsed+=e.length),this.isChunkComplete=!0}},{key:"getFullBatch",value:function(e){return this._isFull()?this._getBatch(e):null}},{key:"getFinalBatch",value:function(e){return this._getBatch(e)}},{key:"_estimateRowMB",value:function(e){return Array.isArray(e)?8*e.length:8*Object.keys(e).length}},{key:"_isFull",value:function(){if(!this.aggregator||0===this.aggregator.rowCount())return!1;if("auto"===this.options.batchSize){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return!(this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs||(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),0))}},{key:"_getBatch",value:function(e){if(!this.aggregator)return null;null!=e&&e.bytesUsed&&(this.bytesUsed=e.bytesUsed);var t=this.aggregator.getBatch();return t.count=this.batchCount,t.bytesUsed=this.bytesUsed,Object.assign(t,e),this.batchCount++,this.aggregator=null,t}},{key:"_getTableBatchType",value:function(){switch(this.options.shape){case"row-table":return r.default;case"array-row-table":case"object-row-table":return i.default;case"columnar-table":return o.default;case"arrow-table":if(!e.ArrowBatch)throw new Error("TableBatchBuilder");return e.ArrowBatch;default:throw new Error("TableBatchBuilder")}}}])&&l(t.prototype,n),a&&l(t,a),e}();t.default=h,c(h,"ArrowBatch",void 0)},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"schema",void 0),i(this,"options",void 0),i(this,"length",0),i(this,"rows",null),i(this,"cursor",0),i(this,"_headers",[]),this.options=n,this.schema=t,!Array.isArray(t))for(var r in this._headers=[],t)this._headers[t[r].index]=t[r].name}var t,n,o;return t=e,(n=[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(e,t){Number.isFinite(t)&&(this.cursor=t),this.rows=this.rows||new Array(100),this.rows[this.length]=e,this.length++}},{key:"addObjectRow",value:function(e,t){Number.isFinite(t)&&(this.cursor=t),this.rows=this.rows||new Array(100),this.rows[this.length]=e,this.length++}},{key:"getBatch",value:function(){var e=this.rows;return e?(e=e.slice(0,this.length),this.rows=null,{shape:this.options.shape,batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}])&&r(t.prototype,n),o&&r(t,o),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMeshSize=function(e){var t=0;for(var n in e){var r=e[n];ArrayBuffer.isView(r)&&(t+=r.byteLength*r.BYTES_PER_ELEMENT)}return t},t.getMeshBoundingBox=function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,u=e.POSITION?e.POSITION.value:[],s=u&&u.length,l=0;l<s;l+=3){var c=u[l],f=u[l+1],h=u[l+2];t=c<t?c:t,n=f<n?f:n,r=h<r?h:r,i=c>i?c:i,o=f>o?f:o,a=h>a?h:a}return[[t,n,r],[i,o,a]]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(13);function i(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){s=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw o}}}}function a(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,"fields",void 0),l(this,"metadata",void 0),(0,r.assert)(Array.isArray(t)),function(e){var t,n={},r=o(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;n[i.name]&&console.warn("Schema: duplicated field name",i.name,i),n[i.name]=!0}}catch(e){r.e(e)}finally{r.f()}}(t),this.fields=t,this.metadata=n||new Map}var t,n,i;return t=e,(n=[{key:"compareTo",value:function(e){if(this.metadata!==e.metadata)return!1;if(this.fields.length!==e.fields.length)return!1;for(var t=0;t<this.fields.length;++t)if(!this.fields[t].compareTo(e.fields[t]))return!1;return!0}},{key:"select",value:function(){for(var t=Object.create(null),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var u=a[o];t[u]=!0}var s=this.fields.filter((function(e){return t[e.name]}));return new e(s,this.metadata)}},{key:"selectAt",value:function(){for(var t=this,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var o=r.map((function(e){return t.fields[e]})).filter(Boolean);return new e(o,this.metadata)}},{key:"assign",value:function(t){var n,r=this.metadata;if(t instanceof e){var i=t;n=i.fields,r=f(f(new Map,this.metadata),i.metadata)}else n=t;var a,u=Object.create(null),s=o(this.fields);try{for(s.s();!(a=s.n()).done;){var l=a.value;u[l.name]=l}}catch(e){s.e(e)}finally{s.f()}var c,h=o(n);try{for(h.s();!(c=h.n()).done;){var y=c.value;u[y.name]=y}}catch(e){h.e(e)}finally{h.f()}return new e(Object.values(u),r)}}])&&s(t.prototype,n),i&&s(t,i),e}();function f(e,t){return new Map([].concat(i(e||new Map),i(t||new Map)))}t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;r(this,e),o(this,"name",void 0),o(this,"type",void 0),o(this,"nullable",void 0),o(this,"metadata",void 0),this.name=t,this.type=n,this.nullable=i,this.metadata=a}var t,n,a;return t=e,(n=[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new e(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}])&&i(t.prototype,n),a&&i(t,a),e}();t.default=a},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Type",{enumerable:!0,get:function(){return f.Type}}),t.FixedSizeList=t.IntervalYearMonth=t.IntervalDayTime=t.Interval=t.TimestampNanosecond=t.TimestampMicrosecond=t.TimestampMillisecond=t.TimestampSecond=t.Timestamp=t.TimeMillisecond=t.TimeSecond=t.Time=t.DateMillisecond=t.DateDay=t.Date=t.Utf8=t.Binary=t.Float64=t.Float32=t.Float16=t.Float=t.Uint64=t.Uint32=t.Uint16=t.Uint8=t.Int64=t.Int32=t.Int16=t.Int8=t.Int=t.Bool=t.Null=t.DataType=void 0;var i,o,a,u,s,l,c,f=n(16);function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var i=b(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return v(this,n)}}function v(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?m(e):t}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function w(e,t,n){return t&&O(e.prototype,t),n&&O(e,n),e}var j=function(){function e(){g(this,e)}return w(e,[{key:"typeId",get:function(){return f.Type.NONE}},{key:"compareTo",value:function(e){return this===e}}],[{key:"isNull",value:function(e){return e&&e.typeId===f.Type.Null}},{key:"isInt",value:function(e){return e&&e.typeId===f.Type.Int}},{key:"isFloat",value:function(e){return e&&e.typeId===f.Type.Float}},{key:"isBinary",value:function(e){return e&&e.typeId===f.Type.Binary}},{key:"isUtf8",value:function(e){return e&&e.typeId===f.Type.Utf8}},{key:"isBool",value:function(e){return e&&e.typeId===f.Type.Bool}},{key:"isDecimal",value:function(e){return e&&e.typeId===f.Type.Decimal}},{key:"isDate",value:function(e){return e&&e.typeId===f.Type.Date}},{key:"isTime",value:function(e){return e&&e.typeId===f.Type.Time}},{key:"isTimestamp",value:function(e){return e&&e.typeId===f.Type.Timestamp}},{key:"isInterval",value:function(e){return e&&e.typeId===f.Type.Interval}},{key:"isList",value:function(e){return e&&e.typeId===f.Type.List}},{key:"isStruct",value:function(e){return e&&e.typeId===f.Type.Struct}},{key:"isUnion",value:function(e){return e&&e.typeId===f.Type.Union}},{key:"isFixedSizeBinary",value:function(e){return e&&e.typeId===f.Type.FixedSizeBinary}},{key:"isFixedSizeList",value:function(e){return e&&e.typeId===f.Type.FixedSizeList}},{key:"isMap",value:function(e){return e&&e.typeId===f.Type.Map}},{key:"isDictionary",value:function(e){return e&&e.typeId===f.Type.Dictionary}}]),e}();t.DataType=j;var T=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.apply(this,arguments)}return w(n,[{key:"typeId",get:function(){return f.Type.Null}},{key:Symbol.toStringTag,get:function(){return"Null"}},{key:"toString",value:function(){return"Null"}}]),n}(j);t.Null=T;var I=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.apply(this,arguments)}return w(n,[{key:"typeId",get:function(){return f.Type.Bool}},{key:Symbol.toStringTag,get:function(){return"Bool"}},{key:"toString",value:function(){return"Bool"}}]),n}(j);t.Bool=I,i=Symbol.toStringTag;var P=function(e){y(n,e);var t=p(n);function n(e,r){var i;return g(this,n),h(m(i=t.call(this)),"isSigned",void 0),h(m(i),"bitWidth",void 0),i.isSigned=e,i.bitWidth=r,i}return w(n,[{key:"typeId",get:function(){return f.Type.Int}},{key:i,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),n}(j);t.Int=P;var S=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!0,8)}return n}(P);t.Int8=S;var k=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!0,16)}return n}(P);t.Int16=k;var _=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!0,32)}return n}(P);t.Int32=_;var M=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!0,64)}return n}(P);t.Int64=M;var A=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!1,8)}return n}(P);t.Uint8=A;var F=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!1,16)}return n}(P);t.Uint16=F;var x=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!1,32)}return n}(P);t.Uint32=x;var B=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,!1,64)}return n}(P);t.Uint64=B;var D=16,U=32,E=64;o=Symbol.toStringTag;var N=function(e){y(n,e);var t=p(n);function n(e){var r;return g(this,n),h(m(r=t.call(this)),"precision",void 0),r.precision=e,r}return w(n,[{key:"typeId",get:function(){return f.Type.Float}},{key:o,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),n}(j);t.Float=N;var R=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,D)}return n}(N);t.Float16=R;var C=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,U)}return n}(N);t.Float32=C;var L=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,E)}return n}(N);t.Float64=L;var z=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this)}return w(n,[{key:"typeId",get:function(){return f.Type.Binary}},{key:"toString",value:function(){return"Binary"}},{key:Symbol.toStringTag,get:function(){return"Binary"}}]),n}(j);t.Binary=z;var V=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.apply(this,arguments)}return w(n,[{key:"typeId",get:function(){return f.Type.Utf8}},{key:Symbol.toStringTag,get:function(){return"Utf8"}},{key:"toString",value:function(){return"Utf8"}}]),n}(j);t.Utf8=V;var Y={DAY:0,MILLISECOND:1};a=Symbol.toStringTag;var J=function(e){y(n,e);var t=p(n);function n(e){var r;return g(this,n),h(m(r=t.call(this)),"unit",void 0),r.unit=e,r}return w(n,[{key:"typeId",get:function(){return f.Type.Date}},{key:a,get:function(){return"Date"}},{key:"toString",value:function(){return"Date".concat(32*(this.unit+1),"<").concat(Y[this.unit],">")}}]),n}(j);t.Date=J;var q=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,Y.DAY)}return n}(J);t.DateDay=q;var W=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,Y.MILLISECOND)}return n}(J);t.DateMillisecond=W;var G={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9};u=Symbol.toStringTag;var $=function(e){y(n,e);var t=p(n);function n(e,r){var i;return g(this,n),h(m(i=t.call(this)),"unit",void 0),h(m(i),"bitWidth",void 0),i.unit=e,i.bitWidth=r,i}return w(n,[{key:"typeId",get:function(){return f.Type.Time}},{key:"toString",value:function(){return"Time".concat(this.bitWidth,"<").concat(G[this.unit],">")}},{key:u,get:function(){return"Time"}}]),n}(j);t.Time=$;var X=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,G.SECOND,32)}return n}($);t.TimeSecond=X;var H=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,G.MILLISECOND,32)}return n}($);t.TimeMillisecond=H,s=Symbol.toStringTag;var Q=function(e){y(n,e);var t=p(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return g(this,n),h(m(r=t.call(this)),"unit",void 0),h(m(r),"timezone",void 0),r.unit=e,r.timezone=i,r}return w(n,[{key:"typeId",get:function(){return f.Type.Timestamp}},{key:s,get:function(){return"Timestamp"}},{key:"toString",value:function(){return"Timestamp<".concat(G[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}}]),n}(j);t.Timestamp=Q;var K=function(e){y(n,e);var t=p(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return g(this,n),t.call(this,G.SECOND,e)}return n}(Q);t.TimestampSecond=K;var Z=function(e){y(n,e);var t=p(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return g(this,n),t.call(this,G.MILLISECOND,e)}return n}(Q);t.TimestampMillisecond=Z;var ee=function(e){y(n,e);var t=p(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return g(this,n),t.call(this,G.MICROSECOND,e)}return n}(Q);t.TimestampMicrosecond=ee;var te=function(e){y(n,e);var t=p(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return g(this,n),t.call(this,G.NANOSECOND,e)}return n}(Q);t.TimestampNanosecond=te;var ne={DAY_TIME:0,YEAR_MONTH:1};l=Symbol.toStringTag;var re=function(e){y(n,e);var t=p(n);function n(e){var r;return g(this,n),h(m(r=t.call(this)),"unit",void 0),r.unit=e,r}return w(n,[{key:"typeId",get:function(){return f.Type.Interval}},{key:l,get:function(){return"Interval"}},{key:"toString",value:function(){return"Interval<".concat(ne[this.unit],">")}}]),n}(j);t.Interval=re;var ie=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,ne.DAY_TIME)}return n}(re);t.IntervalDayTime=ie;var oe=function(e){y(n,e);var t=p(n);function n(){return g(this,n),t.call(this,ne.YEAR_MONTH)}return n}(re);t.IntervalYearMonth=oe,c=Symbol.toStringTag;var ae=function(e){y(n,e);var t=p(n);function n(e,r){var i;return g(this,n),h(m(i=t.call(this)),"listSize",void 0),h(m(i),"children",void 0),i.listSize=e,i.children=[r],i}return w(n,[{key:"typeId",get:function(){return f.Type.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:c,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}]),n}(j);t.FixedSizeList=ae},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.Type=void 0,t.Type=r,function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"}(r||(t.Type=r={}))},function(e,t,n){"use strict";function r(e){return e instanceof Date?Date:e instanceof Number?Float32Array:"string"==typeof e?String:null}Object.defineProperty(t,"__esModule",{value:!0}),t.deduceTableSchema=function(e,t){var n=Array.isArray(e)?function(e){var t={};if(e.length){var n=e[0];for(var i in n){var o=n[i];t[i]=r(o)}}return t}(e):function(e){var t={};for(var n in e){var i=e[n];if(ArrayBuffer.isView(i))t[n]=i.constructor;else if(i.length){var o=i[0];t[n]=r(o)}t[n]=t[n]||null}return t}(e);return Object.assign(n,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTypeInfo=function(e){return{typeId:e.typeId,ArrayType:e.ArrayType,typeName:e.toString(),typeEnumName:o(e.typeId),precision:e.precision}};var r=n(0);var i=null;function o(e){if(!i)for(var t in i={},r.Type)i[r.Type[t]]=t;return i[e]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getArrowTypeFromTypedArray=function(e){switch(e.constructor){case Int8Array:return new r.Int8;case Uint8Array:return new r.Uint8;case Int16Array:return new r.Int16;case Uint16Array:return new r.Uint16;case Int32Array:return new r.Int32;case Uint32Array:return new r.Uint32;case Float32Array:return new r.Float32;case Float64Array:return new r.Float64;default:throw new Error("array type not supported")}};var r=n(0)},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i;function o(e,t,n,r,i,o,a){try{var u=e[o](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function u(e){o(a,r,i,u,s,"next",e)}function s(e){o(a,r,i,u,s,"throw",e)}u(void 0)}))}}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function f(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){var t="function"==typeof Map?new Map:void 0;return(h=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return y(e,arguments,v(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,e)})(e)}function y(e,t,n){return(y=d()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&p(i,n.prototype),i}).apply(null,arguments)}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.takeAsync=function(e){return g.apply(this,arguments)},t.default=void 0;var m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(i,e);var t,n,r=(t=i,n=d(),function(){var e,r=v(t);if(n){var i=v(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return f(this,e)});function i(){return s(this,i),r.apply(this,arguments)}return c(i,[{key:"enqueue",value:function(e){return this.push(e)}},{key:"dequeue",value:function(){return this.shift()}}]),i}(h(Array));i=Symbol.asyncIterator;var b=function(){function e(){s(this,e),u(this,"_values",void 0),u(this,"_settlers",void 0),u(this,"_closed",void 0),this._values=new m,this._settlers=new m,this._closed=!1}return c(e,[{key:"close",value:function(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}},{key:i,value:function(){return this}},{key:"enqueue",value:function(e){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");var t=this._settlers.dequeue();e instanceof Error?t.reject(e):t.resolve({value:e})}else this._values.enqueue(e)}},{key:"next",value:function(){var e=this;if(this._values.length>0){var t=this._values.dequeue();return t instanceof Error?Promise.reject(t):Promise.resolve({value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise((function(t,n){e._settlers.enqueue({resolve:t,reject:n})}))}}]),e}();function g(){return(g=a(regeneratorRuntime.mark((function e(t){var n,r,i,o,a,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=u.length>1&&void 0!==u[1]?u[1]:1/0,r=[],i=t[Symbol.asyncIterator]();case 3:if(!(r.length<n)){e.next=14;break}return e.next=6,i.next();case 6:if(o=e.sent,a=o.value,!o.done){e.next=11;break}return e.abrupt("break",14);case 11:r.push(a),e.next=3;break;case 14:return e.abrupt("return",r);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.default=b},function(e,t,n){"use strict";function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){s=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=/^[og]\s*(.+)?/,l=/^mtllib /,c=/^usemtl /,f=function(){function e(t){var n=t.index,r=t.name,i=void 0===r?"":r,a=t.mtllib,u=t.smooth,s=t.groupStart;o(this,e),this.index=n,this.name=i,this.mtllib=a,this.smooth=u,this.groupStart=s,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}return u(e,[{key:"clone",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.index;return new e({index:t,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}]),e}(),h=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o(this,e),this.name=t,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0,this.fromDeclaration=null}return u(e,[{key:"startMaterial",value:function(e,t){var n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);var r=new f({index:this.materials.length,name:e,mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==n?n.smooth:this.smooth,groupStart:void 0!==n?n.groupEnd:0});return this.materials.push(r),r}},{key:"currentMaterial",value:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]}},{key:"_finalize",value:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var n=this.materials.length-1;n>=0;n--)this.materials[n].groupCount<=0&&this.materials.splice(n,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}}]),e}(),y=function(){function e(){o(this,e),this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}return u(e,[{key:"startObject",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.object&&!this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=t);var n=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object=new h(e),this.object.fromDeclaration=t,n&&n.name&&"function"==typeof n.clone){var r=n.clone(0);r.inherited=!0,this.object.materials.push(r)}this.objects.push(this.object)}},{key:"finalize",value:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)}},{key:"parseVertexIndex",value:function(e,t){var n=parseInt(e);return 3*(n>=0?n-1:n+t/3)}},{key:"parseNormalIndex",value:function(e,t){var n=parseInt(e);return 3*(n>=0?n-1:n+t/3)}},{key:"parseUVIndex",value:function(e,t){var n=parseInt(e);return 2*(n>=0?n-1:n+t/2)}},{key:"addVertex",value:function(e,t,n){var r=this.vertices,i=this.object.geometry.vertices;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])}},{key:"addVertexPoint",value:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])}},{key:"addVertexLine",value:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])}},{key:"addNormal",value:function(e,t,n){var r=this.normals,i=this.object.geometry.normals;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])}},{key:"addColor",value:function(e,t,n){var r=this.colors,i=this.object.geometry.colors;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])}},{key:"addUV",value:function(e,t,n){var r=this.uvs,i=this.object.geometry.uvs;i.push(r[e+0],r[e+1]),i.push(r[t+0],r[t+1]),i.push(r[n+0],r[n+1])}},{key:"addUVLine",value:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])}},{key:"addFace",value:function(e,t,n,r,i,o,a,u,s){var l=this.vertices.length,c=this.parseVertexIndex(e,l),f=this.parseVertexIndex(t,l),h=this.parseVertexIndex(n,l);if(this.addVertex(c,f,h),void 0!==r&&""!==r){var y=this.uvs.length;c=this.parseUVIndex(r,y),f=this.parseUVIndex(i,y),h=this.parseUVIndex(o,y),this.addUV(c,f,h)}if(void 0!==a&&""!==a){var d=this.normals.length;c=this.parseNormalIndex(a,d),f=a===u?c:this.parseNormalIndex(u,d),h=a===s?c:this.parseNormalIndex(s,d),this.addNormal(c,f,h)}this.colors.length>0&&this.addColor(c,f,h)}},{key:"addPointGeometry",value:function(e){this.object.geometry.type="Points";var t,n=this.vertices.length,i=r(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;this.addVertexPoint(this.parseVertexIndex(o,n))}}catch(e){i.e(e)}finally{i.f()}}},{key:"addLineGeometry",value:function(e,t){this.object.geometry.type="Line";var n,i=this.vertices.length,o=this.uvs.length,a=r(e);try{for(a.s();!(n=a.n()).done;){var u=n.value;this.addVertexLine(this.parseVertexIndex(u,i))}}catch(e){a.e(e)}finally{a.f()}var s,l=r(t);try{for(l.s();!(s=l.n()).done;){var c=s.value;this.addUVLine(this.parseUVIndex(c,o))}}catch(e){l.e(e)}finally{l.f()}}}]),e}();t.default=function(e){var t=new y;-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n")),-1!==e.indexOf("\\\n")&&(e=e.replace(/\\\n/g,""));for(var n=e.split("\n"),i="",o="",a=[],u="function"==typeof"".trimLeft,f=0,h=n.length;f<h;f++)if(i=n[f],0!==(i=u?i.trimLeft():i.trim()).length&&"#"!==(o=i.charAt(0)))if("v"===o){var d=i.split(/\s+/);switch(d[0]){case"v":t.vertices.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])),8===d.length&&t.colors.push(parseFloat(d[4]),parseFloat(d[5]),parseFloat(d[6]));break;case"vn":t.normals.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));break;case"vt":t.uvs.push(parseFloat(d[1]),parseFloat(d[2]))}}else if("f"===o){for(var p=i.substr(1).trim().split(/\s+/),v=[],m=0,b=p.length;m<b;m++){var g=p[m];if(g.length>0){var O=g.split("/");v.push(O)}}for(var w=v[0],j=1,T=v.length-1;j<T;j++){var I=v[j],P=v[j+1];t.addFace(w[0],I[0],P[0],w[1],I[1],P[1],w[2],I[2],P[2])}}else if("l"===o){var S=i.substring(1).trim().split(" "),k=void 0,_=[];if(-1===i.indexOf("/"))k=S;else{k=[];for(var M=0,A=S.length;M<A;M++){var F=S[M].split("/");""!==F[0]&&k.push(F[0]),""!==F[1]&&_.push(F[1])}}t.addLineGeometry(k,_)}else if("p"===o){var x=i.substr(1).trim().split(" ");t.addPointGeometry(x)}else if(null!==(a=s.exec(i))){var B=(" "+a[0].substr(1).trim()).substr(1);t.startObject(B)}else if(c.test(i))t.object.startMaterial(i.substring(7).trim(),t.materialLibraries);else if(l.test(i))t.materialLibraries.push(i.substring(7).trim());else{if("s"!==o){if("\0"===i)continue;throw new Error('Unexpected line: "'.concat(i,'"'))}if((a=i.split(" ")).length>1){var D=a[1].trim().toLowerCase();t.object.smooth="0"!==D&&"off"!==D}else t.object.smooth=!0;var U=t.object.currentMaterial();U&&(U.smooth=t.object.smooth)}t.finalize();var E,N=[],R=[],C=r(t.objects);try{for(C.s();!(E=C.n()).done;){var L=E.value,z=L.geometry;if(0!==z.vertices.length){var V={header:{vertexCount:z.vertices.length/3},attributes:{}};switch(z.type){case"Points":V.mode=0;break;case"Line":V.mode=1;break;default:V.mode=4}V.attributes.POSITION={value:new Float32Array(z.vertices),size:3},z.normals.length>0&&(V.attributes.NORMAL={value:new Float32Array(z.normals),size:3}),z.colors.length>0&&(V.attributes.COLOR_0={value:new Float32Array(z.colors),size:3}),z.uvs.length>0&&(V.attributes.TEXCOORD_0={value:new Float32Array(z.uvs),size:2}),V.materials=[];var Y,J=r(L.materials);try{for(J.s();!(Y=J.n()).done;){var q=Y.value,W={name:q.name,flatShading:!q.smooth};V.materials.push(W),R.push(W)}}catch(e){J.e(e)}finally{J.f()}V.name=L.name,N.push(V)}}}catch(e){C.e(e)}finally{C.f()}return{meshes:N,materials:R}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeSchemaFromAttributes=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var o in n)t=t||new Map,"value"!==o&&t.set(o,JSON.stringify(n[o]));var a=[];for(var u in e){var s=e[u],l=i(u,s);a.push(l)}return new r.Schema(a,t)};var r=n(1);function i(e,t){var n=new Map;for(var i in t)"value"!==i&&n.set(i,JSON.stringify(t[i]));var o=(0,r.getArrowTypeFromTypedArray)(t.value);return!("size"in t)||1===t.size?new r.Field(e,o,!1,n):new r.Field(e,new r.FixedSizeList(t.size,new r.Field("value",o)),!1,n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._typecheckOBJLoader=t.OBJLoader=void 0;var r={name:"OBJ",id:"obj",module:"obj",version:"3.0.13",worker:!0,extensions:["obj"],mimeTypes:["text/plain"],testText:function(e){return"v"===e[0]},options:{obj:{}}};t.OBJLoader=r;var i=r;t._typecheckOBJLoader=i}]);
|
|
2
2
|
//# sourceMappingURL=dist.es5.min.js.map
|