@loaders.gl/obj 3.0.12 → 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.min.js +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/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.12",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
|
package/dist/dist.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var s=e();for(var i in s)("object"==typeof exports?exports:t)[i]=s[i]}}(window,(function(){return function(t){var e={};function s(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}return s.m=t,s.c=e,s.d=function(t,e,i){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)s.d(i,n,function(e){return t[e]}.bind(null,n));return i},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=0)}([function(t,e,s){(function(e){const i=s(3),n="undefined"==typeof window?e:window;n.loaders=n.loaders||{},t.exports=Object.assign(n.loaders,i)}).call(this,s(2))},,function(t,e){var s;s=function(){return this}();try{s=s||new Function("return this")()}catch(t){"object"==typeof window&&(s=window)}t.exports=s},function(t,e,s){"use strict";function i(t){let e=1/0,s=1/0,i=1/0,n=-1/0,r=-1/0,o=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let t=0;t<l;t+=3){const l=a[t],c=a[t+1],u=a[t+2];e=l<e?l:e,s=c<s?c:s,i=u<i?u:i,n=l>n?l:n,r=c>r?c:r,o=u>o?u:o}return[[e,s,i],[n,r,o]]}s.r(e),s.d(e,"OBJWorkerLoader",(function(){return E})),s.d(e,"OBJLoader",(function(){return R})),s.d(e,"_typecheckOBJLoader",(function(){return $}));const n=/^[og]\s*(.+)?/,r=/^mtllib /,o=/^usemtl /;class a{constructor({index:t,name:e="",mtllib:s,smooth:i,groupStart:n}){this.index=t,this.name=e,this.mtllib=s,this.smooth=i,this.groupStart=n,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}clone(t=this.index){return new a({index:t,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}class l{constructor(t=""){this.name=t,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0,this.fromDeclaration=null}startMaterial(t,e){const s=this._finalize(!1);s&&(s.inherited||s.groupCount<=0)&&this.materials.splice(s.index,1);const i=new a({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==s?s.smooth:this.smooth,groupStart:void 0!==s?s.groupEnd:0});return this.materials.push(i),i}currentMaterial(){if(this.materials.length>0)return this.materials[this.materials.length-1]}_finalize(t){const e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(let t=this.materials.length-1;t>=0;t--)this.materials[t].groupCount<=0&&this.materials.splice(t,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}}class c{constructor(){this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}startObject(t,e=!0){if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);const s=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 l(t),this.object.fromDeclaration=e,s&&s.name&&"function"==typeof s.clone){const t=s.clone(0);t.inherited=!0,this.object.materials.push(t)}this.objects.push(this.object)}finalize(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)}parseVertexIndex(t,e){const s=parseInt(t);return 3*(s>=0?s-1:s+e/3)}parseNormalIndex(t,e){const s=parseInt(t);return 3*(s>=0?s-1:s+e/3)}parseUVIndex(t,e){const s=parseInt(t);return 2*(s>=0?s-1:s+e/2)}addVertex(t,e,s){const i=this.vertices,n=this.object.geometry.vertices;n.push(i[t+0],i[t+1],i[t+2]),n.push(i[e+0],i[e+1],i[e+2]),n.push(i[s+0],i[s+1],i[s+2])}addVertexPoint(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}addVertexLine(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}addNormal(t,e,s){const i=this.normals,n=this.object.geometry.normals;n.push(i[t+0],i[t+1],i[t+2]),n.push(i[e+0],i[e+1],i[e+2]),n.push(i[s+0],i[s+1],i[s+2])}addColor(t,e,s){const i=this.colors,n=this.object.geometry.colors;n.push(i[t+0],i[t+1],i[t+2]),n.push(i[e+0],i[e+1],i[e+2]),n.push(i[s+0],i[s+1],i[s+2])}addUV(t,e,s){const i=this.uvs,n=this.object.geometry.uvs;n.push(i[t+0],i[t+1]),n.push(i[e+0],i[e+1]),n.push(i[s+0],i[s+1])}addUVLine(t){const e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}addFace(t,e,s,i,n,r,o,a,l){const c=this.vertices.length;let u=this.parseVertexIndex(t,c),h=this.parseVertexIndex(e,c),d=this.parseVertexIndex(s,c);if(this.addVertex(u,h,d),void 0!==i&&""!==i){const t=this.uvs.length;u=this.parseUVIndex(i,t),h=this.parseUVIndex(n,t),d=this.parseUVIndex(r,t),this.addUV(u,h,d)}if(void 0!==o&&""!==o){const t=this.normals.length;u=this.parseNormalIndex(o,t),h=o===a?u:this.parseNormalIndex(a,t),d=o===l?u:this.parseNormalIndex(l,t),this.addNormal(u,h,d)}this.colors.length>0&&this.addColor(u,h,d)}addPointGeometry(t){this.object.geometry.type="Points";const e=this.vertices.length;for(const s of t)this.addVertexPoint(this.parseVertexIndex(s,e))}addLineGeometry(t,e){this.object.geometry.type="Line";const s=this.vertices.length,i=this.uvs.length;for(const e of t)this.addVertexLine(this.parseVertexIndex(e,s));for(const t of e)this.addUVLine(this.parseUVIndex(t,i))}}function u(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class h{constructor(t,e){u(this,"fields",void 0),u(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(t)),function(t){const e={};for(const s of t)e[s.name]&&console.warn("Schema: duplicated field name",s.name,s),e[s.name]=!0}(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(...t){const e=Object.create(null);for(const s of t)e[s]=!0;const s=this.fields.filter(t=>e[t.name]);return new h(s,this.metadata)}selectAt(...t){const e=t.map(t=>this.fields[t]).filter(Boolean);return new h(e,this.metadata)}assign(t){let e,s=this.metadata;if(t instanceof h){const i=t;e=i.fields,s=d(d(new Map,this.metadata),i.metadata)}else e=t;const i=Object.create(null);for(const t of this.fields)i[t.name]=t;for(const t of e)i[t.name]=t;const n=Object.values(i);return new h(n,s)}}function d(t,e){return new Map([...t||new Map,...e||new Map])}let p,m,f,y,b,g,v,x;function I(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(p||(p={}));class S{static isNull(t){return t&&t.typeId===p.Null}static isInt(t){return t&&t.typeId===p.Int}static isFloat(t){return t&&t.typeId===p.Float}static isBinary(t){return t&&t.typeId===p.Binary}static isUtf8(t){return t&&t.typeId===p.Utf8}static isBool(t){return t&&t.typeId===p.Bool}static isDecimal(t){return t&&t.typeId===p.Decimal}static isDate(t){return t&&t.typeId===p.Date}static isTime(t){return t&&t.typeId===p.Time}static isTimestamp(t){return t&&t.typeId===p.Timestamp}static isInterval(t){return t&&t.typeId===p.Interval}static isList(t){return t&&t.typeId===p.List}static isStruct(t){return t&&t.typeId===p.Struct}static isUnion(t){return t&&t.typeId===p.Union}static isFixedSizeBinary(t){return t&&t.typeId===p.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===p.FixedSizeList}static isMap(t){return t&&t.typeId===p.Map}static isDictionary(t){return t&&t.typeId===p.Dictionary}get typeId(){return p.NONE}compareTo(t){return this===t}}Symbol.toStringTag;Symbol.toStringTag;m=Symbol.toStringTag;class w extends S{constructor(t,e){super(),I(this,"isSigned",void 0),I(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return p.Int}get[m](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class j extends w{constructor(){super(!0,8)}}class T extends w{constructor(){super(!0,16)}}class O extends w{constructor(){super(!0,32)}}class F extends w{constructor(){super(!1,8)}}class M extends w{constructor(){super(!1,16)}}class L extends w{constructor(){super(!1,32)}}const U=32,z=64;f=Symbol.toStringTag;class D extends S{constructor(t){super(),I(this,"precision",void 0),this.precision=t}get typeId(){return p.Float}get[f](){return"Float"}toString(){return"Float"+this.precision}}class N extends D{constructor(){super(U)}}class A extends D{constructor(){super(z)}}Symbol.toStringTag;Symbol.toStringTag;y=Symbol.toStringTag;b=Symbol.toStringTag;g=Symbol.toStringTag;v=Symbol.toStringTag;x=Symbol.toStringTag;class V extends S{constructor(t,e){super(),I(this,"listSize",void 0),I(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return p.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[x](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}function B(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class P{constructor(t,e,s=!1,i=new Map){B(this,"name",void 0),B(this,"type",void 0),B(this,"nullable",void 0),B(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=s,this.metadata=i}get typeId(){return this.type&&this.type.typeId}clone(){return new P(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?", metadata: "+this.metadata:""}`}}function _(t,e){const s=new Map;for(const t in e)"value"!==t&&s.set(t,JSON.stringify(e[t]));const i=function(t){switch(t.constructor){case Int8Array:return new j;case Uint8Array:return new F;case Int16Array:return new T;case Uint16Array:return new M;case Int32Array:return new O;case Uint32Array:return new L;case Float32Array:return new N;case Float64Array:return new A;default:throw new Error("array type not supported")}}(e.value),n=!("size"in e)||1===e.size;return new P(t,n?i:new V(e.size,new P("value",i)),!1,s)}function C(t,e){const{meshes:s}=(t=>{const e=new c;-1!==t.indexOf("\r\n")&&(t=t.replace(/\r\n/g,"\n")),-1!==t.indexOf("\\\n")&&(t=t.replace(/\\\n/g,""));const s=t.split("\n");let i="",a="",l=0,u=[];const h="function"==typeof"".trimLeft;for(let t=0,c=s.length;t<c;t++)if(i=s[t],i=h?i.trimLeft():i.trim(),l=i.length,0!==l&&(a=i.charAt(0),"#"!==a))if("v"===a){const t=i.split(/\s+/);switch(t[0]){case"v":e.vertices.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),8===t.length&&e.colors.push(parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]));break;case"vn":e.normals.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]));break;case"vt":e.uvs.push(parseFloat(t[1]),parseFloat(t[2]))}}else if("f"===a){const t=i.substr(1).trim().split(/\s+/),s=[];for(let e=0,i=t.length;e<i;e++){const i=t[e];if(i.length>0){const t=i.split("/");s.push(t)}}const n=s[0];for(let t=1,i=s.length-1;t<i;t++){const i=s[t],r=s[t+1];e.addFace(n[0],i[0],r[0],n[1],i[1],r[1],n[2],i[2],r[2])}}else if("l"===a){const t=i.substring(1).trim().split(" ");let s;const n=[];if(-1===i.indexOf("/"))s=t;else{s=[];for(let e=0,i=t.length;e<i;e++){const i=t[e].split("/");""!==i[0]&&s.push(i[0]),""!==i[1]&&n.push(i[1])}}e.addLineGeometry(s,n)}else if("p"===a){const t=i.substr(1).trim().split(" ");e.addPointGeometry(t)}else if(null!==(u=n.exec(i))){const t=(" "+u[0].substr(1).trim()).substr(1);e.startObject(t)}else if(o.test(i))e.object.startMaterial(i.substring(7).trim(),e.materialLibraries);else if(r.test(i))e.materialLibraries.push(i.substring(7).trim());else{if("s"!==a){if("\0"===i)continue;throw new Error(`Unexpected line: "${i}"`)}{if(u=i.split(" "),u.length>1){const t=u[1].trim().toLowerCase();e.object.smooth="0"!==t&&"off"!==t}else e.object.smooth=!0;const t=e.object.currentMaterial();t&&(t.smooth=e.object.smooth)}}e.finalize();const d=[],p=[];for(const t of e.objects){const{geometry:e}=t;if(0===e.vertices.length)continue;const s={header:{vertexCount:e.vertices.length/3},attributes:{}};switch(e.type){case"Points":s.mode=0;break;case"Line":s.mode=1;break;default:s.mode=4}s.attributes.POSITION={value:new Float32Array(e.vertices),size:3},e.normals.length>0&&(s.attributes.NORMAL={value:new Float32Array(e.normals),size:3}),e.colors.length>0&&(s.attributes.COLOR_0={value:new Float32Array(e.colors),size:3}),e.uvs.length>0&&(s.attributes.TEXCOORD_0={value:new Float32Array(e.uvs),size:2}),s.materials=[];for(const e of t.materials){const t={name:e.name,flatShading:!e.smooth};s.materials.push(t),p.push(t)}s.name=t.name,d.push(s)}return{meshes:d,materials:p}})(t),a=s.reduce((t,e)=>t+e.header.vertexCount,0),l=function(t,e){const s=new Float32Array(3*e);let i,n,r,o=0;for(const a of t){const{POSITION:t,NORMAL:l,COLOR_0:c,TEXCOORD_0:u}=a.attributes;s.set(t.value,3*o),l&&(i=i||new Float32Array(3*e),i.set(l.value,3*o)),c&&(n=n||new Float32Array(3*e),n.set(c.value,3*o)),u&&(r=r||new Float32Array(2*e),r.set(u.value,2*o)),o+=t.value.length/3}const a={};a.POSITION={value:s,size:3},i&&(a.NORMAL={value:i,size:3});n&&(a.COLOR_0={value:n,size:3});r&&(a.TEXCOORD_0={value:r,size:2});return a}(s,a),u={vertexCount:a,boundingBox:i(l)};return{loaderData:{header:{}},schema:function(t,e={}){let s;for(const t in e)s=s||new Map,"value"!==t&&s.set(t,JSON.stringify(e[t]));const i=[];for(const e in t){const s=_(e,t[e]);i.push(s)}return new h(i,s)}(l,{mode:4,boundingBox:u.boundingBox}),header:u,mode:4,attributes:l}}const E={name:"OBJ",id:"obj",module:"obj",version:"3.0.12",worker:!0,extensions:["obj"],mimeTypes:["text/plain"],testText:function(t){return"v"===t[0]},options:{obj:{}}};const R={...E,parse:async(t,e)=>C((new TextDecoder).decode(t)),parseTextSync:C},$=R}])}));
|
|
1
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var s=e();for(var i in s)("object"==typeof exports?exports:t)[i]=s[i]}}(window,(function(){return function(t){var e={};function s(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}return s.m=t,s.c=e,s.d=function(t,e,i){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)s.d(i,n,function(e){return t[e]}.bind(null,n));return i},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=0)}([function(t,e,s){(function(e){const i=s(3),n="undefined"==typeof window?e:window;n.loaders=n.loaders||{},t.exports=Object.assign(n.loaders,i)}).call(this,s(2))},,function(t,e){var s;s=function(){return this}();try{s=s||new Function("return this")()}catch(t){"object"==typeof window&&(s=window)}t.exports=s},function(t,e,s){"use strict";function i(t){let e=1/0,s=1/0,i=1/0,n=-1/0,r=-1/0,o=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let t=0;t<l;t+=3){const l=a[t],c=a[t+1],u=a[t+2];e=l<e?l:e,s=c<s?c:s,i=u<i?u:i,n=l>n?l:n,r=c>r?c:r,o=u>o?u:o}return[[e,s,i],[n,r,o]]}s.r(e),s.d(e,"OBJWorkerLoader",(function(){return E})),s.d(e,"OBJLoader",(function(){return R})),s.d(e,"_typecheckOBJLoader",(function(){return $}));const n=/^[og]\s*(.+)?/,r=/^mtllib /,o=/^usemtl /;class a{constructor({index:t,name:e="",mtllib:s,smooth:i,groupStart:n}){this.index=t,this.name=e,this.mtllib=s,this.smooth=i,this.groupStart=n,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}clone(t=this.index){return new a({index:t,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}}class l{constructor(t=""){this.name=t,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0,this.fromDeclaration=null}startMaterial(t,e){const s=this._finalize(!1);s&&(s.inherited||s.groupCount<=0)&&this.materials.splice(s.index,1);const i=new a({index:this.materials.length,name:t,mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==s?s.smooth:this.smooth,groupStart:void 0!==s?s.groupEnd:0});return this.materials.push(i),i}currentMaterial(){if(this.materials.length>0)return this.materials[this.materials.length-1]}_finalize(t){const e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(let t=this.materials.length-1;t>=0;t--)this.materials[t].groupCount<=0&&this.materials.splice(t,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}}class c{constructor(){this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}startObject(t,e=!0){if(this.object&&!this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=e);const s=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 l(t),this.object.fromDeclaration=e,s&&s.name&&"function"==typeof s.clone){const t=s.clone(0);t.inherited=!0,this.object.materials.push(t)}this.objects.push(this.object)}finalize(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)}parseVertexIndex(t,e){const s=parseInt(t);return 3*(s>=0?s-1:s+e/3)}parseNormalIndex(t,e){const s=parseInt(t);return 3*(s>=0?s-1:s+e/3)}parseUVIndex(t,e){const s=parseInt(t);return 2*(s>=0?s-1:s+e/2)}addVertex(t,e,s){const i=this.vertices,n=this.object.geometry.vertices;n.push(i[t+0],i[t+1],i[t+2]),n.push(i[e+0],i[e+1],i[e+2]),n.push(i[s+0],i[s+1],i[s+2])}addVertexPoint(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}addVertexLine(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])}addNormal(t,e,s){const i=this.normals,n=this.object.geometry.normals;n.push(i[t+0],i[t+1],i[t+2]),n.push(i[e+0],i[e+1],i[e+2]),n.push(i[s+0],i[s+1],i[s+2])}addColor(t,e,s){const i=this.colors,n=this.object.geometry.colors;n.push(i[t+0],i[t+1],i[t+2]),n.push(i[e+0],i[e+1],i[e+2]),n.push(i[s+0],i[s+1],i[s+2])}addUV(t,e,s){const i=this.uvs,n=this.object.geometry.uvs;n.push(i[t+0],i[t+1]),n.push(i[e+0],i[e+1]),n.push(i[s+0],i[s+1])}addUVLine(t){const e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])}addFace(t,e,s,i,n,r,o,a,l){const c=this.vertices.length;let u=this.parseVertexIndex(t,c),h=this.parseVertexIndex(e,c),d=this.parseVertexIndex(s,c);if(this.addVertex(u,h,d),void 0!==i&&""!==i){const t=this.uvs.length;u=this.parseUVIndex(i,t),h=this.parseUVIndex(n,t),d=this.parseUVIndex(r,t),this.addUV(u,h,d)}if(void 0!==o&&""!==o){const t=this.normals.length;u=this.parseNormalIndex(o,t),h=o===a?u:this.parseNormalIndex(a,t),d=o===l?u:this.parseNormalIndex(l,t),this.addNormal(u,h,d)}this.colors.length>0&&this.addColor(u,h,d)}addPointGeometry(t){this.object.geometry.type="Points";const e=this.vertices.length;for(const s of t)this.addVertexPoint(this.parseVertexIndex(s,e))}addLineGeometry(t,e){this.object.geometry.type="Line";const s=this.vertices.length,i=this.uvs.length;for(const e of t)this.addVertexLine(this.parseVertexIndex(e,s));for(const t of e)this.addUVLine(this.parseUVIndex(t,i))}}function u(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class h{constructor(t,e){u(this,"fields",void 0),u(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(t)),function(t){const e={};for(const s of t)e[s.name]&&console.warn("Schema: duplicated field name",s.name,s),e[s.name]=!0}(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(...t){const e=Object.create(null);for(const s of t)e[s]=!0;const s=this.fields.filter(t=>e[t.name]);return new h(s,this.metadata)}selectAt(...t){const e=t.map(t=>this.fields[t]).filter(Boolean);return new h(e,this.metadata)}assign(t){let e,s=this.metadata;if(t instanceof h){const i=t;e=i.fields,s=d(d(new Map,this.metadata),i.metadata)}else e=t;const i=Object.create(null);for(const t of this.fields)i[t.name]=t;for(const t of e)i[t.name]=t;const n=Object.values(i);return new h(n,s)}}function d(t,e){return new Map([...t||new Map,...e||new Map])}let p,m,f,y,b,g,v,x;function I(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(p||(p={}));class S{static isNull(t){return t&&t.typeId===p.Null}static isInt(t){return t&&t.typeId===p.Int}static isFloat(t){return t&&t.typeId===p.Float}static isBinary(t){return t&&t.typeId===p.Binary}static isUtf8(t){return t&&t.typeId===p.Utf8}static isBool(t){return t&&t.typeId===p.Bool}static isDecimal(t){return t&&t.typeId===p.Decimal}static isDate(t){return t&&t.typeId===p.Date}static isTime(t){return t&&t.typeId===p.Time}static isTimestamp(t){return t&&t.typeId===p.Timestamp}static isInterval(t){return t&&t.typeId===p.Interval}static isList(t){return t&&t.typeId===p.List}static isStruct(t){return t&&t.typeId===p.Struct}static isUnion(t){return t&&t.typeId===p.Union}static isFixedSizeBinary(t){return t&&t.typeId===p.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===p.FixedSizeList}static isMap(t){return t&&t.typeId===p.Map}static isDictionary(t){return t&&t.typeId===p.Dictionary}get typeId(){return p.NONE}compareTo(t){return this===t}}Symbol.toStringTag;Symbol.toStringTag;m=Symbol.toStringTag;class w extends S{constructor(t,e){super(),I(this,"isSigned",void 0),I(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return p.Int}get[m](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class j extends w{constructor(){super(!0,8)}}class T extends w{constructor(){super(!0,16)}}class O extends w{constructor(){super(!0,32)}}class F extends w{constructor(){super(!1,8)}}class M extends w{constructor(){super(!1,16)}}class L extends w{constructor(){super(!1,32)}}const U=32,z=64;f=Symbol.toStringTag;class D extends S{constructor(t){super(),I(this,"precision",void 0),this.precision=t}get typeId(){return p.Float}get[f](){return"Float"}toString(){return"Float"+this.precision}}class N extends D{constructor(){super(U)}}class A extends D{constructor(){super(z)}}Symbol.toStringTag;Symbol.toStringTag;y=Symbol.toStringTag;b=Symbol.toStringTag;g=Symbol.toStringTag;v=Symbol.toStringTag;x=Symbol.toStringTag;class V extends S{constructor(t,e){super(),I(this,"listSize",void 0),I(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return p.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[x](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}function B(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class P{constructor(t,e,s=!1,i=new Map){B(this,"name",void 0),B(this,"type",void 0),B(this,"nullable",void 0),B(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=s,this.metadata=i}get typeId(){return this.type&&this.type.typeId}clone(){return new P(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?", metadata: "+this.metadata:""}`}}function _(t,e){const s=new Map;for(const t in e)"value"!==t&&s.set(t,JSON.stringify(e[t]));const i=function(t){switch(t.constructor){case Int8Array:return new j;case Uint8Array:return new F;case Int16Array:return new T;case Uint16Array:return new M;case Int32Array:return new O;case Uint32Array:return new L;case Float32Array:return new N;case Float64Array:return new A;default:throw new Error("array type not supported")}}(e.value),n=!("size"in e)||1===e.size;return new P(t,n?i:new V(e.size,new P("value",i)),!1,s)}function C(t,e){const{meshes:s}=(t=>{const e=new c;-1!==t.indexOf("\r\n")&&(t=t.replace(/\r\n/g,"\n")),-1!==t.indexOf("\\\n")&&(t=t.replace(/\\\n/g,""));const s=t.split("\n");let i="",a="",l=0,u=[];const h="function"==typeof"".trimLeft;for(let t=0,c=s.length;t<c;t++)if(i=s[t],i=h?i.trimLeft():i.trim(),l=i.length,0!==l&&(a=i.charAt(0),"#"!==a))if("v"===a){const t=i.split(/\s+/);switch(t[0]){case"v":e.vertices.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),8===t.length&&e.colors.push(parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]));break;case"vn":e.normals.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]));break;case"vt":e.uvs.push(parseFloat(t[1]),parseFloat(t[2]))}}else if("f"===a){const t=i.substr(1).trim().split(/\s+/),s=[];for(let e=0,i=t.length;e<i;e++){const i=t[e];if(i.length>0){const t=i.split("/");s.push(t)}}const n=s[0];for(let t=1,i=s.length-1;t<i;t++){const i=s[t],r=s[t+1];e.addFace(n[0],i[0],r[0],n[1],i[1],r[1],n[2],i[2],r[2])}}else if("l"===a){const t=i.substring(1).trim().split(" ");let s;const n=[];if(-1===i.indexOf("/"))s=t;else{s=[];for(let e=0,i=t.length;e<i;e++){const i=t[e].split("/");""!==i[0]&&s.push(i[0]),""!==i[1]&&n.push(i[1])}}e.addLineGeometry(s,n)}else if("p"===a){const t=i.substr(1).trim().split(" ");e.addPointGeometry(t)}else if(null!==(u=n.exec(i))){const t=(" "+u[0].substr(1).trim()).substr(1);e.startObject(t)}else if(o.test(i))e.object.startMaterial(i.substring(7).trim(),e.materialLibraries);else if(r.test(i))e.materialLibraries.push(i.substring(7).trim());else{if("s"!==a){if("\0"===i)continue;throw new Error(`Unexpected line: "${i}"`)}{if(u=i.split(" "),u.length>1){const t=u[1].trim().toLowerCase();e.object.smooth="0"!==t&&"off"!==t}else e.object.smooth=!0;const t=e.object.currentMaterial();t&&(t.smooth=e.object.smooth)}}e.finalize();const d=[],p=[];for(const t of e.objects){const{geometry:e}=t;if(0===e.vertices.length)continue;const s={header:{vertexCount:e.vertices.length/3},attributes:{}};switch(e.type){case"Points":s.mode=0;break;case"Line":s.mode=1;break;default:s.mode=4}s.attributes.POSITION={value:new Float32Array(e.vertices),size:3},e.normals.length>0&&(s.attributes.NORMAL={value:new Float32Array(e.normals),size:3}),e.colors.length>0&&(s.attributes.COLOR_0={value:new Float32Array(e.colors),size:3}),e.uvs.length>0&&(s.attributes.TEXCOORD_0={value:new Float32Array(e.uvs),size:2}),s.materials=[];for(const e of t.materials){const t={name:e.name,flatShading:!e.smooth};s.materials.push(t),p.push(t)}s.name=t.name,d.push(s)}return{meshes:d,materials:p}})(t),a=s.reduce((t,e)=>t+e.header.vertexCount,0),l=function(t,e){const s=new Float32Array(3*e);let i,n,r,o=0;for(const a of t){const{POSITION:t,NORMAL:l,COLOR_0:c,TEXCOORD_0:u}=a.attributes;s.set(t.value,3*o),l&&(i=i||new Float32Array(3*e),i.set(l.value,3*o)),c&&(n=n||new Float32Array(3*e),n.set(c.value,3*o)),u&&(r=r||new Float32Array(2*e),r.set(u.value,2*o)),o+=t.value.length/3}const a={};a.POSITION={value:s,size:3},i&&(a.NORMAL={value:i,size:3});n&&(a.COLOR_0={value:n,size:3});r&&(a.TEXCOORD_0={value:r,size:2});return a}(s,a),u={vertexCount:a,boundingBox:i(l)};return{loaderData:{header:{}},schema:function(t,e={}){let s;for(const t in e)s=s||new Map,"value"!==t&&s.set(t,JSON.stringify(e[t]));const i=[];for(const e in t){const s=_(e,t[e]);i.push(s)}return new h(i,s)}(l,{mode:4,boundingBox:u.boundingBox}),header:u,mode:4,attributes:l}}const E={name:"OBJ",id:"obj",module:"obj",version:"3.0.13",worker:!0,extensions:["obj"],mimeTypes:["text/plain"],testText:function(t){return"v"===t[0]},options:{obj:{}}};const R={...E,parse:async(t,e)=>C((new TextDecoder).decode(t)),parseTextSync:C},$=R}])}));
|
|
2
2
|
//# sourceMappingURL=dist.min.js.map
|
package/dist/es5/bundle.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const moduleExports = require('./index');
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const _global = typeof window === 'undefined' ? global : window;
|
|
6
6
|
|
|
7
7
|
_global.loaders = _global.loaders || {};
|
|
8
8
|
module.exports = Object.assign(_global.loaders, moduleExports);
|
package/dist/es5/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bundle.ts"],"names":["moduleExports","require","_global","window","global","loaders","module","exports","Object","assign"],"mappings":";;AACA,
|
|
1
|
+
{"version":3,"sources":["../../src/bundle.ts"],"names":["moduleExports","require","_global","window","global","loaders","module","exports","Object","assign"],"mappings":";;AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAD,CAA7B;;AACA,MAAMC,OAAO,GAAG,OAAOC,MAAP,KAAkB,WAAlB,GAAgCC,MAAhC,GAAyCD,MAAzD;;AACAD,OAAO,CAACG,OAAR,GAAkBH,OAAO,CAACG,OAAR,IAAmB,EAArC;AACAC,MAAM,CAACC,OAAP,GAAiBC,MAAM,CAACC,MAAP,CAAcP,OAAO,CAACG,OAAtB,EAA+BL,aAA/B,CAAjB","sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nconst _global = typeof window === 'undefined' ? global : window;\n_global.loaders = _global.loaders || {};\nmodule.exports = Object.assign(_global.loaders, moduleExports);\n"],"file":"bundle.js"}
|
package/dist/es5/index.js
CHANGED
|
@@ -7,53 +7,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
Object.defineProperty(exports, "OBJWorkerLoader", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function
|
|
10
|
+
get: function () {
|
|
11
11
|
return _objLoader.OBJLoader;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
exports._typecheckOBJLoader = exports.OBJLoader = void 0;
|
|
15
15
|
|
|
16
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
17
|
-
|
|
18
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
19
|
-
|
|
20
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
21
|
-
|
|
22
16
|
var _loadObj = _interopRequireDefault(require("./lib/load-obj"));
|
|
23
17
|
|
|
24
18
|
var _objLoader = require("./obj-loader");
|
|
25
19
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
29
|
-
|
|
30
|
-
var OBJLoader = _objectSpread(_objectSpread({}, _objLoader.OBJLoader), {}, {
|
|
31
|
-
parse: function () {
|
|
32
|
-
var _parse = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(arrayBuffer, options) {
|
|
33
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
34
|
-
while (1) {
|
|
35
|
-
switch (_context.prev = _context.next) {
|
|
36
|
-
case 0:
|
|
37
|
-
return _context.abrupt("return", (0, _loadObj.default)(new TextDecoder().decode(arrayBuffer), options));
|
|
38
|
-
|
|
39
|
-
case 1:
|
|
40
|
-
case "end":
|
|
41
|
-
return _context.stop();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}, _callee);
|
|
45
|
-
}));
|
|
46
|
-
|
|
47
|
-
function parse(_x, _x2) {
|
|
48
|
-
return _parse.apply(this, arguments);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return parse;
|
|
52
|
-
}(),
|
|
20
|
+
const OBJLoader = { ..._objLoader.OBJLoader,
|
|
21
|
+
parse: async (arrayBuffer, options) => (0, _loadObj.default)(new TextDecoder().decode(arrayBuffer), options),
|
|
53
22
|
parseTextSync: _loadObj.default
|
|
54
|
-
}
|
|
55
|
-
|
|
23
|
+
};
|
|
56
24
|
exports.OBJLoader = OBJLoader;
|
|
57
|
-
|
|
25
|
+
const _typecheckOBJLoader = OBJLoader;
|
|
58
26
|
exports._typecheckOBJLoader = _typecheckOBJLoader;
|
|
59
27
|
//# sourceMappingURL=index.js.map
|
package/dist/es5/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":["OBJLoader","OBJWorkerLoader","parse","arrayBuffer","options","TextDecoder","decode","parseTextSync","loadOBJ","_typecheckOBJLoader"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":["OBJLoader","OBJWorkerLoader","parse","arrayBuffer","options","TextDecoder","decode","parseTextSync","loadOBJ","_typecheckOBJLoader"],"mappings":";;;;;;;;;;;;;;;AACA;;AACA;;AASO,MAAMA,SAAS,GAAG,EACvB,GAAGC,oBADoB;AAEvBC,EAAAA,KAAK,EAAE,OAAOC,WAAP,EAAoBC,OAApB,KAAgC,sBAAQ,IAAIC,WAAJ,GAAkBC,MAAlB,CAAyBH,WAAzB,CAAR,EAA+CC,OAA/C,CAFhB;AAGvBG,EAAAA,aAAa,EAAEC;AAHQ,CAAlB;;AAMA,MAAMC,mBAAqC,GAAGT,SAA9C","sourcesContent":["import type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport loadOBJ from './lib/load-obj';\nimport {OBJLoader as OBJWorkerLoader} from './obj-loader';\n\n// OBJLoader\n\nexport {OBJWorkerLoader};\n\n/**\n * Loader for the OBJ geometry format\n */\nexport const OBJLoader = {\n ...OBJWorkerLoader,\n parse: async (arrayBuffer, options) => loadOBJ(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: loadOBJ\n};\n\nexport const _typecheckOBJLoader: LoaderWithParser = OBJLoader;\n"],"file":"index.js"}
|
package/dist/es5/lib/load-obj.js
CHANGED
|
@@ -13,25 +13,17 @@ var _parseObj = _interopRequireDefault(require("./parse-obj"));
|
|
|
13
13
|
|
|
14
14
|
var _schemaAttributeUtils = require("./schema-attribute-utils");
|
|
15
15
|
|
|
16
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
17
|
-
|
|
18
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
|
-
|
|
20
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
21
|
-
|
|
22
16
|
function loadOBJ(text, options) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var header = {
|
|
31
|
-
vertexCount: vertexCount,
|
|
17
|
+
const {
|
|
18
|
+
meshes
|
|
19
|
+
} = (0, _parseObj.default)(text);
|
|
20
|
+
const vertexCount = meshes.reduce((s, mesh) => s + mesh.header.vertexCount, 0);
|
|
21
|
+
const attributes = mergeAttributes(meshes, vertexCount);
|
|
22
|
+
const header = {
|
|
23
|
+
vertexCount,
|
|
32
24
|
boundingBox: (0, _schema.getMeshBoundingBox)(attributes)
|
|
33
25
|
};
|
|
34
|
-
|
|
26
|
+
const schema = (0, _schemaAttributeUtils.makeSchemaFromAttributes)(attributes, {
|
|
35
27
|
mode: 4,
|
|
36
28
|
boundingBox: header.boundingBox
|
|
37
29
|
});
|
|
@@ -39,57 +31,48 @@ function loadOBJ(text, options) {
|
|
|
39
31
|
loaderData: {
|
|
40
32
|
header: {}
|
|
41
33
|
},
|
|
42
|
-
schema
|
|
43
|
-
header
|
|
34
|
+
schema,
|
|
35
|
+
header,
|
|
44
36
|
mode: 4,
|
|
45
|
-
attributes
|
|
37
|
+
attributes
|
|
46
38
|
};
|
|
47
39
|
}
|
|
48
40
|
|
|
49
41
|
function mergeAttributes(meshes, vertexCount) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (TEXCOORD_0) {
|
|
80
|
-
uvs = uvs || new Float32Array(vertexCount * 2);
|
|
81
|
-
uvs.set(TEXCOORD_0.value, i * 2);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
i += POSITION.value.length / 3;
|
|
42
|
+
const positions = new Float32Array(vertexCount * 3);
|
|
43
|
+
let normals;
|
|
44
|
+
let colors;
|
|
45
|
+
let uvs;
|
|
46
|
+
let i = 0;
|
|
47
|
+
|
|
48
|
+
for (const mesh of meshes) {
|
|
49
|
+
const {
|
|
50
|
+
POSITION,
|
|
51
|
+
NORMAL,
|
|
52
|
+
COLOR_0,
|
|
53
|
+
TEXCOORD_0
|
|
54
|
+
} = mesh.attributes;
|
|
55
|
+
positions.set(POSITION.value, i * 3);
|
|
56
|
+
|
|
57
|
+
if (NORMAL) {
|
|
58
|
+
normals = normals || new Float32Array(vertexCount * 3);
|
|
59
|
+
normals.set(NORMAL.value, i * 3);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (COLOR_0) {
|
|
63
|
+
colors = colors || new Float32Array(vertexCount * 3);
|
|
64
|
+
colors.set(COLOR_0.value, i * 3);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (TEXCOORD_0) {
|
|
68
|
+
uvs = uvs || new Float32Array(vertexCount * 2);
|
|
69
|
+
uvs.set(TEXCOORD_0.value, i * 2);
|
|
85
70
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
} finally {
|
|
89
|
-
_iterator.f();
|
|
71
|
+
|
|
72
|
+
i += POSITION.value.length / 3;
|
|
90
73
|
}
|
|
91
74
|
|
|
92
|
-
|
|
75
|
+
const attributes = {};
|
|
93
76
|
attributes.POSITION = {
|
|
94
77
|
value: positions,
|
|
95
78
|
size: 3
|