@realsee/five 5.0.0-alpha.186 → 5.0.0-alpha.188

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.
Files changed (157) hide show
  1. package/docs/assets/search.js +1 -1
  2. package/docs/classes/five.AnimationFrameLoop.html +1 -1
  3. package/docs/classes/five.BVH.html +1 -1
  4. package/docs/classes/five.BVHIntersect.html +1 -1
  5. package/docs/classes/five.BVHNode.html +1 -1
  6. package/docs/classes/five.BVHVector3.html +1 -1
  7. package/docs/classes/five.Camera.html +1 -1
  8. package/docs/classes/five.Clipper.html +1 -1
  9. package/docs/classes/five.Five.html +1 -1
  10. package/docs/classes/five.InternalWebGLRenderer.html +1 -1
  11. package/docs/classes/five.IntersectMesh.html +1 -1
  12. package/docs/classes/five.Model.html +1 -1
  13. package/docs/classes/five.NetworkSubscribe.html +1 -1
  14. package/docs/classes/five.PBMContainer.html +1 -1
  15. package/docs/classes/five.PBMGroup.html +1 -1
  16. package/docs/classes/five.PBMMaterial.html +14 -14
  17. package/docs/classes/five.PBMMesh.html +1 -1
  18. package/docs/classes/five.PanoCircleMesh.html +1 -1
  19. package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
  20. package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
  21. package/docs/classes/five.Scene.html +1 -1
  22. package/docs/classes/five.Subscribe.html +1 -1
  23. package/docs/classes/five.TextureLoader.html +1 -1
  24. package/docs/classes/five.Tile3D.html +1 -1
  25. package/docs/classes/five.Tile3DModel.html +1 -1
  26. package/docs/classes/five.TileBoundingSphere.html +1 -1
  27. package/docs/classes/five.TileCacheNode.html +1 -1
  28. package/docs/classes/five.TileCubeTextureTarget.html +1 -1
  29. package/docs/classes/five.TileCullingVolume.html +1 -1
  30. package/docs/classes/five.TileOrientedBoundingBox.html +1 -1
  31. package/docs/classes/five.TileRequestScheduler.html +1 -1
  32. package/docs/classes/five.Tileset3D.html +1 -1
  33. package/docs/classes/five.Tileset3DTraverser.html +1 -1
  34. package/docs/classes/five.TilesetCache.html +1 -1
  35. package/docs/classes/five.Work.html +12 -12
  36. package/docs/classes/five.XRButton.html +1 -1
  37. package/docs/classes/gltf_loader.DDSLoader.html +1 -1
  38. package/docs/classes/gltf_loader.DRACOLoader.html +1 -1
  39. package/docs/classes/gltf_loader.GLTFLoader.html +1 -1
  40. package/docs/classes/gltf_loader.GLTFObject.html +1 -1
  41. package/docs/classes/gltf_loader.GLTFParser.html +1 -1
  42. package/docs/classes/gltf_loader.THREEGLTFLoader.html +1 -1
  43. package/docs/classes/line.Line.html +1 -1
  44. package/docs/classes/line.LineGeometry.html +1 -1
  45. package/docs/classes/line.LineMaterial.html +1 -1
  46. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  47. package/docs/classes/line.THREE_Line2.html +1 -1
  48. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  49. package/docs/classes/react.Store.html +1 -1
  50. package/docs/classes/server.BVH.html +1 -1
  51. package/docs/classes/server.BVHIntersect.html +1 -1
  52. package/docs/classes/server.BVHNode.html +1 -1
  53. package/docs/classes/server.BVHVector3.html +1 -1
  54. package/docs/classes/server.Model.html +1 -1
  55. package/docs/classes/server.PBMContainer.html +1 -1
  56. package/docs/classes/server.PBMGroup.html +1 -1
  57. package/docs/classes/server.PBMMesh.html +1 -1
  58. package/docs/classes/sticker.Sticker.html +1 -1
  59. package/docs/classes/vfx.Airflow.html +1 -1
  60. package/docs/classes/vfx.Flame.html +1 -1
  61. package/docs/classes/vfx.Particle.html +1 -1
  62. package/docs/classes/vfx.SpotLight.html +1 -1
  63. package/docs/index.html +1 -1
  64. package/docs/interfaces/five.AddableObject.html +1 -1
  65. package/docs/interfaces/five.AnimationFrame.html +1 -1
  66. package/docs/interfaces/five.CameraPose.html +1 -1
  67. package/docs/interfaces/five.ClipperParameter.html +1 -1
  68. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +1 -1
  69. package/docs/interfaces/five.EventCallback.html +1 -1
  70. package/docs/interfaces/five.FiveInitArgs.html +1 -1
  71. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +1 -1
  72. package/docs/interfaces/five.ImageOptions.html +1 -1
  73. package/docs/interfaces/five.ImageURLMappings.html +1 -1
  74. package/docs/interfaces/five.ImageURLOptions.html +1 -1
  75. package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
  76. package/docs/interfaces/five.Intersection.html +1 -1
  77. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +1 -1
  78. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
  79. package/docs/interfaces/five.ModelEventCallback.html +1 -1
  80. package/docs/interfaces/five.MotionKeyframe.html +1 -1
  81. package/docs/interfaces/five.MovePanoOptions.html +1 -1
  82. package/docs/interfaces/five.NetworkOptions.html +1 -1
  83. package/docs/interfaces/five.PBMPanoPicture.html +1 -1
  84. package/docs/interfaces/five.PBMParameters.html +1 -1
  85. package/docs/interfaces/five.PanoCircleMeshCustomOptions.html +1 -1
  86. package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
  87. package/docs/interfaces/five.PanoCircleMeshOptions.html +1 -1
  88. package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +1 -1
  89. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
  90. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
  91. package/docs/interfaces/five.Pose.html +1 -1
  92. package/docs/interfaces/five.Scissor.html +1 -1
  93. package/docs/interfaces/five.State.html +1 -1
  94. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -1
  95. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -1
  96. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -1
  97. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -1
  98. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -1
  99. package/docs/interfaces/five.TextureOptions.html +1 -1
  100. package/docs/interfaces/five.Tile3DModelLoaderOptions.html +1 -1
  101. package/docs/interfaces/five.TileBoundingVolume.html +1 -1
  102. package/docs/interfaces/five.TileContent.html +1 -1
  103. package/docs/interfaces/five.TileCubeNode.html +1 -1
  104. package/docs/interfaces/five.TileCubeTree.html +1 -1
  105. package/docs/interfaces/five.Tileset3dOptions.html +1 -1
  106. package/docs/interfaces/five.TilesetJSON.html +1 -1
  107. package/docs/interfaces/five.TilesetJSONNode.html +1 -1
  108. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
  109. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
  110. package/docs/interfaces/five.WebXRSelectParams.html +1 -1
  111. package/docs/interfaces/five.WorkCubeImage.html +1 -1
  112. package/docs/interfaces/five.WorkImage.html +1 -1
  113. package/docs/interfaces/five.WorkInitial.html +1 -1
  114. package/docs/interfaces/five.WorkModel.html +6 -6
  115. package/docs/interfaces/five.WorkModelTiles.html +1 -1
  116. package/docs/interfaces/five.WorkObserver.html +5 -3
  117. package/docs/interfaces/five.WorkTile.html +1 -1
  118. package/docs/interfaces/five.WorkVideo.html +1 -1
  119. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
  120. package/docs/interfaces/gltf_loader.DDS.html +1 -1
  121. package/docs/interfaces/gltf_loader.GLTF.html +1 -1
  122. package/docs/interfaces/gltf_loader.GLTFReference.html +1 -1
  123. package/docs/interfaces/gltf_loader.THREEGLTF.html +1 -1
  124. package/docs/interfaces/react.FiveActionReactCallbacks.html +1 -1
  125. package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
  126. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -1
  127. package/docs/interfaces/server.Intersection.html +1 -1
  128. package/docs/interfaces/server.ModelEventCallback.html +1 -1
  129. package/docs/interfaces/sticker.IntersectionLike.html +1 -1
  130. package/docs/interfaces/vfx.ParticleArgs.html +1 -1
  131. package/docs/interfaces/vfx.ParticleTweenKeyframe.html +1 -1
  132. package/docs/interfaces/vue.FiveActionVueCallbacks.html +1 -1
  133. package/docs/modules/five.SubscribeMixinType.html +1 -1
  134. package/docs/modules/five.html +2 -2
  135. package/docs/modules/gltf_loader.html +1 -1
  136. package/docs/modules/line.html +1 -1
  137. package/docs/modules/react.html +1 -1
  138. package/docs/modules/server.html +1 -1
  139. package/docs/modules/sticker.html +1 -1
  140. package/docs/modules/vfx.html +1 -1
  141. package/docs/modules/vue.html +1 -1
  142. package/docs/modules.html +1 -1
  143. package/five/index.d.ts +2 -0
  144. package/five/index.js +5 -5
  145. package/gltf-loader/index.js +3 -3
  146. package/line/index.js +3 -3
  147. package/package.json +1 -1
  148. package/react/index.js +2 -2
  149. package/server/index.d.ts +2 -0
  150. package/server/index.js +4 -4
  151. package/sticker/index.js +3 -3
  152. package/umd/five-gltf-loader.js +1 -1
  153. package/umd/five-line.js +1 -1
  154. package/umd/five-sticker.js +1 -1
  155. package/umd/five.js +1 -1
  156. package/vfx/index.js +2 -2
  157. package/vue/index.js +2 -2
package/sticker/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @realsee/five
3
3
  *
4
- * Generated: 2023-03-09
5
- * Version: 5.0.0-alpha.186
4
+ * Generated: 2023-03-10
5
+ * Version: 5.0.0-alpha.188
6
6
  *
7
7
  * Terms:
8
8
  * Realsee SDK License Agreement
@@ -257,4 +257,4 @@
257
257
  * Agreement and all related documents shall be drafted in English.
258
258
  */
259
259
 
260
- "use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("three")),n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)};var r=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),i=new Float32Array([0,0,1,0,0,1,1,1]),o=new Uint8Array([0,1,2,1,3,2]),a=new t.BufferGeometry;a.setAttribute("position",new t.BufferAttribute(r,3)),a.setAttribute("uv",new t.BufferAttribute(i,2)),a.setIndex(new t.BufferAttribute(o,1));var s=window,u=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame||function(e){return setTimeout(e,16)},c="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),p="undefined"!=typeof performance?function(){return c+performance.now()}:function(){return Date.now()};function f(e,t){var n=e.dispose;e.dispose=function(){t(),n.call(e)}}var d=function(e){function r(n,r,i){var o,s,c,d,l,m,v=this,g=new t.MeshBasicMaterial;if((v=e.call(this,a,g)||this)._needsRender=!1,v.scale.set(n,r,1),"string"==typeof i){g.transparent=/\.png$/.test(i);var h=new Image;h.src=i,h.crossOrigin="",i=h}if(i instanceof HTMLImageElement){var y=g.map=new t.Texture;y.wrapS=t.ClampToEdgeWrapping,y.wrapT=t.ClampToEdgeWrapping,y.minFilter=t.LinearFilter,y.encoding=t.sRGBEncoding,f(y,function(e,t){e.naturalWidth>0&&u((function(){return t()}));var n=function(){return t()};return e.addEventListener("load",n,!1),function(){return e.removeEventListener("load",n,!1)}}(i,(function(){y.image=i,y.needsUpdate=!0,v._needsRender=!0})))}else if(i instanceof HTMLCanvasElement)g.map=new t.CanvasTexture(i);else if(i instanceof HTMLVideoElement){var w=g.map=new t.VideoTexture(i);w.wrapS=t.ClampToEdgeWrapping,w.wrapT=t.ClampToEdgeWrapping,w.minFilter=t.LinearFilter,w.encoding=t.sRGBEncoding,f(w,(o=i,s=function(){v._needsRender=!0},c=p(),d=!1,l=function(){d=!0,s(),p()-c<3e3?u(l):d=!1},m=function(){c=p(),!1===d&&l()},o.addEventListener("timeupdate",m,!1),function(){o.removeEventListener("timeupdate",m,!1),d=!1}))}return v}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(r,e),Object.defineProperty(r,"version",{get:function(){return"5.0.0-alpha.186"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"needsRender",{get:function(){return this._needsRender},set:function(e){this._needsRender=e,!0===e&&this.material.map&&(this.material.map.needsUpdate=!0)},enumerable:!1,configurable:!0}),r.prototype.setSize=function(e,t){this.scale.set(e,t,1),this._needsRender=!0},r.prototype.setTransparent=function(e){this.material.transparent=e,this._needsRender=!0},r.prototype.locationWithIntersection=function(e,t){void 0===t&&(t=.005);var n=e.point,r=e.face;this.position.copy(n),r&&(this.position.add(r.normal.clone().setLength(t)),this.lookAt(n.clone().add(r.normal))),this._needsRender=!0},r.prototype.dispose=function(){var e;null===(e=this.material.map)||void 0===e||e.dispose(),this.material.dispose()},r}(t.Mesh);exports.Sticker=d;
260
+ "use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("three")),n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)};var r=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),i=new Float32Array([0,0,1,0,0,1,1,1]),o=new Uint8Array([0,1,2,1,3,2]),a=new t.BufferGeometry;a.setAttribute("position",new t.BufferAttribute(r,3)),a.setAttribute("uv",new t.BufferAttribute(i,2)),a.setIndex(new t.BufferAttribute(o,1));var s=window,u=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame||function(e){return setTimeout(e,16)},c="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),p="undefined"!=typeof performance?function(){return c+performance.now()}:function(){return Date.now()};function f(e,t){var n=e.dispose;e.dispose=function(){t(),n.call(e)}}var d=function(e){function r(n,r,i){var o,s,c,d,l,m,v=this,g=new t.MeshBasicMaterial;if((v=e.call(this,a,g)||this)._needsRender=!1,v.scale.set(n,r,1),"string"==typeof i){g.transparent=/\.png$/.test(i);var h=new Image;h.src=i,h.crossOrigin="",i=h}if(i instanceof HTMLImageElement){var y=g.map=new t.Texture;y.wrapS=t.ClampToEdgeWrapping,y.wrapT=t.ClampToEdgeWrapping,y.minFilter=t.LinearFilter,y.encoding=t.sRGBEncoding,f(y,function(e,t){e.naturalWidth>0&&u((function(){return t()}));var n=function(){return t()};return e.addEventListener("load",n,!1),function(){return e.removeEventListener("load",n,!1)}}(i,(function(){y.image=i,y.needsUpdate=!0,v._needsRender=!0})))}else if(i instanceof HTMLCanvasElement)g.map=new t.CanvasTexture(i);else if(i instanceof HTMLVideoElement){var w=g.map=new t.VideoTexture(i);w.wrapS=t.ClampToEdgeWrapping,w.wrapT=t.ClampToEdgeWrapping,w.minFilter=t.LinearFilter,w.encoding=t.sRGBEncoding,f(w,(o=i,s=function(){v._needsRender=!0},c=p(),d=!1,l=function(){d=!0,s(),p()-c<3e3?u(l):d=!1},m=function(){c=p(),!1===d&&l()},o.addEventListener("timeupdate",m,!1),function(){o.removeEventListener("timeupdate",m,!1),d=!1}))}return v}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(r,e),Object.defineProperty(r,"version",{get:function(){return"5.0.0-alpha.188"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"needsRender",{get:function(){return this._needsRender},set:function(e){this._needsRender=e,!0===e&&this.material.map&&(this.material.map.needsUpdate=!0)},enumerable:!1,configurable:!0}),r.prototype.setSize=function(e,t){this.scale.set(e,t,1),this._needsRender=!0},r.prototype.setTransparent=function(e){this.material.transparent=e,this._needsRender=!0},r.prototype.locationWithIntersection=function(e,t){void 0===t&&(t=.005);var n=e.point,r=e.face;this.position.copy(n),r&&(this.position.add(r.normal.clone().setLength(t)),this.lookAt(n.clone().add(r.normal))),this._needsRender=!0},r.prototype.dispose=function(){var e;null===(e=this.material.map)||void 0===e||e.dispose(),this.material.dispose()},r}(t.Mesh);exports.Sticker=d;
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FiveSDK_GLTFLoader=t():e.FiveSDK_GLTFLoader=t()}(self,(()=>(()=>{var e={438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const t=Number(THREE.REVISION);if(t<115||t>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE}},t={};function r(a){var n=t[a];if(void 0!==n)return n.exports;var o=t[a]={exports:{}};return e[a](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{"use strict";r.r(a),r.d(a,{DDSLoader:()=>i,DRACOLoader:()=>s,GLTFLoader:()=>c,GLTFObject:()=>l,THREEGLTFLoader:()=>o});var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}Object.create,Object.create;var n=r(438),o=function(){function e(e){n.Loader.call(this,e),this.dracoLoader=null,this.ddsLoader=null}function t(){var e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}e.prototype=Object.assign(Object.create(n.Loader.prototype),{constructor:e,load:function(e,t,r,a){var o,s=this;o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:n.LoaderUtils.extractUrlBase(e),s.manager.itemStart(e);var i=function(t){a?a(t):console.error(t),s.manager.itemError(e),s.manager.itemEnd(e)},l=new n.FileLoader(s.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),"use-credentials"===s.crossOrigin&&l.setWithCredentials(!0),l.load(e,(function(r){try{s.parse(r,o,(function(r){t(r),s.manager.itemEnd(e)}),i)}catch(e){i(e)}}),r,i)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},parse:function(e,t,h,g){var v,y={};if("string"==typeof e)v=e;else if(n.LoaderUtils.decodeText(new Uint8Array(e,0,4))===c){try{y[r.KHR_BINARY_GLTF]=new u(e)}catch(e){return void(g&&g(e))}v=y[r.KHR_BINARY_GLTF].content}else v=n.LoaderUtils.decodeText(new Uint8Array(e));var T=JSON.parse(v);if(void 0===T.asset||T.asset.version[0]<2)g&&g(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{if(T.extensionsUsed)for(var M=0;M<T.extensionsUsed.length;++M){var R=T.extensionsUsed[M],A=T.extensionsRequired||[];switch(R){case r.KHR_LIGHTS_PUNCTUAL:y[R]=new o(T);break;case r.KHR_MATERIALS_CLEARCOAT:y[R]=new i;break;case r.KHR_MATERIALS_TRANSMISSION:y[R]=new l;break;case r.KHR_MATERIALS_UNLIT:y[R]=new s;break;case r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:y[R]=new f;break;case r.KHR_DRACO_MESH_COMPRESSION:y[R]=new d(T,this.dracoLoader);break;case r.MSFT_TEXTURE_DDS:y[R]=new a(this.ddsLoader);break;case r.KHR_TEXTURE_TRANSFORM:y[R]=new p;break;case r.KHR_MESH_QUANTIZATION:y[R]=new m;break;default:A.indexOf(R)>=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+R+'".')}}var S=new I(T,y,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager});S.fileLoader.setRequestHeader(this.requestHeader),S.parse(h,g)}}});var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function a(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=e}function o(e){this.name=r.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[r.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function s(){this.name=r.KHR_MATERIALS_UNLIT}function i(){this.name=r.KHR_MATERIALS_CLEARCOAT}function l(){this.name=r.KHR_MATERIALS_TRANSMISSION}o.prototype.loadLight=function(e){var t,r=this.lightDefs[e],a=new n.Color(16777215);void 0!==r.color&&a.fromArray(r.color);var o=void 0!==r.range?r.range:0;switch(r.type){case"directional":(t=new n.DirectionalLight(a)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new n.PointLight(a)).distance=o;break;case"spot":(t=new n.SpotLight(a)).distance=o,r.spot=r.spot||{},r.spot.innerConeAngle=void 0!==r.spot.innerConeAngle?r.spot.innerConeAngle:0,r.spot.outerConeAngle=void 0!==r.spot.outerConeAngle?r.spot.outerConeAngle:Math.PI/4,t.angle=r.spot.outerConeAngle,t.penumbra=1-r.spot.innerConeAngle/r.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+r.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==r.intensity&&(t.intensity=r.intensity),t.name=r.name||"light_"+e,Promise.resolve(t)},s.prototype.getMaterialType=function(){return n.MeshBasicMaterial},s.prototype.extendParams=function(e,t,r){var a=[];e.color=new n.Color(1,1,1),e.opacity=1;var o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;e.color.fromArray(s),e.opacity=s[3]}void 0!==o.baseColorTexture&&a.push(r.assignTexture(e,"map",o.baseColorTexture))}return Promise.all(a)},i.prototype.getMaterialType=function(){return n.MeshPhysicalMaterial},i.prototype.extendParams=function(e,t,r){var a=[],o=t.extensions[this.name];if(void 0!==o.clearcoatFactor&&(e.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&a.push(r.assignTexture(e,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(e.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&a.push(r.assignTexture(e,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(a.push(r.assignTexture(e,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){var s=o.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new n.Vector2(s,s)}return Promise.all(a)},l.prototype.getMaterialType=function(){return n.MeshPhysicalMaterial},l.prototype.extendParams=function(e,t,r){var a=t.extensions[this.name];return void 0!==a.transmissionFactor&&(e.premultipliedAlpha=!0,e.transparent=!0,e.transparency=a.transmissionFactor),Promise.all([])};var c="glTF";function u(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,12);if(this.header={magic:n.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==c)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var a=new DataView(e,12),o=0;o<a.byteLength;){var s=a.getUint32(o,!0);o+=4;var i=a.getUint32(o,!0);if(o+=4,1313821514===i){var l=new Uint8Array(e,12+o,s);this.content=n.LoaderUtils.decodeText(l)}else if(5130562===i){var u=12+o;this.body=e.slice(u,u+s)}o+=s}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function d(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=r.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}function p(){this.name=r.KHR_TEXTURE_TRANSFORM}function h(e){n.MeshStandardMaterial.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),r=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),a=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),o=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),s=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),i={specular:{value:(new n.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=i,this.onBeforeCompile=function(e){for(var n in i)e.uniforms[n]=i[n];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),e.fragmentShader=e.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_pars_fragment>",t),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_pars_fragment>",r),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_fragment>",a),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_fragment>",o),e.fragmentShader=e.fragmentShader.replace("#include <lights_physical_fragment>",s)},Object.defineProperties(this,{specular:{get:function(){return i.specular.value},set:function(e){i.specular.value=e}},specularMap:{get:function(){return i.specularMap.value},set:function(e){i.specularMap.value=e}},glossiness:{get:function(){return i.glossiness.value},set:function(e){i.glossiness.value=e}},glossinessMap:{get:function(){return i.glossinessMap.value},set:function(e){i.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function f(){return{name:r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return h},extendParams:function(e,t,r){var a=t.extensions[this.name];e.color=new n.Color(1,1,1),e.opacity=1;var o=[];if(Array.isArray(a.diffuseFactor)){var s=a.diffuseFactor;e.color.fromArray(s),e.opacity=s[3]}if(void 0!==a.diffuseTexture&&o.push(r.assignTexture(e,"map",a.diffuseTexture)),e.emissive=new n.Color(0,0,0),e.glossiness=void 0!==a.glossinessFactor?a.glossinessFactor:1,e.specular=new n.Color(1,1,1),Array.isArray(a.specularFactor)&&e.specular.fromArray(a.specularFactor),void 0!==a.specularGlossinessTexture){var i=a.specularGlossinessTexture;o.push(r.assignTexture(e,"glossinessMap",i)),o.push(r.assignTexture(e,"specularMap",i))}return Promise.all(o)},createMaterial:function(e){var t=new h(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=n.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function m(){this.name=r.KHR_MESH_QUANTIZATION}function g(e,t,r,a){n.Interpolant.call(this,e,t,r,a)}d.prototype.decodePrimitive=function(e,t){var r=this.json,a=this.dracoLoader,n=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,s={},i={},l={};for(var c in o){var u=R[c]||c.toLowerCase();s[u]=o[c]}for(c in e.attributes)if(u=R[c]||c.toLowerCase(),void 0!==o[c]){var d=r.accessors[e.attributes[c]],p=v[d.componentType];l[u]=p,i[u]=!0===d.normalized}return t.getDependency("bufferView",n).then((function(e){return new Promise((function(t){a.decodeDracoFile(e,(function(e){for(var r in e.attributes){var a=e.attributes[r],n=i[r];void 0!==n&&(a.normalized=n)}t(e)}),s,l)}))}))},p.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},h.prototype=Object.create(n.MeshStandardMaterial.prototype),h.prototype.constructor=h,h.prototype.copy=function(e){return n.MeshStandardMaterial.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},g.prototype=Object.create(n.Interpolant.prototype),g.prototype.constructor=g,g.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,r=this.sampleValues,a=this.valueSize,n=e*a*3+a,o=0;o!==a;o++)t[o]=r[n+o];return t},g.prototype.beforeStart_=g.prototype.copySampleValue_,g.prototype.afterEnd_=g.prototype.copySampleValue_,g.prototype.interpolate_=function(e,t,r,a){for(var n=this.resultBuffer,o=this.sampleValues,s=this.valueSize,i=2*s,l=3*s,c=a-t,u=(r-t)/c,d=u*u,p=d*u,h=e*l,f=h-l,m=-2*p+3*d,g=p-d,v=1-m,y=g-d+u,T=0;T!==s;T++){var M=o[f+T+s],R=o[f+T+i]*c,A=o[h+T+s],S=o[h+T]*c;n[T]=v*M+y*R+m*A+g*S}return n};var v={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},y={9728:n.NearestFilter,9729:n.LinearFilter,9984:n.NearestMipmapNearestFilter,9985:n.LinearMipmapNearestFilter,9986:n.NearestMipmapLinearFilter,9987:n.LinearMipmapLinearFilter},T={33071:n.ClampToEdgeWrapping,33648:n.MirroredRepeatWrapping,10497:n.RepeatWrapping},M={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},R={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},A={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},S={CUBICSPLINE:void 0,LINEAR:n.InterpolateLinear,STEP:n.InterpolateDiscrete},b={"image/png":n.RGBAFormat,"image/jpeg":n.RGBFormat};function w(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function L(e,t,r){for(var a in r.extensions)void 0===e[a]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[a]=r.extensions[a])}function _(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function E(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var r=0,a=t.weights.length;r<a;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){var n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length)for(e.morphTargetDictionary={},r=0,a=n.length;r<a;r++)e.morphTargetDictionary[n[r]]=r;else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function x(e){for(var t="",r=Object.keys(e).sort(),a=0,n=r.length;a<n;a++)t+=r[a]+":"+e[r[a]]+";";return t}function I(e,r,a){this.json=e||{},this.extensions=r||{},this.options=a||{},this.cache=new t,this.associations=new Map,this.primitiveCache={},this.textureLoader=new n.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new n.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function C(e,t,r){var a=t.attributes,o=[];function s(t,a){return r.getDependency("accessor",t).then((function(t){e.setAttribute(a,t)}))}for(var i in a){var l=R[i]||i.toLowerCase();l in e.attributes||o.push(s(a[i],l))}if(void 0!==t.indices&&!e.index){var c=r.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));o.push(c)}return _(e,t),function(e,t,r){var a=t.attributes,o=new n.Box3;if(void 0!==a.POSITION){var s=(h=r.json.accessors[a.POSITION]).min,i=h.max;if(void 0!==s&&void 0!==i){o.set(new n.Vector3(s[0],s[1],s[2]),new n.Vector3(i[0],i[1],i[2]));var l=t.targets;if(void 0!==l){for(var c=new n.Vector3,u=new n.Vector3,d=0,p=l.length;d<p;d++){var h,f=l[d];void 0!==f.POSITION&&(s=(h=r.json.accessors[f.POSITION]).min,i=h.max,void 0!==s&&void 0!==i?(u.setX(Math.max(Math.abs(s[0]),Math.abs(i[0]))),u.setY(Math.max(Math.abs(s[1]),Math.abs(i[1]))),u.setZ(Math.max(Math.abs(s[2]),Math.abs(i[2]))),c.max(u)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."))}o.expandByVector(c)}e.boundingBox=o;var m=new n.Sphere;o.getCenter(m.center),m.radius=o.min.distanceTo(o.max)/2,e.boundingSphere=m}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(e,t,r),Promise.all(o).then((function(){return void 0!==t.targets?function(e,t,r){for(var a=!1,n=!1,o=0,s=t.length;o<s&&(void 0!==(c=t[o]).POSITION&&(a=!0),void 0!==c.NORMAL&&(n=!0),!a||!n);o++);if(!a&&!n)return Promise.resolve(e);var i=[],l=[];for(o=0,s=t.length;o<s;o++){var c=t[o];if(a){var u=void 0!==c.POSITION?r.getDependency("accessor",c.POSITION):e.attributes.position;i.push(u)}n&&(u=void 0!==c.NORMAL?r.getDependency("accessor",c.NORMAL):e.attributes.normal,l.push(u))}return Promise.all([Promise.all(i),Promise.all(l)]).then((function(t){var r=t[0],o=t[1];return a&&(e.morphAttributes.position=r),n&&(e.morphAttributes.normal=o),e.morphTargetsRelative=!0,e}))}(e,t.targets,r):e}))}function D(e,t){var r=e.getIndex();if(null===r){var a=[],o=e.getAttribute("position");if(void 0===o)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var s=0;s<o.count;s++)a.push(s);e.setIndex(a),r=e.getIndex()}var i=r.count-2,l=[];if(t===n.TriangleFanDrawMode)for(s=1;s<=i;s++)l.push(r.getX(0)),l.push(r.getX(s)),l.push(r.getX(s+1));else for(s=0;s<i;s++)s%2==0?(l.push(r.getX(s)),l.push(r.getX(s+1)),l.push(r.getX(s+2))):(l.push(r.getX(s+2)),l.push(r.getX(s+1)),l.push(r.getX(s)));l.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var c=e.clone();return c.setIndex(l),c}return I.prototype.parse=function(e,t){var r=this,a=this.json,n=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then((function(t){var o={scene:t[0][a.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:a.asset,parser:r,userData:{}};L(n,o,a),_(o,a),e(o)})).catch(t)},I.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},o=0,s=t.length;o<s;o++)for(var i=t[o].joints,l=0,c=i.length;l<c;l++)e[i[l]].isBone=!0;for(var u=0,d=e.length;u<d;u++){var p=e[u];void 0!==p.mesh&&(void 0===a[p.mesh]&&(a[p.mesh]=n[p.mesh]=0),a[p.mesh]++,void 0!==p.skin&&(r[p.mesh].isSkinnedMesh=!0))}this.json.meshReferences=a,this.json.meshUses=n},I.prototype.getDependency=function(e,t){var a=e+":"+t,n=this.cache.get(a);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this.loadNode(t);break;case"mesh":n=this.loadMesh(t);break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this.loadBufferView(t);break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this.loadMaterial(t);break;case"texture":n=this.loadTexture(t);break;case"skin":n=this.loadSkin(t);break;case"animation":n=this.loadAnimation(t);break;case"camera":n=this.loadCamera(t);break;case"light":n=this.extensions[r.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(a,n)}return n},I.prototype.getDependencies=function(e){var t=this.cache.get(e);if(!t){var r=this,a=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(a.map((function(t,a){return r.getDependency(e,a)}))),this.cache.add(e,t)}return t},I.prototype.loadBuffer=function(e){var t=this.json.buffers[e],a=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[r.KHR_BINARY_GLTF].body);var n=this.options;return new Promise((function(e,r){a.load(w(t.uri,n.path),e,void 0,(function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))},I.prototype.loadBufferView=function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){var r=t.byteLength||0,a=t.byteOffset||0;return e.slice(a,a+r)}))},I.prototype.loadAccessor=function(e){var t=this,r=this.json,a=this.json.accessors[e];if(void 0===a.bufferView&&void 0===a.sparse)return Promise.resolve(null);var o=[];return void 0!==a.bufferView?o.push(this.getDependency("bufferView",a.bufferView)):o.push(null),void 0!==a.sparse&&(o.push(this.getDependency("bufferView",a.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",a.sparse.values.bufferView))),Promise.all(o).then((function(e){var o,s,i=e[0],l=M[a.type],c=v[a.componentType],u=c.BYTES_PER_ELEMENT,d=u*l,p=a.byteOffset||0,h=void 0!==a.bufferView?r.bufferViews[a.bufferView].byteStride:void 0,f=!0===a.normalized;if(h&&h!==d){var m=Math.floor(p/h),g="InterleavedBuffer:"+a.bufferView+":"+a.componentType+":"+m+":"+a.count,y=t.cache.get(g);y||(o=new c(i,m*h,a.count*h/u),y=new n.InterleavedBuffer(o,h/u),t.cache.add(g,y)),s=new n.InterleavedBufferAttribute(y,l,p%h/u,f)}else o=null===i?new c(a.count*l):new c(i,p,a.count*l),s=new n.BufferAttribute(o,l,f);if(void 0!==a.sparse){var T=M.SCALAR,R=v[a.sparse.indices.componentType],A=a.sparse.indices.byteOffset||0,S=a.sparse.values.byteOffset||0,b=new R(e[1],A,a.sparse.count*T),w=new c(e[2],S,a.sparse.count*l);null!==i&&(s=new n.BufferAttribute(s.array.slice(),s.itemSize,s.normalized));for(var L=0,_=b.length;L<_;L++){var E=b[L];if(s.setX(E,w[L*l]),l>=2&&s.setY(E,w[L*l+1]),l>=3&&s.setZ(E,w[L*l+2]),l>=4&&s.setW(E,w[L*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return s}))},I.prototype.loadTexture=function(e){var t,a=this,o=this.json,s=this.options,i=this.textureLoader,l=self.URL||self.webkitURL,c=o.textures[e],u=c.extensions||{},d=(t=u[r.MSFT_TEXTURE_DDS]?o.images[u[r.MSFT_TEXTURE_DDS].source]:o.images[c.source]).uri,p=!1;return void 0!==t.bufferView&&(d=a.getDependency("bufferView",t.bufferView).then((function(e){p=!0;var r=new Blob([e],{type:t.mimeType});return d=l.createObjectURL(r)}))),Promise.resolve(d).then((function(e){var t=s.manager.getHandler(e);return t||(t=u[r.MSFT_TEXTURE_DDS]?a.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:i),new Promise((function(r,a){t.load(w(e,s.path),r,void 0,a)}))})).then((function(r){!0===p&&l.revokeObjectURL(d),r.flipY=!1,c.name&&(r.name=c.name),t.mimeType in b&&(r.format=b[t.mimeType]);var s=(o.samplers||{})[c.sampler]||{};return r.magFilter=y[s.magFilter]||n.LinearFilter,r.minFilter=y[s.minFilter]||n.LinearMipmapLinearFilter,r.wrapS=T[s.wrapS]||n.RepeatWrapping,r.wrapT=T[s.wrapT]||n.RepeatWrapping,a.associations.set(r,{type:"textures",index:e}),r}))},I.prototype.assignTexture=function(e,t,a){var o=this;return this.getDependency("texture",a.index).then((function(s){if(!s.isCompressedTexture)switch(t){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":s.format=n.RGBFormat}if(void 0===a.texCoord||0==a.texCoord||"aoMap"===t&&1==a.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+a.texCoord+" for texture "+t+" not yet supported."),o.extensions[r.KHR_TEXTURE_TRANSFORM]){var i=void 0!==a.extensions?a.extensions[r.KHR_TEXTURE_TRANSFORM]:void 0;if(i){var l=this.associations.get(s);s=o.extensions[r.KHR_TEXTURE_TRANSFORM].extendTexture(s,i),this.associations.set(s,l)}}e[t]=s}))},I.prototype.assignFinalMaterial=function(e){var t=e.geometry,r=e.material,a=void 0!==t.attributes.tangent,o=void 0!==t.attributes.color,s=void 0===t.attributes.normal,i=!0===e.isSkinnedMesh,l=Object.keys(t.morphAttributes).length>0,c=l&&void 0!==t.morphAttributes.normal;if(e.isPoints){var u="PointsMaterial:"+r.uuid,d=this.cache.get(u);d||(d=new n.PointsMaterial,n.Material.prototype.copy.call(d,r),d.color.copy(r.color),d.map=r.map,d.sizeAttenuation=!1,this.cache.add(u,d)),r=d}else if(e.isLine){u="LineBasicMaterial:"+r.uuid;var p=this.cache.get(u);p||(p=new n.LineBasicMaterial,n.Material.prototype.copy.call(p,r),p.color.copy(r.color),this.cache.add(u,p)),r=p}if(a||o||s||i||l){u="ClonedMaterial:"+r.uuid+":",r.isGLTFSpecularGlossinessMaterial&&(u+="specular-glossiness:"),i&&(u+="skinning:"),a&&(u+="vertex-tangents:"),o&&(u+="vertex-colors:"),s&&(u+="flat-shading:"),l&&(u+="morph-targets:"),c&&(u+="morph-normals:");var h=this.cache.get(u);h||(h=r.clone(),i&&(h.skinning=!0),a&&(h.vertexTangents=!0),o&&(h.vertexColors=!0),s&&(h.flatShading=!0),l&&(h.morphTargets=!0),c&&(h.morphNormals=!0),this.cache.add(u,h),this.associations.set(h,this.associations.get(r))),r=h}r.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),r.normalScale&&!a&&(r.normalScale.y=-r.normalScale.y),r.clearcoatNormalScale&&!a&&(r.clearcoatNormalScale.y=-r.clearcoatNormalScale.y),e.material=r},I.prototype.loadMaterial=function(e){var t,a=this,o=this.json,s=this.extensions,i=o.materials[e],l={},c=i.extensions||{},u=[];if(c[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var d=s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=d.getMaterialType(),u.push(d.extendParams(l,i,a))}else if(c[r.KHR_MATERIALS_UNLIT]){var p=s[r.KHR_MATERIALS_UNLIT];t=p.getMaterialType(),u.push(p.extendParams(l,i,a))}else{t=n.MeshStandardMaterial;var f=i.pbrMetallicRoughness||{};if(l.color=new n.Color(1,1,1),l.opacity=1,Array.isArray(f.baseColorFactor)){var m=f.baseColorFactor;l.color.fromArray(m),l.opacity=m[3]}void 0!==f.baseColorTexture&&u.push(a.assignTexture(l,"map",f.baseColorTexture)),l.metalness=void 0!==f.metallicFactor?f.metallicFactor:1,l.roughness=void 0!==f.roughnessFactor?f.roughnessFactor:1,void 0!==f.metallicRoughnessTexture&&(u.push(a.assignTexture(l,"metalnessMap",f.metallicRoughnessTexture)),u.push(a.assignTexture(l,"roughnessMap",f.metallicRoughnessTexture)))}!0===i.doubleSided&&(l.side=n.DoubleSide);var g=i.alphaMode||"OPAQUE";if("BLEND"===g?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,"MASK"===g&&(l.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==n.MeshBasicMaterial&&(u.push(a.assignTexture(l,"normalMap",i.normalTexture)),l.normalScale=new n.Vector2(1,1),void 0!==i.normalTexture.scale&&l.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==n.MeshBasicMaterial&&(u.push(a.assignTexture(l,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(l.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==n.MeshBasicMaterial&&(l.emissive=(new n.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==n.MeshBasicMaterial&&u.push(a.assignTexture(l,"emissiveMap",i.emissiveTexture)),c[r.KHR_MATERIALS_CLEARCOAT]){var v=s[r.KHR_MATERIALS_CLEARCOAT];t=v.getMaterialType(),u.push(v.extendParams(l,{extensions:c},a))}return c[r.KHR_MATERIALS_TRANSMISSION]&&(v=s[r.KHR_MATERIALS_TRANSMISSION],t=v.getMaterialType(),u.push(v.extendParams(l,{extensions:c},a))),Promise.all(u).then((function(){var o;return o=t===h?s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):new t(l),i.name&&(o.name=i.name),o.map&&(o.map.encoding=n.sRGBEncoding),o.emissiveMap&&(o.emissiveMap.encoding=n.sRGBEncoding),_(o,i),a.associations.set(o,{type:"materials",index:e}),i.extensions&&L(s,o,i),o}))},I.prototype.loadGeometries=function(e){var t=this,a=this.extensions,o=this.primitiveCache;function s(e){return a[r.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(r){return C(r,e,t)}))}for(var i,l,c=[],u=0,d=e.length;u<d;u++){var p,h=e[u],f=(void 0,(l=(i=h).extensions&&i.extensions[r.KHR_DRACO_MESH_COMPRESSION])?"draco:"+l.bufferView+":"+l.indices+":"+x(l.attributes):i.indices+":"+x(i.attributes)+":"+i.mode),m=o[f];m?c.push(m.promise):(p=h.extensions&&h.extensions[r.KHR_DRACO_MESH_COMPRESSION]?s(h):C(new n.BufferGeometry,h,t),o[f]={primitive:h,promise:p},c.push(p))}return Promise.all(c)},I.prototype.loadMesh=function(e){for(var t,r=this,a=this.json.meshes[e],o=a.primitives,s=[],i=0,l=o.length;i<l;i++){var c=void 0===o[i].material?(void 0===(t=this.cache).DefaultMaterial&&(t.DefaultMaterial=new n.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:n.FrontSide})),t.DefaultMaterial):this.getDependency("material",o[i].material);s.push(c)}return s.push(r.loadGeometries(o)),Promise.all(s).then((function(t){for(var s=t.slice(0,t.length-1),i=t[t.length-1],l=[],c=0,u=i.length;c<u;c++){var d,p=i[c],h=o[c],f=s[c];if(4===h.mode||5===h.mode||6===h.mode||void 0===h.mode)!0!==(d=!0===a.isSkinnedMesh?new n.SkinnedMesh(p,f):new n.Mesh(p,f)).isSkinnedMesh||d.geometry.attributes.skinWeight.normalized||d.normalizeSkinWeights(),5===h.mode?d.geometry=D(d.geometry,n.TriangleStripDrawMode):6===h.mode&&(d.geometry=D(d.geometry,n.TriangleFanDrawMode));else if(1===h.mode)d=new n.LineSegments(p,f);else if(3===h.mode)d=new n.Line(p,f);else if(2===h.mode)d=new n.LineLoop(p,f);else{if(0!==h.mode)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+h.mode);d=new n.Points(p,f)}Object.keys(d.geometry.morphAttributes).length>0&&E(d,a),d.name=a.name||"mesh_"+e,i.length>1&&(d.name+="_"+c),_(d,a),r.assignFinalMaterial(d),l.push(d)}if(1===l.length)return l[0];var m=new n.Group;for(c=0,u=l.length;c<u;c++)m.add(l[c]);return m}))},I.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],a=r[r.type];if(a)return"perspective"===r.type?t=new n.PerspectiveCamera(n.MathUtils.radToDeg(a.yfov),a.aspectRatio||1,a.znear||1,a.zfar||2e6):"orthographic"===r.type&&(t=new n.OrthographicCamera(-a.xmag,a.xmag,a.ymag,-a.ymag,a.znear,a.zfar)),r.name&&(t.name=r.name),_(t,r),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},I.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},I.prototype.loadAnimation=function(e){for(var t=this.json.animations[e],r=[],a=[],o=[],s=[],i=[],l=0,c=t.channels.length;l<c;l++){var u=t.channels[l],d=t.samplers[u.sampler],p=u.target,h=void 0!==p.node?p.node:p.id,f=void 0!==t.parameters?t.parameters[d.input]:d.input,m=void 0!==t.parameters?t.parameters[d.output]:d.output;r.push(this.getDependency("node",h)),a.push(this.getDependency("accessor",f)),o.push(this.getDependency("accessor",m)),s.push(d),i.push(p)}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o),Promise.all(s),Promise.all(i)]).then((function(r){for(var a=r[0],o=r[1],s=r[2],i=r[3],l=r[4],c=[],u=0,d=a.length;u<d;u++){var p=a[u],h=o[u],f=s[u],m=i[u],v=l[u];if(void 0!==p){var y;switch(p.updateMatrix(),p.matrixAutoUpdate=!0,A[v.path]){case A.weights:y=n.NumberKeyframeTrack;break;case A.rotation:y=n.QuaternionKeyframeTrack;break;default:y=n.VectorKeyframeTrack}var T=p.name?p.name:p.uuid,M=void 0!==m.interpolation?S[m.interpolation]:n.InterpolateLinear,R=[];A[v.path]===A.weights?p.traverse((function(e){!0===e.isMesh&&e.morphTargetInfluences&&R.push(e.name?e.name:e.uuid)})):R.push(T);var b=f.array;if(f.normalized){var w;if(b.constructor===Int8Array)w=1/127;else if(b.constructor===Uint8Array)w=1/255;else if(b.constructor==Int16Array)w=1/32767;else{if(b.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");w=1/65535}for(var L=new Float32Array(b.length),_=0,E=b.length;_<E;_++)L[_]=b[_]*w;b=L}for(_=0,E=R.length;_<E;_++){var x=new y(R[_]+"."+A[v.path],h.array,b,M);"CUBICSPLINE"===m.interpolation&&(x.createInterpolant=function(e){return new g(this.times,this.values,this.getValueSize()/3,e)},x.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),c.push(x)}}}var I=t.name?t.name:"animation_"+e;return new n.AnimationClip(I,void 0,c)}))},I.prototype.loadNode=function(e){var t,a=this.json,o=this.extensions,s=this,i=a.meshReferences,l=a.meshUses,c=a.nodes[e];return(t=[],void 0!==c.mesh&&t.push(s.getDependency("mesh",c.mesh).then((function(e){var t;if(i[c.mesh]>1){var r=l[c.mesh]++;(t=e.clone()).name+="_instance_"+r}else t=e;return void 0!==c.weights&&t.traverse((function(e){if(e.isMesh)for(var t=0,r=c.weights.length;t<r;t++)e.morphTargetInfluences[t]=c.weights[t]})),t}))),void 0!==c.camera&&t.push(s.getDependency("camera",c.camera)),c.extensions&&c.extensions[r.KHR_LIGHTS_PUNCTUAL]&&void 0!==c.extensions[r.KHR_LIGHTS_PUNCTUAL].light&&t.push(s.getDependency("light",c.extensions[r.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(t)).then((function(t){var r;if((r=!0===c.isBone?new n.Bone:t.length>1?new n.Group:1===t.length?t[0]:new n.Object3D)!==t[0])for(var a=0,i=t.length;a<i;a++)r.add(t[a]);if(c.name&&(r.userData.name=c.name,r.name=n.PropertyBinding.sanitizeNodeName(c.name)),_(r,c),c.extensions&&L(o,r,c),void 0!==c.matrix){var l=new n.Matrix4;l.fromArray(c.matrix),r.applyMatrix4(l)}else void 0!==c.translation&&r.position.fromArray(c.translation),void 0!==c.rotation&&r.quaternion.fromArray(c.rotation),void 0!==c.scale&&r.scale.fromArray(c.scale);return s.associations.set(r,{type:"nodes",index:e}),r}))},I.prototype.loadScene=function(){function e(t,r,a,o){var s=a.nodes[t];return o.getDependency("node",t).then((function(e){return void 0===s.skin?e:o.getDependency("skin",s.skin).then((function(e){for(var r=[],a=0,n=(t=e).joints.length;a<n;a++)r.push(o.getDependency("node",t.joints[a]));return Promise.all(r)})).then((function(r){return e.traverse((function(e){if(e.isMesh){for(var a=[],o=[],s=0,i=r.length;s<i;s++){var l=r[s];if(l){a.push(l);var c=new n.Matrix4;void 0!==t.inverseBindMatrices&&c.fromArray(t.inverseBindMatrices.array,16*s),o.push(c)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[s])}e.bind(new n.Skeleton(a,o),e.matrixWorld)}})),e}));var t})).then((function(t){r.add(t);var n=[];if(s.children)for(var i=s.children,l=0,c=i.length;l<c;l++){var u=i[l];n.push(e(u,t,a,o))}return Promise.all(n)}))}return function(t){var r=this.json,a=this.extensions,o=this.json.scenes[t],s=new n.Group;o.name&&(s.name=o.name),_(s,o),o.extensions&&L(a,s,o);for(var i=o.nodes||[],l=[],c=0,u=i.length;c<u;c++)l.push(e(i[c],s,r,this));return Promise.all(l).then((function(){return s}))}}(),e}(),s=function(e){n.Loader.call(this,e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}};s.prototype=Object.assign(Object.create(n.Loader.prototype),{constructor:s,setDecoderPath:function(e){return this.decoderPath=e,this},setDecoderConfig:function(e){return this.decoderConfig=e,this},setWorkerLimit:function(e){return this.workerLimit=e,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(e,t,r,a){var o=new n.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),"use-credentials"===this.crossOrigin&&o.setWithCredentials(!0),o.load(e,(e=>{var r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(a)}),r,a)},decodeDracoFile:function(e,t,r,a){var n={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:a||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,n).then(t)},decodeGeometry:function(e,t){for(var r in t.attributeTypes){var a=t.attributeTypes[r];void 0!==a.BYTES_PER_ELEMENT&&(t.attributeTypes[r]=a.name)}var n,o=JSON.stringify(t);if(s.taskCache.has(e)){var i=s.taskCache.get(e);if(i.key===o)return i.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var l=this.workerNextTaskID++,c=e.byteLength,u=this._getWorker(l,c).then((r=>(n=r,new Promise(((r,a)=>{n._callbacks[l]={resolve:r,reject:a},n.postMessage({type:"decode",id:l,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return u.catch((()=>!0)).then((()=>{n&&l&&this._releaseTask(n,l)})),s.taskCache.set(e,{key:o,promise:u}),u},_createGeometry:function(e){var t=new n.BufferGeometry;e.index&&t.setIndex(new n.BufferAttribute(e.index.array,1));for(var r=0;r<e.attributes.length;r++){var a=e.attributes[r],o=a.name,s=a.array,i=a.itemSize;t.setAttribute(o,new n.BufferAttribute(s,i))}return t},_loadLibrary:function(e,t){var r=new n.FileLoader(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),new Promise(((t,a)=>{r.load(e,t,void 0,a)}))},preload:function(){return this._initDecoder(),this},_initDecoder:function(){if(this.decoderPending)return this.decoderPending;var e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{var r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);var a=s.DRACOWorker.toString(),n=["/* draco decoder */",r,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))})),this.decoderPending},_getWorker:function(e,t){return this._initDecoder().then((()=>{var r;return this.workerPool.length<this.workerLimit?((r=new Worker(this.workerSourceURL))._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(e){var t=e.data;switch(t.type){case"decode":r._callbacks[t.id].resolve(t);break;case"error":r._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},this.workerPool.push(r)):this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1})),(r=this.workerPool[this.workerPool.length-1])._taskCosts[e]=t,r._taskLoad+=t,r}))},_releaseTask:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]},debug:function(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))},dispose:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}),s.DRACOWorker=function(){var e,t;function r(e,t,r,a,n,o){var s,i,l=o.num_components(),c=r.num_points()*l;switch(n){case Float32Array:s=new e.DracoFloat32Array,t.GetAttributeFloatForAllPoints(r,o,s),i=new Float32Array(c);break;case Int8Array:s=new e.DracoInt8Array,t.GetAttributeInt8ForAllPoints(r,o,s),i=new Int8Array(c);break;case Int16Array:s=new e.DracoInt16Array,t.GetAttributeInt16ForAllPoints(r,o,s),i=new Int16Array(c);break;case Int32Array:s=new e.DracoInt32Array,t.GetAttributeInt32ForAllPoints(r,o,s),i=new Int32Array(c);break;case Uint8Array:s=new e.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(r,o,s),i=new Uint8Array(c);break;case Uint16Array:s=new e.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(r,o,s),i=new Uint16Array(c);break;case Uint32Array:s=new e.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(r,o,s),i=new Uint32Array(c);break;default:throw new Error("THREE.DRACOLoader: Unexpected attribute type.")}for(var u=0;u<c;u++)i[u]=s.GetValue(u);return e.destroy(s),{name:a,array:i,itemSize:l}}onmessage=function(a){var n=a.data;switch(n.type){case"init":e=n.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":var o=n.buffer,s=n.taskConfig;t.then((e=>{var t=e.draco,a=new t.Decoder,i=new t.DecoderBuffer;i.Init(new Int8Array(o),o.byteLength);try{var l=function(e,t,a,n){var o,s,i=n.attributeIDs,l=n.attributeTypes,c=t.GetEncodedGeometryType(a);if(c===e.TRIANGULAR_MESH)o=new e.Mesh,s=t.DecodeBufferToMesh(a,o);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");o=new e.PointCloud,s=t.DecodeBufferToPointCloud(a,o)}if(!s.ok()||0===o.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+s.error_msg());var u={index:null,attributes:[]};for(var d in i){var p,h,f=self[l[d]];if(n.useUniqueIDs)h=i[d],p=t.GetAttributeByUniqueId(o,h);else{if(-1===(h=t.GetAttributeId(o,e[i[d]])))continue;p=t.GetAttribute(o,h)}u.attributes.push(r(e,t,o,d,f,p))}if(c===e.TRIANGULAR_MESH){for(var m=o.num_faces(),g=new Uint32Array(3*m),v=new e.DracoInt32Array,y=0;y<m;++y){t.GetFaceFromMesh(o,y,v);for(var T=0;T<3;++T)g[3*y+T]=v.GetValue(T)}u.index={array:g,itemSize:1},e.destroy(v)}return e.destroy(o),u}(t,a,i,s),c=l.attributes.map((e=>e.array.buffer));l.index&&c.push(l.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:l},c)}catch(e){console.error(e),self.postMessage({type:"error",id:n.id,error:e.message})}finally{t.destroy(i),t.destroy(a)}}))}}},s.taskCache=new WeakMap,s.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")},s.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")},s.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")},s.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};var i=function(e){n.CompressedTextureLoader.call(this,e)};i.prototype=Object.assign(Object.create(n.CompressedTextureLoader.prototype),{constructor:i,parse:function(e,t){var r={mipmaps:[],width:0,height:0,format:null,mipmapCount:1};function a(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function o(e,t,r,a){for(var n=r*a*4,o=new Uint8Array(e,t,n),s=new Uint8Array(n),i=0,l=0,c=0;c<a;c++)for(var u=0;u<r;u++){var d=o[l],p=o[++l],h=o[++l],f=o[++l];l++,s[i]=h,s[++i]=p,s[++i]=d,s[++i]=f,i++}return s}var s,i=a("DXT1"),l=a("DXT3"),c=a("DXT5"),u=a("ETC1"),d=new Int32Array(e,0,31);if(542327876!==d[0])return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),r;if(4&!d[20])return console.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."),r;var p,h=d[21],f=!1;switch(h){case i:s=8,r.format=n.RGB_S3TC_DXT1_Format;break;case l:s=16,r.format=n.RGBA_S3TC_DXT3_Format;break;case c:s=16,r.format=n.RGBA_S3TC_DXT5_Format;break;case u:s=8,r.format=n.RGB_ETC1_Format;break;default:if(!(32===d[22]&&16711680&d[23]&&65280&d[24]&&255&d[25]&&4278190080&d[26]))return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ",(p=h,String.fromCharCode(255&p,p>>8&255,p>>16&255,p>>24&255))),r;f=!0,s=64,r.format=n.RGBAFormat}r.mipmapCount=1,131072&d[2]&&!1!==t&&(r.mipmapCount=Math.max(1,d[7]));var m=d[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=d[4],r.height=d[3];for(var g=d[1]+4,v=r.isCubemap?6:1,y=0;y<v;y++)for(var T=r.width,M=r.height,R=0;R<r.mipmapCount;R++){if(f)var A=(S=o(e,g,T,M)).length;else{A=Math.max(4,T)/4*Math.max(4,M)/4*s;var S=new Uint8Array(e,g,A)}var b={data:S,width:T,height:M};r.mipmaps.push(b),g+=A,T=Math.max(T>>1,1),M=Math.max(M>>1,1)}return r}});var l=function(e){function r(t){var r=e.call(this)||this;return r.needsRender=!0,t&&t.children.length&&r.add.apply(r,t.children),r.mixer=new n.AnimationMixer(r),r}return t(r,e),r.prototype.clone=function(){var t=e.prototype.clone.call(this,!0),r=new n.AnimationMixer(t);return t.mixer=r,t.needsRender=!0,t},r}(n.Group),c=function(e){function r(t){var r=e.call(this,t)||this;return r.ddsLoader=new i(t),r.dracoLoader=new s(t),r.dracoLoader.setDecoderPath("https://vr-public.realsee-cdn.cn/release/static/image/release/five/gltf/"),r}return t(r,e),Object.defineProperty(r,"version",{get:function(){return"5.0.0-alpha.186"},enumerable:!1,configurable:!0}),r.prototype.load=function(t,r,a,n){return e.prototype.load.call(this,t,r,a,n)},r.prototype.parse=function(t,r,a,n){return e.prototype.parse.call(this,t,r,(function(e){var t=new l(e.scene),r=e.scenes.map((function(r){return r===e.scene?t:new l(r)}));a(Object.assign(e,{scene:t,scenes:r}))}),n)},r}(o)})(),a})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FiveSDK_GLTFLoader=t():e.FiveSDK_GLTFLoader=t()}(self,(()=>(()=>{var e={438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const t=Number(THREE.REVISION);if(t<115||t>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE}},t={};function r(a){var n=t[a];if(void 0!==n)return n.exports;var o=t[a]={exports:{}};return e[a](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{"use strict";r.r(a),r.d(a,{DDSLoader:()=>i,DRACOLoader:()=>s,GLTFLoader:()=>c,GLTFObject:()=>l,THREEGLTFLoader:()=>o});var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}Object.create,Object.create;var n=r(438),o=function(){function e(e){n.Loader.call(this,e),this.dracoLoader=null,this.ddsLoader=null}function t(){var e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}e.prototype=Object.assign(Object.create(n.Loader.prototype),{constructor:e,load:function(e,t,r,a){var o,s=this;o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:n.LoaderUtils.extractUrlBase(e),s.manager.itemStart(e);var i=function(t){a?a(t):console.error(t),s.manager.itemError(e),s.manager.itemEnd(e)},l=new n.FileLoader(s.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),"use-credentials"===s.crossOrigin&&l.setWithCredentials(!0),l.load(e,(function(r){try{s.parse(r,o,(function(r){t(r),s.manager.itemEnd(e)}),i)}catch(e){i(e)}}),r,i)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},parse:function(e,t,h,g){var v,y={};if("string"==typeof e)v=e;else if(n.LoaderUtils.decodeText(new Uint8Array(e,0,4))===c){try{y[r.KHR_BINARY_GLTF]=new u(e)}catch(e){return void(g&&g(e))}v=y[r.KHR_BINARY_GLTF].content}else v=n.LoaderUtils.decodeText(new Uint8Array(e));var T=JSON.parse(v);if(void 0===T.asset||T.asset.version[0]<2)g&&g(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{if(T.extensionsUsed)for(var M=0;M<T.extensionsUsed.length;++M){var R=T.extensionsUsed[M],A=T.extensionsRequired||[];switch(R){case r.KHR_LIGHTS_PUNCTUAL:y[R]=new o(T);break;case r.KHR_MATERIALS_CLEARCOAT:y[R]=new i;break;case r.KHR_MATERIALS_TRANSMISSION:y[R]=new l;break;case r.KHR_MATERIALS_UNLIT:y[R]=new s;break;case r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:y[R]=new f;break;case r.KHR_DRACO_MESH_COMPRESSION:y[R]=new d(T,this.dracoLoader);break;case r.MSFT_TEXTURE_DDS:y[R]=new a(this.ddsLoader);break;case r.KHR_TEXTURE_TRANSFORM:y[R]=new p;break;case r.KHR_MESH_QUANTIZATION:y[R]=new m;break;default:A.indexOf(R)>=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+R+'".')}}var S=new I(T,y,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager});S.fileLoader.setRequestHeader(this.requestHeader),S.parse(h,g)}}});var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function a(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=e}function o(e){this.name=r.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[r.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function s(){this.name=r.KHR_MATERIALS_UNLIT}function i(){this.name=r.KHR_MATERIALS_CLEARCOAT}function l(){this.name=r.KHR_MATERIALS_TRANSMISSION}o.prototype.loadLight=function(e){var t,r=this.lightDefs[e],a=new n.Color(16777215);void 0!==r.color&&a.fromArray(r.color);var o=void 0!==r.range?r.range:0;switch(r.type){case"directional":(t=new n.DirectionalLight(a)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new n.PointLight(a)).distance=o;break;case"spot":(t=new n.SpotLight(a)).distance=o,r.spot=r.spot||{},r.spot.innerConeAngle=void 0!==r.spot.innerConeAngle?r.spot.innerConeAngle:0,r.spot.outerConeAngle=void 0!==r.spot.outerConeAngle?r.spot.outerConeAngle:Math.PI/4,t.angle=r.spot.outerConeAngle,t.penumbra=1-r.spot.innerConeAngle/r.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+r.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==r.intensity&&(t.intensity=r.intensity),t.name=r.name||"light_"+e,Promise.resolve(t)},s.prototype.getMaterialType=function(){return n.MeshBasicMaterial},s.prototype.extendParams=function(e,t,r){var a=[];e.color=new n.Color(1,1,1),e.opacity=1;var o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;e.color.fromArray(s),e.opacity=s[3]}void 0!==o.baseColorTexture&&a.push(r.assignTexture(e,"map",o.baseColorTexture))}return Promise.all(a)},i.prototype.getMaterialType=function(){return n.MeshPhysicalMaterial},i.prototype.extendParams=function(e,t,r){var a=[],o=t.extensions[this.name];if(void 0!==o.clearcoatFactor&&(e.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&a.push(r.assignTexture(e,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(e.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&a.push(r.assignTexture(e,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(a.push(r.assignTexture(e,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){var s=o.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new n.Vector2(s,s)}return Promise.all(a)},l.prototype.getMaterialType=function(){return n.MeshPhysicalMaterial},l.prototype.extendParams=function(e,t,r){var a=t.extensions[this.name];return void 0!==a.transmissionFactor&&(e.premultipliedAlpha=!0,e.transparent=!0,e.transparency=a.transmissionFactor),Promise.all([])};var c="glTF";function u(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,12);if(this.header={magic:n.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==c)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var a=new DataView(e,12),o=0;o<a.byteLength;){var s=a.getUint32(o,!0);o+=4;var i=a.getUint32(o,!0);if(o+=4,1313821514===i){var l=new Uint8Array(e,12+o,s);this.content=n.LoaderUtils.decodeText(l)}else if(5130562===i){var u=12+o;this.body=e.slice(u,u+s)}o+=s}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function d(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=r.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}function p(){this.name=r.KHR_TEXTURE_TRANSFORM}function h(e){n.MeshStandardMaterial.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),r=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),a=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),o=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),s=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),i={specular:{value:(new n.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=i,this.onBeforeCompile=function(e){for(var n in i)e.uniforms[n]=i[n];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),e.fragmentShader=e.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_pars_fragment>",t),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_pars_fragment>",r),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_fragment>",a),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_fragment>",o),e.fragmentShader=e.fragmentShader.replace("#include <lights_physical_fragment>",s)},Object.defineProperties(this,{specular:{get:function(){return i.specular.value},set:function(e){i.specular.value=e}},specularMap:{get:function(){return i.specularMap.value},set:function(e){i.specularMap.value=e}},glossiness:{get:function(){return i.glossiness.value},set:function(e){i.glossiness.value=e}},glossinessMap:{get:function(){return i.glossinessMap.value},set:function(e){i.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function f(){return{name:r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return h},extendParams:function(e,t,r){var a=t.extensions[this.name];e.color=new n.Color(1,1,1),e.opacity=1;var o=[];if(Array.isArray(a.diffuseFactor)){var s=a.diffuseFactor;e.color.fromArray(s),e.opacity=s[3]}if(void 0!==a.diffuseTexture&&o.push(r.assignTexture(e,"map",a.diffuseTexture)),e.emissive=new n.Color(0,0,0),e.glossiness=void 0!==a.glossinessFactor?a.glossinessFactor:1,e.specular=new n.Color(1,1,1),Array.isArray(a.specularFactor)&&e.specular.fromArray(a.specularFactor),void 0!==a.specularGlossinessTexture){var i=a.specularGlossinessTexture;o.push(r.assignTexture(e,"glossinessMap",i)),o.push(r.assignTexture(e,"specularMap",i))}return Promise.all(o)},createMaterial:function(e){var t=new h(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=n.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function m(){this.name=r.KHR_MESH_QUANTIZATION}function g(e,t,r,a){n.Interpolant.call(this,e,t,r,a)}d.prototype.decodePrimitive=function(e,t){var r=this.json,a=this.dracoLoader,n=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,s={},i={},l={};for(var c in o){var u=R[c]||c.toLowerCase();s[u]=o[c]}for(c in e.attributes)if(u=R[c]||c.toLowerCase(),void 0!==o[c]){var d=r.accessors[e.attributes[c]],p=v[d.componentType];l[u]=p,i[u]=!0===d.normalized}return t.getDependency("bufferView",n).then((function(e){return new Promise((function(t){a.decodeDracoFile(e,(function(e){for(var r in e.attributes){var a=e.attributes[r],n=i[r];void 0!==n&&(a.normalized=n)}t(e)}),s,l)}))}))},p.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},h.prototype=Object.create(n.MeshStandardMaterial.prototype),h.prototype.constructor=h,h.prototype.copy=function(e){return n.MeshStandardMaterial.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},g.prototype=Object.create(n.Interpolant.prototype),g.prototype.constructor=g,g.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,r=this.sampleValues,a=this.valueSize,n=e*a*3+a,o=0;o!==a;o++)t[o]=r[n+o];return t},g.prototype.beforeStart_=g.prototype.copySampleValue_,g.prototype.afterEnd_=g.prototype.copySampleValue_,g.prototype.interpolate_=function(e,t,r,a){for(var n=this.resultBuffer,o=this.sampleValues,s=this.valueSize,i=2*s,l=3*s,c=a-t,u=(r-t)/c,d=u*u,p=d*u,h=e*l,f=h-l,m=-2*p+3*d,g=p-d,v=1-m,y=g-d+u,T=0;T!==s;T++){var M=o[f+T+s],R=o[f+T+i]*c,A=o[h+T+s],S=o[h+T]*c;n[T]=v*M+y*R+m*A+g*S}return n};var v={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},y={9728:n.NearestFilter,9729:n.LinearFilter,9984:n.NearestMipmapNearestFilter,9985:n.LinearMipmapNearestFilter,9986:n.NearestMipmapLinearFilter,9987:n.LinearMipmapLinearFilter},T={33071:n.ClampToEdgeWrapping,33648:n.MirroredRepeatWrapping,10497:n.RepeatWrapping},M={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},R={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},A={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},S={CUBICSPLINE:void 0,LINEAR:n.InterpolateLinear,STEP:n.InterpolateDiscrete},b={"image/png":n.RGBAFormat,"image/jpeg":n.RGBFormat};function w(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function L(e,t,r){for(var a in r.extensions)void 0===e[a]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[a]=r.extensions[a])}function _(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function E(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var r=0,a=t.weights.length;r<a;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){var n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length)for(e.morphTargetDictionary={},r=0,a=n.length;r<a;r++)e.morphTargetDictionary[n[r]]=r;else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function x(e){for(var t="",r=Object.keys(e).sort(),a=0,n=r.length;a<n;a++)t+=r[a]+":"+e[r[a]]+";";return t}function I(e,r,a){this.json=e||{},this.extensions=r||{},this.options=a||{},this.cache=new t,this.associations=new Map,this.primitiveCache={},this.textureLoader=new n.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new n.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function C(e,t,r){var a=t.attributes,o=[];function s(t,a){return r.getDependency("accessor",t).then((function(t){e.setAttribute(a,t)}))}for(var i in a){var l=R[i]||i.toLowerCase();l in e.attributes||o.push(s(a[i],l))}if(void 0!==t.indices&&!e.index){var c=r.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));o.push(c)}return _(e,t),function(e,t,r){var a=t.attributes,o=new n.Box3;if(void 0!==a.POSITION){var s=(h=r.json.accessors[a.POSITION]).min,i=h.max;if(void 0!==s&&void 0!==i){o.set(new n.Vector3(s[0],s[1],s[2]),new n.Vector3(i[0],i[1],i[2]));var l=t.targets;if(void 0!==l){for(var c=new n.Vector3,u=new n.Vector3,d=0,p=l.length;d<p;d++){var h,f=l[d];void 0!==f.POSITION&&(s=(h=r.json.accessors[f.POSITION]).min,i=h.max,void 0!==s&&void 0!==i?(u.setX(Math.max(Math.abs(s[0]),Math.abs(i[0]))),u.setY(Math.max(Math.abs(s[1]),Math.abs(i[1]))),u.setZ(Math.max(Math.abs(s[2]),Math.abs(i[2]))),c.max(u)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."))}o.expandByVector(c)}e.boundingBox=o;var m=new n.Sphere;o.getCenter(m.center),m.radius=o.min.distanceTo(o.max)/2,e.boundingSphere=m}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(e,t,r),Promise.all(o).then((function(){return void 0!==t.targets?function(e,t,r){for(var a=!1,n=!1,o=0,s=t.length;o<s&&(void 0!==(c=t[o]).POSITION&&(a=!0),void 0!==c.NORMAL&&(n=!0),!a||!n);o++);if(!a&&!n)return Promise.resolve(e);var i=[],l=[];for(o=0,s=t.length;o<s;o++){var c=t[o];if(a){var u=void 0!==c.POSITION?r.getDependency("accessor",c.POSITION):e.attributes.position;i.push(u)}n&&(u=void 0!==c.NORMAL?r.getDependency("accessor",c.NORMAL):e.attributes.normal,l.push(u))}return Promise.all([Promise.all(i),Promise.all(l)]).then((function(t){var r=t[0],o=t[1];return a&&(e.morphAttributes.position=r),n&&(e.morphAttributes.normal=o),e.morphTargetsRelative=!0,e}))}(e,t.targets,r):e}))}function D(e,t){var r=e.getIndex();if(null===r){var a=[],o=e.getAttribute("position");if(void 0===o)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var s=0;s<o.count;s++)a.push(s);e.setIndex(a),r=e.getIndex()}var i=r.count-2,l=[];if(t===n.TriangleFanDrawMode)for(s=1;s<=i;s++)l.push(r.getX(0)),l.push(r.getX(s)),l.push(r.getX(s+1));else for(s=0;s<i;s++)s%2==0?(l.push(r.getX(s)),l.push(r.getX(s+1)),l.push(r.getX(s+2))):(l.push(r.getX(s+2)),l.push(r.getX(s+1)),l.push(r.getX(s)));l.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var c=e.clone();return c.setIndex(l),c}return I.prototype.parse=function(e,t){var r=this,a=this.json,n=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then((function(t){var o={scene:t[0][a.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:a.asset,parser:r,userData:{}};L(n,o,a),_(o,a),e(o)})).catch(t)},I.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},o=0,s=t.length;o<s;o++)for(var i=t[o].joints,l=0,c=i.length;l<c;l++)e[i[l]].isBone=!0;for(var u=0,d=e.length;u<d;u++){var p=e[u];void 0!==p.mesh&&(void 0===a[p.mesh]&&(a[p.mesh]=n[p.mesh]=0),a[p.mesh]++,void 0!==p.skin&&(r[p.mesh].isSkinnedMesh=!0))}this.json.meshReferences=a,this.json.meshUses=n},I.prototype.getDependency=function(e,t){var a=e+":"+t,n=this.cache.get(a);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this.loadNode(t);break;case"mesh":n=this.loadMesh(t);break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this.loadBufferView(t);break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this.loadMaterial(t);break;case"texture":n=this.loadTexture(t);break;case"skin":n=this.loadSkin(t);break;case"animation":n=this.loadAnimation(t);break;case"camera":n=this.loadCamera(t);break;case"light":n=this.extensions[r.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(a,n)}return n},I.prototype.getDependencies=function(e){var t=this.cache.get(e);if(!t){var r=this,a=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(a.map((function(t,a){return r.getDependency(e,a)}))),this.cache.add(e,t)}return t},I.prototype.loadBuffer=function(e){var t=this.json.buffers[e],a=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[r.KHR_BINARY_GLTF].body);var n=this.options;return new Promise((function(e,r){a.load(w(t.uri,n.path),e,void 0,(function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))},I.prototype.loadBufferView=function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){var r=t.byteLength||0,a=t.byteOffset||0;return e.slice(a,a+r)}))},I.prototype.loadAccessor=function(e){var t=this,r=this.json,a=this.json.accessors[e];if(void 0===a.bufferView&&void 0===a.sparse)return Promise.resolve(null);var o=[];return void 0!==a.bufferView?o.push(this.getDependency("bufferView",a.bufferView)):o.push(null),void 0!==a.sparse&&(o.push(this.getDependency("bufferView",a.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",a.sparse.values.bufferView))),Promise.all(o).then((function(e){var o,s,i=e[0],l=M[a.type],c=v[a.componentType],u=c.BYTES_PER_ELEMENT,d=u*l,p=a.byteOffset||0,h=void 0!==a.bufferView?r.bufferViews[a.bufferView].byteStride:void 0,f=!0===a.normalized;if(h&&h!==d){var m=Math.floor(p/h),g="InterleavedBuffer:"+a.bufferView+":"+a.componentType+":"+m+":"+a.count,y=t.cache.get(g);y||(o=new c(i,m*h,a.count*h/u),y=new n.InterleavedBuffer(o,h/u),t.cache.add(g,y)),s=new n.InterleavedBufferAttribute(y,l,p%h/u,f)}else o=null===i?new c(a.count*l):new c(i,p,a.count*l),s=new n.BufferAttribute(o,l,f);if(void 0!==a.sparse){var T=M.SCALAR,R=v[a.sparse.indices.componentType],A=a.sparse.indices.byteOffset||0,S=a.sparse.values.byteOffset||0,b=new R(e[1],A,a.sparse.count*T),w=new c(e[2],S,a.sparse.count*l);null!==i&&(s=new n.BufferAttribute(s.array.slice(),s.itemSize,s.normalized));for(var L=0,_=b.length;L<_;L++){var E=b[L];if(s.setX(E,w[L*l]),l>=2&&s.setY(E,w[L*l+1]),l>=3&&s.setZ(E,w[L*l+2]),l>=4&&s.setW(E,w[L*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return s}))},I.prototype.loadTexture=function(e){var t,a=this,o=this.json,s=this.options,i=this.textureLoader,l=self.URL||self.webkitURL,c=o.textures[e],u=c.extensions||{},d=(t=u[r.MSFT_TEXTURE_DDS]?o.images[u[r.MSFT_TEXTURE_DDS].source]:o.images[c.source]).uri,p=!1;return void 0!==t.bufferView&&(d=a.getDependency("bufferView",t.bufferView).then((function(e){p=!0;var r=new Blob([e],{type:t.mimeType});return d=l.createObjectURL(r)}))),Promise.resolve(d).then((function(e){var t=s.manager.getHandler(e);return t||(t=u[r.MSFT_TEXTURE_DDS]?a.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:i),new Promise((function(r,a){t.load(w(e,s.path),r,void 0,a)}))})).then((function(r){!0===p&&l.revokeObjectURL(d),r.flipY=!1,c.name&&(r.name=c.name),t.mimeType in b&&(r.format=b[t.mimeType]);var s=(o.samplers||{})[c.sampler]||{};return r.magFilter=y[s.magFilter]||n.LinearFilter,r.minFilter=y[s.minFilter]||n.LinearMipmapLinearFilter,r.wrapS=T[s.wrapS]||n.RepeatWrapping,r.wrapT=T[s.wrapT]||n.RepeatWrapping,a.associations.set(r,{type:"textures",index:e}),r}))},I.prototype.assignTexture=function(e,t,a){var o=this;return this.getDependency("texture",a.index).then((function(s){if(!s.isCompressedTexture)switch(t){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":s.format=n.RGBFormat}if(void 0===a.texCoord||0==a.texCoord||"aoMap"===t&&1==a.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+a.texCoord+" for texture "+t+" not yet supported."),o.extensions[r.KHR_TEXTURE_TRANSFORM]){var i=void 0!==a.extensions?a.extensions[r.KHR_TEXTURE_TRANSFORM]:void 0;if(i){var l=this.associations.get(s);s=o.extensions[r.KHR_TEXTURE_TRANSFORM].extendTexture(s,i),this.associations.set(s,l)}}e[t]=s}))},I.prototype.assignFinalMaterial=function(e){var t=e.geometry,r=e.material,a=void 0!==t.attributes.tangent,o=void 0!==t.attributes.color,s=void 0===t.attributes.normal,i=!0===e.isSkinnedMesh,l=Object.keys(t.morphAttributes).length>0,c=l&&void 0!==t.morphAttributes.normal;if(e.isPoints){var u="PointsMaterial:"+r.uuid,d=this.cache.get(u);d||(d=new n.PointsMaterial,n.Material.prototype.copy.call(d,r),d.color.copy(r.color),d.map=r.map,d.sizeAttenuation=!1,this.cache.add(u,d)),r=d}else if(e.isLine){u="LineBasicMaterial:"+r.uuid;var p=this.cache.get(u);p||(p=new n.LineBasicMaterial,n.Material.prototype.copy.call(p,r),p.color.copy(r.color),this.cache.add(u,p)),r=p}if(a||o||s||i||l){u="ClonedMaterial:"+r.uuid+":",r.isGLTFSpecularGlossinessMaterial&&(u+="specular-glossiness:"),i&&(u+="skinning:"),a&&(u+="vertex-tangents:"),o&&(u+="vertex-colors:"),s&&(u+="flat-shading:"),l&&(u+="morph-targets:"),c&&(u+="morph-normals:");var h=this.cache.get(u);h||(h=r.clone(),i&&(h.skinning=!0),a&&(h.vertexTangents=!0),o&&(h.vertexColors=!0),s&&(h.flatShading=!0),l&&(h.morphTargets=!0),c&&(h.morphNormals=!0),this.cache.add(u,h),this.associations.set(h,this.associations.get(r))),r=h}r.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),r.normalScale&&!a&&(r.normalScale.y=-r.normalScale.y),r.clearcoatNormalScale&&!a&&(r.clearcoatNormalScale.y=-r.clearcoatNormalScale.y),e.material=r},I.prototype.loadMaterial=function(e){var t,a=this,o=this.json,s=this.extensions,i=o.materials[e],l={},c=i.extensions||{},u=[];if(c[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var d=s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=d.getMaterialType(),u.push(d.extendParams(l,i,a))}else if(c[r.KHR_MATERIALS_UNLIT]){var p=s[r.KHR_MATERIALS_UNLIT];t=p.getMaterialType(),u.push(p.extendParams(l,i,a))}else{t=n.MeshStandardMaterial;var f=i.pbrMetallicRoughness||{};if(l.color=new n.Color(1,1,1),l.opacity=1,Array.isArray(f.baseColorFactor)){var m=f.baseColorFactor;l.color.fromArray(m),l.opacity=m[3]}void 0!==f.baseColorTexture&&u.push(a.assignTexture(l,"map",f.baseColorTexture)),l.metalness=void 0!==f.metallicFactor?f.metallicFactor:1,l.roughness=void 0!==f.roughnessFactor?f.roughnessFactor:1,void 0!==f.metallicRoughnessTexture&&(u.push(a.assignTexture(l,"metalnessMap",f.metallicRoughnessTexture)),u.push(a.assignTexture(l,"roughnessMap",f.metallicRoughnessTexture)))}!0===i.doubleSided&&(l.side=n.DoubleSide);var g=i.alphaMode||"OPAQUE";if("BLEND"===g?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,"MASK"===g&&(l.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==n.MeshBasicMaterial&&(u.push(a.assignTexture(l,"normalMap",i.normalTexture)),l.normalScale=new n.Vector2(1,1),void 0!==i.normalTexture.scale&&l.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==n.MeshBasicMaterial&&(u.push(a.assignTexture(l,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(l.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==n.MeshBasicMaterial&&(l.emissive=(new n.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==n.MeshBasicMaterial&&u.push(a.assignTexture(l,"emissiveMap",i.emissiveTexture)),c[r.KHR_MATERIALS_CLEARCOAT]){var v=s[r.KHR_MATERIALS_CLEARCOAT];t=v.getMaterialType(),u.push(v.extendParams(l,{extensions:c},a))}return c[r.KHR_MATERIALS_TRANSMISSION]&&(v=s[r.KHR_MATERIALS_TRANSMISSION],t=v.getMaterialType(),u.push(v.extendParams(l,{extensions:c},a))),Promise.all(u).then((function(){var o;return o=t===h?s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):new t(l),i.name&&(o.name=i.name),o.map&&(o.map.encoding=n.sRGBEncoding),o.emissiveMap&&(o.emissiveMap.encoding=n.sRGBEncoding),_(o,i),a.associations.set(o,{type:"materials",index:e}),i.extensions&&L(s,o,i),o}))},I.prototype.loadGeometries=function(e){var t=this,a=this.extensions,o=this.primitiveCache;function s(e){return a[r.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(r){return C(r,e,t)}))}for(var i,l,c=[],u=0,d=e.length;u<d;u++){var p,h=e[u],f=(void 0,(l=(i=h).extensions&&i.extensions[r.KHR_DRACO_MESH_COMPRESSION])?"draco:"+l.bufferView+":"+l.indices+":"+x(l.attributes):i.indices+":"+x(i.attributes)+":"+i.mode),m=o[f];m?c.push(m.promise):(p=h.extensions&&h.extensions[r.KHR_DRACO_MESH_COMPRESSION]?s(h):C(new n.BufferGeometry,h,t),o[f]={primitive:h,promise:p},c.push(p))}return Promise.all(c)},I.prototype.loadMesh=function(e){for(var t,r=this,a=this.json.meshes[e],o=a.primitives,s=[],i=0,l=o.length;i<l;i++){var c=void 0===o[i].material?(void 0===(t=this.cache).DefaultMaterial&&(t.DefaultMaterial=new n.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:n.FrontSide})),t.DefaultMaterial):this.getDependency("material",o[i].material);s.push(c)}return s.push(r.loadGeometries(o)),Promise.all(s).then((function(t){for(var s=t.slice(0,t.length-1),i=t[t.length-1],l=[],c=0,u=i.length;c<u;c++){var d,p=i[c],h=o[c],f=s[c];if(4===h.mode||5===h.mode||6===h.mode||void 0===h.mode)!0!==(d=!0===a.isSkinnedMesh?new n.SkinnedMesh(p,f):new n.Mesh(p,f)).isSkinnedMesh||d.geometry.attributes.skinWeight.normalized||d.normalizeSkinWeights(),5===h.mode?d.geometry=D(d.geometry,n.TriangleStripDrawMode):6===h.mode&&(d.geometry=D(d.geometry,n.TriangleFanDrawMode));else if(1===h.mode)d=new n.LineSegments(p,f);else if(3===h.mode)d=new n.Line(p,f);else if(2===h.mode)d=new n.LineLoop(p,f);else{if(0!==h.mode)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+h.mode);d=new n.Points(p,f)}Object.keys(d.geometry.morphAttributes).length>0&&E(d,a),d.name=a.name||"mesh_"+e,i.length>1&&(d.name+="_"+c),_(d,a),r.assignFinalMaterial(d),l.push(d)}if(1===l.length)return l[0];var m=new n.Group;for(c=0,u=l.length;c<u;c++)m.add(l[c]);return m}))},I.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],a=r[r.type];if(a)return"perspective"===r.type?t=new n.PerspectiveCamera(n.MathUtils.radToDeg(a.yfov),a.aspectRatio||1,a.znear||1,a.zfar||2e6):"orthographic"===r.type&&(t=new n.OrthographicCamera(-a.xmag,a.xmag,a.ymag,-a.ymag,a.znear,a.zfar)),r.name&&(t.name=r.name),_(t,r),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},I.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},I.prototype.loadAnimation=function(e){for(var t=this.json.animations[e],r=[],a=[],o=[],s=[],i=[],l=0,c=t.channels.length;l<c;l++){var u=t.channels[l],d=t.samplers[u.sampler],p=u.target,h=void 0!==p.node?p.node:p.id,f=void 0!==t.parameters?t.parameters[d.input]:d.input,m=void 0!==t.parameters?t.parameters[d.output]:d.output;r.push(this.getDependency("node",h)),a.push(this.getDependency("accessor",f)),o.push(this.getDependency("accessor",m)),s.push(d),i.push(p)}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o),Promise.all(s),Promise.all(i)]).then((function(r){for(var a=r[0],o=r[1],s=r[2],i=r[3],l=r[4],c=[],u=0,d=a.length;u<d;u++){var p=a[u],h=o[u],f=s[u],m=i[u],v=l[u];if(void 0!==p){var y;switch(p.updateMatrix(),p.matrixAutoUpdate=!0,A[v.path]){case A.weights:y=n.NumberKeyframeTrack;break;case A.rotation:y=n.QuaternionKeyframeTrack;break;default:y=n.VectorKeyframeTrack}var T=p.name?p.name:p.uuid,M=void 0!==m.interpolation?S[m.interpolation]:n.InterpolateLinear,R=[];A[v.path]===A.weights?p.traverse((function(e){!0===e.isMesh&&e.morphTargetInfluences&&R.push(e.name?e.name:e.uuid)})):R.push(T);var b=f.array;if(f.normalized){var w;if(b.constructor===Int8Array)w=1/127;else if(b.constructor===Uint8Array)w=1/255;else if(b.constructor==Int16Array)w=1/32767;else{if(b.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");w=1/65535}for(var L=new Float32Array(b.length),_=0,E=b.length;_<E;_++)L[_]=b[_]*w;b=L}for(_=0,E=R.length;_<E;_++){var x=new y(R[_]+"."+A[v.path],h.array,b,M);"CUBICSPLINE"===m.interpolation&&(x.createInterpolant=function(e){return new g(this.times,this.values,this.getValueSize()/3,e)},x.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),c.push(x)}}}var I=t.name?t.name:"animation_"+e;return new n.AnimationClip(I,void 0,c)}))},I.prototype.loadNode=function(e){var t,a=this.json,o=this.extensions,s=this,i=a.meshReferences,l=a.meshUses,c=a.nodes[e];return(t=[],void 0!==c.mesh&&t.push(s.getDependency("mesh",c.mesh).then((function(e){var t;if(i[c.mesh]>1){var r=l[c.mesh]++;(t=e.clone()).name+="_instance_"+r}else t=e;return void 0!==c.weights&&t.traverse((function(e){if(e.isMesh)for(var t=0,r=c.weights.length;t<r;t++)e.morphTargetInfluences[t]=c.weights[t]})),t}))),void 0!==c.camera&&t.push(s.getDependency("camera",c.camera)),c.extensions&&c.extensions[r.KHR_LIGHTS_PUNCTUAL]&&void 0!==c.extensions[r.KHR_LIGHTS_PUNCTUAL].light&&t.push(s.getDependency("light",c.extensions[r.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(t)).then((function(t){var r;if((r=!0===c.isBone?new n.Bone:t.length>1?new n.Group:1===t.length?t[0]:new n.Object3D)!==t[0])for(var a=0,i=t.length;a<i;a++)r.add(t[a]);if(c.name&&(r.userData.name=c.name,r.name=n.PropertyBinding.sanitizeNodeName(c.name)),_(r,c),c.extensions&&L(o,r,c),void 0!==c.matrix){var l=new n.Matrix4;l.fromArray(c.matrix),r.applyMatrix4(l)}else void 0!==c.translation&&r.position.fromArray(c.translation),void 0!==c.rotation&&r.quaternion.fromArray(c.rotation),void 0!==c.scale&&r.scale.fromArray(c.scale);return s.associations.set(r,{type:"nodes",index:e}),r}))},I.prototype.loadScene=function(){function e(t,r,a,o){var s=a.nodes[t];return o.getDependency("node",t).then((function(e){return void 0===s.skin?e:o.getDependency("skin",s.skin).then((function(e){for(var r=[],a=0,n=(t=e).joints.length;a<n;a++)r.push(o.getDependency("node",t.joints[a]));return Promise.all(r)})).then((function(r){return e.traverse((function(e){if(e.isMesh){for(var a=[],o=[],s=0,i=r.length;s<i;s++){var l=r[s];if(l){a.push(l);var c=new n.Matrix4;void 0!==t.inverseBindMatrices&&c.fromArray(t.inverseBindMatrices.array,16*s),o.push(c)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[s])}e.bind(new n.Skeleton(a,o),e.matrixWorld)}})),e}));var t})).then((function(t){r.add(t);var n=[];if(s.children)for(var i=s.children,l=0,c=i.length;l<c;l++){var u=i[l];n.push(e(u,t,a,o))}return Promise.all(n)}))}return function(t){var r=this.json,a=this.extensions,o=this.json.scenes[t],s=new n.Group;o.name&&(s.name=o.name),_(s,o),o.extensions&&L(a,s,o);for(var i=o.nodes||[],l=[],c=0,u=i.length;c<u;c++)l.push(e(i[c],s,r,this));return Promise.all(l).then((function(){return s}))}}(),e}(),s=function(e){n.Loader.call(this,e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}};s.prototype=Object.assign(Object.create(n.Loader.prototype),{constructor:s,setDecoderPath:function(e){return this.decoderPath=e,this},setDecoderConfig:function(e){return this.decoderConfig=e,this},setWorkerLimit:function(e){return this.workerLimit=e,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(e,t,r,a){var o=new n.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),"use-credentials"===this.crossOrigin&&o.setWithCredentials(!0),o.load(e,(e=>{var r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(a)}),r,a)},decodeDracoFile:function(e,t,r,a){var n={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:a||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,n).then(t)},decodeGeometry:function(e,t){for(var r in t.attributeTypes){var a=t.attributeTypes[r];void 0!==a.BYTES_PER_ELEMENT&&(t.attributeTypes[r]=a.name)}var n,o=JSON.stringify(t);if(s.taskCache.has(e)){var i=s.taskCache.get(e);if(i.key===o)return i.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var l=this.workerNextTaskID++,c=e.byteLength,u=this._getWorker(l,c).then((r=>(n=r,new Promise(((r,a)=>{n._callbacks[l]={resolve:r,reject:a},n.postMessage({type:"decode",id:l,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return u.catch((()=>!0)).then((()=>{n&&l&&this._releaseTask(n,l)})),s.taskCache.set(e,{key:o,promise:u}),u},_createGeometry:function(e){var t=new n.BufferGeometry;e.index&&t.setIndex(new n.BufferAttribute(e.index.array,1));for(var r=0;r<e.attributes.length;r++){var a=e.attributes[r],o=a.name,s=a.array,i=a.itemSize;t.setAttribute(o,new n.BufferAttribute(s,i))}return t},_loadLibrary:function(e,t){var r=new n.FileLoader(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),new Promise(((t,a)=>{r.load(e,t,void 0,a)}))},preload:function(){return this._initDecoder(),this},_initDecoder:function(){if(this.decoderPending)return this.decoderPending;var e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{var r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);var a=s.DRACOWorker.toString(),n=["/* draco decoder */",r,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))})),this.decoderPending},_getWorker:function(e,t){return this._initDecoder().then((()=>{var r;return this.workerPool.length<this.workerLimit?((r=new Worker(this.workerSourceURL))._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(e){var t=e.data;switch(t.type){case"decode":r._callbacks[t.id].resolve(t);break;case"error":r._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},this.workerPool.push(r)):this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1})),(r=this.workerPool[this.workerPool.length-1])._taskCosts[e]=t,r._taskLoad+=t,r}))},_releaseTask:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]},debug:function(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))},dispose:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}),s.DRACOWorker=function(){var e,t;function r(e,t,r,a,n,o){var s,i,l=o.num_components(),c=r.num_points()*l;switch(n){case Float32Array:s=new e.DracoFloat32Array,t.GetAttributeFloatForAllPoints(r,o,s),i=new Float32Array(c);break;case Int8Array:s=new e.DracoInt8Array,t.GetAttributeInt8ForAllPoints(r,o,s),i=new Int8Array(c);break;case Int16Array:s=new e.DracoInt16Array,t.GetAttributeInt16ForAllPoints(r,o,s),i=new Int16Array(c);break;case Int32Array:s=new e.DracoInt32Array,t.GetAttributeInt32ForAllPoints(r,o,s),i=new Int32Array(c);break;case Uint8Array:s=new e.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(r,o,s),i=new Uint8Array(c);break;case Uint16Array:s=new e.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(r,o,s),i=new Uint16Array(c);break;case Uint32Array:s=new e.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(r,o,s),i=new Uint32Array(c);break;default:throw new Error("THREE.DRACOLoader: Unexpected attribute type.")}for(var u=0;u<c;u++)i[u]=s.GetValue(u);return e.destroy(s),{name:a,array:i,itemSize:l}}onmessage=function(a){var n=a.data;switch(n.type){case"init":e=n.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":var o=n.buffer,s=n.taskConfig;t.then((e=>{var t=e.draco,a=new t.Decoder,i=new t.DecoderBuffer;i.Init(new Int8Array(o),o.byteLength);try{var l=function(e,t,a,n){var o,s,i=n.attributeIDs,l=n.attributeTypes,c=t.GetEncodedGeometryType(a);if(c===e.TRIANGULAR_MESH)o=new e.Mesh,s=t.DecodeBufferToMesh(a,o);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");o=new e.PointCloud,s=t.DecodeBufferToPointCloud(a,o)}if(!s.ok()||0===o.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+s.error_msg());var u={index:null,attributes:[]};for(var d in i){var p,h,f=self[l[d]];if(n.useUniqueIDs)h=i[d],p=t.GetAttributeByUniqueId(o,h);else{if(-1===(h=t.GetAttributeId(o,e[i[d]])))continue;p=t.GetAttribute(o,h)}u.attributes.push(r(e,t,o,d,f,p))}if(c===e.TRIANGULAR_MESH){for(var m=o.num_faces(),g=new Uint32Array(3*m),v=new e.DracoInt32Array,y=0;y<m;++y){t.GetFaceFromMesh(o,y,v);for(var T=0;T<3;++T)g[3*y+T]=v.GetValue(T)}u.index={array:g,itemSize:1},e.destroy(v)}return e.destroy(o),u}(t,a,i,s),c=l.attributes.map((e=>e.array.buffer));l.index&&c.push(l.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:l},c)}catch(e){console.error(e),self.postMessage({type:"error",id:n.id,error:e.message})}finally{t.destroy(i),t.destroy(a)}}))}}},s.taskCache=new WeakMap,s.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")},s.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")},s.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")},s.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};var i=function(e){n.CompressedTextureLoader.call(this,e)};i.prototype=Object.assign(Object.create(n.CompressedTextureLoader.prototype),{constructor:i,parse:function(e,t){var r={mipmaps:[],width:0,height:0,format:null,mipmapCount:1};function a(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function o(e,t,r,a){for(var n=r*a*4,o=new Uint8Array(e,t,n),s=new Uint8Array(n),i=0,l=0,c=0;c<a;c++)for(var u=0;u<r;u++){var d=o[l],p=o[++l],h=o[++l],f=o[++l];l++,s[i]=h,s[++i]=p,s[++i]=d,s[++i]=f,i++}return s}var s,i=a("DXT1"),l=a("DXT3"),c=a("DXT5"),u=a("ETC1"),d=new Int32Array(e,0,31);if(542327876!==d[0])return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),r;if(4&!d[20])return console.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."),r;var p,h=d[21],f=!1;switch(h){case i:s=8,r.format=n.RGB_S3TC_DXT1_Format;break;case l:s=16,r.format=n.RGBA_S3TC_DXT3_Format;break;case c:s=16,r.format=n.RGBA_S3TC_DXT5_Format;break;case u:s=8,r.format=n.RGB_ETC1_Format;break;default:if(!(32===d[22]&&16711680&d[23]&&65280&d[24]&&255&d[25]&&4278190080&d[26]))return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ",(p=h,String.fromCharCode(255&p,p>>8&255,p>>16&255,p>>24&255))),r;f=!0,s=64,r.format=n.RGBAFormat}r.mipmapCount=1,131072&d[2]&&!1!==t&&(r.mipmapCount=Math.max(1,d[7]));var m=d[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=d[4],r.height=d[3];for(var g=d[1]+4,v=r.isCubemap?6:1,y=0;y<v;y++)for(var T=r.width,M=r.height,R=0;R<r.mipmapCount;R++){if(f)var A=(S=o(e,g,T,M)).length;else{A=Math.max(4,T)/4*Math.max(4,M)/4*s;var S=new Uint8Array(e,g,A)}var b={data:S,width:T,height:M};r.mipmaps.push(b),g+=A,T=Math.max(T>>1,1),M=Math.max(M>>1,1)}return r}});var l=function(e){function r(t){var r=e.call(this)||this;return r.needsRender=!0,t&&t.children.length&&r.add.apply(r,t.children),r.mixer=new n.AnimationMixer(r),r}return t(r,e),r.prototype.clone=function(){var t=e.prototype.clone.call(this,!0),r=new n.AnimationMixer(t);return t.mixer=r,t.needsRender=!0,t},r}(n.Group),c=function(e){function r(t){var r=e.call(this,t)||this;return r.ddsLoader=new i(t),r.dracoLoader=new s(t),r.dracoLoader.setDecoderPath("https://vr-public.realsee-cdn.cn/release/static/image/release/five/gltf/"),r}return t(r,e),Object.defineProperty(r,"version",{get:function(){return"5.0.0-alpha.188"},enumerable:!1,configurable:!0}),r.prototype.load=function(t,r,a,n){return e.prototype.load.call(this,t,r,a,n)},r.prototype.parse=function(t,r,a,n){return e.prototype.parse.call(this,t,r,(function(e){var t=new l(e.scene),r=e.scenes.map((function(r){return r===e.scene?t:new l(r)}));a(Object.assign(e,{scene:t,scenes:r}))}),n)},r}(o)})(),a})()));
package/umd/five-line.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FiveSDK_Line=e():t.FiveSDK_Line=e()}(self,(()=>(()=>{var t={438:t=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const e=Number(THREE.REVISION);if(e<115||e>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');t.exports=window.THREE}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{Line:()=>p,LineGeometry:()=>l,LineMaterial:()=>s,LineSegmentsGeometry:()=>o,THREE_Line2:()=>c,THREE_LineSegments2:()=>u});var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}Object.create,Object.create;var r=n(438),o=function(t){function n(){var e=t.call(this)||this;return e.type="LineSegmentsGeometry",e.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),e.setAttribute("position",new r.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),e.setAttribute("uv",new r.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),e}return e(n,t),n.prototype.applyMatrix4=function(t){var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},n.prototype.setPositions=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var n=new r.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new r.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},n.prototype.setColors=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var n=new r.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceColorStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new r.InterleavedBufferAttribute(n,3,3)),this},n.prototype.fromWireframeGeometry=function(t){return this.setPositions(t.attributes.position.array),this},n.prototype.fromEdgesGeometry=function(t){return this.setPositions(t.attributes.position.array),this},n.prototype.fromMesh=function(t){return this.fromWireframeGeometry(new r.WireframeGeometry(t.geometry)),this},n.prototype.fromLineSegments=function(t){var e=t.geometry;if(e instanceof r.Geometry){var n=(new r.BufferGeometry).fromGeometry(e);this.setPositions(n.attributes.position.array)}else e instanceof r.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},n.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new r.Box3);var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=new r.Box3;this.boundingBox.setFromBufferAttribute(t),n.setFromBufferAttribute(e),this.boundingBox.union(n)}},n.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new r.Sphere),null===this.boundingBox&&this.computeBoundingBox();var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=this.boundingSphere.center;this.boundingBox.getCenter(n);for(var i=0,o=new r.Vector3,a=0,s=t.count;a<s;a++)o.fromBufferAttribute(t,a),i=Math.max(i,n.distanceToSquared(o)),o.fromBufferAttribute(e,a),i=Math.max(i,n.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},n.prototype.toJSON=function(){},n}(r.InstancedBufferGeometry);Object.assign(o.prototype,{isLineSegmentsGeometry:!0});var a={uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new r.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"},s=function(t){function n(e){var n=t.call(this,{uniforms:r.UniformsUtils.clone(a.uniforms),vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,clipping:!0})||this;return n.type="LineMaterial",n.dashed=!1,Object.defineProperties(n,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),n.setValues(e),n}return e(n,t),n}(r.ShaderMaterial);Object.assign(s.prototype,{isLineMaterial:!0});var u=function(t){function n(e,n){var i=t.call(this)||this;return i.type="LineSegments2",i.geometry=void 0!==e?e:new o,i.material=void 0!==n?n:new s({color:16777215*Math.random()}),i}return e(n,t),n.prototype.computeLineDistances=function(){for(var t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.count),o=new r.Vector3,a=new r.Vector3,s=0,u=0,c=e.count;s<c;s++,u+=2)o.fromBufferAttribute(e,s),a.fromBufferAttribute(n,s),i[u]=0===u?0:i[u-1],i[u+1]=i[u]+o.distanceTo(a);var l=new r.InstancedInterleavedBuffer(i,2,1);return t.setAttribute("instanceDistanceStart",new r.InterleavedBufferAttribute(l,1,0)),t.setAttribute("instanceDistanceEnd",new r.InterleavedBufferAttribute(l,1,1)),this},n.prototype.raycast=function(t,e){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var n=t.ray,i=t.camera,o=i.projectionMatrix,a=this.geometry,s=this.material,u=s.resolution,c=s.linewidth,l=a.attributes.instanceStart,f=a.attributes.instanceEnd,d=new r.Vector4,p=new r.Vector4,m=new r.Vector4,v=new r.Vector3,h=new r.Matrix4,y=new r.Line3,A=new r.Vector3;n.at(1,m),m.w=1,m.applyMatrix4(i.matrixWorldInverse),m.applyMatrix4(o),m.multiplyScalar(1/m.w),m.x*=u.x/2,m.y*=u.y/2,m.z=0,v.copy(m);var g=this.matrixWorld;h.multiplyMatrices(i.matrixWorldInverse,g);for(var b=0,w=l.count;b<w;b++){d.fromBufferAttribute(l,b),p.fromBufferAttribute(f,b),d.w=1,p.w=1,d.applyMatrix4(h),p.applyMatrix4(h),d.applyMatrix4(o),p.applyMatrix4(o),d.multiplyScalar(1/d.w),p.multiplyScalar(1/p.w);var S=d.z<-1&&p.z<-1,x=d.z>1&&p.z>1;if(!S&&!x){d.x*=u.x/2,d.y*=u.y/2,p.x*=u.x/2,p.y*=u.y/2,y.start.copy(d),y.start.z=0,y.end.copy(p),y.end.z=0;var E=y.closestPointToPointParameter(v,!0);y.at(E,A);var B=r.MathUtils.lerp(d.z,p.z,E),P=B>=-1&&B<=1,M=v.distanceTo(A)<.5*c;if(P&&M){y.start.fromBufferAttribute(l,b),y.end.fromBufferAttribute(f,b),y.start.applyMatrix4(g),y.end.applyMatrix4(g);var z=new r.Vector3,L=new r.Vector3;n.distanceSqToSegment(y.start,y.end,L,z),e.push({point:L,pointOnLine:z,distance:n.origin.distanceTo(L),object:this,faceIndex:b})}}}},n}(r.Mesh);Object.assign(u.prototype,{isLineSegments2:!0});var c=function(t){function n(e,n){var i=t.call(this,e,n)||this;return i.type="Line2",i}return e(n,t),n}(u);Object.assign(c.prototype,{isLine2:!0});var l=function(t){function n(){var e=t.call(this)||this;return e.type="LineGeometry",e}return e(n,t),n.prototype.setPositions=function(e){for(var n=e.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return t.prototype.setPositions.call(this,i),this},n.prototype.setColors=function(e){for(var n=e.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return t.prototype.setColors.call(this,i),this},n.prototype.fromLine=function(t){var e=t.geometry;if(e instanceof r.Geometry){var n=(new r.BufferGeometry).fromGeometry(e);this.setPositions(n.attributes.position.array)}else e instanceof r.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},n.prototype.copy=function(){return this},n}(o);Object.assign(l.prototype,{isLineGeometry:!0});var f=14467195,d=null,p=function(t){function n(e,n){void 0===e&&(e=new r.Vector3),void 0===n&&(n=new r.Vector3);var i=t.call(this)||this;i.type="FiveLine",i.needsRender=!0;var o=new l,a=new s({color:f,linewidth:2,dashScale:20,dashed:!1});i.line=new c(o,a);var u=new r.BufferGeometry,p=new r.PointsMaterial({color:f,size:8,map:d||(d=(new r.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==")),sizeAttenuation:!1,transparent:!0});return i.points=new r.Points(u,p),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,n),i.add(i.line,i.points),i}return e(n,t),Object.defineProperty(n,"version",{get:function(){return"5.0.0-alpha.186"},enumerable:!1,configurable:!0}),n.prototype.setPoints=function(t,e){var n=[].concat(t.toArray(),e.toArray());this.points.geometry.setAttribute("position",new r.BufferAttribute(new Float32Array(n),3)),this.line.geometry.setPositions(n),this.line.computeLineDistances(),this.needsRender=!0},n.prototype.getPoints=function(){var t=this.points.geometry.attributes.position.array;return[new r.Vector3(t[0],t[1],t[2]),new r.Vector3(t[3],t[4],t[5])]},n.prototype.setMaterial=function(t){var e=this.line.material;for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];"dashed"===n?(e.dashed=i,i?e.defines.USE_DASH="":delete e.defines.USE_DASH,e.needsUpdate=!0):e[n]=t[n]}this.needsRender=!0},n.prototype.setResolution=function(t,e){var n=this.line.material.resolution;n.x===t&&n.y===e||(n.set(t,e),this.needsRender=!0)},n}(r.Object3D);Object.assign(p.prototype,{isFiveLine:!0})})(),i})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FiveSDK_Line=e():t.FiveSDK_Line=e()}(self,(()=>(()=>{var t={438:t=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const e=Number(THREE.REVISION);if(e<115||e>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');t.exports=window.THREE}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{Line:()=>p,LineGeometry:()=>l,LineMaterial:()=>s,LineSegmentsGeometry:()=>o,THREE_Line2:()=>c,THREE_LineSegments2:()=>u});var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}Object.create,Object.create;var r=n(438),o=function(t){function n(){var e=t.call(this)||this;return e.type="LineSegmentsGeometry",e.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),e.setAttribute("position",new r.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),e.setAttribute("uv",new r.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),e}return e(n,t),n.prototype.applyMatrix4=function(t){var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},n.prototype.setPositions=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var n=new r.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new r.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},n.prototype.setColors=function(t){var e;e=t instanceof Float32Array?t:Array.isArray(t)?new Float32Array(t):new Float32Array;var n=new r.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceColorStart",new r.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new r.InterleavedBufferAttribute(n,3,3)),this},n.prototype.fromWireframeGeometry=function(t){return this.setPositions(t.attributes.position.array),this},n.prototype.fromEdgesGeometry=function(t){return this.setPositions(t.attributes.position.array),this},n.prototype.fromMesh=function(t){return this.fromWireframeGeometry(new r.WireframeGeometry(t.geometry)),this},n.prototype.fromLineSegments=function(t){var e=t.geometry;if(e instanceof r.Geometry){var n=(new r.BufferGeometry).fromGeometry(e);this.setPositions(n.attributes.position.array)}else e instanceof r.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},n.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new r.Box3);var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=new r.Box3;this.boundingBox.setFromBufferAttribute(t),n.setFromBufferAttribute(e),this.boundingBox.union(n)}},n.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new r.Sphere),null===this.boundingBox&&this.computeBoundingBox();var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=this.boundingSphere.center;this.boundingBox.getCenter(n);for(var i=0,o=new r.Vector3,a=0,s=t.count;a<s;a++)o.fromBufferAttribute(t,a),i=Math.max(i,n.distanceToSquared(o)),o.fromBufferAttribute(e,a),i=Math.max(i,n.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},n.prototype.toJSON=function(){},n}(r.InstancedBufferGeometry);Object.assign(o.prototype,{isLineSegmentsGeometry:!0});var a={uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new r.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"},s=function(t){function n(e){var n=t.call(this,{uniforms:r.UniformsUtils.clone(a.uniforms),vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,clipping:!0})||this;return n.type="LineMaterial",n.dashed=!1,Object.defineProperties(n,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),n.setValues(e),n}return e(n,t),n}(r.ShaderMaterial);Object.assign(s.prototype,{isLineMaterial:!0});var u=function(t){function n(e,n){var i=t.call(this)||this;return i.type="LineSegments2",i.geometry=void 0!==e?e:new o,i.material=void 0!==n?n:new s({color:16777215*Math.random()}),i}return e(n,t),n.prototype.computeLineDistances=function(){for(var t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.count),o=new r.Vector3,a=new r.Vector3,s=0,u=0,c=e.count;s<c;s++,u+=2)o.fromBufferAttribute(e,s),a.fromBufferAttribute(n,s),i[u]=0===u?0:i[u-1],i[u+1]=i[u]+o.distanceTo(a);var l=new r.InstancedInterleavedBuffer(i,2,1);return t.setAttribute("instanceDistanceStart",new r.InterleavedBufferAttribute(l,1,0)),t.setAttribute("instanceDistanceEnd",new r.InterleavedBufferAttribute(l,1,1)),this},n.prototype.raycast=function(t,e){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var n=t.ray,i=t.camera,o=i.projectionMatrix,a=this.geometry,s=this.material,u=s.resolution,c=s.linewidth,l=a.attributes.instanceStart,f=a.attributes.instanceEnd,d=new r.Vector4,p=new r.Vector4,m=new r.Vector4,v=new r.Vector3,h=new r.Matrix4,y=new r.Line3,A=new r.Vector3;n.at(1,m),m.w=1,m.applyMatrix4(i.matrixWorldInverse),m.applyMatrix4(o),m.multiplyScalar(1/m.w),m.x*=u.x/2,m.y*=u.y/2,m.z=0,v.copy(m);var g=this.matrixWorld;h.multiplyMatrices(i.matrixWorldInverse,g);for(var b=0,w=l.count;b<w;b++){d.fromBufferAttribute(l,b),p.fromBufferAttribute(f,b),d.w=1,p.w=1,d.applyMatrix4(h),p.applyMatrix4(h),d.applyMatrix4(o),p.applyMatrix4(o),d.multiplyScalar(1/d.w),p.multiplyScalar(1/p.w);var S=d.z<-1&&p.z<-1,x=d.z>1&&p.z>1;if(!S&&!x){d.x*=u.x/2,d.y*=u.y/2,p.x*=u.x/2,p.y*=u.y/2,y.start.copy(d),y.start.z=0,y.end.copy(p),y.end.z=0;var E=y.closestPointToPointParameter(v,!0);y.at(E,A);var B=r.MathUtils.lerp(d.z,p.z,E),P=B>=-1&&B<=1,M=v.distanceTo(A)<.5*c;if(P&&M){y.start.fromBufferAttribute(l,b),y.end.fromBufferAttribute(f,b),y.start.applyMatrix4(g),y.end.applyMatrix4(g);var z=new r.Vector3,L=new r.Vector3;n.distanceSqToSegment(y.start,y.end,L,z),e.push({point:L,pointOnLine:z,distance:n.origin.distanceTo(L),object:this,faceIndex:b})}}}},n}(r.Mesh);Object.assign(u.prototype,{isLineSegments2:!0});var c=function(t){function n(e,n){var i=t.call(this,e,n)||this;return i.type="Line2",i}return e(n,t),n}(u);Object.assign(c.prototype,{isLine2:!0});var l=function(t){function n(){var e=t.call(this)||this;return e.type="LineGeometry",e}return e(n,t),n.prototype.setPositions=function(e){for(var n=e.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return t.prototype.setPositions.call(this,i),this},n.prototype.setColors=function(e){for(var n=e.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return t.prototype.setColors.call(this,i),this},n.prototype.fromLine=function(t){var e=t.geometry;if(e instanceof r.Geometry){var n=(new r.BufferGeometry).fromGeometry(e);this.setPositions(n.attributes.position.array)}else e instanceof r.BufferGeometry&&this.setPositions(e.attributes.position.array);return this},n.prototype.copy=function(){return this},n}(o);Object.assign(l.prototype,{isLineGeometry:!0});var f=14467195,d=null,p=function(t){function n(e,n){void 0===e&&(e=new r.Vector3),void 0===n&&(n=new r.Vector3);var i=t.call(this)||this;i.type="FiveLine",i.needsRender=!0;var o=new l,a=new s({color:f,linewidth:2,dashScale:20,dashed:!1});i.line=new c(o,a);var u=new r.BufferGeometry,p=new r.PointsMaterial({color:f,size:8,map:d||(d=(new r.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==")),sizeAttenuation:!1,transparent:!0});return i.points=new r.Points(u,p),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,n),i.add(i.line,i.points),i}return e(n,t),Object.defineProperty(n,"version",{get:function(){return"5.0.0-alpha.188"},enumerable:!1,configurable:!0}),n.prototype.setPoints=function(t,e){var n=[].concat(t.toArray(),e.toArray());this.points.geometry.setAttribute("position",new r.BufferAttribute(new Float32Array(n),3)),this.line.geometry.setPositions(n),this.line.computeLineDistances(),this.needsRender=!0},n.prototype.getPoints=function(){var t=this.points.geometry.attributes.position.array;return[new r.Vector3(t[0],t[1],t[2]),new r.Vector3(t[3],t[4],t[5])]},n.prototype.setMaterial=function(t){var e=this.line.material;for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];"dashed"===n?(e.dashed=i,i?e.defines.USE_DASH="":delete e.defines.USE_DASH,e.needsUpdate=!0):e[n]=t[n]}this.needsRender=!0},n.prototype.setResolution=function(t,e){var n=this.line.material.resolution;n.x===t&&n.y===e||(n.set(t,e),this.needsRender=!0)},n}(r.Object3D);Object.assign(p.prototype,{isFiveLine:!0})})(),i})()));
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FiveSDK_Sticker=t():e.FiveSDK_Sticker=t()}(self,(()=>(()=>{var e={438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const t=Number(THREE.REVISION);if(t<115||t>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Sticker:()=>l});var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};Object.create,Object.create;var t=n(438),o=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),i=new Float32Array([0,0,1,0,0,1,1,1]),a=new Uint8Array([0,1,2,1,3,2]),s=new t.BufferGeometry;s.setAttribute("position",new t.BufferAttribute(o,3)),s.setAttribute("uv",new t.BufferAttribute(i,2)),s.setIndex(new t.BufferAttribute(a,1));var p=window,u=p.requestAnimationFrame||p.mozRequestAnimationFrame||p.webkitRequestAnimationFrame||p.msRequestAnimationFrame||function(e){return setTimeout(e,16)},c="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),f="undefined"!=typeof performance?function(){return c+performance.now()}:function(){return Date.now()};function d(e,t){var n=e.dispose;e.dispose=function(){t(),n.call(e)}}var l=function(n){function r(e,r,o){var i,a,p,c,l,m,v=this,y=new t.MeshBasicMaterial;if((v=n.call(this,s,y)||this)._needsRender=!1,v.scale.set(e,r,1),"string"==typeof o){y.transparent=/\.png$/.test(o);var w=new Image;w.src=o,w.crossOrigin="",o=w}if(o instanceof HTMLImageElement){var g=y.map=new t.Texture;g.wrapS=t.ClampToEdgeWrapping,g.wrapT=t.ClampToEdgeWrapping,g.minFilter=t.LinearFilter,g.encoding=t.sRGBEncoding,d(g,function(e,t){e.naturalWidth>0&&u((function(){return t()}));var n=function(){return t()};return e.addEventListener("load",n,!1),function(){return e.removeEventListener("load",n,!1)}}(o,(function(){g.image=o,g.needsUpdate=!0,v._needsRender=!0})))}else if(o instanceof HTMLCanvasElement)y.map=new t.CanvasTexture(o);else if(o instanceof HTMLVideoElement){var b=y.map=new t.VideoTexture(o);b.wrapS=t.ClampToEdgeWrapping,b.wrapT=t.ClampToEdgeWrapping,b.minFilter=t.LinearFilter,b.encoding=t.sRGBEncoding,d(b,(i=o,a=function(){v._needsRender=!0},p=f(),c=!1,l=function(){c=!0,a(),f()-p<3e3?u(l):c=!1},m=function(){p=f(),!1===c&&l()},i.addEventListener("timeupdate",m,!1),function(){i.removeEventListener("timeupdate",m,!1),c=!1}))}return v}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(r,n),Object.defineProperty(r,"version",{get:function(){return"5.0.0-alpha.186"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"needsRender",{get:function(){return this._needsRender},set:function(e){this._needsRender=e,!0===e&&this.material.map&&(this.material.map.needsUpdate=!0)},enumerable:!1,configurable:!0}),r.prototype.setSize=function(e,t){this.scale.set(e,t,1),this._needsRender=!0},r.prototype.setTransparent=function(e){this.material.transparent=e,this._needsRender=!0},r.prototype.locationWithIntersection=function(e,t){void 0===t&&(t=.005);var n=e.point,r=e.face;this.position.copy(n),r&&(this.position.add(r.normal.clone().setLength(t)),this.lookAt(n.clone().add(r.normal))),this._needsRender=!0},r.prototype.dispose=function(){var e;null===(e=this.material.map)||void 0===e||e.dispose(),this.material.dispose()},r}(t.Mesh)})(),r})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FiveSDK_Sticker=t():e.FiveSDK_Sticker=t()}(self,(()=>(()=>{var e={438:e=>{if(!("THREE"in window))throw new Error('"THREE" is not available. Please include "three.js" in your HTML.');const t=Number(THREE.REVISION);if(t<115||t>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');e.exports=window.THREE}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Sticker:()=>l});var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};Object.create,Object.create;var t=n(438),o=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),i=new Float32Array([0,0,1,0,0,1,1,1]),a=new Uint8Array([0,1,2,1,3,2]),s=new t.BufferGeometry;s.setAttribute("position",new t.BufferAttribute(o,3)),s.setAttribute("uv",new t.BufferAttribute(i,2)),s.setIndex(new t.BufferAttribute(a,1));var p=window,u=p.requestAnimationFrame||p.mozRequestAnimationFrame||p.webkitRequestAnimationFrame||p.msRequestAnimationFrame||function(e){return setTimeout(e,16)},c="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),f="undefined"!=typeof performance?function(){return c+performance.now()}:function(){return Date.now()};function d(e,t){var n=e.dispose;e.dispose=function(){t(),n.call(e)}}var l=function(n){function r(e,r,o){var i,a,p,c,l,m,v=this,y=new t.MeshBasicMaterial;if((v=n.call(this,s,y)||this)._needsRender=!1,v.scale.set(e,r,1),"string"==typeof o){y.transparent=/\.png$/.test(o);var w=new Image;w.src=o,w.crossOrigin="",o=w}if(o instanceof HTMLImageElement){var g=y.map=new t.Texture;g.wrapS=t.ClampToEdgeWrapping,g.wrapT=t.ClampToEdgeWrapping,g.minFilter=t.LinearFilter,g.encoding=t.sRGBEncoding,d(g,function(e,t){e.naturalWidth>0&&u((function(){return t()}));var n=function(){return t()};return e.addEventListener("load",n,!1),function(){return e.removeEventListener("load",n,!1)}}(o,(function(){g.image=o,g.needsUpdate=!0,v._needsRender=!0})))}else if(o instanceof HTMLCanvasElement)y.map=new t.CanvasTexture(o);else if(o instanceof HTMLVideoElement){var b=y.map=new t.VideoTexture(o);b.wrapS=t.ClampToEdgeWrapping,b.wrapT=t.ClampToEdgeWrapping,b.minFilter=t.LinearFilter,b.encoding=t.sRGBEncoding,d(b,(i=o,a=function(){v._needsRender=!0},p=f(),c=!1,l=function(){c=!0,a(),f()-p<3e3?u(l):c=!1},m=function(){p=f(),!1===c&&l()},i.addEventListener("timeupdate",m,!1),function(){i.removeEventListener("timeupdate",m,!1),c=!1}))}return v}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(r,n),Object.defineProperty(r,"version",{get:function(){return"5.0.0-alpha.188"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"needsRender",{get:function(){return this._needsRender},set:function(e){this._needsRender=e,!0===e&&this.material.map&&(this.material.map.needsUpdate=!0)},enumerable:!1,configurable:!0}),r.prototype.setSize=function(e,t){this.scale.set(e,t,1),this._needsRender=!0},r.prototype.setTransparent=function(e){this.material.transparent=e,this._needsRender=!0},r.prototype.locationWithIntersection=function(e,t){void 0===t&&(t=.005);var n=e.point,r=e.face;this.position.copy(n),r&&(this.position.add(r.normal.clone().setLength(t)),this.lookAt(n.clone().add(r.normal))),this._needsRender=!0},r.prototype.dispose=function(){var e;null===(e=this.material.map)||void 0===e||e.dispose(),this.material.dispose()},r}(t.Mesh)})(),r})()));